@ehfuse/forma 1.3.5 → 1.3.6
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/LICENSE +0 -21
- package/README.md +90 -35
- package/dist/core/FieldStore.d.ts +4 -0
- package/dist/core/FieldStore.d.ts.map +1 -1
- package/dist/core/FieldStore.js +95 -2
- package/dist/core/FieldStore.js.map +1 -1
- package/dist/esm/core/FieldStore.d.ts +4 -0
- package/dist/esm/core/FieldStore.d.ts.map +1 -1
- package/dist/esm/core/FieldStore.js +95 -2
- package/dist/esm/core/FieldStore.js.map +1 -1
- package/dist/esm/hooks/useForm.d.ts +4 -19
- package/dist/esm/hooks/useForm.d.ts.map +1 -1
- package/dist/esm/hooks/useForm.js +7 -19
- package/dist/esm/hooks/useForm.js.map +1 -1
- package/dist/esm/hooks/useFormaState.d.ts +2 -1
- package/dist/esm/hooks/useFormaState.d.ts.map +1 -1
- package/dist/esm/hooks/useFormaState.js +19 -9
- package/dist/esm/hooks/useFormaState.js.map +1 -1
- package/dist/esm/hooks/useGlobalFormaState.d.ts +105 -0
- package/dist/esm/hooks/useGlobalFormaState.d.ts.map +1 -0
- package/dist/esm/hooks/useGlobalFormaState.js +120 -0
- package/dist/esm/hooks/useGlobalFormaState.js.map +1 -0
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/form.d.ts +15 -0
- package/dist/esm/types/form.d.ts.map +1 -1
- package/dist/esm/types/globalForm.d.ts +21 -0
- package/dist/esm/types/globalForm.d.ts.map +1 -1
- package/dist/esm/types/globalForm.js.map +1 -1
- package/dist/esm/utils/environment.d.ts +41 -0
- package/dist/esm/utils/environment.d.ts.map +1 -0
- package/dist/esm/utils/environment.js +78 -0
- package/dist/esm/utils/environment.js.map +1 -0
- package/dist/esm/utils/index.d.ts +1 -0
- package/dist/esm/utils/index.d.ts.map +1 -1
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/hooks/useForm.d.ts +4 -19
- package/dist/hooks/useForm.d.ts.map +1 -1
- package/dist/hooks/useForm.js +7 -19
- package/dist/hooks/useForm.js.map +1 -1
- package/dist/hooks/useFormaState.d.ts +2 -1
- package/dist/hooks/useFormaState.d.ts.map +1 -1
- package/dist/hooks/useFormaState.js +19 -9
- package/dist/hooks/useFormaState.js.map +1 -1
- package/dist/hooks/useGlobalFormaState.d.ts +105 -0
- package/dist/hooks/useGlobalFormaState.d.ts.map +1 -0
- package/dist/hooks/useGlobalFormaState.js +123 -0
- package/dist/hooks/useGlobalFormaState.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/types/form.d.ts +15 -0
- package/dist/types/form.d.ts.map +1 -1
- package/dist/types/globalForm.d.ts +21 -0
- package/dist/types/globalForm.d.ts.map +1 -1
- package/dist/types/globalForm.js.map +1 -1
- package/dist/utils/environment.d.ts +41 -0
- package/dist/utils/environment.d.ts.map +1 -0
- package/dist/utils/environment.js +84 -0
- package/dist/utils/environment.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +6 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalForm.js","sourceRoot":"","sources":["../../../types/globalForm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;
|
|
1
|
+
{"version":3,"file":"globalForm.js","sourceRoot":"","sources":["../../../types/globalForm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AA0KH;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACtC,YACI,OAAe,EACR,MAAe,EACf,SAAkB;QAEzB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,WAAM,GAAN,MAAM,CAAS;QACf,cAAS,GAAT,SAAS,CAAS;QAGzB,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAClC,CAAC;CACJ"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* environment.ts
|
|
3
|
+
*
|
|
4
|
+
* Environment detection utilities
|
|
5
|
+
* 환경 감지 유틸리티
|
|
6
|
+
*
|
|
7
|
+
* @author KIM YOUNG JIN (ehfuse@gmail.com)
|
|
8
|
+
* @license MIT License
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Check if the current environment is development
|
|
12
|
+
* 현재 환경이 개발 환경인지 확인
|
|
13
|
+
*
|
|
14
|
+
* @returns {boolean} true if development environment, false otherwise
|
|
15
|
+
*/
|
|
16
|
+
export declare function isDevelopment(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Log a warning message only in development environment
|
|
19
|
+
* 개발 환경에서만 경고 메시지 로그
|
|
20
|
+
*
|
|
21
|
+
* @param message - Warning message to log
|
|
22
|
+
* @param ...args - Additional arguments to log
|
|
23
|
+
*/
|
|
24
|
+
export declare function devWarn(message: string, ...args: any[]): void;
|
|
25
|
+
/**
|
|
26
|
+
* Log an error message only in development environment
|
|
27
|
+
* 개발 환경에서만 에러 메시지 로그
|
|
28
|
+
*
|
|
29
|
+
* @param message - Error message to log
|
|
30
|
+
* @param ...args - Additional arguments to log
|
|
31
|
+
*/
|
|
32
|
+
export declare function devError(message: string, ...args: any[]): void;
|
|
33
|
+
/**
|
|
34
|
+
* Log an info message only in development environment
|
|
35
|
+
* 개발 환경에서만 정보 메시지 로그
|
|
36
|
+
*
|
|
37
|
+
* @param message - Info message to log
|
|
38
|
+
* @param ...args - Additional arguments to log
|
|
39
|
+
*/
|
|
40
|
+
export declare function devLog(message: string, ...args: any[]): void;
|
|
41
|
+
//# sourceMappingURL=environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../utils/environment.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;GAKG;AACH,wBAAgB,aAAa,IAAI,OAAO,CA8BvC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAI7D;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAI9D;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAI5D"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* environment.ts
|
|
3
|
+
*
|
|
4
|
+
* Environment detection utilities
|
|
5
|
+
* 환경 감지 유틸리티
|
|
6
|
+
*
|
|
7
|
+
* @author KIM YOUNG JIN (ehfuse@gmail.com)
|
|
8
|
+
* @license MIT License
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Check if the current environment is development
|
|
12
|
+
* 현재 환경이 개발 환경인지 확인
|
|
13
|
+
*
|
|
14
|
+
* @returns {boolean} true if development environment, false otherwise
|
|
15
|
+
*/
|
|
16
|
+
export function isDevelopment() {
|
|
17
|
+
try {
|
|
18
|
+
// Node.js environment check
|
|
19
|
+
if (typeof globalThis.process !== "undefined" &&
|
|
20
|
+
globalThis.process.env) {
|
|
21
|
+
return globalThis.process.env.NODE_ENV !== "production";
|
|
22
|
+
}
|
|
23
|
+
// Browser environment check
|
|
24
|
+
if (typeof window !== "undefined") {
|
|
25
|
+
// Check for localhost or development hostnames
|
|
26
|
+
const hostname = window.location.hostname;
|
|
27
|
+
const isDev = hostname === "localhost" ||
|
|
28
|
+
hostname === "127.0.0.1" ||
|
|
29
|
+
hostname.includes("dev") ||
|
|
30
|
+
hostname.includes("local") ||
|
|
31
|
+
window.location.port !== "";
|
|
32
|
+
return isDev;
|
|
33
|
+
}
|
|
34
|
+
// Default to false for unknown environments
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
// If any error occurs, assume production
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Log a warning message only in development environment
|
|
44
|
+
* 개발 환경에서만 경고 메시지 로그
|
|
45
|
+
*
|
|
46
|
+
* @param message - Warning message to log
|
|
47
|
+
* @param ...args - Additional arguments to log
|
|
48
|
+
*/
|
|
49
|
+
export function devWarn(message, ...args) {
|
|
50
|
+
if (isDevelopment()) {
|
|
51
|
+
console.warn(message, ...args);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Log an error message only in development environment
|
|
56
|
+
* 개발 환경에서만 에러 메시지 로그
|
|
57
|
+
*
|
|
58
|
+
* @param message - Error message to log
|
|
59
|
+
* @param ...args - Additional arguments to log
|
|
60
|
+
*/
|
|
61
|
+
export function devError(message, ...args) {
|
|
62
|
+
if (isDevelopment()) {
|
|
63
|
+
console.error(message, ...args);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Log an info message only in development environment
|
|
68
|
+
* 개발 환경에서만 정보 메시지 로그
|
|
69
|
+
*
|
|
70
|
+
* @param message - Info message to log
|
|
71
|
+
* @param ...args - Additional arguments to log
|
|
72
|
+
*/
|
|
73
|
+
export function devLog(message, ...args) {
|
|
74
|
+
if (isDevelopment()) {
|
|
75
|
+
console.log(message, ...args);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=environment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../utils/environment.ts"],"names":[],"mappings":"AAAA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AAC,OAAe,EAAE,GAAG,IAAW;IAClD,IAAI,aAAa,EAAE,EAAE,CAAC;QAClB,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IAClC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/hooks/useForm.d.ts
CHANGED
|
@@ -27,8 +27,7 @@
|
|
|
27
27
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
28
|
* SOFTWARE.
|
|
29
29
|
*/
|
|
30
|
-
import {
|
|
31
|
-
import React from "react";
|
|
30
|
+
import { UseFormProps, UseFormPropsOptional, UseFormReturn } from "../types/form";
|
|
32
31
|
/**
|
|
33
32
|
* Forma 핵심 폼 관리 훅 / Forma core form management hook
|
|
34
33
|
*
|
|
@@ -45,21 +44,7 @@ import React from "react";
|
|
|
45
44
|
* @param props 폼 설정 옵션 / Form configuration options
|
|
46
45
|
* @returns 폼 관리 API 객체 / Form management API object
|
|
47
46
|
*/
|
|
48
|
-
export declare function useForm<T extends Record<string, any
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
isModified: boolean;
|
|
52
|
-
useFormValue: (fieldName: string) => any;
|
|
53
|
-
getFormValue: (fieldName: string) => any;
|
|
54
|
-
getFormValues: () => T;
|
|
55
|
-
setFormValue: (name: string, value: any) => void;
|
|
56
|
-
setFormValues: (newValues: Partial<T>) => void;
|
|
57
|
-
setInitialFormValues: (newInitialValues: T) => void;
|
|
58
|
-
handleFormChange: (e: FormChangeEvent) => void;
|
|
59
|
-
handleDatePickerChange: DatePickerChangeHandler;
|
|
60
|
-
submit: (e?: React.FormEvent) => Promise<boolean>;
|
|
61
|
-
resetForm: () => void;
|
|
62
|
-
validateForm: (valuesToValidate?: T) => Promise<boolean>;
|
|
63
|
-
_store: import("..").FieldStore<T>;
|
|
64
|
-
};
|
|
47
|
+
export declare function useForm<T extends Record<string, any> = Record<string, any>>(): UseFormReturn<T>;
|
|
48
|
+
export declare function useForm<T extends Record<string, any> = Record<string, any>>(props?: UseFormPropsOptional<T>): UseFormReturn<T>;
|
|
49
|
+
export declare function useForm<T extends Record<string, any>>(props: UseFormProps<T>): UseFormReturn<T>;
|
|
65
50
|
//# sourceMappingURL=useForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../hooks/useForm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../hooks/useForm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAGH,YAAY,EACZ,oBAAoB,EACpB,aAAa,EAChB,MAAM,eAAe,CAAC;AAevB;;;;;;;;;;;;;;;GAeG;AAGH,wBAAgB,OAAO,CACnB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAClD,aAAa,CAAC,CAAC,CAAC,CAAC;AAGtB,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACvE,KAAK,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAChC,aAAa,CAAC,CAAC,CAAC,CAAC;AAGpB,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACjD,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,GACvB,aAAa,CAAC,CAAC,CAAC,CAAC"}
|
package/dist/hooks/useForm.js
CHANGED
|
@@ -31,24 +31,10 @@
|
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
32
|
exports.useForm = useForm;
|
|
33
33
|
const useFormaState_1 = require("./useFormaState");
|
|
34
|
+
const utils_1 = require("../utils");
|
|
34
35
|
const react_1 = require("react");
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
*
|
|
38
|
-
* 고급 폼 상태 관리와 성능 최적화를 제공합니다
|
|
39
|
-
* Provides advanced form state management and performance optimization
|
|
40
|
-
*
|
|
41
|
-
* Features:
|
|
42
|
-
* - 개별 필드 구독으로 선택적 리렌더링 / Selective re-rendering with individual field subscriptions
|
|
43
|
-
* - Dot notation 지원으로 중첩 객체 처리 / Nested object handling with dot notation support
|
|
44
|
-
* - MUI 컴포넌트 완전 호환 / Full MUI component compatibility
|
|
45
|
-
* - TypeScript 완전 지원 / Complete TypeScript support
|
|
46
|
-
*
|
|
47
|
-
* @template T 폼 데이터의 타입 / Form data type
|
|
48
|
-
* @param props 폼 설정 옵션 / Form configuration options
|
|
49
|
-
* @returns 폼 관리 API 객체 / Form management API object
|
|
50
|
-
*/
|
|
51
|
-
function useForm({ initialValues, onSubmit, onValidate, onComplete, _externalStore, }) {
|
|
36
|
+
function useForm(props = {}) {
|
|
37
|
+
const { initialValues = {}, onSubmit, onValidate, onComplete, _externalStore, } = props;
|
|
52
38
|
// useFormaState를 기반으로 사용 / Use useFormaState as foundation
|
|
53
39
|
const fieldState = (0, useFormaState_1.useFormaState)(initialValues, { _externalStore });
|
|
54
40
|
// 폼 특정 상태 관리 / Form-specific state management
|
|
@@ -171,7 +157,7 @@ function useForm({ initialValues, onSubmit, onValidate, onComplete, _externalSto
|
|
|
171
157
|
return await onValidate(currentValues);
|
|
172
158
|
}
|
|
173
159
|
catch (error) {
|
|
174
|
-
|
|
160
|
+
(0, utils_1.devError)("Validation error:", error);
|
|
175
161
|
return false;
|
|
176
162
|
}
|
|
177
163
|
finally {
|
|
@@ -207,7 +193,7 @@ function useForm({ initialValues, onSubmit, onValidate, onComplete, _externalSto
|
|
|
207
193
|
return true;
|
|
208
194
|
}
|
|
209
195
|
catch (error) {
|
|
210
|
-
|
|
196
|
+
(0, utils_1.devError)("Form submission error:", error);
|
|
211
197
|
return false;
|
|
212
198
|
}
|
|
213
199
|
finally {
|
|
@@ -234,6 +220,8 @@ function useForm({ initialValues, onSubmit, onValidate, onComplete, _externalSto
|
|
|
234
220
|
submit, // 폼 제출 / submit form
|
|
235
221
|
resetForm, // 폼 초기화 / reset form
|
|
236
222
|
validateForm, // 폼 검증 / validate form
|
|
223
|
+
// 호환성 / Compatibility
|
|
224
|
+
values: fieldState.getValues(), // 호환성을 위한 values 객체 (비권장) / Values object for compatibility (not recommended)
|
|
237
225
|
// 고급 사용 / Advanced usage
|
|
238
226
|
_store: fieldState._store, // 직접 store 접근용 / direct store access
|
|
239
227
|
}), [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useForm.js","sourceRoot":"","sources":["../../hooks/useForm.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;;
|
|
1
|
+
{"version":3,"file":"useForm.js","sourceRoot":"","sources":["../../hooks/useForm.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;;AAsDH,0BAoRC;AAjUD,mDAAgD;AAChD,oCAAoC;AAEpC,iCAMe;AAoCf,SAAgB,OAAO,CACnB,QAEgC,EAA6B;IAE7D,MAAM,EACF,aAAa,GAAG,EAAO,EACvB,QAAQ,EACR,UAAU,EACV,UAAU,EACV,cAAc,GACjB,GAAG,KAAK,CAAC;IAEV,2DAA2D;IAC3D,MAAM,UAAU,GAAG,IAAA,6BAAa,EAAI,aAAa,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC;IAEvE,8CAA8C;IAC9C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IACxD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAExD,2CAA2C;IAC3C,8BAA8B;IAC9B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAEpD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACX,MAAM,WAAW,GAAG,UAAU,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE;YACvD,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;QAEH,WAAW;QACX,aAAa,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AO,IAAA,eAAO,EACV,GAAG,EAAE,CAAC,CAAC;QACH,aAAa;QACb,YAAY;QACZ,YAAY;QACZ,UAAU;QAEV,sBAAsB;QACtB,YAAY,EAAE,oEAAoE;QAClF,YAAY,EAAE,uEAAuE;QACrF,aAAa,EAAE,oCAAoC;QAEnD,oBAAoB;QACpB,YAAY,EAAE,kCAAkC;QAChD,aAAa,EAAE,2BAA2B;QAC1C,oBAAoB,EAAE,iCAAiC;QAEvD,2BAA2B;QAC3B,gBAAgB,EAAE,2EAA2E;QAC7F,sBAAsB,EAAE,wDAAwD;QAEhF,sBAAsB;QACtB,MAAM,EAAE,qBAAqB;QAC7B,SAAS,EAAE,qBAAqB;QAChC,YAAY,EAAE,uBAAuB;QAErC,sBAAsB;QACtB,MAAM,EAAE,UAAU,CAAC,SAAS,EAAE,EAAE,8EAA8E;QAE9G,yBAAyB;QACzB,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,qCAAqC;KACnE,CAAC,EACF;QACI,YAAY;QACZ,YAAY;QACZ,UAAU;QACV,YAAY;QACZ,YAAY;QACZ,aAAa;QACb,YAAY;QACZ,aAAa;QACb,oBAAoB;QACpB,gBAAgB;QAChB,sBAAsB;QACtB,MAAM;QACN,SAAS;QACT,YAAY;QACZ,UAAU,CAAC,MAAM,EAAE,iBAAiB;KACvC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* @license MIT License
|
|
9
9
|
*/
|
|
10
10
|
import { FieldStore } from "../core/FieldStore";
|
|
11
|
+
import { FormChangeEvent } from "../types/form";
|
|
11
12
|
/**
|
|
12
13
|
* Options for configuring useFormaState hook
|
|
13
14
|
* useFormaState 훅 설정을 위한 옵션
|
|
@@ -42,7 +43,7 @@ export interface UseFormaStateReturn<T extends Record<string, any>> {
|
|
|
42
43
|
/** Reset to initial values | 초기값으로 재설정 */
|
|
43
44
|
reset: () => void;
|
|
44
45
|
/** Handle standard input change events | 표준 입력 변경 이벤트 처리 */
|
|
45
|
-
handleChange: (event:
|
|
46
|
+
handleChange: (event: FormChangeEvent) => void;
|
|
46
47
|
/** Check if a field exists | 필드 존재 여부 확인 */
|
|
47
48
|
hasField: (path: string) => boolean;
|
|
48
49
|
/** Remove a field from state | 상태에서 필드 제거 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormaState.d.ts","sourceRoot":"","sources":["../../hooks/useFormaState.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"useFormaState.d.ts","sourceRoot":"","sources":["../../hooks/useFormaState.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD;;;GAGG;AACH,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAC/D,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC;IAE/B,qFAAqF;IACrF,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,mFAAmF;IACnF,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAE/B,4DAA4D;IAC5D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC,+DAA+D;IAC/D,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,sFAAsF;IACtF,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAC9D,gFAAgF;IAChF,QAAQ,EAAE,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,CAAC,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,mBAAmB,CAAC,CAAC,CAAC,CAAC;AAGhF,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACvD,aAAa,EAAE,CAAC,EAChB,OAAO,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAClC,mBAAmB,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -13,6 +13,7 @@ exports.useFieldSubscription = useFieldSubscription;
|
|
|
13
13
|
exports.useFormaState = useFormaState;
|
|
14
14
|
const react_1 = require("react");
|
|
15
15
|
const FieldStore_1 = require("../core/FieldStore");
|
|
16
|
+
const utils_1 = require("../utils");
|
|
16
17
|
/**
|
|
17
18
|
* Individual field subscription hook for useFormaState
|
|
18
19
|
* useFormaState를 위한 개별 필드 구독 훅
|
|
@@ -105,24 +106,33 @@ function useFormaState(initialValues = {}, options = {}) {
|
|
|
105
106
|
// Reset to initial values
|
|
106
107
|
// 초기값으로 재설정
|
|
107
108
|
const reset = (0, react_1.useCallback)(() => {
|
|
108
|
-
store.
|
|
109
|
+
store.reset();
|
|
109
110
|
}, []); // store 의존성 제거
|
|
110
111
|
// Handle standard input change events
|
|
111
112
|
// 표준 입력 변경 이벤트 처리
|
|
112
113
|
const handleChange = (0, react_1.useCallback)((event) => {
|
|
113
|
-
const
|
|
114
|
-
if (!name) {
|
|
115
|
-
|
|
114
|
+
const target = event.target;
|
|
115
|
+
if (!target || !target.name) {
|
|
116
|
+
(0, utils_1.devWarn)('useFormaState.handleChange: input element must have a "name" attribute');
|
|
116
117
|
return;
|
|
117
118
|
}
|
|
119
|
+
const { name, type, value, checked } = target;
|
|
118
120
|
let processedValue = value;
|
|
119
|
-
//
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
processedValue = event.target.checked;
|
|
121
|
+
// DatePicker 처리 (Dayjs 객체) / DatePicker handling (Dayjs object)
|
|
122
|
+
if (value && typeof value === "object" && value.format) {
|
|
123
|
+
processedValue = value.format("YYYY-MM-DD");
|
|
123
124
|
}
|
|
125
|
+
// 체크박스 처리 / Checkbox handling
|
|
126
|
+
else if (type === "checkbox") {
|
|
127
|
+
processedValue = checked;
|
|
128
|
+
}
|
|
129
|
+
// 숫자 타입 처리 / Number type handling
|
|
124
130
|
else if (type === "number") {
|
|
125
|
-
processedValue =
|
|
131
|
+
processedValue = Number(value);
|
|
132
|
+
}
|
|
133
|
+
// null 값 처리 / Null value handling
|
|
134
|
+
else if (value === null) {
|
|
135
|
+
processedValue = undefined;
|
|
126
136
|
}
|
|
127
137
|
setValue(name, processedValue);
|
|
128
138
|
}, [setValue]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormaState.js","sourceRoot":"","sources":["../../hooks/useFormaState.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;
|
|
1
|
+
{"version":3,"file":"useFormaState.js","sourceRoot":"","sources":["../../hooks/useFormaState.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAsGH,oDAKC;AA4CD,sCA0JC;AA/SD,iCAA0E;AAC1E,mDAAgD;AAChD,oCAAmE;AAkEnE;;;;;;;GAOG;AACH,SAAS,aAAa,CAAI,KAAsB,EAAE,SAAiB;IAC/D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IAEpE,IAAA,iBAAS,EAAC,GAAG,EAAE;QACX,6BAA6B;QAC7B,MAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE,GAAG,EAAE;YAChD,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YAC3C,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;QAEH,OAAO,WAAW,CAAC;IACvB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,qCAAqC;IAEtD,OAAO,K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E,EAAE;YACb,OAAO,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC,EACD,EAAE,CAAC,eAAe;SACrB;QACD,WAAW,EAAE,IAAA,mBAAW,EACpB,CAAC,IAAY,EAAE,EAAE;YACb,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC,EACD,EAAE,CAAC,eAAe;SACrB;QACD,QAAQ,EAAE,IAAA,mBAAW,EACjB,CAAC,IAAY,EAAE,EAAE;YACb,OAAO,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC,EACD,EAAE,CAAC,eAAe;SACrB;QACD,SAAS,EAAE,IAAA,mBAAW,EAClB,CAAC,QAA6B,EAAE,EAAE;YAC9B,OAAO,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAC1C,CAAC,EACD,EAAE,CAAC,eAAe;SACrB;QACD,MAAM,EAAE,KAAK;KAChB,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useGlobalFormaState.ts
|
|
3
|
+
*
|
|
4
|
+
* Forma - 글로벌 FormaState 관리 훅 / Global FormaState management hook
|
|
5
|
+
* 여러 컴포넌트 간 개별 필드 구독 기반 상태 공유를 위한 확장 훅
|
|
6
|
+
* Extended hook for sharing state across multiple components with individual field subscriptions
|
|
7
|
+
*
|
|
8
|
+
* @license MIT License
|
|
9
|
+
* @copyright 2025 KIM YOUNG JIN (Kim Young Jin)
|
|
10
|
+
* @author KIM YOUNG JIN (ehfuse@gmail.com)
|
|
11
|
+
*
|
|
12
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
* in the Software without restriction, including without limitation the rights
|
|
15
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
* furnished to do so, subject to the following conditions:
|
|
18
|
+
*
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
* copies or substantial portions of the Software.
|
|
21
|
+
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
* SOFTWARE.
|
|
29
|
+
*/
|
|
30
|
+
import { UseGlobalFormaStateProps, UseGlobalFormaStateReturn } from "../types/globalForm";
|
|
31
|
+
/**
|
|
32
|
+
* 글로벌 FormaState 관리 훅 / Global FormaState management hook
|
|
33
|
+
*
|
|
34
|
+
* 여러 컴포넌트 간 개별 필드 구독 기반 상태를 공유하기 위한 훅입니다
|
|
35
|
+
* Hook for sharing state across multiple components with individual field subscriptions
|
|
36
|
+
*
|
|
37
|
+
* 데이터 공유에만 집중하며, 각 컴포넌트에서 필요한 필드만 구독하여 최적화된 렌더링을 제공합니다
|
|
38
|
+
* Focuses only on data sharing and provides optimized rendering by subscribing only to necessary fields in each component
|
|
39
|
+
*
|
|
40
|
+
* @template T FormaState 데이터의 타입 / FormaState data type
|
|
41
|
+
* @param props 글로벌 FormaState 설정 옵션 / Global FormaState configuration options
|
|
42
|
+
* @returns 글로벌 FormaState 관리 API 객체 / Global FormaState management API object
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* // 글로벌 상태 정의
|
|
47
|
+
* interface AppState {
|
|
48
|
+
* user: { name: string; email: string };
|
|
49
|
+
* settings: { theme: 'light' | 'dark'; notifications: boolean };
|
|
50
|
+
* cart: { items: any[]; total: number };
|
|
51
|
+
* }
|
|
52
|
+
*
|
|
53
|
+
* // 컴포넌트 A - 사용자 정보만 구독
|
|
54
|
+
* function UserProfile() {
|
|
55
|
+
* const state = useGlobalFormaState<AppState>({ stateId: 'app-state' });
|
|
56
|
+
* const userName = state.useValue('user.name'); // name 변경시만 리렌더
|
|
57
|
+
* const userEmail = state.useValue('user.email'); // email 변경시만 리렌더
|
|
58
|
+
*
|
|
59
|
+
* return (
|
|
60
|
+
* <div>
|
|
61
|
+
* <h1>{userName}</h1>
|
|
62
|
+
* <p>{userEmail}</p>
|
|
63
|
+
* <button onClick={() => state.setValue('user.name', 'New Name')}>
|
|
64
|
+
* Update Name
|
|
65
|
+
* </button>
|
|
66
|
+
* </div>
|
|
67
|
+
* );
|
|
68
|
+
* }
|
|
69
|
+
*
|
|
70
|
+
* // 컴포넌트 B - 설정만 구독
|
|
71
|
+
* function Settings() {
|
|
72
|
+
* const state = useGlobalFormaState<AppState>({ stateId: 'app-state' });
|
|
73
|
+
* const theme = state.useValue('settings.theme'); // theme 변경시만 리렌더
|
|
74
|
+
* const notifications = state.useValue('settings.notifications'); // notifications 변경시만 리렌더
|
|
75
|
+
*
|
|
76
|
+
* return (
|
|
77
|
+
* <div>
|
|
78
|
+
* <select
|
|
79
|
+
* value={theme}
|
|
80
|
+
* onChange={(e) => state.setValue('settings.theme', e.target.value)}
|
|
81
|
+
* >
|
|
82
|
+
* <option value="light">Light</option>
|
|
83
|
+
* <option value="dark">Dark</option>
|
|
84
|
+
* </select>
|
|
85
|
+
* </div>
|
|
86
|
+
* );
|
|
87
|
+
* }
|
|
88
|
+
*
|
|
89
|
+
* // 컴포넌트 C - 장바구니만 구독
|
|
90
|
+
* function Cart() {
|
|
91
|
+
* const state = useGlobalFormaState<AppState>({ stateId: 'app-state' });
|
|
92
|
+
* const cartItems = state.useValue('cart.items'); // cart.items 변경시만 리렌더
|
|
93
|
+
* const cartTotal = state.useValue('cart.total'); // cart.total 변경시만 리렌더
|
|
94
|
+
*
|
|
95
|
+
* return (
|
|
96
|
+
* <div>
|
|
97
|
+
* <h2>Cart ({cartItems.length} items)</h2>
|
|
98
|
+
* <p>Total: ${cartTotal}</p>
|
|
99
|
+
* </div>
|
|
100
|
+
* );
|
|
101
|
+
* }
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
export declare function useGlobalFormaState<T extends Record<string, any>>({ stateId, autoCleanup, }: UseGlobalFormaStateProps<T>): UseGlobalFormaStateReturn<T>;
|
|
105
|
+
//# sourceMappingURL=useGlobalFormaState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGlobalFormaState.d.ts","sourceRoot":"","sources":["../../hooks/useGlobalFormaState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,EACH,wBAAwB,EACxB,yBAAyB,EAC5B,MAAM,qBAAqB,CAAC;AAG7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EAC/D,OAAO,EACP,WAAkB,GACrB,EAAE,wBAAwB,CAAC,CAAC,CAAC,GAAG,yBAAyB,CAAC,CAAC,CAAC,CAgB5D"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* useGlobalFormaState.ts
|
|
4
|
+
*
|
|
5
|
+
* Forma - 글로벌 FormaState 관리 훅 / Global FormaState management hook
|
|
6
|
+
* 여러 컴포넌트 간 개별 필드 구독 기반 상태 공유를 위한 확장 훅
|
|
7
|
+
* Extended hook for sharing state across multiple components with individual field subscriptions
|
|
8
|
+
*
|
|
9
|
+
* @license MIT License
|
|
10
|
+
* @copyright 2025 KIM YOUNG JIN (Kim Young Jin)
|
|
11
|
+
* @author KIM YOUNG JIN (ehfuse@gmail.com)
|
|
12
|
+
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
* in the Software without restriction, including without limitation the rights
|
|
16
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
18
|
+
* furnished to do so, subject to the following conditions:
|
|
19
|
+
*
|
|
20
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
21
|
+
* copies or substantial portions of the Software.
|
|
22
|
+
*
|
|
23
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
+
* SOFTWARE.
|
|
30
|
+
*/
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.useGlobalFormaState = useGlobalFormaState;
|
|
33
|
+
const react_1 = require("react");
|
|
34
|
+
const useFormaState_1 = require("./useFormaState");
|
|
35
|
+
const GlobalFormContext_1 = require("../contexts/GlobalFormContext");
|
|
36
|
+
/**
|
|
37
|
+
* 글로벌 FormaState 관리 훅 / Global FormaState management hook
|
|
38
|
+
*
|
|
39
|
+
* 여러 컴포넌트 간 개별 필드 구독 기반 상태를 공유하기 위한 훅입니다
|
|
40
|
+
* Hook for sharing state across multiple components with individual field subscriptions
|
|
41
|
+
*
|
|
42
|
+
* 데이터 공유에만 집중하며, 각 컴포넌트에서 필요한 필드만 구독하여 최적화된 렌더링을 제공합니다
|
|
43
|
+
* Focuses only on data sharing and provides optimized rendering by subscribing only to necessary fields in each component
|
|
44
|
+
*
|
|
45
|
+
* @template T FormaState 데이터의 타입 / FormaState data type
|
|
46
|
+
* @param props 글로벌 FormaState 설정 옵션 / Global FormaState configuration options
|
|
47
|
+
* @returns 글로벌 FormaState 관리 API 객체 / Global FormaState management API object
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```typescript
|
|
51
|
+
* // 글로벌 상태 정의
|
|
52
|
+
* interface AppState {
|
|
53
|
+
* user: { name: string; email: string };
|
|
54
|
+
* settings: { theme: 'light' | 'dark'; notifications: boolean };
|
|
55
|
+
* cart: { items: any[]; total: number };
|
|
56
|
+
* }
|
|
57
|
+
*
|
|
58
|
+
* // 컴포넌트 A - 사용자 정보만 구독
|
|
59
|
+
* function UserProfile() {
|
|
60
|
+
* const state = useGlobalFormaState<AppState>({ stateId: 'app-state' });
|
|
61
|
+
* const userName = state.useValue('user.name'); // name 변경시만 리렌더
|
|
62
|
+
* const userEmail = state.useValue('user.email'); // email 변경시만 리렌더
|
|
63
|
+
*
|
|
64
|
+
* return (
|
|
65
|
+
* <div>
|
|
66
|
+
* <h1>{userName}</h1>
|
|
67
|
+
* <p>{userEmail}</p>
|
|
68
|
+
* <button onClick={() => state.setValue('user.name', 'New Name')}>
|
|
69
|
+
* Update Name
|
|
70
|
+
* </button>
|
|
71
|
+
* </div>
|
|
72
|
+
* );
|
|
73
|
+
* }
|
|
74
|
+
*
|
|
75
|
+
* // 컴포넌트 B - 설정만 구독
|
|
76
|
+
* function Settings() {
|
|
77
|
+
* const state = useGlobalFormaState<AppState>({ stateId: 'app-state' });
|
|
78
|
+
* const theme = state.useValue('settings.theme'); // theme 변경시만 리렌더
|
|
79
|
+
* const notifications = state.useValue('settings.notifications'); // notifications 변경시만 리렌더
|
|
80
|
+
*
|
|
81
|
+
* return (
|
|
82
|
+
* <div>
|
|
83
|
+
* <select
|
|
84
|
+
* value={theme}
|
|
85
|
+
* onChange={(e) => state.setValue('settings.theme', e.target.value)}
|
|
86
|
+
* >
|
|
87
|
+
* <option value="light">Light</option>
|
|
88
|
+
* <option value="dark">Dark</option>
|
|
89
|
+
* </select>
|
|
90
|
+
* </div>
|
|
91
|
+
* );
|
|
92
|
+
* }
|
|
93
|
+
*
|
|
94
|
+
* // 컴포넌트 C - 장바구니만 구독
|
|
95
|
+
* function Cart() {
|
|
96
|
+
* const state = useGlobalFormaState<AppState>({ stateId: 'app-state' });
|
|
97
|
+
* const cartItems = state.useValue('cart.items'); // cart.items 변경시만 리렌더
|
|
98
|
+
* const cartTotal = state.useValue('cart.total'); // cart.total 변경시만 리렌더
|
|
99
|
+
*
|
|
100
|
+
* return (
|
|
101
|
+
* <div>
|
|
102
|
+
* <h2>Cart ({cartItems.length} items)</h2>
|
|
103
|
+
* <p>Total: ${cartTotal}</p>
|
|
104
|
+
* </div>
|
|
105
|
+
* );
|
|
106
|
+
* }
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
function useGlobalFormaState({ stateId, autoCleanup = true, }) {
|
|
110
|
+
const { getOrCreateStore } = (0, react_1.useContext)(GlobalFormContext_1.GlobalFormContext);
|
|
111
|
+
// 글로벌 스토어 가져오기 또는 생성 / Get or create global store
|
|
112
|
+
const store = getOrCreateStore(stateId);
|
|
113
|
+
// useFormaState에 외부 스토어 전달 (빈 초기값으로) / Pass external store to useFormaState (with empty initial values)
|
|
114
|
+
const formaState = (0, useFormaState_1.useFormaState)({}, {
|
|
115
|
+
_externalStore: store,
|
|
116
|
+
});
|
|
117
|
+
return {
|
|
118
|
+
...formaState,
|
|
119
|
+
stateId, // 글로벌 FormaState ID 추가 제공 / Provide additional global FormaState ID
|
|
120
|
+
_store: store, // 글로벌 스토어 직접 접근용 (이미 formaState에 있지만 명시적으로 재정의) / Direct access to global store
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=useGlobalFormaState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGlobalFormaState.js","sourceRoot":"","sources":["../../hooks/useGlobalFormaState.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;;AAmFH,kDAmBC;AApGD,iCAAmC;AACnC,mDAAgD;AAKhD,qEAAkE;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH,SAAgB,mBAAmB,CAAgC,EAC/D,OAAO,EACP,WAAW,GAAG,IAAI,GACQ;IAC1B,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAA,kBAAU,EAAC,qCAAiB,CAAC,CAAC;IAE3D,kDAAkD;IAClD,MAAM,KAAK,GAAG,gBAAgB,CAAI,OAAO,CAAC,CAAC;IAE3C,wGAAwG;IACxG,MAAM,UAAU,GAAG,IAAA,6BAAa,EAAI,EAAO,EAAE;QACzC,cAAc,EAAE,KAAK;KACxB,CAAC,CAAC;IAEH,OAAO;QACH,GAAG,UAAU;QACb,OAAO,EAAE,oEAAoE;QAC7E,MAAM,EAAE,KAAK,EAAE,gFAAgF;KAClE,CAAC;AACtC,CAAC"}
|