@tripup-company/element-ui-extended 0.0.112 → 0.0.113

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.
@@ -152,6 +152,293 @@ exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDes
152
152
  };
153
153
 
154
154
 
155
+ /***/ }),
156
+
157
+ /***/ "0713":
158
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
159
+
160
+ "use strict";
161
+ /* WEBPACK VAR INJECTION */(function(__webpack_provided_window_dot_jQuery) {/* harmony import */ var _tinymce_tinymce_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ca72");
162
+ /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("1157");
163
+ /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__);
164
+ /* harmony import */ var trumbowyg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("a01a");
165
+ /* harmony import */ var trumbowyg__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(trumbowyg__WEBPACK_IMPORTED_MODULE_2__);
166
+ /* harmony import */ var vue_trumbowyg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("6cf8");
167
+ /* harmony import */ var vue_trumbowyg__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(vue_trumbowyg__WEBPACK_IMPORTED_MODULE_3__);
168
+ /* harmony import */ var trumbowyg_dist_ui_trumbowyg_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("d6a2");
169
+ /* harmony import */ var trumbowyg_dist_ui_trumbowyg_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(trumbowyg_dist_ui_trumbowyg_css__WEBPACK_IMPORTED_MODULE_4__);
170
+ /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("2ef0");
171
+ /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_5__);
172
+
173
+
174
+
175
+
176
+
177
+
178
+ if (typeof window !== "undefined") {
179
+ window.$ = window.$ || jquery__WEBPACK_IMPORTED_MODULE_1___default.a;
180
+ __webpack_provided_window_dot_jQuery = __webpack_provided_window_dot_jQuery || jquery__WEBPACK_IMPORTED_MODULE_1___default.a;
181
+ }
182
+ const _ = lodash__WEBPACK_IMPORTED_MODULE_5___default.a;
183
+ /* harmony default export */ __webpack_exports__["a"] = ({
184
+ name: "EditableField",
185
+ components: {
186
+ Editor: _tinymce_tinymce_vue__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"],
187
+ VueTrumbowyg: (vue_trumbowyg__WEBPACK_IMPORTED_MODULE_3___default())
188
+ },
189
+ model: {
190
+ props: "value",
191
+ event: "input"
192
+ },
193
+ props: {
194
+ field: {
195
+ type: [String, Boolean],
196
+ default: ""
197
+ },
198
+ value: {
199
+ type: [String, Boolean, Date, Number, Array],
200
+ default: ""
201
+ },
202
+ filterable: {
203
+ type: Boolean,
204
+ default: false
205
+ },
206
+ type: {
207
+ type: String,
208
+ default: "input"
209
+ },
210
+ placeholder: {
211
+ type: String,
212
+ default: ""
213
+ },
214
+ selectList: {
215
+ type: Array,
216
+ default: () => []
217
+ },
218
+ rows: {
219
+ type: Number,
220
+ default: 3
221
+ },
222
+ height: {
223
+ type: String,
224
+ default: "102px"
225
+ },
226
+ selectMultiple: {
227
+ type: Boolean,
228
+ default: false
229
+ },
230
+ objectValueKey: {
231
+ type: String,
232
+ default: "value"
233
+ },
234
+ selectJson: {
235
+ type: Boolean,
236
+ default: false
237
+ },
238
+ selectKey: {
239
+ type: String,
240
+ default: "value"
241
+ },
242
+ selectLabel: {
243
+ type: String,
244
+ default: "name"
245
+ },
246
+ selectValue: {
247
+ type: String,
248
+ default: ""
249
+ },
250
+ precision: {
251
+ type: Number,
252
+ default: 0
253
+ },
254
+ step: {
255
+ type: Number,
256
+ default: 1
257
+ },
258
+ allowCreate: {
259
+ type: Boolean,
260
+ default: false
261
+ },
262
+ defaultFirstOption: {
263
+ type: Boolean,
264
+ default: false
265
+ },
266
+ remoteMethod: {
267
+ type: Object,
268
+ default: null
269
+ },
270
+ readonly: {
271
+ type: Boolean,
272
+ default: false
273
+ },
274
+ format: {
275
+ type: String,
276
+ default: "dd.MM.yyyy"
277
+ },
278
+ valueFormat: {
279
+ type: String,
280
+ default: "yyyy-MM-dd"
281
+ },
282
+ tinyApiKey: {
283
+ type: String,
284
+ default: ""
285
+ },
286
+ trumbowygConfig: {
287
+ type: Object,
288
+ default: () => ({
289
+ menubar: false,
290
+ force_br_newlines: true,
291
+ force_p_newlines: false,
292
+ forced_root_block: '',
293
+ plugins: ['lists'],
294
+ paste_preprocess: function (plugin, args) {
295
+ args.content = args.content.replace(/&lt;(?!p|\/p).*?&gt;|<[^>](?!p|\/p)*>/g, "").replace(/<\/?[^>](?!p|\/p)+(>|$)/g, "");
296
+ },
297
+ toolbar: 'bold italic | bullist numlist',
298
+ btns: [["strong", "em"], ["unorderedList", "orderedList"], ["link"], ["removeformat"]]
299
+ })
300
+ }
301
+ },
302
+ data() {
303
+ return {
304
+ isEditMode: false,
305
+ model: "",
306
+ selectListLocal: this.selectList,
307
+ trumbowygEditorKey: 0
308
+ };
309
+ },
310
+ computed: {
311
+ normalizedTrumbowygValue: {
312
+ get() {
313
+ return this.unwrapTrumbowygHtml(this.value);
314
+ }
315
+ },
316
+ isSelectValue: {
317
+ get() {
318
+ return (this.value || this.value === false) && this.type === "select";
319
+ }
320
+ },
321
+ remote: {
322
+ get() {
323
+ return this.remoteMethod !== null;
324
+ }
325
+ },
326
+ remoteMethodHandler: {
327
+ get() {
328
+ if (this.remoteMethod !== null) {
329
+ return this.remoteCall;
330
+ }
331
+ return null;
332
+ }
333
+ }
334
+ },
335
+ watch: {
336
+ selectList: function () {
337
+ this.selectListLocal = _.cloneDeep(this.selectList);
338
+ }
339
+ },
340
+ methods: {
341
+ unwrapTrumbowygHtml(rawValue) {
342
+ if (this.type !== "trumbowyg" || typeof rawValue !== "string") {
343
+ return rawValue;
344
+ }
345
+ const trimmedValue = rawValue.trim();
346
+ const wrappedTextareaMatch = trimmedValue.match(/^<textarea\b[^>]*>([\s\S]*)<\/textarea>$/i);
347
+ if (wrappedTextareaMatch) {
348
+ return wrappedTextareaMatch[1];
349
+ }
350
+ return rawValue;
351
+ },
352
+ focusTrumbowygEditor(event) {
353
+ const container = event && event.currentTarget ? event.currentTarget : null;
354
+ if (!container || !container.querySelector) {
355
+ return;
356
+ }
357
+ const editor = container.querySelector(".trumbowyg-editor");
358
+ if (editor && typeof editor.focus === "function") {
359
+ editor.focus();
360
+ }
361
+ },
362
+ createList() {
363
+ let label = "";
364
+ if (this.selectMultiple) {
365
+ if (this.value.length) {
366
+ let values = [];
367
+ this.value.forEach(element => {
368
+ console.log(element);
369
+ let compareValue = this.selectJson ? element[this.selectKey] : element;
370
+ if (!compareValue) {
371
+ compareValue = element;
372
+ }
373
+ const labArray = this.selectListLocal.find(x => x[this.selectKey] === compareValue);
374
+ if (labArray && labArray[this.selectLabel]) {
375
+ values.push(labArray[this.selectLabel]);
376
+ } else {
377
+ values.push(element);
378
+ }
379
+ label = values.join("; ");
380
+ });
381
+ } else {
382
+ label = "-";
383
+ }
384
+ } else if (this.selectListLocal.length) {
385
+ let obj = this.selectListLocal.find(x => x[this.selectKey] === this.value);
386
+ if (typeof obj != "undefined") {
387
+ label = obj[this.selectLabel];
388
+ } else {
389
+ console.log(this.value + " not found in " + this.selectListLocal.map(x => x[this.selectKey]));
390
+ }
391
+ } else {
392
+ label = this.value;
393
+ }
394
+ return label;
395
+ },
396
+ async handleDoubleClick() {
397
+ this.$emit("editable:open");
398
+ this.isEditMode = true;
399
+ this.model = this.unwrapTrumbowygHtml(this.value);
400
+ if (this.type === "trumbowyg") {
401
+ this.trumbowygEditorKey += 1;
402
+ }
403
+ },
404
+ handleClose() {
405
+ this.isEditMode = false;
406
+ this.model = this.unwrapTrumbowygHtml(this.value);
407
+ this.$emit("editable:close");
408
+ },
409
+ async remoteCall(query) {
410
+ if (!query.length) {
411
+ return;
412
+ }
413
+ this.loading = true;
414
+ const response = await this.remoteMethod.all({
415
+ search: this.selectLabel + ":" + query,
416
+ searchFields: this.selectLabel + ":like"
417
+ });
418
+ this.selectListLocal = response.data;
419
+ this.loading = false;
420
+ },
421
+ handleSave() {
422
+ this.isEditMode = false;
423
+ this.$emit("editable:close");
424
+ let emitValue = this.model;
425
+ emitValue = this.unwrapTrumbowygHtml(emitValue);
426
+ if (this.type === "number" && (emitValue === undefined || emitValue === "")) {
427
+ emitValue = null;
428
+ }
429
+ this.$emit("editable:save", {
430
+ field: this.field,
431
+ value: emitValue
432
+ });
433
+ this.$emit("update:value", {
434
+ field: this.field,
435
+ value: emitValue
436
+ });
437
+ }
438
+ }
439
+ });
440
+ /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("1157")))
441
+
155
442
  /***/ }),
