jsl-ui 9.20.9 → 9.20.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/lib/components/IntervalComponent.d.ts +17 -17
  2. package/lib/components/IntervalComponent.js +68 -68
  3. package/lib/components/auto-suggest/AutoSuggestComponent.d.ts +22 -22
  4. package/lib/components/auto-suggest/AutoSuggestComponent.js +49 -49
  5. package/lib/components/button/ButtonComponent.d.ts +18 -18
  6. package/lib/components/button/ButtonComponent.js +46 -46
  7. package/lib/components/checkbox/CheckBoxComponent.d.ts +28 -28
  8. package/lib/components/checkbox/CheckBoxComponent.js +98 -98
  9. package/lib/components/date/DateComponent.d.ts +32 -32
  10. package/lib/components/date/DateComponent.js +106 -106
  11. package/lib/components/date-range/DateRangeComponent.d.ts +35 -35
  12. package/lib/components/date-range/DateRangeComponent.js +136 -136
  13. package/lib/components/date-time/DateTimeComponent.d.ts +15 -15
  14. package/lib/components/date-time/DateTimeComponent.js +53 -53
  15. package/lib/components/dialog/DialogComponent.d.ts +67 -67
  16. package/lib/components/dialog/DialogComponent.js +251 -251
  17. package/lib/components/drop-down/DropDownComponent.d.ts +27 -27
  18. package/lib/components/drop-down/DropDownComponent.js +74 -74
  19. package/lib/components/expander/ExpanderComponent.d.ts +27 -27
  20. package/lib/components/expander/ExpanderComponent.js +90 -90
  21. package/lib/components/form-field/FormComponent.d.ts +12 -12
  22. package/lib/components/form-field/FormComponent.js +26 -26
  23. package/lib/components/form-field/FormFieldComponent.d.ts +39 -39
  24. package/lib/components/form-field/FormFieldComponent.js +140 -140
  25. package/lib/components/grid/GridComponent.d.ts +26 -26
  26. package/lib/components/grid/GridComponent.js +116 -116
  27. package/lib/components/input/InputComponent.d.ts +33 -33
  28. package/lib/components/input/InputComponent.js +145 -145
  29. package/lib/components/loading/LoadingComponent.d.ts +8 -8
  30. package/lib/components/loading/LoadingComponent.js +22 -22
  31. package/lib/components/navigation/NavigationComponent.d.ts +34 -34
  32. package/lib/components/navigation/NavigationComponent.js +70 -70
  33. package/lib/components/notification/Notification.d.ts +17 -17
  34. package/lib/components/notification/Notification.js +56 -56
  35. package/lib/components/number/NumberComponent.d.ts +25 -25
  36. package/lib/components/number/NumberComponent.js +87 -87
  37. package/lib/components/overlay/OverlayComponent.d.ts +27 -27
  38. package/lib/components/overlay/OverlayComponent.js +149 -149
  39. package/lib/components/progress/ProgressComponent.d.ts +18 -18
  40. package/lib/components/progress/ProgressComponent.js +42 -42
  41. package/lib/components/ribbon-menu/RibbonMenuComponent.d.ts +12 -12
  42. package/lib/components/ribbon-menu/RibbonMenuComponent.js +34 -34
  43. package/lib/components/select/SelectComponent.d.ts +79 -79
  44. package/lib/components/select/SelectComponent.js +369 -367
  45. package/lib/components/select/SelectDDAreaComponent.d.ts +32 -32
  46. package/lib/components/select/SelectDDAreaComponent.js +317 -317
  47. package/lib/components/slider/nouislider.d.ts +44 -44
  48. package/lib/components/slider/nouislider.js +2158 -2158
  49. package/lib/components/stack-panel/SplitterComponent.d.ts +21 -21
  50. package/lib/components/stack-panel/SplitterComponent.js +126 -126
  51. package/lib/components/stack-panel/StackPanelComponent.d.ts +20 -20
  52. package/lib/components/stack-panel/StackPanelComponent.js +64 -64
  53. package/lib/components/tabs/TabsComponent.d.ts +40 -40
  54. package/lib/components/tabs/TabsComponent.js +204 -204
  55. package/lib/components/time/TimeComponent.d.ts +29 -29
  56. package/lib/components/time/TimeComponent.js +113 -113
  57. package/lib/components/tree-view/TreeViewComponent.d.ts +23 -23
  58. package/lib/components/tree-view/TreeViewComponent.js +45 -45
  59. package/lib/components/virtual-render/VirtualRenderComponent.d.ts +30 -30
  60. package/lib/components/virtual-render/VirtualRenderComponent.js +104 -104
  61. package/lib/core/culture.d.ts +5 -5
  62. package/lib/core/culture.js +385 -385
  63. package/lib/core/date.d.ts +14 -14
  64. package/lib/core/date.js +350 -350
  65. package/lib/core/helper.d.ts +13 -13
  66. package/lib/core/helper.js +104 -104
  67. package/lib/core/jq.d.ts +37 -37
  68. package/lib/core/jq.js +371 -371
  69. package/lib/core/lang.d.ts +24 -24
  70. package/lib/core/lang.js +28 -28
  71. package/lib/core/numeric.d.ts +7 -7
  72. package/lib/core/numeric.js +143 -143
  73. package/lib/core/polyfills.js +22 -22
  74. package/lib/core.d.ts +6 -6
  75. package/lib/core.js +6 -6
  76. package/lib/grid/filterDialogs/dateRangeFilter.d.ts +7 -7
  77. package/lib/grid/filterDialogs/dateRangeFilter.js +156 -156
  78. package/lib/grid/filterDialogs/excelFilter.d.ts +9 -9
  79. package/lib/grid/filterDialogs/excelFilter.js +314 -314
  80. package/lib/grid/plugins/ext.overlay.d.ts +2 -2
  81. package/lib/grid/plugins/ext.overlay.js +291 -291
  82. package/lib/grid/plugins/slick.cellrangedecorator.d.ts +12 -12
  83. package/lib/grid/plugins/slick.cellrangedecorator.js +68 -68
  84. package/lib/grid/plugins/slick.cellrangeselector.d.ts +1 -1
  85. package/lib/grid/plugins/slick.cellrangeselector.js +144 -144
  86. package/lib/grid/plugins/slick.cellselectionmodel.d.ts +1 -1
  87. package/lib/grid/plugins/slick.cellselectionmodel.js +194 -194
  88. package/lib/grid/plugins/slick.headerbuttons.d.ts +55 -55
  89. package/lib/grid/plugins/slick.headerbuttons.js +156 -156
  90. package/lib/grid/plugins/slick.headermenu.d.ts +74 -74
  91. package/lib/grid/plugins/slick.headermenu.js +260 -260
  92. package/lib/grid/plugins/slick.rowmovemanager.d.ts +18 -18
  93. package/lib/grid/plugins/slick.rowmovemanager.js +249 -249
  94. package/lib/grid/plugins/slick.rowselectionmodel.d.ts +1 -1
  95. package/lib/grid/plugins/slick.rowselectionmodel.js +167 -167
  96. package/lib/grid/slick.core.d.ts +91 -91
  97. package/lib/grid/slick.core.js +574 -574
  98. package/lib/grid/slick.creator.d.ts +80 -80
  99. package/lib/grid/slick.creator.js +725 -725
  100. package/lib/grid/slick.dataview.d.ts +71 -71
  101. package/lib/grid/slick.dataview.js +1080 -1080
  102. package/lib/grid/slick.editors.core.d.ts +4 -4
  103. package/lib/grid/slick.editors.core.js +235 -235
  104. package/lib/grid/slick.editors.date.d.ts +2 -2
  105. package/lib/grid/slick.editors.date.js +125 -125
  106. package/lib/grid/slick.editors.lookup.d.ts +14 -14
  107. package/lib/grid/slick.editors.lookup.js +353 -353
  108. package/lib/grid/slick.editors.nav.d.ts +6 -6
  109. package/lib/grid/slick.editors.nav.js +22 -22
  110. package/lib/grid/slick.formatters.d.ts +17 -17
  111. package/lib/grid/slick.formatters.js +137 -137
  112. package/lib/grid/slick.grid.d.ts +284 -284
  113. package/lib/grid/slick.grid.js +5408 -5408
  114. package/lib/grid/slick.groupitemmetadataprovider.d.ts +39 -39
  115. package/lib/grid/slick.groupitemmetadataprovider.js +165 -165
  116. package/lib/grid/slick.tree.d.ts +33 -33
  117. package/lib/grid/slick.tree.js +220 -220
  118. package/lib/grid.d.ts +13 -13
  119. package/lib/grid.js +13 -13
  120. package/lib/index.d.ts +56 -56
  121. package/lib/index.js +61 -61
  122. package/lib/index.js.map +1 -1
  123. package/lib/interaction/dataconverter.d.ts +4 -4
  124. package/lib/interaction/dataconverter.js +1 -1
  125. package/lib/interaction/eventhandler.d.ts +13 -13
  126. package/lib/interaction/eventhandler.js +42 -42
  127. package/lib/interaction/moveable.d.ts +39 -39
  128. package/lib/interaction/moveable.js +172 -172
  129. package/lib/interaction/resizable.d.ts +37 -37
  130. package/lib/interaction/resizable.js +123 -123
  131. package/lib/ui/auto.suggest.d.ts +18 -18
  132. package/lib/ui/auto.suggest.js +259 -259
  133. package/lib/ui/date.picker/date-picker-options.d.ts +11 -11
  134. package/lib/ui/date.picker/date-picker-options.js +76 -76
  135. package/lib/ui/date.picker/lib/date-manip.d.ts +74 -74
  136. package/lib/ui/date.picker/lib/date-manip.js +120 -120
  137. package/lib/ui/date.picker/lib/dom.d.ts +23 -23
  138. package/lib/ui/date.picker/lib/dom.js +28 -28
  139. package/lib/ui/date.picker/lib/emitter.d.ts +13 -13
  140. package/lib/ui/date.picker/lib/emitter.js +49 -49
  141. package/lib/ui/date.picker/lib/fns.d.ts +23 -23
  142. package/lib/ui/date.picker/lib/fns.js +43 -43
  143. package/lib/ui/date.picker/mode/base-mode.d.ts +26 -26
  144. package/lib/ui/date.picker/mode/base-mode.js +248 -248
  145. package/lib/ui/date.picker/mode/dropdown-mode.d.ts +28 -28
  146. package/lib/ui/date.picker/mode/dropdown-mode.js +50 -50
  147. package/lib/ui/date.picker/mode/index.d.ts +28 -28
  148. package/lib/ui/date.picker/mode/index.js +18 -18
  149. package/lib/ui/date.picker/mode/modal-mode.d.ts +25 -25
  150. package/lib/ui/date.picker/mode/modal-mode.js +17 -17
  151. package/lib/ui/date.picker/mode/permanent-mode.d.ts +29 -29
  152. package/lib/ui/date.picker/mode/permanent-mode.js +19 -19
  153. package/lib/ui/date.picker/views/day-picker.d.ts +40 -40
  154. package/lib/ui/date.picker/views/day-picker.js +155 -155
  155. package/lib/ui/date.picker/views/month-picker.d.ts +26 -26
  156. package/lib/ui/date.picker/views/month-picker.js +65 -65
  157. package/lib/ui/date.picker/views/year-picker.d.ts +20 -20
  158. package/lib/ui/date.picker/views/year-picker.js +66 -66
  159. package/lib/ui/date.picker.d.ts +66 -66
  160. package/lib/ui/date.picker.js +32 -32
  161. package/lib/ui/dialog.d.ts +22 -22
  162. package/lib/ui/dialog.js +113 -113
  163. package/lib/ui/drop.down.d.ts +52 -52
  164. package/lib/ui/drop.down.js +2112 -2112
  165. package/lib/ui/number.input.d.ts +12 -12
  166. package/lib/ui/number.input.js +64 -64
  167. package/package.json +1 -1
