@leaflink/stash 42.4.4 → 42.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -3
- package/dist/ActionsDropdown.js +15 -20
- package/dist/ActionsDropdown.js.map +1 -1
- package/dist/AddressSelect.js +34 -45
- package/dist/AddressSelect.js.map +1 -1
- package/dist/Alert.js +58 -57
- package/dist/Alert.js.map +1 -1
- package/dist/AppNavigationItem.js +4 -6
- package/dist/AppNavigationItem.js.map +1 -1
- package/dist/AppTopbar.js +13 -15
- package/dist/AppTopbar.js.map +1 -1
- package/dist/ButtonGroup.js +12 -14
- package/dist/ButtonGroup.js.map +1 -1
- package/dist/CardMedia.js +9 -11
- package/dist/CardMedia.js.map +1 -1
- package/dist/Carousel.js +41 -44
- package/dist/Carousel.js.map +1 -1
- package/dist/Checkbox.js +9 -11
- package/dist/Checkbox.js.map +1 -1
- package/dist/ChevronToggle.js +2 -4
- package/dist/ChevronToggle.js.map +1 -1
- package/dist/Chip.js +4 -6
- package/dist/Chip.js.map +1 -1
- package/dist/ContextSwitcher.js +12 -17
- package/dist/ContextSwitcher.js.map +1 -1
- package/dist/Copy.js +19 -24
- package/dist/Copy.js.map +1 -1
- package/dist/CurrencyInput.js +8 -13
- package/dist/CurrencyInput.js.map +1 -1
- package/dist/DataView.js +48 -59
- package/dist/DataView.js.map +1 -1
- package/dist/DataViewFilters.js +87 -97
- package/dist/DataViewFilters.js.map +1 -1
- package/dist/DataViewSortButton.js +14 -18
- package/dist/DataViewSortButton.js.map +1 -1
- package/dist/DataViewToolbar.js +12 -14
- package/dist/DataViewToolbar.js.map +1 -1
- package/dist/DatePicker.js +2624 -2581
- package/dist/DatePicker.js.map +1 -1
- package/dist/DatePicker.vue.d.ts +19 -0
- package/dist/Dialog.js +6 -9
- package/dist/Dialog.js.map +1 -1
- package/dist/Dropdown.js +15 -20
- package/dist/Dropdown.js.map +1 -1
- package/dist/EmptyState.js +10 -13
- package/dist/EmptyState.js.map +1 -1
- package/dist/Field.js +3 -6
- package/dist/Field.js.map +1 -1
- package/dist/{Field.vue_vue_type_script_setup_true_lang-c864abd3.js → Field.vue_vue_type_script_setup_true_lang-475832fe.js} +2 -2
- package/dist/{Field.vue_vue_type_script_setup_true_lang-c864abd3.js.map → Field.vue_vue_type_script_setup_true_lang-475832fe.js.map} +1 -1
- package/dist/FileUpload.js +27 -30
- package/dist/FileUpload.js.map +1 -1
- package/dist/FilterChip.js +10 -13
- package/dist/FilterChip.js.map +1 -1
- package/dist/FilterDrawerItem.js +5 -8
- package/dist/FilterDrawerItem.js.map +1 -1
- package/dist/FilterDropdown.js +73 -88
- package/dist/FilterDropdown.js.map +1 -1
- package/dist/FilterSelect.js +15 -18
- package/dist/FilterSelect.js.map +1 -1
- package/dist/Filters.js +67 -78
- package/dist/Filters.js.map +1 -1
- package/dist/HttpError.js +4 -7
- package/dist/HttpError.js.map +1 -1
- package/dist/Icon.js +236 -14
- package/dist/Icon.js.map +1 -1
- package/dist/Icon.vue.d.ts +2 -2
- package/dist/Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js +11 -0
- package/dist/Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js.map +1 -0
- package/dist/IconLabel.js +4 -6
- package/dist/IconLabel.js.map +1 -1
- package/dist/Illustration.js +6 -8
- package/dist/Illustration.js.map +1 -1
- package/dist/Image.js +39 -49
- package/dist/Image.js.map +1 -1
- package/dist/InlineEdit.js +10 -12
- package/dist/InlineEdit.js.map +1 -1
- package/dist/Input.js +50 -55
- package/dist/Input.js.map +1 -1
- package/dist/InputOptions.js +20 -29
- package/dist/InputOptions.js.map +1 -1
- package/dist/Label.js +1 -4
- package/dist/Label.js.map +1 -1
- package/dist/LicenseChip.js +7 -9
- package/dist/LicenseChip.js.map +1 -1
- package/dist/ListItem.js +11 -13
- package/dist/ListItem.js.map +1 -1
- package/dist/ListView.js +47 -58
- package/dist/ListView.js.map +1 -1
- package/dist/Metric.js +43 -45
- package/dist/Metric.js.map +1 -1
- package/dist/Metric.vue.d.ts +24 -15
- package/dist/Modal.js +16 -19
- package/dist/Modal.js.map +1 -1
- package/dist/Modals.js +16 -26
- package/dist/Modals.js.map +1 -1
- package/dist/ModalsPlugin.js +12 -22
- package/dist/ModalsPlugin.js.map +1 -1
- package/dist/ObfuscateText.js +7 -9
- package/dist/ObfuscateText.js.map +1 -1
- package/dist/PageNavigation.js +25 -29
- package/dist/PageNavigation.js.map +1 -1
- package/dist/Paginate.js +29 -31
- package/dist/Paginate.js.map +1 -1
- package/dist/QuickAction.js +13 -15
- package/dist/QuickAction.js.map +1 -1
- package/dist/RadioGroup.js +86 -89
- package/dist/RadioGroup.js.map +1 -1
- package/dist/SearchBar.js +18 -20
- package/dist/SearchBar.js.map +1 -1
- package/dist/Select.js +13 -23
- package/dist/Select.js.map +1 -1
- package/dist/SelectStatus.js +26 -36
- package/dist/SelectStatus.js.map +1 -1
- package/dist/Step.js +19 -21
- package/dist/Step.js.map +1 -1
- package/dist/Switch.js +8 -10
- package/dist/Switch.js.map +1 -1
- package/dist/Tab.js +25 -30
- package/dist/Tab.js.map +1 -1
- package/dist/Table.js +19 -21
- package/dist/Table.js.map +1 -1
- package/dist/TableCell.js +21 -22
- package/dist/TableCell.js.map +1 -1
- package/dist/TableHeaderCell.js +4 -4
- package/dist/TableHeaderRow.js +7 -9
- package/dist/TableHeaderRow.js.map +1 -1
- package/dist/TableRow.js +22 -24
- package/dist/TableRow.js.map +1 -1
- package/dist/Tabs.js +11 -16
- package/dist/Tabs.js.map +1 -1
- package/dist/{Tabs.vue_vue_type_script_setup_true_lang-ba383fda.js → Tabs.vue_vue_type_script_setup_true_lang-aca4f8b8.js} +3 -3
- package/dist/{Tabs.vue_vue_type_script_setup_true_lang-ba383fda.js.map → Tabs.vue_vue_type_script_setup_true_lang-aca4f8b8.js.map} +1 -1
- package/dist/Textarea.js +10 -13
- package/dist/Textarea.js.map +1 -1
- package/dist/Toast.js +8 -10
- package/dist/Toast.js.map +1 -1
- package/dist/Toasts.js +14 -25
- package/dist/Toasts.js.map +1 -1
- package/dist/ToastsPlugin.js +14 -25
- package/dist/ToastsPlugin.js.map +1 -1
- package/dist/components.css +1 -1
- package/dist/index.js +53 -62
- package/dist/index.js.map +1 -1
- package/dist/locale.js +12 -15
- package/dist/locale.js.map +1 -1
- package/dist/{searchFuzzy-13c124f8.js → searchFuzzy-74a7de1c.js} +2 -2
- package/dist/{searchFuzzy-13c124f8.js.map → searchFuzzy-74a7de1c.js.map} +1 -1
- package/dist/storage.js +6 -11
- package/dist/storage.js.map +1 -1
- package/dist/tooltip.js +21 -26
- package/dist/tooltip.js.map +1 -1
- package/dist/useGoogleMaps.js +91 -226
- package/dist/useGoogleMaps.js.map +1 -1
- package/dist/useModals.js +21 -31
- package/dist/useModals.js.map +1 -1
- package/dist/useSearch.js +17 -22
- package/dist/useSearch.js.map +1 -1
- package/dist/useToasts.js +25 -36
- package/dist/useToasts.js.map +1 -1
- package/dist/useValidation.js +79 -108
- package/dist/useValidation.js.map +1 -1
- package/dist/utils/calculateElementOverflow.js +9 -14
- package/dist/utils/calculateElementOverflow.js.map +1 -1
- package/dist/utils/createQueryString.js +9 -15
- package/dist/utils/createQueryString.js.map +1 -1
- package/dist/utils/helpers.js +46 -59
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/i18n.js +17 -20
- package/dist/utils/i18n.js.map +1 -1
- package/dist/utils/searchFuzzy.js +7 -12
- package/dist/utils/searchFuzzy.js.map +1 -1
- package/dist/utils/storage.js +10 -15
- package/dist/utils/storage.js.map +1 -1
- package/dist/viewable.js +26 -34
- package/dist/viewable.js.map +1 -1
- package/package.json +4 -6
- package/dist/Icon.vue_used_vue_type_style_index_0_lang.module-d2507af3.js +0 -243
- package/dist/Icon.vue_used_vue_type_style_index_0_lang.module-d2507af3.js.map +0 -1
- package/dist/_MapCache-65811284.js +0 -188
- package/dist/_MapCache-65811284.js.map +0 -1
- package/dist/_Uint8Array-06e4d083.js +0 -66
- package/dist/_Uint8Array-06e4d083.js.map +0 -1
- package/dist/_baseAssignValue-dd1499b4.js +0 -22
- package/dist/_baseAssignValue-dd1499b4.js.map +0 -1
- package/dist/_baseIsEqual-d594c87f.js +0 -171
- package/dist/_baseIsEqual-d594c87f.js.map +0 -1
- package/dist/_createCompounder-ae01a723.js +0 -245
- package/dist/_createCompounder-ae01a723.js.map +0 -1
- package/dist/_getAllKeys-5e735d41.js +0 -44
- package/dist/_getAllKeys-5e735d41.js.map +0 -1
- package/dist/_getPrototype-3e6fccd6.js +0 -7
- package/dist/_getPrototype-3e6fccd6.js.map +0 -1
- package/dist/_getTag-4db47fa6.js +0 -47
- package/dist/_getTag-4db47fa6.js.map +0 -1
- package/dist/_initCloneObject-161353b9.js +0 -88
- package/dist/_initCloneObject-161353b9.js.map +0 -1
- package/dist/_overArg-6d920d99.js +0 -9
- package/dist/_overArg-6d920d99.js.map +0 -1
- package/dist/capitalize-667d9f60.js +0 -42
- package/dist/capitalize-667d9f60.js.map +0 -1
- package/dist/cloneDeep-5bc375b0.js +0 -146
- package/dist/cloneDeep-5bc375b0.js.map +0 -1
- package/dist/debounce-6aca1ca9.js +0 -86
- package/dist/debounce-6aca1ca9.js.map +0 -1
- package/dist/get-27d90892.js +0 -66
- package/dist/get-27d90892.js.map +0 -1
- package/dist/identity-452d03fd.js +0 -20
- package/dist/identity-452d03fd.js.map +0 -1
- package/dist/isArrayLike-09233e52.js +0 -61
- package/dist/isArrayLike-09233e52.js.map +0 -1
- package/dist/isEmpty-2fbad344.js +0 -23
- package/dist/isEmpty-2fbad344.js.map +0 -1
- package/dist/isEqual-fca467fb.js +0 -8
- package/dist/isEqual-fca467fb.js.map +0 -1
- package/dist/isObjectLike-54341556.js +0 -39
- package/dist/isObjectLike-54341556.js.map +0 -1
- package/dist/isPlainObject-55c7f916.js +0 -16
- package/dist/isPlainObject-55c7f916.js.map +0 -1
- package/dist/merge-b14fad9d.js +0 -124
- package/dist/merge-b14fad9d.js.map +0 -1
- package/dist/toString-7d5bf363.js +0 -29
- package/dist/toString-7d5bf363.js.map +0 -1
- package/dist/uniqueId-847efe53.js +0 -10
- package/dist/uniqueId-847efe53.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageNavigation.js","sources":["../src/components/PageNavigation/components/NavItem.vue","../src/components/PageNavigation/PageNavigation.vue"],"sourcesContent":["<script>\n import isFunction from 'lodash-es/isFunction';\n\n import Chip from '../../Chip/Chip.vue';\n\n export default {\n name: 'nav-item',\n\n components: {\n 'll-chip': Chip,\n },\n\n inheritAttrs: false,\n\n props: {\n /**\n * Used to display the bubble count, i.e. orders, messages\n */\n badge: {\n type: [Number, String],\n default: 0,\n },\n\n /**\n * The background color of the badge.\n * Currently limited to a subset of brand colors.\n */\n badgeColor: {\n type: String,\n default: 'blue',\n validator: (value) => ['blue', 'red'].includes(value),\n },\n\n /**\n * Private/inherited - Item index.\n */\n index: {\n type: Number,\n required: true,\n },\n /**\n * Private/inherited - Whether the current tab `index` matches `activeIndex`\n */\n isActive: Boolean,\n /**\n * Private/inherited - Whether the item is inside the dropdown\n */\n isDropdown: Boolean,\n /**\n * Used to render an `<a>` tag. Denotes the target href of the link.\n */\n href: {\n default: '',\n type: String,\n },\n /**\n * The nav item label\n */\n label: {\n default: '',\n type: String,\n },\n /**\n * Used to render a `<router-link>`. Denotes the target route of the link.\n * See: https://router.vuejs.org/api/#router-link\n */\n to: {\n default: '',\n type: [Object, String],\n },\n /**\n * Will render a plain text item if true.\n * Accepts a function to ensure the value is up-to-date, such as when it comes from vuex\n */\n disabled: {\n default: false,\n type: [Boolean, Function],\n },\n },\n\n computed: {\n isDisabled() {\n if (isFunction(this.disabled)) {\n return this.disabled();\n }\n\n return this.disabled;\n },\n },\n\n methods: {\n /**\n * Customer Active Class matcher.\n *\n * This attempts to match the URL ignoring the path params.\n */\n hasActiveClass(path) {\n if (path === this.$route.path) {\n return true;\n } else if (this.$route.path.includes(path)) {\n const sliceIndex = (this.$route.path.length - this.$route.path.lastIndexOf('/')) * -1;\n const parentPath = this.$route.path.slice(0, sliceIndex);\n\n return path === parentPath;\n }\n },\n },\n };\n</script>\n\n<template>\n <li v-if=\"isDisabled\" aria-disabled=\"true\" :data-id=\"index\" v-bind=\"$attrs\">\n <span :class=\"[$style.link, { [$style['dropdown-link']]: isDropdown }, $style['is-disabled']]\">{{ label }}</span>\n </li>\n <template v-else>\n <router-link v-if=\"to\" v-slot=\"{ route, navigate }\" custom :to=\"to\">\n <li\n role=\"tab\"\n :data-id=\"index\"\n :class=\"[{ [$style['is-active']]: hasActiveClass(route.path) }, 'cursor-pointer']\"\n v-bind=\"$attrs\"\n @click=\"navigate\"\n >\n <a :class=\"[$style.link, { [$style['dropdown-link']]: isDropdown }]\" :href=\"to?.name || to\">\n {{ label }}\n <ll-chip v-if=\"badge\" radius=\"pill\" shade=\"main\" size=\"small\" :class=\"$style.badge\" :color=\"badgeColor\">{{\n badge\n }}</ll-chip>\n </a>\n </li>\n </router-link>\n <li\n v-else\n role=\"tab\"\n :aria-selected=\"isActive || null\"\n :class=\"{ [$style['is-active']]: isActive }\"\n :data-id=\"index\"\n v-bind=\"$attrs\"\n >\n <a :class=\"[$style.link, { [$style['dropdown-link']]: isDropdown }]\" :href=\"href\">\n {{ label }}\n <ll-chip v-if=\"badge\" radius=\"pill\" shade=\"main\" size=\"small\" :class=\"$style.badge\" :color=\"badgeColor\">{{\n badge\n }}</ll-chip>\n </a>\n </li>\n </template>\n</template>\n\n<style lang=\"scss\" module>\n .link {\n border-bottom: border(medium, transparent);\n color: var(--color-ice-700);\n display: block;\n font-family: $font-family-primary;\n font-weight: typo('h3', 'weight');\n line-height: 1.75em;\n padding: space(1) 0;\n transition: color $primary-transition;\n white-space: nowrap;\n\n &:hover,\n &:focus {\n color: var(--color-blue);\n outline: 0;\n text-decoration: none;\n }\n\n .is-active & {\n color: var(--color-blue);\n\n &,\n &:hover,\n &:focus {\n background-color: transparent;\n border-bottom-color: var(--color-blue);\n }\n\n &:focus {\n color: var(--color-blue);\n }\n }\n\n &.is-disabled {\n pointer-events: none;\n color: var(--color-ice-500);\n }\n }\n\n .dropdown-link {\n border-bottom: 0;\n border-radius: $border-radius;\n font-size: typo('button', 'size');\n height: space(4);\n line-height: space(4);\n padding: 0 space(1);\n transition: none;\n\n &:hover,\n &:focus,\n &:active {\n background: var(--color-blue);\n color: var(--color-white);\n text-decoration: none;\n }\n\n .is-active &,\n .is-active &:hover,\n .is-active &:focus {\n color: var(--color-blue);\n }\n }\n\n .badge {\n margin-left: 2px;\n }\n</style>\n","<script>\n import { t } from '../../locale';\n import Dropdown from '../Dropdown/Dropdown.vue';\n import Icon from '../Icon/Icon.vue';\n import NavItem from './components/NavItem.vue';\n\n export { default as NavItem } from './components/NavItem.vue';\n\n export default {\n name: 'll-page-navigation',\n\n components: {\n 'll-dropdown': Dropdown,\n 'll-icon': Icon,\n NavItem,\n },\n\n props: {\n /**\n * Index of active tab (zero-based)\n */\n activeIndex: {\n type: Number,\n default: 0,\n },\n /**\n * Array of tabs. A `tab` is an object containing a `label` and either an `href` | `to`\n */\n items: {\n type: Array,\n default: () => [],\n },\n },\n\n data() {\n return {\n hasIntersectionObserver: 'IntersectionObserver' in window,\n observer: undefined,\n overflowIds: [],\n toggleWidth: 0,\n moreText: t('ll.pageNavigation.more'),\n };\n },\n\n watch: {\n items() {\n this.destroyObserver();\n this.observe();\n },\n },\n\n mounted() {\n this.observe();\n },\n\n activated() {\n this.observe();\n },\n\n deactivated() {\n this.destroyObserver();\n },\n\n beforeUnmount() {\n this.destroyObserver();\n },\n\n methods: {\n /**\n * Event emitted when a tab is clicked, with the target tab index.\n */\n observe() {\n if (this.hasIntersectionObserver) {\n const tabs = Array.from(this.$refs.tabList.children);\n\n const options = {\n root: this.$refs.tabList,\n rootMargin: '0px 0px 0px 0px',\n threshold: Array.from({ length: 100 }).map((v, i) => (i + 1) / 100),\n };\n\n this.observer = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n const dataId = entry.target.getAttribute('data-id');\n\n /**\n * Check for partial intersection.\n * Zooming out can result in ratio of approx 0.984\n * Anything higher will result in nav items disappearing\n */\n if (entry.intersectionRatio > 0.96) {\n // show tab, hide in dropdown\n if (this.overflowIds.includes(dataId)) {\n this.overflowIds.splice(this.overflowIds.indexOf(dataId), 1);\n }\n } else {\n // hide tab, show in dropdown\n if (!this.overflowIds.includes(dataId)) {\n this.overflowIds.push(dataId);\n }\n }\n });\n }, options);\n\n tabs.forEach((element) => {\n this.observer.observe(element);\n });\n\n this.toggleWidth = this.$refs.toggle.$el?.getBoundingClientRect().width;\n }\n },\n\n destroyObserver() {\n if (this.observer) {\n this.observer.disconnect();\n this.observer = undefined;\n }\n },\n },\n };\n</script>\n\n<template>\n <div class=\"container\">\n <nav :class=\"[$style.tabs, { [$style['is-scrollable']]: !hasIntersectionObserver }]\">\n <ul\n ref=\"tabList\"\n :class=\"$style.list\"\n :style=\"{\n width: `calc(100% - ${toggleWidth}px)`,\n }\"\n >\n <NavItem\n v-for=\"(item, index) in items\"\n :key=\"index\"\n :class=\"[$style.item, { [$style['is-invisible']]: overflowIds.includes(`${index}`) }]\"\n :badge=\"item.badge\"\n :badge-color=\"item.badgeColor\"\n :data-id=\"index\"\n :href=\"item.href\"\n :index=\"index\"\n :is-active=\"index === activeIndex\"\n :label=\"item.label\"\n :to=\"item.to\"\n :disabled=\"item.disabled\"\n />\n </ul>\n <ll-dropdown\n ref=\"toggle\"\n :class=\"[$style.dropdown, { [$style['is-visible']]: overflowIds.length }]\"\n :offset=\"{ x: -1 }\"\n >\n <template #toggle=\"{ toggle }\">\n <button\n aria-haspopup=\"true\"\n :class=\"[$style.link, $style['dropdown-toggle']]\"\n type=\"button\"\n aria-expanded=\"false\"\n @click=\"toggle\"\n >\n {{ moreText }}\n <ll-icon name=\"caret-down\" :class=\"$style['dropdown-icon']\" />\n </button>\n </template>\n\n <template #default>\n <ul :class=\"$style['dropdown-list']\">\n <NavItem\n v-for=\"(item, index) in items\"\n :key=\"index\"\n :class=\"{ hidden: !overflowIds.includes(`${index}`) }\"\n :href=\"item.href\"\n :index=\"index\"\n :is-active=\"index === activeIndex\"\n :is-dropdown=\"true\"\n :label=\"item.label\"\n :to=\"item.to\"\n :disabled=\"item?.disabled ?? false\"\n />\n </ul>\n </template>\n </ll-dropdown>\n </nav>\n </div>\n</template>\n\n<style lang=\"scss\" module>\n .link {\n border-bottom: border(medium, transparent);\n color: var(--color-ice-700);\n display: block;\n font-family: $font-family-primary;\n font-weight: typo('h3', 'weight');\n line-height: 1.75em;\n padding: space(1) 0;\n transition: color $secondary-transition;\n white-space: nowrap;\n\n &:hover,\n &:focus {\n color: var(--color-blue);\n outline: 0;\n text-decoration: none;\n }\n\n .is-active & {\n color: var(--color-blue);\n\n &,\n &:hover,\n &:focus {\n background-color: transparent;\n border-bottom-color: var(--color-blue);\n }\n\n &:focus {\n color: var(--color-blue);\n }\n }\n }\n\n .tabs {\n position: relative;\n\n &.is-scrollable {\n margin-right: 0;\n max-width: 100%;\n overflow: auto;\n }\n }\n\n .list {\n display: inline-flex;\n list-style: none;\n overflow: hidden;\n padding: 0;\n position: relative;\n }\n\n .item {\n padding: 0 space(2) 0 0;\n\n @include breakpoint('md') {\n padding-right: space(3);\n }\n\n &.is-active {\n transition: none !important;\n }\n }\n\n .is-invisible {\n visibility: hidden;\n }\n\n .tabs .dropdown {\n display: inline-flex;\n height: 100%;\n position: absolute;\n right: 0;\n top: 0;\n visibility: hidden;\n\n &.is-visible {\n visibility: visible;\n }\n }\n\n .dropdown-list {\n @include elevation('high');\n\n background: var(--color-white);\n border: none;\n border-radius: $border-radius;\n display: block;\n list-style: none;\n margin-top: 0;\n min-width: 140px;\n padding: space(1);\n position: static;\n right: -(space(1));\n top: 100%;\n z-index: z-index(control);\n\n .is-open & {\n display: block;\n }\n\n &::before {\n @include corner;\n\n border-left: border(thin, var(--color-blue));\n border-top: border(thin, var(--color-blue));\n content: '';\n display: none;\n right: space(2);\n }\n }\n\n .dropdown-toggle {\n background: transparent;\n border: 0;\n border-bottom: border(medium, transparent);\n color: var(--color-blue);\n display: flex;\n padding-left: space(1);\n\n &:hover,\n &:focus {\n color: var(--color-blue-hover);\n }\n\n .has-active & {\n border-bottom-color: var(--color-blue);\n }\n }\n\n .dropdown-icon {\n height: icon('default', 'height');\n position: relative;\n top: 1px;\n vertical-align: bottom;\n width: icon('default', 'width');\n }\n</style>\n"],"names":["_sfc_main","Chip","value","isFunction","path","sliceIndex","parentPath","$options","_openBlock","_createElementBlock","_mergeProps","$props","_ctx","_createElementVNode","_normalizeClass","_Fragment","_createBlock","_component_router_link","route","navigate","_a","_createTextVNode","_toDisplayString","_component_ll_chip","Dropdown","Icon","NavItem","t","tabs","options","v","i","entries","entry","dataId","element","_hoisted_1","$data","_normalizeStyle","_renderList","item","index","_component_NavItem","_createVNode","_component_ll_dropdown","_withCtx","toggle","_component_ll_icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAKOA,IAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,WAAWC;AAAA,EACZ;AAAA,EAED,cAAc;AAAA,EAEd,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,OAAO;AAAA,MACL,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA,IAMD,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,MACT,WAAW,CAACC,MAAU,CAAC,QAAQ,KAAK,EAAE,SAASA,CAAK;AAAA,IACrD;AAAA;AAAA;AAAA;AAAA,IAKD,OAAO;AAAA,MACL,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA;AAAA;AAAA;AAAA,IAID,UAAU;AAAA;AAAA;AAAA;AAAA,IAIV,YAAY;AAAA;AAAA;AAAA;AAAA,IAIZ,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,MAAM;AAAA,IACP;AAAA;AAAA;AAAA;AA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A,MAAU9B,EAAW;AAAA,cAChC,eAAa;AAAA,cACb,OAAO6B,EAAK;AAAA,cACZ,IAAIA,EAAK;AAAA,cACT,WAAUA,KAAA,gBAAAA,EAAM,aAAQ;AAAA;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"PageNavigation.js","sources":["../src/components/PageNavigation/components/NavItem.vue","../src/components/PageNavigation/PageNavigation.vue"],"sourcesContent":["<script>\n import isFunction from 'lodash-es/isFunction';\n\n import Chip from '../../Chip/Chip.vue';\n\n export default {\n name: 'nav-item',\n\n components: {\n 'll-chip': Chip,\n },\n\n inheritAttrs: false,\n\n props: {\n /**\n * Used to display the bubble count, i.e. orders, messages\n */\n badge: {\n type: [Number, String],\n default: 0,\n },\n\n /**\n * The background color of the badge.\n * Currently limited to a subset of brand colors.\n */\n badgeColor: {\n type: String,\n default: 'blue',\n validator: (value) => ['blue', 'red'].includes(value),\n },\n\n /**\n * Private/inherited - Item index.\n */\n index: {\n type: Number,\n required: true,\n },\n /**\n * Private/inherited - Whether the current tab `index` matches `activeIndex`\n */\n isActive: Boolean,\n /**\n * Private/inherited - Whether the item is inside the dropdown\n */\n isDropdown: Boolean,\n /**\n * Used to render an `<a>` tag. Denotes the target href of the link.\n */\n href: {\n default: '',\n type: String,\n },\n /**\n * The nav item label\n */\n label: {\n default: '',\n type: String,\n },\n /**\n * Used to render a `<router-link>`. Denotes the target route of the link.\n * See: https://router.vuejs.org/api/#router-link\n */\n to: {\n default: '',\n type: [Object, String],\n },\n /**\n * Will render a plain text item if true.\n * Accepts a function to ensure the value is up-to-date, such as when it comes from vuex\n */\n disabled: {\n default: false,\n type: [Boolean, Function],\n },\n },\n\n computed: {\n isDisabled() {\n if (isFunction(this.disabled)) {\n return this.disabled();\n }\n\n return this.disabled;\n },\n },\n\n methods: {\n /**\n * Customer Active Class matcher.\n *\n * This attempts to match the URL ignoring the path params.\n */\n hasActiveClass(path) {\n if (path === this.$route.path) {\n return true;\n } else if (this.$route.path.includes(path)) {\n const sliceIndex = (this.$route.path.length - this.$route.path.lastIndexOf('/')) * -1;\n const parentPath = this.$route.path.slice(0, sliceIndex);\n\n return path === parentPath;\n }\n },\n },\n };\n</script>\n\n<template>\n <li v-if=\"isDisabled\" aria-disabled=\"true\" :data-id=\"index\" v-bind=\"$attrs\">\n <span :class=\"[$style.link, { [$style['dropdown-link']]: isDropdown }, $style['is-disabled']]\">{{ label }}</span>\n </li>\n <template v-else>\n <router-link v-if=\"to\" v-slot=\"{ route, navigate }\" custom :to=\"to\">\n <li\n role=\"tab\"\n :data-id=\"index\"\n :class=\"[{ [$style['is-active']]: hasActiveClass(route.path) }, 'cursor-pointer']\"\n v-bind=\"$attrs\"\n @click=\"navigate\"\n >\n <a :class=\"[$style.link, { [$style['dropdown-link']]: isDropdown }]\" :href=\"to?.name || to\">\n {{ label }}\n <ll-chip v-if=\"badge\" radius=\"pill\" shade=\"main\" size=\"small\" :class=\"$style.badge\" :color=\"badgeColor\">{{\n badge\n }}</ll-chip>\n </a>\n </li>\n </router-link>\n <li\n v-else\n role=\"tab\"\n :aria-selected=\"isActive || null\"\n :class=\"{ [$style['is-active']]: isActive }\"\n :data-id=\"index\"\n v-bind=\"$attrs\"\n >\n <a :class=\"[$style.link, { [$style['dropdown-link']]: isDropdown }]\" :href=\"href\">\n {{ label }}\n <ll-chip v-if=\"badge\" radius=\"pill\" shade=\"main\" size=\"small\" :class=\"$style.badge\" :color=\"badgeColor\">{{\n badge\n }}</ll-chip>\n </a>\n </li>\n </template>\n</template>\n\n<style lang=\"scss\" module>\n .link {\n border-bottom: border(medium, transparent);\n color: var(--color-ice-700);\n display: block;\n font-family: $font-family-primary;\n font-weight: typo('h3', 'weight');\n line-height: 1.75em;\n padding: space(1) 0;\n transition: color $primary-transition;\n white-space: nowrap;\n\n &:hover,\n &:focus {\n color: var(--color-blue);\n outline: 0;\n text-decoration: none;\n }\n\n .is-active & {\n color: var(--color-blue);\n\n &,\n &:hover,\n &:focus {\n background-color: transparent;\n border-bottom-color: var(--color-blue);\n }\n\n &:focus {\n color: var(--color-blue);\n }\n }\n\n &.is-disabled {\n pointer-events: none;\n color: var(--color-ice-500);\n }\n }\n\n .dropdown-link {\n border-bottom: 0;\n border-radius: $border-radius;\n font-size: typo('button', 'size');\n height: space(4);\n line-height: space(4);\n padding: 0 space(1);\n transition: none;\n\n &:hover,\n &:focus,\n &:active {\n background: var(--color-blue);\n color: var(--color-white);\n text-decoration: none;\n }\n\n .is-active &,\n .is-active &:hover,\n .is-active &:focus {\n color: var(--color-blue);\n }\n }\n\n .badge {\n margin-left: 2px;\n }\n</style>\n","<script>\n import { t } from '../../locale';\n import Dropdown from '../Dropdown/Dropdown.vue';\n import Icon from '../Icon/Icon.vue';\n import NavItem from './components/NavItem.vue';\n\n export { default as NavItem } from './components/NavItem.vue';\n\n export default {\n name: 'll-page-navigation',\n\n components: {\n 'll-dropdown': Dropdown,\n 'll-icon': Icon,\n NavItem,\n },\n\n props: {\n /**\n * Index of active tab (zero-based)\n */\n activeIndex: {\n type: Number,\n default: 0,\n },\n /**\n * Array of tabs. A `tab` is an object containing a `label` and either an `href` | `to`\n */\n items: {\n type: Array,\n default: () => [],\n },\n },\n\n data() {\n return {\n hasIntersectionObserver: 'IntersectionObserver' in window,\n observer: undefined,\n overflowIds: [],\n toggleWidth: 0,\n moreText: t('ll.pageNavigation.more'),\n };\n },\n\n watch: {\n items() {\n this.destroyObserver();\n this.observe();\n },\n },\n\n mounted() {\n this.observe();\n },\n\n activated() {\n this.observe();\n },\n\n deactivated() {\n this.destroyObserver();\n },\n\n beforeUnmount() {\n this.destroyObserver();\n },\n\n methods: {\n /**\n * Event emitted when a tab is clicked, with the target tab index.\n */\n observe() {\n if (this.hasIntersectionObserver) {\n const tabs = Array.from(this.$refs.tabList.children);\n\n const options = {\n root: this.$refs.tabList,\n rootMargin: '0px 0px 0px 0px',\n threshold: Array.from({ length: 100 }).map((v, i) => (i + 1) / 100),\n };\n\n this.observer = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n const dataId = entry.target.getAttribute('data-id');\n\n /**\n * Check for partial intersection.\n * Zooming out can result in ratio of approx 0.984\n * Anything higher will result in nav items disappearing\n */\n if (entry.intersectionRatio > 0.96) {\n // show tab, hide in dropdown\n if (this.overflowIds.includes(dataId)) {\n this.overflowIds.splice(this.overflowIds.indexOf(dataId), 1);\n }\n } else {\n // hide tab, show in dropdown\n if (!this.overflowIds.includes(dataId)) {\n this.overflowIds.push(dataId);\n }\n }\n });\n }, options);\n\n tabs.forEach((element) => {\n this.observer.observe(element);\n });\n\n this.toggleWidth = this.$refs.toggle.$el?.getBoundingClientRect().width;\n }\n },\n\n destroyObserver() {\n if (this.observer) {\n this.observer.disconnect();\n this.observer = undefined;\n }\n },\n },\n };\n</script>\n\n<template>\n <div class=\"container\">\n <nav :class=\"[$style.tabs, { [$style['is-scrollable']]: !hasIntersectionObserver }]\">\n <ul\n ref=\"tabList\"\n :class=\"$style.list\"\n :style=\"{\n width: `calc(100% - ${toggleWidth}px)`,\n }\"\n >\n <NavItem\n v-for=\"(item, index) in items\"\n :key=\"index\"\n :class=\"[$style.item, { [$style['is-invisible']]: overflowIds.includes(`${index}`) }]\"\n :badge=\"item.badge\"\n :badge-color=\"item.badgeColor\"\n :data-id=\"index\"\n :href=\"item.href\"\n :index=\"index\"\n :is-active=\"index === activeIndex\"\n :label=\"item.label\"\n :to=\"item.to\"\n :disabled=\"item.disabled\"\n />\n </ul>\n <ll-dropdown\n ref=\"toggle\"\n :class=\"[$style.dropdown, { [$style['is-visible']]: overflowIds.length }]\"\n :offset=\"{ x: -1 }\"\n >\n <template #toggle=\"{ toggle }\">\n <button\n aria-haspopup=\"true\"\n :class=\"[$style.link, $style['dropdown-toggle']]\"\n type=\"button\"\n aria-expanded=\"false\"\n @click=\"toggle\"\n >\n {{ moreText }}\n <ll-icon name=\"caret-down\" :class=\"$style['dropdown-icon']\" />\n </button>\n </template>\n\n <template #default>\n <ul :class=\"$style['dropdown-list']\">\n <NavItem\n v-for=\"(item, index) in items\"\n :key=\"index\"\n :class=\"{ hidden: !overflowIds.includes(`${index}`) }\"\n :href=\"item.href\"\n :index=\"index\"\n :is-active=\"index === activeIndex\"\n :is-dropdown=\"true\"\n :label=\"item.label\"\n :to=\"item.to\"\n :disabled=\"item?.disabled ?? false\"\n />\n </ul>\n </template>\n </ll-dropdown>\n </nav>\n </div>\n</template>\n\n<style lang=\"scss\" module>\n .link {\n border-bottom: border(medium, transparent);\n color: var(--color-ice-700);\n display: block;\n font-family: $font-family-primary;\n font-weight: typo('h3', 'weight');\n line-height: 1.75em;\n padding: space(1) 0;\n transition: color $secondary-transition;\n white-space: nowrap;\n\n &:hover,\n &:focus {\n color: var(--color-blue);\n outline: 0;\n text-decoration: none;\n }\n\n .is-active & {\n color: var(--color-blue);\n\n &,\n &:hover,\n &:focus {\n background-color: transparent;\n border-bottom-color: var(--color-blue);\n }\n\n &:focus {\n color: var(--color-blue);\n }\n }\n }\n\n .tabs {\n position: relative;\n\n &.is-scrollable {\n margin-right: 0;\n max-width: 100%;\n overflow: auto;\n }\n }\n\n .list {\n display: inline-flex;\n list-style: none;\n overflow: hidden;\n padding: 0;\n position: relative;\n }\n\n .item {\n padding: 0 space(2) 0 0;\n\n @include breakpoint('md') {\n padding-right: space(3);\n }\n\n &.is-active {\n transition: none !important;\n }\n }\n\n .is-invisible {\n visibility: hidden;\n }\n\n .tabs .dropdown {\n display: inline-flex;\n height: 100%;\n position: absolute;\n right: 0;\n top: 0;\n visibility: hidden;\n\n &.is-visible {\n visibility: visible;\n }\n }\n\n .dropdown-list {\n @include elevation('high');\n\n background: var(--color-white);\n border: none;\n border-radius: $border-radius;\n display: block;\n list-style: none;\n margin-top: 0;\n min-width: 140px;\n padding: space(1);\n position: static;\n right: -(space(1));\n top: 100%;\n z-index: z-index(control);\n\n .is-open & {\n display: block;\n }\n\n &::before {\n @include corner;\n\n border-left: border(thin, var(--color-blue));\n border-top: border(thin, var(--color-blue));\n content: '';\n display: none;\n right: space(2);\n }\n }\n\n .dropdown-toggle {\n background: transparent;\n border: 0;\n border-bottom: border(medium, transparent);\n color: var(--color-blue);\n display: flex;\n padding-left: space(1);\n\n &:hover,\n &:focus {\n color: var(--color-blue-hover);\n }\n\n .has-active & {\n border-bottom-color: var(--color-blue);\n }\n }\n\n .dropdown-icon {\n height: icon('default', 'height');\n position: relative;\n top: 1px;\n vertical-align: bottom;\n width: icon('default', 'width');\n }\n</style>\n"],"names":["_sfc_main","Chip","value","isFunction","path","sliceIndex","parentPath","$options","_openBlock","_createElementBlock","_mergeProps","$props","_ctx","_createElementVNode","_normalizeClass","_Fragment","_createBlock","_component_router_link","route","navigate","_a","_createTextVNode","_toDisplayString","_component_ll_chip","Dropdown","Icon","NavItem","t","tabs","options","v","i","entries","entry","dataId","element","_hoisted_1","$data","_normalizeStyle","_renderList","item","index","_component_NavItem","_createVNode","_component_ll_dropdown","_withCtx","toggle","_component_ll_icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;GAKOA,IAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,WAAWC;AAAA,EACZ;AAAA,EAED,cAAc;AAAA,EAEd,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,OAAO;AAAA,MACL,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA,IAMD,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,MACT,WAAW,CAACC,MAAU,CAAC,QAAQ,KAAK,EAAE,SAASA,CAAK;AAAA,IACrD;AAAA;AAAA;AAAA;AAAA,IAKD,OAAO;AAAA,MACL,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA;AAAA;AAAA;AAAA,IAID,UAAU;AAAA;AAAA;AAAA;AAAA,IAIV,YAAY;AAAA;AAAA;AAAA;AAAA,IAIZ,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,MAAM;AAAA,IACP;AAAA;AAAA;AA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,aAAWA,MAAU9B,EAAW;AAAA,cAChC,eAAa;AAAA,cACb,OAAO6B,EAAK;AAAA,cACZ,IAAIA,EAAK;AAAA,cACT,WAAUA,KAAA,gBAAAA,EAAM,aAAQ;AAAA;;;;;;;;;;;"}
|
package/dist/Paginate.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { defineComponent as w, useCssModule as y, computed as S, openBlock as r, createElementBlock as
|
|
2
|
-
import
|
|
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
|
+
import m from "./Icon.js";
|
|
3
3
|
import { s as M } from "./Paginate.vue_used_vue_type_style_index_0_lang.module-e579235f.js";
|
|
4
4
|
import { _ as E } from "./_plugin-vue_export-helper-dad06003.js";
|
|
5
|
-
import "
|
|
6
|
-
import "./uniqueId-847efe53.js";
|
|
7
|
-
import "./toString-7d5bf363.js";
|
|
8
|
-
import "./isObjectLike-54341556.js";
|
|
5
|
+
import "lodash-es/uniqueId";
|
|
9
6
|
import "./index-79ce320f.js";
|
|
7
|
+
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
10
8
|
const L = {
|
|
11
9
|
class: "stash-paginate tw-flex tw-justify-center",
|
|
12
10
|
"data-test": "stash-paginate"
|
|
@@ -20,63 +18,63 @@ const L = {
|
|
|
20
18
|
},
|
|
21
19
|
emits: ["set-page"],
|
|
22
20
|
setup(h, { emit: v }) {
|
|
23
|
-
const
|
|
24
|
-
function u(
|
|
25
|
-
v("set-page",
|
|
21
|
+
const t = h, n = y(), s = S(() => Math.ceil(t.listLength / t.pageSize));
|
|
22
|
+
function u(e) {
|
|
23
|
+
v("set-page", e);
|
|
26
24
|
}
|
|
27
25
|
function P() {
|
|
28
|
-
|
|
26
|
+
t.currentPage < s.value && u(t.currentPage + 1);
|
|
29
27
|
}
|
|
30
28
|
function _() {
|
|
31
|
-
|
|
29
|
+
t.currentPage > 1 && u(t.currentPage - 1);
|
|
32
30
|
}
|
|
33
|
-
function b(
|
|
34
|
-
const d = Math.abs(
|
|
35
|
-
return s.value < 10 ||
|
|
31
|
+
function b(e) {
|
|
32
|
+
const d = Math.abs(t.currentPage - e);
|
|
33
|
+
return s.value < 10 || e === 1 || e === s.value || t.currentPage < 6 && e < 8 || s.value - t.currentPage < 5 && s.value - e < 7 || d < 3;
|
|
36
34
|
}
|
|
37
|
-
function k(
|
|
38
|
-
return s.value > 9 &&
|
|
35
|
+
function k(e) {
|
|
36
|
+
return s.value > 9 && t.currentPage > 5 && e === 2;
|
|
39
37
|
}
|
|
40
|
-
function C(
|
|
41
|
-
return s.value > 9 && s.value -
|
|
38
|
+
function C(e) {
|
|
39
|
+
return s.value > 9 && s.value - t.currentPage > 4 && e === s.value - 1;
|
|
42
40
|
}
|
|
43
|
-
return (
|
|
41
|
+
return (e, d) => (r(), l("div", L, [
|
|
44
42
|
c("ul", {
|
|
45
|
-
class: o(["stash-paginate__list tw-flex",
|
|
43
|
+
class: o(["stash-paginate__list tw-flex", i(n).pagination]),
|
|
46
44
|
"data-test": "stash-paginate|list"
|
|
47
45
|
}, [
|
|
48
46
|
c("button", {
|
|
49
47
|
"data-test": "stash-paginate|prev-page",
|
|
50
|
-
class: o([
|
|
48
|
+
class: o([i(n).prev, { [i(n)["is-disabled"]]: e.currentPage === 1 }]),
|
|
51
49
|
onClick: _
|
|
52
50
|
}, [
|
|
53
|
-
f(
|
|
51
|
+
f(m, {
|
|
54
52
|
size: "small",
|
|
55
53
|
name: "chevron-left"
|
|
56
54
|
})
|
|
57
55
|
], 2),
|
|
58
|
-
(r(!0),
|
|
59
|
-
k(a) ? (r(),
|
|
56
|
+
(r(!0), l(g, null, x(s.value, (a) => (r(), l(g, null, [
|
|
57
|
+
k(a) ? (r(), l("button", {
|
|
60
58
|
key: `${a}-ellipsis`,
|
|
61
59
|
"data-test": "stash-paginate|first-ellipsis"
|
|
62
60
|
}, " … ")) : p("", !0),
|
|
63
|
-
b(a) ? (r(),
|
|
61
|
+
b(a) ? (r(), l("button", {
|
|
64
62
|
key: a,
|
|
65
63
|
"data-test": "stash-paginate|page-number",
|
|
66
|
-
class: o({ [
|
|
64
|
+
class: o({ [i(n)["is-active"]]: e.currentPage === a }),
|
|
67
65
|
onClick: (B) => u(a)
|
|
68
66
|
}, z(a), 11, $)) : p("", !0),
|
|
69
|
-
C(a) ? (r(),
|
|
67
|
+
C(a) ? (r(), l("button", {
|
|
70
68
|
key: `${a}-ellipsis`,
|
|
71
69
|
"data-test": "stash-paginate|last-ellipsis"
|
|
72
70
|
}, " … ")) : p("", !0)
|
|
73
71
|
], 64))), 256)),
|
|
74
72
|
c("button", {
|
|
75
73
|
"data-test": "stash-paginate|next-page",
|
|
76
|
-
class: o([
|
|
74
|
+
class: o([i(n).next, { [i(n)["is-disabled"]]: e.currentPage === s.value }]),
|
|
77
75
|
onClick: P
|
|
78
76
|
}, [
|
|
79
|
-
f(
|
|
77
|
+
f(m, {
|
|
80
78
|
size: "small",
|
|
81
79
|
class: "tw-rotate-180",
|
|
82
80
|
name: "chevron-left"
|
|
@@ -87,8 +85,8 @@ const L = {
|
|
|
87
85
|
}
|
|
88
86
|
}), V = {
|
|
89
87
|
$style: M
|
|
90
|
-
},
|
|
88
|
+
}, H = /* @__PURE__ */ E(N, [["__cssModules", V]]);
|
|
91
89
|
export {
|
|
92
|
-
|
|
90
|
+
H as default
|
|
93
91
|
};
|
|
94
92
|
//# sourceMappingURL=Paginate.js.map
|
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: theme(colors.blue.DEFAULT);\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: theme(colors.blue.DEFAULT);\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;\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":"
|
|
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: theme(colors.blue.DEFAULT);\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: theme(colors.blue.DEFAULT);\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;\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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/QuickAction.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { defineComponent as l, computed as o, openBlock as u, createBlock as _, resolveDynamicComponent as
|
|
2
|
-
import
|
|
3
|
-
import { _ as
|
|
4
|
-
import "
|
|
5
|
-
import "./uniqueId-847efe53.js";
|
|
6
|
-
import "./toString-7d5bf363.js";
|
|
7
|
-
import "./isObjectLike-54341556.js";
|
|
1
|
+
import { defineComponent as l, computed as o, openBlock as u, createBlock as _, resolveDynamicComponent as d, mergeProps as p, withCtx as f, createElementVNode as e, createVNode as s, toDisplayString as n } from "vue";
|
|
2
|
+
import r from "./Icon.js";
|
|
3
|
+
import { _ as m } from "./_plugin-vue_export-helper-dad06003.js";
|
|
4
|
+
import "lodash-es/uniqueId";
|
|
8
5
|
import "./index-79ce320f.js";
|
|
6
|
+
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
9
7
|
const w = { class: "content tw-flex tw-items-center" }, h = { class: "tw-flex tw-items-center tw-justify-center tw-rounded tw-bg-blue-100 tw-p-3" }, x = { class: "tw-flex-1" }, b = { class: "tw-text-blue" }, v = { class: "subtitle tw-text-xs lg:tw-mb-0 tw-text-ice-700 tw-font-normal" }, k = /* @__PURE__ */ l({
|
|
10
8
|
__name: "QuickAction",
|
|
11
9
|
props: {
|
|
@@ -21,23 +19,23 @@ const w = { class: "content tw-flex tw-items-center" }, h = { class: "tw-flex tw
|
|
|
21
19
|
} : t.href ? {
|
|
22
20
|
href: t.href
|
|
23
21
|
} : {});
|
|
24
|
-
return (g, y) => (u(), _(
|
|
22
|
+
return (g, y) => (u(), _(d(i.value), p(a.value, {
|
|
25
23
|
class: "stash-quick-action root tw-p-3 tw-shadow tw-rounded",
|
|
26
24
|
"data-test": "stash-quick-action"
|
|
27
25
|
}), {
|
|
28
|
-
default:
|
|
26
|
+
default: f(() => [
|
|
29
27
|
e("div", w, [
|
|
30
28
|
e("div", h, [
|
|
31
|
-
s(
|
|
29
|
+
s(r, {
|
|
32
30
|
name: t.icon,
|
|
33
31
|
class: "tw-text-blue"
|
|
34
32
|
}, null, 8, ["name"])
|
|
35
33
|
]),
|
|
36
34
|
e("div", x, [
|
|
37
|
-
e("h4", b,
|
|
38
|
-
e("p", v,
|
|
35
|
+
e("h4", b, n(t.title), 1),
|
|
36
|
+
e("p", v, n(t.subtitle), 1)
|
|
39
37
|
]),
|
|
40
|
-
s(
|
|
38
|
+
s(r, {
|
|
41
39
|
name: "arrow-right",
|
|
42
40
|
class: "tw-text-blue"
|
|
43
41
|
})
|
|
@@ -47,8 +45,8 @@ const w = { class: "content tw-flex tw-items-center" }, h = { class: "tw-flex tw
|
|
|
47
45
|
}, 16));
|
|
48
46
|
}
|
|
49
47
|
});
|
|
50
|
-
const
|
|
48
|
+
const I = /* @__PURE__ */ m(k, [["__scopeId", "data-v-704bf5c4"]]);
|
|
51
49
|
export {
|
|
52
|
-
|
|
50
|
+
I as default
|
|
53
51
|
};
|
|
54
52
|
//# 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 { computed } 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\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 root tw-p-3 tw-shadow tw-rounded\"\n data-test=\"stash-quick-action\"\n >\n <div class=\"content tw-flex tw-items-center\">\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\" />\n </div>\n <div class=\"tw-flex-1\">\n <h4 class=\"tw-text-blue\">{{ props.title }}</h4>\n <p class=\"subtitle tw-text-xs lg:tw-mb-0 tw-text-ice-700 tw-font-normal\">\n {{ props.subtitle }}\n </p>\n </div>\n <Icon name=\"arrow-right\" class=\"tw-text-blue\" />\n </div>\n </component>\n</template>\n\n<style scoped>\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\n .content {\n gap: 12px;\n }\n</style>\n"],"names":["is","computed","props","linkAttrs"],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuickAction.js","sources":["../src/components/QuickAction/QuickAction.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } 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\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 root tw-p-3 tw-shadow tw-rounded\"\n data-test=\"stash-quick-action\"\n >\n <div class=\"content tw-flex tw-items-center\">\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\" />\n </div>\n <div class=\"tw-flex-1\">\n <h4 class=\"tw-text-blue\">{{ props.title }}</h4>\n <p class=\"subtitle tw-text-xs lg:tw-mb-0 tw-text-ice-700 tw-font-normal\">\n {{ props.subtitle }}\n </p>\n </div>\n <Icon name=\"arrow-right\" class=\"tw-text-blue\" />\n </div>\n </component>\n</template>\n\n<style scoped>\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\n .content {\n gap: 12px;\n }\n</style>\n"],"names":["is","computed","props","linkAttrs"],"mappings":";;;;;;;;;;;;;;;;iBAkCQA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/RadioGroup.js
CHANGED
|
@@ -1,40 +1,37 @@
|
|
|
1
|
-
import { defineComponent as y, inject as x, openBlock as
|
|
2
|
-
import
|
|
3
|
-
import { _ as G } from "./Field.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { defineComponent as y, inject as x, openBlock as d, createElementBlock as n, Fragment as w, renderList as V, unref as e, normalizeClass as f, createElementVNode as o, toDisplayString as h, provide as g, computed as v, createBlock as B, withCtx as T, renderSlot as R, resolveDynamicComponent as C } from "vue";
|
|
2
|
+
import E from "lodash-es/uniqueId";
|
|
3
|
+
import { _ as G } from "./Field.vue_vue_type_script_setup_true_lang-475832fe.js";
|
|
4
4
|
import { R as $ } from "./RadioGroup.keys-974818d6.js";
|
|
5
5
|
import { _ as k } from "./_plugin-vue_export-helper-dad06003.js";
|
|
6
|
-
import "./toString-7d5bf363.js";
|
|
7
|
-
import "./isObjectLike-54341556.js";
|
|
8
6
|
import "./Label.vue_vue_type_script_setup_true_lang-1d29d98a.js";
|
|
9
7
|
import "./locale.js";
|
|
10
|
-
import "
|
|
11
|
-
import "./_MapCache-65811284.js";
|
|
8
|
+
import "lodash-es/get";
|
|
12
9
|
const O = { class: "root flex" }, W = ["id", "name", "value", "checked", "disabled"], j = ["for"], q = /* @__PURE__ */ y({
|
|
13
10
|
__name: "VariantButton",
|
|
14
11
|
setup(u) {
|
|
15
|
-
const
|
|
16
|
-
if (!
|
|
12
|
+
const r = x($.key);
|
|
13
|
+
if (!r)
|
|
17
14
|
throw new Error("VariantButton must be used with a RadioGroup instance.");
|
|
18
|
-
const { name:
|
|
19
|
-
return (I, c) => (
|
|
20
|
-
(
|
|
21
|
-
key: `${e(
|
|
15
|
+
const { name: a, disabled: _, fullWidth: p, modelValue: l, options: i, update: s } = r;
|
|
16
|
+
return (I, c) => (d(), n("div", O, [
|
|
17
|
+
(d(!0), n(w, null, V(e(i), (t) => (d(), n("div", {
|
|
18
|
+
key: `${e(a)}-${t.id}`,
|
|
22
19
|
class: f([{ "w-full": e(p) }])
|
|
23
20
|
}, [
|
|
24
21
|
o("input", {
|
|
25
|
-
id: `${e(
|
|
22
|
+
id: `${e(a)}-${t.id}`,
|
|
26
23
|
class: "sr-only",
|
|
27
24
|
type: "radio",
|
|
28
|
-
name: e(
|
|
29
|
-
value:
|
|
30
|
-
checked: e(l) ===
|
|
31
|
-
disabled: e(_) ||
|
|
25
|
+
name: e(a),
|
|
26
|
+
value: t.value,
|
|
27
|
+
checked: e(l) === t.value,
|
|
28
|
+
disabled: e(_) || t.disabled,
|
|
32
29
|
onInput: c[0] || (c[0] = //@ts-ignore
|
|
33
30
|
(...m) => e(s) && e(s)(...m))
|
|
34
31
|
}, null, 40, W),
|
|
35
32
|
o("label", {
|
|
36
|
-
for: `${e(
|
|
37
|
-
}, h(
|
|
33
|
+
for: `${e(a)}-${t.id}`
|
|
34
|
+
}, h(t.text), 9, j)
|
|
38
35
|
], 2))), 128))
|
|
39
36
|
]));
|
|
40
37
|
}
|
|
@@ -42,29 +39,29 @@ const O = { class: "root flex" }, W = ["id", "name", "value", "checked", "disabl
|
|
|
42
39
|
const S = /* @__PURE__ */ k(q, [["__scopeId", "data-v-e8a24f17"]]), D = { class: "root flex flex-wrap tw-my-1.5" }, L = ["id", "name", "value", "checked", "disabled"], N = ["for"], z = /* @__PURE__ */ y({
|
|
43
40
|
__name: "VariantChip",
|
|
44
41
|
setup(u) {
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
42
|
+
const r = x($.key);
|
|
43
|
+
if (!r)
|
|
47
44
|
throw new Error("VariantChip must be used with a RadioGroup instance.");
|
|
48
|
-
const { name:
|
|
49
|
-
return (I, c) => (
|
|
50
|
-
(
|
|
51
|
-
key: `${e(
|
|
45
|
+
const { name: a, disabled: _, fullWidth: p, modelValue: l, options: i, update: s } = r;
|
|
46
|
+
return (I, c) => (d(), n("div", D, [
|
|
47
|
+
(d(!0), n(w, null, V(e(i), (t) => (d(), n("div", {
|
|
48
|
+
key: `${e(a)}-${t.id}`,
|
|
52
49
|
class: f([{ "w-full": e(p) }])
|
|
53
50
|
}, [
|
|
54
51
|
o("input", {
|
|
55
|
-
id: `${e(
|
|
52
|
+
id: `${e(a)}-${t.id}`,
|
|
56
53
|
class: "sr-only",
|
|
57
54
|
type: "radio",
|
|
58
|
-
name: e(
|
|
59
|
-
value:
|
|
60
|
-
checked: e(l) ===
|
|
61
|
-
disabled: e(_) ||
|
|
55
|
+
name: e(a),
|
|
56
|
+
value: t.value,
|
|
57
|
+
checked: e(l) === t.value,
|
|
58
|
+
disabled: e(_) || t.disabled,
|
|
62
59
|
onInput: c[0] || (c[0] = //@ts-ignore
|
|
63
60
|
(...m) => e(s) && e(s)(...m))
|
|
64
61
|
}, null, 40, L),
|
|
65
62
|
o("label", {
|
|
66
|
-
for: `${e(
|
|
67
|
-
}, h(
|
|
63
|
+
for: `${e(a)}-${t.id}`
|
|
64
|
+
}, h(t.text), 9, N)
|
|
68
65
|
], 2))), 128))
|
|
69
66
|
]));
|
|
70
67
|
}
|
|
@@ -72,28 +69,28 @@ const S = /* @__PURE__ */ k(q, [["__scopeId", "data-v-e8a24f17"]]), D = { class:
|
|
|
72
69
|
const A = /* @__PURE__ */ k(z, [["__scopeId", "data-v-b4b020c6"]]), F = { class: "root flex flex-wrap" }, J = ["id", "name", "value", "checked", "disabled"], M = ["for"], P = /* @__PURE__ */ y({
|
|
73
70
|
__name: "VariantRadio",
|
|
74
71
|
setup(u) {
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
72
|
+
const r = x($.key);
|
|
73
|
+
if (!r)
|
|
77
74
|
throw new Error("VariantRadio must be used with a RadioGroup instance.");
|
|
78
|
-
const { name:
|
|
79
|
-
return (I, c) => (
|
|
80
|
-
(
|
|
81
|
-
key: `${e(
|
|
75
|
+
const { name: a, disabled: _, fullWidth: p, modelValue: l, options: i, update: s } = r;
|
|
76
|
+
return (I, c) => (d(), n("div", F, [
|
|
77
|
+
(d(!0), n(w, null, V(e(i), (t) => (d(), n("div", {
|
|
78
|
+
key: `${e(a)}-${t.id}`,
|
|
82
79
|
class: f([{ "w-full": e(p) }])
|
|
83
80
|
}, [
|
|
84
81
|
o("input", {
|
|
85
|
-
id: `${e(
|
|
82
|
+
id: `${e(a)}-${t.id}`,
|
|
86
83
|
type: "radio",
|
|
87
|
-
name: e(
|
|
88
|
-
value:
|
|
89
|
-
checked: e(l) ===
|
|
90
|
-
disabled: e(_) ||
|
|
84
|
+
name: e(a),
|
|
85
|
+
value: t.value,
|
|
86
|
+
checked: e(l) === t.value,
|
|
87
|
+
disabled: e(_) || t.disabled,
|
|
91
88
|
onInput: c[0] || (c[0] = //@ts-ignore
|
|
92
89
|
(...m) => e(s) && e(s)(...m))
|
|
93
90
|
}, null, 40, J),
|
|
94
91
|
o("label", {
|
|
95
|
-
for: `${e(
|
|
96
|
-
}, h(
|
|
92
|
+
for: `${e(a)}-${t.id}`
|
|
93
|
+
}, h(t.text), 9, M)
|
|
97
94
|
], 2))), 128))
|
|
98
95
|
]));
|
|
99
96
|
}
|
|
@@ -101,45 +98,45 @@ const A = /* @__PURE__ */ k(z, [["__scopeId", "data-v-b4b020c6"]]), F = { class:
|
|
|
101
98
|
const U = /* @__PURE__ */ k(P, [["__scopeId", "data-v-1962fcc7"]]), H = { class: "root flex flex-wrap" }, K = ["for"], Q = ["id", "name", "value", "checked", "disabled"], X = { class: "color-ice-900 tw-m-0" }, Y = { class: "color-ice-700 tw-m-0" }, Z = /* @__PURE__ */ y({
|
|
102
99
|
__name: "VariantTile",
|
|
103
100
|
setup(u) {
|
|
104
|
-
const
|
|
105
|
-
if (!
|
|
101
|
+
const r = x($.key);
|
|
102
|
+
if (!r)
|
|
106
103
|
throw new Error("VariantTile must be used with a RadioGroup instance.");
|
|
107
|
-
const { name:
|
|
108
|
-
return (I, c) => (
|
|
109
|
-
(
|
|
110
|
-
key: `${e(
|
|
104
|
+
const { name: a, disabled: _, fullWidth: p, modelValue: l, options: i, update: s } = r;
|
|
105
|
+
return (I, c) => (d(), n("div", H, [
|
|
106
|
+
(d(!0), n(w, null, V(e(i), (t) => (d(), n("label", {
|
|
107
|
+
key: `${e(a)}-${t.id}`,
|
|
111
108
|
class: f(["tile-container", { "w-full": e(p) }]),
|
|
112
|
-
for: `${e(
|
|
109
|
+
for: `${e(a)}-${t.id}`
|
|
113
110
|
}, [
|
|
114
111
|
o("div", {
|
|
115
112
|
class: f(["tile-header border flex", {
|
|
116
|
-
"border-blue-500 bg-blue-100 color-ice-900": e(l) ===
|
|
117
|
-
"border-ice-500 bg-ice-100 color-ice-700": e(l) !==
|
|
113
|
+
"border-blue-500 bg-blue-100 color-ice-900": e(l) === t.value,
|
|
114
|
+
"border-ice-500 bg-ice-100 color-ice-700": e(l) !== t.value
|
|
118
115
|
}])
|
|
119
116
|
}, [
|
|
120
117
|
o("input", {
|
|
121
|
-
id: `${e(
|
|
118
|
+
id: `${e(a)}-${t.id}`,
|
|
122
119
|
class: "sr-only",
|
|
123
120
|
type: "radio",
|
|
124
|
-
name: e(
|
|
125
|
-
value:
|
|
126
|
-
checked: e(l) ===
|
|
127
|
-
disabled: e(_) ||
|
|
121
|
+
name: e(a),
|
|
122
|
+
value: t.value,
|
|
123
|
+
checked: e(l) === t.value,
|
|
124
|
+
disabled: e(_) || t.disabled,
|
|
128
125
|
onInput: c[0] || (c[0] = //@ts-ignore
|
|
129
126
|
(...m) => e(s) && e(s)(...m))
|
|
130
127
|
}, null, 40, Q),
|
|
131
128
|
o("div", null, [
|
|
132
|
-
o("span", null, h(
|
|
129
|
+
o("span", null, h(t.text), 1)
|
|
133
130
|
])
|
|
134
131
|
], 2),
|
|
135
132
|
o("div", {
|
|
136
133
|
class: f(["tile-body border-r border-b border-l", {
|
|
137
|
-
"border-ice-500": e(l) !==
|
|
138
|
-
"border-blue-500": e(l) ===
|
|
134
|
+
"border-ice-500": e(l) !== t.value,
|
|
135
|
+
"border-blue-500": e(l) === t.value
|
|
139
136
|
}])
|
|
140
137
|
}, [
|
|
141
|
-
o("p", X, h(
|
|
142
|
-
o("p", Y, h(
|
|
138
|
+
o("p", X, h(t.subTitle), 1),
|
|
139
|
+
o("p", Y, h(t.subText), 1)
|
|
143
140
|
], 2)
|
|
144
141
|
], 10, K))), 128))
|
|
145
142
|
]));
|
|
@@ -147,7 +144,7 @@ const U = /* @__PURE__ */ k(P, [["__scopeId", "data-v-1962fcc7"]]), H = { class:
|
|
|
147
144
|
});
|
|
148
145
|
const ee = /* @__PURE__ */ k(Z, [["__scopeId", "data-v-e6997760"]]);
|
|
149
146
|
var b = /* @__PURE__ */ ((u) => (u.Radio = "radio", u.Button = "button", u.Chip = "chip", u.Tile = "tile", u))(b || {});
|
|
150
|
-
const
|
|
147
|
+
const ne = /* @__PURE__ */ y({
|
|
151
148
|
__name: "RadioGroup",
|
|
152
149
|
props: {
|
|
153
150
|
name: { default: void 0 },
|
|
@@ -165,48 +162,48 @@ const _e = /* @__PURE__ */ y({
|
|
|
165
162
|
showOptionalInLabel: { type: Boolean }
|
|
166
163
|
},
|
|
167
164
|
emits: ["update:modelValue"],
|
|
168
|
-
setup(u, { emit:
|
|
169
|
-
const
|
|
165
|
+
setup(u, { emit: r }) {
|
|
166
|
+
const a = u, _ = {
|
|
170
167
|
[b.Button]: S,
|
|
171
168
|
[b.Chip]: A,
|
|
172
169
|
[b.Radio]: U,
|
|
173
170
|
[b.Tile]: ee
|
|
174
171
|
};
|
|
175
172
|
function p(i) {
|
|
176
|
-
|
|
173
|
+
r("update:modelValue", i.target.value);
|
|
177
174
|
}
|
|
178
175
|
const l = E("radio-group-field-error-");
|
|
179
176
|
return g($.key, {
|
|
180
|
-
name: v(() =>
|
|
181
|
-
disabled: v(() =>
|
|
182
|
-
fullWidth: v(() =>
|
|
183
|
-
modelValue: v(() =>
|
|
184
|
-
options: v(() =>
|
|
185
|
-
variant: v(() =>
|
|
177
|
+
name: v(() => a.name),
|
|
178
|
+
disabled: v(() => a.disabled),
|
|
179
|
+
fullWidth: v(() => a.fullWidth),
|
|
180
|
+
modelValue: v(() => a.modelValue),
|
|
181
|
+
options: v(() => a.options),
|
|
182
|
+
variant: v(() => a.variant),
|
|
186
183
|
update: p
|
|
187
|
-
}), (i, s) => (
|
|
184
|
+
}), (i, s) => (d(), B(G, {
|
|
188
185
|
class: f([
|
|
189
186
|
{
|
|
190
|
-
"tw-flex": !
|
|
191
|
-
"tw-gap-6": !
|
|
187
|
+
"tw-flex": !a.options,
|
|
188
|
+
"tw-gap-6": !a.options && a.variant !== e(b).Button
|
|
192
189
|
}
|
|
193
190
|
]),
|
|
194
191
|
"aria-errormessage": e(l),
|
|
195
|
-
"aria-invalid": !!
|
|
192
|
+
"aria-invalid": !!a.errorText,
|
|
196
193
|
role: "radiogroup",
|
|
197
194
|
fieldset: "",
|
|
198
|
-
label:
|
|
199
|
-
"add-bottom-space":
|
|
195
|
+
label: a.label,
|
|
196
|
+
"add-bottom-space": a.addBottomSpace,
|
|
200
197
|
"error-id": e(l),
|
|
201
|
-
"error-text":
|
|
202
|
-
"hint-text":
|
|
203
|
-
"show-optional-in-label":
|
|
204
|
-
"is-required":
|
|
205
|
-
"is-read-only":
|
|
198
|
+
"error-text": a.errorText,
|
|
199
|
+
"hint-text": a.hintText,
|
|
200
|
+
"show-optional-in-label": a.showOptionalInLabel,
|
|
201
|
+
"is-required": a.isRequired,
|
|
202
|
+
"is-read-only": a.isReadOnly
|
|
206
203
|
}, {
|
|
207
204
|
default: T(() => [
|
|
208
|
-
|
|
209
|
-
(
|
|
205
|
+
a.options ? R(i.$slots, "default", { key: 0 }, () => [
|
|
206
|
+
(d(), B(C(_[a.variant])))
|
|
210
207
|
]) : R(i.$slots, "default", { key: 1 })
|
|
211
208
|
]),
|
|
212
209
|
_: 3
|
|
@@ -216,6 +213,6 @@ const _e = /* @__PURE__ */ y({
|
|
|
216
213
|
export {
|
|
217
214
|
$ as RADIO_GROUP_INJECTION,
|
|
218
215
|
b as RadioGroupVariant,
|
|
219
|
-
|
|
216
|
+
ne as default
|
|
220
217
|
};
|
|
221
218
|
//# sourceMappingURL=RadioGroup.js.map
|