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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* # Fomantic-UI 2.10.0-beta.
|
|
2
|
+
* # Fomantic-UI 2.10.0-beta.64+bcb9c73 - Sidebar
|
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
|
4
4
|
*
|
|
5
5
|
*
|
|
@@ -20,20 +20,20 @@
|
|
|
20
20
|
: globalThis;
|
|
21
21
|
|
|
22
22
|
$.fn.sidebar = function (...args) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
const $allModules = $(this);
|
|
24
|
+
const $window = $(window);
|
|
25
|
+
const $document = $(document);
|
|
26
|
+
const $body = $('body');
|
|
27
|
+
const $html = $('html');
|
|
28
|
+
const $head = $('head');
|
|
29
29
|
|
|
30
30
|
let time = Date.now();
|
|
31
31
|
let performance = [];
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
const parameters = args[0];
|
|
34
|
+
const methodInvoked = typeof parameters === 'string';
|
|
35
|
+
const queryArguments = args.slice(1);
|
|
36
|
+
const contextCheck = function (context, win) {
|
|
37
37
|
let $context;
|
|
38
38
|
if ([window, document].includes(context)) {
|
|
39
39
|
$context = $body;
|
|
@@ -49,29 +49,29 @@
|
|
|
49
49
|
let returnedValue;
|
|
50
50
|
|
|
51
51
|
$allModules.each(function () {
|
|
52
|
-
|
|
52
|
+
const settings = $.isPlainObject(parameters)
|
|
53
53
|
? $.extend(true, {}, $.fn.sidebar.settings, parameters)
|
|
54
54
|
: $.extend({}, $.fn.sidebar.settings);
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
const selector = settings.selector;
|
|
57
|
+
const className = settings.className;
|
|
58
|
+
const namespace = settings.namespace;
|
|
59
|
+
const regExp = settings.regExp;
|
|
60
|
+
const error = settings.error;
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
const eventNamespace = '.' + namespace;
|
|
63
|
+
const moduleNamespace = 'module-' + namespace;
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
const $module = $(this);
|
|
66
66
|
let $context = contextCheck(settings.context, window);
|
|
67
|
-
|
|
67
|
+
const isBody = $context[0] === $body[0];
|
|
68
68
|
|
|
69
69
|
let $sidebars = $module.children(selector.sidebar);
|
|
70
70
|
let $fixed = $context.children(selector.fixed);
|
|
71
71
|
let $pusher = $context.children(selector.pusher);
|
|
72
72
|
let $style;
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
const element = this;
|
|
75
75
|
let instance = $module.data(moduleNamespace);
|
|
76
76
|
|
|
77
77
|
let elementNamespace;
|
|
@@ -82,9 +82,7 @@
|
|
|
82
82
|
let tempBodyMargin = 0;
|
|
83
83
|
let hadScrollbar = false;
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
module = {
|
|
85
|
+
const module = {
|
|
88
86
|
|
|
89
87
|
initialize: function () {
|
|
90
88
|
module.debug('Initializing sidebar', parameters);
|
|
@@ -134,8 +132,8 @@
|
|
|
134
132
|
event: {
|
|
135
133
|
clickaway: function (event) {
|
|
136
134
|
if (settings.closable) {
|
|
137
|
-
|
|
138
|
-
|
|
135
|
+
const clickedInPusher = $pusher.find(event.target).length > 0 || $pusher.is(event.target);
|
|
136
|
+
const clickedContext = $context.is(event.target);
|
|
139
137
|
if (clickedInPusher) {
|
|
140
138
|
module.verbose('User clicked on dimmed page');
|
|
141
139
|
module.hide();
|
|
@@ -206,11 +204,11 @@
|
|
|
206
204
|
|
|
207
205
|
add: {
|
|
208
206
|
inlineCSS: function () {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
207
|
+
const width = module.cache.width || $module.outerWidth();
|
|
208
|
+
const height = module.cache.height || $module.outerHeight();
|
|
209
|
+
const isRTL = module.is.rtl();
|
|
210
|
+
const direction = module.get.direction();
|
|
211
|
+
const distance = {
|
|
214
212
|
left: width,
|
|
215
213
|
right: -width,
|
|
216
214
|
top: height,
|
|
@@ -265,7 +263,7 @@
|
|
|
265
263
|
repaint: function () {
|
|
266
264
|
module.verbose('Forcing repaint event');
|
|
267
265
|
element.style.display = 'none';
|
|
268
|
-
|
|
266
|
+
const ignored = element.offsetHeight;
|
|
269
267
|
element.scrollTop = element.scrollTop; // eslint-disable-line no-self-assign
|
|
270
268
|
element.style.display = '';
|
|
271
269
|
},
|
|
@@ -302,7 +300,7 @@
|
|
|
302
300
|
},
|
|
303
301
|
|
|
304
302
|
attachEvents: function (selector, event) {
|
|
305
|
-
|
|
303
|
+
const $toggle = $(selector);
|
|
306
304
|
event = isFunction(module[event])
|
|
307
305
|
? module[event]
|
|
308
306
|
: module.toggle;
|
|
@@ -327,7 +325,7 @@
|
|
|
327
325
|
bodyMargin: function () {
|
|
328
326
|
initialBodyMargin = $context.css((isBody ? 'margin-' : 'padding-') + (module.can.leftBodyScrollbar() ? 'left' : 'right'));
|
|
329
327
|
initialBodyMarginInt = parseInt(initialBodyMargin.replace(/[^\d.]/g, ''), 10);
|
|
330
|
-
|
|
328
|
+
const bodyScrollbarWidth = isBody ? window.innerWidth - document.documentElement.clientWidth : $context[0].offsetWidth - $context[0].clientWidth;
|
|
331
329
|
tempBodyMargin = initialBodyMarginInt + bodyScrollbarWidth;
|
|
332
330
|
},
|
|
333
331
|
},
|
|
@@ -398,13 +396,13 @@
|
|
|
398
396
|
},
|
|
399
397
|
|
|
400
398
|
hideOthers: function (callback = function () {}) {
|
|
401
|
-
|
|
402
|
-
|
|
399
|
+
const $otherSidebars = $sidebars.not($module).filter('.' + className.visible);
|
|
400
|
+
const sidebarCount = $otherSidebars.length;
|
|
403
401
|
let callbackCount = 0;
|
|
404
402
|
$otherSidebars
|
|
405
403
|
.sidebar('hide', function () {
|
|
406
404
|
callbackCount++;
|
|
407
|
-
if (callbackCount === sidebarCount) {
|
|
405
|
+
if (callbackCount === sidebarCount && isFunction(callback)) {
|
|
408
406
|
callback();
|
|
409
407
|
}
|
|
410
408
|
});
|
|
@@ -420,13 +418,10 @@
|
|
|
420
418
|
},
|
|
421
419
|
|
|
422
420
|
pushPage: function (callback) {
|
|
423
|
-
|
|
424
|
-
|
|
421
|
+
const transition = module.get.transition();
|
|
422
|
+
const $transition = transition === 'overlay' || module.othersActive()
|
|
425
423
|
? $module
|
|
426
424
|
: $pusher;
|
|
427
|
-
let animate;
|
|
428
|
-
let dim;
|
|
429
|
-
let transitionEnd;
|
|
430
425
|
callback = isFunction(callback)
|
|
431
426
|
? callback
|
|
432
427
|
: function () {};
|
|
@@ -439,16 +434,16 @@
|
|
|
439
434
|
module.bind.scrollLock();
|
|
440
435
|
module.set.transition(transition);
|
|
441
436
|
module.repaint();
|
|
442
|
-
animate = function () {
|
|
437
|
+
const animate = function () {
|
|
443
438
|
module.bind.clickaway();
|
|
444
439
|
module.add.inlineCSS();
|
|
445
440
|
module.set.animating();
|
|
446
441
|
module.set.visible();
|
|
447
442
|
};
|
|
448
|
-
dim = function () {
|
|
443
|
+
const dim = function () {
|
|
449
444
|
module.set.dimmed();
|
|
450
445
|
};
|
|
451
|
-
transitionEnd = function (event) {
|
|
446
|
+
const transitionEnd = function (event) {
|
|
452
447
|
if (event.target === $transition[0]) {
|
|
453
448
|
$transition.off('transitionend' + elementNamespace, transitionEnd);
|
|
454
449
|
module.remove.animating();
|
|
@@ -464,12 +459,10 @@
|
|
|
464
459
|
},
|
|
465
460
|
|
|
466
461
|
pullPage: function (callback) {
|
|
467
|
-
|
|
468
|
-
|
|
462
|
+
const transition = module.get.transition();
|
|
463
|
+
const $transition = transition === 'overlay' || module.othersActive()
|
|
469
464
|
? $module
|
|
470
465
|
: $pusher;
|
|
471
|
-
let animate;
|
|
472
|
-
let transitionEnd;
|
|
473
466
|
callback = isFunction(callback)
|
|
474
467
|
? callback
|
|
475
468
|
: function () {};
|
|
@@ -478,7 +471,7 @@
|
|
|
478
471
|
module.unbind.clickaway();
|
|
479
472
|
module.unbind.scrollLock();
|
|
480
473
|
|
|
481
|
-
animate = function () {
|
|
474
|
+
const animate = function () {
|
|
482
475
|
module.set.transition(transition);
|
|
483
476
|
module.set.animating();
|
|
484
477
|
if (settings.dimPage && !module.othersVisible()) {
|
|
@@ -486,7 +479,7 @@
|
|
|
486
479
|
}
|
|
487
480
|
module.remove.visible();
|
|
488
481
|
};
|
|
489
|
-
transitionEnd = function (event) {
|
|
482
|
+
const transitionEnd = function (event) {
|
|
490
483
|
if (event.target === $transition[0]) {
|
|
491
484
|
$transition.off('transitionend' + elementNamespace, transitionEnd);
|
|
492
485
|
module.remove.animating();
|
|
@@ -527,11 +520,11 @@
|
|
|
527
520
|
|
|
528
521
|
set: {
|
|
529
522
|
bodyMargin: function () {
|
|
530
|
-
|
|
523
|
+
const position = module.can.leftBodyScrollbar() ? 'left' : 'right';
|
|
531
524
|
$context.css((isBody ? 'margin-' : 'padding-') + position, tempBodyMargin + 'px');
|
|
532
525
|
$context.find(selector.bodyFixed.replace('right', position)).each(function () {
|
|
533
|
-
|
|
534
|
-
|
|
526
|
+
const el = $(this);
|
|
527
|
+
const attribute = el.css('position') === 'fixed' ? 'padding-' + position : position;
|
|
535
528
|
el.css(attribute, 'calc(' + el.css(attribute) + ' + ' + tempBodyMargin + 'px)');
|
|
536
529
|
});
|
|
537
530
|
},
|
|
@@ -621,11 +614,11 @@
|
|
|
621
614
|
},
|
|
622
615
|
restore: {
|
|
623
616
|
bodyMargin: function () {
|
|
624
|
-
|
|
617
|
+
const position = module.can.leftBodyScrollbar() ? 'left' : 'right';
|
|
625
618
|
$context.css((isBody ? 'margin-' : 'padding-') + position, initialBodyMarginInt === 0 ? '' : initialBodyMargin);
|
|
626
619
|
$context.find(selector.bodyFixed.replace('right', position)).each(function () {
|
|
627
|
-
|
|
628
|
-
|
|
620
|
+
const el = $(this);
|
|
621
|
+
const attribute = el.css('position') === 'fixed' ? 'padding-' + position : position;
|
|
629
622
|
el.css(attribute, '');
|
|
630
623
|
});
|
|
631
624
|
},
|
|
@@ -645,9 +638,8 @@
|
|
|
645
638
|
return className.left;
|
|
646
639
|
},
|
|
647
640
|
transition: function () {
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
transition = module.is.mobile()
|
|
641
|
+
const direction = module.get.direction();
|
|
642
|
+
const transition = module.is.mobile()
|
|
651
643
|
? (settings.mobileTransition === 'auto'
|
|
652
644
|
? settings.defaultTransition.mobile[direction]
|
|
653
645
|
: settings.mobileTransition)
|
|
@@ -683,8 +675,8 @@
|
|
|
683
675
|
return !(self === top);
|
|
684
676
|
},
|
|
685
677
|
mobile: function () {
|
|
686
|
-
|
|
687
|
-
|
|
678
|
+
const userAgent = navigator.userAgent;
|
|
679
|
+
const isMobile = userAgent.match(regExp.mobile);
|
|
688
680
|
if (isMobile) {
|
|
689
681
|
module.verbose('Browser was found to be mobile', userAgent);
|
|
690
682
|
|
|
@@ -820,7 +812,7 @@
|
|
|
820
812
|
query = query.split(/[ .]/);
|
|
821
813
|
maxDepth = query.length - 1;
|
|
822
814
|
$.each(query, function (depth, value) {
|
|
823
|
-
|
|
815
|
+
const camelCaseValue = depth !== maxDepth
|
|
824
816
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
|
825
817
|
: query;
|
|
826
818
|
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(R,j,V){"use strict";function q(e){return"function"==typeof e&&"number"!=typeof e.nodeType}j=void 0!==j&&j.Math===Math?j:globalThis,R.fn.sidebar=function(...e){let i=R(this),w=R(j),A=R(V),F=R("body");R("html");let P=R("head"),H=Date.now(),M=[],B=e[0],O="string"==typeof B,E=e.slice(1),L=function(e,i){let n;return[j,V].includes(e)?n=F:0===(n=R(i.document).find(e)).length&&(n=i.frameElement?L(e,i.parent):F),n},D;return i.each(function(){let r=R.isPlainObject(B)?R.extend(!0,{},R.fn.sidebar.settings,B):R.extend({},R.fn.sidebar.settings),i=r.selector,s=r.className;var e=r.namespace;let n=r.regExp,a=r.error,t="."+e,o="module-"+e,l=R(this),c=L(r.context,j),d=c[0]===F[0],u=l.children(i.sidebar),f=void c.children(i.fixed),h=c.children(i.pusher),g,b=this,m=l.data(o),v,p,y,S="",x=0,C=0,T=!1,k;k={initialize:function(){k.debug("Initializing sidebar",B),k.create.id(),r.delaySetup?requestAnimationFrame(k.setup.layout):k.setup.layout(),requestAnimationFrame(function(){k.setup.cache()}),k.instantiate()},instantiate:function(){k.verbose("Storing instance of module",k),m=k,l.data(o,k)},create:{id:function(){p=(Math.random().toString(16)+"000000000").slice(2,10),v="."+p,k.verbose("Creating unique id for element",p)}},destroy:function(){k.verbose("Destroying previous module for",l),l.off(t).removeData(o),c.off(v),w.off(v),A.off(v)},event:{clickaway:function(e){var i;r.closable&&(i=0<h.find(e.target).length||h.is(e.target),e=c.is(e.target),i&&(k.verbose("User clicked on dimmed page"),k.hide()),e&&(k.verbose("User clicked on dimmable context (scaled out page)"),k.hide()))},touch:function(e){},containScroll:function(e){b.scrollTop<=0&&(b.scrollTop=1),b.scrollTop+b.offsetHeight>=b.scrollHeight&&(b.scrollTop=b.scrollHeight-b.offsetHeight-1)},scroll:function(e){0===R(e.target).closest(i.sidebar).length&&e.preventDefault()}},bind:{clickaway:function(){k.verbose("Adding clickaway events to context",c),c.on("click"+v,k.event.clickaway).on("touchend"+v,k.event.clickaway)},scrollLock:function(){r.scrollLock&&(k.debug("Disabling page scroll"),(T=k.has.scrollbar())&&(k.save.bodyMargin(),k.set.bodyMargin()),c.addClass(s.locked)),k.verbose("Adding events to contain sidebar scroll"),A.on("touchmove"+v,k.event.touch),l.on("scroll"+t,k.event.containScroll)}},unbind:{clickaway:function(){k.verbose("Removing clickaway events from context",c),c.off(v)},scrollLock:function(){k.verbose("Removing scroll lock from page"),T&&k.restore.bodyMargin(),c.removeClass(s.locked),A.off(v),l.off("scroll"+t)}},add:{inlineCSS:function(){var e=k.cache.width||l.outerWidth(),i=k.cache.height||l.outerHeight(),n=k.is.rtl(),t=k.get.direction();let o={left:e,right:-e,top:i,bottom:-i},r;n&&(k.verbose("RTL detected, flipping widths"),o.left=-e,o.right=e),r="<style>","left"===t||"right"===t?(k.debug("Adding CSS rules for animation distance",e),r+=" .ui.visible."+t+".sidebar ~ .fixed, .ui.visible."+t+".sidebar ~ .pusher { transform: translate3d("+o[t]+"px, 0, 0); }"):"top"!==t&&"bottom"!==t||(r+=" .ui.visible."+t+".sidebar ~ .fixed, .ui.visible."+t+".sidebar ~ .pusher { transform: translate3d(0, "+o[t]+"px, 0); }"),r+="</style>",g=R(r).appendTo(P),k.debug("Adding sizing css to head",g)}},refresh:function(){k.verbose("Refreshing selector cache"),c=L(r.context,j),k.refreshSidebars(),h=c.children(i.pusher),f=c.children(i.fixed),k.clear.cache()},refreshSidebars:function(){k.verbose("Refreshing other sidebars"),u=c.children(i.sidebar)},repaint:function(){k.verbose("Forcing repaint event"),b.style.display="none";b.offsetHeight;b.scrollTop=b.scrollTop,b.style.display=""},setup:{cache:function(){k.cache={width:l.outerWidth(),height:l.outerHeight()}},layout:function(){0===c.children(i.pusher).length&&(k.debug("Adding wrapper element for sidebar"),k.error(a.pusher),h=R('<div class="pusher" />'),c.children().not(i.omitted).not(u).wrapAll(h),k.refresh()),0!==l.nextAll(i.pusher).length&&l.nextAll(i.pusher)[0]===h[0]||(k.debug("Moved sidebar to correct parent element"),k.error(a.movedSidebar,b),l.detach().prependTo(c),k.refresh()),k.clear.cache(),k.set.pushable(),k.set.direction()}},attachEvents:function(e,i){let n=R(e);i=q(k[i])?k[i]:k.toggle,0<n.length?(k.debug("Attaching sidebar events to element",e,i),n.on("click"+t,i)):k.error(a.notFound,e)},can:{leftBodyScrollbar:function(){return void 0===k.cache.leftBodyScrollbar&&(k.cache.leftBodyScrollbar=k.is.rtl()&&(k.is.iframe&&!k.is.firefox()||k.is.safari())),k.cache.leftBodyScrollbar}},save:{bodyMargin:function(){S=c.css((d?"margin-":"padding-")+(k.can.leftBodyScrollbar()?"left":"right")),x=parseInt(S.replace(/[^\d.]/g,""),10);var e=d?j.innerWidth-V.documentElement.clientWidth:c[0].offsetWidth-c[0].clientWidth;C=x+e}},show:function(e){if(e=q(e)?e:function(){},k.is.hidden())if(!1===r.onShow.call(b))k.verbose("Show callback returned false cancelling show");else{if(r.overlay&&(k.error(a.overlay),r.transition="overlay"),k.refresh(),k.othersActive())if(k.debug("Other sidebars currently visible"),r.exclusive){if("overlay"!==r.transition)return void k.hideOthers(k.show);k.hideOthers()}else r.transition="overlay";k.set.dimmerStyles(),k.pushPage(function(){e.call(b),r.onVisible.call(b)}),r.onChange.call(b)}else k.debug("Sidebar is already visible")},hide:function(e){e=q(e)?e:function(){},(k.is.visible()||k.is.animating())&&!1!==r.onHide.call(b)&&(k.debug("Hiding sidebar",e),k.refreshSidebars(),k.pullPage(function(){e.call(b),r.onHidden.call(b)}),r.onChange.call(b))},othersAnimating:function(){return 0<u.not(l).filter("."+s.animating).length},othersVisible:function(){return 0<u.not(l).filter("."+s.visible).length},othersActive:function(){return k.othersVisible()||k.othersAnimating()},hideOthers:function(e=function(){}){let i=u.not(l).filter("."+s.visible),n=i.length,t=0;i.sidebar("hide",function(){++t===n&&e()})},toggle:function(){k.verbose("Determining toggled direction"),k.is.hidden()?k.show():k.hide()},pushPage:function(i){var e,n=k.get.transition();let t="overlay"===n||k.othersActive()?l:h,o;i=q(i)?i:function(){},r.returnScroll&&(y=(d?w:c).scrollTop()),"scale down"===r.transition&&k.scrollToTop(),k.bind.scrollLock(),k.set.transition(n),k.repaint(),n=function(){k.bind.clickaway(),k.add.inlineCSS(),k.set.animating(),k.set.visible()},e=function(){k.set.dimmed()},o=function(e){e.target===t[0]&&(t.off("transitionend"+v,o),k.remove.animating(),i.call(b))},t.off("transitionend"+v),t.on("transitionend"+v,o),requestAnimationFrame(n),r.dimPage&&!k.othersVisible()&&requestAnimationFrame(e)},pullPage:function(i){let n=k.get.transition(),t="overlay"===n||k.othersActive()?l:h;var e;let o;i=q(i)?i:function(){},k.verbose("Removing context push state",k.get.direction()),k.unbind.clickaway(),k.unbind.scrollLock(),e=function(){k.set.transition(n),k.set.animating(),r.dimPage&&!k.othersVisible()&&k.set.closing(),k.remove.visible()},o=function(e){e.target===t[0]&&(t.off("transitionend"+v,o),k.remove.animating(),k.remove.closing(),k.remove.transition(),k.remove.inlineCSS(),"scale down"!==n&&!r.returnScroll||k.scrollBack(),r.dimPage&&!k.othersVisible()&&h.removeClass(s.dimmed),i.call(b))},t.off("transitionend"+v),t.on("transitionend"+v,o),requestAnimationFrame(e)},scrollToTop:function(){k.verbose("Scrolling to top of page to avoid animation issues"),l.scrollTop(0),(d?w:c)[0].scrollTo(0,0)},scrollBack:function(){k.verbose("Scrolling back to original page position"),(d?w:c)[0].scrollTo(0,y)},clear:{cache:function(){k.verbose("Clearing cached dimensions"),k.cache={}}},set:{bodyMargin:function(){let n=k.can.leftBodyScrollbar()?"left":"right";c.css((d?"margin-":"padding-")+n,C+"px"),c.find(i.bodyFixed.replace("right",n)).each(function(){let e=R(this);var i="fixed"===e.css("position")?"padding-"+n:n;e.css(i,"calc("+e.css(i)+" + "+C+"px)")})},dimmerStyles:function(){r.blurring?h.addClass(s.blurring):h.removeClass(s.blurring)},pushed:function(){c.addClass(s.pushed)},pushable:function(){c.addClass(s.pushable)},dimmed:function(){h.addClass(s.dimmed)},active:function(){l.addClass(s.active)},animating:function(){l.addClass(s.animating)},closing:function(){h.addClass(s.closing)},transition:function(e=k.get.transition()){l.addClass(e)},direction:function(e=k.get.direction()){l.addClass(s[e])},visible:function(){l.addClass(s.visible)},overlay:function(){l.addClass(s.overlay)}},remove:{inlineCSS:function(){k.debug("Removing inline css styles",g),g&&0<g.length&&g.remove()},pushed:function(){c.removeClass(s.pushed)},pushable:function(){c.removeClass(s.pushable)},active:function(){l.removeClass(s.active)},animating:function(){l.removeClass(s.animating)},closing:function(){h.removeClass(s.closing)},transition:function(e=k.get.transition()){l.removeClass(e)},direction:function(e=k.get.direction()){l.removeClass(s[e])},visible:function(){l.removeClass(s.visible)},overlay:function(){l.removeClass(s.overlay)}},restore:{bodyMargin:function(){let n=k.can.leftBodyScrollbar()?"left":"right";c.css((d?"margin-":"padding-")+n,0===x?"":S),c.find(i.bodyFixed.replace("right",n)).each(function(){let e=R(this);var i="fixed"===e.css("position")?"padding-"+n:n;e.css(i,"")})}},get:{direction:function(){return l.hasClass(s.top)?s.top:l.hasClass(s.right)?s.right:l.hasClass(s.bottom)?s.bottom:s.left},transition:function(){var e=k.get.direction(),e=k.is.mobile()?"auto"===r.mobileTransition?r.defaultTransition.mobile[e]:r.mobileTransition:"auto"===r.transition?r.defaultTransition.computer[e]:r.transition;return k.verbose("Determined transition",e),e}},has:{scrollbar:function(){return d||"hidden"!==c.css("overflow-y")}},is:{safari:function(){return void 0===k.cache.isSafari&&(k.cache.isSafari=/constructor/i.test(j.HTMLElement)||!!j.ApplePaySession),k.cache.isSafari},firefox:function(){return void 0===k.cache.isFirefox&&(k.cache.isFirefox=!!j.InstallTrigger),k.cache.isFirefox},iframe:function(){return!(self===top)},mobile:function(){let e=navigator.userAgent;return e.match(n.mobile)?(k.verbose("Browser was found to be mobile",e),!0):(k.verbose("Browser is not mobile, using regular transition",e),!1)},hidden:function(){return!k.is.visible()},visible:function(){return l.hasClass(s.visible)},open:function(){return k.is.visible()},closed:function(){return k.is.hidden()},vertical:function(){return l.hasClass(s.top)},animating:function(){return c.hasClass(s.animating)},rtl:function(){return void 0===k.cache.isRTL&&(k.cache.isRTL="rtl"===l.attr("dir")||"rtl"===l.css("direction")||"rtl"===F.attr("dir")||"rtl"===F.css("direction")||"rtl"===c.attr("dir")||"rtl"===c.css("direction")),k.cache.isRTL}},setting:function(e,i){if(k.debug("Changing setting",e,i),R.isPlainObject(e))R.extend(!0,r,e);else{if(void 0===i)return r[e];R.isPlainObject(r[e])?R.extend(!0,r[e],i):r[e]=i}},internal:function(e,i){if(R.isPlainObject(e))R.extend(!0,k,e);else{if(void 0===i)return k[e];k[e]=i}},debug:function(...e){!r.silent&&r.debug&&(r.performance?k.performance.log(e):(k.debug=Function.prototype.bind.call(console.info,console,r.name+":"),k.debug.apply(console,e)))},verbose:function(...e){!r.silent&&r.verbose&&r.debug&&(r.performance?k.performance.log(e):(k.verbose=Function.prototype.bind.call(console.info,console,r.name+":"),k.verbose.apply(console,e)))},error:function(...e){r.silent||(k.error=Function.prototype.bind.call(console.error,console,r.name+":"),k.error.apply(console,e))},performance:{log:function(e){var i,n;r.performance&&(n=(i=Date.now())-(H||i),H=i,M.push({Name:e[0],Arguments:e.slice(1),Element:b,"Execution Time":n})),clearTimeout(k.performance.timer),k.performance.timer=setTimeout(function(){k.performance.display()},500)},display:function(){var e=r.name+":";let n=0;H=!1,clearTimeout(k.performance.timer),R.each(M,function(e,i){n+=i["Execution Time"]}),e+=" "+n+"ms",0<M.length&&(console.groupCollapsed(e),console.table(M),console.groupEnd()),M=[]}},invoke:function(t,e=E,i=b){let o=m,r,s,n;return"string"==typeof t&&void 0!==o&&(t=t.split(/[ .]/),r=t.length-1,R.each(t,function(e,i){var n=e!==r?i+t[e+1].charAt(0).toUpperCase()+t[e+1].slice(1):t;if(R.isPlainObject(o[n])&&e!==r)o=o[n];else{if(void 0!==o[n])return s=o[n],!1;{if(!R.isPlainObject(o[i])||e===r)return void 0!==o[i]?s=o[i]:k.error(a.method,t),!1;o=o[i]}}})),q(s)?n=s.apply(i,e):void 0!==s&&(n=s),Array.isArray(D)?D.push(n):void 0!==D?D=[D,n]:void 0!==n&&(D=n),s}},O?(void 0===m&&k.initialize(),k.invoke(B)):(void 0!==m&&k.invoke("destroy"),k.initialize())}),void 0!==D?D:this},R.fn.sidebar.settings={name:"Sidebar",namespace:"sidebar",silent:!1,debug:!1,verbose:!1,performance:!0,transition:"auto",mobileTransition:"auto",defaultTransition:{computer:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"},mobile:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"}},context:"body",exclusive:!1,closable:!0,dimPage:!0,scrollLock:!1,returnScroll:!1,delaySetup:!1,onChange:function(){},onShow:function(){},onHide:function(){},onHidden:function(){},onVisible:function(){},className:{active:"active",animating:"animating",blurring:"blurring",closing:"closing",dimmed:"dimmed",locked:"locked",pushable:"pushable",pushed:"pushed",right:"right",top:"top",left:"left",bottom:"bottom",visible:"visible"},selector:{bodyFixed:"> .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.fixed.nag, > .ui.fixed.nag > .close",fixed:".fixed",omitted:"script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed",pusher:".pusher",sidebar:".ui.sidebar"},regExp:{mobile:/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g},error:{method:"The method you called is not defined.",pusher:"Had to add pusher element. For optimal performance make sure body content is inside a pusher element",movedSidebar:"Had to move sidebar. For optimal performance make sure sidebar and pusher are direct children of your body tag",overlay:"The overlay setting is no longer supported, use animation: overlay",notFound:"There were no elements that matched the specified selector"}}}(jQuery,window,document);
|
|
11
|
+
!function(R,j,V){"use strict";function q(e){return"function"==typeof e&&"number"!=typeof e.nodeType}j=void 0!==j&&j.Math===Math?j:globalThis,R.fn.sidebar=function(...e){const i=R(this),w=R(j),A=R(V),F=R("body");R("html");const P=R("head");let H=Date.now(),M=[];const B=e[0],O="string"==typeof B,E=e.slice(1),L=function(e,i){let n;return[j,V].includes(e)?n=F:0===(n=R(i.document).find(e)).length&&(n=i.frameElement?L(e,i.parent):F),n};let D;return i.each(function(){const r=R.isPlainObject(B)?R.extend(!0,{},R.fn.sidebar.settings,B):R.extend({},R.fn.sidebar.settings),i=r.selector,s=r.className;var e=r.namespace;const n=r.regExp,a=r.error,t="."+e,o="module-"+e,l=R(this);let c=L(r.context,j);const d=c[0]===F[0];let u=l.children(i.sidebar),f=void c.children(i.fixed),h=c.children(i.pusher),g;const b=this;let m=l.data(o),v,p,y,S="",x=0,C=0,T=!1;const k={initialize:function(){k.debug("Initializing sidebar",B),k.create.id(),r.delaySetup?requestAnimationFrame(k.setup.layout):k.setup.layout(),requestAnimationFrame(function(){k.setup.cache()}),k.instantiate()},instantiate:function(){k.verbose("Storing instance of module",k),m=k,l.data(o,k)},create:{id:function(){p=(Math.random().toString(16)+"000000000").slice(2,10),v="."+p,k.verbose("Creating unique id for element",p)}},destroy:function(){k.verbose("Destroying previous module for",l),l.off(t).removeData(o),c.off(v),w.off(v),A.off(v)},event:{clickaway:function(e){var i;r.closable&&(i=0<h.find(e.target).length||h.is(e.target),e=c.is(e.target),i&&(k.verbose("User clicked on dimmed page"),k.hide()),e&&(k.verbose("User clicked on dimmable context (scaled out page)"),k.hide()))},touch:function(e){},containScroll:function(e){b.scrollTop<=0&&(b.scrollTop=1),b.scrollTop+b.offsetHeight>=b.scrollHeight&&(b.scrollTop=b.scrollHeight-b.offsetHeight-1)},scroll:function(e){0===R(e.target).closest(i.sidebar).length&&e.preventDefault()}},bind:{clickaway:function(){k.verbose("Adding clickaway events to context",c),c.on("click"+v,k.event.clickaway).on("touchend"+v,k.event.clickaway)},scrollLock:function(){r.scrollLock&&(k.debug("Disabling page scroll"),(T=k.has.scrollbar())&&(k.save.bodyMargin(),k.set.bodyMargin()),c.addClass(s.locked)),k.verbose("Adding events to contain sidebar scroll"),A.on("touchmove"+v,k.event.touch),l.on("scroll"+t,k.event.containScroll)}},unbind:{clickaway:function(){k.verbose("Removing clickaway events from context",c),c.off(v)},scrollLock:function(){k.verbose("Removing scroll lock from page"),T&&k.restore.bodyMargin(),c.removeClass(s.locked),A.off(v),l.off("scroll"+t)}},add:{inlineCSS:function(){var e=k.cache.width||l.outerWidth(),i=k.cache.height||l.outerHeight(),n=k.is.rtl(),t=k.get.direction();const o={left:e,right:-e,top:i,bottom:-i};let r;n&&(k.verbose("RTL detected, flipping widths"),o.left=-e,o.right=e),r="<style>","left"===t||"right"===t?(k.debug("Adding CSS rules for animation distance",e),r+=" .ui.visible."+t+".sidebar ~ .fixed, .ui.visible."+t+".sidebar ~ .pusher { transform: translate3d("+o[t]+"px, 0, 0); }"):"top"!==t&&"bottom"!==t||(r+=" .ui.visible."+t+".sidebar ~ .fixed, .ui.visible."+t+".sidebar ~ .pusher { transform: translate3d(0, "+o[t]+"px, 0); }"),r+="</style>",g=R(r).appendTo(P),k.debug("Adding sizing css to head",g)}},refresh:function(){k.verbose("Refreshing selector cache"),c=L(r.context,j),k.refreshSidebars(),h=c.children(i.pusher),f=c.children(i.fixed),k.clear.cache()},refreshSidebars:function(){k.verbose("Refreshing other sidebars"),u=c.children(i.sidebar)},repaint:function(){k.verbose("Forcing repaint event"),b.style.display="none";b.offsetHeight;b.scrollTop=b.scrollTop,b.style.display=""},setup:{cache:function(){k.cache={width:l.outerWidth(),height:l.outerHeight()}},layout:function(){0===c.children(i.pusher).length&&(k.debug("Adding wrapper element for sidebar"),k.error(a.pusher),h=R('<div class="pusher" />'),c.children().not(i.omitted).not(u).wrapAll(h),k.refresh()),0!==l.nextAll(i.pusher).length&&l.nextAll(i.pusher)[0]===h[0]||(k.debug("Moved sidebar to correct parent element"),k.error(a.movedSidebar,b),l.detach().prependTo(c),k.refresh()),k.clear.cache(),k.set.pushable(),k.set.direction()}},attachEvents:function(e,i){const n=R(e);i=q(k[i])?k[i]:k.toggle,0<n.length?(k.debug("Attaching sidebar events to element",e,i),n.on("click"+t,i)):k.error(a.notFound,e)},can:{leftBodyScrollbar:function(){return void 0===k.cache.leftBodyScrollbar&&(k.cache.leftBodyScrollbar=k.is.rtl()&&(k.is.iframe&&!k.is.firefox()||k.is.safari())),k.cache.leftBodyScrollbar}},save:{bodyMargin:function(){S=c.css((d?"margin-":"padding-")+(k.can.leftBodyScrollbar()?"left":"right")),x=parseInt(S.replace(/[^\d.]/g,""),10);var e=d?j.innerWidth-V.documentElement.clientWidth:c[0].offsetWidth-c[0].clientWidth;C=x+e}},show:function(e){if(e=q(e)?e:function(){},k.is.hidden())if(!1===r.onShow.call(b))k.verbose("Show callback returned false cancelling show");else{if(r.overlay&&(k.error(a.overlay),r.transition="overlay"),k.refresh(),k.othersActive())if(k.debug("Other sidebars currently visible"),r.exclusive){if("overlay"!==r.transition)return void k.hideOthers(k.show);k.hideOthers()}else r.transition="overlay";k.set.dimmerStyles(),k.pushPage(function(){e.call(b),r.onVisible.call(b)}),r.onChange.call(b)}else k.debug("Sidebar is already visible")},hide:function(e){e=q(e)?e:function(){},(k.is.visible()||k.is.animating())&&!1!==r.onHide.call(b)&&(k.debug("Hiding sidebar",e),k.refreshSidebars(),k.pullPage(function(){e.call(b),r.onHidden.call(b)}),r.onChange.call(b))},othersAnimating:function(){return 0<u.not(l).filter("."+s.animating).length},othersVisible:function(){return 0<u.not(l).filter("."+s.visible).length},othersActive:function(){return k.othersVisible()||k.othersAnimating()},hideOthers:function(e=function(){}){const i=u.not(l).filter("."+s.visible),n=i.length;let t=0;i.sidebar("hide",function(){++t===n&&q(e)&&e()})},toggle:function(){k.verbose("Determining toggled direction"),k.is.hidden()?k.show():k.hide()},pushPage:function(i){var e=k.get.transition();const n="overlay"===e||k.othersActive()?l:h;i=q(i)?i:function(){},r.returnScroll&&(y=(d?w:c).scrollTop()),"scale down"===r.transition&&k.scrollToTop(),k.bind.scrollLock(),k.set.transition(e),k.repaint();function t(e){e.target===n[0]&&(n.off("transitionend"+v,t),k.remove.animating(),i.call(b))}n.off("transitionend"+v),n.on("transitionend"+v,t),requestAnimationFrame(function(){k.bind.clickaway(),k.add.inlineCSS(),k.set.animating(),k.set.visible()}),r.dimPage&&!k.othersVisible()&&requestAnimationFrame(function(){k.set.dimmed()})},pullPage:function(i){const n=k.get.transition(),t="overlay"===n||k.othersActive()?l:h;i=q(i)?i:function(){},k.verbose("Removing context push state",k.get.direction()),k.unbind.clickaway(),k.unbind.scrollLock();function o(e){e.target===t[0]&&(t.off("transitionend"+v,o),k.remove.animating(),k.remove.closing(),k.remove.transition(),k.remove.inlineCSS(),"scale down"!==n&&!r.returnScroll||k.scrollBack(),r.dimPage&&!k.othersVisible()&&h.removeClass(s.dimmed),i.call(b))}t.off("transitionend"+v),t.on("transitionend"+v,o),requestAnimationFrame(function(){k.set.transition(n),k.set.animating(),r.dimPage&&!k.othersVisible()&&k.set.closing(),k.remove.visible()})},scrollToTop:function(){k.verbose("Scrolling to top of page to avoid animation issues"),l.scrollTop(0),(d?w:c)[0].scrollTo(0,0)},scrollBack:function(){k.verbose("Scrolling back to original page position"),(d?w:c)[0].scrollTo(0,y)},clear:{cache:function(){k.verbose("Clearing cached dimensions"),k.cache={}}},set:{bodyMargin:function(){const n=k.can.leftBodyScrollbar()?"left":"right";c.css((d?"margin-":"padding-")+n,C+"px"),c.find(i.bodyFixed.replace("right",n)).each(function(){const e=R(this);var i="fixed"===e.css("position")?"padding-"+n:n;e.css(i,"calc("+e.css(i)+" + "+C+"px)")})},dimmerStyles:function(){r.blurring?h.addClass(s.blurring):h.removeClass(s.blurring)},pushed:function(){c.addClass(s.pushed)},pushable:function(){c.addClass(s.pushable)},dimmed:function(){h.addClass(s.dimmed)},active:function(){l.addClass(s.active)},animating:function(){l.addClass(s.animating)},closing:function(){h.addClass(s.closing)},transition:function(e=k.get.transition()){l.addClass(e)},direction:function(e=k.get.direction()){l.addClass(s[e])},visible:function(){l.addClass(s.visible)},overlay:function(){l.addClass(s.overlay)}},remove:{inlineCSS:function(){k.debug("Removing inline css styles",g),g&&0<g.length&&g.remove()},pushed:function(){c.removeClass(s.pushed)},pushable:function(){c.removeClass(s.pushable)},active:function(){l.removeClass(s.active)},animating:function(){l.removeClass(s.animating)},closing:function(){h.removeClass(s.closing)},transition:function(e=k.get.transition()){l.removeClass(e)},direction:function(e=k.get.direction()){l.removeClass(s[e])},visible:function(){l.removeClass(s.visible)},overlay:function(){l.removeClass(s.overlay)}},restore:{bodyMargin:function(){const n=k.can.leftBodyScrollbar()?"left":"right";c.css((d?"margin-":"padding-")+n,0===x?"":S),c.find(i.bodyFixed.replace("right",n)).each(function(){const e=R(this);var i="fixed"===e.css("position")?"padding-"+n:n;e.css(i,"")})}},get:{direction:function(){return l.hasClass(s.top)?s.top:l.hasClass(s.right)?s.right:l.hasClass(s.bottom)?s.bottom:s.left},transition:function(){var e=k.get.direction(),e=k.is.mobile()?"auto"===r.mobileTransition?r.defaultTransition.mobile[e]:r.mobileTransition:"auto"===r.transition?r.defaultTransition.computer[e]:r.transition;return k.verbose("Determined transition",e),e}},has:{scrollbar:function(){return d||"hidden"!==c.css("overflow-y")}},is:{safari:function(){return void 0===k.cache.isSafari&&(k.cache.isSafari=/constructor/i.test(j.HTMLElement)||!!j.ApplePaySession),k.cache.isSafari},firefox:function(){return void 0===k.cache.isFirefox&&(k.cache.isFirefox=!!j.InstallTrigger),k.cache.isFirefox},iframe:function(){return!(self===top)},mobile:function(){const e=navigator.userAgent;return e.match(n.mobile)?(k.verbose("Browser was found to be mobile",e),!0):(k.verbose("Browser is not mobile, using regular transition",e),!1)},hidden:function(){return!k.is.visible()},visible:function(){return l.hasClass(s.visible)},open:function(){return k.is.visible()},closed:function(){return k.is.hidden()},vertical:function(){return l.hasClass(s.top)},animating:function(){return c.hasClass(s.animating)},rtl:function(){return void 0===k.cache.isRTL&&(k.cache.isRTL="rtl"===l.attr("dir")||"rtl"===l.css("direction")||"rtl"===F.attr("dir")||"rtl"===F.css("direction")||"rtl"===c.attr("dir")||"rtl"===c.css("direction")),k.cache.isRTL}},setting:function(e,i){if(k.debug("Changing setting",e,i),R.isPlainObject(e))R.extend(!0,r,e);else{if(void 0===i)return r[e];R.isPlainObject(r[e])?R.extend(!0,r[e],i):r[e]=i}},internal:function(e,i){if(R.isPlainObject(e))R.extend(!0,k,e);else{if(void 0===i)return k[e];k[e]=i}},debug:function(...e){!r.silent&&r.debug&&(r.performance?k.performance.log(e):(k.debug=Function.prototype.bind.call(console.info,console,r.name+":"),k.debug.apply(console,e)))},verbose:function(...e){!r.silent&&r.verbose&&r.debug&&(r.performance?k.performance.log(e):(k.verbose=Function.prototype.bind.call(console.info,console,r.name+":"),k.verbose.apply(console,e)))},error:function(...e){r.silent||(k.error=Function.prototype.bind.call(console.error,console,r.name+":"),k.error.apply(console,e))},performance:{log:function(e){var i,n;r.performance&&(n=(i=Date.now())-(H||i),H=i,M.push({Name:e[0],Arguments:e.slice(1),Element:b,"Execution Time":n})),clearTimeout(k.performance.timer),k.performance.timer=setTimeout(function(){k.performance.display()},500)},display:function(){var e=r.name+":";let n=0;H=!1,clearTimeout(k.performance.timer),R.each(M,function(e,i){n+=i["Execution Time"]}),e+=" "+n+"ms",0<M.length&&(console.groupCollapsed(e),console.table(M),console.groupEnd()),M=[]}},invoke:function(t,e=E,i=b){let o=m,r,s,n;return"string"==typeof t&&void 0!==o&&(t=t.split(/[ .]/),r=t.length-1,R.each(t,function(e,i){var n=e!==r?i+t[e+1].charAt(0).toUpperCase()+t[e+1].slice(1):t;if(R.isPlainObject(o[n])&&e!==r)o=o[n];else{if(void 0!==o[n])return s=o[n],!1;{if(!R.isPlainObject(o[i])||e===r)return void 0!==o[i]?s=o[i]:k.error(a.method,t),!1;o=o[i]}}})),q(s)?n=s.apply(i,e):void 0!==s&&(n=s),Array.isArray(D)?D.push(n):void 0!==D?D=[D,n]:void 0!==n&&(D=n),s}};O?(void 0===m&&k.initialize(),k.invoke(B)):(void 0!==m&&k.invoke("destroy"),k.initialize())}),void 0!==D?D:this},R.fn.sidebar.settings={name:"Sidebar",namespace:"sidebar",silent:!1,debug:!1,verbose:!1,performance:!0,transition:"auto",mobileTransition:"auto",defaultTransition:{computer:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"},mobile:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"}},context:"body",exclusive:!1,closable:!0,dimPage:!0,scrollLock:!1,returnScroll:!1,delaySetup:!1,onChange:function(){},onShow:function(){},onHide:function(){},onHidden:function(){},onVisible:function(){},className:{active:"active",animating:"animating",blurring:"blurring",closing:"closing",dimmed:"dimmed",locked:"locked",pushable:"pushable",pushed:"pushed",right:"right",top:"top",left:"left",bottom:"bottom",visible:"visible"},selector:{bodyFixed:"> .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.fixed.nag, > .ui.fixed.nag > .close",fixed:".fixed",omitted:"script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed",pusher:".pusher",sidebar:".ui.sidebar"},regExp:{mobile:/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g},error:{method:"The method you called is not defined.",pusher:"Had to add pusher element. For optimal performance make sure body content is inside a pusher element",movedSidebar:"Had to move sidebar. For optimal performance make sure sidebar and pusher are direct children of your body tag",overlay:"The overlay setting is no longer supported, use animation: overlay",notFound:"There were no elements that matched the specified selector"}}}(jQuery,window,document);
|
package/dist/components/site.css
CHANGED
package/dist/components/site.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* # Fomantic-UI 2.10.0-beta.
|
|
2
|
+
* # Fomantic-UI 2.10.0-beta.64+bcb9c73 - Site
|
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
|
4
4
|
*
|
|
5
5
|
*
|
|
@@ -23,27 +23,26 @@
|
|
|
23
23
|
let time = Date.now();
|
|
24
24
|
let performance = [];
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
const parameters = args[0];
|
|
27
|
+
const methodInvoked = typeof parameters === 'string';
|
|
28
|
+
const queryArguments = args.slice(1);
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
const settings = $.isPlainObject(parameters)
|
|
31
31
|
? $.extend(true, {}, $.site.settings, parameters)
|
|
32
32
|
: $.extend({}, $.site.settings);
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
const namespace = settings.namespace;
|
|
35
|
+
const error = settings.error;
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
const moduleNamespace = 'module-' + namespace;
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
const $document = $(document);
|
|
40
|
+
const $module = $document;
|
|
41
|
+
const element = this;
|
|
42
42
|
let instance = $module.data(moduleNamespace);
|
|
43
43
|
|
|
44
|
-
let module;
|
|
45
44
|
let returnedValue;
|
|
46
|
-
module = {
|
|
45
|
+
const module = {
|
|
47
46
|
|
|
48
47
|
initialize: function () {
|
|
49
48
|
module.instantiate();
|
|
@@ -75,7 +74,7 @@
|
|
|
75
74
|
|
|
76
75
|
enabled: {
|
|
77
76
|
modules: function (modules = settings.modules) {
|
|
78
|
-
|
|
77
|
+
const enabledModules = [];
|
|
79
78
|
$.each(modules, function (index, name) {
|
|
80
79
|
if (module.moduleExists(name)) {
|
|
81
80
|
enabledModules.push(name);
|
|
@@ -88,7 +87,7 @@
|
|
|
88
87
|
|
|
89
88
|
disabled: {
|
|
90
89
|
modules: function (modules = settings.modules) {
|
|
91
|
-
|
|
90
|
+
const disabledModules = [];
|
|
92
91
|
$.each(modules, function (index, name) {
|
|
93
92
|
if (!module.moduleExists(name)) {
|
|
94
93
|
disabledModules.push(name);
|
|
@@ -107,7 +106,7 @@
|
|
|
107
106
|
: [modules])
|
|
108
107
|
: modules || settings.modules;
|
|
109
108
|
$.each(modules, function (index, name) {
|
|
110
|
-
|
|
109
|
+
const namespace = module.moduleExists(name)
|
|
111
110
|
? $.fn[name].settings.namespace || false
|
|
112
111
|
: true;
|
|
113
112
|
let $existingModules;
|
|
@@ -296,7 +295,7 @@
|
|
|
296
295
|
query = query.split(/[ .]/);
|
|
297
296
|
maxDepth = query.length - 1;
|
|
298
297
|
$.each(query, function (depth, value) {
|
|
299
|
-
|
|
298
|
+
const camelCaseValue = depth !== maxDepth
|
|
300
299
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
|
301
300
|
: query;
|
|
302
301
|
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(b,p,v){"use strict";p=void 0!==p&&p.Math===Math?p:globalThis,b.fn.site=function(...e){let t=Date.now(),i=[];var n=e[0],o="string"==typeof n;
|
|
11
|
+
!function(b,p,v){"use strict";p=void 0!==p&&p.Math===Math?p:globalThis,b.fn.site=function(...e){let t=Date.now(),i=[];var n=e[0],o="string"==typeof n;const a=e.slice(1),c=b.isPlainObject(n)?b.extend(!0,{},b.site.settings,n):b.extend({},b.site.settings),s=c.namespace,u=c.error,r="module-"+s,l=b(v),d=this;let f=l.data(r),g;const m={initialize:function(){m.instantiate()},instantiate:function(){m.verbose("Storing instance of site",m),f=m,l.data(r,m)},normalize:function(){},fix:{consoleClear:function(){m.debug("Disabling programmatic console clearing"),p.console.clear=function(){}}},moduleExists:function(e){return void 0!==b.fn[e]&&void 0!==b.fn[e].settings},enabled:{modules:function(e=c.modules){const o=[];return b.each(e,function(e,n){m.moduleExists(n)&&o.push(n)}),o}},disabled:{modules:function(e=c.modules){const o=[];return b.each(e,function(e,n){m.moduleExists(n)||o.push(n)}),o}},change:{setting:function(i,s,e,r=!0){e="string"==typeof e?"all"===e?c.modules:[e]:e||c.modules,b.each(e,function(e,n){var o=!m.moduleExists(n)||(b.fn[n].settings.namespace||!1);let t;m.moduleExists(n)&&(m.verbose("Changing default setting",i,s,n),b.fn[n].settings[i]=s,r&&o&&0<(t=b(":data(module-"+o+")")).length&&(m.verbose("Modifying existing settings",t),t[n]("setting",i,s)))})},settings:function(t,e,i=!0){e="string"==typeof e?[e]:e||c.modules,b.each(e,function(e,n){let o;m.moduleExists(n)&&(m.verbose("Changing default setting",t,n),b.extend(!0,b.fn[n].settings,t),i&&s&&0<(o=b(":data(module-"+s+")")).length&&(m.verbose("Modifying existing settings",o),o[n]("setting",t)))})}},enable:{console:function(){m.console(!0)},debug:function(e=c.modules,n=!0){m.debug("Enabling debug for modules",e),m.change.setting("debug",!0,e,n)},verbose:function(e=c.modules,n=!0){m.debug("Enabling verbose debug for modules",e),m.change.setting("verbose",!0,e,n)}},disable:{console:function(){m.console(!1)},debug:function(e=c.modules,n=!0){m.debug("Disabling debug for modules",e),m.change.setting("debug",!1,e,n)},verbose:function(e=c.modules,n=!0){m.debug("Disabling verbose debug for modules",e),m.change.setting("verbose",!1,e,n)}},console:function(e){e?void 0===f.cache.console?m.error(u.console):(m.debug("Restoring console function"),p.console=f.cache.console):(m.debug("Disabling console function"),f.cache.console=p.console,p.console={clear:function(){},error:function(){},group:function(){},groupCollapsed:function(){},groupEnd:function(){},info:function(){},log:function(){},table:function(){},warn:function(){}})},destroy:function(){m.verbose("Destroying previous site for",l),l.removeData(r)},cache:{},setting:function(e,n){if(b.isPlainObject(e))b.extend(!0,c,e);else{if(void 0===n)return c[e];c[e]=n}},internal:function(e,n){if(b.isPlainObject(e))b.extend(!0,m,e);else{if(void 0===n)return m[e];m[e]=n}},debug:function(...e){c.debug&&(c.performance?m.performance.log(e):(m.debug=Function.prototype.bind.call(console.info,console,c.name+":"),m.debug.apply(console,e)))},verbose:function(...e){c.verbose&&c.debug&&(c.performance?m.performance.log(e):(m.verbose=Function.prototype.bind.call(console.info,console,c.name+":"),m.verbose.apply(console,e)))},error:function(...e){m.error=Function.prototype.bind.call(console.error,console,c.name+":"),m.error.apply(console,e)},performance:{log:function(e){var n,o;c.performance&&(o=(n=Date.now())-(t||n),t=n,i.push({Element:d,Name:e[0],Arguments:e.slice(1),"Execution Time":o})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(function(){m.performance.display()},500)},display:function(){var e=c.name+":";let o=0;t=!1,clearTimeout(m.performance.timer),b.each(i,function(e,n){o+=n["Execution Time"]}),e+=" "+o+"ms",0<i.length&&(console.groupCollapsed(e),console.table(i),console.groupEnd()),i=[]}},invoke:function(t,e=a,n=d){let i=f,s,r,o;var c;return"string"==typeof t&&void 0!==i&&(t=t.split(/[ .]/),s=t.length-1,b.each(t,function(e,n){var o=e!==s?n+t[e+1].charAt(0).toUpperCase()+t[e+1].slice(1):t;if(b.isPlainObject(i[o])&&e!==s)i=i[o];else{if(void 0!==i[o])return r=i[o],!1;{if(!b.isPlainObject(i[n])||e===s)return void 0!==i[n]?r=i[n]:m.error(u.method,t),!1;i=i[n]}}})),"function"==typeof(c=r)&&"number"!=typeof c.nodeType?o=r.apply(n,e):void 0!==r&&(o=r),Array.isArray(g)?g.push(o):void 0!==g?g=[g,o]:void 0!==o&&(g=o),r}};return o?(void 0===f&&m.initialize(),m.invoke(n)):(void 0!==f&&m.destroy(),m.initialize()),void 0!==g?g:this},b.site=b.fn.site,b.site.settings={name:"Site",namespace:"site",error:{console:"Console cannot be restored, most likely it was overwritten outside of module",method:"The method you called is not defined."},debug:!1,verbose:!1,performance:!0,modules:["accordion","api","calendar","checkbox","dimmer","dropdown","embed","flyout","form","modal","nag","popup","progress","rating","search","shape","sidebar","slider","state","sticky","tab","toast","transition","visibility"],siteNamespace:"site",namespaceStub:{cache:{},config:{},sections:{},section:{},utilities:{}}},b.extend(b.expr.pseudos,{data:b.expr.createPseudo(function(n){return function(e){return!!b.data(e,n)}})})}(jQuery,window,document);
|