@meethive/components 0.0.2 → 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 +38 -31
  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 +38 -31
  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,16 +1,16 @@
1
-
2
- import { defineComponent } from 'vue'
3
- import Item from './Item.js'
4
-
5
- export default defineComponent({
6
- components: { Item },
7
- props: {
8
- active: {
9
- type: Boolean,
10
- default: true
11
- }
12
- },
13
- setup(props) {
14
- return {}
15
- }
16
- })
1
+ import { defineComponent } from 'vue';
2
+ import Item from './Item.js';
3
+ export default defineComponent({
4
+ components: {
5
+ Item
6
+ },
7
+ props: {
8
+ active: {
9
+ type: Boolean,
10
+ default: true
11
+ }
12
+ },
13
+ setup(props) {
14
+ return {};
15
+ }
16
+ });
@@ -1,27 +1,26 @@
1
-
2
- import { defineComponent, computed } from 'vue'
3
- import Item from './Item.js'
4
- import useSkeletonStyle from '../style'
5
-
6
- export default defineComponent({
7
- name: 'JSkeletonTree',
8
- components: { Item },
9
- props: {
10
- active: {
11
- type: Boolean,
12
- default: true
13
- },
14
- loading: {
15
- type: Boolean,
16
- default: true
17
- }
18
- },
19
- setup(props) {
20
- const prefixCls = computed(() => 'j-skeleton')
21
- const [wrapSSR, hashId] = useSkeletonStyle(prefixCls)
22
-
23
- return {
24
- hashId
25
- }
26
- }
27
- })
1
+ import { defineComponent, computed } from 'vue';
2
+ import Item from './Item.js';
3
+ import useSkeletonStyle from '../style';
4
+ export default defineComponent({
5
+ name: 'JSkeletonTree',
6
+ components: {
7
+ Item
8
+ },
9
+ props: {
10
+ active: {
11
+ type: Boolean,
12
+ default: true
13
+ },
14
+ loading: {
15
+ type: Boolean,
16
+ default: true
17
+ }
18
+ },
19
+ setup(props) {
20
+ const prefixCls = computed(() => 'j-skeleton');
21
+ const [wrapSSR, hashId] = useSkeletonStyle(prefixCls);
22
+ return {
23
+ hashId
24
+ };
25
+ }
26
+ });
@@ -1,36 +1,32 @@
1
-
2
- import { defineComponent, computed } from 'vue'
3
- import dayjs from 'dayjs'
4
-
5
- export default defineComponent({
6
- name: 'JTimeFormat',
7
- props: {
8
- time: {
9
- type: [String, Number, undefined]
10
- },
11
- format: {
12
- type: String
13
- }
14
- },
15
- setup(props) {
16
- const handleValue = (time, format) => {
17
- const value = Number(time)
18
- const _format = format || 'YYYY-MM-DD HH:mm:ss'
19
- if (!isNaN(value)) {
20
- return dayjs(value).format(_format)
21
- }
22
- return time
23
- }
24
-
25
- const timeFormat = computed(() => {
26
- if (props.time) {
27
- return handleValue(props.time, props.format)
28
- }
29
- return props.time
30
- })
31
-
32
- return {
33
- timeFormat
34
- }
35
- }
36
- })
1
+ import { defineComponent, computed } from 'vue';
2
+ import dayjs from 'dayjs';
3
+ export default defineComponent({
4
+ name: 'JTimeFormat',
5
+ props: {
6
+ time: {
7
+ type: [String, Number, undefined]
8
+ },
9
+ format: {
10
+ type: String
11
+ }
12
+ },
13
+ setup(props) {
14
+ const handleValue = (time, format) => {
15
+ const value = Number(time);
16
+ const _format = format || 'YYYY-MM-DD HH:mm:ss';
17
+ if (!isNaN(value)) {
18
+ return dayjs(value).format(_format);
19
+ }
20
+ return time;
21
+ };
22
+ const timeFormat = computed(() => {
23
+ if (props.time) {
24
+ return handleValue(props.time, props.format);
25
+ }
26
+ return props.time;
27
+ });
28
+ return {
29
+ timeFormat
30
+ };
31
+ }
32
+ });
package/es/Title/Title.js CHANGED
@@ -1,26 +1,23 @@
1
-
2
- import { defineComponent, computed } from 'vue'
3
- import useTitleStyle from './style'
4
-
5
- export default defineComponent({
6
- name: 'JTitle',
7
- props: {
8
- data: {
9
- type: String,
10
- default: ''
11
- },
12
- style: {
13
- type: Object,
14
- default: () => ({})
15
- }
16
- },
17
- setup(props) {
18
- const prefixCls = computed(() => 'j-title')
19
- const [wrapSSR, hashId] = useTitleStyle(prefixCls)
20
-
21
- return {
22
- prefixCls,
23
- hashId
24
- }
25
- }
26
- })
1
+ import { defineComponent, computed } from 'vue';
2
+ import useTitleStyle from './style';
3
+ export default defineComponent({
4
+ name: 'JTitle',
5
+ props: {
6
+ data: {
7
+ type: String,
8
+ default: ''
9
+ },
10
+ style: {
11
+ type: Object,
12
+ default: () => ({})
13
+ }
14
+ },
15
+ setup(props) {
16
+ const prefixCls = computed(() => 'j-title');
17
+ const [wrapSSR, hashId] = useTitleStyle(prefixCls);
18
+ return {
19
+ prefixCls,
20
+ hashId
21
+ };
22
+ }
23
+ });
@@ -1,113 +1,100 @@
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, ref, watch, computed } from 'vue'
3
- import { componentsType } from './util'
4
- import {
5
- Select,
6
- DatePicker,
7
- TimePicker,
8
- Input,
9
- InputNumber,
10
- InputPassword,
11
- Upload,
12
- } from 'ant-design-vue'
13
- import { omit } from 'lodash-es'
14
-
15
- export default defineComponent({
16
- name: 'JValueItem',
17
- components: {
18
- Select,
19
- DatePicker,
20
- TimePicker,
21
- Input,
22
- InputNumber,
23
- InputPassword,
24
- Upload,
25
- },
26
- props: {
27
- // 组件双向绑定的值
28
- modelValue: {
29
- type: [Number, String],
30
- default: '',
31
- },
32
- // 组件类型
33
- itemType: {
34
- type: String,
35
- default: 'string',
36
- },
37
- // 多选框
38
- mode: {
39
- type: String,
40
- default: undefined,
41
- },
42
- placeholder: String,
43
- options: Array,
44
- style: Object,
45
- class: String,
46
- valueFormat: String,
47
- action: [String, Promise] ,
48
- headers: Object,
49
- disabled: Boolean,
50
- extraProps: {
51
- type: Object,
52
- default: () => ({})
53
- },
54
- handleFileChange: {
55
- type: Function,
56
- }
57
- },
58
- emits: ['update:modelValue', 'change'],
59
- setup(props, { emit }) {
60
- const typeMap = new Map(Object.entries(componentsType))
61
- const myValue = ref(undefined)
62
- const objectValue = ref('')
63
-
64
- const bindProps = computed(() => {
65
- return Object.assign(omit(props, ['extraProps']), props.extraProps)
66
- })
67
-
68
- const handleItemModalSubmit = () => {
69
- myValue.value = objectValue.value.replace(/[\r\n]\s*/g, '')
70
- emit('update:modelValue', objectValue.value)
71
- emit('change', objectValue.value)
72
- }
73
-
74
- const onChange = (e) => {
75
- emit('update:modelValue', myValue.value)
76
- emit('change', e && e.target ? e.target.value : e)
77
- }
78
-
79
- const monacoCancel = () => {
80
- objectValue.value = props.modelValue
81
- }
82
-
83
- const handleFileChangeInternal = async (info) => {
84
- if (info.file.status === 'done') {
85
- let url = _optionalChain([info, 'optionalAccess', _ => _.file, 'optionalAccess', _2 => _2.response, 'optionalAccess', _3 => _3.result, 'optionalAccess', _4 => _4.accessUrl])
86
- if (props.handleFileChange) {
87
- url = await props.handleFileChange(info, info.file.response)
88
- }
89
- myValue.value = url
90
- emit('update:modelValue', url)
91
- emit('change', url)
92
- }
93
- }
94
-
95
- watch(() => props.modelValue, () => {
96
- myValue.value = props.modelValue
97
- if (props.itemType === 'object') {
98
- objectValue.value = props.modelValue
99
- }
100
- }, { immediate: true })
101
-
102
- return {
103
- typeMap,
104
- myValue,
105
- objectValue,
106
- bindProps,
107
- handleItemModalSubmit,
108
- onChange,
109
- monacoCancel,
110
- handleFileChangeInternal,
111
- }
112
- }
113
- })
1
+ import { defineComponent, ref, watch, computed } from 'vue';
2
+ import { componentsType } from './util';
3
+ import { Select, DatePicker, TimePicker, Input, InputNumber, InputPassword, Upload } from 'ant-design-vue';
4
+ import { omit } from 'lodash-es';
5
+ export default defineComponent({
6
+ name: 'JValueItem',
7
+ components: {
8
+ Select,
9
+ DatePicker,
10
+ TimePicker,
11
+ Input,
12
+ InputNumber,
13
+ InputPassword,
14
+ Upload
15
+ },
16
+ props: {
17
+ // 组件双向绑定的值
18
+ modelValue: {
19
+ type: [Number, String],
20
+ default: ''
21
+ },
22
+ // 组件类型
23
+ itemType: {
24
+ type: String,
25
+ default: 'string'
26
+ },
27
+ // 多选框
28
+ mode: {
29
+ type: String,
30
+ default: undefined
31
+ },
32
+ placeholder: String,
33
+ options: Array,
34
+ style: Object,
35
+ class: String,
36
+ valueFormat: String,
37
+ action: [String, Promise],
38
+ headers: Object,
39
+ disabled: Boolean,
40
+ extraProps: {
41
+ type: Object,
42
+ default: () => ({})
43
+ },
44
+ handleFileChange: {
45
+ type: Function
46
+ }
47
+ },
48
+ emits: ['update:modelValue', 'change'],
49
+ setup(props, {
50
+ emit
51
+ }) {
52
+ const typeMap = new Map(Object.entries(componentsType));
53
+ const myValue = ref(undefined);
54
+ const objectValue = ref('');
55
+ const bindProps = computed(() => {
56
+ return Object.assign(omit(props, ['extraProps']), props.extraProps);
57
+ });
58
+ const handleItemModalSubmit = () => {
59
+ myValue.value = objectValue.value.replace(/[\r\n]\s*/g, '');
60
+ emit('update:modelValue', objectValue.value);
61
+ emit('change', objectValue.value);
62
+ };
63
+ const onChange = e => {
64
+ emit('update:modelValue', myValue.value);
65
+ emit('change', e && e.target ? e.target.value : e);
66
+ };
67
+ const monacoCancel = () => {
68
+ objectValue.value = props.modelValue;
69
+ };
70
+ const handleFileChangeInternal = async info => {
71
+ if (info.file.status === 'done') {
72
+ let url = info?.file?.response?.result?.accessUrl;
73
+ if (props.handleFileChange) {
74
+ url = await props.handleFileChange(info, info.file.response);
75
+ }
76
+ myValue.value = url;
77
+ emit('update:modelValue', url);
78
+ emit('change', url);
79
+ }
80
+ };
81
+ watch(() => props.modelValue, () => {
82
+ myValue.value = props.modelValue;
83
+ if (props.itemType === 'object') {
84
+ objectValue.value = props.modelValue;
85
+ }
86
+ }, {
87
+ immediate: true
88
+ });
89
+ return {
90
+ typeMap,
91
+ myValue,
92
+ objectValue,
93
+ bindProps,
94
+ handleItemModalSubmit,
95
+ onChange,
96
+ monacoCancel,
97
+ handleFileChangeInternal
98
+ };
99
+ }
100
+ });