@leaflink/stash 51.10.0 → 51.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion.js.map +1 -1
- package/dist/Accordion.vue.d.ts +37 -6
- package/dist/ActionsDropdown.js +2 -2
- package/dist/ActionsDropdown.js.map +1 -1
- package/dist/ActionsDropdown.vue.d.ts +74 -0
- package/dist/AddressSelect.js +60 -56
- package/dist/AddressSelect.js.map +1 -1
- package/dist/AddressSelect.vue.d.ts +65 -8
- package/dist/Alert.js.map +1 -1
- package/dist/Alert.vue.d.ts +41 -4
- package/dist/AppNavigationItem.js.map +1 -1
- package/dist/AppNavigationItem.vue.d.ts +31 -4
- package/dist/AppSidebar.js.map +1 -1
- package/dist/AppSidebar.vue.d.ts +35 -8
- package/dist/AppTopbar.js +1 -1
- package/dist/AppTopbar.js.map +1 -1
- package/dist/AppTopbar.vue.d.ts +33 -4
- package/dist/Avatar.js.map +1 -1
- package/dist/Avatar.vue.d.ts +44 -5
- package/dist/Backdrop.js.map +1 -1
- package/dist/Backdrop.vue.d.ts +1 -1
- package/dist/Badge.js.map +1 -1
- package/dist/Badge.vue.d.ts +55 -6
- package/dist/Box.vue.d.ts +36 -3
- package/dist/Box.vue_vue_type_script_setup_true_lang-rFnvwLVY.js.map +1 -1
- package/dist/Button.js.map +1 -1
- package/dist/Button.vue.d.ts +50 -5
- package/dist/ButtonGroup.js +37 -33
- package/dist/ButtonGroup.js.map +1 -1
- package/dist/ButtonGroup.vue.d.ts +39 -6
- package/dist/Card.js.map +1 -1
- package/dist/Card.vue.d.ts +32 -5
- package/dist/CardContent.js.map +1 -1
- package/dist/CardContent.vue.d.ts +1 -1
- package/dist/CardFooter.js.map +1 -1
- package/dist/CardFooter.vue.d.ts +1 -1
- package/dist/CardHeader.js.map +1 -1
- package/dist/CardHeader.vue.d.ts +15 -2
- package/dist/CardMedia.js.map +1 -1
- package/dist/CardMedia.vue.d.ts +15 -2
- package/dist/Carousel.js +72 -66
- package/dist/Carousel.js.map +1 -1
- package/dist/Carousel.vue.d.ts +10 -10
- package/dist/Checkbox.js.map +1 -1
- package/dist/Checkbox.vue.d.ts +53 -8
- package/dist/ChevronToggle.vue.d.ts +34 -7
- package/dist/ChevronToggle.vue_vue_type_script_setup_true_lang-Ce_qOXfR.js.map +1 -1
- package/dist/Chip.js.map +1 -1
- package/dist/Chip.vue.d.ts +52 -10
- package/dist/ConfirmationCodeInput.js +44 -40
- package/dist/ConfirmationCodeInput.js.map +1 -1
- package/dist/ConfirmationCodeInput.vue.d.ts +43 -8
- package/dist/ContextSwitcher.js.map +1 -1
- package/dist/ContextSwitcher.vue.d.ts +41 -6
- package/dist/Copy.js.map +1 -1
- package/dist/Copy.vue.d.ts +34 -3
- package/dist/CurrencyInput.js +21 -20
- package/dist/CurrencyInput.js.map +1 -1
- package/dist/CurrencyInput.vue.d.ts +46 -125
- package/dist/CustomRender.js.map +1 -1
- package/dist/DataView.js +96 -94
- package/dist/DataView.js.map +1 -1
- package/dist/DataView.keys-aSOnA4AD.js.map +1 -1
- package/dist/DataView.vue.d.ts +57 -12
- package/dist/DataViewFilters.js +139 -127
- package/dist/DataViewFilters.js.map +1 -1
- package/dist/DataViewFilters.keys-BLu07FiP.js.map +1 -1
- package/dist/DataViewFilters.vue.d.ts +54 -9
- package/dist/DataViewSortButton.js +2 -2
- package/dist/DataViewSortButton.js.map +1 -1
- package/dist/DataViewSortButton.vue.d.ts +30 -3
- package/dist/DataViewToolbar.js +151 -83
- package/dist/DataViewToolbar.js.map +1 -1
- package/dist/DataViewToolbar.vue.d.ts +40 -5
- package/dist/DatePicker.js +4636 -4524
- package/dist/DatePicker.js.map +1 -1
- package/dist/DatePicker.vue.d.ts +79 -30
- package/dist/DescriptionList.js.map +1 -1
- package/dist/DescriptionList.vue.d.ts +32 -3
- package/dist/DescriptionListDetail.js.map +1 -1
- package/dist/DescriptionListDetail.vue.d.ts +1 -1
- package/dist/DescriptionListGroup.js.map +1 -1
- package/dist/DescriptionListGroup.vue.d.ts +1 -1
- package/dist/DescriptionListTerm.js.map +1 -1
- package/dist/DescriptionListTerm.vue.d.ts +1 -1
- package/dist/Dialog.js.map +1 -1
- package/dist/Dialog.vue.d.ts +53 -10
- package/dist/Divider.js.map +1 -1
- package/dist/Dropdown.js +95 -89
- package/dist/Dropdown.js.map +1 -1
- package/dist/Dropdown.vue.d.ts +48 -12
- package/dist/EmptyState.js +1 -1
- package/dist/EmptyState.js.map +1 -1
- package/dist/EmptyState.vue.d.ts +62 -5
- package/dist/Expand.vue.d.ts +40 -10
- package/dist/Expand.vue_vue_type_script_setup_true_lang-CiONJfAp.js.map +1 -1
- package/dist/Field.vue.d.ts +53 -4
- package/dist/Field.vue_vue_type_script_setup_true_lang-DI6z3AE9.js.map +1 -1
- package/dist/FileUpload.js +74 -72
- package/dist/FileUpload.js.map +1 -1
- package/dist/FileUpload.vue.d.ts +44 -10
- package/dist/FilterChip.js.map +1 -1
- package/dist/FilterChip.vue.d.ts +41 -6
- package/dist/FilterDrawerItem.js +21 -21
- package/dist/FilterDrawerItem.js.map +1 -1
- package/dist/FilterDrawerItem.vue.d.ts +23 -6
- package/dist/FilterDropdown.js +69 -63
- package/dist/FilterDropdown.js.map +1 -1
- package/dist/FilterDropdown.vue.d.ts +35 -122
- package/dist/FilterSelect.js.map +1 -1
- package/dist/FilterSelect.vue.d.ts +31 -4
- package/dist/Filters.js +164 -157
- package/dist/Filters.js.map +1 -1
- package/dist/Filters.vue.d.ts +2190 -0
- package/dist/HttpError.js +7 -7
- package/dist/HttpError.js.map +1 -1
- package/dist/HttpError.vue.d.ts +41 -4
- package/dist/Icon.js +17 -17
- package/dist/Icon.js.map +1 -1
- package/dist/Icon.vue.d.ts +36 -3
- package/dist/IconLabel.js.map +1 -1
- package/dist/IconLabel.vue.d.ts +40 -5
- package/dist/Illustration.js +2 -2
- package/dist/Illustration.vue.d.ts +42 -3
- package/dist/{Illustration.vue_vue_type_script_setup_true_lang-BVzzNsRt.js → Illustration.vue_vue_type_script_setup_true_lang-BrqEF8xe.js} +11 -11
- package/dist/{Illustration.vue_vue_type_script_setup_true_lang-BVzzNsRt.js.map → Illustration.vue_vue_type_script_setup_true_lang-BrqEF8xe.js.map} +1 -1
- package/dist/Image.js +2 -2
- package/dist/Image.vue.d.ts +40 -5
- package/dist/{Image.vue_vue_type_script_setup_true_lang-Dg2Zk2r2.js → Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js} +41 -37
- package/dist/{Image.vue_vue_type_script_setup_true_lang-Dg2Zk2r2.js.map → Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js.map} +1 -1
- package/dist/InlineEdit.js.map +1 -1
- package/dist/InlineEdit.vue.d.ts +47 -126
- package/dist/Input.js.map +1 -1
- package/dist/Input.vue.d.ts +45 -12
- package/dist/InputOptions.js +69 -66
- package/dist/InputOptions.js.map +1 -1
- package/dist/InputOptions.vue.d.ts +55 -10
- package/dist/IntegrationIcon.js +7 -7
- package/dist/IntegrationIcon.js.map +1 -1
- package/dist/IntegrationIcon.vue.d.ts +36 -3
- package/dist/Label.vue.d.ts +42 -3
- package/dist/Label.vue_vue_type_script_setup_true_lang-CNquF3AP.js.map +1 -1
- package/dist/LicenseChip.js.map +1 -1
- package/dist/LicenseChip.vue.d.ts +30 -3
- package/dist/ListItem.js.map +1 -1
- package/dist/ListItem.vue.d.ts +294 -0
- package/dist/ListItemCell.js.map +1 -1
- package/dist/ListItemCell.vue.d.ts +21 -0
- package/dist/ListView.js +7 -4
- package/dist/ListView.js.map +1 -1
- package/dist/ListView.types.d.ts +29 -0
- package/dist/ListView.vue.d.ts +5496 -0
- package/dist/Loading.js +2 -2
- package/dist/Loading.js.map +1 -1
- package/dist/Loading.vue.d.ts +1 -1
- package/dist/Logo.js +1 -1
- package/dist/Logo.vue.d.ts +41 -6
- package/dist/{Logo.vue_vue_type_script_setup_true_lang-Y3iE9utm.js → Logo.vue_vue_type_script_setup_true_lang-Dz8c98sc.js} +17 -17
- package/dist/Logo.vue_vue_type_script_setup_true_lang-Dz8c98sc.js.map +1 -0
- package/dist/Menu.js.map +1 -1
- package/dist/Menu.vue.d.ts +1 -1
- package/dist/MenuItem.js.map +1 -1
- package/dist/MenuItem.vue.d.ts +1 -1
- package/dist/MenusPlugin-Bk6UW6o9.js +12 -0
- package/dist/{MenusPlugin-B4jpNe7x.js.map → MenusPlugin-Bk6UW6o9.js.map} +1 -1
- package/dist/Metric.js.map +1 -1
- package/dist/Metric.vue.d.ts +34 -3
- package/dist/Modal.js +64 -62
- package/dist/Modal.js.map +1 -1
- package/dist/Modal.vue.d.ts +60 -13
- package/dist/Modals.js +18 -17
- package/dist/Modals.js.map +1 -1
- package/dist/ModalsPlugin.js +11 -11
- package/dist/ModalsPlugin.js.map +1 -1
- package/dist/Module.js.map +1 -1
- package/dist/Module.keys-CEsrW2f0.js.map +1 -1
- package/dist/Module.types-B1FfGGac.js.map +1 -1
- package/dist/Module.vue.d.ts +29 -2
- package/dist/ModuleContent.js.map +1 -1
- package/dist/ModuleContent.vue.d.ts +3 -3
- package/dist/ModuleFooter.js.map +1 -1
- package/dist/ModuleFooter.vue.d.ts +1 -1
- package/dist/ModuleHeader.js.map +1 -1
- package/dist/ModuleHeader.vue.d.ts +39 -5
- package/dist/MoreActions.js +491 -0
- package/dist/MoreActions.js.map +1 -0
- package/dist/MoreActions.vue.d.ts +126 -0
- package/dist/ObfuscateText.js.map +1 -1
- package/dist/ObfuscateText.vue.d.ts +40 -3
- package/dist/PageContent.js.map +1 -1
- package/dist/PageContent.vue.d.ts +30 -3
- package/dist/PageHeader.js.map +1 -1
- package/dist/PageHeader.vue.d.ts +35 -6
- package/dist/PageNavigation.js +50 -50
- package/dist/PageNavigation.js.map +1 -1
- package/dist/PageNavigation.vue.d.ts +36 -7
- package/dist/Paginate.js.map +1 -1
- package/dist/Paginate.vue.d.ts +40 -5
- package/dist/PlaidLink.js.map +1 -1
- package/dist/PlaidLink.vue.d.ts +49 -12
- package/dist/QuickAction.js.map +1 -1
- package/dist/QuickAction.vue.d.ts +15 -2
- package/dist/Radio.js.map +1 -1
- package/dist/Radio.vue.d.ts +93 -0
- package/dist/RadioGroup.js +101 -94
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioGroup.vue.d.ts +42 -116
- package/dist/RadioNew.js +99 -96
- package/dist/RadioNew.js.map +1 -1
- package/dist/RadioNew.vue.d.ts +48 -7
- package/dist/RangeInput.js.map +1 -1
- package/dist/RangeInput.vue.d.ts +1 -1
- package/dist/SearchBar.js +39 -38
- package/dist/SearchBar.js.map +1 -1
- package/dist/SearchBar.vue.d.ts +44 -127
- package/dist/SectionHeader.js.map +1 -1
- package/dist/SectionHeader.vue.d.ts +36 -5
- package/dist/Select.js +183 -171
- package/dist/Select.js.map +1 -1
- package/dist/Select.vue.d.ts +102 -23
- package/dist/SelectStatus.js +38 -38
- package/dist/SelectStatus.js.map +1 -1
- package/dist/SelectStatus.vue.d.ts +46 -226
- package/dist/Skeleton.js.map +1 -1
- package/dist/Skeleton.vue.d.ts +34 -3
- package/dist/Step.js +44 -44
- package/dist/Step.js.map +1 -1
- package/dist/Step.vue.d.ts +43 -4
- package/dist/Stepper.js.map +1 -1
- package/dist/Stepper.vue.d.ts +44 -9
- package/dist/Switch.js.map +1 -1
- package/dist/Switch.vue.d.ts +47 -8
- package/dist/Tab.js +9 -9
- package/dist/Tab.js.map +1 -1
- package/dist/Tab.vue.d.ts +15 -2
- package/dist/TabPanel.js.map +1 -1
- package/dist/TabPanel.vue.d.ts +30 -3
- package/dist/Table.js +59 -53
- package/dist/Table.js.map +1 -1
- package/dist/Table.keys-LHQf6FEH.js.map +1 -1
- package/dist/Table.vue.d.ts +50 -3
- package/dist/TableCell.js +1 -1
- package/dist/TableCell.js.map +1 -1
- package/dist/TableCell.vue.d.ts +32 -3
- package/dist/TableHeaderCell.js +1 -1
- package/dist/TableHeaderCell.js.map +1 -1
- package/dist/TableHeaderCell.vue.d.ts +30 -3
- package/dist/TableHeaderRow.js +1 -1
- package/dist/TableHeaderRow.js.map +1 -1
- package/dist/TableHeaderRow.vue.d.ts +34 -5
- package/dist/TableRow.js +44 -43
- package/dist/TableRow.js.map +1 -1
- package/dist/TableRow.vue.d.ts +48 -7
- package/dist/Tabs.js +2 -2
- package/dist/Tabs.vue.d.ts +31 -122
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-BlJVDr7o.js +78 -0
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-BlJVDr7o.js.map +1 -0
- package/dist/TextEditor.js +2420 -2414
- package/dist/TextEditor.js.map +1 -1
- package/dist/TextEditor.vue.d.ts +39 -8
- package/dist/Textarea.js +32 -29
- package/dist/Textarea.js.map +1 -1
- package/dist/Textarea.vue.d.ts +44 -9
- package/dist/Thumbnail.js +1 -1
- package/dist/Thumbnail.js.map +1 -1
- package/dist/Thumbnail.vue.d.ts +4 -4
- package/dist/ThumbnailEmpty.js.map +1 -1
- package/dist/ThumbnailEmpty.vue.d.ts +1 -1
- package/dist/ThumbnailGroup.js.map +1 -1
- package/dist/ThumbnailGroup.keys-EJ4qFNhx.js.map +1 -1
- package/dist/ThumbnailGroup.vue.d.ts +22 -26
- package/dist/Timeline.js.map +1 -1
- package/dist/Timeline.vue.d.ts +32 -3
- package/dist/TimelineItem.js.map +1 -1
- package/dist/TimelineItem.vue.d.ts +1 -1
- package/dist/Toast.js.map +1 -1
- package/dist/Toast.vue.d.ts +30 -3
- package/dist/Toasts.js.map +1 -1
- package/dist/ToastsPlugin.js +11 -11
- package/dist/ToastsPlugin.js.map +1 -1
- package/dist/Tooltip.js +30 -29
- package/dist/Tooltip.js.map +1 -1
- package/dist/Tooltip.vue.d.ts +43 -11
- package/dist/colors-DDDVvqfQ.js.map +1 -1
- package/dist/components.css +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/directives/autofocus.js.map +1 -1
- package/dist/directives/clickoutside.js.map +1 -1
- package/dist/directives/observe.js.map +1 -1
- package/dist/directives/sticky.js.map +1 -1
- package/dist/directives/tooltip.js +3 -3
- package/dist/directives/tooltip.js.map +1 -1
- package/dist/directives/viewable.js +44 -39
- package/dist/directives/viewable.js.map +1 -1
- package/dist/{floating-ui.vue-CL01Y9ER.js → floating-ui.vue-pzUuloyX.js} +2 -2
- package/dist/{floating-ui.vue-CL01Y9ER.js.map → floating-ui.vue-pzUuloyX.js.map} +1 -1
- package/dist/formatDateTime-Dz8bXV0R.js +1418 -0
- package/dist/{formatDateTime-DG7kBc2T.js.map → formatDateTime-Dz8bXV0R.js.map} +1 -1
- package/dist/index-C14LhAwV.js +294 -0
- package/dist/{index-GUu9zvbg.js.map → index-C14LhAwV.js.map} +1 -1
- package/dist/index-D6bxWkZ1.js.map +1 -1
- package/dist/index.js +104 -99
- package/dist/index.js.map +1 -1
- package/dist/isDefined-DzVx0B6k.js.map +1 -1
- package/dist/keys-BEdEsanp.js.map +1 -1
- package/dist/keys-C8Zfr_By.js.map +1 -1
- package/dist/locale.js.map +1 -1
- package/dist/misc-CHQs-G03.js.map +1 -1
- package/dist/obfuscateText.d.ts +1 -1
- package/dist/parseISO-wlfIB_QJ.js.map +1 -1
- package/dist/searchFuzzy-DRasJ33G.js +409 -0
- package/dist/{searchFuzzy-DBDE6jkd.js.map → searchFuzzy-DRasJ33G.js.map} +1 -1
- package/dist/statusLevels-D8EgtE_L.js.map +1 -1
- package/dist/storage.js.map +1 -1
- package/dist/tailwind-base.d.ts +18 -0
- package/dist/tailwind-base.js +18 -8
- package/dist/tailwind-base.js.map +1 -1
- package/dist/toTimeZone-Coq1oPTt.js.map +1 -1
- package/dist/useConfirmBeforeClosing.js.map +1 -1
- package/dist/useDialog.d.ts +2 -2
- package/dist/useDialog.js +25 -21
- package/dist/useDialog.js.map +1 -1
- package/dist/useGoogleMaps.js +110 -108
- package/dist/useGoogleMaps.js.map +1 -1
- package/dist/useMediaQuery.d.ts +6 -0
- package/dist/useMediaQuery.js +15 -11
- package/dist/useMediaQuery.js.map +1 -1
- package/dist/useModals.d.ts +1 -1
- package/dist/useModals.js.map +1 -1
- package/dist/usePaginationStats-d_q39naC.js.map +1 -1
- package/dist/usePlaidLink.js +27 -20
- package/dist/usePlaidLink.js.map +1 -1
- package/dist/useScriptTag.js.map +1 -1
- package/dist/useSearch.js +13 -13
- package/dist/useSearch.js.map +1 -1
- package/dist/useSelection.js +56 -56
- package/dist/useSelection.js.map +1 -1
- package/dist/useSortable.js +63 -54
- package/dist/useSortable.js.map +1 -1
- package/dist/useStepper.d.ts +2 -2
- package/dist/useStepper.js +40 -36
- package/dist/useStepper.js.map +1 -1
- package/dist/useToasts.js +23 -23
- package/dist/useToasts.js.map +1 -1
- package/dist/useValidation.js +100 -96
- package/dist/useValidation.js.map +1 -1
- package/dist/utils/calculateElementOverflow.js +4 -4
- package/dist/utils/calculateElementOverflow.js.map +1 -1
- package/dist/utils/colorScheme.js.map +1 -1
- package/dist/utils/createQueryString.js.map +1 -1
- package/dist/utils/createValidDate.js.map +1 -1
- package/dist/utils/formatDateTime.js +1 -1
- package/dist/utils/getContrastingTextColor.js.map +1 -1
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/i18n.js.map +1 -1
- package/dist/utils/normalizeDate.js.map +1 -1
- package/dist/utils/obfuscateText.js +6 -6
- package/dist/utils/obfuscateText.js.map +1 -1
- package/dist/utils/searchFuzzy.js +1 -1
- package/dist/utils/storage.js +23 -23
- package/dist/utils/storage.js.map +1 -1
- package/package.json +12 -12
- package/tailwind-base.ts +11 -0
- package/dist/Logo.vue_vue_type_script_setup_true_lang-Y3iE9utm.js.map +0 -1
- package/dist/MenusPlugin-B4jpNe7x.js +0 -12
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-Dprx064Y.js +0 -156
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-Dprx064Y.js.map +0 -1
- package/dist/formatDateTime-DG7kBc2T.js +0 -1414
- package/dist/index-GUu9zvbg.js +0 -128
- package/dist/searchFuzzy-DBDE6jkd.js +0 -408
package/dist/Dropdown.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { KEY_CODES as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { getMountPoint as
|
|
6
|
-
import
|
|
7
|
-
import { _ as
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as I, ref as r, useCssModule as q, watch as C, onMounted as K, onBeforeUnmount as R, computed as U, withDirectives as _, createElementBlock as k, openBlock as m, renderSlot as x, createVNode as E, createElementVNode as b, normalizeClass as S, createBlock as V, createTextVNode as W, toDisplayString as Y, Transition as F, withCtx as j, normalizeStyle as G, unref as M, vShow as H, nextTick as A } from "vue";
|
|
2
|
+
import { KEY_CODES as f } from "./constants.js";
|
|
3
|
+
import J from "./directives/clickoutside.js";
|
|
4
|
+
import Q from "./utils/calculateElementOverflow.js";
|
|
5
|
+
import { getMountPoint as X } from "./utils/helpers.js";
|
|
6
|
+
import B from "./Icon.js";
|
|
7
|
+
import { _ as Z } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
|
+
const ee = ["aria-expanded"], te = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "tw-flex tw-items-center tw-font-medium tw-text-blue-500 hover:tw-text-blue-700"
|
|
11
|
-
},
|
|
11
|
+
}, le = /* @__PURE__ */ I({
|
|
12
12
|
name: "ll-dropdown",
|
|
13
13
|
__name: "Dropdown",
|
|
14
14
|
props: {
|
|
@@ -21,134 +21,140 @@ const X = ["aria-expanded"], Z = {
|
|
|
21
21
|
fluidContent: { type: Boolean, default: !1 }
|
|
22
22
|
},
|
|
23
23
|
emits: ["toggle", "dismiss"],
|
|
24
|
-
setup(
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
e || (
|
|
28
|
-
}),
|
|
29
|
-
e in
|
|
30
|
-
}),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
setup(D, { expose: $, emit: L }) {
|
|
25
|
+
const a = D, p = L, t = r(null), w = r(null), d = [], s = r(d), i = r(-1), l = r(!1), g = r({}), T = q();
|
|
26
|
+
C(l, (e) => {
|
|
27
|
+
e || (i.value = -1), p("toggle", e);
|
|
28
|
+
}), C(i, (e, o) => {
|
|
29
|
+
e in s.value && s.value[e].classList.add("tw-bg-ice-200"), o in s.value && s.value[o].classList.remove("tw-bg-ice-200");
|
|
30
|
+
}), K(() => {
|
|
31
|
+
var e, o, n;
|
|
32
|
+
if (a.reattach) {
|
|
33
|
+
const c = X();
|
|
34
|
+
t.value && c.appendChild(t.value);
|
|
34
35
|
}
|
|
35
|
-
t.value
|
|
36
|
-
}),
|
|
37
|
-
|
|
36
|
+
(e = t.value) != null && e.querySelector(".stash-menu") ? s.value = ((o = t.value) == null ? void 0 : o.querySelectorAll(".stash-menu-item")) ?? d : s.value = ((n = t.value) == null ? void 0 : n.querySelectorAll(".dropdown__item")) ?? d, window.addEventListener("resize", () => u());
|
|
37
|
+
}), R(() => {
|
|
38
|
+
var e, o;
|
|
39
|
+
window.removeEventListener("resize", () => u()), (o = (e = t == null ? void 0 : t.value) == null ? void 0 : e.parentNode) == null || o.removeChild(t.value);
|
|
38
40
|
});
|
|
39
|
-
function
|
|
40
|
-
|
|
41
|
+
function u(e) {
|
|
42
|
+
var n;
|
|
43
|
+
if (a.closeManually && ((n = t.value) != null && n.contains(e == null ? void 0 : e.target) || t.value === (e == null ? void 0 : e.target)))
|
|
41
44
|
return;
|
|
42
|
-
const
|
|
43
|
-
l.value = !1,
|
|
45
|
+
const o = l.value;
|
|
46
|
+
l.value = !1, o && p("dismiss");
|
|
44
47
|
}
|
|
45
|
-
async function
|
|
46
|
-
|
|
48
|
+
async function v() {
|
|
49
|
+
var e;
|
|
50
|
+
l.value ? l.value = !1 : (l.value = !0, await z(), (e = t.value) == null || e.focus());
|
|
47
51
|
}
|
|
48
|
-
function
|
|
49
|
-
if (e.keyCode ===
|
|
50
|
-
|
|
51
|
-
else if (e.keyCode ===
|
|
52
|
-
|
|
53
|
-
else if (e.keyCode ===
|
|
54
|
-
|
|
55
|
-
else if (e.keyCode ===
|
|
56
|
-
|
|
52
|
+
function N(e) {
|
|
53
|
+
if (e.keyCode === f.ESCAPE)
|
|
54
|
+
u();
|
|
55
|
+
else if (e.keyCode === f.DOWN && i.value < s.value.length - 1 && l.value)
|
|
56
|
+
i.value++;
|
|
57
|
+
else if (e.keyCode === f.UP && i.value > -1 && l.value)
|
|
58
|
+
i.value--;
|
|
59
|
+
else if (e.keyCode === f.ENTER && i.value !== -1 && l.value)
|
|
60
|
+
s[i.value].click();
|
|
57
61
|
else
|
|
58
62
|
return;
|
|
59
63
|
e.preventDefault();
|
|
60
64
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
65
|
+
function O() {
|
|
66
|
+
var e;
|
|
67
|
+
(e = t.value) == null || e.style.setProperty("--offset", "0");
|
|
63
68
|
}
|
|
64
|
-
async function
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
async function z() {
|
|
70
|
+
var y, h;
|
|
71
|
+
await A();
|
|
72
|
+
const e = ((y = w.value) == null ? void 0 : y.getBoundingClientRect()) || {}, o = e.top + e.height, n = {
|
|
67
73
|
x: 0,
|
|
68
74
|
y: 0,
|
|
69
|
-
...
|
|
75
|
+
...a.offset
|
|
70
76
|
};
|
|
71
|
-
|
|
72
|
-
left:
|
|
73
|
-
right:
|
|
74
|
-
top: `${window.scrollY +
|
|
75
|
-
}, await
|
|
76
|
-
const
|
|
77
|
-
if (
|
|
78
|
-
const
|
|
79
|
-
t.value
|
|
77
|
+
a.reattach && (g.value = {
|
|
78
|
+
left: a.align === "left" ? `${Math.round(e.left) + n.x}px` : void 0,
|
|
79
|
+
right: a.align === "right" ? `${document.documentElement.clientWidth - Math.round(e.right) + n.x}px` : void 0,
|
|
80
|
+
top: `${window.scrollY + o + n.y}px`
|
|
81
|
+
}, await A());
|
|
82
|
+
const c = Q(t == null ? void 0 : t.value);
|
|
83
|
+
if (c) {
|
|
84
|
+
const P = a.align === "left" ? "-" : "";
|
|
85
|
+
(h = t.value) == null || h.style.setProperty("--offset", `${P}${c.value}`);
|
|
80
86
|
}
|
|
81
87
|
}
|
|
82
|
-
return
|
|
83
|
-
isActive:
|
|
84
|
-
toggle:
|
|
85
|
-
dismiss:
|
|
86
|
-
}), (e,
|
|
88
|
+
return $({
|
|
89
|
+
isActive: U(() => l.value),
|
|
90
|
+
toggle: v,
|
|
91
|
+
dismiss: u
|
|
92
|
+
}), (e, o) => _((m(), k("div", {
|
|
87
93
|
ref_key: "dropdownRef",
|
|
88
|
-
ref:
|
|
94
|
+
ref: w,
|
|
89
95
|
class: "tw-relative tw-inline-block",
|
|
90
96
|
"data-test": "ll-dropdown",
|
|
91
|
-
onKeydown:
|
|
97
|
+
onKeydown: N
|
|
92
98
|
}, [
|
|
93
|
-
|
|
99
|
+
x(e.$slots, "toggle", {
|
|
94
100
|
isActive: l.value,
|
|
95
|
-
toggle:
|
|
101
|
+
toggle: v
|
|
96
102
|
}, () => [
|
|
97
|
-
|
|
103
|
+
b("button", {
|
|
98
104
|
"data-test": "button|toggle",
|
|
99
105
|
"aria-expanded": l.value,
|
|
100
|
-
class:
|
|
101
|
-
onClick:
|
|
106
|
+
class: S([e.label ? "tw-min-w-auto tw-outline-none" : "tw-rounded tw-p-3"]),
|
|
107
|
+
onClick: v
|
|
102
108
|
}, [
|
|
103
|
-
e.label ? (
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
])) : (
|
|
109
|
+
e.label ? (m(), k("span", te, [
|
|
110
|
+
W(Y(e.label) + " ", 1),
|
|
111
|
+
E(B, { name: "caret-down" })
|
|
112
|
+
])) : (m(), V(B, {
|
|
107
113
|
key: 1,
|
|
108
114
|
name: "ellipsis"
|
|
109
115
|
}))
|
|
110
|
-
], 10,
|
|
116
|
+
], 10, ee)
|
|
111
117
|
]),
|
|
112
|
-
|
|
118
|
+
E(F, {
|
|
113
119
|
name: "fade",
|
|
114
|
-
onAfterLeave:
|
|
120
|
+
onAfterLeave: O
|
|
115
121
|
}, {
|
|
116
|
-
default:
|
|
117
|
-
|
|
122
|
+
default: j(() => [
|
|
123
|
+
_(b("div", {
|
|
118
124
|
ref_key: "contentRef",
|
|
119
125
|
ref: t,
|
|
120
126
|
"data-test": "ll-dropdown-content",
|
|
121
|
-
class:
|
|
122
|
-
|
|
127
|
+
class: S([
|
|
128
|
+
M(T).content,
|
|
123
129
|
e.contentClass,
|
|
124
130
|
{
|
|
125
|
-
"tw-left-0 after:tw-left-6":
|
|
126
|
-
"tw-right-0":
|
|
127
|
-
"tw-max-w-[360px]": !
|
|
131
|
+
"tw-left-0 after:tw-left-6": a.align === "left",
|
|
132
|
+
"tw-right-0": a.align === "right",
|
|
133
|
+
"tw-max-w-[360px]": !a.fluidContent
|
|
128
134
|
}
|
|
129
135
|
]),
|
|
130
|
-
style:
|
|
136
|
+
style: G(g.value)
|
|
131
137
|
}, [
|
|
132
|
-
|
|
133
|
-
dismiss:
|
|
138
|
+
x(e.$slots, "default", {
|
|
139
|
+
dismiss: u,
|
|
134
140
|
isActive: l.value
|
|
135
141
|
})
|
|
136
142
|
], 6), [
|
|
137
|
-
[
|
|
143
|
+
[H, l.value]
|
|
138
144
|
])
|
|
139
145
|
]),
|
|
140
146
|
_: 3
|
|
141
147
|
})
|
|
142
148
|
], 32)), [
|
|
143
|
-
[
|
|
149
|
+
[M(J), u]
|
|
144
150
|
]);
|
|
145
151
|
}
|
|
146
|
-
}),
|
|
147
|
-
content:
|
|
148
|
-
},
|
|
149
|
-
$style:
|
|
150
|
-
},
|
|
152
|
+
}), oe = "_content_zbxyu_2", ae = {
|
|
153
|
+
content: oe
|
|
154
|
+
}, ne = {
|
|
155
|
+
$style: ae
|
|
156
|
+
}, ve = /* @__PURE__ */ Z(le, [["__cssModules", ne]]);
|
|
151
157
|
export {
|
|
152
|
-
|
|
158
|
+
ve as default
|
|
153
159
|
};
|
|
154
160
|
//# sourceMappingURL=Dropdown.js.map
|
package/dist/Dropdown.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sources":["../src/components/Dropdown/Dropdown.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, nextTick, onBeforeUnmount, onMounted, ref, useCssModule, watch } from 'vue';\n\n import { KEY_CODES } from '../../constants';\n import vClickoutside from '../../directives/clickoutside/clickoutside';\n import calculateElementOverflow from '../../utils/calculateElementOverflow';\n import { getMountPoint } from '../../utils/helpers';\n import Icon from '../Icon/Icon.vue';\n\n export type DropdownOffset = {\n x?: number;\n y?: number;\n };\n\n export interface DropdownProps {\n /**\n * Used to position the dropdown relative to target\n * Options: left, right\n */\n align?: 'left' | 'right';\n /**\n * When passed, text with caret is displayed instead of default kebab menu.\n */\n label?: string;\n /**\n * If true, dropdown will remain open when clicking on its content. Otherwise, it'll close automatically on click.\n */\n closeManually?: boolean;\n /**\n * Used to horizontally and vertically offset the dropdown in pixels\n * Keep in mind, `x` value is relative to `align` value.\n */\n offset?: DropdownOffset;\n /**\n * If `reattach` is true, the contents will be mounted in the mount point container,\n * so as to circumvent clipping issues from a parent's overflow property.\n */\n reattach?: boolean;\n /**\n * Custom class to apply to the default dropdown content element\n */\n contentClass?: string | string[];\n /**\n * Removes content container's max width\n */\n fluidContent?: boolean;\n }\n\n type DropdownStyles = {\n left?: string;\n right?: string;\n top?: string;\n };\n\n defineOptions({\n name: 'll-dropdown',\n });\n\n const props = withDefaults(defineProps<DropdownProps>(), {\n align: 'right',\n label: '',\n closeManually: false,\n offset: () => ({}),\n reattach: true,\n contentClass: '',\n fluidContent: false,\n });\n\n const emit = defineEmits<{\n toggle: [isActive: boolean];\n dismiss: [];\n }>();\n\n const contentRef = ref<HTMLElement | null>(null);\n const dropdownRef = ref<HTMLDivElement | null>(null);\n\n const DEFAULT_ITEMS_LIST = [] as unknown as NodeListOf<Element>;\n\n const items = ref<NodeListOf<Element>>(DEFAULT_ITEMS_LIST);\n const itemIndex = ref(-1);\n const isActive = ref(false);\n\n const styles = ref<DropdownStyles>({});\n const classes = useCssModule();\n\n watch(isActive, (val) => {\n if (!val) {\n itemIndex.value = -1;\n }\n\n emit('toggle', val);\n });\n\n watch(itemIndex, (next, prev) => {\n if (next in items.value) {\n items.value[next].classList.add('tw-bg-ice-200');\n }\n if (prev in items.value) {\n items.value[prev].classList.remove('tw-bg-ice-200');\n }\n });\n\n onMounted(() => {\n if (props.reattach) {\n const target = getMountPoint();\n\n if (contentRef.value) {\n target.appendChild(contentRef.value);\n }\n }\n\n // if stash-menu exists, use it's items\n if (contentRef.value?.querySelector('.stash-menu')) {\n items.value = contentRef.value?.querySelectorAll('.stash-menu-item') ?? DEFAULT_ITEMS_LIST;\n } else {\n items.value = contentRef.value?.querySelectorAll('.dropdown__item') ?? DEFAULT_ITEMS_LIST;\n }\n\n // avoid calling dismiss with ResizeEvent because it's target is the Window element and it's not a valid Node element to be passed to dismiss\n window.addEventListener('resize', () => dismiss());\n });\n\n onBeforeUnmount(() => {\n window.removeEventListener('resize', () => dismiss());\n contentRef?.value?.parentNode?.removeChild(contentRef.value);\n });\n\n /**\n * Dismisses the Dropdown.\n */\n function dismiss(event?: Event) {\n if (\n props.closeManually &&\n (contentRef.value?.contains(event?.target as HTMLElement) || contentRef.value === event?.target)\n ) {\n return;\n }\n\n const wasOpen = isActive.value;\n\n isActive.value = false;\n\n if (wasOpen) {\n emit('dismiss');\n }\n }\n\n /**\n * Opens or closes the Dropdown. If opening, positions and focuses its content.\n */\n async function toggle() {\n if (isActive.value) {\n isActive.value = false;\n } else {\n isActive.value = true;\n await calculateOffset();\n contentRef.value?.focus();\n }\n }\n\n /**\n * Handles all user keyboard input on the Dropdown.\n * @param {KeyboardEvent} e The native keydown event.\n */\n function onKeyDown(e: KeyboardEvent) {\n if (e.keyCode === KEY_CODES.ESCAPE) {\n dismiss();\n } else if (e.keyCode === KEY_CODES.DOWN && itemIndex.value < items.value.length - 1 && isActive.value) {\n itemIndex.value++;\n } else if (e.keyCode === KEY_CODES.UP && itemIndex.value > -1 && isActive.value) {\n itemIndex.value--;\n } else if (e.keyCode === KEY_CODES.ENTER && itemIndex.value !== -1 && isActive.value) {\n items[itemIndex.value].click();\n } else {\n return;\n }\n\n e.preventDefault(); // if keyDown did something / we didn't return\n }\n\n /**\n * Reset any page overflow offset\n */\n function resetOffset() {\n contentRef.value?.style.setProperty('--offset', '0');\n }\n\n /**\n * Calculate the position for the Dropdown content element,\n * relative to the viewport.\n * Repositions the dropdown content element (& arrow)\n * if it overflows the page (including gutter).\n */\n async function calculateOffset() {\n await nextTick();\n\n const toggleBCR = dropdownRef.value?.getBoundingClientRect() || ({} as DOMRect);\n const top = toggleBCR.top + toggleBCR.height;\n const offset = {\n x: 0,\n y: 0,\n ...props.offset,\n };\n\n if (props.reattach) {\n styles.value = {\n left: props.align === 'left' ? `${Math.round(toggleBCR.left) + offset.x}px` : undefined,\n right:\n props.align === 'right'\n ? `${document.documentElement.clientWidth - Math.round(toggleBCR.right) + offset.x}px`\n : undefined,\n top: `${window.scrollY + top + offset.y}px`,\n };\n await nextTick(); // wait for style updates to sync in the DOM\n }\n\n const overflow = calculateElementOverflow(contentRef?.value);\n\n if (overflow) {\n const direction = props.align === 'left' ? '-' : '';\n contentRef.value?.style.setProperty('--offset', `${direction}${overflow.value}`);\n }\n }\n\n defineExpose({\n isActive: computed(() => isActive.value),\n toggle,\n dismiss,\n });\n</script>\n\n<template>\n <div\n ref=\"dropdownRef\"\n v-clickoutside=\"dismiss\"\n class=\"tw-relative tw-inline-block\"\n data-test=\"ll-dropdown\"\n @keydown=\"onKeyDown\"\n >\n <!-- @slot Toggle component slot, receives `toggle` method to trigger Dropdown display -->\n <slot name=\"toggle\" :is-active=\"isActive\" :toggle=\"toggle\">\n <button\n data-test=\"button|toggle\"\n :aria-expanded=\"isActive\"\n :class=\"[label ? 'tw-min-w-auto tw-outline-none' : 'tw-rounded tw-p-3']\"\n @click=\"toggle\"\n >\n <span v-if=\"label\" class=\"tw-flex tw-items-center tw-font-medium tw-text-blue-500 hover:tw-text-blue-700\">\n {{ label }}\n <Icon name=\"caret-down\" />\n </span>\n <Icon v-else name=\"ellipsis\" />\n </button>\n </slot>\n\n <transition name=\"fade\" @after-leave=\"resetOffset\">\n <div\n v-show=\"isActive\"\n ref=\"contentRef\"\n data-test=\"ll-dropdown-content\"\n :class=\"[\n classes.content,\n contentClass,\n {\n 'tw-left-0 after:tw-left-6': props.align === 'left',\n 'tw-right-0': props.align === 'right',\n 'tw-max-w-[360px]': !props.fluidContent,\n },\n ]\"\n :style=\"styles\"\n >\n <!-- @slot Dropdown content slot. Receives `dismiss` method, to trigger manual close. You must call dismiss with parentheses. Receives `is-active` prop. -->\n <slot :dismiss=\"dismiss\" :is-active=\"isActive\"></slot>\n </div>\n </transition>\n </div>\n</template>\n\n<style module>\n .content {\n --offset: 0;\n\n @apply tw-shadow-2xl\n tw-bg-white\n tw-border\n tw-border-solid\n tw-border-blue-500\n tw-rounded\n tw-absolute\n tw-z-[301]\n tw-min-w-[200px];\n\n transform: translateX(calc(var(--offset) * 1px));\n }\n\n /**\n * TODO: these global styles should be componentized in https://leaflink.atlassian.net/browse/STASH-566\n */\n :global(.dropdown__list) {\n @apply tw-bg-white tw-list-none tw-m-1.5 tw-p-0;\n }\n\n :global(.dropdown__item) {\n @apply tw-block tw-mx-0 tw-mt-0 tw-mb-1.5 tw-w-full first:tw-mt-0 last:tw-mb-0;\n }\n\n :global(.dropdown__item) button {\n @apply tw-border-none tw-text-left tw-p-1.5;\n }\n\n :global(.dropdown__item) :where(a, button) {\n @apply tw-rounded\n tw-text-ice-700\n tw-block\n tw-py-[10px]\n tw-px-1.5\n tw-w-full\n disabled:tw-text-ice-500\n disabled:tw-cursor-default\n hover:tw-bg-ice-200\n hover:tw-text-ice-700\n hover:tw-no-underline\n tw-transition-all\n tw-duration-fast\n tw-ease-swing;\n }\n</style>\n"],"names":["props","__props","emit","__emit","contentRef","ref","dropdownRef","DEFAULT_ITEMS_LIST","items","itemIndex","isActive","styles","classes","useCssModule","watch","val","next","prev","onMounted","target","getMountPoint","dismiss","onBeforeUnmount","event","wasOpen","toggle","calculateOffset","onKeyDown","KEY_CODES","resetOffset","nextTick","toggleBCR","top","offset","overflow","calculateElementOverflow","direction","__expose","computed","_createElementBlock","_renderSlot","_ctx","_createElementVNode","label","_openBlock","_hoisted_2","_createVNode","Icon","_createBlock","_Transition","_normalizeClass","_unref","contentClass"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0DE,UAAMA,IAAQC,GAURC,IAAOC,GAKPC,IAAaC,EAAwB,IAAI,GACzCC,IAAcD,EAA2B,IAAI,GAE7CE,IAAqB,CAAA,GAErBC,IAAQH,EAAyBE,CAAkB,GACnDE,IAAYJ,EAAI,EAAE,GAClBK,IAAWL,EAAI,EAAK,GAEpBM,IAASN,EAAoB,EAAE,GAC/BO,IAAUC,EAAA;AAEhB,IAAAC,EAAMJ,GAAU,CAACK,MAAQ;AACvB,MAAKA,MACHN,EAAU,QAAQ,KAGpBP,EAAK,UAAUa,CAAG;AAAA,IACpB,CAAC,GAEDD,EAAML,GAAW,CAACO,GAAMC,MAAS;AAC/B,MAAID,KAAQR,EAAM,SAChBA,EAAM,MAAMQ,CAAI,EAAE,UAAU,IAAI,eAAe,GAE7CC,KAAQT,EAAM,SAChBA,EAAM,MAAMS,CAAI,EAAE,UAAU,OAAO,eAAe;AAAA,IAEtD,CAAC,GAEDC,EAAU,MAAM;AACd,UAAIlB,EAAM,UAAU;AAClB,cAAMmB,IAASC,EAAA;AAEf,QAAIhB,EAAW,SACbe,EAAO,YAAYf,EAAW,KAAK;AAAA,MAEvC;AAGA,MAAIA,EAAW,OAAO,cAAc,aAAa,IAC/CI,EAAM,QAAQJ,EAAW,OAAO,iBAAiB,kBAAkB,KAAKG,IAExEC,EAAM,QAAQJ,EAAW,OAAO,iBAAiB,iBAAiB,KAAKG,GAIzE,OAAO,iBAAiB,UAAU,MAAMc,EAAA,CAAS;AAAA,IACnD,CAAC,GAEDC,EAAgB,MAAM;AACpB,aAAO,oBAAoB,UAAU,MAAMD,EAA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AK;AAAA,QAAQ,cAAapB;AAAA,MAAA;mBACpC,MAiBM;AAAA,YAjBNa,EAiBM,OAAA;AAAA,qBAfA;AAAA,YAAJ,KAAItC;AAAA,YACJ,aAAU;AAAA,YACT,OAAK8C,EAAA;AAAA,cAAcC,EAAAvC,CAAA,EAAQ;AAAA,cAAmBwC,EAAAA;AAAAA;gBAAmE,6BAAApD,EAAM,UAAK;AAAA,gBAAuC,cAAAA,EAAM,UAAK;AAAA,gBAA+C,oBAAA,CAAAA,EAAM;AAAA,cAAA;AAAA;YASnO,SAAOW,EAAA,KAAM;AAAA,UAAA;YAGd6B,EAAsDC,EAAA,QAAA,WAAA;AAAA,cAA/C,SAAApB;AAAA,cAAmB,UAAWX,EAAA;AAAA,YAAA;;gBAf7BA,EAAA,KAAQ;AAAA,UAAA;;;;;aAvBJW,CAAO;AAAA,IAAA;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sources":["../src/components/Dropdown/Dropdown.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, nextTick, onBeforeUnmount, onMounted, ref, useCssModule, watch } from 'vue';\n\n import { KEY_CODES } from '../../constants';\n import vClickoutside from '../../directives/clickoutside/clickoutside';\n import calculateElementOverflow from '../../utils/calculateElementOverflow';\n import { getMountPoint } from '../../utils/helpers';\n import Icon from '../Icon/Icon.vue';\n\n export type DropdownOffset = {\n x?: number;\n y?: number;\n };\n\n export interface DropdownProps {\n /**\n * Used to position the dropdown relative to target\n * Options: left, right\n */\n align?: 'left' | 'right';\n /**\n * When passed, text with caret is displayed instead of default kebab menu.\n */\n label?: string;\n /**\n * If true, dropdown will remain open when clicking on its content. Otherwise, it'll close automatically on click.\n */\n closeManually?: boolean;\n /**\n * Used to horizontally and vertically offset the dropdown in pixels\n * Keep in mind, `x` value is relative to `align` value.\n */\n offset?: DropdownOffset;\n /**\n * If `reattach` is true, the contents will be mounted in the mount point container,\n * so as to circumvent clipping issues from a parent's overflow property.\n */\n reattach?: boolean;\n /**\n * Custom class to apply to the default dropdown content element\n */\n contentClass?: string | string[];\n /**\n * Removes content container's max width\n */\n fluidContent?: boolean;\n }\n\n type DropdownStyles = {\n left?: string;\n right?: string;\n top?: string;\n };\n\n defineOptions({\n name: 'll-dropdown',\n });\n\n const props = withDefaults(defineProps<DropdownProps>(), {\n align: 'right',\n label: '',\n closeManually: false,\n offset: () => ({}),\n reattach: true,\n contentClass: '',\n fluidContent: false,\n });\n\n const emit = defineEmits<{\n toggle: [isActive: boolean];\n dismiss: [];\n }>();\n\n const contentRef = ref<HTMLElement | null>(null);\n const dropdownRef = ref<HTMLDivElement | null>(null);\n\n const DEFAULT_ITEMS_LIST = [] as unknown as NodeListOf<Element>;\n\n const items = ref<NodeListOf<Element>>(DEFAULT_ITEMS_LIST);\n const itemIndex = ref(-1);\n const isActive = ref(false);\n\n const styles = ref<DropdownStyles>({});\n const classes = useCssModule();\n\n watch(isActive, (val) => {\n if (!val) {\n itemIndex.value = -1;\n }\n\n emit('toggle', val);\n });\n\n watch(itemIndex, (next, prev) => {\n if (next in items.value) {\n items.value[next].classList.add('tw-bg-ice-200');\n }\n if (prev in items.value) {\n items.value[prev].classList.remove('tw-bg-ice-200');\n }\n });\n\n onMounted(() => {\n if (props.reattach) {\n const target = getMountPoint();\n\n if (contentRef.value) {\n target.appendChild(contentRef.value);\n }\n }\n\n // if stash-menu exists, use it's items\n if (contentRef.value?.querySelector('.stash-menu')) {\n items.value = contentRef.value?.querySelectorAll('.stash-menu-item') ?? DEFAULT_ITEMS_LIST;\n } else {\n items.value = contentRef.value?.querySelectorAll('.dropdown__item') ?? DEFAULT_ITEMS_LIST;\n }\n\n // avoid calling dismiss with ResizeEvent because it's target is the Window element and it's not a valid Node element to be passed to dismiss\n window.addEventListener('resize', () => dismiss());\n });\n\n onBeforeUnmount(() => {\n window.removeEventListener('resize', () => dismiss());\n contentRef?.value?.parentNode?.removeChild(contentRef.value);\n });\n\n /**\n * Dismisses the Dropdown.\n */\n function dismiss(event?: Event) {\n if (\n props.closeManually &&\n (contentRef.value?.contains(event?.target as HTMLElement) || contentRef.value === event?.target)\n ) {\n return;\n }\n\n const wasOpen = isActive.value;\n\n isActive.value = false;\n\n if (wasOpen) {\n emit('dismiss');\n }\n }\n\n /**\n * Opens or closes the Dropdown. If opening, positions and focuses its content.\n */\n async function toggle() {\n if (isActive.value) {\n isActive.value = false;\n } else {\n isActive.value = true;\n await calculateOffset();\n contentRef.value?.focus();\n }\n }\n\n /**\n * Handles all user keyboard input on the Dropdown.\n * @param {KeyboardEvent} e The native keydown event.\n */\n function onKeyDown(e: KeyboardEvent) {\n if (e.keyCode === KEY_CODES.ESCAPE) {\n dismiss();\n } else if (e.keyCode === KEY_CODES.DOWN && itemIndex.value < items.value.length - 1 && isActive.value) {\n itemIndex.value++;\n } else if (e.keyCode === KEY_CODES.UP && itemIndex.value > -1 && isActive.value) {\n itemIndex.value--;\n } else if (e.keyCode === KEY_CODES.ENTER && itemIndex.value !== -1 && isActive.value) {\n items[itemIndex.value].click();\n } else {\n return;\n }\n\n e.preventDefault(); // if keyDown did something / we didn't return\n }\n\n /**\n * Reset any page overflow offset\n */\n function resetOffset() {\n contentRef.value?.style.setProperty('--offset', '0');\n }\n\n /**\n * Calculate the position for the Dropdown content element,\n * relative to the viewport.\n * Repositions the dropdown content element (& arrow)\n * if it overflows the page (including gutter).\n */\n async function calculateOffset() {\n await nextTick();\n\n const toggleBCR = dropdownRef.value?.getBoundingClientRect() || ({} as DOMRect);\n const top = toggleBCR.top + toggleBCR.height;\n const offset = {\n x: 0,\n y: 0,\n ...props.offset,\n };\n\n if (props.reattach) {\n styles.value = {\n left: props.align === 'left' ? `${Math.round(toggleBCR.left) + offset.x}px` : undefined,\n right:\n props.align === 'right'\n ? `${document.documentElement.clientWidth - Math.round(toggleBCR.right) + offset.x}px`\n : undefined,\n top: `${window.scrollY + top + offset.y}px`,\n };\n await nextTick(); // wait for style updates to sync in the DOM\n }\n\n const overflow = calculateElementOverflow(contentRef?.value);\n\n if (overflow) {\n const direction = props.align === 'left' ? '-' : '';\n contentRef.value?.style.setProperty('--offset', `${direction}${overflow.value}`);\n }\n }\n\n defineExpose({\n isActive: computed(() => isActive.value),\n toggle,\n dismiss,\n });\n</script>\n\n<template>\n <div\n ref=\"dropdownRef\"\n v-clickoutside=\"dismiss\"\n class=\"tw-relative tw-inline-block\"\n data-test=\"ll-dropdown\"\n @keydown=\"onKeyDown\"\n >\n <!-- @slot Toggle component slot, receives `toggle` method to trigger Dropdown display -->\n <slot name=\"toggle\" :is-active=\"isActive\" :toggle=\"toggle\">\n <button\n data-test=\"button|toggle\"\n :aria-expanded=\"isActive\"\n :class=\"[label ? 'tw-min-w-auto tw-outline-none' : 'tw-rounded tw-p-3']\"\n @click=\"toggle\"\n >\n <span v-if=\"label\" class=\"tw-flex tw-items-center tw-font-medium tw-text-blue-500 hover:tw-text-blue-700\">\n {{ label }}\n <Icon name=\"caret-down\" />\n </span>\n <Icon v-else name=\"ellipsis\" />\n </button>\n </slot>\n\n <transition name=\"fade\" @after-leave=\"resetOffset\">\n <div\n v-show=\"isActive\"\n ref=\"contentRef\"\n data-test=\"ll-dropdown-content\"\n :class=\"[\n classes.content,\n contentClass,\n {\n 'tw-left-0 after:tw-left-6': props.align === 'left',\n 'tw-right-0': props.align === 'right',\n 'tw-max-w-[360px]': !props.fluidContent,\n },\n ]\"\n :style=\"styles\"\n >\n <!-- @slot Dropdown content slot. Receives `dismiss` method, to trigger manual close. You must call dismiss with parentheses. Receives `is-active` prop. -->\n <slot :dismiss=\"dismiss\" :is-active=\"isActive\"></slot>\n </div>\n </transition>\n </div>\n</template>\n\n<style module>\n .content {\n --offset: 0;\n\n @apply tw-shadow-2xl\n tw-bg-white\n tw-border\n tw-border-solid\n tw-border-blue-500\n tw-rounded\n tw-absolute\n tw-z-[301]\n tw-min-w-[200px];\n\n transform: translateX(calc(var(--offset) * 1px));\n }\n\n /**\n * TODO: these global styles should be componentized in https://leaflink.atlassian.net/browse/STASH-566\n */\n :global(.dropdown__list) {\n @apply tw-bg-white tw-list-none tw-m-1.5 tw-p-0;\n }\n\n :global(.dropdown__item) {\n @apply tw-block tw-mx-0 tw-mt-0 tw-mb-1.5 tw-w-full first:tw-mt-0 last:tw-mb-0;\n }\n\n :global(.dropdown__item) button {\n @apply tw-border-none tw-text-left tw-p-1.5;\n }\n\n :global(.dropdown__item) :where(a, button) {\n @apply tw-rounded\n tw-text-ice-700\n tw-block\n tw-py-[10px]\n tw-px-1.5\n tw-w-full\n disabled:tw-text-ice-500\n disabled:tw-cursor-default\n hover:tw-bg-ice-200\n hover:tw-text-ice-700\n hover:tw-no-underline\n tw-transition-all\n tw-duration-fast\n tw-ease-swing;\n }\n</style>\n"],"names":["props","__props","emit","__emit","contentRef","ref","dropdownRef","DEFAULT_ITEMS_LIST","items","itemIndex","isActive","styles","classes","useCssModule","watch","val","next","prev","onMounted","target","getMountPoint","_a","_b","_c","dismiss","onBeforeUnmount","event","wasOpen","toggle","calculateOffset","onKeyDown","KEY_CODES","resetOffset","nextTick","toggleBCR","top","offset","overflow","calculateElementOverflow","direction","__expose","computed"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0DE,UAAMA,IAAQC,GAURC,IAAOC,GAKPC,IAAaC,EAAwB,IAAI,GACzCC,IAAcD,EAA2B,IAAI,GAE7CE,IAAqB,CAAC,GAEtBC,IAAQH,EAAyBE,CAAkB,GACnDE,IAAYJ,EAAI,EAAE,GAClBK,IAAWL,EAAI,EAAK,GAEpBM,IAASN,EAAoB,EAAE,GAC/BO,IAAUC,EAAa;AAEvB,IAAAC,EAAAJ,GAAU,CAACK,MAAQ;AACvB,MAAKA,MACHN,EAAU,QAAQ,KAGpBP,EAAK,UAAUa,CAAG;AAAA,IAAA,CACnB,GAEKD,EAAAL,GAAW,CAACO,GAAMC,MAAS;AAC3B,MAAAD,KAAQR,EAAM,SAChBA,EAAM,MAAMQ,CAAI,EAAE,UAAU,IAAI,eAAe,GAE7CC,KAAQT,EAAM,SACh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AUC,EAAS,MAAM/B,EAAS,KAAK;AAAA,MACvC,QAAAkB;AAAA,MACA,SAAAJ;AAAA,IAAA,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/Dropdown.vue.d.ts
CHANGED
|
@@ -2,36 +2,72 @@ import { ComponentOptionsMixin } from 'vue';
|
|
|
2
2
|
import { ComponentProvideOptions } from 'vue';
|
|
3
3
|
import { ComputedRef } from 'vue';
|
|
4
4
|
import { DefineComponent } from 'vue';
|
|
5
|
+
import { ExtractPropTypes } from 'vue';
|
|
6
|
+
import { PropType } from 'vue';
|
|
5
7
|
import { PublicProps } from 'vue';
|
|
6
8
|
|
|
9
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
10
|
+
|
|
11
|
+
declare type __VLS_Prettify<T> = {
|
|
12
|
+
[K in keyof T]: T[K];
|
|
13
|
+
} & {};
|
|
14
|
+
|
|
15
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
16
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
17
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
18
|
+
} : {
|
|
19
|
+
type: PropType<T[K]>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
25
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
26
|
+
default: D[K];
|
|
27
|
+
}> : P[K];
|
|
28
|
+
};
|
|
29
|
+
|
|
7
30
|
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
8
31
|
new (): {
|
|
9
32
|
$slots: S;
|
|
10
33
|
};
|
|
11
34
|
};
|
|
12
35
|
|
|
13
|
-
declare const _default: __VLS_WithTemplateSlots<DefineComponent<DropdownProps
|
|
36
|
+
declare const _default: __VLS_WithTemplateSlots<DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DropdownProps>, {
|
|
37
|
+
align: string;
|
|
38
|
+
label: string;
|
|
39
|
+
closeManually: boolean;
|
|
40
|
+
offset: () => {};
|
|
41
|
+
reattach: boolean;
|
|
42
|
+
contentClass: string;
|
|
43
|
+
fluidContent: boolean;
|
|
44
|
+
}>>, {
|
|
14
45
|
isActive: ComputedRef<boolean>;
|
|
15
46
|
toggle: typeof toggle;
|
|
16
47
|
dismiss: typeof dismiss;
|
|
17
48
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
18
|
-
toggle: (isActive: boolean) =>
|
|
19
|
-
dismiss: () =>
|
|
20
|
-
}, string, PublicProps, Readonly<DropdownProps
|
|
49
|
+
toggle: (isActive: boolean) => void;
|
|
50
|
+
dismiss: () => void;
|
|
51
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DropdownProps>, {
|
|
52
|
+
align: string;
|
|
53
|
+
label: string;
|
|
54
|
+
closeManually: boolean;
|
|
55
|
+
offset: () => {};
|
|
56
|
+
reattach: boolean;
|
|
57
|
+
contentClass: string;
|
|
58
|
+
fluidContent: boolean;
|
|
59
|
+
}>>> & Readonly<{
|
|
21
60
|
onToggle?: ((isActive: boolean) => any) | undefined;
|
|
22
61
|
onDismiss?: (() => any) | undefined;
|
|
23
62
|
}>, {
|
|
24
63
|
label: string;
|
|
25
|
-
align: "
|
|
26
|
-
offset: DropdownOffset;
|
|
64
|
+
align: "left" | "right";
|
|
27
65
|
closeManually: boolean;
|
|
66
|
+
offset: DropdownOffset;
|
|
28
67
|
reattach: boolean;
|
|
29
68
|
contentClass: string | string[];
|
|
30
69
|
fluidContent: boolean;
|
|
31
|
-
}, {}, {}, {}, string, ComponentProvideOptions,
|
|
32
|
-
dropdownRef: HTMLDivElement;
|
|
33
|
-
contentRef: HTMLDivElement;
|
|
34
|
-
}, HTMLDivElement>, {
|
|
70
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
|
|
35
71
|
toggle?(_: {
|
|
36
72
|
isActive: boolean;
|
|
37
73
|
toggle: typeof toggle;
|
|
@@ -48,12 +84,12 @@ export default _default;
|
|
|
48
84
|
*/
|
|
49
85
|
declare function dismiss(event?: Event): void;
|
|
50
86
|
|
|
51
|
-
declare type DropdownOffset = {
|
|
87
|
+
export declare type DropdownOffset = {
|
|
52
88
|
x?: number;
|
|
53
89
|
y?: number;
|
|
54
90
|
};
|
|
55
91
|
|
|
56
|
-
declare interface DropdownProps {
|
|
92
|
+
export declare interface DropdownProps {
|
|
57
93
|
/**
|
|
58
94
|
* Used to position the dropdown relative to target
|
|
59
95
|
* Options: left, right
|
package/dist/EmptyState.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as f, useCssModule as p, useSlots as g, createElementBlock as o, openBlock as s, createBlock as _, createCommentVNode as i, createElementVNode as u, renderSlot as a, toDisplayString as n, normalizeClass as m, unref as r, createTextVNode as y } from "vue";
|
|
2
2
|
import { t as w } from "./locale.js";
|
|
3
|
-
import { _ as b } from "./Illustration.vue_vue_type_script_setup_true_lang-
|
|
3
|
+
import { _ as b } from "./Illustration.vue_vue_type_script_setup_true_lang-BrqEF8xe.js";
|
|
4
4
|
import { _ as h } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const x = {
|
|
6
6
|
key: "empty",
|
package/dist/EmptyState.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.js","sources":["../src/components/EmptyState/EmptyState.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { useCssModule } from 'vue';\n\n import { t } from '../../locale';\n import { VignetteNames } from '../Illustration/Illustration.models';\n import Illustration from '../Illustration/Illustration.vue';\n\n export interface EmptyStateProps {\n /**\n * @deprecated Use illustration instead.\n */\n image?: {\n alt?: string;\n src: string;\n };\n\n /**\n * @deprecated Use title instead.\n */\n text?: string;\n\n /**\n * the title text of the empty state\n */\n title?: string;\n\n /**\n * the subtitle text of the empty state\n */\n subtitle?: string;\n\n /**\n * additional text to place at the bottom of the empty state\n */\n footnote?: string;\n\n /**\n * The name of the vignette illustration to render\n */\n vignette?: VignetteNames;\n\n /**\n * The size in pixels of the vignette illustration. Defaults to 300.\n */\n vignetteSize?: number;\n }\n\n export interface EmptyStateSlots {\n title?: () => unknown;\n subtitle?: () => unknown;\n footnote?: () => unknown;\n button?: () => unknown;\n image?: () => unknown;\n }\n\n defineOptions({\n name: 'll-empty-state',\n });\n\n const props = withDefaults(defineProps<EmptyStateProps>(), {\n /**\n * An optional image to render\n */\n image: () => ({\n alt: '',\n src: '',\n }),\n\n /**\n * The custom message to render\n */\n text: '',\n\n title: '',\n subtitle: '',\n footnote: '',\n vignette: undefined,\n vignetteSize: 300,\n });\n\n const classes = useCssModule();\n const slots = defineSlots<EmptyStateSlots>();\n</script>\n\n<template>\n <div key=\"empty\" class=\"stash-empty-state\" data-test=\"stash-empty-state\">\n <template v-if=\"props.title || slots.title || props.subtitle || slots.subtitle || props.vignette\">\n <div class=\"tw-flex tw-flex-col tw-items-center tw-text-center md:tw-flex-row md:tw-text-left\">\n <Illustration\n v-if=\"props.vignette\"\n data-test=\"stash-empty-state|illustration\"\n type=\"vignette\"\n class=\"tw-mx-3\"\n :name=\"props.vignette\"\n :size=\"props.vignetteSize\"\n />\n <section>\n <slot name=\"title\">\n <h3 class=\"tw-mb-1.5\">\n {{ props.title }}\n </h3>\n </slot>\n\n <slot name=\"subtitle\">\n <p v-if=\"props.subtitle || slots.subtitle\" :class=\"{ 'tw-mb-8': slots.button, 'tw-mb-0': !slots.button }\">\n {{ props.subtitle }}\n </p>\n </slot>\n\n <slot name=\"button\"></slot>\n <slot name=\"footnote\">\n <p v-if=\"props.footnote\" class=\"tw-mb-0 tw-text-xs\" :class=\"{ 'tw-mt-3': slots.button }\">\n {{ props.footnote }}\n </p>\n </slot>\n </section>\n </div>\n </template>\n\n <template v-else>\n <div\n class=\"tw-mx-auto tw-my-0 tw-flex tw-items-center tw-justify-center tw-py-12\"\n :class=\"[classes.root, { 'tw-text-center': !props.image.src && !slots.image }]\"\n >\n <slot name=\"image\">\n <img\n v-if=\"props.image.src\"\n class=\"tw-mr-6\"\n :alt=\"props.image.alt\"\n :class=\"classes.image\"\n :src=\"props.image.src\"\n data-test=\"stash-empty-state__img\"\n />\n </slot>\n\n {{ props.text || t('ll.emptyState.noResults') }}\n </div>\n </template>\n </div>\n</template>\n\n<style module>\n .root {\n max-width: 600px;\n }\n\n .image {\n max-width: 60px;\n }\n</style>\n"],"names":["props","__props","classes","useCssModule","slots","_useSlots"
|
|
1
|
+
{"version":3,"file":"EmptyState.js","sources":["../src/components/EmptyState/EmptyState.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { useCssModule } from 'vue';\n\n import { t } from '../../locale';\n import { VignetteNames } from '../Illustration/Illustration.models';\n import Illustration from '../Illustration/Illustration.vue';\n\n export interface EmptyStateProps {\n /**\n * @deprecated Use illustration instead.\n */\n image?: {\n alt?: string;\n src: string;\n };\n\n /**\n * @deprecated Use title instead.\n */\n text?: string;\n\n /**\n * the title text of the empty state\n */\n title?: string;\n\n /**\n * the subtitle text of the empty state\n */\n subtitle?: string;\n\n /**\n * additional text to place at the bottom of the empty state\n */\n footnote?: string;\n\n /**\n * The name of the vignette illustration to render\n */\n vignette?: VignetteNames;\n\n /**\n * The size in pixels of the vignette illustration. Defaults to 300.\n */\n vignetteSize?: number;\n }\n\n export interface EmptyStateSlots {\n title?: () => unknown;\n subtitle?: () => unknown;\n footnote?: () => unknown;\n button?: () => unknown;\n image?: () => unknown;\n }\n\n defineOptions({\n name: 'll-empty-state',\n });\n\n const props = withDefaults(defineProps<EmptyStateProps>(), {\n /**\n * An optional image to render\n */\n image: () => ({\n alt: '',\n src: '',\n }),\n\n /**\n * The custom message to render\n */\n text: '',\n\n title: '',\n subtitle: '',\n footnote: '',\n vignette: undefined,\n vignetteSize: 300,\n });\n\n const classes = useCssModule();\n const slots = defineSlots<EmptyStateSlots>();\n</script>\n\n<template>\n <div key=\"empty\" class=\"stash-empty-state\" data-test=\"stash-empty-state\">\n <template v-if=\"props.title || slots.title || props.subtitle || slots.subtitle || props.vignette\">\n <div class=\"tw-flex tw-flex-col tw-items-center tw-text-center md:tw-flex-row md:tw-text-left\">\n <Illustration\n v-if=\"props.vignette\"\n data-test=\"stash-empty-state|illustration\"\n type=\"vignette\"\n class=\"tw-mx-3\"\n :name=\"props.vignette\"\n :size=\"props.vignetteSize\"\n />\n <section>\n <slot name=\"title\">\n <h3 class=\"tw-mb-1.5\">\n {{ props.title }}\n </h3>\n </slot>\n\n <slot name=\"subtitle\">\n <p v-if=\"props.subtitle || slots.subtitle\" :class=\"{ 'tw-mb-8': slots.button, 'tw-mb-0': !slots.button }\">\n {{ props.subtitle }}\n </p>\n </slot>\n\n <slot name=\"button\"></slot>\n <slot name=\"footnote\">\n <p v-if=\"props.footnote\" class=\"tw-mb-0 tw-text-xs\" :class=\"{ 'tw-mt-3': slots.button }\">\n {{ props.footnote }}\n </p>\n </slot>\n </section>\n </div>\n </template>\n\n <template v-else>\n <div\n class=\"tw-mx-auto tw-my-0 tw-flex tw-items-center tw-justify-center tw-py-12\"\n :class=\"[classes.root, { 'tw-text-center': !props.image.src && !slots.image }]\"\n >\n <slot name=\"image\">\n <img\n v-if=\"props.image.src\"\n class=\"tw-mr-6\"\n :alt=\"props.image.alt\"\n :class=\"classes.image\"\n :src=\"props.image.src\"\n data-test=\"stash-empty-state__img\"\n />\n </slot>\n\n {{ props.text || t('ll.emptyState.noResults') }}\n </div>\n </template>\n </div>\n</template>\n\n<style module>\n .root {\n max-width: 600px;\n }\n\n .image {\n max-width: 60px;\n }\n</style>\n"],"names":["props","__props","classes","useCssModule","slots","_useSlots"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DE,UAAMA,IAAQC,GAqBRC,IAAUC,EAAa,GACvBC,IAAQC,EAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/EmptyState.vue.d.ts
CHANGED
|
@@ -1,29 +1,86 @@
|
|
|
1
1
|
import { ComponentOptionsMixin } from 'vue';
|
|
2
2
|
import { ComponentProvideOptions } from 'vue';
|
|
3
3
|
import { DefineComponent } from 'vue';
|
|
4
|
+
import { ExtractPropTypes } from 'vue';
|
|
5
|
+
import { PropType } from 'vue';
|
|
4
6
|
import { PublicProps } from 'vue';
|
|
5
7
|
|
|
8
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
9
|
+
|
|
10
|
+
declare type __VLS_Prettify<T> = {
|
|
11
|
+
[K in keyof T]: T[K];
|
|
12
|
+
} & {};
|
|
13
|
+
|
|
14
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
15
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
16
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
17
|
+
} : {
|
|
18
|
+
type: PropType<T[K]>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
24
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
25
|
+
default: D[K];
|
|
26
|
+
}> : P[K];
|
|
27
|
+
};
|
|
28
|
+
|
|
6
29
|
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
7
30
|
new (): {
|
|
8
31
|
$slots: S;
|
|
9
32
|
};
|
|
10
33
|
};
|
|
11
34
|
|
|
12
|
-
declare const _default: __VLS_WithTemplateSlots<DefineComponent<
|
|
35
|
+
declare const _default: __VLS_WithTemplateSlots<DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<EmptyStateProps>, {
|
|
36
|
+
/**
|
|
37
|
+
* An optional image to render
|
|
38
|
+
*/
|
|
39
|
+
image: () => {
|
|
40
|
+
alt: string;
|
|
41
|
+
src: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The custom message to render
|
|
45
|
+
*/
|
|
13
46
|
text: string;
|
|
14
47
|
title: string;
|
|
48
|
+
subtitle: string;
|
|
49
|
+
footnote: string;
|
|
50
|
+
vignette: undefined;
|
|
51
|
+
vignetteSize: number;
|
|
52
|
+
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<EmptyStateProps>, {
|
|
53
|
+
/**
|
|
54
|
+
* An optional image to render
|
|
55
|
+
*/
|
|
56
|
+
image: () => {
|
|
57
|
+
alt: string;
|
|
58
|
+
src: string;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* The custom message to render
|
|
62
|
+
*/
|
|
63
|
+
text: string;
|
|
64
|
+
title: string;
|
|
65
|
+
subtitle: string;
|
|
66
|
+
footnote: string;
|
|
67
|
+
vignette: undefined;
|
|
68
|
+
vignetteSize: number;
|
|
69
|
+
}>>> & Readonly<{}>, {
|
|
70
|
+
title: string;
|
|
15
71
|
image: {
|
|
16
72
|
alt?: string | undefined;
|
|
17
73
|
src: string;
|
|
18
74
|
};
|
|
75
|
+
text: string;
|
|
19
76
|
subtitle: string;
|
|
20
|
-
vignette: "
|
|
77
|
+
vignette: "map" | "search" | "bank" | "calendar" | "dashboard" | "edit" | "megaphone" | "truck" | "warehouse" | "payments" | "light-bulb" | "messages" | "pie-chart" | "api" | "basket" | "brand-menu" | "deals" | "document-search" | "empty-tray" | "graph" | "integrations" | "money-bank" | "no-filters-result" | "notifications" | "orders-empty" | "product-cards" | "product-details" | "product-display" | "search-storefront" | "store" | "todo" | "users" | "warehouse-delivery";
|
|
21
78
|
footnote: string;
|
|
22
79
|
vignetteSize: number;
|
|
23
|
-
}, {}, {}, {}, string, ComponentProvideOptions,
|
|
80
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, Readonly<EmptyStateSlots> & EmptyStateSlots>;
|
|
24
81
|
export default _default;
|
|
25
82
|
|
|
26
|
-
declare interface EmptyStateProps {
|
|
83
|
+
export declare interface EmptyStateProps {
|
|
27
84
|
/**
|
|
28
85
|
* @deprecated Use illustration instead.
|
|
29
86
|
*/
|
|
@@ -57,7 +114,7 @@ declare interface EmptyStateProps {
|
|
|
57
114
|
vignetteSize?: number;
|
|
58
115
|
}
|
|
59
116
|
|
|
60
|
-
declare interface EmptyStateSlots {
|
|
117
|
+
export declare interface EmptyStateSlots {
|
|
61
118
|
title?: () => unknown;
|
|
62
119
|
subtitle?: () => unknown;
|
|
63
120
|
footnote?: () => unknown;
|
package/dist/Expand.vue.d.ts
CHANGED
|
@@ -1,34 +1,64 @@
|
|
|
1
1
|
import { ComponentOptionsMixin } from 'vue';
|
|
2
2
|
import { ComponentProvideOptions } from 'vue';
|
|
3
3
|
import { DefineComponent } from 'vue';
|
|
4
|
+
import { ExtractPropTypes } from 'vue';
|
|
5
|
+
import { PropType } from 'vue';
|
|
4
6
|
import { PublicProps } from 'vue';
|
|
5
7
|
|
|
8
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
9
|
+
|
|
10
|
+
declare type __VLS_Prettify<T> = {
|
|
11
|
+
[K in keyof T]: T[K];
|
|
12
|
+
} & {};
|
|
13
|
+
|
|
14
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
15
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
16
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
17
|
+
} : {
|
|
18
|
+
type: PropType<T[K]>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
24
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
25
|
+
default: D[K];
|
|
26
|
+
}> : P[K];
|
|
27
|
+
};
|
|
28
|
+
|
|
6
29
|
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
7
30
|
new (): {
|
|
8
31
|
$slots: S;
|
|
9
32
|
};
|
|
10
33
|
};
|
|
11
34
|
|
|
12
|
-
declare const _default: __VLS_WithTemplateSlots<DefineComponent<ExpandProps
|
|
13
|
-
|
|
14
|
-
|
|
35
|
+
declare const _default: __VLS_WithTemplateSlots<DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ExpandProps>, {
|
|
36
|
+
is: string;
|
|
37
|
+
isExpanded: boolean;
|
|
38
|
+
isLazy: boolean;
|
|
39
|
+
transitionName: string;
|
|
40
|
+
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
41
|
+
"after-expand": () => void;
|
|
42
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ExpandProps>, {
|
|
43
|
+
is: string;
|
|
44
|
+
isExpanded: boolean;
|
|
45
|
+
isLazy: boolean;
|
|
46
|
+
transitionName: string;
|
|
47
|
+
}>>> & Readonly<{
|
|
15
48
|
"onAfter-expand"?: (() => any) | undefined;
|
|
16
49
|
}>, {
|
|
17
|
-
transitionName: string;
|
|
18
50
|
is: ExpandOuterElement;
|
|
19
51
|
isExpanded: boolean;
|
|
20
52
|
isLazy: boolean;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}, any>, {
|
|
24
|
-
default?(_: {}): any;
|
|
53
|
+
transitionName: string;
|
|
54
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
|
|
25
55
|
default?(_: {}): any;
|
|
26
56
|
}>;
|
|
27
57
|
export default _default;
|
|
28
58
|
|
|
29
|
-
declare type ExpandOuterElement = 'div' | 'td' | 'li';
|
|
59
|
+
export declare type ExpandOuterElement = 'div' | 'td' | 'li';
|
|
30
60
|
|
|
31
|
-
declare interface ExpandProps {
|
|
61
|
+
export declare interface ExpandProps {
|
|
32
62
|
/**
|
|
33
63
|
* The root element to use as the root element the expand transition gets applied to
|
|
34
64
|
*/
|