156
443
 
157
444
  /***/ "07fa":
@@ -38894,7 +39181,7 @@ module.exports = DESCRIPTORS ? function (object, key, value) {
38894
39181
  /***/ "9224":
38895
39182
  /***/ (function(module) {
38896
39183
 
38897
- module.exports = JSON.parse("{\"a\":\"0.0.112\"}");
39184
+ module.exports = JSON.parse("{\"a\":\"0.0.113\"}");
38898
39185
 
38899
39186
  /***/ }),
38900
39187
 
@@ -41309,6 +41596,346 @@ try {
41309
41596
  module.exports = g;
41310
41597
 
41311
41598
 
41599
+ /***/ }),
41600
+
41601
+ /***/ "ca72":
41602
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
41603
+
41604
+ "use strict";
41605
+
41606
+ // CONCATENATED MODULE: ./node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/Utils.js
41607
+ /**
41608
+ * Copyright (c) 2018-present, Ephox, Inc.
41609
+ *
41610
+ * This source code is licensed under the Apache 2 license found in the
41611
+ * LICENSE file in the root directory of this source tree.
41612
+ *
41613
+ */
41614
+ var validEvents = [
41615
+ 'onActivate',
41616
+ 'onAddUndo',
41617
+ 'onBeforeAddUndo',
41618
+ 'onBeforeExecCommand',
41619
+ 'onBeforeGetContent',
41620
+ 'onBeforeRenderUI',
41621
+ 'onBeforeSetContent',
41622
+ 'onBeforePaste',
41623
+ 'onBlur',
41624
+ 'onChange',
41625
+ 'onClearUndos',
41626
+ 'onClick',
41627
+ 'onContextMenu',
41628
+ 'onCopy',
41629
+ 'onCut',
41630
+ 'onDblclick',
41631
+ 'onDeactivate',
41632
+ 'onDirty',
41633
+ 'onDrag',
41634
+ 'onDragDrop',
41635
+ 'onDragEnd',
41636
+ 'onDragGesture',
41637
+ 'onDragOver',
41638
+ 'onDrop',
41639
+ 'onExecCommand',
41640
+ 'onFocus',
41641
+ 'onFocusIn',
41642
+ 'onFocusOut',
41643
+ 'onGetContent',
41644
+ 'onHide',
41645
+ 'onInit',
41646
+ 'onKeyDown',
41647
+ 'onKeyPress',
41648
+ 'onKeyUp',
41649
+ 'onLoadContent',
41650
+ 'onMouseDown',
41651
+ 'onMouseEnter',
41652
+ 'onMouseLeave',
41653
+ 'onMouseMove',
41654
+ 'onMouseOut',
41655
+ 'onMouseOver',
41656
+ 'onMouseUp',
41657
+ 'onNodeChange',
41658
+ 'onObjectResizeStart',
41659
+ 'onObjectResized',
41660
+ 'onObjectSelected',
41661
+ 'onPaste',
41662
+ 'onPostProcess',
41663
+ 'onPostRender',
41664
+ 'onPreProcess',
41665
+ 'onProgressState',
41666
+ 'onRedo',
41667
+ 'onRemove',
41668
+ 'onReset',
41669
+ 'onSaveContent',
41670
+ 'onSelectionChange',
41671
+ 'onSetAttrib',
41672
+ 'onSetContent',
41673
+ 'onShow',
41674
+ 'onSubmit',
41675
+ 'onUndo',
41676
+ 'onVisualAid'
41677
+ ];
41678
+ var isValidKey = function (key) { return validEvents.map(function (event) { return event.toLowerCase(); }).indexOf(key.toLowerCase()) !== -1; };
41679
+ var bindHandlers = function (initEvent, listeners, editor) {
41680
+ Object.keys(listeners)
41681
+ .filter(isValidKey)
41682
+ .forEach(function (key) {
41683
+ var handler = listeners[key];
41684
+ if (typeof handler === 'function') {
41685
+ if (key === 'onInit') {
41686
+ handler(initEvent, editor);
41687
+ }
41688
+ else {
41689
+ editor.on(key.substring(2), function (e) { return handler(e, editor); });
41690
+ }
41691
+ }
41692
+ });
41693
+ };
41694
+ var bindModelHandlers = function (ctx, editor) {
41695
+ var modelEvents = ctx.$props.modelEvents ? ctx.$props.modelEvents : null;
41696
+ var normalizedEvents = Array.isArray(modelEvents) ? modelEvents.join(' ') : modelEvents;
41697
+ editor.on(normalizedEvents ? normalizedEvents : 'change input undo redo', function () {
41698
+ ctx.$emit('input', editor.getContent({ format: ctx.$props.outputFormat }));
41699
+ });
41700
+ };
41701
+ var initEditor = function (initEvent, ctx, editor) {
41702
+ var value = ctx.$props.value ? ctx.$props.value : '';
41703
+ var initialValue = ctx.$props.initialValue ? ctx.$props.initialValue : '';
41704
+ editor.setContent(value || (ctx.initialized ? ctx.cache : initialValue));
41705
+ // Always bind the value listener in case users use :value instead of v-model
41706
+ ctx.$watch('value', function (val, prevVal) {
41707
+ if (editor && typeof val === 'string' && val !== prevVal && val !== editor.getContent({ format: ctx.$props.outputFormat })) {
41708
+ editor.setContent(val);
41709
+ }
41710
+ });
41711
+ // checks if the v-model shorthand is used (which sets an v-on:input listener) and then binds either
41712
+ // specified the events or defaults to "change keyup" event and emits the editor content on that event
41713
+ if (ctx.$listeners.input) {
41714
+ bindModelHandlers(ctx, editor);
41715
+ }
41716
+ bindHandlers(initEvent, ctx.$listeners, editor);
41717
+ ctx.initialized = true;
41718
+ };
41719
+ var unique = 0;
41720
+ var uuid = function (prefix) {
41721
+ var time = Date.now();
41722
+ var random = Math.floor(Math.random() * 1000000000);
41723
+ unique++;
41724
+ return prefix + '_' + random + unique + String(time);
41725
+ };
41726
+ var isTextarea = function (element) {
41727
+ return element !== null && element.tagName.toLowerCase() === 'textarea';
41728
+ };
41729
+ var normalizePluginArray = function (plugins) {
41730
+ if (typeof plugins === 'undefined' || plugins === '') {
41731
+ return [];
41732
+ }
41733
+ return Array.isArray(plugins) ? plugins : plugins.split(' ');
41734
+ };
41735
+ var mergePlugins = function (initPlugins, inputPlugins) {
41736
+ return normalizePluginArray(initPlugins).concat(normalizePluginArray(inputPlugins));
41737
+ };
41738
+ var isNullOrUndefined = function (value) { return value === null || value === undefined; };
41739
+
41740
+
41741
+ // CONCATENATED MODULE: ./node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/ScriptLoader.js
41742
+ /**
41743
+ * Copyright (c) 2018-present, Ephox, Inc.
41744
+ *
41745
+ * This source code is licensed under the Apache 2 license found in the
41746
+ * LICENSE file in the root directory of this source tree.
41747
+ *
41748
+ */
41749
+
41750
+ var createState = function () {
41751
+ return {
41752
+ listeners: [],
41753
+ scriptId: uuid('tiny-script'),
41754
+ scriptLoaded: false
41755
+ };
41756
+ };
41757
+ var CreateScriptLoader = function () {
41758
+ var state = createState();
41759
+ var injectScriptTag = function (scriptId, doc, url, callback) {
41760
+ var scriptTag = doc.createElement('script');
41761
+ scriptTag.referrerPolicy = 'origin';
41762
+ scriptTag.type = 'application/javascript';
41763
+ scriptTag.id = scriptId;
41764
+ scriptTag.src = url;
41765
+ var handler = function () {
41766
+ scriptTag.removeEventListener('load', handler);
41767
+ callback();
41768
+ };
41769
+ scriptTag.addEventListener('load', handler);
41770
+ if (doc.head) {
41771
+ doc.head.appendChild(scriptTag);
41772
+ }
41773
+ };
41774
+ var load = function (doc, url, callback) {
41775
+ if (state.scriptLoaded) {
41776
+ callback();
41777
+ }
41778
+ else {
41779
+ state.listeners.push(callback);
41780
+ if (!doc.getElementById(state.scriptId)) {
41781
+ injectScriptTag(state.scriptId, doc, url, function () {
41782
+ state.listeners.forEach(function (fn) { return fn(); });
41783
+ state.scriptLoaded = true;
41784
+ });
41785
+ }
41786
+ }
41787
+ };
41788
+ // Only to be used by tests.
41789
+ var reinitialize = function () {
41790
+ state = createState();
41791
+ };
41792
+ return {
41793
+ load: load,
41794
+ reinitialize: reinitialize
41795
+ };
41796
+ };
41797
+ var ScriptLoader = CreateScriptLoader();
41798
+
41799
+
41800
+ // EXTERNAL MODULE: ./node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/TinyMCE.js
41801
+ var TinyMCE = __webpack_require__("c4a9");
41802
+
41803
+ // CONCATENATED MODULE: ./node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/components/EditorPropTypes.js
41804
+ /**
41805
+ * Copyright (c) 2018-present, Ephox, Inc.
41806
+ *
41807
+ * This source code is licensed under the Apache 2 license found in the
41808
+ * LICENSE file in the root directory of this source tree.
41809
+ *
41810
+ */
41811
+ var editorProps = {
41812
+ apiKey: String,
41813
+ cloudChannel: String,
41814
+ id: String,
41815
+ init: Object,
41816
+ initialValue: String,
41817
+ inline: Boolean,
41818
+ modelEvents: [String, Array],
41819
+ plugins: [String, Array],
41820
+ tagName: String,
41821
+ toolbar: [String, Array],
41822
+ value: String,
41823
+ disabled: Boolean,
41824
+ tinymceScriptSrc: String,
41825
+ outputFormat: {
41826
+ type: String,
41827
+ validator: function (prop) { return prop === 'html' || prop === 'text'; }
41828
+ },
41829
+ };
41830
+
41831
+ // CONCATENATED MODULE: ./node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/components/Editor.js
41832
+ /**
41833
+ * Copyright (c) 2018-present, Ephox, Inc.
41834
+ *
41835
+ * This source code is licensed under the Apache 2 license found in the
41836
+ * LICENSE file in the root directory of this source tree.
41837
+ *
41838
+ */
41839
+ var __assign = (undefined && undefined.__assign) || function () {
41840
+ __assign = Object.assign || function(t) {
41841
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
41842
+ s = arguments[i];
41843
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
41844
+ t[p] = s[p];
41845
+ }
41846
+ return t;
41847
+ };
41848
+ return __assign.apply(this, arguments);
41849
+ };
41850
+
41851
+
41852
+
41853
+
41854
+ var renderInline = function (h, id, tagName) {
41855
+ return h(tagName ? tagName : 'div', {
41856
+ attrs: { id: id }
41857
+ });
41858
+ };
41859
+ var renderIframe = function (h, id) {
41860
+ return h('textarea', {
41861
+ attrs: { id: id },
41862
+ style: { visibility: 'hidden' }
41863
+ });
41864
+ };
41865
+ var initialise = function (ctx) { return function () {
41866
+ var finalInit = __assign(__assign({}, ctx.$props.init), { readonly: ctx.$props.disabled, selector: "#" + ctx.elementId, plugins: mergePlugins(ctx.$props.init && ctx.$props.init.plugins, ctx.$props.plugins), toolbar: ctx.$props.toolbar || (ctx.$props.init && ctx.$props.init.toolbar), inline: ctx.inlineEditor, setup: function (editor) {
41867
+ ctx.editor = editor;
41868
+ editor.on('init', function (e) { return initEditor(e, ctx, editor); });
41869
+ if (ctx.$props.init && typeof ctx.$props.init.setup === 'function') {
41870
+ ctx.$props.init.setup(editor);
41871
+ }
41872
+ } });
41873
+ if (isTextarea(ctx.element)) {
41874
+ ctx.element.style.visibility = '';
41875
+ ctx.element.style.display = '';
41876
+ }
41877
+ Object(TinyMCE["a" /* getTinymce */])().init(finalInit);
41878
+ }; };
41879
+ var Editor = {
41880
+ props: editorProps,
41881
+ created: function () {
41882
+ this.elementId = this.$props.id || uuid('tiny-vue');
41883
+ this.inlineEditor = (this.$props.init && this.$props.init.inline) || this.$props.inline;
41884
+ this.initialized = false;
41885
+ },
41886
+ watch: {
41887
+ disabled: function () {
41888
+ this.editor.setMode(this.disabled ? 'readonly' : 'design');
41889
+ }
41890
+ },
41891
+ mounted: function () {
41892
+ this.element = this.$el;
41893
+ if (Object(TinyMCE["a" /* getTinymce */])() !== null) {
41894
+ initialise(this)();
41895
+ }
41896
+ else if (this.element && this.element.ownerDocument) {
41897
+ var channel = this.$props.cloudChannel ? this.$props.cloudChannel : '5';
41898
+ var apiKey = this.$props.apiKey ? this.$props.apiKey : 'no-api-key';
41899
+ var scriptSrc = isNullOrUndefined(this.$props.tinymceScriptSrc) ?
41900
+ "https://cdn.tiny.cloud/1/" + apiKey + "/tinymce/" + channel + "/tinymce.min.js" :
41901
+ this.$props.tinymceScriptSrc;
41902
+ ScriptLoader.load(this.element.ownerDocument, scriptSrc, initialise(this));
41903
+ }
41904
+ },
41905
+ beforeDestroy: function () {
41906
+ if (Object(TinyMCE["a" /* getTinymce */])() !== null) {
41907
+ Object(TinyMCE["a" /* getTinymce */])().remove(this.editor);
41908
+ }
41909
+ },
41910
+ deactivated: function () {
41911
+ var _a;
41912
+ if (!this.inlineEditor) {
41913
+ this.cache = this.editor.getContent();
41914
+ (_a = Object(TinyMCE["a" /* getTinymce */])()) === null || _a === void 0 ? void 0 : _a.remove(this.editor);
41915
+ }
41916
+ },
41917
+ activated: function () {
41918
+ if (!this.inlineEditor && this.initialized) {
41919
+ initialise(this)();
41920
+ }
41921
+ },
41922
+ render: function (h) {
41923
+ return this.inlineEditor ? renderInline(h, this.elementId, this.$props.tagName) : renderIframe(h, this.elementId);
41924
+ }
41925
+ };
41926
+
41927
+ // CONCATENATED MODULE: ./node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/index.js
41928
+ /**
41929
+ * Copyright (c) 2018-present, Ephox, Inc.
41930
+ *
41931
+ * This source code is licensed under the Apache 2 license found in the
41932
+ * LICENSE file in the root directory of this source tree.
41933
+ *
41934
+ */
41935
+
41936
+ /* harmony default export */ var ts = __webpack_exports__["a"] = (Editor);
41937
+
41938
+
41312
41939
  /***/ }),
