@leaflink/stash 50.12.0 → 50.12.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/Accordion.js +14 -14
- package/dist/ActionsDropdown.js +2 -2
- package/dist/AddressSelect.js +2 -2
- package/dist/Alert.js +6 -6
- package/dist/AppNavigationItem.js +8 -8
- package/dist/AppSidebar.js +8 -8
- package/dist/AppTopbar.js +3 -3
- package/dist/Avatar.js +3 -3
- package/dist/Backdrop.js +2 -2
- package/dist/Badge.js +2 -2
- package/dist/Box.js +1 -1
- package/dist/{Box.vue_vue_type_script_setup_true_lang-DgJHq-09.js → Box.vue_vue_type_script_setup_true_lang-rFnvwLVY.js} +3 -3
- package/dist/{Box.vue_vue_type_script_setup_true_lang-DgJHq-09.js.map → Box.vue_vue_type_script_setup_true_lang-rFnvwLVY.js.map} +1 -1
- package/dist/Button.js +3 -3
- package/dist/ButtonGroup.js +4 -4
- package/dist/Card.js +7 -7
- package/dist/CardContent.js +2 -2
- package/dist/CardFooter.js +2 -2
- package/dist/CardHeader.js +4 -4
- package/dist/CardMedia.js +6 -6
- package/dist/Carousel.js +33 -33
- package/dist/Carousel.js.map +1 -1
- package/dist/Checkbox.js +7 -7
- package/dist/ChevronToggle.js +1 -1
- package/dist/{ChevronToggle.vue_vue_type_script_setup_true_lang-DuvluoTi.js → ChevronToggle.vue_vue_type_script_setup_true_lang-Ce_qOXfR.js} +3 -3
- package/dist/{ChevronToggle.vue_vue_type_script_setup_true_lang-DuvluoTi.js.map → ChevronToggle.vue_vue_type_script_setup_true_lang-Ce_qOXfR.js.map} +1 -1
- package/dist/Chip.js +7 -7
- package/dist/ConfirmationCodeInput.js +6 -6
- package/dist/ContextSwitcher.js +1 -1
- package/dist/Copy.js +1 -1
- package/dist/CurrencyInput.js +115 -111
- package/dist/CurrencyInput.js.map +1 -1
- package/dist/DataView.js +3 -3
- package/dist/DataView.keys-aSOnA4AD.js.map +1 -1
- package/dist/DataViewFilters.js +3 -3
- package/dist/DataViewSortButton.js +10 -10
- package/dist/DataViewToolbar.js +1 -1
- package/dist/DatePicker.js +1080 -1037
- package/dist/DatePicker.js.map +1 -1
- package/dist/DescriptionList.js +2 -2
- package/dist/DescriptionListDetail.js +2 -2
- package/dist/DescriptionListGroup.js +2 -2
- package/dist/DescriptionListTerm.js +3 -3
- package/dist/Dialog.js +1 -1
- package/dist/Divider.js +2 -2
- package/dist/Dropdown.js +9 -9
- package/dist/EmptyState.js +2 -2
- package/dist/Expand.js +1 -1
- package/dist/{Expand.vue_vue_type_script_setup_true_lang-D0fSAtHr.js → Expand.vue_vue_type_script_setup_true_lang-CiONJfAp.js} +5 -5
- package/dist/{Expand.vue_vue_type_script_setup_true_lang-D0fSAtHr.js.map → Expand.vue_vue_type_script_setup_true_lang-CiONJfAp.js.map} +1 -1
- package/dist/Field.js +1 -1
- package/dist/{Field.vue_vue_type_script_setup_true_lang-DEizIcDo.js → Field.vue_vue_type_script_setup_true_lang-DRaKs9Lm.js} +6 -6
- package/dist/{Field.vue_vue_type_script_setup_true_lang-DEizIcDo.js.map → Field.vue_vue_type_script_setup_true_lang-DRaKs9Lm.js.map} +1 -1
- package/dist/FileUpload.js +7 -7
- package/dist/FilterChip.js +1 -1
- package/dist/FilterDrawerItem.js +9 -9
- package/dist/FilterDropdown.js +1 -1
- package/dist/FilterSelect.js +4 -4
- package/dist/Filters.js +18 -18
- package/dist/HttpError.js +9 -9
- package/dist/Icon.js +2 -2
- package/dist/IconLabel.js +2 -2
- package/dist/Illustration.js +2 -2
- package/dist/{Illustration.vue_vue_type_script_setup_true_lang-CYddAFtS.js → Illustration.vue_vue_type_script_setup_true_lang-BBqgoJO8.js} +3 -3
- package/dist/{Illustration.vue_vue_type_script_setup_true_lang-CYddAFtS.js.map → Illustration.vue_vue_type_script_setup_true_lang-BBqgoJO8.js.map} +1 -1
- package/dist/Image.js +2 -2
- package/dist/{Image.vue_vue_type_script_setup_true_lang-YUNunj71.js → Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js} +3 -3
- package/dist/{Image.vue_vue_type_script_setup_true_lang-YUNunj71.js.map → Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js.map} +1 -1
- package/dist/InlineEdit.js +5 -5
- package/dist/Input.js +2 -2
- package/dist/InputOptions.js +2 -2
- package/dist/IntegrationIcon.js +2 -2
- package/dist/Label.js +1 -1
- package/dist/{Label.vue_vue_type_script_setup_true_lang-C4JKdqvC.js → Label.vue_vue_type_script_setup_true_lang-DPnNUfc6.js} +3 -3
- package/dist/{Label.vue_vue_type_script_setup_true_lang-C4JKdqvC.js.map → Label.vue_vue_type_script_setup_true_lang-DPnNUfc6.js.map} +1 -1
- package/dist/LicenseChip.js +2 -2
- package/dist/ListItem.js +1 -1
- package/dist/ListItemCell.js +2 -2
- package/dist/ListView.js +11 -11
- package/dist/Loading.js +2 -2
- package/dist/Logo.js +1 -1
- package/dist/{Logo.vue_vue_type_script_setup_true_lang-BfUU9J9O.js → Logo.vue_vue_type_script_setup_true_lang-Dz8c98sc.js} +4 -4
- package/dist/{Logo.vue_vue_type_script_setup_true_lang-BfUU9J9O.js.map → Logo.vue_vue_type_script_setup_true_lang-Dz8c98sc.js.map} +1 -1
- package/dist/Menu.js +2 -2
- package/dist/MenuItem.js +2 -2
- package/dist/Metric.js +5 -5
- package/dist/Modal.js +20 -20
- package/dist/Modals.js +6 -6
- package/dist/Module.js +3 -3
- package/dist/ModuleContent.js +3 -3
- package/dist/ModuleFooter.js +2 -2
- package/dist/ModuleHeader.js +2 -2
- package/dist/ModuleHeader.js.map +1 -1
- package/dist/ObfuscateText.js +7 -7
- package/dist/PageContent.js +3 -3
- package/dist/PageHeader.js +6 -6
- package/dist/PageNavigation.js +1 -1
- package/dist/Paginate.js +6 -6
- package/dist/PlaidLink.js +2 -2
- package/dist/QuickAction.js +2 -2
- package/dist/Radio.js +2 -2
- package/dist/RadioGroup.js +2 -2
- package/dist/RadioNew.js +1 -1
- package/dist/RangeInput.js +2 -2
- package/dist/SearchBar.js +3 -3
- package/dist/Select.js +4 -4
- package/dist/Select.js.map +1 -1
- package/dist/SelectStatus.js +7 -7
- package/dist/Skeleton.js +4 -4
- package/dist/Step.js +6 -6
- package/dist/Stepper.js +9 -9
- package/dist/Switch.js +7 -7
- package/dist/Tab.js +4 -4
- package/dist/TabPanel.js +2 -2
- package/dist/Table.js +1 -1
- package/dist/TableCell.js +5 -5
- package/dist/TableHeaderCell.js +2 -2
- package/dist/TableHeaderRow.js +4 -4
- package/dist/TableRow.js +4 -4
- package/dist/TableRow.js.map +1 -1
- package/dist/TableRow.vue.d.ts +12 -8
- package/dist/Tabs.js +2 -2
- package/dist/{Tabs.vue_vue_type_script_setup_true_lang-NZm1OrRT.js → Tabs.vue_vue_type_script_setup_true_lang-CmnBP4i1.js} +4 -4
- package/dist/{Tabs.vue_vue_type_script_setup_true_lang-NZm1OrRT.js.map → Tabs.vue_vue_type_script_setup_true_lang-CmnBP4i1.js.map} +1 -1
- package/dist/TextEditor.js +3313 -3291
- package/dist/TextEditor.js.map +1 -1
- package/dist/Textarea.js +3 -3
- package/dist/Thumbnail.js +7 -7
- package/dist/Thumbnail.js.map +1 -1
- package/dist/ThumbnailEmpty.js +3 -3
- package/dist/ThumbnailGroup.js +6 -6
- package/dist/ThumbnailGroup.js.map +1 -1
- package/dist/{ThumbnailGroup.keys-D6WL5xQ5.js → ThumbnailGroup.keys-EJ4qFNhx.js} +2 -2
- package/dist/{ThumbnailGroup.keys-D6WL5xQ5.js.map → ThumbnailGroup.keys-EJ4qFNhx.js.map} +1 -1
- package/dist/Timeline.js +2 -2
- package/dist/TimelineItem.js +3 -3
- package/dist/Toast.js +277 -280
- package/dist/Toast.js.map +1 -1
- package/dist/Toasts.js +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/components.css +1 -1
- package/dist/{formatDateTime-C8CYECpd.js → formatDateTime-Dz8bXV0R.js} +98 -12
- package/dist/{formatDateTime-C8CYECpd.js.map → formatDateTime-Dz8bXV0R.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/searchFuzzy-DRasJ33G.js +409 -0
- package/dist/{searchFuzzy-DKooyZM8.js.map → searchFuzzy-DRasJ33G.js.map} +1 -1
- package/dist/storage.js +3 -3
- package/dist/{toTimeZone-CVE1ZmsS.js → toTimeZone-Coq1oPTt.js} +7 -9
- package/dist/{toTimeZone-CVE1ZmsS.js.map → toTimeZone-Coq1oPTt.js.map} +1 -1
- package/dist/useSearch.js +1 -1
- package/dist/utils/formatDateTime.js +2 -2
- package/dist/utils/searchFuzzy.js +1 -1
- package/dist/utils/toTimeZone.js +1 -1
- package/package.json +16 -16
- package/dist/searchFuzzy-DKooyZM8.js +0 -407
package/dist/IconLabel.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as a, computed as o,
|
|
1
|
+
import { defineComponent as a, computed as o, createBlock as c, openBlock as i, resolveDynamicComponent as f, mergeProps as u, withCtx as d, createVNode as m, createElementVNode as p, normalizeClass as s, renderSlot as w } from "vue";
|
|
2
2
|
import _ from "./Icon.js";
|
|
3
3
|
import { _ as v } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
const h = /* @__PURE__ */ a({
|
|
@@ -18,7 +18,7 @@ const h = /* @__PURE__ */ a({
|
|
|
18
18
|
} : e.href ? {
|
|
19
19
|
href: e.href
|
|
20
20
|
} : {});
|
|
21
|
-
return (t, b) => (
|
|
21
|
+
return (t, b) => (i(), c(f(r.value), u(l.value, {
|
|
22
22
|
class: ["tw-flex", { "tw-flex-col tw-items-center": e.stacked }]
|
|
23
23
|
}), {
|
|
24
24
|
default: d(() => [
|
package/dist/Illustration.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as s } from "./Illustration.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import { I as m, S as o, V as p, s as r, v as i } from "./Illustration.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { _ as s } from "./Illustration.vue_vue_type_script_setup_true_lang-BBqgoJO8.js";
|
|
2
|
+
import { I as m, S as o, V as p, s as r, v as i } from "./Illustration.vue_vue_type_script_setup_true_lang-BBqgoJO8.js";
|
|
3
3
|
export {
|
|
4
4
|
m as IllustrationType,
|
|
5
5
|
o as SpotName,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as d, inject as u, computed as c,
|
|
1
|
+
import { defineComponent as d, inject as u, computed as c, createBlock as h, openBlock as y, unref as k, normalizeClass as f } from "vue";
|
|
2
2
|
import v from "lodash-es/uniqueId";
|
|
3
3
|
import { I as b } from "./index-D6bxWkZ1.js";
|
|
4
4
|
var l = /* @__PURE__ */ ((r) => (r.Approved = "approved", r.Avatar = "avatar", r.Barcode = "barcode", r.Calendar = "calendar", r.Cartridge = "cartridge", r.Celebrate = "celebrate", r.ChatBubble = "chat-bubble", r.CheckBox = "check-box", r.CheckCircle = "check-circle", r.Click = "click", r.Cocktail = "cocktail", r.Confirmation = "confirmation", r.Connnect = "connnect", r.Cookie = "cookie", r.CreditCard = "credit-card", r.Crm = "crm", r.Cultivation = "cultivation", r.Data = "data", r.DeliveryCompleted = "delivery-completed", r.Delivery = "delivery", r.DigitalPayments = "digital-payments", r.Discover = "discover", r.Diversity = "diversity", r.Drink = "drink", r.Dolly = "dolly", r.EasyReconciliations = "easy-reconciliations", r.Efficiency = "efficiency", r.Error = "error", r.ExtendDate = "extend-date", r.FinancialGrowth = "financial-growth", r.FinancialInstitution = "financial-institution", r.Focus = "focus", r.FulfillmentIssues = "fulfillment-issues", r.Growth = "growth", r.Handshake = "handshake", r.Hierarchy = "hierarchy", r.Home = "home", r.Laptop = "laptop", r.Licenses = "licenses", r.LightBulb = "light-bulb", r.LightbulbError = "lightbulb-error", r.LineChart = "line-chart", r.Link = "link", r.LocationPin = "location-pin", r.Lock = "lock", r.Messaging = "messaging", r.Messages = "messages", r.Microchip = "microchip", r.MissingData = "missing-data", r.MoneyTransfer = "money-transfer", r.Money = "money", r.NoInventoryAccess = "no-inventory-access", r.NoInventory = "no-inventory", r.NoPromote = "no-promote", r.PackageReceived = "package-received", r.Package = "package", r.PaymentProcessing = "payment-processing", r.Phone = "phone", r.PieChart = "pie-chart", r.ProductCycle = "product-cycle", r.Puzzle = "puzzle", r.Receipt = "receipt", r.Retail = "retail", r.SearchingDocument = "searching-document", r.ShoppingBasket = "shopping-basket", r.Shopping = "shopping", r.Sign = "sign", r.Smile = "smile", r.Speed = "speed", r.Time = "time", r.Tools = "tools", r.Truck = "truck", r.User = "user", r.Warehouse = "warehouse", r.Warning = "warning", r.XCircle = "x-circle", r))(l || {});
|
|
@@ -31,7 +31,7 @@ const I = /* @__PURE__ */ d({
|
|
|
31
31
|
const n = u("stashOptions", {
|
|
32
32
|
staticPath: "/static"
|
|
33
33
|
}), e = c(() => i.type === s.Spot), t = c(() => e.value ? "0" : !1), a = c(() => i.staticPath || (n == null ? void 0 : n.staticPath));
|
|
34
|
-
return (w, P) => (
|
|
34
|
+
return (w, P) => (y(), h(k(b), {
|
|
35
35
|
id: i.id,
|
|
36
36
|
class: f(["tw-inline-block tw-align-middle", {
|
|
37
37
|
[`tw-text-${i.fillColor}-400 tw-stroke-${i.strokeColor}`]: e.value
|
|
@@ -53,4 +53,4 @@ export {
|
|
|
53
53
|
C as s,
|
|
54
54
|
g as v
|
|
55
55
|
};
|
|
56
|
-
//# sourceMappingURL=Illustration.vue_vue_type_script_setup_true_lang-
|
|
56
|
+
//# sourceMappingURL=Illustration.vue_vue_type_script_setup_true_lang-BBqgoJO8.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Illustration.vue_vue_type_script_setup_true_lang-CYddAFtS.js","sources":["../src/components/Illustration/Illustration.models.ts","../src/components/Illustration/Illustration.vue"],"sourcesContent":["/**\n * Enum to strongly map between a friendly name and file name of the illustration\n */\nexport enum SpotName {\n Approved = 'approved',\n Avatar = 'avatar',\n Barcode = 'barcode',\n Calendar = 'calendar',\n Cartridge = 'cartridge',\n Celebrate = 'celebrate',\n ChatBubble = 'chat-bubble',\n CheckBox = 'check-box',\n CheckCircle = 'check-circle',\n Click = 'click',\n Cocktail = 'cocktail',\n Confirmation = 'confirmation',\n Connnect = 'connnect',\n Cookie = 'cookie',\n CreditCard = 'credit-card',\n Crm = 'crm',\n Cultivation = 'cultivation',\n Data = 'data',\n DeliveryCompleted = 'delivery-completed',\n Delivery = 'delivery',\n DigitalPayments = 'digital-payments',\n Discover = 'discover',\n Diversity = 'diversity',\n Drink = 'drink',\n Dolly = 'dolly',\n EasyReconciliations = 'easy-reconciliations',\n Efficiency = 'efficiency',\n Error = 'error',\n ExtendDate = 'extend-date',\n FinancialGrowth = 'financial-growth',\n FinancialInstitution = 'financial-institution',\n Focus = 'focus',\n FulfillmentIssues = 'fulfillment-issues',\n Growth = 'growth',\n Handshake = 'handshake',\n Hierarchy = 'hierarchy',\n Home = 'home',\n Laptop = 'laptop',\n Licenses = 'licenses',\n LightBulb = 'light-bulb',\n LightbulbError = 'lightbulb-error',\n LineChart = 'line-chart',\n Link = 'link',\n LocationPin = 'location-pin',\n Lock = 'lock',\n Messaging = 'messaging',\n Messages = 'messages',\n Microchip = 'microchip',\n MissingData = 'missing-data',\n MoneyTransfer = 'money-transfer',\n Money = 'money',\n NoInventoryAccess = 'no-inventory-access',\n NoInventory = 'no-inventory',\n NoPromote = 'no-promote',\n PackageReceived = 'package-received',\n Package = 'package',\n PaymentProcessing = 'payment-processing',\n Phone = 'phone',\n PieChart = 'pie-chart',\n ProductCycle = 'product-cycle',\n Puzzle = 'puzzle',\n Receipt = 'receipt',\n Retail = 'retail',\n SearchingDocument = 'searching-document',\n ShoppingBasket = 'shopping-basket',\n Shopping = 'shopping',\n Sign = 'sign',\n Smile = 'smile',\n Speed = 'speed',\n Time = 'time',\n Tools = 'tools',\n Truck = 'truck',\n User = 'user',\n Warehouse = 'warehouse',\n Warning = 'warning',\n XCircle = 'x-circle',\n}\n\nexport type SpotNames = `${SpotName}`;\n\n/**\n * String array of all illustration names\n */\nexport const spotNames = Object.values(SpotName);\n\nexport enum VignetteName {\n Api = 'api',\n Bank = 'bank',\n Basket = 'basket',\n BrandMenu = 'brand-menu',\n Calendar = 'calendar',\n Dashboard = 'dashboard',\n Deals = 'deals',\n DocumentSearch = 'document-search',\n Edit = 'edit',\n EmptyTray = 'empty-tray',\n Graph = 'graph',\n Integrations = 'integrations',\n LightBulb = 'light-bulb',\n Map = 'map',\n Megaphone = 'megaphone',\n Messages = 'messages',\n MoneyBank = 'money-bank',\n Notifications = 'notifications',\n OrdersEmpty = 'orders-empty',\n Payments = 'payments',\n PieChart = 'pie-chart',\n ProductCards = 'product-cards',\n ProductDisplay = 'product-display',\n Search = 'search',\n SearchStorefront = 'search-storefront',\n Store = 'store',\n Todo = 'todo',\n Truck = 'truck',\n Users = 'users',\n Warehouse = 'warehouse',\n WarehouseDelivery = 'warehouse-delivery',\n}\n\nexport type VignetteNames = `${VignetteName}`;\n\n/**\n * String array of all vignette names\n */\nexport const vignetteNames = Object.values(VignetteName);\n\n/**\n * Types of illustrations that map to the subfolder under ./assets/illustrations/<type>\n */\nexport enum IllustrationType {\n Spot = 'spot',\n Vignette = 'vignette',\n // Scene is not implemented, but adding it for future work mentioned in STASH-61.\n Scene = 'scene',\n}\n\nexport type IllustrationTypes = `${IllustrationType}`;\n","<script lang=\"ts\">\n export * from './Illustration.models';\n</script>\n\n<script lang=\"ts\" setup>\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, inject } from 'vue';\n import InlineSvg from 'vue-inline-svg';\n\n import { StashPrimaryColor, StashPrimaryColorGroup } from '../../../types/colors';\n import { StashProvideState } from '../../../types/misc';\n import {\n IllustrationType,\n IllustrationTypes,\n SpotName,\n SpotNames,\n spotNames,\n VignetteName,\n VignetteNames,\n vignetteNames,\n } from './Illustration.models';\n\n export interface IllustrationProps {\n id?: string;\n\n /**\n * The filename of the icon that should be displayed\n */\n name: SpotNames | VignetteNames;\n\n /**\n * Accessible, short-text description for the icon. Not rendered as part of the graphic, but\n * browsers usually display it as a tooltip and screen readers use this.\n */\n title?: string;\n\n /**\n * The size in pixels of the illustration. This number will be used for width and height\n */\n size?: number;\n\n /**\n * Type of the illustration\n */\n type?: IllustrationTypes;\n\n /**\n * The fill color for the illustration. This component will use the 400 shade of the color\n * per design's request. Defaults to teal.\n */\n fillColor?: StashPrimaryColorGroup;\n\n /**\n * The color theme for the illustration. This component will use the standard 500 shade of the color.\n * Defaults to purple\n */\n strokeColor?: StashPrimaryColor;\n\n /**\n * Illustration's custom static path. It'll default to either the staticPath defined on the library installation or '/static' if none are provided.\n */\n staticPath?: string;\n }\n\n const props = withDefaults(defineProps<IllustrationProps>(), {\n id: uniqueId('ll-illustration-'),\n title: '',\n size: 48,\n type: IllustrationType.Spot,\n fillColor: 'blue',\n strokeColor: 'purple-500',\n staticPath: '',\n });\n\n if (props.type === IllustrationType.Scene) {\n throw new Error(\n 'Scene illustration types are not supported. Illustrations will need to be uploaded under ./assets/illustrations/scene. Illustrations to be provided by design.',\n );\n }\n\n if (\n (props.type === IllustrationType.Spot && !spotNames.includes(props.name as SpotName)) ||\n (props.type === IllustrationType.Vignette && !vignetteNames.includes(props.name as VignetteName))\n ) {\n throw new Error(\n `${props.type} illustration name ${props.name} not found. Did you check that you are using the correct type for your illustration?`,\n );\n }\n\n const stashOptions = inject<Partial<StashProvideState>>('stashOptions', {\n staticPath: '/static',\n });\n\n const isSpotIllustration = computed(() => props.type === IllustrationType.Spot);\n\n /**\n * Browsers won't add the `stroke-width` attribute if it is set to false.\n * However, setting it to specific number value affects vignettes\n */\n const strokeWidth = computed<boolean | string>(() => {\n return isSpotIllustration.value ? '0' : false;\n });\n\n const computedStaticPath = computed(() => {\n return props.staticPath || stashOptions?.staticPath;\n });\n</script>\n\n<template>\n <!-- InlineSvg package (https://github.com/shrpne/vue-inline-svg) swaps external svgs and puts\n them inline so we can style them with CSS -->\n <!-- Having to override fill to be none and stroke to be zero so the exported svgs from Figma\n that do not have those attributes specified do not get a default one applied -->\n <InlineSvg\n :id=\"props.id\"\n class=\"tw-inline-block tw-align-middle\"\n :class=\"{\n [`tw-text-${props.fillColor}-400 tw-stroke-${props.strokeColor}`]: isSpotIllustration,\n }\"\n :title=\"props.title\"\n :height=\"props.size\"\n :width=\"props.size\"\n :stroke-width=\"strokeWidth\"\n fill=\"none\"\n :src=\"`${computedStaticPath}/illustrations/${props.type}/${props.name}.svg`\"\n />\n</template>\n"],"names":["SpotName","spotNames","VignetteName","vignetteNames","IllustrationType","props","__props","stashOptions","inject","isSpotIllustration","computed","strokeWidth","computedStaticPath"],"mappings":";;;AAGY,IAAAA,sBAAAA,OACVA,EAAA,WAAW,YACXA,EAAA,SAAS,UACTA,EAAA,UAAU,WACVA,EAAA,WAAW,YACXA,EAAA,YAAY,aACZA,EAAA,YAAY,aACZA,EAAA,aAAa,eACbA,EAAA,WAAW,aACXA,EAAA,cAAc,gBACdA,EAAA,QAAQ,SACRA,EAAA,WAAW,YACXA,EAAA,eAAe,gBACfA,EAAA,WAAW,YACXA,EAAA,SAAS,UACTA,EAAA,aAAa,eACbA,EAAA,MAAM,OACNA,EAAA,cAAc,eACdA,EAAA,OAAO,QACPA,EAAA,oBAAoB,sBACpBA,EAAA,WAAW,YACXA,EAAA,kBAAkB,oBAClBA,EAAA,WAAW,YACXA,EAAA,YAAY,aACZA,EAAA,QAAQ,SACRA,EAAA,QAAQ,SACRA,EAAA,sBAAsB,wBACtBA,EAAA,aAAa,cACbA,EAAA,QAAQ,SACRA,EAAA,aAAa,eACbA,EAAA,kBAAkB,oBAClBA,EAAA,uBAAuB,yBACvBA,EAAA,QAAQ,SACRA,EAAA,oBAAoB,sBACpBA,EAAA,SAAS,UACTA,EAAA,YAAY,aACZA,EAAA,YAAY,aACZA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,WAAW,YACXA,EAAA,YAAY,cACZA,EAAA,iBAAiB,mBACjBA,EAAA,YAAY,cACZA,EAAA,OAAO,QACPA,EAAA,cAAc,gB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,EAAA,QAAQ,SACRA,EAAA,QAAQ,SACRA,EAAA,YAAY,aACZA,EAAA,oBAAoB,sBA/BVA,IAAAA,KAAA,CAAA,CAAA;AAuCC,MAAAC,IAAgB,OAAO,OAAOD,CAAY;AAK3C,IAAAE,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,WAAW,YAEXA,EAAA,QAAQ,SAJEA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;ACrEV,UAAMC,IAAQC;AAUV,QAAAD,EAAM,SAASD,EAAiB;AAClC,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAGF,QACGC,EAAM,SAASD,EAAiB,QAAQ,CAACH,EAAU,SAASI,EAAM,IAAgB,KAClFA,EAAM,SAASD,EAAiB,YAAY,CAACD,EAAc,SAASE,EAAM,IAAoB;AAE/F,YAAM,IAAI;AAAA,QACR,GAAGA,EAAM,IAAI,sBAAsBA,EAAM,IAAI;AAAA,MAC/C;AAGI,UAAAE,IAAeC,EAAmC,gBAAgB;AAAA,MACtE,YAAY;AAAA,IAAA,CACb,GAEKC,IAAqBC,EAAS,MAAML,EAAM,SAASD,EAAiB,IAAI,GAMxEO,IAAcD,EAA2B,MACtCD,EAAmB,QAAQ,MAAM,EACzC,GAEKG,IAAqBF,EAAS,MAC3BL,EAAM,eAAcE,KAAA,gBAAAA,EAAc,WAC1C;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Illustration.vue_vue_type_script_setup_true_lang-BBqgoJO8.js","sources":["../src/components/Illustration/Illustration.models.ts","../src/components/Illustration/Illustration.vue"],"sourcesContent":["/**\n * Enum to strongly map between a friendly name and file name of the illustration\n */\nexport enum SpotName {\n Approved = 'approved',\n Avatar = 'avatar',\n Barcode = 'barcode',\n Calendar = 'calendar',\n Cartridge = 'cartridge',\n Celebrate = 'celebrate',\n ChatBubble = 'chat-bubble',\n CheckBox = 'check-box',\n CheckCircle = 'check-circle',\n Click = 'click',\n Cocktail = 'cocktail',\n Confirmation = 'confirmation',\n Connnect = 'connnect',\n Cookie = 'cookie',\n CreditCard = 'credit-card',\n Crm = 'crm',\n Cultivation = 'cultivation',\n Data = 'data',\n DeliveryCompleted = 'delivery-completed',\n Delivery = 'delivery',\n DigitalPayments = 'digital-payments',\n Discover = 'discover',\n Diversity = 'diversity',\n Drink = 'drink',\n Dolly = 'dolly',\n EasyReconciliations = 'easy-reconciliations',\n Efficiency = 'efficiency',\n Error = 'error',\n ExtendDate = 'extend-date',\n FinancialGrowth = 'financial-growth',\n FinancialInstitution = 'financial-institution',\n Focus = 'focus',\n FulfillmentIssues = 'fulfillment-issues',\n Growth = 'growth',\n Handshake = 'handshake',\n Hierarchy = 'hierarchy',\n Home = 'home',\n Laptop = 'laptop',\n Licenses = 'licenses',\n LightBulb = 'light-bulb',\n LightbulbError = 'lightbulb-error',\n LineChart = 'line-chart',\n Link = 'link',\n LocationPin = 'location-pin',\n Lock = 'lock',\n Messaging = 'messaging',\n Messages = 'messages',\n Microchip = 'microchip',\n MissingData = 'missing-data',\n MoneyTransfer = 'money-transfer',\n Money = 'money',\n NoInventoryAccess = 'no-inventory-access',\n NoInventory = 'no-inventory',\n NoPromote = 'no-promote',\n PackageReceived = 'package-received',\n Package = 'package',\n PaymentProcessing = 'payment-processing',\n Phone = 'phone',\n PieChart = 'pie-chart',\n ProductCycle = 'product-cycle',\n Puzzle = 'puzzle',\n Receipt = 'receipt',\n Retail = 'retail',\n SearchingDocument = 'searching-document',\n ShoppingBasket = 'shopping-basket',\n Shopping = 'shopping',\n Sign = 'sign',\n Smile = 'smile',\n Speed = 'speed',\n Time = 'time',\n Tools = 'tools',\n Truck = 'truck',\n User = 'user',\n Warehouse = 'warehouse',\n Warning = 'warning',\n XCircle = 'x-circle',\n}\n\nexport type SpotNames = `${SpotName}`;\n\n/**\n * String array of all illustration names\n */\nexport const spotNames = Object.values(SpotName);\n\nexport enum VignetteName {\n Api = 'api',\n Bank = 'bank',\n Basket = 'basket',\n BrandMenu = 'brand-menu',\n Calendar = 'calendar',\n Dashboard = 'dashboard',\n Deals = 'deals',\n DocumentSearch = 'document-search',\n Edit = 'edit',\n EmptyTray = 'empty-tray',\n Graph = 'graph',\n Integrations = 'integrations',\n LightBulb = 'light-bulb',\n Map = 'map',\n Megaphone = 'megaphone',\n Messages = 'messages',\n MoneyBank = 'money-bank',\n Notifications = 'notifications',\n OrdersEmpty = 'orders-empty',\n Payments = 'payments',\n PieChart = 'pie-chart',\n ProductCards = 'product-cards',\n ProductDisplay = 'product-display',\n Search = 'search',\n SearchStorefront = 'search-storefront',\n Store = 'store',\n Todo = 'todo',\n Truck = 'truck',\n Users = 'users',\n Warehouse = 'warehouse',\n WarehouseDelivery = 'warehouse-delivery',\n}\n\nexport type VignetteNames = `${VignetteName}`;\n\n/**\n * String array of all vignette names\n */\nexport const vignetteNames = Object.values(VignetteName);\n\n/**\n * Types of illustrations that map to the subfolder under ./assets/illustrations/<type>\n */\nexport enum IllustrationType {\n Spot = 'spot',\n Vignette = 'vignette',\n // Scene is not implemented, but adding it for future work mentioned in STASH-61.\n Scene = 'scene',\n}\n\nexport type IllustrationTypes = `${IllustrationType}`;\n","<script lang=\"ts\">\n export * from './Illustration.models';\n</script>\n\n<script lang=\"ts\" setup>\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, inject } from 'vue';\n import InlineSvg from 'vue-inline-svg';\n\n import { StashPrimaryColor, StashPrimaryColorGroup } from '../../../types/colors';\n import { StashProvideState } from '../../../types/misc';\n import {\n IllustrationType,\n IllustrationTypes,\n SpotName,\n SpotNames,\n spotNames,\n VignetteName,\n VignetteNames,\n vignetteNames,\n } from './Illustration.models';\n\n export interface IllustrationProps {\n id?: string;\n\n /**\n * The filename of the icon that should be displayed\n */\n name: SpotNames | VignetteNames;\n\n /**\n * Accessible, short-text description for the icon. Not rendered as part of the graphic, but\n * browsers usually display it as a tooltip and screen readers use this.\n */\n title?: string;\n\n /**\n * The size in pixels of the illustration. This number will be used for width and height\n */\n size?: number;\n\n /**\n * Type of the illustration\n */\n type?: IllustrationTypes;\n\n /**\n * The fill color for the illustration. This component will use the 400 shade of the color\n * per design's request. Defaults to teal.\n */\n fillColor?: StashPrimaryColorGroup;\n\n /**\n * The color theme for the illustration. This component will use the standard 500 shade of the color.\n * Defaults to purple\n */\n strokeColor?: StashPrimaryColor;\n\n /**\n * Illustration's custom static path. It'll default to either the staticPath defined on the library installation or '/static' if none are provided.\n */\n staticPath?: string;\n }\n\n const props = withDefaults(defineProps<IllustrationProps>(), {\n id: uniqueId('ll-illustration-'),\n title: '',\n size: 48,\n type: IllustrationType.Spot,\n fillColor: 'blue',\n strokeColor: 'purple-500',\n staticPath: '',\n });\n\n if (props.type === IllustrationType.Scene) {\n throw new Error(\n 'Scene illustration types are not supported. Illustrations will need to be uploaded under ./assets/illustrations/scene. Illustrations to be provided by design.',\n );\n }\n\n if (\n (props.type === IllustrationType.Spot && !spotNames.includes(props.name as SpotName)) ||\n (props.type === IllustrationType.Vignette && !vignetteNames.includes(props.name as VignetteName))\n ) {\n throw new Error(\n `${props.type} illustration name ${props.name} not found. Did you check that you are using the correct type for your illustration?`,\n );\n }\n\n const stashOptions = inject<Partial<StashProvideState>>('stashOptions', {\n staticPath: '/static',\n });\n\n const isSpotIllustration = computed(() => props.type === IllustrationType.Spot);\n\n /**\n * Browsers won't add the `stroke-width` attribute if it is set to false.\n * However, setting it to specific number value affects vignettes\n */\n const strokeWidth = computed<boolean | string>(() => {\n return isSpotIllustration.value ? '0' : false;\n });\n\n const computedStaticPath = computed(() => {\n return props.staticPath || stashOptions?.staticPath;\n });\n</script>\n\n<template>\n <!-- InlineSvg package (https://github.com/shrpne/vue-inline-svg) swaps external svgs and puts\n them inline so we can style them with CSS -->\n <!-- Having to override fill to be none and stroke to be zero so the exported svgs from Figma\n that do not have those attributes specified do not get a default one applied -->\n <InlineSvg\n :id=\"props.id\"\n class=\"tw-inline-block tw-align-middle\"\n :class=\"{\n [`tw-text-${props.fillColor}-400 tw-stroke-${props.strokeColor}`]: isSpotIllustration,\n }\"\n :title=\"props.title\"\n :height=\"props.size\"\n :width=\"props.size\"\n :stroke-width=\"strokeWidth\"\n fill=\"none\"\n :src=\"`${computedStaticPath}/illustrations/${props.type}/${props.name}.svg`\"\n />\n</template>\n"],"names":["SpotName","spotNames","VignetteName","vignetteNames","IllustrationType","props","__props","stashOptions","inject","isSpotIllustration","computed","strokeWidth","computedStaticPath"],"mappings":";;;AAGY,IAAAA,sBAAAA,OACVA,EAAA,WAAW,YACXA,EAAA,SAAS,UACTA,EAAA,UAAU,WACVA,EAAA,WAAW,YACXA,EAAA,YAAY,aACZA,EAAA,YAAY,aACZA,EAAA,aAAa,eACbA,EAAA,WAAW,aACXA,EAAA,cAAc,gBACdA,EAAA,QAAQ,SACRA,EAAA,WAAW,YACXA,EAAA,eAAe,gBACfA,EAAA,WAAW,YACXA,EAAA,SAAS,UACTA,EAAA,aAAa,eACbA,EAAA,MAAM,OACNA,EAAA,cAAc,eACdA,EAAA,OAAO,QACPA,EAAA,oBAAoB,sBACpBA,EAAA,WAAW,YACXA,EAAA,kBAAkB,oBAClBA,EAAA,WAAW,YACXA,EAAA,YAAY,aACZA,EAAA,QAAQ,SACRA,EAAA,QAAQ,SACRA,EAAA,sBAAsB,wBACtBA,EAAA,aAAa,cACbA,EAAA,QAAQ,SACRA,EAAA,aAAa,eACbA,EAAA,kBAAkB,oBAClBA,EAAA,uBAAuB,yBACvBA,EAAA,QAAQ,SACRA,EAAA,oBAAoB,sBACpBA,EAAA,SAAS,UACTA,EAAA,YAAY,aACZA,EAAA,YAAY,aACZA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,WAAW,YACXA,EAAA,YAAY,cACZA,EAAA,iBAAiB,mBACjBA,EAAA,YAAY,cACZA,EAAA,OAAO,QACPA,EAAA,cAAc,gBACdA,EAAA,OAAO,QACPA,EAAA,YAAY,aACZA,EAAA,WAAW,YACXA,EAAA,YAAY,aACZA,EAAA,cAAc,gBACdA,EAAA,gBAAgB,kBA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MAAAC,IAAgB,OAAO,OAAOD,CAAY;AAK3C,IAAAE,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,WAAW,YAEXA,EAAA,QAAQ,SAJEA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;ACrEV,UAAMC,IAAQC;AAUV,QAAAD,EAAM,SAASD,EAAiB;AAClC,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAGF,QACGC,EAAM,SAASD,EAAiB,QAAQ,CAACH,EAAU,SAASI,EAAM,IAAgB,KAClFA,EAAM,SAASD,EAAiB,YAAY,CAACD,EAAc,SAASE,EAAM,IAAoB;AAE/F,YAAM,IAAI;AAAA,QACR,GAAGA,EAAM,IAAI,sBAAsBA,EAAM,IAAI;AAAA,MAC/C;AAGI,UAAAE,IAAeC,EAAmC,gBAAgB;AAAA,MACtE,YAAY;AAAA,IAAA,CACb,GAEKC,IAAqBC,EAAS,MAAML,EAAM,SAASD,EAAiB,IAAI,GAMxEO,IAAcD,EAA2B,MACtCD,EAAmB,QAAQ,MAAM,EACzC,GAEKG,IAAqBF,EAAS,MAC3BL,EAAM,eAAcE,KAAA,gBAAAA,EAAc,WAC1C;;;;;;;;;;;;;;;"}
|
package/dist/Image.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as s } from "./Image.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import { a as m, I as o, S as f } from "./Image.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { _ as s } from "./Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js";
|
|
2
|
+
import { a as m, I as o, S as f } from "./Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js";
|
|
3
3
|
export {
|
|
4
4
|
m as ImageProviders,
|
|
5
5
|
o as ImageRadius,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as W, inject as C, computed as a, useAttrs as M,
|
|
1
|
+
import { defineComponent as W, inject as C, computed as a, useAttrs as M, createElementBlock as B, openBlock as k, mergeProps as L, unref as $ } from "vue";
|
|
2
2
|
import { IMAGE_PROVIDER_URLS as N, SCREEN_SIZES as w } from "./constants.js";
|
|
3
3
|
import q from "lodash-es/merge";
|
|
4
4
|
const j = {
|
|
@@ -148,7 +148,7 @@ const Y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
148
148
|
}
|
|
149
149
|
return n.sort((f, u) => f.screenMinWidth > u.screenMinWidth ? -1 : 1), n;
|
|
150
150
|
}
|
|
151
|
-
return (r, n) => (
|
|
151
|
+
return (r, n) => (k(), B("img", L({
|
|
152
152
|
ref: "img",
|
|
153
153
|
key: g.value,
|
|
154
154
|
"data-test": "stash-image",
|
|
@@ -166,4 +166,4 @@ export {
|
|
|
166
166
|
et as _,
|
|
167
167
|
b as a
|
|
168
168
|
};
|
|
169
|
-
//# sourceMappingURL=Image.vue_vue_type_script_setup_true_lang-
|
|
169
|
+
//# sourceMappingURL=Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.vue_vue_type_script_setup_true_lang-YUNunj71.js","sources":["../src/components/Image/Image.types.ts","../src/components/Image/providers/utils.ts","../src/components/Image/providers/cloudinary.ts","../src/components/Image/providers/static.ts","../src/components/Image/providers/index.ts","../src/components/Image/Image.vue"],"sourcesContent":["// Sizes used to generate resized and optimized versions of an image.\n// Generated in `srcset`, and informed by `sizes`.\nexport const Screens = {\n xs: 160,\n sm: 338,\n md: 676,\n lg: 1352,\n xl: 2704,\n} as const;\n\nexport interface ImageSizeCondition {\n mediaQuery: string;\n screenMinWidth: number;\n size: string;\n}\n\nexport enum ImageRadius {\n None = 'none',\n Rounded = 'rounded',\n Circle = 'circle',\n}\n\nexport type ImageRadii = `${ImageRadius}`;\n\nexport enum ImageProviders {\n Cloudinary = 'cloudinary',\n Static = 'static',\n}\n","export interface ImageModifiers {\n format?: string;\n height?: number;\n width?: number;\n [key: string]: any /* eslint-disable-line @typescript-eslint/no-explicit-any */;\n}\n\nexport type ParamFormatter = (key: string, value: string) => string;\n\nexport type ParamMapper = { [key: string]: string } | ((key: string) => string);\n\nexport interface ProviderUrlBuilder {\n keyMap?: ParamMapper;\n formatter?: ParamFormatter;\n joinWith?: string;\n valueMap?: {\n [key: string]: ParamMapper;\n };\n}\n\nfunction createMapper(map: ParamMapper) {\n return (key: string) => {\n return map[key] || key;\n };\n}\n\n/**\n * Builds the parameterized Cloudinary url\n */\nexport function buildProviderUrl({\n formatter = (key, value) => `${key}=${value}`,\n keyMap,\n joinWith = '/',\n valueMap = {},\n}: ProviderUrlBuilder = {}) {\n const keyMapper = typeof keyMap === 'function' ? keyMap : createMapper(keyMap || {});\n\n Object.keys(valueMap).forEach((valueKey) => {\n if (typeof valueMap[valueKey] !== 'function') {\n valueMap[valueKey] = createMapper(valueMap[valueKey]);\n }\n });\n\n return (modifiers: { [key: string]: string } = {}) => {\n const operations = Object.entries(modifiers).map(([key, value]) => {\n const mapper = valueMap[key];\n const newKey = keyMapper(key);\n let newVal = value;\n\n if (typeof mapper === 'function') {\n newVal = mapper(modifiers[key]);\n }\n\n return formatter(newKey, newVal);\n });\n\n return operations.join(joinWith);\n };\n}\n\n/**\n * Checks if a (sub)domain is included in a list of acceptable domains\n * @param str the (sub)domain to check\n * @param domains an array of valid domains\n */\nexport function isDomainValid(str = '', domains: string[] = []): boolean {\n const url = new URL(str);\n const host = url.host;\n\n return domains.some((domain) => {\n if (domain === host) {\n return true;\n }\n\n return domain.endsWith(`.${host}`);\n });\n}\n","import merge from 'lodash-es/merge';\n\nimport { IMAGE_PROVIDER_URLS } from '../../../constants';\nimport { buildProviderUrl, ImageModifiers } from './utils';\n\nconst BASE_URL = IMAGE_PROVIDER_URLS.CLOUDINARY;\n\nconst convertHextoRGBFormat = (value: string) => (value.startsWith('#') ? value.replace('#', 'rgb_') : value);\n\n/**\n * Parameters (option and value pairs) that can be used in the <transformations> segment of the Cloudinary transformation URL.\n * Options and their respective values are connected by an underscore (eg `w_250` for width of 250px.).\n * Multiple parameters are comma separated (eg. `w_250,h_250`).\n *\n * `keyMap` maps the option to its option prefix.\n * `valueMap` is used for grouping options using the same `keyMap` value under a 'category', allowing for easier usage and custom labelling in the component context.\n *\n * Transformation URL structure:\n * https://cloudinary.com/documentation/transformation_reference\n *\n * Transformation URL parameters (options and values):\n * https://cloudinary.com/documentation/image_transformations#transformation_url_syntax\n *\n */\nexport const operationsGenerator = buildProviderUrl({\n keyMap: {\n fit: 'c',\n width: 'w',\n height: 'h',\n format: 'f',\n quality: 'q',\n background: 'b',\n dpr: 'dpr',\n },\n valueMap: {\n fit: {\n fill: 'fill',\n inside: 'pad',\n outside: 'lpad',\n cover: 'fit',\n contain: 'scale',\n },\n format: {\n jpeg: 'jpg',\n },\n background(value: string) {\n return convertHextoRGBFormat(value);\n },\n },\n joinWith: ',',\n formatter: (key, value) => `${key}_${value}`,\n});\n\n// Note: Not configurable via Image props (for now).\nconst defaultModifiers = {\n format: 'auto',\n quality: 'auto:best',\n};\n\nexport function getImageUrl(src: string, modifiers: Partial<ImageModifiers> = {}): string {\n const mergeModifiers = merge(defaultModifiers, modifiers);\n const operations = operationsGenerator(mergeModifiers);\n\n return `${BASE_URL}/${operations}/${src}`;\n}\n","export function getImageUrl(src = ''): string {\n return src;\n}\n","import * as cloudinary from './cloudinary';\nimport * as staticProvider from './static';\n\nexport default {\n cloudinary,\n static: staticProvider,\n};\n","<script lang=\"ts\">\n export * from './Image.types';\n</script>\n\n<script setup lang=\"ts\">\n import { computed, inject, useAttrs } from 'vue';\n\n import { StashImageProviders, StashProvideState } from '../../../types/misc';\n import { SCREEN_SIZES } from '../../constants';\n import { ImageProviders, ImageRadii, ImageRadius, ImageSizeCondition, Screens } from './Image.types';\n import providers from './providers';\n import { ImageModifiers } from './providers/utils';\n\n export interface ImageProps {\n /**\n * The path to the image you want to embed.\n */\n src: string;\n\n /**\n * Native srcset attribute.\n * One or more strings separated by commas, indicating possible image sources\n * Can only be used with provider=static, otherwise it's ignored and auto-generated with `sizes` usage\n */\n srcset?: string;\n\n /**\n * For specifying responsive sizes\n */\n sizes?: string;\n\n /**\n * Where the image is served from.\n * If not provided, the provider will inherit from the Stash config `stashOptions.images.provider` (default: `static`).\n * - `static` for relative or absolute paths\n * - `cloudinary` for images served via Cloudinary\n */\n provider?: StashImageProviders;\n\n /**\n * For applying border radius\n */\n radius?: ImageRadii;\n\n /**\n * A custom static path the image src will be appended onto when provider=static.\n * Can be used to override the library-level default.\n */\n staticPath?: string;\n\n /**\n * TODO - https://leaflink.atlassian.net/browse/GRO-204\n * A custom function used to resolve a URL string for the image\n */\n // loader?: () => string;\n }\n\n defineOptions({\n inheritAttrs: false,\n });\n\n const BREAKPOINTS = {\n md: SCREEN_SIZES.md,\n lg: SCREEN_SIZES.lg,\n };\n const stashOptions = inject<StashProvideState>('stashOptions');\n const props = withDefaults(defineProps<ImageProps>(), {\n src: '',\n srcset: undefined,\n sizes: undefined,\n staticPath: undefined,\n provider: undefined,\n radius: 'none',\n // loader: undefined, // TODO - https://leaflink.atlassian.net/browse/GRO-204\n });\n\n const attrs = computed(() => {\n const { src, ...attrs } = useAttrs();\n\n attrs.sizes = imgSizes.value;\n attrs.srcset = imgSrcset.value;\n\n return attrs;\n });\n\n const isAbsoluteUrl = computed(() => {\n // return true if not an absolute url\n try {\n new URL(props.src);\n return true;\n } catch (e) {\n return false;\n }\n });\n\n const computedProvider = computed(() => props.provider || stashOptions?.images?.provider || ImageProviders.Static);\n\n const computedStaticPath = computed(() => props.staticPath ?? stashOptions?.staticPath);\n\n const isStatic = computed(() => computedProvider.value === ImageProviders.Static);\n\n const imgProvider = computed(() => providers[computedProvider.value]);\n\n const imgSrc = computed(() => (isStatic.value ? getProviderImage() : getProviderImage({ width: Screens.md })));\n\n const imgSizes = computed(() => (props.sizes ? getSizes() : props.sizes));\n\n const imgSrcset = computed(() => (props.sizes && !props.srcset && !isStatic.value ? getSources() : props.srcset));\n\n const parsedSizes = computed(() => {\n return props.sizes ? parseSizes(props.sizes) : [];\n });\n\n function getProviderImage(modifiers: ImageModifiers = {}) {\n if (isStatic.value && isAbsoluteUrl.value) {\n return props.src;\n }\n\n const src = isStatic.value && computedStaticPath.value ? `${computedStaticPath.value}/${props.src}` : props.src;\n\n return imgProvider.value.getImageUrl(src, modifiers);\n }\n\n function getSources() {\n return Object.values(Screens)\n .map((width) => {\n const src = getProviderImage({ width });\n\n return `${src} ${width}w`;\n })\n .join(', ');\n }\n\n function getSizes() {\n // return if using native media conditions\n if (props.sizes?.includes('(')) {\n return props.sizes;\n }\n\n return parsedSizes.value.map((v) => `${v.mediaQuery ? v.mediaQuery + ' ' : ''}${v.size}`).join(', ');\n }\n\n function parseSizes(providedSizes = '') {\n const conditions: ImageSizeCondition[] = [];\n const sizes = {\n default: '100vw',\n };\n\n // parse sizes and convert to object\n if (typeof providedSizes === 'string') {\n const definitions = providedSizes.split(/[\\s]+/).filter((size) => size);\n\n for (const entry of definitions) {\n const size = entry.split(':');\n\n if (size.length !== 2) {\n sizes['default'] = size[0].trim();\n continue;\n }\n\n sizes[size[0].trim()] = size[1].trim();\n }\n } else {\n throw new Error('`sizes` needs to be a string');\n }\n\n for (const key in sizes) {\n const screenMinWidth = parseInt(BREAKPOINTS[key] || 0);\n let size = String(sizes[key]);\n const isFluidSize = size.endsWith('vw');\n\n // convert integer to pixels\n if (!isFluidSize && /^\\d+$/.test(size)) {\n size = `${size}px`;\n }\n\n if (!isFluidSize && size.endsWith('%')) {\n throw new Error('Image: `sizes` does not support percentage values');\n }\n\n const condition = {\n mediaQuery: screenMinWidth ? `(min-width: ${screenMinWidth}px)` : '',\n screenMinWidth,\n size,\n };\n\n conditions.push(condition);\n }\n\n conditions.sort((v1, v2) => (v1.screenMinWidth > v2.screenMinWidth ? -1 : 1));\n\n return conditions;\n }\n</script>\n\n<template>\n <img\n ref=\"img\"\n :key=\"imgSrc\"\n data-test=\"stash-image\"\n class=\"stash-image\"\n :class=\"{\n 'tw-rounded': props.radius === ImageRadius.Rounded,\n 'tw-rounded-full': props.radius === ImageRadius.Circle,\n }\"\n :src=\"imgSrc\"\n v-bind=\"attrs\"\n />\n</template>\n"],"names":["Screens","ImageRadius","ImageProviders","createMapper","map","key","buildProviderUrl","formatter","value","keyMap","joinWith","valueMap","keyMapper","valueKey","modifiers","mapper","newKey","newVal","BASE_URL","IMAGE_PROVIDER_URLS","convertHextoRGBFormat","operationsGenerator","defaultModifiers","getImageUrl","src","mergeModifiers","merge","operations","providers","cloudinary","staticProvider","BREAKPOINTS","SCREEN_SIZES","stashOptions","inject","props","__props","attrs","computed","useAttrs","imgSizes","imgSrcset","isAbsoluteUrl","computedProvider","_a","computedStaticPath","isStatic","imgProvider","imgSrc","getProviderImage","getSizes","getSources","parsedSizes","parseSizes","width","v","providedSizes","conditions","sizes","definitions","size","entry","screenMinWidth","isFluidSize","condition","v1","v2"],"mappings":";;;AAEO,MAAMA,IAAU;AAAA,EACrB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAQY,IAAAC,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,UAAU,WACVA,EAAA,SAAS,UAHCA,IAAAA,KAAA,CAAA,CAAA,GAQAC,sBAAAA,OACVA,EAAA,aAAa,cACbA,EAAA,SAAS,UAFCA,IAAAA,KAAA,CAAA,CAAA;ACJZ,SAASC,EAAaC,GAAkB;AACtC,SAAO,CAACC,MACCD,EAAIC,CAAG,KAAKA;AAEvB;AAKO,SAASC,EAAiB;AAAA,EAC/B,WAAAC,IAAY,CAACF,GAAKG,MAAU,GAAGH,CAAG,IAAIG,CAAK;AAAA,EAC3C,QAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW,CAAA;AACb,IAAwB,IAAI;AACpB,QAAAC,IAAY,OAAOH,KAAW,aAAaA,IAASN,EAAaM,KAAU,EAAE;AAEnF,gBAAO,KAAKE,CAAQ,EA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GhD,iBAAWvD,KAAOqD,GAAO;AACvB,cAAMI,IAAiB,SAAS/B,EAAY1B,CAAG,KAAK,CAAC;AACrD,YAAIuD,IAAO,OAAOF,EAAMrD,CAAG,CAAC;AACtB,cAAA0D,IAAcH,EAAK,SAAS,IAAI;AAOtC,YAJI,CAACG,KAAe,QAAQ,KAAKH,CAAI,MACnCA,IAAO,GAAGA,CAAI,OAGZ,CAACG,KAAeH,EAAK,SAAS,GAAG;AAC7B,gBAAA,IAAI,MAAM,mDAAmD;AAGrE,cAAMI,IAAY;AAAA,UAChB,YAAYF,IAAiB,eAAeA,CAAc,QAAQ;AAAA,UAClE,gBAAAA;AAAA,UACA,MAAAF;AAAA,QACF;AAEA,QAAAH,EAAW,KAAKO,CAAS;AAAA,MAAA;AAGhB,aAAAP,EAAA,KAAK,CAACQ,GAAIC,MAAQD,EAAG,iBAAiBC,EAAG,iBAAiB,KAAK,CAAE,GAErET;AAAA,IAAA;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js","sources":["../src/components/Image/Image.types.ts","../src/components/Image/providers/utils.ts","../src/components/Image/providers/cloudinary.ts","../src/components/Image/providers/static.ts","../src/components/Image/providers/index.ts","../src/components/Image/Image.vue"],"sourcesContent":["// Sizes used to generate resized and optimized versions of an image.\n// Generated in `srcset`, and informed by `sizes`.\nexport const Screens = {\n xs: 160,\n sm: 338,\n md: 676,\n lg: 1352,\n xl: 2704,\n} as const;\n\nexport interface ImageSizeCondition {\n mediaQuery: string;\n screenMinWidth: number;\n size: string;\n}\n\nexport enum ImageRadius {\n None = 'none',\n Rounded = 'rounded',\n Circle = 'circle',\n}\n\nexport type ImageRadii = `${ImageRadius}`;\n\nexport enum ImageProviders {\n Cloudinary = 'cloudinary',\n Static = 'static',\n}\n","export interface ImageModifiers {\n format?: string;\n height?: number;\n width?: number;\n [key: string]: any /* eslint-disable-line @typescript-eslint/no-explicit-any */;\n}\n\nexport type ParamFormatter = (key: string, value: string) => string;\n\nexport type ParamMapper = { [key: string]: string } | ((key: string) => string);\n\nexport interface ProviderUrlBuilder {\n keyMap?: ParamMapper;\n formatter?: ParamFormatter;\n joinWith?: string;\n valueMap?: {\n [key: string]: ParamMapper;\n };\n}\n\nfunction createMapper(map: ParamMapper) {\n return (key: string) => {\n return map[key] || key;\n };\n}\n\n/**\n * Builds the parameterized Cloudinary url\n */\nexport function buildProviderUrl({\n formatter = (key, value) => `${key}=${value}`,\n keyMap,\n joinWith = '/',\n valueMap = {},\n}: ProviderUrlBuilder = {}) {\n const keyMapper = typeof keyMap === 'function' ? keyMap : createMapper(keyMap || {});\n\n Object.keys(valueMap).forEach((valueKey) => {\n if (typeof valueMap[valueKey] !== 'function') {\n valueMap[valueKey] = createMapper(valueMap[valueKey]);\n }\n });\n\n return (modifiers: { [key: string]: string } = {}) => {\n const operations = Object.entries(modifiers).map(([key, value]) => {\n const mapper = valueMap[key];\n const newKey = keyMapper(key);\n let newVal = value;\n\n if (typeof mapper === 'function') {\n newVal = mapper(modifiers[key]);\n }\n\n return formatter(newKey, newVal);\n });\n\n return operations.join(joinWith);\n };\n}\n\n/**\n * Checks if a (sub)domain is included in a list of acceptable domains\n * @param str the (sub)domain to check\n * @param domains an array of valid domains\n */\nexport function isDomainValid(str = '', domains: string[] = []): boolean {\n const url = new URL(str);\n const host = url.host;\n\n return domains.some((domain) => {\n if (domain === host) {\n return true;\n }\n\n return domain.endsWith(`.${host}`);\n });\n}\n","import merge from 'lodash-es/merge';\n\nimport { IMAGE_PROVIDER_URLS } from '../../../constants';\nimport { buildProviderUrl, ImageModifiers } from './utils';\n\nconst BASE_URL = IMAGE_PROVIDER_URLS.CLOUDINARY;\n\nconst convertHextoRGBFormat = (value: string) => (value.startsWith('#') ? value.replace('#', 'rgb_') : value);\n\n/**\n * Parameters (option and value pairs) that can be used in the <transformations> segment of the Cloudinary transformation URL.\n * Options and their respective values are connected by an underscore (eg `w_250` for width of 250px.).\n * Multiple parameters are comma separated (eg. `w_250,h_250`).\n *\n * `keyMap` maps the option to its option prefix.\n * `valueMap` is used for grouping options using the same `keyMap` value under a 'category', allowing for easier usage and custom labelling in the component context.\n *\n * Transformation URL structure:\n * https://cloudinary.com/documentation/transformation_reference\n *\n * Transformation URL parameters (options and values):\n * https://cloudinary.com/documentation/image_transformations#transformation_url_syntax\n *\n */\nexport const operationsGenerator = buildProviderUrl({\n keyMap: {\n fit: 'c',\n width: 'w',\n height: 'h',\n format: 'f',\n quality: 'q',\n background: 'b',\n dpr: 'dpr',\n },\n valueMap: {\n fit: {\n fill: 'fill',\n inside: 'pad',\n outside: 'lpad',\n cover: 'fit',\n contain: 'scale',\n },\n format: {\n jpeg: 'jpg',\n },\n background(value: string) {\n return convertHextoRGBFormat(value);\n },\n },\n joinWith: ',',\n formatter: (key, value) => `${key}_${value}`,\n});\n\n// Note: Not configurable via Image props (for now).\nconst defaultModifiers = {\n format: 'auto',\n quality: 'auto:best',\n};\n\nexport function getImageUrl(src: string, modifiers: Partial<ImageModifiers> = {}): string {\n const mergeModifiers = merge(defaultModifiers, modifiers);\n const operations = operationsGenerator(mergeModifiers);\n\n return `${BASE_URL}/${operations}/${src}`;\n}\n","export function getImageUrl(src = ''): string {\n return src;\n}\n","import * as cloudinary from './cloudinary';\nimport * as staticProvider from './static';\n\nexport default {\n cloudinary,\n static: staticProvider,\n};\n","<script lang=\"ts\">\n export * from './Image.types';\n</script>\n\n<script setup lang=\"ts\">\n import { computed, inject, useAttrs } from 'vue';\n\n import { StashImageProviders, StashProvideState } from '../../../types/misc';\n import { SCREEN_SIZES } from '../../constants';\n import { ImageProviders, ImageRadii, ImageRadius, ImageSizeCondition, Screens } from './Image.types';\n import providers from './providers';\n import { ImageModifiers } from './providers/utils';\n\n export interface ImageProps {\n /**\n * The path to the image you want to embed.\n */\n src: string;\n\n /**\n * Native srcset attribute.\n * One or more strings separated by commas, indicating possible image sources\n * Can only be used with provider=static, otherwise it's ignored and auto-generated with `sizes` usage\n */\n srcset?: string;\n\n /**\n * For specifying responsive sizes\n */\n sizes?: string;\n\n /**\n * Where the image is served from.\n * If not provided, the provider will inherit from the Stash config `stashOptions.images.provider` (default: `static`).\n * - `static` for relative or absolute paths\n * - `cloudinary` for images served via Cloudinary\n */\n provider?: StashImageProviders;\n\n /**\n * For applying border radius\n */\n radius?: ImageRadii;\n\n /**\n * A custom static path the image src will be appended onto when provider=static.\n * Can be used to override the library-level default.\n */\n staticPath?: string;\n\n /**\n * TODO - https://leaflink.atlassian.net/browse/GRO-204\n * A custom function used to resolve a URL string for the image\n */\n // loader?: () => string;\n }\n\n defineOptions({\n inheritAttrs: false,\n });\n\n const BREAKPOINTS = {\n md: SCREEN_SIZES.md,\n lg: SCREEN_SIZES.lg,\n };\n const stashOptions = inject<StashProvideState>('stashOptions');\n const props = withDefaults(defineProps<ImageProps>(), {\n src: '',\n srcset: undefined,\n sizes: undefined,\n staticPath: undefined,\n provider: undefined,\n radius: 'none',\n // loader: undefined, // TODO - https://leaflink.atlassian.net/browse/GRO-204\n });\n\n const attrs = computed(() => {\n const { src, ...attrs } = useAttrs();\n\n attrs.sizes = imgSizes.value;\n attrs.srcset = imgSrcset.value;\n\n return attrs;\n });\n\n const isAbsoluteUrl = computed(() => {\n // return true if not an absolute url\n try {\n new URL(props.src);\n return true;\n } catch (e) {\n return false;\n }\n });\n\n const computedProvider = computed(() => props.provider || stashOptions?.images?.provider || ImageProviders.Static);\n\n const computedStaticPath = computed(() => props.staticPath ?? stashOptions?.staticPath);\n\n const isStatic = computed(() => computedProvider.value === ImageProviders.Static);\n\n const imgProvider = computed(() => providers[computedProvider.value]);\n\n const imgSrc = computed(() => (isStatic.value ? getProviderImage() : getProviderImage({ width: Screens.md })));\n\n const imgSizes = computed(() => (props.sizes ? getSizes() : props.sizes));\n\n const imgSrcset = computed(() => (props.sizes && !props.srcset && !isStatic.value ? getSources() : props.srcset));\n\n const parsedSizes = computed(() => {\n return props.sizes ? parseSizes(props.sizes) : [];\n });\n\n function getProviderImage(modifiers: ImageModifiers = {}) {\n if (isStatic.value && isAbsoluteUrl.value) {\n return props.src;\n }\n\n const src = isStatic.value && computedStaticPath.value ? `${computedStaticPath.value}/${props.src}` : props.src;\n\n return imgProvider.value.getImageUrl(src, modifiers);\n }\n\n function getSources() {\n return Object.values(Screens)\n .map((width) => {\n const src = getProviderImage({ width });\n\n return `${src} ${width}w`;\n })\n .join(', ');\n }\n\n function getSizes() {\n // return if using native media conditions\n if (props.sizes?.includes('(')) {\n return props.sizes;\n }\n\n return parsedSizes.value.map((v) => `${v.mediaQuery ? v.mediaQuery + ' ' : ''}${v.size}`).join(', ');\n }\n\n function parseSizes(providedSizes = '') {\n const conditions: ImageSizeCondition[] = [];\n const sizes = {\n default: '100vw',\n };\n\n // parse sizes and convert to object\n if (typeof providedSizes === 'string') {\n const definitions = providedSizes.split(/[\\s]+/).filter((size) => size);\n\n for (const entry of definitions) {\n const size = entry.split(':');\n\n if (size.length !== 2) {\n sizes['default'] = size[0].trim();\n continue;\n }\n\n sizes[size[0].trim()] = size[1].trim();\n }\n } else {\n throw new Error('`sizes` needs to be a string');\n }\n\n for (const key in sizes) {\n const screenMinWidth = parseInt(BREAKPOINTS[key] || 0);\n let size = String(sizes[key]);\n const isFluidSize = size.endsWith('vw');\n\n // convert integer to pixels\n if (!isFluidSize && /^\\d+$/.test(size)) {\n size = `${size}px`;\n }\n\n if (!isFluidSize && size.endsWith('%')) {\n throw new Error('Image: `sizes` does not support percentage values');\n }\n\n const condition = {\n mediaQuery: screenMinWidth ? `(min-width: ${screenMinWidth}px)` : '',\n screenMinWidth,\n size,\n };\n\n conditions.push(condition);\n }\n\n conditions.sort((v1, v2) => (v1.screenMinWidth > v2.screenMinWidth ? -1 : 1));\n\n return conditions;\n }\n</script>\n\n<template>\n <img\n ref=\"img\"\n :key=\"imgSrc\"\n data-test=\"stash-image\"\n class=\"stash-image\"\n :class=\"{\n 'tw-rounded': props.radius === ImageRadius.Rounded,\n 'tw-rounded-full': props.radius === ImageRadius.Circle,\n }\"\n :src=\"imgSrc\"\n v-bind=\"attrs\"\n />\n</template>\n"],"names":["Screens","ImageRadius","ImageProviders","createMapper","map","key","buildProviderUrl","formatter","value","keyMap","joinWith","valueMap","keyMapper","valueKey","modifiers","mapper","newKey","newVal","BASE_URL","IMAGE_PROVIDER_URLS","convertHextoRGBFormat","operationsGenerator","defaultModifiers","getImageUrl","src","mergeModifiers","merge","operations","providers","cloudinary","staticProvider","BREAKPOINTS","SCREEN_SIZES","stashOptions","inject","props","__props","attrs","computed","useAttrs","imgSizes","imgSrcset","isAbsoluteUrl","computedProvider","_a","computedStaticPath","isStatic","imgProvider","imgSrc","getProviderImage","getSizes","getSources","parsedSizes","parseSizes","width","v","providedSizes","conditions","sizes","definitions","size","entry","screenMinWidth","isFluidSize","condition","v1","v2"],"mappings":";;;AAEO,MAAMA,IAAU;AAAA,EACrB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAQY,IAAAC,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,UAAU,WACVA,EAAA,SAAS,UAHCA,IAAAA,KAAA,CAAA,CAAA,GAQAC,sBAAAA,OACVA,EAAA,aAAa,cACbA,EAAA,SAAS,UAFCA,IAAAA,KAAA,CAAA,CAAA;ACJZ,SAASC,EAAaC,GAAkB;AACtC,SAAO,CAACC,MACCD,EAAIC,CAAG,KAAKA;AAEvB;AAKO,SAASC,EAAiB;AAAA,EAC/B,WAAAC,IAAY,CAACF,GAAKG,MAAU,GAAGH,CAAG,IAAIG,CAAK;AAAA,EAC3C,QAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW,CAAA;AACb,IAAwB,IAAI;AACpB,QAAAC,IAAY,OAAOH,KAAW,aAAaA,IAASN,EAAaM,KAAU,EAAE;AAEnF,gBAAO,KAAKE,CAAQ,EAAE,QAAQ,CAACE,MAAa;AAC1C,IAAI,OAAOF,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AAiB,SAAS/B,EAAY1B,CAAG,KAAK,CAAC;AACrD,YAAIuD,IAAO,OAAOF,EAAMrD,CAAG,CAAC;AACtB,cAAA0D,IAAcH,EAAK,SAAS,IAAI;AAOtC,YAJI,CAACG,KAAe,QAAQ,KAAKH,CAAI,MACnCA,IAAO,GAAGA,CAAI,OAGZ,CAACG,KAAeH,EAAK,SAAS,GAAG;AAC7B,gBAAA,IAAI,MAAM,mDAAmD;AAGrE,cAAMI,IAAY;AAAA,UAChB,YAAYF,IAAiB,eAAeA,CAAc,QAAQ;AAAA,UAClE,gBAAAA;AAAA,UACA,MAAAF;AAAA,QACF;AAEA,QAAAH,EAAW,KAAKO,CAAS;AAAA,MAAA;AAGhB,aAAAP,EAAA,KAAK,CAACQ,GAAIC,MAAQD,EAAG,iBAAiBC,EAAG,iBAAiB,KAAK,CAAE,GAErET;AAAA,IAAA;;;;;;;;;;;;;"}
|
package/dist/InlineEdit.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as B, useSlots as K, useAttrs as N, ref as u, computed as n, watch as $,
|
|
1
|
+
import { defineComponent as B, useSlots as K, useAttrs as N, ref as u, computed as n, watch as $, createElementBlock as c, openBlock as m, normalizeClass as O, unref as P, createElementVNode as z, createCommentVNode as D, createVNode as F, mergeProps as U, withKeys as f, createSlots as j, withCtx as v, renderSlot as V, toDisplayString as q } from "vue";
|
|
2
2
|
import { percent as G, money as H } from "./utils/i18n.js";
|
|
3
3
|
import J from "./Input.js";
|
|
4
4
|
const L = { class: "stash-inline-edit__input-wrapper" }, M = {
|
|
@@ -58,12 +58,12 @@ const L = { class: "stash-inline-edit__input-wrapper" }, M = {
|
|
|
58
58
|
function i() {
|
|
59
59
|
a.value && a.value.inputEl.blur();
|
|
60
60
|
}
|
|
61
|
-
return (t, o) => (
|
|
61
|
+
return (t, o) => (m(), c("div", {
|
|
62
62
|
class: O(["stash-inline-edit", P(p).class]),
|
|
63
63
|
"data-test": "stash-inline-edit"
|
|
64
64
|
}, [
|
|
65
65
|
z("div", L, [
|
|
66
|
-
|
|
66
|
+
F(J, U({
|
|
67
67
|
ref_key: "llInput",
|
|
68
68
|
ref: a,
|
|
69
69
|
modelValue: l.value,
|
|
@@ -78,7 +78,7 @@ const L = { class: "stash-inline-edit__input-wrapper" }, M = {
|
|
|
78
78
|
onFocus: A,
|
|
79
79
|
onKeydown: f(I, ["esc"]),
|
|
80
80
|
onKeyup: f(i, ["enter"])
|
|
81
|
-
}),
|
|
81
|
+
}), j({ _: 2 }, [
|
|
82
82
|
g.value ? {
|
|
83
83
|
name: "prepend",
|
|
84
84
|
fn: v(() => [
|
|
@@ -95,7 +95,7 @@ const L = { class: "stash-inline-edit__input-wrapper" }, M = {
|
|
|
95
95
|
} : void 0
|
|
96
96
|
]), 1040, ["modelValue", "error-text", "hint-text", "label", "placeholder", "type"])
|
|
97
97
|
]),
|
|
98
|
-
b.value ? (
|
|
98
|
+
b.value ? (m(), c("span", M, q(_.value), 1)) : D("", !0)
|
|
99
99
|
], 2));
|
|
100
100
|
}
|
|
101
101
|
});
|
package/dist/Input.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as P, useSlots as U, useCssModule as q, useAttrs as G, ref as y, computed as c, watchEffect as L, onMounted as W,
|
|
1
|
+
import { defineComponent as P, useSlots as U, useCssModule as q, useAttrs as G, ref as y, computed as c, watchEffect as L, onMounted as W, createBlock as V, openBlock as f, mergeProps as B, unref as l, createSlots as j, withCtx as k, createElementVNode as N, withDirectives as H, createElementBlock as x, createCommentVNode as I, vModelDynamic as J, normalizeClass as v, renderSlot as b } from "vue";
|
|
2
2
|
import C from "lodash-es/isNil";
|
|
3
3
|
import { convertDecimal as D, sanitizeDecimal as K, decimalSeparator as h } from "./utils/i18n.js";
|
|
4
|
-
import { _ as Q } from "./Field.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { _ as Q } from "./Field.vue_vue_type_script_setup_true_lang-DRaKs9Lm.js";
|
|
5
5
|
import X from "./Icon.js";
|
|
6
6
|
import { _ as Y } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
7
|
const Z = { class: "tw-relative" }, ee = ["id", "aria-errormessage", "aria-invalid", "autocomplete", "placeholder", "type", "disabled", "readonly"], te = /* @__PURE__ */ P({
|
package/dist/InputOptions.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as S, useAttrs as O, useSlots as E, useCssModule as T, ref as p, watchEffect as $, watch as h,
|
|
1
|
+
import { defineComponent as S, useAttrs as O, useSlots as E, useCssModule as T, ref as p, watchEffect as $, watch as h, createBlock as D, openBlock as d, mergeProps as M, createSlots as R, withCtx as f, createElementBlock as y, createElementVNode as z, toDisplayString as _, normalizeClass as r, unref as s, createVNode as b, renderSlot as F } from "vue";
|
|
2
2
|
import N from "./Input.js";
|
|
3
3
|
import U from "./Select.js";
|
|
4
|
-
import { _ as q } from "./Field.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { _ as q } from "./Field.vue_vue_type_script_setup_true_lang-DRaKs9Lm.js";
|
|
5
5
|
import { _ as A } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const L = {
|
|
7
7
|
key: 0,
|
package/dist/IntegrationIcon.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as d, useCssModule as u, inject as f, computed as m,
|
|
1
|
+
import { defineComponent as d, useCssModule as u, inject as f, computed as m, createBlock as _, openBlock as h, unref as s, normalizeClass as p } from "vue";
|
|
2
2
|
import b from "lodash-es/uniqueId";
|
|
3
3
|
import { I as x } from "./index-D6bxWkZ1.js";
|
|
4
4
|
import { _ as y } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
@@ -46,7 +46,7 @@ const N = [
|
|
|
46
46
|
const r = e.querySelector(`#${t.name}`);
|
|
47
47
|
return r ? (e.replaceChildren(r, n), e) : (e.insertBefore(n, e.firstChild), e);
|
|
48
48
|
};
|
|
49
|
-
return (e, n) => (
|
|
49
|
+
return (e, n) => (h(), _(s(x), {
|
|
50
50
|
id: t.id,
|
|
51
51
|
role: "presentation",
|
|
52
52
|
"aria-labelledby": t.id,
|
package/dist/Label.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as n, computed as r,
|
|
1
|
+
import { defineComponent as n, computed as r, createBlock as i, openBlock as t, resolveDynamicComponent as d, normalizeClass as c, withCtx as p, renderSlot as f, createElementBlock as a, createCommentVNode as u, toDisplayString as m, unref as w } from "vue";
|
|
2
2
|
import { t as b } from "./locale.js";
|
|
3
3
|
const h = {
|
|
4
4
|
key: 0,
|
|
@@ -31,7 +31,7 @@ const h = {
|
|
|
31
31
|
}, {
|
|
32
32
|
default: p(() => [
|
|
33
33
|
f(s.$slots, "default"),
|
|
34
|
-
e.isRequired ? (t(), a("span", h, " * ")) : e.showOptional ? (t(), a("span", _, " (" +
|
|
34
|
+
e.isRequired ? (t(), a("span", h, " * ")) : e.showOptional ? (t(), a("span", _, " (" + m(w(b)("ll.optional")) + ")", 1)) : u("", !0)
|
|
35
35
|
]),
|
|
36
36
|
_: 3
|
|
37
37
|
}, 8, ["class", "for"]));
|
|
@@ -40,4 +40,4 @@ const h = {
|
|
|
40
40
|
export {
|
|
41
41
|
x as _
|
|
42
42
|
};
|
|
43
|
-
//# sourceMappingURL=Label.vue_vue_type_script_setup_true_lang-
|
|
43
|
+
//# sourceMappingURL=Label.vue_vue_type_script_setup_true_lang-DPnNUfc6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
{"version":3,"file":"Label.vue_vue_type_script_setup_true_lang-DPnNUfc6.js","sources":["../src/components/Label/Label.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue';\n\n import { t } from '../../locale';\n\n export interface LabelProps {\n /**\n * The `id` of the input element that this label is associated with.\n */\n for?: string;\n\n /**\n * Indicates whether the label should be styled as an error.\n */\n hasError?: boolean;\n\n /**\n * Indicates whether the input element that this label is associated with is required.\n */\n isRequired?: boolean;\n\n /**\n * Indicates whether the label should show that the input is optional.\n */\n showOptional?: boolean;\n\n /**\n * Indicates whether the wrapper element to be rendered should be a label or a legend.\n */\n legend?: boolean;\n\n /**\n * Indicates whether the label is disabled.\n */\n disabled?: boolean;\n }\n\n const props = withDefaults(defineProps<LabelProps>(), {\n for: undefined,\n hasError: false,\n isRequired: false,\n showOptional: false,\n legend: false,\n isDisabled: false,\n });\n\n const is = computed(() => {\n return props.legend ? 'legend' : 'label';\n });\n</script>\n\n<template>\n <component\n :is=\"is\"\n class=\"stash-label tw-block tw-truncate tw-text-sm tw-font-medium tw-leading-6\"\n :class=\"{\n 'tw-animate-shake': props.hasError,\n 'stash-label--disabled tw-text-ice-700': props.disabled,\n 'tw-text-ice-900': !props.disabled,\n }\"\n :for=\"props.for\"\n data-test=\"stash-label\"\n >\n <!-- @slot The label text -->\n <slot></slot>\n <span v-if=\"props.isRequired\" class=\"tw-font-semibold tw-text-red-500\" title=\"Required\" aria-label=\"required\">\n *\n </span>\n <span v-else-if=\"props.showOptional\" class=\"tw-text-ice-700\"> ({{ t('ll.optional') }})</span>\n </component>\n</template>\n"],"names":["props","__props","is","computed"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqCE,UAAMA,IAAQC,GASRC,IAAKC,EAAS,MACXH,EAAM,SAAS,WAAW,OAClC;;;;;;;;;;;;;;;;;;"}
|
package/dist/LicenseChip.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as a, useAttrs as u, computed as r, withDirectives as d,
|
|
1
|
+
import { defineComponent as a, useAttrs as u, computed as r, withDirectives as d, createBlock as p, openBlock as h, mergeProps as m, withCtx as C, createTextVNode as f, toDisplayString as b, vShow as A } from "vue";
|
|
2
2
|
import g from "./Chip.js";
|
|
3
3
|
const N = /* @__PURE__ */ a({
|
|
4
4
|
name: "ll-license-chip",
|
|
@@ -32,7 +32,7 @@ const N = /* @__PURE__ */ a({
|
|
|
32
32
|
const e = s.license.toUpperCase();
|
|
33
33
|
return e.length > 4 ? e.slice(0, 3) : e;
|
|
34
34
|
});
|
|
35
|
-
return (e, v) => d((
|
|
35
|
+
return (e, v) => d((h(), p(g, m({
|
|
36
36
|
class: "stash-license-chip",
|
|
37
37
|
"data-test": "stash-license-chip",
|
|
38
38
|
radius: "pill",
|
package/dist/ListItem.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import a from "./Checkbox.js";
|
|
2
|
-
import { resolveComponent as n,
|
|
2
|
+
import { resolveComponent as n, createElementBlock as i, openBlock as l, normalizeClass as c, createBlock as d, createCommentVNode as m, renderSlot as b } from "vue";
|
|
3
3
|
import { _ as r } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
const k = "_item_12k6c_2", _ = "_checkbox_12k6c_56", f = {
|
|
5
5
|
item: k,
|
package/dist/ListItemCell.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createElementBlock as s, openBlock as t, normalizeClass as l, renderSlot as c } from "vue";
|
|
2
2
|
import { _ as n } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
3
|
const a = "_cell_3gkxo_2", i = "_action_3gkxo_21", r = {
|
|
4
4
|
cell: a,
|
|
@@ -13,7 +13,7 @@ const a = "_cell_3gkxo_2", i = "_action_3gkxo_21", r = {
|
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
function m(e, p, o, f, u, $) {
|
|
16
|
-
return
|
|
16
|
+
return t(), s("div", {
|
|
17
17
|
class: l(o.isAction ? e.$style.action : e.$style.cell)
|
|
18
18
|
}, [
|
|
19
19
|
c(e.$slots, "default")
|
package/dist/ListView.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import W from "lodash-es/cloneDeep";
|
|
2
|
-
import { resolveComponent as d,
|
|
2
|
+
import { resolveComponent as d, createElementBlock as o, openBlock as a, normalizeClass as r, createElementVNode as u, createCommentVNode as n, createVNode as S, toDisplayString as _, createBlock as h, withCtx as m, createTextVNode as T, renderSlot as f, TransitionGroup as F, resolveDirective as O, withDirectives as E, withKeys as q, normalizeStyle as Y, Fragment as J, renderList as Q, mergeProps as X, resolveDynamicComponent as Z, computed as $ } from "vue";
|
|
3
3
|
import ee from "./useSearch.js";
|
|
4
4
|
import { CSS_VARS as L, LLLV_CHANGE_TRIGGERS as b } from "./constants.js";
|
|
5
5
|
import V from "./directives/sticky.js";
|
|
6
6
|
import { t as w } from "./locale.js";
|
|
7
7
|
import { persistentStorage as A } from "./storage.js";
|
|
8
|
-
import { getCssVar as D,
|
|
8
|
+
import { getCssVar as D, sortItems as te, filterItems as se } from "./utils/helpers.js";
|
|
9
9
|
import le from "./Badge.js";
|
|
10
10
|
import v from "./Button.js";
|
|
11
11
|
import R from "./Checkbox.js";
|
|
12
12
|
import ie from "./Dropdown.js";
|
|
13
|
-
import { _ as N } from "./Expand.vue_vue_type_script_setup_true_lang-
|
|
13
|
+
import { _ as N } from "./Expand.vue_vue_type_script_setup_true_lang-CiONJfAp.js";
|
|
14
14
|
import re from "./Filters.js";
|
|
15
15
|
import B from "./Icon.js";
|
|
16
16
|
import ae from "./Input.js";
|
|
@@ -820,7 +820,7 @@ const Ve = {
|
|
|
820
820
|
return;
|
|
821
821
|
}
|
|
822
822
|
const { searchFor: e } = ee({
|
|
823
|
-
items:
|
|
823
|
+
items: $(() => this.internalItems),
|
|
824
824
|
fieldNames: this.internalSearchSchema.searchBy.length ? this.internalSearchSchema.searchBy : [this.displayBy],
|
|
825
825
|
trackBy: this.itemTrackBy
|
|
826
826
|
});
|
|
@@ -879,7 +879,7 @@ const Ve = {
|
|
|
879
879
|
* @returns list of items filtered by the applied filters
|
|
880
880
|
*/
|
|
881
881
|
filterItems(e) {
|
|
882
|
-
return
|
|
882
|
+
return se(e, this.filters);
|
|
883
883
|
},
|
|
884
884
|
/**
|
|
885
885
|
* Sorts a list of items based on options selected in the `sorts` object
|
|
@@ -887,7 +887,7 @@ const Ve = {
|
|
|
887
887
|
* @returns list of items sorted according to the sort term.
|
|
888
888
|
*/
|
|
889
889
|
sortItems(e) {
|
|
890
|
-
return this.sortTerm ?
|
|
890
|
+
return this.sortTerm ? te(e, this.sorts[this.sortTerm]) : e;
|
|
891
891
|
},
|
|
892
892
|
change({ trigger: e = "" } = {}) {
|
|
893
893
|
const { currentPage: l, filters: s, isFiltered: p, pageSize: i, searchTerm: t, sortTerm: c } = this, g = {
|
|
@@ -1055,7 +1055,7 @@ function Ke(e, l, s, p, i, t) {
|
|
|
1055
1055
|
"hint-text": t.internalSearchSchema.hintText,
|
|
1056
1056
|
label: i.searchText,
|
|
1057
1057
|
placeholder: t.internalSearchSchema.placeholder,
|
|
1058
|
-
onKeyup: l[2] || (l[2] =
|
|
1058
|
+
onKeyup: l[2] || (l[2] = q((y) => !t.isLoading && t.onSearch(), ["enter"])),
|
|
1059
1059
|
onChange: t.onSearchTermChange
|
|
1060
1060
|
}, {
|
|
1061
1061
|
append: m(() => [
|
|
@@ -1175,9 +1175,9 @@ function Ke(e, l, s, p, i, t) {
|
|
|
1175
1175
|
u("ul", {
|
|
1176
1176
|
ref: "sortOptions",
|
|
1177
1177
|
class: "dropdown__list",
|
|
1178
|
-
style:
|
|
1178
|
+
style: Y({ minWidth: i.sortOptionsWidth })
|
|
1179
1179
|
}, [
|
|
1180
|
-
(a(!0), o(
|
|
1180
|
+
(a(!0), o(J, null, Q(Object.keys(s.sorts), (y, K) => (a(), o("li", {
|
|
1181
1181
|
key: K,
|
|
1182
1182
|
class: r([{ "tw-bg-blue-100 tw-text-ice-700": y === i.sortTerm }, "dropdown__item tw-rounded"])
|
|
1183
1183
|
}, [
|
|
@@ -1231,7 +1231,7 @@ function Ke(e, l, s, p, i, t) {
|
|
|
1231
1231
|
f(e.$slots, "list-header")
|
|
1232
1232
|
], 2)
|
|
1233
1233
|
], 2),
|
|
1234
|
-
s.isSelectable ? (a(), h(M,
|
|
1234
|
+
s.isSelectable ? (a(), h(M, X({ key: 0 }, {
|
|
1235
1235
|
allowSelectAll: !s.hideSelectAll && !s.isServerSide,
|
|
1236
1236
|
isAllPageChecked: t.isAllPageChecked,
|
|
1237
1237
|
isSomePageChecked: t.isSomePageChecked,
|
|
@@ -1253,7 +1253,7 @@ function Ke(e, l, s, p, i, t) {
|
|
|
1253
1253
|
], 2)), [
|
|
1254
1254
|
[U, t.headerOffset]
|
|
1255
1255
|
]),
|
|
1256
|
-
(a(), h(
|
|
1256
|
+
(a(), h(Z(s.disableLoader ? "div" : "LoadingManager"), {
|
|
1257
1257
|
"empty-state-text": s.emptyStateText,
|
|
1258
1258
|
loading: t.isLoading,
|
|
1259
1259
|
results: t.paginated
|
package/dist/Loading.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as t, useCssModule as s,
|
|
1
|
+
import { defineComponent as t, useCssModule as s, createElementBlock as e, openBlock as n, createElementVNode as o, normalizeClass as r, unref as c, createStaticVNode as i } from "vue";
|
|
2
2
|
import { _ as d } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
3
|
const p = {
|
|
4
4
|
class: "stash-loading tw-flex tw-justify-center tw-py-12",
|
|
@@ -8,7 +8,7 @@ const p = {
|
|
|
8
8
|
__name: "Loading",
|
|
9
9
|
setup(Z) {
|
|
10
10
|
const l = s();
|
|
11
|
-
return (M, a) => (
|
|
11
|
+
return (M, a) => (n(), e("div", p, [
|
|
12
12
|
o("div", {
|
|
13
13
|
class: r(["stash-loading__spinner", c(l).spinner])
|
|
14
14
|
}, a[0] || (a[0] = [
|
package/dist/Logo.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createElementBlock as n, openBlock as c, createElementVNode as e, createStaticVNode as d, defineComponent as s, computed as p, createBlock as Z, createCommentVNode as u, resolveDynamicComponent as m, mergeProps as V } from "vue";
|
|
2
2
|
import M from "@leaflink/snitch";
|
|
3
3
|
const f = {
|
|
4
4
|
fill: "#1E164B",
|
|
@@ -174,7 +174,7 @@ const G = { render: z }, U = /* @__PURE__ */ s({
|
|
|
174
174
|
}
|
|
175
175
|
return (l.width || l.height) && (delete a.width, delete a.height, l.width && (a.width = l.width), l.height && (a.height = l.height)), a;
|
|
176
176
|
});
|
|
177
|
-
return (a, v) => o.value ? (c(), Z(
|
|
177
|
+
return (a, v) => o.value ? (c(), Z(m(o.value.is), V({
|
|
178
178
|
key: 0,
|
|
179
179
|
class: ["stash-logo", [
|
|
180
180
|
`stash-logo--${l.brand}`,
|
|
@@ -187,10 +187,10 @@ const G = { render: z }, U = /* @__PURE__ */ s({
|
|
|
187
187
|
]],
|
|
188
188
|
"data-test": "stash-logo",
|
|
189
189
|
fill: "currentColor"
|
|
190
|
-
}, o.value), null, 16, ["class"])) :
|
|
190
|
+
}, o.value), null, 16, ["class"])) : u("", !0);
|
|
191
191
|
}
|
|
192
192
|
});
|
|
193
193
|
export {
|
|
194
194
|
U as _
|
|
195
195
|
};
|
|
196
|
-
//# sourceMappingURL=Logo.vue_vue_type_script_setup_true_lang-
|
|
196
|
+
//# sourceMappingURL=Logo.vue_vue_type_script_setup_true_lang-Dz8c98sc.js.map
|