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

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.
Files changed (2) hide show
  1. package/dist/components.js +28 -13
  2. package/package.json +4 -1
@@ -27,10 +27,19 @@ const btnVariantToVuetifyVariant = {
27
27
  ghost: "outlined"
28
28
  };
29
29
  /**
30
+ * Resolves a {@link BtnVariant} to its Vuetify `VBtn` `variant` value,
31
+ * defaulting to `primary`'s mapping when `variant` is `undefined` or not a
32
+ * key of {@link btnVariantToVuetifyVariant} (e.g. a value that bypassed
33
+ * {@link BtnVariant}'s type check at the call site).
34
+ */
35
+ function resolveBtnVariant(variant) {
36
+ return btnVariantToVuetifyVariant[variant] ?? btnVariantToVuetifyVariant.primary;
37
+ }
38
+ /**
30
39
  * Maps {@link BtnColor} to the underlying Vuetify `VBtn` `color` value.
31
40
  * Vuetify types `color` as a bare `string` (it accepts any theme color or
32
41
  * CSS color), so this only guarantees every {@link BtnColor} has a mapped
33
- * value — not that the value is itself a valid Vuetify theme color.
42
+ * value, not that the value is itself a valid Vuetify theme color.
34
43
  */
35
44
  const btnColorToVuetifyColor = {
36
45
  primary: "primary",
@@ -40,6 +49,15 @@ const btnColorToVuetifyColor = {
40
49
  caution: "warning",
41
50
  danger: "error"
42
51
  };
52
+ /**
53
+ * Resolves a {@link BtnColor} to its Vuetify `VBtn` `color` value,
54
+ * defaulting to `primary`'s mapping when `color` is `undefined` or not a key
55
+ * of {@link btnColorToVuetifyColor} (e.g. a value that bypassed
56
+ * {@link BtnColor}'s type check at the call site).
57
+ */
58
+ function resolveBtnColor(color) {
59
+ return btnColorToVuetifyColor[color] ?? btnColorToVuetifyColor.primary;
60
+ }
43
61
  //#endregion
44
62
  //#region src/components/btn/btn.vue
45
63
  var btn_default = /* @__PURE__ */ defineComponent({
@@ -48,35 +66,32 @@ var btn_default = /* @__PURE__ */ defineComponent({
48
66
  props: {
49
67
  variant: {
50
68
  type: String,
51
- required: false,
52
- default: "primary"
69
+ required: false
53
70
  },
54
71
  color: {
55
72
  type: String,
56
- required: false,
57
- default: "primary"
73
+ required: false
58
74
  },
59
75
  disabled: {
60
76
  type: Boolean,
61
- required: false,
62
- default: false
77
+ required: false
63
78
  },
64
79
  loading: {
65
80
  type: Boolean,
66
- required: false,
67
- default: false
81
+ required: false
68
82
  }
69
83
  },
70
84
  emits: ["click"],
71
85
  setup(__props, { emit: __emit }) {
72
- const vuetifyVariant = computed(() => btnVariantToVuetifyVariant[__props.variant]);
73
- const vuetifyColor = computed(() => btnColorToVuetifyColor[__props.color]);
86
+ const props = __props;
87
+ const vuetifyVariant = computed(() => resolveBtnVariant(props.variant));
88
+ const vuetifyColor = computed(() => resolveBtnColor(props.color));
74
89
  return (_ctx, _cache) => {
75
90
  return openBlock(), createBlock(unref(VBtn), {
76
91
  variant: vuetifyVariant.value,
77
92
  color: vuetifyColor.value,
78
- disabled: __props.disabled,
79
- loading: __props.loading,
93
+ disabled: props.disabled,
94
+ loading: props.loading,
80
95
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
81
96
  }, {
82
97
  default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexdom/uimed-vue",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.3",
4
4
  "description": "A ui framework for NEXDOM applications.",
5
5
  "keywords": [
6
6
  "lib",
@@ -37,6 +37,7 @@
37
37
  "build": "vp pack",
38
38
  "dev": "vp pack --watch",
39
39
  "test": "vp test",
40
+ "test:mutations": "stryker run",
40
41
  "check": "vp check",
41
42
  "prepublishOnly": "vpr build",
42
43
  "prepare": "vp config",
@@ -51,6 +52,8 @@
51
52
  "@fontsource/roboto": "^5.3.0",
52
53
  "@mdi/font": "^7.4.47",
53
54
  "@playwright/test": "^1.62.1",
55
+ "@stryker-mutator/core": "^10.0.0",
56
+ "@stryker-mutator/vitest-runner": "^10.0.0",
54
57
  "@types/node": "^26.1.2",
55
58
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
56
59
  "@vitejs/plugin-vue": "^6.0.8",