@ldmjs/ui 1.0.37 → 1.0.38

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.
Files changed (2) hide show
  1. package/dist/index.js +1073 -1072
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -14219,346 +14219,459 @@ function ld_text_viewervue_type_template_id_26123e5c_scoped_true_render(_ctx, _c
14219
14219
  }
14220
14220
  ;// CONCATENATED MODULE: ./src/ld-text-viewer/ld-text-viewer.vue?vue&type=template&id=26123e5c&scoped=true
14221
14221
 
14222
- ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-text-viewer/ld-text-viewer.ts?vue&type=script&lang=js&external
14223
- var ld_text_viewervue_type_script_lang_js_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
14224
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
14225
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
14226
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
14227
- return c > 3 && r && Object.defineProperty(target, key, r), r;
14228
- };
14229
- var ld_text_viewervue_type_script_lang_js_external_metadata = (undefined && undefined.__metadata) || function (k, v) {
14230
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
14231
- };
14232
-
14233
-
14234
-
14235
-
14236
-
14237
- /**
14238
- * @displayName ld-text-viewer
14239
- */
14240
- let CardTextViewer = class CardTextViewer extends (0,external_vue_class_component_.mixins)(GridMixin) {
14241
- hasSlotContent(slot, slotProps = {}) {
14242
- if (!slot) {
14243
- return false;
14222
+ ;// CONCATENATED MODULE: ./src/utils/awaiting.ts
14223
+ async function awaiting(callback) {
14224
+ let resolveFunc = null;
14225
+ const counter = 0;
14226
+ let timer = null;
14227
+ const promise = new Promise(resolve => {
14228
+ resolveFunc = resolve;
14229
+ });
14230
+ timer = setInterval(() => {
14231
+ const a = callback();
14232
+ if (counter > 100 || Boolean(a)) {
14233
+ clearInterval(timer);
14234
+ resolveFunc(a ?? true);
14244
14235
  }
14245
- return slot(slotProps).some((vnode) => {
14246
- if (vnode.type === external_vue_.Comment) {
14247
- return false;
14236
+ }, 100);
14237
+ await promise;
14238
+ }
14239
+
14240
+ ;// CONCATENATED MODULE: ./src/utils/base64.ts
14241
+ /* eslint-disable no-bitwise */
14242
+ class Base64Util {
14243
+ constructor() {
14244
+ this._keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
14245
+ }
14246
+ encode(input) {
14247
+ let output = '';
14248
+ let chr1, chr2, chr3, enc1, enc2, enc3, enc4;
14249
+ let i = 0;
14250
+ input = Base64Util._utf8_encode(input);
14251
+ while (i < input.length) {
14252
+ chr1 = input.charCodeAt(i++);
14253
+ chr2 = input.charCodeAt(i++);
14254
+ chr3 = input.charCodeAt(i++);
14255
+ enc1 = chr1 >> 2;
14256
+ enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
14257
+ enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
14258
+ enc4 = chr3 & 63;
14259
+ if (isNaN(chr2)) {
14260
+ enc3 = enc4 = 64;
14248
14261
  }
14249
- if (Array.isArray(vnode.children) && !vnode.children.length) {
14250
- return false;
14262
+ else if (isNaN(chr3)) {
14263
+ enc4 = 64;
14251
14264
  }
14252
- return vnode.type !== external_vue_.Text || (typeof vnode.children === 'string' && vnode.children.trim() !== '');
14253
- });
14254
- }
14255
- get hasSlot() {
14256
- return this.hasSlotContent(this.$slots.default);
14265
+ output =
14266
+ output +
14267
+ this._keyStr.charAt(enc1) +
14268
+ this._keyStr.charAt(enc2) +
14269
+ this._keyStr.charAt(enc3) +
14270
+ this._keyStr.charAt(enc4);
14271
+ }
14272
+ return output;
14257
14273
  }
14258
- get isTextSlotOnly() {
14259
- if (this.hasSlot) {
14260
- return this.$slots.default().every((vnode) => typeof vnode.children === 'string');
14274
+ decode(input) {
14275
+ let output = '';
14276
+ let chr1, chr2, chr3;
14277
+ let enc1, enc2, enc3, enc4;
14278
+ let i = 0;
14279
+ input = input.replace(/[^\d+/=A-Za-z]/g, '');
14280
+ while (i < input.length) {
14281
+ enc1 = this._keyStr.indexOf(input.charAt(i++));
14282
+ enc2 = this._keyStr.indexOf(input.charAt(i++));
14283
+ enc3 = this._keyStr.indexOf(input.charAt(i++));
14284
+ enc4 = this._keyStr.indexOf(input.charAt(i++));
14285
+ chr1 = (enc1 << 2) | (enc2 >> 4);
14286
+ chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
14287
+ chr3 = ((enc3 & 3) << 6) | enc4;
14288
+ output = output + String.fromCharCode(chr1);
14289
+ if (enc3 !== 64) {
14290
+ output = output + String.fromCharCode(chr2);
14291
+ }
14292
+ if (enc4 !== 64) {
14293
+ output = output + String.fromCharCode(chr3);
14294
+ }
14261
14295
  }
14262
- return false;
14296
+ output = Base64Util._utf8_decode(output);
14297
+ return output;
14263
14298
  }
14264
- get src() {
14265
- if (this.text) {
14266
- return this.text.replace(/\n/g, '<br>');
14299
+ static _utf8_encode(str) {
14300
+ str = str.replace(/\r\n/g, '\n');
14301
+ let utftext = '';
14302
+ for (let n = 0; n < str.length; n++) {
14303
+ const c = str.charCodeAt(n);
14304
+ if (c < 128) {
14305
+ utftext += String.fromCharCode(c);
14306
+ }
14307
+ else if (c > 127 && c < 2048) {
14308
+ utftext += String.fromCharCode((c >> 6) | 192);
14309
+ utftext += String.fromCharCode((c & 63) | 128);
14310
+ }
14311
+ else {
14312
+ utftext += String.fromCharCode((c >> 12) | 224);
14313
+ utftext += String.fromCharCode(((c >> 6) & 63) | 128);
14314
+ utftext += String.fromCharCode((c & 63) | 128);
14315
+ }
14267
14316
  }
14268
- if (this.hasSlot && this.isTextSlotOnly) {
14269
- const slots = this.$slots.default();
14270
- let result = '';
14271
- for (const s of slots) {
14272
- result += s.children.trim();
14317
+ return utftext;
14318
+ }
14319
+ static _utf8_decode(utftext) {
14320
+ let string = '';
14321
+ let i = 0;
14322
+ let c = 0;
14323
+ let c2 = 0;
14324
+ let c3 = 0;
14325
+ while (i < utftext.length) {
14326
+ c = utftext.charCodeAt(i);
14327
+ if (c < 128) {
14328
+ string += String.fromCharCode(c);
14329
+ i++;
14330
+ }
14331
+ else if (c > 191 && c < 224) {
14332
+ c2 = utftext.charCodeAt(i + 1);
14333
+ string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
14334
+ i += 2;
14335
+ }
14336
+ else {
14337
+ c2 = utftext.charCodeAt(i + 1);
14338
+ c3 = utftext.charCodeAt(i + 2);
14339
+ string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
14340
+ i += 3;
14273
14341
  }
14274
- return result;
14275
14342
  }
14276
- return '';
14343
+ return string;
14277
14344
  }
14278
- get textWithHyperlinks() {
14279
- if (!this.src) {
14280
- return;
14345
+ isValid(value) {
14346
+ // eslint-disable-next-line optimize-regex/optimize-regex
14347
+ const base64Regex = /^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)?$/gim;
14348
+ return base64Regex.test(value);
14349
+ }
14350
+ }
14351
+ const base64 = new Base64Util();
14352
+
14353
+
14354
+ ;// CONCATENATED MODULE: ./src/utils/cookie.ts
14355
+ class Cookie {
14356
+ get(key) {
14357
+ const _key = key.replace(/([$()*+./?[\\\]^{|}])/g, '\\$1');
14358
+ const matches = document.cookie.match(new RegExp('(?:^|; )' + _key + '=([^;]*)'));
14359
+ if (matches && matches[1] && matches[1].length) {
14360
+ return matches[1];
14281
14361
  }
14282
- if (this.activeLinks) {
14283
- const globalUrlRegExp = new RegExp(this.$utils.urlRegexp, 'ig');
14284
- return this.src.replace(globalUrlRegExp, '<a href="$1" target="_blank">$1</a>');
14362
+ return null;
14363
+ }
14364
+ set(key, value, expires) {
14365
+ let time = 0;
14366
+ switch (expires) {
14367
+ case 'day':
14368
+ time = 1000 * 60 * 60 * 24;
14369
+ break;
14370
+ case 'month':
14371
+ time = 1000 * 60 * 60 * 24 * 30;
14372
+ break;
14285
14373
  }
14286
- return this.src;
14374
+ let exp = '';
14375
+ if (time) {
14376
+ time = Date.now() + time;
14377
+ exp = new Date(time).toUTCString();
14378
+ }
14379
+ document.cookie = key + '=' + value + '; path=/; expires=' + exp;
14287
14380
  }
14288
- get showPlaceholder() {
14289
- return !this.src && !this.hasSlot;
14381
+ delete(key) {
14382
+ document.cookie = key + '=; path=/; expires=-1';
14290
14383
  }
14291
- };
14292
- ld_text_viewervue_type_script_lang_js_external_decorate([
14293
- (0,external_vue_property_decorator_.Prop)({ type: Boolean, default: false }),
14294
- ld_text_viewervue_type_script_lang_js_external_metadata("design:type", Boolean)
14295
- ], CardTextViewer.prototype, "activeLinks", void 0);
14296
- ld_text_viewervue_type_script_lang_js_external_decorate([
14297
- (0,external_vue_property_decorator_.Prop)(),
14298
- ld_text_viewervue_type_script_lang_js_external_metadata("design:type", String)
14299
- ], CardTextViewer.prototype, "text", void 0);
14300
- ld_text_viewervue_type_script_lang_js_external_decorate([
14301
- (0,external_vue_property_decorator_.Prop)({ type: Boolean, default: false }),
14302
- ld_text_viewervue_type_script_lang_js_external_metadata("design:type", Boolean)
14303
- ], CardTextViewer.prototype, "alignLabelToRight", void 0);
14304
- CardTextViewer = ld_text_viewervue_type_script_lang_js_external_decorate([
14305
- (0,external_vue_class_component_.Options)({
14306
- components: {
14307
- 'ld-label': ld_label
14308
- },
14309
- })
14310
- ], CardTextViewer);
14311
- /* harmony default export */ const ld_text_viewervue_type_script_lang_js_external = (CardTextViewer);
14312
-
14313
- ;// CONCATENATED MODULE: ./src/ld-text-viewer/ld-text-viewer.ts?vue&type=script&lang=js&external
14314
-
14315
- ;// CONCATENATED MODULE: ./src/ld-text-viewer/ld-text-viewer.vue
14316
-
14317
-
14318
-
14319
-
14320
- ;
14321
-
14322
-
14323
- const ld_text_viewer_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(ld_text_viewervue_type_script_lang_js_external, [['render',ld_text_viewervue_type_template_id_26123e5c_scoped_true_render],['__scopeId',"data-v-26123e5c"]])
14324
-
14325
- /* harmony default export */ const ld_text_viewer = (ld_text_viewer_exports_);
14326
- ;// CONCATENATED MODULE: ./src/ld-text-viewer/index.ts
14327
-
14328
- function ld_text_viewer_reg(vue, options) {
14329
- vue.component(options.aliases['ld-text-viewer'], ld_text_viewer);
14330
14384
  }
14331
- /* harmony default export */ const src_ld_text_viewer = (ld_text_viewer_reg);
14332
-
14333
- ;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use!./src/ld-edit-masked-text/ld-edit-masked-text.vue?vue&type=template&id=33aa4ec6&scoped=true
14334
-
14335
-
14336
- const ld_edit_masked_textvue_type_template_id_33aa4ec6_scoped_true_withScopeId = n => (_pushScopeId("data-v-33aa4ec6"),n=n(),_popScopeId(),n)
14337
- const ld_edit_masked_textvue_type_template_id_33aa4ec6_scoped_true_hoisted_1 = { class: "ld-edit-masked-text" }
14338
- const ld_edit_masked_textvue_type_template_id_33aa4ec6_scoped_true_hoisted_2 = {
14339
- key: 0,
14340
- class: "ld-edit-masked-text-validate"
14341
- }
14385
+ const cookie = new Cookie();
14386
+
14342
14387
 
14343
- function ld_edit_masked_textvue_type_template_id_33aa4ec6_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
14344
- const _component_ld_label = (0,external_vue_.resolveComponent)("ld-label")
14345
- const _component_ld_icon = (0,external_vue_.resolveComponent)("ld-icon")
14346
- const _component_imask_input = (0,external_vue_.resolveComponent)("imask-input")
14347
- const _component_v_col = (0,external_vue_.resolveComponent)("v-col")
14348
- const _component_v_row = (0,external_vue_.resolveComponent)("v-row")
14349
-
14350
- return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_edit_masked_textvue_type_template_id_33aa4ec6_scoped_true_hoisted_1, [
14351
- (0,external_vue_.createVNode)(_component_v_row, { "no-gutters": "" }, {
14352
- default: (0,external_vue_.withCtx)(() => [
14353
- (_ctx.label)
14354
- ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_ld_label, {
14355
- key: 0,
14356
- class: (0,external_vue_.normalizeClass)([_ctx.labelSizeClasses]),
14357
- label: _ctx.label,
14358
- required: _ctx.required,
14359
- "align-label-to-right": _ctx.alignLabelToRight
14360
- }, null, 8, ["class", "label", "required", "align-label-to-right"]))
14361
- : (0,external_vue_.createCommentVNode)("", true),
14362
- (0,external_vue_.createTextVNode)(),
14363
- (0,external_vue_.createVNode)(_component_v_col, {
14364
- class: (0,external_vue_.normalizeClass)(["d-flex flex-column", _ctx.inputSizeClasses])
14365
- }, {
14366
- default: (0,external_vue_.withCtx)(() => [
14367
- (0,external_vue_.createVNode)(_component_imask_input, {
14368
- ref: "imask",
14369
- radix: ",",
14370
- value: _ctx.internalValue,
14371
- "onUpdate:value": _cache[1] || (_cache[1] = $event => ((_ctx.internalValue) = $event)),
14372
- mask: _ctx.mask,
14373
- scale: _ctx.scale,
14374
- "thousands-separator": _ctx.thousandsSeparator,
14375
- signed: _ctx.signed,
14376
- mapToRadix: _ctx.mapToRadix,
14377
- placeholder: _ctx.placeholder,
14378
- "onAccept:masked": _ctx.onInput,
14379
- onBlur: _ctx.onBlur,
14380
- onClick: _ctx.onClick
14381
- }, {
14382
- "append-inner": (0,external_vue_.withCtx)(() => [
14383
- (_ctx.clearIcon && _ctx.text)
14384
- ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_ld_icon, {
14385
- key: 0,
14386
- color: "error",
14387
- onClick: _cache[0] || (_cache[0] = $event => (_ctx.emitUpdateModelValue('')))
14388
- }, {
14389
- default: (0,external_vue_.withCtx)(() => [
14390
- (0,external_vue_.createTextVNode)("close")
14391
- ]),
14392
- _: 1
14393
- }))
14394
- : (0,external_vue_.createCommentVNode)("", true)
14395
- ]),
14396
- _: 1
14397
- }, 8, ["value", "mask", "scale", "thousands-separator", "signed", "mapToRadix", "placeholder", "onAccept:masked", "onBlur", "onClick"]),
14398
- (0,external_vue_.createTextVNode)(),
14399
- (!_ctx.hideDetails)
14400
- ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_edit_masked_textvue_type_template_id_33aa4ec6_scoped_true_hoisted_2, [
14401
- (0,external_vue_.createVNode)(external_vue_.Transition, { name: "squash" }, {
14402
- default: (0,external_vue_.withCtx)(() => [
14403
- (0,external_vue_.createElementVNode)("span", {
14404
- style: {"line-height":"12px","font-size":"var(--font-size--1)"},
14405
- class: (0,external_vue_.normalizeClass)({ 'error--text': _ctx.warningHint })
14406
- }, (0,external_vue_.toDisplayString)(_ctx.validationMessage || _ctx.inputHint), 3)
14407
- ]),
14408
- _: 1
14409
- })
14410
- ]))
14411
- : (0,external_vue_.createCommentVNode)("", true)
14412
- ]),
14413
- _: 1
14414
- }, 8, ["class"])
14415
- ]),
14416
- _: 1
14417
- })
14418
- ]))
14419
- }
14420
- ;// CONCATENATED MODULE: ./src/ld-edit-masked-text/ld-edit-masked-text.vue?vue&type=template&id=33aa4ec6&scoped=true
14421
-
14422
- ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-edit-masked-text/ld-edit-masked-text.ts?vue&type=script&lang=js&external
14423
- var ld_edit_masked_textvue_type_script_lang_js_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
14424
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
14425
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
14426
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
14427
- return c > 3 && r && Object.defineProperty(target, key, r), r;
14428
- };
14429
- var ld_edit_masked_textvue_type_script_lang_js_external_metadata = (undefined && undefined.__metadata) || function (k, v) {
14430
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
14431
- };
14432
- var ld_edit_masked_textvue_type_script_lang_js_external_a;
14433
-
14434
-
14435
-
14436
-
14437
-
14438
-
14439
-
14440
-
14441
- let EditMaskedTextComponent = class EditMaskedTextComponent extends (0,external_vue_class_component_.mixins)(ValidatableMixin, GridMixin, InputMixin) {
14442
- constructor() {
14443
- super(...arguments);
14444
- this.internalValue = '';
14388
+ ;// CONCATENATED MODULE: ./src/utils/converting.ts
14389
+ function fileToArrayBuffer(src) {
14390
+ return new Promise(resolve => {
14391
+ const reader = new FileReader();
14392
+ reader.onloadend = function () {
14393
+ resolve(reader.result);
14394
+ };
14395
+ reader.readAsArrayBuffer(src);
14396
+ });
14397
+ }
14398
+ function fileToBase64(file) {
14399
+ return new Promise((resolve, reject) => {
14400
+ const reader = new FileReader();
14401
+ reader.readAsDataURL(file);
14402
+ reader.onload = () => {
14403
+ let fileStr = reader.result.toString();
14404
+ if (fileStr.includes(',')) {
14405
+ fileStr = fileStr.split(',')[1];
14406
+ }
14407
+ resolve(fileStr);
14408
+ };
14409
+ reader.onerror = error => reject(error);
14410
+ });
14411
+ }
14412
+ function base64ToUint8Array(base64) {
14413
+ if (!base64.trim()) {
14414
+ return null;
14445
14415
  }
14446
- emitUpdateModelValue(value) {
14447
- return value;
14416
+ const decrypted = window.atob(base64);
14417
+ let n = decrypted.length;
14418
+ const arr = new Uint8Array(n);
14419
+ while (n--) {
14420
+ arr[n] = decrypted.charCodeAt(n);
14448
14421
  }
14449
- onTextChanged() {
14450
- this.internalValue = this.modelValue ? String(this.modelValue) : '';
14451
- this.validate();
14422
+ return arr;
14423
+ }
14424
+ function Uint8ArrayToHex(bytes) {
14425
+ const hex = [];
14426
+ /* eslint-disable-next-line @typescript-eslint/prefer-for-of */
14427
+ for (let i = 0; i < bytes.length; i++) {
14428
+ const current = bytes[i] < 0 ? bytes[i] + 256 : bytes[i];
14429
+ /* eslint-disable-next-line no-bitwise */
14430
+ hex.push((current >>> 4).toString(16));
14431
+ /* eslint-disable-next-line no-bitwise */
14432
+ hex.push((current & 0xf).toString(16));
14452
14433
  }
14453
- created() {
14454
- this.internalValue = this.modelValue ? String(this.modelValue) : '';
14455
- if (this.form) {
14456
- this.form.register(this, null);
14457
- }
14434
+ return hex.join('');
14435
+ }
14436
+ function hexToArrayBuffer(hex) {
14437
+ hex = hex.replace(/^0x/, '');
14438
+ if (hex.length % 2 != 0) {
14439
+ // console.log('WARNING: expecting an even number of characters in the hexString');
14458
14440
  }
14459
- unmounted() {
14460
- if (this.form) {
14461
- this.form.unregister(this, null);
14462
- }
14441
+ const bad = hex.match(/[\sg-z]/i);
14442
+ if (bad) {
14443
+ // console.log('WARNING: found non-hex characters', bad);
14463
14444
  }
14464
- onBlur() {
14465
- if (this.validateOnBlur) {
14466
- this.validate();
14467
- }
14445
+ const pairs = hex.match(/[\da-f]{2}/gi);
14446
+ const result = [];
14447
+ for (const s of pairs) {
14448
+ result.push(parseInt(s, 16));
14468
14449
  }
14469
- onClick() {
14470
- this.validationMessage = '';
14450
+ return result;
14451
+ }
14452
+ function uint8ArrayToBase64(value) {
14453
+ const bin = value.reduce((acc, i) => (acc += String.fromCharCode.apply(null, [i])), '');
14454
+ return window.btoa(bin);
14455
+ }
14456
+ function arrayBufferToUint8Array(value) {
14457
+ return new Uint8Array(value);
14458
+ }
14459
+
14460
+
14461
+ ;// CONCATENATED MODULE: ./src/utils/deepValueGetter.ts
14462
+ /**
14463
+ * Returns a deep object given a string. zoo['animal.type']
14464
+ * @param {object} obj
14465
+ * @param {string} path
14466
+ */
14467
+ function deepValueGetter(obj, path) {
14468
+ if (obj === null) {
14469
+ return '';
14471
14470
  }
14472
- onInput(e) {
14473
- const emitData = e?.length ? e?.replace(/\s|(-)/g, '') : null;
14474
- this.emitUpdateModelValue(emitData);
14471
+ if (!obj || !path) {
14472
+ return obj;
14475
14473
  }
14476
- validate() {
14477
- let funcResult = null;
14478
- this.validationMessage = '';
14479
- if (typeof this.mask === 'string' &&
14480
- /[ ()-]/.test(this.internalValue) &&
14481
- this.internalValue.length > 0 &&
14482
- this.mask.replace(/[ ()-]/g, '').length > this.internalValue.length) {
14483
- this.validationMessage = 'Недостаточное количество символов';
14484
- return !this.validationMessage;
14485
- }
14486
- this.validRules.forEach(func => {
14487
- funcResult = func(this.modelValue);
14488
- if (funcResult !== true) {
14489
- this.validationMessage = funcResult;
14474
+ const value = obj[path];
14475
+ // eslint-disable-next-line no-undefined
14476
+ if (value !== undefined) {
14477
+ return value;
14478
+ }
14479
+ let current = obj;
14480
+ const split = path.split('.');
14481
+ if (split.length) {
14482
+ for (const key of split) {
14483
+ current = current[key];
14484
+ // if found undefined, return empty string
14485
+ // eslint-disable-next-line no-undefined
14486
+ if (current === undefined || current === null) {
14487
+ return '';
14490
14488
  }
14491
- });
14492
- return !this.validationMessage;
14489
+ }
14493
14490
  }
14494
- get showError() {
14495
- return Boolean(this.validationMessage);
14491
+ return current;
14492
+ }
14493
+
14494
+ ;// CONCATENATED MODULE: ./src/utils/delay.ts
14495
+ async function delay(timeout) {
14496
+ return new Promise(resolve => setTimeout(() => resolve(), timeout));
14497
+ }
14498
+
14499
+ ;// CONCATENATED MODULE: ./src/utils/isObjectEmpty.ts
14500
+ function isObjectEmpty(obj) {
14501
+ for (const _i in obj) {
14502
+ return false;
14496
14503
  }
14497
- get warningHint() {
14498
- return Boolean(this.validationMessage);
14504
+ return true;
14505
+ }
14506
+
14507
+ ;// CONCATENATED MODULE: ./src/utils/pluralizeNoun.ts
14508
+ function pluralizeNoun(num, one, two, five, printNum = true) {
14509
+ if (!num) {
14510
+ return '';
14499
14511
  }
14500
- };
14501
- ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14502
- (0,external_vue_property_decorator_.Prop)({ default: '' }),
14503
- ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", Object)
14504
- ], EditMaskedTextComponent.prototype, "modelValue", void 0);
14505
- ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14506
- (0,external_vue_property_decorator_.Prop)(),
14507
- ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", Object)
14508
- ], EditMaskedTextComponent.prototype, "mask", void 0);
14509
- ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14510
- (0,external_vue_property_decorator_.Prop)(),
14511
- ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", Number)
14512
- ], EditMaskedTextComponent.prototype, "scale", void 0);
14513
- ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14514
- (0,external_vue_property_decorator_.Prop)(),
14515
- ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", String)
14516
- ], EditMaskedTextComponent.prototype, "thousandsSeparator", void 0);
14517
- ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14518
- (0,external_vue_property_decorator_.Prop)(),
14519
- ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", Boolean)
14520
- ], EditMaskedTextComponent.prototype, "signed", void 0);
14521
- ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14522
- (0,external_vue_property_decorator_.Prop)(),
14523
- ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", typeof (ld_edit_masked_textvue_type_script_lang_js_external_a = typeof Array !== "undefined" && Array) === "function" ? ld_edit_masked_textvue_type_script_lang_js_external_a : Object)
14524
- ], EditMaskedTextComponent.prototype, "mapToRadix", void 0);
14525
- ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14526
- (0,external_vue_property_decorator_.Prop)({ default: false, type: Boolean }),
14527
- ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", Boolean)
14528
- ], EditMaskedTextComponent.prototype, "clearIcon", void 0);
14529
- ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14512
+ let n;
14513
+ if (typeof num === 'string') {
14514
+ n = Number(num.match(/\d+\.?\d*/g));
14515
+ }
14516
+ else {
14517
+ n = Math.abs(num);
14518
+ }
14519
+ n %= 100;
14520
+ if (n >= 5 && n <= 20) {
14521
+ return printNum ? `${num} ${five}` : `${five}`;
14522
+ }
14523
+ n %= 10;
14524
+ if (n === 1) {
14525
+ return printNum ? `${num} ${one}` : `${one}`;
14526
+ }
14527
+ if (n >= 2 && n <= 4) {
14528
+ return printNum ? `${num} ${two}` : `${two}`;
14529
+ }
14530
+ return printNum ? `${num} ${five}` : `${five}`;
14531
+ }
14532
+
14533
+ ;// CONCATENATED MODULE: ./src/utils/strings.ts
14534
+ class Strings {
14535
+ camelCase(str) {
14536
+ // Replace special characters with a space
14537
+ str = str.replace(/[^\d A-Za-z]/g, ' ');
14538
+ // put a space before an uppercase letter
14539
+ str = str.replace(/([a-z](?=[A-Z]))/g, '$1 ');
14540
+ // Lower case first character and some other stuff
14541
+ str = str
14542
+ .replace(/([^\d A-Za-z])|^\d+/g, '')
14543
+ .trim()
14544
+ .toLowerCase();
14545
+ // uppercase characters preceded by a space or number
14546
+ str = str.replace(/([\d ]+)([A-Za-z])/g, (a, b, c) => b.trim() + c.toUpperCase());
14547
+ return str;
14548
+ }
14549
+ capitalize(str) {
14550
+ if (!str) {
14551
+ return str;
14552
+ }
14553
+ const first = str[0];
14554
+ const other = str.substring(1);
14555
+ return `${first.toUpperCase()}${other}`;
14556
+ }
14557
+ }
14558
+ const strings = new Strings();
14559
+
14560
+
14561
+ ;// CONCATENATED MODULE: ./src/utils/urlRegexp.ts
14562
+ const urlRegexp =
14563
+ // eslint-disable-next-line optimize-regex/optimize-regex
14564
+ /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\\[\]{};:'".,<>?«»“”‘’]))/i;
14565
+
14566
+ ;// CONCATENATED MODULE: ./src/utils/index.ts
14567
+
14568
+
14569
+
14570
+
14571
+
14572
+
14573
+
14574
+
14575
+
14576
+
14577
+
14578
+
14579
+
14580
+ ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-text-viewer/ld-text-viewer.ts?vue&type=script&lang=js&external
14581
+ var ld_text_viewervue_type_script_lang_js_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
14582
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
14583
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
14584
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
14585
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
14586
+ };
14587
+ var ld_text_viewervue_type_script_lang_js_external_metadata = (undefined && undefined.__metadata) || function (k, v) {
14588
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
14589
+ };
14590
+
14591
+
14592
+
14593
+
14594
+
14595
+
14596
+ /**
14597
+ * @displayName ld-text-viewer
14598
+ */
14599
+ let CardTextViewer = class CardTextViewer extends (0,external_vue_class_component_.mixins)(GridMixin) {
14600
+ hasSlotContent(slot, slotProps = {}) {
14601
+ if (!slot) {
14602
+ return false;
14603
+ }
14604
+ return slot(slotProps).some((vnode) => {
14605
+ if (vnode.type === external_vue_.Comment) {
14606
+ return false;
14607
+ }
14608
+ if (Array.isArray(vnode.children) && !vnode.children.length) {
14609
+ return false;
14610
+ }
14611
+ return vnode.type !== external_vue_.Text || (typeof vnode.children === 'string' && vnode.children.trim() !== '');
14612
+ });
14613
+ }
14614
+ get hasSlot() {
14615
+ return this.hasSlotContent(this.$slots.default);
14616
+ }
14617
+ get isTextSlotOnly() {
14618
+ if (this.hasSlot) {
14619
+ return this.$slots.default().every((vnode) => typeof vnode.children === 'string');
14620
+ }
14621
+ return false;
14622
+ }
14623
+ get src() {
14624
+ if (this.text) {
14625
+ return String(this.text).replace(/\n/g, '<br>');
14626
+ }
14627
+ if (this.hasSlot && this.isTextSlotOnly) {
14628
+ const slots = this.$slots.default();
14629
+ let result = '';
14630
+ for (const s of slots) {
14631
+ result += s.children.trim();
14632
+ }
14633
+ return result;
14634
+ }
14635
+ return '';
14636
+ }
14637
+ get textWithHyperlinks() {
14638
+ if (!this.src) {
14639
+ return;
14640
+ }
14641
+ if (this.activeLinks) {
14642
+ const globalUrlRegExp = new RegExp(urlRegexp, 'ig');
14643
+ return this.src.replace(globalUrlRegExp, '<a href="$1" target="_blank">$1</a>');
14644
+ }
14645
+ return this.src;
14646
+ }
14647
+ get showPlaceholder() {
14648
+ return !this.src && !this.hasSlot;
14649
+ }
14650
+ };
14651
+ ld_text_viewervue_type_script_lang_js_external_decorate([
14652
+ (0,external_vue_property_decorator_.Prop)({ type: Boolean, default: false }),
14653
+ ld_text_viewervue_type_script_lang_js_external_metadata("design:type", Boolean)
14654
+ ], CardTextViewer.prototype, "activeLinks", void 0);
14655
+ ld_text_viewervue_type_script_lang_js_external_decorate([
14530
14656
  (0,external_vue_property_decorator_.Prop)(),
14531
- ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", String)
14532
- ], EditMaskedTextComponent.prototype, "inputHint", void 0);
14533
- ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14534
- (0,external_vue_property_decorator_.Inject)({ from: 'form', default: null }),
14535
- ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", Object)
14536
- ], EditMaskedTextComponent.prototype, "form", void 0);
14537
- ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14538
- Emit('update:model-value'),
14539
- ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", Function),
14540
- ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:paramtypes", [String]),
14541
- ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:returntype", void 0)
14542
- ], EditMaskedTextComponent.prototype, "emitUpdateModelValue", null);
14543
- ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14544
- (0,external_vue_property_decorator_.Watch)('modelValue'),
14545
- ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", Function),
14546
- ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:paramtypes", []),
14547
- ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:returntype", void 0)
14548
- ], EditMaskedTextComponent.prototype, "onTextChanged", null);
14549
- EditMaskedTextComponent = ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14550
- (0,external_vue_property_decorator_.Options)({
14657
+ ld_text_viewervue_type_script_lang_js_external_metadata("design:type", Object)
14658
+ ], CardTextViewer.prototype, "text", void 0);
14659
+ ld_text_viewervue_type_script_lang_js_external_decorate([
14660
+ (0,external_vue_property_decorator_.Prop)({ type: Boolean, default: false }),
14661
+ ld_text_viewervue_type_script_lang_js_external_metadata("design:type", Boolean)
14662
+ ], CardTextViewer.prototype, "alignLabelToRight", void 0);
14663
+ CardTextViewer = ld_text_viewervue_type_script_lang_js_external_decorate([
14664
+ (0,external_vue_class_component_.Options)({
14551
14665
  components: {
14552
- 'ld-label': ld_label,
14553
- 'imask-input': imask_js_.IMaskComponent,
14666
+ 'ld-label': ld_label
14554
14667
  },
14555
14668
  })
14556
- ], EditMaskedTextComponent);
14557
- /* harmony default export */ const ld_edit_masked_textvue_type_script_lang_js_external = (EditMaskedTextComponent);
14669
+ ], CardTextViewer);
14670
+ /* harmony default export */ const ld_text_viewervue_type_script_lang_js_external = (CardTextViewer);
14558
14671
 
