@stachelock/ui 0.6.13 → 0.6.14
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/{DynamicForm.vue_vue_type_script_setup_true_lang-BR8Pq7Kw.js → DynamicForm.vue_vue_type_script_setup_true_lang-DMtVUXUN.js} +1 -1
- package/dist/{DynamicFormField.vue_vue_type_script_setup_true_lang-BCVmqg_n.js → DynamicFormField.vue_vue_type_script_setup_true_lang-DSq31jjH.js} +49 -33
- package/dist/forms/DynamicForm.js +1 -1
- package/dist/forms/DynamicFormField.js +1 -1
- package/dist/index.js +2 -2
- package/dist/src/components/inputs/DatepickerInput.d.ts +1 -1
- package/dist/src/components/inputs/PhoneInput.d.ts +1 -1
- package/dist/src/components/inputs/RichTextInput.d.ts +1 -1
- package/dist/src/types/form.d.ts +4 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { defineComponent as Y, ref as Z, reactive as _, watch as w, computed as
|
|
|
2
2
|
import { useForm as te } from "vee-validate";
|
|
3
3
|
import { ExclamationCircleIcon as se } from "@heroicons/vue/24/outline";
|
|
4
4
|
import A from "./components/Button.js";
|
|
5
|
-
import { _ as ae } from "./DynamicFormField.vue_vue_type_script_setup_true_lang-
|
|
5
|
+
import { _ as ae } from "./DynamicFormField.vue_vue_type_script_setup_true_lang-DSq31jjH.js";
|
|
6
6
|
const le = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "sl-mb-6"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { ExclamationTriangleIcon as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as x, computed as s, defineAsyncComponent as b, createBlock as v, createElementBlock as g, openBlock as c, resolveDynamicComponent as w, mergeProps as V, toHandlers as k, createElementVNode as o, createVNode as C, unref as _, toDisplayString as D } from "vue";
|
|
2
|
+
import i from "./inputs/TextInput.js";
|
|
3
|
+
import { ExclamationTriangleIcon as L } from "@heroicons/vue/24/outline";
|
|
4
|
+
const F = {
|
|
5
5
|
key: 1,
|
|
6
6
|
class: "sl-p-4 sl-bg-yellow-50 sl-border sl-border-yellow-200 sl-rounded-md"
|
|
7
|
-
},
|
|
7
|
+
}, P = { class: "sl-flex" }, E = { class: "sl-ml-3" }, M = { class: "sl-mt-2 sl-text-sm sl-text-yellow-700" }, A = /* @__PURE__ */ x({
|
|
8
8
|
__name: "DynamicFormField",
|
|
9
9
|
props: {
|
|
10
10
|
field: {},
|
|
@@ -12,30 +12,31 @@ const D = {
|
|
|
12
12
|
formData: {}
|
|
13
13
|
},
|
|
14
14
|
emits: ["update:modelValue", "field-change"],
|
|
15
|
-
setup(
|
|
16
|
-
const e =
|
|
17
|
-
text: () => Promise.resolve(
|
|
18
|
-
email: () =>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
setup(r, { emit: u }) {
|
|
16
|
+
const e = r, n = u, m = {
|
|
17
|
+
text: () => Promise.resolve(i),
|
|
18
|
+
email: () => import("./inputs/EmailInput.js"),
|
|
19
|
+
phone: () => import("./inputs/PhoneInput.js"),
|
|
20
|
+
password: () => Promise.resolve(i),
|
|
21
|
+
number: () => Promise.resolve(i),
|
|
22
|
+
tel: () => Promise.resolve(i),
|
|
23
|
+
url: () => Promise.resolve(i),
|
|
23
24
|
textarea: () => import("./inputs/TextAreaInput.js"),
|
|
24
25
|
select: () => import("./inputs/SelectInput.js"),
|
|
25
26
|
combobox: () => import("./inputs/ComboboxInput.js"),
|
|
26
27
|
checkbox: () => import("./inputs/CheckboxInput.js"),
|
|
27
28
|
switch: () => import("./inputs/SwitchInput.js")
|
|
28
|
-
},
|
|
29
|
-
const l =
|
|
30
|
-
return l ?
|
|
29
|
+
}, d = s(() => {
|
|
30
|
+
const l = m[e.field.type];
|
|
31
|
+
return l ? b({
|
|
31
32
|
loader: l,
|
|
32
33
|
errorComponent: () => null,
|
|
33
34
|
delay: 0
|
|
34
35
|
}) : null;
|
|
35
|
-
}),
|
|
36
|
+
}), a = s({
|
|
36
37
|
get: () => e.modelValue ?? e.field.defaultValue ?? h(),
|
|
37
38
|
set: (l) => {
|
|
38
|
-
|
|
39
|
+
n("update:modelValue", l), n("field-change", e.field, l);
|
|
39
40
|
}
|
|
40
41
|
}), f = s(() => {
|
|
41
42
|
const l = {
|
|
@@ -50,7 +51,6 @@ const D = {
|
|
|
50
51
|
};
|
|
51
52
|
switch (e.field.type) {
|
|
52
53
|
case "text":
|
|
53
|
-
case "email":
|
|
54
54
|
case "password":
|
|
55
55
|
case "number":
|
|
56
56
|
case "tel":
|
|
@@ -66,6 +66,22 @@ const D = {
|
|
|
66
66
|
spellcheck: e.field.spellcheck,
|
|
67
67
|
autocomplete: e.field.autocomplete
|
|
68
68
|
};
|
|
69
|
+
case "email":
|
|
70
|
+
return {
|
|
71
|
+
...l,
|
|
72
|
+
colorfulValidation: e.field.colorfulValidation ?? !0,
|
|
73
|
+
showErrors: !0,
|
|
74
|
+
autocomplete: e.field.autocomplete || "email"
|
|
75
|
+
};
|
|
76
|
+
case "phone":
|
|
77
|
+
return {
|
|
78
|
+
...l,
|
|
79
|
+
required: e.field.required,
|
|
80
|
+
colorfulValidation: e.field.colorfulValidation ?? !0,
|
|
81
|
+
showErrors: !0,
|
|
82
|
+
defaultCountry: e.field.defaultCountry,
|
|
83
|
+
autoDetectCountry: e.field.autoDetectCountry ?? !0
|
|
84
|
+
};
|
|
69
85
|
case "textarea":
|
|
70
86
|
return {
|
|
71
87
|
...l,
|
|
@@ -113,8 +129,8 @@ const D = {
|
|
|
113
129
|
}
|
|
114
130
|
}), p = s(() => {
|
|
115
131
|
const l = {};
|
|
116
|
-
return e.field.onBlur && (l.blur = e.field.onBlur), e.field.onFocus && (l.focus = e.field.onFocus), e.field.onChange && (l["update:modelValue"] = (
|
|
117
|
-
|
|
132
|
+
return e.field.onBlur && (l.blur = e.field.onBlur), e.field.onFocus && (l.focus = e.field.onFocus), e.field.onChange && (l["update:modelValue"] = (t) => {
|
|
133
|
+
a.value = t, e.field.onChange?.(t, e.field, e.formData ?? {});
|
|
118
134
|
}), l;
|
|
119
135
|
}), h = () => {
|
|
120
136
|
switch (e.field.type) {
|
|
@@ -128,19 +144,19 @@ const D = {
|
|
|
128
144
|
default:
|
|
129
145
|
return "";
|
|
130
146
|
}
|
|
131
|
-
},
|
|
132
|
-
|
|
147
|
+
}, y = (l) => {
|
|
148
|
+
a.value = l;
|
|
133
149
|
};
|
|
134
|
-
return (l,
|
|
135
|
-
"model-value":
|
|
136
|
-
"onUpdate:modelValue":
|
|
137
|
-
}), null, 16, ["model-value"])) : (c(), g("div",
|
|
138
|
-
o("div",
|
|
139
|
-
_(L
|
|
140
|
-
o("div",
|
|
141
|
-
|
|
142
|
-
o("div",
|
|
143
|
-
o("p", null, 'Field type "' +
|
|
150
|
+
return (l, t) => d.value ? (c(), v(w(d.value), V({ key: 0 }, f.value, k(p.value), {
|
|
151
|
+
"model-value": a.value,
|
|
152
|
+
"onUpdate:modelValue": y
|
|
153
|
+
}), null, 16, ["model-value"])) : (c(), g("div", F, [
|
|
154
|
+
o("div", P, [
|
|
155
|
+
C(_(L), { class: "sl-h-5 sl-w-5 sl-text-yellow-400" }),
|
|
156
|
+
o("div", E, [
|
|
157
|
+
t[0] || (t[0] = o("h3", { class: "sl-text-sm sl-font-medium sl-text-yellow-800" }, " Unknown field type ", -1)),
|
|
158
|
+
o("div", M, [
|
|
159
|
+
o("p", null, 'Field type "' + D(r.field.type) + '" is not supported.', 1)
|
|
144
160
|
])
|
|
145
161
|
])
|
|
146
162
|
])
|
package/dist/index.js
CHANGED
|
@@ -41,7 +41,7 @@ import { _ as Qi } from "./SparklineChart.vue_vue_type_script_setup_true_lang-Bl
|
|
|
41
41
|
import { _ as td } from "./StatCard.vue_vue_type_script_setup_true_lang-B5SuaSXL.js";
|
|
42
42
|
import { format as ae, differenceInYears as ue, differenceInMonths as Pe, isValid as re, parseISO as de } from "date-fns";
|
|
43
43
|
import { _ as ot } from "./AddDeleteButtonGroup.vue_vue_type_script_setup_true_lang-6taLcPq0.js";
|
|
44
|
-
import { _ as nt } from "./DynamicForm.vue_vue_type_script_setup_true_lang-
|
|
44
|
+
import { _ as nt } from "./DynamicForm.vue_vue_type_script_setup_true_lang-DMtVUXUN.js";
|
|
45
45
|
import { _ as it } from "./AlertModal.vue_vue_type_script_setup_true_lang-DzhVQdx4.js";
|
|
46
46
|
import { _ as W } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
47
47
|
import { _ as ld } from "./ComingSoon.vue_vue_type_script_setup_true_lang-CJ8FXE42.js";
|
|
@@ -50,7 +50,7 @@ import N from "dayjs";
|
|
|
50
50
|
import Ee from "dayjs/plugin/utc";
|
|
51
51
|
import Ae from "dayjs/plugin/timezone";
|
|
52
52
|
import dt from "dayjs/plugin/relativeTime";
|
|
53
|
-
import { _ as nd } from "./DynamicFormField.vue_vue_type_script_setup_true_lang-
|
|
53
|
+
import { _ as nd } from "./DynamicFormField.vue_vue_type_script_setup_true_lang-DSq31jjH.js";
|
|
54
54
|
import { _ as ct } from "./CheckboxInput.vue_vue_type_script_setup_true_lang-BikR9rgi.js";
|
|
55
55
|
import { _ as ut } from "./ComboboxInput.vue_vue_type_script_setup_true_lang-Cy0Pl8Ap.js";
|
|
56
56
|
import { _ as dd } from "./DatepickerInput.vue_vue_type_style_index_0_lang-C_0dWHo6.js";
|
|
@@ -753,6 +753,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
|
|
|
753
753
|
clearable: boolean;
|
|
754
754
|
locale: string;
|
|
755
755
|
startTime: TimeModel | TimeModel[];
|
|
756
|
+
hint: string;
|
|
756
757
|
is24: boolean;
|
|
757
758
|
enableTimePicker: boolean;
|
|
758
759
|
multiCalendars: number | boolean | {
|
|
@@ -816,7 +817,6 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
|
|
|
816
817
|
noDisabledRange: boolean;
|
|
817
818
|
sixWeeks: boolean | "center" | "append" | "prepend" | "fair";
|
|
818
819
|
quarterPicker: boolean;
|
|
819
|
-
hint: string;
|
|
820
820
|
inputFlow: FlowType;
|
|
821
821
|
displayFormat: string | ((date: Date | Date[]) => string);
|
|
822
822
|
showNowButton: boolean;
|
|
@@ -195,8 +195,8 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
|
|
|
195
195
|
showErrors: boolean;
|
|
196
196
|
colorfulValidation: boolean;
|
|
197
197
|
disabledMessage: string;
|
|
198
|
-
hint: string;
|
|
199
198
|
autoComplete: string;
|
|
199
|
+
hint: string;
|
|
200
200
|
defaultCountry: CountryCode;
|
|
201
201
|
autoDetectCountry: boolean;
|
|
202
202
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
|
|
@@ -76,8 +76,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
76
76
|
tertiaryLabel: string;
|
|
77
77
|
showErrors: boolean;
|
|
78
78
|
maxHeight: string;
|
|
79
|
-
minHeight: string;
|
|
80
79
|
hint: string;
|
|
80
|
+
minHeight: string;
|
|
81
81
|
showCharCount: boolean;
|
|
82
82
|
minimal: boolean;
|
|
83
83
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
package/dist/src/types/form.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface FormValidationState {
|
|
|
20
20
|
}
|
|
21
21
|
export interface DynamicFormField {
|
|
22
22
|
name: string;
|
|
23
|
-
type: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'textarea' | 'select' | 'combobox' | 'checkbox' | 'switch' | 'file' | 'date' | 'datetime-local' | 'time';
|
|
23
|
+
type: 'text' | 'email' | 'phone' | 'password' | 'number' | 'tel' | 'url' | 'textarea' | 'select' | 'combobox' | 'checkbox' | 'switch' | 'file' | 'date' | 'datetime-local' | 'time';
|
|
24
24
|
label?: string;
|
|
25
25
|
placeholder?: string;
|
|
26
26
|
description?: string;
|
|
@@ -53,6 +53,9 @@ export interface DynamicFormField {
|
|
|
53
53
|
hideMainLabel?: boolean;
|
|
54
54
|
textTrue?: string;
|
|
55
55
|
textFalse?: string;
|
|
56
|
+
colorfulValidation?: boolean;
|
|
57
|
+
defaultCountry?: string;
|
|
58
|
+
autoDetectCountry?: boolean;
|
|
56
59
|
tertiaryLabel?: string;
|
|
57
60
|
successMessage?: string;
|
|
58
61
|
condition?: (formData: FormData, field?: DynamicFormField) => boolean;
|