@nexdom/uimed-vue 2.0.0-beta.12 → 2.0.0-beta.13

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.
@@ -172,8 +172,8 @@ type MainProps = {
172
172
  *
173
173
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/main | Main Guide}
174
174
  */
175
- declare const _default$9: typeof __VLS_export$14;
176
- declare const __VLS_export$14: __VLS_WithSlots$9<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<MainProps & {
175
+ declare const _default$10: typeof __VLS_export$15;
176
+ declare const __VLS_export$15: __VLS_WithSlots$9<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<MainProps & {
177
177
  notificationsOpen?: boolean;
178
178
  }, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {
179
179
  "update:notificationsOpen": (value: boolean) => any;
@@ -205,8 +205,8 @@ type __VLS_WithSlots$9<T, S> = T & {
205
205
  *
206
206
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/button | Button Guide}
207
207
  */
208
- declare const _default$1: typeof __VLS_export$13;
209
- declare const __VLS_export$13: __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, {} & {
208
+ declare const _default$1: typeof __VLS_export$14;
209
+ 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
210
  click: (event: MouseEvent) => any;
211
211
  }, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<ButtonProps> & Readonly<{
212
212
  onClick?: ((event: MouseEvent) => any) | undefined;
@@ -377,8 +377,8 @@ type AutocompleteFieldProps<T = string, Multiple extends boolean = false> = {
377
377
  *
378
378
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/autocomplete-field | AutocompleteField Guide}
379
379
  */
380
- declare const _default: typeof __VLS_export$12;
381
- declare const __VLS_export$12: <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<{
380
+ declare const _default: typeof __VLS_export$13;
381
+ 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
382
  props: import("vue").PublicProps & __VLS_PrettifyLocal$2<(AutocompleteFieldProps<T, Multiple> & {
383
383
  modelValue?: Multiple extends true ? T[] : T;
384
384
  }) & {
@@ -408,8 +408,8 @@ type __VLS_PrettifyLocal$2<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [
408
408
  *
409
409
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/text-field | TextField Guide}
410
410
  */
411
- declare const _default$14: typeof __VLS_export$11;
412
- declare const __VLS_export$11: import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<TextFieldProps & {
411
+ declare const _default$15: typeof __VLS_export$12;
412
+ declare const __VLS_export$12: import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<TextFieldProps & {
413
413
  modelValue?: string;
414
414
  }, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {
415
415
  "update:modelValue": (value: string) => any;
@@ -471,8 +471,8 @@ type CheckboxProps<T = boolean> = {
471
471
  *
472
472
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/checkbox | Checkbox Guide}
473
473
  */
474
- declare const _default$2: typeof __VLS_export$10;
475
- declare const __VLS_export$10: <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<{
474
+ declare const _default$2: typeof __VLS_export$11;
475
+ 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
476
  props: import("vue").PublicProps & __VLS_PrettifyLocal$1<(CheckboxProps<boolean | T> & {
477
477
  modelValue?: T;
478
478
  }) & {
@@ -489,6 +489,117 @@ declare const __VLS_export$10: <T = any>(__VLS_props: NonNullable<Awaited<typeof
489
489
  };
490
490
  type __VLS_PrettifyLocal$1<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
491
491
  //#endregion
492
+ //#region src/components/inputs/date-time-field/types.d.ts
493
+ type DateTimeFieldVariant = TextFieldVariant;
494
+ type DateTimeFieldType = "date" | "time" | "datetime";
495
+ /**
496
+ * Props exposed by the {@link DateTimeField} component.
497
+ */
498
+ type DateTimeFieldProps = {
499
+ /**
500
+ * Applies a distinct style variation to the field.
501
+ * One of `primary` or `secondary`.
502
+ * @default "primary"
503
+ */
504
+ variant?: DateTimeFieldVariant;
505
+ /**
506
+ * Defines which pickers are available and the format of the value.
507
+ *
508
+ * - `date`: value formatted as `YYYY-MM-DD` (e.g. `2026-09-24`);
509
+ * - `time`: value formatted as `HH:mm`, 24h (e.g. `14:30`);
510
+ * - `datetime`: value formatted as `YYYY-MM-DDTHH:mm` (e.g. `2026-09-24T14:30`).
511
+ * @default "datetime"
512
+ */
513
+ type?: DateTimeFieldType;
514
+ /**
515
+ * Minimum allowed value, in the same format as the value for the current `type`.
516
+ *
517
+ * Earlier options can't be picked, and an earlier value shows an error message.
518
+ * For `datetime`, the time limit only applies to the minimum's own date.
519
+ */
520
+ min?: string;
521
+ /**
522
+ * Maximum allowed value, in the same format as the value for the current `type`.
523
+ *
524
+ * Later options can't be picked, and a later value shows an error message.
525
+ * For `datetime`, the time limit only applies to the maximum's own date.
526
+ */
527
+ max?: string;
528
+ /**
529
+ * Removes the ability to click or target the field.
530
+ * @default false
531
+ */
532
+ disabled?: boolean;
533
+ /**
534
+ * Displays a loading indicator on the input.
535
+ * @default false
536
+ */
537
+ loading?: boolean;
538
+ /**
539
+ * Displays clear action, which is hidden while the field is `readonly`.
540
+ * @default false
541
+ */
542
+ clearable?: boolean;
543
+ /**
544
+ * Prevent value changes. The pickers won't open.
545
+ * @default false
546
+ */
547
+ readonly?: boolean;
548
+ /**
549
+ * Add `rules` to require field to be filled before form submission.
550
+ * @default false
551
+ */
552
+ required?: boolean;
553
+ /**
554
+ * Field label.
555
+ */
556
+ label?: string;
557
+ /**
558
+ * Field placeholder.
559
+ */
560
+ placeholder?: string;
561
+ /**
562
+ * Field message to show and direct user to fill field correctly.
563
+ *
564
+ * This message will be replaced when there's an error message to be shown.
565
+ */
566
+ hint?: string;
567
+ /**
568
+ * Component id to use on automated tests.
569
+ */
570
+ dataTestid?: string;
571
+ };
572
+ //#endregion
573
+ //#region src/components/inputs/date-time-field/date-time-field.vue.d.ts
574
+ /**
575
+ * Date and/or time field component to be used throughout the application.
576
+ *
577
+ * Its value uses the native input formats: `YYYY-MM-DD` for `date`, `HH:mm`
578
+ * for `time` and `YYYY-MM-DDTHH:mm` for `datetime`.
579
+ *
580
+ * @example
581
+ * ```vue
582
+ * <template>
583
+ * <u-date-time-field v-model="birthDate" label="Data de nascimento" type="date" />
584
+ * <template>
585
+ * ```
586
+ *
587
+ * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/date-time-field | DateTimeField Guide}
588
+ */
589
+ declare const _default$7: typeof __VLS_export$10;
590
+ declare const __VLS_export$10: import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<DateTimeFieldProps & {
591
+ modelValue?: string;
592
+ }, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {
593
+ "update:modelValue": (value: string) => any;
594
+ }, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<DateTimeFieldProps & {
595
+ modelValue?: string;
596
+ }> & Readonly<{
597
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
598
+ }>, {
599
+ variant: DateTimeFieldVariant;
600
+ type: DateTimeFieldType;
601
+ }, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>;
602
+ //#endregion
492
603
  //#region src/components/grid/container/types.d.ts
493
604
  /**
494
605
  * Props exposed by the {@link Container} component.
@@ -561,7 +672,7 @@ type RowProps = {
561
672
  *
562
673
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/layout | Row Guide}
563
674
  */
564
- declare const _default$10: typeof __VLS_export$8;
675
+ declare const _default$11: typeof __VLS_export$8;
565
676
  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
677
  default?: (props: {}) => any;
567
678
  }>;
@@ -660,7 +771,7 @@ type FormProps = {
660
771
  *
661
772
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/form | Form Guide}
662
773
  */
663
- declare const _default$8: typeof __VLS_export$6;
774
+ declare const _default$9: typeof __VLS_export$6;
664
775
  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
776
  submit: (event: SubmitEvent) => any;
666
777
  }, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<FormProps> & Readonly<{
@@ -690,7 +801,7 @@ type __VLS_WithSlots$4<T, S> = T & {
690
801
  *
691
802
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/section | Section Guide}
692
803
  */
693
- declare const _default$12: typeof __VLS_export$5;
804
+ declare const _default$13: typeof __VLS_export$5;
694
805
  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
806
  default?: (props: {}) => any;
696
807
  }>;
@@ -776,7 +887,7 @@ interface SectionAction extends ButtonProps {
776
887
  *
777
888
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/section | Section Guide}
778
889
  */
779
- declare const _default$11: typeof __VLS_export$4;
890
+ declare const _default$12: typeof __VLS_export$4;
780
891
  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
892
  default?: (props: {}) => any;
782
893
  }>;
@@ -851,7 +962,7 @@ type TableProps = {
851
962
  *
852
963
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/table | Table Guide}
853
964
  */
854
- declare const _default$13: typeof __VLS_export$3;
965
+ declare const _default$14: typeof __VLS_export$3;
855
966
  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
967
  //#endregion
857
968
  //#region src/components/details/types.d.ts
@@ -899,7 +1010,7 @@ type DetailsProps = {
899
1010
  *
900
1011
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/details | Details Guide}
901
1012
  */
902
- declare const _default$7: typeof __VLS_export$2;
1013
+ declare const _default$8: typeof __VLS_export$2;
903
1014
  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
1015
  default?: (props: {}) => any;
905
1016
  }>;
@@ -1088,4 +1199,4 @@ type __VLS_WithSlots<T, S> = T & {
1088
1199
  };
1089
1200
  };
1090
1201
  //#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 UDetails, _default$8 as UForm, _default$9 as UMain, _default$10 as URow, _default$11 as USection, _default$12 as USectionContent, _default$13 as UTable, _default$14 as UTextField };
1202
+ 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 };
@@ -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));
@@ -1022,6 +1023,259 @@ var checkbox_default = /* @__PURE__ */ defineComponent({
1022
1023
  }
1023
1024
  });
