@gaddario98/react-core 2.0.7 → 2.0.8

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.
@@ -1082,24 +1082,24 @@ type MutationCompositeKey$1<Q extends QueriesArray> = {
1082
1082
  }[MutationTopKey$1<Q>];
1083
1083
  type MutationValue$1<Q extends QueriesArray, K extends MutationCompositeKey$1<Q>> = K extends `${infer Top}.${infer Sub}` ? Top extends MutationTopKey$1<Q> ? Sub extends MutationSubKey$1<Q, Top> ? AllMutation<Q>[Top][Sub] : never : never : K extends MutationTopKey$1<Q> ? AllMutation<Q>[K] : never;
1084
1084
  type GetFunction$1<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = {
1085
- <K extends QueryTopKey$1<Q>>(type: 'query', key: K): MultipleQueryResponse<Q>[K];
1086
- <K extends QueryCompositeKey$1<Q>>(type: 'query', key: K): QueryValue$1<Q, K>;
1087
- <K extends QueryCompositeKey$1<Q>>(type: 'query', key: K, defaultValue: unknown): NonNullable<QueryValue$1<Q, K>>;
1088
- <K extends QueryTopKey$1<Q>>(type: 'query', key: K, defaultValue: MultipleQueryResponse<Q>[K]['data']): MultipleQueryResponse<Q>[K]['data'];
1089
- <K extends QueryCompositeKey$1<Q>>(type: 'query', key: K, defaultValue: QueryValue$1<Q, K>): NonNullable<QueryValue$1<Q, K>>;
1090
- <K extends MutationTopKey$1<Q>>(type: 'mutation', key: K): AllMutation<Q>[K];
1091
- <K extends MutationCompositeKey$1<Q>>(type: 'mutation', key: K): MutationValue$1<Q, K>;
1092
- <K extends MutationCompositeKey$1<Q>>(type: 'mutation', key: K, defaultValue: unknown): NonNullable<MutationValue$1<Q, K>>;
1093
- <K extends MutationTopKey$1<Q>>(type: 'mutation', key: K, defaultValue: AllMutation<Q>[K]['data']): AllMutation<Q>[K]['data'];
1094
- <K extends MutationCompositeKey$1<Q>>(type: 'mutation', key: K, defaultValue: MutationValue$1<Q, K>): NonNullable<MutationValue$1<Q, K>>;
1095
- <K extends VariableTopKey$1<V>>(type: 'state', key: K): VariableValue$1<V, K>;
1096
- <K extends VariableTopKey$1<V>>(type: 'state', key: K, defaultValue: VariableValue$1<V, K>): NonNullable<VariableValue$1<V, K>>;
1097
- <TField extends DeepKeys<F>>(type: 'form', key: TField): DeepValue<F, TField> | undefined;
1098
- <TField extends DeepKeys<F>>(type: 'form', key: TField, defaultValue: DeepValue<F, TField>): NonNullable<DeepValue<F, TField>>;
1085
+ <K extends QueryTopKey$1<Q>>(type: "query", key: K): MultipleQueryResponse<Q>[K];
1086
+ <K extends QueryCompositeKey$1<Q>>(type: "query", key: K): QueryValue$1<Q, K>;
1087
+ <K extends QueryCompositeKey$1<Q>>(type: "query", key: K, defaultValue: unknown): NonNullable<QueryValue$1<Q, K>>;
1088
+ <K extends QueryTopKey$1<Q>>(type: "query", key: K, defaultValue: MultipleQueryResponse<Q>[K]["data"]): MultipleQueryResponse<Q>[K]["data"];
1089
+ <K extends QueryCompositeKey$1<Q>>(type: "query", key: K, defaultValue: QueryValue$1<Q, K>): NonNullable<QueryValue$1<Q, K>>;
1090
+ <K extends MutationTopKey$1<Q>>(type: "mutation", key: K): AllMutation<Q>[K];
1091
+ <K extends MutationCompositeKey$1<Q>>(type: "mutation", key: K): MutationValue$1<Q, K>;
1092
+ <K extends MutationCompositeKey$1<Q>>(type: "mutation", key: K, defaultValue: unknown): NonNullable<MutationValue$1<Q, K>>;
1093
+ <K extends MutationTopKey$1<Q>>(type: "mutation", key: K, defaultValue: AllMutation<Q>[K]["data"]): AllMutation<Q>[K]["data"];
1094
+ <K extends MutationCompositeKey$1<Q>>(type: "mutation", key: K, defaultValue: MutationValue$1<Q, K>): NonNullable<MutationValue$1<Q, K>>;
1095
+ <K extends VariableTopKey$1<V>>(type: "state", key: K): VariableValue$1<V, K>;
1096
+ <K extends VariableTopKey$1<V>>(type: "state", key: K, defaultValue: VariableValue$1<V, K>): NonNullable<VariableValue$1<V, K>>;
1097
+ <TField extends DeepKeys<F>>(type: "form", key: TField): DeepValue<F, TField> | undefined;
1098
+ <TField extends DeepKeys<F>>(type: "form", key: TField, defaultValue: DeepValue<F, TField>): NonNullable<DeepValue<F, TField>>;
1099
1099
  };
