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.
Files changed (95) hide show
  1. package/docs/AutoSuggestComponent.md +17 -17
  2. package/docs/ButtonComponent.md +22 -22
  3. package/docs/CheckBoxComponent.md +12 -12
  4. package/docs/DataBinding.md +19 -19
  5. package/docs/DateComponent.md +12 -12
  6. package/docs/DateRangeComponent.md +13 -13
  7. package/docs/DateTimeComponent.md +14 -14
  8. package/docs/DialogComponent.md +15 -15
  9. package/docs/DropdownMenuComponent.md +22 -22
  10. package/docs/ExpanderComponent.md +13 -13
  11. package/docs/FormComponent.md +15 -15
  12. package/docs/FormFieldComponent.md +15 -15
  13. package/docs/GridComponent.md +39 -39
  14. package/docs/InputComponent.md +15 -15
  15. package/docs/IntervalComponent.md +13 -13
  16. package/docs/LoadingComponent.md +12 -12
  17. package/docs/NavigationComponent.md +17 -17
  18. package/docs/Notification.md +14 -14
  19. package/docs/NotificationComponent.md +13 -13
  20. package/docs/NumberComponent.md +12 -12
  21. package/docs/OverlayComponent.md +13 -13
  22. package/docs/ProgressComponent.md +12 -12
  23. package/docs/README.md +27 -27
  24. package/docs/RibbonMenuComponent.md +14 -14
  25. package/docs/SelectComponent.md +36 -36
  26. package/docs/SliderComponent.md +20 -20
  27. package/docs/SplitterComponent.md +14 -14
  28. package/docs/StackPanelComponent.md +13 -13
  29. package/docs/TabsComponent.md +16 -16
  30. package/docs/TimeComponent.md +13 -13
  31. package/docs/TreeViewComponent.md +16 -16
  32. package/examples/showcase/checks-and-expanders.ts +148 -148
  33. package/examples/showcase/cultures.ts +39 -39
  34. package/examples/showcase/data-binding.ts +138 -138
  35. package/examples/showcase/dates.ts +168 -168
  36. package/examples/showcase/dialogs.ts +184 -184
  37. package/examples/showcase/dropdown-menus.ts +99 -99
  38. package/examples/showcase/feedback-and-navigation.ts +173 -173
  39. package/examples/showcase/fields.ts +166 -166
  40. package/examples/showcase/fonts/OFL-BricolageGrotesque.txt +93 -93
  41. package/examples/showcase/fonts/OFL-Figtree.txt +93 -93
  42. package/examples/showcase/fonts/OFL-Jost.txt +93 -93
  43. package/examples/showcase/generate-sources.cjs +104 -104
  44. package/examples/showcase/grids.ts +484 -484
  45. package/examples/showcase/index.html +71 -71
  46. package/examples/showcase/layout-and-navigation.ts +46 -46
  47. package/examples/showcase/nivona.css +98 -98
  48. package/examples/showcase/package.json +10 -10
  49. package/examples/showcase/selects.ts +184 -184
  50. package/examples/showcase/showcase-sources.ts +94 -94
  51. package/examples/showcase/showcase.css +281 -281
  52. package/examples/showcase/showcase.ts +244 -244
  53. package/examples/showcase/tabs.ts +161 -161
  54. package/examples/showcase/themes.css +83 -83
  55. package/examples/showcase/themes.ts +56 -56
  56. package/examples/showcase/wirtshans.css +65 -65
  57. package/lib/components/checkbox/CheckBoxStyle.scss +73 -73
  58. package/lib/components/date-range/DateRangeStyle.scss +35 -35
  59. package/lib/components/date-time/DateTimeStyle.scss +9 -9
  60. package/lib/components/dialog/DialogComponent.d.ts +9 -2
  61. package/lib/components/dialog/DialogComponent.js +17 -51
  62. package/lib/components/dropdown-menu/DropdownMenuStyle.scss +48 -48
  63. package/lib/components/expander/ExpanderStyle.scss +61 -61
  64. package/lib/components/form-field/FormFieldStyle.scss +36 -36
  65. package/lib/components/host/RenderHost.d.ts +25 -0
  66. package/lib/components/host/RenderHost.js +63 -0
  67. package/lib/components/loading/LoadingStyle.css +18 -18
  68. package/lib/components/navigation/NavigationStyle.scss +61 -61
  69. package/lib/components/notification/Notification.scss +102 -102
  70. package/lib/components/overlay/OverlayComponent.d.ts +9 -1
  71. package/lib/components/overlay/OverlayComponent.js +22 -13
  72. package/lib/components/overlay/overlay.css +15 -15
  73. package/lib/components/progress/ProgressStyle.scss +4 -4
  74. package/lib/components/ribbon-menu/RibbonMenuStyle.scss +5 -5
  75. package/lib/components/select/SelectStyle.scss +207 -207
  76. package/lib/components/slider/SliderStyle.scss +21 -21
  77. package/lib/components/slider/nouislider.css +15 -15
  78. package/lib/components/stack-panel/SplitterStyle.scss +8 -8
  79. package/lib/components/stack-panel/StackPanelStyle.scss +10 -10
  80. package/lib/components/tabs/TabsStyle.scss +139 -139
  81. package/lib/components/time/TimeComponent.scss +3 -3
  82. package/lib/components/tree-view/TreeViewStyle.scss +14 -14
  83. package/lib/core/helper.js +11 -6
  84. package/lib/grid/plugins/slick.headermenu.css +98 -98
  85. package/lib/grid.css +840 -3532
  86. package/lib/index.css.map +1 -1
  87. package/lib/index.js.map +1 -1
  88. package/lib/ui/auto.suggest.css +30 -30
  89. package/lib/ui/button.css +147 -147
  90. package/lib/ui/date-input.css +10 -10
  91. package/lib/ui/date.picker/css/tiny-date-picker.css +124 -124
  92. package/lib/ui/dialog.css +144 -144
  93. package/lib/ui/input.css +35 -35
  94. package/lib/ui/theme.css +28 -28
  95. package/package.json +1 -1
