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,326 @@
1
+ .dp-modal {
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ background: rgba(255, 255, 255, 0.75);
8
+ }
9
+
10
+ .dp {
11
+ position: relative;
12
+ background: #FFF;
13
+ box-shadow: 2px 2px 16px rgba(0, 0, 0, 0.25);
14
+ line-height: 1.4;
15
+ border-radius: 0.5rem;
16
+ max-height: 400px;
17
+ z-index: 2010;
18
+ overflow: hidden;
19
+ -webkit-tap-highlight-color: transparent;
20
+ }
21
+
22
+
23
+ /* .dp:before {
24
+ content: ' ';
25
+ height: 6px;
26
+ position: absolute;
27
+ top: 0;
28
+ left: 0;
29
+ right: 0;
30
+ background: #3B99FC;
31
+ background: linear-gradient(-90deg, #3B99FC 0%, #8AEFC8 100%);
32
+ } */
33
+
34
+ .dp-permanent .dp {
35
+ padding-top: 0;
36
+ border: 1px solid #EEE;
37
+ box-shadow: none;
38
+ }
39
+
40
+ .dp-permanent .dp:before {
41
+ display: none;
42
+ }
43
+
44
+ /* .dp-cal {
45
+ min-height: 300px;
46
+ } */
47
+
48
+ .dp-below {
49
+ position: absolute;
50
+ width: 20rem;
51
+ max-width: 100vw;
52
+ }
53
+
54
+ .dp-permanent {
55
+ position: relative;
56
+ width: 20rem;
57
+ max-width: 100vw;
58
+ z-index: 2010;
59
+ }
60
+
61
+ .dp-permanent .dp{
62
+ z-index: 0;
63
+ }
64
+
65
+ .dp-modal .dp {
66
+ position: absolute;
67
+ top: 50%;
68
+ left: 50%;
69
+ max-width: 600px;
70
+ width: calc(100% - 4em);
71
+ transform: translate(-50%, -50%);
72
+ animation: slide-up 0.3s forwards;
73
+ }
74
+
75
+ .dp-months {
76
+ padding: 24px;
77
+ }
78
+
79
+ .dp-years {
80
+ box-sizing: border-box;
81
+ max-height: 400px;
82
+ padding: 8px 0;
83
+ overflow: auto !important; /* HACK for Chrome on Android */
84
+ }
85
+
86
+ .dp-cal-month,
87
+ .dp-cal-year,
88
+ .dp-day,
89
+ .dp-month,
90
+ .dp-year {
91
+ box-sizing: border-box;
92
+ text-align: center;
93
+ text-decoration: none;
94
+ position: relative;
95
+ color: #3B404D;
96
+ border-radius: 2px;
97
+ border: 0;
98
+ background: transparent;
99
+ top: 0.2rem;
100
+ }
101
+
102
+ .dp-cal-header {
103
+ position: relative;
104
+ text-align: center;
105
+ padding-bottom: 0.4rem;
106
+ background: #f0f0f0;
107
+ }
108
+
109
+ .dp-next,
110
+ .dp-prev {
111
+ position: absolute;
112
+ width: 1.8rem;
113
+ height: 1.8rem;
114
+ overflow: hidden;
115
+ top: 0.3rem;
116
+ color: #777;
117
+ border-radius: 2px;
118
+ border: 0;
119
+ background: transparent;
120
+ }
121
+
122
+ .dp-next:focus,
123
+ .dp-prev:focus,
124
+ .dp-next:hover,
125
+ .dp-prev:hover {
126
+ outline: none;
127
+ color: inherit;
128
+ }
129
+
130
+ .dp-prev {
131
+ left: 24px;
132
+ }
133
+
134
+ .dp-next {
135
+ right: 24px;
136
+ }
137
+
138
+ .dp-prev:before,
139
+ .dp-next:before {
140
+ content: '';
141
+ border: 2px solid;
142
+ width: 0.7rem;
143
+ height: 0.7rem;
144
+ display: inline-block;
145
+ transform: rotate(-45deg);
146
+ transition: border-color 0.2s;
147
+ margin: 0.5rem 0 3rem 0.3rem
148
+ }
149
+
150
+ .dp-prev:before {
151
+ border-right: 0;
152
+ border-bottom: 0;
153
+ }
154
+
155
+ .dp-next:before {
156
+ border-left: 0;
157
+ border-top: 0;
158
+ margin-left: 0;
159
+ margin-right: 4px;
160
+ }
161
+
162
+ .dp-cal-month,
163
+ .dp-cal-year {
164
+ display: inline-block;
165
+ font-size: 1.1rem;
166
+ padding: 0.4rem 0.3rem 0.3rem;
167
+ outline: none;
168
+ }
169
+
170
+ .dp-cal-footer {
171
+ text-align: center;
172
+ background: #f5f5f5;
173
+ }
174
+
175
+ .dp-day-today:after {
176
+ content: '';
177
+ height: 0;
178
+ width: 0;
179
+ border: 7px solid #227BD7;
180
+ border-bottom-color: transparent;
181
+ border-left-color: transparent;
182
+ position: absolute;
183
+ top: 0;
184
+ right: 0;
185
+ }
186
+
187
+ .dp-close,
188
+ .dp-clear,
189
+ .dp-today {
190
+ box-sizing: border-box;
191
+ display: inline-block;
192
+ width: 33%;
193
+ padding: 8px;
194
+ text-decoration: none;
195
+ color: inherit;
196
+ border: 0;
197
+ background: transparent;
198
+ }
199
+
200
+ .dp-permanent .dp-close,
201
+ .dp-permanent .dp-clear {
202
+ display: none;
203
+ }
204
+
205
+ .dp-close:active,
206
+ .dp-clear:active,
207
+ .dp-today:active,
208
+ .dp-next:active,
209
+ .dp-prev:active,
210
+ .dp-cal-month:active,
211
+ .dp-cal-year:active {
212
+ background: #75BCFC;
213
+ color: white;
214
+ }
215
+
216
+ @media screen and (min-device-width: 1200px) {
217
+ .dp-close:hover,
218
+ .dp-close:focus,
219
+ .dp-clear:hover,
220
+ .dp-clear:focus,
221
+ .dp-today:hover,
222
+ .dp-today:focus,
223
+ .dp-next:hover,
224
+ .dp-next:focus,
225
+ .dp-prev:hover,
226
+ .dp-prev:focus,
227
+ .dp-cal-month:focus,
228
+ .dp-cal-month:hover,
229
+ .dp-cal-year:hover,
230
+ .dp-cal-year:focus {
231
+ background: #75BCFC;
232
+ color: white;
233
+ }
234
+ }
235
+
236
+ .dp-col-header,
237
+ .dp-day {
238
+ width: 14.28571429%;
239
+ display: inline-block;
240
+ padding: 8px;
241
+ text-align: center;
242
+ }
243
+
244
+ .dp-col-header {
245
+ color: #AAA;
246
+ text-transform: uppercase;
247
+ font-weight: 300;
248
+ font-size: 0.8rem;
249
+ padding: 8px 0;
250
+ }
251
+
252
+ .dp-month {
253
+ width: 33%;
254
+ display: inline-block;
255
+ padding: 8px;
256
+ }
257
+
258
+ .dp-year {
259
+ display: block;
260
+ padding: 8px 40px;
261
+ width: 100%;
262
+ }
263
+
264
+ .dp-edge-day {
265
+ color: #AAA;
266
+ }
267
+
268
+ .dp-day:hover,
269
+ .dp-month:hover,
270
+ .dp-year:hover,
271
+ .dp-current:focus,
272
+ .dp-current,
273
+ .dp-day:focus,
274
+ .dp-month:focus,
275
+ .dp-year:focus {
276
+ outline: none;
277
+ background: #75BCFC;
278
+ color: white;
279
+ }
280
+
281
+ .dp-selected:hover,
282
+ .dp-selected:focus,
283
+ .dp-selected {
284
+ background: #3B99FC;
285
+ color: #FFF;
286
+ }
287
+
288
+ .dp-day-disabled {
289
+ background: transparent;
290
+ color: #DDD;
291
+ }
292
+
293
+ .dp-day-disabled:focus,
294
+ .dp-day-disabled:hover {
295
+ background: #DDD;
296
+ }
297
+
298
+ .dp-focuser {
299
+ position: absolute;
300
+ z-index: 0;
301
+ top: 50%;
302
+ left: 50%;
303
+ }
304
+
305
+ /* Responsive overrides */
306
+ @media (max-width: 480px), (max-height: 480px) {
307
+ .dp-modal .dp {
308
+ /* font-size: 0.9em; */
309
+ width: auto;
310
+ width: 100%;
311
+ }
312
+
313
+ .dp-day-of-week,
314
+ .dp-day {
315
+ padding: 0.3rem;
316
+ }
317
+ }
318
+
319
+ @keyframes slide-up {
320
+ 0% {
321
+ transform: translate(-50%, 100%);
322
+ }
323
+ 100% {
324
+ transform: translate(-50%, -50%);
325
+ }
326
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @file Responsible for sanitizing and creating date picker options.
3
+ */
4
+ /**
5
+ * DatePickerOptions constructs a new date picker options object, overriding
6
+ * default values with any values specified in opts.
7
+ *
8
+ * @param {DatePickerOptions} opts
9
+ * @returns {DatePickerOptions}
10
+ */
11
+ export default function DatePickerOptions(opts: any): any;
@@ -0,0 +1,76 @@
1
+ /**
2
+ * @file Responsible for sanitizing and creating date picker options.
3
+ */
4
+ import { now, shiftYear, dateOrParse } from './lib/date-manip';
5
+ import { cp } from './lib/fns';
6
+ import { date } from './../../core/date';
7
+ var english = {
8
+ days: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
9
+ months: [
10
+ 'January',
11
+ 'February',
12
+ 'March',
13
+ 'April',
14
+ 'May',
15
+ 'June',
16
+ 'July',
17
+ 'August',
18
+ 'September',
19
+ 'October',
20
+ 'November',
21
+ 'December',
22
+ ],
23
+ today: 'Today',
24
+ clear: 'Clear',
25
+ close: 'Close',
26
+ };
27
+ /**
28
+ * DatePickerOptions constructs a new date picker options object, overriding
29
+ * default values with any values specified in opts.
30
+ *
31
+ * @param {DatePickerOptions} opts
32
+ * @returns {DatePickerOptions}
33
+ */
34
+ export default function DatePickerOptions(opts) {
35
+ opts = opts || {};
36
+ opts = cp(defaults(), opts);
37
+ var parse = dateOrParse(opts.parse);
38
+ opts.lang = cp(english, opts.lang);
39
+ opts.parse = parse;
40
+ opts.inRange = makeInRangeFn(opts);
41
+ opts.min = parse(opts.min || shiftYear(now(), -100));
42
+ opts.max = parse(opts.max || shiftYear(now(), 100));
43
+ opts.hilightedDate = opts.parse(opts.hilightedDate);
44
+ return opts;
45
+ }
46
+ function defaults() {
47
+ return {
48
+ lang: english,
49
+ // Possible values: dp-modal, dp-below, dp-permanent
50
+ mode: 'dp-below',
51
+ // The date to hilight initially if the date picker has no
52
+ // initial value.
53
+ hilightedDate: now(),
54
+ format: function (dt) {
55
+ return date.format(dt);
56
+ //return (dt.getMonth() + 1) + '/' + dt.getDate() + '/' + dt.getFullYear();
57
+ },
58
+ parse: function (str) {
59
+ //var date = new Date(str);
60
+ var d = date.parse(str);
61
+ return !d ? now() : d;
62
+ },
63
+ dateClass: function () { },
64
+ inRange: function () {
65
+ return true;
66
+ },
67
+ appendTo: document.body,
68
+ dayOffset: 1
69
+ };
70
+ }
71
+ function makeInRangeFn(opts) {
72
+ var inRange = opts.inRange; // Cache this version, and return a variant
73
+ return function (dt, dp) {
74
+ return inRange(dt, dp) && opts.min <= dt && opts.max >= dt;
75
+ };
76
+ }
@@ -0,0 +1,74 @@
1
+ /**
2
+ * @file A generic set of mutation-free date functions.
3
+ */
4
+ /**
5
+ * now returns the current date without any time values
6
+ *
7
+ * @returns {Date}
8
+ */
9
+ export declare function now(): Date;
10
+ /**
11
+ * dateEq compares two dates
12
+ *
13
+ * @param {Date} date1 the first date
14
+ * @param {Date} date2 the second date
15
+ * @returns {boolean}
16
+ */
17
+ export declare function datesEq(date1: any, date2: any): boolean;
18
+ /**
19
+ * shiftDay shifts the specified date by n days
20
+ *
21
+ * @param {Date} dt
22
+ * @param {number} n
23
+ * @returns {Date}
24
+ */
25
+ export declare function shiftDay(dt: any, n: any): any;
26
+ /**
27
+ * shiftMonth shifts the specified date by a specified number of months
28
+ *
29
+ * @param {Date} dt
30
+ * @param {number} n
31
+ * @param {boolean} wrap optional, if true, does not change year
32
+ * value, defaults to false
33
+ * @returns {Date}
34
+ */
35
+ export declare function shiftMonth(dt: any, n: any, wrap?: boolean): any;
36
+ /**
37
+ * shiftYear shifts the specified date by n years
38
+ *
39
+ * @param {Date} dt
40
+ * @param {number} n
41
+ * @returns {Date}
42
+ */
43
+ export declare function shiftYear(dt: any, n: any): any;
44
+ /**
45
+ * setYear changes the specified date to the specified year
46
+ *
47
+ * @param {Date} dt
48
+ * @param {number} year
49
+ */
50
+ export declare function setYear(dt: any, year: any): any;
51
+ /**
52
+ * setMonth changes the specified date to the specified month
53
+ *
54
+ * @param {Date} dt
55
+ * @param {number} month
56
+ */
57
+ export declare function setMonth(dt: any, month: any): any;
58
+ /**
59
+ * dateOrParse creates a function which, given a date or string, returns a date
60
+ *
61
+ * @param {function} parse the function used to parse strings
62
+ * @returns {function}
63
+ */
64
+ export declare function dateOrParse(parse: any): (dt: any) => any;
65
+ /**
66
+ * constrainDate returns dt or min/max depending on whether dt is out of bounds (inclusive)
67
+ *
68
+ * @export
69
+ * @param {Date} dt
70
+ * @param {Date} min
71
+ * @param {Date} max
72
+ * @returns {Date}
73
+ */
74
+ export declare function constrainDate(dt: any, min: any, max: any): any;
@@ -0,0 +1,120 @@
1
+ /**
2
+ * @file A generic set of mutation-free date functions.
3
+ */
4
+ /**
5
+ * now returns the current date without any time values
6
+ *
7
+ * @returns {Date}
8
+ */
9
+ export function now() {
10
+ var dt = new Date();
11
+ dt.setHours(0, 0, 0, 0);
12
+ return dt;
13
+ }
14
+ /**
15
+ * dateEq compares two dates
16
+ *
17
+ * @param {Date} date1 the first date
18
+ * @param {Date} date2 the second date
19
+ * @returns {boolean}
20
+ */
21
+ export function datesEq(date1, date2) {
22
+ return (date1 && date1.toDateString()) === (date2 && date2.toDateString());
23
+ }
24
+ /**
25
+ * shiftDay shifts the specified date by n days
26
+ *
27
+ * @param {Date} dt
28
+ * @param {number} n
29
+ * @returns {Date}
30
+ */
31
+ export function shiftDay(dt, n) {
32
+ dt = new Date(dt);
33
+ dt.setDate(dt.getDate() + n);
34
+ return dt;
35
+ }
36
+ /**
37
+ * shiftMonth shifts the specified date by a specified number of months
38
+ *
39
+ * @param {Date} dt
40
+ * @param {number} n
41
+ * @param {boolean} wrap optional, if true, does not change year
42
+ * value, defaults to false
43
+ * @returns {Date}
44
+ */
45
+ export function shiftMonth(dt, n, wrap) {
46
+ dt = new Date(dt);
47
+ var dayOfMonth = dt.getDate();
48
+ var month = dt.getMonth() + n;
49
+ dt.setDate(1);
50
+ dt.setMonth(wrap ? (12 + month) % 12 : month);
51
+ dt.setDate(dayOfMonth);
52
+ // If dayOfMonth = 31, but the target month only has 30 or 29 or whatever...
53
+ // head back to the max of the target month
54
+ if (dt.getDate() < dayOfMonth) {
55
+ dt.setDate(0);
56
+ }
57
+ return dt;
58
+ }
59
+ /**
60
+ * shiftYear shifts the specified date by n years
61
+ *
62
+ * @param {Date} dt
63
+ * @param {number} n
64
+ * @returns {Date}
65
+ */
66
+ export function shiftYear(dt, n) {
67
+ dt = new Date(dt);
68
+ dt.setFullYear(dt.getFullYear() + n);
69
+ return dt;
70
+ }
71
+ /**
72
+ * setYear changes the specified date to the specified year
73
+ *
74
+ * @param {Date} dt
75
+ * @param {number} year
76
+ */
77
+ export function setYear(dt, year) {
78
+ dt = new Date(dt);
79
+ dt.setFullYear(year);
80
+ return dt;
81
+ }
82
+ /**
83
+ * setMonth changes the specified date to the specified month
84
+ *
85
+ * @param {Date} dt
86
+ * @param {number} month
87
+ */
88
+ export function setMonth(dt, month) {
89
+ return shiftMonth(dt, month - dt.getMonth());
90
+ }
91
+ /**
92
+ * dateOrParse creates a function which, given a date or string, returns a date
93
+ *
94
+ * @param {function} parse the function used to parse strings
95
+ * @returns {function}
96
+ */
97
+ export function dateOrParse(parse) {
98
+ return function (dt) {
99
+ return dropTime(typeof dt === 'string' ? parse(dt) : dt);
100
+ };
101
+ }
102
+ /**
103
+ * constrainDate returns dt or min/max depending on whether dt is out of bounds (inclusive)
104
+ *
105
+ * @export
106
+ * @param {Date} dt
107
+ * @param {Date} min
108
+ * @param {Date} max
109
+ * @returns {Date}
110
+ */
111
+ export function constrainDate(dt, min, max) {
112
+ return (dt < min) ? min :
113
+ (dt > max) ? max :
114
+ dt;
115
+ }
116
+ function dropTime(dt) {
117
+ dt = new Date(dt);
118
+ dt.setHours(0, 0, 0, 0);
119
+ return dt;
120
+ }
@@ -0,0 +1,23 @@
1
+ import "../../../core/polyfills";
2
+ /**
3
+ * @file Helper functions for dealing with dom elements.
4
+ */
5
+ export declare var Key: {
6
+ left: number;
7
+ up: number;
8
+ right: number;
9
+ down: number;
10
+ enter: number;
11
+ esc: number;
12
+ };
13
+ /**
14
+ * on attaches an event handler to the specified element, and returns an
15
+ * off function which can be used to remove the handler.
16
+ *
17
+ * @param {string} evt the name of the event to handle
18
+ * @param {HTMLElement} el the element to attach to
19
+ * @param {function} handler the event handler
20
+ * @returns {function} the off function
21
+ */
22
+ export declare function on(evt: any, el: any, handler: any): () => void;
23
+ export declare var CustomEvent: any;
@@ -0,0 +1,28 @@
1
+ import "../../../core/polyfills";
2
+ /**
3
+ * @file Helper functions for dealing with dom elements.
4
+ */
5
+ export var Key = {
6
+ left: 37,
7
+ up: 38,
8
+ right: 39,
9
+ down: 40,
10
+ enter: 13,
11
+ esc: 27,
12
+ };
13
+ /**
14
+ * on attaches an event handler to the specified element, and returns an
15
+ * off function which can be used to remove the handler.
16
+ *
17
+ * @param {string} evt the name of the event to handle
18
+ * @param {HTMLElement} el the element to attach to
19
+ * @param {function} handler the event handler
20
+ * @returns {function} the off function
21
+ */
22
+ export function on(evt, el, handler) {
23
+ el.addEventListener(evt, handler, true);
24
+ return function () {
25
+ el.removeEventListener(evt, handler, true);
26
+ };
27
+ }
28
+ export var CustomEvent = window.CustomEvent;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @file Defines simple event emitter behavior.
3
+ */
4
+ /**
5
+ * Emitter constructs a new emitter object which has on/off methods.
6
+ *
7
+ * @returns {EventEmitter}
8
+ */
9
+ export default function Emitter(): {
10
+ on: (name: any, handler: any) => any;
11
+ emit: (name: any, arg: any) => void;
12
+ off: (name: any, handler: any) => any;
13
+ };
@@ -0,0 +1,49 @@
1
+ /**
2
+ * @file Defines simple event emitter behavior.
3
+ */
4
+ /**
5
+ * Emitter constructs a new emitter object which has on/off methods.
6
+ *
7
+ * @returns {EventEmitter}
8
+ */
9
+ export default function Emitter() {
10
+ var handlers = {};
11
+ function onOne(name, handler) {
12
+ (handlers[name] = (handlers[name] || [])).push(handler);
13
+ }
14
+ function onMany(fns) {
15
+ for (var name in fns) {
16
+ onOne(name, fns[name]);
17
+ }
18
+ }
19
+ return {
20
+ on: function (name, handler) {
21
+ if (handler) {
22
+ onOne(name, handler);
23
+ }
24
+ else {
25
+ onMany(name);
26
+ }
27
+ return this;
28
+ },
29
+ emit: function (name, arg) {
30
+ (handlers[name] || []).forEach(function (handler) {
31
+ handler(name, arg);
32
+ });
33
+ },
34
+ off: function (name, handler) {
35
+ if (!name) {
36
+ handlers = {};
37
+ }
38
+ else if (!handler) {
39
+ handlers[name] = [];
40
+ }
41
+ else {
42
+ handlers[name] = (handlers[name] || []).filter(function (h) {
43
+ return h !== handler;
44
+ });
45
+ }
46
+ return this;
47
+ }
48
+ };
49
+ }