bromcom-ui 2.4.18 → 2.4.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  2. package/dist/bromcom-ui/{p-f03e41b5.entry.js → p-275c06a2.entry.js} +1 -1
  3. package/dist/bromcom-ui/{p-1384753c.entry.js → p-56312eb4.entry.js} +1 -1
  4. package/dist/bromcom-ui/{p-c40d45b9.entry.js → p-87eead0c.entry.js} +1 -1
  5. package/dist/bromcom-ui/{p-47be36bf.entry.js → p-893b1117.entry.js} +1 -1
  6. package/dist/bromcom-ui/p-8ff169fb.entry.js +1 -0
  7. package/dist/bromcom-ui/{p-495bf63e.js → p-945d9359.js} +1 -1
  8. package/dist/bromcom-ui/p-a0b12489.entry.js +1 -0
  9. package/dist/bromcom-ui/{p-82352b0f.entry.js → p-ac679765.entry.js} +1 -1
  10. package/dist/bromcom-ui/{p-8c472703.entry.js → p-ae53d8d8.entry.js} +1 -1
  11. package/dist/bromcom-ui/{p-3de794f6.entry.js → p-b6c270d0.entry.js} +1 -1
  12. package/dist/bromcom-ui/{p-7fb112d9.js → p-bc30b511.js} +1 -1
  13. package/dist/bromcom-ui/p-d86c018a.entry.js +1 -0
  14. package/dist/bromcom-ui/{p-e4da928b.entry.js → p-ddbaa099.entry.js} +1 -1
  15. package/dist/bromcom-ui/p-fa0c64f5.entry.js +1 -0
  16. package/dist/bromcom-ui/p-fb10cbc4.entry.js +1 -0
  17. package/dist/cjs/{bcm-button_7.cjs.entry.js → bcm-button_3.cjs.entry.js} +5 -1801
  18. package/dist/cjs/{bcm-checkbox.cjs.entry.js → bcm-checkbox_2.cjs.entry.js} +64 -0
  19. package/dist/cjs/bcm-icon-2_2.cjs.entry.js +3 -3
  20. package/dist/cjs/bcm-label_3.cjs.entry.js +1 -1
  21. package/dist/cjs/bcm-list.cjs.entry.js +1423 -0
  22. package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +1 -1
  23. package/dist/cjs/bcm-popconfirm.cjs.entry.js +1 -1
  24. package/dist/cjs/bcm-popover-box.cjs.entry.js +1 -1
  25. package/dist/cjs/bcm-popover.cjs.entry.js +1 -1
  26. package/dist/cjs/bcm-search-2.cjs.entry.js +306 -0
  27. package/dist/cjs/bcm-stepper.cjs.entry.js +3 -3
  28. package/dist/cjs/bcm-tag-2.cjs.entry.js +2 -2
  29. package/dist/cjs/bcm-text.cjs.entry.js +33 -0
  30. package/dist/cjs/bromcom-ui.cjs.js +1 -1
  31. package/dist/cjs/{generate-debc2c44.js → generate-f1e88921.js} +1 -1
  32. package/dist/cjs/loader.cjs.js +1 -1
  33. package/dist/cjs/{stepper-states-09ebf594.js → stepper-states-4b65b027.js} +1 -1
  34. package/dist/collection/components/organism/form/form.js +5 -5
  35. package/dist/collection/components/organism/list/list.js +68 -71
  36. package/dist/esm/{bcm-button_7.entry.js → bcm-button_3.entry.js} +8 -1800
  37. package/dist/esm/{bcm-checkbox.entry.js → bcm-checkbox_2.entry.js} +65 -2
  38. package/dist/esm/bcm-icon-2_2.entry.js +3 -3
  39. package/dist/esm/bcm-label_3.entry.js +1 -1
  40. package/dist/esm/bcm-list.entry.js +1419 -0
  41. package/dist/esm/bcm-popconfirm-box.entry.js +1 -1
  42. package/dist/esm/bcm-popconfirm.entry.js +1 -1
  43. package/dist/esm/bcm-popover-box.entry.js +1 -1
  44. package/dist/esm/bcm-popover.entry.js +1 -1
  45. package/dist/esm/bcm-search-2.entry.js +302 -0
  46. package/dist/esm/bcm-stepper.entry.js +3 -3
  47. package/dist/esm/bcm-tag-2.entry.js +2 -2
  48. package/dist/esm/bcm-text.entry.js +29 -0
  49. package/dist/esm/bromcom-ui.js +1 -1
  50. package/dist/esm/{generate-42ba55c9.js → generate-b11810eb.js} +1 -1
  51. package/dist/esm/loader.js +1 -1
  52. package/dist/esm/{stepper-states-706439d0.js → stepper-states-7457f702.js} +1 -1
  53. package/package.json +1 -1
  54. package/dist/bromcom-ui/p-63675bea.entry.js +0 -1
  55. package/dist/bromcom-ui/p-6823d86a.entry.js +0 -1
