@elliemae/ds-utilities 2.3.1 → 3.0.0-alpha.3

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 (208) hide show
  1. package/dist/cjs/capitalize.js +35 -0
  2. package/dist/cjs/capitalize.js.map +7 -0
  3. package/dist/cjs/compose.js +45 -0
  4. package/dist/cjs/compose.js.map +7 -0
  5. package/dist/cjs/getComponentFromProps.js +57 -0
  6. package/dist/cjs/getComponentFromProps.js.map +7 -0
  7. package/dist/cjs/hooks/index.js +73 -0
  8. package/dist/cjs/hooks/index.js.map +7 -0
  9. package/dist/cjs/hooks/useCancellableDelayedCallback.js +51 -0
  10. package/dist/cjs/hooks/useCancellableDelayedCallback.js.map +7 -0
  11. package/dist/cjs/hooks/useDerivedStateFromProps.js +67 -0
  12. package/dist/cjs/hooks/useDerivedStateFromProps.js.map +7 -0
  13. package/dist/cjs/hooks/useExecutionTimer.js +50 -0
  14. package/dist/cjs/hooks/useExecutionTimer.js.map +7 -0
  15. package/dist/cjs/hooks/useExpandState.js +137 -0
  16. package/dist/cjs/hooks/useExpandState.js.map +7 -0
  17. package/dist/cjs/hooks/useFocusTrap.js +49 -0
  18. package/dist/cjs/hooks/useFocusTrap.js.map +7 -0
  19. package/dist/cjs/hooks/useHotkeys.js +45 -0
  20. package/dist/cjs/hooks/useHotkeys.js.map +7 -0
  21. package/dist/cjs/hooks/useHoverHandlersDelay.js +58 -0
  22. package/dist/cjs/hooks/useHoverHandlersDelay.js.map +7 -0
  23. package/dist/cjs/hooks/useIsShowingEllipsis.js +58 -0
  24. package/dist/cjs/hooks/useIsShowingEllipsis.js.map +7 -0
  25. package/dist/cjs/hooks/useOnElementResize.js +55 -0
  26. package/dist/cjs/hooks/useOnElementResize.js.map +7 -0
  27. package/dist/cjs/hooks/useParentElement.js +43 -0
  28. package/dist/cjs/hooks/useParentElement.js.map +7 -0
  29. package/dist/cjs/hooks/usePrevious.js +44 -0
  30. package/dist/cjs/hooks/usePrevious.js.map +7 -0
  31. package/dist/cjs/hooks/useResizeObserver.js +60 -0
  32. package/dist/cjs/hooks/useResizeObserver.js.map +7 -0
  33. package/dist/cjs/hooks/useSetRef.js +42 -0
  34. package/dist/cjs/hooks/useSetRef.js.map +7 -0
  35. package/dist/cjs/hooks/useShouldRecalculate.js +44 -0
  36. package/dist/cjs/hooks/useShouldRecalculate.js.map +7 -0
  37. package/dist/cjs/hooks/useWindowScrollerList.js +83 -0
  38. package/dist/cjs/hooks/useWindowScrollerList.js.map +7 -0
  39. package/dist/cjs/hooks/useWindowSize.js +57 -0
  40. package/dist/cjs/hooks/useWindowSize.js.map +7 -0
  41. package/dist/cjs/index.js +146 -0
  42. package/dist/cjs/index.js.map +7 -0
  43. package/dist/cjs/onClickHandlerForNonInteractiveElements.js +49 -0
  44. package/dist/cjs/onClickHandlerForNonInteractiveElements.js.map +7 -0
  45. package/dist/cjs/operators.js +68 -0
  46. package/dist/cjs/operators.js.map +7 -0
  47. package/dist/cjs/platform.js +37 -0
  48. package/dist/cjs/platform.js.map +7 -0
  49. package/dist/cjs/reactTypesUtility.js +58 -0
  50. package/dist/cjs/reactTypesUtility.js.map +7 -0
  51. package/dist/cjs/scrollingTimer.js +46 -0
  52. package/dist/cjs/scrollingTimer.js.map +7 -0
  53. package/dist/cjs/system.js +60 -0
  54. package/dist/cjs/system.js.map +7 -0
  55. package/dist/cjs/timeUtils.js +43 -0
  56. package/dist/cjs/timeUtils.js.map +7 -0
  57. package/dist/cjs/utils.js +143 -0
  58. package/dist/cjs/utils.js.map +7 -0
  59. package/dist/cjs/validations.js +57 -0
  60. package/dist/cjs/validations.js.map +7 -0
  61. package/dist/esm/capitalize.js +6 -0
  62. package/dist/esm/capitalize.js.map +7 -0
  63. package/dist/esm/compose.js +16 -0
  64. package/dist/esm/compose.js.map +7 -0
  65. package/dist/esm/getComponentFromProps.js +30 -0
  66. package/dist/esm/getComponentFromProps.js.map +7 -0
  67. package/dist/esm/hooks/index.js +44 -0
  68. package/dist/esm/hooks/index.js.map +7 -0
  69. package/dist/esm/hooks/useCancellableDelayedCallback.js +22 -0
  70. package/dist/esm/hooks/useCancellableDelayedCallback.js.map +7 -0
  71. package/dist/esm/hooks/useDerivedStateFromProps.js +38 -0
  72. package/dist/esm/hooks/useDerivedStateFromProps.js.map +7 -0
  73. package/dist/esm/hooks/useExecutionTimer.js +21 -0
  74. package/dist/esm/hooks/useExecutionTimer.js.map +7 -0
  75. package/dist/esm/hooks/useExpandState.js +110 -0
  76. package/dist/esm/hooks/useExpandState.js.map +7 -0
  77. package/dist/esm/hooks/useFocusTrap.js +20 -0
  78. package/dist/esm/hooks/useFocusTrap.js.map +7 -0
  79. package/dist/esm/hooks/useHotkeys.js +16 -0
  80. package/dist/esm/hooks/useHotkeys.js.map +7 -0
  81. package/{esm → dist/esm}/hooks/useHoverHandlersDelay.js +15 -12
  82. package/dist/esm/hooks/useHoverHandlersDelay.js.map +7 -0
  83. package/{esm → dist/esm}/hooks/useIsShowingEllipsis.js +9 -12
  84. package/dist/esm/hooks/useIsShowingEllipsis.js.map +7 -0
  85. package/dist/esm/hooks/useOnElementResize.js +26 -0
  86. package/dist/esm/hooks/useOnElementResize.js.map +7 -0
  87. package/dist/esm/hooks/useParentElement.js +14 -0
  88. package/dist/esm/hooks/useParentElement.js.map +7 -0
  89. package/dist/esm/hooks/usePrevious.js +15 -0
  90. package/dist/esm/hooks/usePrevious.js.map +7 -0
  91. package/dist/esm/hooks/useResizeObserver.js +31 -0
  92. package/dist/esm/hooks/useResizeObserver.js.map +7 -0
  93. package/dist/esm/hooks/useSetRef.js +13 -0
  94. package/dist/esm/hooks/useSetRef.js.map +7 -0
  95. package/dist/esm/hooks/useShouldRecalculate.js +15 -0
  96. package/dist/esm/hooks/useShouldRecalculate.js.map +7 -0
  97. package/{esm → dist/esm}/hooks/useWindowScrollerList.js +20 -29
  98. package/dist/esm/hooks/useWindowScrollerList.js.map +7 -0
  99. package/dist/esm/hooks/useWindowSize.js +28 -0
  100. package/dist/esm/hooks/useWindowSize.js.map +7 -0
  101. package/dist/esm/index.js +206 -0
  102. package/dist/esm/index.js.map +7 -0
  103. package/dist/esm/onClickHandlerForNonInteractiveElements.js +20 -0
  104. package/dist/esm/onClickHandlerForNonInteractiveElements.js.map +7 -0
  105. package/dist/esm/operators.js +39 -0
  106. package/dist/esm/operators.js.map +7 -0
  107. package/dist/esm/platform.js +8 -0
  108. package/dist/esm/platform.js.map +7 -0
  109. package/dist/esm/reactTypesUtility.js +29 -0
  110. package/dist/esm/reactTypesUtility.js.map +7 -0
  111. package/dist/esm/scrollingTimer.js +17 -0
  112. package/dist/esm/scrollingTimer.js.map +7 -0
  113. package/dist/esm/system.js +31 -0
  114. package/dist/esm/system.js.map +7 -0
  115. package/dist/esm/timeUtils.js +14 -0
  116. package/dist/esm/timeUtils.js.map +7 -0
  117. package/dist/esm/utils.js +154 -0
  118. package/dist/esm/utils.js.map +7 -0
  119. package/dist/esm/validations.js +28 -0
  120. package/dist/esm/validations.js.map +7 -0
  121. package/package.json +80 -75
  122. package/cjs/capitalize.js +0 -7
  123. package/cjs/compose.js +0 -38
  124. package/cjs/getComponentFromProps.js +0 -30
  125. package/cjs/hooks/index.js +0 -65
  126. package/cjs/hooks/useCancellableDelayedCallback.js +0 -26
  127. package/cjs/hooks/useDerivedStateFromProps.js +0 -56
  128. package/cjs/hooks/useExecutionTimer.js +0 -31
  129. package/cjs/hooks/useExpandState.js +0 -133
  130. package/cjs/hooks/useFocusTrap.js +0 -31
  131. package/cjs/hooks/useHotkeys.js +0 -25
  132. package/cjs/hooks/useHoverHandlersDelay.js +0 -28
  133. package/cjs/hooks/useIsShowingEllipsis.js +0 -36
  134. package/cjs/hooks/useOnElementResize.js +0 -38
  135. package/cjs/hooks/useParentElement.js +0 -16
  136. package/cjs/hooks/usePrevious.js +0 -13
  137. package/cjs/hooks/useResizeObserver.js +0 -33
  138. package/cjs/hooks/useSetRef.js +0 -15
  139. package/cjs/hooks/useShouldRecalculate.js +0 -17
  140. package/cjs/hooks/useWindowScrollerList.js +0 -65
  141. package/cjs/hooks/useWindowSize.js +0 -27
  142. package/cjs/index.js +0 -270
  143. package/cjs/onClickHandlerForNonInteractiveElements.js +0 -22
  144. package/cjs/operators.js +0 -63
  145. package/cjs/platform.js +0 -9
  146. package/cjs/reactTypesUtility.js +0 -35
  147. package/cjs/scrollingTimer.js +0 -24
  148. package/cjs/system.js +0 -43
  149. package/cjs/timeUtils.js +0 -25
  150. package/cjs/utils.js +0 -263
  151. package/cjs/validations.js +0 -44
  152. package/esm/capitalize.js +0 -3
  153. package/esm/compose.js +0 -34
  154. package/esm/getComponentFromProps.js +0 -23
  155. package/esm/hooks/index.js +0 -20
  156. package/esm/hooks/useCancellableDelayedCallback.js +0 -24
  157. package/esm/hooks/useDerivedStateFromProps.js +0 -54
  158. package/esm/hooks/useExecutionTimer.js +0 -29
  159. package/esm/hooks/useExpandState.js +0 -127
  160. package/esm/hooks/useFocusTrap.js +0 -27
  161. package/esm/hooks/useHotkeys.js +0 -19
  162. package/esm/hooks/useOnElementResize.js +0 -34
  163. package/esm/hooks/useParentElement.js +0 -12
  164. package/esm/hooks/usePrevious.js +0 -11
  165. package/esm/hooks/useResizeObserver.js +0 -26
  166. package/esm/hooks/useSetRef.js +0 -11
  167. package/esm/hooks/useShouldRecalculate.js +0 -15
  168. package/esm/hooks/useWindowSize.js +0 -25
  169. package/esm/index.js +0 -33
  170. package/esm/onClickHandlerForNonInteractiveElements.js +0 -20
  171. package/esm/operators.js +0 -46
  172. package/esm/platform.js +0 -4
  173. package/esm/reactTypesUtility.js +0 -22
  174. package/esm/scrollingTimer.js +0 -20
  175. package/esm/system.js +0 -37
  176. package/esm/timeUtils.js +0 -20
  177. package/esm/utils.js +0 -99
  178. package/esm/validations.js +0 -38
  179. package/types/capitalize.d.ts +0 -1
  180. package/types/compose.d.ts +0 -11
  181. package/types/getComponentFromProps.d.ts +0 -2
  182. package/types/hooks/index.d.ts +0 -20
  183. package/types/hooks/useCancellableDelayedCallback.d.ts +0 -1
  184. package/types/hooks/useDerivedStateFromProps.d.ts +0 -1
  185. package/types/hooks/useExecutionTimer.d.ts +0 -1
  186. package/types/hooks/useExpandState.d.ts +0 -22
  187. package/types/hooks/useFocusTrap.d.ts +0 -8
  188. package/types/hooks/useHotkeys.d.ts +0 -5
  189. package/types/hooks/useHoverHandlersDelay.d.ts +0 -9
  190. package/types/hooks/useIsShowingEllipsis.d.ts +0 -5
  191. package/types/hooks/useOnElementResize.d.ts +0 -2
  192. package/types/hooks/useParentElement.d.ts +0 -1
  193. package/types/hooks/usePrevious.d.ts +0 -2
  194. package/types/hooks/useResizeObserver.d.ts +0 -2
  195. package/types/hooks/useSetRef.d.ts +0 -2
  196. package/types/hooks/useShouldRecalculate.d.ts +0 -1
  197. package/types/hooks/useWindowScrollerList.d.ts +0 -4
  198. package/types/hooks/useWindowSize.d.ts +0 -1
  199. package/types/index.d.ts +0 -13
  200. package/types/onClickHandlerForNonInteractiveElements.d.ts +0 -12
  201. package/types/operators.d.ts +0 -31
  202. package/types/platform.d.ts +0 -2
  203. package/types/reactTypesUtility.d.ts +0 -6
  204. package/types/scrollingTimer.d.ts +0 -1
  205. package/types/system.d.ts +0 -3
  206. package/types/timeUtils.d.ts +0 -7
  207. package/types/utils.d.ts +0 -23
  208. package/types/validations.d.ts +0 -23
