@leaflink/stash 45.1.1 → 45.1.3
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/AddressSelect.js +1 -1
- package/dist/CurrencyInput.js +1 -1
- package/dist/DataViewFilters.js +1 -1
- package/dist/DatePicker.js +1 -1
- package/dist/Dialog.js +23 -23
- package/dist/Dialog.js.map +1 -1
- package/dist/Field.js +1 -1
- package/dist/Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js +93 -0
- package/dist/Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js.map +1 -0
- package/dist/FilterSelect.js +1 -1
- package/dist/Filters.js +1 -1
- package/dist/InlineEdit.js +1 -1
- package/dist/Input.js +1 -1
- package/dist/InputOptions.js +1 -1
- package/dist/ListView.js +1 -1
- package/dist/RadioGroup.js +78 -74
- package/dist/RadioGroup.js.map +1 -1
- package/dist/SearchBar.js +1 -1
- package/dist/Select.js +1 -1
- package/dist/SelectStatus.js +1 -1
- package/dist/Textarea.js +1 -1
- package/dist/components.css +1 -1
- package/package.json +1 -2
- package/dist/Field.vue_vue_type_script_setup_true_lang-224ab33a.js +0 -96
- package/dist/Field.vue_vue_type_script_setup_true_lang-224ab33a.js.map +0 -1
package/dist/AddressSelect.js
CHANGED
|
@@ -24,7 +24,7 @@ import "./Icon.js";
|
|
|
24
24
|
import "./index-79ce320f.js";
|
|
25
25
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
26
26
|
import "./_plugin-vue_export-helper-dad06003.js";
|
|
27
|
-
import "./Field.vue_vue_type_script_setup_true_lang-
|
|
27
|
+
import "./Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js";
|
|
28
28
|
import "./Label.vue_vue_type_script_setup_true_lang-4b02087f.js";
|
|
29
29
|
import "./locale.js";
|
|
30
30
|
const _ = "address-select-", ve = /* @__PURE__ */ M({
|
package/dist/CurrencyInput.js
CHANGED
|
@@ -6,7 +6,7 @@ import "./utils/i18n.js";
|
|
|
6
6
|
import "./constants.js";
|
|
7
7
|
import "./locale.js";
|
|
8
8
|
import "lodash-es/get";
|
|
9
|
-
import "./Field.vue_vue_type_script_setup_true_lang-
|
|
9
|
+
import "./Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js";
|
|
10
10
|
import "lodash-es/uniqueId";
|
|
11
11
|
import "./Label.vue_vue_type_script_setup_true_lang-4b02087f.js";
|
|
12
12
|
import "./Icon.js";
|
package/dist/DataViewFilters.js
CHANGED
|
@@ -26,7 +26,7 @@ import "./Backdrop.js";
|
|
|
26
26
|
import "./Input.js";
|
|
27
27
|
import "lodash-es/isNil";
|
|
28
28
|
import "./utils/i18n.js";
|
|
29
|
-
import "./Field.vue_vue_type_script_setup_true_lang-
|
|
29
|
+
import "./Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js";
|
|
30
30
|
function Pe({
|
|
31
31
|
schema: a,
|
|
32
32
|
dataViewRef: w
|
package/dist/DatePicker.js
CHANGED
|
@@ -20,7 +20,7 @@ import "./index-79ce320f.js";
|
|
|
20
20
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
21
21
|
import "lodash-es/isNil";
|
|
22
22
|
import "./utils/i18n.js";
|
|
23
|
-
import "./Field.vue_vue_type_script_setup_true_lang-
|
|
23
|
+
import "./Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js";
|
|
24
24
|
import "./Label.vue_vue_type_script_setup_true_lang-4b02087f.js";
|
|
25
25
|
function Uf(e, t) {
|
|
26
26
|
he(2, arguments);
|
package/dist/Dialog.js
CHANGED
|
@@ -30,42 +30,42 @@ const R = ["open", "aria-labelledby", "data-test", "onKeydown"], U = ["id"], W =
|
|
|
30
30
|
},
|
|
31
31
|
emits: ["update:open", "cancel"],
|
|
32
32
|
setup(M, { emit: y }) {
|
|
33
|
-
const t = M,
|
|
33
|
+
const t = M, b = Z(), i = z(), n = A(), g = G("dialog-header-"), d = C(!1), k = C(), E = l(() => t.confirmText || (t.alert ? c("ll.okay") : c("ll.confirm"))), h = l(() => !!b.default || t.description), N = l(
|
|
34
34
|
() => t.status ? B[S(t.status)] : B.Info
|
|
35
|
-
),
|
|
35
|
+
), v = l(
|
|
36
36
|
() => t.status ? I[S(t.status)] : I.Info
|
|
37
37
|
), V = l(() => t.dangerZone || t.status === J.Error);
|
|
38
|
-
function
|
|
38
|
+
function w() {
|
|
39
39
|
y("update:open", !1), y("cancel");
|
|
40
40
|
}
|
|
41
41
|
async function $(u) {
|
|
42
|
-
|
|
43
|
-
const x =
|
|
44
|
-
await x(u),
|
|
42
|
+
d.value = !0;
|
|
43
|
+
const x = i.onConfirm;
|
|
44
|
+
await x(u), d.value = !1;
|
|
45
45
|
}
|
|
46
46
|
return H(() => {
|
|
47
47
|
t.open && L(function() {
|
|
48
|
-
|
|
48
|
+
k.value.focus();
|
|
49
49
|
});
|
|
50
50
|
}), (u, x) => (s(), f(q, { name: "fade" }, {
|
|
51
51
|
default: m(() => [
|
|
52
52
|
t.open ? (s(), p("dialog", P({
|
|
53
53
|
key: 0,
|
|
54
54
|
ref_key: "root",
|
|
55
|
-
ref:
|
|
55
|
+
ref: k,
|
|
56
56
|
open: t.open,
|
|
57
57
|
tabindex: "0",
|
|
58
|
-
"aria-labelledby": e(
|
|
58
|
+
"aria-labelledby": e(g),
|
|
59
59
|
"aria-modal": "true",
|
|
60
60
|
class: e(n).dialog,
|
|
61
|
-
"data-test": e(
|
|
62
|
-
}, e(
|
|
63
|
-
onKeydown: Y(
|
|
61
|
+
"data-test": e(i)["data-test"] || "ll-dialog"
|
|
62
|
+
}, e(i), {
|
|
63
|
+
onKeydown: Y(w, ["esc"])
|
|
64
64
|
}), [
|
|
65
65
|
a("div", {
|
|
66
66
|
class: o([
|
|
67
67
|
e(n).body,
|
|
68
|
-
`tw-border-${
|
|
68
|
+
`tw-border-${v.value}`,
|
|
69
69
|
{
|
|
70
70
|
"tw-border-t-6": t.status
|
|
71
71
|
}
|
|
@@ -75,28 +75,28 @@ const R = ["open", "aria-labelledby", "data-test", "onKeydown"], U = ["id"], W =
|
|
|
75
75
|
class: o(e(n).content)
|
|
76
76
|
}, [
|
|
77
77
|
a("div", {
|
|
78
|
-
class: o(["tw-flex tw-items-center",
|
|
78
|
+
class: o(["tw-flex tw-items-center", h.value && "tw-mb-1.5"])
|
|
79
79
|
}, [
|
|
80
80
|
t.status ? (s(), f(O, {
|
|
81
81
|
key: 0,
|
|
82
82
|
"data-test": "dialog-status-icon",
|
|
83
83
|
name: N.value,
|
|
84
|
-
class: o(`tw-text-${
|
|
84
|
+
class: o(`tw-text-${v.value}`)
|
|
85
85
|
}, null, 8, ["name", "class"])) : r("", !0),
|
|
86
86
|
a("h3", {
|
|
87
|
-
id: e(
|
|
87
|
+
id: e(g),
|
|
88
88
|
class: o({ "tw-ml-1.5 tw-mt-px": t.status })
|
|
89
89
|
}, _(t.header), 11, U)
|
|
90
90
|
], 2),
|
|
91
|
-
|
|
92
|
-
e(
|
|
91
|
+
h.value ? (s(), p("p", W, [
|
|
92
|
+
e(b).default ? j(u.$slots, "default", { key: 0 }) : (s(), p("span", {
|
|
93
93
|
key: 1,
|
|
94
94
|
innerHTML: t.description
|
|
95
95
|
}, null, 8, X))
|
|
96
96
|
])) : r("", !0)
|
|
97
97
|
], 2),
|
|
98
98
|
a("footer", {
|
|
99
|
-
class: o(
|
|
99
|
+
class: o(e(n).footer)
|
|
100
100
|
}, [
|
|
101
101
|
a("div", tt, [
|
|
102
102
|
a("div", {
|
|
@@ -106,7 +106,7 @@ const R = ["open", "aria-labelledby", "data-test", "onKeydown"], U = ["id"], W =
|
|
|
106
106
|
key: 0,
|
|
107
107
|
"data-test": "button|cancel",
|
|
108
108
|
secondary: "",
|
|
109
|
-
onClick:
|
|
109
|
+
onClick: w
|
|
110
110
|
}, {
|
|
111
111
|
default: m(() => [
|
|
112
112
|
T(_(t.cancelText), 1)
|
|
@@ -115,7 +115,7 @@ const R = ["open", "aria-labelledby", "data-test", "onKeydown"], U = ["id"], W =
|
|
|
115
115
|
})),
|
|
116
116
|
F(D, {
|
|
117
117
|
"data-test": "button|confirm",
|
|
118
|
-
disabled: t.disabled ||
|
|
118
|
+
disabled: t.disabled || d.value,
|
|
119
119
|
color: V.value ? "red" : "blue",
|
|
120
120
|
class: o({
|
|
121
121
|
"tw-w-full": t.alert
|
|
@@ -144,8 +144,8 @@ const R = ["open", "aria-labelledby", "data-test", "onKeydown"], U = ["id"], W =
|
|
|
144
144
|
footer: nt
|
|
145
145
|
}, ct = {
|
|
146
146
|
$style: rt
|
|
147
|
-
},
|
|
147
|
+
}, vt = /* @__PURE__ */ Q(et, [["__cssModules", ct]]);
|
|
148
148
|
export {
|
|
149
|
-
|
|
149
|
+
vt as default
|
|
150
150
|
};
|
|
151
151
|
//# sourceMappingURL=Dialog.js.map
|
package/dist/Dialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sources":["../src/components/Dialog/Dialog.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import capitalize from 'lodash-es/capitalize';\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, nextTick, ref, useAttrs, useCssModule, useSlots, watchEffect } from 'vue';\n\n import {\n StatusColor,\n StatusColors,\n StatusIcon,\n StatusIcons,\n StatusSeverities,\n StatusSeverity,\n } from '../../../types/statusLevels';\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n\n export interface DialogProps {\n /**\n * Shows or hides the dialog.\n * Usage: v-model:open=\"isOpen\"\n */\n open?: boolean;\n\n /**\n * Whether the confirmation button is enabled or not.\n */\n disabled?: boolean;\n\n /**\n * Is this a dangerous action? Will turn the confirmation button red.\n */\n dangerZone?: boolean;\n\n /**\n * Header text.\n */\n header?: string;\n\n /**\n * Description text.\n */\n description?: string;\n\n /**\n * Cancel button text.\n */\n cancelText?: string;\n\n /**\n * Confirm button text.\n */\n confirmText?: string;\n\n /**\n * Treats it like an Alert Dialog, with only the confirmation button showing.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/alert}\n */\n alert?: boolean;\n\n /**\n * Adds a top accent border and icon next to the header.\n * This behaves similarly to the Alert component in respect to the levels, icons, and colors\n * passing `error` will treat the dialog the same as `dangerZone`\n */\n status?: StatusSeverity;\n }\n\n const props = withDefaults(defineProps<DialogProps>(), {\n open: false,\n disabled: false,\n dangerZone: false,\n header: t('ll.areYouSure'),\n description: '',\n cancelText: t('ll.cancel'),\n confirmText: '',\n alert: false,\n status: undefined,\n });\n\n defineOptions({\n name: 'll-dialog',\n inheritAttrs: false,\n });\n\n const emits =\n defineEmits<{\n (e: 'update:open', value: boolean): void;\n (e: 'cancel'): void;\n }>();\n\n const slots = useSlots();\n const attrs = useAttrs();\n const classes = useCssModule();\n const headerId = uniqueId('dialog-header-');\n\n const isConfirming = ref(false);\n const root = ref();\n\n /**\n * Set the default confirm button text to \"Confirm\".\n * If the `alert` prop is true, the default text is \"Okay\".\n * If the `confirmText` prop is provided, `confirmText` is used whether or not\n * the alert prop is true.\n */\n const modifiedConfirmText = computed(() => props.confirmText || (props.alert ? t('ll.okay') : t('ll.confirm')));\n\n const hasDescription = computed(() => !!slots.default || props.description);\n\n const statusIcon = computed<StatusIcon>(() =>\n props.status ? StatusIcons[capitalize(props.status)] : StatusIcons.Info,\n );\n const statusColor = computed<StatusColor>(() =>\n props.status ? StatusColors[capitalize(props.status)] : StatusColors.Info,\n );\n\n const computedDangerZone = computed(() => props.dangerZone || props.status === StatusSeverities.Error);\n\n function cancel() {\n emits('update:open', false);\n emits('cancel');\n }\n\n async function handleConfirm(event: Event) {\n isConfirming.value = true;\n\n // useAttrs returns a Record<string, unknown> type, which causes\n // TS errors when trying to call a passed listener\n const onConfirm = attrs.onConfirm as (event: Event) => void;\n\n // Call the parent confirm listener and await it. Using Async/Await lets\n // us await even non-promises. Pass the event so modifiers can work.\n await onConfirm(event);\n isConfirming.value = false;\n }\n\n watchEffect(() => {\n if (props.open) {\n // Move focus to confirm button\n nextTick(function () {\n root.value.focus();\n });\n }\n });\n</script>\n\n<template>\n <transition name=\"fade\">\n <dialog\n v-if=\"props.open\"\n ref=\"root\"\n :open=\"props.open\"\n tabindex=\"0\"\n :aria-labelledby=\"headerId\"\n aria-modal=\"true\"\n :class=\"classes.dialog\"\n :data-test=\"attrs['data-test'] || 'll-dialog'\"\n v-bind=\"attrs\"\n @keydown.esc=\"cancel\"\n >\n <div\n :class=\"[\n classes.body,\n `tw-border-${statusColor}`,\n {\n 'tw-border-t-6': props.status,\n },\n ]\"\n >\n <div :class=\"classes.content\">\n <div class=\"tw-flex tw-items-center\" :class=\"hasDescription && 'tw-mb-1.5'\">\n <Icon\n v-if=\"props.status\"\n data-test=\"dialog-status-icon\"\n :name=\"statusIcon\"\n :class=\"`tw-text-${statusColor}`\"\n />\n <h3 :id=\"headerId\" :class=\"{ 'tw-ml-1.5 tw-mt-px': props.status }\">{{ props.header }}</h3>\n </div>\n\n <p v-if=\"hasDescription\" class=\"tw-mb-0\">\n <slot v-if=\"slots.default\"></slot>\n <!-- eslint-disable-next-line vue/no-v-html -->\n <span v-else v-html=\"props.description\"></span>\n </p>\n </div>\n\n <footer :class=\"classes.footer\"
|
|
1
|
+
{"version":3,"file":"Dialog.js","sources":["../src/components/Dialog/Dialog.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import capitalize from 'lodash-es/capitalize';\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, nextTick, ref, useAttrs, useCssModule, useSlots, watchEffect } from 'vue';\n\n import {\n StatusColor,\n StatusColors,\n StatusIcon,\n StatusIcons,\n StatusSeverities,\n StatusSeverity,\n } from '../../../types/statusLevels';\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n\n export interface DialogProps {\n /**\n * Shows or hides the dialog.\n * Usage: v-model:open=\"isOpen\"\n */\n open?: boolean;\n\n /**\n * Whether the confirmation button is enabled or not.\n */\n disabled?: boolean;\n\n /**\n * Is this a dangerous action? Will turn the confirmation button red.\n */\n dangerZone?: boolean;\n\n /**\n * Header text.\n */\n header?: string;\n\n /**\n * Description text.\n */\n description?: string;\n\n /**\n * Cancel button text.\n */\n cancelText?: string;\n\n /**\n * Confirm button text.\n */\n confirmText?: string;\n\n /**\n * Treats it like an Alert Dialog, with only the confirmation button showing.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/alert}\n */\n alert?: boolean;\n\n /**\n * Adds a top accent border and icon next to the header.\n * This behaves similarly to the Alert component in respect to the levels, icons, and colors\n * passing `error` will treat the dialog the same as `dangerZone`\n */\n status?: StatusSeverity;\n }\n\n const props = withDefaults(defineProps<DialogProps>(), {\n open: false,\n disabled: false,\n dangerZone: false,\n header: t('ll.areYouSure'),\n description: '',\n cancelText: t('ll.cancel'),\n confirmText: '',\n alert: false,\n status: undefined,\n });\n\n defineOptions({\n name: 'll-dialog',\n inheritAttrs: false,\n });\n\n const emits =\n defineEmits<{\n (e: 'update:open', value: boolean): void;\n (e: 'cancel'): void;\n }>();\n\n const slots = useSlots();\n const attrs = useAttrs();\n const classes = useCssModule();\n const headerId = uniqueId('dialog-header-');\n\n const isConfirming = ref(false);\n const root = ref();\n\n /**\n * Set the default confirm button text to \"Confirm\".\n * If the `alert` prop is true, the default text is \"Okay\".\n * If the `confirmText` prop is provided, `confirmText` is used whether or not\n * the alert prop is true.\n */\n const modifiedConfirmText = computed(() => props.confirmText || (props.alert ? t('ll.okay') : t('ll.confirm')));\n\n const hasDescription = computed(() => !!slots.default || props.description);\n\n const statusIcon = computed<StatusIcon>(() =>\n props.status ? StatusIcons[capitalize(props.status)] : StatusIcons.Info,\n );\n const statusColor = computed<StatusColor>(() =>\n props.status ? StatusColors[capitalize(props.status)] : StatusColors.Info,\n );\n\n const computedDangerZone = computed(() => props.dangerZone || props.status === StatusSeverities.Error);\n\n function cancel() {\n emits('update:open', false);\n emits('cancel');\n }\n\n async function handleConfirm(event: Event) {\n isConfirming.value = true;\n\n // useAttrs returns a Record<string, unknown> type, which causes\n // TS errors when trying to call a passed listener\n const onConfirm = attrs.onConfirm as (event: Event) => void;\n\n // Call the parent confirm listener and await it. Using Async/Await lets\n // us await even non-promises. Pass the event so modifiers can work.\n await onConfirm(event);\n isConfirming.value = false;\n }\n\n watchEffect(() => {\n if (props.open) {\n // Move focus to confirm button\n nextTick(function () {\n root.value.focus();\n });\n }\n });\n</script>\n\n<template>\n <transition name=\"fade\">\n <dialog\n v-if=\"props.open\"\n ref=\"root\"\n :open=\"props.open\"\n tabindex=\"0\"\n :aria-labelledby=\"headerId\"\n aria-modal=\"true\"\n :class=\"classes.dialog\"\n :data-test=\"attrs['data-test'] || 'll-dialog'\"\n v-bind=\"attrs\"\n @keydown.esc=\"cancel\"\n >\n <div\n :class=\"[\n classes.body,\n `tw-border-${statusColor}`,\n {\n 'tw-border-t-6': props.status,\n },\n ]\"\n >\n <div :class=\"classes.content\">\n <div class=\"tw-flex tw-items-center\" :class=\"hasDescription && 'tw-mb-1.5'\">\n <Icon\n v-if=\"props.status\"\n data-test=\"dialog-status-icon\"\n :name=\"statusIcon\"\n :class=\"`tw-text-${statusColor}`\"\n />\n <h3 :id=\"headerId\" :class=\"{ 'tw-ml-1.5 tw-mt-px': props.status }\">{{ props.header }}</h3>\n </div>\n\n <p v-if=\"hasDescription\" class=\"tw-mb-0\">\n <slot v-if=\"slots.default\"></slot>\n <!-- eslint-disable-next-line vue/no-v-html -->\n <span v-else v-html=\"props.description\"></span>\n </p>\n </div>\n\n <footer :class=\"classes.footer\">\n <div class=\"tw-text-right\">\n <div :class=\"{ 'button-grid': !props.alert }\">\n <Button v-if=\"!props.alert\" data-test=\"button|cancel\" secondary @click=\"cancel\">\n {{ props.cancelText }}\n </Button>\n\n <Button\n data-test=\"button|confirm\"\n :disabled=\"props.disabled || isConfirming\"\n :color=\"computedDangerZone ? 'red' : 'blue'\"\n :class=\"{\n 'tw-w-full': props.alert,\n }\"\n @click=\"handleConfirm\"\n >\n {{ modifiedConfirmText }}\n </Button>\n </div>\n </div>\n </footer>\n </div>\n </dialog>\n </transition>\n</template>\n\n<style module>\n .dialog {\n background: rgb(0 0 0 / 30%);\n bottom: 0;\n display: flex;\n flex-direction: column;\n left: 0;\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n place-content: center;\n position: fixed;\n right: 0;\n top: 0;\n z-index: theme('zIndex.dialog');\n width: 100%;\n height: 100vh;\n }\n\n .body {\n @apply tw-shadow;\n\n background: var(--color-white);\n color: var(--color-ice-700);\n display: flex;\n flex-direction: column;\n margin: 0 auto;\n max-height: 100vh;\n max-width: 360px;\n transition: transform theme('transitionDuration.150') theme('transitionTimingFunction.swing');\n width: 100%;\n\n &.grey {\n background: var(--color-ice-200);\n border-radius: theme('borderRadius.DEFAULT');\n }\n\n @media screen('md') {\n border-radius: theme('borderRadius.DEFAULT');\n }\n }\n\n .content {\n flex-grow: 1;\n padding: theme('spacing.6') var(--grid-gutter);\n }\n\n .footer {\n background: var(--color-ice-200);\n border-top: theme('borderWidth.DEFAULT') solid var(--color-ice-500);\n display: initial; /* TEMP. Will need to fix marketplace `footer` style */\n padding: theme('spacing.6') var(--grid-gutter);\n\n @media screen('md') {\n border-bottom-left-radius: theme('borderRadius.DEFAULT');\n border-bottom-right-radius: theme('borderRadius.DEFAULT');\n }\n }\n\n :global(.fade-enter-from),\n :global(.fade-leave-active) {\n .body {\n transform: translate3d(0, theme('spacing.3'), 0);\n }\n }\n</style>\n"],"names":["slots","useSlots","attrs","useAttrs","classes","useCssModule","headerId","uniqueId","isConfirming","ref","root","modifiedConfirmText","computed","props","t","hasDescription","statusIcon","StatusIcons","capitalize","statusColor","StatusColors","computedDangerZone","StatusSeverities","cancel","emits","handleConfirm","event","onConfirm","watchEffect","nextTick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4FQA,IAAQC,KACRC,IAAQC,KACRC,IAAUC,KACVC,IAAWC,EAAS,gBAAgB,GAEpCC,IAAeC,EAAI,EAAK,GACxBC,IAAOD,KAQPE,IAAsBC,EAAS,MAAMC,EAAM,gBAAgBA,EAAM,QAAQC,EAAE,SAAS,IAAIA,EAAE,YAAY,EAAE,GAExGC,IAAiBH,EAAS,MAAM,CAAC,CAACZ,EAAM,WAAWa,EAAM,WAAW,GAEpEG,IAAaJ;AAAA,MAAqB,MACtCC,EAAM,SAASI,EAAYC,EAAWL,EAAM,MAAM,CAAC,IAAII,EAAY;AAAA,IAAA,GAE/DE,IAAcP;AAAA,MAAsB,MACxCC,EAAM,SAASO,EAAaF,EAAWL,EAAM,MAAM,CAAC,IAAIO,EAAa;AAAA,IAAA,GAGjEC,IAAqBT,EAAS,MAAMC,EAAM,cAAcA,EAAM,WAAWS,EAAiB,KAAK;AAErG,aAASC,IAAS;AAChB,MAAAC,EAAM,eAAe,EAAK,GAC1BA,EAAM,QAAQ;AAAA,IAChB;AAEA,mBAAeC,EAAcC,GAAc;AACzC,MAAAlB,EAAa,QAAQ;AAIrB,YAAMmB,IAAYzB,EAAM;AAIxB,YAAMyB,EAAUD,CAAK,GACrBlB,EAAa,QAAQ;AAAA,IACvB;AAEA,WAAAoB,EAAY,MAAM;AAChB,MAAIf,EAAM,QAERgB,EAAS,WAAY;AACnB,QAAAnB,EAAK,MAAM;MAAM,CAClB;AAAA,IACH,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/Field.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as o } from "./Field.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { _ as o } from "./Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js";
|
|
2
2
|
import "vue";
|
|
3
3
|
import "lodash-es/uniqueId";
|
|
4
4
|
import "./Label.vue_vue_type_script_setup_true_lang-4b02087f.js";
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { defineComponent as _, useAttrs as T, useSlots as k, computed as l, openBlock as s, createBlock as w, resolveDynamicComponent as B, mergeProps as O, unref as f, withCtx as m, normalizeClass as R, createTextVNode as q, toDisplayString as h, createCommentVNode as v, createElementBlock as o, renderSlot as u } from "vue";
|
|
2
|
+
import p from "lodash-es/uniqueId";
|
|
3
|
+
import { _ as E } from "./Label.vue_vue_type_script_setup_true_lang-4b02087f.js";
|
|
4
|
+
const L = ["aria-labelledby"], S = ["id"], C = {
|
|
5
|
+
key: 4,
|
|
6
|
+
class: "stash-field-hint tw-mt-1 tw-block tw-whitespace-pre-line tw-text-xs",
|
|
7
|
+
"data-test": "stash-field-hint"
|
|
8
|
+
}, g = {
|
|
9
|
+
key: 5,
|
|
10
|
+
class: "stash-field-hint tw-mt-1 tw-whitespace-pre-line tw-text-xs",
|
|
11
|
+
"data-test": "stash-field-hint"
|
|
12
|
+
}, N = /* @__PURE__ */ _({
|
|
13
|
+
inheritAttrs: !1,
|
|
14
|
+
__name: "Field",
|
|
15
|
+
props: {
|
|
16
|
+
addBottomSpace: { type: Boolean, default: !1 },
|
|
17
|
+
errorText: { default: void 0 },
|
|
18
|
+
hintText: { default: void 0 },
|
|
19
|
+
id: { default: void 0 },
|
|
20
|
+
errorId: { default: void 0 },
|
|
21
|
+
isReadOnly: { type: Boolean },
|
|
22
|
+
isRequired: { type: Boolean, default: !1 },
|
|
23
|
+
label: { default: void 0 },
|
|
24
|
+
showOptionalInLabel: { type: Boolean, default: !1 },
|
|
25
|
+
fieldset: { type: Boolean, default: !1 }
|
|
26
|
+
},
|
|
27
|
+
setup(b) {
|
|
28
|
+
const e = b, y = T(), r = k(), i = l(() => e.id || p("stash-field-")), d = l(() => e.errorId || p("stash-field-error-")), a = l(() => p("stash-field-label-")), n = l(() => !!e.errorText), I = l(() => e.fieldset ? "fieldset" : "div"), x = l(() => {
|
|
29
|
+
const { placeholder: t, ...c } = y;
|
|
30
|
+
return c;
|
|
31
|
+
});
|
|
32
|
+
return (t, c) => (s(), w(B(I.value), O({
|
|
33
|
+
"data-test": "stash-field",
|
|
34
|
+
class: ["stash-field", [
|
|
35
|
+
{ "tw-p-0": e.fieldset },
|
|
36
|
+
{ "tw-mb-9": e.addBottomSpace && !e.errorText && !e.hintText && !f(r).hint },
|
|
37
|
+
{ "tw-mb-4": e.addBottomSpace && (e.errorText || e.hintText || f(r).hint) }
|
|
38
|
+
]]
|
|
39
|
+
}, x.value), {
|
|
40
|
+
default: m(() => [
|
|
41
|
+
e.label ? (s(), w(E, {
|
|
42
|
+
key: 0,
|
|
43
|
+
id: a.value,
|
|
44
|
+
class: R({ "tw-mb-1.5": !!e.isReadOnly }),
|
|
45
|
+
for: i.value,
|
|
46
|
+
"has-error": n.value,
|
|
47
|
+
"is-required": t.isRequired,
|
|
48
|
+
"show-optional": e.showOptionalInLabel,
|
|
49
|
+
legend: e.fieldset
|
|
50
|
+
}, {
|
|
51
|
+
default: m(() => [
|
|
52
|
+
q(h(e.label), 1)
|
|
53
|
+
]),
|
|
54
|
+
_: 1
|
|
55
|
+
}, 8, ["id", "class", "for", "has-error", "is-required", "show-optional", "legend"])) : v("", !0),
|
|
56
|
+
e.isReadOnly ? (s(), o("div", {
|
|
57
|
+
key: 1,
|
|
58
|
+
"aria-labelledby": a.value
|
|
59
|
+
}, [
|
|
60
|
+
u(t.$slots, "default", {
|
|
61
|
+
fieldId: i.value,
|
|
62
|
+
fieldErrorId: d.value,
|
|
63
|
+
hasError: n.value,
|
|
64
|
+
isRequired: t.isRequired,
|
|
65
|
+
labelId: a.value,
|
|
66
|
+
showOptionalInLabel: e.showOptionalInLabel
|
|
67
|
+
})
|
|
68
|
+
], 8, L)) : u(t.$slots, "default", {
|
|
69
|
+
key: 2,
|
|
70
|
+
fieldId: i.value,
|
|
71
|
+
fieldErrorId: d.value,
|
|
72
|
+
hasError: n.value,
|
|
73
|
+
isRequired: t.isRequired,
|
|
74
|
+
labelId: a.value,
|
|
75
|
+
showOptionalInLabel: e.showOptionalInLabel
|
|
76
|
+
}),
|
|
77
|
+
e.errorText ? (s(), o("span", {
|
|
78
|
+
key: 3,
|
|
79
|
+
id: d.value,
|
|
80
|
+
class: "stash-field-error tw-mt-1 tw-block tw-whitespace-pre-line tw-text-xs tw-text-red-500",
|
|
81
|
+
"data-test": "stash-field-error"
|
|
82
|
+
}, h(e.errorText), 9, S)) : e.hintText && !e.isReadOnly ? (s(), o("span", C, h(e.hintText), 1)) : f(r).hint && !e.isReadOnly ? (s(), o("div", g, [
|
|
83
|
+
u(t.$slots, "hint")
|
|
84
|
+
])) : v("", !0)
|
|
85
|
+
]),
|
|
86
|
+
_: 3
|
|
87
|
+
}, 16, ["class"]));
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
export {
|
|
91
|
+
N as _
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js","sources":["../src/components/Field/Field.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, useAttrs, useSlots } from 'vue';\n\n import Label from '../Label/Label.vue';\n\n defineOptions({\n inheritAttrs: false,\n });\n\n export interface FieldProps {\n /**\n * Adds spacing under the field that is consistent whether hint/error text is displayed.\n */\n addBottomSpace?: boolean;\n\n /**\n * Error text to display. Replaces `hintText` (if provided) & adds error styling.\n */\n errorText?: string;\n\n /**\n * Displays text below the input; hidden when the isReadOnly prop is truthy.\n */\n hintText?: string;\n\n /**\n * ID for the Label and Input; must be unique\n */\n id?: string;\n\n /**\n * ID for the error text element; useful for aria-errormessage\n */\n errorId?: string;\n\n /**\n * Whether it's a readonly field.\n */\n isReadOnly?: boolean;\n\n /**\n * Whether the field is required.\n */\n isRequired?: boolean;\n\n /**\n * Label to render above the input.\n */\n label?: string;\n\n /**\n * Show \"(optional)\" to the right of the label text\n */\n showOptionalInLabel?: boolean;\n\n /**\n * Indicates wheter the field is a fieldset or not\n */\n fieldset?: boolean;\n }\n\n const props = withDefaults(defineProps<FieldProps>(), {\n addBottomSpace: false,\n errorText: undefined,\n hintText: undefined,\n id: undefined,\n errorId: undefined,\n isRequired: false,\n label: undefined,\n showOptionalInLabel: false,\n fieldset: false,\n });\n const attrs = useAttrs();\n const slots = useSlots();\n const fieldId = computed(() => props.id || uniqueId('stash-field-'));\n const fieldErrorId = computed(() => props.errorId || uniqueId('stash-field-error-'));\n const labelId = computed(() => uniqueId('stash-field-label-'));\n const hasError = computed(() => !!props.errorText);\n const wrapperElement = computed(() => (props.fieldset ? 'fieldset' : 'div'));\n\n // Any attributes that are unique to form elements, you want to exclude from\n // being bound from the root element.\n const rootAttrs = computed(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { placeholder, ...otherAttrs } = attrs;\n\n return otherAttrs;\n });\n</script>\n\n<template>\n <component\n :is=\"wrapperElement\"\n data-test=\"stash-field\"\n class=\"stash-field\"\n :class=\"[\n { 'tw-p-0': props.fieldset },\n { 'tw-mb-9': props.addBottomSpace && !props.errorText && !props.hintText && !slots.hint },\n { 'tw-mb-4': props.addBottomSpace && (props.errorText || props.hintText || slots.hint) },\n ]\"\n v-bind=\"rootAttrs\"\n >\n <Label\n v-if=\"props.label\"\n :id=\"labelId\"\n :class=\"{ 'tw-mb-1.5': !!props.isReadOnly }\"\n :for=\"fieldId\"\n :has-error=\"hasError\"\n :is-required=\"isRequired\"\n :show-optional=\"props.showOptionalInLabel\"\n :legend=\"props.fieldset\"\n >\n {{ props.label }}\n </Label>\n\n <!-- @slot for the form field; the Label can also be rendered here instead of using the label prop -->\n <template v-if=\"props.isReadOnly\">\n <div :aria-labelledby=\"labelId\">\n <slot\n :field-id=\"fieldId\"\n :field-error-id=\"fieldErrorId\"\n :has-error=\"hasError\"\n :is-required=\"isRequired\"\n :label-id=\"labelId\"\n :show-optional-in-label=\"props.showOptionalInLabel\"\n ></slot>\n </div>\n </template>\n <template v-else>\n <slot\n :field-id=\"fieldId\"\n :field-error-id=\"fieldErrorId\"\n :has-error=\"hasError\"\n :is-required=\"isRequired\"\n :label-id=\"labelId\"\n :show-optional-in-label=\"props.showOptionalInLabel\"\n ></slot>\n </template>\n\n <span\n v-if=\"props.errorText\"\n :id=\"fieldErrorId\"\n class=\"stash-field-error tw-mt-1 tw-block tw-whitespace-pre-line tw-text-xs tw-text-red-500\"\n data-test=\"stash-field-error\"\n >\n {{ props.errorText }}\n </span>\n\n <span\n v-else-if=\"props.hintText && !props.isReadOnly\"\n class=\"stash-field-hint tw-mt-1 tw-block tw-whitespace-pre-line tw-text-xs\"\n data-test=\"stash-field-hint\"\n >\n {{ props.hintText }}\n </span>\n\n <div\n v-else-if=\"slots.hint && !props.isReadOnly\"\n class=\"stash-field-hint tw-mt-1 tw-whitespace-pre-line tw-text-xs\"\n data-test=\"stash-field-hint\"\n >\n <!-- @slot for displaying hint text below the field -->\n <slot name=\"hint\"></slot>\n </div>\n </component>\n</template>\n"],"names":["attrs","useAttrs","slots","useSlots","fieldId","computed","props","uniqueId","fieldErrorId","labelId","hasError","wrapperElement","rootAttrs","placeholder","otherAttrs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyEQA,IAAQC,KACRC,IAAQC,KACRC,IAAUC,EAAS,MAAMC,EAAM,MAAMC,EAAS,cAAc,CAAC,GAC7DC,IAAeH,EAAS,MAAMC,EAAM,WAAWC,EAAS,oBAAoB,CAAC,GAC7EE,IAAUJ,EAAS,MAAME,EAAS,oBAAoB,CAAC,GACvDG,IAAWL,EAAS,MAAM,CAAC,CAACC,EAAM,SAAS,GAC3CK,IAAiBN,EAAS,MAAOC,EAAM,WAAW,aAAa,KAAM,GAIrEM,IAAYP,EAAS,MAAM;AAE/B,YAAM,EAAE,aAAAQ,GAAa,GAAGC,EAAA,IAAed;AAEhC,aAAAc;AAAA,IAAA,CACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/FilterSelect.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as S, computed as p, openBlock as r, createBlock as $, withCtx as u, createElementVNode as s, createElementBlock as d, withDirectives as f, vModelCheckbox as v, createVNode as _, withKeys as h, createTextVNode as b, toDisplayString as x, unref as C, createCommentVNode as K, Fragment as A, renderList as B } from "vue";
|
|
2
2
|
import { t as E } from "./locale.js";
|
|
3
|
-
import { _ as N } from "./Field.vue_vue_type_script_setup_true_lang-
|
|
3
|
+
import { _ as N } from "./Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js";
|
|
4
4
|
import y from "./FilterChip.js";
|
|
5
5
|
import "lodash-es/get";
|
|
6
6
|
import "lodash-es/uniqueId";
|
package/dist/Filters.js
CHANGED
|
@@ -38,7 +38,7 @@ import "./index-79ce320f.js";
|
|
|
38
38
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
39
39
|
import "lodash-es/isNil";
|
|
40
40
|
import "./utils/i18n.js";
|
|
41
|
-
import "./Field.vue_vue_type_script_setup_true_lang-
|
|
41
|
+
import "./Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js";
|
|
42
42
|
import "./Label.vue_vue_type_script_setup_true_lang-4b02087f.js";
|
|
43
43
|
import "lodash-es/isEmpty";
|
|
44
44
|
import "lodash-es/isEqual";
|
package/dist/InlineEdit.js
CHANGED
|
@@ -5,7 +5,7 @@ import "./constants.js";
|
|
|
5
5
|
import "./locale.js";
|
|
6
6
|
import "lodash-es/get";
|
|
7
7
|
import "lodash-es/isNil";
|
|
8
|
-
import "./Field.vue_vue_type_script_setup_true_lang-
|
|
8
|
+
import "./Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js";
|
|
9
9
|
import "lodash-es/uniqueId";
|
|
10
10
|
import "./Label.vue_vue_type_script_setup_true_lang-4b02087f.js";
|
|
11
11
|
import "./Icon.js";
|
package/dist/Input.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as P, useSlots as U, useCssModule as G, useAttrs as L, ref as f, computed as v, watchEffect as O, onMounted as W, openBlock as m, createBlock as g, mergeProps as V, unref as o, createSlots as j, withCtx as k, createElementVNode as N, withDirectives as q, vModelDynamic as H, createElementBlock as x, normalizeClass as C, renderSlot as y, createCommentVNode as I } from "vue";
|
|
2
2
|
import $ from "lodash-es/isNil";
|
|
3
3
|
import { convertDecimal as B, sanitizeDecimal as J, decimalSeparator as _ } from "./utils/i18n.js";
|
|
4
|
-
import { _ as K } from "./Field.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { _ as K } from "./Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js";
|
|
5
5
|
import Q from "./Icon.js";
|
|
6
6
|
import { _ as R } from "./_plugin-vue_export-helper-dad06003.js";
|
|
7
7
|
import "./constants.js";
|
package/dist/InputOptions.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as B, useAttrs as S, useSlots as k, useCssModule as T, ref as d, computed as c, watchEffect as $, watch as v, openBlock as b, createBlock as E, mergeProps as m, createSlots as A, withCtx as f, createElementVNode as M, normalizeClass as O, unref as u, createVNode as h, renderSlot as z } from "vue";
|
|
2
|
-
import { _ as F } from "./Field.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { _ as F } from "./Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js";
|
|
3
3
|
import N from "./Input.js";
|
|
4
4
|
import U from "./Select.js";
|
|
5
5
|
import { _ as P } from "./_plugin-vue_export-helper-dad06003.js";
|
package/dist/ListView.js
CHANGED
|
@@ -46,7 +46,7 @@ import "./utils/formatDateTime.js";
|
|
|
46
46
|
import "./utils/normalizeDate.js";
|
|
47
47
|
import "./toTimeZone-e6e9ab75.js";
|
|
48
48
|
import "./InputOptions.js";
|
|
49
|
-
import "./Field.vue_vue_type_script_setup_true_lang-
|
|
49
|
+
import "./Field.vue_vue_type_script_setup_true_lang-e1e4ff03.js";
|
|
50
50
|
import "./Label.vue_vue_type_script_setup_true_lang-4b02087f.js";
|
|
51
51
|
import "./Select.js";
|
|
52
52
|
import "lodash-es/isEmpty";
|