41313
41940
 
41314
41941
  /***/ "ca84":
@@ -43897,337 +44524,8 @@ var NewFieldvue_type_template_id_e9325706_staticRenderFns = [];
43897
44524
 
43898
44525
  // CONCATENATED MODULE: ./src/components/NewField/index.vue?vue&type=template&id=e9325706
43899
44526
 
43900
- // CONCATENATED MODULE: ./node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/Utils.js
43901
- /**
43902
- * Copyright (c) 2018-present, Ephox, Inc.
43903
- *
43904
- * This source code is licensed under the Apache 2 license found in the
43905
- * LICENSE file in the root directory of this source tree.
43906
- *
43907
- */
43908
- var validEvents = [
43909
- 'onActivate',
43910
- 'onAddUndo',
43911
- 'onBeforeAddUndo',
43912
- 'onBeforeExecCommand',
43913
- 'onBeforeGetContent',
43914
- 'onBeforeRenderUI',
43915
- 'onBeforeSetContent',
43916
- 'onBeforePaste',
43917
- 'onBlur',
43918
- 'onChange',
43919
- 'onClearUndos',
43920
- 'onClick',
43921
- 'onContextMenu',
43922
- 'onCopy',
43923
- 'onCut',
43924
- 'onDblclick',
43925
- 'onDeactivate',
43926
- 'onDirty',
43927
- 'onDrag',
43928
- 'onDragDrop',
43929
- 'onDragEnd',
43930
- 'onDragGesture',
43931
- 'onDragOver',
43932
- 'onDrop',
43933
- 'onExecCommand',
43934
- 'onFocus',
43935
- 'onFocusIn',
43936
- 'onFocusOut',
43937
- 'onGetContent',
43938
- 'onHide',
43939
- 'onInit',
43940
- 'onKeyDown',
43941
- 'onKeyPress',
43942
- 'onKeyUp',
43943
- 'onLoadContent',
43944
- 'onMouseDown',
43945
- 'onMouseEnter',
43946
- 'onMouseLeave',
43947
- 'onMouseMove',
43948
- 'onMouseOut',
43949
- 'onMouseOver',
43950
- 'onMouseUp',
43951
- 'onNodeChange',
43952
- 'onObjectResizeStart',
43953
- 'onObjectResized',
43954
- 'onObjectSelected',
43955
- 'onPaste',
43956
- 'onPostProcess',
43957
- 'onPostRender',
43958
- 'onPreProcess',
43959
- 'onProgressState',
43960
- 'onRedo',
43961
- 'onRemove',
43962
- 'onReset',
43963
- 'onSaveContent',
43964
- 'onSelectionChange',
43965
- 'onSetAttrib',
43966
- 'onSetContent',
43967
- 'onShow',
43968
- 'onSubmit',
43969
- 'onUndo',
43970
- 'onVisualAid'
43971
- ];
43972
- var isValidKey = function (key) { return validEvents.map(function (event) { return event.toLowerCase(); }).indexOf(key.toLowerCase()) !== -1; };
43973
- var bindHandlers = function (initEvent, listeners, editor) {
43974
- Object.keys(listeners)
43975
- .filter(isValidKey)
43976
- .forEach(function (key) {
43977
- var handler = listeners[key];
43978
- if (typeof handler === 'function') {
43979
- if (key === 'onInit') {
43980
- handler(initEvent, editor);
43981
- }
43982
- else {
43983
- editor.on(key.substring(2), function (e) { return handler(e, editor); });
43984
- }
43985
- }
43986
- });
43987
- };
43988
- var bindModelHandlers = function (ctx, editor) {
43989
- var modelEvents = ctx.$props.modelEvents ? ctx.$props.modelEvents : null;
43990
- var normalizedEvents = Array.isArray(modelEvents) ? modelEvents.join(' ') : modelEvents;
43991
- editor.on(normalizedEvents ? normalizedEvents : 'change input undo redo', function () {
43992
- ctx.$emit('input', editor.getContent({ format: ctx.$props.outputFormat }));
43993
- });
43994
- };
43995
- var initEditor = function (initEvent, ctx, editor) {
43996
- var value = ctx.$props.value ? ctx.$props.value : '';
43997
- var initialValue = ctx.$props.initialValue ? ctx.$props.initialValue : '';
43998
- editor.setContent(value || (ctx.initialized ? ctx.cache : initialValue));
43999
- // Always bind the value listener in case users use :value instead of v-model
44000
- ctx.$watch('value', function (val, prevVal) {
44001
- if (editor && typeof val === 'string' && val !== prevVal && val !== editor.getContent({ format: ctx.$props.outputFormat })) {
44002
- editor.setContent(val);
44003
- }
44004
- });
44005
- // checks if the v-model shorthand is used (which sets an v-on:input listener) and then binds either
44006
- // specified the events or defaults to "change keyup" event and emits the editor content on that event
44007
- if (ctx.$listeners.input) {
44008
- bindModelHandlers(ctx, editor);
44009
- }
44010
- bindHandlers(initEvent, ctx.$listeners, editor);
44011
- ctx.initialized = true;
44012
- };
44013
- var unique = 0;
44014
- var uuid = function (prefix) {
44015
- var time = Date.now();
44016
- var random = Math.floor(Math.random() * 1000000000);
44017
- unique++;
44018
- return prefix + '_' + random + unique + String(time);
44019
- };
44020
- var isTextarea = function (element) {
44021
- return element !== null && element.tagName.toLowerCase() === 'textarea';
44022
- };
44023
- var normalizePluginArray = function (plugins) {
44024
- if (typeof plugins === 'undefined' || plugins === '') {
44025
- return [];
44026
- }
44027
- return Array.isArray(plugins) ? plugins : plugins.split(' ');
44028
- };
44029
- var mergePlugins = function (initPlugins, inputPlugins) {
44030
- return normalizePluginArray(initPlugins).concat(normalizePluginArray(inputPlugins));
44031
- };
44032
- var isNullOrUndefined = function (value) { return value === null || value === undefined; };
44033
-
44034
-
44035
- // CONCATENATED MODULE: ./node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/ScriptLoader.js
44036
- /**
44037
- * Copyright (c) 2018-present, Ephox, Inc.
44038
- *
44039
- * This source code is licensed under the Apache 2 license found in the
44040
- * LICENSE file in the root directory of this source tree.
44041
- *
44042
- */
44043
-
44044
- var createState = function () {
44045
- return {
44046
- listeners: [],
44047
- scriptId: uuid('tiny-script'),
44048
- scriptLoaded: false
44049
- };
44050
- };
44051
- var CreateScriptLoader = function () {
44052
- var state = createState();
44053
- var injectScriptTag = function (scriptId, doc, url, callback) {
44054
- var scriptTag = doc.createElement('script');
44055
- scriptTag.referrerPolicy = 'origin';
44056
- scriptTag.type = 'application/javascript';
44057
- scriptTag.id = scriptId;
44058
- scriptTag.src = url;
44059
- var handler = function () {
44060
- scriptTag.removeEventListener('load', handler);
44061
- callback();
44062
- };
44063
- scriptTag.addEventListener('load', handler);
44064
- if (doc.head) {
44065
- doc.head.appendChild(scriptTag);
44066
- }
44067
- };
44068
- var load = function (doc, url, callback) {
44069
- if (state.scriptLoaded) {
44070
- callback();
44071
- }
44072
- else {
44073
- state.listeners.push(callback);
44074
- if (!doc.getElementById(state.scriptId)) {
44075
- injectScriptTag(state.scriptId, doc, url, function () {
44076
- state.listeners.forEach(function (fn) { return fn(); });
44077
- state.scriptLoaded = true;
44078
- });
44079
- }
44080
- }
44081
- };
44082
- // Only to be used by tests.
44083
- var reinitialize = function () {
44084
- state = createState();
44085
- };
44086
- return {
44087
- load: load,
44088
- reinitialize: reinitialize
44089
- };
44090
- };
44091
- var ScriptLoader = CreateScriptLoader();
44092
-
44093
-
44094
- // EXTERNAL MODULE: ./node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/TinyMCE.js
44095
- var TinyMCE = __webpack_require__("c4a9");
44096
-
44097
- // CONCATENATED MODULE: ./node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/components/EditorPropTypes.js
44098
- /**
44099
- * Copyright (c) 2018-present, Ephox, Inc.
44100
- *
44101
- * This source code is licensed under the Apache 2 license found in the
44102
- * LICENSE file in the root directory of this source tree.
44103
- *
44104
- */
44105
- var editorProps = {
44106
- apiKey: String,
44107
- cloudChannel: String,
44108
- id: String,
44109
- init: Object,
44110
- initialValue: String,
44111
- inline: Boolean,
44112
- modelEvents: [String, Array],
44113
- plugins: [String, Array],
44114
- tagName: String,
44115
- toolbar: [String, Array],
44116
- value: String,
44117
- disabled: Boolean,
44118
- tinymceScriptSrc: String,
44119
- outputFormat: {
44120
- type: String,
44121
- validator: function (prop) { return prop === 'html' || prop === 'text'; }
44122
- },
44123
- };
44124
-
44125
- // CONCATENATED MODULE: ./node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/components/Editor.js
44126
- /**
44127
- * Copyright (c) 2018-present, Ephox, Inc.
44128
- *
44129
- * This source code is licensed under the Apache 2 license found in the
44130
- * LICENSE file in the root directory of this source tree.
44131
- *
44132
- */
44133
- var __assign = (undefined && undefined.__assign) || function () {
44134
- __assign = Object.assign || function(t) {
44135
- for (var s, i = 1, n = arguments.length; i < n; i++) {
44136
- s = arguments[i];
44137
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
44138
- t[p] = s[p];
44139
- }
44140
- return t;
44141
- };
44142
- return __assign.apply(this, arguments);
44143
- };
44144
-
44145
-
44146
-
44147
-
44148
- var renderInline = function (h, id, tagName) {
44149
- return h(tagName ? tagName : 'div', {
44150
- attrs: { id: id }
44151
- });
44152
- };
44153
- var renderIframe = function (h, id) {
44154
- return h('textarea', {
44155
- attrs: { id: id },
44156
- style: { visibility: 'hidden' }
44157
- });
44158
- };
44159
- var initialise = function (ctx) { return function () {
44160
- var finalInit = __assign(__assign({}, ctx.$props.init), { readonly: ctx.$props.disabled, selector: "#" + ctx.elementId, plugins: mergePlugins(ctx.$props.init && ctx.$props.init.plugins, ctx.$props.plugins), toolbar: ctx.$props.toolbar || (ctx.$props.init && ctx.$props.init.toolbar), inline: ctx.inlineEditor, setup: function (editor) {
44161
- ctx.editor = editor;
44162
- editor.on('init', function (e) { return initEditor(e, ctx, editor); });
44163
- if (ctx.$props.init && typeof ctx.$props.init.setup === 'function') {
44164
- ctx.$props.init.setup(editor);
44165
- }
44166
- } });
44167
- if (isTextarea(ctx.element)) {
44168
- ctx.element.style.visibility = '';
44169
- ctx.element.style.display = '';
44170
- }
44171
- Object(TinyMCE["a" /* getTinymce */])().init(finalInit);
44172
- }; };
44173
- var Editor = {
44174
- props: editorProps,
44175
- created: function () {
44176
- this.elementId = this.$props.id || uuid('tiny-vue');
44177
- this.inlineEditor = (this.$props.init && this.$props.init.inline) || this.$props.inline;
44178
- this.initialized = false;
44179
- },
44180
- watch: {
44181
- disabled: function () {
44182
- this.editor.setMode(this.disabled ? 'readonly' : 'design');
44183
- }
44184
- },
44185
- mounted: function () {
44186
- this.element = this.$el;
44187
- if (Object(TinyMCE["a" /* getTinymce */])() !== null) {
44188
- initialise(this)();
44189
- }
44190
- else if (this.element && this.element.ownerDocument) {
44191
- var channel = this.$props.cloudChannel ? this.$props.cloudChannel : '5';
44192
- var apiKey = this.$props.apiKey ? this.$props.apiKey : 'no-api-key';
44193
- var scriptSrc = isNullOrUndefined(this.$props.tinymceScriptSrc) ?
44194
- "https://cdn.tiny.cloud/1/" + apiKey + "/tinymce/" + channel + "/tinymce.min.js" :
44195
- this.$props.tinymceScriptSrc;
44196
- ScriptLoader.load(this.element.ownerDocument, scriptSrc, initialise(this));
44197
- }
44198
- },
44199
- beforeDestroy: function () {
44200
- if (Object(TinyMCE["a" /* getTinymce */])() !== null) {
44201
- Object(TinyMCE["a" /* getTinymce */])().remove(this.editor);
44202
- }
44203
- },
44204
- deactivated: function () {
44205
- var _a;
44206
- if (!this.inlineEditor) {
44207
- this.cache = this.editor.getContent();
44208
- (_a = Object(TinyMCE["a" /* getTinymce */])()) === null || _a === void 0 ? void 0 : _a.remove(this.editor);
44209
- }
44210
- },
44211
- activated: function () {
44212
- if (!this.inlineEditor && this.initialized) {
44213
- initialise(this)();
44214
- }
44215
- },
44216
- render: function (h) {
44217
- return this.inlineEditor ? renderInline(h, this.elementId, this.$props.tagName) : renderIframe(h, this.elementId);
44218
- }
44219
- };
44220
-
44221
- // CONCATENATED MODULE: ./node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/index.js
44222
- /**
44223
- * Copyright (c) 2018-present, Ephox, Inc.
44224
- *
44225
- * This source code is licensed under the Apache 2 license found in the
44226
- * LICENSE file in the root directory of this source tree.
44227
- *
44228
- */
44229
-
44230
- /* harmony default export */ var ts = (Editor);
44527
+ // EXTERNAL MODULE: ./node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/index.js + 4 modules
44528
+ var ts = __webpack_require__("ca72");
44231
44529
 
