@antelopejs/interface-dms 0.1.0 → 0.2.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.
@@ -24,9 +24,9 @@ export declare const FormSchema: z.ZodObject<{
24
24
  }, "strip", z.ZodTypeAny, {
25
25
  type: DataType;
26
26
  id: string;
27
- required?: boolean | undefined;
28
27
  label?: string | undefined;
29
28
  disabled?: boolean | undefined;
29
+ required?: boolean | undefined;
30
30
  description?: string | undefined;
31
31
  defaultValue?: DefaultValue | undefined;
32
32
  inputComponent?: ComponentInfoSerialized | undefined;
@@ -34,9 +34,9 @@ export declare const FormSchema: z.ZodObject<{
34
34
  }, {
35
35
  type: DataType;
36
36
  id: string;
37
- required?: boolean | undefined;
38
37
  label?: string | undefined;
39
38
  disabled?: boolean | undefined;
39
+ required?: boolean | undefined;
40
40
  description?: string | undefined;
41
41
  defaultValue?: DefaultValue | undefined;
42
42
  inputComponent?: ComponentInfoSerialized | undefined;
@@ -49,35 +49,35 @@ export declare const FormSchema: z.ZodObject<{
49
49
  fields: {
50
50
  type: DataType;
51
51
  id: string;
52
- required?: boolean | undefined;
53
52
  label?: string | undefined;
54
53
  disabled?: boolean | undefined;
54
+ required?: boolean | undefined;
55
55
  description?: string | undefined;
56
56
  defaultValue?: DefaultValue | undefined;
57
57
  inputComponent?: ComponentInfoSerialized | undefined;
58
58
  localized?: boolean | undefined;
59
59
  }[];
60
- order?: number | undefined;
61
60
  label?: string | undefined;
62
61
  description?: string | undefined;
63
62
  orientation?: "horizontal" | "vertical" | undefined;
63
+ order?: number | undefined;
64
64
  }, {
65
65
  id: string;
66
66
  fields: {
67
67
  type: DataType;
68
68
  id: string;
69
- required?: boolean | undefined;
70
69
  label?: string | undefined;
71
70
  disabled?: boolean | undefined;
71
+ required?: boolean | undefined;
72
72
  description?: string | undefined;
73
73
  defaultValue?: DefaultValue | undefined;
74
74
  inputComponent?: ComponentInfoSerialized | undefined;
75
75
  localized?: boolean | undefined;
76
76
  }[];
77
- order?: number | undefined;
78
77
  label?: string | undefined;
79
78
  description?: string | undefined;
80
79
  orientation?: "horizontal" | "vertical" | undefined;
80
+ order?: number | undefined;
81
81
  }>, z.ZodObject<{
82
82
  id: z.ZodString;
83
83
  label: z.ZodOptional<z.ZodString>;
@@ -91,9 +91,9 @@ export declare const FormSchema: z.ZodObject<{
91
91
  }, "strip", z.ZodTypeAny, {
92
92
  type: DataType;
93
93
  id: string;
94
- required?: boolean | undefined;
95
94
  label?: string | undefined;
96
95
  disabled?: boolean | undefined;
96
+ required?: boolean | undefined;
97
97
  description?: string | undefined;
98
98
  defaultValue?: DefaultValue | undefined;
99
99
  inputComponent?: ComponentInfoSerialized | undefined;
@@ -101,9 +101,9 @@ export declare const FormSchema: z.ZodObject<{
101
101
  }, {
102
102
  type: DataType;
103
103
  id: string;
104
- required?: boolean | undefined;
105
104
  label?: string | undefined;
106
105
  disabled?: boolean | undefined;
106
+ required?: boolean | undefined;
107
107
  description?: string | undefined;
108
108
  defaultValue?: DefaultValue | undefined;
109
109
  inputComponent?: ComponentInfoSerialized | undefined;
@@ -124,9 +124,9 @@ export declare const FormSchema: z.ZodObject<{
124
124
  fields: ({
125
125
  type: DataType;
126
126
  id: string;
127
- required?: boolean | undefined;
128
127
  label?: string | undefined;
129
128
  disabled?: boolean | undefined;
129
+ required?: boolean | undefined;
130
130
  description?: string | undefined;
131
131
  defaultValue?: DefaultValue | undefined;
132
132
  inputComponent?: ComponentInfoSerialized | undefined;
@@ -136,23 +136,23 @@ export declare const FormSchema: z.ZodObject<{
136
136
  fields: {
137
137
  type: DataType;
138
138
  id: string;
139
- required?: boolean | undefined;
140
139
  label?: string | undefined;
141
140
  disabled?: boolean | undefined;
141
+ required?: boolean | undefined;
142
142
  description?: string | undefined;
143
143
  defaultValue?: DefaultValue | undefined;
144
144
  inputComponent?: ComponentInfoSerialized | undefined;
145
145
  localized?: boolean | undefined;
146
146
  }[];
147
- order?: number | undefined;
148
147
  label?: string | undefined;
149
148
  description?: string | undefined;
150
149
  orientation?: "horizontal" | "vertical" | undefined;
150
+ order?: number | undefined;
151
151
  })[];
152
- title?: string | undefined;
153
- description?: string | undefined;
154
152
  slotId?: string | undefined;
153
+ description?: string | undefined;
155
154
  errorMessage?: string | undefined;
155
+ title?: string | undefined;
156
156
  fetchUrl?: string | undefined;
157
157
  fetchUrlMethod?: HttpMethod | undefined;
158
158
  submitUrl?: string | undefined;
@@ -166,9 +166,9 @@ export declare const FormSchema: z.ZodObject<{
166
166
  fields: ({
167
167
  type: DataType;
168
168
  id: string;
169
- required?: boolean | undefined;
170
169
  label?: string | undefined;
171
170
  disabled?: boolean | undefined;
171
+ required?: boolean | undefined;
172
172
  description?: string | undefined;
173
173
  defaultValue?: DefaultValue | undefined;
174
174
  inputComponent?: ComponentInfoSerialized | undefined;
@@ -178,23 +178,23 @@ export declare const FormSchema: z.ZodObject<{
178
178
  fields: {
179
179
  type: DataType;
180
180
  id: string;
181
- required?: boolean | undefined;
182
181
  label?: string | undefined;
183
182
  disabled?: boolean | undefined;
183
+ required?: boolean | undefined;
184
184
  description?: string | undefined;
185
185
  defaultValue?: DefaultValue | undefined;
186
186
  inputComponent?: ComponentInfoSerialized | undefined;
187
187
  localized?: boolean | undefined;
188
188
  }[];
189
- order?: number | undefined;
190
189
  label?: string | undefined;
191
190
  description?: string | undefined;
192
191
  orientation?: "horizontal" | "vertical" | undefined;
192
+ order?: number | undefined;
193
193
  })[];
194
- title?: string | undefined;
195
- description?: string | undefined;
196
194
  slotId?: string | undefined;
195
+ description?: string | undefined;
197
196
  errorMessage?: string | undefined;
197
+ title?: string | undefined;
198
198
  fetchUrl?: string | undefined;
199
199
  fetchUrlMethod?: HttpMethod | undefined;
200
200
  submitUrl?: string | undefined;
@@ -2,13 +2,17 @@ import { ComponentBuilder } from "../component";
2
2
  import { z } from "zod";
3
3
  export interface GridOptions {
4
4
  gap?: string;
5
+ minColumnWidth?: string;
5
6
  }
6
7
  export declare const GridSchema: z.ZodObject<{
7
8
  gap: z.ZodDefault<z.ZodString>;
9
+ minColumnWidth: z.ZodDefault<z.ZodString>;
8
10
  }, "strip", z.ZodTypeAny, {
9
11
  gap: string;
12
+ minColumnWidth: string;
10
13
  }, {
11
14
  gap?: string | undefined;
15
+ minColumnWidth?: string | undefined;
12
16
  }>;
13
17
  export declare const GridChildSchema: z.ZodObject<{
14
18
  colSpan: z.ZodOptional<z.ZodNumber>;
package/dist/base/grid.js CHANGED
@@ -9,11 +9,16 @@ const block_registry_1 = require("./block-registry");
9
9
  const GRID_COMPONENT_NAME = "dms-grid";
10
10
  const GRID_ROW_COMPONENT_NAME = "dms-grid-row";
11
11
  const GRID_DEFAULT_GAP = "1rem";
12
+ const GRID_DEFAULT_MIN_COLUMN_WIDTH = "240px";
12
13
  exports.GridSchema = zod_1.z.object({
13
14
  gap: (0, block_registry_1.ui)(zod_1.z
14
15
  .string()
15
16
  .default(GRID_DEFAULT_GAP)
16
17
  .describe("Gap between rows and columns, as a CSS length."), { label: "Gap", group: "layout" }),
18
+ minColumnWidth: (0, block_registry_1.ui)(zod_1.z
19
+ .string()
20
+ .default(GRID_DEFAULT_MIN_COLUMN_WIDTH)
21
+ .describe("Width below which a column is dropped, as a CSS length."), { label: "Minimum column width", group: "layout" }),
17
22
  });
18
23
  exports.GridChildSchema = zod_1.z.object({
19
24
  colSpan: (0, block_registry_1.ui)(zod_1.z
@@ -27,6 +32,7 @@ function Grid(options) {
27
32
  return new component_1.ComponentBuilder(GRID_COMPONENT_NAME)
28
33
  .options({
29
34
  gap: GRID_DEFAULT_GAP,
35
+ minColumnWidth: GRID_DEFAULT_MIN_COLUMN_WIDTH,
30
36
  ...options,
31
37
  })
32
38
  .meta({
@@ -1 +1 @@
1
- {"version":3,"file":"grid.js","sourceRoot":"","sources":["../../src/base/grid.ts"],"names":[],"mappings":";;;AAkEA,oBAYC;AAeD,0BAMC;AAnGD,4CAAgD;AAChD,6BAAwB;AACxB,qDAA+E;AAE/E,MAAM,mBAA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uB;IACtC,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,uBAAe;IAC1B,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,8CAA8C;QAC3D,KAAK,EAAE,QAAQ;KAChB;CACF,CAAC,CAAC"}
@@ -44,36 +44,36 @@ export declare const KpiCardSchema: z.ZodObject<{
44
44
  staticSparkline: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
45
45
  }, "strip", z.ZodTypeAny, {
46
46
  title: string;
47
+ icon?: string | undefined;
47
48
  variant?: "default" | "stat" | undefined;
48
- invert?: boolean | undefined;
49
49
  description?: string | undefined;
50
- icon?: string | undefined;
51
50
  fetchUrl?: string | undefined;
52
51
  fetchUrlMethod?: HttpMethod | undefined;
53
52
  periodScope?: string | undefined;
54
- valueFormat?: "number" | "percent" | "currency" | "compact" | undefined;
53
+ valueFormat?: "number" | "currency" | "percent" | "compact" | undefined;
55
54
  currencyCode?: string | undefined;
56
55
  showDelta?: boolean | undefined;
57
56
  showSparkline?: boolean | undefined;
58
57
  sparklineAccent?: "auto" | ChartColorValue | undefined;
58
+ invert?: boolean | undefined;
59
59
  compareLabel?: string | undefined;
60
60
  staticValue?: number | undefined;
61
61
  staticDelta?: number | undefined;
62
62
  staticSparkline?: number[] | undefined;
63
63
  }, {
64
64
  title: string;
65
+ icon?: string | undefined;
65
66
  variant?: "default" | "stat" | undefined;
66
- invert?: boolean | undefined;
67
67
  description?: string | undefined;
68
- icon?: string | undefined;
69
68
  fetchUrl?: string | undefined;
70
69
  fetchUrlMethod?: HttpMethod | undefined;
71
70
  periodScope?: string | undefined;
72
- valueFormat?: "number" | "percent" | "currency" | "compact" | undefined;
71
+ valueFormat?: "number" | "currency" | "percent" | "compact" | undefined;
73
72
  currencyCode?: string | undefined;
74
73
  showDelta?: boolean | undefined;
75
74
  showSparkline?: boolean | undefined;
76
75
  sparklineAccent?: "auto" | ChartColorValue | undefined;
76
+ invert?: boolean | undefined;
77
77
  compareLabel?: string | undefined;
78
78
  staticValue?: number | undefined;
79
79
  staticDelta?: number | undefined;
@@ -40,23 +40,23 @@ export declare const PeriodSelectorSchema: z.ZodObject<{
40
40
  variant?: "default" | "segmented" | undefined;
41
41
  size?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
42
42
  defaultPreset?: "custom" | "last-hour" | "last-24h" | "today" | "yesterday" | "last-7-days" | "last-30-days" | "last-90-days" | "this-month" | "last-month" | "this-quarter" | "last-quarter" | "ytd" | "last-year" | undefined;
43
- defaultComparison?: "none" | "custom" | "previous-period" | "previous-year" | undefined;
43
+ defaultComparison?: "custom" | "none" | "previous-period" | "previous-year" | undefined;
44
44
  presets?: ("custom" | "last-hour" | "last-24h" | "today" | "yesterday" | "last-7-days" | "last-30-days" | "last-90-days" | "this-month" | "last-month" | "this-quarter" | "last-quarter" | "ytd" | "last-year")[] | undefined;
45
- comparisons?: ("none" | "custom" | "previous-period" | "previous-year")[] | undefined;
45
+ comparisons?: ("custom" | "none" | "previous-period" | "previous-year")[] | undefined;
46
46
  presetLabels?: Partial<Record<"custom" | "last-hour" | "last-24h" | "today" | "yesterday" | "last-7-days" | "last-30-days" | "last-90-days" | "this-month" | "last-month" | "this-quarter" | "last-quarter" | "ytd" | "last-year", string>> | undefined;
47
- comparisonLabels?: Partial<Record<"none" | "custom" | "previous-period" | "previous-year", string>> | undefined;
48
- align?: "center" | "left" | "right" | undefined;
47
+ comparisonLabels?: Partial<Record<"custom" | "none" | "previous-period" | "previous-year", string>> | undefined;
48
+ align?: "left" | "right" | "center" | undefined;
49
49
  showRangeLabel?: boolean | undefined;
50
50
  }, {
51
51
  id: string;
52
52
  variant?: "default" | "segmented" | undefined;
53
53
  size?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
54
54
  defaultPreset?: "custom" | "last-hour" | "last-24h" | "today" | "yesterday" | "last-7-days" | "last-30-days" | "last-90-days" | "this-month" | "last-month" | "this-quarter" | "last-quarter" | "ytd" | "last-year" | undefined;
55
- defaultComparison?: "none" | "custom" | "previous-period" | "previous-year" | undefined;
55
+ defaultComparison?: "custom" | "none" | "previous-period" | "previous-year" | undefined;
56
56
  presets?: ("custom" | "last-hour" | "last-24h" | "today" | "yesterday" | "last-7-days" | "last-30-days" | "last-90-days" | "this-month" | "last-month" | "this-quarter" | "last-quarter" | "ytd" | "last-year")[] | undefined;
57
- comparisons?: ("none" | "custom" | "previous-period" | "previous-year")[] | undefined;
57
+ comparisons?: ("custom" | "none" | "previous-period" | "previous-year")[] | undefined;
58
58
  presetLabels?: Partial<Record<"custom" | "last-hour" | "last-24h" | "today" | "yesterday" | "last-7-days" | "last-30-days" | "last-90-days" | "this-month" | "last-month" | "this-quarter" | "last-quarter" | "ytd" | "last-year", string>> | undefined;
59
- comparisonLabels?: Partial<Record<"none" | "custom" | "previous-period" | "previous-year", string>> | undefined;
60
- align?: "center" | "left" | "right" | undefined;
59
+ comparisonLabels?: Partial<Record<"custom" | "none" | "previous-period" | "previous-year", string>> | undefined;
60
+ align?: "left" | "right" | "center" | undefined;
61
61
  showRangeLabel?: boolean | undefined;
62
62
  }>;
@@ -11,11 +11,11 @@ export declare const PlaceholderSchema: z.ZodObject<{
11
11
  width: z.ZodOptional<z.ZodString>;
12
12
  }, "strip", z.ZodTypeAny, {
13
13
  height: string;
14
- width?: string | undefined;
15
14
  label?: string | undefined;
15
+ width?: string | undefined;
16
16
  }, {
17
+ label?: string | undefined;
17
18
  height?: string | undefined;
18
19
  width?: string | undefined;
19
- label?: string | undefined;
20
20
  }>;
21
21
  export declare function Placeholder(options?: PlaceholderOptions): ComponentBuilder<PlaceholderOptions>;
@@ -25,13 +25,13 @@ export declare const HStackSchema: z.ZodObject<{
25
25
  wrap: z.ZodDefault<z.ZodBoolean>;
26
26
  }, "strip", z.ZodTypeAny, {
27
27
  wrap: boolean;
28
- alignment: "center" | "end" | "start" | "stretch";
29
- distribution: "center" | "end" | "start" | "space-between" | "space-around" | "space-evenly";
28
+ alignment: "end" | "start" | "center" | "stretch";
29
+ distribution: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly";
30
30
  spacing: string;
31
31
  }, {
32
32
  wrap?: boolean | undefined;
33
- alignment?: "center" | "end" | "start" | "stretch" | undefined;
34
- distribution?: "center" | "end" | "start" | "space-between" | "space-around" | "space-evenly" | undefined;
33
+ alignment?: "end" | "start" | "center" | "stretch" | undefined;
34
+ distribution?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | undefined;
35
35
  spacing?: string | undefined;
36
36
  }>;
37
37
  export declare const VStackSchema: z.ZodObject<{
@@ -39,12 +39,12 @@ export declare const VStackSchema: z.ZodObject<{
39
39
  distribution: z.ZodDefault<z.ZodEnum<["start", "center", "end", "space-between", "space-around", "space-evenly"]>>;
40
40
  spacing: z.ZodDefault<z.ZodString>;
41
41
  }, "strip", z.ZodTypeAny, {
42
- alignment: "center" | "end" | "start" | "stretch";
43
- distribution: "center" | "end" | "start" | "space-between" | "space-around" | "space-evenly";
42
+ alignment: "end" | "start" | "center" | "stretch";
43
+ distribution: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly";
44
44
  spacing: string;
45
45
  }, {
46
- alignment?: "center" | "end" | "start" | "stretch" | undefined;
47
- distribution?: "center" | "end" | "start" | "space-between" | "space-around" | "space-evenly" | undefined;
46
+ alignment?: "end" | "start" | "center" | "stretch" | undefined;
47
+ distribution?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | undefined;
48
48
  spacing?: string | undefined;
49
49
  }>;
50
50
  export declare const SpacerSchema: z.ZodObject<{
@@ -56,9 +56,9 @@ export declare const SpacerSchema: z.ZodObject<{
56
56
  minSize?: string | undefined;
57
57
  maxSize?: string | undefined;
58
58
  }, {
59
- grow?: number | undefined;
60
59
  minSize?: string | undefined;
61
60
  maxSize?: string | undefined;
61
+ grow?: number | undefined;
62
62
  }>;
63
63
  export declare function HStack(options?: HStackOptions): ComponentBuilder<HStackOptions>;
64
64
  export declare function VStack(options?: VStackOptions): ComponentBuilder<VStackOptions>;
@@ -52,14 +52,14 @@ export declare const TabSchema: z.ZodObject<{
52
52
  variant: z.ZodOptional<z.ZodEnum<["solid", "outline", "soft", "subtle"]>>;
53
53
  size: z.ZodOptional<z.ZodNativeEnum<typeof Size>>;
54
54
  }, "strip", z.ZodTypeAny, {
55
- variant?: "outline" | "solid" | "soft" | "subtle" | undefined;
56
- color?: string | undefined;
57
55
  label?: string | number | undefined;
56
+ variant?: "solid" | "outline" | "soft" | "subtle" | undefined;
57
+ color?: string | undefined;
58
58
  size?: Size | undefined;
59
59
  }, {
60
- variant?: "outline" | "solid" | "soft" | "subtle" | undefined;
61
- color?: string | undefined;
62
60
  label?: string | number | undefined;
61
+ variant?: "solid" | "outline" | "soft" | "subtle" | undefined;
62
+ color?: string | undefined;
63
63
  size?: Size | undefined;
64
64
  }>]>>;
65
65
  disabled: z.ZodOptional<z.ZodBoolean>;
@@ -80,34 +80,34 @@ export declare const TabSchema: z.ZodObject<{
80
80
  }, "strip", z.ZodTypeAny, {
81
81
  label: string;
82
82
  slot: string;
83
- disabled?: boolean | undefined;
84
83
  icon?: string | undefined;
84
+ disabled?: boolean | undefined;
85
85
  avatar?: {
86
86
  size?: Size | undefined;
87
87
  alt?: string | undefined;
88
88
  src?: string | undefined;
89
89
  } | undefined;
90
90
  badge?: string | number | {
91
- variant?: "outline" | "solid" | "soft" | "subtle" | undefined;
92
- color?: string | undefined;
93
91
  label?: string | number | undefined;
92
+ variant?: "solid" | "outline" | "soft" | "subtle" | undefined;
93
+ color?: string | undefined;
94
94
  size?: Size | undefined;
95
95
  } | undefined;
96
96
  shortcut?: string | undefined;
97
97
  }, {
98
98
  label: string;
99
99
  slot: string;
100
- disabled?: boolean | undefined;
101
100
  icon?: string | undefined;
101
+ disabled?: boolean | undefined;
102
102
  avatar?: {
103
103
  size?: Size | undefined;
104
104
  alt?: string | undefined;
105
105
  src?: string | undefined;
106
106
  } | undefined;
107
107
  badge?: string | number | {
108
- variant?: "outline" | "solid" | "soft" | "subtle" | undefined;
109
- color?: string | undefined;
110
108
  label?: string | number | undefined;
109
+ variant?: "solid" | "outline" | "soft" | "subtle" | undefined;
110
+ color?: string | undefined;
111
111
  size?: Size | undefined;
112
112
  } | undefined;
113
113
  shortcut?: string | undefined;
@@ -123,17 +123,17 @@ export declare const TabSchema: z.ZodObject<{
123
123
  items: {
124
124
  label: string;
125
125
  slot: string;
126
- disabled?: boolean | undefined;
127
126
  icon?: string | undefined;
127
+ disabled?: boolean | undefined;
128
128
  avatar?: {
129
129
  size?: Size | undefined;
130
130
  alt?: string | undefined;
131
131
  src?: string | undefined;
132
132
  } | undefined;
133
133
  badge?: string | number | {
134
- variant?: "outline" | "solid" | "soft" | "subtle" | undefined;
135
- color?: string | undefined;
136
134
  label?: string | number | undefined;
135
+ variant?: "solid" | "outline" | "soft" | "subtle" | undefined;
136
+ color?: string | undefined;
137
137
  size?: Size | undefined;
138
138
  } | undefined;
139
139
  shortcut?: string | undefined;
@@ -149,17 +149,17 @@ export declare const TabSchema: z.ZodObject<{
149
149
  items: {
150
150
  label: string;
151
151
  slot: string;
152
- disabled?: boolean | undefined;
153
152
  icon?: string | undefined;
153
+ disabled?: boolean | undefined;
154
154
  avatar?: {
155
155
  size?: Size | undefined;
156
156
  alt?: string | undefined;
157
157
  src?: string | undefined;
158
158
  } | undefined;
159
159
  badge?: string | number | {
160
- variant?: "outline" | "solid" | "soft" | "subtle" | undefined;
161
- color?: string | undefined;
162
160
  label?: string | number | undefined;
161
+ variant?: "solid" | "outline" | "soft" | "subtle" | undefined;
162
+ color?: string | undefined;
163
163
  size?: Size | undefined;
164
164
  } | undefined;
165
165
  shortcut?: string | undefined;
@@ -1,8 +1,10 @@
1
1
  import { ComponentBuilder } from "../../component";
2
+ import { type FormBuilder } from "../form-types";
2
3
  import type { CustomButton, CustomButtonSerialized } from "../types/custom-button";
3
4
  import type { RowActionConfig, RowActionRule } from "../types/row-action";
4
5
  import { TableViewMeta } from "./meta";
5
- import { type KanbanOptions, type TableViewDisplayOption, type TableViewDisplayOptionSerialized } from "./options";
6
+ import { type FormContainerPages, type KanbanOptions, type QueryParamFilters, type RouteParamFilters, type TableViewDisplayOption, type TableViewDisplayOptionSerialized, type TableViewFormPageUrls } from "./options";
7
+ export type FormPageKind = keyof TableViewFormPageUrls;
6
8
  export declare namespace TableViewEvents {
7
9
  const ROW_CLICK = "DmsComponent.TableView.RowClick";
8
10
  const ROW_SELECT = "DmsComponent.TableView.RowSelect";
@@ -22,4 +24,29 @@ export declare function filterCustomButtonsByPermission(permissions: Set<string>
22
24
  export declare function mergeControllerRule(actionConfig: boolean | RowActionConfig | undefined, rule: RowActionRule | undefined): boolean | RowActionConfig | undefined;
23
25
  export declare function validateKanbanField(controllerName: string, meta: TableViewMeta, groupByField: string): void;
24
26
  export declare function serializeTableViewDisplays(displays: TableViewDisplayOption[] | undefined, kanban: KanbanOptions | undefined): TableViewDisplayOptionSerialized[] | undefined;
25
- export declare function isNestedComponent(permissionId: string, pageFullId: string): boolean;
27
+ export interface FormPageDefinition {
28
+ defaultSlug: string;
29
+ displayName: string;
30
+ description: string;
31
+ action: string;
32
+ redirectsOnSubmit: boolean;
33
+ submitsFilterDefaults: boolean;
34
+ }
35
+ export declare const FORM_PAGE_DEFINITIONS: Record<FormPageKind, FormPageDefinition>;
36
+ export declare const FORM_PAGE_KINDS: FormPageKind[];
37
+ export declare const ROW_SCOPED_FORM_PAGE_KINDS: FormPageKind[];
38
+ export declare function joinPageSlug(pageSlug: string, slug: string): string;
39
+ export declare function formRouteKey(permissionId: string, pageFullId: string): string;
40
+ export declare function formPageSlug(kind: FormPageKind, routeKey: string, pages?: FormContainerPages): string;
41
+ export declare function buildFormPageUrls(pageSlug: string, routeKey: string, pages?: FormContainerPages): TableViewFormPageUrls;
42
+ export interface TableViewUrlFilters {
43
+ queryParamFilters?: QueryParamFilters;
44
+ routeParamFilters?: RouteParamFilters;
45
+ }
46
+ export interface FormRouteFrame {
47
+ pageSlug: string;
48
+ formSlug: string;
49
+ }
50
+ export declare function buildFormRedirectUrl(frame: FormRouteFrame): string;
51
+ export declare function buildFilterSubmitDefaults(filters: TableViewUrlFilters, frame?: FormRouteFrame): Record<string, string> | undefined;
52
+ export declare function applyFormPageSubmitDefaults(form: FormBuilder, filters: TableViewUrlFilters, frame: FormRouteFrame): void;
@@ -1,13 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TableViewFunctions = exports.TableViewEvents = void 0;
3
+ exports.ROW_SCOPED_FORM_PAGE_KINDS = exports.FORM_PAGE_KINDS = exports.FORM_PAGE_DEFINITIONS = exports.TableViewFunctions = exports.TableViewEvents = void 0;
4
4
  exports.applyFormRedirect = applyFormRedirect;
5
5
  exports.applyPermissionToAction = applyPermissionToAction;
6
6
  exports.filterCustomButtonsByPermission = filterCustomButtonsByPermission;
7
7
  exports.mergeControllerRule = mergeControllerRule;
8
8
  exports.validateKanbanField = validateKanbanField;
9
9
  exports.serializeTableViewDisplays = serializeTableViewDisplays;
10
- exports.isNestedComponent = isNestedComponent;
10
+ exports.joinPageSlug = joinPageSlug;
11
+ exports.formRouteKey = formRouteKey;
12
+ exports.formPageSlug = formPageSlug;
13
+ exports.buildFormPageUrls = buildFormPageUrls;
14
+ exports.buildFormRedirectUrl = buildFormRedirectUrl;
15
+ exports.buildFilterSubmitDefaults = buildFilterSubmitDefaults;
16
+ exports.applyFormPageSubmitDefaults = applyFormPageSubmitDefaults;
11
17
  const permissions_1 = require("../../permissions");
12
18
  const data_types_1 = require("../data-types");
13
19
  const form_types_1 = require("../form-types");
@@ -112,10 +118,112 @@ function serializeTableViewDisplays(displays, kanban) {
112
118
  }
113
119
  return serialized.length > 0 ? serialized : undefined;
114
120
  }
115
- function isNestedComponent(permissionId, pageFullId) {
121
+ exports.FORM_PAGE_DEFINITIONS = {
122
+ new: {
123
+ defaultSlug: "new",
124
+ displayName: "$dms.table.new_item",
125
+ description: "$dms.table.new_item_description",
126
+ action: "add",
127
+ redirectsOnSubmit: true,
128
+ submitsFilterDefaults: true,
129
+ },
130
+ edit: {
131
+ defaultSlug: ":id/edit",
132
+ displayName: "$dms.table.edit_item",
133
+ description: "$dms.table.edit_item_description",
134
+ action: "edit",
135
+ redirectsOnSubmit: true,
136
+ submitsFilterDefaults: true,
137
+ },
138
+ view: {
139
+ defaultSlug: ":id/view",
140
+ displayName: "$dms.table.view_item",
141
+ description: "$dms.table.view_item_description",
142
+ action: "view",
143
+ redirectsOnSubmit: false,
144
+ submitsFilterDefaults: false,
145
+ },
146
+ };
147
+ exports.FORM_PAGE_KINDS = Object.keys(exports.FORM_PAGE_DEFINITIONS);
148
+ exports.ROW_SCOPED_FORM_PAGE_KINDS = ["edit", "view"];
149
+ function joinPageSlug(pageSlug, slug) {
150
+ return `${pageSlug}/${slug}`.replace(/\/+/g, "/");
151
+ }
152
+ function toFormPageUrl(pageSlug, slug) {
153
+ if (slug.startsWith("/"))
154
+ return slug;
155
+ const parts = slug.split("/");
156
+ let parentCount = 0;
157
+ while (parentCount < parts.length && parts[parentCount] === "..") {
158
+ parentCount++;
159
+ }
160
+ const segments = pageSlug.replace(/\/$/, "").split("/");
161
+ return joinPageSlug(segments.slice(0, segments.length - parentCount).join("/"), parts.slice(parentCount).join("/"));
162
+ }
163
+ function formRouteKey(permissionId, pageFullId) {
116
164
  const prefix = `${pageFullId}.`;
117
- if (!permissionId.startsWith(prefix))
118
- return false;
119
- return permissionId.slice(prefix.length).includes(".");
165
+ const path = permissionId.startsWith(prefix)
166
+ ? permissionId.slice(prefix.length)
167
+ : "";
168
+ const key = path.split(".").pop();
169
+ if (!key) {
170
+ throw new Error(`TableView permission id "${permissionId}" names no component of page "${pageFullId}": its form routes have no key to be named after.`);
171
+ }
172
+ return key;
173
+ }
174
+ function formPageSlug(kind, routeKey, pages) {
175
+ return (pages?.[kind]?.urlSlug ||
176
+ `${routeKey}/${exports.FORM_PAGE_DEFINITIONS[kind].defaultSlug}`);
177
+ }
178
+ function buildFormPageUrls(pageSlug, routeKey, pages) {
179
+ const urls = {};
180
+ for (const kind of exports.FORM_PAGE_KINDS) {
181
+ urls[kind] = toFormPageUrl(pageSlug, formPageSlug(kind, routeKey, pages));
182
+ }
183
+ return urls;
184
+ }
185
+ function slugPlaceholders(slug) {
186
+ return slug
187
+ .split("/")
188
+ .filter((segment) => segment.startsWith(":"))
189
+ .map((segment) => segment.substring(1));
190
+ }
191
+ const countOccurrences = (names, name) => names.filter((candidate) => candidate === name).length;
192
+ function pageParamToken(name, frame, occurrence) {
193
+ if (!frame)
194
+ return `{{params.${name}}}`;
195
+ const pageOccurrence = occurrence ?? countOccurrences(slugPlaceholders(frame.pageSlug), name);
196
+ const total = countOccurrences(slugPlaceholders(frame.formSlug), name);
197
+ return pageOccurrence > 0 && total > 1
198
+ ? `{{params.${name}:${pageOccurrence}}}`
199
+ : `{{params.${name}}}`;
200
+ }
201
+ function buildFormRedirectUrl(frame) {
202
+ const seen = {};
203
+ return frame.pageSlug
204
+ .split("/")
205
+ .map((segment) => {
206
+ if (!segment.startsWith(":"))
207
+ return segment;
208
+ const name = segment.substring(1);
209
+ seen[name] = (seen[name] ?? 0) + 1;
210
+ return pageParamToken(name, frame, seen[name]);
211
+ })
212
+ .join("/");
213
+ }
214
+ function buildFilterSubmitDefaults(filters, frame) {
215
+ const defaults = {};
216
+ for (const [param, filter] of Object.entries(filters.queryParamFilters ?? {})) {
217
+ defaults[filter.field] = `{{query.${param}}}`;
218
+ }
219
+ for (const [param, filter] of Object.entries(filters.routeParamFilters ?? {})) {
220
+ defaults[filter.field] = pageParamToken(param, frame);
221
+ }
222
+ return Object.keys(defaults).length > 0 ? defaults : undefined;
223
+ }
224
+ function applyFormPageSubmitDefaults(form, filters, frame) {
225
+ const submitDefaults = buildFilterSubmitDefaults(filters, frame);
226
+ if (submitDefaults)
227
+ form.mergeOptions({ submitDefaults });
120
228
  }
121
229
  //# sourceMappingURL=factory-helpers.js.map