@nubitio/hydra 0.3.0 → 0.3.1
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 +10 -1
- package/dist/index.mjs +10 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -624,6 +624,15 @@ function mapHydraSchemaToFields(schema, urlLookup, schemaLookup) {
|
|
|
624
624
|
fields.push(field);
|
|
625
625
|
continue;
|
|
626
626
|
}
|
|
627
|
+
if (fieldSchema.crudHints?.format === "currency" && (tag === "text" || tag === "integer" || tag === "decimal")) {
|
|
628
|
+
const field = {
|
|
629
|
+
...(0, _nubitio_crud.currencyField)().name(name).label(label).required(required).build(),
|
|
630
|
+
filterable
|
|
631
|
+
};
|
|
632
|
+
applyCrudHints(field, fieldSchema.crudHints);
|
|
633
|
+
fields.push(field);
|
|
634
|
+
continue;
|
|
635
|
+
}
|
|
627
636
|
if (tag === "boolean") {
|
|
628
637
|
const field = {
|
|
629
638
|
...(0, _nubitio_crud.switchField)().name(name).label(label).required(required).build(),
|
|
@@ -653,7 +662,7 @@ function mapHydraSchemaToFields(schema, urlLookup, schemaLookup) {
|
|
|
653
662
|
}
|
|
654
663
|
if (tag === "decimal") {
|
|
655
664
|
const field = {
|
|
656
|
-
...(
|
|
665
|
+
...(0, _nubitio_crud.numberField)().name(name).label(label).required(required).build(),
|
|
657
666
|
filterable
|
|
658
667
|
};
|
|
659
668
|
applyCrudHints(field, fieldSchema.crudHints);
|
package/dist/index.mjs
CHANGED
|
@@ -600,6 +600,15 @@ function mapHydraSchemaToFields(schema, urlLookup, schemaLookup) {
|
|
|
600
600
|
fields.push(field);
|
|
601
601
|
continue;
|
|
602
602
|
}
|
|
603
|
+
if (fieldSchema.crudHints?.format === "currency" && (tag === "text" || tag === "integer" || tag === "decimal")) {
|
|
604
|
+
const field = {
|
|
605
|
+
...currencyField().name(name).label(label).required(required).build(),
|
|
606
|
+
filterable
|
|
607
|
+
};
|
|
608
|
+
applyCrudHints(field, fieldSchema.crudHints);
|
|
609
|
+
fields.push(field);
|
|
610
|
+
continue;
|
|
611
|
+
}
|
|
603
612
|
if (tag === "boolean") {
|
|
604
613
|
const field = {
|
|
605
614
|
...switchField().name(name).label(label).required(required).build(),
|
|
@@ -629,7 +638,7 @@ function mapHydraSchemaToFields(schema, urlLookup, schemaLookup) {
|
|
|
629
638
|
}
|
|
630
639
|
if (tag === "decimal") {
|
|
631
640
|
const field = {
|
|
632
|
-
...
|
|
641
|
+
...numberField().name(name).label(label).required(required).build(),
|
|
633
642
|
filterable
|
|
634
643
|
};
|
|
635
644
|
applyCrudHints(field, fieldSchema.crudHints);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nubitio/hydra",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
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",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"react": "^19.0.0",
|
|
51
51
|
"react-dom": "^19.0.0",
|
|
52
52
|
"react-i18next": "^14.0.0",
|
|
53
|
-
"@nubitio/core": "^0.3.
|
|
54
|
-
"@nubitio/crud": "^0.3.
|
|
53
|
+
"@nubitio/core": "^0.3.1",
|
|
54
|
+
"@nubitio/crud": "^0.3.1"
|
|
55
55
|
}
|
|
56
56
|
}
|