@siemens/ix 1.0.0 → 1.1.0-beta.0
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/README.md +4 -0
- package/dist/cjs/ix-blind.cjs.entry.js +1 -1
- package/dist/cjs/ix-breadcrumb_2.cjs.entry.js +1 -1
- package/dist/cjs/ix-button.cjs.entry.js +1 -1
- package/dist/cjs/ix-category-filter.cjs.entry.js +1 -1
- package/dist/cjs/ix-chip.cjs.entry.js +1 -1
- package/dist/cjs/ix-date-picker_2.cjs.entry.js +214 -56
- package/dist/cjs/ix-date-time-card.cjs.entry.js +1 -1
- package/dist/cjs/ix-datetime-picker.cjs.entry.js +79 -10
- package/dist/cjs/ix-dropdown_2.cjs.entry.js +1 -1
- package/dist/cjs/ix-event-list_2.cjs.entry.js +3 -3
- package/dist/cjs/ix-expanding-search.cjs.entry.js +2 -1
- package/dist/cjs/ix-filter-chip.cjs.entry.js +1 -1
- package/dist/cjs/ix-map-navigation_2.cjs.entry.js +0 -25
- package/dist/cjs/ix-menu_9.cjs.entry.js +32 -16
- package/dist/cjs/ix-select_2.cjs.entry.js +1 -1
- package/dist/cjs/ix-tile.cjs.entry.js +1 -1
- package/dist/cjs/ix-toast_2.cjs.entry.js +4 -0
- package/dist/cjs/ix-tree_2.cjs.entry.js +1 -1
- package/dist/cjs/ix-validation-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/{ix-workflow-step.cjs.entry.js → ix-workflow-step_2.cjs.entry.js} +77 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/siemens-ix.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +6 -0
- package/dist/collection/components/blind/blind.css +1 -1
- package/dist/collection/components/breadcrumb/breadcrumb.css +1 -1
- package/dist/collection/components/button/button.css +3 -0
- package/dist/collection/components/button/button.js +1 -1
- package/dist/collection/components/category-filter/category-filter.css +2 -3
- package/dist/collection/components/chip/chip.css +8 -8
- package/dist/collection/components/date-picker/date-picker.css +51 -49
- package/dist/collection/components/date-picker/date-picker.js +371 -57
- package/dist/collection/components/date-picker/events.js +1 -0
- package/dist/collection/components/date-time-card/date-time-card.css +3 -1
- package/dist/collection/components/datetime-picker/datetime-picker.css +12 -3
- package/dist/collection/components/datetime-picker/datetime-picker.js +361 -21
- package/dist/collection/components/datetime-picker/event.js +9 -0
- package/dist/collection/components/dropdown/dropdown.css +1 -1
- package/dist/collection/components/event-list/event-list.css +2 -2
- package/dist/collection/components/event-list-item/event-list-item.css +36 -19
- package/dist/collection/components/event-list-item/event-list-item.js +2 -2
- package/dist/collection/components/expanding-search/expanding-search.css +6 -3
- package/dist/collection/components/expanding-search/expanding-search.js +1 -0
- package/dist/collection/components/filter-chip/filter-chip.css +2 -2
- package/dist/collection/components/map-navigation/map-navigation.js +1 -28
- package/dist/collection/components/menu/menu.js +36 -17
- package/dist/collection/components/menu-about/menu-about.js +13 -34
- package/dist/collection/components/menu-item/menu-item.css +2 -2
- package/dist/collection/components/menu-settings/menu-settings.js +1 -1
- package/dist/collection/components/select/select.css +1 -1
- package/dist/collection/components/tile/tile.css +1 -1
- package/dist/collection/components/time-picker/time-picker.js +188 -31
- package/dist/collection/components/toast/toast.js +6 -1
- package/dist/collection/components/tree-item/tree-item.css +9 -3
- package/dist/collection/components/validation-tooltip/validation-tooltip.css +2 -1
- package/dist/collection/exports.js +2 -0
- package/dist/components/button.js +2 -2
- package/dist/components/date-picker.js +162 -45
- package/dist/components/date-time-card.js +1 -1
- package/dist/components/dropdown.js +1 -1
- package/dist/components/filter-chip.js +1 -1
- package/dist/components/ix-blind.js +1 -1
- package/dist/components/ix-breadcrumb.js +1 -1
- package/dist/components/ix-category-filter.js +1 -1
- package/dist/components/ix-chip.js +1 -1
- package/dist/components/ix-datetime-picker.js +90 -11
- package/dist/components/ix-event-list-item.js +2 -2
- package/dist/components/ix-event-list.js +1 -1
- package/dist/components/ix-expanding-search.js +2 -1
- package/dist/components/ix-map-navigation.js +6 -51
- package/dist/components/ix-menu-about.js +115 -1
- package/dist/components/ix-menu.js +20 -2
- package/dist/components/ix-select.js +1 -1
- package/dist/components/ix-tile.js +1 -1
- package/dist/components/ix-validation-tooltip.js +1 -1
- package/dist/components/menu-item.js +1 -1
- package/dist/components/time-picker.js +70 -17
- package/dist/components/toast.js +4 -0
- package/dist/components/tree-item.js +1 -1
- package/dist/esm/ix-blind.entry.js +1 -1
- package/dist/esm/ix-breadcrumb_2.entry.js +1 -1
- package/dist/esm/ix-button.entry.js +1 -1
- package/dist/esm/ix-category-filter.entry.js +1 -1
- package/dist/esm/ix-chip.entry.js +1 -1
- package/dist/esm/ix-date-picker_2.entry.js +214 -56
- package/dist/esm/ix-date-time-card.entry.js +1 -1
- package/dist/esm/ix-datetime-picker.entry.js +79 -10
- package/dist/esm/ix-dropdown_2.entry.js +1 -1
- package/dist/esm/ix-event-list_2.entry.js +3 -3
- package/dist/esm/ix-expanding-search.entry.js +2 -1
- package/dist/esm/ix-filter-chip.entry.js +1 -1
- package/dist/esm/ix-map-navigation_2.entry.js +0 -25
- package/dist/esm/ix-menu_9.entry.js +32 -16
- package/dist/esm/ix-select_2.entry.js +1 -1
- package/dist/esm/ix-tile.entry.js +1 -1
- package/dist/esm/ix-toast_2.entry.js +4 -0
- package/dist/esm/ix-tree_2.entry.js +1 -1
- package/dist/esm/ix-validation-tooltip.entry.js +1 -1
- package/dist/esm/{ix-workflow-step.entry.js → ix-workflow-step_2.entry.js} +78 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/siemens-ix.js +1 -1
- package/dist/siemens-ix/p-02501b64.entry.js +1 -0
- package/dist/siemens-ix/{p-03d95feb.entry.js → p-1d56d9b6.entry.js} +1 -1
- package/dist/siemens-ix/p-2b7ed5d4.entry.js +1 -0
- package/dist/siemens-ix/p-334b7d5c.entry.js +1 -0
- package/dist/siemens-ix/{p-cde8f20e.entry.js → p-4287bd7e.entry.js} +1 -1
- package/dist/siemens-ix/{p-7ec8a00e.entry.js → p-52d99490.entry.js} +1 -1
- package/dist/siemens-ix/{p-2cda7278.entry.js → p-5fed62f8.entry.js} +1 -1
- package/dist/siemens-ix/p-71de6498.entry.js +1 -0
- package/dist/siemens-ix/p-77823732.entry.js +1 -0
- package/dist/siemens-ix/{p-2ce29bcd.entry.js → p-94b86dec.entry.js} +1 -1
- package/dist/siemens-ix/{p-40842bea.entry.js → p-a49005f3.entry.js} +1 -1
- package/dist/siemens-ix/{p-e1f54836.entry.js → p-a8396077.entry.js} +1 -1
- package/dist/siemens-ix/{p-504927a0.entry.js → p-b93c2fab.entry.js} +1 -1
- package/dist/siemens-ix/p-bf5513a0.entry.js +1 -0
- package/dist/siemens-ix/p-c0c9fb81.entry.js +1 -0
- package/dist/siemens-ix/p-c792adb4.entry.js +1 -0
- package/dist/siemens-ix/{p-7a4c744e.entry.js → p-c9a5d942.entry.js} +1 -1
- package/dist/siemens-ix/p-cb6e62ff.entry.js +1 -0
- package/dist/siemens-ix/p-cbd0f8a7.entry.js +1 -0
- package/dist/siemens-ix/p-fa44655a.entry.js +1 -0
- package/dist/siemens-ix/siemens-ix.css +13 -13
- package/dist/siemens-ix/siemens-ix.esm.js +1 -1
- package/dist/types/components/date-picker/date-picker.d.ts +93 -13
- package/dist/types/components/date-picker/events.d.ts +5 -0
- package/dist/types/components/datetime-picker/datetime-picker.d.ts +106 -9
- package/dist/types/components/datetime-picker/event.d.ts +5 -0
- package/dist/types/components/map-navigation/map-navigation.d.ts +0 -8
- package/dist/types/components/menu/menu.d.ts +2 -0
- package/dist/types/components/menu-about/menu-about.d.ts +1 -4
- package/dist/types/components/time-picker/time-picker.d.ts +42 -8
- package/dist/types/components.d.ts +274 -38
- package/dist/types/exports.d.ts +2 -0
- package/package.json +10 -1
- package/scss/components/_buttons.scss +15 -5
- package/scss/components/_checkboxes.scss +26 -14
- package/scss/components/_dropdown.scss +1 -1
- package/scss/components/_forms.scss +2 -1
- package/scss/components/_radiobuttons.scss +26 -14
- package/scss/mixins/_hover.scss +0 -1
- package/src/components/date-picker/readme.md +31 -10
- package/src/components/datetime-picker/readme.md +23 -10
- package/src/components/menu-about/readme.md +5 -6
- package/src/components/time-picker/readme.md +25 -8
- package/dist/cjs/ix-workflow-steps.cjs.entry.js +0 -83
- package/dist/components/menu-about.js +0 -120
- package/dist/esm/ix-workflow-steps.entry.js +0 -79
- package/dist/siemens-ix/p-1e111d1d.entry.js +0 -1
- package/dist/siemens-ix/p-240d22b6.entry.js +0 -1
- package/dist/siemens-ix/p-3613be96.entry.js +0 -1
- package/dist/siemens-ix/p-5990f0cb.entry.js +0 -1
- package/dist/siemens-ix/p-59c81e2a.entry.js +0 -1
- package/dist/siemens-ix/p-61b032bf.entry.js +0 -1
- package/dist/siemens-ix/p-662d756f.entry.js +0 -1
- package/dist/siemens-ix/p-9d9b8ad1.entry.js +0 -1
- package/dist/siemens-ix/p-ca71538c.entry.js +0 -1
- package/dist/siemens-ix/p-caf856f2.entry.js +0 -1
- package/dist/siemens-ix/p-d31bf6db.entry.js +0 -1
- package/dist/siemens-ix/p-fe020fa3.entry.js +0 -1
|
@@ -6,38 +6,118 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
import { Component, Event, Fragment, h, Host, Prop, State } from '@stencil/core';
|
|
9
|
+
import { Component, Event, Fragment, h, Host, Method, Prop, State, } from '@stencil/core';
|
|
10
10
|
import { DateTime, Info } from 'luxon';
|
|
11
11
|
export class DatePicker {
|
|
12
12
|
constructor() {
|
|
13
|
+
this.daysInWeek = 7;
|
|
14
|
+
this.dayNames = Info.weekdays();
|
|
15
|
+
this.monthNames = Info.months();
|
|
13
16
|
/**
|
|
14
|
-
*
|
|
17
|
+
* Date format string.
|
|
18
|
+
* See {@link https://moment.github.io/luxon/#/formatting?id=table-of-tokens} for all available tokens.
|
|
15
19
|
*/
|
|
16
20
|
this.format = 'yyyy/LL/dd';
|
|
17
21
|
/**
|
|
18
|
-
*
|
|
22
|
+
* If true a range of dates can be selected.
|
|
19
23
|
*/
|
|
20
24
|
this.range = true;
|
|
21
25
|
/**
|
|
22
|
-
*
|
|
26
|
+
* @deprecated - will get removed with next major release
|
|
23
27
|
*/
|
|
24
28
|
this.individual = true;
|
|
25
29
|
/**
|
|
26
|
-
*
|
|
30
|
+
* Corner style
|
|
27
31
|
*/
|
|
28
32
|
this.corners = 'rounded';
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Picker date. If the picker is in range mode this property is the start date.
|
|
35
|
+
*
|
|
36
|
+
* Format is based on `format`
|
|
37
|
+
*
|
|
38
|
+
* @since 1.1.0
|
|
39
|
+
*/
|
|
40
|
+
this.from = DateTime.now().toFormat(this.format);
|
|
41
|
+
/**
|
|
42
|
+
* Picker date. If the picker is in range mode this property is the end date.
|
|
43
|
+
* If the picker is not in range mode leave this value `null`
|
|
44
|
+
*
|
|
45
|
+
* Format is based on `format`
|
|
46
|
+
*
|
|
47
|
+
* @since 1.1.0
|
|
48
|
+
*/
|
|
49
|
+
this.to = null;
|
|
50
|
+
/**
|
|
51
|
+
* Default behavior of the done event is to join the two events (date and time) into one combined string output.
|
|
52
|
+
* This combination can be configured over the delimiter
|
|
53
|
+
*
|
|
54
|
+
* @since 1.1.0
|
|
55
|
+
*/
|
|
56
|
+
this.eventDelimiter = ' - ';
|
|
57
|
+
/**
|
|
58
|
+
* Text of date select button
|
|
59
|
+
*
|
|
60
|
+
* @since 1.1.0
|
|
61
|
+
*/
|
|
62
|
+
this.textSelectDate = 'Done';
|
|
63
|
+
this.yearValue = this.year;
|
|
35
64
|
this.today = DateTime.now();
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
38
|
-
this.
|
|
39
|
-
this.
|
|
40
|
-
this.
|
|
65
|
+
this.monthValue = this.month;
|
|
66
|
+
this.calendar = [];
|
|
67
|
+
this.years = [...Array(10).keys()].map((year) => year + this.year - 5);
|
|
68
|
+
this.tempYear = this.yearValue;
|
|
69
|
+
this.tempMonth = this.monthValue;
|
|
70
|
+
this.start = DateTime.fromObject({
|
|
71
|
+
year: this.year,
|
|
72
|
+
month: this.month,
|
|
73
|
+
day: this.day,
|
|
74
|
+
});
|
|
75
|
+
this.end = this.to
|
|
76
|
+
? DateTime.fromFormat(this.to, this.format)
|
|
77
|
+
: null;
|
|
78
|
+
}
|
|
79
|
+
get year() {
|
|
80
|
+
return DateTime.fromFormat(this.from, this.format).year;
|
|
81
|
+
}
|
|
82
|
+
get day() {
|
|
83
|
+
return DateTime.fromFormat(this.from, this.format).day;
|
|
84
|
+
}
|
|
85
|
+
get month() {
|
|
86
|
+
return DateTime.fromFormat(this.from, this.format).month;
|
|
87
|
+
}
|
|
88
|
+
onDone() {
|
|
89
|
+
var _a;
|
|
90
|
+
this.done.emit(this.getOutputFormat());
|
|
91
|
+
this.dateSelect.emit({
|
|
92
|
+
from: this.start.toFormat(this.format),
|
|
93
|
+
to: (_a = this.end) === null || _a === void 0 ? void 0 : _a.toFormat(this.format),
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
onDateChange() {
|
|
97
|
+
var _a, _b, _c, _d;
|
|
98
|
+
if (this.eventDelimiter) {
|
|
99
|
+
this.dateChange.emit(this.getOutputFormat());
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
this.dateChange.emit({
|
|
103
|
+
from: (_a = this.start) === null || _a === void 0 ? void 0 : _a.toFormat(this.format),
|
|
104
|
+
to: (_b = this.end) === null || _b === void 0 ? void 0 : _b.toFormat(this.format),
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
if (this.range) {
|
|
108
|
+
this.dateRangeChange.emit({
|
|
109
|
+
from: (_c = this.start) === null || _c === void 0 ? void 0 : _c.toFormat(this.format),
|
|
110
|
+
to: (_d = this.end) === null || _d === void 0 ? void 0 : _d.toFormat(this.format),
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
selectionProps() {
|
|
115
|
+
if (this.year !== null) {
|
|
116
|
+
this.yearValue = this.year;
|
|
117
|
+
}
|
|
118
|
+
if (this.month !== null) {
|
|
119
|
+
this.monthValue = this.month;
|
|
120
|
+
}
|
|
41
121
|
}
|
|
42
122
|
getStartOfMonth(year = DateTime.local().get('year'), month = DateTime.local().get('month')) {
|
|
43
123
|
return DateTime.local(year, month).startOf('month');
|
|
@@ -49,8 +129,9 @@ export class DatePicker {
|
|
|
49
129
|
return Math.ceil(end.diff(start, 'days').days);
|
|
50
130
|
}
|
|
51
131
|
calculateCalendar() {
|
|
52
|
-
|
|
53
|
-
const
|
|
132
|
+
this.selectionProps();
|
|
133
|
+
const start = this.getStartOfMonth(this.yearValue, this.monthValue);
|
|
134
|
+
const end = this.getEndOfMonth(this.yearValue, this.monthValue);
|
|
54
135
|
const totalDays = this.getDaysInMonth(start, end);
|
|
55
136
|
const totalWeeks = 6;
|
|
56
137
|
const totalDaysInWeeks = totalWeeks * this.daysInWeek;
|
|
@@ -78,30 +159,29 @@ export class DatePicker {
|
|
|
78
159
|
const week = weekdays[index - 1];
|
|
79
160
|
const firstWeekDay = week.find((day) => day !== undefined);
|
|
80
161
|
const weekNumber = firstWeekDay
|
|
81
|
-
? DateTime.local(this.
|
|
82
|
-
.weekNumber
|
|
162
|
+
? DateTime.local(this.yearValue, this.monthValue, weekdays[index - 1][0]).weekNumber
|
|
83
163
|
: undefined;
|
|
84
164
|
calendar.push([weekNumber, week]);
|
|
85
165
|
}
|
|
86
166
|
this.calendar = calendar;
|
|
87
167
|
}
|
|
88
168
|
changeMonth(number) {
|
|
89
|
-
if (this.
|
|
90
|
-
this.
|
|
91
|
-
this.
|
|
169
|
+
if (this.monthValue + number < 1) {
|
|
170
|
+
this.yearValue--;
|
|
171
|
+
this.monthValue = 12;
|
|
92
172
|
}
|
|
93
|
-
else if (this.
|
|
94
|
-
this.
|
|
95
|
-
this.
|
|
173
|
+
else if (this.monthValue + number > 12) {
|
|
174
|
+
this.yearValue++;
|
|
175
|
+
this.monthValue = 1;
|
|
96
176
|
}
|
|
97
177
|
else {
|
|
98
|
-
this.
|
|
178
|
+
this.monthValue += number;
|
|
99
179
|
}
|
|
100
180
|
this.calculateCalendar();
|
|
101
181
|
}
|
|
102
182
|
selectMonth(month) {
|
|
103
|
-
this.
|
|
104
|
-
this.
|
|
183
|
+
this.monthValue = month;
|
|
184
|
+
this.yearValue = this.tempYear;
|
|
105
185
|
this.tempMonth = month;
|
|
106
186
|
}
|
|
107
187
|
infiniteScrollYears() {
|
|
@@ -134,7 +214,7 @@ export class DatePicker {
|
|
|
134
214
|
}
|
|
135
215
|
todayClass(day) {
|
|
136
216
|
const today = DateTime.local();
|
|
137
|
-
const daaay = DateTime.local(this.
|
|
217
|
+
const daaay = DateTime.local(this.yearValue, this.monthValue, day);
|
|
138
218
|
const isToday = Math.ceil(daaay.diff(today, 'days').days) === 0;
|
|
139
219
|
return {
|
|
140
220
|
'calendar-item': true,
|
|
@@ -146,14 +226,15 @@ export class DatePicker {
|
|
|
146
226
|
this.end &&
|
|
147
227
|
daaay.toISO() > this.start.toISO() &&
|
|
148
228
|
daaay.toISO() < this.end.toISO(),
|
|
149
|
-
disabled: this.
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
229
|
+
disabled: !this.isWithinMinMax(daaay) ||
|
|
230
|
+
(this.start &&
|
|
231
|
+
daaay.toISO() < this.start.toISO() &&
|
|
232
|
+
this.end === null &&
|
|
233
|
+
this.range),
|
|
153
234
|
};
|
|
154
235
|
}
|
|
155
236
|
selectDay(day) {
|
|
156
|
-
const date = DateTime.local(this.
|
|
237
|
+
const date = DateTime.local(this.yearValue, this.monthValue, day);
|
|
157
238
|
const isNotDay = day === undefined;
|
|
158
239
|
const isFirstDay = this.start === null;
|
|
159
240
|
const isLastDay = this.end === null;
|
|
@@ -164,7 +245,7 @@ export class DatePicker {
|
|
|
164
245
|
return;
|
|
165
246
|
if (isSameDay) {
|
|
166
247
|
this.start = null;
|
|
167
|
-
this.
|
|
248
|
+
this.onDateChange();
|
|
168
249
|
return;
|
|
169
250
|
}
|
|
170
251
|
if (!this.range) {
|
|
@@ -180,16 +261,43 @@ export class DatePicker {
|
|
|
180
261
|
this.start = date;
|
|
181
262
|
this.end = null;
|
|
182
263
|
}
|
|
183
|
-
this.
|
|
264
|
+
this.onDateChange();
|
|
184
265
|
}
|
|
185
266
|
getOutputFormat() {
|
|
186
|
-
if (!this.
|
|
267
|
+
if (!this.start) {
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
if (!this.end) {
|
|
187
271
|
return this.start.toFormat(this.format);
|
|
188
|
-
|
|
272
|
+
}
|
|
273
|
+
return [
|
|
274
|
+
this.start.toFormat(this.format),
|
|
275
|
+
this.end.toFormat(this.format),
|
|
276
|
+
].join(this.eventDelimiter);
|
|
277
|
+
}
|
|
278
|
+
isWithinMinMax(date) {
|
|
279
|
+
const dateIso = date.toISO();
|
|
280
|
+
const _minDate = this.minDate
|
|
281
|
+
? DateTime.fromFormat(this.minDate, this.format)
|
|
282
|
+
: null;
|
|
283
|
+
const _maxDate = this.maxDate
|
|
284
|
+
? DateTime.fromFormat(this.maxDate, this.format)
|
|
285
|
+
: null;
|
|
286
|
+
return ((!_minDate || _minDate.toISO() <= dateIso) &&
|
|
287
|
+
(!_maxDate || _maxDate.toISO() >= dateIso));
|
|
189
288
|
}
|
|
190
289
|
componentWillRender() {
|
|
191
290
|
this.calculateCalendar();
|
|
192
291
|
}
|
|
292
|
+
/**
|
|
293
|
+
* Get the current DateTime
|
|
294
|
+
*/
|
|
295
|
+
async getCurrentDate() {
|
|
296
|
+
return {
|
|
297
|
+
start: this.start,
|
|
298
|
+
end: this.end,
|
|
299
|
+
};
|
|
300
|
+
}
|
|
193
301
|
render() {
|
|
194
302
|
return (h(Host, null,
|
|
195
303
|
h("ix-date-time-card", { individual: this.individual, corners: this.corners },
|
|
@@ -198,9 +306,9 @@ export class DatePicker {
|
|
|
198
306
|
h("div", { class: "selector" },
|
|
199
307
|
h("ix-button", { ghost: true, ref: (ref) => (this.dropdownButtonRef = ref) },
|
|
200
308
|
h("span", { class: "fontSize capitalize" },
|
|
201
|
-
this.monthNames[this.
|
|
309
|
+
this.monthNames[this.monthValue - 1],
|
|
202
310
|
" ",
|
|
203
|
-
this.
|
|
311
|
+
this.yearValue)),
|
|
204
312
|
h("ix-dropdown", { class: "dropdown", trigger: this.dropdownButtonRef, placement: "bottom" },
|
|
205
313
|
h("div", { class: "wrapper" },
|
|
206
314
|
h("div", { class: "overflow", onScroll: () => this.infiniteScrollYears(), ref: (ref) => (this.yearContainerRef = ref) }, this.years.map((year) => (h("div", { class: { arrowYear: true }, onClick: (event) => this.selectTempYear(event, year) },
|
|
@@ -229,7 +337,7 @@ export class DatePicker {
|
|
|
229
337
|
week[1].map((day) => (h("div", { class: this.todayClass(day), onClick: () => this.selectDay(day) }, day)))));
|
|
230
338
|
})),
|
|
231
339
|
h("div", { class: { button: true, hidden: !this.individual } },
|
|
232
|
-
h("ix-button", { onClick: () => this.
|
|
340
|
+
h("ix-button", { onClick: () => this.onDone() }, this.textSelectDate)))));
|
|
233
341
|
}
|
|
234
342
|
static get is() { return "ix-date-picker"; }
|
|
235
343
|
static get encapsulation() { return "scoped"; }
|
|
@@ -252,7 +360,7 @@ export class DatePicker {
|
|
|
252
360
|
"optional": false,
|
|
253
361
|
"docs": {
|
|
254
362
|
"tags": [],
|
|
255
|
-
"text": "
|
|
363
|
+
"text": "Date format string.\nSee {@link https ://moment.github.io/luxon/#/formatting?id=table-of-tokens} for all available tokens."
|
|
256
364
|
},
|
|
257
365
|
"attribute": "format",
|
|
258
366
|
"reflect": false,
|
|
@@ -270,7 +378,7 @@ export class DatePicker {
|
|
|
270
378
|
"optional": false,
|
|
271
379
|
"docs": {
|
|
272
380
|
"tags": [],
|
|
273
|
-
"text": "
|
|
381
|
+
"text": "If true a range of dates can be selected."
|
|
274
382
|
},
|
|
275
383
|
"attribute": "range",
|
|
276
384
|
"reflect": false,
|
|
@@ -287,8 +395,11 @@ export class DatePicker {
|
|
|
287
395
|
"required": false,
|
|
288
396
|
"optional": false,
|
|
289
397
|
"docs": {
|
|
290
|
-
"tags": [
|
|
291
|
-
|
|
398
|
+
"tags": [{
|
|
399
|
+
"name": "deprecated",
|
|
400
|
+
"text": "- will get removed with next major release"
|
|
401
|
+
}],
|
|
402
|
+
"text": ""
|
|
292
403
|
},
|
|
293
404
|
"attribute": "individual",
|
|
294
405
|
"reflect": false,
|
|
@@ -311,18 +422,142 @@ export class DatePicker {
|
|
|
311
422
|
"optional": false,
|
|
312
423
|
"docs": {
|
|
313
424
|
"tags": [],
|
|
314
|
-
"text": "
|
|
425
|
+
"text": "Corner style"
|
|
315
426
|
},
|
|
316
427
|
"attribute": "corners",
|
|
317
428
|
"reflect": false,
|
|
318
429
|
"defaultValue": "'rounded'"
|
|
430
|
+
},
|
|
431
|
+
"from": {
|
|
432
|
+
"type": "string",
|
|
433
|
+
"mutable": false,
|
|
434
|
+
"complexType": {
|
|
435
|
+
"original": "string",
|
|
436
|
+
"resolved": "string",
|
|
437
|
+
"references": {}
|
|
438
|
+
},
|
|
439
|
+
"required": false,
|
|
440
|
+
"optional": false,
|
|
441
|
+
"docs": {
|
|
442
|
+
"tags": [{
|
|
443
|
+
"name": "since",
|
|
444
|
+
"text": "1.1.0"
|
|
445
|
+
}],
|
|
446
|
+
"text": "Picker date. If the picker is in range mode this property is the start date.\n\nFormat is based on `format`"
|
|
447
|
+
},
|
|
448
|
+
"attribute": "from",
|
|
449
|
+
"reflect": false,
|
|
450
|
+
"defaultValue": "DateTime.now().toFormat(this.format)"
|
|
451
|
+
},
|
|
452
|
+
"to": {
|
|
453
|
+
"type": "string",
|
|
454
|
+
"mutable": false,
|
|
455
|
+
"complexType": {
|
|
456
|
+
"original": "string | null",
|
|
457
|
+
"resolved": "string",
|
|
458
|
+
"references": {}
|
|
459
|
+
},
|
|
460
|
+
"required": false,
|
|
461
|
+
"optional": false,
|
|
462
|
+
"docs": {
|
|
463
|
+
"tags": [{
|
|
464
|
+
"name": "since",
|
|
465
|
+
"text": "1.1.0"
|
|
466
|
+
}],
|
|
467
|
+
"text": "Picker date. If the picker is in range mode this property is the end date.\nIf the picker is not in range mode leave this value `null`\n\nFormat is based on `format`"
|
|
468
|
+
},
|
|
469
|
+
"attribute": "to",
|
|
470
|
+
"reflect": false,
|
|
471
|
+
"defaultValue": "null"
|
|
472
|
+
},
|
|
473
|
+
"minDate": {
|
|
474
|
+
"type": "string",
|
|
475
|
+
"mutable": false,
|
|
476
|
+
"complexType": {
|
|
477
|
+
"original": "string",
|
|
478
|
+
"resolved": "string",
|
|
479
|
+
"references": {}
|
|
480
|
+
},
|
|
481
|
+
"required": false,
|
|
482
|
+
"optional": false,
|
|
483
|
+
"docs": {
|
|
484
|
+
"tags": [{
|
|
485
|
+
"name": "since",
|
|
486
|
+
"text": "1.1.0"
|
|
487
|
+
}],
|
|
488
|
+
"text": "The earliest date that can be selected by the date picker.\nIf not set there will be no restriction."
|
|
489
|
+
},
|
|
490
|
+
"attribute": "min-date",
|
|
491
|
+
"reflect": false
|
|
492
|
+
},
|
|
493
|
+
"maxDate": {
|
|
494
|
+
"type": "string",
|
|
495
|
+
"mutable": false,
|
|
496
|
+
"complexType": {
|
|
497
|
+
"original": "string",
|
|
498
|
+
"resolved": "string",
|
|
499
|
+
"references": {}
|
|
500
|
+
},
|
|
501
|
+
"required": false,
|
|
502
|
+
"optional": false,
|
|
503
|
+
"docs": {
|
|
504
|
+
"tags": [{
|
|
505
|
+
"name": "since",
|
|
506
|
+
"text": "1.1.0"
|
|
507
|
+
}],
|
|
508
|
+
"text": "The latest date that can be selected by the date picker.\nIf not set there will be no restriction."
|
|
509
|
+
},
|
|
510
|
+
"attribute": "max-date",
|
|
511
|
+
"reflect": false
|
|
512
|
+
},
|
|
513
|
+
"eventDelimiter": {
|
|
514
|
+
"type": "string",
|
|
515
|
+
"mutable": false,
|
|
516
|
+
"complexType": {
|
|
517
|
+
"original": "string",
|
|
518
|
+
"resolved": "string",
|
|
519
|
+
"references": {}
|
|
520
|
+
},
|
|
521
|
+
"required": false,
|
|
522
|
+
"optional": false,
|
|
523
|
+
"docs": {
|
|
524
|
+
"tags": [{
|
|
525
|
+
"name": "since",
|
|
526
|
+
"text": "1.1.0"
|
|
527
|
+
}],
|
|
528
|
+
"text": "Default behavior of the done event is to join the two events (date and time) into one combined string output.\nThis combination can be configured over the delimiter"
|
|
529
|
+
},
|
|
530
|
+
"attribute": "event-delimiter",
|
|
531
|
+
"reflect": false,
|
|
532
|
+
"defaultValue": "' - '"
|
|
533
|
+
},
|
|
534
|
+
"textSelectDate": {
|
|
535
|
+
"type": "string",
|
|
536
|
+
"mutable": false,
|
|
537
|
+
"complexType": {
|
|
538
|
+
"original": "string",
|
|
539
|
+
"resolved": "string",
|
|
540
|
+
"references": {}
|
|
541
|
+
},
|
|
542
|
+
"required": false,
|
|
543
|
+
"optional": false,
|
|
544
|
+
"docs": {
|
|
545
|
+
"tags": [{
|
|
546
|
+
"name": "since",
|
|
547
|
+
"text": "1.1.0"
|
|
548
|
+
}],
|
|
549
|
+
"text": "Text of date select button"
|
|
550
|
+
},
|
|
551
|
+
"attribute": "text-select-date",
|
|
552
|
+
"reflect": false,
|
|
553
|
+
"defaultValue": "'Done'"
|
|
319
554
|
}
|
|
320
555
|
}; }
|
|
321
556
|
static get states() { return {
|
|
322
|
-
"
|
|
323
|
-
"month": {},
|
|
324
|
-
"calendar": {},
|
|
557
|
+
"yearValue": {},
|
|
325
558
|
"today": {},
|
|
559
|
+
"monthValue": {},
|
|
560
|
+
"calendar": {},
|
|
326
561
|
"years": {},
|
|
327
562
|
"tempYear": {},
|
|
328
563
|
"tempMonth": {},
|
|
@@ -338,13 +573,44 @@ export class DatePicker {
|
|
|
338
573
|
"cancelable": true,
|
|
339
574
|
"composed": true,
|
|
340
575
|
"docs": {
|
|
341
|
-
"tags": [
|
|
342
|
-
|
|
576
|
+
"tags": [{
|
|
577
|
+
"name": "depracted",
|
|
578
|
+
"text": "String output will be removed. Set \u00B4doneEventDelimiter\u00B4 to undefined or null to get date change object instead of a string"
|
|
579
|
+
}],
|
|
580
|
+
"text": "Date change event\n\nIf datepicker is in range mode the event detail will be sperated with a `-` e.g.\n`2022/10/22 - 2022/10/24` (start and end). If range mode is choosen consider to use `dateRangeChange`."
|
|
343
581
|
},
|
|
344
582
|
"complexType": {
|
|
345
|
-
"original": "
|
|
346
|
-
"resolved": "string",
|
|
347
|
-
"references": {
|
|
583
|
+
"original": "LegacyDateChangeEvent",
|
|
584
|
+
"resolved": "DateChangeEvent | string",
|
|
585
|
+
"references": {
|
|
586
|
+
"LegacyDateChangeEvent": {
|
|
587
|
+
"location": "import",
|
|
588
|
+
"path": "./events"
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}, {
|
|
593
|
+
"method": "dateRangeChange",
|
|
594
|
+
"name": "dateRangeChange",
|
|
595
|
+
"bubbles": true,
|
|
596
|
+
"cancelable": true,
|
|
597
|
+
"composed": true,
|
|
598
|
+
"docs": {
|
|
599
|
+
"tags": [{
|
|
600
|
+
"name": "since",
|
|
601
|
+
"text": "1.1.0"
|
|
602
|
+
}],
|
|
603
|
+
"text": "Date range change.\nOnly triggered if datepicker is in range mode"
|
|
604
|
+
},
|
|
605
|
+
"complexType": {
|
|
606
|
+
"original": "DateChangeEvent",
|
|
607
|
+
"resolved": "DateChangeEvent",
|
|
608
|
+
"references": {
|
|
609
|
+
"DateChangeEvent": {
|
|
610
|
+
"location": "import",
|
|
611
|
+
"path": "./events"
|
|
612
|
+
}
|
|
613
|
+
}
|
|
348
614
|
}
|
|
349
615
|
}, {
|
|
350
616
|
"method": "done",
|
|
@@ -353,13 +619,61 @@ export class DatePicker {
|
|
|
353
619
|
"cancelable": true,
|
|
354
620
|
"composed": true,
|
|
355
621
|
"docs": {
|
|
356
|
-
"tags": [
|
|
357
|
-
|
|
622
|
+
"tags": [{
|
|
623
|
+
"name": "deprecated",
|
|
624
|
+
"text": "Use `dateSelect`"
|
|
625
|
+
}],
|
|
626
|
+
"text": "Date selection confirmed via button action"
|
|
358
627
|
},
|
|
359
628
|
"complexType": {
|
|
360
629
|
"original": "string",
|
|
361
630
|
"resolved": "string",
|
|
362
631
|
"references": {}
|
|
363
632
|
}
|
|
633
|
+
}, {
|
|
634
|
+
"method": "dateSelect",
|
|
635
|
+
"name": "dateSelect",
|
|
636
|
+
"bubbles": true,
|
|
637
|
+
"cancelable": true,
|
|
638
|
+
"composed": true,
|
|
639
|
+
"docs": {
|
|
640
|
+
"tags": [{
|
|
641
|
+
"name": "since",
|
|
642
|
+
"text": "1.1.0"
|
|
643
|
+
}],
|
|
644
|
+
"text": "Date selection confirmed via button action"
|
|
645
|
+
},
|
|
646
|
+
"complexType": {
|
|
647
|
+
"original": "DateChangeEvent",
|
|
648
|
+
"resolved": "DateChangeEvent",
|
|
649
|
+
"references": {
|
|
650
|
+
"DateChangeEvent": {
|
|
651
|
+
"location": "import",
|
|
652
|
+
"path": "./events"
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
364
656
|
}]; }
|
|
657
|
+
static get methods() { return {
|
|
658
|
+
"getCurrentDate": {
|
|
659
|
+
"complexType": {
|
|
660
|
+
"signature": "() => Promise<{ start: DateTime; end: DateTime; }>",
|
|
661
|
+
"parameters": [],
|
|
662
|
+
"references": {
|
|
663
|
+
"Promise": {
|
|
664
|
+
"location": "global"
|
|
665
|
+
},
|
|
666
|
+
"DateTime": {
|
|
667
|
+
"location": "import",
|
|
668
|
+
"path": "luxon"
|
|
669
|
+
}
|
|
670
|
+
},
|
|
671
|
+
"return": "Promise<{ start: DateTime; end: DateTime; }>"
|
|
672
|
+
},
|
|
673
|
+
"docs": {
|
|
674
|
+
"text": "Get the current DateTime",
|
|
675
|
+
"tags": []
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
}; }
|
|
365
679
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -26,15 +26,17 @@
|
|
|
26
26
|
border-radius: unset;
|
|
27
27
|
}
|
|
28
28
|
.card.individual {
|
|
29
|
-
box-shadow: 0 0 2px 0
|
|
29
|
+
box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.1), 0 4px 8px 0 rgba(0, 0, 0, 0.1), 0 12px 18px 0px rgba(0, 0, 0, 0.1);
|
|
30
30
|
border: 1px solid var(--theme-menu--border-color);
|
|
31
31
|
border-radius: 4px;
|
|
32
32
|
}
|
|
33
33
|
.card.left {
|
|
34
34
|
border-radius: 4px 0 0 4px;
|
|
35
|
+
height: 100%;
|
|
35
36
|
}
|
|
36
37
|
.card.right {
|
|
37
38
|
border-radius: 0 4px 4px 0;
|
|
39
|
+
height: 100%;
|
|
38
40
|
}
|
|
39
41
|
.card .header {
|
|
40
42
|
padding: 1rem;
|
|
@@ -19,17 +19,26 @@
|
|
|
19
19
|
/* Line heights */
|
|
20
20
|
/* Animation timings */
|
|
21
21
|
:host {
|
|
22
|
+
display: block;
|
|
22
23
|
background-color: var(--theme-menu--background);
|
|
23
|
-
box-shadow: 0 0 2px 0 var(--theme-input--border-color-bottom--disabled), 0 4px 8px 0 var(--theme-input--border-color-bottom--disabled), 0 12px 18px 0px var(--theme-input--border-color-bottom--disabled);
|
|
24
24
|
border-radius: 4px;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.flex {
|
|
28
28
|
display: flex;
|
|
29
|
+
justify-content: center;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
.done {
|
|
32
|
-
display: flex;
|
|
33
|
+
display: inline-flex;
|
|
33
34
|
justify-content: flex-end;
|
|
34
|
-
|
|
35
|
+
padding: 1rem;
|
|
36
|
+
width: 100%;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.separator {
|
|
40
|
+
border: 1px solid var(--theme-datepicker-separator--background);
|
|
41
|
+
width: 100%;
|
|
42
|
+
margin-top: 72px;
|
|
43
|
+
height: 1px;
|
|
35
44
|
}
|