@aurodesignsystem-dev/auro-formkit 0.0.0-pr1460.2 → 0.0.0-pr1464.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/components/checkbox/demo/api.html +4 -26
- package/components/checkbox/demo/getting-started.md +5 -6
- package/components/checkbox/demo/index.min.js +1 -1
- package/components/checkbox/dist/index.js +1 -1
- package/components/checkbox/dist/registered.js +1 -1
- package/components/combobox/demo/api.html +4 -25
- package/components/combobox/demo/getting-started.md +76 -27
- package/components/combobox/demo/index.min.js +15 -1
- package/components/combobox/demo/registered.min.js +1517 -1509
- package/components/combobox/dist/auro-combobox.d.ts +1 -1
- package/components/combobox/dist/index.js +18 -11
- package/components/combobox/dist/registered.js +18 -11
- package/components/counter/demo/api.html +5 -29
- package/components/counter/demo/getting-started.md +4 -3
- package/components/counter/demo/index.min.js +8392 -1
- package/components/counter/dist/index.js +53 -5284
- package/components/counter/dist/registered.js +106 -5110
- package/components/datepicker/demo/accessibility.html +0 -1
- package/components/datepicker/demo/api.html +4 -29
- package/components/datepicker/demo/getting-started.md +25 -2
- package/components/datepicker/demo/index.min.js +24612 -1
- package/components/datepicker/demo/readme.html +2 -10
- package/components/datepicker/dist/index.js +10 -10
- package/components/datepicker/dist/registered.js +10 -10
- package/components/dropdown/demo/api.html +5 -31
- package/components/dropdown/demo/getting-started.md +34 -2
- package/components/dropdown/demo/index.min.js +5097 -1
- package/components/dropdown/dist/index.js +1 -1
- package/components/dropdown/dist/registered.js +1 -1
- package/components/form/demo/api.html +5 -27
- package/components/form/demo/getting-started.md +5 -6
- package/components/form/demo/index.min.js +719 -2
- package/components/form/demo/keyboard-behavior.md +38 -0
- package/components/form/demo/pages.json +1 -1
- package/components/form/demo/registerDemoDeps.min.js +11842 -60908
- package/components/input/demo/accessibility.md +1 -1
- package/components/input/demo/api.html +15 -26
- package/components/input/demo/auro-input.min.js +1 -1
- package/components/input/demo/getting-started.md +1 -1
- package/components/input/demo/readme.html +2 -10
- package/components/input/dist/index.js +1 -1
- package/components/input/dist/registered.js +1 -1
- package/components/menu/demo/api.html +5 -30
- package/components/menu/demo/api.md +1 -1
- package/components/menu/demo/getting-started.md +1 -1
- package/components/menu/demo/index.min.js +1574 -1573
- package/components/menu/dist/auro-menu.context.d.ts +0 -1
- package/components/menu/dist/auro-menu.d.ts +1 -1
- package/components/menu/dist/index.js +1609 -1608
- package/components/menu/dist/registered.js +1553 -1552
- package/components/radio/demo/api.html +7 -28
- package/components/radio/demo/getting-started.md +27 -2
- package/components/radio/demo/index.md +1 -3
- package/components/radio/demo/index.min.js +1 -1
- package/components/radio/demo/readme.md +0 -2
- package/components/radio/dist/index.js +1 -1
- package/components/radio/dist/registered.js +1 -1
- package/components/select/demo/api.html +5 -42
- package/components/select/demo/getting-started.md +39 -5
- package/components/select/demo/registered.min.js +1503 -1502
- package/components/select/dist/index.js +2 -2
- package/components/select/dist/registered.js +2 -2
- package/custom-elements.json +1487 -1489
- package/package.json +37 -4
- package/components/combobox/demo/api.js +0 -39
- package/components/combobox/demo/api.min.js +0 -106
- package/components/combobox/demo/install.html +0 -50
- package/components/combobox/demo/styles.css +0 -974
- package/components/combobox/demo/swap-value.min.js +0 -16
- package/components/counter/demo/api.js +0 -24
- package/components/counter/demo/api.min.js +0 -52
- package/components/counter/demo/auro-counter-group.min.js +0 -8394
- package/components/datepicker/demo/api.js +0 -37
- package/components/datepicker/demo/api.min.js +0 -300
- package/components/datepicker/demo/auro-datepicker.min.js +0 -24614
- package/components/dropdown/demo/api.js +0 -26
- package/components/dropdown/demo/api.min.js +0 -109
- package/components/dropdown/demo/auro-dropdown.min.js +0 -5099
- package/components/form/demo/api.js +0 -5
- package/components/form/demo/api.min.js +0 -5
- package/components/form/demo/auro-form.min.js +0 -718
- package/components/form/demo/autocomplete.html +0 -31
- package/components/radio/demo/api.js +0 -19
- package/components/radio/demo/api.min.js +0 -44
- package/components/select/demo/keyboardBehavior.html +0 -48
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { alertValueExample } from './../apiExamples/alert-value';
|
|
2
|
-
import { errorExample } from './../apiExamples/error';
|
|
3
|
-
import { focusExample } from './../apiExamples/focus';
|
|
4
|
-
import { populateSlotContentExample } from './../apiExamples/dynamic-slot';
|
|
5
|
-
import { updateMaxDateExample } from './../apiExamples/update-max-date';
|
|
6
|
-
import { updateMinDateExample } from './../apiExamples/update-min-date';
|
|
7
|
-
import { validityExample } from './../apiExamples/validity';
|
|
8
|
-
import { inDialogExample } from '../apiExamples/in-dialog';
|
|
9
|
-
import { inDrawerExample } from '../apiExamples/in-drawer';
|
|
10
|
-
import { localizationExample } from '../apiExamples/localization';
|
|
11
|
-
import { resetStateExample } from '../apiExamples/reset-state';
|
|
12
|
-
import '../src/registered.js';
|
|
13
|
-
|
|
14
|
-
export function initExamples(initCount) {
|
|
15
|
-
initCount = initCount || 0;
|
|
16
|
-
|
|
17
|
-
try {
|
|
18
|
-
alertValueExample();
|
|
19
|
-
errorExample();
|
|
20
|
-
focusExample();
|
|
21
|
-
populateSlotContentExample();
|
|
22
|
-
updateMaxDateExample();
|
|
23
|
-
updateMinDateExample();
|
|
24
|
-
validityExample();
|
|
25
|
-
inDialogExample();
|
|
26
|
-
inDrawerExample();
|
|
27
|
-
localizationExample();
|
|
28
|
-
resetStateExample();
|
|
29
|
-
} catch (error) {
|
|
30
|
-
if (initCount <= 20) {
|
|
31
|
-
// setTimeout handles issue where content is sometimes loaded after the functions get called
|
|
32
|
-
setTimeout(() => {
|
|
33
|
-
initExamples(initCount + 1);
|
|
34
|
-
}, 100);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
import { A as AuroDatePicker } from './auro-datepicker.min.js';
|
|
2
|
-
|
|
3
|
-
function alertValueExample() {
|
|
4
|
-
const valueAlertExample = document.querySelector('#datePickerValueAlert');
|
|
5
|
-
|
|
6
|
-
valueAlertExample.addEventListener('auroDatePicker-valueSet', () => {
|
|
7
|
-
console.warn('Select value changed to:', valueAlertExample.value);
|
|
8
|
-
alert(`Select value changed to: ${valueAlertExample.value}`);
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function errorExample() {
|
|
13
|
-
const errorExample = document.querySelector('#errorExample');
|
|
14
|
-
|
|
15
|
-
document.querySelector('#undefinedValueExampleBtnAddError').addEventListener('click', () => {
|
|
16
|
-
errorExample.error = 'Custom New Error';
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
document.querySelector('#undefinedValueExampleBtnRemoveError').addEventListener('click', () => {
|
|
20
|
-
errorExample.removeAttribute('error');
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function focusExample() {
|
|
25
|
-
const focusExampleElem = document.querySelector('#focusExampleElem');
|
|
26
|
-
const focusExampleBtn = document.querySelector('#focusExampleBtn');
|
|
27
|
-
const focusExampleBtnTwo = document.querySelector('#focusExampleBtnTwo');
|
|
28
|
-
|
|
29
|
-
focusExampleBtn.addEventListener('click', () => {
|
|
30
|
-
focusExampleElem.focus();
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
focusExampleBtnTwo.addEventListener('click', () => {
|
|
34
|
-
focusExampleElem.focus('endDate');
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function populateSlotContentExample() {
|
|
39
|
-
const populateSlotContentExample = document.querySelector('#slotContentExample');
|
|
40
|
-
|
|
41
|
-
// Insert slot content when the datepicker has been opened
|
|
42
|
-
populateSlotContentExample.addEventListener('auroDatePicker-toggled', (event) => {
|
|
43
|
-
if (event.detail.expanded) {
|
|
44
|
-
// Array of object(s) containing key, value pairs defining what slot content to render
|
|
45
|
-
const data = [
|
|
46
|
-
{slot: 'date', month: 12, day: 1, year: 2023, content: 'Sold'},
|
|
47
|
-
{slot: 'date', month: 12, day: 2, year: 2023, content: 'Sold'},
|
|
48
|
-
{slot: 'date', month: 12, day: 3, year: 2023, content: 'Sold'},
|
|
49
|
-
{slot: 'date', month: 12, day: 4, year: 2023, content: 'Sold'},
|
|
50
|
-
{slot: 'date', month: 12, day: 5, year: 2023, content: 'Sold'},
|
|
51
|
-
{slot: 'date', month: 12, day: 6, year: 2023, content: 'Sold'},
|
|
52
|
-
{slot: 'date', month: 12, day: 7, year: 2023, content: 'Sold'},
|
|
53
|
-
{slot: 'date', month: 12, day: 8, year: 2023, content: 'Sold'},
|
|
54
|
-
{slot: 'date', month: 12, day: 9, year: 2023, content: 'Sold'},
|
|
55
|
-
{slot: 'date', month: 12, day: 10, year: 2023, content: 'Sold'},
|
|
56
|
-
{slot: 'date', month: 12, day: 11, year: 2023, content: 'Sold'},
|
|
57
|
-
{slot: 'date', month: 12, day: 12, year: 2023, content: 'Sold'},
|
|
58
|
-
{slot: 'date', month: 12, day: 13, year: 2023, content: '$560'},
|
|
59
|
-
{slot: 'date', month: 12, day: 14, year: 2023, content: '$89', highlight: true},
|
|
60
|
-
{slot: 'date', month: 12, day: 15, year: 2023, content: '$100'},
|
|
61
|
-
{slot: 'date', month: 12, day: 16, year: 2023, content: '$2345'},
|
|
62
|
-
{slot: 'date', month: 12, day: 17, year: 2023, content: '$2345'},
|
|
63
|
-
{slot: 'date', month: 12, day: 18, year: 2023, content: '$2345'},
|
|
64
|
-
{slot: 'date', month: 12, day: 19, year: 2023, content: '$2345'},
|
|
65
|
-
{slot: 'date', month: 12, day: 20, year: 2023, content: '$2345'},
|
|
66
|
-
{slot: 'date', month: 12, day: 21, year: 2023, content: '$2345'},
|
|
67
|
-
{slot: 'date', month: 12, day: 22, year: 2023, content: '$2345'},
|
|
68
|
-
{slot: 'date', month: 12, day: 23, year: 2023, content: '$2345'},
|
|
69
|
-
{slot: 'date', month: 12, day: 24, year: 2023, content: '$2345'},
|
|
70
|
-
{slot: 'date', month: 12, day: 25, year: 2023, content: '$2345'},
|
|
71
|
-
{slot: 'date', month: 12, day: 26, year: 2023, content: '$2345'},
|
|
72
|
-
{slot: 'date', month: 12, day: 27, year: 2023, content: '$2345'},
|
|
73
|
-
{slot: 'date', month: 12, day: 28, year: 2023, content: '$2345'},
|
|
74
|
-
{slot: 'date', month: 12, day: 29, year: 2023, content: '$2345'},
|
|
75
|
-
{slot: 'date', month: 12, day: 30, year: 2023, content: '$2345'},
|
|
76
|
-
{slot: 'date', month: 12, day: 31, year: 2023, content: '$2345'},
|
|
77
|
-
{slot: 'date', month: 1, day: 14, year: 2024, content: '$83', highlight: true},
|
|
78
|
-
{slot: 'date', month: 1, day: 15, year: 2024, content: '$203'},
|
|
79
|
-
{slot: 'date', month: 1, day: 16, year: 2024, content: '$4444'},
|
|
80
|
-
{slot: 'date', month: 1, day: 17, year: 2024, content: '$83', highlight: true},
|
|
81
|
-
{slot: 'date', month: 1, day: 18, year: 2024, content: '$96', highlight: true},
|
|
82
|
-
{slot: 'date', month: 1, day: 19, year: 2024, content: 'Sold'},
|
|
83
|
-
{slot: 'date', month: 1, day: 20, year: 2024, content: 'Sold'},
|
|
84
|
-
{slot: 'popover', month: 12, day: 1, year: 2023, content: 'Tickets for this date are sold out'},
|
|
85
|
-
{slot: 'popover', month: 12, day: 2, year: 2023, content: 'Tickets for this date are sold out'},
|
|
86
|
-
{slot: 'popover', month: 12, day: 3, year: 2023, content: 'Tickets for this date are sold out'},
|
|
87
|
-
{slot: 'popover', month: 12, day: 4, year: 2023, content: 'Tickets for this date are sold out'},
|
|
88
|
-
{slot: 'popover', month: 12, day: 5, year: 2023, content: 'Tickets for this date are sold out'},
|
|
89
|
-
{slot: 'popover', month: 12, day: 6, year: 2023, content: 'Tickets for this date are sold out'},
|
|
90
|
-
{slot: 'popover', month: 12, day: 7, year: 2023, content: 'Tickets for this date are sold out'},
|
|
91
|
-
{slot: 'popover', month: 12, day: 8, year: 2023, content: 'Tickets for this date are sold out'},
|
|
92
|
-
{slot: 'popover', month: 12, day: 9, year: 2023, content: 'Tickets for this date are sold out'},
|
|
93
|
-
{slot: 'popover', month: 12, day: 10, year: 2023, content: 'Tickets for this date are sold out'},
|
|
94
|
-
{slot: 'popover', month: 12, day: 11, year: 2023, content: 'Tickets for this date are sold out'},
|
|
95
|
-
{slot: 'popover', month: 12, day: 12, year: 2023, content: 'Tickets for this date are sold out'},
|
|
96
|
-
{slot: 'popover', month: 12, day: 13, year: 2023, content: 'Tickets for this date are $560'},
|
|
97
|
-
{slot: 'popover', month: 12, day: 14, year: 2023, content: 'Tickets for this date are $89'},
|
|
98
|
-
{slot: 'popover', month: 12, day: 15, year: 2023, content: 'Tickets for this date are $100'},
|
|
99
|
-
{slot: 'popover', month: 12, day: 16, year: 2023, content: 'Tickets for this date are $2345'},
|
|
100
|
-
{slot: 'popover', month: 12, day: 17, year: 2023, content: 'Tickets for this date are $2345'},
|
|
101
|
-
{slot: 'popover', month: 12, day: 18, year: 2023, content: 'Tickets for this date are $2345'},
|
|
102
|
-
{slot: 'popover', month: 12, day: 19, year: 2023, content: 'Tickets for this date are $2345'},
|
|
103
|
-
{slot: 'popover', month: 12, day: 20, year: 2023, content: 'Tickets for this date are $2345'},
|
|
104
|
-
{slot: 'popover', month: 12, day: 21, year: 2023, content: 'Tickets for this date are $2345'},
|
|
105
|
-
{slot: 'popover', month: 12, day: 22, year: 2023, content: 'Tickets for this date are $2345'},
|
|
106
|
-
{slot: 'popover', month: 12, day: 23, year: 2023, content: 'Tickets for this date are $2345'},
|
|
107
|
-
{slot: 'popover', month: 12, day: 24, year: 2023, content: 'Tickets for this date are $2345'},
|
|
108
|
-
{slot: 'popover', month: 12, day: 25, year: 2023, content: 'Tickets for this date are $2345'},
|
|
109
|
-
{slot: 'popover', month: 12, day: 26, year: 2023, content: 'Tickets for this date are $2345'},
|
|
110
|
-
{slot: 'popover', month: 12, day: 27, year: 2023, content: 'Tickets for this date are $2345'},
|
|
111
|
-
{slot: 'popover', month: 12, day: 28, year: 2023, content: 'Tickets for this date are $2345'},
|
|
112
|
-
{slot: 'popover', month: 12, day: 29, year: 2023, content: 'Tickets for this date are $2345'},
|
|
113
|
-
{slot: 'popover', month: 12, day: 30, year: 2023, content: 'Tickets for this date are $2345'},
|
|
114
|
-
{slot: 'popover', month: 12, day: 31, year: 2023, content: 'Tickets for this date are $2345'},
|
|
115
|
-
{slot: 'popover', month: 1, day: 14, year: 2024, content: 'Tickets for this date are $83'},
|
|
116
|
-
{slot: 'popover', month: 1, day: 15, year: 2024, content: 'Tickets for this date are $203'},
|
|
117
|
-
{slot: 'popover', month: 1, day: 16, year: 2024, content: 'Tickets for this date are $4444'},
|
|
118
|
-
{slot: 'popover', month: 1, day: 17, year: 2024, content: 'Tickets for this date are $83'},
|
|
119
|
-
{slot: 'popover', month: 1, day: 18, year: 2024, content: 'Tickets for this date are $96'},
|
|
120
|
-
{slot: 'popover', month: 1, day: 19, year: 2024, content: 'Tickets for this date are sold out'},
|
|
121
|
-
{slot: 'popover', month: 1, day: 20, year: 2024, content: 'Tickets for this date are sold out'}
|
|
122
|
-
];
|
|
123
|
-
|
|
124
|
-
// For each item in the array, parse the keys into an HTML element and insert it into the DOM
|
|
125
|
-
data.forEach((item) => {
|
|
126
|
-
// Create the new element for the slot content
|
|
127
|
-
const slotElement = document.createElement('span');
|
|
128
|
-
|
|
129
|
-
if (item.month.toString().length === 1) {
|
|
130
|
-
item.month = `0` + item.month;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (item.day.toString().length === 1) {
|
|
134
|
-
item.day = `0` + item.day;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// Create the slot name from the item's keys
|
|
138
|
-
const slotName = `${item.slot}_${item.month}_${item.day}_${item.year}`;
|
|
139
|
-
|
|
140
|
-
// Set the slot name and content
|
|
141
|
-
slotElement.setAttribute('slot', slotName);
|
|
142
|
-
slotElement.textContent = item.content;
|
|
143
|
-
|
|
144
|
-
// Set the 'highlight' attribute on date slot content
|
|
145
|
-
if (item.slot === 'date' && item.highlight) {
|
|
146
|
-
slotElement.setAttribute('highlight', item.highlight);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// Append the new element to the DOM
|
|
150
|
-
populateSlotContentExample.appendChild(slotElement);
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
populateSlotContentExample.pushSlotContent();
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function formatDateString$1(date) {
|
|
159
|
-
/* eslint-disable prefer-template, no-magic-numbers */
|
|
160
|
-
const dd = String("0" + date.getDate()).slice(-2);
|
|
161
|
-
const mm = String("0" + (date.getMonth() + 1)).slice(-2);
|
|
162
|
-
/* eslint-enable prefer-template, no-magic-numbers */
|
|
163
|
-
const yyyy = date.getFullYear();
|
|
164
|
-
|
|
165
|
-
return `${mm}/${dd}/${yyyy}`;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function updateMaxDateExample() {
|
|
169
|
-
const maxDateExample = document.getElementById('maxDateExample');
|
|
170
|
-
const changeMaxDateButton = document.getElementById('maxDateChange');
|
|
171
|
-
const resetButton = document.getElementById('resetMaxDate');
|
|
172
|
-
|
|
173
|
-
const today = formatDateString$1(new Date());
|
|
174
|
-
|
|
175
|
-
let nextWeek = new Date();
|
|
176
|
-
let addOneWeek = nextWeek.getDate() + 7;
|
|
177
|
-
|
|
178
|
-
nextWeek.setDate(addOneWeek);
|
|
179
|
-
nextWeek = formatDateString$1(nextWeek);
|
|
180
|
-
|
|
181
|
-
maxDateExample.setAttribute('value', nextWeek);
|
|
182
|
-
maxDateExample.setAttribute('maxDate', nextWeek);
|
|
183
|
-
|
|
184
|
-
changeMaxDateButton.addEventListener('click', () => {
|
|
185
|
-
maxDateExample.setAttribute('maxDate', today);
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
resetButton.addEventListener('click', () => {
|
|
189
|
-
maxDateExample.setAttribute('value', nextWeek);
|
|
190
|
-
maxDateExample.setAttribute('maxDate', nextWeek);
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function formatDateString(date) {
|
|
195
|
-
/* eslint-disable prefer-template, no-magic-numbers */
|
|
196
|
-
const dd = String("0" + date.getDate()).slice(-2);
|
|
197
|
-
const mm = String("0" + (date.getMonth() + 1)).slice(-2);
|
|
198
|
-
/* eslint-enable prefer-template, no-magic-numbers */
|
|
199
|
-
const yyyy = date.getFullYear();
|
|
200
|
-
|
|
201
|
-
return `${mm}/${dd}/${yyyy}`;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
function updateMinDateExample() {
|
|
205
|
-
const minDateExample = document.getElementById('minDateExample');
|
|
206
|
-
const changeMinDateButton = document.getElementById('minDateChange');
|
|
207
|
-
const resetButton = document.getElementById('resetMinDate');
|
|
208
|
-
|
|
209
|
-
const today = formatDateString(new Date());
|
|
210
|
-
|
|
211
|
-
let nextWeek = new Date();
|
|
212
|
-
let addOneWeek = nextWeek.getDate() + 7;
|
|
213
|
-
|
|
214
|
-
nextWeek.setDate(addOneWeek);
|
|
215
|
-
nextWeek = formatDateString(nextWeek);
|
|
216
|
-
|
|
217
|
-
minDateExample.setAttribute('value', today);
|
|
218
|
-
minDateExample.setAttribute('minDate', today);
|
|
219
|
-
|
|
220
|
-
changeMinDateButton.addEventListener('click', () => {
|
|
221
|
-
minDateExample.setAttribute('minDate', nextWeek);
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
resetButton.addEventListener('click', () => {
|
|
225
|
-
minDateExample.setAttribute('value', today);
|
|
226
|
-
minDateExample.setAttribute('minDate', today);
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
function validityExample() {
|
|
232
|
-
const validityExampleExample = document.querySelector('#validityExample');
|
|
233
|
-
const validityExampleExampleBtn = document.querySelector('#validityExampleBtn');
|
|
234
|
-
|
|
235
|
-
validityExampleExampleBtn.addEventListener('click', () => {
|
|
236
|
-
console.warn('Validity set to:', validityExampleExample.validity);
|
|
237
|
-
alert(`Validity set to: ${validityExampleExample.validity}`);
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
function inDialogExample() {
|
|
242
|
-
document.querySelector("#datepicker-dialog-opener").addEventListener("click", () => {
|
|
243
|
-
const dialog = document.querySelector("#datepicker-dialog");
|
|
244
|
-
dialog.open = true;
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
function inDrawerExample() {
|
|
249
|
-
document.querySelector("#datepicker-drawer-opener").addEventListener("click", () => {
|
|
250
|
-
const drawer = document.querySelector("#datepicker-drawer");
|
|
251
|
-
if (drawer.hasAttribute('open')) {
|
|
252
|
-
drawer.removeAttribute('open');
|
|
253
|
-
} else {
|
|
254
|
-
drawer.setAttribute('open', true);
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
function localizationExample() {
|
|
260
|
-
const localizedDatepicker = document.querySelector("#localizationExample");
|
|
261
|
-
|
|
262
|
-
localizedDatepicker.monthNames = ['일월', '이월', '삼월', '사월', '오월', '유월', '칠월', '팔월', '구월', '시월', '십일월', '십이월'];
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
function resetStateExample() {
|
|
266
|
-
const elem = document.querySelector('#resetStateExample');
|
|
267
|
-
|
|
268
|
-
document.querySelector('#resetStateBtn').addEventListener('click', () => {
|
|
269
|
-
elem.reset();
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
AuroDatePicker.register();
|
|
274
|
-
|
|
275
|
-
function initExamples(initCount) {
|
|
276
|
-
initCount = initCount || 0;
|
|
277
|
-
|
|
278
|
-
try {
|
|
279
|
-
alertValueExample();
|
|
280
|
-
errorExample();
|
|
281
|
-
focusExample();
|
|
282
|
-
populateSlotContentExample();
|
|
283
|
-
updateMaxDateExample();
|
|
284
|
-
updateMinDateExample();
|
|
285
|
-
validityExample();
|
|
286
|
-
inDialogExample();
|
|
287
|
-
inDrawerExample();
|
|
288
|
-
localizationExample();
|
|
289
|
-
resetStateExample();
|
|
290
|
-
} catch (error) {
|
|
291
|
-
if (initCount <= 20) {
|
|
292
|
-
// setTimeout handles issue where content is sometimes loaded after the functions get called
|
|
293
|
-
setTimeout(() => {
|
|
294
|
-
initExamples(initCount + 1);
|
|
295
|
-
}, 100);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
export { initExamples };
|