eze-factory 1.0.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.
Files changed (99) hide show
  1. package/README.md +59 -0
  2. package/dist/Bees/ArrayBee.d.ts +2 -0
  3. package/dist/Bees/Bee.d.ts +3 -0
  4. package/dist/Bees/Bees.d.ts +3 -0
  5. package/dist/Bees/FormBee.d.ts +3 -0
  6. package/dist/Bees/FormBees.d.ts +3 -0
  7. package/dist/Bees/ObserverBee.d.ts +3 -0
  8. package/dist/Bees/ObserverBees.d.ts +3 -0
  9. package/dist/Bees/ObserverFormBee.d.ts +3 -0
  10. package/dist/Bees/ProxyBee.d.ts +13 -0
  11. package/dist/Bees/Types.d.ts +74 -0
  12. package/dist/Bees/index.d.ts +10 -0
  13. package/dist/Factory/factory.d.ts +9 -0
  14. package/dist/Factory/index.d.ts +2 -0
  15. package/dist/Factory/types.d.ts +2 -0
  16. package/dist/Hives/AsyncHive.d.ts +2 -0
  17. package/dist/Hives/FormHive.d.ts +16 -0
  18. package/dist/Hives/Hive.d.ts +2 -0
  19. package/dist/Hives/HiveArray.d.ts +2 -0
  20. package/dist/Hives/HiveBase.d.ts +2 -0
  21. package/dist/Hives/HiveObserver.d.ts +3 -0
  22. package/dist/Hives/HiveUtils.d.ts +3 -0
  23. package/dist/Hives/ProxyHive.d.ts +2 -0
  24. package/dist/Hives/Types.d.ts +98 -0
  25. package/dist/Hives/index.d.ts +6 -0
  26. package/dist/Hooks/index.d.ts +4 -0
  27. package/dist/Hooks/useFormHive.d.ts +5 -0
  28. package/dist/Hooks/useFormHoney.d.ts +5 -0
  29. package/dist/Hooks/useHive.d.ts +2 -0
  30. package/dist/Hooks/useHoney.d.ts +2 -0
  31. package/dist/System/Constants/Kit/Error.d.ts +3 -0
  32. package/dist/System/Constants/Kit/IosLoader.d.ts +3 -0
  33. package/dist/System/Constants/Kit/ItemsLoading.d.ts +3 -0
  34. package/dist/System/Constants/Kit/Loader.d.ts +6 -0
  35. package/dist/System/Constants/Kit/LoaderTwo.d.ts +7 -0
  36. package/dist/System/Constants/Kit/Loading.d.ts +3 -0
  37. package/dist/System/Constants/Kit/NoContent.d.ts +6 -0
  38. package/dist/System/Constants/Kit/Progressing.d.ts +7 -0
  39. package/dist/System/Constants/Kit/Searching.d.ts +3 -0
  40. package/dist/System/Constants/Kit/StateKit.d.ts +21 -0
  41. package/dist/System/Constants/Kit/index.d.ts +4 -0
  42. package/dist/System/Constants/QueryDefaults.d.ts +17 -0
  43. package/dist/System/Constants/StatusDefaults.d.ts +8 -0
  44. package/dist/System/Factories/DetailFactory.d.ts +25 -0
  45. package/dist/System/Factories/FactoryPackage.d.ts +6 -0
  46. package/dist/System/Factories/ListFactory.d.ts +34 -0
  47. package/dist/System/Factories/StaticTableFactory.d.ts +33 -0
  48. package/dist/System/Factories/TableFactory.d.ts +40 -0
  49. package/dist/System/Factories/Types.d.ts +25 -0
  50. package/dist/System/Factories/index.d.ts +4 -0
  51. package/dist/System/Slices/Exporter/ExporterMechanics.d.ts +17 -0
  52. package/dist/System/Slices/Exporter/ExporterSlice.d.ts +4 -0
  53. package/dist/System/Slices/Exporter/Types.d.ts +35 -0
  54. package/dist/System/Slices/Loader/LoaderMechanics.d.ts +5 -0
  55. package/dist/System/Slices/Loader/LoaderSlice.d.ts +15 -0
  56. package/dist/System/Slices/Loader/Types.d.ts +25 -0
  57. package/dist/System/Slices/Paginator/PaginatorMechanics.d.ts +17 -0
  58. package/dist/System/Slices/Paginator/PaginatorSlice.d.ts +22 -0
  59. package/dist/System/Slices/Paginator/Types.d.ts +30 -0
  60. package/dist/System/Slices/Query/Components/Filters.d.ts +8 -0
  61. package/dist/System/Slices/Query/Components/QueryContainer.d.ts +9 -0
  62. package/dist/System/Slices/Query/Components/QueryElements.d.ts +18 -0
  63. package/dist/System/Slices/Query/Components/Sorts.d.ts +0 -0
  64. package/dist/System/Slices/Query/QueryMechanics.d.ts +13 -0
  65. package/dist/System/Slices/Query/QuerySlice.d.ts +4 -0
  66. package/dist/System/Slices/Query/Types.d.ts +46 -0
  67. package/dist/System/Slices/Status/Components/StatusIndicator.d.ts +91 -0
  68. package/dist/System/Slices/Status/Components/StatutsComopnent.d.ts +12 -0
  69. package/dist/System/Slices/Status/StatusSlice.d.ts +22 -0
  70. package/dist/System/Slices/Status/Types.d.ts +76 -0
  71. package/dist/System/Slices/Table/Components.d.ts +2 -0
  72. package/dist/System/Slices/Table/TableMechanics.d.ts +20 -0
  73. package/dist/System/Slices/Table/TableSlice.d.ts +4 -0
  74. package/dist/System/Slices/Table/Types.d.ts +71 -0
  75. package/dist/System/Slices/Types.d.ts +39 -0
  76. package/dist/System/StatusKit.d.ts +76 -0
  77. package/dist/Types.d.ts +15 -0
  78. package/dist/Ui/Containers/ControllerContainers.d.ts +17 -0
  79. package/dist/Ui/Containers/index.d.ts +1 -0
  80. package/dist/Ui/StatusKit/StateBuilder.d.ts +8 -0
  81. package/dist/Ui/StatusKit/StatusBee.d.ts +15 -0
  82. package/dist/Ui/StatusKit/StatusKit.d.ts +16 -0
  83. package/dist/Ui/StatusKit/empty.d.ts +6 -0
  84. package/dist/Ui/StatusKit/error.d.ts +7 -0
  85. package/dist/Ui/StatusKit/index.d.ts +4 -0
  86. package/dist/Ui/StatusKit/loading.d.ts +6 -0
  87. package/dist/Ui/StatusKit/loadingMore.d.ts +6 -0
  88. package/dist/Ui/StatusKit/processing.d.ts +6 -0
  89. package/dist/Ui/Wrappers/Wrapper.d.ts +17 -0
  90. package/dist/Ui/Wrappers/index.d.ts +2 -0
  91. package/dist/Ui/Wrappers/types.d.ts +38 -0
  92. package/dist/Ui/index.d.ts +2 -0
  93. package/dist/Utils/Storable.d.ts +20 -0
  94. package/dist/Utils/Utils.d.ts +3 -0
  95. package/dist/Utils/index.d.ts +5 -0
  96. package/dist/index.d.ts +8 -0
  97. package/dist/index.js +2 -0
  98. package/dist/index.js.map +1 -0
  99. package/package.json +67 -0
