@genesislcap/foundation-forms 15.19.2-FUI-2610.2 → 15.19.2

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.
@@ -44,9 +44,6 @@ export declare function filterReviewSections(sections: ReviewSection[], query: s
44
44
  * Looks up the display label for a raw value from `options.data` (used by segmented,
45
45
  * radio group, connected-select, and enum-with-explicit-data renderers). Honors
46
46
  * `options.valueField`/`options.labelField` when set, defaulting to `value`/`label`.
47
- * When `options.labelRowFormatter` is set, it's applied to the matched row instead of
48
- * reading `labelField` off it directly — the same formatter `OptionsDatasource.rowToOption`
49
- * applies when rendering this row as a dropdown option, so review agrees with the control.
50
47
  * Returns `null` when no match found.
51
48
  * @internal
52
49
  */
@@ -56,13 +53,8 @@ export declare function resolveOptionLabel(raw: any, options: any): string | nul
56
53
  * `options.allOptionsResourceName` (a Data Server/Request Server resource) rather than a
57
54
  * static `options.data` array — e.g. `ConnectedSelectControlRenderer` in async/remote mode.
58
55
  * Fetches a single row via a criteria-filtered snapshot matching `valueField === raw`,
59
- * then reads `labelField` off the returned row. When `options.labelRowFormatter` is set,
60
- * it's applied to the fetched row instead matching `OptionsDatasource.rowToOption`, which
61
- * prefers `labelRowFormatter(row)` over `row[labelField]` when rendering dropdown options —
62
- * so review agrees with what the control itself would show. Since the formatter can read any
63
- * field off the row (not just `labelField`), the row is fetched unrestricted (no `fields`
64
- * filter) whenever a formatter is present. Returns `null` when there's no resource to query,
65
- * the resource can't be reached, or no row matches.
56
+ * then reads `labelField` off the returned row. Returns `null` when there's no resource
57
+ * to query, the resource can't be reached, or no row matches.
66
58
  * @internal
67
59
  */
68
60
  export declare function resolveResourceOptionLabel(raw: any, options: any): Promise<string | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"review-utils.d.ts","sourceRoot":"","sources":["../../../src/utils/review-utils.ts"],"names":[],"mappings":"AASA,cAAc;AACd,MAAM,MAAM,WAAW,GAAG;IAAE,KAAK,EAAE,MAAM,C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ACjB,MAAM,EAAE,GAAG,EACX,eAAe,CAAC,EAAE,GAAG,GACpB,MAAM,GAAG,OAAO,EAAE,GAAG,IAAI,CAY3B;AAqED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,GAAG,GAAG,CAEpE;AAYD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAwBvD"}