1024
1025
  //#endregion
1026
+ //#region src/composables/inputs/date-time-field.ts
1027
+ /**
1028
+ * Extracts the date part (`YYYY-MM-DD`) of a value, or an empty string when
1029
+ * the type has no date.
1030
+ */
1031
+ function getDatePart(value, type) {
1032
+ return type === "time" ? "" : value.split("T")[0];
1033
+ }
1034
+ /**
1035
+ * Extracts the time part (`HH:mm`) of a value, or an empty string when the
1036
+ * value has no time.
1037
+ */
1038
+ function getTimePart(value, type) {
1039
+ if (type === "time") return value;
1040
+ const [, time = ""] = value.split("T");
1041
+ return time;
1042
+ }
1043
+ /**
1044
+ * Builds a value for the given type, or an empty string while any required
1045
+ * part is missing.
1046
+ */
1047
+ function joinDateTime(type, date, time) {
1048
+ if (type === "date") return date;
1049
+ if (type === "time") return time;
1050
+ return date && time ? `${date}T${time}` : "";
1051
+ }
1052
+ /**
1053
+ * Formats a value to be displayed in pt-BR, like `24/09/2026`, `14:30` or
1054
+ * `24/09/2026 14:30`.
1055
+ */
1056
+ function formatDateTime$1(value, type) {
1057
+ return [getDatePart(value, type).split("-").reverse().join("/"), getTimePart(value, type)].filter(Boolean).join(" ");
1058
+ }
1059
+ function useDateTimeFieldRules(props) {
1060
+ const defaultRules = useRules(props);
1061
+ return computed(() => {
1062
+ const rules = [...defaultRules.value];
1063
+ if (props.min) rules.push(minRule(props.min, props.type));
1064
+ if (props.max) rules.push(maxRule(props.max, props.type));
1065
+ return rules;
1066
+ });
1067
+ }
1068
+ /**
1069
+ * Computes the limits of each picker. For `datetime`, time limits only apply
1070
+ * when the selected date is the limit's own date.
1071
+ */
1072
+ function useDateTimeFieldPickerBounds(props, selectedDate) {
1073
+ return computed(() => {
1074
+ const min = props.min ?? "";
1075
+ const max = props.max ?? "";
1076
+ const date = toValue(selectedDate);
1077
+ return {
1078
+ dateMin: getDatePart(min, props.type),
1079
+ dateMax: getDatePart(max, props.type),
1080
+ timeMin: getTimeBound(min, props.type, date),
1081
+ timeMax: getTimeBound(max, props.type, date)
1082
+ };
1083
+ });
1084
+ }
1085
+ function getTimeBound(bound, type, selectedDate) {
1086
+ if (type === "datetime" && getDatePart(bound, type) !== selectedDate) return "";
1087
+ return getTimePart(bound, type);
1088
+ }
1089
+ function minRule(min, type) {
1090
+ const message = `Valor anterior ao mínimo permitido (${formatDateTime$1(min, type)})`;
1091
+ return (value) => !value || value >= min || message;
1092
+ }
1093
+ function maxRule(max, type) {
1094
+ const message = `Valor posterior ao máximo permitido (${formatDateTime$1(max, type)})`;
1095
+ return (value) => !value || value <= max || message;
1096
+ }
1097
+ //#endregion
1098
+ //#region src/components/inputs/date-time-field/date-time-field.vue
1099
+ var date_time_field_default = /* @__PURE__ */ defineComponent({
1100
+ inheritAttrs: false,
1101
+ __name: "date-time-field",
1102
+ props: /*@__PURE__*/ mergeModels({
1103
+ variant: {
1104
+ type: String,
1105
+ required: false,
1106
+ default: "primary"
1107
+ },
1108
+ type: {
1109
+ type: String,
1110
+ required: false,
1111
+ default: "datetime"
1112
+ },
1113
+ min: {
1114
+ type: String,
1115
+ required: false
1116
+ },
1117
+ max: {
1118
+ type: String,
1119
+ required: false
1120
+ },
1121
+ disabled: {
1122
+ type: Boolean,
1123
+ required: false
1124
+ },
1125
+ loading: {
1126
+ type: Boolean,
1127
+ required: false
1128
+ },
1129
+ clearable: {
1130
+ type: Boolean,
1131
+ required: false
1132
+ },
1133
+ readonly: {
1134
+ type: Boolean,
1135
+ required: false
1136
+ },
1137
+ required: {
1138
+ type: Boolean,
1139
+ required: false
1140
+ },
1141
+ label: {
1142
+ type: String,
1143
+ required: false
1144
+ },
1145
+ placeholder: {
1146
+ type: String,
1147
+ required: false
1148
+ },
1149
+ hint: {
1150
+ type: String,
1151
+ required: false
1152
+ },
1153
+ dataTestid: {
1154
+ type: String,
1155
+ required: false
1156
+ }
1157
+ }, {
1158
+ "modelValue": {
1159
+ type: String,
1160
+ default: ""
1161
+ },
1162
+ "modelModifiers": {}
1163
+ }),
1164
+ emits: ["update:modelValue"],
1165
+ setup(__props) {
1166
+ const modelValue = useModel(__props, "modelValue");
1167
+ const props = __props;
1168
+ const messages = { "pt-BR": pt };
1169
+ const vuetifyVariant = useTextFieldVariant(() => props.variant);
1170
+ const rules = useDateTimeFieldRules(props);
1171
+ const displayValue = computed(() => formatDateTime$1(modelValue.value, props.type));
1172
+ const isClearable = computed(() => props.clearable && !props.readonly);
1173
+ const isMenuDisabled = computed(() => props.disabled || props.readonly);
1174
+ const isMenuOpen = ref(false);
1175
+ const draft = ref({});
1176
+ const draftDate = computed(() => draft.value.date ?? getDatePart(modelValue.value, props.type));
1177
+ const draftTime = computed(() => draft.value.time ?? getTimePart(modelValue.value, props.type));
1178
+ const draftValue = computed(() => joinDateTime(props.type, draftDate.value, draftTime.value));
1179
+ const bounds = useDateTimeFieldPickerBounds(props, draftDate);
1180
+ watch(isMenuOpen, () => {
1181
+ draft.value = {};
1182
+ });
1183
+ function onDateUpdate(date) {
1184
+ draft.value.date = formatDateTime(date, "YYYY-MM-DD");
1185
+ commitDraft();
1186
+ closeIfComplete();
1187
+ }
1188
+ function onTimeUpdate(time) {
1189
+ draft.value.time = time ?? "";
1190
+ commitDraft();
1191
+ }
1192
+ function commitDraft() {
1193
+ if (draftValue.value) modelValue.value = draftValue.value;
1194
+ }
1195
+ function closeIfComplete() {
1196
+ if (draftValue.value) isMenuOpen.value = false;
1197
+ }
1198
+ function clear() {
1199
+ modelValue.value = "";
1200
+ }
1201
+ return (_ctx, _cache) => {
1202
+ return openBlock(), createBlock(unref(VTextField), {
1203
+ "model-value": displayValue.value,
1204
+ "validation-value": modelValue.value,
1205
+ variant: unref(vuetifyVariant),
1206
+ rules: unref(rules),
1207
+ "data-testid": props.dataTestid,
1208
+ disabled: props.disabled,
1209
+ loading: props.loading,
1210
+ label: props.label,
1211
+ placeholder: props.placeholder,
1212
+ hint: props.hint,
1213
+ clearable: isClearable.value,
1214
+ readonly: "",
1215
+ "onClick:clear": clear
1216
+ }, {
1217
+ default: withCtx(() => [createVNode(unref(VMenu), {
1218
+ modelValue: isMenuOpen.value,
1219
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isMenuOpen.value = $event),
1220
+ activator: "parent",
1221
+ location: "bottom start",
1222
+ "min-width": "0",
1223
+ disabled: isMenuDisabled.value,
1224
+ "close-on-content-click": false
1225
+ }, {
1226
+ default: withCtx(() => [createVNode(unref(VCard), null, {
1227
+ default: withCtx(() => [createVNode(unref(VLocaleProvider), {
1228
+ locale: "pt-BR",
1229
+ messages,
1230
+ class: "d-flex flex-wrap"
1231
+ }, {
1232
+ default: withCtx(() => [props.type !== "time" ? (openBlock(), createBlock(unref(VDatePicker), {
1233
+ key: 0,
1234
+ "model-value": draftDate.value || null,
1235
+ min: unref(bounds).dateMin,
1236
+ max: unref(bounds).dateMax,
1237
+ "onUpdate:modelValue": onDateUpdate
1238
+ }, null, 8, [
1239
+ "model-value",
1240
+ "min",
1241
+ "max"
1242
+ ])) : createCommentVNode("v-if", true), props.type !== "date" ? (openBlock(), createBlock(unref(VTimePicker), {
1243
+ key: 1,
1244
+ "model-value": draftTime.value,
1245
+ min: unref(bounds).timeMin,
1246
+ max: unref(bounds).timeMax,
1247
+ format: "24hr",
1248
+ "onUpdate:modelValue": onTimeUpdate,
1249
+ "onUpdate:minute": closeIfComplete
1250
+ }, null, 8, [
1251
+ "model-value",
1252
+ "min",
1253
+ "max"
1254
+ ])) : createCommentVNode("v-if", true)]),
1255
+ _: 1
1256
+ })]),
1257
+ _: 1
1258
+ })]),
1259
+ _: 1
1260
+ }, 8, ["modelValue", "disabled"])]),
1261
+ _: 1
1262
+ }, 8, [
1263
+ "model-value",
1264
+ "validation-value",
1265
+ "variant",
1266
+ "rules",
1267
+ "data-testid",
1268
+ "disabled",
1269
+ "loading",
1270
+ "label",
1271
+ "placeholder",
1272
+ "hint",
1273
+ "clearable"
1274
+ ]);
1275
+ };
1276
+ }
1277
+ });
1278
+ //#endregion
1025
1279
  //#region src/components/grid/row/row.vue
1026
1280
  var row_default = /* @__PURE__ */ defineComponent({
1027
1281
  inheritAttrs: false,
@@ -1685,4 +1939,4 @@ var data_set_item_default = /* @__PURE__ */ defineComponent({
1685
1939
  }
1686
1940
  });
1687
1941
  //#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 };
1942
+ 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexdom/uimed-vue",
3
- "version": "2.0.0-beta.12",
3
+ "version": "2.0.0-beta.13",
4
4
  "description": "A ui framework for NEXDOM applications.",
5
5
  "keywords": [
6
6
  "lib",