@atscript/ui 0.1.62 → 0.1.64
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 +5 -2
- package/dist/index.mjs +5 -2
- package/dist/plugin.cjs +1 -0
- package/dist/plugin.mjs +1 -0
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -348,10 +348,11 @@ function createFieldDef(path, prop) {
|
|
|
348
348
|
const customType = uiType;
|
|
349
349
|
if (kind === "array") {
|
|
350
350
|
const arrayType = prop.type;
|
|
351
|
+
const isMultiselect = customType === "multiselect" || getFieldMeta(prop, "ui.form.options") !== void 0 || getFieldMeta(prop, "ui.form.fn.options") !== void 0 || isPureLiteralUnion(arrayType.of);
|
|
351
352
|
return {
|
|
352
353
|
...base,
|
|
353
354
|
type: "array",
|
|
354
|
-
customType,
|
|
355
|
+
customType: isMultiselect ? "multiselect" : customType,
|
|
355
356
|
itemType: arrayType.of,
|
|
356
357
|
itemField: createFieldDef("", arrayType.of)
|
|
357
358
|
};
|
|
@@ -545,7 +546,9 @@ function parseStaticOptions(raw) {
|
|
|
545
546
|
function resolveOptions(prop, scope) {
|
|
546
547
|
const resolved = resolveFieldProp(prop, UI_FORM_FN_OPTIONS, UI_FORM_OPTIONS, scope, { transform: parseStaticOptions });
|
|
547
548
|
if (resolved !== void 0) return resolved;
|
|
548
|
-
|
|
549
|
+
const literals = extractLiteralOptions(prop);
|
|
550
|
+
if (literals !== void 0) return literals;
|
|
551
|
+
if (prop.type.kind === "array") return extractLiteralOptions(prop.type.of);
|
|
549
552
|
}
|
|
550
553
|
//#endregion
|
|
551
554
|
//#region src/value-help/value-help-client.ts
|
package/dist/index.mjs
CHANGED
|
@@ -347,10 +347,11 @@ function createFieldDef(path, prop) {
|
|
|
347
347
|
const customType = uiType;
|
|
348
348
|
if (kind === "array") {
|
|
349
349
|
const arrayType = prop.type;
|
|
350
|
+
const isMultiselect = customType === "multiselect" || getFieldMeta(prop, "ui.form.options") !== void 0 || getFieldMeta(prop, "ui.form.fn.options") !== void 0 || isPureLiteralUnion(arrayType.of);
|
|
350
351
|
return {
|
|
351
352
|
...base,
|
|
352
353
|
type: "array",
|
|
353
|
-
customType,
|
|
354
|
+
customType: isMultiselect ? "multiselect" : customType,
|
|
354
355
|
itemType: arrayType.of,
|
|
355
356
|
itemField: createFieldDef("", arrayType.of)
|
|
356
357
|
};
|
|
@@ -544,7 +545,9 @@ function parseStaticOptions(raw) {
|
|
|
544
545
|
function resolveOptions(prop, scope) {
|
|
545
546
|
const resolved = resolveFieldProp(prop, UI_FORM_FN_OPTIONS, UI_FORM_OPTIONS, scope, { transform: parseStaticOptions });
|
|
546
547
|
if (resolved !== void 0) return resolved;
|
|
547
|
-
|
|
548
|
+
const literals = extractLiteralOptions(prop);
|
|
549
|
+
if (literals !== void 0) return literals;
|
|
550
|
+
if (prop.type.kind === "array") return extractLiteralOptions(prop.type.of);
|
|
548
551
|
}
|
|
549
552
|
//#endregion
|
|
550
553
|
//#region src/value-help/value-help-client.ts
|
package/dist/plugin.cjs
CHANGED
package/dist/plugin.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.64",
|
|
4
4
|
"description": "Framework-agnostic runtime for form and table definitions from atscript annotated types",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"annotations",
|
|
@@ -46,18 +46,18 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@atscript/db-client": "^0.1.
|
|
49
|
+
"@atscript/db-client": "^0.1.79"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@atscript/core": "^0.1.
|
|
53
|
-
"@atscript/db": "^0.1.
|
|
54
|
-
"@atscript/typescript": "^0.1.
|
|
55
|
-
"unplugin-atscript": "^0.1.
|
|
52
|
+
"@atscript/core": "^0.1.56",
|
|
53
|
+
"@atscript/db": "^0.1.79",
|
|
54
|
+
"@atscript/typescript": "^0.1.56",
|
|
55
|
+
"unplugin-atscript": "^0.1.56",
|
|
56
56
|
"vitest": "npm:@voidzero-dev/vite-plus-test@latest"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@atscript/core": "^0.1.
|
|
60
|
-
"@atscript/typescript": "^0.1.
|
|
59
|
+
"@atscript/core": "^0.1.56",
|
|
60
|
+
"@atscript/typescript": "^0.1.56"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"build": "vp pack",
|