@7365admin1/layer-common 4.97.1-staging.729 → 4.97.1-staging.730

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.
@@ -58,7 +58,7 @@
58
58
  />
59
59
  <v-text-field
60
60
  v-model="model"
61
- :rules="[requiredRule]"
61
+ :rules="[nameRequiredRule]"
62
62
  class="filter-field mb-0"
63
63
  />
64
64
  </v-col>
@@ -149,7 +149,6 @@
149
149
 
150
150
  <script setup lang="ts">
151
151
  import useUnits from '../composables/useUnits';
152
- import useUtils from '../composables/useUtils';
153
152
 
154
153
  const model = defineModel("name", { type: String, default: "" });
155
154
  const typeModel = defineModel("type", { type: String, default: "Common" });
@@ -185,7 +184,8 @@ const valid = ref(false);
185
184
  const submitting = ref(false);
186
185
  const show = ref(false);
187
186
 
188
- const { requiredRule } = useUtils();
187
+ // Spaces only is still an empty name.
188
+ const nameRequiredRule = (v: any) => !!String(v ?? "").trim() || "Required";
189
189
 
190
190
  const unitsRequiredRule = (v: any) => {
191
191
  if (Array.isArray(v)) return v.length > 0 || "Select at least one unit";
@@ -237,7 +237,11 @@ async function submit() {
237
237
  let ok = valid.value;
238
238
  if (form && typeof form.validate === "function") {
239
239
  try {
240
- ok = await form.validate();
240
+ // Vuetify 3 resolves to `{ valid, errors }`, an object that is always
241
+ // truthy: reading it as the result let an empty name through and closed
242
+ // the popup without saving or saying anything (DV-1872).
243
+ const result = await form.validate();
244
+ ok = typeof result === "object" && result !== null ? !!result.valid : !!result;
241
245
  } catch (e) {
242
246
  ok = false;
243
247
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "4.97.1-staging.729",
5
+ "version": "4.97.1-staging.730",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",