@pega/cosmos-react-core 4.0.0-dev.5.0 → 4.0.0-dev.6.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 (211) hide show
  1. package/lib/components/Actions/Actions.d.ts.map +1 -1
  2. package/lib/components/Actions/Actions.js +11 -5
  3. package/lib/components/Actions/Actions.js.map +1 -1
  4. package/lib/components/AdditionalInfo/AdditionalInfo.d.ts +2 -0
  5. package/lib/components/AdditionalInfo/AdditionalInfo.d.ts.map +1 -1
  6. package/lib/components/AdditionalInfo/AdditionalInfo.js +24 -15
  7. package/lib/components/AdditionalInfo/AdditionalInfo.js.map +1 -1
  8. package/lib/components/AppShell/AppShell.styles.js +1 -1
  9. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  10. package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -1
  11. package/lib/components/AppShell/NavigationListItemWrapper.js +4 -2
  12. package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -1
  13. package/lib/components/Badges/Count.d.ts +1 -1
  14. package/lib/components/Badges/Count.d.ts.map +1 -1
  15. package/lib/components/Badges/Count.js +4 -8
  16. package/lib/components/Badges/Count.js.map +1 -1
  17. package/lib/components/Badges/Selection.js +1 -1
  18. package/lib/components/Badges/Selection.js.map +1 -1
  19. package/lib/components/Badges/Tag.js +1 -1
  20. package/lib/components/Badges/Tag.js.map +1 -1
  21. package/lib/components/Banner/Banner.js +3 -3
  22. package/lib/components/Banner/Banner.js.map +1 -1
  23. package/lib/components/Dialog/Dialog.d.ts +3 -30
  24. package/lib/components/Dialog/Dialog.d.ts.map +1 -1
  25. package/lib/components/Dialog/Dialog.js +7 -147
  26. package/lib/components/Dialog/Dialog.js.map +1 -1
  27. package/lib/components/Dialog/Dialog.styles.d.ts +3 -0
  28. package/lib/components/Dialog/Dialog.styles.d.ts.map +1 -0
  29. package/lib/components/Dialog/Dialog.styles.js +18 -0
  30. package/lib/components/Dialog/Dialog.styles.js.map +1 -0
  31. package/lib/components/Dialog/Dialog.types.d.ts +87 -0
  32. package/lib/components/Dialog/Dialog.types.d.ts.map +1 -0
  33. package/lib/components/Dialog/Dialog.types.js +3 -0
  34. package/lib/components/Dialog/Dialog.types.js.map +1 -0
  35. package/lib/components/Dialog/FormDialog.d.ts +7 -0
  36. package/lib/components/Dialog/FormDialog.d.ts.map +1 -0
  37. package/lib/components/Dialog/FormDialog.js +62 -0
  38. package/lib/components/Dialog/FormDialog.js.map +1 -0
  39. package/lib/components/Dialog/InfoDialog.d.ts +6 -0
  40. package/lib/components/Dialog/InfoDialog.d.ts.map +1 -0
  41. package/lib/components/Dialog/InfoDialog.js +47 -0
  42. package/lib/components/Dialog/InfoDialog.js.map +1 -0
  43. package/lib/components/Dialog/index.d.ts +3 -2
  44. package/lib/components/Dialog/index.d.ts.map +1 -1
  45. package/lib/components/Dialog/index.js +2 -2
  46. package/lib/components/Dialog/index.js.map +1 -1
  47. package/lib/components/FieldValueList/index.d.ts +1 -1
  48. package/lib/components/FieldValueList/index.d.ts.map +1 -1
  49. package/lib/components/FieldValueList/index.js.map +1 -1
  50. package/lib/components/FormControl/FormControl.d.ts.map +1 -1
  51. package/lib/components/FormControl/FormControl.js +3 -1
  52. package/lib/components/FormControl/FormControl.js.map +1 -1
  53. package/lib/components/Location/LocationInput.js +1 -1
  54. package/lib/components/Location/LocationInput.js.map +1 -1
  55. package/lib/components/Menu/Menu.d.ts.map +1 -1
  56. package/lib/components/Menu/Menu.js +1 -3
  57. package/lib/components/Menu/Menu.js.map +1 -1
  58. package/lib/components/Menu/Menu.types.d.ts +0 -2
  59. package/lib/components/Menu/Menu.types.d.ts.map +1 -1
  60. package/lib/components/Menu/Menu.types.js.map +1 -1
  61. package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
  62. package/lib/components/MenuButton/MenuButton.js +18 -4
  63. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  64. package/lib/components/Progress/Progress.d.ts.map +1 -1
  65. package/lib/components/Progress/Progress.js +3 -2
  66. package/lib/components/Progress/Progress.js.map +1 -1
  67. package/lib/components/RadioCheck/RadioCheck.js +1 -1
  68. package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
  69. package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
  70. package/lib/components/SearchInput/SearchInput.js +2 -2
  71. package/lib/components/SearchInput/SearchInput.js.map +1 -1
  72. package/lib/components/Tabs/Tab.js +1 -1
  73. package/lib/components/Tabs/Tab.js.map +1 -1
  74. package/lib/components/Tabs/Tabs.d.ts.map +1 -1
  75. package/lib/components/Tabs/Tabs.js +1 -8
  76. package/lib/components/Tabs/Tabs.js.map +1 -1
  77. package/lib/hooks/useI18n.d.ts +17 -0
  78. package/lib/hooks/useI18n.d.ts.map +1 -1
  79. package/lib/i18n/default.d.ts +17 -0
  80. package/lib/i18n/default.d.ts.map +1 -1
  81. package/lib/i18n/default.js +18 -0
  82. package/lib/i18n/default.js.map +1 -1
  83. package/lib/i18n/i18n.d.ts +17 -0
  84. package/lib/i18n/i18n.d.ts.map +1 -1
  85. package/lib/index.d.ts +0 -1
  86. package/lib/index.d.ts.map +1 -1
  87. package/lib/index.js +0 -1
  88. package/lib/index.js.map +1 -1
  89. package/lib/theme/theme.d.ts +3 -39
  90. package/lib/theme/theme.d.ts.map +1 -1
  91. package/lib/theme/themeDefinition.json +1 -21
  92. package/lib/types/types.d.ts +6 -1
  93. package/lib/types/types.d.ts.map +1 -1
  94. package/lib/types/types.js.map +1 -1
  95. package/lib/utils/bindAll.d.ts +4 -0
  96. package/lib/utils/bindAll.d.ts.map +1 -0
  97. package/lib/utils/bindAll.js +9 -0
  98. package/lib/utils/bindAll.js.map +1 -0
  99. package/lib/utils/cap.d.ts +4 -0
  100. package/lib/utils/cap.d.ts.map +1 -0
  101. package/lib/utils/cap.js +6 -0
  102. package/lib/utils/cap.js.map +1 -0
  103. package/lib/utils/createStringMatcher.d.ts +10 -0
  104. package/lib/utils/createStringMatcher.d.ts.map +1 -0
  105. package/lib/utils/createStringMatcher.js +21 -0
  106. package/lib/utils/createStringMatcher.js.map +1 -0
  107. package/lib/utils/createUID.d.ts +4 -0
  108. package/lib/utils/createUID.d.ts.map +1 -0
  109. package/lib/utils/createUID.js +6 -0
  110. package/lib/utils/createUID.js.map +1 -0
  111. package/lib/utils/debounce.d.ts +4 -0
  112. package/lib/utils/debounce.d.ts.map +1 -0
  113. package/lib/utils/debounce.js +14 -0
  114. package/lib/utils/debounce.js.map +1 -0
  115. package/lib/utils/deepGet.d.ts +3 -0
  116. package/lib/utils/deepGet.d.ts.map +1 -0
  117. package/lib/utils/deepGet.js +15 -0
  118. package/lib/utils/deepGet.js.map +1 -0
  119. package/lib/utils/deepObjectComparison.d.ts +4 -0
  120. package/lib/utils/deepObjectComparison.d.ts.map +1 -0
  121. package/lib/utils/deepObjectComparison.js +35 -0
  122. package/lib/utils/deepObjectComparison.js.map +1 -0
  123. package/lib/utils/defineSmartGetter.d.ts +3 -0
  124. package/lib/utils/defineSmartGetter.d.ts.map +1 -0
  125. package/lib/utils/defineSmartGetter.js +14 -0
  126. package/lib/utils/defineSmartGetter.js.map +1 -0
  127. package/lib/utils/documentIsAvailable.d.ts +3 -0
  128. package/lib/utils/documentIsAvailable.d.ts.map +1 -0
  129. package/lib/utils/documentIsAvailable.js +3 -0
  130. package/lib/utils/documentIsAvailable.js.map +1 -0
  131. package/lib/utils/escapeRegExp.d.ts +8 -0
  132. package/lib/utils/escapeRegExp.d.ts.map +1 -0
  133. package/lib/utils/escapeRegExp.js +8 -0
  134. package/lib/utils/escapeRegExp.js.map +1 -0
  135. package/lib/utils/focusHeadingOrContainer.d.ts +8 -0
  136. package/lib/utils/focusHeadingOrContainer.d.ts.map +1 -0
  137. package/lib/utils/focusHeadingOrContainer.js +29 -0
  138. package/lib/utils/focusHeadingOrContainer.js.map +1 -0
  139. package/lib/utils/formatListToLocaleString.d.ts +15 -0
  140. package/lib/utils/formatListToLocaleString.d.ts.map +1 -0
  141. package/lib/utils/formatListToLocaleString.js +17 -0
  142. package/lib/utils/formatListToLocaleString.js.map +1 -0
  143. package/lib/utils/getActiveElement.d.ts +8 -0
  144. package/lib/utils/getActiveElement.d.ts.map +1 -0
  145. package/lib/utils/getActiveElement.js +18 -0
  146. package/lib/utils/getActiveElement.js.map +1 -0
  147. package/lib/utils/getFocusables.d.ts +9 -0
  148. package/lib/utils/getFocusables.d.ts.map +1 -0
  149. package/lib/utils/getFocusables.js +15 -0
  150. package/lib/utils/getFocusables.js.map +1 -0
  151. package/lib/utils/getScrollbarWidth.d.ts +4 -0
  152. package/lib/utils/getScrollbarWidth.d.ts.map +1 -0
  153. package/lib/utils/getScrollbarWidth.js +17 -0
  154. package/lib/utils/getScrollbarWidth.js.map +1 -0
  155. package/lib/utils/hasProp.d.ts +4 -0
  156. package/lib/utils/hasProp.d.ts.map +1 -0
  157. package/lib/utils/hasProp.js +6 -0
  158. package/lib/utils/hasProp.js.map +1 -0
  159. package/lib/utils/index.d.ts +27 -1
  160. package/lib/utils/index.d.ts.map +1 -1
  161. package/lib/utils/index.js +27 -1
  162. package/lib/utils/index.js.map +1 -1
  163. package/lib/utils/loadScript.d.ts +3 -0
  164. package/lib/utils/loadScript.d.ts.map +1 -0
  165. package/lib/utils/loadScript.js +9 -0
  166. package/lib/utils/loadScript.js.map +1 -0
  167. package/lib/utils/navigatorIsAvailable.d.ts +3 -0
  168. package/lib/utils/navigatorIsAvailable.d.ts.map +1 -0
  169. package/lib/utils/navigatorIsAvailable.js +3 -0
  170. package/lib/utils/navigatorIsAvailable.js.map +1 -0
  171. package/lib/utils/normalizeElements.d.ts +9 -0
  172. package/lib/utils/normalizeElements.d.ts.map +1 -0
  173. package/lib/utils/normalizeElements.js +14 -0
  174. package/lib/utils/normalizeElements.js.map +1 -0
  175. package/lib/utils/range.d.ts +4 -0
  176. package/lib/utils/range.d.ts.map +1 -0
  177. package/lib/utils/range.js +8 -0
  178. package/lib/utils/range.js.map +1 -0
  179. package/lib/utils/reflow.d.ts +4 -0
  180. package/lib/utils/reflow.d.ts.map +1 -0
  181. package/lib/utils/reflow.js +7 -0
  182. package/lib/utils/reflow.js.map +1 -0
  183. package/lib/utils/replaceMatchWithElement.d.ts +4 -0
  184. package/lib/utils/replaceMatchWithElement.d.ts.map +1 -0
  185. package/lib/utils/replaceMatchWithElement.js +32 -0
  186. package/lib/utils/replaceMatchWithElement.js.map +1 -0
  187. package/lib/utils/sameOrigin.d.ts +7 -0
  188. package/lib/utils/sameOrigin.d.ts.map +1 -0
  189. package/lib/utils/sameOrigin.js +25 -0
  190. package/lib/utils/sameOrigin.js.map +1 -0
  191. package/lib/utils/testElForOverflow.d.ts +4 -0
  192. package/lib/utils/testElForOverflow.d.ts.map +1 -0
  193. package/lib/utils/testElForOverflow.js +6 -0
  194. package/lib/utils/testElForOverflow.js.map +1 -0
  195. package/lib/utils/triple.d.ts +12 -0
  196. package/lib/utils/triple.d.ts.map +1 -0
  197. package/lib/utils/triple.js +13 -0
  198. package/lib/utils/triple.js.map +1 -0
  199. package/lib/utils/tryCatch.d.ts +5 -0
  200. package/lib/utils/tryCatch.d.ts.map +1 -0
  201. package/lib/utils/tryCatch.js +16 -0
  202. package/lib/utils/tryCatch.js.map +1 -0
  203. package/lib/utils/windowIsAvailable.d.ts +3 -0
  204. package/lib/utils/windowIsAvailable.d.ts.map +1 -0
  205. package/lib/utils/windowIsAvailable.js +3 -0
  206. package/lib/utils/windowIsAvailable.js.map +1 -0
  207. package/package.json +1 -1
  208. package/lib/utils/utils.d.ts +0 -99
  209. package/lib/utils/utils.d.ts.map +0 -1
  210. package/lib/utils/utils.js +0 -314
  211. package/lib/utils/utils.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEhD,MAAM,WAAW,SAAS;IACxB,8BAA8B;IAC9B,SAAS,CAAC,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C,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,GAChG;KACG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;CACzE,CAAC,IAAI,CAAC,CAAC;AAIV,oBAAY,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAGzD,oBAAY,iBAAiB,CAC3B,KAAK,SAAS,MAAM,GAAG,EAAE,EACzB,QAAQ,SAAS,MAAM,KAAK,GAAG,KAAK,IAClC,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AAGlE,oBAAY,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GACzC;KACG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrB,GACD,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ElementType, MouseEvent } from 'react';\n\nexport interface BaseProps {\n /** Additional CSS classes. */\n className?: string;\n}\n\nexport interface ForwardProps {\n [prop: string]: unknown;\n}\n\nexport interface NoChildrenProp {\n children?: never;\n}\n\nexport type HTMLTag = keyof JSX.IntrinsicElements;\nexport interface AsProp {\n /** HTML tag or React Component to render the component as. */\n as?: ElementType;\n /** HTML tag or React Component to finally render the component as. */\n forwardedAs?: ElementType;\n}\n\nexport interface Action extends ForwardProps {\n /** A string to uniquely identify this Action within the onClick handler. */\n id: string;\n /** The text content of the Action. */\n text: string;\n /** The name of the Cosmos Icon to render, if any. */\n icon?: string;\n /** A location to navigate to. Passing an href will render a Link styled as a Button. */\n href?: string;\n /** Called when the Action is clicked. */\n onClick?: (\n id: string,\n e: MouseEvent<HTMLButtonElement | HTMLAnchorElement | HTMLInputElement>\n ) => void;\n /** Determines if the Action will be disabled. */\n disabled?: boolean;\n}\n\n// https://github.com/microsoft/TypeScript/issues/30825\nexport type OmitStrict<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;\nexport type PartialByKey<T extends object, K extends keyof T> = OmitStrict<T, K> &\n Partial<Pick<T, K>>;\nexport type RequiredByKey<T extends object, K extends keyof T> = OmitStrict<T, K> &\n Required<Pick<T, K>>;\n\nexport type DeepPartial<T> = T extends (infer U)[]\n ? DeepPartial<U>[]\n : T extends object\n ? { [K in keyof T]?: DeepPartial<T[K]> }\n : T;\n\nexport type DeepRequired<T> = T extends (infer U)[]\n ? DeepRequired<U>[]\n : T extends Function\n ? T\n : T extends object\n ? { [K in keyof T]-?: DeepRequired<T[K]> }\n : T;\n\n// https://stackoverflow.com/a/49725198\nexport type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> &\n {\n [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;\n }[Keys];\n\n// Lowers type inference precedence without changing the type.\n// https://github.com/Microsoft/TypeScript/issues/14829#issue-216577598\nexport type DeferInfer<T> = T & { [K in keyof T]: T[K] };\n\n/* eslint-disable @typescript-eslint/ban-types */\nexport type PropsWithDefaults<\n Props extends object = {},\n Defaults extends keyof Props = never\n> = OmitStrict<Props, Defaults> & Required<Pick<Props, Defaults>>;\n/* eslint-enable @typescript-eslint/ban-types */\n\nexport type PrettyPrint<T> = T extends object\n ? {\n [K in keyof T]: T[K];\n }\n : T;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ElementType, MouseEvent } from 'react';\n\nexport interface BaseProps {\n /** Additional CSS classes. */\n className?: string;\n}\n\nexport interface ForwardProps {\n [prop: string]: unknown;\n}\n\nexport interface NoChildrenProp {\n children?: never;\n}\n\nexport type HTMLTag = keyof JSX.IntrinsicElements;\nexport interface AsProp {\n /** HTML tag or React Component to render the component as. */\n as?: ElementType;\n /** HTML tag or React Component to finally render the component as. */\n forwardedAs?: ElementType;\n}\n\nexport interface Action extends ForwardProps {\n /** A string to uniquely identify this Action within the onClick handler. */\n id: string;\n /** The text content of the Action. */\n text: string;\n /** The name of the Cosmos Icon to render, if any. */\n icon?: string;\n /** A location to navigate to. Passing an href will render a Link styled as a Button. */\n href?: string;\n /** Called when the Action is clicked. */\n onClick?: (\n id: string,\n e: MouseEvent<HTMLButtonElement | HTMLAnchorElement | HTMLInputElement>,\n /**\n * If the action was rendered as an item in a menu the associated menuButton element will be provided.\n * Often necessary for focus purposes.\n */\n menuButton?: HTMLButtonElement\n ) => void;\n /** Determines if the Action will be disabled. */\n disabled?: boolean;\n}\n\n// https://github.com/microsoft/TypeScript/issues/30825\nexport type OmitStrict<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;\nexport type PartialByKey<T extends object, K extends keyof T> = OmitStrict<T, K> &\n Partial<Pick<T, K>>;\nexport type RequiredByKey<T extends object, K extends keyof T> = OmitStrict<T, K> &\n Required<Pick<T, K>>;\n\nexport type DeepPartial<T> = T extends (infer U)[]\n ? DeepPartial<U>[]\n : T extends object\n ? { [K in keyof T]?: DeepPartial<T[K]> }\n : T;\n\nexport type DeepRequired<T> = T extends (infer U)[]\n ? DeepRequired<U>[]\n : T extends Function\n ? T\n : T extends object\n ? { [K in keyof T]-?: DeepRequired<T[K]> }\n : T;\n\n// https://stackoverflow.com/a/49725198\nexport type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> &\n {\n [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;\n }[Keys];\n\n// Lowers type inference precedence without changing the type.\n// https://github.com/Microsoft/TypeScript/issues/14829#issue-216577598\nexport type DeferInfer<T> = T & { [K in keyof T]: T[K] };\n\n/* eslint-disable @typescript-eslint/ban-types */\nexport type PropsWithDefaults<\n Props extends object = {},\n Defaults extends keyof Props = never\n> = OmitStrict<Props, Defaults> & Required<Pick<Props, Defaults>>;\n/* eslint-enable @typescript-eslint/ban-types */\n\nexport type PrettyPrint<T> = T extends object\n ? {\n [K in keyof T]: T[K];\n }\n : T;\n"]}
