@nexdom/uimed-vue 2.0.0-beta.6 → 2.0.0-beta.60
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/AGENTS.md +131 -17
- package/README.md +1 -1
- package/dist/_virtual/_rolldown/runtime.js +7 -0
- package/dist/components/app-bar/app-bar.js +5 -0
- package/dist/components/app-bar/app-bar.vue_vue_type_script_setup_true_lang.js +286 -0
- package/dist/components/app-bar/types.d.ts +96 -0
- package/dist/components/button/button.js +5 -0
- package/dist/components/button/button.vue.d.ts +31 -0
- package/dist/components/button/button.vue_vue_type_script_setup_true_lang.js +97 -0
- package/dist/components/button/types.d.ts +65 -0
- package/dist/components/data-sets/data-set/data-set.js +5 -0
- package/dist/components/data-sets/data-set/data-set.vue.d.ts +47 -0
- package/dist/components/data-sets/data-set/data-set.vue_vue_type_script_setup_true_lang.js +157 -0
- package/dist/components/data-sets/data-set/types.d.ts +91 -0
- package/dist/components/data-sets/data-set-bar.js +5 -0
- package/dist/components/data-sets/data-set-bar.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/components/data-sets/data-set-item/data-set-item.js +5 -0
- package/dist/components/data-sets/data-set-item/data-set-item.vue.d.ts +35 -0
- package/dist/components/data-sets/data-set-item/data-set-item.vue_vue_type_script_setup_true_lang.js +57 -0
- package/dist/components/data-sets/data-set-item/types.d.ts +42 -0
- package/dist/components/details/details.js +5 -0
- package/dist/components/details/details.vue.d.ts +28 -0
- package/dist/components/details/details.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/components/details/types.d.ts +29 -0
- package/dist/components/dialogs/dialog/dialog-host-key.js +10 -0
- package/dist/components/dialogs/dialog/dialog.js +5 -0
- package/dist/components/dialogs/dialog/dialog.vue.d.ts +36 -0
- package/dist/components/dialogs/dialog/dialog.vue_vue_type_script_setup_true_lang.js +112 -0
- package/dist/components/dialogs/dialog/types.d.ts +47 -0
- package/dist/components/dialogs/dialog-host.js +5 -0
- package/dist/components/dialogs/dialog-host.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/components/dialogs/toast.js +5 -0
- package/dist/components/dialogs/toast.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/components/footer/footer.js +5 -0
- package/dist/components/footer/footer.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/components/footer/types.d.ts +16 -0
- package/dist/components/form/form.js +5 -0
- package/dist/components/form/form.vue.d.ts +32 -0
- package/dist/components/form/form.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/components/form/types.d.ts +15 -0
- package/dist/components/grid/column/column.js +5 -0
- package/dist/components/grid/column/column.vue.d.ts +33 -0
- package/dist/components/grid/column/column.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/components/grid/column/types.d.ts +27 -0
- package/dist/components/grid/container/container.js +5 -0
- package/dist/components/grid/container/container.vue.d.ts +27 -0
- package/dist/components/grid/container/container.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/components/grid/container/types.d.ts +17 -0
- package/dist/components/grid/row/row.js +5 -0
- package/dist/components/grid/row/row.vue.d.ts +29 -0
- package/dist/components/grid/row/row.vue_vue_type_script_setup_true_lang.js +61 -0
- package/dist/components/grid/row/types.d.ts +63 -0
- package/dist/components/icon-button/icon-button.js +5 -0
- package/dist/components/icon-button/icon-button.vue.d.ts +23 -0
- package/dist/components/icon-button/icon-button.vue_vue_type_script_setup_true_lang.js +51 -0
- package/dist/components/icon-button/types.d.ts +32 -0
- package/dist/components/img/img.js +5 -0
- package/dist/components/img/img.vue.d.ts +23 -0
- package/dist/components/img/img.vue_vue_type_script_setup_true_lang.js +61 -0
- package/dist/components/img/types.d.ts +43 -0
- package/dist/components/inputs/autocomplete-field/autocomplete-field.js +5 -0
- package/dist/components/inputs/autocomplete-field/autocomplete-field.vue.d.ts +33 -0
- package/dist/components/inputs/autocomplete-field/autocomplete-field.vue_vue_type_script_setup_true_lang.js +161 -0
- package/dist/components/inputs/autocomplete-field/types.d.ts +84 -0
- package/dist/components/inputs/checkbox/checkbox.js +5 -0
- package/dist/components/inputs/checkbox/checkbox.vue.d.ts +33 -0
- package/dist/components/inputs/checkbox/checkbox.vue_vue_type_script_setup_true_lang.js +71 -0
- package/dist/components/inputs/checkbox/types.d.ts +35 -0
- package/dist/components/inputs/date-time-field/date-time-field.js +5 -0
- package/dist/components/inputs/date-time-field/date-time-field.vue.d.ts +32 -0
- package/dist/components/inputs/date-time-field/date-time-field.vue_vue_type_script_setup_true_lang.js +205 -0
- package/dist/components/inputs/date-time-field/types.d.ts +84 -0
- package/dist/components/inputs/field-loader.js +5 -0
- package/dist/components/inputs/field-loader.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/components/inputs/mask-field/mask-field.js +5 -0
- package/dist/components/inputs/mask-field/mask-field.vue.d.ts +32 -0
- package/dist/components/inputs/mask-field/mask-field.vue_vue_type_script_setup_true_lang.js +120 -0
- package/dist/components/inputs/mask-field/types.d.ts +118 -0
- package/dist/components/inputs/text-field/text-field.js +5 -0
- package/dist/components/inputs/text-field/text-field.vue.d.ts +30 -0
- package/dist/components/inputs/text-field/text-field.vue_vue_type_script_setup_true_lang.js +119 -0
- package/dist/components/inputs/text-field/types.d.ts +70 -0
- package/dist/components/link/link.js +5 -0
- package/dist/components/link/link.vue.d.ts +27 -0
- package/dist/components/link/link.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/components/link/types.d.ts +18 -0
- package/dist/components/main/main.js +5 -0
- package/dist/components/main/main.vue.d.ts +33 -0
- package/dist/components/main/main.vue_vue_type_script_setup_true_lang.js +102 -0
- package/dist/components/main/types.d.ts +75 -0
- package/dist/components/navigation-menu/navigation-menu.js +5 -0
- package/dist/components/navigation-menu/navigation-menu.vue_vue_type_script_setup_true_lang.js +145 -0
- package/dist/components/navigation-menu/types.d.ts +62 -0
- package/dist/components/page-transition/page-transition.js +5 -0
- package/dist/components/page-transition/page-transition.vue.d.ts +40 -0
- package/dist/components/page-transition/page-transition.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/components/page-transition/types.d.ts +18 -0
- package/dist/components/sections/section/section.js +5 -0
- package/dist/components/sections/section/section.vue.d.ts +28 -0
- package/dist/components/sections/section/section.vue_vue_type_script_setup_true_lang.js +108 -0
- package/dist/components/sections/section/types.d.ts +80 -0
- package/dist/components/sections/section-content/section-content.js +5 -0
- package/dist/components/sections/section-content/section-content.vue.d.ts +27 -0
- package/dist/components/sections/section-content/section-content.vue_vue_type_script_setup_true_lang.js +16 -0
- package/dist/components/skeleton-loader/skeleton-loader.js +5 -0
- package/dist/components/skeleton-loader/skeleton-loader.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/components/table/table.js +5 -0
- package/dist/components/table/table.vue.d.ts +19 -0
- package/dist/components/table/table.vue_vue_type_script_setup_true_lang.js +84 -0
- package/dist/components/table/types.d.ts +51 -0
- package/dist/components.d.ts +23 -828
- package/dist/components.js +23 -1112
- package/dist/composables/alignment/alignment.js +41 -0
- package/dist/composables/alignment/types.d.ts +12 -0
- package/dist/composables/button/button.js +54 -0
- package/dist/composables/colors/constants.js +27 -0
- package/dist/composables/colors/types.d.ts +4 -0
- package/dist/composables/colors/use-vuetify-background-color.js +16 -0
- package/dist/composables/colors/use-vuetify-color.js +11 -0
- package/dist/composables/colors/use-vuetify-text-color.js +12 -0
- package/dist/composables/data-set/data-set.js +128 -0
- package/dist/composables/dialogs/types.d.ts +88 -0
- package/dist/composables/dialogs/use-confirm.d.ts +21 -0
- package/dist/composables/dialogs/use-confirm.js +55 -0
- package/dist/composables/dialogs/use-decorative-timer.js +25 -0
- package/dist/composables/dialogs/use-dialog-focus.js +64 -0
- package/dist/composables/dialogs/use-dialog-loading.js +13 -0
- package/dist/composables/dialogs/use-dialog.d.ts +36 -0
- package/dist/composables/dialogs/use-dialog.js +73 -0
- package/dist/composables/dialogs/use-run-or-toast.d.ts +27 -0
- package/dist/composables/dialogs/use-run-or-toast.js +65 -0
- package/dist/composables/dialogs/use-toast.d.ts +25 -0
- package/dist/composables/dialogs/use-toast.js +39 -0
- package/dist/composables/dimensions/dimensions.js +18 -0
- package/dist/composables/inputs/autocomplete-field.js +39 -0
- package/dist/composables/inputs/date-time-field.js +109 -0
- package/dist/composables/inputs/fields.js +28 -0
- package/dist/composables/inputs/mask-field.js +133 -0
- package/dist/composables/inputs/rules.js +16 -0
- package/dist/composables/inputs/text-field.js +81 -0
- package/dist/composables/navigation/types.d.ts +54 -0
- package/dist/composables/navigation/use-navigation-search-shortcut.js +97 -0
- package/dist/composables/navigation/use-route-props.js +21 -0
- package/dist/composables/navigation/use-unsaved-changes.d.ts +35 -0
- package/dist/composables/navigation/use-unsaved-changes.js +88 -0
- package/dist/composables/section/section.js +34 -0
- package/dist/composables.d.ts +6 -67
- package/dist/composables.js +6 -65
- package/dist/consts/icons.d.ts +67 -0
- package/dist/consts/icons.js +69 -0
- package/dist/consts/locale.js +12 -0
- package/dist/consts/types.d.ts +12 -0
- package/dist/index.d.ts +3 -16
- package/dist/index.js +38 -14
- package/dist/plugins.d.ts +17 -7
- package/dist/plugins.js +54 -3
- package/dist/styles/fonts/UnimedSlab-Regular.woff2 +0 -0
- package/dist/styles/fonts/fonts.css +5 -0
- package/dist/styles/settings.scss +155 -0
- package/dist/unit-test.d.ts +2 -3
- package/dist/unit-test.js +11 -7
- package/package.json +14 -12
- package/dist/types-BPXXtbmW.d.ts +0 -5
- package/dist/use-toast-CACuYhK_.js +0 -53
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import autocomplete_field_vue_vue_type_script_setup_true_lang_default from "./autocomplete-field.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region src/components/inputs/autocomplete-field/autocomplete-field.vue
|
|
3
|
+
var autocomplete_field_default = autocomplete_field_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { autocomplete_field_default as default };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AutocompleteFieldProps } from "./types.js";
|
|
2
|
+
//#region src/components/inputs/autocomplete-field/autocomplete-field.vue.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Select field component to be used throughout the application.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```vue
|
|
8
|
+
* <template>
|
|
9
|
+
* <u-autocomplete-field label="Country" :items="['Brazil', 'Argentina']" />
|
|
10
|
+
* </template>
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/autocomplete-field | AutocompleteField Guide}
|
|
14
|
+
*/
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
declare const __VLS_export: <T = string, Multiple extends boolean = false>(__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<{
|
|
17
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<(AutocompleteFieldProps<T, Multiple> & {
|
|
18
|
+
modelValue?: Multiple extends true ? T[] : T;
|
|
19
|
+
}) & {
|
|
20
|
+
"onUpdate:modelValue"?: ((value: Multiple extends true ? T[] : T | undefined) => any) | undefined;
|
|
21
|
+
}> & (typeof globalThis extends {
|
|
22
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
23
|
+
} ? P : {});
|
|
24
|
+
expose: (exposed: {}) => void;
|
|
25
|
+
attrs: any;
|
|
26
|
+
slots: {};
|
|
27
|
+
emit: (event: "update:modelValue", value: Multiple extends true ? T[] : T | undefined) => void;
|
|
28
|
+
}>) => import("vue").VNode & {
|
|
29
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
30
|
+
};
|
|
31
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { _default as default };
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { useTextFieldVariant } from "../../../composables/inputs/fields.js";
|
|
2
|
+
import field_loader_default from "../field-loader.js";
|
|
3
|
+
import { autocompleteFieldMenuProps, useAutocompleteRules } from "../../../composables/inputs/autocomplete-field.js";
|
|
4
|
+
import { computed, createBlock, createSlots, createVNode, defineComponent, guardReactiveProps, mergeModels, normalizeProps, openBlock, ref, resolveDynamicComponent, unref, useModel, withCtx } from "vue";
|
|
5
|
+
import { VAutocomplete, VCheckboxBtn, VCombobox, VListItem } from "vuetify/components";
|
|
6
|
+
import { VHighlight } from "vuetify/labs/VHighlight";
|
|
7
|
+
var autocomplete_field_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
__name: "autocomplete-field",
|
|
10
|
+
props: /*@__PURE__*/ mergeModels({
|
|
11
|
+
variant: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: false,
|
|
14
|
+
default: "primary"
|
|
15
|
+
},
|
|
16
|
+
disabled: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
required: false
|
|
19
|
+
},
|
|
20
|
+
loading: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
required: false
|
|
23
|
+
},
|
|
24
|
+
clearable: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
required: false
|
|
27
|
+
},
|
|
28
|
+
readonly: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
required: false
|
|
31
|
+
},
|
|
32
|
+
required: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
required: false
|
|
35
|
+
},
|
|
36
|
+
label: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: false
|
|
39
|
+
},
|
|
40
|
+
placeholder: {
|
|
41
|
+
type: String,
|
|
42
|
+
required: false
|
|
43
|
+
},
|
|
44
|
+
hint: {
|
|
45
|
+
type: String,
|
|
46
|
+
required: false
|
|
47
|
+
},
|
|
48
|
+
dataTestid: {
|
|
49
|
+
type: String,
|
|
50
|
+
required: false
|
|
51
|
+
},
|
|
52
|
+
strict: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
required: false
|
|
55
|
+
},
|
|
56
|
+
multiple: {
|
|
57
|
+
type: null,
|
|
58
|
+
required: false
|
|
59
|
+
},
|
|
60
|
+
items: {
|
|
61
|
+
type: Array,
|
|
62
|
+
required: false,
|
|
63
|
+
default: () => []
|
|
64
|
+
}
|
|
65
|
+
}, {
|
|
66
|
+
"modelValue": { type: null },
|
|
67
|
+
"modelModifiers": {}
|
|
68
|
+
}),
|
|
69
|
+
emits: ["update:modelValue"],
|
|
70
|
+
setup(__props) {
|
|
71
|
+
const modelValue = useModel(__props, "modelValue");
|
|
72
|
+
const props = __props;
|
|
73
|
+
const vuetifyVariant = useTextFieldVariant(() => props.variant);
|
|
74
|
+
const isMultiple = computed(() => props.multiple ?? false);
|
|
75
|
+
const rules = useAutocompleteRules(() => ({
|
|
76
|
+
required: props.required,
|
|
77
|
+
multiple: isMultiple.value
|
|
78
|
+
}));
|
|
79
|
+
const vuetifyComponent = computed(() => props.strict ? VAutocomplete : VCombobox);
|
|
80
|
+
const search = ref("");
|
|
81
|
+
const maskClass = computed(() => props.strict ? "v-autocomplete__mask" : "v-combobox__mask");
|
|
82
|
+
const normalizedItems = computed(() => {
|
|
83
|
+
return props.items.map((item) => {
|
|
84
|
+
if (typeof item === "string") return {
|
|
85
|
+
label: item,
|
|
86
|
+
value: item
|
|
87
|
+
};
|
|
88
|
+
return item;
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
return (_ctx, _cache) => {
|
|
92
|
+
return openBlock(), createBlock(resolveDynamicComponent(vuetifyComponent.value), {
|
|
93
|
+
modelValue: modelValue.value,
|
|
94
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
95
|
+
search: search.value,
|
|
96
|
+
"onUpdate:search": _cache[1] || (_cache[1] = ($event) => search.value = $event),
|
|
97
|
+
variant: unref(vuetifyVariant),
|
|
98
|
+
items: normalizedItems.value,
|
|
99
|
+
"data-testid": props.dataTestid,
|
|
100
|
+
disabled: props.disabled,
|
|
101
|
+
loading: props.loading,
|
|
102
|
+
"aria-busy": props.loading || void 0,
|
|
103
|
+
readonly: props.readonly,
|
|
104
|
+
label: props.label,
|
|
105
|
+
placeholder: props.placeholder,
|
|
106
|
+
hint: props.hint,
|
|
107
|
+
clearable: props.clearable,
|
|
108
|
+
multiple: isMultiple.value,
|
|
109
|
+
"item-title": "label",
|
|
110
|
+
rules: unref(rules),
|
|
111
|
+
"menu-props": unref(autocompleteFieldMenuProps),
|
|
112
|
+
chips: ""
|
|
113
|
+
}, createSlots({
|
|
114
|
+
loader: withCtx((loader) => [createVNode(field_loader_default, normalizeProps(guardReactiveProps(loader)), null, 16)]),
|
|
115
|
+
_: 2
|
|
116
|
+
}, [isMultiple.value ? {
|
|
117
|
+
name: "item",
|
|
118
|
+
fn: withCtx(({ props: itemProps }) => [createVNode(unref(VListItem), normalizeProps(guardReactiveProps(itemProps)), {
|
|
119
|
+
prepend: withCtx(({ isSelected }) => [createVNode(unref(VCheckboxBtn), {
|
|
120
|
+
"model-value": isSelected,
|
|
121
|
+
ripple: false,
|
|
122
|
+
inert: "",
|
|
123
|
+
"aria-hidden": "true"
|
|
124
|
+
}, null, 8, ["model-value"])]),
|
|
125
|
+
title: withCtx(() => [createVNode(unref(VHighlight), {
|
|
126
|
+
text: itemProps.title,
|
|
127
|
+
query: search.value,
|
|
128
|
+
"match-all": "",
|
|
129
|
+
"ignore-case": "",
|
|
130
|
+
"mark-class": maskClass.value
|
|
131
|
+
}, null, 8, [
|
|
132
|
+
"text",
|
|
133
|
+
"query",
|
|
134
|
+
"mark-class"
|
|
135
|
+
])]),
|
|
136
|
+
_: 2
|
|
137
|
+
}, 1040)]),
|
|
138
|
+
key: "0"
|
|
139
|
+
} : void 0]), 1064, [
|
|
140
|
+
"modelValue",
|
|
141
|
+
"search",
|
|
142
|
+
"variant",
|
|
143
|
+
"items",
|
|
144
|
+
"data-testid",
|
|
145
|
+
"disabled",
|
|
146
|
+
"loading",
|
|
147
|
+
"aria-busy",
|
|
148
|
+
"readonly",
|
|
149
|
+
"label",
|
|
150
|
+
"placeholder",
|
|
151
|
+
"hint",
|
|
152
|
+
"clearable",
|
|
153
|
+
"multiple",
|
|
154
|
+
"rules",
|
|
155
|
+
"menu-props"
|
|
156
|
+
]);
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
//#endregion
|
|
161
|
+
export { autocomplete_field_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { TextFieldVariant } from "../text-field/types.js";
|
|
2
|
+
//#region src/components/inputs/autocomplete-field/types.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Autocomplete/Combobox item type that can be either a string or an object with label and value.
|
|
5
|
+
*/
|
|
6
|
+
export type AutocompleteItem<T = string> = string | {
|
|
7
|
+
label: string;
|
|
8
|
+
value: T;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Props exposed by the {@link AutocompleteField} component.
|
|
12
|
+
*/
|
|
13
|
+
export type AutocompleteFieldProps<T = string, Multiple extends boolean = false> = {
|
|
14
|
+
/**
|
|
15
|
+
* Applies a distinct style variation to the field.
|
|
16
|
+
* One of `primary` or `secondary`.
|
|
17
|
+
* @default "primary"
|
|
18
|
+
*/
|
|
19
|
+
variant?: TextFieldVariant;
|
|
20
|
+
/**
|
|
21
|
+
* Removes the ability to click or target the field.
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Displays a loading indicator on the input. The field keeps its label as
|
|
27
|
+
* accessible name and is marked as busy, and assistive technologies ignore
|
|
28
|
+
* the indicator.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
loading?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Displays clear action.
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
clearable?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Prevent value changes.
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
readonly?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Add rules to require field to be filled before form submission.
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
required?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Field label.
|
|
49
|
+
*/
|
|
50
|
+
label?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Field placeholder.
|
|
53
|
+
*/
|
|
54
|
+
placeholder?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Field message to show and direct user to fill field correctly.
|
|
57
|
+
*
|
|
58
|
+
* This message will be replaced when there's an error message to be shown.
|
|
59
|
+
*/
|
|
60
|
+
hint?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Component id to use on automated tests.
|
|
63
|
+
*/
|
|
64
|
+
dataTestid?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Used to prevent user from adding new values to the list.
|
|
67
|
+
* @default false
|
|
68
|
+
*/
|
|
69
|
+
strict?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Allow selecting/typing more than one value.
|
|
72
|
+
*
|
|
73
|
+
* Passing the literal `true` narrows `modelValue` and `update:modelValue`
|
|
74
|
+
* to `T[]` instead of `T`.
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
77
|
+
multiple?: Multiple;
|
|
78
|
+
/**
|
|
79
|
+
* List of autocomplete items. Can be strings or objects with label and value.
|
|
80
|
+
* @default []
|
|
81
|
+
*/
|
|
82
|
+
items?: AutocompleteItem<T>[];
|
|
83
|
+
};
|
|
84
|
+
//#endregion
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import checkbox_vue_vue_type_script_setup_true_lang_default from "./checkbox.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region src/components/inputs/checkbox/checkbox.vue
|
|
3
|
+
var checkbox_default = checkbox_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { checkbox_default as default };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CheckboxProps } from "./types.js";
|
|
2
|
+
//#region src/components/inputs/checkbox/checkbox.vue.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Checkbox component to be used throughout the application.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```vue
|
|
8
|
+
* <template>
|
|
9
|
+
* <u-checkbox label="Aceito os termos" />
|
|
10
|
+
* </template>
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/checkbox | Checkbox Guide}
|
|
14
|
+
*/
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
declare const __VLS_export: <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<{
|
|
17
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<(CheckboxProps<boolean | T> & {
|
|
18
|
+
modelValue?: T;
|
|
19
|
+
}) & {
|
|
20
|
+
"onUpdate:modelValue"?: ((value: T) => any) | undefined;
|
|
21
|
+
}> & (typeof globalThis extends {
|
|
22
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
23
|
+
} ? P : {});
|
|
24
|
+
expose: (exposed: {}) => void;
|
|
25
|
+
attrs: any;
|
|
26
|
+
slots: {};
|
|
27
|
+
emit: (event: "update:modelValue", value: T) => void;
|
|
28
|
+
}>) => import("vue").VNode & {
|
|
29
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
30
|
+
};
|
|
31
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { _default as default };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { createBlock, defineComponent, mergeModels, openBlock, unref, useModel } from "vue";
|
|
2
|
+
import { VCheckboxBtn } from "vuetify/components";
|
|
3
|
+
var checkbox_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
4
|
+
inheritAttrs: false,
|
|
5
|
+
__name: "checkbox",
|
|
6
|
+
props: /*@__PURE__*/ mergeModels({
|
|
7
|
+
label: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: false
|
|
10
|
+
},
|
|
11
|
+
disabled: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
required: false
|
|
14
|
+
},
|
|
15
|
+
readonly: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
required: false
|
|
18
|
+
},
|
|
19
|
+
trueValue: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
required: false,
|
|
22
|
+
skipCheck: true,
|
|
23
|
+
default: true
|
|
24
|
+
},
|
|
25
|
+
falseValue: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
required: false,
|
|
28
|
+
skipCheck: true,
|
|
29
|
+
default: false
|
|
30
|
+
},
|
|
31
|
+
dataTestid: {
|
|
32
|
+
type: String,
|
|
33
|
+
required: false
|
|
34
|
+
}
|
|
35
|
+
}, {
|
|
36
|
+
"modelValue": {
|
|
37
|
+
type: null,
|
|
38
|
+
default: (props) => props.falseValue
|
|
39
|
+
},
|
|
40
|
+
"modelModifiers": {}
|
|
41
|
+
}),
|
|
42
|
+
emits: ["update:modelValue"],
|
|
43
|
+
setup(__props) {
|
|
44
|
+
const props = __props;
|
|
45
|
+
const modelValue = useModel(__props, "modelValue");
|
|
46
|
+
return (_ctx, _cache) => {
|
|
47
|
+
return openBlock(), createBlock(unref(VCheckboxBtn), {
|
|
48
|
+
modelValue: modelValue.value,
|
|
49
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
50
|
+
"true-value": props.trueValue,
|
|
51
|
+
"false-value": props.falseValue,
|
|
52
|
+
"data-testid": props.dataTestid,
|
|
53
|
+
disabled: props.disabled,
|
|
54
|
+
readonly: props.readonly,
|
|
55
|
+
label: props.label,
|
|
56
|
+
class: "flex-0-1",
|
|
57
|
+
"hide-details": ""
|
|
58
|
+
}, null, 8, [
|
|
59
|
+
"modelValue",
|
|
60
|
+
"true-value",
|
|
61
|
+
"false-value",
|
|
62
|
+
"data-testid",
|
|
63
|
+
"disabled",
|
|
64
|
+
"readonly",
|
|
65
|
+
"label"
|
|
66
|
+
]);
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
//#endregion
|
|
71
|
+
export { checkbox_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/components/inputs/checkbox/types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Props exposed by the {@link Checkbox} component.
|
|
4
|
+
*/
|
|
5
|
+
export type CheckboxProps<T = boolean> = {
|
|
6
|
+
/**
|
|
7
|
+
* Field label.
|
|
8
|
+
*/
|
|
9
|
+
label?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Removes the ability to click or target the checkbox.
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Prevent value changes.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
readonly?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Value applied to the model when the checkbox is checked.
|
|
22
|
+
* @default true
|
|
23
|
+
*/
|
|
24
|
+
trueValue?: T;
|
|
25
|
+
/**
|
|
26
|
+
* Value applied to the model when the checkbox is unchecked.
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
falseValue?: T;
|
|
30
|
+
/**
|
|
31
|
+
* Component id to use on automated tests.
|
|
32
|
+
*/
|
|
33
|
+
dataTestid?: string;
|
|
34
|
+
};
|
|
35
|
+
//#endregion
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import date_time_field_vue_vue_type_script_setup_true_lang_default from "./date-time-field.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region src/components/inputs/date-time-field/date-time-field.vue
|
|
3
|
+
var date_time_field_default = date_time_field_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { date_time_field_default as default };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { DateTimeFieldProps, DateTimeFieldType, DateTimeFieldVariant } from "./types.js";
|
|
2
|
+
//#region src/components/inputs/date-time-field/date-time-field.vue.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Date and/or time field component to be used throughout the application.
|
|
5
|
+
*
|
|
6
|
+
* Its value uses the native input formats: `YYYY-MM-DD` for `date`, `HH:mm`
|
|
7
|
+
* for `time` and `YYYY-MM-DDTHH:mm` for `datetime`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```vue
|
|
11
|
+
* <template>
|
|
12
|
+
* <u-date-time-field v-model="birthDate" label="Data de nascimento" type="date" />
|
|
13
|
+
* <template>
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/date-time-field | DateTimeField Guide}
|
|
17
|
+
*/
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
declare const __VLS_export: import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<DateTimeFieldProps & {
|
|
20
|
+
modelValue?: string;
|
|
21
|
+
}, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {
|
|
22
|
+
"update:modelValue": (value: string) => any;
|
|
23
|
+
}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<DateTimeFieldProps & {
|
|
24
|
+
modelValue?: string;
|
|
25
|
+
}> & Readonly<{
|
|
26
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
27
|
+
}>, {
|
|
28
|
+
variant: DateTimeFieldVariant;
|
|
29
|
+
type: DateTimeFieldType;
|
|
30
|
+
}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { _default as default };
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { useTextFieldVariant } from "../../../composables/inputs/fields.js";
|
|
2
|
+
import field_loader_default from "../field-loader.js";
|
|
3
|
+
import { formatDateTime as formatDateTime$1, getDatePart, getTimePart, joinDateTime, useDateTimeFieldMenu, useDateTimeFieldPickerBounds, useDateTimeFieldRules } from "../../../composables/inputs/date-time-field.js";
|
|
4
|
+
import { computed, createBlock, createCommentVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, normalizeProps, openBlock, ref, unref, useModel, watch, withCtx } from "vue";
|
|
5
|
+
import { pt } from "vuetify/locale";
|
|
6
|
+
import { VCard, VDatePicker, VLocaleProvider, VMenu, VTextField, VTimePicker } from "vuetify/components";
|
|
7
|
+
import { formatDateTime } from "@nexdom/shared/utils";
|
|
8
|
+
var date_time_field_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
9
|
+
inheritAttrs: false,
|
|
10
|
+
__name: "date-time-field",
|
|
11
|
+
props: /*@__PURE__*/ mergeModels({
|
|
12
|
+
variant: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: false,
|
|
15
|
+
default: "primary"
|
|
16
|
+
},
|
|
17
|
+
type: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: false,
|
|
20
|
+
default: "datetime"
|
|
21
|
+
},
|
|
22
|
+
min: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: false
|
|
25
|
+
},
|
|
26
|
+
max: {
|
|
27
|
+
type: String,
|
|
28
|
+
required: false
|
|
29
|
+
},
|
|
30
|
+
disabled: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
required: false
|
|
33
|
+
},
|
|
34
|
+
loading: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
required: false
|
|
37
|
+
},
|
|
38
|
+
clearable: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
required: false
|
|
41
|
+
},
|
|
42
|
+
readonly: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
required: false
|
|
45
|
+
},
|
|
46
|
+
required: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
required: false
|
|
49
|
+
},
|
|
50
|
+
label: {
|
|
51
|
+
type: String,
|
|
52
|
+
required: false
|
|
53
|
+
},
|
|
54
|
+
placeholder: {
|
|
55
|
+
type: String,
|
|
56
|
+
required: false
|
|
57
|
+
},
|
|
58
|
+
hint: {
|
|
59
|
+
type: String,
|
|
60
|
+
required: false
|
|
61
|
+
},
|
|
62
|
+
dataTestid: {
|
|
63
|
+
type: String,
|
|
64
|
+
required: false
|
|
65
|
+
}
|
|
66
|
+
}, {
|
|
67
|
+
"modelValue": {
|
|
68
|
+
type: String,
|
|
69
|
+
default: ""
|
|
70
|
+
},
|
|
71
|
+
"modelModifiers": {}
|
|
72
|
+
}),
|
|
73
|
+
emits: ["update:modelValue"],
|
|
74
|
+
setup(__props) {
|
|
75
|
+
const modelValue = useModel(__props, "modelValue");
|
|
76
|
+
const props = __props;
|
|
77
|
+
const messages = { "pt-BR": pt };
|
|
78
|
+
const vuetifyVariant = useTextFieldVariant(() => props.variant);
|
|
79
|
+
const rules = useDateTimeFieldRules(props);
|
|
80
|
+
const displayValue = computed(() => formatDateTime$1(modelValue.value, props.type));
|
|
81
|
+
const isClearable = computed(() => props.clearable && !props.readonly);
|
|
82
|
+
const isMenuDisabled = computed(() => props.disabled || props.readonly);
|
|
83
|
+
const isMenuOpen = ref(false);
|
|
84
|
+
const draft = ref({});
|
|
85
|
+
const draftDate = computed(() => draft.value.date ?? getDatePart(modelValue.value, props.type));
|
|
86
|
+
const draftTime = computed(() => draft.value.time ?? getTimePart(modelValue.value, props.type));
|
|
87
|
+
const draftValue = computed(() => joinDateTime(props.type, draftDate.value, draftTime.value));
|
|
88
|
+
const bounds = useDateTimeFieldPickerBounds(props, draftDate);
|
|
89
|
+
const { inputId, activator, activatorProps, contentProps, open: openMenu } = useDateTimeFieldMenu(isMenuOpen, isMenuDisabled, () => !!props.label);
|
|
90
|
+
watch(isMenuOpen, () => {
|
|
91
|
+
draft.value = {};
|
|
92
|
+
});
|
|
93
|
+
function onDateUpdate(date) {
|
|
94
|
+
draft.value.date = formatDateTime(date, "YYYY-MM-DD");
|
|
95
|
+
commitDraft();
|
|
96
|
+
closeIfComplete();
|
|
97
|
+
}
|
|
98
|
+
function onTimeUpdate(time) {
|
|
99
|
+
draft.value.time = time ?? "";
|
|
100
|
+
commitDraft();
|
|
101
|
+
}
|
|
102
|
+
function commitDraft() {
|
|
103
|
+
if (draftValue.value) modelValue.value = draftValue.value;
|
|
104
|
+
}
|
|
105
|
+
function closeIfComplete() {
|
|
106
|
+
if (draftValue.value) isMenuOpen.value = false;
|
|
107
|
+
}
|
|
108
|
+
function clear() {
|
|
109
|
+
modelValue.value = "";
|
|
110
|
+
}
|
|
111
|
+
return (_ctx, _cache) => {
|
|
112
|
+
return openBlock(), createBlock(unref(VTextField), {
|
|
113
|
+
id: unref(inputId),
|
|
114
|
+
"model-value": displayValue.value,
|
|
115
|
+
"validation-value": modelValue.value,
|
|
116
|
+
variant: unref(vuetifyVariant),
|
|
117
|
+
rules: unref(rules),
|
|
118
|
+
"data-testid": props.dataTestid,
|
|
119
|
+
disabled: props.disabled,
|
|
120
|
+
loading: props.loading,
|
|
121
|
+
"aria-busy": props.loading || void 0,
|
|
122
|
+
label: props.label,
|
|
123
|
+
placeholder: props.placeholder,
|
|
124
|
+
hint: props.hint,
|
|
125
|
+
clearable: isClearable.value,
|
|
126
|
+
readonly: "",
|
|
127
|
+
"onClick:clear": clear,
|
|
128
|
+
"onClick:control": unref(openMenu)
|
|
129
|
+
}, {
|
|
130
|
+
loader: withCtx((loader) => [createVNode(field_loader_default, normalizeProps(guardReactiveProps(loader)), null, 16)]),
|
|
131
|
+
default: withCtx(() => [createVNode(unref(VMenu), {
|
|
132
|
+
modelValue: isMenuOpen.value,
|
|
133
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isMenuOpen.value = $event),
|
|
134
|
+
activator: unref(activator),
|
|
135
|
+
target: "parent",
|
|
136
|
+
"activator-props": unref(activatorProps),
|
|
137
|
+
"content-props": unref(contentProps),
|
|
138
|
+
location: "bottom start",
|
|
139
|
+
"min-width": "0",
|
|
140
|
+
disabled: isMenuDisabled.value,
|
|
141
|
+
"close-on-content-click": false
|
|
142
|
+
}, {
|
|
143
|
+
default: withCtx(() => [createVNode(unref(VCard), null, {
|
|
144
|
+
default: withCtx(() => [createVNode(unref(VLocaleProvider), {
|
|
145
|
+
locale: "pt-BR",
|
|
146
|
+
messages,
|
|
147
|
+
class: "d-flex flex-wrap"
|
|
148
|
+
}, {
|
|
149
|
+
default: withCtx(() => [props.type !== "time" ? (openBlock(), createBlock(unref(VDatePicker), {
|
|
150
|
+
key: 0,
|
|
151
|
+
"model-value": draftDate.value || null,
|
|
152
|
+
min: unref(bounds).dateMin,
|
|
153
|
+
max: unref(bounds).dateMax,
|
|
154
|
+
"onUpdate:modelValue": onDateUpdate
|
|
155
|
+
}, null, 8, [
|
|
156
|
+
"model-value",
|
|
157
|
+
"min",
|
|
158
|
+
"max"
|
|
159
|
+
])) : createCommentVNode("v-if", true), props.type !== "date" ? (openBlock(), createBlock(unref(VTimePicker), {
|
|
160
|
+
key: 1,
|
|
161
|
+
"model-value": draftTime.value,
|
|
162
|
+
min: unref(bounds).timeMin,
|
|
163
|
+
max: unref(bounds).timeMax,
|
|
164
|
+
format: "24hr",
|
|
165
|
+
"onUpdate:modelValue": onTimeUpdate,
|
|
166
|
+
"onUpdate:minute": closeIfComplete
|
|
167
|
+
}, null, 8, [
|
|
168
|
+
"model-value",
|
|
169
|
+
"min",
|
|
170
|
+
"max"
|
|
171
|
+
])) : createCommentVNode("v-if", true)]),
|
|
172
|
+
_: 1
|
|
173
|
+
})]),
|
|
174
|
+
_: 1
|
|
175
|
+
})]),
|
|
176
|
+
_: 1
|
|
177
|
+
}, 8, [
|
|
178
|
+
"modelValue",
|
|
179
|
+
"activator",
|
|
180
|
+
"activator-props",
|
|
181
|
+
"content-props",
|
|
182
|
+
"disabled"
|
|
183
|
+
])]),
|
|
184
|
+
_: 1
|
|
185
|
+
}, 8, [
|
|
186
|
+
"id",
|
|
187
|
+
"model-value",
|
|
188
|
+
"validation-value",
|
|
189
|
+
"variant",
|
|
190
|
+
"rules",
|
|
191
|
+
"data-testid",
|
|
192
|
+
"disabled",
|
|
193
|
+
"loading",
|
|
194
|
+
"aria-busy",
|
|
195
|
+
"label",
|
|
196
|
+
"placeholder",
|
|
197
|
+
"hint",
|
|
198
|
+
"clearable",
|
|
199
|
+
"onClick:control"
|
|
200
|
+
]);
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
//#endregion
|
|
205
|
+
export { date_time_field_vue_vue_type_script_setup_true_lang_default as default };
|