fomantic-ui 2.9.1-beta.23 → 2.9.1-beta.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslint/eqeqeq-rule.js +18 -0
- package/.eslint/index.js +26 -0
- package/.eslint/no-extra-parens-rule.js +17 -0
- package/.eslint/package.json +11 -0
- package/.eslintrc.js +7 -13
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +24 -24
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +2 -2
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +58 -58
- package/dist/components/api.min.js +2 -2
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +1 -1
- package/dist/components/button.min.css +1 -1
- package/dist/components/calendar.css +1 -1
- package/dist/components/calendar.js +84 -72
- package/dist/components/calendar.min.css +1 -1
- package/dist/components/calendar.min.js +2 -2
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +1 -1
- package/dist/components/checkbox.js +17 -17
- package/dist/components/checkbox.min.css +1 -1
- package/dist/components/checkbox.min.js +2 -2
- package/dist/components/comment.css +1 -1
- package/dist/components/comment.min.css +1 -1
- package/dist/components/container.css +1 -1
- package/dist/components/container.min.css +1 -1
- package/dist/components/dimmer.css +1 -1
- package/dist/components/dimmer.js +18 -18
- package/dist/components/dimmer.min.css +1 -1
- package/dist/components/dimmer.min.js +2 -2
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +1 -1
- package/dist/components/dropdown.js +264 -254
- package/dist/components/dropdown.min.css +1 -1
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +19 -19
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- package/dist/components/feed.css +1 -1
- package/dist/components/feed.min.css +1 -1
- package/dist/components/flag.css +1 -1
- package/dist/components/flag.min.css +1 -1
- package/dist/components/flyout.css +1 -1
- package/dist/components/flyout.js +29 -25
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +1 -1
- package/dist/components/form.js +158 -141
- package/dist/components/form.min.css +1 -1
- package/dist/components/form.min.js +2 -2
- package/dist/components/grid.css +1 -1
- package/dist/components/grid.min.css +1 -1
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +1 -1
- package/dist/components/icon.min.css +1 -1
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +1 -1
- package/dist/components/input.min.css +1 -1
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +1 -1
- package/dist/components/label.min.css +1 -1
- package/dist/components/list.css +1 -1
- package/dist/components/list.min.css +1 -1
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +32 -28
- package/dist/components/modal.min.css +1 -1
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +10 -10
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +2 -2
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +1 -1
- package/dist/components/popup.js +79 -71
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +40 -42
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +2 -2
- package/dist/components/rail.css +1 -1
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +1 -1
- package/dist/components/rating.js +13 -13
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +2 -2
- package/dist/components/reset.css +1 -1
- package/dist/components/reset.min.css +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +1 -1
- package/dist/components/search.js +42 -42
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +2 -2
- package/dist/components/segment.css +1 -1
- package/dist/components/segment.min.css +1 -1
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +36 -36
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +2 -2
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +29 -29
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +2 -2
- package/dist/components/site.css +1 -1
- package/dist/components/site.js +16 -16
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.js +79 -58
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +14 -14
- package/dist/components/state.min.js +2 -2
- package/dist/components/statistic.css +1 -1
- package/dist/components/statistic.min.css +1 -1
- package/dist/components/step.css +1 -1
- package/dist/components/step.min.css +1 -1
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +25 -25
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +2 -2
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +34 -34
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +2 -2
- package/dist/components/table.css +1 -1
- package/dist/components/table.min.css +1 -1
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +1 -1
- package/dist/components/toast.js +43 -19
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +26 -26
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +29 -29
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +50 -50
- package/dist/semantic.js +1218 -1120
- package/dist/semantic.min.css +1 -1
- package/dist/semantic.min.js +2 -2
- package/gulpfile.js +1 -1
- package/package.json +2 -1
- package/scripts/nightly-version.js +3 -1
- package/src/definitions/behaviors/api.js +57 -57
- package/src/definitions/behaviors/form.js +157 -140
- package/src/definitions/behaviors/state.js +13 -13
- package/src/definitions/behaviors/visibility.js +28 -28
- package/src/definitions/globals/site.js +15 -15
- package/src/definitions/modules/accordion.js +23 -23
- package/src/definitions/modules/calendar.js +83 -71
- package/src/definitions/modules/checkbox.js +16 -16
- package/src/definitions/modules/dimmer.js +17 -17
- package/src/definitions/modules/dropdown.js +263 -253
- package/src/definitions/modules/embed.js +18 -18
- package/src/definitions/modules/flyout.js +28 -24
- package/src/definitions/modules/modal.js +31 -27
- package/src/definitions/modules/nag.js +9 -9
- package/src/definitions/modules/popup.js +78 -70
- package/src/definitions/modules/progress.js +39 -41
- package/src/definitions/modules/rating.js +12 -12
- package/src/definitions/modules/search.js +41 -41
- package/src/definitions/modules/shape.js +35 -35
- package/src/definitions/modules/sidebar.js +28 -28
- package/src/definitions/modules/slider.js +78 -57
- package/src/definitions/modules/sticky.js +24 -24
- package/src/definitions/modules/tab.js +33 -33
- package/src/definitions/modules/toast.js +42 -18
- package/src/definitions/modules/transition.js +25 -25
- package/tasks/admin/components/create.js +1 -1
- package/tasks/admin/components/init.js +2 -2
- package/tasks/admin/components/update.js +4 -4
- package/tasks/admin/distributions/create.js +6 -7
- package/tasks/admin/distributions/init.js +2 -2
- package/tasks/admin/distributions/update.js +4 -4
- package/tasks/admin/publish.js +1 -3
- package/tasks/admin/register.js +5 -5
- package/tasks/admin/release.js +1 -3
- package/tasks/build/assets.js +1 -1
- package/tasks/build.js +1 -1
- package/tasks/check-install.js +1 -1
- package/tasks/clean.js +1 -1
- package/tasks/collections/admin.js +1 -1
- package/tasks/collections/rtl.js +1 -1
- package/tasks/config/admin/github.js +3 -4
- package/tasks/config/npm/gulpfile.js +1 -1
- package/tasks/config/project/config.js +10 -8
- package/tasks/config/project/install.js +14 -14
- package/tasks/config/project/release.js +3 -2
- package/tasks/config/tasks.js +4 -4
- package/tasks/config/user.js +5 -3
- package/tasks/docs/build.js +1 -1
- package/tasks/docs/metadata.js +2 -2
- package/tasks/docs/serve.js +2 -1
- package/tasks/install.js +3 -3
- package/tasks/rtl/build.js +1 -3
- package/tasks/rtl/watch.js +1 -3
- package/tasks/version.js +1 -3
- package/tasks/watch.js +1 -1
- package/test/modules/module.spec.js +1 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.1-beta.
|
2
|
+
* # Fomantic-UI 2.9.1-beta.25+bbe4e58 - Slider
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -15,7 +15,7 @@
|
|
15
15
|
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
|
16
16
|
}
|
17
17
|
|
18
|
-
window =
|
18
|
+
window = window !== undefined && window.Math === Math
|
19
19
|
? window
|
20
20
|
: globalThis;
|
21
21
|
|
@@ -31,7 +31,7 @@
|
|
31
31
|
performance = [],
|
32
32
|
|
33
33
|
query = arguments[0],
|
34
|
-
methodInvoked =
|
34
|
+
methodInvoked = typeof query === 'string',
|
35
35
|
queryArguments = [].slice.call(arguments, 1),
|
36
36
|
|
37
37
|
alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'],
|
@@ -51,7 +51,7 @@
|
|
51
51
|
|
52
52
|
$allModules.each(function () {
|
53
53
|
var
|
54
|
-
settings =
|
54
|
+
settings = $.isPlainObject(parameters)
|
55
55
|
? $.extend(true, {}, $.fn.slider.settings, parameters)
|
56
56
|
: $.extend({}, $.fn.slider.settings),
|
57
57
|
|
@@ -186,7 +186,9 @@
|
|
186
186
|
attrValue = $child.attr('data-value')
|
187
187
|
;
|
188
188
|
if (attrValue) {
|
189
|
-
attrValue = attrValue > max
|
189
|
+
attrValue = attrValue > max
|
190
|
+
? max
|
191
|
+
: (attrValue < min ? min : attrValue);
|
190
192
|
ratio = (attrValue - min) / (max - min);
|
191
193
|
} else {
|
192
194
|
ratio = (index + 1) / (numChildren + 1);
|
@@ -204,10 +206,10 @@
|
|
204
206
|
for (var i = 0, len = module.get.numLabels(); i <= len; i++) {
|
205
207
|
var
|
206
208
|
labelText = module.get.label(i),
|
207
|
-
$label =
|
208
|
-
? !(i % module.get.gapRatio())
|
209
|
+
$label = labelText !== ''
|
210
|
+
? (!(i % module.get.gapRatio())
|
209
211
|
? $('<li class="label">' + labelText + '</li>')
|
210
|
-
: $('<li class="halftick label"></li>')
|
212
|
+
: $('<li class="halftick label"></li>'))
|
211
213
|
: null,
|
212
214
|
ratio = i / len
|
213
215
|
;
|
@@ -335,7 +337,7 @@
|
|
335
337
|
}
|
336
338
|
},
|
337
339
|
move: function (event) {
|
338
|
-
if (event.type
|
340
|
+
if (event.type === 'mousemove') {
|
339
341
|
event.preventDefault(); // prevent text selection etc.
|
340
342
|
}
|
341
343
|
if (module.is.disabled()) {
|
@@ -343,14 +345,14 @@
|
|
343
345
|
return;
|
344
346
|
}
|
345
347
|
var value = module.determine.valueFromEvent(event);
|
346
|
-
if (event.type
|
348
|
+
if (event.type === 'mousemove' && $currThumb === undefined) {
|
347
349
|
var
|
348
350
|
eventPos = module.determine.eventPos(event),
|
349
351
|
newPos = module.determine.pos(eventPos)
|
350
352
|
;
|
351
353
|
$currThumb = initialPosition > newPos ? $thumb : $secondThumb;
|
352
354
|
}
|
353
|
-
if (module.get.step()
|
355
|
+
if (module.get.step() === 0 || module.is.smooth()) {
|
354
356
|
var
|
355
357
|
thumbVal = module.thumbVal,
|
356
358
|
secondThumbVal = module.secondThumbVal,
|
@@ -409,31 +411,35 @@
|
|
409
411
|
}
|
410
412
|
if (first || module.is.focused()) {
|
411
413
|
var step = module.determine.keyMovement(event);
|
412
|
-
if (step
|
414
|
+
if (step !== NO_STEP) {
|
413
415
|
event.preventDefault();
|
414
416
|
switch (step) {
|
415
|
-
case SINGLE_STEP:
|
417
|
+
case SINGLE_STEP: {
|
416
418
|
module.takeStep();
|
417
419
|
|
418
420
|
break;
|
419
|
-
|
421
|
+
}
|
422
|
+
case BIG_STEP: {
|
420
423
|
module.takeStep(module.get.multiplier());
|
421
424
|
|
422
425
|
break;
|
423
|
-
|
426
|
+
}
|
427
|
+
case SINGLE_BACKSTEP: {
|
424
428
|
module.backStep();
|
425
429
|
|
426
430
|
break;
|
427
|
-
|
431
|
+
}
|
432
|
+
case BIG_BACKSTEP: {
|
428
433
|
module.backStep(module.get.multiplier());
|
429
434
|
|
430
435
|
break;
|
436
|
+
}
|
431
437
|
}
|
432
438
|
}
|
433
439
|
}
|
434
440
|
},
|
435
441
|
activateFocus: function (event) {
|
436
|
-
if (!module.is.focused() && module.is.hover() && module.determine.keyMovement(event)
|
442
|
+
if (!module.is.focused() && module.is.hover() && module.determine.keyMovement(event) !== NO_STEP) {
|
437
443
|
event.preventDefault();
|
438
444
|
module.event.keydown(event, true);
|
439
445
|
$module.trigger('focus');
|
@@ -441,7 +447,7 @@
|
|
441
447
|
},
|
442
448
|
resize: function (_event) {
|
443
449
|
// To avoid a useless performance cost, we only call the label refresh when its necessary
|
444
|
-
if (gapRatio
|
450
|
+
if (gapRatio !== module.get.gapRatio()) {
|
445
451
|
module.setup.labels();
|
446
452
|
gapRatio = module.get.gapRatio();
|
447
453
|
}
|
@@ -457,7 +463,9 @@
|
|
457
463
|
module.setup.labels();
|
458
464
|
},
|
459
465
|
takeStep: function (multiplier) {
|
460
|
-
|
466
|
+
if (!multiplier) {
|
467
|
+
multiplier = 1;
|
468
|
+
}
|
461
469
|
var
|
462
470
|
step = module.get.step(),
|
463
471
|
currValue = module.get.currentThumbValue()
|
@@ -465,7 +473,7 @@
|
|
465
473
|
module.verbose('Taking a step');
|
466
474
|
if (step > 0) {
|
467
475
|
module.set.value(currValue + step * multiplier);
|
468
|
-
} else if (step
|
476
|
+
} else if (step === 0) {
|
469
477
|
var
|
470
478
|
precision = module.get.precision(),
|
471
479
|
newValue = currValue + (multiplier / precision)
|
@@ -475,7 +483,9 @@
|
|
475
483
|
},
|
476
484
|
|
477
485
|
backStep: function (multiplier) {
|
478
|
-
|
486
|
+
if (!multiplier) {
|
487
|
+
multiplier = 1;
|
488
|
+
}
|
479
489
|
var
|
480
490
|
step = module.get.step(),
|
481
491
|
currValue = module.get.currentThumbValue()
|
@@ -483,7 +493,7 @@
|
|
483
493
|
module.verbose('Going back a step');
|
484
494
|
if (step > 0) {
|
485
495
|
module.set.value(currValue - step * multiplier);
|
486
|
-
} else if (step
|
496
|
+
} else if (step === 0) {
|
487
497
|
var
|
488
498
|
precision = module.get.precision(),
|
489
499
|
newValue = currValue - (multiplier / precision)
|
@@ -572,9 +582,9 @@
|
|
572
582
|
decimalPlaces,
|
573
583
|
step = module.get.step()
|
574
584
|
;
|
575
|
-
if (step
|
585
|
+
if (step !== 0) {
|
576
586
|
var split = String(step).split('.');
|
577
|
-
decimalPlaces = split.length
|
587
|
+
decimalPlaces = split.length === 2 ? split[1].length : 0;
|
578
588
|
} else {
|
579
589
|
decimalPlaces = settings.decimalPlaces;
|
580
590
|
}
|
@@ -614,12 +624,15 @@
|
|
614
624
|
}
|
615
625
|
|
616
626
|
switch (settings.labelType) {
|
617
|
-
case settings.labelTypes.number:
|
627
|
+
case settings.labelTypes.number: {
|
618
628
|
return Math.round(((value * (module.get.step() === 0 ? 1 : module.get.step())) + module.get.min()) * precision) / precision;
|
619
|
-
|
620
|
-
|
621
|
-
|
629
|
+
}
|
630
|
+
case settings.labelTypes.letter: {
|
631
|
+
return alphabet[value % 26];
|
632
|
+
}
|
633
|
+
default: {
|
622
634
|
return value;
|
635
|
+
}
|
623
636
|
}
|
624
637
|
},
|
625
638
|
value: function () {
|
@@ -630,7 +643,7 @@
|
|
630
643
|
},
|
631
644
|
thumbValue: function (which) {
|
632
645
|
switch (which) {
|
633
|
-
case 'second':
|
646
|
+
case 'second': {
|
634
647
|
if (module.is.range()) {
|
635
648
|
return module.secondThumbVal;
|
636
649
|
}
|
@@ -638,9 +651,10 @@
|
|
638
651
|
module.error(error.notrange);
|
639
652
|
|
640
653
|
break;
|
641
|
-
|
642
|
-
default:
|
654
|
+
}
|
655
|
+
default: {
|
643
656
|
return module.thumbVal;
|
657
|
+
}
|
644
658
|
}
|
645
659
|
},
|
646
660
|
multiplier: function () {
|
@@ -648,7 +662,7 @@
|
|
648
662
|
},
|
649
663
|
thumbPosition: function (which) {
|
650
664
|
switch (which) {
|
651
|
-
case 'second':
|
665
|
+
case 'second': {
|
652
666
|
if (module.is.range()) {
|
653
667
|
return secondPos;
|
654
668
|
}
|
@@ -656,9 +670,10 @@
|
|
656
670
|
module.error(error.notrange);
|
657
671
|
|
658
672
|
break;
|
659
|
-
|
660
|
-
default:
|
673
|
+
}
|
674
|
+
default: {
|
661
675
|
return position;
|
676
|
+
}
|
662
677
|
}
|
663
678
|
},
|
664
679
|
gapRatio: function () {
|
@@ -720,8 +735,8 @@
|
|
720
735
|
thumbPos: function ($element) {
|
721
736
|
var
|
722
737
|
pos = module.is.vertical()
|
723
|
-
? module.is.reversed() ? $element.css('bottom') : $element.css('top')
|
724
|
-
: module.is.reversed() ? $element.css('right') : $element.css('left')
|
738
|
+
? (module.is.reversed() ? $element.css('bottom') : $element.css('top'))
|
739
|
+
: (module.is.reversed() ? $element.css('right') : $element.css('left'))
|
725
740
|
;
|
726
741
|
|
727
742
|
return pos;
|
@@ -730,7 +745,9 @@
|
|
730
745
|
var
|
731
746
|
min = module.get.min(),
|
732
747
|
max = module.get.max(),
|
733
|
-
value = val > max
|
748
|
+
value = val > max
|
749
|
+
? max
|
750
|
+
: (val < min ? min : val),
|
734
751
|
trackLength = module.get.trackLength(),
|
735
752
|
ratio = (value - min) / (max - min),
|
736
753
|
position = Math.round(ratio * trackLength)
|
@@ -744,7 +761,7 @@
|
|
744
761
|
trackLength = module.get.trackLength(),
|
745
762
|
step = module.get.step(),
|
746
763
|
position = Math.round(ratio * trackLength),
|
747
|
-
adjustedPos =
|
764
|
+
adjustedPos = step === 0 ? position : Math.round(position / step) * step
|
748
765
|
;
|
749
766
|
|
750
767
|
return adjustedPos;
|
@@ -775,7 +792,9 @@
|
|
775
792
|
ratio,
|
776
793
|
value
|
777
794
|
;
|
778
|
-
newPos = newPos < 0
|
795
|
+
newPos = newPos < 0
|
796
|
+
? 0
|
797
|
+
: (newPos > trackLength ? trackLength : newPos);
|
779
798
|
ratio = newPos / trackLength;
|
780
799
|
if (module.is.reversed()) {
|
781
800
|
ratio = 1 - ratio;
|
@@ -817,11 +836,11 @@
|
|
817
836
|
ratio = (position - startPos) / (endPos - startPos),
|
818
837
|
range = module.get.max() - module.get.min(),
|
819
838
|
step = module.get.step(),
|
820
|
-
value =
|
821
|
-
difference =
|
839
|
+
value = ratio * range,
|
840
|
+
difference = step === 0 ? value : Math.round(value / step) * step
|
822
841
|
;
|
823
842
|
module.verbose('Determined value based upon position: ' + position + ' as: ' + value);
|
824
|
-
if (value
|
843
|
+
if (value !== difference) {
|
825
844
|
module.verbose('Rounding value to closest step: ' + difference);
|
826
845
|
}
|
827
846
|
// Use precision to avoid ugly Javascript floating point rounding issues
|
@@ -834,28 +853,28 @@
|
|
834
853
|
var
|
835
854
|
key = event.which,
|
836
855
|
downArrow = module.is.vertical()
|
837
|
-
? module.is.reversed() ? keys.downArrow : keys.upArrow
|
856
|
+
? (module.is.reversed() ? keys.downArrow : keys.upArrow)
|
838
857
|
: keys.downArrow,
|
839
858
|
upArrow = module.is.vertical()
|
840
|
-
? module.is.reversed() ? keys.upArrow : keys.downArrow
|
859
|
+
? (module.is.reversed() ? keys.upArrow : keys.downArrow)
|
841
860
|
: keys.upArrow,
|
842
861
|
leftArrow = !module.is.vertical()
|
843
|
-
? module.is.reversed() ? keys.rightArrow : keys.leftArrow
|
862
|
+
? (module.is.reversed() ? keys.rightArrow : keys.leftArrow)
|
844
863
|
: keys.leftArrow,
|
845
864
|
rightArrow = !module.is.vertical()
|
846
|
-
? module.is.reversed() ? keys.leftArrow : keys.rightArrow
|
865
|
+
? (module.is.reversed() ? keys.leftArrow : keys.rightArrow)
|
847
866
|
: keys.rightArrow
|
848
867
|
;
|
849
|
-
if (key
|
868
|
+
if (key === downArrow || key === leftArrow) {
|
850
869
|
return SINGLE_BACKSTEP;
|
851
870
|
}
|
852
|
-
if (key
|
871
|
+
if (key === upArrow || key === rightArrow) {
|
853
872
|
return SINGLE_STEP;
|
854
873
|
}
|
855
|
-
if (key
|
874
|
+
if (key === keys.pageDown) {
|
856
875
|
return BIG_BACKSTEP;
|
857
876
|
}
|
858
|
-
if (key
|
877
|
+
if (key === keys.pageUp) {
|
859
878
|
return BIG_STEP;
|
860
879
|
}
|
861
880
|
|
@@ -987,7 +1006,7 @@
|
|
987
1006
|
position: function (newValue, $element) {
|
988
1007
|
var
|
989
1008
|
newPos = module.handleNewValuePosition(newValue),
|
990
|
-
$targetThumb = $element
|
1009
|
+
$targetThumb = $element || $currThumb,
|
991
1010
|
thumbVal = module.thumbVal || module.get.min(),
|
992
1011
|
secondThumbVal = module.secondThumbVal || module.get.min()
|
993
1012
|
;
|
@@ -1038,9 +1057,11 @@
|
|
1038
1057
|
startMargin = module.get.trackStartMargin(),
|
1039
1058
|
endMargin = module.get.trackEndMargin(),
|
1040
1059
|
posDir = module.is.vertical()
|
1041
|
-
? module.is.reversed() ? 'bottom' : 'top'
|
1042
|
-
: module.is.reversed() ? 'right' : 'left',
|
1043
|
-
startMarginMod = module.is.reversed() && !module.is.vertical()
|
1060
|
+
? (module.is.reversed() ? 'bottom' : 'top')
|
1061
|
+
: (module.is.reversed() ? 'right' : 'left'),
|
1062
|
+
startMarginMod = module.is.reversed() && !module.is.vertical()
|
1063
|
+
? ' - '
|
1064
|
+
: ' + '
|
1044
1065
|
;
|
1045
1066
|
var position = '(100% - ' + startMargin + ' - ' + endMargin + ') * ' + ratio;
|
1046
1067
|
$label.css(posDir, 'calc(' + position + startMarginMod + startMargin + ')');
|
@@ -1201,17 +1222,17 @@
|
|
1201
1222
|
query = query.split(/[ .]/);
|
1202
1223
|
maxDepth = query.length - 1;
|
1203
1224
|
$.each(query, function (depth, value) {
|
1204
|
-
var camelCaseValue =
|
1225
|
+
var camelCaseValue = depth !== maxDepth
|
1205
1226
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
1206
1227
|
: query
|
1207
1228
|
;
|
1208
|
-
if ($.isPlainObject(object[camelCaseValue]) && (depth
|
1229
|
+
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
1209
1230
|
object = object[camelCaseValue];
|
1210
1231
|
} else if (object[camelCaseValue] !== undefined) {
|
1211
1232
|
found = object[camelCaseValue];
|
1212
1233
|
|
1213
1234
|
return false;
|
1214
|
-
} else if ($.isPlainObject(object[value]) && (depth
|
1235
|
+
} else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
|
1215
1236
|
object = object[value];
|
1216
1237
|
} else if (object[value] !== undefined) {
|
1217
1238
|
found = object[value];
|
@@ -1254,7 +1275,7 @@
|
|
1254
1275
|
}
|
1255
1276
|
});
|
1256
1277
|
|
1257
|
-
return
|
1278
|
+
return returnedValue !== undefined
|
1258
1279
|
? returnedValue
|
1259
1280
|
: this;
|
1260
1281
|
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.1-beta.
|
2
|
+
* # Fomantic UI - 2.9.1-beta.25+bbe4e58
|
3
3
|
* https://github.com/fomantic/Fomantic-UI
|
4
4
|
* https://fomantic-ui.com/
|
5
5
|
*
|
@@ -8,4 +8,4 @@
|
|
8
8
|
* https://opensource.org/licenses/MIT
|
9
9
|
*
|
10
10
|
*/
|
11
|
-
!function(Y,t,n,K){"use strict";t=t!==K&&t.Math===Math?t:globalThis,Y.fn.slider=function(S){var A,e=Y(this),F=Y(n),O=Y(t),N=e.selector||"",j=Date.now(),z=[],I=S,R="string"==typeof I,B=[].slice.call(arguments,1),U=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],X=0;return e.each(function(){var l,s,i,u,e,c,d,t,m,f,g,v,o,b,r,h,p=Y.isPlainObject(S)?Y.extend(!0,{},Y.fn.slider.settings,S):Y.extend({},Y.fn.slider.settings),n=p.className,a=p.metadata,k=p.namespace,V=p.error,T=p.keys,y=p.interpretLabel,w=!1,M="."+k,x="module-"+k,P=Y(this),E=this,C=P.data(x),L=1,D={initialize:function(){D.debug("Initializing slider",p),h=!0,t=X+=1,D.setup.layout(),D.setup.labels(),D.is.disabled()||D.bind.events(),D.read.metadata(),D.read.settings(),h=!1,D.instantiate()},instantiate:function(){D.verbose("Storing instance of slider",D),C=D,P.data(x,D)},destroy:function(){D.verbose("Destroying previous slider for",P),clearInterval(C.interval),D.unbind.events(),D.unbind.slidingEvents(),P.removeData(x),C=K},setup:{layout:function(){P.attr("tabindex")===K&&P.attr("tabindex",0),0===P.find(".inner").length&&P.append("<div class='inner'><div class='track'></div><div class='track-fill'></div><div class='thumb'></div></div>"),o=D.get.precision(),i=P.find(".thumb:not(.second)"),l=i,D.is.range()&&(0===P.find(".thumb.second").length&&P.find(".inner").append("<div class='thumb second'></div>"),u=P.find(".thumb.second")),e=P.find(".track"),c=P.find(".track-fill"),v=i.width()/2},labels:function(){D.is.labeled()&&(0<(d=P.find(".labels:not(.auto)")).length?D.setup.customLabel():D.setup.autoLabel(),p.showLabelTicks&&P.addClass(n.ticked))},customLabel:function(){var n,e=d.find(".label"),a=e.length,o=D.get.min(),r=D.get.max();e.each(function(e){var t=Y(this).attr("data-value");n=t?((t=r<t?r:t<o?o:t)-o)/(r-o):(e+1)/(a+1),D.update.labelPosition(n,Y(this))})},autoLabel:function(){0<(d=P.find(".labels")).length?d.empty():d=P.append('<ul class="auto labels"></ul>').find(".labels");for(var e=0,t=D.get.numLabels();e<=t;e++){var n=D.get.label(e),n=""!==n?e%D.get.gapRatio()?Y('<li class="halftick label"></li>'):Y('<li class="label">'+n+"</li>"):null;n&&(D.update.labelPosition(e/t,n),d.append(n))}}},bind:{events:function(){D.bind.globalKeyboardEvents(),D.bind.keyboardEvents(),D.bind.mouseEvents(),p.autoAdjustLabels&&D.bind.windowEvents()},keyboardEvents:function(){D.verbose("Binding keyboard events"),P.on("keydown"+M,D.event.keydown)},globalKeyboardEvents:function(){F.on("keydown"+M+t,D.event.activateFocus)},mouseEvents:function(){D.verbose("Binding mouse and touch events"),P.find(".track, .thumb, .inner").on("mousedown"+M,function(e){e.stopImmediatePropagation(),e.preventDefault(),D.event.down(e)}),P.on("mousedown"+M,D.event.down),P.on("mouseenter"+M,function(e){w=!0}),P.on("mouseleave"+M,function(e){w=!1}),P.find(".thumb").on("touchstart"+M,D.event.touchDown).on("touchmove"+M,D.event.move).on("touchend"+M,D.event.up).on("touchcancel"+M,D.event.touchCancel)},slidingEvents:function(){D.verbose("Binding page wide events while handle is being draged"),F.on("mousemove"+M,D.event.move),F.on("mouseup"+M,D.event.up)},windowEvents:function(){O.on("resize"+M,D.event.resize)}},unbind:{events:function(){P.find(".track, .thumb, .inner").off("mousedown"+M),P.off("mousedown"+M),P.off("mouseenter"+M),P.off("mouseleave"+M),P.find(".thumb").off("touchstart"+M).off("touchmove"+M).off("touchend"+M).off("touchcancel"+M),P.off("keydown"+M),P.off("focusout"+M),F.off("keydown"+M+t,D.event.activateFocus),O.off("resize"+M)},slidingEvents:function(){F.off("mousemove"+M),F.off("mouseup"+M)}},event:{down:function(e){e.preventDefault(),D.is.range()?(e=D.determine.eventPos(e),e=D.determine.pos(e),l=p.preventCrossover&&D.is.range()&&D.thumbVal===D.secondThumbVal?(r=e,K):D.determine.closestThumb(e),b===K&&(b=D.get.currentThumbValue())):b===K&&(b=D.get.value()),D.is.disabled()||D.bind.slidingEvents()},touchDown:function(e){e.preventDefault(),e.stopImmediatePropagation(),s===K&&(l=Y(e.target),e=e.touches?e:e.originalEvent,s=e.targetTouches[0].identifier,b===K&&(b=D.get.currentThumbValue()))},move:function(e){var t,n,a;"mousemove"==e.type&&e.preventDefault(),D.is.disabled()||(t=D.determine.valueFromEvent(e),"mousemove"==e.type&&l===K&&(n=D.determine.eventPos(e),n=D.determine.pos(n),l=n<r?i:u),0==D.get.step()||D.is.smooth()?(n=D.thumbVal,a=D.secondThumbVal,e=D.determine.smoothValueFromEvent(e),l.hasClass("second")?(p.preventCrossover&&D.is.range()&&(t=Math.max(n,t),e=Math.max(n,e)),a=t):(p.preventCrossover&&D.is.range()&&(t=Math.min(a,t),e=Math.min(a,e)),n=t),t=Math.abs(n-(a||0)),D.update.position(e),p.onMove.call(E,t,n,a)):D.update.value(t,function(e,t,n){p.onMove.call(E,e,t,n)}))},up:function(e){e.preventDefault(),D.is.disabled()||(e=D.determine.valueFromEvent(e),D.set.value(e),D.unbind.slidingEvents(),b!==(s=K)&&(b=K))},touchCancel:function(e){e.preventDefault(),b!==(s=K)&&(D.update.value(b),b=K)},keydown:function(e,t){if(p.preventCrossover&&D.is.range()&&D.thumbVal===D.secondThumbVal&&(l=K),D.is.focused()&&F.trigger(e),t||D.is.focused()){t=D.determine.keyMovement(e);if(0!=t)switch(e.preventDefault(),t){case 1:D.takeStep();break;case 2:D.takeStep(D.get.multiplier());break;case-1:D.backStep();break;case-2:D.backStep(D.get.multiplier())}}},activateFocus:function(e){!D.is.focused()&&D.is.hover()&&0!=D.determine.keyMovement(e)&&(e.preventDefault(),D.event.keydown(e,!0),P.trigger("focus"))},resize:function(e){L!=D.get.gapRatio()&&(D.setup.labels(),L=D.get.gapRatio())}},resync:function(){D.verbose("Resyncing thumb position based on value"),D.is.range()&&D.update.position(D.secondThumbVal,u),D.update.position(D.thumbVal,i),D.setup.labels()},takeStep:function(e){e=e!=K?e:1;var t=D.get.step(),n=D.get.currentThumbValue();D.verbose("Taking a step"),0<t?D.set.value(n+t*e):0==t&&(t=D.get.precision(),D.set.value(Math.round((n+e/t)*t)/t))},backStep:function(e){e=e!=K?e:1;var t=D.get.step(),n=D.get.currentThumbValue();D.verbose("Going back a step"),0<t?D.set.value(n-t*e):0==t&&(t=D.get.precision(),D.set.value(Math.round((n-e/t)*t)/t))},is:{range:function(){return P.hasClass(p.className.range)},hover:function(){return w},focused:function(){return P.is(":focus")},disabled:function(){return P.hasClass(p.className.disabled)},labeled:function(){return P.hasClass(p.className.labeled)},reversed:function(){return P.hasClass(p.className.reversed)},vertical:function(){return P.hasClass(p.className.vertical)},smooth:function(){return p.smooth||P.hasClass(p.className.smooth)}},get:{trackOffset:function(){return D.is.vertical()?e.offset().top:e.offset().left},trackLength:function(){return D.is.vertical()?e.height():e.width()},trackLeft:function(){return D.is.vertical()?e.position().top:e.position().left},trackStartPos:function(){return D.is.reversed()?D.get.trackLeft()+D.get.trackLength():D.get.trackLeft()},trackEndPos:function(){return D.is.reversed()?D.get.trackLeft():D.get.trackLeft()+D.get.trackLength()},trackStartMargin:function(){var e=D.is.vertical()?D.is.reversed()?P.css("padding-bottom"):P.css("padding-top"):D.is.reversed()?P.css("padding-right"):P.css("padding-left");return e||"0px"},trackEndMargin:function(){var e=D.is.vertical()?D.is.reversed()?P.css("padding-top"):P.css("padding-bottom"):D.is.reversed()?P.css("padding-left"):P.css("padding-right");return e||"0px"},precision:function(){var e=D.get.step(),e=(e=0!=e?2==(e=String(e).split(".")).length?e[1].length:0:p.decimalPlaces,Math.pow(10,e));return D.debug("Precision determined",e),e},min:function(){return p.min},max:function(){var e=D.get.step(),t=D.get.min(),n=0===e?0:Math.floor((p.max-t)/e);return 0==(0===e?0:(p.max-t)%e)?p.max:t+n*e},step:function(){return p.step},numLabels:function(){var e=Math.round((D.get.max()-D.get.min())/(0===D.get.step()?1:D.get.step()));return D.debug("Determined that there should be "+e+" labels"),e},labelType:function(){return p.labelType},label:function(e){if(y)return y(e);switch(p.labelType){case p.labelTypes.number:return Math.round((e*(0===D.get.step()?1:D.get.step())+D.get.min())*o)/o;case p.labelTypes.letter:return U[e%26];default:return e}},value:function(){return m},currentThumbValue:function(){return l!==K&&l.hasClass("second")?D.secondThumbVal:D.thumbVal},thumbValue:function(e){return"second"!==e?D.thumbVal:D.is.range()?D.secondThumbVal:void D.error(V.notrange)},multiplier:function(){return p.pageMultiplier},thumbPosition:function(e){return"second"!==e?f:D.is.range()?g:void D.error(V.notrange)},gapRatio:function(){var e=1;if(p.autoAdjustLabels){var t=D.get.numLabels(),n=D.get.trackLength(),a=1;if(0<n)for(;n/t*a<p.labelDistance;)t%a||(e=a),a+=1}return e}},determine:{pos:function(e){return D.is.reversed()?D.get.trackStartPos()-e+D.get.trackOffset():e-D.get.trackOffset()-D.get.trackStartPos()},closestThumb:function(e){var t=parseFloat(D.determine.thumbPos(i)),t=Math.abs(e-t),n=parseFloat(D.determine.thumbPos(u)),e=Math.abs(e-n);return(t!==e||D.get.thumbValue()!==D.get.min())&&t<=e?i:u},closestThumbPos:function(e){var t=parseFloat(D.determine.thumbPos(i)),n=Math.abs(e-t),a=parseFloat(D.determine.thumbPos(u));return n<=Math.abs(e-a)?t:a},thumbPos:function(e){return D.is.vertical()?D.is.reversed()?e.css("bottom"):e.css("top"):D.is.reversed()?e.css("right"):e.css("left")},positionFromValue:function(e){var t=D.get.min(),n=D.get.max(),e=n<e?n:e<t?t:e,a=D.get.trackLength(),n=Math.round((e-t)/(n-t)*a);return D.verbose("Determined position: "+n+" from value: "+e),n},positionFromRatio:function(e){var t=D.get.trackLength(),n=D.get.step(),e=Math.round(e*t);return 0==n?e:Math.round(e/n)*n},valueFromEvent:function(e){var e=D.determine.eventPos(e),t=D.determine.pos(e),e=e<D.get.trackOffset()?D.is.reversed()?D.get.max():D.get.min():e>D.get.trackOffset()+D.get.trackLength()?D.is.reversed()?D.get.min():D.get.max():D.determine.value(t);return e},smoothValueFromEvent:function(e){var t=D.get.min(),n=D.get.max(),a=D.get.trackLength(),e=D.determine.eventPos(e)-D.get.trackOffset(),e=(e=e<0?0:a<e?a:e)/a;return(e=D.is.reversed()?1-e:e)*(n-t)+t},eventPos:function(e){if("touchmove"===e.type||"touchend"===e.type){for(var t=e.touches?e:e.originalEvent,n=t.changedTouches[0],a=0;a<t.touches.length;a++)if(t.touches[a].identifier===s){n=t.touches[a];break}var o=n.pageY,r=n.pageX;return D.is.vertical()?o:r}o=e.pageY||e.originalEvent.pageY,r=e.pageX||e.originalEvent.pageX;return D.is.vertical()?o:r},value:function(e){var t=D.is.reversed()?D.get.trackEndPos():D.get.trackStartPos(),t=(e-t)/((D.is.reversed()?D.get.trackStartPos():D.get.trackEndPos())-t),n=D.get.max()-D.get.min(),a=D.get.step(),t=t*n,n=0==a?t:Math.round(t/a)*a;return D.verbose("Determined value based upon position: "+e+" as: "+t),t!=n&&D.verbose("Rounding value to closest step: "+n),D.verbose("Cutting off additional decimal places"),Math.round((n+D.get.min())*o)/o},keyMovement:function(e){var e=e.which,t=!D.is.vertical()||D.is.reversed()?T.downArrow:T.upArrow,n=!D.is.vertical()||D.is.reversed()?T.upArrow:T.downArrow,a=!D.is.vertical()&&D.is.reversed()?T.rightArrow:T.leftArrow,o=!D.is.vertical()&&D.is.reversed()?T.leftArrow:T.rightArrow;return e==t||e==a?-1:e==n||e==o?1:e==T.pageDown?-2:e==T.pageUp?2:0}},handleNewValuePosition:function(e){var t=D.get.min(),n=D.get.max();return e<=t?e=t:n<=e&&(e=n),D.determine.positionFromValue(e)},set:{value:function(a,o){o=!1!==o;var r=b===K;b=b===K?D.get.value():b,D.update.value(a,function(e,t,n){h&&!p.fireOnInit||!o||(a!==b&&p.onChange.call(E,e,t,n),p.onMove.call(E,e,t,n)),r&&(b=K)})},rangeValue:function(e,t,n){var a,o,r;n=!1!==n,D.is.range()?(a=D.get.min(),o=D.get.max(),b=(r=b===K)?D.get.value():b,e<=a?e=a:o<=e&&(e=o),t<=a?t=a:o<=t&&(t=o),D.thumbVal=e,D.secondThumbVal=t,m=Math.abs(D.thumbVal-D.secondThumbVal),D.update.position(D.thumbVal,i),D.update.position(D.secondThumbVal,u),h&&!p.fireOnInit||!n||(m!==b&&p.onChange.call(E,m,D.thumbVal,D.secondThumbVal),p.onMove.call(E,m,D.thumbVal,D.secondThumbVal)),r&&(b=K)):D.error(V.notrange)},position:function(e,t){e=D.determine.value(e);"second"===t?(D.secondThumbVal=e,D.update.position(e,u)):(D.thumbVal=e,D.update.position(e,i)),m=Math.abs(D.thumbVal-(D.secondThumbVal||0)),D.set.value(m)}},update:{value:function(e,t){var n=D.get.min(),a=D.get.max();e<=n?e=n:a<=e&&(e=a),D.is.range()?((l=l===K?e<=D.get.currentThumbValue()?i:u:l).hasClass("second")?(p.preventCrossover&&D.is.range()&&(e=Math.max(D.thumbVal,e)),D.secondThumbVal=e):(p.preventCrossover&&D.is.range()&&(e=Math.min(D.secondThumbVal,e)),D.thumbVal=e),m=Math.abs(D.thumbVal-D.secondThumbVal)):(m=e,D.thumbVal=m),D.update.position(e),D.debug("Setting slider value to "+m),"function"==typeof t&&t(m,D.thumbVal,D.secondThumbVal)},position:function(e,t){var n=D.handleNewValuePosition(e),t=t!=K?t:l,a=D.thumbVal||D.get.min(),o=D.secondThumbVal||D.get.min();D.is.range()&&t.hasClass("second")?(g=n,o=e):(f=n,a=e);var r,s=D.get.min(),i=D.get.max(),e=(e-s)/(i-s)*100,u=(Math.min(a,o)-s)/(i-s)*100,a=100*(1-(Math.max(a,o)-s)/(i-s)),o=D.is.vertical()?D.is.reversed()?(r={bottom:"calc("+e+"% - "+v+"px)",top:"auto"},{bottom:u+"%",top:a+"%"}):(r={top:"calc("+e+"% - "+v+"px)",bottom:"auto"},{top:u+"%",bottom:a+"%"}):D.is.reversed()?(r={right:"calc("+e+"% - "+v+"px)",left:"auto"},{right:u+"%",left:a+"%"}):(r={left:"calc("+e+"% - "+v+"px)",right:"auto"},{left:u+"%",right:a+"%"});t.css(r),c.css(o),D.debug("Setting slider position to "+n)},labelPosition:function(e,t){var n=D.get.trackStartMargin(),a=D.get.trackEndMargin(),o=D.is.vertical()?D.is.reversed()?"bottom":"top":D.is.reversed()?"right":"left",r=D.is.reversed()&&!D.is.vertical()?" - ":" + ";t.css(o,"calc("+("(100% - "+n+" - "+a+") * "+e)+r+n+")")}},goto:{max:function(){D.set.value(D.get.max())},min:function(){D.set.value(D.get.min())}},read:{metadata:function(){var e={thumbVal:P.data(a.thumbVal),secondThumbVal:P.data(a.secondThumbVal)};e.thumbVal&&(D.is.range()&&e.secondThumbVal?(D.debug("Current value set from metadata",e.thumbVal,e.secondThumbVal),D.set.rangeValue(e.thumbVal,e.secondThumbVal)):(D.debug("Current value set from metadata",e.thumbVal),D.set.value(e.thumbVal)))},settings:function(){!1!==p.start&&(D.is.range()?(D.debug("Start position set from settings",p.start,p.end),D.set.rangeValue(p.start,p.end)):(D.debug("Start position set from settings",p.start),D.set.value(p.start)))}},setting:function(e,t){if(D.debug("Changing setting",e,t),Y.isPlainObject(e))Y.extend(!0,p,e);else{if(t===K)return p[e];Y.isPlainObject(p[e])?Y.extend(!0,p[e],t):p[e]=t}},internal:function(e,t){if(Y.isPlainObject(e))Y.extend(!0,D,e);else{if(t===K)return D[e];D[e]=t}},debug:function(){!p.silent&&p.debug&&(p.performance?D.performance.log(arguments):(D.debug=Function.prototype.bind.call(console.info,console,p.name+":"),D.debug.apply(console,arguments)))},verbose:function(){!p.silent&&p.verbose&&p.debug&&(p.performance?D.performance.log(arguments):(D.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),D.verbose.apply(console,arguments)))},error:function(){p.silent||(D.error=Function.prototype.bind.call(console.error,console,p.name+":"),D.error.apply(console,arguments))},performance:{log:function(e){var t,n;p.performance&&(n=(t=Date.now())-(j||t),j=t,z.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:E,"Execution Time":n})),clearTimeout(D.performance.timer),D.performance.timer=setTimeout(D.performance.display,500)},display:function(){var e=p.name+":",n=0;j=!1,clearTimeout(D.performance.timer),Y.each(z,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",N&&(e+=" '"+N+"'"),(console.group!==K||console.table!==K)&&0<z.length&&(console.groupCollapsed(e),console.table?console.table(z):Y.each(z,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),z=[]}},invoke:function(a,e,t){var o,r,n,s,i=C;return e=e||B,t=t||E,"string"==typeof a&&i!==K&&(a=a.split(/[ .]/),o=a.length-1,Y.each(a,function(e,t){var n=e!=o?t+a[e+1].charAt(0).toUpperCase()+a[e+1].slice(1):a;if(Y.isPlainObject(i[n])&&e!=o)i=i[n];else{if(i[n]!==K)return r=i[n],!1;{if(!Y.isPlainObject(i[t])||e==o)return i[t]!==K?r=i[t]:D.error(V.method,a),!1;i=i[t]}}})),"function"==typeof(s=r)&&"number"!=typeof s.nodeType?n=r.apply(t,e):r!==K&&(n=r),Array.isArray(A)?A.push(n):A!==K?A=[A,n]:n!==K&&(A=n),r}};R?(C===K&&D.initialize(),D.invoke(I)):(C!==K&&C.invoke("destroy"),D.initialize())}),A!==K?A:this},Y.fn.slider.settings={silent:!1,debug:!1,verbose:!1,performance:!0,name:"Slider",namespace:"slider",error:{method:"The method you called is not defined.",notrange:"This slider is not a range slider"},metadata:{thumbVal:"thumbVal",secondThumbVal:"secondThumbVal"},min:0,max:20,step:1,start:0,end:20,labelType:"number",showLabelTicks:!1,smooth:!1,autoAdjustLabels:!0,labelDistance:100,preventCrossover:!0,fireOnInit:!1,interpretLabel:!1,decimalPlaces:2,pageMultiplier:2,selector:{},className:{reversed:"reversed",disabled:"disabled",labeled:"labeled",ticked:"ticked",vertical:"vertical",range:"range",smooth:"smooth"},keys:{pageUp:33,pageDown:34,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40},labelTypes:{number:"number",letter:"letter"},onChange:function(e,t,n){},onMove:function(e,t,n){}}}(jQuery,window,document);
|
11
|
+
!function(Y,t,n,K){"use strict";t=t!==K&&t.Math===Math?t:globalThis,Y.fn.slider=function(S){var A,e=Y(this),F=Y(n),O=Y(t),N=e.selector||"",j=Date.now(),z=[],I=S,R="string"==typeof I,B=[].slice.call(arguments,1),U=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],X=0;return e.each(function(){var l,s,i,u,e,c,d,t,m,f,g,v,o,b,r,h,p=Y.isPlainObject(S)?Y.extend(!0,{},Y.fn.slider.settings,S):Y.extend({},Y.fn.slider.settings),n=p.className,a=p.metadata,k=p.namespace,V=p.error,T=p.keys,y=p.interpretLabel,w=!1,M="."+k,x="module-"+k,P=Y(this),E=this,C=P.data(x),L=1,D={initialize:function(){D.debug("Initializing slider",p),h=!0,t=X+=1,D.setup.layout(),D.setup.labels(),D.is.disabled()||D.bind.events(),D.read.metadata(),D.read.settings(),h=!1,D.instantiate()},instantiate:function(){D.verbose("Storing instance of slider",D),C=D,P.data(x,D)},destroy:function(){D.verbose("Destroying previous slider for",P),clearInterval(C.interval),D.unbind.events(),D.unbind.slidingEvents(),P.removeData(x),C=K},setup:{layout:function(){P.attr("tabindex")===K&&P.attr("tabindex",0),0===P.find(".inner").length&&P.append("<div class='inner'><div class='track'></div><div class='track-fill'></div><div class='thumb'></div></div>"),o=D.get.precision(),i=P.find(".thumb:not(.second)"),l=i,D.is.range()&&(0===P.find(".thumb.second").length&&P.find(".inner").append("<div class='thumb second'></div>"),u=P.find(".thumb.second")),e=P.find(".track"),c=P.find(".track-fill"),v=i.width()/2},labels:function(){D.is.labeled()&&(0<(d=P.find(".labels:not(.auto)")).length?D.setup.customLabel():D.setup.autoLabel(),p.showLabelTicks&&P.addClass(n.ticked))},customLabel:function(){var n,e=d.find(".label"),a=e.length,o=D.get.min(),r=D.get.max();e.each(function(e){var t=Y(this).attr("data-value");n=t?((t=r<t?r:t<o?o:t)-o)/(r-o):(e+1)/(a+1),D.update.labelPosition(n,Y(this))})},autoLabel:function(){0<(d=P.find(".labels")).length?d.empty():d=P.append('<ul class="auto labels"></ul>').find(".labels");for(var e=0,t=D.get.numLabels();e<=t;e++){var n=D.get.label(e),n=""!==n?e%D.get.gapRatio()?Y('<li class="halftick label"></li>'):Y('<li class="label">'+n+"</li>"):null;n&&(D.update.labelPosition(e/t,n),d.append(n))}}},bind:{events:function(){D.bind.globalKeyboardEvents(),D.bind.keyboardEvents(),D.bind.mouseEvents(),p.autoAdjustLabels&&D.bind.windowEvents()},keyboardEvents:function(){D.verbose("Binding keyboard events"),P.on("keydown"+M,D.event.keydown)},globalKeyboardEvents:function(){F.on("keydown"+M+t,D.event.activateFocus)},mouseEvents:function(){D.verbose("Binding mouse and touch events"),P.find(".track, .thumb, .inner").on("mousedown"+M,function(e){e.stopImmediatePropagation(),e.preventDefault(),D.event.down(e)}),P.on("mousedown"+M,D.event.down),P.on("mouseenter"+M,function(e){w=!0}),P.on("mouseleave"+M,function(e){w=!1}),P.find(".thumb").on("touchstart"+M,D.event.touchDown).on("touchmove"+M,D.event.move).on("touchend"+M,D.event.up).on("touchcancel"+M,D.event.touchCancel)},slidingEvents:function(){D.verbose("Binding page wide events while handle is being draged"),F.on("mousemove"+M,D.event.move),F.on("mouseup"+M,D.event.up)},windowEvents:function(){O.on("resize"+M,D.event.resize)}},unbind:{events:function(){P.find(".track, .thumb, .inner").off("mousedown"+M),P.off("mousedown"+M),P.off("mouseenter"+M),P.off("mouseleave"+M),P.find(".thumb").off("touchstart"+M).off("touchmove"+M).off("touchend"+M).off("touchcancel"+M),P.off("keydown"+M),P.off("focusout"+M),F.off("keydown"+M+t,D.event.activateFocus),O.off("resize"+M)},slidingEvents:function(){F.off("mousemove"+M),F.off("mouseup"+M)}},event:{down:function(e){e.preventDefault(),D.is.range()?(e=D.determine.eventPos(e),e=D.determine.pos(e),l=p.preventCrossover&&D.is.range()&&D.thumbVal===D.secondThumbVal?(r=e,K):D.determine.closestThumb(e),b===K&&(b=D.get.currentThumbValue())):b===K&&(b=D.get.value()),D.is.disabled()||D.bind.slidingEvents()},touchDown:function(e){e.preventDefault(),e.stopImmediatePropagation(),s===K&&(l=Y(e.target),e=e.touches?e:e.originalEvent,s=e.targetTouches[0].identifier,b===K&&(b=D.get.currentThumbValue()))},move:function(e){var t,n,a;"mousemove"===e.type&&e.preventDefault(),D.is.disabled()||(t=D.determine.valueFromEvent(e),"mousemove"===e.type&&l===K&&(n=D.determine.eventPos(e),n=D.determine.pos(n),l=n<r?i:u),0===D.get.step()||D.is.smooth()?(n=D.thumbVal,a=D.secondThumbVal,e=D.determine.smoothValueFromEvent(e),l.hasClass("second")?(p.preventCrossover&&D.is.range()&&(t=Math.max(n,t),e=Math.max(n,e)),a=t):(p.preventCrossover&&D.is.range()&&(t=Math.min(a,t),e=Math.min(a,e)),n=t),t=Math.abs(n-(a||0)),D.update.position(e),p.onMove.call(E,t,n,a)):D.update.value(t,function(e,t,n){p.onMove.call(E,e,t,n)}))},up:function(e){e.preventDefault(),D.is.disabled()||(e=D.determine.valueFromEvent(e),D.set.value(e),D.unbind.slidingEvents(),b!==(s=K)&&(b=K))},touchCancel:function(e){e.preventDefault(),b!==(s=K)&&(D.update.value(b),b=K)},keydown:function(e,t){if(p.preventCrossover&&D.is.range()&&D.thumbVal===D.secondThumbVal&&(l=K),D.is.focused()&&F.trigger(e),t||D.is.focused()){t=D.determine.keyMovement(e);if(0!==t)switch(e.preventDefault(),t){case 1:D.takeStep();break;case 2:D.takeStep(D.get.multiplier());break;case-1:D.backStep();break;case-2:D.backStep(D.get.multiplier())}}},activateFocus:function(e){!D.is.focused()&&D.is.hover()&&0!==D.determine.keyMovement(e)&&(e.preventDefault(),D.event.keydown(e,!0),P.trigger("focus"))},resize:function(e){L!==D.get.gapRatio()&&(D.setup.labels(),L=D.get.gapRatio())}},resync:function(){D.verbose("Resyncing thumb position based on value"),D.is.range()&&D.update.position(D.secondThumbVal,u),D.update.position(D.thumbVal,i),D.setup.labels()},takeStep:function(e){e=e||1;var t=D.get.step(),n=D.get.currentThumbValue();D.verbose("Taking a step"),0<t?D.set.value(n+t*e):0===t&&(t=D.get.precision(),D.set.value(Math.round((n+e/t)*t)/t))},backStep:function(e){e=e||1;var t=D.get.step(),n=D.get.currentThumbValue();D.verbose("Going back a step"),0<t?D.set.value(n-t*e):0===t&&(t=D.get.precision(),D.set.value(Math.round((n-e/t)*t)/t))},is:{range:function(){return P.hasClass(p.className.range)},hover:function(){return w},focused:function(){return P.is(":focus")},disabled:function(){return P.hasClass(p.className.disabled)},labeled:function(){return P.hasClass(p.className.labeled)},reversed:function(){return P.hasClass(p.className.reversed)},vertical:function(){return P.hasClass(p.className.vertical)},smooth:function(){return p.smooth||P.hasClass(p.className.smooth)}},get:{trackOffset:function(){return D.is.vertical()?e.offset().top:e.offset().left},trackLength:function(){return D.is.vertical()?e.height():e.width()},trackLeft:function(){return D.is.vertical()?e.position().top:e.position().left},trackStartPos:function(){return D.is.reversed()?D.get.trackLeft()+D.get.trackLength():D.get.trackLeft()},trackEndPos:function(){return D.is.reversed()?D.get.trackLeft():D.get.trackLeft()+D.get.trackLength()},trackStartMargin:function(){var e=D.is.vertical()?D.is.reversed()?P.css("padding-bottom"):P.css("padding-top"):D.is.reversed()?P.css("padding-right"):P.css("padding-left");return e||"0px"},trackEndMargin:function(){var e=D.is.vertical()?D.is.reversed()?P.css("padding-top"):P.css("padding-bottom"):D.is.reversed()?P.css("padding-left"):P.css("padding-right");return e||"0px"},precision:function(){var e=D.get.step(),e=(e=0!==e?2===(e=String(e).split(".")).length?e[1].length:0:p.decimalPlaces,Math.pow(10,e));return D.debug("Precision determined",e),e},min:function(){return p.min},max:function(){var e=D.get.step(),t=D.get.min(),n=0===e?0:Math.floor((p.max-t)/e);return 0==(0===e?0:(p.max-t)%e)?p.max:t+n*e},step:function(){return p.step},numLabels:function(){var e=Math.round((D.get.max()-D.get.min())/(0===D.get.step()?1:D.get.step()));return D.debug("Determined that there should be "+e+" labels"),e},labelType:function(){return p.labelType},label:function(e){if(y)return y(e);switch(p.labelType){case p.labelTypes.number:return Math.round((e*(0===D.get.step()?1:D.get.step())+D.get.min())*o)/o;case p.labelTypes.letter:return U[e%26];default:return e}},value:function(){return m},currentThumbValue:function(){return l!==K&&l.hasClass("second")?D.secondThumbVal:D.thumbVal},thumbValue:function(e){return"second"!==e?D.thumbVal:D.is.range()?D.secondThumbVal:void D.error(V.notrange)},multiplier:function(){return p.pageMultiplier},thumbPosition:function(e){return"second"!==e?f:D.is.range()?g:void D.error(V.notrange)},gapRatio:function(){var e=1;if(p.autoAdjustLabels){var t=D.get.numLabels(),n=D.get.trackLength(),a=1;if(0<n)for(;n/t*a<p.labelDistance;)t%a||(e=a),a+=1}return e}},determine:{pos:function(e){return D.is.reversed()?D.get.trackStartPos()-e+D.get.trackOffset():e-D.get.trackOffset()-D.get.trackStartPos()},closestThumb:function(e){var t=parseFloat(D.determine.thumbPos(i)),t=Math.abs(e-t),n=parseFloat(D.determine.thumbPos(u)),e=Math.abs(e-n);return(t!==e||D.get.thumbValue()!==D.get.min())&&t<=e?i:u},closestThumbPos:function(e){var t=parseFloat(D.determine.thumbPos(i)),n=Math.abs(e-t),a=parseFloat(D.determine.thumbPos(u));return n<=Math.abs(e-a)?t:a},thumbPos:function(e){return D.is.vertical()?D.is.reversed()?e.css("bottom"):e.css("top"):D.is.reversed()?e.css("right"):e.css("left")},positionFromValue:function(e){var t=D.get.min(),n=D.get.max(),e=n<e?n:e<t?t:e,a=D.get.trackLength(),n=Math.round((e-t)/(n-t)*a);return D.verbose("Determined position: "+n+" from value: "+e),n},positionFromRatio:function(e){var t=D.get.trackLength(),n=D.get.step(),e=Math.round(e*t);return 0===n?e:Math.round(e/n)*n},valueFromEvent:function(e){var e=D.determine.eventPos(e),t=D.determine.pos(e),e=e<D.get.trackOffset()?D.is.reversed()?D.get.max():D.get.min():e>D.get.trackOffset()+D.get.trackLength()?D.is.reversed()?D.get.min():D.get.max():D.determine.value(t);return e},smoothValueFromEvent:function(e){var t=D.get.min(),n=D.get.max(),a=D.get.trackLength(),e=D.determine.eventPos(e)-D.get.trackOffset(),e=(e=e<0?0:a<e?a:e)/a;return(e=D.is.reversed()?1-e:e)*(n-t)+t},eventPos:function(e){if("touchmove"===e.type||"touchend"===e.type){for(var t=e.touches?e:e.originalEvent,n=t.changedTouches[0],a=0;a<t.touches.length;a++)if(t.touches[a].identifier===s){n=t.touches[a];break}var o=n.pageY,r=n.pageX;return D.is.vertical()?o:r}o=e.pageY||e.originalEvent.pageY,r=e.pageX||e.originalEvent.pageX;return D.is.vertical()?o:r},value:function(e){var t=D.is.reversed()?D.get.trackEndPos():D.get.trackStartPos(),t=(e-t)/((D.is.reversed()?D.get.trackStartPos():D.get.trackEndPos())-t),n=D.get.max()-D.get.min(),a=D.get.step(),t=t*n,n=0===a?t:Math.round(t/a)*a;return D.verbose("Determined value based upon position: "+e+" as: "+t),t!=n&&D.verbose("Rounding value to closest step: "+n),D.verbose("Cutting off additional decimal places"),Math.round((n+D.get.min())*o)/o},keyMovement:function(e){var e=e.which,t=!D.is.vertical()||D.is.reversed()?T.downArrow:T.upArrow,n=!D.is.vertical()||D.is.reversed()?T.upArrow:T.downArrow,a=!D.is.vertical()&&D.is.reversed()?T.rightArrow:T.leftArrow,o=!D.is.vertical()&&D.is.reversed()?T.leftArrow:T.rightArrow;return e===t||e===a?-1:e===n||e===o?1:e===T.pageDown?-2:e===T.pageUp?2:0}},handleNewValuePosition:function(e){var t=D.get.min(),n=D.get.max();return e<=t?e=t:n<=e&&(e=n),D.determine.positionFromValue(e)},set:{value:function(a,o){o=!1!==o;var r=b===K;b=b===K?D.get.value():b,D.update.value(a,function(e,t,n){h&&!p.fireOnInit||!o||(a!==b&&p.onChange.call(E,e,t,n),p.onMove.call(E,e,t,n)),r&&(b=K)})},rangeValue:function(e,t,n){var a,o,r;n=!1!==n,D.is.range()?(a=D.get.min(),o=D.get.max(),b=(r=b===K)?D.get.value():b,e<=a?e=a:o<=e&&(e=o),t<=a?t=a:o<=t&&(t=o),D.thumbVal=e,D.secondThumbVal=t,m=Math.abs(D.thumbVal-D.secondThumbVal),D.update.position(D.thumbVal,i),D.update.position(D.secondThumbVal,u),h&&!p.fireOnInit||!n||(m!==b&&p.onChange.call(E,m,D.thumbVal,D.secondThumbVal),p.onMove.call(E,m,D.thumbVal,D.secondThumbVal)),r&&(b=K)):D.error(V.notrange)},position:function(e,t){e=D.determine.value(e);"second"===t?(D.secondThumbVal=e,D.update.position(e,u)):(D.thumbVal=e,D.update.position(e,i)),m=Math.abs(D.thumbVal-(D.secondThumbVal||0)),D.set.value(m)}},update:{value:function(e,t){var n=D.get.min(),a=D.get.max();e<=n?e=n:a<=e&&(e=a),D.is.range()?((l=l===K?e<=D.get.currentThumbValue()?i:u:l).hasClass("second")?(p.preventCrossover&&D.is.range()&&(e=Math.max(D.thumbVal,e)),D.secondThumbVal=e):(p.preventCrossover&&D.is.range()&&(e=Math.min(D.secondThumbVal,e)),D.thumbVal=e),m=Math.abs(D.thumbVal-D.secondThumbVal)):(m=e,D.thumbVal=m),D.update.position(e),D.debug("Setting slider value to "+m),"function"==typeof t&&t(m,D.thumbVal,D.secondThumbVal)},position:function(e,t){var n=D.handleNewValuePosition(e),t=t||l,a=D.thumbVal||D.get.min(),o=D.secondThumbVal||D.get.min();D.is.range()&&t.hasClass("second")?(g=n,o=e):(f=n,a=e);var r,s=D.get.min(),i=D.get.max(),e=(e-s)/(i-s)*100,u=(Math.min(a,o)-s)/(i-s)*100,a=100*(1-(Math.max(a,o)-s)/(i-s)),o=D.is.vertical()?D.is.reversed()?(r={bottom:"calc("+e+"% - "+v+"px)",top:"auto"},{bottom:u+"%",top:a+"%"}):(r={top:"calc("+e+"% - "+v+"px)",bottom:"auto"},{top:u+"%",bottom:a+"%"}):D.is.reversed()?(r={right:"calc("+e+"% - "+v+"px)",left:"auto"},{right:u+"%",left:a+"%"}):(r={left:"calc("+e+"% - "+v+"px)",right:"auto"},{left:u+"%",right:a+"%"});t.css(r),c.css(o),D.debug("Setting slider position to "+n)},labelPosition:function(e,t){var n=D.get.trackStartMargin(),a=D.get.trackEndMargin(),o=D.is.vertical()?D.is.reversed()?"bottom":"top":D.is.reversed()?"right":"left",r=D.is.reversed()&&!D.is.vertical()?" - ":" + ";t.css(o,"calc("+("(100% - "+n+" - "+a+") * "+e)+r+n+")")}},goto:{max:function(){D.set.value(D.get.max())},min:function(){D.set.value(D.get.min())}},read:{metadata:function(){var e={thumbVal:P.data(a.thumbVal),secondThumbVal:P.data(a.secondThumbVal)};e.thumbVal&&(D.is.range()&&e.secondThumbVal?(D.debug("Current value set from metadata",e.thumbVal,e.secondThumbVal),D.set.rangeValue(e.thumbVal,e.secondThumbVal)):(D.debug("Current value set from metadata",e.thumbVal),D.set.value(e.thumbVal)))},settings:function(){!1!==p.start&&(D.is.range()?(D.debug("Start position set from settings",p.start,p.end),D.set.rangeValue(p.start,p.end)):(D.debug("Start position set from settings",p.start),D.set.value(p.start)))}},setting:function(e,t){if(D.debug("Changing setting",e,t),Y.isPlainObject(e))Y.extend(!0,p,e);else{if(t===K)return p[e];Y.isPlainObject(p[e])?Y.extend(!0,p[e],t):p[e]=t}},internal:function(e,t){if(Y.isPlainObject(e))Y.extend(!0,D,e);else{if(t===K)return D[e];D[e]=t}},debug:function(){!p.silent&&p.debug&&(p.performance?D.performance.log(arguments):(D.debug=Function.prototype.bind.call(console.info,console,p.name+":"),D.debug.apply(console,arguments)))},verbose:function(){!p.silent&&p.verbose&&p.debug&&(p.performance?D.performance.log(arguments):(D.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),D.verbose.apply(console,arguments)))},error:function(){p.silent||(D.error=Function.prototype.bind.call(console.error,console,p.name+":"),D.error.apply(console,arguments))},performance:{log:function(e){var t,n;p.performance&&(n=(t=Date.now())-(j||t),j=t,z.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:E,"Execution Time":n})),clearTimeout(D.performance.timer),D.performance.timer=setTimeout(D.performance.display,500)},display:function(){var e=p.name+":",n=0;j=!1,clearTimeout(D.performance.timer),Y.each(z,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",N&&(e+=" '"+N+"'"),(console.group!==K||console.table!==K)&&0<z.length&&(console.groupCollapsed(e),console.table?console.table(z):Y.each(z,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),z=[]}},invoke:function(a,e,t){var o,r,n,s,i=C;return e=e||B,t=t||E,"string"==typeof a&&i!==K&&(a=a.split(/[ .]/),o=a.length-1,Y.each(a,function(e,t){var n=e!==o?t+a[e+1].charAt(0).toUpperCase()+a[e+1].slice(1):a;if(Y.isPlainObject(i[n])&&e!==o)i=i[n];else{if(i[n]!==K)return r=i[n],!1;{if(!Y.isPlainObject(i[t])||e===o)return i[t]!==K?r=i[t]:D.error(V.method,a),!1;i=i[t]}}})),"function"==typeof(s=r)&&"number"!=typeof s.nodeType?n=r.apply(t,e):r!==K&&(n=r),Array.isArray(A)?A.push(n):A!==K?A=[A,n]:n!==K&&(A=n),r}};R?(C===K&&D.initialize(),D.invoke(I)):(C!==K&&C.invoke("destroy"),D.initialize())}),A!==K?A:this},Y.fn.slider.settings={silent:!1,debug:!1,verbose:!1,performance:!0,name:"Slider",namespace:"slider",error:{method:"The method you called is not defined.",notrange:"This slider is not a range slider"},metadata:{thumbVal:"thumbVal",secondThumbVal:"secondThumbVal"},min:0,max:20,step:1,start:0,end:20,labelType:"number",showLabelTicks:!1,smooth:!1,autoAdjustLabels:!0,labelDistance:100,preventCrossover:!0,fireOnInit:!1,interpretLabel:!1,decimalPlaces:2,pageMultiplier:2,selector:{},className:{reversed:"reversed",disabled:"disabled",labeled:"labeled",ticked:"ticked",vertical:"vertical",range:"range",smooth:"smooth"},keys:{pageUp:33,pageDown:34,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40},labelTypes:{number:"number",letter:"letter"},onChange:function(e,t,n){},onMove:function(e,t,n){}}}(jQuery,window,document);
|
package/dist/components/state.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.1-beta.
|
2
|
+
* # Fomantic-UI 2.9.1-beta.25+bbe4e58 - State
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -15,7 +15,7 @@
|
|
15
15
|
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
|
16
16
|
}
|
17
17
|
|
18
|
-
window =
|
18
|
+
window = window !== undefined && window.Math === Math
|
19
19
|
? window
|
20
20
|
: globalThis;
|
21
21
|
|
@@ -29,14 +29,14 @@
|
|
29
29
|
performance = [],
|
30
30
|
|
31
31
|
query = arguments[0],
|
32
|
-
methodInvoked =
|
32
|
+
methodInvoked = typeof query === 'string',
|
33
33
|
queryArguments = [].slice.call(arguments, 1),
|
34
34
|
|
35
35
|
returnedValue
|
36
36
|
;
|
37
37
|
$allModules.each(function () {
|
38
38
|
var
|
39
|
-
settings =
|
39
|
+
settings = $.isPlainObject(parameters)
|
40
40
|
? $.extend(true, {}, $.fn.state.settings, parameters)
|
41
41
|
: $.extend({}, $.fn.state.settings),
|
42
42
|
|
@@ -130,7 +130,7 @@
|
|
130
130
|
return $module.hasClass(className.loading);
|
131
131
|
},
|
132
132
|
inactive: function () {
|
133
|
-
return
|
133
|
+
return !$module.hasClass(className.active);
|
134
134
|
},
|
135
135
|
state: function (state) {
|
136
136
|
if (className[state] === undefined) {
|
@@ -141,13 +141,13 @@
|
|
141
141
|
},
|
142
142
|
|
143
143
|
enabled: function () {
|
144
|
-
return
|
144
|
+
return !$module.is(settings.filter.active);
|
145
145
|
},
|
146
146
|
disabled: function () {
|
147
|
-
return
|
147
|
+
return $module.is(settings.filter.active);
|
148
148
|
},
|
149
149
|
textEnabled: function () {
|
150
|
-
return
|
150
|
+
return !$module.is(settings.filter.text);
|
151
151
|
},
|
152
152
|
|
153
153
|
// definitions for automatic type detection
|
@@ -233,7 +233,7 @@
|
|
233
233
|
}
|
234
234
|
$.when(apiRequest)
|
235
235
|
.then(function () {
|
236
|
-
if (apiRequest.state()
|
236
|
+
if (apiRequest.state() === 'resolved') {
|
237
237
|
module.debug('API request succeeded');
|
238
238
|
settings.activateTest = function () {
|
239
239
|
return true;
|
@@ -339,7 +339,7 @@
|
|
339
339
|
|
340
340
|
get: {
|
341
341
|
text: function () {
|
342
|
-
return
|
342
|
+
return settings.selector.text
|
343
343
|
? $module.find(settings.selector.text).text()
|
344
344
|
: $module.html();
|
345
345
|
},
|
@@ -519,17 +519,17 @@
|
|
519
519
|
query = query.split(/[ .]/);
|
520
520
|
maxDepth = query.length - 1;
|
521
521
|
$.each(query, function (depth, value) {
|
522
|
-
var camelCaseValue =
|
522
|
+
var camelCaseValue = depth !== maxDepth
|
523
523
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
524
524
|
: query
|
525
525
|
;
|
526
|
-
if ($.isPlainObject(object[camelCaseValue]) && (depth
|
526
|
+
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
527
527
|
object = object[camelCaseValue];
|
528
528
|
} else if (object[camelCaseValue] !== undefined) {
|
529
529
|
found = object[camelCaseValue];
|
530
530
|
|
531
531
|
return false;
|
532
|
-
} else if ($.isPlainObject(object[value]) && (depth
|
532
|
+
} else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
|
533
533
|
object = object[value];
|
534
534
|
} else if (object[value] !== undefined) {
|
535
535
|
found = object[value];
|
@@ -572,7 +572,7 @@
|
|
572
572
|
}
|
573
573
|
});
|
574
574
|
|
575
|
-
return
|
575
|
+
return returnedValue !== undefined
|
576
576
|
? returnedValue
|
577
577
|
: this;
|
578
578
|
};
|