14559
- ;// CONCATENATED MODULE: ./src/ld-edit-masked-text/ld-edit-masked-text.ts?vue&type=script&lang=js&external
14672
+ ;// CONCATENATED MODULE: ./src/ld-text-viewer/ld-text-viewer.ts?vue&type=script&lang=js&external
14560
14673
 
14561
- ;// CONCATENATED MODULE: ./src/ld-edit-masked-text/ld-edit-masked-text.vue
14674
+ ;// CONCATENATED MODULE: ./src/ld-text-viewer/ld-text-viewer.vue
14562
14675
 
14563
14676
 
14564
14677
 
@@ -14566,38 +14679,34 @@ EditMaskedTextComponent = ld_edit_masked_textvue_type_script_lang_js_external_de
14566
14679
  ;
14567
14680
 
14568
14681
 
14569
- const ld_edit_masked_text_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(ld_edit_masked_textvue_type_script_lang_js_external, [['render',ld_edit_masked_textvue_type_template_id_33aa4ec6_scoped_true_render],['__scopeId',"data-v-33aa4ec6"]])
14682
+ const ld_text_viewer_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(ld_text_viewervue_type_script_lang_js_external, [['render',ld_text_viewervue_type_template_id_26123e5c_scoped_true_render],['__scopeId',"data-v-26123e5c"]])
14570
14683
 
