@atscript/vue-form 0.1.100 → 0.1.101

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.
@@ -4,7 +4,7 @@ import { t as CLIENT_FACTORY_KEY } from "./use-as-value-help-CBykDEjZ.mjs";
4
4
  import { t as as_field_default } from "./as-field-CDB-HIfz.mjs";
5
5
  import { t as as_iterator_default } from "./as-iterator---gxkT-L.mjs";
6
6
  import { computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeProps, openBlock, provide, reactive, ref, renderSlot, toDisplayString, toRaw, toValue, unref, watch, watchEffect, withModifiers } from "vue";
7
- import { META_DESCRIPTION, META_LABEL, UI_FORM_ACTION, UI_FORM_FN_DESCRIPTION, UI_FORM_FN_SUBMIT_DISABLED, UI_FORM_FN_SUBMIT_TEXT, UI_FORM_FN_TITLE, UI_FORM_SUBMIT_TEXT, WF_ACTION_WITH_DATA, buildDescendantErrorCounts, getFieldMeta, getFormValidator, iteratePathAncestors, mergeErrorMaps, resolveFormProp } from "@atscript/ui";
7
+ import { META_DESCRIPTION, META_LABEL, UI_FORM_FN_DESCRIPTION, UI_FORM_FN_SUBMIT_DISABLED, UI_FORM_FN_SUBMIT_TEXT, UI_FORM_FN_TITLE, UI_FORM_SUBMIT_TEXT, buildDescendantErrorCounts, getDeclaredFormActions, getFormValidator, iteratePathAncestors, mergeErrorMaps, resolveFormProp } from "@atscript/ui";
8
8
  //#region src/composables/use-as-external-errors.ts
