@webitel/ui-sdk 26.8.63 → 26.8.65
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/dist/{caseConverters-DXegZoCt.js → caseConverters-6cy_SaV5.js} +8 -8
- package/dist/{clients-BeKkM_Tf.js → clients-DpqA006B.js} +301 -217
- package/dist/{components-DelpnGuy.js → components-CXPq3d81.js} +5228 -3247
- package/dist/{composables-BtWSAI5D.js → composables-DbGvukRz.js} +3 -3
- package/dist/{debounce-Bp3jy7S5.js → debounce-CCzQDuk5.js} +2 -2
- package/dist/{deep-copy-CTgLtgMO.js → deep-copy-CjYHLk2X.js} +1 -1
- package/dist/{dist-CAOIU8xq.js → dist-C_fngTiN.js} +1 -1
- package/dist/{dist-Crpfx4FA.js → dist-CugChoYz.js} +1 -1
- package/dist/{enums-DY3jIXFF.js → enums-CM8hOd_m.js} +29 -28
- package/dist/genClient-DMVlC4Uy.js +2088 -0
- package/dist/{rolldown-runtime-BEcgMyyN.js → rolldown-runtime-to5KK-CW.js} +5 -2
- package/dist/{side-channel-8SnAuRMA.js → side-channel-M3LABDql.js} +2 -2
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +42 -42
- package/dist/ui-sdk.umd.cjs +642 -641
- package/dist/{useValidation-Bvastl-C.js → useValidation-CDgb424A.js} +2 -2
- package/dist/{useWtTable-DLWucXPx.js → useWtTable-BbNT2rXz.js} +1 -1
- package/dist/utils-DqYQ_mrQ.js +1902 -0
- package/dist/{vue-i18n-Db_oYfO8.js → vue-i18n-DNulhn2J.js} +2 -2
- package/dist/{vue-router-Dwey8MMv.js → vue-router-B9nAVQtl.js} +1 -1
- package/dist/{wt-action-bar-C4JukltF.js → wt-action-bar-Dx2j2yCn.js} +3 -3
- package/dist/{wt-button-2_aOV7LX.js → wt-button-l_CCN7zG.js} +2 -2
- package/dist/{wt-chat-emoji-Be1WcCN8.js → wt-chat-emoji-BwCLLExE.js} +4 -4
- package/dist/{wt-datepicker-DmGisBuB.js → wt-datepicker-Dcg6mx6P.js} +3 -3
- package/dist/{wt-display-chip-items-C2xHjen9.js → wt-display-chip-items-DgDn6xoK.js} +2 -2
- package/dist/{wt-dual-panel-C98aGU8o.js → wt-dual-panel-sCqa1h4_.js} +1 -1
- package/dist/{wt-expansion-card-CEMaWXCy.js → wt-expansion-card-DKEhPBa9.js} +2 -2
- package/dist/{wt-expansion-panel-BjeXHSay.js → wt-expansion-panel-BnQ9Ow8D.js} +1 -1
- package/dist/{wt-galleria-DMCgiiju.js → wt-galleria-CNwBmLcX.js} +2 -2
- package/dist/{wt-icon-Ct0E7k_d.js → wt-icon-CjNYdMOP.js} +2 -2
- package/dist/{wt-icon-action-DB6P4E4K.js → wt-icon-action-DX9R-hzG.js} +2 -2
- package/dist/{wt-icon-btn-DZa_qsai.js → wt-icon-btn-BbPNcD-O.js} +1 -1
- package/dist/{wt-notifications-bar-BEomlIrN.js → wt-notifications-bar-BTt1vqwz.js} +2 -2
- package/dist/{wt-pagination-G2ZGU4Pi.js → wt-pagination-DNjYIHjv.js} +1 -1
- package/dist/{wt-player-CzNYyH1h.js → wt-player-CoB2InY0.js} +5 -5
- package/dist/{wt-popover-BCYPu5NC.js → wt-popover-B0SIrVz6.js} +1 -1
- package/dist/{wt-screen-recordings-action-DI1qlUi1.js → wt-screen-recordings-action-DCdRUBbd.js} +1 -0
- package/dist/{wt-search-bar-D0qgd2ve.js → wt-search-bar-DlNX3Sr8.js} +2 -2
- package/dist/{wt-selection-popup-CjYw4ppb.js → wt-selection-popup-C74__W9Z.js} +1 -1
- package/dist/{wt-send-message-popup-vBS3Rque.js → wt-send-message-popup-TJdbzgRF.js} +22 -22
- package/dist/{wt-slider-BPzRTeYU.js → wt-slider-4xCDNWv-.js} +1 -1
- package/dist/{wt-start-page-BFQExFUj.js → wt-start-page-BUjRx6RA.js} +1 -1
- package/dist/{wt-status-select-BuojqV_1.js → wt-status-select-C2-LFbrZ.js} +10 -10
- package/dist/{wt-table-DWnt7b9t.js → wt-table-BzGCTKMW.js} +3 -3
- package/dist/{wt-table-column-select-D4c56HPB.js → wt-table-column-select-CuQbrCkx.js} +3 -3
- package/dist/{wt-timepicker-C2X8A8fq.js → wt-timepicker-BltIOjh9.js} +3 -3
- package/dist/{wt-toast-eWzfeYuz.js → wt-toast-DHV4UvFz.js} +2 -2
- package/dist/{wt-tree-CMIpbXBo.js → wt-tree-DKSphRxr.js} +4 -4
- package/dist/{wt-tree-table-C-UM5kxp.js → wt-tree-table-9vnEJcX0.js} +2 -2
- package/dist/{wt-type-extension-value-input-BVBAwEBZ.js → wt-type-extension-value-input-D5Y-ds9V.js} +18 -18
- package/dist/{wt-vidstack-player-DW1JPk_N.js → wt-vidstack-player-DKf1aSC7.js} +5 -5
- package/package.json +5 -1
- package/src/api/clients/calendars/calendars.js +2 -2
- package/src/components/on-demand/wt-type-extension-value-input/wt-type-extension-value-input.vue +8 -8
- package/src/components/wt-table/wt-table.vue +1 -1
- package/src/modules/Appearance/index.ts +2 -0
- package/src/scripts/convertDurationWithDays.ts +30 -0
- package/src/scripts/index.js +15 -0
- package/src/scripts/storageFile/downloadFilesAsZip.ts +55 -0
- package/src/scripts/storageFile/downloadStorageFile.ts +27 -0
- package/src/scripts/storageFile/getFileTypeIcon.ts +6 -0
- package/src/scripts/storageFile/getStorageFileUrl.ts +17 -0
- package/src/scripts/storageFile/openStorageFileInNewTab.ts +34 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/prettifyDate.ts +14 -0
- package/types/.tsbuildinfo +1 -1
- package/types/components/on-demand/wt-type-extension-value-input/wt-type-extension-value-input.vue.d.ts +2 -2
- package/types/components/wt-table/wt-table.vue.d.ts +2 -2
- package/types/modules/Appearance/index.d.ts +2 -0
- package/types/scripts/convertDurationWithDays.d.ts +1 -0
- package/types/scripts/index.d.ts +8 -1
- package/types/scripts/storageFile/downloadFilesAsZip.d.ts +11 -0
- package/types/scripts/storageFile/downloadStorageFile.d.ts +8 -0
- package/types/scripts/storageFile/getFileTypeIcon.d.ts +1 -0
- package/types/scripts/storageFile/getStorageFileUrl.d.ts +6 -0
- package/types/scripts/storageFile/openStorageFileInNewTab.d.ts +5 -0
- package/types/utils/index.d.ts +1 -0
- package/types/utils/prettifyDate.d.ts +1 -0
- package/dist/displayText-CtaxzaBz.js +0 -3
- package/dist/genClient-HHiOUj56.js +0 -2891
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const getFileTypeIcon = (mimeType: string): string => {
|
|
2
|
+
if (mimeType.includes('image')) return 'preview-tag-image';
|
|
3
|
+
if (mimeType.includes('video')) return 'preview-tag-video';
|
|
4
|
+
if (mimeType.includes('audio')) return 'preview-tag-audio';
|
|
5
|
+
return 'attach';
|
|
6
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface GetStorageFileUrlParams {
|
|
2
|
+
id: string;
|
|
3
|
+
type?: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export const getStorageFileUrl = ({
|
|
7
|
+
id,
|
|
8
|
+
type,
|
|
9
|
+
}: GetStorageFileUrlParams): string => {
|
|
10
|
+
const token = localStorage.getItem('access-token');
|
|
11
|
+
let url = `${import.meta.env.VITE_API_URL}/storage/file/${id}/download?access_token=${token}`;
|
|
12
|
+
|
|
13
|
+
const source = type?.match(/source=[^;]+/)?.[0];
|
|
14
|
+
if (source) url = `${url}&${source}`;
|
|
15
|
+
|
|
16
|
+
return url;
|
|
17
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { getStorageFileUrl } from './getStorageFileUrl';
|
|
2
|
+
|
|
3
|
+
interface OpenStorageFileInNewTabParams {
|
|
4
|
+
id?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const openStorageFileInNewTab = async (
|
|
8
|
+
item?: OpenStorageFileInNewTabParams,
|
|
9
|
+
) => {
|
|
10
|
+
if (!item?.id) return;
|
|
11
|
+
|
|
12
|
+
// opened synchronously, before the awaits below, so browsers don't
|
|
13
|
+
// treat it as a blocked popup once the user-gesture context is gone
|
|
14
|
+
const newTab = window.open('', '_blank');
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
const url = getStorageFileUrl({
|
|
18
|
+
id: item.id,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const response = await fetch(url);
|
|
22
|
+
if (!response.ok) {
|
|
23
|
+
throw new Error(`Failed to fetch file: ${response.statusText}`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const blob = await response.blob();
|
|
27
|
+
const fileURL = URL.createObjectURL(blob);
|
|
28
|
+
|
|
29
|
+
if (newTab) newTab.location.href = fileURL;
|
|
30
|
+
} catch (error) {
|
|
31
|
+
newTab?.close();
|
|
32
|
+
console.error('Error opening file:', error);
|
|
33
|
+
}
|
|
34
|
+
};
|
package/src/utils/index.ts
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FormatDateMode } from '../enums';
|
|
2
|
+
import { formatDate } from './formatDate';
|
|
3
|
+
|
|
4
|
+
export function prettifyDate(
|
|
5
|
+
timestamp: string | number,
|
|
6
|
+
timezone?: string,
|
|
7
|
+
): string {
|
|
8
|
+
const value = Number(timestamp);
|
|
9
|
+
if (!value) return '';
|
|
10
|
+
|
|
11
|
+
return formatDate(new Date(value), FormatDateMode.DATETIME_SHORT, {
|
|
12
|
+
timezone,
|
|
13
|
+
});
|
|
14
|
+
}
|