@webitel/ui-sdk 24.12.135 → 24.12.136
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/CHANGELOG.md +12 -0
- package/dist/ui-sdk.js +2103 -2103
- package/dist/ui-sdk.umd.cjs +13 -13
- package/package.json +1 -1
- package/src/modules/Filters/v2/filters/components/values/_shared/composables/useFromToSecToPreviewTime.ts +41 -0
- package/src/modules/Filters/v2/filters/components/values/talk-duration/TalkDurationFilter.d.ts +4 -0
- package/src/modules/Filters/v2/filters/components/values/talk-duration/talk-duration-filter-value-field.vue +2 -6
- package/src/modules/Filters/v2/filters/components/values/talk-duration/talk-duration-filter-value-preview.vue +12 -11
- package/src/modules/Filters/v2/filters/components/values/total-duration/TotalDurationFilter.d.ts +4 -0
- package/src/modules/Filters/v2/filters/components/values/total-duration/total-duration-filter-value-field.vue +2 -5
- package/src/modules/Filters/v2/filters/components/values/total-duration/total-duration-filter-value-preview.vue +12 -11
package/package.json
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {computed} from "vue";
|
|
2
|
+
import {useI18n} from "vue-i18n";
|
|
3
|
+
|
|
4
|
+
export const useFromToSecToPreviewTime = (value: {
|
|
5
|
+
from?: number | string | null,
|
|
6
|
+
to?: number | string | null,
|
|
7
|
+
}) => {
|
|
8
|
+
const { t } = useI18n();
|
|
9
|
+
|
|
10
|
+
const format = (secsVal: number) => {
|
|
11
|
+
const minutes = Math.floor(secsVal / 60);
|
|
12
|
+
const seconds = secsVal % 60;
|
|
13
|
+
|
|
14
|
+
return `${t('webitelUI.timepicker.min')} ${minutes} ${t('webitelUI.timepicker.sec')} ${seconds}`;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const from = computed(() => {
|
|
18
|
+
const numValue = Number(value.from);
|
|
19
|
+
|
|
20
|
+
if (!numValue && numValue !== 0) {
|
|
21
|
+
return '';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return format(numValue);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const to = computed(() => {
|
|
28
|
+
const numValue = Number(value.to);
|
|
29
|
+
|
|
30
|
+
if (!numValue && numValue !== 0) {
|
|
31
|
+
return '';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return format(numValue);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
from,
|
|
39
|
+
to
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -7,13 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
<script lang="ts" setup>
|
|
9
9
|
import DurationFilterValueField from '../_shared/durations/duration-filter-value-field.vue';
|
|
10
|
+
import type {TalkDurationFilterModelValue} from "./TalkDurationFilter.d.ts";
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
from: number;
|
|
13
|
-
to: number;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const model = defineModel<ModelValue>();
|
|
12
|
+
const model = defineModel<TalkDurationFilterModelValue>();
|
|
17
13
|
</script>
|
|
18
14
|
|
|
19
15
|
<style lang="scss" scoped></style>
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="talk-duration-filter-value-preview">
|
|
3
|
-
<div v-if="
|
|
3
|
+
<div v-if="from">
|
|
4
4
|
<p class="talk-duration-filter-value-preview__title">
|
|
5
5
|
{{t('reusable.from')}}
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
|
-
<span>{{
|
|
8
|
+
<span>{{ from }}</span>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
|
-
<div v-if="
|
|
11
|
+
<div v-if="to">
|
|
12
12
|
<p class="talk-duration-filter-value-preview__title">
|
|
13
13
|
{{t('reusable.to')}}
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
|
-
<span>{{
|
|
16
|
+
<span>{{ to }}</span>
|
|
17
17
|
</div>
|
|
18
18
|
</div>
|
|
19
19
|
</template>
|
|
@@ -21,18 +21,19 @@
|
|
|
21
21
|
<script lang="ts" setup>
|
|
22
22
|
import {useI18n} from "vue-i18n";
|
|
23
23
|
|
|
24
|
+
import {useFromToSecToPreviewTime} from "../_shared/composables/useFromToSecToPreviewTime";
|
|
25
|
+
import type {TalkDurationFilterModelValue} from "./TalkDurationFilter.d.ts";
|
|
26
|
+
|
|
24
27
|
const props = defineProps<{
|
|
25
|
-
value:
|
|
28
|
+
value: TalkDurationFilterModelValue;
|
|
26
29
|
}>();
|
|
27
30
|
|
|
28
31
|
const { t } = useI18n();
|
|
29
32
|
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return `${t('webitelUI.timepicker.min')} ${minutes} ${t('webitelUI.timepicker.sec')} ${seconds}`;
|
|
35
|
-
}
|
|
33
|
+
const {
|
|
34
|
+
from,
|
|
35
|
+
to,
|
|
36
|
+
} = useFromToSecToPreviewTime(props.value);
|
|
36
37
|
</script>
|
|
37
38
|
|
|
38
39
|
<style lang="scss" scoped>
|
|
@@ -7,13 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
<script lang="ts" setup>
|
|
9
9
|
import DurationFilterValueField from '../_shared/durations/duration-filter-value-field.vue';
|
|
10
|
+
import type {TotalDurationFilterModelValue} from "./TotalDurationFilter";
|
|
10
11
|
|
|
11
|
-
type ModelValue = {
|
|
12
|
-
from: number;
|
|
13
|
-
to: number;
|
|
14
|
-
};
|
|
15
12
|
|
|
16
|
-
const model = defineModel<
|
|
13
|
+
const model = defineModel<TotalDurationFilterModelValue>();
|
|
17
14
|
</script>
|
|
18
15
|
|
|
19
16
|
<style lang="scss" scoped></style>
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="total-duration-filter-value-preview">
|
|
3
|
-
<div v-if="
|
|
3
|
+
<div v-if="from">
|
|
4
4
|
<p class="total-duration-filter-value-preview__title">
|
|
5
5
|
{{t('reusable.from')}}
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
|
-
<span>{{
|
|
8
|
+
<span>{{ from }}</span>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
|
-
<div v-if="
|
|
11
|
+
<div v-if="to">
|
|
12
12
|
<p class="total-duration-filter-value-preview__title">
|
|
13
13
|
{{t('reusable.to')}}
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
|
-
<span>{{
|
|
16
|
+
<span>{{ to }}</span>
|
|
17
17
|
</div>
|
|
18
18
|
</div>
|
|
19
19
|
</template>
|
|
@@ -21,18 +21,19 @@
|
|
|
21
21
|
<script lang="ts" setup>
|
|
22
22
|
import {useI18n} from "vue-i18n";
|
|
23
23
|
|
|
24
|
+
import {useFromToSecToPreviewTime} from "../_shared/composables/useFromToSecToPreviewTime";
|
|
25
|
+
import type {TalkDurationFilterModelValue} from "../talk-duration/TalkDurationFilter";
|
|
26
|
+
|
|
24
27
|
const props = defineProps<{
|
|
25
|
-
value:
|
|
28
|
+
value: TalkDurationFilterModelValue;
|
|
26
29
|
}>();
|
|
27
30
|
|
|
28
31
|
const { t } = useI18n();
|
|
29
32
|
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return `${t('webitelUI.timepicker.min')} ${minutes} ${t('webitelUI.timepicker.sec')} ${seconds}`;
|
|
35
|
-
}
|
|
33
|
+
const {
|
|
34
|
+
from,
|
|
35
|
+
to,
|
|
36
|
+
} = useFromToSecToPreviewTime(props.value);
|
|
36
37
|
</script>
|
|
37
38
|
|
|
38
39
|
<style lang="scss" scoped>
|