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
|
@@ -4,131 +4,63 @@ export class OverlayComponent {
|
|
|
4
4
|
static show(options) {
|
|
5
5
|
const container = document.createElement("div");
|
|
6
6
|
document.body.appendChild(container);
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
JSLRender.lastCreatedRenderer = renderer;
|
|
12
|
-
}
|
|
13
|
-
const o = { ...options };
|
|
14
|
-
o.onClose = () => {
|
|
15
|
-
if (options.onClose) {
|
|
16
|
-
if (options.onClose() === false) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
document.body.removeChild(container);
|
|
21
|
-
JSLRender.lastCreatedRenderer = oldRenderer;
|
|
22
|
-
if (oldRenderer != null) {
|
|
23
|
-
oldRenderer.refresh();
|
|
24
|
-
}
|
|
25
|
-
OverlayComponent.lastRenderedDlg = oldLastDlg;
|
|
26
|
-
};
|
|
27
|
-
const dlg = new OverlayComponent(o);
|
|
28
|
-
OverlayComponent.lastRenderedDlg = dlg;
|
|
29
|
-
renderer.render(dlg);
|
|
30
|
-
return dlg;
|
|
31
|
-
}
|
|
32
|
-
close() {
|
|
33
|
-
if (this.options.onClose) {
|
|
34
|
-
if (this.options.onClose() === false) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
// this.overlay.style.display = "none";
|
|
39
|
-
if (this.onKeydownEvent != null) {
|
|
40
|
-
document.removeEventListener("keydown", this.onKeydownEvent);
|
|
41
|
-
}
|
|
7
|
+
const renderer = new JSLRender(container, false), overlay = new OverlayComponent(options);
|
|
8
|
+
overlay.disposeHost = () => { renderer.render({ tag: "div" }); container.remove(); };
|
|
9
|
+
renderer.render(overlay);
|
|
10
|
+
return overlay;
|
|
42
11
|
}
|
|
43
12
|
constructor(options) {
|
|
44
|
-
this.
|
|
45
|
-
tag: "div", content: "✖" /*"🗙"*/, attr: {
|
|
46
|
-
class: "overl-close-btn", click: () => {
|
|
47
|
-
this.close();
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
};
|
|
13
|
+
this.State = { closed: false };
|
|
51
14
|
this.options = { closeOnEscape: true, closeOnOverlayClick: true, showCloseButton: true, direction: "left", animate: true, ...options };
|
|
52
|
-
if (this.options.closeOnEscape) {
|
|
53
|
-
this.onKeydownEvent = document.addEventListener("keydown", (args) => {
|
|
54
|
-
if (args.keyCode === 27) { // escape
|
|
55
|
-
this.close();
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
15
|
}
|
|
16
|
+
onInit(renderer) { this.renderer = renderer; }
|
|
60
17
|
onCreate(node) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
18
|
+
var _a, _b;
|
|
19
|
+
this.dom = node.dom;
|
|
20
|
+
if (!this.State.closed) {
|
|
21
|
+
this.dom.showModal();
|
|
22
|
+
(_b = (_a = this.options).onOpen) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
onRemove() { var _a; (_a = this.dom) === null || _a === void 0 ? void 0 : _a.close(); this.dom = undefined; }
|
|
26
|
+
close() {
|
|
27
|
+
var _a, _b, _c, _d;
|
|
28
|
+
if (this.State.closed || ((_b = (_a = this.options).onClose) === null || _b === void 0 ? void 0 : _b.call(_a)) === false) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
this.State.closed = true;
|
|
32
|
+
(_c = this.dom) === null || _c === void 0 ? void 0 : _c.close();
|
|
33
|
+
if (this.disposeHost) {
|
|
34
|
+
this.disposeHost();
|
|
79
35
|
}
|
|
80
36
|
else {
|
|
81
|
-
|
|
37
|
+
(_d = this.renderer) === null || _d === void 0 ? void 0 : _d.refresh();
|
|
82
38
|
}
|
|
83
39
|
}
|
|
84
40
|
render() {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
// styleW += "min-width:" + this.options.minWidth + ";";
|
|
93
|
-
// }
|
|
94
|
-
// if (this.options.maxWidth != null) {
|
|
95
|
-
// styleW += "max-width:" + this.options.maxWidth + ";";
|
|
96
|
-
// }
|
|
97
|
-
// if (this.options.height != null) {
|
|
98
|
-
// styleH += "height:" + this.options.height + ";";
|
|
99
|
-
// }
|
|
100
|
-
// if (this.options.minHeight != null) {
|
|
101
|
-
// styleH += "min-height:" + this.options.minHeight + ";";
|
|
102
|
-
// }
|
|
103
|
-
// if (this.options.maxHeight != null) {
|
|
104
|
-
// styleH += "max-height:" + this.options.maxHeight + ";";
|
|
105
|
-
// }
|
|
106
|
-
// const headerStyle = this.options.allowMove ? "cursor:move" : undefined;
|
|
107
|
-
return {
|
|
108
|
-
tag: "div", attr: {
|
|
109
|
-
class: "jsl-overlay-overlay", click: (e) => {
|
|
110
|
-
if (this.options.closeOnOverlayClick && e.target.classList.contains("jsl-overlay-overlay")) {
|
|
41
|
+
var _a, _b, _c, _d, _e;
|
|
42
|
+
return { tag: "dialog", attr: { class: "jsl-overlay-overlay", hidden: this.State.closed ? "hidden" : undefined,
|
|
43
|
+
"aria-label": (_a = this.options.ariaLabel) !== null && _a !== void 0 ? _a : "Panel",
|
|
44
|
+
keydown: (e) => { if (e.key === "Escape") {
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
e.stopPropagation();
|
|
47
|
+
if (this.options.closeOnEscape) {
|
|
111
48
|
this.close();
|
|
112
49
|
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
toNode(content) {
|
|
129
|
-
if (typeof content === "string") {
|
|
130
|
-
return { tag: "div", content };
|
|
131
|
-
}
|
|
132
|
-
return content;
|
|
50
|
+
} return false; },
|
|
51
|
+
cancel: (e) => { e.preventDefault(); if (this.options.closeOnEscape) {
|
|
52
|
+
this.close();
|
|
53
|
+
} return false; },
|
|
54
|
+
click: (e) => { if (e.target === e.currentTarget && this.options.closeOnOverlayClick) {
|
|
55
|
+
const r = this.dom.getBoundingClientRect();
|
|
56
|
+
if (e.clientX < r.left || e.clientX > r.right || e.clientY < r.top || e.clientY > r.bottom) {
|
|
57
|
+
this.close();
|
|
58
|
+
}
|
|
59
|
+
} return false; }
|
|
60
|
+
}, children: [{ tag: "div", attr: { class: "overl-body overl-body-" + this.options.direction + (this.options.animate ? " overl-animate" : "") + " " + ((_b = this.options.class) !== null && _b !== void 0 ? _b : ""),
|
|
61
|
+
style: "--jsl-overlay-size:" + ((_c = this.options.size) !== null && _c !== void 0 ? _c : "28rem") + ";" + ((_d = this.options.style) !== null && _d !== void 0 ? _d : "") }, children: [
|
|
62
|
+
{ tag: "div", attr: { class: "overl-header" }, children: this.options.showCloseButton ? [{ tag: "button", content: "×", attr: { type: "button", class: "overl-close-btn", "aria-label": (_e = this.options.closeButtonLabel) !== null && _e !== void 0 ? _e : "Close panel", click: () => { this.close(); return false; } } }] : [] },
|
|
63
|
+
{ tag: "div", attr: { class: "overl-content" }, children: [typeof this.options.content === "string" ? { tag: "div", content: this.options.content } : this.options.content] }
|
|
64
|
+
] }] };
|
|
133
65
|
}
|
|
134
66
|
}
|
|
@@ -1,57 +1,18 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.overl-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.overl-
|
|
19
|
-
position: absolute;
|
|
20
|
-
overflow: auto;
|
|
21
|
-
background: rgb(255, 255, 255);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.overl-body-left {
|
|
25
|
-
left:0;
|
|
26
|
-
top:0;
|
|
27
|
-
bottom:0;
|
|
28
|
-
min-width: 50%;
|
|
29
|
-
box-shadow: 5px 0px 6px 0px rgba(34, 34, 34, 0.2);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.overl-body-top {
|
|
33
|
-
left:0;
|
|
34
|
-
top:0;
|
|
35
|
-
right:0;
|
|
36
|
-
min-height: 50%;
|
|
37
|
-
box-shadow: 0px 5px 4px 0px rgba(34,34,34,0.2);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
.overl-close-btn {
|
|
42
|
-
color: #555555;
|
|
43
|
-
font-size: 2rem;
|
|
44
|
-
line-height: 2.2rem;
|
|
45
|
-
font-weight: bold;
|
|
46
|
-
position: absolute;
|
|
47
|
-
right: 0;
|
|
48
|
-
top: 0;
|
|
49
|
-
width: 2.2rem;
|
|
50
|
-
box-sizing: border-box;
|
|
51
|
-
border-top-right-radius: 0.8rem;
|
|
52
|
-
cursor: pointer;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.overl-close-btn:hover {
|
|
56
|
-
color: #B22121;
|
|
57
|
-
}
|
|
1
|
+
@import "../../ui/theme.css";
|
|
2
|
+
.jsl-overlay-overlay { position: fixed; inset: 0; margin: 0; padding: 0; border: 0; background: transparent; color: var(--jsl-color-text); max-width: 100vw; max-height: 100dvh; overflow: visible; width: fit-content; height: fit-content; font: inherit; }
|
|
3
|
+
.jsl-overlay-overlay:has(.overl-body-top) { width: 100%; }
|
|
4
|
+
.jsl-overlay-overlay::backdrop { background: var(--jsl-color-overlay); }
|
|
5
|
+
.jsl-overlay-overlay[hidden] { display: none; }
|
|
6
|
+
.overl-body { box-sizing: border-box; display: flex; flex-direction: column; overflow: auto; background: var(--jsl-color-surface); box-shadow: var(--jsl-shadow-dialog); }
|
|
7
|
+
.overl-body-left { width: var(--jsl-overlay-size); max-width: 100vw; height: 100dvh; border-radius: 0 .75rem .75rem 0; }
|
|
8
|
+
.overl-body-top { height: var(--jsl-overlay-size); max-height: 100dvh; width: 100vw; border-radius: 0 0 .75rem .75rem; }
|
|
9
|
+
.overl-header { display: flex; justify-content: flex-end; padding: .75rem .75rem 0; }
|
|
10
|
+
.overl-content { padding: 1.25rem; overflow: auto; }
|
|
11
|
+
.overl-close-btn { display: grid; place-items: center; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: .375rem; background: transparent; color: var(--jsl-color-text-muted); font: inherit; font-size: 1.5rem; cursor: pointer; }
|
|
12
|
+
.overl-close-btn:hover { background: var(--jsl-color-surface-hover); color: var(--jsl-color-text); }
|
|
13
|
+
.overl-close-btn:focus-visible { outline: 2px solid var(--jsl-color-focus); outline-offset: 2px; }
|
|
14
|
+
.overl-body-left.overl-animate { animation: jsl-panel-left .18s ease-out; }
|
|
15
|
+
.overl-body-top.overl-animate { animation: jsl-panel-top .18s ease-out; }
|
|
16
|
+
@keyframes jsl-panel-left { from { transform: translateX(-100%); } }
|
|
17
|
+
@keyframes jsl-panel-top { from { transform: translateY(-100%); } }
|
|
18
|
+
@media (prefers-reduced-motion: reduce) { .overl-animate { animation: none !important; } }
|
|
@@ -9,8 +9,9 @@ export class ProgressComponent {
|
|
|
9
9
|
return this.__proto__ === node.__proto__;
|
|
10
10
|
}
|
|
11
11
|
render() {
|
|
12
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
13
|
-
|
|
12
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
13
|
+
const value = Number.isFinite(this.progress) ? Math.max(0, Math.min(100, this.progress)) : 0;
|
|
14
|
+
let style = "width: " + value + "%";
|
|
14
15
|
if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.color) {
|
|
15
16
|
style += ";background:" + this.options.color;
|
|
16
17
|
}
|
|
@@ -19,16 +20,15 @@ export class ProgressComponent {
|
|
|
19
20
|
}
|
|
20
21
|
let content = "";
|
|
21
22
|
if ((_c = this.options) === null || _c === void 0 ? void 0 : _c.showPercent) {
|
|
22
|
-
content = numeric.format(
|
|
23
|
+
content = numeric.format(value, (_e = (_d = this.options) === null || _d === void 0 ? void 0 : _d.percentFormat) !== null && _e !== void 0 ? _e : "0. %");
|
|
23
24
|
}
|
|
24
25
|
return {
|
|
25
26
|
tag: "div",
|
|
26
|
-
attr: { class: "progress-comp " + ((
|
|
27
|
+
attr: { class: "progress-comp " + (((_f = this.options) === null || _f === void 0 ? void 0 : _f.showPercent) ? "has-label " : "") + ((_h = (_g = this.options) === null || _g === void 0 ? void 0 : _g.class) !== null && _h !== void 0 ? _h : ""), role: "progressbar", "aria-label": (_k = (_j = this.options) === null || _j === void 0 ? void 0 : _j.ariaLabel) !== null && _k !== void 0 ? _k : "Progress", "aria-valuemin": "0", "aria-valuemax": "100", "aria-valuenow": String(value) },
|
|
27
28
|
children: [{
|
|
28
29
|
tag: "div",
|
|
29
30
|
attr: { class: "bar", style },
|
|
30
|
-
|
|
31
|
-
}]
|
|
31
|
+
}, ...(((_l = this.options) === null || _l === void 0 ? void 0 : _l.showPercent) ? [{ tag: "span", attr: { class: "progress-label", "aria-hidden": "true" }, content }] : [])]
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
setProgress(progress) {
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
border-radius: 2px;
|
|
7
|
-
|
|
8
|
-
.bar {
|
|
9
|
-
background: #3B99FF;
|
|
10
|
-
height: 100%;
|
|
11
|
-
text-align: center;
|
|
12
|
-
border-radius: 2px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
}
|
|
1
|
+
@import "../../ui/theme.css";
|
|
2
|
+
.progress-comp { position: relative; background: var(--jsl-color-border-subtle); height: .5rem; border-radius: 999px; overflow: hidden; }
|
|
3
|
+
.progress-comp.has-label { height: 1.25rem; }
|
|
4
|
+
.progress-comp .bar { background: var(--jsl-color-accent); height: 100%; border-radius: inherit; }
|
|
5
|
+
.progress-comp .progress-label { position: absolute; inset: 0; display: grid; place-items: center; color: var(--jsl-color-text); font: 600 .75rem/1.25rem sans-serif; text-shadow: 0 0 3px var(--jsl-color-surface); }
|
|
@@ -14,8 +14,8 @@ export class RibbonMenuComponent {
|
|
|
14
14
|
children: this.groups.map((g) => {
|
|
15
15
|
var _a;
|
|
16
16
|
return {
|
|
17
|
-
tag: "div", attr: { class: "ribbon-group" },
|
|
18
|
-
children: [{ tag: "div", attr: { class: "ribbon-legend" }, content: (_a = g.title) !== null && _a !== void 0 ? _a : "" }
|
|
17
|
+
tag: "div", attr: { class: "ribbon-group", role: "group", "aria-label": g.title },
|
|
18
|
+
children: [{ tag: "div", attr: { class: "ribbon-actions" }, children: g.children }, { tag: "div", attr: { class: "ribbon-legend", hidden: g.title ? undefined : "hidden" }, content: (_a = g.title) !== null && _a !== void 0 ? _a : "" }]
|
|
19
19
|
};
|
|
20
20
|
})
|
|
21
21
|
};
|
|
@@ -1,76 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
.ribbon-menu-comp {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
padding: 0.3rem;
|
|
8
|
-
border-bottom: 1px solid #c9c9c9;
|
|
9
|
-
border-top: 1px solid #c9c9c9;
|
|
10
|
-
flex-shrink: 0;
|
|
11
|
-
background: linear-gradient(90deg,
|
|
12
|
-
rgb(255,255,255) 0%,
|
|
13
|
-
rgb(246,246,246) 20%,
|
|
14
|
-
rgb(246,246,246) 80%,
|
|
15
|
-
rgb(255,255,255) 100%);
|
|
16
|
-
|
|
17
|
-
.ribbon-group {
|
|
18
|
-
position: relative;
|
|
19
|
-
box-sizing: border-box;
|
|
20
|
-
border-right: 1px solid #c9c9c9;
|
|
21
|
-
display: inline-block;
|
|
22
|
-
height: 100%;
|
|
23
|
-
padding: 0 0.6rem 0 0.6rem;
|
|
24
|
-
vertical-align: middle;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.jsl-button {
|
|
28
|
-
margin: 0.1rem;
|
|
29
|
-
// box-sizing: border-box;
|
|
30
|
-
// padding: 0.25rem;
|
|
31
|
-
padding-left: 0.25rem;
|
|
32
|
-
padding-right: 0.25rem;
|
|
33
|
-
// background: #ebebf0;
|
|
34
|
-
// border: 1px solid #ebebf0;
|
|
35
|
-
// border-radius: 2px;
|
|
36
|
-
display: inline-block;
|
|
37
|
-
// cursor: pointer;
|
|
38
|
-
// color:black;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// .jsl-button:hover {
|
|
42
|
-
// border-color: #aaaaaa;
|
|
43
|
-
// background: #aaaaaa;
|
|
44
|
-
// }
|
|
45
|
-
|
|
46
|
-
// .jsl-button-disabled {
|
|
47
|
-
// background: #ebebf0!important;
|
|
48
|
-
// border-color: #ebebf0!important;
|
|
49
|
-
// color:#aaaaaa;
|
|
50
|
-
// cursor: default;
|
|
51
|
-
// }
|
|
52
|
-
|
|
53
|
-
// .jsl-button.ui-state-active {
|
|
54
|
-
// background: #017DBE;
|
|
55
|
-
// border-color: #017DBE;
|
|
56
|
-
// color: white;
|
|
57
|
-
// }
|
|
58
|
-
|
|
59
|
-
// .jsl-button:focus {
|
|
60
|
-
// border-color: #999999;
|
|
61
|
-
// }
|
|
62
|
-
|
|
63
|
-
.ribbon-group > .jsl-button > img {
|
|
64
|
-
height: 1rem;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.ribbon-legend {
|
|
68
|
-
position: absolute;
|
|
69
|
-
bottom: 0;
|
|
70
|
-
left: 1px;
|
|
71
|
-
right: 1px;
|
|
72
|
-
text-align: center;
|
|
73
|
-
font-size: 0.8em;
|
|
74
|
-
color: #444444;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
1
|
+
@import "../../ui/theme.css";
|
|
2
|
+
.ribbon-menu-comp { display: flex; flex-wrap: wrap; align-items: stretch; gap: .75rem; margin: 0; padding: .75rem; background: var(--jsl-color-surface-subtle); color: var(--jsl-color-text); border: 1px solid var(--jsl-color-border-subtle); border-radius: 0; box-sizing: border-box; }
|
|
3
|
+
.ribbon-menu-comp .ribbon-group { display: flex; flex-direction: column; gap: .5rem; padding-inline-end: .75rem; border-inline-end: 1px solid var(--jsl-color-border-subtle); min-width: 0; }
|
|
4
|
+
.ribbon-menu-comp .ribbon-group:last-child { border-inline-end: 0; padding-inline-end: 0; }
|
|
5
|
+
.ribbon-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .375rem; flex: 1; }
|
|
6
|
+
.ribbon-menu-comp .ribbon-legend { font-size: .6875rem; color: var(--jsl-color-text-muted); text-align: center; }
|
|
@@ -15,9 +15,17 @@ export interface ISelectRenderGroupArg {
|
|
|
15
15
|
}
|
|
16
16
|
export interface ISelectComponentOptions<T = any, TValue = any, TBinding = any> {
|
|
17
17
|
data: T[];
|
|
18
|
+
id?: string;
|
|
18
19
|
style?: string;
|
|
19
20
|
class?: string;
|
|
21
|
+
/** Kept for compatibility. Prefer placeholder in new code. */
|
|
20
22
|
placehoder?: string;
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
ariaLabel?: string;
|
|
25
|
+
ariaLabelledBy?: string;
|
|
26
|
+
searchPlaceholder?: string;
|
|
27
|
+
emptyText?: string;
|
|
28
|
+
clearButtonLabel?: string;
|
|
21
29
|
rowHeight?: number;
|
|
22
30
|
textColumn?: string;
|
|
23
31
|
keyColumn?: string;
|
|
@@ -48,32 +56,54 @@ export interface ISelectComponentOptions<T = any, TValue = any, TBinding = any>
|
|
|
48
56
|
autoShrink?: boolean;
|
|
49
57
|
}
|
|
50
58
|
export declare class SelectComponent<T = any, TValue = any, TBinding = any> implements IJSLComponent {
|
|
51
|
-
private static ENTER_KEY;
|
|
52
59
|
private expanded;
|
|
53
|
-
private
|
|
60
|
+
private suppressOpenOnFocus;
|
|
54
61
|
private options;
|
|
55
62
|
private dropdownArea;
|
|
56
63
|
private dom;
|
|
57
64
|
private renderer;
|
|
65
|
+
private dropdownRenderer;
|
|
66
|
+
private dropdownComponent;
|
|
58
67
|
private focused;
|
|
59
68
|
private selected;
|
|
69
|
+
private listId;
|
|
70
|
+
private focusFrame;
|
|
71
|
+
private dropdownLimit;
|
|
72
|
+
private disposed;
|
|
73
|
+
private expandedBeforePress;
|
|
60
74
|
constructor(o: ISelectComponentOptions<T, TValue, TBinding>);
|
|
61
75
|
render(): IJSLVNode;
|
|
62
76
|
onCreate(node: IJSLVNode): void;
|
|
63
77
|
onUpdate(node: IJSLVNode): void;
|
|
64
78
|
onInit(renderer: JSLRender): void;
|
|
79
|
+
onRemove(): void;
|
|
65
80
|
toggle(): void;
|
|
66
81
|
isExpanded(): boolean;
|
|
82
|
+
getListId(): string;
|
|
67
83
|
show(searchTxt?: string): void;
|
|
84
|
+
/** Removes only this select's popup and listeners. The select remains reusable. */
|
|
68
85
|
destroy(): void;
|
|
69
|
-
close(): void;
|
|
86
|
+
close(restoreFocus?: boolean): void;
|
|
70
87
|
setFocus(item: T): void;
|
|
71
88
|
getFocus(): T;
|
|
72
89
|
getValue(): any;
|
|
90
|
+
/** Changes selection and the bound model without raising onChange. */
|
|
73
91
|
setValue(value: any): void;
|
|
74
92
|
getSelected(): T | T[];
|
|
75
93
|
setSelected(item: T | T[]): void;
|
|
76
94
|
focus(): void;
|
|
77
95
|
hasSelection(): boolean;
|
|
78
96
|
protected renderSelection(): IJSLVNode;
|
|
97
|
+
private hasBinding;
|
|
98
|
+
private readModel;
|
|
99
|
+
private writeModel;
|
|
100
|
+
private selectValue;
|
|
101
|
+
private refresh;
|
|
102
|
+
private focusWithoutOpening;
|
|
103
|
+
private onTriggerKeydown;
|
|
104
|
+
private updateTriggerAria;
|
|
105
|
+
private onOutsidePress;
|
|
106
|
+
private onDocumentFocus;
|
|
107
|
+
private onWindowScroll;
|
|
108
|
+
private positionDropdown;
|
|
79
109
|
}
|