@qin-ui/antd-vue-pro 1.1.12 → 1.1.13
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/es/form/{index-b2d126ee.js → index-c1a5e7f6.js} +41 -43
- package/es/form/index.js +1 -1
- package/es/index.d.ts +1266 -1974
- package/es/index.js +2 -2
- package/es/style.css +5 -5
- package/es/table/index.js +18 -18
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inject, ref, h as h$1, getCurrentInstance, nextTick, reactive, defineComponent, createVNode, shallowRef, watch, unref, provide, watchEffect, onBeforeUnmount, computed, isRef, Fragment, Comment, Text, isVNode, onMounted, cloneVNode, Transition, withDirectives, resolveDirective, onUpdated, onUnmounted, toRef, withModifiers, vShow, onBeforeMount, Teleport, TransitionGroup, toRaw, resolveComponent, openBlock, createBlock, mergeProps, withCtx, createElementBlock, renderList, resolveDynamicComponent,
|
|
1
|
+
import { inject, ref, h as h$1, getCurrentInstance, nextTick, reactive, defineComponent, createVNode, shallowRef, watch, unref, provide, watchEffect, onBeforeUnmount, computed, isRef, Fragment, Comment, Text, isVNode, onMounted, cloneVNode, Transition, withDirectives, resolveDirective, onUpdated, onUnmounted, toRef, withModifiers, vShow, onBeforeMount, Teleport, TransitionGroup, toRaw, resolveComponent, openBlock, createBlock, mergeProps, withCtx, createElementBlock, renderList, resolveDynamicComponent, createSlots, createTextVNode, createCommentVNode, useAttrs, normalizeProps, renderSlot, toDisplayString, shallowReactive } from "vue";
|
|
2
2
|
import { Input, Textarea, InputSearch, InputPassword, InputNumber, Select, Cascader, DatePicker as DatePicker$1, RangePicker, TimePicker as TimePicker$1, CheckboxGroup, RadioGroup, Switch, Slider, TreeSelect, Transfer, Row as Row$1, Col as Col$1, FormItem as FormItem$1, message, Form as Form$2 } from "ant-design-vue";
|
|
3
3
|
import { INIT_PROPS_MAP, useInjectProps, INJECT_KEYS } from "../component-provider/index.js";
|
|
4
4
|
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
@@ -15744,15 +15744,15 @@ const UPDATE_ACTIVE_PATH = Symbol(
|
|
|
15744
15744
|
"setActivePath"
|
|
15745
15745
|
);
|
|
15746
15746
|
const RULE_TYPE_MAP = /* @__PURE__ */ new Map([
|
|
15747
|
-
["
|
|
15748
|
-
["
|
|
15749
|
-
["
|
|
15750
|
-
["
|
|
15751
|
-
["
|
|
15752
|
-
["
|
|
15753
|
-
["
|
|
15754
|
-
["
|
|
15755
|
-
["
|
|
15747
|
+
["setValue", "字段赋值"],
|
|
15748
|
+
["setHidden", "字段隐藏/显示"],
|
|
15749
|
+
["setDisabled", "字段禁用/启用"],
|
|
15750
|
+
["setOptions", "字段选项枚举变更"],
|
|
15751
|
+
["setRules", "字段校验规则变更"],
|
|
15752
|
+
["setField", "字段配置变更"],
|
|
15753
|
+
["triggerValidate", "字段触发校验"],
|
|
15754
|
+
["triggerClearValidate", "字段触发清除校验"],
|
|
15755
|
+
["triggerMessage", "字段触发提示"]
|
|
15756
15756
|
]);
|
|
15757
15757
|
const FunctionRegexp = /^\s*function\s*\w*\s*\([^)]*\)\s*{([\s\S]*)}/g;
|
|
15758
15758
|
const ArrowFunctionRegexp = /^\s*(?:\([^)]*\)|\w+)\s*=>\s*\(?({[\s\S]*}|[^;]*)\)?/g;
|
|
@@ -15840,14 +15840,17 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
15840
15840
|
return openBlock(), createElementBlock(Fragment, {
|
|
15841
15841
|
key: getPath(field.key) || index2
|
|
15842
15842
|
}, [
|
|
15843
|
-
field && !field.hidden ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.grid ? unref(Col$1) : unref(_sfc_main$2)),
|
|
15843
|
+
field && !field.hidden ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.grid ? unref(Col$1) : unref(_sfc_main$2)), mergeProps({
|
|
15844
|
+
key: 0,
|
|
15845
|
+
ref_for: true
|
|
15846
|
+
}, _ctx.grid ? unref(withDefaultGridItem)(field) : void 0), {
|
|
15844
15847
|
default: withCtx(() => [
|
|
15845
15848
|
createVNode(unref(_sfc_main$2), {
|
|
15846
15849
|
component: field.container,
|
|
15847
15850
|
path: getPath(field.key)
|
|
15848
15851
|
}, {
|
|
15849
15852
|
default: withCtx(() => [
|
|
15850
|
-
createVNode(unref(FormItem$1), mergeProps(withDefault(field), {
|
|
15853
|
+
createVNode(unref(FormItem$1), mergeProps({ ref_for: true }, withDefault(field), {
|
|
15851
15854
|
ref_for: true,
|
|
15852
15855
|
ref: (el) => setFormItemRef(el, field),
|
|
15853
15856
|
class: field.className,
|
|
@@ -15865,7 +15868,10 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
15865
15868
|
disabled: field.disabled
|
|
15866
15869
|
}, null, 8, ["grid", "fields", "path", "disabled"])) : !field.component ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
15867
15870
|
createTextVNode(' missing "component" prop ')
|
|
15868
|
-
], 64)) : (openBlock(), createBlock(unref(BaseField), mergeProps({
|
|
15871
|
+
], 64)) : (openBlock(), createBlock(unref(BaseField), mergeProps({
|
|
15872
|
+
key: 2,
|
|
15873
|
+
ref_for: true
|
|
15874
|
+
}, unref(omitFormItemProps)(field), {
|
|
15869
15875
|
label: field.label,
|
|
15870
15876
|
path: getPath(field.key)
|
|
15871
15877
|
}), null, 16, ["label", "path"]))
|
|
@@ -15876,7 +15882,10 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
15876
15882
|
return {
|
|
15877
15883
|
name,
|
|
15878
15884
|
fn: withCtx(() => [
|
|
15879
|
-
unref(FORM_ITEM_SLOT_KEYS).includes(name) ? (openBlock(), createBlock(unref(_sfc_main$1), mergeProps({
|
|
15885
|
+
unref(FORM_ITEM_SLOT_KEYS).includes(name) ? (openBlock(), createBlock(unref(_sfc_main$1), mergeProps({
|
|
15886
|
+
key: 0,
|
|
15887
|
+
ref_for: true
|
|
15888
|
+
}, { path: getPath(field.key) }, { component: slot }), null, 16, ["component"])) : createCommentVNode("", true)
|
|
15880
15889
|
])
|
|
15881
15890
|
};
|
|
15882
15891
|
})
|
|
@@ -16193,21 +16202,21 @@ async function runRules(rules2, baseParam) {
|
|
|
16193
16202
|
[`${path}`, ["gray"]]
|
|
16194
16203
|
]);
|
|
16195
16204
|
switch (type4) {
|
|
16196
|
-
case "
|
|
16205
|
+
case "setValue": {
|
|
16197
16206
|
form.setFormData(path, value);
|
|
16198
16207
|
nextTick(() => run(path, "onUpdateValue"));
|
|
16199
16208
|
break;
|
|
16200
16209
|
}
|
|
16201
|
-
case "
|
|
16202
|
-
form.setField(path,
|
|
16210
|
+
case "setHidden":
|
|
16211
|
+
form.setField(path, { hidden: value });
|
|
16203
16212
|
break;
|
|
16204
|
-
case "
|
|
16205
|
-
form.setField(path,
|
|
16213
|
+
case "setDisabled":
|
|
16214
|
+
form.setField(path, { disabled: value });
|
|
16206
16215
|
break;
|
|
16207
|
-
case "
|
|
16208
|
-
form.setField(path,
|
|
16216
|
+
case "setOptions":
|
|
16217
|
+
form.setField(path, { options: value });
|
|
16209
16218
|
break;
|
|
16210
|
-
case "
|
|
16219
|
+
case "setRules": {
|
|
16211
16220
|
const validateRule2 = [];
|
|
16212
16221
|
for (let validateRuleIndex = 0; validateRuleIndex < value.length; validateRuleIndex += 1) {
|
|
16213
16222
|
const validateRuleItem = value[validateRuleIndex];
|
|
@@ -16233,14 +16242,14 @@ async function runRules(rules2, baseParam) {
|
|
|
16233
16242
|
form.setField(path, (preField) => ({ ...preField, rule: validateRule2 }));
|
|
16234
16243
|
break;
|
|
16235
16244
|
}
|
|
16236
|
-
case "
|
|
16245
|
+
case "setField":
|
|
16237
16246
|
form.setField(path, (preField) => ({ ...preField, ...value }));
|
|
16238
16247
|
break;
|
|
16239
|
-
case "
|
|
16248
|
+
case "triggerValidate":
|
|
16240
16249
|
break;
|
|
16241
|
-
case "
|
|
16250
|
+
case "triggerClearValidate":
|
|
16242
16251
|
break;
|
|
16243
|
-
case "
|
|
16252
|
+
case "triggerMessage":
|
|
16244
16253
|
message2.info(value);
|
|
16245
16254
|
break;
|
|
16246
16255
|
default: {
|
|
@@ -16279,8 +16288,8 @@ const runCommands = async ({ path, trigger, ...baseParam }) => {
|
|
|
16279
16288
|
]);
|
|
16280
16289
|
for (let logicIndex = 0; logicIndex < logics.length; logicIndex += 1) {
|
|
16281
16290
|
const logic = logics[logicIndex];
|
|
16282
|
-
const { conditions,
|
|
16283
|
-
if (conditions.length === 0 ||
|
|
16291
|
+
const { conditions, actions } = logic;
|
|
16292
|
+
if (conditions.length === 0 || actions.length === 0)
|
|
16284
16293
|
return;
|
|
16285
16294
|
logQueue.push([
|
|
16286
16295
|
[`逻辑${logicIndex + 1}:`, ["large", "purple"]],
|
|
@@ -16294,7 +16303,7 @@ const runCommands = async ({ path, trigger, ...baseParam }) => {
|
|
|
16294
16303
|
return;
|
|
16295
16304
|
const conditionsValid = await validateConditions(conditions, baseParam);
|
|
16296
16305
|
if (conditionsValid) {
|
|
16297
|
-
await runRules(
|
|
16306
|
+
await runRules(actions, baseParam);
|
|
16298
16307
|
}
|
|
16299
16308
|
}
|
|
16300
16309
|
logQueue.push([
|
|
@@ -16432,8 +16441,6 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
16432
16441
|
const methods = { ...rewriteMethod("onUpdateValue") };
|
|
16433
16442
|
switch (compType) {
|
|
16434
16443
|
case "input":
|
|
16435
|
-
Object.assign(methods, rewriteMethod("onBlur"), rewriteMethod("onFocus"));
|
|
16436
|
-
break;
|
|
16437
16444
|
case "input-number":
|
|
16438
16445
|
Object.assign(methods, rewriteMethod("onBlur"), rewriteMethod("onFocus"));
|
|
16439
16446
|
break;
|
|
@@ -16455,12 +16462,6 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
16455
16462
|
return;
|
|
16456
16463
|
updateRefs == null ? void 0 : updateRefs("fieldRefs", props.path, el);
|
|
16457
16464
|
};
|
|
16458
|
-
onMounted(() => {
|
|
16459
|
-
var _a, _b, _c;
|
|
16460
|
-
if (attrs.autoCommand && ((_b = (_a = attrs.autoCommand) == null ? void 0 : _a.onInit) == null ? void 0 : _b.length) > 0) {
|
|
16461
|
-
(_c = command == null ? void 0 : command.value) == null ? void 0 : _c.run(props.path, "onInit");
|
|
16462
|
-
}
|
|
16463
|
-
});
|
|
16464
16465
|
function handleFocus(...args) {
|
|
16465
16466
|
var _a;
|
|
16466
16467
|
updateActivePath == null ? void 0 : updateActivePath(props.path);
|
|
@@ -16499,7 +16500,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
16499
16500
|
};
|
|
16500
16501
|
}
|
|
16501
16502
|
});
|
|
16502
|
-
const
|
|
16503
|
+
const index_vue_vue_type_style_index_0_scoped_f87938bb_lang = "";
|
|
16503
16504
|
const _export_sfc = (sfc, props) => {
|
|
16504
16505
|
const target = sfc.__vccOpts || sfc;
|
|
16505
16506
|
for (const [key, val] of props) {
|
|
@@ -16507,7 +16508,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
16507
16508
|
}
|
|
16508
16509
|
return target;
|
|
16509
16510
|
};
|
|
16510
|
-
const BaseField = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-
|
|
16511
|
+
const BaseField = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-f87938bb"]]);
|
|
16511
16512
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
16512
16513
|
...{
|
|
16513
16514
|
name: "ContainerFragment",
|
|
@@ -16609,10 +16610,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
16609
16610
|
updateActivePath(path);
|
|
16610
16611
|
};
|
|
16611
16612
|
const command = computed(() => {
|
|
16612
|
-
return props.form && !props.autoCommandDisabled ? useCommand({
|
|
16613
|
-
refs: exposed.refs,
|
|
16614
|
-
form: props.form
|
|
16615
|
-
}) : null;
|
|
16613
|
+
return props.form && !props.autoCommandDisabled ? useCommand({ refs: exposed.refs, form: props.form }) : null;
|
|
16616
16614
|
});
|
|
16617
16615
|
const formInstanceRef = ref(null);
|
|
16618
16616
|
onMounted(() => {
|
package/es/form/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l, B, d, i, C, b, f, F, k, G, R, e, j, U, h, _, m, p, n, s, q, u, r, t } from "./index-
|
|
1
|
+
import { l, B, d, i, C, b, f, F, k, G, R, e, j, U, h, _, m, p, n, s, q, u, r, t } from "./index-c1a5e7f6.js";
|
|
2
2
|
import "vue";
|
|
3
3
|
import "ant-design-vue";
|
|
4
4
|
import "../component-provider/index.js";
|