@navikt/ds-react 8.7.0 → 8.8.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/alert/base-alert/root/BaseAlertRoot.js +1 -2
- package/cjs/alert/base-alert/root/BaseAlertRoot.js.map +1 -1
- package/cjs/alert/info-card/index.d.ts +2 -2
- package/cjs/alert/info-card/index.js +2 -1
- package/cjs/alert/info-card/index.js.map +1 -1
- package/cjs/alert/info-card/message/InfoCardMessage.d.ts +23 -0
- package/cjs/alert/info-card/message/InfoCardMessage.js +73 -0
- package/cjs/alert/info-card/message/InfoCardMessage.js.map +1 -0
- package/cjs/alert/info-card/root/InfoCardRoot.d.ts +15 -2
- package/cjs/alert/info-card/root/InfoCardRoot.js +4 -1
- package/cjs/alert/info-card/root/InfoCardRoot.js.map +1 -1
- package/cjs/data/drag-and-drop/drag-handler/DataDragAndDropDragHandler.d.ts +21 -0
- package/cjs/data/drag-and-drop/drag-handler/DataDragAndDropDragHandler.js +24 -0
- package/cjs/data/drag-and-drop/drag-handler/DataDragAndDropDragHandler.js.map +1 -0
- package/cjs/data/drag-and-drop/item/DataDragAndDropItem.js +7 -57
- package/cjs/data/drag-and-drop/item/DataDragAndDropItem.js.map +1 -1
- package/cjs/data/drag-and-drop/root/DataDragAndDrop.context.d.ts +4 -1
- package/cjs/data/drag-and-drop/root/DataDragAndDrop.context.js +7 -3
- package/cjs/data/drag-and-drop/root/DataDragAndDrop.context.js.map +1 -1
- package/cjs/data/drag-and-drop/root/DataDragAndDropRoot.d.ts +12 -2
- package/cjs/data/drag-and-drop/root/DataDragAndDropRoot.js +14 -64
- package/cjs/data/drag-and-drop/root/DataDragAndDropRoot.js.map +1 -1
- package/cjs/data/drag-and-drop-old/drag-handler/DataDragAndDropDragHandler.d.ts +22 -0
- package/cjs/data/drag-and-drop-old/drag-handler/DataDragAndDropDragHandler.js +35 -0
- package/cjs/data/drag-and-drop-old/drag-handler/DataDragAndDropDragHandler.js.map +1 -0
- package/cjs/data/drag-and-drop-old/item/DataDragAndDropItem.d.ts +27 -0
- package/cjs/data/drag-and-drop-old/item/DataDragAndDropItem.js +86 -0
- package/cjs/data/drag-and-drop-old/item/DataDragAndDropItem.js.map +1 -0
- package/cjs/data/drag-and-drop-old/root/DataDragAndDrop.context.d.ts +5 -0
- package/cjs/data/drag-and-drop-old/root/DataDragAndDrop.context.js +6 -0
- package/cjs/data/drag-and-drop-old/root/DataDragAndDrop.context.js.map +1 -0
- package/cjs/data/drag-and-drop-old/root/DataDragAndDropRoot.d.ts +24 -0
- package/cjs/data/drag-and-drop-old/root/DataDragAndDropRoot.js +108 -0
- package/cjs/data/drag-and-drop-old/root/DataDragAndDropRoot.js.map +1 -0
- package/cjs/data/table/empty-state/DataTableEmptyState.d.ts +5 -0
- package/cjs/data/table/empty-state/DataTableEmptyState.js +57 -0
- package/cjs/data/table/empty-state/DataTableEmptyState.js.map +1 -0
- package/cjs/data/table/helpers/table-focus.js +7 -1
- package/cjs/data/table/helpers/table-focus.js.map +1 -1
- package/cjs/data/table/helpers/table-keyboard.d.ts +0 -1
- package/cjs/data/table/helpers/table-keyboard.js +2 -4
- package/cjs/data/table/helpers/table-keyboard.js.map +1 -1
- package/cjs/data/table/loading-state/DataTableLoadingState.d.ts +5 -0
- package/cjs/data/table/loading-state/DataTableLoadingState.js +57 -0
- package/cjs/data/table/loading-state/DataTableLoadingState.js.map +1 -0
- package/cjs/data/table/root/DataTable.types.d.ts +13 -0
- package/cjs/data/table/root/DataTable.types.js +3 -0
- package/cjs/data/table/root/DataTable.types.js.map +1 -0
- package/cjs/data/table/root/DataTableAuto.d.ts +60 -0
- package/cjs/data/table/root/DataTableAuto.js +99 -0
- package/cjs/data/table/root/DataTableAuto.js.map +1 -0
- package/cjs/data/table/root/DataTableRoot.context.d.ts +3 -2
- package/cjs/data/table/root/DataTableRoot.context.js.map +1 -1
- package/cjs/data/table/root/DataTableRoot.d.ts +30 -3
- package/cjs/data/table/root/DataTableRoot.js +8 -2
- package/cjs/data/table/root/DataTableRoot.js.map +1 -1
- package/cjs/data/table/root/useTableKeyboardNav.js +1 -0
- package/cjs/data/table/root/useTableKeyboardNav.js.map +1 -1
- package/cjs/data/table/root/useTableSelection.d.ts +55 -0
- package/cjs/data/table/root/useTableSelection.js +79 -0
- package/cjs/data/table/root/useTableSelection.js.map +1 -0
- package/cjs/data/table/td/DataTableTd.d.ts +10 -0
- package/cjs/data/table/td/DataTableTd.js +4 -2
- package/cjs/data/table/td/DataTableTd.js.map +1 -1
- package/cjs/data/table/th/DataTableTh.d.ts +10 -4
- package/cjs/data/table/th/DataTableTh.js +24 -22
- package/cjs/data/table/th/DataTableTh.js.map +1 -1
- package/cjs/data/table/th/useTableColumnResize.d.ts +64 -0
- package/cjs/data/table/th/useTableColumnResize.js +144 -0
- package/cjs/data/table/th/useTableColumnResize.js.map +1 -0
- package/cjs/data/table/thead/DataTableThead.context.d.ts +4 -0
- package/cjs/data/table/thead/DataTableThead.context.js +45 -0
- package/cjs/data/table/thead/DataTableThead.context.js.map +1 -0
- package/cjs/data/table/thead/DataTableThead.js +3 -1
- package/cjs/data/table/thead/DataTableThead.js.map +1 -1
- package/cjs/data/table/tr/DataTableTr.js +4 -3
- package/cjs/data/table/tr/DataTableTr.js.map +1 -1
- package/cjs/data/token-filter/AutoSuggest.js +4 -6
- package/cjs/data/token-filter/AutoSuggest.js.map +1 -1
- package/cjs/date/Date.Input.js +1 -1
- package/cjs/date/Date.Input.js.map +1 -1
- package/cjs/date/datepicker/hooks/useDatepicker.d.ts +12 -1
- package/cjs/date/datepicker/hooks/useDatepicker.js.map +1 -1
- package/cjs/date/monthpicker/hooks/useMonthPicker.d.ts +11 -1
- package/cjs/date/monthpicker/hooks/useMonthPicker.js.map +1 -1
- package/cjs/form/checkbox/CheckboxGroup.js +1 -1
- package/cjs/form/checkbox/CheckboxGroup.js.map +1 -1
- package/cjs/form/fieldset/Fieldset.d.ts +25 -5
- package/cjs/form/fieldset/Fieldset.js +19 -2
- package/cjs/form/fieldset/Fieldset.js.map +1 -1
- package/cjs/form/radio/RadioGroup.js +1 -1
- package/cjs/form/radio/RadioGroup.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/read-more/ReadMore.d.ts +10 -0
- package/cjs/read-more/ReadMore.js +4 -6
- package/cjs/read-more/ReadMore.js.map +1 -1
- package/cjs/types/index.d.ts +1 -1
- package/cjs/types/index.js +0 -15
- package/cjs/types/index.js.map +1 -1
- package/cjs/utils/components/Listbox/input-slot/ListboxInputSlot.js +1 -1
- package/cjs/utils/components/Listbox/input-slot/ListboxInputSlot.js.map +1 -1
- package/cjs/utils/components/Listbox/option/ListboxOption.d.ts +24 -0
- package/cjs/utils/components/Listbox/{item/ListboxItem.js → option/ListboxOption.js} +8 -8
- package/cjs/utils/components/Listbox/option/ListboxOption.js.map +1 -0
- package/cjs/utils/components/Listbox/options/ListboxOptions.d.ts +8 -0
- package/cjs/utils/components/Listbox/{list/ListboxList.js → options/ListboxOptions.js} +8 -8
- package/cjs/utils/components/Listbox/options/ListboxOptions.js.map +1 -0
- package/cjs/utils/components/Listbox/root/ListboxRoot.d.ts +6 -6
- package/cjs/utils/components/Listbox/root/ListboxRoot.js +28 -28
- package/cjs/utils/components/Listbox/root/ListboxRoot.js.map +1 -1
- package/cjs/utils/components/Listbox/root/domHelpers.d.ts +3 -3
- package/cjs/utils/components/Listbox/root/domHelpers.js +8 -8
- package/cjs/utils/components/Listbox/root/domHelpers.js.map +1 -1
- package/cjs/utils/components/floating/Floating.d.ts +1 -1
- package/cjs/utils/components/floating/Floating.js +1 -1
- package/cjs/utils/components/floating/Floating.js.map +1 -1
- package/cjs/utils/components/focus-boundary/FocusBoundary.d.ts +0 -1
- package/cjs/utils/components/focus-boundary/FocusBoundary.js +1 -1
- package/cjs/utils/components/focus-boundary/FocusBoundary.js.map +1 -1
- package/cjs/utils/components/link-anchor/LinkAnchor.js +10 -0
- package/cjs/utils/components/link-anchor/LinkAnchor.js.map +1 -1
- package/cjs/utils/helpers/className.js +1 -1
- package/cjs/utils/helpers/className.js.map +1 -1
- package/cjs/utils/helpers/focus.d.ts +3 -1
- package/cjs/utils/helpers/focus.js +2 -2
- package/cjs/utils/helpers/focus.js.map +1 -1
- package/cjs/utils/helpers/index.d.ts +9 -9
- package/cjs/utils/helpers/index.js +22 -23
- package/cjs/utils/helpers/index.js.map +1 -1
- package/cjs/utils/hooks/index.d.ts +13 -13
- package/cjs/utils/hooks/index.js +31 -28
- package/cjs/utils/hooks/index.js.map +1 -1
- package/cjs/utils/hooks/useScrollLock.js +41 -11
- package/cjs/utils/hooks/useScrollLock.js.map +1 -1
- package/esm/alert/base-alert/root/BaseAlertRoot.js +1 -2
- package/esm/alert/base-alert/root/BaseAlertRoot.js.map +1 -1
- package/esm/alert/info-card/index.d.ts +2 -2
- package/esm/alert/info-card/index.js +1 -1
- package/esm/alert/info-card/index.js.map +1 -1
- package/esm/alert/info-card/message/InfoCardMessage.d.ts +23 -0
- package/esm/alert/info-card/message/InfoCardMessage.js +37 -0
- package/esm/alert/info-card/message/InfoCardMessage.js.map +1 -0
- package/esm/alert/info-card/root/InfoCardRoot.d.ts +15 -2
- package/esm/alert/info-card/root/InfoCardRoot.js +3 -1
- package/esm/alert/info-card/root/InfoCardRoot.js.map +1 -1
- package/esm/data/drag-and-drop/drag-handler/DataDragAndDropDragHandler.d.ts +21 -0
- package/esm/data/drag-and-drop/drag-handler/DataDragAndDropDragHandler.js +18 -0
- package/esm/data/drag-and-drop/drag-handler/DataDragAndDropDragHandler.js.map +1 -0
- package/esm/data/drag-and-drop/item/DataDragAndDropItem.js +4 -24
- package/esm/data/drag-and-drop/item/DataDragAndDropItem.js.map +1 -1
- package/esm/data/drag-and-drop/root/DataDragAndDrop.context.d.ts +4 -1
- package/esm/data/drag-and-drop/root/DataDragAndDrop.context.js +5 -2
- package/esm/data/drag-and-drop/root/DataDragAndDrop.context.js.map +1 -1
- package/esm/data/drag-and-drop/root/DataDragAndDropRoot.d.ts +12 -2
- package/esm/data/drag-and-drop/root/DataDragAndDropRoot.js +15 -65
- package/esm/data/drag-and-drop/root/DataDragAndDropRoot.js.map +1 -1
- package/esm/data/drag-and-drop-old/drag-handler/DataDragAndDropDragHandler.d.ts +22 -0
- package/esm/data/drag-and-drop-old/drag-handler/DataDragAndDropDragHandler.js +29 -0
- package/esm/data/drag-and-drop-old/drag-handler/DataDragAndDropDragHandler.js.map +1 -0
- package/esm/data/drag-and-drop-old/item/DataDragAndDropItem.d.ts +27 -0
- package/esm/data/drag-and-drop-old/item/DataDragAndDropItem.js +50 -0
- package/esm/data/drag-and-drop-old/item/DataDragAndDropItem.js.map +1 -0
- package/esm/data/drag-and-drop-old/root/DataDragAndDrop.context.d.ts +5 -0
- package/esm/data/drag-and-drop-old/root/DataDragAndDrop.context.js +3 -0
- package/esm/data/drag-and-drop-old/root/DataDragAndDrop.context.js.map +1 -0
- package/esm/data/drag-and-drop-old/root/DataDragAndDropRoot.d.ts +24 -0
- package/esm/data/drag-and-drop-old/root/DataDragAndDropRoot.js +68 -0
- package/esm/data/drag-and-drop-old/root/DataDragAndDropRoot.js.map +1 -0
- package/esm/data/table/empty-state/DataTableEmptyState.d.ts +5 -0
- package/esm/data/table/empty-state/DataTableEmptyState.js +21 -0
- package/esm/data/table/empty-state/DataTableEmptyState.js.map +1 -0
- package/esm/data/table/helpers/table-focus.js +7 -1
- package/esm/data/table/helpers/table-focus.js.map +1 -1
- package/esm/data/table/helpers/table-keyboard.d.ts +0 -1
- package/esm/data/table/helpers/table-keyboard.js +2 -4
- package/esm/data/table/helpers/table-keyboard.js.map +1 -1
- package/esm/data/table/loading-state/DataTableLoadingState.d.ts +5 -0
- package/esm/data/table/loading-state/DataTableLoadingState.js +21 -0
- package/esm/data/table/loading-state/DataTableLoadingState.js.map +1 -0
- package/esm/data/table/root/DataTable.types.d.ts +13 -0
- package/esm/data/table/root/DataTable.types.js +2 -0
- package/esm/data/table/root/DataTable.types.js.map +1 -0
- package/esm/data/table/root/DataTableAuto.d.ts +60 -0
- package/esm/data/table/root/DataTableAuto.js +63 -0
- package/esm/data/table/root/DataTableAuto.js.map +1 -0
- package/esm/data/table/root/DataTableRoot.context.d.ts +3 -2
- package/esm/data/table/root/DataTableRoot.context.js.map +1 -1
- package/esm/data/table/root/DataTableRoot.d.ts +30 -3
- package/esm/data/table/root/DataTableRoot.js +6 -2
- package/esm/data/table/root/DataTableRoot.js.map +1 -1
- package/esm/data/table/root/useTableKeyboardNav.js +1 -0
- package/esm/data/table/root/useTableKeyboardNav.js.map +1 -1
- package/esm/data/table/root/useTableSelection.d.ts +55 -0
- package/esm/data/table/root/useTableSelection.js +77 -0
- package/esm/data/table/root/useTableSelection.js.map +1 -0
- package/esm/data/table/td/DataTableTd.d.ts +10 -0
- package/esm/data/table/td/DataTableTd.js +4 -2
- package/esm/data/table/td/DataTableTd.js.map +1 -1
- package/esm/data/table/th/DataTableTh.d.ts +10 -4
- package/esm/data/table/th/DataTableTh.js +25 -23
- package/esm/data/table/th/DataTableTh.js.map +1 -1
- package/esm/data/table/th/useTableColumnResize.d.ts +64 -0
- package/esm/data/table/th/useTableColumnResize.js +142 -0
- package/esm/data/table/th/useTableColumnResize.js.map +1 -0
- package/esm/data/table/thead/DataTableThead.context.d.ts +4 -0
- package/esm/data/table/thead/DataTableThead.context.js +8 -0
- package/esm/data/table/thead/DataTableThead.context.js.map +1 -0
- package/esm/data/table/thead/DataTableThead.js +3 -1
- package/esm/data/table/thead/DataTableThead.js.map +1 -1
- package/esm/data/table/tr/DataTableTr.js +4 -3
- package/esm/data/table/tr/DataTableTr.js.map +1 -1
- package/esm/data/token-filter/AutoSuggest.js +4 -6
- package/esm/data/token-filter/AutoSuggest.js.map +1 -1
- package/esm/date/Date.Input.js +1 -1
- package/esm/date/Date.Input.js.map +1 -1
- package/esm/date/datepicker/hooks/useDatepicker.d.ts +12 -1
- package/esm/date/datepicker/hooks/useDatepicker.js.map +1 -1
- package/esm/date/monthpicker/hooks/useMonthPicker.d.ts +11 -1
- package/esm/date/monthpicker/hooks/useMonthPicker.js.map +1 -1
- package/esm/form/checkbox/CheckboxGroup.js +1 -1
- package/esm/form/checkbox/CheckboxGroup.js.map +1 -1
- package/esm/form/fieldset/Fieldset.d.ts +25 -5
- package/esm/form/fieldset/Fieldset.js +19 -2
- package/esm/form/fieldset/Fieldset.js.map +1 -1
- package/esm/form/radio/RadioGroup.js +1 -1
- package/esm/form/radio/RadioGroup.js.map +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js.map +1 -1
- package/esm/read-more/ReadMore.d.ts +10 -0
- package/esm/read-more/ReadMore.js +4 -6
- package/esm/read-more/ReadMore.js.map +1 -1
- package/esm/types/index.d.ts +1 -1
- package/esm/types/index.js +1 -1
- package/esm/types/index.js.map +1 -1
- package/esm/utils/components/Listbox/input-slot/ListboxInputSlot.js +1 -1
- package/esm/utils/components/Listbox/input-slot/ListboxInputSlot.js.map +1 -1
- package/esm/utils/components/Listbox/option/ListboxOption.d.ts +24 -0
- package/esm/utils/components/Listbox/{item/ListboxItem.js → option/ListboxOption.js} +7 -7
- package/esm/utils/components/Listbox/option/ListboxOption.js.map +1 -0
- package/esm/utils/components/Listbox/options/ListboxOptions.d.ts +8 -0
- package/esm/utils/components/Listbox/{list/ListboxList.js → options/ListboxOptions.js} +8 -8
- package/esm/utils/components/Listbox/options/ListboxOptions.js.map +1 -0
- package/esm/utils/components/Listbox/root/ListboxRoot.d.ts +6 -6
- package/esm/utils/components/Listbox/root/ListboxRoot.js +29 -29
- package/esm/utils/components/Listbox/root/ListboxRoot.js.map +1 -1
- package/esm/utils/components/Listbox/root/domHelpers.d.ts +3 -3
- package/esm/utils/components/Listbox/root/domHelpers.js +7 -7
- package/esm/utils/components/Listbox/root/domHelpers.js.map +1 -1
- package/esm/utils/components/floating/Floating.d.ts +1 -1
- package/esm/utils/components/floating/Floating.js +1 -1
- package/esm/utils/components/floating/Floating.js.map +1 -1
- package/esm/utils/components/focus-boundary/FocusBoundary.d.ts +0 -1
- package/esm/utils/components/focus-boundary/FocusBoundary.js +1 -1
- package/esm/utils/components/focus-boundary/FocusBoundary.js.map +1 -1
- package/esm/utils/components/link-anchor/LinkAnchor.js +10 -0
- package/esm/utils/components/link-anchor/LinkAnchor.js.map +1 -1
- package/esm/utils/helpers/className.js +1 -1
- package/esm/utils/helpers/className.js.map +1 -1
- package/esm/utils/helpers/focus.d.ts +3 -1
- package/esm/utils/helpers/focus.js +2 -2
- package/esm/utils/helpers/focus.js.map +1 -1
- package/esm/utils/helpers/index.d.ts +9 -9
- package/esm/utils/helpers/index.js +9 -9
- package/esm/utils/helpers/index.js.map +1 -1
- package/esm/utils/hooks/index.d.ts +13 -13
- package/esm/utils/hooks/index.js +13 -13
- package/esm/utils/hooks/index.js.map +1 -1
- package/esm/utils/hooks/useScrollLock.js +41 -11
- package/esm/utils/hooks/useScrollLock.js.map +1 -1
- package/package.json +5 -5
- package/src/alert/base-alert/root/BaseAlertRoot.tsx +1 -1
- package/src/alert/info-card/index.ts +2 -0
- package/src/alert/info-card/message/InfoCardMessage.tsx +48 -0
- package/src/alert/info-card/root/InfoCardRoot.tsx +20 -1
- package/src/data/drag-and-drop/drag-handler/DataDragAndDropDragHandler.tsx +63 -0
- package/src/data/drag-and-drop/item/DataDragAndDropItem.tsx +6 -53
- package/src/data/drag-and-drop/root/DataDragAndDrop.context.tsx +9 -4
- package/src/data/drag-and-drop/root/DataDragAndDropRoot.tsx +19 -63
- package/src/data/drag-and-drop-old/drag-handler/DataDragAndDropDragHandler.tsx +104 -0
- package/src/data/drag-and-drop-old/item/DataDragAndDropItem.tsx +74 -0
- package/src/data/drag-and-drop-old/root/DataDragAndDrop.context.tsx +11 -0
- package/src/data/drag-and-drop-old/root/DataDragAndDropRoot.tsx +96 -0
- package/src/data/table/empty-state/DataTableEmptyState.tsx +26 -0
- package/src/data/table/helpers/table-focus.ts +10 -1
- package/src/data/table/helpers/table-keyboard.ts +2 -6
- package/src/data/table/loading-state/DataTableLoadingState.tsx +26 -0
- package/src/data/table/root/DataTable.types.ts +16 -0
- package/src/data/table/root/DataTableAuto.tsx +182 -0
- package/src/data/table/root/DataTableRoot.context.ts +3 -2
- package/src/data/table/root/DataTableRoot.tsx +45 -2
- package/src/data/table/root/useTableKeyboardNav.ts +1 -0
- package/src/data/table/root/useTableSelection.ts +126 -0
- package/src/data/table/td/DataTableTd.tsx +14 -1
- package/src/data/table/th/DataTableTh.tsx +48 -36
- package/src/data/table/th/useTableColumnResize.ts +276 -0
- package/src/data/table/thead/DataTableThead.context.ts +10 -0
- package/src/data/table/thead/DataTableThead.tsx +8 -5
- package/src/data/table/tr/DataTableTr.tsx +8 -3
- package/src/data/token-filter/AutoSuggest.tsx +11 -12
- package/src/date/Date.Input.tsx +1 -1
- package/src/date/datepicker/hooks/useDatepicker.tsx +12 -1
- package/src/date/monthpicker/hooks/useMonthPicker.tsx +11 -1
- package/src/form/checkbox/CheckboxGroup.tsx +1 -1
- package/src/form/fieldset/Fieldset.tsx +31 -7
- package/src/form/radio/RadioGroup.tsx +1 -1
- package/src/index.ts +1 -0
- package/src/read-more/ReadMore.tsx +15 -16
- package/src/types/index.ts +1 -1
- package/src/utils/components/Listbox/input-slot/ListboxInputSlot.tsx +1 -1
- package/src/utils/components/Listbox/{item/ListboxItem.tsx → option/ListboxOption.tsx} +14 -14
- package/src/utils/components/Listbox/{list/ListboxList.tsx → options/ListboxOptions.tsx} +10 -10
- package/src/utils/components/Listbox/root/ListboxRoot.tsx +31 -31
- package/src/utils/components/Listbox/root/domHelpers.ts +8 -7
- package/src/utils/components/floating/Floating.tsx +2 -2
- package/src/utils/components/focus-boundary/FocusBoundary.tsx +1 -2
- package/src/utils/components/link-anchor/LinkAnchor.tsx +11 -0
- package/src/utils/helpers/className.ts +1 -1
- package/src/utils/helpers/focus.ts +5 -2
- package/src/utils/helpers/index.ts +9 -9
- package/src/utils/hooks/index.ts +20 -13
- package/src/utils/hooks/useScrollLock.ts +57 -13
- package/cjs/utils/components/Listbox/item/ListboxItem.d.ts +0 -24
- package/cjs/utils/components/Listbox/item/ListboxItem.js.map +0 -1
- package/cjs/utils/components/Listbox/list/ListboxList.d.ts +0 -8
- package/cjs/utils/components/Listbox/list/ListboxList.js.map +0 -1
- package/esm/utils/components/Listbox/item/ListboxItem.d.ts +0 -24
- package/esm/utils/components/Listbox/item/ListboxItem.js.map +0 -1
- package/esm/utils/components/Listbox/list/ListboxList.d.ts +0 -8
- package/esm/utils/components/Listbox/list/ListboxList.js.map +0 -1
|
@@ -13,6 +13,7 @@ import React, { forwardRef } from "react";
|
|
|
13
13
|
import { BaseAlert } from "../../base-alert/index.js";
|
|
14
14
|
import { InfoCardContent, } from "../content/InfoCardContent.js";
|
|
15
15
|
import { InfoCardHeader, } from "../header/InfoCardHeader.js";
|
|
16
|
+
import { InfoCardMessage, } from "../message/InfoCardMessage.js";
|
|
16
17
|
import { InfoCardTitle } from "../title/InfoCardTitle.js";
|
|
17
18
|
/**
|
|
18
19
|
* A component for displaying informational content in a card format.
|
|
@@ -35,6 +36,7 @@ export const InfoCard = forwardRef((_a, forwardedRef) => {
|
|
|
35
36
|
InfoCard.Header = InfoCardHeader;
|
|
36
37
|
InfoCard.Title = InfoCardTitle;
|
|
37
38
|
InfoCard.Content = InfoCardContent;
|
|
39
|
+
InfoCard.Message = InfoCardMessage;
|
|
38
40
|
export default InfoCard;
|
|
39
|
-
export { InfoCardContent, InfoCardHeader, InfoCardTitle };
|
|
41
|
+
export { InfoCardContent, InfoCardHeader, InfoCardTitle, InfoCardMessage };
|
|
40
42
|
//# sourceMappingURL=InfoCardRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoCardRoot.js","sourceRoot":"","sources":["../../../../src/alert/info-card/root/InfoCardRoot.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACL,eAAe,GAEhB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,cAAc,GAEf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAA2B,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"InfoCardRoot.js","sourceRoot":"","sources":["../../../../src/alert/info-card/root/InfoCardRoot.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACL,eAAe,GAEhB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,cAAc,GAEf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,GAEhB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAA2B,MAAM,wBAAwB,CAAC;AA6EhF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAChC,CACE,EAIgB,EAChB,YAAY,EACZ,EAAE;QANF,EACE,YAAY,EAAE,SAAS,GAAG,MAAM,EAChC,EAAE,GAAG,KAAK,OAEI,EADX,SAAS,cAHd,oBAIC,CADa;IAId,OAAO,CACL,oBAAC,SAAS,CAAC,IAAI,kBACb,GAAG,EAAE,YAAY,gBACL,SAAS,IACjB,SAAS,IACb,IAAI,EAAC,UAAU,EACf,MAAM,EAAE,KAAK,EACb,EAAE,EAAE,EAAE,IACN,CACH,CAAC;AACJ,CAAC,CACmB,CAAC;AAEvB,QAAQ,CAAC,MAAM,GAAG,cAAc,CAAC;AACjC,QAAQ,CAAC,KAAK,GAAG,aAAa,CAAC;AAC/B,QAAQ,CAAC,OAAO,GAAG,eAAe,CAAC;AACnC,QAAQ,CAAC,OAAO,GAAG,eAAe,CAAC;AAEnC,eAAe,QAAQ,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface DataDragAndDropDragHandlerProps {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the drag handler is disabled
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Wether dragging is done by keyboard. Used to conditionally render drag indicators.
|
|
8
|
+
*/
|
|
9
|
+
keyboardDragging?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Handle ref is forwarded to the button element serving as drag handle.
|
|
12
|
+
*/
|
|
13
|
+
handleRef: React.Ref<HTMLDivElement>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* DataDragAndDropDragHandler
|
|
17
|
+
*
|
|
18
|
+
* A button component that serves as a drag handle for drag and drop operations.
|
|
19
|
+
* Can be used to initiate dragging of elements in a data table or list.
|
|
20
|
+
*/
|
|
21
|
+
export declare const DataDragAndDropDragHandler: React.ForwardRefExoticComponent<DataDragAndDropDragHandlerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CaretDownCircleFillIcon, CaretUpCircleFillIcon, DragVerticalIcon, } from "@navikt/aksel-icons";
|
|
3
|
+
/**
|
|
4
|
+
* DataDragAndDropDragHandler
|
|
5
|
+
*
|
|
6
|
+
* A button component that serves as a drag handle for drag and drop operations.
|
|
7
|
+
* Can be used to initiate dragging of elements in a data table or list.
|
|
8
|
+
*/
|
|
9
|
+
export const DataDragAndDropDragHandler = React.forwardRef(({ keyboardDragging, handleRef }) => {
|
|
10
|
+
return (React.createElement("div", { className: "aksel-data-drag-and-drop__drag-handler__alt" },
|
|
11
|
+
keyboardDragging && (React.createElement("span", { className: "aksel-data-drag-and-drop__drag-handler__arrow", "data-direction": "up" },
|
|
12
|
+
React.createElement(CaretUpCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" }))),
|
|
13
|
+
React.createElement("div", { ref: handleRef, className: "aksel-data-drag-and-drop__drag-handler__button" },
|
|
14
|
+
React.createElement(DragVerticalIcon, { "aria-hidden": true, title: "Dra for \u00E5 flytte", fontSize: "1.5rem" })),
|
|
15
|
+
keyboardDragging && (React.createElement("span", { className: "aksel-data-drag-and-drop__drag-handler__arrow", "data-direction": "down" },
|
|
16
|
+
React.createElement(CaretDownCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" })))));
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=DataDragAndDropDragHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataDragAndDropDragHandler.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop/drag-handler/DataDragAndDropDragHandler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAiB7B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAC,UAAU,CAGxD,CAAC,EAAE,gBAAgB,EAAE,SAAS,EAAE,EAAE,EAAE;IACpC,OAAO,CACL,6BAAK,SAAS,EAAC,6CAA6C;QACzD,gBAAgB,IAAI,CACnB,8BACE,SAAS,EAAC,+CAA+C,oBAC1C,IAAI;YAEnB,oBAAC,qBAAqB,yBAAa,QAAQ,EAAC,QAAQ,GAAG,CAClD,CACR;QACD,6BACE,GAAG,EAAE,SAAS,EACd,SAAS,EAAC,gDAAgD;YAE1D,oBAAC,gBAAgB,yBAEf,KAAK,EAAC,uBAAkB,EACxB,QAAQ,EAAC,QAAQ,GACjB,CACE;QACL,gBAAgB,IAAI,CACnB,8BACE,SAAS,EAAC,+CAA+C,oBAC1C,MAAM;YAErB,oBAAC,uBAAuB,yBAAa,QAAQ,EAAC,QAAQ,GAAG,CACpD,CACR,CACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -9,13 +9,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import
|
|
13
|
-
import React, { useRef } from "react";
|
|
14
|
-
import { CaretDownCircleFillIcon, CaretUpCircleFillIcon, DragVerticalIcon, } from "@navikt/aksel-icons";
|
|
12
|
+
import React from "react";
|
|
15
13
|
import { HStack } from "../../../primitives/stack/index.js";
|
|
16
14
|
import { cl } from "../../../utils/helpers/index.js";
|
|
17
|
-
import { useMergeRefs } from "../../../utils/hooks/index.js";
|
|
18
|
-
import { DataDragAndDropContext } from "../root/DataDragAndDrop.context.js";
|
|
19
15
|
/**
|
|
20
16
|
* TODO
|
|
21
17
|
*
|
|
@@ -28,26 +24,10 @@ import { DataDragAndDropContext } from "../root/DataDragAndDrop.context.js";
|
|
|
28
24
|
* ```
|
|
29
25
|
*/
|
|
30
26
|
const DataDragAndDropItem = React.forwardRef((_a, forwardedRef) => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const { ref, isDragging, isDropTarget } = useSortable({
|
|
34
|
-
id,
|
|
35
|
-
index,
|
|
36
|
-
handle: handleRef,
|
|
37
|
-
});
|
|
38
|
-
const mergedRef = useMergeRefs(ref, forwardedRef);
|
|
39
|
-
const context = React.useContext(DataDragAndDropContext);
|
|
40
|
-
const mouseDragging = isDragging && (context === null || context === void 0 ? void 0 : context.inputMethod) === "mouse";
|
|
41
|
-
const mouseDropTarget = isDropTarget && (context === null || context === void 0 ? void 0 : context.inputMethod) === "mouse";
|
|
42
|
-
const keyboardDragging = isDragging && (context === null || context === void 0 ? void 0 : context.inputMethod) === "keyboard";
|
|
27
|
+
// const context = useDataDragAndDropContext();
|
|
28
|
+
var { children, className } = _a, rest = __rest(_a, ["children", "className"]);
|
|
43
29
|
return (React.createElement(HStack, { gap: "space-8", align: "center", wrap: false, asChild: true },
|
|
44
|
-
React.createElement("div", Object.assign({ ref:
|
|
45
|
-
React.createElement("div", { className: "aksel-data-table__drag-and-drop-item-drag-handler", ref: handleRef },
|
|
46
|
-
keyboardDragging && (React.createElement("span", { className: "aksel-data-table__drag-and-drop-item-keyboard-drag-icon", "data-direction": "up" },
|
|
47
|
-
React.createElement(CaretUpCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" }))),
|
|
48
|
-
React.createElement(DragVerticalIcon, { "aria-hidden": true, title: "Dra for \u00E5 flytte", fontSize: "1.5rem" }),
|
|
49
|
-
keyboardDragging && (React.createElement("span", { className: "aksel-data-table__drag-and-drop-item-keyboard-drag-icon", "data-direction": "down" },
|
|
50
|
-
React.createElement(CaretDownCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" })))),
|
|
30
|
+
React.createElement("div", Object.assign({ ref: forwardedRef }, rest, { className: cl("aksel-data-table__drag-and-drop-item", className) }),
|
|
51
31
|
React.createElement("div", null, children))));
|
|
52
32
|
});
|
|
53
33
|
export default DataDragAndDropItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataDragAndDropItem.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop/item/DataDragAndDropItem.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"DataDragAndDropItem.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop/item/DataDragAndDropItem.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAc5C;;;;;;;;;;GAUG;AACH,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAG1C,CAAC,EAAgC,EAAE,YAAY,EAAE,EAAE;IACnD,+CAA+C;QAD9C,EAAE,QAAQ,EAAE,SAAS,OAAW,EAAN,IAAI,cAA9B,yBAAgC,CAAF;IAG/B,OAAO,CACL,oBAAC,MAAM,IAAC,GAAG,EAAC,SAAS,EAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAE,KAAK,EAAE,OAAO;QAEvD,2CACE,GAAG,EAAE,YAAY,IACb,IAAI,IACR,SAAS,EAAE,EAAE,CAAC,sCAAsC,EAAE,SAAS,CAAC;YAMhE,iCAAM,QAAQ,CAAO,CACjB,CACC,CACV,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
interface DataDragAndDropContextType {
|
|
2
2
|
inputMethod: "mouse" | "keyboard" | null;
|
|
3
3
|
}
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const DataDragAndDropProvider: import("react").FC<DataDragAndDropContextType & {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
ref?: never;
|
|
7
|
+
}>, useDataDragAndDropContext: <S extends boolean = true>(strict?: S | undefined) => S extends true ? DataDragAndDropContextType | undefined : DataDragAndDropContextType | undefined;
|
|
5
8
|
export {};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const
|
|
1
|
+
import { createStrictContext } from "../../../utils/helpers/index.js";
|
|
2
|
+
export const { Provider: DataDragAndDropProvider, useContext: useDataDragAndDropContext, } = createStrictContext({
|
|
3
|
+
errorMessage: "useDataDragAndDropContext must be used within a DataDragAndDropProvider",
|
|
4
|
+
name: "DataDragAndDropContext",
|
|
5
|
+
});
|
|
3
6
|
//# sourceMappingURL=DataDragAndDrop.context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataDragAndDrop.context.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop/root/DataDragAndDrop.context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"DataDragAndDrop.context.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop/root/DataDragAndDrop.context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAM7D,MAAM,CAAC,MAAM,EACX,QAAQ,EAAE,uBAAuB,EACjC,UAAU,EAAE,yBAAyB,GACtC,GAAG,mBAAmB,CAAyC;IAC9D,YAAY,EACV,yEAAyE;IAC3E,IAAI,EAAE,wBAAwB;CAC/B,CAAC,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import DataDragAndDropItem, { DataDragAndDropItemProps } from "../item/DataDragAndDropItem.js";
|
|
3
|
-
interface DataDragAndDropProps extends React.HTMLAttributes<
|
|
3
|
+
interface DataDragAndDropProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
children: any[];
|
|
5
5
|
setItems: React.Dispatch<React.SetStateAction<any[]>>;
|
|
6
6
|
}
|
|
7
|
-
interface DataDragAndDropRootComponent extends React.ForwardRefExoticComponent<DataDragAndDropProps & React.RefAttributes<
|
|
7
|
+
interface DataDragAndDropRootComponent extends React.ForwardRefExoticComponent<DataDragAndDropProps & React.RefAttributes<HTMLDivElement>> {
|
|
8
8
|
/**
|
|
9
9
|
* @see 🏷️ {@link DataDragAndDropItemProps}
|
|
10
10
|
* * @example
|
|
@@ -18,6 +18,16 @@ interface DataDragAndDropRootComponent extends React.ForwardRefExoticComponent<D
|
|
|
18
18
|
*/
|
|
19
19
|
Item: typeof DataDragAndDropItem;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* TODO
|
|
23
|
+
* setItems on root
|
|
24
|
+
* state : active element
|
|
25
|
+
* pointer over listener / state, onPointerEnter, onPointerLeave
|
|
26
|
+
* Overlay - Use floating component
|
|
27
|
+
* Keyboard navigation
|
|
28
|
+
* Handle - button, arrows also button
|
|
29
|
+
* UU - announce on drag start, item moved, drag end
|
|
30
|
+
*/
|
|
21
31
|
declare const DataDragAndDrop: DataDragAndDropRootComponent;
|
|
22
32
|
export { DataDragAndDrop, DataDragAndDropItem };
|
|
23
33
|
export default DataDragAndDrop;
|
|
@@ -1,69 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { DragDropProvider, DragOverlay } from "@dnd-kit/react";
|
|
13
|
-
import { isSortable } from "@dnd-kit/react/sortable";
|
|
14
|
-
import React, { forwardRef, isValidElement } from "react";
|
|
15
|
-
import { VStack } from "../../../primitives/stack/index.js";
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
16
2
|
import DataDragAndDropItem from "../item/DataDragAndDropItem.js";
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return (React.createElement(
|
|
30
|
-
React.createElement(
|
|
31
|
-
// TODO Look into overriding default keybinds, might eliminate context need
|
|
32
|
-
, {
|
|
33
|
-
// TODO Look into overriding default keybinds, might eliminate context need
|
|
34
|
-
onBeforeDragStart: (event) => {
|
|
35
|
-
var _a;
|
|
36
|
-
return setInputMethod(((_a = event.operation.activatorEvent) === null || _a === void 0 ? void 0 : _a.type) === "pointerdown"
|
|
37
|
-
? "mouse"
|
|
38
|
-
: "keyboard");
|
|
39
|
-
}, onDragOver: (event) => {
|
|
40
|
-
var _a;
|
|
41
|
-
if (((_a = event.operation.activatorEvent) === null || _a === void 0 ? void 0 : _a.type) === "pointerdown") {
|
|
42
|
-
// Prevents items to rearrange while dragging with mouse, but allows keyboard dragging to work as intended
|
|
43
|
-
event.preventDefault();
|
|
44
|
-
}
|
|
45
|
-
}, onDragEnd: (event) => {
|
|
46
|
-
var _a;
|
|
47
|
-
if (((_a = event.operation.activatorEvent) === null || _a === void 0 ? void 0 : _a.type) === "pointerdown") {
|
|
48
|
-
const { source, target } = event.operation;
|
|
49
|
-
if (!isSortable(source) || !isSortable(target))
|
|
50
|
-
return;
|
|
51
|
-
setItemOrder(source.initialIndex, target.index);
|
|
52
|
-
}
|
|
53
|
-
} },
|
|
54
|
-
React.createElement(VStack, { asChild: true, gap: "space-12" },
|
|
55
|
-
React.createElement("div", Object.assign({}, rest, { ref: forwardedRef }), children)),
|
|
56
|
-
React.createElement(DragOverlay, null, (source) => {
|
|
57
|
-
// Overlay not needed and causes glitching when using keyboard
|
|
58
|
-
if (inputMethod === "keyboard")
|
|
59
|
-
return null;
|
|
60
|
-
if (!isSortable(source))
|
|
61
|
-
return null;
|
|
62
|
-
if (isValidElement(children[source.initialIndex])) {
|
|
63
|
-
return children[source.initialIndex];
|
|
64
|
-
}
|
|
65
|
-
return null;
|
|
66
|
-
}))));
|
|
3
|
+
import { DataDragAndDropProvider } from "./DataDragAndDrop.context.js";
|
|
4
|
+
/**
|
|
5
|
+
* TODO
|
|
6
|
+
* setItems on root
|
|
7
|
+
* state : active element
|
|
8
|
+
* pointer over listener / state, onPointerEnter, onPointerLeave
|
|
9
|
+
* Overlay - Use floating component
|
|
10
|
+
* Keyboard navigation
|
|
11
|
+
* Handle - button, arrows also button
|
|
12
|
+
* UU - announce on drag start, item moved, drag end
|
|
13
|
+
*/
|
|
14
|
+
const DataDragAndDrop = forwardRef(({ children }, forwardedRef) => {
|
|
15
|
+
return (React.createElement(DataDragAndDropProvider, { inputMethod: null },
|
|
16
|
+
React.createElement("div", { ref: forwardedRef }, children)));
|
|
67
17
|
});
|
|
68
18
|
DataDragAndDrop.Item = DataDragAndDropItem;
|
|
69
19
|
export { DataDragAndDrop, DataDragAndDropItem };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataDragAndDropRoot.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop/root/DataDragAndDropRoot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataDragAndDropRoot.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop/root/DataDragAndDropRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,mBAEN,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAwBpE;;;;;;;;;GASG;AAEH,MAAM,eAAe,GAAG,UAAU,CAChC,CAAC,EAAE,QAAQ,EAAE,EAAE,YAAY,EAAE,EAAE;IAC7B,OAAO,CACL,oBAAC,uBAAuB,IAAC,WAAW,EAAE,IAAI;QACxC,6BAAK,GAAG,EAAE,YAAY,IAAG,QAAQ,CAAO,CAChB,CAC3B,CAAC;AACJ,CAAC,CAC8B,CAAC;AAElC,eAAe,CAAC,IAAI,GAAG,mBAAmB,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,CAAC;AAChD,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface DataDragAndDropDragHandlerProps {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the drag handler is disabled
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Wether dragging is done by keyboard. Used to conditionally render drag indicators.
|
|
8
|
+
*/
|
|
9
|
+
keyboardDragging?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Handle ref is forwarded to the button element serving as drag handle.
|
|
12
|
+
*/
|
|
13
|
+
handleRef: React.Ref<HTMLDivElement>;
|
|
14
|
+
alt?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* DataDragAndDropDragHandler
|
|
18
|
+
*
|
|
19
|
+
* A button component that serves as a drag handle for drag and drop operations.
|
|
20
|
+
* Can be used to initiate dragging of elements in a data table or list.
|
|
21
|
+
*/
|
|
22
|
+
export declare const DataDragAndDropDragHandler: React.ForwardRefExoticComponent<DataDragAndDropDragHandlerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CaretDownCircleFillIcon, CaretUpCircleFillIcon, DragVerticalIcon, } from "@navikt/aksel-icons";
|
|
3
|
+
import { Floating } from "../../../utils/components/floating/Floating.js";
|
|
4
|
+
/**
|
|
5
|
+
* DataDragAndDropDragHandler
|
|
6
|
+
*
|
|
7
|
+
* A button component that serves as a drag handle for drag and drop operations.
|
|
8
|
+
* Can be used to initiate dragging of elements in a data table or list.
|
|
9
|
+
*/
|
|
10
|
+
export const DataDragAndDropDragHandler = React.forwardRef(({ keyboardDragging, handleRef, alt }) => {
|
|
11
|
+
if (alt) {
|
|
12
|
+
return (React.createElement("div", { className: "aksel-data-drag-and-drop__drag-handler__alt" },
|
|
13
|
+
keyboardDragging && (React.createElement("span", { className: "aksel-data-drag-and-drop__drag-handler__arrow", "data-direction": "up" },
|
|
14
|
+
React.createElement(CaretUpCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" }))),
|
|
15
|
+
React.createElement("div", { ref: handleRef, className: "aksel-data-drag-and-drop__drag-handler__button" },
|
|
16
|
+
React.createElement(DragVerticalIcon, { "aria-hidden": true, title: "Dra for \u00E5 flytte", fontSize: "1.5rem" })),
|
|
17
|
+
keyboardDragging && (React.createElement("span", { className: "aksel-data-drag-and-drop__drag-handler__arrow", "data-direction": "down" },
|
|
18
|
+
React.createElement(CaretDownCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" })))));
|
|
19
|
+
}
|
|
20
|
+
return (React.createElement(Floating, null,
|
|
21
|
+
keyboardDragging && (React.createElement(Floating.Content, { side: "top", avoidCollisions: false, updatePositionStrategy: "always", className: "aksel-data-drag-and-drop__drag-handler__arrow" },
|
|
22
|
+
React.createElement(CaretUpCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" }))),
|
|
23
|
+
React.createElement(Floating.Anchor, { asChild: true },
|
|
24
|
+
React.createElement("div", { ref: handleRef, className: "aksel-data-drag-and-drop__drag-handler__button" },
|
|
25
|
+
React.createElement(DragVerticalIcon, { "aria-hidden": true, title: "Dra for \u00E5 flytte", fontSize: "1.5rem" }))),
|
|
26
|
+
keyboardDragging && (React.createElement(Floating.Content, { avoidCollisions: false, updatePositionStrategy: "always", className: "aksel-data-drag-and-drop__drag-handler__arrow" },
|
|
27
|
+
React.createElement(CaretDownCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" })))));
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=DataDragAndDropDragHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataDragAndDropDragHandler.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop-old/drag-handler/DataDragAndDropDragHandler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AAmBvE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAC,UAAU,CAGxD,CAAC,EAAE,gBAAgB,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,EAAE;IACzC,IAAI,GAAG,EAAE,CAAC;QACR,OAAO,CACL,6BAAK,SAAS,EAAC,6CAA6C;YACzD,gBAAgB,IAAI,CACnB,8BACE,SAAS,EAAC,+CAA+C,oBAC1C,IAAI;gBAEnB,oBAAC,qBAAqB,yBAAa,QAAQ,EAAC,QAAQ,GAAG,CAClD,CACR;YACD,6BACE,GAAG,EAAE,SAAS,EACd,SAAS,EAAC,gDAAgD;gBAE1D,oBAAC,gBAAgB,yBAEf,KAAK,EAAC,uBAAkB,EACxB,QAAQ,EAAC,QAAQ,GACjB,CACE;YACL,gBAAgB,IAAI,CACnB,8BACE,SAAS,EAAC,+CAA+C,oBAC1C,MAAM;gBAErB,oBAAC,uBAAuB,yBAAa,QAAQ,EAAC,QAAQ,GAAG,CACpD,CACR,CACG,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,oBAAC,QAAQ;QACN,gBAAgB,IAAI,CACnB,oBAAC,QAAQ,CAAC,OAAO,IACf,IAAI,EAAC,KAAK,EACV,eAAe,EAAE,KAAK,EACtB,sBAAsB,EAAC,QAAQ,EAC/B,SAAS,EAAC,+CAA+C;YAEzD,oBAAC,qBAAqB,yBAAa,QAAQ,EAAC,QAAQ,GAAG,CACtC,CACpB;QACD,oBAAC,QAAQ,CAAC,MAAM,IAAC,OAAO;YACtB,6BACE,GAAG,EAAE,SAAS,EACd,SAAS,EAAC,gDAAgD;gBAE1D,oBAAC,gBAAgB,yBAEf,KAAK,EAAC,uBAAkB,EACxB,QAAQ,EAAC,QAAQ,GACjB,CACE,CACU;QACjB,gBAAgB,IAAI,CACnB,oBAAC,QAAQ,CAAC,OAAO,IACf,eAAe,EAAE,KAAK,EACtB,sBAAsB,EAAC,QAAQ,EAC/B,SAAS,EAAC,+CAA+C;YAEzD,oBAAC,uBAAuB,yBAAa,QAAQ,EAAC,QAAQ,GAAG,CACxC,CACpB,CACQ,CACZ,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface DataDragAndDropItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* Unique id
|
|
6
|
+
*/
|
|
7
|
+
id: string;
|
|
8
|
+
/**
|
|
9
|
+
* Index of the item being dragged
|
|
10
|
+
*/
|
|
11
|
+
index: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* TODO
|
|
15
|
+
*
|
|
16
|
+
* @see 🏷️ {@link DataDragAndDropItemProps}
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <DragAndDrop.Item numOfSelectedRows={selectedRows.length} onClear={handleClear}>
|
|
20
|
+
* TODO
|
|
21
|
+
* </DragAndDrop.Item>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare const DataDragAndDropItem: React.ForwardRefExoticComponent<DataDragAndDropItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
export default DataDragAndDropItem;
|
|
26
|
+
export { DataDragAndDropItem };
|
|
27
|
+
export type { DataDragAndDropItemProps };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { useSortable } from "@dnd-kit/react/sortable";
|
|
13
|
+
import React, { useRef } from "react";
|
|
14
|
+
import { HStack } from "../../../primitives/stack/index.js";
|
|
15
|
+
import { cl } from "../../../utils/helpers/index.js";
|
|
16
|
+
import { useMergeRefs } from "../../../utils/hooks/index.js";
|
|
17
|
+
import { DataDragAndDropDragHandler } from "../drag-handler/DataDragAndDropDragHandler.js";
|
|
18
|
+
import { DataDragAndDropContext } from "../root/DataDragAndDrop.context.js";
|
|
19
|
+
/**
|
|
20
|
+
* TODO
|
|
21
|
+
*
|
|
22
|
+
* @see 🏷️ {@link DataDragAndDropItemProps}
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <DragAndDrop.Item numOfSelectedRows={selectedRows.length} onClear={handleClear}>
|
|
26
|
+
* TODO
|
|
27
|
+
* </DragAndDrop.Item>
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
const DataDragAndDropItem = React.forwardRef((_a, forwardedRef) => {
|
|
31
|
+
var { children, id, index, className } = _a, rest = __rest(_a, ["children", "id", "index", "className"]);
|
|
32
|
+
const handleRef = useRef(null);
|
|
33
|
+
const { ref, isDragging, isDropTarget } = useSortable({
|
|
34
|
+
id,
|
|
35
|
+
index,
|
|
36
|
+
handle: handleRef,
|
|
37
|
+
});
|
|
38
|
+
const mergedRef = useMergeRefs(ref, forwardedRef);
|
|
39
|
+
const context = React.useContext(DataDragAndDropContext);
|
|
40
|
+
const mouseDragging = isDragging && (context === null || context === void 0 ? void 0 : context.inputMethod) === "mouse";
|
|
41
|
+
const mouseDropTarget = isDropTarget && (context === null || context === void 0 ? void 0 : context.inputMethod) === "mouse";
|
|
42
|
+
const keyboardDragging = isDragging && (context === null || context === void 0 ? void 0 : context.inputMethod) === "keyboard";
|
|
43
|
+
return (React.createElement(HStack, { gap: "space-8", align: "center", wrap: false, asChild: true },
|
|
44
|
+
React.createElement("div", Object.assign({ ref: mergedRef }, rest, { className: cl("aksel-data-table__drag-and-drop-item", className), "data-dragging": isDragging, "data-mouse-dragging": mouseDragging, "data-keyboard-dragging": keyboardDragging, "data-drop-target": mouseDropTarget, tabIndex: -1 }),
|
|
45
|
+
React.createElement(DataDragAndDropDragHandler, { handleRef: handleRef, keyboardDragging: keyboardDragging, alt: true }),
|
|
46
|
+
React.createElement("div", null, children))));
|
|
47
|
+
});
|
|
48
|
+
export default DataDragAndDropItem;
|
|
49
|
+
export { DataDragAndDropItem };
|
|
50
|
+
//# sourceMappingURL=DataDragAndDropItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataDragAndDropItem.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop-old/item/DataDragAndDropItem.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAczE;;;;;;;;;;GAUG;AACH,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAG1C,CAAC,EAA2C,EAAE,YAAY,EAAE,EAAE;QAA7D,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,OAAW,EAAN,IAAI,cAAzC,wCAA2C,CAAF;IAC1C,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC/C,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,WAAW,CAAC;QACpD,EAAE;QACF,KAAK;QACL,MAAM,EAAE,SAAS;KAClB,CAAC,CAAC;IACH,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC;IACzD,MAAM,aAAa,GAAG,UAAU,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,MAAK,OAAO,CAAC;IACrE,MAAM,eAAe,GAAG,YAAY,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,MAAK,OAAO,CAAC;IACzE,MAAM,gBAAgB,GAAG,UAAU,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,MAAK,UAAU,CAAC;IAE3E,OAAO,CACL,oBAAC,MAAM,IAAC,GAAG,EAAC,SAAS,EAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAE,KAAK,EAAE,OAAO;QAEvD,2CACE,GAAG,EAAE,SAAS,IACV,IAAI,IACR,SAAS,EAAE,EAAE,CAAC,sCAAsC,EAAE,SAAS,CAAC,mBACjD,UAAU,yBACJ,aAAa,4BACV,gBAAgB,sBACtB,eAAe,EACjC,QAAQ,EAAE,CAAC,CAAC;YAEZ,oBAAC,0BAA0B,IACzB,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,GAAG,SACH;YACF,iCAAM,QAAQ,CAAO,CACjB,CACC,CACV,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataDragAndDrop.context.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop-old/root/DataDragAndDrop.context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAQtC,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CAEjD,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import DataDragAndDropItem, { DataDragAndDropItemProps } from "../item/DataDragAndDropItem.js";
|
|
3
|
+
interface DataDragAndDropProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
children: any[];
|
|
5
|
+
setItems: React.Dispatch<React.SetStateAction<any[]>>;
|
|
6
|
+
}
|
|
7
|
+
interface DataDragAndDropRootComponent extends React.ForwardRefExoticComponent<DataDragAndDropProps & React.RefAttributes<HTMLDivElement>> {
|
|
8
|
+
/**
|
|
9
|
+
* @see 🏷️ {@link DataDragAndDropItemProps}
|
|
10
|
+
* * @example
|
|
11
|
+
* ```jsx
|
|
12
|
+
* <DragAndDrop>
|
|
13
|
+
* <DragAndDrop.Item id="1" index={0}>
|
|
14
|
+
* ...
|
|
15
|
+
* </DragAndDrop.Item>
|
|
16
|
+
* </DragAndDrop>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
Item: typeof DataDragAndDropItem;
|
|
20
|
+
}
|
|
21
|
+
declare const DataDragAndDrop: DataDragAndDropRootComponent;
|
|
22
|
+
export { DataDragAndDrop, DataDragAndDropItem };
|
|
23
|
+
export default DataDragAndDrop;
|
|
24
|
+
export type { DataDragAndDropItemProps, DataDragAndDropProps };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { DragDropProvider, DragOverlay } from "@dnd-kit/react";
|
|
13
|
+
import { isSortable } from "@dnd-kit/react/sortable";
|
|
14
|
+
import React, { forwardRef, isValidElement } from "react";
|
|
15
|
+
import { VStack } from "../../../primitives/stack/index.js";
|
|
16
|
+
import DataDragAndDropItem from "../item/DataDragAndDropItem.js";
|
|
17
|
+
import { DataDragAndDropContext } from "./DataDragAndDrop.context.js";
|
|
18
|
+
const DataDragAndDrop = forwardRef((_a, forwardedRef) => {
|
|
19
|
+
var { setItems, children } = _a, rest = __rest(_a, ["setItems", "children"]);
|
|
20
|
+
const [inputMethod, setInputMethod] = React.useState(null);
|
|
21
|
+
const setItemOrder = (initalIndex, targetIndex) => {
|
|
22
|
+
setItems((items) => {
|
|
23
|
+
const newItems = [...items];
|
|
24
|
+
const [movedItem] = newItems.splice(initalIndex, 1);
|
|
25
|
+
newItems.splice(targetIndex, 0, movedItem);
|
|
26
|
+
return newItems;
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
return (React.createElement(DataDragAndDropContext.Provider, { value: { inputMethod } },
|
|
30
|
+
React.createElement(DragDropProvider
|
|
31
|
+
// TODO Look into overriding default keybinds, might eliminate context need
|
|
32
|
+
, {
|
|
33
|
+
// TODO Look into overriding default keybinds, might eliminate context need
|
|
34
|
+
onBeforeDragStart: (event) => {
|
|
35
|
+
var _a;
|
|
36
|
+
return setInputMethod(((_a = event.operation.activatorEvent) === null || _a === void 0 ? void 0 : _a.type) === "pointerdown"
|
|
37
|
+
? "mouse"
|
|
38
|
+
: "keyboard");
|
|
39
|
+
}, onDragOver: (event) => {
|
|
40
|
+
var _a;
|
|
41
|
+
if (((_a = event.operation.activatorEvent) === null || _a === void 0 ? void 0 : _a.type) === "pointerdown") {
|
|
42
|
+
// Prevents items to rearrange while dragging with mouse, but allows keyboard dragging to work as intended
|
|
43
|
+
event.preventDefault();
|
|
44
|
+
}
|
|
45
|
+
}, onDragEnd: (event) => {
|
|
46
|
+
const { source, target } = event.operation;
|
|
47
|
+
if (!isSortable(source) || !isSortable(target))
|
|
48
|
+
return;
|
|
49
|
+
setItemOrder(source.initialIndex, target.index);
|
|
50
|
+
} },
|
|
51
|
+
React.createElement(VStack, { asChild: true, gap: "space-12" },
|
|
52
|
+
React.createElement("div", Object.assign({}, rest, { ref: forwardedRef }), children)),
|
|
53
|
+
React.createElement(DragOverlay, { dropAnimation: null }, (source) => {
|
|
54
|
+
// Overlay not needed and causes glitching when using keyboard
|
|
55
|
+
if (inputMethod === "keyboard")
|
|
56
|
+
return null;
|
|
57
|
+
if (!isSortable(source))
|
|
58
|
+
return null;
|
|
59
|
+
if (isValidElement(children[source.initialIndex])) {
|
|
60
|
+
return children[source.initialIndex];
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
}))));
|
|
64
|
+
});
|
|
65
|
+
DataDragAndDrop.Item = DataDragAndDropItem;
|
|
66
|
+
export { DataDragAndDrop, DataDragAndDropItem };
|
|
67
|
+
export default DataDragAndDrop;
|
|
68
|
+
//# sourceMappingURL=DataDragAndDropRoot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataDragAndDropRoot.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop-old/root/DataDragAndDropRoot.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,mBAEN,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAwBnE,MAAM,eAAe,GAAG,UAAU,CAChC,CAAC,EAA+B,EAAE,YAAY,EAAE,EAAE;QAAjD,EAAE,QAAQ,EAAE,QAAQ,OAAW,EAAN,IAAI,cAA7B,wBAA+B,CAAF;IAC5B,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAElD,IAAI,CAAC,CAAC;IAER,MAAM,YAAY,GAAG,CAAC,WAAmB,EAAE,WAAmB,EAAE,EAAE;QAChE,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE;YACjB,MAAM,QAAQ,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;YAC5B,MAAM,CAAC,SAAS,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;YACpD,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC;YAC3C,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,sBAAsB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,WAAW,EAAE;QACrD,oBAAC,gBAAgB;QACf,2EAA2E;;YAA3E,2EAA2E;YAC3E,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE;;gBAC3B,OAAA,cAAc,CACZ,CAAA,MAAA,KAAK,CAAC,SAAS,CAAC,cAAc,0CAAE,IAAI,MAAK,aAAa;oBACpD,CAAC,CAAC,OAAO;oBACT,CAAC,CAAC,UAAU,CACf,CAAA;aAAA,EAEH,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE;;gBACpB,IAAI,CAAA,MAAA,KAAK,CAAC,SAAS,CAAC,cAAc,0CAAE,IAAI,MAAK,aAAa,EAAE,CAAC;oBAC3D,0GAA0G;oBAC1G,KAAK,CAAC,cAAc,EAAE,CAAC;gBACzB,CAAC;YACH,CAAC,EACD,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;gBACnB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC;gBAC3C,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;oBAAE,OAAO;gBACvD,YAAY,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;YAClD,CAAC;YAED,oBAAC,MAAM,IAAC,OAAO,QAAC,GAAG,EAAC,UAAU;gBAC5B,6CAAS,IAAI,IAAE,GAAG,EAAE,YAAY,KAC7B,QAAQ,CACL,CACC;YACT,oBAAC,WAAW,IAAC,aAAa,EAAE,IAAI,IAC7B,CAAC,MAAM,EAAE,EAAE;gBACV,8DAA8D;gBAC9D,IAAI,WAAW,KAAK,UAAU;oBAAE,OAAO,IAAI,CAAC;gBAC5C,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;oBAAE,OAAO,IAAI,CAAC;gBACrC,IAAI,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;oBAClD,OAAO,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;gBACvC,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC,CACW,CACG,CACa,CACnC,CAAC;AACJ,CAAC,CAC8B,CAAC;AAElC,eAAe,CAAC,IAAI,GAAG,mBAAmB,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,CAAC;AAChD,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type DataTableEmptyStateProps = React.HTMLAttributes<HTMLDivElement>;
|
|
3
|
+
declare const DataTableEmptyState: React.ForwardRefExoticComponent<DataTableEmptyStateProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export { DataTableEmptyState };
|
|
5
|
+
export type { DataTableEmptyStateProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React, { forwardRef } from "react";
|
|
13
|
+
import { cl } from "../../../utils/helpers/index.js";
|
|
14
|
+
const DataTableEmptyState = forwardRef((_a, forwardedRef) => {
|
|
15
|
+
var { className, children } = _a, rest = __rest(_a, ["className", "children"]);
|
|
16
|
+
return (React.createElement("tr", null,
|
|
17
|
+
React.createElement("td", { colSpan: 999 },
|
|
18
|
+
React.createElement("div", Object.assign({}, rest, { ref: forwardedRef, className: cl("aksel-data-table__empty-state", className) }), children))));
|
|
19
|
+
});
|
|
20
|
+
export { DataTableEmptyState };
|
|
21
|
+
//# sourceMappingURL=DataTableEmptyState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataTableEmptyState.js","sourceRoot":"","sources":["../../../../src/data/table/empty-state/DataTableEmptyState.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAI5C,MAAM,mBAAmB,GAAG,UAAU,CAGpC,CAAC,EAAgC,EAAE,YAAY,EAAE,EAAE;QAAlD,EAAE,SAAS,EAAE,QAAQ,OAAW,EAAN,IAAI,cAA9B,yBAAgC,CAAF;IAC/B,OAAO,CACL;QACE,4BAAI,OAAO,EAAE,GAAG;YACd,6CACM,IAAI,IACR,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,SAAS,CAAC,KAExD,QAAQ,CACL,CACH,CACF,CACN,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -31,7 +31,9 @@ function restoreTabIndex(cell) {
|
|
|
31
31
|
*/
|
|
32
32
|
function findFocusableElementInCell(cell) {
|
|
33
33
|
const el = cell;
|
|
34
|
-
if (!el ||
|
|
34
|
+
if (!el ||
|
|
35
|
+
isHiddenElement(el) ||
|
|
36
|
+
el.hasAttribute("data-block-keyboard-nav")) {
|
|
35
37
|
return null;
|
|
36
38
|
}
|
|
37
39
|
const focusables = el.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"]), [contenteditable="true"]');
|
|
@@ -40,6 +42,10 @@ function findFocusableElementInCell(cell) {
|
|
|
40
42
|
}
|
|
41
43
|
for (let i = 0; i < focusables.length; i += 1) {
|
|
42
44
|
const focusable = focusables[i];
|
|
45
|
+
/* Ignore element if it has [data-block-keyboard-nav="true"] */
|
|
46
|
+
if (focusable.hasAttribute("data-block-keyboard-nav")) {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
43
49
|
if (!isHiddenElement(focusable) && !isDisabledElement(focusable)) {
|
|
44
50
|
return focusable;
|
|
45
51
|
}
|