@linzjs/step-ag-grid 29.9.0 → 29.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -144,7 +144,7 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
144
144
  }
145
145
 
146
146
  .ag-icon-filter {
147
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232A292C'%3E%3Cpath d='M6 12.984v-1.969h12v1.969zM3 6h18v2.016H3zm6.984 12v-2.016h4.031V18z'/%3E%3C/svg%3E") !important;
147
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23007198'%3E%3Cpath d='M6 12.984v-1.969h12v1.969zM3 6h18v2.016H3zm6.984 12v-2.016h4.031V18z'/%3E%3C/svg%3E") !important;
148
148
  background-repeat: no-repeat;
149
149
  background-position: center;
150
150
  background-size: contain;
@@ -154,6 +154,12 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
154
154
  content: none !important;
155
155
  }
156
156
  }
157
+
158
+ .ag-header-cell-filter-button.ag-has-popup-positioned-under .ag-icon-filter {
159
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M6 12.984v-1.969h12v1.969zM3 6h18v2.016H3zm6.984 12v-2.016h4.031V18z'/%3E%3C/svg%3E") !important;
160
+ background-color: #007198;
161
+ border-radius: 2px;
162
+ }
157
163
 
158
164
  .ag-header-group-cell {
159
165
  text-transform: uppercase;
@@ -15,6 +15,7 @@ export declare class GridFilterColumnsMultiSelect implements IFilterComp {
15
15
  private gui;
16
16
  private labelFormatter?;
17
17
  private reactRoot;
18
+ private normalizeCellValue;
18
19
  private loadFieldValues;
19
20
  init(params: CheckboxMultiFilterParams): void;
20
21
  private render;
@@ -22,7 +23,7 @@ export declare class GridFilterColumnsMultiSelect implements IFilterComp {
22
23
  private handleToggleOne;
23
24
  getGui(): HTMLElement;
24
25
  isFilterActive(): boolean;
25
- doesFilterPass(params: IDoesFilterPassParams): boolean;
26
+ doesFilterPass(p: IDoesFilterPassParams): boolean;
26
27
  getModel(): CheckboxMultiFilterModel | null;
27
28
  setModel(model: CheckboxMultiFilterModel | null): void;
28
29
  destroy(): void;
@@ -3634,11 +3634,13 @@ function styleInject(css, ref) {
3634
3634
  var css_248z$3 = ".GridFilterColsMultiSelect{background:#fff;font-family:Open Sans,system-ui,sans-serif;font-style:normal;font-weight:600;padding:8px}.GridFilterColsMultiSelect .LuiSelect-label-text{color:#6b6966;display:inline-block}.GridFilterColsMultiSelect .LuiCheckboxInput-item,.GridFilterColsMultiSelect .LuiCheckboxInput-selectAll{color:#2a292c;font-size:16px;font-weight:600;letter-spacing:0;line-height:20px;line-height:24px;margin-bottom:0}";
3635
3635
  styleInject(css_248z$3);
3636
3636
 
3637
+ const EMPTY_KEY = '__EMPTY__';
3638
+ const DEFAULT_EMPTY_LABEL = '-';
3637
3639
  const FilterUI = ({ allValues, selected, labels, labelFormatter, onToggleAll, onToggleOne, }) => {
3638
3640
  const allChecked = allValues.length > 0 && selected.size === allValues.length;
3639
3641
  const getDisplayLabel = (raw) => {
3640
- const mapped = labels[raw] ?? raw;
3641
- return labelFormatter ? labelFormatter(mapped) : mapped;
3642
+ const base = raw === EMPTY_KEY ? (labels[EMPTY_KEY] ?? DEFAULT_EMPTY_LABEL) : (labels[raw] ?? raw);
3643
+ return labelFormatter ? labelFormatter(base) : base;
3642
3644
  };
3643
3645
  return (jsxRuntime.jsxs("div", { className: "GridFilterColsMultiSelect", children: [jsxRuntime.jsx("span", { className: "LuiSelect-label-text", children: "Filter column" }), jsxRuntime.jsx(lui.LuiCheckboxInput, { className: "LuiCheckboxInput-selectAll", label: 'Select All', value: "true", isChecked: allChecked, onChange: (e) => onToggleAll(e.target.checked) }), allValues.map((val) => (jsxRuntime.jsx(lui.LuiCheckboxInput, { className: "LuiCheckboxInput-item", label: getDisplayLabel(val), value: val, isChecked: selected.has(val), onChange: (e) => onToggleOne(val, e.target.checked) }, val)))] }));
3644
3646
  };
@@ -3650,27 +3652,35 @@ class GridFilterColumnsMultiSelect {
3650
3652
  gui;
3651
3653
  labelFormatter;
3652
3654
  reactRoot = null;
3655
+ normalizeCellValue(value) {
3656
+ if (typeof value === 'string')
3657
+ return value.trim() === '' ? EMPTY_KEY : value;
3658
+ return EMPTY_KEY;
3659
+ }
3653
3660
  loadFieldValues() {
3654
3661
  const field = this.params.colDef.field;
3655
3662
  const values = new Set();
3656
3663
  this.params.api.forEachNode((node) => {
3657
- const data = node.data;
3658
- const cellValue = data?.[field];
3659
- if (data &&
3660
- typeof data === 'object' &&
3661
- field in data &&
3662
- typeof cellValue === 'string' &&
3663
- cellValue !== undefined &&
3664
- cellValue !== null) {
3665
- values.add(cellValue);
3666
- }
3664
+ const data = node.data ?? {};
3665
+ const raw = data[field];
3666
+ const norm = this.normalizeCellValue(raw);
3667
+ values.add(norm);
3668
+ });
3669
+ return Array.from(values).sort((a, b) => {
3670
+ if (a === EMPTY_KEY && b !== EMPTY_KEY)
3671
+ return -1;
3672
+ if (b === EMPTY_KEY && a !== EMPTY_KEY)
3673
+ return 1;
3674
+ return a.localeCompare(b);
3667
3675
  });
3668
- return Array.from(values).sort();
3669
3676
  }
3670
3677
  init(params) {
3671
3678
  this.params = params;
3672
3679
  this.labels = { ...params.labels };
3673
3680
  this.labelFormatter = params.labelFormatter;
3681
+ if (!(EMPTY_KEY in this.labels)) {
3682
+ this.labels[EMPTY_KEY] = DEFAULT_EMPTY_LABEL;
3683
+ }
3674
3684
  this.allValues = this.loadFieldValues();
3675
3685
  this.selectedValues = new Set(this.allValues);
3676
3686
  this.gui = document.createElement('div');
@@ -3708,16 +3718,14 @@ class GridFilterColumnsMultiSelect {
3708
3718
  isFilterActive() {
3709
3719
  return this.selectedValues.size > 0;
3710
3720
  }
3711
- doesFilterPass(params) {
3721
+ doesFilterPass(p) {
3712
3722
  const field = this.params.colDef.field;
3713
- if (!params.data || typeof params.data !== 'object' || !(field in params.data)) {
3714
- return false;
3715
- }
3716
- const cellValue = params.data[field];
3717
- if (typeof cellValue !== 'string') {
3718
- return false;
3723
+ if (!p.data || typeof p.data !== 'object') {
3724
+ return this.selectedValues.has(EMPTY_KEY);
3719
3725
  }
3720
- return this.selectedValues.has(cellValue);
3726
+ const raw = p.data[field];
3727
+ const norm = this.normalizeCellValue(raw);
3728
+ return this.selectedValues.has(norm);
3721
3729
  }
3722
3730
  getModel() {
3723
3731
  return this.selectedValues.size > 0 ? { values: Array.from(this.selectedValues) } : null;
@@ -3734,7 +3742,7 @@ class GridFilterColumnsMultiSelect {
3734
3742
  }
3735
3743
  }
3736
3744
  const createCheckboxMultiFilterParams = (labels = {}, labelFormatter) => ({
3737
- labels,
3745
+ labels: { [EMPTY_KEY]: DEFAULT_EMPTY_LABEL, ...labels },
3738
3746
  labelFormatter,
3739
3747
  });
3740
3748