@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,12 +1,15 @@
1
- export declare function stringFromUI(stringValue: string): string | null;
2
- export declare function stringAsUI(value: string | null): string;
3
- export declare function numberFromUI(stringValue: string): number | null;
4
- export declare function numberAsUI(value: number | null, fractionDigits?: number): string;
5
- export declare function numberFromModel(value: any): number | null;
6
- export declare function dateFromModel(value: any): Date | null;
7
- export declare function dateAsUI(value: Date | null): string;
8
- export declare function datetimeAsUI(value: Date | null): string;
9
- export declare function timeFromModel(value: any): Date | null;
10
- export declare function dateFormatUI(): string;
11
- export declare function dateFormatCalendar(): string;
12
- export declare function datetimeFormatUI(): string;
1
+ import { IPostgresInterval } from "./XUtils";
2
+ export declare function stringFromUI(stringValue: string): string | null;
3
+ export declare function stringAsUI(value: string | null): string;
4
+ export declare function numberFromUI(stringValue: string): number | null;
5
+ export declare function numberAsUI(value: number | null, fractionDigits?: number): string;
6
+ export declare function numberFromModel(value: any): number | null;
7
+ export declare function dateFromModel(value: any): Date | null;
8
+ export declare function dateAsUI(value: Date | null): string;
9
+ export declare function datetimeAsUI(value: Date | null): string;
10
+ export declare function timeFromModel(value: any): Date | null;
11
+ export declare function dateFormatUI(): string;
12
+ export declare function dateFormatCalendar(): string;
13
+ export declare function datetimeFormatUI(): string;
14
+ export declare function intervalFromUI(valueString: string): IPostgresInterval | null | undefined;
15
+ export declare function intervalAsUI(valueInterval: IPostgresInterval | null): string;
@@ -1,125 +1,177 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.datetimeFormatUI = exports.dateFormatCalendar = exports.dateFormatUI = exports.timeFromModel = exports.datetimeAsUI = exports.dateAsUI = exports.dateFromModel = exports.numberFromModel = exports.numberAsUI = exports.numberFromUI = exports.stringAsUI = exports.stringFromUI = void 0;
4
- var XUtilsCommon_1 = require("../serverApi/XUtilsCommon");
5
- function stringFromUI(stringValue) {
6
- var value;
7
- if (stringValue === '') {
8
- value = null;
9
- }
10
- else {
11
- value = stringValue;
12
- }
13
- return value;
14
- }
15
- exports.stringFromUI = stringFromUI;
16
- function stringAsUI(value) {
17
- return value !== null ? value : "";
18
- }
19
- exports.stringAsUI = stringAsUI;
20
- function numberFromUI(stringValue) {
21
- var value;
22
- if (stringValue === '') {
23
- value = null;
24
- }
25
- else {
26
- value = parseInt(stringValue, 10);
27
- }
28
- return value;
29
- }
30
- exports.numberFromUI = numberFromUI;
31
- function numberAsUI(value, fractionDigits) {
32
- if (fractionDigits === undefined) {
33
- fractionDigits = 2; // default
34
- }
35
- if (value !== null) {
36
- return value.toLocaleString('de-DE', { style: 'decimal', minimumFractionDigits: fractionDigits, maximumFractionDigits: fractionDigits });
37
- }
38
- else {
39
- return "";
40
- }
41
- }
42
- exports.numberAsUI = numberAsUI;
43
- // v modeli na klientovi by mal byt vzdy number, teraz je tam niekedy string (z json-u zo servera) a niekedy number (z komponentu)
44
- // provizorne zatial takato konverzia
45
- function numberFromModel(value) {
46
- var numberValue = null;
47
- if (typeof value === 'string') {
48
- numberValue = parseFloat(value);
49
- }
50
- else if (typeof value === 'number') {
51
- numberValue = value;
52
- }
53
- return numberValue;
54
- }
55
- exports.numberFromModel = numberFromModel;
56
- // v modeli na klientovi by mal byt vzdy Date, teraz je tam niekedy string (z json-u zo servera) a niekedy Date (z komponentu)
57
- // provizorne zatial takato konverzia
58
- function dateFromModel(value) {
59
- var dateValue = null;
60
- if (typeof value === 'string') {
61
- dateValue = new Date(value);
62
- }
63
- else if (typeof value === 'object' && value instanceof Date) {
64
- dateValue = value;
65
- }
66
- return dateValue;
67
- }
68
- exports.dateFromModel = dateFromModel;
69
- function dateAsUI(value) {
70
- if (value !== null) {
71
- return (0, XUtilsCommon_1.dateFormat)(value, dateFormatUI());
72
- }
73
- else {
74
- return "";
75
- }
76
- }
77
- exports.dateAsUI = dateAsUI;
78
- function datetimeAsUI(value) {
79
- if (value !== null) {
80
- return (0, XUtilsCommon_1.dateFormat)(value, datetimeFormatUI());
81
- }
82
- else {
83
- return "";
84
- }
85
- }
86
- exports.datetimeAsUI = datetimeAsUI;
87
- // provizorne zatial takato konverzia
88
- function timeFromModel(value) {
89
- var timeValue = null;
90
- if (typeof value === 'string') {
91
- // ak prichadza cas priamo z databazy, pride '19:30:00'
92
- // ak prichadza reloadnuty objekt (napr. cez webservis saveRow), pride '2021-06-07 19:30:00'
93
- var rowDataCasStr = value;
94
- if (rowDataCasStr.length < 10) {
95
- // mame '19:30:00' -> pridame hociaky rok aby sme skonvertovali na validny Date
96
- rowDataCasStr = '1970-01-01 ' + rowDataCasStr;
97
- }
98
- // na safari nefunguje konverzia new Date('2021-06-07 19:30:00') - vrati NaN
99
- // preto string prehodime na '2021-06-07T19:30:00+01:00'
100
- // 19:30:00 je cas z timezony Central Europe (taka je nastavena na nodejs)), preto oznacime tento cas touto timezonou
101
- // (spravne riesenie je posielat time cez json vzdy vo formate '2021-06-07T18:30:00Z', v tomto formate chodia aj datetime atributy)
102
- rowDataCasStr = rowDataCasStr.replace(' ', 'T');
103
- if (!rowDataCasStr.endsWith('Z') && rowDataCasStr.indexOf('+') === -1) {
104
- rowDataCasStr += '+01:00'; // Central Europe timezone
105
- }
106
- timeValue = new Date(rowDataCasStr);
107
- }
108
- else if (typeof value === 'object' && value instanceof Date) {
109
- timeValue = value;
110
- }
111
- return timeValue;
112
- }
113
- exports.timeFromModel = timeFromModel;
114
- function dateFormatUI() {
115
- return "dd.mm.yyyy";
116
- }
117
- exports.dateFormatUI = dateFormatUI;
118
- function dateFormatCalendar() {
119
- return "dd.mm.yy";
120
- }
121
- exports.dateFormatCalendar = dateFormatCalendar;
122
- function datetimeFormatUI() {
123
- return "dd.mm.yyyy HH:MM:ss";
124
- }
125
- exports.datetimeFormatUI = datetimeFormatUI;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.intervalAsUI = exports.intervalFromUI = exports.datetimeFormatUI = exports.dateFormatCalendar = exports.dateFormatUI = exports.timeFromModel = exports.datetimeAsUI = exports.dateAsUI = exports.dateFromModel = exports.numberFromModel = exports.numberAsUI = exports.numberFromUI = exports.stringAsUI = exports.stringFromUI = void 0;
4
+ var XUtilsCommon_1 = require("../serverApi/XUtilsCommon");
5
+ function stringFromUI(stringValue) {
6
+ var value;
7
+ if (stringValue === '') {
8
+ value = null;
9
+ }
10
+ else {
11
+ value = stringValue;
12
+ }
13
+ return value;
14
+ }
15
+ exports.stringFromUI = stringFromUI;
16
+ function stringAsUI(value) {
17
+ return value !== null ? value : "";
18
+ }
19
+ exports.stringAsUI = stringAsUI;
20
+ function numberFromUI(stringValue) {
21
+ var value;
22
+ if (stringValue === '') {
23
+ value = null;
24
+ }
25
+ else {
26
+ value = parseInt(stringValue, 10);
27
+ }
28
+ return value;
29
+ }
30
+ exports.numberFromUI = numberFromUI;
31
+ function numberAsUI(value, fractionDigits) {
32
+ if (fractionDigits === undefined) {
33
+ fractionDigits = 2; // default
34
+ }
35
+ if (value !== null) {
36
+ return value.toLocaleString('de-DE', { style: 'decimal', minimumFractionDigits: fractionDigits, maximumFractionDigits: fractionDigits });
37
+ }
38
+ else {
39
+ return "";
40
+ }
41
+ }
42
+ exports.numberAsUI = numberAsUI;
43
+ // v modeli na klientovi by mal byt vzdy number, teraz je tam niekedy string (z json-u zo servera) a niekedy number (z komponentu)
44
+ // provizorne zatial takato konverzia
45
+ function numberFromModel(value) {
46
+ var numberValue = null;
47
+ if (typeof value === 'string') {
48
+ numberValue = parseFloat(value);
49
+ }
50
+ else if (typeof value === 'number') {
51
+ numberValue = value;
52
+ }
53
+ return numberValue;
54
+ }
55
+ exports.numberFromModel = numberFromModel;
56
+ // v modeli na klientovi by mal byt vzdy Date, teraz je tam niekedy string (z json-u zo servera) a niekedy Date (z komponentu)
57
+ // provizorne zatial takato konverzia
58
+ function dateFromModel(value) {
59
+ var dateValue = null;
60
+ if (typeof value === 'string') {
61
+ dateValue = new Date(value);
62
+ }
63
+ else if (typeof value === 'object' && value instanceof Date) {
64
+ dateValue = value;
65
+ }
66
+ return dateValue;
67
+ }
68
+ exports.dateFromModel = dateFromModel;
69
+ function dateAsUI(value) {
70
+ if (value !== null) {
71
+ return (0, XUtilsCommon_1.dateFormat)(value, dateFormatUI());
72
+ }
73
+ else {
74
+ return "";
75
+ }
76
+ }
77
+ exports.dateAsUI = dateAsUI;
78
+ function datetimeAsUI(value) {
79
+ if (value !== null) {
80
+ return (0, XUtilsCommon_1.dateFormat)(value, datetimeFormatUI());
81
+ }
82
+ else {
83
+ return "";
84
+ }
85
+ }
86
+ exports.datetimeAsUI = datetimeAsUI;
87
+ // provizorne zatial takato konverzia
88
+ function timeFromModel(value) {
89
+ var timeValue = null;
90
+ if (typeof value === 'string') {
91
+ // ak prichadza cas priamo z databazy, pride '19:30:00'
92
+ // ak prichadza reloadnuty objekt (napr. cez webservis saveRow), pride '2021-06-07 19:30:00'
93
+ var rowDataCasStr = value;
94
+ if (rowDataCasStr.length < 10) {
95
+ // mame '19:30:00' -> pridame hociaky rok aby sme skonvertovali na validny Date
96
+ rowDataCasStr = '1970-01-01 ' + rowDataCasStr;
97
+ }
98
+ // na safari nefunguje konverzia new Date('2021-06-07 19:30:00') - vrati NaN
99
+ // preto string prehodime na '2021-06-07T19:30:00+01:00'
100
+ // 19:30:00 je cas z timezony Central Europe (taka je nastavena na nodejs)), preto oznacime tento cas touto timezonou
101
+ // (spravne riesenie je posielat time cez json vzdy vo formate '2021-06-07T18:30:00Z', v tomto formate chodia aj datetime atributy)
102
+ rowDataCasStr = rowDataCasStr.replace(' ', 'T');
103
+ if (!rowDataCasStr.endsWith('Z') && rowDataCasStr.indexOf('+') === -1) {
104
+ rowDataCasStr += '+01:00'; // Central Europe timezone
105
+ }
106
+ timeValue = new Date(rowDataCasStr);
107
+ }
108
+ else if (typeof value === 'object' && value instanceof Date) {
109
+ timeValue = value;
110
+ }
111
+ return timeValue;
112
+ }
113
+ exports.timeFromModel = timeFromModel;
114
+ function dateFormatUI() {
115
+ return "dd.mm.yyyy";
116
+ }
117
+ exports.dateFormatUI = dateFormatUI;
118
+ function dateFormatCalendar() {
119
+ return "dd.mm.yy";
120
+ }
121
+ exports.dateFormatCalendar = dateFormatCalendar;
122
+ function datetimeFormatUI() {
123
+ return "dd.mm.yyyy HH:MM:ss";
124
+ }
125
+ exports.datetimeFormatUI = datetimeFormatUI;
126
+ function intervalFromUI(valueString) {
127
+ // convert e.target.value (e.g. 10:29) into IPostgresInterval (e.g. {hours: 10, minutes: 29})
128
+ // if stringValue is invalid, returns undefined
129
+ var valueInterval = undefined;
130
+ if (valueString === '') {
131
+ valueInterval = null;
132
+ }
133
+ else {
134
+ var posColon = valueString.indexOf(':');
135
+ if (posColon === -1) {
136
+ var minutes = parseInt(valueString);
137
+ if (!isNaN(minutes)) {
138
+ var hours = Math.floor(minutes / 60);
139
+ minutes = minutes - (hours * 60);
140
+ valueInterval = { hours: hours, minutes: minutes };
141
+ }
142
+ }
143
+ else {
144
+ var hours = parseInt(valueString.substring(0, posColon));
145
+ var minutes = parseInt(valueString.substring(posColon + 1));
146
+ if (!isNaN(hours) && !isNaN(minutes)) {
147
+ if (minutes >= 60) {
148
+ var hoursFromMinutes = Math.floor(minutes / 60);
149
+ hours += hoursFromMinutes;
150
+ minutes = minutes - (hoursFromMinutes * 60);
151
+ }
152
+ valueInterval = { hours: hours, minutes: minutes };
153
+ }
154
+ }
155
+ }
156
+ return valueInterval;
157
+ }
158
+ exports.intervalFromUI = intervalFromUI;
159
+ function intervalAsUI(valueInterval) {
160
+ var _a, _b;
161
+ // conversion e.g. {hours: 10, minutes: 29} => '10:29'
162
+ var valueString;
163
+ if (valueInterval !== null) {
164
+ var hours = (_a = valueInterval.hours) !== null && _a !== void 0 ? _a : 0;
165
+ var minutes = (_b = valueInterval.minutes) !== null && _b !== void 0 ? _b : 0;
166
+ //const seconds: number = value.seconds ?? 0;
167
+ if (valueInterval.days) {
168
+ hours += valueInterval.days * 24;
169
+ }
170
+ valueString = "".concat(hours.toString(), ":").concat(minutes.toString().padStart(2, '0'));
171
+ }
172
+ else {
173
+ valueString = ''; // null
174
+ }
175
+ return valueString;
176
+ }
177
+ exports.intervalAsUI = intervalAsUI;
@@ -1,39 +1,39 @@
1
- import { XAssoc, XEntity, XField, XRelationType } from "../serverApi/XEntityMetadata";
2
- import { XBrowseMeta } from "../serverApi/XBrowseMetadata";
3
- import { XBetweenFilterProp } from "./XLazyDataTable";
4
- export declare class XUtilsMetadata {
5
- private static xEntityMap;
6
- private static xBrowseMetaMap;
7
- static fetchAndSetXEntityMap(): Promise<any>;
8
- static fetchAndSetXBrowseMetaMap(): Promise<any>;
9
- static getXEntity(entity: string): XEntity;
10
- static getXField(xEntity: XEntity, field: string): XField;
11
- static getXFieldByPath(xEntity: XEntity, path: string): XField;
12
- static getXFieldByPathStr(entity: string, path: string): XField;
13
- static getXAssocByPath(xEntity: XEntity, path: string): XAssoc;
14
- static getLastXAssocByPath(xEntity: XEntity, path: string): XAssoc;
15
- static getXAssocToOne(xEntity: XEntity, assocField: string): XAssoc;
16
- static getXAssocToMany(xEntity: XEntity, assocField: string): XAssoc;
17
- static getXAssocToOneByAssocEntity(xEntity: XEntity, assocEntityName: string): XAssoc;
18
- static getXAssocToManyByAssocEntity(xEntity: XEntity, assocEntityName: string): XAssoc;
19
- static getXEntityForAssocToOne(xEntity: XEntity, assocField: string): XEntity;
20
- static getXEntityForAssocToMany(xEntity: XEntity, assocField: string): XEntity;
21
- static getXFieldList(xEntity: XEntity): XField[];
22
- static getXAssocList(xEntity: XEntity, relationTypeList?: XRelationType[]): XAssoc[];
23
- static getParamsForInputNumber(xField: XField): {
24
- useGrouping: boolean;
25
- fractionDigits?: number;
26
- min?: number;
27
- max?: number;
28
- size?: number;
29
- };
30
- static CHAR_SIZE: number;
31
- static computeColumnWidth(xField: XField, betweenFilter: XBetweenFilterProp, filterMenuInFilterRow: boolean, formColumnType: string | undefined, header: string | undefined, sortableButtonInHeader: boolean, filterButtonInHeader: boolean): string | undefined;
32
- static computeColumnWidthBase(charSize?: number, paddingAndOther?: number): number | undefined;
33
- static getXBrowseMeta(entity: string, browseId?: string): XBrowseMeta;
34
- static setXBrowseMeta(entity: string, browseId: string | undefined, xBrowseMeta: XBrowseMeta): void;
35
- static getXBrowseFormMetaKey(entity: string, browseId?: string): string;
36
- private static getXAssoc;
37
- private static getXAssocByAssocEntity;
38
- private static getXEntityForAssoc;
39
- }
1
+ import { XAssoc, XEntity, XField, XRelationType } from "../serverApi/XEntityMetadata";
2
+ import { XBrowseMeta } from "../serverApi/XBrowseMetadata";
3
+ import { XBetweenFilterProp } from "./XLazyDataTable";
4
+ export declare class XUtilsMetadata {
5
+ private static xEntityMap;
6
+ private static xBrowseMetaMap;
7
+ static fetchAndSetXEntityMap(): Promise<any>;
8
+ static fetchAndSetXBrowseMetaMap(): Promise<any>;
9
+ static getXEntity(entity: string): XEntity;
10
+ static getXField(xEntity: XEntity, field: string): XField;
11
+ static getXFieldByPath(xEntity: XEntity, path: string): XField;
12
+ static getXFieldByPathStr(entity: string, path: string): XField;
13
+ static getXAssocByPath(xEntity: XEntity, path: string): XAssoc;
14
+ static getLastXAssocByPath(xEntity: XEntity, path: string): XAssoc;
15
+ static getXAssocToOne(xEntity: XEntity, assocField: string): XAssoc;
16
+ static getXAssocToMany(xEntity: XEntity, assocField: string): XAssoc;
17
+ static getXAssocToOneByAssocEntity(xEntity: XEntity, assocEntityName: string): XAssoc;
18
+ static getXAssocToManyByAssocEntity(xEntity: XEntity, assocEntityName: string): XAssoc;
19
+ static getXEntityForAssocToOne(xEntity: XEntity, assocField: string): XEntity;
20
+ static getXEntityForAssocToMany(xEntity: XEntity, assocField: string): XEntity;
21
+ static getXFieldList(xEntity: XEntity): XField[];
22
+ static getXAssocList(xEntity: XEntity, relationTypeList?: XRelationType[]): XAssoc[];
23
+ static getParamsForInputNumber(xField: XField): {
24
+ useGrouping: boolean;
25
+ fractionDigits?: number;
26
+ min?: number;
27
+ max?: number;
28
+ size?: number;
29
+ };
30
+ static CHAR_SIZE: number;
31
+ static computeColumnWidth(xField: XField, betweenFilter: XBetweenFilterProp, filterMenuInFilterRow: boolean, formColumnType: string | undefined, header: string | undefined, sortableButtonInHeader: boolean, filterButtonInHeader: boolean): string | undefined;
32
+ static computeColumnWidthBase(charSize?: number, paddingAndOther?: number): number | undefined;
33
+ static getXBrowseMeta(entity: string, browseId?: string): XBrowseMeta;
34
+ static setXBrowseMeta(entity: string, browseId: string | undefined, xBrowseMeta: XBrowseMeta): void;
35
+ static getXBrowseFormMetaKey(entity: string, browseId?: string): string;
36
+ private static getXAssoc;
37
+ private static getXAssocByAssocEntity;
38
+ private static getXEntityForAssoc;
39
+ }