rb-document-form-constructor 0.1.6 → 0.1.7

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.
@@ -83,6 +83,309 @@ const UtFormConfig = {
83
83
 
84
84
  };
85
85
 
86
+ let __clone = function (data) {
87
+ return JSON.parse(JSON.stringify(data));
88
+ };
89
+
90
+ let __assign = function () {
91
+ __assign = Object.assign || function __assign(t) {
92
+ for (let s, i = 1, n = arguments.length; i < n; i++) {
93
+ s = arguments[i];
94
+
95
+ for (let p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
96
+ }
97
+
98
+ return t;
99
+ };
100
+
101
+ return __assign.apply(this, arguments);
102
+ };
103
+
104
+ let __mergeInputInMapOfArrays = function (inputs, formConfigInputs) {
105
+ for (let dataType in formConfigInputs) {
106
+ let foundInputs = inputs[dataType];
107
+
108
+ if (foundInputs) {
109
+ __mergeInputsInArray(foundInputs, formConfigInputs[dataType]);
110
+ } else {
111
+ inputs[dataType] = formConfigInputs[dataType];
112
+ }
113
+ }
114
+ };
115
+
116
+ let __mergeInputsInMap = function (inputs, formConfigInputs) {
117
+ for (let name in formConfigInputs) {
118
+ inputs[name] = __assign(inputs[name] ? inputs[name] : {}, formConfigInputs[name] ? formConfigInputs[name] : {});
119
+ }
120
+ };
121
+
122
+ let __mergeInputsInArray = function (inputs, formConfigInputs) {
123
+ formConfigInputs.forEach(input => {
124
+ let index = inputs.findIndex(item => item.name === input.name);
125
+
126
+ if (index >= 0) {
127
+ inputs[index] = input;
128
+ } else {
129
+ inputs.push(input);
130
+ }
131
+ });
132
+ };
133
+
134
+ let __applyDefaultProps = function (input) {
135
+ for (let propName in input.props) {
136
+ input.propsData[propName] = input.props[propName].default;
137
+ }
138
+ };
139
+
140
+ let __applyRefProps = function (input, refConfig) {
141
+ if (refConfig !== null && refConfig !== void 0 && refConfig.propsData) {
142
+ for (let propName in refConfig.propsData) {
143
+ input.propsData[propName] = refConfig.propsData[propName];
144
+ }
145
+ }
146
+ };
147
+
148
+ let fcInputs = {
149
+ text: {
150
+ text: 'Текст',
151
+ name: 'text',
152
+ type: 'b-form-input',
153
+ props: {
154
+ placeholder: {
155
+ type: 'string',
156
+ default: null,
157
+ label: 'Надпись внутри',
158
+ visible: true
159
+ },
160
+ type: {
161
+ type: 'string',
162
+ default: 'text',
163
+ label: 'Тип данных',
164
+ visible: false
165
+ }
166
+ },
167
+ propsData: {},
168
+ defaultValue: null
169
+ },
170
+ number: {
171
+ text: 'Число',
172
+ name: 'number',
173
+ type: 'b-form-input',
174
+ props: {
175
+ placeholder: {
176
+ type: 'string',
177
+ default: null,
178
+ label: 'Надпись внутри',
179
+ visible: true
180
+ },
181
+ type: {
182
+ type: 'string',
183
+ default: 'number',
184
+ label: 'Тип данных',
185
+ visible: false
186
+ }
187
+ },
188
+ propsData: {},
189
+ defaultValue: null
190
+ },
191
+ memo: {
192
+ text: 'Большой текст',
193
+ name: 'memo',
194
+ type: 'b-form-textarea',
195
+ props: {
196
+ placeholder: {
197
+ type: 'string',
198
+ default: null,
199
+ label: 'Надпись внутри',
200
+ visible: true
201
+ }
202
+ },
203
+ propsData: {},
204
+ defaultValue: null
205
+ },
206
+ date: {
207
+ text: 'Дата',
208
+ name: 'date',
209
+ type: 'rb-date-picker-input',
210
+ props: {},
211
+ propsData: {},
212
+ defaultValue: null
213
+ },
214
+ phone: {
215
+ text: 'Телефон',
216
+ name: 'phone',
217
+ type: 'rb-phone-input',
218
+ props: {
219
+ placeholder: {
220
+ type: 'string',
221
+ default: 'Телефон',
222
+ label: 'Надпись внутри',
223
+ visible: true
224
+ }
225
+ },
226
+ propsData: {},
227
+ defaultValue: null
228
+ }
229
+ };
230
+ let fcPrimitiveInputs = {
231
+ text: [__clone(fcInputs.text), __clone(fcInputs.number), __clone(fcInputs.memo), __clone(fcInputs.phone)],
232
+ memo: [__clone(fcInputs.memo), __clone(fcInputs.text)],
233
+ number: [__clone(fcInputs.text), __clone(fcInputs.number)],
234
+ date: [__clone(fcInputs.date)]
235
+ };
236
+ let fcDictInputs = [];
237
+ let fcRefInputs = {};
238
+ let fcRefInputConfigs = {};
239
+ let baseConfig = {
240
+ inputs: __clone(fcInputs),
241
+ primitiveInputs: __clone(fcPrimitiveInputs),
242
+ dictInputs: __clone(fcDictInputs),
243
+ refInputs: __clone(fcRefInputs),
244
+ refInputConfigs: __clone(fcRefInputConfigs),
245
+ rules: [],
246
+ icons: {
247
+ iconExpandFacet: 'icon-chevron-up',
248
+ iconCollapseFacet: 'icon-chevron-down',
249
+ iconCloseFieldSidebar: 'icon-chevron-right',
250
+ iconOpenFieldSidebar: 'icon-chevron-left',
251
+ iconAdd: 'icon-add',
252
+ iconEdit: 'icon-edit',
253
+ iconDelete: 'icon-delete',
254
+ iconDrag: 'icon-reorder'
255
+ },
256
+ ruleContext: {}
257
+ };
258
+ const UtFormConstructor = {
259
+ config: {},
260
+
261
+ init(formConfig) {
262
+ this.config = __clone(baseConfig);
263
+
264
+ if (formConfig) {
265
+ if (formConfig.inputs) {
266
+ __mergeInputsInMap(this.config.inputs, formConfig.inputs);
267
+ }
268
+
269
+ if (formConfig.primitiveInputs) {
270
+ __mergeInputInMapOfArrays(this.config.primitiveInputs, formConfig.primitiveInputs);
271
+ }
272
+
273
+ if (formConfig.dictInputs) {
274
+ __mergeInputsInArray(this.config.dictInputs, formConfig.dictInputs);
275
+ }
276
+
277
+ if (formConfig.refInputs) {
278
+ __mergeInputInMapOfArrays(this.config.refInputs, formConfig.refInputs);
279
+ }
280
+
281
+ if (formConfig.refInputConfigs) {
282
+ this.config.refInputConfigs = formConfig.refInputConfigs;
283
+ }
284
+
285
+ if (formConfig.icons) {
286
+ this.config.icons = __assign(this.config.icons, formConfig.icons);
287
+ }
288
+
289
+ if (formConfig.rules) {
290
+ this.config.rules = formConfig.rules;
291
+ }
292
+
293
+ if (formConfig.ruleContext) {
294
+ this.config.ruleContext = formConfig.ruleContext;
295
+ }
296
+ }
297
+ },
298
+
299
+ getInputTypes(field) {
300
+ if (!field) {
301
+ return [];
302
+ }
303
+
304
+ if (field.dict && !this.config.refInputs[field.ref]) {
305
+ return this.config.dictInputs;
306
+ }
307
+
308
+ if (field.ref) {
309
+ return this.config.refInputs[field.ref];
310
+ }
311
+
312
+ return this.config.primitiveInputs[field.type];
313
+ },
314
+
315
+ getDefaultInput(field) {
316
+ let input = null;
317
+
318
+ if (field.ref && this.config.refInputs[field.ref]) {
319
+ input = __clone(this.config.refInputs[field.ref][0]);
320
+
321
+ __applyDefaultProps(input);
322
+
323
+ if (this.config.refInputConfigs[field.ref] && this.config.refInputConfigs[field.ref][input.name]) {
324
+ __applyRefProps(input, this.config.refInputConfigs[field.ref][input.name]);
325
+ }
326
+ } else if (field.dict) {
327
+ input = __clone(this.config.dictInputs[0]);
328
+ input.props.dict.default = field.ref;
329
+
330
+ __applyDefaultProps(input);
331
+ } else {
332
+ input = __clone(this.config.primitiveInputs[field.type][0]);
333
+
334
+ __applyDefaultProps(input);
335
+ }
336
+
337
+ return input;
338
+ },
339
+
340
+ getInputTypeByName(name, field) {
341
+ let input = JSON.parse(JSON.stringify(this.config.inputs[name]));
342
+
343
+ if (field.ref && this.config.refInputs[field.ref]) {
344
+ __applyDefaultProps(input);
345
+
346
+ if (this.config.refInputConfigs[field.ref] && this.config.refInputConfigs[field.ref][input.name]) {
347
+ __applyRefProps(input, this.config.refInputConfigs[field.ref][input.name]);
348
+ }
349
+ } else if (field.dict) {
350
+ input.props.dict.default = field.ref;
351
+
352
+ __applyDefaultProps(input);
353
+ } else {
354
+ __applyDefaultProps(input);
355
+ }
356
+
357
+ input.propsData['ref'] = field.name;
358
+ return input;
359
+ },
360
+
361
+ getAvailableFieldRules(field) {
362
+ return this.config.rules.filter(rule => {
363
+ return !rule.fields || rule.fields.length === 0 || rule.fields.indexOf(field.name) >= 0;
364
+ });
365
+ },
366
+
367
+ getRuleContext() {
368
+ return this.config.ruleContext;
369
+ },
370
+
371
+ runRule(context, script) {
372
+ let appendScript = `
373
+ var doc = this.form.doc;
374
+ var form = this.form;
375
+ var event = this.event;
376
+ var eventName = this.eventName;
377
+
378
+ `;
379
+
380
+ let func = function (script) {
381
+ return eval(script);
382
+ };
383
+
384
+ func.call(context, appendScript + script);
385
+ }
386
+
387
+ };
388
+
86
389
  //
87
390
  //
88
391
  //
@@ -4957,1052 +5260,749 @@ $export($export.P + $export.F * __webpack_require__("5147")(STARTS_WITH), 'Strin
4957
5260
  });
