@gpa-gemstone/react-forms 1.1.102 → 1.1.104

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,5 +1,5 @@
1
1
  import { Gemstone } from '@gpa-gemstone/application-typings';
2
- interface IProps<T> extends Gemstone.TSX.Interfaces.IBaseFormProps<T> {
2
+ interface IExtendedProps<T> extends Gemstone.TSX.Interfaces.IBaseFormProps<T> {
3
3
  /**
4
4
  * Field representing the start date in the record
5
5
  * @type {keyof T}
@@ -40,9 +40,11 @@ interface IProps<T> extends Gemstone.TSX.Interfaces.IBaseFormProps<T> {
40
40
  */
41
41
  Type?: ('datetime-local' | 'date');
42
42
  }
43
+ type IProps<T> = Omit<IExtendedProps<T>, "Field">;
43
44
  /**
44
45
  * DateRangePicker Component.
45
46
  * Allows users to select a date range either by choosing predefined durations or by specifying custom dates.
47
+ * @deprecated Use TimeFilter in common-pages instead
46
48
  */
47
49
  export default function DateRangePicker<T>(props: IProps<T>): JSX.Element;
48
50
  export {};
@@ -39,6 +39,7 @@ var moment = require("moment");
39
39
  /**
40
40
  * DateRangePicker Component.
41
41
  * Allows users to select a date range either by choosing predefined durations or by specifying custom dates.
42
+ * @deprecated Use TimeFilter in common-pages instead
42
43
  */
43
44
  function DateRangePicker(props) {
44
45
  // Range box vars, need a secondary var to avoid looping react hooks
package/lib/MultiInput.js CHANGED
@@ -75,7 +75,7 @@ function MultiInput(props) {
75
75
  : null,
76
76
  fieldArray.map(function (r, index) {
77
77
  var _a, _b, _c, _d, _e, _f;
78
- return (React.createElement("div", { className: 'row', key: index },
78
+ return (React.createElement("div", { className: 'row no-gutters', key: index },
79
79
  React.createElement("div", { className: 'col-10' },
80
80
  React.createElement(Input_1.default, { Record: fieldArray, Field: index, Label: index === 0 ? props.Label : '', AllowNull: props.AllowNull, Type: props.Type, Help: index === 0 ? props.Help : undefined, Feedback: (_b = (_a = props.ItemFeedback) === null || _a === void 0 ? void 0 : _a.call(props, r, index, fieldArray)) !== null && _b !== void 0 ? _b : undefined, Valid: function () { var _a, _b; return (_b = (_a = props.ItemValid) === null || _a === void 0 ? void 0 : _a.call(props, r, index, fieldArray)) !== null && _b !== void 0 ? _b : true; }, Style: props.Style, Disabled: props.Disabled, Setter: function (record) {
81
81
  var _a;
@@ -87,7 +87,7 @@ function MultiInput(props) {
87
87
  newArray[index] = record[index];
88
88
  props.Setter(__assign(__assign({}, props.Record), (_a = {}, _a[props.Field] = newArray, _a)));
89
89
  } })),
90
- React.createElement("div", { className: "col-".concat(index === __spreadArray([], fieldArray, true).length - 1 ? 1 : 2, " ").concat(index === 0 ? 'd-flex align-items-center' : '') },
90
+ React.createElement("div", { className: "col-".concat(index === __spreadArray([], fieldArray, true).length - 1 ? 1 : 2, " ").concat(index === 0 ? 'd-flex align-items-center justify-content-center' : '') },
91
91
  React.createElement("button", { className: 'btn', style: ((_c = props.Disabled) !== null && _c !== void 0 ? _c : false) ? { display: 'none' } : undefined, onClick: function () {
92
92
  var _a;
93
93
  var newRecords = __spreadArray([], fieldArray, true).filter(function (_, i) { return i !== index; });
@@ -95,7 +95,7 @@ function MultiInput(props) {
95
95
  } },
96
96
  React.createElement(gpa_symbols_1.ReactIcons.TrashCan, { Color: 'red' }))),
97
97
  index === __spreadArray([], fieldArray, true).length - 1 ?
98
- React.createElement("div", { className: "col-1 ".concat(index === 0 ? 'd-flex align-items-center' : '') },
98
+ React.createElement("div", { className: "col-1 ".concat(index === 0 ? 'd-flex align-items-center justify-content-center' : '') },
99
99
  React.createElement("button", { className: 'btn', style: ((_f = (((_d = props.DisableAdd) !== null && _d !== void 0 ? _d : false) || ((_e = props.Disabled) !== null && _e !== void 0 ? _e : false))) !== null && _f !== void 0 ? _f : false) ? { display: 'none' } : undefined, onClick: function () {
100
100
  var _a;
101
101
  var newRecords = __spreadArray(__spreadArray([], __spreadArray([], fieldArray, true), true), [props.DefaultValue], false);
@@ -37,12 +37,12 @@ var MultiSelect = function (props) {
37
37
  var _b = React.useState(false), show = _b[0], setShow = _b[1];
38
38
  var _c = React.useState(false), showHelp = _c[0], setShowHelp = _c[1];
39
39
  var _d = React.useState(false), showItems = _d[0], setShowItems = _d[1];
40
- var _e = React.useState(""), guid = _e[0], setGuid = _e[1];
41
- var helperGuid = React.useState("")[0];
40
+ var guid = React.useState((0, helper_functions_1.CreateGuid)())[0];
41
+ var helperGuid = React.useState((0, helper_functions_1.CreateGuid)())[0];
42
42
  var showLabel = React.useMemo(function () { return props.Label !== ""; }, [props.Label]);
43
43
  var showHelpIcon = React.useMemo(function () { return props.Help !== undefined; }, [props.Help]);
44
44
  var selectedOptions = React.useMemo(function () { return props.Options.filter(function (opt) { return opt.Selected; }); }, [props.Options]);
45
- var _f = React.useState({ Top: 0, Left: 0, Width: 0, Height: 0 }), position = _f[0], setPosition = _f[1];
45
+ var _e = React.useState({ Top: 0, Left: 0, Width: 0, Height: 0 }), position = _e[0], setPosition = _e[1];
46
46
  React.useEffect(function () {
47
47
  var updatePosition = _.debounce(function () {
48
48
  if (multiSelect.current != null) {
@@ -68,10 +68,6 @@ var MultiSelect = function (props) {
68
68
  };
69
69
  }
70
70
  }, [show]);
71
- // Effect to generate a unique ID for the component.
72
- React.useEffect(function () {
73
- setGuid((0, helper_functions_1.CreateGuid)());
74
- }, []);
75
71
  // Handle showing and hiding of the dropdown.
76
72
  function HandleShow(evt) {
77
73
  if (selectTable.current != null && selectTable.current.contains(evt.target))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gpa-gemstone/react-forms",
3
- "version": "1.1.102",
3
+ "version": "1.1.104",
4
4
  "description": "React Form modules for gpa webapps",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -45,9 +45,9 @@
45
45
  "typescript": "5.5.3"
46
46
  },
47
47
  "dependencies": {
48
- "@gpa-gemstone/application-typings": "0.0.90",
48
+ "@gpa-gemstone/application-typings": "0.0.91",
49
49
  "@gpa-gemstone/gpa-symbols": "0.0.57",
50
- "@gpa-gemstone/helper-functions": "0.0.48",
50
+ "@gpa-gemstone/helper-functions": "0.0.49",
51
51
  "@types/react": "^17.0.14",
52
52
  "@types/styled-components": "^5.1.11",
53
53
  "lodash": "^4.17.21",