14571
- /* harmony default export */ const ld_edit_masked_text = (ld_edit_masked_text_exports_);
14572
- ;// CONCATENATED MODULE: ./src/ld-edit-masked-text/index.ts
14684
+ /* harmony default export */ const ld_text_viewer = (ld_text_viewer_exports_);
14685
+ ;// CONCATENATED MODULE: ./src/ld-text-viewer/index.ts
14573
14686
 
14574
- function ld_edit_masked_text_reg(vue, options) {
14575
- vue.component(options.aliases['ld-edit-masked-text'], ld_edit_masked_text);
14687
+ function ld_text_viewer_reg(vue, options) {
14688
+ vue.component(options.aliases['ld-text-viewer'], ld_text_viewer);
14576
14689
  }
14577
- /* harmony default export */ const src_ld_edit_masked_text = (ld_edit_masked_text_reg);
14690
+ /* harmony default export */ const src_ld_text_viewer = (ld_text_viewer_reg);
14578
14691
 
14579
- ;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use!./src/ld-text-markup/ld-text-markup.vue?vue&type=template&id=12e81c9c&scoped=true
14692
+ ;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use!./src/ld-edit-masked-text/ld-edit-masked-text.vue?vue&type=template&id=33aa4ec6&scoped=true
14580
14693
 
14581
14694
 
14582
- const ld_text_markupvue_type_template_id_12e81c9c_scoped_true_withScopeId = n => (_pushScopeId("data-v-12e81c9c"),n=n(),_popScopeId(),n)
14583
- const ld_text_markupvue_type_template_id_12e81c9c_scoped_true_hoisted_1 = { class: "ld-text-markup" }
14584
- const ld_text_markupvue_type_template_id_12e81c9c_scoped_true_hoisted_2 = { class: "tabs-wrapper" }
14585
- const ld_text_markupvue_type_template_id_12e81c9c_scoped_true_hoisted_3 = {
14586
- key: "editor",
14587
- class: "content editorbox",
14588
- style: {"visibility":"hidden"},
14589
- id: "editorbox"
14695
+ const ld_edit_masked_textvue_type_template_id_33aa4ec6_scoped_true_withScopeId = n => (_pushScopeId("data-v-33aa4ec6"),n=n(),_popScopeId(),n)
14696
+ const ld_edit_masked_textvue_type_template_id_33aa4ec6_scoped_true_hoisted_1 = { class: "ld-edit-masked-text" }
14697
+ const ld_edit_masked_textvue_type_template_id_33aa4ec6_scoped_true_hoisted_2 = {
14698
+ key: 0,
14699
+ class: "ld-edit-masked-text-validate"
14590
14700
  }
14591
14701
 
14592
- function ld_text_markupvue_type_template_id_12e81c9c_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
14702
+ function ld_edit_masked_textvue_type_template_id_33aa4ec6_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
14593
14703
  const _component_ld_label = (0,external_vue_.resolveComponent)("ld-label")
14594
- const _component_v_btn = (0,external_vue_.resolveComponent)("v-btn")
14595
- const _component_v_runtime_template = (0,external_vue_.resolveComponent)("v-runtime-template")
14596
- const _component_md_editor = (0,external_vue_.resolveComponent)("md-editor")
14704
+ const _component_ld_icon = (0,external_vue_.resolveComponent)("ld-icon")
14705
+ const _component_imask_input = (0,external_vue_.resolveComponent)("imask-input")
14597
14706
  const _component_v_col = (0,external_vue_.resolveComponent)("v-col")
14598
14707
  const _component_v_row = (0,external_vue_.resolveComponent)("v-row")
14599
14708
 
14600
- return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_text_markupvue_type_template_id_12e81c9c_scoped_true_hoisted_1, [
14709
+ return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_edit_masked_textvue_type_template_id_33aa4ec6_scoped_true_hoisted_1, [
14601
14710
  (0,external_vue_.createVNode)(_component_v_row, { "no-gutters": "" }, {
14602
14711
  default: (0,external_vue_.withCtx)(() => [
14603
14712
  (_ctx.label)
@@ -14611,205 +14720,75 @@ function ld_text_markupvue_type_template_id_12e81c9c_scoped_true_render(_ctx, _c
14611
14720
  : (0,external_vue_.createCommentVNode)("", true),
14612
14721
  (0,external_vue_.createTextVNode)(),
14613
14722
  (0,external_vue_.createVNode)(_component_v_col, {
14614
- class: (0,external_vue_.normalizeClass)([_ctx.inputSizeClasses, "pa-1 content-wrapper"])
14723
+ class: (0,external_vue_.normalizeClass)(["d-flex flex-column", _ctx.inputSizeClasses])
14615
14724
  }, {
14616
14725
  default: (0,external_vue_.withCtx)(() => [
14617
- (0,external_vue_.createElementVNode)("div", ld_text_markupvue_type_template_id_12e81c9c_scoped_true_hoisted_2, [
14618
- (0,external_vue_.createVNode)(_component_v_btn, {
14619
- class: (0,external_vue_.normalizeClass)(["small-button", { active: !_ctx.isPreviewActive }]),
14620
- variant: "outlined",
14621
- disabled: _ctx.readonly,
14622
- onClick: _ctx.onPreviewChanged
14623
- }, {
14624
- default: (0,external_vue_.withCtx)(() => [
14625
- (0,external_vue_.createElementVNode)("span", {
14626
- class: (0,external_vue_.normalizeClass)({ 'text-color': !_ctx.isPreviewActive })
14627
- }, "Текст", 2)
14628
- ]),
14629
- _: 1
14630
- }, 8, ["class", "disabled", "onClick"]),
14631
- (0,external_vue_.createTextVNode)(),
14632
- (0,external_vue_.createVNode)(_component_v_btn, {
14633
- class: (0,external_vue_.normalizeClass)(["small-button", { active: _ctx.isPreviewActive }]),
14634
- variant: "outlined",
14635
- onClick: _ctx.onPreviewChanged
14636
- }, {
14637
- default: (0,external_vue_.withCtx)(() => [
14638
- (0,external_vue_.createElementVNode)("span", {
14639
- class: (0,external_vue_.normalizeClass)({ 'text-color': _ctx.isPreviewActive })
14640
- }, "Превью", 2)
14641
- ]),
14642
- _: 1
14643
- }, 8, ["class", "onClick"])
14644
- ]),
14645
- (0,external_vue_.createTextVNode)(),
14646
- (_ctx.isPreviewActive)
14647
- ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_v_runtime_template, {
14648
- key: 0,
14649
- template: _ctx.template,
14650
- id: "contentbox"
14651
- }, null, 8, ["template"]))
14652
- : (0,external_vue_.createCommentVNode)("", true),
14726
+ (0,external_vue_.createVNode)(_component_imask_input, {
14727
+ ref: "imask",
14728
+ radix: ",",
14729
+ value: _ctx.internalValue,
14730
+ "onUpdate:value": _cache[1] || (_cache[1] = $event => ((_ctx.internalValue) = $event)),
14731
+ mask: _ctx.mask,
14732
+ scale: _ctx.scale,
14733
+ "thousands-separator": _ctx.thousandsSeparator,
14734
+ signed: _ctx.signed,
14735
+ mapToRadix: _ctx.mapToRadix,
14736
+ placeholder: _ctx.placeholder,
14737
+ "onAccept:masked": _ctx.onInput,
14738
+ onBlur: _ctx.onBlur,
14739
+ onClick: _ctx.onClick
14740
+ }, {
14741
+ "append-inner": (0,external_vue_.withCtx)(() => [
14742
+ (_ctx.clearIcon && _ctx.text)
14743
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_ld_icon, {
14744
+ key: 0,
14745
+ color: "error",
14746
+ onClick: _cache[0] || (_cache[0] = $event => (_ctx.emitUpdateModelValue('')))
14747
+ }, {
14748
+ default: (0,external_vue_.withCtx)(() => [
14749
+ (0,external_vue_.createTextVNode)("close")
14750
+ ]),
14751
+ _: 1
14752
+ }))
14753
+ : (0,external_vue_.createCommentVNode)("", true)
14754
+ ]),
14755
+ _: 1
14756
+ }, 8, ["value", "mask", "scale", "thousands-separator", "signed", "mapToRadix", "placeholder", "onAccept:masked", "onBlur", "onClick"]),
14653
14757
  (0,external_vue_.createTextVNode)(),
14654
- (0,external_vue_.withDirectives)((0,external_vue_.createElementVNode)("div", ld_text_markupvue_type_template_id_12e81c9c_scoped_true_hoisted_3, [
14655
- (0,external_vue_.createVNode)(_component_md_editor, {
14656
- modelValue: _ctx.value,
14657
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((_ctx.value) = $event)),
14658
- ref: "editor",
14659
- language: "ru_RU",
14660
- preview: false,
14661
- toolbars: _ctx.toolbars,
14662
- footers: [],
14663
- onOnChange: _ctx.onEditorTextChange
14664
- }, null, 8, ["modelValue", "toolbars", "onOnChange"])
14665
- ], 512), [
14666
- [external_vue_.vShow, !_ctx.isPreviewActive]
14667
- ])
14758
+ (!_ctx.hideDetails)
14759
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_edit_masked_textvue_type_template_id_33aa4ec6_scoped_true_hoisted_2, [
14760
+ (0,external_vue_.createVNode)(external_vue_.Transition, { name: "squash" }, {
14761
+ default: (0,external_vue_.withCtx)(() => [
14762
+ (0,external_vue_.createElementVNode)("span", {
14763
+ style: {"line-height":"12px","font-size":"var(--font-size--1)"},
14764
+ class: (0,external_vue_.normalizeClass)({ 'error--text': _ctx.warningHint })
14765
+ }, (0,external_vue_.toDisplayString)(_ctx.validationMessage || _ctx.inputHint), 3)
14766
+ ]),
14767
+ _: 1
14768
+ })
14769
+ ]))
14770
+ : (0,external_vue_.createCommentVNode)("", true)
14668
14771
  ]),
14669
14772
  _: 1
14670
14773
  }, 8, ["class"])
14671
14774
  ]),
