@michalrakus/x-react-web-lib 1.37.1 → 1.37.3

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.
@@ -13,6 +13,9 @@ export interface XAutoCompleteProps extends XFormComponentProps<XObject> {
13
13
  searchBrowse?: JSX.Element;
14
14
  assocForm?: JSX.Element;
15
15
  dropdownButtonEnabled?: boolean;
16
+ insertButtonTooltip?: string;
17
+ updateButtonTooltip?: string;
18
+ searchButtonTooltip?: string;
16
19
  suggestions?: any[];
17
20
  suggestionsLoad?: XSuggestionsLoadProp;
18
21
  lazyLoadMaxRows?: number;
@@ -70,7 +70,7 @@ var XAutoComplete = /** @class */ (function (_super) {
70
70
  // div className="col" nam zabezpeci aby XAutoCompleteBase nezaberal celu dlzku grid-u (ma nastaveny width=100% vdaka "formgroup-inline")
71
71
  return (react_1.default.createElement("div", { className: "field grid" },
72
72
  react_1.default.createElement("label", { htmlFor: this.props.assocField, className: "col-fixed", style: this.getLabelStyle() }, this.getLabel()),
73
- react_1.default.createElement(XAutoCompleteBase_1.XAutoCompleteBase, { value: this.getValue(), onChange: this.onChangeAutoCompleteBase, field: this.props.displayField, itemTemplate: this.props.itemTemplate, searchBrowse: this.props.searchBrowse, valueForm: this.props.assocForm, dropdownButtonEnabled: this.props.dropdownButtonEnabled, idField: xEntityAssoc.idField, readOnly: this.isReadOnly(), error: this.getError(), onErrorChange: this.onErrorChangeAutoCompleteBase, width: this.props.width, scrollHeight: this.props.scrollHeight, suggestions: this.props.suggestions, suggestionsLoad: this.props.suggestionsLoad, lazyLoadMaxRows: this.props.lazyLoadMaxRows, splitQueryValue: this.props.splitQueryValue, minLength: this.props.minLength, suggestionsQuery: { entity: this.xAssoc.entityName, filter: function () { return _this.getFilterBase(_this.props.filter); }, sortField: this.props.sortField, fields: this.props.fields }, inputClassName: this.props.inputClassName, setFocusOnCreate: this.props.setFocusOnCreate })));
73
+ react_1.default.createElement(XAutoCompleteBase_1.XAutoCompleteBase, { value: this.getValue(), onChange: this.onChangeAutoCompleteBase, field: this.props.displayField, itemTemplate: this.props.itemTemplate, searchBrowse: this.props.searchBrowse, valueForm: this.props.assocForm, dropdownButtonEnabled: this.props.dropdownButtonEnabled, insertButtonTooltip: this.props.insertButtonTooltip, updateButtonTooltip: this.props.updateButtonTooltip, searchButtonTooltip: this.props.searchButtonTooltip, idField: xEntityAssoc.idField, readOnly: this.isReadOnly(), error: this.getError(), onErrorChange: this.onErrorChangeAutoCompleteBase, width: this.props.width, scrollHeight: this.props.scrollHeight, suggestions: this.props.suggestions, suggestionsLoad: this.props.suggestionsLoad, lazyLoadMaxRows: this.props.lazyLoadMaxRows, splitQueryValue: this.props.splitQueryValue, minLength: this.props.minLength, suggestionsQuery: { entity: this.xAssoc.entityName, filter: function () { return _this.getFilterBase(_this.props.filter); }, sortField: this.props.sortField, fields: this.props.fields }, inputClassName: this.props.inputClassName, setFocusOnCreate: this.props.setFocusOnCreate })));
74
74
  };
75
75
  return XAutoComplete;
76
76
  }(XFormComponent_1.XFormComponent));
@@ -284,7 +284,7 @@ var XFormDataTable2 = exports.XFormDataTable2 = /** @class */ (function (_super)
284
284
  filterMatchMode = api_1.FilterMatchMode.CONTAINS;
285
285
  }
286
286
  // zatial vsetky ostatne EQUALS
