@kiva/kv-components 3.102.0 → 3.102.2

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/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.102.2](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.102.1...@kiva/kv-components@3.102.2) (2024-09-26)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * change how model value is handled for select component ([5626a8f](https://github.com/kiva/kv-ui-elements/commit/5626a8fcb2a464d72abbda06968dec56496e4204))
12
+
13
+
14
+
15
+
16
+
17
+ ## [3.102.1](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.102.0...@kiva/kv-components@3.102.1) (2024-09-23)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * pie chart not visible with only one value MP-791 ([6419cd8](https://github.com/kiva/kv-ui-elements/commit/6419cd8d0f348d32dddadd4170f87a6442bf1b29))
23
+
24
+
25
+
26
+
27
+
6
28
  # [3.102.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.101.3...@kiva/kv-components@3.102.0) (2024-09-16)
7
29
 
8
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "3.102.0",
3
+ "version": "3.102.2",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -83,5 +83,5 @@
83
83
  "optional": true
84
84
  }
85
85
  },
86
- "gitHead": "20b68474c85a4df97dcf32d6a234a237f02cb9ae"
86
+ "gitHead": "045a91050100e52132289efff23cd542ac1ae89d"
87
87
  }
@@ -174,10 +174,18 @@ export default {
174
174
  const value = values.value[i];
175
175
  const end = start + value.percent;
176
176
  const [startX, startY] = circumPointFromAngle(cX, cY, r, start * Math.PI * 2);
177
- const [endX, endY] = circumPointFromAngle(cX, cY, r, end * Math.PI * 2);
178
- const largeArc = value.percent > 0.5 ? 1 : 0;
179
- // Draw just the outer arc of the slice
180
- const path = `M ${startX} ${startY} A ${r} ${r} 0 ${largeArc} 1 ${endX} ${endY}`;
177
+ let path = `M ${startX},${startY} `;
178
+ if (value.percent === 1) {
179
+ // Draw a full circle in two arcs
180
+ const [midX, midY] = circumPointFromAngle(cX, cY, r, (start + end) * Math.PI);
181
+ path += `A ${r},${r} 0 0,1 ${midX},${midY} `;
182
+ path += `A ${r},${r} 0 0,1 ${startX},${startY}`;
183
+ } else {
184
+ // Draw just the outer arc of the slice
185
+ const [endX, endY] = circumPointFromAngle(cX, cY, r, end * Math.PI * 2);
186
+ const largeArc = value.percent > 0.5 ? 1 : 0;
187
+ path += `A ${r},${r} 0 ${largeArc},1 ${endX},${endY}`;
188
+ }
181
189
  slicesArr.push({
182
190
  ...value,
183
191
  path,
package/vue/KvSelect.vue CHANGED
@@ -9,8 +9,8 @@
9
9
  <select
10
10
  :id="id"
11
11
  v-bind="inputAttrs"
12
+ v-model="inputValue"
12
13
  :disabled="disabled"
13
- :value="modelValue"
14
14
  class="tw-text-base tw-bg-primary tw-h-6 tw-pr-4 tw-pl-2 tw-border tw-border-tertiary tw-rounded-sm tw-appearance-none tw-w-full tw-ring-inset focus:tw-outline-none focus:tw-ring-2 focus:tw-ring-action focus:tw-border-transparent"
15
15
  :class="{ 'tw-opacity-low': disabled }"
16
16
  @change="onChange"
@@ -28,7 +28,7 @@
28
28
  </template>
29
29
 
30
30
  <script>
31
- import 'vue-demi';
31
+ import { ref, watch } from 'vue-demi';
32
32
  import { mdiChevronDown } from '@mdi/js';
33
33
  import KvMaterialIcon from './KvMaterialIcon.vue';
34
34
  import { useAttrs } from '../utils/attrs';
@@ -82,6 +82,14 @@ export default {
82
82
  inputListeners,
83
83
  } = useAttrs(context, emits);
84
84
 
85
+ const inputValue = ref(props.modelValue);
86
+
87
+ watch(() => props.modelValue, (newValue) => {
88
+ if (newValue !== inputValue.value) {
89
+ inputValue.value = newValue;
90
+ }
91
+ });
92
+
85
93
  const onChange = (event) => {
86
94
  /**
87
95
  * The value that the select has changed to
@@ -91,6 +99,7 @@ export default {
91
99
  emit('change', event.target.value);
92
100
  emit('update:modelValue', event.target.value);
93
101
  };
102
+
94
103
  return {
95
104
  mdiChevronDown,
96
105
  onChange,
@@ -98,6 +107,7 @@ export default {
98
107
  styles,
99
108
  inputAttrs,
100
109
  inputListeners,
110
+ inputValue,
101
111
  };
102
112
  },
103
113
  };
@@ -40,3 +40,8 @@ export const ManyValues = Template.bind({});
40
40
  ManyValues.args = {
41
41
  values: sectorValues,
42
42
  };
43
+
44
+ export const OneValue = Template.bind({});
45
+ OneValue.args = {
46
+ values: [{ label: 'Female', value: 1, percent: 1 }],
47
+ };