@@ -0,0 +1,4 @@
1
+ /** @deprecated */
2
+ declare const bindAll: <T extends object, K extends keyof T>(obj: T, names: K[]) => void;
3
+ export default bindAll;
4
+ //# sourceMappingURL=bindAll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bindAll.d.ts","sourceRoot":"","sources":["../../src/utils/bindAll.ts"],"names":[],"mappings":"AACA,kBAAkB;AAClB,QAAA,MAAM,OAAO,+DAA8D,IAI1E,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,9 @@
1
+ // Add some context...
2
+ /** @deprecated */
3
+ const bindAll = (obj, names) => {
4
+ names.forEach(fn => {
5
+ obj[fn] = obj[fn].bind(obj);
6
+ });
7
+ };
8
+ export default bindAll;
9
+ //# sourceMappingURL=bindAll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bindAll.js","sourceRoot":"","sources":["../../src/utils/bindAll.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,kBAAkB;AAClB,MAAM,OAAO,GAAG,CAAsC,GAAM,EAAE,KAAU,EAAQ,EAAE;IAChF,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;QACjB,GAAG,CAAC,EAAE,CAAC,GAAI,GAAG,CAAC,EAAE,CAAyB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["// Add some context...\n/** @deprecated */\nconst bindAll = <T extends object, K extends keyof T>(obj: T, names: K[]): void => {\n names.forEach(fn => {\n obj[fn] = (obj[fn] as unknown as Function).bind(obj);\n });\n};\n\nexport default bindAll;\n"]}
@@ -0,0 +1,4 @@
1
+ /** Capitalize */
2
+ declare const cap: (s: string) => string;
3
+ export default cap;
4
+ //# sourceMappingURL=cap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cap.d.ts","sourceRoot":"","sources":["../../src/utils/cap.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB,QAAA,MAAM,GAAG,MAAO,MAAM,KAAG,MAExB,CAAC;AAEF,eAAe,GAAG,CAAC"}
@@ -0,0 +1,6 @@
1
+ /** Capitalize */
2
+ const cap = (s) => {
3
+ return s.charAt(0).toUpperCase() + s.slice(1);
4
+ };
5
+ export default cap;
6
+ //# sourceMappingURL=cap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cap.js","sourceRoot":"","sources":["../../src/utils/cap.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB,MAAM,GAAG,GAAG,CAAC,CAAS,EAAU,EAAE;IAChC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC,CAAC;AAEF,eAAe,GAAG,CAAC","sourcesContent":["/** Capitalize */\nconst cap = (s: string): string => {\n return s.charAt(0).toUpperCase() + s.slice(1);\n};\n\nexport default cap;\n"]}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Generate a RegExp with a string parameter.
3
+ * @param s The string to match.
4
+ * @param type How to match.
5
+ * @param flags Standard RegExp flags.
6
+ * @returns A RegExp with the match pattern.
7
+ */
8
+ declare const createStringMatcher: (s: string, type?: 'contains' | 'start' | 'boundary', flags?: string) => RegExp;
9
+ export default createStringMatcher;
10
+ //# sourceMappingURL=createStringMatcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createStringMatcher.d.ts","sourceRoot":"","sources":["../../src/utils/createStringMatcher.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,QAAA,MAAM,mBAAmB,MACpB,MAAM,SACH,UAAU,GAAG,OAAO,GAAG,UAAU,UAChC,MAAM,KACZ,MAWF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import escapeRegExp from './escapeRegExp';
2
+ /**
3
+ * Generate a RegExp with a string parameter.
4
+ * @param s The string to match.
5
+ * @param type How to match.
6
+ * @param flags Standard RegExp flags.
7
+ * @returns A RegExp with the match pattern.
8
+ */
9
+ const createStringMatcher = (s, type = 'contains', flags = 'i') => {
10
+ const escaped = escapeRegExp(s);
11
+ let pattern = escaped;
12
+ if (type === 'start') {
13
+ pattern = `^${escaped}`;
14
+ }
15
+ else if (type === 'boundary') {
16
+ pattern = `(?:^|\\s)${escaped}`;
17
+ }
18
+ return new RegExp(pattern, flags);
19
+ };
20
+ export default createStringMatcher;
21
+ //# sourceMappingURL=createStringMatcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createStringMatcher.js","sourceRoot":"","sources":["../../src/utils/createStringMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,mBAAmB,GAAG,CAC1B,CAAS,EACT,OAA0C,UAAU,EACpD,QAAgB,GAAG,EACX,EAAE;IACV,MAAM,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;IAChC,IAAI,OAAO,GAAW,OAAO,CAAC;IAE9B,IAAI,IAAI,KAAK,OAAO,EAAE;QACpB,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;KACzB;SAAM,IAAI,IAAI,KAAK,UAAU,EAAE;QAC9B,OAAO,GAAG,YAAY,OAAO,EAAE,CAAC;KACjC;IAED,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import escapeRegExp from './escapeRegExp';\n\n/**\n * Generate a RegExp with a string parameter.\n * @param s The string to match.\n * @param type How to match.\n * @param flags Standard RegExp flags.\n * @returns A RegExp with the match pattern.\n */\nconst createStringMatcher = (\n s: string,\n type: 'contains' | 'start' | 'boundary' = 'contains',\n flags: string = 'i'\n): RegExp => {\n const escaped = escapeRegExp(s);\n let pattern: string = escaped;\n\n if (type === 'start') {\n pattern = `^${escaped}`;\n } else if (type === 'boundary') {\n pattern = `(?:^|\\\\s)${escaped}`;\n }\n\n return new RegExp(pattern, flags);\n};\n\nexport default createStringMatcher;\n"]}
@@ -0,0 +1,4 @@
1
+ /** Generate unique id for elements */
2
+ declare const createUID: () => string;
3
+ export default createUID;
4
+ //# sourceMappingURL=createUID.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createUID.d.ts","sourceRoot":"","sources":["../../src/utils/createUID.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,QAAA,MAAM,SAAS,QAAO,MAErB,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,6 @@
1
+ /** Generate unique id for elements */
2
+ const createUID = () => {
3
+ return `_${Math.random().toString(36).slice(2, 11)}`;
4
+ };
5
+ export default createUID;
6
+ //# sourceMappingURL=createUID.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createUID.js","sourceRoot":"","sources":["../../src/utils/createUID.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,MAAM,SAAS,GAAG,GAAW,EAAE;IAC7B,OAAO,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;AACvD,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/** Generate unique id for elements */\nconst createUID = (): string => {\n return `_${Math.random().toString(36).slice(2, 11)}`;\n};\n\nexport default createUID;\n"]}
@@ -0,0 +1,4 @@
1
+ /** @returns Debounced function that can be called only once in given timeout */
2
+ declare function debounce<F extends (...args: any[]) => any>(this: any, func: F, waitTime: number): (...args: Parameters<F>) => void;
3
+ export default debounce;
4
+ //# sourceMappingURL=debounce.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../src/utils/debounce.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,iBAAS,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACjD,IAAI,EAAE,GAAG,EACT,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,MAAM,GACf,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAUlC;AAED,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,14 @@
1
+ /** @returns Debounced function that can be called only once in given timeout */
2
+ function debounce(func, waitTime) {
3
+ let timeout;
4
+ return (...args) => {
5
+ const waitFunc = () => {
6
+ timeout = null;
7
+ func.apply(this, args);
8
+ };
9
+ clearTimeout(timeout);
10
+ timeout = setTimeout(waitFunc, waitTime);
11
+ };
12
+ }
13
+ export default debounce;
14
+ //# sourceMappingURL=debounce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debounce.js","sourceRoot":"","sources":["../../src/utils/debounce.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,SAAS,QAAQ,CAEf,IAAO,EACP,QAAgB;IAEhB,IAAI,OAAY,CAAC;IACjB,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE;QACjB,MAAM,QAAQ,GAAG,GAAG,EAAE;YACpB,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;QACF,YAAY,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,GAAG,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC3C,CAAC,CAAC;AACJ,CAAC;AAED,eAAe,QAAQ,CAAC","sourcesContent":["/** @returns Debounced function that can be called only once in given timeout */\nfunction debounce<F extends (...args: any[]) => any>(\n this: any,\n func: F,\n waitTime: number\n): (...args: Parameters<F>) => void {\n let timeout: any;\n return (...args) => {\n const waitFunc = () => {\n timeout = null;\n func.apply(this, args);\n };\n clearTimeout(timeout);\n timeout = setTimeout(waitFunc, waitTime);\n };\n}\n\nexport default debounce;\n"]}
@@ -0,0 +1,3 @@
1
+ declare const deepGet: (obj: Record<PropertyKey, any>, keys: PropertyKey[]) => any;
2
+ export default deepGet;
3
+ //# sourceMappingURL=deepGet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepGet.d.ts","sourceRoot":"","sources":["../../src/utils/deepGet.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,OAAO,QAAS,OAAO,WAAW,EAAE,GAAG,CAAC,QAAQ,WAAW,EAAE,KAAG,GAcrE,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,15 @@
1
+ const deepGet = (obj, keys) => {
2
+ let rtn = obj;
3
+ const found = keys.every(key => {
4
+ if (typeof rtn === 'object' && rtn) {
5
+ rtn = rtn[key];
6
+ return true;
7
+ }
8
+ return false;
9
+ });
10
+ if (found)
11
+ return rtn;
12
+ return undefined;
13
+ };
14
+ export default deepGet;
15
+ //# sourceMappingURL=deepGet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepGet.js","sourceRoot":"","sources":["../../src/utils/deepGet.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG,CAAC,GAA6B,EAAE,IAAmB,EAAO,EAAE;IAC1E,IAAI,GAAG,GAAQ,GAAG,CAAC;IAEnB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;QAC7B,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,EAAE;YAClC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;YACf,OAAO,IAAI,CAAC;SACb;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;IAEH,IAAI,KAAK;QAAE,OAAO,GAAG,CAAC;IAEtB,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["const deepGet = (obj: Record<PropertyKey, any>, keys: PropertyKey[]): any => {\n let rtn: any = obj;\n\n const found = keys.every(key => {\n if (typeof rtn === 'object' && rtn) {\n rtn = rtn[key];\n return true;\n }\n return false;\n });\n\n if (found) return rtn;\n\n return undefined;\n};\n\nexport default deepGet;\n"]}
@@ -0,0 +1,4 @@
1
+ /** Compares two objects by comparing each key value regardless of order. */
2
+ declare const deepObjectComparison: (valueA: any, valueB: any) => boolean;
3
+ export default deepObjectComparison;
4
+ //# sourceMappingURL=deepObjectComparison.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepObjectComparison.d.ts","sourceRoot":"","sources":["../../src/utils/deepObjectComparison.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,QAAA,MAAM,oBAAoB,WAAY,GAAG,UAAU,GAAG,KAAG,OAiCxD,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,35 @@
1
+ /** Compares two objects by comparing each key value regardless of order. */
2
+ const deepObjectComparison = (valueA, valueB) => {
3
+ // If the values are strictly equal, return true
4
+ if (valueA === valueB)
5
+ return true;
6
+ // If the values are not objects and are not equal, return false
7
+ if (typeof valueA !== 'object' ||
8
+ typeof valueB !== 'object' ||
9
+ valueA === null ||
10
+ valueB === null)
11
+ return false;
12
+ const keysA = Object.keys(valueA);
13
+ const keysB = Object.keys(valueB);
14
+ // If the objects have different numbers of keys, return false
15
+ if (keysA.length !== keysB.length)
16
+ return false;
17
+ for (let i = 0; i < keysA.length; i += 1) {
18
+ const key = keysA[i];
19
+ // If there is not a 1:1 mapping of keys between the objects, return false
20
+ if (!keysB.includes(key))
21
+ return false;
22
+ if (typeof valueA[key] === 'function' || typeof valueB[key] === 'function') {
23
+ // If the value of a given key is a function, and the functions are not equivalent between the objects, return false
24
+ if (valueA[key].toString() !== valueB[key].toString())
25
+ return false;
26
+ // If all checks have passed thus far, compare the next set of nested values
27
+ }
28
+ else if (!deepObjectComparison(valueA[key], valueB[key]))
29
+ return false;
30
+ }
31
+ // If all checks have passed, the objects are deeply equal
32
+ return true;
33
+ };
34
+ export default deepObjectComparison;
35
+ //# sourceMappingURL=deepObjectComparison.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepObjectComparison.js","sourceRoot":"","sources":["../../src/utils/deepObjectComparison.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,oBAAoB,GAAG,CAAC,MAAW,EAAE,MAAW,EAAW,EAAE;IACjE,gDAAgD;IAChD,IAAI,MAAM,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IAEnC,gEAAgE;IAChE,IACE,OAAO,MAAM,KAAK,QAAQ;QAC1B,OAAO,MAAM,KAAK,QAAQ;QAC1B,MAAM,KAAK,IAAI;QACf,MAAM,KAAK,IAAI;QAEf,OAAO,KAAK,CAAC;IAEf,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAElC,8DAA8D;IAC9D,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAEhD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;QACxC,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACrB,0EAA0E;QAC1E,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,OAAO,KAAK,CAAC;QAEvC,IAAI,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,UAAU,IAAI,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,UAAU,EAAE;YAC1E,oHAAoH;YACpH,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;gBAAE,OAAO,KAAK,CAAC;YACpE,4EAA4E;SAC7E;aAAM,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;KAC1E;IAED,0DAA0D;IAC1D,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC","sourcesContent":["/** Compares two objects by comparing each key value regardless of order. */\nconst deepObjectComparison = (valueA: any, valueB: any): boolean => {\n // If the values are strictly equal, return true\n if (valueA === valueB) return true;\n\n // If the values are not objects and are not equal, return false\n if (\n typeof valueA !== 'object' ||\n typeof valueB !== 'object' ||\n valueA === null ||\n valueB === null\n )\n return false;\n\n const keysA = Object.keys(valueA);\n const keysB = Object.keys(valueB);\n\n // If the objects have different numbers of keys, return false\n if (keysA.length !== keysB.length) return false;\n\n for (let i = 0; i < keysA.length; i += 1) {\n const key = keysA[i];\n // If there is not a 1:1 mapping of keys between the objects, return false\n if (!keysB.includes(key)) return false;\n\n if (typeof valueA[key] === 'function' || typeof valueB[key] === 'function') {\n // If the value of a given key is a function, and the functions are not equivalent between the objects, return false\n if (valueA[key].toString() !== valueB[key].toString()) return false;\n // If all checks have passed thus far, compare the next set of nested values\n } else if (!deepObjectComparison(valueA[key], valueB[key])) return false;\n }\n\n // If all checks have passed, the objects are deeply equal\n return true;\n};\n\nexport default deepObjectComparison;\n"]}
@@ -0,0 +1,3 @@
1
+ declare const defineSmartGetter: (obj: Record<string, any>, key: string, valueFn: (...args: any[]) => any) => Record<string, any>;
2
+ export default defineSmartGetter;
3
+ //# sourceMappingURL=defineSmartGetter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defineSmartGetter.d.ts","sourceRoot":"","sources":["../../src/utils/defineSmartGetter.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,iBAAiB,QAChB,OAAO,MAAM,EAAE,GAAG,CAAC,OACnB,MAAM,qBACQ,GAAG,EAAE,KAAK,GAAG,KAC/B,OAAO,MAAM,EAAE,GAAG,CAYpB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,14 @@
1
+ const defineSmartGetter = (obj, key, valueFn) => {
2
+ Object.defineProperty(obj, key, {
3
+ get: () => {
4
+ delete obj[key];
5
+ obj[key] = valueFn();
6
+ return obj[key];
7
+ },
8
+ enumerable: true,
9
+ configurable: true
10
+ });
11
+ return obj;
12
+ };
13
+ export default defineSmartGetter;
14
+ //# sourceMappingURL=defineSmartGetter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defineSmartGetter.js","sourceRoot":"","sources":["../../src/utils/defineSmartGetter.ts"],"names":[],"mappings":"AAAA,MAAM,iBAAiB,GAAG,CACxB,GAAwB,EACxB,GAAW,EACX,OAAgC,EACX,EAAE;IACvB,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE;QAC9B,GAAG,EAAE,GAAG,EAAE;YACR,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;YAChB,GAAG,CAAC,GAAG,CAAC,GAAG,OAAO,EAAE,CAAC;YACrB,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC;QACD,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["const defineSmartGetter = (\n obj: Record<string, any>,\n key: string,\n valueFn: (...args: any[]) => any\n): Record<string, any> => {\n Object.defineProperty(obj, key, {\n get: () => {\n delete obj[key];\n obj[key] = valueFn();\n return obj[key];\n },\n enumerable: true,\n configurable: true\n });\n\n return obj;\n};\n\nexport default defineSmartGetter;\n"]}
@@ -0,0 +1,3 @@
1
+ declare const documentIsAvailable: boolean;
2
+ export default documentIsAvailable;
3
+ //# sourceMappingURL=documentIsAvailable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentIsAvailable.d.ts","sourceRoot":"","sources":["../../src/utils/documentIsAvailable.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,mBAAmB,SAAkC,CAAC;AAE5D,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,3 @@
1
+ const documentIsAvailable = typeof document !== 'undefined';
2
+ export default documentIsAvailable;
3
+ //# sourceMappingURL=documentIsAvailable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentIsAvailable.js","sourceRoot":"","sources":["../../src/utils/documentIsAvailable.ts"],"names":[],"mappings":"AAAA,MAAM,mBAAmB,GAAG,OAAO,QAAQ,KAAK,WAAW,CAAC;AAE5D,eAAe,mBAAmB,CAAC","sourcesContent":["const documentIsAvailable = typeof document !== 'undefined';\n\nexport default documentIsAvailable;\n"]}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Escape special characters in order to pass a string to the RegExp constructor.
3
+ * @param s a string.
4
+ * @returns a string with special characters escaped.
5
+ */
6
+ declare const escapeRegExp: (s: string) => string;
7
+ export default escapeRegExp;
8
+ //# sourceMappingURL=escapeRegExp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"escapeRegExp.d.ts","sourceRoot":"","sources":["../../src/utils/escapeRegExp.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,QAAA,MAAM,YAAY,MAAO,MAAM,KAAG,MAA0D,CAAC;AAE7F,eAAe,YAAY,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Escape special characters in order to pass a string to the RegExp constructor.
3
+ * @param s a string.
4
+ * @returns a string with special characters escaped.
5
+ */
6
+ const escapeRegExp = (s) => String(s).replace(/[\\^$*+?.()|[\]{}]/g, '\\$&');
7
+ export default escapeRegExp;
8
+ //# sourceMappingURL=escapeRegExp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"escapeRegExp.js","sourceRoot":"","sources":["../../src/utils/escapeRegExp.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,YAAY,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AAE7F,eAAe,YAAY,CAAC","sourcesContent":["/**\n * Escape special characters in order to pass a string to the RegExp constructor.\n * @param s a string.\n * @returns a string with special characters escaped.\n */\nconst escapeRegExp = (s: string): string => String(s).replace(/[\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n\nexport default escapeRegExp;\n"]}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Focuses the highest level heading element in a container, or the container itself if there are no headings.
3
+ * @param container Node to query for a heading.
4
+ * @param label Fallback label to apply to the container if focused.
5
+ */
6
+ declare const focusHeadingOrContainer: (container: ParentNode, label: string) => void;
7
+ export default focusHeadingOrContainer;
8
+ //# sourceMappingURL=focusHeadingOrContainer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focusHeadingOrContainer.d.ts","sourceRoot":"","sources":["../../src/utils/focusHeadingOrContainer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,QAAA,MAAM,uBAAuB,cAAe,UAAU,SAAS,MAAM,SAkCpE,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Focuses the highest level heading element in a container, or the container itself if there are no headings.
3
+ * @param container Node to query for a heading.
4
+ * @param label Fallback label to apply to the container if focused.
5
+ */
6
+ const focusHeadingOrContainer = (container, label) => {
7
+ const heading = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].reduce((el, tag) => el ?? container.querySelector(tag), null);
8
+ const target = heading ?? container;
9
+ if (!(target instanceof HTMLElement || target instanceof SVGElement))
10
+ return;
11
+ if (target === container && !target.hasAttribute('aria-label')) {
12
+ target.setAttribute('aria-label', label);
13
+ target.addEventListener('focusout', () => {
14
+ target.removeAttribute('aria-label');
15
+ }, { once: true });
16
+ }
17
+ if (target.hasAttribute('tabindex')) {
18
+ target.focus();
19
+ }
20
+ else {
21
+ target.setAttribute('tabindex', '-1');
22
+ target.focus();
23
+ target.addEventListener('focusout', () => {
24
+ target.removeAttribute('tabindex');
25
+ }, { once: true });
26
+ }
27
+ };
28
+ export default focusHeadingOrContainer;
29
+ //# sourceMappingURL=focusHeadingOrContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focusHeadingOrContainer.js","sourceRoot":"","sources":["../../src/utils/focusHeadingOrContainer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,uBAAuB,GAAG,CAAC,SAAqB,EAAE,KAAa,EAAE,EAAE;IACvE,MAAM,OAAO,GAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAW,CAAC,MAAM,CACpE,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,IAAI,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC,EAC/C,IAAI,CACL,CAAC;IAEF,MAAM,MAAM,GAAG,OAAO,IAAI,SAAS,CAAC;IAEpC,IAAI,CAAC,CAAC,MAAM,YAAY,WAAW,IAAI,MAAM,YAAY,UAAU,CAAC;QAAE,OAAO;IAE7E,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE;QAC9D,MAAM,CAAC,YAAY,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QACzC,MAAM,CAAC,gBAAgB,CACrB,UAAU,EACV,GAAG,EAAE;YACH,MAAM,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;QACvC,CAAC,EACD,EAAE,IAAI,EAAE,IAAI,EAAE,CACf,CAAC;KACH;IAED,IAAI,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE;QACnC,MAAM,CAAC,KAAK,EAAE,CAAC;KAChB;SAAM;QACL,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACtC,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,gBAAgB,CACrB,UAAU,EACV,GAAG,EAAE;YACH,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;QACrC,CAAC,EACD,EAAE,IAAI,EAAE,IAAI,EAAE,CACf,CAAC;KACH;AACH,CAAC,CAAC;AAEF,eAAe,uBAAuB,CAAC","sourcesContent":["/**\n * Focuses the highest level heading element in a container, or the container itself if there are no headings.\n * @param container Node to query for a heading.\n * @param label Fallback label to apply to the container if focused.\n */\nconst focusHeadingOrContainer = (container: ParentNode, label: string) => {\n const heading = (['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const).reduce<HTMLHeadingElement | null>(\n (el, tag) => el ?? container.querySelector(tag),\n null\n );\n\n const target = heading ?? container;\n\n if (!(target instanceof HTMLElement || target instanceof SVGElement)) return;\n\n if (target === container && !target.hasAttribute('aria-label')) {\n target.setAttribute('aria-label', label);\n target.addEventListener(\n 'focusout',\n () => {\n target.removeAttribute('aria-label');\n },\n { once: true }\n );\n }\n\n if (target.hasAttribute('tabindex')) {\n target.focus();\n } else {\n target.setAttribute('tabindex', '-1');\n target.focus();\n target.addEventListener(\n 'focusout',\n () => {\n target.removeAttribute('tabindex');\n },\n { once: true }\n );\n }\n};\n\nexport default focusHeadingOrContainer;\n"]}
@@ -0,0 +1,15 @@
1
+ import type { TranslationFunction, TranslationPack } from '../i18n';
2
+ /**
3
+ * Function generates string representation of the given list accordingly to localization rules of given locale.
4
+ * @param list list of strings to format
5
+ * @param t translation function used internally
6
+ * @param locale locale tag to get the localization rules for
7
+ * @param options formatting options
8
+ * @returns
9
+ */
10
+ declare const formatListToLocaleString: (list: string[], t: TranslationFunction<TranslationPack>, locale: string, { count, separator }?: {
11
+ count?: number | undefined;
12
+ separator?: string | undefined;
13
+ }) => string;
14
+ export default formatListToLocaleString;
15
+ //# sourceMappingURL=formatListToLocaleString.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatListToLocaleString.d.ts","sourceRoot":"","sources":["../../src/utils/formatListToLocaleString.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEpE;;;;;;;GAOG;AACH,QAAA,MAAM,wBAAwB,SACtB,MAAM,EAAE,KACX,oBAAoB,eAAe,CAAC,UAC/B,MAAM;;;MAQb,MASF,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Function generates string representation of the given list accordingly to localization rules of given locale.
3
+ * @param list list of strings to format
4
+ * @param t translation function used internally
5
+ * @param locale locale tag to get the localization rules for
6
+ * @param options formatting options
7
+ * @returns
8
+ */
9
+ const formatListToLocaleString = (list, t, locale, { count = list.length, separator } = {}) => {
10
+ const remainder = list.length ? count - list.length : 0;
11
+ const toFormat = remainder > 0 ? [...list, t('more_count', [remainder], { count: remainder })] : list;
12
+ if (separator || !('ListFormat' in Intl))
13
+ return toFormat.join(separator ?? ', ');
14
+ return new Intl.ListFormat(locale, { style: 'long' }).format(toFormat);
15
+ };
16
+ export default formatListToLocaleString;
17
+ //# sourceMappingURL=formatListToLocaleString.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatListToLocaleString.js","sourceRoot":"","sources":["../../src/utils/formatListToLocaleString.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,wBAAwB,GAAG,CAC/B,IAAc,EACd,CAAuC,EACvC,MAAc,EACd,EACE,KAAK,GAAG,IAAI,CAAC,MAAM,EACnB,SAAS,KAIP,EAAE,EACE,EAAE;IACV,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAExD,MAAM,QAAQ,GACZ,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,YAAY,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAEvF,IAAI,SAAS,IAAI,CAAC,CAAC,YAAY,IAAI,IAAI,CAAC;QAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC;IAElF,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACzE,CAAC,CAAC;AAEF,eAAe,wBAAwB,CAAC","sourcesContent":["import type { TranslationFunction, TranslationPack } from '../i18n';\n\n/**\n * Function generates string representation of the given list accordingly to localization rules of given locale.\n * @param list list of strings to format\n * @param t translation function used internally\n * @param locale locale tag to get the localization rules for\n * @param options formatting options\n * @returns\n */\nconst formatListToLocaleString = (\n list: string[],\n t: TranslationFunction<TranslationPack>,\n locale: string,\n {\n count = list.length,\n separator\n }: {\n count?: number;\n separator?: string;\n } = {}\n): string => {\n const remainder = list.length ? count - list.length : 0;\n\n const toFormat =\n remainder > 0 ? [...list, t('more_count', [remainder], { count: remainder })] : list;\n\n if (separator || !('ListFormat' in Intl)) return toFormat.join(separator ?? ', ');\n\n return new Intl.ListFormat(locale, { style: 'long' }).format(toFormat);\n};\n\nexport default formatListToLocaleString;\n"]}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Gets element that currently has focus with support for open shadow roots.
3
+ * @param root Optional container to search for the active element. Defaults to `document`.
4
+ * @returns The Element within the DOM that currently has focus.
5
+ */
6
+ declare const getActiveElement: (root?: DocumentOrShadowRoot) => Element | null;
7
+ export default getActiveElement;
8
+ //# sourceMappingURL=getActiveElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getActiveElement.d.ts","sourceRoot":"","sources":["../../src/utils/getActiveElement.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,QAAA,MAAM,gBAAgB,UAAU,oBAAoB,KAAc,OAAO,GAAG,IAc3E,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Gets element that currently has focus with support for open shadow roots.
3
+ * @param root Optional container to search for the active element. Defaults to `document`.
4
+ * @returns The Element within the DOM that currently has focus.
5
+ */
6
+ const getActiveElement = (root = document) => {
7
+ let activeEl = root.activeElement;
8
+ if (!activeEl)
9
+ return null;
10
+ if (activeEl.tagName.toLowerCase() === 'iframe' &&
11
+ activeEl.contentDocument)
12
+ activeEl = getActiveElement(activeEl.contentDocument) ?? activeEl;
13
+ if (activeEl.shadowRoot)
14
+ activeEl = getActiveElement(activeEl.shadowRoot) ?? activeEl;
15
+ return activeEl;
16
+ };
17
+ export default getActiveElement;
18
+ //# sourceMappingURL=getActiveElement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getActiveElement.js","sourceRoot":"","sources":["../../src/utils/getActiveElement.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,CAAC,OAA6B,QAAQ,EAAkB,EAAE;IACjF,IAAI,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC;IAElC,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAE3B,IACE,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,QAAQ;QAC1C,QAA8B,CAAC,eAAe;QAE/C,QAAQ,GAAG,gBAAgB,CAAE,QAA8B,CAAC,eAAgB,CAAC,IAAI,QAAQ,CAAC;IAE5F,IAAI,QAAQ,CAAC,UAAU;QAAE,QAAQ,GAAG,gBAAgB,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,QAAQ,CAAC;IAEtF,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["/**\n * Gets element that currently has focus with support for open shadow roots.\n * @param root Optional container to search for the active element. Defaults to `document`.\n * @returns The Element within the DOM that currently has focus.\n */\nconst getActiveElement = (root: DocumentOrShadowRoot = document): Element | null => {\n let activeEl = root.activeElement;\n\n if (!activeEl) return null;\n\n if (\n activeEl.tagName.toLowerCase() === 'iframe' &&\n (activeEl as HTMLIFrameElement).contentDocument\n )\n activeEl = getActiveElement((activeEl as HTMLIFrameElement).contentDocument!) ?? activeEl;\n\n if (activeEl.shadowRoot) activeEl = getActiveElement(activeEl.shadowRoot) ?? activeEl;\n\n return activeEl;\n};\n\nexport default getActiveElement;\n"]}
@@ -0,0 +1,9 @@
1
+ import type { RefObject } from 'react';
2
+ /**
3
+ * Returns all valid focusable elements within a given ref.
4
+ * @param focusablesRef The ref containing the element to search for focusable elements within.
5
+ * @returns a list of valid focusable elements within the given ref.
6
+ */
7
+ declare const getFocusables: (focusablesRef: RefObject<HTMLElement>) => HTMLElement[];
8
+ export default getFocusables;
9
+ //# sourceMappingURL=getFocusables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFocusables.d.ts","sourceRoot":"","sources":["../../src/utils/getFocusables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;GAIG;AACH,QAAA,MAAM,aAAa,kBAAmB,UAAU,WAAW,CAAC,KAAG,WAAW,EAWzE,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Returns all valid focusable elements within a given ref.
3
+ * @param focusablesRef The ref containing the element to search for focusable elements within.
4
+ * @returns a list of valid focusable elements within the given ref.
5
+ */
6
+ const getFocusables = (focusablesRef) => {
7
+ if (!focusablesRef.current)
8
+ return [];
9
+ const selector = 'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])';
10
+ return [...focusablesRef.current.querySelectorAll(selector)].filter(el => el instanceof HTMLElement &&
11
+ !el.hasAttribute('disabled') &&
12
+ el.getAttribute('tabindex') !== '-1');
13
+ };
14
+ export default getFocusables;
15
+ //# sourceMappingURL=getFocusables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFocusables.js","sourceRoot":"","sources":["../../src/utils/getFocusables.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,aAAa,GAAG,CAAC,aAAqC,EAAiB,EAAE;IAC7E,IAAI,CAAC,aAAa,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IAEtC,MAAM,QAAQ,GAAG,8EAA8E,CAAC;IAEhG,OAAQ,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAmB,CAAC,MAAM,CACpF,EAAE,CAAC,EAAE,CACH,EAAE,YAAY,WAAW;QACzB,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC;QAC5B,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,IAAI,CACvC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import type { RefObject } from 'react';\n\n/**\n * Returns all valid focusable elements within a given ref.\n * @param focusablesRef The ref containing the element to search for focusable elements within.\n * @returns a list of valid focusable elements within the given ref.\n */\nconst getFocusables = (focusablesRef: RefObject<HTMLElement>): HTMLElement[] => {\n if (!focusablesRef.current) return [];\n\n const selector = 'a, button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])';\n\n return ([...focusablesRef.current.querySelectorAll(selector)] as HTMLElement[]).filter(\n el =>\n el instanceof HTMLElement &&\n !el.hasAttribute('disabled') &&\n el.getAttribute('tabindex') !== '-1'\n );\n};\n\nexport default getFocusables;\n"]}
@@ -0,0 +1,4 @@
1
+ /** Get scrollbar width */
2
+ declare const getScrollbarWidth: () => number;
3
+ export default getScrollbarWidth;
4
+ //# sourceMappingURL=getScrollbarWidth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getScrollbarWidth.d.ts","sourceRoot":"","sources":["../../src/utils/getScrollbarWidth.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,QAAA,MAAM,iBAAiB,QAAO,MAgB7B,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,17 @@
1
+ /** Get scrollbar width */
2
+ const getScrollbarWidth = () => {
3
+ const scrollDiv = document.createElement('div');
4
+ const divSize = '50px';
5
+ let size = 0;
6
+ scrollDiv.style.position = 'absolute';
7
+ scrollDiv.style.top = `-${divSize}`;
8
+ scrollDiv.style.width = divSize;
9
+ scrollDiv.style.height = divSize;
10
+ scrollDiv.style.overflow = 'scroll';
11
+ document.body.appendChild(scrollDiv);
12
+ size = scrollDiv.offsetWidth - scrollDiv.clientWidth;
13
+ document.body.removeChild(scrollDiv);
14
+ return size;
15
+ };
16
+ export default getScrollbarWidth;
17
+ //# sourceMappingURL=getScrollbarWidth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getScrollbarWidth.js","sourceRoot":"","sources":["../../src/utils/getScrollbarWidth.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,MAAM,iBAAiB,GAAG,GAAW,EAAE;IACrC,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAChD,MAAM,OAAO,GAAG,MAAM,CAAC;IACvB,IAAI,IAAI,GAAG,CAAC,CAAC;IAEb,SAAS,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;IACtC,SAAS,CAAC,KAAK,CAAC,GAAG,GAAG,IAAI,OAAO,EAAE,CAAC;IACpC,SAAS,CAAC,KAAK,CAAC,KAAK,GAAG,OAAO,CAAC;IAChC,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC;IACjC,SAAS,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAEpC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACrC,IAAI,GAAG,SAAS,CAAC,WAAW,GAAG,SAAS,CAAC,WAAW,CAAC;IACrD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAErC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["/** Get scrollbar width */\nconst getScrollbarWidth = (): number => {\n const scrollDiv = document.createElement('div');\n const divSize = '50px';\n let size = 0;\n\n scrollDiv.style.position = 'absolute';\n scrollDiv.style.top = `-${divSize}`;\n scrollDiv.style.width = divSize;\n scrollDiv.style.height = divSize;\n scrollDiv.style.overflow = 'scroll';\n\n document.body.appendChild(scrollDiv);\n size = scrollDiv.offsetWidth - scrollDiv.clientWidth;\n document.body.removeChild(scrollDiv);\n\n return size;\n};\n\nexport default getScrollbarWidth;\n"]}
@@ -0,0 +1,4 @@
1
+ /** Check for an existence of prop */
2
+ declare const hasProp: <T extends object, P extends PropertyKey>(obj: T, prop: P) => obj is T & { [key in P]: unknown; };
3
+ export default hasProp;
4
+ //# sourceMappingURL=hasProp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hasProp.d.ts","sourceRoot":"","sources":["../../src/utils/hasProp.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,QAAA,MAAM,OAAO,mGAKZ,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,6 @@
1
+ /** Check for an existence of prop */
2
+ const hasProp = (obj, prop) => {
3
+ return Object.prototype.hasOwnProperty.call(obj, prop);
4
+ };
5
+ export default hasProp;
6
+ //# sourceMappingURL=hasProp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hasProp.js","sourceRoot":"","sources":["../../src/utils/hasProp.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,MAAM,OAAO,GAAG,CACd,GAAM,EACN,IAAO,EAC6B,EAAE;IACtC,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AACzD,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["/** Check for an existence of prop */\nconst hasProp = <T extends object, P extends PropertyKey>(\n obj: T,\n prop: P\n): obj is T & { [key in P]: unknown } => {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n};\n\nexport default hasProp;\n"]}
@@ -1,2 +1,28 @@
1
- export * from './utils';
1
+ export { default as bindAll } from './bindAll';
2
+ export { default as cap } from './cap';
3
+ export { default as createStringMatcher } from './createStringMatcher';
4
+ export { default as createUID } from './createUID';
5
+ export { default as debounce } from './debounce';
6
+ export { default as deepGet } from './deepGet';
7
+ export { default as deepObjectComparison } from './deepObjectComparison';
8
+ export { default as defineSmartGetter } from './defineSmartGetter';
9
+ export { default as documentIsAvailable } from './documentIsAvailable';
10
+ export { default as escapeRegExp } from './escapeRegExp';
11
+ export { default as focusHeadingOrContainer } from './focusHeadingOrContainer';
12
+ export { default as formatListToLocaleString } from './formatListToLocaleString';
13
+ export { default as getActiveElement } from './getActiveElement';
14
+ export { default as getFocusables } from './getFocusables';
15
+ export { default as getScrollbarWidth } from './getScrollbarWidth';
16
+ export { default as hasProp } from './hasProp';
17
+ export { default as loadScript } from './loadScript';
18
+ export { default as navigatorIsAvailable } from './navigatorIsAvailable';
19
+ export { default as normalizeElements } from './normalizeElements';
20
+ export { default as range } from './range';
21
+ export { default as reflow } from './reflow';
22
+ export { default as replaceMatchWithElement } from './replaceMatchWithElement';
23
+ export { default as sameOrigin } from './sameOrigin';
24
+ export { default as testElForOverflow } from './testElForOverflow';
25
+ export { default as triple } from './triple';
26
+ export { default as tryCatch } from './tryCatch';
27
+ export { default as windowIsAvailable } from './windowIsAvailable';
2
28
  //# sourceMappingURL=index.d.ts.map