@linzjs/step-ag-grid 32.4.1 → 32.5.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.
- package/dist/src/components/gridForm/GridFormTextArea.d.ts +1 -0
- package/dist/src/components/gridForm/GridFormTextInput.d.ts +1 -0
- package/dist/step-ag-grid.cjs +18 -4
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +19 -5
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +3 -1
- package/src/components/gridForm/GridFormTextArea.tsx +10 -1
- package/src/components/gridForm/GridFormTextInput.tsx +10 -1
- package/src/lui/FormError.scss +1 -0
- package/src/stories/grid/gridFormInteraction/GridFormTextAreaInteraction.stories.tsx +67 -13
- package/src/stories/grid/gridFormInteraction/GridFormTextInputInteraction.stories.tsx +69 -15
|
@@ -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;
|
package/dist/step-ag-grid.cjs
CHANGED
|
@@ -61331,7 +61331,9 @@ const Grid = ({
|
|
|
61331
61331
|
...colDef.cellClassRules,
|
|
61332
61332
|
"GridCell-readonly": (ccp) => !suppressReadOnlyStyle && !editable(ccp)
|
|
61333
61333
|
},
|
|
61334
|
-
|
|
61334
|
+
// If chromatic we fix the size to minWidth if set otherwise 120px
|
|
61335
|
+
// else whatever user has configured which will probably be undefined
|
|
61336
|
+
width: isChromatic() ? colDef.minWidth || 120 : colDef.width
|
|
61335
61337
|
};
|
|
61336
61338
|
}
|
|
61337
61339
|
},
|
|
@@ -62704,7 +62706,7 @@ const GridSubComponentContext = React13.createContext({
|
|
|
62704
62706
|
context: null
|
|
62705
62707
|
});
|
|
62706
62708
|
|
|
62707
|
-
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}";
|
|
62709
|
+
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}";
|
|
62708
62710
|
styleInject(css_248z$2);
|
|
62709
62711
|
|
|
62710
62712
|
const FormError = (props) => {
|
|
@@ -64185,6 +64187,7 @@ const GridFormTextArea = (props) => {
|
|
|
64185
64187
|
const { field, value: initialVale, data } = useGridPopoverContext();
|
|
64186
64188
|
const initValue = React13.useMemo(() => initialVale == null ? "" : `${initialVale}`, [initialVale]);
|
|
64187
64189
|
const [value, setValue] = React13.useState(initValue);
|
|
64190
|
+
const { filterInputEvent } = lui.useFilterCharacters();
|
|
64188
64191
|
const helpText = props.helpText ?? "Press tab to save";
|
|
64189
64192
|
const invalid = React13.useCallback(() => TextInputValidator(props, value, data, {}), [props, value, data]);
|
|
64190
64193
|
const save = React13.useCallback(
|
|
@@ -64210,7 +64213,12 @@ const GridFormTextArea = (props) => {
|
|
|
64210
64213
|
TextAreaInput,
|
|
64211
64214
|
{
|
|
64212
64215
|
value,
|
|
64213
|
-
onChange: (e) =>
|
|
64216
|
+
onChange: (e) => {
|
|
64217
|
+
if (!props.disableUnicodeCharacterFilter) {
|
|
64218
|
+
filterInputEvent(e);
|
|
64219
|
+
}
|
|
64220
|
+
setValue(e.target.value);
|
|
64221
|
+
},
|
|
64214
64222
|
error: invalid(),
|
|
64215
64223
|
placeholder: props.placeholder ?? "Type here",
|
|
64216
64224
|
helpText
|
|
@@ -64224,6 +64232,7 @@ const GridFormTextInput = (props) => {
|
|
|
64224
64232
|
const helpText = props.helpText ?? "Press enter or tab to save";
|
|
64225
64233
|
const initValue = React13.useMemo(() => initialVale == null ? "" : `${initialVale}`, [initialVale]);
|
|
64226
64234
|
const [value, setValue] = React13.useState(initValue);
|
|
64235
|
+
const { filterInputEvent } = lui.useFilterCharacters();
|
|
64227
64236
|
const invalid = React13.useCallback(() => TextInputValidator(props, value, data, {}), [data, props, value]);
|
|
64228
64237
|
const save = React13.useCallback(
|
|
64229
64238
|
async (selectedRows) => {
|
|
@@ -64252,7 +64261,12 @@ const GridFormTextInput = (props) => {
|
|
|
64252
64261
|
TextInputFormatted,
|
|
64253
64262
|
{
|
|
64254
64263
|
value,
|
|
64255
|
-
onChange: (e) =>
|
|
64264
|
+
onChange: (e) => {
|
|
64265
|
+
if (!props.disableUnicodeCharacterFilter) {
|
|
64266
|
+
filterInputEvent(e);
|
|
64267
|
+
}
|
|
64268
|
+
setValue(e.target.value);
|
|
64269
|
+
},
|
|
64256
64270
|
error: invalid(),
|
|
64257
64271
|
formatted: props.units,
|
|
64258
64272
|
style: { width: props.width ?? 240 },
|