fomantic-ui 2.9.0-beta.26 → 2.9.0-beta.262
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/.all-contributorsrc +206 -3
- package/.github/workflows/ci.yml +4 -4
- package/.github/workflows/nightly.yml +4 -4
- package/.github/workflows/release.yml +30 -0
- package/CONTRIBUTORS.md +75 -37
- package/README.md +8 -8
- package/dist/components/accordion.css +162 -26
- package/dist/components/accordion.js +1 -1
- package/dist/components/accordion.min.css +2 -2
- 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 +34 -30
- package/dist/components/api.min.js +3 -3
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +176 -134
- package/dist/components/button.min.css +2 -2
- package/dist/components/calendar.css +18 -1
- package/dist/components/calendar.js +10 -9
- package/dist/components/calendar.min.css +2 -2
- package/dist/components/calendar.min.js +3 -3
- package/dist/components/card.css +26 -19
- package/dist/components/card.min.css +2 -2
- package/dist/components/checkbox.css +2 -1
- package/dist/components/checkbox.js +17 -11
- package/dist/components/checkbox.min.css +2 -2
- package/dist/components/checkbox.min.js +3 -3
- package/dist/components/comment.css +11 -11
- package/dist/components/comment.min.css +1 -1
- package/dist/components/container.css +94 -1
- package/dist/components/container.min.css +2 -2
- package/dist/components/dimmer.css +28 -14
- package/dist/components/dimmer.js +11 -5
- package/dist/components/dimmer.min.css +2 -2
- package/dist/components/dimmer.min.js +3 -3
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +49 -13
- package/dist/components/dropdown.js +66 -39
- package/dist/components/dropdown.min.css +2 -2
- package/dist/components/dropdown.min.js +3 -3
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +1 -1
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- package/dist/components/emoji.css +10147 -8139
- package/dist/components/emoji.min.css +1 -1
- package/dist/components/feed.css +28 -28
- package/dist/components/feed.min.css +2 -2
- package/dist/components/flag.css +734 -625
- package/dist/components/flag.min.css +2 -2
- package/dist/components/form.css +118 -55
- package/dist/components/form.js +38 -29
- package/dist/components/form.min.css +2 -2
- package/dist/components/form.min.js +3 -3
- package/dist/components/grid.css +11 -8
- package/dist/components/grid.min.css +2 -2
- package/dist/components/header.css +3 -1
- package/dist/components/header.min.css +2 -2
- package/dist/components/icon.css +126 -47
- package/dist/components/icon.min.css +2 -2
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +742 -17
- package/dist/components/input.min.css +2 -2
- package/dist/components/item.css +13 -13
- 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 +29 -5
- package/dist/components/menu.min.css +1 -1
- package/dist/components/message.css +41 -41
- package/dist/components/message.min.css +2 -2
- package/dist/components/modal.css +13 -1
- package/dist/components/modal.js +127 -49
- package/dist/components/modal.min.css +2 -2
- package/dist/components/modal.min.js +3 -3
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +1 -1
- 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 +2 -2
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +3 -3
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +4 -1
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +3 -3
- 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 +1 -1
- 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 +2 -2
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +3 -3
- package/dist/components/segment.css +91 -7
- package/dist/components/segment.min.css +2 -2
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +3 -3
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +3 -3
- package/dist/components/sidebar.css +4 -2
- package/dist/components/sidebar.js +8 -6
- package/dist/components/sidebar.min.css +2 -2
- package/dist/components/sidebar.min.js +3 -3
- package/dist/components/site.css +61 -39
- package/dist/components/site.js +1 -1
- package/dist/components/site.min.css +2 -2
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.js +1 -1
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +1 -1
- 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 +4 -4
- package/dist/components/step.min.css +2 -2
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +1 -1
- 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 +23 -5
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +3 -3
- package/dist/components/table.css +1168 -26
- package/dist/components/table.min.css +2 -2
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +39 -1
- package/dist/components/toast.js +56 -28
- package/dist/components/toast.min.css +2 -2
- package/dist/components/toast.min.js +3 -3
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +21 -16
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +3 -3
- package/dist/components/visibility.js +1 -1
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +21916 -16238
- package/dist/semantic.js +433 -246
- package/dist/semantic.min.css +3 -3
- package/dist/semantic.min.js +3 -3
- package/dist/themes/default/assets/fonts/brand-icons.eot +0 -0
- package/dist/themes/default/assets/fonts/brand-icons.svg +801 -654
- package/dist/themes/default/assets/fonts/brand-icons.ttf +0 -0
- package/dist/themes/default/assets/fonts/brand-icons.woff +0 -0
- package/dist/themes/default/assets/fonts/brand-icons.woff2 +0 -0
- package/dist/themes/default/assets/fonts/icons.eot +0 -0
- package/dist/themes/default/assets/fonts/icons.svg +1175 -1079
- package/dist/themes/default/assets/fonts/icons.ttf +0 -0
- package/dist/themes/default/assets/fonts/icons.woff +0 -0
- package/dist/themes/default/assets/fonts/icons.woff2 +0 -0
- package/dist/themes/default/assets/fonts/outline-icons.eot +0 -0
- package/dist/themes/default/assets/fonts/outline-icons.svg +93 -95
- package/dist/themes/default/assets/fonts/outline-icons.ttf +0 -0
- package/dist/themes/default/assets/fonts/outline-icons.woff +0 -0
- package/dist/themes/default/assets/fonts/outline-icons.woff2 +0 -0
- package/examples/assets/library/iframe-content.js +8 -8
- package/examples/assets/library/iframe.js +3 -3
- package/package.json +10 -9
- package/src/definitions/behaviors/api.js +33 -29
- package/src/definitions/behaviors/form.js +37 -28
- package/src/definitions/collections/form.less +204 -140
- package/src/definitions/collections/grid.less +716 -680
- package/src/definitions/collections/menu.less +173 -126
- package/src/definitions/collections/message.less +48 -46
- package/src/definitions/collections/table.less +849 -262
- package/src/definitions/elements/button.less +586 -449
- package/src/definitions/elements/container.less +145 -8
- package/src/definitions/elements/emoji.less +15 -9
- package/src/definitions/elements/flag.less +7 -17
- package/src/definitions/elements/header.less +44 -35
- package/src/definitions/elements/icon.less +38 -31
- package/src/definitions/elements/input.less +264 -22
- package/src/definitions/elements/label.less +92 -91
- package/src/definitions/elements/list.less +55 -45
- package/src/definitions/elements/loader.less +30 -29
- package/src/definitions/elements/segment.less +147 -28
- package/src/definitions/elements/step.less +52 -48
- package/src/definitions/elements/text.less +17 -15
- package/src/definitions/globals/site.less +23 -2
- package/src/definitions/modules/accordion.less +175 -24
- package/src/definitions/modules/calendar.js +9 -8
- package/src/definitions/modules/calendar.less +20 -0
- package/src/definitions/modules/checkbox.js +16 -10
- package/src/definitions/modules/checkbox.less +34 -178
- package/src/definitions/modules/dimmer.js +10 -4
- package/src/definitions/modules/dimmer.less +21 -8
- package/src/definitions/modules/dropdown.js +65 -38
- package/src/definitions/modules/dropdown.less +145 -94
- package/src/definitions/modules/modal.js +126 -48
- package/src/definitions/modules/modal.less +12 -0
- package/src/definitions/modules/nag.less +20 -19
- package/src/definitions/modules/popup.js +1 -1
- package/src/definitions/modules/progress.js +3 -0
- package/src/definitions/modules/progress.less +19 -18
- package/src/definitions/modules/rating.less +35 -34
- package/src/definitions/modules/search.js +1 -1
- package/src/definitions/modules/search.less +32 -16
- package/src/definitions/modules/shape.js +2 -2
- package/src/definitions/modules/sidebar.js +7 -5
- package/src/definitions/modules/sidebar.less +33 -19
- package/src/definitions/modules/slider.less +39 -38
- package/src/definitions/modules/tab.js +22 -4
- package/src/definitions/modules/toast.js +55 -27
- package/src/definitions/modules/toast.less +48 -16
- package/src/definitions/modules/transition.js +20 -15
- package/src/definitions/views/card.less +402 -361
- package/src/definitions/views/comment.less +92 -81
- package/src/definitions/views/feed.less +164 -144
- package/src/definitions/views/item.less +249 -196
- package/src/definitions/views/statistic.less +90 -88
- package/src/themes/bookish/elements/header.overrides +1 -1
- package/src/themes/chubby/elements/button.overrides +1 -1
- package/src/themes/chubby/elements/header.overrides +1 -1
- package/src/themes/default/assets/fonts/brand-icons.eot +0 -0
- package/src/themes/default/assets/fonts/brand-icons.svg +801 -654
- package/src/themes/default/assets/fonts/brand-icons.ttf +0 -0
- package/src/themes/default/assets/fonts/brand-icons.woff +0 -0
- package/src/themes/default/assets/fonts/brand-icons.woff2 +0 -0
- package/src/themes/default/assets/fonts/icons.eot +0 -0
- package/src/themes/default/assets/fonts/icons.svg +1175 -1079
- package/src/themes/default/assets/fonts/icons.ttf +0 -0
- package/src/themes/default/assets/fonts/icons.woff +0 -0
- package/src/themes/default/assets/fonts/icons.woff2 +0 -0
- package/src/themes/default/assets/fonts/outline-icons.eot +0 -0
- package/src/themes/default/assets/fonts/outline-icons.svg +93 -95
- package/src/themes/default/assets/fonts/outline-icons.ttf +0 -0
- package/src/themes/default/assets/fonts/outline-icons.woff +0 -0
- package/src/themes/default/assets/fonts/outline-icons.woff2 +0 -0
- package/src/themes/default/collections/form.variables +4 -0
- package/src/themes/default/collections/menu.variables +6 -0
- package/src/themes/default/collections/table.variables +52 -0
- package/src/themes/default/elements/button.variables +7 -1
- package/src/themes/default/elements/container.variables +12 -0
- package/src/themes/default/elements/emoji.overrides +1734 -1232
- package/src/themes/default/elements/flag.overrides +1641 -986
- package/src/themes/default/elements/flag.variables +7 -5
- package/src/themes/default/elements/icon.overrides +75 -48
- package/src/themes/default/elements/icon.variables +1 -0
- package/src/themes/default/elements/input.variables +15 -0
- package/src/themes/default/elements/segment.variables +8 -0
- package/src/themes/default/elements/step.overrides +1 -1
- package/src/themes/default/globals/site.variables +6 -0
- package/src/themes/default/globals/variation.variables +139 -6
- package/src/themes/default/modules/accordion.variables +49 -2
- package/src/themes/default/modules/calendar.variables +3 -0
- package/src/themes/default/modules/checkbox.variables +5 -5
- package/src/themes/default/modules/dimmer.variables +1 -1
- package/src/themes/default/modules/dropdown.variables +4 -10
- package/src/themes/default/modules/modal.variables +13 -0
- package/src/themes/default/modules/toast.variables +3 -0
- package/src/themes/famfamfam/elements/flag.overrides +1026 -0
- package/src/themes/famfamfam/elements/flag.variables +13 -0
- package/src/themes/instagram/views/card.overrides +1 -1
- package/src/themes/joypixels/elements/emoji.overrides +1759 -1257
- package/src/themes/joypixels/elements/emoji.variables +1 -1
- package/src/themes/material/collections/menu.overrides +1 -1
- package/src/themes/material/elements/button.overrides +1 -1
- package/src/themes/material/elements/header.overrides +1 -1
- package/src/themes/material/globals/site.variables +0 -1
- package/src/themes/material/modules/dropdown.overrides +1 -1
- package/src/themes/material/modules/modal.overrides +1 -1
- package/src/themes/rtl/globals/site.overrides +1 -1
- package/src/themes/twitter/elements/emoji.overrides +1734 -1232
- package/tasks/build/css.js +6 -1
- package/tasks/config/project/install.js +11 -5
- package/tasks/install.js +1 -0
- package/test/helpers/sinon.js +2 -2
@@ -66,7 +66,8 @@ $.fn.modal = function(parameters) {
|
|
66
66
|
|
67
67
|
$module = $(this),
|
68
68
|
$context = $(settings.context),
|
69
|
-
$
|
69
|
+
$closeIcon = $module.find(selector.closeIcon),
|
70
|
+
$inputs,
|
70
71
|
|
71
72
|
$allModals,
|
72
73
|
$otherModals,
|
@@ -92,6 +93,7 @@ $.fn.modal = function(parameters) {
|
|
92
93
|
module = {
|
93
94
|
|
94
95
|
initialize: function() {
|
96
|
+
module.create.id();
|
95
97
|
if(!$module.hasClass('modal')) {
|
96
98
|
module.create.modal();
|
97
99
|
if(!$.isFunction(settings.onHidden)) {
|
@@ -116,15 +118,17 @@ $.fn.modal = function(parameters) {
|
|
116
118
|
$actions.empty();
|
117
119
|
}
|
118
120
|
settings.actions.forEach(function (el) {
|
119
|
-
var icon = el[fields.icon] ? '<i class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
|
121
|
+
var icon = el[fields.icon] ? '<i '+(el[fields.text] ? 'aria-hidden="true"' : '')+' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
|
120
122
|
text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
|
121
123
|
cls = module.helpers.deQuote(el[fields.class] || ''),
|
122
124
|
click = el[fields.click] && $.isFunction(el[fields.click]) ? el[fields.click] : function () {};
|
123
125
|
$actions.append($('<button/>', {
|
124
126
|
html: icon + text,
|
127
|
+
'aria-label': $('<div>'+(el[fields.text] || el[fields.icon] || '')+'</div>').text(),
|
125
128
|
class: className.button + ' ' + cls,
|
126
129
|
click: function () {
|
127
|
-
|
130
|
+
var button = $(this);
|
131
|
+
if (button.is(selector.approve) || button.is(selector.deny) || click.call(element, $module) === false) {
|
128
132
|
return;
|
129
133
|
}
|
130
134
|
module.hide();
|
@@ -135,7 +139,6 @@ $.fn.modal = function(parameters) {
|
|
135
139
|
module.cache = {};
|
136
140
|
module.verbose('Initializing dimmer', $context);
|
137
141
|
|
138
|
-
module.create.id();
|
139
142
|
module.create.dimmer();
|
140
143
|
|
141
144
|
if ( settings.allowMultiple ) {
|
@@ -145,11 +148,9 @@ $.fn.modal = function(parameters) {
|
|
145
148
|
$module.addClass('top aligned');
|
146
149
|
}
|
147
150
|
module.refreshModals();
|
148
|
-
|
151
|
+
module.refreshInputs();
|
149
152
|
module.bind.events();
|
150
|
-
|
151
|
-
module.observeChanges();
|
152
|
-
}
|
153
|
+
module.observeChanges();
|
153
154
|
module.instantiate();
|
154
155
|
if(settings.autoShow){
|
155
156
|
module.show();
|
@@ -166,16 +167,20 @@ $.fn.modal = function(parameters) {
|
|
166
167
|
|
167
168
|
create: {
|
168
169
|
modal: function() {
|
169
|
-
$module = $('<div/>', {class: className.modal});
|
170
|
+
$module = $('<div/>', {class: className.modal, role: 'dialog', 'aria-modal': true});
|
170
171
|
if (settings.closeIcon) {
|
171
|
-
$
|
172
|
-
$module.append($
|
172
|
+
$closeIcon = $('<i/>', {class: className.close, role: 'button', tabindex: 0, 'aria-label': settings.text.close})
|
173
|
+
$module.append($closeIcon);
|
173
174
|
}
|
174
175
|
if (settings.title !== '') {
|
175
|
-
|
176
|
+
var titleId = '_' + module.get.id() + 'title';
|
177
|
+
$module.attr('aria-labelledby', titleId);
|
178
|
+
$('<div/>', {class: className.title, id: titleId}).appendTo($module);
|
176
179
|
}
|
177
180
|
if (settings.content !== '') {
|
178
|
-
|
181
|
+
var descId = '_' + module.get.id() + 'desc';
|
182
|
+
$module.attr('aria-describedby', descId);
|
183
|
+
$('<div/>', {class: className.content, id: descId}).appendTo($module);
|
179
184
|
}
|
180
185
|
if (module.has.configActions()) {
|
181
186
|
$('<div/>', {class: className.actions}).appendTo($module);
|
@@ -206,13 +211,13 @@ $.fn.modal = function(parameters) {
|
|
206
211
|
$dimmer = $dimmable.dimmer('get dimmer');
|
207
212
|
},
|
208
213
|
id: function() {
|
209
|
-
id = (Math.random().toString(16) + '000000000').
|
214
|
+
id = (Math.random().toString(16) + '000000000').slice(2, 10);
|
210
215
|
elementEventNamespace = '.' + id;
|
211
216
|
module.verbose('Creating unique id for element', id);
|
212
217
|
},
|
213
218
|
innerDimmer: function() {
|
214
|
-
if ( $module.find(selector.dimmer).length
|
215
|
-
$
|
219
|
+
if ( $module.find(selector.dimmer).length === 0 ) {
|
220
|
+
$('<div/>', {class: className.innerDimmer}).prependTo($module);
|
216
221
|
}
|
217
222
|
}
|
218
223
|
},
|
@@ -228,15 +233,21 @@ $.fn.modal = function(parameters) {
|
|
228
233
|
;
|
229
234
|
$window.off(elementEventNamespace);
|
230
235
|
$dimmer.off(elementEventNamespace);
|
231
|
-
$
|
236
|
+
$closeIcon.off(elementEventNamespace);
|
237
|
+
if($inputs) {
|
238
|
+
$inputs.off(elementEventNamespace);
|
239
|
+
}
|
232
240
|
$context.dimmer('destroy');
|
233
241
|
},
|
234
242
|
|
235
243
|
observeChanges: function() {
|
236
244
|
if('MutationObserver' in window) {
|
237
245
|
observer = new MutationObserver(function(mutations) {
|
238
|
-
|
239
|
-
|
246
|
+
if(settings.observeChanges) {
|
247
|
+
module.debug('DOM tree modified, refreshing');
|
248
|
+
module.refresh();
|
249
|
+
}
|
250
|
+
module.refreshInputs();
|
240
251
|
});
|
241
252
|
observer.observe(element, {
|
242
253
|
childList : true,
|
@@ -261,6 +272,23 @@ $.fn.modal = function(parameters) {
|
|
261
272
|
$allModals = $otherModals.add($module);
|
262
273
|
},
|
263
274
|
|
275
|
+
refreshInputs: function(){
|
276
|
+
if($inputs){
|
277
|
+
$inputs
|
278
|
+
.off('keydown' + elementEventNamespace)
|
279
|
+
;
|
280
|
+
}
|
281
|
+
$inputs = $module.find('[tabindex], :input').filter(':visible').filter(function() {
|
282
|
+
return $(this).closest('.disabled').length === 0;
|
283
|
+
});
|
284
|
+
$inputs.first()
|
285
|
+
.on('keydown' + elementEventNamespace, module.event.inputKeyDown.first)
|
286
|
+
;
|
287
|
+
$inputs.last()
|
288
|
+
.on('keydown' + elementEventNamespace, module.event.inputKeyDown.last)
|
289
|
+
;
|
290
|
+
},
|
291
|
+
|
264
292
|
attachEvents: function(selector, event) {
|
265
293
|
var
|
266
294
|
$toggle = $(selector)
|
@@ -289,6 +317,9 @@ $.fn.modal = function(parameters) {
|
|
289
317
|
.on('click' + eventNamespace, selector.approve, module.event.approve)
|
290
318
|
.on('click' + eventNamespace, selector.deny, module.event.deny)
|
291
319
|
;
|
320
|
+
$closeIcon
|
321
|
+
.on('keyup' + elementEventNamespace, module.event.closeKeyUp)
|
322
|
+
;
|
292
323
|
$window
|
293
324
|
.on('resize' + elementEventNamespace, module.event.resize)
|
294
325
|
;
|
@@ -307,7 +338,7 @@ $.fn.modal = function(parameters) {
|
|
307
338
|
|
308
339
|
get: {
|
309
340
|
id: function() {
|
310
|
-
return
|
341
|
+
return id;
|
311
342
|
},
|
312
343
|
element: function() {
|
313
344
|
return $module;
|
@@ -346,10 +377,38 @@ $.fn.modal = function(parameters) {
|
|
346
377
|
close: function() {
|
347
378
|
module.hide();
|
348
379
|
},
|
380
|
+
closeKeyUp: function(event){
|
381
|
+
var
|
382
|
+
keyCode = event.which
|
383
|
+
;
|
384
|
+
if ((keyCode === settings.keys.enter || keyCode === settings.keys.space) && $module.hasClass(className.front)) {
|
385
|
+
module.hide();
|
386
|
+
}
|
387
|
+
},
|
388
|
+
inputKeyDown: {
|
389
|
+
first: function(event) {
|
390
|
+
var
|
391
|
+
keyCode = event.which
|
392
|
+
;
|
393
|
+
if (keyCode === settings.keys.tab && event.shiftKey) {
|
394
|
+
$inputs.last().focus();
|
395
|
+
event.preventDefault();
|
396
|
+
}
|
397
|
+
},
|
398
|
+
last: function(event) {
|
399
|
+
var
|
400
|
+
keyCode = event.which
|
401
|
+
;
|
402
|
+
if (keyCode === settings.keys.tab && !event.shiftKey) {
|
403
|
+
$inputs.first().focus();
|
404
|
+
event.preventDefault();
|
405
|
+
}
|
406
|
+
}
|
407
|
+
},
|
349
408
|
mousedown: function(event) {
|
350
409
|
var
|
351
410
|
$target = $(event.target),
|
352
|
-
isRtl = module.is.rtl()
|
411
|
+
isRtl = module.is.rtl()
|
353
412
|
;
|
354
413
|
initialMouseDownInModal = ($target.closest(selector.modal).length > 0);
|
355
414
|
if(initialMouseDownInModal) {
|
@@ -397,10 +456,9 @@ $.fn.modal = function(parameters) {
|
|
397
456
|
},
|
398
457
|
keyboard: function(event) {
|
399
458
|
var
|
400
|
-
keyCode = event.which
|
401
|
-
escapeKey = 27
|
459
|
+
keyCode = event.which
|
402
460
|
;
|
403
|
-
if(keyCode
|
461
|
+
if(keyCode === settings.keys.escape) {
|
404
462
|
if(settings.closable) {
|
405
463
|
module.debug('Escape key pressed hiding modal');
|
406
464
|
if ( $module.hasClass(className.front) ) {
|
@@ -456,6 +514,10 @@ $.fn.modal = function(parameters) {
|
|
456
514
|
: function(){}
|
457
515
|
;
|
458
516
|
if( module.is.animating() || !module.is.active() ) {
|
517
|
+
if(settings.onShow.call(element) === false) {
|
518
|
+
module.verbose('Show callback returned false cancelling show');
|
519
|
+
return;
|
520
|
+
}
|
459
521
|
module.showDimmer();
|
460
522
|
module.cacheSizes();
|
461
523
|
module.set.bodyMargin();
|
@@ -485,7 +547,6 @@ $.fn.modal = function(parameters) {
|
|
485
547
|
$module.detach().appendTo($dimmer);
|
486
548
|
}
|
487
549
|
}
|
488
|
-
settings.onShow.call(element);
|
489
550
|
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
|
490
551
|
module.debug('Showing modal with css animations');
|
491
552
|
$module
|
@@ -528,7 +589,6 @@ $.fn.modal = function(parameters) {
|
|
528
589
|
? callback
|
529
590
|
: function(){}
|
530
591
|
;
|
531
|
-
module.debug('Hiding modal');
|
532
592
|
if(settings.onHide.call(element, $(this)) === false) {
|
533
593
|
module.verbose('Hide callback returned false cancelling hide');
|
534
594
|
ignoreRepeatedEvents = false;
|
@@ -536,6 +596,7 @@ $.fn.modal = function(parameters) {
|
|
536
596
|
}
|
537
597
|
|
538
598
|
if( module.is.animating() || module.is.active() ) {
|
599
|
+
module.debug('Hiding modal');
|
539
600
|
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
|
540
601
|
module.remove.active();
|
541
602
|
$module
|
@@ -715,7 +776,7 @@ $.fn.modal = function(parameters) {
|
|
715
776
|
$module
|
716
777
|
.off('mousedown' + elementEventNamespace)
|
717
778
|
;
|
718
|
-
}
|
779
|
+
}
|
719
780
|
$dimmer
|
720
781
|
.off('mousedown' + elementEventNamespace)
|
721
782
|
;
|
@@ -900,13 +961,10 @@ $.fn.modal = function(parameters) {
|
|
900
961
|
set: {
|
901
962
|
autofocus: function() {
|
902
963
|
var
|
903
|
-
$inputs = $module.find('[tabindex], :input').filter(':visible').filter(function() {
|
904
|
-
return $(this).closest('.disabled').length === 0;
|
905
|
-
}),
|
906
964
|
$autofocus = $inputs.filter('[autofocus]'),
|
907
965
|
$input = ($autofocus.length > 0)
|
908
966
|
? $autofocus.first()
|
909
|
-
: $inputs.first()
|
967
|
+
: ($inputs.length > 1 ? $inputs.filter(':not(i.close)') : $inputs).first()
|
910
968
|
;
|
911
969
|
if($input.length > 0) {
|
912
970
|
$input.focus();
|
@@ -988,7 +1046,7 @@ $.fn.modal = function(parameters) {
|
|
988
1046
|
? $(document).scrollTop() + settings.padding
|
989
1047
|
: $(document).scrollTop() + (module.cache.contextHeight - module.cache.height - settings.padding),
|
990
1048
|
marginLeft: -(module.cache.width / 2)
|
991
|
-
})
|
1049
|
+
})
|
992
1050
|
;
|
993
1051
|
} else {
|
994
1052
|
$module
|
@@ -997,7 +1055,7 @@ $.fn.modal = function(parameters) {
|
|
997
1055
|
? -(module.cache.height / 2)
|
998
1056
|
: settings.padding / 2,
|
999
1057
|
marginLeft: -(module.cache.width / 2)
|
1000
|
-
})
|
1058
|
+
})
|
1001
1059
|
;
|
1002
1060
|
}
|
1003
1061
|
module.verbose('Setting modal offset for legacy mode');
|
@@ -1323,11 +1381,19 @@ $.fn.modal.settings = {
|
|
1323
1381
|
// called after deny selector match
|
1324
1382
|
onDeny : function(){ return true; },
|
1325
1383
|
|
1384
|
+
keys : {
|
1385
|
+
space : 32,
|
1386
|
+
enter : 13,
|
1387
|
+
escape : 27,
|
1388
|
+
tab : 9,
|
1389
|
+
},
|
1390
|
+
|
1326
1391
|
selector : {
|
1327
1392
|
title : '> .header',
|
1328
1393
|
content : '> .content',
|
1329
1394
|
actions : '> .actions',
|
1330
1395
|
close : '> .close',
|
1396
|
+
closeIcon: '> .close',
|
1331
1397
|
approve : '.actions .positive, .actions .approve, .actions .ok',
|
1332
1398
|
deny : '.actions .negative, .actions .deny, .actions .cancel',
|
1333
1399
|
modal : '.ui.modal',
|
@@ -1359,11 +1425,13 @@ $.fn.modal.settings = {
|
|
1359
1425
|
template : 'ui tiny modal',
|
1360
1426
|
ok : 'positive',
|
1361
1427
|
cancel : 'negative',
|
1362
|
-
prompt : 'ui fluid input'
|
1428
|
+
prompt : 'ui fluid input',
|
1429
|
+
innerDimmer: 'ui inverted dimmer'
|
1363
1430
|
},
|
1364
1431
|
text: {
|
1365
1432
|
ok : 'Ok',
|
1366
|
-
cancel: 'Cancel'
|
1433
|
+
cancel: 'Cancel',
|
1434
|
+
close : 'Close'
|
1367
1435
|
}
|
1368
1436
|
};
|
1369
1437
|
|
@@ -1389,33 +1457,39 @@ $.fn.modal.settings.templates = {
|
|
1389
1457
|
},
|
1390
1458
|
alert: function () {
|
1391
1459
|
var settings = this.get.settings(),
|
1392
|
-
args = settings.templates.getArguments(arguments)
|
1460
|
+
args = settings.templates.getArguments(arguments),
|
1461
|
+
approveFn = args.handler
|
1393
1462
|
;
|
1394
1463
|
return {
|
1395
1464
|
title : args.title,
|
1396
1465
|
content: args.content,
|
1466
|
+
onApprove: approveFn,
|
1397
1467
|
actions: [{
|
1398
1468
|
text : settings.text.ok,
|
1399
1469
|
class: settings.className.ok,
|
1400
|
-
click:
|
1470
|
+
click: approveFn
|
1401
1471
|
}]
|
1402
1472
|
}
|
1403
1473
|
},
|
1404
1474
|
confirm: function () {
|
1405
1475
|
var settings = this.get.settings(),
|
1406
|
-
args = settings.templates.getArguments(arguments)
|
1476
|
+
args = settings.templates.getArguments(arguments),
|
1477
|
+
approveFn = function(){args.handler(true)},
|
1478
|
+
denyFn = function(){args.handler(false)}
|
1407
1479
|
;
|
1408
1480
|
return {
|
1409
1481
|
title : args.title,
|
1410
1482
|
content: args.content,
|
1483
|
+
onApprove: approveFn,
|
1484
|
+
onDeny: denyFn,
|
1411
1485
|
actions: [{
|
1412
1486
|
text : settings.text.ok,
|
1413
1487
|
class: settings.className.ok,
|
1414
|
-
click:
|
1488
|
+
click: approveFn
|
1415
1489
|
},{
|
1416
1490
|
text: settings.text.cancel,
|
1417
1491
|
class: settings.className.cancel,
|
1418
|
-
click:
|
1492
|
+
click: denyFn
|
1419
1493
|
}]
|
1420
1494
|
}
|
1421
1495
|
},
|
@@ -1423,7 +1497,14 @@ $.fn.modal.settings.templates = {
|
|
1423
1497
|
var $this = this,
|
1424
1498
|
settings = this.get.settings(),
|
1425
1499
|
args = settings.templates.getArguments(arguments),
|
1426
|
-
input = $($.parseHTML(args.content)).filter('.ui.input')
|
1500
|
+
input = $($.parseHTML(args.content)).filter('.ui.input'),
|
1501
|
+
approveFn = function(){
|
1502
|
+
var settings = $this.get.settings(),
|
1503
|
+
inputField = $this.get.element().find(settings.selector.prompt)[0]
|
1504
|
+
;
|
1505
|
+
args.handler($(inputField).val());
|
1506
|
+
},
|
1507
|
+
denyFn = function(){args.handler(null)}
|
1427
1508
|
;
|
1428
1509
|
if (input.length === 0) {
|
1429
1510
|
args.content += '<p><div class="'+settings.className.prompt+'"><input placeholder="'+this.helpers.deQuote(args.placeholder || '')+'" type="text" value="'+this.helpers.deQuote(args.defaultValue || '')+'"></div></p>';
|
@@ -1431,19 +1512,16 @@ $.fn.modal.settings.templates = {
|
|
1431
1512
|
return {
|
1432
1513
|
title : args.title,
|
1433
1514
|
content: args.content,
|
1515
|
+
onApprove: approveFn,
|
1516
|
+
onDeny: denyFn,
|
1434
1517
|
actions: [{
|
1435
1518
|
text: settings.text.ok,
|
1436
1519
|
class: settings.className.ok,
|
1437
|
-
click:
|
1438
|
-
var settings = $this.get.settings(),
|
1439
|
-
inputField = $this.get.element().find(settings.selector.prompt)[0]
|
1440
|
-
;
|
1441
|
-
args.handler($(inputField).val());
|
1442
|
-
}
|
1520
|
+
click: approveFn
|
1443
1521
|
},{
|
1444
1522
|
text: settings.text.cancel,
|
1445
1523
|
class: settings.className.cancel,
|
1446
|
-
click:
|
1524
|
+
click: denyFn
|
1447
1525
|
}]
|
1448
1526
|
}
|
1449
1527
|
}
|
@@ -80,8 +80,10 @@
|
|
80
80
|
height: @closeHitbox;
|
81
81
|
padding: @closePadding;
|
82
82
|
}
|
83
|
+
.ui.modal > .close:focus,
|
83
84
|
.ui.modal > .close:hover {
|
84
85
|
opacity: 1;
|
86
|
+
outline: none;
|
85
87
|
}
|
86
88
|
|
87
89
|
/*--------------
|
@@ -212,6 +214,16 @@
|
|
212
214
|
.ui.modal:not(.fullscreen) {
|
213
215
|
width: @computerWidth;
|
214
216
|
margin: @computerMargin;
|
217
|
+
& > .active.dimmer + .close:not(.inside) {
|
218
|
+
pointer-events: none;
|
219
|
+
opacity: @closeOpacityDimmed;
|
220
|
+
}
|
221
|
+
}
|
222
|
+
.ui.dimmer > .ui.modal:not(.fullscreen) > .close:not(.inside){
|
223
|
+
text-shadow: @closeShadow;
|
224
|
+
}
|
225
|
+
.ui.inverted.dimmer > .ui.modal:not(.fullscreen) > .close:not(.inside){
|
226
|
+
text-shadow: @invertedCloseShadow;
|
215
227
|
}
|
216
228
|
}
|
217
229
|
@media only screen and (min-width : @largeMonitorBreakpoint) {
|
@@ -169,28 +169,29 @@ a.ui.nag {
|
|
169
169
|
/*--------------
|
170
170
|
Colors
|
171
171
|
-------------- */
|
172
|
-
|
173
|
-
each(@
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
172
|
+
& when not (@variationNagColors = false) {
|
173
|
+
each(@variationNagColors, {
|
174
|
+
@color: @value;
|
175
|
+
@c: @colors[@@color][color];
|
176
|
+
@l: @colors[@@color][light];
|
177
|
+
@isVeryDark: @colors[@@color][isVeryDark];
|
178
|
+
|
179
|
+
.ui.@{color}.nag {
|
180
|
+
background-color: @c;
|
181
|
+
& when (@isVeryDark) {
|
182
|
+
color: @invertedTextColor;
|
183
|
+
}
|
183
184
|
}
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
185
|
+
& when (@variationNagInverted) {
|
186
|
+
.ui.inverted.@{color}.nag {
|
187
|
+
background-color: @l;
|
188
|
+
& .title when (@isVeryDark) {
|
189
|
+
color: @titleColor;
|
190
|
+
}
|
190
191
|
}
|
191
192
|
}
|
192
|
-
}
|
193
|
-
}
|
193
|
+
})
|
194
|
+
}
|
194
195
|
|
195
196
|
& when (@variationNagGroups) {
|
196
197
|
/*******************************
|
@@ -309,7 +309,7 @@ $.fn.popup = function(parameters) {
|
|
309
309
|
},
|
310
310
|
|
311
311
|
createID: function() {
|
312
|
-
id = (Math.random().toString(16) + '000000000').
|
312
|
+
id = (Math.random().toString(16) + '000000000').slice(2, 10);
|
313
313
|
elementNamespace = '.' + id;
|
314
314
|
module.verbose('Creating unique id for element', id);
|
315
315
|
},
|
@@ -446,25 +446,26 @@
|
|
446
446
|
/*--------------
|
447
447
|
Colors
|
448
448
|
---------------*/
|
449
|
-
|
450
|
-
each(@
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
}
|
460
|
-
& when (@variationProgressInverted) {
|
461
|
-
.ui.inverted.indeterminate.@{color}.progress .bar::before,
|
462
|
-
.ui.@{color}.inverted.progress .bar,
|
463
|
-
.ui.inverted.progress .@{color}.bar {
|
464
|
-
background-color: @l;
|
449
|
+
& when not (@variationProgressColors = false) {
|
450
|
+
each(@variationProgressColors, {
|
451
|
+
@color: @value;
|
452
|
+
@c: @colors[@@color][color];
|
453
|
+
@l: @colors[@@color][light];
|
454
|
+
|
455
|
+
.ui.indeterminate.@{color}.progress .bar::before,
|
456
|
+
.ui.@{color}.progress .bar,
|
457
|
+
.ui.progress .@{color}.bar {
|
458
|
+
background-color: @c;
|
465
459
|
}
|
466
|
-
|
467
|
-
}
|
460
|
+
& when (@variationProgressInverted) {
|
461
|
+
.ui.inverted.indeterminate.@{color}.progress .bar::before,
|
462
|
+
.ui.@{color}.inverted.progress .bar,
|
463
|
+
.ui.inverted.progress .@{color}.bar {
|
464
|
+
background-color: @l;
|
465
|
+
}
|
466
|
+
}
|
467
|
+
})
|
468
|
+
}
|
468
469
|
|
469
470
|
/*--------------
|
470
471
|
Sizes
|
@@ -95,41 +95,42 @@
|
|
95
95
|
/*--------------
|
96
96
|
Colors
|
97
97
|
-------------- */
|
98
|
-
|
99
|
-
each(@
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
}
|
113
|
-
.ui.@{color}.rating .icon.selected,
|
114
|
-
.ui.@{color}.rating .icon.selected.active,
|
115
|
-
.ui.@{color}.rating .icon.selected.partial.active {
|
116
|
-
background: inherit;
|
117
|
-
color: @lh;
|
118
|
-
text-shadow: 0px -@shadowWidth 0px @h,
|
119
|
-
-@shadowWidth 0px 0px @h,
|
120
|
-
0px @shadowWidth 0px @h,
|
121
|
-
@shadowWidth 0px 0px @h;
|
122
|
-
|
123
|
-
-webkit-text-stroke: unset;
|
124
|
-
background-clip: unset;
|
125
|
-
}
|
126
|
-
& when (@variationRatingPartial) {
|
127
|
-
.ui.@{color}.rating .icon.partial.active {
|
128
|
-
background: linear-gradient(to right, @l 0% var(--full), @inactiveColor var(--full) 100%);
|
129
|
-
-webkit-text-stroke: @c 0.78px;
|
98
|
+
& when not (@variationRatingColors = false) {
|
99
|
+
each(@variationRatingColors, {
|
100
|
+
@color: @value;
|
101
|
+
@c: @colors[@@color][color];
|
102
|
+
@l: @colors[@@color][light];
|
103
|
+
@h: @colors[@@color][hover];
|
104
|
+
@lh: @colors[@@color][lightHover];
|
105
|
+
|
106
|
+
.ui.@{color}.rating .active.icon {
|
107
|
+
color: @l;
|
108
|
+
text-shadow: 0px -@shadowWidth 0px @c,
|
109
|
+
-@shadowWidth 0px 0px @c,
|
110
|
+
0px @shadowWidth 0px @c,
|
111
|
+
@shadowWidth 0px 0px @c;
|
130
112
|
}
|
131
|
-
|
132
|
-
}
|
113
|
+
.ui.@{color}.rating .icon.selected,
|
114
|
+
.ui.@{color}.rating .icon.selected.active,
|
115
|
+
.ui.@{color}.rating .icon.selected.partial.active {
|
116
|
+
background: inherit;
|
117
|
+
color: @lh;
|
118
|
+
text-shadow: 0px -@shadowWidth 0px @h,
|
119
|
+
-@shadowWidth 0px 0px @h,
|
120
|
+
0px @shadowWidth 0px @h,
|
121
|
+
@shadowWidth 0px 0px @h;
|
122
|
+
|
123
|
+
-webkit-text-stroke: unset;
|
124
|
+
background-clip: unset;
|
125
|
+
}
|
126
|
+
& when (@variationRatingPartial) {
|
127
|
+
.ui.@{color}.rating .icon.partial.active {
|
128
|
+
background: linear-gradient(to right, @l 0% var(--full), @inactiveColor var(--full) 100%);
|
129
|
+
-webkit-text-stroke: @c 0.78px;
|
130
|
+
}
|
131
|
+
}
|
132
|
+
})
|
133
|
+
}
|
133
134
|
|
134
135
|
|
135
136
|
/*******************************
|
@@ -403,7 +403,7 @@ $.fn.search = function(parameters) {
|
|
403
403
|
return $results.hasClass(className.animating);
|
404
404
|
},
|
405
405
|
chrome: function() {
|
406
|
-
return !!window.chrome &&
|
406
|
+
return !!window.chrome && !window.StyleMedia;
|
407
407
|
},
|
408
408
|
hidden: function() {
|
409
409
|
return $results.hasClass(className.hidden);
|