14672
14775
  _: 1
14673
- }),
14674
- (0,external_vue_.createTextVNode)(),
14675
- (!_ctx.hideDetails)
14676
- ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_v_row, {
14677
- key: 0,
14678
- "no-gutters": "",
14679
- class: "ld-text-markup-validate"
14680
- }, {
14681
- default: (0,external_vue_.withCtx)(() => [
14682
- (0,external_vue_.createVNode)(_component_v_col, {
14683
- class: (0,external_vue_.normalizeClass)([_ctx.labelSizeClasses])
14684
- }, null, 8, ["class"]),
14685
- (0,external_vue_.createTextVNode)(),
14686
- (0,external_vue_.createVNode)(_component_v_col, {
14687
- class: (0,external_vue_.normalizeClass)(_ctx.inputSizeClasses)
14688
- }, {
14689
- default: (0,external_vue_.withCtx)(() => [
14690
- (0,external_vue_.createVNode)(external_vue_.Transition, { name: "squash" }, {
14691
- default: (0,external_vue_.withCtx)(() => [
14692
- (_ctx.showError)
14693
- ? (0,external_vue_.withDirectives)(((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("span", {
14694
- key: 0,
14695
- class: "error--text",
14696
- style: {"font-size":"var(--font-size--1)"}
14697
- }, (0,external_vue_.toDisplayString)(_ctx.validationMessage), 513)), [
14698
- [external_vue_.vShow, _ctx.showError]
14699
- ])
14700
- : (0,external_vue_.createCommentVNode)("", true)
14701
- ]),
14702
- _: 1
14703
- })
14704
- ]),
14705
- _: 1
14706
- }, 8, ["class"])
14707
- ]),
14708
- _: 1
14709
- }))
14710
- : (0,external_vue_.createCommentVNode)("", true)
14776
+ })
14711
14777
  ]))
14712
14778
  }
14713
- ;// CONCATENATED MODULE: ./src/ld-text-markup/ld-text-markup.vue?vue&type=template&id=12e81c9c&scoped=true
14714
-
14715
- ;// CONCATENATED MODULE: ./src/ld-text-markup/translation.ts
14716
- /* eslint-disable @typescript-eslint/naming-convention */
14717
- const ru_RU = {
14718
- toolbarTips: {
14719
- bold: 'Полужирный',
14720
- underline: 'Подчеркнутый',
14721
- italic: 'Курсив',
14722
- strikeThrough: 'strikeThrough',
14723
- title: 'Заголовок',
14724
- sub: 'subscript',
14725
- sup: 'superscript',
14726
- quote: 'quote',
14727
- unorderedList: 'Список',
14728
- orderedList: 'Нумерованный список',
14729
- task: 'task list',
14730
- codeRow: 'Программый код',
14731
- code: 'block-level code',
14732
- link: 'Создать ссылку',
14733
- image: 'image',
14734
- table: 'Добавить таблицу',
14735
- mermaid: 'mermaid',
14736
- katex: 'formula',
14737
- revoke: 'revoke',
14738
- next: 'undo revoke',
14739
- save: 'save',
14740
- prettier: 'prettier',
14741
- pageFullscreen: 'fullscreen in page',
14742
- fullscreen: 'fullscreen',
14743
- preview: 'Превью',
14744
- htmlPreview: 'html preview',
14745
- catalog: 'catalog',
14746
- github: 'source code',
14747
- },
14748
- titleItem: {
14749
- h1: 'Заголовок 1 уровня',
14750
- h2: 'Заголовок 2 уровня',
14751
- h3: 'Заголовок 3 уровня',
14752
- h4: 'Заголовок 4 уровня',
14753
- h5: 'Заголовок 5 уровня',
14754
- h6: 'Заголовок 6 уровня',
14755
- },
14756
- imgTitleItem: {
14757
- link: 'Add Img Link',
14758
- upload: 'Upload Img',
14759
- clip2upload: 'Clip Upload',
14760
- },
14761
- linkModalTips: {
14762
- descLabel: 'Описание',
14763
- descLabelPlaceHolder: 'Текст для отображения',
14764
- urlLabel: 'Ссылка',
14765
- urlLabelPlaceHolder: 'Адрес ссылки',
14766
- buttonOK: 'Сохранить',
14767
- },
14768
- clipModalTips: {
14769
- title: 'Crop Image',
14770
- buttonUpload: 'Upload',
14771
- },
14772
- copyCode: {
14773
- text: 'Copy',
14774
- successTips: 'Copied!',
14775
- failTips: 'Copy failed!',
14776
- },
14777
- mermaid: {
14778
- flow: 'flow',
14779
- sequence: 'sequence',
14780
- gantt: 'gantt',
14781
- class: 'class',
14782
- state: 'state',
14783
- pie: 'pie',
14784
- relationship: 'relationship',
14785
- journey: 'journey',
14786
- },
14787
- katex: {
14788
- inline: 'inline',
14789
- block: 'block',
14790
- },
14791
- footer: {
14792
- markdownTotal: 'Всего слов',
14793
- scrollAuto: 'Автопрокрутка',
14794
- },
14795
- };
14796
- /* harmony default export */ const translation = (ru_RU);
14779
+ ;// CONCATENATED MODULE: ./src/ld-edit-masked-text/ld-edit-masked-text.vue?vue&type=template&id=33aa4ec6&scoped=true
14797
14780
 
14798
- // EXTERNAL MODULE: external "./lib/runtime-template.js"
14799
- var runtime_template_js_ = __webpack_require__(9435);
14800
- var runtime_template_js_default = /*#__PURE__*/__webpack_require__.n(runtime_template_js_);
14801
- // EXTERNAL MODULE: external "md-editor-v3"
14802
- var external_md_editor_v3_ = __webpack_require__(6443);
14803
- ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-text-markup/ld-text-markup.ts?vue&type=script&lang=js&external
14804
- var ld_text_markupvue_type_script_lang_js_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
14781
+ ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-edit-masked-text/ld-edit-masked-text.ts?vue&type=script&lang=js&external
14782
+ var ld_edit_masked_textvue_type_script_lang_js_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
14805
14783
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
14806
14784
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
14807
14785
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
14808
14786
  return c > 3 && r && Object.defineProperty(target, key, r), r;
14809
14787
  };
