jsl-ui 9.28.7 → 10.0.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/docs/AutoSuggestComponent.md +17 -0
- package/docs/ButtonComponent.md +14 -0
- package/docs/CheckBoxComponent.md +12 -0
- package/docs/DateComponent.md +12 -0
- package/docs/DateRangeComponent.md +13 -0
- package/docs/DateTimeComponent.md +13 -0
- package/docs/DialogComponent.md +15 -0
- package/docs/ExpanderComponent.md +13 -0
- package/docs/FormComponent.md +15 -0
- package/docs/FormFieldComponent.md +15 -0
- package/docs/GridComponent.md +19 -0
- package/docs/InputComponent.md +15 -0
- package/docs/IntervalComponent.md +13 -0
- package/docs/LoadingComponent.md +12 -0
- package/docs/NavigationComponent.md +17 -0
- package/docs/Notification.md +14 -0
- package/docs/NotificationComponent.md +13 -0
- package/docs/NumberComponent.md +12 -0
- package/docs/OverlayComponent.md +12 -0
- package/docs/ProgressComponent.md +12 -0
- package/docs/README.md +24 -0
- package/docs/RibbonMenuComponent.md +14 -0
- package/docs/SelectComponent.md +15 -0
- package/docs/SplitterComponent.md +14 -0
- package/docs/StackPanelComponent.md +13 -0
- package/docs/TabsComponent.md +16 -0
- package/docs/TimeComponent.md +13 -0
- package/docs/TreeViewComponent.md +16 -0
- package/examples/showcase/checks-and-expanders.ts +163 -0
- package/examples/showcase/cultures.ts +39 -0
- package/examples/showcase/dates.ts +182 -0
- package/examples/showcase/dialogs.ts +184 -0
- package/examples/showcase/feedback-and-navigation.ts +174 -0
- package/examples/showcase/fields.ts +178 -0
- package/examples/showcase/fonts/Jost-Variable.ttf +0 -0
- package/examples/showcase/fonts/OFL-Jost.txt +93 -0
- package/examples/showcase/grids.ts +150 -0
- package/examples/showcase/index.html +60 -0
- package/examples/showcase/layout-and-navigation.ts +47 -0
- package/examples/showcase/nivona.css +98 -0
- package/examples/showcase/selects.ts +158 -0
- package/examples/showcase/showcase.css +231 -0
- package/examples/showcase/showcase.ts +214 -0
- package/examples/showcase/tabs.ts +161 -0
- package/examples/showcase/themes.css +83 -0
- package/examples/showcase/themes.ts +54 -0
- package/lib/components/IntervalComponent.d.ts +5 -0
- package/lib/components/IntervalComponent.js +29 -13
- package/lib/components/auto-suggest/AutoSuggestComponent.d.ts +11 -9
- package/lib/components/auto-suggest/AutoSuggestComponent.js +25 -38
- package/lib/components/button/ButtonComponent.d.ts +30 -1
- package/lib/components/button/ButtonComponent.js +85 -4
- package/lib/components/checkbox/CheckBoxComponent.d.ts +11 -1
- package/lib/components/checkbox/CheckBoxComponent.js +66 -56
- package/lib/components/checkbox/CheckBoxStyle.scss +72 -85
- package/lib/components/date/DateComponent.d.ts +10 -0
- package/lib/components/date/DateComponent.js +92 -44
- package/lib/components/date-range/DateRangeComponent.d.ts +14 -3
- package/lib/components/date-range/DateRangeComponent.js +96 -86
- package/lib/components/date-range/DateRangeStyle.scss +35 -11
- package/lib/components/date-time/DateTimeComponent.d.ts +8 -0
- package/lib/components/date-time/DateTimeComponent.js +64 -23
- package/lib/components/date-time/DateTimeStyle.scss +10 -7
- package/lib/components/dialog/DialogComponent.d.ts +21 -7
- package/lib/components/dialog/DialogComponent.js +179 -122
- package/lib/components/expander/ExpanderComponent.d.ts +15 -1
- package/lib/components/expander/ExpanderComponent.js +85 -64
- package/lib/components/expander/ExpanderStyle.scss +61 -47
- package/lib/components/form-field/FormFieldComponent.d.ts +45 -15
- package/lib/components/form-field/FormFieldComponent.js +249 -96
- package/lib/components/form-field/FormFieldStyle.scss +36 -87
- package/lib/components/form-field/create-control.d.ts +7 -0
- package/lib/components/form-field/create-control.js +48 -0
- package/lib/components/input/InputComponent.d.ts +18 -1
- package/lib/components/input/InputComponent.js +68 -93
- package/lib/components/loading/LoadingComponent.d.ts +9 -2
- package/lib/components/loading/LoadingComponent.js +13 -12
- package/lib/components/loading/LoadingStyle.css +19 -29
- package/lib/components/navigation/NavigationComponent.d.ts +34 -10
- package/lib/components/navigation/NavigationComponent.js +261 -33
- package/lib/components/navigation/NavigationStyle.scss +62 -226
- package/lib/components/notification/Notification.d.ts +37 -4
- package/lib/components/notification/Notification.js +160 -41
- package/lib/components/notification/Notification.scss +103 -19
- package/lib/components/number/NumberComponent.d.ts +16 -2
- package/lib/components/number/NumberComponent.js +54 -53
- package/lib/components/overlay/OverlayComponent.d.ts +13 -7
- package/lib/components/overlay/OverlayComponent.js +46 -114
- package/lib/components/overlay/overlay.css +18 -57
- package/lib/components/progress/ProgressComponent.d.ts +1 -0
- package/lib/components/progress/ProgressComponent.js +6 -6
- package/lib/components/progress/ProgressStyle.scss +5 -15
- package/lib/components/ribbon-menu/RibbonMenuComponent.js +2 -2
- package/lib/components/ribbon-menu/RibbonMenuStyle.scss +6 -76
- package/lib/components/select/SelectComponent.d.ts +33 -3
- package/lib/components/select/SelectComponent.js +312 -278
- package/lib/components/select/SelectDDAreaComponent.d.ts +13 -7
- package/lib/components/select/SelectDDAreaComponent.js +215 -256
- package/lib/components/select/SelectStyle.scss +204 -186
- package/lib/components/slider/nouislider.css +40 -54
- package/lib/components/stack-panel/SplitterComponent.d.ts +19 -3
- package/lib/components/stack-panel/SplitterComponent.js +94 -111
- package/lib/components/stack-panel/SplitterStyle.scss +9 -45
- package/lib/components/stack-panel/StackPanelComponent.js +3 -3
- package/lib/components/stack-panel/StackPanelStyle.scss +10 -52
- package/lib/components/tabs/TabsComponent.d.ts +17 -1
- package/lib/components/tabs/TabsComponent.js +247 -123
- package/lib/components/tabs/TabsStyle.scss +138 -75
- package/lib/components/time/TimeComponent.d.ts +5 -0
- package/lib/components/time/TimeComponent.js +61 -69
- package/lib/components/time/TimeComponent.scss +4 -4
- package/lib/components/tree-view/TreeViewComponent.d.ts +10 -4
- package/lib/components/tree-view/TreeViewComponent.js +65 -32
- package/lib/components/tree-view/TreeViewStyle.scss +12 -96
- package/lib/core/date.d.ts +2 -0
- package/lib/core/date.js +6 -0
- package/lib/core/jq.js +11 -8
- package/lib/grid/slick-default-theme.css +107 -31
- package/lib/grid/slick.creator.js +23 -5
- package/lib/grid/slick.formatters.js +4 -3
- package/lib/grid/slick.grid.css +38 -26
- package/lib/grid/slick.grid.d.ts +1 -0
- package/lib/grid/slick.grid.js +2 -3
- package/lib/grid.css +3413 -454
- package/lib/index.css +2500 -1031
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/interaction/moveable.d.ts +1 -0
- package/lib/interaction/moveable.js +8 -0
- package/lib/interaction/resizable.d.ts +1 -0
- package/lib/interaction/resizable.js +9 -0
- package/lib/ui/auto.suggest.css +31 -14
- package/lib/ui/auto.suggest.d.ts +1 -0
- package/lib/ui/auto.suggest.js +88 -18
- package/lib/ui/base.css +2 -48
- package/lib/ui/button.css +134 -0
- package/lib/ui/date-input.css +11 -0
- package/lib/ui/date.picker/css/tiny-date-picker.css +124 -325
- package/lib/ui/date.picker/date-picker-options.js +4 -3
- package/lib/ui/date.picker/lib/date-manip.js +9 -0
- package/lib/ui/date.picker/mode/base-mode.d.ts +2 -1
- package/lib/ui/date.picker/mode/base-mode.js +112 -22
- package/lib/ui/date.picker/mode/dropdown-mode.d.ts +2 -4
- package/lib/ui/date.picker/mode/dropdown-mode.js +29 -42
- package/lib/ui/date.picker/mode/index.d.ts +2 -1
- package/lib/ui/date.picker/mode/modal-mode.d.ts +2 -1
- package/lib/ui/date.picker/mode/modal-mode.js +4 -2
- package/lib/ui/date.picker/mode/permanent-mode.d.ts +2 -1
- package/lib/ui/date.picker/views/day-picker.js +24 -15
- package/lib/ui/date.picker/views/month-picker.js +1 -1
- package/lib/ui/date.picker/views/year-picker.js +3 -2
- package/lib/ui/date.picker.d.ts +2 -1
- package/lib/ui/dialog.css +144 -108
- package/lib/ui/dialog.d.ts +19 -1
- package/lib/ui/dialog.js +178 -60
- package/lib/ui/input.css +35 -0
- package/lib/ui/number.input.js +50 -37
- package/lib/ui/theme.css +28 -0
- package/package.json +12 -8
- package/lib/components/drop-down/DropDownComponent.d.ts +0 -27
- package/lib/components/drop-down/DropDownComponent.js +0 -60
- package/lib/components/expander/OldExpanderStyle.scss +0 -37
- package/lib/ui/drop.down.d.ts +0 -52
- package/lib/ui/drop.down.js +0 -2112
|
@@ -1,126 +1,101 @@
|
|
|
1
|
+
import "../../ui/input.css";
|
|
1
2
|
import { EventHandler } from "../../interaction/eventhandler";
|
|
2
|
-
// tslint:disable-next-line: max-classes-per-file
|
|
3
3
|
export class InputComponent {
|
|
4
|
-
get onChange() {
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
get onInput() {
|
|
8
|
-
return this.options.onInput;
|
|
9
|
-
}
|
|
4
|
+
get onChange() { return this.options.onChange; }
|
|
5
|
+
get onInput() { return this.options.onInput; }
|
|
10
6
|
constructor(options) {
|
|
11
7
|
var _a;
|
|
12
|
-
this.options = {
|
|
13
|
-
if (this.
|
|
14
|
-
this.options.value =
|
|
15
|
-
this.options.converter.toUI(this.options.bindTo[this.options.property]) :
|
|
16
|
-
this.options.bindTo[this.options.property]);
|
|
8
|
+
this.options = { type: "text", enabled: true, bindMode: "toModel", ...options };
|
|
9
|
+
if (this.hasBinding() && this.options.value == null) {
|
|
10
|
+
this.options.value = this.readModel();
|
|
17
11
|
}
|
|
12
|
+
this.modelValue = (_a = this.options.value) !== null && _a !== void 0 ? _a : "";
|
|
13
|
+
this.initialTextValue = this.modelValue;
|
|
18
14
|
this.options.onChange = EventHandler.Create(this.options.onChange);
|
|
19
15
|
this.options.onInput = EventHandler.Create(this.options.onInput);
|
|
20
16
|
if (this.options.type === "input") {
|
|
21
17
|
this.options.type = "text";
|
|
22
18
|
}
|
|
23
19
|
}
|
|
24
|
-
// public isEqual(node: IJSLComponent): boolean {
|
|
25
|
-
// return (this as any).__proto__ === (node as any).__proto__;
|
|
26
|
-
// }
|
|
27
20
|
render() {
|
|
28
|
-
var _a;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (this.
|
|
32
|
-
this.options.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this.options.converter.toUI(this.options.bindTo[this.options.property]) :
|
|
37
|
-
this.options.bindTo[this.options.property]);
|
|
38
|
-
// if (newVal !== current)
|
|
39
|
-
{
|
|
40
|
-
val = newVal;
|
|
41
|
-
if (this.currentDom != null) {
|
|
42
|
-
this.currentDom.value = val !== null && val !== void 0 ? val : "";
|
|
21
|
+
var _a, _b, _c;
|
|
22
|
+
if (this.options.bindMode !== "toModel" && this.hasBinding()) {
|
|
23
|
+
const value = this.readModel();
|
|
24
|
+
if (value !== this.modelValue) {
|
|
25
|
+
this.options.value = value;
|
|
26
|
+
this.modelValue = value;
|
|
27
|
+
if (this.currentDom && this.currentDom.value !== value) {
|
|
28
|
+
this.currentDom.value = value;
|
|
43
29
|
}
|
|
44
30
|
}
|
|
45
31
|
}
|
|
32
|
+
const textarea = this.options.type === "textarea";
|
|
46
33
|
return {
|
|
47
|
-
tag:
|
|
34
|
+
tag: textarea ? "textarea" : "input",
|
|
48
35
|
attr: {
|
|
49
|
-
type:
|
|
50
|
-
disabled:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
input: this.raiseInputEvent,
|
|
55
|
-
value: this.options.
|
|
56
|
-
placeholder: this.options.placeholder,
|
|
57
|
-
|
|
58
|
-
|
|
36
|
+
type: textarea ? undefined : this.options.type,
|
|
37
|
+
disabled: this.options.enabled ? undefined : "disabled",
|
|
38
|
+
readonly: this.options.readOnly ? "readonly" : undefined,
|
|
39
|
+
class: (this.options.unstyled ? "" : "jsl-input ") + ((_a = this.options.class) !== null && _a !== void 0 ? _a : ""),
|
|
40
|
+
style: this.options.style, id: this.options.id,
|
|
41
|
+
change: this.raiseChangeEvent, input: this.raiseInputEvent,
|
|
42
|
+
value: textarea ? undefined : (_b = this.options.value) !== null && _b !== void 0 ? _b : "",
|
|
43
|
+
placeholder: this.options.placeholder, maxlength: this.options.maxLength,
|
|
44
|
+
rows: textarea ? this.options.rows : undefined,
|
|
45
|
+
"aria-label": this.options.ariaLabel, autocomplete: this.options.autocomplete
|
|
59
46
|
},
|
|
60
|
-
content
|
|
47
|
+
// Keep textarea content stable after mounting; updating textContent can reset the caret.
|
|
48
|
+
content: textarea ? (this.currentDom ? this.initialTextValue : (this.initialTextValue = (_c = this.options.value) !== null && _c !== void 0 ? _c : "")) : undefined
|
|
61
49
|
};
|
|
62
50
|
}
|
|
63
|
-
getValue() {
|
|
64
|
-
|
|
65
|
-
return this.options.value || "";
|
|
66
|
-
// return "";
|
|
67
|
-
}
|
|
68
|
-
return this.currentDom.value;
|
|
69
|
-
}
|
|
51
|
+
getValue() { var _a, _b, _c; return (_c = (_b = (_a = this.currentDom) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : this.options.value) !== null && _c !== void 0 ? _c : ""; }
|
|
52
|
+
/** Updates the input and writable binding without raising events. */
|
|
70
53
|
setValue(value) {
|
|
71
|
-
|
|
72
|
-
this.
|
|
73
|
-
|
|
74
|
-
this.currentDom.value = value;
|
|
75
|
-
}
|
|
76
|
-
if (this.options.bindMode !== "fromModel" && this.options.bindTo && this.options.property) {
|
|
77
|
-
this.options.bindTo[this.options.property] =
|
|
78
|
-
((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? this.options.converter.toData(value) : value;
|
|
54
|
+
this.options.value = value !== null && value !== void 0 ? value : "";
|
|
55
|
+
if (this.currentDom && this.currentDom.value !== this.options.value) {
|
|
56
|
+
this.currentDom.value = this.options.value;
|
|
79
57
|
}
|
|
58
|
+
this.writeModel(this.options.value);
|
|
80
59
|
}
|
|
81
|
-
|
|
82
|
-
|
|
60
|
+
focus() { var _a; (_a = this.currentDom) === null || _a === void 0 ? void 0 : _a.focus(); }
|
|
61
|
+
onInit(renderer) { this.renderer = renderer; }
|
|
62
|
+
onCreate(node) { this.currentDom = node.dom; }
|
|
63
|
+
onUpdate(node) { this.currentDom = node.dom; }
|
|
64
|
+
onRemove() { this.currentDom = null; }
|
|
65
|
+
hasBinding() { return this.options.bindTo != null && this.options.property != null; }
|
|
66
|
+
readModel() {
|
|
67
|
+
var _a, _b;
|
|
68
|
+
const value = this.options.bindTo[this.options.property];
|
|
69
|
+
return ((_b = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ? this.options.converter.toUI(value) : value)) !== null && _b !== void 0 ? _b : "");
|
|
83
70
|
}
|
|
84
|
-
|
|
85
|
-
// this.currentDom = node.dom as HTMLInputElement;
|
|
86
|
-
// if (this.options.bindMode !== "toModel" && this.options.bindTo != null && this.options.property != null) {
|
|
87
|
-
// if (this.onInput.count() > 0) {
|
|
88
|
-
// this.options.bindOnInput = true;
|
|
89
|
-
// }
|
|
90
|
-
// const current = this.getValue();
|
|
91
|
-
// const newVal = (this.options.converter?.toUI ?
|
|
92
|
-
// this.options.converter.toUI(this.options.bindTo[this.options.property]) :
|
|
93
|
-
// this.options.bindTo[this.options.property]) as string;
|
|
94
|
-
// if (newVal !== current) {
|
|
95
|
-
// if (this.currentDom != null) {
|
|
96
|
-
// this.currentDom.value = newVal ?? "";
|
|
97
|
-
// }
|
|
98
|
-
// }
|
|
99
|
-
// }
|
|
100
|
-
// }
|
|
101
|
-
raiseChangeEvent(e, node) {
|
|
71
|
+
writeModel(value) {
|
|
102
72
|
var _a;
|
|
103
|
-
if (this.options.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
73
|
+
if (this.hasBinding() && this.options.bindMode !== "fromModel") {
|
|
74
|
+
this.options.bindTo[this.options.property] = ((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? this.options.converter.toData(value) : value;
|
|
75
|
+
this.modelValue = value;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
raiseChangeEvent(event, node) {
|
|
79
|
+
if (!this.options.enabled) {
|
|
80
|
+
return false;
|
|
110
81
|
}
|
|
82
|
+
const value = node.dom.value;
|
|
83
|
+
this.options.value = value;
|
|
84
|
+
this.writeModel(value);
|
|
85
|
+
this.onChange.notify(value);
|
|
111
86
|
}
|
|
112
|
-
raiseInputEvent(
|
|
87
|
+
raiseInputEvent(event, node) {
|
|
113
88
|
var _a;
|
|
114
|
-
if (this.
|
|
89
|
+
if (!this.options.enabled) {
|
|
115
90
|
return false;
|
|
116
91
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
this.options.onInput.notify(value);
|
|
92
|
+
const value = node.dom.value;
|
|
93
|
+
this.options.value = value;
|
|
94
|
+
const bindOnInput = (_a = this.options.bindOnInput) !== null && _a !== void 0 ? _a : (this.options.bindMode !== "toModel" && this.onInput.count() > 0);
|
|
95
|
+
if (bindOnInput) {
|
|
96
|
+
this.writeModel(value);
|
|
124
97
|
}
|
|
98
|
+
this.onInput.notify(value);
|
|
99
|
+
return this.onInput.count() ? undefined : false;
|
|
125
100
|
}
|
|
126
101
|
}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import "./LoadingStyle.css";
|
|
2
2
|
import { IJSLComponent, IJSLVNode } from "jsl-render";
|
|
3
|
+
export interface ILoadingOptions {
|
|
4
|
+
sizeInRem?: number;
|
|
5
|
+
label?: string;
|
|
6
|
+
showLabel?: boolean;
|
|
7
|
+
class?: string;
|
|
8
|
+
style?: string;
|
|
9
|
+
}
|
|
3
10
|
export declare class LoadingComponent implements IJSLComponent {
|
|
4
|
-
private
|
|
5
|
-
constructor(
|
|
11
|
+
private options;
|
|
12
|
+
constructor(sizeOrOptions?: number | ILoadingOptions);
|
|
6
13
|
isEqual(node: IJSLComponent): boolean;
|
|
7
14
|
render(): IJSLVNode;
|
|
8
15
|
}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import "./LoadingStyle.css";
|
|
2
2
|
export class LoadingComponent {
|
|
3
|
-
constructor(
|
|
4
|
-
this.
|
|
5
|
-
|
|
6
|
-
this.sizeInRem = 6;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
isEqual(node) {
|
|
10
|
-
return this.__proto__ === node.__proto__;
|
|
3
|
+
constructor(sizeOrOptions) {
|
|
4
|
+
this.options = typeof sizeOrOptions === "number" ? { sizeInRem: sizeOrOptions } : { ...sizeOrOptions };
|
|
5
|
+
this.options.sizeInRem = Math.max(.5, Number.isFinite(this.options.sizeInRem) ? this.options.sizeInRem : 6);
|
|
11
6
|
}
|
|
7
|
+
isEqual(node) { return this.__proto__ === node.__proto__; }
|
|
12
8
|
render() {
|
|
9
|
+
var _a, _b, _c;
|
|
13
10
|
return {
|
|
14
|
-
tag: "div",
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
tag: "div", attr: {
|
|
12
|
+
class: "jsl-loading " + ((_a = this.options.class) !== null && _a !== void 0 ? _a : ""),
|
|
13
|
+
style: "--jsl-loading-size:" + this.options.sizeInRem + "rem;" + ((_b = this.options.style) !== null && _b !== void 0 ? _b : ""),
|
|
14
|
+
role: "status", "aria-live": "polite", "aria-atomic": "true"
|
|
15
|
+
}, children: [
|
|
16
|
+
{ tag: "span", attr: { class: "lds-dual-ring", "aria-hidden": "true" } },
|
|
17
|
+
{ tag: "span", content: (_c = this.options.label) !== null && _c !== void 0 ? _c : "Loading…", attr: { class: "jsl-loading-label" + (this.options.showLabel ? "" : " jsl-loading-label-hidden") } }
|
|
18
|
+
]
|
|
18
19
|
};
|
|
19
20
|
}
|
|
20
21
|
}
|
|
@@ -1,29 +1,19 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
animation: lds-dual-ring 1.2s linear infinite;
|
|
21
|
-
}
|
|
22
|
-
@keyframes lds-dual-ring {
|
|
23
|
-
0% {
|
|
24
|
-
transform: rotate(0deg);
|
|
25
|
-
}
|
|
26
|
-
100% {
|
|
27
|
-
transform: rotate(360deg);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
1
|
+
@import "../../ui/theme.css";
|
|
2
|
+
|
|
3
|
+
.jsl-loading { display: inline-flex; align-items: center; justify-content: center; gap: .625rem; max-width: 100%; color: var(--jsl-color-text-secondary); font: inherit; vertical-align: middle; }
|
|
4
|
+
.lds-dual-ring { display: inline-block; position: relative; flex-shrink: 0; width: var(--jsl-loading-size, 1em); height: var(--jsl-loading-size, 1em); max-width: 100%; }
|
|
5
|
+
.lds-dual-ring::after {
|
|
6
|
+
content: "";
|
|
7
|
+
position: absolute;
|
|
8
|
+
inset: 0;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
border: max(2px, calc(var(--jsl-loading-size, 1em) * .08)) solid var(--jsl-color-border-subtle);
|
|
11
|
+
border-top-color: var(--jsl-loading-color, var(--jsl-color-accent));
|
|
12
|
+
border-right-color: var(--jsl-loading-color, var(--jsl-color-accent));
|
|
13
|
+
border-radius: 50%;
|
|
14
|
+
animation: jsl-loading-spin .85s linear infinite;
|
|
15
|
+
}
|
|
16
|
+
.jsl-loading-label { font-size: .8125rem; line-height: 1.5; }
|
|
17
|
+
.jsl-loading-label-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
|
|
18
|
+
@keyframes jsl-loading-spin { to { transform: rotate(360deg); } }
|
|
19
|
+
@media (prefers-reduced-motion: reduce) { .lds-dual-ring::after { animation: none; } }
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import "./NavigationStyle.scss";
|
|
2
|
-
import { IJSLComponent, IJSLVNode } from "jsl-render";
|
|
2
|
+
import { IJSLComponent, IJSLVNode, JSLRender } from "jsl-render";
|
|
3
3
|
export interface INavItemChild {
|
|
4
4
|
content: string | IJSLVNode;
|
|
5
5
|
link?: string;
|
|
6
6
|
target?: string;
|
|
7
7
|
click?: (e: MouseEvent) => void;
|
|
8
|
-
}
|
|
9
|
-
export interface INavItem {
|
|
10
|
-
content: string | IJSLVNode;
|
|
11
|
-
link?: string;
|
|
12
|
-
target?: string;
|
|
13
8
|
children?: INavItemChild[];
|
|
14
|
-
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
active?: boolean;
|
|
11
|
+
/** Accessible name for a separate submenu button with rich content. */
|
|
12
|
+
submenuLabel?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface INavItem extends INavItemChild {
|
|
15
15
|
}
|
|
16
16
|
export interface INavigationOptions {
|
|
17
17
|
title: string | IJSLVNode;
|
|
@@ -22,13 +22,37 @@ export interface INavigationOptions {
|
|
|
22
22
|
position?: "default" | "static" | "fixed" | "fixed-bottom";
|
|
23
23
|
alignment?: "right" | "left";
|
|
24
24
|
id?: string;
|
|
25
|
+
ariaLabel?: string;
|
|
26
|
+
menuButtonLabel?: string;
|
|
27
|
+
/** Override location-based selection for applications with their own router. */
|
|
28
|
+
activeLink?: string;
|
|
25
29
|
}
|
|
30
|
+
/** Responsive navigation using native links and disclosure buttons. */
|
|
26
31
|
export declare class NavigationComponent implements IJSLComponent {
|
|
32
|
+
State: {
|
|
33
|
+
id: string;
|
|
34
|
+
mobileOpen: boolean;
|
|
35
|
+
openPath: string;
|
|
36
|
+
dom?: HTMLElement;
|
|
37
|
+
renderer?: JSLRender;
|
|
38
|
+
owner?: NavigationComponent;
|
|
39
|
+
cleanup?: () => void;
|
|
40
|
+
};
|
|
27
41
|
private options;
|
|
28
42
|
constructor(options: INavigationOptions);
|
|
29
43
|
isEqual(node: IJSLComponent): boolean;
|
|
44
|
+
onInit(renderer: JSLRender): void;
|
|
30
45
|
render(): IJSLVNode;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
private
|
|
46
|
+
onCreate(node: IJSLVNode): void;
|
|
47
|
+
onRemove(): void;
|
|
48
|
+
private item;
|
|
49
|
+
private keydown;
|
|
50
|
+
private rowControls;
|
|
51
|
+
private disclosure;
|
|
52
|
+
private isCompact;
|
|
53
|
+
private close;
|
|
54
|
+
private activePath;
|
|
55
|
+
private refresh;
|
|
56
|
+
private node;
|
|
57
|
+
private chevron;
|
|
34
58
|
}
|