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/dist/components/tab.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* # Fomantic-UI 2.10.0-beta.
|
|
2
|
+
* # Fomantic-UI 2.10.0-beta.64+bcb9c73 - Tab
|
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
|
4
4
|
*
|
|
5
5
|
*
|
|
@@ -25,17 +25,17 @@
|
|
|
25
25
|
|
|
26
26
|
$.fn.tab = function (...args) {
|
|
27
27
|
// use window context if none specified
|
|
28
|
-
|
|
28
|
+
const $allModules = isFunction(this)
|
|
29
29
|
? $(window)
|
|
30
30
|
: $(this);
|
|
31
|
-
|
|
31
|
+
const $document = $(document);
|
|
32
32
|
let time = Date.now();
|
|
33
33
|
let performance = [];
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
const parameters = args[0];
|
|
36
|
+
const methodInvoked = typeof parameters === 'string';
|
|
37
|
+
const queryArguments = args.slice(1);
|
|
38
|
+
const contextCheck = function (context, win) {
|
|
39
39
|
let $context;
|
|
40
40
|
if ([window, document].includes(context)) {
|
|
41
41
|
$context = $(context);
|
|
@@ -52,35 +52,34 @@
|
|
|
52
52
|
let returnedValue;
|
|
53
53
|
|
|
54
54
|
$allModules.each(function () {
|
|
55
|
-
|
|
55
|
+
const settings = $.isPlainObject(parameters)
|
|
56
56
|
? $.extend(true, {}, $.fn.tab.settings, parameters)
|
|
57
57
|
: $.extend({}, $.fn.tab.settings);
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
const className = settings.className;
|
|
60
|
+
const metadata = settings.metadata;
|
|
61
|
+
const selector = settings.selector;
|
|
62
|
+
const error = settings.error;
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
const eventNamespace = '.' + settings.namespace;
|
|
65
|
+
const moduleNamespace = 'module-' + settings.namespace;
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
const $module = $(this);
|
|
68
68
|
let $context;
|
|
69
69
|
let $tabs;
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
const cache = {};
|
|
72
72
|
let firstLoad = true;
|
|
73
73
|
let recursionDepth = 0;
|
|
74
|
-
|
|
74
|
+
const element = this;
|
|
75
75
|
let instance = $module.data(moduleNamespace);
|
|
76
76
|
|
|
77
77
|
let activeTabPath;
|
|
78
78
|
let parameterArray;
|
|
79
|
-
let module;
|
|
80
79
|
|
|
81
80
|
let historyEvent;
|
|
82
81
|
|
|
83
|
-
module = {
|
|
82
|
+
const module = {
|
|
84
83
|
|
|
85
84
|
initialize: function () {
|
|
86
85
|
module.debug('Initializing tab menu item', $module);
|
|
@@ -105,7 +104,7 @@
|
|
|
105
104
|
module.changeTab(activeTab);
|
|
106
105
|
}
|
|
107
106
|
if (activeTab !== null && settings.history && settings.historyType === 'state') {
|
|
108
|
-
|
|
107
|
+
const autoUpdate = $.address.autoUpdate();
|
|
109
108
|
$.address.autoUpdate(false);
|
|
110
109
|
$.address.value(activeTab);
|
|
111
110
|
$.address.autoUpdate(autoUpdate);
|
|
@@ -196,7 +195,7 @@
|
|
|
196
195
|
|
|
197
196
|
event: {
|
|
198
197
|
click: function (event) {
|
|
199
|
-
|
|
198
|
+
const tabPath = $(this).data(metadata.tab);
|
|
200
199
|
if (tabPath !== undefined) {
|
|
201
200
|
if (settings.history) {
|
|
202
201
|
module.verbose('Updating page state', event);
|
|
@@ -212,8 +211,8 @@
|
|
|
212
211
|
},
|
|
213
212
|
history: {
|
|
214
213
|
change: function (event) {
|
|
215
|
-
|
|
216
|
-
|
|
214
|
+
const tabPath = event.pathNames.join('/') || module.get.initialPath();
|
|
215
|
+
const pageTitle = settings.templates.determineTitle(tabPath) || false;
|
|
217
216
|
module.performance.display();
|
|
218
217
|
module.debug('History change event', tabPath, event);
|
|
219
218
|
historyEvent = event;
|
|
@@ -253,7 +252,7 @@
|
|
|
253
252
|
|
|
254
253
|
set: {
|
|
255
254
|
auto: function () {
|
|
256
|
-
|
|
255
|
+
const url = typeof settings.path === 'string'
|
|
257
256
|
? settings.path.replace(/\/$/, '') + '/{$tab}'
|
|
258
257
|
: '/{$tab}';
|
|
259
258
|
module.verbose('Setting up automatic tab retrieval from server', url);
|
|
@@ -266,8 +265,8 @@
|
|
|
266
265
|
}
|
|
267
266
|
},
|
|
268
267
|
loading: function (tabPath) {
|
|
269
|
-
|
|
270
|
-
|
|
268
|
+
const $tab = module.get.tabElement(tabPath);
|
|
269
|
+
const isLoading = $tab.hasClass(className.loading);
|
|
271
270
|
if (!isLoading) {
|
|
272
271
|
module.verbose('Setting loading state for', $tab);
|
|
273
272
|
$tab
|
|
@@ -285,20 +284,20 @@
|
|
|
285
284
|
},
|
|
286
285
|
|
|
287
286
|
changeTab: function (tabPath) {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
287
|
+
const pushStateAvailable = window.history && window.history.pushState;
|
|
288
|
+
const shouldIgnoreLoad = pushStateAvailable && settings.ignoreFirstLoad && firstLoad;
|
|
289
|
+
const remoteContent = settings.auto || $.isPlainObject(settings.apiSettings);
|
|
291
290
|
// only add the default path if not remote content
|
|
292
|
-
|
|
291
|
+
const pathArray = remoteContent && !shouldIgnoreLoad
|
|
293
292
|
? module.utilities.pathToArray(tabPath)
|
|
294
293
|
: module.get.defaultPathArray(tabPath);
|
|
295
294
|
tabPath = module.utilities.arrayToPath(pathArray);
|
|
296
295
|
$.each(pathArray, function (index, tab) {
|
|
297
|
-
|
|
296
|
+
const currentPathArray = pathArray.slice(0, index + 1);
|
|
298
297
|
let currentPath = module.utilities.arrayToPath(currentPathArray);
|
|
299
298
|
|
|
300
|
-
|
|
301
|
-
|
|
299
|
+
const isTab = module.is.tab(currentPath);
|
|
300
|
+
const isLastIndex = index + 1 === pathArray.length;
|
|
302
301
|
|
|
303
302
|
let $tab = module.get.tabElement(currentPath);
|
|
304
303
|
let $anchor;
|
|
@@ -388,7 +387,7 @@
|
|
|
388
387
|
},
|
|
389
388
|
|
|
390
389
|
scrollTo: function ($element) {
|
|
391
|
-
|
|
390
|
+
const scrollOffset = $element && $element.length > 0
|
|
392
391
|
? $element.offset().top
|
|
393
392
|
: false;
|
|
394
393
|
if (scrollOffset !== false) {
|
|
@@ -398,12 +397,9 @@
|
|
|
398
397
|
},
|
|
399
398
|
|
|
400
399
|
update: {
|
|
401
|
-
content: function (tabPath, html, evaluateScripts) {
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
evaluateScripts = evaluateScripts !== undefined
|
|
405
|
-
? evaluateScripts
|
|
406
|
-
: settings.evaluateScripts;
|
|
400
|
+
content: function (tabPath, html, evaluateScripts = settings.evaluateScripts) {
|
|
401
|
+
const $tab = module.get.tabElement(tabPath);
|
|
402
|
+
const tab = $tab[0];
|
|
407
403
|
if (typeof settings.cacheType === 'string' && settings.cacheType.toLowerCase() === 'dom' && typeof html !== 'string') {
|
|
408
404
|
$tab
|
|
409
405
|
.empty()
|
|
@@ -421,8 +417,8 @@
|
|
|
421
417
|
fetch: {
|
|
422
418
|
|
|
423
419
|
content: function (tabPath, fullTabPath = tabPath) {
|
|
424
|
-
|
|
425
|
-
|
|
420
|
+
const $tab = module.get.tabElement(tabPath);
|
|
421
|
+
const apiSettings = {
|
|
426
422
|
dataType: 'html',
|
|
427
423
|
encodeParameters: false,
|
|
428
424
|
on: 'now',
|
|
@@ -457,12 +453,11 @@
|
|
|
457
453
|
tab: fullTabPath,
|
|
458
454
|
},
|
|
459
455
|
};
|
|
460
|
-
|
|
461
|
-
|
|
456
|
+
const request = $tab.api('get request') || false;
|
|
457
|
+
const existingRequest = request && request.state() === 'pending';
|
|
462
458
|
let requestSettings;
|
|
463
|
-
let cachedContent;
|
|
464
459
|
|
|
465
|
-
cachedContent = module.cache.read(fullTabPath);
|
|
460
|
+
const cachedContent = module.cache.read(fullTabPath);
|
|
466
461
|
|
|
467
462
|
if (settings.cache && cachedContent) {
|
|
468
463
|
module.activate.tab(tabPath);
|
|
@@ -495,11 +490,11 @@
|
|
|
495
490
|
module.activate.navigation(tabPath);
|
|
496
491
|
},
|
|
497
492
|
tab: function (tabPath) {
|
|
498
|
-
|
|
499
|
-
|
|
493
|
+
const $tab = module.get.tabElement(tabPath);
|
|
494
|
+
const $deactiveTabs = settings.deactivate === 'siblings'
|
|
500
495
|
? $tab.siblings($tabs)
|
|
501
496
|
: $tabs.not($tab);
|
|
502
|
-
|
|
497
|
+
const isActive = $tab.hasClass(className.active);
|
|
503
498
|
module.verbose('Showing tab content for', $tab);
|
|
504
499
|
if (!isActive) {
|
|
505
500
|
$tab
|
|
@@ -512,11 +507,11 @@
|
|
|
512
507
|
}
|
|
513
508
|
},
|
|
514
509
|
navigation: function (tabPath) {
|
|
515
|
-
|
|
516
|
-
|
|
510
|
+
const $navigation = module.get.navElement(tabPath);
|
|
511
|
+
const $deactiveNavigation = settings.deactivate === 'siblings'
|
|
517
512
|
? $navigation.siblings($allModules)
|
|
518
513
|
: $allModules.not($navigation);
|
|
519
|
-
|
|
514
|
+
const isActive = $navigation.hasClass(className.active);
|
|
520
515
|
module.verbose('Activating tab navigation for', $navigation, tabPath);
|
|
521
516
|
if (!isActive) {
|
|
522
517
|
$navigation
|
|
@@ -562,8 +557,8 @@
|
|
|
562
557
|
return module.utilities.pathToArray(module.get.defaultPath(tabPath));
|
|
563
558
|
},
|
|
564
559
|
defaultPath: function (tabPath) {
|
|
565
|
-
|
|
566
|
-
|
|
560
|
+
const $defaultNav = $allModules.filter('[data-' + metadata.tab + '^="' + CSS.escape(tabPath) + '/"]').eq(0);
|
|
561
|
+
const defaultTab = $defaultNav.data(metadata.tab) || false;
|
|
567
562
|
if (defaultTab) {
|
|
568
563
|
module.debug('Found default tab', defaultTab);
|
|
569
564
|
if (recursionDepth < settings.maxDepth) {
|
|
@@ -583,14 +578,10 @@
|
|
|
583
578
|
return $allModules.filter('[data-' + metadata.tab + '="' + CSS.escape(tabPath) + '"]');
|
|
584
579
|
},
|
|
585
580
|
tabElement: function (tabPath = activeTabPath) {
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
tabPathArray = module.utilities.pathToArray(tabPath);
|
|
591
|
-
lastTab = module.utilities.last(tabPathArray);
|
|
592
|
-
$fullPathTab = $tabs.filter('[data-' + metadata.tab + '="' + CSS.escape(tabPath) + '"]');
|
|
593
|
-
$simplePathTab = $tabs.filter('[data-' + metadata.tab + '="' + CSS.escape(lastTab) + '"]');
|
|
581
|
+
const tabPathArray = module.utilities.pathToArray(tabPath);
|
|
582
|
+
const lastTab = module.utilities.last(tabPathArray);
|
|
583
|
+
const $fullPathTab = $tabs.filter('[data-' + metadata.tab + '="' + CSS.escape(tabPath) + '"]');
|
|
584
|
+
const $simplePathTab = $tabs.filter('[data-' + metadata.tab + '="' + CSS.escape(lastTab) + '"]');
|
|
594
585
|
|
|
595
586
|
return $fullPathTab.length > 0
|
|
596
587
|
? $fullPathTab
|
|
@@ -606,11 +597,11 @@
|
|
|
606
597
|
let activeTab = null;
|
|
607
598
|
|
|
608
599
|
$tabs.each(function (_index, tab) {
|
|
609
|
-
|
|
600
|
+
const $tab = $(tab);
|
|
610
601
|
|
|
611
602
|
if ($tab.hasClass(className.active)) {
|
|
612
|
-
|
|
613
|
-
|
|
603
|
+
const tabPath = $(this).data(metadata.tab);
|
|
604
|
+
const $anchor = $allModules.filter('[data-' + metadata.tab + '="' + CSS.escape(tabPath) + '"]');
|
|
614
605
|
|
|
615
606
|
if ($anchor.hasClass(className.active)) {
|
|
616
607
|
activeTab = tabPath;
|
|
@@ -746,7 +737,7 @@
|
|
|
746
737
|
query = query.split(/[ .]/);
|
|
747
738
|
maxDepth = query.length - 1;
|
|
748
739
|
$.each(query, function (depth, value) {
|
|
749
|
-
|
|
740
|
+
const camelCaseValue = depth !== maxDepth
|
|
750
741
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
|
751
742
|
: query;
|
|
752
743
|
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* # Fomantic UI - 2.10.0-beta.
|
|
2
|
+
* # Fomantic UI - 2.10.0-beta.64+bcb9c73
|
|
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(F,O,n){"use strict";function j(e){return"function"==typeof e&&"number"!=typeof e.nodeType}O=void 0!==O&&O.Math===Math?O:globalThis,F.fn.tab=function(...e){let r=j(this)?F(O):F(this),c=F(n),l=Date.now(),d=[],u=e[0],g="string"==typeof u,x=e.slice(1),L=function(e,t){let a;return[O,n].includes(e)?a=F(e):0===(a=F(t.document).find(e)).length&&(a=t.frameElement?L(e,t.parent):O),a},w=!1,E;return r.each(function(){let b=F.isPlainObject(u)?F.extend(!0,{},F.fn.tab.settings,u):F.extend({},F.fn.tab.settings),f=b.className,h=b.metadata,t=b.selector,p=b.error,a="."+b.namespace,e="module-"+b.namespace,v=F(this),m,i,n={},y=!0,o=0,T=this,s=v.data(e),C,S,A,P;A={initialize:function(){A.debug("Initializing tab menu item",v),A.determineTabs(),A.debug("Determining tabs",b.context,i),b.auto&&A.set.auto(),A.bind.events(),b.history&&!w&&(b.history=A.initializeHistory(),w=!0);let e=A.determine.activeTab();var t;b.autoTabActivation&&void 0===s&&null===e&&(e=!0===b.autoTabActivation?A.get.initialPath():b.autoTabActivation,A.debug("No active tab detected, setting tab active",e),A.changeTab(e)),null!==e&&b.history&&"state"===b.historyType&&(t=F.address.autoUpdate(),F.address.autoUpdate(!1),F.address.value(e),F.address.autoUpdate(t)),A.instantiate()},instantiate:function(){A.verbose("Storing instance of module",A),s=A,v.data(e,A)},destroy:function(){A.debug("Destroying tabs",v),v.removeData(e).off(a)},bind:{events:function(){var e;null!==(e=T)&&e===e.window||(A.debug("Attaching tab activation events to element",v),v.on("click"+a,A.event.click))}},determineTabs:function(){let e;"parent"===b.context?(0<v.closest(t.ui).length?(e=v.closest(t.ui),A.verbose("Using closest UI element as parent",e)):e=v,m=e.parent(),A.verbose("Determined parent element for creating context",m)):b.context?(m=L(b.context,O),A.verbose("Using selector for tab context",b.context,m)):m=F("body"),b.childrenOnly?(i=m.children(t.tabs),A.debug("Searching tab context children for tabs",m,i)):(i=m.find(t.tabs),A.debug("Searching tab context for tabs",m,i))},initializeHistory:function(){if(A.debug("Initializing page state"),void 0===F.address)return A.error(p.state),!1;if("state"===b.historyType){if(A.debug("Using HTML5 to manage state"),!1===b.path)return A.error(p.path),!1;F.address.history(!0).state(b.path),F(O).trigger("popstate")}return F.address.bind("change",A.event.history.change),!0},event:{click:function(e){var t=F(this).data(h.tab);void 0!==t?(b.history?(A.verbose("Updating page state",e),F.address.value(t)):(A.verbose("Changing tab",e),A.changeTab(t)),e.preventDefault()):A.debug("No tab specified")},history:{change:function(e){var t=e.pathNames.join("/")||A.get.initialPath(),a=b.templates.determineTitle(t)||!1;A.performance.display(),A.debug("History change event",t,e),P=e,void 0!==t&&A.changeTab(t),a&&F.address.title(a)}}},refresh:function(){C&&(A.debug("Refreshing tab",C),A.changeTab(C))},cache:{read:function(e){return void 0!==e&&n[e]},add:function(e=C,t=""){A.debug("Adding cached content for",e),n[e]=t},remove:function(e=C){A.debug("Removing cached content for",e),delete n[e]}},set:{auto:function(){var e="string"==typeof b.path?b.path.replace(/\/$/,"")+"/{$tab}":"/{$tab}";A.verbose("Setting up automatic tab retrieval from server",e),F.isPlainObject(b.apiSettings)?b.apiSettings.url=e:b.apiSettings={url:e}},loading:function(e){let t=A.get.tabElement(e);t.hasClass(f.loading)||(A.verbose("Setting loading state for",t),t.addClass(f.loading).siblings(i).removeClass(f.active+" "+f.loading),0<t.length&&b.onRequest.call(t[0],e))},state:function(e){F.address.value(e)}},changeTab:function(l){let d=O.history&&O.history.pushState&&b.ignoreFirstLoad&&y,u=b.auto||F.isPlainObject(b.apiSettings),g=u&&!d?A.utilities.pathToArray(l):A.get.defaultPathArray(l);l=A.utilities.arrayToPath(g),F.each(g,function(e,t){var a=g.slice(0,e+1);let n=A.utilities.arrayToPath(a);var i=A.is.tab(n),o=e+1===g.length;let r=A.get.tabElement(n),s,c;return A.verbose("Looking for tab",t),i?(A.verbose("Tab was found",t),C=n,S=A.utilities.filterArray(g,a),o?c=!0:(i=g.slice(0,e+2),t=A.utilities.arrayToPath(i),(c=!A.is.tab(t))&&A.verbose("Tab parameters found",i)),!1===b.onBeforeChange.call(T,n)?(A.debug("onBeforeChange returned false, cancelling tab change",r),!1):c&&u?(d?(A.debug("Ignoring remote content on first tab load",n),y=!1,A.cache.add(l,r.html()),A.activate.all(n),b.onFirstLoad.call(r[0],n,S,P),b.onLoad.call(r[0],n,S,P)):(A.activate.navigation(n),A.fetch.content(n,l)),!1):(A.debug("Opened local tab",n),A.activate.all(n),A.cache.read(n)||(A.cache.add(n,!0),A.debug("First time tab loaded calling tab init"),b.onFirstLoad.call(r[0],n,S,P)),void b.onLoad.call(r[0],n,S,P))):-1!==l.search("/")||""===l?(A.error(p.missingTab,v,m,n),!1):(s=F("#"+CSS.escape(l)+', a[name="'+CSS.escape(l)+'"]'),n=s.closest("[data-tab]").data(h.tab),r=A.get.tabElement(n),s&&0<s.length&&n?(A.debug("Anchor link used, opening parent tab",r,s),!1===b.onBeforeChange.call(T,n)?A.debug("onBeforeChange returned false, cancelling tab change",r):(r.hasClass(f.active)||setTimeout(function(){A.scrollTo(s)},0),A.activate.all(n),A.cache.read(n)||(A.cache.add(n,!0),A.debug("First time tab loaded calling tab init"),b.onFirstLoad.call(r[0],n,S,P)),b.onLoad.call(r[0],n,S,P)),!1):void 0)})},scrollTo:function(e){var t=!!(e&&0<e.length)&&e.offset().top;!1!==t&&(A.debug("Forcing scroll to an in-page link in a hidden tab",t,e),c.scrollTop(t))},update:{content:function(e,t,a){let n=A.get.tabElement(e),i=n[0];a=void 0!==a?a:b.evaluateScripts,"string"==typeof b.cacheType&&"dom"===b.cacheType.toLowerCase()&&"string"!=typeof t?n.empty().append(F(t).clone(!0)):a?(A.debug("Updating HTML and evaluating inline scripts",e,t),n.html(t)):(A.debug("Updating HTML",e,t),i.innerHTML=t)}},fetch:{content:function(t,a=t){let n=A.get.tabElement(t);var e={dataType:"html",encodeParameters:!1,on:"now",cache:b.alwaysRefresh,onSuccess:function(e){"response"===b.cacheType&&A.cache.add(a,e),A.update.content(t,e),t==C?(A.debug("Content loaded",t),A.activate.tab(t)):A.debug("Content loaded in background",t),b.onFirstLoad.call(n[0],t,S,P),b.onLoad.call(n[0],t,S,P),b.loadOnce?A.cache.add(a,!0):"string"==typeof b.cacheType&&"dom"===b.cacheType.toLowerCase()&&0<n.children().length?setTimeout(function(){let e=n.children().clone(!0);e=e.not("script"),A.cache.add(a,e)},0):A.cache.add(a,n.html())},urlData:{tab:a}};let i=n.api("get request")||!1;var o=i&&"pending"===i.state(),r=A.cache.read(a);b.cache&&r?(A.activate.tab(t),A.debug("Adding cached content",a),b.loadOnce||("once"===b.evaluateScripts?A.update.content(t,r,!1):A.update.content(t,r)),b.onLoad.call(n[0],t,S,P)):o?(A.set.loading(t),A.debug("Content is already loading",a)):void 0!==F.api?(r=F.extend(!0,{},b.apiSettings,e),A.debug("Retrieving remote content",a,r),A.set.loading(t),n.api(r)):A.error(p.api)}},activate:{all:function(e){A.activate.tab(e),A.activate.navigation(e)},tab:function(e){let t=A.get.tabElement(e),a="siblings"===b.deactivate?t.siblings(i):i.not(t);var n=t.hasClass(f.active);A.verbose("Showing tab content for",t),n||(t.addClass(f.active),a.removeClass(f.active+" "+f.loading),0<t.length&&b.onVisible.call(t[0],e))},navigation:function(e){let t=A.get.navElement(e),a="siblings"===b.deactivate?t.siblings(r):r.not(t);var n=t.hasClass(f.active);A.verbose("Activating tab navigation for",t,e),n||(t.addClass(f.active),a.removeClass(f.active+" "+f.loading))}},deactivate:{all:function(){A.deactivate.navigation(),A.deactivate.tabs()},navigation:function(){r.removeClass(f.active)},tabs:function(){i.removeClass(f.active+" "+f.loading)}},is:{tab:function(e){return void 0!==e&&0<A.get.tabElement(e).length}},get:{initialPath:function(){return r.eq(0).data(h.tab)||i.eq(0).data(h.tab)},path:function(){return F.address.value()},defaultPathArray:function(e){return A.utilities.pathToArray(A.get.defaultPath(e))},defaultPath:function(e){let t=r.filter("[data-"+h.tab+'^="'+CSS.escape(e)+'/"]').eq(0);var a=t.data(h.tab)||!1;if(a){if(A.debug("Found default tab",a),o<b.maxDepth)return o++,A.get.defaultPath(a);A.error(p.recursion)}else A.debug("No default tabs found for",e,i);return o=0,e},navElement:function(e=C){return r.filter("[data-"+h.tab+'="'+CSS.escape(e)+'"]')},tabElement:function(e=C){var t=A.utilities.pathToArray(e),t=A.utilities.last(t),e=i.filter("[data-"+h.tab+'="'+CSS.escape(e)+'"]'),t=i.filter("[data-"+h.tab+'="'+CSS.escape(t)+'"]');return 0<e.length?e:t},tab:function(){return C}},determine:{activeTab:function(){let n=null;return i.each(function(e,t){let a=F(t);if(a.hasClass(f.active)){t=F(this).data(h.tab);let e=r.filter("[data-"+h.tab+'="'+CSS.escape(t)+'"]');e.hasClass(f.active)&&(n=t)}}),n}},utilities:{filterArray:function(e,t){return F.grep(e,function(e){return!t.includes(e)})},last:function(e){return!!Array.isArray(e)&&e[e.length-1]},pathToArray:function(e){return"string"==typeof(e=void 0===e?C:e)?e.split("/"):[e]},arrayToPath:function(e){return!!Array.isArray(e)&&e.join("/")}},setting:function(e,t){if(A.debug("Changing setting",e,t),F.isPlainObject(e))F.extend(!0,b,e);else{if(void 0===t)return b[e];F.isPlainObject(b[e])?F.extend(!0,b[e],t):b[e]=t}},internal:function(e,t){if(F.isPlainObject(e))F.extend(!0,A,e);else{if(void 0===t)return A[e];A[e]=t}},debug:function(...e){!b.silent&&b.debug&&(b.performance?A.performance.log(e):(A.debug=Function.prototype.bind.call(console.info,console,b.name+":"),A.debug.apply(console,e)))},verbose:function(...e){!b.silent&&b.verbose&&b.debug&&(b.performance?A.performance.log(e):(A.verbose=Function.prototype.bind.call(console.info,console,b.name+":"),A.verbose.apply(console,e)))},error:function(...e){b.silent||(A.error=Function.prototype.bind.call(console.error,console,b.name+":"),A.error.apply(console,e))},performance:{log:function(e){var t,a;b.performance&&(a=(t=Date.now())-(l||t),l=t,d.push({Name:e[0],Arguments:e.slice(1),Element:T,"Execution Time":a})),clearTimeout(A.performance.timer),A.performance.timer=setTimeout(function(){A.performance.display()},500)},display:function(){var e=b.name+":";let a=0;l=!1,clearTimeout(A.performance.timer),F.each(d,function(e,t){a+=t["Execution Time"]}),e+=" "+a+"ms",0<d.length&&(console.groupCollapsed(e),console.table(d),console.groupEnd()),d=[]}},invoke:function(n,e=x,t=T){let i=s,o,r,a;return"string"==typeof n&&void 0!==i&&(n=n.split(/[ .]/),o=n.length-1,F.each(n,function(e,t){var a=e!==o?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(F.isPlainObject(i[a])&&e!==o)i=i[a];else{if(void 0!==i[a])return r=i[a],!1;{if(!F.isPlainObject(i[t])||e===o)return void 0!==i[t]?r=i[t]:A.error(p.method,n),!1;i=i[t]}}})),j(r)?a=r.apply(t,e):void 0!==r&&(a=r),Array.isArray(E)?E.push(a):void 0!==E?E=[E,a]:void 0!==a&&(E=a),r}},g?(void 0===s&&A.initialize(),A.invoke(u)):(void 0!==s&&s.invoke("destroy"),A.initialize())}),void 0!==E?E:this},F.tab=function(...e){F(O).tab.apply(this,e)},F.fn.tab.settings={name:"Tab",namespace:"tab",silent:!1,debug:!1,verbose:!1,performance:!0,auto:!1,history:!1,historyType:"hash",path:!1,context:!1,childrenOnly:!1,maxDepth:25,deactivate:"siblings",alwaysRefresh:!1,cache:!0,loadOnce:!1,cacheType:"response",ignoreFirstLoad:!1,apiSettings:!1,evaluateScripts:"once",autoTabActivation:!0,onFirstLoad:function(e,t,a){},onLoad:function(e,t,a){},onVisible:function(e,t,a){},onRequest:function(e,t,a){},onBeforeChange:function(e){},templates:{determineTitle:function(e){}},error:{api:"You attempted to load content without API module",method:"The method you called is not defined",missingTab:"Activated tab cannot be found. Tabs are case-sensitive.",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",state:"History requires Asual's Address library <https://github.com/asual/jquery-address>"},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".ui.tab",ui:".ui"}}}(jQuery,window,document);
|
|
11
|
+
!function(F,O,n){"use strict";function j(e){return"function"==typeof e&&"number"!=typeof e.nodeType}O=void 0!==O&&O.Math===Math?O:globalThis,F.fn.tab=function(...e){const r=j(this)?F(O):F(this),c=F(n);let l=Date.now(),d=[];const u=e[0],g="string"==typeof u,x=e.slice(1),L=function(e,t){let a;return[O,n].includes(e)?a=F(e):0===(a=F(t.document).find(e)).length&&(a=t.frameElement?L(e,t.parent):O),a};let w=!1,E;return r.each(function(){const b=F.isPlainObject(u)?F.extend(!0,{},F.fn.tab.settings,u):F.extend({},F.fn.tab.settings),f=b.className,h=b.metadata,t=b.selector,p=b.error,a="."+b.namespace,e="module-"+b.namespace,v=F(this);let m,o;const n={};let y=!0,i=0;const T=this;let s=v.data(e),C,S,A;const P={initialize:function(){P.debug("Initializing tab menu item",v),P.determineTabs(),P.debug("Determining tabs",b.context,o),b.auto&&P.set.auto(),P.bind.events(),b.history&&!w&&(b.history=P.initializeHistory(),w=!0);let e=P.determine.activeTab();var t;b.autoTabActivation&&void 0===s&&null===e&&(e=!0===b.autoTabActivation?P.get.initialPath():b.autoTabActivation,P.debug("No active tab detected, setting tab active",e),P.changeTab(e)),null!==e&&b.history&&"state"===b.historyType&&(t=F.address.autoUpdate(),F.address.autoUpdate(!1),F.address.value(e),F.address.autoUpdate(t)),P.instantiate()},instantiate:function(){P.verbose("Storing instance of module",P),s=P,v.data(e,P)},destroy:function(){P.debug("Destroying tabs",v),v.removeData(e).off(a)},bind:{events:function(){var e;null!==(e=T)&&e===e.window||(P.debug("Attaching tab activation events to element",v),v.on("click"+a,P.event.click))}},determineTabs:function(){let e;"parent"===b.context?(0<v.closest(t.ui).length?(e=v.closest(t.ui),P.verbose("Using closest UI element as parent",e)):e=v,m=e.parent(),P.verbose("Determined parent element for creating context",m)):b.context?(m=L(b.context,O),P.verbose("Using selector for tab context",b.context,m)):m=F("body"),b.childrenOnly?(o=m.children(t.tabs),P.debug("Searching tab context children for tabs",m,o)):(o=m.find(t.tabs),P.debug("Searching tab context for tabs",m,o))},initializeHistory:function(){if(P.debug("Initializing page state"),void 0===F.address)return P.error(p.state),!1;if("state"===b.historyType){if(P.debug("Using HTML5 to manage state"),!1===b.path)return P.error(p.path),!1;F.address.history(!0).state(b.path),F(O).trigger("popstate")}return F.address.bind("change",P.event.history.change),!0},event:{click:function(e){var t=F(this).data(h.tab);void 0!==t?(b.history?(P.verbose("Updating page state",e),F.address.value(t)):(P.verbose("Changing tab",e),P.changeTab(t)),e.preventDefault()):P.debug("No tab specified")},history:{change:function(e){var t=e.pathNames.join("/")||P.get.initialPath(),a=b.templates.determineTitle(t)||!1;P.performance.display(),P.debug("History change event",t,e),A=e,void 0!==t&&P.changeTab(t),a&&F.address.title(a)}}},refresh:function(){C&&(P.debug("Refreshing tab",C),P.changeTab(C))},cache:{read:function(e){return void 0!==e&&n[e]},add:function(e=C,t=""){P.debug("Adding cached content for",e),n[e]=t},remove:function(e=C){P.debug("Removing cached content for",e),delete n[e]}},set:{auto:function(){var e="string"==typeof b.path?b.path.replace(/\/$/,"")+"/{$tab}":"/{$tab}";P.verbose("Setting up automatic tab retrieval from server",e),F.isPlainObject(b.apiSettings)?b.apiSettings.url=e:b.apiSettings={url:e}},loading:function(e){const t=P.get.tabElement(e);t.hasClass(f.loading)||(P.verbose("Setting loading state for",t),t.addClass(f.loading).siblings(o).removeClass(f.active+" "+f.loading),0<t.length&&b.onRequest.call(t[0],e))},state:function(e){F.address.value(e)}},changeTab:function(l){const d=O.history&&O.history.pushState&&b.ignoreFirstLoad&&y,u=b.auto||F.isPlainObject(b.apiSettings),g=u&&!d?P.utilities.pathToArray(l):P.get.defaultPathArray(l);l=P.utilities.arrayToPath(g),F.each(g,function(e,t){var a=g.slice(0,e+1);let n=P.utilities.arrayToPath(a);var i=P.is.tab(n),o=e+1===g.length;let r=P.get.tabElement(n),s,c;return P.verbose("Looking for tab",t),i?(P.verbose("Tab was found",t),C=n,S=P.utilities.filterArray(g,a),o?c=!0:(i=g.slice(0,e+2),t=P.utilities.arrayToPath(i),(c=!P.is.tab(t))&&P.verbose("Tab parameters found",i)),!1===b.onBeforeChange.call(T,n)?(P.debug("onBeforeChange returned false, cancelling tab change",r),!1):c&&u?(d?(P.debug("Ignoring remote content on first tab load",n),y=!1,P.cache.add(l,r.html()),P.activate.all(n),b.onFirstLoad.call(r[0],n,S,A),b.onLoad.call(r[0],n,S,A)):(P.activate.navigation(n),P.fetch.content(n,l)),!1):(P.debug("Opened local tab",n),P.activate.all(n),P.cache.read(n)||(P.cache.add(n,!0),P.debug("First time tab loaded calling tab init"),b.onFirstLoad.call(r[0],n,S,A)),void b.onLoad.call(r[0],n,S,A))):-1!==l.search("/")||""===l?(P.error(p.missingTab,v,m,n),!1):(s=F("#"+CSS.escape(l)+', a[name="'+CSS.escape(l)+'"]'),n=s.closest("[data-tab]").data(h.tab),r=P.get.tabElement(n),s&&0<s.length&&n?(P.debug("Anchor link used, opening parent tab",r,s),!1===b.onBeforeChange.call(T,n)?P.debug("onBeforeChange returned false, cancelling tab change",r):(r.hasClass(f.active)||setTimeout(function(){P.scrollTo(s)},0),P.activate.all(n),P.cache.read(n)||(P.cache.add(n,!0),P.debug("First time tab loaded calling tab init"),b.onFirstLoad.call(r[0],n,S,A)),b.onLoad.call(r[0],n,S,A)),!1):void 0)})},scrollTo:function(e){var t=!!(e&&0<e.length)&&e.offset().top;!1!==t&&(P.debug("Forcing scroll to an in-page link in a hidden tab",t,e),c.scrollTop(t))},update:{content:function(e,t,a=b.evaluateScripts){const n=P.get.tabElement(e),i=n[0];"string"==typeof b.cacheType&&"dom"===b.cacheType.toLowerCase()&&"string"!=typeof t?n.empty().append(F(t).clone(!0)):a?(P.debug("Updating HTML and evaluating inline scripts",e,t),n.html(t)):(P.debug("Updating HTML",e,t),i.innerHTML=t)}},fetch:{content:function(t,a=t){const n=P.get.tabElement(t);var e={dataType:"html",encodeParameters:!1,on:"now",cache:b.alwaysRefresh,onSuccess:function(e){"response"===b.cacheType&&P.cache.add(a,e),P.update.content(t,e),t==C?(P.debug("Content loaded",t),P.activate.tab(t)):P.debug("Content loaded in background",t),b.onFirstLoad.call(n[0],t,S,A),b.onLoad.call(n[0],t,S,A),b.loadOnce?P.cache.add(a,!0):"string"==typeof b.cacheType&&"dom"===b.cacheType.toLowerCase()&&0<n.children().length?setTimeout(function(){let e=n.children().clone(!0);e=e.not("script"),P.cache.add(a,e)},0):P.cache.add(a,n.html())},urlData:{tab:a}};const i=n.api("get request")||!1;var o=i&&"pending"===i.state(),r=P.cache.read(a);b.cache&&r?(P.activate.tab(t),P.debug("Adding cached content",a),b.loadOnce||("once"===b.evaluateScripts?P.update.content(t,r,!1):P.update.content(t,r)),b.onLoad.call(n[0],t,S,A)):o?(P.set.loading(t),P.debug("Content is already loading",a)):void 0!==F.api?(r=F.extend(!0,{},b.apiSettings,e),P.debug("Retrieving remote content",a,r),P.set.loading(t),n.api(r)):P.error(p.api)}},activate:{all:function(e){P.activate.tab(e),P.activate.navigation(e)},tab:function(e){const t=P.get.tabElement(e),a="siblings"===b.deactivate?t.siblings(o):o.not(t);var n=t.hasClass(f.active);P.verbose("Showing tab content for",t),n||(t.addClass(f.active),a.removeClass(f.active+" "+f.loading),0<t.length&&b.onVisible.call(t[0],e))},navigation:function(e){const t=P.get.navElement(e),a="siblings"===b.deactivate?t.siblings(r):r.not(t);var n=t.hasClass(f.active);P.verbose("Activating tab navigation for",t,e),n||(t.addClass(f.active),a.removeClass(f.active+" "+f.loading))}},deactivate:{all:function(){P.deactivate.navigation(),P.deactivate.tabs()},navigation:function(){r.removeClass(f.active)},tabs:function(){o.removeClass(f.active+" "+f.loading)}},is:{tab:function(e){return void 0!==e&&0<P.get.tabElement(e).length}},get:{initialPath:function(){return r.eq(0).data(h.tab)||o.eq(0).data(h.tab)},path:function(){return F.address.value()},defaultPathArray:function(e){return P.utilities.pathToArray(P.get.defaultPath(e))},defaultPath:function(e){const t=r.filter("[data-"+h.tab+'^="'+CSS.escape(e)+'/"]').eq(0);var a=t.data(h.tab)||!1;if(a){if(P.debug("Found default tab",a),i<b.maxDepth)return i++,P.get.defaultPath(a);P.error(p.recursion)}else P.debug("No default tabs found for",e,o);return i=0,e},navElement:function(e=C){return r.filter("[data-"+h.tab+'="'+CSS.escape(e)+'"]')},tabElement:function(e=C){var t=P.utilities.pathToArray(e),t=P.utilities.last(t),e=o.filter("[data-"+h.tab+'="'+CSS.escape(e)+'"]'),t=o.filter("[data-"+h.tab+'="'+CSS.escape(t)+'"]');return 0<e.length?e:t},tab:function(){return C}},determine:{activeTab:function(){let i=null;return o.each(function(e,t){const a=F(t);if(a.hasClass(f.active)){t=F(this).data(h.tab);const n=r.filter("[data-"+h.tab+'="'+CSS.escape(t)+'"]');n.hasClass(f.active)&&(i=t)}}),i}},utilities:{filterArray:function(e,t){return F.grep(e,function(e){return!t.includes(e)})},last:function(e){return!!Array.isArray(e)&&e[e.length-1]},pathToArray:function(e){return"string"==typeof(e=void 0===e?C:e)?e.split("/"):[e]},arrayToPath:function(e){return!!Array.isArray(e)&&e.join("/")}},setting:function(e,t){if(P.debug("Changing setting",e,t),F.isPlainObject(e))F.extend(!0,b,e);else{if(void 0===t)return b[e];F.isPlainObject(b[e])?F.extend(!0,b[e],t):b[e]=t}},internal:function(e,t){if(F.isPlainObject(e))F.extend(!0,P,e);else{if(void 0===t)return P[e];P[e]=t}},debug:function(...e){!b.silent&&b.debug&&(b.performance?P.performance.log(e):(P.debug=Function.prototype.bind.call(console.info,console,b.name+":"),P.debug.apply(console,e)))},verbose:function(...e){!b.silent&&b.verbose&&b.debug&&(b.performance?P.performance.log(e):(P.verbose=Function.prototype.bind.call(console.info,console,b.name+":"),P.verbose.apply(console,e)))},error:function(...e){b.silent||(P.error=Function.prototype.bind.call(console.error,console,b.name+":"),P.error.apply(console,e))},performance:{log:function(e){var t,a;b.performance&&(a=(t=Date.now())-(l||t),l=t,d.push({Name:e[0],Arguments:e.slice(1),Element:T,"Execution Time":a})),clearTimeout(P.performance.timer),P.performance.timer=setTimeout(function(){P.performance.display()},500)},display:function(){var e=b.name+":";let a=0;l=!1,clearTimeout(P.performance.timer),F.each(d,function(e,t){a+=t["Execution Time"]}),e+=" "+a+"ms",0<d.length&&(console.groupCollapsed(e),console.table(d),console.groupEnd()),d=[]}},invoke:function(n,e=x,t=T){let i=s,o,r,a;return"string"==typeof n&&void 0!==i&&(n=n.split(/[ .]/),o=n.length-1,F.each(n,function(e,t){var a=e!==o?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(F.isPlainObject(i[a])&&e!==o)i=i[a];else{if(void 0!==i[a])return r=i[a],!1;{if(!F.isPlainObject(i[t])||e===o)return void 0!==i[t]?r=i[t]:P.error(p.method,n),!1;i=i[t]}}})),j(r)?a=r.apply(t,e):void 0!==r&&(a=r),Array.isArray(E)?E.push(a):void 0!==E?E=[E,a]:void 0!==a&&(E=a),r}};g?(void 0===s&&P.initialize(),P.invoke(u)):(void 0!==s&&s.invoke("destroy"),P.initialize())}),void 0!==E?E:this},F.tab=function(...e){F(O).tab.apply(this,e)},F.fn.tab.settings={name:"Tab",namespace:"tab",silent:!1,debug:!1,verbose:!1,performance:!0,auto:!1,history:!1,historyType:"hash",path:!1,context:!1,childrenOnly:!1,maxDepth:25,deactivate:"siblings",alwaysRefresh:!1,cache:!0,loadOnce:!1,cacheType:"response",ignoreFirstLoad:!1,apiSettings:!1,evaluateScripts:"once",autoTabActivation:!0,onFirstLoad:function(e,t,a){},onLoad:function(e,t,a){},onVisible:function(e,t,a){},onRequest:function(e,t,a){},onBeforeChange:function(e){},templates:{determineTitle:function(e){}},error:{api:"You attempted to load content without API module",method:"The method you called is not defined",missingTab:"Activated tab cannot be found. Tabs are case-sensitive.",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",state:"History requires Asual's Address library <https://github.com/asual/jquery-address>"},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".ui.tab",ui:".ui"}}}(jQuery,window,document);
|
package/dist/components/text.css
CHANGED
package/dist/components/toast.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* # Fomantic-UI 2.10.0-beta.
|
|
2
|
+
* # Fomantic-UI 2.10.0-beta.64+bcb9c73 - Toast
|
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
|
4
4
|
*
|
|
5
5
|
*
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
: globalThis;
|
|
21
21
|
|
|
22
22
|
$.fn.toast = function (...args) {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const $allModules = $(this);
|
|
24
|
+
const $body = $('body');
|
|
25
25
|
|
|
26
26
|
let time = Date.now();
|
|
27
27
|
let performance = [];
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
const parameters = args[0];
|
|
30
|
+
const methodInvoked = typeof parameters === 'string';
|
|
31
|
+
const queryArguments = args.slice(1);
|
|
32
|
+
const contextCheck = function (context, win) {
|
|
33
33
|
let $context;
|
|
34
34
|
if ([window, document].includes(context)) {
|
|
35
35
|
$context = $(context);
|
|
@@ -44,18 +44,18 @@
|
|
|
44
44
|
};
|
|
45
45
|
let returnedValue;
|
|
46
46
|
$allModules.each(function () {
|
|
47
|
-
|
|
47
|
+
const settings = $.isPlainObject(parameters)
|
|
48
48
|
? $.extend(true, {}, $.fn.toast.settings, parameters)
|
|
49
49
|
: $.extend({}, $.fn.toast.settings);
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
const className = settings.className;
|
|
52
|
+
const selector = settings.selector;
|
|
53
|
+
const error = settings.error;
|
|
54
|
+
const namespace = settings.namespace;
|
|
55
|
+
const fields = settings.fields;
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
const eventNamespace = '.' + namespace;
|
|
58
|
+
const moduleNamespace = namespace + '-module';
|
|
59
59
|
|
|
60
60
|
let $module = $(this);
|
|
61
61
|
let $toastBox;
|
|
@@ -65,16 +65,15 @@
|
|
|
65
65
|
let $progressBar;
|
|
66
66
|
let $animationObject;
|
|
67
67
|
let $close;
|
|
68
|
-
|
|
68
|
+
const $context = settings.context ? contextCheck(settings.context, window) : $body;
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
const isToastComponent = $module.hasClass('toast') || $module.hasClass('message') || $module.hasClass('card');
|
|
71
71
|
|
|
72
72
|
let element = this;
|
|
73
73
|
let instance = isToastComponent ? $module.data(moduleNamespace) : undefined;
|
|
74
74
|
|
|
75
75
|
let id;
|
|
76
|
-
|
|
77
|
-
module = {
|
|
76
|
+
const module = {
|
|
78
77
|
|
|
79
78
|
initialize: function () {
|
|
80
79
|
module.verbose('Initializing element');
|
|
@@ -162,11 +161,11 @@
|
|
|
162
161
|
},
|
|
163
162
|
toast: function () {
|
|
164
163
|
$toastBox = $('<div/>', { class: className.box });
|
|
165
|
-
|
|
164
|
+
const iconClass = module.get.iconClass();
|
|
166
165
|
if (!isToastComponent) {
|
|
167
166
|
module.verbose('Creating toast');
|
|
168
167
|
$toast = $('<div/>', { role: 'alert' });
|
|
169
|
-
|
|
168
|
+
const $content = $('<div/>', { class: className.content });
|
|
170
169
|
if (iconClass !== '') {
|
|
171
170
|
$toast.append($('<i/>', { class: iconClass + ' ' + className.icon }));
|
|
172
171
|
}
|
|
@@ -179,7 +178,7 @@
|
|
|
179
178
|
}));
|
|
180
179
|
}
|
|
181
180
|
if (settings.title !== '') {
|
|
182
|
-
|
|
181
|
+
const titleId = '_' + module.get.id() + 'title';
|
|
183
182
|
$toast.attr('aria-labelledby', titleId);
|
|
184
183
|
$content.append($('<div/>', {
|
|
185
184
|
class: className.title,
|
|
@@ -187,7 +186,7 @@
|
|
|
187
186
|
html: module.helpers.escape(settings.title, settings),
|
|
188
187
|
}));
|
|
189
188
|
}
|
|
190
|
-
|
|
189
|
+
const descId = '_' + module.get.id() + 'desc';
|
|
191
190
|
$toast.attr('aria-describedby', descId);
|
|
192
191
|
$content.append($('<div/>', {
|
|
193
192
|
class: className.message,
|
|
@@ -248,13 +247,13 @@
|
|
|
248
247
|
}
|
|
249
248
|
}
|
|
250
249
|
settings.actions.forEach(function (el) {
|
|
251
|
-
|
|
250
|
+
const icon = el[fields.icon]
|
|
252
251
|
? '<i ' + (el[fields.text] ? 'aria-hidden="true"' : '')
|
|
253
252
|
+ ' class="' + module.helpers.escape(el[fields.icon]) + ' icon"></i>'
|
|
254
253
|
: '';
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
254
|
+
const text = module.helpers.escape(el[fields.text] || '', settings);
|
|
255
|
+
const cls = module.helpers.escape(el[fields.class] || '');
|
|
256
|
+
const click = el[fields.click] && isFunction(el[fields.click])
|
|
258
257
|
? el[fields.click]
|
|
259
258
|
: function () {};
|
|
260
259
|
$actions.append($('<button/>', {
|
|
@@ -263,7 +262,7 @@
|
|
|
263
262
|
class: className.button + ' ' + cls,
|
|
264
263
|
on: {
|
|
265
264
|
click: function () {
|
|
266
|
-
|
|
265
|
+
const $button = $(this);
|
|
267
266
|
if ($button.is(selector.approve) || $button.is(selector.deny) || click.call(element, $module) === false) {
|
|
268
267
|
return;
|
|
269
268
|
}
|
|
@@ -316,7 +315,7 @@
|
|
|
316
315
|
element = $toast[0];
|
|
317
316
|
}
|
|
318
317
|
if (settings.displayTime > 0) {
|
|
319
|
-
|
|
318
|
+
const progressingClass = className.progressing + ' ' + (settings.pauseOnHover ? className.pausable : '');
|
|
320
319
|
if (settings.showProgress) {
|
|
321
320
|
$progress = $('<div/>', {
|
|
322
321
|
class: className.progress + ' ' + (settings.classProgress || settings.class),
|
|
@@ -563,7 +562,7 @@
|
|
|
563
562
|
|
|
564
563
|
helpers: {
|
|
565
564
|
toClass: function (selector) {
|
|
566
|
-
|
|
565
|
+
const classes = selector.trim().split(/\s+/);
|
|
567
566
|
let result = '';
|
|
568
567
|
|
|
569
568
|
classes.forEach(function (element) {
|
|
@@ -697,7 +696,7 @@
|
|
|
697
696
|
query = query.split(/[ .]/);
|
|
698
697
|
maxDepth = query.length - 1;
|
|
699
698
|
$.each(query, function (depth, value) {
|
|
700
|
-
|
|
699
|
+
const camelCaseValue = depth !== maxDepth
|
|
701
700
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
|
702
701
|
: query;
|
|
703
702
|
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
|
@@ -887,8 +886,8 @@
|
|
|
887
886
|
|
|
888
887
|
$.extend($.easing, {
|
|
889
888
|
easeOutBounce: function (x) {
|
|
890
|
-
|
|
891
|
-
|
|
889
|
+
const n1 = 7.5625;
|
|
890
|
+
const d1 = 2.75;
|
|
892
891
|
if (x < 1 / d1) {
|
|
893
892
|
return n1 * x * x;
|
|
894
893
|
}
|