udp-stencil-component-library 26.3.0-beta.21 → 26.3.0-beta.23

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 (26) hide show
  1. package/dist/cjs/ag-grid-base_63.cjs.entry.js +145 -3
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/stencil-library.cjs.js +1 -1
  4. package/dist/cjs/udp-fluent-number-input.cjs.entry.js +81 -34
  5. package/dist/collection/components/fluent-ui/number-input/udp-fluent-number-input.js +86 -75
  6. package/dist/collection/components/grid/new-grid/ag-grid-base.js +11 -3
  7. package/dist/collection/components/grid/new-grid/grid-header.js +5 -0
  8. package/dist/collection/components/grid/new-grid/gridFunctionRegistry.js +2 -0
  9. package/dist/collection/components/grid/new-grid/gridFunctions/agGridExcelExport.js +15 -0
  10. package/dist/collection/components/grid/new-grid/helperFunctions/udpColumnExcelStyles.js +112 -0
  11. package/dist/components/ag-grid-base2.js +1 -1
  12. package/dist/components/grid-header2.js +1 -1
  13. package/dist/components/udp-fluent-number-input.js +1 -1
  14. package/dist/docs.json +4 -50
  15. package/dist/esm/ag-grid-base_63.entry.js +145 -3
  16. package/dist/esm/loader.js +1 -1
  17. package/dist/esm/stencil-library.js +1 -1
  18. package/dist/esm/udp-fluent-number-input.entry.js +81 -34
  19. package/dist/stencil-library/ag-grid-base_63.entry.js +1 -1
  20. package/dist/stencil-library/stencil-library.esm.js +1 -1
  21. package/dist/stencil-library/udp-fluent-number-input.entry.js +1 -1
  22. package/dist/types/components/fluent-ui/number-input/udp-fluent-number-input.d.ts +7 -10
  23. package/dist/types/components/grid/new-grid/gridFunctions/agGridExcelExport.d.ts +9 -0
  24. package/dist/types/components/grid/new-grid/helperFunctions/udpColumnExcelStyles.d.ts +12 -0
  25. package/dist/types/components.d.ts +12 -24
  26. package/package.json +1 -1
@@ -226,6 +226,22 @@ class AgGridExport {
226
226
  }
227
227
  }
228
228
 
229
+ class AgGridExcelExport {
230
+ constructor(fileName = 'export.xlsx') {
231
+ this.fileName = fileName;
232
+ }
233
+ init(gridApi) {
234
+ this.gridApi = gridApi;
235
+ }
236
+ onAction(name) {
237
+ if (name === 'agGridExcelExport') {
238
+ // The udp-col-* preset styling is applied via `excelStyles` in
239
+ // ag-grid-base (excelStyles is an @initial option, set at grid creation).
240
+ this.gridApi.exportDataAsExcel({ fileName: this.fileName });
241
+ }
242
+ }
243
+ }
244
+
229
245
  function getUserId() {
230
246
  return sessionStorage.getItem('user-id');
231
247
  }
