@nexdom/uimed-vue 2.0.0-beta.8 → 2.0.0
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 +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 +93 -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 +99 -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 +104 -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 +207 -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 -940
- package/dist/components.js +23 -1254
- 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-rail.js +163 -0
- package/dist/composables/navigation/use-navigation-search-shortcut.js +96 -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 +1 -13
- package/dist/index.js +39 -14
- package/dist/plugins.d.ts +15 -4
- 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.js +11 -7
- package/package.json +11 -11
- package/skills/uimed-vue/SKILL.md +113 -0
- package/skills/uimed-vue/references/api/components/autocomplete-field.md +45 -0
- package/skills/uimed-vue/references/api/components/button.md +48 -0
- package/skills/uimed-vue/references/api/components/checkbox.md +36 -0
- package/skills/uimed-vue/references/api/components/data-sets/data-set-item.md +61 -0
- package/skills/uimed-vue/references/api/components/data-sets/data-set.md +67 -0
- package/skills/uimed-vue/references/api/components/date-time-field.md +44 -0
- package/skills/uimed-vue/references/api/components/details.md +33 -0
- package/skills/uimed-vue/references/api/components/dialog.md +70 -0
- package/skills/uimed-vue/references/api/components/form.md +43 -0
- package/skills/uimed-vue/references/api/components/grid/column.md +41 -0
- package/skills/uimed-vue/references/api/components/grid/container.md +32 -0
- package/skills/uimed-vue/references/api/components/grid/row.md +37 -0
- package/skills/uimed-vue/references/api/components/icon-button.md +37 -0
- package/skills/uimed-vue/references/api/components/img.md +34 -0
- package/skills/uimed-vue/references/api/components/link.md +31 -0
- package/skills/uimed-vue/references/api/components/main.md +174 -0
- package/skills/uimed-vue/references/api/components/mask-field.md +60 -0
- package/skills/uimed-vue/references/api/components/page-transition.md +37 -0
- package/skills/uimed-vue/references/api/components/sections/section-content.md +23 -0
- package/skills/uimed-vue/references/api/components/sections/section.md +61 -0
- package/skills/uimed-vue/references/api/components/table.md +35 -0
- package/skills/uimed-vue/references/api/components/text-field.md +42 -0
- package/skills/uimed-vue/references/api/composables/use-confirm.md +96 -0
- package/skills/uimed-vue/references/api/composables/use-dialog.md +95 -0
- package/skills/uimed-vue/references/api/composables/use-run-or-toast.md +58 -0
- package/skills/uimed-vue/references/api/composables/use-toast.md +48 -0
- package/skills/uimed-vue/references/api/composables/use-unsaved-changes.md +106 -0
- package/skills/uimed-vue/references/api/index.md +1 -0
- package/skills/uimed-vue/references/guide/components/autocomplete-field.md +256 -0
- package/skills/uimed-vue/references/guide/components/button.md +155 -0
- package/skills/uimed-vue/references/guide/components/checkbox.md +113 -0
- package/skills/uimed-vue/references/guide/components/data-set.md +370 -0
- package/skills/uimed-vue/references/guide/components/date-time-field.md +202 -0
- package/skills/uimed-vue/references/guide/components/details.md +76 -0
- package/skills/uimed-vue/references/guide/components/dialog.md +269 -0
- package/skills/uimed-vue/references/guide/components/form.md +96 -0
- package/skills/uimed-vue/references/guide/components/icon-button.md +76 -0
- package/skills/uimed-vue/references/guide/components/img.md +128 -0
- package/skills/uimed-vue/references/guide/components/layout.md +323 -0
- package/skills/uimed-vue/references/guide/components/link.md +47 -0
- package/skills/uimed-vue/references/guide/components/main.md +435 -0
- package/skills/uimed-vue/references/guide/components/mask-field.md +256 -0
- package/skills/uimed-vue/references/guide/components/page-transition.md +111 -0
- package/skills/uimed-vue/references/guide/components/section.md +232 -0
- package/skills/uimed-vue/references/guide/components/table.md +102 -0
- package/skills/uimed-vue/references/guide/components/text-field.md +172 -0
- package/skills/uimed-vue/references/guide/composables/use-confirm.md +123 -0
- package/skills/uimed-vue/references/guide/composables/use-dialog.md +102 -0
- package/skills/uimed-vue/references/guide/composables/use-run-or-toast.md +55 -0
- package/skills/uimed-vue/references/guide/composables/use-toast.md +57 -0
- package/skills/uimed-vue/references/guide/composables/use-unsaved-changes.md +129 -0
- package/skills/uimed-vue/references/guide/getting-started.md +135 -0
- package/skills/uimed-vue/references/guide/icons.md +71 -0
- package/skills/uimed-vue/references/guide/index.md +51 -0
- package/skills/uimed-vue/references/guide/migration-v1-to-v2.md +191 -0
- package/skills/uimed-vue/references/guide/unit-testing.md +85 -0
- package/AGENTS.md +0 -160
- package/CLAUDE.md +0 -1
- package/dist/types-BPXXtbmW.d.ts +0 -5
- package/dist/use-toast-CACuYhK_.js +0 -53
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { useTextFieldVariant } from "../../../composables/inputs/fields.js";
|
|
2
|
+
import field_loader_default from "../field-loader.js";
|
|
3
|
+
import { useMaskField } from "../../../composables/inputs/mask-field.js";
|
|
4
|
+
import { createBlock, createVNode, defineComponent, guardReactiveProps, mergeModels, normalizeProps, openBlock, unref, useModel, withCtx } from "vue";
|
|
5
|
+
import { VTextField } from "vuetify/components";
|
|
6
|
+
var mask_field_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
7
|
+
inheritAttrs: false,
|
|
8
|
+
__name: "mask-field",
|
|
9
|
+
props: /*@__PURE__*/ mergeModels({
|
|
10
|
+
variant: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: false,
|
|
13
|
+
default: "primary"
|
|
14
|
+
},
|
|
15
|
+
mask: {
|
|
16
|
+
type: null,
|
|
17
|
+
required: true
|
|
18
|
+
},
|
|
19
|
+
disabled: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
required: false
|
|
22
|
+
},
|
|
23
|
+
loading: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
required: false
|
|
26
|
+
},
|
|
27
|
+
clearable: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
required: false
|
|
30
|
+
},
|
|
31
|
+
readonly: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
required: false
|
|
34
|
+
},
|
|
35
|
+
required: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
required: false
|
|
38
|
+
},
|
|
39
|
+
label: {
|
|
40
|
+
type: String,
|
|
41
|
+
required: false
|
|
42
|
+
},
|
|
43
|
+
placeholder: {
|
|
44
|
+
type: String,
|
|
45
|
+
required: false
|
|
46
|
+
},
|
|
47
|
+
hint: {
|
|
48
|
+
type: String,
|
|
49
|
+
required: false
|
|
50
|
+
},
|
|
51
|
+
dataTestid: {
|
|
52
|
+
type: String,
|
|
53
|
+
required: false
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
"modelValue": {
|
|
57
|
+
type: String,
|
|
58
|
+
default: ""
|
|
59
|
+
},
|
|
60
|
+
"modelModifiers": {}
|
|
61
|
+
}),
|
|
62
|
+
emits: ["update:modelValue"],
|
|
63
|
+
setup(__props) {
|
|
64
|
+
const modelValue = useModel(__props, "modelValue");
|
|
65
|
+
const props = __props;
|
|
66
|
+
const vuetifyVariant = useTextFieldVariant(() => props.variant);
|
|
67
|
+
const { displayValue, placeholder, inputMode, autocapitalize, rules, onInput, onCompositionEnd } = useMaskField(props, modelValue);
|
|
68
|
+
function keepFieldControlled() {}
|
|
69
|
+
function clear() {
|
|
70
|
+
modelValue.value = "";
|
|
71
|
+
}
|
|
72
|
+
return (_ctx, _cache) => {
|
|
73
|
+
return openBlock(), createBlock(unref(VTextField), {
|
|
74
|
+
"model-value": unref(displayValue),
|
|
75
|
+
"validation-value": modelValue.value,
|
|
76
|
+
variant: unref(vuetifyVariant),
|
|
77
|
+
rules: unref(rules),
|
|
78
|
+
"data-testid": props.dataTestid,
|
|
79
|
+
disabled: props.disabled,
|
|
80
|
+
loading: props.loading,
|
|
81
|
+
"aria-busy": props.loading || void 0,
|
|
82
|
+
readonly: props.readonly,
|
|
83
|
+
label: props.label,
|
|
84
|
+
placeholder: unref(placeholder),
|
|
85
|
+
hint: props.hint,
|
|
86
|
+
clearable: props.clearable,
|
|
87
|
+
type: "text",
|
|
88
|
+
inputmode: unref(inputMode),
|
|
89
|
+
autocapitalize: unref(autocapitalize),
|
|
90
|
+
"onUpdate:modelValue": keepFieldControlled,
|
|
91
|
+
onInput: unref(onInput),
|
|
92
|
+
onCompositionend: unref(onCompositionEnd),
|
|
93
|
+
"onClick:clear": clear
|
|
94
|
+
}, {
|
|
95
|
+
loader: withCtx((loader) => [createVNode(field_loader_default, normalizeProps(guardReactiveProps(loader)), null, 16)]),
|
|
96
|
+
_: 1
|
|
97
|
+
}, 8, [
|
|
98
|
+
"model-value",
|
|
99
|
+
"validation-value",
|
|
100
|
+
"variant",
|
|
101
|
+
"rules",
|
|
102
|
+
"data-testid",
|
|
103
|
+
"disabled",
|
|
104
|
+
"loading",
|
|
105
|
+
"aria-busy",
|
|
106
|
+
"readonly",
|
|
107
|
+
"label",
|
|
108
|
+
"placeholder",
|
|
109
|
+
"hint",
|
|
110
|
+
"clearable",
|
|
111
|
+
"inputmode",
|
|
112
|
+
"autocapitalize",
|
|
113
|
+
"onInput",
|
|
114
|
+
"onCompositionend"
|
|
115
|
+
]);
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
//#endregion
|
|
120
|
+
export { mask_field_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { TextFieldVariant } from "../text-field/types.js";
|
|
2
|
+
//#region src/components/inputs/mask-field/types.d.ts
|
|
3
|
+
export type MaskFieldVariant = TextFieldVariant;
|
|
4
|
+
/**
|
|
5
|
+
* Masks the library provides:
|
|
6
|
+
*
|
|
7
|
+
* - `cpf`: `###.###.###-##` (e.g. `123.456.789-09`);
|
|
8
|
+
* - `cnpj`: `##.###.###/####-##`, where the first 12 positions also accept
|
|
9
|
+
* letters, typed in uppercase or lowercase and kept in uppercase (e.g.
|
|
10
|
+
* `12.345.678/0001-95` or the alphanumeric `12.ABC.345/01DE-35`);
|
|
11
|
+
* - `cep`: `#####-###` (e.g. `01310-100`);
|
|
12
|
+
* - `phone`: `(##) #####-####` (e.g. `(11) 91234-5678`);
|
|
13
|
+
* - `date`: `##/##/####` (e.g. `31/12/2026`), formatting only.
|
|
14
|
+
*/
|
|
15
|
+
export type MaskFieldPreset = "cpf" | "cnpj" | "cep" | "phone" | "date";
|
|
16
|
+
/**
|
|
17
|
+
* A preset name, or the mask itself, where `#` is a digit (0–9) and any other
|
|
18
|
+
* character, letters included, is a literal inserted automatically (e.g.
|
|
19
|
+
* `####-##/####` or `Nº ####`).
|
|
20
|
+
*
|
|
21
|
+
* A custom mask must contain at least one `#`, so a misspelled preset (e.g.
|
|
22
|
+
* `"cpff"`) is a type error.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const preset: MaskFieldMask = "cpf";
|
|
27
|
+
* const custom: MaskFieldMask = "####-##/####";
|
|
28
|
+
* const withLetters: MaskFieldMask = "Nº ####";
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export type MaskFieldMask = MaskFieldPreset | `${string}#${string}`;
|
|
32
|
+
/**
|
|
33
|
+
* Props exposed by the {@link MaskField} component.
|
|
34
|
+
*/
|
|
35
|
+
export type MaskFieldProps = {
|
|
36
|
+
/**
|
|
37
|
+
* Applies a distinct style variation to the field.
|
|
38
|
+
* One of `primary` or `secondary`.
|
|
39
|
+
* @default "primary"
|
|
40
|
+
*/
|
|
41
|
+
variant?: MaskFieldVariant;
|
|
42
|
+
/**
|
|
43
|
+
* Mask applied to the value while the user types. One of the presets
|
|
44
|
+
* (`cpf`, `cnpj`, `cep`, `phone` or `date`), or the mask itself, where `#`
|
|
45
|
+
* is a digit (0–9) and any other character, letters included, is a literal
|
|
46
|
+
* inserted automatically (e.g. `####-##/####` or `Nº ####`). A custom mask
|
|
47
|
+
* must contain at least one `#`.
|
|
48
|
+
*
|
|
49
|
+
* Only digits are accepted, up to the number of `#` in the mask, except in
|
|
50
|
+
* the first 12 positions of `cnpj`, which also accept letters (A–Z, without
|
|
51
|
+
* accents, typed in uppercase or lowercase) for the alphanumeric CNPJ (only
|
|
52
|
+
* with `cnpj`: the custom mask `##.###.###/####-##` accepts only digits). The
|
|
53
|
+
* `v-model` holds only these characters, with letters in uppercase (e.g.
|
|
54
|
+
* `12345678909` for `cpf`, and `12345678000195` or `12ABC34501DE35` for
|
|
55
|
+
* `cnpj`). A literal the user could also type, such as a fixed digit
|
|
56
|
+
* (`0800 ###-####`), isn't supported: where the literal is expected, the
|
|
57
|
+
* same character is read as the literal.
|
|
58
|
+
*
|
|
59
|
+
* Editing in the middle of the value shifts the characters after it, and one
|
|
60
|
+
* that doesn't fit its new position (e.g. a letter of `cnpj` shifted into
|
|
61
|
+
* the last 2 positions) is discarded.
|
|
62
|
+
*
|
|
63
|
+
* The `cpf` and `cnpj` masks don't validate check digits.
|
|
64
|
+
*
|
|
65
|
+
* Changing it keeps the `v-model`: a value that doesn't fit the new mask
|
|
66
|
+
* (e.g. longer than it) is displayed cut and fails validation with "Valor
|
|
67
|
+
* inválido".
|
|
68
|
+
*/
|
|
69
|
+
mask: MaskFieldMask;
|
|
70
|
+
/**
|
|
71
|
+
* Removes the ability to click or target the field.
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
74
|
+
disabled?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Displays a loading indicator on the input. The field keeps its label as
|
|
77
|
+
* accessible name and is marked as busy, and assistive technologies ignore
|
|
78
|
+
* the indicator.
|
|
79
|
+
* @default false
|
|
80
|
+
*/
|
|
81
|
+
loading?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Displays clear action.
|
|
84
|
+
* @default false
|
|
85
|
+
*/
|
|
86
|
+
clearable?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Prevent value changes.
|
|
89
|
+
* @default false
|
|
90
|
+
*/
|
|
91
|
+
readonly?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Add `rules` to require field to be filled before form submission.
|
|
94
|
+
* @default false
|
|
95
|
+
*/
|
|
96
|
+
required?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Field label.
|
|
99
|
+
*/
|
|
100
|
+
label?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Field placeholder. Defaults to the mask, with `0` in place of each `#`,
|
|
103
|
+
* e.g. `000.000.000-00` for `cpf`, `00.000.000/0000-00` for `cnpj` and
|
|
104
|
+
* `Nº 0000` for `Nº ####`.
|
|
105
|
+
*/
|
|
106
|
+
placeholder?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Field message to show and direct user to fill field correctly.
|
|
109
|
+
*
|
|
110
|
+
* This message will be replaced when there's an error message to be shown.
|
|
111
|
+
*/
|
|
112
|
+
hint?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Component id to use on automated tests.
|
|
115
|
+
*/
|
|
116
|
+
dataTestid?: string;
|
|
117
|
+
};
|
|
118
|
+
//#endregion
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import text_field_vue_vue_type_script_setup_true_lang_default from "./text-field.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region src/components/inputs/text-field/text-field.vue
|
|
3
|
+
var text_field_default = text_field_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { text_field_default as default };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { TextFieldProps, TextFieldType, TextFieldVariant } from "./types.js";
|
|
2
|
+
//#region src/components/inputs/text-field/text-field.vue.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Text field component to be used throughout the application.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```vue
|
|
8
|
+
* <template>
|
|
9
|
+
* <u-text-field label="E-mail" type="email" />
|
|
10
|
+
* <template>
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/text-field | TextField Guide}
|
|
14
|
+
*/
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
declare const __VLS_export: import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<TextFieldProps & {
|
|
17
|
+
modelValue?: string;
|
|
18
|
+
}, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {
|
|
19
|
+
"update:modelValue": (value: string) => any;
|
|
20
|
+
}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<TextFieldProps & {
|
|
21
|
+
modelValue?: string;
|
|
22
|
+
}> & Readonly<{
|
|
23
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
24
|
+
}>, {
|
|
25
|
+
variant: TextFieldVariant;
|
|
26
|
+
type: TextFieldType;
|
|
27
|
+
clearable: boolean;
|
|
28
|
+
}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { _default as default };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { useTextFieldVariant } from "../../../composables/inputs/fields.js";
|
|
2
|
+
import { useTextFieldAppendIcon, useTextFieldRules, useTextFieldType } from "../../../composables/inputs/text-field.js";
|
|
3
|
+
import field_loader_default from "../field-loader.js";
|
|
4
|
+
import { computed, createBlock, createSlots, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, openBlock, unref, useModel, withCtx } from "vue";
|
|
5
|
+
import { VIcon, VTextField } from "vuetify/components";
|
|
6
|
+
var text_field_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
7
|
+
inheritAttrs: false,
|
|
8
|
+
__name: "text-field",
|
|
9
|
+
props: /*@__PURE__*/ mergeModels({
|
|
10
|
+
variant: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: false,
|
|
13
|
+
default: "primary"
|
|
14
|
+
},
|
|
15
|
+
type: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: false,
|
|
18
|
+
default: "text"
|
|
19
|
+
},
|
|
20
|
+
disabled: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
required: false
|
|
23
|
+
},
|
|
24
|
+
loading: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
required: false
|
|
27
|
+
},
|
|
28
|
+
clearable: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
required: false,
|
|
31
|
+
default: void 0
|
|
32
|
+
},
|
|
33
|
+
readonly: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
required: false
|
|
36
|
+
},
|
|
37
|
+
required: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
required: false
|
|
40
|
+
},
|
|
41
|
+
label: {
|
|
42
|
+
type: String,
|
|
43
|
+
required: false
|
|
44
|
+
},
|
|
45
|
+
placeholder: {
|
|
46
|
+
type: String,
|
|
47
|
+
required: false
|
|
48
|
+
},
|
|
49
|
+
hint: {
|
|
50
|
+
type: String,
|
|
51
|
+
required: false
|
|
52
|
+
},
|
|
53
|
+
dataTestid: {
|
|
54
|
+
type: String,
|
|
55
|
+
required: false
|
|
56
|
+
}
|
|
57
|
+
}, {
|
|
58
|
+
"modelValue": {
|
|
59
|
+
type: String,
|
|
60
|
+
default: ""
|
|
61
|
+
},
|
|
62
|
+
"modelModifiers": {}
|
|
63
|
+
}),
|
|
64
|
+
emits: ["update:modelValue"],
|
|
65
|
+
setup(__props) {
|
|
66
|
+
const modelValue = useModel(__props, "modelValue");
|
|
67
|
+
const props = __props;
|
|
68
|
+
const vuetifyVariant = useTextFieldVariant(() => props.variant);
|
|
69
|
+
const { isPasswordVisible, iconProps: appendIconProps } = useTextFieldAppendIcon(() => props.type, () => props.disabled);
|
|
70
|
+
const vuetifyType = useTextFieldType(() => props.type, isPasswordVisible);
|
|
71
|
+
const rules = useTextFieldRules(props);
|
|
72
|
+
const computedClearable = computed(() => props.clearable ?? props.type === "search");
|
|
73
|
+
function clear() {
|
|
74
|
+
modelValue.value = "";
|
|
75
|
+
}
|
|
76
|
+
return (_ctx, _cache) => {
|
|
77
|
+
return openBlock(), createBlock(unref(VTextField), {
|
|
78
|
+
modelValue: modelValue.value,
|
|
79
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
80
|
+
variant: unref(vuetifyVariant),
|
|
81
|
+
type: unref(vuetifyType),
|
|
82
|
+
rules: unref(rules),
|
|
83
|
+
"data-testid": props.dataTestid,
|
|
84
|
+
disabled: props.disabled,
|
|
85
|
+
loading: props.loading,
|
|
86
|
+
"aria-busy": props.loading || void 0,
|
|
87
|
+
readonly: props.readonly,
|
|
88
|
+
label: props.label,
|
|
89
|
+
placeholder: props.placeholder,
|
|
90
|
+
hint: props.hint,
|
|
91
|
+
clearable: computedClearable.value,
|
|
92
|
+
"onClick:clear": clear
|
|
93
|
+
}, createSlots({
|
|
94
|
+
loader: withCtx((loader) => [createVNode(field_loader_default, normalizeProps(guardReactiveProps(loader)), null, 16)]),
|
|
95
|
+
_: 2
|
|
96
|
+
}, [unref(appendIconProps) ? {
|
|
97
|
+
name: "append-inner",
|
|
98
|
+
fn: withCtx(() => [createVNode(unref(VIcon), mergeProps(unref(appendIconProps), { disabled: props.disabled }), null, 16, ["disabled"])]),
|
|
99
|
+
key: "0"
|
|
100
|
+
} : void 0]), 1032, [
|
|
101
|
+
"modelValue",
|
|
102
|
+
"variant",
|
|
103
|
+
"type",
|
|
104
|
+
"rules",
|
|
105
|
+
"data-testid",
|
|
106
|
+
"disabled",
|
|
107
|
+
"loading",
|
|
108
|
+
"aria-busy",
|
|
109
|
+
"readonly",
|
|
110
|
+
"label",
|
|
111
|
+
"placeholder",
|
|
112
|
+
"hint",
|
|
113
|
+
"clearable"
|
|
114
|
+
]);
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
//#endregion
|
|
119
|
+
export { text_field_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
//#region src/components/inputs/text-field/types.d.ts
|
|
2
|
+
export type TextFieldVariant = "primary" | "secondary";
|
|
3
|
+
export type TextFieldType = "text" | "phone" | "email" | "url" | "password" | "search";
|
|
4
|
+
/**
|
|
5
|
+
* Props exposed by the {@link TextField} component.
|
|
6
|
+
*/
|
|
7
|
+
export type TextFieldProps = {
|
|
8
|
+
/**
|
|
9
|
+
* Applies a distinct style variation to the field.
|
|
10
|
+
* One of `primary` or `secondary`.
|
|
11
|
+
* @default "primary"
|
|
12
|
+
*/
|
|
13
|
+
variant?: TextFieldVariant;
|
|
14
|
+
/**
|
|
15
|
+
* Applies a distinct behavior to the field.
|
|
16
|
+
* One of `text`, `phone`, `email`, `url`, `password` or `search`.
|
|
17
|
+
*
|
|
18
|
+
* With `password`, the field hides its value and shows a "Mostrar senha"
|
|
19
|
+
* button that toggles between showing and hiding it. The value hides again
|
|
20
|
+
* when the button is pressed again or the type changes.
|
|
21
|
+
* @default "text"
|
|
22
|
+
*/
|
|
23
|
+
type?: TextFieldType;
|
|
24
|
+
/**
|
|
25
|
+
* Removes the ability to click or target the field.
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Displays a loading indicator on the input. The field keeps its label as
|
|
31
|
+
* accessible name and is marked as busy, and assistive technologies ignore
|
|
32
|
+
* the indicator.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
loading?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Displays clear action.
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
clearable?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Prevent value changes.
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
readonly?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Add `rules` to require field to be filled before form submission.
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
required?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Field label.
|
|
53
|
+
*/
|
|
54
|
+
label?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Field placeholder.
|
|
57
|
+
*/
|
|
58
|
+
placeholder?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Field message to show and direct user to fill field correctly.
|
|
61
|
+
*
|
|
62
|
+
* This message will be replaced when there's an error message to be shown.
|
|
63
|
+
*/
|
|
64
|
+
hint?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Component id to use on automated tests.
|
|
67
|
+
*/
|
|
68
|
+
dataTestid?: string;
|
|
69
|
+
};
|
|
70
|
+
//#endregion
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import link_vue_vue_type_script_setup_true_lang_default from "./link.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region src/components/link/link.vue
|
|
3
|
+
var link_default = link_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { link_default as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { LinkProps } from "./types.js";
|
|
2
|
+
//#region src/components/link/link.vue.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Standalone text link, such as "Forgot your password?" below a login form.
|
|
5
|
+
* Routes inside the app navigate through the app's router, and URLs starting
|
|
6
|
+
* with `http` navigate through the browser, in the same tab.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```vue
|
|
10
|
+
* <template>
|
|
11
|
+
* <u-link route="/forgot-password">Forgot your password?</u-link>
|
|
12
|
+
* </template>
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/link | Link Guide}
|
|
16
|
+
*/
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<LinkProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<LinkProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, {
|
|
19
|
+
default?: (props: {}) => any;
|
|
20
|
+
}>;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { _default as default };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import useRouteProps, { isExternalRoute } from "../../composables/navigation/use-route-props.js";
|
|
2
|
+
import { Fragment, createBlock, createCommentVNode, createElementBlock, defineComponent, mergeProps, openBlock, renderSlot, resolveDynamicComponent, unref, withCtx } from "vue";
|
|
3
|
+
import { RouterLink } from "vue-router";
|
|
4
|
+
var link_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
5
|
+
inheritAttrs: false,
|
|
6
|
+
__name: "link",
|
|
7
|
+
props: {
|
|
8
|
+
route: {
|
|
9
|
+
type: null,
|
|
10
|
+
required: true
|
|
11
|
+
},
|
|
12
|
+
dataTestid: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: false
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
setup(__props) {
|
|
18
|
+
const props = __props;
|
|
19
|
+
const routeProps = useRouteProps(() => props.route);
|
|
20
|
+
return (_ctx, _cache) => {
|
|
21
|
+
return openBlock(), createElementBlock(Fragment, null, [createCommentVNode(" No Vuetify component renders an inline text link, so the classes remove the browser's underline\n and set the theme's link color, instead of the browser's blue and purple "), (openBlock(), createBlock(resolveDynamicComponent(unref(isExternalRoute)(props.route) ? "a" : unref(RouterLink)), mergeProps(unref(routeProps), {
|
|
22
|
+
class: "text-decoration-none text-link",
|
|
23
|
+
"data-testid": props.dataTestid
|
|
24
|
+
}), {
|
|
25
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
26
|
+
_: 3
|
|
27
|
+
}, 16, ["data-testid"]))], 2112);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
//#endregion
|
|
32
|
+
export { link_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RouteLocationRaw } from "vue-router";
|
|
2
|
+
//#region src/components/link/types.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Props exposed by the {@link Link} component.
|
|
5
|
+
*/
|
|
6
|
+
export type LinkProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Where the link goes. A route inside the app (`"/login"`,
|
|
9
|
+
* `{ name: "forgot-password" }`) navigates through the app's router; a URL
|
|
10
|
+
* starting with `http` navigates through the browser, in the same tab.
|
|
11
|
+
*/
|
|
12
|
+
route: RouteLocationRaw;
|
|
13
|
+
/**
|
|
14
|
+
* Component id to use on automated tests.
|
|
15
|
+
*/
|
|
16
|
+
dataTestid?: string;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import main_vue_vue_type_script_setup_true_lang_default from "./main.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region src/components/main/main.vue
|
|
3
|
+
var main_default = main_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { main_default as default };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { MainProps, MainSlots } from "./types.js";
|
|
2
|
+
//#region src/components/main/main.vue.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Main component to be placed at the top of the component tree.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```vue
|
|
8
|
+
* <template>
|
|
9
|
+
* <u-main>
|
|
10
|
+
* <!-- uimed-components -->
|
|
11
|
+
* </u-main>
|
|
12
|
+
* </template>
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/main | Main Guide}
|
|
16
|
+
*/
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<MainProps & {
|
|
19
|
+
notificationsOpen?: boolean;
|
|
20
|
+
}, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {
|
|
21
|
+
"update:notificationsOpen": (value: boolean) => any;
|
|
22
|
+
}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<MainProps & {
|
|
23
|
+
notificationsOpen?: boolean;
|
|
24
|
+
}> & Readonly<{
|
|
25
|
+
"onUpdate:notificationsOpen"?: ((value: boolean) => any) | undefined;
|
|
26
|
+
}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, MainSlots>;
|
|
27
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
28
|
+
new (): {
|
|
29
|
+
$slots: S;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { _default as default };
|