@michalrakus/x-react-web-lib 1.0.0 → 1.2.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 (98) hide show
  1. package/FindParam.d.ts +3 -0
  2. package/FindParam.js +5 -0
  3. package/LICENSE.md +21 -0
  4. package/XButtonIconNarrow.d.ts +3 -0
  5. package/XButtonIconNarrow.js +5 -0
  6. package/XButtonIconSmall.d.ts +3 -0
  7. package/XButtonIconSmall.js +5 -0
  8. package/XFieldChangeEvent.d.ts +3 -0
  9. package/XFieldChangeEvent.js +5 -0
  10. package/XInputTextarea.d.ts +3 -0
  11. package/XInputTextarea.js +5 -0
  12. package/gulpfile.js +5 -0
  13. package/lib/administration/XBrowseMetaBrowse.js +2 -1
  14. package/lib/administration/XBrowseMetaForm.js +4 -2
  15. package/lib/administration/XUserBrowse.js +3 -2
  16. package/lib/administration/XUserForm.js +5 -3
  17. package/lib/components/SearchTableParams.d.ts +8 -2
  18. package/lib/components/SourceCodeLinkEntity.js +3 -2
  19. package/lib/components/XAutoComplete.d.ts +10 -7
  20. package/lib/components/XAutoComplete.js +37 -41
  21. package/lib/components/XAutoCompleteBase.d.ts +8 -5
  22. package/lib/components/XAutoCompleteBase.js +86 -43
  23. package/lib/components/XAutoCompleteDT.d.ts +33 -0
  24. package/lib/components/XAutoCompleteDT.js +141 -0
  25. package/lib/components/XBrowse.js +11 -5
  26. package/lib/components/XButton.d.ts +3 -1
  27. package/lib/components/XButton.js +3 -2
  28. package/lib/components/XButtonIconNarrow.d.ts +10 -0
  29. package/lib/components/XButtonIconNarrow.js +25 -0
  30. package/lib/components/XButtonIconSmall.d.ts +3 -1
  31. package/lib/components/XButtonIconSmall.js +2 -1
  32. package/lib/components/XChangePasswordForm.js +12 -7
  33. package/lib/components/XCheckbox.d.ts +8 -10
  34. package/lib/components/XCheckbox.js +39 -31
  35. package/lib/components/XCheckboxDT.js +2 -1
  36. package/lib/components/XDataTable.js +16 -10
  37. package/lib/components/XDropdown.d.ts +7 -5
  38. package/lib/components/XDropdown.js +24 -45
  39. package/lib/components/XDropdownDT.js +10 -5
  40. package/lib/components/XDropdownDTFilter.js +12 -7
  41. package/lib/components/XDropdownFormDTFilter.js +12 -7
  42. package/lib/components/XEditColumnDialog.js +12 -7
  43. package/lib/components/XErrors.d.ts +1 -0
  44. package/lib/components/XExportRowsDialog.js +13 -8
  45. package/lib/components/XFieldChangeEvent.d.ts +11 -0
  46. package/lib/components/XFieldChangeEvent.js +2 -0
  47. package/lib/components/XFieldSelector.js +11 -6
  48. package/lib/components/XFormBase.d.ts +17 -8
  49. package/lib/components/XFormBase.js +127 -48
  50. package/lib/components/XFormBaseT.js +3 -1
  51. package/lib/components/XFormComponent.d.ts +19 -7
  52. package/lib/components/XFormComponent.js +89 -49
  53. package/lib/components/XFormComponentDT.d.ts +30 -0
  54. package/lib/components/XFormComponentDT.js +119 -0
  55. package/lib/components/XFormDataTable2.d.ts +53 -8
  56. package/lib/components/XFormDataTable2.js +270 -57
  57. package/lib/components/XFormFooter.js +2 -1
  58. package/lib/components/XFormNavigator3.js +18 -7
  59. package/lib/components/XHolders.js +4 -2
  60. package/lib/components/XInput.d.ts +13 -0
  61. package/lib/components/XInput.js +38 -0
  62. package/lib/components/XInputDT.d.ts +11 -0
  63. package/lib/components/XInputDT.js +37 -0
  64. package/lib/components/XInputDate.d.ts +2 -1
  65. package/lib/components/XInputDate.js +7 -4
  66. package/lib/components/XInputDateDT.js +3 -2
  67. package/lib/components/XInputDecimal.d.ts +9 -2
  68. package/lib/components/XInputDecimal.js +63 -45
  69. package/lib/components/XInputDecimalDT.d.ts +10 -8
  70. package/lib/components/XInputDecimalDT.js +59 -36
  71. package/lib/components/XInputText.d.ts +7 -11
  72. package/lib/components/XInputText.js +22 -49
  73. package/lib/components/XInputTextDT.js +4 -4
  74. package/lib/components/XInputTextarea.d.ts +18 -0
  75. package/lib/components/XInputTextarea.js +85 -0
  76. package/lib/components/XLazyDataTable.d.ts +8 -0
  77. package/lib/components/XLazyDataTable.js +187 -85
  78. package/lib/components/XLoginDialog.js +2 -1
  79. package/lib/components/XLoginForm.js +11 -6
  80. package/lib/components/XResponseError.js +4 -2
  81. package/lib/components/XSearchButton.d.ts +8 -7
  82. package/lib/components/XSearchButton.js +32 -51
  83. package/lib/components/XSearchButtonDT.js +15 -10
  84. package/lib/components/XSearchButtonOld.js +13 -8
  85. package/lib/components/XToOneAssocButton.js +2 -1
  86. package/lib/components/XUtils.d.ts +13 -1
  87. package/lib/components/XUtils.js +125 -5
  88. package/lib/components/XUtilsConversions.d.ts +1 -0
  89. package/lib/components/XUtilsConversions.js +24 -3
  90. package/lib/components/XUtilsMetadata.d.ts +4 -1
  91. package/lib/components/XUtilsMetadata.js +62 -14
  92. package/lib/components/useXToken.js +1 -1
  93. package/lib/serverApi/ExportImportParam.d.ts +3 -3
  94. package/lib/serverApi/FindParam.d.ts +12 -14
  95. package/lib/serverApi/FindParam.js +14 -0
  96. package/lib/serverApi/XUtilsCommon.d.ts +1 -0
  97. package/lib/serverApi/XUtilsCommon.js +6 -2
  98. package/package.json +24 -25
