@linzjs/step-ag-grid 21.1.3 → 21.2.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.
@@ -3126,9 +3126,9 @@ const GridFilterQuick = ({ quickFilterPlaceholder, defaultValue }) => {
3126
3126
  useEffect(() => {
3127
3127
  setQuickFilter(quickFilterValue);
3128
3128
  }, [quickFilterValue, setQuickFilter]);
3129
- return (jsx("div", { className: "GridFilterQuick-container", children: jsx("input", { "aria-label": "Search", className: "GridFilterQuick-input", type: "text", placeholder: quickFilterPlaceholder ?? "Search...", value: quickFilterValue, onChange: (event) => {
3130
- setQuickFilterValue(event.target.value);
3131
- } }) }));
3129
+ return (jsxs("div", { className: "GridFilterQuick-container", children: [jsx("div", { className: "GridFilterQuick-icon", children: jsx(LuiIcon, { name: "ic_search", alt: "Search", size: "md" }) }), jsx("input", { "aria-label": "Search", className: "GridFilterQuick-input", type: "text", placeholder: quickFilterPlaceholder ?? "Search", value: quickFilterValue, onChange: (event) => {
3130
+ setQuickFilterValue(event.target.value);
3131
+ } })] }));
3132
3132
  };
3133
3133
 
3134
3134
  const GridFilters = ({ children }) => (jsx("div", { className: "Grid-container-filters", children: children }));
@@ -4248,43 +4248,42 @@ const GridFormPopoverMenu = (props) => {
4248
4248
  }, children: jsx("div", { className: "subComponent", children: item.subComponent && jsx(item.subComponent, {}) }) })) }, `${item.label}_subcomponent`))] }, `${item.label}`))))) }) }));
4249
4249
  };
4250
4250
 
4251
+ /**
4252
+ * Convert array of 16 byte values to UUID string format of the form:
4253
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
4254
+ */
4255
+ var byteToHex = [];
4256
+ for (var i = 0; i < 256; ++i) {
4257
+ byteToHex.push((i + 0x100).toString(16).slice(1));
4258
+ }
4259
+ function unsafeStringify(arr, offset = 0) {
4260
+ // Note: Be careful editing this code! It's been tuned for performance
4261
+ // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
4262
+ //
4263
+ // Note to future-self: No, you can't remove the `toLowerCase()` call.
4264
+ // REF: https://github.com/uuidjs/uuid/pull/677#issuecomment-1757351351
4265
+ return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
4266
+ }
4267
+
4251
4268
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
4252
4269
  // require the crypto API and do not support built-in fallback to lower quality random number
4253
4270
  // generators (like Math.random()).
4254
- let getRandomValues;
4255
- const rnds8 = new Uint8Array(16);
4271
+
4272
+ var getRandomValues;
4273
+ var rnds8 = new Uint8Array(16);
4256
4274
  function rng() {
4257
4275
  // lazy load so that environments that need to polyfill have a chance to do so
4258
4276
  if (!getRandomValues) {
4259
4277
  // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
4260
4278
  getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
4261
-
4262
4279
  if (!getRandomValues) {
4263
4280
  throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
4264
4281
  }
4265
4282
  }
4266
-
4267
4283
  return getRandomValues(rnds8);
4268
4284
  }
4269
4285
 
4270
- /**
4271
- * Convert array of 16 byte values to UUID string format of the form:
4272
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
4273
- */
4274
-
4275
- const byteToHex = [];
4276
-
4277
- for (let i = 0; i < 256; ++i) {
4278
- byteToHex.push((i + 0x100).toString(16).slice(1));
4279
- }
4280
-
4281
- function unsafeStringify(arr, offset = 0) {
4282
- // Note: Be careful editing this code! It's been tuned for performance
4283
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
4284
- return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
4285
- }
4286
-
4287
- const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
4286
+ var randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
4288
4287
  var native = {
4289
4288
  randomUUID
4290
4289
  };
@@ -4293,13 +4292,12 @@ function v4(options, buf, offset) {
4293
4292
  if (native.randomUUID && !buf && !options) {
4294
4293
  return native.randomUUID();
4295
4294
  }
4296
-
4297
4295
  options = options || {};
4298
- const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
4296
+ var rnds = options.random || (options.rng || rng)();
4299
4297
 
4298
+ // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
4300
4299
  rnds[6] = rnds[6] & 0x0f | 0x40;
4301
- rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
4302
-
4300
+ rnds[8] = rnds[8] & 0x3f | 0x80;
4303
4301
  return unsafeStringify(rnds);
4304
4302
  }
4305
4303
 
@@ -4578,13 +4576,18 @@ const GridContextProvider = (props) => {
4578
4576
  const { modifyUpdating, checkUpdating } = useContext(GridUpdatingContext);
4579
4577
  const [gridApi, setGridApi] = useState();
4580
4578
  const [gridReady, setGridReady] = useState(false);
4581
- const [quickFilter, setQuickFilter] = useState("");
4579
+ const [quickFilter, _setQuickFilter] = useState("");
4582
4580
  const [invisibleColumnIds, _setInvisibleColumnIds] = useState();
4583
4581
  const testId = useRef();
4584
4582
  const idsBeforeUpdate = useRef([]);
4585
4583
  const prePopupFocusedCell = useRef();
4586
4584
  const [externallySelectedItemsAreInSync, setExternallySelectedItemsAreInSync] = useState(false);
4587
4585
  const externalFilters = useRef([]);
4586
+ const setQuickFilter = useCallback((filter) => {
4587
+ // If we don't clear the focused cell focus switches back to grid when typing in the quick filter input
4588
+ gridApi?.clearFocusedCell();
4589
+ _setQuickFilter(filter);
4590
+ }, [gridApi]);
4588
4591
  /**
4589
4592
  * Make extra sure the GridCellFillerColId never gets added to invisibleColumnIds as it's dynamically determined
4590
4593
  */