@nexdom/uimed-vue 2.0.0-beta.2 → 2.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -72,6 +72,18 @@ import { Root } from "@nexdom/uimed-vue/components";
72
72
 
73
73
  Never write CSS, classes or any kind of styling. Always use component props.
74
74
 
75
+ The library doesn't export prop types. Derive them with `ComponentProps` from `vue-component-type-helpers`:
76
+
77
+ ```ts
78
+ import type { ComponentProps } from "vue-component-type-helpers";
79
+ import { UMain, USection } from "@nexdom/uimed-vue/components";
80
+
81
+ type MainProps = ComponentProps<typeof UMain>;
82
+ type AppBar = NonNullable<MainProps["appBar"]>;
83
+ type NavigationMenu = NonNullable<MainProps["navigationMenu"]>;
84
+ type SectionAction = NonNullable<ComponentProps<typeof USection>["actions"]>[number];
85
+ ```
86
+
75
87
  Available entry points: `@nexdom/uimed-vue` (root), `@nexdom/uimed-vue/components`, `@nexdom/uimed-vue/composables`, `@nexdom/uimed-vue/plugins`, `@nexdom/uimed-vue/unit-test` (test helpers, e.g. `vueTestUtilsPluginUimed()` for mounting components with Vuetify in Vitest).
76
88
 
