@leaflink/stash 44.1.1 → 44.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/InputOptions.js +54 -53
- package/dist/InputOptions.js.map +1 -1
- package/dist/InputOptions.vue.d.ts +0 -2
- package/dist/Select.js +2 -2
- package/dist/Select.js.map +1 -1
- package/dist/Select.vue.d.ts +1 -1
- package/dist/Step.js +53 -49
- package/dist/Step.js.map +1 -1
- package/dist/Step.vue.d.ts +8 -1
- package/dist/Stepper.js +7 -7
- package/dist/Stepper.js.map +1 -1
- package/dist/components.css +1 -1
- package/package.json +3 -3
package/dist/InputOptions.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as B, useAttrs as S, useSlots as
|
|
2
|
-
import { _ as
|
|
3
|
-
import
|
|
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-42ba3c5a.js";
|
|
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";
|
|
6
6
|
import "lodash-es/uniqueId";
|
|
@@ -28,10 +28,9 @@ import "./clickoutside.js";
|
|
|
28
28
|
import "./MenusPlugin-5e93f0a5.js";
|
|
29
29
|
import "./Chip.js";
|
|
30
30
|
import "./utils/colorScheme.js";
|
|
31
|
-
const j = {
|
|
32
|
-
name: "ll-input-options"
|
|
33
|
-
|
|
34
|
-
...j,
|
|
31
|
+
const j = /* @__PURE__ */ B({
|
|
32
|
+
name: "ll-input-options",
|
|
33
|
+
__name: "InputOptions",
|
|
35
34
|
props: {
|
|
36
35
|
errorText: { default: void 0 },
|
|
37
36
|
hintText: { default: void 0 },
|
|
@@ -42,49 +41,49 @@ const j = {
|
|
|
42
41
|
options: { default: () => [] }
|
|
43
42
|
},
|
|
44
43
|
emits: ["update:model-value", "change"],
|
|
45
|
-
setup(_, { emit:
|
|
46
|
-
const o = _,
|
|
47
|
-
const { disabled: e, placeholder:
|
|
48
|
-
return { disabled: e, placeholder:
|
|
49
|
-
}),
|
|
50
|
-
const { disabled: e, displayBy:
|
|
51
|
-
return { disabled: e, displayBy:
|
|
44
|
+
setup(_, { emit: a }) {
|
|
45
|
+
const o = _, s = S(), g = k(), i = T(), l = d(), p = d(!1), t = d(), y = c(() => {
|
|
46
|
+
const { disabled: e, placeholder: n } = s;
|
|
47
|
+
return { disabled: e, placeholder: n };
|
|
48
|
+
}), w = c(() => {
|
|
49
|
+
const { disabled: e, displayBy: n, trackBy: r } = s;
|
|
50
|
+
return { disabled: e, displayBy: n, trackBy: r };
|
|
52
51
|
});
|
|
53
|
-
function
|
|
54
|
-
|
|
55
|
-
value:
|
|
52
|
+
function V(e) {
|
|
53
|
+
l.value = String(e), a("update:model-value", {
|
|
54
|
+
value: l.value,
|
|
56
55
|
option: t.value,
|
|
57
56
|
isValueChange: !0,
|
|
58
57
|
type: "input"
|
|
59
58
|
});
|
|
60
59
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
63
|
-
value:
|
|
60
|
+
function C() {
|
|
61
|
+
a("change", {
|
|
62
|
+
value: l.value,
|
|
64
63
|
option: t.value,
|
|
65
64
|
isValueChange: !0,
|
|
66
65
|
type: "input"
|
|
67
66
|
});
|
|
68
67
|
}
|
|
69
68
|
function x(e) {
|
|
70
|
-
t.value = e,
|
|
71
|
-
value:
|
|
69
|
+
t.value = e, a("change", {
|
|
70
|
+
value: l.value,
|
|
72
71
|
option: t.value,
|
|
73
72
|
isValueChange: !1,
|
|
74
73
|
type: "select"
|
|
75
|
-
}),
|
|
76
|
-
value:
|
|
74
|
+
}), a("update:model-value", {
|
|
75
|
+
value: l.value,
|
|
77
76
|
option: t.value,
|
|
78
77
|
isValueChange: !1,
|
|
79
78
|
type: "select"
|
|
80
79
|
});
|
|
81
80
|
}
|
|
82
|
-
if (
|
|
81
|
+
if ($(() => {
|
|
83
82
|
t.value || (t.value = o.options[0]);
|
|
84
83
|
}), v(
|
|
85
84
|
() => o.modelValue.value,
|
|
86
85
|
() => {
|
|
87
|
-
|
|
86
|
+
l.value = o.modelValue.value;
|
|
88
87
|
},
|
|
89
88
|
{ immediate: !0 }
|
|
90
89
|
), v(
|
|
@@ -93,33 +92,35 @@ const j = {
|
|
|
93
92
|
t.value = o.modelValue.option;
|
|
94
93
|
},
|
|
95
94
|
{ immediate: !0 }
|
|
96
|
-
),
|
|
95
|
+
), s.value)
|
|
97
96
|
throw new Error("ll-input-options: use :model-value or v-model instead of :value.");
|
|
98
|
-
if (
|
|
97
|
+
if (s.onInput)
|
|
99
98
|
throw new Error("ll-input-options: use the @update:model-value event instead of @input");
|
|
100
|
-
return (e,
|
|
101
|
-
class: "input",
|
|
102
|
-
"data-test": "
|
|
99
|
+
return (e, n) => (b(), E(F, m(o, {
|
|
100
|
+
class: "stash-input-options",
|
|
101
|
+
"data-test": "stash-input-options"
|
|
103
102
|
}), A({
|
|
104
|
-
default: f(({ fieldId:
|
|
103
|
+
default: f(({ fieldId: r }) => [
|
|
105
104
|
M("div", {
|
|
106
|
-
class:
|
|
105
|
+
class: O(["tw-flex", { [u(i)["has-error"]]: !!o.errorText }])
|
|
107
106
|
}, [
|
|
108
|
-
h(
|
|
109
|
-
id:
|
|
110
|
-
class: ["tw-flex-1", [
|
|
107
|
+
h(N, m(y.value, {
|
|
108
|
+
id: r,
|
|
109
|
+
class: ["stash-input-options__input -tw-mr-[1px] tw-inline-block tw-flex-1", [u(i).input, { "tw-z-control": p.value }]],
|
|
110
|
+
"data-test": "stash-input-options|input",
|
|
111
111
|
type: o.type,
|
|
112
|
-
"model-value":
|
|
113
|
-
onChange:
|
|
114
|
-
"onUpdate:modelValue":
|
|
115
|
-
onBlur:
|
|
116
|
-
onFocus:
|
|
112
|
+
"model-value": l.value,
|
|
113
|
+
onChange: C,
|
|
114
|
+
"onUpdate:modelValue": V,
|
|
115
|
+
onBlur: n[0] || (n[0] = (I) => p.value = !1),
|
|
116
|
+
onFocus: n[1] || (n[1] = (I) => p.value = !0)
|
|
117
117
|
}), null, 16, ["id", "class", "type", "model-value"]),
|
|
118
|
-
h(U, m(
|
|
118
|
+
h(U, m(w.value, {
|
|
119
119
|
single: "",
|
|
120
120
|
"hide-search": "",
|
|
121
121
|
"prevent-empty": "",
|
|
122
|
-
class:
|
|
122
|
+
class: ["stash-input-options__select tw-min-w-20", u(i).select],
|
|
123
|
+
"data-test": "stash-input-options|select",
|
|
123
124
|
"no-truncate": e.noTruncate,
|
|
124
125
|
options: e.options,
|
|
125
126
|
"model-value": t.value,
|
|
@@ -129,23 +130,23 @@ const j = {
|
|
|
129
130
|
]),
|
|
130
131
|
_: 2
|
|
131
132
|
}, [
|
|
132
|
-
|
|
133
|
+
u(g).hint ? {
|
|
133
134
|
name: "hint",
|
|
134
135
|
fn: f(() => [
|
|
135
|
-
|
|
136
|
+
z(e.$slots, "hint")
|
|
136
137
|
]),
|
|
137
138
|
key: "0"
|
|
138
139
|
} : void 0
|
|
139
140
|
]), 1040));
|
|
140
141
|
}
|
|
141
|
-
}),
|
|
142
|
-
input:
|
|
143
|
-
select:
|
|
144
|
-
"has-error": "_has-
|
|
145
|
-
},
|
|
146
|
-
$style:
|
|
147
|
-
},
|
|
142
|
+
}), q = "_input_gn7he_2", D = "_select_gn7he_7", G = {
|
|
143
|
+
input: q,
|
|
144
|
+
select: D,
|
|
145
|
+
"has-error": "_has-error_gn7he_16"
|
|
146
|
+
}, H = {
|
|
147
|
+
$style: G
|
|
148
|
+
}, Ve = /* @__PURE__ */ P(j, [["__cssModules", H]]);
|
|
148
149
|
export {
|
|
149
|
-
|
|
150
|
+
Ve as default
|
|
150
151
|
};
|
|
151
152
|
//# sourceMappingURL=InputOptions.js.map
|
package/dist/InputOptions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputOptions.js","sources":["../src/components/InputOptions/InputOptions.vue"],"sourcesContent":["<script lang=\"ts\">\n
|
|
1
|
+
{"version":3,"file":"InputOptions.js","sources":["../src/components/InputOptions/InputOptions.vue"],"sourcesContent":["<script lang=\"ts\">\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type Option = any;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type SelectedOption = any;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n interface InputOptionsProps {\n /**\n * Error text to display. Replaces `hintText` (if provided) & adds error styling\n */\n errorText?: string;\n\n /**\n * Hint text to display below the input\n */\n hintText?: string;\n\n /**\n * Label to render for the datepicker\n */\n label?: string;\n\n /**\n * The current value inclusive of the input & select\n */\n modelValue?: { value: string; option?: SelectedOption };\n\n /**\n * Input type\n */\n type?: string extends 'button' | 'checkbox' | 'radio' | 'submit' ? never : string;\n\n /**\n * Prevents the Selected Option from being truncated, if true\n */\n noTruncate?: boolean;\n\n /**\n * Options for the select\n */\n options?: Option[];\n }\n</script>\n\n<script lang=\"ts\" setup>\n import { computed, ref, useAttrs, useCssModule, useSlots, watch, watchEffect } from 'vue';\n\n import Field from '../Field/Field.vue';\n import Input from '../Input/Input.vue';\n import Select from '../Select/Select.vue';\n\n defineOptions({\n name: 'll-input-options',\n });\n\n const props = withDefaults(defineProps<InputOptionsProps>(), {\n modelValue: () => ({ value: '', option: undefined }),\n noTruncate: false,\n options: () => [],\n errorText: undefined,\n hintText: undefined,\n label: undefined,\n type: 'text',\n });\n\n const emit =\n defineEmits<{\n /**\n * Emitted when the model value changes\n */\n (\n e: 'update:model-value',\n v: { value?: string; option?: SelectedOption; isValueChange: boolean; type: 'input' | 'select' },\n ): void;\n /**\n * Emitted when either the input or select changes\n */\n (\n e: 'change',\n v: { value?: string; option?: SelectedOption; isValueChange: boolean; type: 'input' | 'select' },\n ): void;\n }>();\n\n const attrs = useAttrs();\n const slots = useSlots();\n const classes = useCssModule();\n const internalInput = ref<string>();\n const isInputFocused = ref(false);\n const selectedOption = ref<Option | undefined>();\n\n const inputAttrs = computed(() => {\n const { disabled, placeholder } = attrs;\n\n return { disabled, placeholder } as { disabled: boolean; placeholder: string };\n });\n\n const selectAttrs = computed(() => {\n const { disabled, displayBy, trackBy } = attrs;\n\n return { disabled, displayBy, trackBy } as { disabled: boolean; displayBy: string; trackBy: string };\n });\n\n // Input value changed\n function handleInput(val?: string | number) {\n internalInput.value = String(val);\n\n emit('update:model-value', {\n value: internalInput.value,\n option: selectedOption.value,\n isValueChange: true,\n type: 'input',\n });\n }\n\n // Input blurred\n function handleInputChange() {\n emit('change', {\n value: internalInput.value,\n option: selectedOption.value,\n isValueChange: true,\n type: 'input',\n });\n }\n\n function handleSelectChange(val?: Option) {\n selectedOption.value = val;\n\n emit('change', {\n value: internalInput.value,\n option: selectedOption.value,\n isValueChange: false,\n type: 'select',\n });\n emit('update:model-value', {\n value: internalInput.value,\n option: selectedOption.value,\n isValueChange: false,\n type: 'select',\n });\n }\n\n watchEffect(() => {\n if (!selectedOption.value) {\n selectedOption.value = props.options[0];\n }\n });\n\n watch(\n () => props.modelValue.value,\n () => {\n internalInput.value = props.modelValue.value;\n },\n { immediate: true },\n );\n\n watch(\n () => props.modelValue.option,\n () => {\n selectedOption.value = props.modelValue.option;\n },\n { immediate: true },\n );\n\n if (attrs.value) {\n throw new Error('ll-input-options: use :model-value or v-model instead of :value.');\n }\n\n if (attrs.onInput) {\n throw new Error('ll-input-options: use the @update:model-value event instead of @input');\n }\n</script>\n\n<template>\n <Field v-bind=\"props\" class=\"stash-input-options\" data-test=\"stash-input-options\">\n <template #default=\"{ fieldId }\">\n <div class=\"tw-flex\" :class=\"{ [classes['has-error']]: !!props.errorText }\">\n <Input\n v-bind=\"inputAttrs\"\n :id=\"fieldId\"\n class=\"stash-input-options__input -tw-mr-[1px] tw-inline-block tw-flex-1\"\n :class=\"[classes.input, { 'tw-z-control': isInputFocused }]\"\n data-test=\"stash-input-options|input\"\n :type=\"props.type\"\n :model-value=\"internalInput\"\n @change=\"handleInputChange\"\n @update:model-value=\"handleInput\"\n @blur=\"isInputFocused = false\"\n @focus=\"isInputFocused = true\"\n />\n\n <Select\n v-bind=\"selectAttrs\"\n single\n hide-search\n prevent-empty\n class=\"stash-input-options__select tw-min-w-20\"\n data-test=\"stash-input-options|select\"\n :class=\"classes.select\"\n :no-truncate=\"noTruncate\"\n :options=\"options\"\n :model-value=\"selectedOption\"\n @update:model-value=\"handleSelectChange\"\n />\n </div>\n </template>\n <template v-if=\"slots.hint\" #hint>\n <!-- @slot Hint slot for rendering text below the input -->\n <slot name=\"hint\"></slot>\n </template>\n </Field>\n</template>\n\n<style module>\n .input input {\n border-bottom-right-radius: 0;\n border-top-right-radius: 0;\n }\n\n .select :global(.stash-select__content) {\n border-bottom-left-radius: 0;\n border-top-left-radius: 0;\n }\n\n .select:global(.stash-select--active .stash-select__content) {\n min-width: 0;\n }\n\n .has-error input,\n .has-error input:hover:not(:focus),\n .has-error :global(.stash-select__content),\n .has-error :global(.stash-select__content:hover:not(:focus)) {\n border-color: var(--color-red-500);\n }\n</style>\n"],"names":["attrs","useAttrs","slots","useSlots","classes","useCssModule","internalInput","ref","isInputFocused","selectedOption","inputAttrs","computed","disabled","placeholder","selectAttrs","displayBy","trackBy","handleInput","val","emit","handleInputChange","handleSelectChange","watchEffect","props","watch"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqFQA,IAAQC,KACRC,IAAQC,KACRC,IAAUC,KACVC,IAAgBC,KAChBC,IAAiBD,EAAI,EAAK,GAC1BE,IAAiBF,KAEjBG,IAAaC,EAAS,MAAM;AAC1B,YAAA,EAAE,UAAAC,GAAU,aAAAC,EAAgB,IAAAb;AAE3B,aAAA,EAAE,UAAAY,GAAU,aAAAC;IAAY,CAChC,GAEKC,IAAcH,EAAS,M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AI,MAAM,kEAAkE;AAGpF,QAAIA,EAAM;AACF,YAAA,IAAI,MAAM,uEAAuE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -40,7 +40,6 @@ declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaul
|
|
|
40
40
|
};
|
|
41
41
|
noTruncate: boolean;
|
|
42
42
|
options: () => never[];
|
|
43
|
-
dataTest: string;
|
|
44
43
|
errorText: undefined;
|
|
45
44
|
hintText: undefined;
|
|
46
45
|
label: undefined;
|
|
@@ -65,7 +64,6 @@ declare const _default: __VLS_WithTemplateSlots<DefineComponent<__VLS_WithDefaul
|
|
|
65
64
|
};
|
|
66
65
|
noTruncate: boolean;
|
|
67
66
|
options: () => never[];
|
|
68
|
-
dataTest: string;
|
|
69
67
|
errorText: undefined;
|
|
70
68
|
hintText: undefined;
|
|
71
69
|
label: undefined;
|
package/dist/Select.js
CHANGED
|
@@ -956,7 +956,7 @@ function Rn(e, n, t) {
|
|
|
956
956
|
update: E
|
|
957
957
|
};
|
|
958
958
|
}
|
|
959
|
-
const On = (e) => (Mt("data-v-
|
|
959
|
+
const On = (e) => (Mt("data-v-487a637d"), e = e(), Dt(), e), kn = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "name"], Tn = ["selected", "value"], Bn = /* @__PURE__ */ On(() => /* @__PURE__ */ z("option", { value: "" }, null, -1)), An = ["aria-controls", "aria-expanded", "aria-label", "aria-disabled", "onKeyup"], Ln = ["id"], Mn = ["onKeypress", "onMousedown"], Dn = {
|
|
960
960
|
key: 0,
|
|
961
961
|
class: "stash-select__total"
|
|
962
962
|
}, Fn = {
|
|
@@ -1401,7 +1401,7 @@ const On = (e) => (Mt("data-v-d0e10c6d"), e = e(), Dt(), e), kn = ["id", "aria-e
|
|
|
1401
1401
|
]), 1032, ["id", "add-bottom-space", "class", "error-text", "hint-text", "label", "show-optional-in-label"]));
|
|
1402
1402
|
}
|
|
1403
1403
|
});
|
|
1404
|
-
const ho = /* @__PURE__ */ Ut(Hn, [["__scopeId", "data-v-
|
|
1404
|
+
const ho = /* @__PURE__ */ Ut(Hn, [["__scopeId", "data-v-487a637d"]]);
|
|
1405
1405
|
export {
|
|
1406
1406
|
ho as default
|
|
1407
1407
|
};
|