declarative-forms 2.1.1 → 2.1.2
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/dist/index.cjs +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +10 -4
- package/styles/classic.css +15 -4
package/dist/index.cjs
CHANGED
|
@@ -1380,10 +1380,11 @@ var SelectField = class extends Field {
|
|
|
1380
1380
|
async loadOptions(opts = {}) {
|
|
1381
1381
|
const isCurrent = this.context.scheduler.claim(`options:${this.descriptor.name}`);
|
|
1382
1382
|
const source = this.descriptor.options;
|
|
1383
|
-
|
|
1384
|
-
const isAsync = requested instanceof Promise;
|
|
1385
|
-
if (isAsync) this.select.setLoadingStatus();
|
|
1383
|
+
let isAsync = false;
|
|
1386
1384
|
try {
|
|
1385
|
+
const requested = typeof source === "function" ? source(this.context.contextFor(this.descriptor)) : source;
|
|
1386
|
+
isAsync = requested instanceof Promise;
|
|
1387
|
+
if (isAsync) this.select.setLoadingStatus();
|
|
1387
1388
|
const options = await requested ?? [];
|
|
1388
1389
|
if (!isCurrent()) return;
|
|
1389
1390
|
if (opts.reload) this.context.tooltips.reset(this.descriptor.name);
|