se-design 1.0.59 → 1.0.61-dev
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.
- package/dist/assets/colors.css +2 -2
- package/dist/assets/icons/checkbox-disabled-minus.svg +1 -1
- package/dist/assets/icons/checkbox-disabled-tick.svg +1 -1
- package/dist/assets/icons/checkbox-fill.svg +1 -1
- package/dist/assets/icons/checkbox-hover-fill.svg +2 -2
- package/dist/assets/icons/sort-asc.svg +3 -4
- package/dist/assets/icons/sort-desc.svg +2 -3
- package/dist/assets/style.css +1 -1
- package/dist/components/AutoCompleteInput/index.d.ts +37 -7
- package/dist/components/DropdownWithInputTags/index.d.ts +7 -1
- package/dist/components/Header/index.d.ts +1 -0
- package/dist/components/OTPInput/index.d.ts +1 -0
- package/dist/components/PhoneInput/index.d.ts +19 -0
- package/dist/components/RadioGroup/index.d.ts +17 -0
- package/dist/components/SidebarOverlay/index.d.ts +4 -0
- package/dist/components/SkipLinksBar/index.d.ts +11 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.js +124 -120
- package/dist/index.js.map +1 -1
- package/dist/index10.js +56 -46
- package/dist/index10.js.map +1 -1
- package/dist/index100.js +2 -2
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +2 -2
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +2 -2
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +2 -2
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +1 -1
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +1 -1
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +2 -2
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +2 -2
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +2 -2
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +2 -2
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +48 -18
- package/dist/index11.js.map +1 -1
- package/dist/index110.js +1 -1
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +1 -1
- package/dist/index111.js.map +1 -1
- package/dist/index112.js +2 -2
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +1 -1
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +1 -1
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +2 -2
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +2 -2
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +2 -2
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +2 -2
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +1 -1
- package/dist/index119.js.map +1 -1
- package/dist/index12.js +20 -11
- package/dist/index12.js.map +1 -1
- package/dist/index120.js +1 -1
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +1 -1
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +1 -1
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +1 -1
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +1 -1
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +1 -1
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +2 -2
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +1 -1
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +2 -2
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +1 -1
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +15 -9
- package/dist/index13.js.map +1 -1
- package/dist/index130.js +1 -1
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +1 -1
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +1 -1
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +1 -1
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +2 -2
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +2 -2
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +2 -2
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +2 -2
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +2 -2
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +2 -2
- package/dist/index139.js.map +1 -1
- package/dist/index14.js +10 -202
- package/dist/index14.js.map +1 -1
- package/dist/index140.js +2 -2
- package/dist/index140.js.map +1 -1
- package/dist/index141.js +1 -1
- package/dist/index141.js.map +1 -1
- package/dist/index142.js +1 -1
- package/dist/index142.js.map +1 -1
- package/dist/index143.js +1 -1
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +1 -1
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +1 -1
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +1 -1
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +1 -1
- package/dist/index147.js.map +1 -1
- package/dist/index148.js +1 -1
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +1 -1
- package/dist/index149.js.map +1 -1
- package/dist/index15.js +216 -59
- package/dist/index15.js.map +1 -1
- package/dist/index150.js +1 -1
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +1 -1
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +1 -1
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +1 -1
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +1 -1
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +1 -1
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +1 -1
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +1 -1
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +1 -1
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +1 -1
- package/dist/index159.js.map +1 -1
- package/dist/index16.js +60 -84
- package/dist/index16.js.map +1 -1
- package/dist/index160.js +1 -1
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +1 -1
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +1 -1
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +2 -2
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +1 -1
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +2 -2
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +1 -1
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +2 -2
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +1 -1
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +2 -2
- package/dist/index169.js.map +1 -1
- package/dist/index17.js +80 -274
- package/dist/index17.js.map +1 -1
- package/dist/index170.js +1 -1
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +1 -1
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +1 -1
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +1 -1
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +1 -1
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +1 -1
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +1 -1
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +2 -2
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +1 -1
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +2 -2
- package/dist/index179.js.map +1 -1
- package/dist/index18.js +281 -11
- package/dist/index18.js.map +1 -1
- package/dist/index180.js +2 -149
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +2 -6
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +149 -5
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +12 -0
- package/dist/index183.js.map +1 -0
- package/dist/index184.js +9 -0
- package/dist/index184.js.map +1 -0
- package/dist/index185.js +4 -23
- package/dist/index185.js.map +1 -1
- package/dist/index188.js +27 -0
- package/dist/index188.js.map +1 -0
- package/dist/index189.js +60 -21
- package/dist/index189.js.map +1 -1
- package/dist/index19.js +12 -31
- package/dist/index19.js.map +1 -1
- package/dist/index191.js +87 -0
- package/dist/index191.js.map +1 -0
- package/dist/index193.js +26 -0
- package/dist/index193.js.map +1 -0
- package/dist/index20.js +32 -56
- package/dist/index20.js.map +1 -1
- package/dist/{index197.js → index201.js} +1 -1
- package/dist/{index197.js.map → index201.js.map} +1 -1
- package/dist/{index205.js → index209.js} +1 -1
- package/dist/{index205.js.map → index209.js.map} +1 -1
- package/dist/index21.js +53 -75
- package/dist/index21.js.map +1 -1
- package/dist/{index207.js → index211.js} +1 -1
- package/dist/{index207.js.map → index211.js.map} +1 -1
- package/dist/{index208.js → index212.js} +2 -2
- package/dist/{index208.js.map → index212.js.map} +1 -1
- package/dist/index22.js +77 -21
- package/dist/index22.js.map +1 -1
- package/dist/index222.js +3 -9
- package/dist/index222.js.map +1 -1
- package/dist/index224.js +56 -167
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +54 -11
- package/dist/index225.js.map +1 -1
- package/dist/index227.js +18 -5
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +9 -5
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +8 -36
- package/dist/index229.js.map +1 -1
- package/dist/index23.js +19 -190
- package/dist/index23.js.map +1 -1
- package/dist/index230.js +5 -2
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +170 -8
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +11 -327
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +5 -49
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +6 -2
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +35 -73
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +2 -93
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +5 -49
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +326 -7
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +49 -4
- package/dist/index239.js.map +1 -1
- package/dist/index24.js +217 -44
- package/dist/index24.js.map +1 -1
- package/dist/index240.js +2 -52
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +76 -2
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +93 -2
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +55 -0
- package/dist/index243.js.map +1 -0
- package/dist/index244.js +11 -0
- package/dist/index244.js.map +1 -0
- package/dist/index245.js +8 -0
- package/dist/index245.js.map +1 -0
- package/dist/index246.js +55 -0
- package/dist/index246.js.map +1 -0
- package/dist/index247.js +5 -0
- package/dist/index247.js.map +1 -0
- package/dist/index248.js +5 -0
- package/dist/index248.js.map +1 -0
- package/dist/index25.js +48 -18
- package/dist/index25.js.map +1 -1
- package/dist/index26.js +16 -80
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +82 -79
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +80 -130
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +131 -55
- package/dist/index29.js.map +1 -1
- package/dist/index3.js +2 -2
- package/dist/index30.js +53 -97
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +99 -61
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +59 -32
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +40 -71
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +68 -41
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +45 -57
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +54 -230
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +281 -70
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +68 -80
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +82 -32
- package/dist/index39.js.map +1 -1
- package/dist/index40.js +26 -44
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +45 -67
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +65 -49
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +49 -89
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +141 -93
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +189 -35
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +34 -29
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +31 -147
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +138 -45
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +52 -373
- package/dist/index49.js.map +1 -1
- package/dist/index5.js +116 -115
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +375 -63
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +65 -38
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +35 -35
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +35 -82
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +81 -159
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +157 -135
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +149 -29
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +29 -86
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +80 -113
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +114 -56
- package/dist/index59.js.map +1 -1
- package/dist/index6.js +32 -51
- package/dist/index6.js.map +1 -1
- package/dist/index60.js +56 -147
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +146 -312
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +317 -44
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +43 -139
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +140 -12
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +10 -42
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +44 -5
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +18 -8
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +8 -0
- package/dist/index68.js.map +1 -0
- package/dist/index69.js +9 -2
- package/dist/index69.js.map +1 -1
- package/dist/index7.js +47 -81
- package/dist/index7.js.map +1 -1
- package/dist/index71.js +1 -1
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +1 -1
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +2 -2
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +1 -1
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +1 -1
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +1 -1
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +1 -1
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +1 -1
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +1 -1
- package/dist/index79.js.map +1 -1
- package/dist/index8.js +86 -26
- package/dist/index8.js.map +1 -1
- package/dist/index80.js +1 -1
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +1 -1
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +1 -1
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +1 -1
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +1 -1
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +1 -1
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +1 -1
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +1 -1
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +1 -1
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +1 -1
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +23 -59
- package/dist/index9.js.map +1 -1
- package/dist/index90.js +1 -1
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +1 -1
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +1 -1
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +1 -1
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +1 -1
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +2 -2
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +2 -2
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +2 -2
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +2 -2
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +1 -1
- package/dist/index99.js.map +1 -1
- package/package.json +3 -2
- package/dist/index186.js +0 -65
- package/dist/index186.js.map +0 -1
- package/dist/index218.js +0 -7
- package/dist/index218.js.map +0 -1
- package/dist/index220.js +0 -62
- package/dist/index220.js.map +0 -1
- package/dist/index221.js +0 -13
- package/dist/index221.js.map +0 -1
- package/dist/index223.js +0 -8
- package/dist/index223.js.map +0 -1
- package/dist/index70.js +0 -5
- package/dist/index70.js.map +0 -1
package/dist/index18.js
CHANGED
|
@@ -1,14 +1,284 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
1
|
+
import B, { forwardRef as ce, useState as A, useRef as G, useEffect as H, useImperativeHandle as ae } from "react";
|
|
2
|
+
import le from "react-dom";
|
|
3
|
+
import { getA11yNameAttributes as ue } from "./index69.js";
|
|
4
|
+
import { useDismissOnFocusOut as fe } from "./index188.js";
|
|
5
|
+
function F() {
|
|
6
|
+
return F = Object.assign ? Object.assign.bind() : function(g) {
|
|
7
|
+
for (var y = 1; y < arguments.length; y++) {
|
|
8
|
+
var p = arguments[y];
|
|
9
|
+
for (var h in p) ({}).hasOwnProperty.call(p, h) && (g[h] = p[h]);
|
|
10
|
+
}
|
|
11
|
+
return g;
|
|
12
|
+
}, F.apply(null, arguments);
|
|
13
|
+
}
|
|
14
|
+
const ve = /* @__PURE__ */ ce(({
|
|
15
|
+
className: g = "",
|
|
16
|
+
automationId: y = "",
|
|
17
|
+
position: p = "bottom-center",
|
|
18
|
+
popoverContentAutomationId: h = "",
|
|
19
|
+
contentWidth: I = "max",
|
|
20
|
+
renderPopoverContents: O,
|
|
21
|
+
renderPopoverSrcElement: J,
|
|
22
|
+
onPopoverToggle: C,
|
|
23
|
+
isPopoverOpen: N,
|
|
24
|
+
disabled: k = !1,
|
|
25
|
+
isWithPortal: d = !1,
|
|
26
|
+
ariaLabel: Q,
|
|
27
|
+
ariaLabelledBy: W,
|
|
28
|
+
sourceRole: j = "button",
|
|
29
|
+
popoverContentStyleProperty: K = {
|
|
30
|
+
zIndex: 1e3,
|
|
31
|
+
borderColor: "var(--color-gray-200)",
|
|
32
|
+
color: "var(--color-gray-900)",
|
|
33
|
+
backgroundColor: "var(--color-white)"
|
|
34
|
+
},
|
|
35
|
+
disableClickToggle: D = !1,
|
|
36
|
+
noBorder: Y = !1,
|
|
37
|
+
disableAutoClose: m = !1,
|
|
38
|
+
...Z
|
|
39
|
+
}, ee) => {
|
|
40
|
+
const [s, u] = A(!1), [w, z] = A(p), [te, T] = A(!1), l = G(null), a = G(null), oe = ue({
|
|
41
|
+
ariaLabel: Q,
|
|
42
|
+
ariaLabelledBy: W,
|
|
43
|
+
ariaDescribedBy: void 0
|
|
44
|
+
// Popover doesn't support describedBy yet
|
|
45
|
+
}), {
|
|
46
|
+
onBlurCapture: ne
|
|
47
|
+
} = fe({
|
|
48
|
+
disabled: !s || m || d,
|
|
49
|
+
onFocusOut: () => u(!1),
|
|
50
|
+
closeOnEscape: !1
|
|
51
|
+
}), [$, P] = A({
|
|
52
|
+
top: 0,
|
|
53
|
+
left: 0
|
|
54
|
+
}), x = (e = "bottom-center") => {
|
|
55
|
+
if (!l.current) return {
|
|
56
|
+
top: 0,
|
|
57
|
+
left: 0
|
|
58
|
+
};
|
|
59
|
+
let o = e;
|
|
60
|
+
const t = l.current.getBoundingClientRect(), r = window.innerWidth, c = window.innerHeight;
|
|
61
|
+
let n = 0, i = 0;
|
|
62
|
+
switch (o) {
|
|
63
|
+
case "bottom-left":
|
|
64
|
+
n = t.bottom, i = t.left;
|
|
65
|
+
break;
|
|
66
|
+
case "bottom-right":
|
|
67
|
+
n = t.bottom, i = t.right - t.width * 0.5;
|
|
68
|
+
break;
|
|
69
|
+
case "bottom-center":
|
|
70
|
+
n = t.bottom, i = t.left + t.width / 2;
|
|
71
|
+
break;
|
|
72
|
+
case "top-left":
|
|
73
|
+
n = t.top - t.height * 1.9, i = t.left;
|
|
74
|
+
break;
|
|
75
|
+
case "top-right":
|
|
76
|
+
n = t.top - t.height * 1.9, i = t.right - t.width * 0.5;
|
|
77
|
+
break;
|
|
78
|
+
case "top-center":
|
|
79
|
+
n = t.top - t.height * 1.9, i = t.left + t.width / 2;
|
|
80
|
+
break;
|
|
81
|
+
default:
|
|
82
|
+
n = t.bottom, i = t.left;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
const f = a.current?.getBoundingClientRect(), v = f?.width || 0, b = f?.height || 0;
|
|
86
|
+
if ((o === "bottom-center" || o === "top-center") && (i = i - v / 2), i + v > r && (i = Math.max(0, r - v)), i < 0 && (i = 0), n + b > c) {
|
|
87
|
+
const E = t.top, se = c - t.bottom;
|
|
88
|
+
E >= b || E > se ? (n = t.top - b, n < 0 && (n = 0)) : n = Math.max(0, c - b);
|
|
89
|
+
}
|
|
90
|
+
return n < 0 && (n = t.bottom, n + b > c && (n = Math.max(0, c - b))), {
|
|
91
|
+
top: n,
|
|
92
|
+
left: i
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
H(() => {
|
|
96
|
+
if (C && C(s), s && !d)
|
|
97
|
+
return m || document.body.addEventListener("click", q, !0), re(), () => {
|
|
98
|
+
m || document.body.removeEventListener("click", q, !0);
|
|
99
|
+
};
|
|
100
|
+
if (s && d) {
|
|
101
|
+
m ? window.addEventListener("scroll", V) : (document.body.addEventListener("click", S, !0), window.addEventListener("scroll", S)), window.addEventListener("resize", M);
|
|
102
|
+
const e = setTimeout(() => {
|
|
103
|
+
const t = x(w);
|
|
104
|
+
R(), t && P(t);
|
|
105
|
+
}, 0), o = setTimeout(() => {
|
|
106
|
+
const t = x(w);
|
|
107
|
+
t && P(t);
|
|
108
|
+
}, 10);
|
|
109
|
+
return () => {
|
|
110
|
+
m ? window.removeEventListener("scroll", V) : (document.body.removeEventListener("click", S, !0), window.removeEventListener("scroll", S)), window.removeEventListener("resize", M), clearTimeout(e), clearTimeout(o);
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
}, [s, d, m]);
|
|
114
|
+
const R = () => {
|
|
115
|
+
if (!l.current) {
|
|
116
|
+
T(!1);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const e = l.current.getBoundingClientRect(), o = window.innerHeight, t = window.innerWidth, r = e.top < o && e.bottom > 0 && e.left < t && e.right > 0;
|
|
120
|
+
T(r);
|
|
121
|
+
};
|
|
122
|
+
H(() => {
|
|
123
|
+
u(N ?? !1);
|
|
124
|
+
}, [N]), H(() => {
|
|
125
|
+
s && a.current && setTimeout(() => {
|
|
126
|
+
const e = ['[role="menuitem"]', '[role="option"]', '[role="menuitemcheckbox"]', '[role="menuitemradio"]', "button:not([disabled])", "a[href]", '[tabindex]:not([tabindex="-1"])'].join(", "), o = a.current?.querySelector(e);
|
|
127
|
+
o && document.activeElement === l.current && o.focus();
|
|
128
|
+
}, 0);
|
|
129
|
+
}, [s]);
|
|
130
|
+
const re = () => {
|
|
131
|
+
if (!a.current) return;
|
|
132
|
+
const e = a.current.getBoundingClientRect(), o = window.innerHeight;
|
|
133
|
+
e?.bottom > o ? z(p.includes("left") ? "top-left" : p.includes("right") ? "top-right" : "top-center") : e?.top < 0 && z(p.includes("left") ? "bottom-left" : p.includes("right") ? "bottom-right" : "bottom-center");
|
|
134
|
+
}, q = (e) => {
|
|
135
|
+
const o = l.current;
|
|
136
|
+
if (!o) return;
|
|
137
|
+
const t = e.target, r = o.contains(t), c = a.current?.contains(t), i = t.closest?.(".se-design-popover-wrapper"), f = i && i !== o, v = a.current?.contains(i);
|
|
138
|
+
m || (!r && !c || f && !v) && u(!1);
|
|
139
|
+
}, S = (e) => {
|
|
140
|
+
const o = l.current, t = a.current;
|
|
141
|
+
if (!o) return;
|
|
142
|
+
if (R(), e.type === "scroll" && s) {
|
|
143
|
+
const E = x(w);
|
|
144
|
+
E && P(E);
|
|
145
|
+
}
|
|
146
|
+
const r = e.target, c = o.contains(r), n = t?.contains(r), f = r.closest?.(".se-design-popover-wrapper"), v = f && f !== o, b = a.current?.contains(f);
|
|
147
|
+
m || (!c && !n || v && !b) && u(!1);
|
|
148
|
+
}, M = () => {
|
|
149
|
+
if (s && d && l.current) {
|
|
150
|
+
R();
|
|
151
|
+
const e = x(w);
|
|
152
|
+
e && P(e);
|
|
153
|
+
}
|
|
154
|
+
}, V = () => {
|
|
155
|
+
if (s && d && l.current) {
|
|
156
|
+
R();
|
|
157
|
+
const e = x(w);
|
|
158
|
+
e && P(e);
|
|
159
|
+
}
|
|
160
|
+
}, L = () => {
|
|
161
|
+
u((e) => !e);
|
|
162
|
+
}, U = (e, o) => {
|
|
163
|
+
if (!o) return;
|
|
164
|
+
const t = ['[role="menuitem"]', '[role="option"]', '[role="menuitemcheckbox"]', '[role="menuitemradio"]', "button:not([disabled])", "a[href]", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])", '[tabindex]:not([tabindex="-1"])'].join(", "), r = Array.from(o.querySelectorAll(t)).filter((i) => {
|
|
165
|
+
const f = window.getComputedStyle(i);
|
|
166
|
+
return !i.hasAttribute("disabled") && !i.hasAttribute("aria-disabled") && f.display !== "none" && f.visibility !== "hidden" && (i.tabIndex >= 0 || i.hasAttribute("role"));
|
|
167
|
+
});
|
|
168
|
+
if (r.length === 0) return;
|
|
169
|
+
const c = r.findIndex((i) => i === document.activeElement);
|
|
170
|
+
let n = -1;
|
|
171
|
+
e.key === "ArrowDown" ? (e.preventDefault(), e.stopPropagation(), n = c < r.length - 1 ? c + 1 : 0) : e.key === "ArrowUp" ? (e.preventDefault(), e.stopPropagation(), n = c > 0 ? c - 1 : r.length - 1) : e.key === "Home" ? (e.preventDefault(), e.stopPropagation(), n = 0) : e.key === "End" && (e.preventDefault(), e.stopPropagation(), n = r.length - 1), n >= 0 && r[n] ? r[n].focus() : c === -1 && r.length > 0 && r[0].focus();
|
|
172
|
+
}, _ = (e) => {
|
|
173
|
+
e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), u(!1), l.current?.focus()) : e.key === "Tab" ? (u(!1), e.shiftKey && (e.preventDefault(), l.current?.focus())) : e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Home" || e.key === "End" ? U(e, a.current) : (e.key === "Enter" || e.key === " ") && e.stopPropagation();
|
|
174
|
+
};
|
|
175
|
+
ae(ee, () => ({
|
|
176
|
+
togglePopover: L
|
|
177
|
+
}), []);
|
|
178
|
+
const ie = {
|
|
179
|
+
"bottom-left": {
|
|
180
|
+
left: "0",
|
|
181
|
+
top: "100%"
|
|
182
|
+
},
|
|
183
|
+
"bottom-right": {
|
|
184
|
+
right: "0",
|
|
185
|
+
top: "100%"
|
|
186
|
+
},
|
|
187
|
+
"bottom-center": {
|
|
188
|
+
left: "50%",
|
|
189
|
+
transform: "translateX(-50%)",
|
|
190
|
+
top: "100%"
|
|
191
|
+
},
|
|
192
|
+
"top-left": {
|
|
193
|
+
left: "0",
|
|
194
|
+
bottom: "100%"
|
|
195
|
+
},
|
|
196
|
+
"top-right": {
|
|
197
|
+
right: "0",
|
|
198
|
+
bottom: "100%"
|
|
199
|
+
},
|
|
200
|
+
"top-center": {
|
|
201
|
+
left: "50%",
|
|
202
|
+
transform: "translateX(-50%)",
|
|
203
|
+
bottom: "100%"
|
|
204
|
+
}
|
|
205
|
+
}, X = Y ? "" : "shadow-md border rounded-md";
|
|
206
|
+
return /* @__PURE__ */ B.createElement("div", F({
|
|
207
|
+
className: "se-design-popover-wrapper cursor-pointer relative focus-outline rounded-md" + (g.length > 0 ? ` ${g}` : "") + (s ? " open" : "") + (k ? " opacity-50 cursor-not-allowed pointer-events-none" : ""),
|
|
208
|
+
ref: l,
|
|
209
|
+
onClick: (e) => {
|
|
210
|
+
k || D || (e.stopPropagation(), L());
|
|
211
|
+
},
|
|
212
|
+
onKeyDown: (e) => {
|
|
213
|
+
if (!k)
|
|
214
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
215
|
+
e.preventDefault(), e.stopPropagation();
|
|
216
|
+
const o = s;
|
|
217
|
+
L(), o || setTimeout(() => {
|
|
218
|
+
const t = a.current;
|
|
219
|
+
if (t) {
|
|
220
|
+
const r = ['[role="menuitem"]', '[role="option"]', '[role="menuitemcheckbox"]', '[role="menuitemradio"]', "button:not([disabled])", "a[href]", '[tabindex]:not([tabindex="-1"])'].join(", "), c = t.querySelector(r);
|
|
221
|
+
c && c.focus();
|
|
222
|
+
}
|
|
223
|
+
}, 0);
|
|
224
|
+
} else if (e.key === "Escape" && s)
|
|
225
|
+
e.preventDefault(), e.stopPropagation(), u(!1);
|
|
226
|
+
else if ((e.key === "ArrowDown" || e.key === "ArrowUp") && s) {
|
|
227
|
+
const o = a.current;
|
|
228
|
+
o && U(e, o);
|
|
229
|
+
} else e.key === "ArrowDown" && !s && (e.preventDefault(), e.stopPropagation(), u(!0), setTimeout(() => {
|
|
230
|
+
const o = a.current;
|
|
231
|
+
if (o) {
|
|
232
|
+
const t = ['[role="menuitem"]', '[role="option"]', '[role="menuitemcheckbox"]', '[role="menuitemradio"]', "button:not([disabled])", "a[href]", '[tabindex]:not([tabindex="-1"])'].join(", "), r = o.querySelector(t);
|
|
233
|
+
r && r.focus();
|
|
234
|
+
}
|
|
235
|
+
}, 0));
|
|
236
|
+
},
|
|
237
|
+
onBlurCapture: ne,
|
|
238
|
+
onBlur: (e) => {
|
|
239
|
+
if (!s || m || !d) return;
|
|
240
|
+
const o = e.relatedTarget, t = !!(o && l.current?.contains(o)), r = !!(o && a.current?.contains(o));
|
|
241
|
+
!t && !r && u(!1);
|
|
242
|
+
},
|
|
243
|
+
role: j,
|
|
244
|
+
"aria-expanded": D ? void 0 : s ? "true" : "false",
|
|
245
|
+
"aria-haspopup": D ? void 0 : j === "combobox" ? "listbox" : "true",
|
|
246
|
+
tabIndex: k || D ? -1 : 0,
|
|
247
|
+
"aria-disabled": k ? "true" : "false"
|
|
248
|
+
}, oe, {
|
|
249
|
+
"data-automation-id": y
|
|
250
|
+
}, Z), J({
|
|
251
|
+
displayPopover: s,
|
|
252
|
+
togglePopover: L
|
|
253
|
+
}), s && !d && /* @__PURE__ */ B.createElement("div", {
|
|
254
|
+
className: `popover-content absolute ${X} z-[1000] ${I == "full" ? "w-full" : "w-max"}`,
|
|
255
|
+
style: {
|
|
256
|
+
...K,
|
|
257
|
+
...ie[w]
|
|
258
|
+
},
|
|
259
|
+
onClick: (e) => e.stopPropagation(),
|
|
260
|
+
onKeyDown: _,
|
|
261
|
+
ref: a,
|
|
262
|
+
"data-automation-id": h
|
|
263
|
+
}, O({
|
|
264
|
+
closePopoverCb: () => u(!1)
|
|
265
|
+
})), d && s && te && /* @__PURE__ */ le.createPortal(/* @__PURE__ */ B.createElement("div", {
|
|
266
|
+
className: `popover-content-with-portal ${X} ${I == "full" ? "w-full" : "w-max"}`,
|
|
267
|
+
style: {
|
|
268
|
+
position: "fixed",
|
|
269
|
+
top: $.top,
|
|
270
|
+
left: $.left,
|
|
271
|
+
...K
|
|
272
|
+
},
|
|
273
|
+
onClick: (e) => e.stopPropagation(),
|
|
274
|
+
onKeyDown: _,
|
|
275
|
+
ref: a,
|
|
276
|
+
"data-automation-id": h
|
|
277
|
+
}, O({
|
|
278
|
+
closePopoverCb: () => u(!1)
|
|
279
|
+
})), document.body));
|
|
280
|
+
});
|
|
11
281
|
export {
|
|
12
|
-
|
|
282
|
+
ve as Popover
|
|
13
283
|
};
|
|
14
284
|
//# sourceMappingURL=index18.js.map
|
package/dist/index18.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index18.js","sources":["../src/components/Header/index.tsx"],"sourcesContent":["import React, { FC } from 'react';\n\nexport interface HeaderProps {\n leftContainer?: React.ReactNode;\n centerContainer?: React.ReactNode;\n rightContainer?: React.ReactNode;\n type?: string;\n className?: string;\n}\n\nexport const Header: FC<HeaderProps> = ({\n leftContainer,\n centerContainer,\n rightContainer,\n className,\n ...props\n}) => {\n return (\n <header className={`se-design-header ${className} sticky top-0 h-[48px] w-full z-[1010] bg-[var(--color-blue-600)] flex justify-between items-center ${\n props?.type === 'fixed' ? 'fixed left-0 right-0 top-0' : ''\n }`}>\n {leftContainer && <>{leftContainer}</>}\n {centerContainer && <>{centerContainer}</>}\n {rightContainer && <>{rightContainer}</>}\n </header>\n );\n};\n"],"names":["Header","leftContainer","centerContainer","rightContainer","className","props","React","createElement","type","Fragment"],"mappings":";AAUO,MAAMA,IAA0BA,CAAC;AAAA,EACtCC,eAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACA,GAAGC;AACL,MAEIC,gBAAAA,EAAAC,cAAA,UAAA;AAAA,EAAQH,WAAW,oBAAoBA,CAAS,uGAC9CC,GAAOG,SAAS,UAAU,+BAA+B,EAAE;AAAA,GAE1DP,KAAiBK,gBAAAA,EAAAC,cAAAD,EAAAG,UAAA,MAAGR,CAAgB,GACpCC,KAAmBI,gBAAAA,EAAAC,cAAAD,EAAAG,UAAA,MAAGP,CAAkB,GACxCC,KAAkBG,gBAAAA,EAAAC,cAAAD,EAAAG,UAAA,MAAGN,CAAiB,CACjC;"}
|
|
1
|
+
{"version":3,"file":"index18.js","sources":["../src/components/Popover/index.tsx"],"sourcesContent":["import React, { useState, useRef, ReactNode, useEffect, forwardRef, ForwardedRef, useImperativeHandle } from 'react';\nimport ReactDOM from 'react-dom';\nimport { getA11yNameAttributes, useDismissOnFocusOut } from '../../utils/a11y';\n\nexport interface PopoverHandle {\n togglePopover: () => void;\n}\n\nexport interface PopoverProps {\n className?: string;\n automationId?: string;\n popoverContentAutomationId?: string;\n renderPopoverContents: (props: { closePopoverCb: () => void }) => ReactNode;\n renderPopoverSrcElement: (props: { displayPopover: boolean; togglePopover: () => void }) => ReactNode;\n position?: 'bottom-center' | 'bottom-left' | 'bottom-right' | 'top-center' | 'top-left' | 'top-right';\n onPopoverToggle?: (displayPopover: boolean) => void;\n contentWidth?: 'full' | 'max';\n isPopoverOpen?: boolean;\n disabled?: boolean;\n isWithPortal?: boolean;\n noBorder?: boolean;\n ariaLabel?: string;\n ariaLabelledBy?: string;\n sourceRole?: 'button' | 'combobox';\n popoverContentStyleProperty?: React.CSSProperties;\n disableClickToggle?: boolean;\n disableAutoClose?: boolean;\n}\n\nexport const Popover = forwardRef<PopoverHandle, PopoverProps>(\n (\n {\n className = '',\n automationId = '',\n position = 'bottom-center',\n popoverContentAutomationId = '',\n contentWidth = 'max',\n renderPopoverContents,\n renderPopoverSrcElement,\n onPopoverToggle,\n isPopoverOpen,\n disabled = false,\n isWithPortal = false,\n ariaLabel,\n ariaLabelledBy,\n sourceRole = 'button',\n popoverContentStyleProperty = {\n zIndex: 1000,\n borderColor: 'var(--color-gray-200)',\n color: 'var(--color-gray-900)',\n backgroundColor: 'var(--color-white)'\n },\n disableClickToggle = false,\n noBorder = false,\n disableAutoClose = false,\n ...props\n },\n ref: ForwardedRef<PopoverHandle>\n ) => {\n const [displayPopover, setDisplayPopover] = useState(false);\n const [popoverPosition, setPopoverPosition] = useState(position);\n const [isSrcElementVisible, setIsSrcElementVisible] = useState(false);\n const srcElementRef = useRef<HTMLDivElement>(null);\n const popoverContentRef = useRef<HTMLDivElement>(null);\n\n // Compute accessible name/description props with correct precedence\n const accessibleNameProps = getA11yNameAttributes({\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy: undefined // Popover doesn't support describedBy yet\n });\n\n // Use shared focus-out dismissal for non-portal popovers.\n // Portal content lives outside the wrapper, so portal uses a dedicated onBlur fallback below.\n const { onBlurCapture: onDismissBlurCapture } = useDismissOnFocusOut<HTMLDivElement>({\n disabled: !displayPopover || disableAutoClose || isWithPortal,\n onFocusOut: () => setDisplayPopover(false),\n closeOnEscape: false\n });\n\n const [portalPosition, setPortalPosition] = useState({ top: 0, left: 0 });\n\n const calculatePositionOfPopover = (position: string = 'bottom-center') => {\n if (!srcElementRef.current) return { top: 0, left: 0 };\n\n let localPosition = position;\n\n const srcRect = srcElementRef.current.getBoundingClientRect();\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n // Calculate position for portal\n let top = 0;\n let left = 0;\n\n switch (localPosition) {\n case 'bottom-left':\n top = srcRect.bottom;\n left = srcRect.left;\n break;\n case 'bottom-right':\n top = srcRect.bottom;\n left = srcRect.right - srcRect.width * 0.5;\n break;\n case 'bottom-center':\n top = srcRect.bottom;\n // Center the popover relative to the source element\n left = srcRect.left + srcRect.width / 2;\n break;\n case 'top-left':\n top = srcRect.top - srcRect.height * 1.9;\n left = srcRect.left;\n break;\n case 'top-right':\n top = srcRect.top - srcRect.height * 1.9;\n left = srcRect.right - srcRect.width * 0.5;\n break;\n case 'top-center':\n top = srcRect.top - srcRect.height * 1.9;\n // Center the popover relative to the source element\n left = srcRect.left + srcRect.width / 2;\n break;\n default:\n top = srcRect.bottom;\n left = srcRect.left;\n break;\n }\n\n // Get popover dimensions if available\n const popoverRect = popoverContentRef.current?.getBoundingClientRect();\n const popoverWidth = popoverRect?.width || 0;\n const popoverHeight = popoverRect?.height || 0;\n\n // Adjust center positions to account for popover width\n if (localPosition === 'bottom-center' || localPosition === 'top-center') {\n // Center the popover by subtracting half its width from the source center\n left = left - popoverWidth / 2;\n }\n\n // Adjust position to keep popover within viewport bounds\n // Horizontal adjustments\n if (left + popoverWidth > viewportWidth) {\n // Popover extends beyond right edge, shift it left\n left = Math.max(0, viewportWidth - popoverWidth);\n }\n if (left < 0) {\n // Popover extends beyond left edge, shift it right\n left = 0;\n }\n\n // Vertical adjustments\n if (top + popoverHeight > viewportHeight) {\n // Popover extends beyond bottom edge\n // Try to position it above the source element\n const spaceAbove = srcRect.top;\n const spaceBelow = viewportHeight - srcRect.bottom;\n\n if (spaceAbove >= popoverHeight || spaceAbove > spaceBelow) {\n // Position above if there's enough space or more space above\n top = srcRect.top - popoverHeight;\n // Ensure it doesn't go above viewport\n if (top < 0) {\n top = 0;\n }\n } else {\n // Keep at bottom but adjust to fit within viewport\n top = Math.max(0, viewportHeight - popoverHeight);\n }\n }\n if (top < 0) {\n // Popover extends beyond top edge, position it below the source element\n top = srcRect.bottom;\n // Ensure it doesn't go below viewport\n if (top + popoverHeight > viewportHeight) {\n top = Math.max(0, viewportHeight - popoverHeight);\n }\n }\n\n return { top, left };\n };\n\n useEffect(() => {\n if (onPopoverToggle) {\n onPopoverToggle(displayPopover);\n }\n\n if (displayPopover && !isWithPortal) {\n // Add click listener for auto-close behavior only if not disabled\n if (!disableAutoClose) {\n document.body.addEventListener('click', clickListener, true);\n }\n checkPopoverPosition();\n return () => {\n if (!disableAutoClose) {\n document.body.removeEventListener('click', clickListener, true);\n }\n };\n } else if (displayPopover && isWithPortal) {\n // Add click/scroll listeners for auto-close behavior only if not disabled\n if (!disableAutoClose) {\n document.body.addEventListener('click', clickAndScrollListenerWithPortal, true);\n window.addEventListener('scroll', clickAndScrollListenerWithPortal);\n } else {\n // When disableAutoClose is true, still listen to scroll for repositioning\n window.addEventListener('scroll', scrollListenerForRepositioning);\n }\n // Always add resize listener for repositioning\n window.addEventListener('resize', resizeListenerWithPortal);\n\n // Initial position calculation\n const timeout1 = setTimeout(() => {\n const position = calculatePositionOfPopover(popoverPosition);\n checkSourceVisibility();\n\n if (position) {\n setPortalPosition(position);\n }\n }, 0);\n\n // Recalculate after popover is rendered to get accurate dimensions\n const timeout2 = setTimeout(() => {\n const position = calculatePositionOfPopover(popoverPosition);\n if (position) {\n setPortalPosition(position);\n }\n }, 10);\n\n return () => {\n if (!disableAutoClose) {\n document.body.removeEventListener('click', clickAndScrollListenerWithPortal, true);\n window.removeEventListener('scroll', clickAndScrollListenerWithPortal);\n } else {\n window.removeEventListener('scroll', scrollListenerForRepositioning);\n }\n window.removeEventListener('resize', resizeListenerWithPortal);\n clearTimeout(timeout1);\n clearTimeout(timeout2);\n };\n }\n }, [displayPopover, isWithPortal, disableAutoClose]);\n\n const checkSourceVisibility = () => {\n if (!srcElementRef.current) {\n setIsSrcElementVisible(false);\n return;\n }\n\n const rec = srcElementRef.current.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const viewportWidth = window.innerWidth;\n\n const isVisible = rec.top < viewportHeight && rec.bottom > 0 && rec.left < viewportWidth && rec.right > 0;\n\n setIsSrcElementVisible(isVisible);\n };\n\n useEffect(() => {\n setDisplayPopover(isPopoverOpen ?? false);\n }, [isPopoverOpen]);\n\n useEffect(() => {\n // Focus first focusable element when popover opens\n if (displayPopover && popoverContentRef.current) {\n setTimeout(() => {\n const focusableSelectors = [\n '[role=\"menuitem\"]',\n '[role=\"option\"]',\n '[role=\"menuitemcheckbox\"]',\n '[role=\"menuitemradio\"]',\n 'button:not([disabled])',\n 'a[href]',\n '[tabindex]:not([tabindex=\"-1\"])'\n ].join(', ');\n const firstFocusable = popoverContentRef.current?.querySelector<HTMLElement>(focusableSelectors);\n if (firstFocusable && document.activeElement === srcElementRef.current) {\n firstFocusable.focus();\n }\n }, 0);\n }\n }, [displayPopover]);\n\n //Function to check popover position\n const checkPopoverPosition = () => {\n if (!popoverContentRef.current) return;\n\n const popoverRect = popoverContentRef.current.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n\n if (popoverRect?.bottom > viewportHeight) {\n setPopoverPosition(\n position.includes('left') ? 'top-left' : position.includes('right') ? 'top-right' : 'top-center'\n );\n } else if (popoverRect?.top < 0) {\n // If popover extends beyond top of viewport, switch to bottom position\n setPopoverPosition(\n position.includes('left') ? 'bottom-left' : position.includes('right') ? 'bottom-right' : 'bottom-center'\n );\n }\n };\n\n const clickListener = (event: MouseEvent) => {\n const currentDropRef = srcElementRef.current;\n if (!currentDropRef) return;\n\n const target = event.target as Node;\n const isSourcePopover = currentDropRef.contains(target);\n const isPopoverContent = popoverContentRef.current?.contains(target);\n\n // Check if click is on another popover's source element\n const clickedElement = target as HTMLElement;\n const closestPopoverWrapper = clickedElement.closest?.('.se-design-popover-wrapper');\n const isAnotherPopoverSource = closestPopoverWrapper && closestPopoverWrapper !== currentDropRef;\n\n // check if the clicked popover is a nesteded child of the current popover content\n const isNestedPopover = popoverContentRef.current?.contains(closestPopoverWrapper as Node);\n\n // if clicked source is parent or the popover-content, do not toggle dropdown.\n // Also close if clicking on another popover's source element\n if (disableAutoClose) return;\n if ((!isSourcePopover && !isPopoverContent) || (isAnotherPopoverSource && !isNestedPopover)) {\n setDisplayPopover(false);\n }\n };\n\n const clickAndScrollListenerWithPortal = (event: Event) => {\n const currentDropRef = srcElementRef.current;\n const currentPopoverRef = popoverContentRef.current;\n if (!currentDropRef) return;\n checkSourceVisibility();\n\n // Recalculate position on scroll\n if (event.type === 'scroll' && displayPopover) {\n const position = calculatePositionOfPopover(popoverPosition);\n if (position) {\n setPortalPosition(position);\n }\n }\n\n const target = event.target as Node;\n const isSourcePopover = currentDropRef.contains(target);\n const isPopoverContent = currentPopoverRef?.contains(target);\n\n // Check if click is on another popover's source element\n const clickedElement = target as HTMLElement;\n const closestPopoverWrapper = clickedElement.closest?.('.se-design-popover-wrapper');\n const isAnotherPopoverSource = closestPopoverWrapper && closestPopoverWrapper !== currentDropRef;\n\n // check if the clicked popover is a nesteded child of the current popover content\n const isNestedPopover = popoverContentRef.current?.contains(closestPopoverWrapper as Node);\n\n if (disableAutoClose) return;\n // if clicked source is parent or the popover-content, do not toggle dropdown.\n // Also close if clicking on another popover's source element\n if ((!isSourcePopover && !isPopoverContent) || (isAnotherPopoverSource && !isNestedPopover)) {\n setDisplayPopover(false);\n }\n };\n\n const resizeListenerWithPortal = () => {\n if (displayPopover && isWithPortal && srcElementRef.current) {\n checkSourceVisibility();\n const position = calculatePositionOfPopover(popoverPosition);\n if (position) {\n setPortalPosition(position);\n }\n }\n };\n\n const scrollListenerForRepositioning = () => {\n if (displayPopover && isWithPortal && srcElementRef.current) {\n checkSourceVisibility();\n const position = calculatePositionOfPopover(popoverPosition);\n if (position) {\n setPortalPosition(position);\n }\n }\n };\n\n const togglePopover = () => {\n setDisplayPopover((displayPopover) => !displayPopover);\n };\n\n const handleArrowKeyNavigation = (e: React.KeyboardEvent, container: HTMLDivElement | null) => {\n if (!container) return;\n\n // Find all focusable elements within the popover content\n // This includes elements with role=\"menuitem\", role=\"option\", tabIndex >= 0, etc.\n const focusableSelectors = [\n '[role=\"menuitem\"]',\n '[role=\"option\"]',\n '[role=\"menuitemcheckbox\"]',\n '[role=\"menuitemradio\"]',\n 'button:not([disabled])',\n 'a[href]',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])'\n ].join(', ');\n\n const focusableElements = Array.from(container.querySelectorAll<HTMLElement>(focusableSelectors)).filter((el) => {\n // Filter out disabled and hidden elements\n const style = window.getComputedStyle(el);\n return (\n !el.hasAttribute('disabled') &&\n !el.hasAttribute('aria-disabled') &&\n style.display !== 'none' &&\n style.visibility !== 'hidden' &&\n (el.tabIndex >= 0 || el.hasAttribute('role'))\n );\n });\n\n if (focusableElements.length === 0) return;\n\n const currentIndex = focusableElements.findIndex((el) => el === document.activeElement);\n let nextIndex = -1;\n\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n e.stopPropagation();\n nextIndex = currentIndex < focusableElements.length - 1 ? currentIndex + 1 : 0;\n } else if (e.key === 'ArrowUp') {\n e.preventDefault();\n e.stopPropagation();\n nextIndex = currentIndex > 0 ? currentIndex - 1 : focusableElements.length - 1;\n } else if (e.key === 'Home') {\n e.preventDefault();\n e.stopPropagation();\n nextIndex = 0;\n } else if (e.key === 'End') {\n e.preventDefault();\n e.stopPropagation();\n nextIndex = focusableElements.length - 1;\n }\n\n if (nextIndex >= 0 && focusableElements[nextIndex]) {\n focusableElements[nextIndex].focus();\n } else if (currentIndex === -1 && focusableElements.length > 0) {\n // If no element is currently focused, focus the first one\n focusableElements[0].focus();\n }\n };\n\n const handlePopoverContentKeyDown = (e: React.KeyboardEvent) => {\n // Allow Escape key to close popover when focus is on content\n if (e.key === 'Escape') {\n e.preventDefault();\n e.stopPropagation();\n setDisplayPopover(false);\n srcElementRef.current?.focus();\n } else if (e.key === 'Tab') {\n // Close popover when Tab exits the menu\n setDisplayPopover(false);\n if (e.shiftKey) {\n // Shift+Tab: prevent default (would go to wrapper) and focus trigger instead\n e.preventDefault();\n srcElementRef.current?.focus();\n }\n // Forward Tab: do NOT preventDefault — browser moves focus to next element naturally\n } else if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Home' || e.key === 'End') {\n // Handle arrow key navigation for focusable elements inside popover\n handleArrowKeyNavigation(e, popoverContentRef.current);\n } else if (e.key === 'Enter' || e.key === ' ') {\n // Prevent Enter/Space from bubbling to wrapper (mirrors click stopPropagation)\n e.stopPropagation();\n }\n };\n\n useImperativeHandle(ref, () => ({ togglePopover }), []);\n\n const popoverContentStyle = {\n 'bottom-left': { left: '0', top: '100%' },\n 'bottom-right': { right: '0', top: '100%' },\n 'bottom-center': { left: '50%', transform: 'translateX(-50%)', top: '100%' },\n 'top-left': { left: '0', bottom: '100%' },\n 'top-right': { right: '0', bottom: '100%' },\n 'top-center': { left: '50%', transform: 'translateX(-50%)', bottom: '100%' }\n };\n const popoverContentClasses = noBorder ? '' : 'shadow-md border rounded-md';\n\n return (\n <div\n className={\n 'se-design-popover-wrapper cursor-pointer relative focus-outline rounded-md' +\n (className.length > 0 ? ` ${className}` : '') +\n (displayPopover ? ' open' : '') +\n (disabled ? ' opacity-50 cursor-not-allowed pointer-events-none' : '')\n }\n ref={srcElementRef}\n onClick={(e) => {\n if (disabled || disableClickToggle) return;\n e.stopPropagation();\n togglePopover();\n }}\n onKeyDown={(e) => {\n if (disabled) return;\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n const wasOpen = displayPopover;\n togglePopover();\n // Focus first focusable element when opening\n if (!wasOpen) {\n setTimeout(() => {\n const currentRef = popoverContentRef.current;\n if (currentRef) {\n const focusableSelectors = [\n '[role=\"menuitem\"]',\n '[role=\"option\"]',\n '[role=\"menuitemcheckbox\"]',\n '[role=\"menuitemradio\"]',\n 'button:not([disabled])',\n 'a[href]',\n '[tabindex]:not([tabindex=\"-1\"])'\n ].join(', ');\n const firstFocusable = currentRef.querySelector<HTMLElement>(focusableSelectors);\n if (firstFocusable) {\n firstFocusable.focus();\n }\n }\n }, 0);\n }\n } else if (e.key === 'Escape' && displayPopover) {\n e.preventDefault();\n e.stopPropagation();\n setDisplayPopover(false);\n } else if ((e.key === 'ArrowDown' || e.key === 'ArrowUp') && displayPopover) {\n // Handle arrow keys when popover is open\n const currentRef = popoverContentRef.current;\n if (currentRef) {\n handleArrowKeyNavigation(e, currentRef);\n }\n } else if (e.key === 'ArrowDown' && !displayPopover) {\n // Open popover and focus first item when ArrowDown is pressed\n e.preventDefault();\n e.stopPropagation();\n setDisplayPopover(true);\n setTimeout(() => {\n const currentRef = popoverContentRef.current;\n if (currentRef) {\n const focusableSelectors = [\n '[role=\"menuitem\"]',\n '[role=\"option\"]',\n '[role=\"menuitemcheckbox\"]',\n '[role=\"menuitemradio\"]',\n 'button:not([disabled])',\n 'a[href]',\n '[tabindex]:not([tabindex=\"-1\"])'\n ].join(', ');\n const firstFocusable = currentRef.querySelector<HTMLElement>(focusableSelectors);\n if (firstFocusable) {\n firstFocusable.focus();\n }\n }\n }, 0);\n }\n }}\n onBlurCapture={onDismissBlurCapture}\n onBlur={(e) => {\n // Portal content is rendered outside wrapper, so keep explicit check for that case.\n if (!displayPopover || disableAutoClose || !isWithPortal) return;\n\n const nextFocused = e.relatedTarget as Node | null;\n const isFocusInSource = !!(nextFocused && srcElementRef.current?.contains(nextFocused));\n const isFocusInPopover = !!(nextFocused && popoverContentRef.current?.contains(nextFocused));\n\n // Close only when focus leaves both source and portal content.\n if (!isFocusInSource && !isFocusInPopover) {\n setDisplayPopover(false);\n }\n }}\n role={sourceRole}\n aria-expanded={disableClickToggle ? undefined : displayPopover ? 'true' : 'false'}\n aria-haspopup={disableClickToggle ? undefined : sourceRole === 'combobox' ? 'listbox' : 'true'}\n tabIndex={disabled || disableClickToggle ? -1 : 0}\n aria-disabled={disabled ? 'true' : 'false'}\n {...accessibleNameProps}\n data-automation-id={automationId}\n {...props}\n >\n {renderPopoverSrcElement({ displayPopover, togglePopover })}\n\n {displayPopover && !isWithPortal && (\n <div\n className={`popover-content absolute ${popoverContentClasses} z-[1000] ${\n contentWidth == 'full' ? 'w-full' : 'w-max'\n }`}\n style={{\n ...popoverContentStyleProperty,\n ...popoverContentStyle[popoverPosition]\n }}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={handlePopoverContentKeyDown}\n ref={popoverContentRef}\n data-automation-id={popoverContentAutomationId}\n >\n {renderPopoverContents({ closePopoverCb: () => setDisplayPopover(false) })}\n </div>\n )}\n {isWithPortal &&\n displayPopover &&\n isSrcElementVisible &&\n ReactDOM.createPortal(\n <div\n className={`popover-content-with-portal ${popoverContentClasses} ${\n contentWidth == 'full' ? 'w-full' : 'w-max'\n }`}\n style={{\n position: 'fixed',\n top: portalPosition.top,\n left: portalPosition.left,\n ...popoverContentStyleProperty\n }}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={handlePopoverContentKeyDown}\n ref={popoverContentRef}\n data-automation-id={popoverContentAutomationId}\n >\n {renderPopoverContents({ closePopoverCb: () => setDisplayPopover(false) })}\n </div>,\n document.body\n )}\n </div>\n );\n }\n);\n"],"names":["Popover","className","automationId","position","popoverContentAutomationId","contentWidth","renderPopoverContents","renderPopoverSrcElement","onPopoverToggle","isPopoverOpen","disabled","isWithPortal","ariaLabel","ariaLabelledBy","sourceRole","popoverContentStyleProperty","zIndex","borderColor","color","backgroundColor","disableClickToggle","noBorder","disableAutoClose","props","ref","displayPopover","setDisplayPopover","useState","popoverPosition","setPopoverPosition","isSrcElementVisible","setIsSrcElementVisible","srcElementRef","useRef","popoverContentRef","accessibleNameProps","getA11yNameAttributes","ariaDescribedBy","undefined","onBlurCapture","onDismissBlurCapture","useDismissOnFocusOut","onFocusOut","closeOnEscape","portalPosition","setPortalPosition","top","left","calculatePositionOfPopover","current","localPosition","srcRect","getBoundingClientRect","viewportWidth","window","innerWidth","viewportHeight","innerHeight","bottom","right","width","height","popoverRect","popoverWidth","popoverHeight","Math","max","spaceAbove","spaceBelow","useEffect","document","body","addEventListener","clickListener","checkPopoverPosition","removeEventListener","scrollListenerForRepositioning","clickAndScrollListenerWithPortal","resizeListenerWithPortal","timeout1","setTimeout","checkSourceVisibility","timeout2","clearTimeout","rec","isVisible","focusableSelectors","join","firstFocusable","querySelector","activeElement","focus","includes","event","currentDropRef","target","isSourcePopover","contains","isPopoverContent","closestPopoverWrapper","closest","isAnotherPopoverSource","isNestedPopover","currentPopoverRef","type","togglePopover","handleArrowKeyNavigation","e","container","focusableElements","Array","from","querySelectorAll","filter","el","style","getComputedStyle","hasAttribute","display","visibility","tabIndex","length","currentIndex","findIndex","nextIndex","key","preventDefault","stopPropagation","handlePopoverContentKeyDown","shiftKey","useImperativeHandle","popoverContentStyle","transform","popoverContentClasses","React","createElement","_extends","onClick","onKeyDown","wasOpen","currentRef","onBlur","nextFocused","relatedTarget","isFocusInSource","isFocusInPopover","role","closePopoverCb","ReactDOM","createPortal"],"mappings":";;;;;;;;;;;;;AA6BO,MAAMA,wBACX,CACE;AAAA,EACEC,WAAAA,IAAY;AAAA,EACZC,cAAAA,IAAe;AAAA,EACfC,UAAAA,IAAW;AAAA,EACXC,4BAAAA,IAA6B;AAAA,EAC7BC,cAAAA,IAAe;AAAA,EACfC,uBAAAA;AAAAA,EACAC,yBAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACAC,eAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,cAAAA,IAAe;AAAA,EACfC,WAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,YAAAA,IAAa;AAAA,EACbC,6BAAAA,IAA8B;AAAA,IAC5BC,QAAQ;AAAA,IACRC,aAAa;AAAA,IACbC,OAAO;AAAA,IACPC,iBAAiB;AAAA,EAAA;AAAA,EAEnBC,oBAAAA,IAAqB;AAAA,EACrBC,UAAAA,IAAW;AAAA,EACXC,kBAAAA,IAAmB;AAAA,EACnB,GAAGC;AACL,GACAC,OACG;AACH,QAAM,CAACC,GAAgBC,CAAiB,IAAIC,EAAS,EAAK,GACpD,CAACC,GAAiBC,CAAkB,IAAIF,EAASxB,CAAQ,GACzD,CAAC2B,IAAqBC,CAAsB,IAAIJ,EAAS,EAAK,GAC9DK,IAAgBC,EAAuB,IAAI,GAC3CC,IAAoBD,EAAuB,IAAI,GAG/CE,KAAsBC,GAAsB;AAAA,IAChDxB,WAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAwB,iBAAiBC;AAAAA;AAAAA,EAAAA,CAClB,GAIK;AAAA,IAAEC,eAAeC;AAA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ACL4C,SAASC,IACX,CACC;AAET,CACF;"}
|
package/dist/index180.js
CHANGED
|
@@ -1,152 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import R from "./index222.js";
|
|
3
|
-
import D from "./index223.js";
|
|
4
|
-
import { SVGInjector as A } from "./index224.js";
|
|
5
|
-
import { p as t } from "./index225.js";
|
|
6
|
-
import * as h from "react";
|
|
7
|
-
var O = function(s) {
|
|
8
|
-
var o = s?.ownerDocument || document;
|
|
9
|
-
return o.defaultView || window;
|
|
10
|
-
}, U = function(s, o) {
|
|
11
|
-
for (var r in s)
|
|
12
|
-
if (!(r in o))
|
|
13
|
-
return !0;
|
|
14
|
-
for (var e in o)
|
|
15
|
-
if (s[e] !== o[e])
|
|
16
|
-
return !0;
|
|
17
|
-
return !1;
|
|
18
|
-
}, H = ["afterInjection", "beforeInjection", "desc", "evalScripts", "fallback", "httpRequestWithCredentials", "loading", "renumerateIRIElements", "src", "title", "useRequestCache", "wrapper"], v = "http://www.w3.org/2000/svg", q = "http://www.w3.org/1999/xlink", V = /* @__PURE__ */ function(c) {
|
|
19
|
-
function s() {
|
|
20
|
-
for (var r, e = arguments.length, n = new Array(e), a = 0; a < e; a++)
|
|
21
|
-
n[a] = arguments[a];
|
|
22
|
-
return r = c.call.apply(c, [this].concat(n)) || this, r.initialState = {
|
|
23
|
-
hasError: !1,
|
|
24
|
-
isLoading: !0
|
|
25
|
-
}, r.state = r.initialState, r._isMounted = !1, r.reactWrapper = void 0, r.nonReactWrapper = void 0, r.refCallback = function(u) {
|
|
26
|
-
r.reactWrapper = u;
|
|
27
|
-
}, r;
|
|
28
|
-
}
|
|
29
|
-
D(s, c);
|
|
30
|
-
var o = s.prototype;
|
|
31
|
-
return o.renderSVG = function() {
|
|
32
|
-
var e = this;
|
|
33
|
-
if (this.reactWrapper instanceof O(this.reactWrapper).Node) {
|
|
34
|
-
var n = this.props, a = n.desc, u = n.evalScripts, S = n.httpRequestWithCredentials, E = n.renumerateIRIElements, G = n.src, b = n.title, g = n.useRequestCache, w = this.props.onError, x = this.props.beforeInjection, y = this.props.afterInjection, f = this.props.wrapper, l, p;
|
|
35
|
-
f === "svg" ? (l = document.createElementNS(v, f), l.setAttribute("xmlns", v), l.setAttribute("xmlns:xlink", q), p = document.createElementNS(v, f)) : (l = document.createElement(f), p = document.createElement(f)), l.appendChild(p), p.dataset.src = G, this.nonReactWrapper = this.reactWrapper.appendChild(l);
|
|
36
|
-
var I = function(i) {
|
|
37
|
-
if (e.removeSVG(), !e._isMounted) {
|
|
38
|
-
w(i);
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
e.setState(function() {
|
|
42
|
-
return {
|
|
43
|
-
hasError: !0,
|
|
44
|
-
isLoading: !1
|
|
45
|
-
};
|
|
46
|
-
}, function() {
|
|
47
|
-
w(i);
|
|
48
|
-
});
|
|
49
|
-
}, L = function(i, d) {
|
|
50
|
-
if (i) {
|
|
51
|
-
I(i);
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
e._isMounted && e.setState(function() {
|
|
55
|
-
return {
|
|
56
|
-
isLoading: !1
|
|
57
|
-
};
|
|
58
|
-
}, function() {
|
|
59
|
-
try {
|
|
60
|
-
y(d);
|
|
61
|
-
} catch (m) {
|
|
62
|
-
I(m);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}, M = function(i) {
|
|
66
|
-
if (i.setAttribute("role", "img"), a) {
|
|
67
|
-
var d = i.querySelector(":scope > desc");
|
|
68
|
-
d && i.removeChild(d);
|
|
69
|
-
var m = document.createElement("desc");
|
|
70
|
-
m.innerHTML = a, i.prepend(m);
|
|
71
|
-
}
|
|
72
|
-
if (b) {
|
|
73
|
-
var j = i.querySelector(":scope > title");
|
|
74
|
-
j && i.removeChild(j);
|
|
75
|
-
var C = document.createElement("title");
|
|
76
|
-
C.innerHTML = b, i.prepend(C);
|
|
77
|
-
}
|
|
78
|
-
try {
|
|
79
|
-
x(i);
|
|
80
|
-
} catch (k) {
|
|
81
|
-
I(k);
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
A(p, {
|
|
85
|
-
afterEach: L,
|
|
86
|
-
beforeEach: M,
|
|
87
|
-
cacheRequests: g,
|
|
88
|
-
evalScripts: u,
|
|
89
|
-
httpRequestWithCredentials: S,
|
|
90
|
-
renumerateIRIElements: E
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
}, o.removeSVG = function() {
|
|
94
|
-
var e;
|
|
95
|
-
(e = this.nonReactWrapper) != null && e.parentNode && (this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper), this.nonReactWrapper = null);
|
|
96
|
-
}, o.componentDidMount = function() {
|
|
97
|
-
this._isMounted = !0, this.renderSVG();
|
|
98
|
-
}, o.componentDidUpdate = function(e) {
|
|
99
|
-
var n = this;
|
|
100
|
-
U(R({}, e), this.props) && this.setState(function() {
|
|
101
|
-
return n.initialState;
|
|
102
|
-
}, function() {
|
|
103
|
-
n.removeSVG(), n.renderSVG();
|
|
104
|
-
});
|
|
105
|
-
}, o.componentWillUnmount = function() {
|
|
106
|
-
this._isMounted = !1, this.removeSVG();
|
|
107
|
-
}, o.render = function() {
|
|
108
|
-
var e = this.props, n = e.fallback, a = e.loading, u = e.wrapper, S = N(e, H), E = u;
|
|
109
|
-
return /* @__PURE__ */ h.createElement(E, R({}, S, {
|
|
110
|
-
ref: this.refCallback
|
|
111
|
-
}, u === "svg" ? {
|
|
112
|
-
xmlns: v,
|
|
113
|
-
xmlnsXlink: q
|
|
114
|
-
} : {}), this.state.isLoading && a && /* @__PURE__ */ h.createElement(a, null), this.state.hasError && n && /* @__PURE__ */ h.createElement(n, null));
|
|
115
|
-
}, s;
|
|
116
|
-
}(h.Component);
|
|
117
|
-
V.defaultProps = {
|
|
118
|
-
afterInjection: function() {
|
|
119
|
-
},
|
|
120
|
-
beforeInjection: function() {
|
|
121
|
-
},
|
|
122
|
-
desc: "",
|
|
123
|
-
evalScripts: "never",
|
|
124
|
-
fallback: null,
|
|
125
|
-
httpRequestWithCredentials: !1,
|
|
126
|
-
loading: null,
|
|
127
|
-
onError: function() {
|
|
128
|
-
},
|
|
129
|
-
renumerateIRIElements: !0,
|
|
130
|
-
title: "",
|
|
131
|
-
useRequestCache: !0,
|
|
132
|
-
wrapper: "div"
|
|
133
|
-
};
|
|
134
|
-
V.propTypes = {
|
|
135
|
-
afterInjection: t.func,
|
|
136
|
-
beforeInjection: t.func,
|
|
137
|
-
desc: t.string,
|
|
138
|
-
evalScripts: t.oneOf(["always", "once", "never"]),
|
|
139
|
-
fallback: t.oneOfType([t.func, t.object, t.string]),
|
|
140
|
-
httpRequestWithCredentials: t.bool,
|
|
141
|
-
loading: t.oneOfType([t.func, t.object, t.string]),
|
|
142
|
-
onError: t.func,
|
|
143
|
-
renumerateIRIElements: t.bool,
|
|
144
|
-
src: t.string.isRequired,
|
|
145
|
-
title: t.string,
|
|
146
|
-
useRequestCache: t.bool,
|
|
147
|
-
wrapper: t.oneOf(["div", "span", "svg"])
|
|
148
|
-
};
|
|
1
|
+
const e = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.545%205.45508L5.4541%2014.546'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5.4541%205.45508L14.545%2014.546'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";
|
|
149
2
|
export {
|
|
150
|
-
|
|
3
|
+
e as default
|
|
151
4
|
};
|
|
152
5
|
//# sourceMappingURL=index180.js.map
|
package/dist/index180.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index180.js","sources":["../node_modules/react-svg/dist/react-svg.esm.js"],"sourcesContent":["import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/objectWithoutPropertiesLoose';\nimport _extends from '@babel/runtime/helpers/extends';\nimport _inheritsLoose from '@babel/runtime/helpers/inheritsLoose';\nimport { SVGInjector } from '@tanem/svg-injector';\nimport * as PropTypes from 'prop-types';\nimport * as React from 'react';\n\n// Hat-tip: https://github.com/mui/material-ui/tree/master/packages/mui-utils/src.\nvar ownerWindow = function ownerWindow(node) {\n var doc = (node == null ? undefined : node.ownerDocument) || document;\n return doc.defaultView || window;\n};\n\n// Hat-tip: https://github.com/developit/preact-compat/blob/master/src/index.js#L402.\nvar shallowDiffers = function shallowDiffers(a, b) {\n for (var i in a) {\n if (!(i in b)) {\n return true;\n }\n }\n for (var _i in b) {\n if (a[_i] !== b[_i]) {\n return true;\n }\n }\n return false;\n};\n\nvar _excluded = [\"afterInjection\", \"beforeInjection\", \"desc\", \"evalScripts\", \"fallback\", \"httpRequestWithCredentials\", \"loading\", \"renumerateIRIElements\", \"src\", \"title\", \"useRequestCache\", \"wrapper\"];\nvar svgNamespace = 'http://www.w3.org/2000/svg';\nvar xlinkNamespace = 'http://www.w3.org/1999/xlink';\nvar ReactSVG = /*#__PURE__*/function (_React$Component) {\n function ReactSVG() {\n var _this;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.initialState = {\n hasError: false,\n isLoading: true\n };\n _this.state = _this.initialState;\n _this._isMounted = false;\n _this.reactWrapper = undefined;\n _this.nonReactWrapper = undefined;\n _this.refCallback = function (reactWrapper) {\n _this.reactWrapper = reactWrapper;\n };\n return _this;\n }\n _inheritsLoose(ReactSVG, _React$Component);\n var _proto = ReactSVG.prototype;\n _proto.renderSVG = function renderSVG() {\n var _this2 = this;\n /* istanbul ignore else */\n if (this.reactWrapper instanceof ownerWindow(this.reactWrapper).Node) {\n var _this$props = this.props,\n desc = _this$props.desc,\n evalScripts = _this$props.evalScripts,\n httpRequestWithCredentials = _this$props.httpRequestWithCredentials,\n renumerateIRIElements = _this$props.renumerateIRIElements,\n src = _this$props.src,\n title = _this$props.title,\n useRequestCache = _this$props.useRequestCache;\n /* eslint-disable @typescript-eslint/no-non-null-assertion */\n var onError = this.props.onError;\n var beforeInjection = this.props.beforeInjection;\n var afterInjection = this.props.afterInjection;\n var wrapper = this.props.wrapper;\n var nonReactWrapper;\n var nonReactTarget;\n if (wrapper === 'svg') {\n nonReactWrapper = document.createElementNS(svgNamespace, wrapper);\n nonReactWrapper.setAttribute('xmlns', svgNamespace);\n nonReactWrapper.setAttribute('xmlns:xlink', xlinkNamespace);\n nonReactTarget = document.createElementNS(svgNamespace, wrapper);\n } else {\n nonReactWrapper = document.createElement(wrapper);\n nonReactTarget = document.createElement(wrapper);\n }\n nonReactWrapper.appendChild(nonReactTarget);\n nonReactTarget.dataset.src = src;\n this.nonReactWrapper = this.reactWrapper.appendChild(nonReactWrapper);\n var handleError = function handleError(error) {\n _this2.removeSVG();\n if (!_this2._isMounted) {\n onError(error);\n return;\n }\n _this2.setState(function () {\n return {\n hasError: true,\n isLoading: false\n };\n }, function () {\n onError(error);\n });\n };\n var afterEach = function afterEach(error, svg) {\n if (error) {\n handleError(error);\n return;\n }\n // TODO (Tane): It'd be better to cleanly unsubscribe from SVGInjector\n // callbacks instead of tracking a property like this.\n if (_this2._isMounted) {\n _this2.setState(function () {\n return {\n isLoading: false\n };\n }, function () {\n try {\n afterInjection(svg);\n } catch (afterInjectionError) {\n handleError(afterInjectionError);\n }\n });\n }\n };\n var beforeEach = function beforeEach(svg) {\n svg.setAttribute('role', 'img');\n if (desc) {\n var originalDesc = svg.querySelector(':scope > desc');\n if (originalDesc) {\n svg.removeChild(originalDesc);\n }\n var newDesc = document.createElement('desc');\n newDesc.innerHTML = desc;\n svg.prepend(newDesc);\n }\n if (title) {\n var originalTitle = svg.querySelector(':scope > title');\n if (originalTitle) {\n svg.removeChild(originalTitle);\n }\n var newTitle = document.createElement('title');\n newTitle.innerHTML = title;\n svg.prepend(newTitle);\n }\n try {\n beforeInjection(svg);\n } catch (error) {\n handleError(error);\n }\n };\n SVGInjector(nonReactTarget, {\n afterEach: afterEach,\n beforeEach: beforeEach,\n cacheRequests: useRequestCache,\n evalScripts: evalScripts,\n httpRequestWithCredentials: httpRequestWithCredentials,\n renumerateIRIElements: renumerateIRIElements\n });\n }\n };\n _proto.removeSVG = function removeSVG() {\n var _this$nonReactWrapper;\n if ((_this$nonReactWrapper = this.nonReactWrapper) != null && _this$nonReactWrapper.parentNode) {\n this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper);\n this.nonReactWrapper = null;\n }\n };\n _proto.componentDidMount = function componentDidMount() {\n this._isMounted = true;\n this.renderSVG();\n };\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var _this3 = this;\n if (shallowDiffers(_extends({}, prevProps), this.props)) {\n this.setState(function () {\n return _this3.initialState;\n }, function () {\n _this3.removeSVG();\n _this3.renderSVG();\n });\n }\n };\n _proto.componentWillUnmount = function componentWillUnmount() {\n this._isMounted = false;\n this.removeSVG();\n };\n _proto.render = function render() {\n /* eslint-disable @typescript-eslint/no-unused-vars */\n var _this$props2 = this.props;\n _this$props2.afterInjection;\n _this$props2.beforeInjection;\n _this$props2.desc;\n _this$props2.evalScripts;\n var Fallback = _this$props2.fallback;\n _this$props2.httpRequestWithCredentials;\n var Loading = _this$props2.loading;\n _this$props2.renumerateIRIElements;\n _this$props2.src;\n _this$props2.title;\n _this$props2.useRequestCache;\n var wrapper = _this$props2.wrapper,\n rest = _objectWithoutPropertiesLoose(_this$props2, _excluded);\n /* eslint-enable @typescript-eslint/no-unused-vars */\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n var Wrapper = wrapper;\n return /*#__PURE__*/React.createElement(Wrapper, _extends({}, rest, {\n ref: this.refCallback\n }, wrapper === 'svg' ? {\n xmlns: svgNamespace,\n xmlnsXlink: xlinkNamespace\n } : {}), this.state.isLoading && Loading && /*#__PURE__*/React.createElement(Loading, null), this.state.hasError && Fallback && /*#__PURE__*/React.createElement(Fallback, null));\n };\n return ReactSVG;\n}(React.Component);\nReactSVG.defaultProps = {\n afterInjection: function afterInjection() {\n return undefined;\n },\n beforeInjection: function beforeInjection() {\n return undefined;\n },\n desc: '',\n evalScripts: 'never',\n fallback: null,\n httpRequestWithCredentials: false,\n loading: null,\n onError: function onError() {\n return undefined;\n },\n renumerateIRIElements: true,\n title: '',\n useRequestCache: true,\n wrapper: 'div'\n};\nReactSVG.propTypes = {\n afterInjection: PropTypes.func,\n beforeInjection: PropTypes.func,\n desc: PropTypes.string,\n evalScripts: PropTypes.oneOf(['always', 'once', 'never']),\n fallback: PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.string]),\n httpRequestWithCredentials: PropTypes.bool,\n loading: PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.string]),\n onError: PropTypes.func,\n renumerateIRIElements: PropTypes.bool,\n src: PropTypes.string.isRequired,\n title: PropTypes.string,\n useRequestCache: PropTypes.bool,\n wrapper: PropTypes.oneOf(['div', 'span', 'svg'])\n} ;\n\nexport { ReactSVG };\n//# sourceMappingURL=react-svg.esm.js.map\n"],"names":["_objectWithoutPropertiesLoose","_extends","_inheritsLoose","SVGInjector","propTypesExports","React","ownerWindow","node","doc","shallowDiffers","a","b","i","_i","_excluded","svgNamespace","xlinkNamespace","ReactSVG","_React$Component","_this","_len","args","_key","reactWrapper","_proto","_this2","_this$props","desc","evalScripts","httpRequestWithCredentials","renumerateIRIElements","src","title","useRequestCache","onError","beforeInjection","afterInjection","wrapper","nonReactWrapper","nonReactTarget","handleError","error","afterEach","svg","afterInjectionError","beforeEach","originalDesc","newDesc","originalTitle","newTitle","_this$nonReactWrapper","prevProps","_this3","_this$props2","Fallback","Loading","rest","Wrapper","PropTypes.func","PropTypes.string","PropTypes.oneOf","PropTypes.oneOfType","PropTypes.object","PropTypes.bool"],"mappings":"AAOA,OAAAA,OAAA;AAAA,OAAAC,OAAA;AAAA,OAAAC,OAAA;AAAA,SAAA,eAAAC,SAAA;AAAA,SAAA,KAAA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F,4BAA4BI,EAAAA;AAAAA,EAC5B,SAASF,EAAAA,UAAoB,CAACH,EAAAA,MAAgBI,EAAAA,QAAkBH,EAAAA,MAAgB,CAAC;AAAA,EACjF,SAASD,EAAAA;AAAAA,EACT,uBAAuBK,EAAAA;AAAAA,EACvB,KAAKJ,EAAAA,OAAiB;AAAA,EACtB,OAAOA,EAAAA;AAAAA,EACP,iBAAiBI,EAAAA;AAAAA,EACjB,SAASH,EAAAA,MAAgB,CAAC,OAAO,QAAQ,KAAK,CAAC;AACjD;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index180.js","sources":["../src/assets/icons/white-close.svg?url"],"sourcesContent":["export default \"data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.545%205.45508L5.4541%2014.546'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5.4541%205.45508L14.545%2014.546'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e\""],"names":["__vite_glob_0_109"],"mappings":"AAAA,MAAAA,IAAe;"}
|