14810
- var ld_text_markupvue_type_script_lang_js_external_metadata = (undefined && undefined.__metadata) || function (k, v) {
14788
+ var ld_edit_masked_textvue_type_script_lang_js_external_metadata = (undefined && undefined.__metadata) || function (k, v) {
14811
14789
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
14812
14790
  };
14791
+ var ld_edit_masked_textvue_type_script_lang_js_external_a;
14813
14792
 
14814
14793
 
14815
14794
 
@@ -14818,74 +14797,22 @@ var ld_text_markupvue_type_script_lang_js_external_metadata = (undefined && unde
14818
14797
 
14819
14798
 
14820
14799
 
14821
-
14822
-
14823
- /**
14824
- * @displayName ld-text-markup
14825
- */
14826
- let TextMarkupComponent = class TextMarkupComponent extends (0,external_vue_class_component_.mixins)(ValidatableMixin, GridMixin, InputMixin) {
14800
+ let EditMaskedTextComponent = class EditMaskedTextComponent extends (0,external_vue_class_component_.mixins)(ValidatableMixin, GridMixin, InputMixin) {
14827
14801
  constructor() {
14828
14802
  super(...arguments);
14829
- /**
14830
- * html
14831
- */
14832
- this.template = '';
14833
- /**
14834
- * markdown
14835
- */
14836
- this.value = '';
14837
- this.isPreviewActive = false;
14838
- this.md = null;
14839
- this.previewWatchDisabled = false;
14803
+ this.internalValue = '';
14840
14804
  }
14841
- emitInput() {
14842
- return this.value;
14805
+ emitUpdateModelValue(value) {
14806
+ return value;
14843
14807
  }
14844
- emitPreview() {
14845
- return this.isPreviewActive;
14808
+ onTextChanged() {
14809
+ this.internalValue = this.modelValue ? String(this.modelValue) : '';
14810
+ this.validate();
14846
14811
  }
14847
- onValueChanged() {
14848
- if (!this.value && this.required) {
14849
- this.validate();
14850
- }
14851
- if (this.value) {
14852
- this.validationMessage = '';
14853
- }
14854
- }
14855
- onReadonlyChanged() {
14856
- if (this.readonly && !this.isPreviewActive) {
14857
- this.togglePreview();
14858
- }
14859
- }
14860
- async onPreviewChanged() {
14861
- if (this.previewWatchDisabled) {
14862
- return;
14863
- }
14864
- this.previewWatchDisabled = true;
14865
- await this.toggleClick();
14866
- await this.$nextTick();
14867
- this.previewWatchDisabled = false;
14868
- }
14869
- created() {
14870
- (0,external_md_editor_v3_.config)({
14871
- editorConfig: {
14872
- languageUserDefined: {
14873
- /* eslint-disable-next-line @typescript-eslint/naming-convention */
14874
- ru_RU: translation,
14875
- },
14876
- },
14877
- });
14878
- if (this.form) {
14879
- this.form.register(this, null);
14880
- }
14881
- }
14882
- async mounted() {
14883
- const markdownIt = (await Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 8461, 23))).default;
14884
- const md = new markdownIt();
14885
- this.md = md;
14886
- this.buildEditor();
14887
- if (this.form) {
14888
- this.form?.register(this, null);
14812
+ created() {
14813
+ this.internalValue = this.modelValue ? String(this.modelValue) : '';
14814
+ if (this.form) {
14815
+ this.form.register(this, null);
14889
14816
  }
14890
14817
  }
14891
14818
  unmounted() {
@@ -14893,136 +14820,104 @@ let TextMarkupComponent = class TextMarkupComponent extends (0,external_vue_clas
14893
14820
  this.form.unregister(this, null);
14894
14821
  }
14895
14822
  }
14896
- onEditorTextChange(value) {
14897
- this.value = value;
14898
- this.emitInput();
14899
- }
14900
- async togglePreview() {
14901
- this.isPreviewActive = !this.isPreviewActive;
14902
- if (this.isPreviewActive) {
14903
- this.previewRender(this.value);
14904
- await this.$nextTick();
14823
+ onBlur() {
14824
+ if (this.validateOnBlur) {
14825
+ this.validate();
14905
14826
  }
14906
- this.emitPreview();
14907
14827
  }
14908
- async toggleClick() {
14909
- if (this.readonly || this.disabled) {
14910
- return;
14911
- }
14912
- await this.togglePreview();
14828
+ onClick() {
14829
+ this.validationMessage = '';
14830
+ }
14831
+ onInput(e) {
14832
+ const emitData = e?.length ? e?.replace(/\s|(-)/g, '') : null;
14833
+ this.emitUpdateModelValue(emitData);
14913
14834
  }
14914
14835
  validate() {
14915
14836
  let funcResult = null;
14916
14837
  this.validationMessage = '';
14838
+ if (typeof this.mask === 'string' &&
14839
+ /[ ()-]/.test(this.internalValue) &&
14840
+ this.internalValue.length > 0 &&
14841
+ this.mask.replace(/[ ()-]/g, '').length > this.internalValue.length) {
14842
+ this.validationMessage = 'Недостаточное количество символов';
14843
+ return !this.validationMessage;
14844
+ }
14917
14845
  this.validRules.forEach(func => {
14918
- funcResult = func(this.value);
14846
+ funcResult = func(this.modelValue);
14919
14847
  if (funcResult !== true) {
14920
14848
  this.validationMessage = funcResult;
14921
14849
  }
14922
14850
  });
14923
14851
  return !this.validationMessage;
14924
14852
  }
14925
- buildEditor() {
14926
- this.value = this.modelValue;
14927
- if (this.preview || this.readonly) {
14928
- this.togglePreview();
14929
- }
14930
- const editorWrapper = document.getElementById('editorbox');
14931
- if (editorWrapper) {
14932
- editorWrapper.style.visibility = 'visible';
14933
- }
14934
- }
14935
- previewRender(plainText) {
14936
- plainText = plainText.replace(/\n\n/g, '\n <br> \n');
14937
- try {
14938
- let html = this.md.render(plainText);
14939
- html = html.replace(/&lt;br&gt;/g, '<br>');
14940
- this.template = '<div class="content contentbox"><div>' + html + '</div></div>';
14941
- }
14942
- catch (e) {
14943
- /* eslint-disable no-console */
14944
- console.error(e);
14945
- }
14946
- }
14947
14853
  get showError() {
14948
14854
  return Boolean(this.validationMessage);
14949
14855
  }
14950
- get toolbars() {
14951
- return [
14952
- 'bold',
14953
- 'underline',
14954
- 'italic',
14955
- '-',
14956
- 'title',
14957
- 'unorderedList',
14958
- 'orderedList',
14959
- '-',
14960
- 'codeRow',
14961
- 'code',
14962
- 'link',
14963
- ];
14856
+ get warningHint() {
14857
+ return Boolean(this.validationMessage);
14964
14858
  }
14965
14859
  };
14966
- ld_text_markupvue_type_script_lang_js_external_decorate([
14860
+ ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14861
+ (0,external_vue_property_decorator_.Prop)({ default: '' }),
14862
+ ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", Object)
14863
+ ], EditMaskedTextComponent.prototype, "modelValue", void 0);
14864
+ ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14967
14865
  (0,external_vue_property_decorator_.Prop)(),
14968
- ld_text_markupvue_type_script_lang_js_external_metadata("design:type", String)
14969
- ], TextMarkupComponent.prototype, "modelValue", void 0);
14970
- ld_text_markupvue_type_script_lang_js_external_decorate([
14971
- (0,external_vue_property_decorator_.Prop)({ default: false }),
14972
- ld_text_markupvue_type_script_lang_js_external_metadata("design:type", Boolean)
14973
- ], TextMarkupComponent.prototype, "preview", void 0);
14974
- ld_text_markupvue_type_script_lang_js_external_decorate([
14975
- (0,external_vue_property_decorator_.Prop)({ type: Boolean, default: false }),
14976
- ld_text_markupvue_type_script_lang_js_external_metadata("design:type", Boolean)
14977
- ], TextMarkupComponent.prototype, "persistentHint", void 0);
14978
- ld_text_markupvue_type_script_lang_js_external_decorate([
14866
+ ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", Object)
14867
+ ], EditMaskedTextComponent.prototype, "mask", void 0);
14868
+ ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14869
+ (0,external_vue_property_decorator_.Prop)(),
14870
+ ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", Number)
14871
+ ], EditMaskedTextComponent.prototype, "scale", void 0);
14872
+ ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14873
+ (0,external_vue_property_decorator_.Prop)(),
14874
+ ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", String)
14875
+ ], EditMaskedTextComponent.prototype, "thousandsSeparator", void 0);
14876
+ ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14877
+ (0,external_vue_property_decorator_.Prop)(),
14878
+ ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", Boolean)
14879
+ ], EditMaskedTextComponent.prototype, "signed", void 0);
14880
+ ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14881
+ (0,external_vue_property_decorator_.Prop)(),
14882
+ ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", typeof (ld_edit_masked_textvue_type_script_lang_js_external_a = typeof Array !== "undefined" && Array) === "function" ? ld_edit_masked_textvue_type_script_lang_js_external_a : Object)
14883
+ ], EditMaskedTextComponent.prototype, "mapToRadix", void 0);
14884
+ ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14885
+ (0,external_vue_property_decorator_.Prop)({ default: false, type: Boolean }),
14886
+ ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", Boolean)
14887
+ ], EditMaskedTextComponent.prototype, "clearIcon", void 0);
14888
+ ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14889
+ (0,external_vue_property_decorator_.Prop)(),
14890
+ ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", String)
14891
+ ], EditMaskedTextComponent.prototype, "inputHint", void 0);
14892
+ ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14979
14893
  (0,external_vue_property_decorator_.Inject)({ from: 'form', default: null }),
14980
- ld_text_markupvue_type_script_lang_js_external_metadata("design:type", Object)
14981
- ], TextMarkupComponent.prototype, "form", void 0);
14982
- ld_text_markupvue_type_script_lang_js_external_decorate([
14894
+ ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", Object)
14895
+ ], EditMaskedTextComponent.prototype, "form", void 0);
14896
+ ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14983
14897
  Emit('update:model-value'),
14984
- ld_text_markupvue_type_script_lang_js_external_metadata("design:type", Function),
14985
- ld_text_markupvue_type_script_lang_js_external_metadata("design:paramtypes", []),
14986
- ld_text_markupvue_type_script_lang_js_external_metadata("design:returntype", void 0)
14987
- ], TextMarkupComponent.prototype, "emitInput", null);
14988
- ld_text_markupvue_type_script_lang_js_external_decorate([
14989
- Emit('update:preview'),
14990
- ld_text_markupvue_type_script_lang_js_external_metadata("design:type", Function),
14991
- ld_text_markupvue_type_script_lang_js_external_metadata("design:paramtypes", []),
14992
- ld_text_markupvue_type_script_lang_js_external_metadata("design:returntype", void 0)
14993
- ], TextMarkupComponent.prototype, "emitPreview", null);
14994
- ld_text_markupvue_type_script_lang_js_external_decorate([
14995
- (0,external_vue_property_decorator_.Watch)('value'),
14996
- ld_text_markupvue_type_script_lang_js_external_metadata("design:type", Function),
14997
- ld_text_markupvue_type_script_lang_js_external_metadata("design:paramtypes", []),
14998
- ld_text_markupvue_type_script_lang_js_external_metadata("design:returntype", void 0)
14999
- ], TextMarkupComponent.prototype, "onValueChanged", null);
15000
- ld_text_markupvue_type_script_lang_js_external_decorate([
15001
- (0,external_vue_property_decorator_.Watch)('readonly'),
15002
- ld_text_markupvue_type_script_lang_js_external_metadata("design:type", Function),
15003
- ld_text_markupvue_type_script_lang_js_external_metadata("design:paramtypes", []),
15004
- ld_text_markupvue_type_script_lang_js_external_metadata("design:returntype", void 0)
15005
- ], TextMarkupComponent.prototype, "onReadonlyChanged", null);
15006
- ld_text_markupvue_type_script_lang_js_external_decorate([
15007
- (0,external_vue_property_decorator_.Watch)('preview'),
15008
- ld_text_markupvue_type_script_lang_js_external_metadata("design:type", Function),
15009
- ld_text_markupvue_type_script_lang_js_external_metadata("design:paramtypes", []),
15010
- ld_text_markupvue_type_script_lang_js_external_metadata("design:returntype", Promise)
15011
- ], TextMarkupComponent.prototype, "onPreviewChanged", null);
15012
- TextMarkupComponent = ld_text_markupvue_type_script_lang_js_external_decorate([
14898
+ ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", Function),
14899
+ ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:paramtypes", [String]),
14900
+ ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:returntype", void 0)
14901
+ ], EditMaskedTextComponent.prototype, "emitUpdateModelValue", null);
14902
+ ld_edit_masked_textvue_type_script_lang_js_external_decorate([
14903
+ (0,external_vue_property_decorator_.Watch)('modelValue'),
14904
+ ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:type", Function),
14905
+ ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:paramtypes", []),
14906
+ ld_edit_masked_textvue_type_script_lang_js_external_metadata("design:returntype", void 0)
14907
+ ], EditMaskedTextComponent.prototype, "onTextChanged", null);
14908
+ EditMaskedTextComponent = ld_edit_masked_textvue_type_script_lang_js_external_decorate([
15013
14909
  (0,external_vue_property_decorator_.Options)({
15014
14910
  components: {
15015
14911
  'ld-label': ld_label,
15016
- 'v-runtime-template': (runtime_template_js_default()),
15017
- 'md-editor': external_md_editor_v3_.MdEditor,
14912
+ 'imask-input': imask_js_.IMaskComponent,
15018
14913
  },
15019
14914
  })
15020
- ], TextMarkupComponent);
15021
- /* harmony default export */ const ld_text_markupvue_type_script_lang_js_external = (TextMarkupComponent);
14915
+ ], EditMaskedTextComponent);
14916
+ /* harmony default export */ const ld_edit_masked_textvue_type_script_lang_js_external = (EditMaskedTextComponent);
15022
14917
 
15023
- ;// CONCATENATED MODULE: ./src/ld-text-markup/ld-text-markup.ts?vue&type=script&lang=js&external
14918
+ ;// CONCATENATED MODULE: ./src/ld-edit-masked-text/ld-edit-masked-text.ts?vue&type=script&lang=js&external
15024
14919
 
15025
- ;// CONCATENATED MODULE: ./src/ld-text-markup/ld-text-markup.vue
14920
+ ;// CONCATENATED MODULE: ./src/ld-edit-masked-text/ld-edit-masked-text.vue
15026
14921
 
15027
14922
 
15028
14923
 