77
89
  Full component/composable reference lives in the [docs](https://nexdom-healthtech.github.io/uimed-vue/).
package/README.md CHANGED
@@ -50,7 +50,7 @@ plugins: [vue(), vitePluginUimed()];
50
50
  // ...
51
51
  ```
52
52
 
53
- Use Uimed inside the Vue app:
53
+ Use UIMed inside the Vue app:
54
54
 
55
55
  ```ts
56
56
  // main.js or main.ts
@@ -171,8 +171,8 @@ type MainProps = {
171
171
  *
172
172
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/main | Main Guide}
173
173
  */
174
- declare const _default$4: typeof __VLS_export$9;
175
- declare const __VLS_export$9: __VLS_WithSlots$7<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<MainProps & {
174
+ declare const _default$5: typeof __VLS_export$10;
175
+ declare const __VLS_export$10: __VLS_WithSlots$7<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<MainProps & {
176
176
  notificationsOpen?: boolean;
177
177
  }, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {
178
178
  "update:notificationsOpen": (value: boolean) => any;
@@ -248,8 +248,8 @@ type ButtonProps = {
248
248
  *
249
249
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/button | Button Guide}
250
250
  */
251
- declare const _default: typeof __VLS_export$8;
252
- declare const __VLS_export$8: __VLS_WithSlots$6<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<ButtonProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {} & {
251
+ declare const _default: typeof __VLS_export$9;
252
+ declare const __VLS_export$9: __VLS_WithSlots$6<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<ButtonProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {} & {
253
253
  click: (event: MouseEvent) => any;
254
254
  }, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<ButtonProps> & Readonly<{
255
255
  onClick?: ((event: MouseEvent) => any) | undefined;
@@ -339,8 +339,8 @@ type TextFieldProps = {
339
339
  *
340
340
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/text-field | TextField Guide}
341
341
  */
342
- declare const _default$9: typeof __VLS_export$7;
343
- declare const __VLS_export$7: import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<TextFieldProps & {
342
+ declare const _default$10: typeof __VLS_export$8;
343
+ declare const __VLS_export$8: import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<TextFieldProps & {
344
344
  modelValue?: string;
345
345
  }, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {
346
346
  "update:modelValue": (value: string) => any;
@@ -354,6 +354,72 @@ declare const __VLS_export$7: import("vue", { with: { "resolution-mode": "import
354
354
  clearable: boolean;
355
355
  }, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>;
356
356
  //#endregion
357
+ //#region src/components/inputs/checkbox/types.d.ts
358
+ /**
359
+ * Props exposed by the {@link Checkbox} component.
360
+ */
361
+ type CheckboxProps<T = boolean> = {
362
+ /**
363
+ * Field label.
364
+ */
365
+ label?: string;
366
+ /**
367
+ * Removes the ability to click or target the checkbox.
368
+ * @default false
369
+ */
370
+ disabled?: boolean;
371
+ /**
372
+ * Prevent value changes.
373
+ * @default false
374
+ */
375
+ readonly?: boolean;
376
+ /**
377
+ * Value applied to the model when the checkbox is checked.
378
+ * @default true
379
+ */
380
+ trueValue?: T;
381
+ /**
382
+ * Value applied to the model when the checkbox is unchecked.
383
+ * @default false
384
+ */
385
+ falseValue?: T;
386
+ /**
387
+ * Component id to use on automated tests.
388
+ */
389
+ dataTestid?: string;
390
+ };
391
+ //#endregion
392
+ //#region src/components/inputs/checkbox/checkbox.vue.d.ts
393
+ /**
394
+ * Checkbox component to be used throughout the application.
395
+ *
396
+ * @example
397
+ * ```vue
398
+ * <template>
399
+ * <u-checkbox label="Aceito os termos" />
400
+ * </template>
401
+ * ```
402
+ *
403
+ * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/checkbox | Checkbox Guide}
404
+ */
405
+ declare const _default$1: typeof __VLS_export$7;
406
+ declare const __VLS_export$7: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
407
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<(CheckboxProps<boolean | T> & {
408
+ modelValue?: T;
409
+ }) & {
410
+ "onUpdate:modelValue"?: ((value: T) => any) | undefined;
411
+ }> & (typeof globalThis extends {
412
+ __VLS_PROPS_FALLBACK: infer P;
413
+ } ? P : {});
414
+ expose: (exposed: {}) => void;
415
+ attrs: any;
416
+ slots: {};
417
+ emit: (event: "update:modelValue", value: T) => void;
418
+ }>) => import("vue").VNode & {
419
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
420
+ };
421
+ type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
422
+ //#endregion
357
423
  //#region src/components/grid/container/types.d.ts
358
424
  /**
359
425
  * Props exposed by the {@link Container} component.
@@ -380,7 +446,7 @@ type ContainerProps = {
380
446
  *
381
447
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/layout | Container Guide}
382
448
  */
383
- declare const _default$2: typeof __VLS_export$6;
449
+ declare const _default$3: typeof __VLS_export$6;
384
450
  declare const __VLS_export$6: __VLS_WithSlots$5<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<ContainerProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<ContainerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, {
385
451
  default?: (props: {}) => any;
386
452
  }>;
@@ -418,7 +484,7 @@ type RowProps = {
418
484
  *
419
485
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/layout | Row Guide}
420
486
  */
421
- declare const _default$5: typeof __VLS_export$5;
487
+ declare const _default$6: typeof __VLS_export$5;
422
488
  declare const __VLS_export$5: __VLS_WithSlots$4<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>, {
423
489
  default?: (props: {}) => any;
424
490
  }>;
@@ -467,7 +533,7 @@ type Cols = "auto" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10"
467
533
  *
468
534
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/layout | Column Guide}
469
535
  */
470
- declare const _default$1: typeof __VLS_export$4;
536
+ declare const _default$2: typeof __VLS_export$4;
471
537
  declare const __VLS_export$4: __VLS_WithSlots$3<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<ColumnProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<ColumnProps> & Readonly<{}>, {
472
538
  cols: "12" | "auto" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11";
473
539
  }, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, {
@@ -510,7 +576,7 @@ type FormProps = {
510
576
  *
511
577
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/form | Form Guide}
512
578
  */
513
- declare const _default$3: typeof __VLS_export$3;
579
+ declare const _default$4: typeof __VLS_export$3;
514
580
  declare const __VLS_export$3: __VLS_WithSlots$2<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<FormProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {} & {
515
581
  submit: (event: SubmitEvent) => any;
516
582
  }, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<FormProps> & Readonly<{
@@ -540,7 +606,7 @@ type __VLS_WithSlots$2<T, S> = T & {
540
606
  *
541
607
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/section | Section Guide}
542
608
  */
543
- declare const _default$7: typeof __VLS_export$2;
609
+ declare const _default$8: typeof __VLS_export$2;
544
610
  declare const __VLS_export$2: __VLS_WithSlots$1<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>, {
545
611
  default?: (props: {}) => any;
546
612
  }>;
@@ -626,7 +692,7 @@ interface SectionAction extends ButtonProps {
626
692
  *
627
693
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/section | Section Guide}
628
694
  */
629
- declare const _default$6: typeof __VLS_export$1;
695
+ declare const _default$7: typeof __VLS_export$1;
630
696
  declare const __VLS_export$1: __VLS_WithSlots<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>, {
631
697
  default?: (props: {}) => any;
632
698
  }>;
@@ -701,7 +767,7 @@ type TableProps = {
701
767
  *
702
768
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/table | Table Guide}
703
769
  */
704
- declare const _default$8: typeof __VLS_export;
770
+ declare const _default$9: typeof __VLS_export;
705
771
  declare const __VLS_export: 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>;
706
772
  //#endregion
707
- export { type AppBarProps as AppBarConfig, type AppBarUserProps as AppBarUserConfig, type NavigationMenuProps as NavigationMenuConfig, type SectionAction, type TableProps, _default as UButton, _default$1 as UColumn, _default$2 as UContainer, _default$3 as UForm, _default$4 as UMain, _default$5 as URow, _default$6 as USection, _default$7 as USectionContent, _default$8 as UTable, _default$9 as UTextField };
773
+ export { _default as UButton, _default$1 as UCheckbox, _default$2 as UColumn, _default$3 as UContainer, _default$4 as UForm, _default$5 as UMain, _default$6 as URow, _default$7 as USection, _default$8 as USectionContent, _default$9 as UTable, _default$10 as UTextField };
@@ -1,6 +1,6 @@
1
1
  import { r as useVuetifyColor, t as messages } from "./use-toast-CACuYhK_.js";
2
2
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, isRef, mergeModels, mergeProps, openBlock, ref, renderList, renderSlot, toDisplayString, toValue, unref, useModel, withCtx, withModifiers } from "vue";
3
- import { VApp, VAppBar, VAppBarNavIcon, VAppBarTitle, VAvatar, VBadge, VBtn, VCard, VCardActions, VCardText, VCol, VContainer, VDivider, VForm, VIcon, VIconBtn, VImg, VList, VListGroup, VListItem, VListItemAction, VListSubheader, VMain, VMenu, VNavigationDrawer, VRow, VSkeletonLoader, VSnackbarQueue, VTable, VTextField } from "vuetify/components";
3
+ import { VApp, VAppBar, VAppBarNavIcon, VAppBarTitle, VAvatar, VBadge, VBtn, VCard, VCardActions, VCardText, VCheckboxBtn, VCol, VContainer, VDivider, VForm, VIcon, VIconBtn, VImg, VList, VListGroup, VListItem, VListItemAction, VListSubheader, VMain, VMenu, VNavigationDrawer, VRow, VSkeletonLoader, VSnackbarQueue, VTable, VTextField } from "vuetify/components";
4
4
  import { formatDateTime, isEmail, isEmpty, isPhone, isUrl, toPeriodInterval } from "@nexdom/shared/utils";
5
5
  //#region src/composables/navigation/use-route-props.ts
6
6
  function useRouteProps(route) {
@@ -700,6 +700,75 @@ var button_default = /* @__PURE__ */ defineComponent({
700
700
  }
701
701
  });
702
702
  //#endregion
703
+ //#region src/components/inputs/checkbox/checkbox.vue
704
+ var checkbox_default = /* @__PURE__ */ defineComponent({
705
+ inheritAttrs: false,
706
+ __name: "checkbox",
707
+ props: /*@__PURE__*/ mergeModels({
708
+ label: {
709
+ type: String,
710
+ required: false
711
+ },
712
+ disabled: {
713
+ type: Boolean,
714
+ required: false
715
+ },
716
+ readonly: {
717
+ type: Boolean,
718
+ required: false
719
+ },
720
+ trueValue: {
721
+ type: Boolean,
722
+ required: false,
723
+ skipCheck: true,
724
+ default: true
725
+ },
726
+ falseValue: {
727
+ type: Boolean,
728
+ required: false,
729
+ skipCheck: true,
730
+ default: false
731
+ },
732
+ dataTestid: {
733
+ type: String,
734
+ required: false
735
+ }
736
+ }, {
737
+ "modelValue": {
738
+ type: null,
739
+ default: (props) => props.falseValue
740
+ },
741
+ "modelModifiers": {}
742
+ }),
743
+ emits: ["update:modelValue"],
744
+ setup(__props) {
745
+ const props = __props;
746
+ const modelValue = useModel(__props, "modelValue");
747
+ return (_ctx, _cache) => {
748
+ return openBlock(), createBlock(unref(VCheckboxBtn), {
749
+ modelValue: modelValue.value,
750
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
751
+ "true-value": props.trueValue,
752
+ "false-value": props.falseValue,
753
+ "data-testid": props.dataTestid,
754
+ disabled: props.disabled,
755
+ readonly: props.readonly,
756
+ label: props.label,
757
+ class: "flex-0-1",
758
+ "hide-details": ""
759
+ }, null, 8, [
760
+ "modelValue",
761
+ "true-value",
762
+ "false-value",
763
+ "data-testid",
764
+ "disabled",
765
+ "readonly",
766
+ "label"
767
+ ]);
768
+ };
769
+ }
770
+ });
771
+ //#endregion
703
772
  //#region src/components/grid/row/row.vue
704
773
  var row_default = /* @__PURE__ */ defineComponent({
705
774
  inheritAttrs: false,
@@ -987,4 +1056,4 @@ var table_default = /* @__PURE__ */ defineComponent({
987
1056
  }
988
1057
  });
989
1058
  //#endregion
990
- export { button_default as UButton, column_default as UColumn, container_default as UContainer, 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 };
1059
+ export { button_default as UButton, checkbox_default as UCheckbox, column_default as UColumn, container_default as UContainer, 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/dist/plugins.d.ts CHANGED
@@ -2,11 +2,11 @@ import vitePluginVuetify from "vite-plugin-vuetify";
2
2
  import { UserConfig } from "vite-plus";
3
3
  //#region src/plugins.d.ts
4
4
  /**
5
- * Vite plugin for Uimed.
5
+ * Vite plugin for UIMed.
6
6
  */
7
7
  declare function vitePluginUimed(): ReturnType<typeof vitePluginVuetify>;
8
8
  /**
9
- * Vitest Server plugin for Uimed.
9
+ * Vitest Server plugin for UIMed.
10
10
  */
11
11
  declare function vitestServerPluginUimed(): NonNullable<NonNullable<UserConfig["test"]>["server"]>;
12
12
  //#endregion
package/dist/plugins.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import vitePluginVuetify from "vite-plugin-vuetify";
2
2
  //#region src/plugins.ts
3
3
  /**
4
- * Vite plugin for Uimed.
4
+ * Vite plugin for UIMed.
5
5
  */
6
6
  function vitePluginUimed() {
7
7
  return vitePluginVuetify({ autoImport: false });
8
8
  }
9
9
  /**
10
- * Vitest Server plugin for Uimed.
10
+ * Vitest Server plugin for UIMed.
11
11
  */
12
12
  function vitestServerPluginUimed() {
13
13
  return { deps: { inline: ["vuetify"] } };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexdom/uimed-vue",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.4",
4
4
  "description": "A ui framework for NEXDOM applications.",
5
5
  "keywords": [
6
6
  "lib",
@@ -81,6 +81,7 @@
81
81
  "vitepress": "2.0.0-alpha.19",
82
82
  "vitepress-plugin-group-icons": "^1.7.6",
83
83
  "vue": "^3.5.40",
84
+ "vue-component-type-helpers": "^3.3.11",
84
85
  "vue-router": "^5.3.1",
85
86
  "vue-tsc": "^3.3.9",
86
87
  "vuetify": "^4.2.0"
@@ -93,6 +94,7 @@
93
94
  "vite-plugin-vuetify": "^2.1.3",
94
95
  "vite-plus": "^0.2.7",
95
96
  "vue": "^3.5.40",
97
+ "vue-component-type-helpers": "^3.3.11",
96
98
  "vue-router": "^5.3.1",
97
99
  "vuetify": "^4.2.0"
98
100
  },