fomantic-ui 2.10.0-beta.62 → 2.10.0-beta.64
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/.eslintrc.js +0 -1
- package/changelog-setup.js +10 -10
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +40 -41
- 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 +57 -61
- 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 +186 -187
- 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 +29 -30
- 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 +22 -23
- 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 +293 -337
- 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 +33 -35
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- package/dist/components/emoji.css +1 -1
- package/dist/components/emoji.min.css +1 -1
- 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 +74 -81
- 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 +141 -146
- 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/menu.css +1 -1
- package/dist/components/menu.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 +80 -81
- 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 +27 -28
- 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 +62 -72
- 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 +51 -55
- 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 +33 -34
- 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 +96 -109
- 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 +44 -45
- 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 +56 -64
- 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 -17
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.css +1 -1
- package/dist/components/slider.js +143 -148
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +24 -25
- 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 +42 -43
- 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 +57 -66
- 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 +32 -33
- 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 +38 -45
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +76 -77
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +53 -53
- package/dist/semantic.js +1753 -1884
- package/dist/semantic.min.css +1 -1
- package/dist/semantic.min.js +2 -2
- package/package.json +1 -1
- package/scripts/nightly-version.js +3 -3
- package/src/definitions/behaviors/api.js +56 -60
- package/src/definitions/behaviors/form.js +140 -145
- package/src/definitions/behaviors/state.js +23 -24
- package/src/definitions/behaviors/visibility.js +75 -76
- package/src/definitions/globals/site.js +15 -16
- package/src/definitions/modules/accordion.js +39 -40
- package/src/definitions/modules/calendar.js +185 -186
- package/src/definitions/modules/checkbox.js +28 -29
- package/src/definitions/modules/dimmer.js +21 -22
- package/src/definitions/modules/dropdown.js +292 -336
- package/src/definitions/modules/embed.js +32 -34
- package/src/definitions/modules/flyout.js +73 -80
- package/src/definitions/modules/modal.js +79 -80
- package/src/definitions/modules/nag.js +26 -27
- package/src/definitions/modules/popup.js +61 -71
- package/src/definitions/modules/progress.js +50 -54
- package/src/definitions/modules/rating.js +32 -33
- package/src/definitions/modules/search.js +95 -108
- package/src/definitions/modules/shape.js +43 -44
- package/src/definitions/modules/sidebar.js +55 -63
- package/src/definitions/modules/slider.js +142 -147
- package/src/definitions/modules/sticky.js +41 -42
- package/src/definitions/modules/tab.js +56 -65
- package/src/definitions/modules/toast.js +31 -32
- package/src/definitions/modules/transition.js +37 -44
- package/tasks/admin/components/create.js +11 -11
- package/tasks/admin/components/init.js +11 -12
- package/tasks/admin/components/update.js +19 -20
- package/tasks/admin/distributions/create.js +24 -36
- package/tasks/admin/distributions/init.js +11 -12
- package/tasks/admin/distributions/update.js +18 -19
- package/tasks/admin/register.js +7 -7
- package/tasks/build/assets.js +1 -1
- package/tasks/build/css.js +1 -1
- package/tasks/build/javascript.js +1 -1
- package/tasks/config/admin/github.js +1 -1
- package/tasks/config/admin/templates/css-package.js +1 -1
- package/tasks/config/admin/templates/less-package.js +1 -1
- package/tasks/config/project/config.js +6 -6
- package/tasks/config/project/install.js +12 -12
- package/tasks/config/project/release.js +5 -11
- package/tasks/config/tasks.js +5 -5
- package/tasks/config/user.js +1 -4
- package/tasks/docs/metadata.js +11 -12
- package/tasks/install.js +9 -9
- package/test/meteor/assets.js +1 -1
- package/test/modules/module.spec.js +18 -18
package/package.json
CHANGED
|
@@ -40,9 +40,9 @@ const getPublishedVersion = async function () {
|
|
|
40
40
|
await fetch(`${npmBase}/${npmPackage}`)
|
|
41
41
|
.then((r) => r.json())
|
|
42
42
|
.then((p) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
const nightly = p['dist-tags'].nightly ?? '';
|
|
44
|
+
const versionInfo = p.versions[nightly] ?? {};
|
|
45
|
+
const buildCommit = !nightly.includes('+') && versionInfo.gitHead
|
|
46
46
|
? '+' + (versionInfo.gitHead ?? '').slice(0, 7)
|
|
47
47
|
: '';
|
|
48
48
|
|
|
@@ -25,16 +25,16 @@
|
|
|
25
25
|
|
|
26
26
|
$.fn.api = function (...args) {
|
|
27
27
|
// use window context if none specified
|
|
28
|
-
|
|
28
|
+
const $allModules = isFunction(this)
|
|
29
29
|
? $(window)
|
|
30
30
|
: $(this);
|
|
31
31
|
let time = Date.now();
|
|
32
32
|
let performance = [];
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
const parameters = args[0];
|
|
35
|
+
const methodInvoked = typeof parameters === 'string';
|
|
36
|
+
const queryArguments = args.slice(1);
|
|
37
|
+
const contextCheck = function (context, win) {
|
|
38
38
|
let $context;
|
|
39
39
|
if ([window, document].includes(context)) {
|
|
40
40
|
$context = $(context);
|
|
@@ -50,28 +50,28 @@
|
|
|
50
50
|
let returnedValue;
|
|
51
51
|
|
|
52
52
|
$allModules.each(function () {
|
|
53
|
-
|
|
53
|
+
const settings = $.isPlainObject(parameters)
|
|
54
54
|
? $.extend(true, {}, $.fn.api.settings, parameters)
|
|
55
55
|
: $.extend({}, $.fn.api.settings);
|
|
56
56
|
|
|
57
57
|
// internal aliases
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
const regExp = settings.regExp;
|
|
59
|
+
const namespace = settings.namespace;
|
|
60
|
+
const metadata = settings.metadata;
|
|
61
|
+
const selector = settings.selector;
|
|
62
|
+
const error = settings.error;
|
|
63
|
+
const className = settings.className;
|
|
64
64
|
|
|
65
65
|
// define namespaces for modules
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
const eventNamespace = '.' + namespace;
|
|
67
|
+
const moduleNamespace = 'module-' + namespace;
|
|
68
68
|
|
|
69
69
|
// element that creates request
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
const $module = $(this);
|
|
71
|
+
const $form = $module.closest(selector.form);
|
|
72
72
|
|
|
73
73
|
// context used for state
|
|
74
|
-
|
|
74
|
+
const $context = settings.stateContext ? contextCheck(settings.stateContext, window) : $module;
|
|
75
75
|
|
|
76
76
|
// request details
|
|
77
77
|
let ajaxSettings;
|
|
@@ -82,12 +82,11 @@
|
|
|
82
82
|
let originalData;
|
|
83
83
|
|
|
84
84
|
// standard module
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
const element = this;
|
|
86
|
+
const context = $context[0];
|
|
87
87
|
let instance = $module.data(moduleNamespace);
|
|
88
|
-
let module;
|
|
89
88
|
|
|
90
|
-
module = {
|
|
89
|
+
const module = {
|
|
91
90
|
|
|
92
91
|
initialize: function () {
|
|
93
92
|
if (!methodInvoked) {
|
|
@@ -113,7 +112,7 @@
|
|
|
113
112
|
|
|
114
113
|
bind: {
|
|
115
114
|
events: function () {
|
|
116
|
-
|
|
115
|
+
const triggerEvent = module.get.event();
|
|
117
116
|
if (triggerEvent) {
|
|
118
117
|
module.verbose('Attaching API events to element', triggerEvent);
|
|
119
118
|
$module
|
|
@@ -340,7 +339,7 @@
|
|
|
340
339
|
if (requiredVariables) {
|
|
341
340
|
module.debug('Looking for required URL variables', requiredVariables);
|
|
342
341
|
$.each(requiredVariables, function (index, templatedString) {
|
|
343
|
-
|
|
342
|
+
const variable = templatedString.slice(1, -1);
|
|
344
343
|
let value = $.isPlainObject(urlData) && urlData[variable] !== undefined
|
|
345
344
|
? urlData[variable]
|
|
346
345
|
: ($module.data(variable) !== undefined
|
|
@@ -366,8 +365,8 @@
|
|
|
366
365
|
if (optionalVariables) {
|
|
367
366
|
module.debug('Looking for optional URL variables', requiredVariables);
|
|
368
367
|
$.each(optionalVariables, function (index, templatedString) {
|
|
369
|
-
|
|
370
|
-
|
|
368
|
+
const variable = templatedString.slice(2, -1);
|
|
369
|
+
const value = $.isPlainObject(urlData) && urlData[variable] !== undefined
|
|
371
370
|
? urlData[variable]
|
|
372
371
|
: ($module.data(variable) !== undefined
|
|
373
372
|
? $module.data(variable)
|
|
@@ -393,19 +392,18 @@
|
|
|
393
392
|
},
|
|
394
393
|
formData: function (data = originalData || settings.data) {
|
|
395
394
|
let formData = {};
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
hasOtherData = $.isPlainObject(data);
|
|
395
|
+
const useFormDataApi = settings.serializeForm === 'formdata';
|
|
396
|
+
const hasOtherData = $.isPlainObject(data);
|
|
399
397
|
|
|
400
398
|
if (useFormDataApi) {
|
|
401
399
|
formData = new FormData($form[0]);
|
|
402
400
|
settings.processData = settings.processData !== undefined ? settings.processData : false;
|
|
403
401
|
settings.contentType = settings.contentType !== undefined ? settings.contentType : false;
|
|
404
402
|
} else {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
403
|
+
const formArray = $form.serializeArray();
|
|
404
|
+
const pushes = {};
|
|
405
|
+
const pushValues = {};
|
|
406
|
+
const build = function (base, key, value) {
|
|
409
407
|
base[key] = value;
|
|
410
408
|
|
|
411
409
|
return base;
|
|
@@ -420,15 +418,15 @@
|
|
|
420
418
|
if (!regExp.validate.test(el.name)) {
|
|
421
419
|
return;
|
|
422
420
|
}
|
|
423
|
-
|
|
424
|
-
|
|
421
|
+
const isCheckbox = $('[name="' + CSS.escape(el.name) + '"]', $form).attr('type') === 'checkbox';
|
|
422
|
+
const floatValue = parseFloat(el.value);
|
|
425
423
|
let value = (isCheckbox && el.value === 'on')
|
|
426
424
|
|| el.value === 'true'
|
|
427
425
|
|| (String(floatValue) === el.value
|
|
428
426
|
? floatValue
|
|
429
427
|
: (el.value === 'false' ? false : el.value));
|
|
430
|
-
|
|
431
|
-
|
|
428
|
+
const nameKeys = el.name.match(regExp.key) || [];
|
|
429
|
+
const pushKey = el.name.replace(/\[]$/, '');
|
|
432
430
|
if (!(pushKey in pushes)) {
|
|
433
431
|
pushes[pushKey] = 0;
|
|
434
432
|
pushValues[pushKey] = value;
|
|
@@ -442,7 +440,7 @@
|
|
|
442
440
|
}
|
|
443
441
|
|
|
444
442
|
while (nameKeys.length > 0) {
|
|
445
|
-
|
|
443
|
+
const k = nameKeys.pop();
|
|
446
444
|
|
|
447
445
|
if (k === '' && !Array.isArray(value)) { // foo[]
|
|
448
446
|
value = build([], pushes[pushKey]++, value);
|
|
@@ -500,10 +498,10 @@
|
|
|
500
498
|
// nothing special
|
|
501
499
|
},
|
|
502
500
|
done: function (response, textStatus, xhr) {
|
|
503
|
-
|
|
504
|
-
|
|
501
|
+
const context = this;
|
|
502
|
+
const elapsedTime = Date.now() - requestStartTime;
|
|
505
503
|
let timeLeft = settings.loadingDuration - elapsedTime;
|
|
506
|
-
|
|
504
|
+
const translatedResponse = isFunction(settings.onResponse)
|
|
507
505
|
? (module.is.expectingJSON() && !settings.rawResponse
|
|
508
506
|
? settings.onResponse.call(context, $.extend(true, {}, response))
|
|
509
507
|
: settings.onResponse.call(context, response))
|
|
@@ -525,8 +523,8 @@
|
|
|
525
523
|
}, timeLeft);
|
|
526
524
|
},
|
|
527
525
|
fail: function (xhr, status, httpMessage) {
|
|
528
|
-
|
|
529
|
-
|
|
526
|
+
const context = this;
|
|
527
|
+
const elapsedTime = Date.now() - requestStartTime;
|
|
530
528
|
let timeLeft = settings.loadingDuration - elapsedTime;
|
|
531
529
|
timeLeft = Math.max(timeLeft, 0);
|
|
532
530
|
if (timeLeft > 0) {
|
|
@@ -566,8 +564,8 @@
|
|
|
566
564
|
},
|
|
567
565
|
fail: function (xhr, status, httpMessage) {
|
|
568
566
|
// pull response from xhr if available
|
|
569
|
-
|
|
570
|
-
|
|
567
|
+
const response = module.get.responseFromXHR(xhr);
|
|
568
|
+
const errorMessage = module.get.errorFromRequest(response, status, httpMessage);
|
|
571
569
|
if (status === 'aborted') {
|
|
572
570
|
module.debug('XHR Aborted (Most likely caused by page navigation or CORS Policy)', status, httpMessage);
|
|
573
571
|
settings.onAbort.call(context, status, $module, xhr);
|
|
@@ -612,16 +610,15 @@
|
|
|
612
610
|
|
|
613
611
|
mockedXHR: function () {
|
|
614
612
|
// xhr does not simulate these properties of xhr but must return them
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
613
|
+
const textStatus = false;
|
|
614
|
+
const status = false;
|
|
615
|
+
const httpMessage = false;
|
|
616
|
+
const responder = settings.mockResponse || settings.response;
|
|
617
|
+
const asyncResponder = settings.mockResponseAsync || settings.responseAsync;
|
|
620
618
|
let asyncCallback;
|
|
621
619
|
let response;
|
|
622
|
-
let mockedXHR;
|
|
623
620
|
|
|
624
|
-
mockedXHR = $.Deferred()
|
|
621
|
+
const mockedXHR = $.Deferred()
|
|
625
622
|
.always(module.event.xhr.complete)
|
|
626
623
|
.done(module.event.xhr.done)
|
|
627
624
|
.fail(module.event.xhr.fail);
|
|
@@ -654,9 +651,8 @@
|
|
|
654
651
|
},
|
|
655
652
|
|
|
656
653
|
xhr: function () {
|
|
657
|
-
let xhr;
|
|
658
654
|
// ajax request promise
|
|
659
|
-
xhr = $.ajax(ajaxSettings)
|
|
655
|
+
const xhr = $.ajax(ajaxSettings)
|
|
660
656
|
.always(module.event.xhr.always)
|
|
661
657
|
.done(module.event.xhr.done)
|
|
662
658
|
.fail(module.event.xhr.fail);
|
|
@@ -714,7 +710,7 @@
|
|
|
714
710
|
return module.xhr || false;
|
|
715
711
|
},
|
|
716
712
|
settings: function () {
|
|
717
|
-
|
|
713
|
+
const runSettings = settings.beforeSend.call(element, settings);
|
|
718
714
|
if (runSettings === undefined) {
|
|
719
715
|
module.error(error.noReturnedValue);
|
|
720
716
|
}
|
|
@@ -727,9 +723,9 @@
|
|
|
727
723
|
: $.extend(true, {}, settings);
|
|
728
724
|
},
|
|
729
725
|
urlEncodedValue: function (value) {
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
726
|
+
const decodedValue = window.decodeURIComponent(value);
|
|
727
|
+
const encodedValue = window.encodeURIComponent(value);
|
|
728
|
+
const alreadyEncoded = decodedValue !== value;
|
|
733
729
|
if (alreadyEncoded) {
|
|
734
730
|
module.debug('URL value is already encoded, avoiding double encoding', value);
|
|
735
731
|
|
|
@@ -740,7 +736,7 @@
|
|
|
740
736
|
return encodedValue;
|
|
741
737
|
},
|
|
742
738
|
defaultData: function () {
|
|
743
|
-
|
|
739
|
+
const data = {};
|
|
744
740
|
if (!isWindow(element)) {
|
|
745
741
|
if (module.is.input()) {
|
|
746
742
|
data.value = $module.val();
|
|
@@ -799,7 +795,7 @@
|
|
|
799
795
|
},
|
|
800
796
|
|
|
801
797
|
abort: function () {
|
|
802
|
-
|
|
798
|
+
const xhr = module.get.xhr();
|
|
803
799
|
if (xhr && xhr.state() !== 'resolved') {
|
|
804
800
|
module.debug('Cancelling API request');
|
|
805
801
|
xhr.abort();
|
|
@@ -909,7 +905,7 @@
|
|
|
909
905
|
query = query.split(/[ .]/);
|
|
910
906
|
maxDepth = query.length - 1;
|
|
911
907
|
$.each(query, function (depth, value) {
|
|
912
|
-
|
|
908
|
+
const camelCaseValue = depth !== maxDepth
|
|
913
909
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
|
914
910
|
: query;
|
|
915
911
|
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|