@form-create/component-elm-group 2.7.17 → 2.7.27
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/dist/index.es.js +12 -12
- package/dist/index.js +3 -3
- package/package.json +2 -2
- package/src/component.jsx +2 -2
package/dist/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* FormCreate 低代码表单渲染器
|
|
3
|
-
* @form-create/component-elm-group v2.7.
|
|
4
|
-
* (c) 2018-
|
|
3
|
+
* @form-create/component-elm-group v2.7.27
|
|
4
|
+
* (c) 2018-2026 xaboy
|
|
5
5
|
* Github https://github.com/xaboy/form-create
|
|
6
6
|
* Site https://form-create.com/
|
|
7
7
|
* Released under the MIT License.
|
|
@@ -40,7 +40,7 @@ var S = ["attrs", "props", "domProps"], B = ["class", "style", "directives"], b
|
|
|
40
40
|
var l = e[s][o] instanceof Array ? e[s][o] : [e[s][o]], f = r[s][o] instanceof Array ? r[s][o] : [r[s][o]];
|
|
41
41
|
e[s][o] = [].concat(l, f);
|
|
42
42
|
} else e[s][o] = r[s][o];
|
|
43
|
-
else if (s === "hook") for (var
|
|
43
|
+
else if (s === "hook") for (var c in r[s]) e[s][c] = e[s][c] ? D(e[s][c], r[s][c]) : r[s][c];
|
|
44
44
|
else e[s] = r[s];
|
|
45
45
|
return e;
|
|
46
46
|
}, {});
|
|
@@ -49,7 +49,7 @@ var S = ["attrs", "props", "domProps"], B = ["class", "style", "directives"], b
|
|
|
49
49
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
50
50
|
};
|
|
51
51
|
}, E = k;
|
|
52
|
-
const I = /* @__PURE__ */ V(E),
|
|
52
|
+
const I = /* @__PURE__ */ V(E), u = {
|
|
53
53
|
type(t, e) {
|
|
54
54
|
return Object.prototype.toString.call(t) === "[object " + e + "]";
|
|
55
55
|
},
|
|
@@ -57,7 +57,7 @@ const I = /* @__PURE__ */ V(E), c = {
|
|
|
57
57
|
return t == null;
|
|
58
58
|
},
|
|
59
59
|
Element(t) {
|
|
60
|
-
return typeof t == "object" && t !== null && t.nodeType === 1 && !
|
|
60
|
+
return typeof t == "object" && t !== null && t.nodeType === 1 && !u.Object(t);
|
|
61
61
|
},
|
|
62
62
|
trueArray(t) {
|
|
63
63
|
return Array.isArray(t) && t.length > 0;
|
|
@@ -75,8 +75,8 @@ const I = /* @__PURE__ */ V(E), c = {
|
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
77
|
["Date", "Object", "String", "Boolean", "Array", "Number"].forEach((t) => {
|
|
78
|
-
|
|
79
|
-
return
|
|
78
|
+
u[t] = function(e) {
|
|
79
|
+
return u.type(e, t);
|
|
80
80
|
};
|
|
81
81
|
});
|
|
82
82
|
function P(t, e) {
|
|
@@ -90,7 +90,7 @@ function y(t, e = {}, r) {
|
|
|
90
90
|
for (let i in e)
|
|
91
91
|
if (Object.prototype.hasOwnProperty.call(e, i)) {
|
|
92
92
|
let n = e[i];
|
|
93
|
-
if ((s = Array.isArray(n)) ||
|
|
93
|
+
if ((s = Array.isArray(n)) || u.Object(n)) {
|
|
94
94
|
let o = t[i] === void 0;
|
|
95
95
|
if (s)
|
|
96
96
|
s = !1, o && h(t, i, []);
|
|
@@ -101,7 +101,7 @@ function y(t, e = {}, r) {
|
|
|
101
101
|
o && h(t, i, {});
|
|
102
102
|
t[i] = y(t[i], n, r);
|
|
103
103
|
} else
|
|
104
|
-
h(t, i, n),
|
|
104
|
+
h(t, i, n), u.Undef(n) || (u.Undef(n.__json) || (t[i].__json = n.__json), u.Undef(n.__origin) || (t[i].__origin = n.__origin));
|
|
105
105
|
}
|
|
106
106
|
return t;
|
|
107
107
|
}
|
|
@@ -258,7 +258,7 @@ const T = "fcGroup", C = {
|
|
|
258
258
|
if (s.filter((n) => r[n].$f).length !== s.length)
|
|
259
259
|
return;
|
|
260
260
|
const i = s.map((n) => {
|
|
261
|
-
const o = t === n ? e : d({}, this.cacheRule[n].$f.form), l = this.field ? o[this.field]
|
|
261
|
+
const o = t === n ? e : d({}, this.cacheRule[n].$f.form), l = this.field ? u.Undef(o[this.field]) ? null : o[this.field] : o;
|
|
262
262
|
return this.cache(n, l), l;
|
|
263
263
|
});
|
|
264
264
|
this.input(i);
|
|
@@ -398,7 +398,7 @@ const T = "fcGroup", C = {
|
|
|
398
398
|
}) : e.map((o, l) => {
|
|
399
399
|
const {
|
|
400
400
|
rule: f,
|
|
401
|
-
options:
|
|
401
|
+
options: c
|
|
402
402
|
} = this.cacheRule[o], g = r && !i ? this.makeIcon(e.length, l, o) : [];
|
|
403
403
|
return t("div", {
|
|
404
404
|
class: "_fc-group-container",
|
|
@@ -419,7 +419,7 @@ const T = "fcGroup", C = {
|
|
|
419
419
|
[this.field]: this._value(this.value[l])
|
|
420
420
|
} : this.value[l],
|
|
421
421
|
rule: f,
|
|
422
|
-
option:
|
|
422
|
+
option: c,
|
|
423
423
|
extendOption: !0
|
|
424
424
|
}
|
|
425
425
|
}])), t("div", {
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* FormCreate 低代码表单渲染器
|
|
3
|
-
* @form-create/component-elm-group v2.7.
|
|
4
|
-
* (c) 2018-
|
|
3
|
+
* @form-create/component-elm-group v2.7.27
|
|
4
|
+
* (c) 2018-2026 xaboy
|
|
5
5
|
* Github https://github.com/xaboy/form-create
|
|
6
6
|
* Site https://form-create.com/
|
|
7
7
|
* Released under the MIT License.
|
|
8
8
|
*/
|
|
9
9
|
(function(){"use strict";try{if(typeof document!="undefined"){var o=document.createElement("style");o.appendChild(document.createTextNode('._fc-group{display:flex;min-height:42px;justify-content:center;flex-direction:column}._fc-group-disabled ._fc-group-btn,._fc-group-disabled ._fc-group-add{cursor:not-allowed}._fc-group-handle{display:flex;flex-direction:row;position:absolute;bottom:-15px;right:30px;border-radius:15px;border:1px dashed #d9d9d9;padding:3px 8px;background-color:#fff}._fc-group-btn{cursor:pointer}._fc-group-idx{position:absolute;bottom:-15px;left:10px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;background:#eee;border-radius:15px;font-weight:700}._fc-group-handle ._fc-group-btn+._fc-group-btn{margin-left:7px}._fc-group-container{position:relative;display:flex;flex-direction:column;border:1px dashed #d9d9d9;padding:20px 20px 25px;margin:5px 5px 25px;border-radius:5px}._fc-group-arrow{position:relative;width:20px;height:20px}._fc-group-arrow:before{content:"";position:absolute;top:8px;left:5px;width:9px;height:9px;border-left:2px solid #999;border-top:2px solid #999}._fc-group-arrow:before{transform:rotate(45deg)}._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group-plus-minus{width:20px;height:20px;position:relative;cursor:pointer}._fc-group-plus-minus:before,._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:60%;height:2px;background-color:#409eff;transform:translate(-50%,-50%)}._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group-plus-minus._fc-group-minus:after{background-color:#f56c6c}._fc-group-add{cursor:pointer;width:25px;height:25px;border:1px solid rgb(64 158 255 / 50%);border-radius:15px}._fc-group-add._fc-group-plus-minus:before,._fc-group-add._fc-group-plus-minus:after{width:50%}')),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
10
|
-
(function(l,u){typeof exports=="object"&&typeof module!="undefined"?module.exports=u(require("vue")):typeof define=="function"&&define.amd?define(["vue"],u):(l=typeof globalThis!="undefined"?globalThis:l||self,l.FcGroup=u(l.Vue))})(this,function(l){"use strict";var x=Object.defineProperty;var $=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var O=(l,u,c)=>u in l?x(l,u,{enumerable:!0,configurable:!0,writable:!0,value:c}):l[u]=c,_=(l,u)=>{for(var c in u||(u={}))F.call(u,c)&&O(l,c,u[c]);if($)for(var c of $(u))T.call(u,c)&&O(l,c,u[c]);return l};function u(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t,r=1;r<arguments.length;r++)for(var s in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},c.apply(this,arguments)}var j=["attrs","props","domProps"],R=["class","style","directives"],A=["on","nativeOn"],V=function(e){return e.reduce(function(t,r){for(var s in r)if(!t[s])t[s]=r[s];else if(j.indexOf(s)!==-1)t[s]=c({},t[s],r[s]);else if(R.indexOf(s)!==-1){var i=t[s]instanceof Array?t[s]:[t[s]],n=r[s]instanceof Array?r[s]:[r[s]];t[s]=[].concat(i,n)}else if(A.indexOf(s)!==-1)for(var o in r[s])if(t[s][o]){var h=t[s][o]instanceof Array?t[s][o]:[t[s][o]],g=r[s][o]instanceof Array?r[s][o]:[r[s][o]];t[s][o]=[].concat(h,g)}else t[s][o]=r[s][o];else if(s==="hook")for(var f in r[s])t[s][f]=t[s][f]?S(t[s][f],r[s][f]):r[s][f];else t[s]=r[s];return t},{})},S=function(e,t){return function(){e&&e.apply(this,arguments),t&&t.apply(this,arguments)}},B=V;const E=u(B),a={type(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"},Undef(e){return e==null},Element(e){return typeof e=="object"&&e!==null&&e.nodeType===1&&!a.Object(e)},trueArray(e){return Array.isArray(e)&&e.length>0},Function(e){const t=this.getType(e);return t==="Function"||t==="AsyncFunction"},getType(e){const t=Object.prototype.toString.call(e);return/^\[object (.*)\]$/.exec(t)[1]},empty(e){return e==null||Array.isArray(e)&&Array.isArray(e)&&!e.length?!0:typeof e=="string"&&!e}};["Date","Object","String","Boolean","Array","Number"].forEach(e=>{a[e]=function(t){return a.type(t,e)}});function b(e,t){return{}.hasOwnProperty.call(e,t)}function d(e,t,r){l.set(e,t,r)}function m(e,t={},r){let s=!1;for(let i in t)if(Object.prototype.hasOwnProperty.call(t,i)){let n=t[i];if((s=Array.isArray(n))||a.Object(n)){let o=e[i]===void 0;if(s)s=!1,o&&d(e,i,[]);else if(n._clone&&r!==void 0){d(e,i,n._clone());continue}else o&&d(e,i,{});e[i]=m(e[i],n,r)}else d(e,i,n),a.Undef(n)||(a.Undef(n.__json)||(e[i].__json=n.__json),a.Undef(n.__origin)||(e[i].__origin=n.__origin))}return e}function y(e){return m({},{value:e}).value}const k=Object.assign||function(e){for(let t,r=1;r<arguments.length;r++)for(let s in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,s)&&d(e,s,t[s]);return e};function D(){return k.apply(this,arguments)}function I(e){return e&&typeof e=="object"&&typeof e.then=="function"}function P(e){return I(e)?e:Promise.resolve(e)}return{name:"fcGroup",props:{field:String,rule:[Array,Object],rules:Array,expand:Number,options:Object,formCreateInject:{type:Object,required:!0},button:{type:Boolean,default:!0},max:{type:Number,default:0},min:{type:Number,default:0},value:{type:Array,default:()=>[]},sortBtn:{type:Boolean,default:!0},defaultValue:Object,disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},onBeforeRemove:{type:Function,default:()=>{}},onBeforeAdd:{type:Function,default:()=>{}},parse:Function},data(){return{len:0,cacheRule:{},cacheValue:{},sort:[],type:void 0}},computed:{formRule(){return this.rules?this.rules:this.rule?Array.isArray(this.rule)?this.rule:[this.rule]:[]}},watch:{cacheRule:{handler(e){this.sort=Object.keys(e)},immediate:!0},formRule:{handler(e,t){Object.keys(this.cacheRule).forEach(r=>{const s=this.cacheRule[r];if(s.$f){const i=s.$f.formData();if(e===t)s.$f.deferSyncValue(()=>{m(s.rule,e),s.$f.setValue(i)},!0);else{const n=s.$f.formData();s.$f.once("reloading",()=>{s.$f.setValue(n)}),s.rule=y(e)}}})},deep:!0},expand(e){let t=e-this.value.length;t>0&&this.expandRule(t)},value(e,t){e=e||[];let r=this.sort,s=r.length,i=s-e.length;if(i<0){for(let n=i;n<0;n++)this.addRule(e.length+n);this.sort=Object.keys(this.cacheRule);for(let n=0;n<s;n++)this.setValue(r[n],e[n])}else{if(i>0){for(let n=0;n<i;n++)this.removeRule(r[s-n-1]);this.sort=Object.keys(this.cacheRule)}e.forEach((n,o)=>{this.setValue(r[o],e[o])})}}},methods:{_value(e){return e&&b(e,this.field)?e[this.field]:e},cache(e,t){this.cacheValue[e]=JSON.stringify(t)},input(e){this.$emit("input",e),this.$emit("change",e)},formData(e,t){const r=this.cacheRule,s=this.sort;if(s.filter(n=>r[n].$f).length!==s.length)return;const i=s.map(n=>{const o=e===n?t:_({},this.cacheRule[n].$f.form),h=this.field?o[this.field]
|
|
10
|
+
(function(l,u){typeof exports=="object"&&typeof module!="undefined"?module.exports=u(require("vue")):typeof define=="function"&&define.amd?define(["vue"],u):(l=typeof globalThis!="undefined"?globalThis:l||self,l.FcGroup=u(l.Vue))})(this,function(l){"use strict";var x=Object.defineProperty;var $=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var O=(l,u,c)=>u in l?x(l,u,{enumerable:!0,configurable:!0,writable:!0,value:c}):l[u]=c,_=(l,u)=>{for(var c in u||(u={}))F.call(u,c)&&O(l,c,u[c]);if($)for(var c of $(u))T.call(u,c)&&O(l,c,u[c]);return l};function u(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t,r=1;r<arguments.length;r++)for(var s in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},c.apply(this,arguments)}var j=["attrs","props","domProps"],R=["class","style","directives"],A=["on","nativeOn"],V=function(e){return e.reduce(function(t,r){for(var s in r)if(!t[s])t[s]=r[s];else if(j.indexOf(s)!==-1)t[s]=c({},t[s],r[s]);else if(R.indexOf(s)!==-1){var i=t[s]instanceof Array?t[s]:[t[s]],n=r[s]instanceof Array?r[s]:[r[s]];t[s]=[].concat(i,n)}else if(A.indexOf(s)!==-1)for(var o in r[s])if(t[s][o]){var h=t[s][o]instanceof Array?t[s][o]:[t[s][o]],g=r[s][o]instanceof Array?r[s][o]:[r[s][o]];t[s][o]=[].concat(h,g)}else t[s][o]=r[s][o];else if(s==="hook")for(var f in r[s])t[s][f]=t[s][f]?S(t[s][f],r[s][f]):r[s][f];else t[s]=r[s];return t},{})},S=function(e,t){return function(){e&&e.apply(this,arguments),t&&t.apply(this,arguments)}},B=V;const E=u(B),a={type(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"},Undef(e){return e==null},Element(e){return typeof e=="object"&&e!==null&&e.nodeType===1&&!a.Object(e)},trueArray(e){return Array.isArray(e)&&e.length>0},Function(e){const t=this.getType(e);return t==="Function"||t==="AsyncFunction"},getType(e){const t=Object.prototype.toString.call(e);return/^\[object (.*)\]$/.exec(t)[1]},empty(e){return e==null||Array.isArray(e)&&Array.isArray(e)&&!e.length?!0:typeof e=="string"&&!e}};["Date","Object","String","Boolean","Array","Number"].forEach(e=>{a[e]=function(t){return a.type(t,e)}});function b(e,t){return{}.hasOwnProperty.call(e,t)}function d(e,t,r){l.set(e,t,r)}function m(e,t={},r){let s=!1;for(let i in t)if(Object.prototype.hasOwnProperty.call(t,i)){let n=t[i];if((s=Array.isArray(n))||a.Object(n)){let o=e[i]===void 0;if(s)s=!1,o&&d(e,i,[]);else if(n._clone&&r!==void 0){d(e,i,n._clone());continue}else o&&d(e,i,{});e[i]=m(e[i],n,r)}else d(e,i,n),a.Undef(n)||(a.Undef(n.__json)||(e[i].__json=n.__json),a.Undef(n.__origin)||(e[i].__origin=n.__origin))}return e}function y(e){return m({},{value:e}).value}const k=Object.assign||function(e){for(let t,r=1;r<arguments.length;r++)for(let s in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,s)&&d(e,s,t[s]);return e};function D(){return k.apply(this,arguments)}function I(e){return e&&typeof e=="object"&&typeof e.then=="function"}function P(e){return I(e)?e:Promise.resolve(e)}return{name:"fcGroup",props:{field:String,rule:[Array,Object],rules:Array,expand:Number,options:Object,formCreateInject:{type:Object,required:!0},button:{type:Boolean,default:!0},max:{type:Number,default:0},min:{type:Number,default:0},value:{type:Array,default:()=>[]},sortBtn:{type:Boolean,default:!0},defaultValue:Object,disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},onBeforeRemove:{type:Function,default:()=>{}},onBeforeAdd:{type:Function,default:()=>{}},parse:Function},data(){return{len:0,cacheRule:{},cacheValue:{},sort:[],type:void 0}},computed:{formRule(){return this.rules?this.rules:this.rule?Array.isArray(this.rule)?this.rule:[this.rule]:[]}},watch:{cacheRule:{handler(e){this.sort=Object.keys(e)},immediate:!0},formRule:{handler(e,t){Object.keys(this.cacheRule).forEach(r=>{const s=this.cacheRule[r];if(s.$f){const i=s.$f.formData();if(e===t)s.$f.deferSyncValue(()=>{m(s.rule,e),s.$f.setValue(i)},!0);else{const n=s.$f.formData();s.$f.once("reloading",()=>{s.$f.setValue(n)}),s.rule=y(e)}}})},deep:!0},expand(e){let t=e-this.value.length;t>0&&this.expandRule(t)},value(e,t){e=e||[];let r=this.sort,s=r.length,i=s-e.length;if(i<0){for(let n=i;n<0;n++)this.addRule(e.length+n);this.sort=Object.keys(this.cacheRule);for(let n=0;n<s;n++)this.setValue(r[n],e[n])}else{if(i>0){for(let n=0;n<i;n++)this.removeRule(r[s-n-1]);this.sort=Object.keys(this.cacheRule)}e.forEach((n,o)=>{this.setValue(r[o],e[o])})}}},methods:{_value(e){return e&&b(e,this.field)?e[this.field]:e},cache(e,t){this.cacheValue[e]=JSON.stringify(t)},input(e){this.$emit("input",e),this.$emit("change",e)},formData(e,t){const r=this.cacheRule,s=this.sort;if(s.filter(n=>r[n].$f).length!==s.length)return;const i=s.map(n=>{const o=e===n?t:_({},this.cacheRule[n].$f.form),h=this.field?a.Undef(o[this.field])?null:o[this.field]:o;return this.cache(n,h),h});this.input(i)},setValue(e,t){const r=this.field,s=this.cacheRule[e].$f;r&&(t={[r]:this._value(t)}),this.cacheValue[e]!==JSON.stringify(r?t[r]:t)&&(this.cache(e,t),s&&s.coverValue(t||{}))},addRule(e,t){const r=this.formCreateInject.form.copyRules(this.formRule),s=this.options?_({},this.options):{submitBtn:!1,resetBtn:!1};if(this.defaultValue){s.formData||(s.formData={});const i=y(this.defaultValue);D(s.formData,this.field?{[this.field]:i}:i)}this.parse&&this.parse({rule:r,options:s,index:this.sort.length}),this.$set(this.cacheRule,++this.len,{rule:r,options:s}),t&&this.$nextTick(()=>this.$emit("add",r,Object.keys(this.cacheRule).length-1))},add$f(e,t,r){this.cacheRule[t].$f=r,this.$nextTick(()=>{this.$emit("itemMounted",r,Object.keys(this.cacheRule).indexOf(t))})},removeRule(e,t){const r=Object.keys(this.cacheRule).indexOf(e);this.$delete(this.cacheRule,e),this.$delete(this.cacheValue,e),t&&this.$nextTick(()=>this.$emit("remove",r))},add(e){if(this.disabled||this.onBeforeAdd(this.value)===!1)return;const t=[...this.value];t.push(this.defaultValue?y(this.defaultValue):this.field?null:{}),this.input(t)},del(e,t){if(this.disabled)return;const r=()=>{this.removeRule(t,!0);const s=[...this.value];s.splice(e,1),this.input(s)};P(this.onBeforeRemove(this.modelValue,e)).then(s=>{s!==!1&&r()})},addIcon(e){const t=this.$createElement;return t("div",{class:"_fc-group-btn _fc-group-plus-minus",on:{click:this.add}})},delIcon(e,t){const r=this.$createElement;return r("div",{class:"_fc-group-btn _fc-group-plus-minus _fc-group-minus",on:{click:()=>this.del(e,t)}})},sortUpIcon(e){const t=this.$createElement;return t("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-up",on:{click:()=>this.changeSort(e,-1)}})},sortDownIcon(e){const t=this.$createElement;return t("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-down",on:{click:()=>this.changeSort(e,1)}})},changeSort(e,t){const r=this.sort[e];this.$set(this.sort,e,this.sort[e+t]),this.sort[e+t]=r,this.formData(0)},makeIcon(e,t,r){if(this.$scopedSlots.button)return this.$scopedSlots.button({total:e,index:t,vm:this,key:r,del:()=>this.del(t,r),add:this.add});const s=[];return(!this.max||e<this.max)&&e===t+1&&s.push(this.addIcon(r)),e>this.min&&s.push(this.delIcon(t,r)),this.sortBtn&&t&&s.push(this.sortUpIcon(t)),this.sortBtn&&t!==e-1&&s.push(this.sortDownIcon(t)),s},emitEvent(e,t,r,s){this.$emit(e,...t,this.cacheRule[s].$f,r)},expandRule(e){for(let t=0;t<e;t++)this.value.push(this.field?null:{})}},created(){this.type=this.formCreateInject.form.$form();const e=(this.expand||0)-this.value.length;e>0&&this.expandRule(e);for(let t=0;t<this.value.length;t++)this.addRule(t)},render(){const e=arguments[0],t=this.sort,r=this.button,s=this.type,i=this.disabled,n=t.length===0?this.$scopedSlots.default?this.$scopedSlots.default({vm:this,add:this.add}):e("div",{key:"a_def",class:"_fc-group-plus-minus _fc-group-add fc-clock",on:{click:this.add}}):t.map((o,h)=>{const{rule:g,options:f}=this.cacheRule[o],v=r&&!i?this.makeIcon(t.length,h,o):[];return e("div",{class:"_fc-group-container",key:o},[e(s,E([{key:o},{on:{"update:value":p=>this.formData(o,p),"emit-event":(p,...w)=>this.emitEvent(p,w,h,o),input:p=>this.add$f(h,o,p)}},{},{props:{disabled:i,inFor:!0,value:this.field?{[this.field]:this._value(this.value[h])}:this.value[h],rule:g,option:f,extendOption:!0}}])),e("div",{class:"_fc-group-idx"},[h+1]),v.length?e("div",{class:"_fc-group-handle fc-clock"},[v]):null])});return e("div",{key:"con",class:"_fc-group "+(i?"_fc-group-disabled":"")},[n])}}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@form-create/component-elm-group",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.27",
|
|
4
4
|
"description": "@form-create/element-ui 内置组件",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.es.js",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "482b4656db7e5bd572541272cd2bdf28f204b65f"
|
|
43
43
|
}
|
package/src/component.jsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {hasProperty} from '@form-create/utils/lib/type';
|
|
1
|
+
import is, {hasProperty} from '@form-create/utils/lib/type';
|
|
2
2
|
import deepExtend, {deepCopy} from '@form-create/utils/lib/deepextend';
|
|
3
3
|
import extend from '@form-create/utils/lib/extend';
|
|
4
4
|
import './style.css';
|
|
@@ -158,7 +158,7 @@ export default {
|
|
|
158
158
|
}
|
|
159
159
|
const value = keys.map(k => {
|
|
160
160
|
const data = key === k ? formData : {...this.cacheRule[k].$f.form};
|
|
161
|
-
const value = this.field ? data[this.field]
|
|
161
|
+
const value = this.field ? (is.Undef(data[this.field]) ? null : data[this.field]) : data;
|
|
162
162
|
this.cache(k, value);
|
|
163
163
|
return value;
|
|
164
164
|
});
|