@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,14 @@
|
|
|
1
|
+
import { openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode } from 'vue';
|
|
2
|
+
|
|
3
|
+
var _hoisted_1 = ["xlink:href"];
|
|
4
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5
|
+
return openBlock(), createElementBlock("svg", {
|
|
6
|
+
"class": normalizeClass([_ctx.prefixCls, _ctx.$attrs["class"], _ctx.spin && 'svg-icon-spin']),
|
|
7
|
+
style: normalizeStyle(_ctx.getStyle),
|
|
8
|
+
"aria-hidden": "true"
|
|
9
|
+
}, [createElementVNode("use", {
|
|
10
|
+
"xlink:href": _ctx.symbolId
|
|
11
|
+
}, null, 8 /* PROPS */, _hoisted_1)], 6 /* CLASS, STYLE */);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { render };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
strength: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/types").ValidatorFunction<boolean>> & {
|
|
3
|
+
default: boolean;
|
|
4
|
+
};
|
|
5
|
+
modelValue: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/types").ValidatorFunction<string>> & {
|
|
6
|
+
default: string;
|
|
7
|
+
} & {
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
}, (_ctx: any, _cache: any) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
strength: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/types").ValidatorFunction<boolean>> & {
|
|
14
|
+
default: boolean;
|
|
15
|
+
};
|
|
16
|
+
modelValue: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/types").ValidatorFunction<string>> & {
|
|
17
|
+
default: string;
|
|
18
|
+
} & {
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
}>> & {
|
|
22
|
+
"onUpdate:modelValue"?: (...args: any[]) => any;
|
|
23
|
+
}, {
|
|
24
|
+
strength: boolean;
|
|
25
|
+
modelValue: string;
|
|
26
|
+
}, {}>;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { defineComponent, watch, unref, ref, computed, openBlock, createElementBlock, normalizeClass, createVNode, mergeProps, createElementVNode, createCommentVNode } from 'vue';
|
|
2
|
+
import { ElInput } from 'element-plus';
|
|
3
|
+
import propTypes from '../../../utils/propTypes.js';
|
|
4
|
+
import { zxcvbn } from '@zxcvbn-ts/core';
|
|
5
|
+
|
|
6
|
+
var _hoisted_1 = ["data-score"];
|
|
7
|
+
var prefixCls = 'ec-component-input-password';
|
|
8
|
+
var script = defineComponent({
|
|
9
|
+
__name: 'InputPassword',
|
|
10
|
+
props: {
|
|
11
|
+
strength: propTypes.bool.def(false),
|
|
12
|
+
modelValue: propTypes.string.def('')
|
|
13
|
+
},
|
|
14
|
+
emits: ['update:modelValue'],
|
|
15
|
+
setup: function setup(__props, _ref) {
|
|
16
|
+
var __emit = _ref.emit;
|
|
17
|
+
var props = __props;
|
|
18
|
+
watch(function () {
|
|
19
|
+
return props.modelValue;
|
|
20
|
+
}, function (val) {
|
|
21
|
+
if (val === unref(valueRef)) return;
|
|
22
|
+
valueRef.value = val;
|
|
23
|
+
});
|
|
24
|
+
var emit = __emit;
|
|
25
|
+
var textType = ref('password');
|
|
26
|
+
var valueRef = ref(props.modelValue);
|
|
27
|
+
watch(function () {
|
|
28
|
+
return valueRef.value;
|
|
29
|
+
}, function (val) {
|
|
30
|
+
emit('update:modelValue', val);
|
|
31
|
+
});
|
|
32
|
+
var getPasswordStrength = computed(function () {
|
|
33
|
+
var value = unref(valueRef);
|
|
34
|
+
var zxcvbnRef = zxcvbn(unref(valueRef));
|
|
35
|
+
return value ? zxcvbnRef.score : -1;
|
|
36
|
+
});
|
|
37
|
+
return function (_ctx, _cache) {
|
|
38
|
+
return openBlock(), createElementBlock("div", {
|
|
39
|
+
"class": normalizeClass([prefixCls, "".concat(prefixCls, "--default")])
|
|
40
|
+
}, [createVNode(unref(ElInput), mergeProps(_ctx.$attrs, {
|
|
41
|
+
modelValue: valueRef.value,
|
|
42
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
|
|
43
|
+
return valueRef.value = $event;
|
|
44
|
+
}),
|
|
45
|
+
showPassword: "",
|
|
46
|
+
type: textType.value
|
|
47
|
+
}), null, 16, ["modelValue", "type"]), __props.strength ? (openBlock(), createElementBlock("div", {
|
|
48
|
+
key: 0,
|
|
49
|
+
"class": normalizeClass(["".concat(prefixCls, "__bar"), "relative h-6px mt-10px mb-6px mr-auto ml-auto"])
|
|
50
|
+
}, [createElementVNode("div", {
|
|
51
|
+
"class": normalizeClass("".concat(prefixCls, "__bar--fill")),
|
|
52
|
+
"data-score": getPasswordStrength.value
|
|
53
|
+
}, null, 10, _hoisted_1)], 2)) : createCommentVNode("v-if", true)], 2);
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export { script as default };
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
footer: {
|
|
3
|
+
type: BooleanConstructor;
|
|
4
|
+
default: boolean;
|
|
5
|
+
};
|
|
6
|
+
cancel: {
|
|
7
|
+
type: BooleanConstructor;
|
|
8
|
+
default: boolean;
|
|
9
|
+
};
|
|
10
|
+
submit: {
|
|
11
|
+
type: BooleanConstructor;
|
|
12
|
+
default: boolean;
|
|
13
|
+
};
|
|
14
|
+
submitOpt: {
|
|
15
|
+
type: ObjectConstructor;
|
|
16
|
+
default: () => {
|
|
17
|
+
label: string;
|
|
18
|
+
color: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
cancelOpt: {
|
|
22
|
+
type: ObjectConstructor;
|
|
23
|
+
default: () => {
|
|
24
|
+
label: string;
|
|
25
|
+
color: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
onCancel: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
29
|
+
default: (...args: any[]) => any;
|
|
30
|
+
} & {
|
|
31
|
+
default: (...args: any[]) => any;
|
|
32
|
+
};
|
|
33
|
+
onSubmit: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
34
|
+
default: (...args: any[]) => any;
|
|
35
|
+
} & {
|
|
36
|
+
default: (...args: any[]) => any;
|
|
37
|
+
};
|
|
38
|
+
header: {
|
|
39
|
+
type: BooleanConstructor;
|
|
40
|
+
default: boolean;
|
|
41
|
+
};
|
|
42
|
+
maximizer: {
|
|
43
|
+
type: BooleanConstructor;
|
|
44
|
+
default: boolean;
|
|
45
|
+
};
|
|
46
|
+
closer: {
|
|
47
|
+
type: BooleanConstructor;
|
|
48
|
+
default: boolean;
|
|
49
|
+
};
|
|
50
|
+
maximum: import("vue-types").VueTypeValidableDef<any, import("vue-types/dist/types").ValidatorFunction<any>> & {
|
|
51
|
+
default: any;
|
|
52
|
+
};
|
|
53
|
+
headerIcon: {
|
|
54
|
+
type: StringConstructor;
|
|
55
|
+
default: string;
|
|
56
|
+
};
|
|
57
|
+
title: import("vue-types").VueTypeDef<any> & {
|
|
58
|
+
default: any;
|
|
59
|
+
};
|
|
60
|
+
titleAlign: import("vue-types").VueTypeDef<string> & {
|
|
61
|
+
default: string;
|
|
62
|
+
};
|
|
63
|
+
titleBefore: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
64
|
+
default: (...args: any[]) => any;
|
|
65
|
+
};
|
|
66
|
+
titleAfter: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
67
|
+
default: (...args: any[]) => any;
|
|
68
|
+
};
|
|
69
|
+
switcherIcon: {
|
|
70
|
+
type: ObjectConstructor;
|
|
71
|
+
default: () => {
|
|
72
|
+
true: {
|
|
73
|
+
image: string;
|
|
74
|
+
color: string;
|
|
75
|
+
};
|
|
76
|
+
false: {
|
|
77
|
+
image: string;
|
|
78
|
+
color: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
closerIcon: {
|
|
83
|
+
type: ObjectConstructor;
|
|
84
|
+
default: () => {
|
|
85
|
+
image: string;
|
|
86
|
+
color: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
onSwitch: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
90
|
+
default: (...args: any[]) => any;
|
|
91
|
+
} & {
|
|
92
|
+
default: (...args: any[]) => any;
|
|
93
|
+
};
|
|
94
|
+
onClose: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
95
|
+
default: (...args: any[]) => any;
|
|
96
|
+
} & {
|
|
97
|
+
default: (...args: any[]) => any;
|
|
98
|
+
};
|
|
99
|
+
visible: BooleanConstructor;
|
|
100
|
+
zIndex: {
|
|
101
|
+
type: NumberConstructor;
|
|
102
|
+
default: () => number;
|
|
103
|
+
};
|
|
104
|
+
sizes: ArrayConstructor;
|
|
105
|
+
offset: ObjectConstructor;
|
|
106
|
+
overflow: StringConstructor;
|
|
107
|
+
modally: BooleanConstructor;
|
|
108
|
+
movable: {
|
|
109
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
110
|
+
default: boolean;
|
|
111
|
+
};
|
|
112
|
+
position: {
|
|
113
|
+
type: StringConstructor;
|
|
114
|
+
default: string;
|
|
115
|
+
};
|
|
116
|
+
resizeable: BooleanConstructor;
|
|
117
|
+
extent: {
|
|
118
|
+
type: ObjectConstructor;
|
|
119
|
+
default: () => {
|
|
120
|
+
top: number;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
modalClass: StringConstructor;
|
|
124
|
+
contentClass: StringConstructor;
|
|
125
|
+
animation: ObjectConstructor;
|
|
126
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
127
|
+
footer: {
|
|
128
|
+
type: BooleanConstructor;
|
|
129
|
+
default: boolean;
|
|
130
|
+
};
|
|
131
|
+
cancel: {
|
|
132
|
+
type: BooleanConstructor;
|
|
133
|
+
default: boolean;
|
|
134
|
+
};
|
|
135
|
+
submit: {
|
|
136
|
+
type: BooleanConstructor;
|
|
137
|
+
default: boolean;
|
|
138
|
+
};
|
|
139
|
+
submitOpt: {
|
|
140
|
+
type: ObjectConstructor;
|
|
141
|
+
default: () => {
|
|
142
|
+
label: string;
|
|
143
|
+
color: string;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
cancelOpt: {
|
|
147
|
+
type: ObjectConstructor;
|
|
148
|
+
default: () => {
|
|
149
|
+
label: string;
|
|
150
|
+
color: string;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
onCancel: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
154
|
+
default: (...args: any[]) => any;
|
|
155
|
+
} & {
|
|
156
|
+
default: (...args: any[]) => any;
|
|
157
|
+
};
|
|
158
|
+
onSubmit: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
159
|
+
default: (...args: any[]) => any;
|
|
160
|
+
} & {
|
|
161
|
+
default: (...args: any[]) => any;
|
|
162
|
+
};
|
|
163
|
+
header: {
|
|
164
|
+
type: BooleanConstructor;
|
|
165
|
+
default: boolean;
|
|
166
|
+
};
|
|
167
|
+
maximizer: {
|
|
168
|
+
type: BooleanConstructor;
|
|
169
|
+
default: boolean;
|
|
170
|
+
};
|
|
171
|
+
closer: {
|
|
172
|
+
type: BooleanConstructor;
|
|
173
|
+
default: boolean;
|
|
174
|
+
};
|
|
175
|
+
maximum: import("vue-types").VueTypeValidableDef<any, import("vue-types/dist/types").ValidatorFunction<any>> & {
|
|
176
|
+
default: any;
|
|
177
|
+
};
|
|
178
|
+
headerIcon: {
|
|
179
|
+
type: StringConstructor;
|
|
180
|
+
default: string;
|
|
181
|
+
};
|
|
182
|
+
title: import("vue-types").VueTypeDef<any> & {
|
|
183
|
+
default: any;
|
|
184
|
+
};
|
|
185
|
+
titleAlign: import("vue-types").VueTypeDef<string> & {
|
|
186
|
+
default: string;
|
|
187
|
+
};
|
|
188
|
+
titleBefore: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
189
|
+
default: (...args: any[]) => any;
|
|
190
|
+
};
|
|
191
|
+
titleAfter: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
192
|
+
default: (...args: any[]) => any;
|
|
193
|
+
};
|
|
194
|
+
switcherIcon: {
|
|
195
|
+
type: ObjectConstructor;
|
|
196
|
+
default: () => {
|
|
197
|
+
true: {
|
|
198
|
+
image: string;
|
|
199
|
+
color: string;
|
|
200
|
+
};
|
|
201
|
+
false: {
|
|
202
|
+
image: string;
|
|
203
|
+
color: string;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
closerIcon: {
|
|
208
|
+
type: ObjectConstructor;
|
|
209
|
+
default: () => {
|
|
210
|
+
image: string;
|
|
211
|
+
color: string;
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
onSwitch: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
215
|
+
default: (...args: any[]) => any;
|
|
216
|
+
} & {
|
|
217
|
+
default: (...args: any[]) => any;
|
|
218
|
+
};
|
|
219
|
+
onClose: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
220
|
+
default: (...args: any[]) => any;
|
|
221
|
+
} & {
|
|
222
|
+
default: (...args: any[]) => any;
|
|
223
|
+
};
|
|
224
|
+
visible: BooleanConstructor;
|
|
225
|
+
zIndex: {
|
|
226
|
+
type: NumberConstructor;
|
|
227
|
+
default: () => number;
|
|
228
|
+
};
|
|
229
|
+
sizes: ArrayConstructor;
|
|
230
|
+
offset: ObjectConstructor;
|
|
231
|
+
overflow: StringConstructor;
|
|
232
|
+
modally: BooleanConstructor;
|
|
233
|
+
movable: {
|
|
234
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
235
|
+
default: boolean;
|
|
236
|
+
};
|
|
237
|
+
position: {
|
|
238
|
+
type: StringConstructor;
|
|
239
|
+
default: string;
|
|
240
|
+
};
|
|
241
|
+
resizeable: BooleanConstructor;
|
|
242
|
+
extent: {
|
|
243
|
+
type: ObjectConstructor;
|
|
244
|
+
default: () => {
|
|
245
|
+
top: number;
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
modalClass: StringConstructor;
|
|
249
|
+
contentClass: StringConstructor;
|
|
250
|
+
animation: ObjectConstructor;
|
|
251
|
+
}>>, {
|
|
252
|
+
footer: boolean;
|
|
253
|
+
cancel: boolean;
|
|
254
|
+
submit: boolean;
|
|
255
|
+
submitOpt: Record<string, any>;
|
|
256
|
+
cancelOpt: Record<string, any>;
|
|
257
|
+
onCancel: (...args: any[]) => any;
|
|
258
|
+
onSubmit: (...args: any[]) => any;
|
|
259
|
+
header: boolean;
|
|
260
|
+
maximizer: boolean;
|
|
261
|
+
closer: boolean;
|
|
262
|
+
maximum: any;
|
|
263
|
+
headerIcon: string;
|
|
264
|
+
title: any;
|
|
265
|
+
titleAlign: string;
|
|
266
|
+
titleBefore: (...args: any[]) => any;
|
|
267
|
+
titleAfter: (...args: any[]) => any;
|
|
268
|
+
switcherIcon: Record<string, any>;
|
|
269
|
+
closerIcon: Record<string, any>;
|
|
270
|
+
onSwitch: (...args: any[]) => any;
|
|
271
|
+
onClose: (...args: any[]) => any;
|
|
272
|
+
visible: boolean;
|
|
273
|
+
zIndex: number;
|
|
274
|
+
modally: boolean;
|
|
275
|
+
movable: string | boolean;
|
|
276
|
+
position: string;
|
|
277
|
+
resizeable: boolean;
|
|
278
|
+
extent: Record<string, any>;
|
|
279
|
+
}, {}>;
|
|
280
|
+
export default _default;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import { defineComponent, Transition, ref, toRefs, watch, computed, unref, createVNode, resolveComponent, withDirectives, resolveDirective } from 'vue';
|
|
3
|
+
import { toMainStyle, toBodyStyle } from './utils/index.js';
|
|
4
|
+
import { baseProps, headerProps, footerProps } from './props.js';
|
|
5
|
+
import { useModalDragMove } from './hooks/useModalDrag.js';
|
|
6
|
+
import './components/ModalHeader.vue.js';
|
|
7
|
+
import '../../Icon/src/Icon.vue.js';
|
|
8
|
+
import './components/ModalFooter.vue.js';
|
|
9
|
+
import { moverClass } from './config.js';
|
|
10
|
+
import { getSlot } from '../../../utils/tsxHelper.js';
|
|
11
|
+
import { isFunction } from '../../../utils/is.js';
|
|
12
|
+
import script$1 from './components/ModalFooter.vue2.js';
|
|
13
|
+
import script$2 from './components/ModalHeader.vue2.js';
|
|
14
|
+
import script$3 from '../../Icon/src/Icon.vue2.js';
|
|
15
|
+
|
|
16
|
+
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; }
|
|
17
|
+
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; }
|
|
18
|
+
var script = defineComponent({
|
|
19
|
+
components: {
|
|
20
|
+
ModalFooter: script$1,
|
|
21
|
+
ModalHeader: script$2,
|
|
22
|
+
Icon: script$3,
|
|
23
|
+
Transition: Transition
|
|
24
|
+
},
|
|
25
|
+
props: _objectSpread(_objectSpread(_objectSpread({}, baseProps), headerProps), footerProps),
|
|
26
|
+
name: 'BasicModal',
|
|
27
|
+
setup: function setup(props, _ref) {
|
|
28
|
+
var slots = _ref.slots,
|
|
29
|
+
emit = _ref.emit;
|
|
30
|
+
_ref.expose;
|
|
31
|
+
var attrs = _ref.attrs;
|
|
32
|
+
var destroyOnClose = ref(true);
|
|
33
|
+
var _toRefs = toRefs(props),
|
|
34
|
+
visible = _toRefs.visible;
|
|
35
|
+
var innerVisible = ref(visible.value || false);
|
|
36
|
+
var draggable = ref(true);
|
|
37
|
+
var maximum = ref(props.maximum || false);
|
|
38
|
+
watch(function () {
|
|
39
|
+
return visible.value;
|
|
40
|
+
}, function (value) {
|
|
41
|
+
console.log('.....', value);
|
|
42
|
+
innerVisible.value = value;
|
|
43
|
+
}, {
|
|
44
|
+
deep: true
|
|
45
|
+
});
|
|
46
|
+
var _useModalDragMove = useModalDragMove({
|
|
47
|
+
maximum: maximum,
|
|
48
|
+
props: props,
|
|
49
|
+
draggable: draggable,
|
|
50
|
+
visible: innerVisible,
|
|
51
|
+
destroyOnClose: destroyOnClose,
|
|
52
|
+
moverEl: moverClass
|
|
53
|
+
}),
|
|
54
|
+
moving = _useModalDragMove.moving,
|
|
55
|
+
locator = _useModalDragMove.locator;
|
|
56
|
+
watch(function () {
|
|
57
|
+
return props.offset;
|
|
58
|
+
}, function (v) {
|
|
59
|
+
return v && Object.assign(locator, v);
|
|
60
|
+
}, {
|
|
61
|
+
immediate: true
|
|
62
|
+
});
|
|
63
|
+
function onSwitch() {
|
|
64
|
+
moving.value = false;
|
|
65
|
+
emit('update:maximum', maximum.value = !maximum.value);
|
|
66
|
+
emit('resize');
|
|
67
|
+
}
|
|
68
|
+
function onClose() {
|
|
69
|
+
innerVisible.value = false;
|
|
70
|
+
console.log('关闭', visible.value);
|
|
71
|
+
emit('close');
|
|
72
|
+
}
|
|
73
|
+
var mainClass = computed(function () {
|
|
74
|
+
var cls = [unref(maximum) ? 'maximum' : '', props.modally ? 'modally' : '', props.modalClass];
|
|
75
|
+
return cls.join(' ');
|
|
76
|
+
});
|
|
77
|
+
var mainStyle = computed(function () {
|
|
78
|
+
return toMainStyle(props, locator, maximum);
|
|
79
|
+
});
|
|
80
|
+
var bodyStyle = computed(function () {
|
|
81
|
+
return toBodyStyle(props, locator, maximum);
|
|
82
|
+
});
|
|
83
|
+
console.log('--titleAftertitleAfter-', props);
|
|
84
|
+
var getBindValue = computed(function () {
|
|
85
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, attrs), slots), props), {}, {
|
|
86
|
+
onSwitch: onSwitch,
|
|
87
|
+
onClose: onClose,
|
|
88
|
+
maximum: unref(maximum)
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
var getTitleBefore = function getTitleBefore() {
|
|
92
|
+
var _slot = getSlot(slots, 'titleBefore', _objectSpread({}, props));
|
|
93
|
+
var _slotFn = props === null || props === void 0 ? void 0 : props.titleBefore;
|
|
94
|
+
return _slot !== null && _slot !== void 0 ? _slot : _slotFn;
|
|
95
|
+
};
|
|
96
|
+
var getTitleAfter = function getTitleAfter() {
|
|
97
|
+
var _slot = getSlot(slots, 'titleAfter', _objectSpread({}, props));
|
|
98
|
+
var _slotFn = props === null || props === void 0 ? void 0 : props.titleAfter;
|
|
99
|
+
return _slot !== null && _slot !== void 0 ? _slot : _slotFn === null || _slotFn === void 0 ? void 0 : _slotFn();
|
|
100
|
+
};
|
|
101
|
+
var getTitle = function getTitle() {
|
|
102
|
+
var _slot = getSlot(slots, 'title', _objectSpread({}, props));
|
|
103
|
+
var _slotFn = props === null || props === void 0 ? void 0 : props.title;
|
|
104
|
+
return (_slot !== null && _slot !== void 0 ? _slot : isFunction(_slotFn)) ? _slotFn === null || _slotFn === void 0 ? void 0 : _slotFn() : _slotFn;
|
|
105
|
+
};
|
|
106
|
+
return function () {
|
|
107
|
+
var _props$animation, _props$animation2;
|
|
108
|
+
return innerVisible.value ? createVNode("div", {
|
|
109
|
+
"class": "component modal dialog component-modal-page-wrap ".concat(mainClass.value),
|
|
110
|
+
"style": mainStyle.value
|
|
111
|
+
}, [createVNode(resolveComponent("transition"), {
|
|
112
|
+
"enter-active-class": ((_props$animation = props.animation) === null || _props$animation === void 0 ? void 0 : _props$animation.enter) || 'window--enter-active',
|
|
113
|
+
"leave-active-class": ((_props$animation2 = props.animation) === null || _props$animation2 === void 0 ? void 0 : _props$animation2.leave) || 'window--leave-active',
|
|
114
|
+
"appear": true
|
|
115
|
+
}, {
|
|
116
|
+
"default": function _default() {
|
|
117
|
+
return [createVNode("div", {
|
|
118
|
+
"ref": 'body',
|
|
119
|
+
"style": bodyStyle.value,
|
|
120
|
+
"class": "modal--body component-modal-body"
|
|
121
|
+
}, [createVNode(script$2, unref(getBindValue), {
|
|
122
|
+
headerBefore: function headerBefore() {
|
|
123
|
+
return getTitleBefore();
|
|
124
|
+
},
|
|
125
|
+
icon: function icon() {
|
|
126
|
+
return createVNode(script$3, {
|
|
127
|
+
"icon": props.headerIcon
|
|
128
|
+
}, null);
|
|
129
|
+
},
|
|
130
|
+
title: function title() {
|
|
131
|
+
return getTitle();
|
|
132
|
+
},
|
|
133
|
+
headerAfter: function headerAfter() {
|
|
134
|
+
return getTitleAfter();
|
|
135
|
+
}
|
|
136
|
+
}), createVNode("div", {
|
|
137
|
+
"class": "modal--content component-modal-content"
|
|
138
|
+
}, {
|
|
139
|
+
"default": function _default() {
|
|
140
|
+
var _slots$default;
|
|
141
|
+
return (_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots);
|
|
142
|
+
}
|
|
143
|
+
}), withDirectives(createVNode(script$1, null, null), [[resolveDirective("bind"), getBindValue]])])];
|
|
144
|
+
}
|
|
145
|
+
})]) : null;
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
export { script as default };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
footer: {
|
|
3
|
+
type: BooleanConstructor;
|
|
4
|
+
default: boolean;
|
|
5
|
+
};
|
|
6
|
+
cancel: {
|
|
7
|
+
type: BooleanConstructor;
|
|
8
|
+
default: boolean;
|
|
9
|
+
};
|
|
10
|
+
submit: {
|
|
11
|
+
type: BooleanConstructor;
|
|
12
|
+
default: boolean;
|
|
13
|
+
};
|
|
14
|
+
submitOpt: {
|
|
15
|
+
type: ObjectConstructor;
|
|
16
|
+
default: () => {
|
|
17
|
+
label: string;
|
|
18
|
+
color: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
cancelOpt: {
|
|
22
|
+
type: ObjectConstructor;
|
|
23
|
+
default: () => {
|
|
24
|
+
label: string;
|
|
25
|
+
color: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
onCancel: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
29
|
+
default: (...args: any[]) => any;
|
|
30
|
+
} & {
|
|
31
|
+
default: (...args: any[]) => any;
|
|
32
|
+
};
|
|
33
|
+
onSubmit: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
34
|
+
default: (...args: any[]) => any;
|
|
35
|
+
} & {
|
|
36
|
+
default: (...args: any[]) => any;
|
|
37
|
+
};
|
|
38
|
+
}, (_ctx: any, _cache: any) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
39
|
+
[key: string]: any;
|
|
40
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
41
|
+
footer: {
|
|
42
|
+
type: BooleanConstructor;
|
|
43
|
+
default: boolean;
|
|
44
|
+
};
|
|
45
|
+
cancel: {
|
|
46
|
+
type: BooleanConstructor;
|
|
47
|
+
default: boolean;
|
|
48
|
+
};
|
|
49
|
+
submit: {
|
|
50
|
+
type: BooleanConstructor;
|
|
51
|
+
default: boolean;
|
|
52
|
+
};
|
|
53
|
+
submitOpt: {
|
|
54
|
+
type: ObjectConstructor;
|
|
55
|
+
default: () => {
|
|
56
|
+
label: string;
|
|
57
|
+
color: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
cancelOpt: {
|
|
61
|
+
type: ObjectConstructor;
|
|
62
|
+
default: () => {
|
|
63
|
+
label: string;
|
|
64
|
+
color: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
onCancel: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
68
|
+
default: (...args: any[]) => any;
|
|
69
|
+
} & {
|
|
70
|
+
default: (...args: any[]) => any;
|
|
71
|
+
};
|
|
72
|
+
onSubmit: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
73
|
+
default: (...args: any[]) => any;
|
|
74
|
+
} & {
|
|
75
|
+
default: (...args: any[]) => any;
|
|
76
|
+
};
|
|
77
|
+
}>>, {
|
|
78
|
+
footer: boolean;
|
|
79
|
+
cancel: boolean;
|
|
80
|
+
submit: boolean;
|
|
81
|
+
submitOpt: Record<string, any>;
|
|
82
|
+
cancelOpt: Record<string, any>;
|
|
83
|
+
onCancel: (...args: any[]) => any;
|
|
84
|
+
onSubmit: (...args: any[]) => any;
|
|
85
|
+
}, {}>;
|
|
86
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { normalizeClass, defineComponent, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, createTextVNode, toDisplayString, unref, createCommentVNode } from 'vue';
|
|
2
|
+
import { footerProps } from '../props.js';
|
|
3
|
+
import { cancel, submit } from '../config.js';
|
|
4
|
+
|
|
5
|
+
var _hoisted_1 = {
|
|
6
|
+
key: 0,
|
|
7
|
+
"class": normalizeClass(['component-modal-footer'])
|
|
8
|
+
};
|
|
9
|
+
var script = defineComponent({
|
|
10
|
+
__name: 'ModalFooter',
|
|
11
|
+
props: footerProps,
|
|
12
|
+
setup: function setup(__props) {
|
|
13
|
+
return function (_ctx, _cache) {
|
|
14
|
+
var _component_el_button = resolveComponent("el-button");
|
|
15
|
+
return !!_ctx.footer ? (openBlock(), createElementBlock("div", _hoisted_1, [createVNode(_component_el_button, null, {
|
|
16
|
+
"default": withCtx(function () {
|
|
17
|
+
return [createTextVNode(toDisplayString(unref(cancel).label), 1)];
|
|
18
|
+
}),
|
|
19
|
+
_: 1
|
|
20
|
+
}), createVNode(_component_el_button, null, {
|
|
21
|
+
"default": withCtx(function () {
|
|
22
|
+
return [createTextVNode(toDisplayString(unref(submit).label), 1)];
|
|
23
|
+
}),
|
|
24
|
+
_: 1
|
|
25
|
+
})])) : createCommentVNode("v-if", true);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export { script as default };
|