@eightshift/ui-components 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Button-DTARR6Ff.js → Button-uYE9D_E3.js} +6 -5
- package/dist/{ColorSwatch-5bZ_yIMB.js → ColorSwatch-Bev-9Vbr.js} +4 -4
- package/dist/{Dialog-DJgS0mAg.js → Dialog-CGE2ficT.js} +17 -15
- package/dist/{FieldError-CviphIN5.js → FieldError-CBPJ4Xx8.js} +2 -2
- package/dist/{FocusScope-BjM5iOQC.js → FocusScope-CVd6C65L.js} +24 -8
- package/dist/{GridList-DjRnMEae.js → GridList-PBJsm70G.js} +156 -116
- package/dist/{Group-BQu67pVS.js → Group-WZgNv9RE.js} +3 -3
- package/dist/Hidden-YSmyVF_5.js +45 -0
- package/dist/{Input-DWRQF0ro.js → Input-CaS4qmLb.js} +10 -9
- package/dist/{Label-BXvY41yE.js → Label-yZgqvhXc.js} +3 -2
- package/dist/ListBox-MZyPpwvj.js +567 -0
- package/dist/{Select-49a62830.esm-BnlXlUnT.js → Select-49a62830.esm-CqLHaIei.js} +1 -1
- package/dist/{SelectionManager-JxXmb3-k.js → SelectionManager-CvRaua4m.js} +1580 -1484
- package/dist/{Separator-CX64zwq8.js → Separator-C7Few7L6.js} +80 -62
- package/dist/{Slider-Clme2C36.js → Slider-D8a63VhT.js} +14 -12
- package/dist/{Text-qjognpzK.js → Text-D8qh3_U7.js} +1 -1
- package/dist/{VisuallyHidden-BZPezMV5.js → VisuallyHidden-DD480kAb.js} +2 -2
- package/dist/_commonjsHelpers-CUmg6egw.js +6 -0
- package/dist/{ariaHideOutside-BZ5z6iCD.js → ariaHideOutside-BzxkODNq.js} +1 -9
- package/dist/assets/style.css +1 -1
- package/dist/assets/wp-ui-enhancements.css +1 -1
- package/dist/components/animated-visibility/animated-visibility.js +311 -198
- package/dist/components/base-control/base-control.js +1 -1
- package/dist/components/button/button.js +274 -9
- package/dist/components/checkbox/checkbox.js +171 -1
- package/dist/components/color-pickers/color-picker.js +1 -1
- package/dist/components/color-pickers/color-swatch.js +3 -3
- package/dist/components/color-pickers/gradient-editor.js +3 -3
- package/dist/components/color-pickers/solid-color-picker.js +46 -32
- package/dist/components/component-toggle/component-toggle.js +2 -2
- package/dist/components/container-panel/container-panel.js +2 -2
- package/dist/components/draggable-list/draggable-list-item.js +3 -3
- package/dist/components/draggable-list/draggable-list.js +3671 -6
- package/dist/components/expandable/expandable.js +7 -4
- package/dist/components/index.js +4 -4
- package/dist/components/input-field/input-field.js +7 -7
- package/dist/components/link-input/link-input.js +1519 -489
- package/dist/components/list-box/list-box.js +2 -2
- package/dist/components/matrix-align/matrix-align.js +3 -3
- package/dist/components/menu/menu.js +164 -466
- package/dist/components/modal/modal.js +7 -7
- package/dist/components/number-picker/number-picker.js +22 -17
- package/dist/components/option-select/option-select.js +6 -4
- package/dist/components/placeholders/file-placeholder.js +1 -1
- package/dist/components/popover/popover.js +3 -3
- package/dist/components/radio/radio.js +13 -13
- package/dist/components/repeater/repeater-context.js +5 -0
- package/dist/components/repeater/repeater-item.js +46 -91
- package/dist/components/repeater/repeater.js +5130 -175
- package/dist/components/responsive/responsive-legacy.js +3 -3
- package/dist/components/responsive/responsive.js +3 -3
- package/dist/components/responsive-preview/responsive-preview.js +1 -1
- package/dist/components/select/async-multi-select.js +3 -3
- package/dist/components/select/async-single-select.js +2 -2
- package/dist/components/select/custom-select-default-components.js +1 -1
- package/dist/components/select/multi-select-components.js +1 -1
- package/dist/components/select/multi-select.js +5 -5
- package/dist/components/select/react-select-component-wrappers.js +1 -1
- package/dist/components/select/single-select.js +2 -2
- package/dist/components/select/styles.js +1 -1
- package/dist/components/slider/column-config-slider.js +3 -3
- package/dist/components/slider/slider.js +3 -3
- package/dist/components/slider/utils.js +1 -1
- package/dist/components/tabs/tabs.js +46 -71
- package/dist/components/toggle/switch.js +6 -6
- package/dist/components/toggle/toggle.js +1 -1
- package/dist/components/toggle-button/toggle-button.js +7 -7
- package/dist/components/tooltip/tooltip.js +3 -3
- package/dist/{context-BG_1RnbC.js → context-Bon2Gyx5.js} +1 -1
- package/dist/{default-i18n-BqwLkgZv.js → default-i18n-BqWys-1G.js} +1 -1
- package/dist/{focusSafely-DGZ4R5fj.js → focusSafely-PMGZgZ9-.js} +33 -26
- package/dist/getScrollParent-B3XgpXBL.js +10 -0
- package/dist/icons/icons.js +205 -0
- package/dist/icons/jsx-svg.js +2 -2
- package/dist/{index-CAPcSs9K.js → index-BTCzc3zb.js} +1 -1
- package/dist/{index-a301f526.esm-ByOfDxiG.js → index-a301f526.esm-B9tWL9yi.js} +80 -603
- package/dist/index.js +4 -4
- package/dist/{intlStrings-CkuKCPkT.js → intlStrings-KQxgp5tS.js} +14 -9
- package/dist/{multi-select-components-7vKCF8dG.js → multi-select-components-DTvEidE3.js} +1 -1
- package/dist/react-jsx-parser.min-CAGfntg1.js +13425 -0
- package/dist/{react-select-async.esm-5zW9Dv9E.js → react-select-async.esm-8Rba_3KV.js} +3 -3
- package/dist/{react-select.esm-Bi6uzjbT.js → react-select.esm-DkSeQzOP.js} +3 -3
- package/dist/{textSelection-BLyBtNe2.js → textSelection-DS7-670U.js} +1 -1
- package/dist/{tooltip-DSk8I1SO.js → tooltip-C9mg1CP5.js} +54 -18
- package/dist/{useButton-EJ9c8fmq.js → useButton-BPY4yXUo.js} +3 -3
- package/dist/{useEvent-Cxq_BzP_.js → useEvent-DDLT851Z.js} +1 -1
- package/dist/{useFocusRing-Dg5Y_10S.js → useFocusRing-DsxEaA2J.js} +1 -1
- package/dist/{useFocusable-CQZyQp4q.js → useFocusable-BFKHuYS9.js} +2 -2
- package/dist/{useFormReset-DJMtIgSL.js → useFormReset-BCPbwfnH.js} +1 -1
- package/dist/{useFormValidationState-DDC_nImg.js → useFormValidationState-DC5jbhBW.js} +2 -2
- package/dist/{useHasTabbableChild-M3O3VIil.js → useHasTabbableChild-Byd7ylXD.js} +2 -2
- package/dist/{useLabel-6NqYraET.js → useLabel-DuJhImKc.js} +2 -2
- package/dist/{useLabels-D2RG7TdI.js → useLabels-JaBafrnV.js} +1 -1
- package/dist/{useListData-BpYQj7kK.js → useListData-B5Pk32vd.js} +6 -3
- package/dist/{useListState-IllYYnXV.js → useListState-Csx05BmT.js} +6 -3
- package/dist/{useLocalizedStringFormatter-Cwm_siat.js → useLocalizedStringFormatter-CVIIVTgz.js} +1 -1
- package/dist/useMenuTrigger-CMgzyMKW.js +246 -0
- package/dist/{useNumberFieldState-CVJOJnF1.js → useNumberFieldState-BVFqhboT.js} +12 -11
- package/dist/{useNumberFormatter-DVZRQXk3.js → useNumberFormatter-BEeBSV-N.js} +1 -1
- package/dist/{usePress-CiXj8dLE.js → usePress-CY8MpqYD.js} +58 -16
- package/dist/useSingleSelectListState-CzZUgAt0.js +37 -0
- package/dist/{useToggle-CV-IX6nL.js → useToggle-CJp2Fh_L.js} +4 -4
- package/dist/{useToggleState-DHIdITtQ.js → useToggleState-B4--Ski0.js} +1 -1
- package/dist/{utils-DC-UMp1n.js → utils-B4IdLYb8.js} +48 -85
- package/package.json +24 -21
- package/dist/Checkbox-CiJIVbAP.js +0 -174
- package/dist/ListBox-DTKMdjQC.js +0 -4216
- package/dist/_commonjsHelpers-DWwsNxpa.js +0 -8
- package/dist/button-IxfzzzbP.js +0 -277
- package/dist/react-jsx-parser.min-DhrYeqLL.js +0 -4563
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, b as $64fa3d84918910a7$export$4d86445c2cf5e3, c as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-B4IdLYb8.js";
|
|
2
|
+
import { $ as $f39a9eba43920ace$export$86427a43e3e48ebb } from "./Hidden-YSmyVF_5.js";
|
|
2
3
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-EDDcM64A.js";
|
|
3
4
|
import React__default, { createContext } from "react";
|
|
4
|
-
import { $ as $701a24aa0da5b062$export$ea18c227d4417cc3 } from "./useButton-
|
|
5
|
-
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "./useFocusRing-
|
|
6
|
-
import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "./focusSafely-
|
|
5
|
+
import { $ as $701a24aa0da5b062$export$ea18c227d4417cc3 } from "./useButton-BPY4yXUo.js";
|
|
6
|
+
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "./useFocusRing-DsxEaA2J.js";
|
|
7
|
+
import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "./focusSafely-PMGZgZ9-.js";
|
|
7
8
|
const $d2b4bc8c273e7be6$var$additionalButtonHTMLAttributes = /* @__PURE__ */ new Set([
|
|
8
9
|
"form",
|
|
9
10
|
"formAction",
|
|
@@ -47,7 +48,7 @@ function $d2b4bc8c273e7be6$var$Button(props, ref) {
|
|
|
47
48
|
"data-focus-visible": isFocusVisible || void 0
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
|
-
const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /* @__PURE__ */ $
|
|
51
|
+
const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /* @__PURE__ */ $f39a9eba43920ace$export$86427a43e3e48ebb($d2b4bc8c273e7be6$var$Button);
|
|
51
52
|
export {
|
|
52
53
|
$d2b4bc8c273e7be6$export$24d547caef80ccd1 as $,
|
|
53
54
|
$d2b4bc8c273e7be6$export$353f5b6fc5456de1 as a
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { e as $bdb11010cef70236$export$f680877a34711e37, a as $64fa3d84918910a7$export$29f1550f4b0d4415,
|
|
2
|
-
import { $ as $799cddbef784668f$export$6e865ea70d7724f, a as $3493a52097159720$exports } from "./intlStrings-
|
|
1
|
+
import { e as $bdb11010cef70236$export$f680877a34711e37, a as $64fa3d84918910a7$export$29f1550f4b0d4415, b as $64fa3d84918910a7$export$4d86445c2cf5e3 } from "./utils-B4IdLYb8.js";
|
|
2
|
+
import { $ as $799cddbef784668f$export$6e865ea70d7724f, a as $3493a52097159720$exports } from "./intlStrings-KQxgp5tS.js";
|
|
3
3
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-EDDcM64A.js";
|
|
4
4
|
import React__default, { useMemo, forwardRef, createContext } from "react";
|
|
5
|
-
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-
|
|
6
|
-
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "./useLocalizedStringFormatter-
|
|
5
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-Bon2Gyx5.js";
|
|
6
|
+
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "./useLocalizedStringFormatter-CVIIVTgz.js";
|
|
7
7
|
function $parcel$interopDefault(a) {
|
|
8
8
|
return a && a.__esModule ? a.default : a;
|
|
9
9
|
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { l as $df56164dff5785e2$export$4338b53315abf666,
|
|
1
|
+
import { l as $df56164dff5785e2$export$4338b53315abf666, c as $3ef42575df84b30b$export$9d1611c77c2fe928, f as $8ae05eaa5c114e9c$export$7f54fc3180508a52, e as $bdb11010cef70236$export$f680877a34711e37, g as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, n as $ff5963eb1fccf552$export$e08e3b67e392101e, d as $b5e257d569688ac6$export$535bd6ca7f90a273, k as $bdb11010cef70236$export$b4cc09c592e8fdb8, a as $64fa3d84918910a7$export$29f1550f4b0d4415, o as $64fa3d84918910a7$export$45fda7c47f93fd48, p as $64fa3d84918910a7$export$6d3443f2c48bfc20, b as $64fa3d84918910a7$export$4d86445c2cf5e3, j as $64fa3d84918910a7$export$2881499e37b75b9a, q as $64fa3d84918910a7$export$c62b8e45d58ddad9 } from "./utils-B4IdLYb8.js";
|
|
2
2
|
import { a as $4e85f108e88277b8$export$d688439359537581 } from "./RSPContexts-DQtGvvpM.js";
|
|
3
|
-
import {
|
|
3
|
+
import { b as $dd149f63282afbbf$export$f6211563215e3b37, c as $2a41e45df1593e64$export$d39e1813b3bdd0e1, $ as $fc909762b330b746$export$61c6a8c84e605fb6, d as $44f671af83e7d9e0$export$2de4954e8ae13b9f } from "./tooltip-C9mg1CP5.js";
|
|
4
4
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-EDDcM64A.js";
|
|
5
|
-
import { e as $ae1eeba8b9eafd08$export$5165eccb35aaadb5 } from "./usePress-
|
|
6
|
-
import { l as $e7801be82b4b2a53$export$4debdb1a3f0fa79e, g as $431fbd86ca7dc216$export$b204af158042fbac, d as $9ab94262bd0047c7$export$420e68273165f4ec, j as $c87311424ea30a05$export$fedb369cb70207f1, h as $6a99195332edec8b$export$80f3e147d781571c } from "./focusSafely-
|
|
5
|
+
import { e as $ae1eeba8b9eafd08$export$5165eccb35aaadb5 } from "./usePress-CY8MpqYD.js";
|
|
6
|
+
import { l as $e7801be82b4b2a53$export$4debdb1a3f0fa79e, g as $431fbd86ca7dc216$export$b204af158042fbac, d as $9ab94262bd0047c7$export$420e68273165f4ec, j as $c87311424ea30a05$export$fedb369cb70207f1, h as $6a99195332edec8b$export$80f3e147d781571c } from "./focusSafely-PMGZgZ9-.js";
|
|
7
7
|
import React__default, { useRef, useContext, useEffect, useMemo, createContext, useState, forwardRef } from "react";
|
|
8
|
-
import { c as $9bf71ea28793e738$export$1258395f99bf9cbf, $ as $9bf71ea28793e738$export$20e40289641fbbb6 } from "./FocusScope-
|
|
9
|
-
import { $ as $dbSRa$reactdom } from "./index-
|
|
10
|
-
import {
|
|
11
|
-
import { $ as $
|
|
12
|
-
import { $ as $
|
|
13
|
-
import { $ as $
|
|
8
|
+
import { c as $9bf71ea28793e738$export$1258395f99bf9cbf, $ as $9bf71ea28793e738$export$20e40289641fbbb6 } from "./FocusScope-CVd6C65L.js";
|
|
9
|
+
import { $ as $dbSRa$reactdom } from "./index-BTCzc3zb.js";
|
|
10
|
+
import { b as $f39a9eba43920ace$export$b5d7cc18bb8d2b59 } from "./Hidden-YSmyVF_5.js";
|
|
11
|
+
import { $ as $5e3802645cc19319$export$1c3ebcada18427bf } from "./ariaHideOutside-BzxkODNq.js";
|
|
12
|
+
import { $ as $62d8ded9296f3872$export$cfa2225e87938781 } from "./getScrollParent-B3XgpXBL.js";
|
|
13
|
+
import { $ as $313b98861ee5dd6c$export$d6875122194c7b44 } from "./useLabels-JaBafrnV.js";
|
|
14
|
+
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "./useLocalizedStringFormatter-CVIIVTgz.js";
|
|
15
|
+
import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "./VisuallyHidden-DD480kAb.js";
|
|
14
16
|
const $f1ab8c75478c6f73$export$3351871ee4b288b8 = /* @__PURE__ */ React__default.forwardRef(({ children, ...props }, ref) => {
|
|
15
17
|
let isRegistered = useRef(false);
|
|
16
18
|
let prevContext = useContext($ae1eeba8b9eafd08$export$5165eccb35aaadb5);
|
|
@@ -659,7 +661,7 @@ function $07b14b47974efb58$var$Popover(props, ref) {
|
|
|
659
661
|
let localState = $fc909762b330b746$export$61c6a8c84e605fb6(props);
|
|
660
662
|
let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;
|
|
661
663
|
let isExiting = $64fa3d84918910a7$export$45fda7c47f93fd48(ref, state.isOpen) || props.isExiting || false;
|
|
662
|
-
let isHidden =
|
|
664
|
+
let isHidden = $f39a9eba43920ace$export$b5d7cc18bb8d2b59();
|
|
663
665
|
if (isHidden) {
|
|
664
666
|
let children = props.children;
|
|
665
667
|
if (typeof children === "function") children = children({
|
|
@@ -833,8 +835,8 @@ export {
|
|
|
833
835
|
$de32f1b87079253c$export$d2f961adcb0afbe as f,
|
|
834
836
|
$337b884510726a0d$export$c6fdb837b070b4ff as g,
|
|
835
837
|
$86ea4cb521eb2e37$export$2317d149ed6f78c4 as h,
|
|
836
|
-
$
|
|
837
|
-
$
|
|
838
|
-
$
|
|
839
|
-
$
|
|
838
|
+
$07b14b47974efb58$export$9b9a0cd73afb7ca4 as i,
|
|
839
|
+
$f1ab8c75478c6f73$export$3351871ee4b288b8 as j,
|
|
840
|
+
$e0b6e0b68ec7f50f$export$872b660ac5a1ff98 as k,
|
|
841
|
+
$628037886ba31236$export$f9d5c8beee7d008d as l
|
|
840
842
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as $d191a55c9702f145$export$8467354a121f1b9f } from "./useLabel-
|
|
2
|
-
import { k as $bdb11010cef70236$export$b4cc09c592e8fdb8,
|
|
1
|
+
import { $ as $d191a55c9702f145$export$8467354a121f1b9f } from "./useLabel-DuJhImKc.js";
|
|
2
|
+
import { k as $bdb11010cef70236$export$b4cc09c592e8fdb8, c as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-B4IdLYb8.js";
|
|
3
3
|
import { createContext } from "react";
|
|
4
4
|
function $2baaea4c71418dea$export$294aa081a6c6f55d(props) {
|
|
5
5
|
let { description, errorMessage, isInvalid, validationState } = props;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as $431fbd86ca7dc216$export$f21a1ffae260145a, g as $431fbd86ca7dc216$export$b204af158042fbac, h as $6a99195332edec8b$export$80f3e147d781571c } from "./focusSafely-
|
|
2
|
-
import { g as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c } from "./utils-
|
|
1
|
+
import { f as $431fbd86ca7dc216$export$f21a1ffae260145a, g as $431fbd86ca7dc216$export$b204af158042fbac, h as $6a99195332edec8b$export$80f3e147d781571c } from "./focusSafely-PMGZgZ9-.js";
|
|
2
|
+
import { g as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c } from "./utils-B4IdLYb8.js";
|
|
3
3
|
import React__default, { useRef, useContext, useMemo, useEffect } from "react";
|
|
4
4
|
function $645f2e67b85a24c9$var$isStyleVisible(element) {
|
|
5
5
|
const windowObject = $431fbd86ca7dc216$export$f21a1ffae260145a(element);
|
|
@@ -21,6 +21,7 @@ function $645f2e67b85a24c9$export$e989c0fffaa6b27a(element, childElement) {
|
|
|
21
21
|
return element.nodeName !== "#comment" && $645f2e67b85a24c9$var$isStyleVisible(element) && $645f2e67b85a24c9$var$isAttributeVisible(element, childElement) && (!element.parentElement || $645f2e67b85a24c9$export$e989c0fffaa6b27a(element.parentElement, element));
|
|
22
22
|
}
|
|
23
23
|
const $9bf71ea28793e738$var$FocusContext = /* @__PURE__ */ React__default.createContext(null);
|
|
24
|
+
const $9bf71ea28793e738$var$RESTORE_FOCUS_EVENT = "react-aria-focus-scope-restore";
|
|
24
25
|
let $9bf71ea28793e738$var$activeScope = null;
|
|
25
26
|
function $9bf71ea28793e738$export$20e40289641fbbb6(props) {
|
|
26
27
|
let { children, contain, restoreFocus, autoFocus } = props;
|
|
@@ -55,11 +56,16 @@ function $9bf71ea28793e738$export$20e40289641fbbb6(props) {
|
|
|
55
56
|
var _startRef_current;
|
|
56
57
|
let node2 = (_startRef_current = startRef.current) === null || _startRef_current === void 0 ? void 0 : _startRef_current.nextSibling;
|
|
57
58
|
let nodes = [];
|
|
59
|
+
let stopPropagation = (e) => e.stopPropagation();
|
|
58
60
|
while (node2 && node2 !== endRef.current) {
|
|
59
61
|
nodes.push(node2);
|
|
62
|
+
node2.addEventListener($9bf71ea28793e738$var$RESTORE_FOCUS_EVENT, stopPropagation);
|
|
60
63
|
node2 = node2.nextSibling;
|
|
61
64
|
}
|
|
62
65
|
scopeRef.current = nodes;
|
|
66
|
+
return () => {
|
|
67
|
+
for (let node3 of nodes) node3.removeEventListener($9bf71ea28793e738$var$RESTORE_FOCUS_EVENT, stopPropagation);
|
|
68
|
+
};
|
|
63
69
|
}, [
|
|
64
70
|
children
|
|
65
71
|
]);
|
|
@@ -206,8 +212,8 @@ function $9bf71ea28793e738$var$shouldContainFocus(scopeRef) {
|
|
|
206
212
|
return true;
|
|
207
213
|
}
|
|
208
214
|
function $9bf71ea28793e738$var$useFocusContainment(scopeRef, contain) {
|
|
209
|
-
let focusedNode = useRef();
|
|
210
|
-
let raf = useRef();
|
|
215
|
+
let focusedNode = useRef(void 0);
|
|
216
|
+
let raf = useRef(void 0);
|
|
211
217
|
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
212
218
|
let scope = scopeRef.current;
|
|
213
219
|
if (!contain) {
|
|
@@ -318,7 +324,7 @@ function $9bf71ea28793e738$var$focusElement(element, scroll = false) {
|
|
|
318
324
|
} catch (err) {
|
|
319
325
|
}
|
|
320
326
|
}
|
|
321
|
-
function $9bf71ea28793e738$var$
|
|
327
|
+
function $9bf71ea28793e738$var$getFirstInScope(scope, tabbable = true) {
|
|
322
328
|
let sentinel = scope[0].previousElementSibling;
|
|
323
329
|
let scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);
|
|
324
330
|
let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(scopeRoot, {
|
|
@@ -334,7 +340,10 @@ function $9bf71ea28793e738$var$focusFirstInScope(scope, tabbable = true) {
|
|
|
334
340
|
walker.currentNode = sentinel;
|
|
335
341
|
nextNode = walker.nextNode();
|
|
336
342
|
}
|
|
337
|
-
|
|
343
|
+
return nextNode;
|
|
344
|
+
}
|
|
345
|
+
function $9bf71ea28793e738$var$focusFirstInScope(scope, tabbable = true) {
|
|
346
|
+
$9bf71ea28793e738$var$focusElement($9bf71ea28793e738$var$getFirstInScope(scope, tabbable));
|
|
338
347
|
}
|
|
339
348
|
function $9bf71ea28793e738$var$useAutoFocus(scopeRef, autoFocus) {
|
|
340
349
|
const autoFocusRef = React__default.useRef(autoFocus);
|
|
@@ -457,7 +466,7 @@ function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
457
466
|
let treeNode3 = clonedTree.getTreeNode(scopeRef);
|
|
458
467
|
while (treeNode3) {
|
|
459
468
|
if (treeNode3.nodeToRestore && treeNode3.nodeToRestore.isConnected) {
|
|
460
|
-
$9bf71ea28793e738$var$
|
|
469
|
+
$9bf71ea28793e738$var$restoreFocusToElement(treeNode3.nodeToRestore);
|
|
461
470
|
return;
|
|
462
471
|
}
|
|
463
472
|
treeNode3 = treeNode3.parent;
|
|
@@ -465,7 +474,8 @@ function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
465
474
|
treeNode3 = clonedTree.getTreeNode(scopeRef);
|
|
466
475
|
while (treeNode3) {
|
|
467
476
|
if (treeNode3.scopeRef && treeNode3.scopeRef.current && $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(treeNode3.scopeRef)) {
|
|
468
|
-
$9bf71ea28793e738$var$
|
|
477
|
+
let node = $9bf71ea28793e738$var$getFirstInScope(treeNode3.scopeRef.current, true);
|
|
478
|
+
$9bf71ea28793e738$var$restoreFocusToElement(node);
|
|
469
479
|
return;
|
|
470
480
|
}
|
|
471
481
|
treeNode3 = treeNode3.parent;
|
|
@@ -479,6 +489,12 @@ function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
479
489
|
restoreFocus
|
|
480
490
|
]);
|
|
481
491
|
}
|
|
492
|
+
function $9bf71ea28793e738$var$restoreFocusToElement(node) {
|
|
493
|
+
if (node.dispatchEvent(new CustomEvent($9bf71ea28793e738$var$RESTORE_FOCUS_EVENT, {
|
|
494
|
+
bubbles: true,
|
|
495
|
+
cancelable: true
|
|
496
|
+
}))) $9bf71ea28793e738$var$focusElement(node);
|
|
497
|
+
}
|
|
482
498
|
function $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, opts, scope) {
|
|
483
499
|
let selector = (opts === null || opts === void 0 ? void 0 : opts.tabbable) ? $9bf71ea28793e738$var$TABBABLE_ELEMENT_SELECTOR : $9bf71ea28793e738$var$FOCUSABLE_ELEMENT_SELECTOR;
|
|
484
500
|
let walker = $431fbd86ca7dc216$export$b204af158042fbac(root).createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
|