287
- else if (xField.type === "decimal" || xField.type === "number" || xField.type === "date" || xField.type === "datetime" || xField.type === "boolean") {
287
+ else if (xField.type === "decimal" || xField.type === "number" || xField.type === "interval" || xField.type === "date" || xField.type === "datetime" || xField.type === "boolean") {
288
288
  filterMatchMode = api_1.FilterMatchMode.EQUALS;
289
289
  }
290
290
  else {
@@ -18,6 +18,7 @@ exports.XFtsInput = void 0;
18
18
  var react_1 = __importDefault(require("react"));
19
19
  var XInputTextBase_1 = require("./XInputTextBase");
20
20
  var XUtils_1 = require("./XUtils");
21
+ var XLocale_1 = require("./XLocale");
21
22
  var XFtsInput = function (props) {
22
23
  var onChange = function (value) {
23
24
  props.value.value = value;
@@ -25,6 +26,6 @@ var XFtsInput = function (props) {
25
26
  };
26
27
  // TODO - pridat input na zmenu matchMode
27
28
  // we use XInputTextBase - we save onChange calls
28
- return (react_1.default.createElement(XInputTextBase_1.XInputTextBase, { value: props.value.value, onChange: onChange, style: { height: '2.5rem', width: XUtils_1.XUtils.isMobile() ? '7rem' : '17rem' }, className: "m-1" }));
29
+ return (react_1.default.createElement(XInputTextBase_1.XInputTextBase, { value: props.value.value, onChange: onChange, style: { height: '2.5rem', width: XUtils_1.XUtils.isMobile() ? '7rem' : '17rem' }, className: "m-1", placeholder: (0, XLocale_1.xLocaleOption)('searchInAllFields') }));
29
30
  };
30
31
  exports.XFtsInput = XFtsInput;
@@ -96,6 +96,8 @@ export interface XLazyDataTableProps {
96
96
  multilineSwitchInitValue?: XMultilineRenderType;
97
97
  multilineSwitchFewLinesCount?: number;
98
98
  multilineSwitchValue?: [XMultilineRenderType, React.Dispatch<React.SetStateAction<XMultilineRenderType>>];
99
+ headerBodyTop?: React.ReactNode;
100
+ headerBodyLeft?: React.ReactNode;
99
101
  headerBodyRight?: React.ReactNode;
100
102
  searchBrowseParams?: XSearchBrowseParams;
101
103
  width?: string;
@@ -243,7 +243,7 @@ exports.XLazyDataTable = (0, react_1.forwardRef)(function (_a, ref) {
243
243
  filterMatchMode = api_1.FilterMatchMode.CONTAINS;
244
244
  }
245
245
  // zatial vsetky ostatne EQUALS
246
- else if (xField.type === "decimal" || xField.type === "number" || xField.type === "date" || xField.type === "datetime" || xField.type === "boolean") {
246
+ else if (xField.type === "decimal" || xField.type === "number" || xField.type === "interval" || xField.type === "date" || xField.type === "datetime" || xField.type === "boolean") {
247
247
  filterMatchMode = api_1.FilterMatchMode.EQUALS;
248
248
  }
249
249
  else {
@@ -1449,8 +1449,11 @@ exports.XLazyDataTable = (0, react_1.forwardRef)(function (_a, ref) {
1449
1449
  // align-items-center centruje vertikalne (posuva smerom dolu do stredu)
1450
1450
  // x-lazy-datatable-label-right-compensation - vyvazuje label, aby item-y v strede isli aspon priblizne do stredu
1451
1451
  return (react_1.default.createElement("div", null,
1452
+ props.headerBodyTop ?
1453
+ react_1.default.createElement("div", { className: "flex justify-content-center align-items-center" }, props.headerBodyTop) : null,
1452
1454
  react_1.default.createElement("div", { className: "flex justify-content-center align-items-center" },
1453
1455
  props.label ? react_1.default.createElement("div", { className: "x-lazy-datatable-label", style: props.labelStyle }, props.label) : null,
1456
+ props.headerBodyLeft,
1454
1457
  ftsInputValue ? react_1.default.createElement(XFtsInput_1.XFtsInput, { value: ftsInputValue, onChange: function (value) { return setFtsInputValue(value); } }) : null,
1455
1458
  props.showFilterButtons ? react_1.default.createElement(XButton_1.XButton, { key: "filter", icon: isMobile ? "pi pi-search" : undefined, label: !isMobile ? (0, XLocale_1.xLocaleOption)('filter') : undefined, onClick: onClickFilter }) : null,
1456
1459
  props.showFilterButtons ? react_1.default.createElement(XButton_1.XButton, { key: "resetTable", icon: isMobile ? "pi pi-ban" : undefined, label: !isMobile ? (0, XLocale_1.xLocaleOption)('resetTable') : undefined, onClick: onClickResetTable }) : null,
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "en": {
3
+ "searchInAllFields": "Search in all fields",
3
4
  "filter": "Filter",
4
5
  "resetTable": "Reset filter",
5
6
  "addRow": "Add",
@@ -342,11 +342,16 @@ function intervalFromUI(valueString) {
342
342
  else {
343
343
  var posColon = valueString.indexOf(':');
344
344
  if (posColon === -1) {
345
- var minutes = parseInt(valueString);
346
- if (!isNaN(minutes)) {
347
- var hours = Math.floor(minutes / 60);
348
- minutes = minutes - (hours * 60);
349
- valueInterval = { hours: hours, minutes: minutes };
345
+ // for depaul project, we use hours as default value - TODO - some param/env value to have both types of init value
346
+ // let minutes: number = parseInt(valueString);
347
+ // if (!isNaN(minutes)) {
348
+ // const hours = Math.floor(minutes / 60);
349
+ // minutes = minutes - (hours * 60);
350
+ // valueInterval = {hours: hours, minutes: minutes} as IPostgresInterval;
351
+ // }
352
+ var hours = parseInt(valueString);
353
+ if (!isNaN(hours)) {
354
+ valueInterval = { hours: hours, minutes: 0 };
350
355
  }
351
356
  }
352
357
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@michalrakus/x-react-web-lib",
3
- "version": "1.37.1",
3
+ "version": "1.37.3",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "clean": "rimraf lib",