@leaflink/stash 49.4.1 → 50.0.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/fonts/sofia/SofiaProMedium.otf +0 -0
- package/assets/fonts/sofia/SofiaProRegular.otf +0 -0
- package/assets/fonts/sofia/SofiaProSemiBold.otf +0 -0
- package/dist/Accordion.js +25 -28
- package/dist/Accordion.js.map +1 -1
- package/dist/Accordion.vue.d.ts +16 -16
- package/dist/ActionsDropdown.js +14 -26
- package/dist/ActionsDropdown.js.map +1 -1
- package/dist/ActionsDropdown.vue.d.ts +12 -12
- package/dist/AddressSelect.js +22 -47
- package/dist/AddressSelect.js.map +1 -1
- package/dist/AddressSelect.vue.d.ts +45 -45
- package/dist/Alert.js +4 -6
- package/dist/Alert.js.map +1 -1
- package/dist/Alert.vue.d.ts +18 -18
- package/dist/AppNavigationItem.js +16 -19
- package/dist/AppNavigationItem.js.map +1 -1
- package/dist/AppNavigationItem.vue.d.ts +4 -4
- package/dist/AppSidebar.js +27 -28
- package/dist/AppSidebar.js.map +1 -1
- package/dist/AppSidebar.vue.d.ts +7 -7
- package/dist/AppTopbar.js +12 -17
- package/dist/AppTopbar.js.map +1 -1
- package/dist/AppTopbar.vue.d.ts +8 -8
- package/dist/Avatar.js +1 -1
- package/dist/Avatar.vue.d.ts +22 -22
- package/dist/Backdrop.js +1 -1
- package/dist/Backdrop.vue.d.ts +1 -1
- package/dist/Badge.js +1 -1
- package/dist/Badge.js.map +1 -1
- package/dist/Badge.vue.d.ts +36 -36
- package/dist/Box.js +2 -3
- package/dist/Box.js.map +1 -1
- package/dist/Box.vue.d.ts +12 -12
- package/dist/{Box.vue_vue_type_script_setup_true_lang-69e5176b.js → Box.vue_vue_type_script_setup_true_lang-DgJHq-09.js} +1 -1
- package/dist/{Box.vue_vue_type_script_setup_true_lang-69e5176b.js.map → Box.vue_vue_type_script_setup_true_lang-DgJHq-09.js.map} +1 -1
- package/dist/Button.js +40 -27
- package/dist/Button.js.map +1 -1
- package/dist/Button.vue.d.ts +34 -27
- package/dist/ButtonGroup.js +1 -1
- package/dist/ButtonGroup.vue.d.ts +14 -14
- package/dist/Card.vue.d.ts +3 -3
- package/dist/CardContent.js +1 -1
- package/dist/CardContent.vue.d.ts +1 -1
- package/dist/CardFooter.js +1 -1
- package/dist/CardFooter.vue.d.ts +1 -1
- package/dist/CardMedia.js +11 -14
- package/dist/CardMedia.js.map +1 -1
- package/dist/Carousel.js +179 -180
- package/dist/Carousel.js.map +1 -1
- package/dist/Carousel.vue.d.ts +33 -11
- package/dist/Checkbox.js +38 -35
- package/dist/Checkbox.js.map +1 -1
- package/dist/Checkbox.vue.d.ts +31 -31
- package/dist/ChevronToggle.js +2 -10
- package/dist/ChevronToggle.js.map +1 -1
- package/dist/ChevronToggle.vue.d.ts +5 -5
- package/dist/{ChevronToggle.vue_vue_type_script_setup_true_lang-fcdf0c19.js → ChevronToggle.vue_vue_type_script_setup_true_lang-DuvluoTi.js} +1 -1
- package/dist/{ChevronToggle.vue_vue_type_script_setup_true_lang-fcdf0c19.js.map → ChevronToggle.vue_vue_type_script_setup_true_lang-DuvluoTi.js.map} +1 -1
- package/dist/Chip.js +17 -20
- package/dist/Chip.js.map +1 -1
- package/dist/Chip.vue.d.ts +32 -32
- package/dist/ConfirmationCodeInput.js +1 -1
- package/dist/ConfirmationCodeInput.js.map +1 -1
- package/dist/ConfirmationCodeInput.vue.d.ts +29 -29
- package/dist/ContextSwitcher.js +8 -14
- package/dist/ContextSwitcher.js.map +1 -1
- package/dist/ContextSwitcher.vue.d.ts +32 -32
- package/dist/Copy.js +23 -34
- package/dist/Copy.js.map +1 -1
- package/dist/Copy.vue.d.ts +9 -9
- package/dist/CurrencyInput.js +117 -128
- package/dist/CurrencyInput.js.map +1 -1
- package/dist/CurrencyInput.vue.d.ts +26 -21
- package/dist/CustomRender.vue.d.ts +12 -1
- package/dist/DataView.js +70 -73
- package/dist/DataView.js.map +1 -1
- package/dist/{DataView.vue_used_vue_type_style_index_0_lang.module-5c180dba.js → DataView.keys-C7eaZg2G.js} +5 -8
- package/dist/DataView.keys-C7eaZg2G.js.map +1 -0
- package/dist/DataView.vue.d.ts +51 -51
- package/dist/DataViewFilters.js +76 -90
- package/dist/DataViewFilters.js.map +1 -1
- package/dist/{DataViewFilters.keys-c80ffabe.js → DataViewFilters.keys-BLu07FiP.js} +1 -1
- package/dist/{DataViewFilters.keys-c80ffabe.js.map → DataViewFilters.keys-BLu07FiP.js.map} +1 -1
- package/dist/DataViewFilters.vue.d.ts +39 -39
- package/dist/DataViewSortButton.js +30 -43
- package/dist/DataViewSortButton.js.map +1 -1
- package/dist/DataViewSortButton.vue.d.ts +3 -3
- package/dist/DataViewToolbar.js +27 -36
- package/dist/DataViewToolbar.js.map +1 -1
- package/dist/DataViewToolbar.vue.d.ts +17 -17
- package/dist/DatePicker.js +649 -662
- package/dist/DatePicker.js.map +1 -1
- package/dist/DatePicker.vue.d.ts +73 -73
- package/dist/DescriptionList.js +1 -1
- package/dist/{DescriptionList.keys-c906ce05.js → DescriptionList.keys-BHlHYV6b.js} +1 -1
- package/dist/{DescriptionList.keys-c906ce05.js.map → DescriptionList.keys-BHlHYV6b.js.map} +1 -1
- package/dist/DescriptionList.vue.d.ts +6 -6
- package/dist/DescriptionListDetail.js +1 -1
- package/dist/DescriptionListDetail.vue.d.ts +1 -1
- package/dist/DescriptionListGroup.js +1 -1
- package/dist/DescriptionListGroup.vue.d.ts +1 -1
- package/dist/DescriptionListTerm.js +1 -1
- package/dist/DescriptionListTerm.vue.d.ts +1 -1
- package/dist/Dialog.js +26 -30
- package/dist/Dialog.js.map +1 -1
- package/dist/Dialog.vue.d.ts +34 -34
- package/dist/Divider.js +1 -1
- package/dist/Divider.js.map +1 -1
- package/dist/Divider.vue.d.ts +1 -1
- package/dist/Dropdown.js +21 -28
- package/dist/Dropdown.js.map +1 -1
- package/dist/Dropdown.vue.d.ts +28 -28
- package/dist/EmptyState.js +32 -33
- package/dist/EmptyState.js.map +1 -1
- package/dist/EmptyState.vue.d.ts +36 -36
- package/dist/Expand.js +2 -3
- package/dist/Expand.js.map +1 -1
- package/dist/Expand.vue.d.ts +14 -14
- package/dist/{Expand.vue_vue_type_script_setup_true_lang-0f236267.js → Expand.vue_vue_type_script_setup_true_lang-D0fSAtHr.js} +1 -1
- package/dist/{Expand.vue_vue_type_script_setup_true_lang-0f236267.js.map → Expand.vue_vue_type_script_setup_true_lang-D0fSAtHr.js.map} +1 -1
- package/dist/Field.js +2 -7
- package/dist/Field.js.map +1 -1
- package/dist/Field.vue.d.ts +30 -30
- package/dist/{Field.vue_vue_type_script_setup_true_lang-fded4f75.js → Field.vue_vue_type_script_setup_true_lang-DjxUvSRF.js} +2 -2
- package/dist/{Field.vue_vue_type_script_setup_true_lang-fded4f75.js.map → Field.vue_vue_type_script_setup_true_lang-DjxUvSRF.js.map} +1 -1
- package/dist/FileUpload.js +58 -57
- package/dist/FileUpload.js.map +1 -1
- package/dist/FileUpload.vue.d.ts +28 -28
- package/dist/FilterChip.js +12 -17
- package/dist/FilterChip.js.map +1 -1
- package/dist/FilterChip.vue.d.ts +19 -19
- package/dist/FilterDrawerItem.js +24 -30
- package/dist/FilterDrawerItem.js.map +1 -1
- package/dist/FilterDrawerItem.vue.d.ts +2 -2
- package/dist/FilterDropdown.js +41 -57
- package/dist/FilterDropdown.js.map +1 -1
- package/dist/FilterDropdown.vue.d.ts +9 -9
- package/dist/FilterSelect.js +36 -45
- package/dist/FilterSelect.js.map +1 -1
- package/dist/FilterSelect.vue.d.ts +5 -5
- package/dist/Filters.js +60 -96
- package/dist/Filters.js.map +1 -1
- package/dist/Filters.vue.d.ts +2005 -2294
- package/dist/HttpError.js +16 -23
- package/dist/HttpError.js.map +1 -1
- package/dist/HttpError.vue.d.ts +18 -18
- package/dist/Icon.js +27 -22
- package/dist/Icon.js.map +1 -1
- package/dist/Icon.vue.d.ts +13 -13
- package/dist/IconLabel.js +9 -12
- package/dist/IconLabel.js.map +1 -1
- package/dist/IconLabel.vue.d.ts +17 -17
- package/dist/Illustration.js +8 -11
- package/dist/Illustration.js.map +1 -1
- package/dist/Illustration.vue.d.ts +21 -21
- package/dist/{Illustration.vue_vue_type_script_setup_true_lang-e26c3841.js → Illustration.vue_vue_type_script_setup_true_lang-C3qG3Ty6.js} +2 -2
- package/dist/{Illustration.vue_vue_type_script_setup_true_lang-e26c3841.js.map → Illustration.vue_vue_type_script_setup_true_lang-C3qG3Ty6.js.map} +1 -1
- package/dist/Image.js.map +1 -1
- package/dist/Image.vue.d.ts +18 -18
- package/dist/InlineEdit.js +19 -30
- package/dist/InlineEdit.js.map +1 -1
- package/dist/InlineEdit.vue.d.ts +26 -26
- package/dist/Input.js +58 -64
- package/dist/Input.js.map +1 -1
- package/dist/Input.vue.d.ts +44 -36
- package/dist/InputOptions.js +66 -93
- package/dist/InputOptions.js.map +1 -1
- package/dist/InputOptions.vue.d.ts +66 -58
- package/dist/IntegrationIcon.js +2 -2
- package/dist/IntegrationIcon.js.map +1 -1
- package/dist/IntegrationIcon.vue.d.ts +12 -12
- package/dist/Label.js +2 -5
- package/dist/Label.js.map +1 -1
- package/dist/Label.vue.d.ts +17 -17
- package/dist/{Label.vue_vue_type_script_setup_true_lang-b6ba2f02.js → Label.vue_vue_type_script_setup_true_lang-C4JKdqvC.js} +1 -1
- package/dist/{Label.vue_vue_type_script_setup_true_lang-b6ba2f02.js.map → Label.vue_vue_type_script_setup_true_lang-C4JKdqvC.js.map} +1 -1
- package/dist/LicenseChip.js +10 -16
- package/dist/LicenseChip.js.map +1 -1
- package/dist/LicenseChip.vue.d.ts +3 -3
- package/dist/ListItem.js +5 -8
- package/dist/ListItem.js.map +1 -1
- package/dist/ListItem.vue.d.ts +275 -225
- package/dist/ListItemCell.js +1 -1
- package/dist/ListItemCell.js.map +1 -1
- package/dist/ListItemCell.vue.d.ts +13 -2
- package/dist/ListView.js +57 -101
- package/dist/ListView.js.map +1 -1
- package/dist/ListView.vue.d.ts +5185 -5430
- package/dist/Loading.js +12 -10
- package/dist/Loading.js.map +1 -1
- package/dist/Loading.vue.d.ts +1 -1
- package/dist/Logo.js +2 -4
- package/dist/Logo.js.map +1 -1
- package/dist/Logo.vue.d.ts +17 -17
- package/dist/{Logo.vue_vue_type_script_setup_true_lang-2a2597cb.js → Logo.vue_vue_type_script_setup_true_lang-BfUU9J9O.js} +1 -1
- package/dist/{Logo.vue_vue_type_script_setup_true_lang-2a2597cb.js.map → Logo.vue_vue_type_script_setup_true_lang-BfUU9J9O.js.map} +1 -1
- package/dist/Menu.js +1 -1
- package/dist/Menu.vue.d.ts +1 -1
- package/dist/MenuItem.js +1 -1
- package/dist/MenuItem.vue.d.ts +1 -1
- package/dist/{MenusPlugin-9288029a.js → MenusPlugin-Bk6UW6o9.js} +1 -1
- package/dist/{MenusPlugin-9288029a.js.map → MenusPlugin-Bk6UW6o9.js.map} +1 -1
- package/dist/Metric.vue.d.ts +10 -10
- package/dist/Modal.js +27 -32
- package/dist/Modal.js.map +1 -1
- package/dist/Modal.vue.d.ts +42 -42
- package/dist/Modals.js +14 -16
- package/dist/Modals.js.map +1 -1
- package/dist/Modals.vue.d.ts +1 -1
- package/dist/ModalsPlugin.js +9 -12
- package/dist/ModalsPlugin.js.map +1 -1
- package/dist/Module.js +3 -3
- package/dist/{Module.keys-2cc7d830.js → Module.keys-CEsrW2f0.js} +1 -1
- package/dist/{Module.keys-2cc7d830.js.map → Module.keys-CEsrW2f0.js.map} +1 -1
- package/dist/{Module.types-3f78f2a0.js → Module.types-B1FfGGac.js} +1 -1
- package/dist/{Module.types-3f78f2a0.js.map → Module.types-B1FfGGac.js.map} +1 -1
- package/dist/Module.vue.d.ts +3 -3
- package/dist/ModuleContent.js +2 -2
- package/dist/ModuleContent.vue.d.ts +1 -1
- package/dist/ModuleFooter.js +2 -2
- package/dist/ModuleFooter.vue.d.ts +1 -1
- package/dist/ModuleHeader.js +3 -3
- package/dist/ModuleHeader.vue.d.ts +15 -15
- package/dist/ObfuscateText.js +8 -13
- package/dist/ObfuscateText.js.map +1 -1
- package/dist/ObfuscateText.vue.d.ts +18 -18
- package/dist/PageContent.js +1 -1
- package/dist/PageContent.vue.d.ts +1 -1
- package/dist/PageHeader.js +26 -23
- package/dist/PageHeader.js.map +1 -1
- package/dist/PageHeader.vue.d.ts +7 -4
- package/dist/PageNavigation.js +41 -64
- package/dist/PageNavigation.js.map +1 -1
- package/dist/PageNavigation.vue.d.ts +10 -10
- package/dist/Paginate.js +36 -34
- package/dist/Paginate.js.map +1 -1
- package/dist/Paginate.vue.d.ts +11 -11
- package/dist/PlaidLink.js +3 -5
- package/dist/PlaidLink.js.map +1 -1
- package/dist/PlaidLink.vue.d.ts +29 -29
- package/dist/QuickAction.js +12 -15
- package/dist/QuickAction.js.map +1 -1
- package/dist/QuickAction.vue.d.ts +1 -1
- package/dist/Radio.js +1 -1
- package/dist/Radio.js.map +1 -1
- package/dist/Radio.vue.d.ts +83 -12
- package/dist/RadioGroup.js +41 -45
- package/dist/RadioGroup.js.map +1 -1
- package/dist/{RadioGroup.keys-974818d6.js → RadioGroup.keys-CqfiKkNz.js} +1 -1
- package/dist/{RadioGroup.keys-974818d6.js.map → RadioGroup.keys-CqfiKkNz.js.map} +1 -1
- package/dist/RadioGroup.vue.d.ts +30 -30
- package/dist/RadioNew.js +2 -2
- package/dist/RadioNew.js.map +1 -1
- package/dist/RadioNew.vue.d.ts +26 -26
- package/dist/RangeInput.js +10 -14
- package/dist/RangeInput.js.map +1 -1
- package/dist/RangeInput.vue.d.ts +1 -1
- package/dist/SearchBar.js +31 -41
- package/dist/SearchBar.js.map +1 -1
- package/dist/SearchBar.vue.d.ts +22 -22
- package/dist/Select.js +66 -78
- package/dist/Select.js.map +1 -1
- package/dist/Select.vue.d.ts +123 -123
- package/dist/SelectStatus.js +47 -69
- package/dist/SelectStatus.js.map +1 -1
- package/dist/SelectStatus.vue.d.ts +33 -26
- package/dist/Skeleton.js +1 -1
- package/dist/Skeleton.js.map +1 -1
- package/dist/Skeleton.vue.d.ts +9 -9
- package/dist/Step.js +10 -14
- package/dist/Step.js.map +1 -1
- package/dist/Step.vue.d.ts +21 -21
- package/dist/Stepper.js +37 -40
- package/dist/Stepper.js.map +1 -1
- package/dist/Stepper.vue.d.ts +34 -29
- package/dist/Switch.js +1 -1
- package/dist/Switch.vue.d.ts +23 -23
- package/dist/Tab.js +21 -36
- package/dist/Tab.js.map +1 -1
- package/dist/Table.js +38 -55
- package/dist/Table.js.map +1 -1
- package/dist/Table.keys-LHQf6FEH.js +7 -0
- package/dist/{Table.keys-83e4f09b.js.map → Table.keys-LHQf6FEH.js.map} +1 -1
- package/dist/Table.vue.d.ts +36 -36
- package/dist/TableCell.js +26 -26
- package/dist/TableCell.js.map +1 -1
- package/dist/TableCell.vue.d.ts +6 -6
- package/dist/TableHeaderCell.js +6 -13
- package/dist/TableHeaderCell.js.map +1 -1
- package/dist/TableHeaderCell.vue.d.ts +3 -3
- package/dist/TableHeaderRow.js +22 -32
- package/dist/TableHeaderRow.js.map +1 -1
- package/dist/TableHeaderRow.vue.d.ts +8 -8
- package/dist/TableRow.js +59 -59
- package/dist/TableRow.js.map +1 -1
- package/dist/TableRow.vue.d.ts +26 -26
- package/dist/Tabs.js +10 -24
- package/dist/Tabs.js.map +1 -1
- package/dist/Tabs.vue.d.ts +5 -5
- package/dist/{Tabs.vue_used_vue_type_style_index_0_lang.module-d7530989.js → Tabs.vue_vue_type_script_setup_true_lang-l41hWkV4.js} +31 -34
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-l41hWkV4.js.map +1 -0
- package/dist/TextEditor.js +1269 -1364
- package/dist/TextEditor.js.map +1 -1
- package/dist/TextEditor.vue.d.ts +46 -46
- package/dist/Textarea.js +30 -31
- package/dist/Textarea.js.map +1 -1
- package/dist/Textarea.vue.d.ts +34 -26
- package/dist/Timeline.js +9 -10
- package/dist/Timeline.js.map +1 -1
- package/dist/Timeline.vue.d.ts +6 -6
- package/dist/TimelineItem.js +1 -1
- package/dist/TimelineItem.vue.d.ts +1 -1
- package/dist/Toast.js +5 -9
- package/dist/Toast.js.map +1 -1
- package/dist/Toast.vue.d.ts +3 -3
- package/dist/Toasts.js +15 -25
- package/dist/Toasts.js.map +1 -1
- package/dist/Toasts.vue.d.ts +1 -1
- package/dist/ToastsPlugin.js +11 -23
- package/dist/ToastsPlugin.js.map +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/Tooltip.js.map +1 -1
- package/dist/Tooltip.vue.d.ts +15 -15
- package/dist/{_commonjsHelpers-10dfc225.js → _commonjsHelpers-DaMA6jEr.js} +1 -1
- package/dist/_commonjsHelpers-DaMA6jEr.js.map +1 -0
- package/dist/{_plugin-vue_export-helper-dad06003.js → _plugin-vue_export-helper-CHgC5LLL.js} +1 -1
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js.map +1 -0
- package/dist/{colors-8d9b9429.js → colors-DDDVvqfQ.js} +1 -1
- package/dist/{colors-8d9b9429.js.map → colors-DDDVvqfQ.js.map} +1 -1
- package/dist/components.css +2 -2
- package/dist/directives/observe.js.map +1 -1
- package/dist/directives/sticky.js.map +1 -1
- package/dist/directives/tooltip.js +21 -27
- package/dist/directives/tooltip.js.map +1 -1
- package/dist/directives/viewable.js +1 -1
- package/dist/directives/viewable.js.map +1 -1
- package/dist/{floating-ui.vue-8d7f7932.js → floating-ui.vue-BmfQDqE-.js} +2 -3
- package/dist/{floating-ui.vue-8d7f7932.js.map → floating-ui.vue-BmfQDqE-.js.map} +1 -1
- package/dist/{formatDateTime-a5e70901.js → formatDateTime-C8CYECpd.js} +8 -12
- package/dist/{formatDateTime-a5e70901.js.map → formatDateTime-C8CYECpd.js.map} +1 -1
- package/dist/{index-9e1095ef.js → index-D6bxWkZ1.js} +2 -3
- package/dist/{index-9e1095ef.js.map → index-D6bxWkZ1.js.map} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +90 -112
- package/dist/index.js.map +1 -1
- package/dist/{isDefined-2ce6cde4.js → isDefined-DzVx0B6k.js} +1 -1
- package/dist/{isDefined-2ce6cde4.js.map → isDefined-DzVx0B6k.js.map} +1 -1
- package/dist/{isValid-4b2b7a54.js → isValid-DN-HkCoi.js} +1 -1
- package/dist/{isValid-4b2b7a54.js.map → isValid-DN-HkCoi.js.map} +1 -1
- package/dist/{keys-241d03b7.js → keys-BEdEsanp.js} +1 -1
- package/dist/{keys-241d03b7.js.map → keys-BEdEsanp.js.map} +1 -1
- package/dist/{keys-7ecef029.js → keys-C8Zfr_By.js} +1 -1
- package/dist/{keys-7ecef029.js.map → keys-C8Zfr_By.js.map} +1 -1
- package/dist/{misc-76697f61.js → misc-CHQs-G03.js} +1 -1
- package/dist/{misc-76697f61.js.map → misc-CHQs-G03.js.map} +1 -1
- package/dist/{parseISO-ed4094c1.js → parseISO-wlfIB_QJ.js} +12 -18
- package/dist/{parseISO-ed4094c1.js.map → parseISO-wlfIB_QJ.js.map} +1 -1
- package/dist/{searchFuzzy-9b74ec4e.js → searchFuzzy-DKooyZM8.js} +110 -149
- package/dist/{searchFuzzy-9b74ec4e.js.map → searchFuzzy-DKooyZM8.js.map} +1 -1
- package/dist/{statusLevels-a8b041f4.js → statusLevels-D8EgtE_L.js} +1 -1
- package/dist/{statusLevels-a8b041f4.js.map → statusLevels-D8EgtE_L.js.map} +1 -1
- package/dist/storage.js +8 -15
- package/dist/storage.js.map +1 -1
- package/dist/tailwind-base.js.map +1 -1
- package/dist/{toTimeZone-a2ed6470.js → toTimeZone-CVE1ZmsS.js} +1 -1
- package/dist/{toTimeZone-a2ed6470.js.map → toTimeZone-CVE1ZmsS.js.map} +1 -1
- package/dist/useDialog.js +7 -7
- package/dist/useGoogleMaps.js +18 -28
- package/dist/useGoogleMaps.js.map +1 -1
- package/dist/useModals.js +1 -2
- package/dist/useModals.js.map +1 -1
- package/dist/useScriptTag.js.map +1 -1
- package/dist/useSearch.js +14 -19
- package/dist/useSearch.js.map +1 -1
- package/dist/useStepper.js.map +1 -1
- package/dist/useValidation.js +1 -1
- package/dist/useValidation.js.map +1 -1
- package/dist/utils/calculateElementOverflow.js +9 -13
- package/dist/utils/calculateElementOverflow.js.map +1 -1
- package/dist/utils/colorScheme.js.map +1 -1
- package/dist/utils/createQueryString.js +4 -5
- package/dist/utils/createQueryString.js.map +1 -1
- package/dist/utils/createValidDate.js +2 -2
- package/dist/utils/formatDateTime.js +4 -5
- package/dist/utils/formatDateTime.js.map +1 -1
- package/dist/utils/getContrastingTextColor.js +1 -1
- package/dist/utils/getContrastingTextColor.js.map +1 -1
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/i18n.js +25 -26
- package/dist/utils/i18n.js.map +1 -1
- package/dist/utils/normalizeDate.js +1 -1
- package/dist/utils/searchFuzzy.js +3 -10
- package/dist/utils/searchFuzzy.js.map +1 -1
- package/dist/utils/storage.js +6 -11
- package/dist/utils/storage.js.map +1 -1
- package/dist/utils/toTimeZone.js +2 -3
- package/dist/utils/toTimeZone.js.map +1 -1
- package/package.json +13 -14
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-4dabc2a9.js +0 -17
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-4dabc2a9.js.map +0 -1
- package/dist/Carousel.types.d.ts +0 -33
- package/dist/Carousel.types.js +0 -2
- package/dist/Carousel.types.js.map +0 -1
- package/dist/Checkbox.vue_used_vue_type_style_index_0_lang.module-fa8d9c06.js +0 -9
- package/dist/Checkbox.vue_used_vue_type_style_index_0_lang.module-fa8d9c06.js.map +0 -1
- package/dist/DataView.vue_used_vue_type_style_index_0_lang.module-5c180dba.js.map +0 -1
- package/dist/EmptyState.vue_used_vue_type_style_index_0_lang.module-f5d89366.js +0 -8
- package/dist/EmptyState.vue_used_vue_type_style_index_0_lang.module-f5d89366.js.map +0 -1
- package/dist/Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js +0 -11
- package/dist/Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js.map +0 -1
- package/dist/Loading.vue_used_vue_type_style_index_0_lang.module-ef5a3bc6.js +0 -8
- package/dist/Loading.vue_used_vue_type_style_index_0_lang.module-ef5a3bc6.js.map +0 -1
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-18343da7.js +0 -11
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-18343da7.js.map +0 -1
- package/dist/Table.keys-83e4f09b.js +0 -27
- package/dist/Tabs.vue_used_vue_type_style_index_0_lang.module-d7530989.js.map +0 -1
- package/dist/_commonjsHelpers-10dfc225.js.map +0 -1
- package/dist/_plugin-vue_export-helper-dad06003.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as d, inject as u, computed as c, openBlock as h, createBlock as y, unref as k, normalizeClass as f } from "vue";
|
|
2
2
|
import v from "lodash-es/uniqueId";
|
|
3
|
-
import { I as b } from "./index-
|
|
3
|
+
import { I as b } from "./index-D6bxWkZ1.js";
|
|
4
4
|
var l = /* @__PURE__ */ ((r) => (r.Approved = "approved", r.Avatar = "avatar", r.Barcode = "barcode", r.Calendar = "calendar", r.Cartridge = "cartridge", r.Celebrate = "celebrate", r.ChatBubble = "chat-bubble", r.CheckBox = "check-box", r.CheckCircle = "check-circle", r.Click = "click", r.Cocktail = "cocktail", r.Confirmation = "confirmation", r.Connnect = "connnect", r.Cookie = "cookie", r.CreditCard = "credit-card", r.Crm = "crm", r.Cultivation = "cultivation", r.Data = "data", r.DeliveryCompleted = "delivery-completed", r.Delivery = "delivery", r.DigitalPayments = "digital-payments", r.Discover = "discover", r.Diversity = "diversity", r.Drink = "drink", r.Dolly = "dolly", r.EasyReconciliations = "easy-reconciliations", r.Efficiency = "efficiency", r.Error = "error", r.ExtendDate = "extend-date", r.FinancialGrowth = "financial-growth", r.FinancialInstitution = "financial-institution", r.Focus = "focus", r.FulfillmentIssues = "fulfillment-issues", r.Growth = "growth", r.Handshake = "handshake", r.Hierarchy = "hierarchy", r.Home = "home", r.Laptop = "laptop", r.Licenses = "licenses", r.LightBulb = "light-bulb", r.LightbulbError = "lightbulb-error", r.LineChart = "line-chart", r.Link = "link", r.LocationPin = "location-pin", r.Lock = "lock", r.Messaging = "messaging", r.Microchip = "microchip", r.MissingData = "missing-data", r.MoneyTransfer = "money-transfer", r.Money = "money", r.NoInventoryAccess = "no-inventory-access", r.NoInventory = "no-inventory", r.NoPromote = "no-promote", r.PackageReceived = "package-received", r.Package = "package", r.PaymentProcessing = "payment-processing", r.Phone = "phone", r.PieChart = "pie-chart", r.ProductCycle = "product-cycle", r.Puzzle = "puzzle", r.Receipt = "receipt", r.Retail = "retail", r.SearchingDocument = "searching-document", r.ShoppingBasket = "shopping-basket", r.Shopping = "shopping", r.Sign = "sign", r.Smile = "smile", r.Speed = "speed", r.Time = "time", r.Tools = "tools", r.Truck = "truck", r.User = "user", r.Warehouse = "warehouse", r.Warning = "warning", r.XCircle = "x-circle", r))(l || {});
|
|
5
5
|
const C = Object.values(l);
|
|
6
6
|
var o = /* @__PURE__ */ ((r) => (r.Api = "api", r.Bank = "bank", r.Basket = "basket", r.BrandMenu = "brand-menu", r.Calendar = "calendar", r.Dashboard = "dashboard", r.Deals = "deals", r.DocumentSearch = "document-search", r.Edit = "edit", r.EmptyTray = "empty-tray", r.Graph = "graph", r.Integrations = "integrations", r.LightBulb = "light-bulb", r.Map = "map", r.Megaphone = "megaphone", r.Messages = "messages", r.MoneyBank = "money-bank", r.Notifications = "notifications", r.OrdersEmpty = "orders-empty", r.Payments = "payments", r.PieChart = "pie-chart", r.ProductCards = "product-cards", r.ProductDisplay = "product-display", r.Search = "search", r.SearchStorefront = "search-storefront", r.Store = "store", r.Todo = "todo", r.Truck = "truck", r.Users = "users", r.Warehouse = "warehouse", r.WarehouseDelivery = "warehouse-delivery", r))(o || {});
|
|
@@ -53,4 +53,4 @@ export {
|
|
|
53
53
|
C as s,
|
|
54
54
|
g as v
|
|
55
55
|
};
|
|
56
|
-
//# sourceMappingURL=Illustration.vue_vue_type_script_setup_true_lang-
|
|
56
|
+
//# sourceMappingURL=Illustration.vue_vue_type_script_setup_true_lang-C3qG3Ty6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Illustration.vue_vue_type_script_setup_true_lang-e26c3841.js","sources":["../src/components/Illustration/Illustration.models.ts","../src/components/Illustration/Illustration.vue"],"sourcesContent":["/**\n * Enum to strongly map between a friendly name and file name of the illustration\n */\nexport enum SpotName {\n Approved = 'approved',\n Avatar = 'avatar',\n Barcode = 'barcode',\n Calendar = 'calendar',\n Cartridge = 'cartridge',\n Celebrate = 'celebrate',\n ChatBubble = 'chat-bubble',\n CheckBox = 'check-box',\n CheckCircle = 'check-circle',\n Click = 'click',\n Cocktail = 'cocktail',\n Confirmation = 'confirmation',\n Connnect = 'connnect',\n Cookie = 'cookie',\n CreditCard = 'credit-card',\n Crm = 'crm',\n Cultivation = 'cultivation',\n Data = 'data',\n DeliveryCompleted = 'delivery-completed',\n Delivery = 'delivery',\n DigitalPayments = 'digital-payments',\n Discover = 'discover',\n Diversity = 'diversity',\n Drink = 'drink',\n Dolly = 'dolly',\n EasyReconciliations = 'easy-reconciliations',\n Efficiency = 'efficiency',\n Error = 'error',\n ExtendDate = 'extend-date',\n FinancialGrowth = 'financial-growth',\n FinancialInstitution = 'financial-institution',\n Focus = 'focus',\n FulfillmentIssues = 'fulfillment-issues',\n Growth = 'growth',\n Handshake = 'handshake',\n Hierarchy = 'hierarchy',\n Home = 'home',\n Laptop = 'laptop',\n Licenses = 'licenses',\n LightBulb = 'light-bulb',\n LightbulbError = 'lightbulb-error',\n LineChart = 'line-chart',\n Link = 'link',\n LocationPin = 'location-pin',\n Lock = 'lock',\n Messaging = 'messaging',\n Microchip = 'microchip',\n MissingData = 'missing-data',\n MoneyTransfer = 'money-transfer',\n Money = 'money',\n NoInventoryAccess = 'no-inventory-access',\n NoInventory = 'no-inventory',\n NoPromote = 'no-promote',\n PackageReceived = 'package-received',\n Package = 'package',\n PaymentProcessing = 'payment-processing',\n Phone = 'phone',\n PieChart = 'pie-chart',\n ProductCycle = 'product-cycle',\n Puzzle = 'puzzle',\n Receipt = 'receipt',\n Retail = 'retail',\n SearchingDocument = 'searching-document',\n ShoppingBasket = 'shopping-basket',\n Shopping = 'shopping',\n Sign = 'sign',\n Smile = 'smile',\n Speed = 'speed',\n Time = 'time',\n Tools = 'tools',\n Truck = 'truck',\n User = 'user',\n Warehouse = 'warehouse',\n Warning = 'warning',\n XCircle = 'x-circle',\n}\n\nexport type SpotNames = `${SpotName}`;\n\n/**\n * String array of all illustration names\n */\nexport const spotNames = Object.values(SpotName);\n\nexport enum VignetteName {\n Api = 'api',\n Bank = 'bank',\n Basket = 'basket',\n BrandMenu = 'brand-menu',\n Calendar = 'calendar',\n Dashboard = 'dashboard',\n Deals = 'deals',\n DocumentSearch = 'document-search',\n Edit = 'edit',\n EmptyTray = 'empty-tray',\n Graph = 'graph',\n Integrations = 'integrations',\n LightBulb = 'light-bulb',\n Map = 'map',\n Megaphone = 'megaphone',\n Messages = 'messages',\n MoneyBank = 'money-bank',\n Notifications = 'notifications',\n OrdersEmpty = 'orders-empty',\n Payments = 'payments',\n PieChart = 'pie-chart',\n ProductCards = 'product-cards',\n ProductDisplay = 'product-display',\n Search = 'search',\n SearchStorefront = 'search-storefront',\n Store = 'store',\n Todo = 'todo',\n Truck = 'truck',\n Users = 'users',\n Warehouse = 'warehouse',\n WarehouseDelivery = 'warehouse-delivery',\n}\n\nexport type VignetteNames = `${VignetteName}`;\n\n/**\n * String array of all vignette names\n */\nexport const vignetteNames = Object.values(VignetteName);\n\n/**\n * Types of illustrations that map to the subfolder under ./assets/illustrations/<type>\n */\nexport enum IllustrationType {\n Spot = 'spot',\n Vignette = 'vignette',\n // Scene is not implemented, but adding it for future work mentioned in STASH-61.\n Scene = 'scene',\n}\n\nexport type IllustrationTypes = `${IllustrationType}`;\n","<script lang=\"ts\">\n export * from './Illustration.models';\n</script>\n\n<script lang=\"ts\" setup>\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, inject } from 'vue';\n import InlineSvg from 'vue-inline-svg';\n\n import { StashPrimaryColor, StashPrimaryColorGroup } from '../../../types/colors';\n import { StashProvideState } from '../../../types/misc';\n import {\n IllustrationType,\n IllustrationTypes,\n SpotName,\n SpotNames,\n spotNames,\n VignetteName,\n VignetteNames,\n vignetteNames,\n } from './Illustration.models';\n\n export interface IllustrationProps {\n id?: string;\n\n /**\n * The filename of the icon that should be displayed\n */\n name: SpotNames | VignetteNames;\n\n /**\n * Accessible, short-text description for the icon. Not rendered as part of the graphic, but\n * browsers usually display it as a tooltip and screen readers use this.\n */\n title?: string;\n\n /**\n * The size in pixels of the illustration. This number will be used for width and height\n */\n size?: number;\n\n /**\n * Type of the illustration\n */\n type?: IllustrationTypes;\n\n /**\n * The fill color for the illustration. This component will use the 400 shade of the color\n * per design's request. Defaults to teal.\n */\n fillColor?: StashPrimaryColorGroup;\n\n /**\n * The color theme for the illustration. This component will use the standard 500 shade of the color.\n * Defaults to purple\n */\n strokeColor?: StashPrimaryColor;\n\n /**\n * Illustration's custom static path. It'll default to either the staticPath defined on the library installation or '/static' if none are provided.\n */\n staticPath?: string;\n }\n\n const props = withDefaults(defineProps<IllustrationProps>(), {\n id: uniqueId('ll-illustration-'),\n title: '',\n size: 48,\n type: IllustrationType.Spot,\n fillColor: 'blue',\n strokeColor: 'purple-500',\n staticPath: '',\n });\n\n if (props.type === IllustrationType.Scene) {\n throw new Error(\n 'Scene illustration types are not supported. Illustrations will need to be uploaded under ./assets/illustrations/scene. Illustrations to be provided by design.',\n );\n }\n\n if (\n (props.type === IllustrationType.Spot && !spotNames.includes(props.name as SpotName)) ||\n (props.type === IllustrationType.Vignette && !vignetteNames.includes(props.name as VignetteName))\n ) {\n throw new Error(\n `${props.type} illustration name ${props.name} not found. Did you check that you are using the correct type for your illustration?`,\n );\n }\n\n const stashOptions = inject<Partial<StashProvideState>>('stashOptions', {\n staticPath: '/static',\n });\n\n const isSpotIllustration = computed(() => props.type === IllustrationType.Spot);\n\n /**\n * Browsers won't add the `stroke-width` attribute if it is set to false.\n * However, setting it to specific number value affects vignettes\n */\n const strokeWidth = computed<boolean | string>(() => {\n return isSpotIllustration.value ? '0' : false;\n });\n\n const computedStaticPath = computed(() => {\n return props.staticPath || stashOptions?.staticPath;\n });\n</script>\n\n<template>\n <!-- InlineSvg package (https://github.com/shrpne/vue-inline-svg) swaps external svgs and puts\n them inline so we can style them with CSS -->\n <!-- Having to override fill to be none and stroke to be zero so the exported svgs from Figma\n that do not have those attributes specified do not get a default one applied -->\n <InlineSvg\n :id=\"props.id\"\n class=\"tw-inline-block tw-align-middle\"\n :class=\"{\n [`tw-text-${props.fillColor}-400 tw-stroke-${props.strokeColor}`]: isSpotIllustration,\n }\"\n :title=\"props.title\"\n :height=\"props.size\"\n :width=\"props.size\"\n :stroke-width=\"strokeWidth\"\n fill=\"none\"\n :src=\"`${computedStaticPath}/illustrations/${props.type}/${props.name}.svg`\"\n />\n</template>\n"],"names":["SpotName","spotNames","VignetteName","vignetteNames","IllustrationType","props","__props","stashOptions","inject","isSpotIllustration","computed","strokeWidth","computedStaticPath"],"mappings":";;;AAGY,IAAAA,sBAAAA,OACVA,EAAA,WAAW,YACXA,EAAA,SAAS,UACTA,EAAA,UAAU,WACVA,EAAA,WAAW,YACXA,EAAA,YAAY,aACZA,EAAA,YAAY,aACZA,EAAA,aAAa,eACbA,EAAA,WAAW,aACXA,EAAA,cAAc,gBACdA,EAAA,QAAQ,SACRA,EAAA,WAAW,YACXA,EAAA,eAAe,gBACfA,EAAA,WAAW,YACXA,EAAA,SAAS,UACTA,EAAA,aAAa,eACbA,EAAA,MAAM,OACNA,EAAA,cAAc,eACdA,EAAA,OAAO,QACPA,EAAA,oBAAoB,sBACpBA,EAAA,WAAW,YACXA,EAAA,kBAAkB,oBAClBA,EAAA,WAAW,YACXA,EAAA,YAAY,aACZA,EAAA,QAAQ,SACRA,EAAA,QAAQ,SACRA,EAAA,sBAAsB,wBACtBA,EAAA,aAAa,cACbA,EAAA,QAAQ,SACRA,EA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AA,YAAY,cACZA,EAAA,MAAM,OACNA,EAAA,YAAY,aACZA,EAAA,WAAW,YACXA,EAAA,YAAY,cACZA,EAAA,gBAAgB,iBAChBA,EAAA,cAAc,gBACdA,EAAA,WAAW,YACXA,EAAA,WAAW,aACXA,EAAA,eAAe,iBACfA,EAAA,iBAAiB,mBACjBA,EAAA,SAAS,UACTA,EAAA,mBAAmB,qBACnBA,EAAA,QAAQ,SACRA,EAAA,OAAO,QACPA,EAAA,QAAQ,SACRA,EAAA,QAAQ,SACRA,EAAA,YAAY,aACZA,EAAA,oBAAoB,sBA/BVA,IAAAA,KAAA,CAAA,CAAA;AAuCC,MAAAC,IAAgB,OAAO,OAAOD,CAAY;AAK3C,IAAAE,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,WAAW,YAEXA,EAAA,QAAQ,SAJEA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;ACpEV,UAAMC,IAAQC;AAUV,QAAAD,EAAM,SAASD,EAAiB;AAClC,YAAM,IAAI;AAAA,QACR;AAAA,MAAA;AAIJ,QACGC,EAAM,SAASD,EAAiB,QAAQ,CAACH,EAAU,SAASI,EAAM,IAAgB,KAClFA,EAAM,SAASD,EAAiB,YAAY,CAACD,EAAc,SAASE,EAAM,IAAoB;AAE/F,YAAM,IAAI;AAAA,QACR,GAAGA,EAAM,0BAA0BA,EAAM;AAAA,MAAA;AAIvC,UAAAE,IAAeC,EAAmC,gBAAgB;AAAA,MACtE,YAAY;AAAA,IAAA,CACb,GAEKC,IAAqBC,EAAS,MAAML,EAAM,SAASD,EAAiB,IAAI,GAMxEO,IAAcD,EAA2B,MACtCD,EAAmB,QAAQ,MAAM,EACzC,GAEKG,IAAqBF,EAAS,MAC3BL,EAAM,eAAcE,KAAA,gBAAAA,EAAc,WAC1C;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Illustration.vue_vue_type_script_setup_true_lang-C3qG3Ty6.js","sources":["../src/components/Illustration/Illustration.models.ts","../src/components/Illustration/Illustration.vue"],"sourcesContent":["/**\n * Enum to strongly map between a friendly name and file name of the illustration\n */\nexport enum SpotName {\n Approved = 'approved',\n Avatar = 'avatar',\n Barcode = 'barcode',\n Calendar = 'calendar',\n Cartridge = 'cartridge',\n Celebrate = 'celebrate',\n ChatBubble = 'chat-bubble',\n CheckBox = 'check-box',\n CheckCircle = 'check-circle',\n Click = 'click',\n Cocktail = 'cocktail',\n Confirmation = 'confirmation',\n Connnect = 'connnect',\n Cookie = 'cookie',\n CreditCard = 'credit-card',\n Crm = 'crm',\n Cultivation = 'cultivation',\n Data = 'data',\n DeliveryCompleted = 'delivery-completed',\n Delivery = 'delivery',\n DigitalPayments = 'digital-payments',\n Discover = 'discover',\n Diversity = 'diversity',\n Drink = 'drink',\n Dolly = 'dolly',\n EasyReconciliations = 'easy-reconciliations',\n Efficiency = 'efficiency',\n Error = 'error',\n ExtendDate = 'extend-date',\n FinancialGrowth = 'financial-growth',\n FinancialInstitution = 'financial-institution',\n Focus = 'focus',\n FulfillmentIssues = 'fulfillment-issues',\n Growth = 'growth',\n Handshake = 'handshake',\n Hierarchy = 'hierarchy',\n Home = 'home',\n Laptop = 'laptop',\n Licenses = 'licenses',\n LightBulb = 'light-bulb',\n LightbulbError = 'lightbulb-error',\n LineChart = 'line-chart',\n Link = 'link',\n LocationPin = 'location-pin',\n Lock = 'lock',\n Messaging = 'messaging',\n Microchip = 'microchip',\n MissingData = 'missing-data',\n MoneyTransfer = 'money-transfer',\n Money = 'money',\n NoInventoryAccess = 'no-inventory-access',\n NoInventory = 'no-inventory',\n NoPromote = 'no-promote',\n PackageReceived = 'package-received',\n Package = 'package',\n PaymentProcessing = 'payment-processing',\n Phone = 'phone',\n PieChart = 'pie-chart',\n ProductCycle = 'product-cycle',\n Puzzle = 'puzzle',\n Receipt = 'receipt',\n Retail = 'retail',\n SearchingDocument = 'searching-document',\n ShoppingBasket = 'shopping-basket',\n Shopping = 'shopping',\n Sign = 'sign',\n Smile = 'smile',\n Speed = 'speed',\n Time = 'time',\n Tools = 'tools',\n Truck = 'truck',\n User = 'user',\n Warehouse = 'warehouse',\n Warning = 'warning',\n XCircle = 'x-circle',\n}\n\nexport type SpotNames = `${SpotName}`;\n\n/**\n * String array of all illustration names\n */\nexport const spotNames = Object.values(SpotName);\n\nexport enum VignetteName {\n Api = 'api',\n Bank = 'bank',\n Basket = 'basket',\n BrandMenu = 'brand-menu',\n Calendar = 'calendar',\n Dashboard = 'dashboard',\n Deals = 'deals',\n DocumentSearch = 'document-search',\n Edit = 'edit',\n EmptyTray = 'empty-tray',\n Graph = 'graph',\n Integrations = 'integrations',\n LightBulb = 'light-bulb',\n Map = 'map',\n Megaphone = 'megaphone',\n Messages = 'messages',\n MoneyBank = 'money-bank',\n Notifications = 'notifications',\n OrdersEmpty = 'orders-empty',\n Payments = 'payments',\n PieChart = 'pie-chart',\n ProductCards = 'product-cards',\n ProductDisplay = 'product-display',\n Search = 'search',\n SearchStorefront = 'search-storefront',\n Store = 'store',\n Todo = 'todo',\n Truck = 'truck',\n Users = 'users',\n Warehouse = 'warehouse',\n WarehouseDelivery = 'warehouse-delivery',\n}\n\nexport type VignetteNames = `${VignetteName}`;\n\n/**\n * String array of all vignette names\n */\nexport const vignetteNames = Object.values(VignetteName);\n\n/**\n * Types of illustrations that map to the subfolder under ./assets/illustrations/<type>\n */\nexport enum IllustrationType {\n Spot = 'spot',\n Vignette = 'vignette',\n // Scene is not implemented, but adding it for future work mentioned in STASH-61.\n Scene = 'scene',\n}\n\nexport type IllustrationTypes = `${IllustrationType}`;\n","<script lang=\"ts\">\n export * from './Illustration.models';\n</script>\n\n<script lang=\"ts\" setup>\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, inject } from 'vue';\n import InlineSvg from 'vue-inline-svg';\n\n import { StashPrimaryColor, StashPrimaryColorGroup } from '../../../types/colors';\n import { StashProvideState } from '../../../types/misc';\n import {\n IllustrationType,\n IllustrationTypes,\n SpotName,\n SpotNames,\n spotNames,\n VignetteName,\n VignetteNames,\n vignetteNames,\n } from './Illustration.models';\n\n export interface IllustrationProps {\n id?: string;\n\n /**\n * The filename of the icon that should be displayed\n */\n name: SpotNames | VignetteNames;\n\n /**\n * Accessible, short-text description for the icon. Not rendered as part of the graphic, but\n * browsers usually display it as a tooltip and screen readers use this.\n */\n title?: string;\n\n /**\n * The size in pixels of the illustration. This number will be used for width and height\n */\n size?: number;\n\n /**\n * Type of the illustration\n */\n type?: IllustrationTypes;\n\n /**\n * The fill color for the illustration. This component will use the 400 shade of the color\n * per design's request. Defaults to teal.\n */\n fillColor?: StashPrimaryColorGroup;\n\n /**\n * The color theme for the illustration. This component will use the standard 500 shade of the color.\n * Defaults to purple\n */\n strokeColor?: StashPrimaryColor;\n\n /**\n * Illustration's custom static path. It'll default to either the staticPath defined on the library installation or '/static' if none are provided.\n */\n staticPath?: string;\n }\n\n const props = withDefaults(defineProps<IllustrationProps>(), {\n id: uniqueId('ll-illustration-'),\n title: '',\n size: 48,\n type: IllustrationType.Spot,\n fillColor: 'blue',\n strokeColor: 'purple-500',\n staticPath: '',\n });\n\n if (props.type === IllustrationType.Scene) {\n throw new Error(\n 'Scene illustration types are not supported. Illustrations will need to be uploaded under ./assets/illustrations/scene. Illustrations to be provided by design.',\n );\n }\n\n if (\n (props.type === IllustrationType.Spot && !spotNames.includes(props.name as SpotName)) ||\n (props.type === IllustrationType.Vignette && !vignetteNames.includes(props.name as VignetteName))\n ) {\n throw new Error(\n `${props.type} illustration name ${props.name} not found. Did you check that you are using the correct type for your illustration?`,\n );\n }\n\n const stashOptions = inject<Partial<StashProvideState>>('stashOptions', {\n staticPath: '/static',\n });\n\n const isSpotIllustration = computed(() => props.type === IllustrationType.Spot);\n\n /**\n * Browsers won't add the `stroke-width` attribute if it is set to false.\n * However, setting it to specific number value affects vignettes\n */\n const strokeWidth = computed<boolean | string>(() => {\n return isSpotIllustration.value ? '0' : false;\n });\n\n const computedStaticPath = computed(() => {\n return props.staticPath || stashOptions?.staticPath;\n });\n</script>\n\n<template>\n <!-- InlineSvg package (https://github.com/shrpne/vue-inline-svg) swaps external svgs and puts\n them inline so we can style them with CSS -->\n <!-- Having to override fill to be none and stroke to be zero so the exported svgs from Figma\n that do not have those attributes specified do not get a default one applied -->\n <InlineSvg\n :id=\"props.id\"\n class=\"tw-inline-block tw-align-middle\"\n :class=\"{\n [`tw-text-${props.fillColor}-400 tw-stroke-${props.strokeColor}`]: isSpotIllustration,\n }\"\n :title=\"props.title\"\n :height=\"props.size\"\n :width=\"props.size\"\n :stroke-width=\"strokeWidth\"\n fill=\"none\"\n :src=\"`${computedStaticPath}/illustrations/${props.type}/${props.name}.svg`\"\n />\n</template>\n"],"names":["SpotName","spotNames","VignetteName","vignetteNames","IllustrationType","props","__props","stashOptions","inject","isSpotIllustration","computed","strokeWidth","computedStaticPath"],"mappings":";;;AAGY,IAAAA,sBAAAA,OACVA,EAAA,WAAW,YACXA,EAAA,SAAS,UACTA,EAAA,UAAU,WACVA,EAAA,WAAW,YACXA,EAAA,YAAY,aACZA,EAAA,YAAY,aACZA,EAAA,aAAa,eACbA,EAAA,WAAW,aACXA,EAAA,cAAc,gBACdA,EAAA,QAAQ,SACRA,EAAA,WAAW,YACXA,EAAA,eAAe,gBACfA,EAAA,WAAW,YACXA,EAAA,SAAS,UACTA,EAAA,aAAa,eACbA,EAAA,MAAM,OACNA,EAAA,cAAc,eACdA,EAAA,OAAO,QACPA,EAAA,oBAAoB,sBACpBA,EAAA,WAAW,YACXA,EAAA,kBAAkB,oBAClBA,EAAA,WAAW,YACXA,EAAA,YAAY,aACZA,EAAA,QAAQ,SACRA,EAAA,QAAQ,SACRA,EAAA,sBAAsB,wBACtBA,EAAA,aAAa,cACbA,EAAA,QAAQ,SACRA,EAAA,aAAa,eACbA,EAAA,kBAAkB,oBAClBA,EAAA,uBAAuB,yBACvBA,EAAA,QAAQ,SACRA,EAAA,oBAAoB,sBACpBA,EAAA,SAAS,UACTA,EAAA,YAAY,aACZA,EAAA,YAAY,aAC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WAAW,aACXA,EAAA,eAAe,iBACfA,EAAA,iBAAiB,mBACjBA,EAAA,SAAS,UACTA,EAAA,mBAAmB,qBACnBA,EAAA,QAAQ,SACRA,EAAA,OAAO,QACPA,EAAA,QAAQ,SACRA,EAAA,QAAQ,SACRA,EAAA,YAAY,aACZA,EAAA,oBAAoB,sBA/BVA,IAAAA,KAAA,CAAA,CAAA;AAuCC,MAAAC,IAAgB,OAAO,OAAOD,CAAY;AAK3C,IAAAE,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,WAAW,YAEXA,EAAA,QAAQ,SAJEA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;ACpEV,UAAMC,IAAQC;AAUV,QAAAD,EAAM,SAASD,EAAiB;AAClC,YAAM,IAAI;AAAA,QACR;AAAA,MAAA;AAIJ,QACGC,EAAM,SAASD,EAAiB,QAAQ,CAACH,EAAU,SAASI,EAAM,IAAgB,KAClFA,EAAM,SAASD,EAAiB,YAAY,CAACD,EAAc,SAASE,EAAM,IAAoB;AAE/F,YAAM,IAAI;AAAA,QACR,GAAGA,EAAM,IAAI,sBAAsBA,EAAM,IAAI;AAAA,MAAA;AAI3C,UAAAE,IAAeC,EAAmC,gBAAgB;AAAA,MACtE,YAAY;AAAA,IAAA,CACb,GAEKC,IAAqBC,EAAS,MAAML,EAAM,SAASD,EAAiB,IAAI,GAMxEO,IAAcD,EAA2B,MACtCD,EAAmB,QAAQ,MAAM,EACzC,GAEKG,IAAqBF,EAAS,MAC3BL,EAAM,eAAcE,KAAA,gBAAAA,EAAc,WAC1C;;;;;;;;;;;;;;;"}
|
package/dist/Image.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.js","sources":["../src/components/Image/Image.types.ts","../src/components/Image/providers/utils.ts","../src/components/Image/providers/cloudinary.ts","../src/components/Image/providers/static.ts","../src/components/Image/providers/index.ts","../src/components/Image/Image.vue"],"sourcesContent":["// Sizes used to generate resized and optimized versions of an image.\n// Generated in `srcset`, and informed by `sizes`.\nexport const Screens = {\n xs: 160,\n sm: 338,\n md: 676,\n lg: 1352,\n xl: 2704,\n} as const;\n\nexport interface ImageSizeCondition {\n mediaQuery: string;\n screenMinWidth: number;\n size: string;\n}\n\nexport enum ImageRadius {\n None = 'none',\n Rounded = 'rounded',\n}\n\nexport type ImageRadii = `${ImageRadius}`;\n\nexport enum ImageProviders {\n Cloudinary = 'cloudinary',\n Static = 'static',\n}\n","export interface ImageModifiers {\n format?: string;\n height?: number;\n width?: number;\n [key: string]: any /* eslint-disable-line @typescript-eslint/no-explicit-any */;\n}\n\nexport type ParamFormatter = (key: string, value: string) => string;\n\nexport type ParamMapper = { [key: string]: string } | ((key: string) => string);\n\nexport interface ProviderUrlBuilder {\n keyMap?: ParamMapper;\n formatter?: ParamFormatter;\n joinWith?: string;\n valueMap?: {\n [key: string]: ParamMapper;\n };\n}\n\nfunction createMapper(map: ParamMapper) {\n return (key: string) => {\n return map[key] || key;\n };\n}\n\n/**\n * Builds the parameterized Cloudinary url\n */\nexport function buildProviderUrl({\n formatter = (key, value) => `${key}=${value}`,\n keyMap,\n joinWith = '/',\n valueMap = {},\n}: ProviderUrlBuilder = {}) {\n const keyMapper = typeof keyMap === 'function' ? keyMap : createMapper(keyMap || {});\n\n Object.keys(valueMap).forEach((valueKey) => {\n if (typeof valueMap[valueKey] !== 'function') {\n valueMap[valueKey] = createMapper(valueMap[valueKey]);\n }\n });\n\n return (modifiers: { [key: string]: string } = {}) => {\n const operations = Object.entries(modifiers).map(([key, value]) => {\n const mapper = valueMap[key];\n const newKey = keyMapper(key);\n let newVal = value;\n\n if (typeof mapper === 'function') {\n newVal = mapper(modifiers[key]);\n }\n\n return formatter(newKey, newVal);\n });\n\n return operations.join(joinWith);\n };\n}\n\n/**\n * Checks if a (sub)domain is included in a list of acceptable domains\n * @param str the (sub)domain to check\n * @param domains an array of valid domains\n */\nexport function isDomainValid(str = '', domains: string[] = []): boolean {\n const url = new URL(str);\n const host = url.host;\n\n return domains.some((domain) => {\n if (domain === host) {\n return true;\n }\n\n return domain.endsWith(`.${host}`);\n });\n}\n","import merge from 'lodash-es/merge';\n\nimport { IMAGE_PROVIDER_URLS } from '../../../constants';\nimport { buildProviderUrl, ImageModifiers } from './utils';\n\nconst BASE_URL = IMAGE_PROVIDER_URLS.CLOUDINARY;\n\nconst convertHextoRGBFormat = (value: string) => (value.startsWith('#') ? value.replace('#', 'rgb_') : value);\n\n/**\n * Parameters (option and value pairs) that can be used in the <transformations> segment of the Cloudinary transformation URL.\n * Options and their respective values are connected by an underscore (eg `w_250` for width of 250px.).\n * Multiple parameters are comma separated (eg. `w_250,h_250`).\n *\n * `keyMap` maps the option to its option prefix.\n * `valueMap` is used for grouping options using the same `keyMap` value under a 'category', allowing for easier usage and custom labelling in the component context.\n *\n * Transformation URL structure:\n * https://cloudinary.com/documentation/transformation_reference\n *\n * Transformation URL parameters (options and values):\n * https://cloudinary.com/documentation/image_transformations#transformation_url_syntax\n *\n */\nexport const operationsGenerator = buildProviderUrl({\n keyMap: {\n fit: 'c',\n width: 'w',\n height: 'h',\n format: 'f',\n quality: 'q',\n background: 'b',\n dpr: 'dpr',\n },\n valueMap: {\n fit: {\n fill: 'fill',\n inside: 'pad',\n outside: 'lpad',\n cover: 'fit',\n contain: 'scale',\n },\n format: {\n jpeg: 'jpg',\n },\n background(value: string) {\n return convertHextoRGBFormat(value);\n },\n },\n joinWith: ',',\n formatter: (key, value) => `${key}_${value}`,\n});\n\n// Note: Not configurable via Image props (for now).\nconst defaultModifiers = {\n format: 'auto',\n quality: 'auto:best',\n};\n\nexport function getImageUrl(src: string, modifiers: Partial<ImageModifiers> = {}): string {\n const mergeModifiers = merge(defaultModifiers, modifiers);\n const operations = operationsGenerator(mergeModifiers);\n\n return `${BASE_URL}/${operations}/${src}`;\n}\n","export function getImageUrl(src = ''): string {\n return src;\n}\n","import * as cloudinary from './cloudinary';\nimport * as staticProvider from './static';\n\nexport default {\n cloudinary,\n static: staticProvider,\n};\n","<script lang=\"ts\">\n export * from './Image.types';\n</script>\n\n<script setup lang=\"ts\">\n import { computed, inject, useAttrs } from 'vue';\n\n import { StashImageProviders, StashProvideState } from '../../../types/misc';\n import { SCREEN_SIZES } from '../../constants';\n import { ImageProviders, ImageRadii, ImageRadius, ImageSizeCondition, Screens } from './Image.types';\n import providers from './providers';\n import { ImageModifiers } from './providers/utils';\n\n export interface ImageProps {\n /**\n * The path to the image you want to embed.\n */\n src: string;\n\n /**\n * Native srcset attribute.\n * One or more strings separated by commas, indicating possible image sources\n * Can only be used with provider=static, otherwise it's ignored and auto-generated with `sizes` usage\n */\n srcset?: string;\n\n /**\n * For specifying responsive sizes\n */\n sizes?: string;\n\n /**\n * Where the image is served from.\n * If not provided, the provider will inherit from the Stash config `stashOptions.images.provider` (default: `static`).\n * - `static` for relative or absolute paths\n * - `cloudinary` for images served via Cloudinary\n */\n provider?: StashImageProviders;\n\n /**\n * For applying border radius\n */\n radius?: ImageRadii;\n\n /**\n * A custom static path the image src will be appended onto when provider=static.\n * Can be used to override the library-level default.\n */\n staticPath?: string;\n\n /**\n * TODO - https://leaflink.atlassian.net/browse/GRO-204\n * A custom function used to resolve a URL string for the image\n */\n // loader?: () => string;\n }\n\n const BREAKPOINTS = {\n md: SCREEN_SIZES.md,\n lg: SCREEN_SIZES.lg,\n };\n const stashOptions = inject<StashProvideState>('stashOptions');\n const props = withDefaults(defineProps<ImageProps>(), {\n src: '',\n srcset: undefined,\n sizes: undefined,\n staticPath: undefined,\n provider: undefined,\n radius: 'none',\n // loader: undefined, // TODO - https://leaflink.atlassian.net/browse/GRO-204\n });\n\n const attrs = computed(() => {\n const { src, ...attrs } = useAttrs();\n\n attrs.sizes = imgSizes.value;\n attrs.srcset = imgSrcset.value;\n\n return attrs;\n });\n\n const isAbsoluteUrl = computed(() => {\n // return true if not an absolute url\n try {\n new URL(props.src);\n return true;\n } catch (e) {\n return false;\n }\n });\n\n const computedProvider = computed(() => props.provider || stashOptions?.images?.provider || ImageProviders.Static);\n\n const computedStaticPath = computed(() => props.staticPath ?? stashOptions?.staticPath);\n\n const isStatic = computed(() => computedProvider.value === ImageProviders.Static);\n\n const imgProvider = computed(() => providers[computedProvider.value]);\n\n const imgSrc = computed(() => (isStatic.value ? getProviderImage() : getProviderImage({ width: Screens.md })));\n\n const imgSizes = computed(() => (props.sizes ? getSizes() : props.sizes));\n\n const imgSrcset = computed(() => (props.sizes && !props.srcset && !isStatic.value ? getSources() : props.srcset));\n\n const parsedSizes = computed(() => {\n return props.sizes ? parseSizes(props.sizes) : [];\n });\n\n function getProviderImage(modifiers: ImageModifiers = {}) {\n if (isStatic.value && isAbsoluteUrl.value) {\n return props.src;\n }\n\n const src = isStatic.value && computedStaticPath.value ? `${computedStaticPath.value}/${props.src}` : props.src;\n\n return imgProvider.value.getImageUrl(src, modifiers);\n }\n\n function getSources() {\n return Object.values(Screens)\n .map((width) => {\n const src = getProviderImage({ width });\n\n return `${src} ${width}w`;\n })\n .join(', ');\n }\n\n function getSizes() {\n // return if using native media conditions\n if (props.sizes?.includes('(')) {\n return props.sizes;\n }\n\n return parsedSizes.value.map((v) => `${v.mediaQuery ? v.mediaQuery + ' ' : ''}${v.size}`).join(', ');\n }\n\n function parseSizes(providedSizes = '') {\n const conditions: ImageSizeCondition[] = [];\n const sizes = {\n default: '100vw',\n };\n\n // parse sizes and convert to object\n if (typeof providedSizes === 'string') {\n const definitions = providedSizes.split(/[\\s]+/).filter((size) => size);\n\n for (const entry of definitions) {\n const size = entry.split(':');\n\n if (size.length !== 2) {\n sizes['default'] = size[0].trim();\n continue;\n }\n\n sizes[size[0].trim()] = size[1].trim();\n }\n } else {\n throw new Error('`sizes` needs to be a string');\n }\n\n for (const key in sizes) {\n const screenMinWidth = parseInt(BREAKPOINTS[key] || 0);\n let size = String(sizes[key]);\n const isFluidSize = size.endsWith('vw');\n\n // convert integer to pixels\n if (!isFluidSize && /^\\d+$/.test(size)) {\n size = `${size}px`;\n }\n\n if (!isFluidSize && size.endsWith('%')) {\n throw new Error('Image: `sizes` does not support percentage values');\n }\n\n const condition = {\n mediaQuery: screenMinWidth ? `(min-width: ${screenMinWidth}px)` : '',\n screenMinWidth,\n size,\n };\n\n conditions.push(condition);\n }\n\n conditions.sort((v1, v2) => (v1.screenMinWidth > v2.screenMinWidth ? -1 : 1));\n\n return conditions;\n }\n</script>\n\n<template>\n <img\n ref=\"img\"\n :key=\"imgSrc\"\n data-test=\"stash-image\"\n class=\"stash-image\"\n :class=\"{\n 'tw-rounded': props.radius === ImageRadius.Rounded,\n }\"\n :src=\"imgSrc\"\n v-bind=\"attrs\"\n />\n</template>\n"],"names":["Screens","ImageRadius","ImageProviders","createMapper","map","key","buildProviderUrl","formatter","value","keyMap","joinWith","valueMap","keyMapper","valueKey","modifiers","mapper","newKey","newVal","BASE_URL","IMAGE_PROVIDER_URLS","convertHextoRGBFormat","operationsGenerator","defaultModifiers","getImageUrl","src","mergeModifiers","merge","operations","providers","cloudinary","staticProvider","BREAKPOINTS","SCREEN_SIZES","stashOptions","inject","props","__props","attrs","computed","useAttrs","imgSizes","imgSrcset","isAbsoluteUrl","computedProvider","_a","computedStaticPath","isStatic","imgProvider","imgSrc","getProviderImage","getSizes","getSources","parsedSizes","parseSizes","width","v","providedSizes","conditions","sizes","definitions","size","entry","screenMinWidth","isFluidSize","condition","v1","v2"],"mappings":";;;AAEO,MAAMA,IAAU;AAAA,EACrB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAQY,IAAAC,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,UAAU,WAFAA,IAAAA,KAAA,CAAA,CAAA,GAOAC,sBAAAA,OACVA,EAAA,aAAa,cACbA,EAAA,SAAS,UAFCA,IAAAA,KAAA,CAAA,CAAA;ACHZ,SAASC,EAAaC,GAAkB;AACtC,SAAO,CAACC,MACCD,EAAIC,CAAG,KAAKA;AAEvB;AAKO,SAASC,EAAiB;A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,EAAE,KAAK;AAChC;AAAA;AAGI,UAAAF,EAAAE,EAAK,CAAC,EAAE,KAAA,CAAM,IAAIA,EAAK,CAAC,EAAE;;;AAG5B,cAAA,IAAI,MAAM,8BAA8B;AAGhD,iBAAWvD,KAAOqD,GAAO;AACvB,cAAMI,IAAiB,SAAS/B,EAAY1B,CAAG,KAAK,CAAC;AACrD,YAAIuD,IAAO,OAAOF,EAAMrD,CAAG,CAAC;AACtB,cAAA0D,IAAcH,EAAK,SAAS,IAAI;AAOtC,YAJI,CAACG,KAAe,QAAQ,KAAKH,CAAI,MACnCA,IAAO,GAAGA,QAGR,CAACG,KAAeH,EAAK,SAAS,GAAG;AAC7B,gBAAA,IAAI,MAAM,mDAAmD;AAGrE,cAAMI,IAAY;AAAA,UAChB,YAAYF,IAAiB,eAAeA,SAAsB;AAAA,UAClE,gBAAAA;AAAA,UACA,MAAAF;AAAA,QAAA;AAGF,QAAAH,EAAW,KAAKO,CAAS;AAAA;AAGhB,aAAAP,EAAA,KAAK,CAACQ,GAAIC,MAAQD,EAAG,iBAAiBC,EAAG,iBAAiB,KAAK,CAAE,GAErET;AAAA,IACT;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Image.js","sources":["../src/components/Image/Image.types.ts","../src/components/Image/providers/utils.ts","../src/components/Image/providers/cloudinary.ts","../src/components/Image/providers/static.ts","../src/components/Image/providers/index.ts","../src/components/Image/Image.vue"],"sourcesContent":["// Sizes used to generate resized and optimized versions of an image.\n// Generated in `srcset`, and informed by `sizes`.\nexport const Screens = {\n xs: 160,\n sm: 338,\n md: 676,\n lg: 1352,\n xl: 2704,\n} as const;\n\nexport interface ImageSizeCondition {\n mediaQuery: string;\n screenMinWidth: number;\n size: string;\n}\n\nexport enum ImageRadius {\n None = 'none',\n Rounded = 'rounded',\n}\n\nexport type ImageRadii = `${ImageRadius}`;\n\nexport enum ImageProviders {\n Cloudinary = 'cloudinary',\n Static = 'static',\n}\n","export interface ImageModifiers {\n format?: string;\n height?: number;\n width?: number;\n [key: string]: any /* eslint-disable-line @typescript-eslint/no-explicit-any */;\n}\n\nexport type ParamFormatter = (key: string, value: string) => string;\n\nexport type ParamMapper = { [key: string]: string } | ((key: string) => string);\n\nexport interface ProviderUrlBuilder {\n keyMap?: ParamMapper;\n formatter?: ParamFormatter;\n joinWith?: string;\n valueMap?: {\n [key: string]: ParamMapper;\n };\n}\n\nfunction createMapper(map: ParamMapper) {\n return (key: string) => {\n return map[key] || key;\n };\n}\n\n/**\n * Builds the parameterized Cloudinary url\n */\nexport function buildProviderUrl({\n formatter = (key, value) => `${key}=${value}`,\n keyMap,\n joinWith = '/',\n valueMap = {},\n}: ProviderUrlBuilder = {}) {\n const keyMapper = typeof keyMap === 'function' ? keyMap : createMapper(keyMap || {});\n\n Object.keys(valueMap).forEach((valueKey) => {\n if (typeof valueMap[valueKey] !== 'function') {\n valueMap[valueKey] = createMapper(valueMap[valueKey]);\n }\n });\n\n return (modifiers: { [key: string]: string } = {}) => {\n const operations = Object.entries(modifiers).map(([key, value]) => {\n const mapper = valueMap[key];\n const newKey = keyMapper(key);\n let newVal = value;\n\n if (typeof mapper === 'function') {\n newVal = mapper(modifiers[key]);\n }\n\n return formatter(newKey, newVal);\n });\n\n return operations.join(joinWith);\n };\n}\n\n/**\n * Checks if a (sub)domain is included in a list of acceptable domains\n * @param str the (sub)domain to check\n * @param domains an array of valid domains\n */\nexport function isDomainValid(str = '', domains: string[] = []): boolean {\n const url = new URL(str);\n const host = url.host;\n\n return domains.some((domain) => {\n if (domain === host) {\n return true;\n }\n\n return domain.endsWith(`.${host}`);\n });\n}\n","import merge from 'lodash-es/merge';\n\nimport { IMAGE_PROVIDER_URLS } from '../../../constants';\nimport { buildProviderUrl, ImageModifiers } from './utils';\n\nconst BASE_URL = IMAGE_PROVIDER_URLS.CLOUDINARY;\n\nconst convertHextoRGBFormat = (value: string) => (value.startsWith('#') ? value.replace('#', 'rgb_') : value);\n\n/**\n * Parameters (option and value pairs) that can be used in the <transformations> segment of the Cloudinary transformation URL.\n * Options and their respective values are connected by an underscore (eg `w_250` for width of 250px.).\n * Multiple parameters are comma separated (eg. `w_250,h_250`).\n *\n * `keyMap` maps the option to its option prefix.\n * `valueMap` is used for grouping options using the same `keyMap` value under a 'category', allowing for easier usage and custom labelling in the component context.\n *\n * Transformation URL structure:\n * https://cloudinary.com/documentation/transformation_reference\n *\n * Transformation URL parameters (options and values):\n * https://cloudinary.com/documentation/image_transformations#transformation_url_syntax\n *\n */\nexport const operationsGenerator = buildProviderUrl({\n keyMap: {\n fit: 'c',\n width: 'w',\n height: 'h',\n format: 'f',\n quality: 'q',\n background: 'b',\n dpr: 'dpr',\n },\n valueMap: {\n fit: {\n fill: 'fill',\n inside: 'pad',\n outside: 'lpad',\n cover: 'fit',\n contain: 'scale',\n },\n format: {\n jpeg: 'jpg',\n },\n background(value: string) {\n return convertHextoRGBFormat(value);\n },\n },\n joinWith: ',',\n formatter: (key, value) => `${key}_${value}`,\n});\n\n// Note: Not configurable via Image props (for now).\nconst defaultModifiers = {\n format: 'auto',\n quality: 'auto:best',\n};\n\nexport function getImageUrl(src: string, modifiers: Partial<ImageModifiers> = {}): string {\n const mergeModifiers = merge(defaultModifiers, modifiers);\n const operations = operationsGenerator(mergeModifiers);\n\n return `${BASE_URL}/${operations}/${src}`;\n}\n","export function getImageUrl(src = ''): string {\n return src;\n}\n","import * as cloudinary from './cloudinary';\nimport * as staticProvider from './static';\n\nexport default {\n cloudinary,\n static: staticProvider,\n};\n","<script lang=\"ts\">\n export * from './Image.types';\n</script>\n\n<script setup lang=\"ts\">\n import { computed, inject, useAttrs } from 'vue';\n\n import { StashImageProviders, StashProvideState } from '../../../types/misc';\n import { SCREEN_SIZES } from '../../constants';\n import { ImageProviders, ImageRadii, ImageRadius, ImageSizeCondition, Screens } from './Image.types';\n import providers from './providers';\n import { ImageModifiers } from './providers/utils';\n\n export interface ImageProps {\n /**\n * The path to the image you want to embed.\n */\n src: string;\n\n /**\n * Native srcset attribute.\n * One or more strings separated by commas, indicating possible image sources\n * Can only be used with provider=static, otherwise it's ignored and auto-generated with `sizes` usage\n */\n srcset?: string;\n\n /**\n * For specifying responsive sizes\n */\n sizes?: string;\n\n /**\n * Where the image is served from.\n * If not provided, the provider will inherit from the Stash config `stashOptions.images.provider` (default: `static`).\n * - `static` for relative or absolute paths\n * - `cloudinary` for images served via Cloudinary\n */\n provider?: StashImageProviders;\n\n /**\n * For applying border radius\n */\n radius?: ImageRadii;\n\n /**\n * A custom static path the image src will be appended onto when provider=static.\n * Can be used to override the library-level default.\n */\n staticPath?: string;\n\n /**\n * TODO - https://leaflink.atlassian.net/browse/GRO-204\n * A custom function used to resolve a URL string for the image\n */\n // loader?: () => string;\n }\n\n const BREAKPOINTS = {\n md: SCREEN_SIZES.md,\n lg: SCREEN_SIZES.lg,\n };\n const stashOptions = inject<StashProvideState>('stashOptions');\n const props = withDefaults(defineProps<ImageProps>(), {\n src: '',\n srcset: undefined,\n sizes: undefined,\n staticPath: undefined,\n provider: undefined,\n radius: 'none',\n // loader: undefined, // TODO - https://leaflink.atlassian.net/browse/GRO-204\n });\n\n const attrs = computed(() => {\n const { src, ...attrs } = useAttrs();\n\n attrs.sizes = imgSizes.value;\n attrs.srcset = imgSrcset.value;\n\n return attrs;\n });\n\n const isAbsoluteUrl = computed(() => {\n // return true if not an absolute url\n try {\n new URL(props.src);\n return true;\n } catch (e) {\n return false;\n }\n });\n\n const computedProvider = computed(() => props.provider || stashOptions?.images?.provider || ImageProviders.Static);\n\n const computedStaticPath = computed(() => props.staticPath ?? stashOptions?.staticPath);\n\n const isStatic = computed(() => computedProvider.value === ImageProviders.Static);\n\n const imgProvider = computed(() => providers[computedProvider.value]);\n\n const imgSrc = computed(() => (isStatic.value ? getProviderImage() : getProviderImage({ width: Screens.md })));\n\n const imgSizes = computed(() => (props.sizes ? getSizes() : props.sizes));\n\n const imgSrcset = computed(() => (props.sizes && !props.srcset && !isStatic.value ? getSources() : props.srcset));\n\n const parsedSizes = computed(() => {\n return props.sizes ? parseSizes(props.sizes) : [];\n });\n\n function getProviderImage(modifiers: ImageModifiers = {}) {\n if (isStatic.value && isAbsoluteUrl.value) {\n return props.src;\n }\n\n const src = isStatic.value && computedStaticPath.value ? `${computedStaticPath.value}/${props.src}` : props.src;\n\n return imgProvider.value.getImageUrl(src, modifiers);\n }\n\n function getSources() {\n return Object.values(Screens)\n .map((width) => {\n const src = getProviderImage({ width });\n\n return `${src} ${width}w`;\n })\n .join(', ');\n }\n\n function getSizes() {\n // return if using native media conditions\n if (props.sizes?.includes('(')) {\n return props.sizes;\n }\n\n return parsedSizes.value.map((v) => `${v.mediaQuery ? v.mediaQuery + ' ' : ''}${v.size}`).join(', ');\n }\n\n function parseSizes(providedSizes = '') {\n const conditions: ImageSizeCondition[] = [];\n const sizes = {\n default: '100vw',\n };\n\n // parse sizes and convert to object\n if (typeof providedSizes === 'string') {\n const definitions = providedSizes.split(/[\\s]+/).filter((size) => size);\n\n for (const entry of definitions) {\n const size = entry.split(':');\n\n if (size.length !== 2) {\n sizes['default'] = size[0].trim();\n continue;\n }\n\n sizes[size[0].trim()] = size[1].trim();\n }\n } else {\n throw new Error('`sizes` needs to be a string');\n }\n\n for (const key in sizes) {\n const screenMinWidth = parseInt(BREAKPOINTS[key] || 0);\n let size = String(sizes[key]);\n const isFluidSize = size.endsWith('vw');\n\n // convert integer to pixels\n if (!isFluidSize && /^\\d+$/.test(size)) {\n size = `${size}px`;\n }\n\n if (!isFluidSize && size.endsWith('%')) {\n throw new Error('Image: `sizes` does not support percentage values');\n }\n\n const condition = {\n mediaQuery: screenMinWidth ? `(min-width: ${screenMinWidth}px)` : '',\n screenMinWidth,\n size,\n };\n\n conditions.push(condition);\n }\n\n conditions.sort((v1, v2) => (v1.screenMinWidth > v2.screenMinWidth ? -1 : 1));\n\n return conditions;\n }\n</script>\n\n<template>\n <img\n ref=\"img\"\n :key=\"imgSrc\"\n data-test=\"stash-image\"\n class=\"stash-image\"\n :class=\"{\n 'tw-rounded': props.radius === ImageRadius.Rounded,\n }\"\n :src=\"imgSrc\"\n v-bind=\"attrs\"\n />\n</template>\n"],"names":["Screens","ImageRadius","ImageProviders","createMapper","map","key","buildProviderUrl","formatter","value","keyMap","joinWith","valueMap","keyMapper","valueKey","modifiers","mapper","newKey","newVal","BASE_URL","IMAGE_PROVIDER_URLS","convertHextoRGBFormat","operationsGenerator","defaultModifiers","getImageUrl","src","mergeModifiers","merge","operations","providers","cloudinary","staticProvider","BREAKPOINTS","SCREEN_SIZES","stashOptions","inject","props","__props","attrs","computed","useAttrs","imgSizes","imgSrcset","isAbsoluteUrl","computedProvider","_a","computedStaticPath","isStatic","imgProvider","imgSrc","getProviderImage","getSizes","getSources","parsedSizes","parseSizes","width","v","providedSizes","conditions","sizes","definitions","size","entry","screenMinWidth","isFluidSize","condition","v1","v2"],"mappings":";;;AAEO,MAAMA,IAAU;AAAA,EACrB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAQY,IAAAC,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,UAAU,WAFAA,IAAAA,KAAA,CAAA,CAAA,GAOAC,sBAAAA,OACVA,EAAA,aAAa,cACbA,EAAA,SAAS,UAFCA,IAAAA,KAAA,CAAA,CAAA;ACHZ,SAASC,EAAaC,GAAkB;AACtC,SAAO,CAACC,MACCD,EAAIC,CAAG,KAAKA;AAEvB;AAKO,SAASC,EAAiB;AAAA,EAC/B,WAAAC,IAAY,CAACF,GAAKG,MAAU,GAAGH,CAAG,IAAIG,CAAK;AAAA,EAC3C,QAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW,CAAC;AACd,IAAwB,IAAI;AACpB,QAAAC,IAAY,OAAOH,KAAW,aAAaA,IAASN,EAAaM,KAAU,CAAA,CAAE;AAEnF,gBAAO,KAAKE,CAAQ,EAAE,QAAQ,CAACE,MAAa;AAC1C,IAAI,OAAOF,EA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CAAG,KAAK,CAAC;AACrD,YAAIuD,IAAO,OAAOF,EAAMrD,CAAG,CAAC;AACtB,cAAA0D,IAAcH,EAAK,SAAS,IAAI;AAOtC,YAJI,CAACG,KAAe,QAAQ,KAAKH,CAAI,MACnCA,IAAO,GAAGA,CAAI,OAGZ,CAACG,KAAeH,EAAK,SAAS,GAAG;AAC7B,gBAAA,IAAI,MAAM,mDAAmD;AAGrE,cAAMI,IAAY;AAAA,UAChB,YAAYF,IAAiB,eAAeA,CAAc,QAAQ;AAAA,UAClE,gBAAAA;AAAA,UACA,MAAAF;AAAA,QAAA;AAGF,QAAAH,EAAW,KAAKO,CAAS;AAAA,MAC3B;AAEW,aAAAP,EAAA,KAAK,CAACQ,GAAIC,MAAQD,EAAG,iBAAiBC,EAAG,iBAAiB,KAAK,CAAE,GAErET;AAAA,IACT;;;;;;;;;;;;"}
|
package/dist/Image.vue.d.ts
CHANGED
|
@@ -27,26 +27,26 @@ declare type __VLS_WithDefaults<P, D> = {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
declare const _default: DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ImageProps>, {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
src: string;
|
|
31
|
+
srcset: undefined;
|
|
32
|
+
sizes: undefined;
|
|
33
|
+
staticPath: undefined;
|
|
34
|
+
provider: undefined;
|
|
35
|
+
radius: string;
|
|
36
36
|
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ImageProps>, {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
src: string;
|
|
38
|
+
srcset: undefined;
|
|
39
|
+
sizes: undefined;
|
|
40
|
+
staticPath: undefined;
|
|
41
|
+
provider: undefined;
|
|
42
|
+
radius: string;
|
|
43
43
|
}>>> & Readonly<{}>, {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
staticPath: string;
|
|
45
|
+
src: string;
|
|
46
|
+
radius: "none" | "rounded";
|
|
47
|
+
srcset: string;
|
|
48
|
+
sizes: string;
|
|
49
|
+
provider: "static" | "cloudinary";
|
|
50
50
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
51
51
|
export default _default;
|
|
52
52
|
|
package/dist/InlineEdit.js
CHANGED
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
import { defineComponent as B, useSlots as K, useAttrs as N, ref as
|
|
1
|
+
import { defineComponent as B, useSlots as K, useAttrs as N, ref as u, computed as n, watch as $, openBlock as c, createElementBlock as m, normalizeClass as O, unref as P, createElementVNode as z, createVNode as D, mergeProps as F, withKeys as f, createSlots as U, withCtx as v, renderSlot as V, toDisplayString as j, createCommentVNode as q } from "vue";
|
|
2
2
|
import { percent as G, money as H } from "./utils/i18n.js";
|
|
3
3
|
import J from "./Input.js";
|
|
4
|
-
import "./constants.js";
|
|
5
|
-
import "./locale.js";
|
|
6
|
-
import "lodash-es/get";
|
|
7
|
-
import "lodash-es/isNil";
|
|
8
|
-
import "./Field.vue_vue_type_script_setup_true_lang-fded4f75.js";
|
|
9
|
-
import "lodash-es/uniqueId";
|
|
10
|
-
import "./Label.vue_vue_type_script_setup_true_lang-b6ba2f02.js";
|
|
11
|
-
import "./Icon.js";
|
|
12
|
-
import "./index-9e1095ef.js";
|
|
13
|
-
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
14
|
-
import "./_plugin-vue_export-helper-dad06003.js";
|
|
15
4
|
const L = { class: "stash-inline-edit__input-wrapper" }, M = {
|
|
16
5
|
key: 0,
|
|
17
6
|
class: "tw-mt-1 tw-inline-block tw-pl-3 tw-text-ice-700 tw-line-through"
|
|
18
|
-
},
|
|
7
|
+
}, X = /* @__PURE__ */ B({
|
|
19
8
|
name: "ll-inline-edit",
|
|
20
9
|
inheritAttrs: !1,
|
|
21
10
|
__name: "InlineEdit",
|
|
@@ -31,21 +20,21 @@ const L = { class: "stash-inline-edit__input-wrapper" }, M = {
|
|
|
31
20
|
},
|
|
32
21
|
emits: ["update:model-value"],
|
|
33
22
|
setup(h, { emit: y }) {
|
|
34
|
-
const d = K(), p = N(), e = h, w = y,
|
|
23
|
+
const d = K(), p = N(), e = h, w = y, r = u(!1), s = u(e.oldValue || e.modelValue), l = u(e.modelValue), x = n(() => {
|
|
35
24
|
const t = { ...p };
|
|
36
25
|
return delete t.class, t;
|
|
37
|
-
}), _ =
|
|
26
|
+
}), _ = n(() => E(s.value || "")), b = n(() => (e.oldValue || e.oldValue === 0) && e.oldValue !== l.value), k = n(() => !!d.append), g = n(() => !!d.prepend);
|
|
38
27
|
$(
|
|
39
28
|
() => e.modelValue,
|
|
40
|
-
(t,
|
|
41
|
-
t !==
|
|
29
|
+
(t, o) => {
|
|
30
|
+
t !== o && (l.value = t);
|
|
42
31
|
}
|
|
43
32
|
);
|
|
44
33
|
function I() {
|
|
45
|
-
l.value = e.modelValue || e.oldValue,
|
|
34
|
+
l.value = e.modelValue || e.oldValue, r.value = !1, i();
|
|
46
35
|
}
|
|
47
36
|
function A() {
|
|
48
|
-
|
|
37
|
+
r.value = !0, S();
|
|
49
38
|
}
|
|
50
39
|
function E(t) {
|
|
51
40
|
switch (e.format) {
|
|
@@ -60,35 +49,35 @@ const L = { class: "stash-inline-edit__input-wrapper" }, M = {
|
|
|
60
49
|
}
|
|
61
50
|
}
|
|
62
51
|
function C() {
|
|
63
|
-
l.value = l.value !== "" ? l.value :
|
|
52
|
+
l.value = l.value !== "" ? l.value : s.value, w("update:model-value", l.value), r.value = !1, i();
|
|
64
53
|
}
|
|
65
|
-
const
|
|
54
|
+
const a = u();
|
|
66
55
|
function S() {
|
|
67
|
-
|
|
56
|
+
a.value && a.value.inputEl.focus();
|
|
68
57
|
}
|
|
69
|
-
function
|
|
70
|
-
|
|
58
|
+
function i() {
|
|
59
|
+
a.value && a.value.inputEl.blur();
|
|
71
60
|
}
|
|
72
|
-
return (t,
|
|
61
|
+
return (t, o) => (c(), m("div", {
|
|
73
62
|
class: O(["stash-inline-edit", P(p).class]),
|
|
74
63
|
"data-test": "stash-inline-edit"
|
|
75
64
|
}, [
|
|
76
65
|
z("div", L, [
|
|
77
66
|
D(J, F({
|
|
78
67
|
ref_key: "llInput",
|
|
79
|
-
ref:
|
|
68
|
+
ref: a,
|
|
80
69
|
modelValue: l.value,
|
|
81
|
-
"onUpdate:modelValue":
|
|
70
|
+
"onUpdate:modelValue": o[0] || (o[0] = (T) => l.value = T),
|
|
82
71
|
"error-text": e.errorText,
|
|
83
72
|
"hint-text": e.hintText,
|
|
84
73
|
label: e.label,
|
|
85
|
-
placeholder: `${e.placeholder ||
|
|
74
|
+
placeholder: `${e.placeholder || s.value}`,
|
|
86
75
|
type: e.type
|
|
87
76
|
}, x.value, {
|
|
88
77
|
onBlur: C,
|
|
89
78
|
onFocus: A,
|
|
90
79
|
onKeydown: f(I, ["esc"]),
|
|
91
|
-
onKeyup: f(
|
|
80
|
+
onKeyup: f(i, ["enter"])
|
|
92
81
|
}), U({ _: 2 }, [
|
|
93
82
|
g.value ? {
|
|
94
83
|
name: "prepend",
|
|
@@ -111,6 +100,6 @@ const L = { class: "stash-inline-edit__input-wrapper" }, M = {
|
|
|
111
100
|
}
|
|
112
101
|
});
|
|
113
102
|
export {
|
|
114
|
-
|
|
103
|
+
X as default
|
|
115
104
|
};
|
|
116
105
|
//# sourceMappingURL=InlineEdit.js.map
|
package/dist/InlineEdit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineEdit.js","sources":["../src/components/InlineEdit/InlineEdit.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref, useAttrs, useSlots, watch } from 'vue';\n\n import { money, percent } from '../../utils/i18n';\n import Input from '../Input/Input.vue';\n\n defineOptions({\n name: 'll-inline-edit',\n inheritAttrs: false,\n });\n\n export interface InlineEditProps {\n /**\n * Formats the value displayed.\n * Options: currency, percent\n */\n format?: 'currency' | 'percent' | '';\n\n /**\n * DOM `type` property to be passed to `ll-input`.\n * Use type=\"number\" for localized numbers\n */\n type?: string;\n\n /**\n * The current value for the component.\n */\n modelValue?: string | number;\n\n /**\n * Used to display a crossed out value below the component\n * if the current `modelValue` does not match `oldValue`.\n */\n oldValue?: string | number;\n\n /**\n * Label to render for the input\n */\n label?: string;\n\n /**\n * Placeholder for the input\n */\n placeholder?: string;\n\n /**\n * Error text to display. Replaces `hintText` (if provided) & adds error styling.\n */\n errorText?: string;\n\n /**\n * Hint text to display below the input\n */\n hintText?: string;\n }\n\n const slots = useSlots();\n const attrs = useAttrs();\n\n const props = withDefaults(defineProps<InlineEditProps>(), {\n format: '',\n type: 'text',\n modelValue: undefined,\n oldValue: undefined,\n label: ' ',\n placeholder: '',\n errorText: '',\n hintText: '',\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the value is updated\n */\n (e: 'update:model-value', value: string | number | undefined): void;\n }>();\n\n const editing = ref(false);\n\n // this value gets set once and never changes\n const originalValue = ref<InlineEditProps['oldValue']>(props.oldValue || props.modelValue);\n\n // the _current_ value. This is a temporary value, used while editing\n const internalValue = ref<InlineEditProps['modelValue']>(props.modelValue);\n\n const inputAttrs = computed(() => {\n const tempAttrs = { ...attrs };\n\n delete tempAttrs.class;\n return tempAttrs;\n });\n\n const formattedOriginalValue = computed(() => formatValue(originalValue.value || ''));\n\n const showOldValue = computed(() => {\n return 1 && (props.oldValue || props.oldValue === 0) && props.oldValue !== internalValue.value;\n });\n\n const isAppended = computed(() => {\n return !!slots.append;\n });\n\n const isPrepended = computed(() => {\n return !!slots.prepend;\n });\n\n watch(\n () => props.modelValue,\n (newVal?: string | number, oldVal?: string | number) => {\n if (newVal !== oldVal) {\n internalValue.value = newVal;\n }\n },\n );\n\n function dismiss() {\n internalValue.value = props.modelValue || props.oldValue;\n editing.value = false;\n blurInput();\n }\n\n /**\n * Toggles edit state on\n */\n function edit() {\n editing.value = true;\n focusInput();\n }\n\n /**\n * Formats the value based on `format`\n */\n function formatValue(value: string | number) {\n switch (props.format) {\n case 'currency':\n return money({\n amount: value as number,\n });\n case 'percent':\n return percent((value as number) / 100);\n default:\n return value;\n }\n }\n\n /**\n * This method saves the current value of the input field by `$emit`ing.\n * If the new value is empty, it reverts `internalValue` to the original value.\n */\n function save() {\n internalValue.value = !(internalValue.value === '') ? internalValue.value : originalValue.value;\n\n emit('update:model-value', internalValue.value);\n editing.value = false;\n blurInput();\n }\n\n const llInput = ref();\n\n function focusInput() {\n if (llInput.value) {\n llInput.value.inputEl.focus();\n }\n }\n\n function blurInput() {\n if (llInput.value) {\n llInput.value.inputEl.blur();\n }\n }\n</script>\n\n<template>\n <div class=\"stash-inline-edit\" :class=\"attrs.class\" data-test=\"stash-inline-edit\">\n <div class=\"stash-inline-edit__input-wrapper\">\n <Input\n ref=\"llInput\"\n v-model=\"internalValue\"\n :error-text=\"props.errorText\"\n :hint-text=\"props.hintText\"\n :label=\"props.label\"\n :placeholder=\"`${props.placeholder || originalValue}`\"\n :type=\"props.type\"\n v-bind=\"inputAttrs\"\n @blur=\"save\"\n @focus=\"edit\"\n @keydown.esc=\"dismiss\"\n @keyup.enter=\"blurInput\"\n >\n <template v-if=\"isPrepended\" #prepend>\n <!-- @slot renders content on the left side of the input -->\n <slot name=\"prepend\"> </slot>\n </template>\n\n <template v-if=\"isAppended\" #append>\n <!-- @slot renders content on the right side of the input -->\n <slot name=\"append\"> </slot>\n </template>\n </Input>\n </div>\n\n <span v-if=\"showOldValue\" class=\"tw-mt-1 tw-inline-block tw-pl-3 tw-text-ice-700 tw-line-through\">\n {{ formattedOriginalValue }}\n </span>\n </div>\n</template>\n"],"names":["slots","useSlots","attrs","useAttrs","props","__props","emit","__emit","editing","ref","originalValue","internalValue","inputAttrs","computed","tempAttrs","formattedOriginalValue","formatValue","showOldValue","isAppended","isPrepended","watch","newVal","oldVal","dismiss","blurInput","edit","focusInput","value","money","percent","save","llInput"],"mappings":"
|
|
1
|
+
{"version":3,"file":"InlineEdit.js","sources":["../src/components/InlineEdit/InlineEdit.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref, useAttrs, useSlots, watch } from 'vue';\n\n import { money, percent } from '../../utils/i18n';\n import Input from '../Input/Input.vue';\n\n defineOptions({\n name: 'll-inline-edit',\n inheritAttrs: false,\n });\n\n export interface InlineEditProps {\n /**\n * Formats the value displayed.\n * Options: currency, percent\n */\n format?: 'currency' | 'percent' | '';\n\n /**\n * DOM `type` property to be passed to `ll-input`.\n * Use type=\"number\" for localized numbers\n */\n type?: string;\n\n /**\n * The current value for the component.\n */\n modelValue?: string | number;\n\n /**\n * Used to display a crossed out value below the component\n * if the current `modelValue` does not match `oldValue`.\n */\n oldValue?: string | number;\n\n /**\n * Label to render for the input\n */\n label?: string;\n\n /**\n * Placeholder for the input\n */\n placeholder?: string;\n\n /**\n * Error text to display. Replaces `hintText` (if provided) & adds error styling.\n */\n errorText?: string;\n\n /**\n * Hint text to display below the input\n */\n hintText?: string;\n }\n\n const slots = useSlots();\n const attrs = useAttrs();\n\n const props = withDefaults(defineProps<InlineEditProps>(), {\n format: '',\n type: 'text',\n modelValue: undefined,\n oldValue: undefined,\n label: ' ',\n placeholder: '',\n errorText: '',\n hintText: '',\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the value is updated\n */\n (e: 'update:model-value', value: string | number | undefined): void;\n }>();\n\n const editing = ref(false);\n\n // this value gets set once and never changes\n const originalValue = ref<InlineEditProps['oldValue']>(props.oldValue || props.modelValue);\n\n // the _current_ value. This is a temporary value, used while editing\n const internalValue = ref<InlineEditProps['modelValue']>(props.modelValue);\n\n const inputAttrs = computed(() => {\n const tempAttrs = { ...attrs };\n\n delete tempAttrs.class;\n return tempAttrs;\n });\n\n const formattedOriginalValue = computed(() => formatValue(originalValue.value || ''));\n\n const showOldValue = computed(() => {\n return 1 && (props.oldValue || props.oldValue === 0) && props.oldValue !== internalValue.value;\n });\n\n const isAppended = computed(() => {\n return !!slots.append;\n });\n\n const isPrepended = computed(() => {\n return !!slots.prepend;\n });\n\n watch(\n () => props.modelValue,\n (newVal?: string | number, oldVal?: string | number) => {\n if (newVal !== oldVal) {\n internalValue.value = newVal;\n }\n },\n );\n\n function dismiss() {\n internalValue.value = props.modelValue || props.oldValue;\n editing.value = false;\n blurInput();\n }\n\n /**\n * Toggles edit state on\n */\n function edit() {\n editing.value = true;\n focusInput();\n }\n\n /**\n * Formats the value based on `format`\n */\n function formatValue(value: string | number) {\n switch (props.format) {\n case 'currency':\n return money({\n amount: value as number,\n });\n case 'percent':\n return percent((value as number) / 100);\n default:\n return value;\n }\n }\n\n /**\n * This method saves the current value of the input field by `$emit`ing.\n * If the new value is empty, it reverts `internalValue` to the original value.\n */\n function save() {\n internalValue.value = !(internalValue.value === '') ? internalValue.value : originalValue.value;\n\n emit('update:model-value', internalValue.value);\n editing.value = false;\n blurInput();\n }\n\n const llInput = ref();\n\n function focusInput() {\n if (llInput.value) {\n llInput.value.inputEl.focus();\n }\n }\n\n function blurInput() {\n if (llInput.value) {\n llInput.value.inputEl.blur();\n }\n }\n</script>\n\n<template>\n <div class=\"stash-inline-edit\" :class=\"attrs.class\" data-test=\"stash-inline-edit\">\n <div class=\"stash-inline-edit__input-wrapper\">\n <Input\n ref=\"llInput\"\n v-model=\"internalValue\"\n :error-text=\"props.errorText\"\n :hint-text=\"props.hintText\"\n :label=\"props.label\"\n :placeholder=\"`${props.placeholder || originalValue}`\"\n :type=\"props.type\"\n v-bind=\"inputAttrs\"\n @blur=\"save\"\n @focus=\"edit\"\n @keydown.esc=\"dismiss\"\n @keyup.enter=\"blurInput\"\n >\n <template v-if=\"isPrepended\" #prepend>\n <!-- @slot renders content on the left side of the input -->\n <slot name=\"prepend\"> </slot>\n </template>\n\n <template v-if=\"isAppended\" #append>\n <!-- @slot renders content on the right side of the input -->\n <slot name=\"append\"> </slot>\n </template>\n </Input>\n </div>\n\n <span v-if=\"showOldValue\" class=\"tw-mt-1 tw-inline-block tw-pl-3 tw-text-ice-700 tw-line-through\">\n {{ formattedOriginalValue }}\n </span>\n </div>\n</template>\n"],"names":["slots","useSlots","attrs","useAttrs","props","__props","emit","__emit","editing","ref","originalValue","internalValue","inputAttrs","computed","tempAttrs","formattedOriginalValue","formatValue","showOldValue","isAppended","isPrepended","watch","newVal","oldVal","dismiss","blurInput","edit","focusInput","value","money","percent","save","llInput"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwDE,UAAMA,IAAQC,KACRC,IAAQC,KAERC,IAAQC,GAWRC,IAAOC,GAOPC,IAAUC,EAAI,EAAK,GAGnBC,IAAgBD,EAAiCL,EAAM,YAAYA,EAAM,UAAU,GAGnFO,IAAgBF,EAAmCL,EAAM,UAAU,GAEnEQ,IAAaC,EAAS,MAAM;AAC1B,YAAAC,IAAY,EAAE,GAAGZ;AAEvB,oBAAOY,EAAU,OACVA;AAAA,IAAA,CACR,GAEKC,IAAyBF,EAAS,MAAMG,EAAYN,EAAc,SAAS,EAAE,CAAC,GAE9EO,IAAeJ,EAAS,OACfT,EAAM,YAAYA,EAAM,aAAa,MAAMA,EAAM,aAAaO,EAAc,KAC1F,GAEKO,IAAaL,EAAS,MACnB,CAAC,CAACb,EAAM,MAChB,GAEKmB,IAAcN,EAAS,MACpB,CAAC,CAACb,EAAM,OAChB;AAED,IAAAoB;AAAA,MACE,MAAMhB,EAAM;AAAA,MACZ,CAACiB,GAA0BC,MAA6B;AACtD,QAAID,MAAWC,MACbX,EAAc,QAAQU;AAAA,MAE1B;AAAA,IAAA;AAGF,aAASE,IAAU;AACH,MAAAZ,EAAA,QAAQP,EAAM,cAAcA,EAAM,UAChDI,EAAQ,QAAQ,IACNgB;IACZ;AAKA,aAASC,IAAO;AACd,MAAAjB,EAAQ,QAAQ,IACLkB;IACb;AAKA,aAASV,EAAYW,GAAwB;AAC3C,cAAQvB,EAAM,QAAQ;AAAA,QACpB,KAAK;AACH,iBAAOwB,EAAM;AAAA,YACX,QAAQD;AAAA,UAAA,CACT;AAAA,QACH,KAAK;AACI,iBAAAE,EAASF,IAAmB,GAAG;AAAA,QACxC;AACS,iBAAAA;AAAA,MACX;AAAA,IACF;AAMA,aAASG,IAAO;AACd,MAAAnB,EAAc,QAAUA,EAAc,UAAU,KAAMA,EAAc,QAAQD,EAAc,OAErFJ,EAAA,sBAAsBK,EAAc,KAAK,GAC9CH,EAAQ,QAAQ,IACNgB;IACZ;AAEA,UAAMO,IAAUtB;AAEhB,aAASiB,IAAa;AACpB,MAAIK,EAAQ,SACFA,EAAA,MAAM,QAAQ;IAE1B;AAEA,aAASP,IAAY;AACnB,MAAIO,EAAQ,SACFA,EAAA,MAAM,QAAQ;IAE1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/InlineEdit.vue.d.ts
CHANGED
|
@@ -33,36 +33,36 @@ declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
declare const _default: __VLS_WithTemplateSlots<DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<InlineEditProps>, {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
format: string;
|
|
37
|
+
type: string;
|
|
38
|
+
modelValue: undefined;
|
|
39
|
+
oldValue: undefined;
|
|
40
|
+
label: string;
|
|
41
|
+
placeholder: string;
|
|
42
|
+
errorText: string;
|
|
43
|
+
hintText: string;
|
|
44
44
|
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
45
|
-
|
|
45
|
+
"update:model-value": (value: string | number | undefined) => void;
|
|
46
46
|
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<InlineEditProps>, {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
format: string;
|
|
48
|
+
type: string;
|
|
49
|
+
modelValue: undefined;
|
|
50
|
+
oldValue: undefined;
|
|
51
|
+
label: string;
|
|
52
|
+
placeholder: string;
|
|
53
|
+
errorText: string;
|
|
54
|
+
hintText: string;
|
|
55
55
|
}>>> & Readonly<{
|
|
56
|
-
|
|
56
|
+
"onUpdate:model-value"?: ((value: string | number | undefined) => any) | undefined;
|
|
57
57
|
}>, {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
type: string;
|
|
59
|
+
label: string;
|
|
60
|
+
errorText: string;
|
|
61
|
+
hintText: string;
|
|
62
|
+
placeholder: string;
|
|
63
|
+
modelValue: string | number;
|
|
64
|
+
oldValue: string | number;
|
|
65
|
+
format: "" | "currency" | "percent";
|
|
66
66
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
|
|
67
67
|
prepend?(_: {}): any;
|
|
68
68
|
append?(_: {}): any;
|
package/dist/Input.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
import { defineComponent as U, useSlots as G, useCssModule as L, useAttrs as O, ref as f, computed as v, watchEffect as W, onMounted as j, openBlock as m, createBlock as V, mergeProps as k, unref as
|
|
1
|
+
import { defineComponent as U, useSlots as G, useCssModule as L, useAttrs as O, ref as f, computed as v, watchEffect as W, onMounted as j, openBlock as m, createBlock as V, mergeProps as k, unref as l, createSlots as q, withCtx as N, createElementVNode as x, withDirectives as H, vModelDynamic as J, createElementBlock as B, normalizeClass as y, renderSlot as h, createCommentVNode as C } from "vue";
|
|
2
2
|
import I from "lodash-es/isNil";
|
|
3
|
-
import { convertDecimal as $, sanitizeDecimal as K, decimalSeparator as
|
|
4
|
-
import { _ as Q } from "./Field.vue_vue_type_script_setup_true_lang-
|
|
3
|
+
import { convertDecimal as $, sanitizeDecimal as K, decimalSeparator as b } from "./utils/i18n.js";
|
|
4
|
+
import { _ as Q } from "./Field.vue_vue_type_script_setup_true_lang-DjxUvSRF.js";
|
|
5
5
|
import R from "./Icon.js";
|
|
6
|
-
import { _ as X } from "./_plugin-vue_export-helper-
|
|
7
|
-
|
|
8
|
-
import "./locale.js";
|
|
9
|
-
import "lodash-es/get";
|
|
10
|
-
import "lodash-es/uniqueId";
|
|
11
|
-
import "./Label.vue_vue_type_script_setup_true_lang-b6ba2f02.js";
|
|
12
|
-
import "./index-9e1095ef.js";
|
|
13
|
-
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
14
|
-
const Y = { class: "tw-relative" }, Z = ["id", "aria-errormessage", "aria-invalid", "autocomplete", "type", "disabled"], ee = /* @__PURE__ */ U({
|
|
6
|
+
import { _ as X } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
|
+
const Y = { class: "tw-relative" }, Z = ["id", "aria-errormessage", "aria-invalid", "autocomplete", "placeholder", "type", "disabled"], ee = /* @__PURE__ */ U({
|
|
15
8
|
name: "ll-input",
|
|
16
9
|
inheritAttrs: !1,
|
|
17
10
|
__name: "Input",
|
|
@@ -26,28 +19,28 @@ const Y = { class: "tw-relative" }, Z = ["id", "aria-errormessage", "aria-invali
|
|
|
26
19
|
modelValue: { default: "" },
|
|
27
20
|
value: { default: null },
|
|
28
21
|
type: { default: "text" },
|
|
22
|
+
placeholder: { default: void 0 },
|
|
29
23
|
disabled: { type: Boolean, default: !1 }
|
|
30
24
|
},
|
|
31
25
|
emits: ["update:model-value", "change", "focus", "blur"],
|
|
32
26
|
setup(E, { expose: S, emit: D }) {
|
|
33
|
-
const
|
|
34
|
-
S({ inputEl:
|
|
35
|
-
const n = f(
|
|
36
|
-
|
|
37
|
-
const p = f(!1),
|
|
38
|
-
const
|
|
39
|
-
return delete
|
|
40
|
-
}), A = v(() =>
|
|
27
|
+
const t = E, i = D, r = G(), s = L(), c = O(), _ = f();
|
|
28
|
+
S({ inputEl: _ });
|
|
29
|
+
const n = f(t.modelValue);
|
|
30
|
+
t.type === "number" && (t.modelValue || t.modelValue === 0) && (n.value = $(t.modelValue, b));
|
|
31
|
+
const p = f(!1), d = v(() => t.type === "number"), M = v(() => {
|
|
32
|
+
const o = { ...c };
|
|
33
|
+
return delete o.class, o;
|
|
34
|
+
}), A = v(() => d.value || t.type === "password" && p.value ? "text" : t.type);
|
|
41
35
|
W(() => {
|
|
42
|
-
n.value = g(
|
|
36
|
+
n.value = g(t.modelValue);
|
|
43
37
|
});
|
|
44
|
-
function w(
|
|
45
|
-
if (!
|
|
46
|
-
return
|
|
47
|
-
let e =
|
|
48
|
-
if (I(e) || `${e}`.length === 0)
|
|
49
|
-
|
|
50
|
-
if (_ !== "." && (e = $(e, ".")), s && (e === "." && (e = "0."), e.toString().startsWith("0.")))
|
|
38
|
+
function w(o = "", a = !1) {
|
|
39
|
+
if (!d.value)
|
|
40
|
+
return o;
|
|
41
|
+
let e = o;
|
|
42
|
+
if (I(e) || `${e}`.length === 0) return "";
|
|
43
|
+
if (b !== "." && (e = $(e, ".")), a && (e === "." && (e = "0."), e.toString().startsWith("0.")))
|
|
51
44
|
return e;
|
|
52
45
|
if (!I(e) && `${e}`.length)
|
|
53
46
|
e = Intl.NumberFormat("en-US", {
|
|
@@ -59,26 +52,26 @@ const Y = { class: "tw-relative" }, Z = ["id", "aria-errormessage", "aria-invali
|
|
|
59
52
|
return "";
|
|
60
53
|
return isNaN(Number(e)) ? "" : parseFloat(e);
|
|
61
54
|
}
|
|
62
|
-
function g(
|
|
63
|
-
return
|
|
55
|
+
function g(o) {
|
|
56
|
+
return d.value ? K(o, b) : o;
|
|
64
57
|
}
|
|
65
58
|
function F() {
|
|
66
|
-
const
|
|
67
|
-
|
|
59
|
+
const o = d.value ? w(n.value) : n.value;
|
|
60
|
+
i("change", o);
|
|
68
61
|
}
|
|
69
|
-
function T(
|
|
70
|
-
const
|
|
71
|
-
n.value = g(
|
|
72
|
-
const e =
|
|
73
|
-
|
|
62
|
+
function T(o) {
|
|
63
|
+
const a = o.target.value;
|
|
64
|
+
n.value = g(a);
|
|
65
|
+
const e = d.value ? w(n.value, !0) : a;
|
|
66
|
+
i("update:model-value", e);
|
|
74
67
|
}
|
|
75
68
|
return j(() => {
|
|
76
|
-
if (
|
|
69
|
+
if (t.value !== null)
|
|
77
70
|
throw new Error("ll-input: use :model-value or v-model instead of :value.");
|
|
78
71
|
if (c.onInput)
|
|
79
72
|
throw new Error("ll-input: use the @update:model-value event instead of @input");
|
|
80
|
-
}), (
|
|
81
|
-
class: ["stash-input", [
|
|
73
|
+
}), (o, a) => (m(), V(Q, k(t, {
|
|
74
|
+
class: ["stash-input", [l(s).root, l(c).class]],
|
|
82
75
|
"data-test": "ll-input"
|
|
83
76
|
}), q({
|
|
84
77
|
default: N(({ fieldId: e, fieldErrorId: z, hasError: P }) => [
|
|
@@ -86,57 +79,58 @@ const Y = { class: "tw-relative" }, Z = ["id", "aria-errormessage", "aria-invali
|
|
|
86
79
|
H(x("input", k(M.value, {
|
|
87
80
|
id: e,
|
|
88
81
|
ref_key: "inputEl",
|
|
89
|
-
ref:
|
|
90
|
-
"onUpdate:modelValue":
|
|
82
|
+
ref: _,
|
|
83
|
+
"onUpdate:modelValue": a[0] || (a[0] = (u) => n.value = u),
|
|
91
84
|
"aria-errormessage": z,
|
|
92
85
|
"aria-invalid": P,
|
|
93
|
-
autocomplete:
|
|
86
|
+
autocomplete: o.autocomplete,
|
|
87
|
+
placeholder: t.placeholder,
|
|
94
88
|
class: [
|
|
95
|
-
{ [
|
|
96
|
-
{ [
|
|
97
|
-
{ [
|
|
89
|
+
{ [l(s)["input-prepended"]]: !!l(r).prepend },
|
|
90
|
+
{ [l(s)["input-appended"]]: !!l(r).append || t.type === "password" },
|
|
91
|
+
{ [l(s)["has-error"]]: !!t.errorText }
|
|
98
92
|
],
|
|
99
93
|
type: A.value,
|
|
100
|
-
disabled:
|
|
94
|
+
disabled: t.disabled,
|
|
101
95
|
onChange: F,
|
|
102
96
|
onInput: T,
|
|
103
|
-
onBlur:
|
|
104
|
-
onFocus:
|
|
97
|
+
onBlur: a[1] || (a[1] = (u) => i("blur", u)),
|
|
98
|
+
onFocus: a[2] || (a[2] = (u) => i("focus", u))
|
|
105
99
|
}), null, 16, Z), [
|
|
106
100
|
[J, n.value]
|
|
107
101
|
]),
|
|
108
|
-
|
|
102
|
+
l(r).prepend ? (m(), B("div", {
|
|
109
103
|
key: 0,
|
|
110
|
-
class: y(["stash-input-prepend font-semibold", [
|
|
104
|
+
class: y(["stash-input-prepend font-semibold", [l(s).symbol, l(s)["symbol--prepend"]]])
|
|
111
105
|
}, [
|
|
112
|
-
|
|
106
|
+
h(o.$slots, "prepend")
|
|
113
107
|
], 2)) : C("", !0),
|
|
114
|
-
|
|
108
|
+
l(r).append || t.type === "password" ? (m(), B("div", {
|
|
115
109
|
key: 1,
|
|
116
|
-
class: y(["stash-input-append font-semibold", [
|
|
110
|
+
class: y(["stash-input-append font-semibold", [l(s).symbol, l(s)["symbol--append"]]])
|
|
117
111
|
}, [
|
|
118
|
-
|
|
112
|
+
l(r).append ? h(o.$slots, "append", { key: 0 }) : (m(), V(R, {
|
|
119
113
|
key: 1,
|
|
120
114
|
name: p.value ? "hide" : "show",
|
|
121
|
-
class: y(["tw-cursor-pointer", { "tw-text-ice-500":
|
|
115
|
+
class: y(["tw-cursor-pointer", { "tw-text-ice-500": t.disabled }]),
|
|
122
116
|
"data-test": p.value ? "hide-password-icon" : "show-password-icon",
|
|
123
|
-
onClick:
|
|
117
|
+
onClick: a[3] || (a[3] = (u) => p.value = !p.value)
|
|
124
118
|
}, null, 8, ["name", "class", "data-test"]))
|
|
125
119
|
], 2)) : C("", !0)
|
|
126
120
|
])
|
|
127
121
|
]),
|
|
128
122
|
_: 2
|
|
129
123
|
}, [
|
|
130
|
-
|
|
124
|
+
l(r).hint ? {
|
|
131
125
|
name: "hint",
|
|
132
126
|
fn: N(() => [
|
|
133
|
-
|
|
127
|
+
h(o.$slots, "hint")
|
|
134
128
|
]),
|
|
135
129
|
key: "0"
|
|
136
130
|
} : void 0
|
|
137
131
|
]), 1040, ["class"]));
|
|
138
132
|
}
|
|
139
|
-
}), te = "_root_12641_2", oe = "_symbol_12641_46",
|
|
133
|
+
}), te = "_root_12641_2", oe = "_symbol_12641_46", le = {
|
|
140
134
|
root: te,
|
|
141
135
|
"has-error": "_has-error_12641_34",
|
|
142
136
|
"input-prepended": "_input-prepended_12641_38",
|
|
@@ -144,10 +138,10 @@ const Y = { class: "tw-relative" }, Z = ["id", "aria-errormessage", "aria-invali
|
|
|
144
138
|
symbol: oe,
|
|
145
139
|
"symbol--prepend": "_symbol--prepend_12641_57",
|
|
146
140
|
"symbol--append": "_symbol--append_12641_63"
|
|
147
|
-
},
|
|
148
|
-
$style:
|
|
149
|
-
},
|
|
141
|
+
}, ae = {
|
|
142
|
+
$style: le
|
|
143
|
+
}, ie = /* @__PURE__ */ X(ee, [["__cssModules", ae]]);
|
|
150
144
|
export {
|
|
151
|
-
|
|
145
|
+
ie as default
|
|
152
146
|
};
|
|
153
147
|
//# sourceMappingURL=Input.js.map
|