@linzjs/step-ag-grid 32.2.0 → 32.4.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 +60 -9
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +60 -10
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +5 -1
- package/src/components/gridForm/GridFormSubComponentTextInput.tsx +6 -1
- package/src/components/gridForm/GridFormTextInput.tsx +6 -1
- package/src/components/gridPopoverEdit/GridButton.tsx +3 -1
- package/src/components/gridPopoverEdit/GridEditBoolean.tsx +5 -1
- package/src/contexts/GridContextProvider.tsx +15 -7
- package/src/lui/TextInputFormatted.test.tsx +22 -0
- package/src/lui/TextInputFormatted.tsx +11 -1
- package/src/stories/grid/GridPopoutEditBoolean.stories.tsx +9 -8
- package/src/utils/textValidator.test.ts +45 -1
- package/src/utils/textValidator.ts +21 -0
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -57822,6 +57822,15 @@ var AgGridReact = class extends Component$1 {
|
|
|
57822
57822
|
}
|
|
57823
57823
|
};
|
|
57824
57824
|
|
|
57825
|
+
function isChromatic(windowArgument) {
|
|
57826
|
+
const windowToCheck = (globalThis.window !== undefined && globalThis);
|
|
57827
|
+
return !!(
|
|
57828
|
+
windowToCheck &&
|
|
57829
|
+
(/Chromatic/.test(windowToCheck.navigator.userAgent) ||
|
|
57830
|
+
/chromatic=true/.test(windowToCheck.location.href))
|
|
57831
|
+
);
|
|
57832
|
+
}
|
|
57833
|
+
|
|
57825
57834
|
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}
|
|
57826
57835
|
|
|
57827
57836
|
const NoContext = () => {
|
|
@@ -61316,7 +61325,8 @@ const Grid = ({
|
|
|
61316
61325
|
cellClassRules: {
|
|
61317
61326
|
...colDef.cellClassRules,
|
|
61318
61327
|
"GridCell-readonly": (ccp) => !suppressReadOnlyStyle && !editable(ccp)
|
|
61319
|
-
}
|
|
61328
|
+
},
|
|
61329
|
+
width: colDef.minWidth || 120
|
|
61320
61330
|
};
|
|
61321
61331
|
}
|
|
61322
61332
|
},
|
|
@@ -61798,7 +61808,9 @@ const Grid = ({
|
|
|
61798
61808
|
const onGridSizeChanged = useCallback(
|
|
61799
61809
|
(event) => {
|
|
61800
61810
|
if (sizeColumns === "fit" || ["auto", "auto-skip-headers"].includes(sizeColumns) && hasSetContentSize.current) {
|
|
61801
|
-
|
|
61811
|
+
if (!isChromatic()) {
|
|
61812
|
+
event.api.sizeColumnsToFit();
|
|
61813
|
+
}
|
|
61802
61814
|
}
|
|
61803
61815
|
},
|
|
61804
61816
|
[sizeColumns]
|
|
@@ -63207,13 +63219,22 @@ const TextInputFormatted = (props) => {
|
|
|
63207
63219
|
type: "text",
|
|
63208
63220
|
spellCheck: true,
|
|
63209
63221
|
defaultValue: props.value,
|
|
63210
|
-
...omit(props, [
|
|
63222
|
+
...omit(props, [
|
|
63223
|
+
"error",
|
|
63224
|
+
"value",
|
|
63225
|
+
"helpText",
|
|
63226
|
+
"formatted",
|
|
63227
|
+
"className",
|
|
63228
|
+
"allowTabToSave",
|
|
63229
|
+
"validationSummary"
|
|
63230
|
+
]),
|
|
63211
63231
|
className: "LuiTextInput-input",
|
|
63212
63232
|
onMouseEnter: (e) => {
|
|
63213
63233
|
e.currentTarget.focus();
|
|
63214
63234
|
props.onMouseEnter?.(e);
|
|
63215
63235
|
},
|
|
63216
|
-
"data-allowtabtosave": props.allowTabToSave
|
|
63236
|
+
"data-allowtabtosave": props.allowTabToSave,
|
|
63237
|
+
"data-validationsummary": props.validationSummary
|
|
63217
63238
|
}
|
|
63218
63239
|
),
|
|
63219
63240
|
/* @__PURE__ */ jsx("span", { className: "LuiTextInput-formatted", children: props.formatted })
|
|
@@ -63406,6 +63427,24 @@ const TextInputValidator = (props, value, data, context) => {
|
|
|
63406
63427
|
}
|
|
63407
63428
|
return null;
|
|
63408
63429
|
};
|
|
63430
|
+
const textInputValidatorPropsToSummary = (props) => {
|
|
63431
|
+
const parts = [];
|
|
63432
|
+
if (props.required) parts.push("required");
|
|
63433
|
+
if (props.maxLength != null) parts.push(`maxLength=${props.maxLength}`);
|
|
63434
|
+
if (props.maxBytes != null) parts.push(`maxBytes=${props.maxBytes}`);
|
|
63435
|
+
if (props.invalid) parts.push("invalid");
|
|
63436
|
+
const nf = props.numberFormat;
|
|
63437
|
+
if (nf) {
|
|
63438
|
+
if (nf.precision != null) parts.push(`precision=${nf.precision}`);
|
|
63439
|
+
if (nf.scale != null) parts.push(`scale=${nf.scale}`);
|
|
63440
|
+
if (nf.gtMin != null) parts.push(`gtMin=${nf.gtMin}`);
|
|
63441
|
+
if (nf.geMin != null) parts.push(`geMin=${nf.geMin}`);
|
|
63442
|
+
if (nf.ltMax != null) parts.push(`ltMax=${nf.ltMax}`);
|
|
63443
|
+
if (nf.leMax != null) parts.push(`leMax=${nf.leMax}`);
|
|
63444
|
+
if (nf.notZero) parts.push("notZero");
|
|
63445
|
+
}
|
|
63446
|
+
return parts.join(",");
|
|
63447
|
+
};
|
|
63409
63448
|
|
|
63410
63449
|
const GridFormInlineTextInput = (props) => {
|
|
63411
63450
|
const { onSave } = props;
|
|
@@ -64131,7 +64170,8 @@ const GridFormSubComponentTextInput = (props) => {
|
|
|
64131
64170
|
helpText,
|
|
64132
64171
|
placeholder: props.placeholder,
|
|
64133
64172
|
style: { width: "100%" },
|
|
64134
|
-
allowTabToSave: true
|
|
64173
|
+
allowTabToSave: true,
|
|
64174
|
+
validationSummary: textInputValidatorPropsToSummary(props)
|
|
64135
64175
|
}
|
|
64136
64176
|
);
|
|
64137
64177
|
};
|
|
@@ -64212,7 +64252,8 @@ const GridFormTextInput = (props) => {
|
|
|
64212
64252
|
formatted: props.units,
|
|
64213
64253
|
style: { width: props.width ?? 240 },
|
|
64214
64254
|
placeholder: props.placeholder ?? "Type here",
|
|
64215
|
-
helpText
|
|
64255
|
+
helpText,
|
|
64256
|
+
validationSummary: textInputValidatorPropsToSummary(props)
|
|
64216
64257
|
}
|
|
64217
64258
|
) })
|
|
64218
64259
|
);
|
|
@@ -64229,7 +64270,9 @@ const ButtonCellRenderer = (props) => {
|
|
|
64229
64270
|
};
|
|
64230
64271
|
api.addEventListener("cellFocused", checkFocus);
|
|
64231
64272
|
return () => {
|
|
64232
|
-
api.
|
|
64273
|
+
if (!api.isDestroyed()) {
|
|
64274
|
+
api.removeEventListener("cellFocused", checkFocus);
|
|
64275
|
+
}
|
|
64233
64276
|
};
|
|
64234
64277
|
}, [api, column, node.rowIndex]);
|
|
64235
64278
|
return /* @__PURE__ */ jsx(
|
|
@@ -64317,7 +64360,11 @@ const BooleanCellRenderer = (props) => {
|
|
|
64317
64360
|
}
|
|
64318
64361
|
};
|
|
64319
64362
|
api.addEventListener("cellFocused", checkFocus);
|
|
64320
|
-
return () =>
|
|
64363
|
+
return () => {
|
|
64364
|
+
if (!api.isDestroyed()) {
|
|
64365
|
+
api.removeEventListener("cellFocused", checkFocus);
|
|
64366
|
+
}
|
|
64367
|
+
};
|
|
64321
64368
|
}, [api, column, node.rowIndex]);
|
|
64322
64369
|
const isDisabled = !fnOrVar(colDef?.editable, props);
|
|
64323
64370
|
const toggleCheckbox = useCallback(() => {
|
|
@@ -64881,6 +64928,9 @@ const GridContextProvider = (props) => {
|
|
|
64881
64928
|
if (!gridApi || gridApi.isDestroyed() || !gridApi.getColumnState()) {
|
|
64882
64929
|
return null;
|
|
64883
64930
|
}
|
|
64931
|
+
if (isChromatic()) {
|
|
64932
|
+
return { width: sumBy(gridApi.getColumnState(), (colState) => colState.hide ? 0 : colState.width ?? 0) };
|
|
64933
|
+
}
|
|
64884
64934
|
try {
|
|
64885
64935
|
const colIdsSet = colIds instanceof Set ? colIds : new Set(colIds);
|
|
64886
64936
|
const getVisibleColStates = () => {
|
|
@@ -64934,7 +64984,7 @@ const GridContextProvider = (props) => {
|
|
|
64934
64984
|
);
|
|
64935
64985
|
const sizeColumnsToFit = useCallback(
|
|
64936
64986
|
(paramsOrGridWidth) => {
|
|
64937
|
-
if (gridApi && !gridApi?.isDestroyed()) {
|
|
64987
|
+
if (gridApi && !gridApi?.isDestroyed() && !isChromatic()) {
|
|
64938
64988
|
gridApi.sizeColumnsToFit(paramsOrGridWidth);
|
|
64939
64989
|
}
|
|
64940
64990
|
},
|
|
@@ -65477,5 +65527,5 @@ const useDeferredPromise = () => {
|
|
|
65477
65527
|
};
|
|
65478
65528
|
};
|
|
65479
65529
|
|
|
65480
|
-
export { ActionButton, CancelPromise, ComponentLoadingWrapper, ControlledMenu, Editor, FocusableItem, FormError, GenericCellEditorComponentWrapper, Grid, GridButton, GridCell, GridCellBearingValueFormatter, GridCellFiller, GridCellFillerColId, GridCellMultiEditor, GridCellMultiSelectClassRules, GridCellRenderer, GridContext, GridContextProvider, GridEditBoolean, GridFilterButtons, GridFilterColumnsMultiSelect, GridFilterColumnsToggle, GridFilterDownloadCsvButton, GridFilterHeaderIconButton, GridFilterQuick, GridFilters, GridFormDropDown, GridFormEditBearing, GridFormInlineTextInput, GridFormMessage, GridFormMultiSelect, GridFormMultiSelectGrid, GridFormPopoverMenu, GridFormSubComponentTextArea, GridFormSubComponentTextInput, GridFormTextArea, GridFormTextInput, GridIcon, GridInlineTextInput, GridLoadableCell, GridNoRowsOverlay, GridNoRowsOverlayFr, GridPopoutEditMultiSelect, GridPopoutEditMultiSelectGrid, GridPopoverContext, GridPopoverContextProvider, GridPopoverEditBearing, GridPopoverEditBearingCorrection, GridPopoverEditBearingCorrectionEditorParams, GridPopoverEditBearingEditorParams, GridPopoverEditDropDown, GridPopoverMenu, GridPopoverMessage, GridPopoverTextArea, GridPopoverTextInput, GridRenderPopoutMenuCell, GridSubComponentContext, GridUpdatingContext, GridUpdatingContextProvider, GridWrapper, Menu, MenuButton, MenuDivider, MenuGroup, MenuHeader, MenuHeaderItem, MenuHeaderString, MenuItem, MenuRadioGroup, MenuSeparator, MenuSeparatorString, PopoutMenuSeparator, SubMenu, TextAreaInput, TextInputFormatted, TextInputValidator, agGridSelectRowColId, bearingCorrectionRangeValidator, bearingCorrectionValueFormatter, bearingNumberParser, bearingRangeValidator, bearingStringValidator, bearingValueFormatter, colStateFlexed, colStateId, colStateNotFlexed, compareNaturalInsensitive, convertDDToDMS, createCheckboxMultiFilterParams, defaultValueFormatter, downloadCsvUseValueFormattersProcessCellCallback, findParentWithClass, fnOrVar, generateFilterGetter, hasParentClass, isFloat, isGridCellFiller, isNotEmpty, primitiveToSelectOption, reorderRows, sanitiseFileName, stringByteLengthIsInvalid, suppressCellKeyboardEvents, textMatch, useDeferredPromise, useGridContext, useGridContextMenu, useGridFilter, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, wait, waitForCondition };
|
|
65530
|
+
export { ActionButton, CancelPromise, ComponentLoadingWrapper, ControlledMenu, Editor, FocusableItem, FormError, GenericCellEditorComponentWrapper, Grid, GridButton, GridCell, GridCellBearingValueFormatter, GridCellFiller, GridCellFillerColId, GridCellMultiEditor, GridCellMultiSelectClassRules, GridCellRenderer, GridContext, GridContextProvider, GridEditBoolean, GridFilterButtons, GridFilterColumnsMultiSelect, GridFilterColumnsToggle, GridFilterDownloadCsvButton, GridFilterHeaderIconButton, GridFilterQuick, GridFilters, GridFormDropDown, GridFormEditBearing, GridFormInlineTextInput, GridFormMessage, GridFormMultiSelect, GridFormMultiSelectGrid, GridFormPopoverMenu, GridFormSubComponentTextArea, GridFormSubComponentTextInput, GridFormTextArea, GridFormTextInput, GridIcon, GridInlineTextInput, GridLoadableCell, GridNoRowsOverlay, GridNoRowsOverlayFr, GridPopoutEditMultiSelect, GridPopoutEditMultiSelectGrid, GridPopoverContext, GridPopoverContextProvider, GridPopoverEditBearing, GridPopoverEditBearingCorrection, GridPopoverEditBearingCorrectionEditorParams, GridPopoverEditBearingEditorParams, GridPopoverEditDropDown, GridPopoverMenu, GridPopoverMessage, GridPopoverTextArea, GridPopoverTextInput, GridRenderPopoutMenuCell, GridSubComponentContext, GridUpdatingContext, GridUpdatingContextProvider, GridWrapper, Menu, MenuButton, MenuDivider, MenuGroup, MenuHeader, MenuHeaderItem, MenuHeaderString, MenuItem, MenuRadioGroup, MenuSeparator, MenuSeparatorString, PopoutMenuSeparator, SubMenu, TextAreaInput, TextInputFormatted, TextInputValidator, agGridSelectRowColId, bearingCorrectionRangeValidator, bearingCorrectionValueFormatter, bearingNumberParser, bearingRangeValidator, bearingStringValidator, bearingValueFormatter, colStateFlexed, colStateId, colStateNotFlexed, compareNaturalInsensitive, convertDDToDMS, createCheckboxMultiFilterParams, defaultValueFormatter, downloadCsvUseValueFormattersProcessCellCallback, findParentWithClass, fnOrVar, generateFilterGetter, hasParentClass, isFloat, isGridCellFiller, isNotEmpty, primitiveToSelectOption, reorderRows, sanitiseFileName, stringByteLengthIsInvalid, suppressCellKeyboardEvents, textInputValidatorPropsToSummary, textMatch, useDeferredPromise, useGridContext, useGridContextMenu, useGridFilter, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, wait, waitForCondition };
|
|
65481
65531
|
//# sourceMappingURL=step-ag-grid.esm.js.map
|