@nexdom/uimed-vue 2.0.0-beta.7 → 2.0.0-beta.8
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/components.d.ts +127 -15
- package/dist/components.js +156 -14
- package/package.json +1 -1
package/dist/components.d.ts
CHANGED
|
@@ -171,8 +171,8 @@ type MainProps = {
|
|
|
171
171
|
*
|
|
172
172
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/main | Main Guide}
|
|
173
173
|
*/
|
|
174
|
-
declare const _default$
|
|
175
|
-
declare const __VLS_export$
|
|
174
|
+
declare const _default$7: typeof __VLS_export$12;
|
|
175
|
+
declare const __VLS_export$12: __VLS_WithSlots$8<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<MainProps & {
|
|
176
176
|
notificationsOpen?: boolean;
|
|
177
177
|
}, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {
|
|
178
178
|
"update:notificationsOpen": (value: boolean) => any;
|
|
@@ -248,8 +248,8 @@ type ButtonProps = {
|
|
|
248
248
|
*
|
|
249
249
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/button | Button Guide}
|
|
250
250
|
*/
|
|
251
|
-
declare const _default: typeof __VLS_export$
|
|
252
|
-
declare const __VLS_export$
|
|
251
|
+
declare const _default$1: typeof __VLS_export$11;
|
|
252
|
+
declare const __VLS_export$11: __VLS_WithSlots$7<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<ButtonProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {} & {
|
|
253
253
|
click: (event: MouseEvent) => any;
|
|
254
254
|
}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<ButtonProps> & Readonly<{
|
|
255
255
|
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
@@ -326,6 +326,118 @@ type TextFieldProps = {
|
|
|
326
326
|
dataTestid?: string;
|
|
327
327
|
};
|
|
328
328
|
//#endregion
|
|
329
|
+
//#region src/components/inputs/autocomplete-field/types.d.ts
|
|
330
|
+
/**
|
|
331
|
+
* Autocomplete/Combobox item type that can be either a string or an object with label and value.
|
|
332
|
+
*/
|
|
333
|
+
type AutocompleteItem<T = string> = string | {
|
|
334
|
+
label: string;
|
|
335
|
+
value: T;
|
|
336
|
+
};
|
|
337
|
+
/**
|
|
338
|
+
* Props exposed by the {@link AutocompleteField} component.
|
|
339
|
+
*/
|
|
340
|
+
type AutocompleteFieldProps<T = string, Multiple extends boolean = false> = {
|
|
341
|
+
/**
|
|
342
|
+
* Applies a distinct style variation to the field.
|
|
343
|
+
* One of `primary` or `secondary`.
|
|
344
|
+
* @default "primary"
|
|
345
|
+
*/
|
|
346
|
+
variant?: TextFieldVariant;
|
|
347
|
+
/**
|
|
348
|
+
* Removes the ability to click or target the field.
|
|
349
|
+
* @default false
|
|
350
|
+
*/
|
|
351
|
+
disabled?: boolean;
|
|
352
|
+
/**
|
|
353
|
+
* Displays a loading indicator on the input.
|
|
354
|
+
* @default false
|
|
355
|
+
*/
|
|
356
|
+
loading?: boolean;
|
|
357
|
+
/**
|
|
358
|
+
* Displays clear action.
|
|
359
|
+
* @default false
|
|
360
|
+
*/
|
|
361
|
+
clearable?: boolean;
|
|
362
|
+
/**
|
|
363
|
+
* Prevent value changes.
|
|
364
|
+
* @default false
|
|
365
|
+
*/
|
|
366
|
+
readonly?: boolean;
|
|
367
|
+
/**
|
|
368
|
+
* Add rules to require field to be filled before form submission.
|
|
369
|
+
* @default false
|
|
370
|
+
*/
|
|
371
|
+
required?: boolean;
|
|
372
|
+
/**
|
|
373
|
+
* Field label.
|
|
374
|
+
*/
|
|
375
|
+
label?: string;
|
|
376
|
+
/**
|
|
377
|
+
* Field placeholder.
|
|
378
|
+
*/
|
|
379
|
+
placeholder?: string;
|
|
380
|
+
/**
|
|
381
|
+
* Field message to show and direct user to fill field correctly.
|
|
382
|
+
*
|
|
383
|
+
* This message will be replaced when there's an error message to be shown.
|
|
384
|
+
*/
|
|
385
|
+
hint?: string;
|
|
386
|
+
/**
|
|
387
|
+
* Component id to use on automated tests.
|
|
388
|
+
*/
|
|
389
|
+
dataTestid?: string;
|
|
390
|
+
/**
|
|
391
|
+
* Used to prevent user from adding new values to the list.
|
|
392
|
+
* @default false
|
|
393
|
+
*/
|
|
394
|
+
strict?: boolean;
|
|
395
|
+
/**
|
|
396
|
+
* Allow selecting/typing more than one value.
|
|
397
|
+
*
|
|
398
|
+
* Passing the literal `true` narrows `modelValue` and `update:modelValue`
|
|
399
|
+
* to `T[]` instead of `T`.
|
|
400
|
+
* @default false
|
|
401
|
+
*/
|
|
402
|
+
multiple?: Multiple;
|
|
403
|
+
/**
|
|
404
|
+
* List of autocomplete items. Can be strings or objects with label and value.
|
|
405
|
+
* @default []
|
|
406
|
+
*/
|
|
407
|
+
items?: AutocompleteItem<T>[];
|
|
408
|
+
};
|
|
409
|
+
//#endregion
|
|
410
|
+
//#region src/components/inputs/autocomplete-field/autocomplete-field.vue.d.ts
|
|
411
|
+
/**
|
|
412
|
+
* Select field component to be used throughout the application.
|
|
413
|
+
*
|
|
414
|
+
* @example
|
|
415
|
+
* ```vue
|
|
416
|
+
* <template>
|
|
417
|
+
* <u-autocomplete-field label="Country" :items="['Brazil', 'Argentina']" />
|
|
418
|
+
* </template>
|
|
419
|
+
* ```
|
|
420
|
+
*
|
|
421
|
+
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/autocomplete-field | AutocompleteField Guide}
|
|
422
|
+
*/
|
|
423
|
+
declare const _default: typeof __VLS_export$10;
|
|
424
|
+
declare const __VLS_export$10: <T = string, Multiple extends boolean = false>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal$1<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
425
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal$1<(AutocompleteFieldProps<T, Multiple> & {
|
|
426
|
+
modelValue?: Multiple extends true ? T[] : T;
|
|
427
|
+
}) & {
|
|
428
|
+
"onUpdate:modelValue"?: ((value: Multiple extends true ? T[] : T | undefined) => any) | undefined;
|
|
429
|
+
}> & (typeof globalThis extends {
|
|
430
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
431
|
+
} ? P : {});
|
|
432
|
+
expose: (exposed: {}) => void;
|
|
433
|
+
attrs: any;
|
|
434
|
+
slots: {};
|
|
435
|
+
emit: (event: "update:modelValue", value: Multiple extends true ? T[] : T | undefined) => void;
|
|
436
|
+
}>) => import("vue").VNode & {
|
|
437
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
438
|
+
};
|
|
439
|
+
type __VLS_PrettifyLocal$1<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
440
|
+
//#endregion
|
|
329
441
|
//#region src/components/inputs/text-field/text-field.vue.d.ts
|
|
330
442
|
/**
|
|
331
443
|
* Text field component to be used throughout the application.
|
|
@@ -339,7 +451,7 @@ type TextFieldProps = {
|
|
|
339
451
|
*
|
|
340
452
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/text-field | TextField Guide}
|
|
341
453
|
*/
|
|
342
|
-
declare const _default$
|
|
454
|
+
declare const _default$12: typeof __VLS_export$9;
|
|
343
455
|
declare const __VLS_export$9: import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<TextFieldProps & {
|
|
344
456
|
modelValue?: string;
|
|
345
457
|
}, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {
|
|
@@ -402,7 +514,7 @@ type CheckboxProps<T = boolean> = {
|
|
|
402
514
|
*
|
|
403
515
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/checkbox | Checkbox Guide}
|
|
404
516
|
*/
|
|
405
|
-
declare const _default$
|
|
517
|
+
declare const _default$2: typeof __VLS_export$8;
|
|
406
518
|
declare const __VLS_export$8: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
407
519
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<(CheckboxProps<boolean | T> & {
|
|
408
520
|
modelValue?: T;
|
|
@@ -446,7 +558,7 @@ type ContainerProps = {
|
|
|
446
558
|
*
|
|
447
559
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/layout | Container Guide}
|
|
448
560
|
*/
|
|
449
|
-
declare const _default$
|
|
561
|
+
declare const _default$4: typeof __VLS_export$7;
|
|
450
562
|
declare const __VLS_export$7: __VLS_WithSlots$6<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>, {
|
|
451
563
|
default?: (props: {}) => any;
|
|
452
564
|
}>;
|
|
@@ -484,7 +596,7 @@ type RowProps = {
|
|
|
484
596
|
*
|
|
485
597
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/layout | Row Guide}
|
|
486
598
|
*/
|
|
487
|
-
declare const _default$
|
|
599
|
+
declare const _default$8: typeof __VLS_export$6;
|
|
488
600
|
declare const __VLS_export$6: __VLS_WithSlots$5<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>, {
|
|
489
601
|
default?: (props: {}) => any;
|
|
490
602
|
}>;
|
|
@@ -533,7 +645,7 @@ type Cols = "auto" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10"
|
|
|
533
645
|
*
|
|
534
646
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/layout | Column Guide}
|
|
535
647
|
*/
|
|
536
|
-
declare const _default$
|
|
648
|
+
declare const _default$3: typeof __VLS_export$5;
|
|
537
649
|
declare const __VLS_export$5: __VLS_WithSlots$4<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<{}>, {
|
|
538
650
|
cols: "12" | "auto" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11";
|
|
539
651
|
}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, {
|
|
@@ -576,7 +688,7 @@ type FormProps = {
|
|
|
576
688
|
*
|
|
577
689
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/form | Form Guide}
|
|
578
690
|
*/
|
|
579
|
-
declare const _default$
|
|
691
|
+
declare const _default$6: typeof __VLS_export$4;
|
|
580
692
|
declare const __VLS_export$4: __VLS_WithSlots$3<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<FormProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {} & {
|
|
581
693
|
submit: (event: SubmitEvent) => any;
|
|
582
694
|
}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<FormProps> & Readonly<{
|
|
@@ -606,7 +718,7 @@ type __VLS_WithSlots$3<T, S> = T & {
|
|
|
606
718
|
*
|
|
607
719
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/section | Section Guide}
|
|
608
720
|
*/
|
|
609
|
-
declare const _default$
|
|
721
|
+
declare const _default$10: typeof __VLS_export$3;
|
|
610
722
|
declare const __VLS_export$3: __VLS_WithSlots$2<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<{}, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, true, {}, any>, {
|
|
611
723
|
default?: (props: {}) => any;
|
|
612
724
|
}>;
|
|
@@ -692,7 +804,7 @@ interface SectionAction extends ButtonProps {
|
|
|
692
804
|
*
|
|
693
805
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/section | Section Guide}
|
|
694
806
|
*/
|
|
695
|
-
declare const _default$
|
|
807
|
+
declare const _default$9: typeof __VLS_export$2;
|
|
696
808
|
declare const __VLS_export$2: __VLS_WithSlots$1<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<SectionProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<SectionProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, {
|
|
697
809
|
default?: (props: {}) => any;
|
|
698
810
|
}>;
|
|
@@ -767,7 +879,7 @@ type TableProps = {
|
|
|
767
879
|
*
|
|
768
880
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/table | Table Guide}
|
|
769
881
|
*/
|
|
770
|
-
declare const _default$
|
|
882
|
+
declare const _default$11: typeof __VLS_export$1;
|
|
771
883
|
declare const __VLS_export$1: import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<TableProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<TableProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>;
|
|
772
884
|
//#endregion
|
|
773
885
|
//#region src/components/details/types.d.ts
|
|
@@ -815,7 +927,7 @@ type DetailsProps = {
|
|
|
815
927
|
*
|
|
816
928
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/details | Details Guide}
|
|
817
929
|
*/
|
|
818
|
-
declare const _default$
|
|
930
|
+
declare const _default$5: typeof __VLS_export;
|
|
819
931
|
declare const __VLS_export: __VLS_WithSlots<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<DetailsProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<DetailsProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, {
|
|
820
932
|
default?: (props: {}) => any;
|
|
821
933
|
}>;
|
|
@@ -825,4 +937,4 @@ type __VLS_WithSlots<T, S> = T & {
|
|
|
825
937
|
};
|
|
826
938
|
};
|
|
827
939
|
//#endregion
|
|
828
|
-
export { _default as
|
|
940
|
+
export { _default as UAutocompleteField, _default$1 as UButton, _default$2 as UCheckbox, _default$3 as UColumn, _default$4 as UContainer, _default$5 as UDetails, _default$6 as UForm, _default$7 as UMain, _default$8 as URow, _default$9 as USection, _default$10 as USectionContent, _default$11 as UTable, _default$12 as UTextField };
|
package/dist/components.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as useVuetifyColor, t as messages } from "./use-toast-CACuYhK_.js";
|
|
2
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, isRef, mergeModels, mergeProps, normalizeClass, openBlock, ref, renderList, renderSlot, toDisplayString, toValue, unref, useModel, withCtx, withModifiers } from "vue";
|
|
3
|
-
import { VApp, VAppBar, VAppBarNavIcon, VAppBarTitle, VAvatar, VBadge, VBtn, VCard, VCardActions, VCardText, VCheckboxBtn, VCol, VContainer, VDivider, VExpansionPanel, VExpansionPanelText, VExpansionPanelTitle, VExpansionPanels, VForm, VIcon, VIconBtn, VImg, VList, VListGroup, VListItem, VListItemAction, VListSubheader, VMain, VMenu, VNavigationDrawer, VRow, VSkeletonLoader, VSnackbarQueue, VTable, VTextField } from "vuetify/components";
|
|
2
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, isRef, mergeModels, mergeProps, normalizeClass, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, toValue, unref, useModel, withCtx, withModifiers } from "vue";
|
|
3
|
+
import { VApp, VAppBar, VAppBarNavIcon, VAppBarTitle, VAutocomplete, VAvatar, VBadge, VBtn, VCard, VCardActions, VCardText, VCheckboxBtn, VCol, VCombobox, VContainer, VDivider, VExpansionPanel, VExpansionPanelText, VExpansionPanelTitle, VExpansionPanels, VForm, VIcon, VIconBtn, VImg, VList, VListGroup, VListItem, VListItemAction, VListSubheader, VMain, VMenu, VNavigationDrawer, VRow, VSkeletonLoader, VSnackbarQueue, VTable, VTextField } from "vuetify/components";
|
|
4
4
|
import { formatDateTime, isEmail, isEmpty, isPhone, isUrl, toPeriodInterval } from "@nexdom/shared/utils";
|
|
5
5
|
//#region src/composables/navigation/use-route-props.ts
|
|
6
6
|
function useRouteProps(route) {
|
|
@@ -244,7 +244,23 @@ function url(value) {
|
|
|
244
244
|
return isEmpty(value) || isUrl(value) || "URL inválida";
|
|
245
245
|
}
|
|
246
246
|
//#endregion
|
|
247
|
-
//#region src/composables/inputs/
|
|
247
|
+
//#region src/composables/inputs/fields.ts
|
|
248
|
+
const textFieldVariantToVuetifyVariant = {
|
|
249
|
+
primary: "underlined",
|
|
250
|
+
secondary: "outlined"
|
|
251
|
+
};
|
|
252
|
+
function useTextFieldVariant(variant) {
|
|
253
|
+
return computed(() => {
|
|
254
|
+
const variantValue = toValue(variant);
|
|
255
|
+
return textFieldVariantToVuetifyVariant[variantValue];
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
function createRequiredRule(required, isPresent) {
|
|
259
|
+
return (value) => {
|
|
260
|
+
if (!required) return true;
|
|
261
|
+
return isPresent(value) || "Campo obrigatório";
|
|
262
|
+
};
|
|
263
|
+
}
|
|
248
264
|
function useRules(options) {
|
|
249
265
|
return computed(() => {
|
|
250
266
|
const rules = [];
|
|
@@ -254,10 +270,6 @@ function useRules(options) {
|
|
|
254
270
|
}
|
|
255
271
|
//#endregion
|
|
256
272
|
//#region src/composables/inputs/text-field.ts
|
|
257
|
-
const textFieldVariantToVuetifyVariant = {
|
|
258
|
-
primary: "underlined",
|
|
259
|
-
secondary: "outlined"
|
|
260
|
-
};
|
|
261
273
|
const textFieldTypeToVuetifyType = {
|
|
262
274
|
text: "text",
|
|
263
275
|
phone: "tel",
|
|
@@ -271,12 +283,6 @@ const textFieldTypeToVuetifyRule = {
|
|
|
271
283
|
email,
|
|
272
284
|
url
|
|
273
285
|
};
|
|
274
|
-
function useTextFieldVariant(variant) {
|
|
275
|
-
return computed(() => {
|
|
276
|
-
const variantValue = toValue(variant);
|
|
277
|
-
return textFieldVariantToVuetifyVariant[variantValue];
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
286
|
function useTextFieldType(type) {
|
|
281
287
|
return computed(() => {
|
|
282
288
|
const typeValue = toValue(type);
|
|
@@ -700,6 +706,142 @@ var button_default = /* @__PURE__ */ defineComponent({
|
|
|
700
706
|
}
|
|
701
707
|
});
|
|
702
708
|
//#endregion
|
|
709
|
+
//#region src/composables/inputs/autocomplete-field.ts
|
|
710
|
+
function createAutocompleteRequiredRule(options) {
|
|
711
|
+
return createRequiredRule(options.required, (value) => {
|
|
712
|
+
if (options.multiple) return (Array.isArray(value) ? value : []).length > 0;
|
|
713
|
+
return !isEmpty(String(value ?? ""));
|
|
714
|
+
});
|
|
715
|
+
}
|
|
716
|
+
function useAutocompleteRules(options) {
|
|
717
|
+
return computed(() => {
|
|
718
|
+
const opts = toValue(options);
|
|
719
|
+
const rules = [];
|
|
720
|
+
if (opts.required) rules.push(createAutocompleteRequiredRule(opts));
|
|
721
|
+
return rules;
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
//#endregion
|
|
725
|
+
//#region src/components/inputs/autocomplete-field/autocomplete-field.vue
|
|
726
|
+
var autocomplete_field_default = /* @__PURE__ */ defineComponent({
|
|
727
|
+
inheritAttrs: false,
|
|
728
|
+
__name: "autocomplete-field",
|
|
729
|
+
props: /*@__PURE__*/ mergeModels({
|
|
730
|
+
variant: {
|
|
731
|
+
type: String,
|
|
732
|
+
required: false,
|
|
733
|
+
default: "primary"
|
|
734
|
+
},
|
|
735
|
+
disabled: {
|
|
736
|
+
type: Boolean,
|
|
737
|
+
required: false
|
|
738
|
+
},
|
|
739
|
+
loading: {
|
|
740
|
+
type: Boolean,
|
|
741
|
+
required: false
|
|
742
|
+
},
|
|
743
|
+
clearable: {
|
|
744
|
+
type: Boolean,
|
|
745
|
+
required: false
|
|
746
|
+
},
|
|
747
|
+
readonly: {
|
|
748
|
+
type: Boolean,
|
|
749
|
+
required: false
|
|
750
|
+
},
|
|
751
|
+
required: {
|
|
752
|
+
type: Boolean,
|
|
753
|
+
required: false
|
|
754
|
+
},
|
|
755
|
+
label: {
|
|
756
|
+
type: String,
|
|
757
|
+
required: false
|
|
758
|
+
},
|
|
759
|
+
placeholder: {
|
|
760
|
+
type: String,
|
|
761
|
+
required: false
|
|
762
|
+
},
|
|
763
|
+
hint: {
|
|
764
|
+
type: String,
|
|
765
|
+
required: false
|
|
766
|
+
},
|
|
767
|
+
dataTestid: {
|
|
768
|
+
type: String,
|
|
769
|
+
required: false
|
|
770
|
+
},
|
|
771
|
+
strict: {
|
|
772
|
+
type: Boolean,
|
|
773
|
+
required: false
|
|
774
|
+
},
|
|
775
|
+
multiple: {
|
|
776
|
+
type: null,
|
|
777
|
+
required: false
|
|
778
|
+
},
|
|
779
|
+
items: {
|
|
780
|
+
type: Array,
|
|
781
|
+
required: false,
|
|
782
|
+
default: () => []
|
|
783
|
+
}
|
|
784
|
+
}, {
|
|
785
|
+
"modelValue": { type: null },
|
|
786
|
+
"modelModifiers": {}
|
|
787
|
+
}),
|
|
788
|
+
emits: ["update:modelValue"],
|
|
789
|
+
setup(__props) {
|
|
790
|
+
const modelValue = useModel(__props, "modelValue");
|
|
791
|
+
const props = __props;
|
|
792
|
+
const vuetifyVariant = useTextFieldVariant(() => props.variant);
|
|
793
|
+
const isMultiple = computed(() => props.multiple ?? false);
|
|
794
|
+
const rules = useAutocompleteRules(() => ({
|
|
795
|
+
required: props.required,
|
|
796
|
+
multiple: isMultiple.value
|
|
797
|
+
}));
|
|
798
|
+
const vuetifyComponent = computed(() => props.strict ? VAutocomplete : VCombobox);
|
|
799
|
+
const normalizedItems = computed(() => {
|
|
800
|
+
return props.items.map((item) => {
|
|
801
|
+
if (typeof item === "string") return {
|
|
802
|
+
label: item,
|
|
803
|
+
value: item
|
|
804
|
+
};
|
|
805
|
+
return item;
|
|
806
|
+
});
|
|
807
|
+
});
|
|
808
|
+
return (_ctx, _cache) => {
|
|
809
|
+
return openBlock(), createBlock(resolveDynamicComponent(vuetifyComponent.value), {
|
|
810
|
+
modelValue: modelValue.value,
|
|
811
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
812
|
+
variant: unref(vuetifyVariant),
|
|
813
|
+
items: normalizedItems.value,
|
|
814
|
+
"data-testid": props.dataTestid,
|
|
815
|
+
disabled: props.disabled,
|
|
816
|
+
loading: props.loading,
|
|
817
|
+
readonly: props.readonly,
|
|
818
|
+
label: props.label,
|
|
819
|
+
placeholder: props.placeholder,
|
|
820
|
+
hint: props.hint,
|
|
821
|
+
clearable: props.clearable,
|
|
822
|
+
multiple: isMultiple.value,
|
|
823
|
+
"item-title": "label",
|
|
824
|
+
rules: unref(rules),
|
|
825
|
+
chips: ""
|
|
826
|
+
}, null, 8, [
|
|
827
|
+
"modelValue",
|
|
828
|
+
"variant",
|
|
829
|
+
"items",
|
|
830
|
+
"data-testid",
|
|
831
|
+
"disabled",
|
|
832
|
+
"loading",
|
|
833
|
+
"readonly",
|
|
834
|
+
"label",
|
|
835
|
+
"placeholder",
|
|
836
|
+
"hint",
|
|
837
|
+
"clearable",
|
|
838
|
+
"multiple",
|
|
839
|
+
"rules"
|
|
840
|
+
]);
|
|
841
|
+
};
|
|
842
|
+
}
|
|
843
|
+
});
|
|
844
|
+
//#endregion
|
|
703
845
|
//#region src/components/inputs/checkbox/checkbox.vue
|
|
704
846
|
var checkbox_default = /* @__PURE__ */ defineComponent({
|
|
705
847
|
inheritAttrs: false,
|
|
@@ -1109,4 +1251,4 @@ var details_default = /* @__PURE__ */ defineComponent({
|
|
|
1109
1251
|
}
|
|
1110
1252
|
});
|
|
1111
1253
|
//#endregion
|
|
1112
|
-
export { button_default as UButton, checkbox_default as UCheckbox, column_default as UColumn, container_default as UContainer, details_default as UDetails, form_default as UForm, main_default as UMain, row_default as URow, section_default as USection, section_content_default as USectionContent, table_default as UTable, text_field_default as UTextField };
|
|
1254
|
+
export { autocomplete_field_default as UAutocompleteField, button_default as UButton, checkbox_default as UCheckbox, column_default as UColumn, container_default as UContainer, details_default as UDetails, form_default as UForm, main_default as UMain, row_default as URow, section_default as USection, section_content_default as USectionContent, table_default as UTable, text_field_default as UTextField };
|