@community-release/nx-ui 0.0.66 → 0.0.67
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
|
@@ -3,12 +3,18 @@
|
|
|
3
3
|
:class="{'tag-active': accordionData.open.value === id, 'tag-icon': accordionData.haveIcon}"
|
|
4
4
|
:data-id="id"
|
|
5
5
|
>
|
|
6
|
-
<
|
|
6
|
+
<button
|
|
7
|
+
:id="`acc-button-${cid}`"
|
|
8
|
+
class="header"
|
|
9
|
+
@click="accordionData.onClick(id)"
|
|
10
|
+
:aria-expanded="accordionData.open.value === id ? 'true' : 'false'"
|
|
11
|
+
:aria-controls="`acc-content-${cid}`"
|
|
12
|
+
>
|
|
7
13
|
<i class="icon"></i>
|
|
8
14
|
<div class="title">{{ title }}</div>
|
|
9
15
|
<div class="btn-toggle"></div>
|
|
10
|
-
</
|
|
11
|
-
<div class="text">
|
|
16
|
+
</button>
|
|
17
|
+
<div :id="`acc-content-${cid}`" class="text" role="region" :aria-labelledby="`acc-button-${cid}`">
|
|
12
18
|
<div><slot /></div>
|
|
13
19
|
</div>
|
|
14
20
|
</section>
|
|
@@ -16,7 +22,7 @@
|
|
|
16
22
|
|
|
17
23
|
<script setup>
|
|
18
24
|
// Import
|
|
19
|
-
import { inject } from 'vue'
|
|
25
|
+
import { inject } from 'vue';
|
|
20
26
|
|
|
21
27
|
// Data
|
|
22
28
|
const accordionData = inject('accordionData');
|
|
@@ -25,6 +31,7 @@
|
|
|
25
31
|
text: String,
|
|
26
32
|
});
|
|
27
33
|
const id = accordionData.counter.value++;
|
|
34
|
+
const cid = accordionData.cid + id;
|
|
28
35
|
</script>
|
|
29
36
|
|
|
30
37
|
<style lang="less">
|
|
@@ -69,9 +76,18 @@
|
|
|
69
76
|
font-size: @com-text-medium;
|
|
70
77
|
|
|
71
78
|
.header {
|
|
79
|
+
// box-sizing: border-box;
|
|
80
|
+
display: block;
|
|
81
|
+
width: 100%;
|
|
72
82
|
position: relative;
|
|
73
83
|
padding: @com-space-small var(--ui-accordion-btn-padding) @com-space-small calc(var(--ui-accordion-icon-size) + @com-space-default);
|
|
74
84
|
margin-bottom: @com-space-mini;
|
|
85
|
+
|
|
86
|
+
font: inherit;
|
|
87
|
+
text-align: left;
|
|
88
|
+
|
|
89
|
+
border: none;
|
|
90
|
+
background: transparent;
|
|
75
91
|
cursor: pointer;
|
|
76
92
|
}
|
|
77
93
|
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
<script setup>
|
|
11
11
|
// Imports
|
|
12
12
|
import { ref, computed, provide, defineEmits } from 'vue';
|
|
13
|
+
import uniq from '../helpers/uniq';
|
|
13
14
|
import comProps from '#build/ui.accordion.mjs';
|
|
14
15
|
import UiAccordionItem from './accordion-item.vue';
|
|
15
16
|
|
|
@@ -47,6 +48,7 @@
|
|
|
47
48
|
|
|
48
49
|
const open = ref(props.open);
|
|
49
50
|
const counter = ref(0);
|
|
51
|
+
const cid = uniq();
|
|
50
52
|
|
|
51
53
|
const iconLightComputed = computed(() => {
|
|
52
54
|
return props.icon !== '' ? `url(${props.icon})` : 'none';
|
|
@@ -65,6 +67,7 @@
|
|
|
65
67
|
|
|
66
68
|
// Provide
|
|
67
69
|
provide('accordionData', {
|
|
70
|
+
cid,
|
|
68
71
|
counter,
|
|
69
72
|
open,
|
|
70
73
|
haveIcon: !!props.icon,
|