@ldmjs/ui 1.0.0-dev-23 → 1.0.1

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.
package/README.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Dependencies
2
2
 
3
- ??????????
3
+ "vue": "3.4.21",
4
+ "vue-class-component": "8.0.0-rc.1",
5
+ "vue-property-decorator": "10.0.0-rc.3",
6
+ "vuetify": "3.6.8",
7
+ "vue-screen-utils": "1.0.0-beta.13",
8
+ "lodash-es": "4.17.21",
9
+ "md-editor-v3": "4.15.6",
4
10
 
5
11
  # Installation
6
12
 
@@ -20,15 +26,27 @@ import '@ldmjs/ui/dist/css/index.css';
20
26
  import '@ldmjs/ui/dist/css/root.css';
21
27
  import '@ldmjs/ui/dist/css/calendar.css';
22
28
  import '@ldmjs/ui/dist/scss';
29
+ import 'vuetify/styles';
30
+ import 'material-design-icons-iconfont/dist/material-design-icons.css';
31
+ import 'md-editor-v3/lib/style.css';
23
32
  import ldmui from '@ldmjs/ui';
24
33
  ```
25
34
 
26
35
  ```js
27
36
  const appComponent = createApp(App);
28
- appComponent.use(ldmui);
37
+ appComponent.use(ldmui); // or appComponent.use(ldmui, options);
29
38
  appComponent.mount('#app');
