@community-release/nx-ui 0.0.64 → 0.0.66

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/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "ui",
3
3
  "configKey": "ui",
4
- "version": "0.0.64"
4
+ "version": "0.0.66"
5
5
  }
@@ -1,8 +1,9 @@
1
1
  <template>
2
2
  <section class="component-ui-accordion-item"
3
3
  :class="{'tag-active': accordionData.open.value === id, 'tag-icon': accordionData.haveIcon}"
4
+ :data-id="id"
4
5
  >
5
- <div class="header" @click="accordionData.open.value = accordionData.open.value === id ? -1 : id">
6
+ <div class="header" @click="accordionData.onClick(id)">
6
7
  <i class="icon"></i>
7
8
  <div class="title">{{ title }}</div>
8
9
  <div class="btn-toggle"></div>
@@ -9,7 +9,7 @@
9
9
 
10
10
  <script setup>
11
11
  // Imports
12
- import { ref, computed, provide } from 'vue';
12
+ import { ref, computed, provide, defineEmits } from 'vue';
13
13
  import comProps from '#build/ui.accordion.mjs';
14
14
  import UiAccordionItem from './accordion-item.vue';
15
15
 
@@ -43,6 +43,8 @@
43
43
  },
44
44
  });
45
45
 
46
+ const emit = defineEmits(['itemClick']);
47
+
46
48
  const open = ref(props.open);
47
49
  const counter = ref(0);
48
50
 
@@ -54,10 +56,19 @@
54
56
  return props.iconDark !== '' ? `url(${props.iconDark})` : iconLightComputed.value;
55
57
  });
56
58
 
59
+
60
+ // Methods
61
+ function onClick(id) {
62
+ open.value = open.value === id ? -1 : id;
63
+ emit('itemClick', id);
64
+ }
65
+
66
+ // Provide
57
67
  provide('accordionData', {
58
68
  counter,
59
69
  open,
60
- haveIcon: !!props.icon
70
+ haveIcon: !!props.icon,
71
+ onClick
61
72
  });
62
73
  </script>
63
74
 
@@ -1,12 +1,12 @@
1
1
  <template>
2
- <section class="component-ui-loading" :class="{'tag-active': active}">
3
- <svg width="32" height="32">
2
+ <div class="component-ui-loading" :class="{'tag-active': active}">
3
+ <svg width="32" height="32" aria-hidden="true">
4
4
  <circle cx="16" cy="16" r="10" ref="progress" />
5
5
  </svg>
6
6
  <div class="text" v-if="slots?.default">
7
7
  <slot />
8
8
  </div>
9
- </section>
9
+ </div>
10
10
  </template>
11
11
 
12
12
  <script setup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@community-release/nx-ui",
3
- "version": "0.0.64",
3
+ "version": "0.0.66",
4
4
  "packageManager": "pnpm@10.14.0",
5
5
  "description": "nx-ui - Nuxt UI library",
6
6
  "repository": {