@povio/ui 4.0.2 → 4.0.4
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/README.md +5 -1
- package/dist/{Autocomplete-DE2lQi5o.d.ts → Autocomplete-CFJ8ro0I.d.ts} +1 -1
- package/dist/{BottomSheet-CVTF1wQe.js → BottomSheet-DKYJqaKC.js} +2 -2
- package/dist/{Breadcrumbs-BibAIBhY.js → Breadcrumbs-C-mZtdCc.js} +1 -1
- package/dist/{Button-CcZBqoQp.js → Button-YQIr25DP.js} +1 -1
- package/dist/{Calendar-kSEji28A.js → Calendar-D-07OtEr.js} +8 -137
- package/dist/{Checkbox-DBV_Nxtq.js → Checkbox-Dp6dSvU3.js} +1 -1
- package/dist/{DatePicker-BbdtBAGN.js → DatePicker-CmadsYcG.js} +13 -13
- package/dist/{DatePickerInput-eyHwzKPm.js → DatePickerInput-BFI-ZPDb.js} +9 -8
- package/dist/{DateRangePicker-Ct182qur.js → DateRangePicker-4fpEtrbb.js} +17 -187
- package/dist/{DateTimePicker-taYHMMYi.js → DateTimePicker-6ixOSPcA.js} +13 -13
- package/dist/{DropdownMenu-tuf1W-IL.js → DropdownMenu-e1MBg1w0.js} +1 -1
- package/dist/{FileInput-B-ADr0B3.js → FileInput-BYImQc3r.js} +3 -3
- package/dist/{FileUpload-3-4Vt4f1.js → FileUpload-BP1BIT9D.js} +3 -3
- package/dist/{Form-mzpVGNjX.d.ts → Form-opTIGQDc.d.ts} +1 -1
- package/dist/{FormField-CAcDJ4HC.js → FormField-DTO2cbXC.js} +1 -1
- package/dist/{FormFieldHeaderTooltip-C2IDI4ac.js → FormFieldHeaderTooltip-h6e5hq9V.js} +1 -1
- package/dist/{InlineTooltipWrapper-7HG-g2X3.js → InlineTooltipWrapper-Ct6zi24f.js} +1 -1
- package/dist/{InputItem-B3PlrjuD.js → InputItem-CljfmlvS.js} +11 -11
- package/dist/{Inputs-CHEDcuP0.d.ts → Inputs-ClUh3WON.d.ts} +1 -1
- package/dist/{Inputs-WZmrBWrL.js → Inputs-K83n37Fs.js} +1 -1
- package/dist/NumberFormatter-CLDS_LRZ.js +265 -0
- package/dist/{NumberRangeInput-X8G1zfNM.js → NumberRangeInput-DzAM2RIu.js} +7 -6
- package/dist/{PaginationList-CmOJo2r2.js → PaginationList-BsxtDg6w.js} +1 -1
- package/dist/{QuerySelect-Bpz-qI9h.d.ts → QuerySelect-CmnJWLol.d.ts} +2 -2
- package/dist/{RadioGroup-DW_OQQDu.js → RadioGroup-B12aDhAs.js} +2 -2
- package/dist/{RichTextEditor-BOTitK7E.js → RichTextEditor-DcmQtw8H.js} +4 -4
- package/dist/{Select-DmLkOMr1.js → Select-BkCBNUfr.js} +3 -3
- package/dist/{Select-wzB2aQ_X.d.ts → Select-CuvhVk-C.d.ts} +1 -1
- package/dist/{SelectBase-DefgAEzh.d.ts → SelectBase-K2ve5zo6.d.ts} +1 -0
- package/dist/{Slider-Q87Hg_V2.js → Slider-CCVCu1JN.js} +2 -2
- package/dist/{Switch-Cylpjatb.js → Switch-CdF3Zonl.js} +1 -1
- package/dist/{Tag-DNuHvt6J.js → Tag-CK5D4sLA.js} +1 -1
- package/dist/{TextArea-DZv6XaT0.js → TextArea-DIZ8Lv_P.js} +3 -3
- package/dist/{TimePicker-DAoHgk8U.js → TimePicker-CtjPqrmF.js} +11 -10
- package/dist/{ToastContainer-8X5jGBe7.js → ToastContainer-BEt6s7Ry.js} +2 -2
- package/dist/{ToggleGroup-Cho_oRZh.js → ToggleGroup-BK6Ka7WA.js} +5 -66
- package/dist/{Tooltip-D94a1IQl.js → Tooltip--PSxkQA3.js} +2 -2
- package/dist/{TooltipWrapper-S2JC-w4e.js → TooltipWrapper-DW1XJTV8.js} +2 -2
- package/dist/{autocomplete-CaQSVRrw.d.ts → autocomplete-C9xgSizP.d.ts} +2 -2
- package/dist/components/alert-dialog.js +2 -2
- package/dist/components/autocomplete.d.ts +1 -1
- package/dist/components/autocomplete.js +3 -3
- package/dist/components/badge.js +1 -1
- package/dist/components/bottom-sheet.js +1 -1
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/checkbox-group.js +3 -3
- package/dist/components/checkbox.js +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-range-picker.js +1 -1
- package/dist/components/date-time-picker.js +1 -1
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/file-input.js +1 -1
- package/dist/components/file-upload-container.js +1 -1
- package/dist/components/file-upload.js +1 -1
- package/dist/components/form-field.js +1 -1
- package/dist/components/icon-button.js +2 -2
- package/dist/components/inline-icon-button.js +1 -1
- package/dist/components/input.js +5 -5
- package/dist/components/number-field.js +8 -7
- package/dist/components/number-range-input.js +1 -1
- package/dist/components/pagination-list.js +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/popover.js +1 -1
- package/dist/components/query-autocomplete.d.ts +2 -2
- package/dist/components/query-autocomplete.js +10 -5
- package/dist/components/query-select.d.ts +1 -1
- package/dist/components/query-select.js +3 -3
- package/dist/components/radio-group.js +1 -1
- package/dist/components/select.d.ts +2 -2
- package/dist/components/select.js +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/split-button.js +2 -2
- package/dist/components/switch.js +1 -1
- package/dist/components/tag.js +1 -1
- package/dist/components/text-area.js +1 -1
- package/dist/components/text-button.js +1 -1
- package/dist/components/time-picker.js +1 -1
- package/dist/components/toast.js +2 -2
- package/dist/components/toggle-button.js +1 -1
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/tooltip-ellipsis.js +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components/use-toast.js +2 -2
- package/dist/config/ui-config.d.ts +1 -1
- package/dist/config/ui-config.js +1 -1
- package/dist/config/ui-router.js +1 -1
- package/dist/{datePickerValue.utils-GADbSu7a.js → datePickerValue.utils-B8aSxcsT.js} +6 -6
- package/dist/{dist-C6GfeeEC.js → dist-CK54f1eE.js} +2 -2
- package/dist/{dom.utils-D3mELNBA.js → dom.utils-CkZXhqc2.js} +1 -1
- package/dist/{dynamicInputs-CQMTixlW.d.ts → dynamicInputs-Wa3FdsbA.d.ts} +15 -15
- package/dist/{fieldAdapter-BYVPxvYi.js → fieldAdapter-B5-U5PYX.js} +1 -1
- package/dist/hooks/use-filters.js +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +26 -26
- package/dist/numberStatic.utils-BX50PSee.js +421 -0
- package/dist/{query-autocomplete-DV8fEkK2.d.ts → query-autocomplete-DfhSserb.d.ts} +2 -2
- package/dist/{query-select-BZ3-5WTu.d.ts → query-select-C6Onz6pF.d.ts} +2 -2
- package/dist/{queryAutocomplete.types-Dm8Ttx4v.d.ts → queryAutocomplete.types-DS9H0Boa.d.ts} +2 -2
- package/dist/rhf/autocomplete.d.ts +2 -2
- package/dist/rhf/autocomplete.js +1 -1
- package/dist/rhf/checkbox-group.js +1 -1
- package/dist/rhf/checkbox.js +2 -2
- package/dist/rhf/date-picker.js +2 -2
- package/dist/rhf/date-range-picker.js +2 -2
- package/dist/rhf/date-time-picker.js +2 -2
- package/dist/rhf/file-input.js +2 -2
- package/dist/rhf/file-upload.js +2 -2
- package/dist/rhf/input.js +1 -1
- package/dist/rhf/inputs.d.ts +1 -1
- package/dist/rhf/number-field.js +1 -1
- package/dist/rhf/number-range-input.js +2 -2
- package/dist/rhf/password-input.js +1 -1
- package/dist/rhf/query-autocomplete.d.ts +1 -1
- package/dist/rhf/query-autocomplete.js +1 -1
- package/dist/rhf/query-select.d.ts +1 -1
- package/dist/rhf/query-select.js +1 -1
- package/dist/rhf/radio-group.js +2 -2
- package/dist/rhf/rich-text-editor.js +2 -2
- package/dist/rhf/select.d.ts +2 -2
- package/dist/rhf/select.js +2 -2
- package/dist/rhf/slider.js +2 -2
- package/dist/rhf/switch.js +2 -2
- package/dist/rhf/text-area.js +2 -2
- package/dist/rhf/time-picker.js +2 -2
- package/dist/rhf/toggle-group.js +2 -2
- package/dist/{rhf-1_ZO8GhU.js → rhf-__WYbcIJ.js} +1 -1
- package/dist/rhf.d.ts +9 -9
- package/dist/rhf.js +26 -26
- package/dist/rich-text-editor.js +1 -1
- package/dist/{router.context-B0jTMtE0.js → router.context-B4FvsTim.js} +2 -2
- package/dist/{select-DXGbGkZM.d.ts → select-y1GPTzpH.d.ts} +2 -2
- package/dist/staticDateTimeSegments-DzKcCK-Y.js +1763 -0
- package/dist/{staticSelect.utils-ad60elvT.js → staticSelect.utils-DWf8KbFx.js} +10 -147
- package/dist/tanstack/autocomplete.d.ts +1 -1
- package/dist/tanstack/checkbox.js +1 -1
- package/dist/tanstack/date-picker.js +1 -1
- package/dist/tanstack/date-range-picker.js +1 -1
- package/dist/tanstack/date-time-picker.js +1 -1
- package/dist/tanstack/file-input.js +1 -1
- package/dist/tanstack/file-upload.js +1 -1
- package/dist/tanstack/form.d.ts +1 -1
- package/dist/tanstack/form.js +1 -1
- package/dist/tanstack/inputs.d.ts +2 -2
- package/dist/tanstack/inputs.js +1 -1
- package/dist/tanstack/number-range-input.js +1 -1
- package/dist/tanstack/query-select.d.ts +1 -1
- package/dist/tanstack/radio-group.js +1 -1
- package/dist/tanstack/rich-text-editor.js +1 -1
- package/dist/tanstack/select.d.ts +1 -1
- package/dist/tanstack/select.js +1 -1
- package/dist/tanstack/slider.js +1 -1
- package/dist/tanstack/switch.js +1 -1
- package/dist/tanstack/table.js +1 -1
- package/dist/tanstack/text-area.js +1 -1
- package/dist/tanstack/time-picker.js +1 -1
- package/dist/tanstack/toggle-group.js +1 -1
- package/dist/tanstack.d.ts +8 -8
- package/dist/tanstack.js +35 -35
- package/dist/{toast.runtime-QMYrNvoQ.js → toast.runtime-D18cXIrS.js} +1 -1
- package/dist/{uiConfig.context-CIoMqe1_.d.ts → uiConfig.context-DQIA0LtD.d.ts} +1 -0
- package/dist/{uiConfig.context-RFvaQYzD.js → uiConfig.context-Dpgiuhxx.js} +1 -0
- package/dist/{useBreakpoint-3kpqzjoC.js → useBreakpoint-BnKj4HZ3.js} +1 -1
- package/dist/useControlledState-CzXkZCX8.js +30 -0
- package/dist/{useFieldAccessibility-CtTdRX2u.js → useFieldAccessibility-DuTAzJ17.js} +2 -2
- package/dist/{useFilters-kkEUFKmQ.js → useFilters-XNH27Md2.js} +1 -1
- package/dist/{useFormAutosave-DqP6lB4l.js → useFormAutosave-DWSqAgMS.js} +2 -2
- package/dist/{useStaticInputHandoff-BAaDW_0z.js → useStaticInputHandoff-C26sYbs1.js} +3 -3
- package/dist/{useTableColumnConfig-DVI_jVHz.js → useTableColumnConfig-ClhWUCBv.js} +3 -3
- package/package.json +1 -3
- package/dist/FocusScope-CO9oJ1sc.js +0 -343
- package/dist/chain-DIXr2VAT.js +0 -10
- package/dist/focusSafely-DCGrr2bb.js +0 -447
- package/dist/getScrollParent-kSR7EtoT.js +0 -47
- package/dist/numberStatic.utils-BMgRzyd3.js +0 -902
- package/dist/openLink-CQhMhfzO.js +0 -121
- package/dist/platform-BXNIIAfU.js +0 -42
- package/dist/staticDateTimeSegments-BQoA94W-.js +0 -3603
- package/dist/useControlledState-DQxX6LMN.js +0 -189
- package/dist/useFocusable-Bd0UsrQ7.js +0 -63
- package/dist/useFormValidationState-D3z-gafz.js +0 -1341
- package/dist/useLayoutEffect-B2-1tbPJ.js +0 -83
- package/dist/useSyncRef-RGMv0rXK.js +0 -338
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import $ahdqC$react, { useCallback, useEffect, useReducer, useRef, useState } from "react";
|
|
2
|
+
//#region ../../node_modules/.bun/react-stately@3.50.0+83d5fd7b249dbeef/node_modules/react-stately/dist/private/utils/useControlledState.mjs
|
|
3
|
+
const $3e6197669829fe11$var$useEarlyEffect = typeof document !== "undefined" ? $ahdqC$react["useInsertionEffect"] ?? $ahdqC$react.useLayoutEffect : () => {};
|
|
4
|
+
function $3e6197669829fe11$export$40bfa8c7b0832715(value, defaultValue, onChange) {
|
|
5
|
+
let [stateValue, setStateValue] = useState(value || defaultValue);
|
|
6
|
+
let valueRef = useRef(stateValue);
|
|
7
|
+
let isControlledRef = useRef(value !== void 0);
|
|
8
|
+
let isControlled = value !== void 0;
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
let wasControlled = isControlledRef.current;
|
|
11
|
+
if (wasControlled !== isControlled && true) console.warn(`WARN: A component changed from ${wasControlled ? "controlled" : "uncontrolled"} to ${isControlled ? "controlled" : "uncontrolled"}.`);
|
|
12
|
+
isControlledRef.current = isControlled;
|
|
13
|
+
}, [isControlled]);
|
|
14
|
+
let currentValue = isControlled ? value : stateValue;
|
|
15
|
+
$3e6197669829fe11$var$useEarlyEffect(() => {
|
|
16
|
+
valueRef.current = currentValue;
|
|
17
|
+
});
|
|
18
|
+
let [, forceUpdate] = useReducer(() => ({}), {});
|
|
19
|
+
return [currentValue, useCallback((value, ...args) => {
|
|
20
|
+
let newValue = typeof value === "function" ? value(valueRef.current) : value;
|
|
21
|
+
if (!Object.is(valueRef.current, newValue)) {
|
|
22
|
+
valueRef.current = newValue;
|
|
23
|
+
setStateValue(newValue);
|
|
24
|
+
forceUpdate();
|
|
25
|
+
onChange?.(newValue, ...args);
|
|
26
|
+
}
|
|
27
|
+
}, [onChange])];
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { $3e6197669829fe11$export$40bfa8c7b0832715 as t };
|
|
@@ -3,9 +3,9 @@ import { t as UIOverrides } from "./uiOverrides.context-Bfm2n-n8.js";
|
|
|
3
3
|
import { t as typographyDefinition } from "./typography.cva-BI0FyIqm.js";
|
|
4
4
|
import { t as Spinner } from "./Spinner-owSXOEzg.js";
|
|
5
5
|
import { InlineIconButton } from "./components/inline-icon-button.js";
|
|
6
|
-
import { r as FormFieldLabel } from "./FormField-
|
|
6
|
+
import { r as FormFieldLabel } from "./FormField-DTO2cbXC.js";
|
|
7
7
|
import { a as inputSizeDefinition, r as inputContentWrapperDefinition } from "./input.cva-KYGD4Bdz.js";
|
|
8
|
-
import { n as InputClear } from "./TooltipWrapper-
|
|
8
|
+
import { n as InputClear } from "./TooltipWrapper-DW1XJTV8.js";
|
|
9
9
|
import { isValidElement, useId } from "react";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
//#region src/components/inputs/Input/shared/InputContent.tsx
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as UIRouter } from "./router.context-
|
|
1
|
+
import { t as UIRouter } from "./router.context-B4FvsTim.js";
|
|
2
2
|
import { t as RoutingUtils } from "./routing.utils-UTQonIhB.js";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as isEqual, o as ObjectUtils } from "./uiConfig.context-
|
|
1
|
+
import { a as isEqual, o as ObjectUtils } from "./uiConfig.context-Dpgiuhxx.js";
|
|
2
2
|
import { n as useForm } from "./form.binding-CG1RPv6o.js";
|
|
3
3
|
import { t as StringUtils } from "./string.utils-BPgv6QwA.js";
|
|
4
4
|
import { t as ZodUtils } from "./zod.utils-DrrPDT9v.js";
|
|
5
5
|
import { n as getDefaultInputComponentType } from "./dynamicInputs-CRMWIpHA.js";
|
|
6
|
-
import { t as InputItem } from "./InputItem-
|
|
6
|
+
import { t as InputItem } from "./InputItem-CljfmlvS.js";
|
|
7
7
|
import { useCallback, useEffect, useMemo, useRef } from "react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
import { z } from "zod";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { t as UIConfig } from "./uiConfig.context-
|
|
1
|
+
import { t as UIConfig } from "./uiConfig.context-Dpgiuhxx.js";
|
|
2
2
|
import { t as clsx } from "./clsx-CnD0nOiA.js";
|
|
3
3
|
import { t as UIOverrides } from "./uiOverrides.context-Bfm2n-n8.js";
|
|
4
4
|
import { t as typographyDefinition } from "./typography.cva-BI0FyIqm.js";
|
|
5
5
|
import { t as Spinner } from "./Spinner-owSXOEzg.js";
|
|
6
6
|
import { InlineIconButton } from "./components/inline-icon-button.js";
|
|
7
|
-
import { r as FormFieldLabel, t as FormField } from "./FormField-
|
|
7
|
+
import { r as FormFieldLabel, t as FormField } from "./FormField-DTO2cbXC.js";
|
|
8
8
|
import { a as inputSizeDefinition, r as inputContentWrapperDefinition, t as inputBaseDefinition } from "./input.cva-KYGD4Bdz.js";
|
|
9
|
-
import { n as InputClear, t as TooltipWrapper } from "./TooltipWrapper-
|
|
9
|
+
import { n as InputClear, t as TooltipWrapper } from "./TooltipWrapper-DW1XJTV8.js";
|
|
10
10
|
import { isValidElement, useId, useLayoutEffect, useRef, useState } from "react";
|
|
11
11
|
import { useFocusRing as $32daac5f69beb98a$re_export$useFocusRing } from "react-aria/useFocusRing";
|
|
12
12
|
import "react-aria/FocusScope";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as logger } from "./logger-CqZjM-sn.js";
|
|
2
2
|
import { t as createLucideIcon } from "./createLucideIcon-LcezOE4z.js";
|
|
3
|
-
import { t as UIConfig } from "./uiConfig.context-
|
|
3
|
+
import { t as UIConfig } from "./uiConfig.context-Dpgiuhxx.js";
|
|
4
4
|
import { t as ChevronDown } from "./chevron-down-B4Pr8bD3.js";
|
|
5
5
|
import { t as ChevronUp } from "./chevron-up-D_Gqpb5M.js";
|
|
6
6
|
import { t as clsx } from "./clsx-CnD0nOiA.js";
|
|
7
|
-
import { t as Checkbox } from "./Checkbox-
|
|
7
|
+
import { t as Checkbox } from "./Checkbox-Dp6dSvU3.js";
|
|
8
8
|
import { t as UIOverrides } from "./uiOverrides.context-Bfm2n-n8.js";
|
|
9
9
|
import { t as Typography } from "./Typography-AcUd9df8.js";
|
|
10
10
|
import { t as Spinner } from "./Spinner-owSXOEzg.js";
|
|
@@ -18,7 +18,7 @@ import { t as ZodUtils } from "./zod.utils-DrrPDT9v.js";
|
|
|
18
18
|
import { t as Dialog } from "./Dialog-BE9BSDDl.js";
|
|
19
19
|
import { Pagination } from "./components/pagination.js";
|
|
20
20
|
import { t as useTranslationMemo } from "./useTranslationMemo-CrZbeyBv.js";
|
|
21
|
-
import { t as UIRouter } from "./router.context-
|
|
21
|
+
import { t as UIRouter } from "./router.context-B4FvsTim.js";
|
|
22
22
|
import { t as RoutingUtils } from "./routing.utils-UTQonIhB.js";
|
|
23
23
|
import { Suspense, lazy, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
24
24
|
import { c } from "react/compiler-runtime";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@povio/ui",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -1359,8 +1359,6 @@
|
|
|
1359
1359
|
"tailwindcss-react-aria-components": "^2.1.0"
|
|
1360
1360
|
},
|
|
1361
1361
|
"peerDependencies": {
|
|
1362
|
-
"@casl/ability": "^6.7.3",
|
|
1363
|
-
"@casl/react": "^5.0.0",
|
|
1364
1362
|
"@dnd-kit/core": "^6.3.1",
|
|
1365
1363
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
1366
1364
|
"@dnd-kit/sortable": "^10.0.0",
|
|
@@ -1,343 +0,0 @@
|
|
|
1
|
-
import { c as $d447af545b77c9f1$export$f21a1ffae260145a, n as $23f2114a1b82827e$export$4282f70798064fe0, r as $23f2114a1b82827e$export$cd4e5573fbe2b576, s as $d447af545b77c9f1$export$b204af158042fbac } from "./useLayoutEffect-B2-1tbPJ.js";
|
|
2
|
-
import { f as $3b8b240c1bf84ab9$export$4c063cf1350e6fed, p as $3b8b240c1bf84ab9$export$bebd5a1431fec25d, t as $f192c2f16961cbe0$export$80f3e147d781571c } from "./focusSafely-DCGrr2bb.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import { shadowDOM } from "react-stately/private/flags/flags";
|
|
5
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/utils/shadowdom/ShadowTreeWalker.mjs
|
|
6
|
-
var $654b97e09f2a30c1$export$63eb3ababa9c55c4 = class {
|
|
7
|
-
constructor(doc, root, whatToShow, filter) {
|
|
8
|
-
this._walkerStack = [];
|
|
9
|
-
this._currentSetFor = /* @__PURE__ */ new Set();
|
|
10
|
-
this._acceptNode = (node) => {
|
|
11
|
-
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
12
|
-
const shadowRoot = node.shadowRoot;
|
|
13
|
-
if (shadowRoot) {
|
|
14
|
-
const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, { acceptNode: this._acceptNode });
|
|
15
|
-
this._walkerStack.unshift(walker);
|
|
16
|
-
return NodeFilter.FILTER_ACCEPT;
|
|
17
|
-
} else if (typeof this.filter === "function") return this.filter(node);
|
|
18
|
-
else if (this.filter?.acceptNode) return this.filter.acceptNode(node);
|
|
19
|
-
else if (this.filter === null) return NodeFilter.FILTER_ACCEPT;
|
|
20
|
-
}
|
|
21
|
-
return NodeFilter.FILTER_SKIP;
|
|
22
|
-
};
|
|
23
|
-
this._doc = doc;
|
|
24
|
-
this.root = root;
|
|
25
|
-
this.filter = filter ?? null;
|
|
26
|
-
this.whatToShow = whatToShow ?? NodeFilter.SHOW_ALL;
|
|
27
|
-
this._currentNode = root;
|
|
28
|
-
this._walkerStack.unshift(doc.createTreeWalker(root, whatToShow, this._acceptNode));
|
|
29
|
-
const shadowRoot = root.shadowRoot;
|
|
30
|
-
if (shadowRoot) {
|
|
31
|
-
const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, { acceptNode: this._acceptNode });
|
|
32
|
-
this._walkerStack.unshift(walker);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
get currentNode() {
|
|
36
|
-
return this._currentNode;
|
|
37
|
-
}
|
|
38
|
-
set currentNode(node) {
|
|
39
|
-
if (!$23f2114a1b82827e$export$4282f70798064fe0(this.root, node)) throw new Error("Cannot set currentNode to a node that is not contained by the root node.");
|
|
40
|
-
const walkers = [];
|
|
41
|
-
let curNode = node;
|
|
42
|
-
let currentWalkerCurrentNode = node;
|
|
43
|
-
this._currentNode = node;
|
|
44
|
-
while (curNode && curNode !== this.root) if (curNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
|
|
45
|
-
const shadowRoot = curNode;
|
|
46
|
-
const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, { acceptNode: this._acceptNode });
|
|
47
|
-
walkers.push(walker);
|
|
48
|
-
walker.currentNode = currentWalkerCurrentNode;
|
|
49
|
-
this._currentSetFor.add(walker);
|
|
50
|
-
curNode = currentWalkerCurrentNode = shadowRoot.host;
|
|
51
|
-
} else curNode = curNode.parentNode;
|
|
52
|
-
const walker = this._doc.createTreeWalker(this.root, this.whatToShow, { acceptNode: this._acceptNode });
|
|
53
|
-
walkers.push(walker);
|
|
54
|
-
walker.currentNode = currentWalkerCurrentNode;
|
|
55
|
-
this._currentSetFor.add(walker);
|
|
56
|
-
this._walkerStack = walkers;
|
|
57
|
-
}
|
|
58
|
-
get doc() {
|
|
59
|
-
return this._doc;
|
|
60
|
-
}
|
|
61
|
-
firstChild() {
|
|
62
|
-
let currentNode = this.currentNode;
|
|
63
|
-
let newNode = this.nextNode();
|
|
64
|
-
if (!$23f2114a1b82827e$export$4282f70798064fe0(currentNode, newNode)) {
|
|
65
|
-
this.currentNode = currentNode;
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
if (newNode) this.currentNode = newNode;
|
|
69
|
-
return newNode;
|
|
70
|
-
}
|
|
71
|
-
lastChild() {
|
|
72
|
-
let newNode = this._walkerStack[0].lastChild();
|
|
73
|
-
if (newNode) this.currentNode = newNode;
|
|
74
|
-
return newNode;
|
|
75
|
-
}
|
|
76
|
-
nextNode() {
|
|
77
|
-
const nextNode = this._walkerStack[0].nextNode();
|
|
78
|
-
if (nextNode) {
|
|
79
|
-
if (nextNode.shadowRoot) {
|
|
80
|
-
let nodeResult;
|
|
81
|
-
if (typeof this.filter === "function") nodeResult = this.filter(nextNode);
|
|
82
|
-
else if (this.filter?.acceptNode) nodeResult = this.filter.acceptNode(nextNode);
|
|
83
|
-
if (nodeResult === NodeFilter.FILTER_ACCEPT) {
|
|
84
|
-
this.currentNode = nextNode;
|
|
85
|
-
return nextNode;
|
|
86
|
-
}
|
|
87
|
-
let newNode = this.nextNode();
|
|
88
|
-
if (newNode) this.currentNode = newNode;
|
|
89
|
-
return newNode;
|
|
90
|
-
}
|
|
91
|
-
if (nextNode) this.currentNode = nextNode;
|
|
92
|
-
return nextNode;
|
|
93
|
-
} else if (this._walkerStack.length > 1) {
|
|
94
|
-
this._walkerStack.shift();
|
|
95
|
-
let newNode = this.nextNode();
|
|
96
|
-
if (newNode) this.currentNode = newNode;
|
|
97
|
-
return newNode;
|
|
98
|
-
} else return null;
|
|
99
|
-
}
|
|
100
|
-
previousNode() {
|
|
101
|
-
const currentWalker = this._walkerStack[0];
|
|
102
|
-
if (currentWalker.currentNode === currentWalker.root) {
|
|
103
|
-
if (this._currentSetFor.has(currentWalker)) {
|
|
104
|
-
this._currentSetFor.delete(currentWalker);
|
|
105
|
-
if (this._walkerStack.length > 1) {
|
|
106
|
-
this._walkerStack.shift();
|
|
107
|
-
let newNode = this.previousNode();
|
|
108
|
-
if (newNode) this.currentNode = newNode;
|
|
109
|
-
return newNode;
|
|
110
|
-
} else return null;
|
|
111
|
-
}
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
const previousNode = currentWalker.previousNode();
|
|
115
|
-
if (previousNode) {
|
|
116
|
-
if (previousNode.shadowRoot) {
|
|
117
|
-
let nodeResult;
|
|
118
|
-
if (typeof this.filter === "function") nodeResult = this.filter(previousNode);
|
|
119
|
-
else if (this.filter?.acceptNode) nodeResult = this.filter.acceptNode(previousNode);
|
|
120
|
-
if (nodeResult === NodeFilter.FILTER_ACCEPT) {
|
|
121
|
-
if (previousNode) this.currentNode = previousNode;
|
|
122
|
-
return previousNode;
|
|
123
|
-
}
|
|
124
|
-
let newNode = this.lastChild();
|
|
125
|
-
if (newNode) this.currentNode = newNode;
|
|
126
|
-
return newNode;
|
|
127
|
-
}
|
|
128
|
-
if (previousNode) this.currentNode = previousNode;
|
|
129
|
-
return previousNode;
|
|
130
|
-
} else if (this._walkerStack.length > 1) {
|
|
131
|
-
this._walkerStack.shift();
|
|
132
|
-
let newNode = this.previousNode();
|
|
133
|
-
if (newNode) this.currentNode = newNode;
|
|
134
|
-
return newNode;
|
|
135
|
-
} else return null;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* @deprecated
|
|
139
|
-
*/ nextSibling() {
|
|
140
|
-
return null;
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* @deprecated
|
|
144
|
-
*/ previousSibling() {
|
|
145
|
-
return null;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* @deprecated
|
|
149
|
-
*/ parentNode() {
|
|
150
|
-
return null;
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
function $654b97e09f2a30c1$export$4d0f8be8b12a7ef6(doc, root, whatToShow, filter) {
|
|
154
|
-
if (shadowDOM()) return new $654b97e09f2a30c1$export$63eb3ababa9c55c4(doc, root, whatToShow, filter);
|
|
155
|
-
return doc.createTreeWalker(root, whatToShow, filter);
|
|
156
|
-
}
|
|
157
|
-
//#endregion
|
|
158
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/focus/FocusScope.mjs
|
|
159
|
-
function $535772f9d2c1f38d$var$getRadiosInGroup(element) {
|
|
160
|
-
if (!element.form) return Array.from($d447af545b77c9f1$export$b204af158042fbac(element).querySelectorAll(`input[type="radio"][name="${CSS.escape(element.name)}"]`)).filter((radio) => !radio.form);
|
|
161
|
-
const radioList = element.form.elements.namedItem(element.name);
|
|
162
|
-
let ownerWindow = $d447af545b77c9f1$export$f21a1ffae260145a(element);
|
|
163
|
-
if (radioList instanceof ownerWindow.RadioNodeList) return Array.from(radioList).filter((el) => el instanceof ownerWindow.HTMLInputElement);
|
|
164
|
-
if (radioList instanceof ownerWindow.HTMLInputElement) return [radioList];
|
|
165
|
-
return [];
|
|
166
|
-
}
|
|
167
|
-
function $535772f9d2c1f38d$var$isTabbableRadio(element) {
|
|
168
|
-
if (element.checked) return true;
|
|
169
|
-
const radios = $535772f9d2c1f38d$var$getRadiosInGroup(element);
|
|
170
|
-
return radios.length > 0 && !radios.some((radio) => radio.checked);
|
|
171
|
-
}
|
|
172
|
-
function $535772f9d2c1f38d$var$isElementInScope(element, scope) {
|
|
173
|
-
if (!element) return false;
|
|
174
|
-
if (!scope) return false;
|
|
175
|
-
return scope.some((node) => $23f2114a1b82827e$export$4282f70798064fe0(node, element));
|
|
176
|
-
}
|
|
177
|
-
function $535772f9d2c1f38d$var$focusElement(element, scroll = false) {
|
|
178
|
-
if (element != null && !scroll) try {
|
|
179
|
-
$f192c2f16961cbe0$export$80f3e147d781571c(element);
|
|
180
|
-
} catch {}
|
|
181
|
-
else if (element != null) try {
|
|
182
|
-
element.focus();
|
|
183
|
-
} catch {}
|
|
184
|
-
}
|
|
185
|
-
function $535772f9d2c1f38d$export$2d6ec8fc375ceafa(root, opts, scope) {
|
|
186
|
-
let filter = opts?.tabbable ? $3b8b240c1bf84ab9$export$bebd5a1431fec25d : $3b8b240c1bf84ab9$export$4c063cf1350e6fed;
|
|
187
|
-
let rootElement = root?.nodeType === Node.ELEMENT_NODE ? root : null;
|
|
188
|
-
let doc = $d447af545b77c9f1$export$b204af158042fbac(rootElement);
|
|
189
|
-
let walker = $654b97e09f2a30c1$export$4d0f8be8b12a7ef6(doc, root || doc, NodeFilter.SHOW_ELEMENT, { acceptNode(node) {
|
|
190
|
-
if ($23f2114a1b82827e$export$4282f70798064fe0(opts?.from, node)) return NodeFilter.FILTER_REJECT;
|
|
191
|
-
if (opts?.tabbable && node.tagName === "INPUT" && node.getAttribute("type") === "radio") {
|
|
192
|
-
if (!$535772f9d2c1f38d$var$isTabbableRadio(node)) return NodeFilter.FILTER_REJECT;
|
|
193
|
-
if (walker.currentNode.tagName === "INPUT" && walker.currentNode.type === "radio" && walker.currentNode.name === node.name) return NodeFilter.FILTER_REJECT;
|
|
194
|
-
}
|
|
195
|
-
if (filter(node) && (!scope || $535772f9d2c1f38d$var$isElementInScope(node, scope)) && (!opts?.accept || opts.accept(node))) return NodeFilter.FILTER_ACCEPT;
|
|
196
|
-
return NodeFilter.FILTER_SKIP;
|
|
197
|
-
} });
|
|
198
|
-
if (opts?.from) walker.currentNode = opts.from;
|
|
199
|
-
return walker;
|
|
200
|
-
}
|
|
201
|
-
function $535772f9d2c1f38d$export$c5251b9e124bf29(ref, defaultOptions = {}) {
|
|
202
|
-
return {
|
|
203
|
-
focusNext(opts = {}) {
|
|
204
|
-
let root = ref.current;
|
|
205
|
-
if (!root) return null;
|
|
206
|
-
let { from, tabbable = defaultOptions.tabbable, wrap = defaultOptions.wrap, accept = defaultOptions.accept } = opts;
|
|
207
|
-
let node = from || $23f2114a1b82827e$export$cd4e5573fbe2b576($d447af545b77c9f1$export$b204af158042fbac(root));
|
|
208
|
-
let walker = $535772f9d2c1f38d$export$2d6ec8fc375ceafa(root, {
|
|
209
|
-
tabbable,
|
|
210
|
-
accept
|
|
211
|
-
});
|
|
212
|
-
if ($23f2114a1b82827e$export$4282f70798064fe0(root, node)) walker.currentNode = node;
|
|
213
|
-
let nextNode = walker.nextNode();
|
|
214
|
-
if (!nextNode && wrap) {
|
|
215
|
-
walker.currentNode = root;
|
|
216
|
-
nextNode = walker.nextNode();
|
|
217
|
-
}
|
|
218
|
-
if (nextNode) $535772f9d2c1f38d$var$focusElement(nextNode, true);
|
|
219
|
-
return nextNode;
|
|
220
|
-
},
|
|
221
|
-
focusPrevious(opts = defaultOptions) {
|
|
222
|
-
let root = ref.current;
|
|
223
|
-
if (!root) return null;
|
|
224
|
-
let { from, tabbable = defaultOptions.tabbable, wrap = defaultOptions.wrap, accept = defaultOptions.accept } = opts;
|
|
225
|
-
let node = from || $23f2114a1b82827e$export$cd4e5573fbe2b576($d447af545b77c9f1$export$b204af158042fbac(root));
|
|
226
|
-
let walker = $535772f9d2c1f38d$export$2d6ec8fc375ceafa(root, {
|
|
227
|
-
tabbable,
|
|
228
|
-
accept
|
|
229
|
-
});
|
|
230
|
-
if ($23f2114a1b82827e$export$4282f70798064fe0(root, node)) walker.currentNode = node;
|
|
231
|
-
else {
|
|
232
|
-
let next = $535772f9d2c1f38d$var$last(walker);
|
|
233
|
-
if (next) $535772f9d2c1f38d$var$focusElement(next, true);
|
|
234
|
-
return next ?? null;
|
|
235
|
-
}
|
|
236
|
-
let previousNode = walker.previousNode();
|
|
237
|
-
if (!previousNode && wrap) {
|
|
238
|
-
walker.currentNode = root;
|
|
239
|
-
let lastNode = $535772f9d2c1f38d$var$last(walker);
|
|
240
|
-
if (!lastNode) return null;
|
|
241
|
-
previousNode = lastNode;
|
|
242
|
-
}
|
|
243
|
-
if (previousNode) $535772f9d2c1f38d$var$focusElement(previousNode, true);
|
|
244
|
-
return previousNode ?? null;
|
|
245
|
-
},
|
|
246
|
-
focusFirst(opts = defaultOptions) {
|
|
247
|
-
let root = ref.current;
|
|
248
|
-
if (!root) return null;
|
|
249
|
-
let { tabbable = defaultOptions.tabbable, accept = defaultOptions.accept } = opts;
|
|
250
|
-
let nextNode = $535772f9d2c1f38d$export$2d6ec8fc375ceafa(root, {
|
|
251
|
-
tabbable,
|
|
252
|
-
accept
|
|
253
|
-
}).nextNode();
|
|
254
|
-
if (nextNode) $535772f9d2c1f38d$var$focusElement(nextNode, true);
|
|
255
|
-
return nextNode;
|
|
256
|
-
},
|
|
257
|
-
focusLast(opts = defaultOptions) {
|
|
258
|
-
let root = ref.current;
|
|
259
|
-
if (!root) return null;
|
|
260
|
-
let { tabbable = defaultOptions.tabbable, accept = defaultOptions.accept } = opts;
|
|
261
|
-
let next = $535772f9d2c1f38d$var$last($535772f9d2c1f38d$export$2d6ec8fc375ceafa(root, {
|
|
262
|
-
tabbable,
|
|
263
|
-
accept
|
|
264
|
-
}));
|
|
265
|
-
if (next) $535772f9d2c1f38d$var$focusElement(next, true);
|
|
266
|
-
return next ?? null;
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
function $535772f9d2c1f38d$var$last(walker) {
|
|
271
|
-
let next = void 0;
|
|
272
|
-
let last;
|
|
273
|
-
do {
|
|
274
|
-
last = walker.lastChild();
|
|
275
|
-
if (last) next = last;
|
|
276
|
-
} while (last);
|
|
277
|
-
return next;
|
|
278
|
-
}
|
|
279
|
-
var $535772f9d2c1f38d$var$Tree = class $535772f9d2c1f38d$var$Tree {
|
|
280
|
-
constructor() {
|
|
281
|
-
this.fastMap = /* @__PURE__ */ new Map();
|
|
282
|
-
this.root = new $535772f9d2c1f38d$var$TreeNode({ scopeRef: null });
|
|
283
|
-
this.fastMap.set(null, this.root);
|
|
284
|
-
}
|
|
285
|
-
get size() {
|
|
286
|
-
return this.fastMap.size;
|
|
287
|
-
}
|
|
288
|
-
getTreeNode(data) {
|
|
289
|
-
return this.fastMap.get(data);
|
|
290
|
-
}
|
|
291
|
-
addTreeNode(scopeRef, parent, nodeToRestore) {
|
|
292
|
-
let parentNode = this.fastMap.get(parent ?? null);
|
|
293
|
-
if (!parentNode) return;
|
|
294
|
-
let node = new $535772f9d2c1f38d$var$TreeNode({ scopeRef });
|
|
295
|
-
parentNode.addChild(node);
|
|
296
|
-
node.parent = parentNode;
|
|
297
|
-
this.fastMap.set(scopeRef, node);
|
|
298
|
-
if (nodeToRestore) node.nodeToRestore = nodeToRestore;
|
|
299
|
-
}
|
|
300
|
-
addNode(node) {
|
|
301
|
-
this.fastMap.set(node.scopeRef, node);
|
|
302
|
-
}
|
|
303
|
-
removeTreeNode(scopeRef) {
|
|
304
|
-
if (scopeRef === null) return;
|
|
305
|
-
let node = this.fastMap.get(scopeRef);
|
|
306
|
-
if (!node) return;
|
|
307
|
-
let parentNode = node.parent;
|
|
308
|
-
for (let current of this.traverse()) if (current !== node && node.nodeToRestore && current.nodeToRestore && node.scopeRef && node.scopeRef.current && $535772f9d2c1f38d$var$isElementInScope(current.nodeToRestore, node.scopeRef.current)) current.nodeToRestore = node.nodeToRestore;
|
|
309
|
-
let children = node.children;
|
|
310
|
-
if (parentNode) {
|
|
311
|
-
parentNode.removeChild(node);
|
|
312
|
-
if (children.size > 0) children.forEach((child) => parentNode && parentNode.addChild(child));
|
|
313
|
-
}
|
|
314
|
-
this.fastMap.delete(node.scopeRef);
|
|
315
|
-
}
|
|
316
|
-
*traverse(node = this.root) {
|
|
317
|
-
if (node.scopeRef != null) yield node;
|
|
318
|
-
if (node.children.size > 0) for (let child of node.children) yield* this.traverse(child);
|
|
319
|
-
}
|
|
320
|
-
clone() {
|
|
321
|
-
let newTree = new $535772f9d2c1f38d$var$Tree();
|
|
322
|
-
for (let node of this.traverse()) newTree.addTreeNode(node.scopeRef, node.parent?.scopeRef ?? null, node.nodeToRestore);
|
|
323
|
-
return newTree;
|
|
324
|
-
}
|
|
325
|
-
};
|
|
326
|
-
var $535772f9d2c1f38d$var$TreeNode = class {
|
|
327
|
-
constructor(props) {
|
|
328
|
-
this.children = /* @__PURE__ */ new Set();
|
|
329
|
-
this.contain = false;
|
|
330
|
-
this.scopeRef = props.scopeRef;
|
|
331
|
-
}
|
|
332
|
-
addChild(node) {
|
|
333
|
-
this.children.add(node);
|
|
334
|
-
node.parent = this;
|
|
335
|
-
}
|
|
336
|
-
removeChild(node) {
|
|
337
|
-
this.children.delete(node);
|
|
338
|
-
node.parent = void 0;
|
|
339
|
-
}
|
|
340
|
-
};
|
|
341
|
-
new $535772f9d2c1f38d$var$Tree();
|
|
342
|
-
//#endregion
|
|
343
|
-
export { $535772f9d2c1f38d$export$c5251b9e124bf29 as n, $535772f9d2c1f38d$export$2d6ec8fc375ceafa as t };
|
package/dist/chain-DIXr2VAT.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/utils/chain.mjs
|
|
2
|
-
/**
|
|
3
|
-
* Calls all functions in the order they were chained with the same arguments.
|
|
4
|
-
*/ function $a4e76a5424781910$export$e08e3b67e392101e(...callbacks) {
|
|
5
|
-
return (...args) => {
|
|
6
|
-
for (let callback of callbacks) if (typeof callback === "function") callback(...args);
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
//#endregion
|
|
10
|
-
export { $a4e76a5424781910$export$e08e3b67e392101e as t };
|