@witchcraft/ui 0.4.0 → 0.4.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/README.md +56 -61
- package/dist/module.d.mts +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +13 -9
- package/dist/runtime/assets/animations.css +1 -1
- package/dist/runtime/assets/locales/en.json +2 -0
- package/dist/runtime/assets/utils.css +1 -1
- package/dist/runtime/build/WitchcraftUiResolver.js +1 -2
- package/dist/runtime/components/TestControls/TestControls.d.vue.ts +2 -1
- package/dist/runtime/components/TestControls/TestControls.vue +3 -3
- package/dist/runtime/components/TestControls/TestControls.vue.d.ts +2 -1
- package/dist/runtime/components/WButton/WButton.d.vue.ts +34 -0
- package/dist/runtime/components/{LibButton/LibButton.vue → WButton/WButton.vue} +26 -38
- package/dist/runtime/components/WButton/WButton.vue.d.ts +34 -0
- package/dist/runtime/components/WCheckbox/WCheckbox.d.vue.ts +33 -0
- package/dist/runtime/components/WCheckbox/WCheckbox.vue +110 -0
- package/dist/runtime/components/WCheckbox/WCheckbox.vue.d.ts +33 -0
- package/dist/runtime/components/{LibColorInput/LibColorInput.d.vue.ts → WColorInput/WColorInput.d.vue.ts} +18 -36
- package/dist/runtime/components/WColorInput/WColorInput.vue +85 -0
- package/dist/runtime/components/{LibColorInput/LibColorInput.vue.d.ts → WColorInput/WColorInput.vue.d.ts} +18 -36
- package/dist/runtime/components/WColorInput/WColorSwatchButton.d.vue.ts +28 -0
- package/dist/runtime/components/WColorInput/WColorSwatchButton.vue +86 -0
- package/dist/runtime/components/WColorInput/WColorSwatchButton.vue.d.ts +28 -0
- package/dist/runtime/components/{LibColorPicker/LibColorPicker.d.vue.ts → WColorPicker/WColorPicker.d.vue.ts} +12 -9
- package/dist/runtime/components/{LibColorPicker/LibColorPicker.vue → WColorPicker/WColorPicker.vue} +41 -29
- package/dist/runtime/components/{LibColorPicker/LibColorPicker.vue.d.ts → WColorPicker/WColorPicker.vue.d.ts} +12 -9
- package/dist/runtime/components/WCombobox/WCombobox.d.vue.ts +111 -0
- package/dist/runtime/components/WCombobox/WCombobox.vue +405 -0
- package/dist/runtime/components/WCombobox/WCombobox.vue.d.ts +111 -0
- package/dist/runtime/components/WCombobox/storyPlays.d.ts +18 -0
- package/dist/runtime/components/WCombobox/storyPlays.js +68 -0
- package/dist/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.d.vue.ts → WDarkModeSwitcher/WDarkModeSwitcher.d.vue.ts} +9 -13
- package/dist/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.vue → WDarkModeSwitcher/WDarkModeSwitcher.vue} +11 -14
- package/dist/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.vue.d.ts → WDarkModeSwitcher/WDarkModeSwitcher.vue.d.ts} +9 -13
- package/dist/runtime/components/{LibDatePicker/LibDatePicker.d.vue.ts → WDatePicker/WDatePicker.d.vue.ts} +7 -7
- package/dist/runtime/components/{LibDatePicker/LibDatePicker.vue → WDatePicker/WDatePicker.vue} +3 -7
- package/dist/runtime/components/{LibDatePicker/LibDatePicker.vue.d.ts → WDatePicker/WDatePicker.vue.d.ts} +7 -7
- package/dist/runtime/components/WDatePicker/WRangeDatePicker.d.vue.ts +182 -0
- package/dist/runtime/components/{LibDatePicker/LibRangeDatePicker.vue → WDatePicker/WRangeDatePicker.vue} +29 -25
- package/dist/runtime/components/WDatePicker/WRangeDatePicker.vue.d.ts +182 -0
- package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.d.vue.ts → WDatePicker/WSingleDatePicker.d.vue.ts} +7 -5
- package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.vue → WDatePicker/WSingleDatePicker.vue} +21 -21
- package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.vue.d.ts → WDatePicker/WSingleDatePicker.vue.d.ts} +7 -5
- package/dist/runtime/components/WDatePicker/WTimeZonePicker.d.vue.ts +13 -0
- package/dist/runtime/components/{LibDatePicker/LibTimeZonePicker.vue → WDatePicker/WTimeZonePicker.vue} +5 -12
- package/dist/runtime/components/WDatePicker/WTimeZonePicker.vue.d.ts +13 -0
- package/dist/runtime/components/{LibDebug/LibDebug.d.vue.ts → WDebug/WDebug.d.vue.ts} +3 -2
- package/dist/runtime/components/{LibDebug/LibDebug.vue → WDebug/WDebug.vue} +10 -12
- package/dist/runtime/components/{LibDebug/LibDebug.vue.d.ts → WDebug/WDebug.vue.d.ts} +3 -2
- package/dist/runtime/components/{LibDevOnly/LibDevOnly.d.vue.ts → WDevOnly/WDevOnly.d.vue.ts} +3 -5
- package/dist/runtime/components/{LibDevOnly/LibDevOnly.vue.d.ts → WDevOnly/WDevOnly.vue.d.ts} +3 -5
- package/dist/runtime/components/WFileInput/WFileInput.d.vue.ts +58 -0
- package/dist/runtime/components/WFileInput/WFileInput.vue +348 -0
- package/dist/runtime/components/WFileInput/WFileInput.vue.d.ts +58 -0
- package/dist/runtime/components/WIcon/WIcon.d.vue.ts +18 -0
- package/dist/runtime/components/{Icon/Icon.vue → WIcon/WIcon.vue} +1 -1
- package/dist/runtime/components/WIcon/WIcon.vue.d.ts +18 -0
- package/dist/runtime/components/WMultiValues/WMultiValues.d.vue.ts +28 -0
- package/dist/runtime/components/WMultiValues/WMultiValues.vue +150 -0
- package/dist/runtime/components/WMultiValues/WMultiValues.vue.d.ts +28 -0
- package/dist/runtime/components/WNotifications/WNotification.d.vue.ts +37 -0
- package/dist/runtime/components/{LibNotifications/LibNotification.vue → WNotifications/WNotification.vue} +61 -35
- package/dist/runtime/components/WNotifications/WNotification.vue.d.ts +37 -0
- package/dist/runtime/components/WNotifications/WNotificationTestMessageComponent.d.vue.ts +7 -0
- package/dist/runtime/components/WNotifications/WNotificationTestMessageComponent.vue +29 -0
- package/dist/runtime/components/WNotifications/WNotificationTestMessageComponent.vue.d.ts +7 -0
- package/dist/runtime/components/WNotifications/WNotifications.d.vue.ts +11 -0
- package/dist/runtime/components/{LibNotifications/LibNotifications.vue → WNotifications/WNotifications.vue} +72 -36
- package/dist/runtime/components/WNotifications/WNotifications.vue.d.ts +11 -0
- package/dist/runtime/components/WNotifications/calculateNotificationProgress.d.ts +2 -0
- package/dist/runtime/components/WNotifications/calculateNotificationProgress.js +4 -0
- package/dist/runtime/components/WNumberInput/WNumberInput.d.vue.ts +27 -0
- package/dist/runtime/components/WNumberInput/WNumberInput.vue +96 -0
- package/dist/runtime/components/WNumberInput/WNumberInput.vue.d.ts +27 -0
- package/dist/runtime/components/WPagination/WPagination.d.vue.ts +59 -0
- package/dist/runtime/components/WPagination/WPagination.vue +182 -0
- package/dist/runtime/components/WPagination/WPagination.vue.d.ts +59 -0
- package/dist/runtime/components/WPalette/WPalette.d.vue.ts +11 -0
- package/dist/runtime/components/{LibPalette/LibPalette.vue → WPalette/WPalette.vue} +3 -8
- package/dist/runtime/components/WPalette/WPalette.vue.d.ts +11 -0
- package/dist/runtime/components/WPopover/WPopover.d.vue.ts +45 -0
- package/dist/runtime/components/WPopover/WPopover.vue +144 -0
- package/dist/runtime/components/WPopover/WPopover.vue.d.ts +45 -0
- package/dist/runtime/components/WPopup/WPopup.d.vue.ts +51 -0
- package/dist/runtime/components/WPopup/WPopup.vue +115 -0
- package/dist/runtime/components/WPopup/WPopup.vue.d.ts +51 -0
- package/dist/runtime/components/{LibProgressBar/LibProgressBar.d.vue.ts → WProgressBar/WProgressBar.d.vue.ts} +13 -16
- package/dist/runtime/components/WProgressBar/WProgressBar.vue +150 -0
- package/dist/runtime/components/{LibProgressBar/LibProgressBar.vue.d.ts → WProgressBar/WProgressBar.vue.d.ts} +13 -16
- package/dist/runtime/components/{LibRecorder/LibRecorder.d.vue.ts → WRecorder/WRecorder.d.vue.ts} +13 -27
- package/dist/runtime/components/{LibRecorder/LibRecorder.vue → WRecorder/WRecorder.vue} +37 -36
- package/dist/runtime/components/{LibRecorder/LibRecorder.vue.d.ts → WRecorder/WRecorder.vue.d.ts} +13 -27
- package/dist/runtime/components/{LibRoot/LibRoot.d.vue.ts → WRoot/WRoot.d.vue.ts} +11 -9
- package/dist/runtime/components/{LibRoot/LibRoot.vue → WRoot/WRoot.vue} +17 -15
- package/dist/runtime/components/{LibRoot/LibRoot.vue.d.ts → WRoot/WRoot.vue.d.ts} +11 -9
- package/dist/runtime/components/WSimpleInput/WSimpleInput.d.vue.ts +34 -0
- package/dist/runtime/components/{LibSimpleInput/LibSimpleInput.vue → WSimpleInput/WSimpleInput.vue} +14 -24
- package/dist/runtime/components/WSimpleInput/WSimpleInput.vue.d.ts +34 -0
- package/dist/runtime/components/WTable/WTable.d.vue.ts +102 -0
- package/dist/runtime/components/WTable/WTable.vue +370 -0
- package/dist/runtime/components/WTable/WTable.vue.d.ts +102 -0
- package/dist/runtime/components/WTooltip/WTooltip.d.vue.ts +40 -0
- package/dist/runtime/components/WTooltip/WTooltip.vue +112 -0
- package/dist/runtime/components/WTooltip/WTooltip.vue.d.ts +40 -0
- package/dist/runtime/components/index.d.ts +20 -20
- package/dist/runtime/components/index.js +20 -20
- package/dist/runtime/composables/index.d.ts +4 -4
- package/dist/runtime/composables/index.js +4 -4
- package/dist/runtime/composables/useDelayedLoadingIndicator.d.ts +9 -0
- package/dist/runtime/composables/useDelayedLoadingIndicator.js +18 -0
- package/dist/runtime/composables/useDisplayForReka.d.ts +25 -0
- package/dist/runtime/composables/useDisplayForReka.js +16 -0
- package/dist/runtime/composables/useFallbackId.d.ts +3 -0
- package/dist/runtime/composables/useFallbackId.js +5 -0
- package/dist/runtime/composables/useInjectedDarkMode.d.ts +1 -1
- package/dist/runtime/composables/usePopupConstrainToStyle.d.ts +8 -0
- package/dist/runtime/composables/usePopupConstrainToStyle.js +8 -0
- package/dist/runtime/composables/useSetupDarkMode.d.ts +2 -3
- package/dist/runtime/composables/useSetupDarkMode.js +90 -4
- package/dist/runtime/composables/useTimeConditionally.d.ts +16 -0
- package/dist/runtime/composables/useTimeConditionally.js +27 -0
- package/dist/runtime/directives/vResizableCols.js +101 -34
- package/dist/runtime/helpers/NotificationHandler.d.ts +28 -3
- package/dist/runtime/helpers/NotificationHandler.js +7 -10
- package/dist/runtime/injectionKeys.d.ts +1 -5
- package/dist/runtime/injectionKeys.js +0 -2
- package/dist/runtime/types/index.d.ts +97 -31
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/utils/notifyIfError.d.ts +3 -1
- package/dist/runtime/utils/notifyIfError.js +4 -2
- package/dist/runtime/utils/twMerge.d.ts +1 -0
- package/dist/runtime/utils/twMerge.js +2 -1
- package/package.json +59 -56
- package/src/module.ts +16 -8
- package/src/runtime/assets/animations.css +53 -6
- package/src/runtime/assets/locales/en.json +2 -0
- package/src/runtime/assets/tailwind.css +1 -1
- package/src/runtime/assets/utils.css +52 -4
- package/src/runtime/build/WitchcraftUiResolver.ts +1 -2
- package/src/runtime/components/TestControls/TestControls.vue +3 -3
- package/src/runtime/components/WButton/WButton.stories.ts +112 -0
- package/src/runtime/components/{LibButton/LibButton.vue → WButton/WButton.vue} +34 -50
- package/src/runtime/components/{LibCheckbox/LibCheckbox.stories.ts → WCheckbox/WCheckbox.stories.ts} +5 -5
- package/src/runtime/components/WCheckbox/WCheckbox.vue +125 -0
- package/src/runtime/components/{LibColorInput/LibColorInput.stories.ts → WColorInput/WColorInput.stories.ts} +8 -8
- package/src/runtime/components/WColorInput/WColorInput.vue +112 -0
- package/src/runtime/components/WColorInput/WColorSwatchButton.vue +102 -0
- package/src/runtime/components/{LibColorPicker/LibColorPicker.stories.ts → WColorPicker/WColorPicker.stories.ts} +12 -12
- package/src/runtime/components/{LibColorPicker/LibColorPicker.vue → WColorPicker/WColorPicker.vue} +44 -31
- package/src/runtime/components/WCombobox/WCombobox.stories.ts +209 -0
- package/src/runtime/components/WCombobox/WCombobox.vue +450 -0
- package/src/runtime/components/WCombobox/storyPlays.ts +92 -0
- package/src/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.stories.ts → WDarkModeSwitcher/WDarkModeSwitcher.stories.ts} +6 -6
- package/src/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.vue → WDarkModeSwitcher/WDarkModeSwitcher.vue} +19 -30
- package/src/runtime/components/{LibDatePicker/LibDatePicker.stories.ts → WDatePicker/WDatePicker.stories.ts} +42 -34
- package/src/runtime/components/{LibDatePicker/LibDatePicker.vue → WDatePicker/WDatePicker.vue} +3 -7
- package/src/runtime/components/{LibDatePicker/LibRangeDatePicker.vue → WDatePicker/WRangeDatePicker.vue} +29 -25
- package/src/runtime/components/{LibDatePicker/LibSingleDatePicker.vue → WDatePicker/WSingleDatePicker.vue} +21 -21
- package/src/runtime/components/{LibDatePicker/LibTimeZonePicker.vue → WDatePicker/WTimeZonePicker.vue} +5 -12
- package/src/runtime/components/{LibDebug/LibDebug.stories.ts → WDebug/WDebug.stories.ts} +5 -5
- package/src/runtime/components/{LibDebug/LibDebug.vue → WDebug/WDebug.vue} +9 -10
- package/src/runtime/components/{LibDevOnly/LibDevOnly.vue → WDevOnly/WDevOnly.vue} +0 -4
- package/src/runtime/components/{LibFileInput/LibFileInput.stories.ts → WFileInput/WFileInput.stories.ts} +20 -10
- package/src/runtime/components/WFileInput/WFileInput.vue +392 -0
- package/src/runtime/components/{Icon/Icon.vue → WIcon/WIcon.vue} +5 -8
- package/src/runtime/components/{LibMultiValues/LibMultiValues.stories.ts → WMultiValues/WMultiValues.stories.ts} +9 -9
- package/src/runtime/components/WMultiValues/WMultiValues.vue +163 -0
- package/src/runtime/components/{LibNotifications/LibNotification.stories.ts → WNotifications/WNotification.stories.ts} +42 -6
- package/src/runtime/components/{LibNotifications/LibNotification.vue → WNotifications/WNotification.vue} +72 -45
- package/src/runtime/components/WNotifications/WNotificationTestMessageComponent.vue +27 -0
- package/src/runtime/components/WNotifications/WNotifications.stories.ts +139 -0
- package/src/runtime/components/{LibNotifications/LibNotifications.vue → WNotifications/WNotifications.vue} +87 -47
- package/src/runtime/components/WNotifications/calculateNotificationProgress.ts +8 -0
- package/src/runtime/components/WNumberInput/WNumberInput.vue +109 -0
- package/src/runtime/components/WPagination/WPagination.stories.ts +51 -0
- package/src/runtime/components/WPagination/WPagination.vue +207 -0
- package/src/runtime/components/{LibPalette/LibPalette.stories.ts → WPalette/WPalette.stories.ts} +6 -6
- package/src/runtime/components/{LibPalette/LibPalette.vue → WPalette/WPalette.vue} +3 -8
- package/src/runtime/components/WPopover/WPopover.stories.ts +218 -0
- package/src/runtime/components/WPopover/WPopover.vue +168 -0
- package/src/runtime/components/WPopup/WPopup.stories.ts +104 -0
- package/src/runtime/components/WPopup/WPopup.vue +134 -0
- package/src/runtime/components/WProgressBar/WProgressBar.stories.ts +119 -0
- package/src/runtime/components/WProgressBar/WProgressBar.vue +185 -0
- package/src/runtime/components/{LibRecorder/LibRecorder.stories.ts → WRecorder/WRecorder.stories.ts} +9 -6
- package/src/runtime/components/{LibRecorder/LibRecorder.vue → WRecorder/WRecorder.vue} +69 -68
- package/src/runtime/components/{LibRoot/LibRoot.vue → WRoot/WRoot.vue} +18 -15
- package/src/runtime/components/{LibSimpleInput/LibSimpleInput.stories.ts → WSimpleInput/WSimpleInput.stories.ts} +11 -12
- package/src/runtime/components/{LibSimpleInput/LibSimpleInput.vue → WSimpleInput/WSimpleInput.vue} +28 -42
- package/src/runtime/components/WTable/WTable.stories.ts +334 -0
- package/src/runtime/components/WTable/WTable.vue +471 -0
- package/src/runtime/components/WTooltip/WTooltip.stories.ts +82 -0
- package/src/runtime/components/WTooltip/WTooltip.vue +128 -0
- package/src/runtime/components/index.ts +20 -20
- package/src/runtime/composables/index.ts +4 -4
- package/src/runtime/composables/useDelayedLoadingIndicator.ts +30 -0
- package/src/runtime/composables/useDisplayForReka.ts +37 -0
- package/src/runtime/composables/useFallbackId.ts +6 -0
- package/src/runtime/composables/useInjectedDarkMode.ts +1 -2
- package/src/runtime/composables/usePopupConstrainToStyle.ts +29 -0
- package/src/runtime/composables/useSetupDarkMode.ts +122 -4
- package/src/runtime/composables/useTimeConditionally.ts +51 -0
- package/src/runtime/directives/vResizableCols.ts +121 -38
- package/src/runtime/helpers/NotificationHandler.ts +30 -11
- package/src/runtime/injectionKeys.ts +1 -7
- package/src/runtime/types/index.ts +118 -36
- package/src/runtime/utils/notifyIfError.ts +6 -2
- package/src/runtime/utils/twMerge.ts +2 -1
- package/types/components.d.ts +14 -15
- package/dist/runtime/components/Aria/Aria.d.vue.ts +0 -5
- package/dist/runtime/components/Aria/Aria.vue +0 -16
- package/dist/runtime/components/Aria/Aria.vue.d.ts +0 -5
- package/dist/runtime/components/Icon/Icon.d.vue.ts +0 -21
- package/dist/runtime/components/Icon/Icon.vue.d.ts +0 -21
- package/dist/runtime/components/LibButton/LibButton.d.vue.ts +0 -36
- package/dist/runtime/components/LibButton/LibButton.vue.d.ts +0 -36
- package/dist/runtime/components/LibCheckbox/LibCheckbox.d.vue.ts +0 -42
- package/dist/runtime/components/LibCheckbox/LibCheckbox.vue +0 -103
- package/dist/runtime/components/LibCheckbox/LibCheckbox.vue.d.ts +0 -42
- package/dist/runtime/components/LibColorInput/LibColorInput.vue +0 -162
- package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.d.vue.ts +0 -34
- package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue.d.ts +0 -34
- package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.d.vue.ts +0 -22
- package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue.d.ts +0 -22
- package/dist/runtime/components/LibFileInput/LibFileInput.d.vue.ts +0 -43
- package/dist/runtime/components/LibFileInput/LibFileInput.vue +0 -274
- package/dist/runtime/components/LibFileInput/LibFileInput.vue.d.ts +0 -43
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.d.vue.ts +0 -165
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +0 -387
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue.d.ts +0 -165
- package/dist/runtime/components/LibLabel/LibLabel.d.vue.ts +0 -26
- package/dist/runtime/components/LibLabel/LibLabel.vue +0 -45
- package/dist/runtime/components/LibLabel/LibLabel.vue.d.ts +0 -26
- package/dist/runtime/components/LibMultiValues/LibMultiValues.d.vue.ts +0 -29
- package/dist/runtime/components/LibMultiValues/LibMultiValues.vue +0 -109
- package/dist/runtime/components/LibMultiValues/LibMultiValues.vue.d.ts +0 -29
- package/dist/runtime/components/LibNotifications/LibNotification.d.vue.ts +0 -30
- package/dist/runtime/components/LibNotifications/LibNotification.vue.d.ts +0 -30
- package/dist/runtime/components/LibNotifications/LibNotifications.d.vue.ts +0 -13
- package/dist/runtime/components/LibNotifications/LibNotifications.vue.d.ts +0 -13
- package/dist/runtime/components/LibPagination/LibPagination.d.vue.ts +0 -104
- package/dist/runtime/components/LibPagination/LibPagination.vue +0 -229
- package/dist/runtime/components/LibPagination/LibPagination.vue.d.ts +0 -104
- package/dist/runtime/components/LibPalette/LibPalette.d.vue.ts +0 -14
- package/dist/runtime/components/LibPalette/LibPalette.vue.d.ts +0 -14
- package/dist/runtime/components/LibPopup/LibPopup.d.vue.ts +0 -46
- package/dist/runtime/components/LibPopup/LibPopup.vue +0 -365
- package/dist/runtime/components/LibPopup/LibPopup.vue.d.ts +0 -46
- package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +0 -169
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.d.vue.ts +0 -35
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue.d.ts +0 -35
- package/dist/runtime/components/LibSuggestions/LibSuggestions.d.vue.ts +0 -94
- package/dist/runtime/components/LibSuggestions/LibSuggestions.vue +0 -178
- package/dist/runtime/components/LibSuggestions/LibSuggestions.vue.d.ts +0 -94
- package/dist/runtime/components/LibTable/LibTable.d.vue.ts +0 -45
- package/dist/runtime/components/LibTable/LibTable.vue +0 -155
- package/dist/runtime/components/LibTable/LibTable.vue.d.ts +0 -45
- package/dist/runtime/components/Template/NAME.d.vue.ts +0 -17
- package/dist/runtime/components/Template/NAME.vue +0 -27
- package/dist/runtime/components/Template/NAME.vue.d.ts +0 -17
- package/dist/runtime/components/Template/TemplateStory.d.ts +0 -7
- package/dist/runtime/components/Template/TemplateStory.js +0 -22
- package/dist/runtime/components/shared/props.d.ts +0 -171
- package/dist/runtime/components/shared/props.js +0 -2
- package/dist/runtime/composables/useAriaLabel.d.ts +0 -6
- package/dist/runtime/composables/useAriaLabel.js +0 -15
- package/dist/runtime/composables/useDarkMode.d.ts +0 -77
- package/dist/runtime/composables/useDarkMode.js +0 -89
- package/dist/runtime/composables/useDivideAttrs.d.ts +0 -27
- package/dist/runtime/composables/useDivideAttrs.js +0 -27
- package/dist/runtime/composables/useSuggestions.d.ts +0 -40
- package/dist/runtime/composables/useSuggestions.js +0 -263
- package/src/runtime/components/Aria/Aria.vue +0 -26
- package/src/runtime/components/LibButton/LibButton.stories.ts +0 -106
- package/src/runtime/components/LibCheckbox/LibCheckbox.vue +0 -129
- package/src/runtime/components/LibColorInput/LibColorInput.vue +0 -203
- package/src/runtime/components/LibFileInput/LibFileInput.vue +0 -320
- package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.ts +0 -405
- package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +0 -414
- package/src/runtime/components/LibLabel/LibLabel.stories.ts +0 -33
- package/src/runtime/components/LibLabel/LibLabel.vue +0 -65
- package/src/runtime/components/LibMultiValues/LibMultiValues.vue +0 -123
- package/src/runtime/components/LibNotifications/LibNotifications.stories.ts +0 -120
- package/src/runtime/components/LibPagination/LibPagination.stories.ts +0 -49
- package/src/runtime/components/LibPagination/LibPagination.vue +0 -274
- package/src/runtime/components/LibPopup/LibPopup.stories.ts +0 -153
- package/src/runtime/components/LibPopup/LibPopup.vue +0 -396
- package/src/runtime/components/LibProgressBar/LibProgressBar.stories.ts +0 -90
- package/src/runtime/components/LibProgressBar/LibProgressBar.vue +0 -197
- package/src/runtime/components/LibSuggestions/LibSuggestions.stories.ts +0 -134
- package/src/runtime/components/LibSuggestions/LibSuggestions.vue +0 -212
- package/src/runtime/components/LibTable/LibTable.stories.ts +0 -167
- package/src/runtime/components/LibTable/LibTable.vue +0 -190
- package/src/runtime/components/Template/NAME.vue +0 -49
- package/src/runtime/components/Template/TemplateStory.ts +0 -37
- package/src/runtime/components/shared/props.ts +0 -199
- package/src/runtime/composables/useAriaLabel.ts +0 -23
- package/src/runtime/composables/useDarkMode.ts +0 -199
- package/src/runtime/composables/useDivideAttrs.ts +0 -53
- package/src/runtime/composables/useSuggestions.ts +0 -339
- /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToHsva.d.ts +0 -0
- /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToHsva.js +0 -0
- /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToRgba.d.ts +0 -0
- /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToRgba.js +0 -0
- /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/toLowPrecisionRgbaString.d.ts +0 -0
- /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/toLowPrecisionRgbaString.js +0 -0
- /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/truncate.d.ts +0 -0
- /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/truncate.js +0 -0
- /package/dist/runtime/components/{LibDatePicker → WDatePicker}/helpers.d.ts +0 -0
- /package/dist/runtime/components/{LibDatePicker → WDatePicker}/helpers.js +0 -0
- /package/dist/runtime/components/{LibDevOnly/LibDevOnly.vue → WDevOnly/WDevOnly.vue} +0 -0
- /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToHsva.ts +0 -0
- /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToRgba.ts +0 -0
- /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/toLowPrecisionRgbaString.ts +0 -0
- /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/truncate.ts +0 -0
- /package/src/runtime/components/{LibDatePicker → WDatePicker}/helpers.ts +0 -0
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
:id="id"
|
|
4
3
|
tabindex="-1"
|
|
5
4
|
:class="twMerge(
|
|
6
5
|
(showOutline ? 'group outlined outlined-visible' : '[&_*]:outline-hidden'),
|
|
7
6
|
darkMode && ' dark',
|
|
8
|
-
|
|
7
|
+
wrapperAttrs?.class
|
|
9
8
|
)"
|
|
10
|
-
v-bind="{
|
|
9
|
+
v-bind="{
|
|
10
|
+
id: 'app',
|
|
11
|
+
...wrapperAttrs,
|
|
12
|
+
class: undefined
|
|
13
|
+
}"
|
|
11
14
|
:ref="handleRef"
|
|
12
15
|
>
|
|
13
16
|
<!-- id root is useful for teleports, so they are at the topmost level where they can still be styled -->
|
|
14
17
|
<!-- See TestControls for why the margins here -->
|
|
15
18
|
<div
|
|
16
19
|
id="root"
|
|
17
|
-
v-bind="{ ...$attrs
|
|
20
|
+
v-bind="{ ...$attrs, class: undefined }"
|
|
18
21
|
:class="twMerge(`
|
|
19
|
-
dark:bg-
|
|
20
|
-
dark:text-
|
|
21
|
-
bg-
|
|
22
|
-
text-
|
|
22
|
+
dark:bg-neutral-900
|
|
23
|
+
dark:text-white
|
|
24
|
+
bg-neutral-50
|
|
25
|
+
text-black
|
|
23
26
|
`,
|
|
24
27
|
testWrapperMode && `
|
|
25
28
|
px-10
|
|
@@ -30,7 +33,7 @@
|
|
|
30
33
|
flex
|
|
31
34
|
flex-col
|
|
32
35
|
`,
|
|
33
|
-
($attrs as any).
|
|
36
|
+
($attrs as any).class)"
|
|
34
37
|
>
|
|
35
38
|
<TestControls
|
|
36
39
|
v-if="testWrapperMode"
|
|
@@ -48,10 +51,10 @@
|
|
|
48
51
|
<script setup lang="ts">
|
|
49
52
|
import { unreachable } from "@alanscodelog/utils/unreachable"
|
|
50
53
|
import type { Theme } from "metamorphosis"
|
|
51
|
-
import {
|
|
54
|
+
import type { ComponentPublicInstance, HTMLAttributes } from "vue"
|
|
55
|
+
import { computed, onBeforeUnmount, onMounted, ref, toRaw, useAttrs } from "vue"
|
|
52
56
|
|
|
53
57
|
import { useAccesibilityOutline } from "../../composables/useAccesibilityOutline.js"
|
|
54
|
-
import { useDivideAttrs } from "../../composables/useDivideAttrs.js"
|
|
55
58
|
import { useNotificationHandler } from "../../composables/useNotificationHandler.js"
|
|
56
59
|
import { useSetupDarkMode } from "../../composables/useSetupDarkMode.js"
|
|
57
60
|
import { useSetupI18n } from "../../composables/useSetupI18n.js"
|
|
@@ -59,19 +62,19 @@ import { useSetupLocale } from "../../composables/useSetupLocale.js"
|
|
|
59
62
|
import { useShowDevOnlyKey } from "../../composables/useShowDevOnlyKey.js"
|
|
60
63
|
import { NotificationHandler } from "../../helpers/NotificationHandler.js"
|
|
61
64
|
import { theme as defaultTheme } from "../../theme.js"
|
|
65
|
+
import type { TailwindClassProp } from "../../types/index.js"
|
|
62
66
|
import { twMerge } from "../../utils/twMerge.js"
|
|
63
|
-
import Notifications from "../LibNotifications/LibNotifications.vue"
|
|
64
67
|
import TestControls from "../TestControls/TestControls.vue"
|
|
68
|
+
import Notifications from "../WNotifications/WNotifications.vue"
|
|
65
69
|
|
|
66
|
-
const $attrs = useDivideAttrs(["wrapper"])
|
|
67
70
|
|
|
68
71
|
defineOptions({ name: "Root", inheritAttrs: false, suspensible: false })
|
|
72
|
+
const $attrs = useAttrs()
|
|
69
73
|
const props = withDefaults(defineProps<{
|
|
70
74
|
theme?: Theme
|
|
71
75
|
outline?: boolean
|
|
72
76
|
forceOutline?: boolean
|
|
73
77
|
testWrapperMode?: boolean
|
|
74
|
-
id?: string
|
|
75
78
|
/** You can set a ref to the root element by passing :getRef="_ => el = _" */
|
|
76
79
|
getRef?: (el: HTMLElement | null) => void
|
|
77
80
|
/** True by default, should be passed import.meta.client if using nuxt, or false when running server side. */
|
|
@@ -79,12 +82,12 @@ const props = withDefaults(defineProps<{
|
|
|
79
82
|
useBuiltinTranslations?: boolean
|
|
80
83
|
useNotifications?: boolean
|
|
81
84
|
notificationHandler?: NotificationHandler
|
|
85
|
+
wrapperAttrs?: Omit<HTMLAttributes, "class"> & TailwindClassProp
|
|
82
86
|
}>(), {
|
|
83
87
|
theme: undefined,
|
|
84
88
|
testWrapperMode: false,
|
|
85
89
|
outline: true,
|
|
86
90
|
forceOutline: false,
|
|
87
|
-
id: "app",
|
|
88
91
|
getRef: undefined,
|
|
89
92
|
isClientSide: true,
|
|
90
93
|
useBuiltinTranslations: true,
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
|
-
import type {
|
|
2
|
+
import type { StoryObj } from "@storybook/vue3"
|
|
3
|
+
|
|
4
|
+
import WSimpleInput from "./WSimpleInput.vue"
|
|
3
5
|
|
|
4
6
|
import * as components from "../index.js"
|
|
5
7
|
|
|
6
8
|
const meta = {
|
|
7
|
-
component:
|
|
9
|
+
component: WSimpleInput,
|
|
8
10
|
title: "Components/Input",
|
|
9
11
|
args: {
|
|
10
12
|
modelValue: "Value",
|
|
11
13
|
placeholder: "Placeholder"
|
|
12
14
|
}
|
|
13
|
-
}
|
|
15
|
+
}
|
|
14
16
|
|
|
15
17
|
export default meta
|
|
16
|
-
type Story = StoryObj<typeof components.
|
|
18
|
+
type Story = StoryObj<typeof components.WSimpleInput>
|
|
17
19
|
|
|
18
20
|
/** Input */
|
|
19
21
|
export const Primary: Story = {
|
|
@@ -25,10 +27,10 @@ export const Primary: Story = {
|
|
|
25
27
|
// eslint-disable-next-line no-console
|
|
26
28
|
setup: () => ({ args, test: () => console.log("Enter") }),
|
|
27
29
|
template: `
|
|
28
|
-
<
|
|
30
|
+
<WSimpleInput
|
|
29
31
|
@keydown="test"
|
|
30
|
-
class="m-2" v-bind="args" v-model="args.modelValue" ></
|
|
31
|
-
<
|
|
32
|
+
class="m-2" v-bind="args" v-model="args.modelValue" ></WSimpleInput>
|
|
33
|
+
<WSimpleInput class="m-2" v-bind="{...args, modelValue:''}" ></WSimpleInput>
|
|
32
34
|
`
|
|
33
35
|
})
|
|
34
36
|
}
|
|
@@ -41,14 +43,11 @@ export const InsideAFlexbox: Story = {
|
|
|
41
43
|
template: `
|
|
42
44
|
Inside a flexbox:
|
|
43
45
|
<div class="flex flex-wrap">
|
|
44
|
-
<
|
|
46
|
+
<WSimpleInput v-bind="args" v-model="args.modelValue"></WSimpleInput>
|
|
45
47
|
<div class="border-1 border-danger-500 flex-1 whitespace-nowrap">Flex Grow: 1</div>
|
|
46
48
|
</div>
|
|
47
49
|
`
|
|
48
|
-
})
|
|
49
|
-
args: {
|
|
50
|
-
stretch: true
|
|
51
|
-
}
|
|
50
|
+
})
|
|
52
51
|
}
|
|
53
52
|
|
|
54
53
|
export const Disabled = {
|
package/src/runtime/components/{LibSimpleInput/LibSimpleInput.vue → WSimpleInput/WSimpleInput.vue}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<input
|
|
3
|
-
:id="
|
|
4
|
-
:class="twMerge(`
|
|
3
|
+
:id="finalId"
|
|
4
|
+
:class="!unstyle && twMerge(`
|
|
5
5
|
simple-input
|
|
6
6
|
flex-1
|
|
7
7
|
grow-[999999]
|
|
@@ -70,12 +70,11 @@
|
|
|
70
70
|
)"
|
|
71
71
|
:data-border="border"
|
|
72
72
|
:data-invalid="!valid"
|
|
73
|
-
:type="type"
|
|
74
|
-
:placeholder="placeholder"
|
|
75
|
-
:disabled="disabled"
|
|
76
|
-
:readonly="readonly"
|
|
77
73
|
v-model="modelValue"
|
|
78
|
-
v-bind="{
|
|
74
|
+
v-bind="{
|
|
75
|
+
...$attrs,
|
|
76
|
+
class: undefined
|
|
77
|
+
}"
|
|
79
78
|
@keydown="handleKeydown"
|
|
80
79
|
@input="emit('input', $event as InputEvent)"
|
|
81
80
|
>
|
|
@@ -84,27 +83,42 @@
|
|
|
84
83
|
<script lang="ts" setup generic="T">
|
|
85
84
|
import { type InputHTMLAttributes, useAttrs } from "vue"
|
|
86
85
|
|
|
87
|
-
import {
|
|
86
|
+
import { useFallbackId } from "../../composables/useFallbackId.js"
|
|
88
87
|
import { usePreHydrationValue } from "../../composables/usePreHydrationValue.js"
|
|
89
88
|
import { hasModifiers } from "../../helpers/hasModifiers.js"
|
|
89
|
+
import type { BaseInteractiveProps, TailwindClassProp } from "../../types/index.js"
|
|
90
90
|
import { twMerge } from "../../utils/twMerge.js"
|
|
91
|
-
import { type BaseInteractiveProps, getFallbackId, type LabelProps, type LinkableByIdProps, type TailwindClassProp } from "../shared/props.js"
|
|
92
91
|
|
|
93
92
|
defineOptions({
|
|
94
|
-
name: "
|
|
93
|
+
name: "WSimpleInput",
|
|
95
94
|
inheritAttrs: false
|
|
96
95
|
})
|
|
97
96
|
|
|
98
|
-
const fallbackId = getFallbackId()
|
|
99
97
|
|
|
100
|
-
const props = withDefaults(defineProps<
|
|
98
|
+
const props = withDefaults(defineProps<
|
|
99
|
+
& /** @vue-ignore */ Omit<
|
|
100
|
+
InputHTMLAttributes,
|
|
101
|
+
| "class" | "readonly" | "disabled" | "onSubmit" | "onInput" | "type"
|
|
102
|
+
// https://github.com/vuejs/core/pull/14237
|
|
103
|
+
| "autocomplete"
|
|
104
|
+
>
|
|
105
|
+
& /** @vue-ignore */ TailwindClassProp
|
|
106
|
+
& Pick<BaseInteractiveProps, "unstyle" | "border">
|
|
107
|
+
& {
|
|
108
|
+
id?: string
|
|
109
|
+
label?: string
|
|
110
|
+
valid?: boolean
|
|
111
|
+
type?: InputHTMLAttributes["type"]
|
|
112
|
+
}
|
|
113
|
+
>(), {
|
|
101
114
|
id: "",
|
|
102
115
|
placeholder: "",
|
|
103
116
|
valid: true,
|
|
104
117
|
label: "",
|
|
105
118
|
type: undefined,
|
|
106
|
-
|
|
119
|
+
border: true
|
|
107
120
|
})
|
|
121
|
+
const finalId = useFallbackId(props)
|
|
108
122
|
|
|
109
123
|
const modelValue = defineModel<T>({ required: true })
|
|
110
124
|
|
|
@@ -114,40 +128,12 @@ const emit = defineEmits<{
|
|
|
114
128
|
(e: "input", val: InputEvent): void
|
|
115
129
|
}>()
|
|
116
130
|
const $attrs = useAttrs()
|
|
117
|
-
const ariaLabel = useAriaLabel(props, fallbackId)
|
|
118
131
|
|
|
119
132
|
function handleKeydown(e: KeyboardEvent) {
|
|
120
133
|
if (e.key === "Enter" && !hasModifiers(e)) {
|
|
121
134
|
emit("submit", modelValue.value)
|
|
122
135
|
}
|
|
123
136
|
}
|
|
124
|
-
usePreHydrationValue(
|
|
137
|
+
usePreHydrationValue(finalId, modelValue)
|
|
125
138
|
</script>
|
|
126
139
|
|
|
127
|
-
<script lang="ts">
|
|
128
|
-
type RealProps
|
|
129
|
-
= & LinkableByIdProps
|
|
130
|
-
& LabelProps
|
|
131
|
-
& BaseInteractiveProps
|
|
132
|
-
& {
|
|
133
|
-
placeholder?: InputHTMLAttributes["placeholder"]
|
|
134
|
-
disabled?: InputHTMLAttributes["disabled"]
|
|
135
|
-
id?: InputHTMLAttributes["id"]
|
|
136
|
-
type?: InputHTMLAttributes["type"]
|
|
137
|
-
valid?: boolean
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
interface Props
|
|
141
|
-
extends
|
|
142
|
-
/** @vue-ignore */
|
|
143
|
-
Partial<Omit<
|
|
144
|
-
InputHTMLAttributes,
|
|
145
|
-
| "class"
|
|
146
|
-
| "readonly"
|
|
147
|
-
| "disabled"
|
|
148
|
-
| "onSubmit"
|
|
149
|
-
| "onInput"
|
|
150
|
-
> & TailwindClassProp>,
|
|
151
|
-
RealProps
|
|
152
|
-
{}
|
|
153
|
-
</script>
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
|
+
import { faker } from "@faker-js/faker"
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/vue3"
|
|
4
|
+
import { reactive, ref } from "vue"
|
|
5
|
+
|
|
6
|
+
import WTable from "./WTable.vue"
|
|
7
|
+
|
|
8
|
+
// todo
|
|
9
|
+
import * as components from "../index.js"
|
|
10
|
+
|
|
11
|
+
// faker is slow, we can just choose from a few hundred pre-generated sentences
|
|
12
|
+
const fakerSentences = Array.from({ length: 100 }).fill(0).map(_ => faker.lorem.sentence(faker.number.int({ min: 1, max: 50 })))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
type ExtraTestArgs = {
|
|
16
|
+
_slots?: string
|
|
17
|
+
}
|
|
18
|
+
const meta: Meta<typeof WTable> = {
|
|
19
|
+
component: WTable as any,
|
|
20
|
+
title: "Components/Table"
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default meta
|
|
24
|
+
type Story = StoryObj<typeof WTable> & { args: ExtraTestArgs }
|
|
25
|
+
|
|
26
|
+
export const Primary: Story = {
|
|
27
|
+
render: args => {
|
|
28
|
+
const extraArgs = args as ExtraTestArgs
|
|
29
|
+
return {
|
|
30
|
+
components,
|
|
31
|
+
setup: () => {
|
|
32
|
+
const show = ref(true)
|
|
33
|
+
const debugGrips = ref(false)
|
|
34
|
+
// careful, storybook passes refs as is causing issues
|
|
35
|
+
const argsReactive = reactive({
|
|
36
|
+
...args,
|
|
37
|
+
resizable: {
|
|
38
|
+
enabled: true,
|
|
39
|
+
...args.resizable
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
args: argsReactive,
|
|
45
|
+
debugGrips,
|
|
46
|
+
show
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
template: `
|
|
50
|
+
<div class="p-2 flex flex-col gap-2 border rounded-md mb-10">
|
|
51
|
+
Controls:
|
|
52
|
+
<WButton class="flex-1" @click="args.resizable.enabled = !args.resizable.enabled">Toggle Resizable (currently {{args.resizable.enabled}})</WButton>
|
|
53
|
+
<WButton @click="args.stickyHeader = !args.stickyHeader">Toggle Sticky Header (currently {{args.stickyHeader}})</WButton>
|
|
54
|
+
<WButton @click="show = !show">Toggle Table</WButton>
|
|
55
|
+
<WButton @click="debugGrips = !debugGrips">Toggle Debug Grips (currently {{debugGrips}})</WButton>
|
|
56
|
+
</div>
|
|
57
|
+
<div :class="debugGrips ? ' [&_.grip]:bg-red-500': ''">
|
|
58
|
+
<WTable
|
|
59
|
+
v-if="show"
|
|
60
|
+
v-bind="args"
|
|
61
|
+
>
|
|
62
|
+
${extraArgs._slots}
|
|
63
|
+
</WTable>
|
|
64
|
+
</div>
|
|
65
|
+
`
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
args: {
|
|
69
|
+
cols: ["prop1", "prop2", "prop3"] as any,
|
|
70
|
+
values: [
|
|
71
|
+
{ prop1: "Item1 Prop 1", prop2: "Item1 Prop 2", prop3: "Item1 Prop 3" },
|
|
72
|
+
{ prop1: "Item2 Prop 1", prop2: "Item2 Prop 2", prop3: "Item2 Prop 3" },
|
|
73
|
+
{ prop1: "Item3 Prop 1", prop2: "Item3 Prop 2", prop3: "Item3 Prop 3" }
|
|
74
|
+
],
|
|
75
|
+
colConfig: { prop1: { name: "Header 1" }, prop2: { name: "Header 2" } }
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export const NoCellBorders: Story = {
|
|
80
|
+
...Primary,
|
|
81
|
+
args: {
|
|
82
|
+
...Primary.args,
|
|
83
|
+
cellBorder: false
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const NoBorders: Story = {
|
|
88
|
+
...Primary,
|
|
89
|
+
args: {
|
|
90
|
+
...Primary.args,
|
|
91
|
+
border: false
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
export const NoCellBordersNoBorders: Story = {
|
|
95
|
+
...Primary,
|
|
96
|
+
args: {
|
|
97
|
+
...Primary.args,
|
|
98
|
+
cellBorder: false,
|
|
99
|
+
border: false
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export const SquareBorders: Story = {
|
|
104
|
+
...Primary,
|
|
105
|
+
args: {
|
|
106
|
+
...Primary.args,
|
|
107
|
+
rounded: false
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
export const NoHeader: Story = {
|
|
111
|
+
...Primary,
|
|
112
|
+
args: {
|
|
113
|
+
...Primary.args,
|
|
114
|
+
header: false
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
export const NoHeaderNoBorders: Story = {
|
|
118
|
+
...Primary,
|
|
119
|
+
args: {
|
|
120
|
+
...Primary.args,
|
|
121
|
+
header: false,
|
|
122
|
+
border: false
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
export const NoHeaderNoCellBorders: Story = {
|
|
126
|
+
...Primary,
|
|
127
|
+
args: {
|
|
128
|
+
...Primary.args,
|
|
129
|
+
header: false,
|
|
130
|
+
cellBorder: false
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export const InitialSize: Story = {
|
|
135
|
+
...Primary,
|
|
136
|
+
args: {
|
|
137
|
+
...Primary.args,
|
|
138
|
+
colConfig: {
|
|
139
|
+
prop1: { name: "Initially Flex 1", resizable: true },
|
|
140
|
+
prop2: { name: "Initially Flex 2", resizable: true },
|
|
141
|
+
prop3: { name: "Initially Size of Header", resizable: true }
|
|
142
|
+
},
|
|
143
|
+
resizable: {
|
|
144
|
+
enabled: true
|
|
145
|
+
},
|
|
146
|
+
class: `
|
|
147
|
+
[&:not(.resizable-cols-setup)]:w-full
|
|
148
|
+
[&:not(.resizable-cols-setup)]:block
|
|
149
|
+
[&:not(.resizable-cols-setup)_thead]:block
|
|
150
|
+
[&:not(.resizable-cols-setup)_thead_tr]:w-full
|
|
151
|
+
[&:not(.resizable-cols-setup)_thead_tr]:flex
|
|
152
|
+
[&:not(.resizable-cols-setup)_thead_tr]:flex-nowrap
|
|
153
|
+
[&:not(.resizable-cols-setup)_thead_th:not(.override-initial)]:flex-1
|
|
154
|
+
`,
|
|
155
|
+
_slots: `
|
|
156
|
+
<template #header-prop3="colProps">
|
|
157
|
+
<th
|
|
158
|
+
:class="\`\${colProps.class} [table:not(.resizable-cols-setup)_&]:w-[min-content] whitespace-nowrap override-initial\`"
|
|
159
|
+
:style="colProps.style"
|
|
160
|
+
>
|
|
161
|
+
{{ colProps.config.name }}
|
|
162
|
+
</th>
|
|
163
|
+
</template>
|
|
164
|
+
`
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export const FitWidthFalse: Story = {
|
|
169
|
+
...Primary,
|
|
170
|
+
args: {
|
|
171
|
+
...Primary.args,
|
|
172
|
+
resizable: {
|
|
173
|
+
fitWidth: false
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
export const StickyHeader: Story = {
|
|
180
|
+
...Primary,
|
|
181
|
+
args: {
|
|
182
|
+
...Primary.args,
|
|
183
|
+
resizable: {
|
|
184
|
+
enabled: true
|
|
185
|
+
},
|
|
186
|
+
stickyHeader: true,
|
|
187
|
+
// moving the border to the wrapper is to hide the little bits of border sticking out
|
|
188
|
+
// added back the right straight border otherwise the scrollbar looks ass
|
|
189
|
+
// this is ever so slightly visible if there is no scrollbar
|
|
190
|
+
wrapperAttrs: {
|
|
191
|
+
class: `
|
|
192
|
+
max-h-[50dvh]
|
|
193
|
+
`
|
|
194
|
+
},
|
|
195
|
+
values: Array.from({ length: 200 }).fill(0).map((_, i) => ({
|
|
196
|
+
prop1: `Item${i + 1} Prop 1`,
|
|
197
|
+
prop2: `Item${i + 1} Prop 2`,
|
|
198
|
+
prop3: `Item${i + 1} Prop 3`
|
|
199
|
+
}))
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
export const VirtualizedFixedHeight: Story = {
|
|
205
|
+
...Primary,
|
|
206
|
+
args: {
|
|
207
|
+
...Primary.args,
|
|
208
|
+
resizable: {
|
|
209
|
+
enabled: true
|
|
210
|
+
},
|
|
211
|
+
virtualizerOptions: {
|
|
212
|
+
enabled: true
|
|
213
|
+
},
|
|
214
|
+
stickyHeader: true,
|
|
215
|
+
wrapperAttrs: {
|
|
216
|
+
class: `
|
|
217
|
+
max-h-[50dvh]
|
|
218
|
+
`
|
|
219
|
+
},
|
|
220
|
+
values: Array.from({ length: 10000 }).fill(0).map((_, i) => ({
|
|
221
|
+
prop1: `Item${i + 1} Prop 1`,
|
|
222
|
+
prop2: `Item${i + 1} Prop 2`,
|
|
223
|
+
prop3: `Item${i + 1} Prop 3`
|
|
224
|
+
}))
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
// this is not the smoothest ever, but then the tan stack example isn't either
|
|
230
|
+
// i think the issue is when the scrollbar gets to it's min height
|
|
231
|
+
export const VirtualizedDynamicHeightExperimental: Story = {
|
|
232
|
+
...VirtualizedFixedHeight,
|
|
233
|
+
args: {
|
|
234
|
+
...VirtualizedFixedHeight.args,
|
|
235
|
+
virtualizerOptions: {
|
|
236
|
+
enabled: true,
|
|
237
|
+
method: "dynamic",
|
|
238
|
+
overscan: 5 // overscan is more expensive in dynamic mode
|
|
239
|
+
},
|
|
240
|
+
class: `
|
|
241
|
+
[&_td]:no-truncate!
|
|
242
|
+
[&_th]:no-truncate!
|
|
243
|
+
`,
|
|
244
|
+
values: Array.from({ length: 10000 }).fill(0).map((_, i) => ({
|
|
245
|
+
prop1: `Item${i + 1} Prop 1: ${faker.helpers.arrayElement(fakerSentences)}`,
|
|
246
|
+
prop2: `Item${i + 1} Prop 2: ${faker.helpers.arrayElement(fakerSentences)}`,
|
|
247
|
+
prop3: `Item${i + 1} Prop 3: ${faker.helpers.arrayElement(fakerSentences)}`
|
|
248
|
+
}))
|
|
249
|
+
},
|
|
250
|
+
parameters: {
|
|
251
|
+
tags: ["skip-smoke-test"]
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
export const VirtualizedFitWidthFalse: Story = {
|
|
257
|
+
...VirtualizedFixedHeight,
|
|
258
|
+
args: {
|
|
259
|
+
...VirtualizedFixedHeight.args,
|
|
260
|
+
resizable: {
|
|
261
|
+
fitWidth: false
|
|
262
|
+
},
|
|
263
|
+
|
|
264
|
+
class: `
|
|
265
|
+
[&_th]:no-truncate!
|
|
266
|
+
[&_th]:whitespace-nowrap!
|
|
267
|
+
[&:not(.resizable-cols-setup)]:w-max
|
|
268
|
+
[&:not(.resizable-cols-setup)_th]:w-max
|
|
269
|
+
`,
|
|
270
|
+
wrapperAttrs: {
|
|
271
|
+
class: `max-h-[50dvh]`
|
|
272
|
+
},
|
|
273
|
+
values: Array.from({ length: 10000 }).fill(0).map((_, i) => ({
|
|
274
|
+
prop1: `Item${i + 1} Prop 1`,
|
|
275
|
+
prop2: `Item${i + 1} Prop 2`,
|
|
276
|
+
prop3: `Item${i + 1} Prop 3`
|
|
277
|
+
}))
|
|
278
|
+
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export const ThreeColSomeColsNotResizable: Story = {
|
|
283
|
+
render: args => ({
|
|
284
|
+
components,
|
|
285
|
+
setup: () => {
|
|
286
|
+
const debugGrips = ref(false)
|
|
287
|
+
return { args, debugGrips }
|
|
288
|
+
},
|
|
289
|
+
template: `
|
|
290
|
+
<div class="flex flex-col gap-2 w-full border rounded-md mb-10">
|
|
291
|
+
<WButton @click="debugGrips = !debugGrips">Toggle Debug Grips (currently {{debugGrips}})</WButton>
|
|
292
|
+
</div>
|
|
293
|
+
<div :class="debugGrips ? ' [&_.grip]:bg-red-500': ''">
|
|
294
|
+
<div class="flex flex-col gap-2 w-full">
|
|
295
|
+
<WTable
|
|
296
|
+
v-bind="args"
|
|
297
|
+
>
|
|
298
|
+
</WTable>
|
|
299
|
+
<WTable
|
|
300
|
+
v-bind="{...args, colConfig:args.colConfig2}"
|
|
301
|
+
>
|
|
302
|
+
</WTable>
|
|
303
|
+
<WTable
|
|
304
|
+
v-bind="{...args, colConfig:args.colConfig3}"
|
|
305
|
+
>
|
|
306
|
+
</WTable>
|
|
307
|
+
</div>
|
|
308
|
+
</div>
|
|
309
|
+
`
|
|
310
|
+
}),
|
|
311
|
+
args: {
|
|
312
|
+
cols: ["prop1", "prop2", "prop3"],
|
|
313
|
+
itemKey: "prop1",
|
|
314
|
+
values: [
|
|
315
|
+
{ prop1: "Prop 1", prop2: "Prop 2", prop3: "Prop 3" }
|
|
316
|
+
],
|
|
317
|
+
colConfig: { prop1: { name: "No Resize", resizable: false } },
|
|
318
|
+
colConfig2: { prop2: { name: "No Resize", resizable: false } },
|
|
319
|
+
colConfig3: { prop3: { name: "No Resize", resizable: false } }
|
|
320
|
+
} as any
|
|
321
|
+
}
|
|
322
|
+
export const FourColSomeColsNotResizable: Story = {
|
|
323
|
+
render: ThreeColSomeColsNotResizable.render,
|
|
324
|
+
args: {
|
|
325
|
+
cols: ["prop1", "prop2", "prop3", "prop4"],
|
|
326
|
+
values: [
|
|
327
|
+
{ prop1: "Prop 1", prop2: "Prop 2", prop3: "Prop 3", prop4: "Prop 4" }
|
|
328
|
+
],
|
|
329
|
+
itemKey: "prop1",
|
|
330
|
+
colConfig: { prop1: { name: "No Resize", resizable: false }, prop3: { name: "No Resize", resizable: false } },
|
|
331
|
+
colConfig2: { prop2: { name: "No Resize", resizable: false }, prop3: { name: "No Resize", resizable: false } },
|
|
332
|
+
colConfig3: { prop1: { name: "No Resize", resizable: false }, prop4: { name: "No Resize", resizable: false } }
|
|
333
|
+
} as any
|
|
334
|
+
}
|