@@ -15030,65 +14925,529 @@ TextMarkupComponent = ld_text_markupvue_type_script_lang_js_external_decorate([
15030
14925
  ;
15031
14926
 
15032
14927
 
15033
- const ld_text_markup_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(ld_text_markupvue_type_script_lang_js_external, [['render',ld_text_markupvue_type_template_id_12e81c9c_scoped_true_render],['__scopeId',"data-v-12e81c9c"]])
14928
+ const ld_edit_masked_text_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(ld_edit_masked_textvue_type_script_lang_js_external, [['render',ld_edit_masked_textvue_type_template_id_33aa4ec6_scoped_true_render],['__scopeId',"data-v-33aa4ec6"]])
15034
14929
 
15035
- /* harmony default export */ const ld_text_markup = (ld_text_markup_exports_);
15036
- ;// CONCATENATED MODULE: ./src/ld-text-markup/index.ts
14930
+ /* harmony default export */ const ld_edit_masked_text = (ld_edit_masked_text_exports_);
14931
+ ;// CONCATENATED MODULE: ./src/ld-edit-masked-text/index.ts
15037
14932
 
15038
- function ld_text_markup_reg(vue, options) {
15039
- vue.component(options.aliases['ld-text-markup'], ld_text_markup);
14933
+ function ld_edit_masked_text_reg(vue, options) {
14934
+ vue.component(options.aliases['ld-edit-masked-text'], ld_edit_masked_text);
15040
14935
  }
15041
- /* harmony default export */ const src_ld_text_markup = (ld_text_markup_reg);
15042
-
15043
- ;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use!./src/ld-switch/ld-switch.vue?vue&type=template&id=89826e86&scoped=true
15044
-
14936
+ /* harmony default export */ const src_ld_edit_masked_text = (ld_edit_masked_text_reg);
15045
14937
 
15046
- const ld_switchvue_type_template_id_89826e86_scoped_true_withScopeId = n => (_pushScopeId("data-v-89826e86"),n=n(),_popScopeId(),n)
15047
- const ld_switchvue_type_template_id_89826e86_scoped_true_hoisted_1 = { class: "ld-switch" }
14938
+ ;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use!./src/ld-text-markup/ld-text-markup.vue?vue&type=template&id=12e81c9c&scoped=true
15048
14939
 
15049
- function ld_switchvue_type_template_id_89826e86_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
15050
- const _component_v_switch = (0,external_vue_.resolveComponent)("v-switch")
15051
14940
 
15052
- return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_switchvue_type_template_id_89826e86_scoped_true_hoisted_1, [
15053
- (0,external_vue_.createVNode)(_component_v_switch, {
15054
- modelValue: _ctx.value,
15055
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((_ctx.value) = $event)),
15056
- readonly: _ctx.readonly,
15057
- disabled: _ctx.disabled,
15058
- label: _ctx.label,
15059
- "hide-details": _ctx.hideDetails
15060
- }, null, 8, ["modelValue", "readonly", "disabled", "label", "hide-details"])
15061
- ]))
14941
+ const ld_text_markupvue_type_template_id_12e81c9c_scoped_true_withScopeId = n => (_pushScopeId("data-v-12e81c9c"),n=n(),_popScopeId(),n)
14942
+ const ld_text_markupvue_type_template_id_12e81c9c_scoped_true_hoisted_1 = { class: "ld-text-markup" }
14943
+ const ld_text_markupvue_type_template_id_12e81c9c_scoped_true_hoisted_2 = { class: "tabs-wrapper" }
14944
+ const ld_text_markupvue_type_template_id_12e81c9c_scoped_true_hoisted_3 = {
14945
+ key: "editor",
14946
+ class: "content editorbox",
14947
+ style: {"visibility":"hidden"},
14948
+ id: "editorbox"
15062
14949
  }
15063
- ;// CONCATENATED MODULE: ./src/ld-switch/ld-switch.vue?vue&type=template&id=89826e86&scoped=true
15064
14950
 
15065
- ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-switch/ld-switch.ts?vue&type=script&lang=js&external
15066
- var ld_switchvue_type_script_lang_js_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
15067
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15068
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
15069
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
15070
- return c > 3 && r && Object.defineProperty(target, key, r), r;
15071
- };
15072
- var ld_switchvue_type_script_lang_js_external_metadata = (undefined && undefined.__metadata) || function (k, v) {
14951
+ function ld_text_markupvue_type_template_id_12e81c9c_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
14952
+ const _component_ld_label = (0,external_vue_.resolveComponent)("ld-label")
14953
+ const _component_v_btn = (0,external_vue_.resolveComponent)("v-btn")
14954
+ const _component_v_runtime_template = (0,external_vue_.resolveComponent)("v-runtime-template")
14955
+ const _component_md_editor = (0,external_vue_.resolveComponent)("md-editor")
14956
+ const _component_v_col = (0,external_vue_.resolveComponent)("v-col")
14957
+ const _component_v_row = (0,external_vue_.resolveComponent)("v-row")
14958
+
14959
+ return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_text_markupvue_type_template_id_12e81c9c_scoped_true_hoisted_1, [
14960
+ (0,external_vue_.createVNode)(_component_v_row, { "no-gutters": "" }, {
14961
+ default: (0,external_vue_.withCtx)(() => [
14962
+ (_ctx.label)
14963
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_ld_label, {
14964
+ key: 0,
14965
+ class: (0,external_vue_.normalizeClass)([_ctx.labelSizeClasses]),
14966
+ label: _ctx.label,
14967
+ required: _ctx.required,
14968
+ "align-label-to-right": _ctx.alignLabelToRight
14969
+ }, null, 8, ["class", "label", "required", "align-label-to-right"]))
14970
+ : (0,external_vue_.createCommentVNode)("", true),
14971
+ (0,external_vue_.createTextVNode)(),
14972
+ (0,external_vue_.createVNode)(_component_v_col, {
14973
+ class: (0,external_vue_.normalizeClass)([_ctx.inputSizeClasses, "pa-1 content-wrapper"])
14974
+ }, {
14975
+ default: (0,external_vue_.withCtx)(() => [
14976
+ (0,external_vue_.createElementVNode)("div", ld_text_markupvue_type_template_id_12e81c9c_scoped_true_hoisted_2, [
14977
+ (0,external_vue_.createVNode)(_component_v_btn, {
14978
+ class: (0,external_vue_.normalizeClass)(["small-button", { active: !_ctx.isPreviewActive }]),
14979
+ variant: "outlined",
14980
+ disabled: _ctx.readonly,
14981
+ onClick: _ctx.onPreviewChanged
14982
+ }, {
14983
+ default: (0,external_vue_.withCtx)(() => [
14984
+ (0,external_vue_.createElementVNode)("span", {
14985
+ class: (0,external_vue_.normalizeClass)({ 'text-color': !_ctx.isPreviewActive })
14986
+ }, "Текст", 2)
14987
+ ]),
14988
+ _: 1
14989
+ }, 8, ["class", "disabled", "onClick"]),
14990
+ (0,external_vue_.createTextVNode)(),
14991
+ (0,external_vue_.createVNode)(_component_v_btn, {
14992
+ class: (0,external_vue_.normalizeClass)(["small-button", { active: _ctx.isPreviewActive }]),
14993
+ variant: "outlined",
14994
+ onClick: _ctx.onPreviewChanged
14995
+ }, {
14996
+ default: (0,external_vue_.withCtx)(() => [
14997
+ (0,external_vue_.createElementVNode)("span", {
14998
+ class: (0,external_vue_.normalizeClass)({ 'text-color': _ctx.isPreviewActive })
14999
+ }, "Превью", 2)
15000
+ ]),
15001
+ _: 1
15002
+ }, 8, ["class", "onClick"])
15003
+ ]),
15004
+ (0,external_vue_.createTextVNode)(),
15005
+ (_ctx.isPreviewActive)
15006
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_v_runtime_template, {
15007
+ key: 0,
15008
+ template: _ctx.template,
15009
+ id: "contentbox"
15010
+ }, null, 8, ["template"]))
15011
+ : (0,external_vue_.createCommentVNode)("", true),
15012
+ (0,external_vue_.createTextVNode)(),
15013
+ (0,external_vue_.withDirectives)((0,external_vue_.createElementVNode)("div", ld_text_markupvue_type_template_id_12e81c9c_scoped_true_hoisted_3, [
15014
+ (0,external_vue_.createVNode)(_component_md_editor, {
15015
+ modelValue: _ctx.value,
15016
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((_ctx.value) = $event)),
15017
+ ref: "editor",
15018
+ language: "ru_RU",
15019
+ preview: false,
15020
+ toolbars: _ctx.toolbars,
15021
+ footers: [],
15022
+ onOnChange: _ctx.onEditorTextChange
15023
+ }, null, 8, ["modelValue", "toolbars", "onOnChange"])
15024
+ ], 512), [
15025
+ [external_vue_.vShow, !_ctx.isPreviewActive]
15026
+ ])
15027
+ ]),
15028
+ _: 1
15029
+ }, 8, ["class"])
15030
+ ]),
15031
+ _: 1
15032
+ }),
15033
+ (0,external_vue_.createTextVNode)(),
15034
+ (!_ctx.hideDetails)
15035
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_v_row, {
15036
+ key: 0,
15037
+ "no-gutters": "",
15038
+ class: "ld-text-markup-validate"
15039
+ }, {
15040
+ default: (0,external_vue_.withCtx)(() => [
15041
+ (0,external_vue_.createVNode)(_component_v_col, {
15042
+ class: (0,external_vue_.normalizeClass)([_ctx.labelSizeClasses])
15043
+ }, null, 8, ["class"]),
15044
+ (0,external_vue_.createTextVNode)(),
15045
+ (0,external_vue_.createVNode)(_component_v_col, {
15046
+ class: (0,external_vue_.normalizeClass)(_ctx.inputSizeClasses)
15047
+ }, {
15048
+ default: (0,external_vue_.withCtx)(() => [
15049
+ (0,external_vue_.createVNode)(external_vue_.Transition, { name: "squash" }, {
15050
+ default: (0,external_vue_.withCtx)(() => [
15051
+ (_ctx.showError)
15052
+ ? (0,external_vue_.withDirectives)(((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("span", {
15053
+ key: 0,
15054
+ class: "error--text",
15055
+ style: {"font-size":"var(--font-size--1)"}
15056
+ }, (0,external_vue_.toDisplayString)(_ctx.validationMessage), 513)), [
15057
+ [external_vue_.vShow, _ctx.showError]
15058
+ ])
15059
+ : (0,external_vue_.createCommentVNode)("", true)
15060
+ ]),
15061
+ _: 1
15062
+ })
15063
+ ]),
15064
+ _: 1
15065
+ }, 8, ["class"])
15066
+ ]),
15067
+ _: 1
15068
+ }))
15069
+ : (0,external_vue_.createCommentVNode)("", true)
15070
+ ]))
15071
+ }
15072
+ ;// CONCATENATED MODULE: ./src/ld-text-markup/ld-text-markup.vue?vue&type=template&id=12e81c9c&scoped=true
15073
+
15074
+ ;// CONCATENATED MODULE: ./src/ld-text-markup/translation.ts
15075
+ /* eslint-disable @typescript-eslint/naming-convention */
15076
+ const ru_RU = {
15077
+ toolbarTips: {
15078
+ bold: 'Полужирный',
15079
+ underline: 'Подчеркнутый',
15080
+ italic: 'Курсив',
15081
+ strikeThrough: 'strikeThrough',
15082
+ title: 'Заголовок',
15083
+ sub: 'subscript',
15084
+ sup: 'superscript',
15085
+ quote: 'quote',
15086
+ unorderedList: 'Список',
15087
+ orderedList: 'Нумерованный список',
15088
+ task: 'task list',
15089
+ codeRow: 'Программый код',
15090
+ code: 'block-level code',
15091
+ link: 'Создать ссылку',
15092
+ image: 'image',
15093
+ table: 'Добавить таблицу',
15094
+ mermaid: 'mermaid',
15095
+ katex: 'formula',
15096
+ revoke: 'revoke',
15097
+ next: 'undo revoke',
15098
+ save: 'save',
15099
+ prettier: 'prettier',
15100
+ pageFullscreen: 'fullscreen in page',
15101
+ fullscreen: 'fullscreen',
15102
+ preview: 'Превью',
15103
+ htmlPreview: 'html preview',
15104
+ catalog: 'catalog',
15105
+ github: 'source code',
15106
+ },
15107
+ titleItem: {
15108
+ h1: 'Заголовок 1 уровня',
15109
+ h2: 'Заголовок 2 уровня',
15110
+ h3: 'Заголовок 3 уровня',
15111
+ h4: 'Заголовок 4 уровня',
15112
+ h5: 'Заголовок 5 уровня',
15113
+ h6: 'Заголовок 6 уровня',
15114
+ },
15115
+ imgTitleItem: {
15116
+ link: 'Add Img Link',
15117
+ upload: 'Upload Img',
15118
+ clip2upload: 'Clip Upload',
15119
+ },
15120
+ linkModalTips: {
15121
+ descLabel: 'Описание',
15122
+ descLabelPlaceHolder: 'Текст для отображения',
15123
+ urlLabel: 'Ссылка',
15124
+ urlLabelPlaceHolder: 'Адрес ссылки',
15125
+ buttonOK: 'Сохранить',
15126
+ },
15127
+ clipModalTips: {
15128
+ title: 'Crop Image',
15129
+ buttonUpload: 'Upload',
15130
+ },
15131
+ copyCode: {
15132
+ text: 'Copy',
15133
+ successTips: 'Copied!',
15134
+ failTips: 'Copy failed!',
15135
+ },
15136
+ mermaid: {
15137
+ flow: 'flow',
15138
+ sequence: 'sequence',
15139
+ gantt: 'gantt',
15140
+ class: 'class',
15141
+ state: 'state',
15142
+ pie: 'pie',
15143
+ relationship: 'relationship',
15144
+ journey: 'journey',
15145
+ },
15146
+ katex: {
15147
+ inline: 'inline',
15148
+ block: 'block',
15149
+ },
15150
+ footer: {
15151
+ markdownTotal: 'Всего слов',
15152
+ scrollAuto: 'Автопрокрутка',
15153
+ },
15154
+ };
15155
+ /* harmony default export */ const translation = (ru_RU);
15156
+
15157
+ // EXTERNAL MODULE: external "./lib/runtime-template.js"
15158
+ var runtime_template_js_ = __webpack_require__(9435);
15159
+ var runtime_template_js_default = /*#__PURE__*/__webpack_require__.n(runtime_template_js_);
15160
+ // EXTERNAL MODULE: external "md-editor-v3"
15161
+ var external_md_editor_v3_ = __webpack_require__(6443);
15162
+ ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-text-markup/ld-text-markup.ts?vue&type=script&lang=js&external
15163
+ var ld_text_markupvue_type_script_lang_js_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
15164
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15165
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
15166
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
15167
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
15168
+ };
15169
+ var ld_text_markupvue_type_script_lang_js_external_metadata = (undefined && undefined.__metadata) || function (k, v) {
15073
15170
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
15074
15171
  };