1100
1100
  type SetFunction$1<F extends FieldValues, V extends Record<string, unknown> = Record<string, unknown>> = {
1101
- (type: 'form'): SetValueFunction<F>;
1102
- (type: 'state'): <K extends VariableTopKey$1<V>>(key: K, value: VariableValue$1<V, K>) => void;
1101
+ (type: "form"): SetValueFunction<F>;
1102
+ (type: "state"): <K extends VariableTopKey$1<V>>(key: K, value: VariableValue$1<V, K>) => void;
1103
1103
  };
1104
1104
  type FunctionProps$1<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = {
1105
1105
  /**
@@ -1125,7 +1125,7 @@ type LifecycleContext$1<F extends FieldValues = FieldValues, Q extends QueriesAr
1125
1125
  pageConfig?: PageProps$1<F, Q, V>;
1126
1126
  };
1127
1127
  type Items$1<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = {
1128
- type: 'custom';
1128
+ type: "custom";
1129
1129
  component: React.JSX.Element | ((props: FunctionProps$1<F, Q, V>) => React.JSX.Element);
1130
1130
  index?: number;
1131
1131
  usedBoxes?: number;
@@ -1136,12 +1136,12 @@ type Items$1<F extends FieldValues, Q extends QueriesArray, V extends Record<str
1136
1136
  isInDraggableView?: boolean;
1137
1137
  key?: string;
1138
1138
  lazy?: boolean;
1139
- lazyTrigger?: 'viewport' | 'interaction' | 'conditional';
1139
+ lazyTrigger?: "viewport" | "interaction" | "conditional";
1140
1140
  lazyCondition?: MappedItemsFunction$1<F, Q, boolean, V>;
1141
1141
  };
1142
1142
  type ContainerItem$1<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = {
1143
- type: 'container';
1144
- component?: PageConfigProps$1['ItemsContainer'];
1143
+ type: "container";
1144
+ component?: PageConfigProps$1["ItemsContainer"];
1145
1145
  items: ContentItemsType$1<F, Q, V>;
1146
1146
  index?: number;
1147
1147
  usedBoxes?: number;
@@ -1152,28 +1152,28 @@ type ContainerItem$1<F extends FieldValues, Q extends QueriesArray, V extends Re
1152
1152
  isInDraggableView?: boolean;
1153
1153
  key?: string;
1154
1154
  lazy?: boolean;
1155
- lazyTrigger?: 'viewport' | 'interaction' | 'conditional';
1155
+ lazyTrigger?: "viewport" | "interaction" | "conditional";
1156
1156
  lazyCondition?: MappedItemsFunction$1<F, Q, boolean, V>;
1157
1157
  };
1158
1158
  type ContentItem$1<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = Items$1<F, Q, V> | ContainerItem$1<F, Q, V>;
1159
1159
  type MappedContents$1<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = MappedItemsFunction$1<F, Q, Array<ContentItem$1<F, Q, V>>, V>;
1160
1160
  type ContentItemsType$1<F extends FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = Array<ContentItem$1<F, Q, V>> | MappedContents$1<F, Q, V>;
1161
- type FormPageProps$1<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = Omit<ComponentProps<typeof FormManager<F>>, 'updateFormValues' | 'submit' | 'data'> & {
1161
+ type FormPageProps$1<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = Omit<ComponentProps<typeof FormManager<F>>, "updateFormValues" | "submit" | "data"> & {
1162
1162
  defaultValueQueryKey?: Array<string>;
1163
- defaultValueQueryMap?: (props: ExtractQuery<Q>['response']) => DeepValue<F, DeepKeys<F>>;
1163
+ defaultValueQueryMap?: (props: ExtractQuery<Q>["response"]) => F;
1164
1164
  submit?: Array<Submit<F>> | MappedItemsFunction$1<F, Q, Array<Submit<F>>, V>;
1165
1165
  index?: number;
1166
1166
  data?: Array<FormManagerConfig<F> | MappedItemsFunction$1<F, Q, FormManagerConfig<F>, V>>;
1167
1167
  debounceDelay?: number;
1168
1168
  hidden?: boolean | MappedItemsFunction$1<F, Q, boolean, V>;
1169
1169
  };
1170
- type SingleQueryConfig$1<F extends FieldValues, Q extends QueryDefinition<any, any, any, any, any>, V extends Record<string, unknown> = Record<string, unknown>> = Q extends QueryDefinition<infer K, infer T, infer P, infer R, infer C> ? T extends 'mutation' ? {
1171
- type: 'mutation';
1170
+ type SingleQueryConfig$1<F extends FieldValues, Q extends QueryDefinition<any, any, any, any, any>, V extends Record<string, unknown> = Record<string, unknown>> = Q extends QueryDefinition<infer K, infer T, infer P, infer R, infer C> ? T extends "mutation" ? {
1171
+ type: "mutation";
1172
1172
  mutationConfig: (<Qa extends QueriesArray>(props: FunctionProps$1<F, Qa, V>) => MutationConfig<P, R, C>) | MutationConfig<P, R, C>;
1173
1173
  key: K;
1174
1174
  } : {
1175
- type: 'query';
1176
- queryConfig?: (<Qa extends QueriesArray>(props: FunctionProps$1<F, Qa, V>) => Omit<QueryProps<K, R>, 'keyToMap'>) | Omit<QueryProps<K, R>, 'keyToMap'>;
1175
+ type: "query";
1176
+ queryConfig?: (<Qa extends QueriesArray>(props: FunctionProps$1<F, Qa, V>) => Omit<QueryProps<K, R>, "keyToMap">) | Omit<QueryProps<K, R>, "keyToMap">;
1177
1177
  key: K;
1178
1178
  } : never;
1179
1179
  type QueryPageConfigArray$1<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = {
@@ -1226,9 +1226,9 @@ type ViewSettings$1 = {
1226
1226
  } & Record<string, unknown>>;
1227
1227
  pageContainerProps?: Record<string, unknown>;
1228
1228
  /** @deprecated Use layoutComponent instead */
1229
- customLayoutComponent?: PageConfigProps$1['BodyContainer'];
1229
+ customLayoutComponent?: PageConfigProps$1["BodyContainer"];
1230
1230
  /** @deprecated Use pageContainerComponent instead */
1231
- customPageContainer?: PageConfigProps$1['PageContainer'];
1231
+ customPageContainer?: PageConfigProps$1["PageContainer"];
1232
1232
  };
1233
1233
 
1234
1234
  declare const usePageConfig: <F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>>({ queries, form, ns, viewSettings, meta, lazyLoading, variables, pageId, }: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gaddario98/react-core",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -32,7 +32,7 @@
32
32
  "dependencies": {
33
33
  "@gaddario98/react-form": "^2.0.3",
34
34
  "@gaddario98/react-localization": "^2.0.1",
35
- "@gaddario98/react-pages": "^3.0.1",
35
+ "@gaddario98/react-pages": "^3.0.2",
36
36
  "@gaddario98/react-queries": "^2.0.1",
37
37
  "@gaddario98/react-state": "^2.0.1"
38
38
  },