@elliemae/ds-utilities 2.3.0-alpha.9 → 2.3.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/cjs/capitalize.js +7 -0
  2. package/cjs/compose.js +38 -0
  3. package/cjs/getComponentFromProps.js +30 -0
  4. package/cjs/hooks/index.js +63 -0
  5. package/cjs/hooks/useCancellableDelayedCallback.js +26 -0
  6. package/cjs/hooks/useDerivedStateFromProps.js +56 -0
  7. package/cjs/hooks/useExecutionTimer.js +31 -0
  8. package/cjs/hooks/useExpandState.js +133 -0
  9. package/cjs/hooks/useHotkeys.js +25 -0
  10. package/cjs/hooks/useHoverHandlersDelay.js +28 -0
  11. package/cjs/hooks/useIsShowingEllipsis.js +36 -0
  12. package/cjs/hooks/useOnElementResize.js +38 -0
  13. package/cjs/hooks/useParentElement.js +16 -0
  14. package/cjs/hooks/usePrevious.js +13 -0
  15. package/cjs/hooks/useResizeObserver.js +33 -0
  16. package/cjs/hooks/useSetRef.js +15 -0
  17. package/cjs/hooks/useShouldRecalculate.js +17 -0
  18. package/cjs/hooks/useWindowScrollerList.js +65 -0
  19. package/cjs/hooks/useWindowSize.js +27 -0
  20. package/cjs/index.js +268 -0
  21. package/cjs/onClickHandlerForNonInteractiveElements.js +22 -0
  22. package/cjs/operators.js +63 -0
  23. package/cjs/platform.js +9 -0
  24. package/cjs/reactTypesUtility.js +35 -0
  25. package/cjs/scrollingTimer.js +24 -0
  26. package/cjs/system.js +43 -0
  27. package/cjs/timeUtils.js +25 -0
  28. package/cjs/utils.js +263 -0
  29. package/cjs/validations.js +44 -0
  30. package/esm/capitalize.js +3 -0
  31. package/esm/compose.js +34 -0
  32. package/esm/getComponentFromProps.js +23 -0
  33. package/esm/hooks/index.js +19 -0
  34. package/esm/hooks/useCancellableDelayedCallback.js +24 -0
  35. package/esm/hooks/useDerivedStateFromProps.js +54 -0
  36. package/esm/hooks/useExecutionTimer.js +29 -0
  37. package/esm/hooks/useExpandState.js +127 -0
  38. package/esm/hooks/useHotkeys.js +19 -0
  39. package/{dist/esm → esm}/hooks/useHoverHandlersDelay.js +12 -15
  40. package/{dist/esm → esm}/hooks/useIsShowingEllipsis.js +12 -9
  41. package/esm/hooks/useOnElementResize.js +34 -0
  42. package/esm/hooks/useParentElement.js +12 -0
  43. package/esm/hooks/usePrevious.js +11 -0
  44. package/esm/hooks/useResizeObserver.js +26 -0
  45. package/esm/hooks/useSetRef.js +11 -0
  46. package/esm/hooks/useShouldRecalculate.js +15 -0
  47. package/{dist/esm → esm}/hooks/useWindowScrollerList.js +29 -20
  48. package/esm/hooks/useWindowSize.js +25 -0
  49. package/esm/index.js +32 -0
  50. package/esm/onClickHandlerForNonInteractiveElements.js +20 -0
  51. package/esm/operators.js +46 -0
  52. package/esm/platform.js +4 -0
  53. package/esm/reactTypesUtility.js +22 -0
  54. package/esm/scrollingTimer.js +20 -0
  55. package/esm/system.js +37 -0
  56. package/esm/timeUtils.js +20 -0
  57. package/esm/utils.js +99 -0
  58. package/esm/validations.js +38 -0
  59. package/package.json +72 -74
  60. package/{dist/types → types}/capitalize.d.ts +0 -0
  61. package/{dist/types → types}/compose.d.ts +1 -2
  62. package/types/getComponentFromProps.d.ts +2 -0
  63. package/types/hooks/index.d.ts +19 -0
  64. package/types/hooks/useCancellableDelayedCallback.d.ts +1 -0
  65. package/types/hooks/useDerivedStateFromProps.d.ts +1 -0
  66. package/types/hooks/useExecutionTimer.d.ts +1 -0
  67. package/{dist/types → types}/hooks/useExpandState.d.ts +2 -3
  68. package/types/hooks/useHotkeys.d.ts +5 -0
  69. package/{dist/types → types}/hooks/useHoverHandlersDelay.d.ts +2 -3
  70. package/{dist/types → types}/hooks/useIsShowingEllipsis.d.ts +0 -0
  71. package/types/hooks/useOnElementResize.d.ts +2 -0
  72. package/{dist/types → types}/hooks/useParentElement.d.ts +0 -0
  73. package/types/hooks/usePrevious.d.ts +2 -0
  74. package/types/hooks/useResizeObserver.d.ts +2 -0
  75. package/{dist/types → types}/hooks/useSetRef.d.ts +0 -0
  76. package/types/hooks/useShouldRecalculate.d.ts +1 -0
  77. package/types/hooks/useWindowScrollerList.d.ts +4 -0
  78. package/types/hooks/useWindowSize.d.ts +1 -0
  79. package/types/index.d.ts +13 -0
  80. package/{dist/types → types}/onClickHandlerForNonInteractiveElements.d.ts +7 -7
  81. package/{dist/types → types}/operators.d.ts +0 -0
  82. package/{dist/types → types}/platform.d.ts +0 -0
  83. package/{dist/types → types}/reactTypesUtility.d.ts +0 -0
  84. package/types/scrollingTimer.d.ts +1 -0
  85. package/{dist/types → types}/system.d.ts +0 -0
  86. package/{dist/types → types}/timeUtils.d.ts +0 -0
  87. package/{dist/types → types}/utils.d.ts +0 -0
  88. package/{dist/types → types}/validations.d.ts +0 -0
  89. package/dist/cjs/capitalize.js +0 -35
  90. package/dist/cjs/capitalize.js.map +0 -7
  91. package/dist/cjs/compose.js +0 -45
  92. package/dist/cjs/compose.js.map +0 -7
  93. package/dist/cjs/getComponentFromProps.js +0 -48
  94. package/dist/cjs/getComponentFromProps.js.map +0 -7
  95. package/dist/cjs/hooks/index.js +0 -71
  96. package/dist/cjs/hooks/index.js.map +0 -7
  97. package/dist/cjs/hooks/useCancellableDelayedCallback.js +0 -51
  98. package/dist/cjs/hooks/useCancellableDelayedCallback.js.map +0 -7
  99. package/dist/cjs/hooks/useDerivedStateFromProps.js +0 -67
  100. package/dist/cjs/hooks/useDerivedStateFromProps.js.map +0 -7
  101. package/dist/cjs/hooks/useExecutionTimer.js +0 -50
  102. package/dist/cjs/hooks/useExecutionTimer.js.map +0 -7
  103. package/dist/cjs/hooks/useExpandState.js +0 -120
  104. package/dist/cjs/hooks/useExpandState.js.map +0 -7
  105. package/dist/cjs/hooks/useHotkeys.js +0 -45
  106. package/dist/cjs/hooks/useHotkeys.js.map +0 -7
  107. package/dist/cjs/hooks/useHoverHandlersDelay.js +0 -58
  108. package/dist/cjs/hooks/useHoverHandlersDelay.js.map +0 -7
  109. package/dist/cjs/hooks/useIsShowingEllipsis.js +0 -58
  110. package/dist/cjs/hooks/useIsShowingEllipsis.js.map +0 -7
  111. package/dist/cjs/hooks/useOnElementResize.js +0 -54
  112. package/dist/cjs/hooks/useOnElementResize.js.map +0 -7
  113. package/dist/cjs/hooks/useParentElement.js +0 -43
  114. package/dist/cjs/hooks/useParentElement.js.map +0 -7
  115. package/dist/cjs/hooks/usePrevious.js +0 -44
  116. package/dist/cjs/hooks/usePrevious.js.map +0 -7
  117. package/dist/cjs/hooks/useResizeObserver.js +0 -60
  118. package/dist/cjs/hooks/useResizeObserver.js.map +0 -7
  119. package/dist/cjs/hooks/useSetRef.js +0 -42
  120. package/dist/cjs/hooks/useSetRef.js.map +0 -7
  121. package/dist/cjs/hooks/useShouldRecalculate.js +0 -44
  122. package/dist/cjs/hooks/useShouldRecalculate.js.map +0 -7
  123. package/dist/cjs/hooks/useWindowScrollerList.js +0 -83
  124. package/dist/cjs/hooks/useWindowScrollerList.js.map +0 -7
  125. package/dist/cjs/hooks/useWindowSize.js +0 -57
  126. package/dist/cjs/hooks/useWindowSize.js.map +0 -7
  127. package/dist/cjs/index.js +0 -146
  128. package/dist/cjs/index.js.map +0 -7
  129. package/dist/cjs/onClickHandlerForNonInteractiveElements.js +0 -49
  130. package/dist/cjs/onClickHandlerForNonInteractiveElements.js.map +0 -7
  131. package/dist/cjs/operators.js +0 -68
  132. package/dist/cjs/operators.js.map +0 -7
  133. package/dist/cjs/platform.js +0 -37
  134. package/dist/cjs/platform.js.map +0 -7
  135. package/dist/cjs/reactTypesUtility.js +0 -58
  136. package/dist/cjs/reactTypesUtility.js.map +0 -7
  137. package/dist/cjs/scrollingTimer.js +0 -46
  138. package/dist/cjs/scrollingTimer.js.map +0 -7
  139. package/dist/cjs/system.js +0 -60
  140. package/dist/cjs/system.js.map +0 -7
  141. package/dist/cjs/timeUtils.js +0 -43
  142. package/dist/cjs/timeUtils.js.map +0 -7
  143. package/dist/cjs/utils.js +0 -127
  144. package/dist/cjs/utils.js.map +0 -7
  145. package/dist/cjs/validations.js +0 -57
  146. package/dist/cjs/validations.js.map +0 -7
  147. package/dist/esm/capitalize.js +0 -6
  148. package/dist/esm/capitalize.js.map +0 -7
  149. package/dist/esm/compose.js +0 -16
  150. package/dist/esm/compose.js.map +0 -7
  151. package/dist/esm/getComponentFromProps.js +0 -19
  152. package/dist/esm/getComponentFromProps.js.map +0 -7
  153. package/dist/esm/hooks/index.js +0 -42
  154. package/dist/esm/hooks/index.js.map +0 -7
  155. package/dist/esm/hooks/useCancellableDelayedCallback.js +0 -22
  156. package/dist/esm/hooks/useCancellableDelayedCallback.js.map +0 -7
  157. package/dist/esm/hooks/useDerivedStateFromProps.js +0 -38
  158. package/dist/esm/hooks/useDerivedStateFromProps.js.map +0 -7
  159. package/dist/esm/hooks/useExecutionTimer.js +0 -21
  160. package/dist/esm/hooks/useExecutionTimer.js.map +0 -7
  161. package/dist/esm/hooks/useExpandState.js +0 -91
  162. package/dist/esm/hooks/useExpandState.js.map +0 -7
  163. package/dist/esm/hooks/useHotkeys.js +0 -16
  164. package/dist/esm/hooks/useHotkeys.js.map +0 -7
  165. package/dist/esm/hooks/useHoverHandlersDelay.js.map +0 -7
  166. package/dist/esm/hooks/useIsShowingEllipsis.js.map +0 -7
  167. package/dist/esm/hooks/useOnElementResize.js +0 -25
  168. package/dist/esm/hooks/useOnElementResize.js.map +0 -7
  169. package/dist/esm/hooks/useParentElement.js +0 -14
  170. package/dist/esm/hooks/useParentElement.js.map +0 -7
  171. package/dist/esm/hooks/usePrevious.js +0 -15
  172. package/dist/esm/hooks/usePrevious.js.map +0 -7
  173. package/dist/esm/hooks/useResizeObserver.js +0 -31
  174. package/dist/esm/hooks/useResizeObserver.js.map +0 -7
  175. package/dist/esm/hooks/useSetRef.js +0 -13
  176. package/dist/esm/hooks/useSetRef.js.map +0 -7
  177. package/dist/esm/hooks/useShouldRecalculate.js +0 -15
  178. package/dist/esm/hooks/useShouldRecalculate.js.map +0 -7
  179. package/dist/esm/hooks/useWindowScrollerList.js.map +0 -7
  180. package/dist/esm/hooks/useWindowSize.js +0 -28
  181. package/dist/esm/hooks/useWindowSize.js.map +0 -7
  182. package/dist/esm/index.js +0 -206
  183. package/dist/esm/index.js.map +0 -7
  184. package/dist/esm/onClickHandlerForNonInteractiveElements.js +0 -20
  185. package/dist/esm/onClickHandlerForNonInteractiveElements.js.map +0 -7
  186. package/dist/esm/operators.js +0 -39
  187. package/dist/esm/operators.js.map +0 -7
  188. package/dist/esm/platform.js +0 -8
  189. package/dist/esm/platform.js.map +0 -7
  190. package/dist/esm/reactTypesUtility.js +0 -29
  191. package/dist/esm/reactTypesUtility.js.map +0 -7
  192. package/dist/esm/scrollingTimer.js +0 -17
  193. package/dist/esm/scrollingTimer.js.map +0 -7
  194. package/dist/esm/system.js +0 -31
  195. package/dist/esm/system.js.map +0 -7
  196. package/dist/esm/timeUtils.js +0 -14
  197. package/dist/esm/timeUtils.js.map +0 -7
  198. package/dist/esm/utils.js +0 -136
  199. package/dist/esm/utils.js.map +0 -7
  200. package/dist/esm/validations.js +0 -28
  201. package/dist/esm/validations.js.map +0 -7
  202. package/dist/types/getComponentFromProps.d.ts +0 -3
  203. package/dist/types/hooks/index.d.ts +0 -19
  204. package/dist/types/hooks/useCancellableDelayedCallback.d.ts +0 -2
  205. package/dist/types/hooks/useDerivedStateFromProps.d.ts +0 -2
  206. package/dist/types/hooks/useExecutionTimer.d.ts +0 -2
  207. package/dist/types/hooks/useHotkeys.d.ts +0 -6
  208. package/dist/types/hooks/useOnElementResize.d.ts +0 -2
  209. package/dist/types/hooks/usePrevious.d.ts +0 -2
  210. package/dist/types/hooks/useResizeObserver.d.ts +0 -3
  211. package/dist/types/hooks/useShouldRecalculate.d.ts +0 -2
  212. package/dist/types/hooks/useWindowScrollerList.d.ts +0 -5
  213. package/dist/types/hooks/useWindowSize.d.ts +0 -2
  214. package/dist/types/index.d.ts +0 -13
  215. package/dist/types/scrollingTimer.d.ts +0 -1
