@meethive/components 0.0.3 → 0.0.5
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/es/AutoComplete/AutoComplete.js +71 -80
- package/es/BadgeStatus/Badge.js +38 -47
- package/es/CardSelect/CardSelect.js +115 -137
- package/es/CheckButton/CheckButton.js +102 -118
- package/es/ConfigProvider/ConfigProvider.js +44 -68
- package/es/DragModal/DragModal.js +191 -212
- package/es/EditTable/Body.js +158 -189
- package/es/EditTable/CellRender.js +10 -12
- package/es/EditTable/EditTable.js +385 -434
- package/es/EditTable/FormItem.js +140 -169
- package/es/EditTable/Group.js +171 -204
- package/es/EditTable/Header.js +57 -63
- package/es/EditTable/HeaderRender.js +10 -12
- package/es/EditTable/components/ContextMenu/Menu.js +78 -86
- package/es/EditTable/components/Search/Search.js +151 -163
- package/es/EditTable/components/Search/Sort.js +104 -119
- package/es/Ellipsis/Ellipsis.js +144 -148
- package/es/Empty/Empty.js +51 -57
- package/es/FullPage/FullPage.js +20 -19
- package/es/Icon/Icon.js +42 -49
- package/es/LocaleProvider/LocaleProvider.js +32 -38
- package/es/Markdown/Markdown.js +101 -118
- package/es/PermissionButton/PermissionButton.js +118 -118
- package/es/ProLayout/Basic/BasicLayout.js +361 -418
- package/es/ProLayout/Basic/Header.js +97 -111
- package/es/ProLayout/PageContainer/index.js +298 -344
- package/es/ProLayout/SiderMenu/BaseMenu.js +233 -240
- package/es/ProTable/Alert.js +39 -40
- package/es/ProTable/Content.js +84 -97
- package/es/ProTable/Header.js +32 -33
- package/es/ProTable/Pagination.js +56 -55
- package/es/ProTable/ProTable.js +256 -276
- package/es/RadioButton/RadioButton.js +48 -53
- package/es/Scrollbar/Bar.js +65 -76
- package/es/Scrollbar/Scrollbar.js +129 -161
- package/es/Scrollbar/Thumb.js +101 -150
- package/es/Search/Item.js +208 -236
- package/es/Search/Search.js +90 -90
- package/es/Skeleton/Skeleton.js +26 -27
- package/es/Skeleton/components/DashBoardCard.js +26 -27
- package/es/Skeleton/components/DashBoardChart.js +26 -27
- package/es/Skeleton/components/Detail.js +26 -27
- package/es/Skeleton/components/Drawer.js +26 -27
- package/es/Skeleton/components/Item.js +55 -54
- package/es/Skeleton/components/List.js +29 -27
- package/es/Skeleton/components/ListCard.js +28 -28
- package/es/Skeleton/components/ListCardItem.js +20 -20
- package/es/Skeleton/components/ListTable.js +26 -27
- package/es/Skeleton/components/Page.js +27 -26
- package/es/Skeleton/components/Search.js +16 -16
- package/es/Skeleton/components/Tree.js +26 -27
- package/es/TimeFormat/TimeFormat.js +32 -36
- package/es/Title/Title.js +23 -26
- package/es/ValueItem/ValueItem.js +100 -113
- package/es/VirtualTable/VirtualTable.js +235 -271
- package/lib/AutoComplete/AutoComplete.js +71 -80
- package/lib/BadgeStatus/Badge.js +38 -47
- package/lib/CardSelect/CardSelect.js +115 -137
- package/lib/CheckButton/CheckButton.js +102 -118
- package/lib/ConfigProvider/ConfigProvider.js +44 -68
- package/lib/DragModal/DragModal.js +191 -212
- package/lib/EditTable/Body.js +158 -189
- package/lib/EditTable/CellRender.js +10 -12
- package/lib/EditTable/EditTable.js +385 -434
- package/lib/EditTable/FormItem.js +140 -169
- package/lib/EditTable/Group.js +171 -204
- package/lib/EditTable/Header.js +57 -63
- package/lib/EditTable/HeaderRender.js +10 -12
- package/lib/EditTable/components/ContextMenu/Menu.js +78 -86
- package/lib/EditTable/components/Search/Search.js +151 -163
- package/lib/EditTable/components/Search/Sort.js +104 -119
- package/lib/Ellipsis/Ellipsis.js +144 -148
- package/lib/Empty/Empty.js +51 -57
- package/lib/FullPage/FullPage.js +20 -19
- package/lib/Icon/Icon.js +42 -49
- package/lib/LocaleProvider/LocaleProvider.js +32 -38
- package/lib/Markdown/Markdown.js +101 -118
- package/lib/PermissionButton/PermissionButton.js +118 -118
- package/lib/ProLayout/Basic/BasicLayout.js +361 -418
- package/lib/ProLayout/Basic/Header.js +97 -111
- package/lib/ProLayout/PageContainer/index.js +298 -344
- package/lib/ProLayout/SiderMenu/BaseMenu.js +233 -240
- package/lib/ProTable/Alert.js +39 -40
- package/lib/ProTable/Content.js +84 -97
- package/lib/ProTable/Header.js +32 -33
- package/lib/ProTable/Pagination.js +56 -55
- package/lib/ProTable/ProTable.js +256 -276
- package/lib/RadioButton/RadioButton.js +48 -53
- package/lib/Scrollbar/Bar.js +65 -76
- package/lib/Scrollbar/Scrollbar.js +129 -161
- package/lib/Scrollbar/Thumb.js +101 -150
- package/lib/Search/Item.js +208 -236
- package/lib/Search/Search.js +90 -90
- package/lib/Skeleton/Skeleton.js +26 -27
- package/lib/Skeleton/components/DashBoardCard.js +26 -27
- package/lib/Skeleton/components/DashBoardChart.js +26 -27
- package/lib/Skeleton/components/Detail.js +26 -27
- package/lib/Skeleton/components/Drawer.js +26 -27
- package/lib/Skeleton/components/Item.js +55 -54
- package/lib/Skeleton/components/List.js +29 -27
- package/lib/Skeleton/components/ListCard.js +28 -28
- package/lib/Skeleton/components/ListCardItem.js +20 -20
- package/lib/Skeleton/components/ListTable.js +26 -27
- package/lib/Skeleton/components/Page.js +27 -26
- package/lib/Skeleton/components/Search.js +16 -16
- package/lib/Skeleton/components/Tree.js +26 -27
- package/lib/TimeFormat/TimeFormat.js +32 -36
- package/lib/Title/Title.js +23 -26
- package/lib/ValueItem/ValueItem.js +100 -113
- package/lib/VirtualTable/VirtualTable.js +235 -271
- package/package.json +1 -1
|
@@ -1,84 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
import { unref as _unref, mergeProps as _mergeProps, openBlock as _openBlock, createBlock as _createBlock } from "vue"
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { ref, watch, computed } from 'vue'
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { unref as _unref, mergeProps as _mergeProps, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
3
|
+
import { Select } from 'ant-design-vue';
|
|
4
|
+
import { selectProps } from 'ant-design-vue/lib/select';
|
|
5
|
+
import { ref, watch, computed } from 'vue';
|
|
9
6
|
const __sfc_main__ = _defineComponent({
|
|
10
|
-
...{
|
|
11
|
-
|
|
12
|
-
},
|
|
7
|
+
...{
|
|
8
|
+
name: 'JAutoComplete'
|
|
9
|
+
},
|
|
13
10
|
__name: 'AutoComplete',
|
|
14
|
-
props: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
},
|
|
11
|
+
props: {
|
|
12
|
+
...selectProps(),
|
|
13
|
+
searchKey: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: 'label'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
21
18
|
emits: ['select', 'change', 'update:value'],
|
|
22
|
-
setup(__props, {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}, {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
onChange: handleChange
|
|
79
|
-
}), null, 16 /* FULL_PROPS */, ["value", "options"]))
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
})
|
|
19
|
+
setup(__props, {
|
|
20
|
+
emit: __emit
|
|
21
|
+
}) {
|
|
22
|
+
const props = __props;
|
|
23
|
+
const emit = __emit;
|
|
24
|
+
const myValue = ref();
|
|
25
|
+
const _label = ref();
|
|
26
|
+
const handleChange = e => {
|
|
27
|
+
if (e.length === 0) {
|
|
28
|
+
myValue.value = undefined;
|
|
29
|
+
emit('update:value', undefined);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const _options = computed(() => {
|
|
33
|
+
const item = props.options.find(option => option.value === myValue.value);
|
|
34
|
+
if (item || !myValue.value) {
|
|
35
|
+
_label.value = item?.label;
|
|
36
|
+
return props.options;
|
|
37
|
+
}
|
|
38
|
+
_label.value = myValue.value;
|
|
39
|
+
return [{
|
|
40
|
+
label: myValue.value,
|
|
41
|
+
value: myValue.value
|
|
42
|
+
}, ...props.options];
|
|
43
|
+
});
|
|
44
|
+
const handleSearch = e => {
|
|
45
|
+
myValue.value = e;
|
|
46
|
+
};
|
|
47
|
+
const onSelect = (val, option) => {
|
|
48
|
+
myValue.value = val;
|
|
49
|
+
emit('update:value', val);
|
|
50
|
+
emit('select', val, option);
|
|
51
|
+
};
|
|
52
|
+
watch(() => props.value, val => {
|
|
53
|
+
myValue.value = val;
|
|
54
|
+
}, {
|
|
55
|
+
immediate: true
|
|
56
|
+
});
|
|
57
|
+
return (_ctx, _cache) => {
|
|
58
|
+
return _openBlock(), _createBlock(_unref(Select), _mergeProps({
|
|
59
|
+
value: myValue.value,
|
|
60
|
+
"onUpdate:value": _cache[0] || (_cache[0] = $event => myValue.value = $event),
|
|
61
|
+
allowClear: ""
|
|
62
|
+
}, props, {
|
|
63
|
+
options: _options.value,
|
|
64
|
+
mode: "tags",
|
|
65
|
+
style: {
|
|
66
|
+
width: '100%'
|
|
67
|
+
},
|
|
68
|
+
onSelect: onSelect,
|
|
69
|
+
onSearch: handleSearch,
|
|
70
|
+
onChange: handleChange
|
|
71
|
+
}), null, 16 /* FULL_PROPS */, ["value", "options"]);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
});
|
|
84
75
|
export default __sfc_main__;
|
package/lib/BadgeStatus/Badge.js
CHANGED
|
@@ -1,51 +1,42 @@
|
|
|
1
|
-
import { defineComponent as _defineComponent } from 'vue'
|
|
2
|
-
import { unref as _unref, openBlock as _openBlock, createBlock as _createBlock } from "vue"
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { getHexColor } from './color'
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { unref as _unref, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
3
|
+
import { computed } from 'vue';
|
|
4
|
+
import { Badge } from 'ant-design-vue';
|
|
5
|
+
import { getHexColor } from './color';
|
|
9
6
|
const __sfc_main__ = _defineComponent({
|
|
10
|
-
...{
|
|
11
|
-
|
|
12
|
-
},
|
|
7
|
+
...{
|
|
8
|
+
name: 'JBadgeStatus'
|
|
9
|
+
},
|
|
13
10
|
__name: 'Badge',
|
|
14
|
-
props: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
11
|
+
props: {
|
|
12
|
+
text: {
|
|
13
|
+
type: String
|
|
14
|
+
},
|
|
15
|
+
status: {
|
|
16
|
+
type: [String, Number],
|
|
17
|
+
default: 'default'
|
|
18
|
+
},
|
|
19
|
+
statusNames: {
|
|
20
|
+
type: Object,
|
|
21
|
+
default: () => ({
|
|
22
|
+
'success': 'success',
|
|
23
|
+
'warning': 'warning',
|
|
24
|
+
'error': 'error',
|
|
25
|
+
'default': 'default'
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
},
|
|
32
29
|
setup(__props) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
text: __props.text
|
|
46
|
-
}, null, 8 /* PROPS */, ["color", "text"]))
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
})
|
|
30
|
+
const props = __props;
|
|
31
|
+
const _color = computed(() => {
|
|
32
|
+
return getHexColor(props.statusNames[props.status], 1);
|
|
33
|
+
});
|
|
34
|
+
return (_ctx, _cache) => {
|
|
35
|
+
return _openBlock(), _createBlock(_unref(Badge), {
|
|
36
|
+
color: _color.value,
|
|
37
|
+
text: __props.text
|
|
38
|
+
}, null, 8 /* PROPS */, ["color", "text"]);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
});
|
|
51
42
|
export default __sfc_main__;
|
|
@@ -1,141 +1,119 @@
|
|
|
1
|
-
import { defineComponent as _defineComponent } from 'vue'
|
|
2
|
-
import { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle } from "vue"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import genComponentStyle from './style'
|
|
9
|
-
import { Form } from 'ant-design-vue'
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle } from "vue";
|
|
3
|
+
const _hoisted_1 = ["onClick"];
|
|
4
|
+
import { computed, ref, watch } from 'vue';
|
|
5
|
+
import { has } from 'lodash-es';
|
|
6
|
+
import genComponentStyle from './style';
|
|
7
|
+
import { Form } from 'ant-design-vue';
|
|
12
8
|
const __sfc_main__ = _defineComponent({
|
|
13
|
-
...{
|
|
14
|
-
|
|
15
|
-
},
|
|
9
|
+
...{
|
|
10
|
+
name: 'JCardSelect'
|
|
11
|
+
},
|
|
16
12
|
__name: 'CardSelect',
|
|
17
|
-
props: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
13
|
+
props: {
|
|
14
|
+
layout: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: 'horizontal'
|
|
17
|
+
},
|
|
18
|
+
options: {
|
|
19
|
+
type: Array,
|
|
20
|
+
default: () => []
|
|
21
|
+
},
|
|
22
|
+
disabled: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
multiple: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false
|
|
29
|
+
},
|
|
30
|
+
column: {
|
|
31
|
+
type: Number,
|
|
32
|
+
default: 3
|
|
33
|
+
},
|
|
34
|
+
value: {
|
|
35
|
+
type: [String, Array],
|
|
36
|
+
default: undefined
|
|
37
|
+
},
|
|
38
|
+
itemLayout: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: 'horizontal'
|
|
41
|
+
}
|
|
42
|
+
},
|
|
47
43
|
emits: ['select', 'change', 'update:value'],
|
|
48
|
-
setup(__props, {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}),
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
_createElementVNode("div", {
|
|
124
|
-
class: _normalizeClass(['j-card-select-item-content', _unref(hashId)])
|
|
125
|
-
}, [
|
|
126
|
-
_createElementVNode("div", {
|
|
127
|
-
class: _normalizeClass(['j-card-select-title', _unref(hashId)])
|
|
128
|
-
}, _toDisplayString(item.label), 3 /* TEXT, CLASS */),
|
|
129
|
-
_createElementVNode("div", {
|
|
130
|
-
class: _normalizeClass(['j-card-select-describe', _unref(hashId)])
|
|
131
|
-
}, _toDisplayString(item.describe), 3 /* TEXT, CLASS */)
|
|
132
|
-
], 2 /* CLASS */)
|
|
133
|
-
])
|
|
134
|
-
], 10 /* CLASS, PROPS */, _hoisted_1))
|
|
135
|
-
}), 128 /* KEYED_FRAGMENT */))
|
|
136
|
-
], 6 /* CLASS, STYLE */))
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
})
|
|
44
|
+
setup(__props, {
|
|
45
|
+
emit: __emit
|
|
46
|
+
}) {
|
|
47
|
+
const props = __props;
|
|
48
|
+
const emit = __emit;
|
|
49
|
+
const selectKeys = ref([]);
|
|
50
|
+
const prefixCls = computed(() => 'j-card-select');
|
|
51
|
+
const [wrapSSR, hashId] = genComponentStyle(prefixCls);
|
|
52
|
+
const formItemContext = Form.useInjectFormItemContext();
|
|
53
|
+
const CardSelectStyle = computed(() => {
|
|
54
|
+
const _column = props.column > 0 && props.layout === 'horizontal' ? props.column : 1;
|
|
55
|
+
return {
|
|
56
|
+
'grid-template-columns': `repeat(${_column}, 1fr)`
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
const isMultiple = computed(() => {
|
|
60
|
+
return has(props, 'multiple') && props.multiple !== false;
|
|
61
|
+
});
|
|
62
|
+
const handleSelect = (key, node) => {
|
|
63
|
+
if (props.disabled || node.disabled) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const selectKeysSet = new Set(selectKeys.value);
|
|
67
|
+
const isActive = selectKeysSet.has(key);
|
|
68
|
+
if (isMultiple.value) {
|
|
69
|
+
if (isActive) {
|
|
70
|
+
selectKeysSet.delete(key);
|
|
71
|
+
} else {
|
|
72
|
+
selectKeysSet.add(key);
|
|
73
|
+
}
|
|
74
|
+
selectKeys.value = [...selectKeysSet.values()];
|
|
75
|
+
const nodes = props.options.filter(item => selectKeys.value.includes(item.value));
|
|
76
|
+
emit('select', selectKeys.value, nodes);
|
|
77
|
+
emit('change', selectKeys.value, nodes);
|
|
78
|
+
emit('update:value', selectKeys.value);
|
|
79
|
+
} else {
|
|
80
|
+
selectKeys.value = [key];
|
|
81
|
+
emit('select', key, node);
|
|
82
|
+
emit('change', key, node);
|
|
83
|
+
emit('update:value', key);
|
|
84
|
+
}
|
|
85
|
+
formItemContext.onFieldChange();
|
|
86
|
+
};
|
|
87
|
+
watch(() => props.value, () => {
|
|
88
|
+
selectKeys.value = isMultiple.value ? props.value || [] : [props.value];
|
|
89
|
+
}, {
|
|
90
|
+
immediate: true
|
|
91
|
+
});
|
|
92
|
+
return (_ctx, _cache) => {
|
|
93
|
+
return _openBlock(), _createElementBlock("div", {
|
|
94
|
+
class: _normalizeClass(['j-card-select', _unref(hashId)]),
|
|
95
|
+
style: _normalizeStyle(CardSelectStyle.value)
|
|
96
|
+
}, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(__props.options, item => {
|
|
97
|
+
return _openBlock(), _createElementBlock("div", {
|
|
98
|
+
key: item.value,
|
|
99
|
+
class: _normalizeClass({
|
|
100
|
+
'j-card-select-item': true,
|
|
101
|
+
'disabled': __props.disabled || item.disabled,
|
|
102
|
+
'active': selectKeys.value.includes(item.value),
|
|
103
|
+
[_unref(hashId)]: true
|
|
104
|
+
}),
|
|
105
|
+
onClick: () => handleSelect(item.value, item)
|
|
106
|
+
}, [_renderSlot(_ctx.$slots, "itemRender", {
|
|
107
|
+
node: item
|
|
108
|
+
}, () => [_createElementVNode("div", {
|
|
109
|
+
class: _normalizeClass(['j-card-select-item-content', _unref(hashId)])
|
|
110
|
+
}, [_createElementVNode("div", {
|
|
111
|
+
class: _normalizeClass(['j-card-select-title', _unref(hashId)])
|
|
112
|
+
}, _toDisplayString(item.label), 3 /* TEXT, CLASS */), _createElementVNode("div", {
|
|
113
|
+
class: _normalizeClass(['j-card-select-describe', _unref(hashId)])
|
|
114
|
+
}, _toDisplayString(item.describe), 3 /* TEXT, CLASS */)], 2 /* CLASS */)])], 10 /* CLASS, PROPS */, _hoisted_1);
|
|
115
|
+
}), 128 /* KEYED_FRAGMENT */))], 6 /* CLASS, STYLE */);
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
});
|
|
141
119
|
export default __sfc_main__;
|