@nexdom/uimed-vue 2.0.0-beta.12 → 2.0.0-beta.14
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 +135 -17
- package/dist/components.js +424 -127
- package/package.json +1 -1
package/dist/components.d.ts
CHANGED
|
@@ -155,6 +155,13 @@ type MainProps = {
|
|
|
155
155
|
* Navigation menu properties.
|
|
156
156
|
*/
|
|
157
157
|
navigationMenu?: NavigationMenuProps;
|
|
158
|
+
/**
|
|
159
|
+
* Shows skeleton loaders in place of the user-related parts of the app bar
|
|
160
|
+
* and of the navigation menu items while their data is being loaded.
|
|
161
|
+
* The main content (default slot) isn't affected.
|
|
162
|
+
* @default false
|
|
163
|
+
*/
|
|
164
|
+
loading?: boolean;
|
|
158
165
|
};
|
|
159
166
|
//#endregion
|
|
160
167
|
//#region src/components/main/main.vue.d.ts
|
|
@@ -172,8 +179,8 @@ type MainProps = {
|
|
|
172
179
|
*
|
|
173
180
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/main | Main Guide}
|
|
174
181
|
*/
|
|
175
|
-
declare const _default$
|
|
176
|
-
declare const __VLS_export$
|
|
182
|
+
declare const _default$10: typeof __VLS_export$15;
|
|
183
|
+
declare const __VLS_export$15: __VLS_WithSlots$9<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<MainProps & {
|
|
177
184
|
notificationsOpen?: boolean;
|
|
178
185
|
}, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {
|
|
179
186
|
"update:notificationsOpen": (value: boolean) => any;
|
|
@@ -205,8 +212,8 @@ type __VLS_WithSlots$9<T, S> = T & {
|
|
|
205
212
|
*
|
|
206
213
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/button | Button Guide}
|
|
207
214
|
*/
|
|
208
|
-
declare const _default$1: typeof __VLS_export$
|
|
209
|
-
declare const __VLS_export$
|
|
215
|
+
declare const _default$1: typeof __VLS_export$14;
|
|
216
|
+
declare const __VLS_export$14: __VLS_WithSlots$8<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<ButtonProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {} & {
|
|
210
217
|
click: (event: MouseEvent) => any;
|
|
211
218
|
}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<ButtonProps> & Readonly<{
|
|
212
219
|
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
@@ -377,8 +384,8 @@ type AutocompleteFieldProps<T = string, Multiple extends boolean = false> = {
|
|
|
377
384
|
*
|
|
378
385
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/autocomplete-field | AutocompleteField Guide}
|
|
379
386
|
*/
|
|
380
|
-
declare const _default: typeof __VLS_export$
|
|
381
|
-
declare const __VLS_export$
|
|
387
|
+
declare const _default: typeof __VLS_export$13;
|
|
388
|
+
declare const __VLS_export$13: <T = string, Multiple extends boolean = false>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal$2<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
382
389
|
props: import("vue").PublicProps & __VLS_PrettifyLocal$2<(AutocompleteFieldProps<T, Multiple> & {
|
|
383
390
|
modelValue?: Multiple extends true ? T[] : T;
|
|
384
391
|
}) & {
|
|
@@ -408,8 +415,8 @@ type __VLS_PrettifyLocal$2<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [
|
|
|
408
415
|
*
|
|
409
416
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/text-field | TextField Guide}
|
|
410
417
|
*/
|
|
411
|
-
declare const _default$
|
|
412
|
-
declare const __VLS_export$
|
|
418
|
+
declare const _default$15: typeof __VLS_export$12;
|
|
419
|
+
declare const __VLS_export$12: import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<TextFieldProps & {
|
|
413
420
|
modelValue?: string;
|
|
414
421
|
}, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {
|
|
415
422
|
"update:modelValue": (value: string) => any;
|
|
@@ -471,8 +478,8 @@ type CheckboxProps<T = boolean> = {
|
|
|
471
478
|
*
|
|
472
479
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/checkbox | Checkbox Guide}
|
|
473
480
|
*/
|
|
474
|
-
declare const _default$2: typeof __VLS_export$
|
|
475
|
-
declare const __VLS_export$
|
|
481
|
+
declare const _default$2: typeof __VLS_export$11;
|
|
482
|
+
declare const __VLS_export$11: <T = any>(__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<{
|
|
476
483
|
props: import("vue").PublicProps & __VLS_PrettifyLocal$1<(CheckboxProps<boolean | T> & {
|
|
477
484
|
modelValue?: T;
|
|
478
485
|
}) & {
|
|
@@ -489,6 +496,117 @@ declare const __VLS_export$10: <T = any>(__VLS_props: NonNullable<Awaited<typeof
|
|
|
489
496
|
};
|
|
490
497
|
type __VLS_PrettifyLocal$1<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
491
498
|
//#endregion
|
|
499
|
+
//#region src/components/inputs/date-time-field/types.d.ts
|
|
500
|
+
type DateTimeFieldVariant = TextFieldVariant;
|
|
501
|
+
type DateTimeFieldType = "date" | "time" | "datetime";
|
|
502
|
+
/**
|
|
503
|
+
* Props exposed by the {@link DateTimeField} component.
|
|
504
|
+
*/
|
|
505
|
+
type DateTimeFieldProps = {
|
|
506
|
+
/**
|
|
507
|
+
* Applies a distinct style variation to the field.
|
|
508
|
+
* One of `primary` or `secondary`.
|
|
509
|
+
* @default "primary"
|
|
510
|
+
*/
|
|
511
|
+
variant?: DateTimeFieldVariant;
|
|
512
|
+
/**
|
|
513
|
+
* Defines which pickers are available and the format of the value.
|
|
514
|
+
*
|
|
515
|
+
* - `date`: value formatted as `YYYY-MM-DD` (e.g. `2026-09-24`);
|
|
516
|
+
* - `time`: value formatted as `HH:mm`, 24h (e.g. `14:30`);
|
|
517
|
+
* - `datetime`: value formatted as `YYYY-MM-DDTHH:mm` (e.g. `2026-09-24T14:30`).
|
|
518
|
+
* @default "datetime"
|
|
519
|
+
*/
|
|
520
|
+
type?: DateTimeFieldType;
|
|
521
|
+
/**
|
|
522
|
+
* Minimum allowed value, in the same format as the value for the current `type`.
|
|
523
|
+
*
|
|
524
|
+
* Earlier options can't be picked, and an earlier value shows an error message.
|
|
525
|
+
* For `datetime`, the time limit only applies to the minimum's own date.
|
|
526
|
+
*/
|
|
527
|
+
min?: string;
|
|
528
|
+
/**
|
|
529
|
+
* Maximum allowed value, in the same format as the value for the current `type`.
|
|
530
|
+
*
|
|
531
|
+
* Later options can't be picked, and a later value shows an error message.
|
|
532
|
+
* For `datetime`, the time limit only applies to the maximum's own date.
|
|
533
|
+
*/
|
|
534
|
+
max?: string;
|
|
535
|
+
/**
|
|
536
|
+
* Removes the ability to click or target the field.
|
|
537
|
+
* @default false
|
|
538
|
+
*/
|
|
539
|
+
disabled?: boolean;
|
|
540
|
+
/**
|
|
541
|
+
* Displays a loading indicator on the input.
|
|
542
|
+
* @default false
|
|
543
|
+
*/
|
|
544
|
+
loading?: boolean;
|
|
545
|
+
/**
|
|
546
|
+
* Displays clear action, which is hidden while the field is `readonly`.
|
|
547
|
+
* @default false
|
|
548
|
+
*/
|
|
549
|
+
clearable?: boolean;
|
|
550
|
+
/**
|
|
551
|
+
* Prevent value changes. The pickers won't open.
|
|
552
|
+
* @default false
|
|
553
|
+
*/
|
|
554
|
+
readonly?: boolean;
|
|
555
|
+
/**
|
|
556
|
+
* Add `rules` to require field to be filled before form submission.
|
|
557
|
+
* @default false
|
|
558
|
+
*/
|
|
559
|
+
required?: boolean;
|
|
560
|
+
/**
|
|
561
|
+
* Field label.
|
|
562
|
+
*/
|
|
563
|
+
label?: string;
|
|
564
|
+
/**
|
|
565
|
+
* Field placeholder.
|
|
566
|
+
*/
|
|
567
|
+
placeholder?: string;
|
|
568
|
+
/**
|
|
569
|
+
* Field message to show and direct user to fill field correctly.
|
|
570
|
+
*
|
|
571
|
+
* This message will be replaced when there's an error message to be shown.
|
|
572
|
+
*/
|
|
573
|
+
hint?: string;
|
|
574
|
+
/**
|
|
575
|
+
* Component id to use on automated tests.
|
|
576
|
+
*/
|
|
577
|
+
dataTestid?: string;
|
|
578
|
+
};
|
|
579
|
+
//#endregion
|
|
580
|
+
//#region src/components/inputs/date-time-field/date-time-field.vue.d.ts
|
|
581
|
+
/**
|
|
582
|
+
* Date and/or time field component to be used throughout the application.
|
|
583
|
+
*
|
|
584
|
+
* Its value uses the native input formats: `YYYY-MM-DD` for `date`, `HH:mm`
|
|
585
|
+
* for `time` and `YYYY-MM-DDTHH:mm` for `datetime`.
|
|
586
|
+
*
|
|
587
|
+
* @example
|
|
588
|
+
* ```vue
|
|
589
|
+
* <template>
|
|
590
|
+
* <u-date-time-field v-model="birthDate" label="Data de nascimento" type="date" />
|
|
591
|
+
* <template>
|
|
592
|
+
* ```
|
|
593
|
+
*
|
|
594
|
+
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/date-time-field | DateTimeField Guide}
|
|
595
|
+
*/
|
|
596
|
+
declare const _default$7: typeof __VLS_export$10;
|
|
597
|
+
declare const __VLS_export$10: import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<DateTimeFieldProps & {
|
|
598
|
+
modelValue?: string;
|
|
599
|
+
}, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {
|
|
600
|
+
"update:modelValue": (value: string) => any;
|
|
601
|
+
}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<DateTimeFieldProps & {
|
|
602
|
+
modelValue?: string;
|
|
603
|
+
}> & Readonly<{
|
|
604
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
605
|
+
}>, {
|
|
606
|
+
variant: DateTimeFieldVariant;
|
|
607
|
+
type: DateTimeFieldType;
|
|
608
|
+
}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>;
|
|
609
|
+
//#endregion
|
|
492
610
|
//#region src/components/grid/container/types.d.ts
|
|
493
611
|
/**
|
|
494
612
|
* Props exposed by the {@link Container} component.
|
|
@@ -561,7 +679,7 @@ type RowProps = {
|
|
|
561
679
|
*
|
|
562
680
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/layout | Row Guide}
|
|
563
681
|
*/
|
|
564
|
-
declare const _default$
|
|
682
|
+
declare const _default$11: typeof __VLS_export$8;
|
|
565
683
|
declare const __VLS_export$8: __VLS_WithSlots$6<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>, {
|
|
566
684
|
default?: (props: {}) => any;
|
|
567
685
|
}>;
|
|
@@ -660,7 +778,7 @@ type FormProps = {
|
|
|
660
778
|
*
|
|
661
779
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/form | Form Guide}
|
|
662
780
|
*/
|
|
663
|
-
declare const _default$
|
|
781
|
+
declare const _default$9: typeof __VLS_export$6;
|
|
664
782
|
declare const __VLS_export$6: __VLS_WithSlots$4<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<FormProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {} & {
|
|
665
783
|
submit: (event: SubmitEvent) => any;
|
|
666
784
|
}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<FormProps> & Readonly<{
|
|
@@ -690,7 +808,7 @@ type __VLS_WithSlots$4<T, S> = T & {
|
|
|
690
808
|
*
|
|
691
809
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/section | Section Guide}
|
|
692
810
|
*/
|
|
693
|
-
declare const _default$
|
|
811
|
+
declare const _default$13: typeof __VLS_export$5;
|
|
694
812
|
declare const __VLS_export$5: __VLS_WithSlots$3<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>, {
|
|
695
813
|
default?: (props: {}) => any;
|
|
696
814
|
}>;
|
|
@@ -776,7 +894,7 @@ interface SectionAction extends ButtonProps {
|
|
|
776
894
|
*
|
|
777
895
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/section | Section Guide}
|
|
778
896
|
*/
|
|
779
|
-
declare const _default$
|
|
897
|
+
declare const _default$12: typeof __VLS_export$4;
|
|
780
898
|
declare const __VLS_export$4: __VLS_WithSlots$2<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>, {
|
|
781
899
|
default?: (props: {}) => any;
|
|
782
900
|
}>;
|
|
@@ -851,7 +969,7 @@ type TableProps = {
|
|
|
851
969
|
*
|
|
852
970
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/table | Table Guide}
|
|
853
971
|
*/
|
|
854
|
-
declare const _default$
|
|
972
|
+
declare const _default$14: typeof __VLS_export$3;
|
|
855
973
|
declare const __VLS_export$3: 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>;
|
|
856
974
|
//#endregion
|
|
857
975
|
//#region src/components/details/types.d.ts
|
|
@@ -899,7 +1017,7 @@ type DetailsProps = {
|
|
|
899
1017
|
*
|
|
900
1018
|
* @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/details | Details Guide}
|
|
901
1019
|
*/
|
|
902
|
-
declare const _default$
|
|
1020
|
+
declare const _default$8: typeof __VLS_export$2;
|
|
903
1021
|
declare const __VLS_export$2: __VLS_WithSlots$1<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>, {
|
|
904
1022
|
default?: (props: {}) => any;
|
|
905
1023
|
}>;
|
|
@@ -1088,4 +1206,4 @@ type __VLS_WithSlots<T, S> = T & {
|
|
|
1088
1206
|
};
|
|
1089
1207
|
};
|
|
1090
1208
|
//#endregion
|
|
1091
|
-
export { _default as UAutocompleteField, _default$1 as UButton, _default$2 as UCheckbox, _default$3 as UColumn, _default$4 as UContainer, _default$5 as UDataSet, _default$6 as UDataSetItem, _default$7 as
|
|
1209
|
+
export { _default as UAutocompleteField, _default$1 as UButton, _default$2 as UCheckbox, _default$3 as UColumn, _default$4 as UContainer, _default$5 as UDataSet, _default$6 as UDataSetItem, _default$7 as UDateTimeField, _default$8 as UDetails, _default$9 as UForm, _default$10 as UMain, _default$11 as URow, _default$12 as USection, _default$13 as USectionContent, _default$14 as UTable, _default$15 as UTextField };
|
package/dist/components.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { a as messages, n as owners, r as requests, s as useVuetifyColor } from "./use-dialog-Ck2_ZW7T.js";
|
|
2
2
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, isRef, mergeModels, mergeProps, normalizeClass, onMounted, onScopeDispose, onUnmounted, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toValue, unref, useId, useModel, useSlots, useTemplateRef, watch, withCtx, withModifiers } from "vue";
|
|
3
|
-
import { VApp, VAppBar, VAppBarNavIcon, VAppBarTitle, VAutocomplete, VAvatar, VBadge, VBtn, VCard, VCardActions, VCardItem, VCardText, VCardTitle, VCheckboxBtn, VCol, VCombobox, VContainer, VDataIterator, VDialog, VDivider, VEmptyState, VExpansionPanel, VExpansionPanelText, VExpansionPanelTitle, VExpansionPanels, VForm, VIcon, VIconBtn, VImg, VList, VListGroup, VListItem, VListItemAction, VListSubheader, VMain, VMenu, VNavigationDrawer, VPagination, VRow, VSkeletonLoader, VSnackbarQueue, VTable, VTextField } from "vuetify/components";
|
|
4
|
-
import { isEmail, isEmpty, isPhone, isUrl } from "@nexdom/shared/utils";
|
|
3
|
+
import { VApp, VAppBar, VAppBarNavIcon, VAppBarTitle, VAutocomplete, VAvatar, VBadge, VBtn, VCard, VCardActions, VCardItem, VCardText, VCardTitle, VCheckboxBtn, VCol, VCombobox, VContainer, VDataIterator, VDatePicker, VDialog, VDivider, VEmptyState, VExpansionPanel, VExpansionPanelText, VExpansionPanelTitle, VExpansionPanels, VForm, VIcon, VIconBtn, VImg, VList, VListGroup, VListItem, VListItemAction, VListSubheader, VLocaleProvider, VMain, VMenu, VNavigationDrawer, VPagination, VRow, VSkeletonLoader, VSnackbarQueue, VTable, VTextField, VTimePicker } from "vuetify/components";
|
|
4
|
+
import { formatDateTime, isEmail, isEmpty, isPhone, isUrl } from "@nexdom/shared/utils";
|
|
5
|
+
import { pt } from "vuetify/locale";
|
|
5
6
|
//#region src/composables/navigation/use-route-props.ts
|
|
6
7
|
function useRouteProps(route) {
|
|
7
8
|
return computed(() => routeToProps(route));
|
|
@@ -49,6 +50,10 @@ var app_bar_default = /* @__PURE__ */ defineComponent({
|
|
|
49
50
|
logo: {
|
|
50
51
|
type: String,
|
|
51
52
|
required: false
|
|
53
|
+
},
|
|
54
|
+
loading: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
required: false
|
|
52
57
|
}
|
|
53
58
|
}, {
|
|
54
59
|
"notificationsOpen": {
|
|
@@ -75,119 +80,131 @@ var app_bar_default = /* @__PURE__ */ defineComponent({
|
|
|
75
80
|
const showNotifications = computed(() => !!props.notifications);
|
|
76
81
|
const unreadCount = computed(() => props.notifications.filter((notification) => !notification.read).length);
|
|
77
82
|
const hasUnreadNotifications = computed(() => unreadCount.value > 0);
|
|
83
|
+
watch(() => props.loading, (loading) => {
|
|
84
|
+
if (loading) notificationsOpen.value = false;
|
|
85
|
+
});
|
|
78
86
|
const showUser = computed(() => !!props.user);
|
|
79
87
|
const userAvatarProps = computed(() => props.user.img ? { image: props.user.img } : { icon: "mdi-account-outline" });
|
|
80
88
|
function isParentOption(option) {
|
|
81
89
|
return "items" in option;
|
|
82
90
|
}
|
|
83
91
|
return (_ctx, _cache) => {
|
|
84
|
-
return openBlock(), createBlock(unref(VAppBar), {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode("Notificações", -1)])]),
|
|
92
|
+
return openBlock(), createBlock(unref(VAppBar), {
|
|
93
|
+
"data-testid": props.dataTestid,
|
|
94
|
+
"aria-busy": props.loading || void 0
|
|
95
|
+
}, {
|
|
96
|
+
append: withCtx(() => [createVNode(unref(VSkeletonLoader), {
|
|
97
|
+
loading: props.loading,
|
|
98
|
+
type: "avatar"
|
|
99
|
+
}, {
|
|
100
|
+
default: withCtx(() => [
|
|
101
|
+
showHelp.value ? (openBlock(), createBlock(unref(VBtn), mergeProps({ key: 0 }, unref(routeProps), {
|
|
102
|
+
"data-testid": helpBtnDataTestid.value,
|
|
103
|
+
icon: "mdi-help-circle-outline"
|
|
104
|
+
}), null, 16, ["data-testid"])) : createCommentVNode("v-if", true),
|
|
105
|
+
showNotifications.value ? (openBlock(), createBlock(unref(VMenu), {
|
|
106
|
+
key: 1,
|
|
107
|
+
modelValue: notificationsOpen.value,
|
|
108
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => notificationsOpen.value = $event),
|
|
109
|
+
"close-on-content-click": false
|
|
110
|
+
}, {
|
|
111
|
+
activator: withCtx(({ props }) => [createVNode(unref(VBtn), mergeProps(props, {
|
|
112
|
+
"data-testid": notificationsBtnDataTestid.value,
|
|
113
|
+
icon: ""
|
|
114
|
+
}), {
|
|
115
|
+
default: withCtx(() => [createVNode(unref(VBadge), {
|
|
116
|
+
"model-value": hasUnreadNotifications.value,
|
|
117
|
+
content: unreadCount.value,
|
|
118
|
+
color: "error"
|
|
119
|
+
}, {
|
|
120
|
+
default: withCtx(() => [createVNode(unref(VIcon), { icon: "mdi-bell-outline" })]),
|
|
114
121
|
_: 1
|
|
115
|
-
}
|
|
116
|
-
return openBlock(), createBlock(unref(VListItem), {
|
|
117
|
-
key: index,
|
|
118
|
-
active: !notification.read,
|
|
119
|
-
title: notification.title,
|
|
120
|
-
subtitle: notification.subtitle,
|
|
121
|
-
"active-class": "text-primary"
|
|
122
|
-
}, createSlots({ _: 2 }, [notification.when ? {
|
|
123
|
-
name: "append",
|
|
124
|
-
fn: withCtx(() => [createVNode(unref(VListItemAction), { end: "" }, {
|
|
125
|
-
default: withCtx(() => [createElementVNode("small", _hoisted_1$2, toDisplayString(notification.when), 1)]),
|
|
126
|
-
_: 2
|
|
127
|
-
}, 1024)]),
|
|
128
|
-
key: "0"
|
|
129
|
-
} : void 0]), 1032, [
|
|
130
|
-
"active",
|
|
131
|
-
"title",
|
|
132
|
-
"subtitle"
|
|
133
|
-
]);
|
|
134
|
-
}), 128))]),
|
|
122
|
+
}, 8, ["model-value", "content"])]),
|
|
135
123
|
_: 1
|
|
136
|
-
}
|
|
137
|
-
|
|
124
|
+
}, 16, ["data-testid"])]),
|
|
125
|
+
default: withCtx(() => [createVNode(unref(VCard), { "data-testid": notificationsMenuDataTestid.value }, {
|
|
126
|
+
default: withCtx(() => [props.notifications?.length ? (openBlock(), createBlock(unref(VList), { key: 0 }, {
|
|
127
|
+
default: withCtx(() => [createVNode(unref(VListSubheader), null, {
|
|
128
|
+
default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode("Notificações", -1)])]),
|
|
129
|
+
_: 1
|
|
130
|
+
}), (openBlock(true), createElementBlock(Fragment, null, renderList(props.notifications, (notification, index) => {
|
|
131
|
+
return openBlock(), createBlock(unref(VListItem), {
|
|
132
|
+
key: index,
|
|
133
|
+
active: !notification.read,
|
|
134
|
+
title: notification.title,
|
|
135
|
+
subtitle: notification.subtitle,
|
|
136
|
+
"active-class": "text-primary"
|
|
137
|
+
}, createSlots({ _: 2 }, [notification.when ? {
|
|
138
|
+
name: "append",
|
|
139
|
+
fn: withCtx(() => [createVNode(unref(VListItemAction), { end: "" }, {
|
|
140
|
+
default: withCtx(() => [createElementVNode("small", _hoisted_1$2, toDisplayString(notification.when), 1)]),
|
|
141
|
+
_: 2
|
|
142
|
+
}, 1024)]),
|
|
143
|
+
key: "0"
|
|
144
|
+
} : void 0]), 1032, [
|
|
145
|
+
"active",
|
|
146
|
+
"title",
|
|
147
|
+
"subtitle"
|
|
148
|
+
]);
|
|
149
|
+
}), 128))]),
|
|
150
|
+
_: 1
|
|
151
|
+
})) : (openBlock(), createBlock(unref(VCardText), { key: 1 }, {
|
|
152
|
+
default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode("Nenhuma notificação", -1)])]),
|
|
153
|
+
_: 1
|
|
154
|
+
}))]),
|
|
138
155
|
_: 1
|
|
139
|
-
})
|
|
140
|
-
_: 1
|
|
141
|
-
}, 8, ["data-testid"])]),
|
|
142
|
-
_: 1
|
|
143
|
-
}, 8, ["modelValue"])) : createCommentVNode("v-if", true),
|
|
144
|
-
showUser.value ? (openBlock(), createBlock(unref(VMenu), {
|
|
145
|
-
key: 2,
|
|
146
|
-
"close-on-content-click": false
|
|
147
|
-
}, {
|
|
148
|
-
activator: withCtx(({ props }) => [createVNode(unref(VBtn), mergeProps(props, {
|
|
149
|
-
"data-testid": userBtnDataTestid.value,
|
|
150
|
-
icon: ""
|
|
151
|
-
}), {
|
|
152
|
-
default: withCtx(() => [createVNode(unref(VAvatar), mergeProps(userAvatarProps.value, { color: "primary" }), null, 16)]),
|
|
156
|
+
}, 8, ["data-testid"])]),
|
|
153
157
|
_: 1
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
"data-testid": userMenuDataTestid.value
|
|
158
|
+
}, 8, ["modelValue"])) : createCommentVNode("v-if", true),
|
|
159
|
+
showUser.value ? (openBlock(), createBlock(unref(VMenu), {
|
|
160
|
+
key: 2,
|
|
161
|
+
"close-on-content-click": false
|
|
159
162
|
}, {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
163
|
+
activator: withCtx(({ props }) => [createVNode(unref(VBtn), mergeProps(props, {
|
|
164
|
+
"data-testid": userBtnDataTestid.value,
|
|
165
|
+
icon: ""
|
|
166
|
+
}), {
|
|
167
|
+
default: withCtx(() => [createVNode(unref(VAvatar), mergeProps(userAvatarProps.value, { color: "primary" }), null, 16)]),
|
|
168
|
+
_: 1
|
|
169
|
+
}, 16, ["data-testid"])]),
|
|
170
|
+
default: withCtx(() => [createVNode(unref(VCard), {
|
|
171
|
+
title: __props.user?.title,
|
|
172
|
+
subtitle: __props.user?.subtitle,
|
|
173
|
+
"data-testid": userMenuDataTestid.value
|
|
174
|
+
}, {
|
|
175
|
+
prepend: withCtx(() => [createVNode(unref(VAvatar), mergeProps(userAvatarProps.value, { color: "primary" }), null, 16)]),
|
|
176
|
+
default: withCtx(() => [createVNode(unref(VDivider)), createVNode(unref(VList), { nav: "" }, {
|
|
177
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(props.user?.options, (option, index) => {
|
|
178
|
+
return openBlock(), createElementBlock(Fragment, { key: index }, [index > 0 ? (openBlock(), createBlock(unref(VDivider), {
|
|
179
|
+
key: 0,
|
|
180
|
+
class: "mt-1"
|
|
181
|
+
})) : createCommentVNode("v-if", true), isParentOption(option) ? (openBlock(), createBlock(unref(VListGroup), { key: 1 }, {
|
|
182
|
+
activator: withCtx(({ props }) => [createVNode(unref(VListItem), mergeProps({ ref_for: true }, props, { title: option.description }), null, 16, ["title"])]),
|
|
183
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(option.items, (childOption, index) => {
|
|
184
|
+
return openBlock(), createBlock(unref(VListItem), mergeProps({ key: index }, { ref_for: true }, unref(routeToProps)(childOption.route), {
|
|
185
|
+
title: childOption.description,
|
|
186
|
+
onClick: childOption.action
|
|
187
|
+
}), null, 16, ["title", "onClick"]);
|
|
188
|
+
}), 128))]),
|
|
189
|
+
_: 2
|
|
190
|
+
}, 1024)) : (openBlock(), createBlock(unref(VListItem), mergeProps({
|
|
191
|
+
key: 2,
|
|
192
|
+
title: option.description
|
|
193
|
+
}, { ref_for: true }, unref(routeToProps)(option.route), { onClick: option.action }), null, 16, ["title", "onClick"]))], 64);
|
|
194
|
+
}), 128))]),
|
|
195
|
+
_: 1
|
|
196
|
+
})]),
|
|
180
197
|
_: 1
|
|
181
|
-
}
|
|
198
|
+
}, 8, [
|
|
199
|
+
"title",
|
|
200
|
+
"subtitle",
|
|
201
|
+
"data-testid"
|
|
202
|
+
])]),
|
|
182
203
|
_: 1
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
])]),
|
|
188
|
-
_: 1
|
|
189
|
-
})) : createCommentVNode("v-if", true)
|
|
190
|
-
]),
|
|
204
|
+
})) : createCommentVNode("v-if", true)
|
|
205
|
+
]),
|
|
206
|
+
_: 1
|
|
207
|
+
}, 8, ["loading"])]),
|
|
191
208
|
default: withCtx(() => [
|
|
192
209
|
__props.navigation ? (openBlock(), createBlock(unref(VAppBarNavIcon), {
|
|
193
210
|
key: 0,
|
|
@@ -208,7 +225,7 @@ var app_bar_default = /* @__PURE__ */ defineComponent({
|
|
|
208
225
|
})) : createCommentVNode("v-if", true)
|
|
209
226
|
]),
|
|
210
227
|
_: 1
|
|
211
|
-
}, 8, ["data-testid"]);
|
|
228
|
+
}, 8, ["data-testid", "aria-busy"]);
|
|
212
229
|
};
|
|
213
230
|
}
|
|
214
231
|
});
|
|
@@ -408,6 +425,10 @@ var navigation_menu_default = /* @__PURE__ */ defineComponent({
|
|
|
408
425
|
items: {
|
|
409
426
|
type: Array,
|
|
410
427
|
required: false
|
|
428
|
+
},
|
|
429
|
+
loading: {
|
|
430
|
+
type: Boolean,
|
|
431
|
+
required: false
|
|
411
432
|
}
|
|
412
433
|
}, {
|
|
413
434
|
"modelValue": {
|
|
@@ -449,6 +470,7 @@ var navigation_menu_default = /* @__PURE__ */ defineComponent({
|
|
|
449
470
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => open.value = $event),
|
|
450
471
|
color: "primary",
|
|
451
472
|
"data-testid": props.dataTestid,
|
|
473
|
+
"aria-busy": props.loading || void 0,
|
|
452
474
|
absolute: "",
|
|
453
475
|
temporary: ""
|
|
454
476
|
}, {
|
|
@@ -457,28 +479,44 @@ var navigation_menu_default = /* @__PURE__ */ defineComponent({
|
|
|
457
479
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => search.value = $event),
|
|
458
480
|
type: "search",
|
|
459
481
|
label: "Buscar",
|
|
460
|
-
"data-testid": searchDataTestid.value
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
key:
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
482
|
+
"data-testid": searchDataTestid.value,
|
|
483
|
+
disabled: props.loading
|
|
484
|
+
}, null, 8, [
|
|
485
|
+
"modelValue",
|
|
486
|
+
"data-testid",
|
|
487
|
+
"disabled"
|
|
488
|
+
])])]),
|
|
489
|
+
default: withCtx(() => [createVNode(unref(VDivider)), createVNode(unref(VSkeletonLoader), {
|
|
490
|
+
loading: props.loading,
|
|
491
|
+
type: "list-item@6",
|
|
492
|
+
color: "primary"
|
|
493
|
+
}, {
|
|
494
|
+
default: withCtx(() => [createVNode(unref(VList), { nav: "" }, {
|
|
495
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(filteredItems.value, (item, index) => {
|
|
496
|
+
return openBlock(), createElementBlock(Fragment, { key: index }, [isParentItem(item) ? (openBlock(), createBlock(unref(VListGroup), { key: 0 }, {
|
|
497
|
+
activator: withCtx(({ props: activatorProps }) => [createVNode(unref(VListItem), mergeProps({ ref_for: true }, activatorProps, { title: item.description }), null, 16, ["title"])]),
|
|
498
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(item.items, (childItem, childIndex) => {
|
|
499
|
+
return openBlock(), createBlock(unref(VListItem), mergeProps({ key: childIndex }, { ref_for: true }, unref(routeToProps)(childItem.route), {
|
|
500
|
+
title: childItem.description,
|
|
501
|
+
onClick: childItem.action
|
|
502
|
+
}), null, 16, ["title", "onClick"]);
|
|
503
|
+
}), 128))]),
|
|
504
|
+
_: 2
|
|
505
|
+
}, 1024)) : (openBlock(), createBlock(unref(VListItem), mergeProps({
|
|
506
|
+
key: 1,
|
|
507
|
+
title: item.description
|
|
508
|
+
}, { ref_for: true }, unref(routeToProps)(item.route), { onClick: item.action }), null, 16, ["title", "onClick"]))], 64);
|
|
509
|
+
}), 128))]),
|
|
510
|
+
_: 1
|
|
511
|
+
})]),
|
|
478
512
|
_: 1
|
|
479
|
-
})]),
|
|
513
|
+
}, 8, ["loading"])]),
|
|
480
514
|
_: 1
|
|
481
|
-
}, 8, [
|
|
515
|
+
}, 8, [
|
|
516
|
+
"modelValue",
|
|
517
|
+
"data-testid",
|
|
518
|
+
"aria-busy"
|
|
519
|
+
]);
|
|
482
520
|
};
|
|
483
521
|
}
|
|
484
522
|
});
|
|
@@ -768,6 +806,10 @@ var main_default = /* @__PURE__ */ defineComponent({
|
|
|
768
806
|
navigationMenu: {
|
|
769
807
|
type: Object,
|
|
770
808
|
required: false
|
|
809
|
+
},
|
|
810
|
+
loading: {
|
|
811
|
+
type: Boolean,
|
|
812
|
+
required: false
|
|
771
813
|
}
|
|
772
814
|
}, {
|
|
773
815
|
"notificationsOpen": {
|
|
@@ -782,7 +824,8 @@ var main_default = /* @__PURE__ */ defineComponent({
|
|
|
782
824
|
const appBarProps = computed(() => props.appBar ? {
|
|
783
825
|
...props.appBar,
|
|
784
826
|
logo: props.logo,
|
|
785
|
-
navigation: props.navigationMenu !== void 0
|
|
827
|
+
navigation: props.navigationMenu !== void 0,
|
|
828
|
+
loading: props.loading
|
|
786
829
|
} : void 0);
|
|
787
830
|
const notificationsOpen = useModel(__props, "notificationsOpen");
|
|
788
831
|
const navigationMenuOpen = ref(false);
|
|
@@ -797,8 +840,9 @@ var main_default = /* @__PURE__ */ defineComponent({
|
|
|
797
840
|
}), null, 16, ["notifications-open", "navigation-open"])) : createCommentVNode("v-if", true),
|
|
798
841
|
props.navigationMenu ? (openBlock(), createBlock(navigation_menu_default, mergeProps({ key: 1 }, props.navigationMenu, {
|
|
799
842
|
modelValue: navigationMenuOpen.value,
|
|
800
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => navigationMenuOpen.value = $event)
|
|
801
|
-
|
|
843
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => navigationMenuOpen.value = $event),
|
|
844
|
+
loading: props.loading
|
|
845
|
+
}), null, 16, ["modelValue", "loading"])) : createCommentVNode("v-if", true),
|
|
802
846
|
createVNode(unref(VMain), null, {
|
|
803
847
|
default: withCtx(() => [createVNode(container_default, null, {
|
|
804
848
|
default: withCtx(() => [
|
|
@@ -1022,6 +1066,259 @@ var checkbox_default = /* @__PURE__ */ defineComponent({
|
|
|
1022
1066
|
}
|
|
1023
1067
|
});
|
|
1024
1068
|
//#endregion
|
|
1069
|
+
//#region src/composables/inputs/date-time-field.ts
|
|
1070
|
+
/**
|
|
1071
|
+
* Extracts the date part (`YYYY-MM-DD`) of a value, or an empty string when
|
|
1072
|
+
* the type has no date.
|
|
1073
|
+
*/
|
|
1074
|
+
function getDatePart(value, type) {
|
|
1075
|
+
return type === "time" ? "" : value.split("T")[0];
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* Extracts the time part (`HH:mm`) of a value, or an empty string when the
|
|
1079
|
+
* value has no time.
|
|
1080
|
+
*/
|
|
1081
|
+
function getTimePart(value, type) {
|
|
1082
|
+
if (type === "time") return value;
|
|
1083
|
+
const [, time = ""] = value.split("T");
|
|
1084
|
+
return time;
|
|
1085
|
+
}
|
|
1086
|
+
/**
|
|
1087
|
+
* Builds a value for the given type, or an empty string while any required
|
|
1088
|
+
* part is missing.
|
|
1089
|
+
*/
|
|
1090
|
+
function joinDateTime(type, date, time) {
|
|
1091
|
+
if (type === "date") return date;
|
|
1092
|
+
if (type === "time") return time;
|
|
1093
|
+
return date && time ? `${date}T${time}` : "";
|
|
1094
|
+
}
|
|
1095
|
+
/**
|
|
1096
|
+
* Formats a value to be displayed in pt-BR, like `24/09/2026`, `14:30` or
|
|
1097
|
+
* `24/09/2026 14:30`.
|
|
1098
|
+
*/
|
|
1099
|
+
function formatDateTime$1(value, type) {
|
|
1100
|
+
return [getDatePart(value, type).split("-").reverse().join("/"), getTimePart(value, type)].filter(Boolean).join(" ");
|
|
1101
|
+
}
|
|
1102
|
+
function useDateTimeFieldRules(props) {
|
|
1103
|
+
const defaultRules = useRules(props);
|
|
1104
|
+
return computed(() => {
|
|
1105
|
+
const rules = [...defaultRules.value];
|
|
1106
|
+
if (props.min) rules.push(minRule(props.min, props.type));
|
|
1107
|
+
if (props.max) rules.push(maxRule(props.max, props.type));
|
|
1108
|
+
return rules;
|
|
1109
|
+
});
|
|
1110
|
+
}
|
|
1111
|
+
/**
|
|
1112
|
+
* Computes the limits of each picker. For `datetime`, time limits only apply
|
|
1113
|
+
* when the selected date is the limit's own date.
|
|
1114
|
+
*/
|
|
1115
|
+
function useDateTimeFieldPickerBounds(props, selectedDate) {
|
|
1116
|
+
return computed(() => {
|
|
1117
|
+
const min = props.min ?? "";
|
|
1118
|
+
const max = props.max ?? "";
|
|
1119
|
+
const date = toValue(selectedDate);
|
|
1120
|
+
return {
|
|
1121
|
+
dateMin: getDatePart(min, props.type),
|
|
1122
|
+
dateMax: getDatePart(max, props.type),
|
|
1123
|
+
timeMin: getTimeBound(min, props.type, date),
|
|
1124
|
+
timeMax: getTimeBound(max, props.type, date)
|
|
1125
|
+
};
|
|
1126
|
+
});
|
|
1127
|
+
}
|
|
1128
|
+
function getTimeBound(bound, type, selectedDate) {
|
|
1129
|
+
if (type === "datetime" && getDatePart(bound, type) !== selectedDate) return "";
|
|
1130
|
+
return getTimePart(bound, type);
|
|
1131
|
+
}
|
|
1132
|
+
function minRule(min, type) {
|
|
1133
|
+
const message = `Valor anterior ao mínimo permitido (${formatDateTime$1(min, type)})`;
|
|
1134
|
+
return (value) => !value || value >= min || message;
|
|
1135
|
+
}
|
|
1136
|
+
function maxRule(max, type) {
|
|
1137
|
+
const message = `Valor posterior ao máximo permitido (${formatDateTime$1(max, type)})`;
|
|
1138
|
+
return (value) => !value || value <= max || message;
|
|
1139
|
+
}
|
|
1140
|
+
//#endregion
|
|
1141
|
+
//#region src/components/inputs/date-time-field/date-time-field.vue
|
|
1142
|
+
var date_time_field_default = /* @__PURE__ */ defineComponent({
|
|
1143
|
+
inheritAttrs: false,
|
|
1144
|
+
__name: "date-time-field",
|
|
1145
|
+
props: /*@__PURE__*/ mergeModels({
|
|
1146
|
+
variant: {
|
|
1147
|
+
type: String,
|
|
1148
|
+
required: false,
|
|
1149
|
+
default: "primary"
|
|
1150
|
+
},
|
|
1151
|
+
type: {
|
|
1152
|
+
type: String,
|
|
1153
|
+
required: false,
|
|
1154
|
+
default: "datetime"
|
|
1155
|
+
},
|
|
1156
|
+
min: {
|
|
1157
|
+
type: String,
|
|
1158
|
+
required: false
|
|
1159
|
+
},
|
|
1160
|
+
max: {
|
|
1161
|
+
type: String,
|
|
1162
|
+
required: false
|
|
1163
|
+
},
|
|
1164
|
+
disabled: {
|
|
1165
|
+
type: Boolean,
|
|
1166
|
+
required: false
|
|
1167
|
+
},
|
|
1168
|
+
loading: {
|
|
1169
|
+
type: Boolean,
|
|
1170
|
+
required: false
|
|
1171
|
+
},
|
|
1172
|
+
clearable: {
|
|
1173
|
+
type: Boolean,
|
|
1174
|
+
required: false
|
|
1175
|
+
},
|
|
1176
|
+
readonly: {
|
|
1177
|
+
type: Boolean,
|
|
1178
|
+
required: false
|
|
1179
|
+
},
|
|
1180
|
+
required: {
|
|
1181
|
+
type: Boolean,
|
|
1182
|
+
required: false
|
|
1183
|
+
},
|
|
1184
|
+
label: {
|
|
1185
|
+
type: String,
|
|
1186
|
+
required: false
|
|
1187
|
+
},
|
|
1188
|
+
placeholder: {
|
|
1189
|
+
type: String,
|
|
1190
|
+
required: false
|
|
1191
|
+
},
|
|
1192
|
+
hint: {
|
|
1193
|
+
type: String,
|
|
1194
|
+
required: false
|
|
1195
|
+
},
|
|
1196
|
+
dataTestid: {
|
|
1197
|
+
type: String,
|
|
1198
|
+
required: false
|
|
1199
|
+
}
|
|
1200
|
+
}, {
|
|
1201
|
+
"modelValue": {
|
|
1202
|
+
type: String,
|
|
1203
|
+
default: ""
|
|
1204
|
+
},
|
|
1205
|
+
"modelModifiers": {}
|
|
1206
|
+
}),
|
|
1207
|
+
emits: ["update:modelValue"],
|
|
1208
|
+
setup(__props) {
|
|
1209
|
+
const modelValue = useModel(__props, "modelValue");
|
|
1210
|
+
const props = __props;
|
|
1211
|
+
const messages = { "pt-BR": pt };
|
|
1212
|
+
const vuetifyVariant = useTextFieldVariant(() => props.variant);
|
|
1213
|
+
const rules = useDateTimeFieldRules(props);
|
|
1214
|
+
const displayValue = computed(() => formatDateTime$1(modelValue.value, props.type));
|
|
1215
|
+
const isClearable = computed(() => props.clearable && !props.readonly);
|
|
1216
|
+
const isMenuDisabled = computed(() => props.disabled || props.readonly);
|
|
1217
|
+
const isMenuOpen = ref(false);
|
|
1218
|
+
const draft = ref({});
|
|
1219
|
+
const draftDate = computed(() => draft.value.date ?? getDatePart(modelValue.value, props.type));
|
|
1220
|
+
const draftTime = computed(() => draft.value.time ?? getTimePart(modelValue.value, props.type));
|
|
1221
|
+
const draftValue = computed(() => joinDateTime(props.type, draftDate.value, draftTime.value));
|
|
1222
|
+
const bounds = useDateTimeFieldPickerBounds(props, draftDate);
|
|
1223
|
+
watch(isMenuOpen, () => {
|
|
1224
|
+
draft.value = {};
|
|
1225
|
+
});
|
|
1226
|
+
function onDateUpdate(date) {
|
|
1227
|
+
draft.value.date = formatDateTime(date, "YYYY-MM-DD");
|
|
1228
|
+
commitDraft();
|
|
1229
|
+
closeIfComplete();
|
|
1230
|
+
}
|
|
1231
|
+
function onTimeUpdate(time) {
|
|
1232
|
+
draft.value.time = time ?? "";
|
|
1233
|
+
commitDraft();
|
|
1234
|
+
}
|
|
1235
|
+
function commitDraft() {
|
|
1236
|
+
if (draftValue.value) modelValue.value = draftValue.value;
|
|
1237
|
+
}
|
|
1238
|
+
function closeIfComplete() {
|
|
1239
|
+
if (draftValue.value) isMenuOpen.value = false;
|
|
1240
|
+
}
|
|
1241
|
+
function clear() {
|
|
1242
|
+
modelValue.value = "";
|
|
1243
|
+
}
|
|
1244
|
+
return (_ctx, _cache) => {
|
|
1245
|
+
return openBlock(), createBlock(unref(VTextField), {
|
|
1246
|
+
"model-value": displayValue.value,
|
|
1247
|
+
"validation-value": modelValue.value,
|
|
1248
|
+
variant: unref(vuetifyVariant),
|
|
1249
|
+
rules: unref(rules),
|
|
1250
|
+
"data-testid": props.dataTestid,
|
|
1251
|
+
disabled: props.disabled,
|
|
1252
|
+
loading: props.loading,
|
|
1253
|
+
label: props.label,
|
|
1254
|
+
placeholder: props.placeholder,
|
|
1255
|
+
hint: props.hint,
|
|
1256
|
+
clearable: isClearable.value,
|
|
1257
|
+
readonly: "",
|
|
1258
|
+
"onClick:clear": clear
|
|
1259
|
+
}, {
|
|
1260
|
+
default: withCtx(() => [createVNode(unref(VMenu), {
|
|
1261
|
+
modelValue: isMenuOpen.value,
|
|
1262
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isMenuOpen.value = $event),
|
|
1263
|
+
activator: "parent",
|
|
1264
|
+
location: "bottom start",
|
|
1265
|
+
"min-width": "0",
|
|
1266
|
+
disabled: isMenuDisabled.value,
|
|
1267
|
+
"close-on-content-click": false
|
|
1268
|
+
}, {
|
|
1269
|
+
default: withCtx(() => [createVNode(unref(VCard), null, {
|
|
1270
|
+
default: withCtx(() => [createVNode(unref(VLocaleProvider), {
|
|
1271
|
+
locale: "pt-BR",
|
|
1272
|
+
messages,
|
|
1273
|
+
class: "d-flex flex-wrap"
|
|
1274
|
+
}, {
|
|
1275
|
+
default: withCtx(() => [props.type !== "time" ? (openBlock(), createBlock(unref(VDatePicker), {
|
|
1276
|
+
key: 0,
|
|
1277
|
+
"model-value": draftDate.value || null,
|
|
1278
|
+
min: unref(bounds).dateMin,
|
|
1279
|
+
max: unref(bounds).dateMax,
|
|
1280
|
+
"onUpdate:modelValue": onDateUpdate
|
|
1281
|
+
}, null, 8, [
|
|
1282
|
+
"model-value",
|
|
1283
|
+
"min",
|
|
1284
|
+
"max"
|
|
1285
|
+
])) : createCommentVNode("v-if", true), props.type !== "date" ? (openBlock(), createBlock(unref(VTimePicker), {
|
|
1286
|
+
key: 1,
|
|
1287
|
+
"model-value": draftTime.value,
|
|
1288
|
+
min: unref(bounds).timeMin,
|
|
1289
|
+
max: unref(bounds).timeMax,
|
|
1290
|
+
format: "24hr",
|
|
1291
|
+
"onUpdate:modelValue": onTimeUpdate,
|
|
1292
|
+
"onUpdate:minute": closeIfComplete
|
|
1293
|
+
}, null, 8, [
|
|
1294
|
+
"model-value",
|
|
1295
|
+
"min",
|
|
1296
|
+
"max"
|
|
1297
|
+
])) : createCommentVNode("v-if", true)]),
|
|
1298
|
+
_: 1
|
|
1299
|
+
})]),
|
|
1300
|
+
_: 1
|
|
1301
|
+
})]),
|
|
1302
|
+
_: 1
|
|
1303
|
+
}, 8, ["modelValue", "disabled"])]),
|
|
1304
|
+
_: 1
|
|
1305
|
+
}, 8, [
|
|
1306
|
+
"model-value",
|
|
1307
|
+
"validation-value",
|
|
1308
|
+
"variant",
|
|
1309
|
+
"rules",
|
|
1310
|
+
"data-testid",
|
|
1311
|
+
"disabled",
|
|
1312
|
+
"loading",
|
|
1313
|
+
"label",
|
|
1314
|
+
"placeholder",
|
|
1315
|
+
"hint",
|
|
1316
|
+
"clearable"
|
|
1317
|
+
]);
|
|
1318
|
+
};
|
|
1319
|
+
}
|
|
1320
|
+
});
|
|
1321
|
+
//#endregion
|
|
1025
1322
|
//#region src/components/grid/row/row.vue
|
|
1026
1323
|
var row_default = /* @__PURE__ */ defineComponent({
|
|
1027
1324
|
inheritAttrs: false,
|
|
@@ -1685,4 +1982,4 @@ var data_set_item_default = /* @__PURE__ */ defineComponent({
|
|
|
1685
1982
|
}
|
|
1686
1983
|
});
|
|
1687
1984
|
//#endregion
|
|
1688
|
-
export { autocomplete_field_default as UAutocompleteField, button_default as UButton, checkbox_default as UCheckbox, column_default as UColumn, container_default as UContainer, data_set_default as UDataSet, data_set_item_default as UDataSetItem, 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 };
|
|
1985
|
+
export { autocomplete_field_default as UAutocompleteField, button_default as UButton, checkbox_default as UCheckbox, column_default as UColumn, container_default as UContainer, data_set_default as UDataSet, data_set_item_default as UDataSetItem, date_time_field_default as UDateTimeField, 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 };
|