@zealicsolutions/web-ui 1.0.140-beta.92 → 1.0.140-beta.94

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.
@@ -5,31 +5,16 @@ import { ContainerComponentProps, Molecule } from '../types/types';
5
5
  */
6
6
  export declare const isEmptyStateContainer: (item: ContainerComponentProps | Molecule) => boolean;
7
7
  /**
8
- * Checks if an item is a replicator container.
9
- */
10
- export declare const isReplicatorContainer: (item: ContainerComponentProps | Molecule) => boolean;
11
- /**
12
- * Gets the replicatorFieldId from a container.
8
+ * Gets the replicatorFieldId from a container (works for any container type).
13
9
  */
14
10
  export declare const getReplicatorFieldId: (item: ContainerComponentProps | Molecule) => DmfId | undefined;
15
11
  /**
16
- * Finds the replicatorFieldId from sibling containers.
17
- * If the empty_state has a sibling replicator, that's its context.
18
- */
19
- export declare const findSiblingReplicatorFieldId: (siblings: (ContainerComponentProps | Molecule)[]) => DmfId | undefined;
20
- /**
21
- * Gets the replicatorFieldId context for an empty_state container.
22
- * First checks the container itself, then looks at siblings.
23
- * @deprecated Use findSiblingReplicatorFieldId instead for sibling lookup
24
- */
25
- export declare const getEmptyStateReplicatorFieldId: (item: ContainerComponentProps | Molecule) => DmfId | undefined;
26
- /**
27
- * Checks if a specific array field is empty at the given scope.
28
- * Handles cases where:
29
- * 1. scope[replicatorFieldId] is the array
30
- * 2. scope itself IS the array (when pmiObjectId === replicatorFieldId)
12
+ * Checks if a specific field is empty at the given data scope.
13
+ * Handles:
14
+ * 1. scope[fieldId] - nested field lookup
15
+ * 2. scope itself IS the array (when at root and pmiObjectId === replicatorFieldId)
31
16
  */
32
- export declare const isArrayFieldEmptyAtScope: (scope: Record<string, unknown> | unknown[] | undefined, replicatorFieldId: DmfId) => boolean;
17
+ export declare const isFieldEmptyAtScope: (scope: Record<string, unknown> | unknown[] | undefined, fieldId: DmfId) => boolean;
33
18
  export type UseEmptyStateFilteringParams = {
34
19
  /**
35
20
  * All container items (before visibility filtering)
@@ -54,25 +39,24 @@ export type EmptyStateFilterResult = {
54
39
  */
55
40
  showingEmptyStateForFields: Set<string>;
56
41
  /**
57
- * Whether organism-level empty state is showing
42
+ * Whether organism-level empty state is showing (no replicatorFieldId)
58
43
  */
59
44
  showOrganismLevelEmptyState: boolean;
60
45
  };
61
46
  /**
62
47
  * Hook that filters container items based on empty state logic.
63
48
  *
64
- * **Design Mode (isConfigurationMode=true):**
65
- * - All containers including empty_state are visible for editing
66
- * - Preview mode via popover can simulate empty data state
49
+ * ## Core Rule
50
+ * Empty state container ONLY affects its siblings (same level in children array).
51
+ * When an empty_state is visible, ALL its siblings are hidden.
67
52
  *
68
- * **Runtime Mode (isConfigurationMode=false):**
69
- * - empty_state containers shown based on actual data emptiness
70
- * - With replicatorFieldId: shows when that array is empty
71
- * - Without replicatorFieldId: shows when organism data is empty
53
+ * ## Visibility Logic
54
+ * - **With replicatorFieldId**: Shows when that field is empty at current data scope
55
+ * - **Without replicatorFieldId**: Shows when organism-level data is empty (isEmptyDataState)
72
56
  *
73
- * When an empty_state is shown (runtime or preview):
74
- * - If it has replicatorFieldId: hides sibling replicator with same fieldId
75
- * - If no replicatorFieldId: hides all containers after it
57
+ * ## Design Mode
58
+ * - All containers visible for editing (no filtering)
59
+ * - Preview mode can simulate empty state via forceEmptyStatePreview
76
60
  *
77
61
  * @param params - Parameters for filtering
78
62
  * @returns Filtered items and empty state visibility info
@@ -61,6 +61,12 @@ export type OrganismContextType = {
61
61
  loadRecordData?: (args: {
62
62
  rwoRecordId: string;
63
63
  }) => Promise<Record<string, unknown>>;
64
+ /**
65
+ * Indicates whether the organism data is currently loading.
66
+ * When true, empty_state containers are hidden (show loading instead).
67
+ * Empty state should only show when: !isLoading && isEmptyDataState
68
+ */
69
+ isLoadingData?: boolean;
64
70
  /**
65
71
  * Indicates whether the organism has empty data from the backend.
66
72
  * Used by containers to determine if empty_state container should be shown.
@@ -55,6 +55,8 @@ export type OrganismContextProviderProps = React.PropsWithChildren<{} & Partial<
55
55
  loadRecordData: (args: {
56
56
  rwoRecordId: string;
57
57
  }) => Promise<Record<string, unknown>>;
58
+ /** Indicates organism data is currently loading */
59
+ isLoadingData: boolean;
58
60
  /** Indicates organism has empty data from backend */
59
61
  isEmptyDataState: boolean;
60
62
  /** Forces empty state preview for designer mode */
@@ -64,4 +66,4 @@ export type OrganismContextProviderProps = React.PropsWithChildren<{} & Partial<
64
66
  /** Callback to toggle empty state preview */
65
67
  toggleEmptyStatePreview: (replicatorFieldId: string) => void;
66
68
  }>>;
67
- export declare const OrganismContextProvider: ({ initItems, children, submitHandler, formId, validations, editable, isPreview, organismBodyId, isFormInEditMode, organismMetadata, organismInfo, localStateObject, isConfigurationMode, onConfigurationItemHandler, selectedConfigurationItemId, currentStyleProperties, currentContentProperties, onInternalNavigation, routing, prefillData, loadRecordData, isEmptyDataState: isEmptyDataStateProp, forceEmptyStatePreview, previewingEmptyStates, toggleEmptyStatePreview, }: OrganismContextProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
69
+ export declare const OrganismContextProvider: ({ initItems, children, submitHandler, formId, validations, editable, isPreview, organismBodyId, isFormInEditMode, organismMetadata, organismInfo, localStateObject, isConfigurationMode, onConfigurationItemHandler, selectedConfigurationItemId, currentStyleProperties, currentContentProperties, onInternalNavigation, routing, prefillData, loadRecordData, isLoadingData, isEmptyDataState: isEmptyDataStateProp, forceEmptyStatePreview, previewingEmptyStates, toggleEmptyStatePreview, }: OrganismContextProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;