@linzjs/step-ag-grid 2.4.6 → 2.4.8

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.
@@ -1,8 +1,10 @@
1
1
  /// <reference types="react" />
2
+ import "../../styles/GridFormSubComponentTextInput.scss";
2
3
  export interface GridFormSubComponentTextInput {
3
4
  setValue: (value: string) => void;
4
5
  keyDown: (key: string) => void;
5
6
  placeholder?: string;
6
7
  className?: string;
8
+ customHelpText?: string;
7
9
  }
8
- export declare const GridFormSubComponentTextInput: ({ keyDown, placeholder, setValue, className, }: GridFormSubComponentTextInput) => JSX.Element;
10
+ export declare const GridFormSubComponentTextInput: ({ keyDown, placeholder, setValue, className, customHelpText, }: GridFormSubComponentTextInput) => JSX.Element;
@@ -1757,12 +1757,12 @@ var MenuRadioGroup = forwardRef(MenuRadioGroupFr);
1757
1757
 
1758
1758
  var GridUpdatingContext = createContext({
1759
1759
  checkUpdating: function () {
1760
- console.error("Missing UpdatingContext");
1760
+ console.error("Missing GridUpdatingContext");
1761
1761
  return false;
1762
1762
  },
1763
1763
  modifyUpdating: function () { return __awaiter(void 0, void 0, void 0, function () {
1764
1764
  return __generator(this, function (_a) {
1765
- console.error("Missing UpdatingContext");
1765
+ console.error("Missing GridUpdatingContext");
1766
1766
  return [2 /*return*/];
1767
1767
  });
1768
1768
  }); }
@@ -2585,11 +2585,11 @@ function styleInject(css, ref) {
2585
2585
  }
2586
2586
  }
2587
2587
 
2588
- var css_248z$7 = ".AgGridGenericCellRenderer-icon{margin-right:4px}.AgGridGenericCellRenderer-ic_infoIcon{fill:#3a7cdf;margin-right:4px}.AgGridGenericCellRenderer-ic_warningIcon{fill:#ea6a2e;margin-right:4px}";
2589
- styleInject(css_248z$7);
2588
+ var css_248z$8 = ".AgGridGenericCellRenderer-icon{margin-right:4px}.AgGridGenericCellRenderer-ic_infoIcon{fill:#3a7cdf;margin-right:4px}.AgGridGenericCellRenderer-ic_warningIcon{fill:#ea6a2e;margin-right:4px}";
2589
+ styleInject(css_248z$8);
2590
2590
 
2591
- var css_248z$6 = ".GridLoadableCell-container{align-items:center;display:flex}";
2592
- styleInject(css_248z$6);
2591
+ var css_248z$7 = ".GridLoadableCell-container{align-items:center;display:flex}";
2592
+ styleInject(css_248z$7);
2593
2593
 
2594
2594
  var GridLoadableCell = function (props) {
2595
2595
  if (props.isLoading) {
@@ -2813,11 +2813,11 @@ var GridRenderPopoutMenuCell = function (props) {
2813
2813
  return (jsx(GridLoadableCell, __assign({ isLoading: isLoading, className: disabled ? "GridPopoutMenu-burgerDisabled" : "GridPopoutMenu-burger" }, { children: jsx(LuiIcon, { name: "ic_more_vert", alt: "More actions", size: "md" }) })));
2814
2814
  };
2815
2815
 
2816
- var css_248z$5 = ".GridMultiSelect-containerSmall .GridFormMultiSelect-options{max-height:130px;overflow-y:auto}.GridMultiSelect-containerMedium .GridFormMultiSelect-options{max-height:190px;overflow-y:auto}.GridMultiSelect-containerLarge .GridFormMultiSelect-options{max-height:320px;overflow-y:auto}.GridMultiSelect-containerUnlimited .GridFormMultiSelect-options{overflow-y:auto}";
2817
- styleInject(css_248z$5);
2816
+ var css_248z$6 = ".GridMultiSelect-containerSmall .GridFormMultiSelect-options{max-height:130px;overflow-y:auto}.GridMultiSelect-containerMedium .GridFormMultiSelect-options{max-height:190px;overflow-y:auto}.GridMultiSelect-containerLarge .GridFormMultiSelect-options{max-height:320px;overflow-y:auto}.GridMultiSelect-containerUnlimited .GridFormMultiSelect-options{overflow-y:auto}";
2817
+ styleInject(css_248z$6);
2818
2818
 
2819
- var css_248z$4 = ".GridPopoverEditDropDown-containerSmall .GridFormDropDown-options{max-height:120px;overflow-y:auto}.GridPopoverEditDropDown-containerMedium .GridFormDropDown-options{max-height:200px;overflow-y:auto}.GridPopoverEditDropDown-containerLarge .GridFormDropDown-options{max-height:400px;overflow-y:auto}.GridPopoverEditDropDown-containerUnlimited .GridFormDropDown-options{overflow-y:auto}";
2820
- styleInject(css_248z$4);
2819
+ var css_248z$5 = ".GridPopoverEditDropDown-containerSmall .GridFormDropDown-options{max-height:120px;overflow-y:auto}.GridPopoverEditDropDown-containerMedium .GridFormDropDown-options{max-height:200px;overflow-y:auto}.GridPopoverEditDropDown-containerLarge .GridFormDropDown-options{max-height:400px;overflow-y:auto}.GridPopoverEditDropDown-containerUnlimited .GridFormDropDown-options{overflow-y:auto}";
2820
+ styleInject(css_248z$5);
2821
2821
 
2822
2822
  /* global setTimeout, clearTimeout */
2823
2823
 
@@ -2976,7 +2976,11 @@ var GridFormDropDown = function (_props) {
2976
2976
  case 2:
2977
2977
  optionsList = optionsConf === null || optionsConf === void 0 ? void 0 : optionsConf.map(function (item) {
2978
2978
  if (item == null || typeof item == "string" || typeof item == "number") {
2979
- item = { value: item, label: item, disabled: false };
2979
+ item = {
2980
+ value: item,
2981
+ label: item,
2982
+ disabled: false
2983
+ };
2980
2984
  }
2981
2985
  return item;
2982
2986
  });
@@ -3058,9 +3062,9 @@ var GridFormDropDown = function (_props) {
3058
3062
  var _b;
3059
3063
  var ref = _a.ref;
3060
3064
  return (jsx("div", __assign({ style: { display: "flex", width: "100%" } }, { children: jsx("input", { autoFocus: true, className: "free-text-input", style: { border: "0px" }, ref: ref, type: "text", placeholder: (_b = props.filterPlaceholder) !== null && _b !== void 0 ? _b : "Placeholder", "data-testid": "filteredMenu-free-text-input", defaultValue: filter, onChange: function (e) { return setFilter(e.target.value.toLowerCase()); }, onKeyDown: function (e) { return onFilterKeyDown(e); } }) })));
3061
- } })), jsx(MenuDivider, {}, "$$divider_filter")] }))), jsx(ComponentLoadingWrapper, __assign({ loading: !options, className: "GridFormDropDown-options" }, { children: jsxs(Fragment$1, { children: [options && options.length == (filteredValues === null || filteredValues === void 0 ? void 0 : filteredValues.length) && jsx(MenuItem, { children: "[Empty]" }), options === null || options === void 0 ? void 0 : options.map(function (item, index) {
3065
+ } })), jsx(MenuDivider, {}, "$$divider_filter")] }))), jsx(ComponentLoadingWrapper, __assign({ loading: !options, className: "GridFormDropDown-options" }, { children: jsxs(Fragment$1, { children: [options && options.length == (filteredValues === null || filteredValues === void 0 ? void 0 : filteredValues.length) && (jsx(MenuItem, { children: "[Empty]" }, "".concat(props.field, "-empty"))), options === null || options === void 0 ? void 0 : options.map(function (item, index) {
3062
3066
  var _a;
3063
- return item.value === MenuSeparatorString ? (jsx(MenuDivider, {}, "$$divider_".concat(index))) : item.value === MenuHeaderString ? (jsx(MenuHeader, { children: item.label })) : filteredValues.includes(item.value) ? null : (jsx(Fragment$1, { children: !item.subComponent ? (jsx(MenuItem, __assign({ disabled: !!item.disabled, title: item.disabled && typeof item.disabled !== "boolean" ? item.disabled : "", value: item.value, onClick: function () {
3067
+ return item.value === MenuSeparatorString ? (jsx(MenuDivider, {}, "$$divider_".concat(index))) : item.value === MenuHeaderString ? (jsx(MenuHeader, { children: item.label }, "$$header_".concat(index))) : filteredValues.includes(item.value) ? null : (jsx("div", { children: !item.subComponent ? (jsx(MenuItem, __assign({ disabled: !!item.disabled, title: item.disabled && typeof item.disabled !== "boolean" ? item.disabled : "", value: item.value, onClick: function () {
3064
3068
  selectItemHandler(item.value);
3065
3069
  } }, { children: (_a = item.label) !== null && _a !== void 0 ? _a : (item.value == null ? "<".concat(item.value, ">") : "".concat(item.value)) }), "".concat(props.field, "-").concat(index))) : (jsx(FocusableItem, __assign({ className: "LuiDeprecatedForms" }, { children: function (ref) {
3066
3070
  return item.subComponent &&
@@ -3087,13 +3091,14 @@ var GridFormDropDown = function (_props) {
3087
3091
  var optionValue = _a.optionValue;
3088
3092
  return optionValue === item.value;
3089
3093
  });
3090
- if (key === "Enter" && subComponentItem) {
3094
+ if ((key === "Enter" || key === "Tab") && subComponentItem) {
3091
3095
  selectItemHandler(item.value, subComponentItem.subComponentValue);
3092
3096
  ref.closeMenu();
3093
3097
  }
3094
- }
3098
+ },
3099
+ key: "".concat(props.field, "-").concat(index, "_subcomponent_inner")
3095
3100
  }, ref);
3096
- } }), "".concat(props.field, "-").concat(index, "_subcomponent"))) }));
3101
+ } }), "".concat(props.field, "-").concat(index, "_subcomponent"))) }, "menu-wrapper-".concat(index)));
3097
3102
  })] }) }))] }));