@@ -1,7 +0,0 @@
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
- }
package/dist/esm/utils.js DELETED
@@ -1,136 +0,0 @@
1
- import * as React from "react";
2
- import {
3
- cloneDeep,
4
- filter,
5
- debounce,
6
- findIndex,
7
- isEmpty,
8
- isString,
9
- isEqual,
10
- noop,
11
- omit,
12
- orderBy,
13
- pull,
14
- sumBy,
15
- maxBy,
16
- meanBy,
17
- sortBy,
18
- transform,
19
- isFunction,
20
- uniq,
21
- uniqBy,
22
- groupBy,
23
- property,
24
- get,
25
- set,
26
- range,
27
- parseInt,
28
- padStart,
29
- isNaN,
30
- values,
31
- throttle,
32
- pick,
33
- pickBy,
34
- differenceBy,
35
- differenceWith,
36
- isEqualWith,
37
- curry,
38
- isObject,
39
- isBoolean
40
- } from "lodash";
41
- const cx = (...classnames) => classnames.reduce((result, cn) => `${result} ${cn || ""}`, "");
42
- const toggleInObject = (obj, key, value) => obj[key] !== void 0 ? omit(obj, [key]) : { ...obj, [key]: value };
43
- const toggleInArray = (array, value) => array.indexOf(value) === -1 ? [value] : [];
44
- const arrayMoveMutate = (array, from, to) => {
45
- array.splice(to < 0 ? array.length + to : to, 0, array.splice(from, 1)[0]);
46
- };
47
- const arrayMove = (array, from, to) => {
48
- array = array.slice();
49
- arrayMoveMutate(array, from, to);
50
- return array;
51
- };
52
- const accessorDefault = (item) => item;
53
- const addOrRemove = (array, item, accessor = accessorDefault) => {
54
- const index = array.findIndex((iItem) => accessor(iItem) === accessor(item));
55
- if (index !== -1) {
56
- const nextArray = cloneDeep(array);
57
- nextArray.splice(index, 1);
58
- return nextArray;
59
- }
60
- return [...array, item];
61
- };
62
- function runAll(...fns) {
63
- return (...args) => fns.forEach((fn) => {
64
- if (Array.isArray(fn))
65
- runAll(fn);
66
- if (isFunction(fn))
67
- fn(...args);
68
- });
69
- }
70
- function hashArray(arr, fieldName) {
71
- return arr.reduce((result, item) => ({
72
- ...result,
73
- [fieldName ? item[fieldName] : item]: true
74
- }), {});
75
- }
76
- function safeCall(fun, ...args) {
77
- if (isFunction(fun)) {
78
- fun(...args);
79
- }
80
- }
81
- const removeUndefinedProperties = (obj) => {
82
- const cleanObject = { ...obj };
83
- Object.keys(obj).forEach((key) => cleanObject[key] === void 0 && delete cleanObject[key]);
84
- return cleanObject;
85
- };
86
- var utils_default = {};
87
- export {
88
- addOrRemove,
89
- arrayMove,
90
- cloneDeep,
91
- curry,
92
- cx,
93
- debounce,
94
- utils_default as default,
95
- differenceBy,
96
- differenceWith,
97
- filter,
98
- findIndex,
99
- get,
100
- groupBy,
101
- hashArray,
102
- isBoolean,
103
- isEmpty,
104
- isEqual,
105
- isEqualWith,
106
- isFunction,
107
- isNaN,
108
- isObject,
109
- isString,
110
- maxBy,
111
- meanBy,
112
- noop,
113
- omit,
114
- orderBy,
115
- padStart,
116
- parseInt,
117
- pick,
118
- pickBy,
119
- property,
120
- pull,
121
- range,
122
- removeUndefinedProperties,
123
- runAll,
124
- safeCall,
125
- set,
126
- sortBy,
127
- sumBy,
128
- throttle,
129
- toggleInArray,
130
- toggleInObject,
131
- transform,
132
- uniq,
133
- uniqBy,
134
- values
135
- };
136
- //# sourceMappingURL=utils.js.map
@@ -1,7 +0,0 @@
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,KAAK,MAAM,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;AAAA,OACd;AAAA,KACF,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,KAAK;AACzB,SAAO,KAAK,KAAK,QAAQ,CAAC,QAAQ,YAAY,SAAS,UAAa,OAAO,YAAY;AACvF,SAAO;AAAA;AAGT,IAAO,gBAAQ;",
6
- "names": []
7
- }
@@ -1,28 +0,0 @@
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
@@ -1,7 +0,0 @@
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
- }
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const getComponentFromProps: (Component: any, props: any, children?: never[]) => JSX.Element | null;
3
- export default getComponentFromProps;
@@ -1,19 +0,0 @@
1
- export { default as useMeasure } from 'use-measure';
2
- export { default as useForceUpdate } from 'use-force-update';
3
- export { default as useOnClickOutside } from 'use-onclickoutside';
4
- export { useUncontrolled } from 'uncontrollable';
5
- export { useExecutionTimer } from './useExecutionTimer';
6
- export { useExpandState } from './useExpandState';
7
- export { useHotkeys } from './useHotkeys';
8
- export { useHoverHandlersDelay } from './useHoverHandlersDelay';
9
- export { useResizeObserver } from './useResizeObserver';
10
- export { useShouldRecalculate } from './useShouldRecalculate';
11
- export { useWindowScrollerList } from './useWindowScrollerList';
12
- export { useWindowSize } from './useWindowSize';
13
- export { usePrevious } from './usePrevious';
14
- export { useCancellableDelayedCallback } from './useCancellableDelayedCallback';
15
- export { useDerivedStateFromProps } from './useDerivedStateFromProps';
16
- export { useSetRef } from './useSetRef';
17
- export { useParentElement } from './useParentElement';
18
- export { useOnElementResize } from './useOnElementResize';
19
- export { useIsShowingEllipsis } from './useIsShowingEllipsis';
@@ -1,2 +0,0 @@
1
- export declare const useCancellableDelayedCallback: (cb: any, delay: any) => ((...args: any[]) => void)[];
2
- export default useCancellableDelayedCallback;
@@ -1,2 +0,0 @@
1
- export declare const useDerivedStateFromProps: (prop: any, options?: {}) => any[];
2
- export default useDerivedStateFromProps;
@@ -1,2 +0,0 @@
1
- export declare const useExecutionTimer: (startFn: any, cleanFn: any, delayTime: any) => ((...args: any[]) => void)[];
2
- export default useExecutionTimer;
@@ -1,6 +0,0 @@
1
- export declare const useHotkeys: ({ keys, handler, options }: {
2
- keys: any;
3
- handler: any;
4
- options?: {} | undefined;
5
- }, deps?: never[]) => void;
6
- export default useHotkeys;
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const useOnElementResize: (targetRef: React.RefObject<HTMLDivElement>) => Record<'width' | 'height', number>;
@@ -1,2 +0,0 @@
1
- export declare const usePrevious: (value: any) => undefined;
2
- export default usePrevious;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const useResizeObserver: (handler: any, el: any) => import("react").Dispatch<any>[];
3
- export default useResizeObserver;
@@ -1,2 +0,0 @@
1
- export declare const useShouldRecalculate: (bool: any) => number;
2
- export default useShouldRecalculate;
@@ -1,5 +0,0 @@
1
- export declare const useWindowScrollerList: ({ listInstance, outerListRef }: {
2
- listInstance: any;
3
- outerListRef: any;
4
- }) => void;
5
- export default useWindowScrollerList;
@@ -1,2 +0,0 @@
1
- export declare const useWindowSize: () => false | number[];
2
- export default useWindowSize;
@@ -1,13 +0,0 @@
1
- export { default as getComponentFromProps } from './getComponentFromProps';
2
- export { default as onClickHandlerForNonInteractiveElements } from './onClickHandlerForNonInteractiveElements';
3
- export { capitalize } from './capitalize';
4
- export { checkNotEmpty, checkEmpty, greaterThan, validDate, equal, notEqual, isNull, isNotNull, isIn, isNotIn, greaterThanOrEquals, lessThanOrEquals, startsWith, contains, } from './operators';
5
- export { cx, runAll, hashArray, safeCall, removeUndefinedProperties, isObject, curry, arrayMove, uniq, filter, uniqBy, groupBy, property, get, set, cloneDeep, debounce, findIndex, isEmpty, isString, isEqual, maxBy, meanBy, noop, omit, orderBy, pull, sortBy, sumBy, transform, isFunction, range, parseInt, padStart, isNaN, values, throttle, toggleInObject, toggleInArray, pick, pickBy, differenceBy, differenceWith, addOrRemove, isEqualWith, isBoolean, } from './utils';
6
- export { setRef, mergeRefs, logger } from './system';
7
- export { useMeasure, useForceUpdate, useOnClickOutside, useUncontrolled, useExecutionTimer, useExpandState, useHotkeys, useHoverHandlersDelay, useResizeObserver, useShouldRecalculate, useWindowScrollerList, useWindowSize, usePrevious, useCancellableDelayedCallback, useDerivedStateFromProps, useSetRef, useParentElement, useOnElementResize, useIsShowingEllipsis, } from './hooks';
8
- export { getVisibleTimeByFormat, addLeadingZeros } from './timeUtils';
9
- export { compose } from './compose';
10
- export { DOCUMENT, WINDOW } from './platform';
11
- export { isClassComponent, isFunctionComponent, isReactComponent, isElement, isDOMTypeElement, isCompositeTypeElement, } from './reactTypesUtility';
12
- export { resetTimer } from './scrollingTimer';
13
- export { isRequired, isGreaterThan, isValidDate } from './validations';
@@ -1 +0,0 @@
1
- export declare const resetTimer: (func: any) => (...args: any[]) => void;