@genesislcap/grid-pro 15.17.1 → 15.18.0-FUI-2601.4

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 (64) hide show
  1. package/dist/custom-elements.json +5163 -3233
  2. package/dist/dts/columns-tool-panel/columns-tool-panel-ag-drag.d.ts +12 -0
  3. package/dist/dts/columns-tool-panel/columns-tool-panel-ag-drag.d.ts.map +1 -0
  4. package/dist/dts/columns-tool-panel/columns-tool-panel.d.ts +150 -0
  5. package/dist/dts/columns-tool-panel/columns-tool-panel.d.ts.map +1 -0
  6. package/dist/dts/columns-tool-panel/columns-tool-panel.styles.d.ts +9 -0
  7. package/dist/dts/columns-tool-panel/columns-tool-panel.styles.d.ts.map +1 -0
  8. package/dist/dts/columns-tool-panel/columns-tool-panel.template.d.ts +12 -0
  9. package/dist/dts/columns-tool-panel/columns-tool-panel.template.d.ts.map +1 -0
  10. package/dist/dts/columns-tool-panel/columns-tool-panel.utils.d.ts +48 -0
  11. package/dist/dts/columns-tool-panel/columns-tool-panel.utils.d.ts.map +1 -0
  12. package/dist/dts/columns-tool-panel/grid-pro-column-drag-bridge.d.ts +39 -0
  13. package/dist/dts/columns-tool-panel/grid-pro-column-drag-bridge.d.ts.map +1 -0
  14. package/dist/dts/columns-tool-panel/index.d.ts +5 -0
  15. package/dist/dts/columns-tool-panel/index.d.ts.map +1 -0
  16. package/dist/dts/grid-pro-beta.d.ts +27 -3
  17. package/dist/dts/grid-pro-beta.d.ts.map +1 -1
  18. package/dist/dts/grid-pro.d.ts.map +1 -1
  19. package/dist/dts/grid-pro.styles.d.ts.map +1 -1
  20. package/dist/dts/grid-pro.template.d.ts.map +1 -1
  21. package/dist/dts/grid-pro.types.d.ts +10 -0
  22. package/dist/dts/grid-pro.types.d.ts.map +1 -1
  23. package/dist/dts/index.d.ts +2 -0
  24. package/dist/dts/index.d.ts.map +1 -1
  25. package/dist/dts/react.d.ts +20 -0
  26. package/dist/dts/row-alert/row-alert.d.ts +2 -0
  27. package/dist/dts/row-alert/row-alert.d.ts.map +1 -1
  28. package/dist/dts/side-bar/index.d.ts +6 -0
  29. package/dist/dts/side-bar/index.d.ts.map +1 -0
  30. package/dist/dts/side-bar/side-bar.d.ts +418 -0
  31. package/dist/dts/side-bar/side-bar.d.ts.map +1 -0
  32. package/dist/dts/side-bar/side-bar.styles.d.ts +19 -0
  33. package/dist/dts/side-bar/side-bar.styles.d.ts.map +1 -0
  34. package/dist/dts/side-bar/side-bar.template.d.ts +11 -0
  35. package/dist/dts/side-bar/side-bar.template.d.ts.map +1 -0
  36. package/dist/dts/side-bar/side-bar.tools.d.ts +19 -0
  37. package/dist/dts/side-bar/side-bar.tools.d.ts.map +1 -0
  38. package/dist/dts/side-bar/side-bar.types.d.ts +86 -0
  39. package/dist/dts/side-bar/side-bar.types.d.ts.map +1 -0
  40. package/dist/esm/columns-tool-panel/columns-tool-panel-ag-drag.js +50 -0
  41. package/dist/esm/columns-tool-panel/columns-tool-panel.js +500 -0
  42. package/dist/esm/columns-tool-panel/columns-tool-panel.styles.js +180 -0
  43. package/dist/esm/columns-tool-panel/columns-tool-panel.template.js +70 -0
  44. package/dist/esm/columns-tool-panel/columns-tool-panel.utils.js +185 -0
  45. package/dist/esm/columns-tool-panel/grid-pro-column-drag-bridge.js +57 -0
  46. package/dist/esm/columns-tool-panel/index.js +4 -0
  47. package/dist/esm/grid-pro-beta.js +95 -3
  48. package/dist/esm/grid-pro.js +2 -2
  49. package/dist/esm/grid-pro.styles.js +4 -0
  50. package/dist/esm/grid-pro.template.js +13 -1
  51. package/dist/esm/grid-pro.types.js +11 -0
  52. package/dist/esm/index.js +2 -0
  53. package/dist/esm/row-alert/row-alert.js +4 -0
  54. package/dist/esm/side-bar/index.js +5 -0
  55. package/dist/esm/side-bar/side-bar.js +204 -0
  56. package/dist/esm/side-bar/side-bar.styles.js +155 -0
  57. package/dist/esm/side-bar/side-bar.template.js +53 -0
  58. package/dist/esm/side-bar/side-bar.tools.js +26 -0
  59. package/dist/esm/side-bar/side-bar.types.js +45 -0
  60. package/dist/grid-pro.api.json +11006 -7961
  61. package/dist/grid-pro.d.ts +986 -150
  62. package/dist/react.cjs +14 -0
  63. package/dist/react.mjs +12 -0
  64. package/package.json +14 -14
