@webitel/ui-sdk 24.12.94 → 24.12.95

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.
Files changed (20) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/ui-sdk.js +6 -6
  3. package/dist/ui-sdk.umd.cjs +2 -2
  4. package/package.json +1 -1
  5. package/src/locale/en/en.js +1 -0
  6. package/src/locale/ru/ru.js +1 -0
  7. package/src/locale/ua/ua.js +1 -0
  8. package/src/mixins/validationMixin/useValidation.js +2 -0
  9. package/src/modules/Filters/v2/filters/components/config/dynamic-filter-config-form-label.vue +50 -0
  10. package/src/modules/Filters/v2/filters/components/{dynamic/config → config}/dynamic-filter-config-form.vue +14 -5
  11. package/src/modules/Filters/v2/filters/components/{dynamic/config → config}/dynamic-filter-config-view.vue +1 -1
  12. package/src/modules/Filters/v2/filters/components/{dynamic/dynamic-filter-add-action.vue → dynamic-filter-add-action.vue} +2 -1
  13. package/src/modules/Filters/v2/filters/components/{dynamic/preview → preview}/dynamic-filter-preview-info.vue +1 -1
  14. package/src/modules/Filters/v2/filters/components/{dynamic/preview → preview}/dynamic-filter-preview.vue +4 -4
  15. package/src/modules/Filters/v2/filters/components/table-filters-panel.vue +3 -3
  16. package/src/modules/Filters/v2/filters/components/values/users/config.js +4 -0
  17. package/src/modules/Filters/v2/filters/components/values/users/user-filter-value-field.vue +35 -0
  18. package/src/modules/Filters/v2/filters/components/values/users/user-filter-value-preview.vue +13 -0
  19. package/src/modules/Filters/v2/filters/components/static/search-filter.vue +0 -14
  20. /package/src/modules/Filters/v2/filters/components/{dynamic/dynamic-filter-panel-wrapper.vue → dynamic-filter-panel-wrapper.vue} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "24.12.94",
