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.
Files changed (166) hide show
  1. package/docs/AutoSuggestComponent.md +17 -0
  2. package/docs/ButtonComponent.md +14 -0
  3. package/docs/CheckBoxComponent.md +12 -0
  4. package/docs/DateComponent.md +12 -0
  5. package/docs/DateRangeComponent.md +13 -0
  6. package/docs/DateTimeComponent.md +13 -0
  7. package/docs/DialogComponent.md +15 -0
  8. package/docs/ExpanderComponent.md +13 -0
  9. package/docs/FormComponent.md +15 -0
  10. package/docs/FormFieldComponent.md +15 -0
  11. package/docs/GridComponent.md +19 -0
  12. package/docs/InputComponent.md +15 -0
  13. package/docs/IntervalComponent.md +13 -0
  14. package/docs/LoadingComponent.md +12 -0
  15. package/docs/NavigationComponent.md +17 -0
  16. package/docs/Notification.md +14 -0
  17. package/docs/NotificationComponent.md +13 -0
  18. package/docs/NumberComponent.md +12 -0
  19. package/docs/OverlayComponent.md +12 -0
  20. package/docs/ProgressComponent.md +12 -0
  21. package/docs/README.md +24 -0
  22. package/docs/RibbonMenuComponent.md +14 -0
  23. package/docs/SelectComponent.md +15 -0
  24. package/docs/SplitterComponent.md +14 -0
  25. package/docs/StackPanelComponent.md +13 -0
  26. package/docs/TabsComponent.md +16 -0
  27. package/docs/TimeComponent.md +13 -0
  28. package/docs/TreeViewComponent.md +16 -0
  29. package/examples/showcase/checks-and-expanders.ts +163 -0
  30. package/examples/showcase/cultures.ts +39 -0
  31. package/examples/showcase/dates.ts +182 -0
  32. package/examples/showcase/dialogs.ts +184 -0
  33. package/examples/showcase/feedback-and-navigation.ts +174 -0
  34. package/examples/showcase/fields.ts +178 -0
  35. package/examples/showcase/fonts/Jost-Variable.ttf +0 -0
  36. package/examples/showcase/fonts/OFL-Jost.txt +93 -0
  37. package/examples/showcase/grids.ts +150 -0
  38. package/examples/showcase/index.html +60 -0
  39. package/examples/showcase/layout-and-navigation.ts +47 -0
  40. package/examples/showcase/nivona.css +98 -0
  41. package/examples/showcase/selects.ts +158 -0
  42. package/examples/showcase/showcase.css +231 -0
  43. package/examples/showcase/showcase.ts +214 -0
  44. package/examples/showcase/tabs.ts +161 -0
  45. package/examples/showcase/themes.css +83 -0
  46. package/examples/showcase/themes.ts +54 -0
  47. package/lib/components/IntervalComponent.d.ts +5 -0
  48. package/lib/components/IntervalComponent.js +29 -13
  49. package/lib/components/auto-suggest/AutoSuggestComponent.d.ts +11 -9
  50. package/lib/components/auto-suggest/AutoSuggestComponent.js +25 -38
  51. package/lib/components/button/ButtonComponent.d.ts +30 -1
  52. package/lib/components/button/ButtonComponent.js +85 -4
  53. package/lib/components/checkbox/CheckBoxComponent.d.ts +11 -1
  54. package/lib/components/checkbox/CheckBoxComponent.js +66 -56
  55. package/lib/components/checkbox/CheckBoxStyle.scss +72 -85
  56. package/lib/components/date/DateComponent.d.ts +10 -0
  57. package/lib/components/date/DateComponent.js +92 -44
  58. package/lib/components/date-range/DateRangeComponent.d.ts +14 -3
  59. package/lib/components/date-range/DateRangeComponent.js +96 -86
  60. package/lib/components/date-range/DateRangeStyle.scss +35 -11
  61. package/lib/components/date-time/DateTimeComponent.d.ts +8 -0
  62. package/lib/components/date-time/DateTimeComponent.js +64 -23
  63. package/lib/components/date-time/DateTimeStyle.scss +10 -7
  64. package/lib/components/dialog/DialogComponent.d.ts +21 -7
  65. package/lib/components/dialog/DialogComponent.js +179 -122
  66. package/lib/components/expander/ExpanderComponent.d.ts +15 -1
  67. package/lib/components/expander/ExpanderComponent.js +85 -64
  68. package/lib/components/expander/ExpanderStyle.scss +61 -47
  69. package/lib/components/form-field/FormFieldComponent.d.ts +45 -15
  70. package/lib/components/form-field/FormFieldComponent.js +249 -96
  71. package/lib/components/form-field/FormFieldStyle.scss +36 -87
  72. package/lib/components/form-field/create-control.d.ts +7 -0
  73. package/lib/components/form-field/create-control.js +48 -0
  74. package/lib/components/input/InputComponent.d.ts +18 -1
  75. package/lib/components/input/InputComponent.js +68 -93
  76. package/lib/components/loading/LoadingComponent.d.ts +9 -2
  77. package/lib/components/loading/LoadingComponent.js +13 -12
  78. package/lib/components/loading/LoadingStyle.css +19 -29
  79. package/lib/components/navigation/NavigationComponent.d.ts +34 -10
  80. package/lib/components/navigation/NavigationComponent.js +261 -33
  81. package/lib/components/navigation/NavigationStyle.scss +62 -226
  82. package/lib/components/notification/Notification.d.ts +37 -4
  83. package/lib/components/notification/Notification.js +160 -41
  84. package/lib/components/notification/Notification.scss +103 -19
  85. package/lib/components/number/NumberComponent.d.ts +16 -2
  86. package/lib/components/number/NumberComponent.js +54 -53
  87. package/lib/components/overlay/OverlayComponent.d.ts +13 -7
  88. package/lib/components/overlay/OverlayComponent.js +46 -114
  89. package/lib/components/overlay/overlay.css +18 -57
  90. package/lib/components/progress/ProgressComponent.d.ts +1 -0
  91. package/lib/components/progress/ProgressComponent.js +6 -6
  92. package/lib/components/progress/ProgressStyle.scss +5 -15
  93. package/lib/components/ribbon-menu/RibbonMenuComponent.js +2 -2
  94. package/lib/components/ribbon-menu/RibbonMenuStyle.scss +6 -76
  95. package/lib/components/select/SelectComponent.d.ts +33 -3
  96. package/lib/components/select/SelectComponent.js +312 -278
  97. package/lib/components/select/SelectDDAreaComponent.d.ts +13 -7
  98. package/lib/components/select/SelectDDAreaComponent.js +215 -256
  99. package/lib/components/select/SelectStyle.scss +204 -186
  100. package/lib/components/slider/nouislider.css +40 -54
  101. package/lib/components/stack-panel/SplitterComponent.d.ts +19 -3
  102. package/lib/components/stack-panel/SplitterComponent.js +94 -111
  103. package/lib/components/stack-panel/SplitterStyle.scss +9 -45
  104. package/lib/components/stack-panel/StackPanelComponent.js +3 -3
  105. package/lib/components/stack-panel/StackPanelStyle.scss +10 -52
  106. package/lib/components/tabs/TabsComponent.d.ts +17 -1
  107. package/lib/components/tabs/TabsComponent.js +247 -123
  108. package/lib/components/tabs/TabsStyle.scss +138 -75
  109. package/lib/components/time/TimeComponent.d.ts +5 -0
  110. package/lib/components/time/TimeComponent.js +61 -69
  111. package/lib/components/time/TimeComponent.scss +4 -4
  112. package/lib/components/tree-view/TreeViewComponent.d.ts +10 -4
  113. package/lib/components/tree-view/TreeViewComponent.js +65 -32
  114. package/lib/components/tree-view/TreeViewStyle.scss +12 -96
  115. package/lib/core/date.d.ts +2 -0
  116. package/lib/core/date.js +6 -0
  117. package/lib/core/jq.js +11 -8
  118. package/lib/grid/slick-default-theme.css +107 -31
  119. package/lib/grid/slick.creator.js +23 -5
  120. package/lib/grid/slick.formatters.js +4 -3
  121. package/lib/grid/slick.grid.css +38 -26
  122. package/lib/grid/slick.grid.d.ts +1 -0
  123. package/lib/grid/slick.grid.js +2 -3
  124. package/lib/grid.css +3413 -454
  125. package/lib/index.css +2500 -1031
  126. package/lib/index.css.map +1 -1
  127. package/lib/index.d.ts +1 -0
  128. package/lib/index.js +1 -1
  129. package/lib/index.js.map +1 -1
  130. package/lib/interaction/moveable.d.ts +1 -0
  131. package/lib/interaction/moveable.js +8 -0
  132. package/lib/interaction/resizable.d.ts +1 -0
  133. package/lib/interaction/resizable.js +9 -0
  134. package/lib/ui/auto.suggest.css +31 -14
  135. package/lib/ui/auto.suggest.d.ts +1 -0
  136. package/lib/ui/auto.suggest.js +88 -18
  137. package/lib/ui/base.css +2 -48
  138. package/lib/ui/button.css +134 -0
  139. package/lib/ui/date-input.css +11 -0
  140. package/lib/ui/date.picker/css/tiny-date-picker.css +124 -325
  141. package/lib/ui/date.picker/date-picker-options.js +4 -3
  142. package/lib/ui/date.picker/lib/date-manip.js +9 -0
  143. package/lib/ui/date.picker/mode/base-mode.d.ts +2 -1
  144. package/lib/ui/date.picker/mode/base-mode.js +112 -22
  145. package/lib/ui/date.picker/mode/dropdown-mode.d.ts +2 -4
  146. package/lib/ui/date.picker/mode/dropdown-mode.js +29 -42
  147. package/lib/ui/date.picker/mode/index.d.ts +2 -1
  148. package/lib/ui/date.picker/mode/modal-mode.d.ts +2 -1
  149. package/lib/ui/date.picker/mode/modal-mode.js +4 -2
  150. package/lib/ui/date.picker/mode/permanent-mode.d.ts +2 -1
  151. package/lib/ui/date.picker/views/day-picker.js +24 -15
  152. package/lib/ui/date.picker/views/month-picker.js +1 -1
  153. package/lib/ui/date.picker/views/year-picker.js +3 -2
  154. package/lib/ui/date.picker.d.ts +2 -1
  155. package/lib/ui/dialog.css +144 -108
  156. package/lib/ui/dialog.d.ts +19 -1
  157. package/lib/ui/dialog.js +178 -60
  158. package/lib/ui/input.css +35 -0
  159. package/lib/ui/number.input.js +50 -37
  160. package/lib/ui/theme.css +28 -0
  161. package/package.json +12 -8
  162. package/lib/components/drop-down/DropDownComponent.d.ts +0 -27
  163. package/lib/components/drop-down/DropDownComponent.js +0 -60
  164. package/lib/components/expander/OldExpanderStyle.scss +0 -37
  165. package/lib/ui/drop.down.d.ts +0 -52
  166. 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
