jsl-ui 9.18.3 → 9.18.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +17 -0
  171. package/lib/ui/auto.suggest.js +255 -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,4 @@
1
+ export interface IDataConverter<TData, TUI> {
2
+ toUI?: (value: TData) => TUI;
3
+ toData?: (value: TUI) => TData;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ export interface IEvent<T, T2 = void> {
2
+ subscribe(fnc: (args?: T, args2?: T2) => any): any;
3
+ notify(val?: T): any;
4
+ }
5
+ export declare class EventHandler<T, T2 = void> implements IEvent<T, T2> {
6
+ static Create(click: (EventHandler<any, any> | ((p?: any, p2?: any) => any))): EventHandler<any, any>;
7
+ private handlers;
8
+ constructor(fnc?: (args?: T, args2?: T2) => any);
9
+ subscribe(fnc: (args?: T, args2?: T2) => any): void;
10
+ notify(val?: T, val2?: T2): void;
11
+ count(): number;
12
+ unSubscribe(fnc: (args?: T, args2?: T2) => any): void;
13
+ }
@@ -0,0 +1,42 @@
1
+ var EventHandler = /** @class */ (function () {
2
+ function EventHandler(fnc) {
3
+ this.handlers = [];
4
+ if (fnc != null) {
5
+ this.handlers.push(fnc);
6
+ }
7
+ }
8
+ EventHandler.Create = function (click) {
9
+ if (click == null) {
10
+ return new EventHandler();
11
+ }
12
+ if (typeof click === "function") {
13
+ var res = new EventHandler();
14
+ res.subscribe(click);
15
+ return res;
16
+ }
17
+ return click;
18
+ };
19
+ EventHandler.prototype.subscribe = function (fnc) {
20
+ this.handlers.push(fnc);
21
+ };
22
+ EventHandler.prototype.notify = function (val, val2) {
23
+ for (var _i = 0, _a = this.handlers; _i < _a.length; _i++) {
24
+ var h = _a[_i];
25
+ h(val, val2);
26
+ }
27
+ };
28
+ EventHandler.prototype.count = function () {
29
+ return this.handlers.length;
30
+ };
31
+ EventHandler.prototype.unSubscribe = function (fnc) {
32
+ if (this.handlers.indexOf(fnc) >= 0) {
33
+ this.handlers.splice(this.handlers.indexOf(fnc), 1);
34
+ }
35
+ else {
36
+ // TODO? throw exception?
37
+ console.warn("handler not found in EventHandler.unSubscribe");
38
+ }
39
+ };
40
+ return EventHandler;
41
+ }());
42
+ export { EventHandler };
File without changes
@@ -0,0 +1,39 @@
1
+ import "./moveable.css";
2
+ import "../core/polyfills";
3
+ import { EventHandler } from "./eventhandler";
4
+ export interface IMoveEventArg {
5
+ x: number;
6
+ y: number;
7
+ target: HTMLElement;
8
+ evt: MouseEvent;
9
+ cancelEvent: () => void;
10
+ }
11
+ export interface IMoveableOptions {
12
+ moveDelta?: number;
13
+ onStart?: EventHandler<IMoveEventArg>;
14
+ onStop?: EventHandler<IMoveEventArg>;
15
+ onMove?: EventHandler<IMoveEventArg>;
16
+ gridX?: number;
17
+ gridY?: number;
18
+ selector?: string;
19
+ handleSelector?: string;
20
+ direction?: "x" | "y" | "both";
21
+ containInParent?: boolean;
22
+ }
23
+ export declare class MoveableContainer {
24
+ private container;
25
+ private options;
26
+ private element;
27
+ private resizeX;
28
+ private resizeY;
29
+ private initialX;
30
+ private initialY;
31
+ private startSize;
32
+ constructor(container: HTMLElement, options: IMoveableOptions);
33
+ private init;
34
+ private mouseDownContainer;
35
+ private mouseMove;
36
+ private mouseUp;
37
+ private extractArg;
38
+ }
39
+ export declare function Moveable(selector: HTMLElement | string, options?: IMoveableOptions): MoveableContainer;
@@ -0,0 +1,172 @@
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 "./moveable.css";
13
+ import "../core/polyfills";
14
+ import { EventHandler } from "./eventhandler";
15
+ var defaultOptions = {
16
+ onStart: new EventHandler(),
17
+ onStop: new EventHandler(),
18
+ onMove: new EventHandler(),
19
+ direction: "both",
20
+ moveDelta: 0,
21
+ containInParent: true
22
+ };
23
+ var MoveableContainer = /** @class */ (function () {
24
+ function MoveableContainer(container, options) {
25
+ var _this = this;
26
+ this.container = container;
27
+ this.options = options;
28
+ this.resizeX = false;
29
+ this.resizeY = false;
30
+ this.initialX = null;
31
+ this.initialY = null;
32
+ this.startSize = { x: null, y: null };
33
+ this.mouseDownContainer = function (evt) {
34
+ var target = evt.target;
35
+ var directChild = target;
36
+ while (directChild.parentElement != null && directChild.parentElement !== _this.container) {
37
+ if (_this.options.selector != null && directChild.matches(_this.options.selector)) {
38
+ break;
39
+ }
40
+ directChild = directChild.parentElement;
41
+ }
42
+ if (directChild.parentElement == null) {
43
+ return;
44
+ }
45
+ if (_this.options.selector != null && !directChild.matches(_this.options.selector)) {
46
+ return;
47
+ }
48
+ _this.element = directChild;
49
+ var canceled = false;
50
+ var args = {
51
+ evt: evt,
52
+ target: _this.element,
53
+ x: _this.element.offsetLeft,
54
+ y: _this.element.offsetTop,
55
+ cancelEvent: function () { canceled = true; }
56
+ };
57
+ _this.options.onStart.notify(args);
58
+ if (canceled) {
59
+ return;
60
+ }
61
+ evt.preventDefault();
62
+ evt.stopPropagation();
63
+ evt.stopImmediatePropagation();
64
+ _this.initialX = _this.extractArg(evt, "clientX") - _this.element.offsetLeft;
65
+ _this.initialY = _this.extractArg(evt, "clientY") - _this.element.offsetTop;
66
+ // register event listeners
67
+ window.addEventListener("mousemove", _this.mouseMove, false);
68
+ window.addEventListener("mouseup", _this.mouseUp, false);
69
+ window.addEventListener("touchmove", _this.mouseMove, false);
70
+ window.addEventListener("touchend", _this.mouseUp, false);
71
+ };
72
+ this.mouseMove = function (evt) {
73
+ var raiseEvt = false;
74
+ var x = 0;
75
+ if (_this.resizeX) {
76
+ var val = _this.extractArg(evt, "clientX");
77
+ if (_this.startSize != null && _this.startSize.x == null) {
78
+ _this.startSize.x = val;
79
+ }
80
+ if (_this.startSize == null || Math.abs(_this.startSize.x - val) >= _this.options.moveDelta) {
81
+ //if (!this.options.gridX || Math.round(val) % this.options.gridX === 0) {
82
+ x = val - _this.initialX;
83
+ if (_this.options.gridX) {
84
+ x = Math.round(x / _this.options.gridX) * _this.options.gridX;
85
+ }
86
+ if (_this.options.containInParent) {
87
+ if (x < 0) {
88
+ x = 0;
89
+ }
90
+ var maxX = _this.container.clientWidth - _this.element.offsetWidth;
91
+ if (x > maxX) {
92
+ x = maxX;
93
+ }
94
+ }
95
+ _this.element.style.left = x + "px";
96
+ raiseEvt = true;
97
+ _this.startSize = null;
98
+ //}
99
+ }
100
+ }
101
+ var y = 0;
102
+ if (_this.resizeY) {
103
+ var val = _this.extractArg(evt, "clientY");
104
+ if (_this.startSize != null && _this.startSize.y == null) {
105
+ _this.startSize.y = val;
106
+ }
107
+ if (_this.startSize == null || Math.abs(_this.startSize.y - val) >= _this.options.moveDelta) {
108
+ //if (!this.options.gridY || Math.round(val) % this.options.gridY === 0) {
109
+ y = val - _this.initialY;
110
+ if (_this.options.gridY) {
111
+ y = Math.round(y / _this.options.gridY) * _this.options.gridY;
112
+ }
113
+ if (y < 0) {
114
+ y = 0;
115
+ }
116
+ var maxY = _this.container.clientHeight - _this.element.offsetHeight;
117
+ if (y > maxY) {
118
+ y = maxY;
119
+ }
120
+ _this.element.style.top = y + "px";
121
+ raiseEvt = true;
122
+ _this.startSize = null;
123
+ //}
124
+ }
125
+ }
126
+ if (raiseEvt) {
127
+ _this.options.onMove.notify({
128
+ evt: evt,
129
+ target: _this.element,
130
+ x: x,
131
+ y: y,
132
+ cancelEvent: function () { }
133
+ });
134
+ }
135
+ };
136
+ this.mouseUp = function (evt) {
137
+ window.removeEventListener("mousemove", _this.mouseMove, false);
138
+ window.removeEventListener("mouseup", _this.mouseUp, false);
139
+ window.removeEventListener("touchmove", _this.mouseMove, false);
140
+ window.removeEventListener("touchend", _this.mouseUp, false);
141
+ _this.options.onStop.notify({
142
+ evt: evt,
143
+ target: _this.element,
144
+ x: _this.element.offsetLeft,
145
+ y: _this.element.offsetTop,
146
+ cancelEvent: function () { }
147
+ });
148
+ _this.startSize = { x: null, y: null };
149
+ };
150
+ if (options.direction === "x" || options.direction === "both") {
151
+ this.resizeX = true;
152
+ }
153
+ if (options.direction === "y" || options.direction === "both") {
154
+ this.resizeY = true;
155
+ }
156
+ this.init();
157
+ }
158
+ MoveableContainer.prototype.init = function () {
159
+ this.container.addEventListener("mousedown", this.mouseDownContainer, false);
160
+ this.container.addEventListener("touchstart", this.mouseDownContainer, false);
161
+ };
162
+ MoveableContainer.prototype.extractArg = function (evt, key) {
163
+ return evt[key] != null ? evt[key] : (evt.touches.length > 0 ? evt.touches : evt.changedTouches)[0][key];
164
+ };
165
+ return MoveableContainer;
166
+ }());
167
+ export { MoveableContainer };
168
+ export function Moveable(selector, options) {
169
+ return new MoveableContainer(typeof selector === "string" ?
170
+ document.querySelector(selector) :
171
+ selector, __assign(__assign({}, defaultOptions), options));
172
+ }
@@ -0,0 +1,33 @@
1
+ .resizable {
2
+ position: relative;
3
+ }
4
+
5
+ .resizable > .rs-r {
6
+ position: absolute;
7
+ top:0;
8
+ bottom:0;
9
+ right:0;
10
+ width:0.5rem;
11
+ box-sizing:border-box;
12
+ background:rgba(20,20,20,0.2);
13
+ cursor: w-resize;
14
+ }
15
+
16
+ .resizable > .rs-b {
17
+ position: absolute;
18
+ left:0;
19
+ bottom:0;
20
+ right:0;
21
+ height:0.5rem;
22
+ box-sizing:border-box;
23
+ background:rgba(20,20,20,0.2);
24
+ cursor: n-resize;
25
+ }
26
+
27
+ .resizable > .rs-r.rs-b {
28
+ top: initial;
29
+ left: initial;
30
+ right: 0;
31
+ bottom: 0;
32
+ cursor: nw-resize;
33
+ }
@@ -0,0 +1,37 @@
1
+ import "./resizable.css";
2
+ import "../core/polyfills";
3
+ import { EventHandler } from "./eventhandler";
4
+ export interface IResizeEventArg {
5
+ x: number;
6
+ y: number;
7
+ target: HTMLElement;
8
+ evt: MouseEvent;
9
+ }
10
+ export interface IResizeOptions {
11
+ minWidth?: number;
12
+ maxWidth?: number;
13
+ minHeight?: number;
14
+ maxHeight?: number;
15
+ resizeDelta?: number;
16
+ resizeHandlePrefix?: string;
17
+ onStart?: EventHandler<IResizeEventArg>;
18
+ onStop?: EventHandler<IResizeEventArg>;
19
+ onResize?: EventHandler<IResizeEventArg>;
20
+ gridX?: number;
21
+ gridY?: number;
22
+ }
23
+ export declare class ResizeContainer {
24
+ private container;
25
+ private options;
26
+ private element;
27
+ private resizeX;
28
+ private resizeY;
29
+ private startSize;
30
+ constructor(container: HTMLElement, options: IResizeOptions);
31
+ private init;
32
+ private mouseDownContainer;
33
+ private mouseMove;
34
+ private mouseUp;
35
+ private extractArg;
36
+ }
37
+ export declare function Resizable(selector: HTMLElement | string, options?: IResizeOptions): ResizeContainer;
@@ -0,0 +1,123 @@
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 "./resizable.css";
13
+ import "../core/polyfills";
14
+ import { EventHandler } from "./eventhandler";
15
+ var defaultOptions = {
16
+ resizeHandlePrefix: "rs-",
17
+ onStart: new EventHandler(),
18
+ onStop: new EventHandler(),
19
+ onResize: new EventHandler(),
20
+ resizeDelta: 0
21
+ };
22
+ var ResizeContainer = /** @class */ (function () {
23
+ function ResizeContainer(container, options) {
24
+ var _this = this;
25
+ this.container = container;
26
+ this.options = options;
27
+ this.startSize = { x: null, y: null };
28
+ this.mouseDownContainer = function (evt) {
29
+ var target = evt.target;
30
+ if ((" " + target.className).indexOf(" " + _this.options.resizeHandlePrefix) < 0) {
31
+ return; // not a resize handle
32
+ }
33
+ evt.preventDefault();
34
+ evt.stopPropagation();
35
+ evt.stopImmediatePropagation();
36
+ _this.resizeX = target.classList.contains(_this.options.resizeHandlePrefix + "r") ||
37
+ target.classList.contains(_this.options.resizeHandlePrefix + "l");
38
+ _this.resizeY = target.classList.contains(_this.options.resizeHandlePrefix + "t") ||
39
+ target.classList.contains(_this.options.resizeHandlePrefix + "b");
40
+ _this.element = target.parentElement; // TODO change to closest class
41
+ _this.options.onStart.notify({ evt: evt, target: _this.element, x: _this.extractArg(evt, "pageX"), y: _this.extractArg(evt, "pageY") });
42
+ // register event listeners
43
+ window.addEventListener("mousemove", _this.mouseMove, false);
44
+ window.addEventListener("mouseup", _this.mouseUp, false);
45
+ window.addEventListener("touchmove", _this.mouseMove, false);
46
+ window.addEventListener("touchend", _this.mouseUp, false);
47
+ };
48
+ this.mouseMove = function (evt) {
49
+ var raiseEvt = false;
50
+ if (_this.resizeX) {
51
+ var val = _this.extractArg(evt, "clientX") - _this.element.getBoundingClientRect().left;
52
+ if (_this.options.minWidth && val < _this.options.minWidth) {
53
+ val = _this.options.minWidth;
54
+ }
55
+ else if (_this.options.maxWidth && val > _this.options.maxWidth) {
56
+ val = _this.options.maxWidth;
57
+ }
58
+ if (_this.startSize != null && _this.startSize.x == null) {
59
+ _this.startSize.x = val;
60
+ }
61
+ if (_this.startSize == null || Math.abs(_this.startSize.x - val) >= _this.options.resizeDelta) {
62
+ // if (!this.options.gridX || Math.round(val) % this.options.gridX === 0) {
63
+ if (_this.options.gridX) {
64
+ val = Math.round(val / _this.options.gridX) * _this.options.gridX;
65
+ }
66
+ _this.element.style.width = Math.round(val) + "px";
67
+ raiseEvt = true;
68
+ _this.startSize = null;
69
+ // }
70
+ }
71
+ }
72
+ if (_this.resizeY) {
73
+ var val = _this.extractArg(evt, "clientY") - _this.element.getBoundingClientRect().top;
74
+ if (_this.options.minHeight && val < _this.options.minHeight) {
75
+ val = _this.options.minHeight;
76
+ }
77
+ else if (_this.options.maxHeight && val > _this.options.maxHeight) {
78
+ val = _this.options.maxHeight;
79
+ }
80
+ if (_this.startSize != null && _this.startSize.y == null) {
81
+ _this.startSize.y = val;
82
+ }
83
+ if (_this.startSize == null || Math.abs(_this.startSize.y - val) >= _this.options.resizeDelta) {
84
+ // if (!this.options.gridY || Math.round(val) % this.options.gridY === 0) {
85
+ if (_this.options.gridY) {
86
+ val = Math.round(val / _this.options.gridY) * _this.options.gridY;
87
+ }
88
+ _this.element.style.height = Math.round(val) + "px";
89
+ raiseEvt = true;
90
+ _this.startSize = null;
91
+ // }
92
+ }
93
+ }
94
+ if (raiseEvt) {
95
+ _this.options.onResize.notify({ evt: evt, target: _this.element, x: _this.extractArg(evt, "pageX"), y: _this.extractArg(evt, "pageY") });
96
+ }
97
+ };
98
+ this.mouseUp = function (evt) {
99
+ window.removeEventListener("mousemove", _this.mouseMove, false);
100
+ window.removeEventListener("mouseup", _this.mouseUp, false);
101
+ window.removeEventListener("touchmove", _this.mouseMove, false);
102
+ window.removeEventListener("touchend", _this.mouseUp, false);
103
+ _this.options.onStop.notify({ evt: evt, target: _this.element, x: _this.extractArg(evt, "pageX"), y: _this.extractArg(evt, "pageY") });
104
+ _this.startSize = { x: null, y: null };
105
+ };
106
+ this.init();
107
+ }
108
+ ResizeContainer.prototype.init = function () {
109
+ this.container.classList.add("resizable");
110
+ this.container.addEventListener("mousedown", this.mouseDownContainer, false);
111
+ this.container.addEventListener("touchstart", this.mouseDownContainer, false);
112
+ };
113
+ ResizeContainer.prototype.extractArg = function (evt, key) {
114
+ return evt[key] != null ? evt[key] : (evt.touches.length > 0 ? evt.touches : evt.changedTouches)[0][key];
115
+ };
116
+ return ResizeContainer;
117
+ }());
118
+ export { ResizeContainer };
119
+ export function Resizable(selector, options) {
120
+ return new ResizeContainer(typeof selector === "string" ?
121
+ document.querySelector(selector) :
122
+ selector, __assign(__assign({}, defaultOptions), options));
123
+ }
@@ -0,0 +1,14 @@
1
+ .autocomplete-suggestions {
2
+ text-align: left;
3
+ cursor: default;
4
+ border: 1px solid #ccc;
5
+ border-top: 0;
6
+ background: #fff;
7
+ box-shadow: -1px 1px 3px rgba(0,0,0,.1);
8
+
9
+ /* core styles should not be changed */
10
+ position: absolute; display: none; z-index: 9999; max-height: 254px; overflow: hidden; overflow-y: auto; box-sizing: border-box;
11
+ }
12
+ .autocomplete-suggestion { position: relative; padding: 0 .6em; line-height: 23px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.02em; color: #333; }
13
+ .autocomplete-suggestion b { font-weight: normal; color: #1f8dd6; }
14
+ .autocomplete-suggestion.selected { background: #f0f0f0; }
@@ -0,0 +1,17 @@
1
+ import "./auto.suggest.css";
2
+ export interface IAutoSuggestOptions {
3
+ selector?: HTMLElement | string;
4
+ source: (val: string, suggest: (items: any[]) => void) => void;
5
+ minChars?: number;
6
+ delay?: number;
7
+ offsetLeft?: number;
8
+ offsetTop?: number;
9
+ cache?: boolean;
10
+ menuClass?: string;
11
+ renderItem?: (item: any, search: string) => string;
12
+ onSelect?: (e: any, term: string, dom: HTMLElement) => void;
13
+ }
14
+ export interface IAutoSuggest {
15
+ destroy: () => void;
16
+ }
17
+ export declare function AutoSuggest(input: HTMLElement | string, opts: IAutoSuggestOptions): IAutoSuggest;