15075
15172
 
15076
15173
 
15077
- let SwitchComponent = class SwitchComponent extends (0,external_vue_property_decorator_.mixins)(InputMixin) {
15174
+
15175
+
15176
+
15177
+
15178
+
15179
+
15180
+
15181
+
15182
+ /**
15183
+ * @displayName ld-text-markup
15184
+ */
15185
+ let TextMarkupComponent = class TextMarkupComponent extends (0,external_vue_class_component_.mixins)(ValidatableMixin, GridMixin, InputMixin) {
15078
15186
  constructor() {
15079
15187
  super(...arguments);
15080
- this.value = false;
15188
+ /**
15189
+ * html
15190
+ */
15191
+ this.template = '';
15192
+ /**
15193
+ * markdown
15194
+ */
15195
+ this.value = '';
15196
+ this.isPreviewActive = false;
15197
+ this.md = null;
15198
+ this.previewWatchDisabled = false;
15081
15199
  }
15082
- onModelChanged() {
15083
- this.value = this.modelValue;
15200
+ emitInput() {
15201
+ return this.value;
15084
15202
  }
15085
- onValueChanged(val) {
15086
- this.$emit('update:model-value', val);
15203
+ emitPreview() {
15204
+ return this.isPreviewActive;
15087
15205
  }
15088
- };
15089
- ld_switchvue_type_script_lang_js_external_decorate([
15090
- (0,external_vue_property_decorator_.Prop)(),
15091
- ld_switchvue_type_script_lang_js_external_metadata("design:type", Boolean)
15206
+ onValueChanged() {
15207
+ if (!this.value && this.required) {
15208
+ this.validate();
15209
+ }
15210
+ if (this.value) {
15211
+ this.validationMessage = '';
15212
+ }
15213
+ }
15214
+ onReadonlyChanged() {
15215
+ if (this.readonly && !this.isPreviewActive) {
15216
+ this.togglePreview();
15217
+ }
15218
+ }
15219
+ async onPreviewChanged() {
15220
+ if (this.previewWatchDisabled) {
15221
+ return;
15222
+ }
15223
+ this.previewWatchDisabled = true;
15224
+ await this.toggleClick();
15225
+ await this.$nextTick();
15226
+ this.previewWatchDisabled = false;
15227
+ }
15228
+ created() {
15229
+ (0,external_md_editor_v3_.config)({
15230
+ editorConfig: {
15231
+ languageUserDefined: {
15232
+ /* eslint-disable-next-line @typescript-eslint/naming-convention */
15233
+ ru_RU: translation,
15234
+ },
15235
+ },
15236
+ });
15237
+ if (this.form) {
15238
+ this.form.register(this, null);
15239
+ }
15240
+ }
15241
+ async mounted() {
15242
+ const markdownIt = (await Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 8461, 23))).default;
15243
+ const md = new markdownIt();
15244
+ this.md = md;
15245
+ this.buildEditor();
15246
+ if (this.form) {
15247
+ this.form?.register(this, null);
15248
+ }
15249
+ }
15250
+ unmounted() {
15251
+ if (this.form) {
15252
+ this.form.unregister(this, null);
15253
+ }
15254
+ }
15255
+ onEditorTextChange(value) {
15256
+ this.value = value;
15257
+ this.emitInput();
15258
+ }
15259
+ async togglePreview() {
15260
+ this.isPreviewActive = !this.isPreviewActive;
15261
+ if (this.isPreviewActive) {
15262
+ this.previewRender(this.value);
15263
+ await this.$nextTick();
15264
+ }
15265
+ this.emitPreview();
15266
+ }
15267
+ async toggleClick() {
15268
+ if (this.readonly || this.disabled) {
15269
+ return;
15270
+ }
15271
+ await this.togglePreview();
15272
+ }
15273
+ validate() {
15274
+ let funcResult = null;
15275
+ this.validationMessage = '';
15276
+ this.validRules.forEach(func => {
15277
+ funcResult = func(this.value);
15278
+ if (funcResult !== true) {
15279
+ this.validationMessage = funcResult;
15280
+ }
15281
+ });
15282
+ return !this.validationMessage;
15283
+ }
15284
+ buildEditor() {
15285
+ this.value = this.modelValue;
15286
+ if (this.preview || this.readonly) {
15287
+ this.togglePreview();
15288
+ }
15289
+ const editorWrapper = document.getElementById('editorbox');
15290
+ if (editorWrapper) {
15291
+ editorWrapper.style.visibility = 'visible';
15292
+ }
15293
+ }
15294
+ previewRender(plainText) {
15295
+ plainText = plainText.replace(/\n\n/g, '\n <br> \n');
15296
+ try {
15297
+ let html = this.md.render(plainText);
15298
+ html = html.replace(/&lt;br&gt;/g, '<br>');
15299
+ this.template = '<div class="content contentbox"><div>' + html + '</div></div>';
15300
+ }
15301
+ catch (e) {
15302
+ /* eslint-disable no-console */
15303
+ console.error(e);
15304
+ }
15305
+ }
15306
+ get showError() {
15307
+ return Boolean(this.validationMessage);
15308
+ }
15309
+ get toolbars() {
15310
+ return [
15311
+ 'bold',
15312
+ 'underline',
15313
+ 'italic',
15314
+ '-',
15315
+ 'title',
15316
+ 'unorderedList',
15317
+ 'orderedList',
15318
+ '-',
15319
+ 'codeRow',
15320
+ 'code',
15321
+ 'link',
15322
+ ];
15323
+ }
15324
+ };
15325
+ ld_text_markupvue_type_script_lang_js_external_decorate([
15326
+ (0,external_vue_property_decorator_.Prop)(),
15327
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:type", String)
15328
+ ], TextMarkupComponent.prototype, "modelValue", void 0);
15329
+ ld_text_markupvue_type_script_lang_js_external_decorate([
15330
+ (0,external_vue_property_decorator_.Prop)({ default: false }),
15331
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:type", Boolean)
15332
+ ], TextMarkupComponent.prototype, "preview", void 0);
15333
+ ld_text_markupvue_type_script_lang_js_external_decorate([
15334
+ (0,external_vue_property_decorator_.Prop)({ type: Boolean, default: false }),
15335
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:type", Boolean)
15336
+ ], TextMarkupComponent.prototype, "persistentHint", void 0);
15337
+ ld_text_markupvue_type_script_lang_js_external_decorate([
15338
+ (0,external_vue_property_decorator_.Inject)({ from: 'form', default: null }),
15339
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:type", Object)
15340
+ ], TextMarkupComponent.prototype, "form", void 0);
15341
+ ld_text_markupvue_type_script_lang_js_external_decorate([
15342
+ Emit('update:model-value'),
15343
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:type", Function),
15344
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:paramtypes", []),
15345
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:returntype", void 0)
15346
+ ], TextMarkupComponent.prototype, "emitInput", null);
15347
+ ld_text_markupvue_type_script_lang_js_external_decorate([
15348
+ Emit('update:preview'),
15349
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:type", Function),
15350
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:paramtypes", []),
15351
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:returntype", void 0)
15352
+ ], TextMarkupComponent.prototype, "emitPreview", null);
15353
+ ld_text_markupvue_type_script_lang_js_external_decorate([
15354
+ (0,external_vue_property_decorator_.Watch)('value'),
15355
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:type", Function),
15356
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:paramtypes", []),
15357
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:returntype", void 0)
15358
+ ], TextMarkupComponent.prototype, "onValueChanged", null);
15359
+ ld_text_markupvue_type_script_lang_js_external_decorate([
15360
+ (0,external_vue_property_decorator_.Watch)('readonly'),
15361
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:type", Function),
15362
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:paramtypes", []),
15363
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:returntype", void 0)
15364
+ ], TextMarkupComponent.prototype, "onReadonlyChanged", null);
15365
+ ld_text_markupvue_type_script_lang_js_external_decorate([
15366
+ (0,external_vue_property_decorator_.Watch)('preview'),
15367
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:type", Function),
15368
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:paramtypes", []),
15369
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:returntype", Promise)
15370
+ ], TextMarkupComponent.prototype, "onPreviewChanged", null);
15371
+ TextMarkupComponent = ld_text_markupvue_type_script_lang_js_external_decorate([
15372
+ (0,external_vue_property_decorator_.Options)({
15373
+ components: {
15374
+ 'ld-label': ld_label,
15375
+ 'v-runtime-template': (runtime_template_js_default()),
15376
+ 'md-editor': external_md_editor_v3_.MdEditor,
15377
+ },
15378
+ })
15379
+ ], TextMarkupComponent);
15380
+ /* harmony default export */ const ld_text_markupvue_type_script_lang_js_external = (TextMarkupComponent);
15381
+
15382
+ ;// CONCATENATED MODULE: ./src/ld-text-markup/ld-text-markup.ts?vue&type=script&lang=js&external
15383
+
15384
+ ;// CONCATENATED MODULE: ./src/ld-text-markup/ld-text-markup.vue
15385
+
15386
+
15387
+
15388
+
15389
+ ;
15390
+
15391
+
15392
+ const ld_text_markup_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(ld_text_markupvue_type_script_lang_js_external, [['render',ld_text_markupvue_type_template_id_12e81c9c_scoped_true_render],['__scopeId',"data-v-12e81c9c"]])
15393
+
15394
+ /* harmony default export */ const ld_text_markup = (ld_text_markup_exports_);
15395
+ ;// CONCATENATED MODULE: ./src/ld-text-markup/index.ts
15396
+
15397
+ function ld_text_markup_reg(vue, options) {
15398
+ vue.component(options.aliases['ld-text-markup'], ld_text_markup);
15399
+ }
15400
+ /* harmony default export */ const src_ld_text_markup = (ld_text_markup_reg);
15401
+
15402
+ ;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use!./src/ld-switch/ld-switch.vue?vue&type=template&id=89826e86&scoped=true
15403
+
15404
+
15405
+ const ld_switchvue_type_template_id_89826e86_scoped_true_withScopeId = n => (_pushScopeId("data-v-89826e86"),n=n(),_popScopeId(),n)
15406
+ const ld_switchvue_type_template_id_89826e86_scoped_true_hoisted_1 = { class: "ld-switch" }
15407
+
15408
+ function ld_switchvue_type_template_id_89826e86_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
15409
+ const _component_v_switch = (0,external_vue_.resolveComponent)("v-switch")
15410
+
15411
+ return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_switchvue_type_template_id_89826e86_scoped_true_hoisted_1, [
15412
+ (0,external_vue_.createVNode)(_component_v_switch, {
15413
+ modelValue: _ctx.value,
15414
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((_ctx.value) = $event)),
15415
+ readonly: _ctx.readonly,
15416
+ disabled: _ctx.disabled,
15417
+ label: _ctx.label,
15418
+ "hide-details": _ctx.hideDetails
15419
+ }, null, 8, ["modelValue", "readonly", "disabled", "label", "hide-details"])
15420
+ ]))
15421
+ }
15422
+ ;// CONCATENATED MODULE: ./src/ld-switch/ld-switch.vue?vue&type=template&id=89826e86&scoped=true
15423
+
15424
+ ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-switch/ld-switch.ts?vue&type=script&lang=js&external
15425
+ var ld_switchvue_type_script_lang_js_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
15426
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15427
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
15428
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
15429
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
15430
+ };
15431
+ var ld_switchvue_type_script_lang_js_external_metadata = (undefined && undefined.__metadata) || function (k, v) {
15432
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
15433
+ };
15434
+
15435
+
15436
+ let SwitchComponent = class SwitchComponent extends (0,external_vue_property_decorator_.mixins)(InputMixin) {
15437
+ constructor() {
15438
+ super(...arguments);
15439
+ this.value = false;
15440
+ }
15441
+ onModelChanged() {
15442
+ this.value = this.modelValue;
15443
+ }
15444
+ onValueChanged(val) {
15445
+ this.$emit('update:model-value', val);
15446
+ }
15447
+ };
15448
+ ld_switchvue_type_script_lang_js_external_decorate([
15449
+ (0,external_vue_property_decorator_.Prop)(),
15450
+ ld_switchvue_type_script_lang_js_external_metadata("design:type", Boolean)
15092
15451
  ], SwitchComponent.prototype, "modelValue", void 0);