44232
44530
  // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/NewField/index.vue?vue&type=script&lang=js
44233
44531
 
@@ -44236,7 +44534,7 @@ const _ = lodash_default.a;
44236
44534
  /* harmony default export */ var NewFieldvue_type_script_lang_js = ({
44237
44535
  name: "NewField",
44238
44536
  components: {
44239
- Editor: ts
44537
+ Editor: ts["a" /* default */]
44240
44538
  },
44241
44539
  props: {
44242
44540
  field: {
@@ -44404,9 +44702,9 @@ var NewField_component = normalizeComponent(
44404
44702
  )
44405
44703
 
44406
44704
  /* harmony default export */ var NewField = (NewField_component.exports);
44407
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"28cb8bd5-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/EditableField/index.vue?vue&type=template&id=37c0daa8
44705
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"28cb8bd5-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/EditableField/index.vue?vue&type=template&id=4682b07c
44408
44706
 
44409
- var EditableFieldvue_type_template_id_37c0daa8_render = function render() {
44707
+ var EditableFieldvue_type_template_id_4682b07c_render = function render() {
44410
44708
  var _vm = this,
44411
44709
  _c = _vm._self._c;
44412
44710
  return _c('div', {
@@ -44623,282 +44921,15 @@ var EditableFieldvue_type_template_id_37c0daa8_render = function render() {
44623
44921
  }
44624
44922
  }) : _vm._e()], 1)], 1)]);