@@ -1380,6 +1396,7 @@ class AgGridExpandCollapseAll {
1380
1396
 
1381
1397
  const gridFunctionRegistry = {
1382
1398
  agGridExport: AgGridExport,
1399
+ agGridExcelExport: AgGridExcelExport,
1383
1400
  openSavedViews: SavedViews,
1384
1401
  agGridSizeColumnsToFit: AgGridSizeColumnsToFit,
1385
1402
  agGridAutoSizeColumns: AgGridAutoSizeColumns,
@@ -1551,6 +1568,119 @@ const dateTimeValueFormatter = params => {
1551
1568
  return `${dateObject.getFullYear()}-${String(dateObject.getMonth() + 1).padStart(2, '0')}-${String(dateObject.getDate()).padStart(2, '0')} ${String(dateObject.getHours()).padStart(2, '0')}:${String(dateObject.getMinutes()).padStart(2, '0')}`;
1552
1569
  };
1553
1570
 
1571
+ // UDP column style presets (see ag-grid-base.css). Each maps to a cell class
1572
+ // `udp-col-<name>` and a header class `udp-col-<name>-header`.
1573
+ const UDP_COL_PRESETS = [
1574
+ 'brand',
1575
+ 'danger',
1576
+ 'important',
1577
+ 'informative',
1578
+ 'severe',
1579
+ 'subtle',
1580
+ 'success',
1581
+ 'warning',
1582
+ ];
1583
+ let probeCtx;
1584
+ function getProbeCtx() {
1585
+ var _a;
1586
+ if (probeCtx !== undefined)
1587
+ return probeCtx;
1588
+ const canvas = document.createElement('canvas');
1589
+ canvas.width = 1;
1590
+ canvas.height = 1;
1591
+ probeCtx = (_a = canvas.getContext('2d', { willReadFrequently: true })) !== null && _a !== void 0 ? _a : null;
1592
+ return probeCtx;
1593
+ }
1594
+ /** Paint `cssColor` over an opaque background and read the resulting RGB pixel. */
1595
+ function paintOver(ctx, cssColor, bg) {
1596
+ ctx.clearRect(0, 0, 1, 1);
1597
+ ctx.fillStyle = `rgb(${bg[0]}, ${bg[1]}, ${bg[2]})`;
1598
+ ctx.fillRect(0, 0, 1, 1);
1599
+ // If the browser can't parse cssColor, fillStyle keeps the bg we just set, so
1600
+ // the color resolves to the background (treated as "no tint" below).
1601
+ ctx.fillStyle = cssColor;
1602
+ ctx.fillRect(0, 0, 1, 1);
1603
+ const [r, g, b] = ctx.getImageData(0, 0, 1, 1).data;
1604
+ return [r, g, b];
1605
+ }
1606
+ /**
1607
+ * Resolve any computed CSS color to an opaque `#RRGGBB`, flattened over white
1608
+ * (the Excel sheet background). Uses a canvas so it handles every serialization
1609
+ * `getComputedStyle` can return — `rgb()/rgba()`, `color(srgb …)`, `color-mix`,
1610
+ * named colors. Returns null when the color is fully transparent (no tint to
1611
+ * export) or the canvas is unavailable.
1612
+ */
1613
+ function resolveColor(cssColor) {
1614
+ if (!cssColor)
1615
+ return null;
1616
+ const ctx = getProbeCtx();
1617
+ if (!ctx)
1618
+ return null;
1619
+ const overWhite = paintOver(ctx, cssColor, [255, 255, 255]);
1620
+ const overBlack = paintOver(ctx, cssColor, [0, 0, 0]);
1621
+ // Fully transparent ⇒ matches whatever it's painted over ⇒ nothing to export.
1622
+ if (overWhite[0] === 255 && overWhite[1] === 255 && overWhite[2] === 255 &&
1623
+ overBlack[0] === 0 && overBlack[1] === 0 && overBlack[2] === 0) {
1624
+ return null;
1625
+ }
1626
+ const hex = (n) => Math.max(0, Math.min(255, n)).toString(16).padStart(2, '0');
1627
+ return `#${hex(overWhite[0])}${hex(overWhite[1])}${hex(overWhite[2])}`.toUpperCase();
1628
+ }
1629
+ /**
1630
+ * Excel never sees the grid's CSS, so the udp-col-* column tints don't carry over
1631
+ * to a `.xlsx` by default. This resolves each preset to its *live themed* color
1632
+ * (honoring the active theme and any `color-mix`) and returns matching ExcelStyle
1633
+ * entries keyed by the same class name, so cellClass / headerClass tints export.
1634
+ *
1635
+ * Must run after the grid's stylesheet is in the DOM (ag-grid-base.css is global
1636
+ * since the component is `shadow: false`). Resolved at grid creation because
1637
+ * `excelStyles` is an `@initial` grid option and cannot be updated at runtime.
1638
+ */
1639
+ function buildUdpPresetExcelStyles() {
1640
+ if (typeof document === 'undefined' || typeof getComputedStyle === 'undefined') {
1641
+ return [];
1642
+ }
1643
+ // Offscreen probes resolving the same global rules AG Grid's real cells/headers
1644
+ // do. Header text color lives on a nested `.ag-header-cell-text`.
1645
+ const host = document.createElement('div');
1646
+ host.setAttribute('aria-hidden', 'true');
1647
+ host.style.cssText = 'position:fixed;left:-9999px;top:0;visibility:hidden;pointer-events:none;';
1648
+ const cell = document.createElement('div');
1649
+ const headerCell = document.createElement('div');
1650
+ const headerText = document.createElement('span');
1651
+ headerText.className = 'ag-header-cell-text';
1652
+ headerCell.appendChild(headerText);
1653
+ host.appendChild(cell);
1654
+ host.appendChild(headerCell);
1655
+ document.body.appendChild(host);
1656
+ const styles = [];
1657
+ try {
1658
+ for (const name of UDP_COL_PRESETS) {
1659
+ cell.className = `ag-cell udp-col-${name}`;
1660
+ const cellStyle = getComputedStyle(cell);
1661
+ const cellBg = resolveColor(cellStyle.backgroundColor);
1662
+ if (cellBg) {
1663
+ const cellFg = resolveColor(cellStyle.color);
1664
+ styles.push(Object.assign({ id: `udp-col-${name}`, interior: { color: cellBg, pattern: 'Solid' } }, (cellFg ? { font: { color: cellFg } } : {})));
1665
+ }
1666
+ headerCell.className = `ag-header-cell udp-col-${name}-header`;
1667
+ const headerBg = resolveColor(getComputedStyle(headerCell).backgroundColor);
1668
+ if (headerBg) {
1669
+ const headerFg = resolveColor(getComputedStyle(headerText).color);
1670
+ styles.push({
1671
+ id: `udp-col-${name}-header`,
1672
+ interior: { color: headerBg, pattern: 'Solid' },
1673
+ font: Object.assign({ bold: true }, (headerFg ? { color: headerFg } : {})),
1674
+ });
1675
+ }
1676
+ }
1677
+ }
1678
+ finally {
1679
+ host.remove();
1680
+ }
1681
+ return styles;
1682
+ }
1683
+
1554
1684
  const agGridBaseCss = () => `.variant-dark{--udp-grid-column-header-bg:#F8F9FA;--udp-grid-column-header-bg-hover:#dce6f2;--udp-grid-column-header-text:var(--primary-color-dark)}.variant-light{--udp-grid-column-header-bg:#f2f4f5;--udp-grid-column-header-bg-hover:#eef3f9;--udp-grid-column-header-text:var(--primary-color-dark)}::view-transition-group(*){animation-duration:0.2s}.grid-wrapper{display:flex;flex-direction:column;height:100%}#myNewGrid{flex:1}.ag-cell.udp-col-brand{background-color:var(--colorBrandBackground2) !important;color:var(--colorBrandForeground2)}.ag-header-cell.udp-col-brand-header{background-color:var(--colorBrandBackground2) !important}.ag-header-cell.udp-col-brand-header .ag-header-cell-text{color:var(--colorBrandForeground2)}.ag-cell.udp-col-danger{background-color:var(--colorPaletteRedBackground1) !important;color:var(--colorPaletteRedForeground1)}.ag-header-cell.udp-col-danger-header{background-color:var(--colorPaletteRedBackground1) !important}.ag-header-cell.udp-col-danger-header .ag-header-cell-text{color:var(--colorPaletteRedForeground1)}.ag-cell.udp-col-important{background-color:color-mix(in srgb, var(--colorNeutralForeground1) 20%, transparent) !important;color:var(--colorNeutralForeground1)}.ag-header-cell.udp-col-important-header{background-color:color-mix(in srgb, var(--colorNeutralForeground1) 20%, transparent) !important}.ag-header-cell.udp-col-important-header .ag-header-cell-text{color:var(--colorNeutralForeground1)}.ag-cell.udp-col-informative{background-color:color-mix(in srgb, var(--colorPaletteBlueBackground2) 20%, transparent) !important;color:color-mix(in srgb, var(--colorPaletteBlueForeground2) 85%, transparent)}.ag-header-cell.udp-col-informative-header{background-color:color-mix(in srgb, var(--colorPaletteBlueBackground2) 20%, transparent) !important}.ag-header-cell.udp-col-informative-header .ag-header-cell-text{color:color-mix(in srgb, var(--colorPaletteBlueForeground2) 85%, transparent)}.ag-cell.udp-col-severe{background-color:var(--colorPaletteDarkOrangeBackground1) !important;color:var(--colorPaletteDarkOrangeForeground1)}.ag-header-cell.udp-col-severe-header{background-color:var(--colorPaletteDarkOrangeBackground1) !important}.ag-header-cell.udp-col-severe-header .ag-header-cell-text{color:var(--colorPaletteDarkOrangeForeground1)}.ag-cell.udp-col-subtle{background-color:var(--colorNeutralBackground1) !important;color:var(--colorNeutralForeground3)}.ag-header-cell.udp-col-subtle-header{background-color:var(--colorNeutralBackground1) !important}.ag-header-cell.udp-col-subtle-header .ag-header-cell-text{color:var(--colorNeutralForeground3)}.ag-cell.udp-col-success{background-color:var(--colorPaletteGreenBackground1) !important;color:var(--colorPaletteGreenForeground1)}.ag-header-cell.udp-col-success-header{background-color:var(--colorPaletteGreenBackground1) !important}.ag-header-cell.udp-col-success-header .ag-header-cell-text{color:var(--colorPaletteGreenForeground1)}.ag-cell.udp-col-warning{background-color:var(--colorPaletteYellowBackground1) !important;color:var(--colorPaletteYellowForeground2)}.ag-header-cell.udp-col-warning-header{background-color:var(--colorPaletteYellowBackground1) !important}.ag-header-cell.udp-col-warning-header .ag-header-cell-text{color:var(--colorPaletteYellowForeground2)}`;
1555
1685
 
1556
1686
  const AgGridBase = class {
@@ -1670,7 +1800,7 @@ const AgGridBase = class {
1670
1800
  agGridEnterpriseV33.LicenseManager.setLicenseKey('Using_this_{AG_Grid}_Enterprise_key_{AG-080613}_in_excess_of_the_licence_granted_is_not_permitted___Please_report_misuse_to_legal@ag-grid.com___For_help_with_changing_this_key_please_contact_info@ag-grid.com___{Univerus_Software_Inc}_is_granted_a_{Single_Application}_Developer_License_for_the_application_{MAIS_eRec}_only_for_{1}_Front-End_JavaScript_developer___All_Front-End_JavaScript_developers_working_on_{MAIS_eRec}_need_to_be_licensed___{MAIS_eRec}_has_not_been_granted_a_Deployment_License_Add-on___This_key_works_with_{AG_Grid}_Enterprise_versions_released_before_{28_June_2026}____[v3]_[01]_MTc4MjYwMTIwMDAwMA==5c7d1487ecb13b28e75415d34b7cf694');
1671
1801
  }
1672
1802
  componentDidLoad() {
1673
- var _a, _b, _c, _d;
1803
+ var _a, _b, _c, _d, _e, _f;
1674
1804
  const gridOptions = Object.assign(Object.assign({ tooltipShowMode: 'whenTruncated', tooltipShowDelay: 500 }, this.gridOptions), { columnTypes: {
1675
1805
  booleanChip: {
1676
1806
  cellRenderer: 'iconRenderer',
@@ -1692,7 +1822,14 @@ const AgGridBase = class {
1692
1822
  extendsDataType: 'boolean',
1693
1823
  columnTypes: 'booleanChip',
1694
1824
  },
1695
- }, gridId: this.gridId, onGridReady: e => void this.onGridReady(e), theme: getAgGridTheme(), components: Object.assign({ actionsRenderer: statusRenderer.ActionsRenderer, avatarRenderer: AvatarRenderer, iconRenderer: statusRenderer.IconRenderer, imageRenderer: ImageRenderer, linkRenderer: LinkRenderer, statusRenderer: statusRenderer.StatusRenderer, subtitleRenderer: AgGridSubtitleCellRenderer }, (_a = this.gridOptions) === null || _a === void 0 ? void 0 : _a.components), domLayout: 'normal', defaultColDef: Object.assign(Object.assign({ cellDataType: false, sortable: true, filter: true, flex: 1, minWidth: 150, suppressHeaderMenuButton: true }, (_b = this.gridOptions) === null || _b === void 0 ? void 0 : _b.defaultColDef), { filterParams: Object.assign({ buttons: ['reset', 'apply'], closeOnApply: true, maxNumConditions: 10 }, (_d = (_c = this.gridOptions) === null || _c === void 0 ? void 0 : _c.defaultColDef) === null || _d === void 0 ? void 0 : _d.filterParams) }) });
1825
+ }, gridId: this.gridId, onGridReady: e => void this.onGridReady(e), theme: getAgGridTheme(),
1826
+ // Carry the udp-col-* column tints into Excel exports. excelStyles is an
1827
+ // @initial option (cannot be set at runtime), so it's resolved here at grid
1828
+ // creation. Consumer-provided excelStyles win over the generated presets.
1829
+ excelStyles: [
1830
+ ...buildUdpPresetExcelStyles().filter(preset => { var _a, _b; return !((_b = (_a = this.gridOptions) === null || _a === void 0 ? void 0 : _a.excelStyles) !== null && _b !== void 0 ? _b : []).some(s => s.id === preset.id); }),
1831
+ ...((_b = (_a = this.gridOptions) === null || _a === void 0 ? void 0 : _a.excelStyles) !== null && _b !== void 0 ? _b : []),
1832
+ ], components: Object.assign({ actionsRenderer: statusRenderer.ActionsRenderer, avatarRenderer: AvatarRenderer, iconRenderer: statusRenderer.IconRenderer, imageRenderer: ImageRenderer, linkRenderer: LinkRenderer, statusRenderer: statusRenderer.StatusRenderer, subtitleRenderer: AgGridSubtitleCellRenderer }, (_c = this.gridOptions) === null || _c === void 0 ? void 0 : _c.components), domLayout: 'normal', defaultColDef: Object.assign(Object.assign({ cellDataType: false, sortable: true, filter: true, flex: 1, minWidth: 150, suppressHeaderMenuButton: true }, (_d = this.gridOptions) === null || _d === void 0 ? void 0 : _d.defaultColDef), { filterParams: Object.assign({ buttons: ['reset', 'apply'], closeOnApply: true, maxNumConditions: 10 }, (_f = (_e = this.gridOptions) === null || _e === void 0 ? void 0 : _e.defaultColDef) === null || _f === void 0 ? void 0 : _f.filterParams) }) });
1696
1833
  agGridEnterpriseV33.createGrid(this.gridEl, gridOptions);
1697
1834
  window.addEventListener('theme-changed', this.themeChangedHandler);
1698
1835
  if (this.gridHeight) {
@@ -1743,7 +1880,7 @@ const AgGridBase = class {
1743
1880
  this.updateGridContextValues();
1744
1881
  }
1745
1882
  render() {
1746
- return (index.h("div", { key: '104459ae3bbc35124905c375284deea7fd4a18e2', ref: el => (this.gridContainerEl = el) }, index.h("ghost-render", { key: '9246393a0abf0f32551fc7783747328dbba99ec7' }, index.h("div", { key: 'b8e6d1fdb1ff7884e6723a0ff9421bd12ad63740' }, index.h("udp-dialog", { key: '4e2de434c26d11fa47104e6c8f06d76d3e617500' }), index.h("udp-list-item", { key: 'c46d7dec91a2bae694631f095c9904f85d607ba6' }), index.h("hint-panel", { key: '4177e50ac5fedda3f15de57153de46201f104454' }), index.h("udp-side-sheet", { key: '2e8914c6d8ea1bb83e48cce4489fd2d636884498' }), index.h("udp-fluent-dialog", { key: '482719dc0f89bdbe4749d28aa1d2509343de1ca7' }), index.h("udp-fluent-text", { key: '03a30ea4a724b2d003befd88f4fa8eba27685411' }), index.h("udp-fluent-text-input", { key: 'a6e25454b5bd17db8ed441363c81b66902987323' }), index.h("udp-fluent-switch", { key: 'b547bd01dda86ba3b1c94a5973de9b562cf7cb59' }), index.h("udp-fluent-button", { key: '9d5b809d46caaedf783b42598adb23f2d181a8b8' }), index.h("udp-text", { key: 'f4ce740ea9998d756f4e9518a1c304dd5e4208a3' }), index.h("udp-search-input", { key: '8192e2ac08b3ee6052578677c3361e9dc7648ec5' }), index.h("udp-fluent-avatar", { key: '8e7f9bb0c6e9dee5d50b5740a9599a7a1271f677' }), index.h("udp-fluent-icon-button", { key: '059f897ae01e52266e938f77c70dd848efd12f43' }), index.h("udp-fluent-icon", { key: '33b02e8a98bb6fee997ac180942dbb2545ea2c21' }), index.h("udp-fluent-badge", { key: '5b0ca3ac9944d662c9593602fe8adfd13da4a2b8' }))), index.h("grid-header", { key: '5a1a52b5e07dd84dbc5f7b0c8d6ac3cca3faa2d9', headerConfig: this.headerConfig, gridFunctions: this.gridFunctions, gridFunctionInstances: this.gridFunctionInstances, refreshKey: this.refreshKey, onHeaderAction: this.onHeaderAction }), index.h("div", { key: 'ea69fb43b9a875f35ef7851662af90474321ef81', ref: el => (this.gridEl = el) })));
1883
+ return (index.h("div", { key: 'd390a4e4472211df84c8431dce95448861bd7cf8', ref: el => (this.gridContainerEl = el) }, index.h("ghost-render", { key: '6598aa469fbd486c45a1251185e46e163254ca74' }, index.h("div", { key: '8b4a74033bcbfee121ab2108a4312b8a0feb651b' }, index.h("udp-dialog", { key: '8bace417eb116aff9cbae2e76d340ea478c02eb0' }), index.h("udp-list-item", { key: '02fa2c8ab83e5a9296178366517d8cfb28779745' }), index.h("hint-panel", { key: '6e29b193c52c292e2d6dac6b4e64025e027148bf' }), index.h("udp-side-sheet", { key: 'daa39be7c760daa21244b6d7ad57217503ca9ec2' }), index.h("udp-fluent-dialog", { key: '9a703f20309d94629f3bd0dfcada241a826fea82' }), index.h("udp-fluent-text", { key: '7ae20805172f8bc59bd7d3427421144eb13f6ded' }), index.h("udp-fluent-text-input", { key: '77a58d878d712e247cc7f1e835def85df325dd70' }), index.h("udp-fluent-switch", { key: '47b13c7be1563969da9cad7850b6a9bc5b7c4a45' }), index.h("udp-fluent-button", { key: '3f8b1d78694b7bee699f0800c1d31a61d78ebf97' }), index.h("udp-text", { key: 'eaab0e6b5949f42619cc171fdc7c5cb32abcb1d9' }), index.h("udp-search-input", { key: 'a44cb53fca08b1c9e829789501efb339a501d8f5' }), index.h("udp-fluent-avatar", { key: '6ba0c2bd921f244c6f9c70566714fd2cbe0c2e80' }), index.h("udp-fluent-icon-button", { key: '67aea24100272ef7ba9936afcdbd1cde8db5647e' }), index.h("udp-fluent-icon", { key: '665398531aaa7c8acc52ec16cbb736fb92c4fe22' }), index.h("udp-fluent-badge", { key: '3a08b41829ad68400d93da40c45c506a06e6099b' }))), index.h("grid-header", { key: '795ec194aecacf9d43fb731b7a1390b6faab1965', headerConfig: this.headerConfig, gridFunctions: this.gridFunctions, gridFunctionInstances: this.gridFunctionInstances, refreshKey: this.refreshKey, onHeaderAction: this.onHeaderAction }), index.h("div", { key: 'fdce74fba0821732e808b266f1a2ecb694254490', ref: el => (this.gridEl = el) })));
1747
1884
  }
1748
1885
  static get watchers() { return {
1749
1886
  "gridFunctions": [{
@@ -1996,6 +2133,11 @@ const GridHeader = class {
1996
2133
  startIconName: 'export',
1997
2134
  onClick: () => this.action('agGridExport'),
1998
2135
  },
2136
+ enabledFunctionNames.has('agGridExcelExport') && {
2137
+ text: 'Export to Excel',
2138
+ startIconName: 'table',
2139
+ onClick: () => this.action('agGridExcelExport'),
2140
+ },
1999
2141
  ].filter(Boolean);
2000
2142
  const hasUdpExport = enabledFunctionNames.has('udpExport');
2001
2143
  const hasExpandCollapse = enabledFunctionNames.has('agGridExpandCollapseAll');