@atscript/ui 0.1.198 → 0.1.200

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.
@@ -61,8 +61,9 @@ const serverManagedPlugin = (ctx, def, value) => {
61
61
  };
62
62
  /**
63
63
  * A required value-help picker left unpicked — absent, `null` (its ×), or `""`
64
- * for a string foreign key (never a key; a `@ui.valueHelp` binding on a plain
65
- * string column takes `""`, as the server does) — fails with code `REQUIRED`
64
+ * for a string foreign key (never a key, unless its own `@meta.default` is
65
+ * `''`: its "none"; a `@ui.valueHelp` binding on a plain string column takes
66
+ * `""`, as the server does) — fails with code `REQUIRED`
66
67
  * and its `@expect.message`, else the code's text ("Must not be empty"), as
67
68
  * `@meta.required` reports a missing value (a number field may not carry
68
69
  * `@meta.required`). A `@meta.required` field keeps the validator's own rule
@@ -82,7 +83,7 @@ function missingPickPlugin(pickers) {
82
83
  if (value !== void 0 && value !== null && value !== "") return void 0;
83
84
  if (!pickers.has(def) || def.optional || def.metadata.has("meta.required")) return void 0;
84
85
  if (value === "") {
85
- if (!(def.type.designType === "string") || !require_extract_ref.isForeignKey(def)) return void 0;
86
+ if (!(def.type.designType === "string") || def.metadata.get("meta.default") === "" || !require_extract_ref.isForeignKey(def)) return;
86
87
  }
87
88
  const custom = def.metadata.get(require_annotation_keys.EXPECT_MESSAGE);
88
89
  ctx.error(custom || _atscript_typescript_utils.VALIDATOR_MESSAGES.REQUIRED, void 0, void 0, {
@@ -61,8 +61,9 @@ const serverManagedPlugin = (ctx, def, value) => {
61
61
  };
62
62
  /**
63
63
  * A required value-help picker left unpicked — absent, `null` (its ×), or `""`
64
- * for a string foreign key (never a key; a `@ui.valueHelp` binding on a plain
65
- * string column takes `""`, as the server does) — fails with code `REQUIRED`
64
+ * for a string foreign key (never a key, unless its own `@meta.default` is
65
+ * `''`: its "none"; a `@ui.valueHelp` binding on a plain string column takes
66
+ * `""`, as the server does) — fails with code `REQUIRED`
66
67
  * and its `@expect.message`, else the code's text ("Must not be empty"), as
67
68
  * `@meta.required` reports a missing value (a number field may not carry
68
69
  * `@meta.required`). A `@meta.required` field keeps the validator's own rule
@@ -82,7 +83,7 @@ function missingPickPlugin(pickers) {
82
83
  if (value !== void 0 && value !== null && value !== "") return void 0;
83
84
  if (!pickers.has(def) || def.optional || def.metadata.has("meta.required")) return void 0;
84
85
  if (value === "") {
85
- if (!(def.type.designType === "string") || !isForeignKey(def)) return void 0;
86
+ if (!(def.type.designType === "string") || def.metadata.get("meta.default") === "" || !isForeignKey(def)) return;
86
87
  }
87
88
  const custom = def.metadata.get(EXPECT_MESSAGE);
88
89
  ctx.error(custom || VALIDATOR_MESSAGES.REQUIRED, void 0, void 0, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atscript/ui",
3
- "version": "0.1.198",
3
+ "version": "0.1.200",
4
4
  "description": "Framework-agnostic runtime for form and table definitions from atscript annotated types",
5
5
  "keywords": [
6
6
  "annotations",
@@ -52,20 +52,20 @@
52
52
  "access": "public"
53
53
  },
54
54
  "dependencies": {
55
- "@atscript/db-client": "^0.1.202"
55
+ "@atscript/db-client": "^0.1.203"
56
56
  },
57
57
  "devDependencies": {
58
- "@atscript/core": "^0.2.27",
59
- "@atscript/db": "^0.1.202",
60
- "@atscript/typescript": "^0.2.27",
58
+ "@atscript/core": "^0.2.28",
59
+ "@atscript/db": "^0.1.203",
60
+ "@atscript/typescript": "^0.2.28",
61
61
  "@uniqu/core": "^0.2.2",
62
- "unplugin-atscript": "^0.2.27",
62
+ "unplugin-atscript": "^0.2.28",
63
63
  "vitest": "npm:@voidzero-dev/vite-plus-test@0.1.14"
64
64
  },
65
65
  "peerDependencies": {
66
- "@atscript/core": "^0.2.27",
67
- "@atscript/db": "^0.1.202",
68
- "@atscript/typescript": "^0.2.27"
66
+ "@atscript/core": "^0.2.28",
67
+ "@atscript/db": "^0.1.203",
68
+ "@atscript/typescript": "^0.2.28"
69
69
  },
70
70
  "scripts": {
71
71
  "build": "vp pack",