9
9
  /**
10
10
  * Local dismissal state for externally-supplied errors.
@@ -228,10 +228,7 @@ function useAsForm(options) {
228
228
  formContext: formContext.value
229
229
  }));
230
230
  function supportsAction(def, actionId) {
231
- return def.fields.some((f) => {
232
- if (getFieldMeta(f.prop, UI_FORM_ACTION)?.id === actionId) return true;
233
- return getFieldMeta(f.prop, WF_ACTION_WITH_DATA) === actionId;
234
- });
231
+ return getDeclaredFormActions(def).some((a) => a.id === actionId);
235
232
  }
236
233
  function invokeAction(name) {
237
234
  if (supportsAction(options.def(), name)) options.emits?.action?.(name, domainData());
@@ -228,10 +228,7 @@ function useAsForm(options) {
228
228
  formContext: formContext.value
229
229
  }));
230
230
  function supportsAction(def, actionId) {
231
- return def.fields.some((f) => {
232
- if ((0, _atscript_ui.getFieldMeta)(f.prop, _atscript_ui.UI_FORM_ACTION)?.id === actionId) return true;
233
- return (0, _atscript_ui.getFieldMeta)(f.prop, _atscript_ui.WF_ACTION_WITH_DATA) === actionId;
234
- });
231
+ return (0, _atscript_ui.getDeclaredFormActions)(def).some((a) => a.id === actionId);
235
232
  }
236
233
  function invokeAction(name) {
237
234
  if (supportsAction(options.def(), name)) options.emits?.action?.(name, domainData());
package/dist/as-form.cjs CHANGED
@@ -1,2 +1,2 @@
1
- const require_as_form = require("./as-form-ZobuKJBo.cjs");
1
+ const require_as_form = require("./as-form-DaAnsFVF.cjs");
2
2
  module.exports = require_as_form.as_form_default;
@@ -1,2 +1,2 @@
1
- import { n as _default, t as Props } from "./as-form.vue-5FyX_1CQ.cjs";
1
+ import { n as _default, t as Props } from "./as-form.vue-BQx8-pxt.cjs";
2
2
  export { Props, _default as default };
@@ -1,2 +1,2 @@
1
- import { n as _default, t as Props } from "./as-form.vue-ZykHT4gZ.mjs";
1
+ import { n as _default, t as Props } from "./as-form.vue-CD0bUADp.mjs";
2
2
  export { Props, _default as default };
package/dist/as-form.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { t as as_form_default } from "./as-form-Cezf4SZG.mjs";
1
+ import { t as as_form_default } from "./as-form-8YNdb-49.mjs";
2
2
  export { as_form_default as default };
@@ -77,12 +77,12 @@ interface Props<TF, TC> {
77
77
  }
78
78
  declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
79
79
  props: vue.PublicProps & __VLS_PrettifyLocal<Props<TFormData, TFormContext> & {
80
- onSubmit?: ((data: TFormData) => any) | undefined;
81
80
  onError?: ((errors: {
82
81
  path: string;
83
82
  message: string;
84
83
  }[]) => any) | undefined;
85
84
  onAction?: ((name: string, data: TFormData) => any) | undefined;
85
+ onSubmit?: ((data: TFormData) => any) | undefined;
86
86
  "onUnsupported-action"?: ((name: string, data: TFormData) => any) | undefined;
87
87
  onChange?: ((type: TAsChangeType, path: string, value: unknown, formData: TFormData) => any) | undefined;
88
88
  }> & (typeof globalThis extends {
@@ -77,12 +77,12 @@ interface Props<TF, TC> {
77
77
  }
78
78
  declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
79
79
  props: vue.PublicProps & __VLS_PrettifyLocal<Props<TFormData, TFormContext> & {
80
- onSubmit?: ((data: TFormData) => any) | undefined;
81
80
  onError?: ((errors: {
82
81
  path: string;
83
82
  message: string;
84
83
  }[]) => any) | undefined;
85
84
  onAction?: ((name: string, data: TFormData) => any) | undefined;
85
+ onSubmit?: ((data: TFormData) => any) | undefined;
86
86
  "onUnsupported-action"?: ((name: string, data: TFormData) => any) | undefined;
87
87
  onChange?: ((type: TAsChangeType, path: string, value: unknown, formData: TFormData) => any) | undefined;
88
88
  }> & (typeof globalThis extends {
package/dist/index.cjs CHANGED
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_use_form_context = require("./use-form-context-Dwr8Ai1v.cjs");
3
3
  const require_use_as_nested_sections_store = require("./use-as-nested-sections-store-jdMRxjBE.cjs");
4
4
  const require_use_as_value_help = require("./use-as-value-help-uANI3zWa.cjs");
5
- const require_as_form = require("./as-form-ZobuKJBo.cjs");
5
+ const require_as_form = require("./as-form-DaAnsFVF.cjs");
6
6
  const require_as_field = require("./as-field-DGnC4dew.cjs");
7
7
  const require_use_as_locale = require("./use-as-locale-C4z5stwD.cjs");
8
8
  const require_as_iterator = require("./as-iterator-BWXIzbJF.cjs");
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { a as TAsComponentEmits, c as TAsUnionContext, i as TAsCollapsibleSlots, n as TAsChangeType, o as TAsComponentProps, r as TAsCollapsibleProps, s as TAsTypeComponents, t as TAsBaseComponentProps } from "./types-BYfe1QEF.cjs";
2
2
  import _default$3 from "./as-collapsible.cjs";
3
3
  import _default$7 from "./as-field.cjs";
4
- import { a as TFormRule, i as TFormFieldRegistration, n as _default$9, o as TFormState, r as TFormFieldCallbacks } from "./as-form.vue-5FyX_1CQ.cjs";
4
+ import { a as TFormRule, i as TFormFieldRegistration, n as _default$9, o as TFormState, r as TFormFieldCallbacks } from "./as-form.vue-BQx8-pxt.cjs";
5
5
  import _default$11 from "./as-iterator.cjs";
6
6
  import { t as _default } from "./as-action.vue-BCbopk0S.cjs";
7
7
  import { t as _default$1 } from "./as-array.vue-Ci4xO292.cjs";
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { a as TAsComponentEmits, c as TAsUnionContext, i as TAsCollapsibleSlots, n as TAsChangeType, o as TAsComponentProps, r as TAsCollapsibleProps, s as TAsTypeComponents, t as TAsBaseComponentProps } from "./types-CV9ss4UN.mjs";
2
2
  import _default$3 from "./as-collapsible.mjs";
3
3
  import _default$7 from "./as-field.mjs";
4
- import { a as TFormRule, i as TFormFieldRegistration, n as _default$9, o as TFormState, r as TFormFieldCallbacks } from "./as-form.vue-ZykHT4gZ.mjs";
4
+ import { a as TFormRule, i as TFormFieldRegistration, n as _default$9, o as TFormState, r as TFormFieldCallbacks } from "./as-form.vue-CD0bUADp.mjs";
5
5
  import _default$11 from "./as-iterator.mjs";
6
6
  import { t as _default } from "./as-action.vue-BtQX09n-.mjs";
7
7
  import { t as _default$1 } from "./as-array.vue-I42wuF6e.mjs";
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { m as PATH_PREFIX_KEY, n as useAsUnionVariant, s as DISMISS_EXTERNAL_AT_KEY, t as formatIndexedLabelParts } from "./use-form-context-bAj7UoSe.mjs";
2
2
  import { n as provideAsNestedSectionsStore, r as useAsNestedSectionsStore } from "./use-as-nested-sections-store-lhi0z5z1.mjs";
3
3
  import { n as useAsValueHelp } from "./use-as-value-help-CBykDEjZ.mjs";
4
- import { i as useAsExternalErrors, n as useAsForm, r as useAsState, t as as_form_default } from "./as-form-Cezf4SZG.mjs";
4
+ import { i as useAsExternalErrors, n as useAsForm, r as useAsState, t as as_form_default } from "./as-form-8YNdb-49.mjs";
5
5
  import { n as useAsData, r as useAsField, t as as_field_default } from "./as-field-CDB-HIfz.mjs";
6
6
  import { n as useAsLocale, t as provideAsLocale } from "./use-as-locale-BrFdAgnU.mjs";
7
7
  import { t as as_iterator_default } from "./as-iterator---gxkT-L.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atscript/vue-form",
3
- "version": "0.1.100",
3
+ "version": "0.1.101",
4
4
  "description": "Type-driven form rendering for Atscript with Vue 3",
5
5
  "keywords": [
6
6
  "atscript",
@@ -160,7 +160,7 @@
160
160
  "access": "public"
161
161
  },
162
162
  "dependencies": {
163
- "@atscript/ui": "^0.1.100"
163
+ "@atscript/ui": "^0.1.101"
164
164
  },
165
165
  "devDependencies": {
166
166
  "@atscript/core": "^0.1.76",
@@ -176,13 +176,13 @@
176
176
  "vue": "^3",
177
177
  "vue-tsc": "~3.2.9",
178
178
  "vunor": "^0.2.1",
179
- "@atscript/ui-fns": "^0.1.100"
179
+ "@atscript/ui-fns": "^0.1.101"
180
180
  },
181
181
  "peerDependencies": {
182
182
  "@atscript/db-client": "^0.1.106",
183
183
  "reka-ui": "^2.9.8",
184
184
  "vue": "^3",
185
- "@atscript/ui-fns": "^0.1.100"
185
+ "@atscript/ui-fns": "^0.1.101"
186
186
  },
187
187
  "scripts": {
188
188
  "build": "node ../../scripts/gen-exports.mjs && vp pack",