ublo-lib 1.13.2 → 1.13.4

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.
@@ -13,14 +13,14 @@
13
13
  align-items: center;
14
14
  justify-content: center;
15
15
  background: var(
16
- --cms-blue-gradient,
16
+ --ublo-blue-gradient,
17
17
  linear-gradient(
18
18
  175deg,
19
- var(--cms-blue-400, #4177f6),
20
- var(--cms-blue-500, #004cc2)
19
+ var(--ublo-blue-400, #4177f6),
20
+ var(--ublo-blue-500, #004cc2)
21
21
  )
22
22
  );
23
- border-radius: var(--cms-radius-100, 3px);
23
+ border-radius: var(--ublo-radius-100, 3px);
24
24
  cursor: pointer;
25
25
  user-select: none;
26
26
  z-index: 2;
@@ -29,7 +29,7 @@
29
29
  .toggleIcon {
30
30
  width: 16px;
31
31
  height: 16px;
32
- fill: var(--cms-grey-000, #ffffff);
32
+ fill: var(--ublo-grey-000, #ffffff);
33
33
  }
34
34
 
35
35
  .links {
@@ -40,20 +40,20 @@
40
40
  display: flex;
41
41
  flex-direction: column;
42
42
  padding: 16px;
43
- color: var(--cms-grey-000, #fff);
43
+ color: var(--ublo-grey-000, #fff);
44
44
  background: var(
45
- --cms-blue-gradient,
45
+ --ublo-blue-gradient,
46
46
  linear-gradient(
47
47
  175deg,
48
- var(--cms-secondary-color, #4177f6),
49
- var(--cms-primary-color, #004cc2)
48
+ var(--ublo-secondary-color, #4177f6),
49
+ var(--ublo-primary-color, #004cc2)
50
50
  )
51
51
  );
52
- border-radius: var(--cms-radius-300, 15px);
53
- box-shadow: var(--cms-shadow-300, 0 5px 10px rgba(0, 0, 0, 0.24));
52
+ border-radius: var(--ublo-radius-300, 15px);
53
+ box-shadow: var(--ublo-shadow-300, 0 5px 10px rgba(0, 0, 0, 0.24));
54
54
  transform-origin: bottom left;
55
55
  animation: admin-links-appearance 240ms
56
- var(--cms-transition-easing, cubic-bezier(0.4, 0, 0.2, 1));
56
+ var(--ublo-transition-easing, cubic-bezier(0.4, 0, 0.2, 1));
57
57
  }
58
58
 
59
59
  @keyframes admin-links-appearance {
@@ -12,11 +12,11 @@
12
12
  align-items: center;
13
13
  justify-content: center;
14
14
  background: var(
15
- --cms-blue-gradient,
15
+ --ublo-blue-gradient,
16
16
  linear-gradient(
17
17
  175deg,
18
- var(--cms-blue-400, #4177f6),
19
- var(--cms-blue-500, #004cc2)
18
+ var(--ublo-blue-400, #4177f6),
19
+ var(--ublo-blue-500, #004cc2)
20
20
  )
21
21
  );
22
22
  border-radius: 50%;
@@ -40,11 +40,11 @@
40
40
  font-size: 13px;
41
41
  font-family: "Open Sans", sans-serif;
42
42
  background: var(
43
- --cms-blue-gradient,
43
+ --ublo-blue-gradient,
44
44
  linear-gradient(
45
45
  175deg,
46
- var(--cms-blue-400, #4177f6),
47
- var(--cms-blue-500, #004cc2)
46
+ var(--ublo-blue-400, #4177f6),
47
+ var(--ublo-blue-500, #004cc2)
48
48
  )
49
49
  );
50
50
  border-radius: var(--ds-radius-200, 10px);
@@ -60,26 +60,29 @@ function ContactForm({
60
60
  }
61
61
  });
62
62
  }, [widgetLang]);
63
+ const handleCategory = React.useCallback(() => {
64
+ const needCategory = params?.categories?.length > 1;
65
+ setNeedCategory(needCategory);
66
+ if (!needCategory) {
67
+ if (params?.categories?.length === 1) {
68
+ update(true, "category", params.categories[0].code, []);
69
+ } else {
70
+ update(true, "category", undefined, []);
71
+ }
72
+ }
73
+ }, [params, update]);
63
74
  React.useEffect(() => {
64
75
  const getParams = async () => {
65
76
  const params = await API.fetchParams(widgetLang, resort, merchant, channel, categories, integration, uat);
66
77
  if (params === undefined || params.error !== undefined) {
67
78
  setHasError(true);
68
79
  } else {
69
- const needCategory = params?.categories?.length > 1;
70
80
  setParams(params);
71
- setNeedCategory(needCategory);
72
- if (!needCategory) {
73
- if (params?.categories?.length === 1) {
74
- update(true, "category", params.categories[0].code, []);
75
- } else {
76
- update(true, "category", undefined, []);
77
- }
78
- }
81
+ handleCategory();
79
82
  }
80
83
  };
81
84
  getParams();
82
- }, [categories, channel, integration, merchant, resort, uat, update, widgetLang]);
85
+ }, [categories, channel, handleCategory, integration, merchant, resort, uat, widgetLang]);
83
86
  const validateAll = () => {
84
87
  Object.keys(fields).forEach(key => {
85
88
  update(true, key, undefined, !needCategory && key === "category" ? undefined : fields[key].validators);
@@ -142,6 +145,7 @@ function ContactForm({
142
145
  Subject: subject?.label
143
146
  });
144
147
  setFields(Data.DEFAULT_FIELDS);
148
+ handleCategory();
145
149
  }
146
150
  }
147
151
  setSubmiting(false);
@@ -45,7 +45,7 @@
45
45
 
46
46
  .itemSelected {
47
47
  color: #fff;
48
- background-color: var(--cms-primary-color, #004cc2);
48
+ background-color: var(--ublo-primary-color, #004cc2);
49
49
  }
50
50
 
51
51
  .loader {
@@ -63,7 +63,7 @@
63
63
  width: 42px;
64
64
  height: 42px;
65
65
  border: 4px solid #f5f5f5;
66
- border-bottom-color: var(--cms-primary-color, #004cc2);
66
+ border-bottom-color: var(--ublo-primary-color, #004cc2);
67
67
  box-sizing: border-box;
68
68
  border-radius: 50%;
69
69
  animation: packages-loader-spining 640ms ease-in-out infinite;
@@ -15,7 +15,7 @@ const buttonStyles = `
15
15
  font-family: "Open Sans";
16
16
  text-transform: uppercase;
17
17
  font-weight: 700;
18
- background-color: var(--cms-primary-color, #004cc2);
18
+ background-color: var(--ublo-primary-color, #004cc2);
19
19
  border-radius: 8px;
20
20
  cursor: pointer;
21
21
  user-select: none;
@@ -137,11 +137,11 @@
137
137
  font-family: "Open Sans", sans-serif;
138
138
  letter-spacing: 1px;
139
139
  background: var(
140
- --cms-blue-gradient,
140
+ --ublo-blue-gradient,
141
141
  linear-gradient(
142
142
  175deg,
143
- var(--cms-blue-400, #4177f6),
144
- var(--cms-blue-500, #004cc2)
143
+ var(--ublo-blue-400, #4177f6),
144
+ var(--ublo-blue-500, #004cc2)
145
145
  )
146
146
  );
147
147
  padding: 5px 20px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.13.2",
3
+ "version": "1.13.4",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^2.1.0",
6
6
  "leaflet": "^1.9.1",