package/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # Eze-Factory
2
+
3
+ **A revolutionary architecture for building React applications through composable state and modular logic.**
4
+
5
+ ## Documentation
6
+
7
+ 📖 **[Complete Documentation](./Eze-Factory-Docs.md)** — Everything about Eze-Factory's philosophy, patterns, and usage.
8
+
9
+ ## Quick Start
10
+
11
+ ```bash
12
+ npm install eze-factory
13
+ ```
14
+
15
+ ### Basic State (Hive)
16
+
17
+ ```typescript
18
+ import { createHive } from "eze-factory";
19
+
20
+ const counter = createHive(0);
21
+ counter.setHoney(1);
22
+ counter.subscribe((value) => console.log(value));
23
+ ```
24
+
25
+ ### React Connection (Bee)
26
+
27
+ ```tsx
28
+ import { Bee } from "eze-factory";
29
+
30
+ <Bee hive={counter} Component={({ honey, setHoney }) => <button onClick={() => setHoney(honey + 1)}>Count: {honey}</button>} />;
31
+ ```
32
+
33
+ ### Factory Composition
34
+
35
+ ```typescript
36
+ import { createTableFactory } from 'eze-factory';
37
+
38
+ // Compose slices into a complete feature
39
+ const UsersFactory = createTableFactory({
40
+ paginator: { paginator: UsersAPI },
41
+ table: { columns: () => [...] }
42
+ }).build();
43
+
44
+ // Use directly — no useState needed!
45
+ UsersFactory.paginator.load();
46
+ UsersFactory.table.toggleColumnVisibility('email');
47
+ UsersFactory.exporter.download({ type: 'csv' });
48
+ ```
49
+
50
+ ## Philosophy
51
+
52
+ - **🐝 Hives** — State lives outside React, accessible anywhere
53
+ - **🔌 Slices** — Reusable logic modules that auto-wire together
54
+ - **🏭 Factories** — Compose slices into complete features
55
+ - **📦 Components** — StatusGuard, StatusIndicator filter by operation
56
+
57
+ ## License
58
+
59
+ MIT
@@ -0,0 +1,2 @@
1
+ import { ArrayBeeProps } from "./Types";
2
+ export default function ArrayBee<HiveType = any>({ hive, Component }: ArrayBeeProps<HiveType>): any;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { BeeProps } from "./Types";
3
+ export default function Bee<HiveType = any>({ hive, Component }: BeeProps<HiveType>): React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { BeesProps } from "./Types";
3
+ export default function Bees({ hiveCluster, Component }: BeesProps): React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { FormBeeProps } from "./Types";
3
+ export default function FormBee<HiveType = any>({ hive, Component }: FormBeeProps<HiveType>): React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { FormBeesProps } from "./Types";
3
+ export default function FormBees<HiveType = any>({ hiveCluster, Component }: FormBeesProps<HiveType>): React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { ObserverBeeProps } from "./Types";
3
+ export default function ObserverBee<HiveType = any>({ hive, Component }: ObserverBeeProps<HiveType>): React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { ObserverBeesProps } from "./Types";
3
+ export default function ObserverBees({ hiveCluster, Component }: ObserverBeesProps): React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { ObserverFormBeeProps } from "./Types";
3
+ export default function ObserverFormBee<HiveType = any>({ hive, Component }: ObserverFormBeeProps<HiveType>): React.JSX.Element;
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { IProxyHive } from "../Hives/Types";
3
+ interface ControllerElementProps<T> {
4
+ hive: IProxyHive<T>;
5
+ id: keyof T;
6
+ Component: React.ComponentType<{
7
+ honey: T[keyof T];
8
+ setHoney: (value: T[keyof T]) => void;
9
+ silentSetHoney: (value: T[keyof T]) => void;
10
+ }>;
11
+ }
12
+ export default function ProxyBee<HiveType>({ hive, Component, id }: ControllerElementProps<HiveType>): React.JSX.Element;
13
+ export {};
@@ -0,0 +1,74 @@
1
+ import React from "react";
2
+ import { IHive, IHiveArray, IHiveObserver, INestedFormHive } from "../Hives/Types";
3
+ export type KeyValueHive = {
4
+ [key: string]: IHive<any> | IHiveArray<any>;
5
+ };
6
+ export type KeyValueNestedFormHive = {
7
+ [key: string]: INestedFormHive<any>;
8
+ };
9
+ export type KeyValueHiveObserver = {
10
+ [key: string]: IHiveObserver<any> | IHive<any> | INestedFormHive<any> | IHiveArray<any>;
11
+ };
12
+ export type HoneySetter<HiveType> = (prev: HiveType) => void | HiveType;
13
+ export type BeeProps<HiveType> = {
14
+ hive: IHive<HiveType>;
15
+ Component: (props: {
16
+ honey: HiveType;
17
+ setHoney: HoneySetter<HiveType>;
18
+ silentSetHoney: HoneySetter<HiveType>;
19
+ }) => React.ReactNode;
20
+ };
21
+ export type BeesProps = {
22
+ hiveCluster: KeyValueHive;
23
+ Component: (props: {
24
+ cell: KeyValueHive;
25
+ set: (newValues: KeyValueHive, replace?: boolean) => void;
26
+ }) => any;
27
+ };
28
+ export type ArrayBeeProps<HiveType> = {
29
+ hive: IHiveArray<HiveType>;
30
+ Component: (props: {
31
+ honey: HiveType;
32
+ i: number;
33
+ }) => any;
34
+ };
35
+ export type ObserverBeeProps<HiveType> = {
36
+ hive: IHiveObserver<HiveType> | IHive<HiveType>;
37
+ Component: (props: {
38
+ honey: HiveType;
39
+ }) => any;
40
+ };
41
+ export type ObserverBeesProps = {
42
+ hiveCluster: KeyValueHiveObserver;
43
+ Component: (props: {
44
+ cell: KeyValueHiveObserver;
45
+ }) => any;
46
+ };
47
+ export type INestedFormHoneySetter<K> = (prev: K, effect?: boolean) => void | ((hive: K, effect?: boolean) => void);
48
+ export type FormBeeProps<HiveType> = {
49
+ hive: INestedFormHive<HiveType>;
50
+ Component: (props: {
51
+ honey: HiveType;
52
+ setHoney: HoneySetter<HiveType>;
53
+ silentSetHoney: HoneySetter<HiveType>;
54
+ error?: string;
55
+ validate: INestedFormHoneySetter<HiveType>;
56
+ }) => any;
57
+ };
58
+ export type ObserverFormBeeProps<HiveType> = {
59
+ hive: INestedFormHive<HiveType>;
60
+ Component: (props: {
61
+ honey: HiveType;
62
+ error?: string;
63
+ }) => any;
64
+ };
65
+ export type FormBeesProps<HiveType> = {
66
+ hiveCluster: KeyValueNestedFormHive;
67
+ Component: (props: {
68
+ cell: KeyValueNestedFormHive;
69
+ set: (newValues: KeyValueNestedFormHive, replace?: boolean) => void;
70
+ error?: string;
71
+ validate: INestedFormHoneySetter<HiveType>;
72
+ }) => any;
73
+ };
74
+ export type ProxyHoneySetter<K> = (prev: K, effect?: boolean) => void | ((hive: K, effect?: boolean) => void);
@@ -0,0 +1,10 @@
1
+ export { default as Bee } from "./Bee";
2
+ export { default as Bees } from "./Bees";
3
+ export { default as ArrayBee } from "./ArrayBee";
4
+ export { default as ObserverBee } from "./ObserverBee";
5
+ export { default as ObserverBees } from "./ObserverBees";
6
+ export { default as FormBee } from "./FormBee";
7
+ export { default as FormBees } from "./FormBees";
8
+ export { default as ObserverFormBee } from "./ObserverFormBee";
9
+ export { default as ProxyBee } from "./ProxyBee";
10
+ export * from "./Types";
@@ -0,0 +1,9 @@
1
+ import { SliceFactory } from "./types";
2
+ export declare function createFactory(): FactoryBuilder<{}>;
3
+ declare class FactoryBuilder<Ctx> {
4
+ private ctx;
5
+ constructor(ctx: Ctx);
6
+ use<Add>(factory: SliceFactory<Ctx, Add>): FactoryBuilder<Ctx & Add>;
7
+ build(): Ctx;
8
+ }
9
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "./types.js";
2
+ export * from "./factory.js";
@@ -0,0 +1,2 @@
1
+ export type SliceConfig<SliceCreator> = SliceCreator extends (config?: infer C) => any ? C : never;
2
+ export type SliceFactory<Ctx, Add> = (ctx: Ctx) => Add;
@@ -0,0 +1,2 @@
1
+ import { IHive, IStoreKey } from "./Types";
2
+ export declare function createAsyncHive<HiveType = any>(initialValue: HiveType, storeKey?: IStoreKey): IHive<HiveType>;
@@ -0,0 +1,16 @@
1
+ import { FormValidateMode, IFormHive, IFormHiveValidator, IStoreKey } from "./Types";
2
+ export declare function createFormHive<HiveType>({ initialValue, storeKey, validator, getValidator, validateMode, onSubmit, }: {
3
+ initialValue: HiveType;
4
+ storeKey?: IStoreKey;
5
+ validator?: undefined;
6
+ getValidator?: (formHive: IFormHive<HiveType>) => IFormHiveValidator<HiveType>;
7
+ validateMode?: FormValidateMode;
8
+ onSubmit: (honey: HiveType) => void;
9
+ } | {
10
+ initialValue: HiveType;
11
+ storeKey?: IStoreKey;
12
+ validator?: <K extends keyof HiveType>(key: K, value: HiveType[K]) => string | undefined;
13
+ getValidator?: undefined;
14
+ validateMode?: FormValidateMode;
15
+ onSubmit: (honey: HiveType) => void;
16
+ }): IFormHive<HiveType>;
@@ -0,0 +1,2 @@
1
+ import { IHive, IStoreKey } from "./Types";
2
+ export declare function createHive<HiveType = any>(initialValue: HiveType, storeKey?: IStoreKey): IHive<HiveType>;
@@ -0,0 +1,2 @@
1
+ import { IHiveArray, IStoreKey } from "./Types";
2
+ export declare function createHiveArray<HiveType>(initialValue: HiveType[], storeKey?: IStoreKey): IHiveArray<HiveType>;
@@ -0,0 +1,2 @@
1
+ import { IHiveBase, IStoreKey } from "./Types";
2
+ export declare function _getHiveBase<HiveType>(initialValue: HiveType, storeKey?: IStoreKey): IHiveBase<HiveType>;
@@ -0,0 +1,3 @@
1
+ import { HiveGetter } from "./Types";
2
+ import { IHiveObserver } from "./Types";
3
+ export declare function createHiveObserver<HiveType>(listen: HiveGetter<HiveType>): IHiveObserver<HiveType>;
@@ -0,0 +1,3 @@
1
+ import { StorageType } from "../Utils/Storable";
2
+ export declare const getStorable: (storage?: StorageType) => any;
3
+ export declare const CheckSimilarity: (a: any, b: any) => boolean;
@@ -0,0 +1,2 @@
1
+ import { IProxyHive, IStoreKey } from "./Types";
2
+ export declare function createProxyHive<HiveType>(initialValue: HiveType, storeKey?: IStoreKey): IProxyHive<HiveType>;
@@ -0,0 +1,98 @@
1
+ import { StorageType } from "../Utils/Storable";
2
+ export interface IHive<HiveType> {
3
+ honey: HiveType;
4
+ setHoney: (newValue: HiveType | ((prev: HiveType) => HiveType)) => void;
5
+ silentSetHoney: (newValue: HiveType | ((prev: HiveType) => HiveType)) => void;
6
+ subscribe: (callback: (newValue: HiveType) => void) => () => void;
7
+ _subscribers: () => number;
8
+ reset: () => void;
9
+ clearStore?: () => void;
10
+ initialValue: HiveType;
11
+ }
12
+ export type HiveGetter<HiveType> = (get: <Target>(a: IHive<Target>) => Target) => HiveType;
13
+ export type IHiveBase<HiveType> = [IHive<HiveType>, () => void];
14
+ export interface IHiveObserver<HiveType> {
15
+ honey: any;
16
+ subscribe: (callback: (newValue: HiveType) => void) => () => void;
17
+ _subscribers: () => number;
18
+ setHoney?: undefined;
19
+ silentSetHoney?: undefined;
20
+ }
21
+ export interface IHiveArray<HiveType> {
22
+ honey: HiveType[];
23
+ setHoney: (newValue: HiveType[] | ((prev: HiveType[]) => HiveType[])) => void;
24
+ silentSetHoney: (newValue: HiveType[]) => void;
25
+ subscribe: (callback: (newValue: HiveType[]) => void) => () => void;
26
+ _subscribers: () => number;
27
+ push: (newValue: HiveType) => void;
28
+ pop: () => void;
29
+ shift: () => void;
30
+ unshift: (newValue: HiveType) => void;
31
+ splice: (start: number, deleteCount: number, ...items: HiveType[]) => void;
32
+ remove: (id: any) => void;
33
+ removeById: (id: any) => void;
34
+ removeByIndex: (index: number) => void;
35
+ append: (items: HiveType[]) => void;
36
+ update: () => void;
37
+ updateById: (id: any, newValue: HiveType) => void;
38
+ updateByIndex: (index: number, newValue: HiveType) => void;
39
+ }
40
+ export interface IProxyHive<HiveType> extends IHive<HiveType> {
41
+ createNestedHive: <NestedHiveType>(key: string, initialValue: NestedHiveType, storeKey?: string) => IHive<NestedHiveType>;
42
+ getNestedHive: <K extends keyof HiveType>(key: K) => IHive<HiveType[K]> | undefined;
43
+ setNestedHoney: <K extends keyof HiveType>(key: K, value: HiveType[K] | ((prev: HiveType[K]) => HiveType[K]), effect?: boolean) => void;
44
+ getNestedHoney: <K extends keyof HiveType>(key: K) => HiveType[K];
45
+ subscribeToNestedHive: <K extends keyof HiveType>(key: K, callback: (value: HiveType[K]) => void) => void;
46
+ reset: () => void;
47
+ }
48
+ export interface IFormHive<HiveType> extends IHive<HiveType> {
49
+ createNestedHive: <NestedHiveType>(key: string, initialValue: NestedHiveType, storeKey?: string) => INestedFormHive<NestedHiveType>;
50
+ getNestedHive: <K extends keyof HiveType>(key: K) => INestedFormHive<HiveType[K]>;
51
+ setNestedHoney: <K extends keyof HiveType>(key: K, value: HiveType[K] | ((prev: HiveType[K]) => HiveType[K]), effect?: boolean) => void;
52
+ getNestedHoney: <K extends keyof HiveType>(key: K) => HiveType[K];
53
+ subscribeToNestedHive: <K extends keyof HiveType>(key: K, callback: (value: HiveType[K]) => void) => void;
54
+ validate: <K extends keyof HiveType>(key: K, value: HiveType[K], effect?: boolean) => void;
55
+ errors: {
56
+ [key: string]: string;
57
+ };
58
+ getError: (key: keyof HiveType) => string;
59
+ setError: (key: keyof HiveType, value: string) => void;
60
+ clearErrors: () => void;
61
+ isDirtyHive: IHive<boolean>;
62
+ isValidHive: IHive<boolean>;
63
+ reValidate: <K extends keyof HiveType>(validateKeys?: K[]) => Promise<boolean>;
64
+ submit: <K extends keyof HiveType>(e?: React.FormEvent<HTMLFormElement>, validateKeys?: K[]) => void;
65
+ validateMode: FormValidateMode;
66
+ reset: (initialValue?: {
67
+ key: keyof HiveType;
68
+ value: HiveType[keyof HiveType];
69
+ }) => void;
70
+ }
71
+ export interface INestedFormHive<HiveType> {
72
+ initialValue: HiveType;
73
+ setHoney: (newValue: HiveType | ((prev: HiveType) => HiveType)) => void;
74
+ silentSetHoney: (newValue: HiveType | ((prev: HiveType) => HiveType)) => void;
75
+ subscribe: (callback: (newValue: {
76
+ value: HiveType;
77
+ error?: string;
78
+ }) => void) => () => void;
79
+ _subscribers: () => number;
80
+ clearStore?: () => void;
81
+ honey: {
82
+ value: HiveType;
83
+ error?: string;
84
+ };
85
+ error?: string;
86
+ setError: (err?: string) => void;
87
+ validate: (honey: HiveType, effect?: boolean) => void;
88
+ isValid: () => boolean | Promise<boolean>;
89
+ reset: () => void;
90
+ }
91
+ export type IStoreKey = string | {
92
+ storeKey: string;
93
+ storage: StorageType;
94
+ };
95
+ export type FormValidateMode = "onBlur" | "onChange" | "onSubmit";
96
+ export type IFormHiveValidator<T> = {
97
+ [K in keyof T]?: (value: T[K]) => string | undefined;
98
+ };
@@ -0,0 +1,6 @@
1
+ export { createHive } from "./Hive";
2
+ export { createHiveArray } from "./HiveArray";
3
+ export { createHiveObserver } from "./HiveObserver";
4
+ export { createProxyHive } from "./ProxyHive";
5
+ export { createFormHive } from "./FormHive";
6
+ export * from "./Types";
@@ -0,0 +1,4 @@
1
+ export { default as useHoney } from "./useHoney";
2
+ export { default as useHive } from "./useHive";
3
+ export { default as useFormHive } from "./useFormHive";
4
+ export { default as useFormHoney } from "./useFormHoney";
@@ -0,0 +1,5 @@
1
+ import { INestedFormHive } from "../Hives/Types";
2
+ export default function useFormHive<HiveType>(hive: INestedFormHive<HiveType>): [{
3
+ value: HiveType;
4
+ error?: string;
5
+ }, (honey: HiveType, effect?: boolean) => void];
@@ -0,0 +1,5 @@
1
+ import { INestedFormHive } from "../Hives/Types";
2
+ export default function useFormHoney<HiveType>(hive: INestedFormHive<HiveType>): {
3
+ value: HiveType;
4
+ error?: string;
5
+ };
@@ -0,0 +1,2 @@
1
+ import { IHive } from "../Hives/Types";
2
+ export default function useHive<HiveType>(hive: IHive<HiveType>): any[];
@@ -0,0 +1,2 @@
1
+ import { IHive, IHiveArray, IHiveObserver, INestedFormHive } from "../Hives/Types";
2
+ export default function useHoney<HiveType>(hive: IHive<HiveType> | IHiveObserver<HiveType> | IHiveArray<HiveType> | INestedFormHive<HiveType>): any;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const Error: () => React.JSX.Element;
3
+ export default Error;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const IosLoader: () => React.JSX.Element;
3
+ export default IosLoader;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const ItemsLoading: ({}: {}) => React.JSX.Element;
3
+ export default ItemsLoading;
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ type Props = {
3
+ variant?: "v-small" | "small" | "medium" | "large";
4
+ };
5
+ declare const Loader: ({ variant }: Props) => React.JSX.Element;
6
+ export default Loader;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ type Props = {
3
+ className?: string;
4
+ style?: React.CSSProperties;
5
+ };
6
+ declare const LoaderTwo: ({ className, style }: Props) => React.JSX.Element;
7
+ export default LoaderTwo;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const Loading: () => React.JSX.Element;
3
+ export default Loading;
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ export interface Props {
3
+ label: string;
4
+ }
5
+ declare const _default: React.MemoExoticComponent<({ label }: Props) => React.JSX.Element>;
6
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ export interface Props {
3
+ label?: string;
4
+ service?: any;
5
+ }
6
+ declare const Progressing: ({ label }: Props) => React.JSX.Element;
7
+ export default Progressing;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const Searching: () => React.JSX.Element;
3
+ export default Searching;
@@ -0,0 +1,21 @@
1
+ declare const StateKit: {
2
+ error: () => import("react").JSX.Element;
3
+ processing: ({ label }: import("./Progressing").Props) => import("react").JSX.Element;
4
+ loading: () => import("react").JSX.Element;
5
+ noContent: import("react").MemoExoticComponent<({ label }: import("./NoContent").Props) => import("react").JSX.Element>;
6
+ empty: import("react").MemoExoticComponent<({ label }: import("./NoContent").Props) => import("react").JSX.Element>;
7
+ reloading: () => import("react").JSX.Element;
8
+ };
9
+ export default StateKit;
10
+ export type IState = "idle" | "loading" | "processing" | "reloading" | "searching" | "error" | "noContent" | "loadingMore";
11
+ export type ServiceState = IState | {
12
+ state: IState;
13
+ props: any;
14
+ parent?: HTMLElement | undefined;
15
+ } | {
16
+ state: "noContent";
17
+ props: {
18
+ label: string;
19
+ };
20
+ parent?: HTMLElement | undefined;
21
+ };
@@ -0,0 +1,4 @@
1
+ import "./stateKit.css";
2
+ export * from "./StateKit";
3
+ export { default as StateKit } from "./StateKit";
4
+ export { default as Loader } from "./Loader";
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ export declare const DefaultComponentMap: {
3
+ readonly text: any;
4
+ readonly number: any;
5
+ readonly boolean: any;
6
+ readonly selector: any;
7
+ readonly "multi-selector": any;
8
+ readonly "string-selector": any;
9
+ readonly "number-selector": any;
10
+ readonly "selector-api": any;
11
+ readonly Date: any;
12
+ readonly Time: any;
13
+ readonly DateTime: (props: any) => React.JSX.Element;
14
+ readonly Float: any;
15
+ readonly Int32: any;
16
+ readonly hidden: () => React.JSX.Element;
17
+ };
@@ -0,0 +1,8 @@
1
+ export declare const DefaultStatusKit: {
2
+ error: () => import("react").JSX.Element;
3
+ processing: ({ label }: import("./Kit/Progressing").Props) => import("react").JSX.Element;
4
+ loading: () => import("react").JSX.Element;
5
+ noContent: import("react").MemoExoticComponent<({ label }: import("./Kit/NoContent").Props) => import("react").JSX.Element>;
6
+ empty: import("react").MemoExoticComponent<({ label }: import("./Kit/NoContent").Props) => import("react").JSX.Element>;
7
+ reloading: () => import("react").JSX.Element;
8
+ };
@@ -0,0 +1,25 @@
1
+ import { FilterDefinition, QueryComponentMap } from "../Slices/Query/Types";
2
+ import { StatusSliceConfig } from "../Slices/Status/Types";
3
+ import { LoaderFunction, LoaderProps } from "../Slices/Loader/Types";
4
+ import { DefaultComponentMap } from "../Constants/QueryDefaults";
5
+ type DefaultMap = typeof DefaultComponentMap;
6
+ type MergedMap<M extends QueryComponentMap> = DefaultMap & M;
7
+ type FactoryQueryConfig<M extends QueryComponentMap> = {
8
+ componentMap?: M;
9
+ filters: Record<string, FilterDefinition<MergedMap<M>>>;
10
+ validators?: any[];
11
+ onQueryChange?: (query: any) => void;
12
+ syncWithRouter?: boolean;
13
+ };
14
+ export declare function createDetailFactory<L extends LoaderFunction, R = Awaited<ReturnType<L>>, Fmt = undefined, M extends QueryComponentMap = {}>(config: {
15
+ query?: FactoryQueryConfig<M>;
16
+ loader: LoaderProps<L, R, Fmt>;
17
+ status?: Partial<StatusSliceConfig>;
18
+ }): import("./FactoryPackage").Factory<{
19
+ status: import("../Slices/Status/Types").StatusAPI<import("../Slices/Status/Types").StatusKit>;
20
+ } & {
21
+ query: import("../Slices/Query/Types").QueryAPI<MergedMap<M>, Record<string, FilterDefinition<MergedMap<M>>>>;
22
+ } & {
23
+ loader: import("../Slices/Loader/Types").LoaderAPI<Fmt extends undefined ? R : Fmt>;
24
+ }>;
25
+ export {};
@@ -0,0 +1,6 @@
1
+ export type Slice<T = any, Ctx = any> = (ctx: Ctx) => T;
2
+ export type Factory<Ctx = {}> = {
3
+ use: <S extends Slice<any, Ctx>>(slice: S) => Factory<Ctx & ReturnType<S>>;
4
+ build: () => Ctx;
5
+ };
6
+ export declare function createFactory<Ctx = {}>(): Factory<Ctx>;
@@ -0,0 +1,34 @@
1
+ import { FilterDefinition, QueryComponentMap } from "../Slices/Query/Types";
2
+ import { StatusSliceConfig } from "../Slices/Status/Types";
3
+ import { PaginatorProps } from "../Slices/Paginator/Types";
4
+ import { DefaultComponentMap } from "../Constants/QueryDefaults";
5
+ import { DefaultStatusKit } from "../Constants/StatusDefaults";
6
+ type DefaultMap = typeof DefaultComponentMap;
7
+ type MergedMap<M extends QueryComponentMap> = DefaultMap & M;
8
+ type DefaultStatusMap = typeof DefaultStatusKit;
9
+ export declare function createListFactory<P extends {
10
+ load: (...args: any[]) => Promise<any>;
11
+ reload: (...args: any[]) => Promise<any>;
12
+ loadMore: () => Promise<any>;
13
+ hasMore: boolean;
14
+ limit: number;
15
+ }, R = Awaited<ReturnType<P["load"]>>, Fmt = undefined, M extends QueryComponentMap = {}, F extends Record<string, FilterDefinition<MergedMap<M>>> = Record<string, FilterDefinition<MergedMap<M>>>, SK extends Record<string, any> = {}>(config: {
16
+ query?: {
17
+ componentMap?: M;
18
+ filters: F;
19
+ validators?: any[];
20
+ onQueryChange?: (query: any) => void;
21
+ syncWithRouter?: boolean;
22
+ };
23
+ paginator: PaginatorProps<P, R, Fmt, any>;
24
+ status?: Omit<Partial<StatusSliceConfig<DefaultStatusMap & SK>>, "statusKit"> & {
25
+ statusKit?: SK;
26
+ };
27
+ }): import("./FactoryPackage").Factory<{
28
+ status: import("../Slices/Status/Types").StatusAPI<import("../Slices/Status/Types").StatusKit>;
29
+ } & {
30
+ query: import("../Slices/Query/Types").QueryAPI<MergedMap<M>, F>;
31
+ } & {
32
+ paginator: import("../Slices/Paginator/Types").PaginatorAPI<import("../Slices/Paginator/PaginatorMechanics").ArrayElement<Fmt extends undefined ? R : Fmt>, any>;
33
+ }>;
34
+ export {};
@@ -0,0 +1,33 @@
1
+ import { FilterDefinition, QueryComponentMap } from "../Slices/Query/Types";
2
+ import { StatusSliceConfig } from "../Slices/Status/Types";
3
+ import { LoaderFunction, LoaderProps } from "../Slices/Loader/Types";
4
+ import { TableSliceConfig } from "../Slices/Table/Types";
5
+ import { ExporterSliceConfig } from "../Slices/Exporter/Types";
6
+ import { DefaultComponentMap } from "../Constants/QueryDefaults";
7
+ type DefaultMap = typeof DefaultComponentMap;
8
+ type MergedMap<M extends QueryComponentMap> = DefaultMap & M;
9
+ type FactoryQueryConfig<M extends QueryComponentMap> = {
10
+ componentMap?: M;
11
+ filters: Record<string, FilterDefinition<MergedMap<M>>>;
12
+ validators?: any[];
13
+ onQueryChange?: (query: any) => void;
14
+ syncWithRouter?: boolean;
15
+ };
16
+ export declare function createStaticTableFactory<L extends LoaderFunction, R = Awaited<ReturnType<L>>, Fmt = undefined, M extends QueryComponentMap = {}>(config: {
17
+ query?: FactoryQueryConfig<M>;
18
+ loader: LoaderProps<L, R, Fmt>;
19
+ status?: Partial<StatusSliceConfig>;
20
+ table: TableSliceConfig<Fmt extends undefined ? (R extends any[] ? R[number] : never) : (Fmt extends any[] ? Fmt[number] : never)>;
21
+ exporter?: ExporterSliceConfig<Fmt extends undefined ? (R extends any[] ? R[number] : never) : (Fmt extends any[] ? Fmt[number] : never)>;
22
+ }): import("./FactoryPackage").Factory<{
23
+ status: import("../Slices/Status/Types").StatusAPI<import("../Slices/Status/Types").StatusKit>;
24
+ } & {
25
+ query: import("../Slices/Query/Types").QueryAPI<MergedMap<M>, Record<string, FilterDefinition<MergedMap<M>>>>;
26
+ } & {
27
+ loader: import("../Slices/Loader/Types").LoaderAPI<Fmt extends undefined ? R : Fmt>;
28
+ } & {
29
+ table: import("../Slices/Table/Types").TableAPI<Fmt extends undefined ? R extends any[] ? R[number] : never : Fmt extends any[] ? Fmt[number] : never>;
30
+ } & {
31
+ exporter: import("../Slices/Exporter/Types").ExporterAPI;
32
+ }>;
33
+ export {};