@nexdom/uimed-vue 1.1.0-beta.2 → 1.1.0-beta.4
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/README.md +2 -2
- package/dist/components.d.ts +188 -11
- package/dist/components.js +189 -13
- package/package.json +3 -2
package/README.md
CHANGED
package/dist/components.d.ts
CHANGED
|
@@ -22,11 +22,11 @@ type RootProps = {
|
|
|
22
22
|
*
|
|
23
23
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/root | Root Guide}
|
|
24
24
|
*/
|
|
25
|
-
declare const _default$
|
|
26
|
-
declare const __VLS_export$
|
|
25
|
+
declare const _default$4: typeof __VLS_export$6;
|
|
26
|
+
declare const __VLS_export$6: __VLS_WithSlots$5<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<RootProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<RootProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, {
|
|
27
27
|
default?: (props: {}) => any;
|
|
28
28
|
}>;
|
|
29
|
-
type __VLS_WithSlots$
|
|
29
|
+
type __VLS_WithSlots$5<T, S> = T & {
|
|
30
30
|
new (): {
|
|
31
31
|
$slots: S;
|
|
32
32
|
};
|
|
@@ -45,6 +45,12 @@ type BtnProps = {
|
|
|
45
45
|
* @default "primary"
|
|
46
46
|
*/
|
|
47
47
|
variant?: BtnVariant;
|
|
48
|
+
/**
|
|
49
|
+
* Applies a distinct behavior to the button.
|
|
50
|
+
* One of `button` or `submit`.
|
|
51
|
+
* @default "button"
|
|
52
|
+
*/
|
|
53
|
+
type?: "submit" | "button";
|
|
48
54
|
/**
|
|
49
55
|
* Applies a color to the button.
|
|
50
56
|
* One of `primary`, `secondary`, `positive`, `informative`, `caution`, or `danger`.
|
|
@@ -61,6 +67,10 @@ type BtnProps = {
|
|
|
61
67
|
* @default false
|
|
62
68
|
*/
|
|
63
69
|
loading?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Associated [form](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/form) id.
|
|
72
|
+
*/
|
|
73
|
+
form?: string;
|
|
64
74
|
/**
|
|
65
75
|
* Component id to use on automated tests.
|
|
66
76
|
*/
|
|
@@ -80,21 +90,21 @@ type BtnProps = {
|
|
|
80
90
|
*
|
|
81
91
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/btn | Btn Guide}
|
|
82
92
|
*/
|
|
83
|
-
declare const _default: typeof __VLS_export$
|
|
84
|
-
declare const __VLS_export$
|
|
93
|
+
declare const _default: typeof __VLS_export$5;
|
|
94
|
+
declare const __VLS_export$5: __VLS_WithSlots$4<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<BtnProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {} & {
|
|
85
95
|
click: (event: MouseEvent) => any;
|
|
86
96
|
}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<BtnProps> & Readonly<{
|
|
87
97
|
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
88
98
|
}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, {
|
|
89
99
|
default?: (props: {}) => any;
|
|
90
100
|
}>;
|
|
91
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
101
|
+
type __VLS_WithSlots$4<T, S> = T & {
|
|
92
102
|
new (): {
|
|
93
103
|
$slots: S;
|
|
94
104
|
};
|
|
95
105
|
};
|
|
96
106
|
//#endregion
|
|
97
|
-
//#region src/components/text-field/types.d.ts
|
|
107
|
+
//#region src/components/inputs/text-field/types.d.ts
|
|
98
108
|
type TextFieldVariant = "primary" | "secondary";
|
|
99
109
|
type TextFieldType = "text" | "phone" | "email" | "url" | "password" | "search";
|
|
100
110
|
/**
|
|
@@ -133,6 +143,11 @@ type TextFieldProps = {
|
|
|
133
143
|
* @default false
|
|
134
144
|
*/
|
|
135
145
|
readonly?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Add `rules` to require field to be filled before form submission.
|
|
148
|
+
* @default false
|
|
149
|
+
*/
|
|
150
|
+
required?: boolean;
|
|
136
151
|
/**
|
|
137
152
|
* Field label.
|
|
138
153
|
*/
|
|
@@ -153,7 +168,7 @@ type TextFieldProps = {
|
|
|
153
168
|
dataTestid?: string;
|
|
154
169
|
};
|
|
155
170
|
//#endregion
|
|
156
|
-
//#region src/components/text-field/text-field.vue.d.ts
|
|
171
|
+
//#region src/components/inputs/text-field/text-field.vue.d.ts
|
|
157
172
|
/**
|
|
158
173
|
* Text field component to be used throughout the application.
|
|
159
174
|
*
|
|
@@ -164,8 +179,8 @@ type TextFieldProps = {
|
|
|
164
179
|
*
|
|
165
180
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/text-field | TextField Guide}
|
|
166
181
|
*/
|
|
167
|
-
declare const _default$
|
|
168
|
-
declare const __VLS_export: import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<TextFieldProps & {
|
|
182
|
+
declare const _default$6: typeof __VLS_export$4;
|
|
183
|
+
declare const __VLS_export$4: import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<TextFieldProps & {
|
|
169
184
|
modelValue?: string;
|
|
170
185
|
}, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {
|
|
171
186
|
"update:modelValue": (value: string) => any;
|
|
@@ -175,4 +190,166 @@ declare const __VLS_export: import("vue", { with: { "resolution-mode": "import"
|
|
|
175
190
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
176
191
|
}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>;
|
|
177
192
|
//#endregion
|
|
178
|
-
|
|
193
|
+
//#region src/components/grid/container/types.d.ts
|
|
194
|
+
/**
|
|
195
|
+
* Props exposed by the {@link Container} component.
|
|
196
|
+
*/
|
|
197
|
+
type ContainerProps = {
|
|
198
|
+
/**
|
|
199
|
+
* Component id to use on automated tests.
|
|
200
|
+
*/
|
|
201
|
+
dataTestid?: string;
|
|
202
|
+
};
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region src/components/grid/container/container.vue.d.ts
|
|
205
|
+
/**
|
|
206
|
+
* Container component to be placed at the top of the component tree.
|
|
207
|
+
*
|
|
208
|
+
* @example
|
|
209
|
+
* ```vue
|
|
210
|
+
* <container>
|
|
211
|
+
* <!-- uimed-components -->
|
|
212
|
+
* </container>
|
|
213
|
+
* ```
|
|
214
|
+
*
|
|
215
|
+
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/layout | Container Guide}
|
|
216
|
+
*/
|
|
217
|
+
declare const _default$2: typeof __VLS_export$3;
|
|
218
|
+
declare const __VLS_export$3: __VLS_WithSlots$3<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<ContainerProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<ContainerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, {
|
|
219
|
+
default?: (props: {}) => any;
|
|
220
|
+
}>;
|
|
221
|
+
type __VLS_WithSlots$3<T, S> = T & {
|
|
222
|
+
new (): {
|
|
223
|
+
$slots: S;
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
//#endregion
|
|
227
|
+
//#region src/components/grid/row/types.d.ts
|
|
228
|
+
/**
|
|
229
|
+
* Props exposed by the {@link Row} component.
|
|
230
|
+
*/
|
|
231
|
+
type RowProps = {
|
|
232
|
+
/**
|
|
233
|
+
* Component id to use on automated tests.
|
|
234
|
+
*/
|
|
235
|
+
dataTestid?: string;
|
|
236
|
+
};
|
|
237
|
+
//#endregion
|
|
238
|
+
//#region src/components/grid/row/row.vue.d.ts
|
|
239
|
+
/**
|
|
240
|
+
* Row component to be placed within a container.
|
|
241
|
+
*
|
|
242
|
+
* @example
|
|
243
|
+
* ```vue
|
|
244
|
+
* <container>
|
|
245
|
+
* <row>
|
|
246
|
+
* <!-- uimed-column -->
|
|
247
|
+
* </row>
|
|
248
|
+
* </container>
|
|
249
|
+
* ```
|
|
250
|
+
*
|
|
251
|
+
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/layout | Row Guide}
|
|
252
|
+
*/
|
|
253
|
+
declare const _default$5: typeof __VLS_export$2;
|
|
254
|
+
declare const __VLS_export$2: __VLS_WithSlots$2<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<RowProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<RowProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, {
|
|
255
|
+
default?: (props: {}) => any;
|
|
256
|
+
}>;
|
|
257
|
+
type __VLS_WithSlots$2<T, S> = T & {
|
|
258
|
+
new (): {
|
|
259
|
+
$slots: S;
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
//#endregion
|
|
263
|
+
//#region src/components/grid/column/types.d.ts
|
|
264
|
+
/**
|
|
265
|
+
* Props exposed by the {@link Col} component.
|
|
266
|
+
*/
|
|
267
|
+
type ColumnProps = {
|
|
268
|
+
/**
|
|
269
|
+
* Number of columns to stretch the component.
|
|
270
|
+
* Available options are:
|
|
271
|
+
* - `"auto"`: which won't try to stretch the component
|
|
272
|
+
* - `"1"` to `"12"`.
|
|
273
|
+
* @default "12"
|
|
274
|
+
*/
|
|
275
|
+
cols?: Cols;
|
|
276
|
+
/**
|
|
277
|
+
* Component id to use on automated tests.
|
|
278
|
+
*/
|
|
279
|
+
dataTestid?: string;
|
|
280
|
+
};
|
|
281
|
+
type Cols = "auto" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12";
|
|
282
|
+
//#endregion
|
|
283
|
+
//#region src/components/grid/column/column.vue.d.ts
|
|
284
|
+
/**
|
|
285
|
+
* Column component to be placed within a row.
|
|
286
|
+
*
|
|
287
|
+
* @example
|
|
288
|
+
* ```vue
|
|
289
|
+
* <container>
|
|
290
|
+
* <row>
|
|
291
|
+
* <col>
|
|
292
|
+
* <!-- uimed-components -->
|
|
293
|
+
* </col>
|
|
294
|
+
* </row>
|
|
295
|
+
* </container>
|
|
296
|
+
* ```
|
|
297
|
+
*
|
|
298
|
+
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/layout | Column Guide}
|
|
299
|
+
*/
|
|
300
|
+
declare const _default$1: typeof __VLS_export$1;
|
|
301
|
+
declare const __VLS_export$1: __VLS_WithSlots$1<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<ColumnProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<ColumnProps> & Readonly<{}>, {
|
|
302
|
+
cols: "12" | "auto" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11";
|
|
303
|
+
}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, {
|
|
304
|
+
default?: (props: {}) => any;
|
|
305
|
+
}>;
|
|
306
|
+
type __VLS_WithSlots$1<T, S> = T & {
|
|
307
|
+
new (): {
|
|
308
|
+
$slots: S;
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
//#endregion
|
|
312
|
+
//#region src/components/frm/types.d.ts
|
|
313
|
+
/**
|
|
314
|
+
* Props exposed by the {@link Frm} component.
|
|
315
|
+
*/
|
|
316
|
+
type FrmProps = {
|
|
317
|
+
/**
|
|
318
|
+
* Id to set on `form` native element.
|
|
319
|
+
*/
|
|
320
|
+
id?: string;
|
|
321
|
+
/**
|
|
322
|
+
* Component id to use on automated tests.
|
|
323
|
+
*/
|
|
324
|
+
dataTestid?: string;
|
|
325
|
+
};
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region src/components/frm/frm.vue.d.ts
|
|
328
|
+
/**
|
|
329
|
+
* Form component to be used throughout the application.
|
|
330
|
+
*
|
|
331
|
+
* @example
|
|
332
|
+
* ```vue
|
|
333
|
+
* <frm @submit="onSubmit">
|
|
334
|
+
* <!-- uimed-field-components -->
|
|
335
|
+
* <!-- uimed-submit-btn-component -->
|
|
336
|
+
* </frm>
|
|
337
|
+
* ```
|
|
338
|
+
*
|
|
339
|
+
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/frm | Form Guide}
|
|
340
|
+
*/
|
|
341
|
+
declare const _default$3: typeof __VLS_export;
|
|
342
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<FrmProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {} & {
|
|
343
|
+
submit: (event: SubmitEvent) => any;
|
|
344
|
+
}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<FrmProps> & Readonly<{
|
|
345
|
+
onSubmit?: ((event: SubmitEvent) => any) | undefined;
|
|
346
|
+
}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, {
|
|
347
|
+
default?: (props: {}) => any;
|
|
348
|
+
}>;
|
|
349
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
350
|
+
new (): {
|
|
351
|
+
$slots: S;
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
//#endregion
|
|
355
|
+
export { _default as Btn, _default$1 as Column, _default$2 as Container, _default$3 as Frm, _default$4 as Root, _default$5 as Row, _default$6 as TextField };
|
package/dist/components.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { computed, createBlock, createPropsRestProxy, defineComponent, mergeModels, openBlock, renderSlot, toValue, unref, useModel, withCtx } from "vue";
|
|
2
|
-
import { VApp, VBtn, VTextField } from "vuetify/components";
|
|
1
|
+
import { computed, createBlock, createPropsRestProxy, defineComponent, mergeModels, openBlock, renderSlot, toValue, unref, useModel, withCtx, withModifiers } from "vue";
|
|
2
|
+
import { VApp, VBtn, VCol, VContainer, VForm, VRow, VTextField } from "vuetify/components";
|
|
3
|
+
import { isEmail, isEmpty, isPhone, isUrl } from "@nexdom/shared/utils";
|
|
3
4
|
//#endregion
|
|
4
5
|
//#region src/components/root/root.vue
|
|
5
6
|
var root_default = /* @__PURE__ */ defineComponent({
|
|
@@ -20,7 +21,7 @@ var root_default = /* @__PURE__ */ defineComponent({
|
|
|
20
21
|
}
|
|
21
22
|
});
|
|
22
23
|
//#endregion
|
|
23
|
-
//#region src/
|
|
24
|
+
//#region src/composables/btn.ts
|
|
24
25
|
const btnVariantToVuetifyVariant = {
|
|
25
26
|
primary: "elevated",
|
|
26
27
|
secondary: "flat",
|
|
@@ -46,6 +47,14 @@ function useBtnColor(color) {
|
|
|
46
47
|
return colorValue ? btnColorToVuetifyColor[colorValue] : btnColorToVuetifyColor.primary;
|
|
47
48
|
});
|
|
48
49
|
}
|
|
50
|
+
function useBtnType(type) {
|
|
51
|
+
return computed(() => {
|
|
52
|
+
return toValue(type) ?? "button";
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function useBtnForm(form) {
|
|
56
|
+
return computed(() => toValue(form));
|
|
57
|
+
}
|
|
49
58
|
//#endregion
|
|
50
59
|
//#region src/components/btn/btn.vue
|
|
51
60
|
var btn_default = /* @__PURE__ */ defineComponent({
|
|
@@ -56,6 +65,10 @@ var btn_default = /* @__PURE__ */ defineComponent({
|
|
|
56
65
|
type: String,
|
|
57
66
|
required: false
|
|
58
67
|
},
|
|
68
|
+
type: {
|
|
69
|
+
type: String,
|
|
70
|
+
required: false
|
|
71
|
+
},
|
|
59
72
|
color: {
|
|
60
73
|
type: String,
|
|
61
74
|
required: false
|
|
@@ -68,6 +81,10 @@ var btn_default = /* @__PURE__ */ defineComponent({
|
|
|
68
81
|
type: Boolean,
|
|
69
82
|
required: false
|
|
70
83
|
},
|
|
84
|
+
form: {
|
|
85
|
+
type: String,
|
|
86
|
+
required: false
|
|
87
|
+
},
|
|
71
88
|
dataTestid: {
|
|
72
89
|
type: String,
|
|
73
90
|
required: false
|
|
@@ -77,34 +94,63 @@ var btn_default = /* @__PURE__ */ defineComponent({
|
|
|
77
94
|
setup(__props, { emit: __emit }) {
|
|
78
95
|
const props = __props;
|
|
79
96
|
const emit = __emit;
|
|
80
|
-
const
|
|
81
|
-
const
|
|
97
|
+
const variant = useBtnVariant(() => props.variant);
|
|
98
|
+
const color = useBtnColor(() => props.color);
|
|
99
|
+
const type = useBtnType(() => props.type);
|
|
100
|
+
const form = useBtnForm(() => props.form);
|
|
82
101
|
function onClick(event) {
|
|
83
102
|
emit("click", event);
|
|
84
103
|
}
|
|
85
104
|
return (_ctx, _cache) => {
|
|
86
105
|
return openBlock(), createBlock(unref(VBtn), {
|
|
87
|
-
variant: unref(vuetifyVariant),
|
|
88
|
-
color: unref(vuetifyColor),
|
|
89
106
|
disabled: props.disabled,
|
|
90
107
|
loading: props.loading,
|
|
91
108
|
"data-testid": props.dataTestid,
|
|
109
|
+
variant: unref(variant),
|
|
110
|
+
color: unref(color),
|
|
111
|
+
type: unref(type),
|
|
112
|
+
form: unref(form),
|
|
92
113
|
onClick
|
|
93
114
|
}, {
|
|
94
115
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
95
116
|
_: 3
|
|
96
117
|
}, 8, [
|
|
97
|
-
"variant",
|
|
98
|
-
"color",
|
|
99
118
|
"disabled",
|
|
100
119
|
"loading",
|
|
101
|
-
"data-testid"
|
|
120
|
+
"data-testid",
|
|
121
|
+
"variant",
|
|
122
|
+
"color",
|
|
123
|
+
"type",
|
|
124
|
+
"form"
|
|
102
125
|
]);
|
|
103
126
|
};
|
|
104
127
|
}
|
|
105
128
|
});
|
|
106
129
|
//#endregion
|
|
107
|
-
//#region src/
|
|
130
|
+
//#region src/composables/inputs/rules.ts
|
|
131
|
+
function required(value) {
|
|
132
|
+
return !isEmpty(value) || "Campo obrigatório";
|
|
133
|
+
}
|
|
134
|
+
function phone(value) {
|
|
135
|
+
return isEmpty(value) || isPhone(value) || "Número inválido";
|
|
136
|
+
}
|
|
137
|
+
function email(value) {
|
|
138
|
+
return isEmpty(value) || isEmail(value) || "E-mail inválido";
|
|
139
|
+
}
|
|
140
|
+
function url(value) {
|
|
141
|
+
return isEmpty(value) || isUrl(value) || "URL inválida";
|
|
142
|
+
}
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/composables/inputs/use-rules.ts
|
|
145
|
+
function useRules(options) {
|
|
146
|
+
return computed(() => {
|
|
147
|
+
const rules = [];
|
|
148
|
+
if (options.required) rules.push(required);
|
|
149
|
+
return rules;
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/composables/inputs/text-field.ts
|
|
108
154
|
const textFieldVariantToVuetifyVariant = {
|
|
109
155
|
primary: "underlined",
|
|
110
156
|
secondary: "outlined"
|
|
@@ -117,6 +163,11 @@ const textFieldTypeToVuetifyType = {
|
|
|
117
163
|
password: "password",
|
|
118
164
|
search: "text"
|
|
119
165
|
};
|
|
166
|
+
const textFieldTypeToVuetifyRule = {
|
|
167
|
+
phone,
|
|
168
|
+
email,
|
|
169
|
+
url
|
|
170
|
+
};
|
|
120
171
|
function useTextFieldVariant(variant) {
|
|
121
172
|
return computed(() => {
|
|
122
173
|
const variantValue = toValue(variant);
|
|
@@ -129,8 +180,20 @@ function useTextFieldType(type) {
|
|
|
129
180
|
return typeValue ? textFieldTypeToVuetifyType[typeValue] : textFieldTypeToVuetifyType.text;
|
|
130
181
|
});
|
|
131
182
|
}
|
|
183
|
+
function useTextFieldRules(props) {
|
|
184
|
+
const defaultRules = useRules(props);
|
|
185
|
+
return computed(() => {
|
|
186
|
+
const rules = [...defaultRules.value];
|
|
187
|
+
const typeRule = associatedRuleType(props.type) ? textFieldTypeToVuetifyRule[props.type] : void 0;
|
|
188
|
+
if (typeRule) rules.push(typeRule);
|
|
189
|
+
return rules;
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
function associatedRuleType(type) {
|
|
193
|
+
return type in textFieldTypeToVuetifyRule;
|
|
194
|
+
}
|
|
132
195
|
//#endregion
|
|
133
|
-
//#region src/components/text-field/text-field.vue
|
|
196
|
+
//#region src/components/inputs/text-field/text-field.vue
|
|
134
197
|
var text_field_default = /* @__PURE__ */ defineComponent({
|
|
135
198
|
inheritAttrs: false,
|
|
136
199
|
__name: "text-field",
|
|
@@ -160,6 +223,10 @@ var text_field_default = /* @__PURE__ */ defineComponent({
|
|
|
160
223
|
type: Boolean,
|
|
161
224
|
required: false
|
|
162
225
|
},
|
|
226
|
+
required: {
|
|
227
|
+
type: Boolean,
|
|
228
|
+
required: false
|
|
229
|
+
},
|
|
163
230
|
label: {
|
|
164
231
|
type: String,
|
|
165
232
|
required: false
|
|
@@ -189,6 +256,7 @@ var text_field_default = /* @__PURE__ */ defineComponent({
|
|
|
189
256
|
const props = createPropsRestProxy(__props, ["clearable"]);
|
|
190
257
|
const vuetifyVariant = useTextFieldVariant(() => props.variant);
|
|
191
258
|
const vuetifyType = useTextFieldType(() => props.type);
|
|
259
|
+
const rules = useTextFieldRules(props);
|
|
192
260
|
const computedClearable = computed(() => __props.clearable ?? props.type === "search");
|
|
193
261
|
return (_ctx, _cache) => {
|
|
194
262
|
return openBlock(), createBlock(unref(VTextField), {
|
|
@@ -196,6 +264,7 @@ var text_field_default = /* @__PURE__ */ defineComponent({
|
|
|
196
264
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
197
265
|
variant: unref(vuetifyVariant),
|
|
198
266
|
type: unref(vuetifyType),
|
|
267
|
+
rules: unref(rules),
|
|
199
268
|
"data-testid": props.dataTestid,
|
|
200
269
|
disabled: props.disabled,
|
|
201
270
|
loading: props.loading,
|
|
@@ -208,6 +277,7 @@ var text_field_default = /* @__PURE__ */ defineComponent({
|
|
|
208
277
|
"modelValue",
|
|
209
278
|
"variant",
|
|
210
279
|
"type",
|
|
280
|
+
"rules",
|
|
211
281
|
"data-testid",
|
|
212
282
|
"disabled",
|
|
213
283
|
"loading",
|
|
@@ -221,4 +291,110 @@ var text_field_default = /* @__PURE__ */ defineComponent({
|
|
|
221
291
|
}
|
|
222
292
|
});
|
|
223
293
|
//#endregion
|
|
224
|
-
|
|
294
|
+
//#region src/components/grid/container/container.vue
|
|
295
|
+
var container_default = /* @__PURE__ */ defineComponent({
|
|
296
|
+
inheritAttrs: false,
|
|
297
|
+
__name: "container",
|
|
298
|
+
props: { dataTestid: {
|
|
299
|
+
type: String,
|
|
300
|
+
required: false
|
|
301
|
+
} },
|
|
302
|
+
setup(__props) {
|
|
303
|
+
const props = __props;
|
|
304
|
+
return (_ctx, _cache) => {
|
|
305
|
+
return openBlock(), createBlock(unref(VContainer), {
|
|
306
|
+
"data-testid": props.dataTestid,
|
|
307
|
+
fluid: ""
|
|
308
|
+
}, {
|
|
309
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
310
|
+
_: 3
|
|
311
|
+
}, 8, ["data-testid"]);
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region src/components/grid/row/row.vue
|
|
317
|
+
var row_default = /* @__PURE__ */ defineComponent({
|
|
318
|
+
inheritAttrs: false,
|
|
319
|
+
__name: "row",
|
|
320
|
+
props: { dataTestid: {
|
|
321
|
+
type: String,
|
|
322
|
+
required: false
|
|
323
|
+
} },
|
|
324
|
+
setup(__props) {
|
|
325
|
+
const props = __props;
|
|
326
|
+
return (_ctx, _cache) => {
|
|
327
|
+
return openBlock(), createBlock(unref(VRow), { "data-testid": props.dataTestid }, {
|
|
328
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
329
|
+
_: 3
|
|
330
|
+
}, 8, ["data-testid"]);
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region src/components/grid/column/column.vue
|
|
336
|
+
var column_default = /* @__PURE__ */ defineComponent({
|
|
337
|
+
inheritAttrs: false,
|
|
338
|
+
__name: "column",
|
|
339
|
+
props: {
|
|
340
|
+
cols: {
|
|
341
|
+
type: String,
|
|
342
|
+
required: false,
|
|
343
|
+
default: "12"
|
|
344
|
+
},
|
|
345
|
+
dataTestid: {
|
|
346
|
+
type: String,
|
|
347
|
+
required: false
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
setup(__props) {
|
|
351
|
+
const props = __props;
|
|
352
|
+
return (_ctx, _cache) => {
|
|
353
|
+
return openBlock(), createBlock(unref(VCol), {
|
|
354
|
+
cols: "12",
|
|
355
|
+
sm: props.cols,
|
|
356
|
+
"data-testid": props.dataTestid
|
|
357
|
+
}, {
|
|
358
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
359
|
+
_: 3
|
|
360
|
+
}, 8, ["sm", "data-testid"]);
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
//#endregion
|
|
365
|
+
//#region src/components/frm/frm.vue
|
|
366
|
+
var frm_default = /* @__PURE__ */ defineComponent({
|
|
367
|
+
inheritAttrs: false,
|
|
368
|
+
__name: "frm",
|
|
369
|
+
props: {
|
|
370
|
+
id: {
|
|
371
|
+
type: String,
|
|
372
|
+
required: false
|
|
373
|
+
},
|
|
374
|
+
dataTestid: {
|
|
375
|
+
type: String,
|
|
376
|
+
required: false
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
emits: ["submit"],
|
|
380
|
+
setup(__props, { emit: __emit }) {
|
|
381
|
+
const props = __props;
|
|
382
|
+
const emit = __emit;
|
|
383
|
+
async function onSubmit(event) {
|
|
384
|
+
const { valid } = await event;
|
|
385
|
+
if (valid) emit("submit", event);
|
|
386
|
+
}
|
|
387
|
+
return (_ctx, _cache) => {
|
|
388
|
+
return openBlock(), createBlock(unref(VForm), {
|
|
389
|
+
id: props.id,
|
|
390
|
+
"data-testid": props.dataTestid,
|
|
391
|
+
onSubmit: withModifiers(onSubmit, ["prevent"])
|
|
392
|
+
}, {
|
|
393
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
394
|
+
_: 3
|
|
395
|
+
}, 8, ["id", "data-testid"]);
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
//#endregion
|
|
400
|
+
export { btn_default as Btn, column_default as Column, container_default as Container, frm_default as Frm, root_default as Root, row_default as Row, text_field_default as TextField };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexdom/uimed-vue",
|
|
3
|
-
"version": "1.1.0-beta.
|
|
3
|
+
"version": "1.1.0-beta.4",
|
|
4
4
|
"description": "A ui framework for NEXDOM applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lib",
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"@commitlint/config-conventional": "^21.2.0",
|
|
55
55
|
"@fontsource/roboto": "^5.3.0",
|
|
56
56
|
"@mdi/font": "^7.4.47",
|
|
57
|
+
"@nexdom/shared": "^2.1.1",
|
|
57
58
|
"@playwright/test": "^1.62.1",
|
|
58
59
|
"@stryker-mutator/core": "^10.0.0",
|
|
59
60
|
"@stryker-mutator/vitest-runner": "^10.0.0",
|
|
@@ -71,7 +72,6 @@
|
|
|
71
72
|
"resize-observer-polyfill": "^1.5.1",
|
|
72
73
|
"sass-embedded": "^1.103.1",
|
|
73
74
|
"stryker-vue-ignorer": "github:davidlandais/stryker-vue-ignorer",
|
|
74
|
-
"type-fest": "^5.8.0",
|
|
75
75
|
"typescript": "^6.0.3",
|
|
76
76
|
"vite-plugin-vuetify": "^2.1.3",
|
|
77
77
|
"vite-plus": "^0.2.9",
|
|
@@ -84,6 +84,7 @@
|
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"@fontsource/roboto": "^5.3.0",
|
|
86
86
|
"@mdi/font": "^7.4.47",
|
|
87
|
+
"@nexdom/shared": "^2.1.1",
|
|
87
88
|
"resize-observer-polyfill": "^1.5.1",
|
|
88
89
|
"vite-plugin-vuetify": "^2.1.3",
|
|
89
90
|
"vite-plus": "^0.2.7",
|