@michalrakus/x-react-web-lib 1.8.0 → 1.9.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 (152) hide show
  1. package/README.md +3 -3
  2. package/gulpfile.js +82 -82
  3. package/lib/administration/XBrowseMetaBrowse.d.ts +2 -2
  4. package/lib/administration/XBrowseMetaBrowse.js +21 -21
  5. package/lib/administration/XBrowseMetaForm.d.ts +5 -5
  6. package/lib/administration/XBrowseMetaForm.js +63 -63
  7. package/lib/administration/XUserBrowse.d.ts +2 -2
  8. package/lib/administration/XUserBrowse.js +88 -87
  9. package/lib/administration/XUserForm.d.ts +9 -9
  10. package/lib/administration/XUserForm.js +195 -194
  11. package/lib/components/SearchTableParams.d.ts +11 -11
  12. package/lib/components/SearchTableParams.js +2 -2
  13. package/lib/components/SourceCodeLinkEntity.d.ts +4 -4
  14. package/lib/components/SourceCodeLinkEntity.js +14 -14
  15. package/lib/components/XAutoComplete.d.ts +36 -36
  16. package/lib/components/XAutoComplete.js +155 -155
  17. package/lib/components/XAutoCompleteBase.d.ts +45 -45
  18. package/lib/components/XAutoCompleteBase.js +371 -371
  19. package/lib/components/XAutoCompleteDT.d.ts +33 -33
  20. package/lib/components/XAutoCompleteDT.js +140 -140
  21. package/lib/components/XBrowse.d.ts +33 -33
  22. package/lib/components/XBrowse.js +360 -360
  23. package/lib/components/XButton.d.ts +9 -9
  24. package/lib/components/XButton.js +13 -13
  25. package/lib/components/XButtonIconMedium.d.ts +9 -9
  26. package/lib/components/XButtonIconMedium.js +13 -13
  27. package/lib/components/XButtonIconNarrow.d.ts +10 -10
  28. package/lib/components/XButtonIconNarrow.js +25 -25
  29. package/lib/components/XButtonIconSmall.d.ts +9 -9
  30. package/lib/components/XButtonIconSmall.js +13 -13
  31. package/lib/components/XCalendar.d.ts +8 -8
  32. package/lib/components/XCalendar.js +27 -27
  33. package/lib/components/XChangePasswordForm.d.ts +5 -5
  34. package/lib/components/XChangePasswordForm.js +160 -160
  35. package/lib/components/XCheckbox.d.ts +8 -8
  36. package/lib/components/XCheckbox.js +57 -57
  37. package/lib/components/XCheckboxDT.d.ts +10 -10
  38. package/lib/components/XCheckboxDT.js +46 -46
  39. package/lib/components/XDataTable.d.ts +11 -11
  40. package/lib/components/XDataTable.js +197 -197
  41. package/lib/components/XDropdown.d.ts +18 -18
  42. package/lib/components/XDropdown.js +57 -57
  43. package/lib/components/XDropdownDT.d.ts +13 -13
  44. package/lib/components/XDropdownDT.js +128 -128
  45. package/lib/components/XDropdownDTFilter.d.ts +7 -7
  46. package/lib/components/XDropdownDTFilter.js +121 -121
  47. package/lib/components/XDropdownForEntity.d.ts +25 -25
  48. package/lib/components/XDropdownForEntity.js +149 -149
  49. package/lib/components/XDropdownFormDTFilter.d.ts +7 -7
  50. package/lib/components/XDropdownFormDTFilter.js +121 -121
  51. package/lib/components/XEditColumnDialog.d.ts +13 -13
  52. package/lib/components/XEditColumnDialog.js +112 -112
  53. package/lib/components/XEnvVars.d.ts +15 -12
  54. package/lib/components/XEnvVars.js +23 -20
  55. package/lib/components/XErrors.d.ts +12 -12
  56. package/lib/components/XErrors.js +2 -2
  57. package/lib/components/XExportRowsDialog.d.ts +15 -15
  58. package/lib/components/XExportRowsDialog.js +184 -184
  59. package/lib/components/XFieldChangeEvent.d.ts +11 -11
  60. package/lib/components/XFieldChangeEvent.js +2 -2
  61. package/lib/components/XFieldSelector.d.ts +7 -7
  62. package/lib/components/XFieldSelector.js +113 -113
  63. package/lib/components/XFormBase.d.ts +59 -59
  64. package/lib/components/XFormBase.js +526 -526
  65. package/lib/components/XFormBaseModif.d.ts +5 -5
  66. package/lib/components/XFormBaseModif.js +33 -33
  67. package/lib/components/XFormBaseT.d.ts +4 -4
  68. package/lib/components/XFormBaseT.js +31 -31
  69. package/lib/components/XFormComponent.d.ts +40 -40
  70. package/lib/components/XFormComponent.js +177 -177
  71. package/lib/components/XFormComponentDT.d.ts +30 -30
  72. package/lib/components/XFormComponentDT.js +145 -145
  73. package/lib/components/XFormDataTable2.d.ts +143 -143
  74. package/lib/components/XFormDataTable2.js +686 -686
  75. package/lib/components/XFormFooter.d.ts +6 -6
  76. package/lib/components/XFormFooter.js +19 -19
  77. package/lib/components/XFormNavigator3.d.ts +12 -12
  78. package/lib/components/XFormNavigator3.js +130 -130
  79. package/lib/components/XHolders.d.ts +7 -7
  80. package/lib/components/XHolders.js +15 -15
  81. package/lib/components/XInput.d.ts +13 -13
  82. package/lib/components/XInput.js +38 -38
  83. package/lib/components/XInputDT.d.ts +11 -11
  84. package/lib/components/XInputDT.js +37 -37
  85. package/lib/components/XInputDate.d.ts +13 -13
  86. package/lib/components/XInputDate.js +63 -63
  87. package/lib/components/XInputDateDT.d.ts +10 -10
  88. package/lib/components/XInputDateDT.js +55 -55
  89. package/lib/components/XInputDecimal.d.ts +15 -15
  90. package/lib/components/XInputDecimal.js +78 -78
  91. package/lib/components/XInputDecimalBase.d.ts +12 -12
  92. package/lib/components/XInputDecimalBase.js +18 -18
  93. package/lib/components/XInputDecimalDT.d.ts +11 -11
  94. package/lib/components/XInputDecimalDT.js +74 -74
  95. package/lib/components/XInputFileList.d.ts +36 -36
  96. package/lib/components/XInputFileList.js +251 -251
  97. package/lib/components/XInputText.d.ts +12 -12
  98. package/lib/components/XInputText.js +69 -69
  99. package/lib/components/XInputTextDT.d.ts +9 -9
  100. package/lib/components/XInputTextDT.js +42 -42
  101. package/lib/components/XInputTextarea.d.ts +18 -18
  102. package/lib/components/XInputTextarea.js +85 -85
  103. package/lib/components/XLazyDataTable.d.ts +78 -78
  104. package/lib/components/XLazyDataTable.js +885 -885
  105. package/lib/components/XLocale.d.ts +26 -26
  106. package/lib/components/XLocale.js +59 -59
  107. package/lib/components/XLoginDialog.d.ts +8 -8
  108. package/lib/components/XLoginDialog.js +21 -21
  109. package/lib/components/XLoginForm.d.ts +7 -7
  110. package/lib/components/XLoginForm.js +128 -128
  111. package/lib/components/XObject.d.ts +3 -3
  112. package/lib/components/XObject.js +2 -2
  113. package/lib/components/XResponseError.d.ts +11 -11
  114. package/lib/components/XResponseError.js +32 -32
  115. package/lib/components/XSearchButton.d.ts +26 -26
  116. package/lib/components/XSearchButton.js +225 -225
  117. package/lib/components/XSearchButtonDT.d.ts +12 -12
  118. package/lib/components/XSearchButtonDT.js +188 -188
  119. package/lib/components/XSearchButtonOld.d.ts +13 -13
  120. package/lib/components/XSearchButtonOld.js +212 -212
  121. package/lib/components/XToOneAssocButton.d.ts +8 -8
  122. package/lib/components/XToOneAssocButton.js +30 -30
  123. package/lib/components/XToken.d.ts +6 -6
  124. package/lib/components/XToken.js +2 -2
  125. package/lib/components/XUtils.d.ts +74 -74
  126. package/lib/components/XUtils.js +627 -627
  127. package/lib/components/XUtilsConversions.d.ts +12 -12
  128. package/lib/components/XUtilsConversions.js +125 -125
  129. package/lib/components/XUtilsMetadata.d.ts +39 -39
  130. package/lib/components/XUtilsMetadata.js +452 -452
  131. package/lib/components/locale/x-en.json +26 -26
  132. package/lib/components/useXToken.d.ts +2 -2
  133. package/lib/components/useXToken.js +44 -44
  134. package/lib/serverApi/ExportImportParam.d.ts +51 -51
  135. package/lib/serverApi/ExportImportParam.js +34 -34
  136. package/lib/serverApi/FindParam.d.ts +34 -34
  137. package/lib/serverApi/FindParam.js +30 -30
  138. package/lib/serverApi/FindResult.d.ts +8 -8
  139. package/lib/serverApi/FindResult.js +2 -2
  140. package/lib/serverApi/XBrowseMetadata.d.ts +19 -19
  141. package/lib/serverApi/XBrowseMetadata.js +2 -2
  142. package/lib/serverApi/XEntityMetadata.d.ts +35 -35
  143. package/lib/serverApi/XEntityMetadata.js +2 -2
  144. package/lib/serverApi/XFileJsonField.d.ts +6 -6
  145. package/lib/serverApi/XFileJsonField.js +2 -2
  146. package/lib/serverApi/XUser.d.ts +8 -7
  147. package/lib/serverApi/XUser.js +2 -2
  148. package/lib/serverApi/XUserAuthenticationIfc.d.ts +9 -9
  149. package/lib/serverApi/XUserAuthenticationIfc.js +2 -2
  150. package/lib/serverApi/XUtilsCommon.d.ts +13 -13
  151. package/lib/serverApi/XUtilsCommon.js +110 -110
  152. package/package.json +1 -1
