@duke333/builder-ui 0.2.2 → 0.2.3

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.
@@ -89,6 +89,7 @@ type BuilderEditorColumn = {
89
89
  key: string;
90
90
  label: string;
91
91
  sortable: boolean;
92
+ hidden?: boolean;
92
93
  align: "left" | "right";
93
94
  };
94
95
  type BuilderFormEditorEntity<TFieldType extends string = string, TTriggerEvent extends string = string> = {
@@ -111,6 +112,7 @@ type BuilderListEditorEntity<TTriggerEvent extends string = string> = {
111
112
  source: BuilderEditorSource;
112
113
  schema: {
113
114
  columns: BuilderEditorColumn[];
115
+ orderBy?: BuilderListEditorOrderByValues | BuilderListEditorOrderByValues[];
114
116
  };
115
117
  triggers: BuilderEditorTrigger<TTriggerEvent>[];
116
118
  };
@@ -188,14 +190,20 @@ type BuilderListEditorColumnValues = {
188
190
  key: string;
189
191
  label: string;
190
192
  sortable: boolean;
193
+ hidden: boolean;
191
194
  align: "left" | "right";
192
195
  };
196
+ type BuilderListEditorOrderByValues = {
197
+ field: string;
198
+ direction: "asc" | "desc";
199
+ };
193
200
  type BuilderListEditorValues<TTriggerEvent extends string = string> = {
194
201
  title: string;
195
202
  description?: string;
196
203
  sourceType: "none" | "dbTable" | "apiEndpoint";
197
204
  sourceTable: string;
198
205
  apiBasePath?: string;
206
+ orderBy: BuilderListEditorOrderByValues[];
199
207
  columns: BuilderListEditorColumnValues[];
200
208
  triggers: BuilderEditorTriggerValues<TTriggerEvent>[];
201
209
  version: number;
@@ -312,6 +320,7 @@ declare function builderListEditorInputFromValues<TTriggerEvent extends string>(
312
320
  tableName?: undefined;
313
321
  } | null;
314
322
  schema: {
323
+ orderBy?: BuilderListEditorOrderByValues[] | undefined;
315
324
  columns: BuilderListEditorColumnValues[];
316
325
  };
317
326
  triggers: {
@@ -386,6 +395,7 @@ type BuilderListEditorBodyProps<TTriggerEvent extends string> = {
386
395
  listId?: string;
387
396
  form: UseFormReturn<BuilderListEditorValues<TTriggerEvent>>;
388
397
  columnArray: UseFieldArrayReturn<BuilderListEditorValues<TTriggerEvent>, "columns">;
398
+ orderByArray: UseFieldArrayReturn<BuilderListEditorValues<TTriggerEvent>, "orderBy">;
389
399
  triggerArray: UseFieldArrayReturn<BuilderListEditorValues<TTriggerEvent>, "triggers">;
390
400
  sourceType: BuilderListEditorValues<TTriggerEvent>["sourceType"];
391
401
  sourceTable: string;
@@ -451,7 +461,7 @@ type BuilderDefaultListEditorBodyOptions = {
451
461
  listTriggerEventOptions: BuilderDefaultOption[];
452
462
  };
453
463
  declare function createBuilderDefaultFormEditorBody<TFieldType extends string, TTriggerEvent extends string>(options: BuilderDefaultFormEditorBodyOptions): ({ formId, form, fieldArray, subformArray, triggerArray, fields, sourceType, sourceTable, tables, emptyField, emptyTrigger, isSaving, importFieldsFromTable, }: BuilderFormEditorBodyProps<TFieldType, TTriggerEvent>) => react.JSX.Element;
454
- declare function createBuilderDefaultListEditorBody<TTriggerEvent extends string>(options: BuilderDefaultListEditorBodyOptions): ({ listId, form, columnArray, triggerArray, sourceType, sourceTable, tables, emptyColumn, emptyTrigger, isSaving, importColumnsFromTable, }: BuilderListEditorBodyProps<TTriggerEvent>) => react.JSX.Element;
464
+ declare function createBuilderDefaultListEditorBody<TTriggerEvent extends string>(options: BuilderDefaultListEditorBodyOptions): ({ listId, form, columnArray, orderByArray, triggerArray, sourceType, sourceTable, tables, emptyColumn, emptyTrigger, isSaving, importColumnsFromTable, }: BuilderListEditorBodyProps<TTriggerEvent>) => react.JSX.Element;
455
465
 
456
466
  type BuilderDefaultEntity = {
457
467
  id: string;
@@ -595,4 +605,4 @@ declare function createBuilderAdminPages<C extends BuilderAdminPageContracts>({
595
605
  };
596
606
  };
597
607
 
598
- export { type BuilderViewEditorEntity as A, BUILDER_EDITOR_NONE_VALUE as B, type BuilderViewEditorValues as C, builderEditorOptionsToText as D, builderEditorSearchFieldsToText as E, builderEditorTextToOptions as F, builderEditorTextToSearchFields as G, builderFormEditorFieldsFromTable as H, builderFormEditorInputFromValues as I, builderFormEditorValuesFromEntity as J, builderListEditorColumnsFromTable as K, builderListEditorInputFromValues as L, builderListEditorValuesFromEntity as M, builderViewEditorInputFromValues as N, builderViewEditorValuesFromEntity as O, createBuilderAdminPages as P, createBuilderDefaultEntityManagerComponent as Q, createBuilderDefaultFormEditorBody as R, createBuilderDefaultListEditorBody as S, createBuilderFormEditorPageComponent as T, createBuilderListEditorPageComponent as U, getBuilderEditorTriggerRoute as V, type BuilderFormEditorLayoutGroupValues as W, type BuilderFormEditorSubformValues as X, builderFormEditorDefaultLayoutGroups as Y, builderFormEditorDefaultSpan as Z, type BuilderAdminPageContracts as a, type BuilderAdminPagesOptions as b, type BuilderAdminPagesRoutes as c, type BuilderDefaultEntity as d, type BuilderDefaultEntityListResult as e, type BuilderDefaultEntityManagerDependencies as f, type BuilderDefaultEntityManagerLabels as g, type BuilderDefaultEntityManagerState as h, type BuilderDefaultEntityMutation as i, type BuilderDefaultEntityQueryResult as j, type BuilderDefaultFormEditorBodyOptions as k, type BuilderDefaultListEditorBodyOptions as l, type BuilderDefaultOption as m, type BuilderEditorDbTable as n, type BuilderEditorSelectOption as o, type BuilderEditorTriggerValues as p, type BuilderFormEditorBodyProps as q, type BuilderFormEditorEntity as r, type BuilderFormEditorFieldValues as s, type BuilderFormEditorPageDependencies as t, type BuilderFormEditorValues as u, type BuilderListEditorBodyProps as v, type BuilderListEditorColumnValues as w, type BuilderListEditorEntity as x, type BuilderListEditorPageDependencies as y, type BuilderListEditorValues as z };
608
+ export { type BuilderListEditorValues as A, BUILDER_EDITOR_NONE_VALUE as B, type BuilderViewEditorEntity as C, type BuilderViewEditorValues as D, builderEditorOptionsToText as E, builderEditorSearchFieldsToText as F, builderEditorTextToOptions as G, builderEditorTextToSearchFields as H, builderFormEditorFieldsFromTable as I, builderFormEditorInputFromValues as J, builderFormEditorValuesFromEntity as K, builderListEditorColumnsFromTable as L, builderListEditorInputFromValues as M, builderListEditorValuesFromEntity as N, builderViewEditorInputFromValues as O, builderViewEditorValuesFromEntity as P, createBuilderAdminPages as Q, createBuilderDefaultEntityManagerComponent as R, createBuilderDefaultFormEditorBody as S, createBuilderDefaultListEditorBody as T, createBuilderFormEditorPageComponent as U, createBuilderListEditorPageComponent as V, getBuilderEditorTriggerRoute as W, type BuilderFormEditorLayoutGroupValues as X, type BuilderFormEditorSubformValues as Y, builderFormEditorDefaultLayoutGroups as Z, builderFormEditorDefaultSpan as _, type BuilderAdminPageContracts as a, type BuilderAdminPagesOptions as b, type BuilderAdminPagesRoutes as c, type BuilderDefaultEntity as d, type BuilderDefaultEntityListResult as e, type BuilderDefaultEntityManagerDependencies as f, type BuilderDefaultEntityManagerLabels as g, type BuilderDefaultEntityManagerState as h, type BuilderDefaultEntityMutation as i, type BuilderDefaultEntityQueryResult as j, type BuilderDefaultFormEditorBodyOptions as k, type BuilderDefaultListEditorBodyOptions as l, type BuilderDefaultOption as m, type BuilderEditorDbTable as n, type BuilderEditorSelectOption as o, type BuilderEditorTriggerValues as p, type BuilderFormEditorBodyProps as q, type BuilderFormEditorEntity as r, type BuilderFormEditorFieldValues as s, type BuilderFormEditorPageDependencies as t, type BuilderFormEditorValues as u, type BuilderListEditorBodyProps as v, type BuilderListEditorColumnValues as w, type BuilderListEditorEntity as x, type BuilderListEditorOrderByValues as y, type BuilderListEditorPageDependencies as z };
@@ -1,5 +1,5 @@
1
- import { A as BuilderViewEditorEntity, C as BuilderViewEditorValues, W as BuilderFormEditorLayoutGroupValues, u as BuilderFormEditorValues, s as BuilderFormEditorFieldValues, X as BuilderFormEditorSubformValues } from '../BuilderAdminPages-C-jaMLOa.js';
2
- export { B as BUILDER_EDITOR_NONE_VALUE, a as BuilderAdminPageContracts, b as BuilderAdminPagesOptions, c as BuilderAdminPagesRoutes, d as BuilderDefaultEntity, e as BuilderDefaultEntityListResult, f as BuilderDefaultEntityManagerDependencies, g as BuilderDefaultEntityManagerLabels, h as BuilderDefaultEntityManagerState, i as BuilderDefaultEntityMutation, j as BuilderDefaultEntityQueryResult, k as BuilderDefaultFormEditorBodyOptions, l as BuilderDefaultListEditorBodyOptions, m as BuilderDefaultOption, n as BuilderEditorDbTable, o as BuilderEditorSelectOption, p as BuilderEditorTriggerValues, q as BuilderFormEditorBodyProps, r as BuilderFormEditorEntity, t as BuilderFormEditorPageDependencies, v as BuilderListEditorBodyProps, w as BuilderListEditorColumnValues, x as BuilderListEditorEntity, y as BuilderListEditorPageDependencies, z as BuilderListEditorValues, D as builderEditorOptionsToText, E as builderEditorSearchFieldsToText, F as builderEditorTextToOptions, G as builderEditorTextToSearchFields, Y as builderFormEditorDefaultLayoutGroups, Z as builderFormEditorDefaultSpan, H as builderFormEditorFieldsFromTable, I as builderFormEditorInputFromValues, J as builderFormEditorValuesFromEntity, K as builderListEditorColumnsFromTable, L as builderListEditorInputFromValues, M as builderListEditorValuesFromEntity, N as builderViewEditorInputFromValues, O as builderViewEditorValuesFromEntity, P as createBuilderAdminPages, Q as createBuilderDefaultEntityManagerComponent, R as createBuilderDefaultFormEditorBody, S as createBuilderDefaultListEditorBody, T as createBuilderFormEditorPageComponent, U as createBuilderListEditorPageComponent, V as getBuilderEditorTriggerRoute } from '../BuilderAdminPages-C-jaMLOa.js';
1
+ import { C as BuilderViewEditorEntity, D as BuilderViewEditorValues, X as BuilderFormEditorLayoutGroupValues, u as BuilderFormEditorValues, s as BuilderFormEditorFieldValues, Y as BuilderFormEditorSubformValues } from '../BuilderAdminPages-DrOrFyIX.js';
2
+ export { B as BUILDER_EDITOR_NONE_VALUE, a as BuilderAdminPageContracts, b as BuilderAdminPagesOptions, c as BuilderAdminPagesRoutes, d as BuilderDefaultEntity, e as BuilderDefaultEntityListResult, f as BuilderDefaultEntityManagerDependencies, g as BuilderDefaultEntityManagerLabels, h as BuilderDefaultEntityManagerState, i as BuilderDefaultEntityMutation, j as BuilderDefaultEntityQueryResult, k as BuilderDefaultFormEditorBodyOptions, l as BuilderDefaultListEditorBodyOptions, m as BuilderDefaultOption, n as BuilderEditorDbTable, o as BuilderEditorSelectOption, p as BuilderEditorTriggerValues, q as BuilderFormEditorBodyProps, r as BuilderFormEditorEntity, t as BuilderFormEditorPageDependencies, v as BuilderListEditorBodyProps, w as BuilderListEditorColumnValues, x as BuilderListEditorEntity, y as BuilderListEditorOrderByValues, z as BuilderListEditorPageDependencies, A as BuilderListEditorValues, E as builderEditorOptionsToText, F as builderEditorSearchFieldsToText, G as builderEditorTextToOptions, H as builderEditorTextToSearchFields, Z as builderFormEditorDefaultLayoutGroups, _ as builderFormEditorDefaultSpan, I as builderFormEditorFieldsFromTable, J as builderFormEditorInputFromValues, K as builderFormEditorValuesFromEntity, L as builderListEditorColumnsFromTable, M as builderListEditorInputFromValues, N as builderListEditorValuesFromEntity, O as builderViewEditorInputFromValues, P as builderViewEditorValuesFromEntity, Q as createBuilderAdminPages, R as createBuilderDefaultEntityManagerComponent, S as createBuilderDefaultFormEditorBody, T as createBuilderDefaultListEditorBody, U as createBuilderFormEditorPageComponent, V as createBuilderListEditorPageComponent, W as getBuilderEditorTriggerRoute } from '../BuilderAdminPages-DrOrFyIX.js';
3
3
  import * as react from 'react';
4
4
  import { ComponentType, ReactNode } from 'react';
5
5
  import { BuilderApiContracts } from '../api/index.js';
@@ -154,16 +154,19 @@ function builderFormEditorValuesFromEntity(form, emptyValues) {
154
154
  function builderListEditorValuesFromEntity(list, emptyValues) {
155
155
  if (!list) return emptyValues;
156
156
  const source = list.source;
157
+ const orderBy = list.schema.orderBy ? Array.isArray(list.schema.orderBy) ? list.schema.orderBy : [list.schema.orderBy] : [];
157
158
  return {
158
159
  title: list.title,
159
160
  description: list.description ?? "",
160
161
  sourceType: source?.type ?? "none",
161
162
  sourceTable: source?.type === "dbTable" ? source.tableName : BUILDER_EDITOR_NONE_VALUE,
162
163
  apiBasePath: source?.type === "apiEndpoint" ? source.basePath : "",
164
+ orderBy,
163
165
  columns: list.schema.columns.map((column) => ({
164
166
  key: column.key,
165
167
  label: column.label,
166
168
  sortable: column.sortable,
169
+ hidden: column.hidden ?? false,
167
170
  align: column.align
168
171
  })),
169
172
  triggers: valuesFromTriggers(list.triggers),
@@ -208,6 +211,7 @@ function builderListEditorColumnsFromTable(table) {
208
211
  key: column.name,
209
212
  label: column.label,
210
213
  sortable: column.sortable,
214
+ hidden: false,
211
215
  align: column.fieldType === "number" || column.fieldType === "money" ? "right" : "left"
212
216
  }));
213
217
  }
@@ -279,11 +283,19 @@ function builderFormEditorInputFromValues(values) {
279
283
  }
280
284
  function builderListEditorInputFromValues(values) {
281
285
  const source = values.sourceType === "dbTable" && values.sourceTable !== BUILDER_EDITOR_NONE_VALUE ? { type: "dbTable", tableName: values.sourceTable } : values.sourceType === "apiEndpoint" && values.apiBasePath ? { type: "apiEndpoint", basePath: values.apiBasePath } : null;
286
+ const orderBy = Array.from(
287
+ new Map(
288
+ values.orderBy.filter((rule) => rule.field && rule.field !== BUILDER_EDITOR_NONE_VALUE).map((rule) => [rule.field, rule])
289
+ ).values()
290
+ );
282
291
  return {
283
292
  title: values.title,
284
293
  description: values.description || null,
285
294
  source,
286
- schema: { columns: values.columns },
295
+ schema: {
296
+ columns: values.columns,
297
+ ...source && orderBy.length > 0 ? { orderBy } : {}
298
+ },
287
299
  triggers: values.triggers.map((trigger) => ({
288
300
  event: trigger.event,
289
301
  action: "callApi",
@@ -486,10 +498,18 @@ function createBuilderDefaultFormEditorBody(options) {
486
498
  ] }),
487
499
  sourceType === "dbTable" ? /* @__PURE__ */ jsxs("label", { style: styles.field, children: [
488
500
  /* @__PURE__ */ jsx("span", { style: styles.label, children: "Table" }),
489
- /* @__PURE__ */ jsxs("select", { style: styles.input, ...form.register("sourceTable"), children: [
490
- /* @__PURE__ */ jsx("option", { value: BUILDER_EDITOR_NONE_VALUE, children: "Select table" }),
491
- tables.map((table) => /* @__PURE__ */ jsx("option", { value: table.name, children: table.label ?? table.name }, table.name))
492
- ] })
501
+ /* @__PURE__ */ jsxs(
502
+ "select",
503
+ {
504
+ style: styles.input,
505
+ value: sourceTable,
506
+ ...form.register("sourceTable"),
507
+ children: [
508
+ /* @__PURE__ */ jsx("option", { value: BUILDER_EDITOR_NONE_VALUE, children: "Select table" }),
509
+ tables.map((table) => /* @__PURE__ */ jsx("option", { value: table.name, children: table.label ?? table.name }, table.name))
510
+ ]
511
+ }
512
+ )
493
513
  ] }) : null,
494
514
  sourceType === "apiEndpoint" ? /* @__PURE__ */ jsxs("label", { style: styles.field, children: [
495
515
  /* @__PURE__ */ jsx("span", { style: styles.label, children: "API base path" }),
@@ -747,6 +767,7 @@ function createBuilderDefaultListEditorBody(options) {
747
767
  listId,
748
768
  form,
749
769
  columnArray,
770
+ orderByArray,
750
771
  triggerArray,
751
772
  sourceType,
752
773
  sourceTable,
@@ -756,6 +777,8 @@ function createBuilderDefaultListEditorBody(options) {
756
777
  isSaving,
757
778
  importColumnsFromTable
758
779
  }) {
780
+ const selectedTable = tables.find((table) => table.name === sourceTable);
781
+ const orderByColumns = selectedTable?.columns.filter((column) => column.sortable) ?? [];
759
782
  return /* @__PURE__ */ jsxs("div", { style: styles.page, children: [
760
783
  /* @__PURE__ */ jsxs("div", { style: styles.header, children: [
761
784
  /* @__PURE__ */ jsxs("div", { children: [
@@ -788,10 +811,18 @@ function createBuilderDefaultListEditorBody(options) {
788
811
  ] }),
789
812
  sourceType === "dbTable" ? /* @__PURE__ */ jsxs("label", { style: styles.field, children: [
790
813
  /* @__PURE__ */ jsx("span", { style: styles.label, children: "Table" }),
791
- /* @__PURE__ */ jsxs("select", { style: styles.input, ...form.register("sourceTable"), children: [
792
- /* @__PURE__ */ jsx("option", { value: BUILDER_EDITOR_NONE_VALUE, children: "Select table" }),
793
- tables.map((table) => /* @__PURE__ */ jsx("option", { value: table.name, children: table.label ?? table.name }, table.name))
794
- ] })
814
+ /* @__PURE__ */ jsxs(
815
+ "select",
816
+ {
817
+ style: styles.input,
818
+ value: sourceTable,
819
+ ...form.register("sourceTable"),
820
+ children: [
821
+ /* @__PURE__ */ jsx("option", { value: BUILDER_EDITOR_NONE_VALUE, children: "Select table" }),
822
+ tables.map((table) => /* @__PURE__ */ jsx("option", { value: table.name, children: table.label ?? table.name }, table.name))
823
+ ]
824
+ }
825
+ )
795
826
  ] }) : null,
796
827
  sourceType === "apiEndpoint" ? /* @__PURE__ */ jsxs("label", { style: styles.field, children: [
797
828
  /* @__PURE__ */ jsx("span", { style: styles.label, children: "API base path" }),
@@ -809,6 +840,85 @@ function createBuilderDefaultListEditorBody(options) {
809
840
  ) }) : null
810
841
  ] })
811
842
  ] }),
843
+ /* @__PURE__ */ jsxs("section", { style: styles.section, children: [
844
+ /* @__PURE__ */ jsxs("div", { style: styles.sectionHeader, children: [
845
+ /* @__PURE__ */ jsxs("div", { children: [
846
+ /* @__PURE__ */ jsx("h2", { style: styles.sectionTitle, children: "Default ordering" }),
847
+ /* @__PURE__ */ jsx("p", { style: styles.description, children: "Rules are applied from top to bottom." })
848
+ ] }),
849
+ /* @__PURE__ */ jsx(
850
+ "button",
851
+ {
852
+ type: "button",
853
+ style: styles.button,
854
+ disabled: sourceType === "none" || orderByArray.fields.length >= 8,
855
+ onClick: () => orderByArray.append({
856
+ field: sourceType === "dbTable" ? orderByColumns[0]?.name ?? BUILDER_EDITOR_NONE_VALUE : "",
857
+ direction: "desc"
858
+ }),
859
+ children: "Add ordering"
860
+ }
861
+ )
862
+ ] }),
863
+ orderByArray.fields.length === 0 ? /* @__PURE__ */ jsx("div", { style: styles.grid, children: /* @__PURE__ */ jsx("p", { style: styles.description, children: "Automatic ordering is used." }) }) : null,
864
+ orderByArray.fields.map((rule, index) => /* @__PURE__ */ jsxs("div", { style: styles.row, children: [
865
+ sourceType === "dbTable" ? /* @__PURE__ */ jsxs("label", { style: styles.field, children: [
866
+ /* @__PURE__ */ jsx("span", { style: styles.label, children: "Order by field" }),
867
+ /* @__PURE__ */ jsxs("select", { style: styles.input, ...form.register(`orderBy.${index}.field`), children: [
868
+ /* @__PURE__ */ jsx("option", { value: BUILDER_EDITOR_NONE_VALUE, children: "Select field" }),
869
+ orderByColumns.map((column) => /* @__PURE__ */ jsx("option", { value: column.name, children: column.label }, column.name))
870
+ ] })
871
+ ] }) : /* @__PURE__ */ jsxs("label", { style: styles.field, children: [
872
+ /* @__PURE__ */ jsx("span", { style: styles.label, children: "Order by field" }),
873
+ /* @__PURE__ */ jsx(
874
+ "input",
875
+ {
876
+ style: styles.input,
877
+ placeholder: "createdAt",
878
+ ...form.register(`orderBy.${index}.field`)
879
+ }
880
+ )
881
+ ] }),
882
+ /* @__PURE__ */ jsxs("label", { style: styles.field, children: [
883
+ /* @__PURE__ */ jsx("span", { style: styles.label, children: "Direction" }),
884
+ /* @__PURE__ */ jsxs("select", { style: styles.input, ...form.register(`orderBy.${index}.direction`), children: [
885
+ /* @__PURE__ */ jsx("option", { value: "asc", children: "Ascending" }),
886
+ /* @__PURE__ */ jsx("option", { value: "desc", children: "Descending" })
887
+ ] })
888
+ ] }),
889
+ /* @__PURE__ */ jsxs("div", { style: styles.actions, children: [
890
+ /* @__PURE__ */ jsx(
891
+ "button",
892
+ {
893
+ type: "button",
894
+ style: styles.button,
895
+ disabled: index === 0,
896
+ onClick: () => orderByArray.move(index, index - 1),
897
+ children: "Move up"
898
+ }
899
+ ),
900
+ /* @__PURE__ */ jsx(
901
+ "button",
902
+ {
903
+ type: "button",
904
+ style: styles.button,
905
+ disabled: index === orderByArray.fields.length - 1,
906
+ onClick: () => orderByArray.move(index, index + 1),
907
+ children: "Move down"
908
+ }
909
+ ),
910
+ /* @__PURE__ */ jsx(
911
+ "button",
912
+ {
913
+ type: "button",
914
+ style: styles.button,
915
+ onClick: () => orderByArray.remove(index),
916
+ children: "Remove"
917
+ }
918
+ )
919
+ ] })
920
+ ] }, rule.id))
921
+ ] }),
812
922
  /* @__PURE__ */ jsxs("section", { style: styles.section, children: [
813
923
  /* @__PURE__ */ jsxs("div", { style: styles.sectionHeader, children: [
814
924
  /* @__PURE__ */ jsxs("div", { children: [
@@ -849,16 +959,10 @@ function createBuilderDefaultListEditorBody(options) {
849
959
  /* @__PURE__ */ jsx("input", { type: "checkbox", ...form.register(`columns.${index}.sortable`) }),
850
960
  "Sortable"
851
961
  ] }),
852
- /* @__PURE__ */ jsx(
853
- "button",
854
- {
855
- type: "button",
856
- style: styles.button,
857
- onClick: () => columnArray.remove(index),
858
- disabled: columnArray.fields.length <= 1,
859
- children: "Remove"
860
- }
861
- )
962
+ /* @__PURE__ */ jsxs("label", { style: styles.checkboxField, children: [
963
+ /* @__PURE__ */ jsx("input", { type: "checkbox", ...form.register(`columns.${index}.hidden`) }),
964
+ "Hidden"
965
+ ] })
862
966
  ] }, column.id))
863
967
  ] }),
864
968
  /* @__PURE__ */ jsxs("section", { style: styles.section, children: [
@@ -1387,6 +1491,7 @@ function createBuilderListEditorPageComponent(deps) {
1387
1491
  defaultValues: deps.emptyValues
1388
1492
  });
1389
1493
  const columnArray = useFieldArray({ control: form.control, name: "columns" });
1494
+ const orderByArray = useFieldArray({ control: form.control, name: "orderBy" });
1390
1495
  const triggerArray = useFieldArray({ control: form.control, name: "triggers" });
1391
1496
  const sourceType = useWatch({ control: form.control, name: "sourceType" });
1392
1497
  const sourceTable = useWatch({ control: form.control, name: "sourceTable" });
@@ -1420,6 +1525,7 @@ function createBuilderListEditorPageComponent(deps) {
1420
1525
  listId,
1421
1526
  form,
1422
1527
  columnArray,
1528
+ orderByArray,
1423
1529
  triggerArray,
1424
1530
  sourceType,
1425
1531
  sourceTable,
@@ -1582,6 +1688,7 @@ function createBuilderAdminPages({
1582
1688
  key: "name",
1583
1689
  label: "Name",
1584
1690
  sortable: true,
1691
+ hidden: false,
1585
1692
  align: "left"
1586
1693
  };
1587
1694
  const emptyListValues = {
@@ -1590,6 +1697,7 @@ function createBuilderAdminPages({
1590
1697
  sourceType: "none",
1591
1698
  sourceTable: BUILDER_EDITOR_NONE_VALUE,
1592
1699
  apiBasePath: "",
1700
+ orderBy: [],
1593
1701
  columns: [emptyColumn],
1594
1702
  triggers: [],
1595
1703
  version: 0