udp-stencil-component-library 26.9.0-beta.17 → 26.9.0-beta.18

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.
Files changed (42) hide show
  1. package/dist/cjs/ag-grid-base_66.cjs.entry.js +28 -10
  2. package/dist/cjs/{extraFields-COF-QTmY.js → extraFields-CNvT2Qyf.js} +42 -1
  3. package/dist/cjs/{extraFieldsHelper-CCIXIxFx.js → extraFieldsHelper-Clk9u_FW.js} +20 -4
  4. package/dist/cjs/index.cjs.js +12 -0
  5. package/dist/cjs/search-method-grid.cjs.entry.js +23 -14
  6. package/dist/cjs/server-side-grid.cjs.entry.js +2 -2
  7. package/dist/cjs/udp-advanced-search-builder.cjs.entry.js +9 -3
  8. package/dist/collection/components/advanced-search-builder/udp-advanced-search-builder.js +9 -3
  9. package/dist/collection/components/fluent-ui/dropdown/udp-fluent-dropdown.js +28 -10
  10. package/dist/collection/components/grid/new-grid/helperFunctions/extraFieldsHelper.js +20 -4
  11. package/dist/collection/components/grid/new-grid/search-method-grid.js +21 -12
  12. package/dist/collection/index.js +1 -0
  13. package/dist/collection/udp-utilities/extra-fields/extraFields.js +36 -1
  14. package/dist/components/extraFields.js +1 -1
  15. package/dist/components/index.js +1 -1
  16. package/dist/components/search-method-grid2.js +1 -1
  17. package/dist/components/server-side-grid2.js +1 -1
  18. package/dist/components/udp-advanced-search-builder.js +1 -1
  19. package/dist/components/udp-fluent-dropdown2.js +1 -1
  20. package/dist/docs.json +1 -1
  21. package/dist/esm/ag-grid-base_66.entry.js +28 -10
  22. package/dist/esm/{extraFields-BqCe3fVb.js → extraFields-Cnpy_Bm7.js} +38 -2
  23. package/dist/esm/{extraFieldsHelper-CAiyvIlI.js → extraFieldsHelper-CaBMA4HJ.js} +20 -4
  24. package/dist/esm/index.js +1 -0
  25. package/dist/esm/search-method-grid.entry.js +23 -14
  26. package/dist/esm/server-side-grid.entry.js +2 -2
  27. package/dist/esm/udp-advanced-search-builder.entry.js +9 -3
  28. package/dist/stencil-library/ag-grid-base_66.entry.js +1 -1
  29. package/dist/stencil-library/extraFields-Cnpy_Bm7.js +1 -0
  30. package/dist/stencil-library/extraFieldsHelper-CaBMA4HJ.js +1 -0
  31. package/dist/stencil-library/index.esm.js +1 -1
  32. package/dist/stencil-library/search-method-grid.entry.js +1 -1
  33. package/dist/stencil-library/server-side-grid.entry.js +1 -1
  34. package/dist/stencil-library/udp-advanced-search-builder.entry.js +1 -1
  35. package/dist/types/components/fluent-ui/dropdown/udp-fluent-dropdown.d.ts +12 -1
  36. package/dist/types/components/grid/new-grid/helperFunctions/extraFieldsHelper.d.ts +3 -1
  37. package/dist/types/components/grid/new-grid/search-method-grid.d.ts +5 -0
  38. package/dist/types/index.d.ts +1 -0
  39. package/dist/types/udp-utilities/extra-fields/extraFields.d.ts +42 -0
  40. package/package.json +1 -1
  41. package/dist/stencil-library/extraFields-BqCe3fVb.js +0 -1
  42. package/dist/stencil-library/extraFieldsHelper-CAiyvIlI.js +0 -1
