@linzjs/step-ag-grid 34.0.1 → 34.0.2
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/step-ag-grid.cjs +18 -3
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +18 -3
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/gridForm/GridFormTextInput.tsx +1 -1
- package/src/lui/TextInputFormatted.tsx +25 -2
- package/src/stories/grid/gridFormStatic/GridFormTextInput.stories.tsx +1 -0
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -63208,7 +63208,18 @@ const GridFormDropDown = (props) => {
|
|
|
63208
63208
|
var css_248z$1 = ".LuiTextInput.GridLuiTextInput{margin-bottom:0}.LuiTextInput-formatted{color:#6b6966;line-height:48px;position:absolute;right:14px;top:0}";
|
|
63209
63209
|
styleInject(css_248z$1);
|
|
63210
63210
|
|
|
63211
|
+
const FORMATTED_GAP = 8;
|
|
63211
63212
|
const TextInputFormatted = (props) => {
|
|
63213
|
+
const formattedRef = useRef(null);
|
|
63214
|
+
const [formattedPadding, setFormattedPadding] = useState(void 0);
|
|
63215
|
+
useLayoutEffect(() => {
|
|
63216
|
+
if (!props.formatted) {
|
|
63217
|
+
setFormattedPadding(void 0);
|
|
63218
|
+
return;
|
|
63219
|
+
}
|
|
63220
|
+
const formattedWidth = formattedRef.current?.offsetWidth ?? 0;
|
|
63221
|
+
setFormattedPadding(formattedWidth + 14 + FORMATTED_GAP);
|
|
63222
|
+
}, [props.formatted]);
|
|
63212
63223
|
return /* @__PURE__ */ jsxs(
|
|
63213
63224
|
"div",
|
|
63214
63225
|
{
|
|
@@ -63217,6 +63228,7 @@ const TextInputFormatted = (props) => {
|
|
|
63217
63228
|
props.error && "hasError",
|
|
63218
63229
|
props.className
|
|
63219
63230
|
),
|
|
63231
|
+
style: { width: props.width, ...props.style },
|
|
63220
63232
|
children: [
|
|
63221
63233
|
/* @__PURE__ */ jsxs("span", { className: "LuiTextInput-inputWrapper", children: [
|
|
63222
63234
|
/* @__PURE__ */ jsx(
|
|
@@ -63227,14 +63239,17 @@ const TextInputFormatted = (props) => {
|
|
|
63227
63239
|
defaultValue: props.value,
|
|
63228
63240
|
...omit(props, [
|
|
63229
63241
|
"error",
|
|
63242
|
+
"width",
|
|
63230
63243
|
"value",
|
|
63231
63244
|
"helpText",
|
|
63232
63245
|
"formatted",
|
|
63233
63246
|
"className",
|
|
63234
63247
|
"allowTabToSave",
|
|
63235
|
-
"validationSummary"
|
|
63248
|
+
"validationSummary",
|
|
63249
|
+
"style"
|
|
63236
63250
|
]),
|
|
63237
63251
|
className: "LuiTextInput-input",
|
|
63252
|
+
style: formattedPadding != null ? { paddingRight: formattedPadding } : void 0,
|
|
63238
63253
|
onMouseEnter: (e) => {
|
|
63239
63254
|
e.currentTarget.focus();
|
|
63240
63255
|
props.onMouseEnter?.(e);
|
|
@@ -63243,7 +63258,7 @@ const TextInputFormatted = (props) => {
|
|
|
63243
63258
|
"data-validationsummary": props.validationSummary
|
|
63244
63259
|
}
|
|
63245
63260
|
),
|
|
63246
|
-
/* @__PURE__ */ jsx("span", { className: "LuiTextInput-formatted", children: props.formatted })
|
|
63261
|
+
/* @__PURE__ */ jsx("span", { className: "LuiTextInput-formatted", ref: formattedRef, children: props.formatted })
|
|
63247
63262
|
] }),
|
|
63248
63263
|
/* @__PURE__ */ jsx(FormError, { error: props.error, helpText: props.helpText })
|
|
63249
63264
|
]
|
|
@@ -64267,8 +64282,8 @@ const GridFormTextInput = (props) => {
|
|
|
64267
64282
|
setValue(e.target.value);
|
|
64268
64283
|
},
|
|
64269
64284
|
error: invalid(),
|
|
64285
|
+
width: props.width ?? 264,
|
|
64270
64286
|
formatted: props.units,
|
|
64271
|
-
style: { width: props.width ?? 240 },
|
|
64272
64287
|
placeholder: props.placeholder ?? "Type here",
|
|
64273
64288
|
helpText,
|
|
64274
64289
|
validationSummary: textInputValidatorPropsToSummary(props)
|