fomantic-ui 2.10.0-beta.63 → 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 +283 -299
- 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 +31 -32
- 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 +73 -80
- 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 +50 -51
- 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 +95 -102
- 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 +55 -63
- 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 +56 -62
- 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 +33 -36
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +75 -76
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +53 -53
- package/dist/semantic.js +1730 -1816
- 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 +74 -75
- 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 +282 -298
- package/src/definitions/modules/embed.js +30 -31
- package/src/definitions/modules/flyout.js +72 -79
- 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 +49 -50
- package/src/definitions/modules/rating.js +32 -33
- package/src/definitions/modules/search.js +94 -101
- package/src/definitions/modules/shape.js +43 -44
- package/src/definitions/modules/sidebar.js +54 -62
- package/src/definitions/modules/slider.js +142 -147
- package/src/definitions/modules/sticky.js +41 -42
- package/src/definitions/modules/tab.js +55 -61
- package/src/definitions/modules/toast.js +31 -32
- package/src/definitions/modules/transition.js +32 -35
- 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/.eslintrc.js
CHANGED
|
@@ -83,7 +83,6 @@ module.exports = {
|
|
|
83
83
|
// TODO rules to be removed/fixed in v2.10.0 as fixes are not compatible with IE11
|
|
84
84
|
'no-restricted-globals': 'off',
|
|
85
85
|
'no-restricted-properties': 'off',
|
|
86
|
-
'prefer-const': 'off',
|
|
87
86
|
'unicorn/no-array-for-each': 'off',
|
|
88
87
|
'unicorn/prefer-number-properties': 'off',
|
|
89
88
|
'unicorn/prefer-reflect-apply': 'off',
|
package/changelog-setup.js
CHANGED
|
@@ -9,7 +9,7 @@ const issueLinks = function (item) {
|
|
|
9
9
|
if (typeof loopVersion !== 'string') {
|
|
10
10
|
return item;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
const repository = semver.gte(loopVersion, '2.4.0') ? 'fomantic/Fomantic-UI' : 'Semantic-Org/Semantic-UI';
|
|
13
13
|
item.subject = item.subject.replace(/#(\d+)([ ,]|$)/, '[`#$1`](https://github.com/' + repository + '/issues/$1) ');
|
|
14
14
|
|
|
15
15
|
return item;
|
|
@@ -96,7 +96,7 @@ module.exports = function (Handlebars) {
|
|
|
96
96
|
if (!(typeof text === 'string')) {
|
|
97
97
|
return '';
|
|
98
98
|
}
|
|
99
|
-
|
|
99
|
+
const result = text.replace(/^(\w+(\([^()]+\))?:|\[[\w ]+]) */, '');
|
|
100
100
|
|
|
101
101
|
return new Handlebars.SafeString(result);
|
|
102
102
|
});
|
|
@@ -105,7 +105,7 @@ module.exports = function (Handlebars) {
|
|
|
105
105
|
if (!(typeof text === 'string')) {
|
|
106
106
|
return '';
|
|
107
107
|
}
|
|
108
|
-
|
|
108
|
+
const result = text.replace(/add ([\dA-Za-z-]+) as a contributor/, '[`$1`](https://github.com/$1)');
|
|
109
109
|
|
|
110
110
|
return Handlebars.helpers.noprefix(result);
|
|
111
111
|
});
|
|
@@ -127,14 +127,14 @@ module.exports = function (Handlebars) {
|
|
|
127
127
|
changelogDeps = {};
|
|
128
128
|
const depsRegex = /(?:build\(deps[A-Za-z-]*\):|\[Snyk]) (?:\[?[Ss]ecurity]? )?(?:bump|upgrade) ([\w./@-]+) from (\d+\.\d+\.\d+) to (\d+\.\d+\.\d+)/;
|
|
129
129
|
const detectVersionRange = function (item) {
|
|
130
|
-
|
|
130
|
+
const subjectDetails = item.subject.match(depsRegex);
|
|
131
131
|
if (!subjectDetails) {
|
|
132
132
|
return true;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
const depPackage = subjectDetails[1];
|
|
136
|
+
const depVersionFrom = subjectDetails[2];
|
|
137
|
+
const depVersionTo = subjectDetails[3];
|
|
138
138
|
if (!changelogDeps[depPackage]) {
|
|
139
139
|
changelogDeps[depPackage] = {
|
|
140
140
|
from: '999.999.999',
|
|
@@ -188,12 +188,12 @@ module.exports = function (Handlebars) {
|
|
|
188
188
|
.filter(detectVersionRange)
|
|
189
189
|
// adjust from version to create the whole range in one line (linked to the latest commit)
|
|
190
190
|
.map((item) => {
|
|
191
|
-
|
|
191
|
+
const subjectDetails = item.subject.match(depsRegex);
|
|
192
192
|
if (!subjectDetails) {
|
|
193
193
|
return item;
|
|
194
194
|
}
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
const depPackage = subjectDetails[1];
|
|
196
|
+
const depVersionFrom = subjectDetails[2];
|
|
197
197
|
item.subject = item.subject.replace(depVersionFrom, changelogDeps[depPackage].from);
|
|
198
198
|
|
|
199
199
|
return item;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* # Fomantic-UI 2.10.0-beta.
|
|
2
|
+
* # Fomantic-UI 2.10.0-beta.64+bcb9c73 - Accordion
|
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
|
4
4
|
*
|
|
5
5
|
*
|
|
@@ -20,39 +20,38 @@
|
|
|
20
20
|
: globalThis;
|
|
21
21
|
|
|
22
22
|
$.fn.accordion = function (...args) {
|
|
23
|
-
|
|
23
|
+
const $allModules = $(this);
|
|
24
24
|
|
|
25
25
|
let time = Date.now();
|
|
26
26
|
let performance = [];
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
const parameters = args[0];
|
|
29
|
+
const methodInvoked = typeof parameters === 'string';
|
|
30
|
+
const queryArguments = args.slice(1);
|
|
31
31
|
|
|
32
32
|
let returnedValue;
|
|
33
33
|
$allModules.each(function () {
|
|
34
|
-
|
|
34
|
+
const settings = $.isPlainObject(parameters)
|
|
35
35
|
? $.extend(true, {}, $.fn.accordion.settings, parameters)
|
|
36
36
|
: $.extend({}, $.fn.accordion.settings);
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
const className = settings.className;
|
|
39
|
+
const namespace = settings.namespace;
|
|
40
|
+
const selector = settings.selector;
|
|
41
|
+
const error = settings.error;
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
const eventNamespace = '.' + namespace;
|
|
44
|
+
const moduleNamespace = 'module-' + namespace;
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
const $module = $(this);
|
|
47
47
|
let $title = $module.find(selector.title);
|
|
48
48
|
let $content = $module.find(selector.content);
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
const element = this;
|
|
51
51
|
let instance = $module.data(moduleNamespace);
|
|
52
52
|
let observer;
|
|
53
|
-
let module;
|
|
54
53
|
|
|
55
|
-
module = {
|
|
54
|
+
const module = {
|
|
56
55
|
|
|
57
56
|
initialize: function () {
|
|
58
57
|
module.debug('Initializing', $module);
|
|
@@ -110,16 +109,16 @@
|
|
|
110
109
|
},
|
|
111
110
|
|
|
112
111
|
toggle: function (query) {
|
|
113
|
-
|
|
112
|
+
const $activeTitle = query !== undefined
|
|
114
113
|
? (typeof query === 'number'
|
|
115
114
|
? $title.eq(query)
|
|
116
115
|
: $(query).closest(selector.title))
|
|
117
116
|
: $(this).closest(selector.title);
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
const $activeContent = $activeTitle.next($content);
|
|
118
|
+
const isAnimating = $activeContent.hasClass(className.animating);
|
|
119
|
+
const isActive = $activeContent.hasClass(className.active);
|
|
120
|
+
const isOpen = isActive && !isAnimating;
|
|
121
|
+
const isOpening = !isActive && isAnimating;
|
|
123
122
|
module.debug('Toggling visibility of content', $activeTitle);
|
|
124
123
|
if (isOpen || isOpening) {
|
|
125
124
|
if (settings.collapsible) {
|
|
@@ -133,15 +132,15 @@
|
|
|
133
132
|
},
|
|
134
133
|
|
|
135
134
|
open: function (query) {
|
|
136
|
-
|
|
135
|
+
const $activeTitle = query !== undefined
|
|
137
136
|
? (typeof query === 'number'
|
|
138
137
|
? $title.eq(query)
|
|
139
138
|
: $(query).closest(selector.title))
|
|
140
139
|
: $(this).closest(selector.title);
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
140
|
+
const $activeContent = $activeTitle.next($content);
|
|
141
|
+
const isAnimating = $activeContent.hasClass(className.animating);
|
|
142
|
+
const isActive = $activeContent.hasClass(className.active);
|
|
143
|
+
const isOpen = isActive || isAnimating;
|
|
145
144
|
if (isOpen) {
|
|
146
145
|
module.debug('Accordion already open, skipping', $activeContent);
|
|
147
146
|
|
|
@@ -196,16 +195,16 @@
|
|
|
196
195
|
},
|
|
197
196
|
|
|
198
197
|
close: function (query) {
|
|
199
|
-
|
|
198
|
+
const $activeTitle = query !== undefined
|
|
200
199
|
? (typeof query === 'number'
|
|
201
200
|
? $title.eq(query)
|
|
202
201
|
: $(query).closest(selector.title))
|
|
203
202
|
: $(this).closest(selector.title);
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
203
|
+
const $activeContent = $activeTitle.next($content);
|
|
204
|
+
const isAnimating = $activeContent.hasClass(className.animating);
|
|
205
|
+
const isActive = $activeContent.hasClass(className.active);
|
|
206
|
+
const isOpening = !isActive && isAnimating;
|
|
207
|
+
const isClosing = isActive && isAnimating;
|
|
209
208
|
if ((isActive || isOpening) && !isClosing) {
|
|
210
209
|
module.debug('Closing accordion content', $activeContent);
|
|
211
210
|
settings.onClosing.call($activeContent);
|
|
@@ -251,13 +250,13 @@
|
|
|
251
250
|
},
|
|
252
251
|
|
|
253
252
|
closeOthers: function (index) {
|
|
254
|
-
|
|
253
|
+
const $activeTitle = index !== undefined
|
|
255
254
|
? $title.eq(index)
|
|
256
255
|
: $(this).closest(selector.title);
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
256
|
+
const $parentTitles = $activeTitle.parents(selector.content).prev(selector.title);
|
|
257
|
+
const $activeAccordion = $activeTitle.closest(selector.accordion);
|
|
258
|
+
const activeSelector = selector.title + '.' + className.active + ':visible';
|
|
259
|
+
const activeContent = selector.content + '.' + className.active + ':visible';
|
|
261
260
|
let $openTitles;
|
|
262
261
|
let $nestedTitles;
|
|
263
262
|
let $openContents;
|
|
@@ -311,7 +310,7 @@
|
|
|
311
310
|
|
|
312
311
|
display: function () {
|
|
313
312
|
module.verbose('Removing inline display from element', this);
|
|
314
|
-
|
|
313
|
+
const $element = $(this);
|
|
315
314
|
$element.css('display', '');
|
|
316
315
|
if ($element.attr('style') === '') {
|
|
317
316
|
$element
|
|
@@ -322,7 +321,7 @@
|
|
|
322
321
|
|
|
323
322
|
opacity: function () {
|
|
324
323
|
module.verbose('Removing inline opacity from element', this);
|
|
325
|
-
|
|
324
|
+
const $element = $(this);
|
|
326
325
|
$element.css('opacity', '');
|
|
327
326
|
if ($element.attr('style') === '') {
|
|
328
327
|
$element
|
|
@@ -433,7 +432,7 @@
|
|
|
433
432
|
query = query.split(/[ .]/);
|
|
434
433
|
maxDepth = query.length - 1;
|
|
435
434
|
$.each(query, function (depth, value) {
|
|
436
|
-
|
|
435
|
+
const camelCaseValue = depth !== maxDepth
|
|
437
436
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
|
438
437
|
: query;
|
|
439
438
|
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(C,e){"use strict";e=void 0!==e&&e.Math===Math?e:globalThis,C.fn.accordion=function(...e){
|
|
11
|
+
!function(C,e){"use strict";e=void 0!==e&&e.Math===Math?e:globalThis,C.fn.accordion=function(...e){const n=C(this);let s=Date.now(),a=[];const m=e[0],h="string"==typeof m,b=e.slice(1);let y;return n.each(function(){const l=C.isPlainObject(m)?C.extend(!0,{},C.fn.accordion.settings,m):C.extend({},C.fn.accordion.settings),c=l.className;var e=l.namespace;const r=l.selector,d=l.error,n="."+e,t="module-"+e,i=C(this);let u=i.find(r.title),g=i.find(r.content);const f=this;let p=i.data(t),o;const v={initialize:function(){v.debug("Initializing",i),v.bind.events(),l.observeChanges&&v.observeChanges(),v.instantiate()},instantiate:function(){p=v,i.data(t,v)},destroy:function(){v.debug("Destroying previous instance",i),i.off(n).removeData(t)},refresh:function(){u=i.find(r.title),g=i.find(r.content)},observeChanges:function(){(o=new MutationObserver(function(e){v.debug("DOM tree modified, updating selector cache"),v.refresh()})).observe(f,{childList:!0,subtree:!0}),v.debug("Setting up mutation observer",o)},bind:{events:function(){v.debug("Binding delegated events"),i.on(l.on+n,r.trigger,v.event.click)}},event:{click:function(e){0===C(e.target).closest(r.ignore).length&&v.toggle.call(this)}},toggle:function(e){const n=void 0!==e?"number"==typeof e?u.eq(e):C(e).closest(r.title):C(this).closest(r.title),t=n.next(g);var e=t.hasClass(c.animating),i=t.hasClass(c.active),o=i&&!e,i=!i&&e;v.debug("Toggling visibility of content",n),o||i?l.collapsible?v.close.call(n):v.debug("Cannot close accordion content collapsing is disabled"):v.open.call(n)},open:function(e){const n=void 0!==e?"number"==typeof e?u.eq(e):C(e).closest(r.title):C(this).closest(r.title),t=n.next(g);e=t.hasClass(c.animating);t.hasClass(c.active)||e?v.debug("Accordion already open, skipping",t):(v.debug("Opening accordion content",n),l.onOpening.call(t),l.onChanging.call(t),l.exclusive&&v.closeOthers.call(n),n.addClass(c.active),t.stop(!0,!0).addClass(c.animating),l.animateChildren&&(void 0!==C.fn.transition?t.children().transition({animation:"fade in",queue:!1,useFailSafe:!0,debug:l.debug,verbose:l.verbose,silent:l.silent,duration:l.duration,skipInlineHidden:!0,onComplete:function(){t.children().removeClass(c.transition)}}):t.children().stop(!0,!0).animate({opacity:1},l.duration,v.resetOpacity)),t.slideDown(l.duration,l.easing,function(){t.removeClass(c.animating).addClass(c.active),v.reset.display.call(this),l.onOpen.call(this),l.onChange.call(this)}))},close:function(e){const n=void 0!==e?"number"==typeof e?u.eq(e):C(e).closest(r.title):C(this).closest(r.title),t=n.next(g);var e=t.hasClass(c.animating),i=t.hasClass(c.active);!i&&!(!i&&e)||i&&e||(v.debug("Closing accordion content",t),l.onClosing.call(t),l.onChanging.call(t),n.removeClass(c.active),t.stop(!0,!0).addClass(c.animating),l.animateChildren&&(void 0!==C.fn.transition?t.children().transition({animation:"fade out",queue:!1,useFailSafe:!0,debug:l.debug,verbose:l.verbose,silent:l.silent,duration:l.duration,skipInlineHidden:!0}):t.children().stop(!0,!0).animate({opacity:0},l.duration,v.resetOpacity)),t.slideUp(l.duration,l.easing,function(){t.removeClass(c.animating).removeClass(c.active),v.reset.display.call(this),l.onClose.call(this),l.onChange.call(this)}))},closeOthers:function(e){const n=void 0!==e?u.eq(e):C(this).closest(r.title);e=n.parents(r.content).prev(r.title);const t=n.closest(r.accordion);var i=r.title+"."+c.active+":visible",o=r.content+"."+c.active+":visible";let s,a;a=(s=l.closeNested?t.find(i).not(e):(s=t.find(i).not(e),o=t.find(o).find(i).not(e),s.not(o))).next(g),0<s.length&&(v.debug("Exclusive enabled, closing other content",s),s.removeClass(c.active),a.removeClass(c.animating).stop(!0,!0),l.animateChildren&&(void 0!==C.fn.transition?a.children().transition({animation:"fade out",useFailSafe:!0,debug:l.debug,verbose:l.verbose,silent:l.silent,duration:l.duration,skipInlineHidden:!0}):a.children().stop(!0,!0).animate({opacity:0},l.duration,v.resetOpacity)),a.slideUp(l.duration,l.easing,function(){C(this).removeClass(c.active),v.reset.display.call(this)}))},reset:{display:function(){v.verbose("Removing inline display from element",this);const e=C(this);e.css("display",""),""===e.attr("style")&&e.attr("style","").removeAttr("style")},opacity:function(){v.verbose("Removing inline opacity from element",this);const e=C(this);e.css("opacity",""),""===e.attr("style")&&e.attr("style","").removeAttr("style")}},setting:function(e,n){if(v.debug("Changing setting",e,n),C.isPlainObject(e))C.extend(!0,l,e);else{if(void 0===n)return l[e];C.isPlainObject(l[e])?C.extend(!0,l[e],n):l[e]=n}},internal:function(e,n){if(v.debug("Changing internal",e,n),void 0===n)return v[e];C.isPlainObject(e)?C.extend(!0,v,e):v[e]=n},debug:function(...e){!l.silent&&l.debug&&(l.performance?v.performance.log(e):(v.debug=Function.prototype.bind.call(console.info,console,l.name+":"),v.debug.apply(console,e)))},verbose:function(...e){!l.silent&&l.verbose&&l.debug&&(l.performance?v.performance.log(e):(v.verbose=Function.prototype.bind.call(console.info,console,l.name+":"),v.verbose.apply(console,e)))},error:function(...e){l.silent||(v.error=Function.prototype.bind.call(console.error,console,l.name+":"),v.error.apply(console,e))},performance:{log:function(e){var n,t;l.performance&&(t=(n=Date.now())-(s||n),s=n,a.push({Name:e[0],Arguments:e.slice(1),Element:f,"Execution Time":t})),clearTimeout(v.performance.timer),v.performance.timer=setTimeout(function(){v.performance.display()},500)},display:function(){var e=l.name+":";let t=0;s=!1,clearTimeout(v.performance.timer),C.each(a,function(e,n){t+=n["Execution Time"]}),e+=" "+t+"ms",0<a.length&&(console.groupCollapsed(e),console.table(a),console.groupEnd()),a=[]}},invoke:function(i,e=b,n=f){let o=p,s,a,t;var l;return"string"==typeof i&&void 0!==o&&(i=i.split(/[ .]/),s=i.length-1,C.each(i,function(e,n){var t=e!==s?n+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(C.isPlainObject(o[t])&&e!==s)o=o[t];else{if(void 0!==o[t])return a=o[t],!1;{if(!C.isPlainObject(o[n])||e===s)return void 0!==o[n]?a=o[n]:v.error(d.method,i),!1;o=o[n]}}})),"function"==typeof(l=a)&&"number"!=typeof l.nodeType?t=a.apply(n,e):void 0!==a&&(t=a),Array.isArray(y)?y.push(t):void 0!==y?y=[y,t]:void 0!==t&&(y=t),a}};h?(void 0===p&&v.initialize(),v.invoke(m)):(void 0!==p&&p.invoke("destroy"),v.initialize())}),void 0!==y?y:this},C.fn.accordion.settings={name:"Accordion",namespace:"accordion",silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",observeChanges:!0,exclusive:!0,collapsible:!0,closeNested:!1,animateChildren:!0,duration:350,easing:"easeOutQuad",onOpening:function(){},onClosing:function(){},onChanging:function(){},onOpen:function(){},onClose:function(){},onChange:function(){},error:{method:"The method you called is not defined"},className:{active:"active",animating:"animating",transition:"transition"},selector:{accordion:".accordion",title:".title",trigger:".title",ignore:".ui.dropdown",content:".content"}},C.extend(C.easing,{easeOutQuad:function(e){return 1-(1-e)*(1-e)}})}(jQuery,window,document);
|
package/dist/components/ad.css
CHANGED
package/dist/components/api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* # Fomantic-UI 2.10.0-beta.
|
|
2
|
+
* # Fomantic-UI 2.10.0-beta.64+bcb9c73 - API
|
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
|
4
4
|
*
|
|
5
5
|
*
|
|
@@ -25,16 +25,16 @@
|
|
|
25
25
|
|
|
26
26
|
$.fn.api = function (...args) {
|
|
27
27
|
// use window context if none specified
|
|
28
|
-
|
|
28
|
+
const $allModules = isFunction(this)
|
|
29
29
|
? $(window)
|
|
30
30
|
: $(this);
|
|
31
31
|
let time = Date.now();
|
|
32
32
|
let performance = [];
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
const parameters = args[0];
|
|
35
|
+
const methodInvoked = typeof parameters === 'string';
|
|
36
|
+
const queryArguments = args.slice(1);
|
|
37
|
+
const contextCheck = function (context, win) {
|
|
38
38
|
let $context;
|
|
39
39
|
if ([window, document].includes(context)) {
|
|
40
40
|
$context = $(context);
|
|
@@ -50,28 +50,28 @@
|
|
|
50
50
|
let returnedValue;
|
|
51
51
|
|
|
52
52
|
$allModules.each(function () {
|
|
53
|
-
|
|
53
|
+
const settings = $.isPlainObject(parameters)
|
|
54
54
|
? $.extend(true, {}, $.fn.api.settings, parameters)
|
|
55
55
|
: $.extend({}, $.fn.api.settings);
|
|
56
56
|
|
|
57
57
|
// internal aliases
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
const regExp = settings.regExp;
|
|
59
|
+
const namespace = settings.namespace;
|
|
60
|
+
const metadata = settings.metadata;
|
|
61
|
+
const selector = settings.selector;
|
|
62
|
+
const error = settings.error;
|
|
63
|
+
const className = settings.className;
|
|
64
64
|
|
|
65
65
|
// define namespaces for modules
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
const eventNamespace = '.' + namespace;
|
|
67
|
+
const moduleNamespace = 'module-' + namespace;
|
|
68
68
|
|
|
69
69
|
// element that creates request
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
const $module = $(this);
|
|
71
|
+
const $form = $module.closest(selector.form);
|
|
72
72
|
|
|
73
73
|
// context used for state
|
|
74
|
-
|
|
74
|
+
const $context = settings.stateContext ? contextCheck(settings.stateContext, window) : $module;
|
|
75
75
|
|
|
76
76
|
// request details
|
|
77
77
|
let ajaxSettings;
|
|
@@ -82,12 +82,11 @@
|
|
|
82
82
|
let originalData;
|
|
83
83
|
|
|
84
84
|
// standard module
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
const element = this;
|
|
86
|
+
const context = $context[0];
|
|
87
87
|
let instance = $module.data(moduleNamespace);
|
|
88
|
-
let module;
|
|
89
88
|
|
|
90
|
-
module = {
|
|
89
|
+
const module = {
|
|
91
90
|
|
|
92
91
|
initialize: function () {
|
|
93
92
|
if (!methodInvoked) {
|
|
@@ -113,7 +112,7 @@
|
|
|
113
112
|
|
|
114
113
|
bind: {
|
|
115
114
|
events: function () {
|
|
116
|
-
|
|
115
|
+
const triggerEvent = module.get.event();
|
|
117
116
|
if (triggerEvent) {
|
|
118
117
|
module.verbose('Attaching API events to element', triggerEvent);
|
|
119
118
|
$module
|
|
@@ -340,7 +339,7 @@
|
|
|
340
339
|
if (requiredVariables) {
|
|
341
340
|
module.debug('Looking for required URL variables', requiredVariables);
|
|
342
341
|
$.each(requiredVariables, function (index, templatedString) {
|
|
343
|
-
|
|
342
|
+
const variable = templatedString.slice(1, -1);
|
|
344
343
|
let value = $.isPlainObject(urlData) && urlData[variable] !== undefined
|
|
345
344
|
? urlData[variable]
|
|
346
345
|
: ($module.data(variable) !== undefined
|
|
@@ -366,8 +365,8 @@
|
|
|
366
365
|
if (optionalVariables) {
|
|
367
366
|
module.debug('Looking for optional URL variables', requiredVariables);
|
|
368
367
|
$.each(optionalVariables, function (index, templatedString) {
|
|
369
|
-
|
|
370
|
-
|
|
368
|
+
const variable = templatedString.slice(2, -1);
|
|
369
|
+
const value = $.isPlainObject(urlData) && urlData[variable] !== undefined
|
|
371
370
|
? urlData[variable]
|
|
372
371
|
: ($module.data(variable) !== undefined
|
|
373
372
|
? $module.data(variable)
|
|
@@ -393,19 +392,18 @@
|
|
|
393
392
|
},
|
|
394
393
|
formData: function (data = originalData || settings.data) {
|
|
395
394
|
let formData = {};
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
hasOtherData = $.isPlainObject(data);
|
|
395
|
+
const useFormDataApi = settings.serializeForm === 'formdata';
|
|
396
|
+
const hasOtherData = $.isPlainObject(data);
|
|
399
397
|
|
|
400
398
|
if (useFormDataApi) {
|
|
401
399
|
formData = new FormData($form[0]);
|
|
402
400
|
settings.processData = settings.processData !== undefined ? settings.processData : false;
|
|
403
401
|
settings.contentType = settings.contentType !== undefined ? settings.contentType : false;
|
|
404
402
|
} else {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
403
|
+
const formArray = $form.serializeArray();
|
|
404
|
+
const pushes = {};
|
|
405
|
+
const pushValues = {};
|
|
406
|
+
const build = function (base, key, value) {
|
|
409
407
|
base[key] = value;
|
|
410
408
|
|
|
411
409
|
return base;
|
|
@@ -420,15 +418,15 @@
|
|
|
420
418
|
if (!regExp.validate.test(el.name)) {
|
|
421
419
|
return;
|
|
422
420
|
}
|
|
423
|
-
|
|
424
|
-
|
|
421
|
+
const isCheckbox = $('[name="' + CSS.escape(el.name) + '"]', $form).attr('type') === 'checkbox';
|
|
422
|
+
const floatValue = parseFloat(el.value);
|
|
425
423
|
let value = (isCheckbox && el.value === 'on')
|
|
426
424
|
|| el.value === 'true'
|
|
427
425
|
|| (String(floatValue) === el.value
|
|
428
426
|
? floatValue
|
|
429
427
|
: (el.value === 'false' ? false : el.value));
|
|
430
|
-
|
|
431
|
-
|
|
428
|
+
const nameKeys = el.name.match(regExp.key) || [];
|
|
429
|
+
const pushKey = el.name.replace(/\[]$/, '');
|
|
432
430
|
if (!(pushKey in pushes)) {
|
|
433
431
|
pushes[pushKey] = 0;
|
|
434
432
|
pushValues[pushKey] = value;
|
|
@@ -442,7 +440,7 @@
|
|
|
442
440
|
}
|
|
443
441
|
|
|
444
442
|
while (nameKeys.length > 0) {
|
|
445
|
-
|
|
443
|
+
const k = nameKeys.pop();
|
|
446
444
|
|
|
447
445
|
if (k === '' && !Array.isArray(value)) { // foo[]
|
|
448
446
|
value = build([], pushes[pushKey]++, value);
|
|
@@ -500,10 +498,10 @@
|
|
|
500
498
|
// nothing special
|
|
501
499
|
},
|
|
502
500
|
done: function (response, textStatus, xhr) {
|
|
503
|
-
|
|
504
|
-
|
|
501
|
+
const context = this;
|
|
502
|
+
const elapsedTime = Date.now() - requestStartTime;
|
|
505
503
|
let timeLeft = settings.loadingDuration - elapsedTime;
|
|
506
|
-
|
|
504
|
+
const translatedResponse = isFunction(settings.onResponse)
|
|
507
505
|
? (module.is.expectingJSON() && !settings.rawResponse
|
|
508
506
|
? settings.onResponse.call(context, $.extend(true, {}, response))
|
|
509
507
|
: settings.onResponse.call(context, response))
|
|
@@ -525,8 +523,8 @@
|
|
|
525
523
|
}, timeLeft);
|
|
526
524
|
},
|
|
527
525
|
fail: function (xhr, status, httpMessage) {
|
|
528
|
-
|
|
529
|
-
|
|
526
|
+
const context = this;
|
|
527
|
+
const elapsedTime = Date.now() - requestStartTime;
|
|
530
528
|
let timeLeft = settings.loadingDuration - elapsedTime;
|
|
531
529
|
timeLeft = Math.max(timeLeft, 0);
|
|
532
530
|
if (timeLeft > 0) {
|
|
@@ -566,8 +564,8 @@
|
|
|
566
564
|
},
|
|
567
565
|
fail: function (xhr, status, httpMessage) {
|
|
568
566
|
// pull response from xhr if available
|
|
569
|
-
|
|
570
|
-
|
|
567
|
+
const response = module.get.responseFromXHR(xhr);
|
|
568
|
+
const errorMessage = module.get.errorFromRequest(response, status, httpMessage);
|
|
571
569
|
if (status === 'aborted') {
|
|
572
570
|
module.debug('XHR Aborted (Most likely caused by page navigation or CORS Policy)', status, httpMessage);
|
|
573
571
|
settings.onAbort.call(context, status, $module, xhr);
|
|
@@ -612,16 +610,15 @@
|
|
|
612
610
|
|
|
613
611
|
mockedXHR: function () {
|
|
614
612
|
// xhr does not simulate these properties of xhr but must return them
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
613
|
+
const textStatus = false;
|
|
614
|
+
const status = false;
|
|
615
|
+
const httpMessage = false;
|
|
616
|
+
const responder = settings.mockResponse || settings.response;
|
|
617
|
+
const asyncResponder = settings.mockResponseAsync || settings.responseAsync;
|
|
620
618
|
let asyncCallback;
|
|
621
619
|
let response;
|
|
622
|
-
let mockedXHR;
|
|
623
620
|
|
|
624
|
-
mockedXHR = $.Deferred()
|
|
621
|
+
const mockedXHR = $.Deferred()
|
|
625
622
|
.always(module.event.xhr.complete)
|
|
626
623
|
.done(module.event.xhr.done)
|
|
627
624
|
.fail(module.event.xhr.fail);
|
|
@@ -654,9 +651,8 @@
|
|
|
654
651
|
},
|
|
655
652
|
|
|
656
653
|
xhr: function () {
|
|
657
|
-
let xhr;
|
|
658
654
|
// ajax request promise
|
|
659
|
-
xhr = $.ajax(ajaxSettings)
|
|
655
|
+
const xhr = $.ajax(ajaxSettings)
|
|
660
656
|
.always(module.event.xhr.always)
|
|
661
657
|
.done(module.event.xhr.done)
|
|
662
658
|
.fail(module.event.xhr.fail);
|
|
@@ -714,7 +710,7 @@
|
|
|
714
710
|
return module.xhr || false;
|
|
715
711
|
},
|
|
716
712
|
settings: function () {
|
|
717
|
-
|
|
713
|
+
const runSettings = settings.beforeSend.call(element, settings);
|
|
718
714
|
if (runSettings === undefined) {
|
|
719
715
|
module.error(error.noReturnedValue);
|
|
720
716
|
}
|
|
@@ -727,9 +723,9 @@
|
|
|
727
723
|
: $.extend(true, {}, settings);
|
|
728
724
|
},
|
|
729
725
|
urlEncodedValue: function (value) {
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
726
|
+
const decodedValue = window.decodeURIComponent(value);
|
|
727
|
+
const encodedValue = window.encodeURIComponent(value);
|
|
728
|
+
const alreadyEncoded = decodedValue !== value;
|
|
733
729
|
if (alreadyEncoded) {
|
|
734
730
|
module.debug('URL value is already encoded, avoiding double encoding', value);
|
|
735
731
|
|
|
@@ -740,7 +736,7 @@
|
|
|
740
736
|
return encodedValue;
|
|
741
737
|
},
|
|
742
738
|
defaultData: function () {
|
|
743
|
-
|
|
739
|
+
const data = {};
|
|
744
740
|
if (!isWindow(element)) {
|
|
745
741
|
if (module.is.input()) {
|
|
746
742
|
data.value = $module.val();
|
|
@@ -799,7 +795,7 @@
|
|
|
799
795
|
},
|
|
800
796
|
|
|
801
797
|
abort: function () {
|
|
802
|
-
|
|
798
|
+
const xhr = module.get.xhr();
|
|
803
799
|
if (xhr && xhr.state() !== 'resolved') {
|
|
804
800
|
module.debug('Cancelling API request');
|
|
805
801
|
xhr.abort();
|
|
@@ -909,7 +905,7 @@
|
|
|
909
905
|
query = query.split(/[ .]/);
|
|
910
906
|
maxDepth = query.length - 1;
|
|
911
907
|
$.each(query, function (depth, value) {
|
|
912
|
-
|
|
908
|
+
const camelCaseValue = depth !== maxDepth
|
|
913
909
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
|
914
910
|
: query;
|
|
915
911
|
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|