@@ -1,138 +1,138 @@
1
- import { IJSLComponent, IJSLVNode } from "jsl-render";
2
- import { ButtonComponent } from "../../components/button/ButtonComponent";
3
- import { CheckBoxComponent } from "../../components/checkbox/CheckBoxComponent";
4
- import { DateTimeComponent } from "../../components/date-time/DateTimeComponent";
5
- import { InputComponent } from "../../components/input/InputComponent";
6
- import { NumberComponent } from "../../components/number/NumberComponent";
7
- import { SelectComponent } from "../../components/select/SelectComponent";
8
- import { date } from "../../core/date";
9
-
10
- type Content = IJSLVNode | IJSLComponent;
11
- const text = (tag: string, content: string, className?: string): IJSLVNode => ({ tag, content, attr: { class: className } });
12
- const group = (children: Content[], className?: string): IJSLVNode => ({ tag: "div", attr: { class: className }, children });
13
- const status = (content: string): IJSLVNode => ({ tag: "p", content, attr: { class: "sample-status", role: "status" } });
14
- const action = (content: string, click: () => void) => new ButtonComponent({ content, click, type: "button", outlined: true, size: "small" });
15
- const field = (id: string, label: string, control: Content) => group([
16
- { tag: "label", content: label, attr: { for: id } }, control
17
- ], "binding-field");
18
- function card(id: string, number: string, title: string, description: string, children: Content[]): IJSLVNode {
19
- return { tag: "article", attr: { class: "sample-card", id }, children: [
20
- group([text("span", number, "sample-number"), text("h2", title)], "card-heading"),
21
- text("p", description, "card-description"), ...children
22
- ] };
23
- }
24
-
25
- const createModel = { title: "Waiting for the first commit" };
26
- const createStatus = status("Model value: Ready for review");
27
- const createInput = new InputComponent({
28
- id: "binding-to-model", value: "Ready for review", bindTo: createModel, property: "title", bindMode: "toModel",
29
- onChange: () => { createStatus.content = "Model value: " + createModel.title; }
30
- });
31
-
32
- const readModel = { subscribed: false };
33
- const readStatus = status("Model value: off. Toggle the control to see that edits stay local.");
34
- const readCheck = new CheckBoxComponent({
35
- id: "binding-from-model", label: "Send weekly updates", bindTo: readModel, property: "subscribed", bindMode: "fromModel",
36
- onChange: value => { readStatus.content = "Change event: " + (value ? "on" : "off") + "; model is still " + (readModel.subscribed ? "on" : "off") + "."; }
37
- });
38
-
39
- const budgetModel = { cents: 12500 };
40
- const budgetStatus = status("Model value: 12500 cents");
41
- const budgetInput = new NumberComponent({
42
- id: "binding-both", bindTo: budgetModel, property: "cents", bindMode: "both", format: "0.00",
43
- converter: { toUI: cents => cents / 100, toData: amount => amount == null ? null : Math.round(amount * 100) },
44
- onChange: () => { budgetStatus.content = "Model value: " + budgetModel.cents + " cents"; }
45
- });
46
-
47
- const projectOptions = [
48
- { value: "website", text: "Website refresh" },
49
- { value: "library", text: "Component library" },
50
- { value: "research", text: "Customer research" }
51
- ];
52
- const projectModel = { current: "library" };
53
- const projectStatus = status("Model value: library");
54
- const projectSelect = new SelectComponent({
55
- id: "binding-select", data: projectOptions, bindTo: projectModel, property: "current", bindMode: "both",
56
- ariaLabel: "Bound project", placeholder: "Choose a project",
57
- onChange: value => { projectStatus.content = "Model value: " + (value ?? "empty"); }
58
- });
59
-
60
- const appointmentModel = { appointment: new Date(2026, 9, 21, 14, 45) };
61
- const appointmentText = () => {
62
- const value = appointmentModel.appointment;
63
- return value ? "Model value: " + date.format(value) + " at " + date.formatTime(value, "HourMinute") : "Model value: cleared";
64
- };
65
- const appointmentStatus = status(appointmentText());
66
- const appointment = new DateTimeComponent({
67
- id: "binding-datetime", bindTo: appointmentModel, property: "appointment", bindMode: "both",
68
- onChange: () => { appointmentStatus.content = appointmentText(); }
69
- });
70
-
71
- export const dataBindingShowcase: IJSLVNode = {
72
- tag: "section", attr: { id: "data-binding", class: "component-section", "aria-labelledby": "data-binding-title" }, children: [
73
- group([
74
- group([
75
- text("p", "THE ESSENTIALS / 24", "eyebrow"),
76
- { tag: "h2", content: "Data binding", attr: { id: "data-binding-title", class: "section-title" } },
77
- text("p", "Choose which side owns the value. See model updates, local edits, events, and conversion across controls.", "hero-description")
78
- ], "hero-copy"),
79
- group([
80
- text("span", "INTERACTIVE PREVIEW", "preview-caption"),
81
- field("binding-preview", "Project title", new InputComponent({
82
- id: "binding-preview", value: "Planning that stays in sync", ariaLabel: "Binding preview"
83
- })),
84
- text("span", "Edit any example, then use its action to change the model.", "preview-note")
85
- ], "hero-preview binding-preview")
86
- ], "hero"),
87
- group([
88
- text("span", "Overview", "overview-label"), text("span", "3 binding modes", "overview-stat"),
89
- text("span", "Events and converters", "overview-stat"), text("span", "External model updates", "overview-stat")
90
- ], "overview-bar"),
91
- group([
92
- card("binding-both-card", "01", "Two way with a converter", "The control shows dollars while the model stores cents. Commits and setValue() write; changed model data refreshes the control.", [
93
- field("binding-both", "Budget (dollars)", budgetInput), budgetStatus,
94
- action("Set model to $250.00", () => {
95
- budgetModel.cents = 25000;
96
- budgetStatus.content = "Model value: 25000 cents";
97
- }),
98
- text("pre", 'new NumberComponent({\n bindTo: model, property: "cents", bindMode: "both",\n converter: {\n toUI: cents => cents / 100,\n toData: dollars => Math.round(dollars * 100)\n }\n});', "sample-code")
99
- ]),
100
- card("binding-to-model-card", "02", "Control to model", "The control starts from its explicit value. On mount, that value initializes the model; later commits write back.", [
101
- field("binding-to-model", "Project title", createInput), createStatus,
102
- text("pre", 'new InputComponent({\n value: "Ready for review",\n bindTo: model, property: "title",\n bindMode: "toModel"\n});', "sample-code")
103
- ]),
104
- card("binding-from-model-card", "03", "Model to control", "The model supplies the initial value and wins when it changes. A user change still raises onChange but does not write back.", [
105
- readCheck, readStatus,
106
- group([action("Set model to on", () => {
107
- readModel.subscribed = true;
108
- readStatus.content = "Model value: on. The checkbox updates on render.";
109
- }), action("Set model to off", () => {
110
- readModel.subscribed = false;
111
- readStatus.content = "Model value: off. The checkbox updates on render.";
112
- })], "sample-row"),
113
- text("pre", 'new CheckBoxComponent({\n bindTo: model, property: "subscribed",\n bindMode: "fromModel",\n onChange: value => console.log(value)\n});', "sample-code")
114
- ]),
115
- card("binding-select-card", "04", "The same contract on Select", "Select stores option keys. A control change writes the key; changing the model updates the selected option on render.", [
116
- field("binding-select", "Project", projectSelect), projectStatus,
117
- action("Choose Website refresh in the model", () => {
118
- projectModel.current = "website";
119
- projectStatus.content = "Model value: website";
120
- }),
121
- text("p", "Single selection uses a scalar key; multiple selection uses an array of keys.", "inline-note")
122
- ]),
123
- card("binding-datetime-card", "05", "Date and time share one value", "DateTime binds one Date across both fields. A partial entry stays local; clearing both fields writes null.", [
124
- field("binding-datetime", "Appointment", appointment), appointmentStatus,
125
- action("Move appointment to October 26", () => {
126
- appointmentModel.appointment = new Date(2026, 9, 26, 11, 15);
127
- appointmentStatus.content = appointmentText();
128
- })
129
- ])
130
- ], "sample-grid binding-sample-grid"),
131
- { tag: "details", attr: { class: "usage" }, children: [
132
- text("summary", "Binding modes & compatibility"),
133
- text("p", "toModel uses the control's value or default and never reads the model. An explicit initial value is written once when the control mounts. fromModel reads the model and never writes to it. both reads the model and writes user changes and setValue() back."),
134
- text("p", "In fromModel and both, a local edit remains visible while the model value stays the same. A changed model value is applied on the next render. Updating a plain object does not request a render by itself."),
135
- text("p", "Converters use toUI for model-to-control values and toData for control-to-model values. Input writes on every input event when bindOnInput is true; when omitted, it does so if an onInput handler is registered. See the component guides for control-specific events and validation.")
136
- ] }
137
- ]
138
- };
1
+ import { IJSLComponent, IJSLVNode } from "jsl-render";
2
+ import { ButtonComponent } from "../../components/button/ButtonComponent";
3
+ import { CheckBoxComponent } from "../../components/checkbox/CheckBoxComponent";
4
+ import { DateTimeComponent } from "../../components/date-time/DateTimeComponent";
5
+ import { InputComponent } from "../../components/input/InputComponent";
6
+ import { NumberComponent } from "../../components/number/NumberComponent";
7
+ import { SelectComponent } from "../../components/select/SelectComponent";
8
+ import { date } from "../../core/date";
9
+
10
+ type Content = IJSLVNode | IJSLComponent;
11
+ const text = (tag: string, content: string, className?: string): IJSLVNode => ({ tag, content, attr: { class: className } });
12
+ const group = (children: Content[], className?: string): IJSLVNode => ({ tag: "div", attr: { class: className }, children });
13
+ const status = (content: string): IJSLVNode => ({ tag: "p", content, attr: { class: "sample-status", role: "status" } });
14
+ const action = (content: string, click: () => void) => new ButtonComponent({ content, click, type: "button", outlined: true, size: "small" });
15
+ const field = (id: string, label: string, control: Content) => group([
16
+ { tag: "label", content: label, attr: { for: id } }, control
17
+ ], "binding-field");
18
+ function card(id: string, number: string, title: string, description: string, children: Content[]): IJSLVNode {
19
+ return { tag: "article", attr: { class: "sample-card", id }, children: [
20
+ group([text("span", number, "sample-number"), text("h2", title)], "card-heading"),
21
+ text("p", description, "card-description"), ...children
22
+ ] };
23
+ }
24
+
25
+ const createModel = { title: "Waiting for the first commit" };
26
+ const createStatus = status("Model value: Ready for review");
27
+ const createInput = new InputComponent({
28
+ id: "binding-to-model", value: "Ready for review", bindTo: createModel, property: "title", bindMode: "toModel",
29
+ onChange: () => { createStatus.content = "Model value: " + createModel.title; }
30
+ });
31
+
32
+ const readModel = { subscribed: false };
33
+ const readStatus = status("Model value: off. Toggle the control to see that edits stay local.");
34
+ const readCheck = new CheckBoxComponent({
35
+ id: "binding-from-model", label: "Send weekly updates", bindTo: readModel, property: "subscribed", bindMode: "fromModel",
36
+ onChange: value => { readStatus.content = "Change event: " + (value ? "on" : "off") + "; model is still " + (readModel.subscribed ? "on" : "off") + "."; }
37
+ });
38
+
39
+ const budgetModel = { cents: 12500 };
40
+ const budgetStatus = status("Model value: 12500 cents");
41
+ const budgetInput = new NumberComponent({
42
+ id: "binding-both", bindTo: budgetModel, property: "cents", bindMode: "both", format: "0.00",
43
+ converter: { toUI: cents => cents / 100, toData: amount => amount == null ? null : Math.round(amount * 100) },
44
+ onChange: () => { budgetStatus.content = "Model value: " + budgetModel.cents + " cents"; }
45
+ });
46
+
47
+ const projectOptions = [
48
+ { value: "website", text: "Website refresh" },
49
+ { value: "library", text: "Component library" },
50
+ { value: "research", text: "Customer research" }
51
+ ];
52
+ const projectModel = { current: "library" };
53
+ const projectStatus = status("Model value: library");
54
+ const projectSelect = new SelectComponent({
55
+ id: "binding-select", data: projectOptions, bindTo: projectModel, property: "current", bindMode: "both",
56
+ ariaLabel: "Bound project", placeholder: "Choose a project",
57
+ onChange: value => { projectStatus.content = "Model value: " + (value ?? "empty"); }
58
+ });
59
+
60
+ const appointmentModel = { appointment: new Date(2026, 9, 21, 14, 45) };
61
+ const appointmentText = () => {
62
+ const value = appointmentModel.appointment;
63
+ return value ? "Model value: " + date.format(value) + " at " + date.formatTime(value, "HourMinute") : "Model value: cleared";
64
+ };
65
+ const appointmentStatus = status(appointmentText());
66
+ const appointment = new DateTimeComponent({
67
+ id: "binding-datetime", bindTo: appointmentModel, property: "appointment", bindMode: "both",
68
+ onChange: () => { appointmentStatus.content = appointmentText(); }
69
+ });
70
+
71
+ export const dataBindingShowcase: IJSLVNode = {
72
+ tag: "section", attr: { id: "data-binding", class: "component-section", "aria-labelledby": "data-binding-title" }, children: [
73
+ group([
74
+ group([
75
+ text("p", "THE ESSENTIALS / 24", "eyebrow"),
76
+ { tag: "h2", content: "Data binding", attr: { id: "data-binding-title", class: "section-title" } },
77
+ text("p", "Choose which side owns the value. See model updates, local edits, events, and conversion across controls.", "hero-description")
78
+ ], "hero-copy"),
79
+ group([
80
+ text("span", "INTERACTIVE PREVIEW", "preview-caption"),
81
+ field("binding-preview", "Project title", new InputComponent({
82
+ id: "binding-preview", value: "Planning that stays in sync", ariaLabel: "Binding preview"
83
+ })),
84
+ text("span", "Edit any example, then use its action to change the model.", "preview-note")
85
+ ], "hero-preview binding-preview")
86
+ ], "hero"),
87
+ group([
88
+ text("span", "Overview", "overview-label"), text("span", "3 binding modes", "overview-stat"),
89
+ text("span", "Events and converters", "overview-stat"), text("span", "External model updates", "overview-stat")
90
+ ], "overview-bar"),
91
+ group([
92
+ card("binding-both-card", "01", "Two way with a converter", "The control shows dollars while the model stores cents. Commits and setValue() write; changed model data refreshes the control.", [
93
+ field("binding-both", "Budget (dollars)", budgetInput), budgetStatus,
94
+ action("Set model to $250.00", () => {
95
+ budgetModel.cents = 25000;
96
+ budgetStatus.content = "Model value: 25000 cents";
97
+ }),
98
+ text("pre", 'new NumberComponent({\n bindTo: model, property: "cents", bindMode: "both",\n converter: {\n toUI: cents => cents / 100,\n toData: dollars => Math.round(dollars * 100)\n }\n});', "sample-code")
99
+ ]),
100
+ card("binding-to-model-card", "02", "Control to model", "The control starts from its explicit value. On mount, that value initializes the model; later commits write back.", [
101
+ field("binding-to-model", "Project title", createInput), createStatus,
102
+ text("pre", 'new InputComponent({\n value: "Ready for review",\n bindTo: model, property: "title",\n bindMode: "toModel"\n});', "sample-code")
103
+ ]),
104
+ card("binding-from-model-card", "03", "Model to control", "The model supplies the initial value and wins when it changes. A user change still raises onChange but does not write back.", [
105
+ readCheck, readStatus,
106
+ group([action("Set model to on", () => {
107
+ readModel.subscribed = true;
108
+ readStatus.content = "Model value: on. The checkbox updates on render.";
109
+ }), action("Set model to off", () => {
110
+ readModel.subscribed = false;
111
+ readStatus.content = "Model value: off. The checkbox updates on render.";
112
+ })], "sample-row"),
113
+ text("pre", 'new CheckBoxComponent({\n bindTo: model, property: "subscribed",\n bindMode: "fromModel",\n onChange: value => console.log(value)\n});', "sample-code")
114
+ ]),
115
+ card("binding-select-card", "04", "The same contract on Select", "Select stores option keys. A control change writes the key; changing the model updates the selected option on render.", [
116
+ field("binding-select", "Project", projectSelect), projectStatus,
117
+ action("Choose Website refresh in the model", () => {
118
+ projectModel.current = "website";
119
+ projectStatus.content = "Model value: website";
120
+ }),
121
+ text("p", "Single selection uses a scalar key; multiple selection uses an array of keys.", "inline-note")
122
+ ]),
123
+ card("binding-datetime-card", "05", "Date and time share one value", "DateTime binds one Date across both fields. A partial entry stays local; clearing both fields writes null.", [
124
+ field("binding-datetime", "Appointment", appointment), appointmentStatus,
125
+ action("Move appointment to October 26", () => {
126
+ appointmentModel.appointment = new Date(2026, 9, 26, 11, 15);
127
+ appointmentStatus.content = appointmentText();
128
+ })
129
+ ])
130
+ ], "sample-grid binding-sample-grid"),
131
+ { tag: "details", attr: { class: "usage" }, children: [
132
+ text("summary", "Binding modes & compatibility"),
133
+ text("p", "toModel uses the control's value or default and never reads the model. An explicit initial value is written once when the control mounts. fromModel reads the model and never writes to it. both reads the model and writes user changes and setValue() back."),
134
+ text("p", "In fromModel and both, a local edit remains visible while the model value stays the same. A changed model value is applied on the next render. Updating a plain object does not request a render by itself."),
135
+ text("p", "Converters use toUI for model-to-control values and toData for control-to-model values. Input writes on every input event when bindOnInput is true; when omitted, it does so if an onInput handler is registered. See the component guides for control-specific events and validation.")
136
+ ] }
137
+ ]
138
+ };