rb-document-form-constructor 0.9.19 → 0.9.20
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.
|
@@ -473,10 +473,14 @@ const UtFormConstructor = {
|
|
|
473
473
|
},
|
|
474
474
|
|
|
475
475
|
getInputTypeByName(name, field) {
|
|
476
|
-
let input = __clone(this.config.inputs[name]);
|
|
476
|
+
let input = __clone(this.config.inputs[name]); // Сохраняем существующие propsData
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
const existingPropsData = field.input && field.input.propsData ? { ...field.input.propsData
|
|
480
|
+
} : {};
|
|
477
481
|
|
|
478
482
|
if (field.ref && this.config.refInputs[field.ref]) {
|
|
479
|
-
__applyDefaultProps(input);
|
|
483
|
+
__applyDefaultProps(input, field);
|
|
480
484
|
|
|
481
485
|
if (this.config.refInputConfigs[field.ref] && this.config.refInputConfigs[field.ref][input.name]) {
|
|
482
486
|
__applyRefProps(input, this.config.refInputConfigs[field.ref][input.name]);
|
|
@@ -487,6 +491,11 @@ const UtFormConstructor = {
|
|
|
487
491
|
__applyDefaultProps(input, field);
|
|
488
492
|
} else {
|
|
489
493
|
__applyDefaultProps(input, field);
|
|
494
|
+
} // Восстанавливаем существующие propsData
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
if (existingPropsData) {
|
|
498
|
+
Object.assign(input.propsData, existingPropsData);
|
|
490
499
|
}
|
|
491
500
|
|
|
492
501
|
input.propsData['ref'] = field.name;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var RbDocumentFormConstructor=function(Vue){"use strict";function _interopDefaultLegacy(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var Vue__default=_interopDefaultLegacy(Vue);function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function _objectSpread2(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach((function(e){_defineProperty$1(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function _defineProperty$1(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_nonIterableRest()}function _arrayWithHoles(t){if(Array.isArray(t))return t}function _iterableToArrayLimit(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i=[],a=!0,l=!1;try{for(n=n.call(t);!(a=(o=n.next()).done)&&(i.push(o.value),!e||i.length!==e);a=!0);}catch(t){l=!0,r=t}finally{try{a||null==n.return||n.return()}finally{if(l)throw r}}return i}}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var UtFormConfig={findField:function(t,e){if(!e||!e.sections)return null;var n=null;return e.sections.every((function(e){if(e.columns&&e.columns.every((function(e){if(e.fields.forEach((function(e){e.name===t&&(n=e)})),n)return!1})),n)return!1})),n},findRule:function(t,e){if(!e||!e.sections)return null;var n=null;return e.sections.every((function(e){if(e.columns&&e.columns.every((function(e){if(e.fields.every((function(e){if(e.rules&&e.rules.forEach((function(e){e.id===t&&(n=e)})),n)return!1})),n)return!1})),n)return!1})),n},getFields:function(t){var e=[];return t.sections.forEach((function(t){t.columns&&t.columns.forEach((function(t){t.fields&&t.fields.forEach((function(t){e.push(t)}))}))})),e},parseFacets:function(t){var e=[];return t.sections.forEach((function(t){t.columns.forEach((function(t){t.fields.forEach((function(t){e.indexOf(t.facet)<0&&e.push(t.facet)}))}))})),e}},__clone=function(t){return JSON.parse(JSON.stringify(t))},_assign=function(){return _assign=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},_assign.apply(this,arguments)},__mergeInputInMapOfArrays=function(t,e){for(var n in e){var o=t[n];o?__mergeInputsInArray(o,e[n]):t[n]=e[n]}},__mergeInputsInMap=function(t,e){for(var n in e)t[n]=_assign(t[n]?t[n]:{},e[n]?e[n]:{})},__mergeInputsInArray=function(t,e){e.forEach((function(e){var n=t.findIndex((function(t){return t.name===e.name}));n>=0?t[n]=e:t.push(e)}))},__applyDefaultProps=function(t,e){for(var n in t.props){var o,r,i;if(e){if(e.input.propsData[n])t.propsData[n]=e.input.propsData[n],null!==(o=t.propsData)&&void 0!==o&&o.type&&null!==(r=t.props)&&void 0!==r&&null!==(i=r.type)&&void 0!==i&&i.default&&(t.propsData.type=t.props.type.default)}else t.propsData[n]=t.props[n].default}},__applyRefProps=function(t,e){if(null!=e&&e.propsData)for(var n in e.propsData)t.propsData[n]=e.propsData[n]},__filterInputsByMultiple=function(t,e){return t.filter((function(t){return t.multiple&&e||!t.multiple&&!e}))},fcInputs={string:{text:"Текст",name:"string",type:"b-form-input",props:{placeholder:{type:"string",default:null,label:"Надпись внутри",visible:!0},type:{type:"string",default:"text",label:"Тип данных",visible:!0}},propsData:{},defaultValue:null},number:{text:"Число",name:"number",type:"b-form-input",props:{placeholder:{type:"string",default:null,label:"Надпись внутри",visible:!0},type:{type:"string",default:"number",label:"Тип данных",visible:!0},min:{type:"number",default:null,label:"Минимальное значение",visible:!0}},propsData:{},defaultValue:null},memo:{text:"Большой текст",name:"memo",type:"b-form-textarea",props:{placeholder:{type:"string",default:null,label:"Надпись внутри",visible:!0},max:{type:"number",default:30,label:"Максимальное значение",visible:!0}},propsData:{},defaultValue:null},date:{text:"Дата",name:"date",type:"rb-date-picker-input",props:{minCurrentDate:{type:"boolean",default:!1,label:"Установить текущую дату как минимальную",visible:!0},minDate:{type:"date",default:null,label:"Установить минимальную дату",visible:!0},maxDate:{type:"date",default:null,label:"Установить максимальную дату",visible:!0}},propsData:{},defaultValue:null},datetime:{text:"Дата и вермя",name:"date",type:"rb-date-picker-input",props:{minDate:{type:"date",default:null,label:"Установить минимальную дату",visible:!0},maxDate:{type:"date",default:null,label:"Установить максимальную дату",visible:!0}},propsData:{},defaultValue:null},phone:{text:"Телефон",name:"phone",type:"rb-phone-input",props:{placeholder:{type:"string",default:"Телефон",label:"Надпись внутри",visible:!0}},propsData:{},defaultValue:null},boolean:{text:"Булевое",name:"boolean",type:"rb-boolean-single-option-input",props:{block:{type:"boolean",default:!0,label:"Растянуть",visible:!0},bordered:{type:"boolean",label:"Граница вокруг",default:!0,visible:!0}},propsData:{},defaultValue:null},email:{text:"Email",name:"email",type:"rb-email-input",props:{},propsData:{},defaultValue:[],multiple:!0}},fcPrimitiveInputs={string:[__clone(fcInputs.string),__clone(fcInputs.number),__clone(fcInputs.memo),__clone(fcInputs.phone)],memo:[__clone(fcInputs.memo),__clone(fcInputs.string)],number:[__clone(fcInputs.string),__clone(fcInputs.number)],double:[__clone(fcInputs.string),__clone(fcInputs.number)],float:[__clone(fcInputs.string),__clone(fcInputs.number)],integer:[__clone(fcInputs.string),__clone(fcInputs.number)],long:[__clone(fcInputs.string),__clone(fcInputs.number)],date:[__clone(fcInputs.date)],datetime:[__clone(fcInputs.datetime)],boolean:[__clone(fcInputs.boolean)],email:[__clone(fcInputs.email)]},fcDictInputs=[],fcRefInputs={},fcRefInputConfigs={},baseConfig={inputs:__clone(fcInputs),primitiveInputs:__clone(fcPrimitiveInputs),dictInputs:__clone(fcDictInputs),refInputs:__clone(fcRefInputs),refInputConfigs:__clone(fcRefInputConfigs),rules:[],icons:{iconExpandFacet:"icon-chevron-down",iconCollapseFacet:"icon-chevron-up",iconCloseFieldSidebar:"icon-chevron-right",iconOpenFieldSidebar:"icon-chevron-left",iconAdd:"icon-add",iconEdit:"icon-edit",iconDelete:"icon-delete",iconDrag:"icon-reorder"},ruleContext:{}},UtFormConstructor={config:{},init:function(t){this.config=__clone(baseConfig),t&&(t.inputs&&__mergeInputsInMap(this.config.inputs,t.inputs),t.primitiveInputs&&__mergeInputInMapOfArrays(this.config.primitiveInputs,t.primitiveInputs),t.dictInputs&&__mergeInputsInArray(this.config.dictInputs,t.dictInputs),t.refInputs&&__mergeInputInMapOfArrays(this.config.refInputs,t.refInputs),t.refInputConfigs&&(this.config.refInputConfigs=t.refInputConfigs),t.icons&&(this.config.icons=_assign(this.config.icons,t.icons)),t.rules&&(this.config.rules=t.rules),t.ruleContext&&(this.config.ruleContext=t.ruleContext))},getInputTypes:function(t){var e=[];return t?e=t.dict&&!this.config.refInputs[t.ref]?__filterInputsByMultiple(this.config.dictInputs,t.multiple):t.ref?__filterInputsByMultiple(this.config.refInputs[t.ref],t.multiple):__filterInputsByMultiple(this.config.primitiveInputs[t.type],t.multiple):e},hasMultipleInputTypes:function(t){var e=this.getInputTypes(_objectSpread2(_objectSpread2({},t),{},{multiple:!0}));return e&&e.length>0},getDefaultInput:function(t){var e=null,n=this.getInputTypes(t);return n||(e=this.primitiveInputs[0]),t.ref&&this.config.refInputs[t.ref]?(e=__clone(n[0]),__applyDefaultProps(e),this.config.refInputConfigs[t.ref]&&this.config.refInputConfigs[t.ref][e.name]&&__applyRefProps(e,this.config.refInputConfigs[t.ref][e.name])):t.dict?((e=__clone(n[0])).props.dict.default=t.ref,__applyDefaultProps(e)):(e=__clone(n[0]),__applyDefaultProps(e)),e},getInputTypeByName:function(t,e){var n=__clone(this.config.inputs[t]);return e.ref&&this.config.refInputs[e.ref]?(__applyDefaultProps(n),this.config.refInputConfigs[e.ref]&&this.config.refInputConfigs[e.ref][n.name]&&__applyRefProps(n,this.config.refInputConfigs[e.ref][n.name])):e.dict?(n.props.dict.default=e.ref,__applyDefaultProps(n,e)):__applyDefaultProps(n,e),n.propsData.ref=e.name,n},getAvailableFieldRules:function(t){return this.config.rules.filter((function(e){return!e.fields||0===e.fields.length||e.fields.indexOf(t.name)>=0}))},getRuleContext:function(){return this.config.ruleContext},runRule:function runRule(context,script){context=context||{},context.console=console,context.Date=Date,context.Math=Math;var appendScript="";for(var v in context)appendScript+="var ".concat(v," = this.").concat(v,";\n");appendScript=appendScript?appendScript+"\n":"";var func=function func(script){return eval(script)};func.call(context,appendScript+script)}},script$5={name:"DocTemplateSectionModal",props:{section:Object,mode:{type:String,default:"ins"},onAfterOk:{type:Function,default:function(){}}},data:function(){return{id:"rb-doc-template-section-modal",label:{}}},computed:{title:function(){return"ins"===this.mode?"Добавление секции":"Редактирование секции"}},watch:{section:function(){this.section&&(this.label=this.section)}},methods:{onOk:function(){var t=this;this.section=this.label,this.onAfterOk&&this.onAfterOk(),this.$nextTick((function(){t.$bvModal.hide(t.id)}))}},created:function(){this.section&&(this.label=this.section)}};function normalizeComponent(t,e,n,o,r,i,a,l,s,c){"boolean"!=typeof a&&(s=l,l=a,a=!1);const u="function"==typeof n?n.options:n;let d;if(t&&t.render&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),o&&(u._scopeId=o),i?(d=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,s(t)),t&&t._registeredComponents&&t._registeredComponents.add(i)},u._ssrRegister=d):e&&(d=a?function(t){e.call(this,c(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,l(t))}),d)if(u.functional){const t=u.render;u.render=function(e,n){return d.call(n),t(e,n)}}else{const t=u.beforeCreate;u.beforeCreate=t?[].concat(t,d):[d]}return n}var __vue_script__$5=script$5,__vue_render__$5=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("b-modal",{attrs:{id:"rb-doc-template-section-modal","modal-class":"rb-doc-template-section-modal","ok-title":"Сохранить изменения","cancel-variant":"outline-gray","cancel-title":"Отмена",title:t.title},on:{ok:function(e){return e.preventDefault(),t.onOk.apply(null,arguments)}}},[n("b-form",{on:{submit:function(e){return e.preventDefault(),t.onOk.apply(null,arguments)}}},[n("b-form-row",[n("b-col",{attrs:{lg:"12"}},[n("b-form-group",{attrs:{label:"Наименование секции"}},[n("rb-multi-lang-input",{model:{value:t.label,callback:function(e){t.label=e},expression:"label"}})],1)],1)],1)],1)],1)},__vue_staticRenderFns__$5=[],__vue_inject_styles__$5=void 0,__vue_scope_id__$5=void 0,__vue_module_identifier__$5=void 0,__vue_is_functional_template__$5=!1,__vue_component__$6=normalizeComponent({render:__vue_render__$5,staticRenderFns:__vue_staticRenderFns__$5},__vue_inject_styles__$5,__vue_script__$5,__vue_scope_id__$5,__vue_is_functional_template__$5,__vue_module_identifier__$5,!1,void 0,void 0,void 0),DocTemplateSectionModal=__vue_component__$6,commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return commonjsRequire(t,null==e?n.path:e)}},n.exports),n.exports}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}
|
|
1
|
+
var RbDocumentFormConstructor=function(Vue){"use strict";function _interopDefaultLegacy(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var Vue__default=_interopDefaultLegacy(Vue);function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function _objectSpread2(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach((function(e){_defineProperty$1(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function _defineProperty$1(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_nonIterableRest()}function _arrayWithHoles(t){if(Array.isArray(t))return t}function _iterableToArrayLimit(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i=[],a=!0,l=!1;try{for(n=n.call(t);!(a=(o=n.next()).done)&&(i.push(o.value),!e||i.length!==e);a=!0);}catch(t){l=!0,r=t}finally{try{a||null==n.return||n.return()}finally{if(l)throw r}}return i}}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var UtFormConfig={findField:function(t,e){if(!e||!e.sections)return null;var n=null;return e.sections.every((function(e){if(e.columns&&e.columns.every((function(e){if(e.fields.forEach((function(e){e.name===t&&(n=e)})),n)return!1})),n)return!1})),n},findRule:function(t,e){if(!e||!e.sections)return null;var n=null;return e.sections.every((function(e){if(e.columns&&e.columns.every((function(e){if(e.fields.every((function(e){if(e.rules&&e.rules.forEach((function(e){e.id===t&&(n=e)})),n)return!1})),n)return!1})),n)return!1})),n},getFields:function(t){var e=[];return t.sections.forEach((function(t){t.columns&&t.columns.forEach((function(t){t.fields&&t.fields.forEach((function(t){e.push(t)}))}))})),e},parseFacets:function(t){var e=[];return t.sections.forEach((function(t){t.columns.forEach((function(t){t.fields.forEach((function(t){e.indexOf(t.facet)<0&&e.push(t.facet)}))}))})),e}},__clone=function(t){return JSON.parse(JSON.stringify(t))},_assign=function(){return _assign=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},_assign.apply(this,arguments)},__mergeInputInMapOfArrays=function(t,e){for(var n in e){var o=t[n];o?__mergeInputsInArray(o,e[n]):t[n]=e[n]}},__mergeInputsInMap=function(t,e){for(var n in e)t[n]=_assign(t[n]?t[n]:{},e[n]?e[n]:{})},__mergeInputsInArray=function(t,e){e.forEach((function(e){var n=t.findIndex((function(t){return t.name===e.name}));n>=0?t[n]=e:t.push(e)}))},__applyDefaultProps=function(t,e){for(var n in t.props){var o,r,i;if(e){if(e.input.propsData[n])t.propsData[n]=e.input.propsData[n],null!==(o=t.propsData)&&void 0!==o&&o.type&&null!==(r=t.props)&&void 0!==r&&null!==(i=r.type)&&void 0!==i&&i.default&&(t.propsData.type=t.props.type.default)}else t.propsData[n]=t.props[n].default}},__applyRefProps=function(t,e){if(null!=e&&e.propsData)for(var n in e.propsData)t.propsData[n]=e.propsData[n]},__filterInputsByMultiple=function(t,e){return t.filter((function(t){return t.multiple&&e||!t.multiple&&!e}))},fcInputs={string:{text:"Текст",name:"string",type:"b-form-input",props:{placeholder:{type:"string",default:null,label:"Надпись внутри",visible:!0},type:{type:"string",default:"text",label:"Тип данных",visible:!0}},propsData:{},defaultValue:null},number:{text:"Число",name:"number",type:"b-form-input",props:{placeholder:{type:"string",default:null,label:"Надпись внутри",visible:!0},type:{type:"string",default:"number",label:"Тип данных",visible:!0},min:{type:"number",default:null,label:"Минимальное значение",visible:!0}},propsData:{},defaultValue:null},memo:{text:"Большой текст",name:"memo",type:"b-form-textarea",props:{placeholder:{type:"string",default:null,label:"Надпись внутри",visible:!0},max:{type:"number",default:30,label:"Максимальное значение",visible:!0}},propsData:{},defaultValue:null},date:{text:"Дата",name:"date",type:"rb-date-picker-input",props:{minCurrentDate:{type:"boolean",default:!1,label:"Установить текущую дату как минимальную",visible:!0},minDate:{type:"date",default:null,label:"Установить минимальную дату",visible:!0},maxDate:{type:"date",default:null,label:"Установить максимальную дату",visible:!0}},propsData:{},defaultValue:null},datetime:{text:"Дата и вермя",name:"date",type:"rb-date-picker-input",props:{minDate:{type:"date",default:null,label:"Установить минимальную дату",visible:!0},maxDate:{type:"date",default:null,label:"Установить максимальную дату",visible:!0}},propsData:{},defaultValue:null},phone:{text:"Телефон",name:"phone",type:"rb-phone-input",props:{placeholder:{type:"string",default:"Телефон",label:"Надпись внутри",visible:!0}},propsData:{},defaultValue:null},boolean:{text:"Булевое",name:"boolean",type:"rb-boolean-single-option-input",props:{block:{type:"boolean",default:!0,label:"Растянуть",visible:!0},bordered:{type:"boolean",label:"Граница вокруг",default:!0,visible:!0}},propsData:{},defaultValue:null},email:{text:"Email",name:"email",type:"rb-email-input",props:{},propsData:{},defaultValue:[],multiple:!0}},fcPrimitiveInputs={string:[__clone(fcInputs.string),__clone(fcInputs.number),__clone(fcInputs.memo),__clone(fcInputs.phone)],memo:[__clone(fcInputs.memo),__clone(fcInputs.string)],number:[__clone(fcInputs.string),__clone(fcInputs.number)],double:[__clone(fcInputs.string),__clone(fcInputs.number)],float:[__clone(fcInputs.string),__clone(fcInputs.number)],integer:[__clone(fcInputs.string),__clone(fcInputs.number)],long:[__clone(fcInputs.string),__clone(fcInputs.number)],date:[__clone(fcInputs.date)],datetime:[__clone(fcInputs.datetime)],boolean:[__clone(fcInputs.boolean)],email:[__clone(fcInputs.email)]},fcDictInputs=[],fcRefInputs={},fcRefInputConfigs={},baseConfig={inputs:__clone(fcInputs),primitiveInputs:__clone(fcPrimitiveInputs),dictInputs:__clone(fcDictInputs),refInputs:__clone(fcRefInputs),refInputConfigs:__clone(fcRefInputConfigs),rules:[],icons:{iconExpandFacet:"icon-chevron-down",iconCollapseFacet:"icon-chevron-up",iconCloseFieldSidebar:"icon-chevron-right",iconOpenFieldSidebar:"icon-chevron-left",iconAdd:"icon-add",iconEdit:"icon-edit",iconDelete:"icon-delete",iconDrag:"icon-reorder"},ruleContext:{}},UtFormConstructor={config:{},init:function(t){this.config=__clone(baseConfig),t&&(t.inputs&&__mergeInputsInMap(this.config.inputs,t.inputs),t.primitiveInputs&&__mergeInputInMapOfArrays(this.config.primitiveInputs,t.primitiveInputs),t.dictInputs&&__mergeInputsInArray(this.config.dictInputs,t.dictInputs),t.refInputs&&__mergeInputInMapOfArrays(this.config.refInputs,t.refInputs),t.refInputConfigs&&(this.config.refInputConfigs=t.refInputConfigs),t.icons&&(this.config.icons=_assign(this.config.icons,t.icons)),t.rules&&(this.config.rules=t.rules),t.ruleContext&&(this.config.ruleContext=t.ruleContext))},getInputTypes:function(t){var e=[];return t?e=t.dict&&!this.config.refInputs[t.ref]?__filterInputsByMultiple(this.config.dictInputs,t.multiple):t.ref?__filterInputsByMultiple(this.config.refInputs[t.ref],t.multiple):__filterInputsByMultiple(this.config.primitiveInputs[t.type],t.multiple):e},hasMultipleInputTypes:function(t){var e=this.getInputTypes(_objectSpread2(_objectSpread2({},t),{},{multiple:!0}));return e&&e.length>0},getDefaultInput:function(t){var e=null,n=this.getInputTypes(t);return n||(e=this.primitiveInputs[0]),t.ref&&this.config.refInputs[t.ref]?(e=__clone(n[0]),__applyDefaultProps(e),this.config.refInputConfigs[t.ref]&&this.config.refInputConfigs[t.ref][e.name]&&__applyRefProps(e,this.config.refInputConfigs[t.ref][e.name])):t.dict?((e=__clone(n[0])).props.dict.default=t.ref,__applyDefaultProps(e)):(e=__clone(n[0]),__applyDefaultProps(e)),e},getInputTypeByName:function(t,e){var n=__clone(this.config.inputs[t]),o=e.input&&e.input.propsData?_objectSpread2({},e.input.propsData):{};return e.ref&&this.config.refInputs[e.ref]?(__applyDefaultProps(n,e),this.config.refInputConfigs[e.ref]&&this.config.refInputConfigs[e.ref][n.name]&&__applyRefProps(n,this.config.refInputConfigs[e.ref][n.name])):e.dict?(n.props.dict.default=e.ref,__applyDefaultProps(n,e)):__applyDefaultProps(n,e),o&&Object.assign(n.propsData,o),n.propsData.ref=e.name,n},getAvailableFieldRules:function(t){return this.config.rules.filter((function(e){return!e.fields||0===e.fields.length||e.fields.indexOf(t.name)>=0}))},getRuleContext:function(){return this.config.ruleContext},runRule:function runRule(context,script){context=context||{},context.console=console,context.Date=Date,context.Math=Math;var appendScript="";for(var v in context)appendScript+="var ".concat(v," = this.").concat(v,";\n");appendScript=appendScript?appendScript+"\n":"";var func=function func(script){return eval(script)};func.call(context,appendScript+script)}},script$5={name:"DocTemplateSectionModal",props:{section:Object,mode:{type:String,default:"ins"},onAfterOk:{type:Function,default:function(){}}},data:function(){return{id:"rb-doc-template-section-modal",label:{}}},computed:{title:function(){return"ins"===this.mode?"Добавление секции":"Редактирование секции"}},watch:{section:function(){this.section&&(this.label=this.section)}},methods:{onOk:function(){var t=this;this.section=this.label,this.onAfterOk&&this.onAfterOk(),this.$nextTick((function(){t.$bvModal.hide(t.id)}))}},created:function(){this.section&&(this.label=this.section)}};function normalizeComponent(t,e,n,o,r,i,a,l,s,c){"boolean"!=typeof a&&(s=l,l=a,a=!1);const u="function"==typeof n?n.options:n;let d;if(t&&t.render&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),o&&(u._scopeId=o),i?(d=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,s(t)),t&&t._registeredComponents&&t._registeredComponents.add(i)},u._ssrRegister=d):e&&(d=a?function(t){e.call(this,c(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,l(t))}),d)if(u.functional){const t=u.render;u.render=function(e,n){return d.call(n),t(e,n)}}else{const t=u.beforeCreate;u.beforeCreate=t?[].concat(t,d):[d]}return n}var __vue_script__$5=script$5,__vue_render__$5=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("b-modal",{attrs:{id:"rb-doc-template-section-modal","modal-class":"rb-doc-template-section-modal","ok-title":"Сохранить изменения","cancel-variant":"outline-gray","cancel-title":"Отмена",title:t.title},on:{ok:function(e){return e.preventDefault(),t.onOk.apply(null,arguments)}}},[n("b-form",{on:{submit:function(e){return e.preventDefault(),t.onOk.apply(null,arguments)}}},[n("b-form-row",[n("b-col",{attrs:{lg:"12"}},[n("b-form-group",{attrs:{label:"Наименование секции"}},[n("rb-multi-lang-input",{model:{value:t.label,callback:function(e){t.label=e},expression:"label"}})],1)],1)],1)],1)],1)},__vue_staticRenderFns__$5=[],__vue_inject_styles__$5=void 0,__vue_scope_id__$5=void 0,__vue_module_identifier__$5=void 0,__vue_is_functional_template__$5=!1,__vue_component__$6=normalizeComponent({render:__vue_render__$5,staticRenderFns:__vue_staticRenderFns__$5},__vue_inject_styles__$5,__vue_script__$5,__vue_scope_id__$5,__vue_is_functional_template__$5,__vue_module_identifier__$5,!1,void 0,void 0,void 0),DocTemplateSectionModal=__vue_component__$6,commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return commonjsRequire(t,null==e?n.path:e)}},n.exports),n.exports}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}
|
|
2
2
|
/**!
|
|
3
3
|
* Sortable 1.10.2
|
|
4
4
|
* @author RubaXa <trash@rubaxa.org>
|
|
@@ -574,10 +574,13 @@ var UtFormConstructor = {
|
|
|
574
574
|
return input;
|
|
575
575
|
},
|
|
576
576
|
getInputTypeByName: function getInputTypeByName(name, field) {
|
|
577
|
-
var input = __clone(this.config.inputs[name]);
|
|
577
|
+
var input = __clone(this.config.inputs[name]); // Сохраняем существующие propsData
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
var existingPropsData = field.input && field.input.propsData ? _objectSpread2({}, field.input.propsData) : {};
|
|
578
581
|
|
|
579
582
|
if (field.ref && this.config.refInputs[field.ref]) {
|
|
580
|
-
__applyDefaultProps(input);
|
|
583
|
+
__applyDefaultProps(input, field);
|
|
581
584
|
|
|
582
585
|
if (this.config.refInputConfigs[field.ref] && this.config.refInputConfigs[field.ref][input.name]) {
|
|
583
586
|
__applyRefProps(input, this.config.refInputConfigs[field.ref][input.name]);
|
|
@@ -588,6 +591,11 @@ var UtFormConstructor = {
|
|
|
588
591
|
__applyDefaultProps(input, field);
|
|
589
592
|
} else {
|
|
590
593
|
__applyDefaultProps(input, field);
|
|
594
|
+
} // Восстанавливаем существующие propsData
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
if (existingPropsData) {
|
|
598
|
+
Object.assign(input.propsData, existingPropsData);
|
|
591
599
|
}
|
|
592
600
|
|
|
593
601
|
input.propsData['ref'] = field.name;
|
|
@@ -8233,7 +8241,7 @@ var __vue_inject_styles__ = undefined;
|
|
|
8233
8241
|
var __vue_scope_id__ = undefined;
|
|
8234
8242
|
/* module identifier */
|
|
8235
8243
|
|
|
8236
|
-
var __vue_module_identifier__ = "data-v-
|
|
8244
|
+
var __vue_module_identifier__ = "data-v-72392df9";
|
|
8237
8245
|
/* functional template */
|
|
8238
8246
|
|
|
8239
8247
|
var __vue_is_functional_template__ = false;
|
package/package.json
CHANGED
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
|
|
107
107
|
<script>
|
|
108
108
|
import DocTemplateFacetList from "@/components/DocTemplateFacetList";
|
|
109
|
-
import DocTemplateFieldSidebar from "@/components/DocTemplateFieldSidebar";
|
|
109
|
+
import DocTemplateFieldSidebar from "@/components/DocTemplateFieldSidebar.vue";
|
|
110
110
|
import DocTemplateSectionModal from "@/components/DocTemplateSectionModal";
|
|
111
111
|
import draggable from 'vuedraggable';
|
|
112
112
|
import {UtFormConfig} from "../utils/UtFormConfig";
|