@@ -1,63 +1,63 @@
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.XInputDate = void 0;
22
- var react_1 = __importDefault(require("react"));
23
- var XCalendar_1 = require("./XCalendar");
24
- var XInput_1 = require("./XInput");
25
- var XInputDate = /** @class */ (function (_super) {
26
- __extends(XInputDate, _super);
27
- function XInputDate(props) {
28
- var _this = _super.call(this, props) || this;
29
- _this.onValueChange = _this.onValueChange.bind(_this);
30
- _this.onBlur = _this.onBlur.bind(_this);
31
- return _this;
32
- }
33
- XInputDate.prototype.getValue = function () {
34
- var value = null;
35
- var objectValue = this.getValueFromObject();
36
- // tuto zatial hack, mal by prist Date
37
- if (typeof objectValue === 'string') {
38
- value = new Date(objectValue);
39
- }
40
- else if (typeof objectValue === 'object' && objectValue instanceof Date) {
41
- value = objectValue;
42
- }
43
- // value zostalo null ak nebol vykonany ziaden if
44
- return value;
45
- };
46
- XInputDate.prototype.onValueChange = function (value) {
47
- // z XCalendar prichadza value - typ Date alebo null
48
- this.onValueChangeBase(value);
49
- };
50
- // nedame do onChange inputu, lebo by sa nas onChange volal po kazdej zmene pismenka
51
- // ak bude treba, mozme este dorobit metodu "onChange2", ktora sa bude volat po kazdej zmene pismenka (asi iba do XInputText)
52
- XInputDate.prototype.onBlur = function (e) {
53
- this.callOnChangeFromOnBlur();
54
- };
55
- XInputDate.prototype.render = function () {
56
- // note: style overrides size (width of the input according to character count)
57
- return (react_1.default.createElement("div", { className: "field grid" },
58
- react_1.default.createElement("label", { htmlFor: this.props.field, className: "col-fixed", style: this.getLabelStyle() }, this.getLabel()),
59
- react_1.default.createElement(XCalendar_1.XCalendar, { id: this.props.field, value: this.getValue(), onChange: this.onValueChange, readOnly: this.isReadOnly(), datetime: this.xField.type === 'datetime' })));
60
- };
61
- return XInputDate;
62
- }(XInput_1.XInput));
63
- exports.XInputDate = XInputDate;
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.XInputDate = void 0;
22
+ var react_1 = __importDefault(require("react"));
23
+ var XCalendar_1 = require("./XCalendar");
24
+ var XInput_1 = require("./XInput");
25
+ var XInputDate = /** @class */ (function (_super) {
26
+ __extends(XInputDate, _super);
27
+ function XInputDate(props) {
28
+ var _this = _super.call(this, props) || this;
29
+ _this.onValueChange = _this.onValueChange.bind(_this);
30
+ _this.onBlur = _this.onBlur.bind(_this);
31
+ return _this;
32
+ }
33
+ XInputDate.prototype.getValue = function () {
34
+ var value = null;
35
+ var objectValue = this.getValueFromObject();
36
+ // tuto zatial hack, mal by prist Date
37
+ if (typeof objectValue === 'string') {
38
+ value = new Date(objectValue);
39
+ }
40
+ else if (typeof objectValue === 'object' && objectValue instanceof Date) {
41
+ value = objectValue;
42
+ }
43
+ // value zostalo null ak nebol vykonany ziaden if
44
+ return value;
45
+ };
46
+ XInputDate.prototype.onValueChange = function (value) {
47
+ // z XCalendar prichadza value - typ Date alebo null
48
+ this.onValueChangeBase(value);
49
+ };
50
+ // nedame do onChange inputu, lebo by sa nas onChange volal po kazdej zmene pismenka
51
+ // ak bude treba, mozme este dorobit metodu "onChange2", ktora sa bude volat po kazdej zmene pismenka (asi iba do XInputText)
52
+ XInputDate.prototype.onBlur = function (e) {
53
+ this.callOnChangeFromOnBlur();
54
+ };
55
+ XInputDate.prototype.render = function () {
56
+ // note: style overrides size (width of the input according to character count)
57
+ return (react_1.default.createElement("div", { className: "field grid" },
58
+ react_1.default.createElement("label", { htmlFor: this.props.field, className: "col-fixed", style: this.getLabelStyle() }, this.getLabel()),
59
+ react_1.default.createElement(XCalendar_1.XCalendar, { id: this.props.field, value: this.getValue(), onChange: this.onValueChange, readOnly: this.isReadOnly(), datetime: this.xField.type === 'datetime' })));
60
+ };
61
+ return XInputDate;
62
+ }(XInput_1.XInput));
63
+ exports.XInputDate = XInputDate;
@@ -1,10 +1,10 @@
1
- /// <reference types="react" />
2
- import { XFormBase } from "./XFormBase";
3
- import { XField } from "../serverApi/XEntityMetadata";
4
- export declare const XInputDateDT: (props: {
5
- form: XFormBase;
6
- xField: XField;
7
- field: string;
8
- rowData: any;
9
- readOnly?: boolean | undefined;
10
- }) => JSX.Element;
1
+ /// <reference types="react" />
2
+ import { XFormBase } from "./XFormBase";
3
+ import { XField } from "../serverApi/XEntityMetadata";
4
+ export declare const XInputDateDT: (props: {
5
+ form: XFormBase;
6
+ xField: XField;
7
+ field: string;
8
+ rowData: any;
9
+ readOnly?: boolean | undefined;
10
+ }) => JSX.Element;
@@ -1,55 +1,55 @@
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.XInputDateDT = void 0;
7
- var XUtilsConversions_1 = require("./XUtilsConversions");
8
- var calendar_1 = require("primereact/calendar");
9
- var react_1 = __importDefault(require("react"));
10
- var XUtilsCommon_1 = require("../serverApi/XUtilsCommon");
11
- var XInputDateDT = function (props) {
12
- var showTime = (props.xField.type === 'datetime');
13
- var cssClassName = showTime ? 'x-input-datetime' : 'x-input-date';
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
- // z Calendar prichadza e.value - typ Date alebo null
25
- // zmenime hodnotu v modeli (odtial sa hodnota cita)
26
- rowData[field] = newValue;
27
- // kedze "rowData" je sucastou "props.form.state.object", tak nam staci zavolat setState({object: object}), aby sa zmena prejavila
28
- props.form.onObjectDataChange();
29
- };
30
- var fieldValue = undefined;
31
- // test na undefined je tu koli insertu noveho riadku
32
- if (props.rowData !== undefined && props.rowData !== null) {
33
- var rowDataValue = XUtilsCommon_1.XUtilsCommon.getValueByPath(props.rowData, props.field);
34
- // pre istotu dame na null, null je standard
35
- //if (rowDataValue === undefined) {
36
- // rowDataValue = null;
37
- //}
38
- // TODO - konvertovat null hodnotu na "" (vo funkcii stringAsUI) je dolezite aby sa prejavila zmena na null v modeli
39
- // - otestovat ci zmena na null funguje dobre -
40
- //fieldValue = stringAsUI(rowDataValue);
41
- // tuto zatial hack, mal by prist Date
42
- if (typeof rowDataValue === 'string') {
43
- fieldValue = new Date(rowDataValue);
44
- }
45
- else if (typeof rowDataValue === 'object' && rowDataValue instanceof Date) {
46
- fieldValue = rowDataValue;
47
- }
48
- // fieldValue zostalo undefined (konvertujeme null -> undefined) - Calendar pozaduje undefined, nechce null
49
- }
50
- // TODO - nefunguje dobre pridavanie noveho riadku - su tam stare neupdatnute hodnoty - este to asi neopravili https://github.com/primefaces/primereact/issues/1277
51
- // test mame na TestovaciForm
52
- // appendTo={document.body} appenduje overlay panel na element body - eliminuje problem s overflow (pozri poznamku v XDropdownDTFilter)
53
- return (react_1.default.createElement(calendar_1.Calendar, { appendTo: document.body, id: props.field, value: fieldValue, onChange: function (e) { return onValueChange(props.field, props.rowData, e.value); }, disabled: readOnly, showIcon: true, dateFormat: (0, XUtilsConversions_1.dateFormatCalendar)(), showTime: showTime, showSeconds: showTime, inputClassName: cssClassName, showOnFocus: false }));
54
- };
55
- exports.XInputDateDT = XInputDateDT;
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.XInputDateDT = void 0;
7
+ var XUtilsConversions_1 = require("./XUtilsConversions");
8
+ var calendar_1 = require("primereact/calendar");
9
+ var react_1 = __importDefault(require("react"));
10
+ var XUtilsCommon_1 = require("../serverApi/XUtilsCommon");
11
+ var XInputDateDT = function (props) {
12
+ var showTime = (props.xField.type === 'datetime');
13
+ var cssClassName = showTime ? 'x-input-datetime' : 'x-input-date';
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
+ // z Calendar prichadza e.value - typ Date alebo null
25
+ // zmenime hodnotu v modeli (odtial sa hodnota cita)
26
+ rowData[field] = newValue;
27
+ // kedze "rowData" je sucastou "props.form.state.object", tak nam staci zavolat setState({object: object}), aby sa zmena prejavila
28
+ props.form.onObjectDataChange();
29
+ };
30
+ var fieldValue = undefined;
31
+ // test na undefined je tu koli insertu noveho riadku
32
+ if (props.rowData !== undefined && props.rowData !== null) {
33
+ var rowDataValue = XUtilsCommon_1.XUtilsCommon.getValueByPath(props.rowData, props.field);
34
+ // pre istotu dame na null, null je standard
35
+ //if (rowDataValue === undefined) {
36
+ // rowDataValue = null;
37
+ //}
38
+ // TODO - konvertovat null hodnotu na "" (vo funkcii stringAsUI) je dolezite aby sa prejavila zmena na null v modeli
39
+ // - otestovat ci zmena na null funguje dobre -
40
+ //fieldValue = stringAsUI(rowDataValue);
41
+ // tuto zatial hack, mal by prist Date
42
+ if (typeof rowDataValue === 'string') {
43
+ fieldValue = new Date(rowDataValue);
44
+ }
45
+ else if (typeof rowDataValue === 'object' && rowDataValue instanceof Date) {
46
+ fieldValue = rowDataValue;
47
+ }
48
+ // fieldValue zostalo undefined (konvertujeme null -> undefined) - Calendar pozaduje undefined, nechce null
49
+ }
50
+ // TODO - nefunguje dobre pridavanie noveho riadku - su tam stare neupdatnute hodnoty - este to asi neopravili https://github.com/primefaces/primereact/issues/1277
51
+ // test mame na TestovaciForm
52
+ // appendTo={document.body} appenduje overlay panel na element body - eliminuje problem s overflow (pozri poznamku v XDropdownDTFilter)
53
+ return (react_1.default.createElement(calendar_1.Calendar, { appendTo: document.body, id: props.field, value: fieldValue, onChange: function (e) { return onValueChange(props.field, props.rowData, e.value); }, disabled: readOnly, showIcon: true, dateFormat: (0, XUtilsConversions_1.dateFormatCalendar)(), showTime: showTime, showSeconds: showTime, inputClassName: cssClassName, showOnFocus: false }));
54
+ };
55
+ exports.XInputDateDT = XInputDateDT;
@@ -1,15 +1,15 @@
1
- import React from "react";
2
- import { XFormComponentProps } from "./XFormComponent";
3
- import { XInput } from "./XInput";
4
- export interface XInputDecimalProps extends XFormComponentProps<number> {
5
- field: string;
6
- size?: number;
7
- inputStyle?: React.CSSProperties;
8
- }
9
- export declare class XInputDecimal extends XInput<number, XInputDecimalProps> {
10
- constructor(props: XInputDecimalProps);
11
- getValue(): number | undefined;
12
- onValueChange(e: any): void;
13
- onBlur(e: any): void;
14
- render(): JSX.Element;
15
- }
1
+ import React from "react";
2
+ import { XFormComponentProps } from "./XFormComponent";
3
+ import { XInput } from "./XInput";
4
+ export interface XInputDecimalProps extends XFormComponentProps<number> {
5
+ field: string;
6
+ size?: number;
7
+ inputStyle?: React.CSSProperties;
8
+ }
9
+ export declare class XInputDecimal extends XInput<number, XInputDecimalProps> {
10
+ constructor(props: XInputDecimalProps);
11
+ getValue(): number | undefined;
12
+ onValueChange(e: any): void;
13
+ onBlur(e: any): void;
14
+ render(): JSX.Element;
15
+ }
@@ -1,78 +1,78 @@
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.XInputDecimal = void 0;
33
- var react_1 = __importDefault(require("react"));
34
- var inputnumber_1 = require("primereact/inputnumber");
35
- var XUtilsMetadata_1 = require("./XUtilsMetadata");
36
- var XInput_1 = require("./XInput");
37
- var XInputDecimal = /** @class */ (function (_super) {
38
- __extends(XInputDecimal, _super);
39
- function XInputDecimal(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
- XInputDecimal.prototype.getValue = function () {
46
- var value = undefined;
47
- var objectValue = this.getValueFromObject();
48
- // tuto zatial hack, mal by prist number
49
- if (typeof objectValue === 'string') {
50
- value = parseFloat(objectValue);
51
- }
52
- else if (typeof objectValue === 'number') {
53
- value = objectValue;
54
- }
55
- // value zostalo undefined ak nebol vykonany ziaden if (konvertujeme null -> undefined) - InputNumber pozaduje undefined, nechce null
56
- return value;
57
- };
58
- XInputDecimal.prototype.onValueChange = function (e) {
59
- // z InputNumber prichadza e.value - typ number alebo null
60
- this.onValueChangeBase(e.value);
61
- };
62
- // nedame do onChange inputu, lebo by sa nas onChange volal po kazdej zmene pismenka
63
- // ak bude treba, mozme este dorobit metodu "onChange2", ktora sa bude volat po kazdej zmene pismenka (asi iba do XInputText)
64
- XInputDecimal.prototype.onBlur = function (e) {
65
- this.callOnChangeFromOnBlur();
66
- };
67
- XInputDecimal.prototype.render = function () {
68
- var _a;
69
- var _b = XUtilsMetadata_1.XUtilsMetadata.getParamsForInputNumber(this.xField), useGrouping = _b.useGrouping, fractionDigits = _b.fractionDigits, min = _b.min, max = _b.max, size = _b.size;
70
- var sizeInput = (_a = this.props.size) !== null && _a !== void 0 ? _a : size;
71
- // note: style overrides size (width of the input according to character count)
72
- return (react_1.default.createElement("div", { className: "field grid" },
73
- react_1.default.createElement("label", { htmlFor: this.props.field, className: "col-fixed", style: this.getLabelStyle() }, this.getLabel()),
74
- react_1.default.createElement(inputnumber_1.InputNumber, __assign({ id: this.props.field, value: this.getValue(), onChange: this.onValueChange, readOnly: this.isReadOnly(), mode: "decimal", locale: "de-DE", useGrouping: useGrouping, minFractionDigits: fractionDigits, maxFractionDigits: fractionDigits, min: min, max: max, size: sizeInput, style: this.props.inputStyle }, this.getClassNameTooltip(), { onBlur: this.onBlur }))));
75
- };
76
- return XInputDecimal;
77
- }(XInput_1.XInput));
78
- exports.XInputDecimal = XInputDecimal;
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.XInputDecimal = void 0;
33
+ var react_1 = __importDefault(require("react"));
34
+ var inputnumber_1 = require("primereact/inputnumber");
35
+ var XUtilsMetadata_1 = require("./XUtilsMetadata");
36
+ var XInput_1 = require("./XInput");
37
+ var XInputDecimal = /** @class */ (function (_super) {
38
+ __extends(XInputDecimal, _super);
39
+ function XInputDecimal(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
+ XInputDecimal.prototype.getValue = function () {
46
+ var value = undefined;
47
+ var objectValue = this.getValueFromObject();
48
+ // tuto zatial hack, mal by prist number
49
+ if (typeof objectValue === 'string') {
50
+ value = parseFloat(objectValue);
51
+ }
52
+ else if (typeof objectValue === 'number') {
53
+ value = objectValue;
54
+ }
55
+ // value zostalo undefined ak nebol vykonany ziaden if (konvertujeme null -> undefined) - InputNumber pozaduje undefined, nechce null
56
+ return value;
57
+ };
58
+ XInputDecimal.prototype.onValueChange = function (e) {
59
+ // z InputNumber prichadza e.value - typ number alebo null
60
+ this.onValueChangeBase(e.value);
61
+ };
62
+ // nedame do onChange inputu, lebo by sa nas onChange volal po kazdej zmene pismenka
63
+ // ak bude treba, mozme este dorobit metodu "onChange2", ktora sa bude volat po kazdej zmene pismenka (asi iba do XInputText)
64
+ XInputDecimal.prototype.onBlur = function (e) {
65
+ this.callOnChangeFromOnBlur();
66
+ };
67
+ XInputDecimal.prototype.render = function () {
68
+ var _a;
69
+ var _b = XUtilsMetadata_1.XUtilsMetadata.getParamsForInputNumber(this.xField), useGrouping = _b.useGrouping, fractionDigits = _b.fractionDigits, min = _b.min, max = _b.max, size = _b.size;
70
+ var sizeInput = (_a = this.props.size) !== null && _a !== void 0 ? _a : size;
71
+ // note: style overrides size (width of the input according to character count)
72
+ return (react_1.default.createElement("div", { className: "field grid" },
73
+ react_1.default.createElement("label", { htmlFor: this.props.field, className: "col-fixed", style: this.getLabelStyle() }, this.getLabel()),
74
+ react_1.default.createElement(inputnumber_1.InputNumber, __assign({ id: this.props.field, value: this.getValue(), onChange: this.onValueChange, readOnly: this.isReadOnly(), mode: "decimal", locale: "de-DE", useGrouping: useGrouping, minFractionDigits: fractionDigits, maxFractionDigits: fractionDigits, min: min, max: max, size: sizeInput, style: this.props.inputStyle }, this.getClassNameTooltip(), { onBlur: this.onBlur }))));
75
+ };
76
+ return XInputDecimal;
77
+ }(XInput_1.XInput));
78
+ exports.XInputDecimal = XInputDecimal;
@@ -1,12 +1,12 @@
1
- /// <reference types="react" />
2
- export declare const XInputDecimalBase: (props: {
3
- id?: string | undefined;
4
- value: number | null;
5
- onChange: (value: number | null) => void;
6
- readOnly?: boolean | undefined;
7
- useGrouping?: boolean | undefined;
8
- fractionDigits?: number | undefined;
9
- min?: number | undefined;
10
- max?: number | undefined;
11
- size?: number | undefined;
12
- }) => JSX.Element;
1
+ /// <reference types="react" />
2
+ export declare const XInputDecimalBase: (props: {
3
+ id?: string | undefined;
4
+ value: number | null;
5
+ onChange: (value: number | null) => void;
6
+ readOnly?: boolean | undefined;
7
+ useGrouping?: boolean | undefined;
8
+ fractionDigits?: number | undefined;
9
+ min?: number | undefined;
10
+ max?: number | undefined;
11
+ size?: number | undefined;
12
+ }) => JSX.Element;
@@ -1,18 +1,18 @@
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.XInputDecimalBase = void 0;
7
- var react_1 = __importDefault(require("react"));
8
- var inputnumber_1 = require("primereact/inputnumber");
9
- // wrapper for InputNumber component - zatial taky zjednoduseny, len na filter polozky pouzivame
10
- var XInputDecimalBase = function (props) {
11
- var onChange = function (e) {
12
- // z InputNumber prichadza e.value - typ number alebo null
13
- props.onChange(e.value);
14
- };
15
- // null konvertujeme na undefined (zevraj InputNumber nechce null)
16
- return (react_1.default.createElement(inputnumber_1.InputNumber, { id: props.id, value: props.value !== null ? props.value : undefined, onChange: onChange, readOnly: props.readOnly, mode: "decimal", locale: "de-DE", useGrouping: props.useGrouping, minFractionDigits: props.fractionDigits, maxFractionDigits: props.fractionDigits, min: props.min, max: props.max, size: props.size }));
17
- };
18
- exports.XInputDecimalBase = XInputDecimalBase;
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.XInputDecimalBase = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var inputnumber_1 = require("primereact/inputnumber");
9
+ // wrapper for InputNumber component - zatial taky zjednoduseny, len na filter polozky pouzivame
10
+ var XInputDecimalBase = function (props) {
11
+ var onChange = function (e) {
12
+ // z InputNumber prichadza e.value - typ number alebo null
13
+ props.onChange(e.value);
14
+ };
15
+ // null konvertujeme na undefined (zevraj InputNumber nechce null)
16
+ return (react_1.default.createElement(inputnumber_1.InputNumber, { id: props.id, value: props.value !== null ? props.value : undefined, onChange: onChange, readOnly: props.readOnly, mode: "decimal", locale: "de-DE", useGrouping: props.useGrouping, minFractionDigits: props.fractionDigits, maxFractionDigits: props.fractionDigits, min: props.min, max: props.max, size: props.size }));
17
+ };
18
+ exports.XInputDecimalBase = XInputDecimalBase;
@@ -1,11 +1,11 @@
1
- /// <reference types="react" />
2
- import { XInputDT, XInputDTProps } from "./XInputDT";
3
- export interface XInputDecimalDTProps extends XInputDTProps {
4
- }
5
- export declare class XInputDecimalDT extends XInputDT<XInputDecimalDTProps> {
6
- constructor(props: XInputDecimalDTProps);
7
- getValue(): number | undefined;
8
- onValueChange(e: any): void;
9
- onBlur(e: any): void;
10
- render(): JSX.Element;
11
- }
1
+ /// <reference types="react" />
2
+ import { XInputDT, XInputDTProps } from "./XInputDT";
3
+ export interface XInputDecimalDTProps extends XInputDTProps {
4
+ }
5
+ export declare class XInputDecimalDT extends XInputDT<XInputDecimalDTProps> {
6
+ constructor(props: XInputDecimalDTProps);
7
+ getValue(): number | undefined;
8
+ onValueChange(e: any): void;
9
+ onBlur(e: any): void;
10
+ render(): JSX.Element;
11
+ }