@omnigrid/react 0.1.21 → 0.1.22

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 (2) hide show
  1. package/dist/controls.js +8 -0
  2. package/package.json +2 -2
package/dist/controls.js CHANGED
@@ -289,6 +289,13 @@ function MultiSelectControl({ descriptor }) {
289
289
  return descriptor.options.filter((opt) => opt.label.toLowerCase().includes(term) || opt.value.toLowerCase().includes(term));
290
290
  }, [descriptor.options, searchTerm]);
291
291
  const allChecked = useMemo(() => descriptor.options.length > 0 && descriptor.options.every((opt) => opt.checked), [descriptor.options]);
292
+ const someChecked = useMemo(() => descriptor.options.length > 0 && !allChecked && descriptor.options.some((opt) => opt.checked), [descriptor.options, allChecked]);
293
+ const selectAllRef = useRef(null);
294
+ useEffect(() => {
295
+ if (selectAllRef.current) {
296
+ selectAllRef.current.indeterminate = someChecked;
297
+ }
298
+ }, [someChecked]);
292
299
  const toggleAll = (checked) => {
293
300
  if (checked) {
294
301
  descriptor.onChange(descriptor.options.map((opt) => opt.value));
@@ -324,6 +331,7 @@ function MultiSelectControl({ descriptor }) {
324
331
  setSearchTerm("");
325
332
  },
326
333
  }, "×")), createElement("div", { className: "omnigrid-multi-select-actions" }, createElement("label", { className: "omnigrid-multi-select-item" }, createElement("input", {
334
+ ref: selectAllRef,
327
335
  type: "checkbox",
328
336
  className: "omnigrid-checkbox",
329
337
  checked: allChecked,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnigrid/react",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "React adapter and renderer for OmniGrid",
5
5
  "keywords": [
6
6
  "omnigrid",
@@ -45,7 +45,7 @@
45
45
  "@omnigrid/default-theme": "^0.1.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@omnigrid/filtering-plugin": "*",
48
+ "@omnigrid/column-filter-plugin": "*",
49
49
  "@omnigrid/quick-filter-plugin": "*",
50
50
  "@types/react": "^19.0.0",
51
51
  "@types/react-dom": "^19.0.0"