@coveo/atomic 3.62.0 → 3.63.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/custom-elements.json +131 -10
- package/dist/cjs/components/commerce/atomic-commerce-interface/atomic-commerce-interface.cjs +25 -4
- package/dist/cjs/components/commerce/atomic-commerce-pager/atomic-commerce-pager.cjs +3 -2
- package/dist/cjs/components/commerce/atomic-commerce-products-per-page/atomic-commerce-products-per-page.cjs +1 -1
- package/dist/cjs/components/commerce/atomic-commerce-recommendation-interface/atomic-commerce-recommendation-interface.cjs +25 -4
- package/dist/cjs/components/common/interface/i18n.cjs +6 -2
- package/dist/cjs/components/common/interface/interface-controller.cjs +8 -4
- package/dist/cjs/components/common/pager/pager-fit-controller.cjs +72 -0
- package/dist/cjs/components/insight/atomic-insight-pager/atomic-insight-pager.cjs +3 -2
- package/dist/cjs/components/search/atomic-pager/atomic-pager.cjs +3 -2
- package/dist/cjs/components/search/atomic-result-date/atomic-result-date.cjs +11 -16
- package/dist/cjs/components/search/atomic-results-per-page/atomic-results-per-page.cjs +1 -1
- package/dist/cjs/generated/dayjs-locales-data.cjs +43 -43
- package/dist/cjs/global/environment.cjs +1 -1
- package/dist/cjs/utils/dayjs-locales.cjs +23 -9
- package/dist/cjs/utils/field-utils.cjs +5 -1
- package/dist/cjs/utils/locale-utils.cjs +50 -0
- package/dist/cjs/versions.cjs +1 -1
- package/dist/esm/components/commerce/atomic-commerce-interface/atomic-commerce-interface.js +25 -4
- package/dist/esm/components/commerce/atomic-commerce-pager/atomic-commerce-pager.js +3 -2
- package/dist/esm/components/commerce/atomic-commerce-products-per-page/atomic-commerce-products-per-page.js +1 -1
- package/dist/esm/components/commerce/atomic-commerce-recommendation-interface/atomic-commerce-recommendation-interface.js +25 -4
- package/dist/esm/components/common/interface/i18n.js +6 -2
- package/dist/esm/components/common/interface/interface-controller.js +8 -4
- package/dist/esm/components/common/pager/pager-fit-controller.js +34 -0
- package/dist/esm/components/insight/atomic-insight-pager/atomic-insight-pager.js +3 -2
- package/dist/esm/components/search/atomic-pager/atomic-pager.js +3 -2
- package/dist/esm/components/search/atomic-result-date/atomic-result-date.js +10 -15
- package/dist/esm/components/search/atomic-results-per-page/atomic-results-per-page.js +1 -1
- package/dist/esm/generated/dayjs-locales-data.js +43 -43
- package/dist/esm/global/environment.js +1 -1
- package/dist/esm/utils/dayjs-locales.js +23 -9
- package/dist/esm/utils/field-utils.js +5 -1
- package/dist/esm/utils/locale-utils.js +12 -0
- package/dist/esm/versions.js +1 -1
- package/dist/lang/cs.json +1 -1
- package/dist/lang/da.json +1 -1
- package/dist/lang/de.json +1 -1
- package/dist/lang/el.json +1 -1
- package/dist/lang/es.json +1 -1
- package/dist/lang/fi.json +1 -1
- package/dist/lang/hu.json +1 -1
- package/dist/lang/id.json +1 -1
- package/dist/lang/it.json +1 -1
- package/dist/lang/ja.json +1 -1
- package/dist/lang/ko.json +1 -1
- package/dist/lang/nl.json +1 -1
- package/dist/lang/no.json +1 -1
- package/dist/lang/pl.json +1 -1
- package/dist/lang/pt-BR.json +1 -1
- package/dist/lang/pt.json +1 -1
- package/dist/lang/ru.json +1 -1
- package/dist/lang/sv.json +1 -1
- package/dist/lang/th.json +1 -1
- package/dist/lang/tr.json +1 -1
- package/dist/lang/zh-CN.json +1 -1
- package/dist/lang/zh-TW.json +1 -1
- package/dist/lang/zh.json +1 -1
- package/dist/types/components/commerce/atomic-commerce-interface/atomic-commerce-interface.d.ts +17 -0
- package/dist/types/components/commerce/atomic-commerce-pager/atomic-commerce-pager.d.ts +1 -0
- package/dist/types/components/commerce/atomic-commerce-recommendation-interface/atomic-commerce-recommendation-interface.d.ts +13 -0
- package/dist/types/components/common/interface/i18n.d.ts +9 -5
- package/dist/types/components/common/pager/pager-fit-controller.d.ts +21 -0
- package/dist/types/components/common/suggestions/suggestion-manager.d.ts +1 -1
- package/dist/types/components/common/suggestions/suggestions-types.d.ts +1 -1
- package/dist/types/components/insight/atomic-insight-interface/atomic-insight-interface.d.ts +4 -0
- package/dist/types/components/insight/atomic-insight-pager/atomic-insight-pager.d.ts +1 -0
- package/dist/types/components/recommendations/atomic-recs-interface/atomic-recs-interface.d.ts +4 -0
- package/dist/types/components/search/atomic-pager/atomic-pager.d.ts +1 -0
- package/dist/types/components/search/atomic-result-date/atomic-result-date.d.ts +3 -0
- package/dist/types/components/search/atomic-search-interface/atomic-search-interface.d.ts +4 -0
- package/dist/types/utils/dayjs-locales.d.ts +1 -1
- package/dist/types/utils/field-utils.d.ts +1 -1
- package/dist/types/utils/locale-utils.d.ts +7 -0
- package/package.json +4 -4
|
@@ -48,6 +48,7 @@ const when_js_namespaceObject = require("lit/directives/when.js");
|
|
|
48
48
|
const store_cjs_namespaceObject = require("../../common/interface/store.cjs");
|
|
49
49
|
const pager_buttons_cjs_namespaceObject = require("../../common/pager/pager-buttons.cjs");
|
|
50
50
|
const pager_navigation_cjs_namespaceObject = require("../../common/pager/pager-navigation.cjs");
|
|
51
|
+
const pager_fit_controller_cjs_namespaceObject = require("../../common/pager/pager-fit-controller.cjs");
|
|
51
52
|
const pager_utils_cjs_namespaceObject = require("../../common/pager/pager-utils.cjs");
|
|
52
53
|
const validate_props_controller_cjs_namespaceObject = require("../../common/validate-props-controller/validate-props-controller.cjs");
|
|
53
54
|
const bind_state_cjs_namespaceObject = require("../../../decorators/bind-state.cjs");
|
|
@@ -85,7 +86,7 @@ class AtomicPager extends (0, bindings_mixin_cjs_namespaceObject.InitializeBindi
|
|
|
85
86
|
});
|
|
86
87
|
}
|
|
87
88
|
render() {
|
|
88
|
-
const pagesRange = (0, pager_utils_cjs_namespaceObject.getCurrentPagesRange)(this.pagerState.currentPage - 1, this.numberOfPages, this.pagerState.maxPage - 1);
|
|
89
|
+
const pagesRange = (0, pager_utils_cjs_namespaceObject.getCurrentPagesRange)(this.pagerState.currentPage - 1, this.pagerFit.getNumberOfPagesToDisplay(this.numberOfPages), this.pagerState.maxPage - 1);
|
|
89
90
|
return (0, external_lit_namespaceObject.html)`${(0, when_js_namespaceObject.when)(this.pagerState.maxPage > 1 && this.isAppLoaded, ()=>(0, external_lit_namespaceObject.html)` ${(0, pager_navigation_cjs_namespaceObject.renderPagerNavigation)({
|
|
90
91
|
props: {
|
|
91
92
|
i18n: this.bindings.i18n
|
|
@@ -150,7 +151,7 @@ class AtomicPager extends (0, bindings_mixin_cjs_namespaceObject.InitializeBindi
|
|
|
150
151
|
});
|
|
151
152
|
}
|
|
152
153
|
constructor(){
|
|
153
|
-
super(), this.isAppLoaded = false, this.numberOfPages = 5, this.previousButtonIcon = arrow_left_rounded_cjs_default(), this.nextButtonIcon = arrow_right_rounded_cjs_default(), this.ariaMessage = new accessibility_utils_cjs_namespaceObject.AriaLiveRegionController(this, 'atomic-pager');
|
|
154
|
+
super(), this.isAppLoaded = false, this.numberOfPages = 5, this.previousButtonIcon = arrow_left_rounded_cjs_default(), this.nextButtonIcon = arrow_right_rounded_cjs_default(), this.ariaMessage = new accessibility_utils_cjs_namespaceObject.AriaLiveRegionController(this, 'atomic-pager'), this.pagerFit = new pager_fit_controller_cjs_namespaceObject.PagerFitController(this);
|
|
154
155
|
new validate_props_controller_cjs_namespaceObject.ValidatePropsController(this, ()=>({
|
|
155
156
|
numberOfPages: this.numberOfPages
|
|
156
157
|
}), AtomicPager.propsSchema);
|
|
@@ -45,8 +45,8 @@ const external_dayjs_namespaceObject = require("dayjs");
|
|
|
45
45
|
var external_dayjs_default = /*#__PURE__*/ __webpack_require__.n(external_dayjs_namespaceObject);
|
|
46
46
|
const calendar_namespaceObject = require("dayjs/plugin/calendar");
|
|
47
47
|
var calendar_default = /*#__PURE__*/ __webpack_require__.n(calendar_namespaceObject);
|
|
48
|
-
const
|
|
49
|
-
var
|
|
48
|
+
const localizedFormat_namespaceObject = require("dayjs/plugin/localizedFormat");
|
|
49
|
+
var localizedFormat_default = /*#__PURE__*/ __webpack_require__.n(localizedFormat_namespaceObject);
|
|
50
50
|
const external_lit_namespaceObject = require("lit");
|
|
51
51
|
const decorators_js_namespaceObject = require("lit/decorators.js");
|
|
52
52
|
const when_js_namespaceObject = require("lit/directives/when.js");
|
|
@@ -67,7 +67,7 @@ function _ts_metadata(metadataKey, metadataValue) {
|
|
|
67
67
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(metadataKey, metadataValue);
|
|
68
68
|
}
|
|
69
69
|
external_dayjs_default().extend(calendar_default());
|
|
70
|
-
external_dayjs_default().extend(
|
|
70
|
+
external_dayjs_default().extend(localizedFormat_default());
|
|
71
71
|
class AtomicResultDate extends (0, light_dom_cjs_namespaceObject.LightDomMixin)(external_lit_namespaceObject.LitElement) {
|
|
72
72
|
initialize() {
|
|
73
73
|
if (!this.result && this.resultController.item) {
|
|
@@ -95,19 +95,14 @@ class AtomicResultDate extends (0, light_dom_cjs_namespaceObject.LightDomMixin)(
|
|
|
95
95
|
this.error = new Error(`Field "${this.field}" does not contain a valid date.`);
|
|
96
96
|
return null;
|
|
97
97
|
}
|
|
98
|
-
if (this.relativeTime) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
sameElse: this.format
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
return parsedValue.calendar();
|
|
110
|
-
}
|
|
98
|
+
if (this.relativeTime) return parsedValue.calendar(null, {
|
|
99
|
+
sameDay: this.bindings.i18n.t('calendar-same-day'),
|
|
100
|
+
nextDay: this.bindings.i18n.t('calendar-next-day'),
|
|
101
|
+
nextWeek: this.bindings.i18n.t('calendar-next-week'),
|
|
102
|
+
lastDay: this.bindings.i18n.t('calendar-last-day'),
|
|
103
|
+
lastWeek: this.bindings.i18n.t('calendar-last-week'),
|
|
104
|
+
sameElse: this.format
|
|
105
|
+
});
|
|
111
106
|
return parsedValue.format(this.format);
|
|
112
107
|
}
|
|
113
108
|
constructor(){
|
|
@@ -89,7 +89,7 @@ class AtomicResultsPerPage extends (0, bindings_mixin_cjs_namespaceObject.Initia
|
|
|
89
89
|
if (!this.searchStatusState) return (0, external_lit_namespaceObject.html)``;
|
|
90
90
|
return (0, external_lit_namespaceObject.html)`
|
|
91
91
|
${(0, when_js_namespaceObject.when)(!this.searchStatusState.hasError && this.isAppLoaded && this.searchStatusState.hasResults, ()=>(0, external_lit_namespaceObject.html)`
|
|
92
|
-
<div class="flex items-center">
|
|
92
|
+
<div class="flex flex-wrap items-center">
|
|
93
93
|
${(0, label_cjs_namespaceObject.renderLabel)()((0, external_lit_namespaceObject.html)`${this.label}`)}
|
|
94
94
|
${(0, fieldset_group_cjs_namespaceObject.renderFieldsetGroup)({
|
|
95
95
|
props: {
|
|
@@ -30,20 +30,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
30
30
|
const locales = {
|
|
31
31
|
af: ()=>import("dayjs/locale/af"),
|
|
32
32
|
am: ()=>import("dayjs/locale/am"),
|
|
33
|
-
'ar-
|
|
34
|
-
'ar-
|
|
35
|
-
'ar-
|
|
36
|
-
'ar-
|
|
37
|
-
'ar-
|
|
38
|
-
'ar-
|
|
39
|
-
'ar-
|
|
33
|
+
'ar-iq': ()=>import("dayjs/locale/ar-iq"),
|
|
34
|
+
'ar-dz': ()=>import("dayjs/locale/ar-dz"),
|
|
35
|
+
'ar-kw': ()=>import("dayjs/locale/ar-kw"),
|
|
36
|
+
'ar-ly': ()=>import("dayjs/locale/ar-ly"),
|
|
37
|
+
'ar-ma': ()=>import("dayjs/locale/ar-ma"),
|
|
38
|
+
'ar-sa': ()=>import("dayjs/locale/ar-sa"),
|
|
39
|
+
'ar-tn': ()=>import("dayjs/locale/ar-tn"),
|
|
40
40
|
ar: ()=>import("dayjs/locale/ar"),
|
|
41
41
|
az: ()=>import("dayjs/locale/az"),
|
|
42
42
|
be: ()=>import("dayjs/locale/be"),
|
|
43
43
|
bg: ()=>import("dayjs/locale/bg"),
|
|
44
44
|
bi: ()=>import("dayjs/locale/bi"),
|
|
45
45
|
bm: ()=>import("dayjs/locale/bm"),
|
|
46
|
-
'bn-
|
|
46
|
+
'bn-bd': ()=>import("dayjs/locale/bn-bd"),
|
|
47
47
|
bn: ()=>import("dayjs/locale/bn"),
|
|
48
48
|
bo: ()=>import("dayjs/locale/bo"),
|
|
49
49
|
br: ()=>import("dayjs/locale/br"),
|
|
@@ -53,49 +53,49 @@ const locales = {
|
|
|
53
53
|
cv: ()=>import("dayjs/locale/cv"),
|
|
54
54
|
cy: ()=>import("dayjs/locale/cy"),
|
|
55
55
|
da: ()=>import("dayjs/locale/da"),
|
|
56
|
-
'de-
|
|
57
|
-
'de-
|
|
56
|
+
'de-at': ()=>import("dayjs/locale/de-at"),
|
|
57
|
+
'de-ch': ()=>import("dayjs/locale/de-ch"),
|
|
58
58
|
de: ()=>import("dayjs/locale/de"),
|
|
59
59
|
dv: ()=>import("dayjs/locale/dv"),
|
|
60
|
-
'en-
|
|
60
|
+
'en-au': ()=>import("dayjs/locale/en-au"),
|
|
61
61
|
el: ()=>import("dayjs/locale/el"),
|
|
62
|
-
'en-
|
|
63
|
-
'en-
|
|
64
|
-
'en-
|
|
65
|
-
'en-
|
|
66
|
-
'en-
|
|
67
|
-
'en-
|
|
68
|
-
'en-
|
|
69
|
-
'en-
|
|
62
|
+
'en-gb': ()=>import("dayjs/locale/en-gb"),
|
|
63
|
+
'en-ie': ()=>import("dayjs/locale/en-ie"),
|
|
64
|
+
'en-il': ()=>import("dayjs/locale/en-il"),
|
|
65
|
+
'en-in': ()=>import("dayjs/locale/en-in"),
|
|
66
|
+
'en-nz': ()=>import("dayjs/locale/en-nz"),
|
|
67
|
+
'en-sg': ()=>import("dayjs/locale/en-sg"),
|
|
68
|
+
'en-tt': ()=>import("dayjs/locale/en-tt"),
|
|
69
|
+
'en-ca': ()=>import("dayjs/locale/en-ca"),
|
|
70
70
|
en: ()=>import("dayjs/locale/en"),
|
|
71
71
|
eo: ()=>import("dayjs/locale/eo"),
|
|
72
|
-
'es-
|
|
73
|
-
'es-
|
|
74
|
-
'es-
|
|
75
|
-
'es-
|
|
72
|
+
'es-mx': ()=>import("dayjs/locale/es-mx"),
|
|
73
|
+
'es-pr': ()=>import("dayjs/locale/es-pr"),
|
|
74
|
+
'es-us': ()=>import("dayjs/locale/es-us"),
|
|
75
|
+
'es-do': ()=>import("dayjs/locale/es-do"),
|
|
76
76
|
et: ()=>import("dayjs/locale/et"),
|
|
77
77
|
eu: ()=>import("dayjs/locale/eu"),
|
|
78
78
|
fa: ()=>import("dayjs/locale/fa"),
|
|
79
79
|
fi: ()=>import("dayjs/locale/fi"),
|
|
80
|
-
'fr-
|
|
81
|
-
'fr-
|
|
80
|
+
'fr-ca': ()=>import("dayjs/locale/fr-ca"),
|
|
81
|
+
'fr-ch': ()=>import("dayjs/locale/fr-ch"),
|
|
82
82
|
fr: ()=>import("dayjs/locale/fr"),
|
|
83
83
|
fo: ()=>import("dayjs/locale/fo"),
|
|
84
84
|
fy: ()=>import("dayjs/locale/fy"),
|
|
85
85
|
ga: ()=>import("dayjs/locale/ga"),
|
|
86
86
|
gd: ()=>import("dayjs/locale/gd"),
|
|
87
87
|
gl: ()=>import("dayjs/locale/gl"),
|
|
88
|
-
'gom-
|
|
88
|
+
'gom-latn': ()=>import("dayjs/locale/gom-latn"),
|
|
89
89
|
gu: ()=>import("dayjs/locale/gu"),
|
|
90
90
|
he: ()=>import("dayjs/locale/he"),
|
|
91
91
|
hi: ()=>import("dayjs/locale/hi"),
|
|
92
92
|
hr: ()=>import("dayjs/locale/hr"),
|
|
93
93
|
ht: ()=>import("dayjs/locale/ht"),
|
|
94
94
|
hu: ()=>import("dayjs/locale/hu"),
|
|
95
|
-
'hy-
|
|
95
|
+
'hy-am': ()=>import("dayjs/locale/hy-am"),
|
|
96
96
|
id: ()=>import("dayjs/locale/id"),
|
|
97
97
|
is: ()=>import("dayjs/locale/is"),
|
|
98
|
-
'it-
|
|
98
|
+
'it-ch': ()=>import("dayjs/locale/it-ch"),
|
|
99
99
|
it: ()=>import("dayjs/locale/it"),
|
|
100
100
|
jv: ()=>import("dayjs/locale/jv"),
|
|
101
101
|
ka: ()=>import("dayjs/locale/ka"),
|
|
@@ -115,7 +115,7 @@ const locales = {
|
|
|
115
115
|
ml: ()=>import("dayjs/locale/ml"),
|
|
116
116
|
mn: ()=>import("dayjs/locale/mn"),
|
|
117
117
|
mr: ()=>import("dayjs/locale/mr"),
|
|
118
|
-
'ms-
|
|
118
|
+
'ms-my': ()=>import("dayjs/locale/ms-my"),
|
|
119
119
|
ms: ()=>import("dayjs/locale/ms"),
|
|
120
120
|
mt: ()=>import("dayjs/locale/mt"),
|
|
121
121
|
lo: ()=>import("dayjs/locale/lo"),
|
|
@@ -123,11 +123,11 @@ const locales = {
|
|
|
123
123
|
nb: ()=>import("dayjs/locale/nb"),
|
|
124
124
|
ne: ()=>import("dayjs/locale/ne"),
|
|
125
125
|
nl: ()=>import("dayjs/locale/nl"),
|
|
126
|
-
'nl-
|
|
126
|
+
'nl-be': ()=>import("dayjs/locale/nl-be"),
|
|
127
127
|
nn: ()=>import("dayjs/locale/nn"),
|
|
128
|
-
'pa-
|
|
128
|
+
'pa-in': ()=>import("dayjs/locale/pa-in"),
|
|
129
129
|
pl: ()=>import("dayjs/locale/pl"),
|
|
130
|
-
'pt-
|
|
130
|
+
'pt-br': ()=>import("dayjs/locale/pt-br"),
|
|
131
131
|
pt: ()=>import("dayjs/locale/pt"),
|
|
132
132
|
rn: ()=>import("dayjs/locale/rn"),
|
|
133
133
|
ro: ()=>import("dayjs/locale/ro"),
|
|
@@ -139,12 +139,12 @@ const locales = {
|
|
|
139
139
|
si: ()=>import("dayjs/locale/si"),
|
|
140
140
|
sk: ()=>import("dayjs/locale/sk"),
|
|
141
141
|
sl: ()=>import("dayjs/locale/sl"),
|
|
142
|
-
'oc-
|
|
142
|
+
'oc-lnc': ()=>import("dayjs/locale/oc-lnc"),
|
|
143
143
|
sq: ()=>import("dayjs/locale/sq"),
|
|
144
|
-
'sr-
|
|
144
|
+
'sr-cyrl': ()=>import("dayjs/locale/sr-cyrl"),
|
|
145
145
|
sr: ()=>import("dayjs/locale/sr"),
|
|
146
146
|
ss: ()=>import("dayjs/locale/ss"),
|
|
147
|
-
'sv-
|
|
147
|
+
'sv-fi': ()=>import("dayjs/locale/sv-fi"),
|
|
148
148
|
sv: ()=>import("dayjs/locale/sv"),
|
|
149
149
|
sw: ()=>import("dayjs/locale/sw"),
|
|
150
150
|
ta: ()=>import("dayjs/locale/ta"),
|
|
@@ -152,24 +152,24 @@ const locales = {
|
|
|
152
152
|
tet: ()=>import("dayjs/locale/tet"),
|
|
153
153
|
tg: ()=>import("dayjs/locale/tg"),
|
|
154
154
|
th: ()=>import("dayjs/locale/th"),
|
|
155
|
-
'tl-
|
|
155
|
+
'tl-ph': ()=>import("dayjs/locale/tl-ph"),
|
|
156
156
|
tlh: ()=>import("dayjs/locale/tlh"),
|
|
157
157
|
tr: ()=>import("dayjs/locale/tr"),
|
|
158
158
|
tzl: ()=>import("dayjs/locale/tzl"),
|
|
159
159
|
tzm: ()=>import("dayjs/locale/tzm"),
|
|
160
|
-
'ug-
|
|
160
|
+
'ug-cn': ()=>import("dayjs/locale/ug-cn"),
|
|
161
161
|
uk: ()=>import("dayjs/locale/uk"),
|
|
162
162
|
tk: ()=>import("dayjs/locale/tk"),
|
|
163
163
|
ur: ()=>import("dayjs/locale/ur"),
|
|
164
|
-
'uz-
|
|
164
|
+
'uz-latn': ()=>import("dayjs/locale/uz-latn"),
|
|
165
165
|
uz: ()=>import("dayjs/locale/uz"),
|
|
166
166
|
vi: ()=>import("dayjs/locale/vi"),
|
|
167
|
-
'x-
|
|
168
|
-
'tzm-
|
|
167
|
+
'x-pseudo': ()=>import("dayjs/locale/x-pseudo"),
|
|
168
|
+
'tzm-latn': ()=>import("dayjs/locale/tzm-latn"),
|
|
169
169
|
yo: ()=>import("dayjs/locale/yo"),
|
|
170
|
-
'zh-
|
|
171
|
-
'zh-
|
|
172
|
-
'zh-
|
|
170
|
+
'zh-cn': ()=>import("dayjs/locale/zh-cn"),
|
|
171
|
+
'zh-hk': ()=>import("dayjs/locale/zh-hk"),
|
|
172
|
+
'zh-tw': ()=>import("dayjs/locale/zh-tw"),
|
|
173
173
|
zh: ()=>import("dayjs/locale/zh")
|
|
174
174
|
};
|
|
175
175
|
__webpack_require__.d(__webpack_exports__, {}, {
|
|
@@ -43,20 +43,34 @@ const external_dayjs_namespaceObject = require("dayjs");
|
|
|
43
43
|
var external_dayjs_default = /*#__PURE__*/ __webpack_require__.n(external_dayjs_namespaceObject);
|
|
44
44
|
const dayjs_locales_data_cjs_namespaceObject = require("../generated/dayjs-locales-data.cjs");
|
|
45
45
|
const warn = (language)=>console.warn(`Cannot load dayjs locale file for "${language}"`);
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
const getCandidateLocales = (languageInput)=>{
|
|
47
|
+
try {
|
|
48
|
+
const { language, script, region } = new Intl.Locale(languageInput);
|
|
49
|
+
return [
|
|
50
|
+
languageInput,
|
|
51
|
+
...region ? [
|
|
52
|
+
`${language}-${region}`
|
|
53
|
+
] : [],
|
|
54
|
+
...script ? [
|
|
55
|
+
`${language}-${script}`
|
|
56
|
+
] : [],
|
|
57
|
+
language
|
|
58
|
+
];
|
|
59
|
+
} catch {
|
|
60
|
+
return [
|
|
61
|
+
languageInput,
|
|
62
|
+
languageInput.split('-')[0]
|
|
63
|
+
];
|
|
51
64
|
}
|
|
52
|
-
return languageInput;
|
|
53
65
|
};
|
|
54
|
-
|
|
66
|
+
const resolveLanguage = (languageInput)=>getCandidateLocales(languageInput).map((locale)=>locale.toLowerCase()).find((locale)=>Object.hasOwn(dayjs_locales_data_cjs_namespaceObject.locales, locale)) ?? languageInput;
|
|
67
|
+
async function loadDayjsLocale(languageInput) {
|
|
55
68
|
const language = resolveLanguage(languageInput);
|
|
56
69
|
if (!dayjs_locales_data_cjs_namespaceObject.locales[language]) return void warn(language);
|
|
57
70
|
try {
|
|
58
|
-
dayjs_locales_data_cjs_namespaceObject.locales[language]()
|
|
59
|
-
|
|
71
|
+
await dayjs_locales_data_cjs_namespaceObject.locales[language]();
|
|
72
|
+
external_dayjs_default().locale(language);
|
|
73
|
+
} catch {
|
|
60
74
|
warn(language);
|
|
61
75
|
}
|
|
62
76
|
}
|
|
@@ -31,7 +31,11 @@ function getFieldCaptionNamespace(field) {
|
|
|
31
31
|
return `caption-${field}`;
|
|
32
32
|
}
|
|
33
33
|
function getFieldCaptions(field, i18n) {
|
|
34
|
-
|
|
34
|
+
const namespace = getFieldCaptionNamespace(field);
|
|
35
|
+
return (i18n.languages ?? []).reduceRight((captions, language)=>({
|
|
36
|
+
...captions,
|
|
37
|
+
...i18n.getResourceBundle(language, namespace)
|
|
38
|
+
}), {});
|
|
35
39
|
}
|
|
36
40
|
function getFieldValueCaption(field, facetValue, i18n) {
|
|
37
41
|
return i18n.t(facetValue, {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
function withCountry(language, country) {
|
|
31
|
+
if (!country) return language;
|
|
32
|
+
try {
|
|
33
|
+
if (new Intl.Locale(language).region) return language;
|
|
34
|
+
return new Intl.Locale(language, {
|
|
35
|
+
region: country
|
|
36
|
+
}).toString();
|
|
37
|
+
} catch {
|
|
38
|
+
return language;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
42
|
+
withCountry: ()=>withCountry
|
|
43
|
+
});
|
|
44
|
+
exports.withCountry = __webpack_exports__.withCountry;
|
|
45
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
46
|
+
"withCountry"
|
|
47
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
48
|
+
Object.defineProperty(exports, '__esModule', {
|
|
49
|
+
value: true
|
|
50
|
+
});
|
package/dist/cjs/versions.cjs
CHANGED
|
@@ -32,7 +32,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
32
32
|
headlessVersion: ()=>package_json_namespaceObject.version
|
|
33
33
|
});
|
|
34
34
|
const package_json_namespaceObject = require("@coveo/headless/package.json");
|
|
35
|
-
const atomicVersion = "3.
|
|
35
|
+
const atomicVersion = "3.63.0";
|
|
36
36
|
exports.atomicVersion = __webpack_exports__.atomicVersion;
|
|
37
37
|
exports.headlessVersion = __webpack_exports__.headlessVersion;
|
|
38
38
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
@@ -16,6 +16,7 @@ import { ChildrenUpdateCompleteMixin } from "../../../mixins/children-update-com
|
|
|
16
16
|
import { markParentAsReady } from "../../../utils/init-queue.js";
|
|
17
17
|
import { waitForAtomicChildrenToBeDefined } from "../../../utils/initialization-common-utils.js";
|
|
18
18
|
import { SafeStorage, StorageItems } from "../../../utils/local-storage-utils.js";
|
|
19
|
+
import { withCountry } from "../../../utils/locale-utils.js";
|
|
19
20
|
import { getAnalyticsConfig } from "./analytics-config.js";
|
|
20
21
|
import { createCommerceStore } from "./store.js";
|
|
21
22
|
function _ts_decorate(decorators, target, key, desc) {
|
|
@@ -72,7 +73,7 @@ class AtomicCommerceInterface extends ChildrenUpdateCompleteMixin(LitElement) {
|
|
|
72
73
|
}
|
|
73
74
|
updateLocale(language, country, currency) {
|
|
74
75
|
if (!this.interfaceController.engineIsCreated(this.engine) || !this.context) return;
|
|
75
|
-
language && this.interfaceController.onLanguageChange(language);
|
|
76
|
+
if (language || country && this.localizeWithCountry) this.interfaceController.onLanguageChange(this.getLocale(language || this.context.state.language, country || this.context.state.country));
|
|
76
77
|
if (this.isNewLocale(language, country, currency)) {
|
|
77
78
|
const { setContext } = loadContextActions(this.engine);
|
|
78
79
|
this.engine.dispatch(setContext({
|
|
@@ -97,7 +98,11 @@ class AtomicCommerceInterface extends ChildrenUpdateCompleteMixin(LitElement) {
|
|
|
97
98
|
if (!this.interfaceController.engineIsCreated(this.engine) || !this.language || !this.context) return;
|
|
98
99
|
this.engine.logger.warn('The `language` property will be removed in the next major version of Atomic (v4). Rather than using this property, set the initial language through the engine configuration when calling `initialize` or `initializeWithEngine`, and update the language as needed using the `updateLocale` method.');
|
|
99
100
|
this.context.setLanguage(this.language);
|
|
100
|
-
return this.interfaceController.onLanguageChange();
|
|
101
|
+
return this.interfaceController.onLanguageChange(this.getLocale(this.language, this.context.state.country));
|
|
102
|
+
}
|
|
103
|
+
toggleLocalizeWithCountry() {
|
|
104
|
+
if (!this.context) return;
|
|
105
|
+
this.interfaceController.onLanguageChange(this.getLocale(this.context.state.language, this.context.state.country));
|
|
101
106
|
}
|
|
102
107
|
updateIconAssetsPath() {
|
|
103
108
|
this.store.state.iconAssetsPath = this.iconAssetsPath;
|
|
@@ -138,7 +143,10 @@ class AtomicCommerceInterface extends ChildrenUpdateCompleteMixin(LitElement) {
|
|
|
138
143
|
}
|
|
139
144
|
initLanguage() {
|
|
140
145
|
if (!this.context || this.language) return;
|
|
141
|
-
this.interfaceController.onLanguageChange(this.context.state.language);
|
|
146
|
+
this.interfaceController.onLanguageChange(this.getLocale(this.context.state.language, this.context.state.country));
|
|
147
|
+
}
|
|
148
|
+
getLocale(language, country) {
|
|
149
|
+
return this.localizeWithCountry ? withCountry(language, country) : language;
|
|
142
150
|
}
|
|
143
151
|
initRequestStatus() {
|
|
144
152
|
this.searchOrListing = 'product-listing' === this.type ? buildProductListing(this.engine) : buildSearch(this.engine);
|
|
@@ -202,7 +210,7 @@ class AtomicCommerceInterface extends ChildrenUpdateCompleteMixin(LitElement) {
|
|
|
202
210
|
this.bindings.engine.logger.info(`History pushState #${newFragment}`);
|
|
203
211
|
}
|
|
204
212
|
constructor(){
|
|
205
|
-
super(), this.bindings = {}, this.unsubscribeUrlManager = ()=>{}, this.unsubscribeSummary = ()=>{}, this.initialized = false, this.interfaceController = new InterfaceController(this, 'CoveoAtomic', VERSION), this.type = 'search', this.analytics = true, this.reflectStateInUrl = true, this.disableStateReflectionInUrl = false, this.scrollContainer = 'atomic-commerce-interface', this.languageAssetsPath = './lang', this.iconAssetsPath = './assets', this.handleInitialization = (event)=>{
|
|
213
|
+
super(), this.bindings = {}, this.unsubscribeUrlManager = ()=>{}, this.unsubscribeSummary = ()=>{}, this.initialized = false, this.interfaceController = new InterfaceController(this, 'CoveoAtomic', VERSION), this.type = 'search', this.analytics = true, this.localizeWithCountry = false, this.reflectStateInUrl = true, this.disableStateReflectionInUrl = false, this.scrollContainer = 'atomic-commerce-interface', this.languageAssetsPath = './lang', this.iconAssetsPath = './assets', this.handleInitialization = (event)=>{
|
|
206
214
|
this.interfaceController.onComponentInitializing(event);
|
|
207
215
|
}, this.onHashChange = ()=>{
|
|
208
216
|
this.urlManager.synchronize(this.fragment);
|
|
@@ -264,6 +272,13 @@ _ts_decorate([
|
|
|
264
272
|
}),
|
|
265
273
|
_ts_metadata("design:type", String)
|
|
266
274
|
], AtomicCommerceInterface.prototype, "language", void 0);
|
|
275
|
+
_ts_decorate([
|
|
276
|
+
property({
|
|
277
|
+
type: Boolean,
|
|
278
|
+
attribute: 'localize-with-country',
|
|
279
|
+
reflect: true
|
|
280
|
+
})
|
|
281
|
+
], AtomicCommerceInterface.prototype, "localizeWithCountry", void 0);
|
|
267
282
|
_ts_decorate([
|
|
268
283
|
property({
|
|
269
284
|
type: Object,
|
|
@@ -319,6 +334,12 @@ _ts_decorate([
|
|
|
319
334
|
_ts_metadata("design:paramtypes", []),
|
|
320
335
|
_ts_metadata("design:returntype", void 0)
|
|
321
336
|
], AtomicCommerceInterface.prototype, "updateLanguage", null);
|
|
337
|
+
_ts_decorate([
|
|
338
|
+
watch('localizeWithCountry'),
|
|
339
|
+
_ts_metadata("design:type", Function),
|
|
340
|
+
_ts_metadata("design:paramtypes", []),
|
|
341
|
+
_ts_metadata("design:returntype", void 0)
|
|
342
|
+
], AtomicCommerceInterface.prototype, "toggleLocalizeWithCountry", null);
|
|
322
343
|
_ts_decorate([
|
|
323
344
|
watch('iconAssetsPath'),
|
|
324
345
|
_ts_metadata("design:type", Function),
|
|
@@ -7,6 +7,7 @@ import { when } from "lit/directives/when.js";
|
|
|
7
7
|
import { createAppLoadedListener } from "../../common/interface/store.js";
|
|
8
8
|
import { renderPageButtons, renderPagerNextButton, renderPagerPageButton, renderPagerPreviousButton } from "../../common/pager/pager-buttons.js";
|
|
9
9
|
import { renderPagerNavigation } from "../../common/pager/pager-navigation.js";
|
|
10
|
+
import { PagerFitController } from "../../common/pager/pager-fit-controller.js";
|
|
10
11
|
import { getCurrentPagesRange } from "../../common/pager/pager-utils.js";
|
|
11
12
|
import { ValidatePropsController } from "../../common/validate-props-controller/validate-props-controller.js";
|
|
12
13
|
import { bindStateToController } from "../../../decorators/bind-state.js";
|
|
@@ -38,7 +39,7 @@ class AtomicCommercePager extends LitElement {
|
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
41
|
render() {
|
|
41
|
-
const pagesRange = getCurrentPagesRange(this.pagerState.page, this.numberOfPages, this.pagerState.totalPages - 1);
|
|
42
|
+
const pagesRange = getCurrentPagesRange(this.pagerState.page, this.pagerFit.getNumberOfPagesToDisplay(this.numberOfPages), this.pagerState.totalPages - 1);
|
|
42
43
|
return html`
|
|
43
44
|
${when(this.pagerState.totalPages > 1 && this.isAppLoaded, ()=>html`
|
|
44
45
|
${renderPagerNavigation({
|
|
@@ -109,7 +110,7 @@ class AtomicCommercePager extends LitElement {
|
|
|
109
110
|
});
|
|
110
111
|
}
|
|
111
112
|
constructor(){
|
|
112
|
-
super(), this.isAppLoaded = false, this.numberOfPages = 5, this.previousButtonIcon = arrow_left_rounded, this.nextButtonIcon = arrow_right_rounded, this.ariaMessage = new AriaLiveRegionController(this, 'atomic-pager');
|
|
113
|
+
super(), this.isAppLoaded = false, this.numberOfPages = 5, this.previousButtonIcon = arrow_left_rounded, this.nextButtonIcon = arrow_right_rounded, this.ariaMessage = new AriaLiveRegionController(this, 'atomic-pager'), this.pagerFit = new PagerFitController(this);
|
|
113
114
|
new ValidatePropsController(this, ()=>({
|
|
114
115
|
numberOfPages: this.numberOfPages
|
|
115
116
|
}), AtomicCommercePager.propsSchema);
|
|
@@ -48,7 +48,7 @@ class AtomicCommerceProductsPerPage extends LitElement {
|
|
|
48
48
|
render() {
|
|
49
49
|
return html`
|
|
50
50
|
${when(!this.summaryState.hasError && this.summaryState.hasProducts && this.isAppLoaded, ()=>html`
|
|
51
|
-
<div class="flex items-center">
|
|
51
|
+
<div class="flex flex-wrap items-center">
|
|
52
52
|
${renderLabel()(html`${this.label}`)}
|
|
53
53
|
${renderFieldsetGroup({
|
|
54
54
|
props: {
|
|
@@ -10,6 +10,7 @@ import { withTailwindStyles } from "../../../decorators/with-tailwind-styles.js"
|
|
|
10
10
|
import { ChildrenUpdateCompleteMixin } from "../../../mixins/children-update-complete-mixin.js";
|
|
11
11
|
import { markParentAsReady } from "../../../utils/init-queue.js";
|
|
12
12
|
import { waitForAtomicChildrenToBeDefined } from "../../../utils/initialization-common-utils.js";
|
|
13
|
+
import { withCountry } from "../../../utils/locale-utils.js";
|
|
13
14
|
import { bindingsContext } from "../../common/context/bindings-context.js";
|
|
14
15
|
import { augmentAnalyticsConfigWithAtomicVersion } from "../../common/interface/analytics-config.js";
|
|
15
16
|
import { InterfaceController } from "../../common/interface/interface-controller.js";
|
|
@@ -40,7 +41,7 @@ class AtomicCommerceRecommendationInterface extends ChildrenUpdateCompleteMixin(
|
|
|
40
41
|
}
|
|
41
42
|
updateLocale(language, country, currency) {
|
|
42
43
|
if (!this.interfaceController.engineIsCreated(this.engine) || !this.context) return;
|
|
43
|
-
language && this.interfaceController.onLanguageChange(language);
|
|
44
|
+
if (language || country && this.localizeWithCountry) this.interfaceController.onLanguageChange(this.getLocale(language || this.context.state.language, country || this.context.state.country));
|
|
44
45
|
if (this.isNewLocale(language, country, currency)) {
|
|
45
46
|
const { setContext } = loadContextActions(this.engine);
|
|
46
47
|
this.engine.dispatch(setContext({
|
|
@@ -63,11 +64,15 @@ class AtomicCommerceRecommendationInterface extends ChildrenUpdateCompleteMixin(
|
|
|
63
64
|
updateIconAssetsPath() {
|
|
64
65
|
this.store.state.iconAssetsPath = this.iconAssetsPath;
|
|
65
66
|
}
|
|
67
|
+
toggleLocalizeWithCountry() {
|
|
68
|
+
if (!this.context) return;
|
|
69
|
+
this.interfaceController.onLanguageChange(this.getLocale(this.context.state.language, this.context.state.country));
|
|
70
|
+
}
|
|
66
71
|
async updateLanguage() {
|
|
67
72
|
if (!this.interfaceController.engineIsCreated(this.engine) || !this.language || !this.context) return;
|
|
68
73
|
this.engine.logger.warn('The `language` property will be removed in the next major version of Atomic (v4). Rather than using this property, set the initial language through the engine configuration when calling `initializeWithEngine`, and update the language as needed using the `updateLocale` method.');
|
|
69
74
|
this.context.setLanguage(this.language);
|
|
70
|
-
return this.interfaceController.onLanguageChange();
|
|
75
|
+
return this.interfaceController.onLanguageChange(this.getLocale(this.language, this.context.state.country));
|
|
71
76
|
}
|
|
72
77
|
disconnectedCallback() {
|
|
73
78
|
super.disconnectedCallback();
|
|
@@ -108,14 +113,17 @@ class AtomicCommerceRecommendationInterface extends ChildrenUpdateCompleteMixin(
|
|
|
108
113
|
}
|
|
109
114
|
initLanguage() {
|
|
110
115
|
if (!this.context || this.language) return;
|
|
111
|
-
this.interfaceController.onLanguageChange(this.context.state.language);
|
|
116
|
+
this.interfaceController.onLanguageChange(this.getLocale(this.context.state.language, this.context.state.country));
|
|
117
|
+
}
|
|
118
|
+
getLocale(language, country) {
|
|
119
|
+
return this.localizeWithCountry ? withCountry(language, country) : language;
|
|
112
120
|
}
|
|
113
121
|
isNewLocale(language, country, currency) {
|
|
114
122
|
if (!this.context) return false;
|
|
115
123
|
return language && language !== this.context.state.language || country && country !== this.context.state.country || currency && currency !== this.context.state.currency;
|
|
116
124
|
}
|
|
117
125
|
constructor(){
|
|
118
|
-
super(), this.bindings = {}, this.interfaceController = new InterfaceController(this, 'CoveoAtomic', VERSION), this.scrollContainer = 'atomic-commerce-recommendation-interface', this.languageAssetsPath = './lang', this.iconAssetsPath = './assets', this.analytics = true, this.handleInitialization = (event)=>{
|
|
126
|
+
super(), this.bindings = {}, this.interfaceController = new InterfaceController(this, 'CoveoAtomic', VERSION), this.scrollContainer = 'atomic-commerce-recommendation-interface', this.languageAssetsPath = './lang', this.iconAssetsPath = './assets', this.localizeWithCountry = false, this.analytics = true, this.handleInitialization = (event)=>{
|
|
119
127
|
this.interfaceController.onComponentInitializing(event);
|
|
120
128
|
};
|
|
121
129
|
this.store = createCommerceRecommendationStore();
|
|
@@ -183,6 +191,13 @@ _ts_decorate([
|
|
|
183
191
|
}),
|
|
184
192
|
_ts_metadata("design:type", String)
|
|
185
193
|
], AtomicCommerceRecommendationInterface.prototype, "language", void 0);
|
|
194
|
+
_ts_decorate([
|
|
195
|
+
property({
|
|
196
|
+
type: Boolean,
|
|
197
|
+
attribute: 'localize-with-country',
|
|
198
|
+
reflect: true
|
|
199
|
+
})
|
|
200
|
+
], AtomicCommerceRecommendationInterface.prototype, "localizeWithCountry", void 0);
|
|
186
201
|
_ts_decorate([
|
|
187
202
|
property({
|
|
188
203
|
type: Boolean,
|
|
@@ -203,6 +218,12 @@ _ts_decorate([
|
|
|
203
218
|
_ts_metadata("design:paramtypes", []),
|
|
204
219
|
_ts_metadata("design:returntype", void 0)
|
|
205
220
|
], AtomicCommerceRecommendationInterface.prototype, "updateIconAssetsPath", null);
|
|
221
|
+
_ts_decorate([
|
|
222
|
+
watch('localizeWithCountry'),
|
|
223
|
+
_ts_metadata("design:type", Function),
|
|
224
|
+
_ts_metadata("design:paramtypes", []),
|
|
225
|
+
_ts_metadata("design:returntype", void 0)
|
|
226
|
+
], AtomicCommerceRecommendationInterface.prototype, "toggleLocalizeWithCountry", null);
|
|
206
227
|
_ts_decorate([
|
|
207
228
|
watch('language'),
|
|
208
229
|
_ts_metadata("design:type", Function),
|
|
@@ -30,9 +30,13 @@ function i18nBackendOptions(atomicInterface) {
|
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
function loadTranslations(atomicInterface, language) {
|
|
33
|
+
async function loadTranslations(atomicInterface, language) {
|
|
34
|
+
const { languageUtils } = atomicInterface.i18n.services;
|
|
35
|
+
const languages = languageUtils.toResolveHierarchy(languageUtils.formatLanguageCode(language), false);
|
|
36
|
+
await Promise.all(languages.filter(isI18nLocaleAvailable).map((lng)=>loadTranslationBundle(atomicInterface, lng)));
|
|
37
|
+
}
|
|
38
|
+
function loadTranslationBundle(atomicInterface, lng) {
|
|
34
39
|
const { i18n } = atomicInterface;
|
|
35
|
-
const lng = language.split('-')[0];
|
|
36
40
|
return new Promise((resolve)=>{
|
|
37
41
|
new i18next_http_backend(i18n.services, i18nBackendOptions(atomicInterface)).read(lng, i18nTranslationNamespace, (_error, data)=>{
|
|
38
42
|
if (data) i18n.addResourceBundle(lng, i18nTranslationNamespace, data, true, false);
|
|
@@ -21,8 +21,10 @@ class InterfaceController {
|
|
|
21
21
|
this.host.updateIconAssetsPath();
|
|
22
22
|
initEngine();
|
|
23
23
|
if (this.host.registerFieldsToInclude) this.host.registerFieldsToInclude();
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
await Promise.all([
|
|
25
|
+
this.i18nPromise,
|
|
26
|
+
loadDayjsLocale(this.host.language || 'en')
|
|
27
|
+
]);
|
|
26
28
|
this.initComponents();
|
|
27
29
|
}
|
|
28
30
|
onAnalyticsChange() {
|
|
@@ -35,8 +37,10 @@ class InterfaceController {
|
|
|
35
37
|
const language = newLanguage ?? this.host.language;
|
|
36
38
|
const languageWithFallback = language ?? 'en';
|
|
37
39
|
const { i18n } = this.host;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
Promise.all([
|
|
41
|
+
loadDayjsLocale(languageWithFallback),
|
|
42
|
+
loadTranslations(this.host, languageWithFallback)
|
|
43
|
+
]).then(()=>{
|
|
40
44
|
i18n.changeLanguage(language);
|
|
41
45
|
});
|
|
42
46
|
}
|