@ai-matrx/records 0.87.16 → 0.87.18
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/CHANGELOG.md +25 -1
- package/dist/core/index.cjs +12 -3
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +12 -3
- package/dist/core/index.js.map +1 -1
- package/dist/data/index.cjs +7 -2
- package/dist/data/index.cjs.map +1 -1
- package/dist/data/index.js +7 -2
- package/dist/data/index.js.map +1 -1
- package/dist/index.cjs +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +12 -3
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +8 -1
- package/dist/react/index.d.ts +8 -1
- package/dist/react/index.js +12 -3
- package/dist/react/index.js.map +1 -1
- package/dist/typed-table/index.cjs +7 -2
- package/dist/typed-table/index.cjs.map +1 -1
- package/dist/typed-table/index.js +7 -2
- package/dist/typed-table/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -108,6 +108,7 @@ __export(src_exports, {
|
|
|
108
108
|
asChoiceNudge: () => asChoiceNudge,
|
|
109
109
|
asPermissionLevel: () => asPermissionLevel,
|
|
110
110
|
atLeast: () => atLeast,
|
|
111
|
+
autonumberJoin: () => autonumberJoin,
|
|
111
112
|
autonumberPrefixOf: () => autonumberPrefixOf,
|
|
112
113
|
autonumberSearchOf: () => autonumberSearchOf,
|
|
113
114
|
autonumberWords: () => autonumberWords,
|
|
@@ -1399,7 +1400,10 @@ function autonumberPrefixOf(field) {
|
|
|
1399
1400
|
function autonumberWords(field, value) {
|
|
1400
1401
|
const n = typeof value === "number" ? value : typeof value === "string" && /^\d+$/.test(value.trim()) ? Number(value) : NaN;
|
|
1401
1402
|
if (!Number.isFinite(n)) return null;
|
|
1402
|
-
return `${autonumberPrefixOf(field)}${Math.trunc(n)}`;
|
|
1403
|
+
return `${autonumberJoin(autonumberPrefixOf(field))}${Math.trunc(n)}`;
|
|
1404
|
+
}
|
|
1405
|
+
function autonumberJoin(prefix) {
|
|
1406
|
+
return prefix === "" || /[-_#.:/\s]$/.test(prefix) ? prefix : `${prefix}-`;
|
|
1403
1407
|
}
|
|
1404
1408
|
function autonumberSearchOf(fields, words) {
|
|
1405
1409
|
const text = words.trim();
|