@michalrakus/x-react-web-lib 1.0.0 → 1.1.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.
Files changed (72) hide show
  1. package/LICENSE.md +21 -0
  2. package/XInputTextarea.d.ts +3 -0
  3. package/XInputTextarea.js +5 -0
  4. package/gulpfile.js +1 -0
  5. package/lib/administration/XBrowseMetaBrowse.js +2 -1
  6. package/lib/administration/XBrowseMetaForm.js +4 -2
  7. package/lib/administration/XUserBrowse.js +3 -2
  8. package/lib/administration/XUserForm.js +5 -3
  9. package/lib/components/SourceCodeLinkEntity.js +3 -2
  10. package/lib/components/XAutoComplete.d.ts +3 -3
  11. package/lib/components/XAutoComplete.js +19 -38
  12. package/lib/components/XAutoCompleteBase.d.ts +1 -1
  13. package/lib/components/XAutoCompleteBase.js +27 -23
  14. package/lib/components/XBrowse.js +11 -5
  15. package/lib/components/XButton.js +2 -1
  16. package/lib/components/XButtonIconSmall.js +2 -1
  17. package/lib/components/XChangePasswordForm.js +12 -7
  18. package/lib/components/XCheckbox.d.ts +8 -10
  19. package/lib/components/XCheckbox.js +39 -31
  20. package/lib/components/XCheckboxDT.js +2 -1
  21. package/lib/components/XDataTable.js +16 -10
  22. package/lib/components/XDropdown.d.ts +4 -3
  23. package/lib/components/XDropdown.js +24 -45
  24. package/lib/components/XDropdownDT.js +10 -5
  25. package/lib/components/XDropdownDTFilter.js +12 -7
  26. package/lib/components/XDropdownFormDTFilter.js +12 -7
  27. package/lib/components/XEditColumnDialog.js +12 -7
  28. package/lib/components/XErrors.d.ts +1 -0
  29. package/lib/components/XExportRowsDialog.js +13 -8
  30. package/lib/components/XFieldSelector.js +11 -6
  31. package/lib/components/XFormBase.d.ts +1 -0
  32. package/lib/components/XFormBase.js +50 -22
  33. package/lib/components/XFormBaseT.js +3 -1
  34. package/lib/components/XFormComponent.d.ts +10 -6
  35. package/lib/components/XFormComponent.js +63 -49
  36. package/lib/components/XFormDataTable2.d.ts +8 -3
  37. package/lib/components/XFormDataTable2.js +115 -32
  38. package/lib/components/XFormFooter.js +2 -1
  39. package/lib/components/XFormNavigator3.js +18 -7
  40. package/lib/components/XHolders.js +4 -2
  41. package/lib/components/XInput.d.ts +13 -0
  42. package/lib/components/XInput.js +38 -0
  43. package/lib/components/XInputDate.js +3 -2
  44. package/lib/components/XInputDateDT.js +3 -2
  45. package/lib/components/XInputDecimal.js +2 -1
  46. package/lib/components/XInputDecimalDT.js +2 -1
  47. package/lib/components/XInputText.d.ts +6 -11
  48. package/lib/components/XInputText.js +17 -50
  49. package/lib/components/XInputTextDT.js +4 -4
  50. package/lib/components/XInputTextarea.d.ts +18 -0
  51. package/lib/components/XInputTextarea.js +85 -0
  52. package/lib/components/XLazyDataTable.d.ts +3 -0
  53. package/lib/components/XLazyDataTable.js +166 -79
  54. package/lib/components/XLoginDialog.js +2 -1
  55. package/lib/components/XLoginForm.js +11 -6
  56. package/lib/components/XResponseError.js +4 -2
  57. package/lib/components/XSearchButton.d.ts +2 -3
  58. package/lib/components/XSearchButton.js +15 -36
  59. package/lib/components/XSearchButtonDT.js +13 -8
  60. package/lib/components/XSearchButtonOld.js +13 -8
  61. package/lib/components/XToOneAssocButton.js +2 -1
  62. package/lib/components/XUtils.d.ts +3 -1
  63. package/lib/components/XUtils.js +32 -5
  64. package/lib/components/XUtilsConversions.js +10 -2
  65. package/lib/components/XUtilsMetadata.d.ts +1 -1
  66. package/lib/components/XUtilsMetadata.js +20 -11
  67. package/lib/components/useXToken.js +1 -1
  68. package/lib/serverApi/ExportImportParam.d.ts +3 -3
  69. package/lib/serverApi/FindParam.d.ts +3 -13
  70. package/lib/serverApi/FindParam.js +14 -0
  71. package/lib/serverApi/XUtilsCommon.js +2 -2
  72. package/package.json +24 -25
