@linzjs/step-ag-grid 32.4.2 → 32.6.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 (56) hide show
  1. package/dist/src/components/gridForm/GridFormTextArea.d.ts +1 -0
  2. package/dist/src/components/gridForm/GridFormTextInput.d.ts +1 -0
  3. package/dist/src/index.d.ts +1 -0
  4. package/dist/src/utils/isChromatic.d.ts +11 -0
  5. package/dist/step-ag-grid.cjs +40 -12
  6. package/dist/step-ag-grid.cjs.map +1 -1
  7. package/dist/step-ag-grid.esm.js +40 -14
  8. package/dist/step-ag-grid.esm.js.map +1 -1
  9. package/package.json +16 -16
  10. package/src/components/Grid.tsx +1 -1
  11. package/src/components/gridForm/GridFormTextArea.tsx +10 -1
  12. package/src/components/gridForm/GridFormTextInput.tsx +10 -1
  13. package/src/contexts/GridContextProvider.tsx +1 -1
  14. package/src/index.ts +1 -0
  15. package/src/lui/FormError.scss +1 -0
  16. package/src/stories/components/ActionButton.stories.tsx +0 -1
  17. package/src/stories/grid/GridCopy.stories.tsx +1 -6
  18. package/src/stories/grid/GridDragRow.stories.tsx +1 -6
  19. package/src/stories/grid/GridFilterButtons.stories.tsx +0 -5
  20. package/src/stories/grid/GridFilterColumnsMultiSelect.stories.tsx +0 -5
  21. package/src/stories/grid/GridInlineText.stories.tsx +0 -5
  22. package/src/stories/grid/GridNoRowsOverlay.stories.tsx +0 -5
  23. package/src/stories/grid/GridNonEditableRow.stories.tsx +0 -5
  24. package/src/stories/grid/GridPinnedRow.stories.tsx +1 -6
  25. package/src/stories/grid/GridPopoutContextMenu.stories.tsx +0 -5
  26. package/src/stories/grid/GridPopoutEditGeneric.stories.tsx +0 -5
  27. package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +0 -5
  28. package/src/stories/grid/GridPopoverEditBearing.stories.tsx +0 -5
  29. package/src/stories/grid/GridPopoverEditDropDown.stories.tsx +0 -5
  30. package/src/stories/grid/GridPopoverEditMultiSelect.stories.tsx +0 -5
  31. package/src/stories/grid/GridPopoverEditMultiSelectGrid.stories.tsx +0 -5
  32. package/src/stories/grid/GridReadOnly.stories.tsx +1 -6
  33. package/src/stories/grid/GridSorting.stories.tsx +1 -6
  34. package/src/stories/grid/GridViewList.stories.tsx +1 -6
  35. package/src/stories/grid/GridViewSelectableList.stories.tsx +1 -6
  36. package/src/stories/grid/gridAutosize/GridAutoSize.stories.tsx +28 -11
  37. package/src/stories/grid/gridAutosize/GridFitSize.stories.tsx +27 -11
  38. package/src/stories/grid/gridAutosize/GridFitSizeFlex.stories.tsx +27 -11
  39. package/src/stories/grid/gridFormInteraction/GridFormDropDownInteraction.stories.tsx +0 -1
  40. package/src/stories/grid/gridFormInteraction/GridFormEditBearingCorrectionInteraction.stories.tsx +0 -1
  41. package/src/stories/grid/gridFormInteraction/GridFormEditBearingInteraction.stories.tsx +0 -1
  42. package/src/stories/grid/gridFormInteraction/GridFormMultiSelectGridInteraction.stories.tsx +0 -1
  43. package/src/stories/grid/gridFormInteraction/GridFormMultiSelectInteraction.stories.tsx +0 -1
  44. package/src/stories/grid/gridFormInteraction/GridFormPopoverMenuInteraction.stories.tsx +0 -1
  45. package/src/stories/grid/gridFormInteraction/GridFormTextAreaInteraction.stories.tsx +67 -13
  46. package/src/stories/grid/gridFormInteraction/GridFormTextInputInteraction.stories.tsx +69 -15
  47. package/src/stories/grid/gridFormStatic/GridFormDropDown.stories.tsx +0 -1
  48. package/src/stories/grid/gridFormStatic/GridFormEditBearing.stories.tsx +0 -1
  49. package/src/stories/grid/gridFormStatic/GridFormEditBearingCorrection.stories.tsx +0 -1
  50. package/src/stories/grid/gridFormStatic/GridFormMessage.stories.tsx +0 -1
  51. package/src/stories/grid/gridFormStatic/GridFormMultiSelect.stories.tsx +0 -1
  52. package/src/stories/grid/gridFormStatic/GridFormPopoverMenu.stories.tsx +0 -1
  53. package/src/stories/grid/gridFormStatic/GridFormTextArea.stories.tsx +0 -1
  54. package/src/stories/grid/gridFormStatic/GridFormTextInput.stories.tsx +0 -1
  55. package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +0 -5
  56. package/src/utils/isChromatic.tsx +30 -0
