@ldmjs/ui 1.0.39 → 1.0.40

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.d.ts CHANGED
@@ -149,6 +149,7 @@ export declare const ValidateMixinOptions: Record<string, any>;
149
149
 
150
150
  export declare class DialogManager {
151
151
  static exec<T>(modal: Dialog, fetchData?: () => Promise<any>): Promise<T>;
152
+ static id: (value: string) => DialogManager
152
153
  }
153
154
 
154
155
  declare const ldmui: {
package/dist/index.js CHANGED
@@ -11263,14 +11263,17 @@ let SelectListBoxComponent = class SelectListBoxComponent extends (0,external_vu
11263
11263
  emitClick() {
11264
11264
  return true;
11265
11265
  }
11266
- async onValueChanged(value) {
11266
+ async onValueChanged(value, oldValue) {
11267
11267
  if (!this.$utils.isDefined(value)) {
11268
11268
  if (this.hasSelected) {
11269
11269
  this.clear();
11270
11270
  }
11271
11271
  return;
11272
11272
  }
11273
- let val = this.toArray(value);
11273
+ if (this.$utils.isDefined(value) && this.$utils.isDefined(oldValue) && lodash_es_isEqual(value, oldValue)) {
11274
+ return;
11275
+ }
11276
+ let val = Array.from(new Set(this.toArray(value)));
11274
11277
  if (lodash_es_isEqual(val, this.selectedIds)) {
11275
11278
  return;
11276
11279
  }
@@ -11642,7 +11645,7 @@ ld_select_list_boxvue_type_script_lang_ts_external_decorate([
11642
11645
  ld_select_list_boxvue_type_script_lang_ts_external_decorate([
11643
11646
  (0,external_vue_property_decorator_.Watch)('modelValue', { immediate: true }),
11644
11647
  ld_select_list_boxvue_type_script_lang_ts_external_metadata("design:type", Function),
11645
- ld_select_list_boxvue_type_script_lang_ts_external_metadata("design:paramtypes", [Object]),
11648
+ ld_select_list_boxvue_type_script_lang_ts_external_metadata("design:paramtypes", [Object, Object]),
11646
11649
  ld_select_list_boxvue_type_script_lang_ts_external_metadata("design:returntype", Promise)
11647
11650
  ], SelectListBoxComponent.prototype, "onValueChanged", null);
11648
11651
  ld_select_list_boxvue_type_script_lang_ts_external_decorate([
@@ -11825,8 +11828,6 @@ class CheckboxComponent extends (0,external_vue_property_decorator_.mixins)(Inpu
11825
11828
  return value;
11826
11829
  }
11827
11830
  onValueChanged() {
11828
- /* eslint-disable no-console */
11829
- console.log('onValueChanged!!!');
11830
11831
  if (this.modelValue === this.internalValue) {
11831
11832
  return;
11832
11833
  }
@@ -11852,8 +11853,6 @@ class CheckboxComponent extends (0,external_vue_property_decorator_.mixins)(Inpu
11852
11853
  }
11853
11854
  }
11854
11855
  onChange(event) {
11855
- /* eslint-disable no-console */
11856
- console.log('onChange!!!');
11857
11856
  const checked = event.target.checked;
11858
11857
  if (this.$utils.isDefined(this.checkedValue) && this.$utils.isDefined(this.uncheckedValue)) {
11859
11858
  this.fireinputEvent(checked ? this.checkedValue : this.uncheckedValue);
@@ -15492,10 +15491,10 @@ function ld_switch_reg(vue, options) {
15492
15491
  }
15493
15492
  /* harmony default export */ const src_ld_switch = (ld_switch_reg);
15494
15493
 
15495
- ;// 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
15494
+ ;// 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=a2e3c6ee&ts=true
15496
15495
 
15497
- const ld_dialogvue_type_template_id_184339ee_ts_true_hoisted_1 = { class: "ld-dialog" };
15498
- function ld_dialogvue_type_template_id_184339ee_ts_true_render(_ctx, _cache, $props, $setup, $data, $options) {
15496
+ const ld_dialogvue_type_template_id_a2e3c6ee_ts_true_hoisted_1 = { class: "ld-dialog" };
15497
+ function ld_dialogvue_type_template_id_a2e3c6ee_ts_true_render(_ctx, _cache, $props, $setup, $data, $options) {
15499
15498
  const _component_minimized = (0,external_vue_.resolveComponent)("minimized");
15500
15499
  const _component_v_spacer = (0,external_vue_.resolveComponent)("v-spacer");
15501
15500
  const _component_square_button = (0,external_vue_.resolveComponent)("square-button");
@@ -15505,13 +15504,14 @@ function ld_dialogvue_type_template_id_184339ee_ts_true_render(_ctx, _cache, $pr
15505
15504
  const _component_v_card_actions = (0,external_vue_.resolveComponent)("v-card-actions");
15506
15505
  const _component_v_card = (0,external_vue_.resolveComponent)("v-card");
15507
15506
  const _component_v_dialog = (0,external_vue_.resolveComponent)("v-dialog");
15508
- return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_dialogvue_type_template_id_184339ee_ts_true_hoisted_1, [
15507
+ return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", ld_dialogvue_type_template_id_a2e3c6ee_ts_true_hoisted_1, [
15509
15508
  (0,external_vue_.createVNode)(_component_minimized, {
15509
+ id: _ctx.id,
15510
15510
  dialogs: _ctx.minimized,
15511
15511
  onMaximize: _cache[0] || (_cache[0] = ($event) => (_ctx.onMinimize($event))),
15512
15512
  onClose: _cache[1] || (_cache[1] = ($event) => (_ctx.handleCancel($event))),
15513
15513
  onCloseAll: _ctx.handleCancelAll
15514
- }, null, 8, ["dialogs", "onCloseAll"]),
15514
+ }, null, 8, ["id", "dialogs", "onCloseAll"]),
15515
15515
  (0,external_vue_.createTextVNode)(),
15516
15516
  ((0,external_vue_.openBlock)(true), (0,external_vue_.createElementBlock)(external_vue_.Fragment, null, (0,external_vue_.renderList)(_ctx.modals, (modal) => {
15517
15517
  return ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", {
@@ -15739,7 +15739,7 @@ function ld_dialogvue_type_template_id_184339ee_ts_true_render(_ctx, _cache, $pr
15739
15739
  ]));
15740
15740
  }
15741
15741
 
15742
- ;// CONCATENATED MODULE: ./src/ld-dialog/ld-dialog.vue?vue&type=template&id=184339ee&ts=true
15742
+ ;// CONCATENATED MODULE: ./src/ld-dialog/ld-dialog.vue?vue&type=template&id=a2e3c6ee&ts=true
15743
15743
 
15744
15744
  // EXTERNAL MODULE: ./node_modules/@ldmjs/core/dist/index.js
15745
15745
  var dist = __webpack_require__(634);
@@ -15764,23 +15764,6 @@ const GAP = 17;
15764
15764
  const MARGIN_RIGHT = 25;
15765
15765
  const MARGIN_BOTTOM = 68;
15766
15766
  class DialogManager {
15767
- static exec(modal, fetchData) {
15768
- switch (modal.constructor.name) {
15769
- case 'AlertDialog':
15770
- return DialogManager.alert(modal);
15771
- case 'PromptDialog':
15772
- return DialogManager.prompt(modal);
15773
- case 'ConfirmDialog':
15774
- return DialogManager.confirm(modal);
15775
- case 'InfoDialog':
15776
- return DialogManager.info(modal, fetchData);
15777
- case 'SelectDialog':
15778
- return DialogManager.select(modal, fetchData);
15779
- case 'CreateEditDialog':
15780
- return DialogManager.createEdit(modal, fetchData);
15781
- }
15782
- return null;
15783
- }
15784
15767
  constructor() {
15785
15768
  this._visibled = [];
15786
15769
  this._minimized = [];
@@ -16020,18 +16003,41 @@ class DialogManager {
16020
16003
  uniqKey(info) {
16021
16004
  return `dlg-${info.id}`;
16022
16005
  }
16006
+ static id(value) {
16007
+ DialogManager._id = value;
16008
+ return DialogManager;
16009
+ }
16010
+ static exec(modal, fetchData) {
16011
+ switch (modal.constructor.name) {
16012
+ case 'AlertDialog':
16013
+ return DialogManager.alert(modal);
16014
+ case 'PromptDialog':
16015
+ return DialogManager.prompt(modal);
16016
+ case 'ConfirmDialog':
16017
+ return DialogManager.confirm(modal);
16018
+ case 'InfoDialog':
16019
+ return DialogManager.info(modal, fetchData);
16020
+ case 'SelectDialog':
16021
+ return DialogManager.select(modal, fetchData);
16022
+ case 'CreateEditDialog':
16023
+ return DialogManager.createEdit(modal, fetchData);
16024
+ }
16025
+ return null;
16026
+ }
16023
16027
  static alert(modal) {
16024
16028
  const modalInfo = {
16025
16029
  title: modal.title,
16026
16030
  content: modal.content,
16027
16031
  type: ModalType.Alert,
16032
+ managerId: DialogManager._id
16028
16033
  };
16029
16034
  return DialogManager.execAsync(modalInfo);
16030
16035
  }
16031
16036
  static prompt(modal) {
16032
16037
  const modalInfo = {
16033
16038
  ...modal,
16034
- type: ModalType.Prompt
16039
+ type: ModalType.Prompt,
16040
+ managerId: DialogManager._id
16035
16041
  };
16036
16042
  return DialogManager.execAsync(modalInfo);
16037
16043
  }
@@ -16041,6 +16047,7 @@ class DialogManager {
16041
16047
  content: modal.text,
16042
16048
  type: ModalType.Confirm,
16043
16049
  closable: true,
16050
+ managerId: DialogManager._id
16044
16051
  };
16045
16052
  return DialogManager.execAsync(modalInfo);
16046
16053
  }
@@ -16048,6 +16055,7 @@ class DialogManager {
16048
16055
  const modalInfo = {
16049
16056
  ...modal,
16050
16057
  type: ModalType.Info,
16058
+ managerId: DialogManager._id
16051
16059
  };
16052
16060
  if (!modalInfo.hostObject) {
16053
16061
  modalInfo.hostObject = {
@@ -16062,6 +16070,7 @@ class DialogManager {
16062
16070
  const modalInfo = {
16063
16071
  ...modal,
16064
16072
  type: ModalType.Select,
16073
+ managerId: DialogManager._id
16065
16074
  };
16066
16075
  if (!modalInfo.hostObject) {
16067
16076
  modalInfo.hostObject = {
@@ -16076,6 +16085,7 @@ class DialogManager {
16076
16085
  const modalInfo = {
16077
16086
  ...modal,
16078
16087
  type: ModalType.CreateEdit,
16088
+ managerId: DialogManager._id
16079
16089
  };
16080
16090
  if (!modalInfo.hostObject) {
16081
16091
  modalInfo.hostObject = {
@@ -16090,22 +16100,24 @@ class DialogManager {
16090
16100
  return new Promise(resolve => {
16091
16101
  modalInfo.resolveFunction = resolve;
16092
16102
  let fetchProps = null;
16103
+ const managerId = modalInfo.managerId || '';
16093
16104
  if (fetchData instanceof Function) {
16094
16105
  fetchProps = async (host) => {
16095
16106
  if (host.id === modalInfo.hostObject.id) {
16096
16107
  if (fetchData instanceof Function) {
16097
16108
  const props = await fetchData();
16098
- dist.eventBus.$off('dialog:created', fetchProps);
16099
- dist.eventBus.$emit('dialog:props', props, modalInfo.hostObject);
16109
+ dist.eventBus.$off('dialog:created' + managerId, fetchProps);
16110
+ dist.eventBus.$emit('dialog:props' + managerId, props, modalInfo.hostObject);
16100
16111
  }
16101
16112
  }
16102
16113
  };
16103
- dist.eventBus.$on('dialog:created', fetchProps);
16114
+ dist.eventBus.$on('dialog:created' + managerId, fetchProps);
16104
16115
  }
16105
- dist.eventBus.$emit('dialog:open', modalInfo);
16116
+ dist.eventBus.$emit('dialog:open' + managerId, modalInfo);
16106
16117
  });
16107
16118
  }
16108
16119
  }
16120
+ DialogManager._id = '';
16109
16121
 
16110
16122
  ;// 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
16111
16123
 
@@ -16328,10 +16340,10 @@ var dialog_minimizedvue_type_script_lang_ts_external_a;
16328
16340
  let DialogMinimizedComponent = class DialogMinimizedComponent extends external_vue_property_decorator_.Vue {
16329
16341
  created() {
16330
16342
  this.maximizeHandler = this.onMaximize.bind(this);
16331
- dist.eventBus.$on('modal-maximize', this.maximizeHandler);
16343
+ dist.eventBus.$on('modal-maximize' + this.id, this.maximizeHandler);
16332
16344
  }
16333
16345
  beforeUnmount() {
16334
- dist.eventBus.$off('modal-maximize', this.maximizeHandler);
16346
+ dist.eventBus.$off('modal-maximize' + this.id, this.maximizeHandler);
16335
16347
  }
16336
16348
  onMaximize(item) {
16337
16349
  const dlg = this.dialogs.find(d => d.id === item.id);
@@ -16364,6 +16376,10 @@ let DialogMinimizedComponent = class DialogMinimizedComponent extends external_v
16364
16376
  return this.items.length && this.items.length < 5;
16365
16377
  }
16366
16378
  };
16379
+ dialog_minimizedvue_type_script_lang_ts_external_decorate([
16380
+ (0,external_vue_property_decorator_.Prop)({ type: String, default: '' }),
16381
+ dialog_minimizedvue_type_script_lang_ts_external_metadata("design:type", String)
16382
+ ], DialogMinimizedComponent.prototype, "id", void 0);
16367
16383
  dialog_minimizedvue_type_script_lang_ts_external_decorate([
16368
16384
  (0,external_vue_property_decorator_.Prop)(),
16369
16385
  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)
@@ -16529,15 +16545,15 @@ let DialogComponent = class DialogComponent extends (0,external_vue_class_compon
16529
16545
  }
16530
16546
  mounted() {
16531
16547
  this.$nextTick(() => {
16532
- dist.eventBus.$on('dialog:open', this.open);
16533
- dist.eventBus.$on('dialog:props', this.onSetProps);
16534
- dist.eventBus.$on('dialog:close:all', this.closeAll);
16548
+ dist.eventBus.$on('dialog:open' + this.id, this.open);
16549
+ dist.eventBus.$on('dialog:props' + this.id, this.onSetProps);
16550
+ dist.eventBus.$on('dialog:close:all' + this.id, this.closeAll);
16535
16551
  });
16536
16552
  }
16537
16553
  beforeUnmount() {
16538
- dist.eventBus.$off('dialog:open', this.open);
16539
- dist.eventBus.$off('dialog:props', this.onSetProps);
16540
- dist.eventBus.$off('dialog:close:all', this.closeAll);
16554
+ dist.eventBus.$off('dialog:open' + this.id, this.open);
16555
+ dist.eventBus.$off('dialog:props' + this.id, this.onSetProps);
16556
+ dist.eventBus.$off('dialog:close:all' + this.id, this.closeAll);
16541
16557
  }
16542
16558
  async open(modalInfo) {
16543
16559
  if (modalInfo.hostObject) {
@@ -16643,7 +16659,7 @@ let DialogComponent = class DialogComponent extends (0,external_vue_class_compon
16643
16659
  }
16644
16660
  }
16645
16661
  this.dialogManager.dialogCreated(modal);
16646
- dist.eventBus.$emit('dialog:created', modal.hostObject);
16662
+ dist.eventBus.$emit('dialog:created' + this.id, modal.hostObject);
16647
16663
  }
16648
16664
  }, 100);
16649
16665
  }
@@ -16651,6 +16667,9 @@ let DialogComponent = class DialogComponent extends (0,external_vue_class_compon
16651
16667
  const result = [
16652
16668
  `${this.uniqKey(modal)} ${ModalType[modal.type]}`
16653
16669
  ];
16670
+ if (this.id) {
16671
+ result.push(`${ModalType[modal.type]}-${this.id}`);
16672
+ }
16654
16673
  if (this.isMobileGlobal) {
16655
16674
  return result;
16656
16675
  }
@@ -16806,7 +16825,7 @@ let DialogComponent = class DialogComponent extends (0,external_vue_class_compon
16806
16825
  if (!modal.show) {
16807
16826
  this.remove(modal);
16808
16827
  this.listenerMap.remove(modal);
16809
- dist.eventBus.$emit('modal-cancel');
16828
+ dist.eventBus.$emit('modal-cancel' + this.id);
16810
16829
  }
16811
16830
  }
16812
16831
  }
@@ -16877,7 +16896,7 @@ let DialogComponent = class DialogComponent extends (0,external_vue_class_compon
16877
16896
  onMinimize(modal) {
16878
16897
  modal.minimized = !modal.minimized;
16879
16898
  this.dialogManager.dialogMinimizeChanged(modal);
16880
- dist.eventBus.$emit('on-minimize', modal.minimized);
16899
+ dist.eventBus.$emit('on-minimize' + this.id, modal.minimized);
16881
16900
  }
16882
16901
  onActivate(modal) {
16883
16902
  modal.processingDescription = null;
@@ -17034,6 +17053,10 @@ let DialogComponent = class DialogComponent extends (0,external_vue_class_compon
17034
17053
  };
17035
17054
  }
17036
17055
  };
17056
+ ld_dialogvue_type_script_lang_ts_external_decorate([
17057
+ (0,external_vue_property_decorator_.Prop)({ type: String, default: '' }),
17058
+ ld_dialogvue_type_script_lang_ts_external_metadata("design:type", String)
17059
+ ], DialogComponent.prototype, "id", void 0);
17037
17060
  ld_dialogvue_type_script_lang_ts_external_decorate([
17038
17061
  Emit('modal-in-focus'),
17039
17062
  ld_dialogvue_type_script_lang_ts_external_metadata("design:type", Function),
@@ -17063,7 +17086,7 @@ DialogComponent = ld_dialogvue_type_script_lang_ts_external_decorate([
17063
17086
 
17064
17087
 
17065
17088
  ;
17066
- 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]])
17089
+ const ld_dialog_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(ld_dialogvue_type_script_lang_ts_external, [['render',ld_dialogvue_type_template_id_a2e3c6ee_ts_true_render]])
17067
17090
 
17068
17091
  /* harmony default export */ const ld_dialog = (ld_dialog_exports_);
17069
17092
  ;// CONCATENATED MODULE: ./src/ld-dialog/index.ts
@@ -26,6 +26,7 @@ export interface IModalInfo {
26
26
  description?: string | (() => string);
27
27
  processingDescription?: string | (() => string);
28
28
  el?: HTMLElement;
29
+ managerId?: string;
29
30
  hostObject?: IHostObject;
30
31
  /**
31
32
  * Окно немодальное - это начит окно отображается поверх контента страницы и не ограничивает пользователя
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldmjs/ui",
3
- "version": "1.0.39",
3
+ "version": "1.0.40",
4
4
  "description": "ldm ui",
5
5
  "main": "dist/index.js",
6
6
  "engines": {