@@ -9,7 +9,7 @@ var inputtext_1 = require("primereact/inputtext");
9
9
  var XUtilsConversions_1 = require("./XUtilsConversions");
10
10
  var XUtilsMetadata_1 = require("./XUtilsMetadata");
11
11
  var XUtilsCommon_1 = require("../serverApi/XUtilsCommon");
12
- exports.XInputTextDT = function (props) {
12
+ var XInputTextDT = function (props) {
13
13
  var xField = XUtilsMetadata_1.XUtilsMetadata.getXFieldByPathStr(props.entity, props.field);
14
14
  // ak mame path, field je vzdy readOnly
15
15
  var readOnly;
@@ -21,9 +21,8 @@ exports.XInputTextDT = function (props) {
21
21
  readOnly = props.readOnly !== undefined ? props.readOnly : false;
22
22
  }
23
23
  var onValueChange = function (field, rowData, newValue) {
24
- //console.log("onBodyValueChange");
25
24
  // zmenime hodnotu v modeli (odtial sa hodnota cita)
26
- rowData[field] = XUtilsConversions_1.stringFromUI(newValue);
25
+ rowData[field] = (0, XUtilsConversions_1.stringFromUI)(newValue);
27
26
  // kedze "rowData" je sucastou "props.form.state.object", tak nam staci zavolat setState({object: object}), aby sa zmena prejavila
28
27
  props.form.onObjectDataChange();
29
28
  };
@@ -36,7 +35,8 @@ exports.XInputTextDT = function (props) {
36
35
  rowDataValue = null;
37
36
  }
38
37
  // konvertovat null hodnotu na "" (vo funkcii stringAsUI) je dolezite aby sa prejavila zmena na null v modeli (a tiez aby korektne pridal novy riadok)
39
- fieldValue = XUtilsConversions_1.stringAsUI(rowDataValue);
38
+ fieldValue = (0, XUtilsConversions_1.stringAsUI)(rowDataValue);
40
39
  }
41
40
  return (react_1.default.createElement(inputtext_1.InputText, { id: props.field, value: fieldValue, onChange: function (e) { return onValueChange(props.field, props.rowData, e.target.value); }, readOnly: readOnly, maxLength: xField.length, className: "x-input-to-resize" }));
42
41
  };
