Skip to content

Commit

Permalink
Merging 3.2.4 changes - fixes #435, #433, #432, #404
Browse files Browse the repository at this point in the history
  • Loading branch information
dioslaska committed Aug 22, 2017
1 parent 9a946ad commit 1c6ba1f
Show file tree
Hide file tree
Showing 26 changed files with 861 additions and 61 deletions.
36 changes: 20 additions & 16 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
{
"parser": "babel-eslint",
"plugins": [
"react"
],
"extends": ["eslint:recommended", "plugin:react/recommended"],
"rules": {
"react/no-find-dom-node": 0,
"react/prop-types": 0,
"react/react-in-jsx-scope": 0,
"react/display-name": 0
},
"globals": {
"mobiscroll": true,
"React": true,
"ReactDOM": true
}
"parser": "babel-eslint",
"plugins": [
"react"
],
"extends": ["eslint:recommended", "plugin:react/recommended"],
"rules": {
"react/no-find-dom-node": 0,
"react/prop-types": 0,
"react/react-in-jsx-scope": 0,
"react/display-name": 0
},
"globals": {
"mobiscroll": true,
"React": true,
"ReactDOM": true
},
"env": {
"browser": true,
"node": true
}
}
3 changes: 1 addition & 2 deletions bundles/mobiscroll.angular.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
import { mobiscroll, MbscModule } from '../src/js/modules/mobiscroll.angular.free';
export * from '../src/js/modules/mobiscroll.angular.free';
import './mobiscroll.common';
export { mobiscroll, MbscModule };
4 changes: 2 additions & 2 deletions bundles/mobiscroll.angular.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 1 addition & 10 deletions bundles/mobiscroll.angular.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@
import {
mobiscroll,
MbscModule
} from '../src/js/modules/mobiscroll.angular.free';

export * from '../src/js/modules/mobiscroll.angular.free';
import './mobiscroll.common';

export {
mobiscroll,
MbscModule
};
10 changes: 10 additions & 0 deletions bundles/mobiscroll.common.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
// Languages
import '../src/js/i18n/ar';
import '../src/js/i18n/bg';
import '../src/js/i18n/ca';
import '../src/js/i18n/cs';
import '../src/js/i18n/da';
import '../src/js/i18n/de';
import '../src/js/i18n/el';
import '../src/js/i18n/en-UK';
import '../src/js/i18n/es';
import '../src/js/i18n/fa';
import '../src/js/i18n/fi';
import '../src/js/i18n/fr';
import '../src/js/i18n/he';
import '../src/js/i18n/hi';
import '../src/js/i18n/hr';
import '../src/js/i18n/hu';
import '../src/js/i18n/it';
import '../src/js/i18n/ja';
import '../src/js/i18n/ko';
import '../src/js/i18n/lt';
import '../src/js/i18n/nl';
import '../src/js/i18n/no';
Expand All @@ -20,8 +28,10 @@ import '../src/js/i18n/ro';
import '../src/js/i18n/ru-UA';
import '../src/js/i18n/ru';
import '../src/js/i18n/sk';
import '../src/js/i18n/sr';
import '../src/js/i18n/sv';
import '../src/js/i18n/tr';
import '../src/js/i18n/vi';
import '../src/js/i18n/zh';

// Themes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"grunt-contrib-jshint": "^1.1.0",
"grunt-contrib-less": "^1.4.0",
"grunt-eslint": "^19.0.0",
"grunt-rollup": "^1.0.1",
"grunt-rollup": "^2.0.1",
"grunt-run": "^0.7.0",
"less": "^2.7.2",
"load-grunt-config": "^0.19.2",
Expand Down
8 changes: 3 additions & 5 deletions src/js/classes/slider-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,18 +239,16 @@ const SliderBase = function (elm, settings, inherit) {
}

