@cosmicdrift/kumiko-renderer-web 0.186.3 → 0.188.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/package.json +4 -4
- package/src/__tests__/config-edit.test.tsx +66 -0
- package/src/__tests__/primitives.test.tsx +121 -0
- package/src/__tests__/render-edit.test.tsx +1368 -1
- package/src/__tests__/test-utils.tsx +24 -0
- package/src/__tests__/wizard-form-validation.test.tsx +73 -0
- package/src/app/create-app.tsx +33 -20
- package/src/app/draft-storage.ts +59 -0
- package/src/index.ts +4 -0
- package/src/primitives/__tests__/date-parse.test.ts +26 -1
- package/src/primitives/__tests__/embedded-list-input.test.tsx +29 -0
- package/src/primitives/date-field.tsx +13 -5
- package/src/primitives/date-parse.ts +30 -7
- package/src/primitives/embedded-list-input.tsx +5 -3
- package/src/primitives/index.tsx +49 -7
- package/src/primitives/money-input.tsx +5 -9
|
@@ -14,10 +14,15 @@
|
|
|
14
14
|
// Klick — also 100 cents bei EUR/USD, 1 yen bei JPY). User der nur
|
|
15
15
|
// Cent-genaue Steps will tippt halt im Focus-Modus.
|
|
16
16
|
|
|
17
|
+
import { currencyDecimals } from "@cosmicdrift/kumiko-headless";
|
|
17
18
|
import { Minus, Plus } from "lucide-react";
|
|
18
19
|
import { type ReactNode, useEffect, useRef, useState } from "react";
|
|
19
20
|
import { cn } from "../lib/cn";
|
|
20
21
|
|
|
22
|
+
// Re-exported for backward compat — callers used to import this from here
|
|
23
|
+
// before it moved to headless (shared with RenderField, kumiko-framework#1923).
|
|
24
|
+
export { currencyDecimals };
|
|
25
|
+
|
|
21
26
|
export type MoneyInputProps = {
|
|
22
27
|
readonly id: string;
|
|
23
28
|
readonly name: string;
|
|
@@ -165,15 +170,6 @@ export function MoneyInput({
|
|
|
165
170
|
);
|
|
166
171
|
}
|
|
167
172
|
|
|
168
|
-
// Currency-Decimal-Stellen — überdeckt die wichtigsten Welt-Währungen.
|
|
169
|
-
// Default 2 wenn Code unbekannt.
|
|
170
|
-
export function currencyDecimals(code: string): number {
|
|
171
|
-
if (code === "JPY" || code === "KRW" || code === "VND" || code === "ISK") return 0;
|
|
172
|
-
if (code === "BHD" || code === "JOD" || code === "KWD" || code === "OMR" || code === "TND")
|
|
173
|
-
return 3;
|
|
174
|
-
return 2;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
173
|
function guessLocale(): string {
|
|
178
174
|
if (typeof navigator !== "undefined" && navigator.language) return navigator.language;
|
|
179
175
|
return "en-US";
|