@@ -0,0 +1,206 @@
1
+ import * as React from "react";
2
+ import { default as default2 } from "./getComponentFromProps";
3
+ import { default as default3 } from "./onClickHandlerForNonInteractiveElements";
4
+ import { capitalize } from "./capitalize";
5
+ import {
6
+ checkNotEmpty,
7
+ checkEmpty,
8
+ greaterThan,
9
+ validDate,
10
+ equal,
11
+ notEqual,
12
+ isNull,
13
+ isNotNull,
14
+ isIn,
15
+ isNotIn,
16
+ greaterThanOrEquals,
17
+ lessThanOrEquals,
18
+ startsWith,
19
+ contains
20
+ } from "./operators";
21
+ import {
22
+ cx,
23
+ runAll,
24
+ hashArray,
25
+ safeCall,
26
+ removeUndefinedProperties,
27
+ isObject,
28
+ curry,
29
+ arrayMove,
30
+ uniq,
31
+ filter,
32
+ uniqBy,
33
+ groupBy,
34
+ property,
35
+ get,
36
+ set,
37
+ cloneDeep,
38
+ debounce,
39
+ findIndex,
40
+ isEmpty,
41
+ isString,
42
+ isEqual,
43
+ maxBy,
44
+ meanBy,
45
+ noop,
46
+ omit,
47
+ orderBy,
48
+ pull,
49
+ sortBy,
50
+ sumBy,
51
+ transform,
52
+ isFunction,
53
+ range,
54
+ parseInt,
55
+ padStart,
56
+ isNaN,
57
+ values,
58
+ throttle,
59
+ toggleInObject,
60
+ toggleInArray,
61
+ pick,
62
+ pickBy,
63
+ differenceBy,
64
+ differenceWith,
65
+ addOrRemove,
66
+ isEqualWith,
67
+ isBoolean
68
+ } from "./utils";
69
+ import { setRef, mergeRefs, logger } from "./system";
70
+ import {
71
+ useMeasure,
72
+ useForceUpdate,
73
+ useOnClickOutside,
74
+ useUncontrolled,
75
+ useExecutionTimer,
76
+ useExpandState,
77
+ useHotkeys,
78
+ useHoverHandlersDelay,
79
+ useResizeObserver,
80
+ useShouldRecalculate,
81
+ useWindowScrollerList,
82
+ useWindowSize,
83
+ usePrevious,
84
+ useCancellableDelayedCallback,
85
+ useDerivedStateFromProps,
86
+ useSetRef,
87
+ useParentElement,
88
+ useOnElementResize,
89
+ useIsShowingEllipsis
90
+ } from "./hooks";
91
+ import { getVisibleTimeByFormat, addLeadingZeros } from "./timeUtils";
92
+ import { compose } from "./compose";
93
+ import { DOCUMENT, WINDOW } from "./platform";
94
+ import {
95
+ isClassComponent,
96
+ isFunctionComponent,
97
+ isReactComponent,
98
+ isElement,
99
+ isDOMTypeElement,
100
+ isCompositeTypeElement
101
+ } from "./reactTypesUtility";
102
+ import { resetTimer } from "./scrollingTimer";
103
+ import { isRequired, isGreaterThan, isValidDate } from "./validations";
104
+ export {
105
+ DOCUMENT,
106
+ WINDOW,
107
+ addLeadingZeros,
108
+ addOrRemove,
109
+ arrayMove,
110
+ capitalize,
111
+ checkEmpty,
112
+ checkNotEmpty,
113
+ cloneDeep,
114
+ compose,
115
+ contains,
116
+ curry,
117
+ cx,
118
+ debounce,
119
+ differenceBy,
120
+ differenceWith,
121
+ equal,
122
+ filter,
123
+ findIndex,
124
+ get,
125
+ default2 as getComponentFromProps,
126
+ getVisibleTimeByFormat,
127
+ greaterThan,
128
+ greaterThanOrEquals,
129
+ groupBy,
130
+ hashArray,
131
+ isBoolean,
132
+ isClassComponent,
133
+ isCompositeTypeElement,
134
+ isDOMTypeElement,
135
+ isElement,
136
+ isEmpty,
137
+ isEqual,
138
+ isEqualWith,
139
+ isFunction,
140
+ isFunctionComponent,
141
+ isGreaterThan,
142
+ isIn,
143
+ isNaN,
144
+ isNotIn,
145
+ isNotNull,
146
+ isNull,
147
+ isObject,
148
+ isReactComponent,
149
+ isRequired,
150
+ isString,
151
+ isValidDate,
152
+ lessThanOrEquals,
153
+ logger,
154
+ maxBy,
155
+ meanBy,
156
+ mergeRefs,
157
+ noop,
158
+ notEqual,
159
+ omit,
160
+ default3 as onClickHandlerForNonInteractiveElements,
161
+ orderBy,
162
+ padStart,
163
+ parseInt,
164
+ pick,
165
+ pickBy,
166
+ property,
167
+ pull,
168
+ range,
169
+ removeUndefinedProperties,
170
+ resetTimer,
171
+ runAll,
172
+ safeCall,
173
+ set,
174
+ setRef,
175
+ sortBy,
176
+ startsWith,
177
+ sumBy,
178
+ throttle,
179
+ toggleInArray,
180
+ toggleInObject,
181
+ transform,
182
+ uniq,
183
+ uniqBy,
184
+ useCancellableDelayedCallback,
185
+ useDerivedStateFromProps,
186
+ useExecutionTimer,
187
+ useExpandState,
188
+ useForceUpdate,
189
+ useHotkeys,
190
+ useHoverHandlersDelay,
191
+ useIsShowingEllipsis,
192
+ useMeasure,
193
+ useOnClickOutside,
194
+ useOnElementResize,
195
+ useParentElement,
196
+ usePrevious,
197
+ useResizeObserver,
198
+ useSetRef,
199
+ useShouldRecalculate,
200
+ useUncontrolled,
201
+ useWindowScrollerList,
202
+ useWindowSize,
203
+ validDate,
204
+ values
205
+ };
206
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { default as getComponentFromProps } from './getComponentFromProps';\nexport { default as onClickHandlerForNonInteractiveElements } from './onClickHandlerForNonInteractiveElements';\nexport { capitalize } from './capitalize';\nexport {\n checkNotEmpty,\n checkEmpty,\n greaterThan,\n validDate,\n equal,\n notEqual,\n isNull,\n isNotNull,\n isIn,\n isNotIn,\n greaterThanOrEquals,\n lessThanOrEquals,\n startsWith,\n contains,\n} from './operators';\nexport {\n cx,\n runAll,\n hashArray,\n safeCall,\n removeUndefinedProperties,\n isObject,\n curry,\n arrayMove,\n uniq,\n filter,\n uniqBy,\n groupBy,\n property,\n get,\n set,\n cloneDeep,\n debounce,\n findIndex,\n isEmpty,\n isString,\n isEqual,\n maxBy,\n meanBy,\n noop,\n omit,\n orderBy,\n pull,\n sortBy,\n sumBy,\n transform,\n isFunction,\n range,\n parseInt,\n padStart,\n isNaN,\n values,\n throttle,\n toggleInObject,\n toggleInArray,\n pick,\n pickBy,\n differenceBy,\n differenceWith,\n addOrRemove,\n isEqualWith,\n isBoolean,\n} from './utils';\nexport { setRef, mergeRefs, logger } from './system';\nexport {\n useMeasure,\n useForceUpdate,\n useOnClickOutside,\n useUncontrolled,\n useExecutionTimer,\n useExpandState,\n useHotkeys,\n useHoverHandlersDelay,\n useResizeObserver,\n useShouldRecalculate,\n useWindowScrollerList,\n useWindowSize,\n usePrevious,\n useCancellableDelayedCallback,\n useDerivedStateFromProps,\n useSetRef,\n useParentElement,\n useOnElementResize,\n useIsShowingEllipsis,\n} from './hooks';\nexport { getVisibleTimeByFormat, addLeadingZeros } from './timeUtils';\nexport { compose } from './compose';\nexport { DOCUMENT, WINDOW } from './platform';\nexport {\n isClassComponent,\n isFunctionComponent,\n isReactComponent,\n isElement,\n isDOMTypeElement,\n isCompositeTypeElement,\n} from './reactTypesUtility';\nexport { resetTimer } from './scrollingTimer';\nexport { isRequired, isGreaterThan, isValidDate } from './validations';\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgDA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AACA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ const onClickHandlerForNonInteractiveElements = (onClickHandler) => ({
3
+ role: "button",
4
+ tabIndex: "0",
5
+ onClick: onClickHandler,
6
+ onKeyPress: (event) => {
7
+ event.stopPropagation();
8
+ const { keycode, key } = event;
9
+ if (key === "Enter")
10
+ onClickHandler(event);
11
+ else if (keycode === 13)
12
+ onClickHandler(event);
13
+ }
14
+ });
15
+ var onClickHandlerForNonInteractiveElements_default = onClickHandlerForNonInteractiveElements;
16
+ export {
17
+ onClickHandlerForNonInteractiveElements_default as default,
18
+ onClickHandlerForNonInteractiveElements
19
+ };
20
+ //# sourceMappingURL=onClickHandlerForNonInteractiveElements.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/onClickHandlerForNonInteractiveElements.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/**\n * onClickHandler: callback\n *\n * @param onClickHandler\n */\nexport const onClickHandlerForNonInteractiveElements = onClickHandler => ({\n role: 'button',\n tabIndex: '0',\n onClick: onClickHandler,\n onKeyPress: event => {\n event.stopPropagation();\n const { keycode, key } = event;\n if (key === 'Enter') onClickHandler(event);\n else if (keycode === 13) onClickHandler(event);\n },\n});\n\nexport default onClickHandlerForNonInteractiveElements;\n"],
5
+ "mappings": "AAAA;ACKO,MAAM,0CAA0C,oBAAmB;AAAA,EACxE,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY,WAAS;AACnB,UAAM;AACN,UAAM,EAAE,SAAS,QAAQ;AACzB,QAAI,QAAQ;AAAS,qBAAe;AAAA,aAC3B,YAAY;AAAI,qBAAe;AAAA;AAAA;AAI5C,IAAO,kDAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,39 @@
1
+ import * as React from "react";
2
+ import { isEmpty } from "lodash";
3
+ const checkNotEmpty = (value) => value === "" || value === void 0 || value == [] || value === null || isEmpty(value);
4
+ const checkEmpty = (value) => !isEmpty(value);
5
+ const greaterThan = (value, comparator) => value > comparator;
6
+ const validDate = (value) => {
7
+ const dateValidationRegex = /^\d{1,2}\/\d{1,2}\/\d{4}$/;
8
+ if (!dateValidationRegex.test(value))
9
+ return false;
10
+ const [m, d, y] = value.split("/").map((n) => Number(n));
11
+ return m === Number(new Date(y, m - 1, d).getMonth()) + 1 && d === Number(new Date(y, m - 1, d).getDate());
12
+ };
13
+ const equal = (a, b) => a === b;
14
+ const notEqual = (a, b) => !equal(a, b);
15
+ const isNull = (a) => checkNotEmpty(a);
16
+ const isNotNull = (a) => !isNull(a);
17
+ const isIn = (a, b) => b.indexOf(a) > -1;
18
+ const isNotIn = (a, b) => !isIn(a, b);
19
+ const greaterThanOrEquals = (value, comparator) => value >= comparator;
20
+ const lessThanOrEquals = (value, comparator) => value <= comparator;
21
+ const startsWith = (value, comparator) => String(value).startsWith(comparator);
22
+ const contains = (value, comparator) => String(value).includes(comparator);
23
+ export {
24
+ checkEmpty,
25
+ checkNotEmpty,
26
+ contains,
27
+ equal,
28
+ greaterThan,
29
+ greaterThanOrEquals,
30
+ isIn,
31
+ isNotIn,
32
+ isNotNull,
33
+ isNull,
34
+ lessThanOrEquals,
35
+ notEqual,
36
+ startsWith,
37
+ validDate
38
+ };
39
+ //# sourceMappingURL=operators.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/operators.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { isEmpty } from 'lodash';\n/**\n * Check if the value is null undefined ''\n *\n * @param value\n */\nexport const checkNotEmpty = (value) =>\n value === '' || value === undefined || value == [] || value === null || isEmpty(value);\n\nexport const checkEmpty = (value) => !isEmpty(value)\n/**\n * @param value: number\n * @param comparator: number\n * @param value\n * @param comparator\n */\nexport const greaterThan = (value, comparator) => value > comparator;\n\n/**\n * Check if a valid date with format MM/DD/YYYY\n *\n * @param {*} value: string\n * @param value\n */\nexport const validDate = (value) => {\n const dateValidationRegex = /^\\d{1,2}\\/\\d{1,2}\\/\\d{4}$/;\n if (!dateValidationRegex.test(value)) return false;\n const [m, d, y] = value.split('/').map((n) => Number(n));\n return (\n m === Number(new Date(y, m - 1, d).getMonth()) + 1 &&\n d === Number(new Date(y, m - 1, d).getDate())\n );\n};\n\nexport const equal = (a, b) => a === b;\n\nexport const notEqual = (a, b) => !equal(a, b);\n\nexport const isNull = (a) => checkNotEmpty(a);\n\nexport const isNotNull = (a) => !isNull(a);\n\nexport const isIn = (a, b) => b.indexOf(a) > -1;\n\nexport const isNotIn = (a, b) => !isIn(a, b);\n\nexport const greaterThanOrEquals = (value, comparator) => value >= comparator;\nexport const lessThanOrEquals = (value, comparator) => value <= comparator;\nexport const startsWith = (value, comparator) =>\n String(value).startsWith(comparator);\nexport const contains = (value, comparator) =>\n String(value).includes(comparator);\n"],
5
+ "mappings": "AAAA;ACAA;AAMO,MAAM,gBAAgB,CAAC,UAC5B,UAAU,MAAM,UAAU,UAAa,SAAS,MAAM,UAAU,QAAQ,QAAQ;AAE3E,MAAM,aAAa,CAAC,UAAU,CAAC,QAAQ;AAOvC,MAAM,cAAc,CAAC,OAAO,eAAe,QAAQ;AAQnD,MAAM,YAAY,CAAC,UAAU;AAClC,QAAM,sBAAsB;AAC5B,MAAI,CAAC,oBAAoB,KAAK;AAAQ,WAAO;AAC7C,QAAM,CAAC,GAAG,GAAG,KAAK,MAAM,MAAM,KAAK,IAAI,CAAC,MAAM,OAAO;AACrD,SACE,MAAM,OAAO,IAAI,KAAK,GAAG,IAAI,GAAG,GAAG,cAAc,KACjD,MAAM,OAAO,IAAI,KAAK,GAAG,IAAI,GAAG,GAAG;AAAA;AAIhC,MAAM,QAAQ,CAAC,GAAG,MAAM,MAAM;AAE9B,MAAM,WAAW,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG;AAErC,MAAM,SAAS,CAAC,MAAM,cAAc;AAEpC,MAAM,YAAY,CAAC,MAAM,CAAC,OAAO;AAEjC,MAAM,OAAO,CAAC,GAAG,MAAM,EAAE,QAAQ,KAAK;AAEtC,MAAM,UAAU,CAAC,GAAG,MAAM,CAAC,KAAK,GAAG;AAEnC,MAAM,sBAAsB,CAAC,OAAO,eAAe,SAAS;AAC5D,MAAM,mBAAmB,CAAC,OAAO,eAAe,SAAS;AACzD,MAAM,aAAa,CAAC,OAAO,eAChC,OAAO,OAAO,WAAW;AACpB,MAAM,WAAW,CAAC,OAAO,eAC9B,OAAO,OAAO,SAAS;",
6
+ "names": []
7
+ }
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ const DOCUMENT = typeof document !== "undefined" ? document : null;
3
+ const WINDOW = typeof window !== "undefined" ? window : null;
4
+ export {
5
+ DOCUMENT,
6
+ WINDOW
7
+ };
8
+ //# sourceMappingURL=platform.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/platform.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DOCUMENT = typeof document !== 'undefined' ? document : null;\nexport const WINDOW = typeof window !== 'undefined' ? window : null;\n"],
5
+ "mappings": "AAAA;ACAO,MAAM,WAAW,OAAO,aAAa,cAAc,WAAW;AAC9D,MAAM,SAAS,OAAO,WAAW,cAAc,SAAS;",
6
+ "names": []
7
+ }
@@ -0,0 +1,29 @@
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ function isClassComponent(component) {
4
+ return !!(typeof component === "function" && !!component.prototype.isReactComponent);
5
+ }
6
+ function isFunctionComponent(component) {
7
+ return typeof component === "function" && String(component).includes("return React.createElement");
8
+ }
9
+ function isReactComponent(component) {
10
+ return !!(isClassComponent(component) || isFunctionComponent(component));
11
+ }
12
+ function isElement(element) {
13
+ return React2.isValidElement(element);
14
+ }
15
+ function isDOMTypeElement(element) {
16
+ return isElement(element) && typeof element.type === "string";
17
+ }
18
+ function isCompositeTypeElement(element) {
19
+ return isElement(element) && typeof element.type === "function";
20
+ }
21
+ export {
22
+ isClassComponent,
23
+ isCompositeTypeElement,
24
+ isDOMTypeElement,
25
+ isElement,
26
+ isFunctionComponent,
27
+ isReactComponent
28
+ };
29
+ //# sourceMappingURL=reactTypesUtility.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/reactTypesUtility.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\n\nexport function isClassComponent(component) {\n return !!(typeof component === 'function' && !!component.prototype.isReactComponent);\n}\n\nexport function isFunctionComponent(component) {\n return typeof component === 'function' && String(component).includes('return React.createElement');\n}\n\nexport function isReactComponent(component) {\n return !!(isClassComponent(component) || isFunctionComponent(component));\n}\n\nexport function isElement(element) {\n return React.isValidElement(element);\n}\n\nexport function isDOMTypeElement(element) {\n return isElement(element) && typeof element.type === 'string';\n}\n\nexport function isCompositeTypeElement(element) {\n return isElement(element) && typeof element.type === 'function';\n}\n"],
5
+ "mappings": "AAAA;ACAA;AAEO,0BAA0B,WAAW;AAC1C,SAAO,CAAC,CAAE,QAAO,cAAc,cAAc,CAAC,CAAC,UAAU,UAAU;AAAA;AAG9D,6BAA6B,WAAW;AAC7C,SAAO,OAAO,cAAc,cAAc,OAAO,WAAW,SAAS;AAAA;AAGhE,0BAA0B,WAAW;AAC1C,SAAO,CAAC,CAAE,kBAAiB,cAAc,oBAAoB;AAAA;AAGxD,mBAAmB,SAAS;AACjC,SAAO,OAAM,eAAe;AAAA;AAGvB,0BAA0B,SAAS;AACxC,SAAO,UAAU,YAAY,OAAO,QAAQ,SAAS;AAAA;AAGhD,gCAAgC,SAAS;AAC9C,SAAO,UAAU,YAAY,OAAO,QAAQ,SAAS;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,17 @@
1
+ import * as React from "react";
2
+ const resetTimer = (func) => {
3
+ let timeout;
4
+ return function(...args) {
5
+ const context = this;
6
+ const lastCall = () => {
7
+ timeout = null;
8
+ func.apply(context, args);
9
+ };
10
+ clearTimeout(timeout);
11
+ timeout = setTimeout(lastCall, 300);
12
+ };
13
+ };
14
+ export {
15
+ resetTimer
16
+ };
17
+ //# sourceMappingURL=scrollingTimer.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/scrollingTimer.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const resetTimer = (func) => {\n let timeout;\n return function(...args) {\n const context = this;\n\n const lastCall = () => {\n timeout = null;\n func.apply(context, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(lastCall, 300);\n };\n};\n"],
5
+ "mappings": "AAAA;ACAO,MAAM,aAAa,CAAC,SAAS;AAClC,MAAI;AACJ,SAAO,YAAY,MAAM;AACvB,UAAM,UAAU;AAEhB,UAAM,WAAW,MAAM;AACrB,gBAAU;AACV,WAAK,MAAM,SAAS;AAAA;AAGtB,iBAAa;AACb,cAAU,WAAW,UAAU;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,31 @@
1
+ import * as React from "react";
2
+ import { isFunction } from "./utils";
3
+ const setRef = (ref, value) => {
4
+ if (isFunction(ref)) {
5
+ ref(value);
6
+ } else if (ref) {
7
+ ref.current = value;
8
+ }
9
+ };
10
+ function mergeRefs(...refs) {
11
+ return (node) => {
12
+ if (!node)
13
+ return;
14
+ refs.forEach((ref) => {
15
+ if (isFunction(ref)) {
16
+ ref(node);
17
+ } else if (ref) {
18
+ ref.current = node;
19
+ }
20
+ });
21
+ };
22
+ }
23
+ function logger(...args) {
24
+ console.log(...args);
25
+ }
26
+ export {
27
+ logger,
28
+ mergeRefs,
29
+ setRef
30
+ };
31
+ //# sourceMappingURL=system.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/system.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { isFunction } from './utils';\n\nexport const setRef = (ref, value) => {\n if (isFunction(ref)) {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n};\n\nexport function mergeRefs(...refs) {\n return (node) => {\n if (!node) return;\n refs.forEach((ref) => {\n if (isFunction(ref)) {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n });\n };\n}\n\nexport function logger(...args) {\n // eslint-disable-next-line no-console\n console.log(...args);\n}\n"],
5
+ "mappings": "AAAA;ACAA;AAEO,MAAM,SAAS,CAAC,KAAK,UAAU;AACpC,MAAI,WAAW,MAAM;AACnB,QAAI;AAAA,aACK,KAAK;AACd,QAAI,UAAU;AAAA;AAAA;AAIX,sBAAsB,MAAM;AACjC,SAAO,CAAC,SAAS;AACf,QAAI,CAAC;AAAM;AACX,SAAK,QAAQ,CAAC,QAAQ;AACpB,UAAI,WAAW,MAAM;AACnB,YAAI;AAAA,iBACK,KAAK;AACd,YAAI,UAAU;AAAA;AAAA;AAAA;AAAA;AAMf,mBAAmB,MAAM;AAE9B,UAAQ,IAAI,GAAG;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ import { padStart } from "./utils";
3
+ const getVisibleTimeByFormat = (format) => ({
4
+ showHours: format.indexOf("H") > -1 || format.indexOf("h") > -1 || format.indexOf("k") > -1,
5
+ showMinutes: format.indexOf("m") > -1,
6
+ showSeconds: format.indexOf("s") > -1,
7
+ use12Hours: format.indexOf("A") > -1 || format.indexOf("h") > -1 || format.indexOf("a") > -1
8
+ });
9
+ const addLeadingZeros = (count) => (number) => padStart(String(number), count, "0");
10
+ export {
11
+ addLeadingZeros,
12
+ getVisibleTimeByFormat
13
+ };
14
+ //# sourceMappingURL=timeUtils.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/timeUtils.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { padStart } from './utils';\n\nexport const getVisibleTimeByFormat = format => ({\n showHours:\n format.indexOf('H') > -1 ||\n format.indexOf('h') > -1 ||\n format.indexOf('k') > -1,\n showMinutes: format.indexOf('m') > -1,\n showSeconds: format.indexOf('s') > -1,\n use12Hours:\n format.indexOf('A') > -1 ||\n format.indexOf('h') > -1 ||\n format.indexOf('a') > -1,\n});\n\nexport const addLeadingZeros = count => number =>\n padStart(String(number), count, '0');\n"],
5
+ "mappings": "AAAA;ACAA;AAEO,MAAM,yBAAyB,YAAW;AAAA,EAC/C,WACE,OAAO,QAAQ,OAAO,MACtB,OAAO,QAAQ,OAAO,MACtB,OAAO,QAAQ,OAAO;AAAA,EACxB,aAAa,OAAO,QAAQ,OAAO;AAAA,EACnC,aAAa,OAAO,QAAQ,OAAO;AAAA,EACnC,YACE,OAAO,QAAQ,OAAO,MACtB,OAAO,QAAQ,OAAO,MACtB,OAAO,QAAQ,OAAO;AAAA;AAGnB,MAAM,kBAAkB,WAAS,YACtC,SAAS,OAAO,SAAS,OAAO;",
6
+ "names": []
7
+ }
@@ -0,0 +1,154 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import * as React from "react";
21
+ import {
22
+ cloneDeep,
23
+ filter,
24
+ debounce,
25
+ findIndex,
26
+ isEmpty,
27
+ isString,
28
+ isEqual,
29
+ noop,
30
+ omit,
31
+ orderBy,
32
+ pull,
33
+ sumBy,
34
+ maxBy,
35
+ meanBy,
36
+ sortBy,
37
+ transform,
38
+ isFunction,
39
+ uniq,
40
+ uniqBy,
41
+ groupBy,
42
+ property,
43
+ get,
44
+ set,
45
+ range,
46
+ parseInt,
47
+ padStart,
48
+ isNaN,
49
+ values,
50
+ throttle,
51
+ pick,
52
+ pickBy,
53
+ differenceBy,
54
+ differenceWith,
55
+ isEqualWith,
56
+ curry,
57
+ isObject,
58
+ isBoolean
59
+ } from "lodash";
60
+ const cx = (...classnames) => classnames.reduce((result, cn) => `${result} ${cn || ""}`, "");
61
+ const toggleInObject = (obj, key, value) => obj[key] !== void 0 ? omit(obj, [key]) : __spreadProps(__spreadValues({}, obj), { [key]: value });
62
+ const toggleInArray = (array, value) => array.indexOf(value) === -1 ? [value] : [];
63
+ const arrayMoveMutate = (array, from, to) => {
64
+ array.splice(to < 0 ? array.length + to : to, 0, array.splice(from, 1)[0]);
65
+ };
66
+ const arrayMove = (array, from, to) => {
67
+ array = array.slice();
68
+ arrayMoveMutate(array, from, to);
69
+ return array;
70
+ };
71
+ const accessorDefault = (item) => item;
72
+ const addOrRemove = (array, item, accessor = accessorDefault) => {
73
+ const index = array.findIndex((iItem) => accessor(iItem) === accessor(item));
74
+ if (index !== -1) {
75
+ const nextArray = cloneDeep(array);
76
+ nextArray.splice(index, 1);
77
+ return nextArray;
78
+ }
79
+ return [...array, item];
80
+ };
81
+ function runAll(...fns) {
82
+ return (...args) => fns.forEach((fn) => {
83
+ if (Array.isArray(fn))
84
+ runAll(fn);
85
+ if (isFunction(fn))
86
+ fn(...args);
87
+ });
88
+ }
89
+ function hashArray(arr, fieldName) {
90
+ return arr.reduce((result, item) => __spreadProps(__spreadValues({}, result), {
91
+ [fieldName ? item[fieldName] : item]: true
92
+ }), {});
93
+ }
94
+ function safeCall(fun, ...args) {
95
+ if (isFunction(fun)) {
96
+ fun(...args);
97
+ }
98
+ }
99
+ const removeUndefinedProperties = (obj) => {
100
+ const cleanObject = __spreadValues({}, obj);
101
+ Object.keys(obj).forEach((key) => cleanObject[key] === void 0 && delete cleanObject[key]);
102
+ return cleanObject;
103
+ };
104
+ var utils_default = {};
105
+ export {
106
+ addOrRemove,
107
+ arrayMove,
108
+ cloneDeep,
109
+ curry,
110
+ cx,
111
+ debounce,
112
+ utils_default as default,
113
+ differenceBy,
114
+ differenceWith,
115
+ filter,
116
+ findIndex,
117
+ get,
118
+ groupBy,
119
+ hashArray,
120
+ isBoolean,
121
+ isEmpty,
122
+ isEqual,
123
+ isEqualWith,
124
+ isFunction,
125
+ isNaN,
126
+ isObject,
127
+ isString,
128
+ maxBy,
129
+ meanBy,
130
+ noop,
131
+ omit,
132
+ orderBy,
133
+ padStart,
134
+ parseInt,
135
+ pick,
136
+ pickBy,
137
+ property,
138
+ pull,
139
+ range,
140
+ removeUndefinedProperties,
141
+ runAll,
142
+ safeCall,
143
+ set,
144
+ sortBy,
145
+ sumBy,
146
+ throttle,
147
+ toggleInArray,
148
+ toggleInObject,
149
+ transform,
150
+ uniq,
151
+ uniqBy,
152
+ values
153
+ };
154
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/utils.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-param-reassign */\n/* eslint-disable max-lines */\n/**\n * commonly used functions\n * Add a level of indirection to lodash so we can replace\n * it if desired, while keeping function names the same\n */\n// TODO: Import individual packages vs referencing all of lodash\nimport {\n cloneDeep,\n filter,\n debounce,\n findIndex,\n isEmpty,\n isString,\n isEqual,\n noop,\n omit,\n orderBy,\n pull,\n sumBy,\n maxBy,\n meanBy,\n sortBy,\n transform,\n isFunction,\n uniq,\n uniqBy,\n groupBy,\n property,\n get,\n set,\n range,\n parseInt,\n padStart,\n isNaN,\n values,\n throttle,\n pick,\n pickBy,\n differenceBy,\n differenceWith,\n isEqualWith,\n curry,\n isObject,\n isBoolean,\n} from 'lodash';\n\n/**\n * Concatenates classNames from arguments\n *\n * @param {...any} classnames\n */\nexport const cx = (...classnames) => classnames.reduce((result, cn) => `${result} ${cn || ''}`, '');\n\n// if entry exists, remove it, if not, add it\nconst toggleInObject = (obj, key, value) => (obj[key] !== undefined ? omit(obj, [key]) : { ...obj, [key]: value });\nconst toggleInArray = (array, value) => (array.indexOf(value) === -1 ? [value] : []);\n\nconst arrayMoveMutate = (array, from, to) => {\n array.splice(to < 0 ? array.length + to : to, 0, array.splice(from, 1)[0]);\n};\n\nconst arrayMove = (array, from, to) => {\n array = array.slice();\n arrayMoveMutate(array, from, to);\n return array;\n};\n\nconst accessorDefault = (item) => item;\nconst addOrRemove = (array, item, accessor = accessorDefault) => {\n const index = array.findIndex((iItem) => accessor(iItem) === accessor(item));\n\n if (index !== -1) {\n const nextArray = cloneDeep(array);\n nextArray.splice(index, 1);\n return nextArray;\n }\n\n return [...array, item];\n};\n\nexport function runAll(...fns) {\n return (...args) =>\n fns.forEach((fn) => {\n if (Array.isArray(fn)) runAll(fn);\n if (isFunction(fn)) fn(...args);\n });\n}\n\nexport function hashArray(arr, fieldName) {\n return arr.reduce(\n (result, item) => ({\n ...result,\n [fieldName ? item[fieldName] : item]: true,\n }),\n {},\n );\n}\n\nexport function safeCall(fun, ...args) {\n if (isFunction(fun)) {\n fun(...args);\n }\n}\n\nexport const removeUndefinedProperties = (obj) => {\n const cleanObject = { ...obj };\n Object.keys(obj).forEach((key) => cleanObject[key] === undefined && delete cleanObject[key]);\n return cleanObject;\n};\n\nexport default {};\nexport {\n isObject,\n curry,\n arrayMove,\n uniq,\n filter,\n uniqBy,\n groupBy,\n property,\n get,\n set,\n cloneDeep,\n debounce,\n findIndex,\n isEmpty,\n isString,\n isEqual,\n maxBy,\n meanBy,\n noop,\n omit,\n orderBy,\n pull,\n sortBy,\n sumBy,\n transform,\n isFunction,\n range,\n parseInt,\n padStart,\n isNaN,\n values,\n throttle,\n toggleInObject,\n toggleInArray,\n pick,\n pickBy,\n differenceBy,\n differenceWith,\n addOrRemove,\n isEqualWith,\n isBoolean,\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6CO,MAAM,KAAK,IAAI,eAAe,WAAW,OAAO,CAAC,QAAQ,OAAO,GAAG,UAAU,MAAM,MAAM;AAGhG,MAAM,iBAAiB,CAAC,KAAK,KAAK,UAAW,IAAI,SAAS,SAAY,KAAK,KAAK,CAAC,QAAQ,iCAAK,MAAL,GAAW,MAAM;AAC1G,MAAM,gBAAgB,CAAC,OAAO,UAAW,MAAM,QAAQ,WAAW,KAAK,CAAC,SAAS;AAEjF,MAAM,kBAAkB,CAAC,OAAO,MAAM,OAAO;AAC3C,QAAM,OAAO,KAAK,IAAI,MAAM,SAAS,KAAK,IAAI,GAAG,MAAM,OAAO,MAAM,GAAG;AAAA;AAGzE,MAAM,YAAY,CAAC,OAAO,MAAM,OAAO;AACrC,UAAQ,MAAM;AACd,kBAAgB,OAAO,MAAM;AAC7B,SAAO;AAAA;AAGT,MAAM,kBAAkB,CAAC,SAAS;AAClC,MAAM,cAAc,CAAC,OAAO,MAAM,WAAW,oBAAoB;AAC/D,QAAM,QAAQ,MAAM,UAAU,CAAC,UAAU,SAAS,WAAW,SAAS;AAEtE,MAAI,UAAU,IAAI;AAChB,UAAM,YAAY,UAAU;AAC5B,cAAU,OAAO,OAAO;AACxB,WAAO;AAAA;AAGT,SAAO,CAAC,GAAG,OAAO;AAAA;AAGb,mBAAmB,KAAK;AAC7B,SAAO,IAAI,SACT,IAAI,QAAQ,CAAC,OAAO;AAClB,QAAI,MAAM,QAAQ;AAAK,aAAO;AAC9B,QAAI,WAAW;AAAK,SAAG,GAAG;AAAA;AAAA;AAIzB,mBAAmB,KAAK,WAAW;AACxC,SAAO,IAAI,OACT,CAAC,QAAQ,SAAU,iCACd,SADc;AAAA,KAEhB,YAAY,KAAK,aAAa,OAAO;AAAA,MAExC;AAAA;AAIG,kBAAkB,QAAQ,MAAM;AACrC,MAAI,WAAW,MAAM;AACnB,QAAI,GAAG;AAAA;AAAA;AAIJ,MAAM,4BAA4B,CAAC,QAAQ;AAChD,QAAM,cAAc,mBAAK;AACzB,SAAO,KAAK,KAAK,QAAQ,CAAC,QAAQ,YAAY,SAAS,UAAa,OAAO,YAAY;AACvF,SAAO;AAAA;AAGT,IAAO,gBAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
1
+ import * as React from "react";
2
+ import { checkNotEmpty, greaterThan, validDate } from "./operators";
3
+ const isRequired = ({ value, help = "Field is Required" }) => ({
4
+ payload: help,
5
+ error: checkNotEmpty(value)
6
+ });
7
+ const isGreaterThan = ({ value, help, comparator = 0 }) => {
8
+ if (!help)
9
+ help = `Max value ${comparator}`;
10
+ return {
11
+ payload: help,
12
+ error: greaterThan(value, comparator)
13
+ };
14
+ };
15
+ const isValidDate = ({ value, help, format = "MM/DD/AAA" }) => {
16
+ if (!help)
17
+ help = `Valid Date is required ${format}`;
18
+ return {
19
+ payload: help,
20
+ error: !validDate(value)
21
+ };
22
+ };
23
+ export {
24
+ isGreaterThan,
25
+ isRequired,
26
+ isValidDate
27
+ };
28
+ //# sourceMappingURL=validations.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/validations.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { checkNotEmpty, greaterThan, validDate } from './operators';\n\nexport const isRequired = ({ value, help = 'Field is Required' }) => ({\n payload: help,\n error: checkNotEmpty(value),\n});\n\nexport const isGreaterThan = ({ value, help, comparator = 0 }) => {\n if (!help) help = `Max value ${comparator}`;\n return {\n payload: help,\n error: greaterThan(value, comparator),\n };\n};\n\nexport const isValidDate = ({ value, help, format = 'MM/DD/AAA' }) => {\n if (!help) help = `Valid Date is required ${format}`;\n return {\n payload: help,\n error: !validDate(value),\n };\n};\n"],
5
+ "mappings": "AAAA;ACAA;AAEO,MAAM,aAAa,CAAC,EAAE,OAAO,OAAO,0BAA2B;AAAA,EACpE,SAAS;AAAA,EACT,OAAO,cAAc;AAAA;AAGhB,MAAM,gBAAgB,CAAC,EAAE,OAAO,MAAM,aAAa,QAAQ;AAChE,MAAI,CAAC;AAAM,WAAO,aAAa;AAC/B,SAAO;AAAA,IACL,SAAS;AAAA,IACT,OAAO,YAAY,OAAO;AAAA;AAAA;AAIvB,MAAM,cAAc,CAAC,EAAE,OAAO,MAAM,SAAS,kBAAkB;AACpE,MAAI,CAAC;AAAM,WAAO,0BAA0B;AAC5C,SAAO;AAAA,IACL,SAAS;AAAA,IACT,OAAO,CAAC,UAAU;AAAA;AAAA;",
6
+ "names": []
7
+ }