4958
5261
 
4959
5262
 
4960
- /***/ }),
4961
-
4962
- /***/ "f6fd":
4963
- /***/ (function(module, exports) {
4964
-
4965
- // document.currentScript polyfill by Adam Miller
4966
-
4967
- // MIT license
4968
-
4969
- (function(document){
4970
- var currentScript = "currentScript",
4971
- scripts = document.getElementsByTagName('script'); // Live NodeList collection
4972
-
4973
- // If browser needs currentScript polyfill, add get currentScript() to the document object
4974
- if (!(currentScript in document)) {
4975
- Object.defineProperty(document, currentScript, {
4976
- get: function(){
4977
-
4978
- // IE 6-10 supports script readyState
4979
- // IE 10+ support stack trace
4980
- try { throw new Error(); }
4981
- catch (err) {
4982
-
4983
- // Find the second match for the "at" string to get file src url from stack.
4984
- // Specifically works with the format of stack traces in IE.
4985
- var i, res = ((/.*at [^\(]*\((.*):.+:.+\)$/ig).exec(err.stack) || [false])[1];
4986
-
4987
- // For all scripts on the page, if src matches or if ready state is interactive, return the script tag
4988
- for(i in scripts){
4989
- if(scripts[i].src == res || scripts[i].readyState == "interactive"){
4990
- return scripts[i];
4991
- }
4992
- }
4993
-
4994
- // If no match, return null
4995
- return null;
4996
- }
4997
- }
4998
- });
4999
- }
5000
- })(document);
5001
-
5002
-
5003
- /***/ }),
5004
-
5005
- /***/ "f751":
5006
- /***/ (function(module, exports, __webpack_require__) {
5007
-
5008
- // 19.1.3.1 Object.assign(target, source)
5009
- var $export = __webpack_require__("5ca1");
5010
-
5011
- $export($export.S + $export.F, 'Object', { assign: __webpack_require__("7333") });
5012
-
5013
-
5014
- /***/ }),
5015
-
5016
- /***/ "fa5b":
5017
- /***/ (function(module, exports, __webpack_require__) {
5018
-
5019
- module.exports = __webpack_require__("5537")('native-function-to-string', Function.toString);
5020
-
5021
-
5022
- /***/ }),
5023
-
5024
- /***/ "fab2":
5025
- /***/ (function(module, exports, __webpack_require__) {
5026
-
5027
- var document = __webpack_require__("7726").document;
5028
- module.exports = document && document.documentElement;
5029
-
5030
-
5031
- /***/ }),
5032
-
5033
- /***/ "fb15":
5034
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
5035
- // ESM COMPAT FLAG
5036
- __webpack_require__.r(__webpack_exports__);
5037
-
5038
- // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
5039
- // This file is imported into lib/wc client bundles.
5040
-
5041
- if (typeof window !== 'undefined') {
5042
- {
5043
- __webpack_require__("f6fd");
5044
- }
5045
-
5046
- var setPublicPath_i;
5047
- if ((setPublicPath_i = window.document.currentScript) && (setPublicPath_i = setPublicPath_i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))) {
5048
- __webpack_require__.p = setPublicPath_i[1]; // eslint-disable-line
5049
- }
5050
- }
5051
-
5052
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.object.assign.js
5053
- __webpack_require__("f751");
5054
-
5055
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.string.starts-with.js
5056
- __webpack_require__("f559");
5057
-
5058
- // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom.iterable.js
5059
- __webpack_require__("ac6a");
5060
-
5061
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.array.iterator.js
5062
- __webpack_require__("cadf");
5063
-
5064
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.object.keys.js
5065
- __webpack_require__("456d");
5066
-
5067
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
5068
- function _arrayWithHoles(arr) {
5069
- if (Array.isArray(arr)) return arr;
5070
- }
5071
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
5072
- function _iterableToArrayLimit(arr, i) {
5073
- if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
5074
- var _arr = [];
5075
- var _n = true;
5076
- var _d = false;
5077
- var _e = undefined;
5078
-
5079
- try {
5080
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
5081
- _arr.push(_s.value);
5082
-
5083
- if (i && _arr.length === i) break;
5084
- }
5085
- } catch (err) {
5086
- _d = true;
5087
- _e = err;
5088
- } finally {
5089
- try {
5090
- if (!_n && _i["return"] != null) _i["return"]();
5091
- } finally {
5092
- if (_d) throw _e;
5093
- }
5094
- }
5095
-
5096
- return _arr;
5097
- }
5098
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
5099
- function _arrayLikeToArray(arr, len) {
5100
- if (len == null || len > arr.length) len = arr.length;
5101
-
5102
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
5103
- arr2[i] = arr[i];
5104
- }
5105
-
5106
- return arr2;
5107
- }
5108
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
5109
-
5110
- function _unsupportedIterableToArray(o, minLen) {
5111
- if (!o) return;
5112
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
5113
- var n = Object.prototype.toString.call(o).slice(8, -1);
5114
- if (n === "Object" && o.constructor) n = o.constructor.name;
5115
- if (n === "Map" || n === "Set") return Array.from(o);
5116
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
5117
- }
5118
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
5119
- function _nonIterableRest() {
5120
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5121
- }
5122
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
5123
-
5124
-
5125
-
5126
-
5127
- function _slicedToArray(arr, i) {
5128
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
5129
- }
5130
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es7.array.includes.js
5131
- __webpack_require__("6762");
5132
-
5133
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.string.includes.js
5134
- __webpack_require__("2fdb");
5135
-
5136
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
5137
-
5138
- function _arrayWithoutHoles(arr) {
5139
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
5140
- }
5141
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
5142
- function _iterableToArray(iter) {
5143
- if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
5144
- }
5145
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
5146
- function _nonIterableSpread() {
5147
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5148
- }
5149
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
5150
-
5151
-
5152
-
5153
-
5154
- function _toConsumableArray(arr) {
5155
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
5156
- }
5157
- // EXTERNAL MODULE: external {"commonjs":"sortablejs","commonjs2":"sortablejs","amd":"sortablejs","root":"Sortable"}
5158
- var external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_ = __webpack_require__("a352");
5159
- var external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_);
5160
-
5161
- // EXTERNAL MODULE: ./src/util/helper.js
5162
- var helper = __webpack_require__("c649");
5163
-
5164
- // CONCATENATED MODULE: ./src/vuedraggable.js
5165
-
5166
-
5167
-
5168
-
5169
-
5170
-
5263
+ /***/ }),
5171
5264
 
