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,350 @@
1
+ import culture from "./culture";
2
+ /*
3
+ * contains function to parse and format numeric values
4
+ */
5
+ //*** all following parts are extracted out of jquery-ui library (GPL/MIT license) ***/
6
+ var _helper = {
7
+ _defaults: { shortYearCutoff: "+10", dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] },
8
+ _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
9
+ _daylightSavingAdjust: function (date) {
10
+ if (!date) {
11
+ return null;
12
+ }
13
+ date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
14
+ return date;
15
+ },
16
+ _getDaysInMonth: function (year, month) {
17
+ return 32 - _helper._daylightSavingAdjust(new Date(year, month, 32)).getDate();
18
+ }
19
+ };
20
+ var date = /** @class */ (function () {
21
+ function date() {
22
+ }
23
+ /* Parse a string value into a date object.
24
+ See formatDate below for the possible formats.
25
+
26
+ @param format string - the expected format of the date
27
+ @param value string - the date in the above format
28
+ @param settings Object - attributes include:
29
+ shortYearCutoff number - the cutoff year for determining the century (optional)
30
+ dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
31
+ dayNames string[7] - names of the days from Sunday (optional)
32
+ monthNamesShort string[12] - abbreviated names of the months (optional)
33
+ monthNames string[12] - names of the months (optional)
34
+ @return Date - the extracted date value or null if value is blank */
35
+ date.parse = function (value, format, settings) {
36
+ if (value === null) {
37
+ return null;
38
+ }
39
+ if (value === undefined) {
40
+ return undefined;
41
+ }
42
+ if (value == "") {
43
+ return null;
44
+ }
45
+ format = format || culture.info.dateFormat;
46
+ //value = (typeof value == 'object' ? value.toString() : value + '');
47
+ var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || _helper._defaults.shortYearCutoff;
48
+ shortYearCutoff = (typeof shortYearCutoff != "string" ? shortYearCutoff :
49
+ new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
50
+ var dayNamesShort = (settings ? settings.dayNamesShort : null) || _helper._defaults.dayNamesShort;
51
+ var dayNames = (settings ? settings.dayNames : null) || _helper._defaults.dayNames;
52
+ var monthNamesShort = (settings ? settings.monthNamesShort : null) || _helper._defaults.monthNamesShort;
53
+ var monthNames = (settings ? settings.monthNames : null) || _helper._defaults.monthNames;
54
+ var year = -1;
55
+ var month = -1;
56
+ var day = -1;
57
+ var doy = -1;
58
+ var literal = false;
59
+ // Check whether a format character is doubled
60
+ var lookAhead = function (match) {
61
+ var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
62
+ if (matches) {
63
+ iFormat++;
64
+ }
65
+ return matches;
66
+ };
67
+ // Extract a number from the string value
68
+ var getNumber = function (match) {
69
+ var isDoubled = lookAhead(match);
70
+ var size = (match == "@" ? 14 : (match == "!" ? 20 :
71
+ (match == "y" && isDoubled ? 4 : (match == "o" ? 3 : 2))));
72
+ var digits = new RegExp("^\\d{1," + size + "}");
73
+ var num = value.substring(iValue).match(digits);
74
+ if (!num) {
75
+ throw "Missing number at position " + iValue;
76
+ }
77
+ iValue += num[0].length;
78
+ return parseInt(num[0], 10);
79
+ };
80
+ // Extract a name from the string value and convert to an index
81
+ var getName = function (match, shortNames, longNames) {
82
+ var names = (lookAhead(match) ? longNames : shortNames);
83
+ for (var i = 0; i < names.length; i++) {
84
+ if (value.substr(iValue, names[i].length).toLowerCase() == names[i].toLowerCase()) {
85
+ iValue += names[i].length;
86
+ return i + 1;
87
+ }
88
+ }
89
+ throw new Error("Unknown name at position " + iValue);
90
+ };
91
+ // Confirm that a literal character matches the string value
92
+ var checkLiteral = function () {
93
+ if (value.charAt(iValue) != format.charAt(iFormat)) {
94
+ throw "Unexpected literal at position " + iValue;
95
+ }
96
+ iValue++;
97
+ };
98
+ var iValue = 0;
99
+ for (var iFormat = 0; iFormat < format.length; iFormat++) {
100
+ if (literal) {
101
+ if (format.charAt(iFormat) == "'" && !lookAhead("'")) {
102
+ literal = false;
103
+ }
104
+ else {
105
+ checkLiteral();
106
+ }
107
+ }
108
+ else {
109
+ switch (format.charAt(iFormat)) {
110
+ case "d":
111
+ day = getNumber("d");
112
+ break;
113
+ case "D":
114
+ getName("D", dayNamesShort, dayNames);
115
+ break;
116
+ case "o":
117
+ doy = getNumber("o");
118
+ break;
119
+ case "m":
120
+ month = getNumber("m");
121
+ break;
122
+ case "M":
123
+ month = getName("M", monthNamesShort, monthNames);
124
+ break;
125
+ case "y":
126
+ year = getNumber("y");
127
+ break;
128
+ case "@":
129
+ var date = new Date(getNumber("@"));
130
+ year = date.getFullYear();
131
+ month = date.getMonth() + 1;
132
+ day = date.getDate();
133
+ break;
134
+ case "!":
135
+ var date = new Date((getNumber("!") - _helper._ticksTo1970) / 10000);
136
+ year = date.getFullYear();
137
+ month = date.getMonth() + 1;
138
+ day = date.getDate();
139
+ break;
140
+ case "'":
141
+ if (lookAhead("'")) {
142
+ checkLiteral();
143
+ }
144
+ else {
145
+ literal = true;
146
+ }
147
+ break;
148
+ default:
149
+ checkLiteral();
150
+ }
151
+ }
152
+ }
153
+ if (year == -1) {
154
+ year = new Date().getFullYear();
155
+ }
156
+ else if (year < 100) {
157
+ year += new Date().getFullYear() - new Date().getFullYear() % 100 +
158
+ (year <= shortYearCutoff ? 0 : -100);
159
+ }
160
+ if (doy > -1) {
161
+ month = 1;
162
+ day = doy;
163
+ do {
164
+ var dim = _helper._getDaysInMonth(year, month - 1);
165
+ if (day <= dim) {
166
+ break;
167
+ }
168
+ month++;
169
+ day -= dim;
170
+ } while (true);
171
+ }
172
+ var result = _helper._daylightSavingAdjust(new Date(year, month - 1, day));
173
+ if (result.getFullYear() != year || result.getMonth() + 1 != month || result.getDate() != day) {
174
+ throw new Error("Invalid date");
175
+ } // E.g. 31/02/*
176
+ return result;
177
+ };
178
+ /* Format a date object into a string value.
179
+ The format can be combinations of the following:
180
+ d - day of month (no leading zero)
181
+ dd - day of month (two digit)
182
+ o - day of year (no leading zeros)
183
+ oo - day of year (three digit)
184
+ D - day name short
185
+ DD - day name long
186
+ m - month of year (no leading zero)
187
+ mm - month of year (two digit)
188
+ M - month name short
189
+ MM - month name long
190
+ y - year (two digit)
191
+ yy - year (four digit)
192
+ @ - Unix timestamp (ms since 01/01/1970)
193
+ ! - Windows ticks (100ns since 01/01/0001)
194
+ '...' - literal text
195
+ '' - single quote
196
+
197
+ @param format string - the desired format of the date
198
+ @param date Date - the date value to format
199
+ @param settings Object - attributes include:
200
+ dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
201
+ dayNames string[7] - names of the days from Sunday (optional)
202
+ monthNamesShort string[12] - abbreviated names of the months (optional)
203
+ monthNames string[12] - names of the months (optional)
204
+ @return string - the date in the above format */
205
+ date.format = function (date, format, settings) {
206
+ if (!date || isNaN(date)) {
207
+ return "";
208
+ }
209
+ format = format || culture.info.dateFormat;
210
+ var dayNamesShort = (settings ? settings.dayNamesShort : null) || _helper._defaults.dayNamesShort;
211
+ var dayNames = (settings ? settings.dayNames : null) || _helper._defaults.dayNames;
212
+ var monthNamesShort = (settings ? settings.monthNamesShort : null) || _helper._defaults.monthNamesShort;
213
+ var monthNames = (settings ? settings.monthNames : null) || _helper._defaults.monthNames;
214
+ // Check whether a format character is doubled
215
+ var lookAhead = function (match) {
216
+ var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
217
+ if (matches) {
218
+ iFormat++;
219
+ }
220
+ return matches;
221
+ };
222
+ // Format a number, with leading zero if necessary
223
+ var formatNumber = function (match, value, len) {
224
+ var num = "" + value;
225
+ if (lookAhead(match)) {
226
+ while (num.length < len) {
227
+ num = "0" + num;
228
+ }
229
+ }
230
+ return num;
231
+ };
232
+ // Format a name, short or long as requested
233
+ var formatName = function (match, value, shortNames, longNames) {
234
+ return (lookAhead(match) ? longNames[value] : shortNames[value]);
235
+ };
236
+ var output = "";
237
+ var literal = false;
238
+ if (date) {
239
+ for (var iFormat = 0; iFormat < format.length; iFormat++) {
240
+ if (literal) {
241
+ if (format.charAt(iFormat) == "'" && !lookAhead("'")) {
242
+ literal = false;
243
+ }
244
+ else {
245
+ output += format.charAt(iFormat);
246
+ }
247
+ }
248
+ else {
249
+ switch (format.charAt(iFormat)) {
250
+ case "d":
251
+ output += formatNumber("d", date.getDate(), 2);
252
+ break;
253
+ case "D":
254
+ output += formatName("D", date.getDay(), dayNamesShort, dayNames);
255
+ break;
256
+ case "o":
257
+ output += formatNumber("o", (date.getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000, 3);
258
+ break;
259
+ case "m":
260
+ output += formatNumber("m", date.getMonth() + 1, 2);
261
+ break;
262
+ case "M":
263
+ output += formatName("M", date.getMonth(), monthNamesShort, monthNames);
264
+ break;
265
+ case "y":
266
+ output += (lookAhead("y") ? date.getFullYear() :
267
+ (date.getFullYear() % 100 < 10 ? "0" : "") + date.getFullYear() % 100);
268
+ break;
269
+ case "@":
270
+ output += date.getTime();
271
+ break;
272
+ case "!":
273
+ output += date.getTime() * 10000 + _helper._ticksTo1970;
274
+ break;
275
+ case "'":
276
+ if (lookAhead("'")) {
277
+ output += "'";
278
+ }
279
+ else {
280
+ literal = true;
281
+ }
282
+ break;
283
+ default:
284
+ output += format.charAt(iFormat);
285
+ }
286
+ }
287
+ }
288
+ }
289
+ return output;
290
+ };
291
+ date.formatTime = function (value, inputMode) {
292
+ if (inputMode === "HourMinute") {
293
+ return value ? (pad(value.getHours()) + ":" + pad(value.getMinutes())) : "";
294
+ }
295
+ else if (inputMode === "HourMinuteSecond") {
296
+ return value ? (pad(value.getHours()) + ":" + pad(value.getMinutes()) + ":" + pad(value.getSeconds())) : "";
297
+ }
298
+ return "";
299
+ };
300
+ date.now = function () {
301
+ return new Date();
302
+ };
303
+ date.addSeconds = function (d, seconds) {
304
+ var future = new Date(d);
305
+ future.setSeconds(d.getSeconds() + seconds);
306
+ return future;
307
+ };
308
+ date.addMinutes = function (d, minutes) {
309
+ var future = new Date(d);
310
+ future.setMinutes(d.getMinutes() + minutes);
311
+ return future;
312
+ };
313
+ date.addHours = function (d, hours) {
314
+ var future = new Date(d);
315
+ future.setHours(d.getHours() + hours);
316
+ return future;
317
+ };
318
+ date.addDays = function (d, days) {
319
+ var future = new Date(d);
320
+ future.setDate(d.getDate() + days);
321
+ return future;
322
+ };
323
+ date.getDaysBetween = function (startDate, endDate) {
324
+ return Math.round((endDate - startDate) / (1000.0 * 3600.0 * 24.0));
325
+ };
326
+ date.getMsBetween = function (startDate, endDate) {
327
+ return endDate.getTime() - startDate.getTime();
328
+ };
329
+ date.onlyDate = function (d) {
330
+ if (d == null) {
331
+ return d;
332
+ }
333
+ var result = new Date(d);
334
+ result.setHours(0, 0, 0, 0);
335
+ return result;
336
+ };
337
+ date.equal = function (date1, date2) {
338
+ return (date1 && date1.getTime()) === (date2 && date2.getTime());
339
+ };
340
+ return date;
341
+ }());
342
+ export { date };
343
+ function pad(nr) {
344
+ if (nr < 10) {
345
+ return "0" + nr.toString();
346
+ }
347
+ else {
348
+ return nr.toString();
349
+ }
350
+ }
@@ -0,0 +1,12 @@
1
+ export declare abstract class helper {
2
+ static emptyGuid: string;
3
+ static random(): number;
4
+ static newGuid(): string;
5
+ static newSeqGuid(): string;
6
+ static newDomGuid(): string;
7
+ static isObject(obj: any): boolean;
8
+ static isGuid(id: any): boolean;
9
+ static getParams(): any;
10
+ static isCyclic(o: any): boolean;
11
+ static correctDates(data: any): any;
12
+ }
@@ -0,0 +1,101 @@
1
+ var helper = /** @class */ (function () {
2
+ function helper() {
3
+ }
4
+ helper.random = function () {
5
+ return (Math.random() * (new Date().getTime() || 1)) % 1;
6
+ };
7
+ helper.newGuid = function () {
8
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { var r = helper.random() * 16 | 0, v = c == "x" ? r : r & 0x3 | 0x8; return v.toString(16); });
9
+ };
10
+ helper.newSeqGuid = function () {
11
+ var d = new Date().getTime().toString(16);
12
+ while (d.length < 12) {
13
+ d = "0" + d;
14
+ }
15
+ if (d.length > 12) {
16
+ d = d.substring(0, 12);
17
+ }
18
+ return "xxxxxxxx-xxxx-4xxx-yxxx-".replace(/[xy]/g, function (c) { var r = helper.random() * 16 | 0, v = c == "x" ? r : r & 0x3 | 0x8; return v.toString(16); })
19
+ + d;
20
+ };
21
+ helper.newDomGuid = function () {
22
+ return "axxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { var r = helper.random() * 16 | 0, v = c == "x" ? r : r & 0x3 | 0x8; return v.toString(16); });
23
+ };
24
+ helper.isObject = function (obj) {
25
+ return obj ? Object.prototype.toString.call(obj) === "[object Object]" : false;
26
+ };
27
+ helper.isGuid = function (id) {
28
+ if (!id) {
29
+ return false;
30
+ }
31
+ return /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(id);
32
+ };
33
+ helper.getParams = function () {
34
+ var match, pl = /\+/g, // Regex for replacing addition symbol with a space
35
+ search = /([^&=]+)=?([^&]*)/g, decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); }, query = window.location.search.substring(1);
36
+ var urlParams = {};
37
+ while (match = search.exec(query))
38
+ urlParams[decode(match[1])] = decode(match[2]);
39
+ return urlParams;
40
+ };
41
+ helper.isCyclic = function (o) {
42
+ var seenObjects = [];
43
+ function detect(obj) {
44
+ if (obj && typeof obj === 'object') {
45
+ if (seenObjects.indexOf(obj) !== -1) {
46
+ return true;
47
+ }
48
+ seenObjects.push(obj);
49
+ for (var key in obj) {
50
+ if (obj.hasOwnProperty(key) && detect(obj[key])) {
51
+ return true;
52
+ }
53
+ }
54
+ }
55
+ return false;
56
+ }
57
+ return detect(o);
58
+ };
59
+ helper.correctDates = function (data) {
60
+ for (var key in data) {
61
+ if (data[key] && typeof data[key] === "object")
62
+ data[key] = helper.correctDates(data[key]);
63
+ //else if (data[key] && data[key].toString().substring(0, 6) === "/Date\(")
64
+ // data[key] = new Date(parseInt(data[key].substr(6))+ timezone_offset);
65
+ else if (data[key] && dateISO.test(data[key].toString())) {
66
+ var x = Date.fromString(data[key]);
67
+ data[key] = new Date(x.getTime() + (x.getTimezoneOffset() * 60000));
68
+ }
69
+ }
70
+ return data;
71
+ };
72
+ helper.emptyGuid = "00000000-0000-0000-0000-000000000000";
73
+ return helper;
74
+ }());
75
+ export { helper };
76
+ var dateISO = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.*/i;
77
+ (function () {
78
+ var d = window.Date;
79
+ var regexIso8601 = /^(\d{4})-(\d{2})-(\d{2})((T)(\d{2}):(\d{2})(:(\d{2})(\.\d*)?)?)?(Z)?$/;
80
+ d._myparse = function (v) {
81
+ if (v.charAt(v.length - 1) !== "Z")
82
+ v += "Z";
83
+ var m = regexIso8601.exec(v);
84
+ if (m) {
85
+ return new Date(Date.UTC(+m[1], +m[2] - 1, +m[3], +m[6] || 0, +m[7] || 0, +m[9] || 0, parseInt((+m[10]) * 1000) || 0));
86
+ //return Date.UTC(
87
+ // m[1],
88
+ // (m[2] || 1) - 1,
89
+ // m[3] || 1,
90
+ // m[4] - (m[8] ? m[8] + m[9] : 0) || 0,
91
+ // m[5] - (m[8] ? m[8] + m[10] : 0) || 0,
92
+ // m[6] || 0,
93
+ // ((m[7] || 0) + '00').substr(0, 3)
94
+ //);
95
+ }
96
+ return d.parse.apply(this, arguments);
97
+ };
98
+ d.fromString = function (v) {
99
+ return d._myparse(v);
100
+ };
101
+ })();
@@ -0,0 +1,37 @@
1
+ export interface IjQueryWrapper {
2
+ length: number;
3
+ empty: () => IjQueryWrapper;
4
+ appendTo: (selector: IjQueryWrapper | HTMLElement) => IjQueryWrapper;
5
+ append: (el: HTMLElement) => IjQueryWrapper;
6
+ add: (selector: IjQueryWrapper | HTMLElement) => IjQueryWrapper;
7
+ css: (key: string, value?: any) => IjQueryWrapper | any;
8
+ attr: (key: string, value?: any) => IjQueryWrapper | string;
9
+ closestClass: (name: string, stopAt?: string) => IjQueryWrapper;
10
+ data: (name: string, value?: any) => any;
11
+ remove(): void;
12
+ html: (value?: any) => string | IjQueryWrapper;
13
+ text: (value: string) => IjQueryWrapper;
14
+ addClass: (name: string) => IjQueryWrapper;
15
+ hasClass: (name: string) => boolean;
16
+ height: (val?: number | string) => number | IjQueryWrapper;
17
+ width: (val?: number | string) => number | IjQueryWrapper;
18
+ removeClass: (name: string) => IjQueryWrapper;
19
+ offset: () => {
20
+ top: number;
21
+ left: number;
22
+ };
23
+ children: () => IjQueryWrapper;
24
+ on: (eventname: string, fnc: Function) => IjQueryWrapper;
25
+ toggleClass: (name: string, state?: boolean) => IjQueryWrapper;
26
+ find: (selector: string) => IjQueryWrapper;
27
+ slideDown: (speed: string, done: Function) => IjQueryWrapper;
28
+ slideUp: (speed: string, done: Function) => IjQueryWrapper;
29
+ index: () => number;
30
+ }
31
+ export interface IjQueryReplacement {
32
+ (selector?: string | HTMLElement | Document): IjQueryWrapper;
33
+ deepExtend: (out: any, ...a: any[]) => any;
34
+ shallowExtend: (out: any, ...a: any[]) => any;
35
+ each: (array: any[] | IjQueryWrapper, fnc: (idx: number, val: any) => void) => void;
36
+ }
37
+ export declare let jQueryReplacement: ((selector?: string | HTMLElement) => IjQueryWrapper) & IjQueryReplacement;