tyrell-components 1.0.0-RC13 → 1.0.0-RC15
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 +10 -2
- package/css/tyrell-theme.css +192 -180
- package/css/tyrell.css +23 -0
- package/dist/tyrell-colors-static.css +1 -316
- package/dist/tyrell-theme.css +1 -1454
- package/dist/tyrell.css +1 -1371
- package/dist/tyrell.js +1 -1
- package/lib/base/ty-component.d.ts +20 -10
- package/lib/base/ty-component.js +196 -319
- package/lib/components/button.d.ts +3 -17
- package/lib/components/button.js +261 -295
- package/lib/components/calendar-month.d.ts +4 -50
- package/lib/components/calendar-month.js +443 -582
- package/lib/components/calendar-navigation.d.ts +3 -48
- package/lib/components/calendar-navigation.js +239 -362
- package/lib/components/calendar.d.ts +8 -83
- package/lib/components/calendar.js +616 -829
- package/lib/components/checkbox.d.ts +5 -72
- package/lib/components/checkbox.js +273 -416
- package/lib/components/copy.d.ts +4 -57
- package/lib/components/copy.js +280 -397
- package/lib/components/date-picker.d.ts +21 -163
- package/lib/components/date-picker.js +1143 -1674
- package/lib/components/file-upload.d.ts +9 -15
- package/lib/components/file-upload.js +404 -426
- package/lib/components/icon.d.ts +3 -24
- package/lib/components/icon.js +141 -230
- package/lib/components/input.d.ts +8 -108
- package/lib/components/input.js +593 -784
- package/lib/components/modal.d.ts +17 -26
- package/lib/components/modal.js +340 -484
- package/lib/components/option.d.ts +2 -9
- package/lib/components/option.js +168 -216
- package/lib/components/popup.d.ts +2 -17
- package/lib/components/popup.js +249 -380
- package/lib/components/radio.d.ts +5 -25
- package/lib/components/radio.js +407 -461
- package/lib/components/resize-observer.d.ts +3 -30
- package/lib/components/resize-observer.js +69 -103
- package/lib/components/scroll-container.d.ts +2 -12
- package/lib/components/scroll-container.js +293 -338
- package/lib/components/select.d.ts +87 -159
- package/lib/components/select.js +1609 -2090
- package/lib/components/selected-tags.d.ts +5 -48
- package/lib/components/selected-tags.js +188 -276
- package/lib/components/step.d.ts +1 -6
- package/lib/components/step.js +62 -68
- package/lib/components/switch.d.ts +1 -12
- package/lib/components/switch.js +214 -247
- package/lib/components/tab.d.ts +1 -6
- package/lib/components/tab.js +62 -69
- package/lib/components/tabs.d.ts +6 -63
- package/lib/components/tabs.js +545 -777
- package/lib/components/tag.d.ts +3 -37
- package/lib/components/tag.js +236 -335
- package/lib/components/textarea.d.ts +7 -87
- package/lib/components/textarea.js +457 -627
- package/lib/components/tooltip.d.ts +3 -11
- package/lib/components/tooltip.js +307 -443
- package/lib/components/wizard.d.ts +6 -54
- package/lib/components/wizard.js +405 -618
- 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 +392 -400
- package/lib/icons/heroicons/mini.d.ts +0 -1
- package/lib/icons/heroicons/mini.js +382 -390
- package/lib/icons/heroicons/outline.d.ts +0 -1
- package/lib/icons/heroicons/outline.js +337 -345
- package/lib/icons/heroicons/solid.d.ts +0 -1
- package/lib/icons/heroicons/solid.js +407 -415
- package/lib/icons/lucide.d.ts +0 -1
- package/lib/icons/lucide.js +24479 -26351
- package/lib/icons/material/filled.d.ts +0 -1
- package/lib/icons/material/filled.js +9653 -9663
- package/lib/icons/material/outlined.d.ts +0 -1
- package/lib/icons/material/outlined.js +10271 -10281
- package/lib/icons/material/round.d.ts +0 -1
- package/lib/icons/material/round.js +10495 -10505
- package/lib/icons/material/sharp.d.ts +0 -1
- package/lib/icons/material/sharp.js +9905 -9915
- package/lib/icons/material/two-tone.d.ts +0 -1
- package/lib/icons/material/two-tone.js +12792 -12802
- package/lib/index.d.ts +0 -1
- package/lib/index.js +21 -41
- package/lib/styles/button.d.ts +2 -20
- package/lib/styles/button.js +202 -404
- package/lib/styles/calendar-month.d.ts +1 -5
- package/lib/styles/calendar-month.js +127 -244
- package/lib/styles/calendar-navigation.d.ts +2 -6
- package/lib/styles/calendar-navigation.js +64 -104
- package/lib/styles/calendar.d.ts +1 -2
- package/lib/styles/calendar.js +9 -22
- package/lib/styles/checkbox.d.ts +0 -1
- package/lib/styles/checkbox.js +45 -94
- package/lib/styles/copy.d.ts +0 -1
- package/lib/styles/copy.js +67 -106
- package/lib/styles/custom-scrollbar.d.ts +1 -2
- package/lib/styles/custom-scrollbar.js +80 -115
- package/lib/styles/date-picker.d.ts +1 -5
- package/lib/styles/date-picker.js +261 -335
- package/lib/styles/field-size.d.ts +6 -0
- package/lib/styles/field-size.js +91 -0
- package/lib/styles/file-upload.d.ts +1 -2
- package/lib/styles/file-upload.js +143 -188
- package/lib/styles/icon.d.ts +2 -6
- package/lib/styles/icon.js +92 -170
- package/lib/styles/input.d.ts +1 -6
- package/lib/styles/input.js +125 -290
- package/lib/styles/modal.d.ts +1 -2
- package/lib/styles/modal.js +71 -108
- package/lib/styles/option.d.ts +2 -6
- package/lib/styles/option.js +49 -64
- package/lib/styles/popup.d.ts +1 -2
- package/lib/styles/popup.js +42 -77
- package/lib/styles/radio.d.ts +0 -1
- package/lib/styles/radio.js +69 -110
- package/lib/styles/resize-observer.d.ts +1 -2
- package/lib/styles/resize-observer.js +2 -12
- package/lib/styles/scroll-container.d.ts +1 -2
- package/lib/styles/scroll-container.js +100 -149
- package/lib/styles/select-base.d.ts +0 -1
- package/lib/styles/select-base.js +597 -785
- package/lib/styles/select.d.ts +1 -2
- package/lib/styles/select.js +140 -236
- package/lib/styles/step.d.ts +1 -2
- package/lib/styles/step.js +22 -33
- package/lib/styles/switch.d.ts +0 -1
- package/lib/styles/switch.js +34 -73
- package/lib/styles/tab.d.ts +1 -2
- package/lib/styles/tab.js +22 -34
- package/lib/styles/tabs.d.ts +3 -11
- package/lib/styles/tabs.js +190 -222
- package/lib/styles/tag.d.ts +1 -5
- package/lib/styles/tag.js +136 -218
- package/lib/styles/textarea.d.ts +1 -2
- package/lib/styles/textarea.js +210 -319
- package/lib/styles/tooltip.d.ts +0 -1
- package/lib/styles/tooltip.js +3 -13
- package/lib/styles/wizard.d.ts +5 -21
- package/lib/styles/wizard.js +170 -306
- package/lib/types/common.d.ts +2 -2
- package/lib/types/common.js +6 -17
- package/lib/utils/calendar-utils.d.ts +4 -21
- package/lib/utils/calendar-utils.js +100 -273
- package/lib/utils/custom-scrollbar.d.ts +6 -20
- package/lib/utils/custom-scrollbar.js +273 -317
- package/lib/utils/flavor-sheet.d.ts +0 -1
- package/lib/utils/flavor-sheet.js +14 -37
- package/lib/utils/icon-registry.d.ts +0 -2
- package/lib/utils/icon-registry.js +137 -243
- 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 +3 -35
- package/lib/utils/locale.d.ts +2 -23
- package/lib/utils/locale.js +34 -120
- package/lib/utils/mobile.d.ts +0 -1
- package/lib/utils/mobile.js +1 -18
- package/lib/utils/number-format.d.ts +6 -3
- package/lib/utils/number-format.js +54 -110
- package/lib/utils/positioning.d.ts +50 -7
- package/lib/utils/positioning.js +224 -234
- package/lib/utils/property-capture.d.ts +5 -27
- package/lib/utils/property-capture.js +36 -144
- package/lib/utils/property-manager.d.ts +0 -1
- package/lib/utils/property-manager.js +126 -196
- package/lib/utils/resize-observer.d.ts +0 -1
- package/lib/utils/resize-observer.js +23 -59
- package/lib/utils/scroll-lock.d.ts +4 -11
- package/lib/utils/scroll-lock.js +65 -172
- package/lib/utils/styles.d.ts +0 -1
- package/lib/utils/styles.js +17 -41
- package/lib/version.d.ts +1 -2
- package/lib/version.js +1 -11
- package/package.json +4 -4
- 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,57 +1,18 @@
|
|
|
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";
|
|
8
|
+
import { type Placement } from "../utils/positioning.js";
|
|
42
9
|
import { TyComponent } from "../base/ty-component.js";
|
|
43
10
|
import type { PropertyChange } from "../utils/property-manager.js";
|
|
44
|
-
/**
|
|
45
|
-
* Tag data structure
|
|
46
|
-
*/
|
|
47
11
|
interface TagData {
|
|
48
12
|
value: string;
|
|
49
13
|
text: string;
|
|
50
14
|
element: HTMLElement;
|
|
51
15
|
}
|
|
52
|
-
/**
|
|
53
|
-
* Component state structure
|
|
54
|
-
*/
|
|
55
16
|
interface SelectState {
|
|
56
17
|
open: boolean;
|
|
57
18
|
search: string;
|
|
@@ -145,23 +106,27 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
145
106
|
};
|
|
146
107
|
coerce: (v: any) => "none" | "slug";
|
|
147
108
|
};
|
|
148
|
-
|
|
149
|
-
type: "
|
|
109
|
+
notSearchable: {
|
|
110
|
+
type: "boolean";
|
|
150
111
|
visual: boolean;
|
|
151
|
-
default:
|
|
152
|
-
coerce: (v: any) => "auto" | "always" | "never";
|
|
112
|
+
default: boolean;
|
|
153
113
|
};
|
|
154
114
|
align: {
|
|
155
115
|
type: "string";
|
|
156
116
|
visual: boolean;
|
|
157
117
|
default: string;
|
|
158
118
|
validate: (v: any) => boolean;
|
|
159
|
-
coerce: (v: any) => "start" | "end";
|
|
119
|
+
coerce: (v: any) => "start" | "end" | "center";
|
|
160
120
|
};
|
|
161
|
-
|
|
121
|
+
placement: {
|
|
162
122
|
type: "string";
|
|
163
123
|
visual: boolean;
|
|
164
124
|
default: string;
|
|
125
|
+
};
|
|
126
|
+
size: {
|
|
127
|
+
type: "string";
|
|
128
|
+
visual: boolean;
|
|
129
|
+
default: Size;
|
|
165
130
|
validate: (v: any) => boolean;
|
|
166
131
|
coerce: (v: any) => any;
|
|
167
132
|
};
|
|
@@ -176,6 +141,11 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
176
141
|
visual: boolean;
|
|
177
142
|
default: string;
|
|
178
143
|
};
|
|
144
|
+
"selected-label": {
|
|
145
|
+
type: "string";
|
|
146
|
+
visual: boolean;
|
|
147
|
+
default: string;
|
|
148
|
+
};
|
|
179
149
|
"no-options-message": {
|
|
180
150
|
type: "string";
|
|
181
151
|
visual: boolean;
|
|
@@ -204,11 +174,12 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
204
174
|
private _externalSearch;
|
|
205
175
|
private _allowCreate;
|
|
206
176
|
private _createTransform;
|
|
207
|
-
private
|
|
177
|
+
private _notSearchable;
|
|
208
178
|
private _loading;
|
|
209
179
|
private _scrollLockId;
|
|
210
180
|
private _size;
|
|
211
181
|
private _availableLabel;
|
|
182
|
+
private _selectedLabel;
|
|
212
183
|
private _noOptionsMessage;
|
|
213
184
|
private _state;
|
|
214
185
|
private _stubClickHandler;
|
|
@@ -223,22 +194,12 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
223
194
|
private _selectedClone;
|
|
224
195
|
private _customFlavorSheet;
|
|
225
196
|
constructor();
|
|
226
|
-
/**
|
|
227
|
-
* Called when component is connected to DOM
|
|
228
|
-
* TyComponent handles property capture automatically
|
|
229
|
-
*/
|
|
197
|
+
/** TyComponent handles property capture automatically. */
|
|
230
198
|
protected onConnect(): void;
|
|
231
199
|
/** Custom (non-built-in) flavors — see utils/flavor-sheet.ts. */
|
|
232
200
|
private _syncCustomFlavor;
|
|
233
|
-
/**
|
|
234
|
-
* Called when component is disconnected from DOM
|
|
235
|
-
* Clean up event listeners and timers
|
|
236
|
-
*/
|
|
237
201
|
protected onDisconnect(): void;
|
|
238
|
-
/**
|
|
239
|
-
* Called when properties change
|
|
240
|
-
* Handle state synchronization BEFORE render
|
|
241
|
-
*/
|
|
202
|
+
/** Handle state synchronization BEFORE render. */
|
|
242
203
|
protected onPropertiesChanged(changes: PropertyChange[]): void;
|
|
243
204
|
/**
|
|
244
205
|
* Toggle the loading visual state on the open popup.
|
|
@@ -247,27 +208,38 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
247
208
|
* take effect on the next loading toggle.
|
|
248
209
|
*/
|
|
249
210
|
private applyLoadingState;
|
|
250
|
-
/**
|
|
251
|
-
* Get the form value for this component
|
|
252
|
-
* Returns FormData with multiple entries (HTMX standard)
|
|
253
|
-
*/
|
|
211
|
+
/** Form value: a plain entry for single, FormData with repeated entries for multiple (HTMX standard). */
|
|
254
212
|
protected getFormValue(): FormDataEntryValue | FormData | null;
|
|
255
|
-
/**
|
|
256
|
-
* Parse select value (comma-separated string to array)
|
|
257
|
-
*/
|
|
258
213
|
private parseValue;
|
|
214
|
+
/** Initialize component state from the value property / pre-selected children. */
|
|
215
|
+
private initializeState;
|
|
259
216
|
/**
|
|
260
|
-
*
|
|
261
|
-
*
|
|
217
|
+
* Declarative init: no `value` attribute, but markup pre-marked one or more
|
|
218
|
+
* options `selected` — native <select> semantics. This is the ONE place
|
|
219
|
+
* selection is read FROM the DOM rather than treated as a rendering of
|
|
220
|
+
* state (see getSelectedValues()): it seeds initial state, once. After
|
|
221
|
+
* this, `value` rules — flipping an option's `selected` property later
|
|
222
|
+
* does nothing, same as native.
|
|
223
|
+
*
|
|
224
|
+
* Called from initializeState() at connect AND from the child observer:
|
|
225
|
+
* a real HTML parser upgrades a custom element the moment its start tag is
|
|
226
|
+
* seen, BEFORE its children exist — `<ty-select>` connects with zero
|
|
227
|
+
* `<ty-option>` children when it's part of the page's own markup (as
|
|
228
|
+
* opposed to an already-built fragment attached via innerHTML/appendChild,
|
|
229
|
+
* where children exist at connect). Calling this only at connect would
|
|
230
|
+
* silently miss every option parsed after that instant, which is the
|
|
231
|
+
* common case for markup that is literally in the page's initial HTML.
|
|
232
|
+
*
|
|
233
|
+
* Safe to call repeatedly: no-ops once `value` has ever been explicitly
|
|
234
|
+
* set (attribute or property) or state is already non-empty — including
|
|
235
|
+
* after a real `.clear()`, which removes `selected` from every option via
|
|
236
|
+
* syncSelectedTags, so there is nothing left here to (re-)seed from.
|
|
262
237
|
*/
|
|
263
|
-
private
|
|
238
|
+
private resolveDeclarativeSelection;
|
|
264
239
|
/**
|
|
265
240
|
* Get all option elements from the component (ty-option preferred, ty-tag accepted)
|
|
266
241
|
*/
|
|
267
242
|
private getTagElements;
|
|
268
|
-
/**
|
|
269
|
-
* Extract value and text from a ty-tag element
|
|
270
|
-
*/
|
|
271
243
|
private getTagData;
|
|
272
244
|
/**
|
|
273
245
|
* Select an option - attribute only. The option stays in the list with
|
|
@@ -279,12 +251,17 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
279
251
|
*/
|
|
280
252
|
private deselectTag;
|
|
281
253
|
/**
|
|
282
|
-
* Get array of currently selected values
|
|
254
|
+
* Get the array of currently selected values.
|
|
255
|
+
*
|
|
256
|
+
* Reads STATE (`_state.selectedValues`), not the DOM: `value` is the
|
|
257
|
+
* selection, and an option's `selected` attribute is a rendering of it
|
|
258
|
+
* (written by syncSelectedTags below), never the other way round. This
|
|
259
|
+
* matters whenever options don't fully reflect the selection — external
|
|
260
|
+
* search legitimately has a selected value with no matching option
|
|
261
|
+
* present; a DOM scan would report empty and desync .value, `required`
|
|
262
|
+
* validation and the click-toggle logic from what's actually selected.
|
|
283
263
|
*/
|
|
284
264
|
private getSelectedValues;
|
|
285
|
-
/**
|
|
286
|
-
* Sync tag selection states with desired values
|
|
287
|
-
*/
|
|
288
265
|
private syncSelectedTags;
|
|
289
266
|
/**
|
|
290
267
|
* role="option" for every current option/tag — separate from
|
|
@@ -294,18 +271,12 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
294
271
|
* on every light-DOM change.
|
|
295
272
|
*/
|
|
296
273
|
private ensureOptionRoles;
|
|
297
|
-
/**
|
|
298
|
-
* Central update function - synchronizes everything
|
|
299
|
-
* Uses TyComponent's property system for proper lifecycle
|
|
300
|
-
*/
|
|
274
|
+
/** Central update function — synchronizes everything via TyComponent's property system. */
|
|
301
275
|
private updateComponentValue;
|
|
302
276
|
/**
|
|
303
277
|
* Build rich item info for values, read off the matching option elements
|
|
304
278
|
*/
|
|
305
279
|
private getSelectedItems;
|
|
306
|
-
/**
|
|
307
|
-
* Calculate and set dropdown position with smart direction detection
|
|
308
|
-
*/
|
|
309
280
|
private calculatePosition;
|
|
310
281
|
private _setupOptionsScrollbar;
|
|
311
282
|
private _destroyOptionsScrollbar;
|
|
@@ -319,19 +290,9 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
319
290
|
* implement.
|
|
320
291
|
*/
|
|
321
292
|
private openDropdown;
|
|
322
|
-
/**
|
|
323
|
-
* Close dropdown dialog (desktop mode)
|
|
324
|
-
*/
|
|
325
293
|
private closeDropdown;
|
|
326
|
-
/**
|
|
327
|
-
* Open mobile modal (mobile mode)
|
|
328
|
-
* Now using <dialog> element for native z-index management
|
|
329
|
-
*/
|
|
294
|
+
/** Open mobile modal — <dialog> handles z-index natively. */
|
|
330
295
|
private openMobileModal;
|
|
331
|
-
/**
|
|
332
|
-
* Close mobile modal (mobile mode)
|
|
333
|
-
* Now using <dialog> element for native management
|
|
334
|
-
*/
|
|
335
296
|
private closeMobileModal;
|
|
336
297
|
private handleStubClick;
|
|
337
298
|
/**
|
|
@@ -375,33 +336,19 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
375
336
|
private handleSearchInput;
|
|
376
337
|
private handleKeyboard;
|
|
377
338
|
/**
|
|
378
|
-
*
|
|
339
|
+
* Next tag index in `direction` (-1/1) that isn't disabled, wrapping
|
|
340
|
+
* around — mirrors handleTagClick's disabled check so keyboard nav can
|
|
341
|
+
* never land on/select what a click already refuses to. Returns -1 if
|
|
342
|
+
* every tag is disabled (or there are none).
|
|
379
343
|
*/
|
|
344
|
+
private nextEnabledTagIndex;
|
|
380
345
|
private filterTags;
|
|
381
|
-
/**
|
|
382
|
-
* Update visibility of tags based on filtered list
|
|
383
|
-
*/
|
|
384
346
|
private updateTagVisibility;
|
|
385
|
-
/**
|
|
386
|
-
* Show/hide the dropdown options area
|
|
387
|
-
*/
|
|
388
347
|
private updateOptionsVisibility;
|
|
389
|
-
/**
|
|
390
|
-
* Clear all tag highlights
|
|
391
|
-
*/
|
|
392
348
|
private clearHighlights;
|
|
393
|
-
/**
|
|
394
|
-
* Highlight tag at specific index
|
|
395
|
-
*/
|
|
396
349
|
private highlightTag;
|
|
397
|
-
/**
|
|
398
|
-
* Dispatch search event for external search handling
|
|
399
|
-
* With optional debounce support
|
|
400
|
-
*/
|
|
350
|
+
/** Dispatch the search event for external search handling, with optional debounce. */
|
|
401
351
|
private dispatchSearchEvent;
|
|
402
|
-
/**
|
|
403
|
-
* Fire the actual search event
|
|
404
|
-
*/
|
|
405
352
|
private fireSearchEvent;
|
|
406
353
|
/**
|
|
407
354
|
* Dispatch lifecycle events for popup open/close.
|
|
@@ -410,14 +357,7 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
410
357
|
*/
|
|
411
358
|
private fireOpenEvent;
|
|
412
359
|
private fireCloseEvent;
|
|
413
|
-
/**
|
|
414
|
-
* Dispatch custom change event
|
|
415
|
-
*/
|
|
416
360
|
private dispatchChangeEvent;
|
|
417
|
-
/**
|
|
418
|
-
* Main render method (required by TyComponent)
|
|
419
|
-
* Delegates to mode-specific renderer
|
|
420
|
-
*/
|
|
421
361
|
protected render(): void;
|
|
422
362
|
/**
|
|
423
363
|
* Reflect constraint validation to the owning <form> via ElementInternals.
|
|
@@ -432,49 +372,36 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
432
372
|
* default field chrome so the trigger is styled entirely by the consumer.
|
|
433
373
|
*/
|
|
434
374
|
private setupTriggerSlot;
|
|
435
|
-
/**
|
|
436
|
-
* Setup event listeners
|
|
437
|
-
*/
|
|
438
375
|
private setupEventListeners;
|
|
439
|
-
/**
|
|
440
|
-
* Build CSS class list for stub
|
|
441
|
-
*/
|
|
442
376
|
private buildStubClasses;
|
|
443
|
-
/**
|
|
444
|
-
* Render desktop mode with dialog
|
|
445
|
-
*/
|
|
446
377
|
private renderDesktop;
|
|
447
|
-
/**
|
|
448
|
-
* Render mobile mode with full-screen modal
|
|
449
|
-
* Following dropdown.ts mobile structure
|
|
450
|
-
*/
|
|
451
378
|
private renderMobile;
|
|
452
|
-
/**
|
|
453
|
-
* Setup event listeners for mobile mode
|
|
454
|
-
* Using <dialog> element - backdrop clicks handled natively
|
|
455
|
-
*/
|
|
456
379
|
private setupMobileEventListeners;
|
|
457
|
-
/**
|
|
458
|
-
* Handle mobile stub click - open modal
|
|
459
|
-
*/
|
|
460
380
|
private handleMobileStubClick;
|
|
461
381
|
/** Keyboard-open the (closed) mobile stub — see handleStubKeydown for why this is needed. */
|
|
462
382
|
private handleMobileStubKeydown;
|
|
463
|
-
/**
|
|
464
|
-
* Handle mobile tag click - select and potentially close
|
|
465
|
-
*/
|
|
466
383
|
private handleMobileTagClick;
|
|
384
|
+
private updateMobileSelectedState;
|
|
467
385
|
/**
|
|
468
|
-
*
|
|
386
|
+
* Hand the dialog's spare vertical space to one section or the other. Only
|
|
387
|
+
* one can own it: on a phone there isn't enough height for two scrollable
|
|
388
|
+
* lists to both be usefully tall, so tapping a header trades the space
|
|
389
|
+
* rather than splitting it. Selecting from the list hands it back to
|
|
390
|
+
* "available" — you're still picking, so that's the list you want open.
|
|
469
391
|
*/
|
|
470
|
-
private
|
|
392
|
+
private expandMobileSection;
|
|
471
393
|
/**
|
|
472
|
-
*
|
|
394
|
+
* The selected values as dismissible chips, pinned above the available
|
|
395
|
+
* list so a long list can never scroll the current selection out of sight.
|
|
396
|
+
* Rebuilt wholesale: the strip is small, and diffing it would have to
|
|
397
|
+
* track chip identity for the sake of a handful of nodes.
|
|
473
398
|
*/
|
|
399
|
+
private renderMobileSelectedChips;
|
|
474
400
|
/**
|
|
475
|
-
* Should the popup show a search row? external-search
|
|
476
|
-
* the
|
|
477
|
-
*
|
|
401
|
+
* Should the popup show a search row? external-search/allow-create pin it
|
|
402
|
+
* on (the input is the only way to get a query out at all), not-searchable
|
|
403
|
+
* forces it off, and otherwise it follows the list: shown once there are
|
|
404
|
+
* more options than fit without scrolling.
|
|
478
405
|
*/
|
|
479
406
|
private shouldShowSearch;
|
|
480
407
|
/**
|
|
@@ -532,19 +459,20 @@ export declare class TySelect extends TyComponent<SelectState> {
|
|
|
532
459
|
set clearable(value: boolean);
|
|
533
460
|
get required(): boolean;
|
|
534
461
|
set required(value: boolean);
|
|
535
|
-
get
|
|
536
|
-
set
|
|
462
|
+
get notSearchable(): boolean;
|
|
463
|
+
set notSearchable(value: boolean);
|
|
537
464
|
get externalSearch(): boolean;
|
|
538
465
|
set externalSearch(value: boolean);
|
|
539
466
|
get debounce(): number;
|
|
540
467
|
set debounce(value: number | string);
|
|
541
468
|
get size(): Size;
|
|
542
469
|
set size(value: Size);
|
|
543
|
-
get align(): "start" | "end";
|
|
544
|
-
set align(value: "start" | "end");
|
|
470
|
+
get align(): "start" | "center" | "end";
|
|
471
|
+
set align(value: "start" | "center" | "end");
|
|
472
|
+
get placement(): Placement | "";
|
|
473
|
+
set placement(value: Placement | "");
|
|
545
474
|
get flavor(): Flavor;
|
|
546
475
|
set flavor(value: Flavor);
|
|
547
476
|
get form(): HTMLFormElement | null;
|
|
548
477
|
}
|
|
549
478
|
export {};
|
|
550
|
-
//# sourceMappingURL=select.d.ts.map
|