@leaflink/stash 43.5.1 → 44.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActionsDropdown.js +9 -9
- package/dist/ActionsDropdown.js.map +1 -1
- package/dist/AddressSelect.js +12 -11
- package/dist/AddressSelect.js.map +1 -1
- package/dist/Alert.js +2 -2
- package/dist/Alert.js.map +1 -1
- package/dist/AppNavigationItem.js +15 -15
- package/dist/AppNavigationItem.js.map +1 -1
- package/dist/AppSidebar.js +17 -17
- package/dist/AppSidebar.js.map +1 -1
- package/dist/AppTopbar.js +12 -12
- package/dist/Avatar.js +12 -12
- package/dist/Avatar.js.map +1 -1
- package/dist/Backdrop.js +1 -1
- package/dist/Backdrop.js.map +1 -1
- package/dist/Badge.js +12 -12
- package/dist/Badge.js.map +1 -1
- package/dist/Button.js +1 -1
- package/dist/Button.js.map +1 -1
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-b2ee90e6.js +17 -0
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-b2ee90e6.js.map +1 -0
- package/dist/ButtonGroup.js +26 -26
- package/dist/ButtonGroup.js.map +1 -1
- package/dist/Card.js +3 -3
- package/dist/Card.js.map +1 -1
- package/dist/CardHeader.js +3 -3
- package/dist/CardMedia.js +1 -1
- package/dist/CardMedia.js.map +1 -1
- package/dist/Carousel.js +24 -24
- package/dist/Carousel.js.map +1 -1
- package/dist/Checkbox.js +27 -26
- package/dist/Checkbox.js.map +1 -1
- package/dist/{Checkbox.vue_vue_type_style_index_0_scoped_0d7e7fd0_lang-4ed993c7.js → Checkbox.vue_vue_type_style_index_0_scoped_dbd26d7f_lang-4ed993c7.js} +1 -1
- package/dist/Checkbox.vue_vue_type_style_index_0_scoped_dbd26d7f_lang-4ed993c7.js.map +1 -0
- package/dist/ChevronToggle.js +1 -1
- package/dist/Chip.js +1 -1
- package/dist/Chip.js.map +1 -1
- package/dist/ConfirmationCodeInput.js +21 -21
- package/dist/ConfirmationCodeInput.js.map +1 -1
- package/dist/ContextSwitcher.js +6 -5
- package/dist/ContextSwitcher.js.map +1 -1
- package/dist/Copy.js +1 -1
- package/dist/CurrencyInput.js +2 -2
- package/dist/DataView.js +1 -1
- package/dist/DataViewFilters.js +7 -7
- package/dist/DataViewFilters.js.map +1 -1
- package/dist/DataViewSortButton.js +5 -5
- package/dist/DataViewSortButton.js.map +1 -1
- package/dist/DataViewToolbar.js +4 -4
- package/dist/DataViewToolbar.js.map +1 -1
- package/dist/DatePicker.js +8 -8
- package/dist/DatePicker.js.map +1 -1
- package/dist/DescriptionListTerm.js +1 -1
- package/dist/DescriptionListTerm.js.map +1 -1
- package/dist/Dialog.js +34 -34
- package/dist/Dialog.js.map +1 -1
- package/dist/Dropdown.js +3 -3
- package/dist/Dropdown.js.map +1 -1
- package/dist/EmptyState.js +1 -1
- package/dist/EmptyState.js.map +1 -1
- package/dist/Field.js +2 -2
- package/dist/{Field.vue_vue_type_script_setup_true_lang-475832fe.js → Field.vue_vue_type_script_setup_true_lang-42cf79d4.js} +5 -5
- package/dist/{Field.vue_vue_type_script_setup_true_lang-475832fe.js.map → Field.vue_vue_type_script_setup_true_lang-42cf79d4.js.map} +1 -1
- package/dist/FileUpload.js +25 -25
- package/dist/FileUpload.js.map +1 -1
- package/dist/FilterChip.js +32 -32
- package/dist/FilterChip.js.map +1 -1
- package/dist/FilterDrawerItem.js +4 -4
- package/dist/FilterDrawerItem.js.map +1 -1
- package/dist/FilterDropdown.js +19 -19
- package/dist/FilterDropdown.js.map +1 -1
- package/dist/FilterSelect.js +2 -2
- package/dist/Filters.js +7 -6
- package/dist/Filters.js.map +1 -1
- package/dist/HttpError.js +30 -30
- package/dist/HttpError.js.map +1 -1
- package/dist/IconLabel.js +1 -1
- package/dist/IconLabel.js.map +1 -1
- package/dist/InlineEdit.js +3 -3
- package/dist/InlineEdit.js.map +1 -1
- package/dist/Input.js +37 -37
- package/dist/Input.js.map +1 -1
- package/dist/InputOptions.js +37 -36
- package/dist/InputOptions.js.map +1 -1
- package/dist/Label.js +1 -1
- package/dist/{Label.vue_vue_type_script_setup_true_lang-1d29d98a.js → Label.vue_vue_type_script_setup_true_lang-c5589919.js} +2 -2
- package/dist/{Label.vue_vue_type_script_setup_true_lang-1d29d98a.js.map → Label.vue_vue_type_script_setup_true_lang-c5589919.js.map} +1 -1
- package/dist/ListItem.js +6 -5
- package/dist/ListItem.js.map +1 -1
- package/dist/ListView.js +55 -54
- package/dist/ListView.js.map +1 -1
- package/dist/Menu.js +1 -1
- package/dist/Menu.js.map +1 -1
- package/dist/Metric.js +4 -4
- package/dist/Metric.js.map +1 -1
- package/dist/Modal.js +21 -21
- package/dist/Modal.js.map +1 -1
- package/dist/Module.js +2 -2
- package/dist/Module.js.map +1 -1
- package/dist/ModuleContent.js +2 -2
- package/dist/ModuleContent.js.map +1 -1
- package/dist/ModuleFooter.js +11 -11
- package/dist/ModuleFooter.js.map +1 -1
- package/dist/ModuleHeader.js +6 -6
- package/dist/ModuleHeader.js.map +1 -1
- package/dist/ObfuscateText.js +1 -1
- package/dist/PageHeader.js +3 -3
- package/dist/PageHeader.js.map +1 -1
- package/dist/PageNavigation.js +2 -2
- package/dist/Paginate.js +1 -1
- package/dist/Paginate.js.map +1 -1
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-1a2084f9.js +11 -0
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-1a2084f9.js.map +1 -0
- package/dist/QuickAction.js +11 -11
- package/dist/QuickAction.js.map +1 -1
- package/dist/Radio.js +2 -2
- package/dist/Radio.js.map +1 -1
- package/dist/RadioGroup.js +44 -44
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioNew.js +14 -14
- package/dist/SearchBar.js +21 -21
- package/dist/SearchBar.js.map +1 -1
- package/dist/Select.js +187 -186
- package/dist/Select.js.map +1 -1
- package/dist/SelectStatus.js +22 -21
- package/dist/SelectStatus.js.map +1 -1
- package/dist/Step.js +37 -37
- package/dist/Step.js.map +1 -1
- package/dist/Switch.js +26 -25
- package/dist/Switch.js.map +1 -1
- package/dist/Tab.js +3 -2
- package/dist/Tab.js.map +1 -1
- package/dist/{Tab.vue_vue_type_script_setup_true_lang-b810bee8.js → Tab.vue_vue_type_script_setup_true_lang-4a40f015.js} +23 -22
- package/dist/Tab.vue_vue_type_script_setup_true_lang-4a40f015.js.map +1 -0
- package/dist/Table.js +20 -19
- package/dist/Table.js.map +1 -1
- package/dist/TableCell.js +22 -21
- package/dist/TableCell.js.map +1 -1
- package/dist/TableHeaderCell.js +7 -6
- package/dist/TableHeaderCell.js.map +1 -1
- package/dist/TableHeaderRow.js +6 -5
- package/dist/TableHeaderRow.js.map +1 -1
- package/dist/TableRow.js +24 -23
- package/dist/TableRow.js.map +1 -1
- package/dist/Tabs.js +2 -2
- package/dist/{Tabs.vue_used_vue_type_style_index_0_lang.module-4f247ed7.js → Tabs.vue_used_vue_type_style_index_0_lang.module-0af1e1cf.js} +3 -3
- package/dist/{Tabs.vue_used_vue_type_style_index_0_lang.module-4f247ed7.js.map → Tabs.vue_used_vue_type_style_index_0_lang.module-0af1e1cf.js.map} +1 -1
- package/dist/Textarea.js +3 -3
- package/dist/Textarea.js.map +1 -1
- package/dist/components.css +1 -1
- package/dist/index.js +21 -20
- package/dist/index.js.map +1 -1
- package/dist/storage.js +3 -2
- package/dist/storage.js.map +1 -1
- package/dist/useGoogleMaps.js.map +1 -1
- package/dist/utils/storage.js +30 -29
- package/dist/utils/storage.js.map +1 -1
- package/package.json +2 -2
- package/styles/_base.scss +1 -1
- package/styles/_core.scss +49 -1
- package/styles/backwards-compat.css +1407 -2
- package/styles/base.css +388 -19
- package/styles/elements/_links.scss +1 -1
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-b77978d6.js +0 -17
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-b77978d6.js.map +0 -1
- package/dist/Checkbox.vue_vue_type_style_index_0_scoped_0d7e7fd0_lang-4ed993c7.js.map +0 -1
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-bfccf992.js +0 -11
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-bfccf992.js.map +0 -1
- package/dist/Tab.vue_vue_type_script_setup_true_lang-b810bee8.js.map +0 -1
- package/styles/components/_all.scss +0 -14
- package/styles/components/_box.scss +0 -13
- package/styles/components/_item-list.scss +0 -78
- package/styles/components/_sidebar.scss +0 -404
- package/styles/components/_top-header.scss +0 -219
- package/styles/elements/_all.scss +0 -15
- package/styles/elements/_buttons.scss +0 -235
- package/styles/elements/_forms.scss +0 -300
- package/styles/elements/_tables.scss +0 -80
- package/styles/elements/_tooltips.scss +0 -110
- package/styles/utility/_all.scss +0 -12
- package/styles/utility/_animations.scss +0 -103
- package/styles/utility/_display.scss +0 -167
- package/styles/utility/_grid.scss +0 -200
- package/styles/utility/_icons.scss +0 -31
- package/styles/utility/_transitions.scss +0 -110
package/dist/Filters.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Filters.js","sources":["../src/components/Filters/Filters.vue"],"sourcesContent":["<script>\n import cloneDeep from 'lodash-es/cloneDeep';\n import merge from 'lodash-es/merge';\n import { nextTick, ref, toRefs } from 'vue';\n\n import useValidation from '../../composables/useValidation/useValidation';\n import { LLLV_CHANGE_TRIGGERS } from '../../constants';\n import { t } from '../../locale';\n import { persistentStorage } from '../../storage';\n import Button from '../Button/Button.vue';\n import Checkbox from '../Checkbox/Checkbox.vue';\n import DatePicker from '../DatePicker/DatePicker.vue';\n import Input from '../Input/Input.vue';\n import InputOptions from '../InputOptions/InputOptions.vue';\n import Radio from '../Radio/Radio.vue';\n import Select from '../Select/Select.vue';\n\n export default {\n name: 'll-filters',\n\n components: {\n 'll-button': Button,\n 'll-checkbox': Checkbox,\n 'll-input': Input,\n 'll-input-options': InputOptions,\n 'll-radio': Radio,\n 'll-select': Select,\n DatePicker,\n },\n\n props: {\n /**\n * Whether to disable the Apply button\n */\n disableApply: Boolean,\n /**\n * Whether to disable the Clear button\n */\n disableClear: Boolean,\n /**\n * Whether to disable the sticky filters\n * If disabled, a default pre-selected value(s) can be added to\n * the filter component's attributes\n */\n disablePersistency: Boolean,\n /**\n * Filters schema\n */\n schema: {\n type: Array,\n default: () => [],\n },\n /**\n * Validation schema function that returns an object\n */\n validationSchema: {\n type: Function,\n default: () => () => undefined,\n },\n },\n\n emits: ['change', 'submit', 'reset'],\n\n setup(props) {\n const { validationSchema: getValidationSchema } = toRefs(props);\n const validationSchema = getValidationSchema.value();\n const validationValues = ref({});\n\n // Without ref, `this.validation` will always evaluate to its initial value of `undefined` due to lack of reactivity.\n const validation = ref();\n\n function initValidation() {\n if (validationSchema?.toString() !== '[object Object]') {\n return;\n }\n\n validationValues.value = Object.keys(validationSchema).reduce((values, fieldName) => {\n values[fieldName] = undefined;\n\n return values;\n }, {});\n\n const validationRules = Object.entries(validationSchema).reduce((rules, [fieldName, fieldRules]) => {\n rules[fieldName] = fieldRules.map((fieldRule) => {\n return fieldRule(validationValues);\n });\n\n return rules;\n }, {});\n\n validation.value = useValidation({ rules: validationRules, values: validationValues });\n validation.value.validate();\n }\n\n return {\n validation,\n validationValues,\n initValidation,\n };\n },\n\n data() {\n return {\n applyText: t('ll.apply'),\n clearText: t('ll.clear'),\n filters: {},\n filterValues: {},\n forceRenderCount: 0,\n };\n },\n\n watch: {\n filterValues: {\n /**\n * Maps filters to a partcular object structure:\n * @param {IFilterSchemaItem} newFilterValues all selected filters\n * @returns {IFilter}\n */\n handler: function (newFilterValues) {\n const filters = Object.keys(newFilterValues).reduce((acc, i) => {\n const schema = this.schema[i];\n\n if (!schema || !schema.fieldToFilter) {\n return acc;\n }\n\n const item = newFilterValues[i];\n\n // Ignore empty string or undefined/null filter values\n if (item === '' || item == null) {\n return acc;\n }\n\n const trackBy = schema.attributes.trackBy || 'id';\n const isObject = typeof item === 'object';\n const isCustomFilterComponent = typeof schema.type === 'object';\n // TODO: remove handling of schema.attributes.multiple when we remove the vue-multiselect version of Select\n const isMultiple =\n (isCustomFilterComponent && schema.attributes.multiple) ||\n (!isCustomFilterComponent &&\n schema.type.includes('ll-select') &&\n (schema.attributes.multiple || !schema.attributes.single));\n const filterBy = isMultiple\n ? // local storage might have item stored as an object from the old Select\n (Array.isArray(item) ? item : [item]).map((v) => v[trackBy])\n : isObject\n ? [item[trackBy]]\n : [item];\n\n const groupedWith = schema.groupedWith;\n\n if (groupedWith) {\n filterBy[0] = {\n index: groupedWith,\n value: newFilterValues[groupedWith],\n };\n filterBy.push({\n index: Number(i),\n value: newFilterValues[i],\n });\n }\n\n filterBy.length &&\n (acc[schema.fieldToFilter] = {\n // don't add to `filters` if no filterBy\n filterBy,\n filterType: schema.type, // Informs the applied filter count\n isMultiple,\n ...('fn' in schema && { customFilter: schema.fn }),\n });\n\n return acc;\n }, {});\n\n this.filters = filters;\n this.$emit('change', filters);\n },\n\n deep: true,\n immediate: true,\n },\n\n filters() {\n if (this.validation) {\n this.updateValidationValues();\n }\n },\n },\n\n async created() {\n // initFilterValues updates the filterValues so using await nextTick() forces the code\n // after it to wait until nextTick is done, at which point the filterValues will\n // be done initializing. Otherwise, applyFilters sometimes applies the wrong\n // filters because filterValues is not done updating.\n this.initFilterValues();\n await nextTick();\n this.initValidation();\n this.applyFilters({ trigger: LLLV_CHANGE_TRIGGERS.LOAD });\n },\n\n methods: {\n initFilterValues() {\n if (this.disablePersistency) {\n this.filterValues = this.getDefaultFilterValues();\n\n return;\n }\n\n this.filterValues = this.getPersistentFilterValues() || this.getDefaultFilterValues();\n },\n\n /**\n * Apply the selected filters and save them to localStorage.\n * ListView calls this method using a ref to Filters.\n * The trigger option is used in ListView.\n * @param {object} [options] - optional parameters\n * @param {string} [options.trigger] - the action that triggered this function call\n */\n async applyFilters({ trigger = LLLV_CHANGE_TRIGGERS.APPLY } = {}) {\n if (this.validation) {\n await this.validation.validate();\n\n if (this.validation.hasErrors) {\n return;\n }\n }\n\n if (!this.disablePersistency) {\n this.persistFilterValues(this.filterValues);\n }\n\n this.$emit('submit', { trigger });\n },\n\n resetFilters() {\n this.filterValues = this.getDefaultFilterValues();\n\n this.forceRenderCount++;\n\n if (!this.disablePersistency) {\n this.persistFilterValues(this.filterValues);\n }\n\n // Emit after filters are updated\n this.$nextTick(() => {\n this.$emit('reset');\n });\n },\n\n /**\n * Returns pre-defined filter values to become the default values\n */\n getDefaultFilterValues() {\n return this.schema.reduce((acc, item, filterIndex) => {\n if (item.type === 'll-checkbox') {\n acc[filterIndex] = item.attributes.checked || false;\n } else if (Object.prototype.hasOwnProperty.call(item.attributes, 'modelValue')) {\n acc[filterIndex] = item.attributes.modelValue;\n }\n\n return acc;\n }, {});\n },\n\n /**\n * Intended for external use, when filter values need to be set for the user\n */\n setFilterValues(newValues) {\n this.filterValues = merge({}, this.filterValues, newValues);\n this.forceRenderCount++;\n },\n\n updateValidationValues() {\n const validatable = Object.keys(this.validationSchema());\n\n this.schema.forEach((fieldSchema, filterIndex) => {\n const fieldToFilter = fieldSchema.fieldToFilter;\n const validate = validatable.includes(fieldToFilter);\n\n if (validate) {\n const filter = this.filters[fieldToFilter];\n\n /**\n * Get all validatable fields.\n * Use parsed value of filters that are set,\n * otherwise fall back to `filterValue` value if not set.\n */\n const filterValue = filter\n ? filter.isMultiple\n ? filter.filterBy\n : filter.filterBy[0]\n : this.filterValues[filterIndex];\n\n this.validationValues[fieldToFilter] = filterValue;\n }\n });\n },\n\n /**\n * Change handler for filter fields\n */\n onChange(filter, filterValues, filterIndex) {\n if (filter.on?.change) {\n // Maps to `on.change` handlers in the filter schema.\n filter.on.change(filterValues, filterIndex);\n }\n },\n\n /**\n * Select input event handler for filter fields\n */\n onSelectInput(newValue, filter, filterIndex) {\n if (newValue === undefined) {\n delete this.filterValues[filterIndex]; // prevent undefined filterValues which cause an empty result list\n } else {\n this.filterValues[filterIndex] = newValue;\n }\n\n this.onChange(filter, this.filterValues, filterIndex);\n },\n\n /**\n * Get filter values from local storage.\n * @returns {any}\n */\n getPersistentFilterValues() {\n return persistentStorage.get('filter-values');\n },\n\n /**\n * Clone new filterValues to remove reactivity, and save them to localStorage.\n * @param {object} newValues - the filterValues to be persisted in localStorage\n */\n persistFilterValues(newValues) {\n persistentStorage.set('filter-values', cloneDeep(newValues));\n },\n },\n };\n</script>\n\n<template>\n <div class=\"ll-grid ll-grid-cols-4 md:ll-grid-cols-12\">\n <template v-for=\"(filter, filterIndex) in schema\">\n <div\n v-if=\"!filter.hidden\"\n :key=\"`${filterIndex} ${forceRenderCount}`\"\n class=\"field-wrapper col-span-4 md:col-span-3\"\n :class=\"{ 'hidden-sm-only': !filter.type, 'flex align-bottom': filter.type === 'll-checkbox' }\"\n :data-test=\"`filter|${filter.fieldToFilter}`\"\n >\n <!-- Filter component -->\n <ll-select\n v-if=\"filter.type === 'll-select'\"\n v-bind=\"filter.attributes\"\n :error=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n :model-value=\"filterValues[filterIndex]\"\n @update:model-value=\"(newValue) => onSelectInput(newValue, filter, filterIndex)\"\n />\n <ll-checkbox\n v-else-if=\"filter.type === 'll-checkbox'\"\n v-model:checked=\"filterValues[filterIndex]\"\n v-bind=\"filter.attributes\"\n :error-text=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n @update:checked=\"onChange(filter, filterValues, filterIndex)\"\n />\n <ll-radio\n v-else-if=\"filter.type === 'll-radio'\"\n v-model:checked=\"filterValues[filterIndex]\"\n v-bind=\"filter.attributes\"\n :error-text=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n @update:checked=\"onChange(filter, filterValues, filterIndex)\"\n />\n <component\n v-bind=\"filter.attributes\"\n :is=\"filter.type\"\n v-else-if=\"filter.type\"\n v-model=\"filterValues[filterIndex]\"\n :error-text=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n @update:model-value=\"onChange(filter, filterValues, filterIndex)\"\n >\n <template v-if=\"filter.slots && filter.slots.selected\" #selected=\"{ option }\">\n <component :is=\"filter.slots.selected\" v-bind=\"option.props\" />\n </template>\n <template v-if=\"filter.slots && filter.slots.option\" #option=\"{ option }\">\n <component :is=\"filter.slots.option\" v-bind=\"option.props\" />\n </template>\n <template v-if=\"filter.slots && filter.slots.prepend\" #prepend>\n <span v-html=\"filter.slots.prepend\"></span>\n </template>\n <template v-if=\"filter.slots && filter.slots.append\" #append>\n <span v-html=\"filter.slots.append\"></span>\n </template>\n </component>\n </div>\n </template>\n <div\n class=\"flex align-right align-bottom button-grid col-span-4 md:col-span-12\"\n :class=\"$style['filter-button-group']\"\n >\n <ll-button secondary data-test=\"button|reset-filters\" :disabled=\"disableClear\" @click=\"resetFilters\">\n {{ clearText }}\n </ll-button>\n <ll-button\n primary\n data-test=\"button|apply-filters\"\n :disabled=\"disableApply || validation?.hasErrors\"\n @click=\"applyFilters\"\n >\n {{ applyText }}\n </ll-button>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\" module>\n .filter-button-group {\n @include breakpoint('sm-only') {\n display: flex;\n flex-direction: column-reverse;\n }\n\n button {\n @include breakpoint('sm-only') {\n width: 100% !important;\n }\n\n &:nth-child(2) {\n @include breakpoint('sm-only') {\n margin-bottom: space(2);\n }\n }\n }\n }\n</style>\n"],"names":["_sfc_main","Button","Checkbox","Input","InputOptions","Radio","Select","DatePicker","props","getValidationSchema","toRefs","validationSchema","validationValues","ref","validation","initValidation","values","fieldName","validationRules","rules","fieldRules","fieldRule","useValidation","t","newFilterValues","filters","acc","schema","item","trackBy","isObject","isCustomFilterComponent","isMultiple","filterBy","v","groupedWith","nextTick","LLLV_CHANGE_TRIGGERS","trigger","filterIndex","newValues","merge","validatable","fieldSchema","fieldToFilter","filter","filterValue","filterValues","_a","newValue","persistentStorage","cloneDeep","_hoisted_1","_openBlock","_createElementBlock","_Fragment","_renderList","$props","$data","_normalizeClass","_createBlock","_component_ll_select","_mergeProps","$setup","_b","$options","_component_ll_checkbox","$event","_c","_d","_component_ll_radio","_e","_f","_resolveDynamicComponent","_g","_h","_withCtx","option","_normalizeProps","_guardReactiveProps","_createElementVNode","_ctx","_createVNode","_component_ll_button"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBOA,KAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,aAAaC;AAAA,IACb,eAAeC;AAAA,IACf,YAAYC;AAAA,IACZ,oBAAoBC;AAAA,IACpB,YAAYC;AAAA,IACZ,aAAaC;AAAA,IACb,YAAAC;AAAA,EACD;AAAA,EAED,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,cAAc;AAAA;AAAA;AAAA;AAAA,IAId,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMd,oBAAoB;AAAA;AAAA;AAAA;AAAA,IAIpB,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS,MAAM,CAAE;AAAA,IAClB;AAAA;AAAA;AAAA;AAAA,IAID,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,SAAS,MAAM,MAAA;AAAA;AAAA,IAChB;AAAA,EACF;AAAA,EAED,OAAO,CAAC,UAAU,UAAU,OAAO;AAAA,EAEnC,MAAMC,GAAO;AACX,UAAM,EAAE,kBAAkBC,EAAoB,IAAIC,EAAOF,CAAK,GACxDG,IAAmBF,EAAoB,SACvCG,IAAmBC,EAAI,CAAA,CAAE,GAGzBC,IAAaD;AAEnB,aAASE,IAAiB;AACxB,WAAIJ,KAAA,gBAAAA,EAAkB,gBAAe;AACnC;AAGF,MAAAC,EAAiB,QAAQ,OAAO,KAAKD,CAAgB,EAAE,OAAO,CAACK,GAAQC,OACrED,EAAOC,CAAS,IAAI,QAEbD,IACN,CAAE,CAAA;AAEL,YAAME,IAAkB,OAAO,QAAQP,CAAgB,EAAE,OAAO,CAACQ,GAAO,CAACF,GAAWG,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AAAiC,EAAAC,EAAUF,EAAO,KAAK,CAAA,GAAA,MAAA,EAAA;AAAA;;;YAE7ChC,EAAO,SAASA,EAAO,MAAM;oBAAS;AAAA,cACpD,IAAA+B,EAAA,CAA6D,EADC,QAAAC,QAAM;AAAA,sBACpEjB,EAA6Da,EAA7C5B,EAAO,MAAM,MAAM,GAAAiC,EAAAC,EAAUF,EAAO,KAAK,CAAA,GAAA,MAAA,EAAA;AAAA;;;YAE3ChC,EAAO,SAASA,EAAO,MAAM;oBAAU;AAAA,oBACrD,MAA2C;AAAA,gBAA3CmC,EAA2C,QAAA;AAAA,kBAArC,WAAQnC,EAAO,MAAM;AAAA;;;;YAEbA,EAAO,SAASA,EAAO,MAAM;oBAAS;AAAA,oBACpD,MAA0C;AAAA,gBAA1CmC,EAA0C,QAAA;AAAA,kBAApC,WAAQnC,EAAO,MAAM;AAAA;;;;;;;;IAKnCmC,EAeM,OAAA;AAAA,MAdJ,OAAKrB,EAAA,CAAC,uEACEsB,EAAM,OAAA,qBAAA,CAAA,CAAA;AAAA;MAEdC,EAEYC,GAAA;AAAA,QAFD,WAAA;AAAA,QAAU,aAAU;AAAA,QAAwB,UAAU1B,EAAY;AAAA,QAAG,SAAOQ,EAAY;AAAA;mBACjG,MAAe;AAAA,cAAZP,EAAS,SAAA,GAAA,CAAA;AAAA;;;MAEdwB,EAOYC,GAAA;AAAA,QANV,SAAA;AAAA,QACA,aAAU;AAAA,QACT,UAAU1B,EAAA,kBAAgBT,IAAAe,EAAA,eAAA,gBAAAf,EAAY;AAAA,QACtC,SAAOiB,EAAY;AAAA;mBAEpB,MAAe;AAAA,cAAZP,EAAS,SAAA,GAAA,CAAA;AAAA;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Filters.js","sources":["../src/components/Filters/Filters.vue"],"sourcesContent":["<script>\n import cloneDeep from 'lodash-es/cloneDeep';\n import merge from 'lodash-es/merge';\n import { nextTick, ref, toRefs } from 'vue';\n\n import useValidation from '../../composables/useValidation/useValidation';\n import { LLLV_CHANGE_TRIGGERS } from '../../constants';\n import { t } from '../../locale';\n import { persistentStorage } from '../../storage';\n import Button from '../Button/Button.vue';\n import Checkbox from '../Checkbox/Checkbox.vue';\n import DatePicker from '../DatePicker/DatePicker.vue';\n import Input from '../Input/Input.vue';\n import InputOptions from '../InputOptions/InputOptions.vue';\n import Radio from '../Radio/Radio.vue';\n import Select from '../Select/Select.vue';\n\n export default {\n name: 'll-filters',\n\n components: {\n 'll-button': Button,\n 'll-checkbox': Checkbox,\n 'll-input': Input,\n 'll-input-options': InputOptions,\n 'll-radio': Radio,\n 'll-select': Select,\n DatePicker,\n },\n\n props: {\n /**\n * Whether to disable the Apply button\n */\n disableApply: Boolean,\n /**\n * Whether to disable the Clear button\n */\n disableClear: Boolean,\n /**\n * Whether to disable the sticky filters\n * If disabled, a default pre-selected value(s) can be added to\n * the filter component's attributes\n */\n disablePersistency: Boolean,\n /**\n * Filters schema\n */\n schema: {\n type: Array,\n default: () => [],\n },\n /**\n * Validation schema function that returns an object\n */\n validationSchema: {\n type: Function,\n default: () => () => undefined,\n },\n },\n\n emits: ['change', 'submit', 'reset'],\n\n setup(props) {\n const { validationSchema: getValidationSchema } = toRefs(props);\n const validationSchema = getValidationSchema.value();\n const validationValues = ref({});\n\n // Without ref, `this.validation` will always evaluate to its initial value of `undefined` due to lack of reactivity.\n const validation = ref();\n\n function initValidation() {\n if (validationSchema?.toString() !== '[object Object]') {\n return;\n }\n\n validationValues.value = Object.keys(validationSchema).reduce((values, fieldName) => {\n values[fieldName] = undefined;\n\n return values;\n }, {});\n\n const validationRules = Object.entries(validationSchema).reduce((rules, [fieldName, fieldRules]) => {\n rules[fieldName] = fieldRules.map((fieldRule) => {\n return fieldRule(validationValues);\n });\n\n return rules;\n }, {});\n\n validation.value = useValidation({ rules: validationRules, values: validationValues });\n validation.value.validate();\n }\n\n return {\n validation,\n validationValues,\n initValidation,\n };\n },\n\n data() {\n return {\n applyText: t('ll.apply'),\n clearText: t('ll.clear'),\n filters: {},\n filterValues: {},\n forceRenderCount: 0,\n };\n },\n\n watch: {\n filterValues: {\n /**\n * Maps filters to a partcular object structure:\n * @param {IFilterSchemaItem} newFilterValues all selected filters\n * @returns {IFilter}\n */\n handler: function (newFilterValues) {\n const filters = Object.keys(newFilterValues).reduce((acc, i) => {\n const schema = this.schema[i];\n\n if (!schema || !schema.fieldToFilter) {\n return acc;\n }\n\n const item = newFilterValues[i];\n\n // Ignore empty string or undefined/null filter values\n if (item === '' || item == null) {\n return acc;\n }\n\n const trackBy = schema.attributes.trackBy || 'id';\n const isObject = typeof item === 'object';\n const isCustomFilterComponent = typeof schema.type === 'object';\n // TODO: remove handling of schema.attributes.multiple when we remove the vue-multiselect version of Select\n const isMultiple =\n (isCustomFilterComponent && schema.attributes.multiple) ||\n (!isCustomFilterComponent &&\n schema.type.includes('ll-select') &&\n (schema.attributes.multiple || !schema.attributes.single));\n const filterBy = isMultiple\n ? // local storage might have item stored as an object from the old Select\n (Array.isArray(item) ? item : [item]).map((v) => v[trackBy])\n : isObject\n ? [item[trackBy]]\n : [item];\n\n const groupedWith = schema.groupedWith;\n\n if (groupedWith) {\n filterBy[0] = {\n index: groupedWith,\n value: newFilterValues[groupedWith],\n };\n filterBy.push({\n index: Number(i),\n value: newFilterValues[i],\n });\n }\n\n filterBy.length &&\n (acc[schema.fieldToFilter] = {\n // don't add to `filters` if no filterBy\n filterBy,\n filterType: schema.type, // Informs the applied filter count\n isMultiple,\n ...('fn' in schema && { customFilter: schema.fn }),\n });\n\n return acc;\n }, {});\n\n this.filters = filters;\n this.$emit('change', filters);\n },\n\n deep: true,\n immediate: true,\n },\n\n filters() {\n if (this.validation) {\n this.updateValidationValues();\n }\n },\n },\n\n async created() {\n // initFilterValues updates the filterValues so using await nextTick() forces the code\n // after it to wait until nextTick is done, at which point the filterValues will\n // be done initializing. Otherwise, applyFilters sometimes applies the wrong\n // filters because filterValues is not done updating.\n this.initFilterValues();\n await nextTick();\n this.initValidation();\n this.applyFilters({ trigger: LLLV_CHANGE_TRIGGERS.LOAD });\n },\n\n methods: {\n initFilterValues() {\n if (this.disablePersistency) {\n this.filterValues = this.getDefaultFilterValues();\n\n return;\n }\n\n this.filterValues = this.getPersistentFilterValues() || this.getDefaultFilterValues();\n },\n\n /**\n * Apply the selected filters and save them to localStorage.\n * ListView calls this method using a ref to Filters.\n * The trigger option is used in ListView.\n * @param {object} [options] - optional parameters\n * @param {string} [options.trigger] - the action that triggered this function call\n */\n async applyFilters({ trigger = LLLV_CHANGE_TRIGGERS.APPLY } = {}) {\n if (this.validation) {\n await this.validation.validate();\n\n if (this.validation.hasErrors) {\n return;\n }\n }\n\n if (!this.disablePersistency) {\n this.persistFilterValues(this.filterValues);\n }\n\n this.$emit('submit', { trigger });\n },\n\n resetFilters() {\n this.filterValues = this.getDefaultFilterValues();\n\n this.forceRenderCount++;\n\n if (!this.disablePersistency) {\n this.persistFilterValues(this.filterValues);\n }\n\n // Emit after filters are updated\n this.$nextTick(() => {\n this.$emit('reset');\n });\n },\n\n /**\n * Returns pre-defined filter values to become the default values\n */\n getDefaultFilterValues() {\n return this.schema.reduce((acc, item, filterIndex) => {\n if (item.type === 'll-checkbox') {\n acc[filterIndex] = item.attributes.checked || false;\n } else if (Object.prototype.hasOwnProperty.call(item.attributes, 'modelValue')) {\n acc[filterIndex] = item.attributes.modelValue;\n }\n\n return acc;\n }, {});\n },\n\n /**\n * Intended for external use, when filter values need to be set for the user\n */\n setFilterValues(newValues) {\n this.filterValues = merge({}, this.filterValues, newValues);\n this.forceRenderCount++;\n },\n\n updateValidationValues() {\n const validatable = Object.keys(this.validationSchema());\n\n this.schema.forEach((fieldSchema, filterIndex) => {\n const fieldToFilter = fieldSchema.fieldToFilter;\n const validate = validatable.includes(fieldToFilter);\n\n if (validate) {\n const filter = this.filters[fieldToFilter];\n\n /**\n * Get all validatable fields.\n * Use parsed value of filters that are set,\n * otherwise fall back to `filterValue` value if not set.\n */\n const filterValue = filter\n ? filter.isMultiple\n ? filter.filterBy\n : filter.filterBy[0]\n : this.filterValues[filterIndex];\n\n this.validationValues[fieldToFilter] = filterValue;\n }\n });\n },\n\n /**\n * Change handler for filter fields\n */\n onChange(filter, filterValues, filterIndex) {\n if (filter.on?.change) {\n // Maps to `on.change` handlers in the filter schema.\n filter.on.change(filterValues, filterIndex);\n }\n },\n\n /**\n * Select input event handler for filter fields\n */\n onSelectInput(newValue, filter, filterIndex) {\n if (newValue === undefined) {\n delete this.filterValues[filterIndex]; // prevent undefined filterValues which cause an empty result list\n } else {\n this.filterValues[filterIndex] = newValue;\n }\n\n this.onChange(filter, this.filterValues, filterIndex);\n },\n\n /**\n * Get filter values from local storage.\n * @returns {any}\n */\n getPersistentFilterValues() {\n return persistentStorage.get('filter-values');\n },\n\n /**\n * Clone new filterValues to remove reactivity, and save them to localStorage.\n * @param {object} newValues - the filterValues to be persisted in localStorage\n */\n persistFilterValues(newValues) {\n persistentStorage.set('filter-values', cloneDeep(newValues));\n },\n },\n };\n</script>\n\n<template>\n <div class=\"ll-grid ll-grid-cols-4 md:ll-grid-cols-12\">\n <template v-for=\"(filter, filterIndex) in schema\">\n <div\n v-if=\"!filter.hidden\"\n :key=\"`${filterIndex} ${forceRenderCount}`\"\n class=\"field-wrapper col-span-4 md:col-span-3\"\n :class=\"{ 'hidden-sm-only': !filter.type, 'flex align-bottom': filter.type === 'll-checkbox' }\"\n :data-test=\"`filter|${filter.fieldToFilter}`\"\n >\n <!-- Filter component -->\n <ll-select\n v-if=\"filter.type === 'll-select'\"\n v-bind=\"filter.attributes\"\n :error=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n :model-value=\"filterValues[filterIndex]\"\n @update:model-value=\"(newValue) => onSelectInput(newValue, filter, filterIndex)\"\n />\n <ll-checkbox\n v-else-if=\"filter.type === 'll-checkbox'\"\n v-model:checked=\"filterValues[filterIndex]\"\n v-bind=\"filter.attributes\"\n :error-text=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n @update:checked=\"onChange(filter, filterValues, filterIndex)\"\n />\n <ll-radio\n v-else-if=\"filter.type === 'll-radio'\"\n v-model:checked=\"filterValues[filterIndex]\"\n v-bind=\"filter.attributes\"\n :error-text=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n @update:checked=\"onChange(filter, filterValues, filterIndex)\"\n />\n <component\n v-bind=\"filter.attributes\"\n :is=\"filter.type\"\n v-else-if=\"filter.type\"\n v-model=\"filterValues[filterIndex]\"\n :error-text=\"validation?.fields[filter.fieldToFilter] && validation?.getError(filter.fieldToFilter)\"\n :label=\"filter.label\"\n @update:model-value=\"onChange(filter, filterValues, filterIndex)\"\n >\n <template v-if=\"filter.slots && filter.slots.selected\" #selected=\"{ option }\">\n <component :is=\"filter.slots.selected\" v-bind=\"option.props\" />\n </template>\n <template v-if=\"filter.slots && filter.slots.option\" #option=\"{ option }\">\n <component :is=\"filter.slots.option\" v-bind=\"option.props\" />\n </template>\n <template v-if=\"filter.slots && filter.slots.prepend\" #prepend>\n <span v-html=\"filter.slots.prepend\"></span>\n </template>\n <template v-if=\"filter.slots && filter.slots.append\" #append>\n <span v-html=\"filter.slots.append\"></span>\n </template>\n </component>\n </div>\n </template>\n <div\n class=\"flex align-right align-bottom button-grid col-span-4 md:col-span-12\"\n :class=\"$style['filter-button-group']\"\n >\n <ll-button secondary data-test=\"button|reset-filters\" :disabled=\"disableClear\" @click=\"resetFilters\">\n {{ clearText }}\n </ll-button>\n <ll-button\n primary\n data-test=\"button|apply-filters\"\n :disabled=\"disableApply || validation?.hasErrors\"\n @click=\"applyFilters\"\n >\n {{ applyText }}\n </ll-button>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\" module>\n .filter-button-group {\n @include breakpoint('sm-only') {\n display: flex;\n flex-direction: column-reverse;\n }\n\n button {\n @include breakpoint('sm-only') {\n width: 100% !important;\n }\n\n &:nth-child(2) {\n @include breakpoint('sm-only') {\n margin-bottom: space(2);\n }\n }\n }\n }\n</style>\n"],"names":["_sfc_main","Button","Checkbox","Input","InputOptions","Radio","Select","DatePicker","props","getValidationSchema","toRefs","validationSchema","validationValues","ref","validation","initValidation","values","fieldName","validationRules","rules","fieldRules","fieldRule","useValidation","t","newFilterValues","filters","acc","schema","item","trackBy","isObject","isCustomFilterComponent","isMultiple","filterBy","v","groupedWith","nextTick","LLLV_CHANGE_TRIGGERS","trigger","filterIndex","newValues","merge","validatable","fieldSchema","fieldToFilter","filter","filterValue","filterValues","_a","newValue","persistentStorage","cloneDeep","_hoisted_1","_openBlock","_createElementBlock","_Fragment","_renderList","$props","$data","_normalizeClass","_createBlock","_component_ll_select","_mergeProps","$setup","_b","$options","_component_ll_checkbox","$event","_c","_d","_component_ll_radio","_e","_f","_resolveDynamicComponent","_g","_h","_withCtx","option","_normalizeProps","_guardReactiveProps","_createElementVNode","_ctx","_createVNode","_component_ll_button"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBOA,KAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,aAAaC;AAAA,IACb,eAAeC;AAAA,IACf,YAAYC;AAAA,IACZ,oBAAoBC;AAAA,IACpB,YAAYC;AAAA,IACZ,aAAaC;AAAA,IACb,YAAAC;AAAA,EACD;AAAA,EAED,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,cAAc;AAAA;AAAA;AAAA;AAAA,IAId,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMd,oBAAoB;AAAA;AAAA;AAAA;AAAA,IAIpB,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS,MAAM,CAAE;AAAA,IAClB;AAAA;AAAA;AAAA;AAAA,IAID,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,SAAS,MAAM,MAAA;AAAA;AAAA,IAChB;AAAA,EACF;AAAA,EAED,OAAO,C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,cAAZP,EAAS,SAAA,GAAA,CAAA;AAAA;;;MAEdwB,EAOYC,GAAA;AAAA,QANV,SAAA;AAAA,QACA,aAAU;AAAA,QACT,UAAU1B,EAAA,kBAAgBT,IAAAe,EAAA,eAAA,gBAAAf,EAAY;AAAA,QACtC,SAAOiB,EAAY;AAAA;mBAEpB,MAAe;AAAA,cAAZP,EAAS,SAAA,GAAA,CAAA;AAAA;;;;;;;;;"}
|
package/dist/HttpError.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { openBlock as p, createElementBlock as h, createStaticVNode as
|
|
1
|
+
import { openBlock as p, createElementBlock as h, createStaticVNode as y, defineComponent as k, useCssModule as C, useSlots as L, computed as l, resolveComponent as B, normalizeClass as i, unref as o, createElementVNode as r, createVNode as n, withCtx as m, toDisplayString as a, createTextVNode as c, renderSlot as S, createCommentVNode as j } from "vue";
|
|
2
2
|
import { t } from "./locale.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { _ as
|
|
3
|
+
import b from "./Button.js";
|
|
4
|
+
import H, { IllustrationType as N, VignetteName as X } from "./Illustration.js";
|
|
5
|
+
import { _ as I } from "./_plugin-vue_export-helper-dad06003.js";
|
|
6
6
|
import "lodash-es/get";
|
|
7
|
-
import "./Button.vue_used_vue_type_style_index_0_lang.module-
|
|
7
|
+
import "./Button.vue_used_vue_type_style_index_0_lang.module-b2ee90e6.js";
|
|
8
8
|
import "lodash-es/uniqueId";
|
|
9
9
|
import "./index-79ce320f.js";
|
|
10
|
-
const
|
|
10
|
+
const $ = {
|
|
11
11
|
viewBox: "0 0 139 24",
|
|
12
12
|
fill: "none",
|
|
13
13
|
xmlns: "http://www.w3.org/2000/svg"
|
|
14
|
-
},
|
|
15
|
-
|
|
14
|
+
}, z = /* @__PURE__ */ y('<g clip-path="url(#a)" fill="#fff"><path d="M35.265.248h3.883V23.82h-3.883V.248ZM57.586 17.127H45.493c.433 2.143 2.11 3.231 4.422 3.231 1.708 0 3.316-.66 4.254-1.912l2.58 1.945c-1.44 2.242-4.188 3.429-7.036 3.429-4.689 0-8.24-3.231-8.24-8.045 0-4.912 3.752-8.012 8.207-8.012 4.49 0 8.007 3.068 8.007 7.88-.005.496-.038.991-.1 1.483ZM53.8 14.456c-.234-2.11-1.876-3.33-4.053-3.33-2.11 0-3.785.99-4.254 3.33H53.8ZM76.628 8.093V23.82H72.74v-2.407c-1.071 1.648-3.282 2.407-5.196 2.407-4.12 0-7.709-3.132-7.709-8.045 0-4.944 3.552-8.012 7.672-8.012 1.977 0 4.158.758 5.226 2.374V8.09l3.894.002Zm-3.953 7.65c0-2.705-2.278-4.419-4.522-4.419-2.412 0-4.389 1.846-4.389 4.418s1.977 4.484 4.389 4.484c2.378 0 4.522-1.78 4.522-4.484ZM83.997 7.071v1.352h3.484v3.069h-3.484V23.82h-3.882V7.269c0-4.418 2.14-7.089 6.495-7.089h1.843l-1.072 3.56c-2.647 0-3.418 1.452-3.384 3.331ZM91.182.25h3.886v23.57h-3.886V.25ZM97.993 2.983c0-1.352 1.172-2.34 2.546-2.34 1.407 0 2.512.988 2.512 2.34 0 1.319-1.105 2.34-2.512 2.34-1.37 0-2.546-1.021-2.546-2.34Zm.606 5.44h3.886V23.82h-3.886V8.423ZM120.934 15.183v8.637h-3.885v-8.276c0-2.44-1.508-3.692-3.25-3.692-1.776 0-3.984.956-3.984 3.92v8.045h-3.891V8.423h3.886v2.44c.803-1.913 3.249-2.77 4.857-2.77 4.023 0 6.267 2.604 6.267 7.09ZM134.073 23.82l-6.098-6.99v6.99h-3.885V.248h3.885v13.087l4.489-4.912h5.059l-6.365 6.726 7.838 8.67h-4.923ZM7.219 19.014v-4.518L0 23.813h4.195l3.092-3.99a4.958 4.958 0 0 1-.068-.81ZM14.74 22.429a3.8 3.8 0 0 1-2.657-1.095 3.68 3.68 0 0 1-1.097-2.621c0-.03.01-11.764.01-13.665.003-1.747 1.502-3.333 3.442-3.333.87 0 1.706.323 2.343.906A4.876 4.876 0 0 0 14.408.589a4.971 4.971 0 0 0-3.139-.193 4.902 4.902 0 0 0-2.61 1.726 4.771 4.771 0 0 0-1.007 2.932v13.943c0 2.521 2.11 4.802 4.9 4.802a4.905 4.905 0 0 0 2.834-.887c.345-.238.658-.517.932-.831a3.755 3.755 0 0 1-1.578.348Z"></path><path d="M18.023 19.003v-4.517l-4.23 5.428c-.219.282-.53.481-.883.562-.351.082-.72.04-1.044-.117.265.46.641.848 1.094 1.132a3.338 3.338 0 0 0 3.073.248c.494-.207.929-.53 1.267-.941l.788-1.008a4.672 4.672 0 0 1-.065-.787ZM25.55 22.429a3.8 3.8 0 0 1-2.657-1.094 3.679 3.679 0 0 1-1.096-2.622l.01-13.665c0-1.745 1.5-3.33 3.441-3.33.868.001 1.703.325 2.338.907A4.875 4.875 0 0 0 25.216.594 4.971 4.971 0 0 0 22.077.4a4.902 4.902 0 0 0-2.61 1.724 4.77 4.77 0 0 0-1.01 2.93v13.943c0 2.521 2.111 4.802 4.9 4.802a4.904 4.904 0 0 0 2.835-.887c.345-.238.658-.517.932-.831a3.758 3.758 0 0 1-1.574.348Z"></path><path d="m26.12 17.93-1.523 1.983c-.219.282-.53.48-.881.562-.352.081-.72.04-1.044-.116.266.46.642.848 1.095 1.132a3.339 3.339 0 0 0 3.073.248c.494-.207.929-.53 1.268-.941l.67-.864-2.657-2.004ZM25.243 2.169c-.547 0-1.084.147-1.553.425a2.99 2.99 0 0 0-1.11 1.151 1.58 1.58 0 0 1 1.973.31 1.52 1.52 0 0 1 .044 1.965L22.23 9.077v5.4l5.02-6.46a4.711 4.711 0 0 0 1.01-2.92 2.943 2.943 0 0 0-.897-2.074 3.038 3.038 0 0 0-2.119-.854ZM14.438 2.169a3.055 3.055 0 0 0-1.551.426 2.99 2.99 0 0 0-1.108 1.15 1.58 1.58 0 0 1 1.97.312 1.52 1.52 0 0 1 .044 1.963l-2.368 3.057v5.4l5.019-6.46a4.713 4.713 0 0 0 1.008-2.92 2.943 2.943 0 0 0-.897-2.073 3.038 3.038 0 0 0-2.117-.855Z"></path></g><defs><clipPath id="a"><path fill="#fff" transform="translate(0 .18)" d="M0 0h139v23.64H0z"></path></clipPath></defs>', 2), T = [
|
|
15
|
+
z
|
|
16
16
|
];
|
|
17
|
-
function
|
|
18
|
-
return p(), h("svg",
|
|
17
|
+
function A(d, e) {
|
|
18
|
+
return p(), h("svg", $, T);
|
|
19
19
|
}
|
|
20
|
-
const
|
|
20
|
+
const D = { render: A }, P = { class: "heading-jumbo tw-m-0 tw-mb-3 !tw-text-white" }, F = { class: "tw-mb-8 tw-text-white" }, R = { class: "tw-mb-4 tw-text-white" }, Y = ["href"], q = /* @__PURE__ */ r("a", {
|
|
21
21
|
href: "mailto:support@leaflink.com",
|
|
22
22
|
class: "link"
|
|
23
23
|
}, "support@leaflink.com", -1), G = {
|
|
24
24
|
key: 0,
|
|
25
25
|
class: "tw-flex tw-items-start tw-gap-6"
|
|
26
|
-
}, J = /* @__PURE__ */
|
|
26
|
+
}, J = /* @__PURE__ */ k({
|
|
27
27
|
__name: "HttpError",
|
|
28
28
|
props: {
|
|
29
29
|
description: { default: "" },
|
|
@@ -67,9 +67,9 @@ const P = { render: D }, j = { class: "heading-jumbo !tw-text-white tw-m-0 tw-mb
|
|
|
67
67
|
title: t("ll.httpError.504.title"),
|
|
68
68
|
description: t("ll.httpError.504.description")
|
|
69
69
|
}
|
|
70
|
-
}, s = C(),
|
|
71
|
-
return (
|
|
72
|
-
const
|
|
70
|
+
}, s = C(), f = L(), v = l(() => e.errorCode.toString()), w = l(() => parseInt(v.value, 10)), u = l(() => _[w.value] || _[500]), g = l(() => e.title || u.value.title), E = l(() => e.description || u.value.description), M = l(() => !e.hideLogoutButton && e.onLogout), V = l(() => e.retryLink || window.location.href);
|
|
71
|
+
return (Z, rt) => {
|
|
72
|
+
const x = B("router-link");
|
|
73
73
|
return p(), h("div", {
|
|
74
74
|
class: i(["stash-http-error tw-min-h-screen tw-px-6 tw-py-12", o(s).root]),
|
|
75
75
|
"data-test": "stash-http-error"
|
|
@@ -77,12 +77,12 @@ const P = { render: D }, j = { class: "heading-jumbo !tw-text-white tw-m-0 tw-mb
|
|
|
77
77
|
r("div", {
|
|
78
78
|
class: i(o(s).wrapper)
|
|
79
79
|
}, [
|
|
80
|
-
n(
|
|
80
|
+
n(x, {
|
|
81
81
|
to: "/",
|
|
82
82
|
class: i(["tw-mb-8", o(s).logo])
|
|
83
83
|
}, {
|
|
84
|
-
default:
|
|
85
|
-
n(o(
|
|
84
|
+
default: m(() => [
|
|
85
|
+
n(o(D), {
|
|
86
86
|
width: "192",
|
|
87
87
|
height: "33"
|
|
88
88
|
})
|
|
@@ -95,12 +95,12 @@ const P = { render: D }, j = { class: "heading-jumbo !tw-text-white tw-m-0 tw-mb
|
|
|
95
95
|
r("div", {
|
|
96
96
|
class: i(["tw-order-2 lg:tw-order-1", o(s).content__text])
|
|
97
97
|
}, [
|
|
98
|
-
r("h1",
|
|
98
|
+
r("h1", P, a(g.value), 1),
|
|
99
99
|
r("h2", F, "Error Code: " + a(e.errorCode), 1),
|
|
100
100
|
r("p", R, [
|
|
101
101
|
c(a(E.value) + " You can ", 1),
|
|
102
102
|
r("a", {
|
|
103
|
-
href:
|
|
103
|
+
href: V.value,
|
|
104
104
|
class: "link"
|
|
105
105
|
}, "try again", 8, Y),
|
|
106
106
|
c(" or reach out to "),
|
|
@@ -111,31 +111,31 @@ const P = { render: D }, j = { class: "heading-jumbo !tw-text-white tw-m-0 tw-mb
|
|
|
111
111
|
r("div", {
|
|
112
112
|
class: i(["tw-order-1 lg:tw-order-2", o(s).illustration])
|
|
113
113
|
}, [
|
|
114
|
-
n(
|
|
114
|
+
n(H, {
|
|
115
115
|
size: 300,
|
|
116
|
-
type: o(
|
|
117
|
-
name: o(
|
|
116
|
+
type: o(N).Vignette,
|
|
117
|
+
name: o(X).SearchStorefront
|
|
118
118
|
}, null, 8, ["type", "name"])
|
|
119
119
|
], 2)
|
|
120
120
|
], 2),
|
|
121
|
-
o(
|
|
122
|
-
S(
|
|
123
|
-
n(
|
|
121
|
+
o(f).actions || M.value ? (p(), h("div", G, [
|
|
122
|
+
S(Z.$slots, "actions", {}, () => [
|
|
123
|
+
n(b, {
|
|
124
124
|
tertiary: "",
|
|
125
125
|
onClick: e.onLogout
|
|
126
126
|
}, {
|
|
127
|
-
default:
|
|
127
|
+
default: m(() => [
|
|
128
128
|
c("Logout")
|
|
129
129
|
]),
|
|
130
130
|
_: 1
|
|
131
131
|
}, 8, ["onClick"])
|
|
132
132
|
])
|
|
133
|
-
])) :
|
|
133
|
+
])) : j("", !0)
|
|
134
134
|
], 2)
|
|
135
135
|
], 2);
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
-
}), K = "
|
|
138
|
+
}), K = "_root_1ch6j_2", O = "_wrapper_1ch6j_11", Q = "_content_1ch6j_16", U = "_illustration_1ch6j_22", W = "_content__text_1ch6j_40", tt = "_logo_1ch6j_54", ot = {
|
|
139
139
|
root: K,
|
|
140
140
|
wrapper: O,
|
|
141
141
|
content: Q,
|
|
@@ -144,7 +144,7 @@ const P = { render: D }, j = { class: "heading-jumbo !tw-text-white tw-m-0 tw-mb
|
|
|
144
144
|
logo: tt
|
|
145
145
|
}, et = {
|
|
146
146
|
$style: ot
|
|
147
|
-
}, _t = /* @__PURE__ */
|
|
147
|
+
}, _t = /* @__PURE__ */ I(J, [["__cssModules", et]]);
|
|
148
148
|
export {
|
|
149
149
|
_t as default
|
|
150
150
|
};
|
package/dist/HttpError.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpError.js","sources":["../assets/logos/leaflink-white-logo-full.svg?component","../src/components/HttpError/HttpError.vue"],"sourcesContent":["import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createStaticVNode as _createStaticVNode } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 139 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createStaticVNode(\"<g clip-path=\\\"url(#a)\\\" fill=\\\"#fff\\\"><path d=\\\"M35.265.248h3.883V23.82h-3.883V.248ZM57.586 17.127H45.493c.433 2.143 2.11 3.231 4.422 3.231 1.708 0 3.316-.66 4.254-1.912l2.58 1.945c-1.44 2.242-4.188 3.429-7.036 3.429-4.689 0-8.24-3.231-8.24-8.045 0-4.912 3.752-8.012 8.207-8.012 4.49 0 8.007 3.068 8.007 7.88-.005.496-.038.991-.1 1.483ZM53.8 14.456c-.234-2.11-1.876-3.33-4.053-3.33-2.11 0-3.785.99-4.254 3.33H53.8ZM76.628 8.093V23.82H72.74v-2.407c-1.071 1.648-3.282 2.407-5.196 2.407-4.12 0-7.709-3.132-7.709-8.045 0-4.944 3.552-8.012 7.672-8.012 1.977 0 4.158.758 5.226 2.374V8.09l3.894.002Zm-3.953 7.65c0-2.705-2.278-4.419-4.522-4.419-2.412 0-4.389 1.846-4.389 4.418s1.977 4.484 4.389 4.484c2.378 0 4.522-1.78 4.522-4.484ZM83.997 7.071v1.352h3.484v3.069h-3.484V23.82h-3.882V7.269c0-4.418 2.14-7.089 6.495-7.089h1.843l-1.072 3.56c-2.647 0-3.418 1.452-3.384 3.331ZM91.182.25h3.886v23.57h-3.886V.25ZM97.993 2.983c0-1.352 1.172-2.34 2.546-2.34 1.407 0 2.512.988 2.512 2.34 0 1.319-1.105 2.34-2.512 2.34-1.37 0-2.546-1.021-2.546-2.34Zm.606 5.44h3.886V23.82h-3.886V8.423ZM120.934 15.183v8.637h-3.885v-8.276c0-2.44-1.508-3.692-3.25-3.692-1.776 0-3.984.956-3.984 3.92v8.045h-3.891V8.423h3.886v2.44c.803-1.913 3.249-2.77 4.857-2.77 4.023 0 6.267 2.604 6.267 7.09ZM134.073 23.82l-6.098-6.99v6.99h-3.885V.248h3.885v13.087l4.489-4.912h5.059l-6.365 6.726 7.838 8.67h-4.923ZM7.219 19.014v-4.518L0 23.813h4.195l3.092-3.99a4.958 4.958 0 0 1-.068-.81ZM14.74 22.429a3.8 3.8 0 0 1-2.657-1.095 3.68 3.68 0 0 1-1.097-2.621c0-.03.01-11.764.01-13.665.003-1.747 1.502-3.333 3.442-3.333.87 0 1.706.323 2.343.906A4.876 4.876 0 0 0 14.408.589a4.971 4.971 0 0 0-3.139-.193 4.902 4.902 0 0 0-2.61 1.726 4.771 4.771 0 0 0-1.007 2.932v13.943c0 2.521 2.11 4.802 4.9 4.802a4.905 4.905 0 0 0 2.834-.887c.345-.238.658-.517.932-.831a3.755 3.755 0 0 1-1.578.348Z\\\"></path><path d=\\\"M18.023 19.003v-4.517l-4.23 5.428c-.219.282-.53.481-.883.562-.351.082-.72.04-1.044-.117.265.46.641.848 1.094 1.132a3.338 3.338 0 0 0 3.073.248c.494-.207.929-.53 1.267-.941l.788-1.008a4.672 4.672 0 0 1-.065-.787ZM25.55 22.429a3.8 3.8 0 0 1-2.657-1.094 3.679 3.679 0 0 1-1.096-2.622l.01-13.665c0-1.745 1.5-3.33 3.441-3.33.868.001 1.703.325 2.338.907A4.875 4.875 0 0 0 25.216.594 4.971 4.971 0 0 0 22.077.4a4.902 4.902 0 0 0-2.61 1.724 4.77 4.77 0 0 0-1.01 2.93v13.943c0 2.521 2.111 4.802 4.9 4.802a4.904 4.904 0 0 0 2.835-.887c.345-.238.658-.517.932-.831a3.758 3.758 0 0 1-1.574.348Z\\\"></path><path d=\\\"m26.12 17.93-1.523 1.983c-.219.282-.53.48-.881.562-.352.081-.72.04-1.044-.116.266.46.642.848 1.095 1.132a3.339 3.339 0 0 0 3.073.248c.494-.207.929-.53 1.268-.941l.67-.864-2.657-2.004ZM25.243 2.169c-.547 0-1.084.147-1.553.425a2.99 2.99 0 0 0-1.11 1.151 1.58 1.58 0 0 1 1.973.31 1.52 1.52 0 0 1 .044 1.965L22.23 9.077v5.4l5.02-6.46a4.711 4.711 0 0 0 1.01-2.92 2.943 2.943 0 0 0-.897-2.074 3.038 3.038 0 0 0-2.119-.854ZM14.438 2.169a3.055 3.055 0 0 0-1.551.426 2.99 2.99 0 0 0-1.108 1.15 1.58 1.58 0 0 1 1.97.312 1.52 1.52 0 0 1 .044 1.963l-2.368 3.057v5.4l5.019-6.46a4.713 4.713 0 0 0 1.008-2.92 2.943 2.943 0 0 0-.897-2.073 3.038 3.038 0 0 0-2.117-.855Z\\\"></path></g><defs><clipPath id=\\\"a\\\"><path fill=\\\"#fff\\\" transform=\\\"translate(0 .18)\\\" d=\\\"M0 0h139v23.64H0z\\\"></path></clipPath></defs>\", 2)\nconst _hoisted_4 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_4))\n}\nexport default { render: render }","<script setup lang=\"ts\">\n import { computed, useCssModule, useSlots } from 'vue';\n\n import LeafLinkLogo from '../../../assets/logos/leaflink-white-logo-full.svg?component';\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import { IllustrationType, VignetteName } from '../Illustration/Illustration.models';\n import Illustration from '../Illustration/Illustration.vue';\n\n type ErrorCodes = 401 | 403 | 404 | 405 | 500 | 502 | 503 | 504;\n const errors: Record<ErrorCodes, { title: string; description: string }> = {\n 401: {\n title: t('ll.httpError.401.title'),\n description: t('ll.httpError.401.description'),\n },\n 403: {\n title: t('ll.httpError.403.title'),\n description: t('ll.httpError.403.description'),\n },\n 404: {\n title: t('ll.httpError.404.title'),\n description: t('ll.httpError.404.description'),\n },\n 405: {\n title: t('ll.httpError.405.title'),\n description: t('ll.httpError.405.description'),\n },\n 500: {\n title: t('ll.httpError.50X.title'),\n description: t('ll.httpError.50X.description'),\n },\n 502: {\n title: t('ll.httpError.50X.title'),\n description: t('ll.httpError.50X.description'),\n },\n 503: {\n title: t('ll.httpError.50X.title'),\n description: t('ll.httpError.50X.description'),\n },\n 504: {\n title: t('ll.httpError.504.title'),\n description: t('ll.httpError.504.description'),\n },\n };\n\n export interface HttpErrorProps {\n /**\n * A description of what possibly happened.\n */\n description?: string;\n\n /**\n * The error code.\n */\n errorCode: keyof typeof errors | `${keyof typeof errors}`;\n\n /**\n * By default, the logout button is visible unless content is provided to the `actions` slot or\n * this prop is `true`.\n */\n hideLogoutButton?: boolean;\n\n /**\n * A callback that will be called when the user clicks the logout button. If not provided,\n * a `logout` event will be emitted.\n */\n onLogout?: () => void;\n\n /**\n * A link to redirect the user to see if a hard refresh fixes the issue.\n */\n retryLink?: string;\n\n /**\n * The error title.\n */\n title?: string;\n }\n\n const props = withDefaults(defineProps<HttpErrorProps>(), {\n description: '',\n errorCode: '404',\n onLogout: undefined,\n hideLogoutButton: false,\n retryLink: undefined,\n title: '',\n });\n\n const classes = useCssModule();\n const slots = useSlots();\n\n const errorCodeStr = computed(() => props.errorCode.toString());\n const errorCodeInt = computed(() => parseInt(errorCodeStr.value, 10));\n const defaultInfoByErrorCode = computed(() => errors[errorCodeInt.value] || errors['500']);\n const errorTitle = computed(() => props.title || defaultInfoByErrorCode.value.title);\n const errorDescription = computed(() => props.description || defaultInfoByErrorCode.value.description);\n\n const showLogoutButton = computed(() => !props.hideLogoutButton && props.onLogout);\n const computedRetryLink = computed(() => props.retryLink || window.location.href);\n</script>\n\n<template>\n <div class=\"stash-http-error tw-min-h-screen tw-px-6 tw-py-12\" :class=\"classes.root\" data-test=\"stash-http-error\">\n <div :class=\"classes.wrapper\">\n <router-link to=\"/\" class=\"tw-mb-8\" :class=\"classes.logo\">\n <LeafLinkLogo width=\"192\" height=\"33\" />\n </router-link>\n\n <div class=\"tw-mb-8 tw-gap-6\" :class=\"classes.content\">\n <div class=\"tw-order-2 lg:tw-order-1\" :class=\"classes.content__text\">\n <h1 class=\"heading-jumbo !tw-text-white tw-m-0 tw-mb-3\">\n {{ errorTitle }}\n </h1>\n <h2 class=\"tw-text-white tw-mb-8\">Error Code: {{ props.errorCode }}</h2>\n <p class=\"tw-text-white tw-mb-4\">\n {{ errorDescription }} You can <a :href=\"computedRetryLink\" class=\"link\">try again</a> or reach out to\n <a href=\"mailto:support@leaflink.com\" class=\"link\">support@leaflink.com</a> for assistance.\n </p>\n </div>\n <div class=\"tw-order-1 lg:tw-order-2\" :class=\"classes.illustration\">\n <Illustration :size=\"300\" :type=\"IllustrationType.Vignette\" :name=\"VignetteName.SearchStorefront\" />\n </div>\n </div>\n\n <div v-if=\"slots.actions || showLogoutButton\" class=\"tw-flex tw-items-start tw-gap-6\">\n <slot name=\"actions\">\n <Button tertiary @click=\"props.onLogout\">Logout</Button>\n </slot>\n </div>\n </div>\n </div>\n</template>\n\n<style module>\n .root {\n background-color: theme('colors.purple.500');\n display: flex;\n height: 100%;\n justify-content: center;\n align-items: center;\n max-width: 100vw;\n }\n\n .wrapper {\n max-width: 100%;\n width: 56rem;\n }\n\n .content {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n .illustration {\n /* width and height similar to figma. */\n width: 300px;\n height: 193px;\n }\n\n @media screen and (width < 1024px) {\n .content {\n flex-wrap: wrap;\n gap: 0;\n }\n\n .illustration {\n margin-bottom: 30px;\n }\n }\n\n @media screen and (width >= 1024px) {\n .content__text {\n max-width: 50vw;\n }\n }\n\n .illustration svg {\n /*\n * We cannot use the same sizes from figma because the illustration would be smaller\n * and it would break alignment. The specified height in figma is 193px but the\n * illustration is 300px, so, (300 - 193) / 2 ~= 53, which keeps it aligned.\n */\n margin-top: -53px;\n }\n\n .logo {\n /* width and height similar to figma. */\n width: 192px;\n height: 33px;\n display: block;\n }\n</style>\n"],"names":["_hoisted_1","_hoisted_2","_createStaticVNode","_hoisted_4","render","_ctx","_cache","_openBlock","_createElementBlock","LeafLinkLogo","errors","classes","useCssModule","slots","useSlots","errorCodeStr","computed","props","errorCodeInt","defaultInfoByErrorCode","errorTitle","errorDescription","showLogoutButton","computedRetryLink"],"mappings":";;;;;;;;;AAEA,MAAMA,IAAa;AAAA,EACjB,SAAS;AAAA,EACT,MAAM;AAAA,EACN,OAAO;AACT,GACMC,IAA0BC,gBAAAA,EAAmB,0pGAA4qG,CAAC,GAC1tGC,IAAa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,EAAS,MAAMC,EAAM,eAAeE,EAAuB,MAAM,WAAW,GAE/FG,IAAmBN,EAAS,MAAM,CAACC,EAAM,oBAAoBA,EAAM,QAAQ,GAC3EM,IAAoBP,EAAS,MAAMC,EAAM,aAAa,OAAO,SAAS,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"HttpError.js","sources":["../assets/logos/leaflink-white-logo-full.svg?component","../src/components/HttpError/HttpError.vue"],"sourcesContent":["import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createStaticVNode as _createStaticVNode } from \"vue\"\n\nconst _hoisted_1 = {\n viewBox: \"0 0 139 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createStaticVNode(\"<g clip-path=\\\"url(#a)\\\" fill=\\\"#fff\\\"><path d=\\\"M35.265.248h3.883V23.82h-3.883V.248ZM57.586 17.127H45.493c.433 2.143 2.11 3.231 4.422 3.231 1.708 0 3.316-.66 4.254-1.912l2.58 1.945c-1.44 2.242-4.188 3.429-7.036 3.429-4.689 0-8.24-3.231-8.24-8.045 0-4.912 3.752-8.012 8.207-8.012 4.49 0 8.007 3.068 8.007 7.88-.005.496-.038.991-.1 1.483ZM53.8 14.456c-.234-2.11-1.876-3.33-4.053-3.33-2.11 0-3.785.99-4.254 3.33H53.8ZM76.628 8.093V23.82H72.74v-2.407c-1.071 1.648-3.282 2.407-5.196 2.407-4.12 0-7.709-3.132-7.709-8.045 0-4.944 3.552-8.012 7.672-8.012 1.977 0 4.158.758 5.226 2.374V8.09l3.894.002Zm-3.953 7.65c0-2.705-2.278-4.419-4.522-4.419-2.412 0-4.389 1.846-4.389 4.418s1.977 4.484 4.389 4.484c2.378 0 4.522-1.78 4.522-4.484ZM83.997 7.071v1.352h3.484v3.069h-3.484V23.82h-3.882V7.269c0-4.418 2.14-7.089 6.495-7.089h1.843l-1.072 3.56c-2.647 0-3.418 1.452-3.384 3.331ZM91.182.25h3.886v23.57h-3.886V.25ZM97.993 2.983c0-1.352 1.172-2.34 2.546-2.34 1.407 0 2.512.988 2.512 2.34 0 1.319-1.105 2.34-2.512 2.34-1.37 0-2.546-1.021-2.546-2.34Zm.606 5.44h3.886V23.82h-3.886V8.423ZM120.934 15.183v8.637h-3.885v-8.276c0-2.44-1.508-3.692-3.25-3.692-1.776 0-3.984.956-3.984 3.92v8.045h-3.891V8.423h3.886v2.44c.803-1.913 3.249-2.77 4.857-2.77 4.023 0 6.267 2.604 6.267 7.09ZM134.073 23.82l-6.098-6.99v6.99h-3.885V.248h3.885v13.087l4.489-4.912h5.059l-6.365 6.726 7.838 8.67h-4.923ZM7.219 19.014v-4.518L0 23.813h4.195l3.092-3.99a4.958 4.958 0 0 1-.068-.81ZM14.74 22.429a3.8 3.8 0 0 1-2.657-1.095 3.68 3.68 0 0 1-1.097-2.621c0-.03.01-11.764.01-13.665.003-1.747 1.502-3.333 3.442-3.333.87 0 1.706.323 2.343.906A4.876 4.876 0 0 0 14.408.589a4.971 4.971 0 0 0-3.139-.193 4.902 4.902 0 0 0-2.61 1.726 4.771 4.771 0 0 0-1.007 2.932v13.943c0 2.521 2.11 4.802 4.9 4.802a4.905 4.905 0 0 0 2.834-.887c.345-.238.658-.517.932-.831a3.755 3.755 0 0 1-1.578.348Z\\\"></path><path d=\\\"M18.023 19.003v-4.517l-4.23 5.428c-.219.282-.53.481-.883.562-.351.082-.72.04-1.044-.117.265.46.641.848 1.094 1.132a3.338 3.338 0 0 0 3.073.248c.494-.207.929-.53 1.267-.941l.788-1.008a4.672 4.672 0 0 1-.065-.787ZM25.55 22.429a3.8 3.8 0 0 1-2.657-1.094 3.679 3.679 0 0 1-1.096-2.622l.01-13.665c0-1.745 1.5-3.33 3.441-3.33.868.001 1.703.325 2.338.907A4.875 4.875 0 0 0 25.216.594 4.971 4.971 0 0 0 22.077.4a4.902 4.902 0 0 0-2.61 1.724 4.77 4.77 0 0 0-1.01 2.93v13.943c0 2.521 2.111 4.802 4.9 4.802a4.904 4.904 0 0 0 2.835-.887c.345-.238.658-.517.932-.831a3.758 3.758 0 0 1-1.574.348Z\\\"></path><path d=\\\"m26.12 17.93-1.523 1.983c-.219.282-.53.48-.881.562-.352.081-.72.04-1.044-.116.266.46.642.848 1.095 1.132a3.339 3.339 0 0 0 3.073.248c.494-.207.929-.53 1.268-.941l.67-.864-2.657-2.004ZM25.243 2.169c-.547 0-1.084.147-1.553.425a2.99 2.99 0 0 0-1.11 1.151 1.58 1.58 0 0 1 1.973.31 1.52 1.52 0 0 1 .044 1.965L22.23 9.077v5.4l5.02-6.46a4.711 4.711 0 0 0 1.01-2.92 2.943 2.943 0 0 0-.897-2.074 3.038 3.038 0 0 0-2.119-.854ZM14.438 2.169a3.055 3.055 0 0 0-1.551.426 2.99 2.99 0 0 0-1.108 1.15 1.58 1.58 0 0 1 1.97.312 1.52 1.52 0 0 1 .044 1.963l-2.368 3.057v5.4l5.019-6.46a4.713 4.713 0 0 0 1.008-2.92 2.943 2.943 0 0 0-.897-2.073 3.038 3.038 0 0 0-2.117-.855Z\\\"></path></g><defs><clipPath id=\\\"a\\\"><path fill=\\\"#fff\\\" transform=\\\"translate(0 .18)\\\" d=\\\"M0 0h139v23.64H0z\\\"></path></clipPath></defs>\", 2)\nconst _hoisted_4 = [\n _hoisted_2\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_4))\n}\nexport default { render: render }","<script setup lang=\"ts\">\n import { computed, useCssModule, useSlots } from 'vue';\n\n import LeafLinkLogo from '../../../assets/logos/leaflink-white-logo-full.svg?component';\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import { IllustrationType, VignetteName } from '../Illustration/Illustration.models';\n import Illustration from '../Illustration/Illustration.vue';\n\n type ErrorCodes = 401 | 403 | 404 | 405 | 500 | 502 | 503 | 504;\n const errors: Record<ErrorCodes, { title: string; description: string }> = {\n 401: {\n title: t('ll.httpError.401.title'),\n description: t('ll.httpError.401.description'),\n },\n 403: {\n title: t('ll.httpError.403.title'),\n description: t('ll.httpError.403.description'),\n },\n 404: {\n title: t('ll.httpError.404.title'),\n description: t('ll.httpError.404.description'),\n },\n 405: {\n title: t('ll.httpError.405.title'),\n description: t('ll.httpError.405.description'),\n },\n 500: {\n title: t('ll.httpError.50X.title'),\n description: t('ll.httpError.50X.description'),\n },\n 502: {\n title: t('ll.httpError.50X.title'),\n description: t('ll.httpError.50X.description'),\n },\n 503: {\n title: t('ll.httpError.50X.title'),\n description: t('ll.httpError.50X.description'),\n },\n 504: {\n title: t('ll.httpError.504.title'),\n description: t('ll.httpError.504.description'),\n },\n };\n\n export interface HttpErrorProps {\n /**\n * A description of what possibly happened.\n */\n description?: string;\n\n /**\n * The error code.\n */\n errorCode: keyof typeof errors | `${keyof typeof errors}`;\n\n /**\n * By default, the logout button is visible unless content is provided to the `actions` slot or\n * this prop is `true`.\n */\n hideLogoutButton?: boolean;\n\n /**\n * A callback that will be called when the user clicks the logout button. If not provided,\n * a `logout` event will be emitted.\n */\n onLogout?: () => void;\n\n /**\n * A link to redirect the user to see if a hard refresh fixes the issue.\n */\n retryLink?: string;\n\n /**\n * The error title.\n */\n title?: string;\n }\n\n const props = withDefaults(defineProps<HttpErrorProps>(), {\n description: '',\n errorCode: '404',\n onLogout: undefined,\n hideLogoutButton: false,\n retryLink: undefined,\n title: '',\n });\n\n const classes = useCssModule();\n const slots = useSlots();\n\n const errorCodeStr = computed(() => props.errorCode.toString());\n const errorCodeInt = computed(() => parseInt(errorCodeStr.value, 10));\n const defaultInfoByErrorCode = computed(() => errors[errorCodeInt.value] || errors['500']);\n const errorTitle = computed(() => props.title || defaultInfoByErrorCode.value.title);\n const errorDescription = computed(() => props.description || defaultInfoByErrorCode.value.description);\n\n const showLogoutButton = computed(() => !props.hideLogoutButton && props.onLogout);\n const computedRetryLink = computed(() => props.retryLink || window.location.href);\n</script>\n\n<template>\n <div class=\"stash-http-error tw-min-h-screen tw-px-6 tw-py-12\" :class=\"classes.root\" data-test=\"stash-http-error\">\n <div :class=\"classes.wrapper\">\n <router-link to=\"/\" class=\"tw-mb-8\" :class=\"classes.logo\">\n <LeafLinkLogo width=\"192\" height=\"33\" />\n </router-link>\n\n <div class=\"tw-mb-8 tw-gap-6\" :class=\"classes.content\">\n <div class=\"tw-order-2 lg:tw-order-1\" :class=\"classes.content__text\">\n <h1 class=\"heading-jumbo tw-m-0 tw-mb-3 !tw-text-white\">\n {{ errorTitle }}\n </h1>\n <h2 class=\"tw-mb-8 tw-text-white\">Error Code: {{ props.errorCode }}</h2>\n <p class=\"tw-mb-4 tw-text-white\">\n {{ errorDescription }} You can <a :href=\"computedRetryLink\" class=\"link\">try again</a> or reach out to\n <a href=\"mailto:support@leaflink.com\" class=\"link\">support@leaflink.com</a> for assistance.\n </p>\n </div>\n <div class=\"tw-order-1 lg:tw-order-2\" :class=\"classes.illustration\">\n <Illustration :size=\"300\" :type=\"IllustrationType.Vignette\" :name=\"VignetteName.SearchStorefront\" />\n </div>\n </div>\n\n <div v-if=\"slots.actions || showLogoutButton\" class=\"tw-flex tw-items-start tw-gap-6\">\n <slot name=\"actions\">\n <Button tertiary @click=\"props.onLogout\">Logout</Button>\n </slot>\n </div>\n </div>\n </div>\n</template>\n\n<style module>\n .root {\n background-color: var(--color-purple-500);\n display: flex;\n height: 100%;\n justify-content: center;\n align-items: center;\n max-width: 100vw;\n }\n\n .wrapper {\n max-width: 100%;\n width: 56rem;\n }\n\n .content {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n .illustration {\n /* width and height similar to figma. */\n width: 300px;\n height: 193px;\n }\n\n @media screen and (width < 1024px) {\n .content {\n flex-wrap: wrap;\n gap: 0;\n }\n\n .illustration {\n margin-bottom: 30px;\n }\n }\n\n @media screen and (width >= 1024px) {\n .content__text {\n max-width: 50vw;\n }\n }\n\n .illustration svg {\n /*\n * We cannot use the same sizes from figma because the illustration would be smaller\n * and it would break alignment. The specified height in figma is 193px but the\n * illustration is 300px, so, (300 - 193) / 2 ~= 53, which keeps it aligned.\n */\n margin-top: -53px;\n }\n\n .logo {\n /* width and height similar to figma. */\n width: 192px;\n height: 33px;\n display: block;\n }\n</style>\n"],"names":["_hoisted_1","_hoisted_2","_createStaticVNode","_hoisted_4","render","_ctx","_cache","_openBlock","_createElementBlock","LeafLinkLogo","errors","classes","useCssModule","slots","useSlots","errorCodeStr","computed","props","errorCodeInt","defaultInfoByErrorCode","errorTitle","errorDescription","showLogoutButton","computedRetryLink"],"mappings":";;;;;;;;;AAEA,MAAMA,IAAa;AAAA,EACjB,SAAS;AAAA,EACT,MAAM;AAAA,EACN,OAAO;AACT,GACMC,IAA0BC,gBAAAA,EAAmB,0pGAA4qG,CAAC,GAC1tGC,IAAa;AAAA,EACjBF;AACF;AAEO,SAASG,EAAOC,GAAMC,GAAQ;AACnC,SAAQC,EAAY,GAAEC,EAAoB,OAAOR,GAAYG,CAAU;AACzE;AACA,MAAeM,IAAA,EAAE,QAAQL,EAAM;;;;;;;;;;;;;;;;;iBCLvBM,IAAqE;AAAA,MACzE,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,MACA,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,MACA,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,MACA,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,MACA,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,MACA,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,MACA,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,MACA,KAAK;AAAA,QACH,OAAO,EAAE,wBAAwB;AAAA,QACjC,aAAa,EAAE,8BAA8B;AAAA,MAC/C;AAAA,IAAA,GA8CIC,IAAUC,KACVC,IAAQC,KAERC,IAAeC,EAAS,MAAMC,EAAM,UAAU,UAAU,GACxDC,IAAeF,EAAS,MAAM,SAASD,EAAa,OAAO,EAAE,CAAC,GAC9DI,IAAyBH,EAAS,MAAMN,EAAOQ,EAAa,KAAK,KAAKR,EAAO,GAAK,CAAC,GACnFU,IAAaJ,EAAS,MAAMC,EAAM,SAASE,EAAuB,MAAM,KAAK,GAC7EE,IAAmBL,EAAS,MAAMC,EAAM,eAAeE,EAAuB,MAAM,WAAW,GAE/FG,IAAmBN,EAAS,MAAM,CAACC,EAAM,oBAAoBA,EAAM,QAAQ,GAC3EM,IAAoBP,EAAS,MAAMC,EAAM,aAAa,OAAO,SAAS,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/IconLabel.js
CHANGED
package/dist/IconLabel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconLabel.js","sources":["../src/components/IconLabel/IconLabel.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue';\n\n import { StashCommonColor } from '../../../types/colors';\n import { IconName } from '../Icon/Icon.types';\n import Icon from '../Icon/Icon.vue';\n\n export interface IconLabelProps {\n /**\n * Name of the icon to use. All design system icons are supported.\n */\n icon: IconName;\n\n /**\n * Color to apply to the icon. Common Stash colors are supported (default, 100 & 700 shades).\n */\n color?: StashCommonColor;\n\n /**\n * Valid hyperlink.\n */\n href?: string;\n\n /**\n * Valid vue-router route.\n */\n to?: string | object;\n\n /**\n * If true, renders the label below the icon instead of to the right\n */\n stacked?: boolean;\n\n /**\n * If true, truncates overflowing text with an ellipsis when it's unable to wrap\n */\n truncate?: boolean;\n }\n\n const props = withDefaults(defineProps<IconLabelProps>(), {\n color: undefined,\n href: undefined,\n to: undefined,\n stacked: false,\n truncate: false,\n });\n\n defineOptions({\n name: 'll-icon-label',\n });\n\n const is = computed(() => {\n if (props.to) {\n return 'router-link';\n }\n\n if (props.href) {\n return 'a';\n }\n\n return 'div';\n });\n\n const attributes = computed(() => {\n if (props.to) {\n return {\n to: props.to,\n };\n }\n\n if (props.href) {\n return {\n href: props.href,\n };\n }\n\n return {};\n });\n</script>\n\n<template>\n <component :is=\"is\" v-bind=\"attributes\" class=\"flex\" :class=\"{ 'flex-column items-center': props.stacked }\">\n <Icon :name=\"props.icon\" size=\"dense\" :class=\"[$style.icon, { [`text-${color}`]: !!color }]\" />\n\n <div\n :class=\"{\n 'flex-1 tw-ml-1.5': !props.stacked,\n 'text-xs tw-
|
|
1
|
+
{"version":3,"file":"IconLabel.js","sources":["../src/components/IconLabel/IconLabel.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue';\n\n import { StashCommonColor } from '../../../types/colors';\n import { IconName } from '../Icon/Icon.types';\n import Icon from '../Icon/Icon.vue';\n\n export interface IconLabelProps {\n /**\n * Name of the icon to use. All design system icons are supported.\n */\n icon: IconName;\n\n /**\n * Color to apply to the icon. Common Stash colors are supported (default, 100 & 700 shades).\n */\n color?: StashCommonColor;\n\n /**\n * Valid hyperlink.\n */\n href?: string;\n\n /**\n * Valid vue-router route.\n */\n to?: string | object;\n\n /**\n * If true, renders the label below the icon instead of to the right\n */\n stacked?: boolean;\n\n /**\n * If true, truncates overflowing text with an ellipsis when it's unable to wrap\n */\n truncate?: boolean;\n }\n\n const props = withDefaults(defineProps<IconLabelProps>(), {\n color: undefined,\n href: undefined,\n to: undefined,\n stacked: false,\n truncate: false,\n });\n\n defineOptions({\n name: 'll-icon-label',\n });\n\n const is = computed(() => {\n if (props.to) {\n return 'router-link';\n }\n\n if (props.href) {\n return 'a';\n }\n\n return 'div';\n });\n\n const attributes = computed(() => {\n if (props.to) {\n return {\n to: props.to,\n };\n }\n\n if (props.href) {\n return {\n href: props.href,\n };\n }\n\n return {};\n });\n</script>\n\n<template>\n <component :is=\"is\" v-bind=\"attributes\" class=\"flex\" :class=\"{ 'flex-column items-center': props.stacked }\">\n <Icon :name=\"props.icon\" size=\"dense\" :class=\"[$style.icon, { [`text-${color}`]: !!color }]\" />\n\n <div\n :class=\"{\n 'flex-1 tw-ml-1.5': !props.stacked,\n 'text-xs tw-mt-1.5 tw-leading-3': props.stacked,\n 'tw-truncate': truncate,\n }\"\n >\n <!-- @slot Label text -->\n <slot></slot>\n </div>\n </component>\n</template>\n\n<style module>\n .icon {\n margin-top: -1px;\n }\n</style>\n"],"names":["is","computed","props","attributes"],"mappings":";;;;;;;;;;;;;;;;;;iBAmDQA,IAAKC,EAAS,MACdC,EAAM,KACD,gBAGLA,EAAM,OACD,MAGF,KACR,GAEKC,IAAaF,EAAS,MACtBC,EAAM,KACD;AAAA,MACL,IAAIA,EAAM;AAAA,IAAA,IAIVA,EAAM,OACD;AAAA,MACL,MAAMA,EAAM;AAAA,IAAA,IAIT,EACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/InlineEdit.js
CHANGED
|
@@ -5,16 +5,16 @@ import "./constants.js";
|
|
|
5
5
|
import "./locale.js";
|
|
6
6
|
import "lodash-es/get";
|
|
7
7
|
import "lodash-es/isNil";
|
|
8
|
-
import "./Field.vue_vue_type_script_setup_true_lang-
|
|
8
|
+
import "./Field.vue_vue_type_script_setup_true_lang-42cf79d4.js";
|
|
9
9
|
import "lodash-es/uniqueId";
|
|
10
|
-
import "./Label.vue_vue_type_script_setup_true_lang-
|
|
10
|
+
import "./Label.vue_vue_type_script_setup_true_lang-c5589919.js";
|
|
11
11
|
import "./Icon.js";
|
|
12
12
|
import "./index-79ce320f.js";
|
|
13
13
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
14
14
|
import "./_plugin-vue_export-helper-dad06003.js";
|
|
15
15
|
const J = { class: "stash-inline-edit__input-wrapper" }, L = {
|
|
16
16
|
key: 0,
|
|
17
|
-
class: "tw-
|
|
17
|
+
class: "tw-mt-1 tw-inline-block tw-pl-3 tw-text-ice-700 tw-line-through"
|
|
18
18
|
}, ue = /* @__PURE__ */ S({
|
|
19
19
|
name: "ll-inline-edit",
|
|
20
20
|
inheritAttrs: !1,
|
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 =\n 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-
|
|
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 =\n 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","editing","ref","originalValue","props","internalValue","inputAttrs","computed","tempAttrs","formattedOriginalValue","formatValue","showOldValue","isAppended","isPrepended","watch","newVal","oldVal","dismiss","blurInput","edit","focusInput","value","money","percent","save","emit","llInput"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwDQA,IAAQC,KACRC,IAAQC,KAqBRC,IAAUC,EAAI,EAAK,GAGnBC,IAAgBD,EAAiCE,EAAM,YAAYA,EAAM,UAAU,GAGnFC,IAAgBH,EAAmCE,EAAM,UAAU,GAEnEE,IAAaC,EAAS,MAAM;AAC1B,YAAAC,IAAY,EAAE,GAAGT;AAEvB,oBAAOS,EAAU,OACVA;AAAA,IAAA,CACR,GAEKC,IAAyBF,EAAS,MAAMG,EAAYP,EAAc,SAAS,EAAE,CAAC,GAE9EQ,IAAeJ,EAAS,OACfH,EAAM,YAAYA,EAAM,aAAa,MAAMA,EAAM,aAAaC,EAAc,KAC1F,GAEKO,IAAaL,EAAS,MACnB,CAAC,CAACV,EAAM,MAChB,GAEKgB,IAAcN,EAAS,MACpB,CAAC,CAACV,EAAM,OAChB;AAED,IAAAiB;AAAA,MACE,MAAMV,EAAM;AAAA,MACZ,CAACW,GAA0BC,MAA6B;AACtD,QAAID,MAAWC,MACbX,EAAc,QAAQU;AAAA,MAE1B;AAAA,IAAA;AAGF,aAASE,IAAU;AACH,MAAAZ,EAAA,QAAQD,EAAM,cAAcA,EAAM,UAChDH,EAAQ,QAAQ,IACNiB;IACZ;AAKA,aAASC,IAAO;AACd,MAAAlB,EAAQ,QAAQ,IACLmB;IACb;AAKA,aAASV,EAAYW,GAAwB;AAC3C,cAAQjB,EAAM,QAAQ;AAAA,QACpB,KAAK;AACH,iBAAOkB,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,QAAQF,EAAc,OAErFsB,EAAA,sBAAsBpB,EAAc,KAAK,GAC9CJ,EAAQ,QAAQ,IACNiB;IACZ;AAEA,UAAMQ,IAAUxB;AAEhB,aAASkB,IAAa;AACpB,MAAIM,EAAQ,SACFA,EAAA,MAAM,QAAQ;IAE1B;AAEA,aAASR,IAAY;AACnB,MAAIQ,EAAQ,SACFA,EAAA,MAAM,QAAQ;IAE1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/Input.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as z, useSlots as P, useCssModule as U, useAttrs as G, ref as f, computed as v, watchEffect as L, onMounted as O, openBlock as m, createBlock as g, mergeProps as V, unref as o, createSlots as W, withCtx as k, createElementVNode as N, withDirectives as q, vModelDynamic as H, createElementBlock as x, normalizeClass as C, renderSlot as y, createCommentVNode as I } from "vue";
|
|
2
2
|
import $ from "lodash-es/isNil";
|
|
3
|
-
import { convertDecimal as
|
|
4
|
-
import { _ as K } from "./Field.vue_vue_type_script_setup_true_lang-
|
|
3
|
+
import { convertDecimal as j, sanitizeDecimal as J, decimalSeparator as _ } from "./utils/i18n.js";
|
|
4
|
+
import { _ as K } from "./Field.vue_vue_type_script_setup_true_lang-42cf79d4.js";
|
|
5
5
|
import Q from "./Icon.js";
|
|
6
6
|
import { _ as R } from "./_plugin-vue_export-helper-dad06003.js";
|
|
7
7
|
import "./constants.js";
|
|
8
8
|
import "./locale.js";
|
|
9
9
|
import "lodash-es/get";
|
|
10
10
|
import "lodash-es/uniqueId";
|
|
11
|
-
import "./Label.vue_vue_type_script_setup_true_lang-
|
|
11
|
+
import "./Label.vue_vue_type_script_setup_true_lang-c5589919.js";
|
|
12
12
|
import "./index-79ce320f.js";
|
|
13
13
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
14
|
-
const X = { class: "relative" }, Y = ["id", "aria-errormessage", "aria-invalid", "autocomplete", "type"], Z = /* @__PURE__ */
|
|
14
|
+
const X = { class: "relative" }, Y = ["id", "aria-errormessage", "aria-invalid", "autocomplete", "type"], Z = /* @__PURE__ */ z({
|
|
15
15
|
name: "ll-input",
|
|
16
16
|
inheritAttrs: !1,
|
|
17
17
|
__name: "Input",
|
|
@@ -28,25 +28,25 @@ const X = { class: "relative" }, Y = ["id", "aria-errormessage", "aria-invalid",
|
|
|
28
28
|
type: { default: "text" }
|
|
29
29
|
},
|
|
30
30
|
emits: ["update:model-value", "change", "focus", "blur"],
|
|
31
|
-
setup(
|
|
32
|
-
const n =
|
|
33
|
-
|
|
31
|
+
setup(B, { expose: E, emit: d }) {
|
|
32
|
+
const n = B, r = P(), s = U(), c = G(), h = f();
|
|
33
|
+
E({ inputEl: h });
|
|
34
34
|
const l = f(n.modelValue);
|
|
35
|
-
n.type === "number" && (n.modelValue || n.modelValue === 0) && (l.value =
|
|
36
|
-
const p = f(!1), i = v(() => n.type === "number"),
|
|
35
|
+
n.type === "number" && (n.modelValue || n.modelValue === 0) && (l.value = j(n.modelValue, _));
|
|
36
|
+
const p = f(!1), i = v(() => n.type === "number"), S = v(() => {
|
|
37
37
|
const t = { ...c };
|
|
38
38
|
return delete t.class, t;
|
|
39
|
-
}),
|
|
40
|
-
|
|
39
|
+
}), D = v(() => i.value || n.type === "password" && p.value ? "text" : n.type);
|
|
40
|
+
L(() => {
|
|
41
41
|
l.value = w(n.modelValue);
|
|
42
42
|
});
|
|
43
|
-
function
|
|
43
|
+
function b(t = "", a = !1) {
|
|
44
44
|
if (!i.value)
|
|
45
45
|
return t;
|
|
46
46
|
let e = t;
|
|
47
47
|
if ($(e) || `${e}`.length === 0)
|
|
48
48
|
return "";
|
|
49
|
-
if (
|
|
49
|
+
if (_ !== "." && (e = j(e, ".")), a && (e === "." && (e = "0."), e.toString().startsWith("0.")))
|
|
50
50
|
return e;
|
|
51
51
|
if (!$(e) && `${e}`.length)
|
|
52
52
|
e = Intl.NumberFormat("en-US", {
|
|
@@ -59,19 +59,19 @@ const X = { class: "relative" }, Y = ["id", "aria-errormessage", "aria-invalid",
|
|
|
59
59
|
return isNaN(Number(e)) ? "" : parseFloat(e);
|
|
60
60
|
}
|
|
61
61
|
function w(t) {
|
|
62
|
-
return i.value ? J(t,
|
|
62
|
+
return i.value ? J(t, _) : t;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
const t = i.value ?
|
|
64
|
+
function M() {
|
|
65
|
+
const t = i.value ? b(l.value) : l.value;
|
|
66
66
|
d("change", t);
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function A(t) {
|
|
69
69
|
const a = t.target.value;
|
|
70
70
|
l.value = w(a);
|
|
71
|
-
const e = i.value ?
|
|
71
|
+
const e = i.value ? b(l.value, !0) : a;
|
|
72
72
|
d("update:model-value", e);
|
|
73
73
|
}
|
|
74
|
-
return
|
|
74
|
+
return O(() => {
|
|
75
75
|
if (n.value !== null)
|
|
76
76
|
throw new Error("ll-input: use :model-value or v-model instead of :value.");
|
|
77
77
|
if (c.onInput)
|
|
@@ -79,25 +79,25 @@ const X = { class: "relative" }, Y = ["id", "aria-errormessage", "aria-invalid",
|
|
|
79
79
|
}), (t, a) => (m(), g(K, V(n, {
|
|
80
80
|
class: ["stash-input", [o(s).root, o(c).class]],
|
|
81
81
|
"data-test": "ll-input"
|
|
82
|
-
}),
|
|
83
|
-
default: k(({ fieldId: e, fieldErrorId:
|
|
82
|
+
}), W({
|
|
83
|
+
default: k(({ fieldId: e, fieldErrorId: F, hasError: T }) => [
|
|
84
84
|
N("div", X, [
|
|
85
|
-
q(N("input", V(
|
|
85
|
+
q(N("input", V(S.value, {
|
|
86
86
|
id: e,
|
|
87
87
|
ref_key: "inputEl",
|
|
88
|
-
ref:
|
|
88
|
+
ref: h,
|
|
89
89
|
"onUpdate:modelValue": a[0] || (a[0] = (u) => l.value = u),
|
|
90
|
-
"aria-errormessage":
|
|
91
|
-
"aria-invalid":
|
|
90
|
+
"aria-errormessage": F,
|
|
91
|
+
"aria-invalid": T,
|
|
92
92
|
autocomplete: t.autocomplete,
|
|
93
93
|
class: [
|
|
94
94
|
{ [o(s)["input-prepended"]]: !!o(r).prepend },
|
|
95
95
|
{ [o(s)["input-appended"]]: !!o(r).append || n.type === "password" },
|
|
96
96
|
{ [o(s)["has-error"]]: !!n.errorText }
|
|
97
97
|
],
|
|
98
|
-
type:
|
|
99
|
-
onChange:
|
|
100
|
-
onInput:
|
|
98
|
+
type: D.value,
|
|
99
|
+
onChange: M,
|
|
100
|
+
onInput: A,
|
|
101
101
|
onBlur: a[1] || (a[1] = (u) => d("blur", u)),
|
|
102
102
|
onFocus: a[2] || (a[2] = (u) => d("focus", u))
|
|
103
103
|
}), null, 16, Y), [
|
|
@@ -134,18 +134,18 @@ const X = { class: "relative" }, Y = ["id", "aria-errormessage", "aria-invalid",
|
|
|
134
134
|
} : void 0
|
|
135
135
|
]), 1040, ["class"]));
|
|
136
136
|
}
|
|
137
|
-
}), ee = "
|
|
137
|
+
}), ee = "_root_ojmdn_2", te = "_symbol_ojmdn_66", oe = {
|
|
138
138
|
root: ee,
|
|
139
|
-
"has-error": "_has-
|
|
140
|
-
"input-prepended": "_input-
|
|
141
|
-
"input-appended": "_input-
|
|
139
|
+
"has-error": "_has-error_ojmdn_34",
|
|
140
|
+
"input-prepended": "_input-prepended_ojmdn_38",
|
|
141
|
+
"input-appended": "_input-appended_ojmdn_42",
|
|
142
142
|
symbol: te,
|
|
143
|
-
"symbol--prepend": "_symbol--
|
|
144
|
-
"symbol--append": "_symbol--
|
|
143
|
+
"symbol--prepend": "_symbol--prepend_ojmdn_77",
|
|
144
|
+
"symbol--append": "_symbol--append_ojmdn_83"
|
|
145
145
|
}, ne = {
|
|
146
146
|
$style: oe
|
|
147
|
-
},
|
|
147
|
+
}, _e = /* @__PURE__ */ R(Z, [["__cssModules", ne]]);
|
|
148
148
|
export {
|
|
149
|
-
|
|
149
|
+
_e as default
|
|
150
150
|
};
|
|
151
151
|
//# sourceMappingURL=Input.js.map
|