5265
+ /***/ "f6fd":
5266
+ /***/ (function(module, exports) {
5172
5267
 
5268
+ // document.currentScript polyfill by Adam Miller
5173
5269
 
5270
+ // MIT license
5174
5271
 
5272
+ (function(document){
5273
+ var currentScript = "currentScript",
5274
+ scripts = document.getElementsByTagName('script'); // Live NodeList collection
5175
5275
 
5276
+ // If browser needs currentScript polyfill, add get currentScript() to the document object
5277
+ if (!(currentScript in document)) {
5278
+ Object.defineProperty(document, currentScript, {
5279
+ get: function(){
5176
5280
 
5177
- function buildAttribute(object, propName, value) {
5178
- if (value === undefined) {
5179
- return object;
5180
- }
5281
+ // IE 6-10 supports script readyState
5282
+ // IE 10+ support stack trace
5283
+ try { throw new Error(); }
5284
+ catch (err) {
5181
5285
 
5182
- object = object || {};
5183
- object[propName] = value;
5184
- return object;
5185
- }
5286
+ // Find the second match for the "at" string to get file src url from stack.
5287
+ // Specifically works with the format of stack traces in IE.
5288
+ var i, res = ((/.*at [^\(]*\((.*):.+:.+\)$/ig).exec(err.stack) || [false])[1];
5186
5289
 
5187
- function computeVmIndex(vnodes, element) {
5188
- return vnodes.map(function (elt) {
5189
- return elt.elm;
5190
- }).indexOf(element);
5191
- }
5290
+ // For all scripts on the page, if src matches or if ready state is interactive, return the script tag
5291
+ for(i in scripts){
5292
+ if(scripts[i].src == res || scripts[i].readyState == "interactive"){
5293
+ return scripts[i];
5294
+ }
5295
+ }
5192
5296
 
5193
- function _computeIndexes(slots, children, isTransition, footerOffset) {
5194
- if (!slots) {
5195
- return [];
5297
+ // If no match, return null
5298
+ return null;
5299
+ }
5300
+ }
5301
+ });
5196
5302
  }
5303
+ })(document);
5197
5304
 
5198
- var elmFromNodes = slots.map(function (elt) {
5199
- return elt.elm;
5200
- });
5201
- var footerIndex = children.length - footerOffset;
5202
5305
 
5203
- var rawIndexes = _toConsumableArray(children).map(function (elt, idx) {
5204
- return idx >= footerIndex ? elmFromNodes.length : elmFromNodes.indexOf(elt);
5205
- });
5306
+ /***/ }),
5206
5307
 
5207
- return isTransition ? rawIndexes.filter(function (ind) {
5208
- return ind !== -1;
5209
- }) : rawIndexes;
5210
- }
5308
+ /***/ "f751":
5309
+ /***/ (function(module, exports, __webpack_require__) {
5211
5310
 
5212
- function emit(evtName, evtData) {
5213
- var _this = this;
5311
+ // 19.1.3.1 Object.assign(target, source)
5312
+ var $export = __webpack_require__("5ca1");
5214
5313
 
5215
- this.$nextTick(function () {
5216
- return _this.$emit(evtName.toLowerCase(), evtData);
5217
- });
5218
- }
5314
+ $export($export.S + $export.F, 'Object', { assign: __webpack_require__("7333") });
5219
5315
 
5220
- function delegateAndEmit(evtName) {
5221
- var _this2 = this;
5222
5316
 
5223
- return function (evtData) {
5224
- if (_this2.realList !== null) {
5225
- _this2["onDrag" + evtName](evtData);
5226
- }
5317
+ /***/ }),
5227
5318
 
5228
- emit.call(_this2, evtName, evtData);
5229
- };
5230
- }
5319
+ /***/ "fa5b":
5320
+ /***/ (function(module, exports, __webpack_require__) {
5231
5321
 
5232
- function isTransitionName(name) {
5233
- return ["transition-group", "TransitionGroup"].includes(name);
5234
- }
5322
+ module.exports = __webpack_require__("5537")('native-function-to-string', Function.toString);
5235
5323
 
5236
- function vuedraggable_isTransition(slots) {
5237
- if (!slots || slots.length !== 1) {
5238
- return false;
5239
- }
5240
5324
 
5241
- var _slots = _slicedToArray(slots, 1),
5242
- componentOptions = _slots[0].componentOptions;
5325
+ /***/ }),
5243
5326
 
5244
- if (!componentOptions) {
5245
- return false;
5246
- }
5327
+ /***/ "fab2":
5328
+ /***/ (function(module, exports, __webpack_require__) {
5247
5329
 
5248
- return isTransitionName(componentOptions.tag);
5249
- }
5330
+ var document = __webpack_require__("7726").document;
5331
+ module.exports = document && document.documentElement;
5250
5332
 
5251
- function getSlot(slot, scopedSlot, key) {
5252
- return slot[key] || (scopedSlot[key] ? scopedSlot[key]() : undefined);
5253
- }
5254
5333
 
5255
- function computeChildrenAndOffsets(children, slot, scopedSlot) {
5256
- var headerOffset = 0;
5257
- var footerOffset = 0;
5258
- var header = getSlot(slot, scopedSlot, "header");
5334
+ /***/ }),
5259
5335
 
5260
- if (header) {
5261
- headerOffset = header.length;
5262
- children = children ? [].concat(_toConsumableArray(header), _toConsumableArray(children)) : _toConsumableArray(header);
5263
- }
5336
+ /***/ "fb15":
5337
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
5338
+ // ESM COMPAT FLAG
5339
+ __webpack_require__.r(__webpack_exports__);
5264
5340
 
5265
- var footer = getSlot(slot, scopedSlot, "footer");
5341
+ // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
5342
+ // This file is imported into lib/wc client bundles.
5266
5343
 
5267
- if (footer) {
5268
- footerOffset = footer.length;
5269
- children = children ? [].concat(_toConsumableArray(children), _toConsumableArray(footer)) : _toConsumableArray(footer);
5344
+ if (typeof window !== 'undefined') {
5345
+ {
5346
+ __webpack_require__("f6fd");
5270
5347
  }
5271
5348
 
5272
- return {
5273
- children: children,
5274
- headerOffset: headerOffset,
5275
- footerOffset: footerOffset
5276
- };
5349
+ var setPublicPath_i;
5350
+ if ((setPublicPath_i = window.document.currentScript) && (setPublicPath_i = setPublicPath_i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))) {
5351
+ __webpack_require__.p = setPublicPath_i[1]; // eslint-disable-line
5352
+ }
5277
5353
  }
5278
5354
 
5279
- function getComponentAttributes($attrs, componentData) {
5280
- var attributes = null;
5355
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.object.assign.js
5356
+ __webpack_require__("f751");
5281
5357
 
5282
- var update = function update(name, value) {
5283
- attributes = buildAttribute(attributes, name, value);
5284
- };
5358
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.string.starts-with.js
5359
+ __webpack_require__("f559");
5285
5360
 
5286
- var attrs = Object.keys($attrs).filter(function (key) {
5287
- return key === "id" || key.startsWith("data-");
5288
- }).reduce(function (res, key) {
5289
- res[key] = $attrs[key];
5290
- return res;
5291
- }, {});
5292
- update("attrs", attrs);
5361
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom.iterable.js
5362
+ __webpack_require__("ac6a");
5293
5363
 
5294
- if (!componentData) {
5295
- return attributes;
5296
- }
5364
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.array.iterator.js
5365
+ __webpack_require__("cadf");
5297
5366
 
5298
- var on = componentData.on,
5299
- props = componentData.props,
5300
- componentDataAttrs = componentData.attrs;
5301
- update("on", on);
5302
- update("props", props);
5303
- Object.assign(attributes.attrs, componentDataAttrs);
5304
- return attributes;
5367
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.object.keys.js
5368
+ __webpack_require__("456d");
5369
+
5370
+ // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
5371
+ function _arrayWithHoles(arr) {
5372
+ if (Array.isArray(arr)) return arr;
5305
5373
  }
5374
+ // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
5375
+ function _iterableToArrayLimit(arr, i) {
5376
+ if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
5377
+ var _arr = [];
5378
+ var _n = true;
5379
+ var _d = false;
5380
+ var _e = undefined;
5306
5381
 
5307
- var eventsListened = ["Start", "Add", "Remove", "Update", "End"];
5308
- var eventsToEmit = ["Choose", "Unchoose", "Sort", "Filter", "Clone"];
5309
- var readonlyProperties = ["Move"].concat(eventsListened, eventsToEmit).map(function (evt) {
5310
- return "on" + evt;
5311
- });
5312
- var draggingElement = null;
5313
- var props = {
5314
- options: Object,
5315
- list: {
5316
- type: Array,
5317
- required: false,
5318
- default: null
5319
- },
5320
- value: {
5321
- type: Array,
5322
- required: false,
5323
- default: null
5324
- },
5325
- noTransitionOnDrag: {
5326
- type: Boolean,
5327
- default: false
5328
- },
5329
- clone: {
5330
- type: Function,
5331
- default: function _default(original) {
5332
- return original;
5382
+ try {
5383
+ for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
5384
+ _arr.push(_s.value);
5385
+
5386
+ if (i && _arr.length === i) break;
5387
+ }
5388
+ } catch (err) {
5389
+ _d = true;
5390
+ _e = err;
5391
+ } finally {
5392
+ try {
5393
+ if (!_n && _i["return"] != null) _i["return"]();
5394
+ } finally {
5395
+ if (_d) throw _e;
5333
5396
  }
5334
- },
5335
- element: {
5336
- type: String,
5337
- default: "div"
5338
- },
5339
- tag: {
5340
- type: String,
5341
- default: null
5342
- },
5343
- move: {
5344
- type: Function,
5345
- default: null
5346
- },
5347
- componentData: {
5348
- type: Object,
5349
- required: false,
5350
- default: null
5351
5397
  }
5352
- };
5353
- var draggableComponent = {
5354
- name: "draggable",
5355
- inheritAttrs: false,
5356
- props: props,
5357
- data: function data() {
5358
- return {
5359
- transitionMode: false,
5360
- noneFunctionalComponentMode: false
5361
- };
5362
- },
5363
- render: function render(h) {
5364
- var slots = this.$slots.default;
5365
- this.transitionMode = vuedraggable_isTransition(slots);
5366
5398
 
5367
- var _computeChildrenAndOf = computeChildrenAndOffsets(slots, this.$slots, this.$scopedSlots),
5368
- children = _computeChildrenAndOf.children,
5369
- headerOffset = _computeChildrenAndOf.headerOffset,
5370
- footerOffset = _computeChildrenAndOf.footerOffset;
5399
+ return _arr;
5400
+ }
5401
+ // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
5402
+ function _arrayLikeToArray(arr, len) {
5403
+ if (len == null || len > arr.length) len = arr.length;
5404
+
5405
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
5406
+ arr2[i] = arr[i];
5407
+ }
5371
5408
 
5372
- this.headerOffset = headerOffset;
5373
- this.footerOffset = footerOffset;
5374
- var attributes = getComponentAttributes(this.$attrs, this.componentData);
5375
- return h(this.getTag(), attributes, children);
5376
- },
5377
- created: function created() {
5378
- if (this.list !== null && this.value !== null) {
5379
- helper["b" /* console */].error("Value and list props are mutually exclusive! Please set one or another.");
5380
- }
5409
+ return arr2;
5410
+ }
5411
+ // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
5381
5412
 
5382
- if (this.element !== "div") {
5383
- helper["b" /* console */].warn("Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props");
5384
- }
5413
+ function _unsupportedIterableToArray(o, minLen) {
5414
+ if (!o) return;
5415
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
5416
+ var n = Object.prototype.toString.call(o).slice(8, -1);
5417
+ if (n === "Object" && o.constructor) n = o.constructor.name;
5418
+ if (n === "Map" || n === "Set") return Array.from(o);
5419
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
5420
+ }
5421
+ // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
5422
+ function _nonIterableRest() {
5423
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5424
+ }
5425
+ // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
5385
5426
 
5386
- if (this.options !== undefined) {
5387
- helper["b" /* console */].warn("Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props");
5388
- }
5389
- },
5390
- mounted: function mounted() {
5391
- var _this3 = this;
5392
5427
 
5393
- this.noneFunctionalComponentMode = this.getTag().toLowerCase() !== this.$el.nodeName.toLowerCase() && !this.getIsFunctional();
5394
5428
 
5395
- if (this.noneFunctionalComponentMode && this.transitionMode) {
5396
- throw new Error("Transition-group inside component is not supported. Please alter tag value or remove transition-group. Current tag value: ".concat(this.getTag()));
5397
- }
5398
5429
 
5399
- var optionsAdded = {};
5400
- eventsListened.forEach(function (elt) {
5401
- optionsAdded["on" + elt] = delegateAndEmit.call(_this3, elt);
5402
- });
5403
- eventsToEmit.forEach(function (elt) {
5404
- optionsAdded["on" + elt] = emit.bind(_this3, elt);
5405
- });
5406
- var attributes = Object.keys(this.$attrs).reduce(function (res, key) {
5407
- res[Object(helper["a" /* camelize */])(key)] = _this3.$attrs[key];
5408
- return res;
5409
- }, {});
5410
- var options = Object.assign({}, this.options, attributes, optionsAdded, {
5411
- onMove: function onMove(evt, originalEvent) {
5412
- return _this3.onDragMove(evt, originalEvent);
5413
- }
5414
- });
5415
- !("draggable" in options) && (options.draggable = ">*");
5416
- this._sortable = new external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_default.a(this.rootContainer, options);
5417
- this.computeIndexes();
5418
- },
5419
- beforeDestroy: function beforeDestroy() {
5420
- if (this._sortable !== undefined) this._sortable.destroy();
5421
- },
5422
- computed: {
5423
- rootContainer: function rootContainer() {
5424
- return this.transitionMode ? this.$el.children[0] : this.$el;
5425
- },
5426
- realList: function realList() {
5427
- return this.list ? this.list : this.value;
5428
- }
5429
- },
5430
- watch: {
5431
- options: {
5432
- handler: function handler(newOptionValue) {
5433
- this.updateOptions(newOptionValue);
5434
- },
5435
- deep: true
5436
- },
5437
- $attrs: {
5438
- handler: function handler(newOptionValue) {
5439
- this.updateOptions(newOptionValue);
5440
- },
5441
- deep: true
5442
- },
5443
- realList: function realList() {
5444
- this.computeIndexes();
5445
- }
5446
- },
5447
- methods: {
5448
- getIsFunctional: function getIsFunctional() {
5449
- var fnOptions = this._vnode.fnOptions;
5450
- return fnOptions && fnOptions.functional;
5451
- },
5452
- getTag: function getTag() {
5453
- return this.tag || this.element;
5454
- },
5455
- updateOptions: function updateOptions(newOptionValue) {
5456
- for (var property in newOptionValue) {
5457
- var value = Object(helper["a" /* camelize */])(property);
5430
+ function _slicedToArray(arr, i) {
5431
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
5432
+ }
5433
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es7.array.includes.js
5434
+ __webpack_require__("6762");
5458
5435
 
5459
- if (readonlyProperties.indexOf(value) === -1) {
5460
- this._sortable.option(value, newOptionValue[property]);
5461
- }
5462
- }
5463
- },
5464
- getChildrenNodes: function getChildrenNodes() {
5465
- if (this.noneFunctionalComponentMode) {
5466
- return this.$children[0].$slots.default;
5467
- }
5436
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.string.includes.js
5437
+ __webpack_require__("2fdb");
5468
5438
 
5469
- var rawNodes = this.$slots.default;
5470
- return this.transitionMode ? rawNodes[0].child.$slots.default : rawNodes;
5471
- },
5472
- computeIndexes: function computeIndexes() {
5473
- var _this4 = this;
5439
+ // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
5474
5440
 
5475
- this.$nextTick(function () {
5476
- _this4.visibleIndexes = _computeIndexes(_this4.getChildrenNodes(), _this4.rootContainer.children, _this4.transitionMode, _this4.footerOffset);
5477
- });
5478
- },
5479
- getUnderlyingVm: function getUnderlyingVm(htmlElt) {
5480
- var index = computeVmIndex(this.getChildrenNodes() || [], htmlElt);
5441
+ function _arrayWithoutHoles(arr) {
5442
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
5443
+ }
5444
+ // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
5445
+ function _iterableToArray(iter) {
5446
+ if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
5447
+ }
5448
+ // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
5449
+ function _nonIterableSpread() {
5450
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5451
+ }
5452
+ // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
5481
5453
 
5482
- if (index === -1) {
5483
- //Edge case during move callback: related element might be
5484
- //an element different from collection
5485
- return null;
5486
- }
5487
5454
 
5488
- var element = this.realList[index];
5489
- return {
5490
- index: index,
5491
- element: element
5492
- };
5493
- },
5494
- getUnderlyingPotencialDraggableComponent: function getUnderlyingPotencialDraggableComponent(_ref) {
5495
- var vue = _ref.__vue__;
5496
5455
 
5497
- if (!vue || !vue.$options || !isTransitionName(vue.$options._componentTag)) {
5498
- if (!("realList" in vue) && vue.$children.length === 1 && "realList" in vue.$children[0]) return vue.$children[0];
5499
- return vue;
5500
- }
5501
5456
 
5502
- return vue.$parent;
5503
- },
5504
- emitChanges: function emitChanges(evt) {
5505
- var _this5 = this;
5457
+ function _toConsumableArray(arr) {
5458
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
5459
+ }
5460
+ // EXTERNAL MODULE: external {"commonjs":"sortablejs","commonjs2":"sortablejs","amd":"sortablejs","root":"Sortable"}
5461
+ var external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_ = __webpack_require__("a352");
5462
+ var external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_);
5506
5463
 
5507
- this.$nextTick(function () {
5508
- _this5.$emit("change", evt);
5509
- });
5510
- },
5511
- alterList: function alterList(onList) {
5512
- if (this.list) {
5513
- onList(this.list);
5514
- return;
5515
- }
5464
+ // EXTERNAL MODULE: ./src/util/helper.js
5465
+ var helper = __webpack_require__("c649");
5516
5466
 
5517
- var newList = _toConsumableArray(this.value);
5467
+ // CONCATENATED MODULE: ./src/vuedraggable.js
5518
5468
 
5519
- onList(newList);
5520
- this.$emit("input", newList);
5521
- },
5522
- spliceList: function spliceList() {
5523
- var _arguments = arguments;
5524
5469
 
5525
- var spliceList = function spliceList(list) {
5526
- return list.splice.apply(list, _toConsumableArray(_arguments));
5527
- };
5528
5470
 
5529
- this.alterList(spliceList);
5530
- },
5531
- updatePosition: function updatePosition(oldIndex, newIndex) {
5532
- var updatePosition = function updatePosition(list) {
5533
- return list.splice(newIndex, 0, list.splice(oldIndex, 1)[0]);
5534
- };
5535
5471
 
5536
- this.alterList(updatePosition);
5537
- },
5538
- getRelatedContextFromMoveEvent: function getRelatedContextFromMoveEvent(_ref2) {
5539
- var to = _ref2.to,
5540
- related = _ref2.related;
5541
- var component = this.getUnderlyingPotencialDraggableComponent(to);
5542
5472
 
5543
- if (!component) {
5544
- return {
5545
- component: component
5546
- };
5547
- }
5548
5473
 
5549
- var list = component.realList;
5550
- var context = {
5551
- list: list,
5552
- component: component
5553
- };
5554
5474
 
5555
- if (to !== related && list && component.getUnderlyingVm) {
5556
- var destination = component.getUnderlyingVm(related);
5557
5475
 
5558
- if (destination) {
5559
- return Object.assign(destination, context);
5560
- }
5561
- }
5562
5476
 
5563
- return context;
5564
- },
5565
- getVmIndex: function getVmIndex(domIndex) {
5566
- var indexes = this.visibleIndexes;
5567
- var numberIndexes = indexes.length;
5568
- return domIndex > numberIndexes - 1 ? numberIndexes : indexes[domIndex];
5569
- },
5570
- getComponent: function getComponent() {
5571
- return this.$slots.default[0].componentInstance;
5572
- },
5573
- resetTransitionData: function resetTransitionData(index) {
5574
- if (!this.noTransitionOnDrag || !this.transitionMode) {
5575
- return;
5576
- }
5577
5477
 
5578
- var nodes = this.getChildrenNodes();
5579
- nodes[index].data = null;
5580
- var transitionContainer = this.getComponent();
5581
- transitionContainer.children = [];
5582
- transitionContainer.kept = undefined;
5583
- },
5584
- onDragStart: function onDragStart(evt) {
5585
- this.context = this.getUnderlyingVm(evt.item);
5586
- evt.item._underlying_vm_ = this.clone(this.context.element);
5587
- draggingElement = evt.item;
5588
- },
5589
- onDragAdd: function onDragAdd(evt) {
5590
- var element = evt.item._underlying_vm_;
5591
5478
 
5592
- if (element === undefined) {
5593
- return;
5594
- }
5595
5479
 
5596
- Object(helper["d" /* removeNode */])(evt.item);
5597
- var newIndex = this.getVmIndex(evt.newIndex);
5598
- this.spliceList(newIndex, 0, element);
5599
- this.computeIndexes();
5600
- var added = {
5601
- element: element,
5602
- newIndex: newIndex
5603
- };
5604
- this.emitChanges({
5605
- added: added
5606
- });
5607
- },
5608
- onDragRemove: function onDragRemove(evt) {
5609
- Object(helper["c" /* insertNodeAt */])(this.rootContainer, evt.item, evt.oldIndex);
5480
+ function buildAttribute(object, propName, value) {
5481
+ if (value === undefined) {
5482
+ return object;
5483
+ }
5484
+
5485
+ object = object || {};
5486
+ object[propName] = value;
5487
+ return object;
5488
+ }
5489
+
5490
+ function computeVmIndex(vnodes, element) {
5491
+ return vnodes.map(function (elt) {
5492
+ return elt.elm;
5493
+ }).indexOf(element);
5494
+ }
5495
+
5496
+ function _computeIndexes(slots, children, isTransition, footerOffset) {
5497
+ if (!slots) {
5498
+ return [];
5499
+ }
5610
5500
 
5611
- if (evt.pullMode === "clone") {
5612
- Object(helper["d" /* removeNode */])(evt.clone);
5613
- return;
5614
- }
5501
+ var elmFromNodes = slots.map(function (elt) {
5502
+ return elt.elm;
5503
+ });
5504
+ var footerIndex = children.length - footerOffset;
5615
5505
 
5616
- var oldIndex = this.context.index;
5617
- this.spliceList(oldIndex, 1);
5618
- var removed = {
5619
- element: this.context.element,
5620
- oldIndex: oldIndex
5621
- };
5622
- this.resetTransitionData(oldIndex);
5623
- this.emitChanges({
5624
- removed: removed
5625
- });
5626
- },
5627
- onDragUpdate: function onDragUpdate(evt) {
5628
- Object(helper["d" /* removeNode */])(evt.item);
5629
- Object(helper["c" /* insertNodeAt */])(evt.from, evt.item, evt.oldIndex);
5630
- var oldIndex = this.context.index;
5631
- var newIndex = this.getVmIndex(evt.newIndex);
5632
- this.updatePosition(oldIndex, newIndex);
5633
- var moved = {
5634
- element: this.context.element,
5635
- oldIndex: oldIndex,
5636
- newIndex: newIndex
5637
- };
5638
- this.emitChanges({
5639
- moved: moved
5640
- });
5641
- },
5642
- updateProperty: function updateProperty(evt, propertyName) {
5643
- evt.hasOwnProperty(propertyName) && (evt[propertyName] += this.headerOffset);
5644
- },
5645
- computeFutureIndex: function computeFutureIndex(relatedContext, evt) {
5646
- if (!relatedContext.element) {
5647
- return 0;
5648
- }
5506
+ var rawIndexes = _toConsumableArray(children).map(function (elt, idx) {
5507
+ return idx >= footerIndex ? elmFromNodes.length : elmFromNodes.indexOf(elt);
5508
+ });
5649
5509
 
5650
- var domChildren = _toConsumableArray(evt.to.children).filter(function (el) {
5651
- return el.style["display"] !== "none";
5652
- });
5510
+ return isTransition ? rawIndexes.filter(function (ind) {
5511
+ return ind !== -1;
5512
+ }) : rawIndexes;
5513
+ }
5653
5514
 
5654
- var currentDOMIndex = domChildren.indexOf(evt.related);
5655
- var currentIndex = relatedContext.component.getVmIndex(currentDOMIndex);
5656
- var draggedInList = domChildren.indexOf(draggingElement) !== -1;
5657
- return draggedInList || !evt.willInsertAfter ? currentIndex : currentIndex + 1;
5658
- },
5659
- onDragMove: function onDragMove(evt, originalEvent) {
5660
- var onMove = this.move;
5515
+ function emit(evtName, evtData) {
5516
+ var _this = this;
5661
5517
 
5662
- if (!onMove || !this.realList) {
5663
- return true;
5664
- }
5518
+ this.$nextTick(function () {
5519
+ return _this.$emit(evtName.toLowerCase(), evtData);
5520
+ });
5521
+ }
5665
5522
 
5666
- var relatedContext = this.getRelatedContextFromMoveEvent(evt);
5667
- var draggedContext = this.context;
5668
- var futureIndex = this.computeFutureIndex(relatedContext, evt);
5669
- Object.assign(draggedContext, {
5670
- futureIndex: futureIndex
5671
- });
5672
- var sendEvt = Object.assign({}, evt, {
5673
- relatedContext: relatedContext,
5674
- draggedContext: draggedContext
5675
- });
5676
- return onMove(sendEvt, originalEvent);
5677
- },
5678
- onDragEnd: function onDragEnd() {
5679
- this.computeIndexes();
5680
- draggingElement = null;
5523
+ function delegateAndEmit(evtName) {
5524
+ var _this2 = this;
5525
+
5526
+ return function (evtData) {
5527
+ if (_this2.realList !== null) {
5528
+ _this2["onDrag" + evtName](evtData);
5681
5529
  }
5682
- }
5683
- };
5684
5530
 
5685
- if (typeof window !== "undefined" && "Vue" in window) {
5686
- window.Vue.component("draggable", draggableComponent);
5531
+ emit.call(_this2, evtName, evtData);
5532
+ };
5687
5533
  }
5688
5534
 
5689
- /* harmony default export */ var vuedraggable = (draggableComponent);
5690
- // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
5535
+ function isTransitionName(name) {
5536
+ return ["transition-group", "TransitionGroup"].includes(name);
5537
+ }
5538
+
5539
+ function vuedraggable_isTransition(slots) {
5540
+ if (!slots || slots.length !== 1) {
5541
+ return false;
5542
+ }
5691
5543
 
5544
+ var _slots = _slicedToArray(slots, 1),
5545
+ componentOptions = _slots[0].componentOptions;
5692
5546
 
5693
- /* harmony default export */ __webpack_exports__["default"] = (vuedraggable);
5547
+ if (!componentOptions) {
5548
+ return false;
5549
+ }
5694
5550
 
5551
+ return isTransitionName(componentOptions.tag);
5552
+ }
5695
5553
 
5554
+ function getSlot(slot, scopedSlot, key) {
5555
+ return slot[key] || (scopedSlot[key] ? scopedSlot[key]() : undefined);
5556
+ }
5696
5557
 
5697
- /***/ })
5558
+ function computeChildrenAndOffsets(children, slot, scopedSlot) {
5559
+ var headerOffset = 0;
5560
+ var footerOffset = 0;
5561
+ var header = getSlot(slot, scopedSlot, "header");
5698
5562
 
5699
- /******/ })["default"];
5700
- });
5563
+ if (header) {
5564
+ headerOffset = header.length;
5565
+ children = children ? [].concat(_toConsumableArray(header), _toConsumableArray(children)) : _toConsumableArray(header);
5566
+ }
5701
5567
 