3
+ "version": "24.12.95",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -296,6 +296,7 @@ export default {
296
296
  macValidator: 'Should look like MAC',
297
297
  minValue: 'Value should be not less than',
298
298
  maxValue: 'Value should be not much than',
299
+ maxLength: 'The length should not be greater than',
299
300
  sameAs: 'Incorrect password',
300
301
  requiredArrayValue: 'Array should not be empty',
301
302
  minLength: 'Quantity of characters should not be less than',
@@ -293,6 +293,7 @@ export default {
293
293
  macValidator: 'Необходимо ввести MAC-адрес',
294
294
  minValue: 'Значение должно быть не меньше',
295
295
  maxValue: 'Значение должно быть не больше',
296
+ maxLength: 'Длина не должна быть больше, чем',
296
297
  sameAs: 'Неверный пароль',
297
298
  requiredArrayValue: 'Поле не должно быть пустым',
298
299
  minLength: 'Количество символов не должно быть меньше, чем',
@@ -293,6 +293,7 @@ export default {
293
293
  macValidator: 'Необхідно ввести MAC-адрес',
294
294
  minValue: 'Значення повинно бути не менше',
295
295
  maxValue: 'Значення повинно бути не більше',
296
+ maxLength: 'Довжина не повинна бути більшою, ніж',
296
297
  sameAs: 'Неправильний пароль',
297
298
  requiredArrayValue: 'Поле не повинно бути пустим',
298
299
  minLength: 'Кількість символів повинна бути не меншою, ніж',
@@ -39,6 +39,8 @@ export function useValidation({
39
39
  validationText = `${t('validation.minValue')} ${v.value.minValue.$params.min}`;
40
40
  else if (v.value.maxValue?.$invalid)
41
41
  validationText = `${t('validation.maxValue')} ${v.value.maxValue.$params.max}`;
42
+ else if (v.value.maxLength?.$invalid)
43
+ validationText = `${t('validation.maxLength')} ${v.value.maxLength.$params.max}`;
42
44
  else if (v.value.sipAccountValidator?.$invalid)
43
45
  validationText = t('validation.sipAccountValidator');
44
46
  else if (v.value.minLength?.$invalid)
@@ -0,0 +1,50 @@
1
+ <template>
2
+ <wt-input
3
+ :value="model"
4
+ :label="t('webitelUI.filters.filterLabel')"
5
+ :v="v$"
6
+ @input="model = $event"
7
+ />
8
+ </template>
9
+
10
+ <script setup lang="ts">
11
+ import { useVuelidate } from '@vuelidate/core';
12
+ import { maxLength } from '@vuelidate/validators';
13
+ import { computed, watch } from 'vue';
14
+ import { useI18n } from 'vue-i18n';
15
+
16
+ import WtInput from '../../../../../../../components/wt-input/wt-input.vue';
17
+
18
+ const MAX_STRING_LENGTH = 50;
19
+
20
+ const model = defineModel<string>();
21
+
22
+ interface Emits {
23
+ 'update:invalid': [boolean];
24
+ }
25
+ const emit = defineEmits<Emits>();
26
+
27
+ const { t } = useI18n();
28
+
29
+ const v$ = useVuelidate(
30
+ computed(() => ({
31
+ model: {
32
+ // maybe make maxLength value by props
33
+ maxLength: maxLength(MAX_STRING_LENGTH),
34
+ },
35
+ })),
36
+ { model },
37
+ { $autoDirty: true },
38
+ );
39
+ v$.value.$touch();
40
+
41
+ watch(
42
+ () => v$.value.$invalid,
43
+ (invalid) => {
44
+ emit('update:invalid', invalid);
45
+ },
46
+ { immediate: true },
47
+ );
48
+ </script>
49
+
50
+ <style scoped lang="scss"></style>
@@ -8,6 +8,7 @@
8
8
  use-value-from-options-by-prop="id"
9
9
  @input="filterName = $event"
10
10
  />
11
+
11
12
  <slot
12
13
  name="value-input"
13
14
  v-bind="{
@@ -18,11 +19,13 @@
18
19
  onValueInvalidChange: (v) => (invalid = v),
19
20
  }"
20
21
  />
21
- <wt-input
22
- v-model="filterLabel"
23
- :label="t('webitelUI.filters.filterLabel')"
24
- @input="touchedLabel = true"
22
+
23
+ <dynamic-filter-config-form-label
24
+ :value="filterLabel"
25
+ @update:value="onLabelValueUpdate"
26
+ @update:invalid="(v) => (invalid = v)"
25
27
  />
28
+
26
29
  <footer class="dynamic-filter-config-form-footer">
27
30
  <wt-button
28
31
  :disabled="invalid"
@@ -31,6 +34,7 @@
31
34
  >
32
35
  {{ t('reusable.save') }}
33
36
  </wt-button>
37
+
34
38
  <wt-button
35
39
  color="secondary"
36
40
  wide
@@ -48,13 +52,13 @@ import { ref, watch } from 'vue';
48
52
  import { useI18n } from 'vue-i18n';
49
53
 
50
54
  import WtButton from '../../../../../../../components/wt-button/wt-button.vue';
51
- import WtInput from '../../../../../../../components/wt-input/wt-input.vue';
52
55
  import WtSelect from '../../../../../../../components/wt-select/wt-select.vue';
53
56
  import type {
54
57
  FilterInitParams,
55
58
  FilterName,
56
59
  IFilter,
57
60
  } from '../../../types/Filter';
61
+ import DynamicFilterConfigFormLabel from './dynamic-filter-config-form-label.vue';
58
62
 
59
63
  interface FilterNameSelectRepresentation {
60
64
  name: string;
@@ -91,6 +95,11 @@ const editMode = !!props.filter;
91
95
 
92
96
  const invalid = ref(false);
93
97
 
98
+ const onLabelValueUpdate = (val: string) => {
99
+ filterLabel.value = val;
100
+ touchedLabel.value = true;
101
+ };
102
+
94
103
  const submit = () => {
95
104
  emit('submit', {
96
105
  name: filterName.value,
@@ -23,7 +23,7 @@
23
23
  * and their styling
24
24
  */
25
25
 
26
- import WtTooltip from '../../../../../../../components/wt-tooltip/wt-tooltip.vue';
26
+ import WtTooltip from '../../../../../../components/wt-tooltip/wt-tooltip.vue';
27
27
  </script>
28
28
 
29
29
  <style lang="scss" scoped></style>
@@ -5,7 +5,7 @@
5
5
  <p v-if="props.showLabel">
6
6
  {{ t('webitelUI.filters.addFilter') }}
7
7
  </p>
8
- <wt-icon-btn icon="add-filter" />
8
+ <wt-icon-action action="add" />
9
9
  </div>
10
10
  </template>
11
11
 
@@ -18,6 +18,7 @@
18
18
  <script lang="ts" setup>
19
19
  import { useI18n } from 'vue-i18n';
20
20
 
21
+ import WtIconAction from '../../../../../components/wt-icon-action/wt-icon-action.vue';
21
22
  import DynamicFilterConfigView from './config/dynamic-filter-config-view.vue';
22
23
 
23
24
  interface Props {
@@ -23,7 +23,7 @@
23
23
  </template>
24
24
 
25
25
  <script lang="ts" setup>
26
- import type { FilterName, FilterValue } from '../../../types/Filter';
26
+ import type { FilterName, FilterValue } from '../../types/Filter';
27
27
 
28
28
  interface Props {
29
29
  name: FilterName;
@@ -29,10 +29,10 @@
29
29
  </template>
30
30
 
31
31
  <script lang="ts" setup>
32
- import WtChip from '../../../../../../../components/wt-chip/wt-chip.vue';
33
- import WtIconBtn from '../../../../../../../components/wt-icon-btn/wt-icon-btn.vue';
34
- import WtTooltip from '../../../../../../../components/wt-tooltip/wt-tooltip.vue';
35
- import type { IFilter } from '../../../types/Filter';
32
+ import WtChip from '../../../../../../components/wt-chip/wt-chip.vue';
33
+ import WtIconBtn from '../../../../../../components/wt-icon-btn/wt-icon-btn.vue';
34
+ import WtTooltip from '../../../../../../components/wt-tooltip/wt-tooltip.vue';
35
+ import type { IFilter } from '../../types/Filter';
36
36
  import DynamicFilterConfigView from '../config/dynamic-filter-config-view.vue';
37
37
  import DynamicFilterPreviewInfo from './dynamic-filter-preview-info.vue';
38
38
 
@@ -64,9 +64,9 @@
64
64
  </template>
65
65
 
66
66
  <script lang="ts" setup>
67
- import DynamicFilterConfigForm from './dynamic/config/dynamic-filter-config-form.vue';
68
- import DynamicFilterAddAction from './dynamic/dynamic-filter-add-action.vue';
69
- import DynamicFilterPreview from './dynamic/preview/dynamic-filter-preview.vue';
67
+ import DynamicFilterConfigForm from './config/dynamic-filter-config-form.vue';
68
+ import DynamicFilterAddAction from './dynamic-filter-add-action.vue';
69
+ import DynamicFilterPreview from './preview/dynamic-filter-preview.vue';
70
70
 
71
71
  interface Props {}
72
72
 
@@ -0,0 +1,4 @@
1
+ // import { UsersApi}
2
+
3
+ export const searchMethod = UsersAPI.getLookup;
4
+ export const localePath = ''; /* label locale goes here */
@@ -0,0 +1,35 @@
1
+ <template>
2
+ <wt-select
3
+ :close-on-select="false"
4
+ :search-method="searchMethod"
5
+ :value="model"
6
+ multiple
7
+ use-value-from-options-by-prop="id"
8
+ @input="handleInput"
9
+ />
10
+ </template>
11
+
12
+ <script lang="ts" setup>
13
+ import WtSelect from '@webitel/ui-sdk/src/components/wt-select/wt-select.vue';
14
+
15
+ import { searchMethod } from './config';
16
+
17
+ type ModelValue = number[];
18
+
19
+ const model = defineModel<ModelValue>();
20
+
21
+ // const props = defineProps({});
22
+ //
23
+ // const emit = defineEmits([]);
24
+
25
+ const handleInput = (value: ModelValue) => {
26
+ model.value = value;
27
+ };
28
+
29
+ </script>
30
+
31
+ <style lang="scss" scoped>
32
+ .user-filter {
33
+
34
+ }
35
+ </style>
@@ -0,0 +1,13 @@
1
+
2
+ <template>
3
+ <div class="">
4
+ </div>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import { searchMethod } from './config';
9
+ </script>
10
+
11
+ <style scoped lang="scss">
12
+
13
+ </style>
@@ -1,14 +0,0 @@
1
- <template>
2
- <div class="search-filter"></div>
3
- </template>
4
-
5
- <script setup lang="ts">
6
- const props = defineProps({});
7
-
8
- const emit = defineEmits([]);
9
- </script>
10
-
11
- <style scoped lang="scss">
12
- .search-filter {
13
- }
14
- </style>