@pega/cosmos-react-core 4.0.0-dev.5.0 → 4.0.0-dev.5.1

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 (145) hide show
  1. package/lib/components/AppShell/AppShell.styles.js +1 -1
  2. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  3. package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -1
  4. package/lib/components/AppShell/NavigationListItemWrapper.js +4 -2
  5. package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -1
  6. package/lib/components/Badges/Count.js +1 -1
  7. package/lib/components/Badges/Count.js.map +1 -1
  8. package/lib/components/Badges/Selection.js +1 -1
  9. package/lib/components/Badges/Selection.js.map +1 -1
  10. package/lib/components/Badges/Tag.js +1 -1
  11. package/lib/components/Badges/Tag.js.map +1 -1
  12. package/lib/components/Location/LocationInput.js +1 -1
  13. package/lib/components/Location/LocationInput.js.map +1 -1
  14. package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
  15. package/lib/components/MenuButton/MenuButton.js +18 -4
  16. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  17. package/lib/components/RadioCheck/RadioCheck.js +1 -1
  18. package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
  19. package/lib/components/Tabs/Tab.js +1 -1
  20. package/lib/components/Tabs/Tab.js.map +1 -1
  21. package/lib/hooks/useI18n.d.ts +3 -0
  22. package/lib/hooks/useI18n.d.ts.map +1 -1
  23. package/lib/i18n/default.d.ts +3 -0
  24. package/lib/i18n/default.d.ts.map +1 -1
  25. package/lib/i18n/default.js +3 -0
  26. package/lib/i18n/default.js.map +1 -1
  27. package/lib/i18n/i18n.d.ts +3 -0
  28. package/lib/i18n/i18n.d.ts.map +1 -1
  29. package/lib/utils/bindAll.d.ts +4 -0
  30. package/lib/utils/bindAll.d.ts.map +1 -0
  31. package/lib/utils/bindAll.js +9 -0
  32. package/lib/utils/bindAll.js.map +1 -0
  33. package/lib/utils/cap.d.ts +4 -0
  34. package/lib/utils/cap.d.ts.map +1 -0
  35. package/lib/utils/cap.js +6 -0
  36. package/lib/utils/cap.js.map +1 -0
  37. package/lib/utils/createStringMatcher.d.ts +10 -0
  38. package/lib/utils/createStringMatcher.d.ts.map +1 -0
  39. package/lib/utils/createStringMatcher.js +21 -0
  40. package/lib/utils/createStringMatcher.js.map +1 -0
  41. package/lib/utils/createUID.d.ts +4 -0
  42. package/lib/utils/createUID.d.ts.map +1 -0
  43. package/lib/utils/createUID.js +6 -0
  44. package/lib/utils/createUID.js.map +1 -0
  45. package/lib/utils/debounce.d.ts +4 -0
  46. package/lib/utils/debounce.d.ts.map +1 -0
  47. package/lib/utils/debounce.js +14 -0
  48. package/lib/utils/debounce.js.map +1 -0
  49. package/lib/utils/deepGet.d.ts +3 -0
  50. package/lib/utils/deepGet.d.ts.map +1 -0
  51. package/lib/utils/deepGet.js +15 -0
  52. package/lib/utils/deepGet.js.map +1 -0
  53. package/lib/utils/deepObjectComparison.d.ts +4 -0
  54. package/lib/utils/deepObjectComparison.d.ts.map +1 -0
  55. package/lib/utils/deepObjectComparison.js +35 -0
  56. package/lib/utils/deepObjectComparison.js.map +1 -0
  57. package/lib/utils/defineSmartGetter.d.ts +3 -0
  58. package/lib/utils/defineSmartGetter.d.ts.map +1 -0
  59. package/lib/utils/defineSmartGetter.js +14 -0
  60. package/lib/utils/defineSmartGetter.js.map +1 -0
  61. package/lib/utils/documentIsAvailable.d.ts +3 -0
  62. package/lib/utils/documentIsAvailable.d.ts.map +1 -0
  63. package/lib/utils/documentIsAvailable.js +3 -0
  64. package/lib/utils/documentIsAvailable.js.map +1 -0
  65. package/lib/utils/escapeRegExp.d.ts +8 -0
  66. package/lib/utils/escapeRegExp.d.ts.map +1 -0
  67. package/lib/utils/escapeRegExp.js +8 -0
  68. package/lib/utils/escapeRegExp.js.map +1 -0
  69. package/lib/utils/focusHeadingOrContainer.d.ts +8 -0
  70. package/lib/utils/focusHeadingOrContainer.d.ts.map +1 -0
  71. package/lib/utils/focusHeadingOrContainer.js +29 -0
  72. package/lib/utils/focusHeadingOrContainer.js.map +1 -0
  73. package/lib/utils/formatListToLocaleString.d.ts +15 -0
  74. package/lib/utils/formatListToLocaleString.d.ts.map +1 -0
  75. package/lib/utils/formatListToLocaleString.js +17 -0
  76. package/lib/utils/formatListToLocaleString.js.map +1 -0
  77. package/lib/utils/getActiveElement.d.ts +8 -0
  78. package/lib/utils/getActiveElement.d.ts.map +1 -0
  79. package/lib/utils/getActiveElement.js +18 -0
  80. package/lib/utils/getActiveElement.js.map +1 -0
  81. package/lib/utils/getFocusables.d.ts +9 -0
  82. package/lib/utils/getFocusables.d.ts.map +1 -0
  83. package/lib/utils/getFocusables.js +15 -0
  84. package/lib/utils/getFocusables.js.map +1 -0
  85. package/lib/utils/getScrollbarWidth.d.ts +4 -0
  86. package/lib/utils/getScrollbarWidth.d.ts.map +1 -0
  87. package/lib/utils/getScrollbarWidth.js +17 -0
  88. package/lib/utils/getScrollbarWidth.js.map +1 -0
  89. package/lib/utils/hasProp.d.ts +4 -0
  90. package/lib/utils/hasProp.d.ts.map +1 -0
  91. package/lib/utils/hasProp.js +6 -0
  92. package/lib/utils/hasProp.js.map +1 -0
  93. package/lib/utils/index.d.ts +27 -1
  94. package/lib/utils/index.d.ts.map +1 -1
  95. package/lib/utils/index.js +27 -1
  96. package/lib/utils/index.js.map +1 -1
  97. package/lib/utils/loadScript.d.ts +3 -0
  98. package/lib/utils/loadScript.d.ts.map +1 -0
  99. package/lib/utils/loadScript.js +9 -0
  100. package/lib/utils/loadScript.js.map +1 -0
  101. package/lib/utils/navigatorIsAvailable.d.ts +3 -0
  102. package/lib/utils/navigatorIsAvailable.d.ts.map +1 -0
  103. package/lib/utils/navigatorIsAvailable.js +3 -0
  104. package/lib/utils/navigatorIsAvailable.js.map +1 -0
  105. package/lib/utils/normalizeElements.d.ts +9 -0
  106. package/lib/utils/normalizeElements.d.ts.map +1 -0
  107. package/lib/utils/normalizeElements.js +14 -0
  108. package/lib/utils/normalizeElements.js.map +1 -0
  109. package/lib/utils/range.d.ts +4 -0
  110. package/lib/utils/range.d.ts.map +1 -0
  111. package/lib/utils/range.js +8 -0
  112. package/lib/utils/range.js.map +1 -0
  113. package/lib/utils/reflow.d.ts +4 -0
  114. package/lib/utils/reflow.d.ts.map +1 -0
  115. package/lib/utils/reflow.js +7 -0
  116. package/lib/utils/reflow.js.map +1 -0
  117. package/lib/utils/replaceMatchWithElement.d.ts +4 -0
  118. package/lib/utils/replaceMatchWithElement.d.ts.map +1 -0
  119. package/lib/utils/replaceMatchWithElement.js +32 -0
  120. package/lib/utils/replaceMatchWithElement.js.map +1 -0
  121. package/lib/utils/sameOrigin.d.ts +7 -0
  122. package/lib/utils/sameOrigin.d.ts.map +1 -0
  123. package/lib/utils/sameOrigin.js +25 -0
  124. package/lib/utils/sameOrigin.js.map +1 -0
  125. package/lib/utils/testElForOverflow.d.ts +4 -0
  126. package/lib/utils/testElForOverflow.d.ts.map +1 -0
  127. package/lib/utils/testElForOverflow.js +6 -0
  128. package/lib/utils/testElForOverflow.js.map +1 -0
  129. package/lib/utils/triple.d.ts +12 -0
  130. package/lib/utils/triple.d.ts.map +1 -0
  131. package/lib/utils/triple.js +13 -0
  132. package/lib/utils/triple.js.map +1 -0
  133. package/lib/utils/tryCatch.d.ts +5 -0
  134. package/lib/utils/tryCatch.d.ts.map +1 -0
  135. package/lib/utils/tryCatch.js +16 -0
  136. package/lib/utils/tryCatch.js.map +1 -0
  137. package/lib/utils/windowIsAvailable.d.ts +3 -0
  138. package/lib/utils/windowIsAvailable.d.ts.map +1 -0
  139. package/lib/utils/windowIsAvailable.js +3 -0
  140. package/lib/utils/windowIsAvailable.js.map +1 -0
  141. package/package.json +1 -1
  142. package/lib/utils/utils.d.ts +0 -99
  143. package/lib/utils/utils.d.ts.map +0 -1
  144. package/lib/utils/utils.js +0 -314
  145. package/lib/utils/utils.js.map +0 -1
