@ncds/ui-admin 1.8.28-alpha.0 → 1.8.28-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/assets/scripts/notification/const/icons.js +1 -2
- package/dist/cjs/assets/scripts/notification/const/index.js +0 -30
- package/dist/cjs/assets/scripts/notification/const/sizes.js +5 -5
- package/dist/cjs/assets/scripts/notification/index.js +0 -7
- package/dist/cjs/assets/scripts/shared/ButtonCloseX.js +5 -4
- package/dist/cjs/assets/scripts/tooltip/const/classNames.js +29 -0
- package/dist/cjs/assets/scripts/tooltip/const/constants.js +58 -0
- package/dist/cjs/assets/scripts/tooltip/const/icons.js +15 -0
- package/dist/cjs/assets/scripts/tooltip/const/index.js +117 -0
- package/dist/cjs/assets/scripts/tooltip/const/templates.js +67 -0
- package/dist/cjs/assets/scripts/tooltip/const/types.js +5 -0
- package/dist/cjs/assets/scripts/utils/sanitize.js +0 -13
- package/dist/cjs/src/__tests__/helpers/dom.js +14 -0
- package/dist/cjs/src/__tests__/helpers/fileInput.js +92 -0
- package/dist/cjs/src/__tests__/helpers/fixedToday.js +17 -0
- package/dist/cjs/src/__tests__/helpers/matchMedia.js +50 -0
- package/dist/cjs/src/__tests__/helpers/rect.js +25 -0
- package/dist/cjs/src/components/action/button/__tests__/Button.test.js +260 -0
- package/dist/cjs/src/components/action/button-group/__tests__/ButtonGroup.test.js +267 -0
- package/dist/cjs/src/components/data-display/data-grid/__tests__/DataGrid.test.js +350 -0
- package/dist/cjs/src/components/data-display/table/__tests__/Table.dnd.dragCell.test.js +320 -0
- package/dist/cjs/src/components/data-display/table/__tests__/Table.dnd.test.js +313 -0
- package/dist/cjs/src/components/data-display/table/__tests__/Table.scroll.test.js +194 -0
- package/dist/cjs/src/components/data-display/table/__tests__/Table.test.js +382 -0
- package/dist/cjs/src/components/data-display/table/__tests__/dnd-context.test.js +61 -0
- package/dist/cjs/src/components/data-display/table/__tests__/dnd-preview.test.js +230 -0
- package/dist/cjs/src/components/data-display/table/__tests__/tableDndTestUtils.js +266 -0
- package/dist/cjs/src/components/data-display/table/__tests__/tableTestUtils.js +48 -0
- package/dist/cjs/src/components/data-display/table/__tests__/useTableScrollbars.ownership.test.js +362 -0
- package/dist/cjs/src/components/data-display/table/useTableScrollbars.js +0 -24
- package/dist/cjs/src/components/feedback-and-status/badge/__tests__/Badge.test.js +189 -0
- package/dist/cjs/src/components/feedback-and-status/badge-group/__tests__/BadgeGroup.test.js +119 -0
- package/dist/cjs/src/components/feedback-and-status/carousel-arrow/__tests__/CarouselArrow.test.js +94 -0
- package/dist/cjs/src/components/feedback-and-status/carousel-number-group/__tests__/CarouselNumberGroup.test.js +64 -0
- package/dist/cjs/src/components/feedback-and-status/empty-state/__tests__/EmptyState.test.js +126 -0
- package/dist/cjs/src/components/feedback-and-status/progress-bar/__tests__/ProgressBar.test.js +277 -0
- package/dist/cjs/src/components/feedback-and-status/progress-bar/__tests__/useProgressBar.test.js +249 -0
- package/dist/cjs/src/components/feedback-and-status/progress-bar/__tests__/utils.test.js +22 -0
- package/dist/cjs/src/components/feedback-and-status/progress-circle/__tests__/ProgressCircle.test.js +102 -0
- package/dist/cjs/src/components/feedback-and-status/spinner/__tests__/Spinner.test.js +76 -0
- package/dist/cjs/src/components/feedback-and-status/tag/__tests__/Tag.test.js +604 -0
- package/dist/cjs/src/components/forms-and-input/checkbox/__tests__/Checkbox.test.js +213 -0
- package/dist/cjs/src/components/forms-and-input/combo-box/ComboBox.js +2 -2
- package/dist/cjs/src/components/forms-and-input/combo-box/__tests__/ComboBox.interaction.test.js +442 -0
- package/dist/cjs/src/components/forms-and-input/combo-box/__tests__/ComboBox.register.test.js +153 -0
- package/dist/cjs/src/components/forms-and-input/combo-box/__tests__/comboBoxTestUtils.js +92 -0
- package/dist/cjs/src/components/forms-and-input/date-picker/__tests__/DatePicker.input.test.js +546 -0
- package/dist/cjs/src/components/forms-and-input/date-picker/__tests__/DatePicker.position.test.js +550 -0
- package/dist/cjs/src/components/forms-and-input/date-picker/__tests__/utils.test.js +34 -0
- package/dist/cjs/src/components/forms-and-input/file-input/__tests__/FileInput.select.test.js +266 -0
- package/dist/cjs/src/components/forms-and-input/image-file-input/__tests__/ImageFileInput.select.test.js +416 -0
- package/dist/cjs/src/components/forms-and-input/input-base/__tests__/InputBase.slots.test.js +236 -0
- package/dist/cjs/src/components/forms-and-input/number-input/__tests__/NumberInput.test.js +570 -0
- package/dist/cjs/src/components/forms-and-input/password-input/__tests__/PasswordInput.toggle.test.js +113 -0
- package/dist/cjs/src/components/forms-and-input/radio/__tests__/Radio.test.js +57 -0
- package/dist/cjs/src/components/forms-and-input/range-date-picker/__tests__/RangeDatePicker.test.js +275 -0
- package/dist/cjs/src/components/forms-and-input/range-date-picker-with-buttons/__tests__/RangeDatePickerWithButtons.test.js +235 -2
- package/dist/cjs/src/components/forms-and-input/select/__tests__/Select.test.js +275 -0
- package/dist/cjs/src/components/forms-and-input/select-box/SelectBox.js +2 -2
- package/dist/cjs/src/components/forms-and-input/select-box/__tests__/SelectBox.portal.test.js +371 -0
- package/dist/cjs/src/components/forms-and-input/select-box/__tests__/SelectBox.test.js +1335 -0
- package/dist/cjs/src/components/forms-and-input/slider/__tests__/Slider.test.js +390 -0
- package/dist/cjs/src/components/forms-and-input/switch/__tests__/Switch.test.js +317 -0
- package/dist/cjs/src/components/forms-and-input/textarea/__tests__/Textarea.test.js +255 -0
- package/dist/cjs/src/components/forms-and-input/textarea/__tests__/Textarea.unmount.test.js +158 -0
- package/dist/cjs/src/components/forms-and-input/toggle/__tests__/Toggle.test.js +138 -0
- package/dist/cjs/src/components/image-and-icons/featured-icon/__tests__/FeaturedIcon.test.js +67 -0
- package/dist/cjs/src/components/layout/block-container/__tests__/BlockContainer.test.js +59 -0
- package/dist/cjs/src/components/layout/block-header/__tests__/BlockHeader.test.js +169 -0
- package/dist/cjs/src/components/layout/block-header/__tests__/SubTitle.test.js +77 -0
- package/dist/cjs/src/components/layout/divider/__tests__/Divider.test.js +65 -0
- package/dist/cjs/src/components/layout/ncua-scope/__tests__/NcuaScope.test.js +146 -0
- package/dist/cjs/src/components/layout/page-title/__tests__/PageTitle.test.js +164 -0
- package/dist/cjs/src/components/navigation/context-tab/__tests__/ContextTab.test.js +616 -0
- package/dist/cjs/src/components/navigation/context-tab/__tests__/useContextTabScroll.test.js +592 -0
- package/dist/cjs/src/components/navigation/horizontal-tab/__tests__/HorizontalTab.test.js +211 -0
- package/dist/cjs/src/components/navigation/pagination/__tests__/Pagination.navigation.test.js +285 -0
- package/dist/cjs/src/components/navigation/vertical-tab/__tests__/VerticalTab.test.js +255 -0
- package/dist/cjs/src/components/overlays/dropdown/__tests__/Dropdown.dnd.test.js +558 -0
- package/dist/cjs/src/components/overlays/dropdown/__tests__/Dropdown.test.js +1020 -0
- package/dist/cjs/src/components/overlays/dropdown/__tests__/dropdownTestUtils.js +24 -0
- package/dist/cjs/src/components/overlays/dropdown/__tests__/utils.test.js +56 -0
- package/dist/cjs/src/components/overlays/modal/__tests__/Modal.test.js +426 -0
- package/dist/cjs/src/components/overlays/notification/__tests__/FloatingNotification.test.js +284 -0
- package/dist/cjs/src/components/overlays/notification/__tests__/MessageNotification.test.js +12 -0
- package/dist/cjs/src/components/overlays/postcode-search-modal/PostcodeSearchModalTip.js +2 -2
- package/dist/cjs/src/components/overlays/postcode-search-modal/__tests__/PostcodeSearchModal.viewport.test.js +141 -0
- package/dist/cjs/src/components/overlays/tooltip/__tests__/Tooltip.test.js +829 -0
- package/dist/cjs/src/components/tab/__tests__/TabButton.test.js +252 -0
- package/dist/cjs/src/hooks/__tests__/useCallbackRef.test.js +152 -0
- package/dist/cjs/src/hooks/__tests__/useMediaQuery.test.js +119 -0
- package/dist/cjs/src/hooks/__tests__/usePortalState.ssr.test.js +25 -0
- package/dist/cjs/src/hooks/dropdown/__tests__/dropdownHooks.test.js +168 -0
- package/dist/cjs/src/types/component-meta.js +0 -4
- package/dist/cjs/src/utils/__tests__/date-picker.test.js +105 -0
- package/dist/cjs/src/utils/dropdown/__tests__/dropdownUtils.test.js +24 -0
- package/dist/cjs/src/utils/dropdown/__tests__/multiSelect.test.js +49 -0
- package/dist/cjs/src/utils/dropdown/multiSelect.js +1 -6
- package/dist/cjs/src/utils/portal-position/__tests__/portalPosition.nullAnchor.test.js +67 -0
- package/dist/cjs/vitest.config.js +16 -10
- package/dist/esm/assets/scripts/notification/const/icons.js +0 -1
- package/dist/esm/assets/scripts/notification/const/index.js +2 -2
- package/dist/esm/assets/scripts/notification/const/sizes.js +4 -4
- package/dist/esm/assets/scripts/notification/index.js +1 -1
- package/dist/esm/assets/scripts/shared/ButtonCloseX.js +6 -3
- package/dist/esm/assets/scripts/tooltip/const/classNames.js +23 -0
- package/dist/esm/assets/scripts/tooltip/const/constants.js +52 -0
- package/dist/esm/assets/scripts/tooltip/const/icons.js +9 -0
- package/dist/esm/assets/scripts/tooltip/const/index.js +5 -0
- package/dist/esm/assets/scripts/tooltip/const/templates.js +60 -0
- package/dist/esm/assets/scripts/tooltip/const/types.js +1 -0
- package/dist/esm/assets/scripts/utils/sanitize.js +0 -12
- package/dist/esm/src/__tests__/helpers/dom.js +8 -0
- package/dist/esm/src/__tests__/helpers/fileInput.js +78 -0
- package/dist/esm/src/__tests__/helpers/fixedToday.js +10 -0
- package/dist/esm/src/__tests__/helpers/matchMedia.js +44 -0
- package/dist/esm/src/__tests__/helpers/rect.js +18 -0
- package/dist/esm/src/components/action/button/__tests__/Button.test.js +257 -0
- package/dist/esm/src/components/action/button-group/__tests__/ButtonGroup.test.js +264 -0
- package/dist/esm/src/components/data-display/data-grid/__tests__/DataGrid.test.js +347 -0
- package/dist/esm/src/components/data-display/table/__tests__/Table.dnd.dragCell.test.js +317 -0
- package/dist/esm/src/components/data-display/table/__tests__/Table.dnd.test.js +310 -0
- package/dist/esm/src/components/data-display/table/__tests__/Table.scroll.test.js +191 -0
- package/dist/esm/src/components/data-display/table/__tests__/Table.test.js +379 -0
- package/dist/esm/src/components/data-display/table/__tests__/dnd-context.test.js +58 -0
- package/dist/esm/src/components/data-display/table/__tests__/dnd-preview.test.js +227 -0
- package/dist/esm/src/components/data-display/table/__tests__/tableDndTestUtils.js +240 -0
- package/dist/esm/src/components/data-display/table/__tests__/tableTestUtils.js +40 -0
- package/dist/esm/src/components/data-display/table/__tests__/useTableScrollbars.ownership.test.js +359 -0
- package/dist/esm/src/components/data-display/table/useTableScrollbars.js +1 -1
- package/dist/esm/src/components/feedback-and-status/badge/__tests__/Badge.test.js +186 -0
- package/dist/esm/src/components/feedback-and-status/badge-group/__tests__/BadgeGroup.test.js +116 -0
- package/dist/esm/src/components/feedback-and-status/carousel-arrow/__tests__/CarouselArrow.test.js +91 -0
- package/dist/esm/src/components/feedback-and-status/carousel-number-group/__tests__/CarouselNumberGroup.test.js +61 -0
- package/dist/esm/src/components/feedback-and-status/empty-state/__tests__/EmptyState.test.js +123 -0
- package/dist/esm/src/components/feedback-and-status/progress-bar/__tests__/ProgressBar.test.js +274 -0
- package/dist/esm/src/components/feedback-and-status/progress-bar/__tests__/useProgressBar.test.js +246 -0
- package/dist/esm/src/components/feedback-and-status/progress-bar/__tests__/utils.test.js +19 -0
- package/dist/esm/src/components/feedback-and-status/progress-circle/__tests__/ProgressCircle.test.js +99 -0
- package/dist/esm/src/components/feedback-and-status/spinner/__tests__/Spinner.test.js +73 -0
- package/dist/esm/src/components/feedback-and-status/tag/__tests__/Tag.test.js +601 -0
- package/dist/esm/src/components/forms-and-input/checkbox/__tests__/Checkbox.test.js +210 -0
- package/dist/esm/src/components/forms-and-input/combo-box/ComboBox.js +1 -1
- package/dist/esm/src/components/forms-and-input/combo-box/__tests__/ComboBox.interaction.test.js +439 -0
- package/dist/esm/src/components/forms-and-input/combo-box/__tests__/ComboBox.register.test.js +151 -0
- package/dist/esm/src/components/forms-and-input/combo-box/__tests__/comboBoxTestUtils.js +77 -0
- package/dist/esm/src/components/forms-and-input/date-picker/__tests__/DatePicker.input.test.js +544 -0
- package/dist/esm/src/components/forms-and-input/date-picker/__tests__/DatePicker.position.test.js +546 -0
- package/dist/esm/src/components/forms-and-input/date-picker/__tests__/utils.test.js +31 -0
- package/dist/esm/src/components/forms-and-input/file-input/__tests__/FileInput.select.test.js +263 -0
- package/dist/esm/src/components/forms-and-input/image-file-input/__tests__/ImageFileInput.select.test.js +413 -0
- package/dist/esm/src/components/forms-and-input/input-base/__tests__/InputBase.slots.test.js +233 -0
- package/dist/esm/src/components/forms-and-input/number-input/__tests__/NumberInput.test.js +567 -0
- package/dist/esm/src/components/forms-and-input/password-input/__tests__/PasswordInput.toggle.test.js +110 -0
- package/dist/esm/src/components/forms-and-input/radio/__tests__/Radio.test.js +54 -0
- package/dist/esm/src/components/forms-and-input/range-date-picker/__tests__/RangeDatePicker.test.js +275 -0
- package/dist/esm/src/components/forms-and-input/range-date-picker-with-buttons/__tests__/RangeDatePickerWithButtons.test.js +235 -1
- package/dist/esm/src/components/forms-and-input/select/__tests__/Select.test.js +272 -0
- package/dist/esm/src/components/forms-and-input/select-box/SelectBox.js +1 -1
- package/dist/esm/src/components/forms-and-input/select-box/__tests__/SelectBox.portal.test.js +368 -0
- package/dist/esm/src/components/forms-and-input/select-box/__tests__/SelectBox.test.js +1332 -0
- package/dist/esm/src/components/forms-and-input/slider/__tests__/Slider.test.js +387 -0
- package/dist/esm/src/components/forms-and-input/switch/__tests__/Switch.test.js +314 -0
- package/dist/esm/src/components/forms-and-input/textarea/__tests__/Textarea.test.js +252 -0
- package/dist/esm/src/components/forms-and-input/textarea/__tests__/Textarea.unmount.test.js +155 -0
- package/dist/esm/src/components/forms-and-input/toggle/__tests__/Toggle.test.js +135 -0
- package/dist/esm/src/components/image-and-icons/featured-icon/__tests__/FeaturedIcon.test.js +64 -0
- package/dist/esm/src/components/layout/block-container/__tests__/BlockContainer.test.js +56 -0
- package/dist/esm/src/components/layout/block-header/__tests__/BlockHeader.test.js +166 -0
- package/dist/esm/src/components/layout/block-header/__tests__/SubTitle.test.js +74 -0
- package/dist/esm/src/components/layout/divider/__tests__/Divider.test.js +62 -0
- package/dist/esm/src/components/layout/ncua-scope/__tests__/NcuaScope.test.js +144 -0
- package/dist/esm/src/components/layout/page-title/__tests__/PageTitle.test.js +161 -0
- package/dist/esm/src/components/navigation/context-tab/__tests__/ContextTab.test.js +613 -0
- package/dist/esm/src/components/navigation/context-tab/__tests__/useContextTabScroll.test.js +589 -0
- package/dist/esm/src/components/navigation/horizontal-tab/__tests__/HorizontalTab.test.js +209 -0
- package/dist/esm/src/components/navigation/pagination/__tests__/Pagination.navigation.test.js +282 -0
- package/dist/esm/src/components/navigation/vertical-tab/__tests__/VerticalTab.test.js +252 -0
- package/dist/esm/src/components/overlays/dropdown/__tests__/Dropdown.dnd.test.js +556 -0
- package/dist/esm/src/components/overlays/dropdown/__tests__/Dropdown.test.js +1017 -0
- package/dist/esm/src/components/overlays/dropdown/__tests__/dropdownTestUtils.js +15 -0
- package/dist/esm/src/components/overlays/dropdown/__tests__/utils.test.js +57 -1
- package/dist/esm/src/components/overlays/modal/__tests__/Modal.test.js +423 -0
- package/dist/esm/src/components/overlays/notification/__tests__/FloatingNotification.test.js +281 -0
- package/dist/esm/src/components/overlays/notification/__tests__/MessageNotification.test.js +12 -0
- package/dist/esm/src/components/overlays/postcode-search-modal/PostcodeSearchModalTip.js +1 -1
- package/dist/esm/src/components/overlays/postcode-search-modal/__tests__/PostcodeSearchModal.viewport.test.js +139 -0
- package/dist/esm/src/components/overlays/tooltip/__tests__/Tooltip.test.js +826 -0
- package/dist/esm/src/components/tab/__tests__/TabButton.test.js +249 -0
- package/dist/esm/src/hooks/__tests__/useCallbackRef.test.js +149 -0
- package/dist/esm/src/hooks/__tests__/useMediaQuery.test.js +116 -0
- package/dist/esm/src/hooks/__tests__/usePortalState.ssr.test.js +22 -0
- package/dist/esm/src/hooks/dropdown/__tests__/dropdownHooks.test.js +165 -0
- package/dist/esm/src/types/component-meta.js +0 -4
- package/dist/esm/src/utils/__tests__/date-picker.test.js +107 -2
- package/dist/esm/src/utils/dropdown/__tests__/dropdownUtils.test.js +24 -0
- package/dist/esm/src/utils/dropdown/__tests__/multiSelect.test.js +46 -0
- package/dist/esm/src/utils/dropdown/multiSelect.js +5 -5
- package/dist/esm/src/utils/portal-position/__tests__/portalPosition.nullAnchor.test.js +64 -0
- package/dist/esm/vitest.config.js +16 -10
- package/dist/temp/assets/scripts/notification/const/icons.d.ts +0 -7
- package/dist/temp/assets/scripts/notification/const/icons.js +0 -1
- package/dist/temp/assets/scripts/notification/const/index.d.ts +3 -3
- package/dist/temp/assets/scripts/notification/const/index.js +2 -2
- package/dist/temp/assets/scripts/notification/const/sizes.d.ts +2 -14
- package/dist/temp/assets/scripts/notification/const/sizes.js +4 -4
- package/dist/temp/assets/scripts/notification/const/types.d.ts +3 -2
- package/dist/temp/assets/scripts/notification/index.d.ts +1 -1
- package/dist/temp/assets/scripts/notification/index.js +1 -1
- package/dist/temp/assets/scripts/shared/ButtonCloseX.d.ts +0 -2
- package/dist/temp/assets/scripts/shared/ButtonCloseX.js +6 -3
- package/dist/temp/assets/scripts/table/scrollbar/const.d.ts +0 -1
- package/dist/temp/assets/scripts/tooltip/const/classNames.d.ts +17 -0
- package/dist/temp/assets/scripts/tooltip/const/classNames.js +23 -0
- package/dist/temp/assets/scripts/tooltip/const/constants.d.ts +33 -0
- package/dist/temp/assets/scripts/tooltip/const/constants.js +48 -0
- package/dist/temp/assets/scripts/tooltip/const/icons.d.ts +4 -0
- package/dist/temp/assets/scripts/tooltip/const/icons.js +9 -0
- package/dist/temp/assets/scripts/tooltip/const/index.d.ts +5 -0
- package/dist/temp/assets/scripts/tooltip/const/index.js +5 -0
- package/dist/temp/assets/scripts/tooltip/const/templates.d.ts +16 -0
- package/dist/temp/assets/scripts/tooltip/const/templates.js +60 -0
- package/dist/temp/assets/scripts/tooltip/const/types.d.ts +17 -0
- package/dist/temp/assets/scripts/tooltip/const/types.js +1 -0
- package/dist/temp/assets/scripts/utils/sanitize.d.ts +0 -6
- package/dist/temp/assets/scripts/utils/sanitize.js +0 -12
- package/dist/temp/src/__tests__/helpers/dom.d.ts +2 -0
- package/dist/temp/src/__tests__/helpers/dom.js +8 -0
- package/dist/temp/src/__tests__/helpers/fileInput.d.ts +27 -0
- package/dist/temp/src/__tests__/helpers/fileInput.js +70 -0
- package/dist/temp/src/__tests__/helpers/fixedToday.d.ts +4 -0
- package/dist/temp/src/__tests__/helpers/fixedToday.js +8 -0
- package/dist/temp/src/__tests__/helpers/matchMedia.d.ts +13 -0
- package/dist/temp/src/__tests__/helpers/matchMedia.js +42 -0
- package/dist/temp/src/__tests__/helpers/rect.d.ts +2 -0
- package/dist/temp/src/__tests__/helpers/rect.js +5 -0
- package/dist/temp/src/components/action/button/__tests__/Button.test.d.ts +1 -0
- package/dist/temp/src/components/action/button/__tests__/Button.test.js +180 -0
- package/dist/temp/src/components/action/button-group/__tests__/ButtonGroup.test.d.ts +1 -0
- package/dist/temp/src/components/action/button-group/__tests__/ButtonGroup.test.js +162 -0
- package/dist/temp/src/components/data-display/data-grid/__tests__/DataGrid.test.d.ts +1 -0
- package/dist/temp/src/components/data-display/data-grid/__tests__/DataGrid.test.js +291 -0
- package/dist/temp/src/components/data-display/table/__tests__/Table.dnd.dragCell.test.d.ts +1 -0
- package/dist/temp/src/components/data-display/table/__tests__/Table.dnd.dragCell.test.js +255 -0
- package/dist/temp/src/components/data-display/table/__tests__/Table.dnd.test.d.ts +1 -0
- package/dist/temp/src/components/data-display/table/__tests__/Table.dnd.test.js +240 -0
- package/dist/temp/src/components/data-display/table/__tests__/Table.scroll.test.d.ts +1 -0
- package/dist/temp/src/components/data-display/table/__tests__/Table.scroll.test.js +145 -0
- package/dist/temp/src/components/data-display/table/__tests__/Table.test.d.ts +1 -0
- package/dist/temp/src/components/data-display/table/__tests__/Table.test.js +295 -0
- package/dist/temp/src/components/data-display/table/__tests__/dnd-context.test.d.ts +1 -0
- package/dist/temp/src/components/data-display/table/__tests__/dnd-context.test.js +42 -0
- package/dist/temp/src/components/data-display/table/__tests__/dnd-preview.test.d.ts +1 -0
- package/dist/temp/src/components/data-display/table/__tests__/dnd-preview.test.js +226 -0
- package/dist/temp/src/components/data-display/table/__tests__/tableDndTestUtils.d.ts +76 -0
- package/dist/temp/src/components/data-display/table/__tests__/tableDndTestUtils.js +153 -0
- package/dist/temp/src/components/data-display/table/__tests__/tableTestUtils.d.ts +11 -0
- package/dist/temp/src/components/data-display/table/__tests__/tableTestUtils.js +40 -0
- package/dist/temp/src/components/data-display/table/__tests__/useTableScrollbars.ownership.test.d.ts +1 -0
- package/dist/temp/src/components/data-display/table/__tests__/useTableScrollbars.ownership.test.js +269 -0
- package/dist/temp/src/components/data-display/table/dnd-context.d.ts +1 -1
- package/dist/temp/src/components/data-display/table/useTableScrollbars.d.ts +2 -2
- package/dist/temp/src/components/data-display/table/useTableScrollbars.js +1 -1
- package/dist/temp/src/components/feedback-and-status/badge/__tests__/Badge.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/badge/__tests__/Badge.test.js +136 -0
- package/dist/temp/src/components/feedback-and-status/badge-group/__tests__/BadgeGroup.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/badge-group/__tests__/BadgeGroup.test.js +103 -0
- package/dist/temp/src/components/feedback-and-status/carousel-arrow/__tests__/CarouselArrow.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/carousel-arrow/__tests__/CarouselArrow.test.js +81 -0
- package/dist/temp/src/components/feedback-and-status/carousel-number-group/__tests__/CarouselNumberGroup.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/carousel-number-group/__tests__/CarouselNumberGroup.test.js +53 -0
- package/dist/temp/src/components/feedback-and-status/empty-state/__tests__/EmptyState.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/empty-state/__tests__/EmptyState.test.js +86 -0
- package/dist/temp/src/components/feedback-and-status/progress-bar/__tests__/ProgressBar.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/progress-bar/__tests__/ProgressBar.test.js +221 -0
- package/dist/temp/src/components/feedback-and-status/progress-bar/__tests__/useProgressBar.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/progress-bar/__tests__/useProgressBar.test.js +168 -0
- package/dist/temp/src/components/feedback-and-status/progress-bar/__tests__/utils.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/progress-bar/__tests__/utils.test.js +35 -0
- package/dist/temp/src/components/feedback-and-status/progress-circle/__tests__/ProgressCircle.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/progress-circle/__tests__/ProgressCircle.test.js +106 -0
- package/dist/temp/src/components/feedback-and-status/spinner/__tests__/Spinner.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/spinner/__tests__/Spinner.test.js +73 -0
- package/dist/temp/src/components/feedback-and-status/tag/__tests__/Tag.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/tag/__tests__/Tag.test.js +392 -0
- package/dist/temp/src/components/forms-and-input/checkbox/__tests__/Checkbox.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/checkbox/__tests__/Checkbox.test.js +180 -0
- package/dist/temp/src/components/forms-and-input/combo-box/ComboBox.d.ts +1 -2
- package/dist/temp/src/components/forms-and-input/combo-box/ComboBox.js +1 -1
- package/dist/temp/src/components/forms-and-input/combo-box/__tests__/ComboBox.interaction.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/combo-box/__tests__/ComboBox.interaction.test.js +295 -0
- package/dist/temp/src/components/forms-and-input/combo-box/__tests__/ComboBox.register.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/combo-box/__tests__/ComboBox.register.test.js +111 -0
- package/dist/temp/src/components/forms-and-input/combo-box/__tests__/comboBoxTestUtils.d.ts +22 -0
- package/dist/temp/src/components/forms-and-input/combo-box/__tests__/comboBoxTestUtils.js +69 -0
- package/dist/temp/src/components/forms-and-input/date-picker/__tests__/DatePicker.input.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/date-picker/__tests__/DatePicker.input.test.js +358 -0
- package/dist/temp/src/components/forms-and-input/date-picker/__tests__/DatePicker.position.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/date-picker/__tests__/DatePicker.position.test.js +361 -0
- package/dist/temp/src/components/forms-and-input/date-picker/__tests__/utils.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/date-picker/__tests__/utils.test.js +34 -0
- package/dist/temp/src/components/forms-and-input/file-input/__tests__/FileInput.select.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/file-input/__tests__/FileInput.select.test.js +206 -0
- package/dist/temp/src/components/forms-and-input/image-file-input/__tests__/ImageFileInput.select.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/image-file-input/__tests__/ImageFileInput.select.test.js +292 -0
- package/dist/temp/src/components/forms-and-input/input-base/__tests__/InputBase.slots.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/input-base/__tests__/InputBase.slots.test.js +177 -0
- package/dist/temp/src/components/forms-and-input/number-input/__tests__/NumberInput.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/number-input/__tests__/NumberInput.test.js +434 -0
- package/dist/temp/src/components/forms-and-input/password-input/__tests__/PasswordInput.toggle.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/password-input/__tests__/PasswordInput.toggle.test.js +88 -0
- package/dist/temp/src/components/forms-and-input/radio/__tests__/Radio.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/radio/__tests__/Radio.test.js +42 -0
- package/dist/temp/src/components/forms-and-input/range-date-picker/__tests__/RangeDatePicker.test.js +137 -0
- package/dist/temp/src/components/forms-and-input/range-date-picker-with-buttons/__tests__/RangeDatePickerWithButtons.test.js +201 -1
- package/dist/temp/src/components/forms-and-input/select/__tests__/Select.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/select/__tests__/Select.test.js +214 -0
- package/dist/temp/src/components/forms-and-input/select-box/SelectBox.d.ts +1 -2
- package/dist/temp/src/components/forms-and-input/select-box/SelectBox.js +1 -1
- package/dist/temp/src/components/forms-and-input/select-box/__tests__/SelectBox.portal.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/select-box/__tests__/SelectBox.portal.test.js +312 -0
- package/dist/temp/src/components/forms-and-input/select-box/__tests__/SelectBox.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/select-box/__tests__/SelectBox.test.js +991 -0
- package/dist/temp/src/components/forms-and-input/slider/__tests__/Slider.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/slider/__tests__/Slider.test.js +294 -0
- package/dist/temp/src/components/forms-and-input/switch/__tests__/Switch.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/switch/__tests__/Switch.test.js +234 -0
- package/dist/temp/src/components/forms-and-input/textarea/__tests__/Textarea.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/textarea/__tests__/Textarea.test.js +207 -0
- package/dist/temp/src/components/forms-and-input/textarea/__tests__/Textarea.unmount.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/textarea/__tests__/Textarea.unmount.test.js +120 -0
- package/dist/temp/src/components/forms-and-input/toggle/__tests__/Toggle.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/toggle/__tests__/Toggle.test.js +125 -0
- package/dist/temp/src/components/image-and-icons/featured-icon/__tests__/FeaturedIcon.test.d.ts +1 -0
- package/dist/temp/src/components/image-and-icons/featured-icon/__tests__/FeaturedIcon.test.js +47 -0
- package/dist/temp/src/components/layout/block-container/__tests__/BlockContainer.test.d.ts +1 -0
- package/dist/temp/src/components/layout/block-container/__tests__/BlockContainer.test.js +53 -0
- package/dist/temp/src/components/layout/block-header/__tests__/BlockHeader.test.d.ts +1 -0
- package/dist/temp/src/components/layout/block-header/__tests__/BlockHeader.test.js +127 -0
- package/dist/temp/src/components/layout/block-header/__tests__/SubTitle.test.d.ts +1 -0
- package/dist/temp/src/components/layout/block-header/__tests__/SubTitle.test.js +76 -0
- package/dist/temp/src/components/layout/divider/__tests__/Divider.test.d.ts +1 -0
- package/dist/temp/src/components/layout/divider/__tests__/Divider.test.js +53 -0
- package/dist/temp/src/components/layout/ncua-scope/__tests__/NcuaScope.test.d.ts +1 -0
- package/dist/temp/src/components/layout/ncua-scope/__tests__/NcuaScope.test.js +136 -0
- package/dist/temp/src/components/layout/page-title/__tests__/PageTitle.test.d.ts +1 -0
- package/dist/temp/src/components/layout/page-title/__tests__/PageTitle.test.js +119 -0
- package/dist/temp/src/components/navigation/context-tab/__tests__/ContextTab.test.d.ts +1 -0
- package/dist/temp/src/components/navigation/context-tab/__tests__/ContextTab.test.js +447 -0
- package/dist/temp/src/components/navigation/context-tab/__tests__/useContextTabScroll.test.d.ts +1 -0
- package/dist/temp/src/components/navigation/context-tab/__tests__/useContextTabScroll.test.js +352 -0
- package/dist/temp/src/components/navigation/horizontal-tab/__tests__/HorizontalTab.test.d.ts +1 -0
- package/dist/temp/src/components/navigation/horizontal-tab/__tests__/HorizontalTab.test.js +152 -0
- package/dist/temp/src/components/navigation/pagination/__tests__/Pagination.navigation.test.d.ts +1 -0
- package/dist/temp/src/components/navigation/pagination/__tests__/Pagination.navigation.test.js +265 -0
- package/dist/temp/src/components/navigation/vertical-tab/__tests__/VerticalTab.test.d.ts +1 -0
- package/dist/temp/src/components/navigation/vertical-tab/__tests__/VerticalTab.test.js +172 -0
- package/dist/temp/src/components/overlays/dropdown/__tests__/Dropdown.dnd.test.d.ts +1 -0
- package/dist/temp/src/components/overlays/dropdown/__tests__/Dropdown.dnd.test.js +423 -0
- package/dist/temp/src/components/overlays/dropdown/__tests__/Dropdown.test.d.ts +1 -0
- package/dist/temp/src/components/overlays/dropdown/__tests__/Dropdown.test.js +699 -0
- package/dist/temp/src/components/overlays/dropdown/__tests__/dropdownTestUtils.d.ts +3 -0
- package/dist/temp/src/components/overlays/dropdown/__tests__/dropdownTestUtils.js +17 -0
- package/dist/temp/src/components/overlays/dropdown/__tests__/utils.test.js +24 -1
- package/dist/temp/src/components/overlays/modal/__tests__/Modal.test.d.ts +1 -0
- package/dist/temp/src/components/overlays/modal/__tests__/Modal.test.js +307 -0
- package/dist/temp/src/components/overlays/notification/MessageNotificationParts.d.ts +0 -1
- package/dist/temp/src/components/overlays/notification/NotificationActionButtons.d.ts +0 -1
- package/dist/temp/src/components/overlays/notification/__tests__/FloatingNotification.test.d.ts +1 -0
- package/dist/temp/src/components/overlays/notification/__tests__/FloatingNotification.test.js +218 -0
- package/dist/temp/src/components/overlays/notification/__tests__/MessageNotification.test.js +10 -0
- package/dist/temp/src/components/overlays/postcode-search-modal/PostcodeSearchModalTip.d.ts +1 -3
- package/dist/temp/src/components/overlays/postcode-search-modal/PostcodeSearchModalTip.js +1 -1
- package/dist/temp/src/components/overlays/postcode-search-modal/__tests__/PostcodeSearchModal.viewport.test.d.ts +1 -0
- package/dist/temp/src/components/overlays/postcode-search-modal/__tests__/PostcodeSearchModal.viewport.test.js +112 -0
- package/dist/temp/src/components/overlays/tooltip/__tests__/Tooltip.test.d.ts +1 -0
- package/dist/temp/src/components/overlays/tooltip/__tests__/Tooltip.test.js +538 -0
- package/dist/temp/src/components/tab/__tests__/TabButton.test.d.ts +1 -0
- package/dist/temp/src/components/tab/__tests__/TabButton.test.js +181 -0
- package/dist/temp/src/constant/date-picker.d.ts +2 -1
- package/dist/temp/src/hooks/__tests__/useCallbackRef.test.d.ts +1 -0
- package/dist/temp/src/hooks/__tests__/useCallbackRef.test.js +99 -0
- package/dist/temp/src/hooks/__tests__/useMediaQuery.test.d.ts +1 -0
- package/dist/temp/src/hooks/__tests__/useMediaQuery.test.js +95 -0
- package/dist/temp/src/hooks/__tests__/usePortalState.ssr.test.d.ts +1 -0
- package/dist/temp/src/hooks/__tests__/usePortalState.ssr.test.js +19 -0
- package/dist/temp/src/hooks/dropdown/__tests__/dropdownHooks.test.d.ts +1 -0
- package/dist/temp/src/hooks/dropdown/__tests__/dropdownHooks.test.js +147 -0
- package/dist/temp/src/types/component-meta.d.ts +2 -1
- package/dist/temp/src/types/component-meta.js +0 -4
- package/dist/temp/src/utils/__tests__/date-picker.test.js +58 -2
- package/dist/temp/src/utils/dropdown/__tests__/dropdownUtils.test.js +9 -0
- package/dist/temp/src/utils/dropdown/__tests__/multiSelect.test.d.ts +1 -0
- package/dist/temp/src/utils/dropdown/__tests__/multiSelect.test.js +41 -0
- package/dist/temp/src/utils/dropdown/multiSelect.d.ts +0 -20
- package/dist/temp/src/utils/dropdown/multiSelect.js +5 -5
- package/dist/temp/src/utils/portal-position/__tests__/portalPosition.nullAnchor.test.d.ts +1 -0
- package/dist/temp/src/utils/portal-position/__tests__/portalPosition.nullAnchor.test.js +57 -0
- package/dist/temp/vitest.config.js +15 -9
- package/dist/types/assets/scripts/notification/const/icons.d.ts +0 -7
- package/dist/types/assets/scripts/notification/const/index.d.ts +3 -3
- package/dist/types/assets/scripts/notification/const/sizes.d.ts +2 -14
- package/dist/types/assets/scripts/notification/const/types.d.ts +3 -2
- package/dist/types/assets/scripts/notification/index.d.ts +1 -1
- package/dist/types/assets/scripts/shared/ButtonCloseX.d.ts +0 -2
- package/dist/types/assets/scripts/table/scrollbar/const.d.ts +0 -1
- package/dist/types/assets/scripts/tooltip/const/classNames.d.ts +17 -0
- package/dist/types/assets/scripts/tooltip/const/constants.d.ts +33 -0
- package/dist/types/assets/scripts/tooltip/const/icons.d.ts +4 -0
- package/dist/types/assets/scripts/tooltip/const/index.d.ts +5 -0
- package/dist/types/assets/scripts/tooltip/const/templates.d.ts +16 -0
- package/dist/types/assets/scripts/tooltip/const/types.d.ts +17 -0
- package/dist/types/assets/scripts/utils/sanitize.d.ts +0 -6
- package/dist/types/src/__tests__/helpers/dom.d.ts +2 -0
- package/dist/types/src/__tests__/helpers/fileInput.d.ts +27 -0
- package/dist/types/src/__tests__/helpers/fixedToday.d.ts +4 -0
- package/dist/types/src/__tests__/helpers/matchMedia.d.ts +13 -0
- package/dist/types/src/__tests__/helpers/rect.d.ts +2 -0
- package/dist/types/src/components/action/button/__tests__/Button.test.d.ts +1 -0
- package/dist/types/src/components/action/button-group/__tests__/ButtonGroup.test.d.ts +1 -0
- package/dist/types/src/components/data-display/data-grid/__tests__/DataGrid.test.d.ts +1 -0
- package/dist/types/src/components/data-display/table/__tests__/Table.dnd.dragCell.test.d.ts +1 -0
- package/dist/types/src/components/data-display/table/__tests__/Table.dnd.test.d.ts +1 -0
- package/dist/types/src/components/data-display/table/__tests__/Table.scroll.test.d.ts +1 -0
- package/dist/types/src/components/data-display/table/__tests__/Table.test.d.ts +1 -0
- package/dist/types/src/components/data-display/table/__tests__/dnd-context.test.d.ts +1 -0
- package/dist/types/src/components/data-display/table/__tests__/dnd-preview.test.d.ts +1 -0
- package/dist/types/src/components/data-display/table/__tests__/tableDndTestUtils.d.ts +76 -0
- package/dist/types/src/components/data-display/table/__tests__/tableTestUtils.d.ts +11 -0
- package/dist/types/src/components/data-display/table/__tests__/useTableScrollbars.ownership.test.d.ts +1 -0
- package/dist/types/src/components/data-display/table/dnd-context.d.ts +1 -1
- package/dist/types/src/components/data-display/table/useTableScrollbars.d.ts +2 -2
- package/dist/types/src/components/feedback-and-status/badge/__tests__/Badge.test.d.ts +1 -0
- package/dist/types/src/components/feedback-and-status/badge-group/__tests__/BadgeGroup.test.d.ts +1 -0
- package/dist/types/src/components/feedback-and-status/carousel-arrow/__tests__/CarouselArrow.test.d.ts +1 -0
- package/dist/types/src/components/feedback-and-status/carousel-number-group/__tests__/CarouselNumberGroup.test.d.ts +1 -0
- package/dist/types/src/components/feedback-and-status/empty-state/__tests__/EmptyState.test.d.ts +1 -0
- package/dist/types/src/components/feedback-and-status/progress-bar/__tests__/ProgressBar.test.d.ts +1 -0
- package/dist/types/src/components/feedback-and-status/progress-bar/__tests__/useProgressBar.test.d.ts +1 -0
- package/dist/types/src/components/feedback-and-status/progress-bar/__tests__/utils.test.d.ts +1 -0
- package/dist/types/src/components/feedback-and-status/progress-circle/__tests__/ProgressCircle.test.d.ts +1 -0
- package/dist/types/src/components/feedback-and-status/spinner/__tests__/Spinner.test.d.ts +1 -0
- package/dist/types/src/components/feedback-and-status/tag/__tests__/Tag.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/checkbox/__tests__/Checkbox.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/combo-box/ComboBox.d.ts +1 -2
- package/dist/types/src/components/forms-and-input/combo-box/__tests__/ComboBox.interaction.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/combo-box/__tests__/ComboBox.register.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/combo-box/__tests__/comboBoxTestUtils.d.ts +22 -0
- package/dist/types/src/components/forms-and-input/date-picker/__tests__/DatePicker.input.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/date-picker/__tests__/DatePicker.position.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/date-picker/__tests__/utils.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/file-input/__tests__/FileInput.select.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/image-file-input/__tests__/ImageFileInput.select.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/input-base/__tests__/InputBase.slots.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/number-input/__tests__/NumberInput.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/password-input/__tests__/PasswordInput.toggle.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/radio/__tests__/Radio.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/select/__tests__/Select.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/select-box/SelectBox.d.ts +1 -2
- package/dist/types/src/components/forms-and-input/select-box/__tests__/SelectBox.portal.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/select-box/__tests__/SelectBox.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/slider/__tests__/Slider.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/switch/__tests__/Switch.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/textarea/__tests__/Textarea.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/textarea/__tests__/Textarea.unmount.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/toggle/__tests__/Toggle.test.d.ts +1 -0
- package/dist/types/src/components/image-and-icons/featured-icon/__tests__/FeaturedIcon.test.d.ts +1 -0
- package/dist/types/src/components/layout/block-container/__tests__/BlockContainer.test.d.ts +1 -0
- package/dist/types/src/components/layout/block-header/__tests__/BlockHeader.test.d.ts +1 -0
- package/dist/types/src/components/layout/block-header/__tests__/SubTitle.test.d.ts +1 -0
- package/dist/types/src/components/layout/divider/__tests__/Divider.test.d.ts +1 -0
- package/dist/types/src/components/layout/ncua-scope/__tests__/NcuaScope.test.d.ts +1 -0
- package/dist/types/src/components/layout/page-title/__tests__/PageTitle.test.d.ts +1 -0
- package/dist/types/src/components/navigation/context-tab/__tests__/ContextTab.test.d.ts +1 -0
- package/dist/types/src/components/navigation/context-tab/__tests__/useContextTabScroll.test.d.ts +1 -0
- package/dist/types/src/components/navigation/horizontal-tab/__tests__/HorizontalTab.test.d.ts +1 -0
- package/dist/types/src/components/navigation/pagination/__tests__/Pagination.navigation.test.d.ts +1 -0
- package/dist/types/src/components/navigation/vertical-tab/__tests__/VerticalTab.test.d.ts +1 -0
- package/dist/types/src/components/overlays/dropdown/__tests__/Dropdown.dnd.test.d.ts +1 -0
- package/dist/types/src/components/overlays/dropdown/__tests__/Dropdown.test.d.ts +1 -0
- package/dist/types/src/components/overlays/dropdown/__tests__/dropdownTestUtils.d.ts +3 -0
- package/dist/types/src/components/overlays/modal/__tests__/Modal.test.d.ts +1 -0
- package/dist/types/src/components/overlays/notification/MessageNotificationParts.d.ts +0 -1
- package/dist/types/src/components/overlays/notification/NotificationActionButtons.d.ts +0 -1
- package/dist/types/src/components/overlays/notification/__tests__/FloatingNotification.test.d.ts +1 -0
- package/dist/types/src/components/overlays/postcode-search-modal/PostcodeSearchModalTip.d.ts +1 -3
- package/dist/types/src/components/overlays/postcode-search-modal/__tests__/PostcodeSearchModal.viewport.test.d.ts +1 -0
- package/dist/types/src/components/overlays/tooltip/__tests__/Tooltip.test.d.ts +1 -0
- package/dist/types/src/components/tab/__tests__/TabButton.test.d.ts +1 -0
- package/dist/types/src/constant/date-picker.d.ts +2 -1
- package/dist/types/src/hooks/__tests__/useCallbackRef.test.d.ts +1 -0
- package/dist/types/src/hooks/__tests__/useMediaQuery.test.d.ts +1 -0
- package/dist/types/src/hooks/__tests__/usePortalState.ssr.test.d.ts +1 -0
- package/dist/types/src/hooks/dropdown/__tests__/dropdownHooks.test.d.ts +1 -0
- package/dist/types/src/types/component-meta.d.ts +2 -1
- package/dist/types/src/utils/dropdown/__tests__/multiSelect.test.d.ts +1 -0
- package/dist/types/src/utils/dropdown/multiSelect.d.ts +0 -20
- package/dist/types/src/utils/portal-position/__tests__/portalPosition.nullAnchor.test.d.ts +1 -0
- package/package.json +3 -8
- package/dist/cjs/src/constant/index.js +0 -27
- package/dist/cjs/src/constant/size.js +0 -7
- package/dist/cjs/src/contexts/index.js +0 -16
- package/dist/esm/src/constant/index.js +0 -2
- package/dist/esm/src/constant/size.js +0 -1
- package/dist/esm/src/contexts/index.js +0 -1
- package/dist/temp/src/constant/index.d.ts +0 -2
- package/dist/temp/src/constant/index.js +0 -2
- package/dist/temp/src/constant/size.d.ts +0 -1
- package/dist/temp/src/constant/size.js +0 -1
- package/dist/temp/src/contexts/index.d.ts +0 -1
- package/dist/temp/src/contexts/index.js +0 -1
- package/dist/types/src/constant/index.d.ts +0 -2
- package/dist/types/src/constant/size.d.ts +0 -1
- package/dist/types/src/contexts/index.d.ts +0 -1
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
//
|
|
3
|
+
// Table (React) 위험 경로 중 DnD mock 이 필요 없는 경로 — 위험 목록표 TB-xx.
|
|
4
|
+
// 행 드래그앤드롭 경로는 vi.mock 이 파일 전체에 걸리므로 Table.dnd.test.ts 로 분리했다.
|
|
5
|
+
import { createElement, createRef } from 'react';
|
|
6
|
+
import { act } from 'react-dom/test-utils';
|
|
7
|
+
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
8
|
+
import { Table } from '../Table';
|
|
9
|
+
import { TABLE_HEADER_HEIGHT } from '../useTableScrollbars';
|
|
10
|
+
import { cleanupRender, render } from './tableTestUtils';
|
|
11
|
+
const COL_WIDTH = 120;
|
|
12
|
+
const MIN_COL_WIDTH = 80;
|
|
13
|
+
const WIDTH_COUNT = 4;
|
|
14
|
+
const HEADER_WIDTH = 160;
|
|
15
|
+
const STYLE_WIDTH = 999;
|
|
16
|
+
const DEFAULT_MIN_WIDTH = 1140;
|
|
17
|
+
const SORT_DIRECTION_COUNT = 3;
|
|
18
|
+
const EMPTY_COL_SPAN = 3;
|
|
19
|
+
afterEach(() => {
|
|
20
|
+
cleanupRender();
|
|
21
|
+
vi.restoreAllMocks();
|
|
22
|
+
});
|
|
23
|
+
/** 헤더 셀 하나짜리 테이블 */
|
|
24
|
+
const tableWithHeaderCell = (props, label = '주문일') => createElement(Table, null, createElement(Table.Header, null, createElement('tr', null, createElement(Table.HeaderCell, props, label))));
|
|
25
|
+
const headerCellOf = (element) => element.querySelector('th.ncua-table__header-cell');
|
|
26
|
+
const click = (element) => {
|
|
27
|
+
act(() => {
|
|
28
|
+
element.click();
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
describe('Table.HeaderCell — 정렬 (TB-02)', () => {
|
|
32
|
+
it('TB-02 sortDirection 과 onSort 가 모두 있으면 헤더 셀 click 마다 onSort 를 호출한다', () => {
|
|
33
|
+
const onSort = vi.fn();
|
|
34
|
+
const view = render(tableWithHeaderCell({ sortDirection: 'none', onSort }));
|
|
35
|
+
const th = headerCellOf(view);
|
|
36
|
+
click(th);
|
|
37
|
+
expect(onSort).toHaveBeenCalledTimes(1);
|
|
38
|
+
click(th);
|
|
39
|
+
expect(onSort).toHaveBeenCalledTimes(2);
|
|
40
|
+
expect(th.classList.contains('ncua-table__header-cell--sortable')).toBe(true);
|
|
41
|
+
});
|
|
42
|
+
it('TB-02 헤더 셀 안의 텍스트·아이콘을 눌러도 onSort 가 호출된다', () => {
|
|
43
|
+
const onSort = vi.fn();
|
|
44
|
+
const view = render(tableWithHeaderCell({ sortDirection: 'asc', onSort }));
|
|
45
|
+
click(view.querySelector('.ncua-table__header-cell-text'));
|
|
46
|
+
view.querySelector('.ncua-table__sort-icon svg')?.dispatchEvent(new MouseEvent('click', { bubbles: true }));
|
|
47
|
+
expect(onSort).toHaveBeenCalledTimes(2);
|
|
48
|
+
});
|
|
49
|
+
it('TB-02 onSort 만 있고 sortDirection 이 없으면 정렬 가능 셀이 아니어서 click 해도 호출하지 않는다', () => {
|
|
50
|
+
const onSort = vi.fn();
|
|
51
|
+
const view = render(tableWithHeaderCell({ onSort }));
|
|
52
|
+
const th = headerCellOf(view);
|
|
53
|
+
click(th);
|
|
54
|
+
expect(onSort).not.toHaveBeenCalled();
|
|
55
|
+
expect(th.classList.contains('ncua-table__header-cell--sortable')).toBe(false);
|
|
56
|
+
expect(th.hasAttribute('aria-sort')).toBe(false);
|
|
57
|
+
});
|
|
58
|
+
it('TB-02 sortDirection 만 있고 onSort 가 없으면 정렬 아이콘 없이 텍스트만 렌더한다', () => {
|
|
59
|
+
const view = render(tableWithHeaderCell({ sortDirection: 'desc' }));
|
|
60
|
+
const th = headerCellOf(view);
|
|
61
|
+
click(th);
|
|
62
|
+
expect(th.querySelector('.ncua-table__sort-icon')).toBeNull();
|
|
63
|
+
expect(th.textContent).toBe('주문일');
|
|
64
|
+
});
|
|
65
|
+
it('TB-02 onClick 을 함께 넘기면 onClick 이 onSort 를 덮어써 정렬 콜백이 호출되지 않는다', () => {
|
|
66
|
+
// 현재 동작 고정 — 결함 후보: #588 (...rest 가 onClick={onSort} 뒤에 펼쳐져 덮어씀)
|
|
67
|
+
const onSort = vi.fn();
|
|
68
|
+
const onClick = vi.fn();
|
|
69
|
+
const view = render(tableWithHeaderCell({ sortDirection: 'none', onSort, onClick }));
|
|
70
|
+
click(headerCellOf(view));
|
|
71
|
+
expect(onClick).toHaveBeenCalledTimes(1);
|
|
72
|
+
expect(onSort).not.toHaveBeenCalled();
|
|
73
|
+
});
|
|
74
|
+
it.todo('TB-02 onClick 을 함께 넘겨도 정렬 가능 셀이면 onSort 가 호출된다 (둘 다 호출 또는 onClick 금지)');
|
|
75
|
+
});
|
|
76
|
+
// ── 표현 경로 공통 헬퍼 ──────────────────────────────────────
|
|
77
|
+
const tableEl = (element) => element.querySelector('.ncua-table');
|
|
78
|
+
const hasClass = (element, className) => element?.classList.contains(className) ?? false;
|
|
79
|
+
const bodyRow = (props = {}, ref) => createElement(Table, null, createElement(Table.Body, null, createElement(Table.Row, { ...props, ref }, createElement(Table.Cell, null, '셀'))));
|
|
80
|
+
describe('Table.HeaderCell — aria-sort·아이콘 (TB-12)', () => {
|
|
81
|
+
it.each([
|
|
82
|
+
['asc', 'ascending'],
|
|
83
|
+
['desc', 'descending'],
|
|
84
|
+
['none', 'none'],
|
|
85
|
+
])('TB-12 sortDirection=%s 이면 aria-sort=%s, 정렬 아이콘(svg)·sortable 클래스를 렌더한다', (direction, ariaSort) => {
|
|
86
|
+
const view = render(tableWithHeaderCell({ sortDirection: direction, onSort: vi.fn() }));
|
|
87
|
+
const th = headerCellOf(view);
|
|
88
|
+
expect(th.getAttribute('aria-sort')).toBe(ariaSort);
|
|
89
|
+
expect(th.querySelector('.ncua-table__sort-icon svg')).not.toBeNull();
|
|
90
|
+
expect(th.querySelector('.ncua-table__header-cell-text')?.textContent).toBe('주문일');
|
|
91
|
+
expect(hasClass(th, 'ncua-table__header-cell--sortable')).toBe(true);
|
|
92
|
+
});
|
|
93
|
+
it('TB-12 sortDirection 별로 서로 다른 아이콘을 쓴다', () => {
|
|
94
|
+
const markupOf = (direction) => {
|
|
95
|
+
const view = render(tableWithHeaderCell({ sortDirection: direction, onSort: vi.fn() }));
|
|
96
|
+
return view.querySelector('.ncua-table__sort-icon')?.innerHTML ?? '';
|
|
97
|
+
};
|
|
98
|
+
const icons = new Set([markupOf('asc'), markupOf('desc'), markupOf('none')]);
|
|
99
|
+
expect(icons.size).toBe(SORT_DIRECTION_COUNT);
|
|
100
|
+
});
|
|
101
|
+
it('TB-12 타입 밖의 sortDirection 이면 aria-sort 없이 children 만 렌더한다 (SortIcon 미해결 분기)', () => {
|
|
102
|
+
const view = render(tableWithHeaderCell({ sortDirection: 'unknown', onSort: vi.fn() }));
|
|
103
|
+
const th = headerCellOf(view);
|
|
104
|
+
expect(th.hasAttribute('aria-sort')).toBe(false);
|
|
105
|
+
expect(th.querySelector('.ncua-table__sort-icon')).toBeNull();
|
|
106
|
+
expect(th.textContent).toBe('주문일');
|
|
107
|
+
expect(hasClass(th, 'ncua-table__header-cell--sortable')).toBe(true);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
describe('Table children 분류 (TB-13)', () => {
|
|
111
|
+
it('TB-13 Header·ColGroup·기타는 table 안, Footer 는 .ncua-table 안 table 뒤, Pagination 은 .ncua-table 밖 wrapper 안', () => {
|
|
112
|
+
const view = render(createElement(Table, null, createElement(Table.Footer, null, '푸터'), createElement(Table.Pagination, null, '페이지'), createElement(Table.Body, null, createElement(Table.Row, null, createElement(Table.Cell, null, '셀'))), createElement(Table.Header, null, createElement('tr', null, createElement(Table.HeaderCell, null, '헤더'))), createElement(Table.ColGroup, { widths: [COL_WIDTH] })));
|
|
113
|
+
const wrapper = view.querySelector('.ncua-table-wrapper');
|
|
114
|
+
const table = view.querySelector('table.ncua-table__table');
|
|
115
|
+
const footer = view.querySelector('.ncua-table__footer');
|
|
116
|
+
const pagination = view.querySelector('.ncua-table__pagination');
|
|
117
|
+
expect(Array.from(table.children).map((child) => child.tagName)).toEqual(['COLGROUP', 'THEAD', 'TBODY']);
|
|
118
|
+
expect(table.getAttribute('role')).toBe('table');
|
|
119
|
+
expect(footer.parentElement).toBe(tableEl(view));
|
|
120
|
+
expect(table.compareDocumentPosition(footer) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
|
|
121
|
+
expect(pagination.parentElement).toBe(wrapper);
|
|
122
|
+
expect(tableEl(view).contains(pagination)).toBe(false);
|
|
123
|
+
});
|
|
124
|
+
it('TB-13 문자열·null children 도 table 안 콘텐츠로 분류한다', () => {
|
|
125
|
+
const view = render(createElement(Table, null, null, '텍스트', false));
|
|
126
|
+
const table = view.querySelector('table.ncua-table__table');
|
|
127
|
+
expect(table.textContent).toBe('텍스트');
|
|
128
|
+
});
|
|
129
|
+
it('TB-13 Header·Footer 의 className 을 함께 붙인다', () => {
|
|
130
|
+
const view = render(createElement(Table, null, createElement(Table.Header, { className: 'h-extra' }, null), createElement(Table.Body, { className: 'b-extra' }, null), createElement(Table.Footer, { className: 'f-extra' }, null), createElement(Table.Pagination, { className: 'p-extra' }, null)));
|
|
131
|
+
expect(hasClass(view.querySelector('thead'), 'h-extra')).toBe(true);
|
|
132
|
+
expect(hasClass(view.querySelector('tbody'), 'ncua-table__body')).toBe(true);
|
|
133
|
+
expect(hasClass(view.querySelector('tbody'), 'b-extra')).toBe(true);
|
|
134
|
+
expect(hasClass(view.querySelector('.ncua-table__footer'), 'f-extra')).toBe(true);
|
|
135
|
+
expect(hasClass(view.querySelector('.ncua-table__pagination'), 'p-extra')).toBe(true);
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
describe('Table 루트 클래스 (TB-17)', () => {
|
|
139
|
+
it('TB-17 기본값은 horizontal + hoverable 이고 fixed-header·selectable·draggable 은 없다', () => {
|
|
140
|
+
const view = render(createElement(Table, null, null));
|
|
141
|
+
const table = tableEl(view);
|
|
142
|
+
expect(hasClass(table, 'ncua-table--horizontal')).toBe(true);
|
|
143
|
+
expect(hasClass(table, 'ncua-table--hoverable')).toBe(true);
|
|
144
|
+
expect(hasClass(table, 'ncua-table--vertical')).toBe(false);
|
|
145
|
+
expect(hasClass(table, 'ncua-table--fixed-header')).toBe(false);
|
|
146
|
+
expect(hasClass(table, 'ncua-table--selectable')).toBe(false);
|
|
147
|
+
expect(hasClass(table, 'ncua-table--draggable')).toBe(false);
|
|
148
|
+
});
|
|
149
|
+
it('TB-17 type=vertical 이면 hoverable=true 여도 hoverable 클래스를 붙이지 않는다', () => {
|
|
150
|
+
const view = render(createElement(Table, { type: 'vertical', hoverable: true }, null));
|
|
151
|
+
const table = tableEl(view);
|
|
152
|
+
expect(hasClass(table, 'ncua-table--vertical')).toBe(true);
|
|
153
|
+
expect(hasClass(table, 'ncua-table--horizontal')).toBe(false);
|
|
154
|
+
expect(hasClass(table, 'ncua-table--hoverable')).toBe(false);
|
|
155
|
+
});
|
|
156
|
+
it('TB-17 fixedHeader·selectable·draggable·className 을 클래스로 반영하고 hoverable=false 면 뺀다', () => {
|
|
157
|
+
const view = render(createElement(Table, { fixedHeader: true, selectable: true, draggable: true, hoverable: false, className: 'extra' }, null));
|
|
158
|
+
const table = tableEl(view);
|
|
159
|
+
expect(hasClass(table, 'ncua-table--fixed-header')).toBe(true);
|
|
160
|
+
expect(hasClass(table, 'ncua-table--selectable')).toBe(true);
|
|
161
|
+
expect(hasClass(table, 'ncua-table--draggable')).toBe(true);
|
|
162
|
+
expect(hasClass(table, 'ncua-table--hoverable')).toBe(false);
|
|
163
|
+
expect(hasClass(table, 'extra')).toBe(true);
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
describe('Table.Row 클래스·ref·rest (TB-18)', () => {
|
|
167
|
+
it('TB-18 selected·status 에 따라 modifier 클래스를 붙인다', () => {
|
|
168
|
+
const rowOf = (props) => render(bodyRow(props)).querySelector('tr');
|
|
169
|
+
expect(hasClass(rowOf({ selected: true }), 'ncua-table__row--selected')).toBe(true);
|
|
170
|
+
expect(hasClass(rowOf({ status: 'warning' }), 'ncua-table__row--warning')).toBe(true);
|
|
171
|
+
expect(hasClass(rowOf({ status: 'error' }), 'ncua-table__row--error')).toBe(true);
|
|
172
|
+
const plain = rowOf({});
|
|
173
|
+
expect(plain.className).toBe('ncua-table__row');
|
|
174
|
+
expect(plain.hasAttribute('data-draggable-id')).toBe(false);
|
|
175
|
+
});
|
|
176
|
+
it('TB-18 함수 ref 에 tr 요소를 넘기고 언마운트 시 null 을 넘긴다', () => {
|
|
177
|
+
const ref = vi.fn();
|
|
178
|
+
const view = render(bodyRow({}, ref));
|
|
179
|
+
const row = view.querySelector('tr');
|
|
180
|
+
expect(ref).toHaveBeenCalledWith(row);
|
|
181
|
+
render(createElement(Table, null, null));
|
|
182
|
+
expect(ref).toHaveBeenLastCalledWith(null);
|
|
183
|
+
});
|
|
184
|
+
it('TB-18 객체 ref 의 current 에 tr 요소를 넣는다', () => {
|
|
185
|
+
const ref = createRef();
|
|
186
|
+
const view = render(bodyRow({}, ref));
|
|
187
|
+
expect(ref.current).toBe(view.querySelector('tr'));
|
|
188
|
+
});
|
|
189
|
+
it('TB-18 className·dragId·나머지 props 를 tr 에 그대로 전달한다', () => {
|
|
190
|
+
const onClick = vi.fn();
|
|
191
|
+
const view = render(bodyRow({ className: 'row-extra', dragId: 'r1', 'aria-rowindex': 2, onClick }));
|
|
192
|
+
const row = view.querySelector('tr');
|
|
193
|
+
click(row);
|
|
194
|
+
expect(hasClass(row, 'row-extra')).toBe(true);
|
|
195
|
+
expect(row.dataset.draggableId).toBe('r1');
|
|
196
|
+
expect(row.getAttribute('aria-rowindex')).toBe('2');
|
|
197
|
+
expect(onClick).toHaveBeenCalledTimes(1);
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
describe('Table.Cell (TB-19)', () => {
|
|
201
|
+
it('TB-19 isHeader 이면 th[scope=row], 아니면 td 로 렌더하고 ref·className·rest 를 전달한다', () => {
|
|
202
|
+
const headerRef = createRef();
|
|
203
|
+
const cellRef = createRef();
|
|
204
|
+
const view = render(createElement(Table, null, createElement(Table.Body, null, createElement(Table.Row, null, createElement(Table.Cell, { isHeader: true, ref: headerRef, className: 'th-extra' }, '항목'), createElement(Table.Cell, { ref: cellRef, className: 'td-extra', colSpan: 2 }, '값')))));
|
|
205
|
+
const th = view.querySelector('tbody th');
|
|
206
|
+
const td = view.querySelector('tbody td');
|
|
207
|
+
expect(th.getAttribute('scope')).toBe('row');
|
|
208
|
+
expect(th.className).toBe('ncua-table__cell th-extra');
|
|
209
|
+
expect(headerRef.current).toBe(th);
|
|
210
|
+
expect(td.className).toBe('ncua-table__cell td-extra');
|
|
211
|
+
expect(td.colSpan).toBe(2);
|
|
212
|
+
expect(cellRef.current).toBe(td);
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
describe('Table.HeaderCell 스타일·rest (TB-20)', () => {
|
|
216
|
+
it('TB-20 width·minWidth 를 style 과 병합하고 같은 키는 width·minWidth 가 이긴다', () => {
|
|
217
|
+
const view = render(tableWithHeaderCell({
|
|
218
|
+
width: HEADER_WIDTH,
|
|
219
|
+
minWidth: '5rem',
|
|
220
|
+
style: { color: 'red', width: STYLE_WIDTH },
|
|
221
|
+
className: 'hc-extra',
|
|
222
|
+
id: 'hc',
|
|
223
|
+
}));
|
|
224
|
+
const th = headerCellOf(view);
|
|
225
|
+
expect(th.style.width).toBe(`${HEADER_WIDTH}px`);
|
|
226
|
+
expect(th.style.minWidth).toBe('5rem');
|
|
227
|
+
expect(th.style.color).toBe('red');
|
|
228
|
+
expect(hasClass(th, 'hc-extra')).toBe(true);
|
|
229
|
+
expect(th.id).toBe('hc');
|
|
230
|
+
});
|
|
231
|
+
it('TB-20 ref 를 th 에 연결하고 width·style 이 없으면 style 속성을 렌더하지 않는다', () => {
|
|
232
|
+
const ref = createRef();
|
|
233
|
+
const view = render(createElement(Table, null, createElement(Table.Header, null, createElement('tr', null, createElement(Table.HeaderCell, { ref }, '이름')))));
|
|
234
|
+
expect(ref.current).toBe(headerCellOf(view));
|
|
235
|
+
expect(ref.current?.getAttribute('style')).toBeNull();
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
describe('Table.ColGroup (TB-21)', () => {
|
|
239
|
+
it('TB-21 숫자는 px, "auto"·undefined 는 미지정, 문자열은 그대로 쓰고 minWidths 도 같은 규칙을 따른다', () => {
|
|
240
|
+
const view = render(createElement(Table, null, createElement(Table.ColGroup, {
|
|
241
|
+
widths: [COL_WIDTH, 'auto', '20%', undefined],
|
|
242
|
+
minWidths: [MIN_COL_WIDTH, undefined, '4rem'],
|
|
243
|
+
})));
|
|
244
|
+
const cols = Array.from(view.querySelectorAll('col'));
|
|
245
|
+
expect(cols).toHaveLength(WIDTH_COUNT);
|
|
246
|
+
expect(cols.map((col) => col.style.width)).toEqual([`${COL_WIDTH}px`, '', '20%', '']);
|
|
247
|
+
expect(cols.map((col) => col.style.minWidth)).toEqual([`${MIN_COL_WIDTH}px`, '', '4rem', '']);
|
|
248
|
+
});
|
|
249
|
+
it('TB-21 minWidths 가 없으면 min-width 를 지정하지 않는다', () => {
|
|
250
|
+
const view = render(createElement(Table, null, createElement(Table.ColGroup, { widths: [COL_WIDTH] })));
|
|
251
|
+
expect(view.querySelector('col').style.minWidth).toBe('');
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
describe('Table.Empty (TB-22)', () => {
|
|
255
|
+
const emptyCell = (children) => {
|
|
256
|
+
const view = render(createElement(Table, null, createElement(Table.Body, null, createElement(Table.Empty, { colSpan: EMPTY_COL_SPAN }, children))));
|
|
257
|
+
return view.querySelector('.ncua-table__empty');
|
|
258
|
+
};
|
|
259
|
+
it('TB-22 children 이 없으면 기본 문구를, 있으면 children 을 렌더한다', () => {
|
|
260
|
+
expect(emptyCell().textContent).toBe('등록된 게시물이 없습니다.');
|
|
261
|
+
expect(emptyCell('검색 결과 없음').textContent).toBe('검색 결과 없음');
|
|
262
|
+
});
|
|
263
|
+
it('TB-22 colSpan·role=status·aria-live=polite 를 가진 td 로 렌더한다', () => {
|
|
264
|
+
const cell = emptyCell();
|
|
265
|
+
expect(cell.tagName).toBe('TD');
|
|
266
|
+
expect(cell.colSpan).toBe(EMPTY_COL_SPAN);
|
|
267
|
+
expect(cell.getAttribute('role')).toBe('status');
|
|
268
|
+
expect(cell.getAttribute('aria-live')).toBe('polite');
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
describe('Table.DragHeaderCell (TB-23)', () => {
|
|
272
|
+
it('TB-23 aria-hidden 아이콘과 children 을 inner span 안에 렌더한다', () => {
|
|
273
|
+
const view = render(createElement(Table, null, createElement(Table.Header, null, createElement('tr', null, createElement(Table.DragHeaderCell, { className: 'dh-extra' }, '전체')))));
|
|
274
|
+
const th = view.querySelector('th');
|
|
275
|
+
const inner = th.querySelector('.ncua-table__drag-cell-inner');
|
|
276
|
+
const icon = inner.querySelector('.ncua-table__drag-header-icon');
|
|
277
|
+
expect(th.className).toBe('ncua-table__header-cell ncua-table__drag-header-cell dh-extra');
|
|
278
|
+
expect(icon.getAttribute('aria-hidden')).toBe('true');
|
|
279
|
+
expect(icon.querySelector('svg')).not.toBeNull();
|
|
280
|
+
expect(inner.textContent).toBe('전체');
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
describe('Table 루트 ref·rest·CSS 변수 (TB-24)', () => {
|
|
284
|
+
it('TB-24 ref 는 wrapper div, rest 는 .ncua-table div 로 가고 wrapper 에 CSS 변수를 주입한다', () => {
|
|
285
|
+
const ref = createRef();
|
|
286
|
+
const view = render(createElement(Table, { ref, id: 't1', 'aria-label': '주문 목록' }, null));
|
|
287
|
+
const wrapper = view.querySelector('.ncua-table-wrapper');
|
|
288
|
+
expect(ref.current).toBe(wrapper);
|
|
289
|
+
expect(tableEl(view).id).toBe('t1');
|
|
290
|
+
expect(tableEl(view).getAttribute('aria-label')).toBe('주문 목록');
|
|
291
|
+
expect(wrapper.hasAttribute('id')).toBe(false);
|
|
292
|
+
expect(wrapper.style.getPropertyValue('--ncua-table-header-height')).toBe(`${TABLE_HEADER_HEIGHT}px`);
|
|
293
|
+
expect(wrapper.style.getPropertyValue('--ncua-table-default-min-width')).toBe(`${DEFAULT_MIN_WIDTH}px`);
|
|
294
|
+
});
|
|
295
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
import { createElement, useContext } from 'react';
|
|
3
|
+
import { createRoot } from 'react-dom/client';
|
|
4
|
+
import { act } from 'react-dom/test-utils';
|
|
5
|
+
import { afterEach, describe, expect, it } from 'vitest';
|
|
6
|
+
import { RowDndContext, TableDndContext } from '../dnd-context';
|
|
7
|
+
// React 18에서 act() 사용 시 필요한 플래그 (미설정 시 console.error 경고 발생)
|
|
8
|
+
globalThis.IS_REACT_ACT_ENVIRONMENT = true;
|
|
9
|
+
const mounted = [];
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
for (const { root, container } of mounted.splice(0)) {
|
|
12
|
+
act(() => root.unmount());
|
|
13
|
+
container.remove();
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
/** Provider 밖에서 컨텍스트 기본값을 읽어 기록하는 소비자 */
|
|
17
|
+
const readDefaults = () => {
|
|
18
|
+
const seen = {};
|
|
19
|
+
const Consumer = () => {
|
|
20
|
+
seen.row = useContext(RowDndContext);
|
|
21
|
+
seen.table = useContext(TableDndContext);
|
|
22
|
+
return null;
|
|
23
|
+
};
|
|
24
|
+
const container = document.createElement('div');
|
|
25
|
+
document.body.appendChild(container);
|
|
26
|
+
const root = createRoot(container);
|
|
27
|
+
mounted.push({ root, container });
|
|
28
|
+
act(() => root.render(createElement(Consumer)));
|
|
29
|
+
return seen;
|
|
30
|
+
};
|
|
31
|
+
describe('dnd-context — Provider 밖 기본값 (RSD-05)', () => {
|
|
32
|
+
// 공개 경로 미사용 — Table 행은 항상 Provider 안에서 소비한다. 기본값 계약만 직접 소비로 고정한다.
|
|
33
|
+
it('RSD-05 RowDndContext 기본값은 dragId undefined 이고 setIsDragging 은 호출해도 오류가 없다', () => {
|
|
34
|
+
const { row } = readDefaults();
|
|
35
|
+
expect(row).toEqual({ dragId: undefined, setIsDragging: expect.any(Function) });
|
|
36
|
+
expect(() => row?.setIsDragging(true)).not.toThrow();
|
|
37
|
+
});
|
|
38
|
+
it('RSD-05 TableDndContext 기본값은 드래그 비활성 · 빈 tableId 다', () => {
|
|
39
|
+
const { table } = readDefaults();
|
|
40
|
+
expect(table).toEqual({ isDraggable: false, tableId: '' });
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
//
|
|
3
|
+
// Table 드래그 미리보기 DOM 빌더(dnd-preview.ts) 위험 경로 — 위험 목록표 DP-xx.
|
|
4
|
+
// 형제 PR #586 의 Table.dnd.test.ts(TB-10) 가 확인하는 것(오버레이 body 부착·좌표, 배지 '2', 카드 개수 1·2)은
|
|
5
|
+
// 다시 단언하지 않는다. 여기서는 buildDragPreview 를 직접 호출해 치수·적층 순서·배경·복제 상태·요약 카드를 본다.
|
|
6
|
+
// 드래그 미리보기의 시각 결과는 TB-27(단위 불가, E2E 후보)이 다룬다.
|
|
7
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
8
|
+
import { buildDragPreview, PREVIEW_BADGE_SIZE } from '../dnd-preview';
|
|
9
|
+
const BADGE_HALF = PREVIEW_BADGE_SIZE / 2;
|
|
10
|
+
// 소스 비공개 상수(PREVIEW_STACK_OFFSET·PREVIEW_MAX_ROWS)의 스펙 값 — 소스가 바뀌면 함께 갱신한다.
|
|
11
|
+
const STACK_OFFSET = 5;
|
|
12
|
+
const MAX_ROWS = 3;
|
|
13
|
+
const MAX_STACK_OFFSET = STACK_OFFSET * MAX_ROWS;
|
|
14
|
+
const ROW_WIDTH = 300.4;
|
|
15
|
+
const ROW_HEIGHT = 47.6;
|
|
16
|
+
const ROUNDED_WIDTH = 300;
|
|
17
|
+
const ROUNDED_HEIGHT = 48;
|
|
18
|
+
const ROW_RECT = { width: ROW_WIDTH, height: ROW_HEIGHT };
|
|
19
|
+
const STACKED_ROW_COUNT = 2;
|
|
20
|
+
const MAX_STACKED_ROW_COUNT = MAX_ROWS;
|
|
21
|
+
const OVER_MAX_ROW_COUNT = 5;
|
|
22
|
+
const CELL_WIDTH_FRACTION = 40.2;
|
|
23
|
+
const CELL_WIDTH_CEILED = 41;
|
|
24
|
+
const CELL_WIDTH_INTEGER = 99;
|
|
25
|
+
const TABLE_CLASS = 'ncua-table__table order-table';
|
|
26
|
+
/** CSS 변수 → 계산값. 앞뒤 공백이 섞인 값도 배경으로 그대로 쓸 수 있는지 본다. */
|
|
27
|
+
const CSS_VARS = {
|
|
28
|
+
'--primary-red-50': ' rgb(254, 243, 242) ',
|
|
29
|
+
'--orange-50': ' rgb(255, 250, 235) ',
|
|
30
|
+
'--gray-50': ' rgb(249, 250, 251) ',
|
|
31
|
+
'--base-white': ' rgb(255, 255, 255) ',
|
|
32
|
+
};
|
|
33
|
+
const RED_50 = 'rgb(254, 243, 242)';
|
|
34
|
+
const ORANGE_50 = 'rgb(255, 250, 235)';
|
|
35
|
+
const GRAY_50 = 'rgb(249, 250, 251)';
|
|
36
|
+
const BASE_WHITE = 'rgb(255, 255, 255)';
|
|
37
|
+
let getComputedStyleSpy;
|
|
38
|
+
beforeEach(() => {
|
|
39
|
+
getComputedStyleSpy = vi.spyOn(window, 'getComputedStyle').mockImplementation(() => ({
|
|
40
|
+
getPropertyValue: (name) => CSS_VARS[name] ?? '',
|
|
41
|
+
}));
|
|
42
|
+
});
|
|
43
|
+
afterEach(() => {
|
|
44
|
+
document.body.innerHTML = '';
|
|
45
|
+
vi.restoreAllMocks();
|
|
46
|
+
});
|
|
47
|
+
/** 원본 테이블에 행 count 개를 그리고 행 목록을 돌려준다. 각 행은 data-row 로 식별한다. */
|
|
48
|
+
const mountRows = (count, rowClasses = []) => {
|
|
49
|
+
const table = document.createElement('table');
|
|
50
|
+
table.className = TABLE_CLASS;
|
|
51
|
+
const tbody = document.createElement('tbody');
|
|
52
|
+
table.appendChild(tbody);
|
|
53
|
+
document.body.appendChild(table);
|
|
54
|
+
return Array.from({ length: count }, (_, index) => {
|
|
55
|
+
const row = document.createElement('tr');
|
|
56
|
+
row.className = ['ncua-table__row', ...rowClasses].join(' ');
|
|
57
|
+
row.dataset.row = String(index);
|
|
58
|
+
const cell = document.createElement('td');
|
|
59
|
+
cell.textContent = `행 ${index}`;
|
|
60
|
+
row.appendChild(cell);
|
|
61
|
+
tbody.appendChild(row);
|
|
62
|
+
return row;
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
const cardsOf = (preview) => Array.from(preview.querySelectorAll(':scope > .ncua-table-dnd-preview__card'));
|
|
66
|
+
const clonedRowOf = (card) => card.querySelector('tbody > tr');
|
|
67
|
+
const px = (value) => `${value}px`;
|
|
68
|
+
describe('buildDragPreview — 행 1개 (DP-01)', () => {
|
|
69
|
+
it('DP-01 배지·요약 없이 카드 1장을 zIndex 1, 배지 절반 오프셋, 반올림한 행 크기로 만든다', () => {
|
|
70
|
+
const [row] = mountRows(1);
|
|
71
|
+
const preview = buildDragPreview([row], ROW_RECT);
|
|
72
|
+
const [card] = cardsOf(preview);
|
|
73
|
+
expect(preview.classList.contains('ncua-table-dnd-preview')).toBe(true);
|
|
74
|
+
expect(preview.querySelector('.ncua-table-dnd-preview__badge')).toBeNull();
|
|
75
|
+
expect(preview.querySelector('.ncua-table-dnd-preview__summary')).toBeNull();
|
|
76
|
+
expect(card.style.zIndex).toBe('1');
|
|
77
|
+
expect(card.style.top).toBe(px(BADGE_HALF));
|
|
78
|
+
expect(card.style.left).toBe(px(BADGE_HALF));
|
|
79
|
+
expect(card.style.width).toBe(px(ROUNDED_WIDTH));
|
|
80
|
+
expect(card.style.height).toBe(px(ROUNDED_HEIGHT));
|
|
81
|
+
});
|
|
82
|
+
it('DP-01 컨테이너는 (배지 절반 + 행 폭) × (배지 절반 + 행 높이) 다', () => {
|
|
83
|
+
const [row] = mountRows(1);
|
|
84
|
+
const preview = buildDragPreview([row], ROW_RECT);
|
|
85
|
+
expect(preview.style.width).toBe(px(BADGE_HALF + ROUNDED_WIDTH));
|
|
86
|
+
expect(preview.style.height).toBe(px(BADGE_HALF + ROUNDED_HEIGHT));
|
|
87
|
+
});
|
|
88
|
+
it('DP-01 카드 table 은 원본 closest(table) 의 className 과 카드 폭을, tbody 는 ncua-table__body 를 갖고 행 복제본을 담는다', () => {
|
|
89
|
+
const [row] = mountRows(1);
|
|
90
|
+
const [card] = cardsOf(buildDragPreview([row], ROW_RECT));
|
|
91
|
+
const table = card.querySelector('table');
|
|
92
|
+
const clone = clonedRowOf(card);
|
|
93
|
+
expect(table.className).toBe(TABLE_CLASS);
|
|
94
|
+
expect(table.style.width).toBe(px(ROUNDED_WIDTH));
|
|
95
|
+
expect(table.querySelector('tbody')?.className).toBe('ncua-table__body');
|
|
96
|
+
expect(clone).not.toBe(row);
|
|
97
|
+
expect(clone.dataset.row).toBe('0');
|
|
98
|
+
expect(clone.textContent).toBe('행 0');
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
describe('buildDragPreview — 행 2~3개 적층 (DP-02)', () => {
|
|
102
|
+
it('DP-02 배지를 먼저 붙이고 카드는 뒤 행부터(rows[n−1] … rows[0]) 붙인다', () => {
|
|
103
|
+
const rows = mountRows(MAX_STACKED_ROW_COUNT);
|
|
104
|
+
const preview = buildDragPreview(rows, ROW_RECT);
|
|
105
|
+
expect(preview.firstElementChild?.classList.contains('ncua-table-dnd-preview__badge')).toBe(true);
|
|
106
|
+
expect(cardsOf(preview).map((card) => clonedRowOf(card).dataset.row)).toEqual(['2', '1', '0']);
|
|
107
|
+
});
|
|
108
|
+
it('DP-02 i 번째 행 카드는 zIndex n−i, 오프셋 배지 절반 + 5i, 폭 행 폭 − 5i 다', () => {
|
|
109
|
+
const rows = mountRows(MAX_STACKED_ROW_COUNT);
|
|
110
|
+
const cards = cardsOf(buildDragPreview(rows, ROW_RECT));
|
|
111
|
+
const cardOfRow = (index) => cards.find((card) => clonedRowOf(card).dataset.row === String(index));
|
|
112
|
+
const expectCardGeometry = (index) => {
|
|
113
|
+
const card = cardOfRow(index);
|
|
114
|
+
const shift = index * STACK_OFFSET;
|
|
115
|
+
expect(card.style.zIndex).toBe(String(MAX_STACKED_ROW_COUNT - index));
|
|
116
|
+
expect(card.style.top).toBe(px(BADGE_HALF + shift));
|
|
117
|
+
expect(card.style.left).toBe(px(BADGE_HALF + shift));
|
|
118
|
+
expect(card.style.width).toBe(px(ROUNDED_WIDTH - shift));
|
|
119
|
+
expect(card.style.height).toBe(px(ROUNDED_HEIGHT));
|
|
120
|
+
expect(card.querySelector('table').style.width).toBe(px(ROUNDED_WIDTH - shift));
|
|
121
|
+
};
|
|
122
|
+
expectCardGeometry(0);
|
|
123
|
+
expectCardGeometry(1);
|
|
124
|
+
expectCardGeometry(2);
|
|
125
|
+
});
|
|
126
|
+
it('DP-02 컨테이너 높이는 배지 절반 + 행 높이 + 5 × (n − 1) 이다', () => {
|
|
127
|
+
expect(buildDragPreview(mountRows(STACKED_ROW_COUNT), ROW_RECT).style.height).toBe(px(BADGE_HALF + ROUNDED_HEIGHT + STACK_OFFSET));
|
|
128
|
+
expect(buildDragPreview(mountRows(MAX_STACKED_ROW_COUNT), ROW_RECT).style.height).toBe(px(BADGE_HALF + ROUNDED_HEIGHT + STACK_OFFSET * (MAX_STACKED_ROW_COUNT - 1)));
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
describe('buildDragPreview — 행 4개 이상 요약 카드 (DP-03)', () => {
|
|
132
|
+
it('DP-03 요약 카드를 배지 다음에 붙이고 위치·크기는 최대 적층 오프셋(15) 기준이다', () => {
|
|
133
|
+
const preview = buildDragPreview(mountRows(OVER_MAX_ROW_COUNT), ROW_RECT);
|
|
134
|
+
const summary = preview.children[1];
|
|
135
|
+
expect(summary.classList.contains('ncua-table-dnd-preview__summary')).toBe(true);
|
|
136
|
+
expect(summary.style.top).toBe(px(BADGE_HALF + MAX_STACK_OFFSET));
|
|
137
|
+
expect(summary.style.left).toBe(px(BADGE_HALF + MAX_STACK_OFFSET));
|
|
138
|
+
expect(summary.style.width).toBe(px(ROUNDED_WIDTH - MAX_STACK_OFFSET));
|
|
139
|
+
expect(summary.style.height).toBe(px(ROUNDED_HEIGHT));
|
|
140
|
+
});
|
|
141
|
+
it('DP-03 배지는 전체 행 수를 보이고 카드는 앞 3행만 만든다', () => {
|
|
142
|
+
const preview = buildDragPreview(mountRows(OVER_MAX_ROW_COUNT), ROW_RECT);
|
|
143
|
+
expect(preview.querySelector('.ncua-table-dnd-preview__badge')?.textContent).toBe(String(OVER_MAX_ROW_COUNT));
|
|
144
|
+
expect(cardsOf(preview).map((card) => clonedRowOf(card).dataset.row)).toEqual(['2', '1', '0']);
|
|
145
|
+
});
|
|
146
|
+
it('DP-03 컨테이너 높이는 배지 절반 + 행 높이 + 15 다', () => {
|
|
147
|
+
const preview = buildDragPreview(mountRows(OVER_MAX_ROW_COUNT), ROW_RECT);
|
|
148
|
+
expect(preview.style.height).toBe(px(BADGE_HALF + ROUNDED_HEIGHT + MAX_STACK_OFFSET));
|
|
149
|
+
expect(preview.style.width).toBe(px(BADGE_HALF + ROUNDED_WIDTH));
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
describe('buildDragPreview — 행 상태별 배경 (DP-04)', () => {
|
|
153
|
+
it.each([
|
|
154
|
+
['selected + error', ['ncua-table__row--selected', 'ncua-table__row--error'], RED_50],
|
|
155
|
+
['selected + warning', ['ncua-table__row--selected', 'ncua-table__row--warning'], ORANGE_50],
|
|
156
|
+
['selected', ['ncua-table__row--selected'], GRAY_50],
|
|
157
|
+
['선택 안 된 error', ['ncua-table__row--error'], BASE_WHITE],
|
|
158
|
+
['상태 없음', [], BASE_WHITE],
|
|
159
|
+
])('DP-04 %s 행은 카드와 복제 행 배경이 해당 CSS 변수 값이다', (_label, rowClasses, expected) => {
|
|
160
|
+
const [row] = mountRows(1, rowClasses);
|
|
161
|
+
const [card] = cardsOf(buildDragPreview([row], ROW_RECT));
|
|
162
|
+
expect(card.style.backgroundColor).toBe(expected);
|
|
163
|
+
expect(clonedRowOf(card).style.backgroundColor).toBe(expected);
|
|
164
|
+
});
|
|
165
|
+
it('DP-04 CSS 변수는 documentElement 의 계산 스타일에서 읽는다', () => {
|
|
166
|
+
const [row] = mountRows(1);
|
|
167
|
+
buildDragPreview([row], ROW_RECT);
|
|
168
|
+
expect(getComputedStyleSpy).toHaveBeenCalledWith(document.documentElement);
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
describe('buildDragPreview — 복제 행 상태 (DP-05)', () => {
|
|
172
|
+
const addCheckboxes = (row) => [0, 1].map(() => {
|
|
173
|
+
const cell = document.createElement('td');
|
|
174
|
+
const input = document.createElement('input');
|
|
175
|
+
input.type = 'checkbox';
|
|
176
|
+
cell.appendChild(input);
|
|
177
|
+
row.appendChild(cell);
|
|
178
|
+
return input;
|
|
179
|
+
});
|
|
180
|
+
it('DP-05 복제 행 체크박스는 원본 checked 프로퍼티를 유지한다 (속성과 달라도)', () => {
|
|
181
|
+
const [row] = mountRows(1);
|
|
182
|
+
const [first, second] = addCheckboxes(row);
|
|
183
|
+
first.checked = true; // 프로퍼티만 true (속성 없음)
|
|
184
|
+
second.setAttribute('checked', ''); // 속성은 있지만
|
|
185
|
+
second.checked = false; // 프로퍼티는 false
|
|
186
|
+
const [card] = cardsOf(buildDragPreview([row], ROW_RECT));
|
|
187
|
+
const clones = Array.from(clonedRowOf(card).querySelectorAll('input[type="checkbox"]'));
|
|
188
|
+
expect(clones.map((input) => input.checked)).toEqual([true, false]);
|
|
189
|
+
});
|
|
190
|
+
it('DP-05 셀 폭은 원본 getBoundingClientRect 폭을 올림해 width·minWidth·maxWidth 로 고정한다', () => {
|
|
191
|
+
const [row] = mountRows(1);
|
|
192
|
+
const extraCell = document.createElement('td');
|
|
193
|
+
row.appendChild(extraCell);
|
|
194
|
+
const [firstCell, secondCell] = Array.from(row.cells);
|
|
195
|
+
vi.spyOn(firstCell, 'getBoundingClientRect').mockReturnValue({ width: CELL_WIDTH_FRACTION });
|
|
196
|
+
vi.spyOn(secondCell, 'getBoundingClientRect').mockReturnValue({ width: CELL_WIDTH_INTEGER });
|
|
197
|
+
const [card] = cardsOf(buildDragPreview([row], ROW_RECT));
|
|
198
|
+
const cloneCells = Array.from(clonedRowOf(card).cells);
|
|
199
|
+
expect(cloneCells.map((cell) => [cell.style.width, cell.style.minWidth, cell.style.maxWidth])).toEqual([
|
|
200
|
+
[px(CELL_WIDTH_CEILED), px(CELL_WIDTH_CEILED), px(CELL_WIDTH_CEILED)],
|
|
201
|
+
[px(CELL_WIDTH_INTEGER), px(CELL_WIDTH_INTEGER), px(CELL_WIDTH_INTEGER)],
|
|
202
|
+
]);
|
|
203
|
+
});
|
|
204
|
+
it('DP-05 원본 행은 제자리에 남고 배경·셀 폭이 바뀌지 않는다', () => {
|
|
205
|
+
const rows = mountRows(STACKED_ROW_COUNT, ['ncua-table__row--selected']);
|
|
206
|
+
const originalParent = rows[0].parentElement;
|
|
207
|
+
buildDragPreview(rows, ROW_RECT);
|
|
208
|
+
expect(rows.map((row) => row.parentElement)).toEqual([originalParent, originalParent]);
|
|
209
|
+
expect(originalParent?.children).toHaveLength(STACKED_ROW_COUNT);
|
|
210
|
+
expect(rows[0].style.backgroundColor).toBe('');
|
|
211
|
+
expect(rows[0].cells[0].style.width).toBe('');
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
describe('buildDragPreview — 코너 (DP-06)', () => {
|
|
215
|
+
it('DP-06 table 밖의 행이면 카드 table 에 className 을 두지 않는다', () => {
|
|
216
|
+
const row = document.createElement('tr');
|
|
217
|
+
row.appendChild(document.createElement('td'));
|
|
218
|
+
const [card] = cardsOf(buildDragPreview([row], ROW_RECT));
|
|
219
|
+
expect(card.querySelector('table')?.className).toBe('');
|
|
220
|
+
});
|
|
221
|
+
it('DP-06 rows 가 비어 있으면 자식 없는 컨테이너를 예외 없이 돌려준다', () => {
|
|
222
|
+
const preview = buildDragPreview([], ROW_RECT);
|
|
223
|
+
expect(preview.classList.contains('ncua-table-dnd-preview')).toBe(true);
|
|
224
|
+
expect(preview.children).toHaveLength(0);
|
|
225
|
+
});
|
|
226
|
+
});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { dropTargetForElements, draggable as makeDraggable, monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
2
|
+
import type { TableBodyProps, TableProps } from '../types';
|
|
3
|
+
type DraggableArgs = Parameters<typeof makeDraggable>[0];
|
|
4
|
+
type DropTargetArgs = Parameters<typeof dropTargetForElements>[0];
|
|
5
|
+
type MonitorArgs = Parameters<typeof monitorForElements>[0];
|
|
6
|
+
type MonitorCanPayload = Parameters<NonNullable<MonitorArgs['canMonitor']>>[0];
|
|
7
|
+
type GetInitialDataPayload = Parameters<NonNullable<DraggableArgs['getInitialData']>>[0];
|
|
8
|
+
type DragData = Record<string | symbol, unknown>;
|
|
9
|
+
/** cleanup 이 아직 불리지 않은 registration 만 등록 순서대로 돌려준다 */
|
|
10
|
+
declare const draggables: () => DraggableArgs[];
|
|
11
|
+
declare const dropTargets: () => DropTargetArgs[];
|
|
12
|
+
declare const monitors: () => MonitorArgs[];
|
|
13
|
+
declare const stubRect: (element: Element, rect: Partial<DOMRect>) => void;
|
|
14
|
+
declare const ROW_HEIGHT = 40;
|
|
15
|
+
declare const UPPER_HALF_Y = 10;
|
|
16
|
+
declare const LOWER_HALF_Y = 30;
|
|
17
|
+
declare const rowOf: (dragId: string, scope?: ParentNode) => HTMLTableRowElement;
|
|
18
|
+
/** 드래그 핸들(button)이 scope 안의 dragId 행에 속한 draggable registration */
|
|
19
|
+
declare const draggableArgsOf: (dragId: string, scope?: ParentNode) => DraggableArgs;
|
|
20
|
+
declare const dropTargetArgsOf: (dragId: string) => DropTargetArgs;
|
|
21
|
+
declare const sourceDataOf: (dragId: string, scope?: ParentNode) => DragData;
|
|
22
|
+
/** 행 dropTarget 의 getData 를 실제 closest-edge 로 실행해 target data 를 만든다. */
|
|
23
|
+
declare const targetDataOf: (dragId: string, clientY: number, source: DragData) => DragData;
|
|
24
|
+
/** 등록된 모든 monitor 에 drop 을 흘린다 (canMonitor 통과한 것만). */
|
|
25
|
+
declare const dropOnMonitors: (source: DragData, targets: DragData[]) => void;
|
|
26
|
+
type RowDragEvent = 'onDragEnter' | 'onDrag' | 'onDragLeave' | 'onDrop';
|
|
27
|
+
/** 행 dropTarget 콜백에 self(=closest-edge 가 붙은 target data)·source 를 넘긴다. */
|
|
28
|
+
declare const fireRowEvent: (event: RowDragEvent, targetId: string, sourceId: string, clientY: number) => void;
|
|
29
|
+
declare const ROW_LEFT = 20;
|
|
30
|
+
declare const ROW_TOP = 100;
|
|
31
|
+
declare const ROW_WIDTH = 600;
|
|
32
|
+
declare const START_X = 50;
|
|
33
|
+
declare const START_Y = 110;
|
|
34
|
+
declare const MOVE_X = 200;
|
|
35
|
+
declare const MOVE_Y = 300;
|
|
36
|
+
declare const OFFSET_X: number;
|
|
37
|
+
declare const OFFSET_Y: number;
|
|
38
|
+
declare const generatePreview: (args: DraggableArgs, nativeSetDragImage?: DataTransfer['setDragImage']) => void;
|
|
39
|
+
declare const startDrag: (args: DraggableArgs) => void;
|
|
40
|
+
declare const endDrag: (args: DraggableArgs) => void;
|
|
41
|
+
declare const previewOverlays: () => HTMLElement[];
|
|
42
|
+
declare const fireDragOver: (clientX: number, clientY: number) => void;
|
|
43
|
+
/** beforeEach 에서 부른다 */
|
|
44
|
+
declare const trackDragOverListeners: () => void;
|
|
45
|
+
/** afterEach 에서 부른다 — 남은 오버레이·dragover 리스너를 정리하고 spy 를 되돌린다 */
|
|
46
|
+
declare const cleanupDragPreview: () => void;
|
|
47
|
+
declare const ROW_IDS: string[];
|
|
48
|
+
declare const draggableTable: (onRowDrop: TableBodyProps['onRowDrop']) => import("react").FunctionComponentElement<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "draggable" | "ref"> & {
|
|
49
|
+
type?: import("../types").TableType | undefined;
|
|
50
|
+
fixedHeader?: boolean | undefined;
|
|
51
|
+
maxHeight?: string | number | undefined;
|
|
52
|
+
hoverable?: boolean | undefined;
|
|
53
|
+
selectable?: boolean | undefined;
|
|
54
|
+
horizontalScroll?: boolean | undefined;
|
|
55
|
+
minWidth?: string | number | undefined;
|
|
56
|
+
draggable?: boolean | undefined;
|
|
57
|
+
children: import("react").ReactNode;
|
|
58
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
59
|
+
type RowSpec = {
|
|
60
|
+
id: string;
|
|
61
|
+
selected?: boolean;
|
|
62
|
+
disabled?: boolean;
|
|
63
|
+
withDragCell?: boolean;
|
|
64
|
+
};
|
|
65
|
+
declare const customTable: (rows: RowSpec[], tableProps?: Partial<TableProps>, bodyProps?: Partial<TableBodyProps>) => import("react").FunctionComponentElement<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "draggable" | "ref"> & {
|
|
66
|
+
type?: import("../types").TableType | undefined;
|
|
67
|
+
fixedHeader?: boolean | undefined;
|
|
68
|
+
maxHeight?: string | number | undefined;
|
|
69
|
+
hoverable?: boolean | undefined;
|
|
70
|
+
selectable?: boolean | undefined;
|
|
71
|
+
horizontalScroll?: boolean | undefined;
|
|
72
|
+
minWidth?: string | number | undefined;
|
|
73
|
+
draggable?: boolean | undefined;
|
|
74
|
+
children: import("react").ReactNode;
|
|
75
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
76
|
+
export { type DraggableArgs, type DropTargetArgs, type MonitorCanPayload, type GetInitialDataPayload, type DragData, draggables, dropTargets, monitors, stubRect, ROW_HEIGHT, UPPER_HALF_Y, LOWER_HALF_Y, rowOf, draggableArgsOf, dropTargetArgsOf, sourceDataOf, targetDataOf, dropOnMonitors, fireRowEvent, ROW_LEFT, ROW_TOP, ROW_WIDTH, START_X, START_Y, MOVE_X, MOVE_Y, OFFSET_X, OFFSET_Y, generatePreview, startDrag, endDrag, previewOverlays, fireDragOver, trackDragOverListeners, cleanupDragPreview, ROW_IDS, draggableTable, customTable, };
|