jsl-ui 10.4.3 → 10.4.5
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/docs/AutoSuggestComponent.md +17 -17
- package/docs/ButtonComponent.md +22 -22
- package/docs/CheckBoxComponent.md +12 -12
- package/docs/DataBinding.md +19 -19
- package/docs/DateComponent.md +12 -12
- package/docs/DateRangeComponent.md +13 -13
- package/docs/DateTimeComponent.md +14 -14
- package/docs/DialogComponent.md +15 -15
- package/docs/DropdownMenuComponent.md +22 -22
- package/docs/ExpanderComponent.md +13 -13
- package/docs/FormComponent.md +15 -15
- package/docs/FormFieldComponent.md +15 -15
- package/docs/GridComponent.md +39 -39
- package/docs/InputComponent.md +15 -15
- package/docs/IntervalComponent.md +13 -13
- package/docs/LoadingComponent.md +12 -12
- package/docs/NavigationComponent.md +17 -17
- package/docs/Notification.md +14 -14
- package/docs/NotificationComponent.md +13 -13
- package/docs/NumberComponent.md +12 -12
- package/docs/OverlayComponent.md +13 -13
- package/docs/ProgressComponent.md +12 -12
- package/docs/README.md +27 -27
- package/docs/RibbonMenuComponent.md +14 -14
- package/docs/SelectComponent.md +36 -36
- package/docs/SliderComponent.md +20 -20
- package/docs/SplitterComponent.md +14 -14
- package/docs/StackPanelComponent.md +13 -13
- package/docs/TabsComponent.md +16 -16
- package/docs/TimeComponent.md +13 -13
- package/docs/TreeViewComponent.md +16 -16
- package/examples/showcase/checks-and-expanders.ts +148 -148
- package/examples/showcase/cultures.ts +39 -39
- package/examples/showcase/data-binding.ts +138 -138
- package/examples/showcase/dates.ts +168 -168
- package/examples/showcase/dialogs.ts +184 -184
- package/examples/showcase/dropdown-menus.ts +99 -99
- package/examples/showcase/feedback-and-navigation.ts +173 -173
- package/examples/showcase/fields.ts +166 -166
- package/examples/showcase/fonts/OFL-BricolageGrotesque.txt +93 -93
- package/examples/showcase/fonts/OFL-Figtree.txt +93 -93
- package/examples/showcase/fonts/OFL-Jost.txt +93 -93
- package/examples/showcase/generate-sources.cjs +104 -104
- package/examples/showcase/grids.ts +484 -484
- package/examples/showcase/index.html +71 -71
- package/examples/showcase/layout-and-navigation.ts +46 -46
- package/examples/showcase/nivona.css +98 -98
- package/examples/showcase/package.json +10 -10
- package/examples/showcase/selects.ts +184 -184
- package/examples/showcase/showcase-sources.ts +94 -94
- package/examples/showcase/showcase.css +281 -281
- package/examples/showcase/showcase.ts +244 -244
- package/examples/showcase/tabs.ts +161 -161
- package/examples/showcase/themes.css +83 -83
- package/examples/showcase/themes.ts +56 -56
- package/examples/showcase/wirtshans.css +65 -65
- package/lib/components/checkbox/CheckBoxStyle.scss +73 -73
- package/lib/components/date-range/DateRangeStyle.scss +35 -35
- package/lib/components/date-time/DateTimeStyle.scss +9 -9
- package/lib/components/dialog/DialogComponent.d.ts +9 -2
- package/lib/components/dialog/DialogComponent.js +17 -51
- package/lib/components/dropdown-menu/DropdownMenuStyle.scss +48 -48
- package/lib/components/expander/ExpanderStyle.scss +61 -61
- package/lib/components/form-field/FormFieldStyle.scss +36 -36
- package/lib/components/host/RenderHost.d.ts +25 -0
- package/lib/components/host/RenderHost.js +63 -0
- package/lib/components/loading/LoadingStyle.css +18 -18
- package/lib/components/navigation/NavigationStyle.scss +61 -61
- package/lib/components/notification/Notification.scss +102 -102
- package/lib/components/overlay/OverlayComponent.d.ts +9 -1
- package/lib/components/overlay/OverlayComponent.js +22 -13
- package/lib/components/overlay/overlay.css +15 -15
- package/lib/components/progress/ProgressStyle.scss +4 -4
- package/lib/components/ribbon-menu/RibbonMenuStyle.scss +5 -5
- package/lib/components/select/SelectStyle.scss +207 -207
- package/lib/components/slider/SliderStyle.scss +21 -21
- package/lib/components/slider/nouislider.css +15 -15
- package/lib/components/stack-panel/SplitterStyle.scss +8 -8
- package/lib/components/stack-panel/StackPanelStyle.scss +10 -10
- package/lib/components/tabs/TabsStyle.scss +139 -139
- package/lib/components/time/TimeComponent.scss +3 -3
- package/lib/components/tree-view/TreeViewStyle.scss +14 -14
- package/lib/core/helper.js +11 -6
- package/lib/grid/plugins/slick.headermenu.css +98 -98
- package/lib/grid.css +840 -3532
- package/lib/index.css.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/ui/auto.suggest.css +30 -30
- package/lib/ui/button.css +147 -147
- package/lib/ui/date-input.css +10 -10
- package/lib/ui/date.picker/css/tiny-date-picker.css +124 -124
- package/lib/ui/dialog.css +144 -144
- package/lib/ui/input.css +35 -35
- package/lib/ui/theme.css +28 -28
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
# AutoSuggestComponent
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { AutoSuggestComponent } from "jsl-ui";
|
|
5
|
-
|
|
6
|
-
const cities = ["Vienna", "London", "Berlin"];
|
|
7
|
-
const city = new AutoSuggestComponent({
|
|
8
|
-
ariaLabel: "City", minChars: 1,
|
|
9
|
-
source: (term, suggest) => {
|
|
10
|
-
suggest(cities.filter(name => name.toLowerCase().includes(term.toLowerCase())));
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
- `source` must call `suggest(items)`, including after an asynchronous lookup; returning an array or promise alone does not populate results.
|
|
16
|
-
- Values are text. Custom `renderItem` returns HTML, so escape any untrusted item text.
|
|
17
|
-
- `getRef()` is available only after mounting an enabled, editable control.
|
|
1
|
+
# AutoSuggestComponent
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { AutoSuggestComponent } from "jsl-ui";
|
|
5
|
+
|
|
6
|
+
const cities = ["Vienna", "London", "Berlin"];
|
|
7
|
+
const city = new AutoSuggestComponent({
|
|
8
|
+
ariaLabel: "City", minChars: 1,
|
|
9
|
+
source: (term, suggest) => {
|
|
10
|
+
suggest(cities.filter(name => name.toLowerCase().includes(term.toLowerCase())));
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
- `source` must call `suggest(items)`, including after an asynchronous lookup; returning an array or promise alone does not populate results.
|
|
16
|
+
- Values are text. Custom `renderItem` returns HTML, so escape any untrusted item text.
|
|
17
|
+
- `getRef()` is available only after mounting an enabled, editable control.
|
package/docs/ButtonComponent.md
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
# ButtonComponent
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { ButtonComponent } from "jsl-ui";
|
|
5
|
-
|
|
6
|
-
const bookmark = new ButtonComponent({
|
|
7
|
-
content: "Bookmark", type: "button", toggle: true,
|
|
8
|
-
onToggle: pressed => { /* persist selection */ }
|
|
9
|
-
});
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
- Set `type: "button"` for actions inside forms; omitting it retains native submit behavior.
|
|
13
|
-
- `pressed` is the initial state. Afterwards, use `bookmark.pressed`; assigning it does not raise callbacks.
|
|
14
|
-
- Icon strings are literal text, not HTML or icon-library class names. Supply a VNode/component for markup; name icon-only buttons with `ariaLabel` or hidden `content`.
|
|
15
|
-
- Manual markup uses the same styles; load `jsl-ui/lib/ui/button.css` when not importing components:
|
|
16
|
-
|
|
17
|
-
```html
|
|
18
|
-
<button type="button" class="jsl-button jsl-button-outline">View projects</button>
|
|
19
|
-
<a href="/projects" class="jsl-button jsl-button-outline">View projects</a>
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
- Use links for navigation and buttons for actions. Disable buttons with native `disabled`; for links, use `aria-disabled="true"` for styling and omit `href` or prevent activation yourself. Manual toggles need their own event handler to update `aria-pressed`.
|
|
1
|
+
# ButtonComponent
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { ButtonComponent } from "jsl-ui";
|
|
5
|
+
|
|
6
|
+
const bookmark = new ButtonComponent({
|
|
7
|
+
content: "Bookmark", type: "button", toggle: true,
|
|
8
|
+
onToggle: pressed => { /* persist selection */ }
|
|
9
|
+
});
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
- Set `type: "button"` for actions inside forms; omitting it retains native submit behavior.
|
|
13
|
+
- `pressed` is the initial state. Afterwards, use `bookmark.pressed`; assigning it does not raise callbacks.
|
|
14
|
+
- Icon strings are literal text, not HTML or icon-library class names. Supply a VNode/component for markup; name icon-only buttons with `ariaLabel` or hidden `content`.
|
|
15
|
+
- Manual markup uses the same styles; load `jsl-ui/lib/ui/button.css` when not importing components:
|
|
16
|
+
|
|
17
|
+
```html
|
|
18
|
+
<button type="button" class="jsl-button jsl-button-outline">View projects</button>
|
|
19
|
+
<a href="/projects" class="jsl-button jsl-button-outline">View projects</a>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
- Use links for navigation and buttons for actions. Disable buttons with native `disabled`; for links, use `aria-disabled="true"` for styling and omit `href` or prevent activation yourself. Manual toggles need their own event handler to update `aria-pressed`.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# CheckBoxComponent
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { CheckBoxComponent } from "jsl-ui";
|
|
5
|
-
|
|
6
|
-
const archived = new CheckBoxComponent({
|
|
7
|
-
label: "Include archived projects", value: false
|
|
8
|
-
});
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
- `indeterminate` is a separate visual state, not a third value; `getValue()` remains boolean.
|
|
12
|
-
- `setValue()` updates the binding without raising change callbacks.
|
|
1
|
+
# CheckBoxComponent
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { CheckBoxComponent } from "jsl-ui";
|
|
5
|
+
|
|
6
|
+
const archived = new CheckBoxComponent({
|
|
7
|
+
label: "Include archived projects", value: false
|
|
8
|
+
});
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
- `indeterminate` is a separate visual state, not a third value; `getValue()` remains boolean.
|
|
12
|
+
- `setValue()` updates the binding without raising change callbacks.
|
package/docs/DataBinding.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
# Data binding
|
|
2
|
-
|
|
3
|
-
Input, AutoSuggest, Number, CheckBox, Select, Date, Time and DateTime support `bindTo`, `property`, `bindMode` and an optional `converter`. Binding defaults to `"toModel"`.
|
|
4
|
-
|
|
5
|
-
| Mode | Initial value | User changes and `setValue()` | External model changes |
|
|
6
|
-
| --- | --- | --- | --- |
|
|
7
|
-
| `toModel` | Control `value` or its default | Write to the model | Never read |
|
|
8
|
-
| `fromModel` | Model | Change the control, but do not write to the model | Apply on render when the model value changes |
|
|
9
|
-
| `both` | Model | Write to the model | Apply on render when the model value changes |
|
|
10
|
-
|
|
11
|
-
When a `toModel` control is mounted, an explicitly supplied initial `value` is written to the model without raising a change event. If the value was omitted, mounting does not write. Calling `setValue()` before mounting writes immediately in a writable mode and takes precedence over the initial option. `setValue()` does not raise change events.
|
|
12
|
-
|
|
13
|
-
In `fromModel` and `both` modes, a render preserves a local value or draft while the model value remains unchanged. A changed model value is applied on the next render; changing a plain object does not itself schedule a render. Dates and arrays are compared by value, including in-place changes.
|
|
14
|
-
|
|
15
|
-
`converter.toUI` converts model values for the control; `converter.toData` converts control values before writing. Valid user changes write before the change callback is raised. Invalid drafts are not published.
|
|
16
|
-
|
|
17
|
-
For Input and AutoSuggest, `bindOnInput: true` writes on input in writable modes, and `false` waits for change. When omitted, input events write if an `onInput` handler is registered; otherwise they wait for change. The model is updated before `onInput` handlers run.
|
|
18
|
-
|
|
19
|
-
DateTime does not publish a partially filled date and time. Clearing both fields publishes `null` in a writable mode.
|
|
1
|
+
# Data binding
|
|
2
|
+
|
|
3
|
+
Input, AutoSuggest, Number, CheckBox, Select, Date, Time and DateTime support `bindTo`, `property`, `bindMode` and an optional `converter`. Binding defaults to `"toModel"`.
|
|
4
|
+
|
|
5
|
+
| Mode | Initial value | User changes and `setValue()` | External model changes |
|
|
6
|
+
| --- | --- | --- | --- |
|
|
7
|
+
| `toModel` | Control `value` or its default | Write to the model | Never read |
|
|
8
|
+
| `fromModel` | Model | Change the control, but do not write to the model | Apply on render when the model value changes |
|
|
9
|
+
| `both` | Model | Write to the model | Apply on render when the model value changes |
|
|
10
|
+
|
|
11
|
+
When a `toModel` control is mounted, an explicitly supplied initial `value` is written to the model without raising a change event. If the value was omitted, mounting does not write. Calling `setValue()` before mounting writes immediately in a writable mode and takes precedence over the initial option. `setValue()` does not raise change events.
|
|
12
|
+
|
|
13
|
+
In `fromModel` and `both` modes, a render preserves a local value or draft while the model value remains unchanged. A changed model value is applied on the next render; changing a plain object does not itself schedule a render. Dates and arrays are compared by value, including in-place changes.
|
|
14
|
+
|
|
15
|
+
`converter.toUI` converts model values for the control; `converter.toData` converts control values before writing. Valid user changes write before the change callback is raised. Invalid drafts are not published.
|
|
16
|
+
|
|
17
|
+
For Input and AutoSuggest, `bindOnInput: true` writes on input in writable modes, and `false` waits for change. When omitted, input events write if an `onInput` handler is registered; otherwise they wait for change. The model is updated before `onInput` handlers run.
|
|
18
|
+
|
|
19
|
+
DateTime does not publish a partially filled date and time. Clearing both fields publishes `null` in a writable mode.
|
package/docs/DateComponent.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# DateComponent
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { DateComponent } from "jsl-ui";
|
|
5
|
-
|
|
6
|
-
const due = new DateComponent({
|
|
7
|
-
value: new Date(2026, 9, 23), ariaLabel: "Due date"
|
|
8
|
-
});
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
- Values and bindings use `Date` objects; display and parsing follow the culture helper. Supply both `format` and `parse` when overriding that convention.
|
|
12
|
-
- `getValue()` returns text; use `isValid()` and `getValueAsDate()` when reading edited dates. `setValue()` does not raise change callbacks.
|
|
1
|
+
# DateComponent
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { DateComponent } from "jsl-ui";
|
|
5
|
+
|
|
6
|
+
const due = new DateComponent({
|
|
7
|
+
value: new Date(2026, 9, 23), ariaLabel: "Due date"
|
|
8
|
+
});
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
- Values and bindings use `Date` objects; display and parsing follow the culture helper. Supply both `format` and `parse` when overriding that convention.
|
|
12
|
+
- `getValue()` returns text; use `isValid()` and `getValueAsDate()` when reading edited dates. `setValue()` does not raise change callbacks.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# DateRangeComponent
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { DateRangeComponent } from "jsl-ui";
|
|
5
|
-
|
|
6
|
-
const range = new DateRangeComponent({
|
|
7
|
-
min: new Date(2026, 9, 1), max: new Date(2026, 9, 31), increment: "days",
|
|
8
|
-
minValue: new Date(2026, 9, 5), maxValue: new Date(2026, 9, 20)
|
|
9
|
-
});
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
- Only `increment: "days"` is implemented, despite the broader type. Dates are normalized to local calendar days; bounds must be valid and ascending.
|
|
13
|
-
- `min` / `max` are bounds; `minValue` / `maxValue` are the initial selection. Read the selection through `getMin()` / `getMax()` or `onChange`.
|
|
1
|
+
# DateRangeComponent
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { DateRangeComponent } from "jsl-ui";
|
|
5
|
+
|
|
6
|
+
const range = new DateRangeComponent({
|
|
7
|
+
min: new Date(2026, 9, 1), max: new Date(2026, 9, 31), increment: "days",
|
|
8
|
+
minValue: new Date(2026, 9, 5), maxValue: new Date(2026, 9, 20)
|
|
9
|
+
});
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
- Only `increment: "days"` is implemented, despite the broader type. Dates are normalized to local calendar days; bounds must be valid and ascending.
|
|
13
|
+
- `min` / `max` are bounds; `minValue` / `maxValue` are the initial selection. Read the selection through `getMin()` / `getMax()` or `onChange`.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
# DateTimeComponent
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { DateTimeComponent } from "jsl-ui";
|
|
5
|
-
|
|
6
|
-
const appointment = new DateTimeComponent({
|
|
7
|
-
value: new Date(2026, 9, 23, 9, 30),
|
|
8
|
-
dateAriaLabel: "Appointment date", timeAriaLabel: "Appointment time"
|
|
9
|
-
});
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
- Bind the composite control to one `Date`; it combines the date and time inputs. `getValueAsDate()` returns `null` for invalid input; `getValue()` returns text.
|
|
13
|
-
- `setValue()` updates both inputs without raising change callbacks. The control edits local date/time, without timezone conversion.
|
|
14
|
-
- A partially filled date and time remains a draft. Clearing both fields publishes `null` to writable bindings. See [Data binding](DataBinding.md).
|
|
1
|
+
# DateTimeComponent
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { DateTimeComponent } from "jsl-ui";
|
|
5
|
+
|
|
6
|
+
const appointment = new DateTimeComponent({
|
|
7
|
+
value: new Date(2026, 9, 23, 9, 30),
|
|
8
|
+
dateAriaLabel: "Appointment date", timeAriaLabel: "Appointment time"
|
|
9
|
+
});
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
- Bind the composite control to one `Date`; it combines the date and time inputs. `getValueAsDate()` returns `null` for invalid input; `getValue()` returns text.
|
|
13
|
+
- `setValue()` updates both inputs without raising change callbacks. The control edits local date/time, without timezone conversion.
|
|
14
|
+
- A partially filled date and time remains a draft. Clearing both fields publishes `null` to writable bindings. See [Data binding](DataBinding.md).
|
package/docs/DialogComponent.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# DialogComponent
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { DialogComponent } from "jsl-ui";
|
|
5
|
-
|
|
6
|
-
const dialog = DialogComponent.show({
|
|
7
|
-
header: "Confirm changes", content: "Save this version?",
|
|
8
|
-
footer: { tag: "div", children: [
|
|
9
|
-
DialogComponent.Cancel(), DialogComponent.Ok(() => { /* save changes */ })
|
|
10
|
-
] }
|
|
11
|
-
});
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
- `show()` mounts and cleans up its own host. To close programmatically, use `dialog.getRef().close()`.
|
|
15
|
-
- Footer helper buttons close the dialog unless their callback returns `false` (also after awaiting a promise). `onClose` can veto any close by returning `false`.
|
|
1
|
+
# DialogComponent
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { DialogComponent } from "jsl-ui";
|
|
5
|
+
|
|
6
|
+
const dialog = DialogComponent.show({
|
|
7
|
+
header: "Confirm changes", content: "Save this version?",
|
|
8
|
+
footer: { tag: "div", children: [
|
|
9
|
+
DialogComponent.Cancel(), DialogComponent.Ok(() => { /* save changes */ })
|
|
10
|
+
] }
|
|
11
|
+
});
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
- `show()` mounts and cleans up its own host. To close programmatically, use `dialog.getRef().close()`.
|
|
15
|
+
- Footer helper buttons close the dialog unless their callback returns `false` (also after awaiting a promise). `onClose` can veto any close by returning `false`.
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
# DropdownMenuComponent
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { ButtonComponent, DropdownMenuComponent } from "jsl-ui";
|
|
5
|
-
|
|
6
|
-
const actions = new DropdownMenuComponent({
|
|
7
|
-
content: "Actions", class: "jsl-button jsl-button-outline",
|
|
8
|
-
children: [
|
|
9
|
-
new ButtonComponent({ content: "Edit", type: "button", click: () => edit() }),
|
|
10
|
-
new ButtonComponent({ content: "Archive", type: "button", click: () => archive() })
|
|
11
|
-
],
|
|
12
|
-
closeOnClick: true
|
|
13
|
-
});
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
- `children`, `content`, `rawContent`, `class`, `style`, `tag`, `width`, `offsetX`, `disabled`, `title`, `closeOnClick`, `maxHeight`, `maxWidth`, `height`, and `onOpen` retain the corresponding dropdown-menu options. `DropdownMenuButtonComponent` is also exported as an alias.
|
|
17
|
-
- The menu anchors to the trigger, opens below its start edge by default, flips above when needed, and stays within the viewport. `placement` selects `bottom-start`, `bottom-end`, `top-start`, or `top-end`; `offsetX` and `offsetY` adjust its position. Width defaults to `12rem`; height defaults to `max-content`.
|
|
18
|
-
- `onOpen(options)` runs before each opening, so it can replace `options.children` with current items. Return `false` to cancel opening. `closeOnClick` defaults to `false` for menus that contain multiple toggles; set it to `true` to close after a menu click. Call `close()` to close programmatically.
|
|
19
|
-
- A decorative chevron appears after the trigger by default and points upward while open. Set `showIndicator: false` when the trigger already has an overflow or dropdown indicator.
|
|
20
|
-
- The trigger is a native `button` with `type="button"` by default. It exposes `aria-haspopup`, `aria-expanded`, and `aria-controls`. Native buttons and anchors in `children` become menu items; use `data-menu-item` on a custom interactive root to include it in menu keyboard navigation.
|
|
21
|
-
- Enter or Space opens the trigger; Arrow Up/Down opens and focuses the last/first item. In the menu, Arrow keys move between enabled items, Home/End jump to the edges, type-ahead searches labels, Escape closes and restores trigger focus, and Tab exits the menu. Outside pointer or focus closes it without stealing focus. The popup repositions when the page scrolls or resizes.
|
|
22
|
-
- `menuClass`, `menuStyle`, `menuLabel`, and `ariaLabel` customize the popup and trigger. A VNode is preferred for rich trigger content. Use `rawContent` only for trusted HTML strings.
|
|
1
|
+
# DropdownMenuComponent
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { ButtonComponent, DropdownMenuComponent } from "jsl-ui";
|
|
5
|
+
|
|
6
|
+
const actions = new DropdownMenuComponent({
|
|
7
|
+
content: "Actions", class: "jsl-button jsl-button-outline",
|
|
8
|
+
children: [
|
|
9
|
+
new ButtonComponent({ content: "Edit", type: "button", click: () => edit() }),
|
|
10
|
+
new ButtonComponent({ content: "Archive", type: "button", click: () => archive() })
|
|
11
|
+
],
|
|
12
|
+
closeOnClick: true
|
|
13
|
+
});
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
- `children`, `content`, `rawContent`, `class`, `style`, `tag`, `width`, `offsetX`, `disabled`, `title`, `closeOnClick`, `maxHeight`, `maxWidth`, `height`, and `onOpen` retain the corresponding dropdown-menu options. `DropdownMenuButtonComponent` is also exported as an alias.
|
|
17
|
+
- The menu anchors to the trigger, opens below its start edge by default, flips above when needed, and stays within the viewport. `placement` selects `bottom-start`, `bottom-end`, `top-start`, or `top-end`; `offsetX` and `offsetY` adjust its position. Width defaults to `12rem`; height defaults to `max-content`.
|
|
18
|
+
- `onOpen(options)` runs before each opening, so it can replace `options.children` with current items. Return `false` to cancel opening. `closeOnClick` defaults to `false` for menus that contain multiple toggles; set it to `true` to close after a menu click. Call `close()` to close programmatically.
|
|
19
|
+
- A decorative chevron appears after the trigger by default and points upward while open. Set `showIndicator: false` when the trigger already has an overflow or dropdown indicator.
|
|
20
|
+
- The trigger is a native `button` with `type="button"` by default. It exposes `aria-haspopup`, `aria-expanded`, and `aria-controls`. Native buttons and anchors in `children` become menu items; use `data-menu-item` on a custom interactive root to include it in menu keyboard navigation.
|
|
21
|
+
- Enter or Space opens the trigger; Arrow Up/Down opens and focuses the last/first item. In the menu, Arrow keys move between enabled items, Home/End jump to the edges, type-ahead searches labels, Escape closes and restores trigger focus, and Tab exits the menu. Outside pointer or focus closes it without stealing focus. The popup repositions when the page scrolls or resizes.
|
|
22
|
+
- `menuClass`, `menuStyle`, `menuLabel`, and `ariaLabel` customize the popup and trigger. A VNode is preferred for rich trigger content. Use `rawContent` only for trusted HTML strings.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# ExpanderComponent
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { ExpanderComponent, InputComponent } from "jsl-ui";
|
|
5
|
-
|
|
6
|
-
const advanced = new ExpanderComponent({
|
|
7
|
-
header: "Advanced options", expanded: false,
|
|
8
|
-
body: new InputComponent({ ariaLabel: "Reference", placeholder: "Reference" })
|
|
9
|
-
});
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
- Collapsing hides the body but keeps it mounted.
|
|
13
|
-
- Return `false` from `onToggle` to veto a user toggle. `setExpanded()` changes state without calling `onToggle`.
|
|
1
|
+
# ExpanderComponent
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { ExpanderComponent, InputComponent } from "jsl-ui";
|
|
5
|
+
|
|
6
|
+
const advanced = new ExpanderComponent({
|
|
7
|
+
header: "Advanced options", expanded: false,
|
|
8
|
+
body: new InputComponent({ ariaLabel: "Reference", placeholder: "Reference" })
|
|
9
|
+
});
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
- Collapsing hides the body but keeps it mounted.
|
|
13
|
+
- Return `false` from `onToggle` to veto a user toggle. `setExpanded()` changes state without calling `onToggle`.
|
package/docs/FormComponent.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# FormComponent
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { FormComponent, FormFieldComponent, InputComponent } from "jsl-ui";
|
|
5
|
-
|
|
6
|
-
const form = new FormComponent([
|
|
7
|
-
new FormFieldComponent({
|
|
8
|
-
label: "Project", required: true,
|
|
9
|
-
control: new InputComponent({ id: "project-name" })
|
|
10
|
-
})
|
|
11
|
-
]);
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
- `form.validate()` calls validators on direct children only. Keep fields as direct children if relying on this method.
|
|
15
|
-
- This is a native form; it does not intercept submission. Validate in your submit/action handler; use `type: "button"` for buttons that should not submit.
|
|
1
|
+
# FormComponent
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { FormComponent, FormFieldComponent, InputComponent } from "jsl-ui";
|
|
5
|
+
|
|
6
|
+
const form = new FormComponent([
|
|
7
|
+
new FormFieldComponent({
|
|
8
|
+
label: "Project", required: true,
|
|
9
|
+
control: new InputComponent({ id: "project-name" })
|
|
10
|
+
})
|
|
11
|
+
]);
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
- `form.validate()` calls validators on direct children only. Keep fields as direct children if relying on this method.
|
|
15
|
+
- This is a native form; it does not intercept submission. Validate in your submit/action handler; use `type: "button"` for buttons that should not submit.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# FormFieldComponent
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { FormFieldComponent, InputComponent } from "jsl-ui";
|
|
5
|
-
|
|
6
|
-
const field = new FormFieldComponent({
|
|
7
|
-
label: "Project", required: true,
|
|
8
|
-
control: new InputComponent({ id: "project-name", value: "Website" })
|
|
9
|
-
});
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
- Put editing, binding, and formatting on the child control. The field supplies its label, layout, and validation feedback.
|
|
13
|
-
- Call `validate()` when submitting; `required` does not submit or validate the surrounding form automatically.
|
|
14
|
-
- `getValue()` / `setValue()` delegate to supplied controls. Match the child's value contract; the legacy `type` factory may use strings instead.
|
|
15
|
-
- For custom markup with several inputs, set `controlId` to identify the label target.
|
|
1
|
+
# FormFieldComponent
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { FormFieldComponent, InputComponent } from "jsl-ui";
|
|
5
|
+
|
|
6
|
+
const field = new FormFieldComponent({
|
|
7
|
+
label: "Project", required: true,
|
|
8
|
+
control: new InputComponent({ id: "project-name", value: "Website" })
|
|
9
|
+
});
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
- Put editing, binding, and formatting on the child control. The field supplies its label, layout, and validation feedback.
|
|
13
|
+
- Call `validate()` when submitting; `required` does not submit or validate the surrounding form automatically.
|
|
14
|
+
- `getValue()` / `setValue()` delegate to supplied controls. Match the child's value contract; the legacy `type` factory may use strings instead.
|
|
15
|
+
- For custom markup with several inputs, set `controlId` to identify the label target.
|
package/docs/GridComponent.md
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
# GridComponent
|
|
2
|
-
|
|
3
|
-
`GridComponent<T>` wraps the grid for use in a JSL render tree. It accepts an array or promise of rows, column definitions, grid options, and an optional height.
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
import { GridComponent, NumericFormatter } from "jsl-ui";
|
|
7
|
-
|
|
8
|
-
interface Request { Id: number; Name: string; Amount: number; }
|
|
9
|
-
|
|
10
|
-
const grid = new GridComponent<Request>(
|
|
11
|
-
[{ Id: 1, Name: "Office supplies", Amount: 1250.5 }],
|
|
12
|
-
[
|
|
13
|
-
{ id: "Name", field: "Name", name: "Request", width: 180, sortable: true },
|
|
14
|
-
{ id: "Amount", field: "Amount", name: "Amount", width: 140,
|
|
15
|
-
sortable: true, formatter: NumericFormatter, headerCssClass: "right" }
|
|
16
|
-
],
|
|
17
|
-
{ primaryKey: "Id", showHeaderMenu: true, saveColumnsKey: "requests-grid" },
|
|
18
|
-
"360px"
|
|
19
|
-
);
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Patterns and features
|
|
23
|
-
|
|
24
|
-
- **Identity and lifecycle:** Use a unique, stable `primaryKey` and keep the component instance stable across parent renders. Register setup and event handlers with `initEvents()`; `getRef()` resolves after the grid mounts. A stable `saveColumnsKey` preserves column settings.
|
|
25
|
-
- **Columns and editing:** Columns default their `field` to their `id`. Set `sortable` and `filterable` on columns and `showHeaderMenu: true` to expose sorting and filtering in the header menu. For a custom filter row, set `showHeaderRow: true` and register `onHeaderRowCellRendered` in `initEvents()`; use `explicitInitialization: true` and call `grid.init()` after registering the handler. Enable `editable` and provide column editors to edit cells; use `onAfterEdit` for application updates. Custom header icons can be supplied through `column.header.buttons`.
|
|
26
|
-
- **Formulas and totals:** Use `addFormula(field, calculate, dependencies)` and `triggerAllFormulas()` for calculated values. For grouped totals, configure DataView grouping with an aggregator such as `SumAggregator`, enable `displayTotalsRow`, and use a column's `groupTotalsFormatter` to format the result. Set `aggregateCollapsed: true` to keep totals visible when groups are collapsed.
|
|
27
|
-
- **Variable row heights:** Set `variableRowHeight: true` and give individual data items a `__height` in pixels. Rows without a height, including group headers, use `rowHeight` (40 px by default). Heights are explicit, not measured from wrapped content; call `grid.refresh()` after changing them.
|
|
28
|
-
- **Hierarchical rows:** Use `IndentFormatter` for the tree column and initialize `GridTree` in `initEvents()` with the parent ID field. Keep parents before their descendants in the data, with each subtree contiguous; ordinary sorting can break that order.
|
|
29
|
-
- **Selection:** The grid starts with a row selection model. Use `setSelectionModel(new CellSelectionModel())` for cell ranges and subscribe to the model's `onSelectedRangesChanged` event for range coordinates. Clear the old model's ranges before switching modes. The showcase demonstrates counting selected cells and calculating a sum and average from numeric values.
|
|
30
|
-
- **Components in cells:** Use `ComponentFormatter` and render the component into `args.dom` from `onAppendCell`. Cells can be recreated during scrolling or refresh, so keep state in the row data rather than only in the cell DOM; call `refreshDataItem(item)` when it changes.
|
|
31
|
-
- **Sorting and layout:** `multiColumnSort` and `numberedMultiColumnSort` support prioritized sorts. `frozenColumn`, `rowHeight`/`autoHeight`, `showColumnGroups` with each column's `columnGroup`, and footer rows cover wide or structured grids. Disable sorting when manual row order (`allowRowMove`) should remain authoritative.
|
|
32
|
-
- **Styling:** `NumericFormatter` aligns cell values; set `headerCssClass: "right"` or `"center"` explicitly to align headers. Keep `content-box` sizing on cells and headers so padding and borders do not disrupt grid measurements.
|
|
33
|
-
|
|
34
|
-
## Examples
|
|
35
|
-
|
|
36
|
-
- [GridComponent showcase](../examples/showcase/grids.ts): interactive examples for sorting, header-menu filters, a custom filter row, editing, grouping and totals, hierarchy, cell components, selection, variable heights, and more. Each example has a **Show code** option.
|
|
37
|
-
- [Focused grid demos](../examples/grid/g-01-basic.html): [large-data grouping and filters](../examples/grid/g-02-grouping.html), [custom formatters and editors](../examples/grid/g-03-customformatter-forcefit.html), [JSL cell components](../examples/grid/g-06-cellcomponents.html), [async rendering](../examples/grid/g-07-asyncrender.html), [selection](../examples/grid/g-10-selection.html), [column spans](../examples/grid/g-11-colspan.html), [undo/redo](../examples/grid/g-12-undo-redo.html), [filter row](../examples/grid/g-13-filterrow.html), and [row reordering](../examples/grid/g-14-reorder.html).
|
|
38
|
-
|
|
39
|
-
The focused demos mostly use `createJSLGrid` directly and show the underlying grid APIs; use the showcase for `GridComponent` patterns.
|
|
1
|
+
# GridComponent
|
|
2
|
+
|
|
3
|
+
`GridComponent<T>` wraps the grid for use in a JSL render tree. It accepts an array or promise of rows, column definitions, grid options, and an optional height.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { GridComponent, NumericFormatter } from "jsl-ui";
|
|
7
|
+
|
|
8
|
+
interface Request { Id: number; Name: string; Amount: number; }
|
|
9
|
+
|
|
10
|
+
const grid = new GridComponent<Request>(
|
|
11
|
+
[{ Id: 1, Name: "Office supplies", Amount: 1250.5 }],
|
|
12
|
+
[
|
|
13
|
+
{ id: "Name", field: "Name", name: "Request", width: 180, sortable: true },
|
|
14
|
+
{ id: "Amount", field: "Amount", name: "Amount", width: 140,
|
|
15
|
+
sortable: true, formatter: NumericFormatter, headerCssClass: "right" }
|
|
16
|
+
],
|
|
17
|
+
{ primaryKey: "Id", showHeaderMenu: true, saveColumnsKey: "requests-grid" },
|
|
18
|
+
"360px"
|
|
19
|
+
);
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Patterns and features
|
|
23
|
+
|
|
24
|
+
- **Identity and lifecycle:** Use a unique, stable `primaryKey` and keep the component instance stable across parent renders. Register setup and event handlers with `initEvents()`; `getRef()` resolves after the grid mounts. A stable `saveColumnsKey` preserves column settings.
|
|
25
|
+
- **Columns and editing:** Columns default their `field` to their `id`. Set `sortable` and `filterable` on columns and `showHeaderMenu: true` to expose sorting and filtering in the header menu. For a custom filter row, set `showHeaderRow: true` and register `onHeaderRowCellRendered` in `initEvents()`; use `explicitInitialization: true` and call `grid.init()` after registering the handler. Enable `editable` and provide column editors to edit cells; use `onAfterEdit` for application updates. Custom header icons can be supplied through `column.header.buttons`.
|
|
26
|
+
- **Formulas and totals:** Use `addFormula(field, calculate, dependencies)` and `triggerAllFormulas()` for calculated values. For grouped totals, configure DataView grouping with an aggregator such as `SumAggregator`, enable `displayTotalsRow`, and use a column's `groupTotalsFormatter` to format the result. Set `aggregateCollapsed: true` to keep totals visible when groups are collapsed.
|
|
27
|
+
- **Variable row heights:** Set `variableRowHeight: true` and give individual data items a `__height` in pixels. Rows without a height, including group headers, use `rowHeight` (40 px by default). Heights are explicit, not measured from wrapped content; call `grid.refresh()` after changing them.
|
|
28
|
+
- **Hierarchical rows:** Use `IndentFormatter` for the tree column and initialize `GridTree` in `initEvents()` with the parent ID field. Keep parents before their descendants in the data, with each subtree contiguous; ordinary sorting can break that order.
|
|
29
|
+
- **Selection:** The grid starts with a row selection model. Use `setSelectionModel(new CellSelectionModel())` for cell ranges and subscribe to the model's `onSelectedRangesChanged` event for range coordinates. Clear the old model's ranges before switching modes. The showcase demonstrates counting selected cells and calculating a sum and average from numeric values.
|
|
30
|
+
- **Components in cells:** Use `ComponentFormatter` and render the component into `args.dom` from `onAppendCell`. Cells can be recreated during scrolling or refresh, so keep state in the row data rather than only in the cell DOM; call `refreshDataItem(item)` when it changes.
|
|
31
|
+
- **Sorting and layout:** `multiColumnSort` and `numberedMultiColumnSort` support prioritized sorts. `frozenColumn`, `rowHeight`/`autoHeight`, `showColumnGroups` with each column's `columnGroup`, and footer rows cover wide or structured grids. Disable sorting when manual row order (`allowRowMove`) should remain authoritative.
|
|
32
|
+
- **Styling:** `NumericFormatter` aligns cell values; set `headerCssClass: "right"` or `"center"` explicitly to align headers. Keep `content-box` sizing on cells and headers so padding and borders do not disrupt grid measurements.
|
|
33
|
+
|
|
34
|
+
## Examples
|
|
35
|
+
|
|
36
|
+
- [GridComponent showcase](../examples/showcase/grids.ts): interactive examples for sorting, header-menu filters, a custom filter row, editing, grouping and totals, hierarchy, cell components, selection, variable heights, and more. Each example has a **Show code** option.
|
|
37
|
+
- [Focused grid demos](../examples/grid/g-01-basic.html): [large-data grouping and filters](../examples/grid/g-02-grouping.html), [custom formatters and editors](../examples/grid/g-03-customformatter-forcefit.html), [JSL cell components](../examples/grid/g-06-cellcomponents.html), [async rendering](../examples/grid/g-07-asyncrender.html), [selection](../examples/grid/g-10-selection.html), [column spans](../examples/grid/g-11-colspan.html), [undo/redo](../examples/grid/g-12-undo-redo.html), [filter row](../examples/grid/g-13-filterrow.html), and [row reordering](../examples/grid/g-14-reorder.html).
|
|
38
|
+
|
|
39
|
+
The focused demos mostly use `createJSLGrid` directly and show the underlying grid APIs; use the showcase for `GridComponent` patterns.
|
package/docs/InputComponent.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# InputComponent
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { InputComponent } from "jsl-ui";
|
|
5
|
-
|
|
6
|
-
const model = { name: "Website" };
|
|
7
|
-
const input = new InputComponent({
|
|
8
|
-
bindTo: model, property: "name", bindMode: "both",
|
|
9
|
-
bindOnInput: true, ariaLabel: "Project name"
|
|
10
|
-
});
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
- Binding defaults to `"toModel"`. Use `"both"` to also read external model changes on render. See [Data binding](DataBinding.md) for `bindOnInput` and draft behavior.
|
|
14
|
-
- `setValue()` updates the binding without raising change callbacks.
|
|
15
|
-
- Use [FormFieldComponent](FormFieldComponent.md) for a visible label. Keep the default control styling unless the host deliberately supplies its own via `unstyled`.
|
|
1
|
+
# InputComponent
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { InputComponent } from "jsl-ui";
|
|
5
|
+
|
|
6
|
+
const model = { name: "Website" };
|
|
7
|
+
const input = new InputComponent({
|
|
8
|
+
bindTo: model, property: "name", bindMode: "both",
|
|
9
|
+
bindOnInput: true, ariaLabel: "Project name"
|
|
10
|
+
});
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
- Binding defaults to `"toModel"`. Use `"both"` to also read external model changes on render. See [Data binding](DataBinding.md) for `bindOnInput` and draft behavior.
|
|
14
|
+
- `setValue()` updates the binding without raising change callbacks.
|
|
15
|
+
- Use [FormFieldComponent](FormFieldComponent.md) for a visible label. Keep the default control styling unless the host deliberately supplies its own via `unstyled`.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# IntervalComponent
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { IntervalComponent } from "jsl-ui";
|
|
5
|
-
|
|
6
|
-
const state = { ticks: 0 };
|
|
7
|
-
const timer = new IntervalComponent(() => { state.ticks++; }, {
|
|
8
|
-
interval: 30000, stopOnError: true
|
|
9
|
-
});
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
- Mount the component to start it; the callback runs immediately, then repeats after the interval in milliseconds. Async callbacks settle before the next delay begins.
|
|
13
|
-
- The owning view refreshes after callbacks unless `noRefresh` is set. Unmounting clears the pending timeout; cancellation of in-flight asynchronous work belongs to your callback.
|
|
1
|
+
# IntervalComponent
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { IntervalComponent } from "jsl-ui";
|
|
5
|
+
|
|
6
|
+
const state = { ticks: 0 };
|
|
7
|
+
const timer = new IntervalComponent(() => { state.ticks++; }, {
|
|
8
|
+
interval: 30000, stopOnError: true
|
|
9
|
+
});
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
- Mount the component to start it; the callback runs immediately, then repeats after the interval in milliseconds. Async callbacks settle before the next delay begins.
|
|
13
|
+
- The owning view refreshes after callbacks unless `noRefresh` is set. Unmounting clears the pending timeout; cancellation of in-flight asynchronous work belongs to your callback.
|
package/docs/LoadingComponent.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# LoadingComponent
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { LoadingComponent } from "jsl-ui";
|
|
5
|
-
|
|
6
|
-
const loading = new LoadingComponent({
|
|
7
|
-
sizeInRem: 1.25, label: "Loading report", showLabel: true
|
|
8
|
-
});
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
- Specify size for compact layouts; the legacy default is `6rem`.
|
|
12
|
-
- The label remains accessible when visually hidden. The indicator does not disable controls or manage the surrounding content's `aria-busy` state.
|
|
1
|
+
# LoadingComponent
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { LoadingComponent } from "jsl-ui";
|
|
5
|
+
|
|
6
|
+
const loading = new LoadingComponent({
|
|
7
|
+
sizeInRem: 1.25, label: "Loading report", showLabel: true
|
|
8
|
+
});
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
- Specify size for compact layouts; the legacy default is `6rem`.
|
|
12
|
+
- The label remains accessible when visually hidden. The indicator does not disable controls or manage the surrounding content's `aria-busy` state.
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
# NavigationComponent
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { NavigationComponent } from "jsl-ui";
|
|
5
|
-
|
|
6
|
-
const navigation = new NavigationComponent({
|
|
7
|
-
title: "Workspace", position: "default",
|
|
8
|
-
data: [
|
|
9
|
-
{ content: "Projects", link: "#projects" },
|
|
10
|
-
{ content: "Settings", children: [{ content: "Profile", link: "#profile" }] }
|
|
11
|
-
]
|
|
12
|
-
});
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
- Position defaults to `"fixed"`; use `"default"` or `"static"` to participate in the page layout.
|
|
16
|
-
- Items with `link` use native anchors; callback-only items use buttons. Children provide submenus.
|
|
17
|
-
- Active links follow the current location. For a custom router, update `activeLink` in the options and refresh the view.
|
|
1
|
+
# NavigationComponent
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import { NavigationComponent } from "jsl-ui";
|
|
5
|
+
|
|
6
|
+
const navigation = new NavigationComponent({
|
|
7
|
+
title: "Workspace", position: "default",
|
|
8
|
+
data: [
|
|
9
|
+
{ content: "Projects", link: "#projects" },
|
|
10
|
+
{ content: "Settings", children: [{ content: "Profile", link: "#profile" }] }
|
|
11
|
+
]
|
|
12
|
+
});
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
- Position defaults to `"fixed"`; use `"default"` or `"static"` to participate in the page layout.
|
|
16
|
+
- Items with `link` use native anchors; callback-only items use buttons. Children provide submenus.
|
|
17
|
+
- Active links follow the current location. For a custom router, update `activeLink` in the options and refresh the view.
|