@@ -10,5 +10,6 @@ export interface GridFormTextAreaProps<TData extends GridBaseRow> extends TextIn
10
10
  value: string;
11
11
  }) => Promise<boolean>;
12
12
  helpText?: string;
13
+ disableUnicodeCharacterFilter?: boolean;
13
14
  }
14
15
  export declare const GridFormTextArea: <TData extends GridBaseRow>(props: GridFormTextAreaProps<TData>) => ReactElement;
@@ -10,5 +10,6 @@ export interface GridFormTextInputProps<TData extends GridBaseRow> extends TextI
10
10
  value: string;
11
11
  }) => Promise<boolean>;
12
12
  helpText?: string;
13
+ disableUnicodeCharacterFilter?: boolean;
13
14
  }
14
15
  export declare const GridFormTextInput: <TData extends GridBaseRow>(props: GridFormTextInputProps<TData>) => import("react").JSX.Element;
@@ -14,6 +14,7 @@ export * from './react-menu3/index';
14
14
  export * from './react-menu3/types';
15
15
  export * from './utils/bearing';
16
16
  export * from './utils/deferredPromise';
17
+ export * from './utils/isChromatic';
17
18
  export * from './utils/textMatcher';
18
19
  export * from './utils/textValidator';
19
20
  export * from './utils/util';
@@ -0,0 +1,11 @@
1
+ import type { Decorator } from '@storybook/react-vite';
2
+ export interface WindowChromaticProps {
3
+ FORCE_IS_CHROMATIC?: boolean;
4
+ }
5
+ /**
6
+ * Wraps chromatic's isChromatic(). If window.FORCE_IS_CHROMATIC is set, returns that;
7
+ * otherwise returns whatever the real chromaticIsChromatic() reports.
8
+ */
9
+ export declare const isChromatic: () => boolean;
10
+ /** Story decorator that forces isChromatic() to false for the story's lifetime. */
11
+ export declare const ChromaticAllowGridAutosize: Decorator;
@@ -57824,15 +57824,6 @@ var AgGridReact = class extends React13.Component {
57824
57824
  }
57825
57825
  };
57826
57826
 
57827
- function isChromatic(windowArgument) {
57828
- const windowToCheck = (globalThis.window !== undefined && globalThis);
57829
- return !!(
57830
- windowToCheck &&
57831
- (/Chromatic/.test(windowToCheck.navigator.userAgent) ||
57832
- /chromatic=true/.test(windowToCheck.location.href))
57833
- );
57834
- }
57835
-
57836
57827
  function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
57837
57828
 
