pict-section-picker 1.1.0 → 1.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.
- package/README.md +31 -0
- package/package.json +1 -1
- package/source/form/Pict-Section-Picker-FormInput.js +8 -0
- package/source/providers/Pict-Provider-Picker.js +127 -6
- package/types/form/Pict-Section-Picker-FormInput.d.ts +6 -0
- package/types/form/Pict-Section-Picker-FormInput.d.ts.map +1 -1
- package/types/providers/Pict-Provider-Picker.d.ts +46 -0
- package/types/providers/Pict-Provider-Picker.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -117,6 +117,37 @@ Entity-source configuration:
|
|
|
117
117
|
|
|
118
118
|
The lower-level builders are also exposed: `createEntityDataProvider(cfg)` and `createEntityResolveValue(cfg)` return the raw functions if you want to wire them yourself.
|
|
119
119
|
|
|
120
|
+
## Joined display (parent-entity context)
|
|
121
|
+
|
|
122
|
+
Sometimes a searched entity is ambiguous on its own — a `LineItem` only makes sense next to its `Project`, a `Review` next to its `Book`. Set `JoinEntity` and the picker renders a **compound** label by joining each searched row to a parent entity through a foreign key the row carries:
|
|
123
|
+
|
|
124
|
+
```javascript
|
|
125
|
+
tmpPicker.createEntityPicker('ReviewPicker',
|
|
126
|
+
{
|
|
127
|
+
Entity: 'Review',
|
|
128
|
+
SearchFields: [ 'Summary' ],
|
|
129
|
+
JoinEntity: 'Book', // the parent entity to join
|
|
130
|
+
JoinField: 'IDBook', // the FK on the Review row -> Book
|
|
131
|
+
JoinEntityDisplayField: 'Title', // the Book field to show
|
|
132
|
+
DestinationAddress: '#ReviewPicker',
|
|
133
|
+
ValueAddress: 'AppData.Form.IDReview',
|
|
134
|
+
});
|
|
135
|
+
// options render as "Neuromancer - Loved it"; the Value is still IDReview.
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Meadow can't join in a single read, so this is **fetch-then-merge**: after each search page the picker collects the rows' unique FK ids and issues **one** `FBL~ID{JoinEntity}~INN~<ids>` request, then stitches the joined display onto every row (also exposed as `Record.JoinName` / `Record.JoinRecord` for `MapRecord` / templates). The same join resolves a pre-bound value's label on first render.
|
|
139
|
+
|
|
140
|
+
| Option | Default | Purpose |
|
|
141
|
+
|---|---|---|
|
|
142
|
+
| `JoinEntity` | — | Parent entity to join for the compound display. Setting it enables the feature. |
|
|
143
|
+
| `JoinField` | `ID<JoinEntity>` | The FK column **on the searched row** pointing at `JoinEntity`. |
|
|
144
|
+
| `JoinEntityValueField` | `ID<JoinEntity>` | The PK column on `JoinEntity` to match (the `INN` column). |
|
|
145
|
+
| `JoinEntityDisplayField` | `'Name'` | The `JoinEntity` field shown in the compound label. |
|
|
146
|
+
| `JoinEntityFirst` | `true` | `true` → `Parent - Row`; `false` → `Row - Parent`. |
|
|
147
|
+
| `JoinSeparator` | `' - '` | Separator between the two parts. |
|
|
148
|
+
|
|
149
|
+
The same options ride through the form-input adapter (`PictForm.JoinEntity`, …) and the pict-section-recordset entity filters (set `JoinEntity` on the clause) — so an entity filter can show parent context for its options with no host code, layered on top of either the 1:1 (direct-FK / `InternalJoin`) or 1:many (junction / `ExternalJoin`) filter relationship.
|
|
150
|
+
|
|
120
151
|
## Categories
|
|
121
152
|
|
|
122
153
|
Give option rows an optional `Group` field and the list renders headered sections (preserving order; rows without a `Group` fall into a leading unlabeled section):
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pict-section-picker",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Pict-native themeable searchable select / combobox — single & multi select, server pagination, categorized groups and creatable entries, driven by a host-agnostic async DataProvider (with a built-in Meadow EntityProvider adapter). A jQuery/select2-free replacement.",
|
|
5
5
|
"main": "source/Pict-Section-Picker.js",
|
|
6
6
|
"types": "types/Pict-Section-Picker.d.ts",
|
|
@@ -117,6 +117,14 @@ class PictInputTypePicker extends libPictInputExtension
|
|
|
117
117
|
TextField: tmpPF.TextField,
|
|
118
118
|
PageSize: tmpPF.PageSize || 20,
|
|
119
119
|
Options: tmpPF.Options || [],
|
|
120
|
+
// JoinEntity compound display (1:1 / 1:many parent-entity context) — passed straight through
|
|
121
|
+
// to the picker's entity adapter, which fetch-then-merges the join. No-op when JoinEntity unset.
|
|
122
|
+
JoinEntity: tmpPF.JoinEntity,
|
|
123
|
+
JoinField: tmpPF.JoinField,
|
|
124
|
+
JoinEntityValueField: tmpPF.JoinEntityValueField,
|
|
125
|
+
JoinEntityDisplayField: tmpPF.JoinEntityDisplayField,
|
|
126
|
+
JoinEntityFirst: tmpPF.JoinEntityFirst,
|
|
127
|
+
JoinSeparator: tmpPF.JoinSeparator,
|
|
120
128
|
// Per-search contextual scope — the generic hook the host fills.
|
|
121
129
|
BaseFilter: () => this.getContextualSearchFilters(pInput),
|
|
122
130
|
OnChange: fOnChange,
|
|
@@ -174,6 +174,17 @@ class PictProviderPicker extends libPictProvider
|
|
|
174
174
|
* evaluated on every search — the generic hook for host-injected CONTEXTUAL scoping (project,
|
|
175
175
|
* tenant, spec-year, …). The module stays agnostic; the host supplies the closure.
|
|
176
176
|
* - MapRecord {function} - optional `(record) => {Value, Text}` mapper (overrides Value/TextField).
|
|
177
|
+
* - JoinEntity {string} - optional second entity to JOIN for a compound display (e.g. a `LineItem`
|
|
178
|
+
* shown with its `Project`). Each searched row must carry the FK (`JoinField`). Because Meadow
|
|
179
|
+
* can't join in one read, this is fetch-then-merge: after the primary page resolves, the unique
|
|
180
|
+
* FK ids drive ONE `FBL~ID{JoinEntity}~INN~<ids>` request, and the joined display field is
|
|
181
|
+
* stitched onto each row (as `Record.JoinName` / `Record.JoinRecord`) + composed into the Text.
|
|
182
|
+
* - JoinField {string} - the FK column ON THE SEARCHED ROW pointing at JoinEntity (default `ID{JoinEntity}`).
|
|
183
|
+
* - JoinEntityValueField {string} - the PK column on JoinEntity to match (default `ID{JoinEntity}`).
|
|
184
|
+
* - JoinEntityDisplayField {string} - the JoinEntity field to display (default `Name`).
|
|
185
|
+
* - JoinEntityFirst {boolean} - put the joined value first in the compound (default `true`):
|
|
186
|
+
* `JoinName - baseText`; when `false`, `baseText - JoinName`.
|
|
187
|
+
* - JoinSeparator {string} - the compound separator (default `' - '`).
|
|
177
188
|
* @return {(pSearchTerm: string, pPage: number) => Promise<{results: Array<any>, hasMore: boolean}>}
|
|
178
189
|
*/
|
|
179
190
|
createEntityDataProvider(pConfig)
|
|
@@ -186,6 +197,7 @@ class PictProviderPicker extends libPictProvider
|
|
|
186
197
|
const tmpSort = pConfig.Sort || false;
|
|
187
198
|
const tmpBaseFilterConfig = pConfig.BaseFilter || '';
|
|
188
199
|
const tmpMapRecord = (typeof pConfig.MapRecord === 'function') ? pConfig.MapRecord : false;
|
|
200
|
+
const tmpJoinConfig = this._resolveJoinConfig(pConfig);
|
|
189
201
|
|
|
190
202
|
return (pSearchTerm, pPage) => new Promise((resolve, reject) =>
|
|
191
203
|
{
|
|
@@ -217,11 +229,103 @@ class PictProviderPicker extends libPictProvider
|
|
|
217
229
|
{
|
|
218
230
|
if (pError) { return reject(pError); }
|
|
219
231
|
const tmpList = Array.isArray(pRecords) ? pRecords : [];
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
232
|
+
// JoinEntity (when configured): one INN fetch for the joined rows, stitched onto each
|
|
233
|
+
// searched row, before mapping — so the option Text can show the compound display.
|
|
234
|
+
this._decorateRecordsWithJoin(tmpList, tmpJoinConfig).then((pDecorated) =>
|
|
235
|
+
{
|
|
236
|
+
const tmpResults = pDecorated.map((pRecord) =>
|
|
237
|
+
{
|
|
238
|
+
if (tmpMapRecord) { return tmpMapRecord(pRecord); }
|
|
239
|
+
const tmpText = tmpJoinConfig
|
|
240
|
+
? this._composeJoinedText(pRecord[tmpTextField], pRecord.JoinName, tmpJoinConfig.First, tmpJoinConfig.Separator)
|
|
241
|
+
: pRecord[tmpTextField];
|
|
242
|
+
return { Value: pRecord[tmpValueField], Text: tmpText, Record: pRecord };
|
|
243
|
+
});
|
|
244
|
+
// hasMore: a full page came back, so there is (probably) another. Avoids a Count round-trip.
|
|
245
|
+
return resolve({ results: tmpResults, hasMore: (tmpList.length >= tmpPageSize) });
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Resolve the JoinEntity options off an entity-source config into a normalized internal shape, or
|
|
253
|
+
* `false` when no JoinEntity is configured. Centralizes the defaults so the DataProvider and the
|
|
254
|
+
* ResolveValue builders agree.
|
|
255
|
+
*
|
|
256
|
+
* @param {Record<string, any>} pConfig
|
|
257
|
+
* @return {false | {Entity:string, FKColumn:string, PKColumn:string, DisplayField:string, First:boolean, Separator:string}}
|
|
258
|
+
*/
|
|
259
|
+
_resolveJoinConfig(pConfig)
|
|
260
|
+
{
|
|
261
|
+
if (!pConfig || !pConfig.JoinEntity) { return false; }
|
|
262
|
+
return {
|
|
263
|
+
Entity: pConfig.JoinEntity,
|
|
264
|
+
// The FK on the SEARCHED row, and the PK it points at on the join entity (the INN column).
|
|
265
|
+
FKColumn: pConfig.JoinField || `ID${pConfig.JoinEntity}`,
|
|
266
|
+
PKColumn: pConfig.JoinEntityValueField || `ID${pConfig.JoinEntity}`,
|
|
267
|
+
DisplayField: pConfig.JoinEntityDisplayField || 'Name',
|
|
268
|
+
// Default join-first (mirrors the documented select2 EntitySelector default).
|
|
269
|
+
First: (pConfig.JoinEntityFirst !== false),
|
|
270
|
+
Separator: (typeof pConfig.JoinSeparator === 'string') ? pConfig.JoinSeparator : ' - ',
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Compose a compound display from a base text + a joined value, honoring ordering + separator.
|
|
276
|
+
* Falls back to just the base text when there is no joined value.
|
|
277
|
+
*
|
|
278
|
+
* @param {any} pBaseText @param {any} pJoinText @param {boolean} pFirst @param {string} pSeparator
|
|
279
|
+
* @return {any}
|
|
280
|
+
*/
|
|
281
|
+
_composeJoinedText(pBaseText, pJoinText, pFirst, pSeparator)
|
|
282
|
+
{
|
|
283
|
+
if (pJoinText === undefined || pJoinText === null || pJoinText === '') { return pBaseText; }
|
|
284
|
+
const tmpBase = (pBaseText === undefined || pBaseText === null) ? '' : pBaseText;
|
|
285
|
+
return pFirst ? `${pJoinText}${pSeparator}${tmpBase}` : `${tmpBase}${pSeparator}${pJoinText}`;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Fetch-then-merge the join entity for a page of searched records. Collects the unique FK ids the
|
|
290
|
+
* rows carry (`JoinConfig.FKColumn`), issues ONE `FBL~{PKColumn}~INN~<ids>` request against the join
|
|
291
|
+
* entity, and stitches `JoinRecord` + `JoinName` onto each searched row. Resolves the (mutated) same
|
|
292
|
+
* array; on any error or when there's nothing to join, resolves the records un-decorated (the Text
|
|
293
|
+
* gracefully degrades to the base field).
|
|
294
|
+
*
|
|
295
|
+
* @param {Array<any>} pRecords @param {false | Record<string, any>} pJoinConfig
|
|
296
|
+
* @return {Promise<Array<any>>}
|
|
297
|
+
*/
|
|
298
|
+
_decorateRecordsWithJoin(pRecords, pJoinConfig)
|
|
299
|
+
{
|
|
300
|
+
return new Promise((resolve) =>
|
|
301
|
+
{
|
|
302
|
+
if (!pJoinConfig || !Array.isArray(pRecords) || pRecords.length < 1 || !this.pict.EntityProvider) { return resolve(pRecords); }
|
|
303
|
+
const tmpIDs = [];
|
|
304
|
+
const tmpSeen = {};
|
|
305
|
+
for (let i = 0; i < pRecords.length; i++)
|
|
306
|
+
{
|
|
307
|
+
const tmpID = pRecords[i][pJoinConfig.FKColumn];
|
|
308
|
+
if (tmpID !== undefined && tmpID !== null && tmpID !== '' && !tmpSeen[tmpID]) { tmpSeen[tmpID] = true; tmpIDs.push(tmpID); }
|
|
309
|
+
}
|
|
310
|
+
if (tmpIDs.length < 1) { return resolve(pRecords); }
|
|
311
|
+
const tmpFilter = `FBL~${pJoinConfig.PKColumn}~INN~${tmpIDs.join(',')}`;
|
|
312
|
+
this.pict.EntityProvider.getEntitySetPage(pJoinConfig.Entity, tmpFilter, 0, tmpIDs.length,
|
|
313
|
+
(pError, pJoinRecords) =>
|
|
314
|
+
{
|
|
315
|
+
if (pError)
|
|
316
|
+
{
|
|
317
|
+
this.pict.log.warn(`Pict-Section-Picker [${pJoinConfig.Entity}] join fetch failed; showing un-joined text.`, pError);
|
|
318
|
+
return resolve(pRecords);
|
|
319
|
+
}
|
|
320
|
+
const tmpMap = {};
|
|
321
|
+
const tmpJoinList = Array.isArray(pJoinRecords) ? pJoinRecords : [];
|
|
322
|
+
for (let i = 0; i < tmpJoinList.length; i++) { tmpMap[tmpJoinList[i][pJoinConfig.PKColumn]] = tmpJoinList[i]; }
|
|
323
|
+
for (let i = 0; i < pRecords.length; i++)
|
|
324
|
+
{
|
|
325
|
+
const tmpJoinRecord = tmpMap[pRecords[i][pJoinConfig.FKColumn]];
|
|
326
|
+
if (tmpJoinRecord) { pRecords[i].JoinRecord = tmpJoinRecord; pRecords[i].JoinName = tmpJoinRecord[pJoinConfig.DisplayField]; }
|
|
327
|
+
}
|
|
328
|
+
return resolve(pRecords);
|
|
225
329
|
});
|
|
226
330
|
});
|
|
227
331
|
}
|
|
@@ -239,6 +343,7 @@ class PictProviderPicker extends libPictProvider
|
|
|
239
343
|
const tmpValueField = pConfig.ValueField || `ID${tmpEntity}`;
|
|
240
344
|
const tmpTextField = pConfig.TextField || 'Name';
|
|
241
345
|
const tmpMapRecord = (typeof pConfig.MapRecord === 'function') ? pConfig.MapRecord : false;
|
|
346
|
+
const tmpJoinConfig = this._resolveJoinConfig(pConfig);
|
|
242
347
|
|
|
243
348
|
return (pValue) => new Promise((resolve) =>
|
|
244
349
|
{
|
|
@@ -250,7 +355,23 @@ class PictProviderPicker extends libPictProvider
|
|
|
250
355
|
(pError, pRecord) =>
|
|
251
356
|
{
|
|
252
357
|
if (pError || !pRecord) { return resolve(null); }
|
|
253
|
-
|
|
358
|
+
const fFinish = () =>
|
|
359
|
+
{
|
|
360
|
+
if (tmpMapRecord) { return resolve(tmpMapRecord(pRecord)); }
|
|
361
|
+
const tmpText = tmpJoinConfig
|
|
362
|
+
? this._composeJoinedText(pRecord[tmpTextField], pRecord.JoinName, tmpJoinConfig.First, tmpJoinConfig.Separator)
|
|
363
|
+
: pRecord[tmpTextField];
|
|
364
|
+
return resolve({ Value: pRecord[tmpValueField], Text: tmpText, Record: pRecord });
|
|
365
|
+
};
|
|
366
|
+
// JoinEntity: resolve the single joined record (cached getEntity) for the compound label.
|
|
367
|
+
const tmpFK = tmpJoinConfig ? pRecord[tmpJoinConfig.FKColumn] : null;
|
|
368
|
+
if (!tmpJoinConfig || tmpFK === undefined || tmpFK === null || tmpFK === '') { return fFinish(); }
|
|
369
|
+
this.pict.EntityProvider.getEntity(tmpJoinConfig.Entity, tmpFK,
|
|
370
|
+
(pJoinError, pJoinRecord) =>
|
|
371
|
+
{
|
|
372
|
+
if (!pJoinError && pJoinRecord) { pRecord.JoinRecord = pJoinRecord; pRecord.JoinName = pJoinRecord[tmpJoinConfig.DisplayField]; }
|
|
373
|
+
return fFinish();
|
|
374
|
+
});
|
|
254
375
|
});
|
|
255
376
|
});
|
|
256
377
|
}
|
|
@@ -27,6 +27,12 @@ declare class PictInputTypePicker extends PictInputTypePicker_base {
|
|
|
27
27
|
TextField: any;
|
|
28
28
|
PageSize: any;
|
|
29
29
|
Options: any;
|
|
30
|
+
JoinEntity: any;
|
|
31
|
+
JoinField: any;
|
|
32
|
+
JoinEntityValueField: any;
|
|
33
|
+
JoinEntityDisplayField: any;
|
|
34
|
+
JoinEntityFirst: any;
|
|
35
|
+
JoinSeparator: any;
|
|
30
36
|
BaseFilter: () => string | string[];
|
|
31
37
|
OnChange: any;
|
|
32
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pict-Section-Picker-FormInput.d.ts","sourceRoot":"","sources":["../../source/form/Pict-Section-Picker-FormInput.js"],"names":[],"mappings":";;AAsEA;IAEC,2DAKC;IAGD,yCAAmE;IACnE,uCAA4D;IAC5D,gEAAsG;IACtG,8DAA2F;IAC3F,4DAAuG;IAEvG;;;;;;OAMG;IACH,mCAFW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAkB,MAAM,GAAC,KAAK,CAAC,MAAM,CAAC,CAWnE;IAED,4DAA4D;IAC5D
|
|
1
|
+
{"version":3,"file":"Pict-Section-Picker-FormInput.d.ts","sourceRoot":"","sources":["../../source/form/Pict-Section-Picker-FormInput.js"],"names":[],"mappings":";;AAsEA;IAEC,2DAKC;IAGD,yCAAmE;IACnE,uCAA4D;IAC5D,gEAAsG;IACtG,8DAA2F;IAC3F,4DAAuG;IAEvG;;;;;;OAMG;IACH,mCAFW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAkB,MAAM,GAAC,KAAK,CAAC,MAAM,CAAC,CAWnE;IAED,4DAA4D;IAC5D;;;;;;;;;;;;;;;;;;;MA0BC;IAED,8FAA8F;IAC9F,wDAWC;IAED;;;;OAIG;IACH,wEAUC;IAED,2FAKC;IAED;;;;;;OAMG;IACH,0GAFY,OAAO,CAUlB;IAID,oIAMC;IAED,sIAYC;IAED,iFAMC;IAID,qEAAqE;IACrE,2EAD0D,OAAO,CAahE;IAED,gJAIC;IAED,kJAQC;IAED,wGAMC;CACD;;;;AAED;;;;;;;;;;;;;;GAcG;AACH,gDAVW,GAAG,aACH,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAOlB,OAAO,CAwBlB;AAjRD;;;;;;;GAOG;AACH,2DAJW,MAAM,iBACN,MAAM,GACL,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAoCrC;AAnDD,kCAAkC;AAClC,sCADW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAO5B"}
|
|
@@ -51,12 +51,58 @@ declare class PictProviderPicker extends libPictProvider {
|
|
|
51
51
|
* evaluated on every search — the generic hook for host-injected CONTEXTUAL scoping (project,
|
|
52
52
|
* tenant, spec-year, …). The module stays agnostic; the host supplies the closure.
|
|
53
53
|
* - MapRecord {function} - optional `(record) => {Value, Text}` mapper (overrides Value/TextField).
|
|
54
|
+
* - JoinEntity {string} - optional second entity to JOIN for a compound display (e.g. a `LineItem`
|
|
55
|
+
* shown with its `Project`). Each searched row must carry the FK (`JoinField`). Because Meadow
|
|
56
|
+
* can't join in one read, this is fetch-then-merge: after the primary page resolves, the unique
|
|
57
|
+
* FK ids drive ONE `FBL~ID{JoinEntity}~INN~<ids>` request, and the joined display field is
|
|
58
|
+
* stitched onto each row (as `Record.JoinName` / `Record.JoinRecord`) + composed into the Text.
|
|
59
|
+
* - JoinField {string} - the FK column ON THE SEARCHED ROW pointing at JoinEntity (default `ID{JoinEntity}`).
|
|
60
|
+
* - JoinEntityValueField {string} - the PK column on JoinEntity to match (default `ID{JoinEntity}`).
|
|
61
|
+
* - JoinEntityDisplayField {string} - the JoinEntity field to display (default `Name`).
|
|
62
|
+
* - JoinEntityFirst {boolean} - put the joined value first in the compound (default `true`):
|
|
63
|
+
* `JoinName - baseText`; when `false`, `baseText - JoinName`.
|
|
64
|
+
* - JoinSeparator {string} - the compound separator (default `' - '`).
|
|
54
65
|
* @return {(pSearchTerm: string, pPage: number) => Promise<{results: Array<any>, hasMore: boolean}>}
|
|
55
66
|
*/
|
|
56
67
|
createEntityDataProvider(pConfig: Record<string, any>): (pSearchTerm: string, pPage: number) => Promise<{
|
|
57
68
|
results: Array<any>;
|
|
58
69
|
hasMore: boolean;
|
|
59
70
|
}>;
|
|
71
|
+
/**
|
|
72
|
+
* Resolve the JoinEntity options off an entity-source config into a normalized internal shape, or
|
|
73
|
+
* `false` when no JoinEntity is configured. Centralizes the defaults so the DataProvider and the
|
|
74
|
+
* ResolveValue builders agree.
|
|
75
|
+
*
|
|
76
|
+
* @param {Record<string, any>} pConfig
|
|
77
|
+
* @return {false | {Entity:string, FKColumn:string, PKColumn:string, DisplayField:string, First:boolean, Separator:string}}
|
|
78
|
+
*/
|
|
79
|
+
_resolveJoinConfig(pConfig: Record<string, any>): false | {
|
|
80
|
+
Entity: string;
|
|
81
|
+
FKColumn: string;
|
|
82
|
+
PKColumn: string;
|
|
83
|
+
DisplayField: string;
|
|
84
|
+
First: boolean;
|
|
85
|
+
Separator: string;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Compose a compound display from a base text + a joined value, honoring ordering + separator.
|
|
89
|
+
* Falls back to just the base text when there is no joined value.
|
|
90
|
+
*
|
|
91
|
+
* @param {any} pBaseText @param {any} pJoinText @param {boolean} pFirst @param {string} pSeparator
|
|
92
|
+
* @return {any}
|
|
93
|
+
*/
|
|
94
|
+
_composeJoinedText(pBaseText: any, pJoinText: any, pFirst: boolean, pSeparator: string): any;
|
|
95
|
+
/**
|
|
96
|
+
* Fetch-then-merge the join entity for a page of searched records. Collects the unique FK ids the
|
|
97
|
+
* rows carry (`JoinConfig.FKColumn`), issues ONE `FBL~{PKColumn}~INN~<ids>` request against the join
|
|
98
|
+
* entity, and stitches `JoinRecord` + `JoinName` onto each searched row. Resolves the (mutated) same
|
|
99
|
+
* array; on any error or when there's nothing to join, resolves the records un-decorated (the Text
|
|
100
|
+
* gracefully degrades to the base field).
|
|
101
|
+
*
|
|
102
|
+
* @param {Array<any>} pRecords @param {false | Record<string, any>} pJoinConfig
|
|
103
|
+
* @return {Promise<Array<any>>}
|
|
104
|
+
*/
|
|
105
|
+
_decorateRecordsWithJoin(pRecords: Array<any>, pJoinConfig: false | Record<string, any>): Promise<Array<any>>;
|
|
60
106
|
/**
|
|
61
107
|
* Build a `ResolveValue(value) => Promise<{Value,Text}>` for an entity-backed picker, so a
|
|
62
108
|
* pre-bound ID resolves to its display text on first render (fetched + cached by `getEntity`).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pict-Provider-Picker.d.ts","sourceRoot":"","sources":["../../source/providers/Pict-Provider-Picker.js"],"names":[],"mappings":";AAmFA;;;GAGG;AACH;IAEC,2DASC;IAED;;;;;;;;;;;;;;OAcG;IACH,0BAZW,MAAM,WAEN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAQlB,GAAG,CAqBd;IAED;;;;;;;;;;;OAWG;IACH,iCAJW,KAAK,CAAC,MAAM,CAAC,SACb,MAAM,GACL,MAAM,CAWjB;IAED
|
|
1
|
+
{"version":3,"file":"Pict-Provider-Picker.d.ts","sourceRoot":"","sources":["../../source/providers/Pict-Provider-Picker.js"],"names":[],"mappings":";AAmFA;;;GAGG;AACH;IAEC,2DASC;IAED;;;;;;;;;;;;;;OAcG;IACH,0BAZW,MAAM,WAEN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAQlB,GAAG,CAqBd;IAED;;;;;;;;;;;OAWG;IACH,iCAJW,KAAK,CAAC,MAAM,CAAC,SACb,MAAM,GACL,MAAM,CAWjB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,kCAzBW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAuBlB,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;QAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAC,CAAC,CA6DnG;IAED;;;;;;;OAOG;IACH,4BAHW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAClB,KAAK,GAAG;QAAC,MAAM,EAAC,MAAM,CAAC;QAAC,QAAQ,EAAC,MAAM,CAAC;QAAC,QAAQ,EAAC,MAAM,CAAC;QAAC,YAAY,EAAC,MAAM,CAAC;QAAC,KAAK,EAAC,OAAO,CAAC;QAAC,SAAS,EAAC,MAAM,CAAA;KAAC,CAe1H;IAED;;;;;;OAMG;IACH,8BAHW,GAAG,aAAoB,GAAG,UAAoB,OAAO,cAAiB,MAAM,GAC3E,GAAG,CAOd;IAED;;;;;;;;;OASG;IACH,mCAHW,KAAK,CAAC,GAAG,CAAC,eAAmB,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACvD,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAmC9B;IAED;;;;;;OAMG;IACH,kCAHW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAClB,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAuCxC;IAED;;;;;;;;;OASG;IACH,gCAJW,MAAM,WACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAClB,GAAG,CAQd;CACD;;;;;AAjUD,kCAAkC;AAClC,sCADW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAO5B"}
|