@webitel/ui-datalist 1.1.78 → 1.1.80
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 +2 -0
- package/package.json +1 -1
- package/src/modules/card/composables/useCardAnyFieldEditedWatcher.ts +18 -0
- package/src/modules/card/index.ts +1 -0
- package/src/modules/card/stores/createCardStore.ts +4 -3
- package/src/modules/filters/__tests__/createTableFiltersStore.spec.ts +9 -3
- package/src/modules/headers/__tests__/createTableHeadersStore.spec.ts +6 -4
- package/src/modules/persist/usePersistedStorage.ts +4 -1
- package/src/modules/persist/useRoutePersistedStorage.ts +11 -4
- package/src/modules/table/createTableStore.store.ts +11 -1
- package/types/.tsbuildinfo +1 -1
- package/types/modules/card/composables/useCardAnyFieldEditedWatcher.d.ts +18 -0
- package/types/modules/card/index.d.ts +1 -0
- package/types/modules/card/stores/createCardStore.d.ts +2 -1
- package/types/modules/persist/useRoutePersistedStorage.d.ts +3 -1
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
import { type Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Dirty flag for a local draft `ref`.
|
|
4
|
+
*
|
|
5
|
+
* Replacing `value` with a new object resets dirty. Mutating fields
|
|
6
|
+
* in place sets `isAnyFieldEdited` to `true`.
|
|
7
|
+
*
|
|
8
|
+
* Used by `useCardComponent`. Also usable on nested popups that keep
|
|
9
|
+
* a local draft instead of a card store.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const draft = ref({ name: '' });
|
|
14
|
+
* const { isAnyFieldEdited } = useCardAnyFieldEditedWatcher({ value: draft });
|
|
15
|
+
*
|
|
16
|
+
* draft.value = { name: 'Holiday' }; // reset
|
|
17
|
+
* draft.value.name = 'NY'; // dirty
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
2
20
|
export declare const useCardAnyFieldEditedWatcher: ({ value, }: {
|
|
3
21
|
value: Ref<object>;
|
|
4
22
|
}) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type RegleSchemaBehaviourOptions } from '@regle/schemas';
|
|
2
2
|
import type { ApiModule } from '@webitel/ui-sdk/src/api/types/ApiModule';
|
|
3
|
+
import type { MaybeRef } from 'vue';
|
|
3
4
|
import type { z } from 'zod/v4';
|
|
4
5
|
import type { CardItemId } from '../types/CardStore.types';
|
|
5
6
|
export declare const createCardStore: <Entity extends {
|
|
@@ -8,7 +9,7 @@ export declare const createCardStore: <Entity extends {
|
|
|
8
9
|
id?: string | number;
|
|
9
10
|
}>({ namespace, apiModule, standardValidationSchema, validationSchemaOptions, }: {
|
|
10
11
|
namespace: string;
|
|
11
|
-
standardValidationSchema: z.ZodType
|
|
12
|
+
standardValidationSchema: MaybeRef<z.ZodType>;
|
|
12
13
|
/**
|
|
13
14
|
* Every method on {@link ApiModule} is optional, but a card store reads and
|
|
14
15
|
* writes one item, so these three are required here.
|