@akinon/akifilter 1.2.0-next.5 → 1.2.0-next.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"akifilter.d.ts","sourceRoot":"","sources":["../../src/akifilter.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAGtB,OAAO,EAIL,WAAW,EAEX,IAAI,EAGL,MAAM,iBAAiB,CAAC;AAWzB,OAAO,KAAK,MAAM,OAAO,CAAC;AA0B1B,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,SAAS,CAAC;AAY/D,KAAK,oBAAoB,GAAG,WAAW,CAAC;AA2DxC,MAAM,MAAM,cAAc,CACxB,YAAY,SAAS,oBAAoB,GAAG,oBAAoB,IAC9D;IACF;;OAEG;IACH,YAAY,CAAC,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;IAC7C;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACtC;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IACzD;;OAEG;IACH,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,KAAK,IAAI,CAAC;IAClE;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;
|
|
1
|
+
{"version":3,"file":"akifilter.d.ts","sourceRoot":"","sources":["../../src/akifilter.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAGtB,OAAO,EAIL,WAAW,EAEX,IAAI,EAGL,MAAM,iBAAiB,CAAC;AAWzB,OAAO,KAAK,MAAM,OAAO,CAAC;AA0B1B,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,SAAS,CAAC;AAY/D,KAAK,oBAAoB,GAAG,WAAW,CAAC;AA2DxC,MAAM,MAAM,cAAc,CACxB,YAAY,SAAS,oBAAoB,GAAG,oBAAoB,IAC9D;IACF;;OAEG;IACH,YAAY,CAAC,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;IAC7C;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACtC;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IACzD;;OAEG;IACH,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,KAAK,IAAI,CAAC;IAClE;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAiwBF,eAAO,MAAM,SAAS;KACpB,YAAY,SAAS,oBAAoB,uBAElC,cAAc,CAAC,YAAY,CAAC;;CAmBpC,CAAC"}
|
package/dist/cjs/akifilter.js
CHANGED
|
@@ -268,13 +268,33 @@ const AkifilterContent = ({ filterSchema, storageNamespace, defaultValues, onVal
|
|
|
268
268
|
const removedKeys = prevKeys.filter(key => !currKeys.includes(key));
|
|
269
269
|
// If a field was removed, immediately persist and emit (bypass debounce)
|
|
270
270
|
if (removedKeys.length > 0) {
|
|
271
|
+
// Sync form state for removed fields
|
|
272
|
+
removedKeys.forEach(key => {
|
|
273
|
+
const field = flattenedSchema.find(f => String(f.key) === key);
|
|
274
|
+
if (field) {
|
|
275
|
+
const defaultValue = schemaDefaults[key];
|
|
276
|
+
const nextValue = resolveClearedFieldValue(field, defaultValue);
|
|
277
|
+
formMethods.setValue(field.key, nextValue, {
|
|
278
|
+
shouldDirty: false,
|
|
279
|
+
shouldTouch: false,
|
|
280
|
+
shouldValidate: false
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
});
|
|
271
284
|
const nextSerialised = current;
|
|
272
285
|
persistValues(currParsed, nextSerialised);
|
|
273
286
|
lastPersistedValuesRef.current = nextSerialised;
|
|
274
287
|
currentSerialisedValuesRef.current = nextSerialised;
|
|
275
288
|
onValuesChange === null || onValuesChange === void 0 ? void 0 : onValuesChange(currParsed);
|
|
276
289
|
}
|
|
277
|
-
}, [
|
|
290
|
+
}, [
|
|
291
|
+
serialisedValues,
|
|
292
|
+
onValuesChange,
|
|
293
|
+
persistValues,
|
|
294
|
+
flattenedSchema,
|
|
295
|
+
schemaDefaults,
|
|
296
|
+
formMethods
|
|
297
|
+
]);
|
|
278
298
|
const handleClearAll = react_1.default.useCallback(() => {
|
|
279
299
|
const clearedDefaults = Object.assign({}, schemaDefaults);
|
|
280
300
|
flattenedSchema.forEach(field => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"akifilter.d.ts","sourceRoot":"","sources":["../../src/akifilter.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAGtB,OAAO,EAIL,WAAW,EAEX,IAAI,EAGL,MAAM,iBAAiB,CAAC;AAWzB,OAAO,KAAK,MAAM,OAAO,CAAC;AA0B1B,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,SAAS,CAAC;AAY/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;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACtC;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IACzD;;OAEG;IACH,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,KAAK,IAAI,CAAC;IAClE;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAiwBF,eAAO,MAAM,SAAS;KACpB,YAAY,SAAS,oBAAoB,uBAElC,cAAc,CAAC,YAAY,CAAC;;CAmBpC,CAAC"}
|
package/dist/esm/akifilter.js
CHANGED
|
@@ -265,13 +265,33 @@ const AkifilterContent = ({ filterSchema, storageNamespace, defaultValues, onVal
|
|
|
265
265
|
const removedKeys = prevKeys.filter(key => !currKeys.includes(key));
|
|
266
266
|
// If a field was removed, immediately persist and emit (bypass debounce)
|
|
267
267
|
if (removedKeys.length > 0) {
|
|
268
|
+
// Sync form state for removed fields
|
|
269
|
+
removedKeys.forEach(key => {
|
|
270
|
+
const field = flattenedSchema.find(f => String(f.key) === key);
|
|
271
|
+
if (field) {
|
|
272
|
+
const defaultValue = schemaDefaults[key];
|
|
273
|
+
const nextValue = resolveClearedFieldValue(field, defaultValue);
|
|
274
|
+
formMethods.setValue(field.key, nextValue, {
|
|
275
|
+
shouldDirty: false,
|
|
276
|
+
shouldTouch: false,
|
|
277
|
+
shouldValidate: false
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
});
|
|
268
281
|
const nextSerialised = current;
|
|
269
282
|
persistValues(currParsed, nextSerialised);
|
|
270
283
|
lastPersistedValuesRef.current = nextSerialised;
|
|
271
284
|
currentSerialisedValuesRef.current = nextSerialised;
|
|
272
285
|
onValuesChange === null || onValuesChange === void 0 ? void 0 : onValuesChange(currParsed);
|
|
273
286
|
}
|
|
274
|
-
}, [
|
|
287
|
+
}, [
|
|
288
|
+
serialisedValues,
|
|
289
|
+
onValuesChange,
|
|
290
|
+
persistValues,
|
|
291
|
+
flattenedSchema,
|
|
292
|
+
schemaDefaults,
|
|
293
|
+
formMethods
|
|
294
|
+
]);
|
|
275
295
|
const handleClearAll = React.useCallback(() => {
|
|
276
296
|
const clearedDefaults = Object.assign({}, schemaDefaults);
|
|
277
297
|
flattenedSchema.forEach(field => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/akifilter",
|
|
3
|
-
"version": "1.2.0-next.
|
|
3
|
+
"version": "1.2.0-next.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Akifilter is a filtering library for Akinon frontend applications.",
|
|
6
6
|
"type": "module",
|
|
@@ -12,33 +12,33 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"antd": "^5.27.0",
|
|
14
14
|
"react-error-boundary": "^6.0.0",
|
|
15
|
+
"@akinon/akidate": "1.1.3-next.0",
|
|
15
16
|
"@akinon/akiform": "1.1.2",
|
|
16
17
|
"@akinon/akilocale": "1.2.1",
|
|
17
18
|
"@akinon/icons": "1.1.2-next.1",
|
|
18
19
|
"@akinon/ui-button": "1.4.0-next.1",
|
|
19
20
|
"@akinon/ui-card": "1.1.3-next.1",
|
|
20
21
|
"@akinon/ui-checkbox": "1.3.3-next.1",
|
|
21
|
-
"@akinon/akidate": "1.1.3-next.0",
|
|
22
|
-
"@akinon/ui-collapse": "1.3.2-next.1",
|
|
23
22
|
"@akinon/ui-date-picker": "1.3.3-next.1",
|
|
23
|
+
"@akinon/ui-input": "1.1.3-next.1",
|
|
24
24
|
"@akinon/ui-input-number": "1.3.3-next.1",
|
|
25
|
+
"@akinon/ui-modal": "1.1.3-next.1",
|
|
26
|
+
"@akinon/ui-collapse": "1.3.2-next.1",
|
|
25
27
|
"@akinon/ui-pagination": "1.3.4-next.1",
|
|
26
28
|
"@akinon/ui-space": "1.3.3-next.1",
|
|
27
29
|
"@akinon/ui-select": "1.3.4-next.1",
|
|
28
|
-
"@akinon/ui-
|
|
29
|
-
"@akinon/ui-typography": "1.1.2-next.0",
|
|
30
|
-
"@akinon/ui-modal": "1.1.3-next.1"
|
|
30
|
+
"@akinon/ui-typography": "1.1.2-next.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"clean-package": "2.2.0",
|
|
34
34
|
"copyfiles": "^2.4.1",
|
|
35
35
|
"rimraf": "^5.0.5",
|
|
36
36
|
"typescript": "*",
|
|
37
|
-
"@akinon/typescript-config": "1.1.1",
|
|
38
37
|
"@akinon/akiform-builder": "1.3.5-next.1",
|
|
38
|
+
"@akinon/typescript-config": "1.1.1",
|
|
39
39
|
"@akinon/ui-theme": "1.1.3-next.1",
|
|
40
|
-
"@akinon/
|
|
41
|
-
"@akinon/
|
|
40
|
+
"@akinon/vitest-config": "1.1.1",
|
|
41
|
+
"@akinon/utils": "1.1.4-next.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"react": "^18 || ^19",
|