@leaflink/stash 44.0.0-beta.6 → 44.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +107 -39
- package/dist/ActionsDropdown.js +2 -2
- package/dist/ActionsDropdown.js.map +1 -1
- package/dist/AddressSelect.js +2 -2
- package/dist/AppNavigationItem.js +1 -1
- package/dist/AppSidebar.js +13 -13
- package/dist/AppSidebar.js.map +1 -1
- package/dist/Badge.vue.d.ts +1 -1
- package/dist/Button.js +1 -1
- package/dist/Button.js.map +1 -1
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-63d31dc0.js +17 -0
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-63d31dc0.js.map +1 -0
- package/dist/ButtonGroup.js +19 -19
- package/dist/ButtonGroup.js.map +1 -1
- package/dist/Carousel.js +258 -246
- package/dist/Carousel.js.map +1 -1
- package/dist/Checkbox.js +57 -46
- package/dist/Checkbox.js.map +1 -1
- package/dist/Checkbox.vue.d.ts +2 -0
- package/dist/Checkbox.vue_used_vue_type_style_index_0_lang.module-fa8d9c06.js +9 -0
- package/dist/Checkbox.vue_used_vue_type_style_index_0_lang.module-fa8d9c06.js.map +1 -0
- package/dist/ChevronToggle.js +1 -1
- package/dist/Copy.js +1 -1
- package/dist/CurrencyInput.js +2 -2
- package/dist/DataView.js +1 -1
- package/dist/DataViewFilters.js +4 -4
- package/dist/DataViewSortButton.js +47 -38
- package/dist/DataViewSortButton.js.map +1 -1
- package/dist/DataViewToolbar.js +2 -2
- package/dist/DatePicker.js +9 -9
- package/dist/DatePicker.js.map +1 -1
- package/dist/DescriptionListTerm.js +1 -1
- package/dist/DescriptionListTerm.js.map +1 -1
- package/dist/Dialog.js +33 -33
- package/dist/Dialog.js.map +1 -1
- package/dist/Divider.js +4 -4
- package/dist/Divider.js.map +1 -1
- package/dist/Expand.js +1 -1
- package/dist/{Expand.vue_vue_type_script_setup_true_lang-5fe03d51.js → Expand.vue_vue_type_script_setup_true_lang-1751f4a6.js} +14 -15
- package/dist/Expand.vue_vue_type_script_setup_true_lang-1751f4a6.js.map +1 -0
- package/dist/Field.js +2 -2
- package/dist/Field.vue.d.ts +1 -1
- package/dist/{Field.vue_vue_type_script_setup_true_lang-4483019d.js → Field.vue_vue_type_script_setup_true_lang-42ba3c5a.js} +2 -2
- package/dist/Field.vue_vue_type_script_setup_true_lang-42ba3c5a.js.map +1 -0
- package/dist/FileUpload.js +7 -7
- package/dist/FileUpload.js.map +1 -1
- package/dist/FilterChip.js +30 -30
- package/dist/FilterChip.js.map +1 -1
- package/dist/FilterDropdown.js +2 -2
- package/dist/FilterSelect.js +27 -27
- package/dist/FilterSelect.js.map +1 -1
- package/dist/Filters.js +39 -39
- package/dist/Filters.js.map +1 -1
- package/dist/HttpError.js +6 -6
- package/dist/IconLabel.js +6 -6
- package/dist/IconLabel.js.map +1 -1
- package/dist/IconLabel.vue.d.ts +1 -1
- package/dist/Illustration.js +10 -60
- package/dist/Illustration.js.map +1 -1
- package/dist/Illustration.vue_vue_type_script_setup_true_lang-d6a94e17.js +56 -0
- package/dist/Illustration.vue_vue_type_script_setup_true_lang-d6a94e17.js.map +1 -0
- package/dist/Image.js +67 -72
- package/dist/Image.js.map +1 -1
- package/dist/InlineEdit.js +2 -2
- package/dist/Input.js +53 -53
- package/dist/Input.js.map +1 -1
- package/dist/InputOptions.js +2 -2
- package/dist/Label.js +1 -1
- package/dist/Label.vue.d.ts +13 -2
- package/dist/{Label.vue_vue_type_script_setup_true_lang-2de35913.js → Label.vue_vue_type_script_setup_true_lang-4b02087f.js} +12 -11
- package/dist/Label.vue_vue_type_script_setup_true_lang-4b02087f.js.map +1 -0
- package/dist/ListItem.js +11 -11
- package/dist/ListItem.js.map +1 -1
- package/dist/ListItemCell.js +9 -9
- package/dist/ListItemCell.js.map +1 -1
- package/dist/ListView.js +55 -52
- package/dist/ListView.js.map +1 -1
- package/dist/Loading.js +17 -10
- package/dist/Loading.js.map +1 -1
- package/dist/Loading.vue_used_vue_type_style_index_0_lang.module-ef5a3bc6.js +8 -0
- package/dist/Loading.vue_used_vue_type_style_index_0_lang.module-ef5a3bc6.js.map +1 -0
- package/dist/MenuItem.js +20 -14
- package/dist/MenuItem.js.map +1 -1
- package/dist/Modal.js +2 -2
- package/dist/Modal.js.map +1 -1
- package/dist/ObfuscateText.js +30 -32
- package/dist/ObfuscateText.js.map +1 -1
- package/dist/ObfuscateText.vue.d.ts +1 -1
- package/dist/PageContent.js +9 -9
- package/dist/PageContent.js.map +1 -1
- package/dist/PageHeader.js +22 -22
- package/dist/PageHeader.js.map +1 -1
- package/dist/PageNavigation.js +3 -3
- package/dist/PageNavigation.js.map +1 -1
- package/dist/Paginate.js +1 -1
- package/dist/Paginate.js.map +1 -1
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-18343da7.js +11 -0
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-18343da7.js.map +1 -0
- package/dist/QuickAction.js +22 -19
- package/dist/QuickAction.js.map +1 -1
- package/dist/Radio.js +30 -15
- package/dist/Radio.js.map +1 -1
- package/dist/RadioGroup.js +135 -106
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioNew.js +118 -91
- package/dist/RadioNew.js.map +1 -1
- package/dist/SearchBar.js +32 -32
- package/dist/SearchBar.js.map +1 -1
- package/dist/Select.js +7 -7
- package/dist/Select.js.map +1 -1
- package/dist/SelectStatus.js +2 -2
- package/dist/Switch.js +41 -34
- package/dist/Switch.js.map +1 -1
- package/dist/Tab.js +2 -2
- package/dist/{Tab.vue_vue_type_script_setup_true_lang-4a40f015.js → Tab.vue_vue_type_script_setup_true_lang-69d1b046.js} +2 -2
- package/dist/{Tab.vue_vue_type_script_setup_true_lang-4a40f015.js.map → Tab.vue_vue_type_script_setup_true_lang-69d1b046.js.map} +1 -1
- package/dist/Table.js +6 -6
- package/dist/Table.keys-cf93df19.js +27 -0
- package/dist/{Table.keys-1ebe4ecb.js.map → Table.keys-cf93df19.js.map} +1 -1
- package/dist/TableCell.js +5 -5
- package/dist/TableCell.js.map +1 -1
- package/dist/TableHeaderCell.js +32 -32
- package/dist/TableHeaderCell.js.map +1 -1
- package/dist/TableHeaderRow.js +10 -10
- package/dist/TableHeaderRow.js.map +1 -1
- package/dist/TableRow.js +42 -41
- package/dist/TableRow.js.map +1 -1
- package/dist/Tabs.js +2 -2
- package/dist/{Tabs.vue_used_vue_type_style_index_0_lang.module-0af1e1cf.js → Tabs.vue_used_vue_type_style_index_0_lang.module-2a131332.js} +25 -25
- package/dist/Tabs.vue_used_vue_type_style_index_0_lang.module-2a131332.js.map +1 -0
- package/dist/Textarea.js +49 -41
- package/dist/Textarea.js.map +1 -1
- package/dist/Toast.js +23 -23
- package/dist/Toast.js.map +1 -1
- package/dist/components.css +1 -1
- package/dist/constants.d.ts +26 -19
- package/dist/constants.js +41 -26
- package/dist/constants.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/tailwind-base.d.ts +16 -16
- package/dist/tailwind-base.js +16 -6
- package/dist/tailwind-base.js.map +1 -1
- package/package.json +2 -2
- package/styles/backwards-compat.css +41 -104
- package/styles/base.css +258 -112
- package/tailwind-base.ts +6 -1
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-b2ee90e6.js +0 -17
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-b2ee90e6.js.map +0 -1
- package/dist/Checkbox.vue_vue_type_style_index_0_scoped_dbd26d7f_lang-4ed993c7.js +0 -2
- package/dist/Checkbox.vue_vue_type_style_index_0_scoped_dbd26d7f_lang-4ed993c7.js.map +0 -1
- package/dist/Expand.vue_vue_type_script_setup_true_lang-5fe03d51.js.map +0 -1
- package/dist/Field.vue_vue_type_script_setup_true_lang-4483019d.js.map +0 -1
- package/dist/Label.vue_vue_type_script_setup_true_lang-2de35913.js.map +0 -1
- package/dist/Loading.vue_vue_type_style_index_0_scoped_bb8d5f15_lang-4ed993c7.js +0 -2
- package/dist/Loading.vue_vue_type_style_index_0_scoped_bb8d5f15_lang-4ed993c7.js.map +0 -1
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-1a2084f9.js +0 -11
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-1a2084f9.js.map +0 -1
- package/dist/Table.keys-1ebe4ecb.js +0 -27
- package/dist/Tabs.vue_used_vue_type_style_index_0_lang.module-0af1e1cf.js.map +0 -1
- package/styles/_base.scss +0 -493
- package/styles/elements/_links.scss +0 -32
- package/styles/elements/_lists.scss +0 -31
- package/styles/elements/_misc.scss +0 -16
- package/styles/main.scss +0 -38
package/dist/Modal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sources":["../src/components/Modal/Modal.types.ts","../src/components/Modal/Modal.vue"],"sourcesContent":["export enum ModalSize {\n Narrow = 'narrow',\n Medium = 'medium',\n Wide = 'wide',\n}\n\nexport type ModalSizes = `${ModalSize}`;\n\nexport enum ModalPosition {\n Center = 'center',\n Left = 'left',\n Right = 'right',\n}\n\nexport type ModalPositions = `${ModalPosition}`;\n","<script lang=\"ts\">\n import { ModalPositions, ModalSizes } from './Modal.types';\n\n export * from './Modal.types';\n\n export interface ModalProps {\n /**\n * Hides the \"close\" button\n */\n hideClose?: boolean;\n\n /**\n * Opens the modal when truthy; hides the modal when falsy.\n * @deprecated Use `isOpen` instead\n */\n open?: boolean;\n\n /**\n * Opens the modal when truthy; hides the modal when falsy.\n */\n isOpen?: boolean;\n\n /**\n * Use v-model:is-open or :is-open instead of :model-value and v-model.\n * @deprecated\n */\n modelValue?: boolean;\n\n /**\n * Sets a preset max-width on the modal.\n * Options: default (648px), narrow (360px), wide (960px)\n */\n size?: ModalSizes;\n\n /**\n * Should the modal be scrollable within the content area. This prop is treated as `true` when the `position` prop is set to \"left\" or \"right\".\n */\n scrollable?: boolean;\n\n /**\n * Gives the modal body have a light gray background\n */\n contrast?: boolean;\n\n /**\n * Text to display in the modal header\n */\n title?: string;\n\n /**\n * Disables the default padding in the modal body.\n */\n disableBodyPadding?: boolean;\n\n /**\n * The position on the screen to display the modal.\n */\n position?: ModalPositions;\n\n /**\n * Hide the header. Typically used with the featuredContent slot to display a graphic and create a \"promo\" modal.\n */\n hideHeader?: boolean;\n\n /**\n * Add classes to the close button. This can be used with the hideHeader prop and featuredContent slot to\n * accommodate images with different color backgrounds.\n */\n closeButtonColorClass?: string;\n }\n</script>\n\n<script setup lang=\"ts\">\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, onBeforeUnmount, ref, useSlots, watch } from 'vue';\n\n import { FOCUS_ELEMENTS_SELECTOR } from '../../constants';\n import { t } from '../../locale';\n import Backdrop from '../Backdrop/Backdrop.vue';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({ name: 'll-modal' });\n\n const props = withDefaults(defineProps<ModalProps>(), {\n hideClose: false,\n open: false,\n isOpen: false,\n modelValue: false,\n size: 'medium',\n scrollable: false,\n contrast: false,\n title: '',\n position: 'center',\n hideHeader: false,\n closeButtonColorClass: 'tw-text-white/50',\n });\n\n const emit =\n defineEmits<{\n /**\n * @deprecated Use the `update:is-open` event instead\n */\n (e: 'update:open', isOpen?: boolean): void;\n (e: 'update:is-open', isOpen?: boolean): void;\n (e: 'dismiss'): void;\n }>();\n\n const slots = useSlots();\n\n const rootRef = ref<HTMLElement>();\n const lastExternalFocusedElement = ref<HTMLElement>();\n const focusElements = ref<HTMLElement[]>([]);\n const firstFocusElement = ref<HTMLElement>();\n const lastFocusElement = ref<HTMLElement>();\n const initialPageScrollingElementStyle = ref({ height: '', overflow: '' });\n const headerId = uniqueId('modal-header-');\n const hasFooterContent = computed(() => !!slots.actions || !!slots.footer);\n const isModalOpen = computed(() => props.open || props.isOpen);\n const isDrawer = computed(() => props.position === 'left' || props.position === 'right');\n\n function getPageScrollingElement() {\n return (document.scrollingElement || document.body) as HTMLElement;\n }\n\n watch(\n isModalOpen,\n () => {\n if (isModalOpen.value) {\n Object.assign(initialPageScrollingElementStyle.value, {\n height: getPageScrollingElement().style.height,\n overflow: getPageScrollingElement().style.overflow,\n });\n }\n\n Object.assign(getPageScrollingElement().style, {\n overflow: isModalOpen.value ? 'hidden' : initialPageScrollingElementStyle.value.overflow, // Prevents page from scrolling when modal is open\n height: isModalOpen.value ? '100%' : initialPageScrollingElementStyle.value.height, // Ensures the backdrop covers the entire page when modal is open; see https://github.com/LeafLink/stash/pull/713#issuecomment-1184602535\n });\n },\n { immediate: true },\n );\n\n onBeforeUnmount(() => {\n // In cases where the watchEffect for isModalOpen isn't triggered while closing/nagivating away from modal, this ensures scrolling returns to normal\n Object.assign(getPageScrollingElement().style, {\n overflow: initialPageScrollingElementStyle.value.overflow,\n height: initialPageScrollingElementStyle.value.height,\n });\n\n // Clear focus trap tab listener\n document.removeEventListener('keydown', handleTab);\n lastExternalFocusedElement.value?.focus();\n });\n\n function dismiss() {\n emit('update:open', false);\n emit('update:is-open', false);\n emit('dismiss');\n }\n\n // This watcher ensures the Tab key cycles through focusable elements within the modal.\n watch(rootRef, () => {\n if (!rootRef.value) {\n return;\n }\n\n lastExternalFocusedElement.value = document.activeElement as HTMLElement;\n rootRef.value.focus();\n\n focusElements.value = Array.from(rootRef.value.querySelectorAll<HTMLElement>(FOCUS_ELEMENTS_SELECTOR));\n firstFocusElement.value = focusElements.value[0];\n lastFocusElement.value = focusElements.value[focusElements.value.length - 1];\n document.addEventListener('keydown', handleTab);\n });\n\n function handleTab(e) {\n if (e.key === 'Tab') {\n if (e.shiftKey && document.activeElement === firstFocusElement.value) {\n lastFocusElement.value?.focus();\n e.preventDefault();\n } else if (document.activeElement === lastFocusElement.value) {\n firstFocusElement.value?.focus();\n e.preventDefault();\n }\n }\n }\n</script>\n\n<template>\n <div\n v-if=\"isModalOpen\"\n ref=\"rootRef\"\n class=\"stash-modal tw-fixed tw-inset-0 tw-overflow-y-auto\"\n :class=\"{\n 'tw-invisible tw-z-behind': !isModalOpen,\n 'tw-visible tw-z-modal': isModalOpen,\n 'lg:tw-flex lg:tw-flex-col lg:tw-items-center lg:tw-justify-center': props.position === 'center',\n }\"\n data-test=\"ll-modal\"\n tabindex=\"0\"\n @keydown.esc=\"dismiss\"\n >\n <Backdrop class=\"stash-modal__backdrop\" @click.stop=\"dismiss\" />\n <div\n aria-modal=\"true\"\n role=\"dialog\"\n :aria-labelledby=\"headerId\"\n class=\"stash-modal__dialog tw-relative tw-flex tw-h-screen tw-w-full tw-flex-col lg:tw-shadow\"\n :class=\"[\n `stash-modal__dialog--size-${props.size}`,\n `stash-modal__dialog--position-${props.position}`,\n {\n 'stash-modal__dialog--is-open': isModalOpen,\n 'stash-modal__dialog--is-drawer': isDrawer,\n 'stash-modal__dialog--is-contrast': props.contrast,\n 'stash-modal__dialog--is-scrollable': props.scrollable,\n 'lg:tw-w-[360px]': props.size === 'narrow',\n 'lg:tw-w-[648px]': props.size === 'medium',\n 'lg:tw-w-[960px]': props.size === 'wide',\n 'lg:tw-my-0 lg:tw-h-auto lg:tw-max-h-[90vh]': props.position === 'center',\n 'lg:tw-absolute lg:tw-h-screen': isDrawer,\n 'lg:tw-left-0': props.position === 'left',\n 'lg:tw-right-0': props.position === 'right',\n },\n ]\"\n @click.stop\n >\n <header\n v-if=\"!props.hideHeader\"\n data-test=\"stash-modal__header\"\n class=\"stash-modal__header tw-grid tw-h-12 tw-place-items-center tw-bg-purple-500\"\n :class=\"{ 'lg:tw-rounded-t': !isDrawer }\"\n >\n <div class=\"tw-flex tw-place-items-center\">\n <!-- @slot Adds an action to the left side of the header bar. An example usage is a modal with multiple pages and a back button can be inserted here -->\n <slot name=\"headerAction\"></slot>\n </div>\n\n <h3 v-if=\"props.title\" :id=\"headerId\" class=\"tw-m-0 tw-flex-1 tw-leading-6 tw-text-white\">\n {{ props.title }}\n </h3>\n\n <Button\n v-if=\"!props.hideClose\"\n icon\n data-test=\"ll-modal-close\"\n :title=\"t('ll.closeModal')\"\n type=\"button\"\n @click=\"dismiss\"\n >\n <Icon class=\"tw-text-white\" name=\"close\" />\n </Button>\n </header>\n\n <Button\n v-if=\"!props.hideClose && props.hideHeader\"\n class=\"tw-absolute tw-right-0 tw-top-0 tw-z-10\"\n icon\n data-test=\"ll-modal-close\"\n type=\"button\"\n :title=\"t('ll.closeModal')\"\n @click=\"dismiss\"\n >\n <Icon class=\"tw-drop-shadow-md\" name=\"close\" :class=\"[props.closeButtonColorClass]\" />\n </Button>\n\n <div\n v-if=\"!!slots['featured-content']\"\n class=\"stash-modal__featured-content tw-relative\"\n :class=\"{\n 'tw-rounded-t': props.hideHeader,\n }\"\n >\n <slot name=\"featured-content\"></slot>\n </div>\n\n <div\n class=\"stash-modal__body tw-flex-1 tw-overflow-y-auto\"\n :class=\"[\n {\n 'tw-p-3 lg:tw-p-6': !props.disableBodyPadding,\n 'lg:tw-overflow-y-visible': !props.scrollable && !isDrawer,\n 'lg:tw-rounded-b': !hasFooterContent && !isDrawer,\n 'tw-bg-white': !props.contrast,\n 'tw-bg-ice-200': props.contrast,\n },\n ]\"\n data-test=\"stash-modal__body\"\n >\n <slot></slot>\n </div>\n\n <footer\n v-if=\"hasFooterContent\"\n class=\"stash-modal__footer tw-border-ice-500 tw-bg-ice-100 tw-p-3 lg:tw-p-6\"\n :class=\"{ 'lg:tw-rounded-b': !isDrawer }\"\n >\n <!-- @slot Overrides the whole footer section. Used for rendering custom footers with more than 2 actions. If defined, \"actions\" slot will get ignored. -->\n <slot name=\"footer\">\n <div class=\"stash-modal__footer__actions tw-flex tw-flex-col tw-justify-end lg:tw-flex-row\">\n <!-- @slot Modal footer actions, supports rendering up to 2 `<Button>` children -->\n <slot name=\"actions\"></slot>\n </div>\n </slot>\n </footer>\n </div>\n </div>\n</template>\n\n<style scoped>\n .stash-modal__header {\n grid-template-columns: 48px 1fr 48px;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(1) {\n order: 2;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(2) {\n margin-bottom: var(--ll-space-2);\n order: 1;\n }\n\n @media screen and (width >= 961px) {\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(1) {\n order: 1;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(2) {\n margin-bottom: 0;\n order: 2;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button + .stash-button) {\n margin-left: var(--grid-gutter);\n }\n }\n\n .stash-modal__featured-content > :deep(*) {\n border-radius: inherit;\n }\n</style>\n"],"names":["ModalSize","ModalPosition","slots","useSlots","rootRef","ref","lastExternalFocusedElement","focusElements","firstFocusElement","lastFocusElement","initialPageScrollingElementStyle","headerId","uniqueId","hasFooterContent","computed","isModalOpen","props","isDrawer","getPageScrollingElement","watch","onBeforeUnmount","handleTab","_a","dismiss","emit","FOCUS_ELEMENTS_SELECTOR","e","_b"],"mappings":";;;;;;;;;;;;AAAY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,OAAO,QAHGA,IAAAA,KAAA,CAAA,CAAA,GAQAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,OAAO,QACPA,EAAA,QAAQ,SAHEA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;iBCoGJC,IAAQC,KAERC,IAAUC,KACVC,IAA6BD,KAC7BE,IAAgBF,EAAmB,CAAA,CAAE,GACrCG,IAAoBH,KACpBI,IAAmBJ,KACnBK,IAAmCL,EAAI,EAAE,QAAQ,IAAI,UAAU,IAAI,GACnEM,IAAWC,EAAS,eAAe,GACnCC,IAAmBC,EAAS,MAAM,CAAC,CAACZ,EAAM,WAAW,CAAC,CAACA,EAAM,MAAM,GACnEa,IAAcD,EAAS,MAAME,EAAM,QAAQA,EAAM,MAAM,GACvDC,IAAWH,EAAS,MAAME,EAAM,aAAa,UAAUA,EAAM,aAAa,OAAO;AAEvF,aAASE,IAA0B;AACzB,aAAA,SAAS,oBAAoB,SAAS;AAAA,IAChD;AAEA,IAAAC;AAAA,MACEJ;AAAA,MACA,MAAM;AACJ,QAAIA,EAAY,SACP,OAAA,OAAOL,EAAiC,OAAO;AAAA,UACpD,QAAQQ,IAA0B,MAAM;AAAA,UACxC,UAAUA,IAA0B,MAAM;AAAA,QAAA,CAC3C,GAGI,OAAA,OAAOA,EAAwB,EAAE,OAAO;AAAA,UAC7C,UAAUH,EAAY,QAAQ,WAAWL,EAAiC,MAAM;AAAA;AAAA,UAChF,QAAQK,EAAY,QAAQ,SAASL,EAAiC,MAAM;AAAA;AAAA,QAAA,CAC7E;AAAA,MACH;AAAA,MACA,EAAE,WAAW,GAAK;AAAA,IAAA,GAGpBU,EAAgB,MAAM;;AAEb,aAAA,OAAOF,EAAwB,EAAE,OAAO;AAAA,QAC7C,UAAUR,EAAiC,MAAM;AAAA,QACjD,QAAQA,EAAiC,MAAM;AAAA,MAAA,CAChD,GAGQ,SAAA,oBAAoB,WAAWW,CAAS,IACjDC,IAAAhB,EAA2B,UAA3B,QAAAgB,EAAkC;AAAA,IAAM,CACzC;AAED,aAASC,IAAU;AACjB,MAAAC,EAAK,eAAe,EAAK,GACzBA,EAAK,kBAAkB,EAAK,GAC5BA,EAAK,SAAS;AAAA,IAChB;AAGA,IAAAL,EAAMf,GAAS,MAAM;AACf,MAACA,EAAQ,UAIbE,EAA2B,QAAQ,SAAS,eAC5CF,EAAQ,MAAM,SAEdG,EAAc,QAAQ,MAAM,KAAKH,EAAQ,MAAM,iBAA8BqB,CAAuB,CAAC,GACnFjB,EAAA,QAAQD,EAAc,MAAM,CAAC,GAC/CE,EAAiB,QAAQF,EAAc,MAAMA,EAAc,MAAM,SAAS,CAAC,GAClE,SAAA,iBAAiB,WAAWc,CAAS;AAAA,IAAA,CAC/C;AAED,aAASA,EAAUK,GAAG;;AAChB,MAAAA,EAAE,QAAQ,UACRA,EAAE,YAAY,SAAS,kBAAkBlB,EAAkB,UAC7Dc,IAAAb,EAAiB,UAAjB,QAAAa,EAAwB,SACxBI,EAAE,eAAe,KACR,SAAS,kBAAkBjB,EAAiB,WACrDkB,IAAAnB,EAAkB,UAAlB,QAAAmB,EAAyB,SACzBD,EAAE,eAAe;AAAA,IAGvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Modal.js","sources":["../src/components/Modal/Modal.types.ts","../src/components/Modal/Modal.vue"],"sourcesContent":["export enum ModalSize {\n Narrow = 'narrow',\n Medium = 'medium',\n Wide = 'wide',\n}\n\nexport type ModalSizes = `${ModalSize}`;\n\nexport enum ModalPosition {\n Center = 'center',\n Left = 'left',\n Right = 'right',\n}\n\nexport type ModalPositions = `${ModalPosition}`;\n","<script lang=\"ts\">\n import { ModalPositions, ModalSizes } from './Modal.types';\n\n export * from './Modal.types';\n\n export interface ModalProps {\n /**\n * Hides the \"close\" button\n */\n hideClose?: boolean;\n\n /**\n * Opens the modal when truthy; hides the modal when falsy.\n * @deprecated Use `isOpen` instead\n */\n open?: boolean;\n\n /**\n * Opens the modal when truthy; hides the modal when falsy.\n */\n isOpen?: boolean;\n\n /**\n * Use v-model:is-open or :is-open instead of :model-value and v-model.\n * @deprecated\n */\n modelValue?: boolean;\n\n /**\n * Sets a preset max-width on the modal.\n * Options: default (648px), narrow (360px), wide (960px)\n */\n size?: ModalSizes;\n\n /**\n * Should the modal be scrollable within the content area. This prop is treated as `true` when the `position` prop is set to \"left\" or \"right\".\n */\n scrollable?: boolean;\n\n /**\n * Gives the modal body have a light gray background\n */\n contrast?: boolean;\n\n /**\n * Text to display in the modal header\n */\n title?: string;\n\n /**\n * Disables the default padding in the modal body.\n */\n disableBodyPadding?: boolean;\n\n /**\n * The position on the screen to display the modal.\n */\n position?: ModalPositions;\n\n /**\n * Hide the header. Typically used with the featuredContent slot to display a graphic and create a \"promo\" modal.\n */\n hideHeader?: boolean;\n\n /**\n * Add classes to the close button. This can be used with the hideHeader prop and featuredContent slot to\n * accommodate images with different color backgrounds.\n */\n closeButtonColorClass?: string;\n }\n</script>\n\n<script setup lang=\"ts\">\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, onBeforeUnmount, ref, useSlots, watch } from 'vue';\n\n import { FOCUS_ELEMENTS_SELECTOR } from '../../constants';\n import { t } from '../../locale';\n import Backdrop from '../Backdrop/Backdrop.vue';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({ name: 'll-modal' });\n\n const props = withDefaults(defineProps<ModalProps>(), {\n hideClose: false,\n open: false,\n isOpen: false,\n modelValue: false,\n size: 'medium',\n scrollable: false,\n contrast: false,\n title: '',\n position: 'center',\n hideHeader: false,\n closeButtonColorClass: 'tw-text-white/50',\n });\n\n const emit =\n defineEmits<{\n /**\n * @deprecated Use the `update:is-open` event instead\n */\n (e: 'update:open', isOpen?: boolean): void;\n (e: 'update:is-open', isOpen?: boolean): void;\n (e: 'dismiss'): void;\n }>();\n\n const slots = useSlots();\n\n const rootRef = ref<HTMLElement>();\n const lastExternalFocusedElement = ref<HTMLElement>();\n const focusElements = ref<HTMLElement[]>([]);\n const firstFocusElement = ref<HTMLElement>();\n const lastFocusElement = ref<HTMLElement>();\n const initialPageScrollingElementStyle = ref({ height: '', overflow: '' });\n const headerId = uniqueId('modal-header-');\n const hasFooterContent = computed(() => !!slots.actions || !!slots.footer);\n const isModalOpen = computed(() => props.open || props.isOpen);\n const isDrawer = computed(() => props.position === 'left' || props.position === 'right');\n\n function getPageScrollingElement() {\n return (document.scrollingElement || document.body) as HTMLElement;\n }\n\n watch(\n isModalOpen,\n () => {\n if (isModalOpen.value) {\n Object.assign(initialPageScrollingElementStyle.value, {\n height: getPageScrollingElement().style.height,\n overflow: getPageScrollingElement().style.overflow,\n });\n }\n\n Object.assign(getPageScrollingElement().style, {\n overflow: isModalOpen.value ? 'hidden' : initialPageScrollingElementStyle.value.overflow, // Prevents page from scrolling when modal is open\n height: isModalOpen.value ? '100%' : initialPageScrollingElementStyle.value.height, // Ensures the backdrop covers the entire page when modal is open; see https://github.com/LeafLink/stash/pull/713#issuecomment-1184602535\n });\n },\n { immediate: true },\n );\n\n onBeforeUnmount(() => {\n // In cases where the watchEffect for isModalOpen isn't triggered while closing/nagivating away from modal, this ensures scrolling returns to normal\n Object.assign(getPageScrollingElement().style, {\n overflow: initialPageScrollingElementStyle.value.overflow,\n height: initialPageScrollingElementStyle.value.height,\n });\n\n // Clear focus trap tab listener\n document.removeEventListener('keydown', handleTab);\n lastExternalFocusedElement.value?.focus();\n });\n\n function dismiss() {\n emit('update:open', false);\n emit('update:is-open', false);\n emit('dismiss');\n }\n\n // This watcher ensures the Tab key cycles through focusable elements within the modal.\n watch(rootRef, () => {\n if (!rootRef.value) {\n return;\n }\n\n lastExternalFocusedElement.value = document.activeElement as HTMLElement;\n rootRef.value.focus();\n\n focusElements.value = Array.from(rootRef.value.querySelectorAll<HTMLElement>(FOCUS_ELEMENTS_SELECTOR));\n firstFocusElement.value = focusElements.value[0];\n lastFocusElement.value = focusElements.value[focusElements.value.length - 1];\n document.addEventListener('keydown', handleTab);\n });\n\n function handleTab(e) {\n if (e.key === 'Tab') {\n if (e.shiftKey && document.activeElement === firstFocusElement.value) {\n lastFocusElement.value?.focus();\n e.preventDefault();\n } else if (document.activeElement === lastFocusElement.value) {\n firstFocusElement.value?.focus();\n e.preventDefault();\n }\n }\n }\n</script>\n\n<template>\n <div\n v-if=\"isModalOpen\"\n ref=\"rootRef\"\n class=\"stash-modal tw-fixed tw-inset-0 tw-overflow-y-auto\"\n :class=\"{\n 'tw-invisible tw-z-behind': !isModalOpen,\n 'tw-visible tw-z-modal': isModalOpen,\n 'lg:tw-flex lg:tw-flex-col lg:tw-items-center lg:tw-justify-center': props.position === 'center',\n }\"\n data-test=\"ll-modal\"\n tabindex=\"0\"\n @keydown.esc=\"dismiss\"\n >\n <Backdrop class=\"stash-modal__backdrop\" @click.stop=\"dismiss\" />\n <div\n aria-modal=\"true\"\n role=\"dialog\"\n :aria-labelledby=\"headerId\"\n class=\"stash-modal__dialog tw-relative tw-flex tw-h-screen tw-w-full tw-flex-col lg:tw-shadow\"\n :class=\"[\n `stash-modal__dialog--size-${props.size}`,\n `stash-modal__dialog--position-${props.position}`,\n {\n 'stash-modal__dialog--is-open': isModalOpen,\n 'stash-modal__dialog--is-drawer': isDrawer,\n 'stash-modal__dialog--is-contrast': props.contrast,\n 'stash-modal__dialog--is-scrollable': props.scrollable,\n 'lg:tw-w-[360px]': props.size === 'narrow',\n 'lg:tw-w-[648px]': props.size === 'medium',\n 'lg:tw-w-[960px]': props.size === 'wide',\n 'lg:tw-my-0 lg:tw-h-auto lg:tw-max-h-[90vh]': props.position === 'center',\n 'lg:tw-absolute lg:tw-h-screen': isDrawer,\n 'lg:tw-left-0': props.position === 'left',\n 'lg:tw-right-0': props.position === 'right',\n },\n ]\"\n @click.stop\n >\n <header\n v-if=\"!props.hideHeader\"\n data-test=\"stash-modal__header\"\n class=\"stash-modal__header tw-grid tw-h-12 tw-place-items-center tw-bg-purple-500\"\n :class=\"{ 'lg:tw-rounded-t': !isDrawer }\"\n >\n <div class=\"tw-flex tw-place-items-center\">\n <!-- @slot Adds an action to the left side of the header bar. An example usage is a modal with multiple pages and a back button can be inserted here -->\n <slot name=\"headerAction\"></slot>\n </div>\n\n <h3 v-if=\"props.title\" :id=\"headerId\" class=\"tw-m-0 tw-flex-1 tw-leading-6 tw-text-white\">\n {{ props.title }}\n </h3>\n\n <Button\n v-if=\"!props.hideClose\"\n icon\n data-test=\"ll-modal-close\"\n :title=\"t('ll.closeModal')\"\n type=\"button\"\n @click=\"dismiss\"\n >\n <Icon class=\"tw-text-white\" name=\"close\" />\n </Button>\n </header>\n\n <Button\n v-if=\"!props.hideClose && props.hideHeader\"\n class=\"tw-absolute tw-right-0 tw-top-0 tw-z-10\"\n icon\n data-test=\"ll-modal-close\"\n type=\"button\"\n :title=\"t('ll.closeModal')\"\n @click=\"dismiss\"\n >\n <Icon class=\"tw-drop-shadow-md\" name=\"close\" :class=\"[props.closeButtonColorClass]\" />\n </Button>\n\n <div\n v-if=\"!!slots['featured-content']\"\n class=\"stash-modal__featured-content tw-relative\"\n :class=\"{\n 'tw-rounded-t': props.hideHeader,\n }\"\n >\n <slot name=\"featured-content\"></slot>\n </div>\n\n <div\n class=\"stash-modal__body tw-flex-1 tw-overflow-y-auto\"\n :class=\"[\n {\n 'tw-p-3 lg:tw-p-6': !props.disableBodyPadding,\n 'lg:tw-overflow-y-visible': !props.scrollable && !isDrawer,\n 'lg:tw-rounded-b': !hasFooterContent && !isDrawer,\n 'tw-bg-white': !props.contrast,\n 'tw-bg-ice-200': props.contrast,\n },\n ]\"\n data-test=\"stash-modal__body\"\n >\n <slot></slot>\n </div>\n\n <footer\n v-if=\"hasFooterContent\"\n class=\"stash-modal__footer tw-border-ice-500 tw-bg-ice-100 tw-p-3 lg:tw-p-6\"\n :class=\"{ 'lg:tw-rounded-b': !isDrawer }\"\n >\n <!-- @slot Overrides the whole footer section. Used for rendering custom footers with more than 2 actions. If defined, \"actions\" slot will get ignored. -->\n <slot name=\"footer\">\n <div class=\"stash-modal__footer__actions tw-flex tw-flex-col tw-justify-end lg:tw-flex-row\">\n <!-- @slot Modal footer actions, supports rendering up to 2 `<Button>` children -->\n <slot name=\"actions\"></slot>\n </div>\n </slot>\n </footer>\n </div>\n </div>\n</template>\n\n<style scoped>\n .stash-modal__header {\n grid-template-columns: 48px 1fr 48px;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(1) {\n order: 2;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(2) {\n margin-bottom: theme('spacing.3');\n order: 1;\n }\n\n @media screen('lg') {\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(1) {\n order: 1;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(2) {\n margin-bottom: 0;\n order: 2;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button + .stash-button) {\n margin-left: var(--grid-gutter);\n }\n }\n\n .stash-modal__featured-content > :deep(*) {\n border-radius: inherit;\n }\n</style>\n"],"names":["ModalSize","ModalPosition","slots","useSlots","rootRef","ref","lastExternalFocusedElement","focusElements","firstFocusElement","lastFocusElement","initialPageScrollingElementStyle","headerId","uniqueId","hasFooterContent","computed","isModalOpen","props","isDrawer","getPageScrollingElement","watch","onBeforeUnmount","handleTab","_a","dismiss","emit","FOCUS_ELEMENTS_SELECTOR","e","_b"],"mappings":";;;;;;;;;;;;AAAY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,OAAO,QAHGA,IAAAA,KAAA,CAAA,CAAA,GAQAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,OAAO,QACPA,EAAA,QAAQ,SAHEA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;iBCoGJC,IAAQC,KAERC,IAAUC,KACVC,IAA6BD,KAC7BE,IAAgBF,EAAmB,CAAA,CAAE,GACrCG,IAAoBH,KACpBI,IAAmBJ,KACnBK,IAAmCL,EAAI,EAAE,QAAQ,IAAI,UAAU,IAAI,GACnEM,IAAWC,EAAS,eAAe,GACnCC,IAAmBC,EAAS,MAAM,CAAC,CAACZ,EAAM,WAAW,CAAC,CAACA,EAAM,MAAM,GACnEa,IAAcD,EAAS,MAAME,EAAM,QAAQA,EAAM,MAAM,GACvDC,IAAWH,EAAS,MAAME,EAAM,aAAa,UAAUA,EAAM,aAAa,OAAO;AAEvF,aAASE,IAA0B;AACzB,aAAA,SAAS,oBAAoB,SAAS;AAAA,IAChD;AAEA,IAAAC;AAAA,MACEJ;AAAA,MACA,MAAM;AACJ,QAAIA,EAAY,SACP,OAAA,OAAOL,EAAiC,OAAO;AAAA,UACpD,QAAQQ,IAA0B,MAAM;AAAA,UACxC,UAAUA,IAA0B,MAAM;AAAA,QAAA,CAC3C,GAGI,OAAA,OAAOA,EAAwB,EAAE,OAAO;AAAA,UAC7C,UAAUH,EAAY,QAAQ,WAAWL,EAAiC,MAAM;AAAA;AAAA,UAChF,QAAQK,EAAY,QAAQ,SAASL,EAAiC,MAAM;AAAA;AAAA,QAAA,CAC7E;AAAA,MACH;AAAA,MACA,EAAE,WAAW,GAAK;AAAA,IAAA,GAGpBU,EAAgB,MAAM;;AAEb,aAAA,OAAOF,EAAwB,EAAE,OAAO;AAAA,QAC7C,UAAUR,EAAiC,MAAM;AAAA,QACjD,QAAQA,EAAiC,MAAM;AAAA,MAAA,CAChD,GAGQ,SAAA,oBAAoB,WAAWW,CAAS,IACjDC,IAAAhB,EAA2B,UAA3B,QAAAgB,EAAkC;AAAA,IAAM,CACzC;AAED,aAASC,IAAU;AACjB,MAAAC,EAAK,eAAe,EAAK,GACzBA,EAAK,kBAAkB,EAAK,GAC5BA,EAAK,SAAS;AAAA,IAChB;AAGA,IAAAL,EAAMf,GAAS,MAAM;AACf,MAACA,EAAQ,UAIbE,EAA2B,QAAQ,SAAS,eAC5CF,EAAQ,MAAM,SAEdG,EAAc,QAAQ,MAAM,KAAKH,EAAQ,MAAM,iBAA8BqB,CAAuB,CAAC,GACnFjB,EAAA,QAAQD,EAAc,MAAM,CAAC,GAC/CE,EAAiB,QAAQF,EAAc,MAAMA,EAAc,MAAM,SAAS,CAAC,GAClE,SAAA,iBAAiB,WAAWc,CAAS;AAAA,IAAA,CAC/C;AAED,aAASA,EAAUK,GAAG;;AAChB,MAAAA,EAAE,QAAQ,UACRA,EAAE,YAAY,SAAS,kBAAkBlB,EAAkB,UAC7Dc,IAAAb,EAAiB,UAAjB,QAAAa,EAAwB,SACxBI,EAAE,eAAe,KACR,SAAS,kBAAkBjB,EAAiB,WACrDkB,IAAAnB,EAAkB,UAAlB,QAAAmB,EAAyB,SACzBD,EAAE,eAAe;AAAA,IAGvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/ObfuscateText.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import "./
|
|
1
|
+
import { defineComponent as r, ref as u, computed as c, openBlock as s, createElementBlock as i, createTextVNode as p, toDisplayString as f, createBlock as h, withCtx as m, createVNode as d, normalizeClass as g, createCommentVNode as x } from "vue";
|
|
2
|
+
import C from "./Button.js";
|
|
3
|
+
import b from "./Icon.js";
|
|
4
|
+
import "./Button.vue_used_vue_type_style_index_0_lang.module-63d31dc0.js";
|
|
5
|
+
import "./_plugin-vue_export-helper-dad06003.js";
|
|
6
6
|
import "lodash-es/uniqueId";
|
|
7
7
|
import "./index-79ce320f.js";
|
|
8
8
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
9
|
-
const
|
|
9
|
+
const k = {
|
|
10
|
+
class: "stash-obfuscate-text",
|
|
11
|
+
"data-test": "stash-obfuscate-text"
|
|
12
|
+
}, A = /* @__PURE__ */ r({
|
|
10
13
|
name: "ll-obfuscate-text",
|
|
11
14
|
__name: "ObfuscateText",
|
|
12
15
|
props: {
|
|
@@ -18,42 +21,37 @@ const N = /* @__PURE__ */ g({
|
|
|
18
21
|
obfuscateAll: { type: Boolean, default: !1 },
|
|
19
22
|
showToggle: { type: Boolean, default: !1 }
|
|
20
23
|
},
|
|
21
|
-
setup(
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return l.repeat(n);
|
|
24
|
+
setup(l) {
|
|
25
|
+
const t = l, e = u(!1), n = c(() => {
|
|
26
|
+
if (t.showToggle && e.value)
|
|
27
|
+
return t.text;
|
|
28
|
+
if (t.obfuscateAll || !t.lengthToKeep)
|
|
29
|
+
return t.maskChar.repeat(t.maskCharCount);
|
|
28
30
|
let o;
|
|
29
|
-
return
|
|
31
|
+
return t.position === "end" ? (o = t.text.substring(0, t.lengthToKeep), o + t.maskChar.repeat(t.maskCharCount)) : (o = t.text.substring(t.text.length - t.lengthToKeep), t.maskChar.repeat(t.maskCharCount) + o);
|
|
30
32
|
});
|
|
31
|
-
return (
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
return (o, a) => (s(), i("span", k, [
|
|
34
|
+
p(f(n.value) + " ", 1),
|
|
35
|
+
o.showToggle ? (s(), h(C, {
|
|
34
36
|
key: 0,
|
|
35
|
-
class:
|
|
37
|
+
class: "tw-ml-1 tw-h-auto tw-w-auto tw-p-0",
|
|
36
38
|
icon: "",
|
|
37
39
|
type: "button",
|
|
38
|
-
onClick:
|
|
40
|
+
onClick: a[0] || (a[0] = (w) => e.value = !e.value)
|
|
39
41
|
}, {
|
|
40
|
-
default:
|
|
41
|
-
|
|
42
|
-
name:
|
|
43
|
-
class: "tw-cursor-pointer",
|
|
44
|
-
"data-test":
|
|
45
|
-
}, null, 8, ["name", "data-test"])
|
|
42
|
+
default: m(() => [
|
|
43
|
+
d(b, {
|
|
44
|
+
name: e.value ? "hide" : "show",
|
|
45
|
+
class: g(["tw-cursor-pointer", e.value ? "stash-obfuscate-text__hide-toggle-icon" : "stash-obfuscate-text__show-toggle-icon"]),
|
|
46
|
+
"data-test": e.value ? "stash-obfuscate-text|hide-toggle-icon" : "stash-obfuscate-text|show-toggle-icon"
|
|
47
|
+
}, null, 8, ["name", "class", "data-test"])
|
|
46
48
|
]),
|
|
47
49
|
_: 1
|
|
48
|
-
}
|
|
50
|
+
})) : x("", !0)
|
|
49
51
|
]));
|
|
50
52
|
}
|
|
51
|
-
})
|
|
52
|
-
"obfuscation-toggle-button": "_obfuscation-toggle-button_16egb_2"
|
|
53
|
-
}, O = {
|
|
54
|
-
$style: A
|
|
55
|
-
}, q = /* @__PURE__ */ M(N, [["__cssModules", O]]);
|
|
53
|
+
});
|
|
56
54
|
export {
|
|
57
|
-
|
|
55
|
+
A as default
|
|
58
56
|
};
|
|
59
57
|
//# sourceMappingURL=ObfuscateText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObfuscateText.js","sources":["../src/components/ObfuscateText/ObfuscateText.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref
|
|
1
|
+
{"version":3,"file":"ObfuscateText.js","sources":["../src/components/ObfuscateText/ObfuscateText.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref } from 'vue';\n\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({ name: 'll-obfuscate-text' });\n\n export interface ObfuscateTextProps {\n /**\n * The full text\n */\n text: string;\n\n /**\n * Character to obfuscate text with\n */\n maskChar?: string;\n\n /**\n * The number of masked characters to display\n */\n maskCharCount?: number;\n\n /**\n * Num of characters to keep revealed.\n * Default will obfuscate entire string\n * with length of maskCharCount.\n */\n lengthToKeep?: number;\n\n /**\n * Position to start obfuscating text\n */\n position?: 'start' | 'end';\n\n /**\n * Whether to obfuscate all characters.\n * @deprecated omit the lengthToKeep prop to achieve the same result\n */\n obfuscateAll?: boolean;\n\n /**\n * Displays a button for toggling text visibility\n */\n showToggle?: boolean;\n }\n\n const isFullTextVisible = ref(false);\n\n const props = withDefaults(defineProps<ObfuscateTextProps>(), {\n maskChar: '•',\n maskCharCount: 10,\n lengthToKeep: 0,\n position: 'start',\n obfuscateAll: false,\n showToggle: false,\n });\n\n const obfuscatedText = computed(() => {\n if (props.showToggle && isFullTextVisible.value) {\n return props.text;\n }\n\n if (props.obfuscateAll || !props.lengthToKeep) {\n return props.maskChar.repeat(props.maskCharCount);\n }\n\n let charsToKeep;\n\n if (props.position === 'end') {\n charsToKeep = props.text.substring(0, props.lengthToKeep);\n\n return charsToKeep + props.maskChar.repeat(props.maskCharCount);\n } else {\n charsToKeep = props.text.substring(props.text.length - props.lengthToKeep);\n\n return props.maskChar.repeat(props.maskCharCount) + charsToKeep;\n }\n });\n</script>\n\n<template>\n <span class=\"stash-obfuscate-text\" data-test=\"stash-obfuscate-text\">\n {{ obfuscatedText }}\n <Button\n v-if=\"showToggle\"\n class=\"tw-ml-1 tw-h-auto tw-w-auto tw-p-0\"\n icon\n type=\"button\"\n @click=\"isFullTextVisible = !isFullTextVisible\"\n >\n <Icon\n :name=\"isFullTextVisible ? 'hide' : 'show'\"\n class=\"tw-cursor-pointer\"\n :class=\"isFullTextVisible ? 'stash-obfuscate-text__hide-toggle-icon' : 'stash-obfuscate-text__show-toggle-icon'\"\n :data-test=\"\n isFullTextVisible ? 'stash-obfuscate-text|hide-toggle-icon' : 'stash-obfuscate-text|show-toggle-icon'\n \"\n />\n </Button>\n </span>\n</template>\n"],"names":["isFullTextVisible","ref","obfuscatedText","computed","props","charsToKeep"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;iBAgDQA,IAAoBC,EAAI,EAAK,GAW7BC,IAAiBC,EAAS,MAAM;AAChC,UAAAC,EAAM,cAAcJ,EAAkB;AACxC,eAAOI,EAAM;AAGf,UAAIA,EAAM,gBAAgB,CAACA,EAAM;AAC/B,eAAOA,EAAM,SAAS,OAAOA,EAAM,aAAa;AAG9C,UAAAC;AAEA,aAAAD,EAAM,aAAa,SACrBC,IAAcD,EAAM,KAAK,UAAU,GAAGA,EAAM,YAAY,GAEjDC,IAAcD,EAAM,SAAS,OAAOA,EAAM,aAAa,MAE9DC,IAAcD,EAAM,KAAK,UAAUA,EAAM,KAAK,SAASA,EAAM,YAAY,GAElEA,EAAM,SAAS,OAAOA,EAAM,aAAa,IAAIC;AAAA,IACtD,CACD;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -75,7 +75,7 @@ export declare interface ObfuscateTextProps {
|
|
|
75
75
|
*/
|
|
76
76
|
position?: 'start' | 'end';
|
|
77
77
|
/**
|
|
78
|
-
* Whether
|
|
78
|
+
* Whether to obfuscate all characters.
|
|
79
79
|
* @deprecated omit the lengthToKeep prop to achieve the same result
|
|
80
80
|
*/
|
|
81
81
|
obfuscateAll?: boolean;
|
package/dist/PageContent.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as l, useSlots as d, useCssModule as c, openBlock as n, createElementBlock as r, normalizeClass as _, unref as e, createElementVNode as i, renderSlot as a, createCommentVNode as m } from "vue";
|
|
2
2
|
import { _ as u } from "./_plugin-vue_export-helper-dad06003.js";
|
|
3
|
-
const p = { key: 0 }, g = /* @__PURE__ */
|
|
3
|
+
const p = { key: 0 }, g = /* @__PURE__ */ l({
|
|
4
4
|
name: "ll-page-content",
|
|
5
5
|
__name: "PageContent",
|
|
6
|
-
setup(
|
|
7
|
-
const s = d(), t =
|
|
8
|
-
return (o,
|
|
6
|
+
setup(y) {
|
|
7
|
+
const s = d(), t = c();
|
|
8
|
+
return (o, M) => (n(), r("div", {
|
|
9
9
|
class: _(["stash-page-content", [
|
|
10
10
|
e(t).root,
|
|
11
11
|
{
|
|
@@ -23,14 +23,14 @@ const p = { key: 0 }, g = /* @__PURE__ */ c({
|
|
|
23
23
|
])) : m("", !0)
|
|
24
24
|
], 2));
|
|
25
25
|
}
|
|
26
|
-
}), b = "
|
|
26
|
+
}), b = "_root_r9enl_2", f = "_grid_r9enl_10", C = "_sidebar_r9enl_17", h = {
|
|
27
27
|
root: b,
|
|
28
28
|
grid: f,
|
|
29
29
|
sidebar: C
|
|
30
|
-
},
|
|
30
|
+
}, k = {
|
|
31
31
|
$style: h
|
|
32
|
-
},
|
|
32
|
+
}, B = /* @__PURE__ */ u(g, [["__cssModules", k]]);
|
|
33
33
|
export {
|
|
34
|
-
|
|
34
|
+
B as default
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=PageContent.js.map
|
package/dist/PageContent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageContent.js","sources":["../src/components/PageContent/PageContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { useCssModule, useSlots } from 'vue';\n\n defineOptions({\n name: 'll-page-content',\n });\n\n const slots = useSlots();\n const classes = useCssModule();\n</script>\n\n<template>\n <div\n class=\"stash-page-content\"\n :class=\"[\n classes.root,\n {\n [classes.grid]: !!slots.sidebar,\n [classes.sidebar]: !!slots.sidebar,\n },\n ]\"\n date-test=\"stash-page-content\"\n >\n <div>\n <!-- @slot Default content -->\n <slot name=\"default\"></slot>\n </div>\n\n <aside v-if=\"!!slots.sidebar\">\n <!-- @slot Sidebar content -->\n <slot name=\"sidebar\"></slot>\n </aside>\n </div>\n</template>\n\n<style module>\n .root {\n max-width: theme(width.container); /* 1400px */\n padding-inline:
|
|
1
|
+
{"version":3,"file":"PageContent.js","sources":["../src/components/PageContent/PageContent.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { useCssModule, useSlots } from 'vue';\n\n defineOptions({\n name: 'll-page-content',\n });\n\n const slots = useSlots();\n const classes = useCssModule();\n</script>\n\n<template>\n <div\n class=\"stash-page-content\"\n :class=\"[\n classes.root,\n {\n [classes.grid]: !!slots.sidebar,\n [classes.sidebar]: !!slots.sidebar,\n },\n ]\"\n date-test=\"stash-page-content\"\n >\n <div>\n <!-- @slot Default content -->\n <slot name=\"default\"></slot>\n </div>\n\n <aside v-if=\"!!slots.sidebar\">\n <!-- @slot Sidebar content -->\n <slot name=\"sidebar\"></slot>\n </aside>\n </div>\n</template>\n\n<style module>\n .root {\n max-width: theme('width.container'); /* 1400px */\n padding-inline: var(--grid-gutter);\n position: relative;\n margin-inline: auto;\n width: 100%;\n }\n\n .grid {\n display: grid;\n grid-gap: var(--grid-gutter);\n grid-template-columns: [start] 1fr [end];\n }\n\n @media screen('lg') {\n .sidebar {\n grid-template-columns: [start] 3fr 1fr [end]; /* 9 cols / 3 cols */\n }\n }\n</style>\n"],"names":["slots","useSlots","classes","useCssModule"],"mappings":";;;;;;AAOE,UAAMA,IAAQC,KACRC,IAAUC;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/PageHeader.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as g, useCssModule as h, useSlots as u, computed as f, openBlock as a, createElementBlock as c, normalizeClass as n, unref as s, createElementVNode as l, renderSlot as t, createCommentVNode as i, toDisplayString as _ } from "vue";
|
|
2
2
|
import { _ as w } from "./_plugin-vue_export-helper-dad06003.js";
|
|
3
3
|
const y = { class: "tw-col-span-full tw-flex tw-items-center lg:tw-col-span-1" }, v = { class: "stash-page-header__title tw-my-0" }, $ = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "stash-page-header__description tw-mb-0 tw-mt-1.5"
|
|
6
|
-
},
|
|
6
|
+
}, k = /* @__PURE__ */ g({
|
|
7
7
|
name: "ll-page-header",
|
|
8
8
|
__name: "PageHeader",
|
|
9
9
|
props: {
|
|
@@ -11,45 +11,45 @@ const y = { class: "tw-col-span-full tw-flex tw-items-center lg:tw-col-span-1" }
|
|
|
11
11
|
description: { default: "" }
|
|
12
12
|
},
|
|
13
13
|
setup(m) {
|
|
14
|
-
const d = m, o =
|
|
15
|
-
return (e,
|
|
16
|
-
class:
|
|
14
|
+
const d = m, o = h(), r = u(), p = f(() => !!(r["primary-action"] || r["secondary-action"]));
|
|
15
|
+
return (e, H) => (a(), c("header", {
|
|
16
|
+
class: n(["stash-page-header", [s(o).root, { [s(o).grid]: p.value }]]),
|
|
17
17
|
"date-test": "stash-page-header"
|
|
18
18
|
}, [
|
|
19
|
-
|
|
20
|
-
s(
|
|
19
|
+
l("div", y, [
|
|
20
|
+
s(r).media ? (a(), c("div", {
|
|
21
21
|
key: 0,
|
|
22
|
-
class:
|
|
22
|
+
class: n(["stash-page-header__media tw-mr-3 tw-self-center", s(o).mediaTest])
|
|
23
23
|
}, [
|
|
24
24
|
t(e.$slots, "media")
|
|
25
25
|
], 2)) : i("", !0),
|
|
26
|
-
|
|
26
|
+
l("div", null, [
|
|
27
27
|
t(e.$slots, "title", {}, () => [
|
|
28
|
-
|
|
28
|
+
l("h1", v, _(d.title), 1)
|
|
29
29
|
]),
|
|
30
30
|
t(e.$slots, "description", {}, () => [
|
|
31
|
-
e.description ? (a(),
|
|
31
|
+
e.description ? (a(), c("p", $, _(d.description), 1)) : i("", !0)
|
|
32
32
|
])
|
|
33
33
|
])
|
|
34
34
|
]),
|
|
35
|
-
p.value ? (a(),
|
|
35
|
+
p.value ? (a(), c("div", {
|
|
36
36
|
key: 0,
|
|
37
|
-
class:
|
|
37
|
+
class: n(["stash-page-header__actions tw-col-span-full tw-flex lg:tw-col-span-1", s(o).actions])
|
|
38
38
|
}, [
|
|
39
39
|
t(e.$slots, "secondary-action"),
|
|
40
40
|
t(e.$slots, "primary-action")
|
|
41
41
|
], 2)) : i("", !0)
|
|
42
42
|
], 2));
|
|
43
43
|
}
|
|
44
|
-
}),
|
|
45
|
-
root:
|
|
46
|
-
grid:
|
|
47
|
-
actions:
|
|
48
|
-
"media-test": "_media-
|
|
49
|
-
},
|
|
50
|
-
$style:
|
|
51
|
-
},
|
|
44
|
+
}), C = "_root_1gg6c_2", M = "_grid_1gg6c_13", S = "_actions_1gg6c_18", B = {
|
|
45
|
+
root: C,
|
|
46
|
+
grid: M,
|
|
47
|
+
actions: S,
|
|
48
|
+
"media-test": "_media-test_1gg6c_41"
|
|
49
|
+
}, E = {
|
|
50
|
+
$style: B
|
|
51
|
+
}, V = /* @__PURE__ */ w(k, [["__cssModules", E]]);
|
|
52
52
|
export {
|
|
53
|
-
|
|
53
|
+
V as default
|
|
54
54
|
};
|
|
55
55
|
//# sourceMappingURL=PageHeader.js.map
|
package/dist/PageHeader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader.js","sources":["../src/components/PageHeader/PageHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, useCssModule, useSlots } from 'vue';\n\n export interface PageHeaderProps {\n /**\n * The title of the page.\n */\n title: string;\n /**\n * The description of the page.\n */\n description?: string;\n }\n\n defineOptions({\n name: 'll-page-header',\n });\n\n const props = withDefaults(defineProps<PageHeaderProps>(), {\n description: '',\n });\n\n const classes = useCssModule();\n const slots = useSlots();\n\n const hasActions = computed<boolean>(() => !!(slots['primary-action'] || slots['secondary-action']));\n</script>\n\n<template>\n <header\n class=\"stash-page-header\"\n :class=\"[classes.root, { [classes.grid]: hasActions }]\"\n date-test=\"stash-page-header\"\n >\n <div class=\"tw-col-span-full tw-flex tw-items-center lg:tw-col-span-1\">\n <div v-if=\"slots.media\" class=\"stash-page-header__media tw-mr-3 tw-self-center\" :class=\"classes.mediaTest\">\n <!-- @slot Receives a custom media -->\n <slot name=\"media\"></slot>\n </div>\n\n <div>\n <!-- @slot Receives a custom title -->\n <slot name=\"title\">\n <h1 class=\"stash-page-header__title tw-my-0\">{{ props.title }}</h1>\n </slot>\n\n <!-- @slot Receives a custom description -->\n <slot name=\"description\">\n <p v-if=\"description\" class=\"stash-page-header__description tw-mb-0 tw-mt-1.5\">{{ props.description }}</p>\n </slot>\n </div>\n </div>\n\n <div\n v-if=\"hasActions\"\n class=\"stash-page-header__actions tw-col-span-full tw-flex lg:tw-col-span-1\"\n :class=\"classes.actions\"\n >\n <!-- @slot Receives a custom secondary action -->\n <slot name=\"secondary-action\"> </slot>\n <!-- @slot Receives a custom primary action -->\n <slot name=\"primary-action\"> </slot>\n </div>\n </header>\n</template>\n\n<style module>\n .root {\n border-bottom: 0;\n display: grid;\n gap:
|
|
1
|
+
{"version":3,"file":"PageHeader.js","sources":["../src/components/PageHeader/PageHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, useCssModule, useSlots } from 'vue';\n\n export interface PageHeaderProps {\n /**\n * The title of the page.\n */\n title: string;\n /**\n * The description of the page.\n */\n description?: string;\n }\n\n defineOptions({\n name: 'll-page-header',\n });\n\n const props = withDefaults(defineProps<PageHeaderProps>(), {\n description: '',\n });\n\n const classes = useCssModule();\n const slots = useSlots();\n\n const hasActions = computed<boolean>(() => !!(slots['primary-action'] || slots['secondary-action']));\n</script>\n\n<template>\n <header\n class=\"stash-page-header\"\n :class=\"[classes.root, { [classes.grid]: hasActions }]\"\n date-test=\"stash-page-header\"\n >\n <div class=\"tw-col-span-full tw-flex tw-items-center lg:tw-col-span-1\">\n <div v-if=\"slots.media\" class=\"stash-page-header__media tw-mr-3 tw-self-center\" :class=\"classes.mediaTest\">\n <!-- @slot Receives a custom media -->\n <slot name=\"media\"></slot>\n </div>\n\n <div>\n <!-- @slot Receives a custom title -->\n <slot name=\"title\">\n <h1 class=\"stash-page-header__title tw-my-0\">{{ props.title }}</h1>\n </slot>\n\n <!-- @slot Receives a custom description -->\n <slot name=\"description\">\n <p v-if=\"description\" class=\"stash-page-header__description tw-mb-0 tw-mt-1.5\">{{ props.description }}</p>\n </slot>\n </div>\n </div>\n\n <div\n v-if=\"hasActions\"\n class=\"stash-page-header__actions tw-col-span-full tw-flex lg:tw-col-span-1\"\n :class=\"classes.actions\"\n >\n <!-- @slot Receives a custom secondary action -->\n <slot name=\"secondary-action\"> </slot>\n <!-- @slot Receives a custom primary action -->\n <slot name=\"primary-action\"> </slot>\n </div>\n </header>\n</template>\n\n<style module>\n .root {\n border-bottom: 0;\n display: grid;\n gap: var(--grid-gutter);\n margin: 0 auto;\n max-width: theme('width.container');\n padding: theme('spacing.6') var(--grid-gutter) theme('spacing.12');\n width: 100%;\n }\n\n @media screen('lg') {\n .root.grid {\n grid-template-columns: repeat(2, 1fr);\n }\n }\n\n .actions {\n align-self: flex-end;\n flex-direction: column-reverse;\n row-gap: var(--grid-gutter);\n }\n\n @media screen('md') {\n .actions {\n column-gap: var(--grid-gutter);\n flex-direction: row;\n row-gap: 0;\n }\n }\n\n @media screen('lg') {\n .actions {\n align-items: flex-end;\n flex-direction: row;\n justify-content: flex-end;\n }\n }\n\n /* max size for media/marketing illustration icons we would be passing to the slot */\n .media-test {\n max-width: 58px;\n max-height: 58px;\n }\n</style>\n"],"names":["classes","useCssModule","slots","useSlots","hasActions","computed"],"mappings":";;;;;;;;;;;;;iBAsBQA,IAAUC,KACVC,IAAQC,KAERC,IAAaC,EAAkB,MAAM,CAAC,EAAEH,EAAM,gBAAgB,KAAKA,EAAM,kBAAkB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/PageNavigation.js
CHANGED
|
@@ -2,11 +2,11 @@ import { defineComponent as b, ref as g, watch as m, onMounted as x, openBlock a
|
|
|
2
2
|
import C from "@leaflink/snitch";
|
|
3
3
|
import d from "lodash-es/kebabCase";
|
|
4
4
|
import { useRoute as U, useRouter as y } from "vue-router";
|
|
5
|
-
import { _ as P } from "./Tab.vue_vue_type_script_setup_true_lang-
|
|
5
|
+
import { _ as P } from "./Tab.vue_vue_type_script_setup_true_lang-69d1b046.js";
|
|
6
6
|
import D from "./Tabs.js";
|
|
7
7
|
import "./Badge.js";
|
|
8
8
|
import "./_plugin-vue_export-helper-dad06003.js";
|
|
9
|
-
import "./Tabs.vue_used_vue_type_style_index_0_lang.module-
|
|
9
|
+
import "./Tabs.vue_used_vue_type_style_index_0_lang.module-2a131332.js";
|
|
10
10
|
import "lodash-es/debounce";
|
|
11
11
|
import "lodash-es/uniqueId";
|
|
12
12
|
import "./constants.js";
|
|
@@ -23,7 +23,7 @@ import "./Icon.js";
|
|
|
23
23
|
import "./index-79ce320f.js";
|
|
24
24
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
25
25
|
const E = {
|
|
26
|
-
class: "
|
|
26
|
+
class: "stash-page-navigation container",
|
|
27
27
|
"data-test": "stash-page-navigation"
|
|
28
28
|
}, re = /* @__PURE__ */ b({
|
|
29
29
|
name: "ll-page-navigation",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageNavigation.js","sources":["../src/components/PageNavigation/PageNavigation.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import logger from '@leaflink/snitch';\n import kebabCase from 'lodash-es/kebabCase';\n import { onMounted, ref, watch } from 'vue';\n import { RouteLocationRaw, useRoute, useRouter } from 'vue-router';\n\n import Tab, { type TabProps } from '../Tab/Tab.vue';\n import Tabs from '../Tabs/Tabs.vue';\n\n defineOptions({\n name: 'll-page-navigation',\n });\n\n export interface NavItem extends Omit<TabProps, 'value'> {\n /**\n * The tab's label\n */\n label: string;\n\n /**\n * The tab's label\n */\n value?: string;\n }\n\n export interface PageNavigationProps {\n /**\n * Index of active tab (zero-based)\n * @deprecated Use v-model instead.\n */\n activeIndex?: number | string;\n\n /**\n * The currently active tab value\n */\n modelValue?: string;\n\n /**\n * Array of tabs. A `tab` is an object containing a `label` and either an `href` | `to`\n */\n items: NavItem[];\n }\n\n const props = withDefaults(defineProps<PageNavigationProps>(), {\n activeIndex: undefined,\n modelValue: '',\n });\n\n const emit =\n defineEmits<{\n /**\n * Emits the current active nav value\n */\n (e: 'update:modelValue', activeTab: string): void;\n\n /**\n * Emits the current active nav index\n * @deprecated - Use v-model instead.\n */\n (e: 'change', activeNavIndex: number): void;\n }>();\n\n if (props.activeIndex) {\n logger.info('The `activeIndex` prop is deprecated. Use `v-model` instead.');\n }\n\n const route = useRoute();\n const router = useRouter();\n\n // this ref is needed to keep track of the active tab even if v-model is not passed\n const activeTab = ref('');\n\n function onUpdateActiveTab(newActiveTab: string) {\n if (newActiveTab === activeTab.value) return;\n\n activeTab.value = newActiveTab;\n emit('update:modelValue', newActiveTab);\n }\n\n // TODO: Remove this once activeIndex is removed\n watch(() => props.modelValue, (newValue, oldValue) => {\n if (oldValue === newValue) return;\n\n const activeNavItemIndex = props.items.findIndex((item) => kebabCase(item.label) === newValue);\n\n emit('change', activeNavItemIndex);\n });\n\n onMounted(() => {\n if (!props.items.length) return;\n\n // TODO: Remove this once activeIndex is removed\n if (props.activeIndex !== undefined) {\n const activeTabItem = props.items[props.activeIndex];\n\n onUpdateActiveTab(kebabCase(activeTabItem.label));\n\n return;\n }\n\n if (props.modelValue) {\n onUpdateActiveTab(props.modelValue);\n return;\n }\n\n if (!router) return;\n\n const itemMatchingRoute = props.items.find(item => {\n if (item?.disabled || (!item?.to && !item?.href)) return;\n\n const { path } = router.resolve(item?.to as RouteLocationRaw || item?.href as string);\n\n if (path === route.path) {\n return true;\n }\n\n if (!route.path.includes(path)) return;\n\n const sliceIndex = (route.path.length - route.path.lastIndexOf('/')) * -1;\n const parentPath = route.path.slice(0, sliceIndex);\n\n return path === parentPath;\n });\n\n if (!itemMatchingRoute) return;\n\n onUpdateActiveTab(itemMatchingRoute?.value || kebabCase(itemMatchingRoute.label));\n });\n</script>\n\n<template>\n <nav class=\"
|
|
1
|
+
{"version":3,"file":"PageNavigation.js","sources":["../src/components/PageNavigation/PageNavigation.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import logger from '@leaflink/snitch';\n import kebabCase from 'lodash-es/kebabCase';\n import { onMounted, ref, watch } from 'vue';\n import { RouteLocationRaw, useRoute, useRouter } from 'vue-router';\n\n import Tab, { type TabProps } from '../Tab/Tab.vue';\n import Tabs from '../Tabs/Tabs.vue';\n\n defineOptions({\n name: 'll-page-navigation',\n });\n\n export interface NavItem extends Omit<TabProps, 'value'> {\n /**\n * The tab's label\n */\n label: string;\n\n /**\n * The tab's label\n */\n value?: string;\n }\n\n export interface PageNavigationProps {\n /**\n * Index of active tab (zero-based)\n * @deprecated Use v-model instead.\n */\n activeIndex?: number | string;\n\n /**\n * The currently active tab value\n */\n modelValue?: string;\n\n /**\n * Array of tabs. A `tab` is an object containing a `label` and either an `href` | `to`\n */\n items: NavItem[];\n }\n\n const props = withDefaults(defineProps<PageNavigationProps>(), {\n activeIndex: undefined,\n modelValue: '',\n });\n\n const emit =\n defineEmits<{\n /**\n * Emits the current active nav value\n */\n (e: 'update:modelValue', activeTab: string): void;\n\n /**\n * Emits the current active nav index\n * @deprecated - Use v-model instead.\n */\n (e: 'change', activeNavIndex: number): void;\n }>();\n\n if (props.activeIndex) {\n logger.info('The `activeIndex` prop is deprecated. Use `v-model` instead.');\n }\n\n const route = useRoute();\n const router = useRouter();\n\n // this ref is needed to keep track of the active tab even if v-model is not passed\n const activeTab = ref('');\n\n function onUpdateActiveTab(newActiveTab: string) {\n if (newActiveTab === activeTab.value) return;\n\n activeTab.value = newActiveTab;\n emit('update:modelValue', newActiveTab);\n }\n\n // TODO: Remove this once activeIndex is removed\n watch(() => props.modelValue, (newValue, oldValue) => {\n if (oldValue === newValue) return;\n\n const activeNavItemIndex = props.items.findIndex((item) => kebabCase(item.label) === newValue);\n\n emit('change', activeNavItemIndex);\n });\n\n onMounted(() => {\n if (!props.items.length) return;\n\n // TODO: Remove this once activeIndex is removed\n if (props.activeIndex !== undefined) {\n const activeTabItem = props.items[props.activeIndex];\n\n onUpdateActiveTab(kebabCase(activeTabItem.label));\n\n return;\n }\n\n if (props.modelValue) {\n onUpdateActiveTab(props.modelValue);\n return;\n }\n\n if (!router) return;\n\n const itemMatchingRoute = props.items.find(item => {\n if (item?.disabled || (!item?.to && !item?.href)) return;\n\n const { path } = router.resolve(item?.to as RouteLocationRaw || item?.href as string);\n\n if (path === route.path) {\n return true;\n }\n\n if (!route.path.includes(path)) return;\n\n const sliceIndex = (route.path.length - route.path.lastIndexOf('/')) * -1;\n const parentPath = route.path.slice(0, sliceIndex);\n\n return path === parentPath;\n });\n\n if (!itemMatchingRoute) return;\n\n onUpdateActiveTab(itemMatchingRoute?.value || kebabCase(itemMatchingRoute.label));\n });\n</script>\n\n<template>\n <nav class=\"stash-page-navigation container\" data-test=\"stash-page-navigation\">\n <Tabs :active-tab=\"activeTab\" @update:active-tab=\"onUpdateActiveTab\">\n <Tab\n v-for=\"(item, index) in props.items\"\n :key=\"item.label\"\n :value=\"item?.value || kebabCase(item.label)\"\n :to=\"item.to\"\n :href=\"item.href\"\n :badge=\"item.badge\"\n :disabled=\"item.disabled\"\n :data-id=\"index\"\n >\n {{ item.label }}\n </Tab>\n </Tabs>\n </nav>\n</template>\n"],"names":["props","logger","route","useRoute","router","useRouter","activeTab","ref","onUpdateActiveTab","newActiveTab","emit","watch","newValue","oldValue","activeNavItemIndex","item","kebabCase","onMounted","activeTabItem","itemMatchingRoute","path","sliceIndex","parentPath"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DE,IAAIA,EAAM,eACRC,EAAO,KAAK,8DAA8D;AAG5E,UAAMC,IAAQC,KACRC,IAASC,KAGTC,IAAYC,EAAI,EAAE;AAExB,aAASC,EAAkBC,GAAsB;AAC/C,MAAIA,MAAiBH,EAAU,UAE/BA,EAAU,QAAQG,GAClBC,EAAK,qBAAqBD,CAAY;AAAA,IACxC;AAGA,WAAAE,EAAM,MAAMX,EAAM,YAAY,CAACY,GAAUC,MAAa;AACpD,UAAIA,MAAaD;AAAU;AAErB,YAAAE,IAAqBd,EAAM,MAAM,UAAU,CAACe,MAASC,EAAUD,EAAK,KAAK,MAAMH,CAAQ;AAE7F,MAAAF,EAAK,UAAUI,CAAkB;AAAA,IAAA,CAClC,GAEDG,EAAU,MAAM;AACV,UAAA,CAACjB,EAAM,MAAM;AAAQ;AAGrB,UAAAA,EAAM,gBAAgB,QAAW;AACnC,cAAMkB,IAAgBlB,EAAM,MAAMA,EAAM,WAAW;AAEjC,QAAAQ,EAAAQ,EAAUE,EAAc,KAAK,CAAC;AAEhD;AAAA,MACF;AAEA,UAAIlB,EAAM,YAAY;AACpB,QAAAQ,EAAkBR,EAAM,UAAU;AAClC;AAAA,MACF;AAEA,UAAI,CAACI;AAAQ;AAEb,YAAMe,IAAoBnB,EAAM,MAAM,KAAK,CAAQe,MAAA;AACjD,YAAIA,KAAA,QAAAA,EAAM,YAAa,EAACA,KAAA,QAAAA,EAAM,OAAM,EAACA,KAAA,QAAAA,EAAM;AAAO;AAE5C,cAAA,EAAE,MAAAK,EAAS,IAAAhB,EAAO,SAAQW,KAAA,gBAAAA,EAAM,QAA0BA,KAAA,gBAAAA,EAAM,KAAc;AAEhF,YAAAK,MAASlB,EAAM;AACV,iBAAA;AAGT,YAAI,CAACA,EAAM,KAAK,SAASkB,CAAI;AAAG;AAE1B,cAAAC,KAAcnB,EAAM,KAAK,SAASA,EAAM,KAAK,YAAY,GAAG,KAAK,IACjEoB,IAAapB,EAAM,KAAK,MAAM,GAAGmB,CAAU;AAEjD,eAAOD,MAASE;AAAA,MAAA,CACjB;AAED,MAAKH,KAELX,GAAkBW,KAAA,gBAAAA,EAAmB,UAASH,EAAUG,EAAkB,KAAK,CAAC;AAAA,IAAA,CACjF;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/Paginate.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as w, useCssModule as y, computed as S, openBlock as r, createElementBlock as l, createElementVNode as c, normalizeClass as o, unref as i, createVNode as f, Fragment as g, renderList as x, createCommentVNode as p, toDisplayString as z } from "vue";
|
|
2
2
|
import m from "./Icon.js";
|
|
3
|
-
import { s as M } from "./Paginate.vue_used_vue_type_style_index_0_lang.module-
|
|
3
|
+
import { s as M } from "./Paginate.vue_used_vue_type_style_index_0_lang.module-18343da7.js";
|
|
4
4
|
import { _ as E } from "./_plugin-vue_export-helper-dad06003.js";
|
|
5
5
|
import "lodash-es/uniqueId";
|
|
6
6
|
import "./index-79ce320f.js";
|
package/dist/Paginate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paginate.js","sources":["../src/components/Paginate/Paginate.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { computed, useCssModule } from 'vue';\n\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({\n name: 'll-paginate',\n });\n\n export interface PaginateProps {\n /**\n * Current page number\n */\n currentPage?: number;\n /**\n * Total number of items in list\n */\n listLength?: number;\n /**\n * Number of items per page\n */\n pageSize?: number;\n }\n\n const props = withDefaults(defineProps<PaginateProps>(), {\n currentPage: 1,\n listLength: 1,\n pageSize: 50,\n });\n\n const emit =\n defineEmits<{\n /**\n * Emitted when the page number changes.\n */\n (e: 'set-page', pageNumber: number): void;\n }>();\n\n const classes = useCssModule();\n\n const pages = computed(() => Math.ceil(props.listLength / props.pageSize));\n\n /**\n * Emits current page to list view.\n */\n function updatePage(currentPage: number) {\n emit('set-page', currentPage);\n }\n\n /**\n * Sets current page to next page\n */\n function next() {\n if (props.currentPage < pages.value) {\n updatePage(props.currentPage + 1);\n }\n }\n\n /**\n * Sets current page to previous page\n */\n function prev() {\n if (props.currentPage > 1) {\n updatePage(props.currentPage - 1);\n }\n }\n\n /**\n * Determines whether to show page\n * @returns {boolean} - should show page in pagination component\n */\n function shouldShowPage(page: number): boolean {\n const pageDiff = Math.abs(props.currentPage - page);\n\n if (\n pages.value < 10 ||\n page === 1 ||\n page === pages.value ||\n (props.currentPage < 6 && page < 8) ||\n (pages.value - props.currentPage < 5 && pages.value - page < 7) ||\n pageDiff < 3\n ) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Determines whether to show the leading ellipsis\n * @returns {boolean} should show or not\n */\n function shouldShowFirstEllipsis(page: number): boolean {\n return pages.value > 9 && props.currentPage > 5 && page === 2;\n }\n\n /**\n * Determines whether to show the trailing ellipsis\n * @returns {boolean} should show or not\n */\n function shouldShowLastEllipsis(page: number): boolean {\n return pages.value > 9 && pages.value - props.currentPage > 4 && page === pages.value - 1;\n }\n</script>\n\n<template>\n <div class=\"stash-paginate tw-flex tw-justify-center\" data-test=\"stash-paginate\">\n <ul class=\"stash-paginate__list tw-flex\" :class=\"classes.pagination\" data-test=\"stash-paginate|list\">\n <button\n data-test=\"stash-paginate|prev-page\"\n :class=\"[classes.prev, { [classes['is-disabled']]: currentPage === 1 }]\"\n @click=\"prev\"\n >\n <Icon size=\"small\" name=\"chevron-left\" />\n </button>\n <template v-for=\"page in pages\">\n <button\n v-if=\"shouldShowFirstEllipsis(page)\"\n :key=\"`${page}-ellipsis`\"\n data-test=\"stash-paginate|first-ellipsis\"\n >\n …\n </button>\n <button\n v-if=\"shouldShowPage(page)\"\n :key=\"page\"\n data-test=\"stash-paginate|page-number\"\n :class=\"{ [classes['is-active']]: currentPage === page }\"\n @click=\"updatePage(page)\"\n >\n {{ page }}\n </button>\n <button v-if=\"shouldShowLastEllipsis(page)\" :key=\"`${page}-ellipsis`\" data-test=\"stash-paginate|last-ellipsis\">\n …\n </button>\n </template>\n <button\n data-test=\"stash-paginate|next-page\"\n :class=\"[classes.next, { [classes['is-disabled']]: currentPage === pages }]\"\n @click=\"next\"\n >\n <Icon size=\"small\" class=\"tw-rotate-180\" name=\"chevron-left\" />\n </button>\n </ul>\n </div>\n</template>\n\n<style module>\n .pagination {\n /* Todo: We shouldn't really be making assumptions about the outer spacing of the pagination component */\n margin-top: theme(spacing.12);\n z-index: 0;\n\n a,\n button {\n @apply tw-border tw-border-solid tw-border-ice-200;\n align-items: center;\n background-color: theme(colors.white);\n color: var(--color-blue-500);\n cursor: pointer;\n display: flex;\n height: theme(height.input);\n justify-content: center;\n margin: 0 0 0 -1px;\n width: theme(height.input);\n\n &.prev {\n border-bottom-left-radius: theme(borderRadius.DEFAULT);\n border-top-left-radius: theme(borderRadius.DEFAULT);\n }\n\n &.next {\n border-bottom-right-radius: theme(borderRadius.DEFAULT);\n border-top-right-radius: theme(borderRadius.DEFAULT);\n }\n\n &:focus {\n outline: none;\n }\n\n &:hover {\n text-decoration: none;\n }\n\n &.is-active {\n background-color: var(--color-blue-500);\n color: theme(colors.white);\n pointer-events: none;\n z-index: theme(zIndex.control);\n }\n\n &:hover,\n &.is-active {\n @apply tw-border tw-border-solid tw-border-blue-500;\n position: relative;\n }\n\n &.is-disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n }\n }\n</style>\n"],"names":["classes","useCssModule","pages","computed","props","updatePage","currentPage","emit","next","prev","shouldShowPage","page","pageDiff","shouldShowFirstEllipsis","shouldShowLastEllipsis"],"mappings":";;;;;;;;;;;;;;;;;;;;iBAsCQA,IAAUC,KAEVC,IAAQC,EAAS,MAAM,KAAK,KAAKC,EAAM,aAAaA,EAAM,QAAQ,CAAC;AAKzE,aAASC,EAAWC,GAAqB;AACvC,MAAAC,EAAK,YAAYD,CAAW;AAAA,IAC9B;AAKA,aAASE,IAAO;AACV,MAAAJ,EAAM,cAAcF,EAAM,SACjBG,EAAAD,EAAM,cAAc,CAAC;AAAA,IAEpC;AAKA,aAASK,IAAO;AACV,MAAAL,EAAM,cAAc,KACXC,EAAAD,EAAM,cAAc,CAAC;AAAA,IAEpC;AAMA,aAASM,EAAeC,GAAuB;AAC7C,YAAMC,IAAW,KAAK,IAAIR,EAAM,cAAcO,CAAI;AAGhD,aAAAT,EAAM,QAAQ,MACdS,MAAS,KACTA,MAAST,EAAM,SACdE,EAAM,cAAc,KAAKO,IAAO,KAChCT,EAAM,QAAQE,EAAM,cAAc,KAAKF,EAAM,QAAQS,IAAO,KAC7DC,IAAW;AAAA,IAMf;AAMA,aAASC,EAAwBF,GAAuB;AACtD,aAAOT,EAAM,QAAQ,KAAKE,EAAM,cAAc,KAAKO,MAAS;AAAA,IAC9D;AAMA,aAASG,EAAuBH,GAAuB;AAC9C,aAAAT,EAAM,QAAQ,KAAKA,EAAM,QAAQE,EAAM,cAAc,KAAKO,MAAST,EAAM,QAAQ;AAAA,IAC1F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Paginate.js","sources":["../src/components/Paginate/Paginate.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { computed, useCssModule } from 'vue';\n\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({\n name: 'll-paginate',\n });\n\n export interface PaginateProps {\n /**\n * Current page number\n */\n currentPage?: number;\n /**\n * Total number of items in list\n */\n listLength?: number;\n /**\n * Number of items per page\n */\n pageSize?: number;\n }\n\n const props = withDefaults(defineProps<PaginateProps>(), {\n currentPage: 1,\n listLength: 1,\n pageSize: 50,\n });\n\n const emit =\n defineEmits<{\n /**\n * Emitted when the page number changes.\n */\n (e: 'set-page', pageNumber: number): void;\n }>();\n\n const classes = useCssModule();\n\n const pages = computed(() => Math.ceil(props.listLength / props.pageSize));\n\n /**\n * Emits current page to list view.\n */\n function updatePage(currentPage: number) {\n emit('set-page', currentPage);\n }\n\n /**\n * Sets current page to next page\n */\n function next() {\n if (props.currentPage < pages.value) {\n updatePage(props.currentPage + 1);\n }\n }\n\n /**\n * Sets current page to previous page\n */\n function prev() {\n if (props.currentPage > 1) {\n updatePage(props.currentPage - 1);\n }\n }\n\n /**\n * Determines whether to show page\n * @returns {boolean} - should show page in pagination component\n */\n function shouldShowPage(page: number): boolean {\n const pageDiff = Math.abs(props.currentPage - page);\n\n if (\n pages.value < 10 ||\n page === 1 ||\n page === pages.value ||\n (props.currentPage < 6 && page < 8) ||\n (pages.value - props.currentPage < 5 && pages.value - page < 7) ||\n pageDiff < 3\n ) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Determines whether to show the leading ellipsis\n * @returns {boolean} should show or not\n */\n function shouldShowFirstEllipsis(page: number): boolean {\n return pages.value > 9 && props.currentPage > 5 && page === 2;\n }\n\n /**\n * Determines whether to show the trailing ellipsis\n * @returns {boolean} should show or not\n */\n function shouldShowLastEllipsis(page: number): boolean {\n return pages.value > 9 && pages.value - props.currentPage > 4 && page === pages.value - 1;\n }\n</script>\n\n<template>\n <div class=\"stash-paginate tw-flex tw-justify-center\" data-test=\"stash-paginate\">\n <ul class=\"stash-paginate__list tw-flex\" :class=\"classes.pagination\" data-test=\"stash-paginate|list\">\n <button\n data-test=\"stash-paginate|prev-page\"\n :class=\"[classes.prev, { [classes['is-disabled']]: currentPage === 1 }]\"\n @click=\"prev\"\n >\n <Icon size=\"small\" name=\"chevron-left\" />\n </button>\n <template v-for=\"page in pages\">\n <button\n v-if=\"shouldShowFirstEllipsis(page)\"\n :key=\"`${page}-ellipsis`\"\n data-test=\"stash-paginate|first-ellipsis\"\n >\n …\n </button>\n <button\n v-if=\"shouldShowPage(page)\"\n :key=\"page\"\n data-test=\"stash-paginate|page-number\"\n :class=\"{ [classes['is-active']]: currentPage === page }\"\n @click=\"updatePage(page)\"\n >\n {{ page }}\n </button>\n <button v-if=\"shouldShowLastEllipsis(page)\" :key=\"`${page}-ellipsis`\" data-test=\"stash-paginate|last-ellipsis\">\n …\n </button>\n </template>\n <button\n data-test=\"stash-paginate|next-page\"\n :class=\"[classes.next, { [classes['is-disabled']]: currentPage === pages }]\"\n @click=\"next\"\n >\n <Icon size=\"small\" class=\"tw-rotate-180\" name=\"chevron-left\" />\n </button>\n </ul>\n </div>\n</template>\n\n<style module>\n .pagination {\n /* Todo: We shouldn't really be making assumptions about the outer spacing of the pagination component */\n margin-top: theme('spacing.12');\n z-index: 0;\n\n a,\n button {\n @apply tw-border tw-border-solid tw-border-ice-200;\n align-items: center;\n background-color: theme('colors.white');\n color: var(--color-blue-500);\n cursor: pointer;\n display: flex;\n height: theme('height.input');\n justify-content: center;\n margin: 0 0 0 -1px;\n width: theme('height.input');\n\n &.prev {\n border-bottom-left-radius: theme('borderRadius.DEFAULT');\n border-top-left-radius: theme('borderRadius.DEFAULT');\n }\n\n &.next {\n border-bottom-right-radius: theme('borderRadius.DEFAULT');\n border-top-right-radius: theme('borderRadius.DEFAULT');\n }\n\n &:focus {\n outline: none;\n }\n\n &:hover {\n text-decoration: none;\n }\n\n &.is-active {\n background-color: var(--color-blue-500);\n color: theme('colors.white');\n pointer-events: none;\n z-index: theme('zIndex.control');\n }\n\n &:hover,\n &.is-active {\n @apply tw-border tw-border-solid tw-border-blue-500;\n position: relative;\n }\n\n &.is-disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n }\n }\n</style>\n"],"names":["classes","useCssModule","pages","computed","props","updatePage","currentPage","emit","next","prev","shouldShowPage","page","pageDiff","shouldShowFirstEllipsis","shouldShowLastEllipsis"],"mappings":";;;;;;;;;;;;;;;;;;;;iBAsCQA,IAAUC,KAEVC,IAAQC,EAAS,MAAM,KAAK,KAAKC,EAAM,aAAaA,EAAM,QAAQ,CAAC;AAKzE,aAASC,EAAWC,GAAqB;AACvC,MAAAC,EAAK,YAAYD,CAAW;AAAA,IAC9B;AAKA,aAASE,IAAO;AACV,MAAAJ,EAAM,cAAcF,EAAM,SACjBG,EAAAD,EAAM,cAAc,CAAC;AAAA,IAEpC;AAKA,aAASK,IAAO;AACV,MAAAL,EAAM,cAAc,KACXC,EAAAD,EAAM,cAAc,CAAC;AAAA,IAEpC;AAMA,aAASM,EAAeC,GAAuB;AAC7C,YAAMC,IAAW,KAAK,IAAIR,EAAM,cAAcO,CAAI;AAGhD,aAAAT,EAAM,QAAQ,MACdS,MAAS,KACTA,MAAST,EAAM,SACdE,EAAM,cAAc,KAAKO,IAAO,KAChCT,EAAM,QAAQE,EAAM,cAAc,KAAKF,EAAM,QAAQS,IAAO,KAC7DC,IAAW;AAAA,IAMf;AAMA,aAASC,EAAwBF,GAAuB;AACtD,aAAOT,EAAM,QAAQ,KAAKE,EAAM,cAAc,KAAKO,MAAS;AAAA,IAC9D;AAMA,aAASG,EAAuBH,GAAuB;AAC9C,aAAAT,EAAM,QAAQ,KAAKA,EAAM,QAAQE,EAAM,cAAc,KAAKO,MAAST,EAAM,QAAQ;AAAA,IAC1F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const _ = "_pagination_14zhb_2", i = "_prev_14zhb_20", t = "_next_14zhb_25", n = {
|
|
2
|
+
pagination: _,
|
|
3
|
+
prev: i,
|
|
4
|
+
next: t,
|
|
5
|
+
"is-active": "_is-active_14zhb_38",
|
|
6
|
+
"is-disabled": "_is-disabled_14zhb_51"
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
n as s
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=Paginate.vue_used_vue_type_style_index_0_lang.module-18343da7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Paginate.vue_used_vue_type_style_index_0_lang.module-18343da7.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
package/dist/QuickAction.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { _ as
|
|
1
|
+
import { defineComponent as u, useCssModule as _, computed as o, openBlock as d, createBlock as m, resolveDynamicComponent as f, mergeProps as p, unref as w, withCtx as h, createElementVNode as e, createVNode as s, toDisplayString as r } from "vue";
|
|
2
|
+
import n from "./Icon.js";
|
|
3
|
+
import { _ as x } from "./_plugin-vue_export-helper-dad06003.js";
|
|
4
4
|
import "lodash-es/uniqueId";
|
|
5
5
|
import "./index-79ce320f.js";
|
|
6
6
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
7
|
-
const
|
|
7
|
+
const b = { class: "tw-flex tw-items-center tw-gap-3" }, k = { class: "tw-flex tw-items-center tw-justify-center tw-rounded tw-bg-blue-100 tw-p-3" }, v = { class: "tw-flex-1" }, g = { class: "tw-text-blue-500" }, y = { class: "tw-text-xs tw-font-normal tw-text-ice-700 lg:tw-mb-0" }, C = /* @__PURE__ */ u({
|
|
8
8
|
__name: "QuickAction",
|
|
9
9
|
props: {
|
|
10
10
|
title: {},
|
|
@@ -14,39 +14,42 @@ const w = { class: "content tw-flex tw-items-center" }, h = { class: "tw-flex tw
|
|
|
14
14
|
icon: {}
|
|
15
15
|
},
|
|
16
16
|
setup(c) {
|
|
17
|
-
const t = c, i = o(() => t.to ? "router-link" : t.href ? "a" : "div"), a = o(() => t.to ? {
|
|
17
|
+
const t = c, i = _(), l = o(() => t.to ? "router-link" : t.href ? "a" : "div"), a = o(() => t.to ? {
|
|
18
18
|
to: t.to
|
|
19
19
|
} : t.href ? {
|
|
20
20
|
href: t.href
|
|
21
21
|
} : {});
|
|
22
|
-
return (
|
|
23
|
-
class: "stash-quick-action
|
|
22
|
+
return (B, D) => (d(), m(f(l.value), p(a.value, {
|
|
23
|
+
class: ["stash-quick-action tw-rounded tw-p-3 tw-shadow", w(i).root],
|
|
24
24
|
"data-test": "stash-quick-action"
|
|
25
25
|
}), {
|
|
26
|
-
default:
|
|
27
|
-
e("div",
|
|
28
|
-
e("div",
|
|
29
|
-
s(
|
|
26
|
+
default: h(() => [
|
|
27
|
+
e("div", b, [
|
|
28
|
+
e("div", k, [
|
|
29
|
+
s(n, {
|
|
30
30
|
name: t.icon,
|
|
31
31
|
class: "tw-text-blue-500"
|
|
32
32
|
}, null, 8, ["name"])
|
|
33
33
|
]),
|
|
34
|
-
e("div",
|
|
35
|
-
e("h4",
|
|
36
|
-
e("p",
|
|
34
|
+
e("div", v, [
|
|
35
|
+
e("h4", g, r(t.title), 1),
|
|
36
|
+
e("p", y, r(t.subtitle), 1)
|
|
37
37
|
]),
|
|
38
|
-
s(
|
|
38
|
+
s(n, {
|
|
39
39
|
name: "arrow-right",
|
|
40
40
|
class: "tw-text-blue-500"
|
|
41
41
|
})
|
|
42
42
|
])
|
|
43
43
|
]),
|
|
44
44
|
_: 1
|
|
45
|
-
}, 16));
|
|
45
|
+
}, 16, ["class"]));
|
|
46
46
|
}
|
|
47
|
-
})
|
|
48
|
-
|
|
47
|
+
}), A = "_root_nu1bt_2", M = {
|
|
48
|
+
root: A
|
|
49
|
+
}, q = {
|
|
50
|
+
$style: M
|
|
51
|
+
}, P = /* @__PURE__ */ x(C, [["__cssModules", q]]);
|
|
49
52
|
export {
|
|
50
|
-
|
|
53
|
+
P as default
|
|
51
54
|
};
|
|
52
55
|
//# sourceMappingURL=QuickAction.js.map
|
package/dist/QuickAction.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuickAction.js","sources":["../src/components/QuickAction/QuickAction.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import {
|
|
1
|
+
{"version":3,"file":"QuickAction.js","sources":["../src/components/QuickAction/QuickAction.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import {computed, useCssModule} from 'vue';\n import { type RouteLocationRaw } from 'vue-router';\n\n import { IconName } from '../Icon/Icon.types';\n import Icon from '../Icon/Icon.vue';\n\n export interface QuickActionProps {\n /**\n * The title prop will show the first line of text\n */\n title: string;\n\n /**\n * The subtitle prop will show the second line of text\n */\n subtitle: string;\n\n /**\n * The `to` prop for vue-router's `RouterLink` component\n */\n to?: RouteLocationRaw;\n /**\n * If defined, the quick action will render as an `<a />` tag.\n */\n href?: string;\n /**\n * Icon to render on the left side\n */\n icon: IconName;\n }\n\n const props = defineProps<QuickActionProps>();\n const classes = useCssModule();\n\n const is = computed(() => {\n if (props.to) {\n return 'router-link';\n }\n\n if (props.href) {\n return 'a';\n }\n\n return 'div';\n });\n\n const linkAttrs = computed(() => {\n if (props.to) {\n return {\n to: props.to,\n };\n }\n\n if (props.href) {\n return {\n href: props.href\n };\n }\n\n return {};\n });\n</script>\n\n<template>\n <component\n :is=\"is\"\n v-bind=\"linkAttrs\"\n class=\"stash-quick-action tw-rounded tw-p-3 tw-shadow\"\n :class=\"classes.root\"\n data-test=\"stash-quick-action\"\n >\n <div class=\"tw-flex tw-items-center tw-gap-3\">\n <div class=\"tw-flex tw-items-center tw-justify-center tw-rounded tw-bg-blue-100 tw-p-3\">\n <Icon :name=\"props.icon\" class=\"tw-text-blue-500\" />\n </div>\n <div class=\"tw-flex-1\">\n <h4 class=\"tw-text-blue-500\">{{ props.title }}</h4>\n <p class=\"tw-text-xs tw-font-normal tw-text-ice-700 lg:tw-mb-0\">\n {{ props.subtitle }}\n </p>\n </div>\n <Icon name=\"arrow-right\" class=\"tw-text-blue-500\" />\n </div>\n </component>\n</template>\n\n<style module>\n .root {\n background-color: #fff;\n border: 1px solid transparent; /* it prevents layout size shifting of extra height/width when hover */\n cursor: pointer;\n display: inline-block;\n }\n\n .root:hover,\n .root:active,\n .root:focus {\n border: 1px solid var(--color-blue-500);\n text-decoration: none;\n }\n</style>\n"],"names":["classes","useCssModule","is","computed","props","linkAttrs"],"mappings":";;;;;;;;;;;;;;;;iBAiCQA,IAAUC,KAEVC,IAAKC,EAAS,MACdC,EAAM,KACD,gBAGLA,EAAM,OACD,MAGF,KACR,GAEKC,IAAYF,EAAS,MACrBC,EAAM,KACD;AAAA,MACL,IAAIA,EAAM;AAAA,IAAA,IAIVA,EAAM,OACD;AAAA,MACL,MAAMA,EAAM;AAAA,IAAA,IAIT,EACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|