@witchcraft/ui 0.3.24 → 0.4.0-beta.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 +54 -61
- package/dist/module.json +1 -1
- 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 -1
- package/dist/runtime/components/TestControls/TestControls.vue +3 -3
- 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 +109 -0
- package/dist/runtime/components/WCheckbox/WCheckbox.vue.d.ts +33 -0
- package/dist/runtime/components/WColorInput/WColorInput.d.vue.ts +45 -0
- package/dist/runtime/components/WColorInput/WColorInput.vue +85 -0
- package/dist/runtime/components/WColorInput/WColorInput.vue.d.ts +45 -0
- 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} +5 -4
- package/dist/runtime/components/{LibColorPicker/LibColorPicker.vue → WColorPicker/WColorPicker.vue} +40 -29
- package/dist/runtime/components/{LibColorPicker/LibColorPicker.vue.d.ts → WColorPicker/WColorPicker.vue.d.ts} +5 -4
- package/dist/runtime/components/WCombobox/WCombobox.d.vue.ts +109 -0
- package/dist/runtime/components/WCombobox/WCombobox.vue +402 -0
- package/dist/runtime/components/WCombobox/WCombobox.vue.d.ts +109 -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} +8 -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} +8 -13
- package/dist/runtime/components/WDatePicker/WDatePicker.d.vue.ts +40 -0
- package/dist/runtime/components/{LibDatePicker/LibDatePicker.vue → WDatePicker/WDatePicker.vue} +3 -7
- package/dist/runtime/components/WDatePicker/WDatePicker.vue.d.ts +40 -0
- package/dist/runtime/components/{LibDatePicker/LibRangeDatePicker.vue → WDatePicker/WRangeDatePicker.vue} +16 -21
- package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.vue → WDatePicker/WSingleDatePicker.vue} +16 -21
- package/dist/runtime/components/{LibDatePicker/LibTimeZonePicker.d.vue.ts → WDatePicker/WTimeZonePicker.d.vue.ts} +1 -11
- package/dist/runtime/components/{LibDatePicker/LibTimeZonePicker.vue → WDatePicker/WTimeZonePicker.vue} +5 -12
- package/dist/runtime/components/{LibDatePicker/LibTimeZonePicker.vue.d.ts → WDatePicker/WTimeZonePicker.vue.d.ts} +1 -11
- package/dist/runtime/components/{LibDebug/LibDebug.vue → WDebug/WDebug.vue} +9 -12
- package/dist/runtime/components/{LibDevOnly/LibDevOnly.d.vue.ts → WDevOnly/WDevOnly.d.vue.ts} +0 -3
- package/dist/runtime/components/{LibDevOnly/LibDevOnly.vue.d.ts → WDevOnly/WDevOnly.vue.d.ts} +0 -3
- package/dist/runtime/components/WFileInput/WFileInput.d.vue.ts +58 -0
- package/dist/runtime/components/{LibFileInput/LibFileInput.vue → WFileInput/WFileInput.vue} +71 -57
- package/dist/runtime/components/WFileInput/WFileInput.vue.d.ts +58 -0
- package/dist/runtime/components/{Icon/Icon.vue.d.ts → WIcon/WIcon.d.vue.ts} +2 -6
- package/dist/runtime/components/{Icon/Icon.vue → WIcon/WIcon.vue} +1 -1
- package/dist/runtime/components/{Icon/Icon.d.vue.ts → WIcon/WIcon.vue.d.ts} +2 -6
- package/dist/runtime/components/{LibMultiValues/LibMultiValues.d.vue.ts → WMultiValues/WMultiValues.d.vue.ts} +8 -14
- package/dist/runtime/components/WMultiValues/WMultiValues.vue +149 -0
- package/dist/runtime/components/{LibMultiValues/LibMultiValues.vue.d.ts → WMultiValues/WMultiValues.vue.d.ts} +8 -14
- package/dist/runtime/components/WNotifications/WNotification.d.vue.ts +37 -0
- package/dist/runtime/components/{LibNotifications/LibNotification.vue → WNotifications/WNotification.vue} +38 -50
- package/dist/runtime/components/WNotifications/WNotification.vue.d.ts +37 -0
- package/dist/runtime/components/WNotifications/WNotifications.d.vue.ts +11 -0
- package/dist/runtime/components/{LibNotifications/LibNotifications.vue → WNotifications/WNotifications.vue} +44 -28
- package/dist/runtime/components/WNotifications/WNotifications.vue.d.ts +11 -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 +43 -0
- package/dist/runtime/components/WPopover/WPopover.vue +138 -0
- package/dist/runtime/components/WPopover/WPopover.vue.d.ts +43 -0
- package/dist/runtime/components/WPopup/WPopup.d.vue.ts +41 -0
- package/dist/runtime/components/WPopup/WPopup.vue +74 -0
- package/dist/runtime/components/WPopup/WPopup.vue.d.ts +41 -0
- package/dist/runtime/components/{LibProgressBar/LibProgressBar.d.vue.ts → WProgressBar/WProgressBar.d.vue.ts} +14 -18
- package/dist/runtime/components/WProgressBar/WProgressBar.vue +150 -0
- package/dist/runtime/components/{LibProgressBar/LibProgressBar.vue.d.ts → WProgressBar/WProgressBar.vue.d.ts} +14 -18
- package/dist/runtime/components/{LibRecorder/LibRecorder.d.vue.ts → WRecorder/WRecorder.d.vue.ts} +14 -29
- 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} +14 -29
- package/dist/runtime/components/{LibRoot/LibRoot.d.vue.ts → WRoot/WRoot.d.vue.ts} +6 -5
- 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} +6 -5
- package/dist/runtime/components/{LibSimpleInput/LibSimpleInput.d.vue.ts → WSimpleInput/WSimpleInput.d.vue.ts} +9 -16
- package/dist/runtime/components/{LibSimpleInput/LibSimpleInput.vue → WSimpleInput/WSimpleInput.vue} +12 -23
- package/dist/runtime/components/{LibSimpleInput/LibSimpleInput.vue.d.ts → WSimpleInput/WSimpleInput.vue.d.ts} +9 -16
- package/dist/runtime/components/WTable/WTable.d.vue.ts +102 -0
- package/dist/runtime/components/{LibTable/LibTable.vue → WTable/WTable.vue} +13 -14
- 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 +111 -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/helpers/NotificationHandler.d.ts +25 -3
- package/dist/runtime/helpers/NotificationHandler.js +5 -9
- package/dist/runtime/injectionKeys.d.ts +1 -5
- package/dist/runtime/injectionKeys.js +0 -2
- package/dist/runtime/types/index.d.ts +85 -27
- package/dist/runtime/types/index.js +1 -0
- package/package.json +43 -43
- package/src/runtime/assets/animations.css +5 -5
- package/src/runtime/assets/locales/en.json +2 -0
- package/src/runtime/assets/utils.css +43 -0
- package/src/runtime/build/WitchcraftUiResolver.ts +1 -1
- 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 +123 -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} +43 -32
- package/src/runtime/components/WCombobox/WCombobox.stories.ts +209 -0
- package/src/runtime/components/WCombobox/WCombobox.vue +446 -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} +16 -22
- package/src/runtime/components/{LibDatePicker/LibSingleDatePicker.vue → WDatePicker/WSingleDatePicker.vue} +16 -22
- 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} +8 -11
- package/src/runtime/components/{LibDevOnly/LibDevOnly.vue → WDevOnly/WDevOnly.vue} +0 -4
- package/src/runtime/components/{LibFileInput/LibFileInput.stories.ts → WFileInput/WFileInput.stories.ts} +7 -7
- package/src/runtime/components/{LibFileInput/LibFileInput.vue → WFileInput/WFileInput.vue} +95 -98
- 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 +161 -0
- package/src/runtime/components/{LibNotifications/LibNotification.stories.ts → WNotifications/WNotification.stories.ts} +24 -9
- package/src/runtime/components/{LibNotifications/LibNotification.vue → WNotifications/WNotification.vue} +46 -66
- package/src/runtime/components/WNotifications/WNotifications.stories.ts +139 -0
- package/src/runtime/components/{LibNotifications/LibNotifications.vue → WNotifications/WNotifications.vue} +60 -40
- 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 +161 -0
- package/src/runtime/components/WPopup/WPopup.stories.ts +60 -0
- package/src/runtime/components/WPopup/WPopup.vue +93 -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} +27 -44
- package/src/runtime/components/{LibTable/LibTable.stories.ts → WTable/WTable.stories.ts} +60 -52
- package/src/runtime/components/{LibTable/LibTable.vue → WTable/WTable.vue} +85 -87
- package/src/runtime/components/WTooltip/WTooltip.stories.ts +82 -0
- package/src/runtime/components/WTooltip/WTooltip.vue +126 -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/helpers/NotificationHandler.ts +26 -11
- package/src/runtime/injectionKeys.ts +1 -7
- package/src/runtime/types/index.ts +105 -32
- package/types/components.d.ts +13 -15
- package/dist/runtime/components/Aria/Aria.d.vue.ts +0 -6
- package/dist/runtime/components/Aria/Aria.vue +0 -16
- package/dist/runtime/components/Aria/Aria.vue.d.ts +0 -6
- package/dist/runtime/components/LibButton/LibButton.d.vue.ts +0 -37
- package/dist/runtime/components/LibButton/LibButton.vue.d.ts +0 -37
- package/dist/runtime/components/LibCheckbox/LibCheckbox.d.vue.ts +0 -41
- package/dist/runtime/components/LibCheckbox/LibCheckbox.vue +0 -103
- package/dist/runtime/components/LibCheckbox/LibCheckbox.vue.d.ts +0 -41
- package/dist/runtime/components/LibColorInput/LibColorInput.d.vue.ts +0 -64
- package/dist/runtime/components/LibColorInput/LibColorInput.vue +0 -162
- package/dist/runtime/components/LibColorInput/LibColorInput.vue.d.ts +0 -64
- package/dist/runtime/components/LibDatePicker/LibDatePicker.d.vue.ts +0 -191
- package/dist/runtime/components/LibDatePicker/LibDatePicker.vue.d.ts +0 -191
- package/dist/runtime/components/LibFileInput/LibFileInput.d.vue.ts +0 -46
- package/dist/runtime/components/LibFileInput/LibFileInput.vue.d.ts +0 -46
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.d.vue.ts +0 -256
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +0 -387
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue.d.ts +0 -256
- package/dist/runtime/components/LibLabel/LibLabel.d.vue.ts +0 -27
- package/dist/runtime/components/LibLabel/LibLabel.vue +0 -45
- package/dist/runtime/components/LibLabel/LibLabel.vue.d.ts +0 -27
- package/dist/runtime/components/LibMultiValues/LibMultiValues.vue +0 -109
- package/dist/runtime/components/LibNotifications/LibNotification.d.vue.ts +0 -45
- package/dist/runtime/components/LibNotifications/LibNotification.vue.d.ts +0 -45
- package/dist/runtime/components/LibNotifications/LibNotifications.d.vue.ts +0 -15
- package/dist/runtime/components/LibNotifications/LibNotifications.vue.d.ts +0 -15
- package/dist/runtime/components/LibPagination/LibPagination.d.vue.ts +0 -105
- package/dist/runtime/components/LibPagination/LibPagination.vue +0 -229
- package/dist/runtime/components/LibPagination/LibPagination.vue.d.ts +0 -105
- package/dist/runtime/components/LibPalette/LibPalette.d.vue.ts +0 -15
- package/dist/runtime/components/LibPalette/LibPalette.vue.d.ts +0 -15
- package/dist/runtime/components/LibPopup/LibPopup.d.vue.ts +0 -52
- package/dist/runtime/components/LibPopup/LibPopup.vue +0 -365
- package/dist/runtime/components/LibPopup/LibPopup.vue.d.ts +0 -52
- package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +0 -169
- package/dist/runtime/components/LibSuggestions/LibSuggestions.d.vue.ts +0 -99
- package/dist/runtime/components/LibSuggestions/LibSuggestions.vue +0 -178
- package/dist/runtime/components/LibSuggestions/LibSuggestions.vue.d.ts +0 -99
- package/dist/runtime/components/LibTable/LibTable.d.vue.ts +0 -125
- package/dist/runtime/components/LibTable/LibTable.vue.d.ts +0 -125
- package/dist/runtime/components/Template/NAME.d.vue.ts +0 -18
- package/dist/runtime/components/Template/NAME.vue +0 -27
- package/dist/runtime/components/Template/NAME.vue.d.ts +0 -18
- 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 -131
- package/src/runtime/components/LibColorInput/LibColorInput.vue +0 -203
- package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.ts +0 -405
- package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +0 -419
- 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 -127
- 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/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/LibRangeDatePicker.d.vue.ts → WDatePicker/WRangeDatePicker.d.vue.ts} +0 -0
- /package/dist/runtime/components/{LibDatePicker/LibRangeDatePicker.vue.d.ts → WDatePicker/WRangeDatePicker.vue.d.ts} +0 -0
- /package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.d.vue.ts → WDatePicker/WSingleDatePicker.d.vue.ts} +0 -0
- /package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.vue.d.ts → WDatePicker/WSingleDatePicker.vue.d.ts} +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/{LibDebug/LibDebug.d.vue.ts → WDebug/WDebug.d.vue.ts} +0 -0
- /package/dist/runtime/components/{LibDebug/LibDebug.vue.d.ts → WDebug/WDebug.vue.d.ts} +0 -0
- /package/dist/runtime/components/{LibDevOnly/LibDevOnly.vue → WDevOnly/WDevOnly.vue} +0 -0
- /package/dist/runtime/components/{LibNotifications/LibNotificationTestMessageComponent.d.vue.ts → WNotifications/WNotificationTestMessageComponent.d.vue.ts} +0 -0
- /package/dist/runtime/components/{LibNotifications/LibNotificationTestMessageComponent.vue → WNotifications/WNotificationTestMessageComponent.vue} +0 -0
- /package/dist/runtime/components/{LibNotifications/LibNotificationTestMessageComponent.vue.d.ts → WNotifications/WNotificationTestMessageComponent.vue.d.ts} +0 -0
- /package/dist/runtime/components/{LibNotifications → WNotifications}/calculateNotificationProgress.d.ts +0 -0
- /package/dist/runtime/components/{LibNotifications → WNotifications}/calculateNotificationProgress.js +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
- /package/src/runtime/components/{LibNotifications/LibNotificationTestMessageComponent.vue → WNotifications/WNotificationTestMessageComponent.vue} +0 -0
- /package/src/runtime/components/{LibNotifications → WNotifications}/calculateNotificationProgress.ts +0 -0
|
@@ -1,365 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<slot
|
|
3
|
-
name="button"
|
|
4
|
-
:extract-el="(_) => buttonEl = _"
|
|
5
|
-
/>
|
|
6
|
-
<!-- <Transition> -->
|
|
7
|
-
<component
|
|
8
|
-
v-if="modelValue || useDialogForBackdrop"
|
|
9
|
-
:id="id ?? fallbackId"
|
|
10
|
-
:class="twMerge(
|
|
11
|
-
useBackdrop && useDialogForBackdrop && `
|
|
12
|
-
popup--backdrop
|
|
13
|
-
bg-transparent
|
|
14
|
-
p-0
|
|
15
|
-
backdrop:bg-transparent
|
|
16
|
-
`,
|
|
17
|
-
modelValue && useBackdrop && !useDialogForBackdrop && `
|
|
18
|
-
popup--backdrop
|
|
19
|
-
z-100
|
|
20
|
-
fixed
|
|
21
|
-
inset-0
|
|
22
|
-
`,
|
|
23
|
-
$attrs.class
|
|
24
|
-
)"
|
|
25
|
-
v-bind="{ ...$attrs, class: void 0 }"
|
|
26
|
-
:is="useDialogForBackdrop ? 'dialog' : 'div'"
|
|
27
|
-
ref="dialogEl"
|
|
28
|
-
@mousedown.self="handleMouseup"
|
|
29
|
-
>
|
|
30
|
-
<div
|
|
31
|
-
v-if="modelValue"
|
|
32
|
-
:class="`popup z-100 fixed ${props.avoidRepositioning ? 'transition-[top,left]' : ''}`"
|
|
33
|
-
:style="`
|
|
34
|
-
top:${pos.y}px;
|
|
35
|
-
left:${pos.x}px;
|
|
36
|
-
${pos.maxWidth ? `max-width:${pos.maxWidth}px` : ''}
|
|
37
|
-
${pos.maxHeight ? `max-height:${pos.maxHeight}px` : ''}
|
|
38
|
-
`"
|
|
39
|
-
>
|
|
40
|
-
<slot
|
|
41
|
-
name="popup"
|
|
42
|
-
:position="pos"
|
|
43
|
-
:extract-el="(_) => popupEl = _"
|
|
44
|
-
/>
|
|
45
|
-
</div>
|
|
46
|
-
</component>
|
|
47
|
-
<!-- </Transition> -->
|
|
48
|
-
</template>
|
|
49
|
-
|
|
50
|
-
<script setup>
|
|
51
|
-
import { onMounted, ref, useAttrs, watch } from "vue";
|
|
52
|
-
import { getFallbackId } from "../shared/props.js";
|
|
53
|
-
import { twMerge } from "../../utils/twMerge.js";
|
|
54
|
-
import { castType } from "@alanscodelog/utils/castType";
|
|
55
|
-
import { isArray } from "@alanscodelog/utils/isArray";
|
|
56
|
-
const fallbackId = getFallbackId();
|
|
57
|
-
const props = defineProps({
|
|
58
|
-
id: { type: String, required: false },
|
|
59
|
-
useDialogForBackdrop: { type: Boolean, required: false, default: false },
|
|
60
|
-
useBackdrop: { type: Boolean, required: false, default: true },
|
|
61
|
-
preferredHorizontal: { type: [Array, Function], required: false, default: () => ["center-most", "either"] },
|
|
62
|
-
preferredVertical: { type: [Array, Function], required: false, default: () => ["top", "bottom", "either"] },
|
|
63
|
-
avoidRepositioning: { type: Boolean, required: false, default: false },
|
|
64
|
-
modifyPosition: { type: Function, required: false },
|
|
65
|
-
canClose: { type: Boolean, required: false, default: true }
|
|
66
|
-
});
|
|
67
|
-
const $attrs = useAttrs();
|
|
68
|
-
defineOptions({
|
|
69
|
-
name: "LibPopup",
|
|
70
|
-
inheritAttrs: false
|
|
71
|
-
});
|
|
72
|
-
const emit = defineEmits(["close"]);
|
|
73
|
-
const dialogEl = ref(null);
|
|
74
|
-
const popupEl = ref(null);
|
|
75
|
-
const buttonEl = ref(null);
|
|
76
|
-
const backgroundEl = ref(null);
|
|
77
|
-
const pos = ref({});
|
|
78
|
-
const modelValue = defineModel({ type: Boolean, ...{ default: false } });
|
|
79
|
-
let isOpen = modelValue.value;
|
|
80
|
-
const getDialogBoundingRect = () => ({
|
|
81
|
-
x: 0,
|
|
82
|
-
y: 0,
|
|
83
|
-
width: window.innerWidth,
|
|
84
|
-
height: window.innerHeight,
|
|
85
|
-
top: 0,
|
|
86
|
-
bottom: 0,
|
|
87
|
-
left: 0,
|
|
88
|
-
right: 0
|
|
89
|
-
});
|
|
90
|
-
let lastButtonElPos;
|
|
91
|
-
const recompute = (force = false) => {
|
|
92
|
-
requestAnimationFrame(() => {
|
|
93
|
-
const horzHasCenterScreen = isArray(props.preferredHorizontal) && props.preferredHorizontal[0] === "center-screen";
|
|
94
|
-
const vertHasCenterScreen = isArray(props.preferredVertical) && props.preferredVertical[0] === "center-screen";
|
|
95
|
-
const canBePositionedWithoutButton = (horzHasCenterScreen || typeof props.preferredHorizontal === "function") && (vertHasCenterScreen || typeof props.preferredVertical === "function");
|
|
96
|
-
if (!popupEl.value || !dialogEl.value || !buttonEl.value && !canBePositionedWithoutButton) {
|
|
97
|
-
pos.value = {};
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
const el = buttonEl.value?.getBoundingClientRect();
|
|
101
|
-
const bg = backgroundEl.value?.getBoundingClientRect() ?? (props.useBackdrop ? getDialogBoundingRect() : document.body.getBoundingClientRect());
|
|
102
|
-
const popup = popupEl.value.getBoundingClientRect();
|
|
103
|
-
let finalPos = {};
|
|
104
|
-
if (!force && modelValue.value && props.avoidRepositioning && buttonEl.value && lastButtonElPos) {
|
|
105
|
-
const shiftX = buttonEl.value.getBoundingClientRect().x - lastButtonElPos.x;
|
|
106
|
-
const shiftY = buttonEl.value.getBoundingClientRect().y - lastButtonElPos.y;
|
|
107
|
-
pos.value.x += shiftX;
|
|
108
|
-
pos.value.y += shiftY;
|
|
109
|
-
lastButtonElPos = el;
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
const space = {
|
|
113
|
-
left: 0,
|
|
114
|
-
right: 0,
|
|
115
|
-
leftLeft: 0,
|
|
116
|
-
rightRight: 0,
|
|
117
|
-
leftFromCenter: 0,
|
|
118
|
-
rightFromCenter: 0,
|
|
119
|
-
topFromCenter: 0,
|
|
120
|
-
bottomFromCenter: 0,
|
|
121
|
-
top: 0,
|
|
122
|
-
bottom: 0
|
|
123
|
-
};
|
|
124
|
-
if (el) {
|
|
125
|
-
space.left = el.x + el.width - bg.x;
|
|
126
|
-
space.leftLeft = el.x - bg.x;
|
|
127
|
-
space.right = bg.x + bg.width - (el.x + el.width);
|
|
128
|
-
space.rightRight = bg.x + bg.width - el.x;
|
|
129
|
-
space.leftFromCenter = el.x + el.width / 2 - bg.x;
|
|
130
|
-
space.rightFromCenter = bg.x + bg.width - (el.x + el.width / 2);
|
|
131
|
-
space.topFromCenter = el.y + el.height / 2 - bg.y;
|
|
132
|
-
space.bottomFromCenter = bg.y + bg.height - (el.y + el.height / 2);
|
|
133
|
-
space.top = el.y - bg.y;
|
|
134
|
-
space.bottom = bg.y + bg.height - (el.y + el.height);
|
|
135
|
-
}
|
|
136
|
-
const { preferredHorizontal, preferredVertical } = props;
|
|
137
|
-
let maxWidth;
|
|
138
|
-
let maxHeight;
|
|
139
|
-
if (typeof preferredHorizontal === "function") {
|
|
140
|
-
finalPos.x = preferredHorizontal(el, popup, bg, space);
|
|
141
|
-
} else {
|
|
142
|
-
outerloop:
|
|
143
|
-
for (const type of preferredHorizontal) {
|
|
144
|
-
switch (type) {
|
|
145
|
-
case "center-screen":
|
|
146
|
-
if (popup.width < bg.width) {
|
|
147
|
-
finalPos.x = bg.width / 2 - popup.width / 2;
|
|
148
|
-
} else {
|
|
149
|
-
finalPos.x = 0;
|
|
150
|
-
maxWidth = finalPos.x;
|
|
151
|
-
}
|
|
152
|
-
break;
|
|
153
|
-
case "center-most":
|
|
154
|
-
case "center":
|
|
155
|
-
castType(el);
|
|
156
|
-
if (space.leftFromCenter >= popup.width / 2 && space.rightFromCenter >= popup.width / 2) {
|
|
157
|
-
finalPos.x = el.x + el.width / 2 - popup.width / 2;
|
|
158
|
-
break outerloop;
|
|
159
|
-
}
|
|
160
|
-
if (space.rightFromCenter + space.leftFromCenter <= popup.width) {
|
|
161
|
-
finalPos.x = 0;
|
|
162
|
-
break outerloop;
|
|
163
|
-
}
|
|
164
|
-
if (type === "center-most") {
|
|
165
|
-
if (space.leftFromCenter < space.rightFromCenter) {
|
|
166
|
-
finalPos.x = el.x + el.width / 2 - space.leftFromCenter;
|
|
167
|
-
break outerloop;
|
|
168
|
-
} else {
|
|
169
|
-
finalPos.x = el.x + el.width / 2 + space.rightFromCenter - popup.width;
|
|
170
|
-
break outerloop;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
break;
|
|
174
|
-
case "left-most":
|
|
175
|
-
castType(el);
|
|
176
|
-
if (space.left >= popup.width) {
|
|
177
|
-
finalPos.x = el.x - popup.width;
|
|
178
|
-
break outerloop;
|
|
179
|
-
} else {
|
|
180
|
-
finalPos.x = 0;
|
|
181
|
-
break outerloop;
|
|
182
|
-
}
|
|
183
|
-
case "right-most":
|
|
184
|
-
castType(el);
|
|
185
|
-
if (space.right >= popup.width) {
|
|
186
|
-
finalPos.x = el.x + el.width;
|
|
187
|
-
break outerloop;
|
|
188
|
-
} else {
|
|
189
|
-
finalPos.x = bg.x + bg.width - popup.width;
|
|
190
|
-
break outerloop;
|
|
191
|
-
}
|
|
192
|
-
case "right":
|
|
193
|
-
castType(el);
|
|
194
|
-
if (space.right >= popup.width) {
|
|
195
|
-
finalPos.x = el.x;
|
|
196
|
-
break outerloop;
|
|
197
|
-
}
|
|
198
|
-
break;
|
|
199
|
-
case "left":
|
|
200
|
-
castType(el);
|
|
201
|
-
if (space.left >= popup.width) {
|
|
202
|
-
finalPos.x = el.x + el.width - popup.width;
|
|
203
|
-
break outerloop;
|
|
204
|
-
}
|
|
205
|
-
break;
|
|
206
|
-
case "either": {
|
|
207
|
-
castType(el);
|
|
208
|
-
if (space.right >= space.left) {
|
|
209
|
-
finalPos.x = el.x;
|
|
210
|
-
break outerloop;
|
|
211
|
-
} else {
|
|
212
|
-
finalPos.x = el.x + el.width - popup.width;
|
|
213
|
-
break outerloop;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
if (typeof preferredVertical === "function") {
|
|
220
|
-
finalPos.y = preferredVertical(el, popup, bg, space);
|
|
221
|
-
} else {
|
|
222
|
-
outerloop:
|
|
223
|
-
for (const type of preferredVertical) {
|
|
224
|
-
switch (type) {
|
|
225
|
-
case "center-screen":
|
|
226
|
-
if (popup.height < bg.height) {
|
|
227
|
-
finalPos.y = bg.height / 2 - popup.height / 2;
|
|
228
|
-
} else {
|
|
229
|
-
finalPos.y = 0;
|
|
230
|
-
maxHeight = finalPos.y;
|
|
231
|
-
}
|
|
232
|
-
break;
|
|
233
|
-
case "top":
|
|
234
|
-
castType(el);
|
|
235
|
-
if (space.top >= popup.height) {
|
|
236
|
-
finalPos.y = el.y - popup.height;
|
|
237
|
-
break outerloop;
|
|
238
|
-
}
|
|
239
|
-
break;
|
|
240
|
-
case "bottom":
|
|
241
|
-
castType(el);
|
|
242
|
-
if (space.bottom >= popup.height) {
|
|
243
|
-
finalPos.y = el.y + el.height;
|
|
244
|
-
break outerloop;
|
|
245
|
-
}
|
|
246
|
-
break;
|
|
247
|
-
case "top-most":
|
|
248
|
-
castType(el);
|
|
249
|
-
if (space.top >= popup.height) {
|
|
250
|
-
finalPos.y = el.y - popup.height;
|
|
251
|
-
break outerloop;
|
|
252
|
-
} else {
|
|
253
|
-
finalPos.y = 0;
|
|
254
|
-
break outerloop;
|
|
255
|
-
}
|
|
256
|
-
case "bottom-most":
|
|
257
|
-
castType(el);
|
|
258
|
-
if (space.bottom >= popup.height) {
|
|
259
|
-
finalPos.y = el.y + el.height;
|
|
260
|
-
break outerloop;
|
|
261
|
-
} else {
|
|
262
|
-
finalPos.y = bg.y + bg.height - popup.height;
|
|
263
|
-
break outerloop;
|
|
264
|
-
}
|
|
265
|
-
case "center-most":
|
|
266
|
-
case "center":
|
|
267
|
-
castType(el);
|
|
268
|
-
if (space.topFromCenter >= popup.height / 2 && space.bottomFromCenter >= popup.height / 2) {
|
|
269
|
-
finalPos.y = el.y + el.height / 2 - popup.height / 2;
|
|
270
|
-
break outerloop;
|
|
271
|
-
}
|
|
272
|
-
if (space.bottomFromCenter + space.topFromCenter <= popup.height) {
|
|
273
|
-
finalPos.y = 0;
|
|
274
|
-
break outerloop;
|
|
275
|
-
}
|
|
276
|
-
if (type === "center-most") {
|
|
277
|
-
if (space.topFromCenter < space.bottomFromCenter) {
|
|
278
|
-
finalPos.y = el.y + el.height / 2 - space.topFromCenter;
|
|
279
|
-
break outerloop;
|
|
280
|
-
} else {
|
|
281
|
-
finalPos.y = el.y + el.height / 2 + space.bottomFromCenter - popup.height;
|
|
282
|
-
break outerloop;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
break;
|
|
286
|
-
case "either": {
|
|
287
|
-
castType(el);
|
|
288
|
-
if (space.top >= space.bottom) {
|
|
289
|
-
finalPos.y = el.y - popup.height;
|
|
290
|
-
break outerloop;
|
|
291
|
-
} else {
|
|
292
|
-
finalPos.y = el.y + el.height;
|
|
293
|
-
break outerloop;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
finalPos.maxWidth = maxWidth ?? void 0;
|
|
300
|
-
finalPos.maxHeight = maxHeight ?? void 0;
|
|
301
|
-
if (props.modifyPosition) {
|
|
302
|
-
finalPos = props.modifyPosition(finalPos, el, popup, bg, space);
|
|
303
|
-
}
|
|
304
|
-
pos.value = finalPos;
|
|
305
|
-
lastButtonElPos = el;
|
|
306
|
-
});
|
|
307
|
-
};
|
|
308
|
-
const show = () => {
|
|
309
|
-
if (!isOpen) {
|
|
310
|
-
isOpen = true;
|
|
311
|
-
modelValue.value = isOpen;
|
|
312
|
-
if (props.useBackdrop && props.useDialogForBackdrop) dialogEl.value?.showModal();
|
|
313
|
-
recompute(true);
|
|
314
|
-
}
|
|
315
|
-
};
|
|
316
|
-
const close = () => {
|
|
317
|
-
if (isOpen) {
|
|
318
|
-
const res = props.canClose ?? false;
|
|
319
|
-
emit("close");
|
|
320
|
-
if (res === false) return;
|
|
321
|
-
isOpen = false;
|
|
322
|
-
modelValue.value = isOpen;
|
|
323
|
-
pos.value.maxWidth = void 0;
|
|
324
|
-
if (props.useBackdrop && props.useDialogForBackdrop) dialogEl.value?.close();
|
|
325
|
-
}
|
|
326
|
-
};
|
|
327
|
-
const recomputeListener = () => recompute();
|
|
328
|
-
const bindListeners = () => {
|
|
329
|
-
window.addEventListener("resize", recomputeListener);
|
|
330
|
-
window.addEventListener("scroll", recomputeListener, true);
|
|
331
|
-
};
|
|
332
|
-
const unbindListeners = () => {
|
|
333
|
-
window.removeEventListener("resize", recomputeListener);
|
|
334
|
-
window.removeEventListener("scroll", recomputeListener, true);
|
|
335
|
-
};
|
|
336
|
-
watch([modelValue, popupEl], () => {
|
|
337
|
-
if (modelValue.value) {
|
|
338
|
-
show();
|
|
339
|
-
bindListeners();
|
|
340
|
-
} else {
|
|
341
|
-
close();
|
|
342
|
-
unbindListeners();
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
const handleMouseup = ($event) => {
|
|
346
|
-
$event.preventDefault();
|
|
347
|
-
close();
|
|
348
|
-
};
|
|
349
|
-
onMounted(() => {
|
|
350
|
-
recompute();
|
|
351
|
-
});
|
|
352
|
-
defineExpose({
|
|
353
|
-
recompute,
|
|
354
|
-
setReference: (el) => {
|
|
355
|
-
buttonEl.value = el;
|
|
356
|
-
},
|
|
357
|
-
setBackground: (el) => {
|
|
358
|
-
backgroundEl.value = el;
|
|
359
|
-
}
|
|
360
|
-
});
|
|
361
|
-
</script>
|
|
362
|
-
|
|
363
|
-
<script>
|
|
364
|
-
|
|
365
|
-
</script>
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { type HTMLAttributes } from "vue";
|
|
2
|
-
import { type LinkableByIdProps, type TailwindClassProp, type PopupProps } from "../shared/props.js";
|
|
3
|
-
import type { IPopupReference } from "../../types/index.js";
|
|
4
|
-
type RealProps = LinkableByIdProps & PopupProps;
|
|
5
|
-
interface Props extends
|
|
6
|
-
/** @vue-ignore */
|
|
7
|
-
Partial<Omit<HTMLAttributes, "class"> & TailwindClassProp>, RealProps {
|
|
8
|
-
}
|
|
9
|
-
declare const _default: typeof __VLS_export;
|
|
10
|
-
export default _default;
|
|
11
|
-
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Props & {
|
|
12
|
-
modelValue?: boolean;
|
|
13
|
-
}, {
|
|
14
|
-
recompute: (force?: boolean) => void;
|
|
15
|
-
setReference: (el: IPopupReference | null) => void;
|
|
16
|
-
setBackground: (el: IPopupReference | null) => void;
|
|
17
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
-
"update:modelValue": (value: boolean) => any;
|
|
19
|
-
} & {
|
|
20
|
-
close: () => any;
|
|
21
|
-
}, string, import("vue").PublicProps, Readonly<Props & {
|
|
22
|
-
modelValue?: boolean;
|
|
23
|
-
}> & Readonly<{
|
|
24
|
-
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
25
|
-
onClose?: (() => any) | undefined;
|
|
26
|
-
}>, {
|
|
27
|
-
canClose: boolean;
|
|
28
|
-
useDialogForBackdrop: false;
|
|
29
|
-
useBackdrop: boolean;
|
|
30
|
-
preferredHorizontal: ("center" | "right" | "left" | "either" | "center-screen" | "right-most" | "left-most" | "center-most")[] | import("../../main.lib.js").PopupPositioner;
|
|
31
|
-
preferredVertical: ("top" | "bottom" | "center" | "either" | "center-screen" | "top-most" | "bottom-most" | "center-most")[] | import("../../main.lib.js").PopupPositioner;
|
|
32
|
-
avoidRepositioning: boolean;
|
|
33
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
34
|
-
button?: (props: {
|
|
35
|
-
extractEl: (_: any) => any;
|
|
36
|
-
}) => any;
|
|
37
|
-
} & {
|
|
38
|
-
popup?: (props: {
|
|
39
|
-
position: {
|
|
40
|
-
x: number;
|
|
41
|
-
y: number;
|
|
42
|
-
maxWidth?: number | undefined;
|
|
43
|
-
maxHeight?: number | undefined;
|
|
44
|
-
};
|
|
45
|
-
extractEl: (_: any) => any;
|
|
46
|
-
}) => any;
|
|
47
|
-
}>;
|
|
48
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
49
|
-
new (): {
|
|
50
|
-
$slots: S;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Transition>
|
|
3
|
-
<div
|
|
4
|
-
v-if="!hide"
|
|
5
|
-
:id="id ?? fallbackId"
|
|
6
|
-
:class="twMerge(`
|
|
7
|
-
progress-bar
|
|
8
|
-
w-[200px]
|
|
9
|
-
whitespace-nowrap
|
|
10
|
-
overflow-x-scroll
|
|
11
|
-
scrollbar-hidden
|
|
12
|
-
rounded-sm
|
|
13
|
-
flex
|
|
14
|
-
text-fg
|
|
15
|
-
relative
|
|
16
|
-
before:content-['']
|
|
17
|
-
text-sm
|
|
18
|
-
min-w-[50px]
|
|
19
|
-
after:shadow-inner
|
|
20
|
-
after:shadow-black/50
|
|
21
|
-
after:content-['']
|
|
22
|
-
after:absolute
|
|
23
|
-
after:inset-0
|
|
24
|
-
after:pointer-events-none
|
|
25
|
-
after:z-2
|
|
26
|
-
after:transition-all
|
|
27
|
-
before:shadow-inner
|
|
28
|
-
before:shadow-black/50
|
|
29
|
-
before:rounded-sm
|
|
30
|
-
before:bg-bars-gradient
|
|
31
|
-
before:animate-slideBgInf
|
|
32
|
-
before:[background-size:15px_15px]
|
|
33
|
-
before:absolute
|
|
34
|
-
before:w-[var(--progress)]
|
|
35
|
-
before:top-0 before:bottom-0 before:left-0
|
|
36
|
-
before:transition-all
|
|
37
|
-
before:z-1
|
|
38
|
-
before:duration-500
|
|
39
|
-
`, psuedoHide && `
|
|
40
|
-
after:opacity-0
|
|
41
|
-
before:opacity-0
|
|
42
|
-
`, $attrs.class)"
|
|
43
|
-
:data-value="progress"
|
|
44
|
-
:title="label"
|
|
45
|
-
role="progressbar"
|
|
46
|
-
:aria-valuenow="clampVal(progress, clamp[0] ?? 0, clamp[1] ?? 100)"
|
|
47
|
-
:aria-valuemin="clamp[0] ?? 0"
|
|
48
|
-
:aria-valuemax="clamp[1] ?? 100"
|
|
49
|
-
v-bind="{ ...$attrs, class: void 0 }"
|
|
50
|
-
:style="`--progress: ${clampVal(progress, clamp[0] ?? 0, clamp[1] ?? 100)}%;`"
|
|
51
|
-
>
|
|
52
|
-
<div class="procgress-bar--label-wrapper relative flex-1">
|
|
53
|
-
<span class="before:content-vertical-holder"/>
|
|
54
|
-
<Transition>
|
|
55
|
-
<slot>
|
|
56
|
-
<label
|
|
57
|
-
v-if="!psuedoHide"
|
|
58
|
-
:for="id"
|
|
59
|
-
class="
|
|
60
|
-
text-bg
|
|
61
|
-
absolute inset-0 flex
|
|
62
|
-
justify-center
|
|
63
|
-
"
|
|
64
|
-
>
|
|
65
|
-
<div class="truncate">
|
|
66
|
-
{{ label ?? "" }}
|
|
67
|
-
</div>
|
|
68
|
-
</label>
|
|
69
|
-
</slot>
|
|
70
|
-
</Transition>
|
|
71
|
-
|
|
72
|
-
<Transition>
|
|
73
|
-
<slot>
|
|
74
|
-
<label
|
|
75
|
-
v-if="!psuedoHide"
|
|
76
|
-
class="
|
|
77
|
-
progress-bar--label
|
|
78
|
-
contrast-label
|
|
79
|
-
pointer-events-none
|
|
80
|
-
absolute
|
|
81
|
-
inset-0
|
|
82
|
-
flex justify-center transition-all
|
|
83
|
-
duration-500
|
|
84
|
-
[clip-path:inset(0_0_0_var(--progress))]
|
|
85
|
-
dark:hidden
|
|
86
|
-
"
|
|
87
|
-
>
|
|
88
|
-
<div class="truncate">
|
|
89
|
-
{{ label ?? "" }}
|
|
90
|
-
</div>
|
|
91
|
-
</label>
|
|
92
|
-
</slot>
|
|
93
|
-
</Transition>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
</Transition>
|
|
97
|
-
</template>
|
|
98
|
-
|
|
99
|
-
<script setup>
|
|
100
|
-
import { ref, watch } from "vue";
|
|
101
|
-
import { twMerge } from "../../utils/twMerge.js";
|
|
102
|
-
import { getFallbackId } from "../shared/props.js";
|
|
103
|
-
const clampVal = (n, min, max) => Math.min(Math.max(n, min), max);
|
|
104
|
-
defineOptions({
|
|
105
|
-
name: "LibProgressBar",
|
|
106
|
-
inheritAttrs: false
|
|
107
|
-
});
|
|
108
|
-
const fallbackId = getFallbackId();
|
|
109
|
-
const props = defineProps({
|
|
110
|
-
id: { type: String, required: false },
|
|
111
|
-
disabled: { type: Boolean, required: false, default: false },
|
|
112
|
-
readonly: { type: Boolean, required: false, default: false },
|
|
113
|
-
border: { type: Boolean, required: false, default: true },
|
|
114
|
-
unstyle: { type: Boolean, required: false, default: false },
|
|
115
|
-
label: { type: String, required: false },
|
|
116
|
-
progress: { type: Number, required: true },
|
|
117
|
-
autohideOnComplete: { type: Number, required: false, default: -1 },
|
|
118
|
-
keepSpaceWhenHidden: { type: Boolean, required: false, default: false },
|
|
119
|
-
clamp: { type: Array, required: false, default: () => [0, 100] }
|
|
120
|
-
});
|
|
121
|
-
const hide = ref(false);
|
|
122
|
-
const psuedoHide = ref(false);
|
|
123
|
-
let timeout;
|
|
124
|
-
let type;
|
|
125
|
-
if (props.autohideOnComplete > -1 && (props.progress >= 100 || props.progress < 0)) {
|
|
126
|
-
if (props.keepSpaceWhenHidden) {
|
|
127
|
-
hide.value = false;
|
|
128
|
-
psuedoHide.value = true;
|
|
129
|
-
} else {
|
|
130
|
-
hide.value = true;
|
|
131
|
-
psuedoHide.value = false;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
watch([
|
|
135
|
-
() => props.progress,
|
|
136
|
-
() => props.keepSpaceWhenHidden,
|
|
137
|
-
() => props.autohideOnComplete
|
|
138
|
-
], () => {
|
|
139
|
-
if (props.autohideOnComplete > -1 && (props.progress >= 100 || props.progress < 0)) {
|
|
140
|
-
if (props.keepSpaceWhenHidden) {
|
|
141
|
-
if (type === 1) return;
|
|
142
|
-
clearTimeout(timeout);
|
|
143
|
-
type = 1;
|
|
144
|
-
timeout = setTimeout(() => {
|
|
145
|
-
type = 0;
|
|
146
|
-
hide.value = false;
|
|
147
|
-
psuedoHide.value = true;
|
|
148
|
-
}, props.autohideOnComplete);
|
|
149
|
-
} else {
|
|
150
|
-
if (type === 2) return;
|
|
151
|
-
clearTimeout(timeout);
|
|
152
|
-
type = 2;
|
|
153
|
-
timeout = setTimeout(() => {
|
|
154
|
-
type = 0;
|
|
155
|
-
hide.value = true;
|
|
156
|
-
psuedoHide.value = false;
|
|
157
|
-
}, props.autohideOnComplete);
|
|
158
|
-
}
|
|
159
|
-
} else {
|
|
160
|
-
clearTimeout(timeout);
|
|
161
|
-
hide.value = false;
|
|
162
|
-
psuedoHide.value = false;
|
|
163
|
-
}
|
|
164
|
-
}, { immediate: false });
|
|
165
|
-
</script>
|
|
166
|
-
|
|
167
|
-
<script>
|
|
168
|
-
|
|
169
|
-
</script>
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { type HTMLAttributes } from "vue";
|
|
2
|
-
import { type BaseInteractiveProps, type LabelProps, type LinkableByIdProps, type SuggestionsEmits, type SuggestionsProps, type WrapperProps } from "../shared/props.js";
|
|
3
|
-
type WrapperTypes = Partial<WrapperProps<"item", HTMLAttributes, {
|
|
4
|
-
/** Tailwind classes. */
|
|
5
|
-
class?: string;
|
|
6
|
-
}>>;
|
|
7
|
-
type RealProps = LinkableByIdProps & LabelProps & BaseInteractiveProps & {
|
|
8
|
-
/** Return true to prevent the keydown event from being handled. */
|
|
9
|
-
filterKeydown?: (e: KeyboardEvent) => boolean;
|
|
10
|
-
/** Return true to prevent the blur event from being handled. */
|
|
11
|
-
filterBlur?: (e: MouseEvent) => boolean;
|
|
12
|
-
/** Return true to prevent the focus event from being handled. */
|
|
13
|
-
filterFocus?: (e: FocusEvent) => boolean;
|
|
14
|
-
};
|
|
15
|
-
interface Props extends
|
|
16
|
-
/** @vue-ignore */
|
|
17
|
-
Partial<Omit<HTMLAttributes, "class" | "onSubmit"> & {
|
|
18
|
-
/** Tailwind classes. */
|
|
19
|
-
class?: string;
|
|
20
|
-
}>,
|
|
21
|
-
/** @vue-ignore */
|
|
22
|
-
WrapperTypes, RealProps {
|
|
23
|
-
}
|
|
24
|
-
declare const _default: typeof __VLS_export;
|
|
25
|
-
export default _default;
|
|
26
|
-
declare const __VLS_export: <TSuggestion extends string | object, TValue extends string | string[]>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
27
|
-
props: import("vue").PublicProps & __VLS_PrettifyLocal<(Props & SuggestionsProps<TSuggestion> & {
|
|
28
|
-
/**
|
|
29
|
-
* The final valid value. This is *not* the value you want to share with the input. If `restrictToSuggestions` is true this will not update on any invalid values that `inputValue` might be set to.
|
|
30
|
-
*
|
|
31
|
-
* If suggestions are objects, this will be the string returned by the `suggestionLabel` prop.
|
|
32
|
-
*/
|
|
33
|
-
modelValue: TValue;
|
|
34
|
-
/**
|
|
35
|
-
* If the element is bound to an input, this is the value that the input should be sharing.
|
|
36
|
-
*
|
|
37
|
-
* It allows the component to read even invalid output, and also to reset that invalid output when either modelValue is set to a new value, or when the component is closed via cancel.
|
|
38
|
-
*/
|
|
39
|
-
inputValue?: string;
|
|
40
|
-
open?: boolean;
|
|
41
|
-
}) & {
|
|
42
|
-
onSubmit?: ((val: string, suggestion?: any, wasRemoved?: boolean | undefined) => any) | undefined;
|
|
43
|
-
"onUpdate:isOpen"?: ((val: boolean) => any) | undefined;
|
|
44
|
-
"onUpdate:activeSuggestion"?: ((val: number) => any) | undefined;
|
|
45
|
-
"onUpdate:modelValue"?: ((value: TValue) => any) | undefined;
|
|
46
|
-
"onUpdate:inputValue"?: ((value: string) => any) | undefined;
|
|
47
|
-
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
48
|
-
}> & (typeof globalThis extends {
|
|
49
|
-
__VLS_PROPS_FALLBACK: infer P;
|
|
50
|
-
} ? P : {});
|
|
51
|
-
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
52
|
-
suggestions: {
|
|
53
|
-
list: any[] | undefined;
|
|
54
|
-
filtered: any[] | undefined;
|
|
55
|
-
active: number;
|
|
56
|
-
available: boolean;
|
|
57
|
-
moreThanOneAvailable: boolean;
|
|
58
|
-
hasExactlyMatching: TSuggestion | undefined;
|
|
59
|
-
hasValidSuggestion: boolean;
|
|
60
|
-
openable: boolean | undefined;
|
|
61
|
-
getLabel: (item: any) => string;
|
|
62
|
-
$open: boolean;
|
|
63
|
-
open: () => void;
|
|
64
|
-
close: () => void;
|
|
65
|
-
enterSelected: (doClose?: boolean) => void;
|
|
66
|
-
enterIndex: (num: number, doClose?: boolean) => void;
|
|
67
|
-
toggle: () => void;
|
|
68
|
-
cancel: () => void;
|
|
69
|
-
select: (num: number) => void;
|
|
70
|
-
prev: () => void;
|
|
71
|
-
next: () => void;
|
|
72
|
-
first: () => void;
|
|
73
|
-
last: () => void;
|
|
74
|
-
};
|
|
75
|
-
el: import("vue").Ref<HTMLElement | null, HTMLElement | null>;
|
|
76
|
-
/** A simple keydown handler that can be passed to an input to control the component while still focused inside it. */
|
|
77
|
-
inputKeydownHandler: (e: KeyboardEvent) => void;
|
|
78
|
-
/** A blur handler for the input that controls the component. This also takes care of making clicking on a suggestion work, since otherwise if canOpen is set to false in the blur handler, no click event will fire. */
|
|
79
|
-
inputBlurHandler: (e: MouseEvent) => void;
|
|
80
|
-
/** A focus handler for the input that controls the component. */
|
|
81
|
-
inputFocusHandler: (e: FocusEvent) => void;
|
|
82
|
-
}>) => void;
|
|
83
|
-
attrs: any;
|
|
84
|
-
slots: {
|
|
85
|
-
item?: (props: {
|
|
86
|
-
item: any;
|
|
87
|
-
index: number;
|
|
88
|
-
isSelected: boolean;
|
|
89
|
-
}) => any;
|
|
90
|
-
};
|
|
91
|
-
emit: SuggestionsEmits<false> & (((event: "update:modelValue", value: TValue) => void) & ((event: "update:inputValue", value: string) => void) & ((event: "update:open", value: boolean) => void));
|
|
92
|
-
}>) => import("vue").VNode & {
|
|
93
|
-
__ctx?: Awaited<typeof __VLS_setup>;
|
|
94
|
-
};
|
|
95
|
-
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
96
|
-
[K in keyof T]: T[K];
|
|
97
|
-
} : {
|
|
98
|
-
[K in keyof T as K]: T[K];
|
|
99
|
-
}) & {};
|