reneco-hierarchized-picker 0.4.0-beta.2 → 0.4.0-beta.3

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.
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["reneco-hierarchized-picker_2.cjs",[[0,"reneco-hierarchized-picker",{"options":[16],"valueChangeCallback":[16],"disabled":[4],"newoptions":[1],"newfilter":[1],"isDisabled":[32],"componentID":[32],"rawData":[32],"pickerClass":[32],"displayedValue":[32],"value":[32],"shownTree":[32],"searchResultData":[32],"hasFocus":[32],"errorToLog":[32],"getValue":[64],"refreshPicker":[64],"setOptions":[64],"getSearchResult":[64],"filterTree":[64],"clearPicker":[64],"showSelectedNodes":[64]}],[0,"search-input",{"placeholder":[1],"setFocus":[64]}]]]], options);
17
+ return index.bootstrapLazy([["reneco-hierarchized-picker_2.cjs",[[0,"reneco-hierarchized-picker",{"options":[1],"valueChangeCallback":[16],"disabled":[4],"newoptions":[1],"newfilter":[1],"isDisabled":[32],"componentID":[32],"rawData":[32],"pickerClass":[32],"displayedValue":[32],"value":[32],"shownTree":[32],"searchResultData":[32],"hasFocus":[32],"errorToLog":[32],"getValue":[64],"refreshPicker":[64],"setOptions":[64],"getSearchResult":[64],"filterTree":[64],"clearPicker":[64],"showSelectedNodes":[64]}],[0,"search-input",{"placeholder":[1],"setFocus":[64]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -17,7 +17,7 @@ const patchBrowser = () => {
17
17
  };
18
18
 
19
19
  patchBrowser().then(options => {
20
- return index.bootstrapLazy([["reneco-hierarchized-picker_2.cjs",[[0,"reneco-hierarchized-picker",{"options":[16],"valueChangeCallback":[16],"disabled":[4],"newoptions":[1],"newfilter":[1],"isDisabled":[32],"componentID":[32],"rawData":[32],"pickerClass":[32],"displayedValue":[32],"value":[32],"shownTree":[32],"searchResultData":[32],"hasFocus":[32],"errorToLog":[32],"getValue":[64],"refreshPicker":[64],"setOptions":[64],"getSearchResult":[64],"filterTree":[64],"clearPicker":[64],"showSelectedNodes":[64]}],[0,"search-input",{"placeholder":[1],"setFocus":[64]}]]]], options);
20
+ return index.bootstrapLazy([["reneco-hierarchized-picker_2.cjs",[[0,"reneco-hierarchized-picker",{"options":[1],"valueChangeCallback":[16],"disabled":[4],"newoptions":[1],"newfilter":[1],"isDisabled":[32],"componentID":[32],"rawData":[32],"pickerClass":[32],"displayedValue":[32],"value":[32],"shownTree":[32],"searchResultData":[32],"hasFocus":[32],"errorToLog":[32],"getValue":[64],"refreshPicker":[64],"setOptions":[64],"getSearchResult":[64],"filterTree":[64],"clearPicker":[64],"showSelectedNodes":[64]}],[0,"search-input",{"placeholder":[1],"setFocus":[64]}]]]], options);
21
21
  });
22
22
 
23
23
  exports.setNonce = index.setNonce;
@@ -18546,6 +18546,11 @@ const HierarchizedPickerComponent = class {
18546
18546
  async setOptions(newOptions) {
18547
18547
  this.setNewOption(newOptions);
18548
18548
  }
18549
+ getOptionsAsIConf(options) {
18550
+ if (typeof options == 'string')
18551
+ return JSON.parse(options);
18552
+ return options;
18553
+ }
18549
18554
  setSearchResults(tree) {
18550
18555
  let searchCount = 0;
18551
18556
  const queue = [...tree];
@@ -18701,7 +18706,7 @@ const HierarchizedPickerComponent = class {
18701
18706
  }
18702
18707
  async componentWillLoad() {
18703
18708
  this.isDisabled = this.disabled;
18704
- this.optionsManager = new OptionsManager(this.options);
18709
+ this.optionsManager = new OptionsManager(this.getOptionsAsIConf(this.options));
18705
18710
  this.rawDataManager = new RawDataManager(() => this.getToken(), this.optionsManager);
18706
18711
  await this.loadHierarchizedPicker();
18707
18712
  this.setDisplayedValueFromDefault();
@@ -18878,13 +18883,13 @@ const HierarchizedPickerComponent = class {
18878
18883
  }
18879
18884
  async getToken() {
18880
18885
  var _a;
18881
- if (typeof this.options.token === 'string') {
18882
- return this.options.token.length > 200
18883
- ? this.options.token
18884
- : (_a = window.localStorage.getItem(this.options.token)) !== null && _a !== void 0 ? _a : null;
18886
+ if (typeof this.getOptionsAsIConf(this.options).token === 'string') {
18887
+ return this.getOptionsAsIConf(this.options).token.length > 200
18888
+ ? this.getOptionsAsIConf(this.options).token
18889
+ : (_a = window.localStorage.getItem(this.getOptionsAsIConf(this.options).token)) !== null && _a !== void 0 ? _a : null;
18885
18890
  }
18886
- if (typeof this.options.token === 'function') {
18887
- const token = await this.options.token();
18891
+ if (typeof this.getOptionsAsIConf(this.options).token === 'function') {
18892
+ const token = await this.getOptionsAsIConf(this.options).token();
18888
18893
  return typeof token === 'string' ? token : null;
18889
18894
  }
18890
18895
  return null;
@@ -46,6 +46,11 @@ export class HierarchizedPickerComponent {
46
46
  async setOptions(newOptions) {
47
47
  this.setNewOption(newOptions);
48
48
  }
49
+ getOptionsAsIConf(options) {
50
+ if (typeof options == 'string')
51
+ return JSON.parse(options);
52
+ return options;
53
+ }
49
54
  setSearchResults(tree) {
50
55
  let searchCount = 0;
51
56
  const queue = [...tree];
@@ -196,7 +201,7 @@ export class HierarchizedPickerComponent {
196
201
  }
197
202
  async componentWillLoad() {
198
203
  this.isDisabled = this.disabled;
199
- this.optionsManager = new OptionsManager(this.options);
204
+ this.optionsManager = new OptionsManager(this.getOptionsAsIConf(this.options));
200
205
  this.rawDataManager = new RawDataManager(() => this.getToken(), this.optionsManager);
201
206
  await this.loadHierarchizedPicker();
202
207
  this.setDisplayedValueFromDefault();
@@ -376,13 +381,13 @@ export class HierarchizedPickerComponent {
376
381
  }
377
382
  async getToken() {
378
383
  var _a;
379
- if (typeof this.options.token === 'string') {
380
- return this.options.token.length > 200
381
- ? this.options.token
382
- : (_a = window.localStorage.getItem(this.options.token)) !== null && _a !== void 0 ? _a : null;
384
+ if (typeof this.getOptionsAsIConf(this.options).token === 'string') {
385
+ return this.getOptionsAsIConf(this.options).token.length > 200
386
+ ? this.getOptionsAsIConf(this.options).token
387
+ : (_a = window.localStorage.getItem(this.getOptionsAsIConf(this.options).token)) !== null && _a !== void 0 ? _a : null;
383
388
  }
384
- if (typeof this.options.token === 'function') {
385
- const token = await this.options.token();
389
+ if (typeof this.getOptionsAsIConf(this.options).token === 'function') {
390
+ const token = await this.getOptionsAsIConf(this.options).token();
386
391
  return typeof token === 'string' ? token : null;
387
392
  }
388
393
  return null;
@@ -975,11 +980,11 @@ export class HierarchizedPickerComponent {
975
980
  static get properties() {
976
981
  return {
977
982
  "options": {
978
- "type": "unknown",
983
+ "type": "string",
979
984
  "mutable": false,
980
985
  "complexType": {
981
- "original": "IConf",
982
- "resolved": "IConf",
986
+ "original": "string | IConf",
987
+ "resolved": "IConf | string",
983
988
  "references": {
984
989
  "IConf": {
985
990
  "location": "import",
@@ -992,7 +997,9 @@ export class HierarchizedPickerComponent {
992
997
  "docs": {
993
998
  "tags": [],
994
999
  "text": "The component's options as described in the IConf interface"
995
- }
1000
+ },
1001
+ "attribute": "options",
1002
+ "reflect": false
996
1003
  },
997
1004
  "valueChangeCallback": {
998
1005
  "type": "unknown",
@@ -18543,6 +18543,11 @@ const HierarchizedPickerComponent = class extends HTMLElement {
18543
18543
  async setOptions(newOptions) {
18544
18544
  this.setNewOption(newOptions);
18545
18545
  }
18546
+ getOptionsAsIConf(options) {
18547
+ if (typeof options == 'string')
18548
+ return JSON.parse(options);
18549
+ return options;
18550
+ }
18546
18551
  setSearchResults(tree) {
18547
18552
  let searchCount = 0;
18548
18553
  const queue = [...tree];
@@ -18699,7 +18704,7 @@ const HierarchizedPickerComponent = class extends HTMLElement {
18699
18704
  }
18700
18705
  async componentWillLoad() {
18701
18706
  this.isDisabled = this.disabled;
18702
- this.optionsManager = new OptionsManager(this.options);
18707
+ this.optionsManager = new OptionsManager(this.getOptionsAsIConf(this.options));
18703
18708
  this.rawDataManager = new RawDataManager(() => this.getToken(), this.optionsManager);
18704
18709
  await this.loadHierarchizedPicker();
18705
18710
  this.setDisplayedValueFromDefault();
@@ -18876,13 +18881,13 @@ const HierarchizedPickerComponent = class extends HTMLElement {
18876
18881
  }
18877
18882
  async getToken() {
18878
18883
  var _a;
18879
- if (typeof this.options.token === 'string') {
18880
- return this.options.token.length > 200
18881
- ? this.options.token
18882
- : (_a = window.localStorage.getItem(this.options.token)) !== null && _a !== void 0 ? _a : null;
18884
+ if (typeof this.getOptionsAsIConf(this.options).token === 'string') {
18885
+ return this.getOptionsAsIConf(this.options).token.length > 200
18886
+ ? this.getOptionsAsIConf(this.options).token
18887
+ : (_a = window.localStorage.getItem(this.getOptionsAsIConf(this.options).token)) !== null && _a !== void 0 ? _a : null;
18883
18888
  }
18884
- if (typeof this.options.token === 'function') {
18885
- const token = await this.options.token();
18889
+ if (typeof this.getOptionsAsIConf(this.options).token === 'function') {
18890
+ const token = await this.getOptionsAsIConf(this.options).token();
18886
18891
  return typeof token === 'string' ? token : null;
18887
18892
  }
18888
18893
  return null;
@@ -19517,7 +19522,7 @@ const SearchInput$1 = class extends HTMLElement {
19517
19522
  static get style() { return searchInputCss; }
19518
19523
  };
19519
19524
 
19520
- const RenecoHierarchizedPicker = /*@__PURE__*/proxyCustomElement(HierarchizedPickerComponent, [0,"reneco-hierarchized-picker",{"options":[16],"valueChangeCallback":[16],"disabled":[4],"newoptions":[1],"newfilter":[1],"isDisabled":[32],"componentID":[32],"rawData":[32],"pickerClass":[32],"displayedValue":[32],"value":[32],"shownTree":[32],"searchResultData":[32],"hasFocus":[32],"errorToLog":[32]}]);
19525
+ const RenecoHierarchizedPicker = /*@__PURE__*/proxyCustomElement(HierarchizedPickerComponent, [0,"reneco-hierarchized-picker",{"options":[1],"valueChangeCallback":[16],"disabled":[4],"newoptions":[1],"newfilter":[1],"isDisabled":[32],"componentID":[32],"rawData":[32],"pickerClass":[32],"displayedValue":[32],"value":[32],"shownTree":[32],"searchResultData":[32],"hasFocus":[32],"errorToLog":[32]}]);
19521
19526
  const SearchInput = /*@__PURE__*/proxyCustomElement(SearchInput$1, [0,"search-input",{"placeholder":[1]}]);
19522
19527
  const defineCustomElements = (opts) => {
19523
19528
  if (typeof customElements !== 'undefined') {
@@ -11,7 +11,7 @@ const patchEsm = () => {
11
11
  const defineCustomElements = (win, options) => {
12
12
  if (typeof window === 'undefined') return Promise.resolve();
13
13
  return patchEsm().then(() => {
14
- return bootstrapLazy([["reneco-hierarchized-picker_2",[[0,"reneco-hierarchized-picker",{"options":[16],"valueChangeCallback":[16],"disabled":[4],"newoptions":[1],"newfilter":[1],"isDisabled":[32],"componentID":[32],"rawData":[32],"pickerClass":[32],"displayedValue":[32],"value":[32],"shownTree":[32],"searchResultData":[32],"hasFocus":[32],"errorToLog":[32],"getValue":[64],"refreshPicker":[64],"setOptions":[64],"getSearchResult":[64],"filterTree":[64],"clearPicker":[64],"showSelectedNodes":[64]}],[0,"search-input",{"placeholder":[1],"setFocus":[64]}]]]], options);
14
+ return bootstrapLazy([["reneco-hierarchized-picker_2",[[0,"reneco-hierarchized-picker",{"options":[1],"valueChangeCallback":[16],"disabled":[4],"newoptions":[1],"newfilter":[1],"isDisabled":[32],"componentID":[32],"rawData":[32],"pickerClass":[32],"displayedValue":[32],"value":[32],"shownTree":[32],"searchResultData":[32],"hasFocus":[32],"errorToLog":[32],"getValue":[64],"refreshPicker":[64],"setOptions":[64],"getSearchResult":[64],"filterTree":[64],"clearPicker":[64],"showSelectedNodes":[64]}],[0,"search-input",{"placeholder":[1],"setFocus":[64]}]]]], options);
15
15
  });
16
16
  };
17
17
 
@@ -14,5 +14,5 @@ const patchBrowser = () => {
14
14
  };
15
15
 
16
16
  patchBrowser().then(options => {
17
- return bootstrapLazy([["reneco-hierarchized-picker_2",[[0,"reneco-hierarchized-picker",{"options":[16],"valueChangeCallback":[16],"disabled":[4],"newoptions":[1],"newfilter":[1],"isDisabled":[32],"componentID":[32],"rawData":[32],"pickerClass":[32],"displayedValue":[32],"value":[32],"shownTree":[32],"searchResultData":[32],"hasFocus":[32],"errorToLog":[32],"getValue":[64],"refreshPicker":[64],"setOptions":[64],"getSearchResult":[64],"filterTree":[64],"clearPicker":[64],"showSelectedNodes":[64]}],[0,"search-input",{"placeholder":[1],"setFocus":[64]}]]]], options);
17
+ return bootstrapLazy([["reneco-hierarchized-picker_2",[[0,"reneco-hierarchized-picker",{"options":[1],"valueChangeCallback":[16],"disabled":[4],"newoptions":[1],"newfilter":[1],"isDisabled":[32],"componentID":[32],"rawData":[32],"pickerClass":[32],"displayedValue":[32],"value":[32],"shownTree":[32],"searchResultData":[32],"hasFocus":[32],"errorToLog":[32],"getValue":[64],"refreshPicker":[64],"setOptions":[64],"getSearchResult":[64],"filterTree":[64],"clearPicker":[64],"showSelectedNodes":[64]}],[0,"search-input",{"placeholder":[1],"setFocus":[64]}]]]], options);
18
18
  });
@@ -18542,6 +18542,11 @@ const HierarchizedPickerComponent = class {
18542
18542
  async setOptions(newOptions) {
18543
18543
  this.setNewOption(newOptions);
18544
18544
  }
18545
+ getOptionsAsIConf(options) {
18546
+ if (typeof options == 'string')
18547
+ return JSON.parse(options);
18548
+ return options;
18549
+ }
18545
18550
  setSearchResults(tree) {
18546
18551
  let searchCount = 0;
18547
18552
  const queue = [...tree];
@@ -18697,7 +18702,7 @@ const HierarchizedPickerComponent = class {
18697
18702
  }
18698
18703
  async componentWillLoad() {
18699
18704
  this.isDisabled = this.disabled;
18700
- this.optionsManager = new OptionsManager(this.options);
18705
+ this.optionsManager = new OptionsManager(this.getOptionsAsIConf(this.options));
18701
18706
  this.rawDataManager = new RawDataManager(() => this.getToken(), this.optionsManager);
18702
18707
  await this.loadHierarchizedPicker();
18703
18708
  this.setDisplayedValueFromDefault();
@@ -18874,13 +18879,13 @@ const HierarchizedPickerComponent = class {
18874
18879
  }
18875
18880
  async getToken() {
18876
18881
  var _a;
18877
- if (typeof this.options.token === 'string') {
18878
- return this.options.token.length > 200
18879
- ? this.options.token
18880
- : (_a = window.localStorage.getItem(this.options.token)) !== null && _a !== void 0 ? _a : null;
18882
+ if (typeof this.getOptionsAsIConf(this.options).token === 'string') {
18883
+ return this.getOptionsAsIConf(this.options).token.length > 200
18884
+ ? this.getOptionsAsIConf(this.options).token
18885
+ : (_a = window.localStorage.getItem(this.getOptionsAsIConf(this.options).token)) !== null && _a !== void 0 ? _a : null;
18881
18886
  }
18882
- if (typeof this.options.token === 'function') {
18883
- const token = await this.options.token();
18887
+ if (typeof this.getOptionsAsIConf(this.options).token === 'function') {
18888
+ const token = await this.getOptionsAsIConf(this.options).token();
18884
18889
  return typeof token === 'string' ? token : null;
18885
18890
  }
18886
18891
  return null;
@@ -1 +1 @@
1
- import{p as promiseResolve,b as bootstrapLazy}from"./index-ef964604.js";export{s as setNonce}from"./index-ef964604.js";var patchEsm=function(){return promiseResolve()};var defineCustomElements=function(e,r){if(typeof window==="undefined")return Promise.resolve();return patchEsm().then((function(){return bootstrapLazy([["reneco-hierarchized-picker_2",[[0,"reneco-hierarchized-picker",{options:[16],valueChangeCallback:[16],disabled:[4],newoptions:[1],newfilter:[1],isDisabled:[32],componentID:[32],rawData:[32],pickerClass:[32],displayedValue:[32],value:[32],shownTree:[32],searchResultData:[32],hasFocus:[32],errorToLog:[32],getValue:[64],refreshPicker:[64],setOptions:[64],getSearchResult:[64],filterTree:[64],clearPicker:[64],showSelectedNodes:[64]}],[0,"search-input",{placeholder:[1],setFocus:[64]}]]]],r)}))};export{defineCustomElements};
1
+ import{p as promiseResolve,b as bootstrapLazy}from"./index-ef964604.js";export{s as setNonce}from"./index-ef964604.js";var patchEsm=function(){return promiseResolve()};var defineCustomElements=function(e,r){if(typeof window==="undefined")return Promise.resolve();return patchEsm().then((function(){return bootstrapLazy([["reneco-hierarchized-picker_2",[[0,"reneco-hierarchized-picker",{options:[1],valueChangeCallback:[16],disabled:[4],newoptions:[1],newfilter:[1],isDisabled:[32],componentID:[32],rawData:[32],pickerClass:[32],displayedValue:[32],value:[32],shownTree:[32],searchResultData:[32],hasFocus:[32],errorToLog:[32],getValue:[64],refreshPicker:[64],setOptions:[64],getSearchResult:[64],filterTree:[64],clearPicker:[64],showSelectedNodes:[64]}],[0,"search-input",{placeholder:[1],setFocus:[64]}]]]],r)}))};export{defineCustomElements};
@@ -1 +1 @@
1
- import{p as promiseResolve,b as bootstrapLazy}from"./index-ef964604.js";export{s as setNonce}from"./index-ef964604.js";var patchBrowser=function(){var e=import.meta.url;var r={};if(e!==""){r.resourcesUrl=new URL(".",e).href}return promiseResolve(r)};patchBrowser().then((function(e){return bootstrapLazy([["reneco-hierarchized-picker_2",[[0,"reneco-hierarchized-picker",{options:[16],valueChangeCallback:[16],disabled:[4],newoptions:[1],newfilter:[1],isDisabled:[32],componentID:[32],rawData:[32],pickerClass:[32],displayedValue:[32],value:[32],shownTree:[32],searchResultData:[32],hasFocus:[32],errorToLog:[32],getValue:[64],refreshPicker:[64],setOptions:[64],getSearchResult:[64],filterTree:[64],clearPicker:[64],showSelectedNodes:[64]}],[0,"search-input",{placeholder:[1],setFocus:[64]}]]]],e)}));
1
+ import{p as promiseResolve,b as bootstrapLazy}from"./index-ef964604.js";export{s as setNonce}from"./index-ef964604.js";var patchBrowser=function(){var e=import.meta.url;var r={};if(e!==""){r.resourcesUrl=new URL(".",e).href}return promiseResolve(r)};patchBrowser().then((function(e){return bootstrapLazy([["reneco-hierarchized-picker_2",[[0,"reneco-hierarchized-picker",{options:[1],valueChangeCallback:[16],disabled:[4],newoptions:[1],newfilter:[1],isDisabled:[32],componentID:[32],rawData:[32],pickerClass:[32],displayedValue:[32],value:[32],shownTree:[32],searchResultData:[32],hasFocus:[32],errorToLog:[32],getValue:[64],refreshPicker:[64],setOptions:[64],getSearchResult:[64],filterTree:[64],clearPicker:[64],showSelectedNodes:[64]}],[0,"search-input",{placeholder:[1],setFocus:[64]}]]]],e)}));