@@ -118,9 +118,6 @@ export function filterReviewSections(sections, query) {
118
118
  * Looks up the display label for a raw value from `options.data` (used by segmented,
119
119
  * radio group, connected-select, and enum-with-explicit-data renderers). Honors
120
120
  * `options.valueField`/`options.labelField` when set, defaulting to `value`/`label`.
121
- * When `options.labelRowFormatter` is set, it's applied to the matched row instead of
122
- * reading `labelField` off it directly — the same formatter `OptionsDatasource.rowToOption`
123
- * applies when rendering this row as a dropdown option, so review agrees with the control.
124
121
  * Returns `null` when no match found.
125
122
  * @internal
126
123
  */
@@ -131,51 +128,38 @@ export function resolveOptionLabel(raw, options) {
131
128
  const valueKey = (_a = options.valueField) !== null && _a !== void 0 ? _a : 'value';
132
129
  const labelKey = (_b = options.labelField) !== null && _b !== void 0 ? _b : 'label';
133
130
  const entry = options.data.find((item) => item[valueKey] === raw);
134
- if (!entry)
135
- return null;
136
- return options.labelRowFormatter ? options.labelRowFormatter(entry) : ((_c = entry[labelKey]) !== null && _c !== void 0 ? _c : null);
131
+ return (_c = entry === null || entry === void 0 ? void 0 : entry[labelKey]) !== null && _c !== void 0 ? _c : null;
137
132
  }
138
133
  /**
139
134
  * Resolves the display label for a connected-select field backed by
140
135
  * `options.allOptionsResourceName` (a Data Server/Request Server resource) rather than a
141
136
  * static `options.data` array — e.g. `ConnectedSelectControlRenderer` in async/remote mode.
142
137
  * Fetches a single row via a criteria-filtered snapshot matching `valueField === raw`,
143
- * then reads `labelField` off the returned row. When `options.labelRowFormatter` is set,
144
- * it's applied to the fetched row instead matching `OptionsDatasource.rowToOption`, which
145
- * prefers `labelRowFormatter(row)` over `row[labelField]` when rendering dropdown options —
146
- * so review agrees with what the control itself would show. Since the formatter can read any
147
- * field off the row (not just `labelField`), the row is fetched unrestricted (no `fields`
148
- * filter) whenever a formatter is present. Returns `null` when there's no resource to query,
149
- * the resource can't be reached, or no row matches.
138
+ * then reads `labelField` off the returned row. Returns `null` when there's no resource
139
+ * to query, the resource can't be reached, or no row matches.
150
140
  * @internal
151
141
  */
152
142
  export function resolveResourceOptionLabel(raw, options) {
153
143
  return __awaiter(this, void 0, void 0, function* () {
154
- var _a, _b, _c;
144
+ var _a, _b, _c, _d;
155
145
  const resourceName = options === null || options === void 0 ? void 0 : options.allOptionsResourceName;
156
146
  if (!resourceName || raw === undefined || raw === null || raw === '')
157
147
  return null;
158
148
  const valueField = (_a = options.valueField) !== null && _a !== void 0 ? _a : 'value';
159
149
  const labelField = (_b = options.labelField) !== null && _b !== void 0 ? _b : 'label';
160
- const labelRowFormatter = options.labelRowFormatter;
161
150
  const datasource = getDatasource();
162
151
  try {
163
152
  const criteria = new CriteriaBuilder()
164
153
  .withExpression(new ExpressionBuilder().withField(valueField).withValue(raw).build())
165
154
  .build();
166
- const initialized = yield datasource.init(Object.assign(Object.assign(Object.assign({}, options.datasourceConfig), { resourceName,
167
- criteria, isSnapshot: true, maxRows: 1 }), (labelRowFormatter
168
- ? {}
169
- : { fields: valueField === labelField ? valueField : `${valueField} ${labelField}` })));
155
+ const initialized = yield datasource.init(Object.assign(Object.assign({}, options.datasourceConfig), { resourceName,
156
+ criteria, isSnapshot: true, maxRows: 1, fields: valueField === labelField ? valueField : `${valueField} ${labelField}` }));
170
157
  if (!initialized)
171
158
  return null;
172
159
  const rows = yield datasource.snapshotFiltered();
173
- const row = rows === null || rows === void 0 ? void 0 : rows[0];
174
- if (!row)
175
- return null;
176
- return labelRowFormatter ? labelRowFormatter(row) : ((_c = row[labelField]) !== null && _c !== void 0 ? _c : null);
160
+ return (_d = (_c = rows === null || rows === void 0 ? void 0 : rows[0]) === null || _c === void 0 ? void 0 : _c[labelField]) !== null && _d !== void 0 ? _d : null;
177
161
  }
178
- catch (_d) {
162
+ catch (_e) {
179
163
  return null;
180
164
  }
181
165
  finally {
@@ -2507,9 +2507,6 @@ export declare function resolveEnumLabel(raw: any, fieldName: string, schema: an
2507
2507
  * Looks up the display label for a raw value from `options.data` (used by segmented,
2508
2508
  * radio group, connected-select, and enum-with-explicit-data renderers). Honors
2509
2509
  * `options.valueField`/`options.labelField` when set, defaulting to `value`/`label`.
2510
- * When `options.labelRowFormatter` is set, it's applied to the matched row instead of
2511
- * reading `labelField` off it directly — the same formatter `OptionsDatasource.rowToOption`
2512
- * applies when rendering this row as a dropdown option, so review agrees with the control.
2513
2510
  * Returns `null` when no match found.
2514
2511
  * @internal
2515
2512
  */
@@ -2520,13 +2517,8 @@ export declare function resolveOptionLabel(raw: any, options: any): string | nul
2520
2517
  * `options.allOptionsResourceName` (a Data Server/Request Server resource) rather than a
2521
2518
  * static `options.data` array — e.g. `ConnectedSelectControlRenderer` in async/remote mode.
2522
2519
  * Fetches a single row via a criteria-filtered snapshot matching `valueField === raw`,
2523
- * then reads `labelField` off the returned row. When `options.labelRowFormatter` is set,
2524
- * it's applied to the fetched row instead matching `OptionsDatasource.rowToOption`, which
2525
- * prefers `labelRowFormatter(row)` over `row[labelField]` when rendering dropdown options —
2526
- * so review agrees with what the control itself would show. Since the formatter can read any
2527
- * field off the row (not just `labelField`), the row is fetched unrestricted (no `fields`
2528
- * filter) whenever a formatter is present. Returns `null` when there's no resource to query,
2529
- * the resource can't be reached, or no row matches.
2520
+ * then reads `labelField` off the returned row. Returns `null` when there's no resource
2521
+ * to query, the resource can't be reached, or no row matches.
2530
2522
  * @internal
2531
2523
  */
2532
2524
  export declare function resolveResourceOptionLabel(raw: any, options: any): Promise<string | null>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-forms",
3
3
  "description": "Genesis Foundation Forms",
4
- "version": "15.19.2-FUI-2610.2",
4
+ "version": "15.19.2",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -59,13 +59,13 @@
59
59
  }
60
60
  },
61
61
  "devDependencies": {
62
- "@genesislcap/foundation-testing": "15.19.2-FUI-2610.2",
63
- "@genesislcap/genx": "15.19.2-FUI-2610.2",
64
- "@genesislcap/rollup-builder": "15.19.2-FUI-2610.2",
65
- "@genesislcap/ts-builder": "15.19.2-FUI-2610.2",
66
- "@genesislcap/uvu-playwright-builder": "15.19.2-FUI-2610.2",
67
- "@genesislcap/vite-builder": "15.19.2-FUI-2610.2",
68
- "@genesislcap/webpack-builder": "15.19.2-FUI-2610.2",
62
+ "@genesislcap/foundation-testing": "15.19.2",
63
+ "@genesislcap/genx": "15.19.2",
64
+ "@genesislcap/rollup-builder": "15.19.2",
65
+ "@genesislcap/ts-builder": "15.19.2",
66
+ "@genesislcap/uvu-playwright-builder": "15.19.2",
67
+ "@genesislcap/vite-builder": "15.19.2",
68
+ "@genesislcap/webpack-builder": "15.19.2",
69
69
  "@types/json-schema": "^7.0.11",
70
70
  "@types/papaparse": "^5.3.14"
71
71
  },
@@ -82,12 +82,12 @@
82
82
  }
83
83
  },
84
84
  "dependencies": {
85
- "@genesislcap/foundation-comms": "15.19.2-FUI-2610.2",
86
- "@genesislcap/foundation-criteria": "15.19.2-FUI-2610.2",
87
- "@genesislcap/foundation-logger": "15.19.2-FUI-2610.2",
88
- "@genesislcap/foundation-notifications": "15.19.2-FUI-2610.2",
89
- "@genesislcap/foundation-ui": "15.19.2-FUI-2610.2",
90
- "@genesislcap/foundation-utils": "15.19.2-FUI-2610.2",
85
+ "@genesislcap/foundation-comms": "15.19.2",
86
+ "@genesislcap/foundation-criteria": "15.19.2",
87
+ "@genesislcap/foundation-logger": "15.19.2",
88
+ "@genesislcap/foundation-notifications": "15.19.2",
89
+ "@genesislcap/foundation-ui": "15.19.2",
90
+ "@genesislcap/foundation-utils": "15.19.2",
91
91
  "@json-schema-tools/dereferencer": "^1.6.1",
92
92
  "@jsonforms/core": "^3.2.1",
93
93
  "@microsoft/fast-components": "2.30.6",