// Check if value changed
if (oldValue[index] != v) {
if (fill && oldValue[index] != v) {
changed = true;

oldValue[index] = v;

// Store new value
value[index] = v;

if (fill) {
// Set new value to the input
that._fillValue(v, index, change);
}
// Set new value to the input
that._fillValue(v, index, change);
}

$handle.attr('aria-valuenow', v);
Expand Down
137 changes: 136 additions & 1 deletion src/js/core/core.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,139 @@
import mobiscroll from './mobiscroll';
export default mobiscroll;
export const $: any;
export const extend: any;
export const extend: any;

export interface MbscCoreOptions {
// Settings
theme?: string;
lang?: string;
rtl?: boolean;

// Events
onInit?(event: any, inst: any): void;
onDestroy?(event: any, inst: any): void;
}

export interface MbscFrameOptions extends MbscCoreOptions {
// Settings
anchor?: string | HTMLElement;
animate?: boolean | 'fade' | 'flip' | 'pop' | 'swing' | 'slidevertical' | 'slidehorizontal' | 'slidedown' | 'slideup';
buttons?: Array<any>;
closeOnOverlayTap?: boolean;
context?: string | HTMLElement;
disabled?: boolean;
display?: 'top' | 'bottom' | 'bubble' | 'inline' | 'center';
focusOnClose?: boolean | string | HTMLElement;
focusTrap?: boolean;
headerText?: string | boolean | ((formattedValue: string) => string);
showOnFocus?: boolean;
showOnTap?: boolean;

// Events
onBeforeClose?(event: { valueText: string, button: string }, inst: any): void;
onBeforeShow?(event: any, inst: any): void;
onCancel?(event: { valuteText: string }, inst: any): void;
onClose?(event: { valueText: string }, inst: any): void;
onDestroy?(event: any, inst: any): void;
onFill?(event: any, inst: any): void;
onMarkupReady?(event: { target: HTMLElement }, inst: any): void;
onPosition?(event: { target: HTMLElement, windowWidth: number, windowHeight: number }, inst: any): void;
onShow?(event: { target: HTMLElement, valueText: string }, inst: any): void;
}

export interface MbscScrollerOptions extends MbscFrameOptions {
// Settings
circular?: boolean | Array<boolean>;
height?: number;
layout?: 'liquid' | 'fixed';
maxWidth?: number | Array<number>;
minWidth?: number | Array<number>;
multiline?: number;
readOnly?: boolean | Array<boolean>;
rows?: number;
showLabel?: boolean;
showScrollArrows?: boolean;
wheels?: Array<any>;
width?: number;

// Events
onChange?(event: { valueText?: string }, inst: any): void;
validate?(data: { values: Array<any>, index: number, direction: number }, inst: any): (void | { disabled?: Array<any>, valid?: Array<any> });
onSet?(event: { valueText?: string }, inst: any): void;
onItemTap?(event: any, inst: any): void;
onClear?(event: any, inst: any): void;

// localization
cancelText?: string;
clearText?: string;
selectedText?: string;
setText?: string;
}

export interface MbscDataControlOptions {
select?: 'single' | 'multiple' | number;
}

export type MbscDataFrameOptions = MbscDataControlOptions & MbscFrameOptions;

export interface MbscDatetimeOptions extends MbscScrollerOptions {
// Settings
defaultValue?: Date | Array<Date>;
invalid?: Array<string | { start: Date, end: Date, d?: string } | Date>;
max?: Date;
min?: Date;
steps?: { hour?: number, minute?: number, second?: number, zeroBased?: boolean };
valid?: Array<string | { start: Date, end: Date, d?: string } | Date>;

// localization
ampmText?: string;
amText?: string;
dateFormat?: string;
dateWheels?: string;
dayNames?: Array<string>;
dayNamesShort?: Array<string>;
dayText?: string;
hourText?: string;
minuteText?: string;
monthNames?: Array<string>;
monthNamesShort?: Array<string>;
monthSuffix?: string;
monthText?: string;
nowText?: string;
pmText?: string;
secText?: string;
timeFormat?: string;
timeWheels?: string;
yearSuffix?: string;
yearText?: string;
}

export interface MbscCalbaseOptions extends MbscDatetimeOptions {
// Settings
calendarHeight?: number;
calendarWidth?: number;
calendarScroll?: 'horizontal' | 'vertical';
counter?: boolean;
defaultValue?: Date | Array<Date>;
months?: number | 'auto';
outerMonthChange?: boolean;
showOuterDays?: boolean;
tabs?: boolean;
weekCounter?: 'year' | 'month';
weekDays?: 'full' | 'short' | 'min';
yearChange?: boolean;

// localization
calendarText?: string;
dateText?: string;
dayNamesMin?: Array<string>;
firstDay?: number;
timeText?: string;

// Events
onTabChange?(event: { tab: 'calendar' | 'date' | 'time' }, inst: any): void;
onDayChange?(event: { date: Date, marked?: any, selected?: 'start' | 'end', target: HTMLElement }, inst: any): void;
onMonthChange?(event: { year: number, month: number }, inst: any): void;
onMonthLoading?(event: { year: number, month: number }, inst: any): void;
onMonthLoaded?(event: { year: number, month: number }, inst: any): void;
}
4 changes: 2 additions & 2 deletions src/js/core/core.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Mobiscroll v3.2.3
* Mobiscroll v3.2.4
* http://mobiscroll.com
*
* Copyright 2010-2016, Acid Media
Expand Down Expand Up @@ -64,7 +64,7 @@ if (isBrowser) {

ms = extend(mobiscroll, {
$: $,
version: '3.2.3',
version: '3.2.4',
util: {
prefix: prefix,
jsPrefix: pr,
Expand Down
27 changes: 22 additions & 5 deletions src/js/forms.angular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ import Radio from './classes/radio';
import SegmentedItem from './classes/segmented';
import Slider from './classes/slider';

import { MbscCoreOptions } from './core/core';

export interface MbscFormOptions extends MbscCoreOptions {}


@Injectable()
export class MbscFormService {
private _options: any;
Expand All @@ -56,7 +61,7 @@ export class MbscFormService {
})
export class MbscForm extends MbscBase implements OnInit {
@Input('options')
options: any;
options: MbscFormOptions;

@ViewChild('rootElement')
rootElem: ElementRef;
Expand Down Expand Up @@ -85,7 +90,7 @@ export class MbscFormBase extends MbscBase implements OnInit {
* Input for the control options
*/
@Input()
options: any;
options: MbscFormOptions;

/**
* Input for the disabled state of the control
Expand Down Expand Up @@ -132,13 +137,13 @@ export class MbscFormValueBase extends MbscFormBase implements ControlValueAcces
* This function propagates the value to the model
* It's overwrittem in registerOnChange (if formControl is used)
*/
protected onChange: any = () => { };
onChange: any = () => { };

/**
* This function has to be called when the control is touched, to notify the validators (if formControl is used)
* It's overwritter in registerOnTouched
*/
protected onTouch: any = () => { };
onTouch: any = () => { };

/**
* Input for the value. Used when no ngModel is present.
Expand Down Expand Up @@ -494,6 +499,9 @@ export class MbscCheckbox extends MbscFormValueBase {
export class MbscSwitch extends MbscControlBase implements OnInit {
protected _inheritedOptions: any;

@Input('options')
options: MbscFormOptions;

@Input()
disabled: boolean = false;

Expand Down Expand Up @@ -571,6 +579,9 @@ export class MbscSwitch extends MbscControlBase implements OnInit {
export class MbscStepper extends MbscControlBase implements OnInit {
protected _inheritedOptions: any;

@Input('options')
options: MbscFormOptions;

@Input()
set value(v: number) {
this.setNewValueProxy(v);
Expand Down Expand Up @@ -666,6 +677,9 @@ export class MbscStepper extends MbscControlBase implements OnInit {
export class MbscProgress extends MbscControlBase implements OnInit {
protected _inheritedOptions: any;

@Input('options')
options: MbscFormOptions;

@Input()
set value(v: number) {
this.setNewValueProxy(v);
Expand Down Expand Up @@ -1003,7 +1017,10 @@ export class MbscSlider extends MbscControlBase {

protected _inheritedOptions: any;

protected _needsTimeout: boolean = false;
_needsTimeout: boolean = false;

@Input('options')
options: MbscFormOptions;

@Input()
tooltip: boolean;
Expand Down
Loading

0 comments on commit 1c6ba1f

Please sign in to comment.