@rotki/ui-library 2.21.0 → 2.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordions/accordion/RuiAccordion.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/accordions/accordion/RuiAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/accordions/accordions/RuiAccordions.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/accordions/accordions/RuiAccordions.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/alerts/RuiAlert.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/alerts/RuiAlert.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/avatars/RuiAvatar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/avatars/RuiAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/avatars/RuiAvatarGroup.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/avatars/RuiAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/avatars/avatar-props.js +1 -1
- package/dist/components/avatars/avatar-props.js.map +1 -1
- package/dist/components/avatars/use-avatar-group.js.map +1 -1
- package/dist/components/buttons/button/RuiButton.js.map +1 -1
- package/dist/components/buttons/button/RuiButton.vue.d.ts +2 -2
- package/dist/components/buttons/button/RuiButton.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/buttons/button/RuiButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/buttons/button/button-props.js.map +1 -1
- package/dist/components/buttons/button/button-styles.js.map +1 -1
- package/dist/components/buttons/button-group/RuiButtonGroup.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/buttons/button-group/RuiButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/calendar/RuiCalendar.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/calendar/RuiCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/calendar/RuiCalendarGrid.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/calendar/RuiCalendarGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/calendar/RuiCalendarHeader.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/calendar/RuiCalendarHeader.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/calendar/RuiCalendarMenu.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/calendar/RuiCalendarMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/calendar/state.js.map +1 -1
- package/dist/components/cards/RuiCard.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/cards/RuiCard.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/cards/RuiCardHeader.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/cards/RuiCardHeader.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/chips/RuiChip.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/chips/RuiChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/chips/chip-props.js.map +1 -1
- package/dist/components/color-picker/RuiColorBoard.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/color-picker/RuiColorBoard.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/color-picker/RuiColorDisplay.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/color-picker/RuiColorDisplay.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/color-picker/RuiColorHue.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/color-picker/RuiColorHue.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/color-picker/RuiColorInput.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/color-picker/RuiColorInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/color-picker/RuiColorPicker.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/color-picker/RuiColorPicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/color-picker/utils.js.map +1 -1
- package/dist/components/date-time-picker/RuiDateTimePicker.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/date-time-picker/RuiDateTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/date-time-picker/RuiDateTimePickerMenu.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/date-time-picker/RuiDateTimePickerMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/date-time-picker/RuiTimezoneSelect.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/date-time-picker/RuiTimezoneSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker-styles.js.map +1 -1
- package/dist/components/date-time-picker/dayjs-setup.js.map +1 -1
- package/dist/components/date-time-picker/segment-config.js.map +1 -1
- package/dist/components/date-time-picker/segment-utils.js.map +1 -1
- package/dist/components/date-time-picker/timezones.js.map +1 -1
- package/dist/components/date-time-picker/types.js +1 -1
- package/dist/components/date-time-picker/types.js.map +1 -1
- package/dist/components/date-time-picker/use-date-time-selection.js +2 -2
- package/dist/components/date-time-picker/use-date-time-selection.js.map +1 -1
- package/dist/components/date-time-picker/use-input-handler.js.map +1 -1
- package/dist/components/date-time-picker/use-keyboard-handler.js.map +1 -1
- package/dist/components/date-time-picker/utils.js.map +1 -1
- package/dist/components/divider/RuiDivider.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/divider/RuiDivider.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/auto-complete/RuiAutoComplete.js.map +1 -1
- package/dist/components/forms/auto-complete/RuiAutoComplete.vue.d.ts +14 -1
- package/dist/components/forms/auto-complete/RuiAutoComplete.vue_vue_type_script_setup_true_lang.js +15 -5
- package/dist/components/forms/auto-complete/RuiAutoComplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/auto-complete/auto-complete-styles.js.map +1 -1
- package/dist/components/forms/category-picker/RuiCategoryPicker.js +7 -0
- package/dist/components/forms/category-picker/RuiCategoryPicker.js.map +1 -0
- package/dist/components/forms/category-picker/RuiCategoryPicker.vue.d.ts +134 -0
- package/dist/components/forms/category-picker/RuiCategoryPicker.vue_vue_type_script_setup_true_lang.js +567 -0
- package/dist/components/forms/category-picker/RuiCategoryPicker.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/forms/category-picker/category-picker-styles.d.ts +432 -0
- package/dist/components/forms/category-picker/category-picker-styles.js +59 -0
- package/dist/components/forms/category-picker/category-picker-styles.js.map +1 -0
- package/dist/components/forms/check-control-styles.js.map +1 -1
- package/dist/components/forms/checkbox/RuiCheckbox.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/forms/checkbox/RuiCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/checkbox/checkbox-group/RuiCheckboxGroup.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/forms/checkbox/checkbox-group/RuiCheckboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/checkbox/checkbox-group/context.js.map +1 -1
- package/dist/components/forms/file-upload/RuiFileUpload.js.map +1 -1
- package/dist/components/forms/file-upload/RuiFileUpload.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/forms/file-upload/RuiFileUpload.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/radio-button/radio/RuiRadio.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/forms/radio-button/radio/RuiRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/radio-button/radio-group/RuiRadioGroup.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/forms/radio-button/radio-group/RuiRadioGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/revealable-text-field/RuiRevealableTextField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/forms/revealable-text-field/RuiRevealableTextField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/select/RuiMenuSelect.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/forms/select/RuiMenuSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/select/RuiSimpleSelect.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/forms/select/RuiSimpleSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/select/menu-select-styles.js.map +1 -1
- package/dist/components/forms/slider/RuiSlider.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/forms/slider/RuiSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/slider/slider-styles.js.map +1 -1
- package/dist/components/forms/switch/RuiSwitch.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/forms/switch/RuiSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/text-area/RuiTextArea.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/forms/text-area/RuiTextArea.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/text-area/text-area-styles.js.map +1 -1
- package/dist/components/forms/text-field/RuiTextField.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/forms/text-field/RuiTextField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/text-field/text-field-styles.js.map +1 -1
- package/dist/components/forms/text-input-styles.js.map +1 -1
- package/dist/components/helpers/RuiFormTextDetail.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/helpers/RuiFormTextDetail.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/icons/RuiIcon.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/icons/RuiIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.js +3 -2
- package/dist/components/loaders/RuiSkeletonBase.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/loaders/RuiSkeletonBase.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/loaders/RuiSkeletonLoader.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/loaders/RuiSkeletonLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/loaders/skeleton-type.js.map +1 -1
- package/dist/components/logos/RuiLogo.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/logos/RuiLogo.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/logos/use-logo-sources.js.map +1 -1
- package/dist/components/overlays/badge/RuiBadge.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/overlays/badge/RuiBadge.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/overlays/badge/badge-props.js.map +1 -1
- package/dist/components/overlays/bottom-sheet/RuiBottomSheet.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/overlays/bottom-sheet/RuiBottomSheet.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/overlays/dialog/RuiDialog.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/overlays/dialog/RuiDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/overlays/menu/RuiMenu.js.map +1 -1
- package/dist/components/overlays/menu/RuiMenu.vue.d.ts +2 -0
- package/dist/components/overlays/menu/RuiMenu.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/overlays/menu/RuiMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/overlays/navigation-drawer/RuiNavigationDrawer.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/overlays/navigation-drawer/RuiNavigationDrawer.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/overlays/notification/RuiNotification.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/overlays/notification/RuiNotification.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/overlays/tooltip/RuiTooltip.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/overlays/tooltip/RuiTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/overlays/tooltip/tooltip-styles.js.map +1 -1
- package/dist/components/progress/RuiProgress.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/progress/RuiProgress.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/progress/progress-props.js.map +1 -1
- package/dist/components/steppers/RuiFooterStepper.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/steppers/RuiFooterStepper.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/steppers/RuiStepper.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/steppers/RuiStepper.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/steppers/RuiStepperCustomIcon.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/steppers/RuiStepperCustomIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/steppers/RuiStepperIcon.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/steppers/RuiStepperIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/steppers/footer-stepper-variant.js.map +1 -1
- package/dist/components/tables/RuiDataTable.js.map +1 -1
- package/dist/components/tables/RuiDataTable.vue.d.ts +23 -2
- package/dist/components/tables/RuiDataTable.vue_vue_type_script_setup_true_lang.js +186 -217
- package/dist/components/tables/RuiDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tables/RuiExpandButton.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/tables/RuiExpandButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tables/RuiTableEmptyState.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/tables/RuiTableEmptyState.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tables/RuiTableHead.js.map +1 -1
- package/dist/components/tables/RuiTableHead.vue.d.ts +11 -1
- package/dist/components/tables/RuiTableHead.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/components/tables/RuiTableHead.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tables/RuiTablePagination.js.map +1 -1
- package/dist/components/tables/RuiTablePagination.vue.d.ts +5 -0
- package/dist/components/tables/RuiTablePagination.vue_vue_type_script_setup_true_lang.js +24 -8
- package/dist/components/tables/RuiTablePagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tables/data-table/RuiDataTableBody.js +7 -0
- package/dist/components/tables/data-table/RuiDataTableBody.js.map +1 -0
- package/dist/components/tables/data-table/RuiDataTableBody.vue.d.ts +55 -0
- package/dist/components/tables/data-table/RuiDataTableBody.vue_vue_type_script_setup_true_lang.js +78 -0
- package/dist/components/tables/data-table/RuiDataTableBody.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/tables/data-table/RuiDataTableCell.js +7 -0
- package/dist/components/tables/data-table/RuiDataTableCell.js.map +1 -0
- package/dist/components/tables/data-table/RuiDataTableCell.vue.d.ts +30 -0
- package/dist/components/tables/data-table/RuiDataTableCell.vue_vue_type_script_setup_true_lang.js +54 -0
- package/dist/components/tables/data-table/RuiDataTableCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/tables/data-table/RuiDataTableEmptyRow.js +7 -0
- package/dist/components/tables/data-table/RuiDataTableEmptyRow.js.map +1 -0
- package/dist/components/tables/data-table/RuiDataTableEmptyRow.vue.d.ts +19 -0
- package/dist/components/tables/data-table/RuiDataTableEmptyRow.vue_vue_type_script_setup_true_lang.js +43 -0
- package/dist/components/tables/data-table/RuiDataTableEmptyRow.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/tables/data-table/RuiDataTableExpandedRow.js +7 -0
- package/dist/components/tables/data-table/RuiDataTableExpandedRow.js.map +1 -0
- package/dist/components/tables/data-table/RuiDataTableExpandedRow.vue.d.ts +26 -0
- package/dist/components/tables/data-table/RuiDataTableExpandedRow.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/components/tables/data-table/RuiDataTableExpandedRow.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/tables/data-table/RuiDataTableGroupRow.js +7 -0
- package/dist/components/tables/data-table/RuiDataTableGroupRow.js.map +1 -0
- package/dist/components/tables/data-table/RuiDataTableGroupRow.vue.d.ts +32 -0
- package/dist/components/tables/data-table/RuiDataTableGroupRow.vue_vue_type_script_setup_true_lang.js +85 -0
- package/dist/components/tables/data-table/RuiDataTableGroupRow.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/tables/data-table/RuiDataTableLoadingRow.js +7 -0
- package/dist/components/tables/data-table/RuiDataTableLoadingRow.js.map +1 -0
- package/dist/components/tables/data-table/RuiDataTableLoadingRow.vue.d.ts +3 -0
- package/dist/components/tables/data-table/RuiDataTableLoadingRow.vue_vue_type_script_setup_true_lang.js +26 -0
- package/dist/components/tables/data-table/RuiDataTableLoadingRow.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/tables/data-table/RuiDataTableMobileSort.js +7 -0
- package/dist/components/tables/data-table/RuiDataTableMobileSort.js.map +1 -0
- package/dist/components/tables/data-table/RuiDataTableMobileSort.vue.d.ts +33 -0
- package/dist/components/tables/data-table/RuiDataTableMobileSort.vue_vue_type_script_setup_true_lang.js +101 -0
- package/dist/components/tables/data-table/RuiDataTableMobileSort.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/tables/data-table/RuiDataTableRow.js +7 -0
- package/dist/components/tables/data-table/RuiDataTableRow.js.map +1 -0
- package/dist/components/tables/data-table/RuiDataTableRow.vue.d.ts +31 -0
- package/dist/components/tables/data-table/RuiDataTableRow.vue_vue_type_script_setup_true_lang.js +142 -0
- package/dist/components/tables/data-table/RuiDataTableRow.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/tables/data-table/context.d.ts +73 -0
- package/dist/components/tables/data-table/context.js +100 -0
- package/dist/components/tables/data-table/context.js.map +1 -0
- package/dist/components/tables/data-table-styles.d.ts +30 -1
- package/dist/components/tables/data-table-styles.js +9 -2
- package/dist/components/tables/data-table-styles.js.map +1 -1
- package/dist/components/tables/table-props.d.ts +5 -0
- package/dist/components/tables/table-props.js +5 -1
- package/dist/components/tables/table-props.js.map +1 -1
- package/dist/components/tables/use-pagination-navigation.js.map +1 -1
- package/dist/components/tabs/tab/RuiTab.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/tabs/tab/RuiTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tabs/tab/use-tab-link.js.map +1 -1
- package/dist/components/tabs/tab-item/RuiTabItem.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/tabs/tab-item/RuiTabItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tabs/tab-items/RuiTabItems.js.map +1 -1
- package/dist/components/tabs/tab-items/RuiTabItems.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/tabs/tab-items/RuiTabItems.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tabs/tab-props.js.map +1 -1
- package/dist/components/tabs/tabs/RuiTabs.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/tabs/tabs/RuiTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tabs/tabs/use-tab-routing.js +1 -1
- package/dist/components/tabs/tabs/use-tab-routing.js.map +1 -1
- package/dist/components/tabs/tabs/use-tab-scroll.js.map +1 -1
- package/dist/components/time-picker/RuiTimePicker.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/time-picker/RuiTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/time-picker/time-picker-styles.js.map +1 -1
- package/dist/composables/breakpoint.js.map +1 -1
- package/dist/composables/defaults/table.d.ts +12 -0
- package/dist/composables/defaults/table.js.map +1 -1
- package/dist/composables/dropdown-menu.js.map +1 -1
- package/dist/composables/floating.d.ts +11 -0
- package/dist/composables/floating.js +21 -2
- package/dist/composables/floating.js.map +1 -1
- package/dist/composables/forms/auto-complete/focus.js.map +1 -1
- package/dist/composables/forms/auto-complete/index.js +5 -4
- package/dist/composables/forms/auto-complete/keyboard-navigation.js.map +1 -1
- package/dist/composables/forms/auto-complete/search.d.ts +6 -1
- package/dist/composables/forms/auto-complete/search.js +12 -1
- package/dist/composables/forms/auto-complete/search.js.map +1 -1
- package/dist/composables/forms/auto-complete/value.js.map +1 -1
- package/dist/composables/forms/category-picker/use-category-picker.d.ts +76 -0
- package/dist/composables/forms/category-picker/use-category-picker.js +141 -0
- package/dist/composables/forms/category-picker/use-category-picker.js.map +1 -0
- package/dist/composables/forms/use-prepend-append-width.js.map +1 -1
- package/dist/composables/icons.js.map +1 -1
- package/dist/composables/popper.js.map +1 -1
- package/dist/composables/sticky-header.js.map +1 -1
- package/dist/composables/tables/data-table/columns.d.ts +7 -1
- package/dist/composables/tables/data-table/columns.js +18 -10
- package/dist/composables/tables/data-table/columns.js.map +1 -1
- package/dist/composables/tables/data-table/expansion.js.map +1 -1
- package/dist/composables/tables/data-table/grouping.d.ts +4 -6
- package/dist/composables/tables/data-table/grouping.js +38 -24
- package/dist/composables/tables/data-table/grouping.js.map +1 -1
- package/dist/composables/tables/data-table/pagination.d.ts +4 -4
- package/dist/composables/tables/data-table/pagination.js +63 -21
- package/dist/composables/tables/data-table/pagination.js.map +1 -1
- package/dist/composables/tables/data-table/selection.js +16 -6
- package/dist/composables/tables/data-table/selection.js.map +1 -1
- package/dist/composables/tables/data-table/sort.d.ts +4 -3
- package/dist/composables/tables/data-table/sort.js +78 -40
- package/dist/composables/tables/data-table/sort.js.map +1 -1
- package/dist/composables/tables/data-table/types.d.ts +3 -1
- package/dist/composables/tables/data-table/types.js +6 -2
- package/dist/composables/tables/data-table/types.js.map +1 -1
- package/dist/composables/theme.js.map +1 -1
- package/dist/composables/timeout-manager.js.map +1 -1
- package/dist/composables/use-rui-i18n.js.map +1 -1
- package/dist/consts/colors.js.map +1 -1
- package/dist/consts/time-accuracy.js.map +1 -1
- package/dist/i18n/keys.js.map +1 -1
- package/dist/icons/icons_1.d.ts +12 -12
- package/dist/icons/icons_1.js +140 -157
- package/dist/icons/icons_1.js.map +1 -1
- package/dist/icons/icons_2.d.ts +13 -13
- package/dist/icons/icons_2.js +128 -149
- package/dist/icons/icons_2.js.map +1 -1
- package/dist/icons/icons_3.d.ts +18 -18
- package/dist/icons/icons_3.js +244 -282
- package/dist/icons/icons_3.js.map +1 -1
- package/dist/icons/icons_4.d.ts +251 -6
- package/dist/icons/icons_4.js +3016 -75
- package/dist/icons/icons_4.js.map +1 -1
- package/dist/icons/icons_5.d.ts +20 -0
- package/dist/icons/icons_5.js +221 -0
- package/dist/icons/icons_5.js.map +1 -0
- package/dist/icons/index.d.ts +2 -1
- package/dist/icons/index.js +297 -32
- package/dist/icons/index.js.map +1 -1
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/library-icons.json +1 -0
- package/dist/style.css +157 -0
- package/dist/theme/index.js.map +1 -1
- package/dist/types/stepper.js.map +1 -1
- package/dist/types/theme.js.map +1 -1
- package/dist/utils/assert.js.map +1 -1
- package/dist/utils/blockie.js.map +1 -1
- package/dist/utils/form-text-detail.js.map +1 -1
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/is-equal.js.map +1 -1
- package/dist/utils/tv.js.map +1 -1
- package/dist/vite-plugin/index.js +6 -5
- package/dist/vite-plugin/index.js.map +1 -1
- package/dist/vite-plugin/scanner.d.ts +1 -1
- package/dist/vite-plugin/scanner.js +10 -7
- package/dist/vite-plugin/scanner.js.map +1 -1
- package/dist/vite-plugin/types.d.ts +9 -0
- package/dist/web-types.json +2042 -1108
- package/package.json +35 -35
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { getAlignClass } from '../../components/tables/table-props.js';
|
|
2
1
|
export declare const dataTableStyles: import("tailwind-variants").TVReturnType<{
|
|
3
2
|
outlined: {
|
|
4
3
|
true: {
|
|
@@ -40,6 +39,16 @@ export declare const dataTableStyles: import("tailwind-variants").TVReturnType<{
|
|
|
40
39
|
tr: string;
|
|
41
40
|
};
|
|
42
41
|
};
|
|
42
|
+
mobile: {
|
|
43
|
+
true: {
|
|
44
|
+
wrapper: string;
|
|
45
|
+
scroller: string;
|
|
46
|
+
table: string;
|
|
47
|
+
tbody: string;
|
|
48
|
+
tr: string;
|
|
49
|
+
td: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
43
52
|
}, {
|
|
44
53
|
wrapper: string;
|
|
45
54
|
scroller: string;
|
|
@@ -91,6 +100,16 @@ export declare const dataTableStyles: import("tailwind-variants").TVReturnType<{
|
|
|
91
100
|
tr: string;
|
|
92
101
|
};
|
|
93
102
|
};
|
|
103
|
+
mobile: {
|
|
104
|
+
true: {
|
|
105
|
+
wrapper: string;
|
|
106
|
+
scroller: string;
|
|
107
|
+
table: string;
|
|
108
|
+
tbody: string;
|
|
109
|
+
tr: string;
|
|
110
|
+
td: string;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
94
113
|
}, {
|
|
95
114
|
wrapper: string;
|
|
96
115
|
scroller: string;
|
|
@@ -142,6 +161,16 @@ export declare const dataTableStyles: import("tailwind-variants").TVReturnType<{
|
|
|
142
161
|
tr: string;
|
|
143
162
|
};
|
|
144
163
|
};
|
|
164
|
+
mobile: {
|
|
165
|
+
true: {
|
|
166
|
+
wrapper: string;
|
|
167
|
+
scroller: string;
|
|
168
|
+
table: string;
|
|
169
|
+
tbody: string;
|
|
170
|
+
tr: string;
|
|
171
|
+
td: string;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
145
174
|
}, {
|
|
146
175
|
wrapper: string;
|
|
147
176
|
scroller: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { tv } from "../../utils/tv.js";
|
|
2
|
-
import "./table-props.js";
|
|
3
2
|
//#region src/components/tables/data-table-styles.ts
|
|
4
3
|
var dataTableStyles = tv({
|
|
5
4
|
slots: {
|
|
@@ -27,7 +26,15 @@ var dataTableStyles = tv({
|
|
|
27
26
|
empty: { tr: "hover:bg-transparent" },
|
|
28
27
|
expandable: { tr: "bg-[#f9fafb] hover:bg-[#f9fafb] dark:bg-[#121212] dark:hover:bg-[#121212]" },
|
|
29
28
|
group: { tr: "bg-black/[0.02] dark:bg-white/[0.02]" }
|
|
30
|
-
}
|
|
29
|
+
},
|
|
30
|
+
mobile: { true: {
|
|
31
|
+
wrapper: "divide-y-0 border-0 rounded-none overflow-visible",
|
|
32
|
+
scroller: "overflow-visible [clip-path:none]",
|
|
33
|
+
table: "block min-w-0 max-w-none w-full whitespace-normal divide-y-0 border-0",
|
|
34
|
+
tbody: "block divide-y-0",
|
|
35
|
+
tr: "block",
|
|
36
|
+
td: "block px-4 py-2"
|
|
37
|
+
} }
|
|
31
38
|
}
|
|
32
39
|
});
|
|
33
40
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table-styles.js","names":[],"sources":["../../../src/components/tables/data-table-styles.ts"],"sourcesContent":["import { tv } from '@/utils/tv';\n\nexport
|
|
1
|
+
{"version":3,"file":"data-table-styles.js","names":[],"sources":["../../../src/components/tables/data-table-styles.ts"],"sourcesContent":["import { tv } from '@/utils/tv';\n\nexport const dataTableStyles = tv({\n slots: {\n wrapper: 'relative divide-y divide-black/[0.12] dark:divide-white/[0.12] overflow-hidden',\n scroller: 'overflow-x-auto overflow-y-hidden [clip-path:inset(0_0_0_0)]',\n table: 'min-w-full table-fixed divide-y divide-black/[0.12] dark:divide-white/[0.12] whitespace-nowrap mx-auto my-0 max-w-fit relative border-black/[0.12] dark:border-white/[0.12]',\n tbody: 'divide-y divide-black/[0.12] dark:divide-white/[0.12]',\n tr: 'hover:bg-black/[0.04] dark:hover:bg-white/[0.04]',\n td: 'p-4 text-rui-text text-body-2 [text-wrap:initial]',\n checkbox: 'px-2 w-[3.625rem] max-w-[3.625rem] [&_label]:ml-0',\n tbodyLoader: 'text-center',\n tbodyLoaderContent: 'flex items-center justify-center min-h-56 py-8',\n },\n variants: {\n outlined: {\n true: { wrapper: 'border border-black/[0.12] dark:border-white/[0.12]' },\n },\n rounded: {\n sm: { wrapper: 'rounded-[.25rem]' },\n md: { wrapper: 'rounded-[.75rem]' },\n lg: { wrapper: 'rounded-[1rem]' },\n },\n dense: {\n true: { td: 'py-[0.38rem]' },\n },\n striped: {\n true: { tbody: 'even:[&>tr]:bg-rui-grey-50 dark:even:[&>tr]:bg-rui-grey-900' },\n },\n rowVariant: {\n selected: { tr: 'bg-rui-primary/[0.08] dark:bg-rui-dark-primary/[0.08]' },\n empty: { tr: 'hover:bg-transparent' },\n expandable: { tr: 'bg-[#f9fafb] hover:bg-[#f9fafb] dark:bg-[#121212] dark:hover:bg-[#121212]' },\n group: { tr: 'bg-black/[0.02] dark:bg-white/[0.02]' },\n },\n mobile: {\n true: {\n wrapper: 'divide-y-0 border-0 rounded-none overflow-visible',\n scroller: 'overflow-visible [clip-path:none]',\n table: 'block min-w-0 max-w-none w-full whitespace-normal divide-y-0 border-0',\n tbody: 'block divide-y-0',\n tr: 'block',\n td: 'block px-4 py-2',\n },\n },\n },\n});\n"],"mappings":";;AAEA,IAAa,kBAAkB,GAAG;CAChC,OAAO;EACL,SAAS;EACT,UAAU;EACV,OAAO;EACP,OAAO;EACP,IAAI;EACJ,IAAI;EACJ,UAAU;EACV,aAAa;EACb,oBAAoB;CACtB;CACA,UAAU;EACR,UAAU,EACR,MAAM,EAAE,SAAS,sDAAsD,EACzE;EACA,SAAS;GACP,IAAI,EAAE,SAAS,mBAAmB;GAClC,IAAI,EAAE,SAAS,mBAAmB;GAClC,IAAI,EAAE,SAAS,iBAAiB;EAClC;EACA,OAAO,EACL,MAAM,EAAE,IAAI,eAAe,EAC7B;EACA,SAAS,EACP,MAAM,EAAE,OAAO,8DAA8D,EAC/E;EACA,YAAY;GACV,UAAU,EAAE,IAAI,wDAAwD;GACxE,OAAO,EAAE,IAAI,uBAAuB;GACpC,YAAY,EAAE,IAAI,4EAA4E;GAC9F,OAAO,EAAE,IAAI,uCAAuC;EACtD;EACA,QAAQ,EACN,MAAM;GACJ,SAAS;GACT,UAAU;GACV,OAAO;GACP,OAAO;GACP,IAAI;GACJ,IAAI;EACN,EACF;CACF;AACF,CAAC"}
|
|
@@ -4,6 +4,11 @@ export declare const TableAlign: {
|
|
|
4
4
|
readonly end: "end";
|
|
5
5
|
};
|
|
6
6
|
export type TableAlign = (typeof TableAlign)[keyof typeof TableAlign];
|
|
7
|
+
export declare const GroupExpandButtonPosition: {
|
|
8
|
+
readonly start: "start";
|
|
9
|
+
readonly end: "end";
|
|
10
|
+
};
|
|
11
|
+
export type GroupExpandButtonPosition = (typeof GroupExpandButtonPosition)[keyof typeof GroupExpandButtonPosition];
|
|
7
12
|
export declare const SortDirection: {
|
|
8
13
|
readonly asc: "asc";
|
|
9
14
|
readonly desc: "desc";
|
|
@@ -4,6 +4,10 @@ var TableAlign = {
|
|
|
4
4
|
center: "center",
|
|
5
5
|
end: "end"
|
|
6
6
|
};
|
|
7
|
+
var GroupExpandButtonPosition = {
|
|
8
|
+
start: "start",
|
|
9
|
+
end: "end"
|
|
10
|
+
};
|
|
7
11
|
var SortDirection = {
|
|
8
12
|
asc: "asc",
|
|
9
13
|
desc: "desc"
|
|
@@ -34,6 +38,6 @@ function getSortButtonAlignClass(align = TableAlign.start) {
|
|
|
34
38
|
return align === TableAlign.center ? "ml-6" : void 0;
|
|
35
39
|
}
|
|
36
40
|
//#endregion
|
|
37
|
-
export { SortDirection, TableAlign, getAlignClass, getSortButtonAlignClass };
|
|
41
|
+
export { GroupExpandButtonPosition, SortDirection, TableAlign, getAlignClass, getSortButtonAlignClass };
|
|
38
42
|
|
|
39
43
|
//# sourceMappingURL=table-props.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-props.js","names":[],"sources":["../../../src/components/tables/table-props.ts"],"sourcesContent":["export const TableAlign = {\n start: 'start',\n center: 'center',\n end: 'end',\n} as const;\n\nexport type TableAlign = (typeof TableAlign)[keyof typeof TableAlign];\n\nexport const SortDirection = {\n asc: 'asc',\n desc: 'desc',\n} as const;\n\nexport type SortDirection = (typeof SortDirection)[keyof typeof SortDirection];\n\nconst ALIGN_CLASSES: Record<TableAlign, string> = {\n [TableAlign.start]: 'text-left rtl:text-right',\n [TableAlign.center]: 'text-center',\n [TableAlign.end]: 'text-right rtl:text-left',\n};\n\nconst SORTABLE_ALIGN_CLASSES: Record<TableAlign, string> = {\n [TableAlign.start]: 'pl-3',\n [TableAlign.center]: 'px-3',\n [TableAlign.end]: 'pr-3',\n};\n\n/**\n * Returns alignment Tailwind classes for a table cell.\n * When sortable, adds reduced padding for the sort button.\n */\nexport function getAlignClass(align: TableAlign = TableAlign.start, sortable?: boolean): string {\n const classes = ALIGN_CLASSES[align];\n if (sortable)\n return `${classes} ${SORTABLE_ALIGN_CLASSES[align]}`;\n return classes;\n}\n\n/**\n * Returns extra class for sort button when column is center-aligned.\n */\nexport function getSortButtonAlignClass(align: TableAlign = TableAlign.start): string | undefined {\n return align === TableAlign.center ? 'ml-6' : undefined;\n}\n"],"mappings":";AAAA,IAAa,aAAa;CACxB,OAAO;CACP,QAAQ;CACR,KAAK;
|
|
1
|
+
{"version":3,"file":"table-props.js","names":[],"sources":["../../../src/components/tables/table-props.ts"],"sourcesContent":["export const TableAlign = {\n start: 'start',\n center: 'center',\n end: 'end',\n} as const;\n\nexport type TableAlign = (typeof TableAlign)[keyof typeof TableAlign];\n\nexport const GroupExpandButtonPosition = {\n start: 'start',\n end: 'end',\n} as const;\n\nexport type GroupExpandButtonPosition = (typeof GroupExpandButtonPosition)[keyof typeof GroupExpandButtonPosition];\n\nexport const SortDirection = {\n asc: 'asc',\n desc: 'desc',\n} as const;\n\nexport type SortDirection = (typeof SortDirection)[keyof typeof SortDirection];\n\nconst ALIGN_CLASSES: Record<TableAlign, string> = {\n [TableAlign.start]: 'text-left rtl:text-right',\n [TableAlign.center]: 'text-center',\n [TableAlign.end]: 'text-right rtl:text-left',\n};\n\nconst SORTABLE_ALIGN_CLASSES: Record<TableAlign, string> = {\n [TableAlign.start]: 'pl-3',\n [TableAlign.center]: 'px-3',\n [TableAlign.end]: 'pr-3',\n};\n\n/**\n * Returns alignment Tailwind classes for a table cell.\n * When sortable, adds reduced padding for the sort button.\n */\nexport function getAlignClass(align: TableAlign = TableAlign.start, sortable?: boolean): string {\n const classes = ALIGN_CLASSES[align];\n if (sortable)\n return `${classes} ${SORTABLE_ALIGN_CLASSES[align]}`;\n return classes;\n}\n\n/**\n * Returns extra class for sort button when column is center-aligned.\n */\nexport function getSortButtonAlignClass(align: TableAlign = TableAlign.start): string | undefined {\n return align === TableAlign.center ? 'ml-6' : undefined;\n}\n"],"mappings":";AAAA,IAAa,aAAa;CACxB,OAAO;CACP,QAAQ;CACR,KAAK;AACP;AAIA,IAAa,4BAA4B;CACvC,OAAO;CACP,KAAK;AACP;AAIA,IAAa,gBAAgB;CAC3B,KAAK;CACL,MAAM;AACR;AAIA,IAAM,gBAA4C;EAC/C,WAAW,QAAQ;EACnB,WAAW,SAAS;EACpB,WAAW,MAAM;AACpB;AAEA,IAAM,yBAAqD;EACxD,WAAW,QAAQ;EACnB,WAAW,SAAS;EACpB,WAAW,MAAM;AACpB;;;;;AAMA,SAAgB,cAAc,QAAoB,WAAW,OAAO,UAA4B;CAC9F,MAAM,UAAU,cAAc;CAC9B,IAAI,UACF,OAAO,GAAG,QAAQ,GAAG,uBAAuB;CAC9C,OAAO;AACT;;;;AAKA,SAAgB,wBAAwB,QAAoB,WAAW,OAA2B;CAChG,OAAO,UAAU,WAAW,SAAS,SAAS,KAAA;AAChD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-pagination-navigation.js","names":[],"sources":["../../../src/components/tables/use-pagination-navigation.ts"],"sourcesContent":["import type { ComputedRef, MaybeRefOrGetter, Ref, WritableComputedRef } from 'vue';\nimport type { TableOptions } from '@/composables/defaults/table';\nimport { formatInteger } from '@/utils/helpers';\n\ninterface LimitEntry { limit: number }\n\ninterface PageRange { page: number; text: string }\n\nexport interface TablePaginationData {\n page: number;\n total: number;\n limit: number;\n limits?: number[];\n}\n\nexport interface UsePaginationNavigationReturn {\n limits: ComputedRef<LimitEntry[]>;\n currentLimit: WritableComputedRef<number>;\n pages: ComputedRef<number>;\n ranges: ComputedRef<PageRange[]>;\n indicatorText: ComputedRef<string>;\n currentRange: WritableComputedRef<number>;\n useInputJump: ComputedRef<boolean>;\n hasPrev: ComputedRef<boolean>;\n hasNext: ComputedRef<boolean>;\n onPrev: () => void;\n onNext: () => void;\n onFirst: () => void;\n onLast: () => void;\n}\n\nexport function usePaginationNavigation(\n // eslint-disable-next-line @rotki/composable-input-flexibility\n modelValue: Ref<TablePaginationData>,\n tableDefaults: TableOptions,\n rangesThreshold: MaybeRefOrGetter<number> = 500,\n): UsePaginationNavigationReturn {\n const limits = computed<LimitEntry[]>(() =>\n (get(modelValue).limits ?? get(tableDefaults.limits)).map(limit => ({ limit })),\n );\n\n const currentLimit = computed<number>({\n get: () => get(modelValue).limit,\n set: limit =>\n set(modelValue, {\n ...get(modelValue),\n limit,\n page: 1,\n }),\n });\n\n const pages = computed<number>(() => {\n const { limit, total } = get(modelValue);\n if (!total)\n return 0;\n\n return Math.ceil(total / limit);\n });\n\n function pageRangeText(page: number): string {\n const { limit, total } = get(modelValue);\n const start = (page - 1) * limit + 1;\n const end = Math.min(page * limit, total);\n return `${formatInteger(start)} - ${formatInteger(end)}`;\n }\n\n const useInputJump = computed<boolean>(() => {\n const threshold = toValue(rangesThreshold);\n return threshold > 0 && get(pages) > threshold;\n });\n\n const ranges = computed<PageRange[]>(() => {\n if (get(useInputJump))\n return [];\n\n return Array.from({ length: get(pages) }, (_, i) => {\n const page = i + 1;\n return { page, text: pageRangeText(page) };\n });\n });\n\n const indicatorText = computed<string>(() => {\n const { total } = get(modelValue);\n if (get(useInputJump))\n return `of ${formatInteger(get(pages))}`;\n\n return total ? `of ${formatInteger(total)}` : `0 of 0`;\n });\n\n const currentRange = computed<number>({\n get: () => get(modelValue).page,\n set: page =>\n set(modelValue, {\n ...get(modelValue),\n page,\n }),\n });\n\n const hasPrev = computed<boolean>(() => get(modelValue).page > 1);\n const hasNext = computed<boolean>(() => get(pages) > get(modelValue).page);\n\n function goToPage(page: number): void {\n set(currentRange, page);\n }\n\n function onPrev(): void {\n if (get(hasPrev))\n goToPage(get(modelValue).page - 1);\n }\n\n function onNext(): void {\n if (get(hasNext))\n goToPage(get(modelValue).page + 1);\n }\n\n function onFirst(): void {\n if (get(hasPrev))\n goToPage(1);\n }\n\n function onLast(): void {\n if (get(hasNext))\n goToPage(get(pages));\n }\n\n return {\n limits,\n currentLimit,\n pages,\n ranges,\n indicatorText,\n currentRange,\n useInputJump,\n hasPrev,\n hasNext,\n onPrev,\n onNext,\n onFirst,\n onLast,\n };\n}\n"],"mappings":";;;;AA+BA,SAAgB,wBAEd,YACA,eACA,kBAA4C,KACb;CAC/B,MAAM,SAAS,gBACZ,IAAI,
|
|
1
|
+
{"version":3,"file":"use-pagination-navigation.js","names":[],"sources":["../../../src/components/tables/use-pagination-navigation.ts"],"sourcesContent":["import type { ComputedRef, MaybeRefOrGetter, Ref, WritableComputedRef } from 'vue';\nimport type { TableOptions } from '@/composables/defaults/table';\nimport { formatInteger } from '@/utils/helpers';\n\ninterface LimitEntry { limit: number }\n\ninterface PageRange { page: number; text: string }\n\nexport interface TablePaginationData {\n page: number;\n total: number;\n limit: number;\n limits?: number[];\n}\n\nexport interface UsePaginationNavigationReturn {\n limits: ComputedRef<LimitEntry[]>;\n currentLimit: WritableComputedRef<number>;\n pages: ComputedRef<number>;\n ranges: ComputedRef<PageRange[]>;\n indicatorText: ComputedRef<string>;\n currentRange: WritableComputedRef<number>;\n useInputJump: ComputedRef<boolean>;\n hasPrev: ComputedRef<boolean>;\n hasNext: ComputedRef<boolean>;\n onPrev: () => void;\n onNext: () => void;\n onFirst: () => void;\n onLast: () => void;\n}\n\nexport function usePaginationNavigation(\n // eslint-disable-next-line @rotki/composable-input-flexibility\n modelValue: Ref<TablePaginationData>,\n tableDefaults: TableOptions,\n rangesThreshold: MaybeRefOrGetter<number> = 500,\n): UsePaginationNavigationReturn {\n const limits = computed<LimitEntry[]>(() =>\n (get(modelValue).limits ?? get(tableDefaults.limits)).map(limit => ({ limit })),\n );\n\n const currentLimit = computed<number>({\n get: () => get(modelValue).limit,\n set: limit =>\n set(modelValue, {\n ...get(modelValue),\n limit,\n page: 1,\n }),\n });\n\n const pages = computed<number>(() => {\n const { limit, total } = get(modelValue);\n if (!total)\n return 0;\n\n return Math.ceil(total / limit);\n });\n\n function pageRangeText(page: number): string {\n const { limit, total } = get(modelValue);\n const start = (page - 1) * limit + 1;\n const end = Math.min(page * limit, total);\n return `${formatInteger(start)} - ${formatInteger(end)}`;\n }\n\n const useInputJump = computed<boolean>(() => {\n const threshold = toValue(rangesThreshold);\n return threshold > 0 && get(pages) > threshold;\n });\n\n const ranges = computed<PageRange[]>(() => {\n if (get(useInputJump))\n return [];\n\n return Array.from({ length: get(pages) }, (_, i) => {\n const page = i + 1;\n return { page, text: pageRangeText(page) };\n });\n });\n\n const indicatorText = computed<string>(() => {\n const { total } = get(modelValue);\n if (get(useInputJump))\n return `of ${formatInteger(get(pages))}`;\n\n return total ? `of ${formatInteger(total)}` : `0 of 0`;\n });\n\n const currentRange = computed<number>({\n get: () => get(modelValue).page,\n set: page =>\n set(modelValue, {\n ...get(modelValue),\n page,\n }),\n });\n\n const hasPrev = computed<boolean>(() => get(modelValue).page > 1);\n const hasNext = computed<boolean>(() => get(pages) > get(modelValue).page);\n\n function goToPage(page: number): void {\n set(currentRange, page);\n }\n\n function onPrev(): void {\n if (get(hasPrev))\n goToPage(get(modelValue).page - 1);\n }\n\n function onNext(): void {\n if (get(hasNext))\n goToPage(get(modelValue).page + 1);\n }\n\n function onFirst(): void {\n if (get(hasPrev))\n goToPage(1);\n }\n\n function onLast(): void {\n if (get(hasNext))\n goToPage(get(pages));\n }\n\n return {\n limits,\n currentLimit,\n pages,\n ranges,\n indicatorText,\n currentRange,\n useInputJump,\n hasPrev,\n hasNext,\n onPrev,\n onNext,\n onFirst,\n onLast,\n };\n}\n"],"mappings":";;;;AA+BA,SAAgB,wBAEd,YACA,eACA,kBAA4C,KACb;CAC/B,MAAM,SAAS,gBACZ,IAAI,UAAU,CAAC,CAAC,UAAU,IAAI,cAAc,MAAM,EAAA,CAAG,KAAI,WAAU,EAAE,MAAM,EAAE,CAChF;CAEA,MAAM,eAAe,SAAiB;EACpC,WAAW,IAAI,UAAU,CAAC,CAAC;EAC3B,MAAK,UACH,IAAI,YAAY;GACd,GAAG,IAAI,UAAU;GACjB;GACA,MAAM;EACR,CAAC;CACL,CAAC;CAED,MAAM,QAAQ,eAAuB;EACnC,MAAM,EAAE,OAAO,UAAU,IAAI,UAAU;EACvC,IAAI,CAAC,OACH,OAAO;EAET,OAAO,KAAK,KAAK,QAAQ,KAAK;CAChC,CAAC;CAED,SAAS,cAAc,MAAsB;EAC3C,MAAM,EAAE,OAAO,UAAU,IAAI,UAAU;EACvC,MAAM,SAAS,OAAO,KAAK,QAAQ;EACnC,MAAM,MAAM,KAAK,IAAI,OAAO,OAAO,KAAK;EACxC,OAAO,GAAG,cAAc,KAAK,EAAE,KAAK,cAAc,GAAG;CACvD;CAEA,MAAM,eAAe,eAAwB;EAC3C,MAAM,YAAY,QAAQ,eAAe;EACzC,OAAO,YAAY,KAAK,IAAI,KAAK,IAAI;CACvC,CAAC;CAED,MAAM,SAAS,eAA4B;EACzC,IAAI,IAAI,YAAY,GAClB,OAAO,CAAC;EAEV,OAAO,MAAM,KAAK,EAAE,QAAQ,IAAI,KAAK,EAAE,IAAI,GAAG,MAAM;GAClD,MAAM,OAAO,IAAI;GACjB,OAAO;IAAE;IAAM,MAAM,cAAc,IAAI;GAAE;EAC3C,CAAC;CACH,CAAC;CAED,MAAM,gBAAgB,eAAuB;EAC3C,MAAM,EAAE,UAAU,IAAI,UAAU;EAChC,IAAI,IAAI,YAAY,GAClB,OAAO,MAAM,cAAc,IAAI,KAAK,CAAC;EAEvC,OAAO,QAAQ,MAAM,cAAc,KAAK,MAAM;CAChD,CAAC;CAED,MAAM,eAAe,SAAiB;EACpC,WAAW,IAAI,UAAU,CAAC,CAAC;EAC3B,MAAK,SACH,IAAI,YAAY;GACd,GAAG,IAAI,UAAU;GACjB;EACF,CAAC;CACL,CAAC;CAED,MAAM,UAAU,eAAwB,IAAI,UAAU,CAAC,CAAC,OAAO,CAAC;CAChE,MAAM,UAAU,eAAwB,IAAI,KAAK,IAAI,IAAI,UAAU,CAAC,CAAC,IAAI;CAEzE,SAAS,SAAS,MAAoB;EACpC,IAAI,cAAc,IAAI;CACxB;CAEA,SAAS,SAAe;EACtB,IAAI,IAAI,OAAO,GACb,SAAS,IAAI,UAAU,CAAC,CAAC,OAAO,CAAC;CACrC;CAEA,SAAS,SAAe;EACtB,IAAI,IAAI,OAAO,GACb,SAAS,IAAI,UAAU,CAAC,CAAC,OAAO,CAAC;CACrC;CAEA,SAAS,UAAgB;EACvB,IAAI,IAAI,OAAO,GACb,SAAS,CAAC;CACd;CAEA,SAAS,SAAe;EACtB,IAAI,IAAI,OAAO,GACb,SAAS,IAAI,KAAK,CAAC;CACvB;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
@@ -5,7 +5,7 @@ import { useTabLink } from "./use-tab-link.js";
|
|
|
5
5
|
import { computed, createBlock, createSlots, defineComponent, mergeProps, openBlock, renderSlot, unref, useId, useSlots, withCtx } from "vue";
|
|
6
6
|
import { get } from "@vueuse/shared";
|
|
7
7
|
//#region src/components/tabs/tab/RuiTab.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var RuiTab_vue_vue_type_script_setup_true_lang_default =
|
|
8
|
+
var RuiTab_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
9
9
|
name: "RuiTab",
|
|
10
10
|
inheritAttrs: false,
|
|
11
11
|
__name: "RuiTab",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuiTab.vue_vue_type_script_setup_true_lang.js","names":["$attrs"],"sources":["../../../../src/components/tabs/tab/RuiTab.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RouteLocationRaw } from 'vue-router';\nimport type { ContextColorsType } from '@/consts/colors';\nimport type { VueClassValue } from '@/types/class-value';\nimport RuiButton from '@/components/buttons/button/RuiButton.vue';\nimport { TabAlignment, TabIndicatorPosition, TabLayout } from '@/components/tabs/tab-props';\nimport { useTabLink } from '@/components/tabs/tab/use-tab-link';\nimport { tv } from '@/utils/tv';\n\nexport interface RuiTabClassNames {\n root?: VueClassValue;\n active?: VueClassValue;\n}\n\nexport interface Props {\n color?: ContextColorsType;\n disabled?: boolean;\n grow?: boolean;\n value?: number | string;\n active?: boolean;\n classNames?: RuiTabClassNames;\n /** @deprecated Use `classNames.active` instead */\n activeClass?: string;\n link?: boolean;\n target?: string;\n to?: RouteLocationRaw;\n exact?: boolean;\n /** @deprecated No longer used — vue-router's `useLink` handles route matching internally */\n exactPath?: boolean;\n vertical?: boolean;\n align?: TabAlignment;\n indicatorPosition?: TabIndicatorPosition;\n}\n\ndefineOptions({\n name: 'RuiTab',\n inheritAttrs: false,\n});\n\nconst {\n color,\n disabled = false,\n grow = false,\n value = useId(),\n active = false,\n classNames,\n activeClass = '',\n link = false,\n to = '',\n target = '_self',\n exact = false,\n vertical = false,\n align = TabAlignment.center,\n indicatorPosition = TabIndicatorPosition.end,\n} = defineProps<Props>();\n\nconst emit = defineEmits<{\n click: [value: string | number];\n}>();\n\nconst slots = defineSlots<{\n default?: (props?: object) => any;\n prepend?: (props?: object) => any;\n append?: (props?: object) => any;\n}>();\n\nconst tab = tv({\n base: 'min-w-[5.625rem] max-w-[22.5rem] flex items-center rounded-none cursor-pointer relative whitespace-nowrap shrink-0 !px-4',\n variants: {\n layout: {\n [TabLayout.horizontal]: '',\n // `min-h` instead of `h`: keep the 48px floor so simple text tabs\n // match horizontal layout, but let tabs grow to fit richer content\n // (logo + label, multi-line text) instead of clipping against the\n // scroll container's `overflow-auto`.\n [TabLayout.vertical]: '!min-h-[3rem] w-full max-w-none',\n },\n align: {\n start: 'justify-start text-left rtl:justify-end rtl:text-right',\n center: 'justify-center text-center',\n end: 'justify-end text-right rtl:justify-start rtl:text-left',\n },\n grow: {\n true: 'grow max-w-none',\n },\n disabled: {\n true: 'cursor-not-allowed',\n },\n active: {\n true: '',\n false: '',\n },\n indicatorPosition: {\n start: '',\n end: '',\n },\n },\n compoundVariants: [\n // Horizontal active indicator (bottom/top border)\n { active: true, layout: TabLayout.horizontal, indicatorPosition: 'end', class: `after:content-[''] after:absolute after:border-current after:h-0 after:w-full after:bottom-0 after:left-0 after:border-b-2` },\n { active: true, layout: TabLayout.horizontal, indicatorPosition: 'start', class: `after:content-[''] after:absolute after:border-current after:h-0 after:w-full after:top-0 after:left-0 after:border-b-2` },\n // Vertical active indicator (right/left border)\n { active: true, layout: TabLayout.vertical, indicatorPosition: 'end', class: `after:content-[''] after:absolute after:border-current after:h-full after:w-0 after:right-0 after:left-auto after:border-r-2` },\n { active: true, layout: TabLayout.vertical, indicatorPosition: 'start', class: `after:content-[''] after:absolute after:border-current after:h-full after:w-0 after:left-0 after:right-auto after:border-r-2` },\n ],\n defaultVariants: { layout: TabLayout.horizontal, align: 'center', indicatorPosition: 'end', active: false },\n});\n\nconst { isRouteActive, href: linkHref, navigate, isLink } = useTabLink({\n link: () => link,\n to: () => to,\n exact: () => exact,\n});\n\nconst layout = computed<TabLayout>(() => vertical ? TabLayout.vertical : TabLayout.horizontal);\nconst isSelf = computed<boolean>(() => target === '_self');\nconst isEffectivelyActive = computed<boolean>(() => active || get(isRouteActive));\n\nfunction onClick(event?: MouseEvent): void {\n emit('click', value);\n if (navigate && get(isSelf) && event)\n navigate(event);\n}\n</script>\n\n<template>\n <RuiButton\n :class=\"[\n tab({ layout, align, indicatorPosition, grow, disabled, active: isEffectivelyActive }),\n isEffectivelyActive && (classNames?.active ?? activeClass),\n ]\"\n :data-active-tab=\"isEffectivelyActive || undefined\"\n :data-align=\"align\"\n :data-indicator-position=\"indicatorPosition\"\n :data-vertical=\"vertical || undefined\"\n :color=\"isEffectivelyActive ? color : undefined\"\n :disabled=\"disabled\"\n :href=\"isLink && !isSelf ? linkHref : undefined\"\n :target=\"isLink ? target : undefined\"\n :tag=\"isLink ? 'a' : undefined\"\n :no-outline=\"isLink\"\n role=\"tab\"\n :aria-selected=\"isEffectivelyActive\"\n tabindex=\"-1\"\n hide-focus-indicator\n variant=\"text\"\n v-bind=\"$attrs\"\n @click=\"disabled ? undefined : onClick($event)\"\n >\n <template\n v-if=\"slots.prepend\"\n #prepend\n >\n <slot name=\"prepend\" />\n </template>\n <slot />\n <template\n v-if=\"slots.append\"\n #append\n >\n <slot name=\"append\" />\n </template>\n </RuiButton>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwDA,MAAM,OAAO;EAIb,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"RuiTab.vue_vue_type_script_setup_true_lang.js","names":["$attrs"],"sources":["../../../../src/components/tabs/tab/RuiTab.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RouteLocationRaw } from 'vue-router';\nimport type { ContextColorsType } from '@/consts/colors';\nimport type { VueClassValue } from '@/types/class-value';\nimport RuiButton from '@/components/buttons/button/RuiButton.vue';\nimport { TabAlignment, TabIndicatorPosition, TabLayout } from '@/components/tabs/tab-props';\nimport { useTabLink } from '@/components/tabs/tab/use-tab-link';\nimport { tv } from '@/utils/tv';\n\nexport interface RuiTabClassNames {\n root?: VueClassValue;\n active?: VueClassValue;\n}\n\nexport interface Props {\n color?: ContextColorsType;\n disabled?: boolean;\n grow?: boolean;\n value?: number | string;\n active?: boolean;\n classNames?: RuiTabClassNames;\n /** @deprecated Use `classNames.active` instead */\n activeClass?: string;\n link?: boolean;\n target?: string;\n to?: RouteLocationRaw;\n exact?: boolean;\n /** @deprecated No longer used — vue-router's `useLink` handles route matching internally */\n exactPath?: boolean;\n vertical?: boolean;\n align?: TabAlignment;\n indicatorPosition?: TabIndicatorPosition;\n}\n\ndefineOptions({\n name: 'RuiTab',\n inheritAttrs: false,\n});\n\nconst {\n color,\n disabled = false,\n grow = false,\n value = useId(),\n active = false,\n classNames,\n activeClass = '',\n link = false,\n to = '',\n target = '_self',\n exact = false,\n vertical = false,\n align = TabAlignment.center,\n indicatorPosition = TabIndicatorPosition.end,\n} = defineProps<Props>();\n\nconst emit = defineEmits<{\n click: [value: string | number];\n}>();\n\nconst slots = defineSlots<{\n default?: (props?: object) => any;\n prepend?: (props?: object) => any;\n append?: (props?: object) => any;\n}>();\n\nconst tab = tv({\n base: 'min-w-[5.625rem] max-w-[22.5rem] flex items-center rounded-none cursor-pointer relative whitespace-nowrap shrink-0 !px-4',\n variants: {\n layout: {\n [TabLayout.horizontal]: '',\n // `min-h` instead of `h`: keep the 48px floor so simple text tabs\n // match horizontal layout, but let tabs grow to fit richer content\n // (logo + label, multi-line text) instead of clipping against the\n // scroll container's `overflow-auto`.\n [TabLayout.vertical]: '!min-h-[3rem] w-full max-w-none',\n },\n align: {\n start: 'justify-start text-left rtl:justify-end rtl:text-right',\n center: 'justify-center text-center',\n end: 'justify-end text-right rtl:justify-start rtl:text-left',\n },\n grow: {\n true: 'grow max-w-none',\n },\n disabled: {\n true: 'cursor-not-allowed',\n },\n active: {\n true: '',\n false: '',\n },\n indicatorPosition: {\n start: '',\n end: '',\n },\n },\n compoundVariants: [\n // Horizontal active indicator (bottom/top border)\n { active: true, layout: TabLayout.horizontal, indicatorPosition: 'end', class: `after:content-[''] after:absolute after:border-current after:h-0 after:w-full after:bottom-0 after:left-0 after:border-b-2` },\n { active: true, layout: TabLayout.horizontal, indicatorPosition: 'start', class: `after:content-[''] after:absolute after:border-current after:h-0 after:w-full after:top-0 after:left-0 after:border-b-2` },\n // Vertical active indicator (right/left border)\n { active: true, layout: TabLayout.vertical, indicatorPosition: 'end', class: `after:content-[''] after:absolute after:border-current after:h-full after:w-0 after:right-0 after:left-auto after:border-r-2` },\n { active: true, layout: TabLayout.vertical, indicatorPosition: 'start', class: `after:content-[''] after:absolute after:border-current after:h-full after:w-0 after:left-0 after:right-auto after:border-r-2` },\n ],\n defaultVariants: { layout: TabLayout.horizontal, align: 'center', indicatorPosition: 'end', active: false },\n});\n\nconst { isRouteActive, href: linkHref, navigate, isLink } = useTabLink({\n link: () => link,\n to: () => to,\n exact: () => exact,\n});\n\nconst layout = computed<TabLayout>(() => vertical ? TabLayout.vertical : TabLayout.horizontal);\nconst isSelf = computed<boolean>(() => target === '_self');\nconst isEffectivelyActive = computed<boolean>(() => active || get(isRouteActive));\n\nfunction onClick(event?: MouseEvent): void {\n emit('click', value);\n if (navigate && get(isSelf) && event)\n navigate(event);\n}\n</script>\n\n<template>\n <RuiButton\n :class=\"[\n tab({ layout, align, indicatorPosition, grow, disabled, active: isEffectivelyActive }),\n isEffectivelyActive && (classNames?.active ?? activeClass),\n ]\"\n :data-active-tab=\"isEffectivelyActive || undefined\"\n :data-align=\"align\"\n :data-indicator-position=\"indicatorPosition\"\n :data-vertical=\"vertical || undefined\"\n :color=\"isEffectivelyActive ? color : undefined\"\n :disabled=\"disabled\"\n :href=\"isLink && !isSelf ? linkHref : undefined\"\n :target=\"isLink ? target : undefined\"\n :tag=\"isLink ? 'a' : undefined\"\n :no-outline=\"isLink\"\n role=\"tab\"\n :aria-selected=\"isEffectivelyActive\"\n tabindex=\"-1\"\n hide-focus-indicator\n variant=\"text\"\n v-bind=\"$attrs\"\n @click=\"disabled ? undefined : onClick($event)\"\n >\n <template\n v-if=\"slots.prepend\"\n #prepend\n >\n <slot name=\"prepend\" />\n </template>\n <slot />\n <template\n v-if=\"slots.append\"\n #append\n >\n <slot name=\"append\" />\n </template>\n </RuiButton>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwDA,MAAM,OAAO;EAIb,MAAM,QAAQ,SAAA;EAMd,MAAM,MAAM,GAAG;GACb,MAAM;GACN,UAAU;IACR,QAAQ;MACL,UAAU,aAAa;MAKvB,UAAU,WAAW;IACxB;IACA,OAAO;KACL,OAAO;KACP,QAAQ;KACR,KAAK;IACP;IACA,MAAM,EACJ,MAAM,kBACR;IACA,UAAU,EACR,MAAM,qBACR;IACA,QAAQ;KACN,MAAM;KACN,OAAO;IACT;IACA,mBAAmB;KACjB,OAAO;KACP,KAAK;IACP;GACF;GACA,kBAAkB;IAEhB;KAAE,QAAQ;KAAM,QAAQ,UAAU;KAAY,mBAAmB;KAAO,OAAO;IAA6H;IAC5M;KAAE,QAAQ;KAAM,QAAQ,UAAU;KAAY,mBAAmB;KAAS,OAAO;IAA0H;IAE3M;KAAE,QAAQ;KAAM,QAAQ,UAAU;KAAU,mBAAmB;KAAO,OAAO;IAA+H;IAC5M;KAAE,QAAQ;KAAM,QAAQ,UAAU;KAAU,mBAAmB;KAAS,OAAO;IAA+H;GAChN;GACA,iBAAiB;IAAE,QAAQ,UAAU;IAAY,OAAO;IAAU,mBAAmB;IAAO,QAAQ;GAAM;EAC5G,CAAC;EAED,MAAM,EAAE,eAAe,MAAM,UAAU,UAAU,WAAW,WAAW;GACrE,YAAY,QAAA;GACZ,UAAU,QAAA;GACV,aAAa,QAAA;EACf,CAAC;EAED,MAAM,SAAS,eAA0B,QAAA,WAAW,UAAU,WAAW,UAAU,UAAU;EAC7F,MAAM,SAAS,eAAwB,QAAA,WAAW,OAAO;EACzD,MAAM,sBAAsB,eAAwB,QAAA,UAAU,IAAI,aAAa,CAAC;EAEhF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../../src/components/tabs/tab/use-tab-link.ts"],"sourcesContent":["import { type ComputedRef, getCurrentInstance, type MaybeRefOrGetter } from 'vue';\nimport { type RouteLocationRaw, useLink } from 'vue-router';\n\ninterface UseTabLinkOptions {\n /** Whether this tab is a link tab */\n link: MaybeRefOrGetter<boolean>;\n /** The route location to navigate to */\n to: MaybeRefOrGetter<RouteLocationRaw>;\n /** Whether to match the route exactly */\n exact: MaybeRefOrGetter<boolean>;\n}\n\ninterface UseTabLinkReturn {\n /** Whether the link is active based on the current route */\n isRouteActive: ComputedRef<boolean>;\n /** The resolved href for the link */\n href: ComputedRef<string | undefined>;\n /** Navigate to the link's route */\n navigate: ((event?: MouseEvent) => void) | undefined;\n /** Whether this tab has link behavior */\n isLink: boolean;\n}\n\n/**\n * Composable that integrates vue-router's `useLink` for link-based tabs.\n * Only activates when `link` is true, a router is available, and `to` is provided.\n */\nexport function useTabLink({ link, to, exact }: UseTabLinkOptions): UseTabLinkReturn {\n const hasRouter = !!getCurrentInstance()?.appContext.config.globalProperties.$router;\n const isLink = toValue(link) && hasRouter && !!toValue(to);\n\n if (!isLink) {\n return {\n isRouteActive: computed<boolean>(() => false),\n href: computed<string | undefined>(() => undefined),\n navigate: undefined,\n isLink: false,\n };\n }\n\n const linkState = useLink({ to: computed<RouteLocationRaw>(() => toValue(to)) });\n\n return {\n isRouteActive: computed<boolean>(() => toValue(exact) ? get(linkState.isExactActive) : get(linkState.isActive)),\n href: computed<string | undefined>(() => get(linkState.href)),\n navigate: (event?: MouseEvent) => linkState.navigate(event as MouseEvent),\n isLink: true,\n };\n}\n"],"mappings":";;;;;;;;AA2BA,SAAgB,WAAW,EAAE,MAAM,IAAI,SAA8C;CACnF,MAAM,YAAY,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"use-tab-link.js","names":[],"sources":["../../../../src/components/tabs/tab/use-tab-link.ts"],"sourcesContent":["import { type ComputedRef, getCurrentInstance, type MaybeRefOrGetter } from 'vue';\nimport { type RouteLocationRaw, useLink } from 'vue-router';\n\ninterface UseTabLinkOptions {\n /** Whether this tab is a link tab */\n link: MaybeRefOrGetter<boolean>;\n /** The route location to navigate to */\n to: MaybeRefOrGetter<RouteLocationRaw>;\n /** Whether to match the route exactly */\n exact: MaybeRefOrGetter<boolean>;\n}\n\ninterface UseTabLinkReturn {\n /** Whether the link is active based on the current route */\n isRouteActive: ComputedRef<boolean>;\n /** The resolved href for the link */\n href: ComputedRef<string | undefined>;\n /** Navigate to the link's route */\n navigate: ((event?: MouseEvent) => void) | undefined;\n /** Whether this tab has link behavior */\n isLink: boolean;\n}\n\n/**\n * Composable that integrates vue-router's `useLink` for link-based tabs.\n * Only activates when `link` is true, a router is available, and `to` is provided.\n */\nexport function useTabLink({ link, to, exact }: UseTabLinkOptions): UseTabLinkReturn {\n const hasRouter = !!getCurrentInstance()?.appContext.config.globalProperties.$router;\n const isLink = toValue(link) && hasRouter && !!toValue(to);\n\n if (!isLink) {\n return {\n isRouteActive: computed<boolean>(() => false),\n href: computed<string | undefined>(() => undefined),\n navigate: undefined,\n isLink: false,\n };\n }\n\n const linkState = useLink({ to: computed<RouteLocationRaw>(() => toValue(to)) });\n\n return {\n isRouteActive: computed<boolean>(() => toValue(exact) ? get(linkState.isExactActive) : get(linkState.isActive)),\n href: computed<string | undefined>(() => get(linkState.href)),\n navigate: (event?: MouseEvent) => linkState.navigate(event as MouseEvent),\n isLink: true,\n };\n}\n"],"mappings":";;;;;;;;AA2BA,SAAgB,WAAW,EAAE,MAAM,IAAI,SAA8C;CACnF,MAAM,YAAY,CAAC,CAAC,mBAAmB,CAAC,EAAE,WAAW,OAAO,iBAAiB;CAG7E,IAAI,EAFW,QAAQ,IAAI,KAAK,aAAa,CAAC,CAAC,QAAQ,EAAE,IAGvD,OAAO;EACL,eAAe,eAAwB,KAAK;EAC5C,MAAM,eAAmC,KAAA,CAAS;EAClD,UAAU,KAAA;EACV,QAAQ;CACV;CAGF,MAAM,YAAY,QAAQ,EAAE,IAAI,eAAiC,QAAQ,EAAE,CAAC,EAAE,CAAC;CAE/E,OAAO;EACL,eAAe,eAAwB,QAAQ,KAAK,IAAI,IAAI,UAAU,aAAa,IAAI,IAAI,UAAU,QAAQ,CAAC;EAC9G,MAAM,eAAmC,IAAI,UAAU,IAAI,CAAC;EAC5D,WAAW,UAAuB,UAAU,SAAS,KAAmB;EACxE,QAAQ;CACV;AACF"}
|
|
@@ -9,7 +9,7 @@ var _hoisted_3 = {
|
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "hidden"
|
|
11
11
|
};
|
|
12
|
-
var RuiTabItem_vue_vue_type_script_setup_true_lang_default =
|
|
12
|
+
var RuiTabItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
13
13
|
name: "RuiTabItem",
|
|
14
14
|
__name: "RuiTabItem",
|
|
15
15
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuiTabItem.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../src/components/tabs/tab-item/RuiTabItem.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nexport interface Props {\n active?: boolean;\n value?: number | string;\n eager?: boolean;\n reverse?: boolean;\n}\n\ndefineOptions({\n name: 'RuiTabItem',\n});\n\nconst { active = false, value, eager = false, reverse = false } = defineProps<Props>();\n\ndefineSlots<{\n default?: () => any;\n}>();\n</script>\n\n<template>\n <div\n role=\"tabpanel\"\n class=\"w-full\"\n :data-value=\"value\"\n :data-active=\"active || undefined\"\n >\n <Transition\n :enter-from-class=\"`opacity-0 ${reverse ? '-translate-x-8' : 'translate-x-8'}`\"\n :leave-to-class=\"`opacity-0 !h-0 overflow-hidden ${\n reverse ? 'translate-x-8' : '-translate-x-8'\n }`\"\n enter-active-class=\"w-full transform duration-300 transition\"\n enter-to-class=\"opacity-100 translate-x-0\"\n leave-active-class=\"w-full transform duration-300 transition !h-0 overflow-hidden\"\n leave-from-class=\"opacity-100 translate-x-0 !h-0 overflow-hidden\"\n >\n <div\n v-if=\"active\"\n class=\"w-full\"\n >\n <slot />\n </div>\n </Transition>\n <div\n v-if=\"eager && !active\"\n class=\"hidden\"\n >\n <slot />\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAoBE,mBA6BM,OAAA;IA5BJ,MAAK;IACL,OAAM;IACL,cAAY,QAAA;IACZ,eAAa,QAAA,UAAU,KAAA;OAExB,YAgBa,YAAA;IAfV,oBAAgB,aAAe,QAAA,UAAO,mBAAA;IACtC,kBAAc,kCAA6C,QAAA,UAAO,kBAAA;IAGnE,sBAAmB;IACnB,kBAAe;IACf,sBAAmB;IACnB,oBAAiB;;2BAOX,CAJE,QAAA,UAAA,
|
|
1
|
+
{"version":3,"file":"RuiTabItem.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../src/components/tabs/tab-item/RuiTabItem.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nexport interface Props {\n active?: boolean;\n value?: number | string;\n eager?: boolean;\n reverse?: boolean;\n}\n\ndefineOptions({\n name: 'RuiTabItem',\n});\n\nconst { active = false, value, eager = false, reverse = false } = defineProps<Props>();\n\ndefineSlots<{\n default?: () => any;\n}>();\n</script>\n\n<template>\n <div\n role=\"tabpanel\"\n class=\"w-full\"\n :data-value=\"value\"\n :data-active=\"active || undefined\"\n >\n <Transition\n :enter-from-class=\"`opacity-0 ${reverse ? '-translate-x-8' : 'translate-x-8'}`\"\n :leave-to-class=\"`opacity-0 !h-0 overflow-hidden ${\n reverse ? 'translate-x-8' : '-translate-x-8'\n }`\"\n enter-active-class=\"w-full transform duration-300 transition\"\n enter-to-class=\"opacity-100 translate-x-0\"\n leave-active-class=\"w-full transform duration-300 transition !h-0 overflow-hidden\"\n leave-from-class=\"opacity-100 translate-x-0 !h-0 overflow-hidden\"\n >\n <div\n v-if=\"active\"\n class=\"w-full\"\n >\n <slot />\n </div>\n </Transition>\n <div\n v-if=\"eager && !active\"\n class=\"hidden\"\n >\n <slot />\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAoBE,mBA6BM,OAAA;IA5BJ,MAAK;IACL,OAAM;IACL,cAAY,QAAA;IACZ,eAAa,QAAA,UAAU,KAAA;OAExB,YAgBa,YAAA;IAfV,oBAAgB,aAAe,QAAA,UAAO,mBAAA;IACtC,kBAAc,kCAA6C,QAAA,UAAO,kBAAA;IAGnE,sBAAmB;IACnB,kBAAe;IACf,sBAAmB;IACnB,oBAAiB;;2BAOX,CAJE,QAAA,UAAA,UAAA,GADR,mBAKM,OALN,YAKM,CADJ,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,CAAA;;kDAIJ,QAAA,SAAK,CAAK,QAAA,UAAA,UAAA,GADlB,mBAKM,OALN,YAKM,CADJ,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,GAAA,GAAA,UAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuiTabItems.js","names":[],"sources":["../../../../src/components/tabs/tab-items/RuiTabItems.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends string | number\">\nimport { Fragment, isVNode } from 'vue';\n\ndefineOptions({\n name: 'RuiTabItems',\n inheritAttrs: false,\n});\n\n// Default matches RuiTabs' `defineModel<... >({ default: 0 })`. Without a\n// default, consumers that bind both components to the same ref (e.g.\n// `v-model=\"item.modelValue\"` on both RuiTabs and RuiTabItems, where the\n// ref starts as `undefined`) leave RuiTabItems with `modelValue === undefined`.\n// The `active = modelValue === value` check then fails for every tab — the\n// panel renders but stays height:0, so e2e `toHaveText` and `toBeVisible`\n// assertions pass the element but see no content.\nconst modelValue = defineModel<T>({ default: 0 as T });\n\nconst slots = useSlots();\n\nconst reverse = ref<boolean>(false);\nconst currIndex = ref<number>(-1);\nconst activeIndex = ref<number>(-1);\nconst inner = useTemplateRef<HTMLDivElement>('inner');\n\nconst { height: innerHeight } = useElementSize(inner);\n\nconst children = computed<VNode[]>(() => {\n const slotContent = slots.default?.() ?? [];\n\n const tabs = getChildrenTabs(slotContent);\n\n let anyActive = false;\n const children = tabs.map((tab, index) => {\n const value = tab.props?.value ?? index;\n const active = get(modelValue) === value;\n if (active) {\n anyActive = true;\n if (index !== get(currIndex)) {\n set(reverse, index < get(currIndex));\n set(currIndex, index);\n }\n }\n\n return {\n ...tab,\n props: {\n value,\n ...tab.props,\n },\n };\n });\n\n if (!anyActive)\n set(currIndex, -1);\n\n return children;\n});\n\n// When using dynamic content with v-for the slot content can contain fragment,\n// Go through the fragment and always return RuiTabItem only\nfunction getChildrenTabs(children: VNode[]): VNode[] {\n return children\n .flatMap((item) => {\n if (item.type === Fragment && Array.isArray(item.children) && item.children.length > 0)\n return getChildrenTabs(item.children.filter(isVNode));\n\n return [item];\n })\n .flat();\n}\n\nwatch(currIndex, (index) => {\n nextTick(() => {\n set(activeIndex, index);\n });\n});\n</script>\n\n<template>\n <div\n class=\"grow transition-all overflow-hidden\"\n :style=\"{ height: `${innerHeight}px` }\"\n v-bind=\"$attrs\"\n >\n <div ref=\"inner\">\n <Component\n :is=\"child\"\n v-for=\"(child, i) in children\"\n :key=\"i\"\n :reverse=\"reverse\"\n :active=\"i === activeIndex\"\n />\n </div>\n </div>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"RuiTabItems.js","names":[],"sources":["../../../../src/components/tabs/tab-items/RuiTabItems.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends string | number\">\nimport { Fragment, isVNode } from 'vue';\n\ndefineOptions({\n name: 'RuiTabItems',\n inheritAttrs: false,\n});\n\n// Default matches RuiTabs' `defineModel<... >({ default: 0 })`. Without a\n// default, consumers that bind both components to the same ref (e.g.\n// `v-model=\"item.modelValue\"` on both RuiTabs and RuiTabItems, where the\n// ref starts as `undefined`) leave RuiTabItems with `modelValue === undefined`.\n// The `active = modelValue === value` check then fails for every tab — the\n// panel renders but stays height:0, so e2e `toHaveText` and `toBeVisible`\n// assertions pass the element but see no content.\nconst modelValue = defineModel<T>({ default: () => 0 as T });\n\nconst slots = useSlots();\n\nconst reverse = ref<boolean>(false);\nconst currIndex = ref<number>(-1);\nconst activeIndex = ref<number>(-1);\nconst inner = useTemplateRef<HTMLDivElement>('inner');\n\nconst { height: innerHeight } = useElementSize(inner);\n\nconst children = computed<VNode[]>(() => {\n const slotContent = slots.default?.() ?? [];\n\n const tabs = getChildrenTabs(slotContent);\n\n let anyActive = false;\n const children = tabs.map((tab, index) => {\n const value = tab.props?.value ?? index;\n const active = get(modelValue) === value;\n if (active) {\n anyActive = true;\n if (index !== get(currIndex)) {\n set(reverse, index < get(currIndex));\n set(currIndex, index);\n }\n }\n\n return {\n ...tab,\n props: {\n value,\n ...tab.props,\n },\n };\n });\n\n if (!anyActive)\n set(currIndex, -1);\n\n return children;\n});\n\n// When using dynamic content with v-for the slot content can contain fragment,\n// Go through the fragment and always return RuiTabItem only\nfunction getChildrenTabs(children: VNode[]): VNode[] {\n return children\n .flatMap((item) => {\n if (item.type === Fragment && Array.isArray(item.children) && item.children.length > 0)\n return getChildrenTabs(item.children.filter(isVNode));\n\n return [item];\n })\n .flat();\n}\n\nwatch(currIndex, (index) => {\n nextTick(() => {\n set(activeIndex, index);\n });\n});\n</script>\n\n<template>\n <div\n class=\"grow transition-all overflow-hidden\"\n :style=\"{ height: `${innerHeight}px` }\"\n v-bind=\"$attrs\"\n >\n <div ref=\"inner\">\n <Component\n :is=\"child\"\n v-for=\"(child, i) in children\"\n :key=\"i\"\n :reverse=\"reverse\"\n :active=\"i === activeIndex\"\n />\n </div>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -2,12 +2,12 @@ import { Fragment, computed, createBlock, createElementBlock, createElementVNode
|
|
|
2
2
|
import { useElementSize } from "@vueuse/core";
|
|
3
3
|
import { get as get$1, set as set$1 } from "@vueuse/shared";
|
|
4
4
|
//#region src/components/tabs/tab-items/RuiTabItems.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var RuiTabItems_vue_vue_type_script_setup_true_lang_default =
|
|
5
|
+
var RuiTabItems_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
6
|
name: "RuiTabItems",
|
|
7
7
|
inheritAttrs: false,
|
|
8
8
|
__name: "RuiTabItems",
|
|
9
9
|
props: {
|
|
10
|
-
"modelValue": { default: 0 },
|
|
10
|
+
"modelValue": { default: () => 0 },
|
|
11
11
|
"modelModifiers": {}
|
|
12
12
|
},
|
|
13
13
|
emits: ["update:modelValue"],
|
package/dist/components/tabs/tab-items/RuiTabItems.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuiTabItems.vue_vue_type_script_setup_true_lang.js","names":["$attrs"],"sources":["../../../../src/components/tabs/tab-items/RuiTabItems.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends string | number\">\nimport { Fragment, isVNode } from 'vue';\n\ndefineOptions({\n name: 'RuiTabItems',\n inheritAttrs: false,\n});\n\n// Default matches RuiTabs' `defineModel<... >({ default: 0 })`. Without a\n// default, consumers that bind both components to the same ref (e.g.\n// `v-model=\"item.modelValue\"` on both RuiTabs and RuiTabItems, where the\n// ref starts as `undefined`) leave RuiTabItems with `modelValue === undefined`.\n// The `active = modelValue === value` check then fails for every tab — the\n// panel renders but stays height:0, so e2e `toHaveText` and `toBeVisible`\n// assertions pass the element but see no content.\nconst modelValue = defineModel<T>({ default: 0 as T });\n\nconst slots = useSlots();\n\nconst reverse = ref<boolean>(false);\nconst currIndex = ref<number>(-1);\nconst activeIndex = ref<number>(-1);\nconst inner = useTemplateRef<HTMLDivElement>('inner');\n\nconst { height: innerHeight } = useElementSize(inner);\n\nconst children = computed<VNode[]>(() => {\n const slotContent = slots.default?.() ?? [];\n\n const tabs = getChildrenTabs(slotContent);\n\n let anyActive = false;\n const children = tabs.map((tab, index) => {\n const value = tab.props?.value ?? index;\n const active = get(modelValue) === value;\n if (active) {\n anyActive = true;\n if (index !== get(currIndex)) {\n set(reverse, index < get(currIndex));\n set(currIndex, index);\n }\n }\n\n return {\n ...tab,\n props: {\n value,\n ...tab.props,\n },\n };\n });\n\n if (!anyActive)\n set(currIndex, -1);\n\n return children;\n});\n\n// When using dynamic content with v-for the slot content can contain fragment,\n// Go through the fragment and always return RuiTabItem only\nfunction getChildrenTabs(children: VNode[]): VNode[] {\n return children\n .flatMap((item) => {\n if (item.type === Fragment && Array.isArray(item.children) && item.children.length > 0)\n return getChildrenTabs(item.children.filter(isVNode));\n\n return [item];\n })\n .flat();\n}\n\nwatch(currIndex, (index) => {\n nextTick(() => {\n set(activeIndex, index);\n });\n});\n</script>\n\n<template>\n <div\n class=\"grow transition-all overflow-hidden\"\n :style=\"{ height: `${innerHeight}px` }\"\n v-bind=\"$attrs\"\n >\n <div ref=\"inner\">\n <Component\n :is=\"child\"\n v-for=\"(child, i) in children\"\n :key=\"i\"\n :reverse=\"reverse\"\n :active=\"i === activeIndex\"\n />\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;EAeA,MAAM,aAAa,SAAc,SAAA,
|
|
1
|
+
{"version":3,"file":"RuiTabItems.vue_vue_type_script_setup_true_lang.js","names":["$attrs"],"sources":["../../../../src/components/tabs/tab-items/RuiTabItems.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends string | number\">\nimport { Fragment, isVNode } from 'vue';\n\ndefineOptions({\n name: 'RuiTabItems',\n inheritAttrs: false,\n});\n\n// Default matches RuiTabs' `defineModel<... >({ default: 0 })`. Without a\n// default, consumers that bind both components to the same ref (e.g.\n// `v-model=\"item.modelValue\"` on both RuiTabs and RuiTabItems, where the\n// ref starts as `undefined`) leave RuiTabItems with `modelValue === undefined`.\n// The `active = modelValue === value` check then fails for every tab — the\n// panel renders but stays height:0, so e2e `toHaveText` and `toBeVisible`\n// assertions pass the element but see no content.\nconst modelValue = defineModel<T>({ default: () => 0 as T });\n\nconst slots = useSlots();\n\nconst reverse = ref<boolean>(false);\nconst currIndex = ref<number>(-1);\nconst activeIndex = ref<number>(-1);\nconst inner = useTemplateRef<HTMLDivElement>('inner');\n\nconst { height: innerHeight } = useElementSize(inner);\n\nconst children = computed<VNode[]>(() => {\n const slotContent = slots.default?.() ?? [];\n\n const tabs = getChildrenTabs(slotContent);\n\n let anyActive = false;\n const children = tabs.map((tab, index) => {\n const value = tab.props?.value ?? index;\n const active = get(modelValue) === value;\n if (active) {\n anyActive = true;\n if (index !== get(currIndex)) {\n set(reverse, index < get(currIndex));\n set(currIndex, index);\n }\n }\n\n return {\n ...tab,\n props: {\n value,\n ...tab.props,\n },\n };\n });\n\n if (!anyActive)\n set(currIndex, -1);\n\n return children;\n});\n\n// When using dynamic content with v-for the slot content can contain fragment,\n// Go through the fragment and always return RuiTabItem only\nfunction getChildrenTabs(children: VNode[]): VNode[] {\n return children\n .flatMap((item) => {\n if (item.type === Fragment && Array.isArray(item.children) && item.children.length > 0)\n return getChildrenTabs(item.children.filter(isVNode));\n\n return [item];\n })\n .flat();\n}\n\nwatch(currIndex, (index) => {\n nextTick(() => {\n set(activeIndex, index);\n });\n});\n</script>\n\n<template>\n <div\n class=\"grow transition-all overflow-hidden\"\n :style=\"{ height: `${innerHeight}px` }\"\n v-bind=\"$attrs\"\n >\n <div ref=\"inner\">\n <Component\n :is=\"child\"\n v-for=\"(child, i) in children\"\n :key=\"i\"\n :reverse=\"reverse\"\n :active=\"i === activeIndex\"\n />\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;EAeA,MAAM,aAAa,SAAc,SAAA,YAA0B;EAE3D,MAAM,QAAQ,SAAS;EAEvB,MAAM,UAAU,IAAa,KAAK;EAClC,MAAM,YAAY,IAAY,EAAE;EAChC,MAAM,cAAc,IAAY,EAAE;EAClC,MAAM,QAAQ,eAA+B,OAAO;EAEpD,MAAM,EAAE,QAAQ,gBAAgB,eAAe,KAAK;EAEpD,MAAM,WAAW,eAAwB;GAGvC,MAAM,OAAO,gBAFO,MAAM,UAAU,KAAK,CAAC,CAEF;GAExC,IAAI,YAAY;GAChB,MAAM,WAAW,KAAK,KAAK,KAAK,UAAU;IACxC,MAAM,QAAQ,IAAI,OAAO,SAAS;IAElC,IADe,MAAI,UAAU,MAAM,OACvB;KACV,YAAY;KACZ,IAAI,UAAU,MAAI,SAAS,GAAG;MAC5B,MAAI,SAAS,QAAQ,MAAI,SAAS,CAAC;MACnC,MAAI,WAAW,KAAK;KACtB;IACF;IAEA,OAAO;KACL,GAAG;KACH,OAAO;MACL;MACA,GAAG,IAAI;KACT;IACF;GACF,CAAC;GAED,IAAI,CAAC,WACH,MAAI,WAAW,EAAE;GAEnB,OAAO;EACT,CAAC;EAID,SAAS,gBAAgB,UAA4B;GACnD,OAAO,SACJ,SAAS,SAAS;IACjB,IAAI,KAAK,SAAS,YAAY,MAAM,QAAQ,KAAK,QAAQ,KAAK,KAAK,SAAS,SAAS,GACnF,OAAO,gBAAgB,KAAK,SAAS,OAAO,OAAO,CAAC;IAEtD,OAAO,CAAC,IAAI;GACd,CAAC,CAAA,CACA,KAAK;EACV;EAEA,MAAM,YAAY,UAAU;GAC1B,eAAe;IACb,MAAI,aAAa,KAAK;GACxB,CAAC;EACH,CAAC;;uBAIC,mBAcM,OAdN,WAcM;IAbJ,OAAM;IACL,OAAK,EAAA,QAAA,GAAe,MAAA,WAAA,EAAW,IAAA;MACxBA,KAAAA,MAAM,GAAA,CAEd,mBAQM,OAAA;aARG;IAAJ,KAAI;yBACP,mBAME,UAAA,MAAA,WAJqB,MAAA,QAAA,IAAb,OAAO,MAAC;wBAFlB,YAME,wBALK,KAAK,GAAA;KAET,KAAK;KACL,SAAS,MAAA,OAAA;KACT,QAAQ,MAAM,MAAA,WAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-props.js","names":[],"sources":["../../../src/components/tabs/tab-props.ts"],"sourcesContent":["export const TabAlignment = {\n start: 'start',\n center: 'center',\n end: 'end',\n} as const;\n\nexport type TabAlignment = (typeof TabAlignment)[keyof typeof TabAlignment];\n\nexport const TabIndicatorPosition = {\n start: 'start',\n end: 'end',\n} as const;\n\nexport type TabIndicatorPosition = (typeof TabIndicatorPosition)[keyof typeof TabIndicatorPosition];\n\nexport interface RouteMatchOptions {\n exactPath?: boolean;\n exact?: boolean;\n}\n\nexport const TabLayout = {\n horizontal: 'horizontal',\n vertical: 'vertical',\n} as const;\n\nexport type TabLayout = (typeof TabLayout)[keyof typeof TabLayout];\n"],"mappings":";AAAA,IAAa,eAAe;CAC1B,OAAO;CACP,QAAQ;CACR,KAAK;
|
|
1
|
+
{"version":3,"file":"tab-props.js","names":[],"sources":["../../../src/components/tabs/tab-props.ts"],"sourcesContent":["export const TabAlignment = {\n start: 'start',\n center: 'center',\n end: 'end',\n} as const;\n\nexport type TabAlignment = (typeof TabAlignment)[keyof typeof TabAlignment];\n\nexport const TabIndicatorPosition = {\n start: 'start',\n end: 'end',\n} as const;\n\nexport type TabIndicatorPosition = (typeof TabIndicatorPosition)[keyof typeof TabIndicatorPosition];\n\nexport interface RouteMatchOptions {\n exactPath?: boolean;\n exact?: boolean;\n}\n\nexport const TabLayout = {\n horizontal: 'horizontal',\n vertical: 'vertical',\n} as const;\n\nexport type TabLayout = (typeof TabLayout)[keyof typeof TabLayout];\n"],"mappings":";AAAA,IAAa,eAAe;CAC1B,OAAO;CACP,QAAQ;CACR,KAAK;AACP;AAIA,IAAa,uBAAuB;CAClC,OAAO;CACP,KAAK;AACP;AASA,IAAa,YAAY;CACvB,YAAY;CACZ,UAAU;AACZ"}
|
|
@@ -9,10 +9,10 @@ import { watchImmediate } from "@vueuse/core";
|
|
|
9
9
|
import { get as get$1, set as set$1 } from "@vueuse/shared";
|
|
10
10
|
//#region src/components/tabs/tabs/RuiTabs.vue?vue&type=script&setup=true&lang.ts
|
|
11
11
|
var _hoisted_1 = ["data-vertical"];
|
|
12
|
-
var RuiTabs_vue_vue_type_script_setup_true_lang_default =
|
|
12
|
+
var RuiTabs_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
13
13
|
name: "RuiTabs",
|
|
14
14
|
__name: "RuiTabs",
|
|
15
|
-
props:
|
|
15
|
+
props: /*@__PURE__*/ mergeModels({
|
|
16
16
|
color: {},
|
|
17
17
|
vertical: {
|
|
18
18
|
type: Boolean,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuiTabs.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../src/components/tabs/tabs/RuiTabs.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ContextColorsType } from '@/consts/colors';\nimport { Fragment, isVNode, type VNode } from 'vue';\nimport RuiButton from '@/components/buttons/button/RuiButton.vue';\nimport RuiIcon from '@/components/icons/RuiIcon.vue';\nimport { type TabAlignment, type TabIndicatorPosition, TabLayout } from '@/components/tabs/tab-props';\nimport { useTabRouting } from '@/components/tabs/tabs/use-tab-routing';\nimport { useTabScroll } from '@/components/tabs/tabs/use-tab-scroll';\nimport { tv } from '@/utils/tv';\n\ntype ChildNode = VNode & { props: Record<string, any> };\n\ninterface ResolvedTabProps {\n value?: string | number;\n to?: unknown;\n link?: boolean;\n exact?: boolean;\n exactPath?: boolean;\n}\n\nexport interface Props {\n color?: ContextColorsType;\n vertical?: boolean;\n disabled?: boolean;\n grow?: boolean;\n align?: TabAlignment;\n indicatorPosition?: TabIndicatorPosition;\n}\n\ndefineOptions({\n name: 'RuiTabs',\n});\n\n// Default 0 (first tab) matches the existing internal fallback on line 163.\n// Providing a default narrows the `update:modelValue` emit payload from\n// `value?: number | string` to `value: number | string`, so consumers can\n// type their handler signatures without undefined unions.\nconst modelValue = defineModel<number | string>({ default: 0 });\n\nconst {\n color,\n vertical = false,\n disabled = false,\n grow = false,\n align = 'center',\n indicatorPosition = 'end',\n} = defineProps<Props>();\n\nconst internalModelValue = ref<string | number>();\nconst bar = useTemplateRef<HTMLDivElement>('bar');\nconst wrapper = useTemplateRef<HTMLDivElement>('wrapper');\n\nconst tabs = tv({\n slots: {\n root: '',\n arrow: '',\n bar: 'no-scrollbar max-h-full overflow-auto',\n wrapper: 'h-full inline-flex max-w-none',\n },\n variants: {\n layout: {\n [TabLayout.horizontal]: {\n root: 'flex h-fit',\n arrow: 'h-[3rem] w-10',\n bar: 'h-[3rem]',\n wrapper: '',\n },\n [TabLayout.vertical]: {\n root: 'inline-flex flex-col',\n arrow: 'min-h-[3rem] w-full',\n bar: '',\n wrapper: 'flex-col h-auto',\n },\n },\n wide: {\n true: {\n bar: 'w-full',\n wrapper: 'min-w-full',\n },\n },\n },\n defaultVariants: { layout: TabLayout.horizontal },\n});\n\nconst slots = useSlots();\n\nconst {\n showArrows,\n prevArrowDisabled,\n nextArrowDisabled,\n onPrevSliderClick,\n onNextSliderClick,\n keepActiveTabVisible,\n} = useTabScroll({ bar, wrapper, vertical: () => vertical });\n\nconst { resolveRoute, isPathMatch } = useTabRouting({\n onRouteChange: () => applyNewValue(true),\n});\n\nconst layout = computed<TabLayout>(() => vertical ? TabLayout.vertical : TabLayout.horizontal);\nconst ui = computed<ReturnType<typeof tabs>>(() => tabs({ layout: get(layout), wide: vertical || grow }));\n\nconst children = computed<ChildNode[]>(() => {\n const slotContent = slots.default?.() ?? [];\n\n const tabs = getChildrenTabs(slotContent);\n\n const currentModelValue = get(internalModelValue);\n const inheritedProps = {\n color,\n grow,\n disabled,\n vertical,\n align,\n indicatorPosition,\n };\n\n return tabs.map((tab, index) => {\n let tabValue = tab.props?.value ?? index;\n if (tab.props?.link !== false && tab.props?.to)\n tabValue = tab.props.to;\n\n const active = currentModelValue === tabValue;\n return {\n ...tab,\n props: {\n value: tabValue,\n active,\n ...inheritedProps,\n ...tab.props,\n },\n };\n });\n});\n\n// When using dynamic content with v-for the slot content can contain fragment,\n// Go through the fragment and always return RuiTab only\nfunction getChildrenTabs(children: VNode[]): VNode[] {\n return children.flatMap((item) => {\n if (item.type === Fragment && Array.isArray(item.children) && item.children.length > 0)\n return getChildrenTabs(item.children.filter(isVNode));\n\n return [item];\n }).flat();\n}\n\nfunction updateModelValue(newModelValue: string | number): void {\n set(modelValue, newModelValue);\n set(internalModelValue, newModelValue);\n}\n\nfunction getTabRouteProps(props: Record<string, unknown>): ResolvedTabProps {\n return {\n value: typeof props.value === 'string' || typeof props.value === 'number' ? props.value : undefined,\n to: props.to ?? undefined,\n link: typeof props.link === 'boolean' ? props.link : undefined,\n exact: typeof props.exact === 'boolean' ? props.exact : undefined,\n exactPath: typeof props.exactPath === 'boolean' ? props.exactPath : undefined,\n };\n}\n\nfunction resolveActiveValue(onlyLink: boolean): string | number | undefined {\n const enabledChildren = get(children).filter(child => !child.props?.disabled);\n if (enabledChildren.length === 0)\n return undefined;\n\n let result: string | number = get(modelValue) || 0;\n enabledChildren.forEach((child, index) => {\n const tabProps = getTabRouteProps(child.props);\n if (!onlyLink && index === 0 && tabProps.value)\n result = tabProps.value;\n\n const fullPath = resolveRoute(tabProps.to);\n\n if (tabProps.link !== false && fullPath && isPathMatch(fullPath, tabProps))\n result = fullPath;\n });\n return result;\n}\n\nfunction applyNewValue(onlyLink = false): void {\n const value = resolveActiveValue(onlyLink);\n if (value !== undefined)\n updateModelValue(value);\n\n keepActiveTabVisible();\n}\n\nwatchImmediate(() => get(modelValue), (modelValue) => {\n set(internalModelValue, modelValue);\n});\n\nwatch(internalModelValue, () => {\n keepActiveTabVisible();\n});\n\nonMounted(() => {\n if (get(modelValue) !== undefined)\n return;\n\n applyNewValue();\n});\n</script>\n\n<template>\n <div\n :class=\"ui.root()\"\n :data-vertical=\"vertical || undefined\"\n >\n <div\n v-if=\"showArrows\"\n :class=\"ui.arrow()\"\n >\n <RuiButton\n class=\"w-full h-full !rounded-none\"\n variant=\"text\"\n :color=\"color\"\n :disabled=\"prevArrowDisabled\"\n @click=\"onPrevSliderClick()\"\n >\n <RuiIcon :name=\"vertical ? 'lu-chevron-up' : 'lu-chevron-left'\" />\n </RuiButton>\n </div>\n <div\n ref=\"bar\"\n :class=\"ui.bar()\"\n >\n <div\n ref=\"wrapper\"\n role=\"tablist\"\n data-id=\"tabs-wrapper\"\n :class=\"ui.wrapper()\"\n >\n <Component\n :is=\"child\"\n v-for=\"(child, i) in children\"\n :key=\"i\"\n @click=\"updateModelValue($event)\"\n />\n </div>\n </div>\n <div\n v-if=\"showArrows\"\n :class=\"ui.arrow()\"\n >\n <RuiButton\n class=\"w-full h-full !rounded-none\"\n variant=\"text\"\n :color=\"color\"\n :disabled=\"nextArrowDisabled\"\n @click=\"onNextSliderClick()\"\n >\n <RuiIcon :name=\"vertical ? 'lu-chevron-down' : 'lu-chevron-right'\" />\n </RuiButton>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqCA,MAAM,aAAa,SAA4B,SAAA,aAAgB;EAW/D,MAAM,qBAAqB,KAAsB;EACjD,MAAM,MAAM,eAA+B,MAAM;EACjD,MAAM,UAAU,eAA+B,UAAU;EAEzD,MAAM,OAAO,GAAG;GACd,OAAO;IACL,MAAM;IACN,OAAO;IACP,KAAK;IACL,SAAS;IACV;GACD,UAAU;IACR,QAAQ;MACL,UAAU,aAAa;MACtB,MAAM;MACN,OAAO;MACP,KAAK;MACL,SAAS;MACV;MACA,UAAU,WAAW;MACpB,MAAM;MACN,OAAO;MACP,KAAK;MACL,SAAS;;KAEZ;IACD,MAAM,EACJ,MAAM;KACJ,KAAK;KACL,SAAS;KACV,EAAA;IAEJ;GACD,iBAAiB,EAAE,QAAQ,UAAU,YAAA;GACtC,CAAC;EAEF,MAAM,QAAQ,UAAU;EAExB,MAAM,EACJ,YACA,mBACA,mBACA,mBACA,mBACA,yBACE,aAAa;GAAE;GAAK;GAAS,gBAAgB,QAAA;GAAU,CAAC;EAE5D,MAAM,EAAE,cAAc,gBAAgB,cAAc,EAClD,qBAAqB,cAAc,KAAK,EACzC,CAAC;EAEF,MAAM,SAAS,eAA0B,QAAA,W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,mBAAA,EAAA,MAAA,GAAA,CAAA,OAAA,CAAA,CAAA,CAAA;;;IAG5B,mBAiBM,OAAA;cAhBA;KAAJ,KAAI;KACH,OAAK,eAAE,MAAA,GAAE,CAAC,KAAG,CAAA;QAEd,mBAYM,OAAA;cAXA;KAAJ,KAAI;KACJ,MAAK;KACL,WAAQ;KACP,OAAK,eAAE,MAAA,GAAE,CAAC,SAAO,CAAA;0BAElB,mBAKE,UAAA,MAAA,WAHqB,MAAA,SAAQ,GAArB,OAAO,MAAC;yBAFlB,YAKE,wBAJK,MAAK,EAAA;MAET,KAAK;MACL,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,iBAAiB,OAAM;;;IAK7B,MAAA,WAAU,IAAA,WAAA,EADlB,mBAaM,OAAA;;KAXH,OAAK,eAAE,MAAA,GAAE,CAAC,OAAK,CAAA;QAEhB,YAQY,mBAAA;KAPV,OAAM;KACN,SAAQ;KACP,OAAO,QAAA;KACP,UAAU,MAAA,kBAAiB;KAC3B,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,kBAAiB,EAAA;;4BAE4C,CAArE,YAAqE,iBAAA,EAA3D,MAAM,QAAA,WAAQ,oBAAA,oBAAA,EAAA,MAAA,GAAA,CAAA,OAAA,CAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"RuiTabs.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../src/components/tabs/tabs/RuiTabs.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ContextColorsType } from '@/consts/colors';\nimport { Fragment, isVNode, type VNode } from 'vue';\nimport RuiButton from '@/components/buttons/button/RuiButton.vue';\nimport RuiIcon from '@/components/icons/RuiIcon.vue';\nimport { type TabAlignment, type TabIndicatorPosition, TabLayout } from '@/components/tabs/tab-props';\nimport { useTabRouting } from '@/components/tabs/tabs/use-tab-routing';\nimport { useTabScroll } from '@/components/tabs/tabs/use-tab-scroll';\nimport { tv } from '@/utils/tv';\n\ntype ChildNode = VNode & { props: Record<string, any> };\n\ninterface ResolvedTabProps {\n value?: string | number;\n to?: unknown;\n link?: boolean;\n exact?: boolean;\n exactPath?: boolean;\n}\n\nexport interface Props {\n color?: ContextColorsType;\n vertical?: boolean;\n disabled?: boolean;\n grow?: boolean;\n align?: TabAlignment;\n indicatorPosition?: TabIndicatorPosition;\n}\n\ndefineOptions({\n name: 'RuiTabs',\n});\n\n// Default 0 (first tab) matches the existing internal fallback on line 163.\n// Providing a default narrows the `update:modelValue` emit payload from\n// `value?: number | string` to `value: number | string`, so consumers can\n// type their handler signatures without undefined unions.\nconst modelValue = defineModel<number | string>({ default: 0 });\n\nconst {\n color,\n vertical = false,\n disabled = false,\n grow = false,\n align = 'center',\n indicatorPosition = 'end',\n} = defineProps<Props>();\n\nconst internalModelValue = ref<string | number>();\nconst bar = useTemplateRef<HTMLDivElement>('bar');\nconst wrapper = useTemplateRef<HTMLDivElement>('wrapper');\n\nconst tabs = tv({\n slots: {\n root: '',\n arrow: '',\n bar: 'no-scrollbar max-h-full overflow-auto',\n wrapper: 'h-full inline-flex max-w-none',\n },\n variants: {\n layout: {\n [TabLayout.horizontal]: {\n root: 'flex h-fit',\n arrow: 'h-[3rem] w-10',\n bar: 'h-[3rem]',\n wrapper: '',\n },\n [TabLayout.vertical]: {\n root: 'inline-flex flex-col',\n arrow: 'min-h-[3rem] w-full',\n bar: '',\n wrapper: 'flex-col h-auto',\n },\n },\n wide: {\n true: {\n bar: 'w-full',\n wrapper: 'min-w-full',\n },\n },\n },\n defaultVariants: { layout: TabLayout.horizontal },\n});\n\nconst slots = useSlots();\n\nconst {\n showArrows,\n prevArrowDisabled,\n nextArrowDisabled,\n onPrevSliderClick,\n onNextSliderClick,\n keepActiveTabVisible,\n} = useTabScroll({ bar, wrapper, vertical: () => vertical });\n\nconst { resolveRoute, isPathMatch } = useTabRouting({\n onRouteChange: () => applyNewValue(true),\n});\n\nconst layout = computed<TabLayout>(() => vertical ? TabLayout.vertical : TabLayout.horizontal);\nconst ui = computed<ReturnType<typeof tabs>>(() => tabs({ layout: get(layout), wide: vertical || grow }));\n\nconst children = computed<ChildNode[]>(() => {\n const slotContent = slots.default?.() ?? [];\n\n const tabs = getChildrenTabs(slotContent);\n\n const currentModelValue = get(internalModelValue);\n const inheritedProps = {\n color,\n grow,\n disabled,\n vertical,\n align,\n indicatorPosition,\n };\n\n return tabs.map((tab, index) => {\n let tabValue = tab.props?.value ?? index;\n if (tab.props?.link !== false && tab.props?.to)\n tabValue = tab.props.to;\n\n const active = currentModelValue === tabValue;\n return {\n ...tab,\n props: {\n value: tabValue,\n active,\n ...inheritedProps,\n ...tab.props,\n },\n };\n });\n});\n\n// When using dynamic content with v-for the slot content can contain fragment,\n// Go through the fragment and always return RuiTab only\nfunction getChildrenTabs(children: VNode[]): VNode[] {\n return children.flatMap((item) => {\n if (item.type === Fragment && Array.isArray(item.children) && item.children.length > 0)\n return getChildrenTabs(item.children.filter(isVNode));\n\n return [item];\n }).flat();\n}\n\nfunction updateModelValue(newModelValue: string | number): void {\n set(modelValue, newModelValue);\n set(internalModelValue, newModelValue);\n}\n\nfunction getTabRouteProps(props: Record<string, unknown>): ResolvedTabProps {\n return {\n value: typeof props.value === 'string' || typeof props.value === 'number' ? props.value : undefined,\n to: props.to ?? undefined,\n link: typeof props.link === 'boolean' ? props.link : undefined,\n exact: typeof props.exact === 'boolean' ? props.exact : undefined,\n exactPath: typeof props.exactPath === 'boolean' ? props.exactPath : undefined,\n };\n}\n\nfunction resolveActiveValue(onlyLink: boolean): string | number | undefined {\n const enabledChildren = get(children).filter(child => !child.props?.disabled);\n if (enabledChildren.length === 0)\n return undefined;\n\n let result: string | number = get(modelValue) || 0;\n enabledChildren.forEach((child, index) => {\n const tabProps = getTabRouteProps(child.props);\n if (!onlyLink && index === 0 && tabProps.value)\n result = tabProps.value;\n\n const fullPath = resolveRoute(tabProps.to);\n\n if (tabProps.link !== false && fullPath && isPathMatch(fullPath, tabProps))\n result = fullPath;\n });\n return result;\n}\n\nfunction applyNewValue(onlyLink = false): void {\n const value = resolveActiveValue(onlyLink);\n if (value !== undefined)\n updateModelValue(value);\n\n keepActiveTabVisible();\n}\n\nwatchImmediate(() => get(modelValue), (modelValue) => {\n set(internalModelValue, modelValue);\n});\n\nwatch(internalModelValue, () => {\n keepActiveTabVisible();\n});\n\nonMounted(() => {\n if (get(modelValue) !== undefined)\n return;\n\n applyNewValue();\n});\n</script>\n\n<template>\n <div\n :class=\"ui.root()\"\n :data-vertical=\"vertical || undefined\"\n >\n <div\n v-if=\"showArrows\"\n :class=\"ui.arrow()\"\n >\n <RuiButton\n class=\"w-full h-full !rounded-none\"\n variant=\"text\"\n :color=\"color\"\n :disabled=\"prevArrowDisabled\"\n @click=\"onPrevSliderClick()\"\n >\n <RuiIcon :name=\"vertical ? 'lu-chevron-up' : 'lu-chevron-left'\" />\n </RuiButton>\n </div>\n <div\n ref=\"bar\"\n :class=\"ui.bar()\"\n >\n <div\n ref=\"wrapper\"\n role=\"tablist\"\n data-id=\"tabs-wrapper\"\n :class=\"ui.wrapper()\"\n >\n <Component\n :is=\"child\"\n v-for=\"(child, i) in children\"\n :key=\"i\"\n @click=\"updateModelValue($event)\"\n />\n </div>\n </div>\n <div\n v-if=\"showArrows\"\n :class=\"ui.arrow()\"\n >\n <RuiButton\n class=\"w-full h-full !rounded-none\"\n variant=\"text\"\n :color=\"color\"\n :disabled=\"nextArrowDisabled\"\n @click=\"onNextSliderClick()\"\n >\n <RuiIcon :name=\"vertical ? 'lu-chevron-down' : 'lu-chevron-right'\" />\n </RuiButton>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqCA,MAAM,aAAa,SAA4B,SAAA,YAAe;EAW9D,MAAM,qBAAqB,IAAqB;EAChD,MAAM,MAAM,eAA+B,KAAK;EAChD,MAAM,UAAU,eAA+B,SAAS;EAExD,MAAM,OAAO,GAAG;GACd,OAAO;IACL,MAAM;IACN,OAAO;IACP,KAAK;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AA;KACV,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,iBAAA,CAAiB,CAAA;;4BAE4C,CAArE,YAAqE,iBAAA,EAA3D,MAAM,QAAA,WAAQ,oBAAA,mBAAA,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-tab-routing.js","names":[],"sources":["../../../../src/components/tabs/tabs/use-tab-routing.ts"],"sourcesContent":["import type { RouteMatchOptions } from '@/components/tabs/tab-props';\nimport { type RouteLocationRaw, useRoute, useRouter } from 'vue-router';\n\ninterface UseTabRoutingOptions {\n /** Callback invoked when the route changes, to re-sync the active tab */\n onRouteChange: () => void;\n}\n\ninterface UseTabRoutingReturn {\n /** Whether vue-router is available in the app context */\n hasRouter: boolean;\n /**\n * Resolves a route location and returns its full path, or undefined\n * if the router is not available or the value is not a valid route location.\n */\n resolveRoute: (to: unknown) => string | undefined;\n /**\n * Checks whether a given path matches the current route.\n * Supports exact path, exact route, and prefix matching.\n */\n isPathMatch: (path: string, options: RouteMatchOptions) => boolean;\n}\n\nexport function isRouteLocation(value: unknown): value is RouteLocationRaw {\n return typeof value === 'string' || (typeof value === 'object' && value !== null);\n}\n\n/**\n * Composable that manages vue-router integration for the RuiTabs component.\n * Provides route resolution and path matching utilities, and watches for\n * route changes to notify the parent component.\n */\nexport function useTabRouting({ onRouteChange }: UseTabRoutingOptions): UseTabRoutingReturn {\n const hasRouter = getCurrentInstance()?.appContext.config.globalProperties.$router !== undefined;\n\n if (!hasRouter) {\n return {\n hasRouter,\n resolveRoute: () => undefined,\n isPathMatch: () => false,\n };\n }\n\n const route = useRoute();\n const router = useRouter();\n\n function resolveRoute(to: unknown): string | undefined {\n if (!isRouteLocation(to))\n return undefined;\n\n return router.resolve(to).fullPath;\n }\n\n function isPathMatch(\n path: string,\n { exactPath, exact }: RouteMatchOptions,\n ): boolean {\n const currentRoute = route.fullPath;\n\n if (exactPath)\n return currentRoute === path;\n\n const base = typeof window !== 'undefined' ? window.location.origin : 'http://localhost';\n const routeWithoutQueryParams = new URL(path, base).pathname;\n\n if (exact)\n return currentRoute === routeWithoutQueryParams;\n\n return currentRoute.startsWith(routeWithoutQueryParams);\n }\n\n watch(route, onRouteChange);\n\n return {\n hasRouter,\n resolveRoute,\n isPathMatch,\n };\n}\n"],"mappings":";;;AAuBA,SAAgB,gBAAgB,OAA2C;
|
|
1
|
+
{"version":3,"file":"use-tab-routing.js","names":[],"sources":["../../../../src/components/tabs/tabs/use-tab-routing.ts"],"sourcesContent":["import type { RouteMatchOptions } from '@/components/tabs/tab-props';\nimport { type RouteLocationRaw, useRoute, useRouter } from 'vue-router';\n\ninterface UseTabRoutingOptions {\n /** Callback invoked when the route changes, to re-sync the active tab */\n onRouteChange: () => void;\n}\n\ninterface UseTabRoutingReturn {\n /** Whether vue-router is available in the app context */\n hasRouter: boolean;\n /**\n * Resolves a route location and returns its full path, or undefined\n * if the router is not available or the value is not a valid route location.\n */\n resolveRoute: (to: unknown) => string | undefined;\n /**\n * Checks whether a given path matches the current route.\n * Supports exact path, exact route, and prefix matching.\n */\n isPathMatch: (path: string, options: RouteMatchOptions) => boolean;\n}\n\nexport function isRouteLocation(value: unknown): value is RouteLocationRaw {\n return typeof value === 'string' || (typeof value === 'object' && value !== null);\n}\n\n/**\n * Composable that manages vue-router integration for the RuiTabs component.\n * Provides route resolution and path matching utilities, and watches for\n * route changes to notify the parent component.\n */\nexport function useTabRouting({ onRouteChange }: UseTabRoutingOptions): UseTabRoutingReturn {\n const hasRouter = getCurrentInstance()?.appContext.config.globalProperties.$router !== undefined;\n\n if (!hasRouter) {\n return {\n hasRouter,\n resolveRoute: () => undefined,\n isPathMatch: () => false,\n };\n }\n\n const route = useRoute();\n const router = useRouter();\n\n function resolveRoute(to: unknown): string | undefined {\n if (!isRouteLocation(to))\n return undefined;\n\n return router.resolve(to).fullPath;\n }\n\n function isPathMatch(\n path: string,\n { exactPath, exact }: RouteMatchOptions,\n ): boolean {\n const currentRoute = route.fullPath;\n\n if (exactPath)\n return currentRoute === path;\n\n const base = typeof window !== 'undefined' ? window.location.origin : 'http://localhost';\n const routeWithoutQueryParams = new URL(path, base).pathname;\n\n if (exact)\n return currentRoute === routeWithoutQueryParams;\n\n return currentRoute.startsWith(routeWithoutQueryParams);\n }\n\n watch(route, onRouteChange);\n\n return {\n hasRouter,\n resolveRoute,\n isPathMatch,\n };\n}\n"],"mappings":";;;AAuBA,SAAgB,gBAAgB,OAA2C;CACzE,OAAO,OAAO,UAAU,YAAa,OAAO,UAAU,YAAY,UAAU;AAC9E;;;;;;AAOA,SAAgB,cAAc,EAAE,iBAA4D;CAC1F,MAAM,YAAY,mBAAmB,CAAC,EAAE,WAAW,OAAO,iBAAiB,YAAY,KAAA;CAEvF,IAAI,CAAC,WACH,OAAO;EACL;EACA,oBAAoB,KAAA;EACpB,mBAAmB;CACrB;CAGF,MAAM,QAAQ,SAAS;CACvB,MAAM,SAAS,UAAU;CAEzB,SAAS,aAAa,IAAiC;EACrD,IAAI,CAAC,gBAAgB,EAAE,GACrB,OAAO,KAAA;EAET,OAAO,OAAO,QAAQ,EAAE,CAAC,CAAC;CAC5B;CAEA,SAAS,YACP,MACA,EAAE,WAAW,SACJ;EACT,MAAM,eAAe,MAAM;EAE3B,IAAI,WACF,OAAO,iBAAiB;EAE1B,MAAM,OAAO,OAAO,WAAW,cAAc,OAAO,SAAS,SAAS;EACtE,MAAM,0BAA0B,IAAI,IAAI,MAAM,IAAI,CAAC,CAAC;EAEpD,IAAI,OACF,OAAO,iBAAiB;EAE1B,OAAO,aAAa,WAAW,uBAAuB;CACxD;CAEA,MAAM,OAAO,aAAa;CAE1B,OAAO;EACL;EACA;EACA;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-tab-scroll.js","names":[],"sources":["../../../../src/components/tabs/tabs/use-tab-scroll.ts"],"sourcesContent":["import type { ComputedRef, MaybeRefOrGetter, Ref, ShallowRef } from 'vue';\n\ninterface UseTabScrollOptions {\n /** The scrollable bar container element */\n bar: Readonly<ShallowRef<HTMLDivElement | null>>;\n /** The wrapper element containing the tab buttons */\n wrapper: Readonly<ShallowRef<HTMLDivElement | null>>;\n /** Getter for the current vertical orientation state */\n vertical: MaybeRefOrGetter<boolean>;\n}\n\ninterface UseTabScrollReturn {\n showArrows: Readonly<Ref<boolean>>;\n prevArrowDisabled: ComputedRef<boolean>;\n nextArrowDisabled: ComputedRef<boolean>;\n onPrevSliderClick: () => void;\n onNextSliderClick: () => void;\n keepActiveTabVisible: () => void;\n}\n\n/**\n * Composable that manages tab scroll behavior, overflow arrow visibility,\n * and active tab auto-scrolling for the RuiTabs component.\n */\nexport function useTabScroll({ bar, wrapper, vertical }: UseTabScrollOptions): UseTabScrollReturn {\n const showArrows = shallowRef<boolean>(false);\n\n const { width: barWidth, height: barHeight } = useElementSize(bar);\n const { arrivedState, x, y } = useScroll(bar, { behavior: 'smooth' });\n const { top, bottom, left, right } = toRefs(arrivedState);\n\n function checkOverflow(): void {\n const elem = get(wrapper);\n const barElem = get(bar);\n if (!elem || !barElem) {\n set(showArrows, false);\n return;\n }\n\n const overflows = toValue(vertical)\n ? elem.scrollHeight > barElem.offsetHeight\n : elem.scrollWidth > barElem.offsetWidth;\n\n set(showArrows, overflows);\n }\n\n useResizeObserver(bar, checkOverflow);\n useResizeObserver(wrapper, () => {\n checkOverflow();\n keepActiveTabVisible();\n });\n\n const prevArrowDisabled = computed<boolean>(() => toValue(vertical) ? get(top) : get(left));\n\n const nextArrowDisabled = computed<boolean>(() => toValue(vertical) ? get(bottom) : get(right));\n\n function scrollToActiveTab(): void {\n if (!get(showArrows))\n return;\n\n const elem = get(wrapper);\n const barElem = get(bar);\n\n if (!elem || !barElem)\n return;\n\n const activeTab = elem.querySelector<HTMLElement>('[data-active-tab]');\n\n if (!activeTab)\n return;\n\n const childLeft = activeTab.offsetLeft - elem.offsetLeft;\n const childTop = activeTab.offsetTop - elem.offsetTop;\n\n barElem.scrollTo({\n left: Math.max(Math.min(barElem.scrollLeft, childLeft), childLeft + activeTab.offsetWidth - barElem.offsetWidth),\n top: Math.max(Math.min(barElem.scrollTop, childTop), childTop + activeTab.offsetHeight - barElem.offsetHeight),\n behavior: 'smooth',\n });\n }\n\n function keepActiveTabVisible(): void {\n nextTick(scrollToActiveTab);\n }\n\n function onPrevSliderClick(): void {\n if (!toValue(vertical))\n set(x, get(x) - get(barWidth));\n else\n set(y, get(y) - get(barHeight));\n }\n\n function onNextSliderClick(): void {\n if (!toValue(vertical))\n set(x, get(x) + get(barWidth));\n else\n set(y, get(y) + get(barHeight));\n }\n\n return {\n showArrows: readonly(showArrows),\n prevArrowDisabled,\n nextArrowDisabled,\n onPrevSliderClick,\n onNextSliderClick,\n keepActiveTabVisible,\n };\n}\n"],"mappings":";;;;;;;;AAwBA,SAAgB,aAAa,EAAE,KAAK,SAAS,YAAqD;CAChG,MAAM,aAAa,WAAoB,
|
|
1
|
+
{"version":3,"file":"use-tab-scroll.js","names":[],"sources":["../../../../src/components/tabs/tabs/use-tab-scroll.ts"],"sourcesContent":["import type { ComputedRef, MaybeRefOrGetter, Ref, ShallowRef } from 'vue';\n\ninterface UseTabScrollOptions {\n /** The scrollable bar container element */\n bar: Readonly<ShallowRef<HTMLDivElement | null>>;\n /** The wrapper element containing the tab buttons */\n wrapper: Readonly<ShallowRef<HTMLDivElement | null>>;\n /** Getter for the current vertical orientation state */\n vertical: MaybeRefOrGetter<boolean>;\n}\n\ninterface UseTabScrollReturn {\n showArrows: Readonly<Ref<boolean>>;\n prevArrowDisabled: ComputedRef<boolean>;\n nextArrowDisabled: ComputedRef<boolean>;\n onPrevSliderClick: () => void;\n onNextSliderClick: () => void;\n keepActiveTabVisible: () => void;\n}\n\n/**\n * Composable that manages tab scroll behavior, overflow arrow visibility,\n * and active tab auto-scrolling for the RuiTabs component.\n */\nexport function useTabScroll({ bar, wrapper, vertical }: UseTabScrollOptions): UseTabScrollReturn {\n const showArrows = shallowRef<boolean>(false);\n\n const { width: barWidth, height: barHeight } = useElementSize(bar);\n const { arrivedState, x, y } = useScroll(bar, { behavior: 'smooth' });\n const { top, bottom, left, right } = toRefs(arrivedState);\n\n function checkOverflow(): void {\n const elem = get(wrapper);\n const barElem = get(bar);\n if (!elem || !barElem) {\n set(showArrows, false);\n return;\n }\n\n const overflows = toValue(vertical)\n ? elem.scrollHeight > barElem.offsetHeight\n : elem.scrollWidth > barElem.offsetWidth;\n\n set(showArrows, overflows);\n }\n\n useResizeObserver(bar, checkOverflow);\n useResizeObserver(wrapper, () => {\n checkOverflow();\n keepActiveTabVisible();\n });\n\n const prevArrowDisabled = computed<boolean>(() => toValue(vertical) ? get(top) : get(left));\n\n const nextArrowDisabled = computed<boolean>(() => toValue(vertical) ? get(bottom) : get(right));\n\n function scrollToActiveTab(): void {\n if (!get(showArrows))\n return;\n\n const elem = get(wrapper);\n const barElem = get(bar);\n\n if (!elem || !barElem)\n return;\n\n const activeTab = elem.querySelector<HTMLElement>('[data-active-tab]');\n\n if (!activeTab)\n return;\n\n const childLeft = activeTab.offsetLeft - elem.offsetLeft;\n const childTop = activeTab.offsetTop - elem.offsetTop;\n\n barElem.scrollTo({\n left: Math.max(Math.min(barElem.scrollLeft, childLeft), childLeft + activeTab.offsetWidth - barElem.offsetWidth),\n top: Math.max(Math.min(barElem.scrollTop, childTop), childTop + activeTab.offsetHeight - barElem.offsetHeight),\n behavior: 'smooth',\n });\n }\n\n function keepActiveTabVisible(): void {\n nextTick(scrollToActiveTab);\n }\n\n function onPrevSliderClick(): void {\n if (!toValue(vertical))\n set(x, get(x) - get(barWidth));\n else\n set(y, get(y) - get(barHeight));\n }\n\n function onNextSliderClick(): void {\n if (!toValue(vertical))\n set(x, get(x) + get(barWidth));\n else\n set(y, get(y) + get(barHeight));\n }\n\n return {\n showArrows: readonly(showArrows),\n prevArrowDisabled,\n nextArrowDisabled,\n onPrevSliderClick,\n onNextSliderClick,\n keepActiveTabVisible,\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AI,QAAQ,WAAW,QAAQ,GAAG,WAAW,UAAU,eAAe,QAAQ,YAAY;GAC7G,UAAU;EACZ,CAAC;CACH;CAEA,SAAS,uBAA6B;EACpC,SAAS,iBAAiB;CAC5B;CAEA,SAAS,oBAA0B;EACjC,IAAI,CAAC,QAAQ,QAAQ,GACnB,MAAI,GAAG,MAAI,CAAC,IAAI,MAAI,QAAQ,CAAC;OAE7B,MAAI,GAAG,MAAI,CAAC,IAAI,MAAI,SAAS,CAAC;CAClC;CAEA,SAAS,oBAA0B;EACjC,IAAI,CAAC,QAAQ,QAAQ,GACnB,MAAI,GAAG,MAAI,CAAC,IAAI,MAAI,QAAQ,CAAC;OAE7B,MAAI,GAAG,MAAI,CAAC,IAAI,MAAI,SAAS,CAAC;CAClC;CAEA,OAAO;EACL,YAAY,SAAS,UAAU;EAC/B;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
@@ -19,9 +19,9 @@ var _hoisted_5 = ["aria-label"];
|
|
|
19
19
|
var _hoisted_6 = ["aria-selected", "onClick"];
|
|
20
20
|
var FULL_CIRCLE = 360;
|
|
21
21
|
var TWELVE_HOURS = 12;
|
|
22
|
-
var RuiTimePicker_vue_vue_type_script_setup_true_lang_default =
|
|
22
|
+
var RuiTimePicker_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
23
23
|
__name: "RuiTimePicker",
|
|
24
|
-
props:
|
|
24
|
+
props: /*@__PURE__*/ mergeModels({
|
|
25
25
|
accuracy: { default: () => TimeAccuracy.MINUTE },
|
|
26
26
|
borderless: {
|
|
27
27
|
type: Boolean,
|