57838
57829
  const NoContext = () => {
@@ -57906,6 +57897,29 @@ const GridUpdatingContext = React13.createContext({
57906
57897
  updatedDep: 0
57907
57898
  });
57908
57899
 
57900
+ function isChromatic$1(windowArgument) {
57901
+ const windowToCheck = (globalThis.window !== undefined && globalThis);
57902
+ return !!(
57903
+ windowToCheck &&
57904
+ (/Chromatic/.test(windowToCheck.navigator.userAgent) ||
57905
+ /chromatic=true/.test(windowToCheck.location.href))
57906
+ );
57907
+ }
57908
+
57909
+ const isChromatic = () => {
57910
+ const forced = window.FORCE_IS_CHROMATIC;
57911
+ return forced ?? isChromatic$1();
57912
+ };
57913
+ const ChromaticAllowGridAutosize = (Story) => {
57914
+ window.FORCE_IS_CHROMATIC = false;
57915
+ React13.useEffect(() => {
57916
+ return () => {
57917
+ delete window.FORCE_IS_CHROMATIC;
57918
+ };
57919
+ }, []);
57920
+ return /* @__PURE__ */ jsxRuntime.jsx(Story, {});
57921
+ };
57922
+
57909
57923
  const isStorybook = window.IS_STORYBOOK;
57910
57924
 
57911
57925
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -62706,7 +62720,7 @@ const GridSubComponentContext = React13.createContext({
62706
62720
  context: null
62707
62721
  });
62708
62722
 
62709
- var css_248z$2 = ".FormError{display:flex}.FormError-helpText{color:#6b6966;font-size:.75rem;font-weight:400}.FormError-text-icon{margin-right:4px;margin-top:4px}.FormError-error{align-items:center;color:#2a292c;font-size:14px;font-weight:600;padding-left:0}";
62723
+ var css_248z$2 = ".FormError{display:flex;line-height:24px}.FormError-helpText{color:#6b6966;font-size:.75rem;font-weight:400}.FormError-text-icon{margin-right:4px;margin-top:4px}.FormError-error{align-items:center;color:#2a292c;font-size:14px;font-weight:600;padding-left:0}";
62710
62724
  styleInject(css_248z$2);
62711
62725
 
62712
62726
  const FormError = (props) => {
@@ -64187,6 +64201,7 @@ const GridFormTextArea = (props) => {
64187
64201
  const { field, value: initialVale, data } = useGridPopoverContext();
64188
64202
  const initValue = React13.useMemo(() => initialVale == null ? "" : `${initialVale}`, [initialVale]);
64189
64203
  const [value, setValue] = React13.useState(initValue);
64204
+ const { filterInputEvent } = lui.useFilterCharacters();
64190
64205
  const helpText = props.helpText ?? "Press tab to save";
64191
64206
  const invalid = React13.useCallback(() => TextInputValidator(props, value, data, {}), [props, value, data]);
64192
64207
  const save = React13.useCallback(
@@ -64212,7 +64227,12 @@ const GridFormTextArea = (props) => {
64212
64227
  TextAreaInput,
64213
64228
  {
64214
64229
  value,
64215
- onChange: (e) => setValue(e.target.value),
64230
+ onChange: (e) => {
64231
+ if (!props.disableUnicodeCharacterFilter) {
64232
+ filterInputEvent(e);
64233
+ }
64234
+ setValue(e.target.value);
64235
+ },
64216
64236
  error: invalid(),
64217
64237
  placeholder: props.placeholder ?? "Type here",
64218
64238
  helpText
@@ -64226,6 +64246,7 @@ const GridFormTextInput = (props) => {
64226
64246
  const helpText = props.helpText ?? "Press enter or tab to save";
64227
64247
  const initValue = React13.useMemo(() => initialVale == null ? "" : `${initialVale}`, [initialVale]);
64228
64248
  const [value, setValue] = React13.useState(initValue);
64249
+ const { filterInputEvent } = lui.useFilterCharacters();
64229
64250
  const invalid = React13.useCallback(() => TextInputValidator(props, value, data, {}), [data, props, value]);
64230
64251
  const save = React13.useCallback(
64231
64252
  async (selectedRows) => {
@@ -64254,7 +64275,12 @@ const GridFormTextInput = (props) => {
64254
64275
  TextInputFormatted,
64255
64276
  {
64256
64277
  value,
64257
- onChange: (e) => setValue(e.target.value),
64278
+ onChange: (e) => {
64279
+ if (!props.disableUnicodeCharacterFilter) {
64280
+ filterInputEvent(e);
64281
+ }
64282
+ setValue(e.target.value);
64283
+ },
64258
64284
  error: invalid(),
64259
64285
  formatted: props.units,
64260
64286
  style: { width: props.width ?? 240 },
@@ -65536,6 +65562,7 @@ const useDeferredPromise = () => {
65536
65562
 
65537
65563
  exports.ActionButton = ActionButton;
65538
65564
  exports.CancelPromise = CancelPromise;
65565
+ exports.ChromaticAllowGridAutosize = ChromaticAllowGridAutosize;
65539
65566
  exports.ComponentLoadingWrapper = ComponentLoadingWrapper;
65540
65567
  exports.ControlledMenu = ControlledMenu;
65541
65568
  exports.Editor = Editor;
@@ -65630,6 +65657,7 @@ exports.findParentWithClass = findParentWithClass;
65630
65657
  exports.fnOrVar = fnOrVar;
65631
65658
  exports.generateFilterGetter = generateFilterGetter;
65632
65659
  exports.hasParentClass = hasParentClass;
65660
+ exports.isChromatic = isChromatic;
65633
65661
  exports.isFloat = isFloat;
65634
65662
  exports.isGridCellFiller = isGridCellFiller;
65635
65663
  exports.isNotEmpty = isNotEmpty;