tyrell-components 1.0.0-TC44 → 1.0.0-TC46
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/dist/tyrell.js +1 -1
- package/lib/base/ty-component.d.ts +12 -7
- package/lib/base/ty-component.js +8 -139
- package/lib/components/button.d.ts +2 -16
- package/lib/components/button.js +0 -36
- package/lib/components/calendar-month.d.ts +2 -48
- package/lib/components/calendar-month.js +4 -166
- package/lib/components/calendar-navigation.d.ts +3 -48
- package/lib/components/calendar-navigation.js +3 -126
- package/lib/components/calendar.d.ts +3 -80
- package/lib/components/calendar.js +8 -230
- package/lib/components/checkbox.d.ts +4 -71
- package/lib/components/checkbox.js +7 -151
- package/lib/components/copy.d.ts +3 -56
- package/lib/components/copy.js +1 -120
- package/lib/components/date-picker.d.ts +10 -160
- package/lib/components/date-picker.js +31 -577
- package/lib/components/file-upload.d.ts +3 -15
- package/lib/components/file-upload.js +0 -37
- package/lib/components/icon.d.ts +3 -24
- package/lib/components/icon.js +1 -90
- package/lib/components/input.d.ts +7 -107
- package/lib/components/input.js +4 -193
- package/lib/components/modal.d.ts +3 -26
- package/lib/components/modal.js +1 -188
- package/lib/components/option.d.ts +2 -9
- package/lib/components/option.js +0 -48
- package/lib/components/popup.d.ts +2 -17
- package/lib/components/popup.js +3 -130
- package/lib/components/radio.d.ts +3 -23
- package/lib/components/radio.js +0 -63
- package/lib/components/resize-observer.d.ts +2 -30
- package/lib/components/resize-observer.js +0 -45
- package/lib/components/scroll-container.d.ts +2 -12
- package/lib/components/scroll-container.js +3 -46
- package/lib/components/select.d.ts +43 -150
- package/lib/components/select.js +68 -558
- package/lib/components/selected-tags.d.ts +4 -47
- package/lib/components/selected-tags.js +0 -94
- package/lib/components/step.d.ts +1 -6
- package/lib/components/step.js +0 -6
- package/lib/components/switch.d.ts +0 -11
- package/lib/components/switch.js +2 -36
- package/lib/components/tab.d.ts +1 -6
- package/lib/components/tab.js +0 -7
- package/lib/components/tabs.d.ts +3 -63
- package/lib/components/tabs.js +2 -282
- package/lib/components/tag.d.ts +2 -36
- package/lib/components/tag.js +5 -105
- package/lib/components/textarea.d.ts +6 -86
- package/lib/components/textarea.js +2 -173
- package/lib/components/tooltip.d.ts +3 -11
- package/lib/components/tooltip.js +0 -154
- package/lib/components/wizard.d.ts +4 -54
- package/lib/components/wizard.js +0 -228
- package/lib/icons/fontawesome/brands.d.ts +0 -1
- package/lib/icons/fontawesome/brands.js +0 -8
- package/lib/icons/fontawesome/regular.d.ts +0 -1
- package/lib/icons/fontawesome/regular.js +0 -8
- package/lib/icons/fontawesome/solid.d.ts +0 -1
- package/lib/icons/fontawesome/solid.js +0 -8
- package/lib/icons/heroicons/micro.d.ts +0 -1
- package/lib/icons/heroicons/micro.js +0 -8
- package/lib/icons/heroicons/mini.d.ts +0 -1
- package/lib/icons/heroicons/mini.js +0 -8
- package/lib/icons/heroicons/outline.d.ts +0 -1
- package/lib/icons/heroicons/outline.js +0 -8
- package/lib/icons/heroicons/solid.d.ts +0 -1
- package/lib/icons/heroicons/solid.js +0 -8
- package/lib/icons/lucide.d.ts +0 -1
- package/lib/icons/lucide.js +0 -1872
- package/lib/icons/material/filled.d.ts +0 -1
- package/lib/icons/material/filled.js +0 -10
- package/lib/icons/material/outlined.d.ts +0 -1
- package/lib/icons/material/outlined.js +0 -10
- package/lib/icons/material/round.d.ts +0 -1
- package/lib/icons/material/round.js +0 -10
- package/lib/icons/material/sharp.d.ts +0 -1
- package/lib/icons/material/sharp.js +0 -10
- package/lib/icons/material/two-tone.d.ts +0 -1
- package/lib/icons/material/two-tone.js +0 -10
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -20
- package/lib/styles/button.d.ts +2 -20
- package/lib/styles/button.js +13 -120
- package/lib/styles/calendar-month.d.ts +1 -5
- package/lib/styles/calendar-month.js +3 -60
- package/lib/styles/calendar-navigation.d.ts +2 -6
- package/lib/styles/calendar-navigation.js +1 -26
- package/lib/styles/calendar.d.ts +1 -2
- package/lib/styles/calendar.js +0 -13
- package/lib/styles/checkbox.d.ts +0 -1
- package/lib/styles/checkbox.js +1 -23
- package/lib/styles/copy.d.ts +0 -1
- package/lib/styles/copy.js +2 -17
- package/lib/styles/custom-scrollbar.d.ts +1 -2
- package/lib/styles/custom-scrollbar.js +3 -18
- package/lib/styles/date-picker.d.ts +1 -5
- package/lib/styles/date-picker.js +5 -35
- package/lib/styles/file-upload.d.ts +1 -2
- package/lib/styles/file-upload.js +0 -15
- package/lib/styles/icon.d.ts +2 -6
- package/lib/styles/icon.js +1 -26
- package/lib/styles/input.d.ts +1 -6
- package/lib/styles/input.js +3 -53
- package/lib/styles/modal.d.ts +1 -2
- package/lib/styles/modal.js +3 -23
- package/lib/styles/option.d.ts +2 -6
- package/lib/styles/option.js +1 -11
- package/lib/styles/popup.d.ts +1 -2
- package/lib/styles/popup.js +4 -25
- package/lib/styles/radio.d.ts +0 -1
- package/lib/styles/radio.js +1 -15
- package/lib/styles/resize-observer.d.ts +1 -2
- package/lib/styles/resize-observer.js +0 -7
- package/lib/styles/scroll-container.d.ts +1 -2
- package/lib/styles/scroll-container.js +0 -19
- package/lib/styles/select-base.d.ts +0 -1
- package/lib/styles/select-base.js +9 -70
- package/lib/styles/select.d.ts +1 -2
- package/lib/styles/select.js +50 -18
- package/lib/styles/step.d.ts +1 -2
- package/lib/styles/step.js +0 -4
- package/lib/styles/switch.d.ts +0 -1
- package/lib/styles/switch.js +2 -20
- package/lib/styles/tab.d.ts +1 -2
- package/lib/styles/tab.js +0 -5
- package/lib/styles/tabs.d.ts +3 -11
- package/lib/styles/tabs.js +4 -47
- package/lib/styles/tag.d.ts +1 -5
- package/lib/styles/tag.js +2 -31
- package/lib/styles/textarea.d.ts +1 -2
- package/lib/styles/textarea.js +0 -44
- package/lib/styles/tooltip.d.ts +0 -1
- package/lib/styles/tooltip.js +0 -10
- package/lib/styles/wizard.d.ts +5 -21
- package/lib/styles/wizard.js +5 -85
- package/lib/types/common.d.ts +0 -2
- package/lib/types/common.js +0 -12
- package/lib/utils/calendar-utils.d.ts +4 -21
- package/lib/utils/calendar-utils.js +4 -177
- package/lib/utils/custom-scrollbar.d.ts +6 -20
- package/lib/utils/custom-scrollbar.js +1 -45
- package/lib/utils/flavor-sheet.d.ts +0 -1
- package/lib/utils/flavor-sheet.js +0 -23
- package/lib/utils/icon-registry.d.ts +0 -2
- package/lib/utils/icon-registry.js +1 -107
- package/lib/utils/icons.d.ts +0 -1
- package/lib/utils/icons.js +0 -9
- package/lib/utils/loader-registry.d.ts +0 -1
- package/lib/utils/loader-registry.js +0 -32
- package/lib/utils/locale.d.ts +2 -23
- package/lib/utils/locale.js +0 -86
- package/lib/utils/mobile.d.ts +0 -1
- package/lib/utils/mobile.js +0 -17
- package/lib/utils/number-format.d.ts +0 -2
- package/lib/utils/number-format.js +2 -65
- package/lib/utils/positioning.d.ts +4 -2
- package/lib/utils/positioning.js +2 -54
- package/lib/utils/property-capture.d.ts +5 -27
- package/lib/utils/property-capture.js +0 -108
- package/lib/utils/property-manager.d.ts +0 -1
- package/lib/utils/property-manager.js +0 -70
- package/lib/utils/resize-observer.d.ts +0 -1
- package/lib/utils/resize-observer.js +0 -36
- package/lib/utils/scroll-lock.d.ts +4 -11
- package/lib/utils/scroll-lock.js +0 -107
- package/lib/utils/styles.d.ts +0 -1
- package/lib/utils/styles.js +0 -24
- package/lib/version.d.ts +1 -2
- package/lib/version.js +1 -11
- package/package.json +2 -2
- package/lib/base/ty-component.d.ts.map +0 -1
- package/lib/base/ty-component.js.map +0 -1
- package/lib/components/button.d.ts.map +0 -1
- package/lib/components/button.js.map +0 -1
- package/lib/components/calendar-month.d.ts.map +0 -1
- package/lib/components/calendar-month.js.map +0 -1
- package/lib/components/calendar-navigation.d.ts.map +0 -1
- package/lib/components/calendar-navigation.js.map +0 -1
- package/lib/components/calendar.d.ts.map +0 -1
- package/lib/components/calendar.js.map +0 -1
- package/lib/components/checkbox.d.ts.map +0 -1
- package/lib/components/checkbox.js.map +0 -1
- package/lib/components/copy.d.ts.map +0 -1
- package/lib/components/copy.js.map +0 -1
- package/lib/components/date-picker.d.ts.map +0 -1
- package/lib/components/date-picker.js.map +0 -1
- package/lib/components/file-upload.d.ts.map +0 -1
- package/lib/components/file-upload.js.map +0 -1
- package/lib/components/icon.d.ts.map +0 -1
- package/lib/components/icon.js.map +0 -1
- package/lib/components/input.d.ts.map +0 -1
- package/lib/components/input.js.map +0 -1
- package/lib/components/modal.d.ts.map +0 -1
- package/lib/components/modal.js.map +0 -1
- package/lib/components/option.d.ts.map +0 -1
- package/lib/components/option.js.map +0 -1
- package/lib/components/popup.d.ts.map +0 -1
- package/lib/components/popup.js.map +0 -1
- package/lib/components/radio.d.ts.map +0 -1
- package/lib/components/radio.js.map +0 -1
- package/lib/components/resize-observer.d.ts.map +0 -1
- package/lib/components/resize-observer.js.map +0 -1
- package/lib/components/scroll-container.d.ts.map +0 -1
- package/lib/components/scroll-container.js.map +0 -1
- package/lib/components/select.d.ts.map +0 -1
- package/lib/components/select.js.map +0 -1
- package/lib/components/selected-tags.d.ts.map +0 -1
- package/lib/components/selected-tags.js.map +0 -1
- package/lib/components/step.d.ts.map +0 -1
- package/lib/components/step.js.map +0 -1
- package/lib/components/switch.d.ts.map +0 -1
- package/lib/components/switch.js.map +0 -1
- package/lib/components/tab.d.ts.map +0 -1
- package/lib/components/tab.js.map +0 -1
- package/lib/components/tabs.d.ts.map +0 -1
- package/lib/components/tabs.js.map +0 -1
- package/lib/components/tag.d.ts.map +0 -1
- package/lib/components/tag.js.map +0 -1
- package/lib/components/textarea.d.ts.map +0 -1
- package/lib/components/textarea.js.map +0 -1
- package/lib/components/tooltip.d.ts.map +0 -1
- package/lib/components/tooltip.js.map +0 -1
- package/lib/components/wizard.d.ts.map +0 -1
- package/lib/components/wizard.js.map +0 -1
- package/lib/icons/fontawesome/brands.d.ts.map +0 -1
- package/lib/icons/fontawesome/brands.js.map +0 -1
- package/lib/icons/fontawesome/regular.d.ts.map +0 -1
- package/lib/icons/fontawesome/regular.js.map +0 -1
- package/lib/icons/fontawesome/solid.d.ts.map +0 -1
- package/lib/icons/fontawesome/solid.js.map +0 -1
- package/lib/icons/heroicons/micro.d.ts.map +0 -1
- package/lib/icons/heroicons/micro.js.map +0 -1
- package/lib/icons/heroicons/mini.d.ts.map +0 -1
- package/lib/icons/heroicons/mini.js.map +0 -1
- package/lib/icons/heroicons/outline.d.ts.map +0 -1
- package/lib/icons/heroicons/outline.js.map +0 -1
- package/lib/icons/heroicons/solid.d.ts.map +0 -1
- package/lib/icons/heroicons/solid.js.map +0 -1
- package/lib/icons/lucide.d.ts.map +0 -1
- package/lib/icons/lucide.js.map +0 -1
- package/lib/icons/material/filled.d.ts.map +0 -1
- package/lib/icons/material/filled.js.map +0 -1
- package/lib/icons/material/outlined.d.ts.map +0 -1
- package/lib/icons/material/outlined.js.map +0 -1
- package/lib/icons/material/round.d.ts.map +0 -1
- package/lib/icons/material/round.js.map +0 -1
- package/lib/icons/material/sharp.d.ts.map +0 -1
- package/lib/icons/material/sharp.js.map +0 -1
- package/lib/icons/material/two-tone.d.ts.map +0 -1
- package/lib/icons/material/two-tone.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/styles/button.d.ts.map +0 -1
- package/lib/styles/button.js.map +0 -1
- package/lib/styles/calendar-month.d.ts.map +0 -1
- package/lib/styles/calendar-month.js.map +0 -1
- package/lib/styles/calendar-navigation.d.ts.map +0 -1
- package/lib/styles/calendar-navigation.js.map +0 -1
- package/lib/styles/calendar.d.ts.map +0 -1
- package/lib/styles/calendar.js.map +0 -1
- package/lib/styles/checkbox.d.ts.map +0 -1
- package/lib/styles/checkbox.js.map +0 -1
- package/lib/styles/copy.d.ts.map +0 -1
- package/lib/styles/copy.js.map +0 -1
- package/lib/styles/custom-scrollbar.d.ts.map +0 -1
- package/lib/styles/custom-scrollbar.js.map +0 -1
- package/lib/styles/date-picker.d.ts.map +0 -1
- package/lib/styles/date-picker.js.map +0 -1
- package/lib/styles/file-upload.d.ts.map +0 -1
- package/lib/styles/file-upload.js.map +0 -1
- package/lib/styles/icon.d.ts.map +0 -1
- package/lib/styles/icon.js.map +0 -1
- package/lib/styles/input.d.ts.map +0 -1
- package/lib/styles/input.js.map +0 -1
- package/lib/styles/modal.d.ts.map +0 -1
- package/lib/styles/modal.js.map +0 -1
- package/lib/styles/multiselect.d.ts +0 -8
- package/lib/styles/multiselect.d.ts.map +0 -1
- package/lib/styles/multiselect.js +0 -849
- package/lib/styles/multiselect.js.map +0 -1
- package/lib/styles/option.d.ts.map +0 -1
- package/lib/styles/option.js.map +0 -1
- package/lib/styles/popup.d.ts.map +0 -1
- package/lib/styles/popup.js.map +0 -1
- package/lib/styles/radio.d.ts.map +0 -1
- package/lib/styles/radio.js.map +0 -1
- package/lib/styles/resize-observer.d.ts.map +0 -1
- package/lib/styles/resize-observer.js.map +0 -1
- package/lib/styles/scroll-container.d.ts.map +0 -1
- package/lib/styles/scroll-container.js.map +0 -1
- package/lib/styles/select-base.d.ts.map +0 -1
- package/lib/styles/select-base.js.map +0 -1
- package/lib/styles/select.d.ts.map +0 -1
- package/lib/styles/select.js.map +0 -1
- package/lib/styles/step.d.ts.map +0 -1
- package/lib/styles/step.js.map +0 -1
- package/lib/styles/switch.d.ts.map +0 -1
- package/lib/styles/switch.js.map +0 -1
- package/lib/styles/tab.d.ts.map +0 -1
- package/lib/styles/tab.js.map +0 -1
- package/lib/styles/tabs.d.ts.map +0 -1
- package/lib/styles/tabs.js.map +0 -1
- package/lib/styles/tag.d.ts.map +0 -1
- package/lib/styles/tag.js.map +0 -1
- package/lib/styles/textarea.d.ts.map +0 -1
- package/lib/styles/textarea.js.map +0 -1
- package/lib/styles/tooltip.d.ts.map +0 -1
- package/lib/styles/tooltip.js.map +0 -1
- package/lib/styles/wizard.d.ts.map +0 -1
- package/lib/styles/wizard.js.map +0 -1
- package/lib/types/common.d.ts.map +0 -1
- package/lib/types/common.js.map +0 -1
- package/lib/utils/calendar-utils.d.ts.map +0 -1
- package/lib/utils/calendar-utils.js.map +0 -1
- package/lib/utils/custom-scrollbar.d.ts.map +0 -1
- package/lib/utils/custom-scrollbar.js.map +0 -1
- package/lib/utils/flavor-sheet.d.ts.map +0 -1
- package/lib/utils/flavor-sheet.js.map +0 -1
- package/lib/utils/icon-registry.d.ts.map +0 -1
- package/lib/utils/icon-registry.js.map +0 -1
- package/lib/utils/icons.d.ts.map +0 -1
- package/lib/utils/icons.js.map +0 -1
- package/lib/utils/loader-registry.d.ts.map +0 -1
- package/lib/utils/loader-registry.js.map +0 -1
- package/lib/utils/locale.d.ts.map +0 -1
- package/lib/utils/locale.js.map +0 -1
- package/lib/utils/mobile.d.ts.map +0 -1
- package/lib/utils/mobile.js.map +0 -1
- package/lib/utils/number-format.d.ts.map +0 -1
- package/lib/utils/number-format.js.map +0 -1
- package/lib/utils/parse-boolean.d.ts +0 -39
- package/lib/utils/parse-boolean.d.ts.map +0 -1
- package/lib/utils/parse-boolean.js +0 -58
- package/lib/utils/parse-boolean.js.map +0 -1
- package/lib/utils/positioning.d.ts.map +0 -1
- package/lib/utils/positioning.js.map +0 -1
- package/lib/utils/property-capture.d.ts.map +0 -1
- package/lib/utils/property-capture.js.map +0 -1
- package/lib/utils/property-manager.d.ts.map +0 -1
- package/lib/utils/property-manager.js.map +0 -1
- package/lib/utils/resize-observer.d.ts.map +0 -1
- package/lib/utils/resize-observer.js.map +0 -1
- package/lib/utils/scroll-lock.d.ts.map +0 -1
- package/lib/utils/scroll-lock.js.map +0 -1
- package/lib/utils/styles.d.ts.map +0 -1
- package/lib/utils/styles.js.map +0 -1
- package/lib/version.d.ts.map +0 -1
- package/lib/version.js.map +0 -1
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TyResizeObserver Web Component
|
|
3
|
-
*
|
|
4
|
-
* Self-observing resize component that tracks its own dimensions
|
|
5
|
-
* and stores them in a global registry accessible by element ID.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```html
|
|
9
|
-
* <ty-resize-observer id="parent-container">
|
|
10
|
-
* <div class="child">
|
|
11
|
-
* <!-- Child can query parent size via getSize('parent-container') -->
|
|
12
|
-
* </div>
|
|
13
|
-
* </ty-resize-observer>
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* @example With debouncing
|
|
17
|
-
* ```html
|
|
18
|
-
* <ty-resize-observer id="container" debounce="100">
|
|
19
|
-
* <!-- Only updates after 100ms of no resize activity -->
|
|
20
|
-
* </ty-resize-observer>
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
1
|
import { ensureStyles } from '../utils/styles.js';
|
|
24
2
|
import { resizeObserverStyles } from '../styles/resize-observer.js';
|
|
25
3
|
import { updateSize, removeSize } from '../utils/resize-observer.js';
|
|
@@ -27,9 +5,6 @@ export class TyResizeObserver extends HTMLElement {
|
|
|
27
5
|
static get observedAttributes() {
|
|
28
6
|
return ['id', 'debounce'];
|
|
29
7
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Debounce in milliseconds (default: 0 = no debounce)
|
|
32
|
-
*/
|
|
33
8
|
get debounce() {
|
|
34
9
|
return parseInt(this.getAttribute('debounce') || '0');
|
|
35
10
|
}
|
|
@@ -40,10 +15,8 @@ export class TyResizeObserver extends HTMLElement {
|
|
|
40
15
|
super();
|
|
41
16
|
this._resizeObserver = null;
|
|
42
17
|
this._debounceTimer = null;
|
|
43
|
-
// Setup shadow DOM with styles
|
|
44
18
|
const shadow = this.attachShadow({ mode: 'open' });
|
|
45
19
|
ensureStyles(shadow, { css: resizeObserverStyles, id: 'ty-resize-observer' });
|
|
46
|
-
// Simple slot for content
|
|
47
20
|
shadow.innerHTML = '<slot></slot>';
|
|
48
21
|
}
|
|
49
22
|
connectedCallback() {
|
|
@@ -52,13 +25,9 @@ export class TyResizeObserver extends HTMLElement {
|
|
|
52
25
|
disconnectedCallback() {
|
|
53
26
|
this.cleanup();
|
|
54
27
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Setup ResizeObserver to watch this element
|
|
57
|
-
*/
|
|
58
28
|
setupObserver() {
|
|
59
29
|
this._resizeObserver = new ResizeObserver((entries) => {
|
|
60
30
|
if (this.debounce > 0) {
|
|
61
|
-
// Debounced handling
|
|
62
31
|
if (this._debounceTimer)
|
|
63
32
|
clearTimeout(this._debounceTimer);
|
|
64
33
|
this._debounceTimer = window.setTimeout(() => {
|
|
@@ -66,43 +35,29 @@ export class TyResizeObserver extends HTMLElement {
|
|
|
66
35
|
}, this.debounce);
|
|
67
36
|
}
|
|
68
37
|
else {
|
|
69
|
-
// Immediate handling
|
|
70
38
|
this.handleResize(entries);
|
|
71
39
|
}
|
|
72
40
|
});
|
|
73
|
-
// Observe the custom element itself (not shadow root)
|
|
74
41
|
this._resizeObserver.observe(this);
|
|
75
42
|
}
|
|
76
|
-
/**
|
|
77
|
-
* Handle resize events - update registry and notify callbacks
|
|
78
|
-
*/
|
|
79
43
|
handleResize(entries) {
|
|
80
44
|
const { width, height } = entries[0].contentRect;
|
|
81
|
-
// Only update if element has an ID
|
|
82
45
|
if (this.id) {
|
|
83
46
|
updateSize(this.id, width, height);
|
|
84
47
|
}
|
|
85
48
|
}
|
|
86
|
-
/**
|
|
87
|
-
* Cleanup observer and remove from registry
|
|
88
|
-
*/
|
|
89
49
|
cleanup() {
|
|
90
|
-
// Disconnect observer
|
|
91
50
|
if (this._resizeObserver) {
|
|
92
51
|
this._resizeObserver.disconnect();
|
|
93
52
|
this._resizeObserver = null;
|
|
94
53
|
}
|
|
95
|
-
// Clear pending debounce timer
|
|
96
54
|
if (this._debounceTimer) {
|
|
97
55
|
clearTimeout(this._debounceTimer);
|
|
98
56
|
this._debounceTimer = null;
|
|
99
57
|
}
|
|
100
|
-
// Remove from registry
|
|
101
58
|
if (this.id) {
|
|
102
59
|
removeSize(this.id);
|
|
103
60
|
}
|
|
104
61
|
}
|
|
105
62
|
}
|
|
106
|
-
// Register custom element
|
|
107
63
|
customElements.define('ty-resize-observer', TyResizeObserver);
|
|
108
|
-
//# sourceMappingURL=resize-observer.js.map
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TyScrollContainer Web Component
|
|
3
|
-
*
|
|
4
|
-
* A scroll container with shadow indicators and an optional custom-rendered scrollbar.
|
|
5
|
-
* Uses the CustomScrollbar utility internally.
|
|
6
|
-
*
|
|
7
|
-
* @example Custom scrollbar
|
|
8
|
-
* ```html
|
|
9
|
-
* <ty-scroll-container max-height="300px" custom-scrollbar>
|
|
10
|
-
* <div>Long content...</div>
|
|
11
|
-
* </ty-scroll-container>
|
|
12
|
-
* ```
|
|
2
|
+
* TyScrollContainer Web Component - scroll wrapper with edge shadow indicators
|
|
3
|
+
* and an optional custom-rendered scrollbar (CustomScrollbar utility).
|
|
13
4
|
*/
|
|
14
5
|
export declare class TyScrollContainer extends HTMLElement {
|
|
15
6
|
private _scrollWrapper;
|
|
@@ -64,4 +55,3 @@ export declare class TyScrollContainer extends HTMLElement {
|
|
|
64
55
|
scrollToElement(target: Element | string, smooth?: boolean): void;
|
|
65
56
|
get scrollElement(): HTMLElement | null;
|
|
66
57
|
}
|
|
67
|
-
//# sourceMappingURL=scroll-container.d.ts.map
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TyScrollContainer Web Component
|
|
3
|
-
*
|
|
4
|
-
* A scroll container with shadow indicators and an optional custom-rendered scrollbar.
|
|
5
|
-
* Uses the CustomScrollbar utility internally.
|
|
6
|
-
*
|
|
7
|
-
* @example Custom scrollbar
|
|
8
|
-
* ```html
|
|
9
|
-
* <ty-scroll-container max-height="300px" custom-scrollbar>
|
|
10
|
-
* <div>Long content...</div>
|
|
11
|
-
* </ty-scroll-container>
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
1
|
import { ensureStyles } from '../utils/styles.js';
|
|
15
2
|
import { scrollContainerStyles } from '../styles/scroll-container.js';
|
|
16
3
|
import { CustomScrollbar } from '../utils/custom-scrollbar.js';
|
|
@@ -18,7 +5,6 @@ export class TyScrollContainer extends HTMLElement {
|
|
|
18
5
|
static get observedAttributes() {
|
|
19
6
|
return ['shadow', 'max-height', 'hide-scrollbar', 'custom-scrollbar', 'overflow-x', 'scroll-anchoring'];
|
|
20
7
|
}
|
|
21
|
-
// ============ Property Accessors ============
|
|
22
8
|
get shadow() {
|
|
23
9
|
return this.getAttribute('shadow') !== 'false';
|
|
24
10
|
}
|
|
@@ -65,7 +51,6 @@ export class TyScrollContainer extends HTMLElement {
|
|
|
65
51
|
else
|
|
66
52
|
this.removeAttribute('overflow-x');
|
|
67
53
|
}
|
|
68
|
-
/** Distance (px) from an edge at which nearstart/nearend fire. Default 100. */
|
|
69
54
|
get nearEdgeThreshold() {
|
|
70
55
|
const v = parseInt(this.getAttribute('near-edge-threshold') || '', 10);
|
|
71
56
|
return Number.isFinite(v) ? v : 100;
|
|
@@ -76,8 +61,6 @@ export class TyScrollContainer extends HTMLElement {
|
|
|
76
61
|
else
|
|
77
62
|
this.setAttribute('near-edge-threshold', String(value));
|
|
78
63
|
}
|
|
79
|
-
/** Preserve visual position when content is added above the viewport
|
|
80
|
-
* (e.g. prepending older messages in a chat). Opt-in. */
|
|
81
64
|
get scrollAnchoring() {
|
|
82
65
|
return this.hasAttribute('scroll-anchoring');
|
|
83
66
|
}
|
|
@@ -98,10 +81,8 @@ export class TyScrollContainer extends HTMLElement {
|
|
|
98
81
|
this._resizeObserver = null;
|
|
99
82
|
this._contentObserver = null;
|
|
100
83
|
this._rafId = null;
|
|
101
|
-
// Edge-trigger state for nearstart/nearend (fire once on entering the zone).
|
|
102
84
|
this._nearStartFired = false;
|
|
103
85
|
this._nearEndFired = false;
|
|
104
|
-
// ============ Private: Scroll Handling ============
|
|
105
86
|
this._onScroll = () => {
|
|
106
87
|
if (this._rafId !== null)
|
|
107
88
|
return;
|
|
@@ -182,12 +163,6 @@ export class TyScrollContainer extends HTMLElement {
|
|
|
182
163
|
this._setupAnchoring();
|
|
183
164
|
}
|
|
184
165
|
}
|
|
185
|
-
// ============ Private: Scroll Anchoring ============
|
|
186
|
-
// Preserve visual position when content is added ABOVE the viewport (chat
|
|
187
|
-
// "load older" prepends). A MutationObserver watches the host's children;
|
|
188
|
-
// any added node sitting above the visible area shifts everything down, so we
|
|
189
|
-
// add its (above-the-fold) height back to scrollTop. Append-at-bottom is
|
|
190
|
-
// untouched. CSS sets overflow-anchor:none so native anchoring doesn't fight us.
|
|
191
166
|
_setupAnchoring() {
|
|
192
167
|
if (this._contentObserver || !this.scrollAnchoring)
|
|
193
168
|
return;
|
|
@@ -203,9 +178,9 @@ export class TyScrollContainer extends HTMLElement {
|
|
|
203
178
|
return;
|
|
204
179
|
const rect = n.getBoundingClientRect();
|
|
205
180
|
if (rect.bottom <= wrapTop)
|
|
206
|
-
addedAbove += rect.height;
|
|
181
|
+
addedAbove += rect.height;
|
|
207
182
|
else if (rect.top < wrapTop)
|
|
208
|
-
addedAbove += wrapTop - rect.top;
|
|
183
|
+
addedAbove += wrapTop - rect.top;
|
|
209
184
|
});
|
|
210
185
|
}
|
|
211
186
|
if (addedAbove > 0) {
|
|
@@ -219,11 +194,7 @@ export class TyScrollContainer extends HTMLElement {
|
|
|
219
194
|
this._contentObserver?.disconnect();
|
|
220
195
|
this._contentObserver = null;
|
|
221
196
|
}
|
|
222
|
-
// ============ Private: Scrollbar Setup ============
|
|
223
197
|
_setupScrollbar() {
|
|
224
|
-
// Idempotent: attributeChangedCallback (attrs set before insertion) and
|
|
225
|
-
// connectedCallback can both call this. Without the guard a second
|
|
226
|
-
// CustomScrollbar + track is created → two thumbs.
|
|
227
198
|
if (this._scrollbar)
|
|
228
199
|
return;
|
|
229
200
|
if (!this._scrollWrapper || !this.customScrollbar)
|
|
@@ -232,7 +203,6 @@ export class TyScrollContainer extends HTMLElement {
|
|
|
232
203
|
vertical: true,
|
|
233
204
|
horizontal: this.overflowX
|
|
234
205
|
});
|
|
235
|
-
// Append track elements to shadow DOM
|
|
236
206
|
const shadowRoot = this.shadowRoot;
|
|
237
207
|
if (this._scrollbar.trackY)
|
|
238
208
|
shadowRoot.appendChild(this._scrollbar.trackY);
|
|
@@ -241,14 +211,12 @@ export class TyScrollContainer extends HTMLElement {
|
|
|
241
211
|
}
|
|
242
212
|
_destroyScrollbar() {
|
|
243
213
|
if (this._scrollbar) {
|
|
244
|
-
// Remove track elements from DOM
|
|
245
214
|
this._scrollbar.trackY?.remove();
|
|
246
215
|
this._scrollbar.trackX?.remove();
|
|
247
216
|
this._scrollbar.destroy();
|
|
248
217
|
this._scrollbar = null;
|
|
249
218
|
}
|
|
250
219
|
}
|
|
251
|
-
// ============ Private: Max Height ============
|
|
252
220
|
_updateMaxHeight() {
|
|
253
221
|
if (this._scrollWrapper) {
|
|
254
222
|
const maxHeight = this.maxHeight;
|
|
@@ -262,7 +230,6 @@ export class TyScrollContainer extends HTMLElement {
|
|
|
262
230
|
}
|
|
263
231
|
}
|
|
264
232
|
}
|
|
265
|
-
// ============ Private: Shadow State ============
|
|
266
233
|
_updateShadowState() {
|
|
267
234
|
if (!this._scrollWrapper)
|
|
268
235
|
return;
|
|
@@ -282,10 +249,6 @@ export class TyScrollContainer extends HTMLElement {
|
|
|
282
249
|
this._shadowRight.classList.toggle('visible', scrollLeft + clientWidth < scrollWidth - threshold);
|
|
283
250
|
}
|
|
284
251
|
}
|
|
285
|
-
// Near-edge events for infinite scroll (vertical). Edge-triggered: fire once
|
|
286
|
-
// when entering the zone, re-arm only after leaving it. Runs on scroll,
|
|
287
|
-
// slotchange and resize (all route through here), so loading more content
|
|
288
|
-
// re-arms naturally once it grows the scroll distance.
|
|
289
252
|
const scrollable = scrollHeight - clientHeight;
|
|
290
253
|
if (scrollable > 0) {
|
|
291
254
|
const t = this.nearEdgeThreshold;
|
|
@@ -294,21 +257,18 @@ export class TyScrollContainer extends HTMLElement {
|
|
|
294
257
|
this._nearStartFired = this._maybeEmitEdge('nearstart', scrollTop, t, this._nearStartFired, { distance: scrollTop, scrollTop, scrollHeight, clientHeight });
|
|
295
258
|
}
|
|
296
259
|
else {
|
|
297
|
-
// Not scrollable → re-arm both so they fire fresh once content overflows.
|
|
298
260
|
this._nearStartFired = false;
|
|
299
261
|
this._nearEndFired = false;
|
|
300
262
|
}
|
|
301
263
|
}
|
|
302
|
-
/** Edge-trigger one near-edge event; returns the new "fired" state. */
|
|
303
264
|
_maybeEmitEdge(name, distance, threshold, fired, detail) {
|
|
304
265
|
if (distance > threshold)
|
|
305
|
-
return false;
|
|
266
|
+
return false;
|
|
306
267
|
if (!fired) {
|
|
307
268
|
this.dispatchEvent(new CustomEvent(name, { detail, bubbles: true, composed: true }));
|
|
308
269
|
}
|
|
309
270
|
return true;
|
|
310
271
|
}
|
|
311
|
-
// ============ Public API ============
|
|
312
272
|
updateShadows() {
|
|
313
273
|
this._updateShadowState();
|
|
314
274
|
this._scrollbar?.update();
|
|
@@ -329,7 +289,6 @@ export class TyScrollContainer extends HTMLElement {
|
|
|
329
289
|
this._scrollWrapper.scrollTo({ left: this._scrollWrapper.scrollWidth, behavior: smooth ? 'smooth' : 'auto' });
|
|
330
290
|
}
|
|
331
291
|
}
|
|
332
|
-
/** Scroll a slotted descendant (element or CSS selector) into view. */
|
|
333
292
|
scrollToElement(target, smooth = true) {
|
|
334
293
|
const el = typeof target === 'string' ? this.querySelector(target) : target;
|
|
335
294
|
el?.scrollIntoView({ behavior: smooth ? 'smooth' : 'auto', block: 'nearest' });
|
|
@@ -338,6 +297,4 @@ export class TyScrollContainer extends HTMLElement {
|
|
|
338
297
|
return this._scrollWrapper;
|
|
339
298
|
}
|
|
340
299
|
}
|
|
341
|
-
// Register custom element
|
|
342
300
|
customElements.define('ty-scroll-container', TyScrollContainer);
|
|
343
|
-
//# sourceMappingURL=scroll-container.js.map
|
|
@@ -1,57 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TySelect Web Component
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* Cardinality (native <select> semantics):
|
|
7
|
-
* - default: SINGLE select — scalar value, picking an option closes the popup
|
|
8
|
-
* - `multiple`: multi select — comma value / repeated FormData entries,
|
|
9
|
-
* options toggle and the popup stays open
|
|
10
|
-
*
|
|
11
|
-
* Skins:
|
|
12
|
-
* - default: form FIELD — full width, --ty-input-* tokens, matches ty-input;
|
|
13
|
-
* shows the selected label(s) inline
|
|
14
|
-
* - `compact`: content-hugging trigger for toolbars/filter bars; single shows
|
|
15
|
-
* the selected label, multiple shows placeholder + count badge (pair with
|
|
16
|
-
* <ty-selected-options>)
|
|
17
|
-
* - slot="trigger": consumer skin — replaces field/compact chrome entirely,
|
|
18
|
-
* behavior/ARIA/form participation unchanged
|
|
19
|
-
*
|
|
20
|
-
* - ty-option children (ty-tag also accepted)
|
|
21
|
-
* - Desktop popup with smart positioning, mobile full-screen modal
|
|
22
|
-
* - Search / external-search / debounce, keyboard navigation
|
|
23
|
-
* - Form association: single submits one entry, multiple submits repeated
|
|
24
|
-
* `name=` entries (HTMX-ready)
|
|
25
|
-
* - change event detail: { value, values, items: [{value, label, flavor}], action, item }
|
|
26
|
-
* (`value` is a scalar for single, array for multiple)
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```html
|
|
30
|
-
* <!-- Single select, field skin -->
|
|
31
|
-
* <ty-select label="Robot" name="robot">
|
|
32
|
-
* <ty-option value="bobo">Bobo Robot</ty-option>
|
|
33
|
-
* <ty-option value="eywa">EYWA Dataset Example</ty-option>
|
|
34
|
-
* </ty-select>
|
|
35
|
-
*
|
|
36
|
-
* <!-- Multi select, compact skin + out-of-band chips -->
|
|
37
|
-
* <ty-select multiple compact label="Robots" name="robots" id="robots">...</ty-select>
|
|
38
|
-
* <ty-selected-options for="robots"></ty-selected-options>
|
|
39
|
-
* ```
|
|
2
|
+
* TySelect Web Component — THE select control (replaces ty-dropdown/ty-multiselect).
|
|
3
|
+
* Cardinality follows native <select>: default single (scalar value, picking closes
|
|
4
|
+
* the popup), `multiple` toggles options and submits repeated `name=` FormData entries.
|
|
5
|
+
* Skins: default form field, `compact` content-hugging trigger, slot="trigger" custom.
|
|
40
6
|
*/
|
|
41
7
|
import type { Flavor, Size } from "../types/common.js";
|
|
42
8
|
import { TyComponent } from "../base/ty-component.js";
|
|
43
9
|
import type { PropertyChange } from "../utils/property-manager.js";
|
|
44
|
-
/**
|
|
45
|
-
* Tag data structure
|
|
46
|
-
*/
|
|
47
10
|
interface TagData {
|
|
48
11
|
value: string;
|
|
49
12
|
text: string;
|
|
50
13
|
element: HTMLElement;
|
|
51
14
|
}
|
|
52
|
-
/**
|
|
53
|
-
* Component state structure
|
|
54
|
-
*/
|
|
55
15
|
interface SelectState {
|
|
56
16
|
open: boolean;
|
|
57
17
|
search: string;
|
|
@@ -112,6 +72,14 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
112
72
|
visual: boolean;
|
|
113
73
|
default: boolean;
|
|
114
74
|
};
|
|
75
|
+
clearable: {
|
|
76
|
+
type: "boolean";
|
|
77
|
+
visual: boolean;
|
|
78
|
+
default: boolean;
|
|
79
|
+
aliases: {
|
|
80
|
+
"not-clearable": boolean;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
115
83
|
externalSearch: {
|
|
116
84
|
type: "boolean";
|
|
117
85
|
visual: boolean;
|
|
@@ -143,6 +111,13 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
143
111
|
default: string;
|
|
144
112
|
coerce: (v: any) => "auto" | "always" | "never";
|
|
145
113
|
};
|
|
114
|
+
align: {
|
|
115
|
+
type: "string";
|
|
116
|
+
visual: boolean;
|
|
117
|
+
default: string;
|
|
118
|
+
validate: (v: any) => boolean;
|
|
119
|
+
coerce: (v: any) => "start" | "end";
|
|
120
|
+
};
|
|
146
121
|
size: {
|
|
147
122
|
type: "string";
|
|
148
123
|
visual: boolean;
|
|
@@ -185,6 +160,7 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
185
160
|
private _disabled;
|
|
186
161
|
private _readonly;
|
|
187
162
|
private _required;
|
|
163
|
+
private _clearable;
|
|
188
164
|
private _externalSearch;
|
|
189
165
|
private _allowCreate;
|
|
190
166
|
private _createTransform;
|
|
@@ -207,22 +183,12 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
207
183
|
private _selectedClone;
|
|
208
184
|
private _customFlavorSheet;
|
|
209
185
|
constructor();
|
|
210
|
-
/**
|
|
211
|
-
* Called when component is connected to DOM
|
|
212
|
-
* TyComponent handles property capture automatically
|
|
213
|
-
*/
|
|
186
|
+
/** TyComponent handles property capture automatically. */
|
|
214
187
|
protected onConnect(): void;
|
|
215
188
|
/** Custom (non-built-in) flavors — see utils/flavor-sheet.ts. */
|
|
216
189
|
private _syncCustomFlavor;
|
|
217
|
-
/**
|
|
218
|
-
* Called when component is disconnected from DOM
|
|
219
|
-
* Clean up event listeners and timers
|
|
220
|
-
*/
|
|
221
190
|
protected onDisconnect(): void;
|
|
222
|
-
/**
|
|
223
|
-
* Called when properties change
|
|
224
|
-
* Handle state synchronization BEFORE render
|
|
225
|
-
*/
|
|
191
|
+
/** Handle state synchronization BEFORE render. */
|
|
226
192
|
protected onPropertiesChanged(changes: PropertyChange[]): void;
|
|
227
193
|
/**
|
|
228
194
|
* Toggle the loading visual state on the open popup.
|
|
@@ -231,27 +197,15 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
231
197
|
* take effect on the next loading toggle.
|
|
232
198
|
*/
|
|
233
199
|
private applyLoadingState;
|
|
234
|
-
/**
|
|
235
|
-
* Get the form value for this component
|
|
236
|
-
* Returns FormData with multiple entries (HTMX standard)
|
|
237
|
-
*/
|
|
200
|
+
/** Form value: a plain entry for single, FormData with repeated entries for multiple (HTMX standard). */
|
|
238
201
|
protected getFormValue(): FormDataEntryValue | FormData | null;
|
|
239
|
-
/**
|
|
240
|
-
* Parse select value (comma-separated string to array)
|
|
241
|
-
*/
|
|
242
202
|
private parseValue;
|
|
243
|
-
/**
|
|
244
|
-
* Initialize component state from attributes
|
|
245
|
-
* Reads from both property and attribute (like ClojureScript version)
|
|
246
|
-
*/
|
|
203
|
+
/** Initialize component state from the value property / pre-selected children. */
|
|
247
204
|
private initializeState;
|
|
248
205
|
/**
|
|
249
206
|
* Get all option elements from the component (ty-option preferred, ty-tag accepted)
|
|
250
207
|
*/
|
|
251
208
|
private getTagElements;
|
|
252
|
-
/**
|
|
253
|
-
* Extract value and text from a ty-tag element
|
|
254
|
-
*/
|
|
255
209
|
private getTagData;
|
|
256
210
|
/**
|
|
257
211
|
* Select an option - attribute only. The option stays in the list with
|
|
@@ -266,9 +220,6 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
266
220
|
* Get array of currently selected values from tags (ALWAYS reads from DOM)
|
|
267
221
|
*/
|
|
268
222
|
private getSelectedValues;
|
|
269
|
-
/**
|
|
270
|
-
* Sync tag selection states with desired values
|
|
271
|
-
*/
|
|
272
223
|
private syncSelectedTags;
|
|
273
224
|
/**
|
|
274
225
|
* role="option" for every current option/tag — separate from
|
|
@@ -278,18 +229,12 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
278
229
|
* on every light-DOM change.
|
|
279
230
|
*/
|
|
280
231
|
private ensureOptionRoles;
|
|
281
|
-
/**
|
|
282
|
-
* Central update function - synchronizes everything
|
|
283
|
-
* Uses TyComponent's property system for proper lifecycle
|
|
284
|
-
*/
|
|
232
|
+
/** Central update function — synchronizes everything via TyComponent's property system. */
|
|
285
233
|
private updateComponentValue;
|
|
286
234
|
/**
|
|
287
235
|
* Build rich item info for values, read off the matching option elements
|
|
288
236
|
*/
|
|
289
237
|
private getSelectedItems;
|
|
290
|
-
/**
|
|
291
|
-
* Calculate and set dropdown position with smart direction detection
|
|
292
|
-
*/
|
|
293
238
|
private calculatePosition;
|
|
294
239
|
private _setupOptionsScrollbar;
|
|
295
240
|
private _destroyOptionsScrollbar;
|
|
@@ -303,21 +248,16 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
303
248
|
* implement.
|
|
304
249
|
*/
|
|
305
250
|
private openDropdown;
|
|
306
|
-
/**
|
|
307
|
-
* Close dropdown dialog (desktop mode)
|
|
308
|
-
*/
|
|
309
251
|
private closeDropdown;
|
|
310
|
-
/**
|
|
311
|
-
* Open mobile modal (mobile mode)
|
|
312
|
-
* Now using <dialog> element for native z-index management
|
|
313
|
-
*/
|
|
252
|
+
/** Open mobile modal — <dialog> handles z-index natively. */
|
|
314
253
|
private openMobileModal;
|
|
315
|
-
/**
|
|
316
|
-
* Close mobile modal (mobile mode)
|
|
317
|
-
* Now using <dialog> element for native management
|
|
318
|
-
*/
|
|
319
254
|
private closeMobileModal;
|
|
320
255
|
private handleStubClick;
|
|
256
|
+
/**
|
|
257
|
+
* .select-clear click — must stop propagation before it bubbles to the
|
|
258
|
+
* stub's own click handler (which would otherwise also open the dropdown).
|
|
259
|
+
*/
|
|
260
|
+
private handleClearClick;
|
|
321
261
|
/**
|
|
322
262
|
* Keyboard-open the (closed) stub. The stub is a plain div with
|
|
323
263
|
* tabindex="0", not a native <button> — Enter/Space don't turn into
|
|
@@ -353,34 +293,13 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
353
293
|
private blockSearchClick;
|
|
354
294
|
private handleSearchInput;
|
|
355
295
|
private handleKeyboard;
|
|
356
|
-
/**
|
|
357
|
-
* Filter tags based on search query
|
|
358
|
-
*/
|
|
359
296
|
private filterTags;
|
|
360
|
-
/**
|
|
361
|
-
* Update visibility of tags based on filtered list
|
|
362
|
-
*/
|
|
363
297
|
private updateTagVisibility;
|
|
364
|
-
/**
|
|
365
|
-
* Show/hide the dropdown options area
|
|
366
|
-
*/
|
|
367
298
|
private updateOptionsVisibility;
|
|
368
|
-
/**
|
|
369
|
-
* Clear all tag highlights
|
|
370
|
-
*/
|
|
371
299
|
private clearHighlights;
|
|
372
|
-
/**
|
|
373
|
-
* Highlight tag at specific index
|
|
374
|
-
*/
|
|
375
300
|
private highlightTag;
|
|
376
|
-
/**
|
|
377
|
-
* Dispatch search event for external search handling
|
|
378
|
-
* With optional debounce support
|
|
379
|
-
*/
|
|
301
|
+
/** Dispatch the search event for external search handling, with optional debounce. */
|
|
380
302
|
private dispatchSearchEvent;
|
|
381
|
-
/**
|
|
382
|
-
* Fire the actual search event
|
|
383
|
-
*/
|
|
384
303
|
private fireSearchEvent;
|
|
385
304
|
/**
|
|
386
305
|
* Dispatch lifecycle events for popup open/close.
|
|
@@ -389,14 +308,7 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
389
308
|
*/
|
|
390
309
|
private fireOpenEvent;
|
|
391
310
|
private fireCloseEvent;
|
|
392
|
-
/**
|
|
393
|
-
* Dispatch custom change event
|
|
394
|
-
*/
|
|
395
311
|
private dispatchChangeEvent;
|
|
396
|
-
/**
|
|
397
|
-
* Main render method (required by TyComponent)
|
|
398
|
-
* Delegates to mode-specific renderer
|
|
399
|
-
*/
|
|
400
312
|
protected render(): void;
|
|
401
313
|
/**
|
|
402
314
|
* Reflect constraint validation to the owning <form> via ElementInternals.
|
|
@@ -411,45 +323,16 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
411
323
|
* default field chrome so the trigger is styled entirely by the consumer.
|
|
412
324
|
*/
|
|
413
325
|
private setupTriggerSlot;
|
|
414
|
-
/**
|
|
415
|
-
* Setup event listeners
|
|
416
|
-
*/
|
|
417
326
|
private setupEventListeners;
|
|
418
|
-
/**
|
|
419
|
-
* Build CSS class list for stub
|
|
420
|
-
*/
|
|
421
327
|
private buildStubClasses;
|
|
422
|
-
/**
|
|
423
|
-
* Render desktop mode with dialog
|
|
424
|
-
*/
|
|
425
328
|
private renderDesktop;
|
|
426
|
-
/**
|
|
427
|
-
* Render mobile mode with full-screen modal
|
|
428
|
-
* Following dropdown.ts mobile structure
|
|
429
|
-
*/
|
|
430
329
|
private renderMobile;
|
|
431
|
-
/**
|
|
432
|
-
* Setup event listeners for mobile mode
|
|
433
|
-
* Using <dialog> element - backdrop clicks handled natively
|
|
434
|
-
*/
|
|
435
330
|
private setupMobileEventListeners;
|
|
436
|
-
/**
|
|
437
|
-
* Handle mobile stub click - open modal
|
|
438
|
-
*/
|
|
439
331
|
private handleMobileStubClick;
|
|
440
332
|
/** Keyboard-open the (closed) mobile stub — see handleStubKeydown for why this is needed. */
|
|
441
333
|
private handleMobileStubKeydown;
|
|
442
|
-
/**
|
|
443
|
-
* Handle mobile tag click - select and potentially close
|
|
444
|
-
*/
|
|
445
334
|
private handleMobileTagClick;
|
|
446
|
-
/**
|
|
447
|
-
* Update mobile options section state (count, empty state)
|
|
448
|
-
*/
|
|
449
335
|
private updateMobileSelectedState;
|
|
450
|
-
/**
|
|
451
|
-
* Update selection display: count badge next to the placeholder
|
|
452
|
-
*/
|
|
453
336
|
/**
|
|
454
337
|
* Should the popup show a search row? external-search always (the input is
|
|
455
338
|
* the mechanism); searchable always/never wins otherwise; 'auto' shows it
|
|
@@ -482,6 +365,13 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
482
365
|
* fires change like any in-popup interaction (HTMX hx-trigger="change" etc.).
|
|
483
366
|
*/
|
|
484
367
|
deselectValue(value: string): void;
|
|
368
|
+
/**
|
|
369
|
+
* Clear the entire selection programmatically WITH a change event
|
|
370
|
+
* (action: 'clear'). No-op if nothing is selected. Exists so slot="trigger"
|
|
371
|
+
* consumers (custom chrome, built-in clear UI hidden by design) can wire
|
|
372
|
+
* their own clear icon's click handler to it.
|
|
373
|
+
*/
|
|
374
|
+
clear(): void;
|
|
485
375
|
get value(): string;
|
|
486
376
|
set value(val: string);
|
|
487
377
|
get name(): string;
|
|
@@ -500,6 +390,8 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
500
390
|
set loading(value: boolean);
|
|
501
391
|
get readonly(): boolean;
|
|
502
392
|
set readonly(value: boolean);
|
|
393
|
+
get clearable(): boolean;
|
|
394
|
+
set clearable(value: boolean);
|
|
503
395
|
get required(): boolean;
|
|
504
396
|
set required(value: boolean);
|
|
505
397
|
get searchable(): "auto" | "always" | "never";
|
|
@@ -510,9 +402,10 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
510
402
|
set debounce(value: number | string);
|
|
511
403
|
get size(): Size;
|
|
512
404
|
set size(value: Size);
|
|
405
|
+
get align(): "start" | "end";
|
|
406
|
+
set align(value: "start" | "end");
|
|
513
407
|
get flavor(): Flavor;
|
|
514
408
|
set flavor(value: Flavor);
|
|
515
409
|
get form(): HTMLFormElement | null;
|
|
516
410
|
}
|
|
517
411
|
export {};
|
|
518
|
-
//# sourceMappingURL=select.d.ts.map
|