@nubitio/hydra 1.0.0 → 1.0.2
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/index.cjs +8 -0
- package/dist/index.d.cts +9 -0
- package/dist/index.d.mts +9 -0
- package/dist/index.mjs +8 -0
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -711,6 +711,14 @@ function applyCrudHints(field, hints, fieldName) {
|
|
|
711
711
|
field.toneByValue = hints.toneByValue;
|
|
712
712
|
applied.push("toneByValue");
|
|
713
713
|
}
|
|
714
|
+
if (hints.currency !== void 0) {
|
|
715
|
+
field.currency = hints.currency;
|
|
716
|
+
applied.push(`currency=${hints.currency}`);
|
|
717
|
+
}
|
|
718
|
+
if (hints.scale !== void 0) {
|
|
719
|
+
field.scale = hints.scale;
|
|
720
|
+
applied.push(`scale=${hints.scale}`);
|
|
721
|
+
}
|
|
714
722
|
return applied;
|
|
715
723
|
}
|
|
716
724
|
function stampMappingReason(field, rule, hintSuffix) {
|
package/dist/index.d.cts
CHANGED
|
@@ -91,6 +91,15 @@ interface CrudHints {
|
|
|
91
91
|
presentation?: 'badge';
|
|
92
92
|
/** Visual tone per enum value when `presentation` is `badge`. */
|
|
93
93
|
toneByValue?: Record<string, string>;
|
|
94
|
+
/**
|
|
95
|
+
* MONEY fields only: the ISO 4217 currency to assume while the amount is
|
|
96
|
+
* still empty (a fresh create form). A value with its own currency always
|
|
97
|
+
* wins; without this hint the field falls back to
|
|
98
|
+
* `configureCore({ currency })` and finally 'EUR'.
|
|
99
|
+
*/
|
|
100
|
+
currency?: string;
|
|
101
|
+
/** MONEY fields only: decimal places accepted while typing. Defaults to the value's own scale, then 2. */
|
|
102
|
+
scale?: number;
|
|
94
103
|
/**
|
|
95
104
|
* Render hint.
|
|
96
105
|
*
|
package/dist/index.d.mts
CHANGED
|
@@ -91,6 +91,15 @@ interface CrudHints {
|
|
|
91
91
|
presentation?: 'badge';
|
|
92
92
|
/** Visual tone per enum value when `presentation` is `badge`. */
|
|
93
93
|
toneByValue?: Record<string, string>;
|
|
94
|
+
/**
|
|
95
|
+
* MONEY fields only: the ISO 4217 currency to assume while the amount is
|
|
96
|
+
* still empty (a fresh create form). A value with its own currency always
|
|
97
|
+
* wins; without this hint the field falls back to
|
|
98
|
+
* `configureCore({ currency })` and finally 'EUR'.
|
|
99
|
+
*/
|
|
100
|
+
currency?: string;
|
|
101
|
+
/** MONEY fields only: decimal places accepted while typing. Defaults to the value's own scale, then 2. */
|
|
102
|
+
scale?: number;
|
|
94
103
|
/**
|
|
95
104
|
* Render hint.
|
|
96
105
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -687,6 +687,14 @@ function applyCrudHints(field, hints, fieldName) {
|
|
|
687
687
|
field.toneByValue = hints.toneByValue;
|
|
688
688
|
applied.push("toneByValue");
|
|
689
689
|
}
|
|
690
|
+
if (hints.currency !== void 0) {
|
|
691
|
+
field.currency = hints.currency;
|
|
692
|
+
applied.push(`currency=${hints.currency}`);
|
|
693
|
+
}
|
|
694
|
+
if (hints.scale !== void 0) {
|
|
695
|
+
field.scale = hints.scale;
|
|
696
|
+
applied.push(`scale=${hints.scale}`);
|
|
697
|
+
}
|
|
690
698
|
return applied;
|
|
691
699
|
}
|
|
692
700
|
function stampMappingReason(field, rule, hintSuffix) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nubitio/hydra",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Hydra / OpenAPI adapter for @nubitio/crud — automatic schema discovery and data source from API Platform docs.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"react": "^18.2.0 || ^19.0.0",
|
|
52
52
|
"react-dom": "^18.2.0 || ^19.0.0",
|
|
53
53
|
"react-i18next": "^14.0.0",
|
|
54
|
-
"@nubitio/core": "^1.0.
|
|
55
|
-
"@nubitio/crud": "^1.0.
|
|
54
|
+
"@nubitio/core": "^1.0.2",
|
|
55
|
+
"@nubitio/crud": "^1.0.2"
|
|
56
56
|
}
|
|
57
57
|
}
|