@dfsj/components 3.0.0
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/CHANGELOG.md +203 -0
- package/LICENSE +22 -0
- package/README.md +27 -0
- package/dist/components/Boards/index.d.ts +4 -0
- package/dist/components/Boards/src/Boards.vue.d.ts +33 -0
- package/dist/components/Boards/src/Boards.vue.js +5 -0
- package/dist/components/Boards/src/Boards.vue2.js +113 -0
- package/dist/components/Boards/src/props.d.ts +27 -0
- package/dist/components/Boards/src/props.js +18 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/src/composables/use-month-range-header.d.ts +16 -0
- package/dist/components/DatePicker/src/composables/use-month-range-header.js +52 -0
- package/dist/components/DatePicker/src/composables/use-range-picker.d.ts +100 -0
- package/dist/components/DatePicker/src/composables/use-range-picker.js +99 -0
- package/dist/components/DatePicker/src/date-picker-com/panel-date-range.vue.d.ts +19 -0
- package/dist/components/DatePicker/src/date-picker-com/panel-date-range.vue.js +5 -0
- package/dist/components/DatePicker/src/date-picker-com/panel-date-range.vue2.js +564 -0
- package/dist/components/DatePicker/src/date-picker-com/panel-month-range.vue.d.ts +16 -0
- package/dist/components/DatePicker/src/date-picker-com/panel-month-range.vue.js +5 -0
- package/dist/components/DatePicker/src/date-picker-com/panel-month-range.vue2.js +210 -0
- package/dist/components/DatePicker/src/index.d.ts +196 -0
- package/dist/components/DatePicker/src/index.js +87 -0
- package/dist/components/DatePicker/src/panel-utils.d.ts +2 -0
- package/dist/components/DatePicker/src/panel-utils.js +25 -0
- package/dist/components/Editor/index.d.ts +6 -0
- package/dist/components/Editor/src/Editor.vue.d.ts +50 -0
- package/dist/components/Editor/src/Editor.vue.js +5 -0
- package/dist/components/Editor/src/Editor.vue2.js +138 -0
- package/dist/components/Form/index.d.ts +16 -0
- package/dist/components/Form/src/Form.vue.d.ts +164 -0
- package/dist/components/Form/src/Form.vue.js +5 -0
- package/dist/components/Form/src/Form.vue2.js +378 -0
- package/dist/components/Form/src/components/useRenderCheckbox.d.ts +4 -0
- package/dist/components/Form/src/components/useRenderCheckbox.js +33 -0
- package/dist/components/Form/src/components/useRenderRadio.d.ts +4 -0
- package/dist/components/Form/src/components/useRenderRadio.js +33 -0
- package/dist/components/Form/src/components/useRenderSelect.d.ts +4 -0
- package/dist/components/Form/src/components/useRenderSelect.js +52 -0
- package/dist/components/Form/src/helper/componentMap.d.ts +5 -0
- package/dist/components/Form/src/helper/componentMap.js +35 -0
- package/dist/components/Form/src/helper/index.d.ts +7 -0
- package/dist/components/Form/src/helper/index.js +109 -0
- package/dist/components/Form/src/types/index.d.ts +533 -0
- package/dist/components/Form/src/types/index.js +31 -0
- package/dist/components/Form/src/useForm.d.ts +1 -0
- package/dist/components/Form/src/useForm.js +290 -0
- package/dist/components/Highlight/index.d.ts +2 -0
- package/dist/components/Highlight/src/Highlight.vue.d.ts +41 -0
- package/dist/components/Highlight/src/Highlight.vue.js +5 -0
- package/dist/components/Highlight/src/Highlight.vue2.js +62 -0
- package/dist/components/Icon/index.d.ts +3 -0
- package/dist/components/Icon/src/Icon.vue.d.ts +49 -0
- package/dist/components/Icon/src/Icon.vue.js +5 -0
- package/dist/components/Icon/src/Icon.vue2.js +123 -0
- package/dist/components/Icon/src/SvgIcon.vue.d.ts +45 -0
- package/dist/components/Icon/src/SvgIcon.vue.js +7 -0
- package/dist/components/Icon/src/SvgIcon.vue2.js +45 -0
- package/dist/components/Icon/src/SvgIcon.vue3.js +14 -0
- package/dist/components/InputPassword/index.d.ts +2 -0
- package/dist/components/InputPassword/src/InputPassword.vue.d.ts +27 -0
- package/dist/components/InputPassword/src/InputPassword.vue.js +5 -0
- package/dist/components/InputPassword/src/InputPassword.vue2.js +58 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/Modal/src/BasicModal.vue.d.ts +280 -0
- package/dist/components/Modal/src/BasicModal.vue.js +5 -0
- package/dist/components/Modal/src/BasicModal.vue2.js +150 -0
- package/dist/components/Modal/src/components/ModalFooter.vue.d.ts +86 -0
- package/dist/components/Modal/src/components/ModalFooter.vue.js +5 -0
- package/dist/components/Modal/src/components/ModalFooter.vue2.js +30 -0
- package/dist/components/Modal/src/components/ModalHeader.vue.d.ts +142 -0
- package/dist/components/Modal/src/components/ModalHeader.vue.js +5 -0
- package/dist/components/Modal/src/components/ModalHeader.vue2.js +63 -0
- package/dist/components/Modal/src/config.d.ts +24 -0
- package/dist/components/Modal/src/config.js +25 -0
- package/dist/components/Modal/src/hooks/useModalDrag.d.ts +24 -0
- package/dist/components/Modal/src/hooks/useModalDrag.js +108 -0
- package/dist/components/Modal/src/hooks/useTimeout.d.ts +15 -0
- package/dist/components/Modal/src/hooks/useTimeout.js +53 -0
- package/dist/components/Modal/src/props.d.ts +131 -0
- package/dist/components/Modal/src/props.js +107 -0
- package/dist/components/Modal/src/utils/index.d.ts +3 -0
- package/dist/components/Modal/src/utils/index.js +86 -0
- package/dist/components/Stateful/index.d.ts +4 -0
- package/dist/components/Stateful/src/State.d.ts +20 -0
- package/dist/components/Stateful/src/State.js +82 -0
- package/dist/components/Stateful/src/Stateful.vue.d.ts +44 -0
- package/dist/components/Stateful/src/Stateful.vue.js +5 -0
- package/dist/components/Stateful/src/Stateful.vue2.js +46 -0
- package/dist/components/Stateful/src/props.d.ts +39 -0
- package/dist/components/Stateful/src/props.js +29 -0
- package/dist/components/Table/index.d.ts +14 -0
- package/dist/components/Table/src/Table.vue.d.ts +537 -0
- package/dist/components/Table/src/Table.vue.js +5 -0
- package/dist/components/Table/src/Table.vue2.js +582 -0
- package/dist/components/Table/src/components/ColumnSetting.vue.d.ts +30 -0
- package/dist/components/Table/src/components/ColumnSetting.vue.js +5 -0
- package/dist/components/Table/src/components/ColumnSetting.vue2.js +264 -0
- package/dist/components/Table/src/components/TableActions.vue.d.ts +20 -0
- package/dist/components/Table/src/components/TableActions.vue.js +5 -0
- package/dist/components/Table/src/components/TableActions.vue2.js +108 -0
- package/dist/components/Table/src/helper/index.d.ts +2 -0
- package/dist/components/Table/src/helper/index.js +11 -0
- package/dist/components/Table/src/types/index.d.ts +87 -0
- package/dist/components/Table/src/useTable.d.ts +1 -0
- package/dist/components/Table/src/useTable.js +284 -0
- package/dist/components/UnifyChart/index.d.ts +4 -0
- package/dist/components/UnifyChart/src/ChartToolbox.vue.d.ts +63 -0
- package/dist/components/UnifyChart/src/ChartToolbox.vue.js +5 -0
- package/dist/components/UnifyChart/src/ChartToolbox.vue2.js +83 -0
- package/dist/components/UnifyChart/src/UnifyChart.vue.d.ts +185 -0
- package/dist/components/UnifyChart/src/UnifyChart.vue.js +5 -0
- package/dist/components/UnifyChart/src/UnifyChart.vue2.js +54 -0
- package/dist/components/UnifyChart/src/hooks/useLoader.d.ts +11 -0
- package/dist/components/UnifyChart/src/hooks/useRender.d.ts +24 -0
- package/dist/components/UnifyChart/src/hooks/useRender.js +49 -0
- package/dist/components/UnifyChart/src/props.d.ts +145 -0
- package/dist/components/UnifyChart/src/props.js +33 -0
- package/dist/components/Video/index.d.ts +2 -0
- package/dist/components/Video/src/VideoPlayer.vue.d.ts +60 -0
- package/dist/components/Video/src/VideoPlayer.vue.js +5 -0
- package/dist/components/Video/src/VideoPlayer.vue2.js +107 -0
- package/dist/components/Video/src/VideoPlayerToolbar.vue.d.ts +34 -0
- package/dist/components/Video/src/VideoPlayerToolbar.vue.js +5 -0
- package/dist/components/Video/src/VideoPlayerToolbar.vue2.js +65 -0
- package/dist/components/Video/src/abstract/AbstractVideoControl.d.ts +7 -0
- package/dist/components/Video/src/abstract/Observable.d.ts +6 -0
- package/dist/components/Video/src/abstract/Observable.js +89 -0
- package/dist/components/Video/src/abstract/VideoControl.d.ts +32 -0
- package/dist/components/Video/src/abstract/VideoControl.js +50 -0
- package/dist/components/Video/src/control/DaHua.d.ts +12 -0
- package/dist/components/Video/src/control/DaHua.js +156 -0
- package/dist/components/Video/src/control/Hikvision.d.ts +28 -0
- package/dist/components/Video/src/control/Hikvision.js +251 -0
- package/dist/components/Video/src/control/VideoFactory.d.ts +3 -0
- package/dist/components/Video/src/control/VideoFactory.js +32 -0
- package/dist/components/Video/src/enums/CommonEnum.d.ts +26 -0
- package/dist/components/Video/src/enums/CommonEnum.js +31 -0
- package/dist/components/Windows/index.d.ts +4 -0
- package/dist/components/Windows/src/ModalWrap.vue.d.ts +14 -0
- package/dist/components/Windows/src/ModalWrap.vue.js +5 -0
- package/dist/components/Windows/src/ModalWrap.vue2.js +90 -0
- package/dist/components/Windows/src/Windows.vue.d.ts +18 -0
- package/dist/components/Windows/src/Windows.vue.js +7 -0
- package/dist/components/Windows/src/Windows.vue2.js +51 -0
- package/dist/components/Windows/src/Windows.vue3.js +22 -0
- package/dist/components/Windows/src/props.d.ts +20 -0
- package/dist/components/Windows/src/props.js +9 -0
- package/dist/directives/clickOutside.d.ts +3 -0
- package/dist/directives/index.d.ts +2 -0
- package/dist/directives/repeatClick.d.ts +3 -0
- package/dist/helper/lang.d.ts +1 -0
- package/dist/helper/lang.js +546 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +36 -0
- package/dist/index.min.css +6 -0
- package/dist/node_modules/.pnpm/@vueuse_core@10.7.2_vue@3.4.21/node_modules/@vueuse/core/index.js +268 -0
- package/dist/node_modules/.pnpm/@vueuse_shared@10.7.2_vue@3.4.21/node_modules/@vueuse/shared/index.js +34 -0
- package/dist/themes/index.d.ts +1 -0
- package/dist/themes/index.js +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.js +24 -0
- package/dist/utils/is.d.ts +25 -0
- package/dist/utils/is.js +36 -0
- package/dist/utils/propTypes.d.ts +10 -0
- package/dist/utils/propTypes.js +35 -0
- package/dist/utils/tsxHelper.d.ts +5 -0
- package/dist/utils/tsxHelper.js +18 -0
- package/package.json +64 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { switcher, closer, submit, cancel } from './config.js';
|
|
2
|
+
import propTypes from '../../../utils/propTypes.js';
|
|
3
|
+
|
|
4
|
+
var zIndex = 1000;
|
|
5
|
+
var baseProps = {
|
|
6
|
+
visible: Boolean,
|
|
7
|
+
zIndex: {
|
|
8
|
+
type: Number,
|
|
9
|
+
"default": function _default() {
|
|
10
|
+
return zIndex++;
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
sizes: Array,
|
|
14
|
+
offset: Object,
|
|
15
|
+
overflow: String,
|
|
16
|
+
maximum: Boolean,
|
|
17
|
+
modally: Boolean,
|
|
18
|
+
movable: {
|
|
19
|
+
type: [Boolean, String],
|
|
20
|
+
"default": true
|
|
21
|
+
},
|
|
22
|
+
position: {
|
|
23
|
+
type: String,
|
|
24
|
+
"default": 'fixed'
|
|
25
|
+
},
|
|
26
|
+
resizeable: Boolean,
|
|
27
|
+
extent: {
|
|
28
|
+
type: Object,
|
|
29
|
+
"default": function _default() {
|
|
30
|
+
return {
|
|
31
|
+
top: 0
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
modalClass: String,
|
|
36
|
+
contentClass: String,
|
|
37
|
+
animation: Object
|
|
38
|
+
};
|
|
39
|
+
var headerProps = {
|
|
40
|
+
header: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
"default": true
|
|
43
|
+
},
|
|
44
|
+
maximizer: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
"default": true
|
|
47
|
+
},
|
|
48
|
+
closer: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
"default": true
|
|
51
|
+
},
|
|
52
|
+
maximum: propTypes.any.def(function () {
|
|
53
|
+
return false;
|
|
54
|
+
}),
|
|
55
|
+
headerIcon: {
|
|
56
|
+
type: String,
|
|
57
|
+
"default": 'mdi:map-marker'
|
|
58
|
+
},
|
|
59
|
+
title: propTypes.oneOfType([propTypes.func, propTypes.string]).def('--'),
|
|
60
|
+
titleAlign: propTypes.oneOf(['start', 'center', 'end']).def('start'),
|
|
61
|
+
titleBefore: propTypes.func,
|
|
62
|
+
titleAfter: propTypes.func,
|
|
63
|
+
switcherIcon: {
|
|
64
|
+
type: Object,
|
|
65
|
+
"default": function _default() {
|
|
66
|
+
return switcher;
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
closerIcon: {
|
|
70
|
+
type: Object,
|
|
71
|
+
"default": function _default() {
|
|
72
|
+
return closer;
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
onSwitch: propTypes.func.def(function () {}),
|
|
76
|
+
onClose: propTypes.func.def(function () {})
|
|
77
|
+
};
|
|
78
|
+
var footerProps = {
|
|
79
|
+
footer: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
"default": true
|
|
82
|
+
},
|
|
83
|
+
cancel: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
"default": true
|
|
86
|
+
},
|
|
87
|
+
submit: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
"default": true
|
|
90
|
+
},
|
|
91
|
+
submitOpt: {
|
|
92
|
+
type: Object,
|
|
93
|
+
"default": function _default() {
|
|
94
|
+
return submit;
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
cancelOpt: {
|
|
98
|
+
type: Object,
|
|
99
|
+
"default": function _default() {
|
|
100
|
+
return cancel;
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
onCancel: propTypes.func.def(function () {}),
|
|
104
|
+
onSubmit: propTypes.func.def(function () {})
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export { baseProps, footerProps, headerProps };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import { unref } from 'vue';
|
|
3
|
+
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
function ensure(value) {
|
|
7
|
+
return value == null ? null : isNaN(value) ? value : "".concat(value, "px");
|
|
8
|
+
}
|
|
9
|
+
function isp(value) {
|
|
10
|
+
return typeof value === 'string' && !!value.match(/^.+(%|vh|vw)$/);
|
|
11
|
+
}
|
|
12
|
+
function doLocator(offset, sizes, locator, offsetable, sizeable) {
|
|
13
|
+
var siz = sizes && sizes.map(function (v) {
|
|
14
|
+
return v == null || isNaN(v) ? v : "".concat(v, "px");
|
|
15
|
+
});
|
|
16
|
+
var top = offsetable && ensure(locator.top != null ? locator.top : offset && offset.top);
|
|
17
|
+
var lft = offsetable && ensure(locator.left != null ? locator.left : offset && offset.left);
|
|
18
|
+
var rgt = offsetable && ensure(offset && offset.right);
|
|
19
|
+
var bom = offsetable && ensure(offset && offset.bottom);
|
|
20
|
+
var wid = siz && siz[0];
|
|
21
|
+
var hei = siz && siz[1];
|
|
22
|
+
var transformX, transformY, transform;
|
|
23
|
+
if (!top && !bom && offsetable) {
|
|
24
|
+
top = siz && siz[1] != null ? "calc(50% - ".concat(siz[1], "/2)") : '50%';
|
|
25
|
+
transformY = siz && siz[1] != null ? undefined : 'translateY(-50%)';
|
|
26
|
+
}
|
|
27
|
+
if (!lft && !rgt && offsetable) {
|
|
28
|
+
lft = siz && siz[0] != null ? "calc(50% - ".concat(siz[0], "/2)") : '50%';
|
|
29
|
+
transformX = siz && siz[0] != null ? undefined : 'translateX(-50%)';
|
|
30
|
+
}
|
|
31
|
+
if (transformX || transformY) {
|
|
32
|
+
transform = "".concat(transformX || '', " ").concat(transformY || '');
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
top: top,
|
|
36
|
+
left: lft,
|
|
37
|
+
right: rgt,
|
|
38
|
+
bottom: bom,
|
|
39
|
+
width: sizeable && wid,
|
|
40
|
+
height: sizeable && hei,
|
|
41
|
+
transform: transform
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function toMainStyle(props, locator, maximum) {
|
|
45
|
+
if (props.modally) {
|
|
46
|
+
return {
|
|
47
|
+
position: props.position,
|
|
48
|
+
zIndex: props.zIndex
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
var extent = doLocator(props.offset, props.sizes, locator, !unref(maximum), false);
|
|
52
|
+
if (props.modally === false) {
|
|
53
|
+
if (props.sizes && isp(props.sizes[0])) {
|
|
54
|
+
extent.width = props.sizes[0];
|
|
55
|
+
}
|
|
56
|
+
if (props.sizes && isp(props.sizes[1])) {
|
|
57
|
+
extent.height = props.sizes[1];
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return _objectSpread({
|
|
61
|
+
position: props.position,
|
|
62
|
+
overflow: props.overflow,
|
|
63
|
+
zIndex: props.zIndex
|
|
64
|
+
}, extent);
|
|
65
|
+
}
|
|
66
|
+
function toBodyStyle(props, locator, maximum) {
|
|
67
|
+
var position = props.modally ? 'absolute' : null;
|
|
68
|
+
var extent = doLocator(props.offset, props.sizes, locator, props.modally && !unref(maximum), true);
|
|
69
|
+
if (props.modally === false) {
|
|
70
|
+
if (props.sizes && isp(props.sizes[0])) {
|
|
71
|
+
extent.width = '100%';
|
|
72
|
+
}
|
|
73
|
+
if (props.sizes && isp(props.sizes[1])) {
|
|
74
|
+
extent.height = '100%';
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return _objectSpread({
|
|
78
|
+
position: position,
|
|
79
|
+
overflow: props.overflow
|
|
80
|
+
}, extent);
|
|
81
|
+
}
|
|
82
|
+
function clamp(value, min, max) {
|
|
83
|
+
return value < min ? min : value > max ? max : value;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export { clamp, toBodyStyle, toMainStyle };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare enum StateEnum {
|
|
2
|
+
NONE = 0,
|
|
3
|
+
ERRORED = 1,
|
|
4
|
+
LOADING = 2,
|
|
5
|
+
EMPTY = 4,
|
|
6
|
+
FULL = 8,
|
|
7
|
+
COMPLETED = 16
|
|
8
|
+
}
|
|
9
|
+
export default class State {
|
|
10
|
+
#private;
|
|
11
|
+
constructor(init?: number);
|
|
12
|
+
loading(): void;
|
|
13
|
+
error(): void;
|
|
14
|
+
merge(state: number): void;
|
|
15
|
+
remove(state: number): void;
|
|
16
|
+
completed(isEmpty: any): void;
|
|
17
|
+
get isLoading(): boolean;
|
|
18
|
+
get state(): boolean;
|
|
19
|
+
get stringify(): string | undefined;
|
|
20
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
2
|
+
import _createClass from '@babel/runtime/helpers/createClass';
|
|
3
|
+
import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
|
|
4
|
+
import { toRaw, ref } from 'vue';
|
|
5
|
+
|
|
6
|
+
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
|
7
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
8
|
+
var StateEnum;
|
|
9
|
+
(function (StateEnum) {
|
|
10
|
+
StateEnum[StateEnum["NONE"] = 0] = "NONE";
|
|
11
|
+
StateEnum[StateEnum["ERRORED"] = 1] = "ERRORED";
|
|
12
|
+
StateEnum[StateEnum["LOADING"] = 2] = "LOADING";
|
|
13
|
+
StateEnum[StateEnum["EMPTY"] = 4] = "EMPTY";
|
|
14
|
+
StateEnum[StateEnum["FULL"] = 8] = "FULL";
|
|
15
|
+
StateEnum[StateEnum["COMPLETED"] = 16] = "COMPLETED";
|
|
16
|
+
})(StateEnum || (StateEnum = {}));
|
|
17
|
+
var _state = /*#__PURE__*/new WeakMap();
|
|
18
|
+
var State = /*#__PURE__*/function () {
|
|
19
|
+
function State() {
|
|
20
|
+
var init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : StateEnum.NONE;
|
|
21
|
+
_classCallCheck(this, State);
|
|
22
|
+
_classPrivateFieldInitSpec(this, _state, {
|
|
23
|
+
writable: true,
|
|
24
|
+
value: ref()
|
|
25
|
+
});
|
|
26
|
+
_classPrivateFieldGet(this, _state).value = init;
|
|
27
|
+
}
|
|
28
|
+
_createClass(State, [{
|
|
29
|
+
key: "loading",
|
|
30
|
+
value: function loading() {
|
|
31
|
+
_classPrivateFieldGet(this, _state).value = StateEnum.LOADING;
|
|
32
|
+
}
|
|
33
|
+
}, {
|
|
34
|
+
key: "error",
|
|
35
|
+
value: function error() {
|
|
36
|
+
_classPrivateFieldGet(this, _state).value = StateEnum.ERRORED;
|
|
37
|
+
}
|
|
38
|
+
}, {
|
|
39
|
+
key: "merge",
|
|
40
|
+
value: function merge(state) {
|
|
41
|
+
_classPrivateFieldGet(this, _state).value |= state;
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
44
|
+
key: "remove",
|
|
45
|
+
value: function remove(state) {
|
|
46
|
+
_classPrivateFieldGet(this, _state).value &= ~(_classPrivateFieldGet(this, _state).value & state);
|
|
47
|
+
}
|
|
48
|
+
}, {
|
|
49
|
+
key: "completed",
|
|
50
|
+
value: function completed(isEmpty) {
|
|
51
|
+
_classPrivateFieldGet(this, _state).value &= ~(_classPrivateFieldGet(this, _state).value & StateEnum.LOADING);
|
|
52
|
+
_classPrivateFieldGet(this, _state).value |= StateEnum.COMPLETED;
|
|
53
|
+
_classPrivateFieldGet(this, _state).value |= isEmpty ? StateEnum.EMPTY : StateEnum.FULL;
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
key: "isLoading",
|
|
57
|
+
get: function get() {
|
|
58
|
+
return (_classPrivateFieldGet(this, _state).value & StateEnum.LOADING) === StateEnum.LOADING;
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
key: "state",
|
|
62
|
+
get: function get() {
|
|
63
|
+
return !!_classPrivateFieldGet(this, _state);
|
|
64
|
+
}
|
|
65
|
+
}, {
|
|
66
|
+
key: "stringify",
|
|
67
|
+
get: function get() {
|
|
68
|
+
if (toRaw(this).isLoading) {
|
|
69
|
+
return 'loading';
|
|
70
|
+
}
|
|
71
|
+
if (_classPrivateFieldGet(this, _state).value & StateEnum.ERRORED) {
|
|
72
|
+
return 'error';
|
|
73
|
+
}
|
|
74
|
+
if (_classPrivateFieldGet(this, _state).value & StateEnum.EMPTY) {
|
|
75
|
+
return 'empty';
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}]);
|
|
79
|
+
return State;
|
|
80
|
+
}();
|
|
81
|
+
|
|
82
|
+
export { StateEnum, State as default };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
value: import("vue-types").VueTypeDef<string | number | {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}>;
|
|
5
|
+
contentClass: StringConstructor;
|
|
6
|
+
states: import("vue-types").VueTypeValidableDef<{
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}, import("vue-types/dist/types").ValidatorFunction<{
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}>> & {
|
|
11
|
+
default: () => {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
};
|
|
14
|
+
} & {
|
|
15
|
+
default: () => {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
}, (_ctx: any, _cache: any) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
|
+
value: import("vue-types").VueTypeDef<string | number | {
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}>;
|
|
25
|
+
contentClass: StringConstructor;
|
|
26
|
+
states: import("vue-types").VueTypeValidableDef<{
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}, import("vue-types/dist/types").ValidatorFunction<{
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}>> & {
|
|
31
|
+
default: () => {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
};
|
|
34
|
+
} & {
|
|
35
|
+
default: () => {
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
}>>, {
|
|
40
|
+
states: {
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
};
|
|
43
|
+
}, {}>;
|
|
44
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, normalizeClass, renderSlot, createBlock, resolveDynamicComponent, toDisplayString, createCommentVNode } from 'vue';
|
|
2
|
+
import { isObject } from '../../../utils/is.js';
|
|
3
|
+
import '../../Icon/src/Icon.vue.js';
|
|
4
|
+
import { statefulProps } from './props.js';
|
|
5
|
+
import script$1 from '../../Icon/src/Icon.vue2.js';
|
|
6
|
+
|
|
7
|
+
var _hoisted_1 = {
|
|
8
|
+
"class": "component stateful h-full w-full"
|
|
9
|
+
};
|
|
10
|
+
var _hoisted_2 = {
|
|
11
|
+
key: 0,
|
|
12
|
+
"class": "stateful--cover"
|
|
13
|
+
};
|
|
14
|
+
var _hoisted_3 = {
|
|
15
|
+
"class": "cover--box"
|
|
16
|
+
};
|
|
17
|
+
var script = defineComponent({
|
|
18
|
+
__name: 'Stateful',
|
|
19
|
+
props: statefulProps,
|
|
20
|
+
setup: function setup(__props) {
|
|
21
|
+
var props = __props;
|
|
22
|
+
var state = computed(function () {
|
|
23
|
+
if (isObject(props.value)) {
|
|
24
|
+
return props.value;
|
|
25
|
+
}
|
|
26
|
+
return props.value ? props.states[props.value] : null;
|
|
27
|
+
});
|
|
28
|
+
return function (_ctx, _cache) {
|
|
29
|
+
var _state$value, _state$value2, _state$value3, _state$value4, _state$value5, _state$value6, _state$value7;
|
|
30
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", {
|
|
31
|
+
"class": normalizeClass(["stateful--content h-full w-full", [_ctx.contentClass, {
|
|
32
|
+
cover: !!state.value
|
|
33
|
+
}]])
|
|
34
|
+
}, [renderSlot(_ctx.$slots, "default")], 2), state.value ? (openBlock(), createElementBlock("div", _hoisted_2, [createElementVNode("div", _hoisted_3, [(openBlock(), createBlock(resolveDynamicComponent(((_state$value = state.value) === null || _state$value === void 0 ? void 0 : _state$value.tag) == 'Icon' ? script$1 : (_state$value2 = state.value) === null || _state$value2 === void 0 ? void 0 : _state$value2.tag), {
|
|
35
|
+
"class": "cover--icon",
|
|
36
|
+
icon: (_state$value3 = state.value) === null || _state$value3 === void 0 ? void 0 : _state$value3.image,
|
|
37
|
+
color: (_state$value4 = state.value) === null || _state$value4 === void 0 ? void 0 : _state$value4.color,
|
|
38
|
+
size: ((_state$value5 = state.value) === null || _state$value5 === void 0 ? void 0 : _state$value5.size) || '28'
|
|
39
|
+
}, null, 8, ["icon", "color", "size"])), createElementVNode("div", {
|
|
40
|
+
"class": normalizeClass(["cover--text", ((_state$value6 = state.value) === null || _state$value6 === void 0 ? void 0 : _state$value6.color) + '--text'])
|
|
41
|
+
}, toDisplayString((_state$value7 = state.value) === null || _state$value7 === void 0 ? void 0 : _state$value7.label), 3)])])) : createCommentVNode("v-if", true)]);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export { script as default };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const DEFAULT_STATES: {
|
|
2
|
+
error: {
|
|
3
|
+
tag: string;
|
|
4
|
+
label: string;
|
|
5
|
+
image: string;
|
|
6
|
+
color: string;
|
|
7
|
+
};
|
|
8
|
+
empty: {
|
|
9
|
+
tag: string;
|
|
10
|
+
label: string;
|
|
11
|
+
image: string;
|
|
12
|
+
color: string;
|
|
13
|
+
};
|
|
14
|
+
loading: {
|
|
15
|
+
tag: string;
|
|
16
|
+
label: string;
|
|
17
|
+
image: string;
|
|
18
|
+
color: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare const statefulProps: {
|
|
22
|
+
value: import("vue-types").VueTypeDef<string | number | {
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}>;
|
|
25
|
+
contentClass: StringConstructor;
|
|
26
|
+
states: import("vue-types").VueTypeValidableDef<{
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}, import("vue-types/dist/types").ValidatorFunction<{
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}>> & {
|
|
31
|
+
default: () => {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
};
|
|
34
|
+
} & {
|
|
35
|
+
default: () => {
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import propTypes from '../../../utils/propTypes.js';
|
|
2
|
+
|
|
3
|
+
var DEFAULT_STATES = {
|
|
4
|
+
error: {
|
|
5
|
+
tag: 'Icon',
|
|
6
|
+
label: '出错了...',
|
|
7
|
+
image: 'mdi:alert',
|
|
8
|
+
color: 'info'
|
|
9
|
+
},
|
|
10
|
+
empty: {
|
|
11
|
+
tag: 'Icon',
|
|
12
|
+
label: '暂无数据...',
|
|
13
|
+
image: 'mdi:information',
|
|
14
|
+
color: 'info'
|
|
15
|
+
},
|
|
16
|
+
loading: {
|
|
17
|
+
tag: 'Icon',
|
|
18
|
+
label: '加载中...',
|
|
19
|
+
image: 'svg-spinners:blocks-shuffle-3',
|
|
20
|
+
color: 'info'
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var statefulProps = {
|
|
24
|
+
value: propTypes.oneOfType([propTypes.object, propTypes.number, propTypes.string]),
|
|
25
|
+
contentClass: String,
|
|
26
|
+
states: propTypes.object.def(DEFAULT_STATES)
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { DEFAULT_STATES, statefulProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Table from './src/Table.vue';
|
|
2
|
+
import { ElTable } from 'element-plus';
|
|
3
|
+
import { TableColumn, TableSetProps } from './src/types';
|
|
4
|
+
import { useTable } from './src/useTable';
|
|
5
|
+
import { ComponentRef, Recordable } from '../../types';
|
|
6
|
+
export type { TableColumn, TableSlotDefault, Pagination, TableSetProps, TableProps, } from './src/types';
|
|
7
|
+
export interface TableExpose {
|
|
8
|
+
setProps: (props: Recordable) => void;
|
|
9
|
+
setColumn: (columnProps: TableSetProps[]) => void;
|
|
10
|
+
addColumn: (column: TableColumn, index?: number) => void;
|
|
11
|
+
delColumn: (field: string) => void;
|
|
12
|
+
elTableRef: ComponentRef<typeof ElTable>;
|
|
13
|
+
}
|
|
14
|
+
export { Table, useTable };
|