@sitecore-feaas/clientside 0.0.5 → 0.0.7

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.
@@ -191,6 +191,8 @@ class HTMLFeaasPickerLazy extends WebComponent {
191
191
  return ['library', 'mode', 'hidden', 'src']
192
192
  }
193
193
 
194
+ getToken?: (options: any) => Promise<string>
195
+
194
196
  src = 'https://components.sitecorecloud.io/assets/picker.js'
195
197
 
196
198
  script: HTMLScriptElement
@@ -233,7 +235,6 @@ class HTMLFeaasPickerLazy extends WebComponent {
233
235
  const value = this[key as keyof typeof this]
234
236
  if (value == null) {
235
237
  this.removeAttribute(key)
236
- this.load()
237
238
  } else if (this.getAttribute(key) != String(value)) {
238
239
  this.setAttribute(key, String(value))
239
240
  }
@@ -243,8 +244,12 @@ class HTMLFeaasPickerLazy extends WebComponent {
243
244
  } else if (this.getAttribute('hidden') == null) {
244
245
  this.setAttribute('hidden', 'hidden')
245
246
  }
247
+ if (this.mode && !this.hidden) {
248
+ this.load()
249
+ }
246
250
  if (this.element && this.element.set) {
247
251
  this.element.onClose = this.onClose
252
+ this.element.getToken = this.getToken
248
253
  this.element.set(options)
249
254
  }
250
255
  }