@leaflink/stash 51.9.2 → 51.10.0
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/assets/icons/cloud-share.svg +1 -0
- package/assets/spritesheet.svg +1 -1
- package/dist/Accordion.js.map +1 -1
- package/dist/Accordion.vue.d.ts +7 -38
- package/dist/ActionsDropdown.js +2 -2
- package/dist/ActionsDropdown.js.map +1 -1
- package/dist/ActionsDropdown.vue.d.ts +0 -74
- package/dist/AddressSelect.js +56 -60
- package/dist/AddressSelect.js.map +1 -1
- package/dist/AddressSelect.vue.d.ts +8 -65
- package/dist/Alert.js.map +1 -1
- package/dist/Alert.vue.d.ts +4 -41
- package/dist/AppNavigationItem.js.map +1 -1
- package/dist/AppNavigationItem.vue.d.ts +5 -32
- package/dist/AppSidebar.js.map +1 -1
- package/dist/AppSidebar.vue.d.ts +8 -35
- package/dist/AppTopbar.js +1 -1
- package/dist/AppTopbar.js.map +1 -1
- package/dist/AppTopbar.vue.d.ts +4 -33
- package/dist/Avatar.js.map +1 -1
- package/dist/Avatar.vue.d.ts +5 -44
- 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 +6 -55
- package/dist/Box.vue.d.ts +3 -36
- 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 +5 -50
- package/dist/ButtonGroup.js +33 -37
- package/dist/ButtonGroup.js.map +1 -1
- package/dist/ButtonGroup.vue.d.ts +6 -39
- package/dist/Card.js.map +1 -1
- package/dist/Card.vue.d.ts +5 -32
- 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 +2 -15
- package/dist/CardMedia.js.map +1 -1
- package/dist/CardMedia.vue.d.ts +2 -15
- package/dist/Carousel.js +66 -72
- 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 +8 -53
- package/dist/ChevronToggle.vue.d.ts +7 -34
- 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 +10 -52
- package/dist/ConfirmationCodeInput.js +40 -44
- package/dist/ConfirmationCodeInput.js.map +1 -1
- package/dist/ConfirmationCodeInput.vue.d.ts +8 -43
- package/dist/ContextSwitcher.js.map +1 -1
- package/dist/ContextSwitcher.vue.d.ts +6 -41
- package/dist/Copy.js.map +1 -1
- package/dist/Copy.vue.d.ts +3 -34
- package/dist/CurrencyInput.js +20 -21
- package/dist/CurrencyInput.js.map +1 -1
- package/dist/CurrencyInput.vue.d.ts +125 -46
- package/dist/CustomRender.js.map +1 -1
- package/dist/DataView.js +94 -96
- package/dist/DataView.js.map +1 -1
- package/dist/DataView.keys-aSOnA4AD.js.map +1 -1
- package/dist/DataView.vue.d.ts +15 -57
- package/dist/DataViewFilters.js +127 -139
- package/dist/DataViewFilters.js.map +1 -1
- package/dist/DataViewFilters.keys-BLu07FiP.js.map +1 -1
- package/dist/DataViewFilters.vue.d.ts +9 -54
- package/dist/DataViewSortButton.js +2 -2
- package/dist/DataViewSortButton.js.map +1 -1
- package/dist/DataViewSortButton.vue.d.ts +3 -30
- package/dist/DataViewToolbar.js +70 -62
- package/dist/DataViewToolbar.js.map +1 -1
- package/dist/DataViewToolbar.vue.d.ts +5 -40
- package/dist/DatePicker.js +4524 -4636
- package/dist/DatePicker.js.map +1 -1
- package/dist/DatePicker.vue.d.ts +32 -81
- package/dist/DescriptionList.js.map +1 -1
- package/dist/DescriptionList.vue.d.ts +3 -32
- 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 +10 -53
- package/dist/Divider.js.map +1 -1
- package/dist/Dropdown.js +89 -95
- package/dist/Dropdown.js.map +1 -1
- package/dist/Dropdown.vue.d.ts +12 -48
- package/dist/EmptyState.js +1 -1
- package/dist/EmptyState.js.map +1 -1
- package/dist/EmptyState.vue.d.ts +5 -62
- package/dist/Expand.vue.d.ts +10 -40
- package/dist/Expand.vue_vue_type_script_setup_true_lang-CiONJfAp.js.map +1 -1
- package/dist/Field.vue.d.ts +4 -53
- package/dist/Field.vue_vue_type_script_setup_true_lang-DI6z3AE9.js.map +1 -1
- package/dist/FileUpload.js +72 -74
- package/dist/FileUpload.js.map +1 -1
- package/dist/FileUpload.vue.d.ts +10 -44
- package/dist/FilterChip.js.map +1 -1
- package/dist/FilterChip.vue.d.ts +6 -41
- package/dist/FilterDrawerItem.js +21 -21
- package/dist/FilterDrawerItem.js.map +1 -1
- package/dist/FilterDrawerItem.vue.d.ts +6 -23
- package/dist/FilterDropdown.js +63 -69
- package/dist/FilterDropdown.js.map +1 -1
- package/dist/FilterDropdown.vue.d.ts +122 -35
- package/dist/FilterSelect.js.map +1 -1
- package/dist/FilterSelect.vue.d.ts +4 -31
- package/dist/Filters.js +157 -164
- package/dist/Filters.js.map +1 -1
- package/dist/Filters.vue.d.ts +0 -2190
- package/dist/HttpError.js +7 -7
- package/dist/HttpError.js.map +1 -1
- package/dist/HttpError.vue.d.ts +4 -41
- package/dist/Icon.js +16 -15
- package/dist/Icon.js.map +1 -1
- package/dist/Icon.vue.d.ts +4 -37
- package/dist/IconLabel.js.map +1 -1
- package/dist/IconLabel.vue.d.ts +6 -41
- package/dist/Illustration.js +2 -2
- package/dist/Illustration.vue.d.ts +3 -42
- package/dist/{Illustration.vue_vue_type_script_setup_true_lang-BrqEF8xe.js → Illustration.vue_vue_type_script_setup_true_lang-BVzzNsRt.js} +11 -11
- package/dist/{Illustration.vue_vue_type_script_setup_true_lang-BrqEF8xe.js.map → Illustration.vue_vue_type_script_setup_true_lang-BVzzNsRt.js.map} +1 -1
- package/dist/Image.js +2 -2
- package/dist/Image.vue.d.ts +5 -40
- package/dist/{Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js → Image.vue_vue_type_script_setup_true_lang-Dg2Zk2r2.js} +37 -41
- package/dist/{Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js.map → Image.vue_vue_type_script_setup_true_lang-Dg2Zk2r2.js.map} +1 -1
- package/dist/InlineEdit.js.map +1 -1
- package/dist/InlineEdit.vue.d.ts +126 -47
- package/dist/Input.js.map +1 -1
- package/dist/Input.vue.d.ts +12 -45
- package/dist/InputOptions.js +66 -69
- package/dist/InputOptions.js.map +1 -1
- package/dist/InputOptions.vue.d.ts +10 -55
- package/dist/IntegrationIcon.js +7 -7
- package/dist/IntegrationIcon.js.map +1 -1
- package/dist/IntegrationIcon.vue.d.ts +3 -36
- package/dist/Label.vue.d.ts +3 -42
- 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 +3 -30
- package/dist/ListItem.js.map +1 -1
- package/dist/ListItem.vue.d.ts +0 -294
- package/dist/ListItemCell.js.map +1 -1
- package/dist/ListItemCell.vue.d.ts +0 -21
- package/dist/ListView.js +122 -132
- package/dist/ListView.js.map +1 -1
- package/dist/ListView.types.d.ts +0 -29
- package/dist/ListView.vue.d.ts +0 -5496
- 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 +6 -41
- package/dist/{Logo.vue_vue_type_script_setup_true_lang-Dz8c98sc.js → Logo.vue_vue_type_script_setup_true_lang-Y3iE9utm.js} +17 -17
- package/dist/Logo.vue_vue_type_script_setup_true_lang-Y3iE9utm.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-B4jpNe7x.js +12 -0
- package/dist/{MenusPlugin-Bk6UW6o9.js.map → MenusPlugin-B4jpNe7x.js.map} +1 -1
- package/dist/Metric.js.map +1 -1
- package/dist/Metric.vue.d.ts +3 -34
- package/dist/Modal.js +62 -64
- package/dist/Modal.js.map +1 -1
- package/dist/Modal.vue.d.ts +13 -60
- package/dist/Modals.js +17 -18
- 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 +2 -29
- 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 +5 -39
- package/dist/ObfuscateText.js.map +1 -1
- package/dist/ObfuscateText.vue.d.ts +3 -40
- package/dist/PageContent.js.map +1 -1
- package/dist/PageContent.vue.d.ts +3 -30
- package/dist/PageHeader.js.map +1 -1
- package/dist/PageHeader.vue.d.ts +6 -35
- package/dist/PageNavigation.js +50 -50
- package/dist/PageNavigation.js.map +1 -1
- package/dist/PageNavigation.vue.d.ts +7 -36
- package/dist/Paginate.js.map +1 -1
- package/dist/Paginate.vue.d.ts +5 -40
- package/dist/PlaidLink.js.map +1 -1
- package/dist/PlaidLink.vue.d.ts +12 -49
- package/dist/QuickAction.js.map +1 -1
- package/dist/QuickAction.vue.d.ts +3 -16
- package/dist/Radio.js.map +1 -1
- package/dist/Radio.vue.d.ts +0 -93
- package/dist/RadioGroup.js +94 -101
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioGroup.vue.d.ts +116 -42
- package/dist/RadioNew.js +96 -99
- package/dist/RadioNew.js.map +1 -1
- package/dist/RadioNew.vue.d.ts +7 -48
- package/dist/RangeInput.js.map +1 -1
- package/dist/RangeInput.vue.d.ts +1 -1
- package/dist/SearchBar.js +38 -39
- package/dist/SearchBar.js.map +1 -1
- package/dist/SearchBar.vue.d.ts +127 -44
- package/dist/SectionHeader.js.map +1 -1
- package/dist/SectionHeader.vue.d.ts +6 -37
- package/dist/Select.js +171 -183
- package/dist/Select.js.map +1 -1
- package/dist/Select.vue.d.ts +23 -102
- package/dist/SelectStatus.js +38 -38
- package/dist/SelectStatus.js.map +1 -1
- package/dist/SelectStatus.vue.d.ts +227 -47
- package/dist/Skeleton.js.map +1 -1
- package/dist/Skeleton.vue.d.ts +3 -34
- package/dist/Step.js +44 -44
- package/dist/Step.js.map +1 -1
- package/dist/Step.vue.d.ts +4 -43
- package/dist/Stepper.js.map +1 -1
- package/dist/Stepper.vue.d.ts +9 -44
- package/dist/Switch.js.map +1 -1
- package/dist/Switch.vue.d.ts +8 -47
- package/dist/Tab.js +1 -1
- package/dist/Tab.js.map +1 -1
- package/dist/Tab.vue.d.ts +2 -15
- package/dist/TabPanel.js.map +1 -1
- package/dist/TabPanel.vue.d.ts +3 -30
- package/dist/Table.js +53 -59
- package/dist/Table.js.map +1 -1
- package/dist/Table.keys-LHQf6FEH.js.map +1 -1
- package/dist/Table.vue.d.ts +3 -50
- package/dist/TableCell.js +1 -1
- package/dist/TableCell.js.map +1 -1
- package/dist/TableCell.vue.d.ts +3 -32
- package/dist/TableHeaderCell.js +1 -1
- package/dist/TableHeaderCell.js.map +1 -1
- package/dist/TableHeaderCell.vue.d.ts +3 -30
- package/dist/TableHeaderRow.js +47 -45
- package/dist/TableHeaderRow.js.map +1 -1
- package/dist/TableHeaderRow.vue.d.ts +5 -34
- package/dist/TableRow.js +60 -61
- package/dist/TableRow.js.map +1 -1
- package/dist/TableRow.vue.d.ts +7 -48
- package/dist/Tabs.js +2 -2
- package/dist/Tabs.vue.d.ts +122 -31
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-Dprx064Y.js +156 -0
- package/dist/{Tabs.vue_vue_type_script_setup_true_lang-CmnBP4i1.js.map → Tabs.vue_vue_type_script_setup_true_lang-Dprx064Y.js.map} +1 -1
- package/dist/TextEditor.js +2414 -2420
- package/dist/TextEditor.js.map +1 -1
- package/dist/TextEditor.vue.d.ts +9 -40
- package/dist/Textarea.js +69 -69
- package/dist/Textarea.js.map +1 -1
- package/dist/Textarea.vue.d.ts +9 -44
- 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 +26 -22
- package/dist/Timeline.js.map +1 -1
- package/dist/Timeline.vue.d.ts +3 -32
- 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 +3 -30
- package/dist/Toasts.js.map +1 -1
- package/dist/ToastsPlugin.js +11 -11
- package/dist/ToastsPlugin.js.map +1 -1
- package/dist/Tooltip.js +29 -30
- package/dist/Tooltip.js.map +1 -1
- package/dist/Tooltip.vue.d.ts +11 -43
- 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 +39 -44
- package/dist/directives/viewable.js.map +1 -1
- package/dist/{floating-ui.vue-pzUuloyX.js → floating-ui.vue-CL01Y9ER.js} +2 -2
- package/dist/{floating-ui.vue-pzUuloyX.js.map → floating-ui.vue-CL01Y9ER.js.map} +1 -1
- package/dist/formatDateTime-DG7kBc2T.js +1414 -0
- package/dist/{formatDateTime-Dz8bXV0R.js.map → formatDateTime-DG7kBc2T.js.map} +1 -1
- package/dist/index-D6bxWkZ1.js.map +1 -1
- package/dist/{index-ConQ3o31.js → index-GUu9zvbg.js} +3 -3
- package/dist/{index-ConQ3o31.js.map → index-GUu9zvbg.js.map} +1 -1
- package/dist/index.js +99 -104
- 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-DBDE6jkd.js +408 -0
- package/dist/{searchFuzzy-DRasJ33G.js.map → searchFuzzy-DBDE6jkd.js.map} +1 -1
- package/dist/statusLevels-D8EgtE_L.js.map +1 -1
- package/dist/storage.js.map +1 -1
- package/dist/tailwind-base.js +4 -4
- 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 +21 -25
- package/dist/useDialog.js.map +1 -1
- package/dist/useGoogleMaps.js +108 -110
- package/dist/useGoogleMaps.js.map +1 -1
- package/dist/useMediaQuery.d.ts +0 -6
- package/dist/useMediaQuery.js +11 -15
- 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 +20 -27
- 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 +54 -63
- package/dist/useSortable.js.map +1 -1
- package/dist/useStepper.d.ts +2 -2
- package/dist/useStepper.js +36 -40
- package/dist/useStepper.js.map +1 -1
- package/dist/useToasts.js +23 -23
- package/dist/useToasts.js.map +1 -1
- package/dist/useValidation.js +96 -100
- 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 +2 -2
- 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 +13 -14
- package/tailwind-base.ts +4 -4
- package/types/vite.d.ts +7 -0
- package/types/vitest.d.ts +7 -0
- package/dist/Logo.vue_vue_type_script_setup_true_lang-Dz8c98sc.js.map +0 -1
- package/dist/MenusPlugin-Bk6UW6o9.js +0 -12
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-CmnBP4i1.js +0 -159
- package/dist/formatDateTime-Dz8bXV0R.js +0 -1418
- package/dist/searchFuzzy-DRasJ33G.js +0 -409
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../../src/utils/helpers.ts"],"sourcesContent":["import camelCase from 'lodash-es/camelCase';\nimport get from 'lodash-es/get';\nimport isFinite from 'lodash-es/isFinite';\nimport isPlainObject from 'lodash-es/isPlainObject';\n\nimport { INBOUND_LEADS, LICENSE_COLORS, ORDER, SELLER_STATUSES } from '../constants';\n\nconst BULK = 'BULK';\nconst MOUNT_POINT_CLASS = '.mount-point-container';\n\n/**\n * Filters the list of `items` based on options selected in the `filters` object\n * @param {array} items A list of items to filter\n * @param {IFilter} options an options object for the filtering configuration\n */\nexport function filterItems(items, filters) {\n if (!Object.keys(filters).length) {\n return items;\n }\n\n return items.filter((item) => {\n for (const key in filters) {\n // eg. `brand`, `category`, `status`...\n const filter = filters[key]; // IFilter;\n const filterValues = filter.filterBy; // eg. ['1906', 'LuvBuds'], ['vape', 'pen', 'flower']\n let itemValue = get(item, key.split('.')); // eg `LuvBuds`, 'vape'\n\n // TODO take care of this upstream. ie write custom filter function if itemValue is an object\n // ie. if (typeof itemValue !== 'string' || typeof itemValue !== 'number' )\n if (isPlainObject(itemValue)) {\n itemValue = item[key].id;\n }\n\n if ('customFilter' in filter) {\n // custom function should return `false` when the filter logic does not match\n if (!filter.customFilter(filterValues, itemValue, item)) {\n return false;\n }\n } else {\n if (!Array.isArray(itemValue) && !~filterValues.indexOf(itemValue)) {\n return false;\n }\n }\n }\n\n return true;\n });\n}\n\n/**\n * Sorts an array of items\n * @param {Array} items the list of things to sort\n * @param {ISort} options an options object for the sorting configuration\n * sortBy: the object key to sort on\n * sortDesc: whether to sort descending or not\n * customSorter: a custom sorting function\n *\n * https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/util/helpers.ts#L381\n */\nexport function sortItems(items, options) {\n const { sortBy, sortDesc, customSorter, locale = 'en' } = options;\n const isObject = items.length && typeof items[0] === 'object';\n\n if (!sortBy && isObject) {\n return items;\n }\n\n return [...items].sort((a, b) => {\n let sortA = get(a, sortBy) || a;\n let sortB = get(b, sortBy) || b;\n\n if (sortDesc) {\n [sortA, sortB] = [sortB, sortA];\n }\n\n if (customSorter) {\n return customSorter(sortA, sortB);\n }\n\n [sortA, sortB] = [sortA, sortB].map((s) => (s || '').toString().toLocaleLowerCase());\n\n if (sortA !== sortB) {\n const sortResult =\n !isNaN(sortA) && !isNaN(sortB) ? Number(sortA) - Number(sortB) : sortA.localeCompare(sortB, locale);\n\n if (sortResult) {\n return sortResult;\n }\n }\n\n return 0;\n });\n}\n\n/**\n * Removes all accents/diacritics and converts to lower case\n * @param {string} text to normalize\n */\nexport function normalizeText(text) {\n if (isFinite(text)) {\n text = text.toString();\n }\n\n if (!text || typeof text !== 'string') {\n return '';\n }\n\n /**\n * NFD splits the canonical form and the regex removed only accent characters\n * see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize for more detail.\n */\n return text\n .toLowerCase()\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '');\n}\n\n/**\n * Generates a hash code from a string\n * @param {string} s The string to generate a hash from\n * @see https://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript/52171480\n */\nexport function hashCode(s) {\n return s.split('').reduce((a, b) => {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0);\n}\n\n/**\n * Returns the mount point for elements that will reattach themselves, or creates one if not available\n */\nexport function getMountPoint() {\n const el = document.querySelector(MOUNT_POINT_CLASS);\n\n if (!el) {\n const div = document.createElement('div');\n\n div.className = MOUNT_POINT_CLASS.slice(1, MOUNT_POINT_CLASS.length);\n return document.body.appendChild(div);\n }\n\n return el;\n}\n\n/**\n * Retrieves the value of a css variable\n *\n * @param {string} name name of the css var, with or without `--`\n * @return {string} value of the css var\n */\nexport function getCssVar(name) {\n let variable = name;\n\n if (variable.substring(0, 2) !== '--') {\n variable = `--${variable}`;\n }\n\n return getComputedStyle(document.documentElement).getPropertyValue(variable);\n}\n\n/**\n * Format the license type text to display\n * @param {string} licenseType the first three characters of the licenseType\n */\nexport function formatLicenseTypeText(licenseType = '') {\n const type = licenseType.toUpperCase();\n\n return type === BULK ? type : type.slice(0, 3);\n}\n\nexport function generateColorClass(type, value) {\n let color;\n\n try {\n switch (type) {\n case 'license':\n value = formatLicenseTypeText(value);\n color = LICENSE_COLORS[value];\n break;\n case 'order':\n color = 'tw-bg-' + ORDER[value.toUpperCase()].color;\n break;\n case 'certified-seller':\n color = SELLER_STATUSES[camelCase(value)].color;\n break;\n case 'inbound-leads':\n color = INBOUND_LEADS[value.toUpperCase()].color;\n break;\n }\n\n return color || 'tw-bg-ice-500';\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (err) {\n return 'tw-bg-ice-500';\n }\n}\n"],"names":["BULK","MOUNT_POINT_CLASS","filterItems","items","filters","item","key","filter","filterValues","itemValue","get","isPlainObject","sortItems","options","sortBy","sortDesc","customSorter","locale","isObject","a","b","sortA","sortB","s","sortResult","normalizeText","text","isFinite","hashCode","getMountPoint","el","div","getCssVar","name","variable","formatLicenseTypeText","licenseType","type","generateColorClass","value","color","LICENSE_COLORS","ORDER","SELLER_STATUSES","camelCase","INBOUND_LEADS"],"mappings":";;;;;AAOA,MAAMA,IAAO,QACPC,IAAoB;
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../../src/utils/helpers.ts"],"sourcesContent":["import camelCase from 'lodash-es/camelCase';\nimport get from 'lodash-es/get';\nimport isFinite from 'lodash-es/isFinite';\nimport isPlainObject from 'lodash-es/isPlainObject';\n\nimport { INBOUND_LEADS, LICENSE_COLORS, ORDER, SELLER_STATUSES } from '../constants';\n\nconst BULK = 'BULK';\nconst MOUNT_POINT_CLASS = '.mount-point-container';\n\n/**\n * Filters the list of `items` based on options selected in the `filters` object\n * @param {array} items A list of items to filter\n * @param {IFilter} options an options object for the filtering configuration\n */\nexport function filterItems(items, filters) {\n if (!Object.keys(filters).length) {\n return items;\n }\n\n return items.filter((item) => {\n for (const key in filters) {\n // eg. `brand`, `category`, `status`...\n const filter = filters[key]; // IFilter;\n const filterValues = filter.filterBy; // eg. ['1906', 'LuvBuds'], ['vape', 'pen', 'flower']\n let itemValue = get(item, key.split('.')); // eg `LuvBuds`, 'vape'\n\n // TODO take care of this upstream. ie write custom filter function if itemValue is an object\n // ie. if (typeof itemValue !== 'string' || typeof itemValue !== 'number' )\n if (isPlainObject(itemValue)) {\n itemValue = item[key].id;\n }\n\n if ('customFilter' in filter) {\n // custom function should return `false` when the filter logic does not match\n if (!filter.customFilter(filterValues, itemValue, item)) {\n return false;\n }\n } else {\n if (!Array.isArray(itemValue) && !~filterValues.indexOf(itemValue)) {\n return false;\n }\n }\n }\n\n return true;\n });\n}\n\n/**\n * Sorts an array of items\n * @param {Array} items the list of things to sort\n * @param {ISort} options an options object for the sorting configuration\n * sortBy: the object key to sort on\n * sortDesc: whether to sort descending or not\n * customSorter: a custom sorting function\n *\n * https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/util/helpers.ts#L381\n */\nexport function sortItems(items, options) {\n const { sortBy, sortDesc, customSorter, locale = 'en' } = options;\n const isObject = items.length && typeof items[0] === 'object';\n\n if (!sortBy && isObject) {\n return items;\n }\n\n return [...items].sort((a, b) => {\n let sortA = get(a, sortBy) || a;\n let sortB = get(b, sortBy) || b;\n\n if (sortDesc) {\n [sortA, sortB] = [sortB, sortA];\n }\n\n if (customSorter) {\n return customSorter(sortA, sortB);\n }\n\n [sortA, sortB] = [sortA, sortB].map((s) => (s || '').toString().toLocaleLowerCase());\n\n if (sortA !== sortB) {\n const sortResult =\n !isNaN(sortA) && !isNaN(sortB) ? Number(sortA) - Number(sortB) : sortA.localeCompare(sortB, locale);\n\n if (sortResult) {\n return sortResult;\n }\n }\n\n return 0;\n });\n}\n\n/**\n * Removes all accents/diacritics and converts to lower case\n * @param {string} text to normalize\n */\nexport function normalizeText(text) {\n if (isFinite(text)) {\n text = text.toString();\n }\n\n if (!text || typeof text !== 'string') {\n return '';\n }\n\n /**\n * NFD splits the canonical form and the regex removed only accent characters\n * see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize for more detail.\n */\n return text\n .toLowerCase()\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '');\n}\n\n/**\n * Generates a hash code from a string\n * @param {string} s The string to generate a hash from\n * @see https://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript/52171480\n */\nexport function hashCode(s) {\n return s.split('').reduce((a, b) => {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0);\n}\n\n/**\n * Returns the mount point for elements that will reattach themselves, or creates one if not available\n */\nexport function getMountPoint() {\n const el = document.querySelector(MOUNT_POINT_CLASS);\n\n if (!el) {\n const div = document.createElement('div');\n\n div.className = MOUNT_POINT_CLASS.slice(1, MOUNT_POINT_CLASS.length);\n return document.body.appendChild(div);\n }\n\n return el;\n}\n\n/**\n * Retrieves the value of a css variable\n *\n * @param {string} name name of the css var, with or without `--`\n * @return {string} value of the css var\n */\nexport function getCssVar(name) {\n let variable = name;\n\n if (variable.substring(0, 2) !== '--') {\n variable = `--${variable}`;\n }\n\n return getComputedStyle(document.documentElement).getPropertyValue(variable);\n}\n\n/**\n * Format the license type text to display\n * @param {string} licenseType the first three characters of the licenseType\n */\nexport function formatLicenseTypeText(licenseType = '') {\n const type = licenseType.toUpperCase();\n\n return type === BULK ? type : type.slice(0, 3);\n}\n\nexport function generateColorClass(type, value) {\n let color;\n\n try {\n switch (type) {\n case 'license':\n value = formatLicenseTypeText(value);\n color = LICENSE_COLORS[value];\n break;\n case 'order':\n color = 'tw-bg-' + ORDER[value.toUpperCase()].color;\n break;\n case 'certified-seller':\n color = SELLER_STATUSES[camelCase(value)].color;\n break;\n case 'inbound-leads':\n color = INBOUND_LEADS[value.toUpperCase()].color;\n break;\n }\n\n return color || 'tw-bg-ice-500';\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (err) {\n return 'tw-bg-ice-500';\n }\n}\n"],"names":["BULK","MOUNT_POINT_CLASS","filterItems","items","filters","item","key","filter","filterValues","itemValue","get","isPlainObject","sortItems","options","sortBy","sortDesc","customSorter","locale","isObject","a","b","sortA","sortB","s","sortResult","normalizeText","text","isFinite","hashCode","getMountPoint","el","div","getCssVar","name","variable","formatLicenseTypeText","licenseType","type","generateColorClass","value","color","LICENSE_COLORS","ORDER","SELLER_STATUSES","camelCase","INBOUND_LEADS"],"mappings":"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"}
|
package/dist/utils/i18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sources":["../../src/utils/i18n.ts"],"sourcesContent":["import { CURRENCY_SYMBOL_MAP } from '../constants';\nimport { locale } from '../locale';\n\n/**\n * Return the correct symbol for a currency based on code.\n *\n * @param {string} currencyCode - The code used to determine the symbol (i.e. 'USD').\n * @returns {string} - Currency symbol, i.e. '$'.\n */\nexport const getSymbolFromCurrency = (currencyCode) => {\n if (typeof currencyCode !== 'string') {\n return undefined;\n }\n\n const code = currencyCode.toUpperCase();\n\n if (!Object.prototype.hasOwnProperty.call(CURRENCY_SYMBOL_MAP, code)) {\n return undefined;\n }\n\n return CURRENCY_SYMBOL_MAP[code];\n};\n\nexport const decimalSeparator = getLocaleDecimalSeparator(locale);\nexport const currencySymbol = getSymbolFromCurrency('USD');\nexport const currency = {\n default: 'USD',\n position: getLocaleSymbolPosition(),\n symbol: currencySymbol,\n};\n\n/**\n * A helper function for obtaining the current decimal separator\n * @param {string} locale The locale used to determine the separator.\n * @returns {string} Decimal separator ('.', ',')\n */\nfunction getLocaleDecimalSeparator(locale) {\n return (1.1).toLocaleString(locale).replace(/\\d/g, '');\n}\n\n/**\n * A helper function for obtaining symbol position relative to a value\n * This should be fine going forward unless we get into RTL, or Arabic.\n * @param {string} type the type of symbol\n */\nexport function getLocaleSymbolPosition({ type = 'currency' } = {}) {\n return (type === 'percent' && percent(1).indexOf('%') === 0) ||\n (type === 'currency' && money({ amount: 1 }).indexOf(currencySymbol) === 0)\n ? 'prepend'\n : 'append';\n}\n\n/**\n * Format a value as a decimal in a locale-aware format.\n * NOTE: Be careful as this returns a string and should not be used for\n * additional calculation unless converted.\n * @param {number|string} value number to format\n * @param {number} [decimalPlaces] number of decimal places\n * @return {string} locale-aware number as a string\n */\nexport function decimal(value, decimalPlaces) {\n return new Intl.NumberFormat(locale, {\n minimumFractionDigits: decimalPlaces,\n maximumFractionDigits: decimalPlaces,\n style: 'decimal',\n }).format(value);\n}\n\n/**\n * Format a value as a money string in a locale-aware format.\n * @param {Object} object\n * @param {number} object.amount The number to format\n * @param {string} [object.currency] ISO 4217 currency code (USD, CAD, EUR, etc)\n * @return {string} locale-aware money value as a string\n */\nexport function money({ amount, currency = 'USD' }) {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n }).format(amount);\n}\n\n/**\n * Format a value as a percent in a locale-aware format.\n * @param {number|string} value number to format\n * @param {number} [decimalPlaces] number of decimal places\n * @return {string} locale-aware percentage value as a string\n */\nexport function percent(value, decimalPlaces?) {\n return new Intl.NumberFormat(locale, {\n style: 'percent',\n minimumFractionDigits: decimalPlaces,\n maximumFractionDigits: decimalPlaces || 2,\n }).format(value);\n}\n\n/**\n * Cleans a value to reflect type=number restrictions.\n * Omits exponents, and restricts the decimal separator.\n * @param {number|string} value value to format\n * @param {string} value decimal separator\n */\nexport function sanitizeDecimal(value, separator = '.') {\n const replace = `[^0-9${separator}+-]*`;\n const re = new RegExp(replace, 'g');\n\n return `${value}`.replace(re, '');\n}\n\n/**\n * Replace decimal separator of `value` with `convertTo`\n * @param {string|number} value\n * @param {string} convertTo decimal character to update the value with\n */\nexport function convertDecimal(value, convertTo = '.') {\n return `${value}`.replace(convertTo === '.' ? ',' : '.', convertTo);\n}\n"],"names":["getSymbolFromCurrency","currencyCode","code","CURRENCY_SYMBOL_MAP","decimalSeparator","getLocaleDecimalSeparator","locale","currencySymbol","currency","getLocaleSymbolPosition","type","percent","money","decimal","value","decimalPlaces","amount","sanitizeDecimal","separator","replace","re","convertDecimal","convertTo"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"i18n.js","sources":["../../src/utils/i18n.ts"],"sourcesContent":["import { CURRENCY_SYMBOL_MAP } from '../constants';\nimport { locale } from '../locale';\n\n/**\n * Return the correct symbol for a currency based on code.\n *\n * @param {string} currencyCode - The code used to determine the symbol (i.e. 'USD').\n * @returns {string} - Currency symbol, i.e. '$'.\n */\nexport const getSymbolFromCurrency = (currencyCode) => {\n if (typeof currencyCode !== 'string') {\n return undefined;\n }\n\n const code = currencyCode.toUpperCase();\n\n if (!Object.prototype.hasOwnProperty.call(CURRENCY_SYMBOL_MAP, code)) {\n return undefined;\n }\n\n return CURRENCY_SYMBOL_MAP[code];\n};\n\nexport const decimalSeparator = getLocaleDecimalSeparator(locale);\nexport const currencySymbol = getSymbolFromCurrency('USD');\nexport const currency = {\n default: 'USD',\n position: getLocaleSymbolPosition(),\n symbol: currencySymbol,\n};\n\n/**\n * A helper function for obtaining the current decimal separator\n * @param {string} locale The locale used to determine the separator.\n * @returns {string} Decimal separator ('.', ',')\n */\nfunction getLocaleDecimalSeparator(locale) {\n return (1.1).toLocaleString(locale).replace(/\\d/g, '');\n}\n\n/**\n * A helper function for obtaining symbol position relative to a value\n * This should be fine going forward unless we get into RTL, or Arabic.\n * @param {string} type the type of symbol\n */\nexport function getLocaleSymbolPosition({ type = 'currency' } = {}) {\n return (type === 'percent' && percent(1).indexOf('%') === 0) ||\n (type === 'currency' && money({ amount: 1 }).indexOf(currencySymbol) === 0)\n ? 'prepend'\n : 'append';\n}\n\n/**\n * Format a value as a decimal in a locale-aware format.\n * NOTE: Be careful as this returns a string and should not be used for\n * additional calculation unless converted.\n * @param {number|string} value number to format\n * @param {number} [decimalPlaces] number of decimal places\n * @return {string} locale-aware number as a string\n */\nexport function decimal(value, decimalPlaces) {\n return new Intl.NumberFormat(locale, {\n minimumFractionDigits: decimalPlaces,\n maximumFractionDigits: decimalPlaces,\n style: 'decimal',\n }).format(value);\n}\n\n/**\n * Format a value as a money string in a locale-aware format.\n * @param {Object} object\n * @param {number} object.amount The number to format\n * @param {string} [object.currency] ISO 4217 currency code (USD, CAD, EUR, etc)\n * @return {string} locale-aware money value as a string\n */\nexport function money({ amount, currency = 'USD' }) {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n }).format(amount);\n}\n\n/**\n * Format a value as a percent in a locale-aware format.\n * @param {number|string} value number to format\n * @param {number} [decimalPlaces] number of decimal places\n * @return {string} locale-aware percentage value as a string\n */\nexport function percent(value, decimalPlaces?) {\n return new Intl.NumberFormat(locale, {\n style: 'percent',\n minimumFractionDigits: decimalPlaces,\n maximumFractionDigits: decimalPlaces || 2,\n }).format(value);\n}\n\n/**\n * Cleans a value to reflect type=number restrictions.\n * Omits exponents, and restricts the decimal separator.\n * @param {number|string} value value to format\n * @param {string} value decimal separator\n */\nexport function sanitizeDecimal(value, separator = '.') {\n const replace = `[^0-9${separator}+-]*`;\n const re = new RegExp(replace, 'g');\n\n return `${value}`.replace(re, '');\n}\n\n/**\n * Replace decimal separator of `value` with `convertTo`\n * @param {string|number} value\n * @param {string} convertTo decimal character to update the value with\n */\nexport function convertDecimal(value, convertTo = '.') {\n return `${value}`.replace(convertTo === '.' ? ',' : '.', convertTo);\n}\n"],"names":["getSymbolFromCurrency","currencyCode","code","CURRENCY_SYMBOL_MAP","decimalSeparator","getLocaleDecimalSeparator","locale","currencySymbol","currency","getLocaleSymbolPosition","type","percent","money","decimal","value","decimalPlaces","amount","sanitizeDecimal","separator","replace","re","convertDecimal","convertTo"],"mappings":";;AASO,MAAMA,IAAwB,CAACC,MAAiB;AACrD,MAAI,OAAOA,KAAiB;AAC1B;AAGF,QAAMC,IAAOD,EAAa,YAAA;AAE1B,MAAK,OAAO,UAAU,eAAe,KAAKE,GAAqBD,CAAI;AAInE,WAAOC,EAAoBD,CAAI;AACjC,GAEaE,IAAmBC,EAA0BC,CAAM,GACnDC,IAAiBP,EAAsB,KAAK,GAC5CQ,IAAW;AAAA,EACtB,SAAS;AAAA,EACT,UAAUC,EAAA;AAAA,EACV,QAAQF;AACV;AAOA,SAASF,EAA0BC,GAAQ;AACzC,SAAQ,IAAK,eAAeA,CAAM,EAAE,QAAQ,OAAO,EAAE;AACvD;AAOO,SAASG,EAAwB,EAAE,MAAAC,IAAO,WAAA,IAAe,CAAA,GAAI;AAClE,SAAQA,MAAS,aAAaC,EAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,KACvDD,MAAS,cAAcE,EAAM,EAAE,QAAQ,GAAG,EAAE,QAAQL,CAAc,MAAM,IACvE,YACA;AACN;AAUO,SAASM,EAAQC,GAAOC,GAAe;AAC5C,SAAO,IAAI,KAAK,aAAaT,GAAQ;AAAA,IACnC,uBAAuBS;AAAA,IACvB,uBAAuBA;AAAA,IACvB,OAAO;AAAA,EAAA,CACR,EAAE,OAAOD,CAAK;AACjB;AASO,SAASF,EAAM,EAAE,QAAAI,GAAQ,UAAAR,IAAW,SAAS;AAClD,SAAO,IAAI,KAAK,aAAaF,GAAQ;AAAA,IACnC,OAAO;AAAA,IACP,UAAAE;AAAAA,EAAA,CACD,EAAE,OAAOQ,CAAM;AAClB;AAQO,SAASL,EAAQG,GAAOC,GAAgB;AAC7C,SAAO,IAAI,KAAK,aAAaT,GAAQ;AAAA,IACnC,OAAO;AAAA,IACP,uBAAuBS;AAAA,IACvB,uBAAuBA,KAAiB;AAAA,EAAA,CACzC,EAAE,OAAOD,CAAK;AACjB;AAQO,SAASG,EAAgBH,GAAOI,IAAY,KAAK;AACtD,QAAMC,IAAU,QAAQD,CAAS,QAC3BE,IAAK,IAAI,OAAOD,GAAS,GAAG;AAElC,SAAO,GAAGL,CAAK,GAAG,QAAQM,GAAI,EAAE;AAClC;AAOO,SAASC,EAAeP,GAAOQ,IAAY,KAAK;AACrD,SAAO,GAAGR,CAAK,GAAG,QAAQQ,MAAc,MAAM,MAAM,KAAKA,CAAS;AACpE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizeDate.js","sources":["../../src/utils/normalizeDate.ts"],"sourcesContent":["import { parseISO } from 'date-fns';\n\n/**\n * Normalize a given value into a Date object. This function will accept a string, a Date\n * or a number and return Date representation of the value.\n *\n * @param value - The value to normalize.\n * @returns A normalized date object.\n */\nexport default function normalizeDate(value?: string | Date | number) {\n if (typeof value === 'number') {\n return new Date(value); // the reverse is Date.prototype.getTime()\n }\n\n if (!value) {\n return new Date();\n }\n\n if (typeof value === 'string') {\n return parseISO(value);\n }\n\n return value;\n}\n"],"names":["normalizeDate","value","parseISO"],"mappings":";AASA,SAAwBA,EAAcC,GAAgC;
|
|
1
|
+
{"version":3,"file":"normalizeDate.js","sources":["../../src/utils/normalizeDate.ts"],"sourcesContent":["import { parseISO } from 'date-fns';\n\n/**\n * Normalize a given value into a Date object. This function will accept a string, a Date\n * or a number and return Date representation of the value.\n *\n * @param value - The value to normalize.\n * @returns A normalized date object.\n */\nexport default function normalizeDate(value?: string | Date | number) {\n if (typeof value === 'number') {\n return new Date(value); // the reverse is Date.prototype.getTime()\n }\n\n if (!value) {\n return new Date();\n }\n\n if (typeof value === 'string') {\n return parseISO(value);\n }\n\n return value;\n}\n"],"names":["normalizeDate","value","parseISO"],"mappings":";AASA,SAAwBA,EAAcC,GAAgC;AACpE,SAAI,OAAOA,KAAU,WACZ,IAAI,KAAKA,CAAK,IAGlBA,IAID,OAAOA,KAAU,WACZC,EAASD,CAAK,IAGhBA,wBAPM,KAAA;AAQf;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
function
|
|
2
|
-
if (!
|
|
3
|
-
return
|
|
4
|
-
let
|
|
5
|
-
return
|
|
1
|
+
function n(r, { maskChar: t = "•", maskCharCount: u = 10, lengthToKeep: f = 0, position: i = "start" } = {}) {
|
|
2
|
+
if (!f)
|
|
3
|
+
return t?.repeat(u);
|
|
4
|
+
let e;
|
|
5
|
+
return i === "end" ? (e = r.substring(0, f), e + t?.repeat(u)) : (e = r.substring(r.length - f), t?.repeat(u) + e);
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
n as default
|
|
9
9
|
};
|
|
10
10
|
//# sourceMappingURL=obfuscateText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obfuscateText.js","sources":["../../src/utils/obfuscateText.ts"],"sourcesContent":["export interface ObfuscateTextOptions {\n /**\n * Num of characters to keep revealed.\n * Default will obfuscate entire string\n * with length of maskCharCount.\n */\n lengthToKeep?: number;\n /**\n * Character to obfuscate text with\n */\n maskChar?: string;\n /**\n * The number of masked characters to display\n */\n maskCharCount?: number;\n /**\n * Position to start obfuscating text\n */\n position?: 'start' | 'end';\n}\n\nexport default function obfuscateText(\n text,\n { maskChar = '•', maskCharCount = 10, lengthToKeep = 0, position = 'start' }: ObfuscateTextOptions = {},\n): string {\n if (!lengthToKeep) {\n return maskChar?.repeat(maskCharCount);\n }\n\n let charsToKeep;\n\n if (position === 'end') {\n charsToKeep = text.substring(0, lengthToKeep);\n\n return charsToKeep + maskChar?.repeat(maskCharCount);\n } else {\n charsToKeep = text.substring(text.length - lengthToKeep);\n\n return maskChar?.repeat(maskCharCount) + charsToKeep;\n }\n}\n"],"names":["obfuscateText","text","maskChar","maskCharCount","lengthToKeep","position","charsToKeep"],"mappings":"AAqBA,SAAwBA,EACtBC,GACA,EAAE,UAAAC,IAAW,KAAK,eAAAC,IAAgB,IAAI,cAAAC,IAAe,GAAG,UAAAC,IAAW,
|
|
1
|
+
{"version":3,"file":"obfuscateText.js","sources":["../../src/utils/obfuscateText.ts"],"sourcesContent":["export interface ObfuscateTextOptions {\n /**\n * Num of characters to keep revealed.\n * Default will obfuscate entire string\n * with length of maskCharCount.\n */\n lengthToKeep?: number;\n /**\n * Character to obfuscate text with\n */\n maskChar?: string;\n /**\n * The number of masked characters to display\n */\n maskCharCount?: number;\n /**\n * Position to start obfuscating text\n */\n position?: 'start' | 'end';\n}\n\nexport default function obfuscateText(\n text,\n { maskChar = '•', maskCharCount = 10, lengthToKeep = 0, position = 'start' }: ObfuscateTextOptions = {},\n): string {\n if (!lengthToKeep) {\n return maskChar?.repeat(maskCharCount);\n }\n\n let charsToKeep;\n\n if (position === 'end') {\n charsToKeep = text.substring(0, lengthToKeep);\n\n return charsToKeep + maskChar?.repeat(maskCharCount);\n } else {\n charsToKeep = text.substring(text.length - lengthToKeep);\n\n return maskChar?.repeat(maskCharCount) + charsToKeep;\n }\n}\n"],"names":["obfuscateText","text","maskChar","maskCharCount","lengthToKeep","position","charsToKeep"],"mappings":"AAqBA,SAAwBA,EACtBC,GACA,EAAE,UAAAC,IAAW,KAAK,eAAAC,IAAgB,IAAI,cAAAC,IAAe,GAAG,UAAAC,IAAW,QAAA,IAAkC,CAAA,GAC7F;AACR,MAAI,CAACD;AACH,WAAOF,GAAU,OAAOC,CAAa;AAGvC,MAAIG;AAEJ,SAAID,MAAa,SACfC,IAAcL,EAAK,UAAU,GAAGG,CAAY,GAErCE,IAAcJ,GAAU,OAAOC,CAAa,MAEnDG,IAAcL,EAAK,UAAUA,EAAK,SAASG,CAAY,GAEhDF,GAAU,OAAOC,CAAa,IAAIG;AAE7C;"}
|
package/dist/utils/storage.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import l from "@leaflink/snitch";
|
|
2
|
-
import { hashCode as
|
|
3
|
-
const
|
|
4
|
-
function m(
|
|
5
|
-
const e = a.global ? "" : `-${location.pathname}`,
|
|
2
|
+
import { hashCode as c } from "./helpers.js";
|
|
3
|
+
const n = "ll";
|
|
4
|
+
function m(t, o, a = {}) {
|
|
5
|
+
const e = a.global ? "" : `-${location.pathname}`, r = `${n}-${t}${e}`, s = JSON.stringify(o);
|
|
6
6
|
try {
|
|
7
|
-
localStorage.setItem(
|
|
8
|
-
} catch (
|
|
9
|
-
|
|
7
|
+
localStorage.setItem(r, s);
|
|
8
|
+
} catch (i) {
|
|
9
|
+
i?.name === "QuotaExceededError" ? l.log(`Your localStorage is full. Failed to save item for key: ${r}`) : l.log(`Failed to save value to localStorage for key: ${r}`);
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
function g(
|
|
13
|
-
const a =
|
|
12
|
+
function g(t, o = {}) {
|
|
13
|
+
const a = o.global ? "" : `-${location.pathname}`, e = localStorage.getItem(`${n}-${t}${a}`);
|
|
14
14
|
if (e === null || e === "undefined")
|
|
15
15
|
return null;
|
|
16
16
|
try {
|
|
17
17
|
return JSON.parse(e);
|
|
18
|
-
} catch (
|
|
19
|
-
return l.error(
|
|
18
|
+
} catch (r) {
|
|
19
|
+
return l.error(r?.message, { error: r }), null;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
function u(
|
|
23
|
-
const a =
|
|
22
|
+
function u(t, o = {}) {
|
|
23
|
+
const a = o.global ? "" : `-${location.pathname}`, e = `${n}-${t}${a}`;
|
|
24
24
|
if (localStorage.getItem(e) !== null)
|
|
25
25
|
try {
|
|
26
26
|
localStorage.removeItem(e);
|
|
@@ -28,22 +28,22 @@ function u(o, r = {}) {
|
|
|
28
28
|
l.error(s.message, { error: s });
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function p(
|
|
32
|
-
const a = JSON.parse(localStorage.getItem(
|
|
31
|
+
function p(t, o) {
|
|
32
|
+
const a = JSON.parse(localStorage.getItem(t) || "{}");
|
|
33
33
|
try {
|
|
34
|
-
return (a[
|
|
34
|
+
return (a[o] || {})[c(location.pathname)];
|
|
35
35
|
} catch (e) {
|
|
36
|
-
l.error(e
|
|
36
|
+
l.error(e?.message, { error: e });
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function S(
|
|
41
|
-
const e = { ...JSON.parse(localStorage.getItem(
|
|
42
|
-
e[
|
|
40
|
+
function S(t, o) {
|
|
41
|
+
const e = { ...JSON.parse(localStorage.getItem(t) || "{}") };
|
|
42
|
+
e[o] && delete e[o][c(location.pathname)];
|
|
43
43
|
try {
|
|
44
|
-
localStorage.setItem(
|
|
45
|
-
} catch (
|
|
46
|
-
|
|
44
|
+
localStorage.setItem(t, JSON.stringify(e));
|
|
45
|
+
} catch (r) {
|
|
46
|
+
r?.name === "QuotaExceededError" ? l.log("Your localStorage is full. Failed to set item.") : l.log("Failed to set item to localStorage.");
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
const I = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sources":["../../src/utils/storage.ts"],"sourcesContent":["import logger from '@leaflink/snitch';\n\nimport { hashCode } from './helpers';\n\nconst PREFIX = 'll';\n\n/**\n * Persist an item to localStorage, unique to each url pathname unless [options.global] is set to true\n *\n * If global is set to false (the default):\n * name: 'foo'\n * data: { a: 'a' }\n *\n * localStorage key: 'll-foo-/c/the-leaf-shop/customers/'\n * localStorage value: { a: 'a' }\n *\n * If global is set to true:\n * name: 'bar'\n * data: { b: 'b' }\n *\n * localStorage key: 'll-bar'\n * localStorage value: { b: 'b' }\n *\n * @param {string} name - the storage key name, often a component name\n * @param {object} data - the data to persist\n * @param {object} [options] - an optional options object\n * @param {boolean} [options.global] - does not add url to the key when true\n */\nexport function setPersistentItem(name, data, options: { global?: boolean } = {}) {\n const scope = options.global ? '' : `-${location.pathname}`;\n const storageKey = `${PREFIX}-${name}${scope}`;\n const storageValue = JSON.stringify(data);\n\n try {\n localStorage.setItem(storageKey, storageValue);\n } catch (error) {\n if ((error as Error)?.name === 'QuotaExceededError') {\n logger.log(`Your localStorage is full. Failed to save item for key: ${storageKey}`);\n } else {\n logger.log(`Failed to save value to localStorage for key: ${storageKey}`);\n }\n }\n}\n\n/**\n * Retrieve an item from localStorage, previously saved by `setPersistentItem`.\n * @param {string} name The storage key name, often a component name\n * @param {object} [options] - an optional options object\n * @param {boolean} [options.global] - does not add url to the key when true\n * @returns {any | undefined}\n */\nexport function getPersistentItem(name, options: { global?: boolean } = {}) {\n const scope = options.global ? '' : `-${location.pathname}`;\n const item = localStorage.getItem(`${PREFIX}-${name}${scope}`);\n\n // localStorage.getItem always returns a string or null. When it's a string,\n // it usually contains an object or a boolean. If the value is 'false', we\n // need to ensure we return false instead of null.\n if (item === null || item === 'undefined') {\n return null;\n }\n\n try {\n return JSON.parse(item);\n } catch (err) {\n logger.error((err as Error)?.message, { error: err });\n\n return null;\n }\n}\n\n/**\n * Remove an item from localStorage, previously saved by `setPersistentItem`.\n * @param {string} name The storage key name, often a component name\n * @param {object} [options] - an optional options object\n * @param {boolean} [options.global] - does not add url to the key when true\n */\nexport function removePersistentItem(name, options: { global?: boolean } = {}) {\n const scope = options.global ? '' : `-${location.pathname}`;\n const storageKey = `${PREFIX}-${name}${scope}`;\n const item = localStorage.getItem(storageKey);\n\n if (item === null) {\n return;\n }\n\n try {\n localStorage.removeItem(storageKey);\n } catch (err) {\n logger.error((err as Error).message, { error: err });\n }\n}\n\n/**\n ***************** DEPRECATED *****************\n */\nexport function getPersistentItem__deprecated(itemKey: string, name) {\n const item = JSON.parse(localStorage.getItem(itemKey) || '{}');\n\n try {\n return (item[name] || {})[hashCode(location.pathname)];\n } catch (err) {\n logger.error((err as Error)?.message, { error: err });\n\n return undefined;\n }\n}\n\nexport function removePersistentItem__deprecated(itemKey, name) {\n const item = JSON.parse(localStorage.getItem(itemKey) || '{}');\n const itemValue = { ...item };\n\n if (itemValue[name]) {\n delete itemValue[name][hashCode(location.pathname)];\n }\n\n try {\n localStorage.setItem(itemKey, JSON.stringify(itemValue));\n } catch (error) {\n if ((error as Error)?.name === 'QuotaExceededError') {\n logger.log(`Your localStorage is full. Failed to set item.`);\n } else {\n logger.log(`Failed to set item to localStorage.`);\n }\n }\n}\n// END DEPRECATED\n\nexport const persistentStorage = {\n setItem: setPersistentItem,\n getItem: getPersistentItem,\n removeItem: removePersistentItem,\n};\n"],"names":["PREFIX","setPersistentItem","name","data","options","scope","storageKey","storageValue","error","logger","getPersistentItem","item","err","removePersistentItem","getPersistentItem__deprecated","itemKey","hashCode","removePersistentItem__deprecated","itemValue","persistentStorage"],"mappings":";;AAIA,MAAMA,IAAS;AAwBR,SAASC,EAAkBC,GAAMC,GAAMC,IAAgC,CAAA,GAAI;AAChF,QAAMC,IAAQD,EAAQ,SAAS,KAAK,IAAI,SAAS,QAAQ,IACnDE,IAAa,GAAGN,CAAM,IAAIE,CAAI,GAAGG,CAAK,IACtCE,IAAe,KAAK,UAAUJ,CAAI;
|
|
1
|
+
{"version":3,"file":"storage.js","sources":["../../src/utils/storage.ts"],"sourcesContent":["import logger from '@leaflink/snitch';\n\nimport { hashCode } from './helpers';\n\nconst PREFIX = 'll';\n\n/**\n * Persist an item to localStorage, unique to each url pathname unless [options.global] is set to true\n *\n * If global is set to false (the default):\n * name: 'foo'\n * data: { a: 'a' }\n *\n * localStorage key: 'll-foo-/c/the-leaf-shop/customers/'\n * localStorage value: { a: 'a' }\n *\n * If global is set to true:\n * name: 'bar'\n * data: { b: 'b' }\n *\n * localStorage key: 'll-bar'\n * localStorage value: { b: 'b' }\n *\n * @param {string} name - the storage key name, often a component name\n * @param {object} data - the data to persist\n * @param {object} [options] - an optional options object\n * @param {boolean} [options.global] - does not add url to the key when true\n */\nexport function setPersistentItem(name, data, options: { global?: boolean } = {}) {\n const scope = options.global ? '' : `-${location.pathname}`;\n const storageKey = `${PREFIX}-${name}${scope}`;\n const storageValue = JSON.stringify(data);\n\n try {\n localStorage.setItem(storageKey, storageValue);\n } catch (error) {\n if ((error as Error)?.name === 'QuotaExceededError') {\n logger.log(`Your localStorage is full. Failed to save item for key: ${storageKey}`);\n } else {\n logger.log(`Failed to save value to localStorage for key: ${storageKey}`);\n }\n }\n}\n\n/**\n * Retrieve an item from localStorage, previously saved by `setPersistentItem`.\n * @param {string} name The storage key name, often a component name\n * @param {object} [options] - an optional options object\n * @param {boolean} [options.global] - does not add url to the key when true\n * @returns {any | undefined}\n */\nexport function getPersistentItem(name, options: { global?: boolean } = {}) {\n const scope = options.global ? '' : `-${location.pathname}`;\n const item = localStorage.getItem(`${PREFIX}-${name}${scope}`);\n\n // localStorage.getItem always returns a string or null. When it's a string,\n // it usually contains an object or a boolean. If the value is 'false', we\n // need to ensure we return false instead of null.\n if (item === null || item === 'undefined') {\n return null;\n }\n\n try {\n return JSON.parse(item);\n } catch (err) {\n logger.error((err as Error)?.message, { error: err });\n\n return null;\n }\n}\n\n/**\n * Remove an item from localStorage, previously saved by `setPersistentItem`.\n * @param {string} name The storage key name, often a component name\n * @param {object} [options] - an optional options object\n * @param {boolean} [options.global] - does not add url to the key when true\n */\nexport function removePersistentItem(name, options: { global?: boolean } = {}) {\n const scope = options.global ? '' : `-${location.pathname}`;\n const storageKey = `${PREFIX}-${name}${scope}`;\n const item = localStorage.getItem(storageKey);\n\n if (item === null) {\n return;\n }\n\n try {\n localStorage.removeItem(storageKey);\n } catch (err) {\n logger.error((err as Error).message, { error: err });\n }\n}\n\n/**\n ***************** DEPRECATED *****************\n */\nexport function getPersistentItem__deprecated(itemKey: string, name) {\n const item = JSON.parse(localStorage.getItem(itemKey) || '{}');\n\n try {\n return (item[name] || {})[hashCode(location.pathname)];\n } catch (err) {\n logger.error((err as Error)?.message, { error: err });\n\n return undefined;\n }\n}\n\nexport function removePersistentItem__deprecated(itemKey, name) {\n const item = JSON.parse(localStorage.getItem(itemKey) || '{}');\n const itemValue = { ...item };\n\n if (itemValue[name]) {\n delete itemValue[name][hashCode(location.pathname)];\n }\n\n try {\n localStorage.setItem(itemKey, JSON.stringify(itemValue));\n } catch (error) {\n if ((error as Error)?.name === 'QuotaExceededError') {\n logger.log(`Your localStorage is full. Failed to set item.`);\n } else {\n logger.log(`Failed to set item to localStorage.`);\n }\n }\n}\n// END DEPRECATED\n\nexport const persistentStorage = {\n setItem: setPersistentItem,\n getItem: getPersistentItem,\n removeItem: removePersistentItem,\n};\n"],"names":["PREFIX","setPersistentItem","name","data","options","scope","storageKey","storageValue","error","logger","getPersistentItem","item","err","removePersistentItem","getPersistentItem__deprecated","itemKey","hashCode","removePersistentItem__deprecated","itemValue","persistentStorage"],"mappings":";;AAIA,MAAMA,IAAS;AAwBR,SAASC,EAAkBC,GAAMC,GAAMC,IAAgC,CAAA,GAAI;AAChF,QAAMC,IAAQD,EAAQ,SAAS,KAAK,IAAI,SAAS,QAAQ,IACnDE,IAAa,GAAGN,CAAM,IAAIE,CAAI,GAAGG,CAAK,IACtCE,IAAe,KAAK,UAAUJ,CAAI;AAExC,MAAI;AACF,iBAAa,QAAQG,GAAYC,CAAY;AAAA,EAC/C,SAASC,GAAO;AACd,IAAKA,GAAiB,SAAS,uBAC7BC,EAAO,IAAI,2DAA2DH,CAAU,EAAE,IAElFG,EAAO,IAAI,iDAAiDH,CAAU,EAAE;AAAA,EAE5E;AACF;AASO,SAASI,EAAkBR,GAAME,IAAgC,IAAI;AAC1E,QAAMC,IAAQD,EAAQ,SAAS,KAAK,IAAI,SAAS,QAAQ,IACnDO,IAAO,aAAa,QAAQ,GAAGX,CAAM,IAAIE,CAAI,GAAGG,CAAK,EAAE;AAK7D,MAAIM,MAAS,QAAQA,MAAS;AAC5B,WAAO;AAGT,MAAI;AACF,WAAO,KAAK,MAAMA,CAAI;AAAA,EACxB,SAASC,GAAK;AACZ,WAAAH,EAAO,MAAOG,GAAe,SAAS,EAAE,OAAOA,GAAK,GAE7C;AAAA,EACT;AACF;AAQO,SAASC,EAAqBX,GAAME,IAAgC,IAAI;AAC7E,QAAMC,IAAQD,EAAQ,SAAS,KAAK,IAAI,SAAS,QAAQ,IACnDE,IAAa,GAAGN,CAAM,IAAIE,CAAI,GAAGG,CAAK;AAG5C,MAFa,aAAa,QAAQC,CAAU,MAE/B;AAIb,QAAI;AACF,mBAAa,WAAWA,CAAU;AAAA,IACpC,SAASM,GAAK;AACZ,MAAAH,EAAO,MAAOG,EAAc,SAAS,EAAE,OAAOA,GAAK;AAAA,IACrD;AACF;AAKO,SAASE,EAA8BC,GAAiBb,GAAM;AACnE,QAAMS,IAAO,KAAK,MAAM,aAAa,QAAQI,CAAO,KAAK,IAAI;AAE7D,MAAI;AACF,YAAQJ,EAAKT,CAAI,KAAK,CAAA,GAAIc,EAAS,SAAS,QAAQ,CAAC;AAAA,EACvD,SAASJ,GAAK;AACZ,IAAAH,EAAO,MAAOG,GAAe,SAAS,EAAE,OAAOA,GAAK;AAEpD;AAAA,EACF;AACF;AAEO,SAASK,EAAiCF,GAASb,GAAM;AAE9D,QAAMgB,IAAY,EAAE,GADP,KAAK,MAAM,aAAa,QAAQH,CAAO,KAAK,IAAI,EACtC;AAEvB,EAAIG,EAAUhB,CAAI,KAChB,OAAOgB,EAAUhB,CAAI,EAAEc,EAAS,SAAS,QAAQ,CAAC;AAGpD,MAAI;AACF,iBAAa,QAAQD,GAAS,KAAK,UAAUG,CAAS,CAAC;AAAA,EACzD,SAASV,GAAO;AACd,IAAKA,GAAiB,SAAS,uBAC7BC,EAAO,IAAI,gDAAgD,IAE3DA,EAAO,IAAI,qCAAqC;AAAA,EAEpD;AACF;AAGO,MAAMU,IAAoB;AAAA,EAC/B,SAASlB;AAAA,EACT,SAASS;AAAA,EACT,YAAYG;AACd;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leaflink/stash",
|
|
3
|
-
"version": "51.
|
|
3
|
+
"version": "51.10.0",
|
|
4
4
|
"description": "LeafLink's design system.",
|
|
5
5
|
"homepage": "https://stash.leaflink.com",
|
|
6
6
|
"main": "./dist/index.ts",
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"not ie <= 10"
|
|
75
75
|
],
|
|
76
76
|
"scripts": {
|
|
77
|
-
"
|
|
77
|
+
"prebuild": "npm run build:spritesheet",
|
|
78
|
+
"build": "vite build",
|
|
78
79
|
"build:spritesheet": "svg-sprite --symbol --symbol-dest=assets/ --symbol-sprite=spritesheet.svg --svg-namespace-ids=false assets/icons/*.svg assets/integrations/*.svg",
|
|
79
|
-
"build:ts": "vue-tsc --declaration --emitDeclarationOnly --declarationMap",
|
|
80
80
|
"fix": "npm run lint:js-fix && npm run lint:css-fix",
|
|
81
81
|
"lint": "npm run lint:js && npm run lint:css",
|
|
82
82
|
"lint:js": "eslint .",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"fuzzysort": "3.0.2",
|
|
109
109
|
"sanitize-html": "2.13.0",
|
|
110
110
|
"v-calendar": "3.1.2",
|
|
111
|
-
"vue": "3.5.
|
|
111
|
+
"vue": "^3.5.21",
|
|
112
112
|
"vue-currency-input": "3.1.0",
|
|
113
113
|
"vue-inline-svg": "3.1.4",
|
|
114
114
|
"vue3-carousel": "0.3.4",
|
|
@@ -123,13 +123,12 @@
|
|
|
123
123
|
"@testing-library/jest-dom": "^6.6.3",
|
|
124
124
|
"@testing-library/user-event": "^14.5.2",
|
|
125
125
|
"@testing-library/vue": "^8.1.0",
|
|
126
|
-
"@types/dompurify": "3.2.0",
|
|
127
126
|
"@types/google.maps": "^3.58.1",
|
|
128
127
|
"@types/lodash-es": "^4.17.12",
|
|
129
128
|
"@types/plaid-link": "^2.0.15",
|
|
130
|
-
"@vitejs/plugin-vue": "
|
|
131
|
-
"@vitejs/plugin-vue-jsx": "
|
|
132
|
-
"@vitest/coverage-v8": "3.
|
|
129
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
130
|
+
"@vitejs/plugin-vue-jsx": "^5.1.1",
|
|
131
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
133
132
|
"@vue/babel-plugin-jsx": "1.4.0",
|
|
134
133
|
"@vue/test-utils": "^2.4.6",
|
|
135
134
|
"autoprefixer": "^10.4.20",
|
|
@@ -152,14 +151,14 @@
|
|
|
152
151
|
"svg-sprite": "^2.0.4",
|
|
153
152
|
"tailwindcss": "^3.4.13",
|
|
154
153
|
"typescript": "5.4.2",
|
|
155
|
-
"vite": "
|
|
156
|
-
"vite-plugin-dts": "
|
|
154
|
+
"vite": "^7.1.5",
|
|
155
|
+
"vite-plugin-dts": "^4.5.4",
|
|
157
156
|
"vite-svg-loader": "^5.1.0",
|
|
158
|
-
"vitepress": "1.6.
|
|
159
|
-
"vitest": "3.
|
|
157
|
+
"vitepress": "^1.6.4",
|
|
158
|
+
"vitest": "^3.2.4",
|
|
160
159
|
"vue-component-meta": "2.2.8",
|
|
161
160
|
"vue-eslint-parser": "^9.4.3",
|
|
162
|
-
"vue-tsc": "
|
|
161
|
+
"vue-tsc": "^3.0.6"
|
|
163
162
|
},
|
|
164
163
|
"peerDependencies": {
|
|
165
164
|
"lodash-es": "^4.x.x",
|
|
@@ -181,7 +180,7 @@
|
|
|
181
180
|
]
|
|
182
181
|
},
|
|
183
182
|
"volta": {
|
|
184
|
-
"node": "22.
|
|
183
|
+
"node": "22.19.0"
|
|
185
184
|
},
|
|
186
185
|
"stylelint": {
|
|
187
186
|
"extends": [
|
package/tailwind-base.ts
CHANGED
|
@@ -22,7 +22,7 @@ export default {
|
|
|
22
22
|
// includes a variant modifier like /hover:bg-red-.+/.
|
|
23
23
|
safelist: [
|
|
24
24
|
{
|
|
25
|
-
pattern: /(bg|text|border)-(purple|royal|blue|seafoam|teal|green|yellow|orange|red|ice)(-[1,5,7]00)$/,
|
|
25
|
+
pattern: /(bg|text|border)-(purple|royal|blue|seafoam|teal|green|yellow|orange|red|ice)(-[1,5,7,9]00)$/,
|
|
26
26
|
},
|
|
27
27
|
// Illustration.vue stroke color.
|
|
28
28
|
{
|
|
@@ -302,9 +302,9 @@ export default {
|
|
|
302
302
|
xl: 'calc(28/20)',
|
|
303
303
|
base: 'calc(24/16)',
|
|
304
304
|
// for backwards compatibility with LL typography line-heights
|
|
305
|
-
body: '20/14',
|
|
306
|
-
small: '16/12',
|
|
307
|
-
button: '24/14',
|
|
305
|
+
body: 'calc(20/14)',
|
|
306
|
+
small: 'calc(16/12)',
|
|
307
|
+
button: 'calc(24/14)',
|
|
308
308
|
},
|
|
309
309
|
|
|
310
310
|
// .tw-min-w-*
|
package/types/vite.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// vitest and vite wanted devs to add ./node_modules as a type root, but that makes TSC crawl all
|
|
2
|
+
// type definitions everywhere, just so they could list vite/client or vitest/globals in the types
|
|
3
|
+
// property. It's really a shoddy setup on their part. This is a workaround to force it to load
|
|
4
|
+
// the global stuff and just have our type root be more standard as our own types folder.
|
|
5
|
+
import * as viteClient from 'vite/client';
|
|
6
|
+
|
|
7
|
+
export { viteClient };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// vitest and vite wanted devs to add ./node_modules as a type root, but that makes TSC crawl all
|
|
2
|
+
// type definitions everywhere, just so they could list vite/client or vitest/globals in the types
|
|
3
|
+
// property. It's really a shoddy setup on their part. This is a workaround to force it to load
|
|
4
|
+
// the global stuff and just have our type root be more standard as our own types folder.
|
|
5
|
+
import * as vitestGlobals from 'vitest/globals.d.ts';
|
|
6
|
+
|
|
7
|
+
export { vitestGlobals };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Logo.vue_vue_type_script_setup_true_lang-Dz8c98sc.js","sources":["../assets/logos/direct-pay-lockup.svg","../assets/logos/flex-pay-lockup.svg","../assets/logos/leaflink-brandmark.svg","../assets/logos/leaflink-lockup.svg","../assets/logos/marketplace-brandmark.svg","../assets/logos/payments-brandmark.svg","../assets/logos/payments-lockup.svg","../assets/logos/post-lockup.svg","../src/components/Logo/Logo.vue"],"sourcesContent":["import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n fill: \"#1E164B\",\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 107 24\"\n}\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _cache[0] || (_cache[0] = [\n _createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n \"clip-rule\": \"evenodd\",\n d: \"M6.746 2a4 4 0 0 0-4 4v12a4 4 0 0 0 4 4h12a4 4 0 0 0 4-4V6a4 4 0 0 0-4-4h-12Zm6.827 8.927c1.473.394 2.567 1.196 2.567 2.61 0 1.344-.936 2.313-2.244 2.63-.342.083-.614.368-.614.72v.18a.496.496 0 0 1-.992 0v-.215c0-.354-.263-.646-.601-.75-.973-.302-1.658-.964-1.933-1.782-.154-.457.253-.855.736-.855.485 0 .856.437 1.161.815.265.328.708.54 1.293.54.92 0 1.43-.539 1.43-1.195 0-.51-.365-.933-1.226-1.167l-1.137-.32c-1.983-.51-2.333-1.707-2.333-2.48 0-1.234.86-2.154 2.034-2.512.324-.1.576-.379.576-.717v-.183a.496.496 0 1 1 .992 0v.174c0 .34.26.62.587.714.941.269 1.618.91 1.871 1.779.133.457-.273.847-.75.847-.473 0-.827-.424-1.134-.793l-.03-.036c-.23-.275-.591-.44-1.04-.44-.773 0-1.327.482-1.327 1.124 0 .262.073.772 1.05 1.035l1.064.277Z\"\n }, null, -1),\n _createElementVNode(\"path\", { d: \"M28.746 16.832h3.803c2.782 0 4.39-2.076 4.39-4.811 0-2.749-1.608-4.853-4.39-4.853h-3.803v9.664Zm2.195-1.922V9.09h1.608c1.44 0 2.18 1.416 2.18 2.931 0 1.5-.74 2.89-2.18 2.89H30.94ZM38.63 16.832h2.195V7.168H38.63v9.664ZM47.905 16.832h2.558l-2.488-3.52c1.551-.393 2.264-1.585 2.264-2.946 0-1.599-1.006-3.198-3.243-3.198h-3.942v9.664h2.195v-3.394h.433l2.223 3.394ZM45.249 9.09h1.453c.895 0 1.329.687 1.329 1.332s-.42 1.276-1.384 1.276h-1.398V9.09ZM54.218 14.91V13.06h3.495V11.08h-3.495V9.09h3.984V7.168h-6.179v9.664h6.305V14.91h-4.11ZM64.262 17a4.898 4.898 0 0 0 4.054-2.146l-1.706-1.192c-.503.785-1.244 1.262-2.264 1.262-1.65 0-2.768-1.346-2.768-2.945 0-1.599 1.16-2.903 2.782-2.903 1.006 0 1.747.477 2.25 1.262l1.706-1.192A4.899 4.899 0 0 0 64.262 7c-2.712 0-4.893 2.258-4.893 4.979 0 2.749 2.18 5.021 4.893 5.021ZM76.216 7.168h-7.283V9.09h2.544v7.742h2.195V9.09h2.544V7.168ZM85.39 7.168h-3.97v9.664h2.195V13.55h1.776c2.236 0 3.243-1.571 3.243-3.184 0-1.599-1.007-3.198-3.243-3.198Zm-.097 4.46h-1.678V9.09h1.692c.81 0 1.118.659 1.118 1.276s-.308 1.262-1.132 1.262ZM95.526 16.832h2.335L94.31 7.168h-2.39l-3.566 9.664h2.349l.713-2.244h3.383l.727 2.244Zm-3.509-4.152 1.077-3.38 1.09 3.38h-2.167ZM103.758 7.168l-2.265 3.563-2.222-3.563h-2.615l3.747 5.302v4.362h2.209v-4.32l3.76-5.344h-2.614Z\" }, null, -1)\n ])))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n fill: \"#1E164B\",\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 89 24\"\n}\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _cache[0] || (_cache[0] = [\n _createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n \"clip-rule\": \"evenodd\",\n d: \"M6 2a4 4 0 0 0-4 4v12a4 4 0 0 0 4 4h12a4 4 0 0 0 4-4V6a4 4 0 0 0-4-4H6Zm6.827 8.927c1.473.394 2.567 1.196 2.567 2.61 0 1.344-.936 2.313-2.244 2.63-.342.083-.614.368-.614.72v.18a.496.496 0 0 1-.992 0v-.215c0-.354-.264-.646-.602-.75-.972-.302-1.657-.964-1.932-1.782-.154-.457.253-.855.736-.855.485 0 .856.437 1.161.815.265.328.708.54 1.293.54.919 0 1.43-.539 1.43-1.195 0-.51-.365-.933-1.226-1.167l-1.137-.32c-1.983-.51-2.333-1.707-2.333-2.48 0-1.234.86-2.154 2.034-2.512.324-.1.576-.379.576-.717v-.183a.496.496 0 1 1 .992 0v.174c0 .34.26.62.587.714.941.269 1.618.91 1.871 1.779.133.457-.273.847-.75.847-.474 0-.827-.424-1.134-.793l-.03-.036c-.23-.275-.591-.44-1.04-.44-.773 0-1.327.482-1.327 1.124 0 .262.073.772 1.05 1.035l1.064.277Z\"\n }, null, -1),\n _createElementVNode(\"path\", { d: \"M34.08 9.09V7.168H28v9.664h2.19V13.03h3.08v-1.908h-3.08V9.09h3.89ZM35.639 16.832h5.716V14.91h-3.527V7.168h-2.19v9.664ZM44.922 14.91V13.06h3.486V11.08h-3.486V9.09h3.974V7.168h-6.163v9.664h6.288V14.91h-4.1ZM58.978 16.832l-3.333-5.148 3.04-4.516h-2.621l-1.715 2.763-1.687-2.763h-2.65l3.026 4.516-3.304 5.148h2.565l2.05-3.394 2.05 3.394h2.579ZM67.82 7.168h-3.96v9.664h2.19V13.55h1.77c2.23 0 3.235-1.571 3.235-3.184 0-1.599-1.004-3.198-3.235-3.198Zm-.098 4.46H66.05V9.09h1.687c.809 0 1.116.659 1.116 1.276s-.307 1.262-1.13 1.262ZM77.929 16.832h2.328l-3.541-9.664H74.33l-3.555 9.664h2.342l.711-2.244h3.375l.725 2.244Zm-3.5-4.152 1.074-3.38 1.087 3.38H74.43ZM86.139 7.168l-2.259 3.563-2.217-3.563h-2.607l3.737 5.302v4.362h2.203v-4.32l3.75-5.344H86.14Z\" }, null, -1)\n ])))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 29 24\",\n fill: \"#1E164B\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _cache[0] || (_cache[0] = [\n _createElementVNode(\"path\", { d: \"M7.219 18.834v-4.518L0 23.633h4.195l3.092-3.99a4.956 4.956 0 0 1-.068-.81ZM14.74 22.248a3.8 3.8 0 0 1-2.657-1.094 3.68 3.68 0 0 1-1.097-2.621c0-.03.01-11.764.01-13.665.003-1.747 1.502-3.334 3.442-3.334.87 0 1.706.324 2.343.906A4.876 4.876 0 0 0 14.408.41a4.971 4.971 0 0 0-3.139-.193 4.902 4.902 0 0 0-2.61 1.726 4.771 4.771 0 0 0-1.007 2.932v13.942c0 2.522 2.11 4.803 4.9 4.803a4.904 4.904 0 0 0 2.834-.887c.345-.238.658-.517.932-.831a3.753 3.753 0 0 1-1.578.347Z\" }, null, -1),\n _createElementVNode(\"path\", { d: \"M18.023 18.823v-4.518l-4.23 5.429c-.219.282-.53.48-.883.562-.351.081-.72.04-1.044-.117.265.46.641.848 1.094 1.132a3.338 3.338 0 0 0 3.073.248c.494-.207.929-.53 1.267-.941l.788-1.008a4.672 4.672 0 0 1-.065-.787ZM25.55 22.248a3.799 3.799 0 0 1-2.657-1.094 3.679 3.679 0 0 1-1.096-2.621l.01-13.665c0-1.746 1.5-3.33 3.441-3.33.868 0 1.703.325 2.338.907A4.875 4.875 0 0 0 25.216.414 4.971 4.971 0 0 0 22.077.22a4.902 4.902 0 0 0-2.61 1.723 4.77 4.77 0 0 0-1.01 2.931v13.942c0 2.522 2.111 4.803 4.9 4.803a4.904 4.904 0 0 0 2.835-.887c.345-.238.658-.517.932-.831a3.756 3.756 0 0 1-1.574.347Z\" }, null, -1),\n _createElementVNode(\"path\", { d: \"m26.12 17.75-1.523 1.983c-.219.282-.53.48-.881.562-.352.081-.72.04-1.044-.116.266.46.642.848 1.095 1.132a3.339 3.339 0 0 0 3.073.248c.494-.207.929-.53 1.268-.941l.67-.865-2.657-2.003ZM25.243 1.989c-.547 0-1.084.147-1.553.425a2.99 2.99 0 0 0-1.11 1.15 1.58 1.58 0 0 1 1.973.31 1.52 1.52 0 0 1 .044 1.966L22.23 8.897v5.399l5.02-6.459a4.711 4.711 0 0 0 1.01-2.921 2.943 2.943 0 0 0-.897-2.073 3.038 3.038 0 0 0-2.119-.854ZM14.438 1.989a3.055 3.055 0 0 0-1.551.426 2.99 2.99 0 0 0-1.108 1.15 1.58 1.58 0 0 1 1.97.312 1.52 1.52 0 0 1 .044 1.963l-2.368 3.057v5.399l5.019-6.459a4.713 4.713 0 0 0 1.008-2.921 2.943 2.943 0 0 0-.897-2.073 3.038 3.038 0 0 0-2.117-.854Z\" }, null, -1)\n ])))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createStaticVNode as _createStaticVNode } from \"vue\"\n\nconst _hoisted_1 = {\n fill: \"#1E164B\",\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 139 24\"\n}\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _cache[0] || (_cache[0] = [\n _createStaticVNode(\"<g clip-path=\\\"url(#logo_leaflink_lockup)\\\"><path d=\\\"M35.265.068h3.883V23.64h-3.883V.068ZM57.586 16.946H45.493c.433 2.143 2.11 3.232 4.422 3.232 1.708 0 3.316-.66 4.254-1.912l2.58 1.945c-1.44 2.242-4.188 3.429-7.036 3.429-4.689 0-8.24-3.231-8.24-8.045 0-4.912 3.752-8.013 8.207-8.013 4.49 0 8.007 3.069 8.007 7.88-.005.496-.038.992-.1 1.484Zm-3.786-2.67c-.234-2.11-1.876-3.33-4.053-3.33-2.11 0-3.785.989-4.254 3.33H53.8ZM76.628 7.913V23.64H72.74v-2.407c-1.071 1.648-3.282 2.407-5.196 2.407-4.12 0-7.709-3.132-7.709-8.045 0-4.944 3.552-8.013 7.672-8.013 1.977 0 4.158.759 5.226 2.374V7.91l3.894.003Zm-3.953 7.649c0-2.704-2.278-4.418-4.522-4.418-2.412 0-4.389 1.846-4.389 4.418s1.977 4.484 4.389 4.484c2.378 0 4.522-1.78 4.522-4.484ZM83.997 6.891v1.352h3.484v3.069h-3.484V23.64h-3.882V7.089C80.115 2.67 82.255 0 86.61 0h1.843l-1.072 3.56c-2.647 0-3.418 1.451-3.384 3.331ZM91.182.07h3.886v23.57h-3.886V.07ZM97.993 2.803c0-1.352 1.172-2.341 2.546-2.341 1.407 0 2.512.989 2.512 2.34 0 1.32-1.105 2.342-2.512 2.342-1.37 0-2.546-1.023-2.546-2.341Zm.606 5.44h3.886v15.396h-3.886V8.243ZM120.934 15.003v8.637h-3.885v-8.276c0-2.44-1.508-3.693-3.25-3.693-1.776 0-3.984.957-3.984 3.922v8.044h-3.891V8.243h3.886v2.44c.803-1.913 3.249-2.77 4.857-2.77 4.023 0 6.267 2.604 6.267 7.09ZM134.073 23.64l-6.098-6.99v6.99h-3.885V.068h3.885v13.087l4.489-4.912h5.059l-6.365 6.726 7.838 8.67h-4.923ZM7.219 18.834v-4.518L0 23.633h4.195l3.092-3.99a4.956 4.956 0 0 1-.068-.81ZM14.74 22.248a3.8 3.8 0 0 1-2.657-1.094 3.68 3.68 0 0 1-1.097-2.621c0-.03.01-11.764.01-13.665.003-1.747 1.502-3.334 3.442-3.334.87 0 1.706.324 2.343.906A4.876 4.876 0 0 0 14.408.41a4.971 4.971 0 0 0-3.139-.193 4.902 4.902 0 0 0-2.61 1.726 4.771 4.771 0 0 0-1.007 2.932v13.942c0 2.522 2.11 4.803 4.9 4.803a4.903 4.903 0 0 0 2.834-.887c.345-.238.658-.517.932-.831a3.753 3.753 0 0 1-1.578.347Z\\\"></path><path d=\\\"M18.023 18.823v-4.518l-4.23 5.429c-.219.282-.53.48-.883.562-.351.081-.72.04-1.044-.117.265.46.641.848 1.094 1.132a3.338 3.338 0 0 0 3.073.248c.494-.207.929-.53 1.267-.941l.788-1.008a4.672 4.672 0 0 1-.065-.787ZM25.55 22.248a3.799 3.799 0 0 1-2.657-1.094 3.679 3.679 0 0 1-1.096-2.621l.01-13.665c0-1.746 1.5-3.33 3.441-3.33.868 0 1.703.325 2.338.907A4.875 4.875 0 0 0 25.216.414 4.971 4.971 0 0 0 22.077.22a4.902 4.902 0 0 0-2.61 1.723 4.77 4.77 0 0 0-1.01 2.931v13.942c0 2.522 2.111 4.803 4.9 4.803a4.904 4.904 0 0 0 2.835-.887c.345-.238.658-.517.932-.831a3.756 3.756 0 0 1-1.574.347Z\\\"></path><path d=\\\"m26.12 17.75-1.523 1.983c-.219.282-.53.48-.881.562-.352.081-.72.04-1.044-.116.266.46.642.848 1.095 1.132a3.339 3.339 0 0 0 3.073.248c.494-.207.929-.53 1.268-.941l.67-.865-2.657-2.003ZM25.243 1.989c-.547 0-1.084.147-1.553.425a2.99 2.99 0 0 0-1.11 1.15 1.58 1.58 0 0 1 1.973.31 1.52 1.52 0 0 1 .044 1.966L22.23 8.897v5.399l5.02-6.459a4.711 4.711 0 0 0 1.01-2.921 2.943 2.943 0 0 0-.897-2.073 3.038 3.038 0 0 0-2.119-.854ZM14.438 1.989a3.055 3.055 0 0 0-1.551.426 2.99 2.99 0 0 0-1.108 1.15 1.58 1.58 0 0 1 1.97.312 1.52 1.52 0 0 1 .044 1.963l-2.368 3.057v5.399l5.019-6.459a4.713 4.713 0 0 0 1.008-2.921 2.943 2.943 0 0 0-.897-2.073 3.038 3.038 0 0 0-2.117-.854Z\\\"></path></g><defs><clipPath id=\\\"logo_leaflink_lockup\\\"><path fill=\\\"#fff\\\" d=\\\"M0 0h139v23.64H0z\\\"></path></clipPath></defs>\", 2)\n ])))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n fill: \"#1E164B\",\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _cache[0] || (_cache[0] = [\n _createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n \"clip-rule\": \"evenodd\",\n d: \"M6 2a4 4 0 0 0-4 4v12a4 4 0 0 0 4 4h12a4 4 0 0 0 4-4V6a4 4 0 0 0-4-4H6Zm9.308 13.322V8.655a1.486 1.486 0 0 1 .027-.31 1.687 1.687 0 0 1 1.245-1.29 1.703 1.703 0 0 1 1.622.44l.035.037c.018.018.036.037.052.056a2.39 2.39 0 0 0-1.44-1.304 2.386 2.386 0 0 0-.749-.117 2.385 2.385 0 0 0-2.41 2.357v6.903a2.389 2.389 0 0 0 1.676 2.294 2.416 2.416 0 0 0 2.591-.773 1.85 1.85 0 0 1-2.108-.353 1.805 1.805 0 0 1-.517-1.01 2.54 2.54 0 0 1-.024-.263ZM12.6 10.164l-2.108 2.748-.227.296v-2.669l1.08-1.415c.047-.061.09-.126.126-.195.213-.415.131-.827-.21-1.048a.771.771 0 0 0-.694-.074l.015-.02.038-.047.021-.025a.669.669 0 0 1 .045-.05l.02-.019a1.485 1.485 0 0 1 2.438.543c.064.178.093.366.086.554a2.364 2.364 0 0 1-.61 1.398l-.02.023Zm-5.857 7.67 1.51-1.986a2.514 2.514 0 0 1-.031-.424v-2.203l-3.513 4.612h2.034Zm6.51-1.63.256-.35a4.485 4.485 0 0 1-.012-.077l-.011-.073v-.07l-.004-.034c-.003-.014-.003-.029-.003-.043v-2.319l-.131.179-.385.522c-.593.803-1.348 1.807-1.574 2.033a.778.778 0 0 1-.897.144.798.798 0 0 0 .055.087.953.953 0 0 0 .092.126c.01.014.02.026.032.039l.004.004.034.037.037.038a1.588 1.588 0 0 0 .454.317 1.642 1.642 0 0 0 2.003-.492l.04-.053.01-.014Zm5.236-7.458v-.004a1.465 1.465 0 0 0-.437-1.094 1.49 1.49 0 0 0-1.867-.185l-.059.043a1.473 1.473 0 0 0-.167.143l-.006.006c-.02.02-.04.04-.057.06l-.021.026-.038.047-.014.019a.774.774 0 0 1 .698.074c.34.221.422.633.209 1.048a1.308 1.308 0 0 1-.128.195l-1.077 1.415v2.669l.225-.296 2.115-2.755a2.367 2.367 0 0 0 .624-1.411Zm.22 7.181-.203.278-.012.016a1.367 1.367 0 0 1-.03.042l-.007.009a.101.101 0 0 1-.01.016l-.02.023-.04.05-.01.012a1.04 1.04 0 0 1-.068.076 1.646 1.646 0 0 1-2.274.035l-.006-.004-.006-.006a1.696 1.696 0 0 1-.292-.364l.003.003c.002 0 .003 0 .004.002l.003.001a.786.786 0 0 0 .898-.144c.114-.114.372-.436.77-.958l1.3.913Zm-8.656-7.273v6.666c0 .086.007.172.022.258v.006a1.805 1.805 0 0 0 .565 1.055 1.86 1.86 0 0 0 2.063.308 2.42 2.42 0 0 1-3.566.187 2.355 2.355 0 0 1-.702-1.706V8.522a2.388 2.388 0 0 1 2.412-2.355c.256-.001.51.04.752.12.443.147.834.42 1.125.782.127.16.233.335.314.52a1.703 1.703 0 0 0-1.707-.53c-.58.149-1.038.59-1.204 1.162a.684.684 0 0 0-.04.126c-.023.1-.034.204-.034.307Z\"\n }, null, -1)\n ])))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n fill: \"#1E164B\",\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _cache[0] || (_cache[0] = [\n _createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n \"clip-rule\": \"evenodd\",\n d: \"M6 2a4 4 0 0 0-4 4v12a4 4 0 0 0 4 4h12a4 4 0 0 0 4-4V6a4 4 0 0 0-4-4H6Zm6.827 8.927c1.473.394 2.567 1.196 2.567 2.61 0 1.344-.936 2.313-2.244 2.63-.342.083-.614.368-.614.72v.18a.496.496 0 0 1-.992 0v-.215c0-.354-.264-.646-.602-.75-.972-.302-1.657-.964-1.932-1.782-.154-.457.253-.855.736-.855.485 0 .856.437 1.161.815.265.328.708.54 1.293.54.919 0 1.43-.539 1.43-1.195 0-.51-.365-.933-1.226-1.167l-1.137-.32c-1.983-.51-2.333-1.707-2.333-2.48 0-1.234.86-2.154 2.034-2.512.324-.1.576-.379.576-.717v-.183a.496.496 0 1 1 .992 0v.174c0 .34.26.62.587.714.941.269 1.618.91 1.871 1.779.133.457-.273.847-.75.847-.474 0-.827-.424-1.134-.793l-.03-.036c-.23-.275-.591-.44-1.04-.44-.773 0-1.327.482-1.327 1.124 0 .262.073.772 1.05 1.035l1.064.277Z\"\n }, null, -1)\n ])))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n fill: \"#1E164B\",\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 164 24\"\n}\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _cache[0] || (_cache[0] = [\n _createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n \"clip-rule\": \"evenodd\",\n d: \"M6 2a4 4 0 0 0-4 4v12a4 4 0 0 0 4 4h12a4 4 0 0 0 4-4V6a4 4 0 0 0-4-4H6Zm6.827 8.927c1.473.394 2.567 1.196 2.567 2.61 0 1.344-.936 2.313-2.244 2.63-.342.083-.614.368-.614.72v.18a.496.496 0 0 1-.992 0v-.215c0-.354-.264-.646-.602-.75-.972-.302-1.657-.964-1.932-1.782-.154-.457.253-.855.736-.855.485 0 .856.437 1.161.815.265.328.708.54 1.293.54.919 0 1.43-.539 1.43-1.195 0-.51-.365-.933-1.226-1.167l-1.137-.32c-1.983-.51-2.333-1.707-2.333-2.48 0-1.234.86-2.154 2.034-2.512.324-.1.576-.379.576-.717v-.183a.496.496 0 1 1 .992 0v.174c0 .34.26.62.587.714.941.269 1.618.91 1.871 1.779.133.457-.273.847-.75.847-.474 0-.827-.424-1.134-.793l-.03-.036c-.23-.275-.591-.44-1.04-.44-.773 0-1.327.482-1.327 1.124 0 .262.073.772 1.05 1.035l1.064.277Z\"\n }, null, -1),\n _createElementVNode(\"path\", { d: \"M28 16.832h5.772V14.91H30.21V7.168H28v9.664ZM37.372 14.91V13.06h3.52V11.08h-3.52V9.09h4.012V7.168h-6.222v9.664h6.349V14.91h-4.139ZM49.31 16.832h2.351l-3.575-9.664h-2.407l-3.59 9.664h2.365l.718-2.244h3.407l.732 2.244Zm-3.533-4.152 1.084-3.38 1.098 3.38h-2.182ZM58.785 9.09V7.168h-6.137v9.664h2.21V13.03h3.111v-1.908h-3.11V9.09h3.926ZM60.36 16.832h5.771V14.91H62.57V7.168h-2.21v9.664ZM67.522 16.832h2.21V7.168h-2.21v9.664ZM77.1 7.168v5.484l-3.097-5.484h-2.027v9.664h2.21v-5.554l3.181 5.554h1.943V7.168H77.1ZM89.427 16.832 85.67 11.95l3.223-4.783H86.26l-2.52 3.9v-3.9h-2.21v9.664h2.21v-3.787l2.858 3.787h2.83ZM97.185 7.168h-3.998v9.664h2.21V13.55h1.788c2.252 0 3.266-1.571 3.266-3.184 0-1.599-1.014-3.198-3.266-3.198Zm-.098 4.46h-1.69V9.09h1.704c.816 0 1.126.659 1.126 1.276s-.31 1.262-1.14 1.262ZM107.391 16.832h2.351l-3.576-9.664h-2.407l-3.589 9.664h2.364l.718-2.244h3.407l.732 2.244Zm-3.533-4.152 1.084-3.38 1.098 3.38h-2.182ZM115.68 7.168l-2.281 3.563-2.238-3.563h-2.632l3.772 5.302v4.362h2.225v-4.32l3.786-5.344h-2.632ZM130.237 16.832l-1.182-9.664h-1.887l-2.787 6.045-2.829-6.045h-1.844l-1.197 9.664h2.267l.647-5.484 2.112 4.376h1.689l2.111-4.39.634 5.498h2.266ZM134.163 14.91V13.06h3.52V11.08h-3.52V9.09h4.012V7.168h-6.222v9.664h6.349V14.91h-4.139ZM145.229 7.168v5.484l-3.097-5.484h-2.027v9.664h2.21v-5.554l3.182 5.554h1.942V7.168h-2.21ZM156.163 7.168h-7.334V9.09h2.562v7.742h2.21V9.09h2.562V7.168ZM160.425 17c1.773 0 3.575-.926 3.575-3.001 0-1.754-1.408-2.469-2.787-2.89l-1.014-.308c-.901-.253-.957-.687-.957-.884 0-.533.451-.996 1.14-.996.76 0 1.112.491 1.112 1.066h2.21c0-1.879-1.421-2.987-3.279-2.987-1.929 0-3.421 1.22-3.421 2.96 0 .911.408 2.215 2.548 2.79l1.154.351c.859.28 1.07.631 1.07 1.01 0 .63-.549.996-1.267.996-.76 0-1.38-.477-1.38-1.094h-2.21c0 1.78 1.436 2.987 3.506 2.987Z\" }, null, -1)\n ])))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n fill: \"#1E164B\",\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 60 24\"\n}\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _cache[0] || (_cache[0] = [\n _createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n \"clip-rule\": \"evenodd\",\n d: \"M6.373 2a4 4 0 0 0-4 4v12a4 4 0 0 0 4 4h12a4 4 0 0 0 4-4V6a4 4 0 0 0-4-4h-12Zm6.827 8.927c1.473.394 2.567 1.196 2.567 2.61 0 1.344-.937 2.313-2.244 2.63-.342.083-.615.368-.615.72v.18a.496.496 0 0 1-.991 0v-.215c0-.354-.264-.646-.602-.75-.972-.302-1.657-.964-1.933-1.782-.154-.457.254-.855.736-.855.486 0 .856.437 1.162.815.265.328.708.54 1.293.54.919 0 1.429-.539 1.429-1.195 0-.51-.365-.933-1.225-1.167l-1.137-.32c-1.984-.51-2.334-1.707-2.334-2.48 0-1.234.86-2.154 2.035-2.512.323-.1.576-.379.576-.717v-.183a.496.496 0 1 1 .991 0v.174c0 .34.26.62.588.714.941.269 1.618.91 1.87 1.779.134.457-.272.847-.749.847-.474 0-.828-.424-1.134-.793l-.03-.036c-.23-.275-.592-.44-1.04-.44-.774 0-1.328.482-1.328 1.124 0 .262.073.772 1.05 1.035l1.065.277Z\"\n }, null, -1),\n _createElementVNode(\"path\", { d: \"M59.12 7.177v1.722h-2.66v7.924h-1.947V8.899h-2.66V7.177h7.267ZM47.718 16.991c-2.058 0-3.472-1.274-3.472-2.968h1.946c.014.686.686 1.26 1.582 1.26.868 0 1.442-.476 1.442-1.162 0-.532-.392-.91-1.218-1.162l-1.176-.336c-2.114-.56-2.492-1.834-2.492-2.702 0-1.722 1.484-2.912 3.332-2.912 1.82 0 3.22 1.106 3.22 2.94h-1.946c0-.686-.476-1.218-1.316-1.218-.756 0-1.33.504-1.33 1.148 0 .238.07.742 1.078 1.022l1.078.308c1.456.406 2.73 1.176 2.73 2.814 0 1.918-1.638 2.968-3.458 2.968ZM39.582 16.991c-1.862 0-3.514-1.372-3.514-3.43 0-2.072 1.652-3.444 3.514-3.444 1.862 0 3.514 1.372 3.514 3.444 0 2.058-1.652 3.43-3.514 3.43Zm0-1.708c.91 0 1.652-.714 1.652-1.722 0-1.022-.742-1.736-1.652-1.736-.91 0-1.652.714-1.652 1.736 0 1.008.742 1.722 1.652 1.722ZM32.307 7.177c2.184 0 3.15 1.568 3.15 3.15 0 1.582-.966 3.122-3.15 3.122h-1.988v3.374h-1.946V7.177h3.934Zm-.098 4.564c.938 0 1.288-.728 1.288-1.414 0-.7-.35-1.428-1.26-1.428h-1.918v2.842h1.89Z\" }, null, -1)\n ])))\n}\nexport default { render: render }","<script lang=\"ts\" setup>\n import logger from '@leaflink/snitch';\n import { computed } from 'vue';\n\n import DirectPayLockup from './../../../assets/logos/direct-pay-lockup.svg';\n import FlexPayLockup from './../../../assets/logos/flex-pay-lockup.svg';\n import LeafLinkBrandmark from './../../../assets/logos/leaflink-brandmark.svg';\n import LeafLinkLockup from './../../../assets/logos/leaflink-lockup.svg';\n import MarketplaceBrandmark from './../../../assets/logos/marketplace-brandmark.svg';\n import PaymentsBrandmark from './../../../assets/logos/payments-brandmark.svg';\n import PaymentsLockup from './../../../assets/logos/payments-lockup.svg';\n import PostLockup from './../../../assets/logos/post-lockup.svg';\n\n export interface LogoProps {\n /**\n * brand to use for the logo. This, along with variant, will determine which logo to display.\n */\n brand?: 'leaflink' | 'payments' | 'marketplace' | 'flex-pay' | 'direct-pay' | 'post';\n\n /**\n * What color the logo should be.\n */\n color?: 'purple' | 'white';\n\n /**\n * Which variant of the logo to display.\n */\n variant?: 'lockup' | 'brandmark';\n\n /**\n * Width of the logo.\n */\n width?: string | number;\n\n /**\n * Height of the logo.\n */\n height?: string | number;\n }\n\n const props = withDefaults(defineProps<LogoProps>(), {\n brand: 'leaflink',\n color: 'purple',\n variant: 'lockup',\n width: undefined,\n height: undefined,\n });\n\n const emit = defineEmits<{\n /**\n * Fires when an invalid brand and variant combination is provided.\n */\n (e: 'error', msg: string): void;\n }>();\n\n const DEFAULT_LOGO_ATTRS = {\n LeafLinkLockup: {\n is: LeafLinkLockup,\n width: 139,\n height: 24,\n },\n PaymentsLockup: {\n is: PaymentsLockup,\n width: 164,\n height: 24,\n },\n LeafLinkBrandmark: {\n is: LeafLinkBrandmark,\n width: 29,\n height: 24,\n },\n MarketplaceBrandmark: {\n is: MarketplaceBrandmark,\n width: 24,\n height: 24,\n },\n PaymentsBrandmark: {\n is: PaymentsBrandmark,\n width: 24,\n height: 24,\n },\n DirectPayLockup: {\n is: DirectPayLockup,\n width: 107,\n height: 24,\n },\n FlexPayLockup: {\n is: FlexPayLockup,\n width: 89,\n height: 24,\n },\n PostLockup: {\n is: PostLockup,\n width: 60,\n height: 24,\n },\n };\n\n // Determine which logo to display based on brand and variant & set default sizes for convenience unless explicitly set.\n // Note: Setting default width or height on the SVG element itself will not allow the SVG to scale up above those values.\n const computedLogoAttrs = computed<{ is: string; width: number; height: number }>(() => {\n let attrs;\n\n if (props.brand === 'leaflink' && props.variant === 'lockup') {\n attrs = DEFAULT_LOGO_ATTRS['LeafLinkLockup'];\n }\n\n if (props.brand === 'leaflink' && props.variant === 'brandmark') {\n attrs = DEFAULT_LOGO_ATTRS['LeafLinkBrandmark'];\n }\n\n if (props.brand === 'marketplace' && props.variant === 'brandmark') {\n attrs = DEFAULT_LOGO_ATTRS['MarketplaceBrandmark'];\n }\n\n if (props.brand === 'payments' && props.variant === 'lockup') {\n attrs = DEFAULT_LOGO_ATTRS['PaymentsLockup'];\n }\n\n if (props.brand === 'direct-pay' && props.variant === 'lockup') {\n attrs = DEFAULT_LOGO_ATTRS['DirectPayLockup'];\n }\n\n if (props.brand === 'flex-pay' && props.variant === 'lockup') {\n attrs = DEFAULT_LOGO_ATTRS['FlexPayLockup'];\n }\n\n if (props.brand === 'post' && props.variant === 'lockup') {\n attrs = DEFAULT_LOGO_ATTRS['PostLockup'];\n }\n\n if (['payments', 'direct-pay', 'flex-pay', 'post'].includes(props.brand) && props.variant === 'brandmark') {\n attrs = DEFAULT_LOGO_ATTRS['PaymentsBrandmark'];\n }\n\n if (!attrs) {\n const msg = `Invalid brand and variant combination. There's no ${props.brand.replace(\n '-',\n ' ',\n )} ${props.variant.replace('-', ' ')} logo.`;\n logger.error(msg);\n emit('error', msg);\n\n return;\n }\n\n // If width or height is explicitly set, override the default values but do it individually.\n // SVG's will always maintain their aspect ratio, so setting one will scale the other accordingly, so if a user\n // sends in even ONE of these props, we want to make sure we delete both defaults so the SVG can scale in the\n // expected way.\n if (props.width || props.height) {\n delete attrs.width;\n delete attrs.height;\n if (props.width) {\n attrs.width = props.width;\n }\n if (props.height) {\n attrs.height = props.height;\n }\n }\n\n return attrs;\n });\n</script>\n\n<template>\n <component\n :is=\"computedLogoAttrs.is\"\n v-if=\"computedLogoAttrs\"\n class=\"stash-logo\"\n :class=\"[\n `stash-logo--${props.brand}`,\n `stash-logo--${props.variant}`,\n `stash-logo--${props.color}`,\n {\n 'tw-text-purple-500': props.color === 'purple',\n 'tw-text-white': props.color === 'white',\n },\n ]\"\n data-test=\"stash-logo\"\n fill=\"currentColor\"\n v-bind=\"computedLogoAttrs\"\n />\n</template>\n"],"names":["_hoisted_1","render","_ctx","_cache","_openBlock","_createElementBlock","_createElementVNode","DirectPayLockup","FlexPayLockup","LeafLinkBrandmark","_createStaticVNode","LeafLinkLockup","MarketplaceBrandmark","PaymentsBrandmark","PaymentsLockup","PostLockup","props","__props","emit","__emit","DEFAULT_LOGO_ATTRS","computedLogoAttrs","computed","attrs","msg","logger"],"mappings":"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"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const a = "stash-menus-mount-node", m = {
|
|
2
|
-
install(u, e) {
|
|
3
|
-
const t = (e == null ? void 0 : e.mountNodeId) || a;
|
|
4
|
-
let d = document.getElementById(t);
|
|
5
|
-
d || (d = document.createElement("div"), d.id = t, d.dataset.test = a, e != null && e.mountNodeClass && d.classList.add(e.mountNodeClass), document.body.appendChild(d));
|
|
6
|
-
}
|
|
7
|
-
};
|
|
8
|
-
export {
|
|
9
|
-
a as D,
|
|
10
|
-
m as M
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=MenusPlugin-Bk6UW6o9.js.map
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { defineComponent as U, useCssModule as V, ref as s, computed as f, provide as q, onMounted as J, onUpdated as R, onDeactivated as F, onBeforeUnmount as H, createElementBlock as K, openBlock as k, createElementVNode as m, normalizeClass as I, normalizeStyle as W, renderSlot as A, createBlock as Y, createCommentVNode as Z, withCtx as N, unref as h, createTextVNode as G, createVNode as P, toDisplayString as Q } from "vue";
|
|
2
|
-
import X from "lodash-es/debounce";
|
|
3
|
-
import ee from "lodash-es/uniqueId";
|
|
4
|
-
import { DEBOUNCE as te } from "./constants.js";
|
|
5
|
-
import { t as oe } from "./locale.js";
|
|
6
|
-
import re from "./Dropdown.js";
|
|
7
|
-
import ae from "./Icon.js";
|
|
8
|
-
const se = Object.freeze({
|
|
9
|
-
key: Symbol("TABS_INJECTION_KEY")
|
|
10
|
-
});
|
|
11
|
-
var M = /* @__PURE__ */ ((i) => (i.Line = "line", i.Enclosed = "enclosed", i))(M || {});
|
|
12
|
-
const ie = {
|
|
13
|
-
class: "stash-tabs tw-relative",
|
|
14
|
-
role: "tabList",
|
|
15
|
-
"data-test": "stash-tabs"
|
|
16
|
-
}, ne = ["aria-controls", "aria-expanded", "onClick"], le = ["id"], fe = /* @__PURE__ */ U({
|
|
17
|
-
__name: "Tabs",
|
|
18
|
-
props: {
|
|
19
|
-
activeTab: {},
|
|
20
|
-
variant: { default: M.Line }
|
|
21
|
-
},
|
|
22
|
-
emits: ["update:activeTab"],
|
|
23
|
-
setup(i, { emit: O }) {
|
|
24
|
-
const B = O, d = i, D = V(), l = s(), c = s(), n = s(void 0), S = "IntersectionObserver" in window, a = s(/* @__PURE__ */ new Set()), g = s(0), E = s(), x = ee("more-dropdown-menu-"), u = s(!1), v = f({
|
|
25
|
-
get() {
|
|
26
|
-
return d.activeTab;
|
|
27
|
-
},
|
|
28
|
-
set(t) {
|
|
29
|
-
B("update:activeTab", t);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
function $(t) {
|
|
33
|
-
v.value = t;
|
|
34
|
-
}
|
|
35
|
-
q(se.key, {
|
|
36
|
-
activeTab: f(() => v.value),
|
|
37
|
-
variant: f(() => d.variant),
|
|
38
|
-
setActiveTab: $
|
|
39
|
-
});
|
|
40
|
-
function y() {
|
|
41
|
-
var p, L, T;
|
|
42
|
-
if (!S || !l.value)
|
|
43
|
-
return;
|
|
44
|
-
const t = Array.from((p = l.value) == null ? void 0 : p.children), _ = {
|
|
45
|
-
root: l.value,
|
|
46
|
-
rootMargin: "0px",
|
|
47
|
-
threshold: Array.from({ length: 100 }).map((e, o) => (o + 1) / 100)
|
|
48
|
-
};
|
|
49
|
-
if (n.value = new IntersectionObserver((e) => {
|
|
50
|
-
e.forEach((o) => {
|
|
51
|
-
const r = o.target.getAttribute("id");
|
|
52
|
-
o.intersectionRatio > 0.94 ? a.value.has(r) && a.value.delete(r) : r && !a.value.has(r) && a.value.add(r);
|
|
53
|
-
});
|
|
54
|
-
}, _), t.forEach((e) => {
|
|
55
|
-
var o;
|
|
56
|
-
(o = n.value) == null || o.observe(e), a.value.has(e.getAttribute("id")) ? e.classList.add("tw-invisible") : e.classList.remove("tw-invisible");
|
|
57
|
-
}), g.value = ((T = (L = E.value) == null ? void 0 : L.$el) == null ? void 0 : T.getBoundingClientRect().width) || 0, !c.value)
|
|
58
|
-
return;
|
|
59
|
-
Array.from(c.value.children).forEach((e) => {
|
|
60
|
-
var r;
|
|
61
|
-
const o = e.firstElementChild;
|
|
62
|
-
if (o.className = "", e.className = "", e.classList.add(
|
|
63
|
-
D["menu-tab"],
|
|
64
|
-
"tw-flex",
|
|
65
|
-
"tw-items-center",
|
|
66
|
-
"tw-justify-between",
|
|
67
|
-
"tw-rounded",
|
|
68
|
-
"tw-text-sm",
|
|
69
|
-
"tw-p-1.5",
|
|
70
|
-
"tw-text-left",
|
|
71
|
-
"tw-cursor-pointer",
|
|
72
|
-
"tw-text-ice-700",
|
|
73
|
-
"hover:!tw-bg-ice-200",
|
|
74
|
-
"aria-disabled:tw-text-ice-500",
|
|
75
|
-
"aria-disabled:tw-pointer-events-none",
|
|
76
|
-
"aria-disabled:hover:tw-text-ice-500",
|
|
77
|
-
"aria-disabled:hover:tw-bg-inherit",
|
|
78
|
-
"aria-disabled:hover:tw-cursor-default",
|
|
79
|
-
"aria-selected:tw-bg-blue-100"
|
|
80
|
-
), (r = e.querySelector(".stash-tabs__dropdown-selected-tab-icon")) == null || r.remove(), e.getAttribute("id") === `tab-${v.value}`) {
|
|
81
|
-
const b = document.createElement("span");
|
|
82
|
-
b.className = "stash-tabs__dropdown-selected-tab-icon", b.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" class="tw-text-blue-500 tw-w-6 tw-h-6" viewBox="0 0 24 24" fill="none"><path fill="currentColor" fill-rule="evenodd" d="M20.707 6.854 9 18.561l-5.707-5.707 1.414-1.414L9 15.733 19.293 5.44l1.414 1.414Z" clip-rule="evenodd"/></svg>', e.appendChild(b);
|
|
83
|
-
}
|
|
84
|
-
a.value.has(e.getAttribute("id")) ? e.classList.remove("tw-hidden") : e.classList.add("tw-hidden"), e.removeEventListener("click", () => {
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
const z = X(y, te.FAST, { leading: !0 });
|
|
89
|
-
function w() {
|
|
90
|
-
n.value && (n.value.disconnect(), n.value = void 0);
|
|
91
|
-
}
|
|
92
|
-
J(() => {
|
|
93
|
-
y();
|
|
94
|
-
}), R(() => {
|
|
95
|
-
w(), z();
|
|
96
|
-
}), F(() => {
|
|
97
|
-
w();
|
|
98
|
-
}), H(() => {
|
|
99
|
-
w();
|
|
100
|
-
});
|
|
101
|
-
function j(t) {
|
|
102
|
-
t(), u.value = !u.value;
|
|
103
|
-
}
|
|
104
|
-
return (t, _) => (k(), K("div", ie, [
|
|
105
|
-
m("ul", {
|
|
106
|
-
ref_key: "tabListEl",
|
|
107
|
-
ref: l,
|
|
108
|
-
style: W({
|
|
109
|
-
width: `calc(100% - ${g.value}px)`
|
|
110
|
-
}),
|
|
111
|
-
class: I(["stash-tabs-list tw-flex tw-items-end", {
|
|
112
|
-
"stash-tabs-list--line": t.variant === "line",
|
|
113
|
-
"stash-tabs-list--enclosed": t.variant === "enclosed",
|
|
114
|
-
"tw-gap-6": t.variant === "line"
|
|
115
|
-
}])
|
|
116
|
-
}, [
|
|
117
|
-
A(t.$slots, "default"),
|
|
118
|
-
a.value.size ? (k(), Y(re, {
|
|
119
|
-
key: 0,
|
|
120
|
-
ref_key: "moreDropdownEl",
|
|
121
|
-
ref: E,
|
|
122
|
-
class: "!tw-absolute tw-right-0 tw-top-0"
|
|
123
|
-
}, {
|
|
124
|
-
toggle: N(({ toggle: C }) => [
|
|
125
|
-
m("button", {
|
|
126
|
-
"aria-haspopup": "menu",
|
|
127
|
-
"aria-controls": h(x),
|
|
128
|
-
"aria-expanded": u.value,
|
|
129
|
-
class: I(["tw-flex tw-cursor-pointer tw-items-center tw-justify-center tw-border-solid tw-px-6 tw-py-1.5 tw-text-sm tw-font-medium tw-text-blue-500 hover:tw-text-blue-700", { "tw-border-t-4 tw-border-transparent": d.variant === "enclosed" }]),
|
|
130
|
-
type: "button",
|
|
131
|
-
onClick: (p) => j(C)
|
|
132
|
-
}, [
|
|
133
|
-
G(Q(h(oe)("ll.more")) + " ", 1),
|
|
134
|
-
P(ae, { name: "caret-down" })
|
|
135
|
-
], 10, ne)
|
|
136
|
-
]),
|
|
137
|
-
default: N(() => [
|
|
138
|
-
m("ul", {
|
|
139
|
-
id: h(x),
|
|
140
|
-
ref_key: "moreDropdownMenuEl",
|
|
141
|
-
ref: c,
|
|
142
|
-
class: "tw-space-y-1.5 tw-px-1.5 tw-pb-1.5",
|
|
143
|
-
role: "menu"
|
|
144
|
-
}, [
|
|
145
|
-
A(t.$slots, "default")
|
|
146
|
-
], 8, le)
|
|
147
|
-
]),
|
|
148
|
-
_: 3
|
|
149
|
-
}, 512)) : Z("", !0)
|
|
150
|
-
], 6)
|
|
151
|
-
]));
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
export {
|
|
155
|
-
se as T,
|
|
156
|
-
fe as _,
|
|
157
|
-
M as a
|
|
158
|
-
};
|
|
159
|
-
//# sourceMappingURL=Tabs.vue_vue_type_script_setup_true_lang-CmnBP4i1.js.map
|