tyrell-components 1.0.0-TC52 → 1.0.0-TC53
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/css/tyrell-theme.css +25 -2
- package/css/tyrell.css +4 -0
- package/dist/tyrell-colors-static.css +1 -316
- package/dist/tyrell-theme.css +1 -1443
- package/dist/tyrell.css +1 -1390
- package/dist/tyrell.js +1 -1
- package/lib/base/ty-component.js +196 -196
- package/lib/components/button.d.ts +1 -1
- package/lib/components/button.js +260 -259
- package/lib/components/calendar-month.d.ts +2 -2
- package/lib/components/calendar-month.js +426 -416
- package/lib/components/calendar-navigation.js +238 -238
- package/lib/components/calendar.js +605 -602
- package/lib/components/checkbox.d.ts +1 -1
- package/lib/components/checkbox.js +273 -272
- package/lib/components/copy.d.ts +1 -1
- package/lib/components/copy.js +279 -278
- package/lib/components/date-picker.d.ts +1 -1
- package/lib/components/date-picker.js +1103 -1108
- package/lib/components/file-upload.js +404 -404
- package/lib/components/icon.js +141 -141
- package/lib/components/input.d.ts +1 -1
- package/lib/components/input.js +593 -596
- package/lib/components/modal.js +319 -319
- package/lib/components/option.js +167 -167
- package/lib/components/popup.js +233 -233
- package/lib/components/radio.d.ts +2 -2
- package/lib/components/radio.js +407 -406
- package/lib/components/resize-observer.js +67 -67
- package/lib/components/scroll-container.js +294 -294
- package/lib/components/select.d.ts +1 -1
- package/lib/components/select.js +1524 -1532
- package/lib/components/selected-tags.js +184 -184
- package/lib/components/step.js +62 -62
- package/lib/components/switch.d.ts +1 -1
- package/lib/components/switch.js +214 -213
- package/lib/components/tab.js +62 -62
- package/lib/components/tabs.js +507 -507
- package/lib/components/tag.d.ts +1 -1
- package/lib/components/tag.js +236 -235
- package/lib/components/textarea.d.ts +1 -1
- package/lib/components/textarea.js +457 -456
- package/lib/components/tooltip.js +283 -283
- package/lib/components/wizard.js +384 -384
- package/lib/icons/heroicons/micro.js +392 -392
- package/lib/icons/heroicons/mini.js +382 -382
- package/lib/icons/heroicons/outline.js +337 -337
- package/lib/icons/heroicons/solid.js +407 -407
- package/lib/icons/lucide.js +22843 -22843
- package/lib/icons/material/filled.js +9653 -9653
- package/lib/icons/material/outlined.js +10271 -10271
- package/lib/icons/material/round.js +10495 -10495
- package/lib/icons/material/sharp.js +9905 -9905
- package/lib/icons/material/two-tone.js +12792 -12792
- package/lib/index.js +21 -21
- package/lib/styles/button.js +176 -288
- package/lib/styles/calendar-month.js +123 -183
- package/lib/styles/calendar-navigation.js +60 -79
- package/lib/styles/calendar.js +8 -9
- package/lib/styles/checkbox.js +45 -72
- package/lib/styles/copy.js +67 -91
- package/lib/styles/custom-scrollbar.js +80 -100
- package/lib/styles/date-picker.js +261 -331
- package/lib/styles/field-size.d.ts +6 -0
- package/lib/styles/field-size.js +91 -0
- package/lib/styles/file-upload.js +139 -169
- package/lib/styles/icon.js +92 -156
- package/lib/styles/input.js +125 -241
- package/lib/styles/modal.js +67 -102
- package/lib/styles/option.d.ts +1 -1
- package/lib/styles/option.js +47 -67
- package/lib/styles/popup.js +34 -65
- package/lib/styles/radio.js +69 -96
- package/lib/styles/resize-observer.js +2 -5
- package/lib/styles/scroll-container.js +100 -130
- package/lib/styles/select-base.js +525 -778
- package/lib/styles/select.js +140 -228
- package/lib/styles/step.js +22 -29
- package/lib/styles/switch.js +34 -55
- package/lib/styles/tab.js +22 -29
- package/lib/styles/tabs.js +171 -252
- package/lib/styles/tag.js +135 -188
- package/lib/styles/textarea.d.ts +1 -1
- package/lib/styles/textarea.js +205 -271
- package/lib/styles/tooltip.js +3 -3
- package/lib/styles/wizard.js +170 -226
- package/lib/types/common.d.ts +2 -0
- package/lib/types/common.js +6 -5
- package/lib/utils/calendar-utils.js +100 -100
- package/lib/utils/custom-scrollbar.js +272 -272
- package/lib/utils/flavor-sheet.js +14 -14
- package/lib/utils/icon-registry.js +127 -127
- package/lib/utils/loader-registry.js +3 -3
- package/lib/utils/locale.js +34 -34
- package/lib/utils/mobile.js +1 -1
- package/lib/utils/number-format.js +54 -54
- package/lib/utils/positioning.js +212 -212
- package/lib/utils/property-capture.js +36 -36
- package/lib/utils/property-manager.js +125 -125
- package/lib/utils/resize-observer.js +23 -23
- package/lib/utils/scroll-lock.js +57 -57
- package/lib/utils/styles.js +17 -17
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +4 -4
package/lib/components/popup.js
CHANGED
|
@@ -9,275 +9,275 @@ const escapeHandlers = new WeakMap();
|
|
|
9
9
|
const closeRequestHandlers = new WeakMap();
|
|
10
10
|
const popupIds = new WeakMap();
|
|
11
11
|
function parseBoolAttr(el, name) {
|
|
12
|
-
|
|
12
|
+
return el.hasAttribute(name);
|
|
13
13
|
}
|
|
14
14
|
function parseIntAttr(el, name, defaultValue) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
const value = el.getAttribute(name);
|
|
16
|
+
if (value === null)
|
|
17
|
+
return defaultValue;
|
|
18
|
+
const parsed = parseInt(value, 10);
|
|
19
|
+
return isNaN(parsed) ? defaultValue : parsed;
|
|
20
20
|
}
|
|
21
21
|
function getPopupAttributes(el) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
return {
|
|
23
|
+
manual: parseBoolAttr(el, 'manual'),
|
|
24
|
+
disableClose: parseBoolAttr(el, 'disable-close'),
|
|
25
|
+
placement: (el.getAttribute('placement') || 'bottom'),
|
|
26
|
+
offset: parseIntAttr(el, 'offset', 8),
|
|
27
|
+
};
|
|
28
28
|
}
|
|
29
29
|
function getAnchorElement(el) {
|
|
30
|
-
|
|
30
|
+
return el.parentElement;
|
|
31
31
|
}
|
|
32
32
|
function getPopupDialog(shadowRoot) {
|
|
33
|
-
|
|
33
|
+
return shadowRoot.querySelector('.popup-dialog');
|
|
34
34
|
}
|
|
35
35
|
function getPopupId(el) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
let id = popupIds.get(el);
|
|
37
|
+
if (!id) {
|
|
38
|
+
id = `popup-${el.id || Math.random().toString(36).substr(2, 9)}`;
|
|
39
|
+
popupIds.set(el, id);
|
|
40
|
+
}
|
|
41
|
+
return id;
|
|
42
42
|
}
|
|
43
43
|
function updatePosition(el) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
44
|
+
const { placement, offset } = getPopupAttributes(el);
|
|
45
|
+
const shadowRoot = el.shadowRoot;
|
|
46
|
+
const anchor = getAnchorElement(el);
|
|
47
|
+
const dialog = shadowRoot ? getPopupDialog(shadowRoot) : null;
|
|
48
|
+
if (!anchor || !dialog)
|
|
49
|
+
return;
|
|
50
|
+
const preferences = preferenceChain(placement);
|
|
51
|
+
const positionData = findBestPosition({
|
|
52
|
+
targetEl: anchor,
|
|
53
|
+
floatingEl: dialog,
|
|
54
|
+
preferences,
|
|
55
|
+
offset,
|
|
56
|
+
padding: 8,
|
|
57
|
+
containerPadding: 16,
|
|
58
|
+
});
|
|
59
|
+
el.style.setProperty('--popup-x', `${positionData.x}px`);
|
|
60
|
+
el.style.setProperty('--popup-y', `${positionData.y}px`);
|
|
61
|
+
dialog.dataset.side = positionData.placement.split('-')[0];
|
|
62
|
+
dialog.classList.add('position-calculated');
|
|
63
63
|
}
|
|
64
64
|
function closePopup(el, force = false) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
65
|
+
const { disableClose } = getPopupAttributes(el);
|
|
66
|
+
if (!force && disableClose)
|
|
67
|
+
return;
|
|
68
|
+
const shadowRoot = el.shadowRoot;
|
|
69
|
+
const dialog = shadowRoot ? getPopupDialog(shadowRoot) : null;
|
|
70
|
+
if (!dialog)
|
|
71
|
+
return;
|
|
72
|
+
dialog.classList.remove('open');
|
|
73
|
+
dialog.classList.remove('preparing-animation');
|
|
74
|
+
const anchor = getAnchorElement(el);
|
|
75
|
+
if (anchor?.hasAttribute('aria-haspopup'))
|
|
76
|
+
anchor.setAttribute('aria-expanded', 'false');
|
|
77
|
+
setTimeout(() => {
|
|
78
|
+
dialog.classList.remove('position-calculated');
|
|
79
|
+
dialog.close();
|
|
80
|
+
}, 200);
|
|
81
81
|
}
|
|
82
82
|
function openPopup(el) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
83
|
+
const popupId = getPopupId(el);
|
|
84
|
+
lockScroll(popupId);
|
|
85
|
+
const shadowRoot = el.shadowRoot;
|
|
86
|
+
const dialog = shadowRoot ? getPopupDialog(shadowRoot) : null;
|
|
87
|
+
if (!dialog)
|
|
88
|
+
return;
|
|
89
|
+
dialog.showModal();
|
|
90
|
+
const anchor = getAnchorElement(el);
|
|
91
|
+
if (anchor?.hasAttribute('aria-haspopup'))
|
|
92
|
+
anchor.setAttribute('aria-expanded', 'true');
|
|
93
|
+
requestAnimationFrame(() => {
|
|
94
|
+
updatePosition(el);
|
|
95
|
+
dialog.classList.add('preparing-animation');
|
|
96
|
+
requestAnimationFrame(() => {
|
|
97
|
+
dialog.classList.add('open');
|
|
98
|
+
el.dispatchEvent(new CustomEvent('open'));
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
101
|
}
|
|
102
102
|
function togglePopup(el) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
103
|
+
const shadowRoot = el.shadowRoot;
|
|
104
|
+
const dialog = shadowRoot ? getPopupDialog(shadowRoot) : null;
|
|
105
|
+
if (!dialog)
|
|
106
|
+
return;
|
|
107
|
+
if (dialog.classList.contains('open')) {
|
|
108
|
+
closePopup(el);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
openPopup(el);
|
|
112
|
+
}
|
|
113
113
|
}
|
|
114
114
|
function handleAnchorClick(el, event) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
event.preventDefault();
|
|
116
|
+
event.stopPropagation();
|
|
117
|
+
togglePopup(el);
|
|
118
118
|
}
|
|
119
119
|
function handleOutsideClick(el, event) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
event.stopPropagation();
|
|
121
|
+
const shadowRoot = el.shadowRoot;
|
|
122
|
+
const dialog = shadowRoot ? getPopupDialog(shadowRoot) : null;
|
|
123
|
+
if (dialog && event.target === dialog) {
|
|
124
|
+
event.preventDefault();
|
|
125
|
+
closePopup(el);
|
|
126
|
+
}
|
|
127
127
|
}
|
|
128
128
|
function handleEscape(el, event) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
129
|
+
event.stopPropagation();
|
|
130
|
+
if (event.key === 'Escape') {
|
|
131
|
+
const { disableClose } = getPopupAttributes(el);
|
|
132
|
+
if (disableClose) {
|
|
133
|
+
event.preventDefault();
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
closePopup(el);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
139
|
}
|
|
140
140
|
function handleCloseRequest(el, event) {
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
event.stopPropagation();
|
|
142
|
+
closePopup(el, true);
|
|
143
143
|
}
|
|
144
144
|
function setupAnchorEvents(el) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
145
|
+
const { manual } = getPopupAttributes(el);
|
|
146
|
+
const anchor = getAnchorElement(el);
|
|
147
|
+
if (!anchor || manual)
|
|
148
|
+
return;
|
|
149
|
+
anchor.setAttribute('aria-haspopup', 'dialog');
|
|
150
|
+
if (!anchor.hasAttribute('aria-expanded'))
|
|
151
|
+
anchor.setAttribute('aria-expanded', 'false');
|
|
152
|
+
const existingHandler = anchorClickHandlers.get(el);
|
|
153
|
+
if (existingHandler) {
|
|
154
|
+
anchor.removeEventListener('pointerdown', existingHandler);
|
|
155
|
+
}
|
|
156
|
+
const existingKeyHandler = anchorKeyClickHandlers.get(el);
|
|
157
|
+
if (existingKeyHandler) {
|
|
158
|
+
anchor.removeEventListener('click', existingKeyHandler);
|
|
159
|
+
}
|
|
160
|
+
const handler = (e) => handleAnchorClick(el, e);
|
|
161
|
+
anchorClickHandlers.set(el, handler);
|
|
162
|
+
anchor.addEventListener('pointerdown', handler);
|
|
163
|
+
const keyHandler = (e) => {
|
|
164
|
+
if (e.detail === 0)
|
|
165
|
+
handleAnchorClick(el, e);
|
|
166
|
+
};
|
|
167
|
+
anchorKeyClickHandlers.set(el, keyHandler);
|
|
168
|
+
anchor.addEventListener('click', keyHandler);
|
|
169
169
|
}
|
|
170
170
|
function cleanupAnchorEvents(el) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
171
|
+
const anchor = getAnchorElement(el);
|
|
172
|
+
const handler = anchorClickHandlers.get(el);
|
|
173
|
+
if (anchor && handler) {
|
|
174
|
+
anchor.removeEventListener('pointerdown', handler);
|
|
175
|
+
anchorClickHandlers.delete(el);
|
|
176
|
+
}
|
|
177
|
+
const keyHandler = anchorKeyClickHandlers.get(el);
|
|
178
|
+
if (anchor && keyHandler) {
|
|
179
|
+
anchor.removeEventListener('click', keyHandler);
|
|
180
|
+
anchorKeyClickHandlers.delete(el);
|
|
181
|
+
}
|
|
182
|
+
anchor?.removeAttribute('aria-haspopup');
|
|
183
|
+
anchor?.removeAttribute('aria-expanded');
|
|
184
184
|
}
|
|
185
185
|
function render(el) {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
186
|
+
const shadowRoot = el.shadowRoot;
|
|
187
|
+
if (!shadowRoot)
|
|
188
|
+
return;
|
|
189
|
+
const existingDialog = getPopupDialog(shadowRoot);
|
|
190
|
+
ensureStyles(shadowRoot, { css: popupStyles, id: 'ty-popup' });
|
|
191
|
+
if (!existingDialog) {
|
|
192
|
+
const dialog = document.createElement('dialog');
|
|
193
|
+
const container = document.createElement('div');
|
|
194
|
+
const content = document.createElement('slot');
|
|
195
|
+
dialog.className = 'popup-dialog';
|
|
196
|
+
container.className = 'popup-container';
|
|
197
|
+
content.id = 'popup-content';
|
|
198
|
+
shadowRoot.appendChild(dialog);
|
|
199
|
+
dialog.appendChild(container);
|
|
200
|
+
container.appendChild(content);
|
|
201
|
+
el.style.setProperty('--popup-x', '0px');
|
|
202
|
+
el.style.setProperty('--popup-y', '0px');
|
|
203
|
+
const outsideHandler = (e) => handleOutsideClick(el, e);
|
|
204
|
+
outsideClickHandlers.set(el, outsideHandler);
|
|
205
|
+
dialog.addEventListener('pointerdown', outsideHandler);
|
|
206
|
+
const escapeHandler = (e) => handleEscape(el, e);
|
|
207
|
+
escapeHandlers.set(el, escapeHandler);
|
|
208
|
+
el.addEventListener('keydown', escapeHandler);
|
|
209
|
+
dialog.addEventListener('close', () => {
|
|
210
|
+
const popupId = getPopupId(el);
|
|
211
|
+
unlockScroll(popupId);
|
|
212
|
+
dialog.classList.remove('open');
|
|
213
|
+
dialog.classList.remove('preparing-animation');
|
|
214
|
+
el.dispatchEvent(new CustomEvent('close'));
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
el.closePopup = () => closePopup(el, true);
|
|
218
|
+
el.openPopup = () => openPopup(el);
|
|
219
|
+
el.togglePopup = () => togglePopup(el);
|
|
220
|
+
const closeRequestHandler = (e) => handleCloseRequest(el, e);
|
|
221
|
+
closeRequestHandlers.set(el, closeRequestHandler);
|
|
222
|
+
el.addEventListener('ty:close-popup', closeRequestHandler);
|
|
223
|
+
setupAnchorEvents(el);
|
|
224
224
|
}
|
|
225
225
|
function cleanup(el) {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
226
|
+
const popupId = popupIds.get(el);
|
|
227
|
+
if (popupId) {
|
|
228
|
+
unlockScroll(popupId);
|
|
229
|
+
popupIds.delete(el);
|
|
230
|
+
}
|
|
231
|
+
cleanupAnchorEvents(el);
|
|
232
|
+
const shadowRoot = el.shadowRoot;
|
|
233
|
+
const dialog = shadowRoot ? getPopupDialog(shadowRoot) : null;
|
|
234
|
+
if (dialog) {
|
|
235
|
+
const outsideHandler = outsideClickHandlers.get(el);
|
|
236
|
+
if (outsideHandler) {
|
|
237
|
+
dialog.removeEventListener('pointerdown', outsideHandler);
|
|
238
|
+
outsideClickHandlers.delete(el);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
const escapeHandler = escapeHandlers.get(el);
|
|
242
|
+
if (escapeHandler) {
|
|
243
|
+
el.removeEventListener('keydown', escapeHandler);
|
|
244
|
+
escapeHandlers.delete(el);
|
|
245
|
+
}
|
|
246
|
+
const closeRequestHandler = closeRequestHandlers.get(el);
|
|
247
|
+
if (closeRequestHandler) {
|
|
248
|
+
el.removeEventListener('ty:close-popup', closeRequestHandler);
|
|
249
|
+
closeRequestHandlers.delete(el);
|
|
250
|
+
}
|
|
251
251
|
}
|
|
252
252
|
export class TyPopup extends HTMLElement {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
253
|
+
static get observedAttributes() {
|
|
254
|
+
return ['manual', 'disable-close', 'placement', 'offset'];
|
|
255
|
+
}
|
|
256
|
+
constructor() {
|
|
257
|
+
super();
|
|
258
|
+
this.attachShadow({ mode: 'open' });
|
|
259
|
+
}
|
|
260
|
+
connectedCallback() {
|
|
261
|
+
render(this);
|
|
262
|
+
}
|
|
263
|
+
disconnectedCallback() {
|
|
264
|
+
cleanup(this);
|
|
265
|
+
}
|
|
266
|
+
attributeChangedCallback(name, _oldValue, _newValue) {
|
|
267
|
+
render(this);
|
|
268
|
+
switch (name) {
|
|
269
|
+
case 'placement':
|
|
270
|
+
case 'offset':
|
|
271
|
+
render(this);
|
|
272
|
+
break;
|
|
273
|
+
case 'manual':
|
|
274
|
+
case 'disable-close':
|
|
275
|
+
cleanupAnchorEvents(this);
|
|
276
|
+
setupAnchorEvents(this);
|
|
277
|
+
break;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
280
|
}
|
|
281
281
|
if (!customElements.get('ty-popup')) {
|
|
282
|
-
|
|
282
|
+
customElements.define('ty-popup', TyPopup);
|
|
283
283
|
}
|
|
@@ -35,7 +35,7 @@ export declare class TyRadio extends TyComponent<RadioState> implements TyRadioE
|
|
|
35
35
|
size: {
|
|
36
36
|
type: "string";
|
|
37
37
|
visual: boolean;
|
|
38
|
-
default:
|
|
38
|
+
default: Size;
|
|
39
39
|
};
|
|
40
40
|
flavor: {
|
|
41
41
|
type: "string";
|
|
@@ -127,7 +127,7 @@ export declare class TyRadioGroup extends TyComponent<RadioGroupState> implement
|
|
|
127
127
|
size: {
|
|
128
128
|
type: "string";
|
|
129
129
|
visual: boolean;
|
|
130
|
-
default:
|
|
130
|
+
default: Size;
|
|
131
131
|
};
|
|
132
132
|
flavor: {
|
|
133
133
|
type: "string";
|