42
+ exports.XInputTextDT = XInputTextDT;
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import { XInput, XInputProps } from "./XInput";
3
+ export interface XInputTextareaProps extends XInputProps {
4
+ rows: number;
5
+ cols?: number | "full";
6
+ labelOnTop?: boolean;
7
+ }
8
+ export declare class XInputTextarea extends XInput<XInputTextareaProps> {
9
+ static defaultProps: {
10
+ cols: string;
11
+ labelOnTop: boolean;
12
+ };
13
+ constructor(props: XInputTextareaProps);
14
+ getValue(): string;
15
+ onValueChange(e: any): void;
16
+ getLabelStyle(): React.CSSProperties;
17
+ render(): JSX.Element;
18
+ }
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
28
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.XInputTextarea = void 0;
33
+ var react_1 = __importDefault(require("react"));
34
+ var XUtilsConversions_1 = require("./XUtilsConversions");
35
+ var XInput_1 = require("./XInput");
36
+ var inputtextarea_1 = require("primereact/inputtextarea");
37
+ var XUtils_1 = require("./XUtils");
38
+ var XInputTextarea = /** @class */ (function (_super) {
39
+ __extends(XInputTextarea, _super);
40
+ function XInputTextarea(props) {
41
+ var _this = _super.call(this, props) || this;
42
+ _this.onValueChange = _this.onValueChange.bind(_this);
43
+ return _this;
44
+ }
45
+ XInputTextarea.prototype.getValue = function () {
46
+ // konvertovat null hodnotu na "" (vo funkcii stringAsUI) je dolezite aby sa prejavila zmena na null v modeli
47
+ var value = this.getValueFromObject();
48
+ return (0, XUtilsConversions_1.stringAsUI)(value);
49
+ };
50
+ XInputTextarea.prototype.onValueChange = function (e) {
51
+ var value = (0, XUtilsConversions_1.stringFromUI)(e.target.value);
52
+ this.onValueChangeBase(value);
53
+ };
54
+ XInputTextarea.prototype.getLabelStyle = function () {
55
+ var _a;
56
+ return this.props.labelOnTop ? ((_a = this.props.labelStyle) !== null && _a !== void 0 ? _a : {}) : _super.prototype.getLabelStyle.call(this);
57
+ };
58
+ XInputTextarea.prototype.render = function () {
59
+ var _a;
60
+ var inputStyle = (_a = this.props.inputStyle) !== null && _a !== void 0 ? _a : {};
61
+ var cols;
62
+ if (this.props.cols === "full") {
63
+ cols = undefined;
64
+ // pridame width:100%
65
+ // ak nemame labelOnTop=true, musime odratat sirku labelu, inac sa label dostane nad input (koli flex-wrap: wrap)
66
+ var widthValue = this.props.labelOnTop ? '100%' : "calc(100% - ".concat(XUtils_1.XUtils.FIELD_LABEL_WIDTH, ")");
67
+ XUtils_1.XUtils.addCssPropIfNotExists(inputStyle, { width: widthValue });
68
+ }
69
+ else {
70
+ // TODO - nastavenie cols nefunguje ak labelOnTop=true - vtedy je input roztiahnuty na 100%
71
+ // roztiahnutie na 100% sposobuje .x-inputtextarea-label-on-top {flex-direction: column;}
72
+ // aj tak sa asi vzdy bude pouzivat "full"
73
+ cols = this.props.cols;
74
+ }
75
+ return (react_1.default.createElement("div", { className: !this.props.labelOnTop ? 'field grid' : 'field grid x-inputtextarea-label-on-top' },
76
+ react_1.default.createElement("label", { htmlFor: this.props.field, className: !this.props.labelOnTop ? 'col-fixed' : undefined, style: this.getLabelStyle() }, this.getLabel()),
77
+ react_1.default.createElement(inputtextarea_1.InputTextarea, __assign({ id: this.props.field, value: this.getValue(), onChange: this.onValueChange, readOnly: this.isReadOnly(), maxLength: this.xField.length, style: inputStyle, rows: this.props.rows, cols: cols }, this.getClassNameTooltip()))));
78
+ };
79
+ XInputTextarea.defaultProps = {
80
+ cols: "full",
81
+ labelOnTop: false
82
+ };
83
+ return XInputTextarea;
84
+ }(XInput_1.XInput));
85
+ exports.XInputTextarea = XInputTextarea;
@@ -15,6 +15,7 @@ export interface XLazyDataTableProps {
15
15
  dataKey?: string;
16
16
  paginator: boolean;
17
17
  rows: number;
18
+ filterDisplay: "menu" | "row";
18
19
  scrollable: boolean;
19
20
  scrollWidth: string;
20
21
  scrollHeight: string;
@@ -36,6 +37,7 @@ export declare const XLazyDataTable: {
36
37
  defaultProps: {
37
38
  paginator: boolean;
38
39
  rows: number;
40
+ filterDisplay: string;
39
41
  scrollable: boolean;
40
42
  scrollWidth: string;
41
43
  scrollHeight: string;
@@ -47,6 +49,7 @@ export interface XLazyColumnProps {
47
49
  header?: any;
48
50
  align?: "left" | "center" | "right";
49
51
  dropdownInFilter?: boolean;
52
+ showFilterMenu?: boolean;
50
53
  width?: string;
51
54
  }
52
55
  export declare const XLazyColumn: (props: XLazyColumnProps) => null;