@@ -0,0 +1,204 @@
1
+ import { __decorate } from "tslib";
2
+ import { insertDocumentCSSRule, LifecycleMixin } from '@genesislcap/foundation-utils';
3
+ import { attr, customElement, observable } from '@microsoft/fast-element';
4
+ import { FoundationElement } from '@microsoft/fast-foundation';
5
+ import { agGridAlpineFontFace } from '../external/fonts';
6
+ import { agThemeFontsId } from '../grid-pro.types';
7
+ import { gridProSideBarChromeStyles } from './side-bar.styles';
8
+ import { getGridProSideBarTemplate } from './side-bar.template';
9
+ import { GridProSideBarTool, initLocalSideBarPanel, } from './side-bar.types';
10
+ /**
11
+ * The Grid Pro Side Bar element.
12
+ * @remarks No shadow root — chrome stays in Grid Pro's tree so host CSS still applies.
13
+ * @public
14
+ * @remarks
15
+ * HTML Element: \<grid-pro-side-bar\>
16
+ */
17
+ let GridProSideBar = class GridProSideBar extends LifecycleMixin(FoundationElement) {
18
+ constructor() {
19
+ super(...arguments);
20
+ this.prefix = 'foundation';
21
+ this.tools = [];
22
+ this.open = false;
23
+ this.activeTool = GridProSideBarTool.columns;
24
+ this.mountedPanels = new Map();
25
+ }
26
+ prefixChanged() {
27
+ if (this.$fastController) {
28
+ this.$fastController.template = getGridProSideBarTemplate(this.prefix || 'foundation');
29
+ }
30
+ }
31
+ toolsChanged() {
32
+ var _a, _b;
33
+ this.syncSideBarVisibility();
34
+ if (!((_a = this.tools) === null || _a === void 0 ? void 0 : _a.length)) {
35
+ this.open = false;
36
+ this.closeAgToolPanel();
37
+ (_b = this.panelHost) === null || _b === void 0 ? void 0 : _b.replaceChildren();
38
+ return;
39
+ }
40
+ if (!this.tools.some((t) => t.id === this.activeTool)) {
41
+ this.activeTool = this.tools[0].id;
42
+ }
43
+ this.mountActiveTool();
44
+ }
45
+ gridApiChanged() {
46
+ this.mountActiveTool();
47
+ }
48
+ columnDragBridgeChanged() {
49
+ this.refreshMountedLocalPanels();
50
+ }
51
+ panelHostChanged() {
52
+ this.mountActiveTool();
53
+ }
54
+ getToolPanelParams(def) {
55
+ var _a, _b;
56
+ return Object.assign(Object.assign({ api: this.gridApi, context: (_b = (_a = this.gridApi) === null || _a === void 0 ? void 0 : _a.getGridOption) === null || _b === void 0 ? void 0 : _b.call(_a, 'context') }, def.toolPanelParams), { columnDragBridge: this.columnDragBridge });
57
+ }
58
+ refreshMountedLocalPanels() {
59
+ var _a, _b, _c;
60
+ if (!this.gridApi) {
61
+ return;
62
+ }
63
+ for (const [defId, mounted] of this.mountedPanels) {
64
+ const def = (_a = this.tools) === null || _a === void 0 ? void 0 : _a.find((t) => t.id === defId);
65
+ if (def === null || def === void 0 ? void 0 : def.createPanel) {
66
+ (_c = (_b = mounted.panel).refresh) === null || _c === void 0 ? void 0 : _c.call(_b, this.getToolPanelParams(def));
67
+ }
68
+ }
69
+ }
70
+ connectedCallback() {
71
+ super.connectedCallback();
72
+ this.syncSideBarVisibility();
73
+ insertDocumentCSSRule(agGridAlpineFontFace, agThemeFontsId('alpine'));
74
+ }
75
+ disconnectedCallback() {
76
+ this.destroyTools();
77
+ super.disconnectedCallback();
78
+ }
79
+ /**
80
+ * Selects a tool. Clicking the active open tool collapses the panel.
81
+ * @public
82
+ */
83
+ selectTool(tool) {
84
+ var _a;
85
+ if (!((_a = this.tools) === null || _a === void 0 ? void 0 : _a.some((t) => t.id === tool))) {
86
+ return;
87
+ }
88
+ if (this.activeTool === tool && this.open) {
89
+ this.open = false;
90
+ this.closeAgToolPanel();
91
+ return;
92
+ }
93
+ this.activeTool = tool;
94
+ this.open = true;
95
+ this.mountActiveTool();
96
+ }
97
+ /**
98
+ * @internal
99
+ */
100
+ handleToolClick(id) {
101
+ this.selectTool(id);
102
+ }
103
+ /**
104
+ * @public
105
+ */
106
+ mountActiveTool() {
107
+ var _a, _b, _c;
108
+ if (!this.gridApi || !this.panelHost) {
109
+ return;
110
+ }
111
+ if (!this.open) {
112
+ this.closeAgToolPanel();
113
+ return;
114
+ }
115
+ const def = (_a = this.tools) === null || _a === void 0 ? void 0 : _a.find((t) => t.id === this.activeTool);
116
+ if (!def) {
117
+ this.panelHost.replaceChildren();
118
+ return;
119
+ }
120
+ if (def.createPanel) {
121
+ this.closeAgToolPanel();
122
+ let mounted = this.mountedPanels.get(def.id);
123
+ if (!mounted) {
124
+ const panel = initLocalSideBarPanel(def.createPanel(), this.getToolPanelParams(def));
125
+ mounted = { defId: def.id, panel };
126
+ this.mountedPanels.set(def.id, mounted);
127
+ }
128
+ const gui = mounted.panel.getGui();
129
+ if (gui instanceof HTMLElement &&
130
+ gui.tagName.toLowerCase() === 'grid-pro-columns-tool-panel') {
131
+ gui.setAttribute('prefix', this.prefix || 'foundation');
132
+ }
133
+ this.panelHost.replaceChildren(gui);
134
+ (_c = (_b = mounted.panel).refresh) === null || _c === void 0 ? void 0 : _c.call(_b, this.getToolPanelParams(def));
135
+ return;
136
+ }
137
+ if (def.toolPanel != null) {
138
+ this.panelHost.replaceChildren();
139
+ if (typeof this.gridApi.openToolPanel === 'function') {
140
+ this.gridApi.openToolPanel(def.id, this.panelHost);
141
+ }
142
+ return;
143
+ }
144
+ this.panelHost.replaceChildren();
145
+ }
146
+ /**
147
+ * @public
148
+ */
149
+ destroyTools() {
150
+ var _a, _b, _c, _d;
151
+ this.closeAgToolPanel();
152
+ for (const mounted of this.mountedPanels.values()) {
153
+ (_a = mounted.destroy) === null || _a === void 0 ? void 0 : _a.call(mounted);
154
+ (_c = (_b = mounted.panel).destroy) === null || _c === void 0 ? void 0 : _c.call(_b);
155
+ }
156
+ this.mountedPanels.clear();
157
+ (_d = this.panelHost) === null || _d === void 0 ? void 0 : _d.replaceChildren();
158
+ }
159
+ closeAgToolPanel() {
160
+ var _a;
161
+ if (typeof ((_a = this.gridApi) === null || _a === void 0 ? void 0 : _a.closeToolPanel) === 'function') {
162
+ this.gridApi.closeToolPanel();
163
+ }
164
+ }
165
+ syncSideBarVisibility() {
166
+ var _a;
167
+ if (!((_a = this.tools) === null || _a === void 0 ? void 0 : _a.length)) {
168
+ this.setAttribute('hidden', '');
169
+ }
170
+ else {
171
+ this.removeAttribute('hidden');
172
+ }
173
+ }
174
+ };
175
+ __decorate([
176
+ attr
177
+ ], GridProSideBar.prototype, "prefix", void 0);
178
+ __decorate([
179
+ observable
180
+ ], GridProSideBar.prototype, "tools", void 0);
181
+ __decorate([
182
+ observable
183
+ ], GridProSideBar.prototype, "gridApi", void 0);
184
+ __decorate([
185
+ observable
186
+ ], GridProSideBar.prototype, "columnDragBridge", void 0);
187
+ __decorate([
188
+ observable
189
+ ], GridProSideBar.prototype, "open", void 0);
190
+ __decorate([
191
+ observable
192
+ ], GridProSideBar.prototype, "activeTool", void 0);
193
+ __decorate([
194
+ observable
195
+ ], GridProSideBar.prototype, "panelHost", void 0);
196
+ GridProSideBar = __decorate([
197
+ customElement({
198
+ name: 'grid-pro-side-bar',
199
+ template: getGridProSideBarTemplate(),
200
+ styles: gridProSideBarChromeStyles,
201
+ shadowOptions: null,
202
+ })
203
+ ], GridProSideBar);
204
+ export { GridProSideBar };
@@ -0,0 +1,155 @@
1
+ import { css } from '@microsoft/fast-element';
2
+ /**
3
+ * Layout on the Grid Pro host when `sideBarConfig` is set.
4
+ * @public
5
+ */
6
+ export const gridProSideBarHostStyles = css `
7
+ :host(.has-side-bar) {
8
+ display: flex;
9
+ flex-direction: row;
10
+ min-height: 0;
11
+ }
12
+
13
+ :host(.has-side-bar) [part='grid'] {
14
+ flex: 1 1 auto;
15
+ min-width: 0;
16
+ height: 100%;
17
+ }
18
+ `;
19
+ /**
20
+ * Chrome for {@link GridProSideBar}. Uses class selectors (no `:host`) because the
21
+ * element has no shadow — styles land on Grid Pro's shadow root.
22
+ * @public
23
+ */
24
+ export const gridProSideBarChromeStyles = css `
25
+ .grid-pro-side-bar {
26
+ --ag-icon-font-family: agGridAlpine;
27
+ --ag-icon-size: 16px;
28
+
29
+ display: flex;
30
+ flex-direction: row-reverse;
31
+ flex: 0 0 auto;
32
+ min-height: 0;
33
+ height: 100%;
34
+ z-index: 1;
35
+ border-left: 1px solid var(--neutral-stroke-divider-rest, var(--ag-border-color));
36
+ background: var(--neutral-layer-2, var(--ag-control-panel-background-color));
37
+ color: var(--neutral-foreground-rest, var(--ag-foreground-color));
38
+ }
39
+
40
+ .grid-pro-side-bar-buttons {
41
+ display: flex;
42
+ flex-direction: column;
43
+ flex: 0 0 auto;
44
+ border-left: 1px solid var(--neutral-stroke-divider-rest, var(--ag-border-color));
45
+ }
46
+
47
+ .grid-pro-side-bar-button {
48
+ margin: 0;
49
+ height: auto !important;
50
+ min-height: 0;
51
+ border-bottom: 1px solid var(--neutral-stroke-divider-rest, var(--ag-border-color));
52
+ }
53
+
54
+ .grid-pro-side-bar-button::part(control) {
55
+ display: flex;
56
+ flex-direction: column;
57
+ align-items: center;
58
+ padding: 12px 8px;
59
+ border: 0;
60
+ border-radius: 0;
61
+ min-width: 0;
62
+ min-height: 0;
63
+ height: auto;
64
+ white-space: nowrap;
65
+ }
66
+
67
+ .grid-pro-side-bar-button::part(content) {
68
+ display: flex;
69
+ flex-direction: column;
70
+ align-items: center;
71
+ gap: 4px;
72
+ }
73
+
74
+ .grid-pro-side-bar-button-icon {
75
+ display: block;
76
+ font-family: agGridAlpine, sans-serif;
77
+ font-size: var(--ag-icon-size, 16px);
78
+ line-height: var(--ag-icon-size, 16px);
79
+ font-style: normal;
80
+ font-weight: normal;
81
+ speak: none;
82
+ -webkit-font-smoothing: antialiased;
83
+ -moz-osx-font-smoothing: grayscale;
84
+ }
85
+
86
+ .grid-pro-side-bar-button-icon::before {
87
+ font-family: agGridAlpine, sans-serif;
88
+ background-color: transparent;
89
+ }
90
+
91
+ .grid-pro-side-bar-button-icon.ag-icon-columns::before {
92
+ content: '\\f10a';
93
+ }
94
+
95
+ .grid-pro-side-bar-button-icon.ag-icon-filter::before {
96
+ content: '\\f114';
97
+ }
98
+
99
+ .grid-pro-side-bar-button-icon[hidden] {
100
+ display: none;
101
+ }
102
+
103
+ .grid-pro-side-bar-button-label {
104
+ writing-mode: vertical-rl;
105
+ }
106
+
107
+ .grid-pro-side-bar-button:hover::part(control),
108
+ .grid-pro-side-bar-button[aria-selected='true']::part(control) {
109
+ background: var(--neutral-fill-hover, rgb(255 255 255 / 6%));
110
+ }
111
+
112
+ .grid-pro-side-bar-button:hover::part(content)::before {
113
+ background: transparent;
114
+ }
115
+
116
+ .grid-pro-side-bar-panel {
117
+ display: flex;
118
+ flex-direction: column;
119
+ flex: 0 0 auto;
120
+ width: 260px;
121
+ max-width: 40vw;
122
+ min-height: 0;
123
+ }
124
+
125
+ .grid-pro-side-bar-panel[hidden] {
126
+ display: none;
127
+ }
128
+
129
+ .grid-pro-side-bar-panel-host {
130
+ flex: 1 1 auto;
131
+ min-height: 0;
132
+ overflow: auto;
133
+ }
134
+
135
+ .grid-pro-side-bar-panel-host .ag-filter-toolpanel,
136
+ .grid-pro-side-bar-panel-host .ag-tool-panel-wrapper {
137
+ height: 100%;
138
+ width: 100%;
139
+ }
140
+
141
+ .grid-pro-columns-checkbox {
142
+ margin: 0;
143
+
144
+ --design-unit: 3;
145
+ }
146
+ `;
147
+ /**
148
+ * Host + chrome. Prefer {@link gridProSideBarHostStyles} on Grid Pro and
149
+ * {@link gridProSideBarChromeStyles} on the side-bar element.
150
+ * @public
151
+ */
152
+ export const gridProSideBarStyles = css `
153
+ ${gridProSideBarHostStyles}
154
+ ${gridProSideBarChromeStyles}
155
+ `;
@@ -0,0 +1,53 @@
1
+ import { html, ref, repeat } from '@microsoft/fast-element';
2
+ /**
3
+ * Community side bar chrome. Prefix selects DS buttons (`rapid-button`, `zero-button`).
4
+ * @public
5
+ */
6
+ export const getGridProSideBarTemplate = (prefix = 'foundation') => {
7
+ const buttonTag = `${prefix}-button`;
8
+ return html `
9
+ <template>
10
+ <div
11
+ class="grid-pro-side-bar-buttons"
12
+ role="tablist"
13
+ aria-label="Grid tools"
14
+ ?hidden="${(x) => { var _a; return !((_a = x.tools) === null || _a === void 0 ? void 0 : _a.length); }}"
15
+ >
16
+ ${repeat((x) => x.tools, html `
17
+ <${buttonTag}
18
+ appearance="lightweight"
19
+ role="tab"
20
+ class="grid-pro-side-bar-button"
21
+ data-test-id="${(x) => `grid-pro-side-bar-tool-${x.id}`}"
22
+ aria-selected="${(x, c) => c.parent.open &&
23
+ c.parent.activeTool === x.id}"
24
+ @click="${(x, c) => c.parent.handleToolClick(x.id)}"
25
+ >
26
+ <span
27
+ class="ag-icon grid-pro-side-bar-button-icon ${(x) => x.iconKey ? `ag-icon-${x.iconKey}` : ''}"
28
+ aria-hidden="true"
29
+ ?hidden="${(x) => !x.iconKey}"
30
+ ></span>
31
+ <span class="grid-pro-side-bar-button-label">${(x) => x.label}</span>
32
+ </${buttonTag}>
33
+ `)}
34
+ </div>
35
+ <div
36
+ class="grid-pro-side-bar-panel"
37
+ part="side-bar-panel"
38
+ data-test-id="grid-pro-side-bar-panel"
39
+ ?hidden="${(x) => !x.open}"
40
+ >
41
+ <div
42
+ class="grid-pro-side-bar-panel-host"
43
+ data-test-id="grid-pro-side-bar-panel-host"
44
+ ${ref('panelHost')}
45
+ ></div>
46
+ </div>
47
+ </template>
48
+ `;
49
+ };
50
+ /**
51
+ * @public
52
+ */
53
+ export const gridProSideBarTemplate = getGridProSideBarTemplate();
@@ -0,0 +1,26 @@
1
+ import { ColumnsToolPanel } from '../columns-tool-panel';
2
+ import { GridProSideBarTool, } from './side-bar.types';
3
+ /**
4
+ * Built-in Columns picker (Community, no AG SideBarModule).
5
+ * @public
6
+ */
7
+ export const gridProSideBarColumnsTool = {
8
+ id: GridProSideBarTool.columns,
9
+ label: 'Columns',
10
+ iconKey: 'columns',
11
+ createPanel: () => new ColumnsToolPanel(),
12
+ };
13
+ /**
14
+ * Preset: Columns picker only. Use in {@link GridProSideBarConfig.tools}.
15
+ * @public
16
+ */
17
+ export const GRID_PRO_DEFAULT_SIDE_BAR_TOOLS = [
18
+ gridProSideBarColumnsTool,
19
+ ];
20
+ /**
21
+ * Default side bar config (Columns only).
22
+ * @public
23
+ */
24
+ export const DEFAULT_SIDE_BAR_CONFIG = {
25
+ tools: [...GRID_PRO_DEFAULT_SIDE_BAR_TOOLS],
26
+ };
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Well-known Community side-bar tool ids.
3
+ * @public
4
+ */
5
+ export const GridProSideBarTool = {
6
+ columns: 'columns',
7
+ filters: 'filters',
8
+ };
9
+ /**
10
+ * Built-in AG Filters tool (Enterprise `FiltersToolPanelModule` required at app register).
11
+ * @public
12
+ */
13
+ export const gridProSideBarFiltersTool = {
14
+ id: GridProSideBarTool.filters,
15
+ label: 'Filters',
16
+ labelKey: 'filters',
17
+ iconKey: 'filter',
18
+ toolPanel: 'agFiltersToolPanel',
19
+ };
20
+ /**
21
+ * Builds a custom tool panel def (AG-style registration into our shell).
22
+ * @public
23
+ */
24
+ export function createGridProSideBarTool(def) {
25
+ return def;
26
+ }
27
+ /**
28
+ * @internal
29
+ */
30
+ export function resolveAgSideBarToolPanels(tools) {
31
+ return tools
32
+ .filter((t) => t.toolPanel != null && !t.createPanel)
33
+ .map((t) => {
34
+ var _a, _b;
35
+ return (Object.assign({ id: t.id, labelKey: (_a = t.labelKey) !== null && _a !== void 0 ? _a : t.id, labelDefault: t.label, iconKey: (_b = t.iconKey) !== null && _b !== void 0 ? _b : t.id, toolPanel: t.toolPanel }, (t.toolPanelParams != null ? { toolPanelParams: t.toolPanelParams } : {})));
36
+ });
37
+ }
38
+ /**
39
+ * @internal
40
+ */
41
+ export function initLocalSideBarPanel(panel, params) {
42
+ var _a;
43
+ (_a = panel.init) === null || _a === void 0 ? void 0 : _a.call(panel, params);
44
+ return panel;
45
+ }