@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.
Files changed (111) hide show
  1. package/es/AutoComplete/AutoComplete.js +71 -80
  2. package/es/BadgeStatus/Badge.js +38 -47
  3. package/es/CardSelect/CardSelect.js +115 -137
  4. package/es/CheckButton/CheckButton.js +102 -118
  5. package/es/ConfigProvider/ConfigProvider.js +44 -68
  6. package/es/DragModal/DragModal.js +191 -212
  7. package/es/EditTable/Body.js +158 -189
  8. package/es/EditTable/CellRender.js +10 -12
  9. package/es/EditTable/EditTable.js +385 -434
  10. package/es/EditTable/FormItem.js +140 -169
  11. package/es/EditTable/Group.js +171 -204
  12. package/es/EditTable/Header.js +57 -63
  13. package/es/EditTable/HeaderRender.js +10 -12
  14. package/es/EditTable/components/ContextMenu/Menu.js +78 -86
  15. package/es/EditTable/components/Search/Search.js +151 -163
  16. package/es/EditTable/components/Search/Sort.js +104 -119
  17. package/es/Ellipsis/Ellipsis.js +144 -148
  18. package/es/Empty/Empty.js +51 -57
  19. package/es/FullPage/FullPage.js +20 -19
  20. package/es/Icon/Icon.js +42 -49
  21. package/es/LocaleProvider/LocaleProvider.js +32 -38
  22. package/es/Markdown/Markdown.js +101 -118
  23. package/es/PermissionButton/PermissionButton.js +118 -118
  24. package/es/ProLayout/Basic/BasicLayout.js +361 -418
  25. package/es/ProLayout/Basic/Header.js +97 -111
  26. package/es/ProLayout/PageContainer/index.js +298 -344
  27. package/es/ProLayout/SiderMenu/BaseMenu.js +233 -240
  28. package/es/ProTable/Alert.js +39 -40
  29. package/es/ProTable/Content.js +84 -97
  30. package/es/ProTable/Header.js +32 -33
  31. package/es/ProTable/Pagination.js +56 -55
  32. package/es/ProTable/ProTable.js +256 -276
  33. package/es/RadioButton/RadioButton.js +48 -53
  34. package/es/Scrollbar/Bar.js +65 -76
  35. package/es/Scrollbar/Scrollbar.js +129 -161
  36. package/es/Scrollbar/Thumb.js +101 -150
  37. package/es/Search/Item.js +208 -236
  38. package/es/Search/Search.js +90 -90
  39. package/es/Skeleton/Skeleton.js +26 -27
  40. package/es/Skeleton/components/DashBoardCard.js +26 -27
  41. package/es/Skeleton/components/DashBoardChart.js +26 -27
  42. package/es/Skeleton/components/Detail.js +26 -27
  43. package/es/Skeleton/components/Drawer.js +26 -27
  44. package/es/Skeleton/components/Item.js +55 -54
  45. package/es/Skeleton/components/List.js +29 -27
  46. package/es/Skeleton/components/ListCard.js +28 -28
  47. package/es/Skeleton/components/ListCardItem.js +20 -20
  48. package/es/Skeleton/components/ListTable.js +26 -27
  49. package/es/Skeleton/components/Page.js +27 -26
  50. package/es/Skeleton/components/Search.js +16 -16
  51. package/es/Skeleton/components/Tree.js +26 -27
  52. package/es/TimeFormat/TimeFormat.js +32 -36
  53. package/es/Title/Title.js +23 -26
  54. package/es/ValueItem/ValueItem.js +100 -113
  55. package/es/VirtualTable/VirtualTable.js +235 -271
  56. package/lib/AutoComplete/AutoComplete.js +71 -80
  57. package/lib/BadgeStatus/Badge.js +38 -47
  58. package/lib/CardSelect/CardSelect.js +115 -137
  59. package/lib/CheckButton/CheckButton.js +102 -118
  60. package/lib/ConfigProvider/ConfigProvider.js +44 -68
  61. package/lib/DragModal/DragModal.js +191 -212
  62. package/lib/EditTable/Body.js +158 -189
  63. package/lib/EditTable/CellRender.js +10 -12
  64. package/lib/EditTable/EditTable.js +385 -434
  65. package/lib/EditTable/FormItem.js +140 -169
  66. package/lib/EditTable/Group.js +171 -204
  67. package/lib/EditTable/Header.js +57 -63
  68. package/lib/EditTable/HeaderRender.js +10 -12
  69. package/lib/EditTable/components/ContextMenu/Menu.js +78 -86
  70. package/lib/EditTable/components/Search/Search.js +151 -163
  71. package/lib/EditTable/components/Search/Sort.js +104 -119
  72. package/lib/Ellipsis/Ellipsis.js +144 -148
  73. package/lib/Empty/Empty.js +51 -57
  74. package/lib/FullPage/FullPage.js +20 -19
  75. package/lib/Icon/Icon.js +42 -49
  76. package/lib/LocaleProvider/LocaleProvider.js +32 -38
  77. package/lib/Markdown/Markdown.js +101 -118
  78. package/lib/PermissionButton/PermissionButton.js +118 -118
  79. package/lib/ProLayout/Basic/BasicLayout.js +361 -418
  80. package/lib/ProLayout/Basic/Header.js +97 -111
  81. package/lib/ProLayout/PageContainer/index.js +298 -344
  82. package/lib/ProLayout/SiderMenu/BaseMenu.js +233 -240
  83. package/lib/ProTable/Alert.js +39 -40
  84. package/lib/ProTable/Content.js +84 -97
  85. package/lib/ProTable/Header.js +32 -33
  86. package/lib/ProTable/Pagination.js +56 -55
  87. package/lib/ProTable/ProTable.js +256 -276
  88. package/lib/RadioButton/RadioButton.js +48 -53
  89. package/lib/Scrollbar/Bar.js +65 -76
  90. package/lib/Scrollbar/Scrollbar.js +129 -161
  91. package/lib/Scrollbar/Thumb.js +101 -150
  92. package/lib/Search/Item.js +208 -236
  93. package/lib/Search/Search.js +90 -90
  94. package/lib/Skeleton/Skeleton.js +26 -27
  95. package/lib/Skeleton/components/DashBoardCard.js +26 -27
  96. package/lib/Skeleton/components/DashBoardChart.js +26 -27
  97. package/lib/Skeleton/components/Detail.js +26 -27
  98. package/lib/Skeleton/components/Drawer.js +26 -27
  99. package/lib/Skeleton/components/Item.js +55 -54
  100. package/lib/Skeleton/components/List.js +29 -27
  101. package/lib/Skeleton/components/ListCard.js +28 -28
  102. package/lib/Skeleton/components/ListCardItem.js +20 -20
  103. package/lib/Skeleton/components/ListTable.js +26 -27
  104. package/lib/Skeleton/components/Page.js +27 -26
  105. package/lib/Skeleton/components/Search.js +16 -16
  106. package/lib/Skeleton/components/Tree.js +26 -27
  107. package/lib/TimeFormat/TimeFormat.js +32 -36
  108. package/lib/Title/Title.js +23 -26
  109. package/lib/ValueItem/ValueItem.js +100 -113
  110. package/lib/VirtualTable/VirtualTable.js +235 -271
  111. package/package.json +1 -1
