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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -27,7 +27,7 @@ yarn add @nexdom/uimed-vue
27
27
  Add Vite config:
28
28
 
29
29
  ```ts
30
- // vite.config.js
30
+ // vite.config.ts
31
31
  import { vitePluginUimed } from "@nexdom/uimed-vue/plugins.ts";
32
32
 
33
33
  /// ...
@@ -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/dist/plugins.d.ts CHANGED
@@ -1,8 +1,13 @@
1
1
  import vitePluginVuetify from "vite-plugin-vuetify";
2
+ import { UserConfig } from "vite-plus";
2
3
  //#region src/plugins.d.ts
3
4
  /**
4
5
  * Vite plugin for Uimed.
5
6
  */
6
7
  declare function vitePluginUimed(): ReturnType<typeof vitePluginVuetify>;
8
+ /**
9
+ * Vitest Server plugin for Uimed.
10
+ */
11
+ declare function vitestServerPluginUimed(): NonNullable<NonNullable<UserConfig["test"]>["server"]>;
7
12
  //#endregion
8
- export { vitePluginUimed };
13
+ export { vitePluginUimed, vitestServerPluginUimed };
package/dist/plugins.js CHANGED
@@ -6,5 +6,11 @@ import vitePluginVuetify from "vite-plugin-vuetify";
6
6
  function vitePluginUimed() {
7
7
  return vitePluginVuetify({ autoImport: false });
8
8
  }
9
+ /**
10
+ * Vitest Server plugin for Uimed.
11
+ */
12
+ function vitestServerPluginUimed() {
13
+ return { deps: { inline: ["vuetify"] } };
14
+ }
9
15
  //#endregion
10
- export { vitePluginUimed };
16
+ export { vitePluginUimed, vitestServerPluginUimed };
@@ -0,0 +1,8 @@
1
+ import { createVuetify } from "vuetify";
2
+ //#region src/unit-test.d.ts
3
+ /**
4
+ * Vue Test Utils plugin for Uimed.
5
+ */
6
+ declare function vueTestUtilsPluginUimed(): ReturnType<typeof createVuetify>;
7
+ //#endregion
8
+ export { vueTestUtilsPluginUimed };
@@ -0,0 +1,23 @@
1
+ import { createVuetify } from "vuetify";
2
+ import * as components from "vuetify/components";
3
+ import * as directives from "vuetify/directives";
4
+ //#region \0rolldown/runtime.js
5
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
6
+ if (typeof require !== "undefined") return require.apply(this, arguments);
7
+ throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
8
+ });
9
+ //#endregion
10
+ //#region src/unit-test.ts
11
+ const vuetify = createVuetify({
12
+ components,
13
+ directives
14
+ });
15
+ /**
16
+ * Vue Test Utils plugin for Uimed.
17
+ */
18
+ function vueTestUtilsPluginUimed() {
19
+ global.ResizeObserver = __require("resize-observer-polyfill");
20
+ return vuetify;
21
+ }
22
+ //#endregion
23
+ export { vueTestUtilsPluginUimed };
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.1.0-beta.1",
4
4
  "description": "A ui framework for NEXDOM applications.",
5
5
  "keywords": [
6
6
  "lib",
@@ -28,6 +28,7 @@
28
28
  ".": "./dist/index.js",
29
29
  "./components": "./dist/components.js",
30
30
  "./plugins": "./dist/plugins.js",
31
+ "./unit-test": "./dist/unit-test.js",
31
32
  "./package.json": "./package.json"
32
33
  },
33
34
  "publishConfig": {
@@ -38,13 +39,15 @@
38
39
  "dev": "vp pack --watch",
39
40
  "test": "vp test",
40
41
  "test:mutations": "stryker run",
42
+ "test:e2e": "vpx playwright test",
41
43
  "check": "vp check",
42
44
  "prepublishOnly": "vpr build",
43
45
  "prepare": "vp config",
44
46
  "depcruise": "depcruise src --output-type err-long",
45
47
  "depcruise:graph": "depcruise src --output-type dot| dot -T svg > dependencygraph.svg",
46
48
  "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"
49
+ "docs:dev": "vitepress dev docs --host --port 4173 --strictPort",
50
+ "postinstall": "playwright install --with-deps chromium"
48
51
  },
49
52
  "devDependencies": {
50
53
  "@commitlint/cli": "^21.2.1",
@@ -79,7 +82,9 @@
79
82
  "peerDependencies": {
80
83
  "@fontsource/roboto": "^5.3.0",
81
84
  "@mdi/font": "^7.4.47",
85
+ "resize-observer-polyfill": "^1.5.1",
82
86
  "vite-plugin-vuetify": "^2.1.3",
87
+ "vite-plus": "^0.2.7",
83
88
  "vue": "^3.5.40",
84
89
  "vuetify": "^4.1.7"
85
90
  },