@meethive/components 0.0.1
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 +84 -0
- package/es/AutoComplete/index.js +7 -0
- package/es/BadgeStatus/Badge.js +51 -0
- package/es/BadgeStatus/color.js +14 -0
- package/es/BadgeStatus/index.js +8 -0
- package/es/CardSelect/CardSelect.js +141 -0
- package/es/CardSelect/index.js +7 -0
- package/es/CardSelect/style/index.js +29 -0
- package/es/CheckButton/CheckButton.js +122 -0
- package/es/CheckButton/index.js +7 -0
- package/es/CheckButton/style/index.js +44 -0
- package/es/ConfigProvider/ConfigProvider.js +73 -0
- package/es/ConfigProvider/context.js +26 -0
- package/es/ConfigProvider/index.js +9 -0
- package/es/DragModal/DragModal.js +212 -0
- package/es/DragModal/index.js +7 -0
- package/es/DragModal/style/index.js +86 -0
- package/es/EditTable/Body.js +189 -0
- package/es/EditTable/CellRender.js +12 -0
- package/es/EditTable/EditTable.js +434 -0
- package/es/EditTable/FormItem.js +169 -0
- package/es/EditTable/Group.js +204 -0
- package/es/EditTable/Header.js +63 -0
- package/es/EditTable/HeaderRender.js +12 -0
- package/es/EditTable/components/ContextMenu/Menu.js +86 -0
- package/es/EditTable/components/ContextMenu/index.js +96 -0
- package/es/EditTable/components/Search/Search.js +163 -0
- package/es/EditTable/components/Search/Sort.js +119 -0
- package/es/EditTable/components/Search/index.js +2 -0
- package/es/EditTable/consts.js +13 -0
- package/es/EditTable/context.js +88 -0
- package/es/EditTable/hooks/index.js +19 -0
- package/es/EditTable/hooks/useGroup.js +48 -0
- package/es/EditTable/hooks/useResizeObserver.js +27 -0
- package/es/EditTable/hooks/useValidate.js +112 -0
- package/es/EditTable/index.js +25 -0
- package/es/EditTable/props.js +60 -0
- package/es/EditTable/style/body.js +63 -0
- package/es/EditTable/style/form.js +33 -0
- package/es/EditTable/style/group.js +33 -0
- package/es/EditTable/style/header.js +72 -0
- package/es/EditTable/style/index.js +52 -0
- package/es/EditTable/style/menu.js +27 -0
- package/es/EditTable/style/table.js +46 -0
- package/es/EditTable/utils.js +110 -0
- package/es/Ellipsis/Ellipsis.js +148 -0
- package/es/Ellipsis/index.js +7 -0
- package/es/Ellipsis/style/index.js +26 -0
- package/es/Empty/Empty.js +63 -0
- package/es/Empty/image.js +3 -0
- package/es/Empty/index.js +7 -0
- package/es/FullPage/FullPage.js +19 -0
- package/es/FullPage/index.js +7 -0
- package/es/Icon/Icon.js +49 -0
- package/es/Icon/index.js +7 -0
- package/es/LocaleProvider/LocaleProvider.js +31 -0
- package/es/LocaleProvider/index.js +7 -0
- package/es/LocaleReciver/index.js +24 -0
- package/es/Markdown/Markdown.js +118 -0
- package/es/Markdown/index.js +7 -0
- package/es/PermissionButton/PermissionButton.js +118 -0
- package/es/PermissionButton/confirm.js +94 -0
- package/es/PermissionButton/index.js +9 -0
- package/es/PermissionButton/shared.js +1 -0
- package/es/ProLayout/Basic/BasicLayout.js +422 -0
- package/es/ProLayout/Basic/BasicLayoutStyle.js +51 -0
- package/es/ProLayout/Basic/Header.js +111 -0
- package/es/ProLayout/Basic/HeaderStyle.js +10 -0
- package/es/ProLayout/PageContainer/index.js +354 -0
- package/es/ProLayout/PageContainer/style.js +85 -0
- package/es/ProLayout/RouteContext.js +28 -0
- package/es/ProLayout/SiderMenu/BaseMenu.js +241 -0
- package/es/ProLayout/SiderMenu/SiderMenu.js +274 -0
- package/es/ProLayout/SiderMenu/index.js +2 -0
- package/es/ProLayout/SiderMenu/style.js +204 -0
- package/es/ProLayout/TopHeader/index.js +170 -0
- package/es/ProLayout/TopHeader/style.js +154 -0
- package/es/ProLayout/defaultSettings.js +113 -0
- package/es/ProLayout/index.js +10 -0
- package/es/ProLayout/style/index.js +14 -0
- package/es/ProLayout/util.js +58 -0
- package/es/ProTable/Alert.js +40 -0
- package/es/ProTable/Content.js +97 -0
- package/es/ProTable/Header.js +33 -0
- package/es/ProTable/Pagination.js +55 -0
- package/es/ProTable/ProTable.js +279 -0
- package/es/ProTable/hooks/index.js +2 -0
- package/es/ProTable/hooks/useTableInject.js +6 -0
- package/es/ProTable/hooks/useTableSelection.js +115 -0
- package/es/ProTable/index.js +8 -0
- package/es/ProTable/setting.js +138 -0
- package/es/ProTable/style/index.js +113 -0
- package/es/RadioButton/RadioButton.js +53 -0
- package/es/RadioButton/index.js +8 -0
- package/es/RadioButton/style/index.js +25 -0
- package/es/Scrollbar/Bar.js +76 -0
- package/es/Scrollbar/Scrollbar.js +161 -0
- package/es/Scrollbar/Thumb.js +150 -0
- package/es/Scrollbar/constants.js +1 -0
- package/es/Scrollbar/index.js +7 -0
- package/es/Scrollbar/scrollbarProps.js +100 -0
- package/es/Scrollbar/style/index.js +85 -0
- package/es/Scrollbar/thumbProps.js +10 -0
- package/es/Scrollbar/util.js +39 -0
- package/es/Search/Item.js +239 -0
- package/es/Search/Search.js +90 -0
- package/es/Search/hooks/index.js +117 -0
- package/es/Search/hooks/useRouteQuery.js +86 -0
- package/es/Search/hooks/useSearchItems.js +50 -0
- package/es/Search/hooks/useTermOptions.js +29 -0
- package/es/Search/index.js +10 -0
- package/es/Search/setting.js +245 -0
- package/es/Search/style/index.js +5 -0
- package/es/Search/style/item.js +40 -0
- package/es/Search/style/search.js +177 -0
- package/es/Search/util.js +270 -0
- package/es/Skeleton/Skeleton.js +27 -0
- package/es/Skeleton/components/DashBoardCard.js +27 -0
- package/es/Skeleton/components/DashBoardChart.js +27 -0
- package/es/Skeleton/components/Detail.js +27 -0
- package/es/Skeleton/components/Drawer.js +27 -0
- package/es/Skeleton/components/Item.js +54 -0
- package/es/Skeleton/components/List.js +27 -0
- package/es/Skeleton/components/ListCard.js +28 -0
- package/es/Skeleton/components/ListCardItem.js +20 -0
- package/es/Skeleton/components/ListTable.js +27 -0
- package/es/Skeleton/components/Page.js +26 -0
- package/es/Skeleton/components/Search.js +16 -0
- package/es/Skeleton/components/Tree.js +27 -0
- package/es/Skeleton/index.js +28 -0
- package/es/Skeleton/style/index.js +195 -0
- package/es/TimeFormat/TimeFormat.js +36 -0
- package/es/TimeFormat/index.js +7 -0
- package/es/Title/Title.js +26 -0
- package/es/Title/index.js +7 -0
- package/es/Title/style/index.js +34 -0
- package/es/ValueItem/ValueItem.js +113 -0
- package/es/ValueItem/index.js +7 -0
- package/es/ValueItem/util.js +17 -0
- package/es/VirtualTable/VirtualTable.js +271 -0
- package/es/VirtualTable/data.js +60 -0
- package/es/VirtualTable/index.js +7 -0
- package/es/VirtualTable/style/index.js +34 -0
- package/es/components.js +21 -0
- package/es/index.js +17 -0
- package/es/locale/en-US.js +120 -0
- package/es/locale/zh-CN.js +120 -0
- package/es/style/styleRegister.js +19 -0
- package/es/style/variable.js +4 -0
- package/es/style.js +1 -0
- package/es/utils/constants.js +10 -0
- package/lib/AutoComplete/AutoComplete.js +84 -0
- package/lib/AutoComplete/index.js +7 -0
- package/lib/BadgeStatus/Badge.js +51 -0
- package/lib/BadgeStatus/color.js +14 -0
- package/lib/BadgeStatus/index.js +8 -0
- package/lib/CardSelect/CardSelect.js +141 -0
- package/lib/CardSelect/index.js +7 -0
- package/lib/CardSelect/style/index.js +29 -0
- package/lib/CheckButton/CheckButton.js +122 -0
- package/lib/CheckButton/index.js +7 -0
- package/lib/CheckButton/style/index.js +44 -0
- package/lib/ConfigProvider/ConfigProvider.js +73 -0
- package/lib/ConfigProvider/context.js +26 -0
- package/lib/ConfigProvider/index.js +9 -0
- package/lib/DragModal/DragModal.js +212 -0
- package/lib/DragModal/index.js +7 -0
- package/lib/DragModal/style/index.js +86 -0
- package/lib/EditTable/Body.js +189 -0
- package/lib/EditTable/CellRender.js +12 -0
- package/lib/EditTable/EditTable.js +434 -0
- package/lib/EditTable/FormItem.js +169 -0
- package/lib/EditTable/Group.js +204 -0
- package/lib/EditTable/Header.js +63 -0
- package/lib/EditTable/HeaderRender.js +12 -0
- package/lib/EditTable/components/ContextMenu/Menu.js +86 -0
- package/lib/EditTable/components/ContextMenu/index.js +96 -0
- package/lib/EditTable/components/Search/Search.js +163 -0
- package/lib/EditTable/components/Search/Sort.js +119 -0
- package/lib/EditTable/components/Search/index.js +2 -0
- package/lib/EditTable/consts.js +13 -0
- package/lib/EditTable/context.js +88 -0
- package/lib/EditTable/hooks/index.js +19 -0
- package/lib/EditTable/hooks/useGroup.js +48 -0
- package/lib/EditTable/hooks/useResizeObserver.js +27 -0
- package/lib/EditTable/hooks/useValidate.js +112 -0
- package/lib/EditTable/index.js +25 -0
- package/lib/EditTable/props.js +60 -0
- package/lib/EditTable/style/body.js +63 -0
- package/lib/EditTable/style/form.js +33 -0
- package/lib/EditTable/style/group.js +33 -0
- package/lib/EditTable/style/header.js +72 -0
- package/lib/EditTable/style/index.js +52 -0
- package/lib/EditTable/style/menu.js +27 -0
- package/lib/EditTable/style/table.js +46 -0
- package/lib/EditTable/utils.js +110 -0
- package/lib/Ellipsis/Ellipsis.js +148 -0
- package/lib/Ellipsis/index.js +7 -0
- package/lib/Ellipsis/style/index.js +26 -0
- package/lib/Empty/Empty.js +63 -0
- package/lib/Empty/image.js +3 -0
- package/lib/Empty/index.js +7 -0
- package/lib/FullPage/FullPage.js +19 -0
- package/lib/FullPage/index.js +7 -0
- package/lib/Icon/Icon.js +49 -0
- package/lib/Icon/index.js +7 -0
- package/lib/LocaleProvider/LocaleProvider.js +31 -0
- package/lib/LocaleProvider/index.js +7 -0
- package/lib/LocaleReciver/index.js +24 -0
- package/lib/Markdown/Markdown.js +118 -0
- package/lib/Markdown/index.js +7 -0
- package/lib/PermissionButton/PermissionButton.js +118 -0
- package/lib/PermissionButton/confirm.js +94 -0
- package/lib/PermissionButton/index.js +9 -0
- package/lib/PermissionButton/shared.js +1 -0
- package/lib/ProLayout/Basic/BasicLayout.js +422 -0
- package/lib/ProLayout/Basic/BasicLayoutStyle.js +51 -0
- package/lib/ProLayout/Basic/Header.js +111 -0
- package/lib/ProLayout/Basic/HeaderStyle.js +10 -0
- package/lib/ProLayout/PageContainer/index.js +354 -0
- package/lib/ProLayout/PageContainer/style.js +85 -0
- package/lib/ProLayout/RouteContext.js +28 -0
- package/lib/ProLayout/SiderMenu/BaseMenu.js +241 -0
- package/lib/ProLayout/SiderMenu/SiderMenu.js +274 -0
- package/lib/ProLayout/SiderMenu/index.js +2 -0
- package/lib/ProLayout/SiderMenu/style.js +204 -0
- package/lib/ProLayout/TopHeader/index.js +170 -0
- package/lib/ProLayout/TopHeader/style.js +154 -0
- package/lib/ProLayout/defaultSettings.js +113 -0
- package/lib/ProLayout/index.js +10 -0
- package/lib/ProLayout/style/index.js +14 -0
- package/lib/ProLayout/util.js +58 -0
- package/lib/ProTable/Alert.js +40 -0
- package/lib/ProTable/Content.js +97 -0
- package/lib/ProTable/Header.js +33 -0
- package/lib/ProTable/Pagination.js +55 -0
- package/lib/ProTable/ProTable.js +279 -0
- package/lib/ProTable/hooks/index.js +2 -0
- package/lib/ProTable/hooks/useTableInject.js +6 -0
- package/lib/ProTable/hooks/useTableSelection.js +115 -0
- package/lib/ProTable/index.js +8 -0
- package/lib/ProTable/setting.js +138 -0
- package/lib/ProTable/style/index.js +113 -0
- package/lib/RadioButton/RadioButton.js +53 -0
- package/lib/RadioButton/index.js +8 -0
- package/lib/RadioButton/style/index.js +25 -0
- package/lib/Scrollbar/Bar.js +76 -0
- package/lib/Scrollbar/Scrollbar.js +161 -0
- package/lib/Scrollbar/Thumb.js +150 -0
- package/lib/Scrollbar/constants.js +1 -0
- package/lib/Scrollbar/index.js +7 -0
- package/lib/Scrollbar/scrollbarProps.js +100 -0
- package/lib/Scrollbar/style/index.js +85 -0
- package/lib/Scrollbar/thumbProps.js +10 -0
- package/lib/Scrollbar/util.js +39 -0
- package/lib/Search/Item.js +239 -0
- package/lib/Search/Search.js +90 -0
- package/lib/Search/hooks/index.js +117 -0
- package/lib/Search/hooks/useRouteQuery.js +86 -0
- package/lib/Search/hooks/useSearchItems.js +50 -0
- package/lib/Search/hooks/useTermOptions.js +29 -0
- package/lib/Search/index.js +10 -0
- package/lib/Search/setting.js +245 -0
- package/lib/Search/style/index.js +5 -0
- package/lib/Search/style/item.js +40 -0
- package/lib/Search/style/search.js +177 -0
- package/lib/Search/util.js +270 -0
- package/lib/Skeleton/Skeleton.js +27 -0
- package/lib/Skeleton/components/DashBoardCard.js +27 -0
- package/lib/Skeleton/components/DashBoardChart.js +27 -0
- package/lib/Skeleton/components/Detail.js +27 -0
- package/lib/Skeleton/components/Drawer.js +27 -0
- package/lib/Skeleton/components/Item.js +54 -0
- package/lib/Skeleton/components/List.js +27 -0
- package/lib/Skeleton/components/ListCard.js +28 -0
- package/lib/Skeleton/components/ListCardItem.js +20 -0
- package/lib/Skeleton/components/ListTable.js +27 -0
- package/lib/Skeleton/components/Page.js +26 -0
- package/lib/Skeleton/components/Search.js +16 -0
- package/lib/Skeleton/components/Tree.js +27 -0
- package/lib/Skeleton/index.js +28 -0
- package/lib/Skeleton/style/index.js +195 -0
- package/lib/TimeFormat/TimeFormat.js +36 -0
- package/lib/TimeFormat/index.js +7 -0
- package/lib/Title/Title.js +26 -0
- package/lib/Title/index.js +7 -0
- package/lib/Title/style/index.js +34 -0
- package/lib/ValueItem/ValueItem.js +113 -0
- package/lib/ValueItem/index.js +7 -0
- package/lib/ValueItem/util.js +17 -0
- package/lib/VirtualTable/VirtualTable.js +271 -0
- package/lib/VirtualTable/data.js +60 -0
- package/lib/VirtualTable/index.js +7 -0
- package/lib/VirtualTable/style/index.js +34 -0
- package/lib/components.js +21 -0
- package/lib/index.js +17 -0
- package/lib/locale/en-US.js +120 -0
- package/lib/locale/zh-CN.js +120 -0
- package/lib/style/styleRegister.js +19 -0
- package/lib/style/variable.js +4 -0
- package/lib/style.js +1 -0
- package/lib/utils/constants.js +10 -0
- package/package.json +164 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }import { defineComponent as _defineComponent } from 'vue'
|
|
2
|
+
import { unref as _unref, mergeProps as _mergeProps, openBlock as _openBlock, createBlock as _createBlock } from "vue"
|
|
3
|
+
|
|
4
|
+
import { Select } from 'ant-design-vue'
|
|
5
|
+
import { selectProps } from 'ant-design-vue/lib/select'
|
|
6
|
+
import { ref, watch, computed } from 'vue'
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
const __sfc_main__ = _defineComponent({
|
|
10
|
+
...{
|
|
11
|
+
name: 'JAutoComplete'
|
|
12
|
+
},
|
|
13
|
+
__name: 'AutoComplete',
|
|
14
|
+
props: {
|
|
15
|
+
...selectProps(),
|
|
16
|
+
searchKey: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: 'label',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
emits: ['select', 'change', 'update:value'],
|
|
22
|
+
setup(__props, { emit: __emit }) {
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
const props = __props
|
|
27
|
+
|
|
28
|
+
const emit = __emit
|
|
29
|
+
|
|
30
|
+
const myValue = ref()
|
|
31
|
+
const _label = ref()
|
|
32
|
+
|
|
33
|
+
const handleChange = (e) => {
|
|
34
|
+
if (e.length === 0) {
|
|
35
|
+
myValue.value = undefined
|
|
36
|
+
emit('update:value', undefined)
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const _options = computed(() => {
|
|
41
|
+
const item = props.options.find(option => option.value === myValue.value)
|
|
42
|
+
if (item || !myValue.value) {
|
|
43
|
+
_label.value = _optionalChain([item, 'optionalAccess', _ => _.label])
|
|
44
|
+
return props.options
|
|
45
|
+
}
|
|
46
|
+
_label.value = myValue.value
|
|
47
|
+
return [
|
|
48
|
+
{ label: myValue.value, value: myValue.value },
|
|
49
|
+
...props.options
|
|
50
|
+
]
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
const handleSearch = (e) => {
|
|
54
|
+
myValue.value = e
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const onSelect = (val, option) => {
|
|
58
|
+
myValue.value = val
|
|
59
|
+
emit('update:value', val)
|
|
60
|
+
emit('select', val, option)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
watch(() => props.value, (val) => {
|
|
64
|
+
myValue.value = val
|
|
65
|
+
}, { immediate: true })
|
|
66
|
+
|
|
67
|
+
return (_ctx,_cache) => {
|
|
68
|
+
return (_openBlock(), _createBlock(_unref(Select), _mergeProps({
|
|
69
|
+
value: myValue.value,
|
|
70
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => ((myValue).value = $event)),
|
|
71
|
+
allowClear: ""
|
|
72
|
+
}, props, {
|
|
73
|
+
options: _options.value,
|
|
74
|
+
mode: "tags",
|
|
75
|
+
style: { width: '100%' },
|
|
76
|
+
onSelect: onSelect,
|
|
77
|
+
onSearch: handleSearch,
|
|
78
|
+
onChange: handleChange
|
|
79
|
+
}), null, 16 /* FULL_PROPS */, ["value", "options"]))
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
})
|
|
84
|
+
export default __sfc_main__;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue'
|
|
2
|
+
import { unref as _unref, openBlock as _openBlock, createBlock as _createBlock } from "vue"
|
|
3
|
+
|
|
4
|
+
import { computed } from 'vue'
|
|
5
|
+
import { Badge } from 'ant-design-vue'
|
|
6
|
+
import { getHexColor } from './color'
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
const __sfc_main__ = _defineComponent({
|
|
10
|
+
...{
|
|
11
|
+
name: 'JBadgeStatus'
|
|
12
|
+
},
|
|
13
|
+
__name: 'Badge',
|
|
14
|
+
props: {
|
|
15
|
+
text: {
|
|
16
|
+
type: String,
|
|
17
|
+
},
|
|
18
|
+
status: {
|
|
19
|
+
type: [String, Number],
|
|
20
|
+
default: 'default',
|
|
21
|
+
},
|
|
22
|
+
statusNames: {
|
|
23
|
+
type: Object,
|
|
24
|
+
default: () => ({
|
|
25
|
+
'success': 'success',
|
|
26
|
+
'warning': 'warning',
|
|
27
|
+
'error': 'error',
|
|
28
|
+
'default': 'default',
|
|
29
|
+
})
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
setup(__props) {
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
const props = __props
|
|
37
|
+
|
|
38
|
+
const _color = computed(() => {
|
|
39
|
+
return getHexColor(props.statusNames[props.status], 1)
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
return (_ctx,_cache) => {
|
|
43
|
+
return (_openBlock(), _createBlock(_unref(Badge), {
|
|
44
|
+
color: _color.value,
|
|
45
|
+
text: __props.text
|
|
46
|
+
}, null, 8 /* PROPS */, ["color", "text"]))
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
})
|
|
51
|
+
export default __sfc_main__;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const colorMap = {
|
|
2
|
+
'success': '36, 178, 118',
|
|
3
|
+
'warning': '255, 144, 0',
|
|
4
|
+
'error': '229, 0, 18',
|
|
5
|
+
'processing': '9, 46, 231',
|
|
6
|
+
'default': '102, 102, 102'
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const getHexColor = (code, pe = 0.1) => {
|
|
10
|
+
const _color = colorMap[code] || colorMap.default
|
|
11
|
+
return `rgba(${_color}, ${pe})`
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default colorMap
|
|
@@ -0,0 +1,141 @@
|
|
|
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
|
+
const _hoisted_1 = ["onClick"]
|
|
5
|
+
|
|
6
|
+
import { computed, ref, watch } from 'vue'
|
|
7
|
+
import { has } from 'lodash-es'
|
|
8
|
+
import genComponentStyle from './style'
|
|
9
|
+
import { Form } from 'ant-design-vue'
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
const __sfc_main__ = _defineComponent({
|
|
13
|
+
...{
|
|
14
|
+
name: 'JCardSelect'
|
|
15
|
+
},
|
|
16
|
+
__name: 'CardSelect',
|
|
17
|
+
props: {
|
|
18
|
+
layout: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: 'horizontal'
|
|
21
|
+
},
|
|
22
|
+
options: {
|
|
23
|
+
type: Array,
|
|
24
|
+
default: () => []
|
|
25
|
+
},
|
|
26
|
+
disabled: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false
|
|
29
|
+
},
|
|
30
|
+
multiple: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false
|
|
33
|
+
},
|
|
34
|
+
column: {
|
|
35
|
+
type: Number,
|
|
36
|
+
default: 3
|
|
37
|
+
},
|
|
38
|
+
value: {
|
|
39
|
+
type: [String, Array],
|
|
40
|
+
default: undefined
|
|
41
|
+
},
|
|
42
|
+
itemLayout: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: 'horizontal'
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
emits: ['select', 'change', 'update:value'],
|
|
48
|
+
setup(__props, { emit: __emit }) {
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
const props = __props
|
|
53
|
+
|
|
54
|
+
const emit = __emit
|
|
55
|
+
|
|
56
|
+
const selectKeys = ref([])
|
|
57
|
+
const prefixCls = computed(() => 'j-card-select')
|
|
58
|
+
const [wrapSSR, hashId] = genComponentStyle(prefixCls)
|
|
59
|
+
const formItemContext = Form.useInjectFormItemContext()
|
|
60
|
+
|
|
61
|
+
const CardSelectStyle = computed(() => {
|
|
62
|
+
const _column = props.column > 0 && props.layout === 'horizontal' ? props.column : 1
|
|
63
|
+
return {
|
|
64
|
+
'grid-template-columns': `repeat(${_column}, 1fr)`
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
const isMultiple = computed(() => {
|
|
69
|
+
return has(props, 'multiple') && props.multiple !== false
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
const handleSelect = (key, node) => {
|
|
73
|
+
if (props.disabled || node.disabled) {
|
|
74
|
+
return
|
|
75
|
+
}
|
|
76
|
+
const selectKeysSet = new Set(selectKeys.value)
|
|
77
|
+
const isActive = selectKeysSet.has(key)
|
|
78
|
+
if (isMultiple.value) {
|
|
79
|
+
if (isActive) {
|
|
80
|
+
selectKeysSet.delete(key)
|
|
81
|
+
} else {
|
|
82
|
+
selectKeysSet.add(key)
|
|
83
|
+
}
|
|
84
|
+
selectKeys.value = [...selectKeysSet.values()]
|
|
85
|
+
const nodes = props.options.filter((item) => selectKeys.value.includes(item.value))
|
|
86
|
+
emit('select', selectKeys.value, nodes)
|
|
87
|
+
emit('change', selectKeys.value, nodes)
|
|
88
|
+
emit('update:value', selectKeys.value)
|
|
89
|
+
} else {
|
|
90
|
+
selectKeys.value = [key]
|
|
91
|
+
emit('select', key, node)
|
|
92
|
+
emit('change', key, node)
|
|
93
|
+
emit('update:value', key)
|
|
94
|
+
}
|
|
95
|
+
formItemContext.onFieldChange()
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
watch(
|
|
99
|
+
() => props.value,
|
|
100
|
+
() => {
|
|
101
|
+
selectKeys.value = isMultiple.value ? (props.value || []) : [props.value]
|
|
102
|
+
},
|
|
103
|
+
{ immediate: true }
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
return (_ctx,_cache) => {
|
|
107
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
108
|
+
class: _normalizeClass(['j-card-select', _unref(hashId)]),
|
|
109
|
+
style: _normalizeStyle(CardSelectStyle.value)
|
|
110
|
+
}, [
|
|
111
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(__props.options, (item) => {
|
|
112
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
113
|
+
key: item.value,
|
|
114
|
+
class: _normalizeClass({
|
|
115
|
+
'j-card-select-item': true,
|
|
116
|
+
'disabled': __props.disabled || item.disabled,
|
|
117
|
+
'active': selectKeys.value.includes(item.value),
|
|
118
|
+
[_unref(hashId)]: true
|
|
119
|
+
}),
|
|
120
|
+
onClick: () => handleSelect(item.value, item)
|
|
121
|
+
}, [
|
|
122
|
+
_renderSlot(_ctx.$slots, "itemRender", { node: item }, () => [
|
|
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
|
+
})
|
|
141
|
+
export default __sfc_main__;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import genComponentStyle from '../../style/styleRegister'
|
|
2
|
+
|
|
3
|
+
const genCardSelectStyle = (config) => {
|
|
4
|
+
const { componentCls, token } = config
|
|
5
|
+
return {
|
|
6
|
+
[componentCls]: {
|
|
7
|
+
display: 'grid',
|
|
8
|
+
gap: '12px',
|
|
9
|
+
[`${componentCls}-item`]: {
|
|
10
|
+
padding: '12px',
|
|
11
|
+
border: '1px solid #e6e6e6',
|
|
12
|
+
borderRadius: '@border-radius-base',
|
|
13
|
+
cursor: 'pointer',
|
|
14
|
+
'&.active': {
|
|
15
|
+
borderColor: token.colorPrimary
|
|
16
|
+
},
|
|
17
|
+
'&.disabled': {
|
|
18
|
+
cursor: 'not-allowed',
|
|
19
|
+
opacity: 0.7
|
|
20
|
+
},
|
|
21
|
+
[`${componentCls}-describe`]: {
|
|
22
|
+
color: token.textColorSubtitle
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default genComponentStyle([genCardSelectStyle])
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue'
|
|
2
|
+
import { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle } from "vue"
|
|
3
|
+
|
|
4
|
+
const _hoisted_1 = ["onClick"]
|
|
5
|
+
|
|
6
|
+
import { computed, ref, watch } from 'vue'
|
|
7
|
+
import { isArray } from '@meethive/utils'
|
|
8
|
+
import useCheckButtonStyle from './style'
|
|
9
|
+
import { Form } from 'ant-design-vue'
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
const __sfc_main__ = _defineComponent({
|
|
13
|
+
...{
|
|
14
|
+
name: 'JCheckButton'
|
|
15
|
+
},
|
|
16
|
+
__name: 'CheckButton',
|
|
17
|
+
props: {
|
|
18
|
+
value: {
|
|
19
|
+
type: [String, Array],
|
|
20
|
+
default: undefined,
|
|
21
|
+
},
|
|
22
|
+
options: {
|
|
23
|
+
type: Array,
|
|
24
|
+
default: () => [],
|
|
25
|
+
},
|
|
26
|
+
multiple: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false,
|
|
29
|
+
},
|
|
30
|
+
disabled: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false,
|
|
33
|
+
},
|
|
34
|
+
class: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: undefined,
|
|
37
|
+
},
|
|
38
|
+
style: {
|
|
39
|
+
type: Object,
|
|
40
|
+
default: () => ({}),
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
emits: ['update:value', 'change', 'select'],
|
|
44
|
+
setup(__props, { emit: __emit }) {
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
const props = __props
|
|
49
|
+
|
|
50
|
+
const emit = __emit
|
|
51
|
+
|
|
52
|
+
const prefixCls = computed(() => 'j-check-button')
|
|
53
|
+
const [wrapSSR, hashId] = useCheckButtonStyle(prefixCls)
|
|
54
|
+
|
|
55
|
+
const formItemContext = Form.useInjectFormItemContext()
|
|
56
|
+
|
|
57
|
+
const myValue = ref()
|
|
58
|
+
const optionsMap = ref(new Map())
|
|
59
|
+
|
|
60
|
+
const _options = computed(() => {
|
|
61
|
+
props.options.forEach((item) => {
|
|
62
|
+
if (props.disabled) {
|
|
63
|
+
item.disabled = props.disabled
|
|
64
|
+
}
|
|
65
|
+
optionsMap.value.set(item.value, item)
|
|
66
|
+
})
|
|
67
|
+
return props.options
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
watch(() => props.value, () => {
|
|
71
|
+
if (props.value) {
|
|
72
|
+
myValue.value = isArray(props.value) ? props.value : [props.value]
|
|
73
|
+
} else {
|
|
74
|
+
myValue.value = []
|
|
75
|
+
}
|
|
76
|
+
}, { immediate: true, deep: true })
|
|
77
|
+
|
|
78
|
+
const selected = (key, disabled) => {
|
|
79
|
+
if (disabled) return
|
|
80
|
+
const values = new Set(myValue.value)
|
|
81
|
+
if (values.has(key)) {
|
|
82
|
+
values.delete(key)
|
|
83
|
+
} else {
|
|
84
|
+
if (!props.multiple) {
|
|
85
|
+
values.clear()
|
|
86
|
+
}
|
|
87
|
+
values.add(key)
|
|
88
|
+
}
|
|
89
|
+
myValue.value = [...values.values()]
|
|
90
|
+
const optionsItems = myValue.value.map((_key) => {
|
|
91
|
+
return optionsMap.value.get(_key)
|
|
92
|
+
})
|
|
93
|
+
const _value = props.multiple ? myValue.value : myValue.value[0]
|
|
94
|
+
emit('update:value', _value)
|
|
95
|
+
emit('change', _value, props.multiple ? optionsItems : optionsItems[0])
|
|
96
|
+
emit('select', _value, props.multiple ? optionsItems : optionsItems[0])
|
|
97
|
+
formItemContext.onFieldChange()
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return (_ctx,_cache) => {
|
|
101
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
102
|
+
class: _normalizeClass(['j-check-button', props.class, _unref(hashId)]),
|
|
103
|
+
style: _normalizeStyle(props.style)
|
|
104
|
+
}, [
|
|
105
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_options.value, (item) => {
|
|
106
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
107
|
+
key: item.value,
|
|
108
|
+
class: _normalizeClass([
|
|
109
|
+
'j-check-button-item',
|
|
110
|
+
myValue.value.includes(item.value) ? 'selected' : '',
|
|
111
|
+
item.disabled ? 'disabled' : '',
|
|
112
|
+
_unref(hashId)
|
|
113
|
+
]),
|
|
114
|
+
onClick: () => { selected(item.value, item.disabled) }
|
|
115
|
+
}, _toDisplayString(item.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_1))
|
|
116
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
117
|
+
], 6 /* CLASS, STYLE */))
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
})
|
|
122
|
+
export default __sfc_main__;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import genComponentStyle from '../../style/styleRegister'
|
|
2
|
+
|
|
3
|
+
const genCheckButtonStyle = (config) => {
|
|
4
|
+
const { componentCls, token } = config
|
|
5
|
+
return {
|
|
6
|
+
[componentCls]: {
|
|
7
|
+
display: 'flex',
|
|
8
|
+
gap: '16px',
|
|
9
|
+
width: '100%',
|
|
10
|
+
[`${componentCls}-item`]: {
|
|
11
|
+
flex: 1,
|
|
12
|
+
minWidth: 0,
|
|
13
|
+
padding: '8px',
|
|
14
|
+
borderRadius: token.borderRadius,
|
|
15
|
+
backgroundColor: '#f2f3f5',
|
|
16
|
+
transition: 'all 0.3s',
|
|
17
|
+
color: '#333',
|
|
18
|
+
textAlign: 'center',
|
|
19
|
+
cursor: 'pointer',
|
|
20
|
+
'&:hover': {
|
|
21
|
+
backgroundColor: token.colorPrimary,
|
|
22
|
+
opacity: 0.85,
|
|
23
|
+
color: '#fff'
|
|
24
|
+
},
|
|
25
|
+
'&.selected': {
|
|
26
|
+
backgroundColor: token.colorPrimary,
|
|
27
|
+
color: '#fff'
|
|
28
|
+
},
|
|
29
|
+
'&.disabled': {
|
|
30
|
+
backgroundColor: '#f5f5f5',
|
|
31
|
+
color: '#ccc',
|
|
32
|
+
cursor: 'not-allowed',
|
|
33
|
+
'&:hover': {
|
|
34
|
+
backgroundColor: '#f5f5f5',
|
|
35
|
+
color: '#ccc',
|
|
36
|
+
opacity: 1
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default genComponentStyle([genCheckButtonStyle])
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue'
|
|
2
|
+
import { unref as _unref, renderSlot as _renderSlot, createVNode as _createVNode, withCtx as _withCtx, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, openBlock as _openBlock, createBlock as _createBlock } from "vue"
|
|
3
|
+
|
|
4
|
+
import { provide, reactive } from 'vue'
|
|
5
|
+
import { ConfigProvider } from 'ant-design-vue'
|
|
6
|
+
import { omit } from 'lodash-es'
|
|
7
|
+
import { configProps } from './context'
|
|
8
|
+
import {
|
|
9
|
+
ComponentsEnum,
|
|
10
|
+
MAPConfig,
|
|
11
|
+
PermissionButtonConfig,
|
|
12
|
+
SearchConfig,
|
|
13
|
+
FullPageConfig,
|
|
14
|
+
TableConfig
|
|
15
|
+
} from '../utils/constants'
|
|
16
|
+
import LocaleProvider from '../LocaleProvider/index'
|
|
17
|
+
import Empty from '../Empty/index'
|
|
18
|
+
import zh from '../locale/zh-CN'
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
const __sfc_main__ = _defineComponent({
|
|
22
|
+
...{
|
|
23
|
+
name: 'JConfigProvider',
|
|
24
|
+
inheritAttrs: false
|
|
25
|
+
},
|
|
26
|
+
__name: 'ConfigProvider',
|
|
27
|
+
props: { ...configProps() },
|
|
28
|
+
setup(__props) {
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
const props = __props
|
|
33
|
+
|
|
34
|
+
const _iconConfig = reactive(props.IconConfig || {})
|
|
35
|
+
const _mapConfig = reactive(props.MapConfig || {})
|
|
36
|
+
const _searchConfig = reactive(props.SearchConfig || {})
|
|
37
|
+
const _PermissionButtonConfig = reactive(props.PermissionButtonConfig || {})
|
|
38
|
+
const _FullPageConfig = reactive(props.FullPageConfig || {})
|
|
39
|
+
const _TableConfig = reactive(props.TableConfig || {})
|
|
40
|
+
|
|
41
|
+
provide(ComponentsEnum.Icon, _iconConfig)
|
|
42
|
+
provide(MAPConfig, _mapConfig)
|
|
43
|
+
provide(SearchConfig, _searchConfig)
|
|
44
|
+
provide(PermissionButtonConfig, _PermissionButtonConfig)
|
|
45
|
+
provide(FullPageConfig, _FullPageConfig)
|
|
46
|
+
provide(TableConfig, _TableConfig)
|
|
47
|
+
|
|
48
|
+
const configProviderProps = omit(props, ['IconConfig', 'MapConfig', 'SearchConfig'])
|
|
49
|
+
|
|
50
|
+
return (_ctx,_cache) => {
|
|
51
|
+
return (_openBlock(), _createBlock(_unref(ConfigProvider), _normalizeProps(_guardReactiveProps(_unref(configProviderProps))), {
|
|
52
|
+
default: _withCtx(() => [
|
|
53
|
+
_createVNode(_unref(LocaleProvider), {
|
|
54
|
+
locale: _ctx.componentsLocale || _unref(zh)
|
|
55
|
+
}, {
|
|
56
|
+
default: _withCtx(() => [
|
|
57
|
+
_renderSlot(_ctx.$slots, "default")
|
|
58
|
+
]),
|
|
59
|
+
renderEmpty: _withCtx(() => [
|
|
60
|
+
_renderSlot(_ctx.$slots, "renderEmpty", {}, () => [
|
|
61
|
+
_createVNode(_unref(Empty))
|
|
62
|
+
])
|
|
63
|
+
]),
|
|
64
|
+
_: 3 /* FORWARDED */
|
|
65
|
+
}, 8 /* PROPS */, ["locale"])
|
|
66
|
+
]),
|
|
67
|
+
_: 3 /* FORWARDED */
|
|
68
|
+
}, 16 /* FULL_PROPS */))
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
})
|
|
73
|
+
export default __sfc_main__;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { configProviderProps } from 'ant-design-vue/es/config-provider/context'
|
|
2
|
+
|
|
3
|
+
export const configProps = () => ({
|
|
4
|
+
...configProviderProps(),
|
|
5
|
+
IconConfig: {
|
|
6
|
+
type: Object
|
|
7
|
+
},
|
|
8
|
+
MapConfig: {
|
|
9
|
+
type: Object
|
|
10
|
+
},
|
|
11
|
+
SearchConfig: {
|
|
12
|
+
type: Object
|
|
13
|
+
},
|
|
14
|
+
TableConfig: {
|
|
15
|
+
type: Object
|
|
16
|
+
},
|
|
17
|
+
PermissionButtonConfig: {
|
|
18
|
+
type: Object
|
|
19
|
+
},
|
|
20
|
+
FullPageConfig: {
|
|
21
|
+
reduceHeight: Number
|
|
22
|
+
},
|
|
23
|
+
componentsLocale: {
|
|
24
|
+
type: Object
|
|
25
|
+
}
|
|
26
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ConfigProvider as AntConfigProvider } from 'ant-design-vue'
|
|
2
|
+
import ConfigProvider from './ConfigProvider.js'
|
|
3
|
+
|
|
4
|
+
ConfigProvider.config = AntConfigProvider.config
|
|
5
|
+
ConfigProvider.install = function (app) {
|
|
6
|
+
app.component(ConfigProvider.name, ConfigProvider)
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default ConfigProvider
|