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