@linzjs/step-ag-grid 6.1.1 → 7.0.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.
Files changed (44) hide show
  1. package/dist/index.css +12 -2
  2. package/dist/index.js +377 -202
  3. package/dist/index.js.map +1 -1
  4. package/dist/src/components/GridPopoverHook.d.ts +1 -1
  5. package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +17 -12
  6. package/dist/src/components/gridPopoverEdit/GridPopoutEditMultiSelect.d.ts +1 -1
  7. package/dist/src/contexts/GridSubComponentContext.d.ts +1 -0
  8. package/dist/src/lui/ActionButton.d.ts +2 -1
  9. package/dist/src/lui/FormError.d.ts +2 -1
  10. package/dist/src/lui/TextAreaInput.d.ts +1 -1
  11. package/dist/src/lui/TextInputFormatted.d.ts +1 -1
  12. package/dist/src/react-menu3/utils/utils.d.ts +1 -0
  13. package/dist/src/utils/textMatcher.d.ts +13 -0
  14. package/dist/src/utils/textValidator.d.ts +3 -2
  15. package/dist/src/utils/util.d.ts +2 -1
  16. package/dist/step-ag-grid.esm.js +378 -204
  17. package/dist/step-ag-grid.esm.js.map +1 -1
  18. package/package.json +9 -8
  19. package/src/components/GridPopoverHook.tsx +7 -1
  20. package/src/components/gridForm/GridFormDropDown.tsx +1 -0
  21. package/src/components/gridForm/GridFormMultiSelect.tsx +290 -188
  22. package/src/components/gridForm/GridFormPopoverMenu.tsx +1 -0
  23. package/src/components/gridForm/GridFormSubComponentTextArea.tsx +2 -2
  24. package/src/components/gridForm/GridFormSubComponentTextInput.tsx +3 -5
  25. package/src/components/gridForm/GridFormTextArea.tsx +13 -13
  26. package/src/components/gridForm/GridFormTextInput.tsx +3 -8
  27. package/src/components/gridPopoverEdit/GridPopoutEditMultiSelect.ts +3 -3
  28. package/src/contexts/GridSubComponentContext.ts +2 -0
  29. package/src/lui/ActionButton.tsx +26 -8
  30. package/src/lui/FormError.scss +7 -0
  31. package/src/lui/FormError.tsx +4 -13
  32. package/src/lui/TextAreaInput.tsx +1 -1
  33. package/src/lui/TextInputFormatted.tsx +1 -1
  34. package/src/react-menu3/components/ControlledMenu.tsx +3 -2
  35. package/src/react-menu3/components/MenuList.tsx +2 -12
  36. package/src/react-menu3/hooks/useItems.ts +5 -2
  37. package/src/react-menu3/utils/utils.ts +15 -0
  38. package/src/stories/components/ActionButton.stories.tsx +9 -0
  39. package/src/stories/grid/GridPopoutEditMultiSelect.stories.tsx +93 -17
  40. package/src/styles/Grid.scss +12 -0
  41. package/src/styles/lui-overrides.scss +0 -2
  42. package/src/utils/textMatcher.ts +31 -0
  43. package/src/utils/textValidator.ts +6 -3
  44. package/src/utils/util.ts +6 -7
package/src/utils/util.ts CHANGED
@@ -1,8 +1,6 @@
1
- import { isEmpty as _isEmpty } from "lodash-es";
1
+ import { isEmpty, negate } from "lodash-es";
2
2
 
3
- // Typed version of lodash !isEmpty
4
- export const isNotEmpty = (obj: Set<any> | Map<any, any> | Record<any, any> | any[] | undefined): boolean =>
5
- !_isEmpty(obj);
3
+ export const isNotEmpty = negate(isEmpty);
6
4
 
7
5
  export const wait = (timeoutMs: number) =>
8
6
  new Promise<(string | null)[]>((resolve) => {
@@ -15,13 +13,14 @@ export const isFloat = (value: string) => {
15
13
  };
16
14
 
17
15
  export const hasParentClass = function (className: string, child: Node) {
18
- let node: Node | null = child;
19
- while (node) {
16
+ for (let node: Node | null = child; node; node = node.parentNode) {
20
17
  // When nodes are in portals they aren't type node anymore hence treating it as any here
21
18
  if ((node as any).classList && (node as any).classList.contains(className)) {
22
19
  return true;
23
20
  }
24
- node = node.parentNode;
25
21
  }
26
22
  return false;
27
23
  };
24
+
25
+ export const stringByteLengthIsInvalid = (str: string, maxBytes: number) =>
26
+ new TextEncoder().encode(str).length > maxBytes;