@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
@@ -1,26 +1,26 @@
1
- export interface XLocaleOptions {
2
- filter?: string;
3
- clearFilter?: string;
4
- addRow?: string;
5
- editRow?: string;
6
- removeRow?: string;
7
- exportRows?: string;
8
- chooseRow?: string;
9
- totalRecords?: string;
10
- pleaseSelectRow?: string;
11
- removeRowConfirm?: string;
12
- removeRowFailed?: string;
13
- save?: string;
14
- cancel?: string;
15
- expRowCount?: string;
16
- expExportType?: string;
17
- expCreateHeaderLine?: string;
18
- expCsvSeparator?: string;
19
- expDecimalFormat?: string;
20
- expEncoding?: string;
21
- fileUploadSizeToBig?: string;
22
- fileUploadFailed?: string;
23
- fileDownloadFailed?: string;
24
- }
25
- export declare function xAddLocale(locale: string, xOptions: XLocaleOptions): void;
26
- export declare function xLocaleOption(xOptionKey: string, options?: any[string]): any;
1
+ export interface XLocaleOptions {
2
+ filter?: string;
3
+ clearFilter?: string;
4
+ addRow?: string;
5
+ editRow?: string;
6
+ removeRow?: string;
7
+ exportRows?: string;
8
+ chooseRow?: string;
9
+ totalRecords?: string;
10
+ pleaseSelectRow?: string;
11
+ removeRowConfirm?: string;
12
+ removeRowFailed?: string;
13
+ save?: string;
14
+ cancel?: string;
15
+ expRowCount?: string;
16
+ expExportType?: string;
17
+ expCreateHeaderLine?: string;
18
+ expCsvSeparator?: string;
19
+ expDecimalFormat?: string;
20
+ expEncoding?: string;
21
+ fileUploadSizeToBig?: string;
22
+ fileUploadFailed?: string;
23
+ fileDownloadFailed?: string;
24
+ }
25
+ export declare function xAddLocale(locale: string, xOptions: XLocaleOptions): void;
26
+ export declare function xLocaleOption(xOptionKey: string, options?: any[string]): any;
@@ -1,59 +1,59 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.xLocaleOption = exports.xAddLocale = void 0;
30
- var api_1 = __importStar(require("primereact/api"));
31
- // using json-loader module we import x-en.json file into variable xEnJsonObject
32
- var x_en_json_1 = __importDefault(require("./locale/x-en.json"));
33
- // under this key are x-locale saved inside of PrimeReact locale
34
- var xOptionsKey = "xOptions";
35
- function xAddLocale(locale, xOptions) {
36
- (0, api_1.updateLocaleOption)(xOptionsKey, xOptions, locale);
37
- }
38
- exports.xAddLocale = xAddLocale;
39
- // using this method are x-locale read
40
- function xLocaleOption(xOptionKey, options) {
41
- var _locale = api_1.default.locale || 'en';
42
- try {
43
- var optionValue = (0, api_1.localeOptions)(_locale)[xOptionsKey][xOptionKey];
44
- if (optionValue && options) {
45
- for (var key in options) {
46
- if (options.hasOwnProperty(key)) {
47
- optionValue = optionValue.replace("{".concat(key, "}"), options[key]);
48
- }
49
- }
50
- }
51
- return optionValue;
52
- }
53
- catch (error) {
54
- throw new Error("The ".concat(xOptionKey, " option is not found in the current x-locale('").concat(_locale, "')."));
55
- }
56
- }
57
- exports.xLocaleOption = xLocaleOption;
58
- // add en locale into PrimeReact locale (global variable "locales" declared in file Locale.js)
59
- xAddLocale('en', x_en_json_1.default.en);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.xLocaleOption = exports.xAddLocale = void 0;
30
+ var api_1 = __importStar(require("primereact/api"));
31
+ // using json-loader module we import x-en.json file into variable xEnJsonObject
32
+ var x_en_json_1 = __importDefault(require("./locale/x-en.json"));
33
+ // under this key are x-locale saved inside of PrimeReact locale
34
+ var xOptionsKey = "xOptions";
35
+ function xAddLocale(locale, xOptions) {
36
+ (0, api_1.updateLocaleOption)(xOptionsKey, xOptions, locale);
37
+ }
38
+ exports.xAddLocale = xAddLocale;
39
+ // using this method are x-locale read
40
+ function xLocaleOption(xOptionKey, options) {
41
+ var _locale = api_1.default.locale || 'en';
42
+ try {
43
+ var optionValue = (0, api_1.localeOptions)(_locale)[xOptionsKey][xOptionKey];
44
+ if (optionValue && options) {
45
+ for (var key in options) {
46
+ if (options.hasOwnProperty(key)) {
47
+ optionValue = optionValue.replace("{".concat(key, "}"), options[key]);
48
+ }
49
+ }
50
+ }
51
+ return optionValue;
52
+ }
53
+ catch (error) {
54
+ throw new Error("The ".concat(xOptionKey, " option is not found in the current x-locale('").concat(_locale, "')."));
55
+ }
56
+ }
57
+ exports.xLocaleOption = xLocaleOption;
58
+ // add en locale into PrimeReact locale (global variable "locales" declared in file Locale.js)
59
+ xAddLocale('en', x_en_json_1.default.en);
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
2
- import { XToken } from "./XToken";
3
- export declare const XLoginDialog: (props: {
4
- dialogOpened: boolean;
5
- setXToken: (xToken: XToken | null) => void;
6
- onHideDialog: (ok: boolean) => void;
7
- customUserService?: string | undefined;
8
- }) => JSX.Element;
1
+ /// <reference types="react" />
2
+ import { XToken } from "./XToken";
3
+ export declare const XLoginDialog: (props: {
4
+ dialogOpened: boolean;
5
+ setXToken: (xToken: XToken | null) => void;
6
+ onHideDialog: (ok: boolean) => void;
7
+ customUserService?: string | undefined;
8
+ }) => JSX.Element;
@@ -1,21 +1,21 @@
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.XLoginDialog = void 0;
7
- var react_1 = __importDefault(require("react"));
8
- var dialog_1 = require("primereact/dialog");
9
- var XLoginForm_1 = require("./XLoginForm");
10
- var XLoginDialog = function (props) {
11
- // bez tejto metody by pri opetovnom otvoreni dialogu ponechal povodne hodnoty
12
- var onShow = function () {
13
- };
14
- var onLogin = function () {
15
- props.onHideDialog(true);
16
- };
17
- // poznamka: renderovanie vnutornych komponentov Dialogu sa zavola az po otvoreni dialogu
18
- return (react_1.default.createElement(dialog_1.Dialog, { visible: props.dialogOpened, onShow: onShow, onHide: function () { return props.onHideDialog(false); } },
19
- react_1.default.createElement(XLoginForm_1.XLoginForm, { setXToken: props.setXToken, onLogin: onLogin, customUserService: props.customUserService })));
20
- };
21
- exports.XLoginDialog = XLoginDialog;
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.XLoginDialog = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var dialog_1 = require("primereact/dialog");
9
+ var XLoginForm_1 = require("./XLoginForm");
10
+ var XLoginDialog = function (props) {
11
+ // bez tejto metody by pri opetovnom otvoreni dialogu ponechal povodne hodnoty
12
+ var onShow = function () {
13
+ };
14
+ var onLogin = function () {
15
+ props.onHideDialog(true);
16
+ };
17
+ // poznamka: renderovanie vnutornych komponentov Dialogu sa zavola az po otvoreni dialogu
18
+ return (react_1.default.createElement(dialog_1.Dialog, { visible: props.dialogOpened, onShow: onShow, onHide: function () { return props.onHideDialog(false); } },
19
+ react_1.default.createElement(XLoginForm_1.XLoginForm, { setXToken: props.setXToken, onLogin: onLogin, customUserService: props.customUserService })));
20
+ };
21
+ exports.XLoginDialog = XLoginDialog;
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
2
- import { XToken } from "./XToken";
3
- export declare const XLoginForm: (props: {
4
- setXToken: (xToken: XToken | null) => void;
5
- onLogin?: (() => void) | undefined;
6
- customUserService?: string | undefined;
7
- }) => JSX.Element;
1
+ /// <reference types="react" />
2
+ import { XToken } from "./XToken";
3
+ export declare const XLoginForm: (props: {
4
+ setXToken: (xToken: XToken | null) => void;
5
+ onLogin?: (() => void) | undefined;
6
+ customUserService?: string | undefined;
7
+ }) => JSX.Element;
@@ -1,128 +1,128 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- var __generator = (this && this.__generator) || function (thisArg, body) {
35
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
36
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
- function verb(n) { return function (v) { return step([n, v]); }; }
38
- function step(op) {
39
- if (f) throw new TypeError("Generator is already executing.");
40
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
42
- if (y = 0, t) op = [op[0] & 2, t.value];
43
- switch (op[0]) {
44
- case 0: case 1: t = op; break;
45
- case 4: _.label++; return { value: op[1], done: false };
46
- case 5: _.label++; y = op[1]; op = [0]; continue;
47
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
48
- default:
49
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
50
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
51
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
52
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
53
- if (t[2]) _.ops.pop();
54
- _.trys.pop(); continue;
55
- }
56
- op = body.call(thisArg, _);
57
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
58
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
59
- }
60
- };
61
- var __read = (this && this.__read) || function (o, n) {
62
- var m = typeof Symbol === "function" && o[Symbol.iterator];
63
- if (!m) return o;
64
- var i = m.call(o), r, ar = [], e;
65
- try {
66
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
67
- }
68
- catch (error) { e = { error: error }; }
69
- finally {
70
- try {
71
- if (r && !r.done && (m = i["return"])) m.call(i);
72
- }
73
- finally { if (e) throw e.error; }
74
- }
75
- return ar;
76
- };
77
- Object.defineProperty(exports, "__esModule", { value: true });
78
- exports.XLoginForm = void 0;
79
- var inputtext_1 = require("primereact/inputtext");
80
- var react_1 = __importStar(require("react"));
81
- var password_1 = require("primereact/password");
82
- var button_1 = require("primereact/button");
83
- var XUtils_1 = require("./XUtils");
84
- var XLoginForm = function (props) {
85
- var _a = __read((0, react_1.useState)(""), 2), username = _a[0], setUsername = _a[1];
86
- var _b = __read((0, react_1.useState)(""), 2), password = _b[0], setPassword = _b[1];
87
- var onClickLogIn = function () { return __awaiter(void 0, void 0, void 0, function () {
88
- var xUserAuthenticationRequest, xUserAuthenticationResponse, customUser;
89
- return __generator(this, function (_a) {
90
- switch (_a.label) {
91
- case 0:
92
- xUserAuthenticationRequest = { username: username, password: password };
93
- return [4 /*yield*/, XUtils_1.XUtils.fetchOne('userAuthentication', xUserAuthenticationRequest)];
94
- case 1:
95
- xUserAuthenticationResponse = _a.sent();
96
- if (!xUserAuthenticationResponse.authenticationOk) return [3 /*break*/, 4];
97
- customUser = undefined;
98
- if (!props.customUserService) return [3 /*break*/, 3];
99
- return [4 /*yield*/, XUtils_1.XUtils.fetchOne(props.customUserService, { username: username }, { username: username, password: password })];
100
- case 2:
101
- customUser = _a.sent();
102
- _a.label = 3;
103
- case 3:
104
- // zatial si ulozime len username/password (koli http basic autentifikacii)
105
- props.setXToken({ username: username, password: password, xUser: customUser });
106
- // metoda pouzivana v XLoginDialog
107
- if (props.onLogin) {
108
- props.onLogin();
109
- }
110
- return [3 /*break*/, 5];
111
- case 4:
112
- alert("Invalid Username/Password");
113
- _a.label = 5;
114
- case 5: return [2 /*return*/];
115
- }
116
- });
117
- }); };
118
- return (react_1.default.createElement("div", { className: "flex flex-column align-items-center" },
119
- react_1.default.createElement("h2", null, "Please log in"),
120
- react_1.default.createElement("div", { className: "field grid" },
121
- react_1.default.createElement("label", { htmlFor: "userName", className: "col-fixed", style: { width: '10.5rem' } }, "Username"),
122
- react_1.default.createElement(inputtext_1.InputText, { id: "userName", value: username, onChange: function (e) { return setUsername(e.target.value); }, maxLength: 64 })),
123
- react_1.default.createElement("div", { className: "field grid" },
124
- react_1.default.createElement("label", { htmlFor: "password", className: "col-fixed", style: { width: '10.5rem' } }, "Password"),
125
- react_1.default.createElement(password_1.Password, { id: "password", value: password, onChange: function (e) { return setPassword(e.target.value); }, feedback: false, maxLength: 64 })),
126
- react_1.default.createElement(button_1.Button, { label: "Log in", onClick: onClickLogIn })));
127
- };
128
- exports.XLoginForm = XLoginForm;
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ var __generator = (this && this.__generator) || function (thisArg, body) {
35
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
36
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
+ function verb(n) { return function (v) { return step([n, v]); }; }
38
+ function step(op) {
39
+ if (f) throw new TypeError("Generator is already executing.");
40
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
42
+ if (y = 0, t) op = [op[0] & 2, t.value];
43
+ switch (op[0]) {
44
+ case 0: case 1: t = op; break;
45
+ case 4: _.label++; return { value: op[1], done: false };
46
+ case 5: _.label++; y = op[1]; op = [0]; continue;
47
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
48
+ default:
49
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
50
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
51
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
52
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
53
+ if (t[2]) _.ops.pop();
54
+ _.trys.pop(); continue;
55
+ }
56
+ op = body.call(thisArg, _);
57
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
58
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
59
+ }
60
+ };
61
+ var __read = (this && this.__read) || function (o, n) {
62
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
63
+ if (!m) return o;
64
+ var i = m.call(o), r, ar = [], e;
65
+ try {
66
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
67
+ }
68
+ catch (error) { e = { error: error }; }
69
+ finally {
70
+ try {
71
+ if (r && !r.done && (m = i["return"])) m.call(i);
72
+ }
73
+ finally { if (e) throw e.error; }
74
+ }
75
+ return ar;
76
+ };
77
+ Object.defineProperty(exports, "__esModule", { value: true });
78
+ exports.XLoginForm = void 0;
79
+ var inputtext_1 = require("primereact/inputtext");
80
+ var react_1 = __importStar(require("react"));
81
+ var password_1 = require("primereact/password");
82
+ var button_1 = require("primereact/button");
83
+ var XUtils_1 = require("./XUtils");
84
+ var XLoginForm = function (props) {
85
+ var _a = __read((0, react_1.useState)(""), 2), username = _a[0], setUsername = _a[1];
86
+ var _b = __read((0, react_1.useState)(""), 2), password = _b[0], setPassword = _b[1];
87
+ var onClickLogIn = function () { return __awaiter(void 0, void 0, void 0, function () {
88
+ var xUserAuthenticationRequest, xUserAuthenticationResponse, customUser;
89
+ return __generator(this, function (_a) {
90
+ switch (_a.label) {
91
+ case 0:
92
+ xUserAuthenticationRequest = { username: username, password: password };
93
+ return [4 /*yield*/, XUtils_1.XUtils.fetchOne('userAuthentication', xUserAuthenticationRequest)];
94
+ case 1:
95
+ xUserAuthenticationResponse = _a.sent();
96
+ if (!xUserAuthenticationResponse.authenticationOk) return [3 /*break*/, 4];
97
+ customUser = undefined;
98
+ if (!props.customUserService) return [3 /*break*/, 3];
99
+ return [4 /*yield*/, XUtils_1.XUtils.fetchOne(props.customUserService, { username: username }, { username: username, password: password })];
100
+ case 2:
101
+ customUser = _a.sent();
102
+ _a.label = 3;
103
+ case 3:
104
+ // zatial si ulozime len username/password (koli http basic autentifikacii)
105
+ props.setXToken({ username: username, password: password, xUser: customUser });
106
+ // metoda pouzivana v XLoginDialog
107
+ if (props.onLogin) {
108
+ props.onLogin();
109
+ }
110
+ return [3 /*break*/, 5];
111
+ case 4:
112
+ alert("Invalid Username/Password");
113
+ _a.label = 5;
114
+ case 5: return [2 /*return*/];
115
+ }
116
+ });
117
+ }); };
118
+ return (react_1.default.createElement("div", { className: "flex flex-column align-items-center" },
119
+ react_1.default.createElement("h2", null, "Please log in"),
120
+ react_1.default.createElement("div", { className: "field grid" },
121
+ react_1.default.createElement("label", { htmlFor: "userName", className: "col-fixed", style: { width: '10.5rem' } }, "Username"),
122
+ react_1.default.createElement(inputtext_1.InputText, { id: "userName", value: username, onChange: function (e) { return setUsername(e.target.value); }, maxLength: 64 })),
123
+ react_1.default.createElement("div", { className: "field grid" },
124
+ react_1.default.createElement("label", { htmlFor: "password", className: "col-fixed", style: { width: '10.5rem' } }, "Password"),
125
+ react_1.default.createElement(password_1.Password, { id: "password", value: password, onChange: function (e) { return setPassword(e.target.value); }, feedback: false, maxLength: 64 })),
126
+ react_1.default.createElement(button_1.Button, { label: "Log in", onClick: onClickLogIn })));
127
+ };
128
+ exports.XLoginForm = XLoginForm;
@@ -1,3 +1,3 @@
1
- export interface XObject {
2
- [field: string]: any;
3
- }
1
+ export interface XObject {
2
+ [field: string]: any;
3
+ }
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,11 +1,11 @@
1
- export interface XResponseErrorBody {
2
- statusCode: number;
3
- message: string;
4
- exceptionName: string;
5
- sqlMessage?: string;
6
- sql?: string;
7
- }
8
- export declare class XResponseError extends Error {
9
- xResponseErrorBody: XResponseErrorBody;
10
- constructor(path: string, status: number, statusText: string, body: XResponseErrorBody);
11
- }
1
+ export interface XResponseErrorBody {
2
+ statusCode: number;
3
+ message: string;
4
+ exceptionName: string;
5
+ sqlMessage?: string;
6
+ sql?: string;
7
+ }
8
+ export declare class XResponseError extends Error {
9
+ xResponseErrorBody: XResponseErrorBody;
10
+ constructor(path: string, status: number, statusText: string, body: XResponseErrorBody);
11
+ }
@@ -1,32 +1,32 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.XResponseError = void 0;
19
- var XResponseError = /** @class */ (function (_super) {
20
- __extends(XResponseError, _super);
21
- function XResponseError(path, status, statusText, body) {
22
- var _newTarget = this.constructor;
23
- var _this = _super.call(this, "Http request \"".concat(path, "\" failed. Status: ").concat(status, ", status text: ").concat(statusText)) || this;
24
- // see: typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html
25
- Object.setPrototypeOf(_this, _newTarget.prototype); // restore prototype chain
26
- _this.name = XResponseError.name; // stack traces display correctly now
27
- _this.xResponseErrorBody = body;
28
- return _this;
29
- }
30
- return XResponseError;
31
- }(Error));
32
- exports.XResponseError = XResponseError;
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
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.XResponseError = void 0;
19
+ var XResponseError = /** @class */ (function (_super) {
20
+ __extends(XResponseError, _super);
21
+ function XResponseError(path, status, statusText, body) {
22
+ var _newTarget = this.constructor;
23
+ var _this = _super.call(this, "Http request \"".concat(path, "\" failed. Status: ").concat(status, ", status text: ").concat(statusText)) || this;
24
+ // see: typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html
25
+ Object.setPrototypeOf(_this, _newTarget.prototype); // restore prototype chain
26
+ _this.name = XResponseError.name; // stack traces display correctly now
27
+ _this.xResponseErrorBody = body;
28
+ return _this;
29
+ }
30
+ return XResponseError;
31
+ }(Error));
32
+ exports.XResponseError = XResponseError;