@stachelock/ui 0.6.13 → 0.6.15

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.
@@ -743,6 +743,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
743
743
  [x: string]: (...args: never) => any;
744
744
  }>;
745
745
  range: boolean;
746
+ selectText: string;
746
747
  tertiaryLabel: string;
747
748
  successMessage: string;
748
749
  showErrors: boolean;
@@ -753,6 +754,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
753
754
  clearable: boolean;
754
755
  locale: string;
755
756
  startTime: TimeModel | TimeModel[];
757
+ hint: string;
756
758
  is24: boolean;
757
759
  enableTimePicker: boolean;
758
760
  multiCalendars: number | boolean | {
@@ -771,7 +773,6 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
771
773
  autoApply: boolean;
772
774
  disableMonthYearSelect: boolean;
773
775
  disabledDates: Date[] | ((date: Date) => boolean);
774
- selectText: string;
775
776
  autoPosition: boolean;
776
777
  monthPicker: boolean;
777
778
  timePicker: 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>;
@@ -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' | 'names' | 'baseInfo' | 'address' | 'selectText';
24
24
  label?: string;
25
25
  placeholder?: string;
26
26
  description?: string;
@@ -53,8 +53,34 @@ 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;
61
+ schema?: unknown;
62
+ requiredFields?: string[];
63
+ use?: string;
64
+ enableVerification?: boolean;
65
+ showSuggestionCount?: boolean;
66
+ allowManualEntry?: boolean;
67
+ select?: {
68
+ label?: string;
69
+ options: Array<{
70
+ label: string;
71
+ value: string;
72
+ }>;
73
+ placeholder?: string;
74
+ };
75
+ text?: {
76
+ label?: string;
77
+ placeholder?: string;
78
+ inputMode?: string;
79
+ maxLength?: number;
80
+ };
81
+ delimiter?: string;
82
+ formatter?: (value: FormValue) => string | undefined;
83
+ showValidCheck?: boolean;
58
84
  condition?: (formData: FormData, field?: DynamicFormField) => boolean;
59
85
  onChange?: (value: FormValue, field: DynamicFormField, formData: FormData) => void;
60
86
  onBlur?: (event: FocusEvent) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stachelock/ui",
3
- "version": "0.6.13",
3
+ "version": "0.6.15",
4
4
  "description": "A comprehensive Vue 3 UI component library built with Tailwind CSS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,152 +0,0 @@
1
- import { defineComponent as b, computed as s, defineAsyncComponent as y, createBlock as v, createElementBlock as g, openBlock as c, resolveDynamicComponent as w, mergeProps as k, toHandlers as V, createElementVNode as o, createVNode as _, unref as L, toDisplayString as P } from "vue";
2
- import t from "./inputs/TextInput.js";
3
- import { ExclamationTriangleIcon as C } from "@heroicons/vue/24/outline";
4
- const D = {
5
- key: 1,
6
- class: "sl-p-4 sl-bg-yellow-50 sl-border sl-border-yellow-200 sl-rounded-md"
7
- }, F = { class: "sl-flex" }, M = { class: "sl-ml-3" }, T = { class: "sl-mt-2 sl-text-sm sl-text-yellow-700" }, A = /* @__PURE__ */ b({
8
- __name: "DynamicFormField",
9
- props: {
10
- field: {},
11
- modelValue: { type: [String, Number, Boolean, null, Array, Object] },
12
- formData: {}
13
- },
14
- emits: ["update:modelValue", "field-change"],
15
- setup(a, { emit: m }) {
16
- const e = a, d = m, u = {
17
- text: () => Promise.resolve(t),
18
- email: () => Promise.resolve(t),
19
- password: () => Promise.resolve(t),
20
- number: () => Promise.resolve(t),
21
- tel: () => Promise.resolve(t),
22
- url: () => Promise.resolve(t),
23
- textarea: () => import("./inputs/TextAreaInput.js"),
24
- select: () => import("./inputs/SelectInput.js"),
25
- combobox: () => import("./inputs/ComboboxInput.js"),
26
- checkbox: () => import("./inputs/CheckboxInput.js"),
27
- switch: () => import("./inputs/SwitchInput.js")
28
- }, r = s(() => {
29
- const l = u[e.field.type];
30
- return l ? y({
31
- loader: l,
32
- errorComponent: () => null,
33
- delay: 0
34
- }) : null;
35
- }), n = s({
36
- get: () => e.modelValue ?? e.field.defaultValue ?? h(),
37
- set: (l) => {
38
- d("update:modelValue", l), d("field-change", e.field, l);
39
- }
40
- }), f = s(() => {
41
- const l = {
42
- name: e.field.name,
43
- label: e.field.label,
44
- placeholder: e.field.placeholder,
45
- disabled: e.field.disabled,
46
- rules: e.field.validation,
47
- validateOnMount: e.field.validateOnMount,
48
- tertiaryLabel: e.field.tertiaryLabel,
49
- successMessage: e.field.successMessage
50
- };
51
- switch (e.field.type) {
52
- case "text":
53
- case "email":
54
- case "password":
55
- case "number":
56
- case "tel":
57
- case "url":
58
- return {
59
- ...l,
60
- type: e.field.inputType || e.field.type,
61
- maxlength: e.field.maxLength,
62
- minlength: e.field.minLength,
63
- min: e.field.min,
64
- max: e.field.max,
65
- step: e.field.step,
66
- spellcheck: e.field.spellcheck,
67
- autocomplete: e.field.autocomplete
68
- };
69
- case "textarea":
70
- return {
71
- ...l,
72
- rows: e.field.rows,
73
- maxlength: e.field.maxLength,
74
- spellcheck: e.field.spellcheck
75
- };
76
- case "select":
77
- return {
78
- ...l,
79
- items: e.field.options || [],
80
- multiple: e.field.multiple,
81
- itemKey: e.field.optionKey || "value",
82
- itemText: e.field.optionLabel || "label",
83
- showAll: e.field.showSelectAll
84
- };
85
- case "combobox":
86
- return {
87
- ...l,
88
- items: e.field.options || [],
89
- itemKey: e.field.optionKey || "value",
90
- itemText: e.field.optionLabel || "label",
91
- customQuery: e.field.customQuery,
92
- loading: e.field.loading
93
- };
94
- case "checkbox":
95
- return {
96
- ...l,
97
- description: e.field.description,
98
- immediate: e.field.immediate ?? !0,
99
- isDescriptionHtml: e.field.isDescriptionHtml
100
- };
101
- case "switch":
102
- return {
103
- ...l,
104
- description: e.field.description,
105
- immediate: e.field.immediate ?? !0,
106
- boxShadow: e.field.boxShadow,
107
- hideMainLabel: e.field.hideMainLabel,
108
- textTrue: e.field.textTrue,
109
- textFalse: e.field.textFalse
110
- };
111
- default:
112
- return l;
113
- }
114
- }), p = s(() => {
115
- 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"] = (i) => {
117
- n.value = i, e.field.onChange?.(i, e.field, e.formData ?? {});
118
- }), l;
119
- }), h = () => {
120
- switch (e.field.type) {
121
- case "checkbox":
122
- case "switch":
123
- return !1;
124
- case "select":
125
- return e.field.multiple ? [] : null;
126
- case "number":
127
- return e.field.min || 0;
128
- default:
129
- return "";
130
- }
131
- }, x = (l) => {
132
- n.value = l;
133
- };
134
- return (l, i) => r.value ? (c(), v(w(r.value), k({ key: 0 }, f.value, V(p.value), {
135
- "model-value": n.value,
136
- "onUpdate:modelValue": x
137
- }), null, 16, ["model-value"])) : (c(), g("div", D, [
138
- o("div", F, [
139
- _(L(C), { class: "sl-h-5 sl-w-5 sl-text-yellow-400" }),
140
- o("div", M, [
141
- i[0] || (i[0] = o("h3", { class: "sl-text-sm sl-font-medium sl-text-yellow-800" }, " Unknown field type ", -1)),
142
- o("div", T, [
143
- o("p", null, 'Field type "' + P(a.field.type) + '" is not supported.', 1)
144
- ])
145
- ])
146
- ])
147
- ]));
148
- }
149
- });
150
- export {
151
- A as _
152
- };