@linzjs/step-ag-grid 30.2.0 → 30.4.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.
- package/dist/src/components/gridFilter/GridFilterColumnsMultiSelect.d.ts +0 -1
- package/dist/src/components/gridForm/GridFormInlineTextInput.d.ts +5 -0
- package/dist/step-ag-grid.cjs +24 -6
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +24 -6
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/gridFilter/GridFilterColumnsMultiSelect.tsx +18 -5
- package/src/components/gridForm/GridFormInlineTextInput.tsx +9 -1
- package/src/stories/grid/GridInlineText.stories.tsx +99 -18
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -62066,6 +62066,8 @@ styleInject(css_248z$3);
|
|
|
62066
62066
|
|
|
62067
62067
|
const EMPTY_KEY = '__EMPTY__';
|
|
62068
62068
|
const DEFAULT_EMPTY_LABEL = '-';
|
|
62069
|
+
const filterStateMap = new Map();
|
|
62070
|
+
const filterClickCountMap = new Map();
|
|
62069
62071
|
const FilterUI = ({ allValues, selected, labels, labelFormatter, onToggleAll, onToggleOne, }) => {
|
|
62070
62072
|
const allChecked = allValues.length > 0 && selected.size === allValues.length;
|
|
62071
62073
|
const getDisplayLabel = (raw) => {
|
|
@@ -62084,7 +62086,6 @@ class GridFilterColumnsMultiSelect {
|
|
|
62084
62086
|
reactRoot = null;
|
|
62085
62087
|
filterButtonClickListener = null;
|
|
62086
62088
|
filterButton = null;
|
|
62087
|
-
hasOpened = false;
|
|
62088
62089
|
normalizeCellValue(value) {
|
|
62089
62090
|
if (typeof value === 'string')
|
|
62090
62091
|
return value.trim() === '' ? EMPTY_KEY : value;
|
|
@@ -62134,14 +62135,24 @@ class GridFilterColumnsMultiSelect {
|
|
|
62134
62135
|
this.filterButton = document.querySelector(`[col-id="${columnId}"] .ag-header-cell-filter-button`);
|
|
62135
62136
|
if (this.filterButton) {
|
|
62136
62137
|
this.filterButtonClickListener = (e) => {
|
|
62137
|
-
|
|
62138
|
-
|
|
62138
|
+
const clickCount = filterClickCountMap.get(columnId) || 0;
|
|
62139
|
+
filterClickCountMap.set(columnId, clickCount + 1);
|
|
62140
|
+
if (clickCount === 0) {
|
|
62141
|
+
e.stopImmediatePropagation();
|
|
62139
62142
|
e.preventDefault();
|
|
62140
62143
|
this.params.api.hidePopupMenu();
|
|
62141
|
-
|
|
62144
|
+
filterStateMap.set(columnId, false);
|
|
62145
|
+
return;
|
|
62146
|
+
}
|
|
62147
|
+
const isOpen = filterStateMap.get(columnId) || false;
|
|
62148
|
+
if (isOpen) {
|
|
62149
|
+
e.stopImmediatePropagation();
|
|
62150
|
+
e.preventDefault();
|
|
62151
|
+
this.params.api.hidePopupMenu();
|
|
62152
|
+
filterStateMap.set(columnId, false);
|
|
62142
62153
|
}
|
|
62143
62154
|
else {
|
|
62144
|
-
|
|
62155
|
+
filterStateMap.set(columnId, true);
|
|
62145
62156
|
}
|
|
62146
62157
|
};
|
|
62147
62158
|
this.filterButton.addEventListener('click', this.filterButtonClickListener, true);
|
|
@@ -63166,7 +63177,14 @@ const GridFormInlineTextInput = (props) => {
|
|
|
63166
63177
|
input?.removeEventListener('keydown', tabRecorder, { capture: true });
|
|
63167
63178
|
};
|
|
63168
63179
|
}, [tabRecorder]);
|
|
63169
|
-
return (jsx("div", { className: clsx('GridFormInlineTextInput', invalid() && 'GridFormInlineTextInput-error'), title: String(invalid() ?? ''), children: jsx("input", { ref: inputRef, type: 'text', value: value, onChange: (e) =>
|
|
63180
|
+
return (jsx("div", { className: clsx('GridFormInlineTextInput', invalid() && 'GridFormInlineTextInput-error'), title: String(invalid() ?? ''), children: jsx("input", { ref: inputRef, type: 'text', value: value, onChange: (e) => {
|
|
63181
|
+
setValue(e.target.value);
|
|
63182
|
+
if (props.onChange) {
|
|
63183
|
+
const selectedRows = getSelectedRows();
|
|
63184
|
+
const selectedRowIds = selectedRows.map((data) => data.id);
|
|
63185
|
+
props.onChange({ selectedRows, selectedRowIds, value: e.target.value });
|
|
63186
|
+
}
|
|
63187
|
+
}, placeholder: props.placeholder ?? 'Type here', onBlur: () => {
|
|
63170
63188
|
void triggerSave(CloseReason.BLUR);
|
|
63171
63189
|
}, onKeyUp: (e) => {
|
|
63172
63190
|
if (e.key === 'Enter') {
|