@nexdom/uimed-vue 1.0.0-beta.3 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,20 @@
1
- //#region src/components/root.vue.d.ts
1
+ //#region src/components/root/types.d.ts
2
+ /**
3
+ * Props exposed by the {@link Root} component.
4
+ */
5
+ type RootProps = {
6
+ /**
7
+ * Component id to use on automated tests.
8
+ */
9
+ dataTestid?: string;
10
+ };
11
+ //#endregion
12
+ //#region src/components/root/root.vue.d.ts
2
13
  /**
3
14
  * Root component to be placed at the top of the component tree.
4
15
  */
5
16
  declare const _default$1: typeof __VLS_export$1;
6
- declare const __VLS_export$1: __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>, {
17
+ declare const __VLS_export$1: __VLS_WithSlots$1<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<RootProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<RootProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, {
7
18
  default?: (props: {}) => any;
8
19
  }>;
9
20
  type __VLS_WithSlots$1<T, S> = T & {
@@ -49,6 +60,10 @@ type BtnProps = {
49
60
  * @default false
50
61
  */
51
62
  loading?: boolean;
63
+ /**
64
+ * Component id to use on automated tests.
65
+ */
66
+ dataTestid?: string;
52
67
  };
53
68
  //#endregion
54
69
  //#region src/components/btn/btn.vue.d.ts
@@ -65,10 +80,10 @@ type BtnProps = {
65
80
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/btn | Guia do Btn}
66
81
  */
67
82
  declare const _default: typeof __VLS_export;
68
- declare const __VLS_export: __VLS_WithSlots<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<BtnProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {
69
- click: () => any;
83
+ declare const __VLS_export: __VLS_WithSlots<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<BtnProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {} & {
84
+ click: (event: MouseEvent) => any;
70
85
  }, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<BtnProps> & Readonly<{
71
- onClick?: (() => any) | undefined;
86
+ onClick?: ((event: MouseEvent) => any) | undefined;
72
87
  }>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, {
73
88
  default?: (props: {}) => any;
74
89
  }>;
@@ -1,16 +1,21 @@
1
1
  import { computed, createBlock, defineComponent, openBlock, renderSlot, unref, withCtx } from "vue";
2
2
  import { VApp, VBtn } from "vuetify/components";
3
3
  //#endregion
4
- //#region src/components/root.vue
4
+ //#region src/components/root/root.vue
5
5
  var root_default = /* @__PURE__ */ defineComponent({
6
6
  inheritAttrs: false,
7
7
  __name: "root",
8
+ props: { dataTestid: {
9
+ type: String,
10
+ required: false
11
+ } },
8
12
  setup(__props) {
13
+ const props = __props;
9
14
  return (_ctx, _cache) => {
10
- return openBlock(), createBlock(unref(VApp), null, {
15
+ return openBlock(), createBlock(unref(VApp), { "data-testid": props.dataTestid }, {
11
16
  default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
12
17
  _: 3
13
- });
18
+ }, 8, ["data-testid"]);
14
19
  };
15
20
  }
16
21
  });
@@ -79,20 +84,29 @@ var btn_default = /* @__PURE__ */ defineComponent({
79
84
  loading: {
80
85
  type: Boolean,
81
86
  required: false
87
+ },
88
+ dataTestid: {
89
+ type: String,
90
+ required: false
82
91
  }
83
92
  },
84
93
  emits: ["click"],
85
94
  setup(__props, { emit: __emit }) {
86
95
  const props = __props;
96
+ const emit = __emit;
87
97
  const vuetifyVariant = computed(() => resolveBtnVariant(props.variant));
88
98
  const vuetifyColor = computed(() => resolveBtnColor(props.color));
99
+ function onClick(event) {
100
+ emit("click", event);
101
+ }
89
102
  return (_ctx, _cache) => {
90
103
  return openBlock(), createBlock(unref(VBtn), {
91
104
  variant: vuetifyVariant.value,
92
105
  color: vuetifyColor.value,
93
106
  disabled: props.disabled,
94
107
  loading: props.loading,
95
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
108
+ "data-testid": props.dataTestid,
109
+ onClick
96
110
  }, {
97
111
  default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
98
112
  _: 3
@@ -100,7 +114,8 @@ var btn_default = /* @__PURE__ */ defineComponent({
100
114
  "variant",
101
115
  "color",
102
116
  "disabled",
103
- "loading"
117
+ "loading",
118
+ "data-testid"
104
119
  ]);
105
120
  };
106
121
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexdom/uimed-vue",
3
- "version": "1.0.0-beta.3",
3
+ "version": "1.0.0",
4
4
  "description": "A ui framework for NEXDOM applications.",
5
5
  "keywords": [
6
6
  "lib",
@@ -38,13 +38,15 @@
38
38
  "dev": "vp pack --watch",
39
39
  "test": "vp test",
40
40
  "test:mutations": "stryker run",
41
+ "test:e2e": "vpx playwright test",
41
42
  "check": "vp check",
42
43
  "prepublishOnly": "vpr build",
43
44
  "prepare": "vp config",
44
45
  "depcruise": "depcruise src --output-type err-long",
45
46
  "depcruise:graph": "depcruise src --output-type dot| dot -T svg > dependencygraph.svg",
46
47
  "depcruise:graph:no-tests": "depcruise src --exclude \"__tests__\" --output-type dot | dot -T svg > dependencygraph.no-tests.svg",
47
- "docs:dev": "vitepress dev docs --host --port 5173 --strictPort"
48
+ "docs:dev": "vitepress dev docs --host --port 4173 --strictPort",
49
+ "postinstall": "playwright install --with-deps chromium"
48
50
  },
49
51
  "devDependencies": {
50
52
  "@commitlint/cli": "^21.2.1",