bromcom-ui 2.3.49 → 2.3.50

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.
@@ -6436,7 +6436,7 @@ const BcmInput = class {
6436
6436
  };
6437
6437
  BcmInput.style = inputCss;
6438
6438
 
6439
- const listCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}:host{display:block;position:relative;width:256px;height:256px;background-color:#ffffff;border:1px solid #d9d9d9;box-sizing:border-box;transition:height 1s ease 1s;display:flex;flex-direction:column;position:relative;user-select:none;opacity:0}:host(.full-width){width:100%}:host(.linked){z-index:-999;position:absolute;opacity:0;top:-10000;left:-10000;box-shadow:0px 2px 8px rgba(0, 0, 0, 0.15)}:host(.linked.show){opacity:1;z-index:100000}:host(.flex){width:100%;height:100%}:host(.type-autocomplete) .search-container{height:0;margin:0;padding:0;overflow:hidden}.search-container{margin:0 8px;padding-top:8px;background-color:#ffffff}.search-container+.list-container{padding-top:0}.footer{text-align:right;padding:4px 8px;background-color:var(--bcm-color-grey-3)}.list-container{flex:1;overflow-y:auto;display:flex;flex-direction:column;grid-gap:4px;position:relative}.list-container .list{display:flex;flex-direction:column;grid-gap:4px}.spinner{position:absolute;z-index:1;top:0;opacity:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;background-color:#ffffff;visibility:hidden;transition:opacity 0.3s, visibility 0.5s}.spinner.show{visibility:visible;opacity:0.8}.spinner.first-run{visibility:visible;opacity:0.9}.list-item{padding:8px;color:var(--bcm-color-grey-8);background-color:var(--bcm-color-grey-1);cursor:pointer;display:flex;justify-content:flex-start;align-items:center;flex-direction:row}.list-item:hover:not(.disabled),.list-item:active:not(.disabled){color:var(--bcm-color-prime-blue-6);background-color:var(--bcm-color-prime-blue-1)}.divider{margin:0 8px}";
6439
+ const listCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}:host{display:block;position:relative;user-select:none;width:256px}:host main{width:256px;height:256px;background-color:#ffffff;border:1px solid #d9d9d9;box-sizing:border-box;transition:height 1s ease 1s;display:flex;flex-direction:column;position:relative;padding:8px}:host(.full-width){width:100%}:host(.full-width) main{width:100%}:host(.linked){z-index:-999;position:absolute;opacity:0;top:-10000;left:-10000;box-shadow:0px 2px 8px rgba(0, 0, 0, 0.15)}:host(.linked.show){opacity:1;z-index:100000}:host(.flex){width:100%;height:100%}:host(.flex) main{width:100%}:host(.type-autocomplete) .search-container{height:0;margin:0;padding:0;overflow:hidden}.label{display:block;color:var(--bcm-color-grey-9);margin-bottom:4px}.caption-area{min-height:20px}.caption-default{color:#8C8C8C}.caption-primary{color:#4293CF}.caption-success{color:#52C41A}.caption-warning{color:#FA8C16}.caption-error{color:#F5222D}:host(.error) .label{color:var(--bcm-color-red-6) !important}:host(.error) main{border:1px solid var(--bcm-color-red-6) !important}.search-container{margin:0 8px;padding-top:8px;background-color:#ffffff}.search-container+.list-container{padding-top:0}.footer{text-align:right;padding:4px 8px;background-color:var(--bcm-color-grey-3)}.list-container{flex:1;overflow-y:auto;display:flex;flex-direction:column;grid-gap:4px;position:relative}.list-container .list{display:flex;flex-direction:column;grid-gap:4px}.spinner{position:absolute;z-index:1;top:0;opacity:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;background-color:#ffffff;visibility:hidden;transition:opacity 0.3s, visibility 0.5s}.spinner.show{visibility:visible;opacity:0.8}.spinner.first-run{visibility:visible;opacity:0.9}.list-item{padding:8px;color:var(--bcm-color-grey-8);background-color:var(--bcm-color-grey-1);cursor:pointer;display:flex;justify-content:flex-start;align-items:center;flex-direction:row}.list-item:hover:not(.disabled),.list-item:active:not(.disabled){color:var(--bcm-color-prime-blue-6);background-color:var(--bcm-color-prime-blue-1)}.divider{margin:0 8px}";
6440
6440
 
6441
6441
  const lowercase$2 = (str) => str.toLowerCase();
6442
6442
  const BcmList = class {
@@ -6444,6 +6444,7 @@ const BcmList = class {
6444
6444
  registerInstance(this, hostRef);
6445
6445
  this.listSelected = createEvent(this, "bcm-list-selected", 7);
6446
6446
  this.listChecked = createEvent(this, "bcm-list-checklist", 7);
6447
+ this.change = createEvent(this, "bcm-change", 7);
6447
6448
  this.configObject = [];
6448
6449
  this.isRendered = false;
6449
6450
  this.firstRender = true;
@@ -6507,6 +6508,8 @@ const BcmList = class {
6507
6508
  this.required = false;
6508
6509
  }
6509
6510
  connectedCallback() {
6511
+ this.captionCache = this.caption;
6512
+ this.captionTypeCache = this.captionType;
6510
6513
  this.bodyStyleOverflow = document.querySelector("body").style.overflow;
6511
6514
  const elementId = "bcm-list-select-" + this._id;
6512
6515
  if (this.type === 'select' || this.type === 'autocomplete') {
@@ -6532,6 +6535,11 @@ const BcmList = class {
6532
6535
  componentDidLoad() { }
6533
6536
  componentWillRender() { }
6534
6537
  componentDidRender() {
6538
+ const elementId = "bcm-list-select-" + this._id;
6539
+ if (this.type === 'select' || this.type === 'autocomplete') {
6540
+ this.selectIsInitialize();
6541
+ this.linkedComponent = elementId;
6542
+ }
6535
6543
  if (sessionStorage.getItem(this._internal_id + "-config")) {
6536
6544
  this.config(JSON.parse(sessionStorage.getItem(this._internal_id + "-config")));
6537
6545
  }
@@ -6619,6 +6627,12 @@ const BcmList = class {
6619
6627
  }
6620
6628
  }
6621
6629
  }
6630
+ /**
6631
+ * @desc
6632
+ */
6633
+ handleChange(newValue) {
6634
+ this.change.emit(newValue);
6635
+ }
6622
6636
  /**
6623
6637
  * @desc
6624
6638
  */
@@ -6721,6 +6735,14 @@ const BcmList = class {
6721
6735
  async getChecklist() {
6722
6736
  return this.checklist;
6723
6737
  }
6738
+ /**
6739
+ * @desc
6740
+ */
6741
+ async resetCaption() {
6742
+ this.caption = this.captionCache;
6743
+ this.captionType = this.captionTypeCache;
6744
+ this.captionError = null;
6745
+ }
6724
6746
  /**
6725
6747
  * @desc
6726
6748
  */
@@ -6792,7 +6814,6 @@ const BcmList = class {
6792
6814
  // this.handleIndeterminateStatus()
6793
6815
  // this.sendSelectValue()
6794
6816
  }
6795
- // console.log("selectedIDs: ", selectedIDs)
6796
6817
  this.checked(selectedIDs, false);
6797
6818
  }
6798
6819
  }
@@ -6838,10 +6859,7 @@ const BcmList = class {
6838
6859
  this.setClear(false);
6839
6860
  }
6840
6861
  if (typeof checkedItems == 'string') {
6841
- if (this.sendSelectId(String(checkedItems)) !== false) {
6842
- this.sendSelectId(String(checkedItems));
6843
- // selectedIDs.push( checkItem )
6844
- }
6862
+ this.sendSelectId(String(checkedItems));
6845
6863
  if (this.multiSelect === false) {
6846
6864
  this.selectedId = this.items.find(e => String(e[this.objectMapping['id']]) === String(checkedItems));
6847
6865
  }
@@ -6849,10 +6867,7 @@ const BcmList = class {
6849
6867
  else {
6850
6868
  if (this.multiSelect === true) {
6851
6869
  checkedItems.forEach(item => {
6852
- if (this.sendSelectId(String(item)) !== false) {
6853
- this.sendSelectId(String(item));
6854
- // selectedIDs.push( checkItem )
6855
- }
6870
+ this.sendSelectId(String(item));
6856
6871
  });
6857
6872
  }
6858
6873
  }
@@ -6875,13 +6890,7 @@ const BcmList = class {
6875
6890
  */
6876
6891
  async setClear(eventEmit = true) {
6877
6892
  if (this.items != undefined && this.items.length > 0) {
6878
- // this.el.shadowRoot.querySelectorAll("bcm-list-item").forEach( item => {
6879
- // if ( item.shadowRoot.querySelector(".checkbox") ){
6880
- // item.shadowRoot.querySelector(".checkbox").querySelector("input").checked = false
6881
- // }
6882
- // item.classList.remove("selected")
6883
- // })
6884
- this.unChecked(Object.keys(this.items));
6893
+ this.unChecked(this.items.map(item => { return item[this.objectMapping["id"]]; }));
6885
6894
  }
6886
6895
  this.selectedId = null;
6887
6896
  this.checklist = [];
@@ -6909,7 +6918,6 @@ const BcmList = class {
6909
6918
  this.searchData = _data;
6910
6919
  await delay(100);
6911
6920
  _data.map(item => {
6912
- // console.log(item)
6913
6921
  const element = document.createElement("bcm-list-item");
6914
6922
  element.setAttribute("_internal_id", this._internal_id);
6915
6923
  element.setAttribute("text", item[this.objectMapping['text']]);
@@ -6965,44 +6973,33 @@ const BcmList = class {
6965
6973
  * @desc
6966
6974
  */
6967
6975
  handleClick(event) {
6968
- // console.log(this.el.contains(event.target as HTMLElement) )
6969
- // console.log(
6970
- // event["path"]
6971
- // && event["path"].filter((input: HTMLElement) => input['_internal_id'] == this._internal_id)[0]
6972
- // && event["path"].filter((input: HTMLElement) => input['nodeName'] == "BCM-LIST-ITEM")[0]
6973
- // && this.multiSelect === false
6974
- // )
6976
+ var path = event.path || (event.composedPath && event.composedPath());
6975
6977
  if (!this.el.contains(event.target)
6976
- || (event["path"]
6977
- && event["path"].filter((input) => input['_internal_id'] == this._internal_id)[0]
6978
- && event["path"].filter((input) => input['nodeName'] == "BCM-LIST-ITEM")[0]
6978
+ || (path
6979
+ && path.filter((input) => input['_internal_id'] == this._internal_id)[0]
6980
+ && path.filter((input) => input['nodeName'] == "BCM-LIST-ITEM")[0]
6979
6981
  && this.multiSelect === false)) {
6980
6982
  if (this.isShow === true) {
6981
6983
  this.hide();
6982
6984
  }
6983
6985
  }
6984
- // if ( event["path"]
6985
- // && event["path"].filter((input: HTMLElement) => input['id'] == "other-tag")[0]
6986
- // && event["path"].filter((input: HTMLElement) => input['_internal_id'] == this._internal_id)[0] ){
6987
- // event.preventDefault();
6988
- // event.stopPropagation();
6989
- // console.log("clone aç")
6990
- // // this.show("other")
6991
- // const elementId = "bcm-clone-list-" + this._internal_id
6992
- // var element:any = document.getElementById(elementId)
6993
- // console.log(element)
6994
- // // setTimeout(() => {
6995
- // // this.hide()
6996
- // element.show();
6997
- // // }, 100);
6998
- // }
6986
+ }
6987
+ /**
6988
+ * @desc
6989
+ */
6990
+ wheelEvent(event) {
6991
+ if (!this.el.contains(event.target)) {
6992
+ if (this.isShow === true) {
6993
+ this.hide();
6994
+ }
6995
+ }
6999
6996
  }
7000
6997
  /**
7001
6998
  * @desc
7002
6999
  */
7003
7000
  scrollEvent(event) {
7004
7001
  if (!this.el.contains(event.target)) {
7005
- if (this.isShow) {
7002
+ if (this.isShow === true) {
7006
7003
  this.hide();
7007
7004
  }
7008
7005
  }
@@ -7032,27 +7029,28 @@ const BcmList = class {
7032
7029
  * @descc
7033
7030
 
7034
7031
  */
7035
- listenSearchResult(e) {
7036
- if (e.isEvent == undefined) {
7037
- if (e["path"] && e["path"].filter((input) => input['_internal_id'] == this._internal_id)[0] != undefined) {
7032
+ listenSearchResult(event) {
7033
+ var path = event.path || (event.composedPath && event.composedPath());
7034
+ if (event.isEvent == undefined) {
7035
+ if (path && path.filter((input) => input['_internal_id'] == this._internal_id)[0] != undefined) {
7038
7036
  // var childs: any[] = getChilds(this.el, 'bcm-list-item')
7039
7037
  var childs = this.el.shadowRoot.querySelectorAll("bcm-list-item");
7040
7038
  childs.forEach(element => {
7041
7039
  element.classList.add("hidden");
7042
7040
  });
7043
- if (e.detail.length > 0) {
7044
- if (e.detail[0] == -1) {
7041
+ if (event.detail.length > 0) {
7042
+ if (event.detail[0] == -1) {
7045
7043
  this.totalSearch = 0;
7046
7044
  this.empty = true;
7047
7045
  }
7048
7046
  else {
7049
- this.totalSearch = e.detail.length;
7047
+ this.totalSearch = event.detail.length;
7050
7048
  this.empty = false;
7051
7049
  if (this.dataLength > 0) {
7052
7050
  childs.forEach(element => {
7053
7051
  if (this.highlight) {
7054
- e.target.addEventListener('bcm-on-search-value', async (e) => {
7055
- var searchValue = await e.detail;
7052
+ event.target.addEventListener('bcm-on-search-value', async (event) => {
7053
+ var searchValue = await event.detail;
7056
7054
  var inputText = element.shadowRoot.getElementById("text");
7057
7055
  inputText = inputText.textContent || inputText.innerText || "";
7058
7056
  if (searchValue) {
@@ -7066,14 +7064,14 @@ const BcmList = class {
7066
7064
  element.shadowRoot.getElementById("text").innerHTML = inputText;
7067
7065
  });
7068
7066
  }
7069
- if (e.detail.indexOf(element._id) >= 0) {
7067
+ if (event.detail.indexOf(element._id) >= 0) {
7070
7068
  element.classList.remove("hidden");
7071
7069
  }
7072
7070
  });
7073
7071
  }
7074
7072
  }
7075
7073
  }
7076
- else if (e.detail === true) {
7074
+ else if (event.detail === true) {
7077
7075
  this.totalSearch = this.dataLength;
7078
7076
  this.empty = false;
7079
7077
  childs.forEach(element => {
@@ -7089,7 +7087,6 @@ const BcmList = class {
7089
7087
 
7090
7088
  */
7091
7089
  sendSelectId(id, status = true) {
7092
- // console.log(this.items.find( e => e[ this.objectMapping['id'] ] == id ))
7093
7090
  if (this.items && this.items.find(e => e[this.objectMapping['id']] == id)) {
7094
7091
  if (this.isRendered === false) {
7095
7092
  this.items.find(e => e[this.objectMapping['id']] == id)[this.objectMapping['selected']] = status;
@@ -7133,7 +7130,7 @@ const BcmList = class {
7133
7130
  * @descc
7134
7131
  */
7135
7132
  handleListSelected(event) {
7136
- // var path = event.path || (event.composedPath && event.composedPath());
7133
+ var path = event.path || (event.composedPath && event.composedPath());
7137
7134
  // console.log(path);
7138
7135
  if (this.isInternal(event) || (!this.isInternal(event) && this.isInternalSlot(event))) {
7139
7136
  var status = false;
@@ -7165,8 +7162,8 @@ const BcmList = class {
7165
7162
  }
7166
7163
  }
7167
7164
  if (this.isInternalSlot(event)) {
7168
- if (selectedItem = event.path[0]) {
7169
- this.selectedId = event.path[0].id;
7165
+ if (selectedItem = path[0]) {
7166
+ this.selectedId = path[0].id;
7170
7167
  this.value = event.detail;
7171
7168
  return true;
7172
7169
  }
@@ -7283,32 +7280,35 @@ const BcmList = class {
7283
7280
  * @desc
7284
7281
  */
7285
7282
  getItemId(event) {
7286
- const detect = event.path
7287
- && event.path[0]
7288
- && event.path[0].attributes
7289
- && event.path[0].attributes['id']
7290
- && event.path[0].attributes['id'].value;
7283
+ var path = event.path || (event.composedPath && event.composedPath());
7284
+ const detect = path
7285
+ && path[0]
7286
+ && path[0].attributes
7287
+ && path[0].attributes['id']
7288
+ && path[0].attributes['id'].value;
7291
7289
  return detect;
7292
7290
  }
7293
7291
  /**
7294
7292
  * @desc
7295
7293
  */
7296
7294
  isInternalSlot(event) {
7297
- const detect = event.path
7298
- && event.path[0]
7299
- && lowercase$2(event.path[0].tagName) === 'bcm-list-item'
7300
- && this.el.contains(event.path[0]);
7295
+ var path = event.path || (event.composedPath && event.composedPath());
7296
+ const detect = path
7297
+ && path[0]
7298
+ && lowercase$2(path[0].tagName) === 'bcm-list-item'
7299
+ && this.el.contains(path[0]);
7301
7300
  return detect;
7302
7301
  }
7303
7302
  /**
7304
7303
  * @desc
7305
7304
  */
7306
7305
  isInternal(event) {
7307
- const detect = event.path
7308
- && event.path[0]
7309
- && event.path[0].attributes
7310
- && event.path[0].attributes['_internal_id']
7311
- && event.path[0].attributes['_internal_id'].value;
7306
+ var path = event.path || (event.composedPath && event.composedPath());
7307
+ const detect = path
7308
+ && path[0]
7309
+ && path[0].attributes
7310
+ && path[0].attributes['_internal_id']
7311
+ && path[0].attributes['_internal_id'].value;
7312
7312
  return detect == this._internal_id;
7313
7313
  }
7314
7314
  /**
@@ -7417,7 +7417,7 @@ const BcmList = class {
7417
7417
  // }
7418
7418
  });
7419
7419
  if (this.checkStatus === true) {
7420
- this.checked(selectedIDs);
7420
+ this.checked(selectedIDs, false);
7421
7421
  }
7422
7422
  else {
7423
7423
  this.unChecked(selectedIDs);
@@ -7431,9 +7431,9 @@ const BcmList = class {
7431
7431
  // element.unChecked(this.selectedId)
7432
7432
  }
7433
7433
  }
7434
- this.listChecked.emit(this.checklist);
7435
- this.value = this.checklist;
7436
- this.sendSelectValue();
7434
+ // this.listChecked.emit( this.checklist )
7435
+ // this.value = this.checklist
7436
+ // this.sendSelectValue()
7437
7437
  }
7438
7438
  this.handleIndeterminateStatus();
7439
7439
  }
@@ -7442,7 +7442,6 @@ const BcmList = class {
7442
7442
  */
7443
7443
  sendSelectValue() {
7444
7444
  if (this.type === 'select' || this.type === 'autocomplete') {
7445
- // console.log(this.value)
7446
7445
  const select = document.getElementById("bcm-list-select-" + this._id);
7447
7446
  if (select) {
7448
7447
  if (this.multiSelect === true) {
@@ -7461,6 +7460,7 @@ const BcmList = class {
7461
7460
  'size-3': this.size === 'large',
7462
7461
  });
7463
7462
  const hostClasses = classnames(this.hidden ? 'hidden' : null, 'type-' + this.type, {
7463
+ 'error': this.captionType == 'error' ? true : false,
7464
7464
  'show': this.isShow,
7465
7465
  'flex': this.minHeight != null || this.maxHeight != null,
7466
7466
  'full-width': this.fullWidth
@@ -7469,6 +7469,7 @@ const BcmList = class {
7469
7469
  'show': this.searchable,
7470
7470
  });
7471
7471
  const footer = classnames('footer');
7472
+ const captionClasses = classnames('size-1', 'input-caption', 'caption-' + this.captionType);
7472
7473
  var customStyle = {
7473
7474
  'height': this.minHeight != null || this.maxHeight != null ? 'auto' : this.height,
7474
7475
  'min-height': this.minHeight != null ? this.minHeight : null,
@@ -7478,11 +7479,14 @@ const BcmList = class {
7478
7479
  'min-width': this.minWidth != null ? this.minWidth == "100%" || this.minWidth == "auto" ? this.linkedElementWidth : this.minWidth : null,
7479
7480
  'max-width': this.maxWidth != null ? this.maxWidth == "100%" || this.maxWidth == "auto" ? this.linkedElementWidth : this.maxWidth : null,
7480
7481
  };
7481
- return (h(Host, { class: hostClasses, style: customStyle }, this.searchable === true && (h("div", { class: searchContainer }, h("bcm-search", { id: "search", _internal_id: this._internal_id, searchPlaceholder: this.searchPlaceholder, data: this.searchData, returnField: this.returnField, searchFields: this.searchFields, searchValue: this.searchText, clearable: true }), h("bcm-divider", null))), this.multiSelect === true && (h("div", { class: "check-container" }, h("div", { class: listItem, id: "text", onClick: (e) => this.handleIndeterminateClick(e) }, h("div", { class: "check-content" }, h("bcm-checkbox-lite", { id: 'check-lite-' + this._id, name: 'check-lite-' + this._id, checked: false, indeterminate: false, onClick: (e) => this.handleCheckboxClick(e) })), "Select All"), h("div", { class: "divider" }, h("bcm-divider", null)))), h("div", { class: classes }, h("slot", null), h("div", { class: "list" }), h("div", { class: "spinner first-run" }, h("bcm-icon", { type: "animated", color: "prime-blue", class: "prefix", icon: "loading" }))), this.infoFooter == true && (h("div", { class: footer }, h("bcm-text", { scale: "size-1", color: "grey-8" }, h("span", { id: "selected-item" }), " Total ", h("span", { id: "in-total" }, "0"), " items found.")))));
7482
+ return (h(Host, { class: hostClasses, style: customStyle }, (this.type === 'default' && this.processType === 'default' && this.label) && (h("label", { class: "label size-1" }, " ", this.label, " ", this.required && ('*'), " ")), h("main", { style: customStyle }, this.searchable === true && (h("div", { class: searchContainer }, h("bcm-search", { id: "search", _internal_id: this._internal_id, searchPlaceholder: this.searchPlaceholder, data: this.searchData, returnField: this.returnField, searchFields: this.searchFields, searchValue: this.searchText, clearable: true }), h("bcm-divider", null))), h("div", { class: classes }, this.multiSelect === true && (h("div", { class: "check-container" }, h("div", { class: listItem, id: "text", onClick: (e) => this.handleIndeterminateClick(e) }, h("div", { class: "check-content" }, h("bcm-checkbox-lite", { id: 'check-lite-' + this._id, name: 'check-lite-' + this._id, checked: false, indeterminate: false, onClick: (e) => this.handleCheckboxClick(e) })), "Select All"), h("div", { class: "divider" }, h("bcm-divider", null)))), h("slot", null), h("div", { class: "list" }), h("div", { class: "spinner first-run" }, h("bcm-icon", { type: "animated", color: "prime-blue", class: "prefix", icon: "loading" }))), this.infoFooter == true && (h("div", { class: footer }, h("bcm-text", { scale: "size-1", color: "grey-8" }, h("span", { id: "selected-item" }), " Total ", h("span", { id: "in-total" }, "0"), " items found.")))), (this.type === 'default' && this.processType === 'default' && !this.noCaption) && (h("div", { class: "caption-area" }, this.captionType == "error"
7483
+ ? h("span", { class: captionClasses }, " ", this.captionError, " ")
7484
+ : this.caption && h("span", { class: captionClasses }, " ", this.caption, " ")))));
7482
7485
  }
7483
7486
  get el() { return getElement(this); }
7484
7487
  static get watchers() { return {
7485
- "isShow": ["handleOpen"]
7488
+ "isShow": ["handleOpen"],
7489
+ "value": ["handleChange"]
7486
7490
  }; }
7487
7491
  };
7488
7492
  BcmList.style = listCss;
@@ -7636,8 +7640,8 @@ const BcmListSelect = class {
7636
7640
  this.selectArea = this.el.shadowRoot.querySelector(".selected-text");
7637
7641
  this.selectAreaWidth = this.selectArea.clientWidth;
7638
7642
  }
7643
+ this.selectArea.style.width = "100%";
7639
7644
  this.handleTagControl();
7640
- this.selectArea.style.width = this.selectAreaWidth - 16 + "px";
7641
7645
  if (sessionStorage.getItem(this._internal_id + "-config")) {
7642
7646
  this.config(JSON.parse(sessionStorage.getItem(this._internal_id + "-config")));
7643
7647
  }
@@ -7656,6 +7660,14 @@ const BcmListSelect = class {
7656
7660
  handleBlur() {
7657
7661
  this.blur.emit();
7658
7662
  }
7663
+ /**
7664
+ * @desc
7665
+ */
7666
+ async resetCaption() {
7667
+ this.caption = this.captionCache;
7668
+ this.captionType = this.captionTypeCache;
7669
+ this.captionError = null;
7670
+ }
7659
7671
  /**
7660
7672
  * @descc
7661
7673
  */
@@ -7734,6 +7746,11 @@ const BcmListSelect = class {
7734
7746
  * @desc
7735
7747
  */
7736
7748
  async config(_config) {
7749
+ this.selectArea = this.el.shadowRoot.querySelector(".selected-text");
7750
+ this.selectArea.style.width = "100%";
7751
+ this.selectAreaWidth = this.selectArea.clientWidth;
7752
+ this.handleTagControl();
7753
+ this.selectArea.style.width = this.selectAreaWidth - 16 + "px";
7737
7754
  if (_config['searchPlaceholder']) {
7738
7755
  this.searchPlaceholder = _config['searchPlaceholder'];
7739
7756
  }
@@ -7828,6 +7845,7 @@ const BcmListSelect = class {
7828
7845
  // this.selectHiddenData = this.value
7829
7846
  }
7830
7847
  // console.log('this.otherList: ', this.otherList)
7848
+ // this.resetCaption()
7831
7849
  return this.value;
7832
7850
  }
7833
7851
  /**
@@ -7857,7 +7875,6 @@ const BcmListSelect = class {
7857
7875
  * @descc
7858
7876
  */
7859
7877
  async handleTagControl() {
7860
- // debugger
7861
7878
  this.selectHiddenData = [];
7862
7879
  const tagcontainer = this.el.shadowRoot.getElementById("tagcontainer");
7863
7880
  if (tagcontainer) {
@@ -7873,8 +7890,9 @@ const BcmListSelect = class {
7873
7890
  element["style"]["position"] = "absolute";
7874
7891
  });
7875
7892
  tags.forEach(element => {
7876
- if ((this.selectAreaWidth - padding) > (element.clientWidth + 2 + tagsWidth)) {
7877
- tagsWidth += element.clientWidth + 2;
7893
+ var clientWidth = element.clientWidth <= 200 ? element.clientWidth : 200;
7894
+ if ((this.selectAreaWidth - padding) > (clientWidth + 2 + tagsWidth)) {
7895
+ tagsWidth += clientWidth + 2;
7878
7896
  element["style"]["opacity"] = "1";
7879
7897
  element["style"]["position"] = "relative";
7880
7898
  }
@@ -7887,7 +7905,8 @@ const BcmListSelect = class {
7887
7905
  if ((this.selectAreaWidth - padding) < (calcOther === true ? tagsWidth + otherTagWidth : tagsWidth)) {
7888
7906
  visibleTags = Array.from(tags).filter(e => e["hidden"] === false);
7889
7907
  if (visibleTags[visibleTags.length - 1]) {
7890
- tagsWidth -= visibleTags[visibleTags.length - 1].clientWidth + 2;
7908
+ var clientWidth = visibleTags[visibleTags.length - 1].clientWidth <= 200 ? visibleTags[visibleTags.length - 1].clientWidth : 200;
7909
+ tagsWidth -= clientWidth + 2;
7891
7910
  visibleTags[visibleTags.length - 1]["hidden"] = true;
7892
7911
  removeTag(calcOther);
7893
7912
  }
@@ -7956,6 +7975,7 @@ const BcmListSelect = class {
7956
7975
  element.type = "default";
7957
7976
  element.processType = "deselect";
7958
7977
  element.setAttribute("linked-component", this._id);
7978
+ element.linkedComponent = this._id;
7959
7979
  element.multiSelect = true;
7960
7980
  const parentNode = this.el.parentNode;
7961
7981
  parentNode.insertBefore(element, this.el);
@@ -7982,24 +8002,25 @@ const BcmListSelect = class {
7982
8002
  * @desc
7983
8003
  */
7984
8004
  async handleClick(event) {
7985
- if (event["path"] && event["path"].filter((input) => input['_internal_id'] == this._internal_id)[0]) {
8005
+ var path = event.path || (event.composedPath && event.composedPath());
8006
+ if (path && path.filter((input) => input['_internal_id'] == this._internal_id)[0]) {
7986
8007
  const cloneElementId = "bcm-clone-list-" + this._internal_id;
7987
8008
  const cloneElement = document.querySelector("#" + cloneElementId);
7988
8009
  const element = document.querySelector("#" + this._list_id);
7989
- if (event["path"].filter((input) => input['id'] == "close-button")[0]
7990
- && event["path"].filter((input) => input['className'] == "tag dissmisable size-1")[0]
7991
- && event["path"].filter((input) => input['className'] == "tag dissmisable size-1")[0]["id"]) {
8010
+ if (path.filter((input) => input['id'] == "close-button")[0]
8011
+ && path.filter((input) => input['className'] == "tag dissmisable size-1")[0]
8012
+ && path.filter((input) => input['className'] == "tag dissmisable size-1")[0]["id"]) {
7992
8013
  event.preventDefault();
7993
8014
  event.stopPropagation();
7994
- const selectedID = event["path"].filter((input) => input['className'] == "tag dissmisable size-1")[0]["id"];
8015
+ const selectedID = path.filter((input) => input['className'] == "tag dissmisable size-1")[0]["id"];
7995
8016
  if (element) {
7996
8017
  element.unChecked(selectedID);
7997
8018
  }
7998
8019
  }
7999
- if (event["path"].filter((input) => input['id'] == "other-tag")[0]) {
8020
+ if (path.filter((input) => input['id'] == "other-tag")[0]) {
8000
8021
  event.preventDefault();
8001
8022
  event.stopPropagation();
8002
- if (event["path"].filter((input) => input['id'] == "close")[0]) {
8023
+ if (path.filter((input) => input['id'] == "close")[0]) {
8003
8024
  if (cloneElement) {
8004
8025
  if (await cloneElement.openStatus() === true) {
8005
8026
  if (element) {
@@ -8063,7 +8084,7 @@ const BcmListSelect = class {
8063
8084
  // <slot />
8064
8085
  // </div>
8065
8086
  // </Host>
8066
- h(Host, { class: hostClasses, onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur() }, h("div", { class: container }, label && h("label", { class: "label size-1", onClick: () => this.handleOpen() }, " ", label, " ", required && ('*'), " "), h("div", { id: "selected-container", class: selected, onClick: () => this.handleOpen(), tabIndex: -1 }, h("span", { class: selectedText, title: selectText !== null && (selectText) }, h("div", { class: "spinner first-run" }), this.type === 'select' && (selectText !== null && (h("div", { class: "text-content" }, selectText))), (this.type === 'select' || this.type === 'autocomplete' && this.multiSelect === true) && (selectText === null && (h("span", { id: "tagcontainer", class: "tag-container" }, h("span", { id: "visible-tags" }), h("span", { id: "other-container" }, h("bcm-tag", { _internal_id: this._internal_id, customStyle: customStyleOtherTag, type: "dissmisable", id: "other-tag" }))))), this.type === 'select' && (selectText === null && selectData.length === 0 && placeholder !== null && (h("span", { class: "placeholder" }, " ", placeholder, " "))), this.type === 'autocomplete' && (h("bcm-input", { "on-bcm-change": e => this.inputChange(e.detail), "full-width": true, placeholder: this.searchPlaceholder, id: "autocomplete", value: this.searchText, "no-caption": true, "no-margin": true, type: "search", clearable: true }))), this.type === 'select' && (h("div", { class: "buttons" }, clearable && value && (h("button", { class: "select-clear-button", onClick: (e) => this.clickClear(e) }, h("bcm-icon", { icon: "close-circle", type: "fill", size: 18, color: "grey-7" }))), h("span", { class: isOpen ? 'open' : 'close' }, h("bcm-icon", { icon: "caret-up", type: "outlined", size: 18, color: "grey-6" }))))), noCaption === false && (h("div", { class: "caption-area" }, captionType == "error"
8087
+ h(Host, { class: hostClasses, onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur() }, h("div", { class: container }, label && h("label", { class: "label size-1", onClick: () => this.handleOpen() }, " ", label, " ", required === true && ('*'), " "), h("div", { id: "selected-container", class: selected, onClick: () => this.handleOpen(), tabIndex: -1 }, h("span", { class: selectedText, title: selectText !== null && (selectText) }, h("div", { class: "spinner first-run" }), this.type === 'select' && (selectText !== null && (h("div", { class: "text-content" }, selectText))), (this.type === 'select' || this.type === 'autocomplete' && this.multiSelect === true) && (selectText === null && (h("span", { id: "tagcontainer", class: "tag-container" }, h("span", { id: "visible-tags" }), h("span", { id: "other-container" }, h("bcm-tag", { _internal_id: this._internal_id, customStyle: customStyleOtherTag, type: "dissmisable", id: "other-tag" }))))), this.type === 'select' && (selectText === null && selectData.length === 0 && placeholder !== null && (h("span", { class: "placeholder" }, " ", placeholder, " "))), this.type === 'autocomplete' && (h("bcm-input", { "on-bcm-change": e => this.inputChange(e.detail), "full-width": true, placeholder: this.searchPlaceholder, id: "autocomplete", value: this.searchText, "no-caption": true, "no-margin": true, type: "search", clearable: true }))), this.type === 'select' && (h("div", { class: "buttons" }, clearable && value && (h("button", { class: "select-clear-button", onClick: (e) => this.clickClear(e) }, h("bcm-icon", { icon: "close-circle", type: "fill", size: 18, color: "grey-7" }))), h("span", { class: isOpen ? 'open' : 'close' }, h("bcm-icon", { icon: "caret-up", type: "outlined", size: 18, color: "grey-6" }))))), noCaption === false && (h("div", { class: "caption-area" }, captionType == "error"
8067
8088
  ? h("span", { class: captionClasses }, " ", captionError, " ")
8068
8089
  : caption && h("span", { class: captionClasses }, " ", caption, " "))))));
8069
8090
  }