@navikt/ds-react 6.12.0 → 6.14.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/cjs/accordion/AccordionContext.d.ts +0 -1
- package/cjs/alert/Alert.d.ts +4 -4
- package/cjs/collapsible/Collapsible.context.d.ts +0 -1
- package/cjs/date/context/useDateInputContext.d.ts +0 -1
- package/cjs/date/datepicker/parts/HeadRow.d.ts +0 -1
- package/cjs/date/datepicker/parts/HeadRow.js +2 -3
- package/cjs/date/datepicker/parts/HeadRow.js.map +1 -1
- package/cjs/date/datepicker/parts/Row.d.ts +0 -1
- package/cjs/date/datepicker/parts/TableHead.d.ts +0 -1
- package/cjs/date/datepicker/parts/WeekNumber.d.ts +0 -1
- package/cjs/date/datepicker/types.d.ts +0 -1
- package/cjs/date/monthpicker/types.d.ts +0 -1
- package/cjs/date/utils/check-dates.js +2 -2
- package/cjs/date/utils/check-dates.js.map +1 -1
- package/cjs/date/utils/get-initial-year.js +1 -2
- package/cjs/date/utils/get-initial-year.js.map +1 -1
- package/cjs/date/utils/get-month-weeks.js +2 -3
- package/cjs/date/utils/get-month-weeks.js.map +1 -1
- package/cjs/date/utils/is-match.js +2 -3
- package/cjs/date/utils/is-match.js.map +1 -1
- package/cjs/dropdown/Menu/index.d.ts +1 -1
- package/cjs/dropdown/context.d.ts +0 -1
- package/cjs/expansion-card/context.d.ts +0 -1
- package/cjs/form/checkbox/useCheckbox.d.ts +3 -3
- package/cjs/form/combobox/Combobox.d.ts +1 -1
- package/cjs/form/combobox/Combobox.js.map +1 -1
- package/cjs/form/combobox/ComboboxProvider.js +3 -1
- package/cjs/form/combobox/ComboboxProvider.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/filtered-options-util.d.ts +1 -0
- package/cjs/form/combobox/FilteredOptions/filtered-options-util.js +6 -1
- package/cjs/form/combobox/FilteredOptions/filtered-options-util.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js +5 -5
- package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js.map +1 -1
- package/cjs/form/combobox/Input/Input.context.d.ts +20 -7
- package/cjs/form/combobox/Input/Input.context.js +6 -12
- package/cjs/form/combobox/Input/Input.context.js.map +1 -1
- package/cjs/form/combobox/Input/Input.d.ts +1 -1
- package/cjs/form/combobox/Input/Input.js +42 -18
- package/cjs/form/combobox/Input/Input.js.map +1 -1
- package/cjs/form/combobox/Input/InputController.d.ts +1 -1
- package/cjs/form/combobox/Input/InputController.js.map +1 -1
- package/cjs/form/combobox/types.d.ts +8 -4
- package/cjs/form/fieldset/context.d.ts +0 -1
- package/cjs/form/fieldset/useFieldset.d.ts +1 -1
- package/cjs/form/file-upload/FileUpload.context.d.ts +0 -1
- package/cjs/form/file-upload/parts/dropzone/dropzone.types.d.ts +0 -1
- package/cjs/form/file-upload/parts/item/utils/format-file-size.js +1 -2
- package/cjs/form/file-upload/parts/item/utils/format-file-size.js.map +1 -1
- package/cjs/form/file-upload/useFileUpload.d.ts +1 -2
- package/cjs/form/file-upload/utils/is-accepted-file-type.js +1 -2
- package/cjs/form/file-upload/utils/is-accepted-file-type.js.map +1 -1
- package/cjs/form/file-upload/utils/is-accepted-size.js +1 -2
- package/cjs/form/file-upload/utils/is-accepted-size.js.map +1 -1
- package/cjs/form/radio/useRadio.d.ts +3 -3
- package/cjs/form/search/context.d.ts +0 -1
- package/cjs/layout/base/PrimitiveAsChildProps.d.ts +0 -1
- package/cjs/layout/grid/HGrid.js +4 -1
- package/cjs/layout/grid/HGrid.js.map +1 -1
- package/cjs/layout/stack/Stack.js +7 -2
- package/cjs/layout/stack/Stack.js.map +1 -1
- package/cjs/layout/utilities/css.js +2 -3
- package/cjs/layout/utilities/css.js.map +1 -1
- package/cjs/list/context.d.ts +0 -1
- package/cjs/list/types.d.ts +0 -1
- package/cjs/modal/Modal.js +3 -2
- package/cjs/modal/Modal.js.map +1 -1
- package/cjs/modal/ModalUtils.js +3 -3
- package/cjs/modal/ModalUtils.js.map +1 -1
- package/cjs/modal/types.d.ts +5 -1
- package/cjs/overlays/dismissablelayer/DismissableLayer.d.ts +1 -1
- package/cjs/overlays/dismissablelayer/util/dispatchCustomEvent.js +2 -2
- package/cjs/overlays/dismissablelayer/util/dispatchCustomEvent.js.map +1 -1
- package/cjs/overlays/dismissablelayer/util/useEscapeKeydown.js +1 -2
- package/cjs/overlays/dismissablelayer/util/useEscapeKeydown.js.map +1 -1
- package/cjs/overlays/dismissablelayer/util/useFocusOutside.js +1 -2
- package/cjs/overlays/dismissablelayer/util/useFocusOutside.js.map +1 -1
- package/cjs/overlays/dismissablelayer/util/usePointerDownOutside.js +1 -2
- package/cjs/overlays/dismissablelayer/util/usePointerDownOutside.js.map +1 -1
- package/cjs/overlays/floating/Floating.utils.js +2 -3
- package/cjs/overlays/floating/Floating.utils.js.map +1 -1
- package/cjs/slot/merge-props.js +1 -2
- package/cjs/slot/merge-props.js.map +1 -1
- package/cjs/stepper/context.d.ts +0 -1
- package/cjs/table/context.d.ts +0 -1
- package/cjs/tabs/Tabs.context.d.ts +1 -2
- package/cjs/tabs/parts/tab/useTab.d.ts +1 -2
- package/cjs/tabs/parts/tab/useTab.js +1 -2
- package/cjs/tabs/parts/tab/useTab.js.map +1 -1
- package/cjs/tabs/parts/tablist/useScrollButtons.d.ts +0 -1
- package/cjs/tabs/parts/tablist/useScrollButtons.js +1 -2
- package/cjs/tabs/parts/tablist/useScrollButtons.js.map +1 -1
- package/cjs/tabs/parts/tablist/useTabList.js +3 -3
- package/cjs/tabs/parts/tablist/useTabList.js.map +1 -1
- package/cjs/tabs/parts/tabpanel/useTabPanel.js +1 -2
- package/cjs/tabs/parts/tabpanel/useTabPanel.js.map +1 -1
- package/cjs/tabs/useTabs.d.ts +0 -1
- package/cjs/tabs/useTabs.js +1 -2
- package/cjs/tabs/useTabs.js.map +1 -1
- package/cjs/timeline/hooks/usePeriodContext.d.ts +0 -1
- package/cjs/timeline/hooks/useRowContext.d.ts +0 -1
- package/cjs/timeline/hooks/useTimelineContext.d.ts +0 -1
- package/cjs/timeline/period/types.d.ts +0 -1
- package/cjs/timeline/zoom/index.d.ts +1 -1
- package/cjs/toggle-group/ToggleGroup.context.d.ts +1 -2
- package/cjs/toggle-group/parts/useToggleItem.d.ts +1 -2
- package/cjs/toggle-group/parts/useToggleItem.js +3 -3
- package/cjs/toggle-group/parts/useToggleItem.js.map +1 -1
- package/cjs/toggle-group/useToggleGroup.d.ts +0 -1
- package/cjs/toggle-group/useToggleGroup.js +1 -2
- package/cjs/toggle-group/useToggleGroup.js.map +1 -1
- package/cjs/util/composeEventHandlers.d.ts +0 -1
- package/cjs/util/composeEventHandlers.js +1 -2
- package/cjs/util/composeEventHandlers.js.map +1 -1
- package/cjs/util/copy.js +1 -1
- package/cjs/util/copy.js.map +1 -1
- package/cjs/util/create-context.js +1 -2
- package/cjs/util/create-context.js.map +1 -1
- package/cjs/util/debounce.js +1 -1
- package/cjs/util/debounce.js.map +1 -1
- package/cjs/util/hooks/descendants/useDescendant.d.ts +1 -1
- package/cjs/util/hooks/descendants/useDescendant.js +1 -2
- package/cjs/util/hooks/descendants/useDescendant.js.map +1 -1
- package/cjs/util/hooks/descendants/utils.js +4 -4
- package/cjs/util/hooks/descendants/utils.js.map +1 -1
- package/cjs/util/hooks/useCallbackRef.d.ts +0 -1
- package/cjs/util/hooks/useCallbackRef.js +1 -2
- package/cjs/util/hooks/useCallbackRef.js.map +1 -1
- package/cjs/util/hooks/useControllableState.js +1 -2
- package/cjs/util/hooks/useControllableState.js.map +1 -1
- package/cjs/util/hooks/useId.js +1 -2
- package/cjs/util/hooks/useId.js.map +1 -1
- package/cjs/util/hooks/useMergeRefs.d.ts +1 -1
- package/cjs/util/hooks/useMergeRefs.js +2 -3
- package/cjs/util/hooks/useMergeRefs.js.map +1 -1
- package/cjs/util/i18n/get.js +1 -2
- package/cjs/util/i18n/get.js.map +1 -1
- package/cjs/util/i18n/i18n.context.d.ts +0 -1
- package/cjs/util/i18n/i18n.context.js +2 -2
- package/cjs/util/i18n/i18n.context.js.map +1 -1
- package/cjs/util/i18n/merge.js +1 -2
- package/cjs/util/i18n/merge.js.map +1 -1
- package/cjs/util/omit.js +1 -2
- package/cjs/util/omit.js.map +1 -1
- package/cjs/util/types/AsChild.d.ts +0 -1
- package/cjs/util/types/AsChildProps.d.ts +0 -1
- package/cjs/util/virtualfocus/Context.d.ts +43 -0
- package/cjs/util/virtualfocus/Context.js +9 -0
- package/cjs/util/virtualfocus/Context.js.map +1 -0
- package/cjs/util/virtualfocus/SlottedDivElement.d.ts +7 -0
- package/cjs/util/virtualfocus/SlottedDivElement.js +46 -0
- package/cjs/util/virtualfocus/SlottedDivElement.js.map +1 -0
- package/cjs/util/virtualfocus/VirtualFocus.d.ts +62 -0
- package/cjs/util/virtualfocus/VirtualFocus.js +90 -0
- package/cjs/util/virtualfocus/VirtualFocus.js.map +1 -0
- package/cjs/util/virtualfocus/parts/VirtualFocusAnchor.d.ts +33 -0
- package/cjs/util/virtualfocus/parts/VirtualFocusAnchor.js +80 -0
- package/cjs/util/virtualfocus/parts/VirtualFocusAnchor.js.map +1 -0
- package/cjs/util/virtualfocus/parts/VirtualFocusContent.d.ts +4 -0
- package/cjs/util/virtualfocus/parts/VirtualFocusContent.js +45 -0
- package/cjs/util/virtualfocus/parts/VirtualFocusContent.js.map +1 -0
- package/cjs/util/virtualfocus/parts/VirtualFocusItem.d.ts +18 -0
- package/cjs/util/virtualfocus/parts/VirtualFocusItem.js +64 -0
- package/cjs/util/virtualfocus/parts/VirtualFocusItem.js.map +1 -0
- package/esm/accordion/AccordionContext.d.ts +0 -1
- package/esm/alert/Alert.d.ts +4 -4
- package/esm/collapsible/Collapsible.context.d.ts +0 -1
- package/esm/date/context/useDateInputContext.d.ts +0 -1
- package/esm/date/datepicker/parts/HeadRow.d.ts +0 -1
- package/esm/date/datepicker/parts/Row.d.ts +0 -1
- package/esm/date/datepicker/parts/TableHead.d.ts +0 -1
- package/esm/date/datepicker/parts/WeekNumber.d.ts +0 -1
- package/esm/date/datepicker/types.d.ts +0 -1
- package/esm/date/monthpicker/types.d.ts +0 -1
- package/esm/dropdown/Menu/index.d.ts +1 -1
- package/esm/dropdown/context.d.ts +0 -1
- package/esm/expansion-card/context.d.ts +0 -1
- package/esm/form/checkbox/useCheckbox.d.ts +3 -3
- package/esm/form/combobox/Combobox.d.ts +1 -1
- package/esm/form/combobox/Combobox.js.map +1 -1
- package/esm/form/combobox/ComboboxProvider.js +3 -1
- package/esm/form/combobox/ComboboxProvider.js.map +1 -1
- package/esm/form/combobox/FilteredOptions/filtered-options-util.d.ts +1 -0
- package/esm/form/combobox/FilteredOptions/filtered-options-util.js +6 -1
- package/esm/form/combobox/FilteredOptions/filtered-options-util.js.map +1 -1
- package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js +5 -5
- package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js.map +1 -1
- package/esm/form/combobox/Input/Input.context.d.ts +20 -7
- package/esm/form/combobox/Input/Input.context.js +7 -13
- package/esm/form/combobox/Input/Input.context.js.map +1 -1
- package/esm/form/combobox/Input/Input.d.ts +1 -1
- package/esm/form/combobox/Input/Input.js +43 -19
- package/esm/form/combobox/Input/Input.js.map +1 -1
- package/esm/form/combobox/Input/InputController.d.ts +1 -1
- package/esm/form/combobox/Input/InputController.js.map +1 -1
- package/esm/form/combobox/types.d.ts +8 -4
- package/esm/form/fieldset/context.d.ts +0 -1
- package/esm/form/fieldset/useFieldset.d.ts +1 -1
- package/esm/form/file-upload/FileUpload.context.d.ts +0 -1
- package/esm/form/file-upload/parts/dropzone/dropzone.types.d.ts +0 -1
- package/esm/form/file-upload/useFileUpload.d.ts +1 -2
- package/esm/form/radio/useRadio.d.ts +3 -3
- package/esm/form/search/context.d.ts +0 -1
- package/esm/layout/base/PrimitiveAsChildProps.d.ts +0 -1
- package/esm/layout/grid/HGrid.js +4 -1
- package/esm/layout/grid/HGrid.js.map +1 -1
- package/esm/layout/stack/Stack.js +7 -2
- package/esm/layout/stack/Stack.js.map +1 -1
- package/esm/list/context.d.ts +0 -1
- package/esm/list/types.d.ts +0 -1
- package/esm/modal/Modal.js +3 -2
- package/esm/modal/Modal.js.map +1 -1
- package/esm/modal/types.d.ts +5 -1
- package/esm/overlays/dismissablelayer/DismissableLayer.d.ts +1 -1
- package/esm/stepper/context.d.ts +0 -1
- package/esm/table/context.d.ts +0 -1
- package/esm/tabs/Tabs.context.d.ts +1 -2
- package/esm/tabs/parts/tab/useTab.d.ts +1 -2
- package/esm/tabs/parts/tablist/useScrollButtons.d.ts +0 -1
- package/esm/tabs/parts/tablist/useTabList.js +2 -1
- package/esm/tabs/parts/tablist/useTabList.js.map +1 -1
- package/esm/tabs/useTabs.d.ts +0 -1
- package/esm/timeline/hooks/usePeriodContext.d.ts +0 -1
- package/esm/timeline/hooks/useRowContext.d.ts +0 -1
- package/esm/timeline/hooks/useTimelineContext.d.ts +0 -1
- package/esm/timeline/period/types.d.ts +0 -1
- package/esm/timeline/zoom/index.d.ts +1 -1
- package/esm/toggle-group/ToggleGroup.context.d.ts +1 -2
- package/esm/toggle-group/parts/useToggleItem.d.ts +1 -2
- package/esm/toggle-group/parts/useToggleItem.js +2 -1
- package/esm/toggle-group/parts/useToggleItem.js.map +1 -1
- package/esm/toggle-group/useToggleGroup.d.ts +0 -1
- package/esm/util/composeEventHandlers.d.ts +0 -1
- package/esm/util/hooks/descendants/useDescendant.d.ts +1 -1
- package/esm/util/hooks/useCallbackRef.d.ts +0 -1
- package/esm/util/hooks/useMergeRefs.d.ts +1 -1
- package/esm/util/i18n/i18n.context.d.ts +0 -1
- package/esm/util/types/AsChild.d.ts +0 -1
- package/esm/util/types/AsChildProps.d.ts +0 -1
- package/esm/util/virtualfocus/Context.d.ts +43 -0
- package/esm/util/virtualfocus/Context.js +5 -0
- package/esm/util/virtualfocus/Context.js.map +1 -0
- package/esm/util/virtualfocus/SlottedDivElement.d.ts +7 -0
- package/esm/util/virtualfocus/SlottedDivElement.js +20 -0
- package/esm/util/virtualfocus/SlottedDivElement.js.map +1 -0
- package/esm/util/virtualfocus/VirtualFocus.d.ts +62 -0
- package/esm/util/virtualfocus/VirtualFocus.js +63 -0
- package/esm/util/virtualfocus/VirtualFocus.js.map +1 -0
- package/esm/util/virtualfocus/parts/VirtualFocusAnchor.d.ts +33 -0
- package/esm/util/virtualfocus/parts/VirtualFocusAnchor.js +54 -0
- package/esm/util/virtualfocus/parts/VirtualFocusAnchor.js.map +1 -0
- package/esm/util/virtualfocus/parts/VirtualFocusContent.d.ts +4 -0
- package/esm/util/virtualfocus/parts/VirtualFocusContent.js +19 -0
- package/esm/util/virtualfocus/parts/VirtualFocusContent.js.map +1 -0
- package/esm/util/virtualfocus/parts/VirtualFocusItem.d.ts +18 -0
- package/esm/util/virtualfocus/parts/VirtualFocusItem.js +38 -0
- package/esm/util/virtualfocus/parts/VirtualFocusItem.js.map +1 -0
- package/package.json +3 -3
- package/src/alert/Alert.tsx +4 -4
- package/src/form/combobox/Combobox.tsx +4 -1
- package/src/form/combobox/ComboboxProvider.tsx +3 -0
- package/src/form/combobox/FilteredOptions/filtered-options-util.ts +9 -1
- package/src/form/combobox/FilteredOptions/filteredOptionsContext.tsx +8 -5
- package/src/form/combobox/Input/Input.context.tsx +27 -25
- package/src/form/combobox/Input/Input.tsx +56 -27
- package/src/form/combobox/Input/InputController.tsx +1 -0
- package/src/form/combobox/__tests__/combobox.test.tsx +174 -66
- package/src/form/combobox/types.ts +11 -7
- package/src/layout/grid/HGrid.tsx +4 -1
- package/src/layout/stack/Stack.tsx +6 -2
- package/src/modal/Modal.tsx +3 -1
- package/src/modal/types.ts +5 -0
- package/src/tabs/parts/tablist/useTabList.ts +4 -1
- package/src/toggle-group/parts/useToggleItem.ts +4 -1
- package/src/util/virtualfocus/Context.tsx +27 -0
- package/src/util/virtualfocus/SlottedDivElement.tsx +17 -0
- package/src/util/virtualfocus/VirtualFocus.tsx +89 -0
- package/src/util/virtualfocus/parts/VirtualFocusAnchor.tsx +102 -0
- package/src/util/virtualfocus/parts/VirtualFocusContent.tsx +17 -0
- package/src/util/virtualfocus/parts/VirtualFocusItem.tsx +60 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useCallbackRef =
|
|
3
|
+
exports.useCallbackRef = useCallbackRef;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
/**
|
|
6
6
|
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
|
@@ -15,5 +15,4 @@ function useCallbackRef(callback, deps = []) {
|
|
|
15
15
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
16
16
|
return (0, react_1.useCallback)(((...args) => { var _a; return (_a = callbackRef.current) === null || _a === void 0 ? void 0 : _a.call(callbackRef, ...args); }), deps);
|
|
17
17
|
}
|
|
18
|
-
exports.useCallbackRef = useCallbackRef;
|
|
19
18
|
//# sourceMappingURL=useCallbackRef.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCallbackRef.js","sourceRoot":"","sources":["../../../src/util/hooks/useCallbackRef.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCallbackRef.js","sourceRoot":"","sources":["../../../src/util/hooks/useCallbackRef.ts"],"names":[],"mappings":";;AAOA,wCAYC;AAnBD,iCAAuD;AAEvD;;;;GAIG;AACH,SAAgB,cAAc,CAC5B,QAAuB,EACvB,OAA6B,EAAE;IAE/B,MAAM,WAAW,GAAG,IAAA,cAAM,EAAC,QAAQ,CAAC,CAAC;IAErC,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,WAAW,CAAC,OAAO,GAAG,QAAQ,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,uDAAuD;IACvD,OAAO,IAAA,mBAAW,EAAC,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE,WAAC,OAAA,MAAA,WAAW,CAAC,OAAO,4DAAG,GAAG,IAAI,CAAC,CAAA,EAAA,CAAM,EAAE,IAAI,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useControllableState =
|
|
3
|
+
exports.useControllableState = useControllableState;
|
|
4
4
|
// https://github.com/chakra-ui/chakra-ui/tree/5ec0be610b5a69afba01a9c22365155c1b519136/packages/hooks/use-controllable-state
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const useCallbackRef_1 = require("./useCallbackRef");
|
|
@@ -22,5 +22,4 @@ function useControllableState({ value: valueProp, defaultValue, onChange, }) {
|
|
|
22
22
|
}, [controlled, onChangeProp, value]);
|
|
23
23
|
return [value, setValue];
|
|
24
24
|
}
|
|
25
|
-
exports.useControllableState = useControllableState;
|
|
26
25
|
//# sourceMappingURL=useControllableState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useControllableState.js","sourceRoot":"","sources":["../../../src/util/hooks/useControllableState.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useControllableState.js","sourceRoot":"","sources":["../../../src/util/hooks/useControllableState.ts"],"names":[],"mappings":";;AAaA,oDA0BC;AAvCD,6HAA6H;AAC7H,iCAAiC;AACjC,qDAAkD;AAQlD;;GAEG;AACH,SAAgB,oBAAoB,CAAI,EACtC,KAAK,EAAE,SAAS,EAChB,YAAY,EACZ,QAAQ,GACqB;IAC7B,MAAM,YAAY,GAAG,IAAA,+BAAc,EAAC,QAAQ,CAAC,CAAC;IAE9C,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,IAAA,gBAAQ,EAAC,YAAY,CAAC,CAAC;IACzE,MAAM,UAAU,GAAG,SAAS,KAAK,SAAS,CAAC;IAC3C,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC;IAEzD,MAAM,QAAQ,GAAG,IAAA,+BAAc,EAC7B,CAAC,IAA6B,EAAE,EAAE;QAChC,MAAM,MAAM,GAAG,IAA4B,CAAC;QAC5C,MAAM,SAAS,GAAG,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAEpE,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAClC,CAAC;QAED,YAAY,CAAC,SAAS,CAAC,CAAC;IAC1B,CAAC,EACD,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,CAAC,CAClC,CAAC;IAEF,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAU,CAAC;AACpC,CAAC"}
|
package/cjs/util/hooks/useId.js
CHANGED
|
@@ -24,7 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
return result;
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.useId =
|
|
27
|
+
exports.useId = useId;
|
|
28
28
|
//https://github.com/mui/material-ui/blob/master/packages/mui-utils/src/useId.ts
|
|
29
29
|
const react_1 = __importStar(require("react"));
|
|
30
30
|
let globalId = 0;
|
|
@@ -60,5 +60,4 @@ function useId(idOverride) {
|
|
|
60
60
|
// eslint-disable-next-line react-hooks/rules-of-hooks -- `useId` is invariant at runtime.
|
|
61
61
|
return (_a = useGlobalId(idOverride)) !== null && _a !== void 0 ? _a : "";
|
|
62
62
|
}
|
|
63
|
-
exports.useId = useId;
|
|
64
63
|
//# sourceMappingURL=useId.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useId.js","sourceRoot":"","sources":["../../../src/util/hooks/useId.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"useId.js","sourceRoot":"","sources":["../../../src/util/hooks/useId.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;AA+Bb,sBAOC;AApCD,gFAAgF;AAChF,+CAAmD;AAEnD,IAAI,QAAQ,GAAG,CAAC,CAAC;AACjB,SAAS,WAAW,CAAC,UAAmB;IACtC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,UAAU,CAAC,CAAC;IACvD,MAAM,EAAE,GAAG,UAAU,IAAI,SAAS,CAAC;IACnC,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;YACtB,6CAA6C;YAC7C,6DAA6D;YAC7D,+BAA+B;YAC/B,wHAAwH;YACxH,QAAQ,IAAI,CAAC,CAAC;YACd,YAAY,CAAC,YAAY,QAAQ,EAAE,CAAC,CAAC;QACvC,CAAC;IACH,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAChB,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,MAAM,eAAe,GAAgC,eAAa,CAChE,OAAO,GAAG,EAAE,CAAC,iEAAiE;CAC/E,CAAC;AACF;;;;;GAKG;AACH,SAAgB,KAAK,CAAC,UAAmB;;IACvC,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,eAAe,EAAE,CAAC;QAClC,OAAO,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACnD,CAAC;IACD,0FAA0F;IAC1F,OAAO,MAAA,WAAW,CAAC,UAAU,CAAC,mCAAI,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -11,5 +11,5 @@ export declare function mergeRefs<T>(refs: PossibleRef<T>[]): React.RefCallback<
|
|
|
11
11
|
* @param ...refs: React.Ref<T> | undefined
|
|
12
12
|
* @returns React.useCallback(mergeRefs(refs), refs)
|
|
13
13
|
*/
|
|
14
|
-
export declare function useMergeRefs<T>(...refs: PossibleRef<T>[]): (instance: T | null) => void;
|
|
14
|
+
export declare function useMergeRefs<T>(...refs: PossibleRef<T>[]): (instance: T | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES];
|
|
15
15
|
export {};
|
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.mergeRefs = mergeRefs;
|
|
7
|
+
exports.useMergeRefs = useMergeRefs;
|
|
7
8
|
/* https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/composeRefs.tsx */
|
|
8
9
|
const react_1 = __importDefault(require("react"));
|
|
9
10
|
// https://github.com/gregberge/react-merge-refs
|
|
@@ -23,7 +24,6 @@ function mergeRefs(refs) {
|
|
|
23
24
|
});
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
|
-
exports.mergeRefs = mergeRefs;
|
|
27
27
|
/**
|
|
28
28
|
* Merges refs within useCallback
|
|
29
29
|
* @internal
|
|
@@ -34,5 +34,4 @@ function useMergeRefs(...refs) {
|
|
|
34
34
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
35
35
|
return react_1.default.useCallback(mergeRefs(refs), refs);
|
|
36
36
|
}
|
|
37
|
-
exports.useMergeRefs = useMergeRefs;
|
|
38
37
|
//# sourceMappingURL=useMergeRefs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMergeRefs.js","sourceRoot":"","sources":["../../../src/util/hooks/useMergeRefs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useMergeRefs.js","sourceRoot":"","sources":["../../../src/util/hooks/useMergeRefs.ts"],"names":[],"mappings":";;;;;AAUA,8BAUC;AAQD,oCAGC;AA/BD,sGAAsG;AACtG,kDAA0B;AAI1B,gDAAgD;AAChD;;;GAGG;AACH,SAAgB,SAAS,CAAI,IAAsB;IACjD,OAAO,CAAC,KAAK,EAAE,EAAE;QACf,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACnB,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,CAAC;gBAC9B,GAAG,CAAC,KAAK,CAAC,CAAC;YACb,CAAC;iBAAM,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;gBAC5C,GAAwC,CAAC,OAAO,GAAG,KAAK,CAAC;YAC5D,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,YAAY,CAAI,GAAG,IAAsB;IACvD,uDAAuD;IACvD,OAAO,eAAK,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AAClD,CAAC"}
|
package/cjs/util/i18n/get.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.get =
|
|
3
|
+
exports.get = get;
|
|
4
4
|
/**
|
|
5
5
|
* https://github.com/Shopify/polaris/blob/main/polaris-react/src/utilities/get.ts#L3
|
|
6
6
|
*/
|
|
@@ -25,7 +25,6 @@ function get(keypath, ...objs) {
|
|
|
25
25
|
}
|
|
26
26
|
throw new Error("Error translating key. The keypath does not resolve to a string.");
|
|
27
27
|
}
|
|
28
|
-
exports.get = get;
|
|
29
28
|
function getKeypath(str) {
|
|
30
29
|
const path = [];
|
|
31
30
|
let result = OBJECT_NOTATION_MATCHER.exec(str);
|
package/cjs/util/i18n/get.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/util/i18n/get.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/util/i18n/get.ts"],"names":[],"mappings":";;AAOA,kBA6BC;AAlCD;;GAEG;AACH,MAAM,uBAAuB,GAAG,QAAQ,CAAC;AAEzC,SAAgB,GAAG,CACjB,OAA0B,EAC1B,GAAG,IAAuC;IAE1C,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAEpE,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,SAAS;QACX,CAAC;QAED,IAAI,GAAG,GAA+B,GAAG,CAAC;QAE1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACrC,MAAM,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YACzB,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;gBACtB,SAAS;YACX,CAAC;YACD,GAAG,GAAG,GAAG,CAAC;QACZ,CAAC;QAED,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC5B,OAAO,GAAG,CAAC;QACb,CAAC;IACH,CAAC;IAED,MAAM,IAAI,KAAK,CACb,kEAAkE,CACnE,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,GAAW;IAC7B,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,MAAM,GAAG,uBAAuB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE/C,OAAO,MAAM,EAAE,CAAC;QACd,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC;QACjC,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC;QAC3B,MAAM,GAAG,uBAAuB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.I18nContext = void 0;
|
|
7
|
+
exports.useI18n = useI18n;
|
|
7
8
|
const react_1 = require("react");
|
|
8
9
|
const get_1 = require("./get");
|
|
9
10
|
const nb_1 = __importDefault(require("./locales/nb"));
|
|
@@ -35,5 +36,4 @@ function useI18n(componentName, ...local) {
|
|
|
35
36
|
};
|
|
36
37
|
return translate;
|
|
37
38
|
}
|
|
38
|
-
exports.useI18n = useI18n;
|
|
39
39
|
//# sourceMappingURL=i18n.context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.context.js","sourceRoot":"","sources":["../../../src/util/i18n/i18n.context.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"i18n.context.js","sourceRoot":"","sources":["../../../src/util/i18n/i18n.context.ts"],"names":[],"mappings":";;;;;;AAyBA,0BAyCC;AAlED,iCAAkD;AAClD,+BAA4B;AAM5B,sDAA8B;AAE9B;;GAEG;AACH,MAAM,aAAa,GAAG,UAAU,CAAC;AAEpB,QAAA,WAAW,GAAG,IAAA,qBAAa,EAEtC,YAAE,CAAC,CAAC;AASN,SAAgB,OAAO,CACrB,aAAgB,EAChB,GAAG,KAA8C;IAEjD,MAAM,IAAI,GAAG,IAAA,kBAAU,EAAC,mBAAW,CAAC,CAAC;IAErC;;OAEG;IACH,MAAM,SAAS,GAAG,CAChB,OAAoC,EACpC,OAA2D,EAC3D,EAAE;QACF,MAAM,IAAI,GAAG,IAAA,SAAG,EACd,OAAO,EACP,GAAG,KAAK,EACR,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;YACrB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAC3B,CAAC;QAEF,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;gBAC3C,MAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;gBAEzD,IAAI,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,KAAK,SAAS,EAAE,CAAC;oBACpD,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;oBAE7D,MAAM,IAAI,KAAK,CACb,0BAA0B,OAAO,gDAAgD,WAAW,+CAA+C,eAAe,GAAG,CAC9J,CAAC;gBACJ,CAAC;gBAED,OAAO,OAAO,CAAC,YAAY,CAAC,WAAW,CAAW,CAAC,CAAC,+CAA+C;YACrG,CAAC,CAAC,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/cjs/util/i18n/merge.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.merge =
|
|
3
|
+
exports.merge = merge;
|
|
4
4
|
function merge(...objs) {
|
|
5
5
|
let final = {};
|
|
6
6
|
for (const obj of objs) {
|
|
@@ -8,7 +8,6 @@ function merge(...objs) {
|
|
|
8
8
|
}
|
|
9
9
|
return final;
|
|
10
10
|
}
|
|
11
|
-
exports.merge = merge;
|
|
12
11
|
function mergeRecursively(objA, objB) {
|
|
13
12
|
const objARes = Object.assign({}, objA);
|
|
14
13
|
for (const key in objB) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge.js","sourceRoot":"","sources":["../../../src/util/i18n/merge.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"merge.js","sourceRoot":"","sources":["../../../src/util/i18n/merge.ts"],"names":[],"mappings":";;AAEA,sBAQC;AARD,SAAgB,KAAK,CAAC,GAAG,IAA6B;IACpD,IAAI,KAAK,GAA0B,EAAE,CAAC;IAEtC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,KAAK,GAAG,gBAAgB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,gBAAgB,CACvB,IAAO,EACP,IAA+C;IAE/C,MAAM,OAAO,qBAAQ,IAAI,CAAE,CAAC;IAE5B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC;YACnB,SAAS;QACX,CAAC;QAED,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QACvB,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QAEpB,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;YACxD,OAAO,CAAC,GAAG,CAAC,GAAG,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACxC,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/cjs/util/omit.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.omit =
|
|
3
|
+
exports.omit = omit;
|
|
4
4
|
function omit(obj, props) {
|
|
5
5
|
const filteredEntries = Object.entries(obj).filter(([key]) => !props.includes(key));
|
|
6
6
|
return Object.fromEntries(filteredEntries);
|
|
7
7
|
}
|
|
8
|
-
exports.omit = omit;
|
|
9
8
|
//# sourceMappingURL=omit.js.map
|
package/cjs/util/omit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"omit.js","sourceRoot":"","sources":["../../src/util/omit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"omit.js","sourceRoot":"","sources":["../../src/util/omit.ts"],"names":[],"mappings":";;AAAA,oBASC;AATD,SAAgB,IAAI,CAClB,GAAM,EACN,KAAU;IAEV,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAChD,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAQ,CAAC,CACrC,CAAC;IAEF,OAAO,MAAM,CAAC,WAAW,CAAC,eAAe,CAAe,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from "react";
|
|
2
|
+
export declare const VirtualFocusDescendantsProvider: import("react").Provider<import("../hooks/descendants/descendant").DescendantsManager<HTMLDivElement, {
|
|
3
|
+
handleOnSelect: () => void;
|
|
4
|
+
handleOnActive: () => void;
|
|
5
|
+
}>>, useVirtualFocusDescendantsContext: <S extends boolean = true>(strict?: S) => S extends true ? import("../hooks/descendants/descendant").DescendantsManager<HTMLDivElement, {
|
|
6
|
+
handleOnSelect: () => void;
|
|
7
|
+
handleOnActive: () => void;
|
|
8
|
+
}> : import("../hooks/descendants/descendant").DescendantsManager<HTMLDivElement, {
|
|
9
|
+
handleOnSelect: () => void;
|
|
10
|
+
handleOnActive: () => void;
|
|
11
|
+
}> | undefined, useVirtualFocusDescendantInitializer: () => import("../hooks/descendants/descendant").DescendantsManager<HTMLDivElement, {
|
|
12
|
+
handleOnSelect: () => void;
|
|
13
|
+
handleOnActive: () => void;
|
|
14
|
+
}>, useVirtualFocusDescendant: (options?: import("../hooks/descendants/descendant").DescendantOptions<{
|
|
15
|
+
handleOnSelect: () => void;
|
|
16
|
+
handleOnActive: () => void;
|
|
17
|
+
}> | undefined) => {
|
|
18
|
+
descendants: import("../hooks/descendants/descendant").DescendantsManager<HTMLDivElement, {
|
|
19
|
+
handleOnSelect: () => void;
|
|
20
|
+
handleOnActive: () => void;
|
|
21
|
+
}>;
|
|
22
|
+
index: number;
|
|
23
|
+
enabledIndex: number;
|
|
24
|
+
register: (instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES];
|
|
25
|
+
};
|
|
26
|
+
export declare const VirtualFocusInternalContextProvider: import("react").ForwardRefExoticComponent<{
|
|
27
|
+
virtualFocusIdx: number;
|
|
28
|
+
setVirtualFocusIdx: Dispatch<SetStateAction<number>>;
|
|
29
|
+
loop: boolean;
|
|
30
|
+
uniqueId: string;
|
|
31
|
+
} & {
|
|
32
|
+
children: import("react").ReactNode;
|
|
33
|
+
} & import("react").RefAttributes<unknown>>, useVirtualFocusInternalContext: <S extends boolean = true>(strict?: S) => S extends true ? {
|
|
34
|
+
virtualFocusIdx: number;
|
|
35
|
+
setVirtualFocusIdx: Dispatch<SetStateAction<number>>;
|
|
36
|
+
loop: boolean;
|
|
37
|
+
uniqueId: string;
|
|
38
|
+
} : {
|
|
39
|
+
virtualFocusIdx: number;
|
|
40
|
+
setVirtualFocusIdx: Dispatch<SetStateAction<number>>;
|
|
41
|
+
loop: boolean;
|
|
42
|
+
uniqueId: string;
|
|
43
|
+
} | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a, _b;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useVirtualFocusInternalContext = exports.VirtualFocusInternalContextProvider = exports.useVirtualFocusDescendant = exports.useVirtualFocusDescendantInitializer = exports.useVirtualFocusDescendantsContext = exports.VirtualFocusDescendantsProvider = void 0;
|
|
5
|
+
const create_context_1 = require("../create-context");
|
|
6
|
+
const useDescendant_1 = require("../hooks/descendants/useDescendant");
|
|
7
|
+
_a = (0, useDescendant_1.createDescendantContext)(), exports.VirtualFocusDescendantsProvider = _a[0], exports.useVirtualFocusDescendantsContext = _a[1], exports.useVirtualFocusDescendantInitializer = _a[2], exports.useVirtualFocusDescendant = _a[3];
|
|
8
|
+
_b = (0, create_context_1.createContext)(), exports.VirtualFocusInternalContextProvider = _b[0], exports.useVirtualFocusInternalContext = _b[1];
|
|
9
|
+
//# sourceMappingURL=Context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Context.js","sourceRoot":"","sources":["../../../src/util/virtualfocus/Context.tsx"],"names":[],"mappings":";;;;AACA,sDAAkD;AAClD,sEAA6E;AAGhE,KAKT,IAAA,uCAAuB,GAMxB,EAVD,uCAA+B,UAC/B,yCAAiC,UACjC,4CAAoC,UACpC,iCAAyB,SAOvB;AAES,KAGT,IAAA,8BAAa,GAKb,EAPF,2CAAmC,UACnC,sCAA8B,SAM3B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface SlottedDivProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
asChild?: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare const SlottedDivElement: React.ForwardRefExoticComponent<SlottedDivProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
type SlottedDivElementRef = React.ElementRef<typeof SlottedDivElement>;
|
|
7
|
+
export { SlottedDivElement, type SlottedDivElementRef, type SlottedDivProps };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.SlottedDivElement = void 0;
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const Slot_1 = require("../../slot/Slot");
|
|
40
|
+
const SlottedDivElement = (0, react_1.forwardRef)((_a, forwardedRef) => {
|
|
41
|
+
var { asChild } = _a, rest = __rest(_a, ["asChild"]);
|
|
42
|
+
const Comp = asChild ? Slot_1.Slot : "div";
|
|
43
|
+
return react_1.default.createElement(Comp, Object.assign({}, rest, { ref: forwardedRef }));
|
|
44
|
+
});
|
|
45
|
+
exports.SlottedDivElement = SlottedDivElement;
|
|
46
|
+
//# sourceMappingURL=SlottedDivElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SlottedDivElement.js","sourceRoot":"","sources":["../../../src/util/virtualfocus/SlottedDivElement.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAC1C,0CAAuC;AAMvC,MAAM,iBAAiB,GAAG,IAAA,kBAAU,EAClC,CAAC,EAAoB,EAAE,YAAY,EAAE,EAAE;QAAtC,EAAE,OAAO,OAAW,EAAN,IAAI,cAAlB,WAAoB,CAAF;IACjB,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,WAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IACpC,OAAO,8BAAC,IAAI,oBAAK,IAAI,IAAE,GAAG,EAAE,YAAY,IAAI,CAAC;AAC/C,CAAC,CACF,CAAC;AAIO,8CAAiB"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type VirtualFocusProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* Whether to cause focus to loop around when it hits the first or last element
|
|
6
|
+
* @default false
|
|
7
|
+
**/
|
|
8
|
+
loop?: boolean;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A component that manages a virtual focus using the 'up' and 'down'
|
|
12
|
+
* arrow keys as well as selection with 'Return'.
|
|
13
|
+
*
|
|
14
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/virtualfocus)
|
|
15
|
+
* @see 🏷️ {@link AccordionProps}
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```jsx
|
|
19
|
+
* <VirtualFocus>
|
|
20
|
+
* <VirtualFocus.Anchor
|
|
21
|
+
* role="combobox"
|
|
22
|
+
* onSelect={() => {
|
|
23
|
+
* console.log("you selected the anchor");
|
|
24
|
+
* }}
|
|
25
|
+
* onActive={() => {
|
|
26
|
+
* console.log("the anchor is now virtually focused");
|
|
27
|
+
* }}
|
|
28
|
+
* >
|
|
29
|
+
* <input type="text" />
|
|
30
|
+
* </VirtualFocus.Anchor>
|
|
31
|
+
* <VirtualFocus.Content>
|
|
32
|
+
* <VirtualFocus.Item
|
|
33
|
+
* onSelect={() => {
|
|
34
|
+
* console.log("you selected the item");
|
|
35
|
+
* }}
|
|
36
|
+
* onActive={() => {
|
|
37
|
+
* console.log("the item is now virtually focused");
|
|
38
|
+
* }}
|
|
39
|
+
* >
|
|
40
|
+
* <p>item 1</p>
|
|
41
|
+
* </VirtualFocus.Item>
|
|
42
|
+
* <VirtualFocus.Item
|
|
43
|
+
* onSelect={() => {
|
|
44
|
+
* console.log("you selected the item");
|
|
45
|
+
* }}
|
|
46
|
+
* onActive={() => {
|
|
47
|
+
* console.log("the item is now virtually focused");
|
|
48
|
+
* }}
|
|
49
|
+
* >
|
|
50
|
+
* <p>item 2</p>
|
|
51
|
+
* </VirtualFocus.Item>
|
|
52
|
+
* </VirtualFocus.Content>
|
|
53
|
+
* </VirtualFocus>
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare const VirtualFocus: {
|
|
57
|
+
({ children, loop }: VirtualFocusProps): React.JSX.Element;
|
|
58
|
+
Anchor: React.ForwardRefExoticComponent<import("./parts/VirtualFocusAnchor").VirtualFocusAnchorProps & React.RefAttributes<HTMLInputElement>>;
|
|
59
|
+
Item: React.ForwardRefExoticComponent<import("./parts/VirtualFocusItem").VirtualFocusItemProps & React.RefAttributes<HTMLElement>>;
|
|
60
|
+
Content: React.ForwardRefExoticComponent<import("./parts/VirtualFocusContent").VirtualFocusContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
61
|
+
};
|
|
62
|
+
export default VirtualFocus;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.VirtualFocus = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const hooks_1 = require("../../util/hooks");
|
|
29
|
+
const Context_1 = require("./Context");
|
|
30
|
+
const VirtualFocusAnchor_1 = require("./parts/VirtualFocusAnchor");
|
|
31
|
+
const VirtualFocusContent_1 = require("./parts/VirtualFocusContent");
|
|
32
|
+
const VirtualFocusItem_1 = require("./parts/VirtualFocusItem");
|
|
33
|
+
/**
|
|
34
|
+
* A component that manages a virtual focus using the 'up' and 'down'
|
|
35
|
+
* arrow keys as well as selection with 'Return'.
|
|
36
|
+
*
|
|
37
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/virtualfocus)
|
|
38
|
+
* @see 🏷️ {@link AccordionProps}
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```jsx
|
|
42
|
+
* <VirtualFocus>
|
|
43
|
+
* <VirtualFocus.Anchor
|
|
44
|
+
* role="combobox"
|
|
45
|
+
* onSelect={() => {
|
|
46
|
+
* console.log("you selected the anchor");
|
|
47
|
+
* }}
|
|
48
|
+
* onActive={() => {
|
|
49
|
+
* console.log("the anchor is now virtually focused");
|
|
50
|
+
* }}
|
|
51
|
+
* >
|
|
52
|
+
* <input type="text" />
|
|
53
|
+
* </VirtualFocus.Anchor>
|
|
54
|
+
* <VirtualFocus.Content>
|
|
55
|
+
* <VirtualFocus.Item
|
|
56
|
+
* onSelect={() => {
|
|
57
|
+
* console.log("you selected the item");
|
|
58
|
+
* }}
|
|
59
|
+
* onActive={() => {
|
|
60
|
+
* console.log("the item is now virtually focused");
|
|
61
|
+
* }}
|
|
62
|
+
* >
|
|
63
|
+
* <p>item 1</p>
|
|
64
|
+
* </VirtualFocus.Item>
|
|
65
|
+
* <VirtualFocus.Item
|
|
66
|
+
* onSelect={() => {
|
|
67
|
+
* console.log("you selected the item");
|
|
68
|
+
* }}
|
|
69
|
+
* onActive={() => {
|
|
70
|
+
* console.log("the item is now virtually focused");
|
|
71
|
+
* }}
|
|
72
|
+
* >
|
|
73
|
+
* <p>item 2</p>
|
|
74
|
+
* </VirtualFocus.Item>
|
|
75
|
+
* </VirtualFocus.Content>
|
|
76
|
+
* </VirtualFocus>
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
const VirtualFocus = ({ children, loop = false }) => {
|
|
80
|
+
const descendants = (0, Context_1.useVirtualFocusDescendantInitializer)();
|
|
81
|
+
const [virtualFocusIdx, setVirtualFocusIdx] = (0, react_1.useState)(0);
|
|
82
|
+
return (react_1.default.createElement(Context_1.VirtualFocusInternalContextProvider, { virtualFocusIdx: virtualFocusIdx, setVirtualFocusIdx: setVirtualFocusIdx, loop: loop, uniqueId: (0, hooks_1.useId)() },
|
|
83
|
+
react_1.default.createElement(Context_1.VirtualFocusDescendantsProvider, { value: descendants }, children)));
|
|
84
|
+
};
|
|
85
|
+
exports.VirtualFocus = VirtualFocus;
|
|
86
|
+
exports.VirtualFocus.Anchor = VirtualFocusAnchor_1.VirtualFocusAnchor;
|
|
87
|
+
exports.VirtualFocus.Item = VirtualFocusItem_1.VirtualFocusItem;
|
|
88
|
+
exports.VirtualFocus.Content = VirtualFocusContent_1.VirtualFocusContent;
|
|
89
|
+
exports.default = exports.VirtualFocus;
|
|
90
|
+
//# sourceMappingURL=VirtualFocus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VirtualFocus.js","sourceRoot":"","sources":["../../../src/util/virtualfocus/VirtualFocus.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAwC;AACxC,4CAAyC;AACzC,uCAImB;AACnB,mEAAgE;AAChE,qEAAkE;AAClE,+DAA4D;AAW5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACI,MAAM,YAAY,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,GAAG,KAAK,EAAqB,EAAE,EAAE;IAC5E,MAAM,WAAW,GAAG,IAAA,8CAAoC,GAAE,CAAC;IAC3D,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,CAAC;IAE1D,OAAO,CACL,8BAAC,6CAAmC,IAClC,eAAe,EAAE,eAAe,EAChC,kBAAkB,EAAE,kBAAkB,EACtC,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,IAAA,aAAK,GAAE;QAEjB,8BAAC,yCAA+B,IAAC,KAAK,EAAE,WAAW,IAChD,QAAQ,CACuB,CACE,CACvC,CAAC;AACJ,CAAC,CAAC;AAhBW,QAAA,YAAY,gBAgBvB;AAEF,oBAAY,CAAC,MAAM,GAAG,uCAAkB,CAAC;AACzC,oBAAY,CAAC,IAAI,GAAG,mCAAgB,CAAC;AACrC,oBAAY,CAAC,OAAO,GAAG,yCAAmB,CAAC;AAE3C,kBAAe,oBAAY,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface VirtualFocusAnchorProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "id"> {
|
|
3
|
+
/**
|
|
4
|
+
* The role of the container. This is a limited subset of roles that
|
|
5
|
+
* require manual focus management.
|
|
6
|
+
*
|
|
7
|
+
* Children that are to get focus inside this container element shall be
|
|
8
|
+
* pointed to by `aria-activedescendant`.
|
|
9
|
+
**/
|
|
10
|
+
role: "combobox" | "grid" | "listbox" | "menu" | "menubar" | "radiogroup" | "tree" | "treegrid" | "tablist";
|
|
11
|
+
/**
|
|
12
|
+
* The function that is run when the focused element
|
|
13
|
+
* is to be selected (eg. do an actual search, change route... etc)
|
|
14
|
+
*/
|
|
15
|
+
onSelect: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* The function that is run when the element gets
|
|
18
|
+
* virtual focus set to it.
|
|
19
|
+
*/
|
|
20
|
+
onActive: () => void;
|
|
21
|
+
children: React.ReactElement;
|
|
22
|
+
/**
|
|
23
|
+
* Set this to `0` if you want the Anchor itself
|
|
24
|
+
* to be focusable. Since this Anchor is hoisted & merged with
|
|
25
|
+
* its first child, you most likely want to keep this as `0`.
|
|
26
|
+
* @default 0
|
|
27
|
+
*/
|
|
28
|
+
tabIndex?: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Must have a single child that is an input element.
|
|
32
|
+
*/
|
|
33
|
+
export declare const VirtualFocusAnchor: React.ForwardRefExoticComponent<VirtualFocusAnchorProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.VirtualFocusAnchor = void 0;
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const Slot_1 = require("../../../slot/Slot");
|
|
40
|
+
const composeEventHandlers_1 = require("../../composeEventHandlers");
|
|
41
|
+
const hooks_1 = require("../../hooks");
|
|
42
|
+
const Context_1 = require("../Context");
|
|
43
|
+
/**
|
|
44
|
+
* Must have a single child that is an input element.
|
|
45
|
+
*/
|
|
46
|
+
exports.VirtualFocusAnchor = (0, react_1.forwardRef)((_a, ref) => {
|
|
47
|
+
var { onSelect, onActive, children } = _a, rest = __rest(_a, ["onSelect", "onActive", "children"]);
|
|
48
|
+
const { virtualFocusIdx, setVirtualFocusIdx, loop, uniqueId } = (0, Context_1.useVirtualFocusInternalContext)();
|
|
49
|
+
const { register, descendants, index } = (0, Context_1.useVirtualFocusDescendant)({
|
|
50
|
+
handleOnActive: () => {
|
|
51
|
+
setVirtualFocusIdx(0);
|
|
52
|
+
onActive();
|
|
53
|
+
},
|
|
54
|
+
handleOnSelect: onSelect,
|
|
55
|
+
});
|
|
56
|
+
const mergedRefs = (0, hooks_1.useMergeRefs)(ref, register);
|
|
57
|
+
return (react_1.default.createElement(Slot_1.Slot, Object.assign({ ref: mergedRefs, tabIndex: 0 }, rest, { id: `virtualfocus-${uniqueId}-${index}`, "aria-owns": `virtualfocus-${uniqueId}-content`, "aria-controls": `virtualfocus-${uniqueId}-content`, "aria-activedescendant": `virtualfocus-${uniqueId}-${virtualFocusIdx}`, onKeyDown: (0, composeEventHandlers_1.composeEventHandlers)(rest.onKeyDown, (event) => {
|
|
58
|
+
if (event.key === "ArrowDown") {
|
|
59
|
+
event.preventDefault();
|
|
60
|
+
const to_focus_descendant = descendants.next(virtualFocusIdx, loop);
|
|
61
|
+
if (to_focus_descendant) {
|
|
62
|
+
to_focus_descendant.handleOnActive();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else if (event.key === "ArrowUp") {
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
const to_focus_descendant = descendants.prev(virtualFocusIdx, loop);
|
|
68
|
+
if (to_focus_descendant) {
|
|
69
|
+
to_focus_descendant.handleOnActive();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else if (event.key === "Enter") {
|
|
73
|
+
const curr = descendants.item(virtualFocusIdx);
|
|
74
|
+
if (curr === null || curr === void 0 ? void 0 : curr.handleOnSelect) {
|
|
75
|
+
curr.handleOnSelect();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}) }), children));
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=VirtualFocusAnchor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VirtualFocusAnchor.js","sourceRoot":"","sources":["../../../../src/util/virtualfocus/parts/VirtualFocusAnchor.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAC1C,6CAA0C;AAC1C,qEAAkE;AAClE,uCAA2C;AAC3C,wCAGoB;AAyCpB;;GAEG;AACU,QAAA,kBAAkB,GAAG,IAAA,kBAAU,EAG1C,CAAC,EAAyC,EAAE,GAAG,EAAE,EAAE;QAAlD,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,OAAW,EAAN,IAAI,cAAvC,oCAAyC,CAAF;IACxC,MAAM,EAAE,eAAe,EAAE,kBAAkB,EAAE,IAAI,EAAE,QAAQ,EAAE,GAC3D,IAAA,wCAA8B,GAAE,CAAC;IAEnC,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,IAAA,mCAAyB,EAAC;QACjE,cAAc,EAAE,GAAG,EAAE;YACnB,kBAAkB,CAAC,CAAC,CAAC,CAAC;YACtB,QAAQ,EAAE,CAAC;QACb,CAAC;QACD,cAAc,EAAE,QAAQ;KACzB,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,IAAA,oBAAY,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAE/C,OAAO,CACL,8BAAC,WAAI,kBACH,GAAG,EAAE,UAAU,EACf,QAAQ,EAAE,CAAC,IACP,IAAI,IACR,EAAE,EAAE,gBAAgB,QAAQ,IAAI,KAAK,EAAE,eAC5B,gBAAgB,QAAQ,UAAU,mBAC9B,gBAAgB,QAAQ,UAAU,2BAC1B,gBAAgB,QAAQ,IAAI,eAAe,EAAE,EACpE,SAAS,EAAE,IAAA,2CAAoB,EAAC,IAAI,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;YACxD,IAAI,KAAK,CAAC,GAAG,KAAK,WAAW,EAAE,CAAC;gBAC9B,KAAK,CAAC,cAAc,EAAE,CAAC;gBACvB,MAAM,mBAAmB,GAAG,WAAW,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;gBACpE,IAAI,mBAAmB,EAAE,CAAC;oBACxB,mBAAmB,CAAC,cAAc,EAAE,CAAC;gBACvC,CAAC;YACH,CAAC;iBAAM,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;gBACnC,KAAK,CAAC,cAAc,EAAE,CAAC;gBACvB,MAAM,mBAAmB,GAAG,WAAW,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;gBACpE,IAAI,mBAAmB,EAAE,CAAC;oBACxB,mBAAmB,CAAC,cAAc,EAAE,CAAC;gBACvC,CAAC;YACH,CAAC;iBAAM,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC;gBACjC,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;gBAC/C,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,cAAc,EAAE,CAAC;oBACzB,IAAI,CAAC,cAAc,EAAE,CAAC;gBACxB,CAAC;YACH,CAAC;QACH,CAAC,CAAC,KAED,QAAQ,CACJ,CACR,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface VirtualFocusContentProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "id"> {
|
|
3
|
+
}
|
|
4
|
+
export declare const VirtualFocusContent: React.ForwardRefExoticComponent<VirtualFocusContentProps & React.RefAttributes<HTMLDivElement>>;
|