@akinon/akifilter 1.0.4 → 1.0.5
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/dist/cjs/akifilter.d.ts.map +1 -1
- package/dist/cjs/akifilter.js +29 -6
- package/dist/cjs/common/storage.d.ts.map +1 -1
- package/dist/cjs/common/storage.js +7 -6
- package/dist/cjs/constants.d.ts +6 -0
- package/dist/cjs/constants.d.ts.map +1 -1
- package/dist/cjs/constants.js +7 -1
- package/dist/cjs/i18n/translations/en.d.ts +8 -0
- package/dist/cjs/i18n/translations/en.d.ts.map +1 -1
- package/dist/cjs/i18n/translations/en.js +9 -1
- package/dist/cjs/i18n/translations/tr.d.ts +8 -0
- package/dist/cjs/i18n/translations/tr.d.ts.map +1 -1
- package/dist/cjs/i18n/translations/tr.js +9 -1
- package/dist/cjs/utils/values.d.ts.map +1 -1
- package/dist/cjs/utils/values.js +5 -1
- package/dist/esm/akifilter.d.ts.map +1 -1
- package/dist/esm/akifilter.js +30 -7
- package/dist/esm/common/storage.d.ts.map +1 -1
- package/dist/esm/common/storage.js +7 -6
- package/dist/esm/constants.d.ts +6 -0
- package/dist/esm/constants.d.ts.map +1 -1
- package/dist/esm/constants.js +6 -0
- package/dist/esm/i18n/translations/en.d.ts +8 -0
- package/dist/esm/i18n/translations/en.d.ts.map +1 -1
- package/dist/esm/i18n/translations/en.js +9 -1
- package/dist/esm/i18n/translations/tr.d.ts +8 -0
- package/dist/esm/i18n/translations/tr.d.ts.map +1 -1
- package/dist/esm/i18n/translations/tr.js +9 -1
- package/dist/esm/utils/values.d.ts.map +1 -1
- package/dist/esm/utils/values.js +5 -1
- package/package.json +21 -21
|
@@ -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;AAUzB,OAAO,KAAK,MAAM,OAAO,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;AAUzB,OAAO,KAAK,MAAM,OAAO,CAAC;AA2B1B,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,SAAS,CAAC;AAU/D,KAAK,oBAAoB,GAAG,WAAW,CAAC;AA2BxC,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;AAqnBF,eAAO,MAAM,SAAS;KACpB,YAAY,SAAS,oBAAoB,uBAElC,cAAc,CAAC,YAAY,CAAC;;CAmBpC,CAAC"}
|
package/dist/cjs/akifilter.js
CHANGED
|
@@ -107,14 +107,17 @@ const AkifilterContent = ({ filterSchema, storageNamespace, defaultValues, onVal
|
|
|
107
107
|
if (field.type === 'date') {
|
|
108
108
|
const iso = akidate_1.akidate.toIsoDate(currentValue);
|
|
109
109
|
if (iso) {
|
|
110
|
-
|
|
110
|
+
// Use localized format with time if showTime is enabled
|
|
111
|
+
const hasShowTime = 'showTime' in field && field.showTime;
|
|
112
|
+
const format = hasShowTime ? 'L LTS' : 'YYYY-MM-DD';
|
|
113
|
+
return akidate_1.akidate.formatIsoDate(iso, format);
|
|
111
114
|
}
|
|
112
115
|
}
|
|
113
116
|
if (Array.isArray(currentValue)) {
|
|
114
117
|
return currentValue.map((value) => String(value)).join(', ');
|
|
115
118
|
}
|
|
116
119
|
if (typeof currentValue === 'boolean') {
|
|
117
|
-
return currentValue ?
|
|
120
|
+
return currentValue ? constants_1.BOOLEAN_STRING.TRUE : constants_1.BOOLEAN_STRING.FALSE;
|
|
118
121
|
}
|
|
119
122
|
if (typeof currentValue === 'string' ||
|
|
120
123
|
typeof currentValue === 'number') {
|
|
@@ -122,7 +125,7 @@ const AkifilterContent = ({ filterSchema, storageNamespace, defaultValues, onVal
|
|
|
122
125
|
}
|
|
123
126
|
const iso = akidate_1.akidate.toIsoDate(currentValue);
|
|
124
127
|
if (iso) {
|
|
125
|
-
return akidate_1.akidate.formatIsoDate(iso,
|
|
128
|
+
return akidate_1.akidate.formatIsoDate(iso, constants_1.DATE_FORMAT);
|
|
126
129
|
}
|
|
127
130
|
return String(currentValue);
|
|
128
131
|
};
|
|
@@ -174,14 +177,25 @@ const AkifilterContent = ({ filterSchema, storageNamespace, defaultValues, onVal
|
|
|
174
177
|
(0, storage_1.writeStoredValues)(storageKey, values);
|
|
175
178
|
return nextSerialised;
|
|
176
179
|
}, [storageKey]);
|
|
180
|
+
// Use a ref to track the current serialised values for staleness checks
|
|
181
|
+
const currentSerialisedValuesRef = react_1.default.useRef(serialisedValues);
|
|
182
|
+
react_1.default.useEffect(() => {
|
|
183
|
+
currentSerialisedValuesRef.current = serialisedValues;
|
|
184
|
+
}, [serialisedValues]);
|
|
177
185
|
react_1.default.useEffect(() => {
|
|
178
186
|
if (debouncedSerialisedValues == null) {
|
|
179
187
|
return;
|
|
180
188
|
}
|
|
189
|
+
// Skip if we've already processed this exact debounced value
|
|
181
190
|
if (hasEmittedValuesRef.current &&
|
|
182
191
|
lastPersistedValuesRef.current === debouncedSerialisedValues) {
|
|
183
192
|
return;
|
|
184
193
|
}
|
|
194
|
+
// Skip if the debounced value is stale (doesn't match current state)
|
|
195
|
+
// This prevents old debounced values from overwriting manual updates
|
|
196
|
+
if (currentSerialisedValuesRef.current !== debouncedSerialisedValues) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
185
199
|
const parsedValues = JSON.parse(debouncedSerialisedValues);
|
|
186
200
|
const isEmpty = Object.keys(parsedValues).length === 0;
|
|
187
201
|
if (!hasEmittedValuesRef.current &&
|
|
@@ -251,16 +265,25 @@ const AkifilterContent = ({ filterSchema, storageNamespace, defaultValues, onVal
|
|
|
251
265
|
const defaultValue = baseDefaultValues[String(schemaField.key)];
|
|
252
266
|
const fieldPath = schemaField.key;
|
|
253
267
|
const nextValue = resolveClearedFieldValue(schemaField, defaultValue);
|
|
268
|
+
// Update the form value
|
|
254
269
|
formMethods.setValue(fieldPath, nextValue, {
|
|
255
270
|
shouldDirty: false,
|
|
256
271
|
shouldTouch: false,
|
|
257
272
|
shouldValidate: false
|
|
258
273
|
});
|
|
259
|
-
|
|
260
|
-
const
|
|
274
|
+
// Compute the updated values immediately (don't wait for debounce)
|
|
275
|
+
const currentValues = formMethods.getValues() || {};
|
|
276
|
+
const updatedFormValues = Object.assign(Object.assign({}, currentValues), { [fieldPath]: nextValue });
|
|
277
|
+
const nextValues = (0, values_1.normaliseOutputValues)(filterSchema, updatedFormValues);
|
|
278
|
+
const nextSerialised = JSON.stringify(nextValues);
|
|
279
|
+
// Persist immediately (bypass debounce for remove action)
|
|
280
|
+
persistValues(nextValues);
|
|
281
|
+
// Update refs to mark this as the latest persisted state
|
|
282
|
+
lastPersistedValuesRef.current = nextSerialised;
|
|
283
|
+
currentSerialisedValuesRef.current = nextSerialised;
|
|
261
284
|
hasEmittedValuesRef.current = true;
|
|
262
|
-
lastPersistedValuesRef.current = nextSerialised !== null && nextSerialised !== void 0 ? nextSerialised : null;
|
|
263
285
|
hasInitialValuesRef.current = Object.keys(nextValues).length > 0;
|
|
286
|
+
// Emit the change to parent
|
|
264
287
|
onValuesChange === null || onValuesChange === void 0 ? void 0 : onValuesChange(nextValues);
|
|
265
288
|
}, [
|
|
266
289
|
baseDefaultValues,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/common/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/common/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAqB/C,eAAO,MAAM,eAAe,GAAI,YAAY,SAAS,WAAW,EAC9D,QAAQ,cAAc,CAAC,YAAY,CAAC,EAAE,EACtC,YAAY,MAAM,KACjB,MAKF,CAAC;AAIF,eAAO,MAAM,eAAe,GAAI,YAAY,SAAS,WAAW,EAC9D,QAAQ,cAAc,CAAC,YAAY,CAAC,EAAE,EACtC,YAAY,MAAM,KACjB,MAAM,EAAE,GAAG,IAoBb,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,YAAY,MAAM,EAAE,MAAM,MAAM,EAAE,KAAG,IAQrE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,YAAY,MAAM,KAAG,IAQrD,CAAC;AAKF,eAAO,MAAM,gBAAgB,GAAI,YAAY,SAAS,WAAW,EAC/D,QAAQ,cAAc,CAAC,YAAY,CAAC,EAAE,EACtC,YAAY,MAAM,KACjB,OAAO,CAAC,YAAY,CAAC,GAAG,IA+B1B,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,YAAY,SAAS,WAAW,EAChE,YAAY,MAAM,EAClB,QAAQ,OAAO,CAAC,YAAY,CAAC,KAC5B,IAeF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,YAAY,MAAM,KAAG,IAQtD,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.clearStoredValues = exports.writeStoredValues = exports.readStoredValues = exports.clearVisibleKeys = exports.writeVisibleKeys = exports.readVisibleKeys = exports.buildStorageKey = void 0;
|
|
4
|
+
const i18n_1 = require("../i18n");
|
|
4
5
|
const STORAGE_PREFIX = 'akifilter:v1';
|
|
5
6
|
const VALUES_SUFFIX = ':values';
|
|
6
7
|
const hashString = (value) => {
|
|
@@ -39,7 +40,7 @@ const readVisibleKeys = (schema, storageKey) => {
|
|
|
39
40
|
return parsed.filter(key => schemaKeys.has(String(key)));
|
|
40
41
|
}
|
|
41
42
|
catch (error) {
|
|
42
|
-
console.warn('
|
|
43
|
+
console.warn(i18n_1.i18n.t('errors.storage.readVisibility'), error);
|
|
43
44
|
return null;
|
|
44
45
|
}
|
|
45
46
|
};
|
|
@@ -51,7 +52,7 @@ const writeVisibleKeys = (storageKey, keys) => {
|
|
|
51
52
|
window.localStorage.setItem(storageKey, JSON.stringify(keys));
|
|
52
53
|
}
|
|
53
54
|
catch (error) {
|
|
54
|
-
console.warn('
|
|
55
|
+
console.warn(i18n_1.i18n.t('errors.storage.writeVisibility'), error);
|
|
55
56
|
}
|
|
56
57
|
};
|
|
57
58
|
exports.writeVisibleKeys = writeVisibleKeys;
|
|
@@ -62,7 +63,7 @@ const clearVisibleKeys = (storageKey) => {
|
|
|
62
63
|
window.localStorage.removeItem(storageKey);
|
|
63
64
|
}
|
|
64
65
|
catch (error) {
|
|
65
|
-
console.warn('
|
|
66
|
+
console.warn(i18n_1.i18n.t('errors.storage.clearVisibility'), error);
|
|
66
67
|
}
|
|
67
68
|
};
|
|
68
69
|
exports.clearVisibleKeys = clearVisibleKeys;
|
|
@@ -89,7 +90,7 @@ const readStoredValues = (schema, storageKey) => {
|
|
|
89
90
|
}, {});
|
|
90
91
|
}
|
|
91
92
|
catch (error) {
|
|
92
|
-
console.warn('
|
|
93
|
+
console.warn(i18n_1.i18n.t('errors.storage.readValues'), error);
|
|
93
94
|
return null;
|
|
94
95
|
}
|
|
95
96
|
};
|
|
@@ -107,7 +108,7 @@ const writeStoredValues = (storageKey, values) => {
|
|
|
107
108
|
window.localStorage.setItem(valuesKey, JSON.stringify(values));
|
|
108
109
|
}
|
|
109
110
|
catch (error) {
|
|
110
|
-
console.warn('
|
|
111
|
+
console.warn(i18n_1.i18n.t('errors.storage.writeValues'), error);
|
|
111
112
|
}
|
|
112
113
|
};
|
|
113
114
|
exports.writeStoredValues = writeStoredValues;
|
|
@@ -118,7 +119,7 @@ const clearStoredValues = (storageKey) => {
|
|
|
118
119
|
window.localStorage.removeItem(buildValuesStorageKey(storageKey));
|
|
119
120
|
}
|
|
120
121
|
catch (error) {
|
|
121
|
-
console.warn('
|
|
122
|
+
console.warn(i18n_1.i18n.t('errors.storage.clearValues'), error);
|
|
122
123
|
}
|
|
123
124
|
};
|
|
124
125
|
exports.clearStoredValues = clearStoredValues;
|
package/dist/cjs/constants.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export declare const DEFAULT_VISIBLE_COUNT = 8;
|
|
2
2
|
export declare const DEFAULT_MODAL_PAGE_SIZE = 40;
|
|
3
3
|
export declare const FILTER_DEBOUNCE_DELAY = 300;
|
|
4
|
+
export declare const DATE_FORMAT = "YYYY-MM-DD";
|
|
5
|
+
export declare const DATETIME_FORMAT = "YYYY-MM-DD HH:mm:ss";
|
|
6
|
+
export declare const BOOLEAN_STRING: {
|
|
7
|
+
readonly TRUE: "true";
|
|
8
|
+
readonly FALSE: "false";
|
|
9
|
+
};
|
|
4
10
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,eAAO,MAAM,qBAAqB,MAAM,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC,eAAO,MAAM,WAAW,eAAe,CAAC;AACxC,eAAO,MAAM,eAAe,wBAAwB,CAAC;AAErD,eAAO,MAAM,cAAc;;;CAGjB,CAAC"}
|
package/dist/cjs/constants.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FILTER_DEBOUNCE_DELAY = exports.DEFAULT_MODAL_PAGE_SIZE = exports.DEFAULT_VISIBLE_COUNT = void 0;
|
|
3
|
+
exports.BOOLEAN_STRING = exports.DATETIME_FORMAT = exports.DATE_FORMAT = exports.FILTER_DEBOUNCE_DELAY = exports.DEFAULT_MODAL_PAGE_SIZE = exports.DEFAULT_VISIBLE_COUNT = void 0;
|
|
4
4
|
exports.DEFAULT_VISIBLE_COUNT = 8;
|
|
5
5
|
exports.DEFAULT_MODAL_PAGE_SIZE = 40;
|
|
6
6
|
exports.FILTER_DEBOUNCE_DELAY = 300;
|
|
7
|
+
exports.DATE_FORMAT = 'YYYY-MM-DD';
|
|
8
|
+
exports.DATETIME_FORMAT = 'YYYY-MM-DD HH:mm:ss';
|
|
9
|
+
exports.BOOLEAN_STRING = {
|
|
10
|
+
TRUE: 'true',
|
|
11
|
+
FALSE: 'false'
|
|
12
|
+
};
|
|
@@ -29,6 +29,14 @@ declare const translations: {
|
|
|
29
29
|
readonly title: "Akifilter failed to load";
|
|
30
30
|
readonly description: "An unexpected error occurred while rendering the filters. Try again or refresh the page.";
|
|
31
31
|
readonly retry: "Try again";
|
|
32
|
+
readonly storage: {
|
|
33
|
+
readonly readVisibility: "Akifilter: unable to read visibility state from storage";
|
|
34
|
+
readonly writeVisibility: "Akifilter: unable to persist visibility state";
|
|
35
|
+
readonly clearVisibility: "Akifilter: unable to clear visibility state";
|
|
36
|
+
readonly readValues: "Akifilter: unable to read values from storage";
|
|
37
|
+
readonly writeValues: "Akifilter: unable to persist values";
|
|
38
|
+
readonly clearValues: "Akifilter: unable to clear stored values";
|
|
39
|
+
};
|
|
32
40
|
};
|
|
33
41
|
};
|
|
34
42
|
export default translations;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../src/i18n/translations/en.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../src/i18n/translations/en.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCR,CAAC;AAEX,eAAe,YAAY,CAAC"}
|
|
@@ -30,7 +30,15 @@ const translations = {
|
|
|
30
30
|
errors: {
|
|
31
31
|
title: 'Akifilter failed to load',
|
|
32
32
|
description: 'An unexpected error occurred while rendering the filters. Try again or refresh the page.',
|
|
33
|
-
retry: 'Try again'
|
|
33
|
+
retry: 'Try again',
|
|
34
|
+
storage: {
|
|
35
|
+
readVisibility: 'Akifilter: unable to read visibility state from storage',
|
|
36
|
+
writeVisibility: 'Akifilter: unable to persist visibility state',
|
|
37
|
+
clearVisibility: 'Akifilter: unable to clear visibility state',
|
|
38
|
+
readValues: 'Akifilter: unable to read values from storage',
|
|
39
|
+
writeValues: 'Akifilter: unable to persist values',
|
|
40
|
+
clearValues: 'Akifilter: unable to clear stored values'
|
|
41
|
+
}
|
|
34
42
|
}
|
|
35
43
|
};
|
|
36
44
|
exports.default = translations;
|
|
@@ -29,6 +29,14 @@ declare const translations: {
|
|
|
29
29
|
readonly title: "Akifilter yüklenemedi";
|
|
30
30
|
readonly description: "Filtreler render edilirken beklenmeyen bir hata oluştu. Lütfen tekrar deneyin veya sayfayı yenileyin.";
|
|
31
31
|
readonly retry: "Tekrar dene";
|
|
32
|
+
readonly storage: {
|
|
33
|
+
readonly readVisibility: "Akifilter: görünürlük durumu depodan okunamadı";
|
|
34
|
+
readonly writeVisibility: "Akifilter: görünürlük durumu kalıcı hale getirilemedi";
|
|
35
|
+
readonly clearVisibility: "Akifilter: görünürlük durumu temizlenemedi";
|
|
36
|
+
readonly readValues: "Akifilter: değerler depodan okunamadı";
|
|
37
|
+
readonly writeValues: "Akifilter: değerler kalıcı hale getirilemedi";
|
|
38
|
+
readonly clearValues: "Akifilter: kayıtlı değerler temizlenemedi";
|
|
39
|
+
};
|
|
32
40
|
};
|
|
33
41
|
};
|
|
34
42
|
export default translations;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["../../../../src/i18n/translations/tr.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["../../../../src/i18n/translations/tr.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCR,CAAC;AAEX,eAAe,YAAY,CAAC"}
|
|
@@ -30,7 +30,15 @@ const translations = {
|
|
|
30
30
|
errors: {
|
|
31
31
|
title: 'Akifilter yüklenemedi',
|
|
32
32
|
description: 'Filtreler render edilirken beklenmeyen bir hata oluştu. Lütfen tekrar deneyin veya sayfayı yenileyin.',
|
|
33
|
-
retry: 'Tekrar dene'
|
|
33
|
+
retry: 'Tekrar dene',
|
|
34
|
+
storage: {
|
|
35
|
+
readVisibility: 'Akifilter: görünürlük durumu depodan okunamadı',
|
|
36
|
+
writeVisibility: 'Akifilter: görünürlük durumu kalıcı hale getirilemedi',
|
|
37
|
+
clearVisibility: 'Akifilter: görünürlük durumu temizlenemedi',
|
|
38
|
+
readValues: 'Akifilter: değerler depodan okunamadı',
|
|
39
|
+
writeValues: 'Akifilter: değerler kalıcı hale getirilemedi',
|
|
40
|
+
clearValues: 'Akifilter: kayıtlı değerler temizlenemedi'
|
|
41
|
+
}
|
|
34
42
|
}
|
|
35
43
|
};
|
|
36
44
|
exports.default = translations;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../../../src/utils/values.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../../../src/utils/values.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGnD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhE,eAAO,MAAM,kBAAkB,GAC7B,YAAY,SAAS,WAAW,GAAG,WAAW,EAE9C,OAAO,cAAc,CAAC,YAAY,CAAC,GAAG,SAAS,EAC/C,OAAO,OAAO,KACb,OAkBF,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,YAAY,SAAS,WAAW,GAAG,WAAW,EAE9C,QAAQ,eAAe,CAAC,YAAY,CAAC,EACrC,SAAS,OAAO,CAAC,YAAY,CAAC,GAAG,WAAW,KAC3C,OAAO,CAAC,YAAY,CAkCtB,CAAC"}
|
package/dist/cjs/utils/values.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normaliseOutputValues = exports.shouldPersistValue = void 0;
|
|
4
4
|
const akidate_1 = require("@akinon/akidate");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
5
6
|
const shouldPersistValue = (field, value) => {
|
|
6
7
|
if (value === undefined || value === null) {
|
|
7
8
|
return false;
|
|
@@ -34,7 +35,10 @@ const normaliseOutputValues = (schema, values) => {
|
|
|
34
35
|
if (!normalised) {
|
|
35
36
|
return acc;
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
+
// Format with time if showTime is enabled, otherwise date only
|
|
39
|
+
const hasShowTime = 'showTime' in field && field.showTime;
|
|
40
|
+
const format = hasShowTime ? constants_1.DATETIME_FORMAT : constants_1.DATE_FORMAT;
|
|
41
|
+
normalisedValue = akidate_1.akidate.formatIsoDate(normalised, format);
|
|
38
42
|
}
|
|
39
43
|
acc[key] =
|
|
40
44
|
normalisedValue;
|
|
@@ -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;AAUzB,OAAO,KAAK,MAAM,OAAO,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;AAUzB,OAAO,KAAK,MAAM,OAAO,CAAC;AA2B1B,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,SAAS,CAAC;AAU/D,KAAK,oBAAoB,GAAG,WAAW,CAAC;AA2BxC,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;AAqnBF,eAAO,MAAM,SAAS;KACpB,YAAY,SAAS,oBAAoB,uBAElC,cAAc,CAAC,YAAY,CAAC;;CAmBpC,CAAC"}
|
package/dist/esm/akifilter.js
CHANGED
|
@@ -28,7 +28,7 @@ import { themeOverrides } from './common/theme-overrides';
|
|
|
28
28
|
import { AppliedFilters } from './components/applied-filters';
|
|
29
29
|
import { FilterToolbar } from './components/filter-toolbar';
|
|
30
30
|
import { VisibilityModal } from './components/visibility-modal';
|
|
31
|
-
import { DEFAULT_MODAL_PAGE_SIZE, FILTER_DEBOUNCE_DELAY } from './constants';
|
|
31
|
+
import { BOOLEAN_STRING, DATE_FORMAT, DEFAULT_MODAL_PAGE_SIZE, FILTER_DEBOUNCE_DELAY } from './constants';
|
|
32
32
|
import { useDebouncedValue } from './hooks/use-debounced-value';
|
|
33
33
|
import { i18n } from './i18n';
|
|
34
34
|
import { deriveDefaultVisibleKeys, ensureSchemaOrder, extractDefaultValues, getFieldAriaLabel, normaliseValuesBySchema } from './utils/schema';
|
|
@@ -104,14 +104,17 @@ const AkifilterContent = ({ filterSchema, storageNamespace, defaultValues, onVal
|
|
|
104
104
|
if (field.type === 'date') {
|
|
105
105
|
const iso = akidate.toIsoDate(currentValue);
|
|
106
106
|
if (iso) {
|
|
107
|
-
|
|
107
|
+
// Use localized format with time if showTime is enabled
|
|
108
|
+
const hasShowTime = 'showTime' in field && field.showTime;
|
|
109
|
+
const format = hasShowTime ? 'L LTS' : 'YYYY-MM-DD';
|
|
110
|
+
return akidate.formatIsoDate(iso, format);
|
|
108
111
|
}
|
|
109
112
|
}
|
|
110
113
|
if (Array.isArray(currentValue)) {
|
|
111
114
|
return currentValue.map((value) => String(value)).join(', ');
|
|
112
115
|
}
|
|
113
116
|
if (typeof currentValue === 'boolean') {
|
|
114
|
-
return currentValue ?
|
|
117
|
+
return currentValue ? BOOLEAN_STRING.TRUE : BOOLEAN_STRING.FALSE;
|
|
115
118
|
}
|
|
116
119
|
if (typeof currentValue === 'string' ||
|
|
117
120
|
typeof currentValue === 'number') {
|
|
@@ -119,7 +122,7 @@ const AkifilterContent = ({ filterSchema, storageNamespace, defaultValues, onVal
|
|
|
119
122
|
}
|
|
120
123
|
const iso = akidate.toIsoDate(currentValue);
|
|
121
124
|
if (iso) {
|
|
122
|
-
return akidate.formatIsoDate(iso,
|
|
125
|
+
return akidate.formatIsoDate(iso, DATE_FORMAT);
|
|
123
126
|
}
|
|
124
127
|
return String(currentValue);
|
|
125
128
|
};
|
|
@@ -171,14 +174,25 @@ const AkifilterContent = ({ filterSchema, storageNamespace, defaultValues, onVal
|
|
|
171
174
|
writeStoredValues(storageKey, values);
|
|
172
175
|
return nextSerialised;
|
|
173
176
|
}, [storageKey]);
|
|
177
|
+
// Use a ref to track the current serialised values for staleness checks
|
|
178
|
+
const currentSerialisedValuesRef = React.useRef(serialisedValues);
|
|
179
|
+
React.useEffect(() => {
|
|
180
|
+
currentSerialisedValuesRef.current = serialisedValues;
|
|
181
|
+
}, [serialisedValues]);
|
|
174
182
|
React.useEffect(() => {
|
|
175
183
|
if (debouncedSerialisedValues == null) {
|
|
176
184
|
return;
|
|
177
185
|
}
|
|
186
|
+
// Skip if we've already processed this exact debounced value
|
|
178
187
|
if (hasEmittedValuesRef.current &&
|
|
179
188
|
lastPersistedValuesRef.current === debouncedSerialisedValues) {
|
|
180
189
|
return;
|
|
181
190
|
}
|
|
191
|
+
// Skip if the debounced value is stale (doesn't match current state)
|
|
192
|
+
// This prevents old debounced values from overwriting manual updates
|
|
193
|
+
if (currentSerialisedValuesRef.current !== debouncedSerialisedValues) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
182
196
|
const parsedValues = JSON.parse(debouncedSerialisedValues);
|
|
183
197
|
const isEmpty = Object.keys(parsedValues).length === 0;
|
|
184
198
|
if (!hasEmittedValuesRef.current &&
|
|
@@ -248,16 +262,25 @@ const AkifilterContent = ({ filterSchema, storageNamespace, defaultValues, onVal
|
|
|
248
262
|
const defaultValue = baseDefaultValues[String(schemaField.key)];
|
|
249
263
|
const fieldPath = schemaField.key;
|
|
250
264
|
const nextValue = resolveClearedFieldValue(schemaField, defaultValue);
|
|
265
|
+
// Update the form value
|
|
251
266
|
formMethods.setValue(fieldPath, nextValue, {
|
|
252
267
|
shouldDirty: false,
|
|
253
268
|
shouldTouch: false,
|
|
254
269
|
shouldValidate: false
|
|
255
270
|
});
|
|
256
|
-
|
|
257
|
-
const
|
|
271
|
+
// Compute the updated values immediately (don't wait for debounce)
|
|
272
|
+
const currentValues = formMethods.getValues() || {};
|
|
273
|
+
const updatedFormValues = Object.assign(Object.assign({}, currentValues), { [fieldPath]: nextValue });
|
|
274
|
+
const nextValues = normaliseOutputValues(filterSchema, updatedFormValues);
|
|
275
|
+
const nextSerialised = JSON.stringify(nextValues);
|
|
276
|
+
// Persist immediately (bypass debounce for remove action)
|
|
277
|
+
persistValues(nextValues);
|
|
278
|
+
// Update refs to mark this as the latest persisted state
|
|
279
|
+
lastPersistedValuesRef.current = nextSerialised;
|
|
280
|
+
currentSerialisedValuesRef.current = nextSerialised;
|
|
258
281
|
hasEmittedValuesRef.current = true;
|
|
259
|
-
lastPersistedValuesRef.current = nextSerialised !== null && nextSerialised !== void 0 ? nextSerialised : null;
|
|
260
282
|
hasInitialValuesRef.current = Object.keys(nextValues).length > 0;
|
|
283
|
+
// Emit the change to parent
|
|
261
284
|
onValuesChange === null || onValuesChange === void 0 ? void 0 : onValuesChange(nextValues);
|
|
262
285
|
}, [
|
|
263
286
|
baseDefaultValues,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/common/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/common/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAqB/C,eAAO,MAAM,eAAe,GAAI,YAAY,SAAS,WAAW,EAC9D,QAAQ,cAAc,CAAC,YAAY,CAAC,EAAE,EACtC,YAAY,MAAM,KACjB,MAKF,CAAC;AAIF,eAAO,MAAM,eAAe,GAAI,YAAY,SAAS,WAAW,EAC9D,QAAQ,cAAc,CAAC,YAAY,CAAC,EAAE,EACtC,YAAY,MAAM,KACjB,MAAM,EAAE,GAAG,IAoBb,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,YAAY,MAAM,EAAE,MAAM,MAAM,EAAE,KAAG,IAQrE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,YAAY,MAAM,KAAG,IAQrD,CAAC;AAKF,eAAO,MAAM,gBAAgB,GAAI,YAAY,SAAS,WAAW,EAC/D,QAAQ,cAAc,CAAC,YAAY,CAAC,EAAE,EACtC,YAAY,MAAM,KACjB,OAAO,CAAC,YAAY,CAAC,GAAG,IA+B1B,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,YAAY,SAAS,WAAW,EAChE,YAAY,MAAM,EAClB,QAAQ,OAAO,CAAC,YAAY,CAAC,KAC5B,IAeF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,YAAY,MAAM,KAAG,IAQtD,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { i18n } from '../i18n';
|
|
1
2
|
const STORAGE_PREFIX = 'akifilter:v1';
|
|
2
3
|
const VALUES_SUFFIX = ':values';
|
|
3
4
|
const hashString = (value) => {
|
|
@@ -35,7 +36,7 @@ export const readVisibleKeys = (schema, storageKey) => {
|
|
|
35
36
|
return parsed.filter(key => schemaKeys.has(String(key)));
|
|
36
37
|
}
|
|
37
38
|
catch (error) {
|
|
38
|
-
console.warn('
|
|
39
|
+
console.warn(i18n.t('errors.storage.readVisibility'), error);
|
|
39
40
|
return null;
|
|
40
41
|
}
|
|
41
42
|
};
|
|
@@ -46,7 +47,7 @@ export const writeVisibleKeys = (storageKey, keys) => {
|
|
|
46
47
|
window.localStorage.setItem(storageKey, JSON.stringify(keys));
|
|
47
48
|
}
|
|
48
49
|
catch (error) {
|
|
49
|
-
console.warn('
|
|
50
|
+
console.warn(i18n.t('errors.storage.writeVisibility'), error);
|
|
50
51
|
}
|
|
51
52
|
};
|
|
52
53
|
export const clearVisibleKeys = (storageKey) => {
|
|
@@ -56,7 +57,7 @@ export const clearVisibleKeys = (storageKey) => {
|
|
|
56
57
|
window.localStorage.removeItem(storageKey);
|
|
57
58
|
}
|
|
58
59
|
catch (error) {
|
|
59
|
-
console.warn('
|
|
60
|
+
console.warn(i18n.t('errors.storage.clearVisibility'), error);
|
|
60
61
|
}
|
|
61
62
|
};
|
|
62
63
|
const buildValuesStorageKey = (storageKey) => `${storageKey}${VALUES_SUFFIX}`;
|
|
@@ -82,7 +83,7 @@ export const readStoredValues = (schema, storageKey) => {
|
|
|
82
83
|
}, {});
|
|
83
84
|
}
|
|
84
85
|
catch (error) {
|
|
85
|
-
console.warn('
|
|
86
|
+
console.warn(i18n.t('errors.storage.readValues'), error);
|
|
86
87
|
return null;
|
|
87
88
|
}
|
|
88
89
|
};
|
|
@@ -99,7 +100,7 @@ export const writeStoredValues = (storageKey, values) => {
|
|
|
99
100
|
window.localStorage.setItem(valuesKey, JSON.stringify(values));
|
|
100
101
|
}
|
|
101
102
|
catch (error) {
|
|
102
|
-
console.warn('
|
|
103
|
+
console.warn(i18n.t('errors.storage.writeValues'), error);
|
|
103
104
|
}
|
|
104
105
|
};
|
|
105
106
|
export const clearStoredValues = (storageKey) => {
|
|
@@ -109,6 +110,6 @@ export const clearStoredValues = (storageKey) => {
|
|
|
109
110
|
window.localStorage.removeItem(buildValuesStorageKey(storageKey));
|
|
110
111
|
}
|
|
111
112
|
catch (error) {
|
|
112
|
-
console.warn('
|
|
113
|
+
console.warn(i18n.t('errors.storage.clearValues'), error);
|
|
113
114
|
}
|
|
114
115
|
};
|
package/dist/esm/constants.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export declare const DEFAULT_VISIBLE_COUNT = 8;
|
|
2
2
|
export declare const DEFAULT_MODAL_PAGE_SIZE = 40;
|
|
3
3
|
export declare const FILTER_DEBOUNCE_DELAY = 300;
|
|
4
|
+
export declare const DATE_FORMAT = "YYYY-MM-DD";
|
|
5
|
+
export declare const DATETIME_FORMAT = "YYYY-MM-DD HH:mm:ss";
|
|
6
|
+
export declare const BOOLEAN_STRING: {
|
|
7
|
+
readonly TRUE: "true";
|
|
8
|
+
readonly FALSE: "false";
|
|
9
|
+
};
|
|
4
10
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,eAAO,MAAM,qBAAqB,MAAM,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC,eAAO,MAAM,WAAW,eAAe,CAAC;AACxC,eAAO,MAAM,eAAe,wBAAwB,CAAC;AAErD,eAAO,MAAM,cAAc;;;CAGjB,CAAC"}
|
package/dist/esm/constants.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
export const DEFAULT_VISIBLE_COUNT = 8;
|
|
2
2
|
export const DEFAULT_MODAL_PAGE_SIZE = 40;
|
|
3
3
|
export const FILTER_DEBOUNCE_DELAY = 300;
|
|
4
|
+
export const DATE_FORMAT = 'YYYY-MM-DD';
|
|
5
|
+
export const DATETIME_FORMAT = 'YYYY-MM-DD HH:mm:ss';
|
|
6
|
+
export const BOOLEAN_STRING = {
|
|
7
|
+
TRUE: 'true',
|
|
8
|
+
FALSE: 'false'
|
|
9
|
+
};
|
|
@@ -29,6 +29,14 @@ declare const translations: {
|
|
|
29
29
|
readonly title: "Akifilter failed to load";
|
|
30
30
|
readonly description: "An unexpected error occurred while rendering the filters. Try again or refresh the page.";
|
|
31
31
|
readonly retry: "Try again";
|
|
32
|
+
readonly storage: {
|
|
33
|
+
readonly readVisibility: "Akifilter: unable to read visibility state from storage";
|
|
34
|
+
readonly writeVisibility: "Akifilter: unable to persist visibility state";
|
|
35
|
+
readonly clearVisibility: "Akifilter: unable to clear visibility state";
|
|
36
|
+
readonly readValues: "Akifilter: unable to read values from storage";
|
|
37
|
+
readonly writeValues: "Akifilter: unable to persist values";
|
|
38
|
+
readonly clearValues: "Akifilter: unable to clear stored values";
|
|
39
|
+
};
|
|
32
40
|
};
|
|
33
41
|
};
|
|
34
42
|
export default translations;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../src/i18n/translations/en.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../src/i18n/translations/en.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCR,CAAC;AAEX,eAAe,YAAY,CAAC"}
|
|
@@ -28,7 +28,15 @@ const translations = {
|
|
|
28
28
|
errors: {
|
|
29
29
|
title: 'Akifilter failed to load',
|
|
30
30
|
description: 'An unexpected error occurred while rendering the filters. Try again or refresh the page.',
|
|
31
|
-
retry: 'Try again'
|
|
31
|
+
retry: 'Try again',
|
|
32
|
+
storage: {
|
|
33
|
+
readVisibility: 'Akifilter: unable to read visibility state from storage',
|
|
34
|
+
writeVisibility: 'Akifilter: unable to persist visibility state',
|
|
35
|
+
clearVisibility: 'Akifilter: unable to clear visibility state',
|
|
36
|
+
readValues: 'Akifilter: unable to read values from storage',
|
|
37
|
+
writeValues: 'Akifilter: unable to persist values',
|
|
38
|
+
clearValues: 'Akifilter: unable to clear stored values'
|
|
39
|
+
}
|
|
32
40
|
}
|
|
33
41
|
};
|
|
34
42
|
export default translations;
|
|
@@ -29,6 +29,14 @@ declare const translations: {
|
|
|
29
29
|
readonly title: "Akifilter yüklenemedi";
|
|
30
30
|
readonly description: "Filtreler render edilirken beklenmeyen bir hata oluştu. Lütfen tekrar deneyin veya sayfayı yenileyin.";
|
|
31
31
|
readonly retry: "Tekrar dene";
|
|
32
|
+
readonly storage: {
|
|
33
|
+
readonly readVisibility: "Akifilter: görünürlük durumu depodan okunamadı";
|
|
34
|
+
readonly writeVisibility: "Akifilter: görünürlük durumu kalıcı hale getirilemedi";
|
|
35
|
+
readonly clearVisibility: "Akifilter: görünürlük durumu temizlenemedi";
|
|
36
|
+
readonly readValues: "Akifilter: değerler depodan okunamadı";
|
|
37
|
+
readonly writeValues: "Akifilter: değerler kalıcı hale getirilemedi";
|
|
38
|
+
readonly clearValues: "Akifilter: kayıtlı değerler temizlenemedi";
|
|
39
|
+
};
|
|
32
40
|
};
|
|
33
41
|
};
|
|
34
42
|
export default translations;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["../../../../src/i18n/translations/tr.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["../../../../src/i18n/translations/tr.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCR,CAAC;AAEX,eAAe,YAAY,CAAC"}
|
|
@@ -28,7 +28,15 @@ const translations = {
|
|
|
28
28
|
errors: {
|
|
29
29
|
title: 'Akifilter yüklenemedi',
|
|
30
30
|
description: 'Filtreler render edilirken beklenmeyen bir hata oluştu. Lütfen tekrar deneyin veya sayfayı yenileyin.',
|
|
31
|
-
retry: 'Tekrar dene'
|
|
31
|
+
retry: 'Tekrar dene',
|
|
32
|
+
storage: {
|
|
33
|
+
readVisibility: 'Akifilter: görünürlük durumu depodan okunamadı',
|
|
34
|
+
writeVisibility: 'Akifilter: görünürlük durumu kalıcı hale getirilemedi',
|
|
35
|
+
clearVisibility: 'Akifilter: görünürlük durumu temizlenemedi',
|
|
36
|
+
readValues: 'Akifilter: değerler depodan okunamadı',
|
|
37
|
+
writeValues: 'Akifilter: değerler kalıcı hale getirilemedi',
|
|
38
|
+
clearValues: 'Akifilter: kayıtlı değerler temizlenemedi'
|
|
39
|
+
}
|
|
32
40
|
}
|
|
33
41
|
};
|
|
34
42
|
export default translations;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../../../src/utils/values.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../../../src/utils/values.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGnD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhE,eAAO,MAAM,kBAAkB,GAC7B,YAAY,SAAS,WAAW,GAAG,WAAW,EAE9C,OAAO,cAAc,CAAC,YAAY,CAAC,GAAG,SAAS,EAC/C,OAAO,OAAO,KACb,OAkBF,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,YAAY,SAAS,WAAW,GAAG,WAAW,EAE9C,QAAQ,eAAe,CAAC,YAAY,CAAC,EACrC,SAAS,OAAO,CAAC,YAAY,CAAC,GAAG,WAAW,KAC3C,OAAO,CAAC,YAAY,CAkCtB,CAAC"}
|
package/dist/esm/utils/values.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { akidate } from '@akinon/akidate';
|
|
2
|
+
import { DATE_FORMAT, DATETIME_FORMAT } from '../constants';
|
|
2
3
|
export const shouldPersistValue = (field, value) => {
|
|
3
4
|
if (value === undefined || value === null) {
|
|
4
5
|
return false;
|
|
@@ -30,7 +31,10 @@ export const normaliseOutputValues = (schema, values) => {
|
|
|
30
31
|
if (!normalised) {
|
|
31
32
|
return acc;
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
+
// Format with time if showTime is enabled, otherwise date only
|
|
35
|
+
const hasShowTime = 'showTime' in field && field.showTime;
|
|
36
|
+
const format = hasShowTime ? DATETIME_FORMAT : DATE_FORMAT;
|
|
37
|
+
normalisedValue = akidate.formatIsoDate(normalised, format);
|
|
34
38
|
}
|
|
35
39
|
acc[key] =
|
|
36
40
|
normalisedValue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/akifilter",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Akifilter is a filtering library for Akinon frontend applications.",
|
|
6
6
|
"type": "module",
|
|
@@ -12,32 +12,32 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"antd": "^5.27.0",
|
|
14
14
|
"react-error-boundary": "^6.0.0",
|
|
15
|
-
"@akinon/akiform": "1.1.
|
|
16
|
-
"@akinon/
|
|
17
|
-
"@akinon/
|
|
18
|
-
"@akinon/
|
|
19
|
-
"@akinon/
|
|
20
|
-
"@akinon/ui-
|
|
21
|
-
"@akinon/ui-card": "1.1.
|
|
22
|
-
"@akinon/ui-
|
|
23
|
-
"@akinon/ui-input": "1.
|
|
24
|
-
"@akinon/ui-modal": "1.1.
|
|
25
|
-
"@akinon/ui-
|
|
26
|
-
"@akinon/ui-pagination": "1.3.
|
|
27
|
-
"@akinon/ui-space": "1.3.
|
|
28
|
-
"@akinon/ui-typography": "1.1.
|
|
29
|
-
"@akinon/ui-
|
|
15
|
+
"@akinon/akiform": "1.1.2",
|
|
16
|
+
"@akinon/akidate": "1.1.2",
|
|
17
|
+
"@akinon/akilocale": "1.2.1",
|
|
18
|
+
"@akinon/icons": "1.1.1",
|
|
19
|
+
"@akinon/ui-button": "1.3.2",
|
|
20
|
+
"@akinon/ui-checkbox": "1.3.2",
|
|
21
|
+
"@akinon/ui-card": "1.1.2",
|
|
22
|
+
"@akinon/ui-input": "1.1.2",
|
|
23
|
+
"@akinon/ui-input-number": "1.3.2",
|
|
24
|
+
"@akinon/ui-modal": "1.1.2",
|
|
25
|
+
"@akinon/ui-select": "1.3.3",
|
|
26
|
+
"@akinon/ui-pagination": "1.3.3",
|
|
27
|
+
"@akinon/ui-space": "1.3.2",
|
|
28
|
+
"@akinon/ui-typography": "1.1.1",
|
|
29
|
+
"@akinon/ui-date-picker": "1.3.2"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"clean-package": "2.2.0",
|
|
33
33
|
"copyfiles": "^2.4.1",
|
|
34
34
|
"rimraf": "^5.0.5",
|
|
35
35
|
"typescript": "*",
|
|
36
|
-
"@akinon/akiform-builder": "1.3.
|
|
37
|
-
"@akinon/typescript-config": "1.1.
|
|
38
|
-
"@akinon/ui-theme": "1.1.
|
|
39
|
-
"@akinon/vitest-config": "1.1.
|
|
40
|
-
"@akinon/utils": "1.1.
|
|
36
|
+
"@akinon/akiform-builder": "1.3.4",
|
|
37
|
+
"@akinon/typescript-config": "1.1.1",
|
|
38
|
+
"@akinon/ui-theme": "1.1.2",
|
|
39
|
+
"@akinon/vitest-config": "1.1.1",
|
|
40
|
+
"@akinon/utils": "1.1.3"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"react": "^18 || ^19",
|