44625
44923
  };
44626
- var EditableFieldvue_type_template_id_37c0daa8_staticRenderFns = [];
44627
-
44628
- // CONCATENATED MODULE: ./src/components/EditableField/index.vue?vue&type=template&id=37c0daa8
44924
+ var EditableFieldvue_type_template_id_4682b07c_staticRenderFns = [];
44629
44925
 
44630
- // EXTERNAL MODULE: ./node_modules/vue-trumbowyg/dist/vue-trumbowyg.min.js
44631
- var vue_trumbowyg_min = __webpack_require__("6cf8");
44632
- var vue_trumbowyg_min_default = /*#__PURE__*/__webpack_require__.n(vue_trumbowyg_min);
44926
+ // CONCATENATED MODULE: ./src/components/EditableField/index.vue?vue&type=template&id=4682b07c
44633
44927
 
44634
- // EXTERNAL MODULE: ./node_modules/trumbowyg/dist/ui/trumbowyg.css
44635
- var trumbowyg = __webpack_require__("d6a2");
44928
+ // EXTERNAL MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/EditableField/index.vue?vue&type=script&lang=js
44929
+ var EditableFieldvue_type_script_lang_js = __webpack_require__("0713");
44636
44930
 
44637
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/EditableField/index.vue?vue&type=script&lang=js
44638
-
44639
-
44640
-
44641
-
44642
- const EditableFieldvue_type_script_lang_js_ = lodash_default.a;
44643
- /* harmony default export */ var EditableFieldvue_type_script_lang_js = ({
44644
- name: "EditableField",
44645
- components: {
44646
- Editor: ts,
44647
- VueTrumbowyg: vue_trumbowyg_min_default.a
44648
- },
44649
- model: {
44650
- props: "value",
44651
- event: "input"
44652
- },
44653
- props: {
44654
- field: {
44655
- type: [String, Boolean],
44656
- default: ""
44657
- },
44658
- value: {
44659
- type: [String, Boolean, Date, Number, Array],
44660
- default: ""
44661
- },
44662
- filterable: {
44663
- type: Boolean,
44664
- default: false
44665
- },
44666
- type: {
44667
- type: String,
44668
- default: "input"
44669
- },
44670
- placeholder: {
44671
- type: String,
44672
- default: ""
44673
- },
44674
- selectList: {
44675
- type: Array,
44676
- default: () => []
44677
- },
44678
- rows: {
44679
- type: Number,
44680
- default: 3
44681
- },
44682
- height: {
44683
- type: String,
44684
- default: "102px"
44685
- },
44686
- selectMultiple: {
44687
- type: Boolean,
44688
- default: false
44689
- },
44690
- objectValueKey: {
44691
- type: String,
44692
- default: "value"
44693
- },
44694
- selectJson: {
44695
- type: Boolean,
44696
- default: false
44697
- },
44698
- selectKey: {
44699
- type: String,
44700
- default: "value"
44701
- },
44702
- selectLabel: {
44703
- type: String,
44704
- default: "name"
44705
- },
44706
- selectValue: {
44707
- type: String,
44708
- default: ""
44709
- },
44710
- precision: {
44711
- type: Number,
44712
- default: 0
44713
- },
44714
- step: {
44715
- type: Number,
44716
- default: 1
44717
- },
44718
- allowCreate: {
44719
- type: Boolean,
44720
- default: false
44721
- },
44722
- defaultFirstOption: {
44723
- type: Boolean,
44724
- default: false
44725
- },
44726
- remoteMethod: {
44727
- type: Object,
44728
- default: null
44729
- },
44730
- readonly: {
44731
- type: Boolean,
44732
- default: false
44733
- },
44734
- format: {
44735
- type: String,
44736
- default: "dd.MM.yyyy"
44737
- },
44738
- valueFormat: {
44739
- type: String,
44740
- default: "yyyy-MM-dd"
44741
- },
44742
- tinyApiKey: {
44743
- type: String,
44744
- default: ""
44745
- },
44746
- trumbowygConfig: {
44747
- type: Object,
44748
- default: () => ({
44749
- menubar: false,
44750
- force_br_newlines: true,
44751
- force_p_newlines: false,
44752
- forced_root_block: '',
44753
- plugins: ['lists'],
44754
- paste_preprocess: function (plugin, args) {
44755
- args.content = args.content.replace(/&lt;(?!p|\/p).*?&gt;|<[^>](?!p|\/p)*>/g, "").replace(/<\/?[^>](?!p|\/p)+(>|$)/g, "");
44756
- },
44757
- toolbar: 'bold italic | bullist numlist',
44758
- btns: [["strong", "em"], ["unorderedList", "orderedList"], ["link"], ["removeformat"]]
44759
- })
44760
- }
44761
- },
44762
- data() {
44763
- return {
44764
- isEditMode: false,
44765
- model: "",
44766
- selectListLocal: this.selectList,
44767
- trumbowygEditorKey: 0
44768
- };
44769
- },
44770
- computed: {
44771
- normalizedTrumbowygValue: {
44772
- get() {
44773
- return this.unwrapTrumbowygHtml(this.value);
44774
- }
44775
- },
44776
- isSelectValue: {
44777
- get() {
44778
- return (this.value || this.value === false) && this.type === "select";
44779
- }
44780
- },
44781
- remote: {
44782
- get() {
44783
- return this.remoteMethod !== null;
44784
- }
44785
- },
44786
- remoteMethodHandler: {
44787
- get() {
44788
- if (this.remoteMethod !== null) {
44789
- return this.remoteCall;
44790
- }
44791
- return null;
44792
- }
44793
- }
44794
- },
44795
- watch: {
44796
- selectList: function () {
44797
- this.selectListLocal = EditableFieldvue_type_script_lang_js_.cloneDeep(this.selectList);
44798
- }
44799
- },
44800
- methods: {
44801
- unwrapTrumbowygHtml(rawValue) {
44802
- if (this.type !== "trumbowyg" || typeof rawValue !== "string") {
44803
- return rawValue;
44804
- }
44805
- const trimmedValue = rawValue.trim();
44806
- const wrappedTextareaMatch = trimmedValue.match(/^<textarea\b[^>]*>([\s\S]*)<\/textarea>$/i);
44807
- if (wrappedTextareaMatch) {
44808
- return wrappedTextareaMatch[1];
44809
- }
44810
- return rawValue;
44811
- },
44812
- focusTrumbowygEditor(event) {
44813
- const container = event && event.currentTarget ? event.currentTarget : null;
44814
- if (!container || !container.querySelector) {
44815
- return;
44816
- }
44817
- const editor = container.querySelector(".trumbowyg-editor");
44818
- if (editor && typeof editor.focus === "function") {
44819
- editor.focus();
44820
- }
44821
- },
44822
- createList() {
44823
- let label = "";
44824
- if (this.selectMultiple) {
44825
- if (this.value.length) {
44826
- let values = [];
44827
- this.value.forEach(element => {
44828
- console.log(element);
44829
- let compareValue = this.selectJson ? element[this.selectKey] : element;
44830
- if (!compareValue) {
44831
- compareValue = element;
44832
- }
44833
- const labArray = this.selectListLocal.find(x => x[this.selectKey] === compareValue);
44834
- if (labArray && labArray[this.selectLabel]) {
44835
- values.push(labArray[this.selectLabel]);
44836
- } else {
44837
- values.push(element);
44838
- }
44839
- label = values.join("; ");
44840
- });
44841
- } else {
44842
- label = "-";
44843
- }
44844
- } else if (this.selectListLocal.length) {
44845
- let obj = this.selectListLocal.find(x => x[this.selectKey] === this.value);
44846
- if (typeof obj != "undefined") {
44847
- label = obj[this.selectLabel];
44848
- } else {
44849
- console.log(this.value + " not found in " + this.selectListLocal.map(x => x[this.selectKey]));
44850
- }
44851
- } else {
44852
- label = this.value;
44853
- }
44854
- return label;
44855
- },
44856
- async handleDoubleClick() {
44857
- this.$emit("editable:open");
44858
- this.isEditMode = true;
44859
- this.model = this.unwrapTrumbowygHtml(this.value);
44860
- if (this.type === "trumbowyg") {
44861
- this.trumbowygEditorKey += 1;
44862
- }
44863
- },
44864
- handleClose() {
44865
- this.isEditMode = false;
44866
- this.model = this.unwrapTrumbowygHtml(this.value);
44867
- this.$emit("editable:close");
44868
- },
44869
- async remoteCall(query) {
44870
- if (!query.length) {
44871
- return;
44872
- }
44873
- this.loading = true;
44874
- const response = await this.remoteMethod.all({
44875
- search: this.selectLabel + ":" + query,
44876
- searchFields: this.selectLabel + ":like"
44877
- });
44878
- this.selectListLocal = response.data;
44879
- this.loading = false;
44880
- },
44881
- handleSave() {
44882
- this.isEditMode = false;
44883
- this.$emit("editable:close");
44884
- let emitValue = this.model;
44885
- emitValue = this.unwrapTrumbowygHtml(emitValue);
44886
- if (this.type === "number" && (emitValue === undefined || emitValue === "")) {
44887
- emitValue = null;
44888
- }
44889
- this.$emit("editable:save", {
44890
- field: this.field,
44891
- value: emitValue
44892
- });
44893
- this.$emit("update:value", {
44894
- field: this.field,
44895
- value: emitValue
44896
- });
44897
- }
44898
- }
44899
- });
44900
44931
  // CONCATENATED MODULE: ./src/components/EditableField/index.vue?vue&type=script&lang=js
44901
- /* harmony default export */ var components_EditableFieldvue_type_script_lang_js = (EditableFieldvue_type_script_lang_js);
44932
+ /* harmony default export */ var components_EditableFieldvue_type_script_lang_js = (EditableFieldvue_type_script_lang_js["a" /* default */]);
44902
44933
  // CONCATENATED MODULE: ./src/components/EditableField/index.vue
44903
44934
 
44904
44935
 
@@ -44909,8 +44940,8 @@ const EditableFieldvue_type_script_lang_js_ = lodash_default.a;
44909
44940
 
44910
44941
  var EditableField_component = normalizeComponent(
44911
44942
  components_EditableFieldvue_type_script_lang_js,
44912
- EditableFieldvue_type_template_id_37c0daa8_render,
44913
- EditableFieldvue_type_template_id_37c0daa8_staticRenderFns,
44943
+ EditableFieldvue_type_template_id_4682b07c_render,
44944
+ EditableFieldvue_type_template_id_4682b07c_staticRenderFns,
44914
44945
  false,
44915
44946
  null,
44916
44947
  null,