@@ -1,122 +1,106 @@
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
-
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
+ const _hoisted_1 = ["onClick"];
4
+ import { computed, ref, watch } from 'vue';
5
+ import { isArray } from '@meethive/utils';
6
+ import useCheckButtonStyle from './style';
7
+ import { Form } from 'ant-design-vue';
12
8
  const __sfc_main__ = _defineComponent({
13
- ...{
14
- name: 'JCheckButton'
15
- },
9
+ ...{
10
+ name: 'JCheckButton'
11
+ },
16
12
  __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
- },
13
+ props: {
14
+ value: {
15
+ type: [String, Array],
16
+ default: undefined
17
+ },
18
+ options: {
19
+ type: Array,
20
+ default: () => []
21
+ },
22
+ multiple: {
23
+ type: Boolean,
24
+ default: false
25
+ },
26
+ disabled: {
27
+ type: Boolean,
28
+ default: false
29
+ },
30
+ class: {
31
+ type: String,
32
+ default: undefined
33
+ },
34
+ style: {
35
+ type: Object,
36
+ default: () => ({})
37
+ }
38
+ },
43
39
  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
- })
40
+ setup(__props, {
41
+ emit: __emit
42
+ }) {
43
+ const props = __props;
44
+ const emit = __emit;
45
+ const prefixCls = computed(() => 'j-check-button');
46
+ const [wrapSSR, hashId] = useCheckButtonStyle(prefixCls);
47
+ const formItemContext = Form.useInjectFormItemContext();
48
+ const myValue = ref();
49
+ const optionsMap = ref(new Map());
50
+ const _options = computed(() => {
51
+ props.options.forEach(item => {
52
+ if (props.disabled) {
53
+ item.disabled = props.disabled;
54
+ }
55
+ optionsMap.value.set(item.value, item);
56
+ });
57
+ return props.options;
58
+ });
59
+ watch(() => props.value, () => {
60
+ if (props.value) {
61
+ myValue.value = isArray(props.value) ? props.value : [props.value];
62
+ } else {
63
+ myValue.value = [];
64
+ }
65
+ }, {
66
+ immediate: true,
67
+ deep: true
68
+ });
69
+ const selected = (key, disabled) => {
70
+ if (disabled) return;
71
+ const values = new Set(myValue.value);
72
+ if (values.has(key)) {
73
+ values.delete(key);
74
+ } else {
75
+ if (!props.multiple) {
76
+ values.clear();
77
+ }
78
+ values.add(key);
79
+ }
80
+ myValue.value = [...values.values()];
81
+ const optionsItems = myValue.value.map(_key => {
82
+ return optionsMap.value.get(_key);
83
+ });
84
+ const _value = props.multiple ? myValue.value : myValue.value[0];
85
+ emit('update:value', _value);
86
+ emit('change', _value, props.multiple ? optionsItems : optionsItems[0]);
87
+ emit('select', _value, props.multiple ? optionsItems : optionsItems[0]);
88
+ formItemContext.onFieldChange();
89
+ };
90
+ return (_ctx, _cache) => {
91
+ return _openBlock(), _createElementBlock("div", {
92
+ class: _normalizeClass(['j-check-button', props.class, _unref(hashId)]),
93
+ style: _normalizeStyle(props.style)
94
+ }, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_options.value, item => {
95
+ return _openBlock(), _createElementBlock("div", {
96
+ key: item.value,
97
+ class: _normalizeClass(['j-check-button-item', myValue.value.includes(item.value) ? 'selected' : '', item.disabled ? 'disabled' : '', _unref(hashId)]),
98
+ onClick: () => {
99
+ selected(item.value, item.disabled);
100
+ }
101
+ }, _toDisplayString(item.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_1);
102
+ }), 128 /* KEYED_FRAGMENT */))], 6 /* CLASS, STYLE */);
103
+ };
104
+ }
105
+ });
122
106
  export default __sfc_main__;
