Skip to content

Commit

Permalink
Merging 3.2.3 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dioslaska committed Jul 28, 2017
1 parent a9fe06d commit 9a946ad
Show file tree
Hide file tree
Showing 24 changed files with 777 additions and 664 deletions.
7 changes: 5 additions & 2 deletions grunt/babel.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
module.exports = {
options: {
babelrc: false,
plugins: [
'transform-react-jsx',
'transform-object-rest-spread',
'transform-es2015-destructuring'
'transform-es2015-destructuring',
"transform-decorators-legacy",
"transform-class-properties"
]
},
dist: {
Expand All @@ -13,4 +16,4 @@ module.exports = {
'src/js/page.react.js': 'src/js/page.react.jsx'
}
}
};
};
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
"babel-helpers": "^6.22.0",
"babel-install": "2.1.0",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-es2015-destructuring": "^6.19.0",
"babel-plugin-transform-object-rest-spread": "^6.20.0",
"babel-plugin-transform-react-jsx": "^6.8.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mobiscroll-angular",
"version": "3.2.2",
"version": "3.2.3",
"description": "Angular UI library for progressive web and hybrid apps",
"homepage": "https://mobiscroll.com/",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/angularjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mobiscroll-angularjs",
"version": "3.2.2",
"version": "3.2.3",
"description": "AngularJS UI library for progressive web and hybrid apps",
"homepage": "https://mobiscroll.com/",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/javascript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mobiscroll-javascript",
"version": "3.2.2",
"version": "3.2.3",
"description": "Framework agnostic UI library for progressive web and hybrid apps",
"homepage": "https://mobiscroll.com/",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/jquery/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mobiscroll-jquery",
"version": "3.2.2",
"version": "3.2.3",
"description": "jQuery and jQuery Mobile UI library for progressive web and hybrid apps",
"homepage": "https://mobiscroll.com/",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/knockout/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mobiscroll-knockout",
"version": "3.2.2",
"version": "3.2.3",
"description": "Knockout UI library for progressive web and hybrid apps",
"homepage": "https://mobiscroll.com/",
"license": "Apache-2.0",
Expand Down
7 changes: 4 additions & 3 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mobiscroll-react",
"version": "3.2.2",
"version": "3.2.3",
"description": "React UI library for progressive web and hybrid apps",
"homepage": "https://mobiscroll.com/",
"license": "Apache-2.0",
Expand Down Expand Up @@ -37,7 +37,8 @@
"dist/css/icons_mobiscroll.woff"
],
"dependencies": {
"react": ">=0.13.0",
"react-dom": ">=0.13.0"
"react": ">=15.3.0",
"react-dom": ">=15.3.0",
"prop-types": ">=15.5.0"
}
}
2 changes: 1 addition & 1 deletion src/js/classes/form-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function getRipple(theme) {
class FormControl {
constructor(elm, settings) {

const s = extend({}, defaults, settings);
const s = extend({}, defaults, mobiscroll.settings, settings);
const $elm = $(elm);
const $p = $elm.parent();
const $parent = $p.hasClass('mbsc-input-wrap') ? $p.parent() : $p;
Expand Down
2 changes: 2 additions & 0 deletions src/js/classes/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,8 @@ const Frame = function (el, settings, inherit) {

hasButtons = buttons.length > 0;

touched = false;

if (doAnim !== false) {
if (s.display == 'top') {
doAnim = doAnim || 'slidedown';
Expand Down
1 change: 1 addition & 0 deletions src/js/classes/progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ Progress.prototype = {
_css: 'mbsc-progress',
_hasTheme: true,
_hasLang: true,
_hasDef: true,
_defaults: {
min: 0,
max: 100,
Expand Down
18 changes: 14 additions & 4 deletions src/js/classes/slider-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const SliderBase = function (elm, settings, inherit) {
min,
moved,
multiple,
oldValue,
step,
s,
scale,
Expand Down Expand Up @@ -223,7 +224,7 @@ const SliderBase = function (elm, settings, inherit) {
}

if (that._update) {
that._update(v, value, index, percent, multiple, refresh, $handleCont);
v = that._update(v, value, index, percent, multiple, refresh, $handleCont);
} else {
$handleCont.css({
left: isRtl ? 'auto' : (percent || getPercent(v)) + '%',
Expand All @@ -238,14 +239,18 @@ const SliderBase = function (elm, settings, inherit) {
}

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

oldValue[index] = v;

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

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

$handle.attr('aria-valuenow', v);
Expand Down Expand Up @@ -288,6 +293,7 @@ const SliderBase = function (elm, settings, inherit) {
multiple = $elm.length > 1;
isRtl = s.rtl;
value = [];
oldValue = [];

// Read values
$elm.each(function (i) {
Expand Down Expand Up @@ -357,6 +363,10 @@ const SliderBase = function (elm, settings, inherit) {
val = [val];
}

$.each(val, function (i, v) {
value[i] = v;
});

$.each(val, function (i, v) {
updateValue(v, i, true, false, true, change);
});
Expand Down
4 changes: 4 additions & 0 deletions src/js/classes/slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ const Slider = function (elm, settings, inherit) {
if (!multiple && (value[index] != v || refresh)) {
that._display(v);
}

// Return validated value
return v;
};

that._readValue = function ($elm) {
Expand Down Expand Up @@ -168,6 +171,7 @@ Slider.prototype = {
_css: 'mbsc-progress mbsc-slider',
_hasTheme: true,
_hasLang: true,
_hasDef: true,
_defaults: {
changeEvent: 'change',
stopProp: true,
Expand Down
3 changes: 2 additions & 1 deletion src/js/classes/stepper.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ const Stepper = function (control, settings) {
displayValue = $control.attr('data-val') || s.val;
val = Math.min(max, Math.max(Math.round(+control.value / step) * step || 0, min));

theme = mobiscroll.themes.form[settings.theme];
theme = mobiscroll.themes.form[s.theme];
ripple = theme && theme.addRipple ? theme : null;

if (!ready) {
Expand Down Expand Up @@ -292,6 +292,7 @@ const Stepper = function (control, settings) {

Stepper.prototype = {
_class: 'stepper',
_hasDef: true,
_defaults: {
min: 0,
max: 100,
Expand Down
1 change: 1 addition & 0 deletions src/js/classes/switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Switch.prototype = {
_css: 'mbsc-switch',
_hasTheme: true,
_hasLang: true,
_hasDef: true,
_defaults: {
stopProp: true,
offText: 'Off',
Expand Down
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.2
* Mobiscroll v3.2.3
* http://mobiscroll.com
*
* Copyright 2010-2016, Acid Media
Expand Down Expand Up @@ -64,7 +64,7 @@ if (isBrowser) {

ms = extend(mobiscroll, {
$: $,
version: '3.2.2',
version: '3.2.3',
util: {
prefix: prefix,
jsPrefix: pr,
Expand Down
24 changes: 22 additions & 2 deletions src/js/forms.angular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ export class MbscInputBase extends MbscFormValueBase {

@Component({
selector: 'mbsc-input',
host: { 'class': 'mbsc-control-ng' },
template: `
<label [class.mbsc-err]="error">
<ng-content></ng-content>
Expand Down Expand Up @@ -283,6 +284,7 @@ export class MbscInput extends MbscInputBase {

@Component({
selector: 'mbsc-textarea',
host: { 'class': 'mbsc-control-ng' },
template: `
<label [class.mbsc-err]="error">
<ng-content></ng-content>
Expand Down Expand Up @@ -317,6 +319,7 @@ export class MbscTextarea extends MbscInputBase {

@Component({
selector: 'mbsc-dropdown',
host: { 'class': 'mbsc-control-ng' },
template: `
<label [class.mbsc-err]="error">
{{label}}
Expand Down Expand Up @@ -446,6 +449,7 @@ export class MbscButton extends MbscFormBase {

@Component({
selector: 'mbsc-checkbox',
host: { 'class': 'mbsc-control-ng' },
template: `
<label>
<input #initElement
Expand Down Expand Up @@ -473,6 +477,7 @@ export class MbscCheckbox extends MbscFormValueBase {

@Component({
selector: 'mbsc-switch',
host: { 'class': 'mbsc-control-ng' },
template: `
<label>
<ng-content></ng-content>
Expand Down Expand Up @@ -542,10 +547,14 @@ export class MbscSwitch extends MbscControlBase implements OnInit {
}
}

/**
* Note on the template: Wrapper needs to be a div (instead of label) - not to fire click events twice
*/
@Component({
selector: 'mbsc-stepper',
host: { 'class': 'mbsc-control-ng' },
template: `
<label>
<div>
<ng-content></ng-content>
<input #initElement
data-role="stepper"
Expand All @@ -555,7 +564,7 @@ export class MbscSwitch extends MbscControlBase implements OnInit {
[attr.step]="step !== undefined ? step : null"
[attr.data-val]="val ? val : null"
[disabled]="disabled" />
</label>
</div>
`,
exportAs: 'mobiscroll'
})
Expand Down Expand Up @@ -638,6 +647,7 @@ export class MbscStepper extends MbscControlBase implements OnInit {

@Component({
selector: 'mbsc-progress',
host: { 'class': 'mbsc-control-ng' },
template: `
<label>
<ng-content></ng-content>
Expand Down Expand Up @@ -803,6 +813,7 @@ export class MbscRadioGroup extends MbscRadioGroupBase {

@Component({
selector: 'mbsc-radio',
host: { 'class': 'mbsc-control-ng' },
template: `
<label>
<input #initElement
Expand Down Expand Up @@ -951,12 +962,14 @@ export class MbscSegmented extends MbscFormBase {

@Component({
selector: 'mbsc-slider',
host: { 'class': 'mbsc-control-ng' },
template: `
<label>
<ng-content></ng-content>
<input #inputElements *ngFor="let v of dummyArray"
type="range"
[disabled]="disabled"
[attr.value]="dummyArray.length > 1 ? initialValue[v]: initialValue"
[attr.data-step-labels]="stepLabels"
[attr.data-template]="valueTemplate"
[attr.data-tooltip]="tooltip ? 'true' : null"
Expand Down Expand Up @@ -1097,6 +1110,13 @@ export class MbscSlider extends MbscControlBase {
ngAfterViewInit() {
super.ngAfterViewInit();

// handle change for each input (when multi value)
this.inputElements.forEach((input, index) => {
if (index) {
this.handleChange(input.nativeElement);
}
});

let options = extend({}, this._inheritedOptions, this.options);
this._instance = new Slider(this.inputElements.first.nativeElement, options);

Expand Down
Loading

0 comments on commit 9a946ad

Please sign in to comment.