- return this.options.onChange;
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 = { ...{ type: "text", enabled: true, bindMode: "toModel" }, ...options };
13
- if (this.options.bindTo != null && this.options.property != null && this.options.value == null) {
14
- this.options.value = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
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
- let val = this.options.value;
30
- if (this.options.bindMode !== "toModel" && this.options.bindTo != null && this.options.property != null) {
31
- if (this.onInput.count() > 0) {
32
- this.options.bindOnInput = true;
33
- }
34
- // const current = this.getValue();
35
- const newVal = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
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: this.options.type !== "textarea" ? "input" : "textarea",
34
+ tag: textarea ? "textarea" : "input",
48
35
  attr: {
49
- type: this.options.type !== "textarea" ? this.options.type : undefined,
50
- disabled: !this.options.enabled ? "disabled" : undefined,
51
- class: this.options.class,
52
- style: this.options.style,
53
- change: this.raiseChangeEvent,
54
- input: this.raiseInputEvent,
55
- value: this.options.type !== "textarea" ? val : undefined,
56
- placeholder: this.options.placeholder,
57
- id: typeof this.options.id === "string" ? this.options.id : undefined,
58
- maxLength: this.options.maxLength
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: this.options.type === "textarea" ? val : undefined
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
- if (this.currentDom == null) {
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
- var _a;
72
- this.options.value = value;
73
- if (this.currentDom != null) {
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
- onCreate(node) {
82
- this.currentDom = node.dom;
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
- // public onUpdate(node: IJSLVNode) {
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.enabled) {
104
- const value = node.dom.value;
105
- if (this.options.bindMode !== "fromModel" && this.options.bindTo && this.options.property) {
106
- this.options.bindTo[this.options.property] =
107
- ((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? this.options.converter.toData(value) : value;
108
- }
109
- this.options.onChange.notify(value);
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(e, node) {
87
+ raiseInputEvent(event, node) {
113
88
  var _a;
114
- if (this.onInput.count() === 0) {
89
+ if (!this.options.enabled) {
115
90
  return false;
116
91
  }
117
- if (this.options.enabled) {
118
- const value = node.dom.value;
119
- if (this.options.bindOnInput && this.options.bindMode !== "fromModel" && this.options.bindTo && this.options.property) {
120
- this.options.bindTo[this.options.property] =
121
- ((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? this.options.converter.toData(value) : value;
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 sizeInRem?;
5
- constructor(sizeInRem?: number);
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(sizeInRem) {
4
- this.sizeInRem = sizeInRem;
5
- if (sizeInRem == null) {
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
- attr: { style: "font-size:" + this.sizeInRem + "rem" },
16
- content: "<div class='lds-dual-ring'></div>",
17
- raw: true
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
- .lds-dual-ring {
2
- display: inline-block;
3
- /* width: 80px;
4
- height: 80px; */
5
- width: 1em;
6
- height: 1em;
7
- }
8
- .lds-dual-ring:after {
9
- content: " ";
10
- display: block;
11
- width: 0.75em;
12
- height: 0.75em;
13
- margin: 0.2em;
14
- /* width: 64px;
15
- height: 64px;
16
- margin: 8px; */
17
- border-radius: 50%;
18
- border: 0.08em solid #444444;
19
- border-color: #444444 transparent #444444 transparent;
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
- click?: (e: MouseEvent) => void;
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
- private itemToNode;
32
- private isActive;
33
- private toNode;
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
  }