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,90 @@
|
|
|
1
|
+
import "./ExpanderStyle.scss";
|
|
2
|
+
var ExpanderComponent = /** @class */ (function () {
|
|
3
|
+
function ExpanderComponent(optionsOrHeader, body, expanded) {
|
|
4
|
+
var _a;
|
|
5
|
+
this.State = { expanded: false, waitingForAnimation: false };
|
|
6
|
+
if (body != null) {
|
|
7
|
+
// old syntax
|
|
8
|
+
this.options = { header: optionsOrHeader, body: body, expanded: expanded !== null && expanded !== void 0 ? expanded : true };
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
this.options = optionsOrHeader;
|
|
12
|
+
this.options.expanded = (_a = this.options.expanded) !== null && _a !== void 0 ? _a : true;
|
|
13
|
+
}
|
|
14
|
+
this.State.expanded = this.options.expanded;
|
|
15
|
+
}
|
|
16
|
+
ExpanderComponent.prototype.getIcon = function (expanded) {
|
|
17
|
+
var _a, _b, _c, _d;
|
|
18
|
+
return {
|
|
19
|
+
tag: "span", attr: {
|
|
20
|
+
class: "expand-collapse-icon", style: "padding:0 0.2rem 0 0.2rem;"
|
|
21
|
+
},
|
|
22
|
+
raw: true,
|
|
23
|
+
content: "<svg style='" +
|
|
24
|
+
"min-width:" + ((_a = this.options.iconSize) !== null && _a !== void 0 ? _a : "1.5rem") + "; min-height:" + ((_b = this.options.iconSize) !== null && _b !== void 0 ? _b : "1.5rem") +
|
|
25
|
+
";max-width:" + ((_c = this.options.iconSize) !== null && _c !== void 0 ? _c : "1.5rem") + "; max-height:" + ((_d = this.options.iconSize) !== null && _d !== void 0 ? _d : "1.5rem") + ";' " +
|
|
26
|
+
"xml:space='preserve' width='1024px' height='1024px' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='nonzero' clip-rule='evenodd' viewBox='0 0 10240 10240'>" +
|
|
27
|
+
(expanded
|
|
28
|
+
? "<path id='curve0' fill='#FFFFFF' d='M1273 3989l3621 3620c124,125 328,125 452,0l3621 -3620c124,-125 124,-328 0,-453l-905 -905c-125,-125 -328,-125 -453,0l-2489 2489 -2489 -2489c-125,-125 -328,-125 -453,0l-905 905c-124,125 -124,328 0,453z'/>"
|
|
29
|
+
: "<path id='curve0' fill='#FFFFFF' d='M3989 1273l3620 3621c125,124 125,328 0,452l-3620 3621c-125,124 -328,124 -453,0l-905 -905c-125,-125 -125,-328 0,-453l2489 -2489 -2489 -2489c-125,-125 -125,-328 0,-453l905 -905c125,-124 328,-124 453,0z'/>") +
|
|
30
|
+
"</svg>"
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
ExpanderComponent.prototype.isEqual = function (node) {
|
|
34
|
+
return this.__proto__ === node.__proto__;
|
|
35
|
+
};
|
|
36
|
+
ExpanderComponent.prototype.render = function () {
|
|
37
|
+
var _this = this;
|
|
38
|
+
var _a, _b, _c;
|
|
39
|
+
var animate = this.State.waitingForAnimation;
|
|
40
|
+
this.State.waitingForAnimation = false;
|
|
41
|
+
return {
|
|
42
|
+
tag: "div", attr: { class: "expander-comp " + (this.options.class || ""), style: (_a = this.options.style) !== null && _a !== void 0 ? _a : "" }, children: [
|
|
43
|
+
{
|
|
44
|
+
tag: "div", attr: {
|
|
45
|
+
class: "header",
|
|
46
|
+
click: function (evt) { var _a; if ((_a = _this.options.isToggleOnHeader) !== null && _a !== void 0 ? _a : true) {
|
|
47
|
+
evt.stopPropagation();
|
|
48
|
+
_this.toggleExpand();
|
|
49
|
+
} },
|
|
50
|
+
},
|
|
51
|
+
children: [
|
|
52
|
+
{
|
|
53
|
+
tag: "span", attr: { class: "toggler", click: function (evt) { evt.stopPropagation(); _this.toggleExpand(); } },
|
|
54
|
+
children: [this.State.expanded
|
|
55
|
+
? ((_b = this.options.expandedIcon) !== null && _b !== void 0 ? _b : this.getIcon(true))
|
|
56
|
+
: ((_c = this.options.collapsedIcon) !== null && _c !== void 0 ? _c : this.getIcon(false))
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{ tag: "span", attr: { class: "content" }, children: [this.toNode(this.options.header)] }
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
tag: "div", attr: { class: "body", style: this.State.expanded ? undefined : { display: "none" } },
|
|
64
|
+
animation: (animate ? { attr: "opacity", from: "0", to: "1", duration: 500 } : undefined),
|
|
65
|
+
children: [this.toNode(this.options.body)]
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
ExpanderComponent.prototype.toggleExpand = function () {
|
|
71
|
+
var newVal = !this.State.expanded;
|
|
72
|
+
if (this.options.onToggle != null) {
|
|
73
|
+
if (this.options.onToggle(newVal) === false) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (newVal) {
|
|
78
|
+
this.State.waitingForAnimation = true;
|
|
79
|
+
}
|
|
80
|
+
this.State.expanded = newVal;
|
|
81
|
+
};
|
|
82
|
+
ExpanderComponent.prototype.toNode = function (content) {
|
|
83
|
+
if (typeof content === "string") {
|
|
84
|
+
return { tag: "div", content: content };
|
|
85
|
+
}
|
|
86
|
+
return content;
|
|
87
|
+
};
|
|
88
|
+
return ExpanderComponent;
|
|
89
|
+
}());
|
|
90
|
+
export { ExpanderComponent };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
.expander-comp {
|
|
2
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
3
|
+
.header {
|
|
4
|
+
background: #3B99FF;
|
|
5
|
+
color: #fff;
|
|
6
|
+
border-radius: 0.3rem;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-content: center;
|
|
9
|
+
min-height: 1.5rem;
|
|
10
|
+
line-height: 1.5rem;
|
|
11
|
+
align-items: center;
|
|
12
|
+
|
|
13
|
+
.toggler {
|
|
14
|
+
border-top-left-radius: 0.3rem;
|
|
15
|
+
border-bottom-left-radius: 0.3rem;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
display: inline-block;
|
|
18
|
+
background: #3B99FF;
|
|
19
|
+
|
|
20
|
+
&:hover {
|
|
21
|
+
background: #6bb1fc;
|
|
22
|
+
color: black;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.content {
|
|
27
|
+
border-top-right-radius: 0.3rem;
|
|
28
|
+
border-bottom-right-radius: 0.3rem;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
display: inline-block;
|
|
31
|
+
flex-grow: 1;
|
|
32
|
+
padding-left: 0.6em;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
&:hover {
|
|
37
|
+
background: #6bb1fc;
|
|
38
|
+
color: black;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
.expand-collapse-icon {
|
|
42
|
+
top: 0.2rem;
|
|
43
|
+
color: #fff;
|
|
44
|
+
opacity: 0.8;
|
|
45
|
+
padding:0 0.2rem 0 0.2rem;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.expander-comp {
|
|
2
|
+
|
|
3
|
+
margin: 1rem;
|
|
4
|
+
box-shadow: 0 1px 2px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.1);
|
|
5
|
+
|
|
6
|
+
.header {
|
|
7
|
+
position: relative;
|
|
8
|
+
padding: 0.5rem;
|
|
9
|
+
padding-left: 1.6rem;
|
|
10
|
+
border-bottom: 2px solid #cccccc;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
background: #3B99FF;
|
|
13
|
+
color: white;
|
|
14
|
+
font-weight: bold;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.body {
|
|
18
|
+
padding: 0.5rem;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.expand-collapse-icon {
|
|
22
|
+
position: absolute;
|
|
23
|
+
left: 0.2rem;
|
|
24
|
+
top: 0.4rem;
|
|
25
|
+
font-size: 0.9rem;
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
padding: 0.1rem;
|
|
28
|
+
opacity: 0.6;
|
|
29
|
+
font-weight: bold;
|
|
30
|
+
color: black;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.header:hover .expand-collapse-icon {
|
|
34
|
+
opacity: 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IJSLComponent, IJSLVNode } from "jsl-render";
|
|
2
|
+
export interface IFormComponentOptions {
|
|
3
|
+
class?: string;
|
|
4
|
+
style?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class FormComponent implements IJSLComponent {
|
|
7
|
+
private children;
|
|
8
|
+
private options?;
|
|
9
|
+
constructor(children: Array<IJSLVNode | IJSLComponent>, options?: IFormComponentOptions);
|
|
10
|
+
render(): IJSLVNode;
|
|
11
|
+
validate(): boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var FormComponent = /** @class */ (function () {
|
|
2
|
+
function FormComponent(children, options) {
|
|
3
|
+
this.children = children;
|
|
4
|
+
this.options = options;
|
|
5
|
+
}
|
|
6
|
+
FormComponent.prototype.render = function () {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
return {
|
|
9
|
+
tag: "form",
|
|
10
|
+
attr: { class: (_a = this.options) === null || _a === void 0 ? void 0 : _a.class, style: (_b = this.options) === null || _b === void 0 ? void 0 : _b.style },
|
|
11
|
+
children: this.children
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
FormComponent.prototype.validate = function () {
|
|
15
|
+
var valid = true;
|
|
16
|
+
for (var _i = 0, _a = this.children; _i < _a.length; _i++) {
|
|
17
|
+
var c = _a[_i];
|
|
18
|
+
if (c.validate && !c.validate()) {
|
|
19
|
+
valid = false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return valid;
|
|
23
|
+
};
|
|
24
|
+
return FormComponent;
|
|
25
|
+
}());
|
|
26
|
+
export { FormComponent };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import "./FormFieldStyle.scss";
|
|
2
|
+
import { IJSLComponent, IJSLVNode } from "jsl-render";
|
|
3
|
+
import { IDatePickerOptions } from "../../ui/date.picker";
|
|
4
|
+
import { INumberInputOptions } from "../../ui/number.input";
|
|
5
|
+
import { IAutoSuggestOptions } from "../../ui/auto.suggest";
|
|
6
|
+
export interface IFormFieldOptions {
|
|
7
|
+
id?: string;
|
|
8
|
+
label: string;
|
|
9
|
+
type?: "text" | "password" | "date" | "number" | "autosuggest";
|
|
10
|
+
dateOptions?: IDatePickerOptions;
|
|
11
|
+
numberOptions?: INumberInputOptions;
|
|
12
|
+
autoSuggestOptions?: IAutoSuggestOptions;
|
|
13
|
+
value?: string;
|
|
14
|
+
maxLength?: number;
|
|
15
|
+
class?: string;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
onValidate?: (val: string) => boolean | string;
|
|
18
|
+
onBlur?: (evt: any, input: IJSLVNode) => void;
|
|
19
|
+
onFocus?: (evt: any, input: IJSLVNode) => void;
|
|
20
|
+
onInput?: (evt: any, input: IJSLVNode) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare class FormFieldComponent implements IJSLComponent {
|
|
23
|
+
private options;
|
|
24
|
+
private id;
|
|
25
|
+
private type;
|
|
26
|
+
private datepickerRef;
|
|
27
|
+
private validationMessage;
|
|
28
|
+
constructor(options: IFormFieldOptions);
|
|
29
|
+
render(): IJSLVNode;
|
|
30
|
+
onCreate(node: IJSLVNode): void;
|
|
31
|
+
onRemove(node: IJSLVNode): void;
|
|
32
|
+
validate(): boolean;
|
|
33
|
+
getValue(): string;
|
|
34
|
+
setValue(value: string): void;
|
|
35
|
+
private setInActive;
|
|
36
|
+
private setActive;
|
|
37
|
+
private onInput;
|
|
38
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import "./FormFieldStyle.scss";
|
|
2
|
+
import { DatePicker } from "../../ui/date.picker";
|
|
3
|
+
import { NumberInput } from "../../ui/number.input";
|
|
4
|
+
import { helper } from "../../core/helper";
|
|
5
|
+
import { AutoSuggest } from "../../ui/auto.suggest";
|
|
6
|
+
var FormFieldComponent = /** @class */ (function () {
|
|
7
|
+
function FormFieldComponent(options) {
|
|
8
|
+
this.options = options;
|
|
9
|
+
this.id = options.id || helper.newDomGuid();
|
|
10
|
+
this.type = this.options.type === "password" ? "password" : "text";
|
|
11
|
+
}
|
|
12
|
+
FormFieldComponent.prototype.render = function () {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
return {
|
|
15
|
+
tag: "div",
|
|
16
|
+
attr: { class: "form-field " + (this.options.value ? "form-field--is-filled " : "") + ((_a = this.options.class) !== null && _a !== void 0 ? _a : "") },
|
|
17
|
+
children: [{
|
|
18
|
+
tag: "div",
|
|
19
|
+
attr: { class: "form-field__control" + (this.validationMessage ? " failed__valid" : "") },
|
|
20
|
+
children: [
|
|
21
|
+
{
|
|
22
|
+
tag: "label",
|
|
23
|
+
attr: { for: this.id, class: "form-field__label" },
|
|
24
|
+
content: this.options.label +
|
|
25
|
+
(this.options.required ? " *" : "") +
|
|
26
|
+
(this.validationMessage ? (" " + ((_b = this.validationMessage) !== null && _b !== void 0 ? _b : "")) : "")
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
tag: "input",
|
|
30
|
+
attr: {
|
|
31
|
+
id: this.id,
|
|
32
|
+
type: this.type,
|
|
33
|
+
value: this.options.value,
|
|
34
|
+
maxLength: this.options.maxLength,
|
|
35
|
+
class: "form-field__input",
|
|
36
|
+
blur: this.setInActive,
|
|
37
|
+
focus: this.setActive,
|
|
38
|
+
input: this.onInput
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}]
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
FormFieldComponent.prototype.onCreate = function (node) {
|
|
46
|
+
var InputDom = node.dom.firstElementChild.children[1];
|
|
47
|
+
if (this.options.type === "number") {
|
|
48
|
+
NumberInput(InputDom, this.options.numberOptions);
|
|
49
|
+
}
|
|
50
|
+
else if (this.options.type === "date") {
|
|
51
|
+
this.datepickerRef = DatePicker(InputDom, this.options.dateOptions);
|
|
52
|
+
}
|
|
53
|
+
else if (this.options.type === "autosuggest") {
|
|
54
|
+
AutoSuggest(InputDom, this.options.autoSuggestOptions);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
FormFieldComponent.prototype.onRemove = function (node) {
|
|
58
|
+
if (this.datepickerRef != null) {
|
|
59
|
+
this.datepickerRef.destroy();
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
FormFieldComponent.prototype.validate = function () {
|
|
63
|
+
var value = this.getValue();
|
|
64
|
+
if (this.options.required && !value) {
|
|
65
|
+
this.validationMessage = " ";
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
if (this.options.onValidate) {
|
|
69
|
+
var validationResult = this.options.onValidate(value);
|
|
70
|
+
if (validationResult === false) {
|
|
71
|
+
this.validationMessage = " ";
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
if (validationResult !== true) {
|
|
75
|
+
this.validationMessage = validationResult;
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
this.validationMessage = null;
|
|
80
|
+
return true;
|
|
81
|
+
};
|
|
82
|
+
FormFieldComponent.prototype.getValue = function () {
|
|
83
|
+
var _a;
|
|
84
|
+
return (_a = document.getElementById(this.id)) === null || _a === void 0 ? void 0 : _a.value;
|
|
85
|
+
};
|
|
86
|
+
FormFieldComponent.prototype.setValue = function (value) {
|
|
87
|
+
var el = document.getElementById(this.id);
|
|
88
|
+
if (el == null) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
el.value = value || "";
|
|
92
|
+
if (value) {
|
|
93
|
+
el.parentElement.classList.add("form-field--is-filled");
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
el.parentElement.classList.remove("form-field--is-filled");
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
FormFieldComponent.prototype.setInActive = function (evt, node) {
|
|
100
|
+
var formField = node.dom.parentElement.parentElement;
|
|
101
|
+
if (formField == null) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
setTimeout(function () {
|
|
105
|
+
formField.classList.remove("form-field--is-active");
|
|
106
|
+
if (node.dom.value === "") {
|
|
107
|
+
formField.classList.remove("form-field--is-filled");
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
formField.classList.add("form-field--is-filled");
|
|
111
|
+
}
|
|
112
|
+
}, 250);
|
|
113
|
+
if (this.options.onBlur) {
|
|
114
|
+
this.options.onBlur(evt, node);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
return false;
|
|
118
|
+
};
|
|
119
|
+
FormFieldComponent.prototype.setActive = function (evt, node) {
|
|
120
|
+
var formField = node.dom.parentElement.parentElement;
|
|
121
|
+
if (formField == null) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
formField.classList.add("form-field--is-active");
|
|
125
|
+
if (this.options.onFocus) {
|
|
126
|
+
this.options.onFocus(evt, node);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
return false;
|
|
130
|
+
};
|
|
131
|
+
FormFieldComponent.prototype.onInput = function (evt, node) {
|
|
132
|
+
if (this.options.onInput) {
|
|
133
|
+
this.options.onInput(evt, node);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
return FormFieldComponent;
|
|
138
|
+
}());
|
|
139
|
+
export { FormFieldComponent };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
|
|
2
|
+
$primary-color: #3B99FF;
|
|
3
|
+
$animation-duration: 0.4s;
|
|
4
|
+
|
|
5
|
+
@mixin label-active() {
|
|
6
|
+
font-size: 0.7em;
|
|
7
|
+
transform: translateY(-14px);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.form-field {
|
|
11
|
+
display: block;
|
|
12
|
+
margin-bottom: 16px;
|
|
13
|
+
|
|
14
|
+
.failed__valid {
|
|
15
|
+
.form-field__input {
|
|
16
|
+
border-color: #cc0000!important;
|
|
17
|
+
}
|
|
18
|
+
.form-field__label {
|
|
19
|
+
color: #aa0000!important;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&--is-active {
|
|
24
|
+
.form-field__control {
|
|
25
|
+
&::after {
|
|
26
|
+
border-bottom: 2px solid $primary-color;
|
|
27
|
+
transform: scaleX(150);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
.form-field__label {
|
|
31
|
+
color: $primary-color;
|
|
32
|
+
@include label-active();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
&--is-filled {
|
|
36
|
+
.form-field__label {
|
|
37
|
+
@include label-active();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
.form-field__label {
|
|
42
|
+
color:#606060;
|
|
43
|
+
display: block;
|
|
44
|
+
font-weight: normal;
|
|
45
|
+
left: 0;
|
|
46
|
+
margin: 0;
|
|
47
|
+
padding: 1rem 0.5rem 0 ;
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: 0;
|
|
50
|
+
transition: all $animation-duration;
|
|
51
|
+
width: 100%;
|
|
52
|
+
}
|
|
53
|
+
.form-field__control {
|
|
54
|
+
background: #f6f6f6;
|
|
55
|
+
border-radius: 0.3rem 0.3rem 0 0;
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
position: relative;
|
|
58
|
+
width: 100%;
|
|
59
|
+
|
|
60
|
+
&::after {
|
|
61
|
+
border-bottom: 2px solid $primary-color;
|
|
62
|
+
bottom: 0;
|
|
63
|
+
content: "";
|
|
64
|
+
display: block;
|
|
65
|
+
left: 0;
|
|
66
|
+
margin: 0 auto;
|
|
67
|
+
position: absolute;
|
|
68
|
+
right: 0;
|
|
69
|
+
transform: scaleX(0);
|
|
70
|
+
transition: all $animation-duration;
|
|
71
|
+
width: 1%;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
.form-field__input,
|
|
75
|
+
.form-field__textarea {
|
|
76
|
+
box-sizing: border-box;
|
|
77
|
+
border:none;
|
|
78
|
+
appearance: none;
|
|
79
|
+
background: transparent;
|
|
80
|
+
border-bottom: 1px solid #999;
|
|
81
|
+
color: #333;
|
|
82
|
+
display: block;
|
|
83
|
+
margin-top: 1.3rem;
|
|
84
|
+
outline: 0;
|
|
85
|
+
padding: 0 0.3rem 0.2rem 0.3rem;
|
|
86
|
+
width: 100%;
|
|
87
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ISlickColumn } from "../../grid/slick.core";
|
|
2
|
+
import { ISlickCreatorOptions, IJSLGrid } from "../../grid/slick.creator";
|
|
3
|
+
import { IJSLComponent, IJSLVNode } from "jsl-render";
|
|
4
|
+
export declare class GridComponent<T> implements IJSLComponent {
|
|
5
|
+
private data;
|
|
6
|
+
private columns;
|
|
7
|
+
private options;
|
|
8
|
+
private gridRef;
|
|
9
|
+
private ref;
|
|
10
|
+
private refResolver;
|
|
11
|
+
private currentlyVisible;
|
|
12
|
+
private checkVisibleTimeout;
|
|
13
|
+
private rootTag;
|
|
14
|
+
private initEventsFnc;
|
|
15
|
+
constructor(data: Promise<T[]> | T[], columns: ISlickColumn[], options: ISlickCreatorOptions, height?: string);
|
|
16
|
+
getRootTag(): IJSLVNode;
|
|
17
|
+
getRef(): Promise<IJSLGrid<T>>;
|
|
18
|
+
initEvents(fnc: (grid: IJSLGrid<T>) => void): void;
|
|
19
|
+
onCreate(vnode: IJSLVNode): void;
|
|
20
|
+
onRemove(vnode: IJSLVNode): void;
|
|
21
|
+
render(): IJSLVNode;
|
|
22
|
+
private checkVisibility;
|
|
23
|
+
private resizeEventListener;
|
|
24
|
+
private anyInputIsFocused;
|
|
25
|
+
private isVisible;
|
|
26
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { Slick } from "../../grid/slick.core";
|
|
2
|
+
import { createJSLGrid } from "../../grid/slick.creator";
|
|
3
|
+
var GridComponent = /** @class */ (function () {
|
|
4
|
+
function GridComponent(data, columns, options, height) {
|
|
5
|
+
var _this = this;
|
|
6
|
+
this.data = data;
|
|
7
|
+
this.columns = columns;
|
|
8
|
+
this.options = options;
|
|
9
|
+
this.currentlyVisible = true;
|
|
10
|
+
this.checkVisibleTimeout = 0;
|
|
11
|
+
this.initEventsFnc = [];
|
|
12
|
+
this.resizeEventListener = function () {
|
|
13
|
+
_this.ref.then(function (g) {
|
|
14
|
+
if (_this.isVisible(g) && !_this.anyInputIsFocused()) {
|
|
15
|
+
g.resizeCanvas();
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
var style = "";
|
|
20
|
+
if (!options.autoHeight) {
|
|
21
|
+
style = "height:" + (height !== null && height !== void 0 ? height : "400px");
|
|
22
|
+
}
|
|
23
|
+
this.rootTag = {
|
|
24
|
+
tag: "div",
|
|
25
|
+
attr: {
|
|
26
|
+
style: style
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
this.ref = new Promise(function (resolve, reject) {
|
|
30
|
+
_this.refResolver = resolve;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
GridComponent.prototype.getRootTag = function () {
|
|
34
|
+
return this.rootTag;
|
|
35
|
+
};
|
|
36
|
+
GridComponent.prototype.getRef = function () {
|
|
37
|
+
return this.ref;
|
|
38
|
+
};
|
|
39
|
+
GridComponent.prototype.initEvents = function (fnc) {
|
|
40
|
+
this.initEventsFnc.push(fnc);
|
|
41
|
+
};
|
|
42
|
+
GridComponent.prototype.onCreate = function (vnode) {
|
|
43
|
+
var _this = this;
|
|
44
|
+
// let grid;
|
|
45
|
+
setTimeout(function () {
|
|
46
|
+
if (Array.isArray(_this.data)) {
|
|
47
|
+
_this.gridRef = createJSLGrid(vnode.dom, _this.data, _this.columns, _this.options);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
var rawData_1 = [];
|
|
51
|
+
_this.gridRef = createJSLGrid(vnode.dom, rawData_1, _this.columns, _this.options);
|
|
52
|
+
_this.data.then(function (result) {
|
|
53
|
+
for (var i = 0; i < result.length; i++) {
|
|
54
|
+
rawData_1.push(result[i]);
|
|
55
|
+
}
|
|
56
|
+
_this.gridRef.refreshData();
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
_this.refResolver(_this.gridRef);
|
|
60
|
+
for (var idx = 0; idx < _this.initEventsFnc.length; idx++) {
|
|
61
|
+
_this.initEventsFnc[idx](_this.gridRef);
|
|
62
|
+
}
|
|
63
|
+
window.addEventListener("resize", _this.resizeEventListener);
|
|
64
|
+
_this.checkVisibility(_this.gridRef);
|
|
65
|
+
}, 1);
|
|
66
|
+
};
|
|
67
|
+
GridComponent.prototype.onRemove = function (vnode) {
|
|
68
|
+
var _this = this;
|
|
69
|
+
if (this.gridRef != null) {
|
|
70
|
+
this.gridRef.destroy();
|
|
71
|
+
this.gridRef = null;
|
|
72
|
+
}
|
|
73
|
+
this.ref = new Promise(function (resolve, reject) {
|
|
74
|
+
_this.refResolver = resolve;
|
|
75
|
+
});
|
|
76
|
+
if (this.checkVisibleTimeout !== 0) {
|
|
77
|
+
clearTimeout(this.checkVisibleTimeout);
|
|
78
|
+
}
|
|
79
|
+
window.removeEventListener("resize", this.resizeEventListener);
|
|
80
|
+
};
|
|
81
|
+
GridComponent.prototype.render = function () {
|
|
82
|
+
return this.rootTag;
|
|
83
|
+
};
|
|
84
|
+
GridComponent.prototype.checkVisibility = function (g) {
|
|
85
|
+
var _this = this;
|
|
86
|
+
if (!this.isVisible(g)) {
|
|
87
|
+
this.currentlyVisible = false;
|
|
88
|
+
this.checkVisibleTimeout = setTimeout(function () { _this.checkVisibility(g); }, 1000);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
if (!this.currentlyVisible) {
|
|
92
|
+
this.currentlyVisible = true;
|
|
93
|
+
g.invalidateAllRows();
|
|
94
|
+
g.resizeCanvas();
|
|
95
|
+
}
|
|
96
|
+
this.checkVisibleTimeout = 0;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
GridComponent.prototype.anyInputIsFocused = function () {
|
|
100
|
+
// this check is necessary because of mobile virtual keyboard
|
|
101
|
+
// -> virtual keyboard triggers window resize event -> which would reset any editors
|
|
102
|
+
return Slick.GlobalEditorLock.isActive() && document.querySelector("input:focus") != null;
|
|
103
|
+
};
|
|
104
|
+
GridComponent.prototype.isVisible = function (g) {
|
|
105
|
+
var el = g.getViewportNode().parentElement;
|
|
106
|
+
while (el != null && el !== document.body) {
|
|
107
|
+
if (getComputedStyle(el, null).display === "none") {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
el = el.parentElement;
|
|
111
|
+
}
|
|
112
|
+
return el != null;
|
|
113
|
+
};
|
|
114
|
+
return GridComponent;
|
|
115
|
+
}());
|
|
116
|
+
export { GridComponent };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IJSLComponent, IJSLVNode } from "jsl-render";
|
|
2
|
+
import { EventHandler } from "../../interaction/eventhandler";
|
|
3
|
+
import { IDataConverter } from "../../interaction/dataconverter";
|
|
4
|
+
export interface IInputOptions<T = any> {
|
|
5
|
+
value?: string;
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
class?: string;
|
|
8
|
+
style?: string;
|
|
9
|
+
onChange?: EventHandler<string> | ((v?: string) => void);
|
|
10
|
+
onInput?: EventHandler<string> | ((v?: string) => void);
|
|
11
|
+
id?: string;
|
|
12
|
+
bindTo?: T;
|
|
13
|
+
property?: keyof T;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
converter?: IDataConverter<any, string>;
|
|
16
|
+
bindMode?: "toModel" | "fromModel" | "both";
|
|
17
|
+
bindOnInput?: boolean;
|
|
18
|
+
maxLength?: number;
|
|
19
|
+
type?: "input" | "text" | "password" | "textarea" | "color";
|
|
20
|
+
}
|
|
21
|
+
export declare class InputComponent<T = any> implements IJSLComponent {
|
|
22
|
+
private options;
|
|
23
|
+
private currentDom;
|
|
24
|
+
get onChange(): EventHandler<string>;
|
|
25
|
+
get onInput(): EventHandler<string>;
|
|
26
|
+
constructor(options: IInputOptions<T>);
|
|
27
|
+
render(): IJSLVNode;
|
|
28
|
+
getValue(): string;
|
|
29
|
+
setValue(value: string): void;
|
|
30
|
+
onCreate(node: IJSLVNode): void;
|
|
31
|
+
private raiseChangeEvent;
|
|
32
|
+
private raiseInputEvent;
|
|
33
|
+
}
|