@@ -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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -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.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC","sourcesContent":["export * from './utils';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["export { default as bindAll } from './bindAll';\nexport { default as cap } from './cap';\nexport { default as createStringMatcher } from './createStringMatcher';\nexport { default as createUID } from './createUID';\nexport { default as debounce } from './debounce';\nexport { default as deepGet } from './deepGet';\nexport { default as deepObjectComparison } from './deepObjectComparison';\nexport { default as defineSmartGetter } from './defineSmartGetter';\nexport { default as documentIsAvailable } from './documentIsAvailable';\nexport { default as escapeRegExp } from './escapeRegExp';\nexport { default as focusHeadingOrContainer } from './focusHeadingOrContainer';\nexport { default as formatListToLocaleString } from './formatListToLocaleString';\nexport { default as getActiveElement } from './getActiveElement';\nexport { default as getFocusables } from './getFocusables';\nexport { default as getScrollbarWidth } from './getScrollbarWidth';\nexport { default as hasProp } from './hasProp';\nexport { default as loadScript } from './loadScript';\nexport { default as navigatorIsAvailable } from './navigatorIsAvailable';\nexport { default as normalizeElements } from './normalizeElements';\nexport { default as range } from './range';\nexport { default as reflow } from './reflow';\nexport { default as replaceMatchWithElement } from './replaceMatchWithElement';\nexport { default as sameOrigin } from './sameOrigin';\nexport { default as testElForOverflow } from './testElForOverflow';\nexport { default as triple } from './triple';\nexport { default as tryCatch } from './tryCatch';\nexport { default as windowIsAvailable } from './windowIsAvailable';\n"]}
@@ -0,0 +1,3 @@
1
+ declare const loadScript: (src: string, onLoad: (this: HTMLScriptElement, ev: Event) => any, onError: (this: HTMLScriptElement, ev: ErrorEvent) => any) => void;
2
+ export default loadScript;
3
+ //# sourceMappingURL=loadScript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadScript.d.ts","sourceRoot":"","sources":["../../src/utils/loadScript.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,UAAU,QACT,MAAM,iBACI,iBAAiB,MAAM,KAAK,KAAK,GAAG,kBACnC,iBAAiB,MAAM,UAAU,KAAK,GAAG,KACxD,IAOF,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,9 @@
1
+ const loadScript = (src, onLoad, onError) => {
2
+ const scriptElem = document.createElement('script');
3
+ scriptElem.src = src;
4
+ scriptElem.addEventListener('load', onLoad);
5
+ scriptElem.addEventListener('error', onError);
6
+ document.head.appendChild(scriptElem);
7
+ };
8
+ export default loadScript;
9
+ //# sourceMappingURL=loadScript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadScript.js","sourceRoot":"","sources":["../../src/utils/loadScript.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,CACjB,GAAW,EACX,MAAmD,EACnD,OAAyD,EACnD,EAAE;IACR,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACpD,UAAU,CAAC,GAAG,GAAG,GAAG,CAAC;IAErB,UAAU,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["const loadScript = (\n src: string,\n onLoad: (this: HTMLScriptElement, ev: Event) => any,\n onError: (this: HTMLScriptElement, ev: ErrorEvent) => any\n): void => {\n const scriptElem = document.createElement('script');\n scriptElem.src = src;\n\n scriptElem.addEventListener('load', onLoad);\n scriptElem.addEventListener('error', onError);\n document.head.appendChild(scriptElem);\n};\n\nexport default loadScript;\n"]}
@@ -0,0 +1,3 @@
1
+ declare const navigatorIsAvailable: boolean;
2
+ export default navigatorIsAvailable;
3
+ //# sourceMappingURL=navigatorIsAvailable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigatorIsAvailable.d.ts","sourceRoot":"","sources":["../../src/utils/navigatorIsAvailable.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,oBAAoB,SAAmC,CAAC;AAE9D,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,3 @@
1
+ const navigatorIsAvailable = typeof navigator !== 'undefined';
2
+ export default navigatorIsAvailable;
3
+ //# sourceMappingURL=navigatorIsAvailable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigatorIsAvailable.js","sourceRoot":"","sources":["../../src/utils/navigatorIsAvailable.ts"],"names":[],"mappings":"AAAA,MAAM,oBAAoB,GAAG,OAAO,SAAS,KAAK,WAAW,CAAC;AAE9D,eAAe,oBAAoB,CAAC","sourcesContent":["const navigatorIsAvailable = typeof navigator !== 'undefined';\n\nexport default navigatorIsAvailable;\n"]}
@@ -0,0 +1,9 @@
1
+ import type { RefObject } from 'react';
2
+ /**
3
+ * Returns normalized list of elements, ie. it de-reference the element from the RefObject if needed.
4
+ * @param els a list of elements or refs to normalize.
5
+ * @returns a new list of the same length with the de-referenced elements.
6
+ */
7
+ declare const normalizeElements: <T extends EventTarget = EventTarget>(els: (T | RefObject<T | null> | null)[]) => (T | null)[];
8
+ export default normalizeElements;
9
+ //# sourceMappingURL=normalizeElements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalizeElements.d.ts","sourceRoot":"","sources":["../../src/utils/normalizeElements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;GAIG;AACH,QAAA,MAAM,iBAAiB,gGAOtB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Returns normalized list of elements, ie. it de-reference the element from the RefObject if needed.
3
+ * @param els a list of elements or refs to normalize.
4
+ * @returns a new list of the same length with the de-referenced elements.
5
+ */
6
+ const normalizeElements = (els) => {
7
+ return els.map((el) => {
8
+ if (!el)
9
+ return null;
10
+ return el instanceof EventTarget ? el : el.current;
11
+ });
12
+ };
13
+ export default normalizeElements;
14
+ //# sourceMappingURL=normalizeElements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalizeElements.js","sourceRoot":"","sources":["../../src/utils/normalizeElements.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,CACxB,GAAuC,EACzB,EAAE;IAChB,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,EAAkC,EAAE,EAAE;QACpD,IAAI,CAAC,EAAE;YAAE,OAAO,IAAI,CAAC;QACrB,OAAO,EAAE,YAAY,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import type { RefObject } from 'react';\n\n/**\n * Returns normalized list of elements, ie. it de-reference the element from the RefObject if needed.\n * @param els a list of elements or refs to normalize.\n * @returns a new list of the same length with the de-referenced elements.\n */\nconst normalizeElements = <T extends EventTarget = EventTarget>(\n els: (T | null | RefObject<T | null>)[]\n): (T | null)[] => {\n return els.map((el: T | null | RefObject<T | null>) => {\n if (!el) return null;\n return el instanceof EventTarget ? el : el.current;\n });\n};\n\nexport default normalizeElements;\n"]}
@@ -0,0 +1,4 @@
1
+ /** Returns array with numbers from given range */
2
+ declare const range: (start: number, end: number) => number[];
3
+ export default range;
4
+ //# sourceMappingURL=range.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../../src/utils/range.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,QAAA,MAAM,KAAK,UAAW,MAAM,OAAO,MAAM,KAAG,MAAM,EAIjD,CAAC;AAEF,eAAe,KAAK,CAAC"}