@zealicsolutions/web-ui 1.1.24 → 1.1.26
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/cjs/containers/Container.d.ts +2 -0
- package/dist/cjs/containers/ReplicatorContainer/ReplicatorContainer.d.ts +1 -2
- package/dist/cjs/containers/ReplicatorContainer/ReplicatorFormSetup.d.ts +3 -3
- package/dist/cjs/containers/hooks/useEmptyStateFiltering.d.ts +1 -1
- package/dist/cjs/containers/hooks/useEmptyStateVisibility.d.ts +6 -2
- package/dist/cjs/containers/types/types.d.ts +5 -0
- package/dist/cjs/contexts/ReplicatorFormContext/types.d.ts +2 -2
- package/dist/cjs/contexts/ReplicatorRegistryContext/types.d.ts +8 -7
- package/dist/cjs/index.js +93 -93
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/containers/Container.d.ts +2 -0
- package/dist/esm/containers/Container.js +11 -11
- package/dist/esm/containers/Container.js.map +1 -1
- package/dist/esm/containers/ReplicatorContainer/ReplicatorContainer.d.ts +1 -2
- package/dist/esm/containers/ReplicatorContainer/ReplicatorContainer.js +1 -1
- package/dist/esm/containers/ReplicatorContainer/ReplicatorContainer.js.map +1 -1
- package/dist/esm/containers/ReplicatorContainer/ReplicatorFormSetup.d.ts +3 -3
- package/dist/esm/containers/ReplicatorContainer/ReplicatorFormSetup.js +1 -1
- package/dist/esm/containers/ReplicatorContainer/ReplicatorFormSetup.js.map +1 -1
- package/dist/esm/containers/hooks/useEmptyStateFiltering.d.ts +1 -1
- package/dist/esm/containers/hooks/useEmptyStateFiltering.js +1 -1
- package/dist/esm/containers/hooks/useEmptyStateFiltering.js.map +1 -1
- package/dist/esm/containers/hooks/useEmptyStateVisibility.d.ts +6 -2
- package/dist/esm/containers/types/types.d.ts +5 -0
- package/dist/esm/containers/utils/dataPathUtils.js +1 -1
- package/dist/esm/containers/utils/dataPathUtils.js.map +1 -1
- package/dist/esm/contexts/ReplicatorFormContext/types.d.ts +2 -2
- package/dist/esm/contexts/ReplicatorRegistryContext/ReplicatorRegistryContextProvider.js +1 -1
- package/dist/esm/contexts/ReplicatorRegistryContext/ReplicatorRegistryContextProvider.js.map +1 -1
- package/dist/esm/contexts/ReplicatorRegistryContext/types.d.ts +8 -7
- package/dist/esm/molecules/BaseMolecule.js +1 -1
- package/dist/esm/molecules/BaseMolecule.js.map +1 -1
- package/dist/esm/molecules/Button/hooks/useButtonAction.js +1 -1
- package/dist/esm/molecules/Button/hooks/useButtonAction.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,7 +5,9 @@ import { StyleVariantConfig } from './ReplicatorContainer/types';
|
|
|
5
5
|
export declare const Container: FC<PropsWithChildren<ContainerProps & {
|
|
6
6
|
id: string;
|
|
7
7
|
nestedPathSegments?: PathSegment[];
|
|
8
|
+
/** @deprecated Use sourceDataPointerId instead */
|
|
8
9
|
targetRwoId?: DmfId;
|
|
10
|
+
/** @deprecated Use sourceDataPointerId instead */
|
|
9
11
|
replicatorFieldId?: DmfId;
|
|
10
12
|
sourceDataPointerId?: string;
|
|
11
13
|
parentStyleVariantConfig?: StyleVariantConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { PathSegment } from '../../contexts/ContainerRuntimeContext/types';
|
|
3
3
|
import { StyleVariantConfig, VariantContainerConfig, VariantContainerProperties } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* Resolve the active variant from scoped data using the variant field configuration.
|
|
@@ -21,7 +21,6 @@ export declare const getVariantContainerStyles: (config: VariantContainerConfig
|
|
|
21
21
|
export type ReplicatorContainerProps = {
|
|
22
22
|
/** The actual container UUID (passed from parent Container) for variant lookup */
|
|
23
23
|
containerId?: string;
|
|
24
|
-
targetRwoId?: DmfId;
|
|
25
24
|
/** Points to specific query result from webpage context */
|
|
26
25
|
sourceDataPointerId?: string;
|
|
27
26
|
nestedPathSegments?: PathSegment[];
|
|
@@ -3,8 +3,8 @@ import { PathSegment } from '../../contexts/ContainerRuntimeContext/types';
|
|
|
3
3
|
/** Default maximum number of replicator instances to prevent performance issues */
|
|
4
4
|
export declare const DEFAULT_MAX_REPLICATOR_INSTANCES = 50;
|
|
5
5
|
export interface ReplicatorFormSetupProps {
|
|
6
|
-
/**
|
|
7
|
-
|
|
6
|
+
/** Source data pointer ID - used as the field array name */
|
|
7
|
+
sourceDataPointerId: string;
|
|
8
8
|
/** Current nested path segments from parent containers */
|
|
9
9
|
nestedPathSegments?: PathSegment[];
|
|
10
10
|
/** Minimum instances allowed (defaults to 1 to ensure at least one instance is shown) */
|
|
@@ -36,7 +36,7 @@ export interface ReplicatorFormSetupProps {
|
|
|
36
36
|
* @usage
|
|
37
37
|
* Wrap a replicator Container in form organisms:
|
|
38
38
|
* ```tsx
|
|
39
|
-
* <ReplicatorFormSetup
|
|
39
|
+
* <ReplicatorFormSetup sourceDataPointerId="query-visits">
|
|
40
40
|
* <Container type="replicator" ... />
|
|
41
41
|
* </ReplicatorFormSetup>
|
|
42
42
|
* ```
|
|
@@ -5,7 +5,7 @@ import { ContainerComponentProps, Molecule } from '../types/types';
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const isEmptyStateContainer: (item: ContainerComponentProps | Molecule) => boolean;
|
|
7
7
|
/**
|
|
8
|
-
* Gets the
|
|
8
|
+
* Gets the field identifier for empty-state checks (sourceDataPointerId preferred).
|
|
9
9
|
*/
|
|
10
10
|
export declare const getReplicatorFieldId: (item: ContainerComponentProps | Molecule) => DmfId | undefined;
|
|
11
11
|
/**
|
|
@@ -5,6 +5,10 @@ export type EmptyStateConfig = {
|
|
|
5
5
|
* If undefined, applies to entire organism data.
|
|
6
6
|
*/
|
|
7
7
|
targetRwoId?: DmfId;
|
|
8
|
+
/**
|
|
9
|
+
* Source data pointer ID to use instead of targetRwoId.
|
|
10
|
+
*/
|
|
11
|
+
sourceDataPointerId?: string;
|
|
8
12
|
/**
|
|
9
13
|
* Current nested path segments from the container context.
|
|
10
14
|
*/
|
|
@@ -17,7 +21,7 @@ export type EmptyStateConfig = {
|
|
|
17
21
|
* - If targetRwoId is NOT set → check if entire organism data is empty
|
|
18
22
|
* - If targetRwoId IS set → check if that specific array field is empty at current path
|
|
19
23
|
*
|
|
20
|
-
* @param config - Configuration with targetRwoId and nestedPathSegments
|
|
24
|
+
* @param config - Configuration with targetRwoId/sourceDataPointerId and nestedPathSegments
|
|
21
25
|
* @returns Object with visibility info and preview state management
|
|
22
26
|
*/
|
|
23
27
|
export declare const useEmptyStateVisibility: (config: EmptyStateConfig) => {
|
|
@@ -34,4 +38,4 @@ export declare const useEmptyStateVisibility: (config: EmptyStateConfig) => {
|
|
|
34
38
|
* Check if a specific array field is empty at the given path.
|
|
35
39
|
* Non-hook version for use outside React components.
|
|
36
40
|
*/
|
|
37
|
-
export declare const isArrayFieldEmpty: (dataRoot: Record<string, unknown>, nestedPathSegments: PathSegment[],
|
|
41
|
+
export declare const isArrayFieldEmpty: (dataRoot: Record<string, unknown>, nestedPathSegments: PathSegment[], fieldId: DmfId) => boolean;
|
|
@@ -81,6 +81,7 @@ export type ContainerPropsType = Partial<{
|
|
|
81
81
|
activeOrganismIds: string[];
|
|
82
82
|
padding: Padding;
|
|
83
83
|
enableBackgroundImage: boolean;
|
|
84
|
+
/** @deprecated Use sourceDataPointerId instead */
|
|
84
85
|
targetRwoId?: DmfId;
|
|
85
86
|
sourceDataPointerId?: string;
|
|
86
87
|
minInstances?: number;
|
|
@@ -110,7 +111,11 @@ export type ContainerComponentProps = {
|
|
|
110
111
|
instance: 'container';
|
|
111
112
|
type: ContainerType;
|
|
112
113
|
/** Replicator field id from backend payloads */
|
|
114
|
+
/** @deprecated Use sourceDataPointerId instead */
|
|
113
115
|
replicatorFieldId?: DmfId;
|
|
116
|
+
/** Source data pointer ID used for replicator data resolution */
|
|
117
|
+
sourceDataPointerId?: string;
|
|
118
|
+
/** @deprecated Use sourceDataPointerId instead */
|
|
114
119
|
targetRwoId?: DmfId;
|
|
115
120
|
items: (ContainerComponentProps | Molecule)[];
|
|
116
121
|
config: Partial<{
|
|
@@ -7,7 +7,7 @@ import { UseFieldArrayReturn } from 'react-hook-form';
|
|
|
7
7
|
* and needs to support add/remove operations on array fields.
|
|
8
8
|
*/
|
|
9
9
|
export interface ReplicatorFormContextValue {
|
|
10
|
-
/**
|
|
10
|
+
/** Source data pointer ID - used as the field array key */
|
|
11
11
|
replicatorFieldId: string;
|
|
12
12
|
/** Full nested path for useFieldArray (e.g., "visits" or "visits.0.medications") */
|
|
13
13
|
fieldArrayName: string;
|
|
@@ -23,7 +23,7 @@ export interface ReplicatorFormContextValue {
|
|
|
23
23
|
maxInstances?: number;
|
|
24
24
|
}
|
|
25
25
|
export interface ReplicatorFormContextProviderProps {
|
|
26
|
-
/**
|
|
26
|
+
/** Source data pointer ID - used as the field array key */
|
|
27
27
|
replicatorFieldId: string;
|
|
28
28
|
/** Full nested path for useFieldArray (e.g., "visits.0.medications") */
|
|
29
29
|
fieldArrayName: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { UseFieldArrayReturn } from 'react-hook-form';
|
|
2
2
|
export interface ReplicatorRegistryEntry {
|
|
3
|
-
|
|
3
|
+
/** Source data pointer ID used to identify this replicator */
|
|
4
|
+
replicatorId: string;
|
|
4
5
|
fieldArrayName: string;
|
|
5
6
|
fieldArrayMethods: UseFieldArrayReturn;
|
|
6
7
|
minInstances: number;
|
|
@@ -9,10 +10,10 @@ export interface ReplicatorRegistryEntry {
|
|
|
9
10
|
export interface ReplicatorRegistryContextValue {
|
|
10
11
|
registry: Map<string, ReplicatorRegistryEntry>;
|
|
11
12
|
register: (entry: ReplicatorRegistryEntry) => void;
|
|
12
|
-
unregister: (
|
|
13
|
-
getReplicator: (
|
|
14
|
-
canAdd: (
|
|
15
|
-
canRemove: (
|
|
16
|
-
append: (
|
|
17
|
-
remove: (
|
|
13
|
+
unregister: (replicatorId: string) => void;
|
|
14
|
+
getReplicator: (replicatorId: string) => ReplicatorRegistryEntry | undefined;
|
|
15
|
+
canAdd: (replicatorId: string) => boolean;
|
|
16
|
+
canRemove: (replicatorId: string) => boolean;
|
|
17
|
+
append: (replicatorId: string, value?: Record<string, unknown>) => void;
|
|
18
|
+
remove: (replicatorId: string, index?: number) => void;
|
|
18
19
|
}
|