@everymatrix/user-transaction-history 1.43.4 → 1.45.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.
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/index-4699d9a2.js +1382 -0
- package/dist/cjs/loader.cjs.js +7 -13
- package/dist/cjs/user-transaction-history.cjs.entry.js +291 -295
- package/dist/cjs/user-transaction-history.cjs.js +17 -11
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/internal/filters.js +11 -20
- package/dist/collection/components/internal/loader.js +2 -14
- package/dist/collection/components/internal/page-size.js +3 -5
- package/dist/collection/components/internal/table.js +18 -29
- package/dist/collection/components/internal/transaction.js +4 -14
- package/dist/collection/components/user-transaction-history/index.js +1 -0
- package/dist/collection/components/user-transaction-history/user-transaction-history.js +334 -343
- package/dist/collection/global/app.js +1 -1
- package/dist/collection/utils/currency.utils.js +15 -15
- package/dist/collection/utils/date.util.js +6 -6
- package/dist/collection/utils/locale.util.js +60 -60
- package/dist/collection/utils/utils.js +3 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/index-b111cb50.js +1353 -0
- package/dist/esm/loader.js +7 -13
- package/dist/esm/user-transaction-history.entry.js +291 -295
- package/dist/esm/user-transaction-history.js +14 -11
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +14 -19
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-transaction-history/.stencil/packages/stencil/user-transaction-history/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-transaction-history/.stencil/packages/stencil/user-transaction-history/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/internal/filters.d.ts +4 -4
- package/dist/types/components/internal/page-size.d.ts +4 -4
- package/dist/types/components/internal/table.d.ts +2 -2
- package/dist/types/components/user-transaction-history/index.d.ts +1 -0
- package/dist/types/components/user-transaction-history/user-transaction-history.d.ts +37 -37
- package/dist/types/contracts/translation.d.ts +2 -2
- package/dist/types/models/transactions-response.model.d.ts +17 -17
- package/dist/types/stencil-public-runtime.d.ts +142 -33
- package/dist/types/utils/currency.utils.d.ts +2 -2
- package/dist/types/utils/date.util.d.ts +2 -2
- package/dist/types/utils/locale.util.d.ts +38 -38
- package/dist/types/utils/utils.d.ts +1 -0
- package/dist/user-transaction-history/p-57173b50.js +2 -0
- package/dist/user-transaction-history/p-653991ac.entry.js +1 -0
- package/dist/user-transaction-history/p-e1255160.js +1 -0
- package/dist/user-transaction-history/user-transaction-history.esm.js +1 -1
- package/loader/cdn.js +1 -3
- package/loader/index.cjs.js +1 -3
- package/loader/index.d.ts +13 -1
- package/loader/index.es2017.js +1 -3
- package/loader/index.js +1 -3
- package/loader/package.json +1 -0
- package/package.json +8 -1
- package/dist/cjs/index-206e75cb.js +0 -1416
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/components/user-transaction-history.d.ts +0 -11
- package/dist/components/user-transaction-history.js +0 -378
- package/dist/esm/index-32e3ae05.js +0 -1388
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/user-transaction-history/.stencil/packages/user-transaction-history/stencil.config.d.ts +0 -2
- package/dist/user-transaction-history/p-10b5b959.js +0 -1
- package/dist/user-transaction-history/p-4e4fb37e.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "@vaadin/date-picker/theme/lumo/vaadin-date-picker.js";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export class CurrencyFormatter {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
constructor() { }
|
|
3
|
+
static format(currency, value) {
|
|
4
|
+
let result = `${value} ${currency}`;
|
|
5
|
+
try {
|
|
6
|
+
const formatter = new Intl.NumberFormat('en-US', {
|
|
7
|
+
style: 'currency',
|
|
8
|
+
currency: currency,
|
|
9
|
+
});
|
|
10
|
+
result = formatter.format(value);
|
|
11
|
+
}
|
|
12
|
+
catch (_a) {
|
|
13
|
+
// If we here formatter do not support that currency.
|
|
14
|
+
// Just ignore that and use the currency name instead of it symbol.
|
|
15
|
+
}
|
|
16
|
+
return result;
|
|
11
17
|
}
|
|
12
|
-
catch (_a) {
|
|
13
|
-
// If we here formatter do not support that currency.
|
|
14
|
-
// Just ignore that and use the currency name instead of it symbol.
|
|
15
|
-
}
|
|
16
|
-
return result;
|
|
17
|
-
}
|
|
18
18
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export class DateTransformer {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
constructor() { }
|
|
3
|
+
static dateToFormatedString(date) {
|
|
4
|
+
const dateStr = date.toLocaleDateString('en-gb');
|
|
5
|
+
const timeStr = date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', hour12: false });
|
|
6
|
+
return `${dateStr}, ${timeStr}`;
|
|
7
|
+
}
|
|
8
8
|
}
|
|
@@ -1,68 +1,68 @@
|
|
|
1
1
|
export const DEFAULT_TRANSLATIONS = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
2
|
+
"en": {
|
|
3
|
+
"deposit": "Deposit",
|
|
4
|
+
"withdrawals": "Withdrawals",
|
|
5
|
+
"show": "Show",
|
|
6
|
+
"from": "From",
|
|
7
|
+
"to": "To",
|
|
8
|
+
"filter": "Filter",
|
|
9
|
+
"transactionId": "Transaction ID",
|
|
10
|
+
"date": "Date",
|
|
11
|
+
"amount": "Amount",
|
|
12
|
+
"productType": "Product Type",
|
|
13
|
+
"status": "Status",
|
|
14
|
+
"noData": "There are no account activities"
|
|
15
|
+
},
|
|
16
|
+
"hr": {
|
|
17
|
+
"deposit": "Uplate",
|
|
18
|
+
"withdrawals": "Isplate",
|
|
19
|
+
"show": "Prikaži",
|
|
20
|
+
"from": "Od",
|
|
21
|
+
"to": "Do",
|
|
22
|
+
"filter": "Filter",
|
|
23
|
+
"transactionId": "ID transakcije",
|
|
24
|
+
"date": "Datum",
|
|
25
|
+
"amount": "Iznos",
|
|
26
|
+
"productType": "Vrsta proizvoda",
|
|
27
|
+
"status": "Status",
|
|
28
|
+
"noData": "Nema aktivnosti na računu"
|
|
29
|
+
}
|
|
30
30
|
};
|
|
31
31
|
export class Localization {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
32
|
+
constructor() { }
|
|
33
|
+
static async loadCustomTranslations(translationUrl) {
|
|
34
|
+
try {
|
|
35
|
+
const response = await fetch(translationUrl, {
|
|
36
|
+
headers: {
|
|
37
|
+
'Content-Type': 'application/json',
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
if (!response.ok) {
|
|
41
|
+
const err = await response.text();
|
|
42
|
+
throw new Error(err);
|
|
43
|
+
}
|
|
44
|
+
const translations = await response.json();
|
|
45
|
+
Localization.updateTranslations(translations);
|
|
46
|
+
}
|
|
47
|
+
catch (ex) {
|
|
48
|
+
console.error(`Failed to load translations ${translationUrl}. ${ex.message}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
static translate(key, locale) {
|
|
52
|
+
var _a, _b;
|
|
53
|
+
const avaliableLocales = Localization.getAvaliableLanguages(locale);
|
|
54
|
+
return ((_b = (_a = Localization.customTranslation) === null || _a === void 0 ? void 0 : _a[avaliableLocales.customLanguage]) === null || _b === void 0 ? void 0 : _b[key]) || Localization.defaultTranslation[avaliableLocales.predefinedLanguage][key];
|
|
55
|
+
}
|
|
56
|
+
static getAvaliableLanguages(locale) {
|
|
57
|
+
var _a;
|
|
58
|
+
const customLanguage = ((_a = Localization.customLanguages) === null || _a === void 0 ? void 0 : _a.includes(locale)) ? locale : Localization.defaultLanguage;
|
|
59
|
+
const predefinedLanguage = Localization.supportedLanguages.includes(locale) ? locale : Localization.defaultLanguage;
|
|
60
|
+
return { predefinedLanguage, customLanguage };
|
|
46
61
|
}
|
|
47
|
-
|
|
48
|
-
|
|
62
|
+
static updateTranslations(translations) {
|
|
63
|
+
Localization.customLanguages = Array.from(new Set([...Localization.supportedLanguages, ...Object.keys(translations).map(k => k.toLowerCase())]));
|
|
64
|
+
Localization.customTranslation = translations;
|
|
49
65
|
}
|
|
50
|
-
}
|
|
51
|
-
static translate(key, locale) {
|
|
52
|
-
var _a, _b;
|
|
53
|
-
const avaliableLocales = Localization.getAvaliableLanguages(locale);
|
|
54
|
-
return ((_b = (_a = Localization.customTranslation) === null || _a === void 0 ? void 0 : _a[avaliableLocales.customLanguage]) === null || _b === void 0 ? void 0 : _b[key]) || Localization.defaultTranslation[avaliableLocales.predefinedLanguage][key];
|
|
55
|
-
}
|
|
56
|
-
static getAvaliableLanguages(locale) {
|
|
57
|
-
var _a;
|
|
58
|
-
const customLanguage = ((_a = Localization.customLanguages) === null || _a === void 0 ? void 0 : _a.includes(locale)) ? locale : Localization.defaultLanguage;
|
|
59
|
-
const predefinedLanguage = Localization.supportedLanguages.includes(locale) ? locale : Localization.defaultLanguage;
|
|
60
|
-
return { predefinedLanguage, customLanguage };
|
|
61
|
-
}
|
|
62
|
-
static updateTranslations(translations) {
|
|
63
|
-
Localization.customLanguages = Array.from(new Set([...Localization.supportedLanguages, ...Object.keys(translations).map(k => k.toLowerCase())]));
|
|
64
|
-
Localization.customTranslation = translations;
|
|
65
|
-
}
|
|
66
66
|
}
|
|
67
67
|
Localization.defaultLanguage = 'en';
|
|
68
68
|
Localization.supportedLanguages = ['en'];
|