@ehfuse/forma 1.0.4 → 1.2.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.
- package/README.md +107 -59
- package/dist/esm/hooks/useForm.d.ts +2 -4
- package/dist/esm/hooks/useForm.d.ts.map +1 -1
- package/dist/esm/hooks/useForm.js +36 -71
- package/dist/esm/hooks/useForm.js.map +1 -1
- package/dist/esm/hooks/useFormaState.d.ts +79 -0
- package/dist/esm/hooks/useFormaState.d.ts.map +1 -0
- package/dist/esm/hooks/useFormaState.js +154 -0
- package/dist/esm/hooks/useFormaState.js.map +1 -0
- package/dist/esm/index.d.ts +4 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/hooks/useForm.d.ts +2 -4
- package/dist/hooks/useForm.d.ts.map +1 -1
- package/dist/hooks/useForm.js +35 -70
- package/dist/hooks/useForm.js.map +1 -1
- package/dist/hooks/useFormaState.d.ts +79 -0
- package/dist/hooks/useFormaState.d.ts.map +1 -0
- package/dist/hooks/useFormaState.js +157 -0
- package/dist/hooks/useFormaState.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* useFormaState.ts
|
|
4
|
+
*
|
|
5
|
+
* Advanced state management hook with individual field subscriptions
|
|
6
|
+
* Optimized for arrays, objects, and complex nested data structures
|
|
7
|
+
*
|
|
8
|
+
* @author KIM YOUNG JIN (ehfuse@gmail.com)
|
|
9
|
+
* @license MIT License
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.useFormaState = useFormaState;
|
|
13
|
+
const react_1 = require("react");
|
|
14
|
+
const FieldStore_1 = require("../core/FieldStore");
|
|
15
|
+
const dotNotation_1 = require("../utils/dotNotation");
|
|
16
|
+
/**
|
|
17
|
+
* Individual field subscription for useFormaState
|
|
18
|
+
* 개별 필드 구독을 위한 내부 함수
|
|
19
|
+
*/
|
|
20
|
+
function useFieldValue(store, fieldName) {
|
|
21
|
+
const [value, setValue] = (0, react_1.useState)(() => store.getValue(fieldName));
|
|
22
|
+
(0, react_1.useEffect)(() => {
|
|
23
|
+
// 구독 설정 / Setup subscription
|
|
24
|
+
const unsubscribe = store.subscribe(fieldName, () => {
|
|
25
|
+
const newValue = store.getValue(fieldName);
|
|
26
|
+
setValue(newValue);
|
|
27
|
+
});
|
|
28
|
+
return unsubscribe;
|
|
29
|
+
}, [fieldName]); // store 의존성 제거로 불필요한 재구독 방지 / Remove store dependency to prevent unnecessary re-subscriptions
|
|
30
|
+
return value;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Advanced state management hook with individual field subscriptions
|
|
34
|
+
* 개별 필드 구독을 통한 고급 상태 관리 훅
|
|
35
|
+
*
|
|
36
|
+
* Optimized for managing complex arrays, objects, and nested data structures
|
|
37
|
+
* where you want to avoid unnecessary re-renders when only specific fields change.
|
|
38
|
+
*
|
|
39
|
+
* 복잡한 배열, 객체, 중첩된 데이터 구조를 관리하는 데 최적화되어 있으며,
|
|
40
|
+
* 특정 필드만 변경될 때 불필요한 재렌더링을 방지하고자 할 때 사용합니다.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```typescript
|
|
44
|
+
* // Managing an array of users
|
|
45
|
+
* const state = useFormaState({
|
|
46
|
+
* initialValues: {
|
|
47
|
+
* users: [
|
|
48
|
+
* { name: 'John', email: 'john@example.com', age: 30 },
|
|
49
|
+
* { name: 'Jane', email: 'jane@example.com', age: 25 }
|
|
50
|
+
* ],
|
|
51
|
+
* settings: { theme: 'dark', notifications: true }
|
|
52
|
+
* }
|
|
53
|
+
* });
|
|
54
|
+
*
|
|
55
|
+
* // Subscribe to individual fields - only these components re-render when changed
|
|
56
|
+
* const firstName = state.useValue('users.0.name'); // Only re-renders when John's name changes
|
|
57
|
+
* const userAge = state.useValue('users.1.age'); // Only re-renders when Jane's age changes
|
|
58
|
+
* const theme = state.useValue('settings.theme'); // Only re-renders when theme changes
|
|
59
|
+
*
|
|
60
|
+
* // Update specific fields
|
|
61
|
+
* state.setValue('users.0.name', 'Johnny');
|
|
62
|
+
* state.setValue('settings.theme', 'light');
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
function useFormaState(initialValues, options = {}) {
|
|
66
|
+
const { onChange, deepEquals = false, _externalStore } = options;
|
|
67
|
+
// Create or use external field store instance (persists across renders)
|
|
68
|
+
// 필드 스토어 인스턴스 생성 또는 외부 스토어 사용 (렌더링 간 유지)
|
|
69
|
+
const storeRef = (0, react_1.useRef)(null);
|
|
70
|
+
if (_externalStore) {
|
|
71
|
+
storeRef.current = _externalStore;
|
|
72
|
+
}
|
|
73
|
+
else if (!storeRef.current) {
|
|
74
|
+
storeRef.current = new FieldStore_1.FieldStore(initialValues);
|
|
75
|
+
// Set up global change listener if provided
|
|
76
|
+
// 글로벌 변경 리스너 설정 (제공된 경우)
|
|
77
|
+
if (onChange) {
|
|
78
|
+
storeRef.current.subscribeGlobal(() => {
|
|
79
|
+
onChange(storeRef.current.getValues());
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const store = storeRef.current;
|
|
84
|
+
// Update initial values when they change (only for non-external stores)
|
|
85
|
+
// 초기값이 변경되면 업데이트 (외부 스토어가 아닌 경우에만)
|
|
86
|
+
(0, react_1.useEffect)(() => {
|
|
87
|
+
if (!_externalStore && store) {
|
|
88
|
+
store.setInitialValues(initialValues);
|
|
89
|
+
}
|
|
90
|
+
}, [initialValues, store, _externalStore]);
|
|
91
|
+
// Subscribe to a specific field value with dot notation
|
|
92
|
+
// dot notation으로 특정 필드 값 구독
|
|
93
|
+
const useValue = (0, react_1.useCallback)((path) => {
|
|
94
|
+
return useFieldValue(store, path);
|
|
95
|
+
}, [store]);
|
|
96
|
+
// Set a specific field value with dot notation
|
|
97
|
+
// dot notation으로 특정 필드 값 설정
|
|
98
|
+
const setValue = (0, react_1.useCallback)((path, value) => {
|
|
99
|
+
const currentValues = store.getValues();
|
|
100
|
+
const newValues = (0, dotNotation_1.setNestedValue)(currentValues, path, value);
|
|
101
|
+
store.setValues(newValues);
|
|
102
|
+
}, [store]);
|
|
103
|
+
// Get all current values (non-reactive)
|
|
104
|
+
// 모든 현재 값 가져오기 (반응형 아님)
|
|
105
|
+
const getValues = (0, react_1.useCallback)(() => {
|
|
106
|
+
return store.getValues();
|
|
107
|
+
}, [store]);
|
|
108
|
+
// Set all values at once
|
|
109
|
+
// 모든 값을 한 번에 설정
|
|
110
|
+
const setValues = (0, react_1.useCallback)((values) => {
|
|
111
|
+
const currentValues = store.getValues();
|
|
112
|
+
const newValues = { ...currentValues, ...values };
|
|
113
|
+
store.setValues(newValues);
|
|
114
|
+
}, [store]);
|
|
115
|
+
// Reset to initial values
|
|
116
|
+
// 초기값으로 재설정
|
|
117
|
+
const reset = (0, react_1.useCallback)(() => {
|
|
118
|
+
store.setValues(initialValues);
|
|
119
|
+
}, [store, initialValues]);
|
|
120
|
+
// Handle standard input change events
|
|
121
|
+
// 표준 입력 변경 이벤트 처리
|
|
122
|
+
const handleChange = (0, react_1.useCallback)((event) => {
|
|
123
|
+
const { name, value, type } = event.target;
|
|
124
|
+
if (!name) {
|
|
125
|
+
console.warn('useFormaState.handleChange: input element must have a "name" attribute');
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
let processedValue = value;
|
|
129
|
+
// Handle different input types
|
|
130
|
+
// 다양한 입력 타입 처리
|
|
131
|
+
if (type === "checkbox") {
|
|
132
|
+
processedValue = event.target.checked;
|
|
133
|
+
}
|
|
134
|
+
else if (type === "number") {
|
|
135
|
+
processedValue = value === "" ? "" : Number(value);
|
|
136
|
+
}
|
|
137
|
+
setValue(name, processedValue);
|
|
138
|
+
}, [setValue]);
|
|
139
|
+
// Get reactive values using the store's reactive mechanism
|
|
140
|
+
// 스토어의 반응형 메커니즘을 사용하여 반응형 값 가져오기
|
|
141
|
+
const values = (0, react_1.useMemo)(() => {
|
|
142
|
+
// This creates a reactive subscription to all values
|
|
143
|
+
// 모든 값에 대한 반응형 구독 생성
|
|
144
|
+
return store.getValues();
|
|
145
|
+
}, [store]);
|
|
146
|
+
return {
|
|
147
|
+
useValue,
|
|
148
|
+
setValue,
|
|
149
|
+
getValues,
|
|
150
|
+
setValues,
|
|
151
|
+
reset,
|
|
152
|
+
handleChange,
|
|
153
|
+
_store: store,
|
|
154
|
+
values,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=useFormaState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormaState.js","sourceRoot":"","sources":["../../hooks/useFormaState.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AA4GH,sCA8HC;AAxOD,iCAA0E;AAC1E,mDAAgD;AAChD,sDAAsE;AAmDtE;;;GAGG;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,8FAA8F;IAE/G,OAAO,KAAK,CAAC;A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IAAI,EAAE,CAAC;YACR,OAAO,CAAC,IAAI,CACR,wEAAwE,CAC3E,CAAC;YACF,OAAO;QACX,CAAC;QAED,IAAI,cAAc,GAAQ,KAAK,CAAC;QAEhC,+BAA+B;QAC/B,eAAe;QACf,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;YACtB,cAAc,GAAI,KAAK,CAAC,MAA2B,CAAC,OAAO,CAAC;QAChE,CAAC;aAAM,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC3B,cAAc,GAAG,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvD,CAAC;QAED,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IACnC,CAAC,EACD,CAAC,QAAQ,CAAC,CACb,CAAC;IAEF,2DAA2D;IAC3D,iCAAiC;IACjC,MAAM,MAAM,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QACxB,qDAAqD;QACrD,qBAAqB;QACrB,OAAO,KAAK,CAAC,SAAS,EAAE,CAAC;IAC7B,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO;QACH,QAAQ;QACR,QAAQ;QACR,SAAS;QACT,SAAS;QACT,KAAK;QACL,YAAY;QACZ,MAAM,EAAE,KAAK;QACb,MAAM;KACT,CAAC;AACN,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* index.ts
|
|
3
3
|
*
|
|
4
|
-
* Forma -
|
|
4
|
+
* Forma - Advexport { useFormaState } from './hooks/useFormaState';nced React form state management library
|
|
5
5
|
* Main entry point and API exports
|
|
6
6
|
*
|
|
7
7
|
* @license MIT License
|
|
@@ -29,10 +29,12 @@
|
|
|
29
29
|
export { useForm } from "./hooks/useForm";
|
|
30
30
|
export { useGlobalForm } from "./hooks/useGlobalForm";
|
|
31
31
|
export { useRegisterGlobalForm } from "./hooks/useRegisterGlobalForm";
|
|
32
|
+
export { useFormaState } from "./hooks/useFormaState";
|
|
32
33
|
export { GlobalFormContext, GlobalFormProvider, } from "./contexts/GlobalFormContext";
|
|
33
34
|
export { FieldStore } from "./core/FieldStore";
|
|
34
35
|
export { getNestedValue, setNestedValue } from "./utils/dotNotation";
|
|
35
|
-
export type { UseFormProps, UseFormReturn,
|
|
36
|
+
export type { UseFormProps, UseFormReturn, FormValidationResult, FormChangeEvent, } from "./types/form";
|
|
37
|
+
export type { UseFormaStateOptions, UseFormaStateReturn, } from "./hooks/useFormaState";
|
|
36
38
|
export type { UseGlobalFormProps, UseGlobalFormReturn, GlobalFormProviderProps, GlobalFormContextType, GlobalFormStoreMap, GlobalFormMetadata, GlobalFormEvent, GlobalFormEventListener, GlobalFormConfig, GlobalFormMiddleware, ExtendedGlobalFormProviderProps, } from "./types/globalForm";
|
|
37
39
|
/**
|
|
38
40
|
* Forma library version
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,EACH,iBAAiB,EACjB,kBAAkB,GACrB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAIrE,YAAY,EACR,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,eAAe,GAClB,MAAM,cAAc,CAAC;AAGtB,YAAY,EACR,oBAAoB,EACpB,mBAAmB,GACtB,MAAM,uBAAuB,CAAC;AAG/B,YAAY,EACR,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,+BAA+B,GAClC,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,eAAO,MAAM,aAAa,UAAU,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;CAejB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* index.ts
|
|
4
4
|
*
|
|
5
|
-
* Forma -
|
|
5
|
+
* Forma - Advexport { useFormaState } from './hooks/useFormaState';nced React form state management library
|
|
6
6
|
* Main entry point and API exports
|
|
7
7
|
*
|
|
8
8
|
* @license MIT License
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
* SOFTWARE.
|
|
29
29
|
*/
|
|
30
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.FORMA_METADATA = exports.FORMA_VERSION = exports.setNestedValue = exports.getNestedValue = exports.FieldStore = exports.GlobalFormProvider = exports.GlobalFormContext = exports.useRegisterGlobalForm = exports.useGlobalForm = exports.useForm = void 0;
|
|
31
|
+
exports.FORMA_METADATA = exports.FORMA_VERSION = exports.setNestedValue = exports.getNestedValue = exports.FieldStore = exports.GlobalFormProvider = exports.GlobalFormContext = exports.useFormaState = exports.useRegisterGlobalForm = exports.useGlobalForm = exports.useForm = void 0;
|
|
32
32
|
// ===== Core Hooks =====
|
|
33
33
|
var useForm_1 = require("./hooks/useForm");
|
|
34
34
|
Object.defineProperty(exports, "useForm", { enumerable: true, get: function () { return useForm_1.useForm; } });
|
|
@@ -36,6 +36,8 @@ var useGlobalForm_1 = require("./hooks/useGlobalForm");
|
|
|
36
36
|
Object.defineProperty(exports, "useGlobalForm", { enumerable: true, get: function () { return useGlobalForm_1.useGlobalForm; } });
|
|
37
37
|
var useRegisterGlobalForm_1 = require("./hooks/useRegisterGlobalForm");
|
|
38
38
|
Object.defineProperty(exports, "useRegisterGlobalForm", { enumerable: true, get: function () { return useRegisterGlobalForm_1.useRegisterGlobalForm; } });
|
|
39
|
+
var useFormaState_1 = require("./hooks/useFormaState");
|
|
40
|
+
Object.defineProperty(exports, "useFormaState", { enumerable: true, get: function () { return useFormaState_1.useFormaState; } });
|
|
39
41
|
// ===== Context & Providers =====
|
|
40
42
|
var GlobalFormContext_1 = require("./contexts/GlobalFormContext");
|
|
41
43
|
Object.defineProperty(exports, "GlobalFormContext", { enumerable: true, get: function () { return GlobalFormContext_1.GlobalFormContext; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;;;AAEH,yBAAyB;AACzB,2CAA0C;AAAjC,kGAAA,OAAO,OAAA;AAChB,uDAAsD;AAA7C,8GAAA,aAAa,OAAA;AACtB,uEAAsE;AAA7D,8HAAA,qBAAqB,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;;;AAEH,yBAAyB;AACzB,2CAA0C;AAAjC,kGAAA,OAAO,OAAA;AAChB,uDAAsD;AAA7C,8GAAA,aAAa,OAAA;AACtB,uEAAsE;AAA7D,8HAAA,qBAAqB,OAAA;AAC9B,uDAAsD;AAA7C,8GAAA,aAAa,OAAA;AAEtB,kCAAkC;AAClC,kEAGsC;AAFlC,sHAAA,iBAAiB,OAAA;AACjB,uHAAA,kBAAkB,OAAA;AAGtB,2BAA2B;AAC3B,gDAA+C;AAAtC,wGAAA,UAAU,OAAA;AAEnB,gCAAgC;AAChC,mDAAqE;AAA5D,6GAAA,cAAc,OAAA;AAAE,6GAAA,cAAc,OAAA;AAgCvC;;GAEG;AACU,QAAA,aAAa,GAAG,OAAO,CAAC;AAErC;;GAEG;AACU,QAAA,cAAc,GAAG;IAC1B,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,qBAAa;IACtB,WAAW,EAAE,8CAA8C;IAC3D,MAAM,EAAE,+BAA+B;IACvC,KAAK,EAAE,kBAAkB;IACzB,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE;QACN,4DAA4D;QAC5D,kDAAkD;QAClD,wCAAwC;QACxC,8BAA8B;QAC9B,6BAA6B;QAC7B,qCAAqC;KACxC;CACK,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ehfuse/forma",
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"description": "Advanced React
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "Advanced React state management library with individual field subscriptions - supports both forms and general state management with useFormaState",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|