@@ -8585,6 +8585,8 @@ const UdpFluentDropdown = class {
8585
8585
  * Single mode: the selected option (or null). Multi mode: array of selected options.
8586
8586
  */
8587
8587
  this.selectionForOverlay = null;
8588
+ /** Set by the value/options watchers; the next render applies the selection to the options it rendered. */
8589
+ this.selectionPending = false;
8588
8590
  this.typeaheadBuffer = '';
8589
8591
  this.handleTogglePopover = (onlyClose) => {
8590
8592
  var _a, _b, _c, _d;
@@ -8733,7 +8735,20 @@ const UdpFluentDropdown = class {
8733
8735
  componentDidLoad() {
8734
8736
  this.patchDropdownShadow();
8735
8737
  this.syncSelectionForOverlay();
8736
- this.valueHandler();
8738
+ this.applySelection();
8739
+ }
8740
+ /**
8741
+ * Applies a value/options change once the render it caused has run. The
8742
+ * watchers fire before that render, so a new options list's
8743
+ * `<fluent-option>`s don't exist yet; syncing from the watcher (even a frame
8744
+ * later) can miss them, leaving a value set before its options arrived with
8745
+ * no selected option and an empty control.
8746
+ */
8747
+ componentDidRender() {
8748
+ if (!this.selectionPending)
8749
+ return;
8750
+ this.selectionPending = false;
8751
+ this.applySelection();
8737
8752
  }
8738
8753
  /**
8739
8754
  * Override fluent-dropdown's hardcoded min-width: 160px on .control (shadow DOM,
@@ -8752,8 +8767,11 @@ const UdpFluentDropdown = class {
8752
8767
  `);
8753
8768
  shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, sheet];
8754
8769
  }
8755
- /** Syncs fluent-dropdown selection when value or options change. */
8770
+ /** Syncs fluent-dropdown selection when value or options change, after they render. */
8756
8771
  valueHandler() {
8772
+ this.selectionPending = true;
8773
+ }
8774
+ applySelection() {
8757
8775
  if (!this.dropdownRef)
8758
8776
  return;
8759
8777
  // rAF lets the option list finish rendering before we read selected state.
@@ -8885,15 +8903,15 @@ const UdpFluentDropdown = class {
8885
8903
  const overlayOptions = this.getSelectedOverlayOptions();
8886
8904
  const hasOverlay = overlayOptions.length > 0;
8887
8905
  const mappedAppearance = this.appearance === 'underline' ? 'transparent' : this.appearance;
8888
- return (index.h(index.Host, { key: '58c4799acc96a25e5474da84b101979b884d88d9', class: { 'has-error': hasError } }, index.h("fluent-field", { key: '57fb717379eaf0e23c7e06a351638aeebe82593e', class: {
8906
+ return (index.h(index.Host, { key: '4af2944eac3fbcc8a7ab5a728739db9ac5dfd6c9', class: { 'has-error': hasError } }, index.h("fluent-field", { key: 'a363bf200bdbb04ccb82526ce5273057cf179a39', class: {
8889
8907
  'no-message': !message && !this.includeErrorPadding,
8890
8908
  'no-label': !this.label,
8891
- } }, this.label && (index.h("fluent-label", { key: '2eaf3e70418bf7ca6929f6b79f641e0eefe4e78e', slot: "label", disabled: this.disabled, onClick: () => this.handleTogglePopover(false), style: { paddingTop: '2px', paddingBottom: '2px' } }, this.label, this.popupHint && (index.h("udp-tooltip", { key: 'c1a98aa9eac686f43f837ba4770b5a35f581000e', content: this.popupHint, positioning: "above" }, index.h("udp-fluent-icon", { key: '647e12173d5bf6e33d32dd35a5ed80a6a01c7173', name: "info", size: "xs", class: "popup-hint-icon" }))))), index.h("div", { key: 'add2b58997925547e2025f1eb972dbca68e7c652', slot: "input", class: {
8909
+ } }, this.label && (index.h("fluent-label", { key: '7eeebfc9170e03046fd797c7053a110b7eae38f5', slot: "label", disabled: this.disabled, onClick: () => this.handleTogglePopover(false), style: { paddingTop: '2px', paddingBottom: '2px' } }, this.label, this.popupHint && (index.h("udp-tooltip", { key: 'b60927d3204d20b8d957727baa8c93ec98c2888e', content: this.popupHint, positioning: "above" }, index.h("udp-fluent-icon", { key: 'fe96ed742d2bc568cfe64947a08b5c1ee383a508', name: "info", size: "xs", class: "popup-hint-icon" }))))), index.h("div", { key: '27b94bf86cba1b03e2cf5535bc06ba0eabf9a300', slot: "input", class: {
8892
8910
  'input-wrapper': true,
8893
8911
  'has-overlay': hasOverlay,
8894
- } }, index.h("fluent-dropdown", { key: 'a765b55d7d33cbb274cc774dae28004644498b45', type: "dropdown", name: this.name, appearance: mappedAppearance, size: this.controlSize, required: this.required, disabled: this.disabled, placeholder: this.placeholder, multiple: this.multiple, onChange: this.handleChange, onKeyDown: this.handleKeyDown, onFocusout: () => this.inputBlur.emit(), onFocusin: () => this.inputFocus.emit(),
8912
+ } }, index.h("fluent-dropdown", { key: 'd245ecdd3db862a6138f542394f82ce9d329e959', type: "dropdown", name: this.name, appearance: mappedAppearance, size: this.controlSize, required: this.required, disabled: this.disabled, placeholder: this.placeholder, multiple: this.multiple, onChange: this.handleChange, onKeyDown: this.handleKeyDown, onFocusout: () => this.inputBlur.emit(), onFocusin: () => this.inputFocus.emit(),
8895
8913
  // Suppress native invalid popup
8896
- onInvalid: (e) => e.preventDefault(), ref: el => (this.dropdownRef = el) }, index.h("fluent-listbox", { key: '74e0c77c78d1159d2ee9101f1029bf73fce633e5' }, this.loading && (index.h("fluent-option", { key: 'e7bf23cfc42dbb1445252a1f0bcf0f4e4c1773b6', disabled: true, ref: (el) => el === null || el === void 0 ? void 0 : el.toggleAttribute('disabled', true) }, index.h("span", { key: '9f9ee2a6fc2d0758f0b6dd51ea94fd99ae54438e' }, "Loading..."), index.h("span", { key: '193fe93beb18232046ff809643162a818ad14830', slot: "indicator" }))), !this.loading && ((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) === 0 && (index.h("fluent-option", { key: '46ffff80b6f8159113777fc667e8590c9cc32cbb', disabled: true, value: "empty", ref: (el) => el === null || el === void 0 ? void 0 : el.toggleAttribute('disabled', true) }, "No options available")), !this.loading &&
8914
+ onInvalid: (e) => e.preventDefault(), ref: el => (this.dropdownRef = el) }, index.h("fluent-listbox", { key: 'd0f8a3f1edf511c18937ab394a2a33f35995433b' }, this.loading && (index.h("fluent-option", { key: '4248b325952cfb566291400e99f7e8462e4db642', disabled: true, ref: (el) => el === null || el === void 0 ? void 0 : el.toggleAttribute('disabled', true) }, index.h("span", { key: '9a67a779d650ac68e979b19664593a43009fa82f' }, "Loading..."), index.h("span", { key: '32f0ae502cf34615e49152bef429be5a3c46c1b1', slot: "indicator" }))), !this.loading && ((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) === 0 && (index.h("fluent-option", { key: '7ba997073e25008269c37f3ceaa1053ca6e50cc5', disabled: true, value: "empty", ref: (el) => el === null || el === void 0 ? void 0 : el.toggleAttribute('disabled', true) }, "No options available")), !this.loading &&
8897
8915
  ((_b = this.options) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
8898
8916
  (() => {
8899
8917
  const nodes = [];
@@ -8913,17 +8931,17 @@ const UdpFluentDropdown = class {
8913
8931
  nodes.push(index.h("fluent-option", { key: index$1, disabled: !!optDisabled, value: safeValue, ref: (el) => el === null || el === void 0 ? void 0 : el.toggleAttribute('disabled', !!optDisabled) }, optIcon && this.iconPosition === 'start' && (index.h("span", { slot: "start", class: "option-icon-slot" }, index.h("udp-fluent-icon", { name: optIcon, size: "sm" }))), optLabel, optIcon && this.iconPosition === 'end' && (index.h("span", { class: "option-icon-end", style: { pointerEvents: 'none', marginLeft: '4px' } }, index.h("udp-fluent-icon", { name: optIcon, size: "sm" }))), this.renderBadges(optBadges)));
8914
8932
  });
8915
8933
  return nodes;
8916
- })()), index.h("div", { key: '82c3f8c77d0cca8490b0d095621ed87c06d213e5', slot: "indicator", class: "indicator-wrapper" }, index.h("udp-fluent-icon-button", { key: '15816daefec1e9a81cd1d54ba8c8d924e683a74e', class: {
8934
+ })()), index.h("div", { key: '71aa382d0627d33ade32250abdb524f9f400d1d6', slot: "indicator", class: "indicator-wrapper" }, index.h("udp-fluent-icon-button", { key: 'ae08bacc142cf4309b7c1ea50a2700f9ff25dd2c', class: {
8917
8935
  'clear-button': true,
8918
8936
  'is-visible': this.showClearButton && !this.disabled && this.clearable,
8919
- }, slot: "indicator", iconName: "dismiss", appearance: "transparent", size: "small", onClick: this.handleClear, onMouseDown: e => e.preventDefault(), ariaLabel: "Clear", tabIndex: -1 }), index.h("udp-fluent-icon", { key: 'aae7c4dd3eadcc58b9915e6b452bfacfb3a65887', name: "chevron-down", size: "sm", class: "chevron-down", onClick: (ev) => {
8937
+ }, slot: "indicator", iconName: "dismiss", appearance: "transparent", size: "small", onClick: this.handleClear, onMouseDown: e => e.preventDefault(), ariaLabel: "Clear", tabIndex: -1 }), index.h("udp-fluent-icon", { key: 'b5a1b696d6dff58c26d6935e6ea6961752e7253e', name: "chevron-down", size: "sm", class: "chevron-down", onClick: (ev) => {
8920
8938
  // stopPropagation: fluent's clickHandler would re-open via its `!this.open → showPopover` branch.
8921
8939
  ev.stopPropagation();
8922
8940
  this.handleTogglePopover(false);
8923
- } }))), hasOverlay && (index.h("div", { key: '0a98a93514c4fb5a521f51a35cd5b4c18ff9e838', class: { 'selected-overlay': true, 'multi': overlayOptions.length > 1 }, "aria-hidden": "true" }, overlayOptions.map((opt, i) => (index.h("span", { class: "selected-item", key: this.getOptionValue(opt) || i }, i > 0 && index.h("span", { class: "selected-separator" }, ", "), index.h("span", { class: "selected-label" }, this.resolveProp(opt, this.optionLabel, true)), this.renderBadges(this.getOptionBadges(opt)))))))), index.h("div", { key: '74a81db56e13dfbde829696586b6e7c33b08db29', class: {
8941
+ } }))), hasOverlay && (index.h("div", { key: 'dd009ec183faf48af1a1a7b959b658ba02d900ca', class: { 'selected-overlay': true, 'multi': overlayOptions.length > 1 }, "aria-hidden": "true" }, overlayOptions.map((opt, i) => (index.h("span", { class: "selected-item", key: this.getOptionValue(opt) || i }, i > 0 && index.h("span", { class: "selected-separator" }, ", "), index.h("span", { class: "selected-label" }, this.resolveProp(opt, this.optionLabel, true)), this.renderBadges(this.getOptionBadges(opt)))))))), index.h("div", { key: '7e5b4f4adc04da9bdea3311032e17abe244580f7', class: {
8924
8942
  'message-wrapper': true,
8925
8943
  'includeErrorPadding': this.includeErrorPadding,
8926
- }, slot: "message", onClick: () => this.handleTogglePopover(true) }, index.h("udp-text", { key: '3aca9404e71fa57d5c2f5d0e4b3f7b5079b198cb', variant: "caption1", class: {
8944
+ }, slot: "message", onClick: () => this.handleTogglePopover(true) }, index.h("udp-text", { key: 'afb12736acb544f45fd2e4dd92cfd58279ce9a4f', variant: "caption1", class: {
8927
8945
  message: true,
8928
8946
  error: hasError,
8929
8947
  } }, message)))));
@@ -6,6 +6,7 @@ var configService = require('./configService-DbfLqId2.js');
6
6
  const EXTRA_FIELD_DEFAULT_PREFIX = '_UdpExtraField';
7
7
  /** `udp.ExtraFieldValueType` seed: 1 String / 2 Number / 3 Date / 4 Boolean. */
8
8
  const ExtraFieldValueType = {
9
+ String: 1,
9
10
  Number: 2,
10
11
  Date: 3,
11
12
  Boolean: 4,
@@ -19,7 +20,42 @@ function extraFieldKey(prefix, name) {
19
20
  }
20
21
  async function fetchExtraFieldDefinitions(domainName) {
21
22
  const definitions = (await makeApiCall.makeApiCall('GET', `${configService.ConfigService.productV1ApiUrl}/UdpExtraField/domain/${encodeURIComponent(domainName)}`));
22
- return (definitions !== null && definitions !== void 0 ? definitions : []).filter(d => d.enabled !== false);
23
+ return enabledExtraFieldDefinitions(definitions);
24
+ }
25
+ /** The enabled definitions, in `order`. */
26
+ function enabledExtraFieldDefinitions(definitions) {
27
+ return (definitions !== null && definitions !== void 0 ? definitions : [])
28
+ .filter(d => d.enabled !== false)
29
+ .sort((a, b) => { var _a, _b; return ((_a = a.order) !== null && _a !== void 0 ? _a : 0) - ((_b = b.order) !== null && _b !== void 0 ? _b : 0); });
30
+ }
31
+ /**
32
+ * The enabled definitions applicable to an existing record in its current
33
+ * state (`GET UdpExtraField/applicable?entityBusinessKey=`). The domain is the
34
+ * key's FQN half; an unresolvable key is a 400.
35
+ */
36
+ async function fetchApplicableExtraFields(entityBusinessKey) {
37
+ const definitions = (await makeApiCall.makeApiCall('GET', `${configService.ConfigService.productV1ApiUrl}/UdpExtraField/applicable?entityBusinessKey=${encodeURIComponent(entityBusinessKey)}`));
38
+ return enabledExtraFieldDefinitions(definitions);
39
+ }
40
+ /**
41
+ * The enabled definitions applicable for a column-to-value map
42
+ * (`POST UdpExtraField/domain/{domainName}/applicable`): the create-form case,
43
+ * where the record does not exist yet. An empty map matches only definitions
44
+ * without conditions.
45
+ */
46
+ async function fetchApplicableExtraFieldsForDomain(domainName, conditionValues) {
47
+ const definitions = (await makeApiCall.makeApiCall('POST', `${configService.ConfigService.productV1ApiUrl}/UdpExtraField/domain/${encodeURIComponent(domainName)}/applicable`, conditionValues, true));
48
+ return enabledExtraFieldDefinitions(definitions);
49
+ }
50
+ /**
51
+ * Stores a record's values (`PUT UdpExtraField/values`). The backend validates
52
+ * each one against its definition (enabled, applicable to the record's current
53
+ * state, parses under the value type) and rejects the whole set with a 400
54
+ * whose body names the offending field.
55
+ */
56
+ async function saveExtraFieldValues(entityBusinessKey, values) {
57
+ const rows = (await makeApiCall.makeApiCall('PUT', `${configService.ConfigService.productV1ApiUrl}/UdpExtraField/values`, { entityBusinessKey, values }, true));
58
+ return rows !== null && rows !== void 0 ? rows : [];
23
59
  }
24
60
  /**
25
61
  * The two-request fallback: a record's values with their definitions, for rows
@@ -62,7 +98,12 @@ function extraFieldsToVirtualFieldGroup(definitions, prefix = EXTRA_FIELD_DEFAUL
62
98
 
63
99
  exports.EXTRA_FIELD_DEFAULT_PREFIX = EXTRA_FIELD_DEFAULT_PREFIX;
64
100
  exports.ExtraFieldValueType = ExtraFieldValueType;
101
+ exports.enabledExtraFieldDefinitions = enabledExtraFieldDefinitions;
102
+ exports.extraFieldCatalogType = extraFieldCatalogType;
65
103
  exports.extraFieldKey = extraFieldKey;
66
104
  exports.extraFieldsToVirtualFieldGroup = extraFieldsToVirtualFieldGroup;
105
+ exports.fetchApplicableExtraFields = fetchApplicableExtraFields;
106
+ exports.fetchApplicableExtraFieldsForDomain = fetchApplicableExtraFieldsForDomain;
67
107
  exports.fetchExtraFieldDefinitions = fetchExtraFieldDefinitions;
68
108
  exports.fetchExtraFieldValues = fetchExtraFieldValues;
109
+ exports.saveExtraFieldValues = saveExtraFieldValues;
@@ -1,15 +1,21 @@
1
1
  'use strict';
2
2
 
3
- var extraFields = require('./extraFields-COF-QTmY.js');
3
+ var extraFields = require('./extraFields-CNvT2Qyf.js');
4
4
 
5
5
  /**
6
6
  * Fetches the domain's enabled definitions and builds their column defs.
7
- * `domainName` defaults to `entityName`; a failed fetch logs and yields no columns.
7
+ * `domainName` defaults to `entityName`; a failed fetch logs and yields no
8
+ * columns. Definitions the consumer already holds (`config.definitions`) are
9
+ * used as they are, so the domain is not fetched twice.
8
10
  */
9
11
  async function loadExtraFieldColumnDefs(config, entityName) {
10
12
  var _a;
11
- const domainName = (_a = config === null || config === void 0 ? void 0 : config.domainName) !== null && _a !== void 0 ? _a : entityName;
12
- if (!config || !domainName)
13
+ if (!config)
14
+ return [];
15
+ if (config.definitions)
16
+ return buildExtraFieldColumnDefs(extraFields.enabledExtraFieldDefinitions(config.definitions), config);
17
+ const domainName = (_a = config.domainName) !== null && _a !== void 0 ? _a : entityName;
18
+ if (!domainName)
13
19
  return [];
14
20
  try {
15
21
  return buildExtraFieldColumnDefs(await extraFields.fetchExtraFieldDefinitions(domainName), config);
@@ -41,6 +47,11 @@ function whenColumnsInstalled(api, expectedCount, callback) {
41
47
  };
42
48
  api.addEventListener('gridColumnsChanged', handler);
43
49
  }
50
+ /** The grid's boolean icons (`booleanChip`), keyed by the stored canonical text. */
51
+ const EXTRA_FIELD_BOOLEAN_ICONS = {
52
+ True: { iconName: 'checkMark24', color: 'success' },
53
+ False: { iconName: 'close24', color: 'error' },
54
+ };
44
55
  function buildExtraFieldColumnDefs(definitions, config) {
45
56
  var _a;
46
57
  const prefix = (_a = config.prefix) !== null && _a !== void 0 ? _a : extraFields.EXTRA_FIELD_DEFAULT_PREFIX;
@@ -70,9 +81,14 @@ function buildExtraFieldColumnDefs(definitions, config) {
70
81
  colDef.cellDataType = 'dateString';
71
82
  break;
72
83
  case extraFields.ExtraFieldValueType.Boolean:
84
+ // Values stay the stored text, which the set filter and search send
85
+ // as is; the cell shows them as the grid's boolean check / cross
86
+ // (the `booleanChip` column type), and an unset value as nothing.
73
87
  colDef.cellDataType = 'text';
74
88
  colDef.filter = 'agSetColumnFilter';
75
89
  colDef.filterParams = { values: ['True', 'False'] };
90
+ colDef.cellRenderer = 'iconRenderer';
91
+ colDef.cellRendererParams = { iconMappingConfig: EXTRA_FIELD_BOOLEAN_ICONS };
76
92
  break;
77
93
  default:
78
94
  colDef.cellDataType = 'text';
@@ -11,6 +11,7 @@ var fluentIcons = require('./fluent-icons-Cs6J6uVm.js');
11
11
  var SearchBuilder = require('./SearchBuilder-Ca9_ur9o.js');
12
12
  var searchObject = require('./searchObject-mbqgqdRh.js');
13
13
  var catalogTree = require('./catalogTree-CeNSaV52.js');
14
+ var extraFields = require('./extraFields-CNvT2Qyf.js');
14
15
  var configService = require('./configService-DbfLqId2.js');
15
16
  var apiMethodInstance = require('./apiMethodInstance-LbRDoXDd.js');
16
17
  var themeManager = require('./theme-manager-vLJfQYn8.js');
@@ -291,6 +292,17 @@ exports.buildCatalogTree = catalogTree.buildCatalogTree;
291
292
  exports.buildIndices = catalogTree.buildIndices;
292
293
  exports.findNodeByPath = catalogTree.findNodeByPath;
293
294
  exports.isCatalogModelObject = catalogTree.isCatalogModelObject;
295
+ exports.EXTRA_FIELD_DEFAULT_PREFIX = extraFields.EXTRA_FIELD_DEFAULT_PREFIX;
296
+ exports.ExtraFieldValueType = extraFields.ExtraFieldValueType;
297
+ exports.enabledExtraFieldDefinitions = extraFields.enabledExtraFieldDefinitions;
298
+ exports.extraFieldCatalogType = extraFields.extraFieldCatalogType;
299
+ exports.extraFieldKey = extraFields.extraFieldKey;
300
+ exports.extraFieldsToVirtualFieldGroup = extraFields.extraFieldsToVirtualFieldGroup;
301
+ exports.fetchApplicableExtraFields = extraFields.fetchApplicableExtraFields;
302
+ exports.fetchApplicableExtraFieldsForDomain = extraFields.fetchApplicableExtraFieldsForDomain;
303
+ exports.fetchExtraFieldDefinitions = extraFields.fetchExtraFieldDefinitions;
304
+ exports.fetchExtraFieldValues = extraFields.fetchExtraFieldValues;
305
+ exports.saveExtraFieldValues = extraFields.saveExtraFieldValues;
294
306
  exports.ConfigService = configService.ConfigService;
295
307
  exports.buildColumnDefsFromCatalog = apiMethodInstance.buildColumnDefsFromCatalog;
296
308
  exports.getCurrentThemeMode = themeManager.getCurrentThemeMode;
@@ -4,9 +4,9 @@ var index = require('./index-CZB9dMeB.js');
4
4
  var apiUtils = require('./apiUtils-033JlOLN.js');
5
5
  var lookupHelper = require('./lookupHelper-D3aLYJ57.js');
6
6
  var makeApiCall = require('./makeApiCall-CFfg9gI0.js');
7
- var extraFieldsHelper = require('./extraFieldsHelper-CCIXIxFx.js');
7
+ var extraFieldsHelper = require('./extraFieldsHelper-Clk9u_FW.js');
8
8
  var configService = require('./configService-DbfLqId2.js');
9
- var extraFields = require('./extraFields-COF-QTmY.js');
9
+ var extraFields = require('./extraFields-CNvT2Qyf.js');
10
10
  var isEqual = require('lodash-es/isEqual');
11
11
  require('./tenantUtils-BCKSE0vq.js');
12
12
  require('./getCurrentApiCatalogId-D7xHCEzs.js');
@@ -216,11 +216,18 @@ const SearchMethodGrid = class {
216
216
  });
217
217
  }
218
218
  }
219
+ /**
220
+ * The base columns with the extra-field columns inserted. Extra columns join
221
+ * existing ones: while the base columns are still empty (a host still
222
+ * loading its catalog) none are shown, so they never appear on their own.
223
+ */
219
224
  mergedColumnDefs() {
220
- var _a;
221
- return this.extraFieldsReady
222
- ? extraFieldsHelper.insertExtraFieldColumns(this.columnDefs, this.extraFieldColumnDefs, (_a = this.extraFields) === null || _a === void 0 ? void 0 : _a.position)
223
- : [];
225
+ var _a, _b, _c;
226
+ if (!this.extraFieldsReady)
227
+ return [];
228
+ if (!((_a = this.columnDefs) === null || _a === void 0 ? void 0 : _a.length))
229
+ return (_b = this.columnDefs) !== null && _b !== void 0 ? _b : [];
230
+ return extraFieldsHelper.insertExtraFieldColumns(this.columnDefs, this.extraFieldColumnDefs, (_c = this.extraFields) === null || _c === void 0 ? void 0 : _c.position);
224
231
  }
225
232
  setDatasource() {
226
233
  var _a;
@@ -246,13 +253,15 @@ const SearchMethodGrid = class {
246
253
  requestUrl: requestUrl,
247
254
  integrationFallbackApiMethodId: integrationFallbackApiMethodId,
248
255
  extraFields: this.extraFields ? { prefix: this.extraFields.prefix } : undefined,
249
- externalSearchObject: customSearchObject ? {
250
- filterElements: customSearchObject.filterElements,
251
- filterGroups: customSearchObject.filterGroups,
252
- logicalSearchOperator: customSearchObject.logicalSearchOperator,
253
- eagerLoad: (_a = customSearchObject.eagerLoad) !== null && _a !== void 0 ? _a : false,
254
- getAll: customSearchObject.getAll,
255
- } : undefined,
256
+ externalSearchObject: customSearchObject
257
+ ? {
258
+ filterElements: customSearchObject.filterElements,
259
+ filterGroups: customSearchObject.filterGroups,
260
+ logicalSearchOperator: customSearchObject.logicalSearchOperator,
261
+ eagerLoad: (_a = customSearchObject.eagerLoad) !== null && _a !== void 0 ? _a : false,
262
+ getAll: customSearchObject.getAll,
263
+ }
264
+ : undefined,
256
265
  });
257
266
  }
258
267
  }
@@ -271,7 +280,7 @@ const SearchMethodGrid = class {
271
280
  }
272
281
  }
273
282
  render() {
274
- return (index.h("server-side-grid", { key: 'da7fa5951b9603432e7edc58386a71e0d265f08f', onGridReady: e => this.handleGridReady(e), dataSource: this.dataSource, gridFunctions: this.gridFunctions, columnDefs: this.mergedColumnDefs(), gridOptions: this.gridOptions, gridHeaderConfig: this.gridHeaderConfig, gridId: this.gridId, entityName: this.entityName, gridHeight: this.gridHeight, gridApiCallback: this.gridApiCallback }));
283
+ return (index.h("server-side-grid", { key: '7ebf7ba23217830a5e42766c94481fa2a9645cae', onGridReady: e => this.handleGridReady(e), dataSource: this.dataSource, gridFunctions: this.gridFunctions, columnDefs: this.mergedColumnDefs(), gridOptions: this.gridOptions, gridHeaderConfig: this.gridHeaderConfig, gridId: this.gridId, entityName: this.entityName, gridHeight: this.gridHeight, gridApiCallback: this.gridApiCallback }));
275
284
  }
276
285
  static get watchers() { return {
277
286
  "searchMethodConfig": [{
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-CZB9dMeB.js');
4
- var extraFieldsHelper = require('./extraFieldsHelper-CCIXIxFx.js');
4
+ var extraFieldsHelper = require('./extraFieldsHelper-Clk9u_FW.js');
5
5
  var lookupHelper = require('./lookupHelper-D3aLYJ57.js');
6
- var extraFields = require('./extraFields-COF-QTmY.js');
6
+ var extraFields = require('./extraFields-CNvT2Qyf.js');
7
7
  require('./apiUtils-033JlOLN.js');
8
8
  require('lodash-es/isEqual');
9
9
  require('./makeApiCall-CFfg9gI0.js');
@@ -5,7 +5,7 @@ var searchObject = require('./searchObject-mbqgqdRh.js');
5
5
  var entityUtilities = require('./entityUtilities-DX7NkEg2.js');
6
6
  var udpOperatorHelper = require('./udpOperatorHelper-NG6jnF8B.js');
7
7
  var catalogTree = require('./catalogTree-CeNSaV52.js');
8
- var extraFields = require('./extraFields-COF-QTmY.js');
8
+ var extraFields = require('./extraFields-CNvT2Qyf.js');
9
9
  require('./makeApiCall-CFfg9gI0.js');
10
10
  require('axios');
11
11
  require('./configService-DbfLqId2.js');
@@ -859,7 +859,11 @@ const UdpAdvancedSearchBuilder = class {
859
859
  // have landed after the last build, and `associations` match case-insensitively
860
860
  // while the graft needs the tree's canonical path.
861
861
  this.buildFieldTree();
862
- const targets = [{ path: '', domainName }];
862
+ // The root's definitions may already be in hand (a grid that decided its
863
+ // opt-in from them); only association domains are then fetched.
864
+ const targets = [
865
+ { path: '', domainName, definitions: this.extraFields.definitions },
866
+ ];
863
867
  for (const route of (_d = this.associations) !== null && _d !== void 0 ? _d : []) {
864
868
  const resolved = this.resolveAssociationPath(route);
865
869
  const entity = (_e = resolved === null || resolved === void 0 ? void 0 : resolved.node.displayName) !== null && _e !== void 0 ? _e : resolved === null || resolved === void 0 ? void 0 : resolved.node.name;
@@ -870,7 +874,9 @@ const UdpAdvancedSearchBuilder = class {
870
874
  try {
871
875
  const groups = await Promise.all(targets.map(async (target) => {
872
876
  try {
873
- const definitions = await extraFields.fetchExtraFieldDefinitions(target.domainName);
877
+ const definitions = target.definitions
878
+ ? extraFields.enabledExtraFieldDefinitions(target.definitions)
879
+ : await extraFields.fetchExtraFieldDefinitions(target.domainName);
874
880
  return extraFields.extraFieldsToVirtualFieldGroup(definitions, prefix, target.path);
875
881
  }
876
882
  catch (e) {
@@ -6,7 +6,7 @@ import { generateFilterString } from "./helperFunctions/createStringFromSearchOb
6
6
  import { humanizeIdentifier } from "./helperFunctions/labelHelper";
7
7
  import { getAllowedSearchOperators } from "./helperFunctions/udpOperatorHelper";
8
8
  import { DragManager } from "./drag-manager";
9
- import { EXTRA_FIELD_DEFAULT_PREFIX, extraFieldsToVirtualFieldGroup, fetchExtraFieldDefinitions, } from "../../udp-utilities/extra-fields/index";
9
+ import { EXTRA_FIELD_DEFAULT_PREFIX, enabledExtraFieldDefinitions, extraFieldsToVirtualFieldGroup, fetchExtraFieldDefinitions, } from "../../udp-utilities/extra-fields/index";
10
10
  export class UdpAdvancedSearchBuilder {
11
11
  constructor() {
12
12
  /**
@@ -254,7 +254,11 @@ export class UdpAdvancedSearchBuilder {
254
254
  // have landed after the last build, and `associations` match case-insensitively
255
255
  // while the graft needs the tree's canonical path.
256
256
  this.buildFieldTree();
257
- const targets = [{ path: '', domainName }];
257
+ // The root's definitions may already be in hand (a grid that decided its
258
+ // opt-in from them); only association domains are then fetched.
259
+ const targets = [
260
+ { path: '', domainName, definitions: this.extraFields.definitions },
261
+ ];
258
262
  for (const route of (_d = this.associations) !== null && _d !== void 0 ? _d : []) {
259
263
  const resolved = this.resolveAssociationPath(route);
260
264
  const entity = (_e = resolved === null || resolved === void 0 ? void 0 : resolved.node.displayName) !== null && _e !== void 0 ? _e : resolved === null || resolved === void 0 ? void 0 : resolved.node.name;
@@ -265,7 +269,9 @@ export class UdpAdvancedSearchBuilder {
265
269
  try {
266
270
  const groups = await Promise.all(targets.map(async (target) => {
267
271
  try {
268
- const definitions = await fetchExtraFieldDefinitions(target.domainName);
272
+ const definitions = target.definitions
273
+ ? enabledExtraFieldDefinitions(target.definitions)
274
+ : await fetchExtraFieldDefinitions(target.domainName);
269
275
  return extraFieldsToVirtualFieldGroup(definitions, prefix, target.path);
270
276
  }
271
277
  catch (e) {
@@ -105,6 +105,8 @@ export class UdpFluentDropdown {
105
105
  * Single mode: the selected option (or null). Multi mode: array of selected options.
106
106
  */
107
107
  this.selectionForOverlay = null;
108
+ /** Set by the value/options watchers; the next render applies the selection to the options it rendered. */
109
+ this.selectionPending = false;
108
110
  this.typeaheadBuffer = '';
109
111
  this.handleTogglePopover = (onlyClose) => {
110
112
  var _a, _b, _c, _d;
@@ -253,7 +255,20 @@ export class UdpFluentDropdown {
253
255
  componentDidLoad() {
254
256
  this.patchDropdownShadow();
255
257
  this.syncSelectionForOverlay();
256
- this.valueHandler();
258
+ this.applySelection();
259
+ }
260
+ /**
261
+ * Applies a value/options change once the render it caused has run. The
262
+ * watchers fire before that render, so a new options list's
263
+ * `<fluent-option>`s don't exist yet; syncing from the watcher (even a frame
264
+ * later) can miss them, leaving a value set before its options arrived with
265
+ * no selected option and an empty control.
266
+ */
267
+ componentDidRender() {
268
+ if (!this.selectionPending)
269
+ return;
270
+ this.selectionPending = false;
271
+ this.applySelection();
257
272
  }
258
273
  /**
259
274
  * Override fluent-dropdown's hardcoded min-width: 160px on .control (shadow DOM,
@@ -272,8 +287,11 @@ export class UdpFluentDropdown {
272
287
  `);
273
288
  shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, sheet];
274
289
  }
275
- /** Syncs fluent-dropdown selection when value or options change. */
290
+ /** Syncs fluent-dropdown selection when value or options change, after they render. */
276
291
  valueHandler() {
292
+ this.selectionPending = true;
293
+ }
294
+ applySelection() {
277
295
  if (!this.dropdownRef)
278
296
  return;
279
297
  // rAF lets the option list finish rendering before we read selected state.
@@ -405,15 +423,15 @@ export class UdpFluentDropdown {
405
423
  const overlayOptions = this.getSelectedOverlayOptions();
406
424
  const hasOverlay = overlayOptions.length > 0;
407
425
  const mappedAppearance = this.appearance === 'underline' ? 'transparent' : this.appearance;
408
- return (h(Host, { key: '58c4799acc96a25e5474da84b101979b884d88d9', class: { 'has-error': hasError } }, h("fluent-field", { key: '57fb717379eaf0e23c7e06a351638aeebe82593e', class: {
426
+ return (h(Host, { key: '4af2944eac3fbcc8a7ab5a728739db9ac5dfd6c9', class: { 'has-error': hasError } }, h("fluent-field", { key: 'a363bf200bdbb04ccb82526ce5273057cf179a39', class: {
409
427
  'no-message': !message && !this.includeErrorPadding,
410
428
  'no-label': !this.label,
411
- } }, this.label && (h("fluent-label", { key: '2eaf3e70418bf7ca6929f6b79f641e0eefe4e78e', slot: "label", disabled: this.disabled, onClick: () => this.handleTogglePopover(false), style: { paddingTop: '2px', paddingBottom: '2px' } }, this.label, this.popupHint && (h("udp-tooltip", { key: 'c1a98aa9eac686f43f837ba4770b5a35f581000e', content: this.popupHint, positioning: "above" }, h("udp-fluent-icon", { key: '647e12173d5bf6e33d32dd35a5ed80a6a01c7173', name: "info", size: "xs", class: "popup-hint-icon" }))))), h("div", { key: 'add2b58997925547e2025f1eb972dbca68e7c652', slot: "input", class: {
429
+ } }, this.label && (h("fluent-label", { key: '7eeebfc9170e03046fd797c7053a110b7eae38f5', slot: "label", disabled: this.disabled, onClick: () => this.handleTogglePopover(false), style: { paddingTop: '2px', paddingBottom: '2px' } }, this.label, this.popupHint && (h("udp-tooltip", { key: 'b60927d3204d20b8d957727baa8c93ec98c2888e', content: this.popupHint, positioning: "above" }, h("udp-fluent-icon", { key: 'fe96ed742d2bc568cfe64947a08b5c1ee383a508', name: "info", size: "xs", class: "popup-hint-icon" }))))), h("div", { key: '27b94bf86cba1b03e2cf5535bc06ba0eabf9a300', slot: "input", class: {
412
430
  'input-wrapper': true,
413
431
  'has-overlay': hasOverlay,
414
- } }, h("fluent-dropdown", { key: 'a765b55d7d33cbb274cc774dae28004644498b45', type: "dropdown", name: this.name, appearance: mappedAppearance, size: this.controlSize, required: this.required, disabled: this.disabled, placeholder: this.placeholder, multiple: this.multiple, onChange: this.handleChange, onKeyDown: this.handleKeyDown, onFocusout: () => this.inputBlur.emit(), onFocusin: () => this.inputFocus.emit(),
432
+ } }, h("fluent-dropdown", { key: 'd245ecdd3db862a6138f542394f82ce9d329e959', type: "dropdown", name: this.name, appearance: mappedAppearance, size: this.controlSize, required: this.required, disabled: this.disabled, placeholder: this.placeholder, multiple: this.multiple, onChange: this.handleChange, onKeyDown: this.handleKeyDown, onFocusout: () => this.inputBlur.emit(), onFocusin: () => this.inputFocus.emit(),
415
433
  // Suppress native invalid popup
416
- onInvalid: (e) => e.preventDefault(), ref: el => (this.dropdownRef = el) }, h("fluent-listbox", { key: '74e0c77c78d1159d2ee9101f1029bf73fce633e5' }, this.loading && (h("fluent-option", { key: 'e7bf23cfc42dbb1445252a1f0bcf0f4e4c1773b6', disabled: true, ref: (el) => el === null || el === void 0 ? void 0 : el.toggleAttribute('disabled', true) }, h("span", { key: '9f9ee2a6fc2d0758f0b6dd51ea94fd99ae54438e' }, "Loading..."), h("span", { key: '193fe93beb18232046ff809643162a818ad14830', slot: "indicator" }))), !this.loading && ((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) === 0 && (h("fluent-option", { key: '46ffff80b6f8159113777fc667e8590c9cc32cbb', disabled: true, value: "empty", ref: (el) => el === null || el === void 0 ? void 0 : el.toggleAttribute('disabled', true) }, "No options available")), !this.loading &&
434
+ onInvalid: (e) => e.preventDefault(), ref: el => (this.dropdownRef = el) }, h("fluent-listbox", { key: 'd0f8a3f1edf511c18937ab394a2a33f35995433b' }, this.loading && (h("fluent-option", { key: '4248b325952cfb566291400e99f7e8462e4db642', disabled: true, ref: (el) => el === null || el === void 0 ? void 0 : el.toggleAttribute('disabled', true) }, h("span", { key: '9a67a779d650ac68e979b19664593a43009fa82f' }, "Loading..."), h("span", { key: '32f0ae502cf34615e49152bef429be5a3c46c1b1', slot: "indicator" }))), !this.loading && ((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) === 0 && (h("fluent-option", { key: '7ba997073e25008269c37f3ceaa1053ca6e50cc5', disabled: true, value: "empty", ref: (el) => el === null || el === void 0 ? void 0 : el.toggleAttribute('disabled', true) }, "No options available")), !this.loading &&
417
435
  ((_b = this.options) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
418
436
  (() => {
419
437
  const nodes = [];
@@ -433,17 +451,17 @@ export class UdpFluentDropdown {
433
451
  nodes.push(h("fluent-option", { key: index, disabled: !!optDisabled, value: safeValue, ref: (el) => el === null || el === void 0 ? void 0 : el.toggleAttribute('disabled', !!optDisabled) }, optIcon && this.iconPosition === 'start' && (h("span", { slot: "start", class: "option-icon-slot" }, h("udp-fluent-icon", { name: optIcon, size: "sm" }))), optLabel, optIcon && this.iconPosition === 'end' && (h("span", { class: "option-icon-end", style: { pointerEvents: 'none', marginLeft: '4px' } }, h("udp-fluent-icon", { name: optIcon, size: "sm" }))), this.renderBadges(optBadges)));
434
452
  });
435
453
  return nodes;
436
- })()), h("div", { key: '82c3f8c77d0cca8490b0d095621ed87c06d213e5', slot: "indicator", class: "indicator-wrapper" }, h("udp-fluent-icon-button", { key: '15816daefec1e9a81cd1d54ba8c8d924e683a74e', class: {
454
+ })()), h("div", { key: '71aa382d0627d33ade32250abdb524f9f400d1d6', slot: "indicator", class: "indicator-wrapper" }, h("udp-fluent-icon-button", { key: 'ae08bacc142cf4309b7c1ea50a2700f9ff25dd2c', class: {
437
455
  'clear-button': true,
438
456
  'is-visible': this.showClearButton && !this.disabled && this.clearable,
439
- }, slot: "indicator", iconName: "dismiss", appearance: "transparent", size: "small", onClick: this.handleClear, onMouseDown: e => e.preventDefault(), ariaLabel: "Clear", tabIndex: -1 }), h("udp-fluent-icon", { key: 'aae7c4dd3eadcc58b9915e6b452bfacfb3a65887', name: "chevron-down", size: "sm", class: "chevron-down", onClick: (ev) => {
457
+ }, slot: "indicator", iconName: "dismiss", appearance: "transparent", size: "small", onClick: this.handleClear, onMouseDown: e => e.preventDefault(), ariaLabel: "Clear", tabIndex: -1 }), h("udp-fluent-icon", { key: 'b5a1b696d6dff58c26d6935e6ea6961752e7253e', name: "chevron-down", size: "sm", class: "chevron-down", onClick: (ev) => {
440
458
  // stopPropagation: fluent's clickHandler would re-open via its `!this.open → showPopover` branch.
441
459
  ev.stopPropagation();
442
460
  this.handleTogglePopover(false);
443
- } }))), hasOverlay && (h("div", { key: '0a98a93514c4fb5a521f51a35cd5b4c18ff9e838', class: { 'selected-overlay': true, 'multi': overlayOptions.length > 1 }, "aria-hidden": "true" }, overlayOptions.map((opt, i) => (h("span", { class: "selected-item", key: this.getOptionValue(opt) || i }, i > 0 && h("span", { class: "selected-separator" }, ", "), h("span", { class: "selected-label" }, this.resolveProp(opt, this.optionLabel, true)), this.renderBadges(this.getOptionBadges(opt)))))))), h("div", { key: '74a81db56e13dfbde829696586b6e7c33b08db29', class: {
461
+ } }))), hasOverlay && (h("div", { key: 'dd009ec183faf48af1a1a7b959b658ba02d900ca', class: { 'selected-overlay': true, 'multi': overlayOptions.length > 1 }, "aria-hidden": "true" }, overlayOptions.map((opt, i) => (h("span", { class: "selected-item", key: this.getOptionValue(opt) || i }, i > 0 && h("span", { class: "selected-separator" }, ", "), h("span", { class: "selected-label" }, this.resolveProp(opt, this.optionLabel, true)), this.renderBadges(this.getOptionBadges(opt)))))))), h("div", { key: '7e5b4f4adc04da9bdea3311032e17abe244580f7', class: {
444
462
  'message-wrapper': true,
445
463
  'includeErrorPadding': this.includeErrorPadding,
446
- }, slot: "message", onClick: () => this.handleTogglePopover(true) }, h("udp-text", { key: '3aca9404e71fa57d5c2f5d0e4b3f7b5079b198cb', variant: "caption1", class: {
464
+ }, slot: "message", onClick: () => this.handleTogglePopover(true) }, h("udp-text", { key: 'afb12736acb544f45fd2e4dd92cfd58279ce9a4f', variant: "caption1", class: {
447
465
  message: true,
448
466
  error: hasError,
449
467
  } }, message)))));
@@ -1,13 +1,19 @@
1
- import { EXTRA_FIELD_DEFAULT_PREFIX, ExtraFieldValueType, extraFieldKey, fetchExtraFieldDefinitions, fetchExtraFieldValues, } from "../../../../udp-utilities/extra-fields";
1
+ import { EXTRA_FIELD_DEFAULT_PREFIX, ExtraFieldValueType, enabledExtraFieldDefinitions, extraFieldKey, fetchExtraFieldDefinitions, fetchExtraFieldValues, } from "../../../../udp-utilities/extra-fields";
2
2
  export { EXTRA_FIELD_DEFAULT_PREFIX, ExtraFieldValueType, extraFieldKey, fetchExtraFieldDefinitions, } from '../../../../udp-utilities/extra-fields';
3
3
  /**
4
4
  * Fetches the domain's enabled definitions and builds their column defs.
5
- * `domainName` defaults to `entityName`; a failed fetch logs and yields no columns.
5
+ * `domainName` defaults to `entityName`; a failed fetch logs and yields no
6
+ * columns. Definitions the consumer already holds (`config.definitions`) are
7
+ * used as they are, so the domain is not fetched twice.
6
8
  */
7
9
  export async function loadExtraFieldColumnDefs(config, entityName) {
8
10
  var _a;
9
- const domainName = (_a = config === null || config === void 0 ? void 0 : config.domainName) !== null && _a !== void 0 ? _a : entityName;
10
- if (!config || !domainName)
11
+ if (!config)
12
+ return [];
13
+ if (config.definitions)
14
+ return buildExtraFieldColumnDefs(enabledExtraFieldDefinitions(config.definitions), config);
15
+ const domainName = (_a = config.domainName) !== null && _a !== void 0 ? _a : entityName;
16
+ if (!domainName)
11
17
  return [];
12
18
  try {
13
19
  return buildExtraFieldColumnDefs(await fetchExtraFieldDefinitions(domainName), config);
@@ -39,6 +45,11 @@ export function whenColumnsInstalled(api, expectedCount, callback) {
39
45
  };
40
46
  api.addEventListener('gridColumnsChanged', handler);
41
47
  }
48
+ /** The grid's boolean icons (`booleanChip`), keyed by the stored canonical text. */
49
+ const EXTRA_FIELD_BOOLEAN_ICONS = {
50
+ True: { iconName: 'checkMark24', color: 'success' },
51
+ False: { iconName: 'close24', color: 'error' },
52
+ };
42
53
  export function buildExtraFieldColumnDefs(definitions, config) {
43
54
  var _a;
44
55
  const prefix = (_a = config.prefix) !== null && _a !== void 0 ? _a : EXTRA_FIELD_DEFAULT_PREFIX;
@@ -68,9 +79,14 @@ export function buildExtraFieldColumnDefs(definitions, config) {
68
79
  colDef.cellDataType = 'dateString';
69
80
  break;
70
81
  case ExtraFieldValueType.Boolean:
82
+ // Values stay the stored text, which the set filter and search send
83
+ // as is; the cell shows them as the grid's boolean check / cross
84
+ // (the `booleanChip` column type), and an unset value as nothing.
71
85
  colDef.cellDataType = 'text';
72
86
  colDef.filter = 'agSetColumnFilter';
73
87
  colDef.filterParams = { values: ['True', 'False'] };
88
+ colDef.cellRenderer = 'iconRenderer';
89
+ colDef.cellRendererParams = { iconMappingConfig: EXTRA_FIELD_BOOLEAN_ICONS };
74
90
  break;
75
91
  default:
76
92
  colDef.cellDataType = 'text';
@@ -92,11 +92,18 @@ export class SearchMethodGrid {
92
92
  });
93
93
  }
94
94
  }
95
+ /**
96
+ * The base columns with the extra-field columns inserted. Extra columns join
97
+ * existing ones: while the base columns are still empty (a host still
98
+ * loading its catalog) none are shown, so they never appear on their own.
99
+ */
95
100
  mergedColumnDefs() {
96
- var _a;
97
- return this.extraFieldsReady
98
- ? insertExtraFieldColumns(this.columnDefs, this.extraFieldColumnDefs, (_a = this.extraFields) === null || _a === void 0 ? void 0 : _a.position)
99
- : [];
101
+ var _a, _b, _c;
102
+ if (!this.extraFieldsReady)
103
+ return [];
104
+ if (!((_a = this.columnDefs) === null || _a === void 0 ? void 0 : _a.length))
105
+ return (_b = this.columnDefs) !== null && _b !== void 0 ? _b : [];
106
+ return insertExtraFieldColumns(this.columnDefs, this.extraFieldColumnDefs, (_c = this.extraFields) === null || _c === void 0 ? void 0 : _c.position);
100
107
  }
101
108
  setDatasource() {
102
109
  var _a;
@@ -122,13 +129,15 @@ export class SearchMethodGrid {
122
129
  requestUrl: requestUrl,
123
130
  integrationFallbackApiMethodId: integrationFallbackApiMethodId,
124
131
  extraFields: this.extraFields ? { prefix: this.extraFields.prefix } : undefined,
125
- externalSearchObject: customSearchObject ? {
126
- filterElements: customSearchObject.filterElements,
127
- filterGroups: customSearchObject.filterGroups,
128
- logicalSearchOperator: customSearchObject.logicalSearchOperator,
129
- eagerLoad: (_a = customSearchObject.eagerLoad) !== null && _a !== void 0 ? _a : false,
130
- getAll: customSearchObject.getAll,
131
- } : undefined,
132
+ externalSearchObject: customSearchObject
133
+ ? {
134
+ filterElements: customSearchObject.filterElements,
135
+ filterGroups: customSearchObject.filterGroups,
136
+ logicalSearchOperator: customSearchObject.logicalSearchOperator,
137
+ eagerLoad: (_a = customSearchObject.eagerLoad) !== null && _a !== void 0 ? _a : false,
138
+ getAll: customSearchObject.getAll,
139
+ }
140
+ : undefined,
132
141
  });
133
142
  }
134
143
  }
@@ -147,7 +156,7 @@ export class SearchMethodGrid {
147
156
  }
148
157
  }
149
158
  render() {
150
- return (h("server-side-grid", { key: 'da7fa5951b9603432e7edc58386a71e0d265f08f', onGridReady: e => this.handleGridReady(e), dataSource: this.dataSource, gridFunctions: this.gridFunctions, columnDefs: this.mergedColumnDefs(), gridOptions: this.gridOptions, gridHeaderConfig: this.gridHeaderConfig, gridId: this.gridId, entityName: this.entityName, gridHeight: this.gridHeight, gridApiCallback: this.gridApiCallback }));
159
+ return (h("server-side-grid", { key: '7ebf7ba23217830a5e42766c94481fa2a9645cae', onGridReady: e => this.handleGridReady(e), dataSource: this.dataSource, gridFunctions: this.gridFunctions, columnDefs: this.mergedColumnDefs(), gridOptions: this.gridOptions, gridHeaderConfig: this.gridHeaderConfig, gridId: this.gridId, entityName: this.entityName, gridHeight: this.gridHeight, gridApiCallback: this.gridApiCallback }));
151
160
  }
152
161
  static get is() { return "search-method-grid"; }
153
162
  static get properties() {
@@ -11,6 +11,7 @@ export { isCatalogModelObject, buildCatalogTree, buildIndices, findNodeByPath }
11
11
  export * from './udp-utilities/lookup/lookup';
12
12
  export * from './udp-utilities/lookup/lookupUtils';
13
13
  export * from './udp-utilities/tags/tag';
14
+ export * from './udp-utilities/extra-fields';
14
15
  export * from './udp-utilities/api-config';
15
16
  export * from './udp-utilities/api-method-instance';
16
17
  export { createAzureMapsProviders } from './udp-utilities/location/createAzureMapsProviders';