@meethive/components 0.0.3 → 0.0.4

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 +301 -418
  25. package/es/ProLayout/Basic/Header.js +91 -111
  26. package/es/ProLayout/PageContainer/index.js +267 -344
  27. package/es/ProLayout/SiderMenu/BaseMenu.js +186 -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 +301 -418
  80. package/lib/ProLayout/Basic/Header.js +91 -111
  81. package/lib/ProLayout/PageContainer/index.js +267 -344
  82. package/lib/ProLayout/SiderMenu/BaseMenu.js +186 -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,97 +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; }
2
- import { defineComponent, computed, useSlots } from 'vue'
3
- import { Table, Checkbox as ACheckbox } from 'ant-design-vue'
4
- import { get, omit } from 'lodash-es'
5
- import Empty from '../Empty'
6
- import { useTableInject } from './hooks'
7
- import useProTableStyle from './style'
8
- import { useLocaleReceiver } from '../LocaleReciver'
9
- import JVirtualTable from '../VirtualTable'
10
- import { _contentProps } from './setting'
11
-
12
- export default defineComponent({
13
- name: 'Content',
14
- components: {
15
- Table,
16
- ACheckbox,
17
- Empty,
18
- JVirtualTable
19
- },
20
- props: {
21
- ..._contentProps,
22
- column: {
23
- type: Number,
24
- default: 4
25
- }
26
- } ,
27
- setup(props) {
28
- const slots = useSlots()
29
- const [contextLocale] = useLocaleReceiver('ProTable')
30
- const prefixCls = computed(() => 'pro-table')
31
- const [wrapSSR, hashId] = useProTableStyle(prefixCls)
32
-
33
- const _rowSelection = useTableInject()
34
-
35
- const _columns = computed(() => props.columns.filter((i) => !_optionalChain([i, 'optionalAccess', _ => _.hideInTable])))
36
-
37
- const _slots = computed(() => {
38
- return omit(slots, ['emptyText', 'bodyCell'])
39
- })
40
-
41
- const _scroll = computed(() => {
42
- if (props.scroll === false) {
43
- return {
44
- x: undefined,
45
- y: undefined
46
- }
47
- }
48
- return {
49
- x: props.scroll.x === false ? undefined : props.scroll.x || '100%',
50
- y: props.scroll.y === false ? undefined : props.scroll.y || '100%'
51
- }
52
- })
53
-
54
- const gridTemplateColumns = computed(() => {
55
- return `repeat(${props.column}, 1fr)`
56
- })
57
-
58
- const __rowSelection = computed(() => {
59
- return props.rowSelection || _optionalChain([_rowSelection, 'optionalAccess', _2 => _2.value])
60
- })
61
-
62
- const indeterminate = computed(() => {
63
- return _optionalChain([__rowSelection, 'access', _3 => _3.value, 'optionalAccess', _4 => _4.selectedRowKeys, 'optionalAccess', _5 => _5.length]) > 0 && _optionalChain([__rowSelection, 'access', _6 => _6.value, 'optionalAccess', _7 => _7.selectedRowKeys, 'optionalAccess', _8 => _8.length]) < props.dataSource.length
64
- })
65
-
66
- const checkedAll = computed(() => {
67
- return _optionalChain([__rowSelection, 'access', _9 => _9.value, 'optionalAccess', _10 => _10.selectedRowKeys, 'optionalAccess', _11 => _11.length]) > 0 && _optionalChain([__rowSelection, 'access', _12 => _12.value, 'optionalAccess', _13 => _13.selectedRowKeys, 'optionalAccess', _14 => _14.length]) === props.dataSource.length
68
- })
69
-
70
- const onClick = (item) => {
71
- if (_rowSelection && _rowSelection.value) {
72
- const _selected = _optionalChain([_rowSelection, 'access', _15 => _15.value, 'access', _16 => _16.selectedRowKeys, 'optionalAccess', _17 => _17.includes, 'call', _18 => _18(item[props.rowKey])])
73
- _optionalChain([_rowSelection, 'access', _19 => _19.value, 'access', _20 => _20.onSelect, 'optionalCall', _21 => _21(item, !_selected)])
74
- }
75
- }
76
-
77
- const handleCheckedAllChange = (e) => {
78
- const flag = e.target.checked
79
- _optionalChain([__rowSelection, 'access', _22 => _22.value, 'optionalAccess', _23 => _23.onSelectAll, 'optionalCall', _24 => _24(flag, props.dataSource, props.dataSource)])
80
- }
81
-
82
- return {
83
- hashId,
84
- contextLocale,
85
- _columns,
86
- _slots,
87
- _scroll,
88
- gridTemplateColumns,
89
- __rowSelection,
90
- indeterminate,
91
- checkedAll,
92
- onClick,
93
- handleCheckedAllChange,
94
- get
95
- }
96
- }
97
- })
1
+ import { defineComponent, computed, useSlots } from 'vue';
2
+ import { Table, Checkbox as ACheckbox } from 'ant-design-vue';
3
+ import { get, omit } from 'lodash-es';
4
+ import Empty from '../Empty';
5
+ import { useTableInject } from './hooks';
6
+ import useProTableStyle from './style';
7
+ import { useLocaleReceiver } from '../LocaleReciver';
8
+ import JVirtualTable from '../VirtualTable';
9
+ import { _contentProps } from './setting';
10
+ export default defineComponent({
11
+ name: 'Content',
12
+ components: {
13
+ Table,
14
+ ACheckbox,
15
+ Empty,
16
+ JVirtualTable
17
+ },
18
+ props: {
19
+ ..._contentProps,
20
+ column: {
21
+ type: Number,
22
+ default: 4
23
+ }
24
+ },
25
+ setup(props) {
26
+ const slots = useSlots();
27
+ const [contextLocale] = useLocaleReceiver('ProTable');
28
+ const prefixCls = computed(() => 'pro-table');
29
+ const [wrapSSR, hashId] = useProTableStyle(prefixCls);
30
+ const _rowSelection = useTableInject();
31
+ const _columns = computed(() => props.columns.filter(i => !i?.hideInTable));
32
+ const _slots = computed(() => {
33
+ return omit(slots, ['emptyText', 'bodyCell']);
34
+ });
35
+ const _scroll = computed(() => {
36
+ if (props.scroll === false) {
37
+ return {
38
+ x: undefined,
39
+ y: undefined
40
+ };
41
+ }
42
+ return {
43
+ x: props.scroll.x === false ? undefined : props.scroll.x || '100%',
44
+ y: props.scroll.y === false ? undefined : props.scroll.y || '100%'
45
+ };
46
+ });
47
+ const gridTemplateColumns = computed(() => {
48
+ return `repeat(${props.column}, 1fr)`;
49
+ });
50
+ const __rowSelection = computed(() => {
51
+ return props.rowSelection || _rowSelection?.value;
52
+ });
53
+ const indeterminate = computed(() => {
54
+ return __rowSelection.value?.selectedRowKeys?.length > 0 && __rowSelection.value?.selectedRowKeys?.length < props.dataSource.length;
55
+ });
56
+ const checkedAll = computed(() => {
57
+ return __rowSelection.value?.selectedRowKeys?.length > 0 && __rowSelection.value?.selectedRowKeys?.length === props.dataSource.length;
58
+ });
59
+ const onClick = item => {
60
+ if (_rowSelection && _rowSelection.value) {
61
+ const _selected = _rowSelection.value.selectedRowKeys?.includes(item[props.rowKey]);
62
+ _rowSelection.value.onSelect?.(item, !_selected);
63
+ }
64
+ };
65
+ const handleCheckedAllChange = e => {
66
+ const flag = e.target.checked;
67
+ __rowSelection.value?.onSelectAll?.(flag, props.dataSource, props.dataSource);
68
+ };
69
+ return {
70
+ hashId,
71
+ contextLocale,
72
+ _columns,
73
+ _slots,
74
+ _scroll,
75
+ gridTemplateColumns,
76
+ __rowSelection,
77
+ indeterminate,
78
+ checkedAll,
79
+ onClick,
80
+ handleCheckedAllChange,
81
+ get
82
+ };
83
+ }
84
+ });
@@ -1,33 +1,32 @@
1
-
2
- import { defineComponent, computed } from 'vue'
3
- import { RadioGroup, RadioButton } from 'ant-design-vue'
4
- import AIcon from '../Icon'
5
- import { _headerProps } from './setting'
6
- import useProTableStyle from './style'
7
-
8
- export default defineComponent({
9
- name: 'Header',
10
- components: {
11
- RadioGroup,
12
- RadioButton,
13
- AIcon
14
- },
15
- props: {
16
- ..._headerProps,
17
- initMode: {
18
- type: [String, undefined] ,
19
- default: undefined
20
- }
21
- } ,
22
- emits: ['change'],
23
- setup(props, { emit }) {
24
- const emits = emit
25
- const prefixCls = computed(() => 'pro-table')
26
- const [wrapSSR, hashId] = useProTableStyle(prefixCls)
27
-
28
- return {
29
- hashId,
30
- emits
31
- }
32
- }
33
- })
1
+ import { defineComponent, computed } from 'vue';
2
+ import { RadioGroup, RadioButton } from 'ant-design-vue';
3
+ import AIcon from '../Icon';
4
+ import { _headerProps } from './setting';
5
+ import useProTableStyle from './style';
6
+ export default defineComponent({
7
+ name: 'Header',
8
+ components: {
9
+ RadioGroup,
10
+ RadioButton,
11
+ AIcon
12
+ },
13
+ props: {
14
+ ..._headerProps,
15
+ initMode: {
16
+ type: [String, undefined],
17
+ default: undefined
18
+ }
19
+ },
20
+ emits: ['change'],
21
+ setup(props, {
22
+ emit
23
+ }) {
24
+ const emits = emit;
25
+ const prefixCls = computed(() => 'pro-table');
26
+ const [wrapSSR, hashId] = useProTableStyle(prefixCls);
27
+ return {
28
+ hashId,
29
+ emits
30
+ };
31
+ }
32
+ });
@@ -1,55 +1,56 @@
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; }
2
- import { defineComponent, computed, h } from 'vue'
3
- import { Pagination, Spin } from 'ant-design-vue'
4
- import { _paginationProps } from './setting'
5
- import { useLocaleReceiver } from '../LocaleReciver'
6
- import useProTableStyle from './style'
7
-
8
- export default defineComponent({
9
- name: 'JPagination',
10
- components: {
11
- Pagination
12
- },
13
- props: { ..._paginationProps } ,
14
- emits: ['change'],
15
- setup(props, { emit }) {
16
- const [contextLocale] = useLocaleReceiver('ProTable')
17
- const prefixCls = computed(() => 'pro-table')
18
- const [wrapSSR, hashId] = useProTableStyle(prefixCls)
19
-
20
- const className = computed(() => {
21
- return {
22
- 'hide-content': !props.isShowContent
23
- }
24
- })
25
-
26
- const _showTotal = (num) => {
27
- const minSize = props.pageIndex * props.pageSize + 1
28
- const MaxSize = (props.pageIndex + 1) * props.pageSize
29
- let localePage = _optionalChain([contextLocale, 'access', _ => _.value, 'access', _2 => _2.pagination, 'optionalAccess', _3 => _3.page]) || ''
30
- let localeTotal = _optionalChain([contextLocale, 'access', _4 => _4.value, 'access', _5 => _5.pagination, 'optionalAccess', _6 => _6.total]) || ''
31
- const _maxSize = props.totalLoading ? MaxSize : (MaxSize > num ? num : MaxSize)
32
- ;[minSize, _maxSize].forEach((item, index) => {
33
- localePage = localePage.replace(`{${index}}`, item)
34
- })
35
- return h('span', {}, [
36
- localePage,
37
- props.totalLoading
38
- ? h(Spin, { size: 'small', style: { margin: '0 4px' } })
39
- : h('span', { style: { margin: '0 4px' } }, num),
40
- localeTotal
41
- ])
42
- }
43
-
44
- const onChange = (page, size) => {
45
- emit('change', page, size)
46
- }
47
-
48
- return {
49
- hashId,
50
- className,
51
- _showTotal,
52
- onChange
53
- }
54
- }
55
- })
1
+ import { defineComponent, computed, h } from 'vue';
2
+ import { Pagination, Spin } from 'ant-design-vue';
3
+ import { _paginationProps } from './setting';
4
+ import { useLocaleReceiver } from '../LocaleReciver';
5
+ import useProTableStyle from './style';
6
+ export default defineComponent({
7
+ name: 'JPagination',
8
+ components: {
9
+ Pagination
10
+ },
11
+ props: {
12
+ ..._paginationProps
13
+ },
14
+ emits: ['change'],
15
+ setup(props, {
16
+ emit
17
+ }) {
18
+ const [contextLocale] = useLocaleReceiver('ProTable');
19
+ const prefixCls = computed(() => 'pro-table');
20
+ const [wrapSSR, hashId] = useProTableStyle(prefixCls);
21
+ const className = computed(() => {
22
+ return {
23
+ 'hide-content': !props.isShowContent
24
+ };
25
+ });
26
+ const _showTotal = num => {
27
+ const minSize = props.pageIndex * props.pageSize + 1;
28
+ const MaxSize = (props.pageIndex + 1) * props.pageSize;
29
+ let localePage = contextLocale.value.pagination?.page || '';
30
+ let localeTotal = contextLocale.value.pagination?.total || '';
31
+ const _maxSize = props.totalLoading ? MaxSize : MaxSize > num ? num : MaxSize;
32
+ [minSize, _maxSize].forEach((item, index) => {
33
+ localePage = localePage.replace(`{${index}}`, item);
34
+ });
35
+ return h('span', {}, [localePage, props.totalLoading ? h(Spin, {
36
+ size: 'small',
37
+ style: {
38
+ margin: '0 4px'
39
+ }
40
+ }) : h('span', {
41
+ style: {
42
+ margin: '0 4px'
43
+ }
44
+ }, num), localeTotal]);
45
+ };
46
+ const onChange = (page, size) => {
47
+ emit('change', page, size);
48
+ };
49
+ return {
50
+ hashId,
51
+ className,
52
+ _showTotal,
53
+ onChange
54
+ };
55
+ }
56
+ });