@@ -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;
@@ -1,5 +1,7 @@
1
1
  import { ReactChild } from 'react';
2
2
  import { SearchTableParams } from "./SearchTableParams";
3
+ import { XCustomFilter } from "../serverApi/FindParam";
4
+ import { XOnSaveOrCancelProp } from "./XFormBase";
3
5
  export interface XEditModeHandlers {
4
6
  onStart: () => void;
5
7
  onSave: () => void;
@@ -15,6 +17,7 @@ export interface XLazyDataTableProps {
15
17
  dataKey?: string;
16
18
  paginator: boolean;
17
19
  rows: number;
20
+ filterDisplay: "menu" | "row";
18
21
  scrollable: boolean;
19
22
  scrollWidth: string;
20
23
  scrollHeight: string;
@@ -23,7 +26,10 @@ export interface XLazyDataTableProps {
23
26
  onAddRow?: () => void;
24
27
  onEdit?: (selectedRow: any) => void;
25
28
  removeRow?: ((selectedRow: any) => Promise<boolean>) | boolean;
29
+ onRemoveRow?: XOnSaveOrCancelProp;
26
30
  appButtons?: any;
31
+ customFilter?: XCustomFilter;
32
+ initSortField?: string;
27
33
  searchTableParams?: SearchTableParams;
28
34
  width?: string;
29
35
  editMode?: boolean;
@@ -36,6 +42,7 @@ export declare const XLazyDataTable: {
36
42
  defaultProps: {
37
43
  paginator: boolean;
38
44
  rows: number;
45
+ filterDisplay: string;
39
46
  scrollable: boolean;
40
47
  scrollWidth: string;
41
48
  scrollHeight: string;
@@ -47,6 +54,7 @@ export interface XLazyColumnProps {
47
54
  header?: any;
48
55
  align?: "left" | "center" | "right";
49
56
  dropdownInFilter?: boolean;
57
+ showFilterMenu?: boolean;
50
58
  width?: string;
51
59
  }
52
60
  export declare const XLazyColumn: (props: XLazyColumnProps) => null;