30
39
  ```
31
40
 
41
+ tsconfig.json
42
+ ```json
43
+ {
44
+ "compilerOptions": {
45
+ "include": ["node_modules/@ldmjs/ui/index.d.ts"]
46
+ }
47
+ }
48
+ ```
49
+
32
50
  # Library
33
51
 
34
52
  ## #ld-icon
@@ -32,3 +32,5 @@
32
32
 
33
33
  .ld-edit-masked-text[data-v-4fae342a]{min-width:100%;font-size:inherit !important;display:flex}.ld-edit-masked-text .column[data-v-4fae342a]{flex-flow:column}input[data-v-4fae342a]{border:1px solid var(--grey-l-5);border-radius:var(--border-radius);width:100%;flex:1 1 auto;padding:0 8px;font-size:var(--font-size);height:var(--input-height)}input[data-v-4fae342a]:focus,input[data-v-4fae342a]:active{outline:none;border:1px solid var(--grey-l-4)}.ld-edit-masked-text-validate[data-v-4fae342a]{overflow:hidden;height:20px}
34
34
 
35
+ .ld-text-markup[data-v-d0f0d7f0]{display:flex;flex-direction:column;min-width:100%;max-width:100%;width:100%;min-height:180px;padding-bottom:18px}.ld-text-markup-validate[data-v-d0f0d7f0]{overflow:hidden;height:20px;flex-grow:0}.content-wrapper[data-v-d0f0d7f0]{display:flex;flex-direction:column;position:relative;background-color:var(--grey-l-6);border-radius:4px}.tabs-wrapper[data-v-d0f0d7f0]{position:relative;display:flex;width:50%;max-width:155px;margin-bottom:-1px;z-index:1;flex-shrink:0}.tabs-wrapper .v-btn[data-v-d0f0d7f0]{border:1px solid var(--grey-l-5);height:30px !important;opacity:0.6;border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.tabs-wrapper .v-btn[data-v-d0f0d7f0]:before,.tabs-wrapper .v-btn[data-v-d0f0d7f0]:after{display:none}.tabs-wrapper .v-btn.active[data-v-d0f0d7f0]{background-color:var(--white);border:1px solid var(--grey-l-4);border-bottom:none;opacity:1}.content[data-v-d0f0d7f0]{position:relative;z-index:0;flex-basis:100%;font-size:var(--font-size);color:var(--text)}.content .md-editor[data-v-d0f0d7f0]{height:100%}.contentbox[data-v-d0f0d7f0]{border:1px solid var(--grey-l-4);background-color:var(--white);border-radius:0 4px 4px 4px;padding:10px}[data-v-d0f0d7f0] .contentbox ul{padding:0 12px;list-style:disc;margin-bottom:8px}[data-v-d0f0d7f0] .contentbox ol{list-style:decimal;padding:0 12px;margin-bottom:8px}[data-v-d0f0d7f0] .contentbox p{margin-bottom:8px}[data-v-d0f0d7f0] .contentbox pre{padding:4px}[data-v-d0f0d7f0] .contentbox code{background:none;color:var(--text);padding:0;font-size:100%}[data-v-d0f0d7f0] .md-editor{border:1px solid var(--grey-l-4)}
36
+
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  (function webpackUniversalModuleDefinition(root, factory) {
2
2
  if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("./calendar.js"), require("./floating.js"), require("./imask.js"), require("./multiselect.js"), require("@vuelidate/validators"), require("imask"), require("vue"), require("vue-class-component"), require("vue-property-decorator"));
3
+ module.exports = factory(require("./calendar.js"), require("./floating.js"), require("./imask.js"), require("./multiselect.js"), require("./runtime-template.js"), require("@vuelidate/validators"), require("imask"), require("markdown-it"), require("md-editor-v3"), require("vue"), require("vue-class-component"), require("vue-property-decorator"));
4
4
  else if(typeof define === 'function' && define.amd)
5
- define(["./calendar.js", "./floating.js", "./imask.js", "./multiselect.js", "@vuelidate/validators", "imask", "vue", "vue-class-component", "vue-property-decorator"], factory);
5
+ define(["./calendar.js", "./floating.js", "./imask.js", "./multiselect.js", "./runtime-template.js", "@vuelidate/validators", "imask", "markdown-it", "md-editor-v3", "vue", "vue-class-component", "vue-property-decorator"], factory);
6
6
  else if(typeof exports === 'object')
7
- exports["ldmui"] = factory(require("./calendar.js"), require("./floating.js"), require("./imask.js"), require("./multiselect.js"), require("@vuelidate/validators"), require("imask"), require("vue"), require("vue-class-component"), require("vue-property-decorator"));
7
+ exports["ldmui"] = factory(require("./calendar.js"), require("./floating.js"), require("./imask.js"), require("./multiselect.js"), require("./runtime-template.js"), require("@vuelidate/validators"), require("imask"), require("markdown-it"), require("md-editor-v3"), require("vue"), require("vue-class-component"), require("vue-property-decorator"));
8
8
  else
9
- root["ldmui"] = factory(root["./calendar.js"], root["./floating.js"], root["./imask.js"], root["./multiselect.js"], root["@vuelidate/validators"], root["imask"], root["vue"], root["vue-class-component"], root["vue-property-decorator"]);
10
- })(self, (__WEBPACK_EXTERNAL_MODULE__4634__, __WEBPACK_EXTERNAL_MODULE__3654__, __WEBPACK_EXTERNAL_MODULE__6135__, __WEBPACK_EXTERNAL_MODULE__9225__, __WEBPACK_EXTERNAL_MODULE__887__, __WEBPACK_EXTERNAL_MODULE__5467__, __WEBPACK_EXTERNAL_MODULE__2380__, __WEBPACK_EXTERNAL_MODULE__9299__, __WEBPACK_EXTERNAL_MODULE__5070__) => {
9
+ root["ldmui"] = factory(root["./calendar.js"], root["./floating.js"], root["./imask.js"], root["./multiselect.js"], root["./runtime-template.js"], root["@vuelidate/validators"], root["imask"], root["markdown-it"], root["md-editor-v3"], root["vue"], root["vue-class-component"], root["vue-property-decorator"]);
10
+ })(self, (__WEBPACK_EXTERNAL_MODULE__4634__, __WEBPACK_EXTERNAL_MODULE__3654__, __WEBPACK_EXTERNAL_MODULE__6135__, __WEBPACK_EXTERNAL_MODULE__9225__, __WEBPACK_EXTERNAL_MODULE__119__, __WEBPACK_EXTERNAL_MODULE__887__, __WEBPACK_EXTERNAL_MODULE__5467__, __WEBPACK_EXTERNAL_MODULE__8461__, __WEBPACK_EXTERNAL_MODULE__6443__, __WEBPACK_EXTERNAL_MODULE__2380__, __WEBPACK_EXTERNAL_MODULE__9299__, __WEBPACK_EXTERNAL_MODULE__5070__) => {
11
11
  return /******/ (() => { // webpackBootstrap
12
12
  /******/ "use strict";
13
13
  /******/ var __webpack_modules__ = ({
@@ -59,6 +59,13 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__9225__;
59
59
 
60
60
  /***/ }),
61
61
 
62
+ /***/ 119:
63
+ /***/ ((module) => {
64
+
65
+ module.exports = __WEBPACK_EXTERNAL_MODULE__119__;
66
+
67
+ /***/ }),
68
+
62
69
  /***/ 887:
63
70
  /***/ ((module) => {
64
71
 
@@ -73,6 +80,20 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__5467__;
73
80
 
74
81
  /***/ }),
75
82
 
83
+ /***/ 8461:
84
+ /***/ ((module) => {
85
+
86
+ module.exports = __WEBPACK_EXTERNAL_MODULE__8461__;
87
+
88
+ /***/ }),
89
+
90
+ /***/ 6443:
91
+ /***/ ((module) => {
92
+
93
+ module.exports = __WEBPACK_EXTERNAL_MODULE__6443__;
94
+
95
+ /***/ }),
96
+
76
97
  /***/ 2380:
77
98
  /***/ ((module) => {
78
99
 
@@ -133,6 +154,36 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__5070__;
133
154
  /******/ };
134
155
  /******/ })();
135
156
  /******/
157
+ /******/ /* webpack/runtime/create fake namespace object */
158
+ /******/ (() => {
159
+ /******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
160
+ /******/ var leafPrototypes;
161
+ /******/ // create a fake namespace object
162
+ /******/ // mode & 1: value is a module id, require it
163
+ /******/ // mode & 2: merge all properties of value into the ns
164
+ /******/ // mode & 4: return value when already ns object
165
+ /******/ // mode & 16: return value when it's Promise-like
166
+ /******/ // mode & 8|1: behave like require
167
+ /******/ __webpack_require__.t = function(value, mode) {
168
+ /******/ if(mode & 1) value = this(value);
169
+ /******/ if(mode & 8) return value;
170
+ /******/ if(typeof value === 'object' && value) {
171
+ /******/ if((mode & 4) && value.__esModule) return value;
172
+ /******/ if((mode & 16) && typeof value.then === 'function') return value;
173
+ /******/ }
174
+ /******/ var ns = Object.create(null);
175
+ /******/ __webpack_require__.r(ns);
176
+ /******/ var def = {};
177
+ /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
178
+ /******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {
179
+ /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
180
+ /******/ }
181
+ /******/ def['default'] = () => (value);
182
+ /******/ __webpack_require__.d(ns, def);
183
+ /******/ return ns;
184
+ /******/ };
185
+ /******/ })();
186
+ /******/
136
187
  /******/ /* webpack/runtime/define property getters */
137
188
  /******/ (() => {
138
189
  /******/ // define getter functions for harmony exports
@@ -10245,6 +10296,433 @@ function ld_edit_masked_text_reg(vue, options) {
10245
10296
  }
10246
10297
  /* harmony default export */ const src_ld_edit_masked_text = (ld_edit_masked_text_reg);
10247
10298
 
10299
+ ;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/ld-text-markup/ld-text-markup.vue?vue&type=template&id=d0f0d7f0&scoped=true
10300
+
10301
+
10302
+ const ld_text_markupvue_type_template_id_d0f0d7f0_scoped_true_withScopeId = n => (_pushScopeId("data-v-d0f0d7f0"),n=n(),_popScopeId(),n)
10303
+ const ld_text_markupvue_type_template_id_d0f0d7f0_scoped_true_hoisted_1 = { class: "ld-text-markup" }
10304
+ const ld_text_markupvue_type_template_id_d0f0d7f0_scoped_true_hoisted_2 = { class: "tabs-wrapper" }
10305
+ const ld_text_markupvue_type_template_id_d0f0d7f0_scoped_true_hoisted_3 = {
10306
+ key: "editor",
10307
+ class: "content editorbox",
10308
+ style: {"visibility":"hidden"},
10309
+ id: "editorbox"
10310
+ }
10311
+
10312
+ function ld_text_markupvue_type_template_id_d0f0d7f0_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
10313
+ const _component_ld_label = (0,external_vue_.resolveComponent)("ld-label")
10314
+ const _component_v_btn = (0,external_vue_.resolveComponent)("v-btn")
10315
+ const _component_v_runtime_template = (0,external_vue_.resolveComponent)("v-runtime-template")
10316
+ const _component_md_editor = (0,external_vue_.resolveComponent)("md-editor")
10317
+ const _component_v_col = (0,external_vue_.resolveComponent)("v-col")
10318
+ const _component_v_row = (0,external_vue_.resolveComponent)("v-row")
10319
+
10320
+ return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_text_markupvue_type_template_id_d0f0d7f0_scoped_true_hoisted_1, [
10321
+ (0,external_vue_.createVNode)(_component_v_row, { "no-gutters": "" }, {
10322
+ default: (0,external_vue_.withCtx)(() => [
10323
+ (_ctx.label)
10324
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_ld_label, {
10325
+ key: 0,
10326
+ class: (0,external_vue_.normalizeClass)([_ctx.labelSizeClasses]),
10327
+ label: _ctx.label,
10328
+ required: _ctx.required,
10329
+ "align-label-to-right": _ctx.alignLabelToRight
10330
+ }, null, 8, ["class", "label", "required", "align-label-to-right"]))
10331
+ : (0,external_vue_.createCommentVNode)("", true),
10332
+ (0,external_vue_.createTextVNode)(),
10333
+ (0,external_vue_.createVNode)(_component_v_col, {
10334
+ class: (0,external_vue_.normalizeClass)([_ctx.inputSizeClasses, "pa-1 content-wrapper"])
10335
+ }, {
10336
+ default: (0,external_vue_.withCtx)(() => [
10337
+ (0,external_vue_.createElementVNode)("div", ld_text_markupvue_type_template_id_d0f0d7f0_scoped_true_hoisted_2, [
10338
+ (0,external_vue_.createVNode)(_component_v_btn, {
10339
+ class: (0,external_vue_.normalizeClass)(["small-button", { active: !_ctx.isPreviewActive }]),
10340
+ variant: "outlined",
10341
+ disabled: _ctx.readonly,
10342
+ onClick: _ctx.toggleClick
10343
+ }, {
10344
+ default: (0,external_vue_.withCtx)(() => [
10345
+ (0,external_vue_.createElementVNode)("span", {
10346
+ class: (0,external_vue_.normalizeClass)({ 'text-color': !_ctx.isPreviewActive })
10347
+ }, "Текст", 2)
10348
+ ]),
10349
+ _: 1
10350
+ }, 8, ["class", "disabled", "onClick"]),
10351
+ (0,external_vue_.createTextVNode)(),
10352
+ (0,external_vue_.createVNode)(_component_v_btn, {
10353
+ class: (0,external_vue_.normalizeClass)(["small-button", { active: _ctx.isPreviewActive }]),
10354
+ variant: "outlined",
10355
+ onClick: _ctx.toggleClick
10356
+ }, {
10357
+ default: (0,external_vue_.withCtx)(() => [
10358
+ (0,external_vue_.createElementVNode)("span", {
10359
+ class: (0,external_vue_.normalizeClass)({ 'text-color': _ctx.isPreviewActive })
10360
+ }, "Превью", 2)
10361
+ ]),
10362
+ _: 1
10363
+ }, 8, ["class", "onClick"])
10364
+ ]),
10365
+ (0,external_vue_.createTextVNode)(),
10366
+ (_ctx.isPreviewActive)
10367
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_v_runtime_template, {
10368
+ key: 0,
10369
+ template: _ctx.template,
10370
+ id: "contentbox"
10371
+ }, null, 8, ["template"]))
10372
+ : (0,external_vue_.createCommentVNode)("", true),
10373
+ (0,external_vue_.createTextVNode)(),
10374
+ (0,external_vue_.withDirectives)((0,external_vue_.createElementVNode)("div", ld_text_markupvue_type_template_id_d0f0d7f0_scoped_true_hoisted_3, [
10375
+ (0,external_vue_.createVNode)(_component_md_editor, {
10376
+ modelValue: _ctx.value,
10377
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((_ctx.value) = $event)),
10378
+ ref: "editor",
10379
+ language: "ru_RU",
10380
+ preview: false,
10381
+ toolbars: _ctx.toolbars,
10382
+ footers: [],
10383
+ onOnChange: _ctx.onEditorTextChange
10384
+ }, null, 8, ["modelValue", "toolbars", "onOnChange"])
10385
+ ], 512), [
10386
+ [external_vue_.vShow, !_ctx.isPreviewActive]
10387
+ ])
10388
+ ]),
10389
+ _: 1
10390
+ }, 8, ["class"])
10391
+ ]),
10392
+ _: 1
10393
+ }),
10394
+ (0,external_vue_.createTextVNode)(),
10395
+ (!_ctx.hideDetails)
10396
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_v_row, {
10397
+ key: 0,
10398
+ "no-gutters": "",
10399
+ class: "ld-text-markup-validate"
10400
+ }, {
10401
+ default: (0,external_vue_.withCtx)(() => [
10402
+ (0,external_vue_.createVNode)(_component_v_col, {
10403
+ class: (0,external_vue_.normalizeClass)([_ctx.labelSizeClasses])
10404
+ }, null, 8, ["class"]),
10405
+ (0,external_vue_.createTextVNode)(),
10406
+ (0,external_vue_.createVNode)(_component_v_col, {
10407
+ class: (0,external_vue_.normalizeClass)(_ctx.inputSizeClasses)
10408
+ }, {
10409
+ default: (0,external_vue_.withCtx)(() => [
10410
+ (0,external_vue_.createVNode)(external_vue_.Transition, { name: "squash" }, {
10411
+ default: (0,external_vue_.withCtx)(() => [
10412
+ (_ctx.showError)
10413
+ ? (0,external_vue_.withDirectives)(((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("span", {
10414
+ key: 0,
10415
+ class: "error--text",
10416
+ style: {"font-size":"var(--font-size--1)"}
10417
+ }, (0,external_vue_.toDisplayString)(_ctx.validationMessage), 513)), [
10418
+ [external_vue_.vShow, _ctx.showError]
10419
+ ])
10420
+ : (0,external_vue_.createCommentVNode)("", true)
10421
+ ]),
10422
+ _: 1
10423
+ })
10424
+ ]),
10425
+ _: 1
10426
+ }, 8, ["class"])
10427
+ ]),
10428
+ _: 1
10429
+ }))
10430
+ : (0,external_vue_.createCommentVNode)("", true)
10431
+ ]))
10432
+ }
10433
+ ;// CONCATENATED MODULE: ./src/ld-text-markup/ld-text-markup.vue?vue&type=template&id=d0f0d7f0&scoped=true
10434
+
10435
+ ;// CONCATENATED MODULE: ./src/ld-text-markup/translation.ts
10436
+ /* eslint-disable @typescript-eslint/naming-convention */
10437
+ const ru_RU = {
10438
+ toolbarTips: {
10439
+ bold: 'Полужирный',
10440
+ underline: 'Подчеркнутый',
10441
+ italic: 'Курсив',
10442
+ strikeThrough: 'strikeThrough',
10443
+ title: 'Заголовок',
10444
+ sub: 'subscript',
10445
+ sup: 'superscript',
10446
+ quote: 'quote',
10447
+ unorderedList: 'Список',
10448
+ orderedList: 'Нумерованный список',
10449
+ task: 'task list',
10450
+ codeRow: 'Программый код',
10451
+ code: 'block-level code',
10452
+ link: 'Создать ссылку',
10453
+ image: 'image',
10454
+ table: 'Добавить таблицу',
10455
+ mermaid: 'mermaid',
10456
+ katex: 'formula',
10457
+ revoke: 'revoke',
10458
+ next: 'undo revoke',
10459
+ save: 'save',
10460
+ prettier: 'prettier',
10461
+ pageFullscreen: 'fullscreen in page',
10462
+ fullscreen: 'fullscreen',
10463
+ preview: 'Превью',
10464
+ htmlPreview: 'html preview',
10465
+ catalog: 'catalog',
10466
+ github: 'source code',
10467
+ },
10468
+ titleItem: {
10469
+ h1: 'Заголовок 1 уровня',
10470
+ h2: 'Заголовок 2 уровня',
10471
+ h3: 'Заголовок 3 уровня',
10472
+ h4: 'Заголовок 4 уровня',
10473
+ h5: 'Заголовок 5 уровня',
10474
+ h6: 'Заголовок 6 уровня',
10475
+ },
10476
+ imgTitleItem: {
10477
+ link: 'Add Img Link',
10478
+ upload: 'Upload Img',
10479
+ clip2upload: 'Clip Upload',
10480
+ },
10481
+ linkModalTips: {
10482
+ descLabel: 'Описание',
10483
+ descLabelPlaceHolder: 'Текст для отображения',
10484
+ urlLabel: 'Ссылка',
10485
+ urlLabelPlaceHolder: 'Адрес ссылки',
10486
+ buttonOK: 'Сохранить',
10487
+ },
10488
+ clipModalTips: {
10489
+ title: 'Crop Image',
10490
+ buttonUpload: 'Upload',
10491
+ },
10492
+ copyCode: {
10493
+ text: 'Copy',
10494
+ successTips: 'Copied!',
10495
+ failTips: 'Copy failed!',
10496
+ },
10497
+ mermaid: {
10498
+ flow: 'flow',
10499
+ sequence: 'sequence',
10500
+ gantt: 'gantt',
10501
+ class: 'class',
10502
+ state: 'state',
10503
+ pie: 'pie',
10504
+ relationship: 'relationship',
10505
+ journey: 'journey',
10506
+ },
10507
+ katex: {
10508
+ inline: 'inline',
10509
+ block: 'block',
10510
+ },
10511
+ footer: {
10512
+ markdownTotal: 'Всего слов',
10513
+ scrollAuto: 'Автопрокрутка',
10514
+ },
10515
+ };
10516
+ /* harmony default export */ const translation = (ru_RU);
10517
+
10518
+ // EXTERNAL MODULE: external "./runtime-template.js"
10519
+ var external_runtime_template_js_ = __webpack_require__(119);
10520
+ var external_runtime_template_js_default = /*#__PURE__*/__webpack_require__.n(external_runtime_template_js_);
10521
+ // EXTERNAL MODULE: external "md-editor-v3"
10522
+ var external_md_editor_v3_ = __webpack_require__(6443);
10523
+ ;// 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
10524
+ var ld_text_markupvue_type_script_lang_js_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
10525
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
10526
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
10527
+ 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;
10528
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
10529
+ };
10530
+ var ld_text_markupvue_type_script_lang_js_external_metadata = (undefined && undefined.__metadata) || function (k, v) {
10531
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10532
+ };
10533
+
10534
+
10535
+
10536
+
10537
+
10538
+
10539
+
10540
+
10541
+
10542
+
10543
+ /**
10544
+ * @displayName ld-text-markup
10545
+ */
10546
+ let TextMarkupComponent = class TextMarkupComponent extends (0,external_vue_class_component_.mixins)(ValidatableMixin, GridMixin, InputMixin) {
10547
+ constructor() {
10548
+ super(...arguments);
10549
+ /**
10550
+ * html
10551
+ */
10552
+ this.template = '';
10553
+ /**
10554
+ * markdown
10555
+ */
10556
+ this.value = '';
10557
+ this.isPreviewActive = false;
10558
+ this.md = null;
10559
+ }
10560
+ emitInput() {
10561
+ return this.value;
10562
+ }
10563
+ onValueChanged() {
10564
+ if (!this.value && this.required) {
10565
+ this.validate();
10566
+ }
10567
+ if (this.value) {
10568
+ this.validationMessage = '';
10569
+ }
10570
+ }
10571
+ created() {
10572
+ (0,external_md_editor_v3_.config)({
10573
+ editorConfig: {
10574
+ languageUserDefined: {
10575
+ /* eslint-disable-next-line @typescript-eslint/naming-convention */
10576
+ ru_RU: translation,
10577
+ },
10578
+ },
10579
+ });
10580
+ if (this.form) {
10581
+ this.form.register(this, null);
10582
+ }
10583
+ }
10584
+ async mounted() {
10585
+ const markdownIt = (await Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 8461, 23))).default;
10586
+ const md = new markdownIt();
10587
+ this.md = md;
10588
+ this.buildEditor();
10589
+ if (this.form) {
10590
+ this.form?.register(this, null);
10591
+ }
10592
+ }
10593
+ unmounted() {
10594
+ if (this.form) {
10595
+ this.form.unregister(this, null);
10596
+ }
10597
+ }
10598
+ onEditorTextChange(value) {
10599
+ this.value = value;
10600
+ this.emitInput();
10601
+ }
10602
+ async togglePreview() {
10603
+ this.isPreviewActive = !this.isPreviewActive;
10604
+ if (this.isPreviewActive) {
10605
+ this.previewRender(this.value);
10606
+ await this.$nextTick();
10607
+ }
10608
+ }
10609
+ toggleClick() {
10610
+ if (this.readonly || this.disabled) {
10611
+ return;
10612
+ }
10613
+ this.togglePreview();
10614
+ }
10615
+ validate() {
10616
+ let funcResult = null;
10617
+ this.validationMessage = '';
10618
+ this.validRules.forEach(func => {
10619
+ funcResult = func(this.value);
10620
+ if (funcResult !== true) {
10621
+ this.validationMessage = funcResult;
10622
+ }
10623
+ });
10624
+ return !this.validationMessage;
10625
+ }
10626
+ buildEditor() {
10627
+ this.value = this.modelValue;
10628
+ if (this.preview || this.readonly) {
10629
+ this.togglePreview();
10630
+ }
10631
+ const editorWrapper = document.getElementById('editorbox');
10632
+ if (editorWrapper) {
10633
+ editorWrapper.style.visibility = 'visible';
10634
+ }
10635
+ }
10636
+ previewRender(plainText) {
10637
+ plainText = plainText.replace(/\n\n/g, '\n <br> \n');
10638
+ try {
10639
+ let html = this.md.render(plainText);
10640
+ html = html.replace(/&lt;br&gt;/g, '<br>');
10641
+ this.template = '<div class="content contentbox"><div>' + html + '</div></div>';
10642
+ }
10643
+ catch (e) {
10644
+ /* eslint-disable no-console */
10645
+ console.log(e);
10646
+ }
10647
+ }
10648
+ get showError() {
10649
+ return Boolean(this.validationMessage);
10650
+ }
10651
+ get toolbars() {
10652
+ return [
10653
+ 'bold',
10654
+ 'underline',
10655
+ 'italic',
10656
+ '-',
10657
+ 'title',
10658
+ 'unorderedList',
10659
+ 'orderedList',
10660
+ '-',
10661
+ 'codeRow',
10662
+ 'code',
10663
+ 'link',
10664
+ ];
10665
+ }
10666
+ };
10667
+ ld_text_markupvue_type_script_lang_js_external_decorate([
10668
+ (0,external_vue_property_decorator_.Prop)(),
10669
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:type", String)
10670
+ ], TextMarkupComponent.prototype, "modelValue", void 0);
10671
+ ld_text_markupvue_type_script_lang_js_external_decorate([
10672
+ (0,external_vue_property_decorator_.Prop)({ type: Boolean, default: false }),
10673
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:type", Boolean)
10674
+ ], TextMarkupComponent.prototype, "persistentHint", void 0);
10675
+ ld_text_markupvue_type_script_lang_js_external_decorate([
10676
+ (0,external_vue_property_decorator_.Prop)({ default: false }),
10677
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:type", Boolean)
10678
+ ], TextMarkupComponent.prototype, "preview", void 0);
10679
+ ld_text_markupvue_type_script_lang_js_external_decorate([
10680
+ (0,external_vue_property_decorator_.Inject)({ from: 'form', default: null }),
10681
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:type", Object)
10682
+ ], TextMarkupComponent.prototype, "form", void 0);
10683
+ ld_text_markupvue_type_script_lang_js_external_decorate([
10684
+ Emit('update:model-value'),
10685
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:type", Function),
10686
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:paramtypes", []),
10687
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:returntype", void 0)
10688
+ ], TextMarkupComponent.prototype, "emitInput", null);
10689
+ ld_text_markupvue_type_script_lang_js_external_decorate([
10690
+ (0,external_vue_property_decorator_.Watch)('value'),
10691
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:type", Function),
10692
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:paramtypes", []),
10693
+ ld_text_markupvue_type_script_lang_js_external_metadata("design:returntype", void 0)
10694
+ ], TextMarkupComponent.prototype, "onValueChanged", null);
10695
+ TextMarkupComponent = ld_text_markupvue_type_script_lang_js_external_decorate([
10696
+ (0,external_vue_property_decorator_.Options)({
10697
+ components: {
10698
+ 'ld-label': ld_label,
10699
+ 'v-runtime-template': (external_runtime_template_js_default()),
10700
+ 'md-editor': external_md_editor_v3_.MdEditor,
10701
+ },
10702
+ })
10703
+ ], TextMarkupComponent);
10704
+ /* harmony default export */ const ld_text_markupvue_type_script_lang_js_external = (TextMarkupComponent);
10705
+
10706
+ ;// CONCATENATED MODULE: ./src/ld-text-markup/ld-text-markup.ts?vue&type=script&lang=js&external
10707
+
10708
+ ;// CONCATENATED MODULE: ./src/ld-text-markup/ld-text-markup.vue
10709
+
10710
+
10711
+
10712
+
10713
+ ;
10714
+
10715
+
10716
+ 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_d0f0d7f0_scoped_true_render],['__scopeId',"data-v-d0f0d7f0"]])
10717
+
10718
+ /* harmony default export */ const ld_text_markup = (ld_text_markup_exports_);
10719
+ ;// CONCATENATED MODULE: ./src/ld-text-markup/index.ts
10720
+
10721
+ function ld_text_markup_reg(vue, options) {
10722
+ vue.component(options.aliases['ld-text-markup'], ld_text_markup);
10723
+ }
10724
+ /* harmony default export */ const src_ld_text_markup = (ld_text_markup_reg);
10725
+
10248
10726
  ;// CONCATENATED MODULE: ./src/utils/delay.ts
10249
10727
  async function delay(timeout) {
10250
10728
  return new Promise(resolve => setTimeout(() => resolve(), timeout));
@@ -10670,6 +11148,7 @@ const ActiveDirectiveOptions = {
10670
11148
 
10671
11149
 
10672
11150
 
11151
+
10673
11152
 
10674
11153
 
10675
11154
  const ldmuiPlugin = {
@@ -10700,6 +11179,7 @@ const ldmuiPlugin = {
10700
11179
  'ld-timepicker': options.aliases?.['ld-timepicker'] ?? 'ld-timepicker',
10701
11180
  'ld-text-viewer': options.aliases?.['ld-text-viewer'] ?? 'ld-text-viewer',
10702
11181
  'ld-edit-masked-text': options.aliases?.['ld-edit-masked-text'] ?? 'ld-edit-masked-text',
11182
+ 'ld-text-markup': options.aliases?.['ld-text-markup'] ?? 'ld-text-markup',
10703
11183
  };
10704
11184
  vue.config.globalProperties.$utils = {
10705
11185
  ...utils_namespaceObject,
@@ -10736,6 +11216,7 @@ const ldmuiPlugin = {
10736
11216
  src_ld_timepicker(vue, options);
10737
11217
  src_ld_text_viewer(vue, options);
10738
11218
  src_ld_edit_masked_text(vue, options);
11219
+ src_ld_text_markup(vue, options);
10739
11220
  },
10740
11221
  };
10741
11222
  /* harmony default export */ const src = (ldmuiPlugin);
@@ -0,0 +1 @@
1
+ (function webpackUniversalModuleDefinition(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define(["vue"],t):"object"===typeof exports?exports["ldmui"]=t(require("vue")):e["ldmui"]=t(e["vue"])})(self,(e=>(()=>{"use strict";var t={6262:(e,t)=>{t.A=(e,t)=>{const o=e.__vccOpts||e;for(const[e,n]of t)o[e]=n;return o}},2380:t=>{t.exports=e}},o={};function __webpack_require__(e){var n=o[e];if(void 0!==n)return n.exports;var r=o[e]={exports:{}};return t[e](r,r.exports,__webpack_require__),r.exports}(()=>{__webpack_require__.d=(e,t)=>{for(var o in t)__webpack_require__.o(t,o)&&!__webpack_require__.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})}})(),(()=>{__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{__webpack_require__.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var n={};return(()=>{__webpack_require__.r(n),__webpack_require__.d(n,{default:()=>i});var e=__webpack_require__(2380);function render(t,o,n,r,s,c){return t.componentName?((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(t.componentName),{key:0})):(0,e.createCommentVNode)("",!0)}const defineDescriptor=(e,t,o)=>{if(!t.hasOwnProperty(o)){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n)}},merge=e=>{const t={};return e.forEach((e=>{e&&Object.getOwnPropertyNames(e).forEach((o=>defineDescriptor(e,t,o)))})),t},buildFromProps=(e,t)=>{const o={};return t.forEach((t=>defineDescriptor(e,o,t))),o},{defineComponent:t}=__webpack_require__(2380),o={props:{template:String,parentComp:Object},data(){return{componentName:"",dynamic:null}},created(){const e="runtime-template-"+Math.floor(1e4*Math.random());if(this.template){if(this.dynamic&&this.$parent){const{$data:o,$props:n}=this.$parent;let r={$data:{},$props:{}};Object.keys(o||{}).forEach((e=>{void 0===this.$data[e]&&(r.$data[e]=o[e])})),Object.keys(n||{}).forEach((e=>r.$props[e]=n[e]));const s=merge([r.$data,r.$props,this.methodsFromProps]);return this.$options.components[e]=t(this.dynamic,{props:s}),void(this.componentName=e)}const o=this.parentComp||this.$parent;this.$options.methods||(this.$options.methods={}),this.$options.computed||(this.$options.computed={}),this.$options.components||(this.$options.components={});const{$data:n,$props:r,$options:s}=o,{components:c,computed:p,methods:i}=s;let a={$data:{},$props:{},$options:{},components:{},computed:{},methods:{}};Object.keys(n||{}).forEach((e=>{void 0===this.$data[e]&&(a.$data[e]=n[e])})),Object.keys(r||{}).forEach((e=>{void 0===this.$props[e]&&(a.$props[e]=r[e])})),Object.keys(i||{}).forEach((e=>{void 0===this.$options.methods[e]&&(a.methods[e]=i[e])})),Object.keys(p||{}).forEach((e=>{void 0===this.$options.computed[e]&&(a.computed[e]=p[e])})),Object.keys(c||{}).forEach((e=>{void 0===this.$options.components[e]&&(a.components[e]=c[e])}));const d=Object.keys(a.methods||{}),_=Object.keys(a.$data||{}),m=Object.keys(a.$props||{}),h=_.concat(m).concat(d);this.methodsFromProps=buildFromProps(o,d);const u=merge([a.$data,a.$props,this.methodsFromProps]),f={},b={};let $=this.template||"<div></div>";_.forEach((e=>{const t=new RegExp(`[^"{\\s=]?${e}["}\\s]*?(?=["}\\s])`,"g"),n=t.exec($);if(n===e){const n=`${e}_ld`;b[n]=a.$data[e],$=$.replace(t,n);const r=o._watchers.find((t=>t.expression===e));if(r){const e=r.cb;r.cb=function(t,r){const s=this.__renderFn__.componentInstance;s[n]=t,e.call(o,t,r)}.bind(this)}else{const t=function(e){const t=this.__renderFn__.componentInstance;t[n]=e}.bind(this);o.$watch(e,t)}f[n]=function(t,n){o[e]=t}}})),this.$options.components[e]=t({template:$,props:h,data:()=>b,computed:a.computed,components:a.components,watch:f},{props:u}),this.componentName=e}}},r={components:{},mixins:[o]};var s=__webpack_require__(6262);const c=(0,s.A)(r,[["render",render]]),p=c,i=p})(),n})()));
@@ -21,6 +21,7 @@ export interface ldmuiOptions {
21
21
  'ld-timepicker'?: string;
22
22
  'ld-text-viewer'?: string;
23
23
  'ld-edit-masked-text'?: string;
24
+ 'ld-text-markup'?: string;
24
25
  },
25
26
  viewport?: {
26
27
  isMobile: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldmjs/ui",
3
- "version": "1.0.0-dev-23",
3
+ "version": "1.0.1",
4
4
  "description": "ldm ui",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -68,6 +68,7 @@
68
68
  "jest-transform-stub": "2.0.0",
69
69
  "lodash-es": "4.17.21",
70
70
  "material-design-icons-iconfont": "^6.7.0",
71
+ "md-editor-v3": "4.15.6",
71
72
  "mini-css-extract-plugin": "2.8.0",
72
73
  "node-sass": "9.0.0",
73
74
  "postcss-loader": "7.3.3",
@@ -85,7 +86,8 @@
85
86
  "vue-imask": "6.6.1",
86
87
  "vue-loader": "17.3.1",
87
88
  "vue-property-decorator": "10.0.0-rc.3",
88
- "vuetify": "3.5.9",
89
+ "vue-screen-utils": "1.0.0-beta.13",
90
+ "vuetify": "3.6.8",
89
91
  "webpack": "5.90.2",
90
92
  "webpack-cli": "5.1.4",
91
93
  "webpack-dev-server": "4.15.1",