@michalrakus/x-react-web-lib 1.8.0 → 1.10.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 (162) hide show
  1. package/README.md +3 -3
  2. package/XInputInterval.d.ts +3 -0
  3. package/XInputInterval.js +5 -0
  4. package/XInputIntervalBase.d.ts +3 -0
  5. package/XInputIntervalBase.js +5 -0
  6. package/gulpfile.js +84 -82
  7. package/lib/administration/XBrowseMetaBrowse.d.ts +2 -2
  8. package/lib/administration/XBrowseMetaBrowse.js +21 -21
  9. package/lib/administration/XBrowseMetaForm.d.ts +5 -5
  10. package/lib/administration/XBrowseMetaForm.js +63 -63
  11. package/lib/administration/XUserBrowse.d.ts +2 -2
  12. package/lib/administration/XUserBrowse.js +88 -87
  13. package/lib/administration/XUserForm.d.ts +9 -9
  14. package/lib/administration/XUserForm.js +195 -194
  15. package/lib/components/SearchTableParams.d.ts +11 -11
  16. package/lib/components/SearchTableParams.js +2 -2
  17. package/lib/components/SourceCodeLinkEntity.d.ts +4 -4
  18. package/lib/components/SourceCodeLinkEntity.js +14 -14
  19. package/lib/components/XAutoComplete.d.ts +36 -36
  20. package/lib/components/XAutoComplete.js +155 -155
  21. package/lib/components/XAutoCompleteBase.d.ts +45 -45
  22. package/lib/components/XAutoCompleteBase.js +371 -371
  23. package/lib/components/XAutoCompleteDT.d.ts +33 -33
  24. package/lib/components/XAutoCompleteDT.js +140 -140
  25. package/lib/components/XBrowse.d.ts +33 -33
  26. package/lib/components/XBrowse.js +360 -360
  27. package/lib/components/XButton.d.ts +9 -9
  28. package/lib/components/XButton.js +13 -13
  29. package/lib/components/XButtonIconMedium.d.ts +9 -9
  30. package/lib/components/XButtonIconMedium.js +13 -13
  31. package/lib/components/XButtonIconNarrow.d.ts +10 -10
  32. package/lib/components/XButtonIconNarrow.js +25 -25
  33. package/lib/components/XButtonIconSmall.d.ts +9 -9
  34. package/lib/components/XButtonIconSmall.js +13 -13
  35. package/lib/components/XCalendar.d.ts +9 -8
  36. package/lib/components/XCalendar.js +27 -27
  37. package/lib/components/XChangePasswordForm.d.ts +5 -5
  38. package/lib/components/XChangePasswordForm.js +160 -160
  39. package/lib/components/XCheckbox.d.ts +8 -8
  40. package/lib/components/XCheckbox.js +57 -57
  41. package/lib/components/XCheckboxDT.d.ts +10 -10
  42. package/lib/components/XCheckboxDT.js +46 -46
  43. package/lib/components/XDataTable.d.ts +11 -11
  44. package/lib/components/XDataTable.js +197 -197
  45. package/lib/components/XDropdown.d.ts +18 -18
  46. package/lib/components/XDropdown.js +57 -57
  47. package/lib/components/XDropdownDT.d.ts +16 -13
  48. package/lib/components/XDropdownDT.js +135 -128
  49. package/lib/components/XDropdownDTFilter.d.ts +7 -7
  50. package/lib/components/XDropdownDTFilter.js +121 -121
  51. package/lib/components/XDropdownForEntity.d.ts +26 -25
  52. package/lib/components/XDropdownForEntity.js +151 -149
  53. package/lib/components/XDropdownFormDTFilter.d.ts +7 -7
  54. package/lib/components/XDropdownFormDTFilter.js +121 -121
  55. package/lib/components/XEditColumnDialog.d.ts +13 -13
  56. package/lib/components/XEditColumnDialog.js +112 -112
  57. package/lib/components/XEnvVars.d.ts +15 -12
  58. package/lib/components/XEnvVars.js +23 -20
  59. package/lib/components/XErrors.d.ts +12 -12
  60. package/lib/components/XErrors.js +2 -2
  61. package/lib/components/XExportRowsDialog.d.ts +15 -15
  62. package/lib/components/XExportRowsDialog.js +184 -184
  63. package/lib/components/XFieldChangeEvent.d.ts +11 -11
  64. package/lib/components/XFieldChangeEvent.js +2 -2
  65. package/lib/components/XFieldSelector.d.ts +7 -7
  66. package/lib/components/XFieldSelector.js +113 -113
  67. package/lib/components/XFormBase.d.ts +68 -59
  68. package/lib/components/XFormBase.js +613 -526
  69. package/lib/components/XFormBaseModif.d.ts +5 -5
  70. package/lib/components/XFormBaseModif.js +33 -33
  71. package/lib/components/XFormBaseT.d.ts +4 -4
  72. package/lib/components/XFormBaseT.js +31 -31
  73. package/lib/components/XFormComponent.d.ts +40 -40
  74. package/lib/components/XFormComponent.js +177 -177
  75. package/lib/components/XFormComponentDT.d.ts +30 -30
  76. package/lib/components/XFormComponentDT.js +145 -145
  77. package/lib/components/XFormDataTable2.d.ts +144 -143
  78. package/lib/components/XFormDataTable2.js +679 -686
  79. package/lib/components/XFormFooter.d.ts +6 -6
  80. package/lib/components/XFormFooter.js +19 -19
  81. package/lib/components/XFormNavigator3.d.ts +12 -12
  82. package/lib/components/XFormNavigator3.js +130 -130
  83. package/lib/components/XHolders.d.ts +7 -7
  84. package/lib/components/XHolders.js +15 -15
  85. package/lib/components/XInput.d.ts +13 -13
  86. package/lib/components/XInput.js +38 -38
  87. package/lib/components/XInputDT.d.ts +11 -11
  88. package/lib/components/XInputDT.js +37 -37
  89. package/lib/components/XInputDate.d.ts +13 -13
  90. package/lib/components/XInputDate.js +63 -63
  91. package/lib/components/XInputDateDT.d.ts +10 -10
  92. package/lib/components/XInputDateDT.js +55 -55
  93. package/lib/components/XInputDecimal.d.ts +15 -15
  94. package/lib/components/XInputDecimal.js +78 -78
  95. package/lib/components/XInputDecimalBase.d.ts +12 -12
  96. package/lib/components/XInputDecimalBase.js +18 -18
  97. package/lib/components/XInputDecimalDT.d.ts +11 -11
  98. package/lib/components/XInputDecimalDT.js +74 -74
  99. package/lib/components/XInputFileList.d.ts +36 -36
  100. package/lib/components/XInputFileList.js +251 -251
  101. package/lib/components/XInputInterval.d.ts +14 -0
  102. package/lib/components/XInputInterval.js +56 -0
  103. package/lib/components/XInputIntervalBase.d.ts +10 -0
  104. package/lib/components/XInputIntervalBase.js +97 -0
  105. package/lib/components/XInputIntervalDT.d.ts +11 -0
  106. package/lib/components/XInputIntervalDT.js +43 -0
  107. package/lib/components/XInputText.d.ts +12 -12
  108. package/lib/components/XInputText.js +69 -69
  109. package/lib/components/XInputTextDT.d.ts +9 -9
  110. package/lib/components/XInputTextDT.js +42 -42
  111. package/lib/components/XInputTextarea.d.ts +18 -18
  112. package/lib/components/XInputTextarea.js +85 -85
  113. package/lib/components/XLazyDataTable.d.ts +78 -78
  114. package/lib/components/XLazyDataTable.js +899 -885
  115. package/lib/components/XLocale.d.ts +26 -26
  116. package/lib/components/XLocale.js +59 -59
  117. package/lib/components/XLoginDialog.d.ts +8 -8
  118. package/lib/components/XLoginDialog.js +21 -21
  119. package/lib/components/XLoginForm.d.ts +7 -7
  120. package/lib/components/XLoginForm.js +128 -128
  121. package/lib/components/XObject.d.ts +3 -3
  122. package/lib/components/XObject.js +2 -2
  123. package/lib/components/XResponseError.d.ts +11 -11
  124. package/lib/components/XResponseError.js +32 -32
  125. package/lib/components/XSearchButton.d.ts +26 -26
  126. package/lib/components/XSearchButton.js +225 -225
  127. package/lib/components/XSearchButtonDT.d.ts +12 -12
  128. package/lib/components/XSearchButtonDT.js +188 -188
  129. package/lib/components/XSearchButtonOld.d.ts +13 -13
  130. package/lib/components/XSearchButtonOld.js +212 -212
  131. package/lib/components/XToOneAssocButton.d.ts +8 -8
  132. package/lib/components/XToOneAssocButton.js +30 -30
  133. package/lib/components/XToken.d.ts +6 -6
  134. package/lib/components/XToken.js +2 -2
  135. package/lib/components/XUtils.d.ts +84 -74
  136. package/lib/components/XUtils.js +664 -627
  137. package/lib/components/XUtilsConversions.d.ts +15 -12
  138. package/lib/components/XUtilsConversions.js +177 -125
  139. package/lib/components/XUtilsMetadata.d.ts +39 -39
  140. package/lib/components/XUtilsMetadata.js +452 -452
  141. package/lib/components/locale/x-en.json +26 -26
  142. package/lib/components/useXToken.d.ts +2 -2
  143. package/lib/components/useXToken.js +44 -44
  144. package/lib/serverApi/ExportImportParam.d.ts +51 -51
  145. package/lib/serverApi/ExportImportParam.js +34 -34
  146. package/lib/serverApi/FindParam.d.ts +35 -34
  147. package/lib/serverApi/FindParam.js +30 -30
  148. package/lib/serverApi/FindResult.d.ts +8 -8
  149. package/lib/serverApi/FindResult.js +2 -2
  150. package/lib/serverApi/XBrowseMetadata.d.ts +19 -19
  151. package/lib/serverApi/XBrowseMetadata.js +2 -2
  152. package/lib/serverApi/XEntityMetadata.d.ts +35 -35
  153. package/lib/serverApi/XEntityMetadata.js +2 -2
  154. package/lib/serverApi/XFileJsonField.d.ts +6 -6
  155. package/lib/serverApi/XFileJsonField.js +2 -2
  156. package/lib/serverApi/XUser.d.ts +8 -7
  157. package/lib/serverApi/XUser.js +2 -2
  158. package/lib/serverApi/XUserAuthenticationIfc.d.ts +9 -9
  159. package/lib/serverApi/XUserAuthenticationIfc.js +2 -2
  160. package/lib/serverApi/XUtilsCommon.d.ts +14 -13
  161. package/lib/serverApi/XUtilsCommon.js +180 -110
  162. package/package.json +1 -1
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ var __read = (this && this.__read) || function (o, n) {
37
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
38
+ if (!m) return o;
39
+ var i = m.call(o), r, ar = [], e;
40
+ try {
41
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
42
+ }
43
+ catch (error) { e = { error: error }; }
44
+ finally {
45
+ try {
46
+ if (r && !r.done && (m = i["return"])) m.call(i);
47
+ }
48
+ finally { if (e) throw e.error; }
49
+ }
50
+ return ar;
51
+ };
52
+ Object.defineProperty(exports, "__esModule", { value: true });
53
+ exports.XInputIntervalBase = void 0;
54
+ var inputtext_1 = require("primereact/inputtext");
55
+ var react_1 = __importStar(require("react"));
56
+ var XUtilsConversions_1 = require("./XUtilsConversions");
57
+ var XUtils_1 = require("./XUtils");
58
+ // zatial podporuje len hours a minutes - TODO - pridat aj seconds, ale cez nejaky prepinac
59
+ var XInputIntervalBase = function (props) {
60
+ // true, ak uzivatel typuje hodnotu ale hodnota sa este neda skonvertovat na korektny interval (este nevieme vytvorit IPostgresInterval)
61
+ // false, ak uz mame v inpute korektnu hodnotu - vtedy zavolame props.onChange a posleme mu IPostgresInterval
62
+ var _a = __read((0, react_1.useState)(false), 2), inputChanged = _a[0], setInputChanged = _a[1];
63
+ // pouzivane, len ak inputChanged === true, je tu zapisana zmenena hodnota v inpute
64
+ var _b = __read((0, react_1.useState)(undefined), 2), inputValueState = _b[0], setInputValueState = _b[1];
65
+ var onChange = function (e) {
66
+ // conversion to IPostgresInterval will be done in onBlur
67
+ setInputChanged(true);
68
+ setInputValueState(e.target.value);
69
+ };
70
+ var onBlur = function (e) {
71
+ // optimalizacia - testujeme len ak inputChanged === true
72
+ if (inputChanged) {
73
+ // convert e.target.value (e.g. 10:29) into IPostgresInterval (e.g. {hours: 10, minutes: 29})
74
+ var valueInterval = (0, XUtilsConversions_1.intervalFromUI)(e.target.value);
75
+ if (valueInterval === undefined) {
76
+ // user odisiel z inputu a nechal tam nevalidnu hodnotu - zapiseme hodnotu null, nech nemusime kontrolovat field pri validacii
77
+ valueInterval = null;
78
+ }
79
+ props.onChange(valueInterval);
80
+ setInputChanged(false);
81
+ setInputValueState(undefined); // pre poriadok
82
+ }
83
+ };
84
+ var getInputValue = function () {
85
+ var inputValue;
86
+ if (inputChanged) {
87
+ inputValue = inputValueState;
88
+ }
89
+ else {
90
+ inputValue = (0, XUtilsConversions_1.intervalAsUI)(props.value);
91
+ }
92
+ return inputValue;
93
+ };
94
+ // remark - width:'3.5rem' is default, can be overriden by value from props.style, if needed
95
+ return (react_1.default.createElement(inputtext_1.InputText, __assign({ id: props.id, value: getInputValue(), onChange: onChange, onBlur: onBlur, readOnly: props.readOnly }, XUtils_1.XUtils.createErrorProps(props.error), { style: __assign({ width: '3.5rem' }, props.style) })));
96
+ };
97
+ exports.XInputIntervalBase = XInputIntervalBase;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { IPostgresInterval } from "./XUtils";
3
+ import { XInputDT, XInputDTProps } from "./XInputDT";
4
+ export interface XInputIntervalDTProps extends XInputDTProps {
5
+ }
6
+ export declare class XInputIntervalDT extends XInputDT<XInputIntervalDTProps> {
7
+ constructor(props: XInputIntervalDTProps);
8
+ getValue(): IPostgresInterval | null;
9
+ onValueChange(value: IPostgresInterval | null): void;
10
+ render(): JSX.Element;
11
+ }
@@ -0,0 +1,43 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.XInputIntervalDT = void 0;
22
+ var react_1 = __importDefault(require("react"));
23
+ var XInputIntervalBase_1 = require("./XInputIntervalBase");
24
+ var XInputDT_1 = require("./XInputDT");
25
+ var XInputIntervalDT = /** @class */ (function (_super) {
26
+ __extends(XInputIntervalDT, _super);
27
+ function XInputIntervalDT(props) {
28
+ var _this = _super.call(this, props) || this;
29
+ _this.onValueChange = _this.onValueChange.bind(_this);
30
+ return _this;
31
+ }
32
+ XInputIntervalDT.prototype.getValue = function () {
33
+ return this.getValueFromRowData();
34
+ };
35
+ XInputIntervalDT.prototype.onValueChange = function (value) {
36
+ this.onValueChangeBase(value, this.props.onChange);
37
+ };
38
+ XInputIntervalDT.prototype.render = function () {
39
+ return (react_1.default.createElement(XInputIntervalBase_1.XInputIntervalBase, { id: this.props.field, value: this.getValue(), onChange: this.onValueChange, readOnly: this.isReadOnly(), error: this.getError() }));
40
+ };
41
+ return XInputIntervalDT;
42
+ }(XInputDT_1.XInputDT));
43
+ exports.XInputIntervalDT = XInputIntervalDT;
@@ -1,12 +1,12 @@
1
- /// <reference types="react" />
2
- import { XInput, XInputProps } from "./XInput";
3
- export interface XInputTextProps extends XInputProps<string> {
4
- size?: number;
5
- }
6
- export declare class XInputText extends XInput<string, XInputTextProps> {
7
- constructor(props: XInputTextProps);
8
- getValue(): string;
9
- onValueChange(e: any): void;
10
- onBlur(e: any): void;
11
- render(): JSX.Element;
12
- }
1
+ /// <reference types="react" />
2
+ import { XInput, XInputProps } from "./XInput";
3
+ export interface XInputTextProps extends XInputProps<string> {
4
+ size?: number;
5
+ }
6
+ export declare class XInputText extends XInput<string, XInputTextProps> {
7
+ constructor(props: XInputTextProps);
8
+ getValue(): string;
9
+ onValueChange(e: any): void;
10
+ onBlur(e: any): void;
11
+ render(): JSX.Element;
12
+ }
@@ -1,69 +1,69 @@
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.XInputText = void 0;
33
- var react_1 = __importDefault(require("react"));
34
- var XUtilsConversions_1 = require("./XUtilsConversions");
35
- var inputtext_1 = require("primereact/inputtext");
36
- var XInput_1 = require("./XInput");
37
- var XInputText = /** @class */ (function (_super) {
38
- __extends(XInputText, _super);
39
- function XInputText(props) {
40
- var _this = _super.call(this, props) || this;
41
- _this.onValueChange = _this.onValueChange.bind(_this);
42
- _this.onBlur = _this.onBlur.bind(_this);
43
- return _this;
44
- }
45
- XInputText.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
- XInputText.prototype.onValueChange = function (e) {
51
- var value = (0, XUtilsConversions_1.stringFromUI)(e.target.value);
52
- this.onValueChangeBase(value);
53
- };
54
- // nedame do onChange inputu, lebo by sa nas onChange volal po kazdej zmene pismenka
55
- // ak bude treba, mozme este dorobit metodu "onChange2", ktora sa bude volat po kazdej zmene pismenka (asi iba do XInputText)
56
- XInputText.prototype.onBlur = function (e) {
57
- this.callOnChangeFromOnBlur();
58
- };
59
- XInputText.prototype.render = function () {
60
- var _a;
61
- var size = (_a = this.props.size) !== null && _a !== void 0 ? _a : this.xField.length;
62
- // note: style overrides size (width of the input according to character count)
63
- return (react_1.default.createElement("div", { className: "field grid" },
64
- react_1.default.createElement("label", { htmlFor: this.props.field, className: "col-fixed", style: this.getLabelStyle() }, this.getLabel()),
65
- react_1.default.createElement(inputtext_1.InputText, __assign({ id: this.props.field, value: this.getValue(), onChange: this.onValueChange, readOnly: this.isReadOnly(), maxLength: this.xField.length, size: size, style: this.props.inputStyle }, this.getClassNameTooltip(), { onBlur: this.onBlur }))));
66
- };
67
- return XInputText;
68
- }(XInput_1.XInput));
69
- exports.XInputText = XInputText;
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.XInputText = void 0;
33
+ var react_1 = __importDefault(require("react"));
34
+ var XUtilsConversions_1 = require("./XUtilsConversions");
35
+ var inputtext_1 = require("primereact/inputtext");
36
+ var XInput_1 = require("./XInput");
37
+ var XInputText = /** @class */ (function (_super) {
38
+ __extends(XInputText, _super);
39
+ function XInputText(props) {
40
+ var _this = _super.call(this, props) || this;
41
+ _this.onValueChange = _this.onValueChange.bind(_this);
42
+ _this.onBlur = _this.onBlur.bind(_this);
43
+ return _this;
44
+ }
45
+ XInputText.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
+ XInputText.prototype.onValueChange = function (e) {
51
+ var value = (0, XUtilsConversions_1.stringFromUI)(e.target.value);
52
+ this.onValueChangeBase(value);
53
+ };
54
+ // nedame do onChange inputu, lebo by sa nas onChange volal po kazdej zmene pismenka
55
+ // ak bude treba, mozme este dorobit metodu "onChange2", ktora sa bude volat po kazdej zmene pismenka (asi iba do XInputText)
56
+ XInputText.prototype.onBlur = function (e) {
57
+ this.callOnChangeFromOnBlur();
58
+ };
59
+ XInputText.prototype.render = function () {
60
+ var _a;
61
+ var size = (_a = this.props.size) !== null && _a !== void 0 ? _a : this.xField.length;
62
+ // note: style overrides size (width of the input according to character count)
63
+ return (react_1.default.createElement("div", { className: "field grid" },
64
+ react_1.default.createElement("label", { htmlFor: this.props.field, className: "col-fixed", style: this.getLabelStyle() }, this.getLabel()),
65
+ react_1.default.createElement(inputtext_1.InputText, __assign({ id: this.props.field, value: this.getValue(), onChange: this.onValueChange, readOnly: this.isReadOnly(), maxLength: this.xField.length, size: size, style: this.props.inputStyle }, this.getClassNameTooltip(), { onBlur: this.onBlur }))));
66
+ };
67
+ return XInputText;
68
+ }(XInput_1.XInput));
69
+ exports.XInputText = XInputText;
@@ -1,9 +1,9 @@
1
- /// <reference types="react" />
2
- import { XFormBase } from "./XFormBase";
3
- export declare const XInputTextDT: (props: {
4
- form: XFormBase;
5
- entity: string;
6
- field: string;
7
- rowData: any;
8
- readOnly?: boolean | undefined;
9
- }) => JSX.Element;
1
+ /// <reference types="react" />
2
+ import { XFormBase } from "./XFormBase";
3
+ export declare const XInputTextDT: (props: {
4
+ form: XFormBase;
5
+ entity: string;
6
+ field: string;
7
+ rowData: any;
8
+ readOnly?: boolean | undefined;
9
+ }) => JSX.Element;
@@ -1,42 +1,42 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.XInputTextDT = void 0;
7
- var react_1 = __importDefault(require("react"));
8
- var inputtext_1 = require("primereact/inputtext");
9
- var XUtilsConversions_1 = require("./XUtilsConversions");
10
- var XUtilsMetadata_1 = require("./XUtilsMetadata");
11
- var XUtilsCommon_1 = require("../serverApi/XUtilsCommon");
12
- var XInputTextDT = function (props) {
13
- var xField = XUtilsMetadata_1.XUtilsMetadata.getXFieldByPathStr(props.entity, props.field);
14
- // ak mame path, field je vzdy readOnly
15
- var readOnly;
16
- var posDot = props.field.indexOf(".");
17
- if (posDot !== -1) {
18
- readOnly = true;
19
- }
20
- else {
21
- readOnly = props.readOnly !== undefined ? props.readOnly : false;
22
- }
23
- var onValueChange = function (field, rowData, newValue) {
24
- // zmenime hodnotu v modeli (odtial sa hodnota cita)
25
- rowData[field] = (0, XUtilsConversions_1.stringFromUI)(newValue);
26
- // kedze "rowData" je sucastou "props.form.state.object", tak nam staci zavolat setState({object: object}), aby sa zmena prejavila
27
- props.form.onObjectDataChange();
28
- };
29
- var fieldValue = "";
30
- // test na undefined je tu koli insertu noveho riadku
31
- if (props.rowData !== undefined && props.rowData !== null) {
32
- var rowDataValue = XUtilsCommon_1.XUtilsCommon.getValueByPath(props.rowData, props.field);
33
- // pri inserte noveho riadku su (zatial) vsetky fieldy undefined, dame na null, null je standard
34
- if (rowDataValue === undefined) {
35
- rowDataValue = null;
36
- }
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)
38
- fieldValue = (0, XUtilsConversions_1.stringAsUI)(rowDataValue);
39
- }
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" }));
41
- };
42
- exports.XInputTextDT = XInputTextDT;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.XInputTextDT = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var inputtext_1 = require("primereact/inputtext");
9
+ var XUtilsConversions_1 = require("./XUtilsConversions");
10
+ var XUtilsMetadata_1 = require("./XUtilsMetadata");
11
+ var XUtilsCommon_1 = require("../serverApi/XUtilsCommon");
12
+ var XInputTextDT = function (props) {
13
+ var xField = XUtilsMetadata_1.XUtilsMetadata.getXFieldByPathStr(props.entity, props.field);
14
+ // ak mame path, field je vzdy readOnly
15
+ var readOnly;
16
+ var posDot = props.field.indexOf(".");
17
+ if (posDot !== -1) {
18
+ readOnly = true;
19
+ }
20
+ else {
21
+ readOnly = props.readOnly !== undefined ? props.readOnly : false;
22
+ }
23
+ var onValueChange = function (field, rowData, newValue) {
24
+ // zmenime hodnotu v modeli (odtial sa hodnota cita)
25
+ rowData[field] = (0, XUtilsConversions_1.stringFromUI)(newValue);
26
+ // kedze "rowData" je sucastou "props.form.state.object", tak nam staci zavolat setState({object: object}), aby sa zmena prejavila
27
+ props.form.onObjectDataChange();
28
+ };
29
+ var fieldValue = "";
30
+ // test na undefined je tu koli insertu noveho riadku
31
+ if (props.rowData !== undefined && props.rowData !== null) {
32
+ var rowDataValue = XUtilsCommon_1.XUtilsCommon.getValueByPath(props.rowData, props.field);
33
+ // pri inserte noveho riadku su (zatial) vsetky fieldy undefined, dame na null, null je standard
34
+ if (rowDataValue === undefined) {
35
+ rowDataValue = null;
36
+ }
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)
38
+ fieldValue = (0, XUtilsConversions_1.stringAsUI)(rowDataValue);
39
+ }
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" }));
41
+ };
42
+ exports.XInputTextDT = XInputTextDT;
@@ -1,18 +1,18 @@
1
- import React from "react";
2
- import { XInput, XInputProps } from "./XInput";
3
- export interface XInputTextareaProps extends XInputProps<string> {
4
- rows: number;
5
- cols?: number | "full";
6
- labelOnTop?: boolean;
7
- }
8
- export declare class XInputTextarea extends XInput<string, 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
- }
1
+ import React from "react";
2
+ import { XInput, XInputProps } from "./XInput";
3
+ export interface XInputTextareaProps extends XInputProps<string> {
4
+ rows: number;
5
+ cols?: number | "full";
6
+ labelOnTop?: boolean;
7
+ }
8
+ export declare class XInputTextarea extends XInput<string, 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
+ }
@@ -1,85 +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
+ "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;