fomantic-ui 2.9.1-beta.22 → 2.9.1-beta.24
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/index.js +23 -0
- package/.eslint/no-extra-parens-rule.js +17 -0
- package/.eslint/package.json +11 -0
- package/.eslintrc.js +13 -70
- package/.stylelintrc.js +5 -7
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +26 -26
- 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 +95 -94
- 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 +3 -3
- package/dist/components/calendar.js +181 -151
- package/dist/components/calendar.min.css +2 -2
- 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 +14 -14
- 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 +23 -25
- 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 +252 -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 +27 -33
- 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 +2 -2
- package/dist/components/flyout.js +50 -44
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +2 -2
- package/dist/components/form.js +187 -163
- package/dist/components/form.min.css +2 -2
- 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 +49 -45
- 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 +22 -20
- 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 +71 -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 +46 -46
- 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 +15 -15
- 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 +69 -74
- 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 +39 -39
- 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 +39 -37
- 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 +22 -21
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.js +69 -64
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +15 -15
- 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 +55 -57
- 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 +57 -30
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +7 -7
- package/dist/components/transition.js +45 -39
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +25 -25
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +60 -60
- package/dist/semantic.js +1518 -1427
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/examples/responsive.html +1 -1
- package/gulpfile.js +1 -1
- package/package.json +2 -1
- package/scripts/nightly-version.js +6 -4
- package/src/definitions/behaviors/api.js +94 -93
- package/src/definitions/behaviors/form.js +186 -162
- package/src/definitions/behaviors/state.js +14 -14
- package/src/definitions/behaviors/visibility.js +24 -24
- package/src/definitions/collections/menu.less +2 -2
- package/src/definitions/elements/button.less +2 -2
- package/src/definitions/elements/loader.less +4 -4
- package/src/definitions/elements/step.less +1 -1
- package/src/definitions/globals/site.js +21 -20
- package/src/definitions/modules/accordion.js +25 -25
- package/src/definitions/modules/calendar.js +180 -150
- package/src/definitions/modules/calendar.less +2 -2
- package/src/definitions/modules/checkbox.js +13 -13
- package/src/definitions/modules/dimmer.js +22 -24
- package/src/definitions/modules/dimmer.less +10 -10
- package/src/definitions/modules/dropdown.js +251 -253
- package/src/definitions/modules/embed.js +26 -32
- package/src/definitions/modules/flyout.js +49 -43
- package/src/definitions/modules/flyout.less +1 -1
- package/src/definitions/modules/modal.js +48 -44
- package/src/definitions/modules/nag.js +21 -19
- package/src/definitions/modules/popup.js +70 -70
- package/src/definitions/modules/progress.js +45 -45
- package/src/definitions/modules/rating.js +14 -14
- package/src/definitions/modules/search.js +68 -73
- package/src/definitions/modules/shape.js +38 -38
- package/src/definitions/modules/sidebar.js +38 -36
- package/src/definitions/modules/slider.js +68 -63
- package/src/definitions/modules/sticky.js +24 -24
- package/src/definitions/modules/tab.js +54 -56
- package/src/definitions/modules/toast.js +56 -29
- package/src/definitions/modules/transition.js +44 -38
- package/src/themes/amazon/elements/button.overrides +7 -7
- package/src/themes/default/collections/form.variables +1 -1
- package/src/themes/default/elements/reveal.variables +1 -1
- package/src/themes/default/globals/site.variables +1 -1
- package/src/themes/default/modules/dimmer.variables +6 -6
- package/src/themes/default/modules/modal.variables +1 -1
- package/src/themes/default/modules/slider.variables +4 -4
- package/src/themes/default/modules/toast.variables +2 -2
- package/src/themes/default/modules/transition.overrides +12 -12
- package/src/themes/flat/collections/form.overrides +2 -2
- package/src/themes/flat/globals/site.variables +1 -1
- package/src/themes/github/collections/form.overrides +2 -2
- package/src/themes/github/collections/menu.variables +1 -1
- package/src/themes/github/collections/message.overrides +3 -3
- package/src/themes/github/elements/input.overrides +2 -2
- package/src/themes/timeline/views/feed.overrides +3 -3
- package/src/themes/twitter/elements/button.overrides +2 -2
- package/tasks/README.md +1 -3
- package/tasks/admin/components/create.js +9 -16
- package/tasks/admin/components/init.js +7 -7
- package/tasks/admin/components/update.js +10 -10
- package/tasks/admin/distributions/create.js +16 -18
- package/tasks/admin/distributions/init.js +7 -7
- package/tasks/admin/distributions/update.js +10 -10
- package/tasks/admin/publish.js +1 -3
- package/tasks/admin/register.js +6 -6
- package/tasks/admin/release.js +1 -3
- package/tasks/build/assets.js +2 -2
- package/tasks/build/css.js +8 -3
- package/tasks/build/javascript.js +3 -1
- package/tasks/build.js +1 -1
- package/tasks/check-install.js +1 -1
- package/tasks/clean.js +1 -1
- package/tasks/collections/README.md +3 -5
- package/tasks/collections/admin.js +1 -1
- package/tasks/collections/docs.js +1 -1
- package/tasks/collections/install.js +1 -1
- package/tasks/collections/rtl.js +1 -1
- package/tasks/collections/various.js +1 -1
- package/tasks/config/admin/github.js +6 -8
- package/tasks/config/admin/templates/css-package.js +1 -1
- package/tasks/config/admin/templates/less-package.js +1 -1
- package/tasks/config/npm/gulpfile.js +7 -7
- package/tasks/config/project/config.js +14 -19
- package/tasks/config/project/install.js +35 -34
- package/tasks/config/project/release.js +15 -16
- package/tasks/config/tasks.js +18 -20
- package/tasks/config/user.js +5 -3
- package/tasks/docs/build.js +5 -3
- package/tasks/docs/metadata.js +7 -8
- package/tasks/docs/serve.js +6 -3
- package/tasks/install.js +39 -39
- 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/.eslintrc.js +0 -4
- package/test/meteor/assets.js +1 -1
- package/test/modules/module.spec.js +15 -15
- package/test/modules/popup.spec.js +1 -1
- package/test/modules/search.spec.js +1 -1
- package/test/modules/tab.spec.js +1 -1
- package/test/modules/transition.spec.js +1 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.1-beta.
|
2
|
+
* # Fomantic-UI 2.9.1-beta.24+029436f - Progress
|
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
|
|
@@ -25,11 +25,11 @@
|
|
25
25
|
|
26
26
|
moduleSelector = $allModules.selector || '',
|
27
27
|
|
28
|
-
time =
|
28
|
+
time = Date.now(),
|
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
|
@@ -37,7 +37,7 @@
|
|
37
37
|
|
38
38
|
$allModules.each(function () {
|
39
39
|
var
|
40
|
-
settings =
|
40
|
+
settings = $.isPlainObject(parameters)
|
41
41
|
? $.extend(true, {}, $.fn.progress.settings, parameters)
|
42
42
|
: $.extend({}, $.fn.progress.settings),
|
43
43
|
|
@@ -95,7 +95,7 @@
|
|
95
95
|
var precision = 1;
|
96
96
|
var ratio = min / total;
|
97
97
|
while (precisionPower < 10) {
|
98
|
-
ratio
|
98
|
+
ratio *= precision;
|
99
99
|
if (ratio > 1) {
|
100
100
|
break;
|
101
101
|
}
|
@@ -107,11 +107,9 @@
|
|
107
107
|
forceArray: function (element) {
|
108
108
|
return Array.isArray(element)
|
109
109
|
? element
|
110
|
-
: !isNaN(element)
|
110
|
+
: (!isNaN(element)
|
111
111
|
? [element]
|
112
|
-
: typeof element
|
113
|
-
? element.split(',')
|
114
|
-
: [];
|
112
|
+
: (typeof element === 'string' ? element.split(',') : [])); // eslint-disable-line unicorn/no-nested-ternary
|
115
113
|
},
|
116
114
|
},
|
117
115
|
|
@@ -256,22 +254,25 @@
|
|
256
254
|
return module.progressPoll;
|
257
255
|
},
|
258
256
|
total: function () {
|
259
|
-
return
|
257
|
+
return module.get.total() !== false;
|
260
258
|
},
|
261
259
|
},
|
262
260
|
|
263
261
|
get: {
|
264
262
|
text: function (templateText, index) {
|
263
|
+
if (!index) {
|
264
|
+
index = 0;
|
265
|
+
}
|
266
|
+
|
265
267
|
var
|
266
|
-
|
267
|
-
value = module.get.value(index_),
|
268
|
+
value = module.get.value(index),
|
268
269
|
total = module.get.total(),
|
269
|
-
percent =
|
270
|
-
? module.get.displayPercent(
|
271
|
-
: module.get.percent(
|
272
|
-
left =
|
270
|
+
percent = animating
|
271
|
+
? module.get.displayPercent(index)
|
272
|
+
: module.get.percent(index),
|
273
|
+
left = total !== false
|
273
274
|
? Math.max(0, total - value)
|
274
|
-
:
|
275
|
+
: 100 - percent
|
275
276
|
;
|
276
277
|
templateText = templateText || '';
|
277
278
|
templateText = templateText
|
@@ -279,7 +280,7 @@
|
|
279
280
|
.replace('{total}', total || 0)
|
280
281
|
.replace('{left}', left)
|
281
282
|
.replace('{percent}', percent)
|
282
|
-
.replace('{bar}', settings.text.bars[
|
283
|
+
.replace('{bar}', settings.text.bars[index] || '')
|
283
284
|
;
|
284
285
|
module.verbose('Adding variables to progress bar text', templateText);
|
285
286
|
|
@@ -322,10 +323,10 @@
|
|
322
323
|
},
|
323
324
|
|
324
325
|
numericValue: function (value) {
|
325
|
-
return
|
326
|
-
? (value.replace(/[^\d.]/g, '') !== ''
|
327
|
-
? +
|
328
|
-
: false
|
326
|
+
return typeof value === 'string'
|
327
|
+
? (value.replace(/[^\d.]/g, '') !== ''
|
328
|
+
? +value.replace(/[^\d.]/g, '')
|
329
|
+
: false)
|
329
330
|
: value;
|
330
331
|
},
|
331
332
|
|
@@ -354,21 +355,21 @@
|
|
354
355
|
barWidth = $bar.width(),
|
355
356
|
totalWidth = $module.width(),
|
356
357
|
minDisplay = parseInt($bar.css('min-width'), 10),
|
357
|
-
displayPercent =
|
358
|
-
? (barWidth / totalWidth * 100
|
358
|
+
displayPercent = barWidth > minDisplay
|
359
|
+
? (barWidth / totalWidth) * 100
|
359
360
|
: module.percent
|
360
361
|
;
|
361
362
|
|
362
|
-
return
|
363
|
+
return settings.precision > 0
|
363
364
|
? Math.round(displayPercent * (10 * settings.precision)) / (10 * settings.precision)
|
364
365
|
: Math.round(displayPercent);
|
365
366
|
},
|
366
367
|
|
367
368
|
percent: function (index) {
|
368
|
-
return module.percent && module.percent[index || 0] || 0;
|
369
|
+
return (module.percent && module.percent[index || 0]) || 0;
|
369
370
|
},
|
370
371
|
value: function (index) {
|
371
|
-
return module.nextValue || module.value && module.value[index || 0] || 0;
|
372
|
+
return module.nextValue || (module.value && module.value[index || 0]) || 0;
|
372
373
|
},
|
373
374
|
total: function () {
|
374
375
|
return module.total !== undefined ? module.total : false;
|
@@ -451,7 +452,7 @@
|
|
451
452
|
var barCounts = $bars.length;
|
452
453
|
var isMultiple = barCounts > 1;
|
453
454
|
var percents = values.map(function (value, index) {
|
454
|
-
var allZero =
|
455
|
+
var allZero = index === barCounts - 1 && valuesSum === 0;
|
455
456
|
var $bar = $($bars[index]);
|
456
457
|
if (value === 0 && isMultiple && !allZero) {
|
457
458
|
$bar.css('display', 'none');
|
@@ -486,7 +487,7 @@
|
|
486
487
|
},
|
487
488
|
duration: function (duration) {
|
488
489
|
duration = duration || settings.duration;
|
489
|
-
duration =
|
490
|
+
duration = typeof duration === 'number'
|
490
491
|
? duration + 'ms'
|
491
492
|
: duration;
|
492
493
|
module.verbose('Setting progress bar transition duration', duration);
|
@@ -498,11 +499,11 @@
|
|
498
499
|
},
|
499
500
|
percent: function (percents) {
|
500
501
|
percents = module.helper.forceArray(percents).map(function (percent) {
|
501
|
-
percent =
|
502
|
-
? +
|
502
|
+
percent = typeof percent === 'string'
|
503
|
+
? +percent.replace('%', '')
|
503
504
|
: percent;
|
504
505
|
|
505
|
-
return
|
506
|
+
return settings.limitValues
|
506
507
|
? Math.max(0, Math.min(100, percent))
|
507
508
|
: percent;
|
508
509
|
});
|
@@ -521,13 +522,13 @@
|
|
521
522
|
} else {
|
522
523
|
var autoPrecision = settings.precision > 0
|
523
524
|
? settings.precision
|
524
|
-
: isMultipleValues
|
525
|
+
: (isMultipleValues
|
525
526
|
? module.helper.derivePrecision(Math.min.apply(null, module.value), module.total)
|
526
|
-
: 0;
|
527
|
+
: 0);
|
527
528
|
|
528
529
|
// round display percentage
|
529
530
|
var roundedPercents = percents.map(function (percent) {
|
530
|
-
return
|
531
|
+
return autoPrecision > 0
|
531
532
|
? Math.round(percent * (10 * autoPrecision)) / (10 * autoPrecision)
|
532
533
|
: Math.round(percent)
|
533
534
|
;
|
@@ -535,7 +536,7 @@
|
|
535
536
|
module.percent = roundedPercents;
|
536
537
|
if (hasTotal) {
|
537
538
|
module.value = percents.map(function (percent) {
|
538
|
-
return
|
539
|
+
return autoPrecision > 0
|
539
540
|
? Math.round((percent / 100) * module.total * (10 * autoPrecision)) / (10 * autoPrecision)
|
540
541
|
: Math.round((percent / 100) * module.total * 10) / 10;
|
541
542
|
});
|
@@ -574,7 +575,6 @@
|
|
574
575
|
module.set.state();
|
575
576
|
},
|
576
577
|
label: function (text) {
|
577
|
-
text = text || '';
|
578
578
|
if (text) {
|
579
579
|
text = module.get.text(text);
|
580
580
|
module.verbose('Setting label to text', text);
|
@@ -582,7 +582,7 @@
|
|
582
582
|
}
|
583
583
|
},
|
584
584
|
state: function (percent) {
|
585
|
-
percent =
|
585
|
+
percent = percent !== undefined
|
586
586
|
? percent
|
587
587
|
: module.helper.sum(module.percent);
|
588
588
|
if (percent === 100) {
|
@@ -807,7 +807,7 @@
|
|
807
807
|
previousTime
|
808
808
|
;
|
809
809
|
if (settings.performance) {
|
810
|
-
currentTime =
|
810
|
+
currentTime = Date.now();
|
811
811
|
previousTime = time || currentTime;
|
812
812
|
executionTime = currentTime - previousTime;
|
813
813
|
time = currentTime;
|
@@ -858,11 +858,11 @@
|
|
858
858
|
;
|
859
859
|
passedArguments = passedArguments || queryArguments;
|
860
860
|
context = context || element;
|
861
|
-
if (typeof query
|
862
|
-
query = query.split(/[
|
861
|
+
if (typeof query === 'string' && object !== undefined) {
|
862
|
+
query = query.split(/[ .]/);
|
863
863
|
maxDepth = query.length - 1;
|
864
864
|
$.each(query, function (depth, value) {
|
865
|
-
var camelCaseValue =
|
865
|
+
var camelCaseValue = depth != maxDepth
|
866
866
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
867
867
|
: query
|
868
868
|
;
|
@@ -915,7 +915,7 @@
|
|
915
915
|
}
|
916
916
|
});
|
917
917
|
|
918
|
-
return
|
918
|
+
return returnedValue !== undefined
|
919
919
|
? returnedValue
|
920
920
|
: this;
|
921
921
|
};
|
@@ -945,7 +945,7 @@
|
|
945
945
|
|
946
946
|
label: 'percent',
|
947
947
|
precision: 0,
|
948
|
-
framerate:
|
948
|
+
framerate: 1000 / 30, /// 30 fps
|
949
949
|
|
950
950
|
percent: false,
|
951
951
|
total: false,
|
@@ -972,7 +972,7 @@
|
|
972
972
|
},
|
973
973
|
|
974
974
|
regExp: {
|
975
|
-
variable:
|
975
|
+
variable: /{\$*[\da-z]+}/gi,
|
976
976
|
},
|
977
977
|
|
978
978
|
metadata: {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.1-beta.
|
2
|
+
* # Fomantic UI - 2.9.1-beta.24+029436f
|
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(A,e,E,P){"use strict";e=void 0!==e&&e.Math==Math?e:globalThis,A.fn.progress=function(m){var b,e=A(this),h=e.selector||"",x=(new Date).getTime(),y=[],w=m,T="string"==typeof w,V=[].slice.call(arguments,1);return e.each(function(){var i=A.isPlainObject(m)?A.extend(!0,{},A.fn.progress.settings,m):A.extend({},A.fn.progress.settings),r=i.className,t=i.metadata,e=i.namespace,n=i.selector,l=i.error,a="."+e,o="module-"+e,c=A(this),u=A(this).find(n.bar),s=A(this).find(n.progress),p=A(this).find(n.label),d=this,g=c.data(o),v=!1,f={helper:{sum:function(e){return Array.isArray(e)?e.reduce(function(e,t){return e+Number(t)},0):0},derivePrecision:function(e,t){for(var r=0,n=1,a=e/t;r<10&&!(1<(a*=n));)n=Math.pow(10,r++);return n},forceArray:function(e){return Array.isArray(e)?e:isNaN(e)?"string"==typeof e?e.split(","):[]:[e]}},initialize:function(){f.set.duration(),f.set.transitionEvent(),f.debug(d),f.read.metadata(),f.read.settings(),f.instantiate()},instantiate:function(){f.verbose("Storing instance of progress",f),g=f,c.data(o,f)},destroy:function(){f.verbose("Destroying previous progress for",c),clearInterval(g.interval),f.remove.state(),c.removeData(o),g=P},reset:function(){f.remove.nextValue(),f.update.progress(0)},complete:function(e){(f.percent===P||f.percent<100)&&(f.remove.progressPoll(),!0!==e&&f.set.percent(100))},read:{metadata:function(){var e={percent:f.helper.forceArray(c.data(t.percent)),total:c.data(t.total),value:f.helper.forceArray(c.data(t.value))};e.total!==P&&(f.debug("Total value set from metadata",e.total),f.set.total(e.total)),0<e.value.length&&(f.debug("Current value set from metadata",e.value),f.set.value(e.value),f.set.progress(e.value)),0<e.percent.length&&(f.debug("Current percent value set from metadata",e.percent),f.set.percent(e.percent))},settings:function(){!1!==i.total&&(f.debug("Current total set in settings",i.total),f.set.total(i.total)),!1!==i.value&&(f.debug("Current value set in settings",i.value),f.set.value(i.value),f.set.progress(f.value)),!1!==i.percent&&(f.debug("Current percent set in settings",i.percent),f.set.percent(i.percent))}},bind:{transitionEnd:function(t){var e=f.get.transitionEnd();u.one(e+a,function(e){clearTimeout(f.failSafeTimer),t.call(this,e)}),f.failSafeTimer=setTimeout(function(){u.triggerHandler(e)},i.duration+i.failSafeDelay),f.verbose("Adding fail safe timer",f.timer)}},increment:function(e){var t;e=f.has.total()?(t=f.get.value(),e||1):(t=f.get.percent(),e||f.get.randomValue()),f.debug("Incrementing percentage by",t,t=t+e,e),t=f.get.normalizedValue(t),f.set.progress(t)},decrement:function(e){var t,r;f.get.total()?(r=(t=f.get.value())-(e=e||1),f.debug("Decrementing value by",e,t)):(r=(t=f.get.percent())-(e=e||f.get.randomValue()),f.debug("Decrementing percentage by",e,t)),r=f.get.normalizedValue(r),f.set.progress(r)},has:{progressPoll:function(){return f.progressPoll},total:function(){return!1!==f.get.total()}},get:{text:function(e,t){var t=t||0,r=f.get.value(t),n=f.get.total(),a=v?f.get.displayPercent(t):f.get.percent(t),o=!1!==n?Math.max(0,n-r):100-a;return e=(e=e||"").replace("{value}",r).replace("{total}",n||0).replace("{left}",o).replace("{percent}",a).replace("{bar}",i.text.bars[t]||""),f.verbose("Adding variables to progress bar text",e),e},normalizedValue:function(e){if(e<0)return f.debug("Value cannot decrement below 0"),0;if(f.has.total()){if(e>f.total)return f.debug("Value cannot increment above total",f.total),f.total}else if(100<e)return f.debug("Value cannot increment above 100 percent"),100;return e},updateInterval:function(){return"auto"==i.updateInterval?i.duration:i.updateInterval},randomValue:function(){return f.debug("Generating random increment percentage"),Math.floor(Math.random()*i.random.max+i.random.min)},numericValue:function(e){return"string"==typeof e?""!==e.replace(/[^\d.]/g,"")&&+e.replace(/[^\d.]/g,""):e},transitionEnd:function(){var e,t=E.createElement("element"),r={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in r)if(t.style[e]!==P)return r[e]},displayPercent:function(e){var e=A(u[e]),t=e.width(),r=c.width(),e=parseInt(e.css("min-width"),10)<t?t/r*100:f.percent;return 0<i.precision?Math.round(e*(10*i.precision))/(10*i.precision):Math.round(e)},percent:function(e){return f.percent&&f.percent[e||0]||0},value:function(e){return f.nextValue||f.value&&f.value[e||0]||0},total:function(){return f.total!==P&&f.total}},create:{progressPoll:function(){f.progressPoll=setTimeout(function(){f.update.toNextValue(),f.remove.progressPoll()},f.get.updateInterval())}},is:{complete:function(){return f.is.success()||f.is.warning()||f.is.error()},success:function(){return c.hasClass(r.success)},warning:function(){return c.hasClass(r.warning)},error:function(){return c.hasClass(r.error)},active:function(){return c.hasClass(r.active)},visible:function(){return c.is(":visible")}},remove:{progressPoll:function(){f.verbose("Removing progress poll timer"),f.progressPoll&&(clearTimeout(f.progressPoll),delete f.progressPoll)},nextValue:function(){f.verbose("Removing progress value stored for next update"),delete f.nextValue},state:function(){f.verbose("Removing stored state"),delete f.total,delete f.percent,delete f.value},active:function(){f.verbose("Removing active state"),c.removeClass(r.active)},success:function(){f.verbose("Removing success state"),c.removeClass(r.success)},warning:function(){f.verbose("Removing warning state"),c.removeClass(r.warning)},error:function(){f.verbose("Removing error state"),c.removeClass(r.error)}},set:{barWidth:function(e){f.debug("set bar width with ",e),e=f.helper.forceArray(e);var a=-1,o=-1,i=f.helper.sum(e),s=u.length,l=1<s,t=e.map(function(e,t){var r=t===s-1&&0===i,n=A(u[t]);return 0===e&&l&&!r?n.css("display","none"):(l&&r&&n.css("background","transparent"),-1==a&&(a=t),o=t,n.css({display:"block",width:e+"%"})),parseFloat(e)});e.forEach(function(e,t){A(u[t]).css({borderTopLeftRadius:t==a?"":"0",borderBottomLeftRadius:t==a?"":"0",borderTopRightRadius:t==o?"":"0",borderBottomRightRadius:t==o?"":"0"})}),c.attr("data-percent",t)},duration:function(e){e=e||i.duration,f.verbose("Setting progress bar transition duration",e="number"==typeof e?e+"ms":e),u.css({"transition-duration":e})},percent:function(e){e=f.helper.forceArray(e).map(function(e){return e="string"==typeof e?+e.replace("%",""):e,i.limitValues?Math.max(0,Math.min(100,e)):e});var t,r=f.has.total(),n=f.helper.sum(e),a=1<e.length&&r,o=f.helper.sum(f.helper.forceArray(f.value));a&&o>f.total?f.error(l.sumExceedsTotal,o,f.total):!a&&100<n?f.error(l.tooHigh,n):n<0?f.error(l.tooLow,n):(t=0<i.precision?i.precision:a?f.helper.derivePrecision(Math.min.apply(null,f.value),f.total):0,o=e.map(function(e){return 0<t?Math.round(e*(10*t))/(10*t):Math.round(e)}),f.percent=o,r&&(f.value=e.map(function(e){return 0<t?Math.round(e/100*f.total*(10*t))/(10*t):Math.round(e/100*f.total*10)/10})),f.set.barWidth(e),f.set.labelInterval()),i.onChange.call(d,e,f.value,f.total)},labelInterval:function(){clearInterval(f.interval),f.bind.transitionEnd(function(){f.verbose("Bar finished animating, removing continuous label updates"),clearInterval(f.interval),v=!1,f.set.labels()}),v=!0,f.interval=setInterval(function(){A.contains(E.documentElement,d)||(clearInterval(f.interval),v=!1),f.set.labels()},i.framerate)},labels:function(){f.verbose("Setting both bar progress and outer label text"),f.set.barLabel(),f.set.state()},label:function(e){(e=e||"")&&(e=f.get.text(e),f.verbose("Setting label to text",e),p.text(e))},state:function(e){100===(e=e!==P?e:f.helper.sum(f.percent))?i.autoSuccess&&1===u.length&&!(f.is.warning()||f.is.error()||f.is.success())?(f.set.success(),f.debug("Automatically triggering success at 100%")):(f.verbose("Reached 100% removing active state"),f.remove.active(),f.remove.progressPoll()):0<e?(f.verbose("Adjusting active progress bar label",e),f.set.active()):(f.remove.active(),f.remove.warning(),f.remove.error(),f.remove.success(),f.set.label(i.text.active))},barLabel:function(r){s.each(function(e,t){t=A(t);r!==P?t.text(f.get.text(r,e)):"ratio"==i.label&&f.has.total()?(f.verbose("Adding ratio to bar label"),t.text(f.get.text(i.text.ratio,e))):"percent"==i.label&&(f.verbose("Adding percentage to bar label"),t.text(f.get.text(i.text.percent,e)))})},active:function(e){e=e||i.text.active,f.debug("Setting active state"),i.showActivity&&!f.is.active()&&c.addClass(r.active),f.remove.warning(),f.remove.error(),f.remove.success(),(e=i.onLabelUpdate("active",e,f.value,f.total))&&f.set.label(e),f.bind.transitionEnd(function(){i.onActive.call(d,f.value,f.total)})},success:function(e,t){e=e||i.text.success||i.text.active,f.debug("Setting success state"),c.addClass(r.success),f.remove.active(),f.remove.warning(),f.remove.error(),f.complete(t),e=i.text.success?i.onLabelUpdate("success",e,f.value,f.total):i.onLabelUpdate("active",e,f.value,f.total),f.set.label(e),f.bind.transitionEnd(function(){i.onSuccess.call(d,f.total)})},warning:function(e,t){e=e||i.text.warning,f.debug("Setting warning state"),c.addClass(r.warning),f.remove.active(),f.remove.success(),f.remove.error(),f.complete(t),(e=i.onLabelUpdate("warning",e,f.value,f.total))&&f.set.label(e),f.bind.transitionEnd(function(){i.onWarning.call(d,f.value,f.total)})},error:function(e,t){e=e||i.text.error,f.debug("Setting error state"),c.addClass(r.error),f.remove.active(),f.remove.success(),f.remove.warning(),f.complete(t),(e=i.onLabelUpdate("error",e,f.value,f.total))&&f.set.label(e),f.bind.transitionEnd(function(){i.onError.call(d,f.value,f.total)})},transitionEvent:function(){f.get.transitionEnd()},total:function(e){f.total=e},value:function(e){f.value=f.helper.forceArray(e)},progress:function(e){f.has.progressPoll()?(f.debug("Updated within interval, setting next update to use new value",e),f.set.nextValue(e)):(f.debug("First update in progress update interval, immediately updating",e),f.update.progress(e),f.create.progressPoll())},nextValue:function(e){f.nextValue=e}},update:{toNextValue:function(){var e=f.nextValue;e&&(f.debug("Update interval complete using last updated value",e),f.update.progress(e),f.remove.nextValue())},progress:function(e){var r=f.has.total(),e=(r&&f.set.value(e),f.helper.forceArray(e).map(function(e){var t;return!1===(e=f.get.numericValue(e))&&f.error(l.nonNumeric,e),e=f.get.normalizedValue(e),r?(t=0<f.total?e/f.total*100:100,f.debug("Calculating percent complete from total",t)):(t=e,f.debug("Setting value to exact percentage value",t)),t}));f.set.percent(e)}},setting:function(e,t){if(f.debug("Changing setting",e,t),A.isPlainObject(e))A.extend(!0,i,e);else{if(t===P)return i[e];A.isPlainObject(i[e])?A.extend(!0,i[e],t):i[e]=t}},internal:function(e,t){if(A.isPlainObject(e))A.extend(!0,f,e);else{if(t===P)return f[e];f[e]=t}},debug:function(){!i.silent&&i.debug&&(i.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,i.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!i.silent&&i.verbose&&i.debug&&(i.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,i.name+":"),f.verbose.apply(console,arguments)))},error:function(){i.silent||(f.error=Function.prototype.bind.call(console.error,console,i.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var t,r;i.performance&&(r=(t=(new Date).getTime())-(x||t),x=t,y.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:d,"Execution Time":r})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var e=i.name+":",r=0;x=!1,clearTimeout(f.performance.timer),A.each(y,function(e,t){r+=t["Execution Time"]}),e+=" "+r+"ms",h&&(e+=" '"+h+"'"),(console.group!==P||console.table!==P)&&0<y.length&&(console.groupCollapsed(e),console.table?console.table(y):A.each(y,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),y=[]}},invoke:function(n,e,t){var a,o,r,i,s=g;return e=e||V,t=t||d,"string"==typeof n&&s!==P&&(n=n.split(/[\. ]/),a=n.length-1,A.each(n,function(e,t){var r=e!=a?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(A.isPlainObject(s[r])&&e!=a)s=s[r];else{if(s[r]!==P)return o=s[r],!1;{if(!A.isPlainObject(s[t])||e==a)return s[t]!==P?o=s[t]:f.error(l.method,n),!1;s=s[t]}}})),"function"==typeof(i=o)&&"number"!=typeof i.nodeType?r=o.apply(t,e):o!==P&&(r=o),Array.isArray(b)?b.push(r):b!==P?b=[b,r]:r!==P&&(b=r),o}};T?(g===P&&f.initialize(),f.invoke(w)):(g!==P&&g.invoke("destroy"),f.initialize())}),b!==P?b:this},A.fn.progress.settings={name:"Progress",namespace:"progress",silent:!1,debug:!1,verbose:!1,performance:!0,random:{min:2,max:5},duration:300,updateInterval:"auto",autoSuccess:!0,showActivity:!0,limitValues:!0,label:"percent",precision:0,framerate:1e3/30,percent:!1,total:!1,value:!1,failSafeDelay:100,onLabelUpdate:function(e,t,r,n){return t},onChange:function(e,t,r){},onSuccess:function(e){},onActive:function(e,t){},onError:function(e,t){},onWarning:function(e,t){},error:{method:"The method you called is not defined.",nonNumeric:"Progress value is non numeric",tooHigh:"Value specified is above 100%",tooLow:"Value specified is below 0%",sumExceedsTotal:"Sum of multiple values exceed total"},regExp:{variable:/\{\$*[a-z0-9]+\}/gi},metadata:{percent:"percent",total:"total",value:"value"},selector:{bar:"> .bar",label:"> .label",progress:".bar > .progress"},text:{active:!1,error:!1,success:!1,warning:!1,percent:"{percent}%",ratio:"{value} of {total}",bars:[""]},className:{active:"active",error:"error",success:"success",warning:"warning"}}}(jQuery,window,document);
|
11
|
+
!function(E,e,P,T){"use strict";e=e!==T&&e.Math===Math?e:globalThis,E.fn.progress=function(m){var b,e=E(this),h=e.selector||"",x=Date.now(),y=[],w=m,V="string"==typeof w,A=[].slice.call(arguments,1);return e.each(function(){var i=E.isPlainObject(m)?E.extend(!0,{},E.fn.progress.settings,m):E.extend({},E.fn.progress.settings),r=i.className,t=i.metadata,e=i.namespace,n=i.selector,l=i.error,a="."+e,o="module-"+e,c=E(this),u=E(this).find(n.bar),s=E(this).find(n.progress),p=E(this).find(n.label),d=this,g=c.data(o),v=!1,f={helper:{sum:function(e){return Array.isArray(e)?e.reduce(function(e,t){return e+Number(t)},0):0},derivePrecision:function(e,t){for(var r=0,n=1,a=e/t;r<10&&!(1<(a*=n));)n=Math.pow(10,r++);return n},forceArray:function(e){return Array.isArray(e)?e:isNaN(e)?"string"==typeof e?e.split(","):[]:[e]}},initialize:function(){f.set.duration(),f.set.transitionEvent(),f.debug(d),f.read.metadata(),f.read.settings(),f.instantiate()},instantiate:function(){f.verbose("Storing instance of progress",f),g=f,c.data(o,f)},destroy:function(){f.verbose("Destroying previous progress for",c),clearInterval(g.interval),f.remove.state(),c.removeData(o),g=T},reset:function(){f.remove.nextValue(),f.update.progress(0)},complete:function(e){(f.percent===T||f.percent<100)&&(f.remove.progressPoll(),!0!==e&&f.set.percent(100))},read:{metadata:function(){var e={percent:f.helper.forceArray(c.data(t.percent)),total:c.data(t.total),value:f.helper.forceArray(c.data(t.value))};e.total!==T&&(f.debug("Total value set from metadata",e.total),f.set.total(e.total)),0<e.value.length&&(f.debug("Current value set from metadata",e.value),f.set.value(e.value),f.set.progress(e.value)),0<e.percent.length&&(f.debug("Current percent value set from metadata",e.percent),f.set.percent(e.percent))},settings:function(){!1!==i.total&&(f.debug("Current total set in settings",i.total),f.set.total(i.total)),!1!==i.value&&(f.debug("Current value set in settings",i.value),f.set.value(i.value),f.set.progress(f.value)),!1!==i.percent&&(f.debug("Current percent set in settings",i.percent),f.set.percent(i.percent))}},bind:{transitionEnd:function(t){var e=f.get.transitionEnd();u.one(e+a,function(e){clearTimeout(f.failSafeTimer),t.call(this,e)}),f.failSafeTimer=setTimeout(function(){u.triggerHandler(e)},i.duration+i.failSafeDelay),f.verbose("Adding fail safe timer",f.timer)}},increment:function(e){var t;e=f.has.total()?(t=f.get.value(),e||1):(t=f.get.percent(),e||f.get.randomValue()),f.debug("Incrementing percentage by",t,t=t+e,e),t=f.get.normalizedValue(t),f.set.progress(t)},decrement:function(e){var t,r;f.get.total()?(r=(t=f.get.value())-(e=e||1),f.debug("Decrementing value by",e,t)):(r=(t=f.get.percent())-(e=e||f.get.randomValue()),f.debug("Decrementing percentage by",e,t)),r=f.get.normalizedValue(r),f.set.progress(r)},has:{progressPoll:function(){return f.progressPoll},total:function(){return!1!==f.get.total()}},get:{text:function(e,t){var r=f.get.value(t=t||0),n=f.get.total(),a=v?f.get.displayPercent(t):f.get.percent(t),o=!1!==n?Math.max(0,n-r):100-a;return e=(e=e||"").replace("{value}",r).replace("{total}",n||0).replace("{left}",o).replace("{percent}",a).replace("{bar}",i.text.bars[t]||""),f.verbose("Adding variables to progress bar text",e),e},normalizedValue:function(e){if(e<0)return f.debug("Value cannot decrement below 0"),0;if(f.has.total()){if(e>f.total)return f.debug("Value cannot increment above total",f.total),f.total}else if(100<e)return f.debug("Value cannot increment above 100 percent"),100;return e},updateInterval:function(){return"auto"==i.updateInterval?i.duration:i.updateInterval},randomValue:function(){return f.debug("Generating random increment percentage"),Math.floor(Math.random()*i.random.max+i.random.min)},numericValue:function(e){return"string"==typeof e?""!==e.replace(/[^\d.]/g,"")&&+e.replace(/[^\d.]/g,""):e},transitionEnd:function(){var e,t=P.createElement("element"),r={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in r)if(t.style[e]!==T)return r[e]},displayPercent:function(e){var e=E(u[e]),t=e.width(),r=c.width(),e=parseInt(e.css("min-width"),10)<t?t/r*100:f.percent;return 0<i.precision?Math.round(e*(10*i.precision))/(10*i.precision):Math.round(e)},percent:function(e){return f.percent&&f.percent[e||0]||0},value:function(e){return f.nextValue||f.value&&f.value[e||0]||0},total:function(){return f.total!==T&&f.total}},create:{progressPoll:function(){f.progressPoll=setTimeout(function(){f.update.toNextValue(),f.remove.progressPoll()},f.get.updateInterval())}},is:{complete:function(){return f.is.success()||f.is.warning()||f.is.error()},success:function(){return c.hasClass(r.success)},warning:function(){return c.hasClass(r.warning)},error:function(){return c.hasClass(r.error)},active:function(){return c.hasClass(r.active)},visible:function(){return c.is(":visible")}},remove:{progressPoll:function(){f.verbose("Removing progress poll timer"),f.progressPoll&&(clearTimeout(f.progressPoll),delete f.progressPoll)},nextValue:function(){f.verbose("Removing progress value stored for next update"),delete f.nextValue},state:function(){f.verbose("Removing stored state"),delete f.total,delete f.percent,delete f.value},active:function(){f.verbose("Removing active state"),c.removeClass(r.active)},success:function(){f.verbose("Removing success state"),c.removeClass(r.success)},warning:function(){f.verbose("Removing warning state"),c.removeClass(r.warning)},error:function(){f.verbose("Removing error state"),c.removeClass(r.error)}},set:{barWidth:function(e){f.debug("set bar width with ",e),e=f.helper.forceArray(e);var a=-1,o=-1,i=f.helper.sum(e),s=u.length,l=1<s,t=e.map(function(e,t){var r=t===s-1&&0===i,n=E(u[t]);return 0===e&&l&&!r?n.css("display","none"):(l&&r&&n.css("background","transparent"),-1==a&&(a=t),o=t,n.css({display:"block",width:e+"%"})),parseFloat(e)});e.forEach(function(e,t){E(u[t]).css({borderTopLeftRadius:t==a?"":"0",borderBottomLeftRadius:t==a?"":"0",borderTopRightRadius:t==o?"":"0",borderBottomRightRadius:t==o?"":"0"})}),c.attr("data-percent",t)},duration:function(e){e=e||i.duration,f.verbose("Setting progress bar transition duration",e="number"==typeof e?e+"ms":e),u.css({"transition-duration":e})},percent:function(e){e=f.helper.forceArray(e).map(function(e){return e="string"==typeof e?+e.replace("%",""):e,i.limitValues?Math.max(0,Math.min(100,e)):e});var t,r=f.has.total(),n=f.helper.sum(e),a=1<e.length&&r,o=f.helper.sum(f.helper.forceArray(f.value));a&&o>f.total?f.error(l.sumExceedsTotal,o,f.total):!a&&100<n?f.error(l.tooHigh,n):n<0?f.error(l.tooLow,n):(t=0<i.precision?i.precision:a?f.helper.derivePrecision(Math.min.apply(null,f.value),f.total):0,o=e.map(function(e){return 0<t?Math.round(e*(10*t))/(10*t):Math.round(e)}),f.percent=o,r&&(f.value=e.map(function(e){return 0<t?Math.round(e/100*f.total*(10*t))/(10*t):Math.round(e/100*f.total*10)/10})),f.set.barWidth(e),f.set.labelInterval()),i.onChange.call(d,e,f.value,f.total)},labelInterval:function(){clearInterval(f.interval),f.bind.transitionEnd(function(){f.verbose("Bar finished animating, removing continuous label updates"),clearInterval(f.interval),v=!1,f.set.labels()}),v=!0,f.interval=setInterval(function(){E.contains(P.documentElement,d)||(clearInterval(f.interval),v=!1),f.set.labels()},i.framerate)},labels:function(){f.verbose("Setting both bar progress and outer label text"),f.set.barLabel(),f.set.state()},label:function(e){e&&(e=f.get.text(e),f.verbose("Setting label to text",e),p.text(e))},state:function(e){100===(e=e!==T?e:f.helper.sum(f.percent))?i.autoSuccess&&1===u.length&&!(f.is.warning()||f.is.error()||f.is.success())?(f.set.success(),f.debug("Automatically triggering success at 100%")):(f.verbose("Reached 100% removing active state"),f.remove.active(),f.remove.progressPoll()):0<e?(f.verbose("Adjusting active progress bar label",e),f.set.active()):(f.remove.active(),f.remove.warning(),f.remove.error(),f.remove.success(),f.set.label(i.text.active))},barLabel:function(r){s.each(function(e,t){t=E(t);r!==T?t.text(f.get.text(r,e)):"ratio"==i.label&&f.has.total()?(f.verbose("Adding ratio to bar label"),t.text(f.get.text(i.text.ratio,e))):"percent"==i.label&&(f.verbose("Adding percentage to bar label"),t.text(f.get.text(i.text.percent,e)))})},active:function(e){e=e||i.text.active,f.debug("Setting active state"),i.showActivity&&!f.is.active()&&c.addClass(r.active),f.remove.warning(),f.remove.error(),f.remove.success(),(e=i.onLabelUpdate("active",e,f.value,f.total))&&f.set.label(e),f.bind.transitionEnd(function(){i.onActive.call(d,f.value,f.total)})},success:function(e,t){e=e||i.text.success||i.text.active,f.debug("Setting success state"),c.addClass(r.success),f.remove.active(),f.remove.warning(),f.remove.error(),f.complete(t),e=i.text.success?i.onLabelUpdate("success",e,f.value,f.total):i.onLabelUpdate("active",e,f.value,f.total),f.set.label(e),f.bind.transitionEnd(function(){i.onSuccess.call(d,f.total)})},warning:function(e,t){e=e||i.text.warning,f.debug("Setting warning state"),c.addClass(r.warning),f.remove.active(),f.remove.success(),f.remove.error(),f.complete(t),(e=i.onLabelUpdate("warning",e,f.value,f.total))&&f.set.label(e),f.bind.transitionEnd(function(){i.onWarning.call(d,f.value,f.total)})},error:function(e,t){e=e||i.text.error,f.debug("Setting error state"),c.addClass(r.error),f.remove.active(),f.remove.success(),f.remove.warning(),f.complete(t),(e=i.onLabelUpdate("error",e,f.value,f.total))&&f.set.label(e),f.bind.transitionEnd(function(){i.onError.call(d,f.value,f.total)})},transitionEvent:function(){f.get.transitionEnd()},total:function(e){f.total=e},value:function(e){f.value=f.helper.forceArray(e)},progress:function(e){f.has.progressPoll()?(f.debug("Updated within interval, setting next update to use new value",e),f.set.nextValue(e)):(f.debug("First update in progress update interval, immediately updating",e),f.update.progress(e),f.create.progressPoll())},nextValue:function(e){f.nextValue=e}},update:{toNextValue:function(){var e=f.nextValue;e&&(f.debug("Update interval complete using last updated value",e),f.update.progress(e),f.remove.nextValue())},progress:function(e){var r=f.has.total(),e=(r&&f.set.value(e),f.helper.forceArray(e).map(function(e){var t;return!1===(e=f.get.numericValue(e))&&f.error(l.nonNumeric,e),e=f.get.normalizedValue(e),r?(t=0<f.total?e/f.total*100:100,f.debug("Calculating percent complete from total",t)):(t=e,f.debug("Setting value to exact percentage value",t)),t}));f.set.percent(e)}},setting:function(e,t){if(f.debug("Changing setting",e,t),E.isPlainObject(e))E.extend(!0,i,e);else{if(t===T)return i[e];E.isPlainObject(i[e])?E.extend(!0,i[e],t):i[e]=t}},internal:function(e,t){if(E.isPlainObject(e))E.extend(!0,f,e);else{if(t===T)return f[e];f[e]=t}},debug:function(){!i.silent&&i.debug&&(i.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,i.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!i.silent&&i.verbose&&i.debug&&(i.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,i.name+":"),f.verbose.apply(console,arguments)))},error:function(){i.silent||(f.error=Function.prototype.bind.call(console.error,console,i.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var t,r;i.performance&&(r=(t=Date.now())-(x||t),x=t,y.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:d,"Execution Time":r})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var e=i.name+":",r=0;x=!1,clearTimeout(f.performance.timer),E.each(y,function(e,t){r+=t["Execution Time"]}),e+=" "+r+"ms",h&&(e+=" '"+h+"'"),(console.group!==T||console.table!==T)&&0<y.length&&(console.groupCollapsed(e),console.table?console.table(y):E.each(y,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),y=[]}},invoke:function(n,e,t){var a,o,r,i,s=g;return e=e||A,t=t||d,"string"==typeof n&&s!==T&&(n=n.split(/[ .]/),a=n.length-1,E.each(n,function(e,t){var r=e!=a?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(E.isPlainObject(s[r])&&e!=a)s=s[r];else{if(s[r]!==T)return o=s[r],!1;{if(!E.isPlainObject(s[t])||e==a)return s[t]!==T?o=s[t]:f.error(l.method,n),!1;s=s[t]}}})),"function"==typeof(i=o)&&"number"!=typeof i.nodeType?r=o.apply(t,e):o!==T&&(r=o),Array.isArray(b)?b.push(r):b!==T?b=[b,r]:r!==T&&(b=r),o}};V?(g===T&&f.initialize(),f.invoke(w)):(g!==T&&g.invoke("destroy"),f.initialize())}),b!==T?b:this},E.fn.progress.settings={name:"Progress",namespace:"progress",silent:!1,debug:!1,verbose:!1,performance:!0,random:{min:2,max:5},duration:300,updateInterval:"auto",autoSuccess:!0,showActivity:!0,limitValues:!0,label:"percent",precision:0,framerate:1e3/30,percent:!1,total:!1,value:!1,failSafeDelay:100,onLabelUpdate:function(e,t,r,n){return t},onChange:function(e,t,r){},onSuccess:function(e){},onActive:function(e,t){},onError:function(e,t){},onWarning:function(e,t){},error:{method:"The method you called is not defined.",nonNumeric:"Progress value is non numeric",tooHigh:"Value specified is above 100%",tooLow:"Value specified is below 0%",sumExceedsTotal:"Sum of multiple values exceed total"},regExp:{variable:/{\$*[\da-z]+}/gi},metadata:{percent:"percent",total:"total",value:"value"},selector:{bar:"> .bar",label:"> .label",progress:".bar > .progress"},text:{active:!1,error:!1,success:!1,warning:!1,percent:"{percent}%",ratio:"{value} of {total}",bars:[""]},className:{active:"active",error:"error",success:"success",warning:"warning"}}}(jQuery,window,document);
|
package/dist/components/rail.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.1-beta.
|
2
|
+
* # Fomantic-UI 2.9.1-beta.24+029436f - Rating
|
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
|
|
@@ -24,17 +24,17 @@
|
|
24
24
|
$allModules = $(this),
|
25
25
|
moduleSelector = $allModules.selector || '',
|
26
26
|
|
27
|
-
time =
|
27
|
+
time = Date.now(),
|
28
28
|
performance = [],
|
29
29
|
|
30
30
|
query = arguments[0],
|
31
|
-
methodInvoked =
|
31
|
+
methodInvoked = typeof query === 'string',
|
32
32
|
queryArguments = [].slice.call(arguments, 1),
|
33
33
|
returnedValue
|
34
34
|
;
|
35
35
|
$allModules.each(function () {
|
36
36
|
var
|
37
|
-
settings =
|
37
|
+
settings = $.isPlainObject(parameters)
|
38
38
|
? $.extend(true, {}, $.fn.rating.settings, parameters)
|
39
39
|
: $.extend({}, $.fn.rating.settings),
|
40
40
|
|
@@ -143,8 +143,8 @@
|
|
143
143
|
$activeIcon = $(this),
|
144
144
|
currentRating = module.get.rating(),
|
145
145
|
rating = $icon.index($activeIcon) + 1,
|
146
|
-
canClear =
|
147
|
-
?
|
146
|
+
canClear = settings.clearable == 'auto'
|
147
|
+
? $icon.length === 1
|
148
148
|
: settings.clearable
|
149
149
|
;
|
150
150
|
if (canClear && currentRating == rating) {
|
@@ -249,8 +249,8 @@
|
|
249
249
|
rating: function (rating) {
|
250
250
|
var
|
251
251
|
ratingIndex = Math.floor(
|
252
|
-
|
253
|
-
?
|
252
|
+
rating - 1 >= 0
|
253
|
+
? rating - 1
|
254
254
|
: 0
|
255
255
|
),
|
256
256
|
$activeIcon = $icon.eq(ratingIndex),
|
@@ -356,7 +356,7 @@
|
|
356
356
|
previousTime
|
357
357
|
;
|
358
358
|
if (settings.performance) {
|
359
|
-
currentTime =
|
359
|
+
currentTime = Date.now();
|
360
360
|
previousTime = time || currentTime;
|
361
361
|
executionTime = currentTime - previousTime;
|
362
362
|
time = currentTime;
|
@@ -385,7 +385,7 @@
|
|
385
385
|
title += ' \'' + moduleSelector + '\'';
|
386
386
|
}
|
387
387
|
if ($allModules.length > 1) {
|
388
|
-
title += '
|
388
|
+
title += ' (' + $allModules.length + ')';
|
389
389
|
}
|
390
390
|
if ((console.group !== undefined || console.table !== undefined) && performance.length > 0) {
|
391
391
|
console.groupCollapsed(title);
|
@@ -410,11 +410,11 @@
|
|
410
410
|
;
|
411
411
|
passedArguments = passedArguments || queryArguments;
|
412
412
|
context = context || element;
|
413
|
-
if (typeof query
|
414
|
-
query = query.split(/[
|
413
|
+
if (typeof query === 'string' && object !== undefined) {
|
414
|
+
query = query.split(/[ .]/);
|
415
415
|
maxDepth = query.length - 1;
|
416
416
|
$.each(query, function (depth, value) {
|
417
|
-
var camelCaseValue =
|
417
|
+
var camelCaseValue = depth != maxDepth
|
418
418
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
419
419
|
: query
|
420
420
|
;
|
@@ -464,7 +464,7 @@
|
|
464
464
|
}
|
465
465
|
});
|
466
466
|
|
467
|
-
return
|
467
|
+
return returnedValue !== undefined
|
468
468
|
? returnedValue
|
469
469
|
: this;
|
470
470
|
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.1-beta.
|
2
|
+
* # Fomantic UI - 2.9.1-beta.24+029436f
|
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(
|
11
|
+
!function(A,e,T){"use strict";e=e!==T&&e.Math===Math?e:globalThis,A.fn.rating=function(f){var v,p=A(this),b=p.selector||"",h=Date.now(),y=[],C=f,x="string"==typeof C,R=[].slice.call(arguments,1);return p.each(function(){var e,a=A.isPlainObject(f)?A.extend(!0,{},A.fn.rating.settings,f):A.extend({},A.fn.rating.settings),n=a.namespace,o=a.className,t=a.metadata,i=a.selector,r=a.cssVars,s="."+n,l="module-"+n,c=this,u=A(this).data(l),d=A(this),g=d.find(i.icon),m={initialize:function(){m.verbose("Initializing rating module",a),0===g.length&&m.setup.layout(),a.interactive&&!m.is.disabled()?m.enable():m.disable(),m.set.initialLoad(),m.set.rating(m.get.initialRating()),m.remove.initialLoad(),m.instantiate()},instantiate:function(){m.verbose("Instantiating module",a),u=m,d.data(l,m)},destroy:function(){m.verbose("Destroying previous instance",u),m.remove.events(),d.removeData(l)},refresh:function(){g=d.find(i.icon)},setup:{layout:function(){var e=m.get.maxRating(),n=m.get.icon(),e=A.fn.rating.settings.templates.icon(e,n);m.debug("Generating icon html dynamically"),d.html(e),m.refresh()}},event:{mouseenter:function(){var e=A(this);e.nextAll().removeClass(o.selected),d.addClass(o.selected),e.addClass(o.selected).prevAll().addClass(o.selected)},mouseleave:function(){d.removeClass(o.selected),g.removeClass(o.selected)},click:function(){var e=A(this),n=m.get.rating(),e=g.index(e)+1;("auto"==a.clearable?1===g.length:a.clearable)&&n==e?m.clearRating():m.set.rating(e)}},clearRating:function(){m.debug("Clearing current rating"),m.set.rating(0)},bind:{events:function(){m.verbose("Binding events"),d.on("mouseenter"+s,i.icon,m.event.mouseenter).on("mouseleave"+s,i.icon,m.event.mouseleave).on("click"+s,i.icon,m.event.click)}},remove:{events:function(){m.verbose("Removing events"),d.off(s)},initialLoad:function(){e=!1}},enable:function(){m.debug("Setting rating to interactive mode"),m.bind.events(),d.removeClass(o.disabled)},disable:function(){m.debug("Setting rating to read-only mode"),m.remove.events(),d.addClass(o.disabled)},is:{initialLoad:function(){return e},disabled:function(){return d.hasClass(o.disabled)}},get:{icon:function(){var e=d.data(t.icon);return e&&d.removeData(t.icon),e||a.icon},initialRating:function(){return d.data(t.rating)!==T?(d.removeData(t.rating),d.data(t.rating)):a.initialRating},maxRating:function(){return d.data(t.maxRating)!==T?(d.removeData(t.maxRating),d.data(t.maxRating)):a.maxRating},rating:function(){var e=g.filter("."+o.active).length;return m.verbose("Current rating retrieved",e),e}},set:{rating:function(e){var n=Math.floor(0<=e-1?e-1:0),n=g.eq(n),t=e<=1?n:n.next(),i=e%1*100;d.removeClass(o.selected),g.removeClass(o.selected).removeClass(o.active).removeClass(o.partiallyActive),0<e&&(m.verbose("Setting current rating to",e),n.prevAll().addBack().addClass(o.active),n.next()&&e%1!=0&&(t.addClass(o.partiallyActive).addClass(o.active),t.css(r.filledCustomPropName,i+"%"),"transparent"===t.css("backgroundColor")&&t.removeClass(o.partiallyActive).removeClass(o.active))),m.is.initialLoad()||a.onRate.call(c,e)},initialLoad:function(){e=!0}},setting:function(e,n){if(m.debug("Changing setting",e,n),A.isPlainObject(e))A.extend(!0,a,e);else{if(n===T)return a[e];A.isPlainObject(a[e])?A.extend(!0,a[e],n):a[e]=n}},internal:function(e,n){if(A.isPlainObject(e))A.extend(!0,m,e);else{if(n===T)return m[e];m[e]=n}},debug:function(){!a.silent&&a.debug&&(a.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,a.name+":"),m.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),m.verbose.apply(console,arguments)))},error:function(){a.silent||(m.error=Function.prototype.bind.call(console.error,console,a.name+":"),m.error.apply(console,arguments))},performance:{log:function(e){var n,t;a.performance&&(t=(n=Date.now())-(h||n),h=n,y.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:c,"Execution Time":t})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var e=a.name+":",t=0;h=!1,clearTimeout(m.performance.timer),A.each(y,function(e,n){t+=n["Execution Time"]}),e+=" "+t+"ms",b&&(e+=" '"+b+"'"),1<p.length&&(e+=" ("+p.length+")"),(console.group!==T||console.table!==T)&&0<y.length&&(console.groupCollapsed(e),console.table?console.table(y):A.each(y,function(e,n){console.log(n.Name+": "+n["Execution Time"]+"ms")}),console.groupEnd()),y=[]}},invoke:function(i,e,n){var a,o,t,r,s=u;return e=e||R,n=n||c,"string"==typeof i&&s!==T&&(i=i.split(/[ .]/),a=i.length-1,A.each(i,function(e,n){var t=e!=a?n+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(A.isPlainObject(s[t])&&e!=a)s=s[t];else{if(s[t]!==T)return o=s[t],!1;{if(!A.isPlainObject(s[n])||e==a)return s[n]!==T&&(o=s[n]),!1;s=s[n]}}})),"function"==typeof(r=o)&&"number"!=typeof r.nodeType?t=o.apply(n,e):o!==T&&(t=o),Array.isArray(v)?v.push(t):v!==T?v=[v,t]:t!==T&&(v=t),o}};x?(u===T&&m.initialize(),m.invoke(C)):(u!==T&&u.invoke("destroy"),m.initialize())}),v!==T?v:this},A.fn.rating.settings={name:"Rating",namespace:"rating",icon:"star",silent:!1,debug:!1,verbose:!1,performance:!0,initialRating:0,interactive:!0,maxRating:4,clearable:"auto",fireOnInit:!1,onRate:function(e){},error:{method:"The method you called is not defined",noMaximum:"No maximum rating specified. Cannot generate HTML automatically"},metadata:{rating:"rating",maxRating:"maxRating",icon:"icon"},className:{active:"active",disabled:"disabled",selected:"selected",loading:"loading",partiallyActive:"partial"},cssVars:{filledCustomPropName:"--full"},selector:{icon:".icon"},templates:{deQuote:function(e,n){return String(e).replace(/"/g,n?""":"")},icon:function(e,n){for(var t=1,i="",a=A.fn.rating.settings.templates.deQuote;t<=e;)i+='<i class="'+a(n)+' icon"></i>',t++;return i}}}}(jQuery,window,void document);
|