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,113 @@
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 "./TimeComponent.scss";
13
+ import { EventHandler } from "../../interaction/eventhandler";
14
+ import { helper } from "../../core/helper";
15
+ import { date } from "../../core/date";
16
+ var TimeComponent = /** @class */ (function () {
17
+ function TimeComponent(options) {
18
+ var _a;
19
+ this.options = __assign({
20
+ enabled: true,
21
+ id: helper.newDomGuid(),
22
+ inputMode: "HourMinute",
23
+ bindMode: "toModel",
24
+ placeholder: (options === null || options === void 0 ? void 0 : options.inputMode) === "HourMinuteSecond" ? "__:__:__" : "__:__"
25
+ }, options);
26
+ if (this.options.bindTo != null && this.options.bindMode !== "fromModel" && this.options.property != null && this.options.value == null) {
27
+ this.options.value = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
28
+ this.options.converter.toUI(this.options.bindTo[this.options.property]) :
29
+ this.options.bindTo[this.options.property]);
30
+ }
31
+ this.options.onChange = EventHandler.Create(this.options.onChange);
32
+ }
33
+ TimeComponent.prototype.render = function () {
34
+ var _a, _b;
35
+ var val = this.options.value;
36
+ if (this.options.bindMode !== "toModel" && this.options.bindTo != null && this.options.property != null) {
37
+ var current = this.getValue();
38
+ var newVal = (((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toUI) ?
39
+ this.options.converter.toUI(this.options.bindTo[this.options.property]) :
40
+ this.options.bindTo[this.options.property]);
41
+ var newValStr = date.formatTime(newVal, this.options.inputMode);
42
+ if (newValStr !== current) {
43
+ val = newVal;
44
+ if (this.currentDom != null) {
45
+ this.currentDom.value = newValStr;
46
+ }
47
+ }
48
+ }
49
+ return {
50
+ tag: "input", attr: {
51
+ id: this.options.id,
52
+ enabled: this.options.enabled,
53
+ value: date.formatTime(val, this.options.inputMode),
54
+ class: "time-comp " + ((_b = this.options.class) !== null && _b !== void 0 ? _b : ""),
55
+ style: this.options.style,
56
+ placeholder: this.options.placeholder,
57
+ change: this.raiseChangeEvent
58
+ }
59
+ };
60
+ };
61
+ TimeComponent.prototype.onCreate = function (node) {
62
+ this.currentDom = node.dom;
63
+ };
64
+ TimeComponent.prototype.onUpdate = function (node) {
65
+ this.currentDom = node.dom;
66
+ };
67
+ TimeComponent.prototype.getValue = function () {
68
+ if (this.currentDom == null) {
69
+ return "";
70
+ }
71
+ return this.currentDom.value;
72
+ };
73
+ TimeComponent.prototype.getValueAsDate = function (datePart) {
74
+ var x = datePart ? new Date(datePart.getTime()) : new Date();
75
+ try {
76
+ var parts = this.getValue().split(":");
77
+ x.setHours(parseInt(parts[0], 10));
78
+ if (parts.length > 1) {
79
+ x.setMinutes(parseInt(parts[1], 10));
80
+ }
81
+ else {
82
+ x.setMinutes(0);
83
+ }
84
+ if (this.options.inputMode === "HourMinuteSecond" && parts.length > 2) {
85
+ x.setSeconds(parseInt(parts[2], 10));
86
+ }
87
+ else {
88
+ x.setSeconds(0);
89
+ }
90
+ }
91
+ catch (e) {
92
+ console.log(e);
93
+ this.currentDom.value = "";
94
+ x.setHours(0);
95
+ x.setMinutes(0);
96
+ x.setSeconds(0);
97
+ }
98
+ return x;
99
+ };
100
+ TimeComponent.prototype.raiseChangeEvent = function (e, node) {
101
+ var _a;
102
+ if (this.options.enabled) {
103
+ var val = this.getValueAsDate(this.options.value);
104
+ if (this.options.bindTo && this.options.bindMode !== "fromModel" && this.options.property) {
105
+ this.options.bindTo[this.options.property] =
106
+ ((_a = this.options.converter) === null || _a === void 0 ? void 0 : _a.toData) ? this.options.converter.toData(val) : val;
107
+ }
108
+ this.options.onChange.notify(val);
109
+ }
110
+ };
111
+ return TimeComponent;
112
+ }());
113
+ export { TimeComponent };
@@ -0,0 +1,4 @@
1
+ .time-comp {
2
+ width: 4em;
3
+ text-align: right;
4
+ }
@@ -0,0 +1,23 @@
1
+ import "./TreeViewStyle.scss";
2
+ import { IJSLComponent, IJSLVNode } from "jsl-render";
3
+ export interface ITreeViewComponentOptions {
4
+ data: ITreeViewChild;
5
+ renderItem?: (data: any) => IJSLVNode;
6
+ style?: string;
7
+ class?: string;
8
+ }
9
+ export interface ITreeViewChild {
10
+ id: string;
11
+ content: IJSLVNode | string;
12
+ children?: ITreeViewChild[];
13
+ collapsed?: boolean;
14
+ }
15
+ export declare class TreeViewComponent implements IJSLComponent {
16
+ private options;
17
+ private filteredData;
18
+ constructor(options: ITreeViewComponentOptions);
19
+ isEqual(node: IJSLComponent): boolean;
20
+ render(): IJSLVNode;
21
+ private renderNode;
22
+ private addChild;
23
+ }
@@ -0,0 +1,45 @@
1
+ import "./TreeViewStyle.scss";
2
+ var TreeViewComponent = /** @class */ (function () {
3
+ function TreeViewComponent(options) {
4
+ this.options = options;
5
+ }
6
+ TreeViewComponent.prototype.isEqual = function (node) {
7
+ return this.__proto__ === node.__proto__;
8
+ };
9
+ TreeViewComponent.prototype.render = function () {
10
+ var _a, _b;
11
+ return {
12
+ tag: "div", attr: { style: this.options.style, class: "treeview-comp hover " + ((_a = this.options.class) !== null && _a !== void 0 ? _a : "") }, children: [
13
+ { tag: "ul", attr: { class: "tv-ul" }, children: [this.renderNode((_b = this.filteredData) !== null && _b !== void 0 ? _b : this.options.data)] }
14
+ ]
15
+ };
16
+ };
17
+ TreeViewComponent.prototype.renderNode = function (el) {
18
+ var _this = this;
19
+ function getInput() {
20
+ var res = { tag: "input", attr: { class: "tv-input", type: "checkbox", id: el.id } };
21
+ if (el.collapsed) {
22
+ res.attr.checked = "checked";
23
+ }
24
+ return res;
25
+ }
26
+ return (el.children && el.children.length > 0) ?
27
+ { tag: "li", children: [
28
+ getInput(),
29
+ this.addChild({ tag: "label", attr: { for: el.id } }, this.options.renderItem != null ? this.options.renderItem(el) : el.content),
30
+ { tag: "ul", attr: { class: "tv-ul" }, children: el.children.map(function (c) { return _this.renderNode(c); }) }
31
+ ] } :
32
+ this.addChild({ tag: "li" }, this.options.renderItem != null ? this.options.renderItem(el) : el.content);
33
+ };
34
+ TreeViewComponent.prototype.addChild = function (parent, content) {
35
+ if (typeof content === "string") {
36
+ parent.content = content;
37
+ }
38
+ else {
39
+ parent.children = [content];
40
+ }
41
+ return parent;
42
+ };
43
+ return TreeViewComponent;
44
+ }());
45
+ export { TreeViewComponent };
@@ -0,0 +1,96 @@
1
+
2
+ $defaultColor: rgba(50,50,50, 0.5);
3
+ // $hoverColor: #3B99FF;
4
+
5
+ // @mixin transition-duration($duration: 1s){
6
+ // -webkit-transition-duration: $duration;
7
+ // -moz-transition-duration: $duration;
8
+ // -ms-transition-duration: $duration;
9
+ // -o-transition-duration: $duration;
10
+ // transition-duration: $duration;
11
+ // }
12
+
13
+ // @mixin transition-property($property){
14
+ // -webkit-transition-property: $property;
15
+ // -moz-transition-property: $property;
16
+ // -ms-transition-property: $property;
17
+ // -o-transition-property: $property;
18
+ // transition-property: $property;
19
+ // }
20
+
21
+ // @mixin user-select($select: none){
22
+ // -webkit-user-select: $select;
23
+ // -moz-user-select: $select;
24
+ // -ms-user-select: $select;
25
+ // -o-user-select: $select;
26
+ // user-select: $select;
27
+ // }
28
+
29
+ .treeview-comp {
30
+ // float: left;
31
+ // @include user-select;
32
+
33
+ // &:hover input ~ label:before,
34
+ // &.hover input ~ label:before{
35
+ // opacity: 1.0;
36
+ // @include transition-duration(0.5s);
37
+ // }
38
+
39
+ .tv-ul {
40
+ // @include transition-duration;
41
+ list-style: none;
42
+ padding-left: 1em;
43
+
44
+ // li {
45
+ // span{
46
+ // @include transition-property(color);
47
+ // @include transition-duration;
48
+
49
+ // &:hover {
50
+ // color: $hoverColor;
51
+ // @include transition-duration(0.3s);
52
+ // }
53
+ // }
54
+ // }
55
+ }
56
+
57
+ .tv-input{
58
+ display: none;
59
+
60
+ &:checked ~ ul {
61
+ display: none;
62
+ }
63
+
64
+ & ~ label {
65
+ cursor: pointer;
66
+ position: relative;
67
+ }
68
+
69
+ & ~ label:before {
70
+ content: '';
71
+ width: 0;
72
+ height: 0;
73
+ position: absolute;
74
+ margin-left: -1em;
75
+ margin-top: 0.4em;
76
+ border-width: 4px;
77
+ border-style: solid;
78
+ border-top-color: transparent;
79
+ border-right-color: $defaultColor;
80
+ border-bottom-color: $defaultColor;
81
+ border-left-color: transparent;
82
+ // opacity: 0.0;
83
+ // @include transition-property(opacity);
84
+ // @include transition-duration;
85
+ }
86
+
87
+ &:checked ~ label:before {
88
+ margin-left: -0.8em;
89
+ border-width: 5px;
90
+ border-top-color: transparent;
91
+ border-right-color: transparent;
92
+ border-bottom-color: transparent;
93
+ border-left-color: $defaultColor;
94
+ }
95
+ }
96
+ }
@@ -0,0 +1,30 @@
1
+ import "./VirtualRenderStyle.scss";
2
+ import { IJSLComponent, IJSLVNode, JSLRender } from "jsl-render";
3
+ export interface IVirtualArg {
4
+ index: number;
5
+ rowData: any;
6
+ container: IJSLVNode;
7
+ }
8
+ export interface IVirtualRenderOptions {
9
+ data: any[];
10
+ renderRow: (args: IVirtualArg) => string | IJSLVNode | IJSLComponent | void;
11
+ rowHeight?: number;
12
+ rowTag?: string;
13
+ bufferSizeInPx?: number;
14
+ viewportSizeInPX?: number;
15
+ class?: string;
16
+ style?: string;
17
+ }
18
+ export declare class VirtualRenderComponent implements IJSLComponent {
19
+ State: {
20
+ scrollPos: number;
21
+ renderer?: JSLRender;
22
+ };
23
+ private options;
24
+ constructor(options: IVirtualRenderOptions);
25
+ isEqual(node: IJSLComponent): boolean;
26
+ setData(data: any[]): void;
27
+ onInit(renderer: JSLRender): void;
28
+ render(): IJSLVNode;
29
+ private getChildren;
30
+ }
@@ -0,0 +1,104 @@
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 "./VirtualRenderStyle.scss";
13
+ var VirtualRenderComponent = /** @class */ (function () {
14
+ function VirtualRenderComponent(options) {
15
+ this.State = { scrollPos: 0 };
16
+ var defaultOptions = {
17
+ data: null,
18
+ renderRow: null,
19
+ bufferSizeInPx: 200,
20
+ rowHeight: 20,
21
+ rowTag: "div",
22
+ viewportSizeInPX: window.innerHeight
23
+ };
24
+ this.options = __assign(__assign({}, defaultOptions), options);
25
+ }
26
+ VirtualRenderComponent.prototype.isEqual = function (node) {
27
+ return this.__proto__ === node.__proto__;
28
+ };
29
+ VirtualRenderComponent.prototype.setData = function (data) {
30
+ this.options.data = data;
31
+ };
32
+ VirtualRenderComponent.prototype.onInit = function (renderer) {
33
+ this.State.renderer = renderer;
34
+ };
35
+ VirtualRenderComponent.prototype.render = function () {
36
+ var _this = this;
37
+ var _a, _b;
38
+ var o = this.options;
39
+ var vrBody = {
40
+ tag: "div",
41
+ attr: { class: "v-r-child", style: "height:" + (o.data.length * o.rowHeight) + "px;position:relative" },
42
+ children: this.getChildren()
43
+ };
44
+ var vrContainer = {
45
+ tag: "div", attr: {
46
+ class: "v-r-comp " + ((_a = o.class) !== null && _a !== void 0 ? _a : ""),
47
+ style: "overflow-y:auto;" + ((_b = o.style) !== null && _b !== void 0 ? _b : ""),
48
+ scroll: function (e, node) {
49
+ var newScrollPos = node.dom.scrollTop;
50
+ if (Math.abs(_this.State.scrollPos - newScrollPos) < o.bufferSizeInPx) {
51
+ return false;
52
+ }
53
+ _this.State.scrollPos = newScrollPos;
54
+ vrBody.children = _this.getChildren();
55
+ node.children[0].children = [{ tag: "dummy" }];
56
+ _this.State.renderer.updateNode(node.children[0], vrBody);
57
+ return false;
58
+ }
59
+ }, children: [vrBody]
60
+ };
61
+ return vrContainer;
62
+ };
63
+ // public scrollRowToTop(idx: number) {
64
+ // }
65
+ // public scrollRowToCenter(idx: number) {
66
+ // }
67
+ // public scrollRowToBottom(idx: number) {
68
+ // }
69
+ VirtualRenderComponent.prototype.getChildren = function () {
70
+ var o = this.options;
71
+ var children = [];
72
+ var viewport = {
73
+ top: Math.floor((this.State.scrollPos - o.bufferSizeInPx) / o.rowHeight),
74
+ bottom: Math.ceil((this.State.scrollPos + o.viewportSizeInPX + o.bufferSizeInPx) / o.rowHeight)
75
+ };
76
+ for (var idx = viewport.top; idx < viewport.bottom; idx++) {
77
+ if (idx < 0 || idx >= o.data.length) {
78
+ continue;
79
+ }
80
+ var node = {
81
+ tag: o.rowTag, attr: {
82
+ style: {
83
+ top: (idx * o.rowHeight) + "px",
84
+ height: o.rowHeight + "px",
85
+ position: "absolute",
86
+ left: "0",
87
+ right: "0"
88
+ }
89
+ }, children: []
90
+ };
91
+ var result = o.renderRow({ index: idx, container: node, rowData: o.data[idx] });
92
+ if (typeof result === "string") {
93
+ node.content = result;
94
+ }
95
+ else if (result != null) {
96
+ node.children.push(result);
97
+ }
98
+ children.push(node);
99
+ }
100
+ return children;
101
+ };
102
+ return VirtualRenderComponent;
103
+ }());
104
+ export { VirtualRenderComponent };
@@ -0,0 +1,9 @@
1
+ .v-r-comp {
2
+
3
+ height:100%;
4
+
5
+ .v-r-child > * {
6
+ height: 100%;
7
+ }
8
+
9
+ }
@@ -0,0 +1,5 @@
1
+ declare let culture: any;
2
+ /**
3
+ * culture info for date and number formatting and parsing
4
+ */
5
+ export default culture;