jsl-ui 9.18.3 → 9.19.0

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 (213) hide show
  1. package/lib/components/IntervalComponent.d.ts +17 -0
  2. package/lib/components/IntervalComponent.js +68 -0
  3. package/lib/components/auto-suggest/AutoSuggestComponent.d.ts +22 -0
  4. package/lib/components/auto-suggest/AutoSuggestComponent.js +49 -0
  5. package/lib/components/button/ButtonComponent.d.ts +18 -0
  6. package/lib/components/button/ButtonComponent.js +46 -0
  7. package/lib/components/checkbox/CheckBoxComponent.d.ts +28 -0
  8. package/lib/components/checkbox/CheckBoxComponent.js +94 -0
  9. package/lib/components/checkbox/CheckBoxStyle.scss +86 -0
  10. package/lib/components/date/DateComponent.d.ts +32 -0
  11. package/lib/components/date/DateComponent.js +106 -0
  12. package/lib/components/date-range/DateRangeComponent.d.ts +35 -0
  13. package/lib/components/date-range/DateRangeComponent.js +136 -0
  14. package/lib/components/date-range/DateRangeStyle.scss +12 -0
  15. package/lib/components/date-time/DateTimeComponent.d.ts +15 -0
  16. package/lib/components/date-time/DateTimeComponent.js +53 -0
  17. package/lib/components/date-time/DateTimeStyle.scss +7 -0
  18. package/lib/components/dialog/DialogComponent.d.ts +67 -0
  19. package/lib/components/dialog/DialogComponent.js +242 -0
  20. package/lib/components/drop-down/DropDownComponent.d.ts +27 -0
  21. package/lib/components/drop-down/DropDownComponent.js +74 -0
  22. package/lib/components/expander/ExpanderComponent.d.ts +27 -0
  23. package/lib/components/expander/ExpanderComponent.js +90 -0
  24. package/lib/components/expander/ExpanderStyle.scss +47 -0
  25. package/lib/components/expander/OldExpanderStyle.scss +37 -0
  26. package/lib/components/form-field/FormComponent.d.ts +12 -0
  27. package/lib/components/form-field/FormComponent.js +26 -0
  28. package/lib/components/form-field/FormFieldComponent.d.ts +38 -0
  29. package/lib/components/form-field/FormFieldComponent.js +139 -0
  30. package/lib/components/form-field/FormFieldStyle.scss +87 -0
  31. package/lib/components/grid/GridComponent.d.ts +26 -0
  32. package/lib/components/grid/GridComponent.js +116 -0
  33. package/lib/components/input/InputComponent.d.ts +33 -0
  34. package/lib/components/input/InputComponent.js +144 -0
  35. package/lib/components/loading/LoadingComponent.d.ts +8 -0
  36. package/lib/components/loading/LoadingComponent.js +22 -0
  37. package/lib/components/loading/LoadingStyle.css +29 -0
  38. package/lib/components/navigation/NavigationComponent.d.ts +34 -0
  39. package/lib/components/navigation/NavigationComponent.js +70 -0
  40. package/lib/components/navigation/NavigationStyle.scss +226 -0
  41. package/lib/components/notification/Notification.d.ts +17 -0
  42. package/lib/components/notification/Notification.js +56 -0
  43. package/lib/components/notification/Notification.scss +19 -0
  44. package/lib/components/number/NumberComponent.d.ts +25 -0
  45. package/lib/components/number/NumberComponent.js +87 -0
  46. package/lib/components/overlay/OverlayComponent.d.ts +27 -0
  47. package/lib/components/overlay/OverlayComponent.js +149 -0
  48. package/lib/components/overlay/overlay.css +57 -0
  49. package/lib/components/progress/ProgressComponent.d.ts +18 -0
  50. package/lib/components/progress/ProgressComponent.js +42 -0
  51. package/lib/components/progress/ProgressStyle.scss +15 -0
  52. package/lib/components/ribbon-menu/RibbonMenuComponent.d.ts +12 -0
  53. package/lib/components/ribbon-menu/RibbonMenuComponent.js +34 -0
  54. package/lib/components/ribbon-menu/RibbonMenuStyle.scss +76 -0
  55. package/lib/components/select/SelectComponent.d.ts +79 -0
  56. package/lib/components/select/SelectComponent.js +362 -0
  57. package/lib/components/select/SelectDDAreaComponent.d.ts +32 -0
  58. package/lib/components/select/SelectDDAreaComponent.js +317 -0
  59. package/lib/components/select/SelectStyle.scss +187 -0
  60. package/lib/components/slider/nouislider.css +310 -0
  61. package/lib/components/slider/nouislider.d.ts +44 -0
  62. package/lib/components/slider/nouislider.js +2158 -0
  63. package/lib/components/stack-panel/SplitterComponent.d.ts +21 -0
  64. package/lib/components/stack-panel/SplitterComponent.js +126 -0
  65. package/lib/components/stack-panel/SplitterStyle.scss +45 -0
  66. package/lib/components/stack-panel/StackPanelComponent.d.ts +20 -0
  67. package/lib/components/stack-panel/StackPanelComponent.js +64 -0
  68. package/lib/components/stack-panel/StackPanelStyle.scss +53 -0
  69. package/lib/components/tabs/TabsComponent.d.ts +39 -0
  70. package/lib/components/tabs/TabsComponent.js +177 -0
  71. package/lib/components/tabs/TabsStyle.scss +76 -0
  72. package/lib/components/time/TimeComponent.d.ts +29 -0
  73. package/lib/components/time/TimeComponent.js +113 -0
  74. package/lib/components/time/TimeComponent.scss +4 -0
  75. package/lib/components/tree-view/TreeViewComponent.d.ts +23 -0
  76. package/lib/components/tree-view/TreeViewComponent.js +45 -0
  77. package/lib/components/tree-view/TreeViewStyle.scss +96 -0
  78. package/lib/components/virtual-render/VirtualRenderComponent.d.ts +30 -0
  79. package/lib/components/virtual-render/VirtualRenderComponent.js +104 -0
  80. package/lib/components/virtual-render/VirtualRenderStyle.scss +9 -0
  81. package/lib/core/culture.d.ts +5 -0
  82. package/lib/core/culture.js +385 -0
  83. package/lib/core/date.d.ts +14 -0
  84. package/lib/core/date.js +350 -0
  85. package/lib/core/helper.d.ts +12 -0
  86. package/lib/core/helper.js +101 -0
  87. package/lib/core/jq.d.ts +37 -0
  88. package/lib/core/jq.js +371 -0
  89. package/lib/core/lang.d.ts +24 -0
  90. package/lib/core/lang.js +28 -0
  91. package/lib/core/numeric.d.ts +7 -0
  92. package/lib/core/numeric.js +143 -0
  93. package/lib/core/polyfills.d.ts +0 -0
  94. package/lib/core/polyfills.js +22 -0
  95. package/lib/core.d.ts +6 -0
  96. package/lib/core.js +6 -0
  97. package/lib/grid/controls/slick.columnpicker.css +46 -0
  98. package/lib/grid/controls/slick.draggablegrouping.css +52 -0
  99. package/lib/grid/controls/slick.gridmenu.css +127 -0
  100. package/lib/grid/controls/slick.pager.css +41 -0
  101. package/lib/grid/examples/examples.css +203 -0
  102. package/lib/grid/filterDialogs/dateRangeFilter.d.ts +7 -0
  103. package/lib/grid/filterDialogs/dateRangeFilter.js +156 -0
  104. package/lib/grid/filterDialogs/excelFilter.d.ts +9 -0
  105. package/lib/grid/filterDialogs/excelFilter.js +313 -0
  106. package/lib/grid/plugins/ext.overlay.css +28 -0
  107. package/lib/grid/plugins/ext.overlay.d.ts +2 -0
  108. package/lib/grid/plugins/ext.overlay.js +291 -0
  109. package/lib/grid/plugins/slick.cellrangedecorator.d.ts +12 -0
  110. package/lib/grid/plugins/slick.cellrangedecorator.js +68 -0
  111. package/lib/grid/plugins/slick.cellrangeselector.d.ts +1 -0
  112. package/lib/grid/plugins/slick.cellrangeselector.js +144 -0
  113. package/lib/grid/plugins/slick.cellselectionmodel.d.ts +1 -0
  114. package/lib/grid/plugins/slick.cellselectionmodel.js +194 -0
  115. package/lib/grid/plugins/slick.headerbuttons.css +40 -0
  116. package/lib/grid/plugins/slick.headerbuttons.d.ts +55 -0
  117. package/lib/grid/plugins/slick.headerbuttons.js +156 -0
  118. package/lib/grid/plugins/slick.headermenu.css +101 -0
  119. package/lib/grid/plugins/slick.headermenu.d.ts +74 -0
  120. package/lib/grid/plugins/slick.headermenu.js +260 -0
  121. package/lib/grid/plugins/slick.rowdetailview.css +37 -0
  122. package/lib/grid/plugins/slick.rowmovemanager.css +8 -0
  123. package/lib/grid/plugins/slick.rowmovemanager.d.ts +18 -0
  124. package/lib/grid/plugins/slick.rowmovemanager.js +249 -0
  125. package/lib/grid/plugins/slick.rowselectionmodel.d.ts +1 -0
  126. package/lib/grid/plugins/slick.rowselectionmodel.js +167 -0
  127. package/lib/grid/slick-default-theme.css +154 -0
  128. package/lib/grid/slick.core.d.ts +90 -0
  129. package/lib/grid/slick.core.js +574 -0
  130. package/lib/grid/slick.creator.d.ts +80 -0
  131. package/lib/grid/slick.creator.js +723 -0
  132. package/lib/grid/slick.dataview.d.ts +71 -0
  133. package/lib/grid/slick.dataview.js +1080 -0
  134. package/lib/grid/slick.editors.core.d.ts +4 -0
  135. package/lib/grid/slick.editors.core.js +232 -0
  136. package/lib/grid/slick.editors.date.d.ts +2 -0
  137. package/lib/grid/slick.editors.date.js +125 -0
  138. package/lib/grid/slick.editors.lookup.d.ts +14 -0
  139. package/lib/grid/slick.editors.lookup.js +353 -0
  140. package/lib/grid/slick.editors.nav.d.ts +6 -0
  141. package/lib/grid/slick.editors.nav.js +22 -0
  142. package/lib/grid/slick.formatters.d.ts +17 -0
  143. package/lib/grid/slick.formatters.js +137 -0
  144. package/lib/grid/slick.grid.css +325 -0
  145. package/lib/grid/slick.grid.d.ts +284 -0
  146. package/lib/grid/slick.grid.js +5395 -0
  147. package/lib/grid/slick.groupitemmetadataprovider.d.ts +39 -0
  148. package/lib/grid/slick.groupitemmetadataprovider.js +165 -0
  149. package/lib/grid/slick.tree.css +20 -0
  150. package/lib/grid/slick.tree.d.ts +33 -0
  151. package/lib/grid/slick.tree.js +220 -0
  152. package/lib/grid.d.ts +13 -0
  153. package/lib/grid.js +13 -0
  154. package/lib/index.css +2576 -0
  155. package/lib/index.css.map +1 -1
  156. package/lib/index.d.ts +56 -0
  157. package/lib/index.js +61 -10198
  158. package/lib/index.js.map +1 -1
  159. package/lib/interaction/dataconverter.d.ts +4 -0
  160. package/lib/interaction/dataconverter.js +1 -0
  161. package/lib/interaction/eventhandler.d.ts +13 -0
  162. package/lib/interaction/eventhandler.js +42 -0
  163. package/lib/interaction/moveable.css +0 -0
  164. package/lib/interaction/moveable.d.ts +39 -0
  165. package/lib/interaction/moveable.js +172 -0
  166. package/lib/interaction/resizable.css +33 -0
  167. package/lib/interaction/resizable.d.ts +37 -0
  168. package/lib/interaction/resizable.js +123 -0
  169. package/lib/ui/auto.suggest.css +14 -0
  170. package/lib/ui/auto.suggest.d.ts +18 -0
  171. package/lib/ui/auto.suggest.js +258 -0
  172. package/lib/ui/base.css +150 -0
  173. package/lib/ui/date.picker/css/date-range-picker.css +87 -0
  174. package/lib/ui/date.picker/css/tiny-date-picker.css +326 -0
  175. package/lib/ui/date.picker/date-picker-options.d.ts +11 -0
  176. package/lib/ui/date.picker/date-picker-options.js +76 -0
  177. package/lib/ui/date.picker/lib/date-manip.d.ts +74 -0
  178. package/lib/ui/date.picker/lib/date-manip.js +120 -0
  179. package/lib/ui/date.picker/lib/dom.d.ts +23 -0
  180. package/lib/ui/date.picker/lib/dom.js +28 -0
  181. package/lib/ui/date.picker/lib/emitter.d.ts +13 -0
  182. package/lib/ui/date.picker/lib/emitter.js +49 -0
  183. package/lib/ui/date.picker/lib/fns.d.ts +23 -0
  184. package/lib/ui/date.picker/lib/fns.js +43 -0
  185. package/lib/ui/date.picker/mode/base-mode.d.ts +26 -0
  186. package/lib/ui/date.picker/mode/base-mode.js +248 -0
  187. package/lib/ui/date.picker/mode/dropdown-mode.d.ts +28 -0
  188. package/lib/ui/date.picker/mode/dropdown-mode.js +50 -0
  189. package/lib/ui/date.picker/mode/index.d.ts +28 -0
  190. package/lib/ui/date.picker/mode/index.js +18 -0
  191. package/lib/ui/date.picker/mode/modal-mode.d.ts +25 -0
  192. package/lib/ui/date.picker/mode/modal-mode.js +17 -0
  193. package/lib/ui/date.picker/mode/permanent-mode.d.ts +29 -0
  194. package/lib/ui/date.picker/mode/permanent-mode.js +19 -0
  195. package/lib/ui/date.picker/views/day-picker.d.ts +40 -0
  196. package/lib/ui/date.picker/views/day-picker.js +155 -0
  197. package/lib/ui/date.picker/views/month-picker.d.ts +26 -0
  198. package/lib/ui/date.picker/views/month-picker.js +65 -0
  199. package/lib/ui/date.picker/views/year-picker.d.ts +20 -0
  200. package/lib/ui/date.picker/views/year-picker.js +66 -0
  201. package/lib/ui/date.picker.d.ts +66 -0
  202. package/lib/ui/date.picker.js +32 -0
  203. package/lib/ui/dialog.css +109 -0
  204. package/lib/ui/dialog.d.ts +22 -0
  205. package/lib/ui/dialog.js +113 -0
  206. package/lib/ui/drop.down.css +472 -0
  207. package/lib/ui/drop.down.d.ts +52 -0
  208. package/lib/ui/drop.down.js +2112 -0
  209. package/lib/ui/number.input.css +3 -0
  210. package/lib/ui/number.input.d.ts +12 -0
  211. package/lib/ui/number.input.js +64 -0
  212. package/lib/ui/tabs.css +53 -0
  213. package/package.json +1 -1
