@gudhub/ssg-web-components-library 1.0.41 → 1.0.43
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/package.json +1 -1
- package/src/components/breadcrumbs/breadcrumbs-component.js +1 -1
- package/src/components/contact-us-block/contact-us-block.html +1 -1
- package/src/components/edit-mode/edit-mode.js +1 -6
- package/src/components/get-in-touch-form/get-in-touch-form.js +1 -1
- package/src/components/get-in-touch-form/inputsValidation.js +2 -2
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ class BreadcrumbsComponent extends GHComponent {
|
|
|
15
15
|
console.error(error);
|
|
16
16
|
}
|
|
17
17
|
} else {
|
|
18
|
-
this.breadcrumbsConfig = window.getConfig()
|
|
18
|
+
this.breadcrumbsConfig = window.getConfig()?.componentsConfigs?.breadcrumbsConfig || window.getConfig()?.breadcrumbsConfig;
|
|
19
19
|
this.initialRoute = this.breadcrumbsConfig[0].routesTree;
|
|
20
20
|
|
|
21
21
|
let currentUrl = new URL(window.location.href);
|
|
@@ -126,12 +126,7 @@ class EditMode extends GHComponent {
|
|
|
126
126
|
}
|
|
127
127
|
let ids = await self.findIds();
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
if (document.querySelector('html').hasAttribute('data-current-chapter')) {
|
|
131
|
-
currentChapter = document.querySelector('html').getAttribute('data-current-chapter');
|
|
132
|
-
} else {
|
|
133
|
-
currentChapter = 'pages';
|
|
134
|
-
}
|
|
129
|
+
const currentChapter = window?.constants?.currentChapter || 'pages';
|
|
135
130
|
|
|
136
131
|
const data = await gudhub.getDocument({app_id: ids.appId, item_id: ids.itemId, element_id: document.querySelector('html').getAttribute(`data-${currentChapter}-json_field_id`)});
|
|
137
132
|
const json = JSON.parse(data.data);
|
|
@@ -14,7 +14,7 @@ class GetInTouchForm extends GHComponent {
|
|
|
14
14
|
this.isFormSubmitted = false;
|
|
15
15
|
|
|
16
16
|
this.placement = 'main';
|
|
17
|
-
this.config = window.getConfig()
|
|
17
|
+
this.config = window.getConfig()?.componentsConfigs?.formConfig || window.getConfig()?.formConfig;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
onServerRender() {
|
|
@@ -40,9 +40,9 @@ const emailValidation = (input) => {
|
|
|
40
40
|
const phoneValidation = (input) => {
|
|
41
41
|
// const regex = /^\d{10}$/; // Default strict regex for checking phone number
|
|
42
42
|
|
|
43
|
-
//
|
|
43
|
+
const regex = /^\+?\d+$/; // We can write only numbers without special symbols besides "+" sign
|
|
44
44
|
|
|
45
|
-
let isValid =
|
|
45
|
+
let isValid = regex.test(input.value);
|
|
46
46
|
|
|
47
47
|
if (!isValid) {
|
|
48
48
|
input.classList.add('error');
|