@webitel/ui-sdk 24.12.119 → 24.12.121

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": "24.12.119",
3
+ "version": "24.12.121",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -1,6 +1,7 @@
1
1
  import WtNavigationMenu from './on-demand/wt-navigation-menu/components/wt-navigation-menu.vue';
2
2
  import WtSelectionPopup from './on-demand/wt-selection-popup/wt-selection-popup.vue';
3
3
  import WtStartPage from './on-demand/wt-start-page/components/wt-start-page.vue';
4
+ import WtReplaceTransition from './transitions/cases/wt-replace-transition.vue';
4
5
  import WtActionBar from './wt-action-bar/wt-action-bar.vue';
5
6
  import WtAppHeader from './wt-app-header/wt-app-header.vue';
6
7
  import WtAppNavigator from './wt-app-header/wt-app-navigator.vue';
@@ -85,6 +86,7 @@ const Components = {
85
86
  WtLabel,
86
87
  WtLoader,
87
88
  WtRoundedAction,
89
+ WtReplaceTransition,
88
90
  WtCheckbox,
89
91
  WtDatepicker,
90
92
  WtIconBtn,
@@ -187,6 +189,7 @@ export {
187
189
  WtPopup,
188
190
  WtProgressBar,
189
191
  WtRadio,
192
+ WtReplaceTransition,
190
193
  WtRoundedAction,
191
194
  WtSearchBar,
192
195
  WtSelect,
@@ -0,0 +1,38 @@
1
+ <template>
2
+ <wt-transition
3
+ class="wt-replace-transition"
4
+ :duration="props.duration"
5
+ :name="transitionName"
6
+ >
7
+ <template #default>
8
+ <slot />
9
+ </template>
10
+ </wt-transition>
11
+ </template>
12
+
13
+ <script setup>
14
+ import { computed } from 'vue';
15
+
16
+ import WtTransition from '../wt-transition.vue';
17
+
18
+ const props = defineProps({
19
+ // can choose replace pattern [opacity, slide ets]
20
+ // ATTENTION!! need to add another names(patterns) to <wt-transition/>, now we have fade-opacity only
21
+ pattern: {
22
+ type: String,
23
+ default: 'opacity',
24
+ },
25
+ duration: {
26
+ type: String,
27
+ default: 'sm',
28
+ },
29
+ appear: {
30
+ type: Boolean,
31
+ default: false,
32
+ },
33
+ });
34
+
35
+ const transitionName = computed(() => `fade-${props.pattern}`);
36
+ </script>
37
+
38
+ <style lang="scss" scoped></style>
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <transition
3
+ class="wt-transition"
4
+ :class="[`wt-transition--${props.duration}`]"
5
+ :mode="props.mode"
6
+ :appear="props.appear"
7
+ :name="props.name"
8
+ >
9
+ <slot />
10
+ </transition>
11
+ </template>
12
+
13
+ <script setup>
14
+ const props = defineProps({
15
+ name: {
16
+ type: String,
17
+ default: 'fade-opacity',
18
+ },
19
+ mode: {
20
+ type: String,
21
+ default: 'out-in',
22
+ },
23
+ appear: {
24
+ type: Boolean,
25
+ default: false,
26
+ },
27
+ duration: {
28
+ type: String,
29
+ default: 'sm',
30
+ },
31
+ });
32
+ </script>
33
+
34
+ <style lang="scss" scoped>
35
+ .fade-opacity-enter-active,
36
+ .fade-opacity-leave-active {
37
+ transition: opacity;
38
+ }
39
+
40
+ .fade-opacity-enter,
41
+ .fade-opacity-leave-to {
42
+ opacity: 0;
43
+ }
44
+
45
+ .wt-transition {
46
+ &--sm {
47
+ transition-duration: 0.3s; // TODO: add variable
48
+ }
49
+ &--md {
50
+ transition-duration: 0.6s; // TODO: add variable
51
+ }
52
+ }
53
+ </style>
@@ -0,0 +1,69 @@
1
+ <template>
2
+ <wt-search-bar
3
+ :placeholder="t('reusable.search')"
4
+ :search-mode="props.searchMode"
5
+ :search-mode-options="searchModeOptions"
6
+ :value="model"
7
+ :v="v$.model"
8
+ @input="model = $event"
9
+ @search="handleSearch"
10
+ @update:search-mode="emit('update:search-mode', $event.value)"
11
+ >
12
+ <template
13
+ v-if="props.showTextSearchIcon"
14
+ #search-icon
15
+ >
16
+ <wt-icon icon="stt-search" />
17
+ </template>
18
+ </wt-search-bar>
19
+ </template>
20
+
21
+ <script lang="ts" setup>
22
+ import { useVuelidate } from '@vuelidate/core';
23
+ import { required } from '@vuelidate/validators';
24
+ import { computed } from 'vue';
25
+ import { useI18n } from 'vue-i18n';
26
+
27
+ import WtSearchBar from '../../../../../components/wt-search-bar/wt-search-bar.vue';
28
+
29
+ type ModelValue = string;
30
+ const model = defineModel<ModelValue>();
31
+
32
+ const props = defineProps<{
33
+ searchMode: string;
34
+ searchModeOptions: Record<string, string>;
35
+ showTextSearchIcon: boolean;
36
+ }>();
37
+
38
+ const emit = defineEmits<{
39
+ 'update:search-mode': [string];
40
+ 'handle-search': [string];
41
+ }>();
42
+
43
+ const { t } = useI18n();
44
+
45
+ const v$ = useVuelidate(
46
+ computed(() => ({
47
+ model: {
48
+ required,
49
+ },
50
+ })),
51
+ { model },
52
+ { $autoDirty: true },
53
+ );
54
+
55
+ const handleSearch = () => {
56
+ emit('handle-search', model.value);
57
+ };
58
+
59
+ const searchModeOptions = computed(() =>
60
+ Object.values(props.searchModeOptions).map((mode) => {
61
+ return {
62
+ value: mode,
63
+ text: t(`filters.search.${mode}`),
64
+ };
65
+ }),
66
+ );
67
+ </script>
68
+
69
+ <style lang="scss" scoped></style>