@redseed/redseed-ui-vue3 7.0.1 → 7.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redseed/redseed-ui-vue3",
3
- "version": "7.0.1",
3
+ "version": "7.0.2",
4
4
  "description": "RedSeed UI Vue 3 components",
5
5
  "main": "index.js",
6
6
  "repository": "https://github.com/redseedtraining/redseed-ui",
@@ -32,6 +32,7 @@ function setActiveItem(item) {
32
32
  <SwitcherItem v-for="item in items"
33
33
  :key="item.id"
34
34
  :active="activeItem.id == item.id"
35
+ :disabled="item.disabled"
35
36
  @click="setActiveItem(item)"
36
37
  >
37
38
  <component v-if="item.icon"
@@ -3,17 +3,28 @@ const props = defineProps({
3
3
  active: {
4
4
  type: Boolean,
5
5
  default: false,
6
- }
6
+ },
7
+ disabled: {
8
+ type: Boolean,
9
+ default: false,
10
+ },
7
11
  })
8
12
 
9
- defineEmits(['click'])
13
+ const emit = defineEmits(['click'])
14
+
15
+ function handleClick() {
16
+ if (props.disabled) return
17
+
18
+ emit('click')
19
+ }
10
20
  </script>
11
21
  <template>
12
22
  <div class="rsui-switcher-item"
13
23
  :class="{
14
- 'rsui-switcher-item--active': props.active,
24
+ 'rsui-switcher-item--active': props.active && !props.disabled,
25
+ 'rsui-switcher-item--disabled': props.disabled,
15
26
  }"
16
- @click="$emit('click')"
27
+ @click="handleClick"
17
28
  >
18
29
  <slot></slot>
19
30
  </div>