@nexdom/uimed-vue 1.0.0-beta.2 → 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.
- package/dist/components.d.ts +20 -5
- package/dist/components.js +48 -18
- package/package.json +7 -2
package/dist/components.d.ts
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
//#region src/components/root.
|
|
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<
|
|
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
|
}>;
|
package/dist/components.js
CHANGED
|
@@ -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),
|
|
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
|
});
|
|
@@ -27,10 +32,19 @@ const btnVariantToVuetifyVariant = {
|
|
|
27
32
|
ghost: "outlined"
|
|
28
33
|
};
|
|
29
34
|
/**
|
|
35
|
+
* Resolves a {@link BtnVariant} to its Vuetify `VBtn` `variant` value,
|
|
36
|
+
* defaulting to `primary`'s mapping when `variant` is `undefined` or not a
|
|
37
|
+
* key of {@link btnVariantToVuetifyVariant} (e.g. a value that bypassed
|
|
38
|
+
* {@link BtnVariant}'s type check at the call site).
|
|
39
|
+
*/
|
|
40
|
+
function resolveBtnVariant(variant) {
|
|
41
|
+
return btnVariantToVuetifyVariant[variant] ?? btnVariantToVuetifyVariant.primary;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
30
44
|
* Maps {@link BtnColor} to the underlying Vuetify `VBtn` `color` value.
|
|
31
45
|
* Vuetify types `color` as a bare `string` (it accepts any theme color or
|
|
32
46
|
* CSS color), so this only guarantees every {@link BtnColor} has a mapped
|
|
33
|
-
* value
|
|
47
|
+
* value, not that the value is itself a valid Vuetify theme color.
|
|
34
48
|
*/
|
|
35
49
|
const btnColorToVuetifyColor = {
|
|
36
50
|
primary: "primary",
|
|
@@ -40,6 +54,15 @@ const btnColorToVuetifyColor = {
|
|
|
40
54
|
caution: "warning",
|
|
41
55
|
danger: "error"
|
|
42
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* Resolves a {@link BtnColor} to its Vuetify `VBtn` `color` value,
|
|
59
|
+
* defaulting to `primary`'s mapping when `color` is `undefined` or not a key
|
|
60
|
+
* of {@link btnColorToVuetifyColor} (e.g. a value that bypassed
|
|
61
|
+
* {@link BtnColor}'s type check at the call site).
|
|
62
|
+
*/
|
|
63
|
+
function resolveBtnColor(color) {
|
|
64
|
+
return btnColorToVuetifyColor[color] ?? btnColorToVuetifyColor.primary;
|
|
65
|
+
}
|
|
43
66
|
//#endregion
|
|
44
67
|
//#region src/components/btn/btn.vue
|
|
45
68
|
var btn_default = /* @__PURE__ */ defineComponent({
|
|
@@ -48,36 +71,42 @@ var btn_default = /* @__PURE__ */ defineComponent({
|
|
|
48
71
|
props: {
|
|
49
72
|
variant: {
|
|
50
73
|
type: String,
|
|
51
|
-
required: false
|
|
52
|
-
default: "primary"
|
|
74
|
+
required: false
|
|
53
75
|
},
|
|
54
76
|
color: {
|
|
55
77
|
type: String,
|
|
56
|
-
required: false
|
|
57
|
-
default: "primary"
|
|
78
|
+
required: false
|
|
58
79
|
},
|
|
59
80
|
disabled: {
|
|
60
81
|
type: Boolean,
|
|
61
|
-
required: false
|
|
62
|
-
default: false
|
|
82
|
+
required: false
|
|
63
83
|
},
|
|
64
84
|
loading: {
|
|
65
85
|
type: Boolean,
|
|
66
|
-
required: false
|
|
67
|
-
|
|
86
|
+
required: false
|
|
87
|
+
},
|
|
88
|
+
dataTestid: {
|
|
89
|
+
type: String,
|
|
90
|
+
required: false
|
|
68
91
|
}
|
|
69
92
|
},
|
|
70
93
|
emits: ["click"],
|
|
71
94
|
setup(__props, { emit: __emit }) {
|
|
72
|
-
const
|
|
73
|
-
const
|
|
95
|
+
const props = __props;
|
|
96
|
+
const emit = __emit;
|
|
97
|
+
const vuetifyVariant = computed(() => resolveBtnVariant(props.variant));
|
|
98
|
+
const vuetifyColor = computed(() => resolveBtnColor(props.color));
|
|
99
|
+
function onClick(event) {
|
|
100
|
+
emit("click", event);
|
|
101
|
+
}
|
|
74
102
|
return (_ctx, _cache) => {
|
|
75
103
|
return openBlock(), createBlock(unref(VBtn), {
|
|
76
104
|
variant: vuetifyVariant.value,
|
|
77
105
|
color: vuetifyColor.value,
|
|
78
|
-
disabled:
|
|
79
|
-
loading:
|
|
80
|
-
|
|
106
|
+
disabled: props.disabled,
|
|
107
|
+
loading: props.loading,
|
|
108
|
+
"data-testid": props.dataTestid,
|
|
109
|
+
onClick
|
|
81
110
|
}, {
|
|
82
111
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
83
112
|
_: 3
|
|
@@ -85,7 +114,8 @@ var btn_default = /* @__PURE__ */ defineComponent({
|
|
|
85
114
|
"variant",
|
|
86
115
|
"color",
|
|
87
116
|
"disabled",
|
|
88
|
-
"loading"
|
|
117
|
+
"loading",
|
|
118
|
+
"data-testid"
|
|
89
119
|
]);
|
|
90
120
|
};
|
|
91
121
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexdom/uimed-vue",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "A ui framework for NEXDOM applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lib",
|
|
@@ -37,13 +37,16 @@
|
|
|
37
37
|
"build": "vp pack",
|
|
38
38
|
"dev": "vp pack --watch",
|
|
39
39
|
"test": "vp test",
|
|
40
|
+
"test:mutations": "stryker run",
|
|
41
|
+
"test:e2e": "vpx playwright test",
|
|
40
42
|
"check": "vp check",
|
|
41
43
|
"prepublishOnly": "vpr build",
|
|
42
44
|
"prepare": "vp config",
|
|
43
45
|
"depcruise": "depcruise src --output-type err-long",
|
|
44
46
|
"depcruise:graph": "depcruise src --output-type dot| dot -T svg > dependencygraph.svg",
|
|
45
47
|
"depcruise:graph:no-tests": "depcruise src --exclude \"__tests__\" --output-type dot | dot -T svg > dependencygraph.no-tests.svg",
|
|
46
|
-
"docs:dev": "vitepress dev docs --host --port
|
|
48
|
+
"docs:dev": "vitepress dev docs --host --port 4173 --strictPort",
|
|
49
|
+
"postinstall": "playwright install --with-deps chromium"
|
|
47
50
|
},
|
|
48
51
|
"devDependencies": {
|
|
49
52
|
"@commitlint/cli": "^21.2.1",
|
|
@@ -51,6 +54,8 @@
|
|
|
51
54
|
"@fontsource/roboto": "^5.3.0",
|
|
52
55
|
"@mdi/font": "^7.4.47",
|
|
53
56
|
"@playwright/test": "^1.62.1",
|
|
57
|
+
"@stryker-mutator/core": "^10.0.0",
|
|
58
|
+
"@stryker-mutator/vitest-runner": "^10.0.0",
|
|
54
59
|
"@types/node": "^26.1.2",
|
|
55
60
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
56
61
|
"@vitejs/plugin-vue": "^6.0.8",
|