@@ -122,22 +122,20 @@ export class BcmList {
122
122
  watchId(newVal, oldVal) {
123
123
  console.info('Changed component id:', oldVal + ' -> ' + newVal);
124
124
  listState.removeState(oldVal);
125
- this.initState(false);
125
+ this.initState();
126
126
  }
127
127
  handleValueChange(newVal, oldVal) {
128
- var _a;
129
- if (this.isSentNotification) {
128
+ if (this.checkboxes) {
130
129
  if (!Validators.compareTwoArrayIsSame(newVal, oldVal)) {
131
- if (this.checkboxes) {
132
- this.bcmChecklist.emit(this.value);
133
- this.change.emit(this.value);
134
- }
135
- else {
136
- this.change.emit(((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.value[0] : this.value);
137
- }
130
+ this.bcmChecklist.emit(this.value);
131
+ this.change.emit(this.value);
132
+ }
133
+ }
134
+ else {
135
+ if ((newVal === null || newVal === void 0 ? void 0 : newVal.text) != (oldVal === null || oldVal === void 0 ? void 0 : oldVal.text)) {
136
+ this.change.emit(this.value);
138
137
  }
139
138
  }
140
- this.isSentNotification = true;
141
139
  }
142
140
  watchReturnFilterData(newVal) {
143
141
  var _a;
@@ -208,7 +206,7 @@ export class BcmList {
208
206
  autocompleteInput.setValue('');
209
207
  }
210
208
  else {
211
- autocompleteInput.setValue(((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.value[0].text : '');
209
+ autocompleteInput.setValue(((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || '');
212
210
  }
213
211
  }
214
212
  }
@@ -451,7 +449,7 @@ export class BcmList {
451
449
  await delay(1000);
452
450
  this.markForCheck();
453
451
  }
454
- async initState(sendChange = true) {
452
+ async initState() {
455
453
  var _a;
456
454
  await listState.setValue({
457
455
  id: this._id,
@@ -461,16 +459,13 @@ export class BcmList {
461
459
  const { totalRoots, totalItems } = listState.getValue(this._id);
462
460
  this.totalData = totalItems;
463
461
  this.totalRootData = totalRoots;
464
- if (!sendChange) {
465
- this.isSentNotification = false;
466
- }
467
- this.value = this.checkboxes ? (await this.getCheckedList()).checkedList : listState.selectedItem(this._id);
462
+ this.value = this.checkboxes ? (await this.getCheckedList()).checkedList : listState.selectedItem(this._id) ? listState.selectedItem(this._id)[0] : null;
468
463
  // value && value.length > 0 && (this.value = value)
469
464
  if (this.checkboxes) {
470
465
  this.tagControl();
471
466
  }
472
467
  else {
473
- this.inputText = ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.value[0].text : '';
468
+ this.inputText = ((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || null;
474
469
  }
475
470
  await this.markForCheck();
476
471
  }
@@ -510,19 +505,19 @@ export class BcmList {
510
505
  }
511
506
  }
512
507
  async selectedItem(itemId) {
513
- var _a, _b;
508
+ var _a;
514
509
  this.value = listState.selectedItem(this._id, itemId)[0];
515
- this.inputText = ((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || '';
510
+ this.inputText = ((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || null;
516
511
  this.isOpen = false;
517
512
  this.markForCheck();
518
- if (this.type == 'autocomplete' && ((_b = this.value) === null || _b === void 0 ? void 0 : _b.length) > 0) {
513
+ if (this.type == 'autocomplete' && this.value) {
519
514
  // await delay(100)
520
515
  // this.resetCaption()
521
516
  const autocompleteInput = this.getAutoCompleteInput();
522
517
  if (autocompleteInput) {
523
518
  setTimeout(() => {
524
519
  var _a;
525
- autocompleteInput.setValue(((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.value[0].text : '');
520
+ autocompleteInput.setValue(((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || '');
526
521
  this.isOpen = false;
527
522
  }, 100);
528
523
  }
@@ -611,7 +606,7 @@ export class BcmList {
611
606
  var tags = [];
612
607
  var i = 0;
613
608
  let itemsWidth = 0;
614
- if (this.value[0] != undefined && ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) > 0) {
609
+ if (this.value != null && ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) > 0) {
615
610
  var BreakException = {};
616
611
  try {
617
612
  for (const item of this.value) {
@@ -647,57 +642,59 @@ export class BcmList {
647
642
  tagContainerArea.appendChild(tag);
648
643
  });
649
644
  }
650
- const otherTag = this.value.slice(i);
651
- if (otherTag.length > 0) {
652
- var otherText, otherElement, BreakException = {};
653
- try {
654
- const removeItems = async () => {
655
- var visibleItems = tagContainer.querySelectorAll('bcm-tag');
656
- tagContainerWidth = this.type == 'autocomplete' ? tagContainer.clientWidth > 300 ? tagContainer.clientWidth - 150 : tagContainer.clientWidth - 100 : tagContainer.clientWidth;
657
- visibleItems = Generate.reverseNodeList(visibleItems);
658
- if (visibleItems.length > 0) {
659
- for (const item of visibleItems) {
660
- otherTag.push(item.itemObject);
661
- otherText = `${otherTag.length} ${pluralize('item', otherTag.length)} selected`;
662
- otherElement = await this.createTag({ id: 'other-tag', text: otherText });
663
- if (otherElement.offsetWidth > (tagContainerWidth - itemsWidth)) {
664
- itemsWidth -= item.offsetWidth + 4;
665
- item.remove();
666
- await removeItems();
667
- }
668
- else {
669
- otherTag.pop();
645
+ if (this.value && this.value.length > 0) {
646
+ const otherTag = this.value.slice(i);
647
+ if (otherTag.length > 0) {
648
+ var otherText, otherElement, BreakException = {};
649
+ try {
650
+ const removeItems = async () => {
651
+ var visibleItems = tagContainer.querySelectorAll('bcm-tag');
652
+ tagContainerWidth = this.type == 'autocomplete' ? tagContainer.clientWidth > 300 ? tagContainer.clientWidth - 150 : tagContainer.clientWidth - 100 : tagContainer.clientWidth;
653
+ visibleItems = Generate.reverseNodeList(visibleItems);
654
+ if (visibleItems.length > 0) {
655
+ for (const item of visibleItems) {
656
+ otherTag.push(item.itemObject);
670
657
  otherText = `${otherTag.length} ${pluralize('item', otherTag.length)} selected`;
671
- otherElement = await this.createTag({ id: 'other-tag', text: otherText, itemObject: otherTag });
672
- throw BreakException;
658
+ otherElement = await this.createTag({ id: 'other-tag', text: otherText });
659
+ if (otherElement.offsetWidth > (tagContainerWidth - itemsWidth)) {
660
+ itemsWidth -= item.offsetWidth + 4;
661
+ item.remove();
662
+ await removeItems();
663
+ }
664
+ else {
665
+ otherTag.pop();
666
+ otherText = `${otherTag.length} ${pluralize('item', otherTag.length)} selected`;
667
+ otherElement = await this.createTag({ id: 'other-tag', text: otherText, itemObject: otherTag });
668
+ throw BreakException;
669
+ }
673
670
  }
674
671
  }
675
- }
676
- };
677
- await removeItems();
678
- }
679
- catch (e) {
680
- if (e !== BreakException)
681
- throw e;
682
- }
683
- otherElement.title = otherTag.slice(0, 10).map(item => StringHelper.textLimitter(item.text, 15)).toString().split(',').join("\r\n") + '\r\n...';
684
- tagContainerArea.appendChild(otherElement);
685
- this.isHaveOtherTag = true;
686
- if (this.isSelectedOther) { // other seçiliyken other içindeki bir checked durumu değiştiğinde seçili classlarının kalması için
687
- this.handleOtherSelected(true);
688
- }
689
- }
690
- else {
691
- if (this.isHaveOtherTag) {
692
- this.unSelectOther();
693
- this.isHaveOtherTag = false;
672
+ };
673
+ await removeItems();
674
+ }
675
+ catch (e) {
676
+ if (e !== BreakException)
677
+ throw e;
678
+ }
679
+ otherElement.title = otherTag.slice(0, 10).map(item => StringHelper.textLimitter(item.text, 15)).toString().split(',').join("\r\n") + '\r\n...';
680
+ tagContainerArea.appendChild(otherElement);
681
+ this.isHaveOtherTag = true;
682
+ if (this.isSelectedOther) { // other seçiliyken other içindeki bir checked durumu değiştiğinde seçili classlarının kalması için
683
+ this.handleOtherSelected(true);
684
+ }
694
685
  }
695
- var element = document.getElementById(`bcm-list-input-tag-${this._id}-other-tag`);
696
- if (element) {
697
- element.remove();
686
+ else {
687
+ if (this.isHaveOtherTag) {
688
+ this.unSelectOther();
689
+ this.isHaveOtherTag = false;
690
+ }
691
+ var element = document.getElementById(`bcm-list-input-tag-${this._id}-other-tag`);
692
+ if (element) {
693
+ element.remove();
694
+ }
698
695
  }
699
696
  }
700
- if (((_b = this.value) === null || _b === void 0 ? void 0 : _b.length) === 0) {
697
+ if (!this.value || ((_b = this.value) === null || _b === void 0 ? void 0 : _b.length) == 0) {
701
698
  tagContainerArea.querySelectorAll('bcm-tag').forEach(element => {
702
699
  element.remove();
703
700
  });
@@ -706,7 +703,7 @@ export class BcmList {
706
703
  }
707
704
  }
708
705
  render() {
709
- var _a, _b;
706
+ var _a;
710
707
  const { checkboxes, treeview, label, size, disabled, readonly, required, hidden, fullWidth, searchable } = this.getOptions();
711
708
  const hostClasses = cs('bcm-list', `bcm-list__size-${size}`, size === 'large' ? 'size-3' : 'size-2', {
712
709
  'error': this.captionType == Bcm.Status.error,
@@ -729,9 +726,9 @@ export class BcmList {
729
726
  this.type == 'select' && (h("div", { id: `bcm-list-input-${this._id}`, class: bcmListInput },
730
727
  h("span", { class: "bcm-list__input-container" },
731
728
  this.checkboxes && (h("span", { id: `bcm-list-input-tag-container-${this._id}`, class: "bcm-list__input-tag-container" })),
732
- (!this.checkboxes || ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) == 0) && (this.inputText || h("span", { class: "bcm-list__input-placeholder" }, this.placeholder))),
729
+ (!this.checkboxes || ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) == 0 || !this.value) && (this.inputText || h("span", { class: "bcm-list__input-placeholder" }, this.placeholder))),
733
730
  h("span", { class: "bcm-list__input-buttons" },
734
- this.clearable && ((_b = this.value) === null || _b === void 0 ? void 0 : _b.length) > 0 && h("i", { class: "bcm-fal bcm-fa-times", onClick: (e) => this.setClear(e) }),
731
+ this.clearable && this.value && h("i", { class: "bcm-fal bcm-fa-times", onClick: (e) => this.setClear(e) }),
735
732
  h("i", { class: `bcm-fas bcm-fa-caret-${this.isOpen ? 'up' : 'down'}` })))),
736
733
  this.type === 'autocomplete' && (h("div", { id: `bcm-list-input-${this._id}`, class: cs(bcmListInput, { 'bcm-list__input-autocomplete': this.type == 'autocomplete' }) },
737
734
  h("span", { class: "bcm-list__input-container", id: `bcm-list-input-tag-container-${this._id}` },