@@ -0,0 +1,136 @@
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 "./DateRangeStyle.scss";
13
+ import { noUiSlider } from "../slider/nouislider";
14
+ import { DateComponent } from "../date/DateComponent";
15
+ import { date } from "../../core/date";
16
+ import { EventHandler } from "../../interaction/eventhandler";
17
+ var DateRangeComponent = /** @class */ (function () {
18
+ function DateRangeComponent(o) {
19
+ var _this = this;
20
+ this.State = { currentMin: null, currentMax: null };
21
+ this.manualChange = false;
22
+ this.options = __assign({}, o);
23
+ if (this.options.minValue == null) {
24
+ this.options.minValue = this.options.min;
25
+ }
26
+ if (this.options.maxValue == null) {
27
+ this.options.maxValue = this.options.max;
28
+ }
29
+ this.options.onChange = EventHandler.Create(this.options.onChange);
30
+ this.minDate = new DateComponent({
31
+ min: this.options.min,
32
+ max: this.options.max,
33
+ value: this.options.minValue,
34
+ style: "width:6rem;",
35
+ onChange: function (val) {
36
+ if (_this.manualChange) {
37
+ return;
38
+ }
39
+ _this.manualChange = true;
40
+ var min = _this.minDate.getValueAsDate();
41
+ var max = _this.maxDate.getValueAsDate();
42
+ _this.slider.set([date.getDaysBetween(_this.options.min, min), date.getDaysBetween(_this.options.min, max)]);
43
+ _this.manualChange = false;
44
+ _this.triggerChange();
45
+ }
46
+ });
47
+ this.maxDate = new DateComponent({
48
+ min: this.options.min,
49
+ max: this.options.max,
50
+ value: this.options.maxValue,
51
+ style: "width:6rem;text-align:right;",
52
+ onChange: function (val) {
53
+ if (_this.manualChange) {
54
+ return;
55
+ }
56
+ _this.manualChange = true;
57
+ var min = _this.minDate.getValueAsDate();
58
+ var max = _this.maxDate.getValueAsDate();
59
+ _this.slider.set([date.getDaysBetween(_this.options.min, min), date.getDaysBetween(_this.options.min, max)]);
60
+ _this.manualChange = false;
61
+ _this.triggerChange();
62
+ }
63
+ });
64
+ }
65
+ DateRangeComponent.prototype.render = function () {
66
+ var _a;
67
+ return {
68
+ tag: "div", attr: { style: this.options.style, class: "date-range-comp " + ((_a = this.options.class) !== null && _a !== void 0 ? _a : "") }, children: [
69
+ {
70
+ tag: "div", children: [
71
+ this.minDate,
72
+ { tag: "span", content: " - " },
73
+ this.maxDate
74
+ ]
75
+ }, {
76
+ tag: "div", children: [
77
+ { tag: "div", attr: { class: "slider-div" } }
78
+ ]
79
+ }
80
+ ]
81
+ };
82
+ };
83
+ DateRangeComponent.prototype.onCreate = function (node) {
84
+ var _this = this;
85
+ var diffInDays = date.getDaysBetween(this.options.min, this.options.max);
86
+ if (this.options.increment !== "days") {
87
+ console.warn(" only days as increments are currently supported");
88
+ }
89
+ var min = 0;
90
+ var max = diffInDays;
91
+ this.slider = noUiSlider.create(node.dom.querySelector(".slider-div"), {
92
+ start: [date.getDaysBetween(this.options.min, this.options.minValue),
93
+ date.getDaysBetween(this.options.min, this.options.maxValue)],
94
+ connect: true,
95
+ step: 1,
96
+ range: {
97
+ min: min,
98
+ max: max
99
+ },
100
+ });
101
+ this.slider.on("update", function (values) {
102
+ if (_this.manualChange) {
103
+ return;
104
+ }
105
+ _this.manualChange = true;
106
+ _this.State.currentMin = values[0];
107
+ _this.State.currentMax = values[1];
108
+ var minVal = date.addDays(_this.options.min, parseFloat(values[0]));
109
+ var maxVal = date.addDays(_this.options.min, parseFloat(values[1]));
110
+ _this.minDate.getRef().setState({ selectedDate: minVal });
111
+ _this.maxDate.getRef().setState({ selectedDate: maxVal });
112
+ _this.manualChange = false;
113
+ _this.triggerChange();
114
+ });
115
+ };
116
+ DateRangeComponent.prototype.onRemove = function () {
117
+ if (this.slider != null) {
118
+ this.slider.destroy();
119
+ this.slider = null;
120
+ }
121
+ };
122
+ DateRangeComponent.prototype.getMin = function () {
123
+ return this.minDate.getValueAsDate();
124
+ };
125
+ DateRangeComponent.prototype.getMax = function () {
126
+ return this.maxDate.getValueAsDate();
127
+ };
128
+ DateRangeComponent.prototype.triggerChange = function () {
129
+ this.options.onChange.notify({
130
+ minValue: this.getMin(),
131
+ maxValue: this.getMin()
132
+ });
133
+ };
134
+ return DateRangeComponent;
135
+ }());
136
+ export { DateRangeComponent };
@@ -0,0 +1,12 @@
1
+ .date-range-comp {
2
+ display: inline-block;
3
+
4
+ .slider-div {
5
+ margin: 0.5rem 0.9rem;
6
+ }
7
+
8
+ // .noUi-handle:before, .noUi-handle:after {
9
+ // width: 1rem;
10
+ // height: 1rem;
11
+ // }
12
+ }
@@ -0,0 +1,15 @@
1
+ import "./DateTimeStyle.scss";
2
+ import { IJSLComponent, IJSLVNode } from "jsl-render";
3
+ import { IDateComponentOptions } from "../date/DateComponent";
4
+ import { ITimeComponentOptions } from "../time/TimeComponent";
5
+ export interface IDateTimeComponentOptions<T> extends IDateComponentOptions<T>, ITimeComponentOptions<T> {
6
+ }
7
+ export declare class DateTimeComponent<T = any> implements IJSLComponent {
8
+ private options;
9
+ private dateComp;
10
+ private timeComp;
11
+ constructor(options: IDateTimeComponentOptions<T>);
12
+ render(): IJSLVNode;
13
+ getValue(): string;
14
+ getValueAsDate(): Date;
15
+ }
@@ -0,0 +1,53 @@
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 "./DateTimeStyle.scss";
13
+ import { EventHandler } from "../../interaction/eventhandler";
14
+ import { DateComponent } from "../date/DateComponent";
15
+ import { TimeComponent } from "../time/TimeComponent";
16
+ var DateTimeComponent = /** @class */ (function () {
17
+ function DateTimeComponent(options) {
18
+ var _this = this;
19
+ if (options.bindMode && options.bindMode !== "toModel") {
20
+ throw new Error("Currently DateTimeComponent only supports toModel as bindMode");
21
+ }
22
+ this.options = __assign({}, options);
23
+ this.options.onChange = EventHandler.Create(this.options.onChange);
24
+ var optionsCopy = __assign({}, options);
25
+ optionsCopy.bindTo = null;
26
+ optionsCopy.property = null;
27
+ optionsCopy.converter = null;
28
+ optionsCopy.onChange = function () {
29
+ var _a;
30
+ var val = _this.getValueAsDate();
31
+ if (_this.options.bindTo && options.property) {
32
+ _this.options.bindTo[options.property] =
33
+ ((_a = _this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? _this.options.converter.toData(val) : val;
34
+ }
35
+ _this.options.onChange.notify(val);
36
+ };
37
+ this.dateComp = new DateComponent(optionsCopy);
38
+ this.timeComp = new TimeComponent(optionsCopy);
39
+ }
40
+ DateTimeComponent.prototype.render = function () {
41
+ return { tag: "div", attr: { class: "date-time-comp" }, children: [
42
+ this.dateComp, this.timeComp
43
+ ] };
44
+ };
45
+ DateTimeComponent.prototype.getValue = function () {
46
+ return this.dateComp.getValue() + " " + this.timeComp.getValue();
47
+ };
48
+ DateTimeComponent.prototype.getValueAsDate = function () {
49
+ return this.timeComp.getValueAsDate(this.dateComp.getValueAsDate());
50
+ };
51
+ return DateTimeComponent;
52
+ }());
53
+ export { DateTimeComponent };
@@ -0,0 +1,7 @@
1
+ .date-time-comp {
2
+ display: inline-block;
3
+ }
4
+
5
+ .date-time-comp input:first-child {
6
+ width:6em;
7
+ }
@@ -0,0 +1,67 @@
1
+ import { IJSLComponent, IJSLVNode } from "jsl-render";
2
+ import { IDialogOptions, JSLDialog } from "../../ui/dialog";
3
+ import { IMoveableOptions } from "../../interaction/moveable";
4
+ import { IResizeOptions } from "../../interaction/resizable";
5
+ export interface IDialogComponentOptions extends IDialogOptions {
6
+ width?: string;
7
+ minWidth?: string;
8
+ minHeight?: string;
9
+ height?: string;
10
+ maxWidth?: string;
11
+ maxHeight?: string;
12
+ header: IJSLVNode | string | IJSLComponent;
13
+ content: IJSLVNode | string | IJSLComponent;
14
+ footer: IJSLVNode | string | IJSLComponent;
15
+ showCloseButton?: boolean;
16
+ allowMove?: boolean;
17
+ allowResize?: boolean;
18
+ resizeOptions?: IResizeOptions;
19
+ moveOptions?: IMoveableOptions;
20
+ class?: string;
21
+ }
22
+ export interface IDialogButtonOptions {
23
+ content?: string;
24
+ class?: string;
25
+ onClick?: () => void | boolean | Promise<any>;
26
+ raw?: boolean;
27
+ }
28
+ export declare class DialogComponent implements IJSLComponent {
29
+ static Button(options: IDialogButtonOptions): {
30
+ tag: string;
31
+ attr: {
32
+ class: string;
33
+ click: () => Promise<void>;
34
+ };
35
+ content: string;
36
+ raw: boolean;
37
+ };
38
+ static Ok(onClick?: () => void | boolean | Promise<any>): {
39
+ tag: string;
40
+ attr: {
41
+ class: string;
42
+ click: () => Promise<void>;
43
+ };
44
+ content: string;
45
+ raw: boolean;
46
+ };
47
+ static Cancel(): {
48
+ tag: string;
49
+ attr: {
50
+ class: string;
51
+ click: () => Promise<void>;
52
+ };
53
+ content: string;
54
+ raw: boolean;
55
+ };
56
+ static show(options: IDialogComponentOptions): DialogComponent;
57
+ private static lastRenderedDlg;
58
+ private closeIcon;
59
+ private resizeHandle;
60
+ private ref;
61
+ private options;
62
+ constructor(options: IDialogComponentOptions);
63
+ render(): IJSLVNode;
64
+ onCreate(node: IJSLVNode): void;
65
+ getRef(): JSLDialog;
66
+ private toNode;
67
+ }
@@ -0,0 +1,242 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (_) try {
28
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
48
+ import { JSLRender } from "jsl-render";
49
+ import { Dialog } from "../../ui/dialog";
50
+ import { Moveable } from "../../interaction/moveable";
51
+ import { EventHandler } from "../../interaction/eventhandler";
52
+ import { Resizable } from "../../interaction/resizable";
53
+ import { UILang } from "../../core/lang";
54
+ var DialogComponent = /** @class */ (function () {
55
+ function DialogComponent(options) {
56
+ var _this = this;
57
+ this.closeIcon = {
58
+ tag: "div", content: "✖" /*"🗙"*/, attr: {
59
+ class: "dlg-close-btn", click: function () {
60
+ _this.ref.close();
61
+ }
62
+ }
63
+ };
64
+ this.resizeHandle = {
65
+ tag: "div", attr: { class: "dlg-res-handle rs-b rs-r" }
66
+ };
67
+ this.options = __assign({ maxHeight: "calc(100vh - 7.5rem)", width: "50vw" }, options);
68
+ }
69
+ DialogComponent.Button = function (options) {
70
+ var _this = this;
71
+ var _a, _b, _c;
72
+ var res = {
73
+ tag: "button", attr: {
74
+ class: "jsl-button " + ((_a = options.class) !== null && _a !== void 0 ? _a : ""),
75
+ click: function () { return __awaiter(_this, void 0, void 0, function () {
76
+ var clickRes, isPromise;
77
+ return __generator(this, function (_a) {
78
+ switch (_a.label) {
79
+ case 0:
80
+ if (!(options.onClick != null)) return [3 /*break*/, 3];
81
+ clickRes = options.onClick();
82
+ isPromise = clickRes && typeof clickRes.then === "function" && typeof clickRes.catch === "function";
83
+ if (!isPromise) return [3 /*break*/, 2];
84
+ return [4 /*yield*/, clickRes];
85
+ case 1:
86
+ clickRes = _a.sent();
87
+ _a.label = 2;
88
+ case 2:
89
+ if (clickRes === false) {
90
+ return [2 /*return*/];
91
+ }
92
+ _a.label = 3;
93
+ case 3:
94
+ if (DialogComponent.lastRenderedDlg != null) {
95
+ DialogComponent.lastRenderedDlg.getRef().close();
96
+ }
97
+ return [2 /*return*/];
98
+ }
99
+ });
100
+ }); }
101
+ }, content: (_b = options.content) !== null && _b !== void 0 ? _b : "OK", raw: (_c = options.raw) !== null && _c !== void 0 ? _c : false
102
+ };
103
+ return res;
104
+ };
105
+ DialogComponent.Ok = function (onClick) {
106
+ return DialogComponent.Button({ content: UILang.core.Ok, onClick: onClick, class: "dlg-ok-btn" });
107
+ };
108
+ DialogComponent.Cancel = function () {
109
+ return DialogComponent.Button({ content: UILang.core.Cancel, class: "dlg-cancel-btn jsl-button-outline" });
110
+ };
111
+ DialogComponent.show = function (options) {
112
+ var container = document.createElement("div");
113
+ document.body.appendChild(container);
114
+ var oldRenderer = JSLRender.lastCreatedRenderer;
115
+ var oldLastDlg = DialogComponent.lastRenderedDlg;
116
+ var renderer = new JSLRender(container, oldRenderer != null);
117
+ if (oldRenderer != null) {
118
+ JSLRender.lastCreatedRenderer = renderer;
119
+ }
120
+ var o = __assign({}, options);
121
+ if (o.autoOpen == null) {
122
+ o.autoOpen = true;
123
+ }
124
+ o.onClose = function () {
125
+ if (options.onClose) {
126
+ if (options.onClose() === false) {
127
+ return;
128
+ }
129
+ }
130
+ document.body.removeChild(container);
131
+ JSLRender.lastCreatedRenderer = oldRenderer;
132
+ if (oldRenderer != null) {
133
+ oldRenderer.refresh();
134
+ }
135
+ DialogComponent.lastRenderedDlg = oldLastDlg;
136
+ };
137
+ var dlg = new DialogComponent(o);
138
+ DialogComponent.lastRenderedDlg = dlg;
139
+ renderer.render(dlg);
140
+ return dlg;
141
+ };
142
+ DialogComponent.prototype.render = function () {
143
+ var header = this.toNode(this.options.header);
144
+ var body = this.toNode(this.options.content);
145
+ var footer = this.toNode(this.options.footer);
146
+ var styleW = "";
147
+ var styleH = "";
148
+ if (this.options.width != null) {
149
+ styleW += "width:" + this.options.width + ";";
150
+ }
151
+ if (this.options.minWidth != null) {
152
+ styleW += "min-width:" + this.options.minWidth + ";";
153
+ }
154
+ if (this.options.maxWidth != null) {
155
+ styleW += "max-width:" + this.options.maxWidth + ";";
156
+ }
157
+ if (this.options.height != null) {
158
+ styleH += "height:" + this.options.height + ";";
159
+ }
160
+ if (this.options.minHeight != null) {
161
+ styleH += "min-height:" + this.options.minHeight + ";";
162
+ }
163
+ if (this.options.maxHeight != null) {
164
+ styleH += "max-height:" + this.options.maxHeight + ";";
165
+ }
166
+ var headerStyle = this.options.allowMove ? "cursor:move" : undefined;
167
+ return {
168
+ tag: "div", attr: {
169
+ class: "jsl-dialog-overlay", wheel: function (e) {
170
+ e.preventDefault();
171
+ }
172
+ }, children: [
173
+ {
174
+ tag: "div", attr: {
175
+ class: "jsl-dialog " + (this.options.class || ""), style: styleW, wheel: function (e) {
176
+ e.stopImmediatePropagation();
177
+ e.stopPropagation();
178
+ }
179
+ }, children: [
180
+ {
181
+ tag: "div", attr: { class: "dlg-header", style: headerStyle },
182
+ children: this.options.showCloseButton ? [header, this.closeIcon] : [header]
183
+ },
184
+ { tag: "div", attr: { class: "dlg-body", style: styleH }, children: [body] },
185
+ {
186
+ tag: "div", attr: { class: "dlg-footer" },
187
+ children: [footer]
188
+ },
189
+ this.options.allowResize ? this.resizeHandle : undefined
190
+ ]
191
+ }
192
+ ]
193
+ };
194
+ };
195
+ DialogComponent.prototype.onCreate = function (node) {
196
+ this.ref = Dialog(node.dom, this.options);
197
+ if (this.options.allowMove) {
198
+ Moveable(this.ref.getOverlay(), __assign({ onStart: new EventHandler(function (e) {
199
+ var headerWasClicked = false;
200
+ var parent = e.evt.target;
201
+ while (parent != null && !parent.classList.contains("jsl-dialog-overlay")) {
202
+ if (parent.classList.contains("dlg-header")) {
203
+ headerWasClicked = true;
204
+ break;
205
+ }
206
+ parent = parent.parentElement;
207
+ }
208
+ if (headerWasClicked) {
209
+ var rect = e.target.getBoundingClientRect();
210
+ e.target.style.transform = "translate(0, 0)";
211
+ e.target.style.left = rect.left + "px";
212
+ e.target.style.top = rect.top + "px";
213
+ }
214
+ else {
215
+ e.cancelEvent();
216
+ }
217
+ }) }, this.options.moveOptions));
218
+ }
219
+ if (this.options.allowResize) {
220
+ var dlgEl = this.ref.getOverlay().querySelector(".jsl-dialog");
221
+ Resizable(dlgEl, this.options.resizeOptions);
222
+ var rect = dlgEl.getBoundingClientRect();
223
+ dlgEl.style.transform = "translate(0, 0)";
224
+ dlgEl.style.left = rect.left + "px";
225
+ dlgEl.style.top = rect.top + "px";
226
+ var bodyEl = dlgEl.querySelector(".dlg-body");
227
+ var bodyRect = bodyEl.getBoundingClientRect();
228
+ bodyEl.style.height = "calc(100% - " + (rect.height - bodyRect.height) + "px)";
229
+ }
230
+ };
231
+ DialogComponent.prototype.getRef = function () {
232
+ return this.ref;
233
+ };
234
+ DialogComponent.prototype.toNode = function (content) {
235
+ if (typeof content === "string") {
236
+ return { tag: "div", content: content };
237
+ }
238
+ return content;
239
+ };
240
+ return DialogComponent;
241
+ }());
242
+ export { DialogComponent };
@@ -0,0 +1,27 @@
1
+ import { IJSLComponent, IJSLVNode } from "jsl-render";
2
+ import { IDropDownOptions, IDropDown } from "../../ui/drop.down";
3
+ import { EventHandler } from "../../interaction/eventhandler";
4
+ import { IDataConverter } from "../../interaction/dataconverter";
5
+ export interface IDropDownComponentOptions<T = any> extends IDropDownOptions {
6
+ class?: string;
7
+ placeholder?: string;
8
+ /**
9
+ * @deprecated
10
+ */
11
+ onSelect?: (value: string | string[]) => void;
12
+ onChange?: EventHandler<string | string[]> | ((value?: string | string[]) => void);
13
+ value?: string | string[];
14
+ bindTo?: T;
15
+ property?: keyof T;
16
+ converter?: IDataConverter<any, string | string[]>;
17
+ enabled?: boolean;
18
+ }
19
+ export declare class DropDownComponent<T = any> implements IJSLComponent {
20
+ private ref;
21
+ private options;
22
+ constructor(options: IDropDownComponentOptions<T>);
23
+ render(): IJSLVNode;
24
+ getRef(): IDropDown;
25
+ onCreate(node: IJSLVNode): void;
26
+ onRemove(): void;
27
+ }
@@ -0,0 +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 };
@@ -0,0 +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
+ }