@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/Modal.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { FOCUS_ELEMENTS_SELECTOR as
|
|
4
|
-
import { t as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { _ as
|
|
9
|
-
var
|
|
10
|
-
const
|
|
1
|
+
import { defineComponent as R, useSlots as T, ref as d, computed as k, watch as D, onBeforeUnmount as V, createElementBlock as f, createCommentVNode as i, openBlock as n, withKeys as A, normalizeClass as r, createVNode as x, createElementVNode as g, withModifiers as L, unref as w, createBlock as j, renderSlot as m, toDisplayString as K, withCtx as F } from "vue";
|
|
2
|
+
import q from "lodash-es/uniqueId";
|
|
3
|
+
import { FOCUS_ELEMENTS_SELECTOR as P } from "./constants.js";
|
|
4
|
+
import { t as H } from "./locale.js";
|
|
5
|
+
import U from "./Backdrop.js";
|
|
6
|
+
import I from "./Button.js";
|
|
7
|
+
import N from "./Icon.js";
|
|
8
|
+
import { _ as W } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
|
+
var G = /* @__PURE__ */ ((l) => (l.Narrow = "narrow", l.Medium = "medium", l.Wide = "wide", l))(G || {}), J = /* @__PURE__ */ ((l) => (l.Center = "center", l.Left = "left", l.Right = "right", l))(J || {});
|
|
10
|
+
const Q = ["aria-labelledby"], X = { class: "tw-flex tw-place-items-center" }, Y = ["id"], Z = { class: "stash-modal__footer__actions tw-flex tw-flex-col tw-justify-end lg:tw-flex-row" }, ee = /* @__PURE__ */ R({
|
|
11
11
|
name: "ll-modal",
|
|
12
12
|
__name: "Modal",
|
|
13
13
|
props: {
|
|
@@ -26,12 +26,12 @@ const J = ["aria-labelledby"], Q = { class: "tw-flex tw-place-items-center" }, X
|
|
|
26
26
|
preventDismiss: { type: Boolean, default: !1 }
|
|
27
27
|
},
|
|
28
28
|
emits: ["update:open", "update:is-open", "dismiss"],
|
|
29
|
-
setup(l, { emit:
|
|
30
|
-
const e = l, y =
|
|
29
|
+
setup(l, { emit: M }) {
|
|
30
|
+
const e = l, y = M, _ = T(), u = d(), B = d(), h = d([]), b = d(), E = d(), c = d({ height: "", overflow: "" }), C = q("modal-header-"), z = k(() => !!_.actions || !!_.footer), o = k(() => e.open || e.isOpen), s = k(() => e.position === "left" || e.position === "right");
|
|
31
31
|
function p() {
|
|
32
32
|
return document.scrollingElement || document.body;
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
D(
|
|
35
35
|
o,
|
|
36
36
|
() => {
|
|
37
37
|
S(o.value ? "hide" : "show"), o.value && Object.assign(c.value, {
|
|
@@ -45,54 +45,56 @@ const J = ["aria-labelledby"], Q = { class: "tw-flex tw-place-items-center" }, X
|
|
|
45
45
|
});
|
|
46
46
|
},
|
|
47
47
|
{ immediate: !0 }
|
|
48
|
-
),
|
|
48
|
+
), V(() => {
|
|
49
|
+
var t;
|
|
49
50
|
S("show"), Object.assign(p().style, {
|
|
50
51
|
overflow: c.value.overflow,
|
|
51
52
|
height: c.value.height
|
|
52
|
-
}), document.removeEventListener("keydown", O), B.value
|
|
53
|
+
}), document.removeEventListener("keydown", O), (t = B.value) == null || t.focus();
|
|
53
54
|
});
|
|
54
55
|
function v() {
|
|
55
56
|
e.preventDismiss || (y("update:open", !1), y("update:is-open", !1), y("dismiss"));
|
|
56
57
|
}
|
|
57
|
-
|
|
58
|
-
u.value && (B.value = document.activeElement, u.value.focus(), h.value = Array.from(u.value.querySelectorAll(
|
|
58
|
+
D(u, () => {
|
|
59
|
+
u.value && (B.value = document.activeElement, u.value.focus(), h.value = Array.from(u.value.querySelectorAll(P)), b.value = h.value[0], E.value = h.value[h.value.length - 1], document.addEventListener("keydown", O));
|
|
59
60
|
});
|
|
60
61
|
function O(t) {
|
|
61
|
-
|
|
62
|
+
var a, $;
|
|
63
|
+
t.key === "Tab" && (t.shiftKey && document.activeElement === b.value ? ((a = E.value) == null || a.focus(), t.preventDefault()) : document.activeElement === E.value && (($ = b.value) == null || $.focus(), t.preventDefault()));
|
|
62
64
|
}
|
|
63
65
|
function S(t) {
|
|
64
|
-
const
|
|
65
|
-
!
|
|
66
|
+
const a = document.getElementById("launcher");
|
|
67
|
+
!a || !a.parentElement || (a.parentElement.style.display = t === "show" ? "block" : "none");
|
|
66
68
|
}
|
|
67
|
-
return (t,
|
|
69
|
+
return (t, a) => o.value ? (n(), f("div", {
|
|
68
70
|
key: 0,
|
|
69
71
|
ref_key: "rootRef",
|
|
70
72
|
ref: u,
|
|
71
|
-
class:
|
|
73
|
+
class: r(["stash-modal tw-fixed tw-inset-0", {
|
|
72
74
|
"tw-invisible tw-z-behind": !o.value,
|
|
73
75
|
"tw-visible tw-z-modal": o.value,
|
|
74
76
|
"lg:tw-flex lg:tw-flex-col lg:tw-items-center lg:tw-justify-center": e.position === "center",
|
|
75
|
-
"tw-overflow-y-auto": !e.scrollable && !
|
|
76
|
-
"tw-overflow-y-hidden":
|
|
77
|
+
"tw-overflow-y-auto": !e.scrollable && !s.value,
|
|
78
|
+
"tw-overflow-y-hidden": s.value
|
|
77
79
|
}]),
|
|
78
80
|
"data-test": "ll-modal",
|
|
79
81
|
tabindex: "0",
|
|
80
|
-
onKeydown:
|
|
82
|
+
onKeydown: A(v, ["esc"])
|
|
81
83
|
}, [
|
|
82
|
-
x(
|
|
84
|
+
x(U, {
|
|
83
85
|
class: "stash-modal__backdrop",
|
|
84
|
-
onClick:
|
|
86
|
+
onClick: L(v, ["stop"])
|
|
85
87
|
}),
|
|
86
88
|
g("div", {
|
|
87
89
|
"aria-modal": "true",
|
|
88
90
|
role: "dialog",
|
|
89
91
|
"aria-labelledby": w(C),
|
|
90
|
-
class:
|
|
92
|
+
class: r(["stash-modal__dialog tw-relative tw-flex tw-h-screen tw-w-full tw-flex-col lg:tw-shadow-3xl", [
|
|
91
93
|
`stash-modal__dialog--size-${e.size}`,
|
|
92
94
|
`stash-modal__dialog--position-${e.position}`,
|
|
93
95
|
{
|
|
94
96
|
"stash-modal__dialog--is-open": o.value,
|
|
95
|
-
"stash-modal__dialog--is-drawer":
|
|
97
|
+
"stash-modal__dialog--is-drawer": s.value,
|
|
96
98
|
"stash-modal__dialog--is-contrast": e.contrast,
|
|
97
99
|
"stash-modal__dialog--is-scrollable": e.scrollable,
|
|
98
100
|
"lg:tw-w-[360px]": e.size === "narrow",
|
|
@@ -100,37 +102,37 @@ const J = ["aria-labelledby"], Q = { class: "tw-flex tw-place-items-center" }, X
|
|
|
100
102
|
"lg:tw-w-[960px]": e.size === "wide",
|
|
101
103
|
"lg:tw-my-0 lg:tw-h-auto lg:tw-max-h-[90vh]": e.position === "center",
|
|
102
104
|
// tw-absolute causing this to break when items in bottom of container get focus
|
|
103
|
-
"lg:tw-fixed lg:tw-h-screen":
|
|
105
|
+
"lg:tw-fixed lg:tw-h-screen": s.value,
|
|
104
106
|
"lg:tw-left-0": e.position === "left",
|
|
105
107
|
"lg:tw-right-0": e.position === "right"
|
|
106
108
|
}
|
|
107
109
|
]]),
|
|
108
|
-
onClick:
|
|
110
|
+
onClick: a[0] || (a[0] = L(() => {
|
|
109
111
|
}, ["stop"]))
|
|
110
112
|
}, [
|
|
111
|
-
e.hideHeader ?
|
|
113
|
+
e.hideHeader ? i("", !0) : (n(), f("header", {
|
|
112
114
|
key: 0,
|
|
113
115
|
"data-test": "stash-modal__header",
|
|
114
|
-
class:
|
|
116
|
+
class: r(["stash-modal__header tw-grid tw-h-12 tw-place-items-center tw-bg-purple-500", { "lg:tw-rounded-t": !s.value }])
|
|
115
117
|
}, [
|
|
116
|
-
g("div",
|
|
118
|
+
g("div", X, [
|
|
117
119
|
m(t.$slots, "headerAction", {}, void 0, !0)
|
|
118
120
|
]),
|
|
119
|
-
e.title ? (
|
|
121
|
+
e.title ? (n(), f("h3", {
|
|
120
122
|
key: 0,
|
|
121
123
|
id: w(C),
|
|
122
124
|
class: "tw-m-0 tw-flex-1 tw-leading-6 tw-text-white"
|
|
123
|
-
},
|
|
124
|
-
e.hideClose ?
|
|
125
|
+
}, K(e.title), 9, Y)) : i("", !0),
|
|
126
|
+
e.hideClose ? i("", !0) : (n(), j(I, {
|
|
125
127
|
key: 1,
|
|
126
128
|
icon: "",
|
|
127
129
|
"data-test": "ll-modal-close",
|
|
128
|
-
title: w(
|
|
130
|
+
title: w(H)("ll.closeModal"),
|
|
129
131
|
type: "button",
|
|
130
132
|
onClick: v
|
|
131
133
|
}, {
|
|
132
|
-
default:
|
|
133
|
-
x(
|
|
134
|
+
default: F(() => [
|
|
135
|
+
x(N, {
|
|
134
136
|
class: "tw-text-white",
|
|
135
137
|
name: "close"
|
|
136
138
|
})
|
|
@@ -138,37 +140,37 @@ const J = ["aria-labelledby"], Q = { class: "tw-flex tw-place-items-center" }, X
|
|
|
138
140
|
_: 1
|
|
139
141
|
}, 8, ["title"]))
|
|
140
142
|
], 2)),
|
|
141
|
-
!e.hideClose && e.hideHeader ? (
|
|
143
|
+
!e.hideClose && e.hideHeader ? (n(), j(I, {
|
|
142
144
|
key: 1,
|
|
143
145
|
class: "tw-absolute tw-right-0 tw-top-0 tw-z-10",
|
|
144
146
|
icon: "",
|
|
145
147
|
"data-test": "ll-modal-close",
|
|
146
148
|
type: "button",
|
|
147
|
-
title: w(
|
|
149
|
+
title: w(H)("ll.closeModal"),
|
|
148
150
|
onClick: v
|
|
149
151
|
}, {
|
|
150
|
-
default:
|
|
151
|
-
x(
|
|
152
|
-
class:
|
|
152
|
+
default: F(() => [
|
|
153
|
+
x(N, {
|
|
154
|
+
class: r(["tw-drop-shadow-md", [e.closeButtonColorClass]]),
|
|
153
155
|
name: "close"
|
|
154
156
|
}, null, 8, ["class"])
|
|
155
157
|
]),
|
|
156
158
|
_: 1
|
|
157
|
-
}, 8, ["title"])) :
|
|
158
|
-
w(_)["featured-content"] ? (
|
|
159
|
+
}, 8, ["title"])) : i("", !0),
|
|
160
|
+
w(_)["featured-content"] ? (n(), f("div", {
|
|
159
161
|
key: 2,
|
|
160
|
-
class:
|
|
162
|
+
class: r(["stash-modal__featured-content tw-relative", {
|
|
161
163
|
"tw-rounded-t": e.hideHeader
|
|
162
164
|
}])
|
|
163
165
|
}, [
|
|
164
166
|
m(t.$slots, "featured-content", {}, void 0, !0)
|
|
165
|
-
], 2)) :
|
|
167
|
+
], 2)) : i("", !0),
|
|
166
168
|
g("div", {
|
|
167
|
-
class:
|
|
169
|
+
class: r(["stash-modal__body tw-flex-1 tw-overflow-y-auto", [
|
|
168
170
|
{
|
|
169
171
|
"tw-p-3 lg:tw-p-6": !e.disableBodyPadding,
|
|
170
|
-
"lg:tw-overflow-y-visible": !e.scrollable && !
|
|
171
|
-
"lg:tw-rounded-b": !z.value && !
|
|
172
|
+
"lg:tw-overflow-y-visible": !e.scrollable && !s.value,
|
|
173
|
+
"lg:tw-rounded-b": !z.value && !s.value,
|
|
172
174
|
"tw-bg-white": !e.contrast,
|
|
173
175
|
"tw-bg-ice-200": e.contrast
|
|
174
176
|
}
|
|
@@ -177,23 +179,23 @@ const J = ["aria-labelledby"], Q = { class: "tw-flex tw-place-items-center" }, X
|
|
|
177
179
|
}, [
|
|
178
180
|
m(t.$slots, "default", {}, void 0, !0)
|
|
179
181
|
], 2),
|
|
180
|
-
z.value ? (
|
|
182
|
+
z.value ? (n(), f("footer", {
|
|
181
183
|
key: 3,
|
|
182
|
-
class:
|
|
184
|
+
class: r(["stash-modal__footer tw-border-t tw-border-ice-500 tw-bg-ice-100 tw-p-3 lg:tw-p-6", { "lg:tw-rounded-b": !s.value }])
|
|
183
185
|
}, [
|
|
184
186
|
m(t.$slots, "footer", {}, () => [
|
|
185
|
-
g("div",
|
|
187
|
+
g("div", Z, [
|
|
186
188
|
m(t.$slots, "actions", {}, void 0, !0)
|
|
187
189
|
])
|
|
188
190
|
], !0)
|
|
189
|
-
], 2)) :
|
|
190
|
-
], 10,
|
|
191
|
-
], 34)) :
|
|
191
|
+
], 2)) : i("", !0)
|
|
192
|
+
], 10, Q)
|
|
193
|
+
], 34)) : i("", !0);
|
|
192
194
|
}
|
|
193
|
-
}),
|
|
195
|
+
}), de = /* @__PURE__ */ W(ee, [["__scopeId", "data-v-fb435673"]]);
|
|
194
196
|
export {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
197
|
+
J as ModalPosition,
|
|
198
|
+
G as ModalSize,
|
|
199
|
+
de as default
|
|
198
200
|
};
|
|
199
201
|
//# sourceMappingURL=Modal.js.map
|
package/dist/Modal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sources":["../src/components/Modal/Modal.types.ts","../src/components/Modal/Modal.vue"],"sourcesContent":["export enum ModalSize {\n Narrow = 'narrow',\n Medium = 'medium',\n Wide = 'wide',\n}\n\nexport type ModalSizes = `${ModalSize}`;\n\nexport enum ModalPosition {\n Center = 'center',\n Left = 'left',\n Right = 'right',\n}\n\nexport type ModalPositions = `${ModalPosition}`;\n","<script lang=\"ts\">\n import { ModalPositions, ModalSizes } from './Modal.types';\n\n export * from './Modal.types';\n\n export interface ModalProps {\n /**\n * Hides the \"close\" button\n */\n hideClose?: boolean;\n\n /**\n * Opens the modal when truthy; hides the modal when falsy.\n * @deprecated Use `isOpen` instead\n */\n open?: boolean;\n\n /**\n * Opens the modal when truthy; hides the modal when falsy.\n */\n isOpen?: boolean;\n\n /**\n * Use v-model:is-open or :is-open instead of :model-value and v-model.\n * @deprecated\n */\n modelValue?: boolean;\n\n /**\n * Sets a preset max-width on the modal.\n * Options: default (648px), narrow (360px), wide (960px)\n */\n size?: ModalSizes;\n\n /**\n * Should the modal be scrollable within the content area. This prop is treated as `true` when the `position` prop is set to \"left\" or \"right\".\n */\n scrollable?: boolean;\n\n /**\n * Gives the modal body have a light gray background\n */\n contrast?: boolean;\n\n /**\n * Text to display in the modal header\n */\n title?: string;\n\n /**\n * Disables the default padding in the modal body.\n */\n disableBodyPadding?: boolean;\n\n /**\n * The position on the screen to display the modal.\n */\n position?: ModalPositions;\n\n /**\n * Hide the header. Typically used with the featuredContent slot to display a graphic and create a \"promo\" modal.\n */\n hideHeader?: boolean;\n\n /**\n * Add classes to the close button. This can be used with the hideHeader prop and featuredContent slot to\n * accommodate images with different color backgrounds.\n */\n closeButtonColorClass?: string;\n\n /**\n * Prevents the modal from being dismissed by clicking the backdrop or pressing the escape key.\n * Example: There are in-flight api requests and you do not want the modal to close until they are done.\n */\n preventDismiss?: boolean;\n }\n</script>\n\n<script setup lang=\"ts\">\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, onBeforeUnmount, ref, useSlots, watch } from 'vue';\n\n import { FOCUS_ELEMENTS_SELECTOR } from '../../constants';\n import { t } from '../../locale';\n import Backdrop from '../Backdrop/Backdrop.vue';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({ name: 'll-modal' });\n\n const props = withDefaults(defineProps<ModalProps>(), {\n hideClose: false,\n open: false,\n isOpen: false,\n modelValue: false,\n size: 'medium',\n scrollable: false,\n contrast: false,\n title: '',\n position: 'center',\n hideHeader: false,\n closeButtonColorClass: 'tw-text-white/50',\n preventDismiss: false,\n });\n\n const emit = defineEmits<{\n /**\n * @deprecated Use the `update:is-open` event instead\n */\n (e: 'update:open', isOpen?: boolean): void;\n (e: 'update:is-open', isOpen?: boolean): void;\n (e: 'dismiss'): void;\n }>();\n\n const slots = useSlots();\n\n const rootRef = ref<HTMLElement>();\n const lastExternalFocusedElement = ref<HTMLElement>();\n const focusElements = ref<HTMLElement[]>([]);\n const firstFocusElement = ref<HTMLElement>();\n const lastFocusElement = ref<HTMLElement>();\n const initialPageScrollingElementStyle = ref({ height: '', overflow: '' });\n const headerId = uniqueId('modal-header-');\n const hasFooterContent = computed(() => !!slots.actions || !!slots.footer);\n const isModalOpen = computed(() => props.open || props.isOpen);\n const isDrawer = computed(() => props.position === 'left' || props.position === 'right');\n\n function getPageScrollingElement() {\n return (document.scrollingElement || document.body) as HTMLElement;\n }\n\n watch(\n isModalOpen,\n () => {\n toggleHelpWidgetLauncher(isModalOpen.value ? 'hide' : 'show');\n\n if (isModalOpen.value) {\n Object.assign(initialPageScrollingElementStyle.value, {\n height: getPageScrollingElement().style.height,\n overflow: getPageScrollingElement().style.overflow,\n });\n }\n\n Object.assign(getPageScrollingElement().style, {\n overflow: isModalOpen.value ? 'hidden' : initialPageScrollingElementStyle.value.overflow, // Prevents page from scrolling when modal is open\n height: isModalOpen.value ? '100%' : initialPageScrollingElementStyle.value.height, // Ensures the backdrop covers the entire page when modal is open; see https://github.com/LeafLink/stash/pull/713#issuecomment-1184602535\n });\n },\n { immediate: true },\n );\n\n onBeforeUnmount(() => {\n toggleHelpWidgetLauncher('show');\n\n // In cases where the watchEffect for isModalOpen isn't triggered while closing/nagivating away from modal, this ensures scrolling returns to normal\n Object.assign(getPageScrollingElement().style, {\n overflow: initialPageScrollingElementStyle.value.overflow,\n height: initialPageScrollingElementStyle.value.height,\n });\n\n // Clear focus trap tab listener\n document.removeEventListener('keydown', handleTab);\n lastExternalFocusedElement.value?.focus();\n });\n\n function dismiss() {\n if (props.preventDismiss) {\n return;\n }\n emit('update:open', false);\n emit('update:is-open', false);\n emit('dismiss');\n }\n\n // This watcher ensures the Tab key cycles through focusable elements within the modal.\n watch(rootRef, () => {\n if (!rootRef.value) {\n return;\n }\n\n lastExternalFocusedElement.value = document.activeElement as HTMLElement;\n rootRef.value.focus();\n\n focusElements.value = Array.from(rootRef.value.querySelectorAll<HTMLElement>(FOCUS_ELEMENTS_SELECTOR));\n firstFocusElement.value = focusElements.value[0];\n lastFocusElement.value = focusElements.value[focusElements.value.length - 1];\n document.addEventListener('keydown', handleTab);\n });\n\n function handleTab(e) {\n if (e.key === 'Tab') {\n if (e.shiftKey && document.activeElement === firstFocusElement.value) {\n lastFocusElement.value?.focus();\n e.preventDefault();\n } else if (document.activeElement === lastFocusElement.value) {\n firstFocusElement.value?.focus();\n e.preventDefault();\n }\n }\n }\n\n /**\n * The customer support \"help widget launcher\" covers the action buttons in the Modal when the Modal uses a position value of \"right\" (for drawers).\n */\n function toggleHelpWidgetLauncher(nextState: 'show' | 'hide') {\n const launcherElement = document.getElementById('launcher');\n\n if (!launcherElement || !launcherElement.parentElement) {\n return;\n }\n\n launcherElement.parentElement.style.display = nextState === 'show' ? 'block' : 'none';\n }\n</script>\n\n<template>\n <div\n v-if=\"isModalOpen\"\n ref=\"rootRef\"\n class=\"stash-modal tw-fixed tw-inset-0\"\n :class=\"{\n 'tw-invisible tw-z-behind': !isModalOpen,\n 'tw-visible tw-z-modal': isModalOpen,\n 'lg:tw-flex lg:tw-flex-col lg:tw-items-center lg:tw-justify-center': props.position === 'center',\n 'tw-overflow-y-auto': !props.scrollable && !isDrawer,\n 'tw-overflow-y-hidden': isDrawer,\n }\"\n data-test=\"ll-modal\"\n tabindex=\"0\"\n @keydown.esc=\"dismiss\"\n >\n <Backdrop class=\"stash-modal__backdrop\" @click.stop=\"dismiss\" />\n <div\n aria-modal=\"true\"\n role=\"dialog\"\n :aria-labelledby=\"headerId\"\n class=\"stash-modal__dialog tw-relative tw-flex tw-h-screen tw-w-full tw-flex-col lg:tw-shadow-3xl\"\n :class=\"[\n `stash-modal__dialog--size-${props.size}`,\n `stash-modal__dialog--position-${props.position}`,\n {\n 'stash-modal__dialog--is-open': isModalOpen,\n 'stash-modal__dialog--is-drawer': isDrawer,\n 'stash-modal__dialog--is-contrast': props.contrast,\n 'stash-modal__dialog--is-scrollable': props.scrollable,\n 'lg:tw-w-[360px]': props.size === 'narrow',\n 'lg:tw-w-[648px]': props.size === 'medium',\n 'lg:tw-w-[960px]': props.size === 'wide',\n 'lg:tw-my-0 lg:tw-h-auto lg:tw-max-h-[90vh]': props.position === 'center',\n // tw-absolute causing this to break when items in bottom of container get focus\n 'lg:tw-fixed lg:tw-h-screen': isDrawer,\n 'lg:tw-left-0': props.position === 'left',\n 'lg:tw-right-0': props.position === 'right',\n },\n ]\"\n @click.stop\n >\n <header\n v-if=\"!props.hideHeader\"\n data-test=\"stash-modal__header\"\n class=\"stash-modal__header tw-grid tw-h-12 tw-place-items-center tw-bg-purple-500\"\n :class=\"{ 'lg:tw-rounded-t': !isDrawer }\"\n >\n <div class=\"tw-flex tw-place-items-center\">\n <!-- @slot Adds an action to the left side of the header bar. An example usage is a modal with multiple pages and a back button can be inserted here -->\n <slot name=\"headerAction\"></slot>\n </div>\n\n <h3 v-if=\"props.title\" :id=\"headerId\" class=\"tw-m-0 tw-flex-1 tw-leading-6 tw-text-white\">\n {{ props.title }}\n </h3>\n\n <Button\n v-if=\"!props.hideClose\"\n icon\n data-test=\"ll-modal-close\"\n :title=\"t('ll.closeModal')\"\n type=\"button\"\n @click=\"dismiss\"\n >\n <Icon class=\"tw-text-white\" name=\"close\" />\n </Button>\n </header>\n\n <Button\n v-if=\"!props.hideClose && props.hideHeader\"\n class=\"tw-absolute tw-right-0 tw-top-0 tw-z-10\"\n icon\n data-test=\"ll-modal-close\"\n type=\"button\"\n :title=\"t('ll.closeModal')\"\n @click=\"dismiss\"\n >\n <Icon class=\"tw-drop-shadow-md\" name=\"close\" :class=\"[props.closeButtonColorClass]\" />\n </Button>\n\n <div\n v-if=\"!!slots['featured-content']\"\n class=\"stash-modal__featured-content tw-relative\"\n :class=\"{\n 'tw-rounded-t': props.hideHeader,\n }\"\n >\n <slot name=\"featured-content\"></slot>\n </div>\n\n <div\n class=\"stash-modal__body tw-flex-1 tw-overflow-y-auto\"\n :class=\"[\n {\n 'tw-p-3 lg:tw-p-6': !props.disableBodyPadding,\n 'lg:tw-overflow-y-visible': !props.scrollable && !isDrawer,\n 'lg:tw-rounded-b': !hasFooterContent && !isDrawer,\n 'tw-bg-white': !props.contrast,\n 'tw-bg-ice-200': props.contrast,\n },\n ]\"\n data-test=\"stash-modal__body\"\n >\n <slot></slot>\n </div>\n\n <footer\n v-if=\"hasFooterContent\"\n class=\"stash-modal__footer tw-border-t tw-border-ice-500 tw-bg-ice-100 tw-p-3 lg:tw-p-6\"\n :class=\"{ 'lg:tw-rounded-b': !isDrawer }\"\n >\n <!-- @slot Overrides the whole footer section. Used for rendering custom footers with more than 2 actions. If defined, \"actions\" slot will get ignored. -->\n <slot name=\"footer\">\n <div class=\"stash-modal__footer__actions tw-flex tw-flex-col tw-justify-end lg:tw-flex-row\">\n <!-- @slot Modal footer actions, supports rendering up to 2 `<Button>` children -->\n <slot name=\"actions\"></slot>\n </div>\n </slot>\n </footer>\n </div>\n </div>\n</template>\n\n<style scoped>\n .stash-modal__header {\n grid-template-columns: 48px 1fr 48px;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(1) {\n order: 2;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(2) {\n margin-bottom: theme('spacing.3');\n order: 1;\n }\n\n @media screen('lg') {\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(1) {\n order: 1;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(2) {\n margin-bottom: 0;\n order: 2;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button + .stash-button) {\n margin-left: var(--grid-gutter);\n }\n }\n\n .stash-modal__featured-content > :deep(*) {\n border-radius: inherit;\n }\n</style>\n"],"names":["ModalSize","ModalPosition","props","__props","emit","__emit","slots","useSlots","rootRef","ref","lastExternalFocusedElement","focusElements","firstFocusElement","lastFocusElement","initialPageScrollingElementStyle","headerId","uniqueId","hasFooterContent","computed","isModalOpen","isDrawer","getPageScrollingElement","watch","toggleHelpWidgetLauncher","onBeforeUnmount","handleTab","dismiss","FOCUS_ELEMENTS_SELECTOR","e","nextState","launcherElement","_createElementBlock","_createVNode","Backdrop","_createElementVNode","_unref","_normalizeClass","_hoisted_2","_renderSlot","_ctx","_toDisplayString","_hoisted_3","_createBlock","Button","t","Icon","_hoisted_4"],"mappings":";;;;;;;;AAAO,IAAKA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,OAAO,QAHGA,IAAAA,KAAA,CAAA,CAAA,GAQAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,OAAO,QACPA,EAAA,QAAQ,SAHEA,IAAAA,KAAA,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A,WAAA,CAAA,GAAA,QAAA,EAAA;AAAA,YAAA;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Modal.js","sources":["../src/components/Modal/Modal.types.ts","../src/components/Modal/Modal.vue"],"sourcesContent":["export enum ModalSize {\n Narrow = 'narrow',\n Medium = 'medium',\n Wide = 'wide',\n}\n\nexport type ModalSizes = `${ModalSize}`;\n\nexport enum ModalPosition {\n Center = 'center',\n Left = 'left',\n Right = 'right',\n}\n\nexport type ModalPositions = `${ModalPosition}`;\n","<script lang=\"ts\">\n import { ModalPositions, ModalSizes } from './Modal.types';\n\n export * from './Modal.types';\n\n export interface ModalProps {\n /**\n * Hides the \"close\" button\n */\n hideClose?: boolean;\n\n /**\n * Opens the modal when truthy; hides the modal when falsy.\n * @deprecated Use `isOpen` instead\n */\n open?: boolean;\n\n /**\n * Opens the modal when truthy; hides the modal when falsy.\n */\n isOpen?: boolean;\n\n /**\n * Use v-model:is-open or :is-open instead of :model-value and v-model.\n * @deprecated\n */\n modelValue?: boolean;\n\n /**\n * Sets a preset max-width on the modal.\n * Options: default (648px), narrow (360px), wide (960px)\n */\n size?: ModalSizes;\n\n /**\n * Should the modal be scrollable within the content area. This prop is treated as `true` when the `position` prop is set to \"left\" or \"right\".\n */\n scrollable?: boolean;\n\n /**\n * Gives the modal body have a light gray background\n */\n contrast?: boolean;\n\n /**\n * Text to display in the modal header\n */\n title?: string;\n\n /**\n * Disables the default padding in the modal body.\n */\n disableBodyPadding?: boolean;\n\n /**\n * The position on the screen to display the modal.\n */\n position?: ModalPositions;\n\n /**\n * Hide the header. Typically used with the featuredContent slot to display a graphic and create a \"promo\" modal.\n */\n hideHeader?: boolean;\n\n /**\n * Add classes to the close button. This can be used with the hideHeader prop and featuredContent slot to\n * accommodate images with different color backgrounds.\n */\n closeButtonColorClass?: string;\n\n /**\n * Prevents the modal from being dismissed by clicking the backdrop or pressing the escape key.\n * Example: There are in-flight api requests and you do not want the modal to close until they are done.\n */\n preventDismiss?: boolean;\n }\n</script>\n\n<script setup lang=\"ts\">\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, onBeforeUnmount, ref, useSlots, watch } from 'vue';\n\n import { FOCUS_ELEMENTS_SELECTOR } from '../../constants';\n import { t } from '../../locale';\n import Backdrop from '../Backdrop/Backdrop.vue';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({ name: 'll-modal' });\n\n const props = withDefaults(defineProps<ModalProps>(), {\n hideClose: false,\n open: false,\n isOpen: false,\n modelValue: false,\n size: 'medium',\n scrollable: false,\n contrast: false,\n title: '',\n position: 'center',\n hideHeader: false,\n closeButtonColorClass: 'tw-text-white/50',\n preventDismiss: false,\n });\n\n const emit = defineEmits<{\n /**\n * @deprecated Use the `update:is-open` event instead\n */\n (e: 'update:open', isOpen?: boolean): void;\n (e: 'update:is-open', isOpen?: boolean): void;\n (e: 'dismiss'): void;\n }>();\n\n const slots = useSlots();\n\n const rootRef = ref<HTMLElement>();\n const lastExternalFocusedElement = ref<HTMLElement>();\n const focusElements = ref<HTMLElement[]>([]);\n const firstFocusElement = ref<HTMLElement>();\n const lastFocusElement = ref<HTMLElement>();\n const initialPageScrollingElementStyle = ref({ height: '', overflow: '' });\n const headerId = uniqueId('modal-header-');\n const hasFooterContent = computed(() => !!slots.actions || !!slots.footer);\n const isModalOpen = computed(() => props.open || props.isOpen);\n const isDrawer = computed(() => props.position === 'left' || props.position === 'right');\n\n function getPageScrollingElement() {\n return (document.scrollingElement || document.body) as HTMLElement;\n }\n\n watch(\n isModalOpen,\n () => {\n toggleHelpWidgetLauncher(isModalOpen.value ? 'hide' : 'show');\n\n if (isModalOpen.value) {\n Object.assign(initialPageScrollingElementStyle.value, {\n height: getPageScrollingElement().style.height,\n overflow: getPageScrollingElement().style.overflow,\n });\n }\n\n Object.assign(getPageScrollingElement().style, {\n overflow: isModalOpen.value ? 'hidden' : initialPageScrollingElementStyle.value.overflow, // Prevents page from scrolling when modal is open\n height: isModalOpen.value ? '100%' : initialPageScrollingElementStyle.value.height, // Ensures the backdrop covers the entire page when modal is open; see https://github.com/LeafLink/stash/pull/713#issuecomment-1184602535\n });\n },\n { immediate: true },\n );\n\n onBeforeUnmount(() => {\n toggleHelpWidgetLauncher('show');\n\n // In cases where the watchEffect for isModalOpen isn't triggered while closing/nagivating away from modal, this ensures scrolling returns to normal\n Object.assign(getPageScrollingElement().style, {\n overflow: initialPageScrollingElementStyle.value.overflow,\n height: initialPageScrollingElementStyle.value.height,\n });\n\n // Clear focus trap tab listener\n document.removeEventListener('keydown', handleTab);\n lastExternalFocusedElement.value?.focus();\n });\n\n function dismiss() {\n if (props.preventDismiss) {\n return;\n }\n emit('update:open', false);\n emit('update:is-open', false);\n emit('dismiss');\n }\n\n // This watcher ensures the Tab key cycles through focusable elements within the modal.\n watch(rootRef, () => {\n if (!rootRef.value) {\n return;\n }\n\n lastExternalFocusedElement.value = document.activeElement as HTMLElement;\n rootRef.value.focus();\n\n focusElements.value = Array.from(rootRef.value.querySelectorAll<HTMLElement>(FOCUS_ELEMENTS_SELECTOR));\n firstFocusElement.value = focusElements.value[0];\n lastFocusElement.value = focusElements.value[focusElements.value.length - 1];\n document.addEventListener('keydown', handleTab);\n });\n\n function handleTab(e) {\n if (e.key === 'Tab') {\n if (e.shiftKey && document.activeElement === firstFocusElement.value) {\n lastFocusElement.value?.focus();\n e.preventDefault();\n } else if (document.activeElement === lastFocusElement.value) {\n firstFocusElement.value?.focus();\n e.preventDefault();\n }\n }\n }\n\n /**\n * The customer support \"help widget launcher\" covers the action buttons in the Modal when the Modal uses a position value of \"right\" (for drawers).\n */\n function toggleHelpWidgetLauncher(nextState: 'show' | 'hide') {\n const launcherElement = document.getElementById('launcher');\n\n if (!launcherElement || !launcherElement.parentElement) {\n return;\n }\n\n launcherElement.parentElement.style.display = nextState === 'show' ? 'block' : 'none';\n }\n</script>\n\n<template>\n <div\n v-if=\"isModalOpen\"\n ref=\"rootRef\"\n class=\"stash-modal tw-fixed tw-inset-0\"\n :class=\"{\n 'tw-invisible tw-z-behind': !isModalOpen,\n 'tw-visible tw-z-modal': isModalOpen,\n 'lg:tw-flex lg:tw-flex-col lg:tw-items-center lg:tw-justify-center': props.position === 'center',\n 'tw-overflow-y-auto': !props.scrollable && !isDrawer,\n 'tw-overflow-y-hidden': isDrawer,\n }\"\n data-test=\"ll-modal\"\n tabindex=\"0\"\n @keydown.esc=\"dismiss\"\n >\n <Backdrop class=\"stash-modal__backdrop\" @click.stop=\"dismiss\" />\n <div\n aria-modal=\"true\"\n role=\"dialog\"\n :aria-labelledby=\"headerId\"\n class=\"stash-modal__dialog tw-relative tw-flex tw-h-screen tw-w-full tw-flex-col lg:tw-shadow-3xl\"\n :class=\"[\n `stash-modal__dialog--size-${props.size}`,\n `stash-modal__dialog--position-${props.position}`,\n {\n 'stash-modal__dialog--is-open': isModalOpen,\n 'stash-modal__dialog--is-drawer': isDrawer,\n 'stash-modal__dialog--is-contrast': props.contrast,\n 'stash-modal__dialog--is-scrollable': props.scrollable,\n 'lg:tw-w-[360px]': props.size === 'narrow',\n 'lg:tw-w-[648px]': props.size === 'medium',\n 'lg:tw-w-[960px]': props.size === 'wide',\n 'lg:tw-my-0 lg:tw-h-auto lg:tw-max-h-[90vh]': props.position === 'center',\n // tw-absolute causing this to break when items in bottom of container get focus\n 'lg:tw-fixed lg:tw-h-screen': isDrawer,\n 'lg:tw-left-0': props.position === 'left',\n 'lg:tw-right-0': props.position === 'right',\n },\n ]\"\n @click.stop\n >\n <header\n v-if=\"!props.hideHeader\"\n data-test=\"stash-modal__header\"\n class=\"stash-modal__header tw-grid tw-h-12 tw-place-items-center tw-bg-purple-500\"\n :class=\"{ 'lg:tw-rounded-t': !isDrawer }\"\n >\n <div class=\"tw-flex tw-place-items-center\">\n <!-- @slot Adds an action to the left side of the header bar. An example usage is a modal with multiple pages and a back button can be inserted here -->\n <slot name=\"headerAction\"></slot>\n </div>\n\n <h3 v-if=\"props.title\" :id=\"headerId\" class=\"tw-m-0 tw-flex-1 tw-leading-6 tw-text-white\">\n {{ props.title }}\n </h3>\n\n <Button\n v-if=\"!props.hideClose\"\n icon\n data-test=\"ll-modal-close\"\n :title=\"t('ll.closeModal')\"\n type=\"button\"\n @click=\"dismiss\"\n >\n <Icon class=\"tw-text-white\" name=\"close\" />\n </Button>\n </header>\n\n <Button\n v-if=\"!props.hideClose && props.hideHeader\"\n class=\"tw-absolute tw-right-0 tw-top-0 tw-z-10\"\n icon\n data-test=\"ll-modal-close\"\n type=\"button\"\n :title=\"t('ll.closeModal')\"\n @click=\"dismiss\"\n >\n <Icon class=\"tw-drop-shadow-md\" name=\"close\" :class=\"[props.closeButtonColorClass]\" />\n </Button>\n\n <div\n v-if=\"!!slots['featured-content']\"\n class=\"stash-modal__featured-content tw-relative\"\n :class=\"{\n 'tw-rounded-t': props.hideHeader,\n }\"\n >\n <slot name=\"featured-content\"></slot>\n </div>\n\n <div\n class=\"stash-modal__body tw-flex-1 tw-overflow-y-auto\"\n :class=\"[\n {\n 'tw-p-3 lg:tw-p-6': !props.disableBodyPadding,\n 'lg:tw-overflow-y-visible': !props.scrollable && !isDrawer,\n 'lg:tw-rounded-b': !hasFooterContent && !isDrawer,\n 'tw-bg-white': !props.contrast,\n 'tw-bg-ice-200': props.contrast,\n },\n ]\"\n data-test=\"stash-modal__body\"\n >\n <slot></slot>\n </div>\n\n <footer\n v-if=\"hasFooterContent\"\n class=\"stash-modal__footer tw-border-t tw-border-ice-500 tw-bg-ice-100 tw-p-3 lg:tw-p-6\"\n :class=\"{ 'lg:tw-rounded-b': !isDrawer }\"\n >\n <!-- @slot Overrides the whole footer section. Used for rendering custom footers with more than 2 actions. If defined, \"actions\" slot will get ignored. -->\n <slot name=\"footer\">\n <div class=\"stash-modal__footer__actions tw-flex tw-flex-col tw-justify-end lg:tw-flex-row\">\n <!-- @slot Modal footer actions, supports rendering up to 2 `<Button>` children -->\n <slot name=\"actions\"></slot>\n </div>\n </slot>\n </footer>\n </div>\n </div>\n</template>\n\n<style scoped>\n .stash-modal__header {\n grid-template-columns: 48px 1fr 48px;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(1) {\n order: 2;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(2) {\n margin-bottom: theme('spacing.3');\n order: 1;\n }\n\n @media screen('lg') {\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(1) {\n order: 1;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button):nth-of-type(2) {\n margin-bottom: 0;\n order: 2;\n }\n\n .stash-modal__footer__actions > :deep(.stash-button + .stash-button) {\n margin-left: var(--grid-gutter);\n }\n }\n\n .stash-modal__featured-content > :deep(*) {\n border-radius: inherit;\n }\n</style>\n"],"names":["ModalSize","ModalPosition","props","__props","emit","__emit","slots","useSlots","rootRef","ref","lastExternalFocusedElement","focusElements","firstFocusElement","lastFocusElement","initialPageScrollingElementStyle","headerId","uniqueId","hasFooterContent","computed","isModalOpen","isDrawer","getPageScrollingElement","watch","toggleHelpWidgetLauncher","onBeforeUnmount","handleTab","_a","dismiss","FOCUS_ELEMENTS_SELECTOR","e","_b","nextState","launcherElement"],"mappings":";;;;;;;;AAAY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,OAAO,QAHGA,IAAAA,KAAA,CAAA,CAAA,GAQAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,OAAO,QACPA,EAAA,QAAQ,SAHEA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;ACkFV,UAAMC,IAAQC,GAeRC,IAAOC,GASPC,IAAQC,EAAS,GAEjBC,IAAUC,EAAiB,GAC3BC,IAA6BD,EAAiB,GAC9CE,IAAgBF,EAAmB,EAAE,GACrCG,IAAoBH,EAAiB,GACrCI,IAAmBJ,EAAiB,GACpCK,IAAmCL,EAAI,EAAE,QAAQ,IAAI,UAAU,IAAI,GACnEM,IAAWC,EAAS,eAAe,GACnCC,IAAmBC,EAA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KH,EAAQ,MAAM,iBAA8BoB,CAAuB,CAAC,GACnFhB,EAAA,QAAQD,EAAc,MAAM,CAAC,GAC/CE,EAAiB,QAAQF,EAAc,MAAMA,EAAc,MAAM,SAAS,CAAC,GAClE,SAAA,iBAAiB,WAAWc,CAAS;AAAA,IAAA,CAC/C;AAED,aAASA,EAAUI,GAAG;;AAChB,MAAAA,EAAE,QAAQ,UACRA,EAAE,YAAY,SAAS,kBAAkBjB,EAAkB,UAC7Dc,IAAAb,EAAiB,UAAjB,QAAAa,EAAwB,SACxBG,EAAE,eAAe,KACR,SAAS,kBAAkBhB,EAAiB,WACrDiB,IAAAlB,EAAkB,UAAlB,QAAAkB,EAAyB,SACzBD,EAAE,eAAe;AAAA,IAErB;AAMF,aAASN,EAAyBQ,GAA4B;AACtD,YAAAC,IAAkB,SAAS,eAAe,UAAU;AAE1D,MAAI,CAACA,KAAmB,CAACA,EAAgB,kBAIzCA,EAAgB,cAAc,MAAM,UAAUD,MAAc,SAAS,UAAU;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/Modal.vue.d.ts
CHANGED
|
@@ -1,40 +1,87 @@
|
|
|
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<ModalProps
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
35
|
+
declare const _default: __VLS_WithTemplateSlots<DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModalProps>, {
|
|
36
|
+
hideClose: boolean;
|
|
37
|
+
open: boolean;
|
|
38
|
+
isOpen: boolean;
|
|
39
|
+
modelValue: boolean;
|
|
40
|
+
size: string;
|
|
41
|
+
scrollable: boolean;
|
|
42
|
+
contrast: boolean;
|
|
43
|
+
title: string;
|
|
44
|
+
position: string;
|
|
45
|
+
hideHeader: boolean;
|
|
46
|
+
closeButtonColorClass: string;
|
|
47
|
+
preventDismiss: boolean;
|
|
48
|
+
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
49
|
+
"update:open": (isOpen?: boolean | undefined) => void;
|
|
50
|
+
"update:is-open": (isOpen?: boolean | undefined) => void;
|
|
51
|
+
dismiss: () => void;
|
|
52
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModalProps>, {
|
|
53
|
+
hideClose: boolean;
|
|
54
|
+
open: boolean;
|
|
55
|
+
isOpen: boolean;
|
|
56
|
+
modelValue: boolean;
|
|
57
|
+
size: string;
|
|
58
|
+
scrollable: boolean;
|
|
59
|
+
contrast: boolean;
|
|
60
|
+
title: string;
|
|
61
|
+
position: string;
|
|
62
|
+
hideHeader: boolean;
|
|
63
|
+
closeButtonColorClass: string;
|
|
64
|
+
preventDismiss: boolean;
|
|
65
|
+
}>>> & Readonly<{
|
|
18
66
|
onDismiss?: (() => any) | undefined;
|
|
19
67
|
"onUpdate:is-open"?: ((isOpen?: boolean | undefined) => any) | undefined;
|
|
68
|
+
"onUpdate:open"?: ((isOpen?: boolean | undefined) => any) | undefined;
|
|
20
69
|
}>, {
|
|
21
|
-
contrast: boolean;
|
|
22
|
-
position: "center" | "right" | "left";
|
|
23
|
-
size: "medium" | "narrow" | "wide";
|
|
24
70
|
title: string;
|
|
71
|
+
size: "medium" | "narrow" | "wide";
|
|
25
72
|
open: boolean;
|
|
26
73
|
modelValue: boolean;
|
|
74
|
+
position: "center" | "left" | "right";
|
|
27
75
|
isOpen: boolean;
|
|
28
76
|
hideClose: boolean;
|
|
29
77
|
scrollable: boolean;
|
|
78
|
+
contrast: boolean;
|
|
30
79
|
hideHeader: boolean;
|
|
31
80
|
closeButtonColorClass: string;
|
|
32
81
|
preventDismiss: boolean;
|
|
33
|
-
}, {}, {}, {}, string, ComponentProvideOptions,
|
|
34
|
-
rootRef: HTMLDivElement;
|
|
35
|
-
}, any>, {
|
|
82
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
|
|
36
83
|
headerAction?(_: {}): any;
|
|
37
|
-
|
|
84
|
+
"featured-content"?(_: {}): any;
|
|
38
85
|
default?(_: {}): any;
|
|
39
86
|
footer?(_: {}): any;
|
|
40
87
|
actions?(_: {}): any;
|
package/dist/Modals.js
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { _ as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as d, computed as u, createBlock as s, openBlock as r, Transition as m, withCtx as a, createCommentVNode as p, resolveDynamicComponent as _, mergeProps as f, toHandlers as v, createSlots as x, renderList as M, createElementVNode as L } from "vue";
|
|
2
|
+
import C from "./useModals.js";
|
|
3
|
+
import { _ as h } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
const k = ["innerHTML"], H = /* @__PURE__ */ d({
|
|
5
5
|
__name: "Modals",
|
|
6
|
-
setup(
|
|
7
|
-
const t =
|
|
8
|
-
function
|
|
9
|
-
|
|
6
|
+
setup(T) {
|
|
7
|
+
const t = C(), e = u(() => t.current);
|
|
8
|
+
function c(n) {
|
|
9
|
+
var o;
|
|
10
|
+
return (o = n.options) != null && o.disableDefaultListeners ? {} : {
|
|
10
11
|
dismiss: () => t.close({ index: 0 }),
|
|
11
12
|
close: () => t.close({ index: 0 }),
|
|
12
13
|
cancel: () => t.close({ index: 0 })
|
|
13
14
|
};
|
|
14
15
|
}
|
|
15
|
-
return (
|
|
16
|
+
return (n, o) => (r(), s(m, {
|
|
16
17
|
name: "modals",
|
|
17
18
|
mode: "out-in"
|
|
18
19
|
}, {
|
|
19
|
-
default:
|
|
20
|
-
e.value ? (
|
|
21
|
-
|
|
22
|
-
name:
|
|
23
|
-
fn:
|
|
24
|
-
|
|
20
|
+
default: a(() => [
|
|
21
|
+
e.value ? (r(), s(_(e.value.component), f({ key: 0 }, e.value.attributes, { "is-open": !0 }, v(c(e.value))), x({ _: 2 }, [
|
|
22
|
+
M(e.value.slots, (l, i) => ({
|
|
23
|
+
name: i,
|
|
24
|
+
fn: a(() => [
|
|
25
|
+
L("div", { innerHTML: l }, null, 8, k)
|
|
25
26
|
])
|
|
26
27
|
}))
|
|
27
|
-
]), 1040)) :
|
|
28
|
+
]), 1040)) : p("", !0)
|
|
28
29
|
]),
|
|
29
30
|
_: 1
|
|
30
31
|
}));
|
|
31
32
|
}
|
|
32
|
-
}), B = /* @__PURE__ */
|
|
33
|
+
}), B = /* @__PURE__ */ h(H, [["__scopeId", "data-v-cf8ad226"]]);
|
|
33
34
|
export {
|
|
34
35
|
B as default
|
|
35
36
|
};
|
package/dist/Modals.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modals.js","sources":["../src/components/Modals/Modals.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { computed, DeepReadonly } from 'vue';\n\n import useModals, { type Modal } from '../../composables/useModals/useModals';\n\n const modals = useModals();\n\n const currentModal = computed(() => modals.current);\n\n // Stupid TS version issues. Todo: remove ` | any` when TS/vite/vue deps are updated.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function getListeners(modal: DeepReadonly<Modal> | any) {\n if (modal.options?.disableDefaultListeners) {\n return {};\n }\n\n return {\n dismiss: () => modals.close({ index: 0 }),\n close: () => modals.close({ index: 0 }),\n cancel: () => modals.close({ index: 0 }),\n };\n }\n</script>\n\n<template>\n <Transition name=\"modals\" mode=\"out-in\">\n <component\n :is=\"currentModal.component\"\n v-if=\"currentModal\"\n v-bind=\"currentModal.attributes\"\n :is-open=\"true\"\n v-on=\"getListeners(currentModal)\"\n >\n <template v-for=\"(value, name) in currentModal.slots\" :key=\"name\" #[name]>\n <!-- eslint-disable-next-line vue/no-v-html -->\n <div v-html=\"value\" />\n </template>\n </component>\n </Transition>\n</template>\n\n<style scoped>\n .modals-enter-active,\n .modals-leave-active {\n --swing-timing-function: cubic-bezier(0.25, 0.8, 0.5, 1); /* \"swing\" from the $transition sass map */\n transition: opacity 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from,\n .modals-leave-to {\n opacity: 0;\n }\n\n .modals-enter-active :deep(.stash-modal__dialog--position-center),\n .modals-leave-active :deep(.stash-modal__dialog--position-center) {\n transition: transform 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-center),\n .modals-leave-to :deep(.stash-modal__dialog--position-center) {\n transform: translateY(20px);\n }\n\n .modals-enter-active :deep(.stash-modal__dialog--is-drawer),\n .modals-leave-active :deep(.stash-modal__dialog--is-drawer) {\n transition: transform 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-left),\n .modals-leave-to :deep(.stash-modal__dialog--position-left) {\n transform: translateX(-50px);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-right),\n .modals-leave-to :deep(.stash-modal__dialog--position-right) {\n transform: translateX(50px);\n }\n</style>\n"],"names":["modals","useModals","currentModal","computed","getListeners","modal","
|
|
1
|
+
{"version":3,"file":"Modals.js","sources":["../src/components/Modals/Modals.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { computed, DeepReadonly } from 'vue';\n\n import useModals, { type Modal } from '../../composables/useModals/useModals';\n\n const modals = useModals();\n\n const currentModal = computed(() => modals.current);\n\n // Stupid TS version issues. Todo: remove ` | any` when TS/vite/vue deps are updated.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function getListeners(modal: DeepReadonly<Modal> | any) {\n if (modal.options?.disableDefaultListeners) {\n return {};\n }\n\n return {\n dismiss: () => modals.close({ index: 0 }),\n close: () => modals.close({ index: 0 }),\n cancel: () => modals.close({ index: 0 }),\n };\n }\n</script>\n\n<template>\n <Transition name=\"modals\" mode=\"out-in\">\n <component\n :is=\"currentModal.component\"\n v-if=\"currentModal\"\n v-bind=\"currentModal.attributes\"\n :is-open=\"true\"\n v-on=\"getListeners(currentModal)\"\n >\n <template v-for=\"(value, name) in currentModal.slots\" :key=\"name\" #[name]>\n <!-- eslint-disable-next-line vue/no-v-html -->\n <div v-html=\"value\" />\n </template>\n </component>\n </Transition>\n</template>\n\n<style scoped>\n .modals-enter-active,\n .modals-leave-active {\n --swing-timing-function: cubic-bezier(0.25, 0.8, 0.5, 1); /* \"swing\" from the $transition sass map */\n transition: opacity 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from,\n .modals-leave-to {\n opacity: 0;\n }\n\n .modals-enter-active :deep(.stash-modal__dialog--position-center),\n .modals-leave-active :deep(.stash-modal__dialog--position-center) {\n transition: transform 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-center),\n .modals-leave-to :deep(.stash-modal__dialog--position-center) {\n transform: translateY(20px);\n }\n\n .modals-enter-active :deep(.stash-modal__dialog--is-drawer),\n .modals-leave-active :deep(.stash-modal__dialog--is-drawer) {\n transition: transform 165ms var(--swing-timing-function);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-left),\n .modals-leave-to :deep(.stash-modal__dialog--position-left) {\n transform: translateX(-50px);\n }\n\n .modals-enter-from :deep(.stash-modal__dialog--position-right),\n .modals-leave-to :deep(.stash-modal__dialog--position-right) {\n transform: translateX(50px);\n }\n</style>\n"],"names":["modals","useModals","currentModal","computed","getListeners","modal","_a"],"mappings":";;;;;;AAKE,UAAMA,IAASC,EAAU,GAEnBC,IAAeC,EAAS,MAAMH,EAAO,OAAO;AAIlD,aAASI,EAAaC,GAAkC;;AAClD,cAAAC,IAAAD,EAAM,YAAN,QAAAC,EAAe,0BACV,CAAC,IAGH;AAAA,QACL,SAAS,MAAMN,EAAO,MAAM,EAAE,OAAO,GAAG;AAAA,QACxC,OAAO,MAAMA,EAAO,MAAM,EAAE,OAAO,GAAG;AAAA,QACtC,QAAQ,MAAMA,EAAO,MAAM,EAAE,OAAO,EAAG,CAAA;AAAA,MACzC;AAAA,IAAA;;;;;;;;;;;;;;;;;;;"}
|
package/dist/ModalsPlugin.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { createVNode as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
install(
|
|
5
|
-
const
|
|
6
|
-
let
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
1
|
+
import { createVNode as s, h as n, render as c } from "vue";
|
|
2
|
+
import o from "./Modals.js";
|
|
3
|
+
const m = "stash-modals-mount-node", r = {
|
|
4
|
+
install(l, e) {
|
|
5
|
+
const t = (e == null ? void 0 : e.mountNodeId) || m;
|
|
6
|
+
let d = document.getElementById(t);
|
|
7
|
+
d || (d = document.createElement("div"), d.id = t, d.dataset.test = m, document.body.appendChild(d)), e != null && e.mountNodeClass && !d.classList.contains(e.mountNodeClass) && d.classList.add(e.mountNodeClass);
|
|
8
|
+
const a = s(n(o));
|
|
9
|
+
a.appContext = l._context, c(a, d);
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
m as DEFAULT_MODALS_PLUGIN_NODE_ID,
|
|
14
|
+
r as default
|
|
15
15
|
};
|
|
16
16
|
//# sourceMappingURL=ModalsPlugin.js.map
|
package/dist/ModalsPlugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalsPlugin.js","sources":["../src/plugins/ModalsPlugin.ts"],"sourcesContent":["import { App, createVNode, h, Plugin, render } from 'vue';\n\nimport Modals from '../components/Modals/Modals.vue';\n\nexport interface ModalsPluginOptions {\n mountNodeClass?: string;\n mountNodeId?: string;\n}\n\nexport const DEFAULT_MODALS_PLUGIN_NODE_ID = 'stash-modals-mount-node';\n\nexport default <Plugin>{\n install(app: App, options?: ModalsPluginOptions) {\n const mountNodeId = options?.mountNodeId || DEFAULT_MODALS_PLUGIN_NODE_ID;\n let mountNode = document.getElementById(mountNodeId);\n\n if (!mountNode) {\n mountNode = document.createElement('div');\n mountNode.id = mountNodeId;\n mountNode.dataset.test = DEFAULT_MODALS_PLUGIN_NODE_ID;\n document.body.appendChild(mountNode);\n }\n\n if (options?.mountNodeClass && !mountNode.classList.contains(options.mountNodeClass)) {\n mountNode.classList.add(options.mountNodeClass);\n }\n\n const vNode = createVNode(h(Modals));\n vNode.appContext = app._context;\n\n render(vNode, mountNode);\n },\n};\n"],"names":["DEFAULT_MODALS_PLUGIN_NODE_ID","ModalsPlugin","app","options","mountNodeId","mountNode","vNode","createVNode","h","Modals","render"],"mappings":";;AASO,MAAMA,IAAgC,
|
|
1
|
+
{"version":3,"file":"ModalsPlugin.js","sources":["../src/plugins/ModalsPlugin.ts"],"sourcesContent":["import { App, createVNode, h, Plugin, render } from 'vue';\n\nimport Modals from '../components/Modals/Modals.vue';\n\nexport interface ModalsPluginOptions {\n mountNodeClass?: string;\n mountNodeId?: string;\n}\n\nexport const DEFAULT_MODALS_PLUGIN_NODE_ID = 'stash-modals-mount-node';\n\nexport default <Plugin>{\n install(app: App, options?: ModalsPluginOptions) {\n const mountNodeId = options?.mountNodeId || DEFAULT_MODALS_PLUGIN_NODE_ID;\n let mountNode = document.getElementById(mountNodeId);\n\n if (!mountNode) {\n mountNode = document.createElement('div');\n mountNode.id = mountNodeId;\n mountNode.dataset.test = DEFAULT_MODALS_PLUGIN_NODE_ID;\n document.body.appendChild(mountNode);\n }\n\n if (options?.mountNodeClass && !mountNode.classList.contains(options.mountNodeClass)) {\n mountNode.classList.add(options.mountNodeClass);\n }\n\n const vNode = createVNode(h(Modals));\n vNode.appContext = app._context;\n\n render(vNode, mountNode);\n },\n};\n"],"names":["DEFAULT_MODALS_PLUGIN_NODE_ID","ModalsPlugin","app","options","mountNodeId","mountNode","vNode","createVNode","h","Modals","render"],"mappings":";;AASO,MAAMA,IAAgC,2BAEtBC,IAAA;AAAA,EACrB,QAAQC,GAAUC,GAA+B;AACzC,UAAAC,KAAcD,KAAA,gBAAAA,EAAS,gBAAeH;AACxC,QAAAK,IAAY,SAAS,eAAeD,CAAW;AAEnD,IAAKC,MACSA,IAAA,SAAS,cAAc,KAAK,GACxCA,EAAU,KAAKD,GACfC,EAAU,QAAQ,OAAOL,GAChB,SAAA,KAAK,YAAYK,CAAS,IAGjCF,KAAA,QAAAA,EAAS,kBAAkB,CAACE,EAAU,UAAU,SAASF,EAAQ,cAAc,KACvEE,EAAA,UAAU,IAAIF,EAAQ,cAAc;AAGhD,UAAMG,IAAQC,EAAYC,EAAEC,CAAM,CAAC;AACnC,IAAAH,EAAM,aAAaJ,EAAI,UAEvBQ,EAAOJ,GAAOD,CAAS;AAAA,EAAA;AAE3B;"}
|
package/dist/Module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Module.js","sources":["../src/components/Module/Module.vue"],"sourcesContent":["<script lang=\"ts\">\n import Box, { type BoxProps } from '../Box/Box.vue';\n import { ModuleVariant, type ModuleVariants } from './Module.types';\n\n export * from './Module.keys';\n export * from './Module.types';\n\n export interface ModuleProps extends BoxProps {\n /**\n * Variant applied.\n *\n * Options: `box`, `card`, `list`.\n */\n variant?: ModuleVariants;\n }\n</script>\n\n<script setup lang=\"ts\">\n import logger from '@leaflink/snitch';\n import { computed, onMounted, provide } from 'vue';\n\n import { MODULE_INJECTION } from './Module.keys';\n\n defineOptions({\n name: 'll-module',\n });\n\n const props = withDefaults(defineProps<ModuleProps>(), {\n variant: 'box',\n });\n\n onMounted(() => {\n if (props.variant === 'card') {\n logger.warn('Card Modules are no longer a thing. You\\'re probably looking for `<RadioGroup variant=\"card\">`.');\n }\n\n if (props.variant === 'list') {\n logger.warn('Only used with deprecated ListView component. Use `table` variant with `Table` component instead.');\n }\n });\n\n provide(MODULE_INJECTION.key, { variant: computed(() => props.variant) });\n</script>\n\n<template>\n <Box\n class=\"stash-module tw-flex tw-flex-col\"\n data-test=\"stash-module\"\n :class=\"{\n 'tw-bg-transparent tw-shadow': props.variant === ModuleVariant.Table,\n 'tw-border tw-border-ice-500': props.variant === ModuleVariant.Card,\n 'tw-mb-6 tw-bg-transparent tw-shadow-none lg:tw-shadow': props.variant === ModuleVariant.List,\n }\"\n :disable-gutters=\"props.disableGutters\"\n :disable-padding=\"props.disablePadding || ['card', 'list', 'table'].includes(props.variant)\"\n :disable-elevation=\"\n props.disableElevation ||\n props.variant === ModuleVariant.Table ||\n props.variant === ModuleVariant.Card ||\n props.variant === ModuleVariant.List\n \"\n >\n <slot></slot>\n </Box>\n</template>\n"],"names":["props","__props","onMounted","logger","provide","MODULE_INJECTION","computed"
|
|
1
|
+
{"version":3,"file":"Module.js","sources":["../src/components/Module/Module.vue"],"sourcesContent":["<script lang=\"ts\">\n import Box, { type BoxProps } from '../Box/Box.vue';\n import { ModuleVariant, type ModuleVariants } from './Module.types';\n\n export * from './Module.keys';\n export * from './Module.types';\n\n export interface ModuleProps extends BoxProps {\n /**\n * Variant applied.\n *\n * Options: `box`, `card`, `list`.\n */\n variant?: ModuleVariants;\n }\n</script>\n\n<script setup lang=\"ts\">\n import logger from '@leaflink/snitch';\n import { computed, onMounted, provide } from 'vue';\n\n import { MODULE_INJECTION } from './Module.keys';\n\n defineOptions({\n name: 'll-module',\n });\n\n const props = withDefaults(defineProps<ModuleProps>(), {\n variant: 'box',\n });\n\n onMounted(() => {\n if (props.variant === 'card') {\n logger.warn('Card Modules are no longer a thing. You\\'re probably looking for `<RadioGroup variant=\"card\">`.');\n }\n\n if (props.variant === 'list') {\n logger.warn('Only used with deprecated ListView component. Use `table` variant with `Table` component instead.');\n }\n });\n\n provide(MODULE_INJECTION.key, { variant: computed(() => props.variant) });\n</script>\n\n<template>\n <Box\n class=\"stash-module tw-flex tw-flex-col\"\n data-test=\"stash-module\"\n :class=\"{\n 'tw-bg-transparent tw-shadow': props.variant === ModuleVariant.Table,\n 'tw-border tw-border-ice-500': props.variant === ModuleVariant.Card,\n 'tw-mb-6 tw-bg-transparent tw-shadow-none lg:tw-shadow': props.variant === ModuleVariant.List,\n }\"\n :disable-gutters=\"props.disableGutters\"\n :disable-padding=\"props.disablePadding || ['card', 'list', 'table'].includes(props.variant)\"\n :disable-elevation=\"\n props.disableElevation ||\n props.variant === ModuleVariant.Table ||\n props.variant === ModuleVariant.Card ||\n props.variant === ModuleVariant.List\n \"\n >\n <slot></slot>\n </Box>\n</template>\n"],"names":["props","__props","onMounted","logger","provide","MODULE_INJECTION","computed"],"mappings":";;;;;;;;;;;;;;;;AA2BE,UAAMA,IAAQC;AAId,WAAAC,EAAU,MAAM;AACV,MAAAF,EAAM,YAAY,UACpBG,EAAO,KAAK,iGAAiG,GAG3GH,EAAM,YAAY,UACpBG,EAAO,KAAK,mGAAmG;AAAA,IACjH,CACD,GAEOC,EAAAC,EAAiB,KAAK,EAAE,SAASC,EAAS,MAAMN,EAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Module.keys-CEsrW2f0.js","sources":["../src/components/Module/Module.keys.ts"],"sourcesContent":["import { InjectionWithDefaults } from '../../../types/utils';\nimport { ModuleInjection } from './Module.types';\n\nexport const MODULE_INJECTION: InjectionWithDefaults<ModuleInjection> = Object.freeze({\n key: Symbol('MODULE_INJECTION_KEY'),\n defaults: {\n variant: undefined,\n },\n});\n"],"names":["MODULE_INJECTION"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Module.keys-CEsrW2f0.js","sources":["../src/components/Module/Module.keys.ts"],"sourcesContent":["import { InjectionWithDefaults } from '../../../types/utils';\nimport { ModuleInjection } from './Module.types';\n\nexport const MODULE_INJECTION: InjectionWithDefaults<ModuleInjection> = Object.freeze({\n key: Symbol('MODULE_INJECTION_KEY'),\n defaults: {\n variant: undefined,\n },\n});\n"],"names":["MODULE_INJECTION"],"mappings":"AAGa,MAAAA,IAA2D,OAAO,OAAO;AAAA,EACpF,KAAK,OAAO,sBAAsB;AAAA,EAClC,UAAU;AAAA,IACR,SAAS;AAAA,EAAA;AAEb,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Module.types-B1FfGGac.js","sources":["../src/components/Module/Module.types.ts"],"sourcesContent":["import { ComputedRef } from 'vue';\n\nexport enum ModuleVariant {\n Box = 'box',\n Table = 'table',\n /**\n * @deprecated Card Modules are no longer a thing. You're probably looking for `<RadioGroup variant=\"card\">`.\n */\n Card = 'card',\n /**\n * @deprecated Only used with deprecated ListView component. Use `table` variant with `Table` component instead.\n */\n List = 'list',\n}\n\nexport type ModuleVariants = `${ModuleVariant}`;\n\nexport interface ModuleInjection {\n /**\n * Module variant applied.\n */\n variant?: ComputedRef<ModuleVariants>;\n}\n"],"names":["ModuleVariant"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Module.types-B1FfGGac.js","sources":["../src/components/Module/Module.types.ts"],"sourcesContent":["import { ComputedRef } from 'vue';\n\nexport enum ModuleVariant {\n Box = 'box',\n Table = 'table',\n /**\n * @deprecated Card Modules are no longer a thing. You're probably looking for `<RadioGroup variant=\"card\">`.\n */\n Card = 'card',\n /**\n * @deprecated Only used with deprecated ListView component. Use `table` variant with `Table` component instead.\n */\n List = 'list',\n}\n\nexport type ModuleVariants = `${ModuleVariant}`;\n\nexport interface ModuleInjection {\n /**\n * Module variant applied.\n */\n variant?: ComputedRef<ModuleVariants>;\n}\n"],"names":["ModuleVariant"],"mappings":"AAEY,IAAAA,sBAAAA,OACVA,EAAA,MAAM,OACNA,EAAA,QAAQ,SAIRA,EAAA,OAAO,QAIPA,EAAA,OAAO,QAVGA,IAAAA,KAAA,CAAA,CAAA;"}
|