@quickflo/quickforms-vue 1.16.32 → 1.18.0
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/components/DynamicForm.vue.d.ts.map +1 -1
- package/dist/composables/useWatchFormValue.d.ts +68 -0
- package/dist/composables/useWatchFormValue.d.ts.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3440 -3345
- package/dist/types/index.d.ts +36 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicForm.vue.d.ts","sourceRoot":"","sources":["../../src/components/DynamicForm.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DynamicForm.vue.d.ts","sourceRoot":"","sources":["../../src/components/DynamicForm.vue"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA4XrD,iBAAS,cAAc;qBA4HO,GAAG;EAGhC;AAmBD,QAAA,MAAM,eAAe;gBAxJT,OAAO,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;;;kBAqK8I,IAAI;;;;;;;;;;;;;;eApgBpL,OAAO;gBAAU,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;;;gBA+V5D,OAAO,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;;;kBAqK8I,IAAI;;;;;;;;;;;;;;eApgBpL,OAAO;gBAAU,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;;;aAd5D,WAAW,CAAC,GAAG,CAAC;wBACL,OAAO;4EA8gB5B,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAUxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { ComputedRef, WatchStopHandle } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Watch a specific form field value reactively.
|
|
5
|
+
*
|
|
6
|
+
* This composable provides a convenient way to watch changes to a specific
|
|
7
|
+
* field in the form. It automatically handles cleanup when the component unmounts.
|
|
8
|
+
*
|
|
9
|
+
* @param path - Dot notation path to the field (e.g., 'provider.provider', 'settings.enabled')
|
|
10
|
+
* @param callback - Function called when the field value changes
|
|
11
|
+
* @param options - Watch options (immediate, deep)
|
|
12
|
+
* @returns Object containing the reactive value ref and a manual stop function
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* // In a custom field component
|
|
17
|
+
* const { value: providerValue, stop } = useWatchFormValue(
|
|
18
|
+
* 'provider.provider',
|
|
19
|
+
* (newValue, oldValue) => {
|
|
20
|
+
* console.log('Provider changed from', oldValue, 'to', newValue);
|
|
21
|
+
* // Refresh options, update UI, etc.
|
|
22
|
+
* },
|
|
23
|
+
* { immediate: true }
|
|
24
|
+
* );
|
|
25
|
+
*
|
|
26
|
+
* // Use the reactive value in computed properties
|
|
27
|
+
* const isOpenAI = computed(() => providerValue.value === 'openai');
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function useWatchFormValue<T = unknown>(path: string, callback?: (newValue: T | undefined, oldValue: T | undefined) => void, options?: {
|
|
31
|
+
immediate?: boolean;
|
|
32
|
+
deep?: boolean;
|
|
33
|
+
}): {
|
|
34
|
+
value: ComputedRef<T | undefined>;
|
|
35
|
+
stop: WatchStopHandle;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Watch multiple form field values reactively.
|
|
39
|
+
*
|
|
40
|
+
* This composable allows watching multiple fields at once, which is useful
|
|
41
|
+
* when you need to react to changes in several related fields.
|
|
42
|
+
*
|
|
43
|
+
* @param paths - Array of dot notation paths to watch
|
|
44
|
+
* @param callback - Function called when any of the field values change
|
|
45
|
+
* @param options - Watch options (immediate, deep)
|
|
46
|
+
* @returns Object containing the reactive values and a manual stop function
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const { values, stop } = useWatchFormValues(
|
|
51
|
+
* ['provider.provider', 'provider.connection'],
|
|
52
|
+
* (newValues) => {
|
|
53
|
+
* const [provider, connection] = newValues;
|
|
54
|
+
* console.log('Provider config changed:', provider, connection);
|
|
55
|
+
* // Refresh dependent options
|
|
56
|
+
* },
|
|
57
|
+
* { immediate: true }
|
|
58
|
+
* );
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare function useWatchFormValues<T extends unknown[] = unknown[]>(paths: string[], callback?: (newValues: T, oldValues: T) => void, options?: {
|
|
62
|
+
immediate?: boolean;
|
|
63
|
+
deep?: boolean;
|
|
64
|
+
}): {
|
|
65
|
+
values: ComputedRef<T[number] | undefined>[];
|
|
66
|
+
stop: WatchStopHandle;
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=useWatchFormValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWatchFormValue.d.ts","sourceRoot":"","sources":["../../src/composables/useWatchFormValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,KAAK,CAAC;AAGrF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,GAAG,OAAO,EAC3C,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,SAAS,EAAE,QAAQ,EAAE,CAAC,GAAG,SAAS,KAAK,IAAI,EACrE,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GACpD;IACD,KAAK,EAAE,WAAW,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAClC,IAAI,EAAE,eAAe,CAAC;CACvB,CA0CA;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,OAAO,EAAE,GAAG,OAAO,EAAE,EAChE,KAAK,EAAE,MAAM,EAAE,EACf,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,KAAK,IAAI,EAC/C,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GACpD;IACD,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC;IAC7C,IAAI,EAAE,eAAe,CAAC;CACvB,CA4CA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,8 +16,9 @@ export { default as AllOfField } from './components/AllOfField.vue';
|
|
|
16
16
|
export { default as HiddenField } from './components/HiddenField.vue';
|
|
17
17
|
export { useFormField } from './composables/useFormField.js';
|
|
18
18
|
export { useFormContext, provideFormContext } from './composables/useFormContext.js';
|
|
19
|
+
export { useWatchFormValue, useWatchFormValues } from './composables/useWatchFormValue.js';
|
|
19
20
|
export * from './composables/utils.js';
|
|
20
|
-
export type { VueFieldComponent, FieldProps, FormOptions, FormContext } from './types/index.js';
|
|
21
|
+
export type { VueFieldComponent, FieldProps, FormOptions, FormContext, FormValuesWatchCallback, } from './types/index.js';
|
|
21
22
|
export type { JSONSchema, UISchemaElement, TesterFunction } from '@quickflo/quickforms';
|
|
22
23
|
export { ComponentRegistry, SchemaUtils, rankWith, and, or, not, hasFormat, hasExtension, hasXRender, isStringType, isNumberType, isIntegerType, isBooleanType, isEnumType, isObjectType, isArrayType, isRecordType, isJsonType, isNullType, isEmailFormat, isDateFormat, isTimeFormat, isDateTimeFormat, isUrlFormat, hasOneOf, hasAnyOf, hasAllOf, hasConst, isDiscriminatedUnion, hasConditional } from '@quickflo/quickforms';
|
|
23
24
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,wBAAwB,CAAC;AAGhC,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAGtD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,6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