@duke333/builder-ui 0.1.3 → 0.1.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/README.md +7 -0
- package/dist/{BuilderAdminPages-Buy2nvjs.d.ts → BuilderAdminPages-C-jaMLOa.d.ts} +6 -0
- package/dist/{RuntimeEntryDialog-DAO74GFp.d.ts → RuntimeEntryDialog-Bw741XbS.d.ts} +12 -5
- package/dist/admin/index.d.ts +2 -2
- package/dist/admin/index.js +30 -3
- package/dist/admin/index.js.map +1 -1
- package/dist/components/index.d.ts +5 -3
- package/dist/components/index.js +53 -25
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +76 -8
- package/dist/index.js.map +1 -1
- package/dist/integration/index.d.ts +1 -1
- package/dist/integration/index.js +30 -3
- package/dist/integration/index.js.map +1 -1
- package/dist/runtime/index.d.ts +3 -1
- package/dist/runtime/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BuilderApiContracts, BuilderApiClient, BuilderApiTransport } from '../api/index.js';
|
|
2
|
-
import { P as createBuilderAdminPages, b as BuilderAdminPagesOptions, a as BuilderAdminPageContracts } from '../BuilderAdminPages-
|
|
2
|
+
import { P as createBuilderAdminPages, b as BuilderAdminPagesOptions, a as BuilderAdminPageContracts } from '../BuilderAdminPages-C-jaMLOa.js';
|
|
3
3
|
import { BuilderHooks } from '../hooks/index.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'react-hook-form';
|
|
@@ -217,11 +217,13 @@ function builderFormEditorValuesFromEntity(form, emptyValues) {
|
|
|
217
217
|
parentField: subform.parentField,
|
|
218
218
|
childField: subform.childField,
|
|
219
219
|
buttonLabel: subform.buttonLabel ?? "",
|
|
220
|
-
icon: subform.icon ?? ""
|
|
220
|
+
icon: subform.icon ?? "",
|
|
221
|
+
presentation: subform.presentation ?? "dialog"
|
|
221
222
|
}));
|
|
222
223
|
return {
|
|
223
224
|
title: form.title,
|
|
224
225
|
description: form.description ?? "",
|
|
226
|
+
presentation: form.schema.presentation ?? "dialog",
|
|
225
227
|
sourceType: source?.type ?? "none",
|
|
226
228
|
sourceTable: source?.type === "dbTable" ? source.tableName : BUILDER_EDITOR_NONE_VALUE,
|
|
227
229
|
apiBasePath: source?.type === "apiEndpoint" ? source.basePath : "",
|
|
@@ -303,6 +305,7 @@ function builderFormEditorInputFromValues(values) {
|
|
|
303
305
|
description: values.description || null,
|
|
304
306
|
source,
|
|
305
307
|
schema: {
|
|
308
|
+
presentation: values.presentation ?? "dialog",
|
|
306
309
|
fields: values.fields.map((field) => ({
|
|
307
310
|
key: field.key,
|
|
308
311
|
label: field.label,
|
|
@@ -347,7 +350,8 @@ function builderFormEditorInputFromValues(values) {
|
|
|
347
350
|
parentField: subform.parentField,
|
|
348
351
|
childField: subform.childField,
|
|
349
352
|
buttonLabel: subform.buttonLabel?.trim() || void 0,
|
|
350
|
-
icon: subform.icon?.trim() || void 0
|
|
353
|
+
icon: subform.icon?.trim() || void 0,
|
|
354
|
+
presentation: subform.presentation ?? "dialog"
|
|
351
355
|
}))
|
|
352
356
|
},
|
|
353
357
|
triggers: values.triggers.map((trigger) => ({
|
|
@@ -552,6 +556,13 @@ function createBuilderDefaultFormEditorBody(options) {
|
|
|
552
556
|
/* @__PURE__ */ jsx("span", { style: styles.label, children: "Description" }),
|
|
553
557
|
/* @__PURE__ */ jsx("input", { style: styles.input, ...form.register("description") })
|
|
554
558
|
] }),
|
|
559
|
+
/* @__PURE__ */ jsxs("label", { style: styles.field, children: [
|
|
560
|
+
/* @__PURE__ */ jsx("span", { style: styles.label, children: "Presentation" }),
|
|
561
|
+
/* @__PURE__ */ jsxs("select", { style: styles.input, ...form.register("presentation"), children: [
|
|
562
|
+
/* @__PURE__ */ jsx("option", { value: "dialog", children: "Dialog" }),
|
|
563
|
+
/* @__PURE__ */ jsx("option", { value: "drawer", children: "Drawer" })
|
|
564
|
+
] })
|
|
565
|
+
] }),
|
|
555
566
|
/* @__PURE__ */ jsxs("label", { style: styles.field, children: [
|
|
556
567
|
/* @__PURE__ */ jsx("span", { style: styles.label, children: "Datasource" }),
|
|
557
568
|
/* @__PURE__ */ jsxs("select", { style: styles.input, ...form.register("sourceType"), children: [
|
|
@@ -733,7 +744,8 @@ function createBuilderDefaultFormEditorBody(options) {
|
|
|
733
744
|
parentField: "id",
|
|
734
745
|
childField: "parentId",
|
|
735
746
|
buttonLabel: "",
|
|
736
|
-
icon: ""
|
|
747
|
+
icon: "",
|
|
748
|
+
presentation: "dialog"
|
|
737
749
|
}),
|
|
738
750
|
children: "Add subform"
|
|
739
751
|
}
|
|
@@ -760,6 +772,20 @@ function createBuilderDefaultFormEditorBody(options) {
|
|
|
760
772
|
/* @__PURE__ */ jsx("span", { style: styles.label, children: "Child field" }),
|
|
761
773
|
/* @__PURE__ */ jsx("input", { style: styles.input, ...form.register(`subforms.${index}.childField`) })
|
|
762
774
|
] }),
|
|
775
|
+
/* @__PURE__ */ jsxs("label", { style: styles.field, children: [
|
|
776
|
+
/* @__PURE__ */ jsx("span", { style: styles.label, children: "Presentation" }),
|
|
777
|
+
/* @__PURE__ */ jsxs(
|
|
778
|
+
"select",
|
|
779
|
+
{
|
|
780
|
+
style: styles.input,
|
|
781
|
+
...form.register(`subforms.${index}.presentation`),
|
|
782
|
+
children: [
|
|
783
|
+
/* @__PURE__ */ jsx("option", { value: "dialog", children: "Dialog" }),
|
|
784
|
+
/* @__PURE__ */ jsx("option", { value: "drawer", children: "Drawer" })
|
|
785
|
+
]
|
|
786
|
+
}
|
|
787
|
+
)
|
|
788
|
+
] }),
|
|
763
789
|
/* @__PURE__ */ jsx("button", { type: "button", style: styles.button, onClick: () => subformArray.remove(index), children: "Remove" })
|
|
764
790
|
] }, subform.id))
|
|
765
791
|
] }),
|
|
@@ -1623,6 +1649,7 @@ function createBuilderAdminPages({
|
|
|
1623
1649
|
const emptyFormValues = {
|
|
1624
1650
|
title: "",
|
|
1625
1651
|
description: "",
|
|
1652
|
+
presentation: "dialog",
|
|
1626
1653
|
sourceType: "none",
|
|
1627
1654
|
sourceTable: BUILDER_EDITOR_NONE_VALUE,
|
|
1628
1655
|
apiBasePath: "",
|