@ixfx/components 0.5.19 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/index.d.ts +462 -210
- package/bundle/index.d.ts.map +1 -1
- package/bundle/index.js +8027 -6493
- package/bundle/index.js.map +1 -1
- package/dist/ac-text.js +3 -3
- package/dist/ac-token-DVbmHmky.d.ts +107 -0
- package/dist/ac-token-DVbmHmky.d.ts.map +1 -0
- package/dist/ac-token.d.ts +2 -0
- package/dist/ac-token.js +646 -0
- package/dist/ac-token.js.map +1 -0
- package/dist/{button-CphdEaZd.js → button-Bn0BuLpO.js} +2 -3
- package/dist/{button-CphdEaZd.js.map → button-Bn0BuLpO.js.map} +1 -1
- package/dist/button.d.ts +1 -1
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{colour-picker-37NyVenk.js → colour-picker-0stHB90J.js} +18 -8
- package/dist/colour-picker-0stHB90J.js.map +1 -0
- package/dist/colour-picker.d.ts +1 -1
- package/dist/colour-picker.js +1 -1
- package/dist/crumbs.d.ts +2 -2
- package/dist/crumbs.js +1152 -1
- package/dist/crumbs.js.map +1 -0
- package/dist/data-controller-DOlmqNKb.js +171 -0
- package/dist/data-controller-DOlmqNKb.js.map +1 -0
- package/dist/data-display.js +1 -1
- package/dist/data-grid-BeAkORz2.d.ts +215 -0
- package/dist/data-grid-BeAkORz2.d.ts.map +1 -0
- package/dist/data-grid.d.ts +2 -0
- package/dist/data-grid.js +1225 -0
- package/dist/data-grid.js.map +1 -0
- package/dist/data-provider-BAn_-oR1.d.ts +61 -0
- package/dist/data-provider-BAn_-oR1.d.ts.map +1 -0
- package/dist/{defaults-BkWCPJFL.js → defaults-BCiDhZbF.js} +20 -3
- package/dist/defaults-BCiDhZbF.js.map +1 -0
- package/dist/drag-ghost-DtSDvjri.js +85 -0
- package/dist/drag-ghost-DtSDvjri.js.map +1 -0
- package/dist/editable-label.js +1 -1
- package/dist/{incr-search-2pz21xtR.js → element-search-Y8SRfPGM.js} +2 -133
- package/dist/element-search-Y8SRfPGM.js.map +1 -0
- package/dist/fallbacks-DEE1nCTt.js +406 -0
- package/dist/fallbacks-DEE1nCTt.js.map +1 -0
- package/dist/form-CsXJX15p.js +64 -0
- package/dist/form-CsXJX15p.js.map +1 -0
- package/dist/form.d.ts +15 -0
- package/dist/form.d.ts.map +1 -0
- package/dist/form.js +2 -0
- package/dist/grouped-item-lister-CNLMgdIr.d.ts +121 -0
- package/dist/grouped-item-lister-CNLMgdIr.d.ts.map +1 -0
- package/dist/grouped-item-lister.d.ts +2 -0
- package/dist/grouped-item-lister.js +177 -0
- package/dist/grouped-item-lister.js.map +1 -0
- package/dist/{icon-DG9Lm3LT.js → icons-Bm2ByQ3s.js} +6 -3
- package/dist/icons-Bm2ByQ3s.js.map +1 -0
- package/dist/icons.js +2 -8
- package/dist/incr-search-vCzuao-2.js +137 -0
- package/dist/incr-search-vCzuao-2.js.map +1 -0
- package/dist/incr-search.d.ts +1 -1
- package/dist/incr-search.js +2 -1
- package/dist/{index-BKAlRgbq.d.ts → index-BOUaDIW-.d.ts} +4 -1
- package/dist/index-BOUaDIW-.d.ts.map +1 -0
- package/dist/{index-D9u_Q7-b.d.ts → index-Cu5i8zZY.d.ts} +3 -3
- package/dist/{index-D9u_Q7-b.d.ts.map → index-Cu5i8zZY.d.ts.map} +1 -1
- package/dist/{index-DkhBGHgF.d.ts → index-ovq_GTdl.d.ts} +2 -2
- package/dist/{index-DkhBGHgF.d.ts.map → index-ovq_GTdl.d.ts.map} +1 -1
- package/dist/index.d.ts +54 -572
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1898 -4253
- package/dist/index.js.map +1 -1
- package/dist/labelled-radial-input.d.ts +1 -1
- package/dist/labelled-radial-input.js +1 -2
- package/dist/labelled-radial-input.js.map +1 -1
- package/dist/led.d.ts +0 -1
- package/dist/led.d.ts.map +1 -1
- package/dist/led.js +2 -4
- package/dist/led.js.map +1 -1
- package/dist/menu-DIfU70AA.js +1609 -0
- package/dist/menu-DIfU70AA.js.map +1 -0
- package/dist/menu-item-BG5w7fi4.d.ts.map +1 -1
- package/dist/menu.d.ts +1 -1
- package/dist/menu.js +1 -2
- package/dist/miller.d.ts +3 -3
- package/dist/miller.js +3 -3
- package/dist/narrowed-text.d.ts.map +1 -1
- package/dist/narrowed-text.js +4 -4
- package/dist/narrowed-text.js.map +1 -1
- package/dist/notification-pill-DyZydXoZ.d.ts +68 -0
- package/dist/notification-pill-DyZydXoZ.d.ts.map +1 -0
- package/dist/notifier.d.ts +2 -0
- package/dist/notifier.js +146 -0
- package/dist/notifier.js.map +1 -0
- package/dist/panel.js +1 -2
- package/dist/panel.js.map +1 -1
- package/dist/plots.js +1 -1
- package/dist/polar-pad.d.ts +1 -1
- package/dist/polar-pad.js +1 -1
- package/dist/{radial-input-BhZeyyP-.d.ts → radial-input-DXMN55Nz.d.ts} +2 -2
- package/dist/{radial-input-BhZeyyP-.d.ts.map → radial-input-DXMN55Nz.d.ts.map} +1 -1
- package/dist/{radial-input-CVxGH-Cp.js → radial-input-Dk8Wydp5.js} +4 -4
- package/dist/radial-input-Dk8Wydp5.js.map +1 -0
- package/dist/radial-input.d.ts +1 -1
- package/dist/radial-input.js +1 -1
- package/dist/range-input.d.ts +1 -1
- package/dist/range-input.js +1 -1
- package/dist/range.d.ts +1 -1
- package/dist/range.js +1 -1
- package/dist/scroll-fade-CAs1EabA.js +70 -0
- package/dist/scroll-fade-CAs1EabA.js.map +1 -0
- package/dist/select-horiz.d.ts +50 -0
- package/dist/select-horiz.d.ts.map +1 -0
- package/dist/select-horiz.js +263 -0
- package/dist/select-horiz.js.map +1 -0
- package/dist/{slider-input-CzmSVgm7.js → slider-input-CT4gcF-o.js} +2 -2
- package/dist/{slider-input-CzmSVgm7.js.map → slider-input-CT4gcF-o.js.map} +1 -1
- package/dist/{slider-input-TidGhvXt.d.ts → slider-input-XppH3vcy.d.ts} +2 -2
- package/dist/{slider-input-TidGhvXt.d.ts.map → slider-input-XppH3vcy.d.ts.map} +1 -1
- package/dist/slider-input.d.ts +1 -1
- package/dist/slider-input.js +1 -1
- package/dist/snackbar.d.ts +58 -0
- package/dist/snackbar.d.ts.map +1 -0
- package/dist/snackbar.js +265 -0
- package/dist/snackbar.js.map +1 -0
- package/dist/split-layout.js +1 -1
- package/dist/swipe.d.ts +1 -1
- package/dist/swipe.js +1 -1
- package/dist/tabs.js +533 -1
- package/dist/tabs.js.map +1 -0
- package/dist/{tickled-controller-BF2Ea0DE.d.ts → tickled-controller-BtevrRLV.d.ts} +8 -6
- package/dist/tickled-controller-BtevrRLV.d.ts.map +1 -0
- package/dist/{tickled-styles-fNDdqf6l.js → tickled-controller-DkAU-0qL.js} +19 -105
- package/dist/tickled-controller-DkAU-0qL.js.map +1 -0
- package/dist/tickled-styles-BrAHEj1q.js +89 -0
- package/dist/tickled-styles-BrAHEj1q.js.map +1 -0
- package/dist/transitory-label.d.ts +30 -0
- package/dist/transitory-label.d.ts.map +1 -0
- package/dist/transitory-label.js +249 -0
- package/dist/transitory-label.js.map +1 -0
- package/dist/{tree-BtiiDX1a.js → tree-BO6BXI2b.js} +4 -4
- package/dist/{tree-BtiiDX1a.js.map → tree-BO6BXI2b.js.map} +1 -1
- package/dist/{tree-component-DQ9vzdy5.d.ts → tree-component-BvV4muxx.d.ts} +2 -2
- package/dist/{tree-component-DQ9vzdy5.d.ts.map → tree-component-BvV4muxx.d.ts.map} +1 -1
- package/dist/tree.d.ts +3 -3
- package/dist/tree.js +1 -1
- package/dist/{types-DO3gt5vg.d.ts → types-Bc23SI94.d.ts} +3 -61
- package/dist/types-Bc23SI94.d.ts.map +1 -0
- package/dist/types-DlVNJez_.d.ts +41 -0
- package/dist/types-DlVNJez_.d.ts.map +1 -0
- package/dist/vertical-list.d.ts +122 -0
- package/dist/vertical-list.d.ts.map +1 -0
- package/dist/vertical-list.js +737 -0
- package/dist/vertical-list.js.map +1 -0
- package/dist/wheel-nudge-BlSCe_hD.js.map +1 -1
- package/dist/{wheel-nudge-DgMTRYlh.d.ts → wheel-nudge-DGrNzWuE.d.ts} +3 -3
- package/dist/wheel-nudge-DGrNzWuE.d.ts.map +1 -0
- package/dist/{xy-axis-CxHC8z5E.js → xy-axis-B6yMjckW.js} +3 -109
- package/dist/xy-axis-B6yMjckW.js.map +1 -0
- package/dist/xy-pad.d.ts +1 -1
- package/dist/xy-pad.js +1 -1
- package/docs-user/README.md +3 -2
- package/docs-user/ac-token.md +7 -1
- package/docs-user/colour-picker.md +8 -4
- package/docs-user/data-grid.md +248 -0
- package/docs-user/index.json +217 -0
- package/docs-user/llms.txt +57 -0
- package/docs-user/menu.md +11 -8
- package/docs-user/rating.md +102 -0
- package/llms.txt +57 -0
- package/package.json +21 -11
- package/dist/colour-picker-37NyVenk.js.map +0 -1
- package/dist/crumb-navigation-BrB0r14u.js +0 -1220
- package/dist/crumb-navigation-BrB0r14u.js.map +0 -1
- package/dist/defaults-BkWCPJFL.js.map +0 -1
- package/dist/fallbacks-DPgPEqo8.js +0 -218
- package/dist/fallbacks-DPgPEqo8.js.map +0 -1
- package/dist/icon-DG9Lm3LT.js.map +0 -1
- package/dist/icons.js.map +0 -1
- package/dist/incr-search-2pz21xtR.js.map +0 -1
- package/dist/index-BKAlRgbq.d.ts.map +0 -1
- package/dist/interaction-D6efrBLo.js +0 -1
- package/dist/menu-CdwSe_XN.js +0 -825
- package/dist/menu-CdwSe_XN.js.map +0 -1
- package/dist/menu-item-CrmUwIoJ.js +0 -782
- package/dist/menu-item-CrmUwIoJ.js.map +0 -1
- package/dist/radial-input-CVxGH-Cp.js.map +0 -1
- package/dist/registry-CkW7q09Q.js +0 -21
- package/dist/registry-CkW7q09Q.js.map +0 -1
- package/dist/selecthorizontal.d.ts +0 -15
- package/dist/selecthorizontal.d.ts.map +0 -1
- package/dist/selecthorizontal.js +0 -43
- package/dist/selecthorizontal.js.map +0 -1
- package/dist/tab-list-mAoD6L0e.js +0 -615
- package/dist/tab-list-mAoD6L0e.js.map +0 -1
- package/dist/tickled-controller-BF2Ea0DE.d.ts.map +0 -1
- package/dist/tickled-styles-fNDdqf6l.js.map +0 -1
- package/dist/types-DO3gt5vg.d.ts.map +0 -1
- package/dist/wheel-nudge-DgMTRYlh.d.ts.map +0 -1
- package/dist/xy-axis-CxHC8z5E.js.map +0 -1
- package/docs-user/selecthorizontal.md +0 -32
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/styles/fallbacks.ts
|
|
3
|
+
/**
|
|
4
|
+
* Default fallback values for theme CSS variables.
|
|
5
|
+
*
|
|
6
|
+
* Uses `@property` to register each variable with an initial value that acts
|
|
7
|
+
* as a fallback. This means:
|
|
8
|
+
* - If the theme CSS (`src/style.css`) is loaded, its `:root` values cascade
|
|
9
|
+
* in and override these defaults.
|
|
10
|
+
* - If no theme CSS is loaded, these initial values ensure components still
|
|
11
|
+
* have visible backgrounds, text colours, etc.
|
|
12
|
+
*
|
|
13
|
+
* `@property` registration is document-global — it is not scoped per shadow
|
|
14
|
+
* root — so this is registered exactly once (via `_registerThemeFallbacksOnce`
|
|
15
|
+
* below) rather than adopted into every component's shadow-root stylesheet.
|
|
16
|
+
* Registering the same `@property` rule repeatedly across many shadow roots
|
|
17
|
+
* causes Chrome to log "Ignored @property rule" for every repeat.
|
|
18
|
+
*/
|
|
19
|
+
const _themeFallbacksCss = css`
|
|
20
|
+
@property --surface-0 {
|
|
21
|
+
syntax: '<color>';
|
|
22
|
+
inherits: true;
|
|
23
|
+
initial-value: oklch(5% 0.02 240);
|
|
24
|
+
}
|
|
25
|
+
@property --surface-1 {
|
|
26
|
+
syntax: '<color>';
|
|
27
|
+
inherits: true;
|
|
28
|
+
initial-value: oklch(8% 0.02 240);
|
|
29
|
+
}
|
|
30
|
+
@property --surface-2 {
|
|
31
|
+
syntax: '<color>';
|
|
32
|
+
inherits: true;
|
|
33
|
+
initial-value: oklch(12% 0.02 240);
|
|
34
|
+
}
|
|
35
|
+
@property --surface-2-text {
|
|
36
|
+
syntax: '<color>';
|
|
37
|
+
inherits: true;
|
|
38
|
+
initial-value: #fff;
|
|
39
|
+
}
|
|
40
|
+
@property --surface-3 {
|
|
41
|
+
syntax: '<color>';
|
|
42
|
+
inherits: true;
|
|
43
|
+
initial-value: oklch(15% 0.02 240);
|
|
44
|
+
}
|
|
45
|
+
@property --surface-3-text {
|
|
46
|
+
syntax: '<color>';
|
|
47
|
+
inherits: true;
|
|
48
|
+
initial-value: oklch(75% 0.02 240);
|
|
49
|
+
}
|
|
50
|
+
@property --surface-4 {
|
|
51
|
+
syntax: '<color>';
|
|
52
|
+
inherits: true;
|
|
53
|
+
initial-value: oklch(22% 0.02 240);
|
|
54
|
+
}
|
|
55
|
+
@property --surface-4-text {
|
|
56
|
+
syntax: '<color>';
|
|
57
|
+
inherits: true;
|
|
58
|
+
initial-value: #fff;
|
|
59
|
+
}
|
|
60
|
+
@property --surface-5 {
|
|
61
|
+
syntax: '<color>';
|
|
62
|
+
inherits: true;
|
|
63
|
+
initial-value: oklch(19% 0.02 240);
|
|
64
|
+
}
|
|
65
|
+
@property --surface-5-text {
|
|
66
|
+
syntax: '<color>';
|
|
67
|
+
inherits: true;
|
|
68
|
+
initial-value: #fff;
|
|
69
|
+
}
|
|
70
|
+
@property --surface-6 {
|
|
71
|
+
syntax: '<color>';
|
|
72
|
+
inherits: true;
|
|
73
|
+
initial-value: oklch(35% 0.02 240);
|
|
74
|
+
}
|
|
75
|
+
@property --surface-6-text {
|
|
76
|
+
syntax: '<color>';
|
|
77
|
+
inherits: true;
|
|
78
|
+
initial-value: #fff;
|
|
79
|
+
}
|
|
80
|
+
@property --surface-muted-text {
|
|
81
|
+
syntax: '<color>';
|
|
82
|
+
inherits: true;
|
|
83
|
+
initial-value: oklch(55% 0.02 240);
|
|
84
|
+
}
|
|
85
|
+
@property --content {
|
|
86
|
+
syntax: '<color>';
|
|
87
|
+
inherits: true;
|
|
88
|
+
initial-value: oklch(10% 0.01 240);
|
|
89
|
+
}
|
|
90
|
+
@property --content-text {
|
|
91
|
+
syntax: '<color>';
|
|
92
|
+
inherits: true;
|
|
93
|
+
initial-value: #fff;
|
|
94
|
+
}
|
|
95
|
+
@property --accent {
|
|
96
|
+
syntax: '<color>';
|
|
97
|
+
inherits: true;
|
|
98
|
+
initial-value: oklch(60% 0.15 140);
|
|
99
|
+
}
|
|
100
|
+
@property --accent-text {
|
|
101
|
+
syntax: '<color>';
|
|
102
|
+
inherits: true;
|
|
103
|
+
initial-value: #fff;
|
|
104
|
+
}
|
|
105
|
+
@property --error {
|
|
106
|
+
syntax: '<color>';
|
|
107
|
+
inherits: true;
|
|
108
|
+
initial-value: oklch(60% 0.15 20);
|
|
109
|
+
}
|
|
110
|
+
@property --error-text {
|
|
111
|
+
syntax: '<color>';
|
|
112
|
+
inherits: true;
|
|
113
|
+
initial-value: #fff;
|
|
114
|
+
}
|
|
115
|
+
@property --border {
|
|
116
|
+
syntax: '*';
|
|
117
|
+
inherits: true;
|
|
118
|
+
initial-value: 1px solid oklch(25% 0.02 240);
|
|
119
|
+
}
|
|
120
|
+
@property --border-subtle {
|
|
121
|
+
syntax: '*';
|
|
122
|
+
inherits: true;
|
|
123
|
+
initial-value: 1px solid oklch(18% 0.02 240);
|
|
124
|
+
}
|
|
125
|
+
@property --disabled-opacity {
|
|
126
|
+
syntax: '<number>';
|
|
127
|
+
inherits: true;
|
|
128
|
+
initial-value: 0.5;
|
|
129
|
+
}
|
|
130
|
+
@property --transition {
|
|
131
|
+
syntax: '<time>';
|
|
132
|
+
inherits: true;
|
|
133
|
+
initial-value: 0.15s;
|
|
134
|
+
}
|
|
135
|
+
@property --prominence-idle-opacity {
|
|
136
|
+
syntax: '<number>';
|
|
137
|
+
inherits: true;
|
|
138
|
+
initial-value: 0.6;
|
|
139
|
+
}
|
|
140
|
+
@property --prominence-idle-saturate {
|
|
141
|
+
syntax: '<number>';
|
|
142
|
+
inherits: true;
|
|
143
|
+
initial-value: 0.4;
|
|
144
|
+
}
|
|
145
|
+
@property --prominence-tickled-opacity {
|
|
146
|
+
syntax: '<number>';
|
|
147
|
+
inherits: true;
|
|
148
|
+
initial-value: 0.85;
|
|
149
|
+
}
|
|
150
|
+
@property --prominence-tickled-saturate {
|
|
151
|
+
syntax: '<number>';
|
|
152
|
+
inherits: true;
|
|
153
|
+
initial-value: 0.8;
|
|
154
|
+
}
|
|
155
|
+
@property --prominence-disabled-opacity {
|
|
156
|
+
syntax: '<number>';
|
|
157
|
+
inherits: true;
|
|
158
|
+
initial-value: 0.3;
|
|
159
|
+
}
|
|
160
|
+
@property --prominence-disabled-saturate {
|
|
161
|
+
syntax: '<number>';
|
|
162
|
+
inherits: true;
|
|
163
|
+
initial-value: 0.1;
|
|
164
|
+
}
|
|
165
|
+
@property --crumb-item-bg {
|
|
166
|
+
syntax: '<color>';
|
|
167
|
+
inherits: true;
|
|
168
|
+
initial-value: transparent;
|
|
169
|
+
}
|
|
170
|
+
@property --crumb-item-bg-tickled {
|
|
171
|
+
syntax: '<color>';
|
|
172
|
+
inherits: true;
|
|
173
|
+
initial-value: var(--surface-5);
|
|
174
|
+
}
|
|
175
|
+
@property --crumb-item-text-tickled {
|
|
176
|
+
syntax: '<color>';
|
|
177
|
+
inherits: true;
|
|
178
|
+
initial-value: inherit;
|
|
179
|
+
}
|
|
180
|
+
@property --crumb-item-border {
|
|
181
|
+
syntax: '*';
|
|
182
|
+
inherits: true;
|
|
183
|
+
initial-value: 1px solid transparent;
|
|
184
|
+
}
|
|
185
|
+
@property --crumb-item-border-tickled {
|
|
186
|
+
syntax: '<color>';
|
|
187
|
+
inherits: true;
|
|
188
|
+
initial-value: var(--accent);
|
|
189
|
+
}
|
|
190
|
+
@property --crumb-item-padding {
|
|
191
|
+
syntax: '*';
|
|
192
|
+
inherits: true;
|
|
193
|
+
initial-value: var(--space-xs);
|
|
194
|
+
}
|
|
195
|
+
@property --crumb-item-border-radius {
|
|
196
|
+
syntax: '<length>';
|
|
197
|
+
inherits: true;
|
|
198
|
+
initial-value: var(--radius-m);
|
|
199
|
+
}
|
|
200
|
+
@property --crumb-item-gap {
|
|
201
|
+
syntax: '<length>';
|
|
202
|
+
inherits: true;
|
|
203
|
+
initial-value: var(--space-xs);
|
|
204
|
+
}
|
|
205
|
+
@property --crumb-separator {
|
|
206
|
+
syntax: '<color>';
|
|
207
|
+
inherits: true;
|
|
208
|
+
initial-value: var(--surface-muted-text);
|
|
209
|
+
}
|
|
210
|
+
@property --crumb-truncate-min-width {
|
|
211
|
+
syntax: '<length>';
|
|
212
|
+
inherits: true;
|
|
213
|
+
initial-value: 5ch;
|
|
214
|
+
}
|
|
215
|
+
@property --space-xs {
|
|
216
|
+
syntax: '<length>';
|
|
217
|
+
inherits: true;
|
|
218
|
+
initial-value: 3px;
|
|
219
|
+
}
|
|
220
|
+
@property --space-s {
|
|
221
|
+
syntax: '<length>';
|
|
222
|
+
inherits: true;
|
|
223
|
+
initial-value: 4px;
|
|
224
|
+
}
|
|
225
|
+
@property --space-m {
|
|
226
|
+
syntax: '<length>';
|
|
227
|
+
inherits: true;
|
|
228
|
+
initial-value: 8px;
|
|
229
|
+
}
|
|
230
|
+
@property --space-l {
|
|
231
|
+
syntax: '<length>';
|
|
232
|
+
inherits: true;
|
|
233
|
+
initial-value: 12px;
|
|
234
|
+
}
|
|
235
|
+
@property --space-xl {
|
|
236
|
+
syntax: '<length>';
|
|
237
|
+
inherits: true;
|
|
238
|
+
initial-value: 16px;
|
|
239
|
+
}
|
|
240
|
+
@property --space-2xl {
|
|
241
|
+
syntax: '<length>';
|
|
242
|
+
inherits: true;
|
|
243
|
+
initial-value: 20px;
|
|
244
|
+
}
|
|
245
|
+
@property --text-xs {
|
|
246
|
+
syntax: '<length>';
|
|
247
|
+
inherits: true;
|
|
248
|
+
initial-value: 10px;
|
|
249
|
+
}
|
|
250
|
+
@property --text-s {
|
|
251
|
+
syntax: '<length>';
|
|
252
|
+
inherits: true;
|
|
253
|
+
initial-value: 11px;
|
|
254
|
+
}
|
|
255
|
+
@property --text-m {
|
|
256
|
+
syntax: '<length>';
|
|
257
|
+
inherits: true;
|
|
258
|
+
initial-value: 12px;
|
|
259
|
+
}
|
|
260
|
+
@property --text-l {
|
|
261
|
+
syntax: '<length>';
|
|
262
|
+
inherits: true;
|
|
263
|
+
initial-value: 13px;
|
|
264
|
+
}
|
|
265
|
+
@property --text-xl {
|
|
266
|
+
syntax: '<length>';
|
|
267
|
+
inherits: true;
|
|
268
|
+
initial-value: 16px;
|
|
269
|
+
}
|
|
270
|
+
@property --text-2xl {
|
|
271
|
+
syntax: '<length>';
|
|
272
|
+
inherits: true;
|
|
273
|
+
initial-value: 20px;
|
|
274
|
+
}
|
|
275
|
+
@property --font-weight-bold {
|
|
276
|
+
syntax: '<number>';
|
|
277
|
+
inherits: true;
|
|
278
|
+
initial-value: 600;
|
|
279
|
+
}
|
|
280
|
+
@property --radius-s {
|
|
281
|
+
syntax: '<length>';
|
|
282
|
+
inherits: true;
|
|
283
|
+
initial-value: 3px;
|
|
284
|
+
}
|
|
285
|
+
@property --radius-m {
|
|
286
|
+
syntax: '<length>';
|
|
287
|
+
inherits: true;
|
|
288
|
+
initial-value: 4px;
|
|
289
|
+
}
|
|
290
|
+
@property --radius-l {
|
|
291
|
+
syntax: '<length>';
|
|
292
|
+
inherits: true;
|
|
293
|
+
initial-value: 6px;
|
|
294
|
+
}
|
|
295
|
+
@property --radius-xl {
|
|
296
|
+
syntax: '<length>';
|
|
297
|
+
inherits: true;
|
|
298
|
+
initial-value: 8px;
|
|
299
|
+
}
|
|
300
|
+
@property --shadow-m {
|
|
301
|
+
syntax: '*';
|
|
302
|
+
inherits: true;
|
|
303
|
+
initial-value: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
304
|
+
}
|
|
305
|
+
@property --shadow-l {
|
|
306
|
+
syntax: '*';
|
|
307
|
+
inherits: true;
|
|
308
|
+
initial-value: 0 4px 24px rgba(0, 0, 0, 0.5);
|
|
309
|
+
}
|
|
310
|
+
@property --item-bg {
|
|
311
|
+
syntax: '<color>';
|
|
312
|
+
inherits: true;
|
|
313
|
+
initial-value: transparent;
|
|
314
|
+
}
|
|
315
|
+
@property --item-bg-tickled {
|
|
316
|
+
syntax: '<color>';
|
|
317
|
+
inherits: true;
|
|
318
|
+
initial-value: oklch(19% 0.02 240);
|
|
319
|
+
}
|
|
320
|
+
@property --item-bg-selected {
|
|
321
|
+
syntax: '<color>';
|
|
322
|
+
inherits: true;
|
|
323
|
+
initial-value: oklch(60% 0.15 140);
|
|
324
|
+
}
|
|
325
|
+
@property --item-bg-selected-tickled {
|
|
326
|
+
syntax: '<color>';
|
|
327
|
+
inherits: true;
|
|
328
|
+
initial-value: color-mix(in oklch, oklch(60% 0.15 140) 80%, oklch(0% 0 0));
|
|
329
|
+
}
|
|
330
|
+
@property --item-text-tickled {
|
|
331
|
+
syntax: '<color>';
|
|
332
|
+
inherits: true;
|
|
333
|
+
initial-value: #fff;
|
|
334
|
+
}
|
|
335
|
+
@property --item-text-selected {
|
|
336
|
+
syntax: '<color>';
|
|
337
|
+
inherits: true;
|
|
338
|
+
initial-value: #fff;
|
|
339
|
+
}
|
|
340
|
+
@property --item-border {
|
|
341
|
+
syntax: '*';
|
|
342
|
+
inherits: true;
|
|
343
|
+
initial-value: 1px solid oklch(19% 0.02 240);
|
|
344
|
+
}
|
|
345
|
+
@property --item-border-tickled {
|
|
346
|
+
syntax: '*';
|
|
347
|
+
inherits: true;
|
|
348
|
+
initial-value: 1px solid color-mix(in oklch, oklch(60% 0.15 140) 40%, transparent);
|
|
349
|
+
}
|
|
350
|
+
@property --item-border-selected {
|
|
351
|
+
syntax: '*';
|
|
352
|
+
inherits: true;
|
|
353
|
+
initial-value: 1px dashed oklch(60% 0.15 140);
|
|
354
|
+
}
|
|
355
|
+
@property --item-border-active {
|
|
356
|
+
syntax: '*';
|
|
357
|
+
inherits: true;
|
|
358
|
+
initial-value: 2px solid oklch(60% 0.15 140);
|
|
359
|
+
}
|
|
360
|
+
@property --item-border-dragged {
|
|
361
|
+
syntax: '*';
|
|
362
|
+
inherits: true;
|
|
363
|
+
initial-value: 2px dotted color-mix(in oklch, oklch(60% 0.15 140) 80%, transparent);
|
|
364
|
+
}
|
|
365
|
+
@property --item-border-disabled {
|
|
366
|
+
syntax: '*';
|
|
367
|
+
inherits: true;
|
|
368
|
+
initial-value: 1px solid oklch(22% 0.02 240);
|
|
369
|
+
}
|
|
370
|
+
@property --item-padding {
|
|
371
|
+
syntax: '*';
|
|
372
|
+
inherits: true;
|
|
373
|
+
initial-value: 4px 8px;
|
|
374
|
+
}
|
|
375
|
+
@property --item-border-radius {
|
|
376
|
+
syntax: '<length>';
|
|
377
|
+
inherits: true;
|
|
378
|
+
initial-value: 4px;
|
|
379
|
+
}
|
|
380
|
+
@property --item-icon-spacing {
|
|
381
|
+
syntax: '<length>';
|
|
382
|
+
inherits: true;
|
|
383
|
+
initial-value: 4px;
|
|
384
|
+
}
|
|
385
|
+
`;
|
|
386
|
+
let _themeFallbacksRegistered = false;
|
|
387
|
+
function _registerThemeFallbacksOnce() {
|
|
388
|
+
if (_themeFallbacksRegistered || typeof document === `undefined`) return;
|
|
389
|
+
_themeFallbacksRegistered = true;
|
|
390
|
+
const styleEl = document.createElement(`style`);
|
|
391
|
+
styleEl.textContent = _themeFallbacksCss.cssText;
|
|
392
|
+
document.head.append(styleEl);
|
|
393
|
+
}
|
|
394
|
+
_registerThemeFallbacksOnce();
|
|
395
|
+
/**
|
|
396
|
+
* Spread this into any component whose styles reference theme variables.
|
|
397
|
+
* It is an empty stylesheet — the actual `@property` rules are registered
|
|
398
|
+
* once at the document level as a side effect of importing this module — so
|
|
399
|
+
* this exists only to keep the familiar `static styles = [themeFallbacks, ...]`
|
|
400
|
+
* pattern working across all consuming components.
|
|
401
|
+
*/
|
|
402
|
+
const themeFallbacks = css``;
|
|
403
|
+
//#endregion
|
|
404
|
+
export { themeFallbacks as t };
|
|
405
|
+
|
|
406
|
+
//# sourceMappingURL=fallbacks-DEE1nCTt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fallbacks-DEE1nCTt.js","names":[],"sources":["../src/styles/fallbacks.ts"],"sourcesContent":["import { css } from 'lit';\n\n/**\n * Default fallback values for theme CSS variables.\n *\n * Uses `@property` to register each variable with an initial value that acts\n * as a fallback. This means:\n * - If the theme CSS (`src/style.css`) is loaded, its `:root` values cascade\n * in and override these defaults.\n * - If no theme CSS is loaded, these initial values ensure components still\n * have visible backgrounds, text colours, etc.\n *\n * `@property` registration is document-global — it is not scoped per shadow\n * root — so this is registered exactly once (via `_registerThemeFallbacksOnce`\n * below) rather than adopted into every component's shadow-root stylesheet.\n * Registering the same `@property` rule repeatedly across many shadow roots\n * causes Chrome to log \"Ignored @property rule\" for every repeat.\n */\nconst _themeFallbacksCss = css`\n @property --surface-0 {\n syntax: '<color>';\n inherits: true;\n initial-value: oklch(5% 0.02 240);\n }\n @property --surface-1 {\n syntax: '<color>';\n inherits: true;\n initial-value: oklch(8% 0.02 240);\n }\n @property --surface-2 {\n syntax: '<color>';\n inherits: true;\n initial-value: oklch(12% 0.02 240);\n }\n @property --surface-2-text {\n syntax: '<color>';\n inherits: true;\n initial-value: #fff;\n }\n @property --surface-3 {\n syntax: '<color>';\n inherits: true;\n initial-value: oklch(15% 0.02 240);\n }\n @property --surface-3-text {\n syntax: '<color>';\n inherits: true;\n initial-value: oklch(75% 0.02 240);\n }\n @property --surface-4 {\n syntax: '<color>';\n inherits: true;\n initial-value: oklch(22% 0.02 240);\n }\n @property --surface-4-text {\n syntax: '<color>';\n inherits: true;\n initial-value: #fff;\n }\n @property --surface-5 {\n syntax: '<color>';\n inherits: true;\n initial-value: oklch(19% 0.02 240);\n }\n @property --surface-5-text {\n syntax: '<color>';\n inherits: true;\n initial-value: #fff;\n }\n @property --surface-6 {\n syntax: '<color>';\n inherits: true;\n initial-value: oklch(35% 0.02 240);\n }\n @property --surface-6-text {\n syntax: '<color>';\n inherits: true;\n initial-value: #fff;\n }\n @property --surface-muted-text {\n syntax: '<color>';\n inherits: true;\n initial-value: oklch(55% 0.02 240);\n }\n @property --content {\n syntax: '<color>';\n inherits: true;\n initial-value: oklch(10% 0.01 240);\n }\n @property --content-text {\n syntax: '<color>';\n inherits: true;\n initial-value: #fff;\n }\n @property --accent {\n syntax: '<color>';\n inherits: true;\n initial-value: oklch(60% 0.15 140);\n }\n @property --accent-text {\n syntax: '<color>';\n inherits: true;\n initial-value: #fff;\n }\n @property --error {\n syntax: '<color>';\n inherits: true;\n initial-value: oklch(60% 0.15 20);\n }\n @property --error-text {\n syntax: '<color>';\n inherits: true;\n initial-value: #fff;\n }\n @property --border {\n syntax: '*';\n inherits: true;\n initial-value: 1px solid oklch(25% 0.02 240);\n }\n @property --border-subtle {\n syntax: '*';\n inherits: true;\n initial-value: 1px solid oklch(18% 0.02 240);\n }\n @property --disabled-opacity {\n syntax: '<number>';\n inherits: true;\n initial-value: 0.5;\n }\n @property --transition {\n syntax: '<time>';\n inherits: true;\n initial-value: 0.15s;\n }\n @property --prominence-idle-opacity {\n syntax: '<number>';\n inherits: true;\n initial-value: 0.6;\n }\n @property --prominence-idle-saturate {\n syntax: '<number>';\n inherits: true;\n initial-value: 0.4;\n }\n @property --prominence-tickled-opacity {\n syntax: '<number>';\n inherits: true;\n initial-value: 0.85;\n }\n @property --prominence-tickled-saturate {\n syntax: '<number>';\n inherits: true;\n initial-value: 0.8;\n }\n @property --prominence-disabled-opacity {\n syntax: '<number>';\n inherits: true;\n initial-value: 0.3;\n }\n @property --prominence-disabled-saturate {\n syntax: '<number>';\n inherits: true;\n initial-value: 0.1;\n }\n @property --crumb-item-bg {\n syntax: '<color>';\n inherits: true;\n initial-value: transparent;\n }\n @property --crumb-item-bg-tickled {\n syntax: '<color>';\n inherits: true;\n initial-value: var(--surface-5);\n }\n @property --crumb-item-text-tickled {\n syntax: '<color>';\n inherits: true;\n initial-value: inherit;\n }\n @property --crumb-item-border {\n syntax: '*';\n inherits: true;\n initial-value: 1px solid transparent;\n }\n @property --crumb-item-border-tickled {\n syntax: '<color>';\n inherits: true;\n initial-value: var(--accent);\n }\n @property --crumb-item-padding {\n syntax: '*';\n inherits: true;\n initial-value: var(--space-xs);\n }\n @property --crumb-item-border-radius {\n syntax: '<length>';\n inherits: true;\n initial-value: var(--radius-m);\n }\n @property --crumb-item-gap {\n syntax: '<length>';\n inherits: true;\n initial-value: var(--space-xs);\n }\n @property --crumb-separator {\n syntax: '<color>';\n inherits: true;\n initial-value: var(--surface-muted-text);\n }\n @property --crumb-truncate-min-width {\n syntax: '<length>';\n inherits: true;\n initial-value: 5ch;\n }\n @property --space-xs {\n syntax: '<length>';\n inherits: true;\n initial-value: 3px;\n }\n @property --space-s {\n syntax: '<length>';\n inherits: true;\n initial-value: 4px;\n }\n @property --space-m {\n syntax: '<length>';\n inherits: true;\n initial-value: 8px;\n }\n @property --space-l {\n syntax: '<length>';\n inherits: true;\n initial-value: 12px;\n }\n @property --space-xl {\n syntax: '<length>';\n inherits: true;\n initial-value: 16px;\n }\n @property --space-2xl {\n syntax: '<length>';\n inherits: true;\n initial-value: 20px;\n }\n @property --text-xs {\n syntax: '<length>';\n inherits: true;\n initial-value: 10px;\n }\n @property --text-s {\n syntax: '<length>';\n inherits: true;\n initial-value: 11px;\n }\n @property --text-m {\n syntax: '<length>';\n inherits: true;\n initial-value: 12px;\n }\n @property --text-l {\n syntax: '<length>';\n inherits: true;\n initial-value: 13px;\n }\n @property --text-xl {\n syntax: '<length>';\n inherits: true;\n initial-value: 16px;\n }\n @property --text-2xl {\n syntax: '<length>';\n inherits: true;\n initial-value: 20px;\n }\n @property --font-weight-bold {\n syntax: '<number>';\n inherits: true;\n initial-value: 600;\n }\n @property --radius-s {\n syntax: '<length>';\n inherits: true;\n initial-value: 3px;\n }\n @property --radius-m {\n syntax: '<length>';\n inherits: true;\n initial-value: 4px;\n }\n @property --radius-l {\n syntax: '<length>';\n inherits: true;\n initial-value: 6px;\n }\n @property --radius-xl {\n syntax: '<length>';\n inherits: true;\n initial-value: 8px;\n }\n @property --shadow-m {\n syntax: '*';\n inherits: true;\n initial-value: 0 4px 12px rgba(0, 0, 0, 0.3);\n }\n @property --shadow-l {\n syntax: '*';\n inherits: true;\n initial-value: 0 4px 24px rgba(0, 0, 0, 0.5);\n }\n @property --item-bg {\n syntax: '<color>';\n inherits: true;\n initial-value: transparent;\n }\n @property --item-bg-tickled {\n syntax: '<color>';\n inherits: true;\n initial-value: oklch(19% 0.02 240);\n }\n @property --item-bg-selected {\n syntax: '<color>';\n inherits: true;\n initial-value: oklch(60% 0.15 140);\n }\n @property --item-bg-selected-tickled {\n syntax: '<color>';\n inherits: true;\n initial-value: color-mix(in oklch, oklch(60% 0.15 140) 80%, oklch(0% 0 0));\n }\n @property --item-text-tickled {\n syntax: '<color>';\n inherits: true;\n initial-value: #fff;\n }\n @property --item-text-selected {\n syntax: '<color>';\n inherits: true;\n initial-value: #fff;\n }\n @property --item-border {\n syntax: '*';\n inherits: true;\n initial-value: 1px solid oklch(19% 0.02 240);\n }\n @property --item-border-tickled {\n syntax: '*';\n inherits: true;\n initial-value: 1px solid color-mix(in oklch, oklch(60% 0.15 140) 40%, transparent);\n }\n @property --item-border-selected {\n syntax: '*';\n inherits: true;\n initial-value: 1px dashed oklch(60% 0.15 140);\n }\n @property --item-border-active {\n syntax: '*';\n inherits: true;\n initial-value: 2px solid oklch(60% 0.15 140);\n }\n @property --item-border-dragged {\n syntax: '*';\n inherits: true;\n initial-value: 2px dotted color-mix(in oklch, oklch(60% 0.15 140) 80%, transparent);\n }\n @property --item-border-disabled {\n syntax: '*';\n inherits: true;\n initial-value: 1px solid oklch(22% 0.02 240);\n }\n @property --item-padding {\n syntax: '*';\n inherits: true;\n initial-value: 4px 8px;\n }\n @property --item-border-radius {\n syntax: '<length>';\n inherits: true;\n initial-value: 4px;\n }\n @property --item-icon-spacing {\n syntax: '<length>';\n inherits: true;\n initial-value: 4px;\n }\n`;\n\nlet _themeFallbacksRegistered = false;\n\nfunction _registerThemeFallbacksOnce(): void {\n if (_themeFallbacksRegistered || typeof document === `undefined`)\n return;\n _themeFallbacksRegistered = true;\n const styleEl = document.createElement(`style`);\n styleEl.textContent = _themeFallbacksCss.cssText;\n document.head.append(styleEl);\n}\n\n_registerThemeFallbacksOnce();\n\n/**\n * Spread this into any component whose styles reference theme variables.\n * It is an empty stylesheet — the actual `@property` rules are registered\n * once at the document level as a side effect of importing this module — so\n * this exists only to keep the familiar `static styles = [themeFallbacks, ...]`\n * pattern working across all consuming components.\n */\nexport const themeFallbacks = css``;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgX9B,IAAI,4BAA4B;AAEhC,SAAS,8BAAoC;CAC3C,IAAI,6BAA6B,OAAO,aAAa,aACnD;CACF,4BAA4B;CAC5B,MAAM,UAAU,SAAS,cAAc,OAAO;CAC9C,QAAQ,cAAc,mBAAmB;CACzC,SAAS,KAAK,OAAO,OAAO;AAC9B;AAEA,4BAA4B;;;;;;;;AAS5B,MAAa,iBAAiB,GAAG"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { n as safeCustomElement, t as __decorate } from "./decorate-VRK8rslU.js";
|
|
2
|
+
import { LitElement } from "lit";
|
|
3
|
+
//#region src/form/form-values.ts
|
|
4
|
+
function collectFormValues(root) {
|
|
5
|
+
const values = {};
|
|
6
|
+
root.querySelectorAll(`[name]`).forEach((el) => {
|
|
7
|
+
const name = el.getAttribute(`name`);
|
|
8
|
+
if (!name) return;
|
|
9
|
+
if (el instanceof HTMLInputElement) {
|
|
10
|
+
if (el.type === `radio`) {
|
|
11
|
+
if (el.checked) values[name] = el.value;
|
|
12
|
+
} else if (el.type === `checkbox`) values[name] = el.checked;
|
|
13
|
+
else values[name] = el.value;
|
|
14
|
+
} else if (el instanceof HTMLSelectElement) {
|
|
15
|
+
if (el.multiple) values[name] = Array.from(el.selectedOptions).map((opt) => opt.value);
|
|
16
|
+
else values[name] = el.value;
|
|
17
|
+
} else if (el instanceof HTMLTextAreaElement) values[name] = el.value;
|
|
18
|
+
else if (`value` in el) values[name] = el.value;
|
|
19
|
+
});
|
|
20
|
+
return values;
|
|
21
|
+
}
|
|
22
|
+
function applyFormValues(root, data) {
|
|
23
|
+
root.querySelectorAll(`[name]`).forEach((el) => {
|
|
24
|
+
const name = el.getAttribute(`name`);
|
|
25
|
+
if (!name || !(name in data)) return;
|
|
26
|
+
const value = data[name];
|
|
27
|
+
if (el instanceof HTMLInputElement) {
|
|
28
|
+
if (el.type === `radio`) el.checked = el.value === value;
|
|
29
|
+
else if (el.type === `checkbox`) el.checked = Boolean(value);
|
|
30
|
+
else el.value = String(value ?? ``);
|
|
31
|
+
el.dispatchEvent(new Event(`input`, { bubbles: true }));
|
|
32
|
+
el.dispatchEvent(new Event(`change`, { bubbles: true }));
|
|
33
|
+
} else if (el instanceof HTMLSelectElement) {
|
|
34
|
+
if (el.multiple && Array.isArray(value)) Array.from(el.options).forEach((opt) => {
|
|
35
|
+
opt.selected = value.includes(opt.value);
|
|
36
|
+
});
|
|
37
|
+
else el.value = String(value ?? ``);
|
|
38
|
+
el.dispatchEvent(new Event(`input`, { bubbles: true }));
|
|
39
|
+
el.dispatchEvent(new Event(`change`, { bubbles: true }));
|
|
40
|
+
} else if (el instanceof HTMLTextAreaElement) {
|
|
41
|
+
el.value = String(value ?? ``);
|
|
42
|
+
el.dispatchEvent(new Event(`input`, { bubbles: true }));
|
|
43
|
+
el.dispatchEvent(new Event(`change`, { bubbles: true }));
|
|
44
|
+
} else if (`value` in el) el.value = value;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/form/form.ts
|
|
49
|
+
let FormElement = class FormElement extends LitElement {
|
|
50
|
+
createRenderRoot() {
|
|
51
|
+
return this;
|
|
52
|
+
}
|
|
53
|
+
getValues() {
|
|
54
|
+
return collectFormValues(this);
|
|
55
|
+
}
|
|
56
|
+
setValues(data) {
|
|
57
|
+
applyFormValues(this, data);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
FormElement = __decorate([safeCustomElement(`ixfx-form`)], FormElement);
|
|
61
|
+
//#endregion
|
|
62
|
+
export { FormElement as t };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=form-CsXJX15p.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-CsXJX15p.js","names":[],"sources":["../src/form/form-values.ts","../src/form/form.ts"],"sourcesContent":["export function collectFormValues(root: ParentNode): Record<string, unknown> {\n const values: Record<string, unknown> = {};\n const elements = root.querySelectorAll(`[name]`);\n\n elements.forEach((el) => {\n const name = el.getAttribute(`name`);\n if (!name) {\n return;\n }\n\n if (el instanceof HTMLInputElement) {\n if (el.type === `radio`) {\n if (el.checked) {\n values[name] = el.value;\n }\n } else if (el.type === `checkbox`) {\n values[name] = el.checked;\n } else {\n values[name] = el.value;\n }\n } else if (el instanceof HTMLSelectElement) {\n if (el.multiple) {\n values[name] = Array.from(el.selectedOptions).map(opt => opt.value);\n } else {\n values[name] = el.value;\n }\n } else if (el instanceof HTMLTextAreaElement) {\n values[name] = el.value;\n } else if (`value` in el) {\n values[name] = (el as { value: unknown }).value;\n }\n });\n\n return values;\n}\n\nexport function applyFormValues(root: ParentNode, data: Record<string, unknown>): void {\n const elements = root.querySelectorAll(`[name]`);\n\n elements.forEach((el) => {\n const name = el.getAttribute(`name`);\n if (!name || !(name in data)) {\n return;\n }\n\n const value = data[name];\n\n if (el instanceof HTMLInputElement) {\n if (el.type === `radio`) {\n el.checked = el.value === value;\n } else if (el.type === `checkbox`) {\n el.checked = Boolean(value);\n } else {\n el.value = String(value ?? ``);\n }\n el.dispatchEvent(new Event(`input`, { bubbles: true }));\n el.dispatchEvent(new Event(`change`, { bubbles: true }));\n } else if (el instanceof HTMLSelectElement) {\n if (el.multiple && Array.isArray(value)) {\n Array.from(el.options).forEach((opt) => {\n opt.selected = value.includes(opt.value);\n });\n } else {\n el.value = String(value ?? ``);\n }\n el.dispatchEvent(new Event(`input`, { bubbles: true }));\n el.dispatchEvent(new Event(`change`, { bubbles: true }));\n } else if (el instanceof HTMLTextAreaElement) {\n el.value = String(value ?? ``);\n el.dispatchEvent(new Event(`input`, { bubbles: true }));\n el.dispatchEvent(new Event(`change`, { bubbles: true }));\n } else if (`value` in el) {\n (el as { value: unknown }).value = value;\n }\n });\n}","import { LitElement } from 'lit';\nimport { safeCustomElement } from '../util/custom-elements.js';\nimport { applyFormValues, collectFormValues } from './form-values.js';\nimport './form.css';\n\n@safeCustomElement(`ixfx-form`)\nexport class FormElement extends LitElement {\n protected override createRenderRoot() {\n return this;\n }\n\n getValues(): Record<string, unknown> {\n return collectFormValues(this);\n }\n\n setValues(data: Record<string, unknown>): void {\n applyFormValues(this, data);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ixfx-form': FormElement;\n }\n}"],"mappings":";;;AAAA,SAAgB,kBAAkB,MAA2C;CAC3E,MAAM,SAAkC,CAAC;CAGzC,KAFsB,iBAAiB,QAEhC,CAAC,CAAC,SAAS,OAAO;EACvB,MAAM,OAAO,GAAG,aAAa,MAAM;EACnC,IAAI,CAAC,MACH;EAGF,IAAI,cAAc,kBAAkB;GAClC,IAAI,GAAG,SAAS,SACV;QAAA,GAAG,SACL,OAAO,QAAQ,GAAG;GAAA,OAEf,IAAI,GAAG,SAAS,YACrB,OAAO,QAAQ,GAAG;QAElB,OAAO,QAAQ,GAAG;EAEtB,OAAO,IAAI,cAAc,mBAAmB;GAC1C,IAAI,GAAG,UACL,OAAO,QAAQ,MAAM,KAAK,GAAG,eAAe,CAAC,CAAC,KAAI,QAAO,IAAI,KAAK;QAElE,OAAO,QAAQ,GAAG;EAEtB,OAAO,IAAI,cAAc,qBACvB,OAAO,QAAQ,GAAG;OACb,IAAI,WAAW,IACpB,OAAO,QAAS,GAA0B;CAE9C,CAAC;CAED,OAAO;AACT;AAEA,SAAgB,gBAAgB,MAAkB,MAAqC;CAGrF,KAFsB,iBAAiB,QAEhC,CAAC,CAAC,SAAS,OAAO;EACvB,MAAM,OAAO,GAAG,aAAa,MAAM;EACnC,IAAI,CAAC,QAAQ,EAAE,QAAQ,OACrB;EAGF,MAAM,QAAQ,KAAK;EAEnB,IAAI,cAAc,kBAAkB;GAClC,IAAI,GAAG,SAAS,SACd,GAAG,UAAU,GAAG,UAAU;QACrB,IAAI,GAAG,SAAS,YACrB,GAAG,UAAU,QAAQ,KAAK;QAE1B,GAAG,QAAQ,OAAO,SAAS,EAAE;GAE/B,GAAG,cAAc,IAAI,MAAM,SAAS,EAAE,SAAS,KAAK,CAAC,CAAC;GACtD,GAAG,cAAc,IAAI,MAAM,UAAU,EAAE,SAAS,KAAK,CAAC,CAAC;EACzD,OAAO,IAAI,cAAc,mBAAmB;GAC1C,IAAI,GAAG,YAAY,MAAM,QAAQ,KAAK,GACpC,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,SAAS,QAAQ;IACtC,IAAI,WAAW,MAAM,SAAS,IAAI,KAAK;GACzC,CAAC;QAED,GAAG,QAAQ,OAAO,SAAS,EAAE;GAE/B,GAAG,cAAc,IAAI,MAAM,SAAS,EAAE,SAAS,KAAK,CAAC,CAAC;GACtD,GAAG,cAAc,IAAI,MAAM,UAAU,EAAE,SAAS,KAAK,CAAC,CAAC;EACzD,OAAO,IAAI,cAAc,qBAAqB;GAC5C,GAAG,QAAQ,OAAO,SAAS,EAAE;GAC7B,GAAG,cAAc,IAAI,MAAM,SAAS,EAAE,SAAS,KAAK,CAAC,CAAC;GACtD,GAAG,cAAc,IAAI,MAAM,UAAU,EAAE,SAAS,KAAK,CAAC,CAAC;EACzD,OAAO,IAAI,WAAW,IACpB,GAA2B,QAAQ;CAEvC,CAAC;AACH;;;ACrEO,IAAM,cAAN,MAAM,oBAAoB,WAAW;CAC1C,mBAAsC;EACpC,OAAO;CACT;CAEA,YAAqC;EACnC,OAAO,kBAAkB,IAAI;CAC/B;CAEA,UAAU,MAAqC;EAC7C,gBAAgB,MAAM,IAAI;CAC5B;AACF;AAbC,cAAA,WAAA,CAAA,kBAAkB,WAAW,CAAA,GAAA,WAAA"}
|
package/dist/form.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
//#region src/form/form.d.ts
|
|
3
|
+
declare class FormElement extends LitElement {
|
|
4
|
+
protected createRenderRoot(): this;
|
|
5
|
+
getValues(): Record<string, unknown>;
|
|
6
|
+
setValues(data: Record<string, unknown>): void;
|
|
7
|
+
}
|
|
8
|
+
declare global {
|
|
9
|
+
interface HTMLElementTagNameMap {
|
|
10
|
+
'ixfx-form': FormElement;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { FormElement };
|
|
15
|
+
//# sourceMappingURL=form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.d.ts","names":[],"sources":["../src/form/form.ts"],"mappings":";;cAMa,oBAAoB;YACZ;EAInB,aAAa;EAIb,UAAU,MAAM;;QAKV;YACI;IACR,aAAa"}
|
package/dist/form.js
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { r as IDataProvider } from "./data-provider-BAn_-oR1.js";
|
|
2
|
+
import { l as ListSelectionMode } from "./types-DlVNJez_.js";
|
|
3
|
+
import "./panel.js";
|
|
4
|
+
import { LitElement, PropertyValues, nothing } from "lit";
|
|
5
|
+
import { CommandId } from "@clinth/ui-commands";
|
|
6
|
+
//#region src/grouped-item-lister/types.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Fired when the selection set changes by any means.
|
|
9
|
+
* Event name: `select`
|
|
10
|
+
*/
|
|
11
|
+
type SubComponentSelectDetail<T> = {
|
|
12
|
+
readonly selected: ReadonlySet<T>;
|
|
13
|
+
readonly previous: ReadonlySet<T>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Fired when an item is explicitly activated (double-click or Enter key).
|
|
17
|
+
* Event name: `activate`
|
|
18
|
+
*/
|
|
19
|
+
type SubComponentActivateDetail<T> = {
|
|
20
|
+
readonly item: T;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Fired on a raw pointer click before any selection change.
|
|
24
|
+
* Event name: `item-click`
|
|
25
|
+
*/
|
|
26
|
+
type SubComponentItemClickDetail<T> = {
|
|
27
|
+
readonly item: T;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Fired when the pointer hovers over an item or the keyboard cursor moves to it.
|
|
31
|
+
* Event name: `tickle`
|
|
32
|
+
*/
|
|
33
|
+
type SubComponentTickleDetail<T> = {
|
|
34
|
+
readonly item: T;
|
|
35
|
+
};
|
|
36
|
+
type SubComponentSelectEvent<T> = CustomEvent<SubComponentSelectDetail<T>>;
|
|
37
|
+
type SubComponentActivateEvent<T> = CustomEvent<SubComponentActivateDetail<T>>;
|
|
38
|
+
type SubComponentItemClickEvent<T> = CustomEvent<SubComponentItemClickDetail<T>>;
|
|
39
|
+
type SubComponentTickleEvent<T> = CustomEvent<SubComponentTickleDetail<T>>;
|
|
40
|
+
interface IGroupedSubComponentEventMap<T> {
|
|
41
|
+
'select': SubComponentSelectEvent<T>;
|
|
42
|
+
'activate': SubComponentActivateEvent<T>;
|
|
43
|
+
'item-click': SubComponentItemClickEvent<T>;
|
|
44
|
+
'tickle': SubComponentTickleEvent<T>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Contract that sub-components passed to `ixfx-grouped-item-lister` must satisfy.
|
|
48
|
+
*
|
|
49
|
+
* All four events (`select`, `activate`, `item-click`, `tickle`) must bubble and be composed
|
|
50
|
+
* so they propagate through the lister's light DOM to external listeners.
|
|
51
|
+
*/
|
|
52
|
+
interface IGroupedSubComponent<T> extends HTMLElement {
|
|
53
|
+
/** Replace the full item list. Called whenever the lister's items or grouping changes. */
|
|
54
|
+
setItems: (items: readonly T[]) => void;
|
|
55
|
+
/** Clear the current selection without firing a `select` event (avoids re-entrant loops). */
|
|
56
|
+
clearSelection: () => void;
|
|
57
|
+
/** The current selection set. */
|
|
58
|
+
readonly selectedItems: ReadonlySet<T>;
|
|
59
|
+
/** Controls how many items can be selected simultaneously. */
|
|
60
|
+
selectionMode: ListSelectionMode;
|
|
61
|
+
/**
|
|
62
|
+
* Forward a command (e.g. sort-order change) to this sub-component.
|
|
63
|
+
* Uses `CommandId` from `@clinth/ui-commands` for interoperability.
|
|
64
|
+
*/
|
|
65
|
+
dispatch: (commandId: CommandId, args?: Record<string, unknown>) => void;
|
|
66
|
+
addEventListener: (<K extends keyof IGroupedSubComponentEventMap<T>>(type: K, listener: (event: IGroupedSubComponentEventMap<T>[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Factory that creates a sub-component for a given group.
|
|
70
|
+
* Called once per group (or once with `undefined` in ungrouped mode).
|
|
71
|
+
*/
|
|
72
|
+
type SubComponentFactory<T> = (groupKey: string | undefined) => HTMLElement & IGroupedSubComponent<T>;
|
|
73
|
+
/**
|
|
74
|
+
* Fired by `ixfx-grouped-item-lister` after any sub-component fires `select`.
|
|
75
|
+
* Carries the full cross-group selection union and the key of the group whose
|
|
76
|
+
* selection just changed (or `undefined` in ungrouped mode).
|
|
77
|
+
*/
|
|
78
|
+
type GroupedSelectDetail<T> = {
|
|
79
|
+
readonly selected: ReadonlySet<T>;
|
|
80
|
+
readonly groupKey: string | undefined;
|
|
81
|
+
};
|
|
82
|
+
type GroupedSelectEvent<T> = CustomEvent<GroupedSelectDetail<T>>;
|
|
83
|
+
interface GroupedItemListerElementEventMap<T> {
|
|
84
|
+
'grouped-select': GroupedSelectEvent<T>;
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/grouped-item-lister/grouped-item-lister.d.ts
|
|
88
|
+
declare class GroupedItemListerElement<T = unknown> extends LitElement {
|
|
89
|
+
#private;
|
|
90
|
+
grouped: boolean;
|
|
91
|
+
crossGroupSelection: boolean;
|
|
92
|
+
get groupBy(): ((item: T) => string) | undefined;
|
|
93
|
+
set groupBy(value: ((item: T) => string) | undefined);
|
|
94
|
+
get factory(): SubComponentFactory<T> | undefined;
|
|
95
|
+
set factory(value: SubComponentFactory<T> | undefined);
|
|
96
|
+
get provider(): IDataProvider<void, T> | undefined;
|
|
97
|
+
set provider(value: IDataProvider<void, T> | undefined);
|
|
98
|
+
/** The union of all selected items across every sub-component. */
|
|
99
|
+
get selectedItems(): ReadonlySet<T>;
|
|
100
|
+
/**
|
|
101
|
+
* Forward a command to all live sub-components.
|
|
102
|
+
* Use this to propagate changes like sort order, filter state, or view mode.
|
|
103
|
+
*/
|
|
104
|
+
dispatch(commandId: CommandId, args?: Record<string, unknown>): void;
|
|
105
|
+
protected createRenderRoot(): this;
|
|
106
|
+
connectedCallback(): void;
|
|
107
|
+
disconnectedCallback(): void;
|
|
108
|
+
protected updated(changed: PropertyValues): void;
|
|
109
|
+
protected render(): import("lit").TemplateResult<1> | typeof nothing;
|
|
110
|
+
}
|
|
111
|
+
declare global {
|
|
112
|
+
interface HTMLElementTagNameMap {
|
|
113
|
+
'ixfx-grouped-item-lister': GroupedItemListerElement;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
interface GroupedItemListerElement<T> {
|
|
117
|
+
addEventListener: (<K extends keyof GroupedItemListerElementEventMap<T>>(type: K, listener: (this: GroupedItemListerElement<T>, event: GroupedItemListerElementEventMap<T>[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void);
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
export { IGroupedSubComponent as a, SubComponentActivateEvent as c, SubComponentItemClickEvent as d, SubComponentSelectDetail as f, SubComponentTickleEvent as h, GroupedSelectEvent as i, SubComponentFactory as l, SubComponentTickleDetail as m, GroupedItemListerElementEventMap as n, IGroupedSubComponentEventMap as o, SubComponentSelectEvent as p, GroupedSelectDetail as r, SubComponentActivateDetail as s, GroupedItemListerElement as t, SubComponentItemClickDetail as u };
|
|
121
|
+
//# sourceMappingURL=grouped-item-lister-CNLMgdIr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grouped-item-lister-CNLMgdIr.d.ts","names":[],"sources":["../src/grouped-item-lister/types.ts","../src/grouped-item-lister/grouped-item-lister.ts"],"mappings":";;;;;;;;;;KAWY,yBAAyB;WAC1B,UAAU,YAAY;WACtB,UAAU,YAAY;;;;;;KAOrB,2BAA2B;WAC5B,MAAM;;;;;;KAOL,4BAA4B;WAC7B,MAAM;;;;;;KAOL,yBAAyB;WAC1B,MAAM;;KAGL,wBAAwB,KAAK,YAAY,yBAAyB;KAClE,0BAA0B,KAAK,YAAY,2BAA2B;KACtE,2BAA2B,KAAK,YAAY,4BAA4B;KACxE,wBAAwB,KAAK,YAAY,yBAAyB;UAE7D,6BAA6B;EAC5C,UAAU,wBAAwB;EAClC,YAAY,0BAA0B;EACtC,cAAc,2BAA2B;EACzC,UAAU,wBAAwB;;;;;;;;UAanB,qBAAqB,WAAW;;EAE/C,WAAW,gBAAgB;;EAG3B;;WAGS,eAAe,YAAY;;EAGpC,eAAe;;;;;EAMf,WAAW,WAAW,WAAW,OAAO;EAExC,oBAAoB,gBAAgB,6BAA6B,IAC/D,MAAM,GACN,WAAW,OAAO,6BAA6B,GAAG,aAClD,oBAAoB,sCAEpB,cACA,UAAU,oCACV,oBAAoB;;;;;;KAQZ,oBAAoB,MAAM,iCAAiC,cAAc,qBAAqB;;;;;;KAW9F,oBAAoB;WACrB,UAAU,YAAY;WACtB;;KAGC,mBAAmB,KAAK,YAAY,oBAAoB;UAEnD,iCAAiC;EAChD,kBAAkB,mBAAmB;;;;cC9E1B,yBAAyB,qBAAqB;;EACb;EAG5C;MAgBI,aAAa,MAAM;MAInB,QAAQ,SAAS,MAAM;MAKvB,WAAW,oBAAoB;MAI/B,QAAQ,OAAO,oBAAoB;MAQnC,YAAY,oBAAoB;MAIhC,SAAS,OAAO,oBAAoB;;MAWpC,iBAAiB,YAAY;;;;;EAcjC,SAAS,WAAW,WAAW,OAAO;YAUnB;EAIV;EAKA;YAKU,QAAQ,SAAS;YAQjB,wBAAM,2BAAA;;QAmJnB;YACI;IACR,4BAA4B;;;UAIf,yBAAyB;EACxC,oBAAoB,gBAAgB,iCAAiC,IACnE,MAAM,GACN,WAAW,MAAM,yBAAyB,IAAI,OAAO,iCAAiC,GAAG,aACzF,oBAAoB,sCAEpB,cACA,UAAU,oCACV,oBAAoB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as IGroupedSubComponent, c as SubComponentActivateEvent, d as SubComponentItemClickEvent, f as SubComponentSelectDetail, h as SubComponentTickleEvent, i as GroupedSelectEvent, l as SubComponentFactory, m as SubComponentTickleDetail, n as GroupedItemListerElementEventMap, o as IGroupedSubComponentEventMap, p as SubComponentSelectEvent, r as GroupedSelectDetail, s as SubComponentActivateDetail, t as GroupedItemListerElement, u as SubComponentItemClickDetail } from "./grouped-item-lister-CNLMgdIr.js";
|
|
2
|
+
export { GroupedItemListerElement, type GroupedItemListerElementEventMap, type GroupedSelectDetail, type GroupedSelectEvent, type IGroupedSubComponent, type IGroupedSubComponentEventMap, type SubComponentActivateDetail, type SubComponentActivateEvent, type SubComponentFactory, type SubComponentItemClickDetail, type SubComponentItemClickEvent, type SubComponentSelectDetail, type SubComponentSelectEvent, type SubComponentTickleDetail, type SubComponentTickleEvent };
|