jsl-ui 9.18.3 → 9.18.4
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/lib/components/IntervalComponent.d.ts +17 -0
- package/lib/components/IntervalComponent.js +68 -0
- package/lib/components/auto-suggest/AutoSuggestComponent.d.ts +22 -0
- package/lib/components/auto-suggest/AutoSuggestComponent.js +49 -0
- package/lib/components/button/ButtonComponent.d.ts +18 -0
- package/lib/components/button/ButtonComponent.js +46 -0
- package/lib/components/checkbox/CheckBoxComponent.d.ts +28 -0
- package/lib/components/checkbox/CheckBoxComponent.js +94 -0
- package/lib/components/checkbox/CheckBoxStyle.scss +86 -0
- package/lib/components/date/DateComponent.d.ts +32 -0
- package/lib/components/date/DateComponent.js +106 -0
- package/lib/components/date-range/DateRangeComponent.d.ts +35 -0
- package/lib/components/date-range/DateRangeComponent.js +136 -0
- package/lib/components/date-range/DateRangeStyle.scss +12 -0
- package/lib/components/date-time/DateTimeComponent.d.ts +15 -0
- package/lib/components/date-time/DateTimeComponent.js +53 -0
- package/lib/components/date-time/DateTimeStyle.scss +7 -0
- package/lib/components/dialog/DialogComponent.d.ts +67 -0
- package/lib/components/dialog/DialogComponent.js +242 -0
- package/lib/components/drop-down/DropDownComponent.d.ts +27 -0
- package/lib/components/drop-down/DropDownComponent.js +74 -0
- package/lib/components/expander/ExpanderComponent.d.ts +27 -0
- package/lib/components/expander/ExpanderComponent.js +90 -0
- package/lib/components/expander/ExpanderStyle.scss +47 -0
- package/lib/components/expander/OldExpanderStyle.scss +37 -0
- package/lib/components/form-field/FormComponent.d.ts +12 -0
- package/lib/components/form-field/FormComponent.js +26 -0
- package/lib/components/form-field/FormFieldComponent.d.ts +38 -0
- package/lib/components/form-field/FormFieldComponent.js +139 -0
- package/lib/components/form-field/FormFieldStyle.scss +87 -0
- package/lib/components/grid/GridComponent.d.ts +26 -0
- package/lib/components/grid/GridComponent.js +116 -0
- package/lib/components/input/InputComponent.d.ts +33 -0
- package/lib/components/input/InputComponent.js +144 -0
- package/lib/components/loading/LoadingComponent.d.ts +8 -0
- package/lib/components/loading/LoadingComponent.js +22 -0
- package/lib/components/loading/LoadingStyle.css +29 -0
- package/lib/components/navigation/NavigationComponent.d.ts +34 -0
- package/lib/components/navigation/NavigationComponent.js +70 -0
- package/lib/components/navigation/NavigationStyle.scss +226 -0
- package/lib/components/notification/Notification.d.ts +17 -0
- package/lib/components/notification/Notification.js +56 -0
- package/lib/components/notification/Notification.scss +19 -0
- package/lib/components/number/NumberComponent.d.ts +25 -0
- package/lib/components/number/NumberComponent.js +87 -0
- package/lib/components/overlay/OverlayComponent.d.ts +27 -0
- package/lib/components/overlay/OverlayComponent.js +149 -0
- package/lib/components/overlay/overlay.css +57 -0
- package/lib/components/progress/ProgressComponent.d.ts +18 -0
- package/lib/components/progress/ProgressComponent.js +42 -0
- package/lib/components/progress/ProgressStyle.scss +15 -0
- package/lib/components/ribbon-menu/RibbonMenuComponent.d.ts +12 -0
- package/lib/components/ribbon-menu/RibbonMenuComponent.js +34 -0
- package/lib/components/ribbon-menu/RibbonMenuStyle.scss +76 -0
- package/lib/components/select/SelectComponent.d.ts +79 -0
- package/lib/components/select/SelectComponent.js +362 -0
- package/lib/components/select/SelectDDAreaComponent.d.ts +32 -0
- package/lib/components/select/SelectDDAreaComponent.js +317 -0
- package/lib/components/select/SelectStyle.scss +187 -0
- package/lib/components/slider/nouislider.css +310 -0
- package/lib/components/slider/nouislider.d.ts +44 -0
- package/lib/components/slider/nouislider.js +2158 -0
- package/lib/components/stack-panel/SplitterComponent.d.ts +21 -0
- package/lib/components/stack-panel/SplitterComponent.js +126 -0
- package/lib/components/stack-panel/SplitterStyle.scss +45 -0
- package/lib/components/stack-panel/StackPanelComponent.d.ts +20 -0
- package/lib/components/stack-panel/StackPanelComponent.js +64 -0
- package/lib/components/stack-panel/StackPanelStyle.scss +53 -0
- package/lib/components/tabs/TabsComponent.d.ts +39 -0
- package/lib/components/tabs/TabsComponent.js +177 -0
- package/lib/components/tabs/TabsStyle.scss +76 -0
- package/lib/components/time/TimeComponent.d.ts +29 -0
- package/lib/components/time/TimeComponent.js +113 -0
- package/lib/components/time/TimeComponent.scss +4 -0
- package/lib/components/tree-view/TreeViewComponent.d.ts +23 -0
- package/lib/components/tree-view/TreeViewComponent.js +45 -0
- package/lib/components/tree-view/TreeViewStyle.scss +96 -0
- package/lib/components/virtual-render/VirtualRenderComponent.d.ts +30 -0
- package/lib/components/virtual-render/VirtualRenderComponent.js +104 -0
- package/lib/components/virtual-render/VirtualRenderStyle.scss +9 -0
- package/lib/core/culture.d.ts +5 -0
- package/lib/core/culture.js +385 -0
- package/lib/core/date.d.ts +14 -0
- package/lib/core/date.js +350 -0
- package/lib/core/helper.d.ts +12 -0
- package/lib/core/helper.js +101 -0
- package/lib/core/jq.d.ts +37 -0
- package/lib/core/jq.js +371 -0
- package/lib/core/lang.d.ts +24 -0
- package/lib/core/lang.js +28 -0
- package/lib/core/numeric.d.ts +7 -0
- package/lib/core/numeric.js +143 -0
- package/lib/core/polyfills.d.ts +0 -0
- package/lib/core/polyfills.js +22 -0
- package/lib/core.d.ts +6 -0
- package/lib/core.js +6 -0
- package/lib/grid/controls/slick.columnpicker.css +46 -0
- package/lib/grid/controls/slick.draggablegrouping.css +52 -0
- package/lib/grid/controls/slick.gridmenu.css +127 -0
- package/lib/grid/controls/slick.pager.css +41 -0
- package/lib/grid/examples/examples.css +203 -0
- package/lib/grid/filterDialogs/dateRangeFilter.d.ts +7 -0
- package/lib/grid/filterDialogs/dateRangeFilter.js +156 -0
- package/lib/grid/filterDialogs/excelFilter.d.ts +9 -0
- package/lib/grid/filterDialogs/excelFilter.js +313 -0
- package/lib/grid/plugins/ext.overlay.css +28 -0
- package/lib/grid/plugins/ext.overlay.d.ts +2 -0
- package/lib/grid/plugins/ext.overlay.js +291 -0
- package/lib/grid/plugins/slick.cellrangedecorator.d.ts +12 -0
- package/lib/grid/plugins/slick.cellrangedecorator.js +68 -0
- package/lib/grid/plugins/slick.cellrangeselector.d.ts +1 -0
- package/lib/grid/plugins/slick.cellrangeselector.js +144 -0
- package/lib/grid/plugins/slick.cellselectionmodel.d.ts +1 -0
- package/lib/grid/plugins/slick.cellselectionmodel.js +194 -0
- package/lib/grid/plugins/slick.headerbuttons.css +40 -0
- package/lib/grid/plugins/slick.headerbuttons.d.ts +55 -0
- package/lib/grid/plugins/slick.headerbuttons.js +156 -0
- package/lib/grid/plugins/slick.headermenu.css +101 -0
- package/lib/grid/plugins/slick.headermenu.d.ts +74 -0
- package/lib/grid/plugins/slick.headermenu.js +260 -0
- package/lib/grid/plugins/slick.rowdetailview.css +37 -0
- package/lib/grid/plugins/slick.rowmovemanager.css +8 -0
- package/lib/grid/plugins/slick.rowmovemanager.d.ts +18 -0
- package/lib/grid/plugins/slick.rowmovemanager.js +249 -0
- package/lib/grid/plugins/slick.rowselectionmodel.d.ts +1 -0
- package/lib/grid/plugins/slick.rowselectionmodel.js +167 -0
- package/lib/grid/slick-default-theme.css +154 -0
- package/lib/grid/slick.core.d.ts +90 -0
- package/lib/grid/slick.core.js +574 -0
- package/lib/grid/slick.creator.d.ts +80 -0
- package/lib/grid/slick.creator.js +723 -0
- package/lib/grid/slick.dataview.d.ts +71 -0
- package/lib/grid/slick.dataview.js +1080 -0
- package/lib/grid/slick.editors.core.d.ts +4 -0
- package/lib/grid/slick.editors.core.js +232 -0
- package/lib/grid/slick.editors.date.d.ts +2 -0
- package/lib/grid/slick.editors.date.js +125 -0
- package/lib/grid/slick.editors.lookup.d.ts +14 -0
- package/lib/grid/slick.editors.lookup.js +353 -0
- package/lib/grid/slick.editors.nav.d.ts +6 -0
- package/lib/grid/slick.editors.nav.js +22 -0
- package/lib/grid/slick.formatters.d.ts +17 -0
- package/lib/grid/slick.formatters.js +137 -0
- package/lib/grid/slick.grid.css +325 -0
- package/lib/grid/slick.grid.d.ts +284 -0
- package/lib/grid/slick.grid.js +5395 -0
- package/lib/grid/slick.groupitemmetadataprovider.d.ts +39 -0
- package/lib/grid/slick.groupitemmetadataprovider.js +165 -0
- package/lib/grid/slick.tree.css +20 -0
- package/lib/grid/slick.tree.d.ts +33 -0
- package/lib/grid/slick.tree.js +220 -0
- package/lib/grid.d.ts +13 -0
- package/lib/grid.js +13 -0
- package/lib/index.css +2576 -0
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +56 -0
- package/lib/index.js +61 -10198
- package/lib/index.js.map +1 -1
- package/lib/interaction/dataconverter.d.ts +4 -0
- package/lib/interaction/dataconverter.js +1 -0
- package/lib/interaction/eventhandler.d.ts +13 -0
- package/lib/interaction/eventhandler.js +42 -0
- package/lib/interaction/moveable.css +0 -0
- package/lib/interaction/moveable.d.ts +39 -0
- package/lib/interaction/moveable.js +172 -0
- package/lib/interaction/resizable.css +33 -0
- package/lib/interaction/resizable.d.ts +37 -0
- package/lib/interaction/resizable.js +123 -0
- package/lib/ui/auto.suggest.css +14 -0
- package/lib/ui/auto.suggest.d.ts +17 -0
- package/lib/ui/auto.suggest.js +255 -0
- package/lib/ui/base.css +150 -0
- package/lib/ui/date.picker/css/date-range-picker.css +87 -0
- package/lib/ui/date.picker/css/tiny-date-picker.css +326 -0
- package/lib/ui/date.picker/date-picker-options.d.ts +11 -0
- package/lib/ui/date.picker/date-picker-options.js +76 -0
- package/lib/ui/date.picker/lib/date-manip.d.ts +74 -0
- package/lib/ui/date.picker/lib/date-manip.js +120 -0
- package/lib/ui/date.picker/lib/dom.d.ts +23 -0
- package/lib/ui/date.picker/lib/dom.js +28 -0
- package/lib/ui/date.picker/lib/emitter.d.ts +13 -0
- package/lib/ui/date.picker/lib/emitter.js +49 -0
- package/lib/ui/date.picker/lib/fns.d.ts +23 -0
- package/lib/ui/date.picker/lib/fns.js +43 -0
- package/lib/ui/date.picker/mode/base-mode.d.ts +26 -0
- package/lib/ui/date.picker/mode/base-mode.js +248 -0
- package/lib/ui/date.picker/mode/dropdown-mode.d.ts +28 -0
- package/lib/ui/date.picker/mode/dropdown-mode.js +50 -0
- package/lib/ui/date.picker/mode/index.d.ts +28 -0
- package/lib/ui/date.picker/mode/index.js +18 -0
- package/lib/ui/date.picker/mode/modal-mode.d.ts +25 -0
- package/lib/ui/date.picker/mode/modal-mode.js +17 -0
- package/lib/ui/date.picker/mode/permanent-mode.d.ts +29 -0
- package/lib/ui/date.picker/mode/permanent-mode.js +19 -0
- package/lib/ui/date.picker/views/day-picker.d.ts +40 -0
- package/lib/ui/date.picker/views/day-picker.js +155 -0
- package/lib/ui/date.picker/views/month-picker.d.ts +26 -0
- package/lib/ui/date.picker/views/month-picker.js +65 -0
- package/lib/ui/date.picker/views/year-picker.d.ts +20 -0
- package/lib/ui/date.picker/views/year-picker.js +66 -0
- package/lib/ui/date.picker.d.ts +66 -0
- package/lib/ui/date.picker.js +32 -0
- package/lib/ui/dialog.css +109 -0
- package/lib/ui/dialog.d.ts +22 -0
- package/lib/ui/dialog.js +113 -0
- package/lib/ui/drop.down.css +472 -0
- package/lib/ui/drop.down.d.ts +52 -0
- package/lib/ui/drop.down.js +2112 -0
- package/lib/ui/number.input.css +3 -0
- package/lib/ui/number.input.d.ts +12 -0
- package/lib/ui/number.input.js +64 -0
- package/lib/ui/tabs.css +53 -0
- package/package.json +1 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { NumberInput } from "../../ui/number.input";
|
|
13
|
+
import { numeric } from "../../core/numeric";
|
|
14
|
+
import { helper } from "../../core/helper";
|
|
15
|
+
import { EventHandler } from "../../interaction/eventhandler";
|
|
16
|
+
var NumberComponent = /** @class */ (function () {
|
|
17
|
+
function NumberComponent(options) {
|
|
18
|
+
var _a;
|
|
19
|
+
this.options = __assign({ onChange: new EventHandler(), bindMode: "toModel" }, options);
|
|
20
|
+
if (this.options.bindTo != null && this.options.property != null && this.options.value == null) {
|
|
21
|
+
this.options.value = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
|
|
22
|
+
this.options.converter.toUI(this.options.bindTo[this.options.property]) :
|
|
23
|
+
this.options.bindTo[this.options.property]);
|
|
24
|
+
}
|
|
25
|
+
this.options.onChange = EventHandler.Create(this.options.onChange);
|
|
26
|
+
this.id = options.id || helper.newDomGuid();
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(NumberComponent.prototype, "onChange", {
|
|
29
|
+
get: function () {
|
|
30
|
+
return this.options.onChange;
|
|
31
|
+
},
|
|
32
|
+
enumerable: false,
|
|
33
|
+
configurable: true
|
|
34
|
+
});
|
|
35
|
+
NumberComponent.prototype.render = function () {
|
|
36
|
+
var _a;
|
|
37
|
+
var val = this.options.value;
|
|
38
|
+
if (this.options.bindMode !== "toModel" && this.options.bindTo != null && this.options.property != null) {
|
|
39
|
+
var current = this.getValue();
|
|
40
|
+
var newVal = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
|
|
41
|
+
this.options.converter.toUI(this.options.bindTo[this.options.property]) :
|
|
42
|
+
this.options.bindTo[this.options.property]);
|
|
43
|
+
var newValStr = numeric.format(newVal, this.options.format);
|
|
44
|
+
if (newValStr !== current) {
|
|
45
|
+
val = newVal;
|
|
46
|
+
if (this.currentDom != null) {
|
|
47
|
+
this.currentDom.value = newValStr;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
tag: "input",
|
|
53
|
+
attr: {
|
|
54
|
+
id: this.id,
|
|
55
|
+
class: this.options.class,
|
|
56
|
+
style: this.options.style,
|
|
57
|
+
value: numeric.format(val, this.options.format),
|
|
58
|
+
placeholder: this.options.placeholder
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
NumberComponent.prototype.getValue = function () {
|
|
63
|
+
if (this.currentDom == null) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
return this.currentDom.value;
|
|
67
|
+
};
|
|
68
|
+
NumberComponent.prototype.getValueAsNumber = function () {
|
|
69
|
+
return numeric.parse(this.getValue());
|
|
70
|
+
};
|
|
71
|
+
NumberComponent.prototype.onCreate = function (node) {
|
|
72
|
+
var _this = this;
|
|
73
|
+
this.currentDom = node.dom;
|
|
74
|
+
var handler = new EventHandler(function (value) {
|
|
75
|
+
var _a;
|
|
76
|
+
if (_this.options.bindTo != null && _this.options.bindMode !== "fromModel" && _this.options.property != null) {
|
|
77
|
+
if (_this.options.bindTo && _this.options.property) {
|
|
78
|
+
_this.options.bindTo[_this.options.property] = ((_a = _this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? _this.options.converter.toData(value) : value;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
_this.options.onChange.notify(value);
|
|
82
|
+
});
|
|
83
|
+
NumberInput(this.currentDom, __assign(__assign({}, this.options), { onChange: handler }));
|
|
84
|
+
};
|
|
85
|
+
return NumberComponent;
|
|
86
|
+
}());
|
|
87
|
+
export { NumberComponent };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import "./overlay.css";
|
|
2
|
+
import { IJSLComponent, IJSLVNode } from "jsl-render";
|
|
3
|
+
export interface IOverlayComponentOptions {
|
|
4
|
+
content: IJSLVNode | string | IJSLComponent;
|
|
5
|
+
showCloseButton?: boolean;
|
|
6
|
+
closeOnEscape?: boolean;
|
|
7
|
+
closeOnOverlayClick?: boolean;
|
|
8
|
+
onClose?: () => void | boolean;
|
|
9
|
+
onOpen?: () => void;
|
|
10
|
+
animate?: boolean;
|
|
11
|
+
direction?: "left" | "top";
|
|
12
|
+
size?: string;
|
|
13
|
+
class?: string;
|
|
14
|
+
style?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class OverlayComponent implements IJSLComponent {
|
|
17
|
+
static show(options: IOverlayComponentOptions): OverlayComponent;
|
|
18
|
+
private static lastRenderedDlg;
|
|
19
|
+
private closeIcon;
|
|
20
|
+
private onKeydownEvent;
|
|
21
|
+
close(): void;
|
|
22
|
+
private options;
|
|
23
|
+
constructor(options: IOverlayComponentOptions);
|
|
24
|
+
onCreate(node: IJSLVNode): void;
|
|
25
|
+
render(): IJSLVNode;
|
|
26
|
+
private toNode;
|
|
27
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import "./overlay.css";
|
|
13
|
+
import { JSLRender } from "jsl-render";
|
|
14
|
+
var OverlayComponent = /** @class */ (function () {
|
|
15
|
+
function OverlayComponent(options) {
|
|
16
|
+
var _this = this;
|
|
17
|
+
this.closeIcon = {
|
|
18
|
+
tag: "div", content: "✖" /*"🗙"*/, attr: {
|
|
19
|
+
class: "overl-close-btn", click: function () {
|
|
20
|
+
_this.close();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
this.options = __assign({ closeOnEscape: true, closeOnOverlayClick: true, showCloseButton: true, direction: "left", animate: true }, options);
|
|
25
|
+
if (this.options.closeOnEscape) {
|
|
26
|
+
this.onKeydownEvent = document.addEventListener("keydown", function (args) {
|
|
27
|
+
if (args.keyCode === 27) { // escape
|
|
28
|
+
_this.close();
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
OverlayComponent.show = function (options) {
|
|
34
|
+
var container = document.createElement("div");
|
|
35
|
+
document.body.appendChild(container);
|
|
36
|
+
var oldRenderer = JSLRender.lastCreatedRenderer;
|
|
37
|
+
var oldLastDlg = OverlayComponent.lastRenderedDlg;
|
|
38
|
+
var renderer = new JSLRender(container, oldRenderer != null);
|
|
39
|
+
if (oldRenderer != null) {
|
|
40
|
+
JSLRender.lastCreatedRenderer = renderer;
|
|
41
|
+
}
|
|
42
|
+
var o = __assign({}, options);
|
|
43
|
+
o.onClose = function () {
|
|
44
|
+
if (options.onClose) {
|
|
45
|
+
if (options.onClose() === false) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
document.body.removeChild(container);
|
|
50
|
+
JSLRender.lastCreatedRenderer = oldRenderer;
|
|
51
|
+
if (oldRenderer != null) {
|
|
52
|
+
oldRenderer.refresh();
|
|
53
|
+
}
|
|
54
|
+
OverlayComponent.lastRenderedDlg = oldLastDlg;
|
|
55
|
+
};
|
|
56
|
+
var dlg = new OverlayComponent(o);
|
|
57
|
+
OverlayComponent.lastRenderedDlg = dlg;
|
|
58
|
+
renderer.render(dlg);
|
|
59
|
+
return dlg;
|
|
60
|
+
};
|
|
61
|
+
OverlayComponent.prototype.close = function () {
|
|
62
|
+
if (this.options.onClose) {
|
|
63
|
+
if (this.options.onClose() === false) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// this.overlay.style.display = "none";
|
|
68
|
+
if (this.onKeydownEvent != null) {
|
|
69
|
+
document.removeEventListener("keydown", this.onKeydownEvent);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
OverlayComponent.prototype.onCreate = function (node) {
|
|
73
|
+
var bodyDom = node.dom.querySelector(".overl-body");
|
|
74
|
+
if (bodyDom != null) {
|
|
75
|
+
if (this.options.direction === "left") {
|
|
76
|
+
node.dom.style.width = this.options.size;
|
|
77
|
+
if (this.options.animate) {
|
|
78
|
+
var realWidth = bodyDom.getBoundingClientRect().width;
|
|
79
|
+
node.dom.style.left = -realWidth + "px";
|
|
80
|
+
JSLRender.animate(node, { attr: "left", from: -realWidth + "px", to: "0px", duration: 500, easing: "easeOutSine" });
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
node.dom.style.height = this.options.size;
|
|
85
|
+
if (this.options.animate) {
|
|
86
|
+
var realHeight = bodyDom.getBoundingClientRect().height;
|
|
87
|
+
node.dom.style.top = -realHeight + "px";
|
|
88
|
+
JSLRender.animate(node, { attr: "top", from: -realHeight + "px", to: "0px", duration: 500, easing: "easeOutSine" });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
console.error("overl-body class not found");
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
OverlayComponent.prototype.render = function () {
|
|
97
|
+
var _this = this;
|
|
98
|
+
var body = this.toNode(this.options.content);
|
|
99
|
+
// let styleW = "";
|
|
100
|
+
// let styleH = "";
|
|
101
|
+
// if (this.options.width != null) {
|
|
102
|
+
// styleW += "width:" + this.options.width + ";";
|
|
103
|
+
// }
|
|
104
|
+
// if (this.options.minWidth != null) {
|
|
105
|
+
// styleW += "min-width:" + this.options.minWidth + ";";
|
|
106
|
+
// }
|
|
107
|
+
// if (this.options.maxWidth != null) {
|
|
108
|
+
// styleW += "max-width:" + this.options.maxWidth + ";";
|
|
109
|
+
// }
|
|
110
|
+
// if (this.options.height != null) {
|
|
111
|
+
// styleH += "height:" + this.options.height + ";";
|
|
112
|
+
// }
|
|
113
|
+
// if (this.options.minHeight != null) {
|
|
114
|
+
// styleH += "min-height:" + this.options.minHeight + ";";
|
|
115
|
+
// }
|
|
116
|
+
// if (this.options.maxHeight != null) {
|
|
117
|
+
// styleH += "max-height:" + this.options.maxHeight + ";";
|
|
118
|
+
// }
|
|
119
|
+
// const headerStyle = this.options.allowMove ? "cursor:move" : undefined;
|
|
120
|
+
return {
|
|
121
|
+
tag: "div", attr: {
|
|
122
|
+
class: "jsl-overlay-overlay", click: function (e) {
|
|
123
|
+
if (_this.options.closeOnOverlayClick && e.target.classList.contains("jsl-overlay-overlay")) {
|
|
124
|
+
_this.close();
|
|
125
|
+
}
|
|
126
|
+
}, wheel: function (e) {
|
|
127
|
+
e.stopImmediatePropagation();
|
|
128
|
+
e.stopPropagation();
|
|
129
|
+
}
|
|
130
|
+
}, children: [
|
|
131
|
+
{
|
|
132
|
+
tag: "div", attr: { class: ("overl-body-" + this.options.direction) + " overl-body " + (this.options.class || ""), style: this.options.style }, children: [{
|
|
133
|
+
tag: "div", attr: { class: "overl-header" },
|
|
134
|
+
children: this.options.showCloseButton ? [this.closeIcon] : []
|
|
135
|
+
}, body]
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
// }]
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
OverlayComponent.prototype.toNode = function (content) {
|
|
142
|
+
if (typeof content === "string") {
|
|
143
|
+
return { tag: "div", content: content };
|
|
144
|
+
}
|
|
145
|
+
return content;
|
|
146
|
+
};
|
|
147
|
+
return OverlayComponent;
|
|
148
|
+
}());
|
|
149
|
+
export { OverlayComponent };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
.jsl-overlay-overlay {
|
|
2
|
+
position: fixed;
|
|
3
|
+
left: 0;
|
|
4
|
+
top: 0;
|
|
5
|
+
bottom: 0;
|
|
6
|
+
right: 0;
|
|
7
|
+
z-index: 2001;
|
|
8
|
+
background: rgba(255, 255, 255, 0.6);
|
|
9
|
+
height: 100vh;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.overl-header {
|
|
13
|
+
position:absolute;
|
|
14
|
+
right: 0;
|
|
15
|
+
top: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.overl-body {
|
|
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
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import "./ProgressStyle.scss";
|
|
2
|
+
import { IJSLComponent, IJSLVNode } from "jsl-render";
|
|
3
|
+
export interface IProgressComponentOptions {
|
|
4
|
+
color?: string;
|
|
5
|
+
showPercent?: boolean;
|
|
6
|
+
percentFormat?: string;
|
|
7
|
+
class?: string;
|
|
8
|
+
style?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class ProgressComponent implements IJSLComponent {
|
|
11
|
+
private progress;
|
|
12
|
+
private options?;
|
|
13
|
+
constructor(progress: number, options?: IProgressComponentOptions);
|
|
14
|
+
isEqual(node: IJSLComponent): boolean;
|
|
15
|
+
render(): IJSLVNode;
|
|
16
|
+
setProgress(progress: number): void;
|
|
17
|
+
getProgress(): number;
|
|
18
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import "./ProgressStyle.scss";
|
|
2
|
+
import { numeric } from "../../core/numeric";
|
|
3
|
+
var ProgressComponent = /** @class */ (function () {
|
|
4
|
+
function ProgressComponent(progress, options) {
|
|
5
|
+
this.progress = progress;
|
|
6
|
+
this.options = options;
|
|
7
|
+
}
|
|
8
|
+
ProgressComponent.prototype.isEqual = function (node) {
|
|
9
|
+
return this.__proto__ === node.__proto__;
|
|
10
|
+
};
|
|
11
|
+
ProgressComponent.prototype.render = function () {
|
|
12
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
13
|
+
var style = "width: " + this.progress + "%";
|
|
14
|
+
if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.color) {
|
|
15
|
+
style += ";background:" + this.options.color;
|
|
16
|
+
}
|
|
17
|
+
if ((_b = this.options) === null || _b === void 0 ? void 0 : _b.style) {
|
|
18
|
+
style += ";" + this.options.style;
|
|
19
|
+
}
|
|
20
|
+
var content = "";
|
|
21
|
+
if ((_c = this.options) === null || _c === void 0 ? void 0 : _c.showPercent) {
|
|
22
|
+
content = numeric.format(this.progress, (_e = (_d = this.options) === null || _d === void 0 ? void 0 : _d.percentFormat) !== null && _e !== void 0 ? _e : "0. %");
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
tag: "div",
|
|
26
|
+
attr: { class: "progress-comp " + ((_g = (_f = this.options) === null || _f === void 0 ? void 0 : _f.class) !== null && _g !== void 0 ? _g : "") },
|
|
27
|
+
children: [{
|
|
28
|
+
tag: "div",
|
|
29
|
+
attr: { class: "bar", style: style },
|
|
30
|
+
content: content
|
|
31
|
+
}]
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
ProgressComponent.prototype.setProgress = function (progress) {
|
|
35
|
+
this.progress = progress;
|
|
36
|
+
};
|
|
37
|
+
ProgressComponent.prototype.getProgress = function () {
|
|
38
|
+
return this.progress;
|
|
39
|
+
};
|
|
40
|
+
return ProgressComponent;
|
|
41
|
+
}());
|
|
42
|
+
export { ProgressComponent };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "./RibbonMenuStyle.scss";
|
|
2
|
+
import { IJSLComponent, IJSLVNode } from "jsl-render";
|
|
3
|
+
export interface IRibbonGroup {
|
|
4
|
+
title?: string;
|
|
5
|
+
children: Array<IJSLVNode | IJSLComponent>;
|
|
6
|
+
}
|
|
7
|
+
export declare class RibbonMenuComponent implements IJSLComponent {
|
|
8
|
+
private groups;
|
|
9
|
+
constructor(groups: IRibbonGroup[]);
|
|
10
|
+
isEqual(node: IJSLComponent): boolean;
|
|
11
|
+
render(): IJSLVNode;
|
|
12
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
10
|
+
import "./RibbonMenuStyle.scss";
|
|
11
|
+
var RibbonMenuComponent = /** @class */ (function () {
|
|
12
|
+
// private options: IStackPanelOptions;
|
|
13
|
+
function RibbonMenuComponent(groups) {
|
|
14
|
+
this.groups = groups;
|
|
15
|
+
// this.options = {...{orientation: "horizontal", verticalAlign: "stretch"}, ...options};
|
|
16
|
+
}
|
|
17
|
+
RibbonMenuComponent.prototype.isEqual = function (node) {
|
|
18
|
+
return this.__proto__ === node.__proto__;
|
|
19
|
+
};
|
|
20
|
+
RibbonMenuComponent.prototype.render = function () {
|
|
21
|
+
return {
|
|
22
|
+
tag: "div", attr: { class: "ribbon-menu-comp" },
|
|
23
|
+
children: this.groups.map(function (g) {
|
|
24
|
+
var _a;
|
|
25
|
+
return {
|
|
26
|
+
tag: "div", attr: { class: "ribbon-group" },
|
|
27
|
+
children: __spreadArray([{ tag: "div", attr: { class: "ribbon-legend" }, content: (_a = g.title) !== null && _a !== void 0 ? _a : "" }], g.children, true)
|
|
28
|
+
};
|
|
29
|
+
})
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
return RibbonMenuComponent;
|
|
33
|
+
}());
|
|
34
|
+
export { RibbonMenuComponent };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
|
|
2
|
+
.ribbon-menu-comp {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
height: 3.9rem;
|
|
5
|
+
position: relative;
|
|
6
|
+
background: white;
|
|
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
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import "./SelectStyle.scss";
|
|
2
|
+
import { IJSLComponent, IJSLVNode, JSLRender } from "jsl-render";
|
|
3
|
+
import { EventHandler } from "../../interaction/eventhandler";
|
|
4
|
+
import { IDataConverter } from "../../interaction/dataconverter";
|
|
5
|
+
export interface ISelectRenderArg<T = any> {
|
|
6
|
+
data: T;
|
|
7
|
+
node: IJSLVNode;
|
|
8
|
+
isFocused: boolean;
|
|
9
|
+
isSelected: boolean;
|
|
10
|
+
isCurrent: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface ISelectRenderGroupArg {
|
|
13
|
+
groupValue: any;
|
|
14
|
+
node: IJSLVNode;
|
|
15
|
+
}
|
|
16
|
+
export interface ISelectComponentOptions<T = any, TValue = any, TBinding = any> {
|
|
17
|
+
data: T[];
|
|
18
|
+
style?: string;
|
|
19
|
+
class?: string;
|
|
20
|
+
placehoder?: string;
|
|
21
|
+
rowHeight?: number;
|
|
22
|
+
textColumn?: string;
|
|
23
|
+
keyColumn?: string;
|
|
24
|
+
dropdownWidth?: string;
|
|
25
|
+
dropdownHeight?: string;
|
|
26
|
+
dropdownClass?: string;
|
|
27
|
+
dropDirection?: "up" | "down" | "auto";
|
|
28
|
+
enableSearch?: boolean;
|
|
29
|
+
enableAnimation?: boolean;
|
|
30
|
+
allowEmpty?: boolean;
|
|
31
|
+
onRender?: (args: ISelectRenderArg<T>) => void | IJSLVNode;
|
|
32
|
+
onRenderGroup?: (args: ISelectRenderGroupArg) => void | IJSLVNode;
|
|
33
|
+
matchSearch?: (data: T, term: string) => boolean;
|
|
34
|
+
onAppend?: (dom: HTMLDivElement) => void;
|
|
35
|
+
enableKeyboard?: boolean;
|
|
36
|
+
multiple?: boolean;
|
|
37
|
+
enabled?: boolean;
|
|
38
|
+
bindTo?: TBinding;
|
|
39
|
+
property?: keyof TBinding;
|
|
40
|
+
converter?: IDataConverter<any, TValue>;
|
|
41
|
+
groupProperty?: keyof T;
|
|
42
|
+
bindMode?: "toModel" | "fromModel" | "both";
|
|
43
|
+
onChange?: EventHandler<TValue, T> | ((keyValue?: TValue, item?: T) => void);
|
|
44
|
+
value?: TValue;
|
|
45
|
+
openOnEnter?: boolean;
|
|
46
|
+
focusFirstItem?: boolean;
|
|
47
|
+
openOnFocus?: boolean;
|
|
48
|
+
autoShrink?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export declare class SelectComponent<T = any, TValue = any, TBinding = any> implements IJSLComponent {
|
|
51
|
+
private static ENTER_KEY;
|
|
52
|
+
private expanded;
|
|
53
|
+
private doNotFocus;
|
|
54
|
+
private options;
|
|
55
|
+
private dropdownArea;
|
|
56
|
+
private dom;
|
|
57
|
+
private renderer;
|
|
58
|
+
private focused;
|
|
59
|
+
private selected;
|
|
60
|
+
constructor(o: ISelectComponentOptions<T, TValue, TBinding>);
|
|
61
|
+
render(): IJSLVNode;
|
|
62
|
+
onCreate(node: IJSLVNode): void;
|
|
63
|
+
onUpdate(node: IJSLVNode): void;
|
|
64
|
+
onInit(renderer: JSLRender): void;
|
|
65
|
+
toggle(): void;
|
|
66
|
+
isExpanded(): boolean;
|
|
67
|
+
show(searchTxt?: string): void;
|
|
68
|
+
destroy(): void;
|
|
69
|
+
close(): void;
|
|
70
|
+
setFocus(item: T): void;
|
|
71
|
+
getFocus(): T;
|
|
72
|
+
getValue(): any;
|
|
73
|
+
setValue(value: any): void;
|
|
74
|
+
getSelected(): T | T[];
|
|
75
|
+
setSelected(item: T | T[]): void;
|
|
76
|
+
focus(): void;
|
|
77
|
+
hasSelection(): boolean;
|
|
78
|
+
protected renderSelection(): IJSLVNode;
|
|
79
|
+
}
|