@@ -1,74 +1,74 @@
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 { DropDown } from "../../ui/drop.down";
13
- import { EventHandler } from "../../interaction/eventhandler";
14
- var DropDownComponent = /** @class */ (function () {
15
- function DropDownComponent(options) {
16
- var _a;
17
- this.options = __assign({ enabled: true }, options);
18
- this.options.onChange = EventHandler.Create(this.options.onChange);
19
- if (this.options.bindTo != null && this.options.property != null && this.options.value == null) {
20
- this.options.value = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
21
- this.options.converter.toUI(this.options.bindTo[this.options.property]) :
22
- this.options.bindTo[this.options.property]);
23
- }
24
- }
25
- DropDownComponent.prototype.render = function () {
26
- return {
27
- tag: "select"
28
- };
29
- };
30
- DropDownComponent.prototype.getRef = function () {
31
- return this.ref;
32
- };
33
- DropDownComponent.prototype.onCreate = function (node) {
34
- var _this = this;
35
- this.ref = DropDown(node.dom, this.options);
36
- if (!this.options.enabled) {
37
- this.ref.disable();
38
- }
39
- node.dom.parentElement.classList.add(this.options.class);
40
- if (this.options.width) {
41
- node.dom.parentElement.style.display = "inline-block";
42
- }
43
- node.dom.addEventListener("change", function (evt) {
44
- var _a;
45
- var value;
46
- if (_this.options.multiple) {
47
- value = Array.prototype.slice.call(node.dom.querySelectorAll("option:checked"), 0).map(function (v) { return v.value; });
48
- }
49
- else {
50
- value = node.dom.value;
51
- }
52
- if (_this.options.bindTo != null && _this.options.property != null) {
53
- _this.options.bindTo[_this.options.property] =
54
- ((_a = _this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? _this.options.converter.toData(value) : value;
55
- }
56
- if (_this.options.onSelect != null) {
57
- _this.options.onSelect(value);
58
- }
59
- if (_this.options.onChange != null) {
60
- _this.options.onChange.notify(value);
61
- }
62
- });
63
- if (this.options.value != null) {
64
- this.ref.setValue(this.options.value);
65
- }
66
- };
67
- DropDownComponent.prototype.onRemove = function () {
68
- if (this.ref != null) {
69
- this.ref.destroy();
70
- }
71
- };
72
- return DropDownComponent;
73
- }());
74
- export { DropDownComponent };
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 { DropDown } from "../../ui/drop.down";
13
+ import { EventHandler } from "../../interaction/eventhandler";
14
+ var DropDownComponent = /** @class */ (function () {
15
+ function DropDownComponent(options) {
16
+ var _a;
17
+ this.options = __assign({ enabled: true }, options);
18
+ this.options.onChange = EventHandler.Create(this.options.onChange);
19
+ if (this.options.bindTo != null && this.options.property != null && this.options.value == null) {
20
+ this.options.value = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
21
+ this.options.converter.toUI(this.options.bindTo[this.options.property]) :
22
+ this.options.bindTo[this.options.property]);
23
+ }
24
+ }
25
+ DropDownComponent.prototype.render = function () {
26
+ return {
27
+ tag: "select"
28
+ };
29
+ };
30
+ DropDownComponent.prototype.getRef = function () {
31
+ return this.ref;
32
+ };
33
+ DropDownComponent.prototype.onCreate = function (node) {
34
+ var _this = this;
35
+ this.ref = DropDown(node.dom, this.options);
36
+ if (!this.options.enabled) {
37
+ this.ref.disable();
38
+ }
39
+ node.dom.parentElement.classList.add(this.options.class);
40
+ if (this.options.width) {
41
+ node.dom.parentElement.style.display = "inline-block";
42
+ }
43
+ node.dom.addEventListener("change", function (evt) {
44
+ var _a;
45
+ var value;
46
+ if (_this.options.multiple) {
47
+ value = Array.prototype.slice.call(node.dom.querySelectorAll("option:checked"), 0).map(function (v) { return v.value; });
48
+ }
49
+ else {
50
+ value = node.dom.value;
51
+ }
52
+ if (_this.options.bindTo != null && _this.options.property != null) {
53
+ _this.options.bindTo[_this.options.property] =
54
+ ((_a = _this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? _this.options.converter.toData(value) : value;
55
+ }
56
+ if (_this.options.onSelect != null) {
57
+ _this.options.onSelect(value);
58
+ }
59
+ if (_this.options.onChange != null) {
60
+ _this.options.onChange.notify(value);
61
+ }
62
+ });
63
+ if (this.options.value != null) {
64
+ this.ref.setValue(this.options.value);
65
+ }
66
+ };
67
+ DropDownComponent.prototype.onRemove = function () {
68
+ if (this.ref != null) {
69
+ this.ref.destroy();
70
+ }
71
+ };
72
+ return DropDownComponent;
73
+ }());
74
+ export { DropDownComponent };
@@ -1,27 +1,27 @@
1
- import "./ExpanderStyle.scss";
2
- import { IJSLComponent, IJSLVNode } from "jsl-render";
3
- export interface IExpanderOptions {
4
- header: IJSLVNode | string | IJSLComponent;
5
- body: IJSLVNode | string | IJSLComponent;
6
- expanded?: boolean;
7
- onToggle?: (isExpanding: boolean) => void | boolean;
8
- expandedIcon?: IJSLVNode;
9
- collapsedIcon?: IJSLVNode;
10
- isToggleOnHeader?: boolean;
11
- class?: string;
12
- style?: string;
13
- iconSize?: string;
14
- }
15
- export declare class ExpanderComponent implements IJSLComponent {
16
- State: {
17
- expanded: boolean;
18
- waitingForAnimation: boolean;
19
- };
20
- private options;
21
- constructor(optionsOrHeader: IExpanderOptions | IJSLVNode | string | IJSLComponent, body?: IJSLVNode | string | IJSLComponent, expanded?: boolean);
22
- getIcon(expanded: boolean): IJSLVNode;
23
- isEqual(node: IJSLComponent): boolean;
24
- render(): IJSLVNode;
25
- private toggleExpand;
26
- private toNode;
27
- }
1
+ import "./ExpanderStyle.scss";
2
+ import { IJSLComponent, IJSLVNode } from "jsl-render";
3
+ export interface IExpanderOptions {
4
+ header: IJSLVNode | string | IJSLComponent;
5
+ body: IJSLVNode | string | IJSLComponent;
6
+ expanded?: boolean;
7
+ onToggle?: (isExpanding: boolean) => void | boolean;
8
+ expandedIcon?: IJSLVNode;
9
+ collapsedIcon?: IJSLVNode;
10
+ isToggleOnHeader?: boolean;
11
+ class?: string;
12
+ style?: string;
13
+ iconSize?: string;
14
+ }
15
+ export declare class ExpanderComponent implements IJSLComponent {
16
+ State: {
17
+ expanded: boolean;
18
+ waitingForAnimation: boolean;
19
+ };
20
+ private options;
21
+ constructor(optionsOrHeader: IExpanderOptions | IJSLVNode | string | IJSLComponent, body?: IJSLVNode | string | IJSLComponent, expanded?: boolean);
22
+ getIcon(expanded: boolean): IJSLVNode;
23
+ isEqual(node: IJSLComponent): boolean;
24
+ render(): IJSLVNode;
25
+ private toggleExpand;
26
+ private toNode;
27
+ }
@@ -1,90 +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 };
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 };
@@ -1,12 +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
- }
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
+ }
@@ -1,26 +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 };
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 };
@@ -1,39 +1,39 @@
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
- disabled?: boolean;
8
- id?: string;
9
- label: string;
10
- type?: "text" | "password" | "date" | "number" | "autosuggest";
11
- dateOptions?: IDatePickerOptions;
12
- numberOptions?: INumberInputOptions;
13
- autoSuggestOptions?: IAutoSuggestOptions;
14
- value?: string;
15
- maxLength?: number;
16
- class?: string;
17
- required?: boolean;
18
- onValidate?: (val: string) => boolean | string;
19
- onBlur?: (evt: any, input: IJSLVNode) => void;
20
- onFocus?: (evt: any, input: IJSLVNode) => void;
21
- onInput?: (evt: any, input: IJSLVNode) => void;
22
- }
23
- export declare class FormFieldComponent implements IJSLComponent {
24
- private options;
25
- private id;
26
- private type;
27
- private datepickerRef;
28
- private validationMessage;
29
- constructor(options: IFormFieldOptions);
30
- render(): IJSLVNode;
31
- onCreate(node: IJSLVNode): void;
32
- onRemove(node: IJSLVNode): void;
33
- validate(): boolean;
34
- getValue(): string;
35
- setValue(value: string): void;
36
- private setInActive;
37
- private setActive;
38
- private onInput;
39
- }
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
+ disabled?: boolean;
8
+ id?: string;
9
+ label: string;
10
+ type?: "text" | "password" | "date" | "number" | "autosuggest";
11
+ dateOptions?: IDatePickerOptions;
12
+ numberOptions?: INumberInputOptions;
13
+ autoSuggestOptions?: IAutoSuggestOptions;
14
+ value?: string;
15
+ maxLength?: number;
16
+ class?: string;
17
+ required?: boolean;
18
+ onValidate?: (val: string) => boolean | string;
19
+ onBlur?: (evt: any, input: IJSLVNode) => void;
20
+ onFocus?: (evt: any, input: IJSLVNode) => void;
21
+ onInput?: (evt: any, input: IJSLVNode) => void;
22
+ }
23
+ export declare class FormFieldComponent implements IJSLComponent {
24
+ private options;
25
+ private id;
26
+ private type;
27
+ private datepickerRef;
28
+ private validationMessage;
29
+ constructor(options: IFormFieldOptions);
30
+ render(): IJSLVNode;
31
+ onCreate(node: IJSLVNode): void;
32
+ onRemove(node: IJSLVNode): void;
33
+ validate(): boolean;
34
+ getValue(): string;
35
+ setValue(value: string): void;
36
+ private setInActive;
37
+ private setActive;
38
+ private onInput;
39
+ }