fomantic-ui 2.9.0-beta.9 → 2.9.0-beta.90
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 +188 -3
- package/CONTRIBUTORS.md +71 -37
- package/README.md +1 -1
- package/dist/components/accordion.css +50 -6
- package/dist/components/accordion.js +1 -1
- package/dist/components/accordion.min.css +2 -2
- package/dist/components/accordion.min.js +1 -1
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +25 -23
- 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 +81 -81
- package/dist/components/button.min.css +2 -2
- package/dist/components/calendar.css +1 -1
- package/dist/components/calendar.js +106 -10
- package/dist/components/calendar.min.css +1 -1
- package/dist/components/calendar.min.js +2 -2
- 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 +2 -2
- package/dist/components/comment.css +11 -11
- 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 +28 -14
- package/dist/components/dimmer.js +1 -1
- package/dist/components/dimmer.min.css +2 -2
- package/dist/components/dimmer.min.js +1 -1
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +28 -5
- package/dist/components/dropdown.js +14 -18
- package/dist/components/dropdown.min.css +2 -2
- package/dist/components/dropdown.min.js +2 -2
- 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 +1 -1
- package/dist/components/emoji.css +2 -2
- package/dist/components/feed.css +28 -28
- package/dist/components/feed.min.css +2 -2
- package/dist/components/flag.css +731 -625
- package/dist/components/flag.min.css +2 -2
- package/dist/components/form.css +103 -54
- package/dist/components/form.js +24 -22
- package/dist/components/form.min.css +2 -2
- package/dist/components/form.min.js +2 -2
- package/dist/components/grid.css +11 -8
- package/dist/components/grid.min.css +2 -2
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +6 -1
- 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 +17 -2
- 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 +3 -1
- package/dist/components/modal.js +94 -30
- package/dist/components/modal.min.css +2 -2
- package/dist/components/modal.min.js +2 -2
- 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 +1 -1
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +5 -3
- package/dist/components/popup.js +1 -1
- package/dist/components/popup.min.css +2 -2
- package/dist/components/popup.min.js +1 -1
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +1 -1
- package/dist/components/rail.css +1 -1
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +7 -46
- package/dist/components/rating.js +1 -1
- package/dist/components/rating.min.css +2 -2
- package/dist/components/rating.min.js +1 -1
- 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 +1 -1
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +1 -1
- package/dist/components/segment.css +12 -6
- package/dist/components/segment.min.css +2 -2
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +1 -1
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +1 -1
- package/dist/components/sidebar.css +4 -2
- package/dist/components/sidebar.js +1 -1
- package/dist/components/sidebar.min.css +2 -2
- package/dist/components/sidebar.min.js +1 -1
- 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 +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/slider.min.js +1 -1
- package/dist/components/state.js +1 -1
- package/dist/components/state.min.js +1 -1
- 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 +1 -1
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +1 -1
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +1 -1
- package/dist/components/table.css +5 -3
- 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 +7 -1
- package/dist/components/toast.js +5 -4
- package/dist/components/toast.min.css +2 -2
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +1 -1
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +1 -1
- package/dist/components/visibility.js +1 -1
- package/dist/components/visibility.min.js +1 -1
- package/dist/semantic.css +1375 -1030
- package/dist/semantic.js +303 -136
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/examples/assets/library/iframe-content.js +5 -5
- package/package.json +2 -2
- package/src/definitions/behaviors/api.js +24 -22
- package/src/definitions/behaviors/form.js +23 -21
- package/src/definitions/collections/form.less +190 -139
- 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 +255 -242
- package/src/definitions/elements/button.less +360 -347
- package/src/definitions/elements/container.less +16 -8
- package/src/definitions/elements/emoji.less +15 -9
- package/src/definitions/elements/flag.less +7 -17
- package/src/definitions/elements/header.less +42 -35
- package/src/definitions/elements/icon.less +38 -31
- package/src/definitions/elements/input.less +23 -7
- 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 +30 -22
- 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 +55 -5
- package/src/definitions/modules/calendar.js +105 -9
- package/src/definitions/modules/checkbox.js +16 -10
- package/src/definitions/modules/checkbox.less +34 -178
- package/src/definitions/modules/dimmer.less +21 -8
- package/src/definitions/modules/dropdown.js +13 -17
- package/src/definitions/modules/dropdown.less +99 -67
- package/src/definitions/modules/modal.js +93 -29
- package/src/definitions/modules/modal.less +2 -0
- package/src/definitions/modules/nag.less +20 -19
- package/src/definitions/modules/popup.less +5 -1
- package/src/definitions/modules/progress.less +19 -18
- package/src/definitions/modules/rating.less +49 -42
- package/src/definitions/modules/search.less +32 -16
- package/src/definitions/modules/sidebar.less +33 -19
- package/src/definitions/modules/slider.less +39 -38
- package/src/definitions/modules/toast.js +4 -3
- package/src/definitions/modules/toast.less +22 -16
- 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/default/collections/menu.variables +6 -0
- package/src/themes/default/elements/button.variables +2 -1
- package/src/themes/default/elements/flag.overrides +1635 -986
- package/src/themes/default/elements/flag.variables +7 -5
- package/src/themes/default/elements/icon.overrides +35 -28
- package/src/themes/default/elements/icon.variables +1 -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 +104 -6
- package/src/themes/default/modules/accordion.variables +15 -0
- package/src/themes/default/modules/dimmer.variables +1 -1
- package/src/themes/default/modules/dropdown.variables +1 -1
- package/src/themes/famfamfam/elements/flag.overrides +1026 -0
- package/src/themes/famfamfam/elements/flag.variables +13 -0
- package/tasks/build/css.js +6 -1
- package/test/helpers/sinon.js +1 -1
@@ -367,9 +367,15 @@
|
|
367
367
|
.ui.dropdown.icon.button > .dropdown.icon {
|
368
368
|
margin: 0;
|
369
369
|
}
|
370
|
-
.ui.button
|
370
|
+
.ui.dropdown.button .menu {
|
371
371
|
min-width: 100%;
|
372
372
|
}
|
373
|
+
.ui.dropdown.button:not(.pointing):not(.floating).active {
|
374
|
+
border-radius: @borderRadius @borderRadius 0 0;
|
375
|
+
}
|
376
|
+
.ui.dropdown.button:not(.pointing):not(.floating) > .menu {
|
377
|
+
border-radius: 0 0 @borderRadius @borderRadius;
|
378
|
+
}
|
373
379
|
}
|
374
380
|
|
375
381
|
|
@@ -1073,12 +1079,12 @@ select.ui.dropdown {
|
|
1073
1079
|
display: none !important;
|
1074
1080
|
}
|
1075
1081
|
|
1076
|
-
& when (@variationDropdownStates) {
|
1082
|
+
& when not (@variationDropdownStates = false) {
|
1077
1083
|
/*--------------------
|
1078
1084
|
States
|
1079
1085
|
----------------------*/
|
1080
|
-
each(@
|
1081
|
-
@state:
|
1086
|
+
each(@variationDropdownStates, {
|
1087
|
+
@state: @value;
|
1082
1088
|
@c: @formStates[@@state][dropdownLabelColor];
|
1083
1089
|
@bdc: @formStates[@@state][borderColor];
|
1084
1090
|
|
@@ -1228,7 +1234,6 @@ select.ui.dropdown {
|
|
1228
1234
|
top: auto;
|
1229
1235
|
bottom: 100%;
|
1230
1236
|
box-shadow: @upwardMenuBoxShadow;
|
1231
|
-
border-radius: @upwardMenuBorderRadius;
|
1232
1237
|
}
|
1233
1238
|
|
1234
1239
|
/* Upward Sub Menu */
|
@@ -1237,42 +1242,54 @@ select.ui.dropdown {
|
|
1237
1242
|
bottom: 0 !important;
|
1238
1243
|
}
|
1239
1244
|
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
border-radius: @borderRadius @borderRadius 0 0;
|
1245
|
+
& when (@variationDropdownSimple) {
|
1246
|
+
/* Active Upward */
|
1247
|
+
.ui.simple.upward.active.dropdown,
|
1248
|
+
.ui.simple.upward.dropdown:hover {
|
1249
|
+
border-radius: @borderRadius @borderRadius 0 0 !important;
|
1250
|
+
}
|
1247
1251
|
}
|
1248
1252
|
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1255
|
-
|
1256
|
-
|
1253
|
+
& when (@variationDropdownButton) {
|
1254
|
+
/* Button */
|
1255
|
+
.ui.upward.dropdown.button:not(.pointing):not(.floating).active {
|
1256
|
+
border-radius: 0 0 @borderRadius @borderRadius;
|
1257
|
+
}
|
1258
|
+
.ui.upward.dropdown.button:not(.pointing):not(.floating) > .menu {
|
1259
|
+
border-radius: @borderRadius @borderRadius 0 0;
|
1260
|
+
}
|
1257
1261
|
}
|
1258
1262
|
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1263
|
+
& when (@variationDropdownSelection) {
|
1264
|
+
/* Selection */
|
1265
|
+
.ui.upward.selection.dropdown .menu {
|
1266
|
+
border-top-width: @menuBorderWidth !important;
|
1267
|
+
border-bottom-width: 0 !important;
|
1268
|
+
box-shadow: @upwardSelectionMenuBoxShadow;
|
1269
|
+
border-radius: @upwardSelectionMenuBorderRadius;
|
1270
|
+
}
|
1271
|
+
.ui.upward.selection.dropdown:hover {
|
1272
|
+
box-shadow: @upwardSelectionHoverBoxShadow;
|
1273
|
+
}
|
1263
1274
|
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
}
|
1275
|
+
/* Active Upward */
|
1276
|
+
.ui.active.upward.selection.dropdown {
|
1277
|
+
border-radius: @upwardSelectionVisibleBorderRadius !important;
|
1278
|
+
}
|
1269
1279
|
|
1270
|
-
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1280
|
+
/* Visible Upward */
|
1281
|
+
.ui.upward.selection.dropdown.visible {
|
1282
|
+
box-shadow: @upwardSelectionVisibleBoxShadow;
|
1283
|
+
border-radius: @upwardSelectionVisibleBorderRadius !important;
|
1284
|
+
}
|
1285
|
+
|
1286
|
+
/* Visible Hover Upward */
|
1287
|
+
.ui.upward.active.selection.dropdown:hover {
|
1288
|
+
box-shadow: @upwardSelectionActiveHoverBoxShadow;
|
1289
|
+
}
|
1290
|
+
.ui.upward.active.selection.dropdown:hover .menu {
|
1291
|
+
box-shadow: @upwardSelectionActiveHoverMenuBoxShadow;
|
1292
|
+
}
|
1276
1293
|
}
|
1277
1294
|
}
|
1278
1295
|
|
@@ -1378,23 +1395,25 @@ select.ui.dropdown {
|
|
1378
1395
|
}
|
1379
1396
|
}
|
1380
1397
|
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
+
& when (@variationDropdownColumnar) {
|
1399
|
+
/*--------------
|
1400
|
+
Columnar
|
1401
|
+
---------------*/
|
1402
|
+
.ui.column.dropdown > .menu {
|
1403
|
+
flex-wrap: wrap;
|
1404
|
+
}
|
1405
|
+
.ui.dropdown[class*="two column"] > .menu > .item {
|
1406
|
+
width: 50%;
|
1407
|
+
}
|
1408
|
+
.ui.dropdown[class*="three column"] > .menu > .item {
|
1409
|
+
width: 33%;
|
1410
|
+
}
|
1411
|
+
.ui.dropdown[class*="four column"] > .menu > .item {
|
1412
|
+
width: 25%;
|
1413
|
+
}
|
1414
|
+
.ui.dropdown[class*="five column"] > .menu > .item {
|
1415
|
+
width: 20%;
|
1416
|
+
}
|
1398
1417
|
}
|
1399
1418
|
|
1400
1419
|
& when (@variationDropdownSimple) {
|
@@ -1895,21 +1914,34 @@ select.ui.dropdown {
|
|
1895
1914
|
}
|
1896
1915
|
|
1897
1916
|
/* Scrollbars */
|
1898
|
-
|
1899
|
-
|
1900
|
-
|
1901
|
-
|
1902
|
-
|
1903
|
-
|
1904
|
-
|
1905
|
-
|
1906
|
-
|
1907
|
-
|
1908
|
-
|
1909
|
-
|
1910
|
-
|
1911
|
-
|
1912
|
-
|
1917
|
+
& when (@useCustomScrollbars) {
|
1918
|
+
.ui.dropdown .inverted.menu::-webkit-scrollbar-track,
|
1919
|
+
.ui.inverted.dropdown .menu::-webkit-scrollbar-track {
|
1920
|
+
background: @trackInvertedBackground;
|
1921
|
+
}
|
1922
|
+
.ui.dropdown .inverted.menu::-webkit-scrollbar-thumb,
|
1923
|
+
.ui.inverted.dropdown .menu::-webkit-scrollbar-thumb {
|
1924
|
+
background: @thumbInvertedBackground;
|
1925
|
+
}
|
1926
|
+
.ui.dropdown .inverted.menu::-webkit-scrollbar-thumb:window-inactive,
|
1927
|
+
.ui.inverted.dropdown .menu::-webkit-scrollbar-thumb:window-inactive {
|
1928
|
+
background: @thumbInvertedInactiveBackground;
|
1929
|
+
}
|
1930
|
+
.ui.dropdown .inverted.menu::-webkit-scrollbar-thumb:hover,
|
1931
|
+
.ui.inverted.dropdown .menu::-webkit-scrollbar-thumb:hover {
|
1932
|
+
background: @thumbInvertedHoverBackground;
|
1933
|
+
}
|
1934
|
+
.ui.dropdown .inverted.menu,
|
1935
|
+
.ui.inverted.dropdown .menu {
|
1936
|
+
/* IE11 */
|
1937
|
+
scrollbar-face-color: @thumbInvertedBackgroundHex;
|
1938
|
+
scrollbar-shadow-color: @thumbInvertedBackgroundHex;
|
1939
|
+
scrollbar-track-color: @trackInvertedBackgroundHex;
|
1940
|
+
scrollbar-arrow-color: @trackInvertedBackgroundHex;
|
1941
|
+
|
1942
|
+
/* firefox : first color thumb, second track */
|
1943
|
+
scrollbar-color: @thumbInvertedBackground @trackInvertedBackground;
|
1944
|
+
}
|
1913
1945
|
}
|
1914
1946
|
& when (@variationDropdownPointing) {
|
1915
1947
|
.ui.pointing.dropdown > .inverted.menu:after,
|
@@ -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);
|
@@ -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) ) {
|
@@ -715,7 +773,7 @@ $.fn.modal = function(parameters) {
|
|
715
773
|
$module
|
716
774
|
.off('mousedown' + elementEventNamespace)
|
717
775
|
;
|
718
|
-
}
|
776
|
+
}
|
719
777
|
$dimmer
|
720
778
|
.off('mousedown' + elementEventNamespace)
|
721
779
|
;
|
@@ -900,13 +958,10 @@ $.fn.modal = function(parameters) {
|
|
900
958
|
set: {
|
901
959
|
autofocus: function() {
|
902
960
|
var
|
903
|
-
$inputs = $module.find('[tabindex], :input').filter(':visible').filter(function() {
|
904
|
-
return $(this).closest('.disabled').length === 0;
|
905
|
-
}),
|
906
961
|
$autofocus = $inputs.filter('[autofocus]'),
|
907
962
|
$input = ($autofocus.length > 0)
|
908
963
|
? $autofocus.first()
|
909
|
-
: $inputs.first()
|
964
|
+
: ($inputs.length > 1 ? $inputs.filter(':not(i.close)') : $inputs).first()
|
910
965
|
;
|
911
966
|
if($input.length > 0) {
|
912
967
|
$input.focus();
|
@@ -988,7 +1043,7 @@ $.fn.modal = function(parameters) {
|
|
988
1043
|
? $(document).scrollTop() + settings.padding
|
989
1044
|
: $(document).scrollTop() + (module.cache.contextHeight - module.cache.height - settings.padding),
|
990
1045
|
marginLeft: -(module.cache.width / 2)
|
991
|
-
})
|
1046
|
+
})
|
992
1047
|
;
|
993
1048
|
} else {
|
994
1049
|
$module
|
@@ -997,7 +1052,7 @@ $.fn.modal = function(parameters) {
|
|
997
1052
|
? -(module.cache.height / 2)
|
998
1053
|
: settings.padding / 2,
|
999
1054
|
marginLeft: -(module.cache.width / 2)
|
1000
|
-
})
|
1055
|
+
})
|
1001
1056
|
;
|
1002
1057
|
}
|
1003
1058
|
module.verbose('Setting modal offset for legacy mode');
|
@@ -1323,11 +1378,19 @@ $.fn.modal.settings = {
|
|
1323
1378
|
// called after deny selector match
|
1324
1379
|
onDeny : function(){ return true; },
|
1325
1380
|
|
1381
|
+
keys : {
|
1382
|
+
space : 32,
|
1383
|
+
enter : 13,
|
1384
|
+
escape : 27,
|
1385
|
+
tab : 9,
|
1386
|
+
},
|
1387
|
+
|
1326
1388
|
selector : {
|
1327
1389
|
title : '> .header',
|
1328
1390
|
content : '> .content',
|
1329
1391
|
actions : '> .actions',
|
1330
1392
|
close : '> .close',
|
1393
|
+
closeIcon: '> .close',
|
1331
1394
|
approve : '.actions .positive, .actions .approve, .actions .ok',
|
1332
1395
|
deny : '.actions .negative, .actions .deny, .actions .cancel',
|
1333
1396
|
modal : '.ui.modal',
|
@@ -1363,7 +1426,8 @@ $.fn.modal.settings = {
|
|
1363
1426
|
},
|
1364
1427
|
text: {
|
1365
1428
|
ok : 'Ok',
|
1366
|
-
cancel: 'Cancel'
|
1429
|
+
cancel: 'Cancel',
|
1430
|
+
close : 'Close'
|
1367
1431
|
}
|
1368
1432
|
};
|
1369
1433
|
|
@@ -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
|
/*******************************
|
@@ -337,7 +337,6 @@
|
|
337
337
|
left: 50%;
|
338
338
|
margin-left: @tooltipArrowHorizontalOffset;
|
339
339
|
margin-top: -@arrowOffset;
|
340
|
-
transform-origin: center top;
|
341
340
|
}
|
342
341
|
}
|
343
342
|
& when (@variationPopupLeft) {
|
@@ -448,6 +447,11 @@
|
|
448
447
|
}
|
449
448
|
}
|
450
449
|
& when (@variationPopupCenter) {
|
450
|
+
& when (@variationPopupBottom) {
|
451
|
+
[data-position="bottom center"][data-tooltip]:before {
|
452
|
+
transform-origin: center top;
|
453
|
+
}
|
454
|
+
}
|
451
455
|
& when (@variationPopupLeft) {
|
452
456
|
[data-position="left center"][data-tooltip]:before {
|
453
457
|
transform-origin: top center;
|
@@ -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
|