@ldmjs/ui 1.0.13 → 1.0.14

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/dist/index.js CHANGED
@@ -9,12 +9,19 @@
9
9
  root["ldmui"] = factory(root["./calendar.js"], root["./floating.js"], root["./imask.js"], root["./multiselect.js"], root["./runtime-template.js"], root["@vuelidate/validators"], root["markdown-it"], root["md-editor-v3"], root["vue"], root["vue-class-component"], root["vue-property-decorator"], root["vue-toastification"]);
10
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__8461__, __WEBPACK_EXTERNAL_MODULE__6443__, __WEBPACK_EXTERNAL_MODULE__2380__, __WEBPACK_EXTERNAL_MODULE__9299__, __WEBPACK_EXTERNAL_MODULE__5070__, __WEBPACK_EXTERNAL_MODULE__7982__) => {
11
11
  return /******/ (() => { // webpackBootstrap
12
- /******/ "use strict";
13
12
  /******/ var __webpack_modules__ = ({
14
13
 
14
+ /***/ 634:
15
+ /***/ ((module) => {
16
+
17
+ (function webpackUniversalModuleDefinition(e,t){ true?module.exports=t():0})(self,(()=>(()=>{"use strict";var e={};(()=>{e.d=(t,s)=>{for(var i in s)e.o(s,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:s[i]})}})(),(()=>{e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{e.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var t={};e.r(t),e.d(t,{eventBus:()=>s});class EventBus{constructor(){this.listeners={},this.once=[]}$on(e,t){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push(t)}$once(e,t){this.$on(e,t),this.once.push(e)}$off(e,t){const s=new Map;if(e in this.listeners){this.listeners[e].forEach(((e,t)=>{s.set(e,t)}));const i=s.get(t);void 0!==i&&(this.listeners[e].splice(i,1),0===this.listeners[e]?.length&&delete this.listeners[e])}}$flush(){for(const e in this.listeners)this.listeners[e]=[];this.listeners={}}$emit(e,...t){e in this.listeners&&this.listeners[e].forEach((s=>{Function.prototype.apply.call(s,this,t),this.once.includes(e)&&(this.$off(e,s),this.once=this.once.filter((t=>t!==e)))}))}$has(e){return Boolean(e in this.listeners&&this.listeners[e])}}const s=new EventBus;return t})()));
18
+
19
+ /***/ }),
20
+
15
21
  /***/ 6262:
16
22
  /***/ ((__unused_webpack_module, exports) => {
17
23
 
24
+ "use strict";
18
25
  var __webpack_unused_export__;
19
26
 
20
27
  __webpack_unused_export__ = ({ value: true });
@@ -34,6 +41,7 @@ exports.A = (sfc, props) => {
34
41
  /***/ 4634:
35
42
  /***/ ((module) => {
36
43
 
44
+ "use strict";
37
45
  module.exports = __WEBPACK_EXTERNAL_MODULE__4634__;
38
46
 
39
47
  /***/ }),
@@ -41,6 +49,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__4634__;
41
49
  /***/ 3654:
42
50
  /***/ ((module) => {
43
51
 
52
+ "use strict";
44
53
  module.exports = __WEBPACK_EXTERNAL_MODULE__3654__;
45
54
 
46
55
  /***/ }),
@@ -48,6 +57,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__3654__;
48
57
  /***/ 6135:
49
58
  /***/ ((module) => {
50
59
 
60
+ "use strict";
51
61
  module.exports = __WEBPACK_EXTERNAL_MODULE__6135__;
52
62
 
53
63
  /***/ }),
@@ -55,6 +65,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__6135__;
55
65
  /***/ 9225:
56
66
  /***/ ((module) => {
57
67
 
68
+ "use strict";
58
69
  module.exports = __WEBPACK_EXTERNAL_MODULE__9225__;
59
70
 
60
71
  /***/ }),
@@ -62,6 +73,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__9225__;
62
73
  /***/ 119:
63
74
  /***/ ((module) => {
64
75
 
76
+ "use strict";
65
77
  module.exports = __WEBPACK_EXTERNAL_MODULE__119__;
66
78
 
67
79
  /***/ }),
@@ -69,6 +81,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__119__;
69
81
  /***/ 887:
70
82
  /***/ ((module) => {
71
83
 
84
+ "use strict";
72
85
  module.exports = __WEBPACK_EXTERNAL_MODULE__887__;
73
86
 
74
87
  /***/ }),
@@ -76,6 +89,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__887__;
76
89
  /***/ 8461:
77
90
  /***/ ((module) => {
78
91
 
92
+ "use strict";
79
93
  module.exports = __WEBPACK_EXTERNAL_MODULE__8461__;
80
94
 
81
95
  /***/ }),
@@ -83,6 +97,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__8461__;
83
97
  /***/ 6443:
84
98
  /***/ ((module) => {
85
99
 
100
+ "use strict";
86
101
  module.exports = __WEBPACK_EXTERNAL_MODULE__6443__;
87
102
 
88
103
  /***/ }),
@@ -90,6 +105,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__6443__;
90
105
  /***/ 2380:
91
106
  /***/ ((module) => {
92
107
 
108
+ "use strict";
93
109
  module.exports = __WEBPACK_EXTERNAL_MODULE__2380__;
94
110
 
95
111
  /***/ }),
@@ -97,6 +113,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__2380__;
97
113
  /***/ 9299:
98
114
  /***/ ((module) => {
99
115
 
116
+ "use strict";
100
117
  module.exports = __WEBPACK_EXTERNAL_MODULE__9299__;
101
118
 
102
119
  /***/ }),
@@ -104,6 +121,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__9299__;
104
121
  /***/ 5070:
105
122
  /***/ ((module) => {
106
123
 
124
+ "use strict";
107
125
  module.exports = __WEBPACK_EXTERNAL_MODULE__5070__;
108
126
 
109
127
  /***/ }),
@@ -111,6 +129,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__5070__;
111
129
  /***/ 7982:
112
130
  /***/ ((module) => {
113
131
 
132
+ "use strict";
114
133
  module.exports = __WEBPACK_EXTERNAL_MODULE__7982__;
115
134
 
116
135
  /***/ })
@@ -214,13 +233,26 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__7982__;
214
233
  /******/
215
234
  /************************************************************************/
216
235
  var __webpack_exports__ = {};
236
+ // This entry need to be wrapped in an IIFE because it need to be in strict mode.
237
+ (() => {
238
+ "use strict";
217
239
  // ESM COMPAT FLAG
218
240
  __webpack_require__.r(__webpack_exports__);
219
241
 
220
242
  // EXPORTS
221
243
  __webpack_require__.d(__webpack_exports__, {
244
+ AlertDialog: () => (/* reexport */ AlertDialog),
245
+ ConfirmDialog: () => (/* reexport */ ConfirmDialog),
246
+ CreateEditDialog: () => (/* reexport */ CreateEditDialog),
247
+ DialogManager: () => (/* reexport */ DialogManager),
248
+ InfoDialog: () => (/* reexport */ InfoDialog),
249
+ ModalButton: () => (/* reexport */ ModalButton),
250
+ ModalType: () => (/* reexport */ ModalType),
251
+ PromptDialog: () => (/* reexport */ PromptDialog),
252
+ SelectDialog: () => (/* reexport */ SelectDialog),
222
253
  ValidateMixin: () => (/* reexport */ ValidateMixin),
223
254
  ValidateMixinOptions: () => (/* reexport */ ValidateMixinOptions),
255
+ awaiting: () => (/* reexport */ awaiting),
224
256
  datetime: () => (/* reexport */ datetime),
225
257
  deepValueGetter: () => (/* reexport */ deepValueGetter),
226
258
  "default": () => (/* binding */ src),
@@ -237,6 +269,7 @@ __webpack_require__.d(__webpack_exports__, {
237
269
  var src_utils_namespaceObject = {};
238
270
  __webpack_require__.r(src_utils_namespaceObject);
239
271
  __webpack_require__.d(src_utils_namespaceObject, {
272
+ awaiting: () => (awaiting),
240
273
  datetime: () => (datetime),
241
274
  deepValueGetter: () => (deepValueGetter),
242
275
  delay: () => (delay),
@@ -1034,9 +1067,9 @@ function baseTrim(string) {
1034
1067
 
1035
1068
 
1036
1069
  /** Built-in value references. */
1037
- var Symbol = _root.Symbol;
1070
+ var src_Symbol = _root.Symbol;
1038
1071
 
1039
- /* harmony default export */ const _Symbol = (Symbol);
1072
+ /* harmony default export */ const _Symbol = (src_Symbol);
1040
1073
 
1041
1074
  ;// CONCATENATED MODULE: ./node_modules/lodash-es/_getRawTag.js
1042
1075
 
@@ -9173,9 +9206,9 @@ function getNative(object, key) {
9173
9206
 
9174
9207
 
9175
9208
  /* Built-in method references that are verified to be native. */
9176
- var Map = _getNative(_root, 'Map');
9209
+ var _Map_Map = _getNative(_root, 'Map');
9177
9210
 
9178
- /* harmony default export */ const _Map = (Map);
9211
+ /* harmony default export */ const _Map = (_Map_Map);
9179
9212
 
9180
9213
  ;// CONCATENATED MODULE: ./node_modules/lodash-es/_nativeCreate.js
9181
9214
 
@@ -12791,34 +12824,34 @@ function ld_select_reg(vue, options) {
12791
12824
  }
12792
12825
  /* harmony default export */ const src_ld_select = (ld_select_reg);
12793
12826
 
12794
- ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use!./src/ld-combobox/ld-combobox.vue?vue&type=template&id=70de7eb0&scoped=true&ts=true
12827
+ ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use!./src/ld-combobox/ld-combobox.vue?vue&type=template&id=31853b17&scoped=true&ts=true
12795
12828
 
12796
- const ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_withScopeId = n => (_pushScopeId("data-v-70de7eb0"), n = n(), _popScopeId(), n);
12797
- const ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_hoisted_1 = {
12829
+ const ld_comboboxvue_type_template_id_31853b17_scoped_true_ts_true_withScopeId = n => (_pushScopeId("data-v-31853b17"), n = n(), _popScopeId(), n);
12830
+ const ld_comboboxvue_type_template_id_31853b17_scoped_true_ts_true_hoisted_1 = {
12798
12831
  class: "w-full overflow-hidden",
12799
12832
  style: { "border-radius": "var(--border-radius)" }
12800
12833
  };
12801
- const ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_hoisted_2 = { class: "w-full d-flex position-relative" };
12802
- const ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_hoisted_3 = { class: "text-crop" };
12803
- const ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_hoisted_4 = {
12834
+ const ld_comboboxvue_type_template_id_31853b17_scoped_true_ts_true_hoisted_2 = { class: "w-full d-flex position-relative" };
12835
+ const ld_comboboxvue_type_template_id_31853b17_scoped_true_ts_true_hoisted_3 = { class: "text-crop" };
12836
+ const ld_comboboxvue_type_template_id_31853b17_scoped_true_ts_true_hoisted_4 = {
12804
12837
  key: 0,
12805
12838
  class: "d-flex align-center"
12806
12839
  };
12807
- const ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_hoisted_5 = { class: "d-flex flex-column justify-center" };
12808
- const ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_hoisted_6 = {
12840
+ const ld_comboboxvue_type_template_id_31853b17_scoped_true_ts_true_hoisted_5 = { class: "d-flex flex-column justify-center" };
12841
+ const ld_comboboxvue_type_template_id_31853b17_scoped_true_ts_true_hoisted_6 = {
12809
12842
  key: 0,
12810
12843
  class: "grey--text",
12811
12844
  style: { "font-size": "var(--font-size--1)" }
12812
12845
  };
12813
- const ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_hoisted_7 = {
12846
+ const ld_comboboxvue_type_template_id_31853b17_scoped_true_ts_true_hoisted_7 = {
12814
12847
  key: 0,
12815
12848
  class: "combobox-loading"
12816
12849
  };
12817
- const ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_hoisted_8 = {
12850
+ const ld_comboboxvue_type_template_id_31853b17_scoped_true_ts_true_hoisted_8 = {
12818
12851
  key: 0,
12819
12852
  class: "combobox-validate"
12820
12853
  };
12821
- function ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_render(_ctx, _cache, $props, $setup, $data, $options) {
12854
+ function ld_comboboxvue_type_template_id_31853b17_scoped_true_ts_true_render(_ctx, _cache, $props, $setup, $data, $options) {
12822
12855
  const _component_ld_label = (0,external_vue_.resolveComponent)("ld-label");
12823
12856
  const _component_small_chip = (0,external_vue_.resolveComponent)("small-chip");
12824
12857
  const _component_v_col = (0,external_vue_.resolveComponent)("v-col");
@@ -12843,8 +12876,8 @@ function ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_render(_ct
12843
12876
  class: (0,external_vue_.normalizeClass)(_ctx.inputSizeClasses)
12844
12877
  }, {
12845
12878
  default: (0,external_vue_.withCtx)(() => [
12846
- (0,external_vue_.createElementVNode)("div", ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_hoisted_1, [
12847
- (0,external_vue_.createElementVNode)("div", ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_hoisted_2, [
12879
+ (0,external_vue_.createElementVNode)("div", ld_comboboxvue_type_template_id_31853b17_scoped_true_ts_true_hoisted_1, [
12880
+ (0,external_vue_.createElementVNode)("div", ld_comboboxvue_type_template_id_31853b17_scoped_true_ts_true_hoisted_2, [
12848
12881
  (0,external_vue_.createVNode)(_component_multiselect, {
12849
12882
  ref: "multiselect",
12850
12883
  modelValue: _ctx.selected,
@@ -12886,7 +12919,7 @@ function ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_render(_ct
12886
12919
  "onClick:close": ($event) => (_ctx.onRemoveItem(option))
12887
12920
  }, {
12888
12921
  default: (0,external_vue_.withCtx)(() => [
12889
- (0,external_vue_.createElementVNode)("span", ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_hoisted_3, (0,external_vue_.toDisplayString)(_ctx.$utils.deepValueGetter(option, this.itemTitle)), 1)
12922
+ (0,external_vue_.createElementVNode)("span", ld_comboboxvue_type_template_id_31853b17_scoped_true_ts_true_hoisted_3, (0,external_vue_.toDisplayString)(_ctx.$utils.deepValueGetter(option, this.itemTitle)), 1)
12890
12923
  ]),
12891
12924
  _: 2
12892
12925
  }, 1032, ["color", "closable", "onClick:close"]))
@@ -12899,7 +12932,7 @@ function ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_render(_ct
12899
12932
  }, () => [
12900
12933
  (0,external_vue_.createVNode)(_component_small_chip, { closable: false }, {
12901
12934
  default: (0,external_vue_.withCtx)(() => [
12902
- (0,external_vue_.createTextVNode)((0,external_vue_.toDisplayString)(`overflow => limit: ${limit}, count: ${count}`), 1)
12935
+ (0,external_vue_.createTextVNode)((0,external_vue_.toDisplayString)(`+${count - limit} items`), 1)
12903
12936
  ]),
12904
12937
  _: 2
12905
12938
  }, 1024)
@@ -12914,7 +12947,7 @@ function ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_render(_ct
12914
12947
  (0,external_vue_.createVNode)(_component_v_col, { class: "d-flex align-center py-1" }, {
12915
12948
  default: (0,external_vue_.withCtx)(() => [
12916
12949
  (_ctx.multiselect)
12917
- ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_hoisted_4, [
12950
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_comboboxvue_type_template_id_31853b17_scoped_true_ts_true_hoisted_4, [
12918
12951
  ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)((0,external_vue_.resolveDynamicComponent)(_ctx.$ldmui.options.aliases['ld-checkbox']), {
12919
12952
  key: JSON.stringify(option),
12920
12953
  "model-value": _ctx.checkedItems,
@@ -12929,13 +12962,13 @@ function ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_render(_ct
12929
12962
  }, [
12930
12963
  (0,external_vue_.renderSlot)(_ctx.$slots, "option-icon", (0,external_vue_.normalizeProps)((0,external_vue_.guardReactiveProps)({ item: option, isSelected: _ctx.checkedItems.includes(_ctx.itemIdentity(option)) })), undefined, true),
12931
12964
  (0,external_vue_.createTextVNode)(),
12932
- (0,external_vue_.createElementVNode)("div", ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_hoisted_5, [
12965
+ (0,external_vue_.createElementVNode)("div", ld_comboboxvue_type_template_id_31853b17_scoped_true_ts_true_hoisted_5, [
12933
12966
  (0,external_vue_.renderSlot)(_ctx.$slots, "option", (0,external_vue_.normalizeProps)((0,external_vue_.guardReactiveProps)({ item: option, isSelected: _ctx.checkedItems.includes(_ctx.itemIdentity(option)) })), () => [
12934
12967
  (0,external_vue_.createElementVNode)("div", null, (0,external_vue_.toDisplayString)(_ctx.$utils.deepValueGetter(option, _ctx.itemTitle)), 1)
12935
12968
  ], true),
12936
12969
  (0,external_vue_.createTextVNode)(),
12937
12970
  (_ctx.optionHint)
12938
- ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_hoisted_6, [
12971
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_comboboxvue_type_template_id_31853b17_scoped_true_ts_true_hoisted_6, [
12939
12972
  (0,external_vue_.renderSlot)(_ctx.$slots, "option-hint", (0,external_vue_.normalizeProps)((0,external_vue_.guardReactiveProps)({ item: option })), undefined, true)
12940
12973
  ]))
12941
12974
  : (0,external_vue_.createCommentVNode)("", true)
@@ -12955,13 +12988,13 @@ function ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_render(_ct
12955
12988
  }, 8, ["modelValue", "multiple", "placeholder", "options", "internal-search", "close-on-select", "disabled", "limit", "tabindex", "allowEmpty", "onClose", "onOpen", "onSearchChange", "onUpdate:modelValue"]),
12956
12989
  (0,external_vue_.createTextVNode)(),
12957
12990
  (_ctx.loading)
12958
- ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_hoisted_7))
12991
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_comboboxvue_type_template_id_31853b17_scoped_true_ts_true_hoisted_7))
12959
12992
  : (0,external_vue_.createCommentVNode)("", true)
12960
12993
  ])
12961
12994
  ]),
12962
12995
  (0,external_vue_.createTextVNode)(),
12963
12996
  (!_ctx.hideDetails)
12964
- ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_hoisted_8, [
12997
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_comboboxvue_type_template_id_31853b17_scoped_true_ts_true_hoisted_8, [
12965
12998
  (0,external_vue_.createVNode)(external_vue_.Transition, { name: "squash" }, {
12966
12999
  default: (0,external_vue_.withCtx)(() => [
12967
13000
  (_ctx.showHint)
@@ -12984,7 +13017,7 @@ function ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_render(_ct
12984
13017
  }));
12985
13018
  }
12986
13019
 
12987
- ;// CONCATENATED MODULE: ./src/ld-combobox/ld-combobox.vue?vue&type=template&id=70de7eb0&scoped=true&ts=true
13020
+ ;// CONCATENATED MODULE: ./src/ld-combobox/ld-combobox.vue?vue&type=template&id=31853b17&scoped=true&ts=true
12988
13021
 
12989
13022
  ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-combobox/ld-combobox.ts?vue&type=script&lang=ts&external
12990
13023
  var ld_comboboxvue_type_script_lang_ts_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
@@ -13442,7 +13475,7 @@ ld_comboboxvue_type_script_lang_ts_external_SelectListBoxComponent = ld_combobox
13442
13475
  ;
13443
13476
 
13444
13477
 
13445
- const ld_combobox_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(ld_comboboxvue_type_script_lang_ts_external, [['render',ld_comboboxvue_type_template_id_70de7eb0_scoped_true_ts_true_render],['__scopeId',"data-v-70de7eb0"]])
13478
+ const ld_combobox_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(ld_comboboxvue_type_script_lang_ts_external, [['render',ld_comboboxvue_type_template_id_31853b17_scoped_true_ts_true_render],['__scopeId',"data-v-31853b17"]])
13446
13479
 
13447
13480
  /* harmony default export */ const ld_combobox = (ld_combobox_exports_);
13448
13481
  ;// CONCATENATED MODULE: ./src/ld-combobox/index.ts
@@ -14806,12 +14839,273 @@ function ld_switch_reg(vue, options) {
14806
14839
  }
14807
14840
  /* harmony default export */ const src_ld_switch = (ld_switch_reg);
14808
14841
 
14809
- // EXTERNAL MODULE: external "vue-toastification"
14810
- var external_vue_toastification_ = __webpack_require__(7982);
14811
- var external_vue_toastification_default = /*#__PURE__*/__webpack_require__.n(external_vue_toastification_);
14812
- ;// CONCATENATED MODULE: ./src/utils/delay.ts
14813
- async function delay(timeout) {
14814
- return new Promise(resolve => setTimeout(() => resolve(), timeout));
14842
+ ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use!./src/ld-dialog/ld-dialog.vue?vue&type=template&id=184339ee&ts=true
14843
+
14844
+ const ld_dialogvue_type_template_id_184339ee_ts_true_hoisted_1 = { class: "ld-dialog" };
14845
+ function ld_dialogvue_type_template_id_184339ee_ts_true_render(_ctx, _cache, $props, $setup, $data, $options) {
14846
+ const _component_minimized = (0,external_vue_.resolveComponent)("minimized");
14847
+ const _component_v_spacer = (0,external_vue_.resolveComponent)("v-spacer");
14848
+ const _component_square_button = (0,external_vue_.resolveComponent)("square-button");
14849
+ const _component_v_card_title = (0,external_vue_.resolveComponent)("v-card-title");
14850
+ const _component_v_card_text = (0,external_vue_.resolveComponent)("v-card-text");
14851
+ const _component_small_button = (0,external_vue_.resolveComponent)("small-button");
14852
+ const _component_v_card_actions = (0,external_vue_.resolveComponent)("v-card-actions");
14853
+ const _component_v_card = (0,external_vue_.resolveComponent)("v-card");
14854
+ const _component_v_dialog = (0,external_vue_.resolveComponent)("v-dialog");
14855
+ return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_dialogvue_type_template_id_184339ee_ts_true_hoisted_1, [
14856
+ (0,external_vue_.createVNode)(_component_minimized, {
14857
+ dialogs: _ctx.minimized,
14858
+ onMaximize: _cache[0] || (_cache[0] = ($event) => (_ctx.onMinimize($event))),
14859
+ onClose: _cache[1] || (_cache[1] = ($event) => (_ctx.handleCancel($event))),
14860
+ onCloseAll: _ctx.handleCancelAll
14861
+ }, null, 8, ["dialogs", "onCloseAll"]),
14862
+ (0,external_vue_.createTextVNode)(),
14863
+ ((0,external_vue_.openBlock)(true), (0,external_vue_.createElementBlock)(external_vue_.Fragment, null, (0,external_vue_.renderList)(_ctx.modals, (modal) => {
14864
+ return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", {
14865
+ key: modal.id,
14866
+ class: "h-100"
14867
+ }, [
14868
+ (0,external_vue_.createVNode)(_component_v_dialog, (0,external_vue_.mergeProps)({
14869
+ modelValue: modal.show,
14870
+ "onUpdate:modelValue": ($event) => ((modal.show) = $event),
14871
+ "content-class": ['ld-dialog-content'].concat(this.modalClass(modal)),
14872
+ persistent: ""
14873
+ }, _ctx.dialogBindings(modal), {
14874
+ "hide-header-close": !modal.closable,
14875
+ "hide-overlay": modal.noModal,
14876
+ "no-click-animation": modal.noModal,
14877
+ "retain-focus": modal.retainFocus,
14878
+ scrim: !modal.noModal,
14879
+ onHide: ($event) => (_ctx.handleHide(modal))
14880
+ }), {
14881
+ default: (0,external_vue_.withCtx)(() => [
14882
+ (0,external_vue_.createVNode)(_component_v_card, {
14883
+ class: (0,external_vue_.normalizeClass)(_ctx.cardClasses(modal))
14884
+ }, {
14885
+ default: (0,external_vue_.withCtx)(() => [
14886
+ (0,external_vue_.createVNode)(_component_v_card_title, {
14887
+ class: (0,external_vue_.normalizeClass)(["modal-title", { 'v-card-title--dark': _ctx.isTitleDark(modal) }])
14888
+ }, {
14889
+ default: (0,external_vue_.withCtx)(() => [
14890
+ (0,external_vue_.createElementVNode)("span", {
14891
+ class: (0,external_vue_.normalizeClass)({ 'font-weight-bold': _ctx.isMobileGlobal })
14892
+ }, (0,external_vue_.toDisplayString)(_ctx.modalTitle(modal)), 3),
14893
+ (0,external_vue_.createTextVNode)(),
14894
+ (0,external_vue_.createVNode)(_component_v_spacer),
14895
+ (0,external_vue_.createTextVNode)(),
14896
+ (modal.minimizable && !_ctx.isMobileGlobal)
14897
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_square_button, {
14898
+ key: 0,
14899
+ icon: "",
14900
+ onClick: ($event) => (_ctx.onMinimize(modal))
14901
+ }, {
14902
+ default: (0,external_vue_.withCtx)(() => [
14903
+ ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)((0,external_vue_.resolveDynamicComponent)(_ctx.$ldmui.options.aliases['ld-icon']), {
14904
+ color: modal.darkTitle ? 'white' : 'grey'
14905
+ }, {
14906
+ default: (0,external_vue_.withCtx)(() => [
14907
+ (0,external_vue_.createTextVNode)("\r\n minimize\r\n ")
14908
+ ]),
14909
+ _: 2
14910
+ }, 1032, ["color"]))
14911
+ ]),
14912
+ _: 2
14913
+ }, 1032, ["onClick"]))
14914
+ : (0,external_vue_.createCommentVNode)("", true),
14915
+ (0,external_vue_.createTextVNode)(),
14916
+ (_ctx.isExpanded(modal) && !_ctx.isMobileGlobal)
14917
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_square_button, {
14918
+ key: 1,
14919
+ icon: "",
14920
+ onClick: ($event) => (_ctx.onExpandCollapse(modal))
14921
+ }, {
14922
+ default: (0,external_vue_.withCtx)(() => [
14923
+ ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)((0,external_vue_.resolveDynamicComponent)(_ctx.$ldmui.options.aliases['ld-icon']), {
14924
+ color: modal.darkTitle ? 'white' : 'grey'
14925
+ }, {
14926
+ default: (0,external_vue_.withCtx)(() => [
14927
+ (0,external_vue_.createTextVNode)("\r\n close_fullscreen\r\n ")
14928
+ ]),
14929
+ _: 2
14930
+ }, 1032, ["color"]))
14931
+ ]),
14932
+ _: 2
14933
+ }, 1032, ["onClick"]))
14934
+ : (0,external_vue_.createCommentVNode)("", true),
14935
+ (0,external_vue_.createTextVNode)(),
14936
+ (_ctx.isCollapsed(modal) && !_ctx.isMobileGlobal)
14937
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_square_button, {
14938
+ key: 2,
14939
+ icon: "",
14940
+ onClick: ($event) => (_ctx.onExpandCollapse(modal))
14941
+ }, {
14942
+ default: (0,external_vue_.withCtx)(() => [
14943
+ ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)((0,external_vue_.resolveDynamicComponent)(_ctx.$ldmui.options.aliases['ld-icon']), {
14944
+ color: modal.darkTitle ? 'white' : 'grey'
14945
+ }, {
14946
+ default: (0,external_vue_.withCtx)(() => [
14947
+ (0,external_vue_.createTextVNode)("\r\n open_in_full\r\n ")
14948
+ ]),
14949
+ _: 2
14950
+ }, 1032, ["color"]))
14951
+ ]),
14952
+ _: 2
14953
+ }, 1032, ["onClick"]))
14954
+ : (0,external_vue_.createCommentVNode)("", true),
14955
+ (0,external_vue_.createTextVNode)(),
14956
+ (modal.closable || _ctx.isMobileGlobal)
14957
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_square_button, {
14958
+ key: 3,
14959
+ icon: "",
14960
+ class: "ml-1",
14961
+ onClick: ($event) => (_ctx.handleCancel(modal, true))
14962
+ }, {
14963
+ default: (0,external_vue_.withCtx)(() => [
14964
+ ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)((0,external_vue_.resolveDynamicComponent)(_ctx.$ldmui.options.aliases['ld-icon']), {
14965
+ color: _ctx.isTitleDark(modal) ? 'white' : 'grey'
14966
+ }, {
14967
+ default: (0,external_vue_.withCtx)(() => [
14968
+ (0,external_vue_.createTextVNode)("\r\n close\r\n ")
14969
+ ]),
14970
+ _: 2
14971
+ }, 1032, ["color"]))
14972
+ ]),
14973
+ _: 2
14974
+ }, 1032, ["onClick"]))
14975
+ : (0,external_vue_.createCommentVNode)("", true)
14976
+ ]),
14977
+ _: 2
14978
+ }, 1032, ["class"]),
14979
+ (0,external_vue_.createTextVNode)(),
14980
+ (_ctx.isAlertDialog(modal) || _ctx.isConfirmDialog(modal))
14981
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_v_card_text, {
14982
+ key: 0,
14983
+ class: "content text-center",
14984
+ innerHTML: modal.content
14985
+ }, null, 8, ["innerHTML"]))
14986
+ : (_ctx.isPromptDialog(modal))
14987
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_v_card_text, {
14988
+ key: 1,
14989
+ class: "content"
14990
+ }, {
14991
+ default: (0,external_vue_.withCtx)(() => [
14992
+ ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)((0,external_vue_.resolveDynamicComponent)(_ctx.$ldmui.options.aliases['ld-textarea']), {
14993
+ modelValue: modal.content,
14994
+ "onUpdate:modelValue": ($event) => ((modal.content) = $event),
14995
+ rows: "3"
14996
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]))
14997
+ ]),
14998
+ _: 2
14999
+ }, 1024))
15000
+ : (modal.component)
15001
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_v_card_text, {
15002
+ key: 2,
15003
+ class: "content",
15004
+ style: (0,external_vue_.normalizeStyle)({
15005
+ visibility: _ctx.setVisibility(modal.id)
15006
+ })
15007
+ }, {
15008
+ default: (0,external_vue_.withCtx)(() => [
15009
+ ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)((0,external_vue_.resolveDynamicComponent)(_ctx.$ldmui.options.aliases['ld-loader']), {
15010
+ options: { transparent: true, global: false },
15011
+ visible: modal.loading
15012
+ }, null, 8, ["visible"])),
15013
+ (0,external_vue_.createTextVNode)(),
15014
+ (!modal.loading && (_ctx.isInfoDialog(modal) || _ctx.isSelectDialog(modal)))
15015
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)((0,external_vue_.resolveDynamicComponent)(modal.component), (0,external_vue_.mergeProps)({ key: 0 }, modal.componentProps, {
15016
+ onSetResult: ($event) => (_ctx.onSetResult(modal, $event)),
15017
+ onSetResultAndClose: ($event) => (_ctx.onSetResultAndClose(modal, $event)),
15018
+ onCancel: ($event) => (_ctx.handleCancel(modal)),
15019
+ onExternalComponentCreated: ($event) => (_ctx.onComponentInstanceCreated(modal, $event))
15020
+ }), null, 16, ["onSetResult", "onSetResultAndClose", "onCancel", "onExternalComponentCreated"]))
15021
+ : (0,external_vue_.createCommentVNode)("", true),
15022
+ (0,external_vue_.createTextVNode)(),
15023
+ (!modal.loading && _ctx.isCreateEditDialog(modal))
15024
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)((0,external_vue_.resolveDynamicComponent)(modal.component), (0,external_vue_.mergeProps)({ key: 1 }, modal.componentProps, {
15025
+ onCollapseModal: ($event) => (_ctx.onExpandCollapse(modal)),
15026
+ onCancel: ($event) => (_ctx.handleCancel(modal)),
15027
+ onSetResult: ($event) => (_ctx.onSetResult(modal, $event)),
15028
+ onSetReadonly: ($event) => (modal.okDisabled = true),
15029
+ "onDialog:activate": ($event) => (_ctx.onActivate(modal)),
15030
+ "onDialog:processing": ($event) => (_ctx.onProcessing(modal, $event)),
15031
+ onExternalComponentCreated: ($event) => (_ctx.onComponentInstanceCreated(modal, $event))
15032
+ }), null, 16, ["onCollapseModal", "onCancel", "onSetResult", "onSetReadonly", "onDialog:activate", "onDialog:processing", "onExternalComponentCreated"]))
15033
+ : (0,external_vue_.createCommentVNode)("", true)
15034
+ ]),
15035
+ _: 2
15036
+ }, 1032, ["style"]))
15037
+ : (0,external_vue_.createCommentVNode)("", true),
15038
+ (0,external_vue_.createTextVNode)(),
15039
+ (!modal.hideFooter)
15040
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_v_card_actions, {
15041
+ key: 3,
15042
+ class: (0,external_vue_.normalizeClass)(["footer", { 'footerBtnEnd': _ctx.isSelectDialog(modal) }]),
15043
+ style: { "justify-content": "center" }
15044
+ }, {
15045
+ default: (0,external_vue_.withCtx)(() => [
15046
+ (0,external_vue_.createVNode)(_component_small_button, {
15047
+ id: "modalOk",
15048
+ disabled: modal.okDisabled,
15049
+ loading: modal.okLoading,
15050
+ color: "primary",
15051
+ onClick: ($event) => (_ctx.handleOk(modal))
15052
+ }, {
15053
+ default: (0,external_vue_.withCtx)(() => [
15054
+ (0,external_vue_.createTextVNode)((0,external_vue_.toDisplayString)(_ctx.okButtonText(modal)), 1)
15055
+ ]),
15056
+ _: 2
15057
+ }, 1032, ["disabled", "loading", "onClick"]),
15058
+ (0,external_vue_.createTextVNode)(),
15059
+ (!_ctx.isAlertDialog(modal) && !_ctx.isInfoDialog(modal))
15060
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_small_button, {
15061
+ key: 0,
15062
+ id: "modalCancel",
15063
+ disabled: modal.okOnly || modal.okLoading,
15064
+ variant: "outlined",
15065
+ color: "primary",
15066
+ onClick: ($event) => (_ctx.handleCancel(modal))
15067
+ }, {
15068
+ default: (0,external_vue_.withCtx)(() => [
15069
+ (0,external_vue_.createTextVNode)((0,external_vue_.toDisplayString)(_ctx.cancelButtonText(modal)), 1)
15070
+ ]),
15071
+ _: 2
15072
+ }, 1032, ["disabled", "onClick"]))
15073
+ : (0,external_vue_.createCommentVNode)("", true)
15074
+ ]),
15075
+ _: 2
15076
+ }, 1032, ["class"]))
15077
+ : (0,external_vue_.createCommentVNode)("", true)
15078
+ ]),
15079
+ _: 2
15080
+ }, 1032, ["class"])
15081
+ ]),
15082
+ _: 2
15083
+ }, 1040, ["modelValue", "onUpdate:modelValue", "content-class", "hide-header-close", "hide-overlay", "no-click-animation", "retain-focus", "scrim", "onHide"])
15084
+ ]));
15085
+ }), 128))
15086
+ ]));
15087
+ }
15088
+
15089
+ ;// CONCATENATED MODULE: ./src/ld-dialog/ld-dialog.vue?vue&type=template&id=184339ee&ts=true
15090
+
15091
+ // EXTERNAL MODULE: ./node_modules/@ldmjs/core/dist/index.js
15092
+ var dist = __webpack_require__(634);
15093
+ ;// CONCATENATED MODULE: ./src/utils/awaiting.ts
15094
+ async function awaiting(callback) {
15095
+ let resolveFunc = null;
15096
+ const counter = 0;
15097
+ let timer = null;
15098
+ const promise = new Promise(resolve => {
15099
+ resolveFunc = resolve;
15100
+ });
15101
+ timer = setInterval(() => {
15102
+ const a = callback();
15103
+ if (counter > 100 || Boolean(a)) {
15104
+ clearInterval(timer);
15105
+ resolveFunc(a ?? true);
15106
+ }
15107
+ }, 100);
15108
+ await promise;
14815
15109
  }
14816
15110
 
14817
15111
  ;// CONCATENATED MODULE: ./src/utils/datetime.ts
@@ -14891,6 +15185,11 @@ function deepValueGetter(obj, path) {
14891
15185
  return current;
14892
15186
  }
14893
15187
 
15188
+ ;// CONCATENATED MODULE: ./src/utils/delay.ts
15189
+ async function delay(timeout) {
15190
+ return new Promise(resolve => setTimeout(() => resolve(), timeout));
15191
+ }
15192
+
14894
15193
  ;// CONCATENATED MODULE: ./src/utils/isObjectEmpty.ts
14895
15194
  function isObjectEmpty(obj) {
14896
15195
  for (const _i in obj) {
@@ -14914,124 +15213,1512 @@ const urlRegexp =
14914
15213
 
14915
15214
 
14916
15215
 
14917
- ;// CONCATENATED MODULE: ./src/mixins/validate.mixin.ts
14918
- var validate_mixin_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
14919
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
14920
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
14921
- 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;
14922
- return c > 3 && r && Object.defineProperty(target, key, r), r;
14923
- };
14924
- var validate_mixin_metadata = (undefined && undefined.__metadata) || function (k, v) {
14925
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
14926
- };
15216
+ ;// CONCATENATED MODULE: ./src/ld-dialog/dialog.manager.ts
14927
15217
 
14928
15218
 
14929
- function validate() {
14930
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
14931
- const errors = this.inputs.filter((input) => input.validate && !input.validate(true)).length;
14932
- return !errors;
14933
- }
14934
- function register(input, section) {
14935
- if (section) {
14936
- this.section = section;
15219
+ var ModalButton;
15220
+ (function (ModalButton) {
15221
+ ModalButton[ModalButton["Ok"] = 0] = "Ok";
15222
+ ModalButton[ModalButton["Cancel"] = 1] = "Cancel";
15223
+ })(ModalButton || (ModalButton = {}));
15224
+ var ModalType;
15225
+ (function (ModalType) {
15226
+ ModalType[ModalType["Alert"] = 0] = "Alert";
15227
+ ModalType[ModalType["Prompt"] = 1] = "Prompt";
15228
+ ModalType[ModalType["Info"] = 2] = "Info";
15229
+ ModalType[ModalType["Confirm"] = 3] = "Confirm";
15230
+ ModalType[ModalType["Select"] = 4] = "Select";
15231
+ ModalType[ModalType["CreateEdit"] = 5] = "CreateEdit";
15232
+ })(ModalType || (ModalType = {}));
15233
+ const GAP = 17;
15234
+ const MARGIN_RIGHT = 25;
15235
+ const MARGIN_BOTTOM = 68;
15236
+ class DialogManager {
15237
+ static exec(modal, fetchData) {
15238
+ switch (modal.constructor.name) {
15239
+ case 'AlertDialog':
15240
+ return DialogManager.alert(modal);
15241
+ case 'PromptDialog':
15242
+ return DialogManager.prompt(modal);
15243
+ case 'ConfirmDialog':
15244
+ return DialogManager.confirm(modal);
15245
+ case 'InfoDialog':
15246
+ return DialogManager.info(modal, fetchData);
15247
+ case 'SelectDialog':
15248
+ return DialogManager.select(modal, fetchData);
15249
+ case 'CreateEditDialog':
15250
+ return DialogManager.createEdit(modal, fetchData);
15251
+ }
15252
+ return null;
14937
15253
  }
14938
- if (this.section && input.validate) {
14939
- // eslint-disable-next-line @typescript-eslint/naming-convention
14940
- input.__cardSection = this.section;
15254
+ constructor() {
15255
+ this._visibled = [];
15256
+ this._minimized = [];
15257
+ this._viewPortWidth = window.innerWidth;
15258
+ window.addEventListener('resize', this.onResizeHandler.bind(this));
14941
15259
  }
14942
- const unwatch = this.watchInput(input);
14943
- this.inputs.push(input);
14944
- this.watchers.push(unwatch);
14945
- }
14946
- function unregister(input) {
14947
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
14948
- const found = this.inputs.find((i) => i.uid === input.uid);
14949
- if (!found) {
14950
- return;
15260
+ setMinimized(minimized) {
15261
+ this._minimized = minimized;
14951
15262
  }
14952
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
14953
- const unwatch = this.watchers.find((i) => i.uid === found.uid);
14954
- if (unwatch.valid) {
14955
- unwatch.valid();
15263
+ modalIdentity(modal, host) {
15264
+ if (!modal.hostObject || !host) {
15265
+ return false;
15266
+ }
15267
+ return (modal.hostObject?.id === host?.id &&
15268
+ modal.hostObject?.contentType === host?.contentType &&
15269
+ modal.hostObject?.kind === host?.kind);
14956
15270
  }
14957
- if (unwatch.shouldValidate) {
14958
- unwatch.shouldValidate();
15271
+ tryToOpen(host) {
15272
+ const found = this._visibled.concat(this._minimized).find(m => this.modalIdentity(m, host));
15273
+ return !found;
14959
15274
  }
14960
- let index = 0;
14961
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
14962
- index = this.watchers.findIndex((i) => i.uid === found.uid);
14963
- this.watchers.splice(index, 1);
14964
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
14965
- index = this.inputs.findIndex((i) => i.uid === found.uid);
14966
- this.inputs.splice(index, 1);
14967
- delete this.errorBag[found.uid];
14968
- }
14969
- function validateSection(section) {
14970
- const errors = this.inputs.filter(
14971
- // eslint-disable-next-line eqeqeq, @typescript-eslint/no-explicit-any
14972
- (input) => input.__cardSection == section && input.validate && !input.validate(true)).length;
14973
- return !errors;
14974
- }
14975
- function watchInput(input) {
14976
- const watcher = (_input) => _input.$watch('hasError', val => {
14977
- this.errorBag[_input.uid] = val;
14978
- }, { immediate: true });
14979
- const watchers = {
14980
- uid: input.uid,
14981
- valid: null,
14982
- shouldValidate: null,
14983
- };
14984
- if (this.lazyValidation) {
14985
- // Only start watching inputs if we need to
14986
- watchers.shouldValidate = input.$watch('shouldValidate', val => {
14987
- if (!val) {
14988
- return;
15275
+ dialogCreated(info) {
15276
+ if (!info) {
15277
+ return;
15278
+ }
15279
+ info.el = document.querySelector(`.${this.uniqKey(info)}`);
15280
+ this.shiftLeft(info);
15281
+ this.refreshPositions();
15282
+ }
15283
+ dialogModalChanged(info, callback = null) {
15284
+ if (!info) {
15285
+ return;
15286
+ }
15287
+ if (info.noModal) {
15288
+ /**
15289
+ * диалог стал немодальным
15290
+ */
15291
+ let timeoutId;
15292
+ let refreshed = false;
15293
+ const resizeEnd = () => {
15294
+ clearTimeout(timeoutId);
15295
+ resizeObserver.unobserve(info.el);
15296
+ this.refreshPositions();
15297
+ refreshed = true;
15298
+ };
15299
+ const resizeObserver = new window.ResizeObserver((entries) => {
15300
+ window.requestAnimationFrame(() => {
15301
+ if (!Array.isArray(entries) || !entries.length) {
15302
+ return null;
15303
+ }
15304
+ if (entries.length && entries[0].contentRect) {
15305
+ clearTimeout(timeoutId);
15306
+ timeoutId = setTimeout(resizeEnd, 50);
15307
+ }
15308
+ });
15309
+ });
15310
+ resizeObserver.observe(info.el);
15311
+ setTimeout(() => {
15312
+ if (!refreshed) {
15313
+ this.refreshPositions();
15314
+ }
15315
+ }, 300);
15316
+ }
15317
+ else {
15318
+ /**
15319
+ * диалог стал модальным
15320
+ */
15321
+ this.setDialogModal(info, callback);
15322
+ }
15323
+ }
15324
+ dialogProcessing(info) {
15325
+ if (!info) {
15326
+ return;
15327
+ }
15328
+ info.minimized = true;
15329
+ this.dialogMinimizeChanged(info);
15330
+ }
15331
+ dialogMinimizeChanged(info) {
15332
+ if (!info) {
15333
+ return;
15334
+ }
15335
+ /**
15336
+ * диалог свернут - диалог развернут
15337
+ */
15338
+ if (info.minimized) {
15339
+ // диалог свернут
15340
+ if (!info.noModal) {
15341
+ /**
15342
+ * если диалог модальный, сначала сделаем его немодальным
15343
+ */
15344
+ info._wasModal = true;
15345
+ info.noModal = true;
15346
+ ;
14989
15347
  }
14990
- // Only watch if we're not already doing it
14991
- if (Object.prototype.hasOwnProperty.call(this.errorBag, input.uid)) {
15348
+ const i = this._visibled.findIndex(m => this.modalIdentity(m, info.hostObject));
15349
+ if (i > -1) {
15350
+ this._visibled.splice(i, 1);
15351
+ }
15352
+ this.addToMinimized(info);
15353
+ this.refreshPositions();
15354
+ }
15355
+ else {
15356
+ // диалог развернут
15357
+ this.removeFromMinimized(info);
15358
+ this.toggleDialogShow(info);
15359
+ this.shiftLeft(info);
15360
+ if (info._wasModal) {
15361
+ info.noModal = false;
15362
+ delete info._wasModal;
15363
+ }
15364
+ if (!info.noModal) {
15365
+ // сделаем окно модальным, если до сворачивания оно было таковым
15366
+ this.setDialogModal(info);
15367
+ }
15368
+ else {
15369
+ this.refreshPositions();
15370
+ }
15371
+ }
15372
+ }
15373
+ dialogClosed(info) {
15374
+ try {
15375
+ if (this.removeFromMinimized(info)) {
14992
15376
  return;
14993
15377
  }
14994
- watchers.valid = watcher(input);
14995
- });
15378
+ const i = this._visibled.findIndex(m => this.modalIdentity(m, info.hostObject));
15379
+ if (i > -1) {
15380
+ this._visibled.splice(i, 1);
15381
+ this.refreshPositions();
15382
+ }
15383
+ }
15384
+ finally {
15385
+ //
15386
+ }
14996
15387
  }
14997
- else {
14998
- watchers.valid = watcher(input);
15388
+ activate(info) {
15389
+ let i = this._minimized.findIndex(d => d === info);
15390
+ let dlg = null;
15391
+ if (i > -1) {
15392
+ dlg = this._minimized[i];
15393
+ this._minimized.splice(i, 1);
15394
+ }
15395
+ if (dlg) {
15396
+ dlg.minimized = false;
15397
+ this.dialogMinimizeChanged(dlg);
15398
+ this.refreshPositions();
15399
+ }
15400
+ else {
15401
+ i = this._visibled.findIndex(m => this.modalIdentity(m, info.hostObject));
15402
+ if (i > -1) {
15403
+ this._visibled.splice(i, 1);
15404
+ }
15405
+ this.shiftLeft(info);
15406
+ this.refreshPositions();
15407
+ }
14999
15408
  }
15000
- return watchers;
15001
- }
15002
- function validate_mixin_reset() {
15003
- for (let i = this.inputs.length; i >= 0; i--) {
15004
- this.inputs[i].reset();
15409
+ onResizeHandler() {
15410
+ this._viewPortWidth = window.innerWidth;
15411
+ this.refreshPositions();
15005
15412
  }
15006
- if (this.lazyValidation) {
15007
- setTimeout(() => {
15008
- this.errorBag = {};
15009
- }, 0);
15413
+ shiftLeft(info) {
15414
+ this._visibled.push(info);
15010
15415
  }
15011
- }
15012
- function resetValidation() {
15013
- for (let i = this.inputs.length; i >= 0; i--) {
15014
- this.inputs[i].resetValidation();
15416
+ /**
15417
+ * --- Позиционирование относительно правого нижнего угла ---
15418
+ * Самый новое созданное или последнее развернутое окно
15419
+ * будет всегда в правом нижнем углу.
15420
+ * Предыдущие ему окна смещаются в сторону левого края,
15421
+ * пока для этого хватает рабочей области.
15422
+ * Окна, не уместившиеся в рабочую область, будут свернуты.
15423
+ */
15424
+ refreshPositions() {
15425
+ let right = 0;
15426
+ let index = -1;
15427
+ let unusedArea = this._viewPortWidth;
15428
+ for (let i = this._visibled.length - 1; i >= 0; i--) {
15429
+ const dlg = this._visibled[i];
15430
+ // пропускаем окна, раскрытые в стандарное представление с затемненным фоном
15431
+ if (!dlg.noModal) {
15432
+ continue;
15433
+ }
15434
+ const offset = dlg.el.clientWidth + GAP;
15435
+ // проверяем, хватит ли незанятой области для отображения еще одного окна
15436
+ if (unusedArea < offset) {
15437
+ const info = this._visibled.shift();
15438
+ info.el.style.bottom = 'unset';
15439
+ info.el.style.right = 'unset';
15440
+ setTimeout(() => {
15441
+ this.addToMinimized(info);
15442
+ }, 1);
15443
+ }
15444
+ else {
15445
+ right = MARGIN_RIGHT + offset * ++index;
15446
+ // на каждой итерации вычисляем ширину незанятой области
15447
+ unusedArea -= MARGIN_RIGHT + offset;
15448
+ dlg.el.style.margin = '0';
15449
+ dlg.el.style.position = 'absolute';
15450
+ dlg.el.style.bottom = `${MARGIN_BOTTOM}px`;
15451
+ dlg.el.style.right = `${right}px`;
15452
+ dlg.el.classList.remove('ld-dialog-content--hidden');
15453
+ }
15454
+ }
15015
15455
  }
15016
- if (this.lazyValidation) {
15017
- setTimeout(() => {
15018
- this.errorBag = {};
15019
- }, 0);
15456
+ setDialogModal(info, callback = null) {
15457
+ if (!info) {
15458
+ return;
15459
+ }
15460
+ info.el.style.position = 'relative';
15461
+ info.el.style.top = 'unset';
15462
+ info.el.style.left = 'unset';
15463
+ info.el.style.bottom = 'unset';
15464
+ info.el.style.right = 'unset';
15465
+ info.el.parentElement.style.justifyContent = 'center';
15466
+ info.el.parentElement.style.alignItems = 'center';
15467
+ }
15468
+ addToMinimized(info) {
15469
+ this.toggleDialogShow(info);
15470
+ info.minimized = true;
15471
+ this._minimized.unshift(info);
15472
+ }
15473
+ removeFromMinimized(info) {
15474
+ const i = this._minimized.findIndex(m => this.modalIdentity(m, info.hostObject));
15475
+ if (i > -1) {
15476
+ this._minimized.splice(i, 1);
15477
+ return true;
15478
+ }
15479
+ return false;
15020
15480
  }
15021
- }
15022
- function onErrorBagChanged() {
15023
- if (this.errorBag) {
15024
- const errors = Object.values(this.errorBag).includes(true);
15025
- this.isValid = !errors;
15481
+ toggleDialogShow(info) {
15482
+ if (info.el.parentElement.style.display !== 'none') {
15483
+ info._lastDisplayProp = info.el.parentElement.style.display;
15484
+ info.el.parentElement.style.display = 'none';
15485
+ }
15486
+ else {
15487
+ info.el.parentElement.style.display = info._lastDisplayProp;
15488
+ }
15026
15489
  }
15027
- else {
15028
- this.isValid = true;
15490
+ uniqKey(info) {
15491
+ return `dlg-${info.id}`;
15029
15492
  }
15030
- }
15031
- const mixin = {
15032
- data() {
15033
- return {
15034
- inputs: [],
15493
+ static alert(modal) {
15494
+ const modalInfo = {
15495
+ title: modal.title,
15496
+ content: modal.content,
15497
+ type: ModalType.Alert,
15498
+ };
15499
+ return DialogManager.execAsync(modalInfo);
15500
+ }
15501
+ static prompt(modal) {
15502
+ const modalInfo = {
15503
+ ...modal,
15504
+ type: ModalType.Prompt
15505
+ };
15506
+ return DialogManager.execAsync(modalInfo);
15507
+ }
15508
+ static confirm(modal) {
15509
+ const modalInfo = {
15510
+ ...modal,
15511
+ content: modal.text,
15512
+ type: ModalType.Confirm,
15513
+ closable: true,
15514
+ };
15515
+ return DialogManager.execAsync(modalInfo);
15516
+ }
15517
+ static info(modal, fetchData) {
15518
+ const modalInfo = {
15519
+ ...modal,
15520
+ type: ModalType.Info,
15521
+ };
15522
+ if (!modalInfo.hostObject) {
15523
+ modalInfo.hostObject = {
15524
+ id: uidGen(6, '0-9'),
15525
+ contentType: 0,
15526
+ kind: 1
15527
+ };
15528
+ }
15529
+ return DialogManager.execAsync(modalInfo, fetchData);
15530
+ }
15531
+ static select(modal, fetchData) {
15532
+ const modalInfo = {
15533
+ ...modal,
15534
+ type: ModalType.Select,
15535
+ };
15536
+ if (!modalInfo.hostObject) {
15537
+ modalInfo.hostObject = {
15538
+ id: uidGen(6, '0-9'),
15539
+ contentType: 0,
15540
+ kind: 1
15541
+ };
15542
+ }
15543
+ return DialogManager.execAsync(modalInfo, fetchData);
15544
+ }
15545
+ static createEdit(modal, fetchData) {
15546
+ const modalInfo = {
15547
+ ...modal,
15548
+ type: ModalType.CreateEdit,
15549
+ };
15550
+ if (!modalInfo.hostObject) {
15551
+ modalInfo.hostObject = {
15552
+ id: uidGen(6, '0-9'),
15553
+ contentType: 0,
15554
+ kind: 1
15555
+ };
15556
+ }
15557
+ return DialogManager.execAsync(modalInfo, fetchData);
15558
+ }
15559
+ static execAsync(modalInfo, fetchData) {
15560
+ return new Promise(resolve => {
15561
+ modalInfo.resolveFunction = resolve;
15562
+ let fetchProps = null;
15563
+ if (fetchData instanceof Function) {
15564
+ fetchProps = async (host) => {
15565
+ if (host.id === modalInfo.hostObject.id) {
15566
+ if (fetchData instanceof Function) {
15567
+ const props = await fetchData();
15568
+ dist.eventBus.$off('dialog:created', fetchProps);
15569
+ dist.eventBus.$emit('dialog:props', props, modalInfo.hostObject);
15570
+ }
15571
+ }
15572
+ };
15573
+ dist.eventBus.$on('dialog:created', fetchProps);
15574
+ }
15575
+ dist.eventBus.$emit('dialog:open', modalInfo);
15576
+ });
15577
+ }
15578
+ }
15579
+
15580
+ ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use!./src/ld-dialog/dialog.minimized.vue?vue&type=template&id=719819aa&ts=true
15581
+
15582
+ const dialog_minimizedvue_type_template_id_719819aa_ts_true_hoisted_1 = {
15583
+ key: 0,
15584
+ class: "minimized-dialogs"
15585
+ };
15586
+ const dialog_minimizedvue_type_template_id_719819aa_ts_true_hoisted_2 = {
15587
+ key: 0,
15588
+ class: "d-flex flex-row-reverse"
15589
+ };
15590
+ const dialog_minimizedvue_type_template_id_719819aa_ts_true_hoisted_3 = ["onClick"];
15591
+ const dialog_minimizedvue_type_template_id_719819aa_ts_true_hoisted_4 = { class: "d-flex align-center justify-between px-2" };
15592
+ const dialog_minimizedvue_type_template_id_719819aa_ts_true_hoisted_5 = { class: "white--text" };
15593
+ const dialog_minimizedvue_type_template_id_719819aa_ts_true_hoisted_6 = /*#__PURE__*/ (0,external_vue_.createElementVNode)("span", null, "Развернуть", -1);
15594
+ const dialog_minimizedvue_type_template_id_719819aa_ts_true_hoisted_7 = /*#__PURE__*/ (0,external_vue_.createElementVNode)("span", null, "Закрыть", -1);
15595
+ const dialog_minimizedvue_type_template_id_719819aa_ts_true_hoisted_8 = { class: "d-flex justify-center" };
15596
+ const dialog_minimizedvue_type_template_id_719819aa_ts_true_hoisted_9 = { class: "body-1 white--text" };
15597
+ const _hoisted_10 = /*#__PURE__*/ (0,external_vue_.createElementVNode)("span", null, "Свёрнутые окна", -1);
15598
+ const _hoisted_11 = { class: "minimized-item__title" };
15599
+ const _hoisted_12 = { class: "minimized-item__subtitle" };
15600
+ const _hoisted_13 = { class: "pa-3" };
15601
+ const _hoisted_14 = /*#__PURE__*/ (0,external_vue_.createElementVNode)("span", null, "Закрыть все", -1);
15602
+ function dialog_minimizedvue_type_template_id_719819aa_ts_true_render(_ctx, _cache, $props, $setup, $data, $options) {
15603
+ const _component_v_spacer = (0,external_vue_.resolveComponent)("v-spacer");
15604
+ const _component_square_button = (0,external_vue_.resolveComponent)("square-button");
15605
+ const _component_v_tooltip = (0,external_vue_.resolveComponent)("v-tooltip");
15606
+ const _component_v_list_item_title = (0,external_vue_.resolveComponent)("v-list-item-title");
15607
+ const _component_v_list_item = (0,external_vue_.resolveComponent)("v-list-item");
15608
+ const _component_v_list = (0,external_vue_.resolveComponent)("v-list");
15609
+ const _component_small_button = (0,external_vue_.resolveComponent)("small-button");
15610
+ const _component_v_card = (0,external_vue_.resolveComponent)("v-card");
15611
+ const _component_v_menu = (0,external_vue_.resolveComponent)("v-menu");
15612
+ return (_ctx.items.length)
15613
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", dialog_minimizedvue_type_template_id_719819aa_ts_true_hoisted_1, [
15614
+ (_ctx.isManyItems)
15615
+ ? ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", dialog_minimizedvue_type_template_id_719819aa_ts_true_hoisted_2, [
15616
+ ((0,external_vue_.openBlock)(true), (0,external_vue_.createElementBlock)(external_vue_.Fragment, null, (0,external_vue_.renderList)(_ctx.items, (item) => {
15617
+ return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("button", {
15618
+ key: item.id,
15619
+ class: "ml-4 minimize-btn",
15620
+ onClick: ($event) => (_ctx.onMaximize(item))
15621
+ }, [
15622
+ (0,external_vue_.createElementVNode)("div", dialog_minimizedvue_type_template_id_719819aa_ts_true_hoisted_4, [
15623
+ (0,external_vue_.createElementVNode)("span", dialog_minimizedvue_type_template_id_719819aa_ts_true_hoisted_5, (0,external_vue_.toDisplayString)(item.processingDescription || item.description || item.title), 1),
15624
+ (0,external_vue_.createTextVNode)(),
15625
+ (0,external_vue_.createVNode)(_component_v_spacer),
15626
+ (0,external_vue_.createTextVNode)(),
15627
+ (0,external_vue_.createElementVNode)("div", null, [
15628
+ (0,external_vue_.createVNode)(_component_v_tooltip, { location: "top" }, {
15629
+ activator: (0,external_vue_.withCtx)(({ props }) => [
15630
+ (0,external_vue_.createVNode)(_component_square_button, (0,external_vue_.mergeProps)(props, {
15631
+ color: "white",
15632
+ onClick: ($event) => (_ctx.onMaximize(item))
15633
+ }), {
15634
+ default: (0,external_vue_.withCtx)(() => [
15635
+ ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)((0,external_vue_.resolveDynamicComponent)(_ctx.$ldmui.options.aliases['ld-icon']), null, {
15636
+ default: (0,external_vue_.withCtx)(() => [
15637
+ (0,external_vue_.createTextVNode)("\r\n open_in_full\r\n ")
15638
+ ]),
15639
+ _: 1
15640
+ }))
15641
+ ]),
15642
+ _: 2
15643
+ }, 1040, ["onClick"])
15644
+ ]),
15645
+ default: (0,external_vue_.withCtx)(() => [
15646
+ (0,external_vue_.createTextVNode)(),
15647
+ dialog_minimizedvue_type_template_id_719819aa_ts_true_hoisted_6
15648
+ ]),
15649
+ _: 2
15650
+ }, 1024),
15651
+ (0,external_vue_.createTextVNode)(),
15652
+ (0,external_vue_.createVNode)(_component_v_tooltip, { location: "top" }, {
15653
+ activator: (0,external_vue_.withCtx)(({ props }) => [
15654
+ (0,external_vue_.createVNode)(_component_square_button, (0,external_vue_.mergeProps)(props, {
15655
+ color: "white",
15656
+ onClick: (0,external_vue_.withModifiers)(($event) => (_ctx.onClose(item)), ["stop"])
15657
+ }), {
15658
+ default: (0,external_vue_.withCtx)(() => [
15659
+ ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)((0,external_vue_.resolveDynamicComponent)(_ctx.$ldmui.options.aliases['ld-icon']), null, {
15660
+ default: (0,external_vue_.withCtx)(() => [
15661
+ (0,external_vue_.createTextVNode)("close")
15662
+ ]),
15663
+ _: 1
15664
+ }))
15665
+ ]),
15666
+ _: 2
15667
+ }, 1040, ["onClick"])
15668
+ ]),
15669
+ default: (0,external_vue_.withCtx)(() => [
15670
+ (0,external_vue_.createTextVNode)(),
15671
+ dialog_minimizedvue_type_template_id_719819aa_ts_true_hoisted_7
15672
+ ]),
15673
+ _: 2
15674
+ }, 1024)
15675
+ ])
15676
+ ])
15677
+ ], 8, dialog_minimizedvue_type_template_id_719819aa_ts_true_hoisted_3));
15678
+ }), 128))
15679
+ ]))
15680
+ : ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_v_menu, { key: 1 }, {
15681
+ activator: (0,external_vue_.withCtx)(({ props }) => [
15682
+ (0,external_vue_.createElementVNode)("button", (0,external_vue_.mergeProps)(props, { class: "minimize-btn" }), [
15683
+ (0,external_vue_.createElementVNode)("div", dialog_minimizedvue_type_template_id_719819aa_ts_true_hoisted_8, [
15684
+ (0,external_vue_.createElementVNode)("span", dialog_minimizedvue_type_template_id_719819aa_ts_true_hoisted_9, [
15685
+ _hoisted_10,
15686
+ (0,external_vue_.createTextVNode)(" (" + (0,external_vue_.toDisplayString)(_ctx.items.length) + ") ", 1)
15687
+ ])
15688
+ ])
15689
+ ], 16)
15690
+ ]),
15691
+ default: (0,external_vue_.withCtx)(() => [
15692
+ (0,external_vue_.createTextVNode)(),
15693
+ (0,external_vue_.createVNode)(_component_v_card, {
15694
+ class: "d-flex flex-column overflow-hidden",
15695
+ style: { "max-height": "65vh" }
15696
+ }, {
15697
+ default: (0,external_vue_.withCtx)(() => [
15698
+ (0,external_vue_.createVNode)(_component_v_list, null, {
15699
+ default: (0,external_vue_.withCtx)(() => [
15700
+ ((0,external_vue_.openBlock)(true), (0,external_vue_.createElementBlock)(external_vue_.Fragment, null, (0,external_vue_.renderList)(_ctx.items, (item) => {
15701
+ return ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)(_component_v_list_item, {
15702
+ key: item.id,
15703
+ onClick: ($event) => (_ctx.onMaximize(item))
15704
+ }, {
15705
+ append: (0,external_vue_.withCtx)(() => [
15706
+ (0,external_vue_.createVNode)(_component_square_button, {
15707
+ onClick: (0,external_vue_.withModifiers)(($event) => (_ctx.onMaximize(item)), ["stop"])
15708
+ }, {
15709
+ default: (0,external_vue_.withCtx)(() => [
15710
+ ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)((0,external_vue_.resolveDynamicComponent)(_ctx.$ldmui.options.aliases['ld-icon']), null, {
15711
+ default: (0,external_vue_.withCtx)(() => [
15712
+ (0,external_vue_.createTextVNode)("\r\n open_in_full\r\n ")
15713
+ ]),
15714
+ _: 1
15715
+ }))
15716
+ ]),
15717
+ _: 2
15718
+ }, 1032, ["onClick"]),
15719
+ (0,external_vue_.createTextVNode)(),
15720
+ (0,external_vue_.createVNode)(_component_square_button, {
15721
+ onClick: (0,external_vue_.withModifiers)(($event) => (_ctx.onClose(item)), ["stop"])
15722
+ }, {
15723
+ default: (0,external_vue_.withCtx)(() => [
15724
+ ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)((0,external_vue_.resolveDynamicComponent)(_ctx.$ldmui.options.aliases['ld-icon']), null, {
15725
+ default: (0,external_vue_.withCtx)(() => [
15726
+ (0,external_vue_.createTextVNode)("\r\n close\r\n ")
15727
+ ]),
15728
+ _: 1
15729
+ }))
15730
+ ]),
15731
+ _: 2
15732
+ }, 1032, ["onClick"])
15733
+ ]),
15734
+ default: (0,external_vue_.withCtx)(() => [
15735
+ (0,external_vue_.createVNode)(_component_v_list_item_title, {
15736
+ class: (0,external_vue_.normalizeClass)({ 'changed': _ctx.itemIsChanged(item) })
15737
+ }, {
15738
+ default: (0,external_vue_.withCtx)(() => [
15739
+ (0,external_vue_.createElementVNode)("div", _hoisted_11, (0,external_vue_.toDisplayString)(item.description), 1),
15740
+ (0,external_vue_.createTextVNode)(),
15741
+ (0,external_vue_.createElementVNode)("div", _hoisted_12, (0,external_vue_.toDisplayString)(item.title), 1)
15742
+ ]),
15743
+ _: 2
15744
+ }, 1032, ["class"]),
15745
+ (0,external_vue_.createTextVNode)()
15746
+ ]),
15747
+ _: 2
15748
+ }, 1032, ["onClick"]));
15749
+ }), 128))
15750
+ ]),
15751
+ _: 1
15752
+ }),
15753
+ (0,external_vue_.createTextVNode)(),
15754
+ (0,external_vue_.createElementVNode)("div", _hoisted_13, [
15755
+ (0,external_vue_.createVNode)(_component_small_button, {
15756
+ color: "grey",
15757
+ variant: "outlined",
15758
+ onClick: _ctx.onCloseAll
15759
+ }, {
15760
+ default: (0,external_vue_.withCtx)(() => [
15761
+ ((0,external_vue_.openBlock)(), (0,external_vue_.createBlock)((0,external_vue_.resolveDynamicComponent)(_ctx.$ldmui.options.aliases['ld-icon']), { color: "error" }, {
15762
+ default: (0,external_vue_.withCtx)(() => [
15763
+ (0,external_vue_.createTextVNode)("\r\n close\r\n ")
15764
+ ]),
15765
+ _: 1
15766
+ })),
15767
+ (0,external_vue_.createTextVNode)(),
15768
+ _hoisted_14
15769
+ ]),
15770
+ _: 1
15771
+ }, 8, ["onClick"])
15772
+ ])
15773
+ ]),
15774
+ _: 1
15775
+ })
15776
+ ]),
15777
+ _: 1
15778
+ }))
15779
+ ]))
15780
+ : (0,external_vue_.createCommentVNode)("", true);
15781
+ }
15782
+
15783
+ ;// CONCATENATED MODULE: ./src/ld-dialog/dialog.minimized.vue?vue&type=template&id=719819aa&ts=true
15784
+
15785
+ ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-dialog/dialog.minimized.ts?vue&type=script&lang=ts&external
15786
+ var dialog_minimizedvue_type_script_lang_ts_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
15787
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15788
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
15789
+ 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;
15790
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
15791
+ };
15792
+ var dialog_minimizedvue_type_script_lang_ts_external_metadata = (undefined && undefined.__metadata) || function (k, v) {
15793
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
15794
+ };
15795
+ var dialog_minimizedvue_type_script_lang_ts_external_a;
15796
+
15797
+
15798
+ let DialogMinimizedComponent = class DialogMinimizedComponent extends external_vue_property_decorator_.Vue {
15799
+ created() {
15800
+ this.maximizeHandler = this.onMaximize.bind(this);
15801
+ dist.eventBus.$on('modal-maximize', this.maximizeHandler);
15802
+ }
15803
+ beforeUnmount() {
15804
+ dist.eventBus.$off('modal-maximize', this.maximizeHandler);
15805
+ }
15806
+ onMaximize(item) {
15807
+ const dlg = this.dialogs.find(d => d.id === item.id);
15808
+ if (dlg) {
15809
+ this.$emit('maximize', dlg);
15810
+ }
15811
+ }
15812
+ onClose(item) {
15813
+ const dlg = this.dialogs.find(d => d.id === item.id);
15814
+ if (dlg) {
15815
+ this.$emit('close', dlg);
15816
+ }
15817
+ }
15818
+ onCloseAll() {
15819
+ this.$emit('close-all');
15820
+ }
15821
+ itemIsChanged(item) {
15822
+ if (!item.isChanged || typeof item.isChanged !== 'function') {
15823
+ return false;
15824
+ }
15825
+ return item.isChanged();
15826
+ }
15827
+ get label() {
15828
+ return 'Свёрнутые окна';
15829
+ }
15830
+ get items() {
15831
+ return this.dialogs ?? [];
15832
+ }
15833
+ get isManyItems() {
15834
+ return this.items.length && this.items.length < 5;
15835
+ }
15836
+ };
15837
+ dialog_minimizedvue_type_script_lang_ts_external_decorate([
15838
+ (0,external_vue_property_decorator_.Prop)(),
15839
+ dialog_minimizedvue_type_script_lang_ts_external_metadata("design:type", typeof (dialog_minimizedvue_type_script_lang_ts_external_a = typeof Array !== "undefined" && Array) === "function" ? dialog_minimizedvue_type_script_lang_ts_external_a : Object)
15840
+ ], DialogMinimizedComponent.prototype, "dialogs", void 0);
15841
+ DialogMinimizedComponent = dialog_minimizedvue_type_script_lang_ts_external_decorate([
15842
+ (0,external_vue_property_decorator_.Options)({
15843
+ emits: [
15844
+ 'maximize',
15845
+ 'close',
15846
+ 'close-all'
15847
+ ]
15848
+ })
15849
+ ], DialogMinimizedComponent);
15850
+ /* harmony default export */ const dialog_minimizedvue_type_script_lang_ts_external = (DialogMinimizedComponent);
15851
+
15852
+ ;// CONCATENATED MODULE: ./src/ld-dialog/dialog.minimized.ts?vue&type=script&lang=ts&external
15853
+
15854
+ ;// CONCATENATED MODULE: ./src/ld-dialog/dialog.minimized.vue
15855
+
15856
+
15857
+
15858
+
15859
+ ;
15860
+ const dialog_minimized_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(dialog_minimizedvue_type_script_lang_ts_external, [['render',dialog_minimizedvue_type_template_id_719819aa_ts_true_render]])
15861
+
15862
+ /* harmony default export */ const dialog_minimized = (dialog_minimized_exports_);
15863
+ ;// CONCATENATED MODULE: ./src/ld-dialog/dialogs.ts
15864
+ class Dialog {
15865
+ constructor(title, content = '') {
15866
+ this.title = title;
15867
+ this.content = content;
15868
+ }
15869
+ ;
15870
+ }
15871
+ class AlertDialog extends Dialog {
15872
+ constructor(data) {
15873
+ super(data.title, data.text);
15874
+ }
15875
+ }
15876
+ class PromptDialog extends Dialog {
15877
+ constructor(data) {
15878
+ super(data.title, data.content);
15879
+ this.title = data.title;
15880
+ this.width = data.width || '60%';
15881
+ }
15882
+ }
15883
+ class ConfirmDialog extends Dialog {
15884
+ constructor(data) {
15885
+ super(data.title);
15886
+ this.title = data.title;
15887
+ this.text = data.text;
15888
+ this.okTitle = data.okTitle;
15889
+ this.cancelTitle = data.cancelTitle;
15890
+ this.okResult = data.okResult;
15891
+ this.cancelResult = data.cancelResult;
15892
+ }
15893
+ ;
15894
+ }
15895
+ class InfoDialog extends Dialog {
15896
+ constructor(data) {
15897
+ super(data.title);
15898
+ this.title = data.title;
15899
+ this.component = data.component;
15900
+ this.componentProps = data.componentProps;
15901
+ this.width = data.width;
15902
+ this.height = data.height;
15903
+ this.loading = data.loading;
15904
+ this.fullHeight = data.fullHeight;
15905
+ this.closable = data.closable;
15906
+ this.hideFooter = data.hideFooter;
15907
+ this.minimizable = data.minimizable;
15908
+ this.description = data.description;
15909
+ this.hostObject = data.hostObject;
15910
+ }
15911
+ }
15912
+ class SelectDialog {
15913
+ constructor(data) {
15914
+ this.title = data.title;
15915
+ this.component = data.component;
15916
+ this.componentProps = data.componentProps;
15917
+ this.loading = data.loading;
15918
+ this.fullHeight = data.fullHeight;
15919
+ this.width = data.width;
15920
+ this.height = data.height;
15921
+ this.selectAsOk = data.selectAsOk;
15922
+ }
15923
+ }
15924
+ class CreateEditDialog {
15925
+ constructor(data) {
15926
+ this._isChanged = null;
15927
+ this.title = data.title;
15928
+ this.component = data.component;
15929
+ this.componentProps = {
15930
+ ...data.componentProps,
15931
+ setIsChangedCallback: this.setIsChangedCallback.bind(this),
15932
+ };
15933
+ this.hostObject = data.hostObject;
15934
+ this.loading = data.loading;
15935
+ this.fullHeight = data.fullHeight;
15936
+ this.width = data.width;
15937
+ this.height = data.height;
15938
+ this.hideFooter = data.hideFooter;
15939
+ this.darkTitle = data.darkTitle;
15940
+ this.closable = data.closable;
15941
+ this.expandable = data.expandable;
15942
+ this.minimizable = data.minimizable;
15943
+ this.collapsedSize = data.collapsedSize;
15944
+ this.expandedSize = data.expandedSize;
15945
+ this.expanded = data.expanded;
15946
+ this.description = data.description;
15947
+ this.noModal = data.noModal;
15948
+ this.okTitle = data.okTitle;
15949
+ this.cancelTitle = data.cancelTitle;
15950
+ this.isChanged = () => {
15951
+ if (this._isChanged instanceof Function) {
15952
+ return this._isChanged();
15953
+ }
15954
+ return false;
15955
+ };
15956
+ }
15957
+ setIsChangedCallback(callback) {
15958
+ this._isChanged = callback;
15959
+ }
15960
+ }
15961
+
15962
+ ;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-1.use!./src/ld-dialog/ld-dialog.ts?vue&type=script&lang=ts&external
15963
+ var ld_dialogvue_type_script_lang_ts_external_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
15964
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15965
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
15966
+ 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;
15967
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
15968
+ };
15969
+ var ld_dialogvue_type_script_lang_ts_external_metadata = (undefined && undefined.__metadata) || function (k, v) {
15970
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
15971
+ };
15972
+
15973
+
15974
+
15975
+
15976
+
15977
+
15978
+
15979
+
15980
+ let DialogComponent = class DialogComponent extends (0,external_vue_class_component_.mixins)(ViewportMixin) {
15981
+ constructor() {
15982
+ super(...arguments);
15983
+ this.minimized = [];
15984
+ this.dialogManager = new DialogManager();
15985
+ this.modals = [];
15986
+ this.modalResult = null;
15987
+ this.listeners = new Map();
15988
+ this.resizingModalId = null;
15989
+ }
15990
+ emitFocus(value) {
15991
+ return value;
15992
+ }
15993
+ onModalsChanged() {
15994
+ const hasModals = this.modals.some(m => !m.minimized && !m.noModal);
15995
+ this.emitFocus(hasModals);
15996
+ }
15997
+ created() {
15998
+ this.dialogManager.setMinimized(this.minimized);
15999
+ }
16000
+ mounted() {
16001
+ this.$nextTick(() => {
16002
+ dist.eventBus.$on('dialog:open', this.open);
16003
+ dist.eventBus.$on('dialog:props', this.onSetProps);
16004
+ dist.eventBus.$on('dialog:close:all', this.closeAll);
16005
+ });
16006
+ }
16007
+ beforeUnmount() {
16008
+ dist.eventBus.$off('dialog:open', this.open);
16009
+ dist.eventBus.$off('dialog:props', this.onSetProps);
16010
+ dist.eventBus.$off('dialog:close:all', this.closeAll);
16011
+ }
16012
+ async open(modalInfo) {
16013
+ if (modalInfo.hostObject) {
16014
+ const found = this.findModal(modalInfo.hostObject);
16015
+ if (found) {
16016
+ this.dialogManager.activate(found);
16017
+ return;
16018
+ }
16019
+ }
16020
+ const modal = {
16021
+ id: Number(modalInfo.hostObject?.id) || this.$utils.uidGen(4, '0-9'),
16022
+ component: modalInfo.component,
16023
+ componentProps: modalInfo.componentProps,
16024
+ hostObject: modalInfo.hostObject,
16025
+ loading: modalInfo.loading,
16026
+ noModal: modalInfo.noModal,
16027
+ type: modalInfo.type,
16028
+ title: modalInfo.title,
16029
+ darkTitle: modalInfo.darkTitle,
16030
+ content: modalInfo.content,
16031
+ resolveFunction: modalInfo.resolveFunction,
16032
+ okTitle: modalInfo.okTitle,
16033
+ cancelTitle: modalInfo.cancelTitle,
16034
+ okResult: modalInfo.okResult,
16035
+ cancelResult: modalInfo.cancelResult,
16036
+ okOnly: modalInfo.type === ModalType.Alert ||
16037
+ modalInfo.type === ModalType.Info,
16038
+ show: true,
16039
+ okLoading: false,
16040
+ okDisabled: modalInfo.type === ModalType.Select,
16041
+ selectAsOk: modalInfo.selectAsOk,
16042
+ hideFooter: this.$utils.isDefined(modalInfo.hideFooter)
16043
+ ? modalInfo.hideFooter
16044
+ : this.$utils.isDefined(modalInfo.selectAsOk)
16045
+ ? modalInfo.selectAsOk
16046
+ : false,
16047
+ resolved: false,
16048
+ width: modalInfo.width,
16049
+ height: modalInfo.height,
16050
+ fullHeight: modalInfo.fullHeight,
16051
+ closable: this.$utils.isDefined(modalInfo.closable) ? modalInfo.closable : true,
16052
+ expandable: modalInfo.expandable,
16053
+ minimizable: modalInfo.minimizable,
16054
+ minimized: false,
16055
+ expandedSize: modalInfo.expandedSize,
16056
+ collapsedSize: modalInfo.collapsedSize,
16057
+ isChanged: modalInfo.isChanged,
16058
+ /**
16059
+ * не дает диалогу автоматом устанавливать фокус на первом focusable элементе (при срабатывании focusin)
16060
+ * т.к. это причина зависания страницы, если одновременно несколько диалогов на экране
16061
+ */
16062
+ retainFocus: false,
16063
+ };
16064
+ if (modal.expandable) {
16065
+ modal.expanded = modalInfo.expanded;
16066
+ if (!modal.expandedSize && !modal.collapsedSize) {
16067
+ const width = modal.width ?? '80%';
16068
+ const height = modal.height ?? width;
16069
+ modal.expandedSize = { width, height };
16070
+ modal.collapsedSize = { width, height };
16071
+ }
16072
+ else if (modal.expandedSize && !modal.collapsedSize) {
16073
+ const { height, width } = modal.expandedSize;
16074
+ modal.noModal = modal.expandedSize.noModal;
16075
+ modal.collapsedSize = { height, width };
16076
+ }
16077
+ else if (!modal.expandedSize && modal.collapsedSize) {
16078
+ const { height, width } = modal.collapsedSize;
16079
+ modal.noModal = modal.collapsedSize.noModal;
16080
+ modal.expandedSize = { height, width };
16081
+ }
16082
+ else {
16083
+ modal.noModal = !modal.expanded;
16084
+ }
16085
+ if (!modal.noModal) {
16086
+ modal.expanded = true;
16087
+ }
16088
+ if (modal.expanded) {
16089
+ modal.noModal = false;
16090
+ }
16091
+ }
16092
+ this.modals.push(modal);
16093
+ const checkDialogExist = setInterval(() => {
16094
+ const el = document.querySelector(`.${this.uniqKey(modal)}`);
16095
+ if (el) {
16096
+ clearInterval(checkDialogExist);
16097
+ this.listenerMap.set(modal, (e) => {
16098
+ if (!this.listenerMap.isLast(modal)) {
16099
+ return;
16100
+ }
16101
+ if (e.key === 'Enter' && this.isConfirmDialog(modal)) {
16102
+ this.handleOk(modal);
16103
+ }
16104
+ if (e.key === 'Escape' && this.isConfirmDialog(modal)) {
16105
+ this.handleCancel(modal);
16106
+ }
16107
+ });
16108
+ modal.el = el;
16109
+ if (this.isConfirmDialog(modal)) {
16110
+ const btnOk = modal.el.querySelector('#modalOk');
16111
+ if (btnOk) {
16112
+ btnOk.focus();
16113
+ }
16114
+ }
16115
+ this.dialogManager.dialogCreated(modal);
16116
+ dist.eventBus.$emit('dialog:created', modal.hostObject);
16117
+ }
16118
+ }, 100);
16119
+ }
16120
+ modalClass(modal) {
16121
+ const result = [
16122
+ `${this.uniqKey(modal)} ${ModalType[modal.type]}`
16123
+ ];
16124
+ if (this.isMobileGlobal) {
16125
+ return result;
16126
+ }
16127
+ if (!modal.width) {
16128
+ result.push('modal');
16129
+ }
16130
+ if (modal.fullHeight || modal.height === '100%') {
16131
+ result.push('h-100');
16132
+ }
16133
+ if (modal.noModal) {
16134
+ result.push('ld-dialog-content--hidden');
16135
+ }
16136
+ return result;
16137
+ }
16138
+ modalWidth(modal) {
16139
+ this.$nextTick(() => {
16140
+ if (modal.expandable || modal.height) {
16141
+ if (!modal.el) {
16142
+ modal.el = document.querySelector(`.${this.uniqKey(modal)}`);
16143
+ }
16144
+ if (modal.el) {
16145
+ modal.el.style.height = String(this.modalHeight(modal));
16146
+ modal.el.style.borderRadius = 'var(--toolbar-border-radius)';
16147
+ modal.el.style.overflow = 'hidden';
16148
+ }
16149
+ }
16150
+ });
16151
+ if (modal.expandable) {
16152
+ return modal.expanded ? modal.expandedSize?.width : modal.collapsedSize?.width;
16153
+ }
16154
+ return modal.width ? modal.width : 'auto';
16155
+ }
16156
+ modalHeight(modal) {
16157
+ if (modal.expandable) {
16158
+ return modal.expanded ? modal.expandedSize?.height : modal.collapsedSize?.height;
16159
+ }
16160
+ return modal.height || 'auto';
16161
+ }
16162
+ modalTitle(modal) {
16163
+ if (modal.description instanceof Function) {
16164
+ return modal.description();
16165
+ }
16166
+ return modal.description || modal.title;
16167
+ }
16168
+ handleHide(modal) {
16169
+ if (!modal.resolved) {
16170
+ this.handleOk(modal);
16171
+ }
16172
+ }
16173
+ async handleOk(modal, settedResult) {
16174
+ let removeModal = true;
16175
+ try {
16176
+ switch (modal.type) {
16177
+ case ModalType.Info:
16178
+ if (modal.componentInstance && modal.componentInstance.onClose) {
16179
+ const canCloseModal = await modal.componentInstance.onClose();
16180
+ if (canCloseModal === false) {
16181
+ removeModal = false;
16182
+ return;
16183
+ }
16184
+ }
16185
+ break;
16186
+ case ModalType.Prompt:
16187
+ return modal.resolveFunction(modal.content);
16188
+ case ModalType.CreateEdit:
16189
+ if (modal.componentInstance && modal.componentInstance.save && !settedResult) {
16190
+ removeModal = false;
16191
+ modal.okLoading = true;
16192
+ let resultSave = modal.componentInstance.save.call(modal.componentInstance);
16193
+ if (resultSave instanceof Promise) {
16194
+ try {
16195
+ resultSave = await resultSave;
16196
+ if (resultSave) {
16197
+ this.modalResult = resultSave;
16198
+ }
16199
+ }
16200
+ catch (e) {
16201
+ /* eslint-disable no-console */
16202
+ console.error(e);
16203
+ }
16204
+ finally {
16205
+ modal.okLoading = false;
16206
+ }
16207
+ }
16208
+ else {
16209
+ modal.okLoading = false;
16210
+ this.modalResult = resultSave;
16211
+ }
16212
+ }
16213
+ break;
16214
+ }
16215
+ modal.show = false;
16216
+ if (modal.type !== ModalType.Select && modal.type !== ModalType.CreateEdit) {
16217
+ const okResult = this.$utils.isDefined(modal.okResult) ? modal.okResult : true;
16218
+ return modal.resolveFunction(okResult);
16219
+ }
16220
+ modal.resolveFunction(this.modalResult);
16221
+ this.modalResult = null;
16222
+ }
16223
+ finally {
16224
+ if (removeModal) {
16225
+ this.remove(modal);
16226
+ this.listenerMap.remove(modal);
16227
+ }
16228
+ }
16229
+ }
16230
+ async handleCancel(modal, fromCloseButton = false) {
16231
+ try {
16232
+ if ([ModalType.CreateEdit, ModalType.Info].includes(modal.type)) {
16233
+ if (modal.componentInstance && modal.componentInstance.onClose) {
16234
+ const canCloseModal = await modal.componentInstance.onClose();
16235
+ if (canCloseModal === false || modal.type === ModalType.CreateEdit) {
16236
+ return;
16237
+ }
16238
+ }
16239
+ let canUnload = false;
16240
+ let dialogText = 'Вы уверены, что хотите закрыть окно?';
16241
+ if (modal.isChanged instanceof Function) {
16242
+ canUnload = !modal.isChanged();
16243
+ }
16244
+ else {
16245
+ const event = new Event('beforeunload');
16246
+ event.modal = true;
16247
+ window.dispatchEvent(event);
16248
+ canUnload = 'canUnload' in event ? event.canUnload : true;
16249
+ dialogText = event.dialogText ?? dialogText;
16250
+ }
16251
+ if (!canUnload) {
16252
+ const confirm = await DialogManager.exec(new ConfirmDialog({
16253
+ title: 'Подтверждение',
16254
+ text: dialogText
16255
+ }));
16256
+ if (!confirm) {
16257
+ return;
16258
+ }
16259
+ }
16260
+ }
16261
+ modal.show = false;
16262
+ if (modal.type !== ModalType.Select) {
16263
+ const cancelResult = !fromCloseButton && modal.cancelResult != null ? modal.cancelResult : false;
16264
+ return modal.resolveFunction(cancelResult);
16265
+ }
16266
+ modal.resolveFunction(this.modalResult);
16267
+ this.modalResult = null;
16268
+ }
16269
+ finally {
16270
+ if (!modal.show) {
16271
+ this.remove(modal);
16272
+ this.listenerMap.remove(modal);
16273
+ dist.eventBus.$emit('modal-cancel');
16274
+ }
16275
+ }
16276
+ }
16277
+ async handleCancelAll() {
16278
+ const confirm = await DialogManager.exec(new ConfirmDialog({
16279
+ title: 'Подтверждение',
16280
+ text: 'Возможно, вами были внесены изменения. Вы уверены, что хотите закрыть все окна?'
16281
+ }));
16282
+ if (!confirm) {
16283
+ return;
16284
+ }
16285
+ this.closeAll(true);
16286
+ }
16287
+ onSetProps(props, host) {
16288
+ const found = this.findModal(host);
16289
+ if (found) {
16290
+ found.componentProps = {
16291
+ ...found.componentProps,
16292
+ ...props
16293
+ };
16294
+ found.loading = false;
16295
+ }
16296
+ }
16297
+ onSetResult(modal, result) {
16298
+ modal.okLoading = false;
16299
+ this.modalResult = result;
16300
+ if (result) {
16301
+ if (modal.selectAsOk || this.isCreateEditDialog(modal)) {
16302
+ return this.handleOk(modal, result);
16303
+ }
16304
+ if (Array.isArray(result)) {
16305
+ modal.okDisabled = result.length === 0;
16306
+ }
16307
+ else {
16308
+ modal.okDisabled = false;
16309
+ }
16310
+ }
16311
+ else {
16312
+ modal.okDisabled = true;
16313
+ }
16314
+ }
16315
+ onSetResultAndClose(modal, result) {
16316
+ this.modalResult = result;
16317
+ if (result) {
16318
+ modal.show = false;
16319
+ return this.handleOk(modal, result);
16320
+ }
16321
+ modal.okDisabled = true;
16322
+ }
16323
+ onExpandCollapse(modal) {
16324
+ this.resizingModalId = modal.id;
16325
+ if (window.requestAnimationFrame) {
16326
+ window.requestAnimationFrame(() => {
16327
+ modal.expanded = !modal.expanded;
16328
+ const prevNoModal = modal.noModal;
16329
+ modal.noModal = !modal.expanded;
16330
+ window.requestAnimationFrame(() => {
16331
+ if (modal.noModal !== prevNoModal) {
16332
+ this.dialogManager.dialogModalChanged(modal);
16333
+ }
16334
+ setTimeout(() => {
16335
+ this.resizingModalId = null;
16336
+ }, 400);
16337
+ });
16338
+ });
16339
+ }
16340
+ }
16341
+ onMinimize(modal) {
16342
+ modal.minimized = !modal.minimized;
16343
+ this.dialogManager.dialogMinimizeChanged(modal);
16344
+ dist.eventBus.$emit('on-minimize', modal.minimized);
16345
+ }
16346
+ onActivate(modal) {
16347
+ modal.processingDescription = null;
16348
+ this.dialogManager.activate(modal);
16349
+ }
16350
+ onProcessing(modal, message) {
16351
+ if (message) {
16352
+ modal.processingDescription = message;
16353
+ }
16354
+ this.dialogManager.dialogProcessing(modal);
16355
+ }
16356
+ remove(modal) {
16357
+ modal.resolved = true;
16358
+ this.$nextTick(() => {
16359
+ const i = this.modals.indexOf(modal);
16360
+ if (i > -1) {
16361
+ this.modals.splice(i, 1);
16362
+ this.dialogManager.dialogClosed(modal);
16363
+ }
16364
+ });
16365
+ ;
16366
+ }
16367
+ isAlertDialog(modal) {
16368
+ return modal.type === ModalType.Alert;
16369
+ }
16370
+ isPromptDialog(modal) {
16371
+ return modal.type === ModalType.Prompt;
16372
+ }
16373
+ isConfirmDialog(modal) {
16374
+ return modal.type === ModalType.Confirm;
16375
+ }
16376
+ isInfoDialog(modal) {
16377
+ return modal.type === ModalType.Info;
16378
+ }
16379
+ isSelectDialog(modal) {
16380
+ return modal.type === ModalType.Select;
16381
+ }
16382
+ isCreateEditDialog(modal) {
16383
+ return modal.type === ModalType.CreateEdit;
16384
+ }
16385
+ isExpanded(modal) {
16386
+ if (!modal.expandable) {
16387
+ return false;
16388
+ }
16389
+ return modal.expanded;
16390
+ }
16391
+ isCollapsed(modal) {
16392
+ if (!modal.expandable) {
16393
+ return false;
16394
+ }
16395
+ return !modal.expanded;
16396
+ }
16397
+ setVisibility(id) {
16398
+ if (!this.resizingModalId) {
16399
+ return 'visible';
16400
+ }
16401
+ if (id === this.resizingModalId) {
16402
+ return 'hidden';
16403
+ }
16404
+ return 'visible';
16405
+ }
16406
+ okButtonText(modal) {
16407
+ if (modal.okTitle) {
16408
+ return modal.okTitle;
16409
+ }
16410
+ switch (modal.type) {
16411
+ case ModalType.Select:
16412
+ return 'Выбрать';
16413
+ case ModalType.Confirm:
16414
+ return 'Да';
16415
+ case ModalType.Info:
16416
+ return 'Закрыть';
16417
+ case ModalType.CreateEdit:
16418
+ return 'Сохранить';
16419
+ default:
16420
+ return 'Ок';
16421
+ }
16422
+ }
16423
+ cancelButtonText(modal) {
16424
+ if (modal.cancelTitle) {
16425
+ return modal.cancelTitle;
16426
+ }
16427
+ if (modal.type === ModalType.Confirm) {
16428
+ return 'Нет';
16429
+ }
16430
+ return 'Отменить';
16431
+ }
16432
+ onComponentInstanceCreated(modal, instance) {
16433
+ modal.componentInstance = instance;
16434
+ }
16435
+ dialogBindings(modal) {
16436
+ if (this.isMobileGlobal) {
16437
+ return {
16438
+ fullscreen: this.isSelectDialog(modal) || this.isCreateEditDialog(modal),
16439
+ fullWidth: true,
16440
+ transition: 'dialog-bottom-transition'
16441
+ };
16442
+ }
16443
+ return {
16444
+ width: this.modalWidth(modal),
16445
+ minWidth: '320',
16446
+ };
16447
+ }
16448
+ cardClasses(modal) {
16449
+ const result = ['card'];
16450
+ if (this.isMobileGlobal) {
16451
+ result.push('card--mobile');
16452
+ }
16453
+ if (!this.isSelectDialog(modal) && !this.isCreateEditDialog(modal)) {
16454
+ result.push(this.isMobileGlobal ? 'not-select-dialog' : 'card--simple');
16455
+ }
16456
+ return result;
16457
+ }
16458
+ isTitleDark(modal) {
16459
+ if (this.isMobileGlobal) {
16460
+ return this.isSelectDialog(modal) || this.isCreateEditDialog(modal);
16461
+ }
16462
+ return modal.darkTitle;
16463
+ }
16464
+ uniqKey(modal) {
16465
+ return `dlg-${modal.id}`;
16466
+ }
16467
+ findModal(host) {
16468
+ return this.modals.find(m => this.dialogManager.modalIdentity(m, host));
16469
+ }
16470
+ closeAll(all = false) {
16471
+ this.modals.forEach(modal => {
16472
+ if (all || !modal.noModal) {
16473
+ this.remove(modal);
16474
+ }
16475
+ });
16476
+ }
16477
+ get listenerMap() {
16478
+ let lastId = null;
16479
+ function set(modal, handler) {
16480
+ handler = handler.bind(this);
16481
+ lastId = modal.id;
16482
+ this.listeners.set(modal, handler);
16483
+ window.addEventListener('keydown', handler);
16484
+ }
16485
+ function remove(modal) {
16486
+ const m = this.modals.find(item => item.id === modal.id);
16487
+ const handler = this.listeners.get(m);
16488
+ window.removeEventListener('keydown', handler);
16489
+ this.listeners.delete(m);
16490
+ }
16491
+ function isLast(modal) {
16492
+ return modal.id === lastId;
16493
+ }
16494
+ return {
16495
+ set: set.bind(this),
16496
+ remove: remove.bind(this),
16497
+ isLast,
16498
+ };
16499
+ }
16500
+ };
16501
+ ld_dialogvue_type_script_lang_ts_external_decorate([
16502
+ Emit('modal-in-focus'),
16503
+ ld_dialogvue_type_script_lang_ts_external_metadata("design:type", Function),
16504
+ ld_dialogvue_type_script_lang_ts_external_metadata("design:paramtypes", [Boolean]),
16505
+ ld_dialogvue_type_script_lang_ts_external_metadata("design:returntype", void 0)
16506
+ ], DialogComponent.prototype, "emitFocus", null);
16507
+ ld_dialogvue_type_script_lang_ts_external_decorate([
16508
+ (0,external_vue_property_decorator_.Watch)('modals', { deep: true }),
16509
+ ld_dialogvue_type_script_lang_ts_external_metadata("design:type", Function),
16510
+ ld_dialogvue_type_script_lang_ts_external_metadata("design:paramtypes", []),
16511
+ ld_dialogvue_type_script_lang_ts_external_metadata("design:returntype", void 0)
16512
+ ], DialogComponent.prototype, "onModalsChanged", null);
16513
+ DialogComponent = ld_dialogvue_type_script_lang_ts_external_decorate([
16514
+ (0,external_vue_class_component_.Options)({
16515
+ components: {
16516
+ minimized: dialog_minimized
16517
+ }
16518
+ })
16519
+ ], DialogComponent);
16520
+ /* harmony default export */ const ld_dialogvue_type_script_lang_ts_external = (DialogComponent);
16521
+
16522
+ ;// CONCATENATED MODULE: ./src/ld-dialog/ld-dialog.ts?vue&type=script&lang=ts&external
16523
+
16524
+ ;// CONCATENATED MODULE: ./src/ld-dialog/ld-dialog.vue
16525
+
16526
+
16527
+
16528
+
16529
+ ;
16530
+ const ld_dialog_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(ld_dialogvue_type_script_lang_ts_external, [['render',ld_dialogvue_type_template_id_184339ee_ts_true_render]])
16531
+
16532
+ /* harmony default export */ const ld_dialog = (ld_dialog_exports_);
16533
+ ;// CONCATENATED MODULE: ./src/ld-dialog/index.ts
16534
+
16535
+ function ld_dialog_reg(vue, options) {
16536
+ vue.component(options.aliases['ld-dialog'], ld_dialog);
16537
+ }
16538
+ /* harmony default export */ const src_ld_dialog = (ld_dialog_reg);
16539
+
16540
+ // EXTERNAL MODULE: external "vue-toastification"
16541
+ var external_vue_toastification_ = __webpack_require__(7982);
16542
+ var external_vue_toastification_default = /*#__PURE__*/__webpack_require__.n(external_vue_toastification_);
16543
+ ;// CONCATENATED MODULE: ./src/vuetify.ts
16544
+ const aliases = {
16545
+ SmallButton: 'VBtn',
16546
+ SquareButton: 'VBtn',
16547
+ SmallChip: 'VChip',
16548
+ SmallBadge: 'VChip',
16549
+ };
16550
+ const defaults = {
16551
+ global: {
16552
+ ripple: false,
16553
+ density: 'compact',
16554
+ },
16555
+ SmallButton: {
16556
+ variant: 'flat',
16557
+ color: 'primary',
16558
+ class: 'small-button',
16559
+ },
16560
+ SquareButton: {
16561
+ variant: 'text',
16562
+ color: 'grey',
16563
+ class: 'square-sm-button',
16564
+ },
16565
+ SmallChip: {
16566
+ variant: 'outlined',
16567
+ color: 'primary',
16568
+ closable: true,
16569
+ closeIcon: 'close',
16570
+ class: 'small-chip',
16571
+ },
16572
+ SmallBadge: {
16573
+ class: 'v-chip--badge',
16574
+ variant: 'outlined',
16575
+ },
16576
+ VToolbar: {
16577
+ height: 60,
16578
+ density: 'default',
16579
+ },
16580
+ };
16581
+ function getAliases(components) {
16582
+ const result = {};
16583
+ for (const key in aliases) {
16584
+ result[key] = components[aliases[key]];
16585
+ }
16586
+ return result;
16587
+ }
16588
+
16589
+
16590
+ ;// CONCATENATED MODULE: ./src/directives/active.directive.ts
16591
+ const ActiveDirectiveOptions = {
16592
+ beforeMount(el, binding) {
16593
+ const className = '--active';
16594
+ const value = binding.value;
16595
+ el.classList[value ? 'add' : 'remove'](className);
16596
+ },
16597
+ updated(el, binding) {
16598
+ const className = '--active';
16599
+ const value = binding.value;
16600
+ el.classList[value ? 'add' : 'remove'](className);
16601
+ },
16602
+ };
16603
+
16604
+ ;// CONCATENATED MODULE: ./src/mixins/validate.mixin.ts
16605
+ var validate_mixin_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
16606
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16607
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
16608
+ 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;
16609
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
16610
+ };
16611
+ var validate_mixin_metadata = (undefined && undefined.__metadata) || function (k, v) {
16612
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
16613
+ };
16614
+
16615
+
16616
+ function validate() {
16617
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
16618
+ const errors = this.inputs.filter((input) => input.validate && !input.validate(true)).length;
16619
+ return !errors;
16620
+ }
16621
+ function register(input, section) {
16622
+ if (section) {
16623
+ this.section = section;
16624
+ }
16625
+ if (this.section && input.validate) {
16626
+ // eslint-disable-next-line @typescript-eslint/naming-convention
16627
+ input.__cardSection = this.section;
16628
+ }
16629
+ const unwatch = this.watchInput(input);
16630
+ this.inputs.push(input);
16631
+ this.watchers.push(unwatch);
16632
+ }
16633
+ function unregister(input) {
16634
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
16635
+ const found = this.inputs.find((i) => i.uid === input.uid);
16636
+ if (!found) {
16637
+ return;
16638
+ }
16639
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
16640
+ const unwatch = this.watchers.find((i) => i.uid === found.uid);
16641
+ if (unwatch.valid) {
16642
+ unwatch.valid();
16643
+ }
16644
+ if (unwatch.shouldValidate) {
16645
+ unwatch.shouldValidate();
16646
+ }
16647
+ let index = 0;
16648
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
16649
+ index = this.watchers.findIndex((i) => i.uid === found.uid);
16650
+ this.watchers.splice(index, 1);
16651
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
16652
+ index = this.inputs.findIndex((i) => i.uid === found.uid);
16653
+ this.inputs.splice(index, 1);
16654
+ delete this.errorBag[found.uid];
16655
+ }
16656
+ function validateSection(section) {
16657
+ const errors = this.inputs.filter(
16658
+ // eslint-disable-next-line eqeqeq, @typescript-eslint/no-explicit-any
16659
+ (input) => input.__cardSection == section && input.validate && !input.validate(true)).length;
16660
+ return !errors;
16661
+ }
16662
+ function watchInput(input) {
16663
+ const watcher = (_input) => _input.$watch('hasError', val => {
16664
+ this.errorBag[_input.uid] = val;
16665
+ }, { immediate: true });
16666
+ const watchers = {
16667
+ uid: input.uid,
16668
+ valid: null,
16669
+ shouldValidate: null,
16670
+ };
16671
+ if (this.lazyValidation) {
16672
+ // Only start watching inputs if we need to
16673
+ watchers.shouldValidate = input.$watch('shouldValidate', val => {
16674
+ if (!val) {
16675
+ return;
16676
+ }
16677
+ // Only watch if we're not already doing it
16678
+ if (Object.prototype.hasOwnProperty.call(this.errorBag, input.uid)) {
16679
+ return;
16680
+ }
16681
+ watchers.valid = watcher(input);
16682
+ });
16683
+ }
16684
+ else {
16685
+ watchers.valid = watcher(input);
16686
+ }
16687
+ return watchers;
16688
+ }
16689
+ function validate_mixin_reset() {
16690
+ for (let i = this.inputs.length; i >= 0; i--) {
16691
+ this.inputs[i].reset();
16692
+ }
16693
+ if (this.lazyValidation) {
16694
+ setTimeout(() => {
16695
+ this.errorBag = {};
16696
+ }, 0);
16697
+ }
16698
+ }
16699
+ function resetValidation() {
16700
+ for (let i = this.inputs.length; i >= 0; i--) {
16701
+ this.inputs[i].resetValidation();
16702
+ }
16703
+ if (this.lazyValidation) {
16704
+ setTimeout(() => {
16705
+ this.errorBag = {};
16706
+ }, 0);
16707
+ }
16708
+ }
16709
+ function onErrorBagChanged() {
16710
+ if (this.errorBag) {
16711
+ const errors = Object.values(this.errorBag).includes(true);
16712
+ this.isValid = !errors;
16713
+ }
16714
+ else {
16715
+ this.isValid = true;
16716
+ }
16717
+ }
16718
+ const mixin = {
16719
+ data() {
16720
+ return {
16721
+ inputs: [],
15035
16722
  watchers: [],
15036
16723
  errorBag: {},
15037
16724
  lazyValidation: false,
@@ -15148,67 +16835,6 @@ validate_mixin_decorate([
15148
16835
  ], ValidateMixin.prototype, "onErrorBagChanged", null);
15149
16836
  const ValidateMixinOptions = mixin;
15150
16837
 
15151
- ;// CONCATENATED MODULE: ./src/vuetify.ts
15152
- const aliases = {
15153
- SmallButton: 'VBtn',
15154
- SquareButton: 'VBtn',
15155
- SmallChip: 'VChip',
15156
- SmallBadge: 'VChip',
15157
- };
15158
- const defaults = {
15159
- global: {
15160
- ripple: false,
15161
- density: 'compact',
15162
- },
15163
- SmallButton: {
15164
- variant: 'flat',
15165
- color: 'primary',
15166
- class: 'small-button',
15167
- },
15168
- SquareButton: {
15169
- variant: 'text',
15170
- color: 'grey',
15171
- class: 'square-sm-button',
15172
- },
15173
- SmallChip: {
15174
- variant: 'outlined',
15175
- color: 'primary',
15176
- closable: true,
15177
- closeIcon: 'close',
15178
- class: 'small-chip',
15179
- },
15180
- SmallBadge: {
15181
- class: 'v-chip--badge',
15182
- variant: 'outlined',
15183
- },
15184
- VToolbar: {
15185
- height: 60,
15186
- density: 'default',
15187
- },
15188
- };
15189
- function getAliases(components) {
15190
- const result = {};
15191
- for (const key in aliases) {
15192
- result[key] = components[aliases[key]];
15193
- }
15194
- return result;
15195
- }
15196
-
15197
-
15198
- ;// CONCATENATED MODULE: ./src/directives/active.directive.ts
15199
- const ActiveDirectiveOptions = {
15200
- beforeMount(el, binding) {
15201
- const className = '--active';
15202
- const value = binding.value;
15203
- el.classList[value ? 'add' : 'remove'](className);
15204
- },
15205
- updated(el, binding) {
15206
- const className = '--active';
15207
- const value = binding.value;
15208
- el.classList[value ? 'add' : 'remove'](className);
15209
- },
15210
- };
15211
-
15212
16838
  ;// CONCATENATED MODULE: ./src/index.ts
15213
16839
 
15214
16840
 
@@ -15269,6 +16895,7 @@ const ldmuiPlugin = {
15269
16895
  'ld-edit-masked-text': options.aliases?.['ld-edit-masked-text'] ?? 'ld-edit-masked-text',
15270
16896
  'ld-text-markup': options.aliases?.['ld-text-markup'] ?? 'ld-text-markup',
15271
16897
  'ld-switch': options.aliases?.['ld-switch'] ?? 'ld-switch',
16898
+ 'ld-dialog': options.aliases?.['ld-dialog'] ?? 'ld-dialog',
15272
16899
  };
15273
16900
  vue.config.globalProperties.$utils = {
15274
16901
  ...src_utils_namespaceObject,
@@ -15318,11 +16945,17 @@ const ldmuiPlugin = {
15318
16945
  src_ld_edit_masked_text(vue, options);
15319
16946
  src_ld_text_markup(vue, options);
15320
16947
  src_ld_switch(vue, options);
16948
+ src_ld_dialog(vue, options);
15321
16949
  },
15322
16950
  };
15323
16951
  /* harmony default export */ const src = (ldmuiPlugin);
15324
16952
 
15325
16953
 
16954
+
16955
+
16956
+
16957
+
16958
+ })();
15326
16959
 
15327
16960
  /******/ return __webpack_exports__;
15328
16961
  /******/ })()