jsl-ui 9.18.2 → 9.18.3

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 (214) hide show
  1. package/lib/grid.css +0 -8
  2. package/lib/index.css.map +1 -1
  3. package/lib/index.js +10198 -61
  4. package/lib/index.js.map +1 -1
  5. package/package.json +1 -1
  6. package/lib/components/IntervalComponent.d.ts +0 -17
  7. package/lib/components/IntervalComponent.js +0 -68
  8. package/lib/components/auto-suggest/AutoSuggestComponent.d.ts +0 -22
  9. package/lib/components/auto-suggest/AutoSuggestComponent.js +0 -49
  10. package/lib/components/button/ButtonComponent.d.ts +0 -18
  11. package/lib/components/button/ButtonComponent.js +0 -46
  12. package/lib/components/checkbox/CheckBoxComponent.d.ts +0 -28
  13. package/lib/components/checkbox/CheckBoxComponent.js +0 -94
  14. package/lib/components/checkbox/CheckBoxStyle.scss +0 -86
  15. package/lib/components/date/DateComponent.d.ts +0 -32
  16. package/lib/components/date/DateComponent.js +0 -106
  17. package/lib/components/date-range/DateRangeComponent.d.ts +0 -35
  18. package/lib/components/date-range/DateRangeComponent.js +0 -136
  19. package/lib/components/date-range/DateRangeStyle.scss +0 -12
  20. package/lib/components/date-time/DateTimeComponent.d.ts +0 -15
  21. package/lib/components/date-time/DateTimeComponent.js +0 -53
  22. package/lib/components/date-time/DateTimeStyle.scss +0 -7
  23. package/lib/components/dialog/DialogComponent.d.ts +0 -67
  24. package/lib/components/dialog/DialogComponent.js +0 -242
  25. package/lib/components/drop-down/DropDownComponent.d.ts +0 -27
  26. package/lib/components/drop-down/DropDownComponent.js +0 -74
  27. package/lib/components/expander/ExpanderComponent.d.ts +0 -27
  28. package/lib/components/expander/ExpanderComponent.js +0 -90
  29. package/lib/components/expander/ExpanderStyle.scss +0 -47
  30. package/lib/components/expander/OldExpanderStyle.scss +0 -37
  31. package/lib/components/form-field/FormComponent.d.ts +0 -12
  32. package/lib/components/form-field/FormComponent.js +0 -26
  33. package/lib/components/form-field/FormFieldComponent.d.ts +0 -38
  34. package/lib/components/form-field/FormFieldComponent.js +0 -139
  35. package/lib/components/form-field/FormFieldStyle.scss +0 -87
  36. package/lib/components/grid/GridComponent.d.ts +0 -26
  37. package/lib/components/grid/GridComponent.js +0 -116
  38. package/lib/components/input/InputComponent.d.ts +0 -33
  39. package/lib/components/input/InputComponent.js +0 -144
  40. package/lib/components/loading/LoadingComponent.d.ts +0 -8
  41. package/lib/components/loading/LoadingComponent.js +0 -22
  42. package/lib/components/loading/LoadingStyle.css +0 -29
  43. package/lib/components/navigation/NavigationComponent.d.ts +0 -34
  44. package/lib/components/navigation/NavigationComponent.js +0 -70
  45. package/lib/components/navigation/NavigationStyle.scss +0 -226
  46. package/lib/components/notification/Notification.d.ts +0 -17
  47. package/lib/components/notification/Notification.js +0 -56
  48. package/lib/components/notification/Notification.scss +0 -19
  49. package/lib/components/number/NumberComponent.d.ts +0 -25
  50. package/lib/components/number/NumberComponent.js +0 -87
  51. package/lib/components/overlay/OverlayComponent.d.ts +0 -27
  52. package/lib/components/overlay/OverlayComponent.js +0 -149
  53. package/lib/components/overlay/overlay.css +0 -57
  54. package/lib/components/progress/ProgressComponent.d.ts +0 -18
  55. package/lib/components/progress/ProgressComponent.js +0 -42
  56. package/lib/components/progress/ProgressStyle.scss +0 -15
  57. package/lib/components/ribbon-menu/RibbonMenuComponent.d.ts +0 -12
  58. package/lib/components/ribbon-menu/RibbonMenuComponent.js +0 -34
  59. package/lib/components/ribbon-menu/RibbonMenuStyle.scss +0 -76
  60. package/lib/components/select/SelectComponent.d.ts +0 -79
  61. package/lib/components/select/SelectComponent.js +0 -362
  62. package/lib/components/select/SelectDDAreaComponent.d.ts +0 -32
  63. package/lib/components/select/SelectDDAreaComponent.js +0 -317
  64. package/lib/components/select/SelectStyle.scss +0 -187
  65. package/lib/components/slider/nouislider.css +0 -310
  66. package/lib/components/slider/nouislider.d.ts +0 -44
  67. package/lib/components/slider/nouislider.js +0 -2158
  68. package/lib/components/stack-panel/SplitterComponent.d.ts +0 -21
  69. package/lib/components/stack-panel/SplitterComponent.js +0 -126
  70. package/lib/components/stack-panel/SplitterStyle.scss +0 -45
  71. package/lib/components/stack-panel/StackPanelComponent.d.ts +0 -20
  72. package/lib/components/stack-panel/StackPanelComponent.js +0 -64
  73. package/lib/components/stack-panel/StackPanelStyle.scss +0 -53
  74. package/lib/components/tabs/TabsComponent.d.ts +0 -39
  75. package/lib/components/tabs/TabsComponent.js +0 -177
  76. package/lib/components/tabs/TabsStyle.scss +0 -76
  77. package/lib/components/time/TimeComponent.d.ts +0 -29
  78. package/lib/components/time/TimeComponent.js +0 -113
  79. package/lib/components/time/TimeComponent.scss +0 -4
  80. package/lib/components/tree-view/TreeViewComponent.d.ts +0 -23
  81. package/lib/components/tree-view/TreeViewComponent.js +0 -45
  82. package/lib/components/tree-view/TreeViewStyle.scss +0 -96
  83. package/lib/components/virtual-render/VirtualRenderComponent.d.ts +0 -30
  84. package/lib/components/virtual-render/VirtualRenderComponent.js +0 -104
  85. package/lib/components/virtual-render/VirtualRenderStyle.scss +0 -9
  86. package/lib/core/culture.d.ts +0 -5
  87. package/lib/core/culture.js +0 -385
  88. package/lib/core/date.d.ts +0 -14
  89. package/lib/core/date.js +0 -350
  90. package/lib/core/helper.d.ts +0 -12
  91. package/lib/core/helper.js +0 -101
  92. package/lib/core/jq.d.ts +0 -37
  93. package/lib/core/jq.js +0 -371
  94. package/lib/core/lang.d.ts +0 -24
  95. package/lib/core/lang.js +0 -28
  96. package/lib/core/numeric.d.ts +0 -7
  97. package/lib/core/numeric.js +0 -143
  98. package/lib/core/polyfills.d.ts +0 -0
  99. package/lib/core/polyfills.js +0 -22
  100. package/lib/core.d.ts +0 -6
  101. package/lib/core.js +0 -6
  102. package/lib/grid/controls/slick.columnpicker.css +0 -46
  103. package/lib/grid/controls/slick.draggablegrouping.css +0 -52
  104. package/lib/grid/controls/slick.gridmenu.css +0 -127
  105. package/lib/grid/controls/slick.pager.css +0 -41
  106. package/lib/grid/examples/examples.css +0 -203
  107. package/lib/grid/filterDialogs/dateRangeFilter.d.ts +0 -7
  108. package/lib/grid/filterDialogs/dateRangeFilter.js +0 -156
  109. package/lib/grid/filterDialogs/excelFilter.d.ts +0 -9
  110. package/lib/grid/filterDialogs/excelFilter.js +0 -313
  111. package/lib/grid/plugins/ext.overlay.css +0 -28
  112. package/lib/grid/plugins/ext.overlay.d.ts +0 -2
  113. package/lib/grid/plugins/ext.overlay.js +0 -291
  114. package/lib/grid/plugins/slick.cellrangedecorator.d.ts +0 -12
  115. package/lib/grid/plugins/slick.cellrangedecorator.js +0 -68
  116. package/lib/grid/plugins/slick.cellrangeselector.d.ts +0 -1
  117. package/lib/grid/plugins/slick.cellrangeselector.js +0 -144
  118. package/lib/grid/plugins/slick.cellselectionmodel.d.ts +0 -1
  119. package/lib/grid/plugins/slick.cellselectionmodel.js +0 -194
  120. package/lib/grid/plugins/slick.headerbuttons.css +0 -40
  121. package/lib/grid/plugins/slick.headerbuttons.d.ts +0 -55
  122. package/lib/grid/plugins/slick.headerbuttons.js +0 -156
  123. package/lib/grid/plugins/slick.headermenu.css +0 -101
  124. package/lib/grid/plugins/slick.headermenu.d.ts +0 -74
  125. package/lib/grid/plugins/slick.headermenu.js +0 -260
  126. package/lib/grid/plugins/slick.rowdetailview.css +0 -37
  127. package/lib/grid/plugins/slick.rowmovemanager.css +0 -8
  128. package/lib/grid/plugins/slick.rowmovemanager.d.ts +0 -18
  129. package/lib/grid/plugins/slick.rowmovemanager.js +0 -249
  130. package/lib/grid/plugins/slick.rowselectionmodel.d.ts +0 -1
  131. package/lib/grid/plugins/slick.rowselectionmodel.js +0 -167
  132. package/lib/grid/slick-default-theme.css +0 -154
  133. package/lib/grid/slick.core.d.ts +0 -90
  134. package/lib/grid/slick.core.js +0 -574
  135. package/lib/grid/slick.creator.d.ts +0 -80
  136. package/lib/grid/slick.creator.js +0 -723
  137. package/lib/grid/slick.dataview.d.ts +0 -71
  138. package/lib/grid/slick.dataview.js +0 -1080
  139. package/lib/grid/slick.editors.core.d.ts +0 -4
  140. package/lib/grid/slick.editors.core.js +0 -232
  141. package/lib/grid/slick.editors.date.d.ts +0 -2
  142. package/lib/grid/slick.editors.date.js +0 -125
  143. package/lib/grid/slick.editors.lookup.d.ts +0 -14
  144. package/lib/grid/slick.editors.lookup.js +0 -353
  145. package/lib/grid/slick.editors.nav.d.ts +0 -6
  146. package/lib/grid/slick.editors.nav.js +0 -22
  147. package/lib/grid/slick.formatters.d.ts +0 -17
  148. package/lib/grid/slick.formatters.js +0 -137
  149. package/lib/grid/slick.grid.css +0 -325
  150. package/lib/grid/slick.grid.d.ts +0 -284
  151. package/lib/grid/slick.grid.js +0 -5395
  152. package/lib/grid/slick.groupitemmetadataprovider.d.ts +0 -39
  153. package/lib/grid/slick.groupitemmetadataprovider.js +0 -165
  154. package/lib/grid/slick.tree.css +0 -20
  155. package/lib/grid/slick.tree.d.ts +0 -33
  156. package/lib/grid/slick.tree.js +0 -220
  157. package/lib/grid.d.ts +0 -13
  158. package/lib/grid.js +0 -13
  159. package/lib/index.css +0 -2584
  160. package/lib/index.d.ts +0 -56
  161. package/lib/interaction/dataconverter.d.ts +0 -4
  162. package/lib/interaction/dataconverter.js +0 -1
  163. package/lib/interaction/eventhandler.d.ts +0 -13
  164. package/lib/interaction/eventhandler.js +0 -42
  165. package/lib/interaction/moveable.css +0 -0
  166. package/lib/interaction/moveable.d.ts +0 -39
  167. package/lib/interaction/moveable.js +0 -172
  168. package/lib/interaction/resizable.css +0 -33
  169. package/lib/interaction/resizable.d.ts +0 -37
  170. package/lib/interaction/resizable.js +0 -123
  171. package/lib/ui/auto.suggest.css +0 -14
  172. package/lib/ui/auto.suggest.d.ts +0 -17
  173. package/lib/ui/auto.suggest.js +0 -255
  174. package/lib/ui/base.css +0 -150
  175. package/lib/ui/date.picker/css/date-range-picker.css +0 -87
  176. package/lib/ui/date.picker/css/tiny-date-picker.css +0 -326
  177. package/lib/ui/date.picker/date-picker-options.d.ts +0 -11
  178. package/lib/ui/date.picker/date-picker-options.js +0 -76
  179. package/lib/ui/date.picker/lib/date-manip.d.ts +0 -74
  180. package/lib/ui/date.picker/lib/date-manip.js +0 -120
  181. package/lib/ui/date.picker/lib/dom.d.ts +0 -23
  182. package/lib/ui/date.picker/lib/dom.js +0 -28
  183. package/lib/ui/date.picker/lib/emitter.d.ts +0 -13
  184. package/lib/ui/date.picker/lib/emitter.js +0 -49
  185. package/lib/ui/date.picker/lib/fns.d.ts +0 -23
  186. package/lib/ui/date.picker/lib/fns.js +0 -43
  187. package/lib/ui/date.picker/mode/base-mode.d.ts +0 -26
  188. package/lib/ui/date.picker/mode/base-mode.js +0 -248
  189. package/lib/ui/date.picker/mode/dropdown-mode.d.ts +0 -28
  190. package/lib/ui/date.picker/mode/dropdown-mode.js +0 -50
  191. package/lib/ui/date.picker/mode/index.d.ts +0 -28
  192. package/lib/ui/date.picker/mode/index.js +0 -18
  193. package/lib/ui/date.picker/mode/modal-mode.d.ts +0 -25
  194. package/lib/ui/date.picker/mode/modal-mode.js +0 -17
  195. package/lib/ui/date.picker/mode/permanent-mode.d.ts +0 -29
  196. package/lib/ui/date.picker/mode/permanent-mode.js +0 -19
  197. package/lib/ui/date.picker/views/day-picker.d.ts +0 -40
  198. package/lib/ui/date.picker/views/day-picker.js +0 -155
  199. package/lib/ui/date.picker/views/month-picker.d.ts +0 -26
  200. package/lib/ui/date.picker/views/month-picker.js +0 -65
  201. package/lib/ui/date.picker/views/year-picker.d.ts +0 -20
  202. package/lib/ui/date.picker/views/year-picker.js +0 -66
  203. package/lib/ui/date.picker.d.ts +0 -66
  204. package/lib/ui/date.picker.js +0 -32
  205. package/lib/ui/dialog.css +0 -109
  206. package/lib/ui/dialog.d.ts +0 -22
  207. package/lib/ui/dialog.js +0 -113
  208. package/lib/ui/drop.down.css +0 -472
  209. package/lib/ui/drop.down.d.ts +0 -52
  210. package/lib/ui/drop.down.js +0 -2112
  211. package/lib/ui/number.input.css +0 -3
  212. package/lib/ui/number.input.d.ts +0 -12
  213. package/lib/ui/number.input.js +0 -64
  214. package/lib/ui/tabs.css +0 -53
@@ -1,90 +0,0 @@
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,47 +0,0 @@
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
- }
@@ -1,37 +0,0 @@
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
- }
@@ -1,12 +0,0 @@
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 +0,0 @@
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,38 +0,0 @@
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
- }
@@ -1,139 +0,0 @@
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 };
@@ -1,87 +0,0 @@
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
- }
@@ -1,26 +0,0 @@
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
- }
@@ -1,116 +0,0 @@
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 };
@@ -1,33 +0,0 @@
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
- }