@webitel/ui-sdk 23.12.49 → 23.12.50-2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "23.12.49",
3
+ "version": "23.12.50-2",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -6,6 +6,7 @@
6
6
 
7
7
  --wt-indicator-text-margin: var(--spacing-2xs);
8
8
 
9
+ --wt-indicator-text-color: var(--text-main-color);
9
10
  --wt-indicator-primary-color: var(--primary-color);
10
11
  --wt-indicator-secondary-color: var(--dp-1-surface-color);
11
12
  --wt-indicator-disabled-color: var(--dp-10-surface-color);
@@ -61,6 +61,7 @@ export default {
61
61
  .wt-indicator__text {
62
62
  @extend %typo-body-1;
63
63
  margin-left: var(--wt-indicator-text-margin);
64
+ color: var(--wt-indicator-text-color);
64
65
  }
65
66
 
66
67
  .wt-indicator__indicator {
@@ -6,10 +6,12 @@
6
6
  --wt-slider-width: 100%;
7
7
  --wt-slider-input-height: 8px;
8
8
  --wt-slider-border: 1px solid var(--secondary-color);
9
- --wt-slider-background-color: var(--secondary-color);
9
+ --wt-slider-background-color: var(--dp-1-surface-color);
10
10
  --wt-slider-background-completed-color: var(--primary-color);
11
11
 
12
- --wt-slider-pointer-background-color: var(--white);
12
+ --wt-slider-pointer-background-color: var(--dp-24-surface-color);
13
+ --wt-slider-pointer-background-hover-color: var(--dp-22-surface-color);
14
+ --wt-slider-pointer-border-color: var(--dp-10-surface-color);
13
15
 
14
16
  --wt-slider-pointer-radius: 50%;
15
17
 
@@ -126,6 +126,7 @@ export default {
126
126
  border-radius: var(--wt-slider-pointer-radius);
127
127
  background: var(--wt-slider-pointer-background-color);
128
128
  -webkit-appearance: none;
129
+ transition: var(--transition);
129
130
  }
130
131
 
131
132
  &::-webkit-slider-runnable-track {
@@ -137,8 +138,10 @@ export default {
137
138
  height: var(--wt-slider-pointer-size);
138
139
  border: var(--wt-slider-border);
139
140
  border-radius: var(--wt-slider-pointer-radius);
141
+ border-color: var(--wt-slider-pointer-border-color);
140
142
  background: var(--wt-slider-pointer-background-color);
141
143
  -moz-appearance: none;
144
+ transition: var(--transition);
142
145
  }
143
146
 
144
147
  &::-moz-range-track {
@@ -154,6 +157,18 @@ export default {
154
157
  }
155
158
  }
156
159
 
160
+ .wt-slider:hover {
161
+ .wt-slider__slider {
162
+ &::-webkit-slider-thumb {
163
+ background: var(--wt-slider-pointer-background-hover-color);
164
+ }
165
+
166
+ &::-moz-range-thumb {
167
+ background: var(--wt-slider-pointer-background-hover-color);
168
+ }
169
+ }
170
+ }
171
+
157
172
  .wt-slider--disabled {
158
173
  .wt-slider__slider {
159
174
  pointer-events: none;
@@ -2,7 +2,8 @@
2
2
  :root {
3
3
  --wt-status-select-padding: 0 calc(var(--icon-size-md) + var(--spacing-xs)) 0 0; // reset wt-select padding, but preserve arrow icon padding
4
4
 
5
- --wt-status-select-option-text-color: var(--form-input-color);
6
- --wt-status-select-option-background-hover-color: var(--secondary-color);
7
- --wt-status-select-option-background-selected-color: var(--secondary-color);
5
+ --wt-status-select-option-text-color: var(--text-main-color);
6
+ --wt-status-select-option-background-color: var(--dp-22-surface-color);
7
+ --wt-status-select-option-background-hover-color: var(--secondary-light-color);
8
+ //--wt-status-select-option-background-selected-color: var(--primary-light-color);
8
9
  }
@@ -124,6 +124,7 @@ export default {
124
124
  min-height: 0;
125
125
  padding: 0;
126
126
  color: var(--wt-status-select-option-text-color);
127
+ background: var(--wt-status-select-option-background-color);
127
128
  }
128
129
 
129
130
  .multiselect__option--highlight {
@@ -131,7 +132,7 @@ export default {
131
132
  }
132
133
 
133
134
  .multiselect__option--selected {
134
- background: var(--wt-status-select-option-background-selected-color);
135
+ //background: var(--wt-status-select-option-background-selected-color);
135
136
  }
136
137
  }
137
138
  }
@@ -1,14 +1,28 @@
1
- import { computed } from 'vue';
1
+ import { computed, isReactive, isRef } from 'vue';
2
2
  import { useI18n } from 'vue-i18n';
3
3
 
4
- export function useValidation({ v, customValidators }) {
4
+ export function useValidation({ v: inputV, customValidators: inputCustomValidators }) {
5
5
  const { t } = useI18n();
6
+
7
+ // support vue options api, where v is a reactive, not ref
8
+ let v = inputV;
9
+ let customValidators = inputCustomValidators;
10
+
11
+ if (isReactive(v)) {
12
+ v = computed(() => inputV);
13
+ customValidators = computed(() => inputCustomValidators);
14
+ }
15
+
16
+ // end
17
+
18
+ console.info(v, inputV, isRef(v), isReactive(inputV));
19
+
6
20
  const isValidation = computed(() => !!v && !!v.value && !!Object.keys(v.value).length);
7
21
  const invalid = computed(() => isValidation.value && v.value.$error);
8
22
 
9
23
  const validationText = computed(() => {
10
24
  let validationText = '';
11
- if (isValidation.value && invalid) {
25
+ if (isValidation.value && invalid.value) {
12
26
  if (v.value.required?.$invalid) validationText = t('validation.required');
13
27
  else if (v.value.numeric?.$invalid) validationText = t('validation.numeric');
14
28
  else if (v.value.email?.$invalid) validationText = t('validation.email');
@@ -28,7 +42,7 @@ export function useValidation({ v, customValidators }) {
28
42
  else if (v.value.integer?.$invalid) validationText = `${t('validation.integer')}`;
29
43
  }
30
44
  // eslint-disable-next-line no-restricted-syntax
31
- for (const { name, text } of customValidators) {
45
+ for (const { name, text } of customValidators.value) {
32
46
  if (v.value[name]?.$invalid) validationText = text;
33
47
  }
34
48
  return validationText;