@docupace/ihub-config 1.1.26 → 1.1.27-sync.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.
- package/dist/config-extension.d.ts +15 -2
- package/dist/config-extension.d.ts.map +1 -1
- package/dist/config-extension.js.map +1 -1
- package/dist/config-service.d.ts +19 -2
- package/dist/config-service.d.ts.map +1 -1
- package/dist/config-service.js +146 -66
- package/dist/config-service.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/named-array-merge.d.ts +29 -0
- package/dist/lib/named-array-merge.d.ts.map +1 -0
- package/dist/lib/named-array-merge.js +158 -0
- package/dist/lib/named-array-merge.js.map +1 -0
- package/dist/mappers/config-mapper.d.ts.map +1 -1
- package/dist/mappers/config-mapper.js +1 -0
- package/dist/mappers/config-mapper.js.map +1 -1
- package/dist/model/graphs/config/fields.graphql +15 -0
- package/dist/model/graphs/config/panel.graphql +7 -0
- package/dist/model/graphs/config/ui-components.graphql +1 -0
- package/dist/providers/index.d.ts +4 -0
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +5 -0
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/screen-layout-patch.d.ts +6 -0
- package/dist/providers/screen-layout-patch.d.ts.map +1 -0
- package/dist/providers/screen-layout-patch.js +57 -0
- package/dist/providers/screen-layout-patch.js.map +1 -0
- package/dist/providers/whole-patch.d.ts +6 -0
- package/dist/providers/whole-patch.d.ts.map +1 -0
- package/dist/providers/whole-patch.js +2 -0
- package/dist/providers/whole-patch.js.map +1 -0
- package/model/graphs/config/fields.graphql +15 -0
- package/model/graphs/config/panel.graphql +7 -0
- package/model/graphs/config/ui-components.graphql +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAMnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,eAAO,MAAM,gBAAgB,EAAE,eAE9B,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,iBAEtC,CAAC;AAEF,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,gCAAgC,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/providers/index.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { DashboardPageConfigProvider } from './dashboard-page-config.js';
|
|
2
|
+
import { ScreenLayoutPatchMerger, SCREEN_LAYOUT_PATCH_CONTENT_TYPE, } from './screen-layout-patch.js';
|
|
2
3
|
export const builtInProviders = {
|
|
3
4
|
DashboardPage: DashboardPageConfigProvider,
|
|
4
5
|
};
|
|
6
|
+
export const builtInWholePatchMergers = {
|
|
7
|
+
[SCREEN_LAYOUT_PATCH_CONTENT_TYPE]: new ScreenLayoutPatchMerger(),
|
|
8
|
+
};
|
|
9
|
+
export { SCREEN_LAYOUT_PATCH_CONTENT_TYPE } from './screen-layout-patch.js';
|
|
5
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EACL,uBAAuB,EACvB,gCAAgC,GACjC,MAAM,0BAA0B,CAAC;AAGlC,MAAM,CAAC,MAAM,gBAAgB,GAAoB;IAC/C,aAAa,EAAE,2BAA2B;CAC3C,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAsB;IACzD,CAAC,gCAAgC,CAAC,EAAE,IAAI,uBAAuB,EAAE;CAClE,CAAC;AAIF,OAAO,EAAE,gCAAgC,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { WholePatchMerger } from './whole-patch.js';
|
|
2
|
+
export declare const SCREEN_LAYOUT_PATCH_CONTENT_TYPE = "application/x-screen-layout-patch+json";
|
|
3
|
+
export declare class ScreenLayoutPatchMerger implements WholePatchMerger {
|
|
4
|
+
merge(processedObj: any, patch: any): any;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=screen-layout-patch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen-layout-patch.d.ts","sourceRoot":"","sources":["../../src/providers/screen-layout-patch.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAKzD,eAAO,MAAM,gCAAgC,2CACH,CAAC;AAW3C,qBAAa,uBAAwB,YAAW,gBAAgB;IAC9D,KAAK,CAAC,YAAY,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,GAAG,GAAG;CA4D1C"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { mergeMatchedFields, } from '../lib/named-array-merge.js';
|
|
2
|
+
// `Configuration.value` is typed CLOB, but the underlying attribute is JSON — for a
|
|
3
|
+
// JSON-shaped value like a screen layout patch, it can come back already parsed as an
|
|
4
|
+
// object rather than as the JSON string it was saved as.
|
|
5
|
+
export const SCREEN_LAYOUT_PATCH_CONTENT_TYPE = 'application/x-screen-layout-patch+json';
|
|
6
|
+
// A Screen Designer override entry counts as "self-contained" when it carries a
|
|
7
|
+
// `__typename` — every full tab/row/element node the client builds for a brand-new,
|
|
8
|
+
// not-yet-in-the-base-config entry always does (see `AddElementDialog.buildDefaultNode`
|
|
9
|
+
// and the client's new-tab/new-row construction), while a thin `{ name, ...diffs }`
|
|
10
|
+
// reference to an existing base node never does.
|
|
11
|
+
function isSelfContainedScreenLayoutNode(item) {
|
|
12
|
+
return typeof item.__typename === 'string' && item.__typename.length > 0;
|
|
13
|
+
}
|
|
14
|
+
export class ScreenLayoutPatchMerger {
|
|
15
|
+
merge(processedObj, patch) {
|
|
16
|
+
// A screen layout patch is always tabs-shaped (`{ tabs: [...] }`), but the config
|
|
17
|
+
// path it's saved against doesn't have to resolve to a bare `TabbedPage` — a modal
|
|
18
|
+
// config like `modals/select-account-holder` resolves to an `AnyPage` that wraps
|
|
19
|
+
// the real `TabbedPage` via `tabbedPages[0]` (a `$ref`, in that case). Detect that
|
|
20
|
+
// shape and merge onto the nested TabbedPage instead, so the patch lands on
|
|
21
|
+
// `tabbedPages[0].tabs` rather than a same-named `tabs` field bolted onto the
|
|
22
|
+
// AnyPage root (which `mergeMatchedFields` would otherwise do silently, since
|
|
23
|
+
// `tabbedPages` itself doesn't qualify as a named-object array to recurse into —
|
|
24
|
+
// `TabbedPage` has no `name` field).
|
|
25
|
+
if (!processedObj?.tabs && Array.isArray(processedObj?.tabbedPages)) {
|
|
26
|
+
const [tabbedPage, ...restTabbedPages] = processedObj.tabbedPages;
|
|
27
|
+
return {
|
|
28
|
+
...processedObj,
|
|
29
|
+
tabbedPages: [
|
|
30
|
+
mergeMatchedFields(tabbedPage, patch, isSelfContainedScreenLayoutNode, true),
|
|
31
|
+
...restTabbedPages,
|
|
32
|
+
],
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
// A `WizardPage` (e.g. `contacts/add-new-contact`) has no `tabs`/`tabbedPages` of
|
|
36
|
+
// its own — its `TabbedPage`(s) live nested one level down, at `steps[].page`. A
|
|
37
|
+
// wizard can carry more than one `TabbedPage` step (add-new-contact has both
|
|
38
|
+
// `enterContactInformation` and `reviewContactInformation`, mutually exclusive by
|
|
39
|
+
// `visibilityCondition` but $ref-ing the identical tabs) — apply the same patch to
|
|
40
|
+
// every step whose `page.tabs` exists, so whichever step is actually visible at
|
|
41
|
+
// runtime reflects the edit, and leave every other step (ComponentPage, etc.)
|
|
42
|
+
// untouched.
|
|
43
|
+
if (!processedObj?.tabbedPages && Array.isArray(processedObj?.steps)) {
|
|
44
|
+
return {
|
|
45
|
+
...processedObj,
|
|
46
|
+
steps: processedObj.steps.map((step) => step?.page?.tabs
|
|
47
|
+
? {
|
|
48
|
+
...step,
|
|
49
|
+
page: mergeMatchedFields(step.page, patch, isSelfContainedScreenLayoutNode, true),
|
|
50
|
+
}
|
|
51
|
+
: step),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
return mergeMatchedFields(processedObj, patch, isSelfContainedScreenLayoutNode, true);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=screen-layout-patch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen-layout-patch.js","sourceRoot":"","sources":["../../src/providers/screen-layout-patch.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,GAEnB,MAAM,6BAA6B,CAAC;AAGrC,oFAAoF;AACpF,sFAAsF;AACtF,yDAAyD;AACzD,MAAM,CAAC,MAAM,gCAAgC,GAC3C,wCAAwC,CAAC;AAE3C,gFAAgF;AAChF,oFAAoF;AACpF,wFAAwF;AACxF,oFAAoF;AACpF,iDAAiD;AACjD,SAAS,+BAA+B,CAAC,IAAiB;IACxD,OAAO,OAAO,IAAI,CAAC,UAAU,KAAK,QAAQ,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;AAC3E,CAAC;AAED,MAAM,OAAO,uBAAuB;IAClC,KAAK,CAAC,YAAiB,EAAE,KAAU;QACjC,kFAAkF;QAClF,mFAAmF;QACnF,iFAAiF;QACjF,mFAAmF;QACnF,4EAA4E;QAC5E,8EAA8E;QAC9E,8EAA8E;QAC9E,iFAAiF;QACjF,qCAAqC;QACrC,IAAI,CAAC,YAAY,EAAE,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE,WAAW,CAAC,EAAE,CAAC;YACpE,MAAM,CAAC,UAAU,EAAE,GAAG,eAAe,CAAC,GAAG,YAAY,CAAC,WAAW,CAAC;YAClE,OAAO;gBACL,GAAG,YAAY;gBACf,WAAW,EAAE;oBACX,kBAAkB,CAChB,UAAU,EACV,KAAK,EACL,+BAA+B,EAC/B,IAAI,CACL;oBACD,GAAG,eAAe;iBACnB;aACF,CAAC;QACJ,CAAC;QAED,kFAAkF;QAClF,iFAAiF;QACjF,6EAA6E;QAC7E,kFAAkF;QAClF,mFAAmF;QACnF,gFAAgF;QAChF,8EAA8E;QAC9E,aAAa;QACb,IAAI,CAAC,YAAY,EAAE,WAAW,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;YACrE,OAAO;gBACL,GAAG,YAAY;gBACf,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAC1C,IAAI,EAAE,IAAI,EAAE,IAAI;oBACd,CAAC,CAAC;wBACE,GAAG,IAAI;wBACP,IAAI,EAAE,kBAAkB,CACtB,IAAI,CAAC,IAAI,EACT,KAAK,EACL,+BAA+B,EAC/B,IAAI,CACL;qBACF;oBACH,CAAC,CAAC,IAAI,CACT;aACF,CAAC;QACJ,CAAC;QAED,OAAO,kBAAkB,CACvB,YAAY,EACZ,KAAK,EACL,+BAA+B,EAC/B,IAAI,CACL,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface WholePatchMerger {
|
|
2
|
+
/** Merges a parsed whole-patch document onto the fully processed config. */
|
|
3
|
+
merge(processedObj: any, patch: any): any;
|
|
4
|
+
}
|
|
5
|
+
export type WholePatchMergers = Record<string, WholePatchMerger>;
|
|
6
|
+
//# sourceMappingURL=whole-patch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whole-patch.d.ts","sourceRoot":"","sources":["../../src/providers/whole-patch.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,gBAAgB;IAC/B,4EAA4E;IAC5E,KAAK,CAAC,YAAY,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,GAAG,GAAG,CAAC;CAC3C;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whole-patch.js","sourceRoot":"","sources":["../../src/providers/whole-patch.ts"],"names":[],"mappings":""}
|
|
@@ -64,12 +64,14 @@ type InputField implements IField & IRowElement & IElement {
|
|
|
64
64
|
maxRows: Int
|
|
65
65
|
minRows: Int
|
|
66
66
|
# End of text area configuration
|
|
67
|
+
custom: Boolean
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
type CustomValidator implements IRowElement & IElement {
|
|
70
71
|
validationRule: String
|
|
71
72
|
errorMessage: String
|
|
72
73
|
paths: [String!]!
|
|
74
|
+
custom: Boolean
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
union Fields = InputField | PhoneField | DateField | DateRangeField | SelectField | ToggleField | BooleanField | TextElement
|
|
@@ -93,6 +95,7 @@ type RepeaterField implements IRowElement & IElement {
|
|
|
93
95
|
validateUnique: Boolean
|
|
94
96
|
duplicateMessage: String
|
|
95
97
|
itemValidation: ItemValidation
|
|
98
|
+
custom: Boolean
|
|
96
99
|
}
|
|
97
100
|
|
|
98
101
|
type ControlGroup implements IRowElement & IElement {
|
|
@@ -101,6 +104,7 @@ type ControlGroup implements IRowElement & IElement {
|
|
|
101
104
|
skipId: Boolean
|
|
102
105
|
controlOptions: ISelectOptions!
|
|
103
106
|
fields: [Fields!]!
|
|
107
|
+
custom: Boolean
|
|
104
108
|
}
|
|
105
109
|
|
|
106
110
|
# Renders the currently-linked records of a multi-valued reference attribute
|
|
@@ -131,6 +135,7 @@ type ReferenceTable implements IField & IRowElement & IElement {
|
|
|
131
135
|
confirmDelete: Boolean
|
|
132
136
|
maxRows: Int
|
|
133
137
|
rowMenuItems: [MenuItem!]
|
|
138
|
+
custom: Boolean
|
|
134
139
|
}
|
|
135
140
|
|
|
136
141
|
type PhoneField implements IField & IRowElement & IElement {
|
|
@@ -149,6 +154,7 @@ type PhoneField implements IField & IRowElement & IElement {
|
|
|
149
154
|
visibilityCondition: String
|
|
150
155
|
disabledCondition: String
|
|
151
156
|
validation: GenericFieldValidation
|
|
157
|
+
custom: Boolean
|
|
152
158
|
}
|
|
153
159
|
|
|
154
160
|
type DateField implements IField & IRowElement & IElement {
|
|
@@ -168,6 +174,7 @@ type DateField implements IField & IRowElement & IElement {
|
|
|
168
174
|
minDate: String # e.q. "now" or "2025-03-20"
|
|
169
175
|
maxDate: String # e.q. "now" or "2025-03-20"
|
|
170
176
|
validation: GenericFieldValidation
|
|
177
|
+
custom: Boolean
|
|
171
178
|
}
|
|
172
179
|
|
|
173
180
|
type DateRangeField implements IDateRangeField & IRowElement & IElement {
|
|
@@ -187,6 +194,7 @@ type DateRangeField implements IDateRangeField & IRowElement & IElement {
|
|
|
187
194
|
visibilityCondition: String
|
|
188
195
|
disabledCondition: String
|
|
189
196
|
validation: GenericFieldValidation
|
|
197
|
+
custom: Boolean
|
|
190
198
|
}
|
|
191
199
|
|
|
192
200
|
type SelectField implements IField & IRowElement & IElement {
|
|
@@ -212,6 +220,7 @@ type SelectField implements IField & IRowElement & IElement {
|
|
|
212
220
|
helperText: String
|
|
213
221
|
autoSelectSingleOption: Boolean
|
|
214
222
|
validation: GenericFieldValidation
|
|
223
|
+
custom: Boolean
|
|
215
224
|
}
|
|
216
225
|
|
|
217
226
|
type ToggleField implements IField & IRowElement & IElement {
|
|
@@ -234,6 +243,7 @@ type ToggleField implements IField & IRowElement & IElement {
|
|
|
234
243
|
disabledCondition: String
|
|
235
244
|
linkedFields: [String!]
|
|
236
245
|
validation: GenericFieldValidation
|
|
246
|
+
custom: Boolean
|
|
237
247
|
}
|
|
238
248
|
|
|
239
249
|
type BooleanField implements IField & IRowElement & IElement {
|
|
@@ -252,6 +262,7 @@ type BooleanField implements IField & IRowElement & IElement {
|
|
|
252
262
|
disabledCondition: String
|
|
253
263
|
linkedFields: [String!]
|
|
254
264
|
validation: GenericFieldValidation
|
|
265
|
+
custom: Boolean
|
|
255
266
|
}
|
|
256
267
|
|
|
257
268
|
type ChipSelectWithInputField implements IField & IRowElement & IElement {
|
|
@@ -277,6 +288,7 @@ type ChipSelectWithInputField implements IField & IRowElement & IElement {
|
|
|
277
288
|
disabledCondition: String
|
|
278
289
|
linkedFields: [String!]
|
|
279
290
|
validation: ChipSelectValidation
|
|
291
|
+
custom: Boolean
|
|
280
292
|
}
|
|
281
293
|
|
|
282
294
|
type CustomField implements IField & IRowElement & IElement {
|
|
@@ -296,6 +308,7 @@ type CustomField implements IField & IRowElement & IElement {
|
|
|
296
308
|
visibilityCondition: String
|
|
297
309
|
disabledCondition: String
|
|
298
310
|
validation: GenericFieldValidation
|
|
311
|
+
custom: Boolean
|
|
299
312
|
}
|
|
300
313
|
|
|
301
314
|
type StatusChipField implements IField & IRowElement & IElement {
|
|
@@ -305,6 +318,7 @@ type StatusChipField implements IField & IRowElement & IElement {
|
|
|
305
318
|
name: String!
|
|
306
319
|
path: String!
|
|
307
320
|
validation: GenericFieldValidation
|
|
321
|
+
custom: Boolean
|
|
308
322
|
}
|
|
309
323
|
|
|
310
324
|
type CheckboxGroupValue {
|
|
@@ -325,6 +339,7 @@ type CheckboxGroup implements IRowElement & IElement {
|
|
|
325
339
|
values: [CheckboxGroupValue!]!
|
|
326
340
|
visibilityCondition: String
|
|
327
341
|
disabledCondition: String
|
|
342
|
+
custom: Boolean
|
|
328
343
|
}
|
|
329
344
|
|
|
330
345
|
enum FieldValueType {
|
|
@@ -27,4 +27,11 @@ type PanelRow implements IPanelRow {
|
|
|
27
27
|
title: String
|
|
28
28
|
titleVariant: String
|
|
29
29
|
visibilityCondition: String
|
|
30
|
+
"""
|
|
31
|
+
Screen Designer: true when this group exists only via the screen layout patch — no
|
|
32
|
+
counterpart in the raw base config — vs. `false`/absent for a real group (whether or
|
|
33
|
+
not the patch also overrides some of its properties). See `Tab.custom` for the full
|
|
34
|
+
reasoning; stamped the same way, one level down the tree.
|
|
35
|
+
"""
|
|
36
|
+
custom: Boolean
|
|
30
37
|
}
|