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,17 @@
|
|
|
1
|
+
import { IJSLComponent, JSLRender, IJSLVNode } from "jsl-render";
|
|
2
|
+
export interface IIntervalOptions {
|
|
3
|
+
interval: number;
|
|
4
|
+
stopOnError?: boolean;
|
|
5
|
+
noRefresh?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class IntervalComponent implements IJSLComponent {
|
|
8
|
+
private fnc;
|
|
9
|
+
private options;
|
|
10
|
+
private renderer;
|
|
11
|
+
constructor(fnc: any, options: IIntervalOptions);
|
|
12
|
+
isEqual(node: IJSLComponent): boolean;
|
|
13
|
+
render(): IJSLVNode;
|
|
14
|
+
onInit(render: JSLRender): void;
|
|
15
|
+
onCreate(node: IJSLVNode): void;
|
|
16
|
+
onRemove(node: IJSLVNode): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var IntervalComponent = /** @class */ (function () {
|
|
2
|
+
function IntervalComponent(fnc, options) {
|
|
3
|
+
this.fnc = fnc;
|
|
4
|
+
this.options = options;
|
|
5
|
+
}
|
|
6
|
+
IntervalComponent.prototype.isEqual = function (node) {
|
|
7
|
+
return this.__proto__ === node.__proto__;
|
|
8
|
+
};
|
|
9
|
+
IntervalComponent.prototype.render = function () {
|
|
10
|
+
return { tag: "input", attr: { type: "hidden" } };
|
|
11
|
+
};
|
|
12
|
+
IntervalComponent.prototype.onInit = function (render) {
|
|
13
|
+
this.renderer = render;
|
|
14
|
+
};
|
|
15
|
+
IntervalComponent.prototype.onCreate = function (node) {
|
|
16
|
+
var _this = this;
|
|
17
|
+
var timeoutRef = node.dom.value;
|
|
18
|
+
if (timeoutRef && timeoutRef !== "0") {
|
|
19
|
+
clearTimeout(parseInt(timeoutRef, 10));
|
|
20
|
+
node.dom.value = "";
|
|
21
|
+
}
|
|
22
|
+
var f = function () {
|
|
23
|
+
var result;
|
|
24
|
+
try {
|
|
25
|
+
result = _this.fnc();
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
console.error(e);
|
|
29
|
+
if (_this.options.stopOnError) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
var isPromise = result && typeof result.then === "function" && typeof result.catch === "function";
|
|
34
|
+
if (isPromise) {
|
|
35
|
+
result.then(function () {
|
|
36
|
+
if (!_this.options.noRefresh) {
|
|
37
|
+
_this.renderer.refresh();
|
|
38
|
+
}
|
|
39
|
+
node.dom.value = setTimeout(f, _this.options.interval).toString();
|
|
40
|
+
}).catch(function (e) {
|
|
41
|
+
console.error(e);
|
|
42
|
+
if (!_this.options.stopOnError) {
|
|
43
|
+
if (!_this.options.noRefresh) {
|
|
44
|
+
_this.renderer.refresh();
|
|
45
|
+
}
|
|
46
|
+
node.dom.value = setTimeout(f, _this.options.interval).toString();
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
if (!_this.options.noRefresh) {
|
|
52
|
+
_this.renderer.refresh();
|
|
53
|
+
}
|
|
54
|
+
node.dom.value = setTimeout(f, _this.options.interval).toString();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
f();
|
|
58
|
+
};
|
|
59
|
+
IntervalComponent.prototype.onRemove = function (node) {
|
|
60
|
+
var timeoutRef = node.dom.value;
|
|
61
|
+
if (timeoutRef && timeoutRef !== "0") {
|
|
62
|
+
clearTimeout(parseInt(timeoutRef, 10));
|
|
63
|
+
node.dom.value = "";
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
return IntervalComponent;
|
|
67
|
+
}());
|
|
68
|
+
export { IntervalComponent };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IJSLComponent, IJSLVNode } from "jsl-render";
|
|
2
|
+
import { IAutoSuggestOptions, IAutoSuggest } from "../../ui/auto.suggest";
|
|
3
|
+
export interface IAutoSuggestComponentOptions extends IAutoSuggestOptions {
|
|
4
|
+
value?: string;
|
|
5
|
+
class?: string;
|
|
6
|
+
style?: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class AutoSuggestComponent implements IJSLComponent {
|
|
10
|
+
private options;
|
|
11
|
+
private ref;
|
|
12
|
+
private dom;
|
|
13
|
+
constructor(options: IAutoSuggestComponentOptions);
|
|
14
|
+
render(): IJSLVNode;
|
|
15
|
+
getRef(): IAutoSuggest;
|
|
16
|
+
getValue(): string;
|
|
17
|
+
setValue(val: string): void;
|
|
18
|
+
focus(): void;
|
|
19
|
+
onCreate(node: IJSLVNode): void;
|
|
20
|
+
onUpdate(node: IJSLVNode): void;
|
|
21
|
+
onRemove(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { AutoSuggest } from "../../ui/auto.suggest";
|
|
2
|
+
var AutoSuggestComponent = /** @class */ (function () {
|
|
3
|
+
function AutoSuggestComponent(options) {
|
|
4
|
+
this.options = options;
|
|
5
|
+
// this.id = this.options.id ?? helper.newDomGuid();
|
|
6
|
+
}
|
|
7
|
+
AutoSuggestComponent.prototype.render = function () {
|
|
8
|
+
var _a;
|
|
9
|
+
return {
|
|
10
|
+
tag: "input",
|
|
11
|
+
attr: { value: this.options.value, class: this.options.class, style: this.options.style, placeholder: (_a = this.options.placeholder) !== null && _a !== void 0 ? _a : "" }
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
AutoSuggestComponent.prototype.getRef = function () {
|
|
15
|
+
return this.ref;
|
|
16
|
+
};
|
|
17
|
+
AutoSuggestComponent.prototype.getValue = function () {
|
|
18
|
+
if (this.dom == null) {
|
|
19
|
+
return "";
|
|
20
|
+
}
|
|
21
|
+
return this.dom.value;
|
|
22
|
+
};
|
|
23
|
+
AutoSuggestComponent.prototype.setValue = function (val) {
|
|
24
|
+
if (this.dom == null) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
this.dom.value = val;
|
|
28
|
+
};
|
|
29
|
+
AutoSuggestComponent.prototype.focus = function () {
|
|
30
|
+
if (this.dom == null) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
this.dom.focus();
|
|
34
|
+
};
|
|
35
|
+
AutoSuggestComponent.prototype.onCreate = function (node) {
|
|
36
|
+
this.dom = node.dom;
|
|
37
|
+
AutoSuggest(node.dom, this.options);
|
|
38
|
+
};
|
|
39
|
+
AutoSuggestComponent.prototype.onUpdate = function (node) {
|
|
40
|
+
this.dom = node.dom;
|
|
41
|
+
};
|
|
42
|
+
AutoSuggestComponent.prototype.onRemove = function () {
|
|
43
|
+
if (this.ref != null) {
|
|
44
|
+
this.ref.destroy();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return AutoSuggestComponent;
|
|
48
|
+
}());
|
|
49
|
+
export { AutoSuggestComponent };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IJSLComponent, IJSLVNode } from "jsl-render";
|
|
2
|
+
import { EventHandler } from "../../interaction/eventhandler";
|
|
3
|
+
export interface IButtonOptions {
|
|
4
|
+
content: string | IJSLVNode | IJSLComponent;
|
|
5
|
+
enabled?: boolean;
|
|
6
|
+
class?: string;
|
|
7
|
+
outlined?: boolean;
|
|
8
|
+
style?: string;
|
|
9
|
+
click?: EventHandler<MouseEvent> | ((evt?: MouseEvent) => void);
|
|
10
|
+
}
|
|
11
|
+
export declare class ButtonComponent implements IJSLComponent {
|
|
12
|
+
private options;
|
|
13
|
+
get click(): EventHandler<MouseEvent>;
|
|
14
|
+
constructor(options: IButtonOptions);
|
|
15
|
+
isEqual(node: IJSLComponent): boolean;
|
|
16
|
+
render(): IJSLVNode;
|
|
17
|
+
private raiseEvent;
|
|
18
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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 { EventHandler } from "../../interaction/eventhandler";
|
|
13
|
+
var ButtonComponent = /** @class */ (function () {
|
|
14
|
+
function ButtonComponent(options) {
|
|
15
|
+
this.options = __assign({ enabled: true, class: "" }, options);
|
|
16
|
+
this.options.click = EventHandler.Create(this.options.click);
|
|
17
|
+
}
|
|
18
|
+
Object.defineProperty(ButtonComponent.prototype, "click", {
|
|
19
|
+
get: function () {
|
|
20
|
+
return this.options.click;
|
|
21
|
+
},
|
|
22
|
+
enumerable: false,
|
|
23
|
+
configurable: true
|
|
24
|
+
});
|
|
25
|
+
ButtonComponent.prototype.isEqual = function (node) {
|
|
26
|
+
return this.__proto__ === node.__proto__;
|
|
27
|
+
};
|
|
28
|
+
ButtonComponent.prototype.render = function () {
|
|
29
|
+
return {
|
|
30
|
+
tag: "button",
|
|
31
|
+
attr: {
|
|
32
|
+
class: "jsl-button " + (this.options.outlined ? "jsl-button-outline " : "") +
|
|
33
|
+
this.options.class + (!this.options.enabled ? " disabled" : ""), style: this.options.style, click: this.raiseEvent
|
|
34
|
+
},
|
|
35
|
+
content: typeof this.options.content === "string" ? this.options.content : "",
|
|
36
|
+
children: typeof this.options.content !== "string" ? [this.options.content] : []
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
ButtonComponent.prototype.raiseEvent = function (evt) {
|
|
40
|
+
if (this.options.enabled) {
|
|
41
|
+
this.options.click.notify(evt);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
return ButtonComponent;
|
|
45
|
+
}());
|
|
46
|
+
export { ButtonComponent };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import "./CheckBoxStyle.scss";
|
|
2
|
+
import { IJSLComponent, IJSLVNode } from "jsl-render";
|
|
3
|
+
import { EventHandler } from "../../interaction/eventhandler";
|
|
4
|
+
import { IDataConverter } from "../../interaction/dataconverter";
|
|
5
|
+
export interface ICheckBoxOptions<T = any> {
|
|
6
|
+
value?: boolean;
|
|
7
|
+
label: string;
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
class?: string;
|
|
10
|
+
style?: string;
|
|
11
|
+
onChange?: EventHandler<boolean> | ((v?: boolean) => void);
|
|
12
|
+
id?: string;
|
|
13
|
+
bindTo?: T;
|
|
14
|
+
property?: keyof T;
|
|
15
|
+
bindMode?: "toModel" | "fromModel" | "both";
|
|
16
|
+
converter?: IDataConverter<any, boolean>;
|
|
17
|
+
}
|
|
18
|
+
export declare class CheckBoxComponent<T = any> implements IJSLComponent {
|
|
19
|
+
private options;
|
|
20
|
+
private currentDom;
|
|
21
|
+
get onChange(): EventHandler<boolean>;
|
|
22
|
+
constructor(options: ICheckBoxOptions<T>);
|
|
23
|
+
render(): IJSLVNode;
|
|
24
|
+
getValue(): boolean;
|
|
25
|
+
setValue(val: boolean): void;
|
|
26
|
+
onCreate(node: IJSLVNode): void;
|
|
27
|
+
private raiseEvent;
|
|
28
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
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 "./CheckBoxStyle.scss";
|
|
13
|
+
import { EventHandler } from "../../interaction/eventhandler";
|
|
14
|
+
import { helper } from "../../core/helper";
|
|
15
|
+
var CheckBoxComponent = /** @class */ (function () {
|
|
16
|
+
function CheckBoxComponent(options) {
|
|
17
|
+
var _a;
|
|
18
|
+
this.options = __assign({ enabled: true, class: "", bindMode: "toModel" }, options);
|
|
19
|
+
if (!this.options.id) {
|
|
20
|
+
this.options.id = helper.newDomGuid();
|
|
21
|
+
}
|
|
22
|
+
if (this.options.bindTo != null && this.options.property != null && this.options.value == null) {
|
|
23
|
+
this.options.value = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
|
|
24
|
+
this.options.converter.toUI(this.options.bindTo[this.options.property]) :
|
|
25
|
+
this.options.bindTo[this.options.property]);
|
|
26
|
+
}
|
|
27
|
+
this.options.onChange = EventHandler.Create(this.options.onChange);
|
|
28
|
+
}
|
|
29
|
+
Object.defineProperty(CheckBoxComponent.prototype, "onChange", {
|
|
30
|
+
get: function () {
|
|
31
|
+
return this.options.onChange;
|
|
32
|
+
},
|
|
33
|
+
enumerable: false,
|
|
34
|
+
configurable: true
|
|
35
|
+
});
|
|
36
|
+
// public isEqual(node: IJSLComponent): boolean {
|
|
37
|
+
// return (this as any).__proto__ === (node as any).__proto__;
|
|
38
|
+
// }
|
|
39
|
+
CheckBoxComponent.prototype.render = function () {
|
|
40
|
+
var _a;
|
|
41
|
+
var val = this.options.value;
|
|
42
|
+
if (this.options.bindMode !== "toModel" && this.options.bindTo != null && this.options.property != null) {
|
|
43
|
+
var current = this.getValue();
|
|
44
|
+
var newVal = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
|
|
45
|
+
this.options.converter.toUI(this.options.bindTo[this.options.property]) :
|
|
46
|
+
this.options.bindTo[this.options.property]);
|
|
47
|
+
if (newVal !== current) {
|
|
48
|
+
val = newVal;
|
|
49
|
+
if (this.currentDom != null) {
|
|
50
|
+
this.currentDom.checked = val;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
tag: "span",
|
|
56
|
+
attr: { style: this.options.style },
|
|
57
|
+
children: [{
|
|
58
|
+
tag: "input",
|
|
59
|
+
attr: {
|
|
60
|
+
type: "checkbox",
|
|
61
|
+
disabled: !this.options.enabled ? "disabled" : undefined,
|
|
62
|
+
class: "checkbox-comp " + (this.options.class || ""),
|
|
63
|
+
change: this.raiseEvent,
|
|
64
|
+
checked: val ? "checked" : undefined,
|
|
65
|
+
id: typeof this.options.id === "string" ? this.options.id : undefined
|
|
66
|
+
}
|
|
67
|
+
}, { tag: "label", content: this.options.label, attr: { for: this.options.id } }]
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
CheckBoxComponent.prototype.getValue = function () {
|
|
71
|
+
var _a;
|
|
72
|
+
return ((_a = this.currentDom) === null || _a === void 0 ? void 0 : _a.checked) || false;
|
|
73
|
+
};
|
|
74
|
+
CheckBoxComponent.prototype.setValue = function (val) {
|
|
75
|
+
if (this.currentDom != null) {
|
|
76
|
+
this.currentDom.checked = val;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
CheckBoxComponent.prototype.onCreate = function (node) {
|
|
80
|
+
this.currentDom = node.dom.querySelector("input");
|
|
81
|
+
};
|
|
82
|
+
CheckBoxComponent.prototype.raiseEvent = function (e, node) {
|
|
83
|
+
var _a;
|
|
84
|
+
if (this.options.enabled) {
|
|
85
|
+
var value = node.dom.checked;
|
|
86
|
+
if (this.options.bindTo && this.options.bindMode !== "fromModel" && this.options.property) {
|
|
87
|
+
this.options.bindTo[this.options.property] = ((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? this.options.converter.toData(value) : value;
|
|
88
|
+
}
|
|
89
|
+
this.options.onChange.notify(value);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
return CheckBoxComponent;
|
|
93
|
+
}());
|
|
94
|
+
export { CheckBoxComponent };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
@keyframes checkbox-comp-hover-color{
|
|
2
|
+
from{
|
|
3
|
+
border-color:#C0C0C0;
|
|
4
|
+
}
|
|
5
|
+
to{
|
|
6
|
+
border-color:#3B99FF;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
.checkbox-comp{
|
|
10
|
+
position:absolute;
|
|
11
|
+
display:none;
|
|
12
|
+
}
|
|
13
|
+
.checkbox-comp[disabled]{
|
|
14
|
+
cursor:not-allowed
|
|
15
|
+
}
|
|
16
|
+
.checkbox-comp+label{
|
|
17
|
+
position:relative;
|
|
18
|
+
// display:block;
|
|
19
|
+
padding-left:1.5em;
|
|
20
|
+
cursor:pointer;
|
|
21
|
+
vertical-align:middle;
|
|
22
|
+
}
|
|
23
|
+
.checkbox-comp+label:hover:before{
|
|
24
|
+
animation-duration:.4s;
|
|
25
|
+
animation-fill-mode:both;
|
|
26
|
+
animation-name:checkbox-comp-hover-color;
|
|
27
|
+
}
|
|
28
|
+
.checkbox-comp+label:before{
|
|
29
|
+
position:absolute;
|
|
30
|
+
top:0;
|
|
31
|
+
left:0;
|
|
32
|
+
display:inline-block;
|
|
33
|
+
width:1em;
|
|
34
|
+
height:1em;
|
|
35
|
+
content:'';
|
|
36
|
+
border:1px solid #C0C0C0;
|
|
37
|
+
}
|
|
38
|
+
.checkbox-comp+label:after{
|
|
39
|
+
position:absolute;
|
|
40
|
+
display:none;
|
|
41
|
+
content:''
|
|
42
|
+
}
|
|
43
|
+
.checkbox-comp[disabled]+label{
|
|
44
|
+
cursor:not-allowed;
|
|
45
|
+
// color:#C0C0C0;
|
|
46
|
+
}
|
|
47
|
+
.checkbox-comp[disabled]+label:hover,.checkbox-comp[disabled]+label:before,.checkbox-comp[disabled]+label:after{
|
|
48
|
+
cursor:not-allowed
|
|
49
|
+
}
|
|
50
|
+
.checkbox-comp[disabled]+label:hover:before{
|
|
51
|
+
border:1px solid #C0C0C0;
|
|
52
|
+
animation-name:none
|
|
53
|
+
}
|
|
54
|
+
.checkbox-comp[disabled]+label:before{
|
|
55
|
+
border-color:#C0C0C0;
|
|
56
|
+
}
|
|
57
|
+
.checkbox-comp:checked+label:before{
|
|
58
|
+
animation-name:none
|
|
59
|
+
}
|
|
60
|
+
.checkbox-comp:checked+label:after{
|
|
61
|
+
display:block
|
|
62
|
+
}
|
|
63
|
+
.checkbox-comp+label:before{
|
|
64
|
+
border-radius:0.2em;
|
|
65
|
+
}
|
|
66
|
+
.checkbox-comp+label:after{
|
|
67
|
+
top:0.1em; //2px;
|
|
68
|
+
left:0.3em; //7px;
|
|
69
|
+
box-sizing:border-box;
|
|
70
|
+
width:0.5em; //6px;
|
|
71
|
+
height:0.7em; //12px;
|
|
72
|
+
transform:rotate(45deg);
|
|
73
|
+
border-width:0.15em;
|
|
74
|
+
border-style:solid;
|
|
75
|
+
border-color:#fff;
|
|
76
|
+
border-top:0;
|
|
77
|
+
border-left:0
|
|
78
|
+
}
|
|
79
|
+
.checkbox-comp:checked+label:before{
|
|
80
|
+
border-color:#3B99FF;
|
|
81
|
+
background:#3B99FF;
|
|
82
|
+
}
|
|
83
|
+
.checkbox-comp:checked[disabled]+label:before{
|
|
84
|
+
border-color:#c9e2f9;
|
|
85
|
+
background:#c9e2f9
|
|
86
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { IJSLComponent, IJSLVNode } from "jsl-render";
|
|
2
|
+
import { IDatePickerOptions, IDatePicker } from "../../ui/date.picker";
|
|
3
|
+
import { EventHandler } from "../../interaction/eventhandler";
|
|
4
|
+
import { IDataConverter } from "../../interaction/dataconverter";
|
|
5
|
+
export interface IDateComponentOptions<T = any> extends IDatePickerOptions {
|
|
6
|
+
id?: string;
|
|
7
|
+
class?: string;
|
|
8
|
+
style?: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
value?: Date;
|
|
11
|
+
onChange?: EventHandler<Date> | ((v?: Date) => void);
|
|
12
|
+
bindTo?: T;
|
|
13
|
+
property?: keyof T;
|
|
14
|
+
bindMode?: "toModel" | "fromModel" | "both";
|
|
15
|
+
converter?: IDataConverter<any, Date>;
|
|
16
|
+
enabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare class DateComponent<T = any> implements IJSLComponent {
|
|
19
|
+
private options;
|
|
20
|
+
private ref;
|
|
21
|
+
private currentDom;
|
|
22
|
+
constructor(options: IDateComponentOptions<T>);
|
|
23
|
+
get onChange(): EventHandler<Date>;
|
|
24
|
+
render(): IJSLVNode;
|
|
25
|
+
getValue(): string;
|
|
26
|
+
getValueAsDate(): Date;
|
|
27
|
+
getRef(): IDatePicker;
|
|
28
|
+
onCreate(node: IJSLVNode): void;
|
|
29
|
+
onUpdate(node: IJSLVNode): void;
|
|
30
|
+
onRemove(): void;
|
|
31
|
+
private raiseEvent;
|
|
32
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
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 { DatePicker } from "../../ui/date.picker";
|
|
13
|
+
import { date } from "../../core/date";
|
|
14
|
+
import { helper } from "../../core/helper";
|
|
15
|
+
import { EventHandler } from "../../interaction/eventhandler";
|
|
16
|
+
var DateComponent = /** @class */ (function () {
|
|
17
|
+
function DateComponent(options) {
|
|
18
|
+
var _a;
|
|
19
|
+
this.options = __assign({ enabled: true, id: helper.newDomGuid(), 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
|
+
}
|
|
27
|
+
Object.defineProperty(DateComponent.prototype, "onChange", {
|
|
28
|
+
get: function () {
|
|
29
|
+
return this.options.onChange;
|
|
30
|
+
},
|
|
31
|
+
enumerable: false,
|
|
32
|
+
configurable: true
|
|
33
|
+
});
|
|
34
|
+
DateComponent.prototype.render = function () {
|
|
35
|
+
var _a;
|
|
36
|
+
var val = this.options.value;
|
|
37
|
+
if (this.options.bindMode !== "toModel" && this.options.bindTo != null && this.options.property != null) {
|
|
38
|
+
var current = this.getValue();
|
|
39
|
+
var newVal = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
|
|
40
|
+
this.options.converter.toUI(this.options.bindTo[this.options.property]) :
|
|
41
|
+
this.options.bindTo[this.options.property]);
|
|
42
|
+
var newValStr = date.format(newVal);
|
|
43
|
+
if (newValStr !== current) {
|
|
44
|
+
val = newVal;
|
|
45
|
+
if (this.currentDom != null) {
|
|
46
|
+
this.currentDom.value = newValStr;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
tag: "input",
|
|
52
|
+
attr: {
|
|
53
|
+
id: this.options.id,
|
|
54
|
+
class: this.options.class,
|
|
55
|
+
style: this.options.style,
|
|
56
|
+
disabled: !this.options.enabled ? "disabled" : undefined,
|
|
57
|
+
placeholder: this.options.placeholder,
|
|
58
|
+
value: date.format(val),
|
|
59
|
+
change: this.raiseEvent,
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
DateComponent.prototype.getValue = function () {
|
|
64
|
+
if (this.currentDom == null) {
|
|
65
|
+
return "";
|
|
66
|
+
}
|
|
67
|
+
return this.currentDom.value;
|
|
68
|
+
};
|
|
69
|
+
DateComponent.prototype.getValueAsDate = function () {
|
|
70
|
+
if (this.currentDom == null) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
if (this.options.parse) {
|
|
74
|
+
return this.options.parse(this.currentDom.value);
|
|
75
|
+
}
|
|
76
|
+
return date.parse(this.currentDom.value);
|
|
77
|
+
};
|
|
78
|
+
DateComponent.prototype.getRef = function () {
|
|
79
|
+
return this.ref;
|
|
80
|
+
};
|
|
81
|
+
DateComponent.prototype.onCreate = function (node) {
|
|
82
|
+
this.currentDom = node.dom;
|
|
83
|
+
this.ref = DatePicker(this.currentDom, this.options);
|
|
84
|
+
};
|
|
85
|
+
DateComponent.prototype.onUpdate = function (node) {
|
|
86
|
+
this.currentDom = node.dom;
|
|
87
|
+
};
|
|
88
|
+
DateComponent.prototype.onRemove = function () {
|
|
89
|
+
if (this.ref != null) {
|
|
90
|
+
this.ref.destroy();
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
DateComponent.prototype.raiseEvent = function (e, node) {
|
|
94
|
+
var _a;
|
|
95
|
+
if (this.options.enabled) {
|
|
96
|
+
var val = date.parse(node.dom.value);
|
|
97
|
+
if (this.options.bindTo && this.options.bindMode !== "fromModel" && this.options.property) {
|
|
98
|
+
this.options.bindTo[this.options.property] =
|
|
99
|
+
((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? this.options.converter.toData(val) : val;
|
|
100
|
+
}
|
|
101
|
+
this.options.onChange.notify(val);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
return DateComponent;
|
|
105
|
+
}());
|
|
106
|
+
export { DateComponent };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import "./DateRangeStyle.scss";
|
|
2
|
+
import { IJSLComponent, IJSLVNode } from "jsl-render";
|
|
3
|
+
import { EventHandler } from "../../interaction/eventhandler";
|
|
4
|
+
export interface IDateRangeValue {
|
|
5
|
+
minValue: Date;
|
|
6
|
+
maxValue: Date;
|
|
7
|
+
}
|
|
8
|
+
export interface IDateRangeOptions {
|
|
9
|
+
class?: string;
|
|
10
|
+
style?: string;
|
|
11
|
+
min: Date;
|
|
12
|
+
max: Date;
|
|
13
|
+
minValue?: Date;
|
|
14
|
+
maxValue?: Date;
|
|
15
|
+
increment: "days" | "weeks" | "month" | "years";
|
|
16
|
+
onChange?: EventHandler<IDateRangeValue> | ((v?: IDateRangeValue) => void);
|
|
17
|
+
}
|
|
18
|
+
export declare class DateRangeComponent implements IJSLComponent {
|
|
19
|
+
State: {
|
|
20
|
+
currentMin: any;
|
|
21
|
+
currentMax: any;
|
|
22
|
+
};
|
|
23
|
+
private manualChange;
|
|
24
|
+
private minDate;
|
|
25
|
+
private maxDate;
|
|
26
|
+
private options;
|
|
27
|
+
private slider;
|
|
28
|
+
constructor(o: IDateRangeOptions);
|
|
29
|
+
render(): IJSLVNode;
|
|
30
|
+
onCreate(node: IJSLVNode): void;
|
|
31
|
+
onRemove(): void;
|
|
32
|
+
getMin(): Date;
|
|
33
|
+
getMax(): Date;
|
|
34
|
+
private triggerChange;
|
|
35
|
+
}
|