@effect-app/vue-components 4.0.0-beta.153 → 4.0.0-beta.155
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/README.md +13 -9
- package/dist/types/components/OmegaForm/OmegaAutoGen.vue.d.ts +1 -2
- package/dist/types/index.d.ts +0 -1
- package/dist/vue-components60.es.js +3 -3
- package/dist/vue-components61.es.js +1 -1
- package/package.json +6 -7
- package/src/components/OmegaForm/OmegaArray.vue +6 -4
- package/src/components/OmegaForm/OmegaAutoGen.vue +3 -2
- package/src/components/OmegaForm/OmegaFormInput.vue +5 -1
- package/src/components/OmegaForm/OmegaInput.vue +5 -1
- package/src/components/OmegaForm/OmegaTaggedUnion.vue +4 -2
- package/src/components/OmegaForm/OmegaTaggedUnionInternal.vue +5 -1
- package/src/components/OmegaForm/OmegaWrapper.vue +4 -2
- package/src/components/OmegaForm/useOmegaForm.ts +1 -1
- package/src/index.ts +0 -1
- package/dist/types/constants/index.d.ts +0 -1
- package/src/constants/index.ts +0 -1
package/README.md
CHANGED
|
@@ -61,9 +61,9 @@ The doc app itself is a client app of the libary, therefore PrimeVue is imported
|
|
|
61
61
|
module.exports = {
|
|
62
62
|
vite: {
|
|
63
63
|
resolve: {
|
|
64
|
-
dedupe: [
|
|
65
|
-
}
|
|
66
|
-
}
|
|
64
|
+
dedupe: ["vue", /primevue\/.+/]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
67
|
}
|
|
68
68
|
```
|
|
69
69
|
|
|
@@ -103,7 +103,7 @@ If you have your own special set of SVG icons, you may create a font file (`.wof
|
|
|
103
103
|
The client app shall import `style.css`, usually in the entry file:
|
|
104
104
|
|
|
105
105
|
```js
|
|
106
|
-
import
|
|
106
|
+
import "my-lib/dist/style.css"
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
### Third-party dependencies
|
|
@@ -132,7 +132,7 @@ The dependency to be externalized may be declared as peer dependency in your lib
|
|
|
132
132
|
If you don't expect the client app of your library also needing the same dependency, you may embed cherry-picked functions. For example, to embed the `fill` function of popular library [lodash](https://lodash.com), import the `fill` function like the following:
|
|
133
133
|
|
|
134
134
|
```js
|
|
135
|
-
import fill from
|
|
135
|
+
import fill from "lodash/fill"
|
|
136
136
|
```
|
|
137
137
|
|
|
138
138
|
Even with tree-shaking, the codes being brought into your library may still be large, as the function may have its own dependencies.
|
|
@@ -190,7 +190,7 @@ In [tsconfig.json](tsconfig.js), set the following to address [Issue #32](https:
|
|
|
190
190
|
Vuetify 4 removed the aggressive global CSS reset that v3 included (universal `margin: 0; padding: 0`, list/heading/input resets, etc.). If your app relied on these defaults, opt in to the supplemental reset:
|
|
191
191
|
|
|
192
192
|
```ts
|
|
193
|
-
import
|
|
193
|
+
import "@effect-app/vue-components/reset.css"
|
|
194
194
|
```
|
|
195
195
|
|
|
196
196
|
### 2. Nested union `_tag` handling
|
|
@@ -208,22 +208,26 @@ import '@effect-app/vue-components/reset.css'
|
|
|
208
208
|
- **v4**: `defaultsValueFromSchema` detects `PropertySignatureTransformation` and extracts defaults, enabling `withDecodingDefault` as a new pattern for declaring field defaults directly on the schema.
|
|
209
209
|
|
|
210
210
|
### On Submit event
|
|
211
|
-
|
|
211
|
+
|
|
212
|
+
The :on-submit event could be tricky in `<OmegaForm />` component.
|
|
212
213
|
This is a prop that is basically a map of Tanstack Form `onSubmit` option and accept a function that return a Promise. If you want to use it as an event, you have to manage the state of loading yourself with `@submit` with a function returning `void`
|
|
213
214
|
|
|
214
215
|
E.g.
|
|
215
216
|
|
|
216
217
|
to use it as a Promise based Tanstack way:
|
|
218
|
+
|
|
217
219
|
```html
|
|
218
|
-
|
|
220
|
+
<OmegaForm :schema="schema" :on-submit="onSubmit" :subscribe="['values']">
|
|
219
221
|
```
|
|
220
222
|
|
|
221
223
|
to use it as an event:
|
|
224
|
+
|
|
222
225
|
```html
|
|
223
226
|
<OmegaForm :schema="schema" @submit="onSubmit" :is-loading="false" :subscribe="['values']">
|
|
224
227
|
```
|
|
225
228
|
|
|
226
229
|
this will give you a type error instead, because `:is-loading` is only accepted in event mode
|
|
230
|
+
|
|
227
231
|
```html
|
|
228
|
-
|
|
232
|
+
<OmegaForm :schema="schema" :on-submit="onSubmit" :is-loading="false" :subscribe="['values']">
|
|
229
233
|
```
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type DeepKeys } from "@tanstack/vue-form";
|
|
2
2
|
import { Order } from "effect-app";
|
|
3
3
|
import { type OmegaAutoGenMeta, type OmegaInputProps } from "./OmegaFormStuff";
|
|
4
|
-
declare const __VLS_export:
|
|
5
|
-
From extends Record<PropertyKey, string>, To extends Record<PropertyKey, string>, Name extends DeepKeys<From>>(__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<{
|
|
4
|
+
declare const __VLS_export: <From extends Record<PropertyKey, string>, To extends Record<PropertyKey, string>, Name extends DeepKeys<From>>(__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<{
|
|
6
5
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
7
6
|
form: OmegaInputProps<From, To, Name>["form"];
|
|
8
7
|
pick?: DeepKeys<From>[];
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);if(e.appendChild(document.createTextNode(`fieldset[data-v-
|
|
2
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);if(e.appendChild(document.createTextNode(`fieldset[data-v-
|
|
1
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);if(e.appendChild(document.createTextNode(`fieldset[data-v-05e510ab]{display:contents}fieldset[disabled][data-v-05e510ab]>*{pointer-events:none}`)),document.head.appendChild(e),window.customElements){let e=window.customElements.define;window.customElements.define=function(t,n){let r=n.prototype.connectedCallback;return n.prototype.connectedCallback=function(){if(r&&r.call(this),this.shadowRoot){let e=document.createElement(`style`);e.appendChild(document.createTextNode(`fieldset[data-v-05e510ab]{display:contents}fieldset[disabled][data-v-05e510ab]>*{pointer-events:none}`)),this.shadowRoot.appendChild(e)}},e.call(window.customElements,t,n)}}}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
2
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);if(e.appendChild(document.createTextNode(`fieldset[data-v-05e510ab]{display:contents}fieldset[disabled][data-v-05e510ab]>*{pointer-events:none}`)),document.head.appendChild(e),window.customElements){let e=window.customElements.define;window.customElements.define=function(t,n){let r=n.prototype.connectedCallback;return n.prototype.connectedCallback=function(){if(r&&r.call(this),this.shadowRoot){let e=document.createElement(`style`);e.appendChild(document.createTextNode(`fieldset[data-v-05e510ab]{display:contents}fieldset[disabled][data-v-05e510ab]>*{pointer-events:none}`)),this.shadowRoot.appendChild(e)}},e.call(window.customElements,t,n)}}}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
3
3
|
import e from "./vue-components44.es.js";
|
|
4
4
|
import t from "./vue-components58.es.js";
|
|
5
5
|
|
|
6
6
|
//#region src/components/OmegaForm/OmegaWrapper.vue
|
|
7
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
7
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-05e510ab"]]);
|
|
8
8
|
//#endregion
|
|
9
9
|
export { n as default };
|
|
@@ -114,7 +114,7 @@ var O = class extends x.TaggedError("FormErrors") {}, k = (e) => function(t) {
|
|
|
114
114
|
...h,
|
|
115
115
|
validators: {
|
|
116
116
|
onSubmit: D,
|
|
117
|
-
...h?.validators
|
|
117
|
+
...h?.validators
|
|
118
118
|
},
|
|
119
119
|
onSubmit: h?.onSubmit ? ({ formApi: e, meta: t, value: n }) => L(t?.currentSpan, async () => {
|
|
120
120
|
let r = await N(A(n)), i = h.onSubmit({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-app/vue-components",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.155",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@mdi/js": "^7.4.47",
|
|
6
6
|
"effect": "^4.0.0-beta.56",
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
"@vitejs/plugin-vue": "^6.0.6",
|
|
20
20
|
"@vue/test-utils": "^2.4.8",
|
|
21
21
|
"@vueuse/core": "^14.2.1",
|
|
22
|
-
"dprint": "^0.54.0",
|
|
23
22
|
"jsdom": "^29.0.2",
|
|
24
23
|
"rimraf": "^6.1.3",
|
|
25
24
|
"sass": "^1.99.0",
|
|
@@ -34,7 +33,7 @@
|
|
|
34
33
|
"vue-toastification": "^2.0.0-rc.5",
|
|
35
34
|
"vue-tsc": "^3.2.7",
|
|
36
35
|
"vuetify": "^4.0.6",
|
|
37
|
-
"@effect-app/eslint-shared-config": "0.6.0-beta.
|
|
36
|
+
"@effect-app/eslint-shared-config": "0.6.0-beta.15"
|
|
38
37
|
},
|
|
39
38
|
"files": [
|
|
40
39
|
"src",
|
|
@@ -58,8 +57,8 @@
|
|
|
58
57
|
"highlight.js": "^11.11.1",
|
|
59
58
|
"mitt": "^3.0.1",
|
|
60
59
|
"vue3-highlightjs": "^1.0.5",
|
|
61
|
-
"@effect-app/vue": "4.0.0-beta.
|
|
62
|
-
"effect-app": "4.0.0-beta.
|
|
60
|
+
"@effect-app/vue": "4.0.0-beta.155",
|
|
61
|
+
"effect-app": "4.0.0-beta.155"
|
|
63
62
|
},
|
|
64
63
|
"scripts": {
|
|
65
64
|
"check": "vue-tsc",
|
|
@@ -68,10 +67,10 @@
|
|
|
68
67
|
"docs:dev": "vitepress dev docs",
|
|
69
68
|
"docs:build": "vitepress build docs",
|
|
70
69
|
"docs:serve": "vitepress serve docs",
|
|
71
|
-
"lint": "NODE_OPTIONS=--max-old-space-size=8192 eslint src stories .storybook",
|
|
70
|
+
"lint": "oxlint src stories && NODE_OPTIONS=--max-old-space-size=8192 eslint src stories .storybook && pnpm exec dprint check --config ../../dprint.jsonc .",
|
|
72
71
|
"ncu": "ncu",
|
|
73
72
|
"clean": "rm -rf dist",
|
|
74
|
-
"lint-fix": "pnpm
|
|
73
|
+
"lint-fix": "oxlint --fix src stories && NODE_OPTIONS=--max-old-space-size=8192 eslint --fix src stories .storybook && pnpm exec dprint fmt --config ../../dprint.jsonc .",
|
|
75
74
|
"storybook": "storybook dev -p 6006",
|
|
76
75
|
"build-storybook": "storybook build",
|
|
77
76
|
"test": "vitest",
|
|
@@ -12,9 +12,7 @@
|
|
|
12
12
|
:is="form.Field"
|
|
13
13
|
v-for="(_, i) of items"
|
|
14
14
|
:key="`${name}[${Number(i)}]`"
|
|
15
|
-
:name="
|
|
16
|
-
`${name}[${Number(i)}]` as DeepKeys<From>
|
|
17
|
-
"
|
|
15
|
+
:name="`${name}[${Number(i)}]` as DeepKeys<From>"
|
|
18
16
|
>
|
|
19
17
|
<template #default="{ field: subField, state: subState }">
|
|
20
18
|
<slot
|
|
@@ -42,7 +40,11 @@
|
|
|
42
40
|
<script
|
|
43
41
|
setup
|
|
44
42
|
lang="ts"
|
|
45
|
-
generic="
|
|
43
|
+
generic="
|
|
44
|
+
From extends Record<PropertyKey, any>,
|
|
45
|
+
To extends Record<PropertyKey, any>,
|
|
46
|
+
Name extends DeepKeys<From>
|
|
47
|
+
"
|
|
46
48
|
>
|
|
47
49
|
import { type DeepKeys } from "@tanstack/vue-form"
|
|
48
50
|
import { computed, onMounted, provide } from "vue"
|
|
@@ -14,10 +14,11 @@
|
|
|
14
14
|
<script
|
|
15
15
|
setup
|
|
16
16
|
lang="ts"
|
|
17
|
-
generic="
|
|
17
|
+
generic="
|
|
18
18
|
From extends Record<PropertyKey, string>,
|
|
19
19
|
To extends Record<PropertyKey, string>,
|
|
20
|
-
Name extends DeepKeys<From>
|
|
20
|
+
Name extends DeepKeys<From>
|
|
21
|
+
"
|
|
21
22
|
>
|
|
22
23
|
import { type DeepKeys } from "@tanstack/vue-form"
|
|
23
24
|
import { Order } from "effect-app"
|
|
@@ -12,7 +12,11 @@
|
|
|
12
12
|
<script
|
|
13
13
|
setup
|
|
14
14
|
lang="ts"
|
|
15
|
-
generic="
|
|
15
|
+
generic="
|
|
16
|
+
From extends Record<PropertyKey, any>,
|
|
17
|
+
To extends Record<PropertyKey, any>,
|
|
18
|
+
Name extends DeepKeys<From>
|
|
19
|
+
"
|
|
16
20
|
>
|
|
17
21
|
import { type DeepKeys } from "@tanstack/vue-form"
|
|
18
22
|
import { inject } from "vue"
|
|
@@ -38,7 +38,11 @@
|
|
|
38
38
|
<script
|
|
39
39
|
setup
|
|
40
40
|
lang="ts"
|
|
41
|
-
generic="
|
|
41
|
+
generic="
|
|
42
|
+
From extends Record<PropertyKey, any>,
|
|
43
|
+
To extends Record<PropertyKey, any>,
|
|
44
|
+
Name extends DeepKeys<From>
|
|
45
|
+
"
|
|
42
46
|
>
|
|
43
47
|
import { type DeepKeys } from "@tanstack/vue-form"
|
|
44
48
|
import { computed, inject, type Ref, useAttrs } from "vue"
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script
|
|
2
2
|
setup
|
|
3
3
|
lang="ts"
|
|
4
|
-
generic="
|
|
4
|
+
generic="
|
|
5
|
+
From extends Record<PropertyKey, any>,
|
|
5
6
|
To extends Record<PropertyKey, any>,
|
|
6
|
-
Name extends DeepKeys<From> | undefined = DeepKeys<From>
|
|
7
|
+
Name extends DeepKeys<From> | undefined = DeepKeys<From>
|
|
8
|
+
"
|
|
7
9
|
>
|
|
8
10
|
import { type DeepKeys } from "@tanstack/vue-form"
|
|
9
11
|
import { computed, provide, ref, watch } from "vue"
|
|
@@ -9,7 +9,11 @@
|
|
|
9
9
|
<script
|
|
10
10
|
setup
|
|
11
11
|
lang="ts"
|
|
12
|
-
generic="
|
|
12
|
+
generic="
|
|
13
|
+
From extends Record<PropertyKey, any>,
|
|
14
|
+
To extends Record<PropertyKey, any>,
|
|
15
|
+
Name extends DeepKeys<From>
|
|
16
|
+
"
|
|
13
17
|
>
|
|
14
18
|
import { type DeepKeys, type DeepValue } from "@tanstack/vue-form"
|
|
15
19
|
import { watch } from "vue"
|
|
@@ -12,10 +12,12 @@
|
|
|
12
12
|
<script
|
|
13
13
|
setup
|
|
14
14
|
lang="ts"
|
|
15
|
-
generic="
|
|
15
|
+
generic="
|
|
16
|
+
From extends Record<PropertyKey, any>,
|
|
16
17
|
To extends Record<PropertyKey, any>,
|
|
17
18
|
K extends keyof OmegaFormState<From, To> = keyof OmegaFormState<From, To>,
|
|
18
|
-
Props = DefaultTypeProps
|
|
19
|
+
Props = DefaultTypeProps
|
|
20
|
+
"
|
|
19
21
|
>
|
|
20
22
|
/**
|
|
21
23
|
* Form component that wraps TanStack Form's useForm hook
|
|
@@ -789,7 +789,7 @@ export const useOmegaForm = <
|
|
|
789
789
|
...tanstackFormOptions,
|
|
790
790
|
validators: {
|
|
791
791
|
onSubmit: standardSchema,
|
|
792
|
-
...
|
|
792
|
+
...tanstackFormOptions?.validators
|
|
793
793
|
},
|
|
794
794
|
onSubmit: tanstackFormOptions?.onSubmit
|
|
795
795
|
? ({ formApi, meta, value }) =>
|
package/src/index.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/src/constants/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|