@ixfx/components 0.5.1 → 0.5.2
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 +67 -6
- package/bundle/index.d.ts.map +1 -1
- package/bundle/index.js +170 -1
- package/bundle/index.js.map +1 -1
- package/bundle/style.css +80 -0
- package/dist/ac-text.d.ts +1 -1
- package/dist/button.d.ts +1 -1
- package/dist/button.d.ts.map +1 -1
- package/dist/colour-picker.d.ts +1 -1
- package/dist/crumbs.d.ts +1 -1
- package/dist/{icon-BUwP1CZ1.d.ts → icon-DpA9x2Ve.d.ts} +2 -2
- package/dist/icon-DpA9x2Ve.d.ts.map +1 -0
- package/dist/icons.d.ts +2 -2
- package/dist/{index-RqMh1i-O.d.ts → index-BtGFYfaK.d.ts} +2 -2
- package/dist/{index-RqMh1i-O.d.ts.map → index-BtGFYfaK.d.ts.map} +1 -1
- package/dist/{index-BUB5SICW.d.ts → index-CoqtMSd9.d.ts} +2 -2
- package/dist/{index-BUB5SICW.d.ts.map → index-CoqtMSd9.d.ts.map} +1 -1
- package/dist/{index-BKAlRgbq.d.ts → index-D_ftz_IT.d.ts} +2 -2
- package/dist/{index-BKAlRgbq.d.ts.map → index-D_ftz_IT.d.ts.map} +1 -1
- package/dist/{index-B1UKcA7l.d.ts → index-DfEkTGvT.d.ts} +3 -3
- package/dist/{index-B1UKcA7l.d.ts.map → index-DfEkTGvT.d.ts.map} +1 -1
- package/dist/index.d.ts +70 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +170 -1
- package/dist/index.js.map +1 -1
- package/dist/{labelled-input-base-Dp_9KP0G.d.ts → labelled-input-base-DiTme1JO.d.ts} +2 -2
- package/dist/{labelled-input-base-Dp_9KP0G.d.ts.map → labelled-input-base-DiTme1JO.d.ts.map} +1 -1
- package/dist/labelled-radial-input.d.ts +2 -2
- package/dist/labelled-radial-input.d.ts.map +1 -1
- package/dist/labelled-range-input.d.ts +1 -1
- package/dist/{menu-item-CQ4Qg731.d.ts → menu-item-DSyf9f_L.d.ts} +2 -2
- package/dist/{menu-item-CQ4Qg731.d.ts.map → menu-item-DSyf9f_L.d.ts.map} +1 -1
- package/dist/menu.d.ts +2 -2
- package/dist/panel.d.ts +1 -1
- package/dist/style.css +80 -0
- package/dist/{tab-list-VtWT-_FG.d.ts → tab-list-BohmbvqF.d.ts} +2 -2
- package/dist/{tab-list-VtWT-_FG.d.ts.map → tab-list-BohmbvqF.d.ts.map} +1 -1
- package/dist/tabs.d.ts +1 -1
- package/docs-user/README.md +1 -0
- package/docs-user/form.md +108 -0
- package/docs-user/tabs.md +11 -2
- package/package.json +1 -1
- package/dist/icon-BUwP1CZ1.d.ts.map +0 -1
|
@@ -33,9 +33,9 @@ declare abstract class LabelledInputBase extends LitElement {
|
|
|
33
33
|
value: number;
|
|
34
34
|
}>) => void;
|
|
35
35
|
protected _syncValue(v: number): void;
|
|
36
|
-
protected _renderEditableNumber(): import("lit").TemplateResult<1
|
|
36
|
+
protected _renderEditableNumber(): typeof nothing | import("lit").TemplateResult<1>;
|
|
37
37
|
updated(changedProperties: Map<string, unknown>): void;
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
40
|
export { LabelledInputBase as t };
|
|
41
|
-
//# sourceMappingURL=labelled-input-base-
|
|
41
|
+
//# sourceMappingURL=labelled-input-base-DiTme1JO.d.ts.map
|
package/dist/{labelled-input-base-Dp_9KP0G.d.ts.map → labelled-input-base-DiTme1JO.d.ts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labelled-input-base-
|
|
1
|
+
{"version":3,"file":"labelled-input-base-DiTme1JO.d.ts","names":[],"sources":["../src/mixins/labelled-input-base.ts"],"mappings":";;uBAIsB,0BAA0B;EAClC;EAEgB;EACA;EACA;EACA;EACA;EAC+B;EAEI;EACC;EAEjB;YAE5B;YACA;YACA,cAAc;UAEzB;UACA;oBAEU;MAEd,cAAc;MAId,UAAU,SAAS;gBAIT;EAIL;EAMA;YAMC,cAAc,SAAS;YAcvB,sBAAuB,GAAG;IAAc;;YAWxC,qBAAsB,GAAG;IAAc;;YAavC,qBAAsB,GAAG;IAAc;;YAYvC,WAAW;YAYX,gCAAqB,wBAAA;EAuBtB,QAAQ,mBAAmB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as LabelledInputBase } from "./labelled-input-base-
|
|
1
|
+
import { t as LabelledInputBase } from "./labelled-input-base-DiTme1JO.js";
|
|
2
2
|
import { i as MarkerStyle, l as ValueMode } from "./radial-input-BhZeyyP-.js";
|
|
3
3
|
import { CSSResultGroup, nothing } from "lit";
|
|
4
4
|
//#region src/labelled-radial-input/labelled-radial-input.d.ts
|
|
@@ -19,7 +19,7 @@ declare class LabelledRadialInput extends LabelledInputBase {
|
|
|
19
19
|
private _isWide;
|
|
20
20
|
private _getEffectivePrecision;
|
|
21
21
|
protected _handleResize(entries: ResizeObserverEntry[]): void;
|
|
22
|
-
protected _renderEditableNumber(): import("lit").TemplateResult<1
|
|
22
|
+
protected _renderEditableNumber(): typeof nothing | import("lit").TemplateResult<1>;
|
|
23
23
|
render(): import("lit").TemplateResult<1>;
|
|
24
24
|
private _getTooltipValue;
|
|
25
25
|
static styles: CSSResultGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labelled-radial-input.d.ts","names":[],"sources":["../src/labelled-radial-input/labelled-radial-input.ts"],"mappings":";;;;cA0Da,4BAA4B;WAC9B;EAGA;EACA;EAEmB;EACA;EAC2B,aAAa;EACvC;EACwB,WAAW;EACnC;EACA;EAEoC;;EAGpC;UAEZ;UAIT;YAeW,cAAc,SAAS;YAMvB,
|
|
1
|
+
{"version":3,"file":"labelled-radial-input.d.ts","names":[],"sources":["../src/labelled-radial-input/labelled-radial-input.ts"],"mappings":";;;;cA0Da,4BAA4B;WAC9B;EAGA;EACA;EAEmB;EACA;EAC2B,aAAa;EACvC;EACwB,WAAW;EACnC;EACA;EAEoC;;EAGpC;UAEZ;UAIT;YAeW,cAAc,SAAS;YAMvB,gCAAqB,wBAAA;EA0B/B,wBAAM;UA6BP;SAYD,QAAQ;;QA0ET;YACI;IACR,8BAA8B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as LabelledRangeInput } from "./index-
|
|
1
|
+
import { t as LabelledRangeInput } from "./index-CoqtMSd9.js";
|
|
2
2
|
export { LabelledRangeInput };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./icon-
|
|
1
|
+
import "./icon-DpA9x2Ve.js";
|
|
2
2
|
import { LitElement } from "lit";
|
|
3
3
|
import { CommandRegistry, KeyboardManager } from "@clinth/ui-commands";
|
|
4
4
|
//#region src/menu/menu-container.d.ts
|
|
@@ -124,4 +124,4 @@ declare global {
|
|
|
124
124
|
}
|
|
125
125
|
//#endregion
|
|
126
126
|
export { MenuContainer as i, MenuTrigger as n, MenuTriggerCommandDetail as r, MenuItem as t };
|
|
127
|
-
//# sourceMappingURL=menu-item-
|
|
127
|
+
//# sourceMappingURL=menu-item-DSyf9f_L.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item-
|
|
1
|
+
{"version":3,"file":"menu-item-DSyf9f_L.d.ts","names":[],"sources":["../src/menu/menu-container.ts","../src/menu/menu-trigger.ts","../src/menu/menu-item.ts"],"mappings":";;;;cASa,sBAAsB;EACgB;EACjB,WAAW;EACX,kBAAkB;UACvB;UAGnB;SAwBD,sBAAM;UA4BL;UAkDA;EAYC,QAAQ,mBAAmB;;;;EASpC,WAAW,SAAS,IAAI;EAOxB,wBAAM;UAaE;;;;;UAoCA;UAiCA;EA0BR;UAIQ;UAQA;UAUA;UAqDA;;QAqCF;YACI;IACR,uBAAuB;;;;;KCxWtB;KACA;KAEO;WACD;WACA;WACA;;cAME,oBAAoB;EACH,MAAM;EACN;EACI,WAAW;EACX,kBAAkB;EACtB,WAAW;UAEtB;UACA;UACA;UAEc;UACN;iBAEV;UAEP;UACA;EAER;EAOA;EAQA;EAkBA,QAAQ,mBAAmB;UAMnB;UAYA;UAWA;UAOA;MAKJ;EAIJ;EAIA;EAIA;UAIQ;UAgBA;UAQA;UAYA;UAUA;UAYA;UAOA;UAeA;UAeA;UAkBA;SAiBD,sBAAM;EAmEb,wBAAM;;QAwBA;YACI;IACR,qBAAqB;;;;;cChVZ,iBAAiB;EACA;EAC2B;EAC3B;EACC;EACuB;EACpB,WAAW;EACX,kBAAkB;EAClB,iBAAiB;UAEhC;UACM;UAEf;EAER;UAOQ;UAKA;UAWA;UAQA;UAUA;UAUA;UAWA;UASA;EASR,WAAW,mBAAmB;EAU9B,QAAQ,mBAAmB;UAInB;SAaQ,sBAAM;EAkEtB,wBAAM;;QAwBA;YACI;IACR,kBAAkB"}
|
package/dist/menu.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as MenuContainer, n as MenuTrigger, t as MenuItem } from "./menu-item-
|
|
2
|
-
import { a as menuFromTree, c as MenuSeparator, d as MenuCheckItem, f as MenuBar, i as MenuFromTreeOptions, l as MenuSubTrigger, n as MenuRadioGroup, o as menuFromTreeToElements, r as MenuRadioItem, s as MenuHeader, u as MenuCommandController } from "./index-
|
|
1
|
+
import { i as MenuContainer, n as MenuTrigger, t as MenuItem } from "./menu-item-DSyf9f_L.js";
|
|
2
|
+
import { a as menuFromTree, c as MenuSeparator, d as MenuCheckItem, f as MenuBar, i as MenuFromTreeOptions, l as MenuSubTrigger, n as MenuRadioGroup, o as menuFromTreeToElements, r as MenuRadioItem, s as MenuHeader, u as MenuCommandController } from "./index-DfEkTGvT.js";
|
|
3
3
|
export { MenuBar, MenuCheckItem, MenuCommandController, MenuContainer, type MenuFromTreeOptions, MenuHeader, MenuItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuSubTrigger, MenuTrigger, menuFromTree, menuFromTreeToElements };
|
package/dist/panel.d.ts
CHANGED
package/dist/style.css
CHANGED
|
@@ -141,3 +141,83 @@
|
|
|
141
141
|
ixfx-grouped-item-lister {
|
|
142
142
|
display: block;
|
|
143
143
|
}
|
|
144
|
+
ixfx-form {
|
|
145
|
+
display: block;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
ixfx-form-group {
|
|
149
|
+
display: block;
|
|
150
|
+
container-type: inline-size;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
ixfx-form-group fieldset {
|
|
154
|
+
gap: var(--space-m) var(--space-l);
|
|
155
|
+
margin: 0;
|
|
156
|
+
border: 0;
|
|
157
|
+
grid-template-columns: 1fr;
|
|
158
|
+
min-inline-size: 0;
|
|
159
|
+
margin-block-start: var(--space-m);
|
|
160
|
+
margin-block-end: var(--space-m);
|
|
161
|
+
padding: 0;
|
|
162
|
+
display: grid;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
ixfx-form-group fieldset > legend:empty {
|
|
166
|
+
display: none;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
ixfx-form-group fieldset > legend {
|
|
170
|
+
font-weight: var(--font-weight-bold);
|
|
171
|
+
grid-column: 1 / -1;
|
|
172
|
+
margin-block-start: var(--space-m);
|
|
173
|
+
margin-block-end: var(--space-s);
|
|
174
|
+
padding: 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
ixfx-form-group fieldset > :not(ixfx-form-part) {
|
|
178
|
+
grid-column: 1 / -1;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
ixfx-form-part {
|
|
182
|
+
grid-column: 1 / -1;
|
|
183
|
+
grid-template-columns: 1fr;
|
|
184
|
+
align-items: start;
|
|
185
|
+
display: grid;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
ixfx-form-part > label {
|
|
189
|
+
font-size: var(--ixfx-form-label-font-size, var(--text-s));
|
|
190
|
+
font-weight: var(--ixfx-form-label-font-weight, inherit);
|
|
191
|
+
font-family: var(--ixfx-form-label-font-family, inherit);
|
|
192
|
+
color: var(--ixfx-form-label-color, inherit);
|
|
193
|
+
text-transform: var(--ixfx-form-label-text-transform, uppercase);
|
|
194
|
+
padding-bottom: var(--space-xs);
|
|
195
|
+
grid-area: 1 / 1;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
ixfx-form-part > input, ixfx-form-part > select, ixfx-form-part > textarea {
|
|
199
|
+
grid-area: 2 / 1;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
@container (width >= 30rem) {
|
|
203
|
+
ixfx-form-group fieldset {
|
|
204
|
+
grid-template-columns: max-content 1fr;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
ixfx-form-part {
|
|
208
|
+
grid-column: 1 / -1;
|
|
209
|
+
grid-template-columns: subgrid;
|
|
210
|
+
align-items: baseline;
|
|
211
|
+
display: grid;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
ixfx-form-part > label {
|
|
215
|
+
padding-right: var(--space-xs);
|
|
216
|
+
grid-area: 1 / 1;
|
|
217
|
+
padding-bottom: 0;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
ixfx-form-part > input, ixfx-form-part > select, ixfx-form-part > textarea {
|
|
221
|
+
grid-area: 1 / 2;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./icon-
|
|
1
|
+
import "./icon-DpA9x2Ve.js";
|
|
2
2
|
import { LitElement, PropertyValues } from "lit";
|
|
3
3
|
import { CommandRegistry } from "@clinth/ui-commands";
|
|
4
4
|
//#region src/tabs/tab-list-item.d.ts
|
|
@@ -71,4 +71,4 @@ declare global {
|
|
|
71
71
|
}
|
|
72
72
|
//#endregion
|
|
73
73
|
export { TabListReorderDetail as a, TabListElement as i, TabListChangeEvent as n, TabListReorderEvent as o, TabListDragMode as r, TabListItemElement as s, TabListChangeDetail as t };
|
|
74
|
-
//# sourceMappingURL=tab-list-
|
|
74
|
+
//# sourceMappingURL=tab-list-BohmbvqF.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-list-
|
|
1
|
+
{"version":3,"file":"tab-list-BohmbvqF.d.ts","names":[],"sources":["../src/tabs/tab-list-item.ts","../src/tabs/tab-list.ts"],"mappings":";;;;;;;;;;cAgBa,2BAA2B;EAEtC;EAGA;EAGA;EAGA;EAGA,UAAU;UAEO;UACT;UACA;EAEC;EAQA;EAQA,QAAQ,SAAS;UAQlB;UAUA;EAWC,wBAAM;UAyBP;SAWQ,sBAAM;;QA0GhB;YACI;IACR,sBAAsB;;;;;;;;;;KCnNd;WACD;WACA;WACA;;KAGC,qBAAqB,YAAY;KAEjC;WACD;WACA;WACA;;KAGC,sBAAsB,YAAY;KAElC;cAMC,uBAAuB;;EAElC;EAGA;EAGA;EAGA,UAAU;EA2BD,wBAAM;EA4BN;EAQA,QAAQ,mBAAmB;EA8FpC,sBAAkB;EAwBlB,cAAc,IAAI;SAwaX,sBAAM;;QAgGP;YACI;IACR,iBAAiB"}
|
package/dist/tabs.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TabListReorderDetail, i as TabListElement, n as TabListChangeEvent, o as TabListReorderEvent, r as TabListDragMode, t as TabListChangeDetail } from "./tab-list-
|
|
1
|
+
import { a as TabListReorderDetail, i as TabListElement, n as TabListChangeEvent, o as TabListReorderEvent, r as TabListDragMode, t as TabListChangeDetail } from "./tab-list-BohmbvqF.js";
|
|
2
2
|
export { TabListChangeDetail, TabListChangeEvent, TabListDragMode, TabListElement, TabListReorderDetail, TabListReorderEvent };
|
package/docs-user/README.md
CHANGED
|
@@ -12,6 +12,7 @@ This directory contains documentation for each component and some architectural
|
|
|
12
12
|
- [crumbs](./crumbs.md)
|
|
13
13
|
- [data-display](./data-display.md)
|
|
14
14
|
- [editable-label](./editable-label.md)
|
|
15
|
+
- [form](./form.md)
|
|
15
16
|
- [grouped-item-lister](./grouped-item-lister.md)
|
|
16
17
|
- [icons](./icons.md)
|
|
17
18
|
- [incr-search](./incr-search.md)
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Form layout components
|
|
2
|
+
|
|
3
|
+
Primitives for typical form layout with responsive label positioning and data binding.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## `ixfx-form`
|
|
8
|
+
|
|
9
|
+
Main container for form sections. Provides `getValues()` and `setValues()` methods for data binding.
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<ixfx-form>
|
|
13
|
+
<ixfx-form-group label="Section A">
|
|
14
|
+
<p>Preamble text for section A...</p>
|
|
15
|
+
<ixfx-form-part label="Some text">
|
|
16
|
+
<input type="text" name="input1" />
|
|
17
|
+
</ixfx-form-part>
|
|
18
|
+
<ixfx-form-part label="Some other text">
|
|
19
|
+
<input type="text" name="input2" />
|
|
20
|
+
</ixfx-form-part>
|
|
21
|
+
</ixfx-form-group>
|
|
22
|
+
</ixfx-form>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Properties / attributes
|
|
26
|
+
|
|
27
|
+
`ixfx-form` has no attributes — it is a pure layout and data-binding container.
|
|
28
|
+
|
|
29
|
+
### Methods
|
|
30
|
+
|
|
31
|
+
| Method | Returns | Description |
|
|
32
|
+
|--------|---------|-------------|
|
|
33
|
+
| `getValues()` | `Record<string, unknown>` | Collects values from all named inputs within the form |
|
|
34
|
+
| `setValues(data)` | `void` | Applies values to named inputs. Keys absent from `data` are left untouched. |
|
|
35
|
+
|
|
36
|
+
### Value collection rules
|
|
37
|
+
|
|
38
|
+
- Native `<input type=radio>` sharing a `name` → value of the checked one
|
|
39
|
+
- Native/checked-bearing checkbox → boolean
|
|
40
|
+
- `<select multiple>` → array of selected values
|
|
41
|
+
- Everything else with a `.value` property → used as-is
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## `ixfx-form-group`
|
|
46
|
+
|
|
47
|
+
A section within the form, backed by a `<fieldset>`/`<legend>` for proper accessibility semantics.
|
|
48
|
+
|
|
49
|
+
```html
|
|
50
|
+
<ixfx-form-group label="Personal Information">
|
|
51
|
+
<ixfx-form-part label="Full Name">
|
|
52
|
+
<input type="text" name="name" />
|
|
53
|
+
</ixfx-form-part>
|
|
54
|
+
<ixfx-form-part label="Email">
|
|
55
|
+
<input type="email" name="email" />
|
|
56
|
+
</ixfx-form-part>
|
|
57
|
+
</ixfx-form-group>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Properties / attributes
|
|
61
|
+
|
|
62
|
+
| Attribute / Property | Type | Default | Description |
|
|
63
|
+
|---------------------|--------|---------|-------------|
|
|
64
|
+
| `label` | string | `''` | Section heading text |
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## `ixfx-form-part`
|
|
69
|
+
|
|
70
|
+
Wraps a form control with a label. Uses light DOM so the `<label for>` natively associates with the slotted input.
|
|
71
|
+
|
|
72
|
+
```html
|
|
73
|
+
<ixfx-form-part label="Username">
|
|
74
|
+
<input type="text" name="username" />
|
|
75
|
+
</ixfx-form-part>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Properties / attributes
|
|
79
|
+
|
|
80
|
+
| Attribute / Property | Type | Default | Description |
|
|
81
|
+
|---------------------|--------|---------|-------------|
|
|
82
|
+
| `label` | string | `''` | Label text displayed for the control |
|
|
83
|
+
|
|
84
|
+
### How it works
|
|
85
|
+
|
|
86
|
+
`ixfx-form-part` generates an `<label for="...">` element that is associated with the first control-like child (`<input>`, `<select>`, `<textarea>`, or element with a `name` attribute). The association works natively because both elements live in the same light DOM tree — no shadow boundary to work around.
|
|
87
|
+
|
|
88
|
+
An `id` is generated for the control if it doesn't already have one.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Responsive behaviour
|
|
93
|
+
|
|
94
|
+
The layout switches between two modes based on available width (via CSS container queries):
|
|
95
|
+
|
|
96
|
+
**Narrow (< 30rem):** Label appears above the input, single-column stacked layout.
|
|
97
|
+
|
|
98
|
+
**Wide (≥ 30rem):** Label appears to the left of the input, two-column grid. All labels in a group share the width of the widest label (right-justified).
|
|
99
|
+
|
|
100
|
+
Resize the container to see the transition.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## TypeScript types
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
import type { FormElement, FormGroupElement, FormPartElement } from 'ixfxfun-components';
|
|
108
|
+
```
|
package/docs-user/tabs.md
CHANGED
|
@@ -27,10 +27,18 @@ Wire them together:
|
|
|
27
27
|
const tabList = document.querySelector('ixfx-tab-list');
|
|
28
28
|
const tabPanels = document.querySelector('ixfx-tab-panels');
|
|
29
29
|
tabList.addEventListener('change', e => {
|
|
30
|
-
tabPanels.selectPanel(e.detail.
|
|
30
|
+
tabPanels.selectPanel(e.detail.for);
|
|
31
31
|
});
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
+
Select a tab programmatically — same effect as clicking it (header + content):
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
tabPanels.syncWithList(tabList);
|
|
38
|
+
tabPanels.selectTab('Home'); // by label text
|
|
39
|
+
tabPanels.selectTab('panel-home'); // by the panel id a tab's `for` points at
|
|
40
|
+
```
|
|
41
|
+
|
|
34
42
|
---
|
|
35
43
|
|
|
36
44
|
## `ixfx-tab-list`
|
|
@@ -252,4 +260,5 @@ Manages multiple `ixfx-tab-panel` children, selecting one at a time.
|
|
|
252
260
|
|---------------------|----------|---------|----------------------------------|
|
|
253
261
|
| `getSelectedElement()` | — | `TabPanelElement \| undefined` | Get currently selected panel |
|
|
254
262
|
| `selectPanel(id)` | `string` | `boolean` | Select panel by ID; returns true if found |
|
|
255
|
-
| `
|
|
263
|
+
| `selectTab(nameOrTitle)` | `string` | `boolean` | Select a tab as if it was clicked: activates the matching header (via the list associated with `syncWithList`) and shows its panel. `nameOrTitle` can be a tab's label text (case-insensitive) or the panel id its `for` attribute points at. Returns true if a panel was found |
|
|
264
|
+
| `syncWithList(el)` | `TabListElement` | `void` | Associates this panels element with a tab list, syncing panel selection to it. Must be called before `selectTab()` if the tab header should be activated |
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"icon-BUwP1CZ1.d.ts","names":[],"sources":["../src/icons/icon.ts"],"mappings":";;;;;;;;;;;;;cAoBa,wBAAwB;;EACvB;EACgB;EAChB;EAC0C;EACU;EAQvD;EAKA;YAKU,wBAAM,2BAAA;YAgBN,QAAQ,SAAS;SAWpB,sBAAM;;QAsChB;YACI;IACR,aAAa"}
|