@linzjs/step-ag-grid 32.2.0 → 32.3.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/lui/TextInputFormatted.d.ts +1 -0
- package/dist/src/lui/TextInputFormatted.test.d.ts +1 -0
- package/dist/src/utils/textValidator.d.ts +1 -0
- package/dist/step-ag-grid.cjs +34 -4
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +34 -5
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/gridForm/GridFormSubComponentTextInput.tsx +6 -1
- package/src/components/gridForm/GridFormTextInput.tsx +6 -1
- package/src/lui/TextInputFormatted.test.tsx +22 -0
- package/src/lui/TextInputFormatted.tsx +11 -1
- package/src/utils/textValidator.test.ts +45 -1
- package/src/utils/textValidator.ts +21 -0
|
@@ -6,5 +6,6 @@ export interface LuiTextInputProps extends DetailedHTMLProps<InputHTMLAttributes
|
|
|
6
6
|
error?: ReactElement | string | boolean | null;
|
|
7
7
|
formatted?: string;
|
|
8
8
|
allowTabToSave?: boolean;
|
|
9
|
+
validationSummary?: string;
|
|
9
10
|
}
|
|
10
11
|
export declare const TextInputFormatted: (props: LuiTextInputProps) => ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -16,3 +16,4 @@ export interface TextInputValidatorProps<TData extends GridBaseRow> {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
export declare const TextInputValidator: <TData extends GridBaseRow>(props: TextInputValidatorProps<TData>, value: string | null, data: TData, context: any) => string | ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
|
19
|
+
export declare const textInputValidatorPropsToSummary: <TData extends GridBaseRow>(props: TextInputValidatorProps<TData>) => string;
|
package/dist/step-ag-grid.cjs
CHANGED
|
@@ -63209,13 +63209,22 @@ const TextInputFormatted = (props) => {
|
|
|
63209
63209
|
type: "text",
|
|
63210
63210
|
spellCheck: true,
|
|
63211
63211
|
defaultValue: props.value,
|
|
63212
|
-
...lodashEs.omit(props, [
|
|
63212
|
+
...lodashEs.omit(props, [
|
|
63213
|
+
"error",
|
|
63214
|
+
"value",
|
|
63215
|
+
"helpText",
|
|
63216
|
+
"formatted",
|
|
63217
|
+
"className",
|
|
63218
|
+
"allowTabToSave",
|
|
63219
|
+
"validationSummary"
|
|
63220
|
+
]),
|
|
63213
63221
|
className: "LuiTextInput-input",
|
|
63214
63222
|
onMouseEnter: (e) => {
|
|
63215
63223
|
e.currentTarget.focus();
|
|
63216
63224
|
props.onMouseEnter?.(e);
|
|
63217
63225
|
},
|
|
63218
|
-
"data-allowtabtosave": props.allowTabToSave
|
|
63226
|
+
"data-allowtabtosave": props.allowTabToSave,
|
|
63227
|
+
"data-validationsummary": props.validationSummary
|
|
63219
63228
|
}
|
|
63220
63229
|
),
|
|
63221
63230
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "LuiTextInput-formatted", children: props.formatted })
|
|
@@ -63408,6 +63417,24 @@ const TextInputValidator = (props, value, data, context) => {
|
|
|
63408
63417
|
}
|
|
63409
63418
|
return null;
|
|
63410
63419
|
};
|
|
63420
|
+
const textInputValidatorPropsToSummary = (props) => {
|
|
63421
|
+
const parts = [];
|
|
63422
|
+
if (props.required) parts.push("required");
|
|
63423
|
+
if (props.maxLength != null) parts.push(`maxLength=${props.maxLength}`);
|
|
63424
|
+
if (props.maxBytes != null) parts.push(`maxBytes=${props.maxBytes}`);
|
|
63425
|
+
if (props.invalid) parts.push("invalid");
|
|
63426
|
+
const nf = props.numberFormat;
|
|
63427
|
+
if (nf) {
|
|
63428
|
+
if (nf.precision != null) parts.push(`precision=${nf.precision}`);
|
|
63429
|
+
if (nf.scale != null) parts.push(`scale=${nf.scale}`);
|
|
63430
|
+
if (nf.gtMin != null) parts.push(`gtMin=${nf.gtMin}`);
|
|
63431
|
+
if (nf.geMin != null) parts.push(`geMin=${nf.geMin}`);
|
|
63432
|
+
if (nf.ltMax != null) parts.push(`ltMax=${nf.ltMax}`);
|
|
63433
|
+
if (nf.leMax != null) parts.push(`leMax=${nf.leMax}`);
|
|
63434
|
+
if (nf.notZero) parts.push("notZero");
|
|
63435
|
+
}
|
|
63436
|
+
return parts.join(",");
|
|
63437
|
+
};
|
|
63411
63438
|
|
|
63412
63439
|
const GridFormInlineTextInput = (props) => {
|
|
63413
63440
|
const { onSave } = props;
|
|
@@ -64133,7 +64160,8 @@ const GridFormSubComponentTextInput = (props) => {
|
|
|
64133
64160
|
helpText,
|
|
64134
64161
|
placeholder: props.placeholder,
|
|
64135
64162
|
style: { width: "100%" },
|
|
64136
|
-
allowTabToSave: true
|
|
64163
|
+
allowTabToSave: true,
|
|
64164
|
+
validationSummary: textInputValidatorPropsToSummary(props)
|
|
64137
64165
|
}
|
|
64138
64166
|
);
|
|
64139
64167
|
};
|
|
@@ -64214,7 +64242,8 @@ const GridFormTextInput = (props) => {
|
|
|
64214
64242
|
formatted: props.units,
|
|
64215
64243
|
style: { width: props.width ?? 240 },
|
|
64216
64244
|
placeholder: props.placeholder ?? "Type here",
|
|
64217
|
-
helpText
|
|
64245
|
+
helpText,
|
|
64246
|
+
validationSummary: textInputValidatorPropsToSummary(props)
|
|
64218
64247
|
}
|
|
64219
64248
|
) })
|
|
64220
64249
|
);
|
|
@@ -65583,6 +65612,7 @@ exports.reorderRows = reorderRows;
|
|
|
65583
65612
|
exports.sanitiseFileName = sanitiseFileName;
|
|
65584
65613
|
exports.stringByteLengthIsInvalid = stringByteLengthIsInvalid;
|
|
65585
65614
|
exports.suppressCellKeyboardEvents = suppressCellKeyboardEvents;
|
|
65615
|
+
exports.textInputValidatorPropsToSummary = textInputValidatorPropsToSummary;
|
|
65586
65616
|
exports.textMatch = textMatch;
|
|
65587
65617
|
exports.useDeferredPromise = useDeferredPromise;
|
|
65588
65618
|
exports.useGridContext = useGridContext;
|