@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,395 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { useRenderSelect } from './components/useRenderSelect.js';
|
|
11
|
-
import { useRenderRadio } from './components/useRenderRadio.js';
|
|
12
|
-
import { useRenderCheckbox } from './components/useRenderCheckbox.js';
|
|
13
|
-
import { findIndex } from '../../../utils/index.js';
|
|
14
|
-
import { set, get } from 'lodash-es';
|
|
15
|
-
import { ComponentNameEnum } from './types/index.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
|
+
*/
|
|
16
10
|
|
|
17
|
-
|
|
18
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
19
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
20
|
-
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; }
|
|
21
|
-
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; }
|
|
22
|
-
function _isSlot(s) {
|
|
23
|
-
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
24
|
-
}
|
|
25
|
-
var _useRenderSelect = useRenderSelect(),
|
|
26
|
-
renderSelectOptions = _useRenderSelect.renderSelectOptions;
|
|
27
|
-
var _useRenderRadio = useRenderRadio(),
|
|
28
|
-
renderRadioOptions = _useRenderRadio.renderRadioOptions;
|
|
29
|
-
var _useRenderCheckbox = useRenderCheckbox(),
|
|
30
|
-
renderCheckboxOptions = _useRenderCheckbox.renderCheckboxOptions;
|
|
31
|
-
var script = defineComponent({
|
|
32
|
-
name: 'Form',
|
|
33
|
-
components: {
|
|
34
|
-
ElCol: ElCol,
|
|
35
|
-
ElForm: ElForm,
|
|
36
|
-
ElFormItem: ElFormItem,
|
|
37
|
-
ElRow: ElRow
|
|
38
|
-
},
|
|
39
|
-
props: {
|
|
40
|
-
schema: {
|
|
41
|
-
type: Array,
|
|
42
|
-
"default": function _default() {
|
|
43
|
-
return [];
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
isCol: propTypes.bool.def(true),
|
|
47
|
-
model: {
|
|
48
|
-
type: Object,
|
|
49
|
-
"default": function _default() {
|
|
50
|
-
return {};
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
autoSetPlaceholder: propTypes.bool.def(true),
|
|
54
|
-
isCustom: propTypes.bool.def(false),
|
|
55
|
-
labelWidth: propTypes.oneOfType([String, Number]).def('auto'),
|
|
56
|
-
rules: {
|
|
57
|
-
type: Object,
|
|
58
|
-
"default": function _default() {
|
|
59
|
-
return {};
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
labelPosition: propTypes.oneOf(['left', 'right', 'top']).def('right'),
|
|
63
|
-
labelSuffix: propTypes.string.def(''),
|
|
64
|
-
hideRequiredAsterisk: propTypes.bool.def(false),
|
|
65
|
-
requireAsteriskPosition: propTypes.oneOf(['left', 'right']).def('left'),
|
|
66
|
-
showMessage: propTypes.bool.def(true),
|
|
67
|
-
inlineMessage: propTypes.bool.def(false),
|
|
68
|
-
statusIcon: propTypes.bool.def(false),
|
|
69
|
-
validateOnRuleChange: propTypes.bool.def(true),
|
|
70
|
-
size: {
|
|
71
|
-
type: String,
|
|
72
|
-
"default": undefined
|
|
73
|
-
},
|
|
74
|
-
disabled: propTypes.bool.def(false),
|
|
75
|
-
scrollToError: propTypes.bool.def(false),
|
|
76
|
-
scrollToErrorOffset: propTypes.oneOfType([Boolean, Object]).def(undefined)
|
|
77
|
-
},
|
|
78
|
-
emits: ['register'],
|
|
79
|
-
setup: function setup(props, _ref) {
|
|
80
|
-
var slots = _ref.slots,
|
|
81
|
-
expose = _ref.expose,
|
|
82
|
-
emit = _ref.emit;
|
|
83
|
-
var elFormRef = ref();
|
|
84
|
-
var mergeProps$1 = ref({});
|
|
85
|
-
var getProps = computed(function () {
|
|
86
|
-
var propsObj = _objectSpread({}, props);
|
|
87
|
-
Object.assign(propsObj, unref(mergeProps$1));
|
|
88
|
-
return propsObj;
|
|
89
|
-
});
|
|
90
|
-
var formComponents = ref({});
|
|
91
|
-
var formItemComponents = ref({});
|
|
92
|
-
var formModel = ref(props.model);
|
|
93
|
-
onMounted(function () {
|
|
94
|
-
var _unref;
|
|
95
|
-
emit('register', (_unref = unref(elFormRef)) === null || _unref === void 0 ? void 0 : _unref.$parent, unref(elFormRef));
|
|
96
|
-
});
|
|
97
|
-
var setValues = function setValues() {
|
|
98
|
-
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
99
|
-
formModel.value = Object.assign(unref(formModel), data);
|
|
100
|
-
};
|
|
101
|
-
var setProps = function setProps() {
|
|
102
|
-
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
103
|
-
mergeProps$1.value = Object.assign(unref(mergeProps$1), props);
|
|
104
|
-
};
|
|
105
|
-
var delSchema = function delSchema(field) {
|
|
106
|
-
var _unref2 = unref(getProps),
|
|
107
|
-
schema = _unref2.schema;
|
|
108
|
-
var index = findIndex(schema, function (v) {
|
|
109
|
-
return v.field === field;
|
|
110
|
-
});
|
|
111
|
-
if (index > -1) {
|
|
112
|
-
schema.splice(index, 1);
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
var addSchema = function addSchema(formSchema, index) {
|
|
116
|
-
var _unref3 = unref(getProps),
|
|
117
|
-
schema = _unref3.schema;
|
|
118
|
-
if (index !== void 0) {
|
|
119
|
-
schema.splice(index, 0, formSchema);
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
schema.push(formSchema);
|
|
123
|
-
};
|
|
124
|
-
var setSchema = function setSchema(schemaProps) {
|
|
125
|
-
var _unref4 = unref(getProps),
|
|
126
|
-
schema = _unref4.schema;
|
|
127
|
-
var _iterator = _createForOfIteratorHelper(schema),
|
|
128
|
-
_step;
|
|
129
|
-
try {
|
|
130
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
131
|
-
var v = _step.value;
|
|
132
|
-
var _iterator2 = _createForOfIteratorHelper(schemaProps),
|
|
133
|
-
_step2;
|
|
134
|
-
try {
|
|
135
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
136
|
-
var item = _step2.value;
|
|
137
|
-
if (v.field === item.field) {
|
|
138
|
-
set(v, item.path, item.value);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
} catch (err) {
|
|
142
|
-
_iterator2.e(err);
|
|
143
|
-
} finally {
|
|
144
|
-
_iterator2.f();
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
} catch (err) {
|
|
148
|
-
_iterator.e(err);
|
|
149
|
-
} finally {
|
|
150
|
-
_iterator.f();
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
var getOptions = /*#__PURE__*/function () {
|
|
154
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(fn, item) {
|
|
155
|
-
var options;
|
|
156
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
157
|
-
while (1) switch (_context.prev = _context.next) {
|
|
158
|
-
case 0:
|
|
159
|
-
_context.next = 1;
|
|
160
|
-
return fn();
|
|
161
|
-
case 1:
|
|
162
|
-
options = _context.sent;
|
|
163
|
-
if (!(!options || options.length == 0)) {
|
|
164
|
-
_context.next = 2;
|
|
165
|
-
break;
|
|
166
|
-
}
|
|
167
|
-
return _context.abrupt("return");
|
|
168
|
-
case 2:
|
|
169
|
-
setSchema([{
|
|
170
|
-
field: item.field,
|
|
171
|
-
path: item.component === ComponentNameEnum.TREE_SELECT || item.component === ComponentNameEnum.TRANSFER ? 'componentProps.data' : 'componentProps.options',
|
|
172
|
-
value: options
|
|
173
|
-
}]);
|
|
174
|
-
case 3:
|
|
175
|
-
case "end":
|
|
176
|
-
return _context.stop();
|
|
177
|
-
}
|
|
178
|
-
}, _callee);
|
|
179
|
-
}));
|
|
180
|
-
return function getOptions(_x, _x2) {
|
|
181
|
-
return _ref2.apply(this, arguments);
|
|
182
|
-
};
|
|
183
|
-
}();
|
|
184
|
-
var getComponentExpose = function getComponentExpose(filed) {
|
|
185
|
-
return unref(formComponents)[filed];
|
|
186
|
-
};
|
|
187
|
-
var getFormItemExpose = function getFormItemExpose(filed) {
|
|
188
|
-
return unref(formItemComponents)[filed];
|
|
189
|
-
};
|
|
190
|
-
var setComponentRefMap = function setComponentRefMap(ref, filed) {
|
|
191
|
-
formComponents.value[filed] = ref;
|
|
192
|
-
};
|
|
193
|
-
var setFormItemRefMap = function setFormItemRefMap(ref, filed) {
|
|
194
|
-
formItemComponents.value[filed] = ref;
|
|
195
|
-
};
|
|
196
|
-
expose({
|
|
197
|
-
setValues: setValues,
|
|
198
|
-
formModel: formModel,
|
|
199
|
-
setProps: setProps,
|
|
200
|
-
delSchema: delSchema,
|
|
201
|
-
addSchema: addSchema,
|
|
202
|
-
setSchema: setSchema,
|
|
203
|
-
getComponentExpose: getComponentExpose,
|
|
204
|
-
getFormItemExpose: getFormItemExpose
|
|
205
|
-
});
|
|
206
|
-
watch(function () {
|
|
207
|
-
return unref(getProps).schema;
|
|
208
|
-
}, function () {
|
|
209
|
-
var schema = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
210
|
-
formModel.value = initModel(schema, unref(formModel));
|
|
211
|
-
}, {
|
|
212
|
-
immediate: true,
|
|
213
|
-
deep: true
|
|
214
|
-
});
|
|
215
|
-
var renderWrap = function renderWrap() {
|
|
216
|
-
var _slot;
|
|
217
|
-
var _unref5 = unref(getProps),
|
|
218
|
-
isCol = _unref5.isCol;
|
|
219
|
-
var content = isCol ? createVNode(ElRow, {
|
|
220
|
-
"gutter": 20
|
|
221
|
-
}, _isSlot(_slot = renderFormItemWrap()) ? _slot : {
|
|
222
|
-
"default": function _default() {
|
|
223
|
-
return [_slot];
|
|
224
|
-
}
|
|
225
|
-
}) : renderFormItemWrap();
|
|
226
|
-
return content;
|
|
227
|
-
};
|
|
228
|
-
var renderFormItemWrap = function renderFormItemWrap() {
|
|
229
|
-
var _unref6 = unref(getProps),
|
|
230
|
-
_unref6$schema = _unref6.schema,
|
|
231
|
-
schema = _unref6$schema === void 0 ? [] : _unref6$schema,
|
|
232
|
-
isCol = _unref6.isCol;
|
|
233
|
-
return schema.filter(function (v) {
|
|
234
|
-
return !v.remove;
|
|
235
|
-
}).map(function (item) {
|
|
236
|
-
var _slot2;
|
|
237
|
-
var isDivider = item.component === 'Divider';
|
|
238
|
-
var Com = componentMap['Divider'];
|
|
239
|
-
return isDivider ? createVNode(Com, _objectSpread({
|
|
240
|
-
contentPosition: 'left'
|
|
241
|
-
}, item.componentProps), {
|
|
242
|
-
"default": function _default() {
|
|
243
|
-
return [item === null || item === void 0 ? void 0 : item.label];
|
|
244
|
-
}
|
|
245
|
-
}) : isCol ? createVNode(ElCol, setGridProp(item.colProps), _isSlot(_slot2 = renderFormItem(item)) ? _slot2 : {
|
|
246
|
-
"default": function _default() {
|
|
247
|
-
return [_slot2];
|
|
248
|
-
}
|
|
249
|
-
}) : renderFormItem(item);
|
|
250
|
-
});
|
|
251
|
-
};
|
|
252
|
-
var renderFormItem = function renderFormItem(item) {
|
|
253
|
-
var _item$componentProps, _item$componentProps2, _item$formItemProps3, _item$formItemProps5;
|
|
254
|
-
if (item.optionApi && (!((_item$componentProps = item.componentProps) !== null && _item$componentProps !== void 0 && _item$componentProps.options) || !((_item$componentProps2 = item.componentProps) !== null && _item$componentProps2 !== void 0 && _item$componentProps2.options.length))) {
|
|
255
|
-
getOptions(item.optionApi, item);
|
|
256
|
-
}
|
|
257
|
-
var formItemSlots = {
|
|
258
|
-
"default": function _default() {
|
|
259
|
-
var _item$formItemProps;
|
|
260
|
-
if (item !== null && item !== void 0 && (_item$formItemProps = item.formItemProps) !== null && _item$formItemProps !== void 0 && (_item$formItemProps = _item$formItemProps.slots) !== null && _item$formItemProps !== void 0 && _item$formItemProps["default"]) {
|
|
261
|
-
var _item$formItemProps2;
|
|
262
|
-
return item === null || item === void 0 || (_item$formItemProps2 = item.formItemProps) === null || _item$formItemProps2 === void 0 || (_item$formItemProps2 = _item$formItemProps2.slots) === null || _item$formItemProps2 === void 0 ? void 0 : _item$formItemProps2["default"](formModel.value);
|
|
263
|
-
} else {
|
|
264
|
-
var _item$componentProps3;
|
|
265
|
-
var Com = componentMap[item.component];
|
|
266
|
-
var _unref7 = unref(getProps),
|
|
267
|
-
autoSetPlaceholder = _unref7.autoSetPlaceholder;
|
|
268
|
-
var componentSlots = (item === null || item === void 0 || (_item$componentProps3 = item.componentProps) === null || _item$componentProps3 === void 0 ? void 0 : _item$componentProps3.slots) || {};
|
|
269
|
-
var slotsMap = _objectSpread({}, setItemComponentSlots(componentSlots));
|
|
270
|
-
if (item.component === ComponentNameEnum.SELECT) {
|
|
271
|
-
slotsMap["default"] = !componentSlots["default"] ? function () {
|
|
272
|
-
return renderSelectOptions(item);
|
|
273
|
-
} : function () {
|
|
274
|
-
var _item$componentProps4;
|
|
275
|
-
return componentSlots["default"](unref(item === null || item === void 0 || (_item$componentProps4 = item.componentProps) === null || _item$componentProps4 === void 0 ? void 0 : _item$componentProps4.options));
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
if (item.component === ComponentNameEnum.SELECT_V2 && componentSlots["default"]) {
|
|
279
|
-
slotsMap["default"] = function (_ref3) {
|
|
280
|
-
var item = _ref3.item;
|
|
281
|
-
return componentSlots["default"](item);
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
|
-
if (item.component === ComponentNameEnum.RADIO_GROUP || item.component === ComponentNameEnum.RADIO_BUTTON) {
|
|
285
|
-
slotsMap["default"] = !componentSlots["default"] ? function () {
|
|
286
|
-
return renderRadioOptions(item);
|
|
287
|
-
} : function () {
|
|
288
|
-
var _item$componentProps5;
|
|
289
|
-
return componentSlots["default"](unref(item === null || item === void 0 || (_item$componentProps5 = item.componentProps) === null || _item$componentProps5 === void 0 ? void 0 : _item$componentProps5.options));
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
if (item.component === ComponentNameEnum.CHECKBOX_GROUP || item.component === ComponentNameEnum.CHECKBOX_BUTTON) {
|
|
293
|
-
slotsMap["default"] = !componentSlots["default"] ? function () {
|
|
294
|
-
return renderCheckboxOptions(item);
|
|
295
|
-
} : function () {
|
|
296
|
-
var _item$componentProps6;
|
|
297
|
-
return componentSlots["default"](unref(item === null || item === void 0 || (_item$componentProps6 = item.componentProps) === null || _item$componentProps6 === void 0 ? void 0 : _item$componentProps6.options));
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
var Comp = function Comp() {
|
|
301
|
-
var _item$componentProps7, _item$componentProps8;
|
|
302
|
-
var itemVal = computed({
|
|
303
|
-
get: function get$1() {
|
|
304
|
-
return get(formModel.value, item.field);
|
|
305
|
-
},
|
|
306
|
-
set: function set$1(val) {
|
|
307
|
-
set(formModel.value, item.field, val);
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
return item.component === ComponentNameEnum.UPLOAD ? createVNode(Com, mergeProps({
|
|
311
|
-
"file-list": itemVal.value,
|
|
312
|
-
"onUpdate:file-list": function onUpdateFileList($event) {
|
|
313
|
-
return itemVal.value = $event;
|
|
314
|
-
},
|
|
315
|
-
"ref": function ref(el) {
|
|
316
|
-
return setComponentRefMap(el, item.field);
|
|
317
|
-
}
|
|
318
|
-
}, autoSetPlaceholder && setTextPlaceholder(item), setComponentProps(item), {
|
|
319
|
-
"style": ((_item$componentProps7 = item.componentProps) === null || _item$componentProps7 === void 0 ? void 0 : _item$componentProps7.style) || {
|
|
320
|
-
width: '100%'
|
|
321
|
-
}
|
|
322
|
-
}), slotsMap) : createVNode(Com, mergeProps({
|
|
323
|
-
"modelValue": itemVal.value,
|
|
324
|
-
"onUpdate:modelValue": function onUpdateModelValue($event) {
|
|
325
|
-
return itemVal.value = $event;
|
|
326
|
-
},
|
|
327
|
-
"ref": function ref(el) {
|
|
328
|
-
return setComponentRefMap(el, item.field);
|
|
329
|
-
}
|
|
330
|
-
}, autoSetPlaceholder && setTextPlaceholder(item), setComponentProps(item), {
|
|
331
|
-
"style": ((_item$componentProps8 = item.componentProps) === null || _item$componentProps8 === void 0 ? void 0 : _item$componentProps8.style) || {}
|
|
332
|
-
}), slotsMap);
|
|
333
|
-
};
|
|
334
|
-
return createVNode(Fragment, null, [Comp()]);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
};
|
|
338
|
-
if (item !== null && item !== void 0 && (_item$formItemProps3 = item.formItemProps) !== null && _item$formItemProps3 !== void 0 && (_item$formItemProps3 = _item$formItemProps3.slots) !== null && _item$formItemProps3 !== void 0 && _item$formItemProps3.label) {
|
|
339
|
-
formItemSlots.label = function () {
|
|
340
|
-
var _item$formItemProps4;
|
|
341
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
342
|
-
args[_key] = arguments[_key];
|
|
343
|
-
}
|
|
344
|
-
return item === null || item === void 0 || (_item$formItemProps4 = item.formItemProps) === null || _item$formItemProps4 === void 0 || (_item$formItemProps4 = _item$formItemProps4.slots) === null || _item$formItemProps4 === void 0 ? void 0 : _item$formItemProps4.label.apply(_item$formItemProps4, args);
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
|
-
if (item !== null && item !== void 0 && (_item$formItemProps5 = item.formItemProps) !== null && _item$formItemProps5 !== void 0 && (_item$formItemProps5 = _item$formItemProps5.slots) !== null && _item$formItemProps5 !== void 0 && _item$formItemProps5.error) {
|
|
348
|
-
formItemSlots.error = function () {
|
|
349
|
-
var _item$formItemProps6;
|
|
350
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
351
|
-
args[_key2] = arguments[_key2];
|
|
352
|
-
}
|
|
353
|
-
return item === null || item === void 0 || (_item$formItemProps6 = item.formItemProps) === null || _item$formItemProps6 === void 0 || (_item$formItemProps6 = _item$formItemProps6.slots) === null || _item$formItemProps6 === void 0 ? void 0 : _item$formItemProps6.error.apply(_item$formItemProps6, args);
|
|
354
|
-
};
|
|
355
|
-
}
|
|
356
|
-
return withDirectives(createVNode(ElFormItem, mergeProps({
|
|
357
|
-
"ref": function ref(el) {
|
|
358
|
-
return setFormItemRefMap(el, item.field);
|
|
359
|
-
}
|
|
360
|
-
}, item.formItemProps || {}, {
|
|
361
|
-
"prop": item.field,
|
|
362
|
-
"label": item.label || ''
|
|
363
|
-
}), _isSlot(formItemSlots) ? formItemSlots : {
|
|
364
|
-
"default": function _default() {
|
|
365
|
-
return [formItemSlots];
|
|
366
|
-
}
|
|
367
|
-
}), [[vShow, !item.hidden]]);
|
|
368
|
-
};
|
|
369
|
-
var getFormBindValue = function getFormBindValue() {
|
|
370
|
-
var delKeys = ['schema', 'isCol', 'autoSetPlaceholder', 'isCustom', 'model'];
|
|
371
|
-
var props = _objectSpread({}, unref(getProps));
|
|
372
|
-
for (var key in props) {
|
|
373
|
-
if (delKeys.indexOf(key) !== -1) {
|
|
374
|
-
delete props[key];
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
return props;
|
|
378
|
-
};
|
|
379
|
-
return function () {
|
|
380
|
-
return createVNode(ElForm, mergeProps({
|
|
381
|
-
"ref": elFormRef
|
|
382
|
-
}, getFormBindValue(), {
|
|
383
|
-
"model": unref(getProps).isCustom ? unref(getProps).model : formModel
|
|
384
|
-
}), {
|
|
385
|
-
"default": function _default() {
|
|
386
|
-
var _unref8 = unref(getProps),
|
|
387
|
-
isCustom = _unref8.isCustom;
|
|
388
|
-
return isCustom ? getSlot(slots, 'default') : renderWrap();
|
|
389
|
-
}
|
|
390
|
-
});
|
|
391
|
-
};
|
|
392
|
-
}
|
|
393
|
-
});
|
|
394
|
-
|
|
395
|
-
export { script as default };
|
|
11
|
+
import{defineComponent as e,ref as o,computed as n,unref as t,onMounted as r,watch as l,createVNode as u,mergeProps as i,withDirectives as a,vShow as f,isVNode as s,Fragment as d}from"vue";import{objectSpread2 as c,createForOfIteratorHelper as p,asyncToGenerator as m,regenerator as v}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{ElCol as h,ElForm as b,ElFormItem as P,ElRow as g}from"element-plus";import{componentMap as O}from"./helper/componentMap.js";import{getSlot as y}from"@dfsj/utils";import C from"vue-types";import{initModel as j,setGridProp as E,setItemComponentSlots as S,setTextPlaceholder as R,setComponentProps as T}from"./helper/index.js";import{useRenderSelect as I}from"./components/useRenderSelect.js";import{useRenderRadio as x}from"./components/useRenderRadio.js";import{useRenderCheckbox as A}from"./components/useRenderCheckbox.js";import{findIndex as _}from"../../../utils/index.js";import{set as w,get as U}from"lodash-es";import{ComponentNameEnum as B}from"./types/index.js";function F(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}var k=I().renderSelectOptions,D=x().renderRadioOptions,H=A().renderCheckboxOptions,L=e({name:"Form",components:{ElCol:h,ElForm:b,ElFormItem:P,ElRow:g},props:{schema:{type:Array,default:function(){return[]}},isCol:C.bool.def(!0),model:{type:Object,default:function(){return{}}},autoSetPlaceholder:C.bool.def(!0),isCustom:C.bool.def(!1),labelWidth:C.oneOfType([String,Number]).def("auto"),rules:{type:Object,default:function(){return{}}},labelPosition:C.oneOf(["left","right","top"]).def("right"),labelSuffix:C.string.def(""),hideRequiredAsterisk:C.bool.def(!1),requireAsteriskPosition:C.oneOf(["left","right"]).def("left"),showMessage:C.bool.def(!0),inlineMessage:C.bool.def(!1),statusIcon:C.bool.def(!1),validateOnRuleChange:C.bool.def(!0),size:{type:String,default:void 0},disabled:C.bool.def(!1),scrollToError:C.bool.def(!1),scrollToErrorOffset:C.oneOfType([Boolean,Object]).def(void 0)},emits:["register"],setup:function(e,s){var C=s.slots,I=s.expose,x=s.emit,A=o(),L=o({}),M=n(function(){var o=c({},e);return Object.assign(o,t(L)),o}),N=o({}),V=o({}),G=o(e.model);r(function(){var e;x("register",null===(e=t(A))||void 0===e?void 0:e.$parent,t(A))});var q=function(e){var o,n=t(M).schema,r=p(n);try{for(r.s();!(o=r.n()).done;){var l,u=o.value,i=p(e);try{for(i.s();!(l=i.n()).done;){var a=l.value;u.field===a.field&&w(u,a.path,a.value)}}catch(e){i.e(e)}finally{i.f()}}}catch(e){r.e(e)}finally{r.f()}},K=function(){var e=m(v().m(function e(o,n){var t;return v().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,o();case 1:if((t=e.v)&&0!=t.length){e.n=2;break}return e.a(2);case 2:q([{field:n.field,path:n.component===B.TREE_SELECT||n.component===B.TRANSFER?"componentProps.data":"componentProps.options",value:t}]);case 3:return e.a(2)}},e)}));return function(o,n){return e.apply(this,arguments)}}(),X=function(e,o){N.value[o]=e};I({setValues:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};G.value=Object.assign(t(G),e)},formModel:G,setProps:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};L.value=Object.assign(t(L),e)},delSchema:function(e){var o=t(M).schema,n=_(o,function(o){return o.field===e});n>-1&&o.splice(n,1)},addSchema:function(e,o){var n=t(M).schema;void 0===o?n.push(e):n.splice(o,0,e)},setSchema:q,getComponentExpose:function(e){return t(N)[e]},getFormItemExpose:function(e){return t(V)[e]}}),l(function(){return t(M).schema},function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];G.value=j(e,t(G))},{immediate:!0,deep:!0});var z=function(){var e=t(M),o=e.schema,n=void 0===o?[]:o,r=e.isCol;return n.filter(function(e){return!e.remove}).map(function(e){var o,n="Divider"===e.component,t=O.Divider;return n?u(t,c({contentPosition:"left"},e.componentProps),{default:function(){return[null==e?void 0:e.label]}}):r?u(h,E(e.colProps),F(o=W(e))?o:{default:function(){return[o]}}):W(e)})},W=function(e){var o,r,l,s;!e.optionApi||null!==(o=e.componentProps)&&void 0!==o&&o.options&&null!==(r=e.componentProps)&&void 0!==r&&r.options.length||K(e.optionApi,e);var p={default:function(){var o,r;if(null!=e&&null!==(o=e.formItemProps)&&void 0!==o&&null!==(o=o.slots)&&void 0!==o&&o.default)return null==e||null===(r=e.formItemProps)||void 0===r||null===(r=r.slots)||void 0===r?void 0:r.default(G.value);var l,a=O[e.component],f=t(M).autoSetPlaceholder,s=(null==e||null===(l=e.componentProps)||void 0===l?void 0:l.slots)||{},p=c({},S(s));e.component===B.SELECT&&(p.default=s.default?function(){var o;return s.default(t(null==e||null===(o=e.componentProps)||void 0===o?void 0:o.options))}:function(){return k(e)}),e.component===B.SELECT_V2&&s.default&&(p.default=function(e){var o=e.item;return s.default(o)}),e.component!==B.RADIO_GROUP&&e.component!==B.RADIO_BUTTON||(p.default=s.default?function(){var o;return s.default(t(null==e||null===(o=e.componentProps)||void 0===o?void 0:o.options))}:function(){return D(e)}),e.component!==B.CHECKBOX_GROUP&&e.component!==B.CHECKBOX_BUTTON||(p.default=s.default?function(){var o;return s.default(t(null==e||null===(o=e.componentProps)||void 0===o?void 0:o.options))}:function(){return H(e)});var m,v,h;return u(d,null,[(h=n({get:function(){return U(G.value,e.field)},set:function(o){w(G.value,e.field,o)}}),e.component===B.UPLOAD?u(a,i({"file-list":h.value,"onUpdate:file-list":function(e){return h.value=e},ref:function(o){return X(o,e.field)}},f&&R(e),T(e),{style:(null===(m=e.componentProps)||void 0===m?void 0:m.style)||{width:"100%"}}),p):u(a,i({modelValue:h.value,"onUpdate:modelValue":function(e){return h.value=e},ref:function(o){return X(o,e.field)}},f&&R(e),T(e),{style:(null===(v=e.componentProps)||void 0===v?void 0:v.style)||{}}),p))])}};return null!=e&&null!==(l=e.formItemProps)&&void 0!==l&&null!==(l=l.slots)&&void 0!==l&&l.label&&(p.label=function(){for(var o,n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];return null==e||null===(o=e.formItemProps)||void 0===o||null===(o=o.slots)||void 0===o?void 0:o.label.apply(o,t)}),null!=e&&null!==(s=e.formItemProps)&&void 0!==s&&null!==(s=s.slots)&&void 0!==s&&s.error&&(p.error=function(){for(var o,n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];return null==e||null===(o=e.formItemProps)||void 0===o||null===(o=o.slots)||void 0===o?void 0:o.error.apply(o,t)}),a(u(P,i({ref:function(o){return function(e,o){V.value[o]=e}(o,e.field)}},e.formItemProps||{},{prop:e.field,label:e.label||""}),F(p)?p:{default:function(){return[p]}}),[[f,!e.hidden]])};return function(){return u(b,i({ref:A},function(){var e=["schema","isCol","autoSetPlaceholder","isCustom","model"],o=c({},t(M));for(var n in o)-1!==e.indexOf(n)&&delete o[n];return o}(),{model:t(M).isCustom?t(M).model:G}),{default:function(){var e;return t(M).isCustom?y(C,"default"):t(M).isCol?u(g,{gutter:20},F(e=z())?e:{default:function(){return[e]}}):z()}})}}});export{L as default};
|
|
@@ -1,33 +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 useRenderCheckbox = function useRenderCheckbox() {
|
|
8
|
-
var renderCheckboxOptions = function renderCheckboxOptions(item) {
|
|
9
|
-
var _componentProps$props, _componentProps$props2, _componentProps$props3, _componentProps$optio;
|
|
10
|
-
var componentProps = item === null || item === void 0 ? void 0 : item.componentProps;
|
|
11
|
-
var valueAlias = (componentProps === null || componentProps === void 0 || (_componentProps$props = componentProps.props) === null || _componentProps$props === void 0 ? void 0 : _componentProps$props.value) || 'value';
|
|
12
|
-
var labelAlias = (componentProps === null || componentProps === void 0 || (_componentProps$props2 = componentProps.props) === null || _componentProps$props2 === void 0 ? void 0 : _componentProps$props2.label) || 'label';
|
|
13
|
-
var disabledAlias = (componentProps === null || componentProps === void 0 || (_componentProps$props3 = componentProps.props) === null || _componentProps$props3 === void 0 ? void 0 : _componentProps$props3.disabled) || 'disabled';
|
|
14
|
-
var Com = item.component === ComponentNameEnum.CHECKBOX_GROUP ? ElCheckbox : ElCheckboxButton;
|
|
15
|
-
return componentProps === null || componentProps === void 0 || (_componentProps$optio = componentProps.options) === null || _componentProps$optio === void 0 ? void 0 : _componentProps$optio.map(function (option) {
|
|
16
|
-
option.value;
|
|
17
|
-
var other = _objectWithoutProperties(option, _excluded);
|
|
18
|
-
return createVNode(Com, mergeProps(other, {
|
|
19
|
-
"disabled": option[disabledAlias || 'disabled'],
|
|
20
|
-
"label": option[valueAlias || 'value']
|
|
21
|
-
}), {
|
|
22
|
-
"default": function _default() {
|
|
23
|
-
return [option[labelAlias || 'label']];
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
return {
|
|
29
|
-
renderCheckboxOptions: renderCheckboxOptions
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export { useRenderCheckbox };
|
|
11
|
+
import{createVNode as l,mergeProps as o}from"vue";import{objectWithoutProperties as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{ComponentNameEnum as n}from"../types/index.js";import{ElCheckbox as r,ElCheckboxButton as u}from"element-plus";var i=["value"],t=function(){return{renderCheckboxOptions:function(t){var p,a,d,v,s=null==t?void 0:t.componentProps,m=(null==s||null===(p=s.props)||void 0===p?void 0:p.value)||"value",b=(null==s||null===(a=s.props)||void 0===a?void 0:a.label)||"label",f=(null==s||null===(d=s.props)||void 0===d?void 0:d.disabled)||"disabled",c=t.component===n.CHECKBOX_GROUP?r:u;return null==s||null===(v=s.options)||void 0===v?void 0:v.map(function(n){n.value;var r=e(n,i),u=n;return l(c,o(r,{disabled:u[f||"disabled"],label:u[m||"value"]}),{default:function(){return[u[b||"label"]]}})})}}};export{t as useRenderCheckbox};
|
|
@@ -1,33 +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 useRenderRadio = function useRenderRadio() {
|
|
8
|
-
var renderRadioOptions = function renderRadioOptions(item) {
|
|
9
|
-
var _componentProps$props, _componentProps$props2, _componentProps$props3, _componentProps$optio;
|
|
10
|
-
var componentProps = item === null || item === void 0 ? void 0 : item.componentProps;
|
|
11
|
-
var valueAlias = (componentProps === null || componentProps === void 0 || (_componentProps$props = componentProps.props) === null || _componentProps$props === void 0 ? void 0 : _componentProps$props.value) || 'value';
|
|
12
|
-
var labelAlias = (componentProps === null || componentProps === void 0 || (_componentProps$props2 = componentProps.props) === null || _componentProps$props2 === void 0 ? void 0 : _componentProps$props2.label) || 'label';
|
|
13
|
-
var disabledAlias = (componentProps === null || componentProps === void 0 || (_componentProps$props3 = componentProps.props) === null || _componentProps$props3 === void 0 ? void 0 : _componentProps$props3.disabled) || 'disabled';
|
|
14
|
-
var Com = item.component === ComponentNameEnum.RADIO_GROUP ? ElRadio : ElRadioButton;
|
|
15
|
-
return componentProps === null || componentProps === void 0 || (_componentProps$optio = componentProps.options) === null || _componentProps$optio === void 0 ? void 0 : _componentProps$optio.map(function (option) {
|
|
16
|
-
option.value;
|
|
17
|
-
var other = _objectWithoutProperties(option, _excluded);
|
|
18
|
-
return createVNode(Com, mergeProps(other, {
|
|
19
|
-
"disabled": option[disabledAlias || 'disabled'],
|
|
20
|
-
"label": option[valueAlias || 'value']
|
|
21
|
-
}), {
|
|
22
|
-
"default": function _default() {
|
|
23
|
-
return [option[labelAlias || 'label']];
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
return {
|
|
29
|
-
renderRadioOptions: renderRadioOptions
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export { useRenderRadio };
|
|
11
|
+
import{createVNode as l,mergeProps as o}from"vue";import{objectWithoutProperties as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{ComponentNameEnum as n}from"../types/index.js";import{ElRadio as r,ElRadioButton as i}from"element-plus";var u=["value"],t=function(){return{renderRadioOptions:function(t){var a,p,d,v,s=null==t?void 0:t.componentProps,m=(null==s||null===(a=s.props)||void 0===a?void 0:a.value)||"value",b=(null==s||null===(p=s.props)||void 0===p?void 0:p.label)||"label",f=(null==s||null===(d=s.props)||void 0===d?void 0:d.disabled)||"disabled",c=t.component===n.RADIO_GROUP?r:i;return null==s||null===(v=s.options)||void 0===v?void 0:v.map(function(n){n.value;var r=e(n,u),i=n;return l(c,o(r,{disabled:i[f||"disabled"],label:i[m||"value"]}),{default:function(){return[i[b||"label"]]}})})}}};export{t as useRenderRadio};
|
|
@@ -1,52 +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
|
-
var renderSelectOptions = function renderSelectOptions(item) {
|
|
6
|
-
var _componentsProps$slot, _componentsProps$prop, _componentsProps$prop2, _componentsProps$opti;
|
|
7
|
-
var componentsProps = item === null || item === void 0 ? void 0 : item.componentProps;
|
|
8
|
-
var optionGroupDefaultSlot = componentsProps === null || componentsProps === void 0 || (_componentsProps$slot = componentsProps.slots) === null || _componentsProps$slot === void 0 ? void 0 : _componentsProps$slot.optionGroupDefault;
|
|
9
|
-
var labelAlias = componentsProps === null || componentsProps === void 0 || (_componentsProps$prop = componentsProps.props) === null || _componentsProps$prop === void 0 ? void 0 : _componentsProps$prop.label;
|
|
10
|
-
var keyAlias = componentsProps === null || componentsProps === void 0 || (_componentsProps$prop2 = componentsProps.props) === null || _componentsProps$prop2 === void 0 ? void 0 : _componentsProps$prop2.key;
|
|
11
|
-
return componentsProps === null || componentsProps === void 0 || (_componentsProps$opti = componentsProps.options) === null || _componentsProps$opti === void 0 ? void 0 : _componentsProps$opti.map(function (option) {
|
|
12
|
-
var _option$options;
|
|
13
|
-
if (option !== null && option !== void 0 && (_option$options = option.options) !== null && _option$options !== void 0 && _option$options.length) {
|
|
14
|
-
return optionGroupDefaultSlot ? optionGroupDefaultSlot(option) : createVNode(ElOptionGroup, {
|
|
15
|
-
"label": option[labelAlias || 'label'],
|
|
16
|
-
"key": option[keyAlias || 'key']
|
|
17
|
-
}, {
|
|
18
|
-
"default": function _default() {
|
|
19
|
-
var _option$options2;
|
|
20
|
-
return option === null || option === void 0 || (_option$options2 = option.options) === null || _option$options2 === void 0 ? void 0 : _option$options2.map(function (v) {
|
|
21
|
-
return renderSelectOptionItem(item, v);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
} else {
|
|
26
|
-
return renderSelectOptionItem(item, option);
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
var renderSelectOptionItem = function renderSelectOptionItem(item, option) {
|
|
31
|
-
var _componentsProps$prop3, _componentsProps$prop4, _componentsProps$prop5, _componentsProps$slot2;
|
|
32
|
-
var componentsProps = item.componentProps;
|
|
33
|
-
var labelAlias = componentsProps === null || componentsProps === void 0 || (_componentsProps$prop3 = componentsProps.props) === null || _componentsProps$prop3 === void 0 ? void 0 : _componentsProps$prop3.label;
|
|
34
|
-
var valueAlias = componentsProps === null || componentsProps === void 0 || (_componentsProps$prop4 = componentsProps.props) === null || _componentsProps$prop4 === void 0 ? void 0 : _componentsProps$prop4.value;
|
|
35
|
-
var keyAlias = componentsProps === null || componentsProps === void 0 || (_componentsProps$prop5 = componentsProps.props) === null || _componentsProps$prop5 === void 0 ? void 0 : _componentsProps$prop5.key;
|
|
36
|
-
var optionDefaultSlot = (_componentsProps$slot2 = componentsProps.slots) === null || _componentsProps$slot2 === void 0 ? void 0 : _componentsProps$slot2.optionDefault;
|
|
37
|
-
return createVNode(ElOption, mergeProps(option, {
|
|
38
|
-
"key": option[keyAlias || 'key'],
|
|
39
|
-
"label": option[labelAlias || 'label'],
|
|
40
|
-
"value": option[valueAlias || 'value']
|
|
41
|
-
}), {
|
|
42
|
-
"default": function _default() {
|
|
43
|
-
return optionDefaultSlot ? optionDefaultSlot(option) : undefined;
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
return {
|
|
48
|
-
renderSelectOptions: renderSelectOptions
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export { useRenderSelect };
|
|
11
|
+
import{createVNode as l,mergeProps as o}from"vue";import{ElOptionGroup as n,ElOption as u}from"element-plus";var e=function(){var e=function(n,e){var i,r,t,v,p=n.componentProps,d=null==p||null===(i=p.props)||void 0===i?void 0:i.label,a=null==p||null===(r=p.props)||void 0===r?void 0:r.value,s=null==p||null===(t=p.props)||void 0===t?void 0:t.key,f=null===(v=p.slots)||void 0===v?void 0:v.optionDefault,c=e;return l(u,o(e,{key:c[s||"key"],label:c[d||"label"],value:c[a||"value"]}),{default:function(){return f?f(e):void 0}})};return{renderSelectOptions:function(o){var u,i,r,t,v=null==o?void 0:o.componentProps,p=null==v||null===(u=v.slots)||void 0===u?void 0:u.optionGroupDefault,d=null==v||null===(i=v.props)||void 0===i?void 0:i.label,a=null==v||null===(r=v.props)||void 0===r?void 0:r.key;return null==v||null===(t=v.options)||void 0===t?void 0:t.map(function(u){var i,r=u;return null!=u&&null!==(i=u.options)&&void 0!==i&&i.length?p?p(u):l(n,{label:r[d||"label"],key:r[a||"key"]},{default:function(){var l;return null==u||null===(l=u.options)||void 0===l?void 0:l.map(function(l){return e(o,l)})}}):e(o,u)})}}};export{e as useRenderSelect};
|
|
@@ -1,33 +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
|
-
RadioGroup: ElRadioGroup,
|
|
9
|
-
RadioButton: ElRadioGroup,
|
|
10
|
-
CheckboxGroup: ElCheckboxGroup,
|
|
11
|
-
CheckboxButton: ElCheckboxGroup,
|
|
12
|
-
Input: ElInput,
|
|
13
|
-
Autocomplete: ElAutocomplete,
|
|
14
|
-
InputNumber: ElInputNumber,
|
|
15
|
-
Select: ElSelect,
|
|
16
|
-
Cascader: ElCascader,
|
|
17
|
-
Switch: ElSwitch,
|
|
18
|
-
Slider: ElSlider,
|
|
19
|
-
TimePicker: ElTimePicker,
|
|
20
|
-
DatePicker: ElDatePicker,
|
|
21
|
-
Rate: ElRate,
|
|
22
|
-
ColorPicker: ElColorPicker,
|
|
23
|
-
Transfer: ElTransfer,
|
|
24
|
-
Divider: ElDivider,
|
|
25
|
-
TimeSelect: ElTimeSelect,
|
|
26
|
-
SelectV2: ElSelectV2,
|
|
27
|
-
InputPassword: script,
|
|
28
|
-
Editor: script$1,
|
|
29
|
-
TreeSelect: ElTreeSelect,
|
|
30
|
-
Upload: ElUpload
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export { componentMap };
|
|
11
|
+
import{ElRadioGroup as r,ElCheckboxGroup as e,ElInput as o,ElAutocomplete as t,ElInputNumber as i,ElSelect as s,ElCascader as p,ElSwitch as u,ElSlider as c,ElTimePicker as d,ElDatePicker as a,ElRate as m,ElColorPicker as n,ElTransfer as l,ElDivider as P,ElTimeSelect as I,ElSelectV2 as v,ElTreeSelect as w,ElUpload as S}from"element-plus";import"../../../InputPassword/src/InputPassword.vue.js";import"../../../Editor/src/Editor.vue.js";import k from"../../../InputPassword/src/InputPassword.vue2.js";import E from"../../../Editor/src/Editor.vue2.js";var f={RadioGroup:r,RadioButton:r,CheckboxGroup:e,CheckboxButton:e,Input:o,Autocomplete:t,InputNumber:i,Select:s,Cascader:p,Switch:u,Slider:c,TimePicker:d,DatePicker:a,Rate:m,ColorPicker:n,Transfer:l,Divider:P,TimeSelect:I,SelectV2:v,InputPassword:k,Editor:E,TreeSelect:w,Upload:S};export{f as componentMap};
|