@yesilyazilim/web.spa 1.1.30 → 1.1.32

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/index.js CHANGED
@@ -4851,6 +4851,7 @@ $parcel$export($1401556c65a2dd20$exports, "ButtonRadio", () => $1401556c65a2dd20
4851
4851
 
4852
4852
 
4853
4853
 
4854
+
4854
4855
  var $1401556c65a2dd20$var$__decorate = undefined && undefined.__decorate || function(decorators, target, key, desc) {
4855
4856
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4856
4857
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -4876,9 +4877,7 @@ let $1401556c65a2dd20$export$a48395222641090 = class ButtonRadio extends (0, $b4
4876
4877
  this._value = null;
4877
4878
  this._loaded = false;
4878
4879
  this._btns = new Map();
4879
- if (props.source instanceof Function) props.source().then((items)=>{
4880
- this._buildButtons(items);
4881
- });
4880
+ if ((0, $87fc1b0b8620af66$export$e1dae5660003ffa7).isFunction(props.source)) this._loadSourceAsync(props.source);
4882
4881
  else this._buildButtons(props.source);
4883
4882
  if (props.asFormInput) this.className = 'flat borderrd';
4884
4883
  }
@@ -4886,30 +4885,11 @@ let $1401556c65a2dd20$export$a48395222641090 = class ButtonRadio extends (0, $b4
4886
4885
  return this._value;
4887
4886
  }
4888
4887
  set value(val) {
4889
- if (!this._loaded) {
4890
- this._asyncValue = val;
4891
- return;
4892
- }
4893
- if (val == this._value) return;
4894
- const active = this._btns.get(this._value);
4895
- if (active) {
4896
- active.removeAttribute('checked');
4897
- (0, $94579973dd0f02f3$export$624631f482c54f59).Buttons.changeIcon(active, 'bi bi-circle');
4898
- }
4899
- this._value = val;
4900
- if (this._value) {
4901
- const btn = this._btns.get(this._value);
4902
- if (btn) {
4903
- btn.setAttribute('checked', '');
4904
- (0, $94579973dd0f02f3$export$624631f482c54f59).Buttons.changeIcon(btn, 'bi bi-check-circle-fill');
4905
- }
4906
- }
4907
- this.onValueChanged.raise(this._value);
4908
- this.raiseEvent('change', new $1401556c65a2dd20$export$efdcb269878784b8(this._value));
4888
+ this.setValue(val, false);
4909
4889
  }
4910
4890
  getButton(key) {
4911
4891
  const a = this._btns.get(key);
4912
- return a ? a : null;
4892
+ return a || null;
4913
4893
  }
4914
4894
  addButton(lk) {
4915
4895
  const old = this.getButton(lk.key);
@@ -4933,6 +4913,34 @@ let $1401556c65a2dd20$export$a48395222641090 = class ButtonRadio extends (0, $b4
4933
4913
  const btn = this._btns.get(key);
4934
4914
  if (btn) btn.disabled = value;
4935
4915
  }
4916
+ setValue(val, silent = false) {
4917
+ if (!this._loaded) {
4918
+ this._asyncValue = val;
4919
+ return;
4920
+ }
4921
+ if (val == this._value) return;
4922
+ const active = this._btns.get(this._value);
4923
+ if (active) {
4924
+ active.removeAttribute('checked');
4925
+ (0, $94579973dd0f02f3$export$624631f482c54f59).Buttons.changeIcon(active, 'bi bi-circle');
4926
+ }
4927
+ this._value = val;
4928
+ if (this._value) {
4929
+ const btn = this._btns.get(this._value);
4930
+ if (btn) {
4931
+ btn.setAttribute('checked', '');
4932
+ (0, $94579973dd0f02f3$export$624631f482c54f59).Buttons.changeIcon(btn, 'bi bi-check-circle-fill');
4933
+ }
4934
+ }
4935
+ if (silent) return;
4936
+ this.onValueChanged.raise(this._value);
4937
+ this.raiseEvent('change', new $1401556c65a2dd20$export$efdcb269878784b8(this._value));
4938
+ }
4939
+ _loadSourceAsync(loader) {
4940
+ loader().then((items)=>{
4941
+ this._buildButtons(items);
4942
+ });
4943
+ }
4936
4944
  _buildButtons(items) {
4937
4945
  for (const item of items){
4938
4946
  const button = this._createButton(item);
@@ -6873,14 +6881,14 @@ let $ff47ee4c049939bf$export$72b9695b8216309a = class ComboBox extends (0, $b495
6873
6881
  return this._asyncValue !== undefined ? this._asyncValue : (_a = this._source.getValueById(this._listElm.selectedId)) === null || _a === void 0 ? void 0 : _a.key;
6874
6882
  }
6875
6883
  set value(key) {
6876
- if (this._loading || !this._connected || !this._loaded) {
6884
+ if (this._loading || !this._loaded) {
6877
6885
  this._asyncValue = key;
6878
6886
  return;
6879
6887
  }
6880
6888
  if (key) {
6881
6889
  const id = this._source.findId((i)=>i.key === key);
6882
6890
  this._listElm.selectedId = id;
6883
- } else if (this._connected) this._listElm.selectedId = null;
6891
+ } else this._listElm.selectedId = null;
6884
6892
  }
6885
6893
  _loadItemsAsync(loader, loaderParams = null) {
6886
6894
  return $ff47ee4c049939bf$var$__awaiter(this, void 0, void 0, function*() {
@@ -6895,7 +6903,7 @@ let $ff47ee4c049939bf$export$72b9695b8216309a = class ComboBox extends (0, $b495
6895
6903
  });
6896
6904
  }
6897
6905
  _trySetValue() {
6898
- if (this._asyncValue !== undefined && this._connected && !this._loading && this._loaded) {
6906
+ if (this._asyncValue !== undefined && !this._loading && this._loaded) {
6899
6907
  this.value = this._asyncValue;
6900
6908
  this._asyncValue = undefined;
6901
6909
  }