15093
15452
  ld_switchvue_type_script_lang_js_external_decorate([
15094
15453
  (0,external_vue_property_decorator_.Watch)('modelValue', { immediate: true }),
@@ -15380,364 +15739,6 @@ function ld_dialogvue_type_template_id_184339ee_ts_true_render(_ctx, _cache, $pr
15380
15739
 
15381
15740
  // EXTERNAL MODULE: ./node_modules/@ldmjs/core/dist/index.js
15382
15741
  var dist = __webpack_require__(634);
15383
- ;// CONCATENATED MODULE: ./src/utils/awaiting.ts
15384
- async function awaiting(callback) {
15385
- let resolveFunc = null;
15386
- const counter = 0;
15387
- let timer = null;
15388
- const promise = new Promise(resolve => {
15389
- resolveFunc = resolve;
15390
- });
15391
- timer = setInterval(() => {
15392
- const a = callback();
15393
- if (counter > 100 || Boolean(a)) {
15394
- clearInterval(timer);
15395
- resolveFunc(a ?? true);
15396
- }
15397
- }, 100);
15398
- await promise;
15399
- }
15400
-
15401
- ;// CONCATENATED MODULE: ./src/utils/base64.ts
15402
- /* eslint-disable no-bitwise */
15403
- class Base64Util {
15404
- constructor() {
15405
- this._keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
15406
- }
15407
- encode(input) {
15408
- let output = '';
15409
- let chr1, chr2, chr3, enc1, enc2, enc3, enc4;
15410
- let i = 0;
15411
- input = Base64Util._utf8_encode(input);
15412
- while (i < input.length) {
15413
- chr1 = input.charCodeAt(i++);
15414
- chr2 = input.charCodeAt(i++);
15415
- chr3 = input.charCodeAt(i++);
15416
- enc1 = chr1 >> 2;
15417
- enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
15418
- enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
15419
- enc4 = chr3 & 63;
15420
- if (isNaN(chr2)) {
15421
- enc3 = enc4 = 64;
15422
- }
15423
- else if (isNaN(chr3)) {
15424
- enc4 = 64;
15425
- }
15426
- output =
15427
- output +
15428
- this._keyStr.charAt(enc1) +
15429
- this._keyStr.charAt(enc2) +
15430
- this._keyStr.charAt(enc3) +
15431
- this._keyStr.charAt(enc4);
15432
- }
15433
- return output;
15434
- }
15435
- decode(input) {
15436
- let output = '';
15437
- let chr1, chr2, chr3;
15438
- let enc1, enc2, enc3, enc4;
15439
- let i = 0;
15440
- input = input.replace(/[^\d+/=A-Za-z]/g, '');
15441
- while (i < input.length) {
15442
- enc1 = this._keyStr.indexOf(input.charAt(i++));
15443
- enc2 = this._keyStr.indexOf(input.charAt(i++));
15444
- enc3 = this._keyStr.indexOf(input.charAt(i++));
15445
- enc4 = this._keyStr.indexOf(input.charAt(i++));
15446
- chr1 = (enc1 << 2) | (enc2 >> 4);
15447
- chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
15448
- chr3 = ((enc3 & 3) << 6) | enc4;
15449
- output = output + String.fromCharCode(chr1);
15450
- if (enc3 !== 64) {
15451
- output = output + String.fromCharCode(chr2);
15452
- }
15453
- if (enc4 !== 64) {
15454
- output = output + String.fromCharCode(chr3);
15455
- }
15456
- }
15457
- output = Base64Util._utf8_decode(output);
15458
- return output;
15459
- }
15460
- static _utf8_encode(str) {
15461
- str = str.replace(/\r\n/g, '\n');
15462
- let utftext = '';
15463
- for (let n = 0; n < str.length; n++) {
15464
- const c = str.charCodeAt(n);
15465
- if (c < 128) {
15466
- utftext += String.fromCharCode(c);
15467
- }
15468
- else if (c > 127 && c < 2048) {
15469
- utftext += String.fromCharCode((c >> 6) | 192);
15470
- utftext += String.fromCharCode((c & 63) | 128);
15471
- }
15472
- else {
15473
- utftext += String.fromCharCode((c >> 12) | 224);
15474
- utftext += String.fromCharCode(((c >> 6) & 63) | 128);
15475
- utftext += String.fromCharCode((c & 63) | 128);
15476
- }
15477
- }
15478
- return utftext;
15479
- }
15480
- static _utf8_decode(utftext) {
15481
- let string = '';
15482
- let i = 0;
15483
- let c = 0;
15484
- let c2 = 0;
15485
- let c3 = 0;
15486
- while (i < utftext.length) {
15487
- c = utftext.charCodeAt(i);
15488
- if (c < 128) {
15489
- string += String.fromCharCode(c);
15490
- i++;
15491
- }
15492
- else if (c > 191 && c < 224) {
15493
- c2 = utftext.charCodeAt(i + 1);
15494
- string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
15495
- i += 2;
15496
- }
15497
- else {
15498
- c2 = utftext.charCodeAt(i + 1);
15499
- c3 = utftext.charCodeAt(i + 2);
15500
- string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
15501
- i += 3;
15502
- }
15503
- }
15504
- return string;
15505
- }
15506
- isValid(value) {
15507
- // eslint-disable-next-line optimize-regex/optimize-regex
15508
- const base64Regex = /^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)?$/gim;
15509
- return base64Regex.test(value);
15510
- }
15511
- }
15512
- const base64 = new Base64Util();
15513
-
15514
-
15515
- ;// CONCATENATED MODULE: ./src/utils/cookie.ts
15516
- class Cookie {
15517
- get(key) {
15518
- const _key = key.replace(/([$()*+./?[\\\]^{|}])/g, '\\$1');
15519
- const matches = document.cookie.match(new RegExp('(?:^|; )' + _key + '=([^;]*)'));
15520
- if (matches && matches[1] && matches[1].length) {
15521
- return matches[1];
15522
- }
15523
- return null;
15524
- }
15525
- set(key, value, expires) {
15526
- let time = 0;
15527
- switch (expires) {
15528
- case 'day':
15529
- time = 1000 * 60 * 60 * 24;
15530
- break;
15531
- case 'month':
15532
- time = 1000 * 60 * 60 * 24 * 30;
15533
- break;
15534
- }
15535
- let exp = '';
15536
- if (time) {
15537
- time = Date.now() + time;
15538
- exp = new Date(time).toUTCString();
15539
- }
15540
- document.cookie = key + '=' + value + '; path=/; expires=' + exp;
15541
- }
15542
- delete(key) {
15543
- document.cookie = key + '=; path=/; expires=-1';
15544
- }
15545
- }
15546
- const cookie = new Cookie();
15547
-
15548
-
15549
- ;// CONCATENATED MODULE: ./src/utils/converting.ts
15550
- function fileToArrayBuffer(src) {
15551
- return new Promise(resolve => {
15552
- const reader = new FileReader();
15553
- reader.onloadend = function () {
15554
- resolve(reader.result);
15555
- };
15556
- reader.readAsArrayBuffer(src);
15557
- });
15558
- }
15559
- function fileToBase64(file) {
15560
- return new Promise((resolve, reject) => {
15561
- const reader = new FileReader();
15562
- reader.readAsDataURL(file);
15563
- reader.onload = () => {
15564
- let fileStr = reader.result.toString();
15565
- if (fileStr.includes(',')) {
15566
- fileStr = fileStr.split(',')[1];
15567
- }
15568
- resolve(fileStr);
15569
- };
15570
- reader.onerror = error => reject(error);
15571
- });
15572
- }
15573
- function base64ToUint8Array(base64) {
15574
- if (!base64.trim()) {
15575
- return null;
15576
- }
15577
- const decrypted = window.atob(base64);
15578
- let n = decrypted.length;
15579
- const arr = new Uint8Array(n);
15580
- while (n--) {
15581
- arr[n] = decrypted.charCodeAt(n);
15582
- }
15583
- return arr;
15584
- }
15585
- function Uint8ArrayToHex(bytes) {
15586
- const hex = [];
15587
- /* eslint-disable-next-line @typescript-eslint/prefer-for-of */
15588
- for (let i = 0; i < bytes.length; i++) {
15589
- const current = bytes[i] < 0 ? bytes[i] + 256 : bytes[i];
15590
- /* eslint-disable-next-line no-bitwise */
15591
- hex.push((current >>> 4).toString(16));
15592
- /* eslint-disable-next-line no-bitwise */
15593
- hex.push((current & 0xf).toString(16));
15594
- }
15595
- return hex.join('');
15596
- }
15597
- function hexToArrayBuffer(hex) {
15598
- hex = hex.replace(/^0x/, '');
15599
- if (hex.length % 2 != 0) {
15600
- // console.log('WARNING: expecting an even number of characters in the hexString');
15601
- }
15602
- const bad = hex.match(/[\sg-z]/i);
15603
- if (bad) {
15604
- // console.log('WARNING: found non-hex characters', bad);
15605
- }
15606
- const pairs = hex.match(/[\da-f]{2}/gi);
15607
- const result = [];
15608
- for (const s of pairs) {
15609
- result.push(parseInt(s, 16));
15610
- }
15611
- return result;
15612
- }
15613
- function uint8ArrayToBase64(value) {
15614
- const bin = value.reduce((acc, i) => (acc += String.fromCharCode.apply(null, [i])), '');
15615
- return window.btoa(bin);
15616
- }
15617
- function arrayBufferToUint8Array(value) {
15618
- return new Uint8Array(value);
15619
- }
15620
-
15621
-
15622
- ;// CONCATENATED MODULE: ./src/utils/deepValueGetter.ts
15623
- /**
15624
- * Returns a deep object given a string. zoo['animal.type']
15625
- * @param {object} obj
15626
- * @param {string} path
15627
- */
15628
- function deepValueGetter(obj, path) {
15629
- if (obj === null) {
15630
- return '';
15631
- }
15632
- if (!obj || !path) {
15633
- return obj;
15634
- }
15635
- const value = obj[path];
15636
- // eslint-disable-next-line no-undefined
15637
- if (value !== undefined) {
15638
- return value;
15639
- }
15640
- let current = obj;
15641
- const split = path.split('.');
15642
- if (split.length) {
15643
- for (const key of split) {
15644
- current = current[key];
15645
- // if found undefined, return empty string
15646
- // eslint-disable-next-line no-undefined
15647
- if (current === undefined || current === null) {
15648
- return '';
15649
- }
15650
- }
15651
- }
15652
- return current;
15653
- }
15654
-
15655
- ;// CONCATENATED MODULE: ./src/utils/delay.ts
15656
- async function delay(timeout) {
15657
- return new Promise(resolve => setTimeout(() => resolve(), timeout));
15658
- }
15659
-
15660
- ;// CONCATENATED MODULE: ./src/utils/isObjectEmpty.ts
15661
- function isObjectEmpty(obj) {
15662
- for (const _i in obj) {
15663
- return false;
15664
- }
15665
- return true;
15666
- }
15667
-
15668
- ;// CONCATENATED MODULE: ./src/utils/pluralizeNoun.ts
15669
- function pluralizeNoun(num, one, two, five, printNum = true) {
15670
- if (!num) {
15671
- return '';
15672
- }
15673
- let n;
15674
- if (typeof num === 'string') {
15675
- n = Number(num.match(/\d+\.?\d*/g));
15676
- }
15677
- else {
15678
- n = Math.abs(num);
15679
- }
15680
- n %= 100;
15681
- if (n >= 5 && n <= 20) {
15682
- return printNum ? `${num} ${five}` : `${five}`;
15683
- }
15684
- n %= 10;
15685
- if (n === 1) {
15686
- return printNum ? `${num} ${one}` : `${one}`;
15687
- }
15688
- if (n >= 2 && n <= 4) {
15689
- return printNum ? `${num} ${two}` : `${two}`;
15690
- }
15691
- return printNum ? `${num} ${five}` : `${five}`;
15692
- }
15693
-
15694
- ;// CONCATENATED MODULE: ./src/utils/strings.ts
15695
- class Strings {
15696
- camelCase(str) {
15697
- // Replace special characters with a space
15698
- str = str.replace(/[^\d A-Za-z]/g, ' ');
15699
- // put a space before an uppercase letter
15700
- str = str.replace(/([a-z](?=[A-Z]))/g, '$1 ');
15701
- // Lower case first character and some other stuff
15702
- str = str
15703
- .replace(/([^\d A-Za-z])|^\d+/g, '')
15704
- .trim()
15705
- .toLowerCase();
15706
- // uppercase characters preceded by a space or number
15707
- str = str.replace(/([\d ]+)([A-Za-z])/g, (a, b, c) => b.trim() + c.toUpperCase());
15708
- return str;
15709
- }
15710
- capitalize(str) {
15711
- if (!str) {
15712
- return str;
15713
- }
15714
- const first = str[0];
15715
- const other = str.substring(1);
15716
- return `${first.toUpperCase()}${other}`;
15717
- }
15718
- }
15719
- const strings = new Strings();
15720
-
15721
-
15722
- ;// CONCATENATED MODULE: ./src/utils/urlRegexp.ts
15723
- const urlRegexp =
15724
- // eslint-disable-next-line optimize-regex/optimize-regex
15725
- /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\\[\]{};:'".,<>?«»“”‘’]))/i;
15726
-
15727
- ;// CONCATENATED MODULE: ./src/utils/index.ts
15728
-
15729
-
15730
-
15731
-
15732
-
15733
-
15734
-
15735
-
15736
-
15737
-
15738
-
15739
-
15740
-
15741
15742
  ;// CONCATENATED MODULE: ./src/ld-dialog/dialog.manager.ts
15742
15743
 
15743
15744