fomantic-ui 2.9.1-beta.22 → 2.9.1-beta.23
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 +7 -59
- package/.stylelintrc.js +5 -7
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +7 -7
- 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 +54 -53
- 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 +3 -3
- package/dist/components/calendar.js +118 -99
- package/dist/components/calendar.min.css +2 -2
- 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 +8 -8
- 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 +16 -18
- 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 +87 -87
- 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 +17 -23
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- 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 +2 -2
- package/dist/components/flyout.js +32 -30
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +2 -2
- package/dist/components/form.js +113 -89
- package/dist/components/form.min.css +2 -2
- 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/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +22 -22
- 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 +18 -16
- 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 +30 -30
- 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 +23 -21
- 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 +8 -8
- 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 +41 -46
- 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 +9 -9
- 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 +21 -19
- 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 +11 -10
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.js +39 -42
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +7 -7
- 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 +7 -7
- 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 +36 -38
- 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 +20 -17
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +7 -7
- package/dist/components/transition.js +27 -21
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +8 -8
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +60 -60
- package/dist/semantic.js +779 -735
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/examples/responsive.html +1 -1
- package/gulpfile.js +1 -1
- package/package.json +1 -1
- package/scripts/nightly-version.js +3 -3
- package/src/definitions/behaviors/api.js +53 -52
- package/src/definitions/behaviors/form.js +112 -88
- package/src/definitions/behaviors/state.js +6 -6
- package/src/definitions/behaviors/visibility.js +7 -7
- package/src/definitions/collections/menu.less +2 -2
- package/src/definitions/elements/button.less +2 -2
- package/src/definitions/elements/loader.less +4 -4
- package/src/definitions/elements/step.less +1 -1
- package/src/definitions/globals/site.js +10 -9
- package/src/definitions/modules/accordion.js +6 -6
- package/src/definitions/modules/calendar.js +117 -98
- package/src/definitions/modules/calendar.less +2 -2
- package/src/definitions/modules/checkbox.js +7 -7
- package/src/definitions/modules/dimmer.js +15 -17
- package/src/definitions/modules/dimmer.less +10 -10
- package/src/definitions/modules/dropdown.js +86 -86
- package/src/definitions/modules/embed.js +16 -22
- package/src/definitions/modules/flyout.js +31 -29
- package/src/definitions/modules/flyout.less +1 -1
- package/src/definitions/modules/modal.js +21 -21
- package/src/definitions/modules/nag.js +17 -15
- package/src/definitions/modules/popup.js +29 -29
- package/src/definitions/modules/progress.js +22 -20
- package/src/definitions/modules/rating.js +7 -7
- package/src/definitions/modules/search.js +40 -45
- package/src/definitions/modules/shape.js +8 -8
- package/src/definitions/modules/sidebar.js +20 -18
- package/src/definitions/modules/slider.js +38 -41
- package/src/definitions/modules/sticky.js +6 -6
- package/src/definitions/modules/tab.js +35 -37
- package/src/definitions/modules/toast.js +19 -16
- package/src/definitions/modules/transition.js +26 -20
- package/src/themes/amazon/elements/button.overrides +7 -7
- package/src/themes/default/collections/form.variables +1 -1
- package/src/themes/default/elements/reveal.variables +1 -1
- package/src/themes/default/globals/site.variables +1 -1
- package/src/themes/default/modules/dimmer.variables +6 -6
- package/src/themes/default/modules/modal.variables +1 -1
- package/src/themes/default/modules/slider.variables +4 -4
- package/src/themes/default/modules/toast.variables +2 -2
- package/src/themes/default/modules/transition.overrides +12 -12
- package/src/themes/flat/collections/form.overrides +2 -2
- package/src/themes/flat/globals/site.variables +1 -1
- package/src/themes/github/collections/form.overrides +2 -2
- package/src/themes/github/collections/menu.variables +1 -1
- package/src/themes/github/collections/message.overrides +3 -3
- package/src/themes/github/elements/input.overrides +2 -2
- package/src/themes/timeline/views/feed.overrides +3 -3
- package/src/themes/twitter/elements/button.overrides +2 -2
- package/tasks/README.md +1 -3
- package/tasks/admin/components/create.js +9 -16
- package/tasks/admin/components/init.js +7 -7
- package/tasks/admin/components/update.js +7 -7
- package/tasks/admin/distributions/create.js +15 -17
- package/tasks/admin/distributions/init.js +7 -7
- package/tasks/admin/distributions/update.js +7 -7
- package/tasks/admin/publish.js +1 -1
- package/tasks/admin/register.js +2 -2
- package/tasks/admin/release.js +1 -1
- package/tasks/build/assets.js +2 -2
- package/tasks/build/css.js +8 -3
- package/tasks/build/javascript.js +3 -1
- package/tasks/build.js +1 -1
- package/tasks/check-install.js +1 -1
- package/tasks/clean.js +1 -1
- package/tasks/collections/README.md +3 -5
- package/tasks/collections/admin.js +1 -1
- package/tasks/collections/docs.js +1 -1
- package/tasks/collections/install.js +1 -1
- package/tasks/collections/rtl.js +1 -1
- package/tasks/collections/various.js +1 -1
- package/tasks/config/admin/github.js +5 -6
- package/tasks/config/admin/templates/css-package.js +1 -1
- package/tasks/config/admin/templates/less-package.js +1 -1
- package/tasks/config/npm/gulpfile.js +7 -7
- package/tasks/config/project/config.js +9 -16
- package/tasks/config/project/install.js +26 -25
- package/tasks/config/project/release.js +12 -14
- package/tasks/config/tasks.js +17 -19
- package/tasks/config/user.js +1 -1
- package/tasks/docs/build.js +5 -3
- package/tasks/docs/metadata.js +7 -8
- package/tasks/docs/serve.js +5 -3
- package/tasks/install.js +38 -38
- package/tasks/rtl/build.js +1 -1
- package/tasks/rtl/watch.js +1 -1
- package/tasks/version.js +1 -1
- package/tasks/watch.js +1 -1
- package/test/.eslintrc.js +0 -4
- package/test/meteor/assets.js +1 -1
- package/test/modules/module.spec.js +15 -15
- package/test/modules/popup.spec.js +1 -1
- package/test/modules/search.spec.js +1 -1
- package/test/modules/tab.spec.js +1 -1
- package/test/modules/transition.spec.js +1 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.1-beta.
|
2
|
+
* # Fomantic-UI 2.9.1-beta.23+27384cb - Calendar
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -99,12 +99,12 @@
|
|
99
99
|
cursor: pointer;
|
100
100
|
}
|
101
101
|
.ui.calendar .ui.table tr .prev.link {
|
102
|
-
width: 14.
|
102
|
+
width: 14.28571%;
|
103
103
|
position: absolute;
|
104
104
|
left: 0;
|
105
105
|
}
|
106
106
|
.ui.calendar .ui.table tr .next.link {
|
107
|
-
width: 14.
|
107
|
+
width: 14.28571%;
|
108
108
|
position: absolute;
|
109
109
|
right: 0;
|
110
110
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.1-beta.
|
2
|
+
* # Fomantic-UI 2.9.1-beta.23+27384cb - Calendar
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -15,7 +15,7 @@
|
|
15
15
|
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
|
16
16
|
}
|
17
17
|
|
18
|
-
window = (
|
18
|
+
window = (window !== undefined && window.Math === Math)
|
19
19
|
? window
|
20
20
|
: globalThis;
|
21
21
|
|
@@ -26,11 +26,11 @@
|
|
26
26
|
|
27
27
|
moduleSelector = $allModules.selector || '',
|
28
28
|
|
29
|
-
time =
|
29
|
+
time = Date.now(),
|
30
30
|
performance = [],
|
31
31
|
|
32
32
|
query = arguments[0],
|
33
|
-
methodInvoked = (typeof query
|
33
|
+
methodInvoked = (typeof query === 'string'),
|
34
34
|
queryArguments = [].slice.call(arguments, 1),
|
35
35
|
returnedValue,
|
36
36
|
timeGapTable = {
|
@@ -124,9 +124,9 @@
|
|
124
124
|
if (settings.inline) {
|
125
125
|
return;
|
126
126
|
}
|
127
|
-
if (
|
127
|
+
if ($activator.length === 0) {
|
128
128
|
$activator = $module.children().first();
|
129
|
-
if (
|
129
|
+
if ($activator.length === 0) {
|
130
130
|
return;
|
131
131
|
}
|
132
132
|
}
|
@@ -135,7 +135,7 @@
|
|
135
135
|
|
136
136
|
return;
|
137
137
|
}
|
138
|
-
if (
|
138
|
+
if ($container.length === 0) {
|
139
139
|
if (settings.context) {
|
140
140
|
module.popupId = namespace + '_popup_' + (Math.random().toString(16) + '000000000').slice(2, 10);
|
141
141
|
$container = $('<div/>', { id: module.popupId }).addClass(className.popup).appendTo($document.find(settings.context));
|
@@ -144,7 +144,7 @@
|
|
144
144
|
// the styling (eg input action button needs to be the last child to have correct border radius)
|
145
145
|
var
|
146
146
|
$activatorParent = $activator.parent(),
|
147
|
-
domPositionFunction = $activatorParent.closest(selector.append).length
|
147
|
+
domPositionFunction = $activatorParent.closest(selector.append).length > 0 ? 'appendTo' : 'prependTo'
|
148
148
|
;
|
149
149
|
$container = $('<div/>').addClass(className.popup)[domPositionFunction]($activatorParent);
|
150
150
|
}
|
@@ -163,7 +163,7 @@
|
|
163
163
|
|
164
164
|
return settings.onHidden.apply($container, arguments);
|
165
165
|
};
|
166
|
-
if (
|
166
|
+
if ($input.length === 0) {
|
167
167
|
// no input, $container has to handle focus/blur
|
168
168
|
$container.attr('tabindex', '0');
|
169
169
|
onVisible = function () {
|
@@ -195,17 +195,17 @@
|
|
195
195
|
module.popup(options);
|
196
196
|
},
|
197
197
|
inline: function () {
|
198
|
-
if ($activator.length && !settings.inline) {
|
198
|
+
if ($activator.length > 0 && !settings.inline) {
|
199
199
|
return;
|
200
200
|
}
|
201
201
|
settings.inline = true;
|
202
202
|
$container = $('<div/>').addClass(className.calendar).appendTo($module);
|
203
|
-
if (
|
203
|
+
if ($input.length === 0) {
|
204
204
|
$container.attr('tabindex', '0');
|
205
205
|
}
|
206
206
|
},
|
207
207
|
input: function () {
|
208
|
-
if (settings.touchReadonly && $input.length && isTouch) {
|
208
|
+
if (settings.touchReadonly && $input.length > 0 && isTouch) {
|
209
209
|
$input.prop('readonly', true);
|
210
210
|
}
|
211
211
|
module.check.disabled();
|
@@ -216,7 +216,7 @@
|
|
216
216
|
date = parser.date(settings.initialDate, settings);
|
217
217
|
} else if ($module.data(metadata.date) !== undefined) {
|
218
218
|
date = parser.date($module.data(metadata.date), settings);
|
219
|
-
} else if ($input.length) {
|
219
|
+
} else if ($input.length > 0) {
|
220
220
|
date = parser.date($input.val(), settings);
|
221
221
|
}
|
222
222
|
module.set.date(date, settings.formatInput, false);
|
@@ -301,7 +301,7 @@
|
|
301
301
|
}
|
302
302
|
|
303
303
|
var month = startMonth + p;
|
304
|
-
var firstMonthDayColumn = (new Date(year, month, 1).getDay() - settings.firstDayOfWeek % 7 + 7) % 7;
|
304
|
+
var firstMonthDayColumn = (new Date(year, month, 1).getDay() - (settings.firstDayOfWeek % 7) + 7) % 7;
|
305
305
|
if (!settings.constantHeight && isDay) {
|
306
306
|
var requiredCells = new Date(year, month + 1, 0).getDate() + firstMonthDayColumn;
|
307
307
|
rows = Math.ceil(requiredCells / 7);
|
@@ -334,7 +334,8 @@
|
|
334
334
|
if (isDay && settings.showWeekNumbers) {
|
335
335
|
tempMode += ' andweek';
|
336
336
|
}
|
337
|
-
var table = $('<table/>').addClass(className.table).addClass(tempMode).addClass(numberText[columns] + ' column')
|
337
|
+
var table = $('<table/>').addClass(className.table).addClass(tempMode).addClass(numberText[columns] + ' column')
|
338
|
+
.appendTo(container);
|
338
339
|
if (isInverted) {
|
339
340
|
table.addClass(className.inverted);
|
340
341
|
}
|
@@ -546,7 +547,7 @@
|
|
546
547
|
var winWidth = $(window).width();
|
547
548
|
$container.find('td[data-position]').each(function () {
|
548
549
|
var $cell = $(this);
|
549
|
-
var tooltipWidth = window.getComputedStyle($cell[0], '::after').width.replace(/[
|
550
|
+
var tooltipWidth = window.getComputedStyle($cell[0], '::after').width.replace(/[^\d.]/g, '');
|
550
551
|
var tooltipPosition = $cell.attr('data-position');
|
551
552
|
// use a fallback width of 250 (calendar width) for IE/Edge (which return "auto")
|
552
553
|
var calcPosition = (winWidth - $cell.width() - (parseInt(tooltipWidth, 10) || 250)) > $cell.offset().left ? 'right' : 'left';
|
@@ -564,7 +565,7 @@
|
|
564
565
|
$container.on('mouseup' + eventNamespace, module.event.mouseup);
|
565
566
|
$container.on('touchend' + eventNamespace, module.event.mouseup);
|
566
567
|
$container.on('mouseover' + eventNamespace, module.event.mouseover);
|
567
|
-
if ($input.length) {
|
568
|
+
if ($input.length > 0) {
|
568
569
|
$input.on('input' + eventNamespace, module.event.inputChange);
|
569
570
|
$input.on('focus' + eventNamespace, module.event.inputFocus);
|
570
571
|
$input.on('blur' + eventNamespace, module.event.inputBlur);
|
@@ -579,7 +580,7 @@
|
|
579
580
|
events: function () {
|
580
581
|
module.debug('Unbinding events');
|
581
582
|
$container.off(eventNamespace);
|
582
|
-
if ($input.length) {
|
583
|
+
if ($input.length > 0) {
|
583
584
|
$input.off(eventNamespace);
|
584
585
|
}
|
585
586
|
},
|
@@ -595,7 +596,7 @@
|
|
595
596
|
}
|
596
597
|
},
|
597
598
|
mousedown: function (event) {
|
598
|
-
if ($input.length) {
|
599
|
+
if ($input.length > 0) {
|
599
600
|
// prevent the mousedown on the calendar causing the input to lose focus
|
600
601
|
event.preventDefault();
|
601
602
|
}
|
@@ -642,38 +643,51 @@
|
|
642
643
|
|
643
644
|
if (module.popup('is visible')) {
|
644
645
|
var mode = module.get.mode();
|
645
|
-
|
646
|
+
switch (keyCode) {
|
646
647
|
// arrow keys
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
648
|
+
case 37:
|
649
|
+
case 38:
|
650
|
+
case 39:
|
651
|
+
case 40: {
|
652
|
+
var bigIncrement = mode === 'day' ? 7 : mode === 'hour' ? 4 : mode === 'minute' ? timeGap.column : 3;
|
653
|
+
var increment = keyCode === 37 ? -1 : keyCode === 38 ? -bigIncrement : keyCode == 39 ? 1 : bigIncrement;
|
654
|
+
increment *= mode === 'minute' ? settings.minTimeGap : 1;
|
655
|
+
var focusDate = module.get.focusDate() || module.get.date() || new Date();
|
656
|
+
var year = focusDate.getFullYear() + (mode === 'year' ? increment : 0);
|
657
|
+
var month = focusDate.getMonth() + (mode === 'month' ? increment : 0);
|
658
|
+
var day = focusDate.getDate() + (mode === 'day' ? increment : 0);
|
659
|
+
var hour = focusDate.getHours() + (mode === 'hour' ? increment : 0);
|
660
|
+
var minute = focusDate.getMinutes() + (mode === 'minute' ? increment : 0);
|
661
|
+
var newFocusDate = new Date(year, month, day, hour, minute);
|
662
|
+
if (settings.type === 'time') {
|
663
|
+
newFocusDate = module.helper.mergeDateTime(focusDate, newFocusDate);
|
664
|
+
}
|
665
|
+
if (module.helper.isDateInRange(newFocusDate, mode)) {
|
666
|
+
module.set.focusDate(newFocusDate);
|
667
|
+
}
|
668
|
+
|
669
|
+
break;
|
662
670
|
}
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
671
|
+
// enter key
|
672
|
+
case 13: {
|
673
|
+
var date = module.get.focusDate();
|
674
|
+
if (date && !settings.isDisabled(date, mode) && !module.helper.isDisabled(date, mode) && module.helper.isEnabled(date, mode)) {
|
675
|
+
if (settings.onSelect.call(element, date, module.get.mode()) !== false) {
|
676
|
+
module.selectDate(date);
|
677
|
+
}
|
669
678
|
}
|
679
|
+
// disable form submission:
|
680
|
+
event.preventDefault();
|
681
|
+
event.stopPropagation();
|
682
|
+
|
683
|
+
break;
|
670
684
|
}
|
671
|
-
//
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
685
|
+
// escape key
|
686
|
+
case 27:
|
687
|
+
module.popup('hide');
|
688
|
+
event.stopPropagation();
|
689
|
+
|
690
|
+
break;
|
677
691
|
}
|
678
692
|
}
|
679
693
|
|
@@ -724,7 +738,7 @@
|
|
724
738
|
|
725
739
|
disconnect: {
|
726
740
|
classObserver: function () {
|
727
|
-
if ($input.length && classObserver) {
|
741
|
+
if ($input.length > 0 && classObserver) {
|
728
742
|
classObserver.disconnect();
|
729
743
|
}
|
730
744
|
},
|
@@ -732,7 +746,7 @@
|
|
732
746
|
|
733
747
|
observe: {
|
734
748
|
class: function () {
|
735
|
-
if ($input.length && classObserver) {
|
749
|
+
if ($input.length > 0 && classObserver) {
|
736
750
|
classObserver.observe($module[0], {
|
737
751
|
attributes: true,
|
738
752
|
});
|
@@ -890,7 +904,7 @@
|
|
890
904
|
}
|
891
905
|
module.set.dataKeyValue(metadata.date, date);
|
892
906
|
|
893
|
-
if (updateInput && $input.length) {
|
907
|
+
if (updateInput && $input.length > 0) {
|
894
908
|
$input.val(text);
|
895
909
|
}
|
896
910
|
|
@@ -1031,14 +1045,14 @@
|
|
1031
1045
|
},
|
1032
1046
|
|
1033
1047
|
focus: function () {
|
1034
|
-
if ($input.length) {
|
1048
|
+
if ($input.length > 0) {
|
1035
1049
|
$input.trigger('focus');
|
1036
1050
|
} else {
|
1037
1051
|
$container.trigger('focus');
|
1038
1052
|
}
|
1039
1053
|
},
|
1040
1054
|
blur: function () {
|
1041
|
-
if ($input.length) {
|
1055
|
+
if ($input.length > 0) {
|
1042
1056
|
$input.trigger('blur');
|
1043
1057
|
} else {
|
1044
1058
|
$container.trigger('blur');
|
@@ -1089,7 +1103,7 @@
|
|
1089
1103
|
ss: ('0' + s).slice(-2),
|
1090
1104
|
a: a,
|
1091
1105
|
A: a.toUpperCase(),
|
1092
|
-
S: ['th', 'st', 'nd', 'rd'][D % 10 > 3 ? 0 : (D % 100 - D % 10
|
1106
|
+
S: ['th', 'st', 'nd', 'rd'][(D % 10) > 3 ? 0 : (((D % 100) - (D % 10) === 10) ? 0 : D % 10)],
|
1093
1107
|
w: w,
|
1094
1108
|
ww: ('0' + w).slice(-2),
|
1095
1109
|
}
|
@@ -1198,9 +1212,9 @@
|
|
1198
1212
|
|
1199
1213
|
return enabled;
|
1200
1214
|
});
|
1201
|
-
} else {
|
1202
|
-
return true;
|
1203
1215
|
}
|
1216
|
+
|
1217
|
+
return true;
|
1204
1218
|
},
|
1205
1219
|
findDayAsObject: function (date, mode, dates) {
|
1206
1220
|
if (mode === 'day' || mode === 'month' || mode === 'year') {
|
@@ -1215,11 +1229,13 @@
|
|
1215
1229
|
dateObject[metadata.date] = d;
|
1216
1230
|
|
1217
1231
|
return dateObject;
|
1218
|
-
}
|
1232
|
+
}
|
1233
|
+
if (d !== null && typeof d === 'object') {
|
1219
1234
|
if (d[metadata.year]) {
|
1220
1235
|
if (typeof d[metadata.year] === 'number' && date.getFullYear() == d[metadata.year]) {
|
1221
1236
|
return d;
|
1222
|
-
}
|
1237
|
+
}
|
1238
|
+
if (Array.isArray(d[metadata.year])) {
|
1223
1239
|
if (d[metadata.year].indexOf(date.getFullYear()) > -1) {
|
1224
1240
|
return d;
|
1225
1241
|
}
|
@@ -1227,7 +1243,8 @@
|
|
1227
1243
|
} else if (d[metadata.month]) {
|
1228
1244
|
if (typeof d[metadata.month] === 'number' && date.getMonth() == d[metadata.month]) {
|
1229
1245
|
return d;
|
1230
|
-
}
|
1246
|
+
}
|
1247
|
+
if (Array.isArray(d[metadata.month])) {
|
1231
1248
|
if (d[metadata.month].indexOf(date.getMonth()) > -1) {
|
1232
1249
|
return d;
|
1233
1250
|
}
|
@@ -1240,7 +1257,8 @@
|
|
1240
1257
|
} else if (d[metadata.date] && mode === 'day') {
|
1241
1258
|
if (d[metadata.date] instanceof Date && module.helper.dateEqual(date, module.helper.sanitiseDate(d[metadata.date]), mode)) {
|
1242
1259
|
return d;
|
1243
|
-
}
|
1260
|
+
}
|
1261
|
+
if (Array.isArray(d[metadata.date])) {
|
1244
1262
|
if (d[metadata.date].some(function (idate) {
|
1245
1263
|
return module.helper.dateEqual(date, idate, mode);
|
1246
1264
|
})) {
|
@@ -1261,7 +1279,8 @@
|
|
1261
1279
|
if (d[metadata.hours]) {
|
1262
1280
|
if (typeof d[metadata.hours] === 'number' && date.getHours() == d[metadata.hours]) {
|
1263
1281
|
return d;
|
1264
|
-
}
|
1282
|
+
}
|
1283
|
+
if (Array.isArray(d[metadata.hours])) {
|
1265
1284
|
if (d[metadata.hours].indexOf(date.getHours()) > -1) {
|
1266
1285
|
return d;
|
1267
1286
|
}
|
@@ -1272,11 +1291,13 @@
|
|
1272
1291
|
d = hours[i];
|
1273
1292
|
if (typeof d === 'number' && date.getHours() == d) {
|
1274
1293
|
return null;
|
1275
|
-
}
|
1294
|
+
}
|
1295
|
+
if (d !== null && typeof d === 'object') {
|
1276
1296
|
if (d[metadata.days] && hourCheck(date, d)) {
|
1277
1297
|
if (typeof d[metadata.days] === 'number' && date.getDay() == d[metadata.days]) {
|
1278
1298
|
return d;
|
1279
|
-
}
|
1299
|
+
}
|
1300
|
+
if (Array.isArray(d[metadata.days])) {
|
1280
1301
|
if (d[metadata.days].indexOf(date.getDay()) > -1) {
|
1281
1302
|
return d;
|
1282
1303
|
}
|
@@ -1284,7 +1305,8 @@
|
|
1284
1305
|
} else if (d[metadata.date] && hourCheck(date, d)) {
|
1285
1306
|
if (d[metadata.date] instanceof Date && module.helper.dateEqual(date, module.helper.sanitiseDate(d[metadata.date]))) {
|
1286
1307
|
return d;
|
1287
|
-
}
|
1308
|
+
}
|
1309
|
+
if (Array.isArray(d[metadata.date])) {
|
1288
1310
|
if (d[metadata.date].some(function (idate) {
|
1289
1311
|
return module.helper.dateEqual(date, idate, mode);
|
1290
1312
|
})) {
|
@@ -1311,7 +1333,10 @@
|
|
1311
1333
|
return date;
|
1312
1334
|
},
|
1313
1335
|
dateDiff: function (date1, date2, mode) {
|
1314
|
-
|
1336
|
+
if (!mode) {
|
1337
|
+
mode = 'day';
|
1338
|
+
}
|
1339
|
+
|
1315
1340
|
var isTimeOnly = settings.type === 'time';
|
1316
1341
|
var isYear = mode === 'year';
|
1317
1342
|
var isYearOrMonth = isYear || mode === 'month';
|
@@ -1434,7 +1459,7 @@
|
|
1434
1459
|
previousTime
|
1435
1460
|
;
|
1436
1461
|
if (settings.performance) {
|
1437
|
-
currentTime =
|
1462
|
+
currentTime = Date.now();
|
1438
1463
|
previousTime = time || currentTime;
|
1439
1464
|
executionTime = currentTime - previousTime;
|
1440
1465
|
time = currentTime;
|
@@ -1485,8 +1510,8 @@
|
|
1485
1510
|
;
|
1486
1511
|
passedArguments = passedArguments || queryArguments;
|
1487
1512
|
context = context || element;
|
1488
|
-
if (typeof query
|
1489
|
-
query = query.split(/[
|
1513
|
+
if (typeof query === 'string' && object !== undefined) {
|
1514
|
+
query = query.split(/[ .]/);
|
1490
1515
|
maxDepth = query.length - 1;
|
1491
1516
|
$.each(query, function (depth, value) {
|
1492
1517
|
var camelCaseValue = (depth != maxDepth)
|
@@ -1634,8 +1659,7 @@
|
|
1634
1659
|
today: function (settings) {
|
1635
1660
|
return settings.type === 'date' ? settings.text.today : settings.text.now;
|
1636
1661
|
},
|
1637
|
-
cell: function (cell, date, cellOptions) {
|
1638
|
-
},
|
1662
|
+
cell: function (cell, date, cellOptions) {},
|
1639
1663
|
},
|
1640
1664
|
|
1641
1665
|
parser: {
|
@@ -1646,17 +1670,18 @@
|
|
1646
1670
|
if (!text) {
|
1647
1671
|
return null;
|
1648
1672
|
}
|
1649
|
-
text = String(text).trim().replace(/([
|
1673
|
+
text = String(text).trim().replace(/([./:-])\s+/g, '$1').replace(/\s+([./:-])/g, '$1')
|
1674
|
+
.replace(/\s+/g, ' ');
|
1650
1675
|
if (text.length === 0) {
|
1651
1676
|
return null;
|
1652
1677
|
}
|
1653
|
-
if (
|
1654
|
-
text = text.replace(/[
|
1678
|
+
if (/^\d{4}(?:[./-]\d{1,2}){2}$/.test(text)) {
|
1679
|
+
text = text.replace(/[./-]/g, '/') + ' 00:00:00';
|
1655
1680
|
}
|
1656
1681
|
// Reverse date and month in some cases
|
1657
|
-
text = settings.monthFirst ||
|
1682
|
+
text = settings.monthFirst || !/^\d{1,2}[./-]/.test(text) ? text : text.replace(/[./-]/g, '/').replace(/(\d+)\/(\d+)/, '$2/$1');
|
1658
1683
|
var textDate = new Date(text);
|
1659
|
-
var numberOnly = text.match(
|
1684
|
+
var numberOnly = text.match(/^\d+$/) !== null;
|
1660
1685
|
if (!numberOnly && !isNaN(textDate.getDate())) {
|
1661
1686
|
return textDate;
|
1662
1687
|
}
|
@@ -1674,7 +1699,7 @@
|
|
1674
1699
|
month = -1,
|
1675
1700
|
year = -1
|
1676
1701
|
;
|
1677
|
-
var isAm
|
1702
|
+
var isAm;
|
1678
1703
|
|
1679
1704
|
var isTimeOnly = settings.type === 'time';
|
1680
1705
|
var isDateOnly = settings.type.indexOf('time') < 0;
|
@@ -1704,7 +1729,7 @@
|
|
1704
1729
|
if (hour < 0 || minute < 0) {
|
1705
1730
|
parts = number.split(':');
|
1706
1731
|
for (k = 0; k < Math.min(2, parts.length); k++) {
|
1707
|
-
j = parseInt(parts[k]);
|
1732
|
+
j = parseInt(parts[k], 10);
|
1708
1733
|
if (isNaN(j)) {
|
1709
1734
|
j = 0;
|
1710
1735
|
}
|
@@ -1743,7 +1768,7 @@
|
|
1743
1768
|
|
1744
1769
|
// year > settings.centuryBreak
|
1745
1770
|
for (i = 0; i < numbers.length; i++) {
|
1746
|
-
j = parseInt(numbers[i]);
|
1771
|
+
j = parseInt(numbers[i], 10);
|
1747
1772
|
if (isNaN(j)) {
|
1748
1773
|
continue;
|
1749
1774
|
}
|
@@ -1762,11 +1787,11 @@
|
|
1762
1787
|
if (month < 0) {
|
1763
1788
|
for (i = 0; i < numbers.length; i++) {
|
1764
1789
|
k = i > 1 || settings.monthFirst ? i : i === 1 ? 0 : 1;
|
1765
|
-
j = parseInt(numbers[k]);
|
1790
|
+
j = parseInt(numbers[k], 10);
|
1766
1791
|
if (isNaN(j)) {
|
1767
1792
|
continue;
|
1768
1793
|
}
|
1769
|
-
if (
|
1794
|
+
if (j >= 1 && j <= 12) {
|
1770
1795
|
month = j;
|
1771
1796
|
numbers.splice(k, 1);
|
1772
1797
|
|
@@ -1777,11 +1802,11 @@
|
|
1777
1802
|
|
1778
1803
|
// day
|
1779
1804
|
for (i = 0; i < numbers.length; i++) {
|
1780
|
-
j = parseInt(numbers[i]);
|
1805
|
+
j = parseInt(numbers[i], 10);
|
1781
1806
|
if (isNaN(j)) {
|
1782
1807
|
continue;
|
1783
1808
|
}
|
1784
|
-
if (
|
1809
|
+
if (j >= 1 && j <= 31) {
|
1785
1810
|
day = j;
|
1786
1811
|
numbers.splice(i, 1);
|
1787
1812
|
|
@@ -1792,7 +1817,7 @@
|
|
1792
1817
|
// year <= settings.centuryBreak
|
1793
1818
|
if (year < 0) {
|
1794
1819
|
for (i = numbers.length - 1; i >= 0; i--) {
|
1795
|
-
j = parseInt(numbers[i]);
|
1820
|
+
j = parseInt(numbers[i], 10);
|
1796
1821
|
if (isNaN(j)) {
|
1797
1822
|
continue;
|
1798
1823
|
}
|
@@ -1811,11 +1836,11 @@
|
|
1811
1836
|
// hour
|
1812
1837
|
if (hour < 0) {
|
1813
1838
|
for (i = 0; i < numbers.length; i++) {
|
1814
|
-
j = parseInt(numbers[i]);
|
1839
|
+
j = parseInt(numbers[i], 10);
|
1815
1840
|
if (isNaN(j)) {
|
1816
1841
|
continue;
|
1817
1842
|
}
|
1818
|
-
if (
|
1843
|
+
if (j >= 0 && j <= 23) {
|
1819
1844
|
hour = j;
|
1820
1845
|
numbers.splice(i, 1);
|
1821
1846
|
|
@@ -1827,11 +1852,11 @@
|
|
1827
1852
|
// minute
|
1828
1853
|
if (minute < 0) {
|
1829
1854
|
for (i = 0; i < numbers.length; i++) {
|
1830
|
-
j = parseInt(numbers[i]);
|
1855
|
+
j = parseInt(numbers[i], 10);
|
1831
1856
|
if (isNaN(j)) {
|
1832
1857
|
continue;
|
1833
1858
|
}
|
1834
|
-
if (
|
1859
|
+
if (j >= 0 && j <= 59) {
|
1835
1860
|
minute = j;
|
1836
1861
|
numbers.splice(i, 1);
|
1837
1862
|
|
@@ -1887,28 +1912,22 @@
|
|
1887
1912
|
},
|
1888
1913
|
|
1889
1914
|
// callback when date changes
|
1890
|
-
onChange: function (date, text, mode) {
|
1891
|
-
},
|
1915
|
+
onChange: function (date, text, mode) {},
|
1892
1916
|
|
1893
1917
|
// callback before show animation, return false to prevent show
|
1894
|
-
onShow: function () {
|
1895
|
-
},
|
1918
|
+
onShow: function () {},
|
1896
1919
|
|
1897
1920
|
// callback after show animation
|
1898
|
-
onVisible: function () {
|
1899
|
-
},
|
1921
|
+
onVisible: function () {},
|
1900
1922
|
|
1901
1923
|
// callback before hide animation, return false to prevent hide
|
1902
|
-
onHide: function () {
|
1903
|
-
},
|
1924
|
+
onHide: function () {},
|
1904
1925
|
|
1905
1926
|
// callback after hide animation
|
1906
|
-
onHidden: function () {
|
1907
|
-
},
|
1927
|
+
onHidden: function () {},
|
1908
1928
|
|
1909
1929
|
// callback before item is selected, return false to prevent selection
|
1910
|
-
onSelect: function (date, mode) {
|
1911
|
-
},
|
1930
|
+
onSelect: function (date, mode) {},
|
1912
1931
|
|
1913
1932
|
// is the given date disabled?
|
1914
1933
|
isDisabled: function (date, mode) {
|
@@ -1925,7 +1944,7 @@
|
|
1925
1944
|
regExp: {
|
1926
1945
|
dateWords: /[^A-Za-z\u00C0-\u024F]+/g,
|
1927
1946
|
dateNumbers: /[^\d:]+/g,
|
1928
|
-
token: /d{1,4}|D{1,2}|M{1,4}|YY(?:YY)?|([Hhmsw])\1?|[
|
1947
|
+
token: /d{1,4}|D{1,2}|M{1,4}|YY(?:YY)?|([Hhmsw])\1?|[ASYa]|"[^"]*"|'[^']*'/g,
|
1929
1948
|
},
|
1930
1949
|
|
1931
1950
|
error: {
|
@@ -1,9 +1,9 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.1-beta.
|
2
|
+
* # Fomantic-UI 2.9.1-beta.23+27384cb - Calendar
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
6
6
|
* Released under the MIT license
|
7
7
|
* https://opensource.org/licenses/MIT
|
8
8
|
*
|
9
|
-
*/.ui.calendar.popup{max-width:none;padding:0;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ui.calendar.popup.inverted::before{background:#2b2b2b}.ui.calendar .calendar:focus,.ui.calendar.popup:focus{outline:0}.ui.calendar.popup .ui.grid{display:block;white-space:nowrap}.ui.calendar.popup .ui.grid>.column{width:auto}.ui.calendar .ui.table.minute,.ui.calendar .ui.table.month,.ui.calendar .ui.table.year{min-width:15em}.ui.calendar .ui.table.day{min-width:18em}.ui.calendar .ui.table.day.andweek{min-width:22em}.ui.calendar .ui.table.hour{min-width:20em}.ui.calendar .ui.table tr td,.ui.calendar .ui.table tr th{padding:.5em;white-space:nowrap}.ui.calendar .ui.table tr th{border-left:none}.ui.calendar .ui.table tr th i.icon{margin:0}.ui.calendar .ui.table tr:first-child th{position:relative;padding-left:0;padding-right:0}.ui.calendar .ui.table.day tr:first-child th{border:none}.ui.calendar .ui.table.day tr:nth-child(2) th{padding-top:.2em;padding-bottom:.3em}.ui.calendar .ui.table tr td{padding-left:.1em;padding-right:.1em}.ui.calendar .ui.table tr .link{cursor:pointer}.ui.calendar .ui.table tr .prev.link{width:14.
|
9
|
+
*/.ui.calendar.popup{max-width:none;padding:0;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ui.calendar.popup.inverted::before{background:#2b2b2b}.ui.calendar .calendar:focus,.ui.calendar.popup:focus{outline:0}.ui.calendar.popup .ui.grid{display:block;white-space:nowrap}.ui.calendar.popup .ui.grid>.column{width:auto}.ui.calendar .ui.table.minute,.ui.calendar .ui.table.month,.ui.calendar .ui.table.year{min-width:15em}.ui.calendar .ui.table.day{min-width:18em}.ui.calendar .ui.table.day.andweek{min-width:22em}.ui.calendar .ui.table.hour{min-width:20em}.ui.calendar .ui.table tr td,.ui.calendar .ui.table tr th{padding:.5em;white-space:nowrap}.ui.calendar .ui.table tr th{border-left:none}.ui.calendar .ui.table tr th i.icon{margin:0}.ui.calendar .ui.table tr:first-child th{position:relative;padding-left:0;padding-right:0}.ui.calendar .ui.table.day tr:first-child th{border:none}.ui.calendar .ui.table.day tr:nth-child(2) th{padding-top:.2em;padding-bottom:.3em}.ui.calendar .ui.table tr td{padding-left:.1em;padding-right:.1em}.ui.calendar .ui.table tr .link{cursor:pointer}.ui.calendar .ui.table tr .prev.link{width:14.28571%;position:absolute;left:0}.ui.calendar .ui.table tr .next.link{width:14.28571%;position:absolute;right:0}.ui.ui.calendar .ui.table tr .disabled{pointer-events:auto;cursor:default;color:rgba(40,40,40,.3)}.ui.calendar .ui.table tr .adjacent:not(.disabled):not(.active){color:rgba(0,0,0,.6);background:rgba(0,0,0,.03)}.ui.calendar .ui.table tr td.today{font-weight:700}.ui.calendar .ui.table tr td.range{background:rgba(0,0,0,.05);color:rgba(0,0,0,.95);-webkit-box-shadow:none;box-shadow:none}.ui.calendar:not(.disabled).popup.active .ui.table tbody tr td.focus,.ui.calendar:not(.disabled):focus .ui.table tbody tr td.focus{-webkit-box-shadow:inset 0 0 0 1px #85b7d9;box-shadow:inset 0 0 0 1px #85b7d9}.ui.inverted.calendar .ui.table.inverted tr td.range{background:rgba(255,255,255,.08);color:#fff;-webkit-box-shadow:none;box-shadow:none}.ui.inverted.calendar:not(.disabled) .calendar:focus .ui.table.inverted tbody tr td.focus,.ui.inverted.calendar:not(.disabled).popup.active .ui.table.inverted tbody tr td.focus{-webkit-box-shadow:inset 0 0 0 1px #85b7d9;box-shadow:inset 0 0 0 1px #85b7d9}.ui.inverted.calendar .ui.ui.ui.inverted.table tr .disabled{color:rgba(225,225,225,.3)}.ui.inverted.calendar .ui.inverted.table tr .adjacent:not(.disabled):not(.active){color:rgba(255,255,255,.8);background:rgba(255,255,255,.02)}.ui.calendar.popup>.ui.ui.grid{margin:-1rem}.ui.calendar.popup>.ui.ui.grid>.column:not(:first-child){padding-left:0}.ui.calendar.popup>.ui.ui.grid>.column:not(:first-child)>.ui.table{border-top-left-radius:0;border-bottom-left-radius:0}.ui.calendar.popup>.ui.ui.grid>.column:not(:last-child){padding-right:0}.ui.calendar.popup>.ui.ui.grid>.column:not(:last-child)>.ui.table{border-top-right-radius:0;border-bottom-right-radius:0}.ui.disabled.calendar{opacity:.45}.ui.disabled.calendar .ui.table tr .link,.ui.disabled.calendar>.input{pointer-events:none}
|