5702
- });
5568
+ var footer = getSlot(slot, scopedSlot, "footer");
5703
5569
 
5704
- let __clone = function (data) {
5705
- return JSON.parse(JSON.stringify(data));
5706
- };
5570
+ if (footer) {
5571
+ footerOffset = footer.length;
5572
+ children = children ? [].concat(_toConsumableArray(children), _toConsumableArray(footer)) : _toConsumableArray(footer);
5573
+ }
5707
5574
 
5708
- let __assign = function () {
5709
- __assign = Object.assign || function __assign(t) {
5710
- for (let s, i = 1, n = arguments.length; i < n; i++) {
5711
- s = arguments[i];
5575
+ return {
5576
+ children: children,
5577
+ headerOffset: headerOffset,
5578
+ footerOffset: footerOffset
5579
+ };
5580
+ }
5712
5581
 
5713
- for (let p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
5714
- }
5582
+ function getComponentAttributes($attrs, componentData) {
5583
+ var attributes = null;
5715
5584
 
5716
- return t;
5585
+ var update = function update(name, value) {
5586
+ attributes = buildAttribute(attributes, name, value);
5717
5587
  };
5718
5588
 
5719
- return __assign.apply(this, arguments);
5589
+ var attrs = Object.keys($attrs).filter(function (key) {
5590
+ return key === "id" || key.startsWith("data-");
5591
+ }).reduce(function (res, key) {
5592
+ res[key] = $attrs[key];
5593
+ return res;
5594
+ }, {});
5595
+ update("attrs", attrs);
5596
+
5597
+ if (!componentData) {
5598
+ return attributes;
5599
+ }
5600
+
5601
+ var on = componentData.on,
5602
+ props = componentData.props,
5603
+ componentDataAttrs = componentData.attrs;
5604
+ update("on", on);
5605
+ update("props", props);
5606
+ Object.assign(attributes.attrs, componentDataAttrs);
5607
+ return attributes;
5608
+ }
5609
+
5610
+ var eventsListened = ["Start", "Add", "Remove", "Update", "End"];
5611
+ var eventsToEmit = ["Choose", "Unchoose", "Sort", "Filter", "Clone"];
5612
+ var readonlyProperties = ["Move"].concat(eventsListened, eventsToEmit).map(function (evt) {
5613
+ return "on" + evt;
5614
+ });
5615
+ var draggingElement = null;
5616
+ var props = {
5617
+ options: Object,
5618
+ list: {
5619
+ type: Array,
5620
+ required: false,
5621
+ default: null
5622
+ },
5623
+ value: {
5624
+ type: Array,
5625
+ required: false,
5626
+ default: null
5627
+ },
5628
+ noTransitionOnDrag: {
5629
+ type: Boolean,
5630
+ default: false
5631
+ },
5632
+ clone: {
5633
+ type: Function,
5634
+ default: function _default(original) {
5635
+ return original;
5636
+ }
5637
+ },
5638
+ element: {
5639
+ type: String,
5640
+ default: "div"
5641
+ },
5642
+ tag: {
5643
+ type: String,
5644
+ default: null
5645
+ },
5646
+ move: {
5647
+ type: Function,
5648
+ default: null
5649
+ },
5650
+ componentData: {
5651
+ type: Object,
5652
+ required: false,
5653
+ default: null
5654
+ }
5720
5655
  };
5656
+ var draggableComponent = {
5657
+ name: "draggable",
5658
+ inheritAttrs: false,
5659
+ props: props,
5660
+ data: function data() {
5661
+ return {
5662
+ transitionMode: false,
5663
+ noneFunctionalComponentMode: false
5664
+ };
5665
+ },
5666
+ render: function render(h) {
5667
+ var slots = this.$slots.default;
5668
+ this.transitionMode = vuedraggable_isTransition(slots);
5721
5669
 
5722
- let __mergeInputInMapOfArrays = function (inputs, formConfigInputs) {
5723
- for (let dataType in formConfigInputs) {
5724
- let foundInputs = inputs[dataType];
5670
+ var _computeChildrenAndOf = computeChildrenAndOffsets(slots, this.$slots, this.$scopedSlots),
5671
+ children = _computeChildrenAndOf.children,
5672
+ headerOffset = _computeChildrenAndOf.headerOffset,
5673
+ footerOffset = _computeChildrenAndOf.footerOffset;
5725
5674
 
5726
- if (foundInputs) {
5727
- __mergeInputsInArray(foundInputs, formConfigInputs[dataType]);
5728
- } else {
5729
- inputs[dataType] = formConfigInputs[dataType];
5675
+ this.headerOffset = headerOffset;
5676
+ this.footerOffset = footerOffset;
5677
+ var attributes = getComponentAttributes(this.$attrs, this.componentData);
5678
+ return h(this.getTag(), attributes, children);
5679
+ },
5680
+ created: function created() {
5681
+ if (this.list !== null && this.value !== null) {
5682
+ helper["b" /* console */].error("Value and list props are mutually exclusive! Please set one or another.");
5730
5683
  }
5731
- }
5732
- };
5733
-
5734
- let __mergeInputsInMap = function (inputs, formConfigInputs) {
5735
- for (let name in formConfigInputs) {
5736
- inputs[name] = __assign(inputs[name] ? inputs[name] : {}, formConfigInputs[name] ? formConfigInputs[name] : {});
5737
- }
5738
- };
5739
5684
 
5740
- let __mergeInputsInArray = function (inputs, formConfigInputs) {
5741
- formConfigInputs.forEach(input => {
5742
- let index = inputs.findIndex(item => item.name === input.name);
5685
+ if (this.element !== "div") {
5686
+ helper["b" /* console */].warn("Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props");
5687
+ }
5743
5688
 
5744
- if (index >= 0) {
5745
- inputs[index] = input;
5746
- } else {
5747
- inputs.push(input);
5689
+ if (this.options !== undefined) {
5690
+ helper["b" /* console */].warn("Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props");
5748
5691
  }
5749
- });
5750
- };
5692
+ },
5693
+ mounted: function mounted() {
5694
+ var _this3 = this;
5751
5695
 
5752
- let __applyDefaultProps = function (input) {
5753
- for (let propName in input.props) {
5754
- input.propsData[propName] = input.props[propName].default;
5755
- }
5756
- };
5696
+ this.noneFunctionalComponentMode = this.getTag().toLowerCase() !== this.$el.nodeName.toLowerCase() && !this.getIsFunctional();
5757
5697
 
5758
- let __applyRefProps = function (input, refConfig) {
5759
- if (refConfig !== null && refConfig !== void 0 && refConfig.propsData) {
5760
- for (let propName in refConfig.propsData) {
5761
- input.propsData[propName] = refConfig.propsData[propName];
5698
+ if (this.noneFunctionalComponentMode && this.transitionMode) {
5699
+ throw new Error("Transition-group inside component is not supported. Please alter tag value or remove transition-group. Current tag value: ".concat(this.getTag()));
5762
5700
  }
5763
- }
5764
- };
5765
5701
 
5766
- let fcInputs = {
5767
- text: {
5768
- text: 'Текст',
5769
- name: 'text',
5770
- type: 'b-form-input',
5771
- props: {
5772
- placeholder: {
5773
- type: 'string',
5774
- default: null,
5775
- label: 'Надпись внутри',
5776
- visible: true
5777
- },
5778
- type: {
5779
- type: 'string',
5780
- default: 'text',
5781
- label: 'Тип данных',
5782
- visible: false
5702
+ var optionsAdded = {};
5703
+ eventsListened.forEach(function (elt) {
5704
+ optionsAdded["on" + elt] = delegateAndEmit.call(_this3, elt);
5705
+ });
5706
+ eventsToEmit.forEach(function (elt) {
5707
+ optionsAdded["on" + elt] = emit.bind(_this3, elt);
5708
+ });
5709
+ var attributes = Object.keys(this.$attrs).reduce(function (res, key) {
5710
+ res[Object(helper["a" /* camelize */])(key)] = _this3.$attrs[key];
5711
+ return res;
5712
+ }, {});
5713
+ var options = Object.assign({}, this.options, attributes, optionsAdded, {
5714
+ onMove: function onMove(evt, originalEvent) {
5715
+ return _this3.onDragMove(evt, originalEvent);
5783
5716
  }
5717
+ });
5718
+ !("draggable" in options) && (options.draggable = ">*");
5719
+ this._sortable = new external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_default.a(this.rootContainer, options);
5720
+ this.computeIndexes();
5721
+ },
5722
+ beforeDestroy: function beforeDestroy() {
5723
+ if (this._sortable !== undefined) this._sortable.destroy();
5724
+ },
5725
+ computed: {
5726
+ rootContainer: function rootContainer() {
5727
+ return this.transitionMode ? this.$el.children[0] : this.$el;
5784
5728
  },
5785
- propsData: {},
5786
- defaultValue: null
5729
+ realList: function realList() {
5730
+ return this.list ? this.list : this.value;
5731
+ }
5787
5732
  },
5788
- number: {
5789
- text: 'Число',
5790
- name: 'number',
5791
- type: 'b-form-input',
5792
- props: {
5793
- placeholder: {
5794
- type: 'string',
5795
- default: null,
5796
- label: 'Надпись внутри',
5797
- visible: true
5733
+ watch: {
5734
+ options: {
5735
+ handler: function handler(newOptionValue) {
5736
+ this.updateOptions(newOptionValue);
5798
5737
  },
5799
- type: {
5800
- type: 'string',
5801
- default: 'number',
5802
- label: 'Тип данных',
5803
- visible: false
5804
- }
5738
+ deep: true
5805
5739
  },
5806
- propsData: {},
5807
- defaultValue: null
5740
+ $attrs: {
5741
+ handler: function handler(newOptionValue) {
5742
+ this.updateOptions(newOptionValue);
5743
+ },
5744
+ deep: true
5745
+ },
5746
+ realList: function realList() {
5747
+ this.computeIndexes();
5748
+ }
5808
5749
  },
5809
- memo: {
5810
- text: 'Большой текст',
5811
- name: 'memo',
5812
- type: 'b-form-textarea',
5813
- props: {
5814
- placeholder: {
5815
- type: 'string',
5816
- default: null,
5817
- label: 'Надпись внутри',
5818
- visible: true
5750
+ methods: {
5751
+ getIsFunctional: function getIsFunctional() {
5752
+ var fnOptions = this._vnode.fnOptions;
5753
+ return fnOptions && fnOptions.functional;
5754
+ },
5755
+ getTag: function getTag() {
5756
+ return this.tag || this.element;
5757
+ },
5758
+ updateOptions: function updateOptions(newOptionValue) {
5759
+ for (var property in newOptionValue) {
5760
+ var value = Object(helper["a" /* camelize */])(property);
5761
+
5762
+ if (readonlyProperties.indexOf(value) === -1) {
5763
+ this._sortable.option(value, newOptionValue[property]);
5764
+ }
5819
5765
  }
5820
5766
  },
5821
- propsData: {},
5822
- defaultValue: null
5823
- },
5824
- date: {
5825
- text: 'Дата',
5826
- name: 'date',
5827
- type: 'rb-date-picker-input',
5828
- props: {},
5829
- propsData: {},
5830
- defaultValue: null
5831
- },
5832
- phone: {
5833
- text: 'Телефон',
5834
- name: 'phone',
5835
- type: 'rb-phone-input',
5836
- props: {
5837
- placeholder: {
5838
- type: 'string',
5839
- default: 'Телефон',
5840
- label: 'Надпись внутри',
5841
- visible: true
5767
+ getChildrenNodes: function getChildrenNodes() {
5768
+ if (this.noneFunctionalComponentMode) {
5769
+ return this.$children[0].$slots.default;
5842
5770
  }
5771
+
5772
+ var rawNodes = this.$slots.default;
5773
+ return this.transitionMode ? rawNodes[0].child.$slots.default : rawNodes;
5843
5774
  },
5844
- propsData: {},
5845
- defaultValue: null
5846
- }
5847
- };
5848
- let fcPrimitiveInputs = {
5849
- text: [__clone(fcInputs.text), __clone(fcInputs.number), __clone(fcInputs.memo), __clone(fcInputs.phone)],
5850
- memo: [__clone(fcInputs.memo), __clone(fcInputs.text)],
5851
- number: [__clone(fcInputs.text), __clone(fcInputs.number)],
5852
- date: [__clone(fcInputs.date)]
5853
- };
5854
- let fcDictInputs = [];
5855
- let fcRefInputs = {};
5856
- let fcRefInputConfigs = {};
5857
- let baseConfig = {
5858
- inputs: __clone(fcInputs),
5859
- primitiveInputs: __clone(fcPrimitiveInputs),
5860
- dictInputs: __clone(fcDictInputs),
5861
- refInputs: __clone(fcRefInputs),
5862
- refInputConfigs: __clone(fcRefInputConfigs),
5863
- rules: [],
5864
- icons: {
5865
- iconExpandFacet: 'icon-chevron-up',
5866
- iconCollapseFacet: 'icon-chevron-down',
5867
- iconCloseFieldSidebar: 'icon-chevron-right',
5868
- iconOpenFieldSidebar: 'icon-chevron-left',
5869
- iconAdd: 'icon-add',
5870
- iconEdit: 'icon-edit',
5871
- iconDelete: 'icon-delete',
5872
- iconDrag: 'icon-reorder'
5873
- },
5874
- ruleContext: {}
5875
- };
5876
- const UtFormConstructor = {
5877
- config: {},
5775
+ computeIndexes: function computeIndexes() {
5776
+ var _this4 = this;
5878
5777
 
5879
- init(formConfig) {
5880
- this.config = __clone(baseConfig);
5778
+ this.$nextTick(function () {
5779
+ _this4.visibleIndexes = _computeIndexes(_this4.getChildrenNodes(), _this4.rootContainer.children, _this4.transitionMode, _this4.footerOffset);
5780
+ });
5781
+ },
5782
+ getUnderlyingVm: function getUnderlyingVm(htmlElt) {
5783
+ var index = computeVmIndex(this.getChildrenNodes() || [], htmlElt);
5881
5784
 
5882
- if (formConfig) {
5883
- if (formConfig.inputs) {
5884
- __mergeInputsInMap(this.config.inputs, formConfig.inputs);
5785
+ if (index === -1) {
5786
+ //Edge case during move callback: related element might be
5787
+ //an element different from collection
5788
+ return null;
5885
5789
  }
5886
5790
 
5887
- if (formConfig.primitiveInputs) {
5888
- __mergeInputInMapOfArrays(this.config.primitiveInputs, formConfig.primitiveInputs);
5791
+ var element = this.realList[index];
5792
+ return {
5793
+ index: index,
5794
+ element: element
5795
+ };
5796
+ },
5797
+ getUnderlyingPotencialDraggableComponent: function getUnderlyingPotencialDraggableComponent(_ref) {
5798
+ var vue = _ref.__vue__;
5799
+
5800
+ if (!vue || !vue.$options || !isTransitionName(vue.$options._componentTag)) {
5801
+ if (!("realList" in vue) && vue.$children.length === 1 && "realList" in vue.$children[0]) return vue.$children[0];
5802
+ return vue;
5889
5803
  }
5890
5804
 
5891
- if (formConfig.dictInputs) {
5892
- __mergeInputsInArray(this.config.dictInputs, formConfig.dictInputs);
5893
- }
5805
+ return vue.$parent;
5806
+ },
5807
+ emitChanges: function emitChanges(evt) {
5808
+ var _this5 = this;
5894
5809
 
5895
- if (formConfig.refInputs) {
5896
- __mergeInputInMapOfArrays(this.config.refInputs, formConfig.refInputs);
5810
+ this.$nextTick(function () {
5811
+ _this5.$emit("change", evt);
5812
+ });
5813
+ },
5814
+ alterList: function alterList(onList) {
5815
+ if (this.list) {
5816
+ onList(this.list);
5817
+ return;
5897
5818
  }
5898
5819
 
5899
- if (formConfig.refInputConfigs) {
5900
- this.config.refInputConfigs = formConfig.refInputConfigs;
5901
- }
5820
+ var newList = _toConsumableArray(this.value);
5902
5821
 
5903
- if (formConfig.icons) {
5904
- this.config.icons = __assign(this.config.icons, formConfig.icons);
5905
- }
5822
+ onList(newList);
5823
+ this.$emit("input", newList);
5824
+ },
5825
+ spliceList: function spliceList() {
5826
+ var _arguments = arguments;
5906
5827
 
5907
- if (formConfig.rules) {
5908
- this.config.rules = formConfig.rules;
5909
- }
5828
+ var spliceList = function spliceList(list) {
5829
+ return list.splice.apply(list, _toConsumableArray(_arguments));
5830
+ };
5910
5831
 
5911
- if (formConfig.ruleContext) {
5912
- this.config.ruleContext = formConfig.ruleContext;
5913
- }
5914
- }
5915
- },
5832
+ this.alterList(spliceList);
5833
+ },
5834
+ updatePosition: function updatePosition(oldIndex, newIndex) {
5835
+ var updatePosition = function updatePosition(list) {
5836
+ return list.splice(newIndex, 0, list.splice(oldIndex, 1)[0]);
5837
+ };
5916
5838
 
5917
- getInputTypes(field) {
5918
- if (!field) {
5919
- return [];
5920
- }
5839
+ this.alterList(updatePosition);
5840
+ },
5841
+ getRelatedContextFromMoveEvent: function getRelatedContextFromMoveEvent(_ref2) {
5842
+ var to = _ref2.to,
5843
+ related = _ref2.related;
5844
+ var component = this.getUnderlyingPotencialDraggableComponent(to);
5921
5845
 
5922
- if (field.dict && !this.config.refInputs[field.ref]) {
5923
- return this.config.dictInputs;
5924
- }
5846
+ if (!component) {
5847
+ return {
5848
+ component: component
5849
+ };
5850
+ }
5925
5851
 
5926
- if (field.ref) {
5927
- return this.config.refInputs[field.ref];
5928
- }
5852
+ var list = component.realList;
5853
+ var context = {
5854
+ list: list,
5855
+ component: component
5856
+ };
5929
5857
 
5930
- return this.config.primitiveInputs[field.type];
5931
- },
5858
+ if (to !== related && list && component.getUnderlyingVm) {
5859
+ var destination = component.getUnderlyingVm(related);
5932
5860
 
5933
- getDefaultInput(field) {
5934
- let input = null;
5861
+ if (destination) {
5862
+ return Object.assign(destination, context);
5863
+ }
5864
+ }
5935
5865
 
5936
- if (field.ref && this.config.refInputs[field.ref]) {
5937
- input = __clone(this.config.refInputs[field.ref][0]);
5866
+ return context;
5867
+ },
5868
+ getVmIndex: function getVmIndex(domIndex) {
5869
+ var indexes = this.visibleIndexes;
5870
+ var numberIndexes = indexes.length;
5871
+ return domIndex > numberIndexes - 1 ? numberIndexes : indexes[domIndex];
5872
+ },
5873
+ getComponent: function getComponent() {
5874
+ return this.$slots.default[0].componentInstance;
5875
+ },
5876
+ resetTransitionData: function resetTransitionData(index) {
5877
+ if (!this.noTransitionOnDrag || !this.transitionMode) {
5878
+ return;
5879
+ }
5938
5880
 
5939
- __applyDefaultProps(input);
5881
+ var nodes = this.getChildrenNodes();
5882
+ nodes[index].data = null;
5883
+ var transitionContainer = this.getComponent();
5884
+ transitionContainer.children = [];
5885
+ transitionContainer.kept = undefined;
5886
+ },
5887
+ onDragStart: function onDragStart(evt) {
5888
+ this.context = this.getUnderlyingVm(evt.item);
5889
+ evt.item._underlying_vm_ = this.clone(this.context.element);
5890
+ draggingElement = evt.item;
5891
+ },
5892
+ onDragAdd: function onDragAdd(evt) {
5893
+ var element = evt.item._underlying_vm_;
5940
5894
 
5941
- if (this.config.refInputConfigs[field.ref] && this.config.refInputConfigs[field.ref][input.name]) {
5942
- __applyRefProps(input, this.config.refInputConfigs[field.ref][input.name]);
5895
+ if (element === undefined) {
5896
+ return;
5943
5897
  }
5944
- } else if (field.dict) {
5945
- input = __clone(this.config.dictInputs[0]);
5946
- input.props.dict.default = field.ref;
5947
5898
 
5948
- __applyDefaultProps(input);
5949
- } else {
5950
- input = __clone(this.config.primitiveInputs[field.type][0]);
5899
+ Object(helper["d" /* removeNode */])(evt.item);
5900
+ var newIndex = this.getVmIndex(evt.newIndex);
5901
+ this.spliceList(newIndex, 0, element);
5902
+ this.computeIndexes();
5903
+ var added = {
5904
+ element: element,
5905
+ newIndex: newIndex
5906
+ };
5907
+ this.emitChanges({
5908
+ added: added
5909
+ });
5910
+ },
5911
+ onDragRemove: function onDragRemove(evt) {
5912
+ Object(helper["c" /* insertNodeAt */])(this.rootContainer, evt.item, evt.oldIndex);
5951
5913
 
5952
- __applyDefaultProps(input);
5953
- }
5914
+ if (evt.pullMode === "clone") {
5915
+ Object(helper["d" /* removeNode */])(evt.clone);
5916
+ return;
5917
+ }
5954
5918
 
5955
- return input;
5956
- },
5919
+ var oldIndex = this.context.index;
5920
+ this.spliceList(oldIndex, 1);
5921
+ var removed = {
5922
+ element: this.context.element,
5923
+ oldIndex: oldIndex
5924
+ };
5925
+ this.resetTransitionData(oldIndex);
5926
+ this.emitChanges({
5927
+ removed: removed
5928
+ });
5929
+ },
5930
+ onDragUpdate: function onDragUpdate(evt) {
5931
+ Object(helper["d" /* removeNode */])(evt.item);
5932
+ Object(helper["c" /* insertNodeAt */])(evt.from, evt.item, evt.oldIndex);
5933
+ var oldIndex = this.context.index;
5934
+ var newIndex = this.getVmIndex(evt.newIndex);
5935
+ this.updatePosition(oldIndex, newIndex);
5936
+ var moved = {
5937
+ element: this.context.element,
5938
+ oldIndex: oldIndex,
5939
+ newIndex: newIndex
5940
+ };
5941
+ this.emitChanges({
5942
+ moved: moved
5943
+ });
5944
+ },
5945
+ updateProperty: function updateProperty(evt, propertyName) {
5946
+ evt.hasOwnProperty(propertyName) && (evt[propertyName] += this.headerOffset);
5947
+ },
5948
+ computeFutureIndex: function computeFutureIndex(relatedContext, evt) {
5949
+ if (!relatedContext.element) {
5950
+ return 0;
5951
+ }
5957
5952
 
5958
- getInputTypeByName(name, field) {
5959
- let input = JSON.parse(JSON.stringify(this.config.inputs[name]));
5953
+ var domChildren = _toConsumableArray(evt.to.children).filter(function (el) {
5954
+ return el.style["display"] !== "none";
5955
+ });
5960
5956
 
5961
- if (field.ref && this.config.refInputs[field.ref]) {
5962
- __applyDefaultProps(input);
5957
+ var currentDOMIndex = domChildren.indexOf(evt.related);
5958
+ var currentIndex = relatedContext.component.getVmIndex(currentDOMIndex);
5959
+ var draggedInList = domChildren.indexOf(draggingElement) !== -1;
5960
+ return draggedInList || !evt.willInsertAfter ? currentIndex : currentIndex + 1;
5961
+ },
5962
+ onDragMove: function onDragMove(evt, originalEvent) {
5963
+ var onMove = this.move;
5963
5964
 
5964
- if (this.config.refInputConfigs[field.ref] && this.config.refInputConfigs[field.ref][input.name]) {
5965
- __applyRefProps(input, this.config.refInputConfigs[field.ref][input.name]);
5965
+ if (!onMove || !this.realList) {
5966
+ return true;
5966
5967
  }
5967
- } else if (field.dict) {
5968
- input.props.dict.default = field.ref;
5969
5968
 
5970
- __applyDefaultProps(input);
5971
- } else {
5972
- __applyDefaultProps(input);
5969
+ var relatedContext = this.getRelatedContextFromMoveEvent(evt);
5970
+ var draggedContext = this.context;
5971
+ var futureIndex = this.computeFutureIndex(relatedContext, evt);
5972
+ Object.assign(draggedContext, {
5973
+ futureIndex: futureIndex
5974
+ });
5975
+ var sendEvt = Object.assign({}, evt, {
5976
+ relatedContext: relatedContext,
5977
+ draggedContext: draggedContext
5978
+ });
5979
+ return onMove(sendEvt, originalEvent);
5980
+ },
5981
+ onDragEnd: function onDragEnd() {
5982
+ this.computeIndexes();
5983
+ draggingElement = null;
5973
5984
  }
5985
+ }
5986
+ };
5974
5987
 
5975
- input.propsData['ref'] = field.name;
5976
- return input;
5977
- },
5988
+ if (typeof window !== "undefined" && "Vue" in window) {
5989
+ window.Vue.component("draggable", draggableComponent);
5990
+ }
5978
5991
 
5979
- getAvailableFieldRules(field) {
5980
- return this.config.rules.filter(rule => {
5981
- return !rule.fields || rule.fields.length === 0 || rule.fields.indexOf(field.name) >= 0;
5982
- });
5983
- },
5992
+ /* harmony default export */ var vuedraggable = (draggableComponent);
5993
+ // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
5984
5994
 
5985
- getRuleContext() {
5986
- return this.config.ruleContext;
5987
- },
5988
5995
 
5989
- runRule(context, script) {
5990
- let appendScript = `
5991
- var doc = this.form.doc;
5992
- var form = this.form;
5993
- var event = this.event;
5994
- var eventName = this.eventName;
5995
-
5996
- `;
5996
+ /* harmony default export */ __webpack_exports__["default"] = (vuedraggable);
5997
5997
 
5998
- let func = function (script) {
5999
- return eval(script);
6000
- };
6001
5998
 
6002
- func.call(context, appendScript + script);
6003
- }
6004
5999
 
6005
- };
6000
+ /***/ })
6001
+
6002
+ /******/ })["default"];
6003
+ });
6004
+
6005
+ });
6006
6006
 
6007
6007
  //
6008
6008
  var script$4 = {
@@ -7744,6 +7744,7 @@ var DocForm = __vue_component__;
7744
7744
  var components = /*#__PURE__*/Object.freeze({
7745
7745
  __proto__: null,
7746
7746
  UtFormConfig: UtFormConfig,
7747
+ UtFormConstructor: UtFormConstructor,
7747
7748
  DocTemplateSectionModal: DocTemplateSectionModal,
7748
7749
  DocTemplateFacetList: DocTemplateFacetList,
7749
7750
  DocTemplateFieldSidebar: DocTemplateFieldSidebar,
@@ -7760,4 +7761,4 @@ const install = function installRbDocumentFormConstructor(Vue) {
7760
7761
  });
7761
7762
  }; // Create module definition for Vue.use()
7762
7763
 
7763
- export { DocForm, __vue_component__$2 as DocTemplateConstructor, DocTemplateFacetList, DocTemplateFieldSidebar, DocTemplateSectionModal, UtFormConfig, install as default };
7764
+ export { DocForm, __vue_component__$2 as DocTemplateConstructor, DocTemplateFacetList, DocTemplateFieldSidebar, DocTemplateSectionModal, UtFormConfig, UtFormConstructor, install as default };