3098
3103
  };
3099
3104
 
@@ -3259,8 +3264,8 @@ var GridPopoutEditMultiSelect = function (colDef, props) {
3259
3264
  return GridCell(colDef, __assign(__assign({ editor: GridFormMultiSelect }, props), { editorParams: __assign({ className: "GridMultiSelect-containerMedium" }, props.editorParams) }));
3260
3265
  };
3261
3266
 
3262
- var css_248z$3 = ".GridPopoutMenu-burger{cursor:pointer}.GridPopoutMenu-burger svg{fill:#007198}.GridPopoutMenu-burgerDisabled svg{fill:#989189}";
3263
- styleInject(css_248z$3);
3267
+ var css_248z$4 = ".GridPopoutMenu-burger{cursor:pointer}.GridPopoutMenu-burger svg{fill:#007198}.GridPopoutMenu-burgerDisabled svg{fill:#989189}";
3268
+ styleInject(css_248z$4);
3264
3269
 
3265
3270
  /** Menu configuration types **/
3266
3271
  var PopoutMenuSeparator = Object.freeze({ __isMenuSeparator__: true });
@@ -3338,7 +3343,7 @@ var GridFormPopoverMenu = function (_props) {
3338
3343
  * Popout burger menu
3339
3344
  */
3340
3345
  var GridPopoverMenu = function (colDef, custom) {
3341
- return GridCell(__assign(__assign({ maxWidth: 40, editable: colDef.editable != null ? colDef.editable : true, cellStyle: { "justify-content": "flex-end" }, cellRenderer: GridRenderPopoutMenuCell, cellClass: (custom === null || custom === void 0 ? void 0 : custom.multiEdit) ? GenericMultiEditCellClass : undefined }, colDef), { cellRendererParams: {
3346
+ return GridCell(__assign(__assign({ maxWidth: 40, editable: colDef.editable != null ? colDef.editable : true, cellStyle: { justifyContent: "flex-end" }, cellRenderer: GridRenderPopoutMenuCell, cellClass: (custom === null || custom === void 0 ? void 0 : custom.multiEdit) ? GenericMultiEditCellClass : undefined }, colDef), { cellRendererParams: {
3342
3347
  // Menus open on single click, this parameter is picked up in Grid.tsx
3343
3348
  singleClickEdit: true
3344
3349
  } }), __assign({ editor: GridFormPopoverMenu }, custom));
@@ -3422,11 +3427,11 @@ var convertDDToDMS = function (dd, showPositiveSymbol, addTrailingZeros) {
3422
3427
  return dmsString;
3423
3428
  };
3424
3429
 
3425
- var css_248z$2 = ".GridFormEditBearing-input{width:320px}";
3426
- styleInject(css_248z$2);
3430
+ var css_248z$3 = ".GridFormEditBearing-input{width:320px}";
3431
+ styleInject(css_248z$3);
3427
3432
 
3428
- var css_248z$1 = ".LuiTextInput{margin-bottom:0}.LuiTextInput-formatted{color:#beb9b4;line-height:48px;position:absolute;right:14px;top:0}";
3429
- styleInject(css_248z$1);
3433
+ var css_248z$2 = ".LuiTextInput{margin-bottom:0}.LuiTextInput-formatted{color:#beb9b4;line-height:48px;position:absolute;right:14px;top:0}";
3434
+ styleInject(css_248z$2);
3430
3435
 
3431
3436
  var TextInputFormatted = function (props) {
3432
3437
  return (jsxs("div", __assign({ className: clsx("LuiTextInput Grid-popoverContainer", props.error && "hasError", props.warning && "hasWarning", props.className) }, { children: [jsxs("span", __assign({ className: "LuiTextInput-inputWrapper" }, { children: [jsx("input", __assign({ type: "text", className: "LuiTextInput-input", min: "0", spellCheck: true, defaultValue: props.value, onChange: props.onChange }, props.inputProps)), jsx("span", __assign({ className: "LuiTextInput-formatted" }, { children: props.formatted }))] })), props.error && (jsxs("span", __assign({ className: "LuiTextInput-error" }, { children: [jsx(LuiIcon, { alt: "error", name: "ic_error", className: "LuiTextInput-error-icon", size: "sm", status: "error" }), props.error] }))), props.warning && (jsxs("span", __assign({ className: "LuiTextInput-warning" }, { children: [jsx(LuiIcon, { alt: "warning", name: "ic_warning", className: "LuiTextInput-warning-icon", size: "sm", status: "warning" }), props.warning] })))] })));
@@ -3723,27 +3728,36 @@ var GridPopoverTextInput = function (colDef, params) {
3723
3728
  return GridCell(colDef, __assign({ editor: GridFormTextInput }, params));
3724
3729
  };
3725
3730
 
3731
+ var css_248z$1 = ".GridFormSubComponentTextInput-full-width-input{padding:0;width:100%}";
3732
+ styleInject(css_248z$1);
3733
+
3726
3734
  var GridFormSubComponentTextInput = function (_a) {
3727
- var keyDown = _a.keyDown, placeholder = _a.placeholder, setValue = _a.setValue, className = _a.className;
3735
+ var keyDown = _a.keyDown, placeholder = _a.placeholder, setValue = _a.setValue, className = _a.className, customHelpText = _a.customHelpText;
3728
3736
  var placeholderText = placeholder || "Other...";
3729
- var inputClass = className || "";
3737
+ var helpText = customHelpText || "Press enter or tab to save";
3738
+ var inputClass = className || "GridFormSubComponentTextInput-full-width-input";
3730
3739
  var _b = useState(""), inputValue = _b[0], setInputValue = _b[1];
3731
- return (jsx(Fragment$1, { children: jsx(TextInputFormatted, { className: inputClass, value: inputValue, onChange: function (e) {
3732
- var value = e.target.value;
3733
- setValue(value);
3734
- setInputValue(value);
3735
- }, inputProps: {
3736
- onKeyDown: function (k) { return keyDown(k.key); },
3737
- placeholder: placeholderText,
3738
- onMouseEnter: function (e) {
3739
- if (document.activeElement != e.currentTarget) {
3740
- e.currentTarget.focus();
3740
+ return (jsxs("div", __assign({ style: {
3741
+ display: "flex",
3742
+ flexDirection: "column"
3743
+ } }, { children: [jsx(TextInputFormatted, { className: inputClass, value: inputValue, onChange: function (e) {
3744
+ var value = e.target.value;
3745
+ setValue(value);
3746
+ setInputValue(value);
3747
+ }, inputProps: {
3748
+ onKeyDown: function (k) { return keyDown(k.key); },
3749
+ placeholder: placeholderText,
3750
+ onMouseEnter: function (e) {
3751
+ if (document.activeElement != e.currentTarget) {
3752
+ e.currentTarget.focus();
3753
+ }
3754
+ },
3755
+ style: {
3756
+ width: "100%"
3741
3757
  }
3742
- },
3743
- style: {
3744
- width: "100%"
3745
- }
3746
- } }) }));
3758
+ } }), jsx("span", __assign({ style: {
3759
+ fontSize: "0.75rem"
3760
+ } }, { children: helpText }))] })));
3747
3761
  };
3748
3762
 
3749
3763
  var GridSubComponentTextArea = function (props) {