@dfsj/components 3.7.2-alpha.6 → 4.0.0-alpha.1
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 +61 -453
- package/README.md +101 -24
- package/dist/_virtual/_rollupPluginBabelHelpers.js +13 -0
- package/dist/components/Boards/src/Boards.vue.js +10 -4
- package/dist/components/Boards/src/Boards.vue2.js +10 -152
- package/dist/components/Boards/src/hooKs/useStyle.d.ts +13 -5
- package/dist/components/Boards/src/hooKs/useStyle.js +10 -104
- package/dist/components/Boards/src/props.d.ts +5 -23
- package/dist/components/Boards/src/props.js +10 -56
- package/dist/components/ClickOutSide/src/ClickOutSide.vue.js +10 -4
- package/dist/components/ClickOutSide/src/ClickOutSide.vue2.js +10 -25
- package/dist/components/Descriptions/src/Descriptions.vue.js +10 -4
- package/dist/components/Descriptions/src/Descriptions.vue2.js +10 -150
- package/dist/components/Editor/src/Editor.vue.js +10 -4
- package/dist/components/Editor/src/Editor.vue2.js +10 -137
- package/dist/components/Form/src/Form.vue.js +10 -4
- package/dist/components/Form/src/Form.vue2.js +10 -394
- package/dist/components/Form/src/components/useRenderCheckbox.js +10 -32
- package/dist/components/Form/src/components/useRenderRadio.js +10 -32
- package/dist/components/Form/src/components/useRenderSelect.js +10 -51
- package/dist/components/Form/src/helper/componentMap.js +10 -32
- package/dist/components/Form/src/helper/index.js +10 -108
- package/dist/components/Form/src/types/index.d.ts +80 -84
- package/dist/components/Form/src/types/index.js +10 -30
- package/dist/components/Form/src/useForm.js +10 -289
- package/dist/components/Highlight/src/Highlight.vue.js +10 -4
- package/dist/components/Highlight/src/Highlight.vue2.js +10 -61
- package/dist/components/Icon/src/Icon.vue.js +10 -4
- package/dist/components/Icon/src/Icon.vue2.js +10 -122
- package/dist/components/Icon/src/SvgIcon.vue.js +10 -6
- package/dist/components/Icon/src/SvgIcon.vue2.js +10 -44
- package/dist/components/Icon/src/SvgIcon.vue3.js +10 -13
- package/dist/components/InputPassword/src/InputPassword.vue.js +10 -4
- package/dist/components/InputPassword/src/InputPassword.vue2.js +10 -57
- package/dist/components/Modal/src/BasicModal.vue.js +10 -4
- package/dist/components/Modal/src/BasicModal.vue2.js +10 -154
- package/dist/components/Modal/src/components/ModalFooter.vue.js +10 -4
- package/dist/components/Modal/src/components/ModalFooter.vue2.js +10 -39
- package/dist/components/Modal/src/components/ModalHeader.vue.js +10 -4
- package/dist/components/Modal/src/components/ModalHeader.vue2.js +10 -80
- package/dist/components/Modal/src/config.d.ts +3 -2
- package/dist/components/Modal/src/config.js +10 -28
- package/dist/components/Modal/src/hooks/useModalDrag.js +10 -109
- package/dist/components/Modal/src/hooks/useTimeout.js +10 -52
- package/dist/components/Modal/src/props.d.ts +16 -56
- package/dist/components/Modal/src/props.js +10 -130
- package/dist/components/Modal/src/utils/index.js +10 -85
- package/dist/components/NodeAxis/src/AbstractNodeProvider.js +10 -21
- package/dist/components/NodeAxis/src/CanvasNodeRender.d.ts +3 -12
- package/dist/components/NodeAxis/src/CanvasNodeRender.js +10 -411
- package/dist/components/NodeAxis/src/NodeAxis.vue.js +10 -4
- package/dist/components/NodeAxis/src/NodeAxis.vue2.js +10 -68
- package/dist/components/NodeAxis/src/NodeModel.js +10 -62
- package/dist/components/NodeAxis/src/NodeRender.js +10 -28
- package/dist/components/NodeAxis/src/NullLayerProvider.js +10 -86
- package/dist/components/NodeAxis/src/NullProvider.js +10 -65
- package/dist/components/NodeAxis/src/TimerNodePlayer.js +10 -148
- package/dist/components/NodeAxis/src/config/node-axis.options.js +10 -55
- package/dist/components/NodeAxis/src/enum/index.js +10 -19
- package/dist/components/NodeAxis/src/utils/assign.js +10 -42
- package/dist/components/Stateful/src/State.js +10 -78
- package/dist/components/Stateful/src/Stateful.vue.js +10 -4
- package/dist/components/Stateful/src/Stateful.vue2.js +10 -52
- package/dist/components/Stateful/src/props.d.ts +2 -6
- package/dist/components/Stateful/src/props.js +10 -28
- package/dist/components/Table/index.d.ts +3 -3
- package/dist/components/Table/src/Table.vue.js +10 -4
- package/dist/components/Table/src/Table.vue2.js +10 -583
- package/dist/components/Table/src/components/ColumnSetting.vue.js +10 -4
- package/dist/components/Table/src/components/ColumnSetting.vue2.js +10 -263
- package/dist/components/Table/src/components/TableActions.vue.js +10 -4
- package/dist/components/Table/src/components/TableActions.vue2.js +10 -107
- package/dist/components/Table/src/helper/index.js +10 -10
- package/dist/components/Table/src/types/index.d.ts +11 -13
- package/dist/components/Table/src/useTable.d.ts +36 -1
- package/dist/components/Table/src/useTable.js +10 -283
- package/dist/components/UnifyChart/src/ChartToolbox.vue.js +10 -4
- package/dist/components/UnifyChart/src/ChartToolbox.vue2.js +10 -82
- package/dist/components/UnifyChart/src/UnifyChart.vue.js +10 -4
- package/dist/components/UnifyChart/src/UnifyChart.vue2.js +10 -57
- package/dist/components/UnifyChart/src/hooks/useLoader.js +10 -92
- package/dist/components/UnifyChart/src/hooks/useRender.d.ts +8 -13
- package/dist/components/UnifyChart/src/hooks/useRender.js +10 -49
- package/dist/components/UnifyChart/src/props.d.ts +13 -59
- package/dist/components/UnifyChart/src/props.js +10 -32
- package/dist/components/UnifyChart/src/useDownLoad.js +10 -26
- package/dist/components/Visual/src/BufferLayerPlayer.js +10 -309
- package/dist/components/Visual/src/ResolvableLayerProvider.js +10 -252
- package/dist/components/Visual/src/config/default.manager.js +10 -6
- package/dist/components/Visual/src/config/default.provider.js +10 -17
- package/dist/components/Visual/src/mapping.js +10 -6
- package/dist/components/Visual/src/resolvers/IntervalResolver.js +10 -168
- package/dist/components/Visual/src/resolvers/tools.resolver.js +10 -151
- package/dist/components/Visual/src/utils/NodeMath.js +10 -99
- package/dist/components/Windows/src/ModalWrap.vue.js +10 -4
- package/dist/components/Windows/src/ModalWrap.vue2.js +10 -132
- package/dist/components/Windows/src/Windows.vue.js +10 -6
- package/dist/components/Windows/src/Windows.vue2.js +10 -55
- package/dist/components/Windows/src/Windows.vue3.js +10 -24
- package/dist/components/Windows/src/props.js +10 -8
- package/dist/directives/clickOutside.js +10 -70
- package/dist/directives/repeatClick.js +10 -28
- package/dist/directives/resizable.js +10 -195
- package/dist/index.d.ts +0 -1
- package/dist/index.js +11 -52
- package/dist/index.min.css +3 -3
- package/dist/themes/index.js +9 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/utils/index.js +10 -23
- package/package.json +54 -25
- package/dist/components/Boards/src/Boards.vue.d.ts +0 -104
- package/dist/components/ClickOutSide/src/ClickOutSide.vue.d.ts +0 -7
- package/dist/components/Descriptions/src/Descriptions.vue.d.ts +0 -97
- package/dist/components/Editor/src/Editor.vue.d.ts +0 -51
- package/dist/components/Form/src/Form.vue.d.ts +0 -838
- package/dist/components/Highlight/src/Highlight.vue.d.ts +0 -41
- package/dist/components/Icon/src/Icon.vue.d.ts +0 -49
- package/dist/components/Icon/src/SvgIcon.vue.d.ts +0 -45
- package/dist/components/InputPassword/src/InputPassword.vue.d.ts +0 -27
- package/dist/components/Modal/src/BasicModal.vue.d.ts +0 -419
- package/dist/components/Modal/src/components/ModalFooter.vue.d.ts +0 -86
- package/dist/components/Modal/src/components/ModalHeader.vue.d.ts +0 -241
- package/dist/components/NodeAxis/src/BCanvasNodeRender.d.ts +0 -19
- package/dist/components/NodeAxis/src/BCanvasNodeRender.js +0 -344
- package/dist/components/NodeAxis/src/NodeAxis.vue.d.ts +0 -17
- package/dist/components/Stateful/src/Stateful.vue.d.ts +0 -22
- package/dist/components/Table/src/Table.vue.d.ts +0 -1535
- package/dist/components/Table/src/components/ColumnSetting.vue.d.ts +0 -30
- package/dist/components/Table/src/components/TableActions.vue.d.ts +0 -229
- package/dist/components/UnifyChart/src/ChartToolbox.vue.d.ts +0 -46
- package/dist/components/UnifyChart/src/UnifyChart.vue.d.ts +0 -95
- package/dist/components/Video/index.d.ts +0 -2
- package/dist/components/Video/src/VideoPlayer.vue.d.ts +0 -60
- package/dist/components/Video/src/VideoPlayer.vue.js +0 -5
- package/dist/components/Video/src/VideoPlayer.vue2.js +0 -107
- package/dist/components/Video/src/VideoPlayerToolbar.vue.d.ts +0 -34
- package/dist/components/Video/src/VideoPlayerToolbar.vue.js +0 -5
- package/dist/components/Video/src/VideoPlayerToolbar.vue2.js +0 -65
- package/dist/components/Video/src/abstract/AbstractVideoControl.d.ts +0 -7
- package/dist/components/Video/src/abstract/Observable.d.ts +0 -6
- package/dist/components/Video/src/abstract/Observable.js +0 -89
- package/dist/components/Video/src/abstract/VideoControl.d.ts +0 -32
- package/dist/components/Video/src/abstract/VideoControl.js +0 -48
- package/dist/components/Video/src/control/DaHua.d.ts +0 -12
- package/dist/components/Video/src/control/DaHua.js +0 -154
- package/dist/components/Video/src/control/Hikvision.d.ts +0 -28
- package/dist/components/Video/src/control/Hikvision.js +0 -249
- package/dist/components/Video/src/control/VideoFactory.d.ts +0 -3
- package/dist/components/Video/src/control/VideoFactory.js +0 -31
- package/dist/components/Video/src/enums/CommonEnum.d.ts +0 -26
- package/dist/components/Video/src/enums/CommonEnum.js +0 -31
- package/dist/components/Windows/src/ModalWrap.vue.d.ts +0 -14
- package/dist/components/Windows/src/Windows.vue.d.ts +0 -21
- package/dist/helper/lang.d.ts +0 -1
- package/dist/helper/lang.js +0 -546
- package/dist/node_modules/.pnpm/@vueuse_core@13.9.0_vue@3.5.20_typescript@5.9.2_/node_modules/@vueuse/core/index.js +0 -393
- package/dist/node_modules/.pnpm/@vueuse_shared@13.9.0_vue@3.5.20_typescript@5.9.2_/node_modules/@vueuse/shared/index.js +0 -53
|
@@ -1,58 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @dfsj/components: 通用的vue组件;包括专业组件、原子级组件
|
|
4
|
+
* 版本: v4.0.0-alpha.1
|
|
5
|
+
* 作者:yangbo <1747837358@qq.com>
|
|
6
|
+
* 日期:2026-07-09 10:11:28
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
5
10
|
|
|
6
|
-
var
|
|
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 };
|
|
11
|
+
import{defineComponent as e,watch as t,unref as a,ref as o,computed as r,openBlock as u,createElementBlock as l,normalizeClass as n,createVNode as s,mergeProps as d,createElementVNode as m,createCommentVNode as c}from"vue";import{ElInput as i}from"element-plus";import p from"vue-types";import{zxcvbn as f}from"@zxcvbn-ts/core";var v=["data-score"],V="dfsj-input-password",b=e({__name:"InputPassword",props:{strength:p.bool.def(!1),modelValue:p.string.def("")},emits:["update:modelValue"],setup:function(e,p){var b=p.emit,_=e;t(function(){return _.modelValue},function(e){e!==a(h)&&(h.value=e)});var w=b,x=o("password"),h=o(_.modelValue);t(function(){return h.value},function(e){w("update:modelValue",e)});var y=r(function(){var e=a(h),t=f(a(h));return e?t.score:-1});return function(t,o){return u(),l("div",{class:n([V,"".concat(V,"--default")])},[s(a(i),d(t.$attrs,{modelValue:h.value,"onUpdate:modelValue":o[0]||(o[0]=function(e){return h.value=e}),showPassword:"",type:x.value}),null,16,["modelValue","type"]),e.strength?(u(),l("div",{key:0,class:n(["".concat(V,"__bar"),"relative h-6px mt-10px mb-6px mr-auto ml-auto"])},[m("div",{class:n("".concat(V,"__bar--fill absolute")),"data-score":y.value},null,10,v)],2)):c("v-if",!0)],2)}}});export{b as default};
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @dfsj/components: 通用的vue组件;包括专业组件、原子级组件
|
|
4
|
+
* 版本: v4.0.0-alpha.1
|
|
5
|
+
* 作者:yangbo <1747837358@qq.com>
|
|
6
|
+
* 日期:2026-07-09 10:11:28
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
2
10
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { script as default };
|
|
11
|
+
import o from"./BasicModal.vue2.js";o.__file="src/components/Modal/src/BasicModal.vue";export{o as default};
|
|
@@ -1,155 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { getSlot, isFunction } from '@dfsj/utils';
|
|
11
|
-
import script$1 from './components/ModalFooter.vue2.js';
|
|
12
|
-
import script$2 from './components/ModalHeader.vue2.js';
|
|
13
|
-
import script$3 from '../../Icon/src/Icon.vue2.js';
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @dfsj/components: 通用的vue组件;包括专业组件、原子级组件
|
|
4
|
+
* 版本: v4.0.0-alpha.1
|
|
5
|
+
* 作者:yangbo <1747837358@qq.com>
|
|
6
|
+
* 日期:2026-07-09 10:11:28
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
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; }
|
|
17
|
-
var script = defineComponent({
|
|
18
|
-
components: {
|
|
19
|
-
ModalFooter: script$1,
|
|
20
|
-
ModalHeader: script$2,
|
|
21
|
-
Icon: script$3,
|
|
22
|
-
Transition: Transition
|
|
23
|
-
},
|
|
24
|
-
props: _objectSpread(_objectSpread(_objectSpread({}, baseProps), headerProps), footerProps),
|
|
25
|
-
name: 'BasicModal',
|
|
26
|
-
emits: ['update:maximum', 'resize', 'close', 'minimize'],
|
|
27
|
-
setup: function setup(props, _ref) {
|
|
28
|
-
var slots = _ref.slots,
|
|
29
|
-
emit = _ref.emit,
|
|
30
|
-
attrs = _ref.attrs;
|
|
31
|
-
var destroyOnClose = ref(true);
|
|
32
|
-
var _toRefs = toRefs(props),
|
|
33
|
-
visible = _toRefs.visible;
|
|
34
|
-
var innerVisible = ref(visible.value || false);
|
|
35
|
-
var draggable = ref(true);
|
|
36
|
-
var maximum = ref(props.maximum || false);
|
|
37
|
-
watch(function () {
|
|
38
|
-
return visible.value;
|
|
39
|
-
}, function (value) {
|
|
40
|
-
innerVisible.value = value;
|
|
41
|
-
}, {
|
|
42
|
-
deep: true
|
|
43
|
-
});
|
|
44
|
-
var _useModalDragMove = useModalDragMove({
|
|
45
|
-
maximum: maximum,
|
|
46
|
-
props: props,
|
|
47
|
-
draggable: draggable,
|
|
48
|
-
visible: innerVisible,
|
|
49
|
-
destroyOnClose: destroyOnClose,
|
|
50
|
-
moverEl: moverClass
|
|
51
|
-
}),
|
|
52
|
-
moving = _useModalDragMove.moving,
|
|
53
|
-
locator = _useModalDragMove.locator;
|
|
54
|
-
watch(function () {
|
|
55
|
-
return props.offset;
|
|
56
|
-
}, function (v) {
|
|
57
|
-
return v && Object.assign(locator, v);
|
|
58
|
-
}, {
|
|
59
|
-
immediate: true
|
|
60
|
-
});
|
|
61
|
-
function onSwitch(e) {
|
|
62
|
-
e.stopImmediatePropagation();
|
|
63
|
-
moving.value = false;
|
|
64
|
-
emit('update:maximum', maximum.value = !maximum.value);
|
|
65
|
-
emit('resize', maximum.value);
|
|
66
|
-
}
|
|
67
|
-
function onClose(e) {
|
|
68
|
-
innerVisible.value = false;
|
|
69
|
-
emit('close', e);
|
|
70
|
-
}
|
|
71
|
-
var mainClass = computed(function () {
|
|
72
|
-
var cls = [unref(maximum) ? 'maximum' : '', props.modally ? 'modally' : '', props.modalClass];
|
|
73
|
-
return cls.join(' ');
|
|
74
|
-
});
|
|
75
|
-
function onMinimize() {
|
|
76
|
-
emit('minimize');
|
|
77
|
-
}
|
|
78
|
-
var mainStyle = computed(function () {
|
|
79
|
-
return toMainStyle(props, locator, maximum);
|
|
80
|
-
});
|
|
81
|
-
var bodyStyle = computed(function () {
|
|
82
|
-
return toBodyStyle(props, locator, maximum);
|
|
83
|
-
});
|
|
84
|
-
var getBindValue = computed(function () {
|
|
85
|
-
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, attrs), slots), props), {}, {
|
|
86
|
-
onSwitch: onSwitch,
|
|
87
|
-
onClose: onClose,
|
|
88
|
-
onMinimize: onMinimize,
|
|
89
|
-
maximum: unref(maximum)
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
var getTitleBefore = function getTitleBefore() {
|
|
93
|
-
var _slot = getSlot(slots, 'titleBefore', _objectSpread({}, props));
|
|
94
|
-
var _slotFn = props === null || props === void 0 ? void 0 : props.titleBefore;
|
|
95
|
-
return _slot !== null && _slot !== void 0 ? _slot : _slotFn === null || _slotFn === void 0 ? void 0 : _slotFn();
|
|
96
|
-
};
|
|
97
|
-
var getTitleAfter = function getTitleAfter() {
|
|
98
|
-
var _slot = getSlot(slots, 'titleAfter', _objectSpread({}, props));
|
|
99
|
-
var _slotFn = props === null || props === void 0 ? void 0 : props.titleAfter;
|
|
100
|
-
return _slot !== null && _slot !== void 0 ? _slot : _slotFn === null || _slotFn === void 0 ? void 0 : _slotFn();
|
|
101
|
-
};
|
|
102
|
-
var getTitle = function getTitle() {
|
|
103
|
-
var _slot = getSlot(slots, 'title', _objectSpread({}, props));
|
|
104
|
-
var _slotFn = props === null || props === void 0 ? void 0 : props.title;
|
|
105
|
-
return (_slot !== null && _slot !== void 0 ? _slot : isFunction(_slotFn)) ? _slotFn === null || _slotFn === void 0 ? void 0 : _slotFn() : _slotFn;
|
|
106
|
-
};
|
|
107
|
-
var hasMover = computed(function () {
|
|
108
|
-
return !!(slots !== null && slots !== void 0 && slots['mover']);
|
|
109
|
-
});
|
|
110
|
-
return function () {
|
|
111
|
-
var _props$animation, _props$animation2, _slots$mover, _slots$default;
|
|
112
|
-
return innerVisible.value ? createVNode("div", {
|
|
113
|
-
"class": ["component modal dialog component-modal-page-wrap ".concat(mainClass.value), {
|
|
114
|
-
minimized: props.minimize
|
|
115
|
-
}],
|
|
116
|
-
"style": mainStyle.value
|
|
117
|
-
}, [createVNode(resolveComponent("transition"), {
|
|
118
|
-
"enter-active-class": ((_props$animation = props.animation) === null || _props$animation === void 0 ? void 0 : _props$animation.enter) || 'window--enter-active',
|
|
119
|
-
"leave-active-class": ((_props$animation2 = props.animation) === null || _props$animation2 === void 0 ? void 0 : _props$animation2.leave) || 'window--leave-active',
|
|
120
|
-
"appear": true
|
|
121
|
-
}, {
|
|
122
|
-
"default": function _default() {
|
|
123
|
-
return [createVNode("div", {
|
|
124
|
-
"ref": 'body',
|
|
125
|
-
"style": bodyStyle.value,
|
|
126
|
-
"class": "modal--body component-modal-body"
|
|
127
|
-
}, [createVNode(script$2, unref(getBindValue), {
|
|
128
|
-
headerBefore: function headerBefore() {
|
|
129
|
-
return getTitleBefore();
|
|
130
|
-
},
|
|
131
|
-
icon: function icon() {
|
|
132
|
-
return props.headerIcon ? createVNode(script$3, {
|
|
133
|
-
"color": "white",
|
|
134
|
-
"size": 26,
|
|
135
|
-
"icon": props.headerIcon
|
|
136
|
-
}, null) : null;
|
|
137
|
-
},
|
|
138
|
-
title: function title() {
|
|
139
|
-
return getTitle();
|
|
140
|
-
},
|
|
141
|
-
headerAfter: function headerAfter() {
|
|
142
|
-
return getTitleAfter();
|
|
143
|
-
}
|
|
144
|
-
}), createVNode("div", {
|
|
145
|
-
"class": "modal--content component-modal-content"
|
|
146
|
-
}, [hasMover.value && createVNode("div", {
|
|
147
|
-
"class": "mover ".concat(moverClass)
|
|
148
|
-
}, [(_slots$mover = slots.mover) === null || _slots$mover === void 0 ? void 0 : _slots$mover.call(slots)]), (_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)]), createVNode(script$1, unref(getBindValue), null)])];
|
|
149
|
-
}
|
|
150
|
-
})]) : null;
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
export { script as default };
|
|
11
|
+
import{defineComponent as e,Transition as o,ref as n,toRefs as t,watch as l,computed as i,unref as r,createVNode as a,resolveComponent as u}from"vue";import{objectSpread2 as c,defineProperty as m}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{toMainStyle as s,toBodyStyle as v}from"./utils/index.js";import{baseProps as f,headerProps as d,footerProps as p}from"./props.js";import{useModalDragMove as j}from"./hooks/useModalDrag.js";import"./components/ModalHeader.vue.js";import"../../Icon/src/Icon.vue2.js";import"./components/ModalFooter.vue.js";import{prefixCls as x,moverClass as h}from"./config.js";import{getSlot as M,isFunction as b}from"@dfsj/utils";import g from"./components/ModalFooter.vue2.js";import y from"./components/ModalHeader.vue2.js";import z from"../../Icon/src/Icon.vue.js";var I=e({components:{ModalFooter:g,ModalHeader:y,Icon:z,Transition:o},props:c(c(c({},f),d),p),name:"BasicModal",emits:["update:maximum","resize","close","minimize"],setup:function(e,o){var f=o.slots,d=o.emit,p=o.attrs,I=n(!0),_=t(e).visible,B=n(_.value||!1),H=n(!0),A=n(e.maximum||!1);l(function(){return _.value},function(e){B.value=e},{deep:!0});var C=j({maximum:A,props:e,draggable:H,visible:B,destroyOnClose:I,moverEl:h}),F=C.moving,P=C.locator;function w(e){e.stopImmediatePropagation(),F.value=!1,d("update:maximum",A.value=!A.value),d("resize",A.value)}function O(e){B.value=!1,d("close",e)}l(function(){return e.offset},function(e){return e&&Object.assign(P,e)},{immediate:!0});var S=i(function(){return[r(A)?"".concat(x,"--maximum"):"",e.modally?"".concat(x,"--modally"):"",e.modalClass].join(" ")});function k(){d("minimize")}var D=i(function(){return s(e,P,A)}),E=i(function(){return v(e,P,A)}),T=i(function(){return c(c(c(c({},p),f),e),{},{onSwitch:w,onClose:O,onMinimize:k,maximum:r(A)})}),q=i(function(){return!(null==f||!f.mover)});return function(){var o,n,t,l;return B.value?a("div",{class:["".concat(x," flex flex-col min-h-0 ").concat(S.value),m({},"".concat(x,"--minimized"),e.minimize)],style:D.value},[a(u("transition"),{"enter-active-class":(null===(o=e.animation)||void 0===o?void 0:o.enter)||"".concat(x,"-enter-active"),"leave-active-class":(null===(n=e.animation)||void 0===n?void 0:n.leave)||"".concat(x,"-leave-active"),appear:!0},{default:function(){return[a("div",{ref:"body",style:E.value,class:"".concat(x,"__body h-full w-full flex flex-col min-h-0")},[a(y,r(T),{headerBefore:function(){return o=M(f,"titleBefore",c({},e)),n=null==e?void 0:e.titleBefore,null!=o?o:null==n?void 0:n();var o,n},icon:function(){return e.headerIcon?a(z,{size:26,icon:e.headerIcon},null):null},title:function(){return o=M(f,"title",c({},e)),n=null==e?void 0:e.title,(null!=o?o:b(n))?null==n?void 0:n():n;var o,n},headerAfter:function(){return o=M(f,"titleAfter",c({},e)),n=null==e?void 0:e.titleAfter,null!=o?o:null==n?void 0:n();var o,n}}),a("div",{class:"".concat(x,"__content relative flex-1 flex flex-col h-full")},[q.value&&a("div",{class:"".concat(h)},[null===(t=f.mover)||void 0===t?void 0:t.call(f)]),null===(l=f.default)||void 0===l?void 0:l.call(f)]),a(g,r(T),null)])]}})]):null}}});export{I as default};
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @dfsj/components: 通用的vue组件;包括专业组件、原子级组件
|
|
4
|
+
* 版本: v4.0.0-alpha.1
|
|
5
|
+
* 作者:yangbo <1747837358@qq.com>
|
|
6
|
+
* 日期:2026-07-09 10:11:28
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
2
10
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { script as default };
|
|
11
|
+
import o from"./ModalFooter.vue2.js";o.__file="src/components/Modal/src/components/ModalFooter.vue";export{o as default};
|
|
@@ -1,40 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @dfsj/components: 通用的vue组件;包括专业组件、原子级组件
|
|
4
|
+
* 版本: v4.0.0-alpha.1
|
|
5
|
+
* 作者:yangbo <1747837358@qq.com>
|
|
6
|
+
* 日期:2026-07-09 10:11:28
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
3
10
|
|
|
4
|
-
var
|
|
5
|
-
key: 0,
|
|
6
|
-
"class": normalizeClass(['component-modal-footer'])
|
|
7
|
-
};
|
|
8
|
-
var script = defineComponent({
|
|
9
|
-
__name: 'ModalFooter',
|
|
10
|
-
props: footerProps,
|
|
11
|
-
setup: function setup(__props) {
|
|
12
|
-
var props = __props;
|
|
13
|
-
var _toRefs = toRefs(props),
|
|
14
|
-
submitOpt = _toRefs.submitOpt,
|
|
15
|
-
cancelOpt = _toRefs.cancelOpt;
|
|
16
|
-
return function (_ctx, _cache) {
|
|
17
|
-
var _unref2, _unref3;
|
|
18
|
-
var _component_el_button = resolveComponent("el-button");
|
|
19
|
-
return !!_ctx.footer ? (openBlock(), createElementBlock("div", _hoisted_1, [createVNode(_component_el_button, {
|
|
20
|
-
onClick: _ctx.onCancel,
|
|
21
|
-
type: (_unref2 = unref(cancelOpt)) === null || _unref2 === void 0 ? void 0 : _unref2.color
|
|
22
|
-
}, {
|
|
23
|
-
"default": withCtx(function () {
|
|
24
|
-
return [createTextVNode(toDisplayString(unref(cancelOpt).label), 1)];
|
|
25
|
-
}),
|
|
26
|
-
_: 1
|
|
27
|
-
}, 8, ["onClick", "type"]), createVNode(_component_el_button, {
|
|
28
|
-
onClick: _ctx.onSubmit,
|
|
29
|
-
type: (_unref3 = unref(submitOpt)) === null || _unref3 === void 0 ? void 0 : _unref3.color
|
|
30
|
-
}, {
|
|
31
|
-
"default": withCtx(function () {
|
|
32
|
-
return [createTextVNode(toDisplayString(unref(submitOpt).label), 1)];
|
|
33
|
-
}),
|
|
34
|
-
_: 1
|
|
35
|
-
}, 8, ["onClick", "type"])])) : createCommentVNode("v-if", true);
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
export { script as default };
|
|
11
|
+
import{defineComponent as o,toRefs as t,resolveComponent as e,openBlock as n,createElementBlock as r,normalizeClass as l,unref as i,createVNode as u,withCtx as c,createTextVNode as f,toDisplayString as a,createCommentVNode as p}from"vue";import{footerProps as s}from"../props.js";import{prefixCls as m}from"../config.js";var v=o({__name:"ModalFooter",props:s,setup:function(o){var s=t(o),v=s.submitOpt,d=s.cancelOpt;return function(o,t){var s,b,y=e("el-button");return o.footer?(n(),r("div",{key:0,class:l("".concat(i(m),"__footer absolute bottom-0 left-0 right-0 h-40px flex justify-center items-center"))},[u(y,{onClick:o.onCancel,type:null===(s=i(d))||void 0===s?void 0:s.color},{default:c(function(){return[f(a(i(d).label),1)]}),_:1},8,["onClick","type"]),u(y,{onClick:o.onSubmit,type:null===(b=i(v))||void 0===b?void 0:b.color},{default:c(function(){return[f(a(i(v).label),1)]}),_:1},8,["onClick","type"])],2)):p("v-if",!0)}}});export{v as default};
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @dfsj/components: 通用的vue组件;包括专业组件、原子级组件
|
|
4
|
+
* 版本: v4.0.0-alpha.1
|
|
5
|
+
* 作者:yangbo <1747837358@qq.com>
|
|
6
|
+
* 日期:2026-07-09 10:11:28
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
2
10
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { script as default };
|
|
11
|
+
import e from"./ModalHeader.vue2.js";e.__file="src/components/Modal/src/components/ModalHeader.vue";export{e as default};
|
|
@@ -1,81 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @dfsj/components: 通用的vue组件;包括专业组件、原子级组件
|
|
4
|
+
* 版本: v4.0.0-alpha.1
|
|
5
|
+
* 作者:yangbo <1747837358@qq.com>
|
|
6
|
+
* 日期:2026-07-09 10:11:28
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
6
10
|
|
|
7
|
-
var
|
|
8
|
-
key: 0,
|
|
9
|
-
"class": "header-before"
|
|
10
|
-
};
|
|
11
|
-
var _hoisted_2 = {
|
|
12
|
-
key: 1,
|
|
13
|
-
"class": "header--icon"
|
|
14
|
-
};
|
|
15
|
-
var _hoisted_3 = {
|
|
16
|
-
key: 2,
|
|
17
|
-
"class": "header--title"
|
|
18
|
-
};
|
|
19
|
-
var _hoisted_4 = {
|
|
20
|
-
key: 3,
|
|
21
|
-
"class": "header-after"
|
|
22
|
-
};
|
|
23
|
-
var _hoisted_5 = {
|
|
24
|
-
"class": "modal-header-right-control-wrap"
|
|
25
|
-
};
|
|
26
|
-
var script = defineComponent({
|
|
27
|
-
__name: 'ModalHeader',
|
|
28
|
-
props: headerProps,
|
|
29
|
-
setup: function setup(__props) {
|
|
30
|
-
var props = __props;
|
|
31
|
-
var getStyle = computed(function () {
|
|
32
|
-
return {
|
|
33
|
-
background: props.background,
|
|
34
|
-
color: '#fff'
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
var sIcon = computed(function () {
|
|
38
|
-
var _props$switcherIcon;
|
|
39
|
-
return (_props$switcherIcon = props.switcherIcon) === null || _props$switcherIcon === void 0 ? void 0 : _props$switcherIcon[props.maximum].image;
|
|
40
|
-
});
|
|
41
|
-
return function (_ctx, _cache) {
|
|
42
|
-
var _ctx$minimizerIcon;
|
|
43
|
-
return !!_ctx.header ? (openBlock(), createElementBlock("div", {
|
|
44
|
-
key: 0,
|
|
45
|
-
"class": normalizeClass(['component-modal-header', unref(moverClass)]),
|
|
46
|
-
style: normalizeStyle(getStyle.value),
|
|
47
|
-
onDblclick: _cache[0] || (_cache[0] = function () {
|
|
48
|
-
return _ctx.onSwitch();
|
|
49
|
-
})
|
|
50
|
-
}, [createCommentVNode(" 头部信息"), createElementVNode("div", {
|
|
51
|
-
"class": "modal-header-main-container-wrap",
|
|
52
|
-
style: normalizeStyle({
|
|
53
|
-
'justify-content': props.titleAlign
|
|
54
|
-
})
|
|
55
|
-
}, [createCommentVNode(" 左侧的信息"), _ctx.$slots.headerBefore ? (openBlock(), createElementBlock("div", _hoisted_1, [renderSlot(_ctx.$slots, "headerBefore")])) : createCommentVNode("v-if", true), createCommentVNode("图标"), _ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_2, [renderSlot(_ctx.$slots, "icon")])) : createCommentVNode("v-if", true), createCommentVNode("文字"), _ctx.$slots.title ? (openBlock(), createElementBlock("div", _hoisted_3, [renderSlot(_ctx.$slots, "title")])) : createCommentVNode("v-if", true), createCommentVNode("追加"), _ctx.$slots.headerAfter ? (openBlock(), createElementBlock("div", _hoisted_4, [renderSlot(_ctx.$slots, "headerAfter")])) : createCommentVNode("v-if", true)], 4), createCommentVNode(" 右侧的按钮"), createElementVNode("div", _hoisted_5, [!!_ctx.minimizerIcon && props.minimizer ? (openBlock(), createBlock(script$1, {
|
|
56
|
-
key: 0,
|
|
57
|
-
"class": "cursor-pointer",
|
|
58
|
-
size: 28,
|
|
59
|
-
color: "white",
|
|
60
|
-
onClick: withModifiers(_ctx.onMinimize, ["stop"]),
|
|
61
|
-
icon: (_ctx$minimizerIcon = _ctx.minimizerIcon) === null || _ctx$minimizerIcon === void 0 ? void 0 : _ctx$minimizerIcon.image
|
|
62
|
-
}, null, 8, ["onClick", "icon"])) : createCommentVNode("v-if", true), !!_ctx.switcherIcon && props.maximizer ? (openBlock(), createBlock(script$1, {
|
|
63
|
-
key: 1,
|
|
64
|
-
"class": "cursor-pointer",
|
|
65
|
-
size: 28,
|
|
66
|
-
color: "white",
|
|
67
|
-
onClick: withModifiers(_ctx.onSwitch, ["stop"]),
|
|
68
|
-
icon: sIcon.value
|
|
69
|
-
}, null, 8, ["onClick", "icon"])) : createCommentVNode("v-if", true), !!_ctx.closerIcon && props.closer ? (openBlock(), createBlock(script$1, {
|
|
70
|
-
key: 2,
|
|
71
|
-
size: 28,
|
|
72
|
-
color: "white",
|
|
73
|
-
"class": "cursor-pointer",
|
|
74
|
-
onClick: withModifiers(_ctx.onClose, ["stop"]),
|
|
75
|
-
icon: _ctx.closerIcon.image
|
|
76
|
-
}, null, 8, ["onClick", "icon"])) : createCommentVNode("v-if", true)])], 38)) : createCommentVNode("v-if", true);
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
export { script as default };
|
|
11
|
+
import{defineComponent as e,ref as o,computed as i,openBlock as t,createElementBlock as n,normalizeClass as c,unref as l,normalizeStyle as r,createCommentVNode as s,createElementVNode as a,renderSlot as u,createBlock as v,withModifiers as d}from"vue";import{headerProps as m}from"../props.js";import"../../../Icon/src/Icon.vue2.js";import{prefixCls as p,moverClass as f}from"../config.js";import y from"../../../Icon/src/Icon.vue.js";var h={key:0},k={key:1},x={key:4},b={class:"absolute z-4 top-0 right-0 bottom-0 flex justify-end items-center gap-10px pr-10px"},C=e({__name:"ModalHeader",props:m,setup:function(e){var m=e,C=o(!1),z=null,g=i(function(){var e;return null===(e=m.switcherIcon)||void 0===e?void 0:e[m.maximum].image}),I=i(function(){return{"select-text":m.copyable,"cursor-text":m.copyable}}),_=i(function(){return C.value?"mdi:check":"mdi:content-copy"});function $(){var e,o,i=document.querySelector(".".concat(p,"__header-title")),t=(null==i||null===(e=i.textContent)||void 0===e?void 0:e.trim())||"";if(t){var n=function(){C.value=!0,z&&clearTimeout(z),z=setTimeout(function(){C.value=!1},1500)};null===(o=navigator.clipboard)||void 0===o||o.writeText(t).then(n).catch(function(){var e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),n()})}}return function(e,o){var i;return e.header?(t(),n("div",{key:0,class:c(["".concat(l(p),"__header"),l(f),"relative w-full h-40px min-h-40px"]),style:r({background:m.background||void 0}),onDblclick:o[0]||(o[0]=function(){return e.onSwitch()})},[s(" 头部信息 "),a("div",{class:"w-full h-full overflow-hidden flex items-center relative z-1 pl-12px",style:r({"justify-content":m.titleAlign})},[s(" 左侧的信息 "),e.$slots.headerBefore?(t(),n("div",h,[u(e.$slots,"headerBefore")])):s("v-if",!0),s(" 图标 "),e.$slots.icon?(t(),n("div",k,[u(e.$slots,"icon")])):s("v-if",!0),s(" 文字 "),e.$slots.title?(t(),n("div",{key:2,class:c(["".concat(l(p),"__header-title"),I.value])},[u(e.$slots,"title")],2)):s("v-if",!0),s(" 复制按钮:仅 copyable 时显示 "),m.copyable&&e.$slots.title?(t(),v(y,{key:3,class:c(["".concat(l(p),"__copy-btn"),"cursor-pointer shrink-0 ml-4px"]),size:18,color:C.value?"#67c23a":void 0,icon:_.value,onClick:d($,["stop"])},null,8,["class","color","icon"])):s("v-if",!0),s(" 追加 "),e.$slots.headerAfter?(t(),n("div",x,[u(e.$slots,"headerAfter")])):s("v-if",!0)],4),s(" 右侧的按钮 "),a("div",b,[e.minimizerIcon&&m.minimizer?(t(),v(y,{key:0,class:"cursor-pointer",size:28,onClick:d(e.onMinimize,["stop"]),icon:null===(i=e.minimizerIcon)||void 0===i?void 0:i.image},null,8,["onClick","icon"])):s("v-if",!0),e.switcherIcon&&m.maximizer?(t(),v(y,{key:1,class:"cursor-pointer",size:28,onClick:d(e.onSwitch,["stop"]),icon:g.value},null,8,["onClick","icon"])):s("v-if",!0),e.closerIcon&&m.closer?(t(),v(y,{key:2,size:28,class:"cursor-pointer",onClick:d(e.onClose,["stop"]),icon:e.closerIcon.image},null,8,["onClick","icon"])):s("v-if",!0)])],38)):s("v-if",!0)}}});export{C as default};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const prefixCls = "dfsj-modal";
|
|
2
|
+
declare const moverClass = "dfsj-modal__drag-target";
|
|
2
3
|
declare const switcher: {
|
|
3
4
|
true: {
|
|
4
5
|
image: string;
|
|
@@ -25,4 +26,4 @@ declare const minimizer: {
|
|
|
25
26
|
image: string;
|
|
26
27
|
color: string;
|
|
27
28
|
};
|
|
28
|
-
export { switcher, closer, cancel, submit, moverClass, minimizer };
|
|
29
|
+
export { switcher, closer, cancel, submit, moverClass, prefixCls, minimizer };
|
|
@@ -1,29 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
var closer = {
|
|
13
|
-
image: 'mdi:close',
|
|
14
|
-
color: 'transparent'
|
|
15
|
-
};
|
|
16
|
-
var cancel = {
|
|
17
|
-
label: '取消',
|
|
18
|
-
color: 'info'
|
|
19
|
-
};
|
|
20
|
-
var submit = {
|
|
21
|
-
label: '提交',
|
|
22
|
-
color: 'primary'
|
|
23
|
-
};
|
|
24
|
-
var minimizer = {
|
|
25
|
-
image: 'mdi:minimize',
|
|
26
|
-
color: 'transparent'
|
|
27
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @dfsj/components: 通用的vue组件;包括专业组件、原子级组件
|
|
4
|
+
* 版本: v4.0.0-alpha.1
|
|
5
|
+
* 作者:yangbo <1747837358@qq.com>
|
|
6
|
+
* 日期:2026-07-09 10:11:28
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
28
10
|
|
|
29
|
-
|
|
11
|
+
var r="dfsj-modal",a="".concat(r,"__drag-target"),o={true:{image:"mdi:window-restore",color:"transparent"},false:{image:"mdi:window-maximize",color:"transparent"}},e={image:"mdi:close",color:"transparent"},i={label:"取消",color:"info"},m={label:"提交",color:"primary"},t={image:"mdi:minimize",color:"transparent"};export{i as cancel,e as closer,t as minimizer,a as moverClass,r as prefixCls,m as submit,o as switcher};
|
|
@@ -1,110 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @dfsj/components: 通用的vue组件;包括专业组件、原子级组件
|
|
4
|
+
* 版本: v4.0.0-alpha.1
|
|
5
|
+
* 作者:yangbo <1747837358@qq.com>
|
|
6
|
+
* 日期:2026-07-09 10:11:28
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
4
10
|
|
|
5
|
-
function
|
|
6
|
-
var moving = ref(false);
|
|
7
|
-
var locator = reactive({
|
|
8
|
-
top: null,
|
|
9
|
-
bottom: null,
|
|
10
|
-
left: null,
|
|
11
|
-
right: null
|
|
12
|
-
});
|
|
13
|
-
var sign = reactive({
|
|
14
|
-
x: undefined,
|
|
15
|
-
y: undefined,
|
|
16
|
-
l: undefined,
|
|
17
|
-
t: undefined
|
|
18
|
-
});
|
|
19
|
-
var that = getCurrentInstance();
|
|
20
|
-
var getStyle = function getStyle(dom, attr) {
|
|
21
|
-
return getComputedStyle(dom)[attr];
|
|
22
|
-
};
|
|
23
|
-
var drag = function drag(wrap) {
|
|
24
|
-
if (!wrap) return;
|
|
25
|
-
wrap.setAttribute('data-drag', unref(context.draggable));
|
|
26
|
-
var dialogHeaderEl = wrap.querySelector(".".concat(context.moverEl));
|
|
27
|
-
var proxy = that.proxy;
|
|
28
|
-
var dragDom = proxy.$el;
|
|
29
|
-
if (!dialogHeaderEl || !dragDom || !unref(context.draggable)) return;
|
|
30
|
-
dialogHeaderEl.style.cursor = 'move';
|
|
31
|
-
dialogHeaderEl.onmousedown = function (e) {
|
|
32
|
-
var _e$target, _context$props, _context$props$onModa;
|
|
33
|
-
if (!e) return;
|
|
34
|
-
console.log(e);
|
|
35
|
-
var element = context.props.modally ? that.refs.body : proxy.$el;
|
|
36
|
-
var bounder = element.getBoundingClientRect();
|
|
37
|
-
sign.l = bounder.left;
|
|
38
|
-
sign.t = bounder.top;
|
|
39
|
-
sign.x = e.x;
|
|
40
|
-
sign.y = e.y;
|
|
41
|
-
moving.value = true;
|
|
42
|
-
if (!e || ['svg', 'path'].includes(e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.nodeName)) (_context$props = context.props) === null || _context$props === void 0 || (_context$props$onModa = _context$props.onModalMousedown) === null || _context$props$onModa === void 0 || _context$props$onModa.call(_context$props);
|
|
43
|
-
document.onmousemove = function (event) {
|
|
44
|
-
var moved = sign.x !== event.x || sign.y !== event.y;
|
|
45
|
-
if (moved && moving.value && !context.maximum.value) {
|
|
46
|
-
var _context$props2, _context$props2$onMod;
|
|
47
|
-
event.preventDefault();
|
|
48
|
-
delete locator.right;
|
|
49
|
-
delete locator.bottom;
|
|
50
|
-
if (context.props.extent) {
|
|
51
|
-
var ex = context.props.extent;
|
|
52
|
-
var dx = event.x - sign.x;
|
|
53
|
-
var dy = event.y - sign.y;
|
|
54
|
-
var br = that.refs.body.getBoundingClientRect();
|
|
55
|
-
var el = ex.left != null ? ex.left : -Number.MAX_VALUE;
|
|
56
|
-
var et = ex.top != null ? ex.top : -Number.MAX_VALUE;
|
|
57
|
-
var mr = ex.right != null ? window.innerWidth - ex.right - br.width : Number.MAX_VALUE;
|
|
58
|
-
var mb = ex.bottom != null ? window.innerHeight - ex.bottom - br.height : Number.MAX_VALUE;
|
|
59
|
-
locator.left = clamp(sign.l + dx, el, mr);
|
|
60
|
-
locator.top = clamp(sign.t + dy, et, mb);
|
|
61
|
-
} else {
|
|
62
|
-
var Δx = event.x - sign.x;
|
|
63
|
-
var Δy = event.y - sign.y;
|
|
64
|
-
locator.left = sign.l + Δx;
|
|
65
|
-
locator.top = sign.t + Δy;
|
|
66
|
-
}
|
|
67
|
-
locator.right = "unset !important";
|
|
68
|
-
locator.bottom = "unset !important";
|
|
69
|
-
that.emit('update:offset', locator);
|
|
70
|
-
(_context$props2 = context.props) === null || _context$props2 === void 0 || (_context$props2$onMod = _context$props2.onModalMousemove) === null || _context$props2$onMod === void 0 || _context$props2$onMod.call(_context$props2, event);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
document.onmouseup = function (e) {
|
|
74
|
-
var _e$target2, _context$props3, _context$props3$onMod;
|
|
75
|
-
moving.value = false;
|
|
76
|
-
document.onmousemove = null;
|
|
77
|
-
document.onmouseup = null;
|
|
78
|
-
if (!e || ['svg', 'path'].includes(e === null || e === void 0 || (_e$target2 = e.target) === null || _e$target2 === void 0 ? void 0 : _e$target2.nodeName)) (_context$props3 = context.props) === null || _context$props3 === void 0 || (_context$props3$onMod = _context$props3.onModalMouseup) === null || _context$props3$onMod === void 0 || _context$props3$onMod.call(_context$props3);
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
var handleDrag = function handleDrag() {
|
|
83
|
-
var _dragWrap$getAttribut;
|
|
84
|
-
var proxy = that.proxy;
|
|
85
|
-
var dragWrap = proxy.$el;
|
|
86
|
-
if (!dragWrap) return;
|
|
87
|
-
var display = getStyle(dragWrap, 'display');
|
|
88
|
-
var draggable = (_dragWrap$getAttribut = dragWrap.getAttribute('data-drag')) !== null && _dragWrap$getAttribut !== void 0 ? _dragWrap$getAttribut : true;
|
|
89
|
-
if (display !== 'none') {
|
|
90
|
-
if (draggable === null || unref(context.destroyOnClose)) {
|
|
91
|
-
drag(dragWrap);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
watchEffect(function () {
|
|
96
|
-
if (!unref(context.visible) || !unref(context.draggable)) {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
useTimeoutFn(function () {
|
|
100
|
-
handleDrag();
|
|
101
|
-
}, 30);
|
|
102
|
-
});
|
|
103
|
-
return {
|
|
104
|
-
locator: locator,
|
|
105
|
-
sign: sign,
|
|
106
|
-
moving: moving
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export { useModalDragMove };
|
|
11
|
+
import{ref as e,reactive as t,getCurrentInstance as o,watchEffect as n,unref as l}from"vue";import{useTimeoutFn as r}from"./useTimeout.js";import{clamp as u}from"../utils/index.js";import{tryOnUnmounted as i}from"@vueuse/core";function a(a){var d=e(!1),v=t({top:null,bottom:null,left:null,right:null}),m=t({x:void 0,y:void 0,l:void 0,t:void 0}),s=o(),p=function(e){if(e){e.setAttribute("data-drag",String(l(a.draggable)));var t=e.querySelector(".".concat(a.moverEl)),o=s.proxy,n=o.$el;t&&n&&l(a.draggable)&&(t.style.cursor="move",t.onmousedown=function(e){var n;if(e&&!function(e){var t=window.getSelection();if(!t||t.isCollapsed)return!1;try{var o=t.getRangeAt(0);return e.contains(o.commonAncestorContainer)}catch(e){return!1}}(t)){var l,r,i=(a.props.modally?s.refs.body:o.$el).getBoundingClientRect();if(m.l=i.left,m.t=i.top,m.x=e.x,m.y=e.y,!e||["svg","path"].includes(null==e||null===(n=e.target)||void 0===n?void 0:n.nodeName))null===(l=a.props)||void 0===l||null===(r=l.onModalMousedown)||void 0===r||r.call(l);var p=function(e){var t=e.x-m.x,o=e.y-m.y;if(!d.value){if(Math.abs(t)<5&&Math.abs(o)<5)return;d.value=!0}if(d.value&&!a.maximum.value){var n,l;if(e.preventDefault(),delete v.right,delete v.bottom,a.props.extent){var r=a.props.extent,i=s.refs.body.getBoundingClientRect(),p=null!=r.left?r.left:-Number.MAX_VALUE,c=null!=r.top?r.top:-Number.MAX_VALUE,f=null!=r.right?window.innerWidth-r.right-i.width:Number.MAX_VALUE,g=null!=r.bottom?window.innerHeight-r.bottom-i.height:Number.MAX_VALUE;v.left=u(m.l+t,p,f),v.top=u(m.t+o,c,g)}else v.left=m.l+t,v.top=m.t+o;v.right="unset !important",v.bottom="unset !important",s.emit("update:offset",v),null===(n=a.props)||void 0===n||null===(l=n.onModalMousemove)||void 0===l||l.call(n,e)}},c=function(e){var t,o,n;(d.value=!1,document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",c),!e||["svg","path"].includes(null==e||null===(t=e.target)||void 0===t?void 0:t.nodeName))&&(null===(o=a.props)||void 0===o||null===(n=o.onModalMouseup)||void 0===n||n.call(o))};document.addEventListener("mousemove",p),document.addEventListener("mouseup",c)}})}},c=function(){var e=s.proxy.$el;if(e){var t,o=(t="display",getComputedStyle(e)[t]),n=e.getAttribute("data-drag");"none"!==o&&(null===n||l(a.destroyOnClose))&&p(e)}};return n(function(){l(a.visible)&&l(a.draggable)&&r(function(){c()},30)}),i(function(){d.value=!1,document.removeEventListener("mousemove",null),document.removeEventListener("mouseup",null)}),{locator:v,sign:m,moving:d}}export{a as useModalDragMove};
|