@ncds/ui-admin 1.8.1 → 1.8.2
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/src/components/badge/index.js +11 -0
- package/dist/cjs/src/components/date-picker/index.js +11 -0
- package/dist/cjs/src/components/image-file-input/components/index.js +16 -0
- package/dist/cjs/src/components/image-file-input/index.js +11 -0
- package/dist/cjs/src/components/progress-bar/components/index.js +27 -0
- package/dist/cjs/src/components/progress-bar/hooks/index.js +16 -0
- package/dist/cjs/src/components/progress-bar/index.js +33 -0
- package/dist/cjs/src/components/select/Select.js +0 -1
- package/dist/cjs/src/components/select-dropdown/index.js +11 -7
- package/dist/cjs/src/components/switch/index.js +11 -7
- package/dist/cjs/src/components/tooltip/Tooltip.js +170 -104
- package/dist/cjs/src/hooks/dropdown/index.js +61 -37
- package/dist/cjs/src/hooks/index.js +31 -25
- package/dist/cjs/vitest.config.js +13 -0
- package/dist/esm/src/components/badge/index.js +2 -1
- package/dist/esm/src/components/date-picker/index.js +1 -0
- package/dist/esm/src/components/empty-state/EmptyState.js +2 -3
- package/dist/esm/src/components/image-file-input/components/index.js +1 -0
- package/dist/esm/src/components/image-file-input/index.js +2 -1
- package/dist/esm/src/components/progress-bar/components/index.js +2 -0
- package/dist/esm/src/components/progress-bar/hooks/index.js +1 -0
- package/dist/esm/src/components/progress-bar/index.js +4 -1
- package/dist/esm/src/components/select/Select.js +0 -1
- package/dist/esm/src/components/select-dropdown/index.js +1 -1
- package/dist/esm/src/components/switch/index.js +1 -1
- package/dist/esm/src/components/tag/Tag.js +2 -3
- package/dist/esm/src/components/tooltip/Tooltip.js +172 -106
- package/dist/esm/src/hooks/dropdown/index.js +6 -6
- package/dist/esm/src/hooks/index.js +3 -3
- package/dist/esm/src/types/component-meta.js +2 -0
- package/dist/esm/vitest.config.js +7 -0
- package/dist/temp/src/components/badge/index.d.ts +1 -0
- package/dist/temp/src/components/badge/index.js +1 -0
- package/dist/temp/src/components/date-picker/index.d.ts +1 -0
- package/dist/temp/src/components/date-picker/index.js +1 -0
- package/dist/temp/src/components/empty-state/EmptyState.d.ts +3 -5
- package/dist/temp/src/components/empty-state/EmptyState.js +1 -2
- package/dist/temp/src/components/image-file-input/components/index.d.ts +1 -0
- package/dist/temp/src/components/image-file-input/components/index.js +1 -0
- package/dist/temp/src/components/image-file-input/index.d.ts +1 -0
- package/dist/temp/src/components/image-file-input/index.js +1 -0
- package/dist/temp/src/components/progress-bar/components/index.d.ts +2 -0
- package/dist/temp/src/components/progress-bar/components/index.js +2 -0
- package/dist/temp/src/components/progress-bar/hooks/index.d.ts +1 -0
- package/dist/temp/src/components/progress-bar/hooks/index.js +1 -0
- package/dist/temp/src/components/progress-bar/index.d.ts +3 -0
- package/dist/temp/src/components/progress-bar/index.js +3 -0
- package/dist/temp/src/components/select/Select.js +1 -1
- package/dist/temp/src/components/select-dropdown/index.d.ts +1 -1
- package/dist/temp/src/components/select-dropdown/index.js +1 -1
- package/dist/temp/src/components/spinner/Spinner.d.ts +1 -2
- package/dist/temp/src/components/switch/index.d.ts +1 -2
- package/dist/temp/src/components/switch/index.js +1 -1
- package/dist/temp/src/components/tag/Tag.d.ts +3 -5
- package/dist/temp/src/components/tag/Tag.js +1 -2
- package/dist/temp/src/components/tooltip/Tooltip.d.ts +4 -2
- package/dist/temp/src/components/tooltip/Tooltip.js +126 -68
- package/dist/temp/src/hooks/dropdown/index.d.ts +6 -6
- package/dist/temp/src/hooks/dropdown/index.js +6 -6
- package/dist/temp/src/hooks/index.d.ts +3 -3
- package/dist/temp/src/hooks/index.js +3 -3
- package/dist/temp/src/types/component-meta.d.ts +26 -0
- package/dist/temp/src/types/component-meta.js +2 -0
- package/dist/temp/src/types/dropdown/option.d.ts +2 -4
- package/dist/temp/src/types/side-slot.d.ts +9 -1
- package/dist/temp/vitest.config.d.ts +2 -0
- package/dist/temp/vitest.config.js +7 -0
- package/dist/types/src/components/badge/index.d.ts +1 -0
- package/dist/types/src/components/date-picker/index.d.ts +1 -0
- package/dist/types/src/components/empty-state/EmptyState.d.ts +3 -5
- package/dist/types/src/components/image-file-input/components/index.d.ts +1 -0
- package/dist/types/src/components/image-file-input/index.d.ts +1 -0
- package/dist/types/src/components/progress-bar/components/index.d.ts +2 -0
- package/dist/types/src/components/progress-bar/hooks/index.d.ts +1 -0
- package/dist/types/src/components/progress-bar/index.d.ts +3 -0
- package/dist/types/src/components/select-dropdown/index.d.ts +1 -1
- package/dist/types/src/components/spinner/Spinner.d.ts +1 -2
- package/dist/types/src/components/switch/index.d.ts +1 -2
- package/dist/types/src/components/tag/Tag.d.ts +3 -5
- package/dist/types/src/components/tooltip/Tooltip.d.ts +4 -2
- package/dist/types/src/hooks/dropdown/index.d.ts +6 -6
- package/dist/types/src/hooks/index.d.ts +3 -3
- package/dist/types/src/types/component-meta.d.ts +26 -0
- package/dist/types/src/types/dropdown/option.d.ts +2 -4
- package/dist/types/src/types/side-slot.d.ts +9 -1
- package/dist/types/vitest.config.d.ts +2 -0
- package/dist/ui-admin/assets/styles/style.css +18 -7
- package/package.json +6 -1
- package/dist/cjs/assets/scripts/baseBox.js +0 -146
- package/dist/cjs/assets/scripts/comboBox.js +0 -137
- package/dist/cjs/assets/scripts/datePicker.js +0 -671
- package/dist/cjs/assets/scripts/featuredIcon.js +0 -87
- package/dist/cjs/assets/scripts/fileInput/const/classNames.js +0 -25
- package/dist/cjs/assets/scripts/fileInput/const/index.js +0 -27
- package/dist/cjs/assets/scripts/fileInput/const/types.js +0 -13
- package/dist/cjs/assets/scripts/fileInput/fileInput.js +0 -78
- package/dist/cjs/assets/scripts/fileInput/fileInputModel.js +0 -53
- package/dist/cjs/assets/scripts/fileInput/fileInputView.js +0 -152
- package/dist/cjs/assets/scripts/fileInput/index.js +0 -44
- package/dist/cjs/assets/scripts/imageFileInput/ImageFileInput.js +0 -184
- package/dist/cjs/assets/scripts/imageFileInput/ImageFileInputModel.js +0 -222
- package/dist/cjs/assets/scripts/imageFileInput/ImageFileInputView.js +0 -356
- package/dist/cjs/assets/scripts/imageFileInput/const/classNames.js +0 -31
- package/dist/cjs/assets/scripts/imageFileInput/const/index.js +0 -27
- package/dist/cjs/assets/scripts/imageFileInput/const/types.js +0 -13
- package/dist/cjs/assets/scripts/imageFileInput/index.js +0 -44
- package/dist/cjs/assets/scripts/index.js +0 -32
- package/dist/cjs/assets/scripts/modal/Modal.js +0 -104
- package/dist/cjs/assets/scripts/modal/ModalActions.js +0 -116
- package/dist/cjs/assets/scripts/modal/ModalContent.js +0 -46
- package/dist/cjs/assets/scripts/modal/ModalHeader.js +0 -104
- package/dist/cjs/assets/scripts/modal/const/classNames.js +0 -33
- package/dist/cjs/assets/scripts/modal/const/index.js +0 -27
- package/dist/cjs/assets/scripts/modal/index.js +0 -61
- package/dist/cjs/assets/scripts/modal/utils/contentUtils.js +0 -35
- package/dist/cjs/assets/scripts/notification/FloatingNotification.js +0 -178
- package/dist/cjs/assets/scripts/notification/FullWidthNotification.js +0 -132
- package/dist/cjs/assets/scripts/notification/MessageNotification.js +0 -159
- package/dist/cjs/assets/scripts/notification/Notification.js +0 -101
- package/dist/cjs/assets/scripts/notification/const/classNames.js +0 -50
- package/dist/cjs/assets/scripts/notification/const/icons.js +0 -31
- package/dist/cjs/assets/scripts/notification/const/index.js +0 -87
- package/dist/cjs/assets/scripts/notification/const/sizes.js +0 -46
- package/dist/cjs/assets/scripts/notification/const/types.js +0 -14
- package/dist/cjs/assets/scripts/notification/index.js +0 -92
- package/dist/cjs/assets/scripts/notification/utils.js +0 -97
- package/dist/cjs/assets/scripts/progress-bar/ProgressBar.js +0 -271
- package/dist/cjs/assets/scripts/progress-bar/index.js +0 -12
- package/dist/cjs/assets/scripts/selectBox.js +0 -169
- package/dist/cjs/assets/scripts/shared/ButtonCloseX.js +0 -45
- package/dist/cjs/assets/scripts/tab.js +0 -40
- package/dist/cjs/assets/scripts/table/Table.js +0 -377
- package/dist/cjs/assets/scripts/table/const/classNames.js +0 -33
- package/dist/cjs/assets/scripts/table/const/index.js +0 -27
- package/dist/cjs/assets/scripts/table/const/types.js +0 -5
- package/dist/cjs/assets/scripts/table/index.js +0 -43
- package/dist/cjs/assets/scripts/tag/Tag.js +0 -261
- package/dist/cjs/assets/scripts/tag/const/classNames.js +0 -20
- package/dist/cjs/assets/scripts/tag/const/index.js +0 -38
- package/dist/cjs/assets/scripts/tag/const/sizes.js +0 -13
- package/dist/cjs/assets/scripts/tag/const/types.js +0 -5
- package/dist/cjs/assets/scripts/tag/index.js +0 -44
- package/dist/cjs/assets/scripts/tooltip/Tooltip.js +0 -353
- package/dist/cjs/assets/scripts/tooltip/TooltipLayerManager.js +0 -82
- package/dist/cjs/assets/scripts/tooltip/const/classNames.js +0 -29
- package/dist/cjs/assets/scripts/tooltip/const/constants.js +0 -56
- package/dist/cjs/assets/scripts/tooltip/const/icons.js +0 -15
- package/dist/cjs/assets/scripts/tooltip/const/index.js +0 -123
- package/dist/cjs/assets/scripts/tooltip/const/templates.js +0 -66
- package/dist/cjs/assets/scripts/tooltip/const/types.js +0 -5
- package/dist/cjs/assets/scripts/tooltip/index.js +0 -57
- package/dist/cjs/assets/scripts/tooltip/utils.js +0 -40
- package/dist/cjs/assets/scripts/utils/debounce.js +0 -32
- package/dist/cjs/assets/scripts/utils/unifiedBox/domRenderer.js +0 -370
- package/dist/cjs/assets/scripts/utils/unifiedBox/dropdownModel.js +0 -285
- package/dist/cjs/assets/scripts/utils/unifiedBox/unifiedBoxController.js +0 -622
- package/dist/cjs/assets/scripts/utils/unifiedBox/unifiedBoxManager.js +0 -473
- package/dist/esm/assets/scripts/baseBox.js +0 -139
- package/dist/esm/assets/scripts/comboBox.js +0 -130
- package/dist/esm/assets/scripts/datePicker.js +0 -663
- package/dist/esm/assets/scripts/featuredIcon.js +0 -80
- package/dist/esm/assets/scripts/fileInput/const/classNames.js +0 -16
- package/dist/esm/assets/scripts/fileInput/const/index.js +0 -2
- package/dist/esm/assets/scripts/fileInput/const/types.js +0 -7
- package/dist/esm/assets/scripts/fileInput/fileInput.js +0 -71
- package/dist/esm/assets/scripts/fileInput/fileInputModel.js +0 -46
- package/dist/esm/assets/scripts/fileInput/fileInputView.js +0 -145
- package/dist/esm/assets/scripts/fileInput/index.js +0 -9
- package/dist/esm/assets/scripts/imageFileInput/ImageFileInput.js +0 -177
- package/dist/esm/assets/scripts/imageFileInput/ImageFileInputModel.js +0 -215
- package/dist/esm/assets/scripts/imageFileInput/ImageFileInputView.js +0 -349
- package/dist/esm/assets/scripts/imageFileInput/const/classNames.js +0 -20
- package/dist/esm/assets/scripts/imageFileInput/const/index.js +0 -2
- package/dist/esm/assets/scripts/imageFileInput/const/types.js +0 -7
- package/dist/esm/assets/scripts/imageFileInput/index.js +0 -9
- package/dist/esm/assets/scripts/index.js +0 -30
- package/dist/esm/assets/scripts/modal/Modal.js +0 -98
- package/dist/esm/assets/scripts/modal/ModalActions.js +0 -109
- package/dist/esm/assets/scripts/modal/ModalContent.js +0 -39
- package/dist/esm/assets/scripts/modal/ModalHeader.js +0 -97
- package/dist/esm/assets/scripts/modal/const/classNames.js +0 -23
- package/dist/esm/assets/scripts/modal/const/index.js +0 -2
- package/dist/esm/assets/scripts/modal/const/types.js +0 -1
- package/dist/esm/assets/scripts/modal/index.js +0 -15
- package/dist/esm/assets/scripts/modal/utils/contentUtils.js +0 -28
- package/dist/esm/assets/scripts/notification/FloatingNotification.js +0 -172
- package/dist/esm/assets/scripts/notification/FullWidthNotification.js +0 -125
- package/dist/esm/assets/scripts/notification/MessageNotification.js +0 -152
- package/dist/esm/assets/scripts/notification/Notification.js +0 -94
- package/dist/esm/assets/scripts/notification/const/classNames.js +0 -44
- package/dist/esm/assets/scripts/notification/const/icons.js +0 -25
- package/dist/esm/assets/scripts/notification/const/index.js +0 -4
- package/dist/esm/assets/scripts/notification/const/sizes.js +0 -40
- package/dist/esm/assets/scripts/notification/const/types.js +0 -8
- package/dist/esm/assets/scripts/notification/index.js +0 -11
- package/dist/esm/assets/scripts/notification/utils.js +0 -84
- package/dist/esm/assets/scripts/progress-bar/ProgressBar.js +0 -264
- package/dist/esm/assets/scripts/progress-bar/index.js +0 -1
- package/dist/esm/assets/scripts/selectBox.js +0 -162
- package/dist/esm/assets/scripts/shared/ButtonCloseX.js +0 -37
- package/dist/esm/assets/scripts/tab.js +0 -33
- package/dist/esm/assets/scripts/table/Table.js +0 -370
- package/dist/esm/assets/scripts/table/const/classNames.js +0 -27
- package/dist/esm/assets/scripts/table/const/index.js +0 -2
- package/dist/esm/assets/scripts/table/const/types.js +0 -1
- package/dist/esm/assets/scripts/table/index.js +0 -8
- package/dist/esm/assets/scripts/tag/Tag.js +0 -254
- package/dist/esm/assets/scripts/tag/const/classNames.js +0 -12
- package/dist/esm/assets/scripts/tag/const/index.js +0 -3
- package/dist/esm/assets/scripts/tag/const/sizes.js +0 -7
- package/dist/esm/assets/scripts/tag/const/types.js +0 -1
- package/dist/esm/assets/scripts/tag/index.js +0 -9
- package/dist/esm/assets/scripts/tooltip/Tooltip.js +0 -346
- package/dist/esm/assets/scripts/tooltip/TooltipLayerManager.js +0 -75
- package/dist/esm/assets/scripts/tooltip/const/classNames.js +0 -23
- package/dist/esm/assets/scripts/tooltip/const/constants.js +0 -50
- package/dist/esm/assets/scripts/tooltip/const/icons.js +0 -9
- package/dist/esm/assets/scripts/tooltip/const/index.js +0 -4
- package/dist/esm/assets/scripts/tooltip/const/templates.js +0 -59
- package/dist/esm/assets/scripts/tooltip/const/types.js +0 -1
- package/dist/esm/assets/scripts/tooltip/index.js +0 -10
- package/dist/esm/assets/scripts/tooltip/utils.js +0 -34
- package/dist/esm/assets/scripts/utils/debounce.js +0 -26
- package/dist/esm/assets/scripts/utils/unifiedBox/domRenderer.js +0 -363
- package/dist/esm/assets/scripts/utils/unifiedBox/dropdownModel.js +0 -279
- package/dist/esm/assets/scripts/utils/unifiedBox/unifiedBoxController.js +0 -615
- package/dist/esm/assets/scripts/utils/unifiedBox/unifiedBoxManager.js +0 -466
- package/dist/temp/assets/scripts/baseBox.d.ts +0 -55
- package/dist/temp/assets/scripts/baseBox.js +0 -140
- package/dist/temp/assets/scripts/comboBox.d.ts +0 -60
- package/dist/temp/assets/scripts/comboBox.js +0 -132
- package/dist/temp/assets/scripts/datePicker.d.ts +0 -86
- package/dist/temp/assets/scripts/datePicker.js +0 -699
- package/dist/temp/assets/scripts/featuredIcon.d.ts +0 -22
- package/dist/temp/assets/scripts/featuredIcon.js +0 -79
- package/dist/temp/assets/scripts/fileInput/const/classNames.d.ts +0 -15
- package/dist/temp/assets/scripts/fileInput/const/classNames.js +0 -16
- package/dist/temp/assets/scripts/fileInput/const/index.d.ts +0 -2
- package/dist/temp/assets/scripts/fileInput/const/index.js +0 -2
- package/dist/temp/assets/scripts/fileInput/const/types.d.ts +0 -88
- package/dist/temp/assets/scripts/fileInput/const/types.js +0 -7
- package/dist/temp/assets/scripts/fileInput/fileInput.d.ts +0 -13
- package/dist/temp/assets/scripts/fileInput/fileInput.js +0 -71
- package/dist/temp/assets/scripts/fileInput/fileInputModel.d.ts +0 -12
- package/dist/temp/assets/scripts/fileInput/fileInputModel.js +0 -37
- package/dist/temp/assets/scripts/fileInput/fileInputView.d.ts +0 -42
- package/dist/temp/assets/scripts/fileInput/fileInputView.js +0 -145
- package/dist/temp/assets/scripts/fileInput/index.d.ts +0 -3
- package/dist/temp/assets/scripts/fileInput/index.js +0 -9
- package/dist/temp/assets/scripts/imageFileInput/ImageFileInput.d.ts +0 -63
- package/dist/temp/assets/scripts/imageFileInput/ImageFileInput.js +0 -180
- package/dist/temp/assets/scripts/imageFileInput/ImageFileInputModel.d.ts +0 -73
- package/dist/temp/assets/scripts/imageFileInput/ImageFileInputModel.js +0 -214
- package/dist/temp/assets/scripts/imageFileInput/ImageFileInputView.d.ts +0 -79
- package/dist/temp/assets/scripts/imageFileInput/ImageFileInputView.js +0 -350
- package/dist/temp/assets/scripts/imageFileInput/const/classNames.d.ts +0 -19
- package/dist/temp/assets/scripts/imageFileInput/const/classNames.js +0 -20
- package/dist/temp/assets/scripts/imageFileInput/const/index.d.ts +0 -2
- package/dist/temp/assets/scripts/imageFileInput/const/index.js +0 -2
- package/dist/temp/assets/scripts/imageFileInput/const/types.d.ts +0 -125
- package/dist/temp/assets/scripts/imageFileInput/const/types.js +0 -7
- package/dist/temp/assets/scripts/imageFileInput/index.d.ts +0 -3
- package/dist/temp/assets/scripts/imageFileInput/index.js +0 -9
- package/dist/temp/assets/scripts/index.d.ts +0 -34
- package/dist/temp/assets/scripts/index.js +0 -30
- package/dist/temp/assets/scripts/modal/Modal.d.ts +0 -27
- package/dist/temp/assets/scripts/modal/Modal.js +0 -100
- package/dist/temp/assets/scripts/modal/ModalActions.d.ts +0 -18
- package/dist/temp/assets/scripts/modal/ModalActions.js +0 -117
- package/dist/temp/assets/scripts/modal/ModalContent.d.ts +0 -13
- package/dist/temp/assets/scripts/modal/ModalContent.js +0 -39
- package/dist/temp/assets/scripts/modal/ModalHeader.d.ts +0 -15
- package/dist/temp/assets/scripts/modal/ModalHeader.js +0 -96
- package/dist/temp/assets/scripts/modal/const/classNames.d.ts +0 -22
- package/dist/temp/assets/scripts/modal/const/classNames.js +0 -23
- package/dist/temp/assets/scripts/modal/const/index.d.ts +0 -2
- package/dist/temp/assets/scripts/modal/const/index.js +0 -2
- package/dist/temp/assets/scripts/modal/const/types.d.ts +0 -61
- package/dist/temp/assets/scripts/modal/const/types.js +0 -1
- package/dist/temp/assets/scripts/modal/index.d.ts +0 -7
- package/dist/temp/assets/scripts/modal/index.js +0 -15
- package/dist/temp/assets/scripts/modal/utils/contentUtils.d.ts +0 -10
- package/dist/temp/assets/scripts/modal/utils/contentUtils.js +0 -29
- package/dist/temp/assets/scripts/notification/FloatingNotification.d.ts +0 -24
- package/dist/temp/assets/scripts/notification/FloatingNotification.js +0 -157
- package/dist/temp/assets/scripts/notification/FullWidthNotification.d.ts +0 -21
- package/dist/temp/assets/scripts/notification/FullWidthNotification.js +0 -110
- package/dist/temp/assets/scripts/notification/MessageNotification.d.ts +0 -22
- package/dist/temp/assets/scripts/notification/MessageNotification.js +0 -140
- package/dist/temp/assets/scripts/notification/Notification.d.ts +0 -21
- package/dist/temp/assets/scripts/notification/Notification.js +0 -94
- package/dist/temp/assets/scripts/notification/const/classNames.d.ts +0 -43
- package/dist/temp/assets/scripts/notification/const/classNames.js +0 -44
- package/dist/temp/assets/scripts/notification/const/icons.d.ts +0 -25
- package/dist/temp/assets/scripts/notification/const/icons.js +0 -25
- package/dist/temp/assets/scripts/notification/const/index.d.ts +0 -5
- package/dist/temp/assets/scripts/notification/const/index.js +0 -4
- package/dist/temp/assets/scripts/notification/const/sizes.d.ts +0 -32
- package/dist/temp/assets/scripts/notification/const/sizes.js +0 -40
- package/dist/temp/assets/scripts/notification/const/types.d.ts +0 -19
- package/dist/temp/assets/scripts/notification/const/types.js +0 -8
- package/dist/temp/assets/scripts/notification/index.d.ts +0 -7
- package/dist/temp/assets/scripts/notification/index.js +0 -11
- package/dist/temp/assets/scripts/notification/utils.d.ts +0 -8
- package/dist/temp/assets/scripts/notification/utils.js +0 -89
- package/dist/temp/assets/scripts/progress-bar/ProgressBar.d.ts +0 -67
- package/dist/temp/assets/scripts/progress-bar/ProgressBar.js +0 -263
- package/dist/temp/assets/scripts/progress-bar/index.d.ts +0 -1
- package/dist/temp/assets/scripts/progress-bar/index.js +0 -1
- package/dist/temp/assets/scripts/selectBox.d.ts +0 -50
- package/dist/temp/assets/scripts/selectBox.js +0 -170
- package/dist/temp/assets/scripts/shared/ButtonCloseX.d.ts +0 -5
- package/dist/temp/assets/scripts/shared/ButtonCloseX.js +0 -33
- package/dist/temp/assets/scripts/tab.d.ts +0 -7
- package/dist/temp/assets/scripts/tab.js +0 -33
- package/dist/temp/assets/scripts/table/Table.d.ts +0 -41
- package/dist/temp/assets/scripts/table/Table.js +0 -378
- package/dist/temp/assets/scripts/table/const/classNames.d.ts +0 -27
- package/dist/temp/assets/scripts/table/const/classNames.js +0 -27
- package/dist/temp/assets/scripts/table/const/index.d.ts +0 -2
- package/dist/temp/assets/scripts/table/const/index.js +0 -2
- package/dist/temp/assets/scripts/table/const/types.d.ts +0 -23
- package/dist/temp/assets/scripts/table/const/types.js +0 -1
- package/dist/temp/assets/scripts/table/index.d.ts +0 -3
- package/dist/temp/assets/scripts/table/index.js +0 -8
- package/dist/temp/assets/scripts/tag/Tag.d.ts +0 -27
- package/dist/temp/assets/scripts/tag/Tag.js +0 -259
- package/dist/temp/assets/scripts/tag/const/classNames.d.ts +0 -11
- package/dist/temp/assets/scripts/tag/const/classNames.js +0 -12
- package/dist/temp/assets/scripts/tag/const/index.d.ts +0 -3
- package/dist/temp/assets/scripts/tag/const/index.js +0 -3
- package/dist/temp/assets/scripts/tag/const/sizes.d.ts +0 -7
- package/dist/temp/assets/scripts/tag/const/sizes.js +0 -7
- package/dist/temp/assets/scripts/tag/const/types.d.ts +0 -33
- package/dist/temp/assets/scripts/tag/const/types.js +0 -1
- package/dist/temp/assets/scripts/tag/index.d.ts +0 -3
- package/dist/temp/assets/scripts/tag/index.js +0 -9
- package/dist/temp/assets/scripts/tooltip/Tooltip.d.ts +0 -54
- package/dist/temp/assets/scripts/tooltip/Tooltip.js +0 -335
- package/dist/temp/assets/scripts/tooltip/TooltipLayerManager.d.ts +0 -21
- package/dist/temp/assets/scripts/tooltip/TooltipLayerManager.js +0 -71
- package/dist/temp/assets/scripts/tooltip/const/classNames.d.ts +0 -17
- package/dist/temp/assets/scripts/tooltip/const/classNames.js +0 -23
- package/dist/temp/assets/scripts/tooltip/const/constants.d.ts +0 -33
- package/dist/temp/assets/scripts/tooltip/const/constants.js +0 -46
- package/dist/temp/assets/scripts/tooltip/const/icons.d.ts +0 -4
- package/dist/temp/assets/scripts/tooltip/const/icons.js +0 -9
- package/dist/temp/assets/scripts/tooltip/const/index.d.ts +0 -5
- package/dist/temp/assets/scripts/tooltip/const/index.js +0 -4
- package/dist/temp/assets/scripts/tooltip/const/templates.d.ts +0 -16
- package/dist/temp/assets/scripts/tooltip/const/templates.js +0 -59
- package/dist/temp/assets/scripts/tooltip/const/types.d.ts +0 -14
- package/dist/temp/assets/scripts/tooltip/const/types.js +0 -1
- package/dist/temp/assets/scripts/tooltip/index.d.ts +0 -6
- package/dist/temp/assets/scripts/tooltip/index.js +0 -10
- package/dist/temp/assets/scripts/tooltip/utils.d.ts +0 -2
- package/dist/temp/assets/scripts/tooltip/utils.js +0 -33
- package/dist/temp/assets/scripts/utils/debounce.d.ts +0 -8
- package/dist/temp/assets/scripts/utils/debounce.js +0 -23
- package/dist/temp/assets/scripts/utils/unifiedBox/domRenderer.d.ts +0 -107
- package/dist/temp/assets/scripts/utils/unifiedBox/domRenderer.js +0 -367
- package/dist/temp/assets/scripts/utils/unifiedBox/dropdownModel.d.ts +0 -142
- package/dist/temp/assets/scripts/utils/unifiedBox/dropdownModel.js +0 -286
- package/dist/temp/assets/scripts/utils/unifiedBox/unifiedBoxController.d.ts +0 -156
- package/dist/temp/assets/scripts/utils/unifiedBox/unifiedBoxController.js +0 -604
- package/dist/temp/assets/scripts/utils/unifiedBox/unifiedBoxManager.d.ts +0 -95
- package/dist/temp/assets/scripts/utils/unifiedBox/unifiedBoxManager.js +0 -482
- package/dist/types/assets/scripts/baseBox.d.ts +0 -55
- package/dist/types/assets/scripts/comboBox.d.ts +0 -60
- package/dist/types/assets/scripts/datePicker.d.ts +0 -86
- package/dist/types/assets/scripts/featuredIcon.d.ts +0 -22
- package/dist/types/assets/scripts/fileInput/const/classNames.d.ts +0 -15
- package/dist/types/assets/scripts/fileInput/const/index.d.ts +0 -2
- package/dist/types/assets/scripts/fileInput/const/types.d.ts +0 -88
- package/dist/types/assets/scripts/fileInput/fileInput.d.ts +0 -13
- package/dist/types/assets/scripts/fileInput/fileInputModel.d.ts +0 -12
- package/dist/types/assets/scripts/fileInput/fileInputView.d.ts +0 -42
- package/dist/types/assets/scripts/fileInput/index.d.ts +0 -3
- package/dist/types/assets/scripts/imageFileInput/ImageFileInput.d.ts +0 -63
- package/dist/types/assets/scripts/imageFileInput/ImageFileInputModel.d.ts +0 -73
- package/dist/types/assets/scripts/imageFileInput/ImageFileInputView.d.ts +0 -79
- package/dist/types/assets/scripts/imageFileInput/const/classNames.d.ts +0 -19
- package/dist/types/assets/scripts/imageFileInput/const/index.d.ts +0 -2
- package/dist/types/assets/scripts/imageFileInput/const/types.d.ts +0 -125
- package/dist/types/assets/scripts/imageFileInput/index.d.ts +0 -3
- package/dist/types/assets/scripts/index.d.ts +0 -34
- package/dist/types/assets/scripts/modal/Modal.d.ts +0 -27
- package/dist/types/assets/scripts/modal/ModalActions.d.ts +0 -18
- package/dist/types/assets/scripts/modal/ModalContent.d.ts +0 -13
- package/dist/types/assets/scripts/modal/ModalHeader.d.ts +0 -15
- package/dist/types/assets/scripts/modal/const/classNames.d.ts +0 -22
- package/dist/types/assets/scripts/modal/const/index.d.ts +0 -2
- package/dist/types/assets/scripts/modal/const/types.d.ts +0 -61
- package/dist/types/assets/scripts/modal/index.d.ts +0 -7
- package/dist/types/assets/scripts/modal/utils/contentUtils.d.ts +0 -10
- package/dist/types/assets/scripts/notification/FloatingNotification.d.ts +0 -24
- package/dist/types/assets/scripts/notification/FullWidthNotification.d.ts +0 -21
- package/dist/types/assets/scripts/notification/MessageNotification.d.ts +0 -22
- package/dist/types/assets/scripts/notification/Notification.d.ts +0 -21
- package/dist/types/assets/scripts/notification/const/classNames.d.ts +0 -43
- package/dist/types/assets/scripts/notification/const/icons.d.ts +0 -25
- package/dist/types/assets/scripts/notification/const/index.d.ts +0 -5
- package/dist/types/assets/scripts/notification/const/sizes.d.ts +0 -32
- package/dist/types/assets/scripts/notification/const/types.d.ts +0 -19
- package/dist/types/assets/scripts/notification/index.d.ts +0 -7
- package/dist/types/assets/scripts/notification/utils.d.ts +0 -8
- package/dist/types/assets/scripts/progress-bar/ProgressBar.d.ts +0 -67
- package/dist/types/assets/scripts/progress-bar/index.d.ts +0 -1
- package/dist/types/assets/scripts/selectBox.d.ts +0 -50
- package/dist/types/assets/scripts/shared/ButtonCloseX.d.ts +0 -5
- package/dist/types/assets/scripts/tab.d.ts +0 -7
- package/dist/types/assets/scripts/table/Table.d.ts +0 -41
- package/dist/types/assets/scripts/table/const/classNames.d.ts +0 -27
- package/dist/types/assets/scripts/table/const/index.d.ts +0 -2
- package/dist/types/assets/scripts/table/const/types.d.ts +0 -23
- package/dist/types/assets/scripts/table/index.d.ts +0 -3
- package/dist/types/assets/scripts/tag/Tag.d.ts +0 -27
- package/dist/types/assets/scripts/tag/const/classNames.d.ts +0 -11
- package/dist/types/assets/scripts/tag/const/index.d.ts +0 -3
- package/dist/types/assets/scripts/tag/const/sizes.d.ts +0 -7
- package/dist/types/assets/scripts/tag/const/types.d.ts +0 -33
- package/dist/types/assets/scripts/tag/index.d.ts +0 -3
- package/dist/types/assets/scripts/tooltip/Tooltip.d.ts +0 -54
- package/dist/types/assets/scripts/tooltip/TooltipLayerManager.d.ts +0 -21
- package/dist/types/assets/scripts/tooltip/const/classNames.d.ts +0 -17
- package/dist/types/assets/scripts/tooltip/const/constants.d.ts +0 -33
- package/dist/types/assets/scripts/tooltip/const/icons.d.ts +0 -4
- package/dist/types/assets/scripts/tooltip/const/index.d.ts +0 -5
- package/dist/types/assets/scripts/tooltip/const/templates.d.ts +0 -16
- package/dist/types/assets/scripts/tooltip/const/types.d.ts +0 -14
- package/dist/types/assets/scripts/tooltip/index.d.ts +0 -6
- package/dist/types/assets/scripts/tooltip/utils.d.ts +0 -2
- package/dist/types/assets/scripts/utils/debounce.d.ts +0 -8
- package/dist/types/assets/scripts/utils/unifiedBox/domRenderer.d.ts +0 -107
- package/dist/types/assets/scripts/utils/unifiedBox/dropdownModel.d.ts +0 -142
- package/dist/types/assets/scripts/utils/unifiedBox/unifiedBoxController.d.ts +0 -156
- package/dist/types/assets/scripts/utils/unifiedBox/unifiedBoxManager.d.ts +0 -95
- /package/dist/cjs/{assets/scripts/modal/const/types.js → src/types/component-meta.js} +0 -0
|
@@ -1,370 +0,0 @@
|
|
|
1
|
-
import { TABLE_CLASS_NAMES } from './const/classNames';
|
|
2
|
-
const TABLE_DIMENSIONS = {
|
|
3
|
-
CHECKBOX_CELL_WIDTH: '56px',
|
|
4
|
-
HEADER_HEIGHT: 40,
|
|
5
|
-
ROW_MIN_HEIGHT: 48,
|
|
6
|
-
CHECKBOX_PADDING: '16px'
|
|
7
|
-
};
|
|
8
|
-
const SORT_SVG = {
|
|
9
|
-
none: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.5 6L8 2.5L11.5 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M4.5 10L8 13.5L11.5 10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,
|
|
10
|
-
asc: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.5 9.5L8 6L11.5 9.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,
|
|
11
|
-
desc: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.5 6.5L8 10L11.5 6.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`
|
|
12
|
-
};
|
|
13
|
-
const ARIA_SORT_VALUES = {
|
|
14
|
-
asc: 'ascending',
|
|
15
|
-
desc: 'descending',
|
|
16
|
-
none: 'none'
|
|
17
|
-
};
|
|
18
|
-
export class Table {
|
|
19
|
-
constructor(options) {
|
|
20
|
-
this.theadElement = null;
|
|
21
|
-
this.sortState = new Map();
|
|
22
|
-
this.selectedIndices = new Set();
|
|
23
|
-
this.abortController = new AbortController();
|
|
24
|
-
this.options = {
|
|
25
|
-
type: 'horizontal',
|
|
26
|
-
hoverable: true,
|
|
27
|
-
selectable: false,
|
|
28
|
-
fixedHeader: false,
|
|
29
|
-
emptyText: '등록된 게시물이 없습니다.',
|
|
30
|
-
...options
|
|
31
|
-
};
|
|
32
|
-
this.createElement();
|
|
33
|
-
}
|
|
34
|
-
createElement() {
|
|
35
|
-
this.createOuterElement();
|
|
36
|
-
this.createTableElement();
|
|
37
|
-
this.renderBody();
|
|
38
|
-
this.wrapWithScrollContainer();
|
|
39
|
-
}
|
|
40
|
-
createOuterElement() {
|
|
41
|
-
this.element = document.createElement('div');
|
|
42
|
-
this.updateOuterClasses();
|
|
43
|
-
}
|
|
44
|
-
createTableElement() {
|
|
45
|
-
this.tableElement = document.createElement('table');
|
|
46
|
-
this.tableElement.className = TABLE_CLASS_NAMES.tableElement;
|
|
47
|
-
this.tableElement.setAttribute('role', 'table');
|
|
48
|
-
if (this.options.columns) {
|
|
49
|
-
this.createColGroup();
|
|
50
|
-
if (this.options.type === 'horizontal') {
|
|
51
|
-
this.createHeader();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
this.tbodyElement = document.createElement('tbody');
|
|
55
|
-
this.tbodyElement.className = TABLE_CLASS_NAMES.body;
|
|
56
|
-
this.tableElement.appendChild(this.tbodyElement);
|
|
57
|
-
}
|
|
58
|
-
wrapWithScrollContainer() {
|
|
59
|
-
if (this.options.fixedHeader && this.options.maxHeight) {
|
|
60
|
-
const scrollContainer = document.createElement('div');
|
|
61
|
-
scrollContainer.className = TABLE_CLASS_NAMES.scrollContainer;
|
|
62
|
-
scrollContainer.style.maxHeight = this.options.maxHeight;
|
|
63
|
-
scrollContainer.appendChild(this.tableElement);
|
|
64
|
-
this.element.appendChild(scrollContainer);
|
|
65
|
-
} else {
|
|
66
|
-
this.element.appendChild(this.tableElement);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
updateOuterClasses() {
|
|
70
|
-
const classes = [TABLE_CLASS_NAMES.table];
|
|
71
|
-
if (this.options.type === 'horizontal') {
|
|
72
|
-
classes.push(TABLE_CLASS_NAMES.horizontal);
|
|
73
|
-
} else {
|
|
74
|
-
classes.push(TABLE_CLASS_NAMES.vertical);
|
|
75
|
-
}
|
|
76
|
-
if (this.options.hoverable && this.options.type === 'horizontal') {
|
|
77
|
-
classes.push(TABLE_CLASS_NAMES.hoverable);
|
|
78
|
-
}
|
|
79
|
-
if (this.options.fixedHeader) {
|
|
80
|
-
classes.push(TABLE_CLASS_NAMES.fixedHeader);
|
|
81
|
-
}
|
|
82
|
-
this.element.className = classes.join(' ');
|
|
83
|
-
}
|
|
84
|
-
createColGroup() {
|
|
85
|
-
const colgroup = document.createElement('colgroup');
|
|
86
|
-
if (this.options.selectable) {
|
|
87
|
-
const column = document.createElement('col');
|
|
88
|
-
column.style.width = TABLE_DIMENSIONS.CHECKBOX_CELL_WIDTH;
|
|
89
|
-
colgroup.appendChild(column);
|
|
90
|
-
}
|
|
91
|
-
for (const columnConfig of this.options.columns ?? []) {
|
|
92
|
-
const column = document.createElement('col');
|
|
93
|
-
if (columnConfig.width) {
|
|
94
|
-
column.style.width = columnConfig.width;
|
|
95
|
-
}
|
|
96
|
-
colgroup.appendChild(column);
|
|
97
|
-
}
|
|
98
|
-
this.tableElement.appendChild(colgroup);
|
|
99
|
-
}
|
|
100
|
-
createHeader() {
|
|
101
|
-
this.theadElement = document.createElement('thead');
|
|
102
|
-
this.theadElement.className = TABLE_CLASS_NAMES.header;
|
|
103
|
-
const tableRow = document.createElement('tr');
|
|
104
|
-
if (this.options.selectable) {
|
|
105
|
-
tableRow.appendChild(this.createHeaderCheckboxCell());
|
|
106
|
-
}
|
|
107
|
-
for (const column of this.options.columns ?? []) {
|
|
108
|
-
tableRow.appendChild(this.createHeaderDataCell(column));
|
|
109
|
-
}
|
|
110
|
-
this.theadElement.appendChild(tableRow);
|
|
111
|
-
this.tableElement.appendChild(this.theadElement);
|
|
112
|
-
}
|
|
113
|
-
createHeaderCheckboxCell() {
|
|
114
|
-
const headerCell = document.createElement('th');
|
|
115
|
-
headerCell.className = `${TABLE_CLASS_NAMES.checkboxCell} ${TABLE_CLASS_NAMES.checkboxCellHeader}`;
|
|
116
|
-
const wrapper = document.createElement('span');
|
|
117
|
-
wrapper.className = 'ncua-checkbox-input ncua-checkbox-input--sm';
|
|
118
|
-
const checkbox = document.createElement('input');
|
|
119
|
-
checkbox.type = 'checkbox';
|
|
120
|
-
checkbox.setAttribute('aria-label', '전체 선택');
|
|
121
|
-
checkbox.addEventListener('change', () => this.handleSelectAll(checkbox.checked), {
|
|
122
|
-
signal: this.abortController.signal
|
|
123
|
-
});
|
|
124
|
-
wrapper.appendChild(checkbox);
|
|
125
|
-
headerCell.appendChild(wrapper);
|
|
126
|
-
return headerCell;
|
|
127
|
-
}
|
|
128
|
-
createHeaderDataCell(column) {
|
|
129
|
-
const headerCell = document.createElement('th');
|
|
130
|
-
headerCell.className = TABLE_CLASS_NAMES.headerCell;
|
|
131
|
-
if (column.width) {
|
|
132
|
-
headerCell.style.width = column.width;
|
|
133
|
-
}
|
|
134
|
-
const innerContainer = document.createElement('span');
|
|
135
|
-
innerContainer.className = 'ncua-table__header-cell-inner';
|
|
136
|
-
const textSpan = document.createElement('span');
|
|
137
|
-
textSpan.className = 'ncua-table__header-cell-text';
|
|
138
|
-
textSpan.textContent = column.label;
|
|
139
|
-
innerContainer.appendChild(textSpan);
|
|
140
|
-
if (column.sortable) {
|
|
141
|
-
headerCell.classList.add(TABLE_CLASS_NAMES.headerCellSortable);
|
|
142
|
-
this.sortState.set(column.key, 'none');
|
|
143
|
-
const sortIcon = document.createElement('span');
|
|
144
|
-
sortIcon.className = TABLE_CLASS_NAMES.sortIcon;
|
|
145
|
-
sortIcon.innerHTML = SORT_SVG.none;
|
|
146
|
-
innerContainer.appendChild(sortIcon);
|
|
147
|
-
headerCell.addEventListener('click', () => this.handleSort(column.key, headerCell), {
|
|
148
|
-
signal: this.abortController.signal
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
headerCell.appendChild(innerContainer);
|
|
152
|
-
return headerCell;
|
|
153
|
-
}
|
|
154
|
-
renderBody() {
|
|
155
|
-
this.tbodyElement.innerHTML = '';
|
|
156
|
-
const data = this.options.data || [];
|
|
157
|
-
if (data.length === 0) {
|
|
158
|
-
this.renderEmptyState();
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
if (this.options.type === 'vertical') {
|
|
162
|
-
this.renderVerticalBody(data);
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
this.renderHorizontalBody(data);
|
|
166
|
-
}
|
|
167
|
-
renderEmptyState() {
|
|
168
|
-
const columnCount = (this.options.columns?.length || 1) + (this.options.selectable ? 1 : 0);
|
|
169
|
-
const tableRow = document.createElement('tr');
|
|
170
|
-
const tableCell = document.createElement('td');
|
|
171
|
-
tableCell.colSpan = columnCount;
|
|
172
|
-
tableCell.className = TABLE_CLASS_NAMES.empty;
|
|
173
|
-
tableCell.setAttribute('role', 'status');
|
|
174
|
-
tableCell.setAttribute('aria-live', 'polite');
|
|
175
|
-
tableCell.textContent = this.options.emptyText;
|
|
176
|
-
tableRow.appendChild(tableCell);
|
|
177
|
-
this.tbodyElement.appendChild(tableRow);
|
|
178
|
-
}
|
|
179
|
-
renderHorizontalBody(data) {
|
|
180
|
-
for (let rowIndex = 0; rowIndex < data.length; rowIndex++) {
|
|
181
|
-
const tableRow = this.createHorizontalRow(data[rowIndex], rowIndex);
|
|
182
|
-
this.tbodyElement.appendChild(tableRow);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
createRowCheckboxCell(rowIndex) {
|
|
186
|
-
const tableCell = document.createElement('td');
|
|
187
|
-
tableCell.className = `${TABLE_CLASS_NAMES.checkboxCell} ${TABLE_CLASS_NAMES.checkboxCellBody}`;
|
|
188
|
-
const wrapper = document.createElement('span');
|
|
189
|
-
wrapper.className = 'ncua-checkbox-input ncua-checkbox-input--sm';
|
|
190
|
-
const checkbox = document.createElement('input');
|
|
191
|
-
checkbox.type = 'checkbox';
|
|
192
|
-
checkbox.checked = this.selectedIndices.has(rowIndex);
|
|
193
|
-
checkbox.setAttribute('aria-label', '행 선택');
|
|
194
|
-
checkbox.addEventListener('change', () => this.handleRowSelect(rowIndex, checkbox.checked), {
|
|
195
|
-
signal: this.abortController.signal
|
|
196
|
-
});
|
|
197
|
-
if (this.selectedIndices.has(rowIndex)) {
|
|
198
|
-
wrapper.classList.add('has-checked');
|
|
199
|
-
}
|
|
200
|
-
wrapper.appendChild(checkbox);
|
|
201
|
-
tableCell.appendChild(wrapper);
|
|
202
|
-
return tableCell;
|
|
203
|
-
}
|
|
204
|
-
createHorizontalRow(row, rowIndex) {
|
|
205
|
-
const tableRow = document.createElement('tr');
|
|
206
|
-
tableRow.className = TABLE_CLASS_NAMES.row;
|
|
207
|
-
if (this.selectedIndices.has(rowIndex)) {
|
|
208
|
-
tableRow.classList.add(TABLE_CLASS_NAMES.rowSelected);
|
|
209
|
-
}
|
|
210
|
-
if (this.options.selectable) {
|
|
211
|
-
tableRow.appendChild(this.createRowCheckboxCell(rowIndex));
|
|
212
|
-
}
|
|
213
|
-
for (const column of this.options.columns ?? []) {
|
|
214
|
-
const tableCell = document.createElement('td');
|
|
215
|
-
tableCell.className = TABLE_CLASS_NAMES.cell;
|
|
216
|
-
if (column.align) {
|
|
217
|
-
tableCell.style.textAlign = column.align;
|
|
218
|
-
}
|
|
219
|
-
if (column.render) {
|
|
220
|
-
const rendered = column.render(row[column.key], row, rowIndex);
|
|
221
|
-
if (typeof rendered === 'string') {
|
|
222
|
-
tableCell.textContent = rendered;
|
|
223
|
-
} else {
|
|
224
|
-
tableCell.appendChild(rendered);
|
|
225
|
-
}
|
|
226
|
-
} else {
|
|
227
|
-
const value = row[column.key];
|
|
228
|
-
tableCell.textContent = value != null ? String(value) : '-';
|
|
229
|
-
}
|
|
230
|
-
tableRow.appendChild(tableCell);
|
|
231
|
-
}
|
|
232
|
-
return tableRow;
|
|
233
|
-
}
|
|
234
|
-
renderVerticalBody(data) {
|
|
235
|
-
const row = data[0] || {};
|
|
236
|
-
for (const column of this.options.columns ?? []) {
|
|
237
|
-
const tableRow = this.createVerticalRow(column, row);
|
|
238
|
-
this.tbodyElement.appendChild(tableRow);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
createVerticalRow(column, row) {
|
|
242
|
-
const tableRow = document.createElement('tr');
|
|
243
|
-
tableRow.className = TABLE_CLASS_NAMES.row;
|
|
244
|
-
const labelCell = document.createElement('td');
|
|
245
|
-
labelCell.className = TABLE_CLASS_NAMES.cell;
|
|
246
|
-
labelCell.textContent = column.label;
|
|
247
|
-
tableRow.appendChild(labelCell);
|
|
248
|
-
const valueCell = this.createVerticalValueCell(column, row);
|
|
249
|
-
tableRow.appendChild(valueCell);
|
|
250
|
-
return tableRow;
|
|
251
|
-
}
|
|
252
|
-
createVerticalValueCell(column, row) {
|
|
253
|
-
const valueCell = document.createElement('td');
|
|
254
|
-
valueCell.className = TABLE_CLASS_NAMES.cell;
|
|
255
|
-
if (column.render) {
|
|
256
|
-
const rendered = column.render(row[column.key], row, 0);
|
|
257
|
-
if (typeof rendered === 'string') {
|
|
258
|
-
valueCell.textContent = rendered;
|
|
259
|
-
} else {
|
|
260
|
-
valueCell.appendChild(rendered);
|
|
261
|
-
}
|
|
262
|
-
} else {
|
|
263
|
-
const value = row[column.key];
|
|
264
|
-
valueCell.textContent = value != null ? String(value) : '-';
|
|
265
|
-
}
|
|
266
|
-
return valueCell;
|
|
267
|
-
}
|
|
268
|
-
handleSort(key, thElement) {
|
|
269
|
-
const nextDirection = this.getNextSortDirection(key);
|
|
270
|
-
for (const [sortKey] of this.sortState) {
|
|
271
|
-
this.sortState.set(sortKey, 'none');
|
|
272
|
-
}
|
|
273
|
-
this.sortState.set(key, nextDirection);
|
|
274
|
-
this.updateSortIcons(thElement, nextDirection);
|
|
275
|
-
thElement.setAttribute('aria-sort', this.getAriaSortValue(nextDirection));
|
|
276
|
-
this.options.onSort?.(key, nextDirection);
|
|
277
|
-
}
|
|
278
|
-
getNextSortDirection(key) {
|
|
279
|
-
const currentDirection = this.sortState.get(key) || 'none';
|
|
280
|
-
if (currentDirection === 'none') {
|
|
281
|
-
return 'asc';
|
|
282
|
-
}
|
|
283
|
-
if (currentDirection === 'asc') {
|
|
284
|
-
return 'desc';
|
|
285
|
-
}
|
|
286
|
-
return 'none';
|
|
287
|
-
}
|
|
288
|
-
updateSortIcons(thElement, direction) {
|
|
289
|
-
const allHeaders = this.theadElement?.querySelectorAll(`.${TABLE_CLASS_NAMES.headerCell}`);
|
|
290
|
-
allHeaders?.forEach(header => {
|
|
291
|
-
const icon = header.querySelector(`.${TABLE_CLASS_NAMES.sortIcon}`);
|
|
292
|
-
if (icon) {
|
|
293
|
-
icon.innerHTML = SORT_SVG.none;
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
const sortIcon = thElement.querySelector(`.${TABLE_CLASS_NAMES.sortIcon}`);
|
|
297
|
-
if (sortIcon) {
|
|
298
|
-
sortIcon.innerHTML = SORT_SVG[direction];
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
getAriaSortValue(direction) {
|
|
302
|
-
return ARIA_SORT_VALUES[direction];
|
|
303
|
-
}
|
|
304
|
-
handleSelectAll(checked) {
|
|
305
|
-
this.selectedIndices.clear();
|
|
306
|
-
if (checked && this.options.data) {
|
|
307
|
-
for (let index = 0; index < this.options.data.length; index++) {
|
|
308
|
-
this.selectedIndices.add(index);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
this.updateRowSelectionStyles();
|
|
312
|
-
this.updateHeaderCheckbox();
|
|
313
|
-
this.options.onSelect?.([...this.selectedIndices]);
|
|
314
|
-
}
|
|
315
|
-
handleRowSelect(index, checked) {
|
|
316
|
-
if (checked) {
|
|
317
|
-
this.selectedIndices.add(index);
|
|
318
|
-
} else {
|
|
319
|
-
this.selectedIndices.delete(index);
|
|
320
|
-
}
|
|
321
|
-
this.updateRowSelectionStyles();
|
|
322
|
-
this.updateHeaderCheckbox();
|
|
323
|
-
this.options.onSelect?.([...this.selectedIndices]);
|
|
324
|
-
}
|
|
325
|
-
updateRowSelectionStyles() {
|
|
326
|
-
const rows = this.tbodyElement.querySelectorAll(`.${TABLE_CLASS_NAMES.row}`);
|
|
327
|
-
rows.forEach((row, index) => {
|
|
328
|
-
const isSelected = this.selectedIndices.has(index);
|
|
329
|
-
row.classList.toggle(TABLE_CLASS_NAMES.rowSelected, isSelected);
|
|
330
|
-
const checkbox = row.querySelector('input[type="checkbox"]');
|
|
331
|
-
if (checkbox) {
|
|
332
|
-
checkbox.checked = isSelected;
|
|
333
|
-
}
|
|
334
|
-
const wrapper = row.querySelector('.ncua-checkbox-input');
|
|
335
|
-
if (wrapper) {
|
|
336
|
-
wrapper.classList.toggle('has-checked', isSelected);
|
|
337
|
-
}
|
|
338
|
-
});
|
|
339
|
-
}
|
|
340
|
-
updateHeaderCheckbox() {
|
|
341
|
-
const headerWrapper = this.theadElement?.querySelector('.ncua-checkbox-input');
|
|
342
|
-
const headerCheckbox = headerWrapper?.querySelector('input[type="checkbox"]');
|
|
343
|
-
if (!headerWrapper || !headerCheckbox || !this.options.data) return;
|
|
344
|
-
const total = this.options.data.length;
|
|
345
|
-
const selectedCount = this.selectedIndices.size;
|
|
346
|
-
const isAllSelected = selectedCount === total && total > 0;
|
|
347
|
-
const isIndeterminate = selectedCount > 0 && selectedCount < total;
|
|
348
|
-
headerCheckbox.checked = isAllSelected;
|
|
349
|
-
headerCheckbox.indeterminate = isIndeterminate;
|
|
350
|
-
headerWrapper.classList.toggle('has-checked', isAllSelected);
|
|
351
|
-
headerWrapper.classList.toggle('has-indeterminate', isIndeterminate);
|
|
352
|
-
}
|
|
353
|
-
// ──────── Public API ────────
|
|
354
|
-
getElement() {
|
|
355
|
-
return this.element;
|
|
356
|
-
}
|
|
357
|
-
setData(data) {
|
|
358
|
-
this.options.data = data;
|
|
359
|
-
this.selectedIndices.clear();
|
|
360
|
-
this.renderBody();
|
|
361
|
-
this.updateHeaderCheckbox();
|
|
362
|
-
}
|
|
363
|
-
getSelectedIndices() {
|
|
364
|
-
return [...this.selectedIndices];
|
|
365
|
-
}
|
|
366
|
-
destroy() {
|
|
367
|
-
this.abortController.abort();
|
|
368
|
-
this.element.remove();
|
|
369
|
-
}
|
|
370
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export const TABLE_CLASS_NAMES = {
|
|
2
|
-
table: 'ncua-table',
|
|
3
|
-
horizontal: 'ncua-table--horizontal',
|
|
4
|
-
vertical: 'ncua-table--vertical',
|
|
5
|
-
hoverable: 'ncua-table--hoverable',
|
|
6
|
-
fixedHeader: 'ncua-table--fixed-header',
|
|
7
|
-
scrollContainer: 'ncua-table__scroll-container',
|
|
8
|
-
tableElement: 'ncua-table__table',
|
|
9
|
-
header: 'ncua-table__header',
|
|
10
|
-
headerCell: 'ncua-table__header-cell',
|
|
11
|
-
headerCellSortable: 'ncua-table__header-cell--sortable',
|
|
12
|
-
sortIcon: 'ncua-table__sort-icon',
|
|
13
|
-
body: 'ncua-table__body',
|
|
14
|
-
row: 'ncua-table__row',
|
|
15
|
-
rowSelected: 'ncua-table__row--selected',
|
|
16
|
-
rowWarning: 'ncua-table__row--warning',
|
|
17
|
-
rowError: 'ncua-table__row--error',
|
|
18
|
-
cell: 'ncua-table__cell',
|
|
19
|
-
checkboxCell: 'ncua-table__checkbox-cell',
|
|
20
|
-
checkboxCellHeader: 'ncua-table__checkbox-cell--header',
|
|
21
|
-
checkboxCellBody: 'ncua-table__checkbox-cell--body',
|
|
22
|
-
footer: 'ncua-table__footer',
|
|
23
|
-
footerRow: 'ncua-table__footer-row',
|
|
24
|
-
pagination: 'ncua-table__pagination',
|
|
25
|
-
empty: 'ncua-table__empty',
|
|
26
|
-
required: 'ncua-table__required'
|
|
27
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import { TAG_CLASS_NAMES, getTagSizeClassName, getTooltipPositionClassName } from './const/classNames';
|
|
2
|
-
import { iconSize, DEFAULT_TOOLTIP_WIDTH, DEFAULT_TOOLTIP_HEIGHT, MARGIN } from './const/sizes';
|
|
3
|
-
// CSS 변수 값을 가져오는 유틸리티 함수
|
|
4
|
-
const getCSSVariable = function (variableName) {
|
|
5
|
-
let fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
6
|
-
return getComputedStyle(document.documentElement).getPropertyValue(variableName).trim() || fallback;
|
|
7
|
-
};
|
|
8
|
-
// 위치 계산 로직
|
|
9
|
-
const calculateOptimalPosition = (triggerElement, tooltipElement) => {
|
|
10
|
-
const triggerRect = triggerElement.getBoundingClientRect();
|
|
11
|
-
const tooltipRect = tooltipElement.getBoundingClientRect();
|
|
12
|
-
const {
|
|
13
|
-
innerWidth: viewportWidth,
|
|
14
|
-
innerHeight: viewportHeight
|
|
15
|
-
} = window;
|
|
16
|
-
const tooltipWidth = tooltipRect.width || DEFAULT_TOOLTIP_WIDTH;
|
|
17
|
-
const tooltipHeight = tooltipRect.height || DEFAULT_TOOLTIP_HEIGHT;
|
|
18
|
-
const spaces = {
|
|
19
|
-
top: triggerRect.top,
|
|
20
|
-
bottom: viewportHeight - triggerRect.bottom,
|
|
21
|
-
left: triggerRect.left,
|
|
22
|
-
right: viewportWidth - triggerRect.right
|
|
23
|
-
};
|
|
24
|
-
// 위/아래 공간을 먼저 확인하고 우선순위 결정
|
|
25
|
-
const hasTopSpace = spaces.top >= tooltipHeight + MARGIN;
|
|
26
|
-
// 위쪽 공간이 있으면 top 우선, 없으면 bottom 우선
|
|
27
|
-
const positions = hasTopSpace ? ['top-right', 'top-left', 'bottom-right', 'bottom-left'] : ['bottom-right', 'bottom-left', 'top-right', 'top-left'];
|
|
28
|
-
for (const position of positions) {
|
|
29
|
-
const isTop = position.includes('top');
|
|
30
|
-
const isRight = position.includes('right');
|
|
31
|
-
const hasVerticalSpace = isTop ? spaces.top >= tooltipHeight + MARGIN : spaces.bottom >= tooltipHeight + MARGIN;
|
|
32
|
-
const hasHorizontalSpace = isRight ? spaces.right >= tooltipWidth + MARGIN // right 정렬: 툴팁이 오른쪽으로 펼쳐짐
|
|
33
|
-
: spaces.left >= tooltipWidth + MARGIN; // left 정렬: 툴팁이 왼쪽으로 펼쳐짐
|
|
34
|
-
if (hasVerticalSpace && hasHorizontalSpace) {
|
|
35
|
-
return position;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
// 모든 조건이 맞지 않으면 공간이 더 많은 쪽으로
|
|
39
|
-
const fallbackPosition = hasTopSpace ? 'top-right' : 'bottom-right';
|
|
40
|
-
return fallbackPosition;
|
|
41
|
-
};
|
|
42
|
-
export class Tag {
|
|
43
|
-
constructor(options) {
|
|
44
|
-
this.isTooltipVisible = false;
|
|
45
|
-
this.calculatedPosition = 'top-right';
|
|
46
|
-
this.tooltipElement = null;
|
|
47
|
-
this.handleMouseEnter = () => {
|
|
48
|
-
if (!this.shouldTruncate()) return;
|
|
49
|
-
this.isTooltipVisible = true;
|
|
50
|
-
// 위치 계산
|
|
51
|
-
if (this.tooltipElement) {
|
|
52
|
-
const optimalPosition = calculateOptimalPosition(this.element, this.tooltipElement);
|
|
53
|
-
this.calculatedPosition = optimalPosition;
|
|
54
|
-
} else {
|
|
55
|
-
// 툴팁이 없으면 더미 요소로 계산
|
|
56
|
-
const dummyTooltipElement = document.createElement('div');
|
|
57
|
-
dummyTooltipElement.style.width = `${DEFAULT_TOOLTIP_WIDTH}px`;
|
|
58
|
-
dummyTooltipElement.style.height = `${DEFAULT_TOOLTIP_HEIGHT}px`;
|
|
59
|
-
const optimalPosition = calculateOptimalPosition(this.element, dummyTooltipElement);
|
|
60
|
-
this.calculatedPosition = optimalPosition;
|
|
61
|
-
}
|
|
62
|
-
this.createTooltip();
|
|
63
|
-
};
|
|
64
|
-
this.handleMouseLeave = () => {
|
|
65
|
-
this.removeTooltip(); // removeTooltip에서 isTooltipVisible을 false로 설정
|
|
66
|
-
};
|
|
67
|
-
this.options = {
|
|
68
|
-
size: 'sm',
|
|
69
|
-
maxLength: 20,
|
|
70
|
-
...options
|
|
71
|
-
};
|
|
72
|
-
this.createElement();
|
|
73
|
-
}
|
|
74
|
-
createElement() {
|
|
75
|
-
// 메인 태그 요소 생성
|
|
76
|
-
this.element = document.createElement('span');
|
|
77
|
-
this.element.className = this.getTagClasses();
|
|
78
|
-
// 텍스트 길이 체크 및 말줄임 처리
|
|
79
|
-
const shouldTruncate = this.shouldTruncate();
|
|
80
|
-
const displayText = shouldTruncate ? this.getTruncatedText() : this.options.text;
|
|
81
|
-
// 아이콘 추가
|
|
82
|
-
if (this.options.icon) {
|
|
83
|
-
const iconElement = this.createSideSlot(this.options.icon);
|
|
84
|
-
if (iconElement) {
|
|
85
|
-
this.element.appendChild(iconElement);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
// 텍스트 요소 생성
|
|
89
|
-
const textElement = document.createElement('span');
|
|
90
|
-
textElement.className = TAG_CLASS_NAMES.text;
|
|
91
|
-
textElement.textContent = displayText;
|
|
92
|
-
this.element.appendChild(textElement);
|
|
93
|
-
// 카운트 추가
|
|
94
|
-
if (this.options.count) {
|
|
95
|
-
const countElement = document.createElement('span');
|
|
96
|
-
countElement.className = TAG_CLASS_NAMES.count;
|
|
97
|
-
countElement.textContent = this.options.count;
|
|
98
|
-
this.element.appendChild(countElement);
|
|
99
|
-
}
|
|
100
|
-
// 닫기 버튼 추가
|
|
101
|
-
if (this.options.close) {
|
|
102
|
-
const closeButton = this.createCloseButton();
|
|
103
|
-
this.element.appendChild(closeButton);
|
|
104
|
-
}
|
|
105
|
-
// 툴팁 이벤트 리스너 추가 (텍스트가 잘린 경우에만)
|
|
106
|
-
if (shouldTruncate) {
|
|
107
|
-
this.element.addEventListener('mouseenter', this.handleMouseEnter);
|
|
108
|
-
this.element.addEventListener('mouseleave', this.handleMouseLeave);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
getTagClasses() {
|
|
112
|
-
const classes = [TAG_CLASS_NAMES.tag, getTagSizeClassName(this.options.size)];
|
|
113
|
-
if (this.shouldTruncate()) {
|
|
114
|
-
classes.push(TAG_CLASS_NAMES.truncated);
|
|
115
|
-
}
|
|
116
|
-
return classes.join(' ');
|
|
117
|
-
}
|
|
118
|
-
shouldTruncate() {
|
|
119
|
-
return this.options.text.length > this.options.maxLength;
|
|
120
|
-
}
|
|
121
|
-
getTruncatedText() {
|
|
122
|
-
return `${this.options.text.slice(0, this.options.maxLength - 2)}...`;
|
|
123
|
-
}
|
|
124
|
-
createSideSlot(slot) {
|
|
125
|
-
if (slot.type === 'icon') {
|
|
126
|
-
// 아이콘 SVG 문자열을 DOM 요소로 변환 (DOMParser 사용)
|
|
127
|
-
const iconSVG = this.createIconSVG(slot.icon, iconSize[this.options.size], slot.color);
|
|
128
|
-
const parser = new DOMParser();
|
|
129
|
-
const doc = parser.parseFromString(iconSVG, 'image/svg+xml');
|
|
130
|
-
return doc.documentElement;
|
|
131
|
-
}
|
|
132
|
-
if (slot.type === 'dot') {
|
|
133
|
-
const dotElement = document.createElement('span');
|
|
134
|
-
dotElement.className = `ncua-dot ncua-dot--neutral ncua-dot--${slot.size || 'sm'}`;
|
|
135
|
-
if (slot.color) {
|
|
136
|
-
dotElement.style.backgroundColor = slot.color;
|
|
137
|
-
}
|
|
138
|
-
return dotElement;
|
|
139
|
-
}
|
|
140
|
-
// 커스텀 요소는 그대로 반환
|
|
141
|
-
return slot.children;
|
|
142
|
-
}
|
|
143
|
-
createIconSVG(iconName, size, color) {
|
|
144
|
-
const colorStyle = color ? ` style="color: ${color}"` : '';
|
|
145
|
-
// 현재는 arrow-left 아이콘만 지원
|
|
146
|
-
if (iconName === 'arrow-left') {
|
|
147
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" fill="none" viewBox="0 0 24 24" stroke="none"${colorStyle}>
|
|
148
|
-
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H5m0 0 7 7m-7-7 7-7" />
|
|
149
|
-
</svg>`;
|
|
150
|
-
}
|
|
151
|
-
// 기본 빈 SVG
|
|
152
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" fill="none" viewBox="0 0 24 24" stroke="none"${colorStyle}></svg>`;
|
|
153
|
-
}
|
|
154
|
-
createCloseButton() {
|
|
155
|
-
// react와 동일한 구조로 직접 구현
|
|
156
|
-
const button = document.createElement('button');
|
|
157
|
-
button.type = 'button';
|
|
158
|
-
button.className = TAG_CLASS_NAMES.close;
|
|
159
|
-
// React 버전과 동일한 SVG 생성 (문자열 방식)
|
|
160
|
-
const grayColor = getCSSVariable('--gray-300', '#a4a5a8');
|
|
161
|
-
const svgString = `<svg xmlns="http://www.w3.org/2000/svg" width="${iconSize[this.options.size]}" height="${iconSize[this.options.size]}" fill="none" viewBox="0 0 24 24" stroke="none" style="color: ${grayColor}">
|
|
162
|
-
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 6 6 18M6 6l12 12" />
|
|
163
|
-
</svg>`;
|
|
164
|
-
// DOMParser로 SVG 문자열을 DOM 요소로 변환
|
|
165
|
-
const parser = new DOMParser();
|
|
166
|
-
const doc = parser.parseFromString(svgString, 'image/svg+xml');
|
|
167
|
-
const svg = doc.documentElement;
|
|
168
|
-
button.appendChild(svg);
|
|
169
|
-
// 이벤트 리스너 추가
|
|
170
|
-
if (this.options.onButtonClick) {
|
|
171
|
-
button.addEventListener('click', this.options.onButtonClick);
|
|
172
|
-
}
|
|
173
|
-
return button;
|
|
174
|
-
}
|
|
175
|
-
createTooltip() {
|
|
176
|
-
if (this.tooltipElement || !this.isTooltipVisible) {
|
|
177
|
-
return; // 이미 생성됨 또는 표시하지 않음
|
|
178
|
-
}
|
|
179
|
-
this.tooltipElement = document.createElement('span');
|
|
180
|
-
this.tooltipElement.className = `${TAG_CLASS_NAMES.tooltip} ${getTooltipPositionClassName(this.calculatedPosition)}`;
|
|
181
|
-
const tooltipContent = document.createElement('span');
|
|
182
|
-
tooltipContent.className = TAG_CLASS_NAMES.tooltipContent;
|
|
183
|
-
tooltipContent.textContent = this.options.text;
|
|
184
|
-
this.tooltipElement.appendChild(tooltipContent);
|
|
185
|
-
this.element.appendChild(this.tooltipElement);
|
|
186
|
-
}
|
|
187
|
-
removeTooltip() {
|
|
188
|
-
if (this.tooltipElement) {
|
|
189
|
-
this.element.removeChild(this.tooltipElement);
|
|
190
|
-
this.tooltipElement = null;
|
|
191
|
-
}
|
|
192
|
-
this.isTooltipVisible = false;
|
|
193
|
-
}
|
|
194
|
-
getElement() {
|
|
195
|
-
return this.element;
|
|
196
|
-
}
|
|
197
|
-
isTooltipShown() {
|
|
198
|
-
return this.isTooltipVisible;
|
|
199
|
-
}
|
|
200
|
-
setText(text) {
|
|
201
|
-
this.options.text = text;
|
|
202
|
-
this.updateTextElement();
|
|
203
|
-
}
|
|
204
|
-
setCount(count) {
|
|
205
|
-
this.options.count = count;
|
|
206
|
-
this.updateCountElement();
|
|
207
|
-
}
|
|
208
|
-
updateTextElement() {
|
|
209
|
-
const textElement = this.element.querySelector(`.${TAG_CLASS_NAMES.text}`);
|
|
210
|
-
if (textElement) {
|
|
211
|
-
const shouldTruncate = this.shouldTruncate();
|
|
212
|
-
const displayText = shouldTruncate ? this.getTruncatedText() : this.options.text;
|
|
213
|
-
textElement.textContent = displayText;
|
|
214
|
-
// 클래스 업데이트
|
|
215
|
-
if (shouldTruncate) {
|
|
216
|
-
this.element.classList.add(TAG_CLASS_NAMES.truncated);
|
|
217
|
-
} else {
|
|
218
|
-
this.element.classList.remove(TAG_CLASS_NAMES.truncated);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
updateCountElement() {
|
|
223
|
-
const existingCount = this.element.querySelector(`.${TAG_CLASS_NAMES.count}`);
|
|
224
|
-
if (this.options.count) {
|
|
225
|
-
if (existingCount) {
|
|
226
|
-
existingCount.textContent = this.options.count;
|
|
227
|
-
} else {
|
|
228
|
-
// 카운트 요소 새로 생성
|
|
229
|
-
const countElement = document.createElement('span');
|
|
230
|
-
countElement.className = TAG_CLASS_NAMES.count;
|
|
231
|
-
countElement.textContent = this.options.count;
|
|
232
|
-
// 닫기 버튼 앞에 삽입
|
|
233
|
-
const closeButton = this.element.querySelector(`.${TAG_CLASS_NAMES.close}`);
|
|
234
|
-
if (closeButton) {
|
|
235
|
-
this.element.insertBefore(countElement, closeButton);
|
|
236
|
-
} else {
|
|
237
|
-
this.element.appendChild(countElement);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
} else {
|
|
241
|
-
// 카운트 제거
|
|
242
|
-
if (existingCount) {
|
|
243
|
-
this.element.removeChild(existingCount);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
destroy() {
|
|
248
|
-
this.element.removeEventListener('mouseenter', this.handleMouseEnter);
|
|
249
|
-
this.element.removeEventListener('mouseleave', this.handleMouseLeave);
|
|
250
|
-
if (this.tooltipElement) {
|
|
251
|
-
this.removeTooltip();
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Tag 관련 CSS 클래스명 상수
|
|
2
|
-
export const TAG_CLASS_NAMES = {
|
|
3
|
-
tag: 'ncua-tag',
|
|
4
|
-
text: 'ncua-tag__text',
|
|
5
|
-
count: 'ncua-tag__count',
|
|
6
|
-
close: 'ncua-tag__close',
|
|
7
|
-
tooltip: 'ncua-tag__tooltip',
|
|
8
|
-
tooltipContent: 'ncua-tag__tooltip-content',
|
|
9
|
-
truncated: 'ncua-tag--truncated'
|
|
10
|
-
};
|
|
11
|
-
export const getTagSizeClassName = size => `ncua-tag--${size}`;
|
|
12
|
-
export const getTooltipPositionClassName = position => `ncua-tag__tooltip--${position}`;
|