@@ -1,73 +1,49 @@
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 as AConfigProvider } 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
-
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
+ import { provide, reactive } from 'vue';
4
+ import { ConfigProvider as AConfigProvider } from 'ant-design-vue';
5
+ import { omit } from 'lodash-es';
6
+ import { configProps } from './context';
7
+ import { ComponentsEnum, MAPConfig, PermissionButtonConfig, SearchConfig, FullPageConfig, TableConfig } from '../utils/constants';
8
+ import LocaleProvider from '../LocaleProvider/index';
9
+ import Empty from '../Empty/index';
10
+ import zh from '../locale/zh-CN';
21
11
  const __sfc_main__ = _defineComponent({
22
- ...{
23
- name: 'JConfigProvider',
24
- inheritAttrs: false
25
- },
12
+ ...{
13
+ name: 'JConfigProvider',
14
+ inheritAttrs: false
15
+ },
26
16
  __name: 'ConfigProvider',
27
- props: { ...configProps() },
17
+ props: {
18
+ ...configProps()
19
+ },
28
20
  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(AConfigProvider), _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
- ]),
21
+ const props = __props;
22
+ const _iconConfig = reactive(props.IconConfig || {});
23
+ const _mapConfig = reactive(props.MapConfig || {});
24
+ const _searchConfig = reactive(props.SearchConfig || {});
25
+ const _PermissionButtonConfig = reactive(props.PermissionButtonConfig || {});
26
+ const _FullPageConfig = reactive(props.FullPageConfig || {});
27
+ const _TableConfig = reactive(props.TableConfig || {});
28
+ provide(ComponentsEnum.Icon, _iconConfig);
29
+ provide(MAPConfig, _mapConfig);
30
+ provide(SearchConfig, _searchConfig);
31
+ provide(PermissionButtonConfig, _PermissionButtonConfig);
32
+ provide(FullPageConfig, _FullPageConfig);
33
+ provide(TableConfig, _TableConfig);
34
+ const configProviderProps = omit(props, ['IconConfig', 'MapConfig', 'SearchConfig']);
35
+ return (_ctx, _cache) => {
36
+ return _openBlock(), _createBlock(_unref(AConfigProvider), _normalizeProps(_guardReactiveProps(_unref(configProviderProps))), {
37
+ default: _withCtx(() => [_createVNode(_unref(LocaleProvider), {
38
+ locale: _ctx.componentsLocale || _unref(zh)
39
+ }, {
40
+ default: _withCtx(() => [_renderSlot(_ctx.$slots, "default")]),
41
+ renderEmpty: _withCtx(() => [_renderSlot(_ctx.$slots, "renderEmpty", {}, () => [_createVNode(_unref(Empty))])]),
42
+ _: 3 /* FORWARDED */
43
+ }, 8 /* PROPS */, ["locale"])]),
64
44
  _: 3 /* FORWARDED */
65
- }, 8 /* PROPS */, ["locale"])
66
- ]),
67
- _: 3 /* FORWARDED */
68
- }, 16 /* FULL_PROPS */))
69
- }
70
- }
71
-
72
- })
45
+ }, 16 /* FULL_PROPS */);
46
+ };
47
+ }
48
+ });
73
49
  export default __sfc_main__;