@alaarab/ogrid-react-fluent 2.0.21 → 2.0.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.
|
@@ -114,6 +114,9 @@
|
|
|
114
114
|
border: 1px solid var(--colorNeutralStroke1, #d1d1d1);
|
|
115
115
|
border-radius: var(--borderRadiusMedium, 4px);
|
|
116
116
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
|
|
117
|
+
font-family: var(--fontFamilyBase, "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif);
|
|
118
|
+
font-size: 14px;
|
|
119
|
+
color: var(--colorNeutralForeground1, #242424);
|
|
117
120
|
}
|
|
118
121
|
|
|
119
122
|
.popoverHeader {
|
|
@@ -129,12 +132,6 @@
|
|
|
129
132
|
padding: 10px 12px;
|
|
130
133
|
border-bottom: 1px solid var(--colorNeutralStroke2, #e0e0e0);
|
|
131
134
|
}
|
|
132
|
-
.popoverSearch .searchInput {
|
|
133
|
-
width: 100%;
|
|
134
|
-
}
|
|
135
|
-
.popoverSearch .searchInput :global .fui-Input__input {
|
|
136
|
-
border-width: 1px !important;
|
|
137
|
-
}
|
|
138
135
|
|
|
139
136
|
.nativeInputWrapper {
|
|
140
137
|
display: flex;
|
|
@@ -225,11 +222,32 @@
|
|
|
225
222
|
.popoverOption {
|
|
226
223
|
padding: 4px 12px;
|
|
227
224
|
transition: background-color 0.1s ease;
|
|
225
|
+
cursor: pointer;
|
|
228
226
|
}
|
|
229
227
|
.popoverOption:hover {
|
|
230
228
|
background-color: var(--colorNeutralBackground1Hover, #f5f5f5);
|
|
231
229
|
}
|
|
232
230
|
|
|
231
|
+
.nativeCheckbox {
|
|
232
|
+
width: 16px;
|
|
233
|
+
height: 16px;
|
|
234
|
+
margin: 0;
|
|
235
|
+
cursor: pointer;
|
|
236
|
+
accent-color: var(--colorBrandBackground, #0f6cbd);
|
|
237
|
+
flex-shrink: 0;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.checkboxLabel {
|
|
241
|
+
margin-left: 8px;
|
|
242
|
+
font-size: 14px;
|
|
243
|
+
color: var(--colorNeutralForeground1, #242424);
|
|
244
|
+
overflow: hidden;
|
|
245
|
+
text-overflow: ellipsis;
|
|
246
|
+
white-space: nowrap;
|
|
247
|
+
min-width: 0;
|
|
248
|
+
cursor: pointer;
|
|
249
|
+
}
|
|
250
|
+
|
|
233
251
|
.personOption {
|
|
234
252
|
padding: 8px 12px;
|
|
235
253
|
cursor: pointer;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Input, Checkbox } from '@fluentui/react-components';
|
|
3
2
|
import { SearchRegular } from '@fluentui/react-icons';
|
|
4
3
|
import { useListVirtualizer } from '@alaarab/ogrid-react';
|
|
5
4
|
import styles from './ColumnHeaderFilter.module.css';
|
|
6
5
|
const ITEM_HEIGHT = 40;
|
|
7
6
|
export const MultiSelectFilterPopover = ({ searchText, onSearchChange, options, filteredOptions, selected, onOptionToggle, onSelectAll, onClearSelection, onApply, isLoading, onPopoverClick, onInputFocus, onInputMouseDown, onInputClick, onInputKeyDown, }) => {
|
|
8
7
|
const virt = useListVirtualizer({ count: filteredOptions.length, itemHeight: ITEM_HEIGHT });
|
|
9
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: styles.popoverSearch, onClick: onPopoverClick, children: [_jsx(
|
|
8
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: styles.popoverSearch, onClick: onPopoverClick, children: [_jsxs("div", { className: styles.nativeInputWrapper, children: [_jsx(SearchRegular, { className: styles.nativeInputIcon }), _jsx("input", { type: "text", placeholder: "Search...", value: searchText, onChange: (e) => onSearchChange(e.target.value), onFocus: onInputFocus, onMouseDown: onInputMouseDown, onClick: onInputClick, onKeyDown: onInputKeyDown, autoComplete: "off", className: styles.nativeInput })] }), _jsxs("div", { className: styles.resultCount, children: [filteredOptions.length, " of ", options.length, " options"] })] }), _jsxs("div", { className: styles.selectAllRow, onClick: onPopoverClick, children: [_jsxs("button", { type: "button", className: styles.selectAllButton, onClick: onSelectAll, children: ["Select All (", filteredOptions.length, ")"] }), _jsx("button", { type: "button", className: styles.selectAllButton, onClick: onClearSelection, children: "Clear" })] }), _jsx("div", { ref: virt.containerRef, onScroll: virt.onScroll, className: styles.popoverOptions, onClick: onPopoverClick, children: isLoading ? (_jsxs("div", { className: styles.loadingContainer, children: [_jsx("div", { className: styles.filterSpinner }), _jsx("span", { style: { fontSize: 12, color: 'var(--colorNeutralForeground2, #616161)' }, children: "Loading..." })] })) : filteredOptions.length === 0 ? (_jsx("div", { className: styles.noResults, children: "No options found" })) : (_jsx("div", { style: { height: virt.totalHeight, position: 'relative' }, children: virt.visibleItems.map(({ index, offsetTop }) => {
|
|
10
9
|
const option = filteredOptions[index];
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
const isChecked = selected.has(option);
|
|
11
|
+
return (_jsxs("label", { className: styles.popoverOption, style: { position: 'absolute', top: offsetTop, width: '100%', height: ITEM_HEIGHT, boxSizing: 'border-box', display: 'flex', alignItems: 'center' }, children: [_jsx("input", { type: "checkbox", checked: isChecked, onChange: (ev) => {
|
|
12
|
+
ev.stopPropagation();
|
|
13
|
+
onOptionToggle(option, ev.target.checked);
|
|
14
|
+
}, className: styles.nativeCheckbox }), _jsx("span", { className: styles.checkboxLabel, children: option })] }, option));
|
|
15
15
|
}) })) }), _jsxs("div", { className: styles.popoverActions, onClick: onPopoverClick, children: [_jsx("button", { type: "button", className: styles.clearButton, onClick: onClearSelection, children: "Clear" }), _jsx("button", { type: "button", className: styles.applyButton, onClick: onApply, children: "Apply" })] })] }));
|
|
16
16
|
};
|
|
17
17
|
MultiSelectFilterPopover.displayName = 'MultiSelectFilterPopover';
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Input } from '@fluentui/react-components';
|
|
3
2
|
import { SearchRegular } from '@fluentui/react-icons';
|
|
4
3
|
import styles from './ColumnHeaderFilter.module.css';
|
|
5
|
-
export const TextFilterPopover = ({ value, onValueChange, onApply, onClear, onPopoverClick, onInputFocus, onInputMouseDown, onInputClick, onInputKeyDown, }) => (_jsxs(_Fragment, { children: [_jsx("div", { className: styles.popoverSearch, onClick: onPopoverClick, children: _jsx(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
export const TextFilterPopover = ({ value, onValueChange, onApply, onClear, onPopoverClick, onInputFocus, onInputMouseDown, onInputClick, onInputKeyDown, }) => (_jsxs(_Fragment, { children: [_jsx("div", { className: styles.popoverSearch, onClick: onPopoverClick, children: _jsxs("div", { className: styles.nativeInputWrapper, children: [_jsx(SearchRegular, { className: styles.nativeInputIcon }), _jsx("input", { type: "text", placeholder: "Enter search term...", value: value, onChange: (e) => onValueChange(e.target.value), onKeyDown: (e) => {
|
|
5
|
+
onInputKeyDown(e);
|
|
6
|
+
if (e.key === 'Enter') {
|
|
7
|
+
e.preventDefault();
|
|
8
|
+
onApply();
|
|
9
|
+
}
|
|
10
|
+
}, onFocus: onInputFocus, onMouseDown: onInputMouseDown, onClick: onInputClick, autoComplete: "off", className: styles.nativeInput })] }) }), _jsxs("div", { className: styles.popoverActions, onClick: onPopoverClick, children: [_jsx("button", { type: "button", className: styles.clearButton, onClick: onClear, disabled: !value, children: "Clear" }), _jsx("button", { type: "button", className: styles.applyButton, onClick: onApply, children: "Apply" })] })] }));
|
|
12
11
|
TextFilterPopover.displayName = 'TextFilterPopover';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alaarab/ogrid-react-fluent",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.23",
|
|
4
4
|
"description": "OGrid React Fluent implementation – DataGrid-powered data table with sorting, filtering, pagination, column chooser, and CSV export.",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"node": ">=18"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@alaarab/ogrid-react": "2.0.
|
|
43
|
+
"@alaarab/ogrid-react": "2.0.23"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@fluentui/react-components": "^9.0.0",
|