@leaflink/stash 48.10.0 → 48.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion.js +1 -1
- package/dist/ActionsDropdown.js +1 -1
- package/dist/AddressSelect.js +1 -1
- package/dist/AddressSelect.js.map +1 -1
- package/dist/Alert.js +1 -1
- package/dist/Alert.js.map +1 -1
- package/dist/AppNavigationItem.js +1 -1
- package/dist/AppTopbar.js +1 -1
- package/dist/Avatar.vue.d.ts +1 -1
- package/dist/Badge.js.map +1 -1
- package/dist/Button.vue.d.ts +3 -1
- package/dist/CardMedia.js +1 -1
- package/dist/Carousel.js.map +1 -1
- package/dist/ChevronToggle.js +1 -1
- package/dist/ChevronToggle.vue_vue_type_script_setup_true_lang-1591294c.js.map +1 -1
- package/dist/Chip.js +1 -1
- package/dist/Chip.js.map +1 -1
- package/dist/Chip.vue.d.ts +1 -1
- package/dist/ConfirmationCodeInput.js.map +1 -1
- package/dist/ContextSwitcher.js.map +1 -1
- package/dist/Copy.js +1 -1
- package/dist/CurrencyInput.js +39 -34
- package/dist/CurrencyInput.js.map +1 -1
- package/dist/DataView.js +1 -1
- package/dist/DataView.js.map +1 -1
- package/dist/DataViewFilters.js +1 -1
- package/dist/DataViewFilters.js.map +1 -1
- package/dist/DataViewSortButton.js +1 -1
- package/dist/DataViewToolbar.js +1 -1
- package/dist/DatePicker.js +3355 -3368
- package/dist/DatePicker.js.map +1 -1
- package/dist/Dialog.js +75 -69
- package/dist/Dialog.js.map +1 -1
- package/dist/Dropdown.js +1 -1
- package/dist/Dropdown.js.map +1 -1
- package/dist/EmptyState.js +2 -2
- package/dist/Expand.vue_vue_type_script_setup_true_lang-1751f4a6.js.map +1 -1
- package/dist/FileUpload.js +1 -1
- package/dist/FileUpload.js.map +1 -1
- package/dist/FilterChip.js +1 -1
- package/dist/FilterDrawerItem.js +1 -1
- package/dist/FilterDropdown.js +1 -1
- package/dist/FilterSelect.js +1 -1
- package/dist/FilterSelect.js.map +1 -1
- package/dist/Filters.js +1 -1
- package/dist/Filters.js.map +1 -1
- package/dist/HttpError.js +2 -2
- package/dist/Icon.js +1 -1
- package/dist/Icon.js.map +1 -1
- package/dist/IconLabel.js +1 -1
- package/dist/IconLabel.vue.d.ts +1 -1
- package/dist/Illustration.js +3 -3
- package/dist/{Illustration.vue_vue_type_script_setup_true_lang-4b8944da.js → Illustration.vue_vue_type_script_setup_true_lang-e26c3841.js} +2 -2
- package/dist/{Illustration.vue_vue_type_script_setup_true_lang-4b8944da.js.map → Illustration.vue_vue_type_script_setup_true_lang-e26c3841.js.map} +1 -1
- package/dist/Image.js.map +1 -1
- package/dist/InlineEdit.js +1 -1
- package/dist/Input.js +1 -1
- package/dist/Input.js.map +1 -1
- package/dist/InputOptions.js +1 -1
- package/dist/LicenseChip.js +1 -1
- package/dist/ListView.js +2 -2
- package/dist/ListView.js.map +1 -1
- package/dist/Logo.vue_vue_type_script_setup_true_lang-d7da48a0.js.map +1 -1
- package/dist/Metric.vue.d.ts +1 -1
- package/dist/Modal.js +1 -1
- package/dist/Modals.js +6 -6
- package/dist/Modals.js.map +1 -1
- package/dist/ObfuscateText.js +1 -1
- package/dist/PageNavigation.js +1 -1
- package/dist/PageNavigation.js.map +1 -1
- package/dist/Paginate.js +1 -1
- package/dist/PlaidLink.js.map +1 -1
- package/dist/QuickAction.js +1 -1
- package/dist/RadioNew.js.map +1 -1
- package/dist/RangeInput.js +1 -1
- package/dist/SearchBar.js +1 -1
- package/dist/Select.js +709 -653
- package/dist/Select.js.map +1 -1
- package/dist/SelectStatus.js +1 -1
- package/dist/SelectStatus.js.map +1 -1
- package/dist/SelectStatus.vue.d.ts +1 -1
- package/dist/Skeleton.js.map +1 -1
- package/dist/Step.js +1 -1
- package/dist/Stepper.js +1 -1
- package/dist/Tab.js +1 -1
- package/dist/Tab.vue_vue_type_script_setup_true_lang-69d1b046.js.map +1 -1
- package/dist/Table.js +2 -2
- package/dist/TableCell.js +2 -2
- package/dist/TableHeaderCell.js +2 -2
- package/dist/TableHeaderRow.js +2 -2
- package/dist/TableRow.js +2 -2
- package/dist/TableRow.vue.d.ts +1 -1
- package/dist/Tabs.js +1 -1
- package/dist/TextEditor.js +991 -991
- package/dist/TextEditor.js.map +1 -1
- package/dist/Textarea.js.map +1 -1
- package/dist/Toast.js +274 -252
- package/dist/Toast.js.map +1 -1
- package/dist/Toasts.js +1 -1
- package/dist/ToastsPlugin.js +1 -1
- package/dist/components.css +2 -2
- package/dist/index-5e5945a9.js.map +1 -1
- package/dist/{index-79ce320f.js → index-9e1095ef.js} +6 -4
- package/dist/index-9e1095ef.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/isDefined-2ce6cde4.js.map +1 -1
- package/dist/observe.js.map +1 -1
- package/dist/searchFuzzy-74a7de1c.js.map +1 -1
- package/dist/sticky.js.map +1 -1
- package/dist/tailwind-base.js.map +1 -1
- package/dist/toTimeZone-e6e9ab75.js.map +1 -1
- package/dist/tooltip.js.map +1 -1
- package/dist/useGoogleMaps.js +109 -119
- package/dist/useGoogleMaps.js.map +1 -1
- package/dist/useModals.d.ts +6 -363
- package/dist/useModals.js.map +1 -1
- package/dist/useScriptTag.js.map +1 -1
- package/dist/useStepper.js.map +1 -1
- package/dist/useValidation.js.map +1 -1
- package/dist/utils/colorScheme.js.map +1 -1
- package/dist/utils/createQueryString.js.map +1 -1
- package/dist/utils/formatDateTime.js.map +1 -1
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/i18n.js.map +1 -1
- package/dist/utils/storage.js.map +1 -1
- package/dist/viewable.js.map +1 -1
- package/package.json +30 -46
- package/dist/index-79ce320f.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../../src/utils/helpers.ts"],"sourcesContent":["import camelCase from 'lodash-es/camelCase';\nimport get from 'lodash-es/get';\nimport isFinite from 'lodash-es/isFinite';\nimport isPlainObject from 'lodash-es/isPlainObject';\n\nimport { INBOUND_LEADS, LICENSE_COLORS, ORDER, SELLER_STATUSES } from '../constants';\n\nconst BULK = 'BULK';\nconst MOUNT_POINT_CLASS = '.mount-point-container';\n\n/**\n * Filters the list of `items` based on options selected in the `filters` object\n * @param {array} items A list of items to filter\n * @param {IFilter} options an options object for the filtering configuration\n */\nexport function filterItems(items, filters) {\n if (!Object.keys(filters).length) {\n return items;\n }\n\n return items.filter((item) => {\n for (const key in filters) {\n // eg. `brand`, `category`, `status`...\n const filter = filters[key]; // IFilter;\n const filterValues = filter.filterBy; // eg. ['1906', 'LuvBuds'], ['vape', 'pen', 'flower']\n let itemValue = get(item, key.split('.')); // eg `LuvBuds`, 'vape'\n\n // TODO take care of this upstream. ie write custom filter function if itemValue is an object\n // ie. if (typeof itemValue !== 'string' || typeof itemValue !== 'number' )\n if (isPlainObject(itemValue)) {\n itemValue = item[key].id;\n }\n\n if ('customFilter' in filter) {\n // custom function should return `false` when the filter logic does not match\n if (!filter.customFilter(filterValues, itemValue, item)) {\n return false;\n }\n } else {\n if (!Array.isArray(itemValue) && !~filterValues.indexOf(itemValue)) {\n return false;\n }\n }\n }\n\n return true;\n });\n}\n\n/**\n * Sorts an array of items\n * @param {Array} items the list of things to sort\n * @param {ISort} options an options object for the sorting configuration\n * sortBy: the object key to sort on\n * sortDesc: whether to sort descending or not\n * customSorter: a custom sorting function\n *\n * https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/util/helpers.ts#L381\n */\nexport function sortItems(items, options) {\n const { sortBy, sortDesc, customSorter, locale = 'en' } = options;\n const isObject = items.length && typeof items[0] === 'object';\n\n if (!sortBy && isObject) {\n return items;\n }\n\n return [...items].sort((a, b) => {\n let sortA = get(a, sortBy) || a;\n let sortB = get(b, sortBy) || b;\n\n if (sortDesc) {\n [sortA, sortB] = [sortB, sortA];\n }\n\n if (customSorter) {\n return customSorter(sortA, sortB);\n }\n\n [sortA, sortB] = [sortA, sortB].map((s) => (s || '').toString().toLocaleLowerCase());\n\n if (sortA !== sortB) {\n const sortResult =\n !isNaN(sortA) && !isNaN(sortB) ? Number(sortA) - Number(sortB) : sortA.localeCompare(sortB, locale);\n\n if (sortResult) {\n return sortResult;\n }\n }\n\n return 0;\n });\n}\n\n/**\n * Removes all accents/diacritics and converts to lower case\n * @param {string} text to normalize\n */\nexport function normalizeText(text) {\n if (isFinite(text)) {\n text = text.toString();\n }\n\n if (!text || typeof text !== 'string') {\n return '';\n }\n\n /**\n * NFD splits the canonical form and the regex removed only accent characters\n * see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize for more detail.\n */\n return text\n .toLowerCase()\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '');\n}\n\n/**\n * Generates a hash code from a string\n * @param {string} s The string to generate a hash from\n * @see https://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript/52171480\n */\nexport function hashCode(s) {\n return s.split('').reduce((a, b) => {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0);\n}\n\n/**\n * Returns the mount point for elements that will reattach themselves, or creates one if not available\n */\nexport function getMountPoint() {\n const el = document.querySelector(MOUNT_POINT_CLASS);\n\n if (!el) {\n const div = document.createElement('div');\n\n div.className = MOUNT_POINT_CLASS.slice(1, MOUNT_POINT_CLASS.length);\n return document.body.appendChild(div);\n }\n\n return el;\n}\n\n/**\n * Retrieves the value of a css variable\n *\n * @param {string} name name of the css var, with or without `--`\n * @return {string} value of the css var\n */\nexport function getCssVar(name) {\n let variable = name;\n\n if (variable.substring(0, 2) !== '--') {\n variable = `--${variable}`;\n }\n\n return getComputedStyle(document.documentElement).getPropertyValue(variable);\n}\n\n/**\n * Format the license type text to display\n * @param {string} licenseType the first three characters of the licenseType\n */\nexport function formatLicenseTypeText(licenseType = '') {\n const type = licenseType.toUpperCase();\n\n return type === BULK ? type : type.slice(0, 3);\n}\n\nexport function generateColorClass(type, value) {\n let color;\n\n try {\n switch (type) {\n case 'license':\n value = formatLicenseTypeText(value);\n color = LICENSE_COLORS[value];\n break;\n case 'order':\n color = 'tw-bg-' + ORDER[value.toUpperCase()].color;\n break;\n case 'certified-seller':\n color = SELLER_STATUSES[camelCase(value)].color;\n break;\n case 'inbound-leads':\n color = INBOUND_LEADS[value.toUpperCase()].color;\n break;\n }\n\n return color || 'tw-bg-ice-500';\n } catch (e) {\n return 'tw-bg-ice-500';\n }\n}\n"],"names":["BULK","MOUNT_POINT_CLASS","filterItems","items","filters","item","key","filter","filterValues","itemValue","get","isPlainObject","sortItems","options","sortBy","sortDesc","customSorter","locale","isObject","a","b","sortA","sortB","s","sortResult","normalizeText","text","isFinite","hashCode","getMountPoint","el","div","getCssVar","name","variable","formatLicenseTypeText","licenseType","type","generateColorClass","value","color","LICENSE_COLORS","ORDER","SELLER_STATUSES","camelCase","INBOUND_LEADS"],"mappings":";;;;;AAOA,MAAMA,IAAO,QACPC,IAAoB;AAOV,SAAAC,EAAYC,GAAOC,GAAS;AAC1C,SAAK,OAAO,KAAKA,CAAO,EAAE,SAInBD,EAAM,OAAO,CAACE,MAAS;AAC5B,eAAWC,KAAOF,GAAS;AAEnB,YAAAG,IAASH,EAAQE,CAAG,GACpBE,IAAeD,EAAO;AAC5B,UAAIE,IAAYC,EAAIL,GAAMC,EAAI,MAAM,GAAG,CAAC;AAQxC,UAJIK,EAAcF,CAAS,MACbA,IAAAJ,EAAKC,CAAG,EAAE,KAGpB,kBAAkBC;AAEpB,YAAI,CAACA,EAAO,aAAaC,GAAcC,GAAWJ,CAAI;AAC7C,iBAAA;AAAA,iBAGL,CAAC,MAAM,QAAQI,CAAS,KAAK,CAAC,CAACD,EAAa,QAAQC,CAAS;AACxD,eAAA;AAAA
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../../src/utils/helpers.ts"],"sourcesContent":["import camelCase from 'lodash-es/camelCase';\nimport get from 'lodash-es/get';\nimport isFinite from 'lodash-es/isFinite';\nimport isPlainObject from 'lodash-es/isPlainObject';\n\nimport { INBOUND_LEADS, LICENSE_COLORS, ORDER, SELLER_STATUSES } from '../constants';\n\nconst BULK = 'BULK';\nconst MOUNT_POINT_CLASS = '.mount-point-container';\n\n/**\n * Filters the list of `items` based on options selected in the `filters` object\n * @param {array} items A list of items to filter\n * @param {IFilter} options an options object for the filtering configuration\n */\nexport function filterItems(items, filters) {\n if (!Object.keys(filters).length) {\n return items;\n }\n\n return items.filter((item) => {\n for (const key in filters) {\n // eg. `brand`, `category`, `status`...\n const filter = filters[key]; // IFilter;\n const filterValues = filter.filterBy; // eg. ['1906', 'LuvBuds'], ['vape', 'pen', 'flower']\n let itemValue = get(item, key.split('.')); // eg `LuvBuds`, 'vape'\n\n // TODO take care of this upstream. ie write custom filter function if itemValue is an object\n // ie. if (typeof itemValue !== 'string' || typeof itemValue !== 'number' )\n if (isPlainObject(itemValue)) {\n itemValue = item[key].id;\n }\n\n if ('customFilter' in filter) {\n // custom function should return `false` when the filter logic does not match\n if (!filter.customFilter(filterValues, itemValue, item)) {\n return false;\n }\n } else {\n if (!Array.isArray(itemValue) && !~filterValues.indexOf(itemValue)) {\n return false;\n }\n }\n }\n\n return true;\n });\n}\n\n/**\n * Sorts an array of items\n * @param {Array} items the list of things to sort\n * @param {ISort} options an options object for the sorting configuration\n * sortBy: the object key to sort on\n * sortDesc: whether to sort descending or not\n * customSorter: a custom sorting function\n *\n * https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/util/helpers.ts#L381\n */\nexport function sortItems(items, options) {\n const { sortBy, sortDesc, customSorter, locale = 'en' } = options;\n const isObject = items.length && typeof items[0] === 'object';\n\n if (!sortBy && isObject) {\n return items;\n }\n\n return [...items].sort((a, b) => {\n let sortA = get(a, sortBy) || a;\n let sortB = get(b, sortBy) || b;\n\n if (sortDesc) {\n [sortA, sortB] = [sortB, sortA];\n }\n\n if (customSorter) {\n return customSorter(sortA, sortB);\n }\n\n [sortA, sortB] = [sortA, sortB].map((s) => (s || '').toString().toLocaleLowerCase());\n\n if (sortA !== sortB) {\n const sortResult =\n !isNaN(sortA) && !isNaN(sortB) ? Number(sortA) - Number(sortB) : sortA.localeCompare(sortB, locale);\n\n if (sortResult) {\n return sortResult;\n }\n }\n\n return 0;\n });\n}\n\n/**\n * Removes all accents/diacritics and converts to lower case\n * @param {string} text to normalize\n */\nexport function normalizeText(text) {\n if (isFinite(text)) {\n text = text.toString();\n }\n\n if (!text || typeof text !== 'string') {\n return '';\n }\n\n /**\n * NFD splits the canonical form and the regex removed only accent characters\n * see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize for more detail.\n */\n return text\n .toLowerCase()\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '');\n}\n\n/**\n * Generates a hash code from a string\n * @param {string} s The string to generate a hash from\n * @see https://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript/52171480\n */\nexport function hashCode(s) {\n return s.split('').reduce((a, b) => {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0);\n}\n\n/**\n * Returns the mount point for elements that will reattach themselves, or creates one if not available\n */\nexport function getMountPoint() {\n const el = document.querySelector(MOUNT_POINT_CLASS);\n\n if (!el) {\n const div = document.createElement('div');\n\n div.className = MOUNT_POINT_CLASS.slice(1, MOUNT_POINT_CLASS.length);\n return document.body.appendChild(div);\n }\n\n return el;\n}\n\n/**\n * Retrieves the value of a css variable\n *\n * @param {string} name name of the css var, with or without `--`\n * @return {string} value of the css var\n */\nexport function getCssVar(name) {\n let variable = name;\n\n if (variable.substring(0, 2) !== '--') {\n variable = `--${variable}`;\n }\n\n return getComputedStyle(document.documentElement).getPropertyValue(variable);\n}\n\n/**\n * Format the license type text to display\n * @param {string} licenseType the first three characters of the licenseType\n */\nexport function formatLicenseTypeText(licenseType = '') {\n const type = licenseType.toUpperCase();\n\n return type === BULK ? type : type.slice(0, 3);\n}\n\nexport function generateColorClass(type, value) {\n let color;\n\n try {\n switch (type) {\n case 'license':\n value = formatLicenseTypeText(value);\n color = LICENSE_COLORS[value];\n break;\n case 'order':\n color = 'tw-bg-' + ORDER[value.toUpperCase()].color;\n break;\n case 'certified-seller':\n color = SELLER_STATUSES[camelCase(value)].color;\n break;\n case 'inbound-leads':\n color = INBOUND_LEADS[value.toUpperCase()].color;\n break;\n }\n\n return color || 'tw-bg-ice-500';\n } catch (e) {\n return 'tw-bg-ice-500';\n }\n}\n"],"names":["BULK","MOUNT_POINT_CLASS","filterItems","items","filters","item","key","filter","filterValues","itemValue","get","isPlainObject","sortItems","options","sortBy","sortDesc","customSorter","locale","isObject","a","b","sortA","sortB","s","sortResult","normalizeText","text","isFinite","hashCode","getMountPoint","el","div","getCssVar","name","variable","formatLicenseTypeText","licenseType","type","generateColorClass","value","color","LICENSE_COLORS","ORDER","SELLER_STATUSES","camelCase","INBOUND_LEADS"],"mappings":";;;;;AAOA,MAAMA,IAAO,QACPC,IAAoB;AAOV,SAAAC,EAAYC,GAAOC,GAAS;AAC1C,SAAK,OAAO,KAAKA,CAAO,EAAE,SAInBD,EAAM,OAAO,CAACE,MAAS;AAC5B,eAAWC,KAAOF,GAAS;AAEnB,YAAAG,IAASH,EAAQE,CAAG,GACpBE,IAAeD,EAAO;AAC5B,UAAIE,IAAYC,EAAIL,GAAMC,EAAI,MAAM,GAAG,CAAC;AAQxC,UAJIK,EAAcF,CAAS,MACbA,IAAAJ,EAAKC,CAAG,EAAE,KAGpB,kBAAkBC;AAEpB,YAAI,CAACA,EAAO,aAAaC,GAAcC,GAAWJ,CAAI;AAC7C,iBAAA;AAAA,iBAGL,CAAC,MAAM,QAAQI,CAAS,KAAK,CAAC,CAACD,EAAa,QAAQC,CAAS;AACxD,eAAA;AAAA;AAKN,WAAA;AAAA,EAAA,CACR,IA7BQN;AA8BX;AAYgB,SAAAS,EAAUT,GAAOU,GAAS;AACxC,QAAM,EAAE,QAAAC,GAAQ,UAAAC,GAAU,cAAAC,GAAc,QAAAC,IAAS,KAAS,IAAAJ,GACpDK,IAAW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AAAA;AAG/B,SAAAD;AACT;AAQO,SAASE,EAAUC,GAAM;AAC9B,MAAIC,IAAWD;AAEf,SAAIC,EAAS,UAAU,GAAG,CAAC,MAAM,SAC/BA,IAAW,KAAKA,MAGX,iBAAiB,SAAS,eAAe,EAAE,iBAAiBA,CAAQ;AAC7E;AAMgB,SAAAC,EAAsBC,IAAc,IAAI;AAChD,QAAAC,IAAOD,EAAY;AAEzB,SAAOC,MAASrC,IAAOqC,IAAOA,EAAK,MAAM,GAAG,CAAC;AAC/C;AAEgB,SAAAC,EAAmBD,GAAME,GAAO;AAC1C,MAAAC;AAEA,MAAA;AACF,YAAQH,GAAM;AAAA,MACZ,KAAK;AACH,QAAAE,IAAQJ,EAAsBI,CAAK,GACnCC,IAAQC,EAAeF,CAAK;AAC5B;AAAA,MACF,KAAK;AACH,QAAAC,IAAQ,WAAWE,EAAMH,EAAM,YAAA,CAAa,EAAE;AAC9C;AAAA,MACF,KAAK;AACH,QAAAC,IAAQG,EAAgBC,EAAUL,CAAK,CAAC,EAAE;AAC1C;AAAA,MACF,KAAK;AACH,QAAAC,IAAQK,EAAcN,EAAM,YAAa,CAAA,EAAE;AAC3C;AAAA,IACJ;AAEA,WAAOC,KAAS;AAAA;AAET,WAAA;AAAA,EACT;AACF;"}
|
package/dist/utils/i18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sources":["../../src/utils/i18n.ts"],"sourcesContent":["import { CURRENCY_SYMBOL_MAP } from '../constants';\nimport { locale } from '../locale';\n\n/**\n * Return the correct symbol for a currency based on code.\n *\n * @param {string} currencyCode - The code used to determine the symbol (i.e. 'USD').\n * @returns {string} - Currency symbol, i.e. '$'.\n */\nexport const getSymbolFromCurrency = (currencyCode) => {\n if (typeof currencyCode !== 'string') {\n return undefined;\n }\n\n const code = currencyCode.toUpperCase();\n\n if (!Object.prototype.hasOwnProperty.call(CURRENCY_SYMBOL_MAP, code)) {\n return undefined;\n }\n\n return CURRENCY_SYMBOL_MAP[code];\n};\n\nexport const decimalSeparator = getLocaleDecimalSeparator(locale);\nexport const currencySymbol = getSymbolFromCurrency('USD');\nexport const currency = {\n default: 'USD',\n position: getLocaleSymbolPosition(),\n symbol: currencySymbol,\n};\n\n/**\n * A helper function for obtaining the current decimal separator\n * @param {string} locale The locale used to determine the separator.\n * @returns {string} Decimal separator ('.', ',')\n */\nfunction getLocaleDecimalSeparator(locale) {\n return (1.1).toLocaleString(locale).replace(/\\d/g, '');\n}\n\n/**\n * A helper function for obtaining symbol position relative to a value\n * This should be fine going forward unless we get into RTL, or Arabic.\n * @param {string} type the type of symbol\n */\nexport function getLocaleSymbolPosition({ type = 'currency' } = {}) {\n return (type === 'percent' && percent(1).indexOf('%') === 0) ||\n (type === 'currency' && money({ amount: 1 }).indexOf(currencySymbol) === 0)\n ? 'prepend'\n : 'append';\n}\n\n/**\n * Format a value as a decimal in a locale-aware format.\n * NOTE: Be careful as this returns a string and should not be used for\n * additional calculation unless converted.\n * @param {number|string} value number to format\n * @param {number} [decimalPlaces] number of decimal places\n * @return {string} locale-aware number as a string\n */\nexport function decimal(value, decimalPlaces) {\n return new Intl.NumberFormat(locale, {\n minimumFractionDigits: decimalPlaces,\n maximumFractionDigits: decimalPlaces,\n style: 'decimal',\n }).format(value);\n}\n\n/**\n * Format a value as a money string in a locale-aware format.\n * @param {Object} object\n * @param {number} object.amount The number to format\n * @param {string} [object.currency] ISO 4217 currency code (USD, CAD, EUR, etc)\n * @return {string} locale-aware money value as a string\n */\nexport function money({ amount, currency = 'USD' }) {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n }).format(amount);\n}\n\n/**\n * Format a value as a percent in a locale-aware format.\n * @param {number|string} value number to format\n * @param {number} [decimalPlaces] number of decimal places\n * @return {string} locale-aware percentage value as a string\n */\nexport function percent(value, decimalPlaces?) {\n return new Intl.NumberFormat(locale, {\n style: 'percent',\n minimumFractionDigits: decimalPlaces,\n maximumFractionDigits: decimalPlaces || 2,\n }).format(value);\n}\n\n/**\n * Cleans a value to reflect type=number restrictions.\n * Omits exponents, and restricts the decimal separator.\n * @param {number|string} value value to format\n * @param {string} value decimal separator\n */\nexport function sanitizeDecimal(value, separator = '.') {\n const replace = `[^0-9${separator}+-]*`;\n const re = new RegExp(replace, 'g');\n\n return `${value}`.replace(re, '');\n}\n\n/**\n * Replace decimal separator of `value` with `convertTo`\n * @param {string|number} value\n * @param {string} convertTo decimal character to update the value with\n */\nexport function convertDecimal(value, convertTo = '.') {\n return `${value}`.replace(convertTo === '.' ? ',' : '.', convertTo);\n}\n"],"names":["getSymbolFromCurrency","currencyCode","code","CURRENCY_SYMBOL_MAP","decimalSeparator","getLocaleDecimalSeparator","locale","currencySymbol","currency","getLocaleSymbolPosition","type","percent","money","decimal","value","decimalPlaces","amount","sanitizeDecimal","separator","replace","re","convertDecimal","convertTo"],"mappings":";;;AASa,MAAAA,IAAwB,CAACC,MAAiB;AACjD,MAAA,OAAOA,KAAiB;AACnB;AAGH,QAAAC,IAAOD,EAAa;AAE1B,MAAK,OAAO,UAAU,eAAe,KAAKE,GAAqBD,CAAI;AAInE,WAAOC,EAAoBD,CAAI;AACjC,GAEaE,IAAmBC,EAA0BC,CAAM,GACnDC,IAAiBP,EAAsB,KAAK,GAC5CQ,IAAW;AAAA,EACtB,SAAS;AAAA,EACT,UAAUC,EAAwB;AAAA,EAClC,QAAQF;AACV;AAOA,SAASF,EAA0BC,GAAQ;AACzC,SAAQ,IAAK,eAAeA,CAAM,EAAE,QAAQ,OAAO,EAAE;AACvD;AAOO,SAASG,EAAwB,EAAE,MAAAC,IAAO,WAAW,IAAI,CAAA,GAAI;AAC1D,SAAAA,MAAS,aAAaC,EAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,KACvDD,MAAS,cAAcE,EAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQL,CAAc,MAAM,IACvE,YACA;AACN;AAUgB,SAAAM,EAAQC,GAAOC,GAAe;AACrC,SAAA,IAAI,KAAK,aAAaT,GAAQ;AAAA,IACnC,uBAAuBS;AAAA,IACvB,uBAAuBA;AAAA,IACvB,OAAO;AAAA,EAAA,CACR,EAAE,OAAOD,CAAK;AACjB;AASO,SAASF,EAAM,EAAE,QAAAI,GAAQ,UAAAR,IAAW,SAAS;AAC3C,SAAA,IAAI,KAAK,aAAaF,GAAQ;AAAA,IACnC,OAAO;AAAA,IACP,UAAAE;AAAAA,EAAA,CACD,EAAE,OAAOQ,CAAM;AAClB;AAQgB,SAAAL,EAAQG,GAAOC,GAAgB;AACtC,SAAA,IAAI,KAAK,aAAaT,GAAQ;AAAA,IACnC,OAAO;AAAA,IACP,uBAAuBS;AAAA,IACvB,uBAAuBA,KAAiB;AAAA,EAAA,CACzC,EAAE,OAAOD,CAAK;AACjB;AAQgB,SAAAG,EAAgBH,GAAOI,IAAY,KAAK;
|
|
1
|
+
{"version":3,"file":"i18n.js","sources":["../../src/utils/i18n.ts"],"sourcesContent":["import { CURRENCY_SYMBOL_MAP } from '../constants';\nimport { locale } from '../locale';\n\n/**\n * Return the correct symbol for a currency based on code.\n *\n * @param {string} currencyCode - The code used to determine the symbol (i.e. 'USD').\n * @returns {string} - Currency symbol, i.e. '$'.\n */\nexport const getSymbolFromCurrency = (currencyCode) => {\n if (typeof currencyCode !== 'string') {\n return undefined;\n }\n\n const code = currencyCode.toUpperCase();\n\n if (!Object.prototype.hasOwnProperty.call(CURRENCY_SYMBOL_MAP, code)) {\n return undefined;\n }\n\n return CURRENCY_SYMBOL_MAP[code];\n};\n\nexport const decimalSeparator = getLocaleDecimalSeparator(locale);\nexport const currencySymbol = getSymbolFromCurrency('USD');\nexport const currency = {\n default: 'USD',\n position: getLocaleSymbolPosition(),\n symbol: currencySymbol,\n};\n\n/**\n * A helper function for obtaining the current decimal separator\n * @param {string} locale The locale used to determine the separator.\n * @returns {string} Decimal separator ('.', ',')\n */\nfunction getLocaleDecimalSeparator(locale) {\n return (1.1).toLocaleString(locale).replace(/\\d/g, '');\n}\n\n/**\n * A helper function for obtaining symbol position relative to a value\n * This should be fine going forward unless we get into RTL, or Arabic.\n * @param {string} type the type of symbol\n */\nexport function getLocaleSymbolPosition({ type = 'currency' } = {}) {\n return (type === 'percent' && percent(1).indexOf('%') === 0) ||\n (type === 'currency' && money({ amount: 1 }).indexOf(currencySymbol) === 0)\n ? 'prepend'\n : 'append';\n}\n\n/**\n * Format a value as a decimal in a locale-aware format.\n * NOTE: Be careful as this returns a string and should not be used for\n * additional calculation unless converted.\n * @param {number|string} value number to format\n * @param {number} [decimalPlaces] number of decimal places\n * @return {string} locale-aware number as a string\n */\nexport function decimal(value, decimalPlaces) {\n return new Intl.NumberFormat(locale, {\n minimumFractionDigits: decimalPlaces,\n maximumFractionDigits: decimalPlaces,\n style: 'decimal',\n }).format(value);\n}\n\n/**\n * Format a value as a money string in a locale-aware format.\n * @param {Object} object\n * @param {number} object.amount The number to format\n * @param {string} [object.currency] ISO 4217 currency code (USD, CAD, EUR, etc)\n * @return {string} locale-aware money value as a string\n */\nexport function money({ amount, currency = 'USD' }) {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n }).format(amount);\n}\n\n/**\n * Format a value as a percent in a locale-aware format.\n * @param {number|string} value number to format\n * @param {number} [decimalPlaces] number of decimal places\n * @return {string} locale-aware percentage value as a string\n */\nexport function percent(value, decimalPlaces?) {\n return new Intl.NumberFormat(locale, {\n style: 'percent',\n minimumFractionDigits: decimalPlaces,\n maximumFractionDigits: decimalPlaces || 2,\n }).format(value);\n}\n\n/**\n * Cleans a value to reflect type=number restrictions.\n * Omits exponents, and restricts the decimal separator.\n * @param {number|string} value value to format\n * @param {string} value decimal separator\n */\nexport function sanitizeDecimal(value, separator = '.') {\n const replace = `[^0-9${separator}+-]*`;\n const re = new RegExp(replace, 'g');\n\n return `${value}`.replace(re, '');\n}\n\n/**\n * Replace decimal separator of `value` with `convertTo`\n * @param {string|number} value\n * @param {string} convertTo decimal character to update the value with\n */\nexport function convertDecimal(value, convertTo = '.') {\n return `${value}`.replace(convertTo === '.' ? ',' : '.', convertTo);\n}\n"],"names":["getSymbolFromCurrency","currencyCode","code","CURRENCY_SYMBOL_MAP","decimalSeparator","getLocaleDecimalSeparator","locale","currencySymbol","currency","getLocaleSymbolPosition","type","percent","money","decimal","value","decimalPlaces","amount","sanitizeDecimal","separator","replace","re","convertDecimal","convertTo"],"mappings":";;;AASa,MAAAA,IAAwB,CAACC,MAAiB;AACjD,MAAA,OAAOA,KAAiB;AACnB;AAGH,QAAAC,IAAOD,EAAa;AAE1B,MAAK,OAAO,UAAU,eAAe,KAAKE,GAAqBD,CAAI;AAInE,WAAOC,EAAoBD,CAAI;AACjC,GAEaE,IAAmBC,EAA0BC,CAAM,GACnDC,IAAiBP,EAAsB,KAAK,GAC5CQ,IAAW;AAAA,EACtB,SAAS;AAAA,EACT,UAAUC,EAAwB;AAAA,EAClC,QAAQF;AACV;AAOA,SAASF,EAA0BC,GAAQ;AACzC,SAAQ,IAAK,eAAeA,CAAM,EAAE,QAAQ,OAAO,EAAE;AACvD;AAOO,SAASG,EAAwB,EAAE,MAAAC,IAAO,WAAW,IAAI,CAAA,GAAI;AAC1D,SAAAA,MAAS,aAAaC,EAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,KACvDD,MAAS,cAAcE,EAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQL,CAAc,MAAM,IACvE,YACA;AACN;AAUgB,SAAAM,EAAQC,GAAOC,GAAe;AACrC,SAAA,IAAI,KAAK,aAAaT,GAAQ;AAAA,IACnC,uBAAuBS;AAAA,IACvB,uBAAuBA;AAAA,IACvB,OAAO;AAAA,EAAA,CACR,EAAE,OAAOD,CAAK;AACjB;AASO,SAASF,EAAM,EAAE,QAAAI,GAAQ,UAAAR,IAAW,SAAS;AAC3C,SAAA,IAAI,KAAK,aAAaF,GAAQ;AAAA,IACnC,OAAO;AAAA,IACP,UAAAE;AAAAA,EAAA,CACD,EAAE,OAAOQ,CAAM;AAClB;AAQgB,SAAAL,EAAQG,GAAOC,GAAgB;AACtC,SAAA,IAAI,KAAK,aAAaT,GAAQ;AAAA,IACnC,OAAO;AAAA,IACP,uBAAuBS;AAAA,IACvB,uBAAuBA,KAAiB;AAAA,EAAA,CACzC,EAAE,OAAOD,CAAK;AACjB;AAQgB,SAAAG,EAAgBH,GAAOI,IAAY,KAAK;AACtD,QAAMC,IAAU,QAAQD,SAClBE,IAAK,IAAI,OAAOD,GAAS,GAAG;AAElC,SAAO,GAAGL,IAAQ,QAAQM,GAAI,EAAE;AAClC;AAOgB,SAAAC,EAAeP,GAAOQ,IAAY,KAAK;AACrD,SAAO,GAAGR,IAAQ,QAAQQ,MAAc,MAAM,MAAM,KAAKA,CAAS;AACpE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sources":["../../src/utils/storage.ts"],"sourcesContent":["import logger from '@leaflink/snitch';\n\nimport { hashCode } from './helpers';\n\nconst PREFIX = 'll';\n\n/**\n * Persist an item to localStorage, unique to each url pathname unless [options.global] is set to true\n *\n * If global is set to false (the default):\n * name: 'foo'\n * data: { a: 'a' }\n *\n * localStorage key: 'll-foo-/c/the-leaf-shop/customers/'\n * localStorage value: { a: 'a' }\n *\n * If global is set to true:\n * name: 'bar'\n * data: { b: 'b' }\n *\n * localStorage key: 'll-bar'\n * localStorage value: { b: 'b' }\n *\n * @param {string} name - the storage key name, often a component name\n * @param {object} data - the data to persist\n * @param {object} [options] - an optional options object\n * @param {boolean} [options.global] - does not add url to the key when true\n */\nexport function setPersistentItem(name, data, options: { global?: boolean } = {}) {\n const scope = options.global ? '' : `-${location.pathname}`;\n const storageKey = `${PREFIX}-${name}${scope}`;\n const storageValue = JSON.stringify(data);\n\n try {\n localStorage.setItem(storageKey, storageValue);\n } catch (error) {\n if ((error as Error)?.name === 'QuotaExceededError') {\n logger.log(`Your localStorage is full. Failed to save item for key: ${storageKey}`);\n } else {\n logger.log(`Failed to save value to localStorage for key: ${storageKey}`);\n }\n }\n}\n\n/**\n * Retrieve an item from localStorage, previously saved by `setPersistentItem`.\n * @param {string} name The storage key name, often a component name\n * @param {object} [options] - an optional options object\n * @param {boolean} [options.global] - does not add url to the key when true\n * @returns {any | undefined}\n */\nexport function getPersistentItem(name, options: { global?: boolean } = {}) {\n const scope = options.global ? '' : `-${location.pathname}`;\n const item = localStorage.getItem(`${PREFIX}-${name}${scope}`);\n\n // localStorage.getItem always returns a string or null. When it's a string,\n // it usually contains an object or a boolean. If the value is 'false', we\n // need to ensure we return false instead of null.\n if (item === null || item === 'undefined') {\n return null;\n }\n\n try {\n return JSON.parse(item);\n } catch (err) {\n logger.error((err as Error)?.message, { error: err });\n\n return null;\n }\n}\n\n/**\n * Remove an item from localStorage, previously saved by `setPersistentItem`.\n * @param {string} name The storage key name, often a component name\n * @param {object} [options] - an optional options object\n * @param {boolean} [options.global] - does not add url to the key when true\n */\nexport function removePersistentItem(name, options: { global?: boolean } = {}) {\n const scope = options.global ? '' : `-${location.pathname}`;\n const storageKey = `${PREFIX}-${name}${scope}`;\n const item = localStorage.getItem(storageKey);\n\n if (item === null) {\n return;\n }\n\n try {\n localStorage.removeItem(storageKey);\n } catch (err) {\n logger.error((err as Error).message, { error: err });\n }\n}\n\n/**\n ***************** DEPRECATED *****************\n */\nexport function getPersistentItem__deprecated(itemKey: string, name) {\n const item = JSON.parse(localStorage.getItem(itemKey) || '{}');\n\n try {\n return (item[name] || {})[hashCode(location.pathname)];\n } catch (err) {\n logger.error((err as Error)?.message, { error: err });\n\n return undefined;\n }\n}\n\nexport function removePersistentItem__deprecated(itemKey, name) {\n const item = JSON.parse(localStorage.getItem(itemKey) || '{}');\n const itemValue = { ...item };\n\n if (itemValue[name]) {\n delete itemValue[name][hashCode(location.pathname)];\n }\n\n try {\n localStorage.setItem(itemKey, JSON.stringify(itemValue));\n } catch (error) {\n if ((error as Error)?.name === 'QuotaExceededError') {\n logger.log(`Your localStorage is full. Failed to set item.`);\n } else {\n logger.log(`Failed to set item to localStorage.`);\n }\n }\n}\n// END DEPRECATED\n\nexport const persistentStorage = {\n setItem: setPersistentItem,\n getItem: getPersistentItem,\n removeItem: removePersistentItem,\n};\n"],"names":["PREFIX","setPersistentItem","name","data","options","scope","storageKey","storageValue","error","logger","getPersistentItem","item","err","removePersistentItem","getPersistentItem__deprecated","itemKey","hashCode","removePersistentItem__deprecated","itemValue","persistentStorage"],"mappings":";;;;;;;AAIA,MAAMA,IAAS;AAwBR,SAASC,EAAkBC,GAAMC,GAAMC,IAAgC,CAAA,GAAI;AAChF,QAAMC,IAAQD,EAAQ,SAAS,KAAK,IAAI,SAAS,
|
|
1
|
+
{"version":3,"file":"storage.js","sources":["../../src/utils/storage.ts"],"sourcesContent":["import logger from '@leaflink/snitch';\n\nimport { hashCode } from './helpers';\n\nconst PREFIX = 'll';\n\n/**\n * Persist an item to localStorage, unique to each url pathname unless [options.global] is set to true\n *\n * If global is set to false (the default):\n * name: 'foo'\n * data: { a: 'a' }\n *\n * localStorage key: 'll-foo-/c/the-leaf-shop/customers/'\n * localStorage value: { a: 'a' }\n *\n * If global is set to true:\n * name: 'bar'\n * data: { b: 'b' }\n *\n * localStorage key: 'll-bar'\n * localStorage value: { b: 'b' }\n *\n * @param {string} name - the storage key name, often a component name\n * @param {object} data - the data to persist\n * @param {object} [options] - an optional options object\n * @param {boolean} [options.global] - does not add url to the key when true\n */\nexport function setPersistentItem(name, data, options: { global?: boolean } = {}) {\n const scope = options.global ? '' : `-${location.pathname}`;\n const storageKey = `${PREFIX}-${name}${scope}`;\n const storageValue = JSON.stringify(data);\n\n try {\n localStorage.setItem(storageKey, storageValue);\n } catch (error) {\n if ((error as Error)?.name === 'QuotaExceededError') {\n logger.log(`Your localStorage is full. Failed to save item for key: ${storageKey}`);\n } else {\n logger.log(`Failed to save value to localStorage for key: ${storageKey}`);\n }\n }\n}\n\n/**\n * Retrieve an item from localStorage, previously saved by `setPersistentItem`.\n * @param {string} name The storage key name, often a component name\n * @param {object} [options] - an optional options object\n * @param {boolean} [options.global] - does not add url to the key when true\n * @returns {any | undefined}\n */\nexport function getPersistentItem(name, options: { global?: boolean } = {}) {\n const scope = options.global ? '' : `-${location.pathname}`;\n const item = localStorage.getItem(`${PREFIX}-${name}${scope}`);\n\n // localStorage.getItem always returns a string or null. When it's a string,\n // it usually contains an object or a boolean. If the value is 'false', we\n // need to ensure we return false instead of null.\n if (item === null || item === 'undefined') {\n return null;\n }\n\n try {\n return JSON.parse(item);\n } catch (err) {\n logger.error((err as Error)?.message, { error: err });\n\n return null;\n }\n}\n\n/**\n * Remove an item from localStorage, previously saved by `setPersistentItem`.\n * @param {string} name The storage key name, often a component name\n * @param {object} [options] - an optional options object\n * @param {boolean} [options.global] - does not add url to the key when true\n */\nexport function removePersistentItem(name, options: { global?: boolean } = {}) {\n const scope = options.global ? '' : `-${location.pathname}`;\n const storageKey = `${PREFIX}-${name}${scope}`;\n const item = localStorage.getItem(storageKey);\n\n if (item === null) {\n return;\n }\n\n try {\n localStorage.removeItem(storageKey);\n } catch (err) {\n logger.error((err as Error).message, { error: err });\n }\n}\n\n/**\n ***************** DEPRECATED *****************\n */\nexport function getPersistentItem__deprecated(itemKey: string, name) {\n const item = JSON.parse(localStorage.getItem(itemKey) || '{}');\n\n try {\n return (item[name] || {})[hashCode(location.pathname)];\n } catch (err) {\n logger.error((err as Error)?.message, { error: err });\n\n return undefined;\n }\n}\n\nexport function removePersistentItem__deprecated(itemKey, name) {\n const item = JSON.parse(localStorage.getItem(itemKey) || '{}');\n const itemValue = { ...item };\n\n if (itemValue[name]) {\n delete itemValue[name][hashCode(location.pathname)];\n }\n\n try {\n localStorage.setItem(itemKey, JSON.stringify(itemValue));\n } catch (error) {\n if ((error as Error)?.name === 'QuotaExceededError') {\n logger.log(`Your localStorage is full. Failed to set item.`);\n } else {\n logger.log(`Failed to set item to localStorage.`);\n }\n }\n}\n// END DEPRECATED\n\nexport const persistentStorage = {\n setItem: setPersistentItem,\n getItem: getPersistentItem,\n removeItem: removePersistentItem,\n};\n"],"names":["PREFIX","setPersistentItem","name","data","options","scope","storageKey","storageValue","error","logger","getPersistentItem","item","err","removePersistentItem","getPersistentItem__deprecated","itemKey","hashCode","removePersistentItem__deprecated","itemValue","persistentStorage"],"mappings":";;;;;;;AAIA,MAAMA,IAAS;AAwBR,SAASC,EAAkBC,GAAMC,GAAMC,IAAgC,CAAA,GAAI;AAChF,QAAMC,IAAQD,EAAQ,SAAS,KAAK,IAAI,SAAS,YAC3CE,IAAa,GAAGN,KAAUE,IAAOG,KACjCE,IAAe,KAAK,UAAUJ,CAAI;AAEpC,MAAA;AACW,iBAAA,QAAQG,GAAYC,CAAY;AAAA,WACtCC;AACF,KAAAA,KAAA,gBAAAA,EAAiB,UAAS,uBACtBC,EAAA,IAAI,2DAA2DH,GAAY,IAE3EG,EAAA,IAAI,iDAAiDH,GAAY;AAAA,EAE5E;AACF;AASO,SAASI,EAAkBR,GAAME,IAAgC,IAAI;AAC1E,QAAMC,IAAQD,EAAQ,SAAS,KAAK,IAAI,SAAS,YAC3CO,IAAO,aAAa,QAAQ,GAAGX,KAAUE,IAAOG,GAAO;AAKzD,MAAAM,MAAS,QAAQA,MAAS;AACrB,WAAA;AAGL,MAAA;AACK,WAAA,KAAK,MAAMA,CAAI;AAAA,WACfC;AACP,WAAAH,EAAO,MAAOG,KAAA,gBAAAA,EAAe,SAAS,EAAE,OAAOA,GAAK,GAE7C;AAAA,EACT;AACF;AAQO,SAASC,EAAqBX,GAAME,IAAgC,IAAI;AAC7E,QAAMC,IAAQD,EAAQ,SAAS,KAAK,IAAI,SAAS,YAC3CE,IAAa,GAAGN,KAAUE,IAAOG;AAGvC,MAFa,aAAa,QAAQC,CAAU,MAE/B;AAIT,QAAA;AACF,mBAAa,WAAWA,CAAU;AAAA,aAC3BM;AACP,MAAAH,EAAO,MAAOG,EAAc,SAAS,EAAE,OAAOA,GAAK;AAAA,IACrD;AACF;AAKgB,SAAAE,EAA8BC,GAAiBb,GAAM;AACnE,QAAMS,IAAO,KAAK,MAAM,aAAa,QAAQI,CAAO,KAAK,IAAI;AAEzD,MAAA;AACM,YAAAJ,EAAKT,CAAI,KAAK,CAAA,GAAIc,EAAS,SAAS,QAAQ,CAAC;AAAA,WAC9CJ;AACP,IAAAH,EAAO,MAAOG,KAAA,gBAAAA,EAAe,SAAS,EAAE,OAAOA,GAAK;AAE7C;AAAA,EACT;AACF;AAEgB,SAAAK,EAAiCF,GAASb,GAAM;AAExD,QAAAgB,IAAY,EAAE,GADP,KAAK,MAAM,aAAa,QAAQH,CAAO,KAAK,IAAI;AAGzD,EAAAG,EAAUhB,CAAI,KAChB,OAAOgB,EAAUhB,CAAI,EAAEc,EAAS,SAAS,QAAQ,CAAC;AAGhD,MAAA;AACF,iBAAa,QAAQD,GAAS,KAAK,UAAUG,CAAS,CAAC;AAAA,WAChDV;AACF,KAAAA,KAAA,gBAAAA,EAAiB,UAAS,uBAC7BC,EAAO,IAAI,gDAAgD,IAE3DA,EAAO,IAAI,qCAAqC;AAAA,EAEpD;AACF;AAGO,MAAMU,IAAoB;AAAA,EAC/B,SAASlB;AAAA,EACT,SAASS;AAAA,EACT,YAAYG;AACd;"}
|
package/dist/viewable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewable.js","sources":["../src/directives/viewable/viewable.ts"],"sourcesContent":["import isEqual from 'lodash-es/isEqual';\nimport { nextTick } from 'vue';\n\nconst viewableKey = Symbol('v-viewable');\n\ntype ViewableCallback = (result: boolean, entry: IntersectionObserverEntry) => void;\n\nclass ViewableState {\n private observer: IntersectionObserver | null;\n private el: Element;\n private frozen: boolean;\n private options: {\n callback: ViewableCallback;\n intersection: IntersectionObserverInit;\n };\n private oldResult: undefined | boolean;\n private callback: ViewableCallback | null;\n private modifiers?: {\n once?: boolean;\n };\n\n constructor(el, options, modifiers = {}) {\n this.el = el;\n this.modifiers = modifiers;\n this.observer = null;\n this.callback = null;\n this.frozen = false;\n this.options = {\n callback: () => {},\n intersection: {},\n };\n this.createObserver(options);\n }\n\n /**\n * Default threshold of 100%.\n * Informs when the element is 100% visibile, or at the provided threshold(s)\n * Does not support an array of values.\n * @see: https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#thresholds\n */\n get threshold() {\n return this.options.intersection && typeof this.options.intersection.threshold === 'number'\n ? this.options.intersection.threshold\n : 1;\n }\n\n get intersectionObserverOptions() {\n return {\n threshold: this.threshold,\n ...this.options.intersection,\n };\n }\n\n createObserver(options) {\n if (this.observer) {\n this.destroyObserver();\n }\n\n if (this.frozen) {\n return;\n }\n\n this.options = this.processOptions(options);\n\n this.callback = (result, entry) => {\n this.options.callback(result, entry);\n\n if (result && this.modifiers?.once) {\n this.frozen = true;\n this.destroyObserver();\n }\n };\n\n this.oldResult = undefined;\n\n if ('IntersectionObserver' in window) {\n this.observer = new IntersectionObserver((entries) => {\n let entry = entries[0];\n\n if (entries.length > 1) {\n const intersectingEntry = entries.find((e) => e.isIntersecting);\n\n if (intersectingEntry) {\n entry = intersectingEntry;\n }\n }\n\n if (this.callback) {\n // Use isIntersecting if possible because browsers can report isIntersecting as true, but intersectionRatio as 0, when something very slowly enters the viewport.\n const result = entry.isIntersecting && entry.intersectionRatio >= this.threshold;\n\n if (result === this.oldResult) {\n return;\n }\n\n this.oldResult = result;\n this.callback(result, entry);\n }\n }, this.intersectionObserverOptions);\n }\n\n // Wait for the element to be in document\n nextTick(() => {\n if (this.observer) {\n this.observer.observe(this.el);\n }\n });\n }\n\n destroyObserver() {\n if (this.observer) {\n this.observer.unobserve(this.el);\n this.observer.disconnect();\n this.observer = null;\n }\n }\n\n private processOptions(value) {\n const options =\n typeof value === 'function'\n ? { callback: value } // Simple options (callback-only)\n : value; // Options object\n\n return options;\n }\n}\n\nfunction mount(el, { modifiers = {}, value }) {\n if (!value) {\n return;\n }\n\n if (value.intersection?.threshold instanceof Array) {\n throw new Error('`threshold` must be a number. v-viewable does not support `threshold` as an array.');\n }\n\n const state = new ViewableState(el, value, modifiers);\n\n el[viewableKey] = state;\n}\n\nfunction updated(el, { modifiers, value, oldValue }) {\n if (isEqual(value, oldValue) || value.toString() === oldValue.toString()) {\n return;\n }\n\n const state = el[viewableKey];\n\n if (!value) {\n unmount(el);\n return;\n }\n\n if (state) {\n state.createObserver(value);\n } else {\n mount(el, { modifiers, value });\n }\n}\n\nfunction unmount(el) {\n const state = el[viewableKey];\n\n if (state) {\n state.destroyObserver();\n delete el[viewableKey];\n }\n}\n\nexport default {\n beforeMount: mount,\n updated,\n unmounted: unmount,\n};\n"],"names":["viewableKey","ViewableState","el","options","modifiers","__publicField","result","entry","_a","entries","intersectingEntry","e","nextTick","value","mount","state","updated","oldValue","isEqual","unmount","viewable"],"mappings":";;;;;AAGA,MAAMA,IAAc,OAAO,YAAY;AAIvC,MAAMC,EAAc;AAAA,EAclB,YAAYC,GAAIC,GAASC,IAAY,CAAA,GAAI;AAbjC,IAAAC,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EAAA;AAIA,IAAAA,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EAAA;AAKN,SAAK,KAAKH,GACV,KAAK,YAAYE,GACjB,KAAK,WAAW,MAChB,KAAK,WAAW,MAChB,KAAK,SAAS,IACd,KAAK,UAAU;AAAA,MACb,UAAU,MAAM;AAAA,MAAC;AAAA,MACjB,cAAc,CAAC;AAAA,IAAA,GAEjB,KAAK,eAAeD,CAAO;AAAA,EAC7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAI,YAAY;AACd,WAAO,KAAK,QAAQ,gBAAgB,OAAO,KAAK,QAAQ,aAAa,aAAc,WAC/E,KAAK,QAAQ,aAAa,YAC1B;AAAA,EACN;AAAA,EAEA,IAAI,8BAA8B;AACzB,WAAA;AAAA,MACL,WAAW,KAAK;AAAA,MAChB,GAAG,KAAK,QAAQ;AAAA,IAAA;AAAA,EAEpB;AAAA,EAEA,eAAeA,GAAS;AAKtB,IAJI,KAAK,YACP,KAAK,gBAAgB,GAGnB,MAAK,WAIJ,KAAA,UAAU,KAAK,eAAeA,CAAO,GAErC,KAAA,WAAW,CAACG,GAAQC,MAAU;;AAC5B,WAAA,QAAQ,SAASD,GAAQC,CAAK,GAE/BD,OAAUE,IAAA,KAAK,cAAL,QAAAA,EAAgB,UAC5B,KAAK,SAAS,IACd,KAAK,gBAAgB;AAAA,IACvB,GAGF,KAAK,YAAY,QAEb,0BAA0B,WAC5B,KAAK,WAAW,IAAI,qBAAqB,CAACC,MAAY;AAChD,UAAAF,IAAQE,EAAQ,CAAC;AAEjB,UAAAA,EAAQ,SAAS,GAAG;AACtB,cAAMC,IAAoBD,EAAQ,KAAK,CAACE,MAAMA,EAAE,cAAc;AAE9D,QAAID,MACMH,IAAAG;AAAA
|
|
1
|
+
{"version":3,"file":"viewable.js","sources":["../src/directives/viewable/viewable.ts"],"sourcesContent":["import isEqual from 'lodash-es/isEqual';\nimport { nextTick } from 'vue';\n\nconst viewableKey = Symbol('v-viewable');\n\ntype ViewableCallback = (result: boolean, entry: IntersectionObserverEntry) => void;\n\nclass ViewableState {\n private observer: IntersectionObserver | null;\n private el: Element;\n private frozen: boolean;\n private options: {\n callback: ViewableCallback;\n intersection: IntersectionObserverInit;\n };\n private oldResult: undefined | boolean;\n private callback: ViewableCallback | null;\n private modifiers?: {\n once?: boolean;\n };\n\n constructor(el, options, modifiers = {}) {\n this.el = el;\n this.modifiers = modifiers;\n this.observer = null;\n this.callback = null;\n this.frozen = false;\n this.options = {\n callback: () => {},\n intersection: {},\n };\n this.createObserver(options);\n }\n\n /**\n * Default threshold of 100%.\n * Informs when the element is 100% visibile, or at the provided threshold(s)\n * Does not support an array of values.\n * @see: https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#thresholds\n */\n get threshold() {\n return this.options.intersection && typeof this.options.intersection.threshold === 'number'\n ? this.options.intersection.threshold\n : 1;\n }\n\n get intersectionObserverOptions() {\n return {\n threshold: this.threshold,\n ...this.options.intersection,\n };\n }\n\n createObserver(options) {\n if (this.observer) {\n this.destroyObserver();\n }\n\n if (this.frozen) {\n return;\n }\n\n this.options = this.processOptions(options);\n\n this.callback = (result, entry) => {\n this.options.callback(result, entry);\n\n if (result && this.modifiers?.once) {\n this.frozen = true;\n this.destroyObserver();\n }\n };\n\n this.oldResult = undefined;\n\n if ('IntersectionObserver' in window) {\n this.observer = new IntersectionObserver((entries) => {\n let entry = entries[0];\n\n if (entries.length > 1) {\n const intersectingEntry = entries.find((e) => e.isIntersecting);\n\n if (intersectingEntry) {\n entry = intersectingEntry;\n }\n }\n\n if (this.callback) {\n // Use isIntersecting if possible because browsers can report isIntersecting as true, but intersectionRatio as 0, when something very slowly enters the viewport.\n const result = entry.isIntersecting && entry.intersectionRatio >= this.threshold;\n\n if (result === this.oldResult) {\n return;\n }\n\n this.oldResult = result;\n this.callback(result, entry);\n }\n }, this.intersectionObserverOptions);\n }\n\n // Wait for the element to be in document\n nextTick(() => {\n if (this.observer) {\n this.observer.observe(this.el);\n }\n });\n }\n\n destroyObserver() {\n if (this.observer) {\n this.observer.unobserve(this.el);\n this.observer.disconnect();\n this.observer = null;\n }\n }\n\n private processOptions(value) {\n const options =\n typeof value === 'function'\n ? { callback: value } // Simple options (callback-only)\n : value; // Options object\n\n return options;\n }\n}\n\nfunction mount(el, { modifiers = {}, value }) {\n if (!value) {\n return;\n }\n\n if (value.intersection?.threshold instanceof Array) {\n throw new Error('`threshold` must be a number. v-viewable does not support `threshold` as an array.');\n }\n\n const state = new ViewableState(el, value, modifiers);\n\n el[viewableKey] = state;\n}\n\nfunction updated(el, { modifiers, value, oldValue }) {\n if (isEqual(value, oldValue) || value.toString() === oldValue.toString()) {\n return;\n }\n\n const state = el[viewableKey];\n\n if (!value) {\n unmount(el);\n return;\n }\n\n if (state) {\n state.createObserver(value);\n } else {\n mount(el, { modifiers, value });\n }\n}\n\nfunction unmount(el) {\n const state = el[viewableKey];\n\n if (state) {\n state.destroyObserver();\n delete el[viewableKey];\n }\n}\n\nexport default {\n beforeMount: mount,\n updated,\n unmounted: unmount,\n};\n"],"names":["viewableKey","ViewableState","el","options","modifiers","__publicField","result","entry","_a","entries","intersectingEntry","e","nextTick","value","mount","state","updated","oldValue","isEqual","unmount","viewable"],"mappings":";;;;;AAGA,MAAMA,IAAc,OAAO,YAAY;AAIvC,MAAMC,EAAc;AAAA,EAclB,YAAYC,GAAIC,GAASC,IAAY,CAAA,GAAI;AAbjC,IAAAC,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EAAA;AAIA,IAAAA,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EAAA;AAKN,SAAK,KAAKH,GACV,KAAK,YAAYE,GACjB,KAAK,WAAW,MAChB,KAAK,WAAW,MAChB,KAAK,SAAS,IACd,KAAK,UAAU;AAAA,MACb,UAAU,MAAM;AAAA,MAAC;AAAA,MACjB,cAAc,CAAC;AAAA,IAAA,GAEjB,KAAK,eAAeD,CAAO;AAAA,EAC7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAI,YAAY;AACd,WAAO,KAAK,QAAQ,gBAAgB,OAAO,KAAK,QAAQ,aAAa,aAAc,WAC/E,KAAK,QAAQ,aAAa,YAC1B;AAAA,EACN;AAAA,EAEA,IAAI,8BAA8B;AACzB,WAAA;AAAA,MACL,WAAW,KAAK;AAAA,MAChB,GAAG,KAAK,QAAQ;AAAA,IAAA;AAAA,EAEpB;AAAA,EAEA,eAAeA,GAAS;AAKtB,IAJI,KAAK,YACP,KAAK,gBAAgB,GAGnB,MAAK,WAIJ,KAAA,UAAU,KAAK,eAAeA,CAAO,GAErC,KAAA,WAAW,CAACG,GAAQC,MAAU;;AAC5B,WAAA,QAAQ,SAASD,GAAQC,CAAK,GAE/BD,OAAUE,IAAA,KAAK,cAAL,QAAAA,EAAgB,UAC5B,KAAK,SAAS,IACd,KAAK,gBAAgB;AAAA,IACvB,GAGF,KAAK,YAAY,QAEb,0BAA0B,WAC5B,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AAQjB,CAAE;AACV;AAAA;AAGF,EAAIa,IACFA,EAAM,eAAeF,CAAK,IAE1BC,EAAMZ,GAAI,EAAE,WAAAE,GAAW,OAAAS,EAAO,CAAA;AAElC;AAEA,SAASM,EAAQjB,GAAI;AACb,QAAAa,IAAQb,EAAGF,CAAW;AAE5B,EAAIe,MACFA,EAAM,gBAAgB,GACtB,OAAOb,EAAGF,CAAW;AAEzB;AAEA,MAAeoB,IAAA;AAAA,EACb,aAAaN;AAAA,EACb,SAAAE;AAAA,EACA,WAAWG;AACb;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leaflink/stash",
|
|
3
|
-
"version": "48.10.
|
|
3
|
+
"version": "48.10.1",
|
|
4
4
|
"description": "LeafLink's design system.",
|
|
5
5
|
"homepage": "https://stash.leaflink.com",
|
|
6
6
|
"main": "./dist/index.ts",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"url": "https://github.com/LeafLink/stash/issues"
|
|
58
58
|
},
|
|
59
59
|
"engines": {
|
|
60
|
-
"node": "^22 || ^20
|
|
60
|
+
"node": "^22 || ^20"
|
|
61
61
|
},
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|
|
@@ -71,9 +71,6 @@
|
|
|
71
71
|
"scripts": {
|
|
72
72
|
"build": "npm run build:spritesheet && vite build",
|
|
73
73
|
"build:spritesheet": "svg-sprite --symbol --symbol-dest=assets/ --symbol-sprite=spritesheet.svg --svg-namespace-ids=false assets/icons/*.svg",
|
|
74
|
-
"build:storybook": "npm run build:storybook:spritesheet && npm run build:storybook:illustrations && build-storybook -s .storybook",
|
|
75
|
-
"build:storybook:spritesheet": "svg-sprite --symbol --symbol-dest=.storybook/static --symbol-sprite=spritesheet.svg --svg-namespace-ids=false assets/icons/*.svg",
|
|
76
|
-
"build:storybook:illustrations": "cp -r ./assets/illustrations .storybook/static",
|
|
77
74
|
"build:ts": "vue-tsc --declaration --emitDeclarationOnly --declarationMap",
|
|
78
75
|
"fix": "npm run lint:js-fix && npm run lint:css-fix",
|
|
79
76
|
"lint": "npm run lint:js && npm run lint:css",
|
|
@@ -86,14 +83,13 @@
|
|
|
86
83
|
"test:ci": "vitest run --silent --coverage",
|
|
87
84
|
"test:release": "vitest run --silent",
|
|
88
85
|
"type-check": "vue-tsc --noEmit",
|
|
89
|
-
"storybook": "npm run build:storybook:spritesheet && npm run build:storybook:illustrations && start-storybook -s .storybook -p 9003",
|
|
90
86
|
"docs:illustrations": "cp -r ./assets/illustrations docs/public/",
|
|
91
87
|
"docs:logos": "cp -r ./assets/logos docs/public/",
|
|
92
88
|
"docs:spritesheet": "svg-sprite --symbol --symbol-dest=docs/public/ --symbol-sprite=spritesheet.svg --svg-namespace-ids=false assets/icons/*.svg",
|
|
93
89
|
"docs": "npm run docs:spritesheet && npm run docs:illustrations && npm run docs:logos && vitepress dev docs",
|
|
94
90
|
"docs:build": "npm run docs:spritesheet && npm run docs:illustrations && npm run docs:logos && vitepress build docs",
|
|
95
91
|
"docs:preview": "vitepress preview docs",
|
|
96
|
-
"prepare": "husky
|
|
92
|
+
"prepare": "husky"
|
|
97
93
|
},
|
|
98
94
|
"dependencies": {
|
|
99
95
|
"@floating-ui/vue": "^1.0.2",
|
|
@@ -104,29 +100,19 @@
|
|
|
104
100
|
"dompurify": "^3.1.0",
|
|
105
101
|
"flat": "6.0.1",
|
|
106
102
|
"fuzzysort": "2.0.1",
|
|
107
|
-
"
|
|
108
|
-
"sanitize-html": "2.11.0",
|
|
103
|
+
"sanitize-html": "2.13.0",
|
|
109
104
|
"v-calendar": "^3.1.2",
|
|
110
105
|
"vue": "^3.3.4",
|
|
111
106
|
"vue-currency-input": "^3.0.5",
|
|
112
|
-
"vue-inline-svg": "^3.1.
|
|
107
|
+
"vue-inline-svg": "^3.1.3",
|
|
113
108
|
"vue3-carousel": "0.3.1",
|
|
114
109
|
"vue3-touch-events": "4.1.0"
|
|
115
110
|
},
|
|
116
111
|
"devDependencies": {
|
|
117
|
-
"@babel/core": "^7.
|
|
118
|
-
"@babel/preset-env": "^7.
|
|
119
|
-
"@babel/preset-typescript": "^7.
|
|
112
|
+
"@babel/core": "^7.25.2",
|
|
113
|
+
"@babel/preset-env": "^7.25.3",
|
|
114
|
+
"@babel/preset-typescript": "^7.24.7",
|
|
120
115
|
"@rollup/pluginutils": "^5.0.2",
|
|
121
|
-
"@storybook/addon-a11y": "^6.5.8",
|
|
122
|
-
"@storybook/addon-actions": "^6.5.8",
|
|
123
|
-
"@storybook/addon-controls": "^6.5.8",
|
|
124
|
-
"@storybook/addon-essentials": "^6.5.8",
|
|
125
|
-
"@storybook/addon-links": "^6.5.8",
|
|
126
|
-
"@storybook/builder-vite": "^0.4.2",
|
|
127
|
-
"@storybook/client-api": "^6.5.8",
|
|
128
|
-
"@storybook/client-logger": "^6.5.8",
|
|
129
|
-
"@storybook/vue3": "^6.5.8",
|
|
130
116
|
"@testing-library/jest-dom": "^6.0.1",
|
|
131
117
|
"@testing-library/user-event": "^14.4.3",
|
|
132
118
|
"@testing-library/vue": "^7.0.0",
|
|
@@ -134,41 +120,39 @@
|
|
|
134
120
|
"@types/google.maps": "^3.53.4",
|
|
135
121
|
"@types/lodash-es": "^4.17.6",
|
|
136
122
|
"@types/plaid-link": "^2.0.11",
|
|
137
|
-
"@vitejs/plugin-vue": "
|
|
138
|
-
"@vitejs/plugin-vue-jsx": "^3.0
|
|
139
|
-
"@vitest/coverage-v8": "
|
|
140
|
-
"@vue/babel-plugin-jsx": "^1.
|
|
123
|
+
"@vitejs/plugin-vue": "4.2.3",
|
|
124
|
+
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
|
125
|
+
"@vitest/coverage-v8": "0.34.2",
|
|
126
|
+
"@vue/babel-plugin-jsx": "^1.2.2",
|
|
141
127
|
"@vue/test-utils": "^2.4.1",
|
|
142
|
-
"autoprefixer": "^
|
|
143
|
-
"babel-core": "^7.0.0-bridge.0",
|
|
128
|
+
"autoprefixer": "^10.4.20",
|
|
144
129
|
"doctoc": "^2.2.1",
|
|
145
|
-
"eslint": "^8.
|
|
146
|
-
"eslint-config-leaflink": "^3.
|
|
130
|
+
"eslint": "^8.57.0",
|
|
131
|
+
"eslint-config-leaflink": "^3.4.0",
|
|
147
132
|
"husky": "^9.0.11",
|
|
148
133
|
"jsdom": "^22.1.0",
|
|
149
134
|
"lint-staged": "^15.2.2",
|
|
150
|
-
"
|
|
151
|
-
"postcss
|
|
152
|
-
"postcss-
|
|
153
|
-
"postcss-
|
|
135
|
+
"medium-zoom": "^1.1.0",
|
|
136
|
+
"postcss": "^8.4.41",
|
|
137
|
+
"postcss-html": "^1.7.0",
|
|
138
|
+
"postcss-prefix-selector": "^1.16.1",
|
|
139
|
+
"postcss-preset-env": "^10.0.0",
|
|
154
140
|
"quill": "^2.0.2",
|
|
155
|
-
"rollup-plugin-copy": "^3.
|
|
156
|
-
"
|
|
157
|
-
"stylelint": "^15.10.2",
|
|
141
|
+
"rollup-plugin-copy": "^3.5.0",
|
|
142
|
+
"stylelint": "^15.11.0",
|
|
158
143
|
"stylelint-config-standard-scss": "^10.0.0",
|
|
159
144
|
"stylelint-config-standard-vue": "^1.0.0",
|
|
160
|
-
"svg-sprite": "2.0.
|
|
145
|
+
"svg-sprite": "^2.0.4",
|
|
161
146
|
"tailwindcss": "^3.4.1",
|
|
162
|
-
"typescript": "
|
|
163
|
-
"vite": "
|
|
147
|
+
"typescript": "5.1.6",
|
|
148
|
+
"vite": "4.3.8",
|
|
164
149
|
"vite-plugin-dts": "3.6.4",
|
|
165
150
|
"vite-svg-loader": "^5.1.0",
|
|
166
|
-
"vitepress": "^1.
|
|
167
|
-
"vitest": "
|
|
168
|
-
"vue-docgen-api": "^4.
|
|
169
|
-
"vue-eslint-parser": "^9.
|
|
170
|
-
"vue-tsc": "
|
|
171
|
-
"vuepress": "^1.9.9"
|
|
151
|
+
"vitepress": "^1.3.2",
|
|
152
|
+
"vitest": "0.34.2",
|
|
153
|
+
"vue-docgen-api": "^4.79.2",
|
|
154
|
+
"vue-eslint-parser": "^9.4.3",
|
|
155
|
+
"vue-tsc": "1.8.8"
|
|
172
156
|
},
|
|
173
157
|
"peerDependencies": {
|
|
174
158
|
"lodash-es": "^4.x.x",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-79ce320f.js","sources":["../node_modules/vue-inline-svg/src/index.js"],"sourcesContent":["// peer dep is not installed during test\n// eslint-disable-next-line import/no-unresolved\nimport { h as createElement } from 'vue';\n\n/** @type Record<string, PromiseWithState<Element>> */\nconst cache = {};\n\n/**\n * Remove false attrs\n * @param {Object} attrs\n */\nfunction filterAttrs(attrs) {\n return Object.keys(attrs).reduce((result, key) => {\n if (attrs[key] !== false && attrs[key] !== null && attrs[key] !== undefined) {\n result[key] = attrs[key];\n }\n return result;\n }, {});\n}\n\nconst InlineSvg = {\n name: 'InlineSvg',\n inheritAttrs: false,\n render() {\n if (!this.svgElSource) {\n return null;\n }\n return createElement(\n 'svg',\n Object.assign(\n {},\n // source attrs\n this.getSvgAttrs(this.svgElSource),\n // component attrs and listeners\n filterAttrs(this.$attrs),\n // content\n { innerHTML: this.getSvgContent(this.svgElSource) },\n ),\n );\n },\n props: {\n src: {\n type: String,\n required: true,\n },\n title: {\n type: String,\n },\n transformSource: {\n type: Function,\n default: (svg) => svg,\n },\n keepDuringLoading: {\n type: Boolean,\n default: true,\n },\n },\n emits: ['loaded', 'unloaded', 'error'],\n data() {\n return {\n /** @type SVGElement */\n svgElSource: null,\n };\n },\n watch: {\n src(newValue) {\n // re-generate cached svg (`svgElSource`)\n this.getSource(newValue);\n },\n },\n mounted() {\n // generate `svgElSource`\n this.getSource(this.src);\n },\n methods: {\n getSvgAttrs(svgEl) {\n // copy attrs\n let svgAttrs = {};\n const attrs = svgEl.attributes;\n if (!attrs) {\n return svgAttrs;\n }\n for (let i = attrs.length - 1; i >= 0; i--) {\n svgAttrs[attrs[i].name] = attrs[i].value;\n }\n return svgAttrs;\n },\n getSvgContent(svgEl) {\n svgEl = svgEl.cloneNode(true);\n svgEl = this.transformSource(svgEl);\n if (this.title) {\n setTitle(svgEl, this.title);\n }\n\n // copy inner html\n return svgEl.innerHTML;\n },\n /**\n * Get svgElSource\n * @param {string} src\n */\n getSource(src) {\n // fill cache by src with promise\n if (!cache[src]) {\n // download\n cache[src] = this.download(src);\n }\n // notify svg is unloaded\n if (this.svgElSource && cache[src].getIsPending() && !this.keepDuringLoading) {\n this.svgElSource = null;\n this.$emit('unloaded');\n }\n\n // inline svg when cached promise resolves\n cache[src]\n .then((svg) => {\n this.svgElSource = svg;\n // wait to render\n this.$nextTick(() => {\n // notify\n this.$emit('loaded', this.$el);\n });\n })\n .catch((err) => {\n // notify svg is unloaded\n if (this.svgElSource) {\n this.svgElSource = null;\n this.$emit('unloaded');\n }\n // remove cached rejected promise so next image can try load again\n delete cache[src];\n this.$emit('error', err);\n });\n },\n\n /**\n * Get the contents of the SVG\n * @param {string} url\n * @returns {PromiseWithState<Element>}\n */\n download(url) {\n return makePromiseState(new Promise((resolve, reject) => {\n const request = new XMLHttpRequest();\n request.open('GET', url, true);\n\n request.onload = () => {\n if (request.status >= 200 && request.status < 400) {\n try {\n // Setup a parser to convert the response to text/xml in order for it to be manipulated and changed\n const parser = new DOMParser();\n const result = parser.parseFromString(request.responseText, 'text/xml');\n let svgEl = result.getElementsByTagName('svg')[0];\n if (svgEl) {\n // svgEl = this.transformSource(svgEl);\n resolve(svgEl);\n } else {\n reject(new Error('Loaded file is not valid SVG\"'));\n }\n } catch (e) {\n reject(e);\n }\n } else {\n reject(new Error('Error loading SVG'));\n }\n };\n\n request.onerror = reject;\n request.send();\n }));\n },\n },\n};\n\n/**\n * Create or edit the <title> element of a SVG\n * @param {SVGElement} svg\n * @param {string} title\n */\nfunction setTitle(svg, title) {\n const titleTags = svg.getElementsByTagName('title');\n if (titleTags.length) { // overwrite existing title\n titleTags[0].textContent = title;\n } else { // create a title element if one doesn't already exist\n const titleEl = document.createElementNS('http://www.w3.org/2000/svg', 'title');\n titleEl.textContent = title;\n // svg.prepend(titleEl);\n svg.insertBefore(titleEl, svg.firstChild);\n }\n}\n\n/**\n * @typedef {Promise & object} PromiseWithState\n * @property {function: boolean} getIsPending\n * @template T\n */\n\n/**\n * This function allow you to modify a JS Promise by adding some status properties.\n * @template {any} T\n * @param {Promise<T>|PromiseWithState<T>} promise\n * @return {PromiseWithState<T>}\n */\nfunction makePromiseState(promise) {\n // Don't modify any promise that has been already modified.\n if (promise.getIsPending) return promise;\n\n // Set initial state\n let isPending = true;\n\n // Observe the promise, saving the fulfillment in a closure scope.\n let result = promise.then(\n (v) => {\n isPending = false;\n return v;\n },\n (e) => {\n isPending = false;\n throw e;\n },\n );\n\n result.getIsPending = function getIsPending() { return isPending; };\n return result;\n}\n\nexport default InlineSvg;\n"],"names":["cache","filterAttrs","attrs","result","key","InlineSvg","createElement","svg","newValue","svgEl","svgAttrs","i","setTitle","src","err","url","makePromiseState","resolve","reject","request","e","title","titleTags","titleEl","promise","isPending","v"],"mappings":";AAKA,MAAMA,IAAQ,CAAA;AAMd,SAASC,EAAYC,GAAO;AACxB,SAAO,OAAO,KAAKA,CAAK,EAAE,OAAO,CAACC,GAAQC,OAClCF,EAAME,CAAG,MAAM,MAASF,EAAME,CAAG,MAAM,QAAQF,EAAME,CAAG,MAAM,WAC9DD,EAAOC,CAAG,IAAIF,EAAME,CAAG,IAEpBD,IACR,CAAE,CAAA;AACT;AAEK,MAACE,IAAY;AAAA,EACd,MAAM;AAAA,EACN,cAAc;AAAA,EACd,SAAS;AACL,WAAK,KAAK,cAGHC;AAAAA,MACH;AAAA,MACA,OAAO;AAAA,QACH,CAAE;AAAA;AAAA,QAEF,KAAK,YAAY,KAAK,WAAW;AAAA;AAAA,QAEjCL,EAAY,KAAK,MAAM;AAAA;AAAA,QAEvB,EAAE,WAAW,KAAK,cAAc,KAAK,WAAW,EAAG;AAAA,MACtD;AAAA,IACb,IAbmB;AAAA,EAcd;AAAA,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