classcard-ui 0.2.716 → 0.2.718
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/classcard-ui.common.js +61 -54
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.umd.js +61 -54
- package/dist/classcard-ui.umd.js.map +1 -1
- package/dist/classcard-ui.umd.min.js +1 -1
- package/dist/classcard-ui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CIconDropdown/CIconDropdown.vue +25 -18
- package/src/stories/CIconDropdown.stories.js +17 -12
package/package.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
:name="icon.name"
|
|
22
22
|
:type="icon.type"
|
|
23
23
|
:class="icon.class"
|
|
24
|
+
:cursorType="cursorType"
|
|
24
25
|
></c-icon>
|
|
25
26
|
</button>
|
|
26
27
|
</div>
|
|
@@ -30,28 +31,30 @@
|
|
|
30
31
|
class="absolute z-10 mt-2 -mr-1 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-gray-900 ring-opacity-5"
|
|
31
32
|
>
|
|
32
33
|
<div
|
|
33
|
-
class="w-max py-
|
|
34
|
+
class="w-max py-1"
|
|
34
35
|
role="menu"
|
|
35
36
|
aria-orientation="vertical"
|
|
36
37
|
aria-labelledby="option-menu"
|
|
37
38
|
>
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
39
|
+
<div v-for="(item, index) in items" v-bind:key="item.text">
|
|
40
|
+
<a
|
|
41
|
+
@mousedown.stop.prevent="dropdownAction(item)"
|
|
42
|
+
class="flex cursor-pointer px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900 disabled:pointer-events-none disabled:opacity-50"
|
|
43
|
+
:class="item.class"
|
|
44
|
+
role="menuitem"
|
|
45
|
+
:disabled="item.disabled"
|
|
46
|
+
>
|
|
47
|
+
<c-icon
|
|
48
|
+
v-if="item.icon"
|
|
49
|
+
:name="dropdownIcons[index].name"
|
|
50
|
+
:type="dropdownIcons[index].type"
|
|
51
|
+
:class="dropdownIcons[index].class"
|
|
52
|
+
:cursorType="cursorType"
|
|
53
|
+
></c-icon>
|
|
54
|
+
{{ item.text }}
|
|
55
|
+
</a>
|
|
56
|
+
<hr v-if="item.border" class="my-1" />
|
|
57
|
+
</div>
|
|
55
58
|
</div>
|
|
56
59
|
</div>
|
|
57
60
|
</div>
|
|
@@ -91,6 +94,10 @@ export default {
|
|
|
91
94
|
type: Boolean,
|
|
92
95
|
default: true,
|
|
93
96
|
},
|
|
97
|
+
cursorType: {
|
|
98
|
+
type: String,
|
|
99
|
+
default: "cursor-pointer",
|
|
100
|
+
},
|
|
94
101
|
},
|
|
95
102
|
data() {
|
|
96
103
|
return {
|
|
@@ -9,7 +9,7 @@ export default {
|
|
|
9
9
|
argTypes: {
|
|
10
10
|
items: { control: { type: "object" } },
|
|
11
11
|
icon: Object,
|
|
12
|
-
dropdownIcons: { type: Array }
|
|
12
|
+
dropdownIcons: { type: Array },
|
|
13
13
|
},
|
|
14
14
|
};
|
|
15
15
|
|
|
@@ -22,19 +22,24 @@ const Template = (args, { argTypes }) => ({
|
|
|
22
22
|
export const Default = Template.bind({});
|
|
23
23
|
Default.args = {
|
|
24
24
|
items: [
|
|
25
|
-
{
|
|
25
|
+
{
|
|
26
|
+
icon: true,
|
|
27
|
+
text: "one",
|
|
28
|
+
action: "alert",
|
|
29
|
+
class: "hover:bg-red-100 hover:text-red-500 w-56",
|
|
30
|
+
},
|
|
26
31
|
{ text: "two" },
|
|
27
32
|
],
|
|
28
33
|
dropdownIcons: [
|
|
29
34
|
{
|
|
30
|
-
name:
|
|
31
|
-
class:
|
|
32
|
-
type:
|
|
33
|
-
}
|
|
35
|
+
name: "trash",
|
|
36
|
+
class: "mr-3 h-5 w-5 text-gray-400 hover:text-red-500",
|
|
37
|
+
type: "solid",
|
|
38
|
+
},
|
|
34
39
|
],
|
|
35
|
-
icon:{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
};
|
|
40
|
+
icon: {
|
|
41
|
+
name: "dots-vertical-solid",
|
|
42
|
+
class: "h-5 w-5 text-gray-500",
|
|
43
|
+
type: "solid",
|
|
44
|
+
},
|
|
45
|
+
};
|