@useupup/vue 3.3.0
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/LICENSE +21 -0
- package/README.md +67 -0
- package/dist/AudioUploader-6ZMGQ3GT.cjs +376 -0
- package/dist/AudioUploader-6ZMGQ3GT.cjs.map +1 -0
- package/dist/AudioUploader-IEWPI3TS.js +376 -0
- package/dist/AudioUploader-IEWPI3TS.js.map +1 -0
- package/dist/BoxUploader-S6CGJLO7.cjs +214 -0
- package/dist/BoxUploader-S6CGJLO7.cjs.map +1 -0
- package/dist/BoxUploader-TIDCYWMC.js +214 -0
- package/dist/BoxUploader-TIDCYWMC.js.map +1 -0
- package/dist/CameraUploader-575RARRY.js +258 -0
- package/dist/CameraUploader-575RARRY.js.map +1 -0
- package/dist/CameraUploader-LBIVBECB.cjs +258 -0
- package/dist/CameraUploader-LBIVBECB.cjs.map +1 -0
- package/dist/DropboxUploader-HTGDBDTB.cjs +216 -0
- package/dist/DropboxUploader-HTGDBDTB.cjs.map +1 -0
- package/dist/DropboxUploader-M2LY2Q32.js +216 -0
- package/dist/DropboxUploader-M2LY2Q32.js.map +1 -0
- package/dist/GoogleDriveUploader-R3WJYLW7.cjs +220 -0
- package/dist/GoogleDriveUploader-R3WJYLW7.cjs.map +1 -0
- package/dist/GoogleDriveUploader-SAY4C2QY.js +220 -0
- package/dist/GoogleDriveUploader-SAY4C2QY.js.map +1 -0
- package/dist/OneDriveUploader-EDB3RJA4.js +219 -0
- package/dist/OneDriveUploader-EDB3RJA4.js.map +1 -0
- package/dist/OneDriveUploader-WYALTOCQ.cjs +219 -0
- package/dist/OneDriveUploader-WYALTOCQ.cjs.map +1 -0
- package/dist/ScreenCaptureUploader-F65CM6OA.js +334 -0
- package/dist/ScreenCaptureUploader-F65CM6OA.js.map +1 -0
- package/dist/ScreenCaptureUploader-TZ74W7WQ.cjs +334 -0
- package/dist/ScreenCaptureUploader-TZ74W7WQ.cjs.map +1 -0
- package/dist/UrlUploader-PXEGUBQ4.js +143 -0
- package/dist/UrlUploader-PXEGUBQ4.js.map +1 -0
- package/dist/UrlUploader-TLYGV433.cjs +143 -0
- package/dist/UrlUploader-TLYGV433.cjs.map +1 -0
- package/dist/assets/logos.d.ts +5 -0
- package/dist/assets/logos.d.ts.map +1 -0
- package/dist/chunk-D32QOALR.cjs +1083 -0
- package/dist/chunk-D32QOALR.cjs.map +1 -0
- package/dist/chunk-GG4ABGXB.cjs +62 -0
- package/dist/chunk-GG4ABGXB.cjs.map +1 -0
- package/dist/chunk-GVB7IFRP.cjs +0 -0
- package/dist/chunk-GVB7IFRP.cjs.map +1 -0
- package/dist/chunk-IXLKUMV2.cjs +55 -0
- package/dist/chunk-IXLKUMV2.cjs.map +1 -0
- package/dist/chunk-M6AHIQ3M.js +62 -0
- package/dist/chunk-M6AHIQ3M.js.map +1 -0
- package/dist/chunk-PPPFIWFQ.js +1083 -0
- package/dist/chunk-PPPFIWFQ.js.map +1 -0
- package/dist/chunk-RZ7RTSRZ.js +55 -0
- package/dist/chunk-RZ7RTSRZ.js.map +1 -0
- package/dist/chunk-X6FZTCNT.js +0 -0
- package/dist/chunk-X6FZTCNT.js.map +1 -0
- package/dist/components/AudioUploader.vue.d.ts +3 -0
- package/dist/components/AudioUploader.vue.d.ts.map +1 -0
- package/dist/components/AudioWaveform.vue.d.ts +16 -0
- package/dist/components/AudioWaveform.vue.d.ts.map +1 -0
- package/dist/components/BoxUploader.vue.d.ts +3 -0
- package/dist/components/BoxUploader.vue.d.ts.map +1 -0
- package/dist/components/CameraUploader.vue.d.ts +3 -0
- package/dist/components/CameraUploader.vue.d.ts.map +1 -0
- package/dist/components/ClientBoxUploader.vue.d.ts +3 -0
- package/dist/components/ClientBoxUploader.vue.d.ts.map +1 -0
- package/dist/components/ClientDropboxUploader.vue.d.ts +3 -0
- package/dist/components/ClientDropboxUploader.vue.d.ts.map +1 -0
- package/dist/components/ClientGoogleDriveUploader.vue.d.ts +3 -0
- package/dist/components/ClientGoogleDriveUploader.vue.d.ts.map +1 -0
- package/dist/components/ClientOneDriveUploader.vue.d.ts +3 -0
- package/dist/components/ClientOneDriveUploader.vue.d.ts.map +1 -0
- package/dist/components/DefaultLoaderIcon.vue.d.ts +3 -0
- package/dist/components/DefaultLoaderIcon.vue.d.ts.map +1 -0
- package/dist/components/DropboxUploader.vue.d.ts +3 -0
- package/dist/components/DropboxUploader.vue.d.ts.map +1 -0
- package/dist/components/FileHero.vue.d.ts +13 -0
- package/dist/components/FileHero.vue.d.ts.map +1 -0
- package/dist/components/FileIcon.vue.d.ts +9 -0
- package/dist/components/FileIcon.vue.d.ts.map +1 -0
- package/dist/components/FileItem.vue.d.ts +14 -0
- package/dist/components/FileItem.vue.d.ts.map +1 -0
- package/dist/components/FileList.vue.d.ts +3 -0
- package/dist/components/FileList.vue.d.ts.map +1 -0
- package/dist/components/FilePreview.vue.d.ts +22 -0
- package/dist/components/FilePreview.vue.d.ts.map +1 -0
- package/dist/components/FilePreviewPortal.vue.d.ts +15 -0
- package/dist/components/FilePreviewPortal.vue.d.ts.map +1 -0
- package/dist/components/FilePreviewThumbnail.vue.d.ts +19 -0
- package/dist/components/FilePreviewThumbnail.vue.d.ts.map +1 -0
- package/dist/components/FileRow.vue.d.ts +17 -0
- package/dist/components/FileRow.vue.d.ts.map +1 -0
- package/dist/components/GoogleDriveUploader.vue.d.ts +3 -0
- package/dist/components/GoogleDriveUploader.vue.d.ts.map +1 -0
- package/dist/components/Icon.d.ts +36 -0
- package/dist/components/Icon.d.ts.map +1 -0
- package/dist/components/Icons.d.ts +10 -0
- package/dist/components/Icons.d.ts.map +1 -0
- package/dist/components/ImageEditorStub.vue.d.ts +3 -0
- package/dist/components/ImageEditorStub.vue.d.ts.map +1 -0
- package/dist/components/OneDriveUploader.vue.d.ts +3 -0
- package/dist/components/OneDriveUploader.vue.d.ts.map +1 -0
- package/dist/components/ScreenCaptureUploader.vue.d.ts +3 -0
- package/dist/components/ScreenCaptureUploader.vue.d.ts.map +1 -0
- package/dist/components/ServerModeDriveUploader.vue.d.ts +9 -0
- package/dist/components/ServerModeDriveUploader.vue.d.ts.map +1 -0
- package/dist/components/SourceSelector.vue.d.ts +3 -0
- package/dist/components/SourceSelector.vue.d.ts.map +1 -0
- package/dist/components/SourceView.vue.d.ts +3 -0
- package/dist/components/SourceView.vue.d.ts.map +1 -0
- package/dist/components/UploaderPanel.vue.d.ts +3 -0
- package/dist/components/UploaderPanel.vue.d.ts.map +1 -0
- package/dist/components/UrlUploader.vue.d.ts +3 -0
- package/dist/components/UrlUploader.vue.d.ts.map +1 -0
- package/dist/components/shared/DriveAuthFallback.vue.d.ts +12 -0
- package/dist/components/shared/DriveAuthFallback.vue.d.ts.map +1 -0
- package/dist/components/shared/DriveBrowser.vue.d.ts +28 -0
- package/dist/components/shared/DriveBrowser.vue.d.ts.map +1 -0
- package/dist/components/shared/DriveBrowserHeader.vue.d.ts +13 -0
- package/dist/components/shared/DriveBrowserHeader.vue.d.ts.map +1 -0
- package/dist/components/shared/DriveBrowserIcon.vue.d.ts +7 -0
- package/dist/components/shared/DriveBrowserIcon.vue.d.ts.map +1 -0
- package/dist/components/shared/DriveBrowserItem.vue.d.ts +9 -0
- package/dist/components/shared/DriveBrowserItem.vue.d.ts.map +1 -0
- package/dist/components/shared/FileSuccessCheck.vue.d.ts +20 -0
- package/dist/components/shared/FileSuccessCheck.vue.d.ts.map +1 -0
- package/dist/components/shared/ProgressBar.vue.d.ts +11 -0
- package/dist/components/shared/ProgressBar.vue.d.ts.map +1 -0
- package/dist/components/shared/SourceViewContainer.vue.d.ts +18 -0
- package/dist/components/shared/SourceViewContainer.vue.d.ts.map +1 -0
- package/dist/components/shared/UploaderHeader.vue.d.ts +15 -0
- package/dist/components/shared/UploaderHeader.vue.d.ts.map +1 -0
- package/dist/composables/use-tiles-per-row.d.ts +10 -0
- package/dist/composables/use-tiles-per-row.d.ts.map +1 -0
- package/dist/composables/useBox.d.ts +28 -0
- package/dist/composables/useBox.d.ts.map +1 -0
- package/dist/composables/useCameraUploader.d.ts +25 -0
- package/dist/composables/useCameraUploader.d.ts.map +1 -0
- package/dist/composables/useDropbox.d.ts +28 -0
- package/dist/composables/useDropbox.d.ts.map +1 -0
- package/dist/composables/useFetchFileByUrl.d.ts +8 -0
- package/dist/composables/useFetchFileByUrl.d.ts.map +1 -0
- package/dist/composables/useGoogleDrive.d.ts +28 -0
- package/dist/composables/useGoogleDrive.d.ts.map +1 -0
- package/dist/composables/useOneDrive.d.ts +29 -0
- package/dist/composables/useOneDrive.d.ts.map +1 -0
- package/dist/composables/useSSEProcessing.d.ts +19 -0
- package/dist/composables/useSSEProcessing.d.ts.map +1 -0
- package/dist/composables/useServerModeDrive.d.ts +17 -0
- package/dist/composables/useServerModeDrive.d.ts.map +1 -0
- package/dist/composables/useSourceSelector.d.ts +13 -0
- package/dist/composables/useSourceSelector.d.ts.map +1 -0
- package/dist/composables/useUploaderController.d.ts +4 -0
- package/dist/composables/useUploaderController.d.ts.map +1 -0
- package/dist/composables/useUploaderPanel.d.ts +13 -0
- package/dist/composables/useUploaderPanel.d.ts.map +1 -0
- package/dist/context/source-view-header-extra.d.ts +4 -0
- package/dist/context/source-view-header-extra.d.ts.map +1 -0
- package/dist/context/uploader-context.d.ts +95 -0
- package/dist/context/uploader-context.d.ts.map +1 -0
- package/dist/index.cjs +4405 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4405 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/constants.d.ts +11 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/view-mode.d.ts +24 -0
- package/dist/lib/view-mode.d.ts.map +1 -0
- package/dist/shared/types.d.ts +15 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/styles.d.ts +4 -0
- package/dist/tailwind-prefixed.css +2508 -0
- package/dist/upup-uploader.vue.d.ts +18 -0
- package/dist/upup-uploader.vue.d.ts.map +1 -0
- package/dist/use-upup-upload.d.ts +38 -0
- package/dist/use-upup-upload.d.ts.map +1 -0
- package/package.json +100 -0
|
@@ -0,0 +1,1083 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Icon_default,
|
|
3
|
+
useSourceViewHeaderExtra
|
|
4
|
+
} from "./chunk-RZ7RTSRZ.js";
|
|
5
|
+
import {
|
|
6
|
+
SourceViewContainer_default
|
|
7
|
+
} from "./chunk-M6AHIQ3M.js";
|
|
8
|
+
import {
|
|
9
|
+
export_helper_default,
|
|
10
|
+
useUploaderI18n,
|
|
11
|
+
useUploaderOptions,
|
|
12
|
+
useUploaderRuntime,
|
|
13
|
+
useUploaderSource,
|
|
14
|
+
useUploaderTheme
|
|
15
|
+
} from "./chunk-X6FZTCNT.js";
|
|
16
|
+
|
|
17
|
+
// src/components/ServerModeDriveUploader.vue
|
|
18
|
+
import { defineComponent as _defineComponent2 } from "vue";
|
|
19
|
+
import { ref, computed as computed2 } from "vue";
|
|
20
|
+
|
|
21
|
+
// src/composables/useServerModeDrive.ts
|
|
22
|
+
import {
|
|
23
|
+
computed,
|
|
24
|
+
shallowRef,
|
|
25
|
+
onMounted,
|
|
26
|
+
onUnmounted
|
|
27
|
+
} from "vue";
|
|
28
|
+
import { ServerModeDriveController } from "@useupup/core/internal";
|
|
29
|
+
function useServerModeDrive(provider) {
|
|
30
|
+
const { serverUrl } = useUploaderRuntime();
|
|
31
|
+
const controller = new ServerModeDriveController({
|
|
32
|
+
provider,
|
|
33
|
+
serverUrl: () => serverUrl
|
|
34
|
+
});
|
|
35
|
+
const snap = shallowRef(controller.getSnapshot());
|
|
36
|
+
let unsub = null;
|
|
37
|
+
onMounted(() => {
|
|
38
|
+
unsub = controller.subscribe(() => {
|
|
39
|
+
snap.value = controller.getSnapshot();
|
|
40
|
+
});
|
|
41
|
+
controller.init();
|
|
42
|
+
});
|
|
43
|
+
onUnmounted(() => {
|
|
44
|
+
controller.destroy();
|
|
45
|
+
unsub == null ? void 0 : unsub();
|
|
46
|
+
});
|
|
47
|
+
return {
|
|
48
|
+
state: computed(() => snap.value.state),
|
|
49
|
+
folderId: computed(() => snap.value.folderId),
|
|
50
|
+
setFolderId(id) {
|
|
51
|
+
controller.setFolderId(id);
|
|
52
|
+
void controller.refresh();
|
|
53
|
+
},
|
|
54
|
+
search: computed(() => snap.value.search),
|
|
55
|
+
setSearch(s) {
|
|
56
|
+
controller.setSearch(s);
|
|
57
|
+
void controller.refresh();
|
|
58
|
+
},
|
|
59
|
+
refresh: (opts) => controller.refresh(opts),
|
|
60
|
+
transfer: (file) => controller.transfer(file),
|
|
61
|
+
startAuth: () => {
|
|
62
|
+
controller.startAuth();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// src/components/shared/DriveAuthFallback.vue
|
|
68
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
69
|
+
import { formatUiMessage as t } from "@useupup/core";
|
|
70
|
+
import { cn } from "@useupup/core/internal";
|
|
71
|
+
import { toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, withCtx as _withCtx, createBlock as _createBlock } from "vue";
|
|
72
|
+
var _sfc_main = /* @__PURE__ */ _defineComponent({
|
|
73
|
+
__name: "DriveAuthFallback",
|
|
74
|
+
props: {
|
|
75
|
+
providerName: {
|
|
76
|
+
type: String,
|
|
77
|
+
required: true
|
|
78
|
+
},
|
|
79
|
+
onRetry: {
|
|
80
|
+
type: Function,
|
|
81
|
+
required: true
|
|
82
|
+
},
|
|
83
|
+
error: {
|
|
84
|
+
type: null,
|
|
85
|
+
required: false
|
|
86
|
+
},
|
|
87
|
+
dataUpupSlot: {
|
|
88
|
+
type: String,
|
|
89
|
+
required: false,
|
|
90
|
+
default: "drive-auth-fallback"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
setup(__props, { expose: __expose }) {
|
|
94
|
+
__expose();
|
|
95
|
+
const props = __props;
|
|
96
|
+
const { isDark: dark, slotOverrides: slotClasses } = useUploaderTheme();
|
|
97
|
+
const { translations: tr } = useUploaderI18n();
|
|
98
|
+
const __returned__ = {
|
|
99
|
+
props,
|
|
100
|
+
dark,
|
|
101
|
+
slotClasses,
|
|
102
|
+
tr,
|
|
103
|
+
get t() {
|
|
104
|
+
return t;
|
|
105
|
+
},
|
|
106
|
+
get cn() {
|
|
107
|
+
return cn;
|
|
108
|
+
},
|
|
109
|
+
SourceViewContainer: SourceViewContainer_default
|
|
110
|
+
};
|
|
111
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
112
|
+
enumerable: false,
|
|
113
|
+
value: true
|
|
114
|
+
});
|
|
115
|
+
return __returned__;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
var _hoisted_1 = { class: "upup-flex upup-h-full upup-w-full upup-flex-col upup-items-center upup-justify-center upup-gap-4 upup-p-6 upup-text-center" };
|
|
119
|
+
var _hoisted_2 = {
|
|
120
|
+
key: 0,
|
|
121
|
+
"data-testid": "upup-drive-error",
|
|
122
|
+
"data-upup-slot": "drive-error",
|
|
123
|
+
role: "alert",
|
|
124
|
+
class: "upup-p-4 upup-text-sm upup-text-red-600 dark:upup-text-red-400"
|
|
125
|
+
};
|
|
126
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
127
|
+
return _openBlock(), _createBlock($setup["SourceViewContainer"], { "data-upup-slot": $setup.props.dataUpupSlot }, {
|
|
128
|
+
default: _withCtx(() => [_createElementVNode("div", _hoisted_1, [
|
|
129
|
+
!!$setup.props.error ? (_openBlock(), _createElementBlock(
|
|
130
|
+
"p",
|
|
131
|
+
_hoisted_2,
|
|
132
|
+
_toDisplayString($setup.t($setup.tr.driveLoadError, { message: $setup.props.error.message })),
|
|
133
|
+
1
|
|
134
|
+
/* TEXT */
|
|
135
|
+
)) : _createCommentVNode("v-if", true),
|
|
136
|
+
_createElementVNode(
|
|
137
|
+
"p",
|
|
138
|
+
{ class: _normalizeClass($setup.cn("upup-text-sm upup-text-[#333]", { "upup-text-[#FAFAFA] dark:upup-text-[#FAFAFA]": $setup.dark }, $setup.slotClasses.sourceView)) },
|
|
139
|
+
_toDisplayString($setup.t($setup.tr.authenticatePrompt, { provider: $setup.props.providerName })),
|
|
140
|
+
3
|
|
141
|
+
/* TEXT, CLASS */
|
|
142
|
+
),
|
|
143
|
+
_createElementVNode(
|
|
144
|
+
"button",
|
|
145
|
+
{
|
|
146
|
+
type: "button",
|
|
147
|
+
class: _normalizeClass($setup.cn("upup-rounded-md upup-bg-[#0ea5e9] upup-px-4 upup-py-2 upup-text-sm upup-font-medium upup-text-white upup-transition-all upup-duration-300 hover:upup-bg-[#0284c7]", { "upup-bg-[#38bdf8] hover:upup-bg-[#0ea5e9] dark:upup-bg-[#38bdf8] dark:hover:upup-bg-[#0ea5e9]": $setup.dark })),
|
|
148
|
+
onClick: _cache[0] || (_cache[0] = (...args) => $setup.props.onRetry && $setup.props.onRetry(...args))
|
|
149
|
+
},
|
|
150
|
+
_toDisplayString($setup.t($setup.tr.signInWith, { provider: $setup.props.providerName })),
|
|
151
|
+
3
|
|
152
|
+
/* TEXT, CLASS */
|
|
153
|
+
)
|
|
154
|
+
])]),
|
|
155
|
+
_: 1
|
|
156
|
+
}, 8, ["data-upup-slot"]);
|
|
157
|
+
}
|
|
158
|
+
var DriveAuthFallback_default = /* @__PURE__ */ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "C:\\Users\\amind\\OneDrive\\Desktop\\Projects\\INTERNAL\\upup\\packages\\vue\\src\\components\\shared\\DriveAuthFallback.vue"]]);
|
|
159
|
+
|
|
160
|
+
// src/components/ServerModeDriveUploader.vue
|
|
161
|
+
import { errorCodeToMessageKey } from "@useupup/core";
|
|
162
|
+
import { cn as cn2 } from "@useupup/core/internal";
|
|
163
|
+
import { openBlock as _openBlock2, createBlock as _createBlock2, createCommentVNode as _createCommentVNode2, resolveDynamicComponent as _resolveDynamicComponent, toDisplayString as _toDisplayString2, createElementVNode as _createElementVNode2, withKeys as _withKeys, normalizeClass as _normalizeClass2, createElementBlock as _createElementBlock2, renderList as _renderList, Fragment as _Fragment, withCtx as _withCtx2 } from "vue";
|
|
164
|
+
var _sfc_main2 = /* @__PURE__ */ _defineComponent2({
|
|
165
|
+
__name: "ServerModeDriveUploader",
|
|
166
|
+
props: {
|
|
167
|
+
provider: {
|
|
168
|
+
type: String,
|
|
169
|
+
required: true
|
|
170
|
+
},
|
|
171
|
+
onBack: {
|
|
172
|
+
type: Function,
|
|
173
|
+
required: false
|
|
174
|
+
},
|
|
175
|
+
dataUpupSlot: {
|
|
176
|
+
type: null,
|
|
177
|
+
required: false
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
setup(__props, { expose: __expose }) {
|
|
181
|
+
__expose();
|
|
182
|
+
const props = __props;
|
|
183
|
+
const PROVIDER_LABEL = {
|
|
184
|
+
"google-drive": "Google Drive",
|
|
185
|
+
"one-drive": "OneDrive",
|
|
186
|
+
"dropbox": "Dropbox",
|
|
187
|
+
"box": "Box"
|
|
188
|
+
};
|
|
189
|
+
const resolvedSlot = computed2(() => {
|
|
190
|
+
var _a;
|
|
191
|
+
return (_a = props.dataUpupSlot) != null ? _a : `drive-browser-${props.provider}`;
|
|
192
|
+
});
|
|
193
|
+
const { icons } = useUploaderOptions();
|
|
194
|
+
const { isDark: dark } = useUploaderTheme();
|
|
195
|
+
const { translator } = useUploaderI18n();
|
|
196
|
+
const { state, search, setSearch, refresh, transfer, startAuth } = useServerModeDrive(props.provider);
|
|
197
|
+
const errorText = computed2(() => {
|
|
198
|
+
if (state.value.status !== "error") return "";
|
|
199
|
+
return state.value.code && translator ? translator(`errors.${errorCodeToMessageKey(state.value.code)}`, { code: state.value.code }) : state.value.message;
|
|
200
|
+
});
|
|
201
|
+
const selected = ref(/* @__PURE__ */ new Set());
|
|
202
|
+
const transferring = ref(false);
|
|
203
|
+
const isLoading = computed2(() => state.value.status === "loading" || state.value.status === "idle");
|
|
204
|
+
const files = computed2(() => state.value.status === "ready" ? state.value.files : []);
|
|
205
|
+
function toggle(id) {
|
|
206
|
+
const next = new Set(selected.value);
|
|
207
|
+
if (next.has(id)) next.delete(id);
|
|
208
|
+
else next.add(id);
|
|
209
|
+
selected.value = next;
|
|
210
|
+
}
|
|
211
|
+
async function handleTransfer() {
|
|
212
|
+
var _a;
|
|
213
|
+
transferring.value = true;
|
|
214
|
+
try {
|
|
215
|
+
for (const file of files.value.filter((f) => selected.value.has(f.id))) {
|
|
216
|
+
const result = await transfer(file);
|
|
217
|
+
if (result.status === "reauth") {
|
|
218
|
+
startAuth();
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
selected.value = /* @__PURE__ */ new Set();
|
|
223
|
+
(_a = props.onBack) == null ? void 0 : _a.call(props);
|
|
224
|
+
} finally {
|
|
225
|
+
transferring.value = false;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
function formatBytes(bytes) {
|
|
229
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
230
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
231
|
+
if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
232
|
+
return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;
|
|
233
|
+
}
|
|
234
|
+
const __returned__ = {
|
|
235
|
+
props,
|
|
236
|
+
PROVIDER_LABEL,
|
|
237
|
+
resolvedSlot,
|
|
238
|
+
icons,
|
|
239
|
+
dark,
|
|
240
|
+
translator,
|
|
241
|
+
state,
|
|
242
|
+
search,
|
|
243
|
+
setSearch,
|
|
244
|
+
refresh,
|
|
245
|
+
transfer,
|
|
246
|
+
startAuth,
|
|
247
|
+
errorText,
|
|
248
|
+
selected,
|
|
249
|
+
transferring,
|
|
250
|
+
isLoading,
|
|
251
|
+
files,
|
|
252
|
+
toggle,
|
|
253
|
+
handleTransfer,
|
|
254
|
+
formatBytes,
|
|
255
|
+
SourceViewContainer: SourceViewContainer_default,
|
|
256
|
+
DriveAuthFallback: DriveAuthFallback_default,
|
|
257
|
+
get cn() {
|
|
258
|
+
return cn2;
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
262
|
+
enumerable: false,
|
|
263
|
+
value: true
|
|
264
|
+
});
|
|
265
|
+
return __returned__;
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
var _hoisted_12 = {
|
|
269
|
+
key: 1,
|
|
270
|
+
"data-testid": "upup-server-drive-browser",
|
|
271
|
+
class: "upup-grid upup-h-full upup-w-full upup-grid-rows-[auto,1fr,auto] upup-overflow-auto"
|
|
272
|
+
};
|
|
273
|
+
var _hoisted_22 = { class: "upup-text-sm upup-font-medium" };
|
|
274
|
+
var _hoisted_3 = ["value"];
|
|
275
|
+
var _hoisted_4 = { class: "upup-overflow-auto upup-p-2" };
|
|
276
|
+
var _hoisted_5 = ["data-selected", "onClick"];
|
|
277
|
+
var _hoisted_6 = {
|
|
278
|
+
class: "upup-flex upup-h-[30px] upup-w-[30px] upup-flex-none upup-items-center upup-justify-center upup-rounded-[8px] upup-bg-white/[0.05]",
|
|
279
|
+
"aria-hidden": "true"
|
|
280
|
+
};
|
|
281
|
+
var _hoisted_7 = {
|
|
282
|
+
key: 0,
|
|
283
|
+
viewBox: "0 0 24 24",
|
|
284
|
+
width: "17",
|
|
285
|
+
height: "17",
|
|
286
|
+
fill: "none",
|
|
287
|
+
stroke: "#38bdf8",
|
|
288
|
+
"stroke-width": "1.7",
|
|
289
|
+
"stroke-linecap": "round",
|
|
290
|
+
"stroke-linejoin": "round"
|
|
291
|
+
};
|
|
292
|
+
var _hoisted_8 = ["stroke"];
|
|
293
|
+
var _hoisted_9 = { class: "upup-flex-1 upup-truncate" };
|
|
294
|
+
var _hoisted_10 = {
|
|
295
|
+
key: 0,
|
|
296
|
+
class: "upup-text-xs upup-opacity-60"
|
|
297
|
+
};
|
|
298
|
+
var _hoisted_11 = ["disabled"];
|
|
299
|
+
function _sfc_render2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
300
|
+
return $setup.state.status === "reauth" ? (_openBlock2(), _createBlock2($setup["DriveAuthFallback"], {
|
|
301
|
+
key: 0,
|
|
302
|
+
"provider-name": $setup.PROVIDER_LABEL[$setup.props.provider],
|
|
303
|
+
"on-retry": $setup.startAuth
|
|
304
|
+
}, null, 8, ["provider-name", "on-retry"])) : (_openBlock2(), _createBlock2($setup["SourceViewContainer"], {
|
|
305
|
+
key: 1,
|
|
306
|
+
"is-loading": $setup.isLoading,
|
|
307
|
+
"data-upup-slot": $setup.resolvedSlot
|
|
308
|
+
}, {
|
|
309
|
+
default: _withCtx2(() => [$setup.isLoading ? (_openBlock2(), _createBlock2(_resolveDynamicComponent($setup.icons.LoaderIcon), { key: 0 })) : (_openBlock2(), _createElementBlock2("div", _hoisted_12, [
|
|
310
|
+
_createElementVNode2(
|
|
311
|
+
"div",
|
|
312
|
+
{
|
|
313
|
+
class: _normalizeClass2($setup.cn("upup-flex upup-items-center upup-gap-2 upup-border-b upup-px-3 upup-py-2.5", $setup.dark ? "upup-border-white/[0.06] upup-text-[#e2e8f0]" : "upup-border-black/[0.06] upup-text-gray-800")),
|
|
314
|
+
"data-upup-slot": "drive-browser-header"
|
|
315
|
+
},
|
|
316
|
+
[_createElementVNode2(
|
|
317
|
+
"span",
|
|
318
|
+
_hoisted_22,
|
|
319
|
+
_toDisplayString2($setup.PROVIDER_LABEL[$setup.props.provider]),
|
|
320
|
+
1
|
|
321
|
+
/* TEXT */
|
|
322
|
+
), _createElementVNode2("input", {
|
|
323
|
+
type: "search",
|
|
324
|
+
name: "upup-drive-search",
|
|
325
|
+
"aria-label": "Search",
|
|
326
|
+
value: $setup.search,
|
|
327
|
+
onInput: _cache[0] || (_cache[0] = ($event) => $setup.setSearch($event.target.value)),
|
|
328
|
+
onKeydown: _cache[1] || (_cache[1] = _withKeys(($event) => $setup.refresh({ search: $event.target.value }), ["enter"])),
|
|
329
|
+
placeholder: "Search\u2026",
|
|
330
|
+
class: _normalizeClass2($setup.cn("upup-ml-auto upup-rounded upup-border upup-px-2 upup-py-1 upup-text-xs", $setup.dark ? "upup-border-gray-700 upup-bg-gray-800 upup-text-gray-100" : "upup-border-gray-300 upup-bg-white"))
|
|
331
|
+
}, null, 42, _hoisted_3)],
|
|
332
|
+
2
|
|
333
|
+
/* CLASS */
|
|
334
|
+
),
|
|
335
|
+
_createElementVNode2("div", _hoisted_4, [$setup.state.status === "error" ? (_openBlock2(), _createElementBlock2(
|
|
336
|
+
"p",
|
|
337
|
+
{
|
|
338
|
+
key: 0,
|
|
339
|
+
"data-testid": "upup-drive-error",
|
|
340
|
+
"data-upup-slot": "drive-error",
|
|
341
|
+
role: "alert",
|
|
342
|
+
class: _normalizeClass2($setup.cn("upup-p-4 upup-text-sm", $setup.dark ? "upup-text-red-400" : "upup-text-red-600"))
|
|
343
|
+
},
|
|
344
|
+
_toDisplayString2($setup.errorText),
|
|
345
|
+
3
|
|
346
|
+
/* TEXT, CLASS */
|
|
347
|
+
)) : _createCommentVNode2("v-if", true), (_openBlock2(true), _createElementBlock2(
|
|
348
|
+
_Fragment,
|
|
349
|
+
null,
|
|
350
|
+
_renderList($setup.files, (file) => {
|
|
351
|
+
return _openBlock2(), _createElementBlock2("button", {
|
|
352
|
+
key: file.id,
|
|
353
|
+
type: "button",
|
|
354
|
+
"data-upup-slot": "drive-browser-item",
|
|
355
|
+
"data-selected": $setup.selected.has(file.id),
|
|
356
|
+
class: _normalizeClass2($setup.cn("upup-fx-hover-lift upup-mb-1.5 upup-flex upup-w-full upup-items-center upup-gap-3 upup-rounded-[11px] upup-px-3 upup-py-2.5 upup-text-left upup-text-sm upup-ring-1", $setup.selected.has(file.id) ? "upup-bg-[#0ea5e9]/10 upup-ring-[#38bdf8]/35" : $setup.dark ? "upup-bg-white/[0.04] upup-text-[#e2e8f0] upup-ring-white/[0.06] hover:upup-bg-white/[0.07]" : "upup-bg-black/[0.03] upup-text-gray-800 upup-ring-black/[0.06] hover:upup-bg-black/[0.05]")),
|
|
357
|
+
onClick: ($event) => file.isFolder ? $setup.refresh({ folderId: file.id }) : $setup.toggle(file.id)
|
|
358
|
+
}, [
|
|
359
|
+
_createElementVNode2("span", _hoisted_6, [file.isFolder ? (_openBlock2(), _createElementBlock2("svg", _hoisted_7, [..._cache[4] || (_cache[4] = [_createElementVNode2(
|
|
360
|
+
"path",
|
|
361
|
+
{ d: "M3 7a2 2 0 0 1 2-2h4l2 2h6a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" },
|
|
362
|
+
null,
|
|
363
|
+
-1
|
|
364
|
+
/* CACHED */
|
|
365
|
+
)])])) : (_openBlock2(), _createElementBlock2("svg", {
|
|
366
|
+
key: 1,
|
|
367
|
+
viewBox: "0 0 24 24",
|
|
368
|
+
width: "17",
|
|
369
|
+
height: "17",
|
|
370
|
+
fill: "none",
|
|
371
|
+
stroke: $setup.dark ? "#94a3b8" : "#64748b",
|
|
372
|
+
"stroke-width": "1.6",
|
|
373
|
+
"stroke-linecap": "round",
|
|
374
|
+
"stroke-linejoin": "round"
|
|
375
|
+
}, [..._cache[5] || (_cache[5] = [_createElementVNode2(
|
|
376
|
+
"path",
|
|
377
|
+
{ d: "M6 3h8l4 4v13a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z" },
|
|
378
|
+
null,
|
|
379
|
+
-1
|
|
380
|
+
/* CACHED */
|
|
381
|
+
), _createElementVNode2(
|
|
382
|
+
"path",
|
|
383
|
+
{ d: "M14 3v4h4" },
|
|
384
|
+
null,
|
|
385
|
+
-1
|
|
386
|
+
/* CACHED */
|
|
387
|
+
)])], 8, _hoisted_8))]),
|
|
388
|
+
_createElementVNode2(
|
|
389
|
+
"span",
|
|
390
|
+
_hoisted_9,
|
|
391
|
+
_toDisplayString2(file.name),
|
|
392
|
+
1
|
|
393
|
+
/* TEXT */
|
|
394
|
+
),
|
|
395
|
+
file.size != null && !file.isFolder ? (_openBlock2(), _createElementBlock2(
|
|
396
|
+
"span",
|
|
397
|
+
_hoisted_10,
|
|
398
|
+
_toDisplayString2($setup.formatBytes(file.size)),
|
|
399
|
+
1
|
|
400
|
+
/* TEXT */
|
|
401
|
+
)) : _createCommentVNode2("v-if", true)
|
|
402
|
+
], 10, _hoisted_5);
|
|
403
|
+
}),
|
|
404
|
+
128
|
|
405
|
+
/* KEYED_FRAGMENT */
|
|
406
|
+
))]),
|
|
407
|
+
_createElementVNode2(
|
|
408
|
+
"div",
|
|
409
|
+
{ class: _normalizeClass2($setup.cn("upup-flex upup-items-center upup-justify-between upup-gap-2 upup-border-t upup-p-3", $setup.dark ? "upup-border-white/[0.06]" : "upup-border-black/[0.06]")) },
|
|
410
|
+
[_createElementVNode2("button", {
|
|
411
|
+
type: "button",
|
|
412
|
+
class: "upup-text-sm upup-opacity-70 hover:upup-opacity-100",
|
|
413
|
+
onClick: _cache[2] || (_cache[2] = ($event) => {
|
|
414
|
+
var _a, _b;
|
|
415
|
+
return (_b = (_a = $setup.props).onBack) == null ? void 0 : _b.call(_a);
|
|
416
|
+
})
|
|
417
|
+
}, " Cancel "), _createElementVNode2("button", {
|
|
418
|
+
type: "button",
|
|
419
|
+
disabled: $setup.selected.size === 0 || $setup.transferring,
|
|
420
|
+
class: "upup-fx-press upup-rounded-lg upup-bg-[#0ea5e9] upup-px-3 upup-py-1.5 upup-text-sm upup-font-medium upup-text-white hover:upup-bg-[#0284c7] disabled:upup-opacity-50",
|
|
421
|
+
onClick: _cache[3] || (_cache[3] = ($event) => $setup.handleTransfer())
|
|
422
|
+
}, _toDisplayString2($setup.transferring ? "Uploading\u2026" : `Add files${$setup.selected.size ? ` (${$setup.selected.size})` : ""}`), 9, _hoisted_11)],
|
|
423
|
+
2
|
|
424
|
+
/* CLASS */
|
|
425
|
+
)
|
|
426
|
+
]))]),
|
|
427
|
+
_: 1
|
|
428
|
+
}, 8, ["is-loading", "data-upup-slot"]));
|
|
429
|
+
}
|
|
430
|
+
var ServerModeDriveUploader_default = /* @__PURE__ */ export_helper_default(_sfc_main2, [["render", _sfc_render2], ["__file", "C:\\Users\\amind\\OneDrive\\Desktop\\Projects\\INTERNAL\\upup\\packages\\vue\\src\\components\\ServerModeDriveUploader.vue"]]);
|
|
431
|
+
|
|
432
|
+
// src/components/shared/DriveBrowser.vue
|
|
433
|
+
import { defineComponent as _defineComponent6 } from "vue";
|
|
434
|
+
import { ref as ref3, computed as computed5 } from "vue";
|
|
435
|
+
import { formatUiMessage as t2, pluralUiMessage as plural } from "@useupup/core";
|
|
436
|
+
import { searchDriveFiles } from "@useupup/core/internal";
|
|
437
|
+
import { cn as cn6 } from "@useupup/core/internal";
|
|
438
|
+
|
|
439
|
+
// src/components/shared/DriveBrowserHeader.vue
|
|
440
|
+
import { defineComponent as _defineComponent3 } from "vue";
|
|
441
|
+
import { computed as computed3, nextTick, ref as ref2, watch } from "vue";
|
|
442
|
+
import { cn as cn3 } from "@useupup/core/internal";
|
|
443
|
+
import { createCommentVNode as _createCommentVNode3, openBlock as _openBlock3, createElementBlock as _createElementBlock3, createBlock as _createBlock3, createElementVNode as _createElementVNode3, toDisplayString as _toDisplayString3, normalizeClass as _normalizeClass3, Teleport as _Teleport, createVNode as _createVNode, withKeys as _withKeys2 } from "vue";
|
|
444
|
+
var _sfc_main3 = /* @__PURE__ */ _defineComponent3({
|
|
445
|
+
__name: "DriveBrowserHeader",
|
|
446
|
+
props: {
|
|
447
|
+
path: {
|
|
448
|
+
type: Array,
|
|
449
|
+
required: true
|
|
450
|
+
},
|
|
451
|
+
setPath: {
|
|
452
|
+
type: Function,
|
|
453
|
+
required: true
|
|
454
|
+
},
|
|
455
|
+
handleSignOut: {
|
|
456
|
+
type: Function,
|
|
457
|
+
required: true
|
|
458
|
+
},
|
|
459
|
+
showSearch: {
|
|
460
|
+
type: Boolean,
|
|
461
|
+
required: true
|
|
462
|
+
},
|
|
463
|
+
searchTerm: {
|
|
464
|
+
type: String,
|
|
465
|
+
required: true
|
|
466
|
+
},
|
|
467
|
+
onSearch: {
|
|
468
|
+
type: Function,
|
|
469
|
+
required: true
|
|
470
|
+
},
|
|
471
|
+
user: {
|
|
472
|
+
type: null,
|
|
473
|
+
required: false
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
setup(__props, { expose: __expose }) {
|
|
477
|
+
__expose();
|
|
478
|
+
const props = __props;
|
|
479
|
+
const { setActiveSource } = useUploaderSource();
|
|
480
|
+
const { translations: tr } = useUploaderI18n();
|
|
481
|
+
const { isDark: dark, slotOverrides: slotClasses } = useUploaderTheme();
|
|
482
|
+
const headerExtraHostRef = useSourceViewHeaderExtra();
|
|
483
|
+
const headerExtraHost = computed3(() => {
|
|
484
|
+
var _a;
|
|
485
|
+
return (_a = headerExtraHostRef == null ? void 0 : headerExtraHostRef.value) != null ? _a : null;
|
|
486
|
+
});
|
|
487
|
+
const navigated = computed3(() => props.path.length > 1);
|
|
488
|
+
const currentFolder = computed3(() => props.path[props.path.length - 1]);
|
|
489
|
+
const hasFilter = computed3(() => props.searchTerm.trim().length > 0);
|
|
490
|
+
const searchOpen = ref2(false);
|
|
491
|
+
const searchInputRef = ref2(null);
|
|
492
|
+
watch(searchOpen, (open) => {
|
|
493
|
+
if (open) void nextTick(() => {
|
|
494
|
+
var _a;
|
|
495
|
+
return (_a = searchInputRef.value) == null ? void 0 : _a.focus();
|
|
496
|
+
});
|
|
497
|
+
});
|
|
498
|
+
function onLogout() {
|
|
499
|
+
void props.handleSignOut();
|
|
500
|
+
setActiveSource(void 0);
|
|
501
|
+
}
|
|
502
|
+
const __returned__ = {
|
|
503
|
+
props,
|
|
504
|
+
setActiveSource,
|
|
505
|
+
tr,
|
|
506
|
+
dark,
|
|
507
|
+
slotClasses,
|
|
508
|
+
headerExtraHostRef,
|
|
509
|
+
headerExtraHost,
|
|
510
|
+
navigated,
|
|
511
|
+
currentFolder,
|
|
512
|
+
hasFilter,
|
|
513
|
+
searchOpen,
|
|
514
|
+
searchInputRef,
|
|
515
|
+
onLogout,
|
|
516
|
+
get cn() {
|
|
517
|
+
return cn3;
|
|
518
|
+
},
|
|
519
|
+
get Icon() {
|
|
520
|
+
return Icon_default;
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
524
|
+
enumerable: false,
|
|
525
|
+
value: true
|
|
526
|
+
});
|
|
527
|
+
return __returned__;
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
var _hoisted_13 = {
|
|
531
|
+
key: 0,
|
|
532
|
+
"data-upup-slot": "drive-browser-header"
|
|
533
|
+
};
|
|
534
|
+
var _hoisted_23 = { class: "upup-relative upup-flex upup-h-6 upup-w-6 upup-items-center upup-justify-center upup-overflow-hidden upup-rounded-full" };
|
|
535
|
+
var _hoisted_32 = ["alt", "src"];
|
|
536
|
+
var _hoisted_42 = ["aria-label"];
|
|
537
|
+
var _hoisted_52 = ["title"];
|
|
538
|
+
var _hoisted_62 = ["aria-label"];
|
|
539
|
+
var _hoisted_72 = [
|
|
540
|
+
"aria-label",
|
|
541
|
+
"placeholder",
|
|
542
|
+
"value"
|
|
543
|
+
];
|
|
544
|
+
function _sfc_render3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
545
|
+
var _a, _b;
|
|
546
|
+
return $setup.props.user ? (_openBlock3(), _createElementBlock3("div", _hoisted_13, [
|
|
547
|
+
_createCommentVNode3(" Account controls live in the SourceView header row (portal), next\r\n to Back, separated by a hairline \u2014 not in their own strip. "),
|
|
548
|
+
$setup.headerExtraHost ? (_openBlock3(), _createBlock3(_Teleport, {
|
|
549
|
+
key: 0,
|
|
550
|
+
to: $setup.headerExtraHost
|
|
551
|
+
}, [
|
|
552
|
+
_createElementVNode3("div", _hoisted_23, [!!$setup.props.user.picture ? (_openBlock3(), _createElementBlock3("img", {
|
|
553
|
+
key: 0,
|
|
554
|
+
alt: $setup.props.user.name,
|
|
555
|
+
src: $setup.props.user.picture,
|
|
556
|
+
class: "upup-bg-center upup-object-cover"
|
|
557
|
+
}, null, 8, _hoisted_32)) : (_openBlock3(), _createBlock3($setup["Icon"], {
|
|
558
|
+
key: 1,
|
|
559
|
+
name: "user",
|
|
560
|
+
class: "upup-text-xl"
|
|
561
|
+
}))]),
|
|
562
|
+
_createElementVNode3(
|
|
563
|
+
"button",
|
|
564
|
+
{
|
|
565
|
+
class: _normalizeClass3($setup.cn("upup-hover:upup-underline upup-text-xs upup-font-medium upup-text-[#0284c7]", { "upup-text-[#38bdf8] dark:upup-text-[#38bdf8]": $setup.dark }, $setup.slotClasses.driveLogoutButton)),
|
|
566
|
+
onClick: $setup.onLogout
|
|
567
|
+
},
|
|
568
|
+
_toDisplayString3($setup.tr.logOut),
|
|
569
|
+
3
|
|
570
|
+
/* TEXT, CLASS */
|
|
571
|
+
),
|
|
572
|
+
_createElementVNode3(
|
|
573
|
+
"span",
|
|
574
|
+
{
|
|
575
|
+
"aria-hidden": "true",
|
|
576
|
+
class: _normalizeClass3($setup.cn("upup-h-4 upup-w-px", $setup.dark ? "upup-bg-white/15" : "upup-bg-black/15"))
|
|
577
|
+
},
|
|
578
|
+
null,
|
|
579
|
+
2
|
|
580
|
+
/* CLASS */
|
|
581
|
+
)
|
|
582
|
+
], 8, ["to"])) : _createCommentVNode3("v-if", true),
|
|
583
|
+
$setup.props.showSearch || $setup.navigated ? (_openBlock3(), _createElementBlock3(
|
|
584
|
+
"div",
|
|
585
|
+
{
|
|
586
|
+
key: 1,
|
|
587
|
+
class: _normalizeClass3($setup.cn("upup-flex upup-items-center upup-gap-2.5 upup-px-3 upup-py-2 upup-text-xs upup-font-medium upup-text-[#333]", { "upup-text-[#FAFAFA] dark:upup-text-[#FAFAFA]": $setup.dark }, $setup.slotClasses.driveHeader))
|
|
588
|
+
},
|
|
589
|
+
[
|
|
590
|
+
$setup.navigated ? (_openBlock3(), _createElementBlock3("button", {
|
|
591
|
+
key: 0,
|
|
592
|
+
type: "button",
|
|
593
|
+
"data-testid": "upup-drive-back",
|
|
594
|
+
"data-upup-slot": "drive-back",
|
|
595
|
+
"aria-label": $setup.tr.overlayBack,
|
|
596
|
+
class: _normalizeClass3($setup.cn("upup-fx-hover-lift upup-fx-press upup-flex upup-h-7 upup-w-7 upup-shrink-0 upup-items-center upup-justify-center upup-rounded-lg", $setup.dark ? "upup-text-[#e2e8f0] hover:upup-bg-white/[0.08]" : "upup-text-[#334155] hover:upup-bg-black/[0.05]")),
|
|
597
|
+
onClick: _cache[0] || (_cache[0] = ($event) => $setup.props.setPath($setup.props.path.slice(0, -1)))
|
|
598
|
+
}, [_createVNode($setup["Icon"], { name: "chevron-left" })], 10, _hoisted_42)) : _createCommentVNode3("v-if", true),
|
|
599
|
+
$setup.navigated && !$setup.searchOpen ? (_openBlock3(), _createElementBlock3("span", {
|
|
600
|
+
key: 1,
|
|
601
|
+
"data-upup-slot": "drive-current-folder",
|
|
602
|
+
title: (_a = $setup.currentFolder) == null ? void 0 : _a.name,
|
|
603
|
+
class: "upup-min-w-0 upup-flex-1 upup-truncate upup-font-medium"
|
|
604
|
+
}, _toDisplayString3((_b = $setup.currentFolder) == null ? void 0 : _b.name), 9, _hoisted_52)) : _createCommentVNode3("v-if", true),
|
|
605
|
+
$setup.navigated && $setup.props.showSearch && !$setup.searchOpen ? (_openBlock3(), _createElementBlock3("button", {
|
|
606
|
+
key: 2,
|
|
607
|
+
type: "button",
|
|
608
|
+
"data-testid": "upup-drive-search-toggle",
|
|
609
|
+
"data-upup-slot": "drive-search-toggle",
|
|
610
|
+
"aria-label": $setup.tr.search,
|
|
611
|
+
"aria-expanded": false,
|
|
612
|
+
class: _normalizeClass3($setup.cn("upup-fx-hover-lift upup-fx-press upup-ml-auto upup-flex upup-h-7 upup-w-7 upup-shrink-0 upup-items-center upup-justify-center upup-rounded-lg", $setup.hasFilter ? "upup-text-[#0ea5e9]" : $setup.dark ? "upup-text-[#94a3b8] hover:upup-bg-white/[0.08]" : "upup-text-[#64748b] hover:upup-bg-black/[0.05]")),
|
|
613
|
+
onClick: _cache[1] || (_cache[1] = ($event) => $setup.searchOpen = true)
|
|
614
|
+
}, [_createVNode($setup["Icon"], { name: "search" })], 10, _hoisted_62)) : _createCommentVNode3("v-if", true),
|
|
615
|
+
$setup.props.showSearch && (!$setup.navigated || $setup.searchOpen) ? (_openBlock3(), _createElementBlock3(
|
|
616
|
+
"div",
|
|
617
|
+
{
|
|
618
|
+
key: 3,
|
|
619
|
+
class: _normalizeClass3($setup.cn("upup-relative upup-min-w-0 upup-flex-1", $setup.navigated && "upup-fx-search-expand", $setup.slotClasses.driveSearchContainer))
|
|
620
|
+
},
|
|
621
|
+
[_createElementVNode3("input", {
|
|
622
|
+
ref: "searchInputRef",
|
|
623
|
+
type: "search",
|
|
624
|
+
name: "upup-drive-search",
|
|
625
|
+
"data-testid": "upup-drive-search-input",
|
|
626
|
+
"data-upup-slot": "drive-search-input",
|
|
627
|
+
"aria-label": $setup.tr.search,
|
|
628
|
+
class: _normalizeClass3($setup.cn("upup-w-full upup-rounded-lg upup-px-3 upup-py-1.5 upup-pl-8 upup-text-xs upup-outline-none upup-ring-1 upup-transition-shadow focus:upup-ring-2 focus:upup-ring-[#38bdf8]", $setup.dark ? "upup-bg-white/[0.06] upup-text-[#e2e8f0] upup-ring-white/[0.1] placeholder:upup-text-[#64748b]" : "upup-bg-white upup-text-[#0f172a] upup-ring-black/[0.08] placeholder:upup-text-[#94a3b8]", $setup.slotClasses.driveSearchInput)),
|
|
629
|
+
placeholder: $setup.tr.search,
|
|
630
|
+
value: $setup.props.searchTerm,
|
|
631
|
+
onInput: _cache[2] || (_cache[2] = ($event) => $setup.props.onSearch($event.target.value)),
|
|
632
|
+
onKeydown: _cache[3] || (_cache[3] = _withKeys2(($event) => $setup.searchOpen = false, ["esc"])),
|
|
633
|
+
onBlur: _cache[4] || (_cache[4] = () => {
|
|
634
|
+
if (!$setup.props.searchTerm) $setup.searchOpen = false;
|
|
635
|
+
})
|
|
636
|
+
}, null, 42, _hoisted_72), _createVNode($setup["Icon"], {
|
|
637
|
+
name: "search",
|
|
638
|
+
class: "upup-absolute upup-left-2.5 upup-top-1/2 upup--translate-y-1/2 upup-text-[#939393]"
|
|
639
|
+
})],
|
|
640
|
+
2
|
|
641
|
+
/* CLASS */
|
|
642
|
+
)) : _createCommentVNode3("v-if", true)
|
|
643
|
+
],
|
|
644
|
+
2
|
|
645
|
+
/* CLASS */
|
|
646
|
+
)) : _createCommentVNode3("v-if", true)
|
|
647
|
+
])) : _createCommentVNode3("v-if", true);
|
|
648
|
+
}
|
|
649
|
+
var DriveBrowserHeader_default = /* @__PURE__ */ export_helper_default(_sfc_main3, [["render", _sfc_render3], ["__file", "C:\\Users\\amind\\OneDrive\\Desktop\\Projects\\INTERNAL\\upup\\packages\\vue\\src\\components\\shared\\DriveBrowserHeader.vue"]]);
|
|
650
|
+
|
|
651
|
+
// src/components/shared/DriveBrowserItem.vue
|
|
652
|
+
import { defineComponent as _defineComponent5 } from "vue";
|
|
653
|
+
import { computed as computed4 } from "vue";
|
|
654
|
+
import { cn as cn5 } from "@useupup/core/internal";
|
|
655
|
+
|
|
656
|
+
// src/components/shared/DriveBrowserIcon.vue
|
|
657
|
+
import { defineComponent as _defineComponent4 } from "vue";
|
|
658
|
+
import { cn as cn4, b64EncodeUnicode } from "@useupup/core/internal";
|
|
659
|
+
import { createCommentVNode as _createCommentVNode4, createVNode as _createVNode2, openBlock as _openBlock4, createElementBlock as _createElementBlock4, normalizeClass as _normalizeClass4 } from "vue";
|
|
660
|
+
var _sfc_main4 = /* @__PURE__ */ _defineComponent4({
|
|
661
|
+
__name: "DriveBrowserIcon",
|
|
662
|
+
props: { file: {
|
|
663
|
+
type: Object,
|
|
664
|
+
required: true
|
|
665
|
+
} },
|
|
666
|
+
setup(__props, { expose: __expose }) {
|
|
667
|
+
__expose();
|
|
668
|
+
const props = __props;
|
|
669
|
+
const { isDark: dark } = useUploaderTheme();
|
|
670
|
+
function handleImgError(e) {
|
|
671
|
+
const img = e.target;
|
|
672
|
+
const svg = `<svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg>`;
|
|
673
|
+
img.src = `data:image/svg+xml;base64,${b64EncodeUnicode(svg)}`;
|
|
674
|
+
img.onerror = null;
|
|
675
|
+
}
|
|
676
|
+
const __returned__ = {
|
|
677
|
+
props,
|
|
678
|
+
dark,
|
|
679
|
+
handleImgError,
|
|
680
|
+
get cn() {
|
|
681
|
+
return cn4;
|
|
682
|
+
},
|
|
683
|
+
get Icon() {
|
|
684
|
+
return Icon_default;
|
|
685
|
+
}
|
|
686
|
+
};
|
|
687
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
688
|
+
enumerable: false,
|
|
689
|
+
value: true
|
|
690
|
+
});
|
|
691
|
+
return __returned__;
|
|
692
|
+
}
|
|
693
|
+
});
|
|
694
|
+
var _hoisted_14 = {
|
|
695
|
+
key: 0,
|
|
696
|
+
class: "upup-flex-grow upup-text-lg"
|
|
697
|
+
};
|
|
698
|
+
var _hoisted_24 = {
|
|
699
|
+
key: 1,
|
|
700
|
+
class: "upup-flex-grow upup-text-lg"
|
|
701
|
+
};
|
|
702
|
+
var _hoisted_33 = ["src", "alt"];
|
|
703
|
+
function _sfc_render4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
704
|
+
return $setup.props.file.isFolder ? (_openBlock4(), _createElementBlock4("i", _hoisted_14, [_createCommentVNode4(" Amber filled folder in both themes \u2014 folders read\r\n unmistakably as folders. "), _createVNode2($setup["Icon"], {
|
|
705
|
+
name: "folder-filled",
|
|
706
|
+
class: "upup-text-[#fbbf24]"
|
|
707
|
+
})])) : !$setup.props.file.thumbnail ? (_openBlock4(), _createElementBlock4("i", _hoisted_24, [_createVNode2($setup["Icon"], {
|
|
708
|
+
name: "file",
|
|
709
|
+
class: _normalizeClass4($setup.cn({ "upup-text-[#6D6D6D] dark:upup-text-[#6D6D6D]": $setup.dark }))
|
|
710
|
+
}, null, 8, ["class"])])) : (_openBlock4(), _createElementBlock4("img", {
|
|
711
|
+
key: 2,
|
|
712
|
+
src: $setup.props.file.thumbnail,
|
|
713
|
+
alt: $setup.props.file.name,
|
|
714
|
+
class: "upup-h-5 upup-w-5 upup-flex-grow upup-rounded-md upup-shadow",
|
|
715
|
+
onError: $setup.handleImgError
|
|
716
|
+
}, null, 40, _hoisted_33));
|
|
717
|
+
}
|
|
718
|
+
var DriveBrowserIcon_default = /* @__PURE__ */ export_helper_default(_sfc_main4, [["render", _sfc_render4], ["__file", "C:\\Users\\amind\\OneDrive\\Desktop\\Projects\\INTERNAL\\upup\\packages\\vue\\src\\components\\shared\\DriveBrowserIcon.vue"]]);
|
|
719
|
+
|
|
720
|
+
// src/components/shared/DriveBrowserItem.vue
|
|
721
|
+
import { createVNode as _createVNode3, toDisplayString as _toDisplayString4, normalizeClass as _normalizeClass5, createElementVNode as _createElementVNode4, openBlock as _openBlock5, createElementBlock as _createElementBlock5 } from "vue";
|
|
722
|
+
var _sfc_main5 = /* @__PURE__ */ _defineComponent5({
|
|
723
|
+
__name: "DriveBrowserItem",
|
|
724
|
+
props: {
|
|
725
|
+
file: {
|
|
726
|
+
type: Object,
|
|
727
|
+
required: true
|
|
728
|
+
},
|
|
729
|
+
handleClick: {
|
|
730
|
+
type: Function,
|
|
731
|
+
required: true
|
|
732
|
+
},
|
|
733
|
+
selectedFiles: {
|
|
734
|
+
type: Array,
|
|
735
|
+
required: true
|
|
736
|
+
}
|
|
737
|
+
},
|
|
738
|
+
setup(__props, { expose: __expose }) {
|
|
739
|
+
__expose();
|
|
740
|
+
const props = __props;
|
|
741
|
+
const { isDark: dark, slotOverrides: slotClasses } = useUploaderTheme();
|
|
742
|
+
const isFolder = computed4(() => props.file.isFolder);
|
|
743
|
+
const isFileSelected = computed4(() => props.selectedFiles.filter((f) => f.id === props.file.id).length);
|
|
744
|
+
const __returned__ = {
|
|
745
|
+
props,
|
|
746
|
+
dark,
|
|
747
|
+
slotClasses,
|
|
748
|
+
isFolder,
|
|
749
|
+
isFileSelected,
|
|
750
|
+
get cn() {
|
|
751
|
+
return cn5;
|
|
752
|
+
},
|
|
753
|
+
DriveBrowserIcon: DriveBrowserIcon_default
|
|
754
|
+
};
|
|
755
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
756
|
+
enumerable: false,
|
|
757
|
+
value: true
|
|
758
|
+
});
|
|
759
|
+
return __returned__;
|
|
760
|
+
}
|
|
761
|
+
});
|
|
762
|
+
function _sfc_render5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
763
|
+
return _openBlock5(), _createElementBlock5(
|
|
764
|
+
"div",
|
|
765
|
+
{
|
|
766
|
+
"data-upup-slot": "drive-browser-item",
|
|
767
|
+
class: _normalizeClass5($setup.cn("upup-fx-hover-lift upup-group upup-mb-1.5 upup-flex upup-cursor-pointer upup-items-center upup-justify-between upup-gap-2 upup-rounded-[11px] upup-px-3 upup-py-2.5 upup-ring-1", { "upup-font-medium": $setup.isFolder }, $setup.isFileSelected ? $setup.dark ? "upup-bg-[#0ea5e9]/10 upup-ring-[#38bdf8]/35" : "upup-bg-[#0ea5e9]/10 upup-ring-[#0ea5e9]/40" : $setup.dark ? "upup-bg-white/[0.04] upup-ring-white/[0.06] hover:upup-bg-white/[0.07]" : "upup-bg-black/[0.03] upup-ring-black/[0.06] hover:upup-bg-black/[0.05]", {
|
|
768
|
+
[$setup.slotClasses.driveItemContainerDefault]: !$setup.isFileSelected && $setup.slotClasses.driveItemContainerDefault,
|
|
769
|
+
[$setup.slotClasses.driveItemContainerSelected]: $setup.isFileSelected && $setup.slotClasses.driveItemContainerSelected
|
|
770
|
+
})),
|
|
771
|
+
onClick: _cache[0] || (_cache[0] = ($event) => $setup.props.handleClick($setup.props.file))
|
|
772
|
+
},
|
|
773
|
+
[_createElementVNode4(
|
|
774
|
+
"div",
|
|
775
|
+
{ class: _normalizeClass5($setup.cn("upup-flex upup-items-center upup-gap-2", $setup.slotClasses.driveItemContainerInner)) },
|
|
776
|
+
[_createVNode3($setup["DriveBrowserIcon"], { file: $setup.props.file }, null, 8, ["file"]), _createElementVNode4(
|
|
777
|
+
"h1",
|
|
778
|
+
{ class: _normalizeClass5($setup.cn("upup-text-wrap upup-break-all upup-text-xs", { "upup-text-[#e0e0e0] dark:upup-text-[#e0e0e0]": $setup.dark }, $setup.slotClasses.driveItemInnerText)) },
|
|
779
|
+
_toDisplayString4($setup.props.file.name),
|
|
780
|
+
3
|
|
781
|
+
/* TEXT, CLASS */
|
|
782
|
+
)],
|
|
783
|
+
2
|
|
784
|
+
/* CLASS */
|
|
785
|
+
)],
|
|
786
|
+
2
|
|
787
|
+
/* CLASS */
|
|
788
|
+
);
|
|
789
|
+
}
|
|
790
|
+
var DriveBrowserItem_default = /* @__PURE__ */ export_helper_default(_sfc_main5, [["render", _sfc_render5], ["__file", "C:\\Users\\amind\\OneDrive\\Desktop\\Projects\\INTERNAL\\upup\\packages\\vue\\src\\components\\shared\\DriveBrowserItem.vue"]]);
|
|
791
|
+
|
|
792
|
+
// src/components/shared/DriveBrowser.vue
|
|
793
|
+
import { resolveDynamicComponent as _resolveDynamicComponent2, openBlock as _openBlock6, createBlock as _createBlock4, createCommentVNode as _createCommentVNode5, createVNode as _createVNode4, toDisplayString as _toDisplayString5, createElementVNode as _createElementVNode5, createElementBlock as _createElementBlock6, renderList as _renderList2, Fragment as _Fragment2, normalizeClass as _normalizeClass6, withCtx as _withCtx3 } from "vue";
|
|
794
|
+
var _sfc_main6 = /* @__PURE__ */ _defineComponent6({
|
|
795
|
+
__name: "DriveBrowser",
|
|
796
|
+
props: {
|
|
797
|
+
isClickLoading: {
|
|
798
|
+
type: Boolean,
|
|
799
|
+
required: false,
|
|
800
|
+
default: false
|
|
801
|
+
},
|
|
802
|
+
driveFiles: {
|
|
803
|
+
type: null,
|
|
804
|
+
required: false
|
|
805
|
+
},
|
|
806
|
+
path: {
|
|
807
|
+
type: Array,
|
|
808
|
+
required: true
|
|
809
|
+
},
|
|
810
|
+
setPath: {
|
|
811
|
+
type: Function,
|
|
812
|
+
required: true
|
|
813
|
+
},
|
|
814
|
+
user: {
|
|
815
|
+
type: null,
|
|
816
|
+
required: false
|
|
817
|
+
},
|
|
818
|
+
handleSignOut: {
|
|
819
|
+
type: Function,
|
|
820
|
+
required: true
|
|
821
|
+
},
|
|
822
|
+
handleClick: {
|
|
823
|
+
type: Function,
|
|
824
|
+
required: true
|
|
825
|
+
},
|
|
826
|
+
selectedFiles: {
|
|
827
|
+
type: Array,
|
|
828
|
+
required: true
|
|
829
|
+
},
|
|
830
|
+
showLoader: {
|
|
831
|
+
type: Boolean,
|
|
832
|
+
required: true
|
|
833
|
+
},
|
|
834
|
+
handleSubmit: {
|
|
835
|
+
type: Function,
|
|
836
|
+
required: true
|
|
837
|
+
},
|
|
838
|
+
handleCancelDownload: {
|
|
839
|
+
type: Function,
|
|
840
|
+
required: true
|
|
841
|
+
},
|
|
842
|
+
onSelectCurrentFolder: {
|
|
843
|
+
type: Function,
|
|
844
|
+
required: false
|
|
845
|
+
},
|
|
846
|
+
error: {
|
|
847
|
+
type: null,
|
|
848
|
+
required: false
|
|
849
|
+
},
|
|
850
|
+
hasMore: {
|
|
851
|
+
type: Boolean,
|
|
852
|
+
required: false,
|
|
853
|
+
default: false
|
|
854
|
+
},
|
|
855
|
+
isLoadingMore: {
|
|
856
|
+
type: Boolean,
|
|
857
|
+
required: false,
|
|
858
|
+
default: false
|
|
859
|
+
},
|
|
860
|
+
loadMore: {
|
|
861
|
+
type: Function,
|
|
862
|
+
required: false
|
|
863
|
+
},
|
|
864
|
+
dataUpupSlot: {
|
|
865
|
+
type: String,
|
|
866
|
+
required: false,
|
|
867
|
+
default: "drive-browser"
|
|
868
|
+
}
|
|
869
|
+
},
|
|
870
|
+
setup(__props, { expose: __expose }) {
|
|
871
|
+
__expose();
|
|
872
|
+
const props = __props;
|
|
873
|
+
const { allowedFileTypes, icons } = useUploaderOptions();
|
|
874
|
+
const { isDark: dark, slotOverrides: slotClasses } = useUploaderTheme();
|
|
875
|
+
const { translations: tr } = useUploaderI18n();
|
|
876
|
+
const searchTerm = ref3("");
|
|
877
|
+
function filterItems(item, accept) {
|
|
878
|
+
if (item.isFolder) return true;
|
|
879
|
+
if (!accept || accept === "*") return true;
|
|
880
|
+
return accept.split(",").some((pattern) => {
|
|
881
|
+
const p = pattern.trim();
|
|
882
|
+
if (p.startsWith(".")) return item.name.endsWith(p);
|
|
883
|
+
if (p.endsWith("/*")) return item.mimeType.startsWith(p.replace("/*", "/"));
|
|
884
|
+
return item.mimeType === p;
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
const items = computed5(() => {
|
|
888
|
+
var _a, _b;
|
|
889
|
+
return (_b = (_a = props.path[props.path.length - 1]) == null ? void 0 : _a.children) == null ? void 0 : _b.filter((item) => filterItems(item, allowedFileTypes));
|
|
890
|
+
});
|
|
891
|
+
const displayedItems = computed5(() => {
|
|
892
|
+
var _a;
|
|
893
|
+
return searchDriveFiles((_a = items.value) != null ? _a : [], searchTerm.value) || [];
|
|
894
|
+
});
|
|
895
|
+
const isLoading = computed5(() => !props.error && (props.isClickLoading || !props.driveFiles));
|
|
896
|
+
function noopClick() {
|
|
897
|
+
}
|
|
898
|
+
const __returned__ = {
|
|
899
|
+
props,
|
|
900
|
+
allowedFileTypes,
|
|
901
|
+
icons,
|
|
902
|
+
dark,
|
|
903
|
+
slotClasses,
|
|
904
|
+
tr,
|
|
905
|
+
searchTerm,
|
|
906
|
+
filterItems,
|
|
907
|
+
items,
|
|
908
|
+
displayedItems,
|
|
909
|
+
isLoading,
|
|
910
|
+
noopClick,
|
|
911
|
+
get t() {
|
|
912
|
+
return t2;
|
|
913
|
+
},
|
|
914
|
+
get plural() {
|
|
915
|
+
return plural;
|
|
916
|
+
},
|
|
917
|
+
get cn() {
|
|
918
|
+
return cn6;
|
|
919
|
+
},
|
|
920
|
+
SourceViewContainer: SourceViewContainer_default,
|
|
921
|
+
DriveBrowserHeader: DriveBrowserHeader_default,
|
|
922
|
+
DriveBrowserItem: DriveBrowserItem_default
|
|
923
|
+
};
|
|
924
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
925
|
+
enumerable: false,
|
|
926
|
+
value: true
|
|
927
|
+
});
|
|
928
|
+
return __returned__;
|
|
929
|
+
}
|
|
930
|
+
});
|
|
931
|
+
var _hoisted_15 = {
|
|
932
|
+
key: 1,
|
|
933
|
+
"data-testid": "upup-drive-browser",
|
|
934
|
+
class: "upup-grid upup-h-full upup-w-full upup-grid-rows-[auto,1fr,auto] upup-overflow-auto"
|
|
935
|
+
};
|
|
936
|
+
var _hoisted_25 = {
|
|
937
|
+
key: 0,
|
|
938
|
+
class: "upup-flex upup-h-full upup-flex-col upup-items-center upup-justify-center upup-px-6 upup-text-center"
|
|
939
|
+
};
|
|
940
|
+
var _hoisted_34 = {
|
|
941
|
+
"data-testid": "upup-drive-error",
|
|
942
|
+
"data-upup-slot": "drive-error",
|
|
943
|
+
role: "alert",
|
|
944
|
+
class: "upup-text-sm upup-text-red-600 dark:upup-text-red-400"
|
|
945
|
+
};
|
|
946
|
+
var _hoisted_43 = {
|
|
947
|
+
key: 1,
|
|
948
|
+
class: "upup-p-2"
|
|
949
|
+
};
|
|
950
|
+
var _hoisted_53 = {
|
|
951
|
+
key: 2,
|
|
952
|
+
class: "upup-flex upup-h-full upup-flex-col upup-items-center upup-justify-center"
|
|
953
|
+
};
|
|
954
|
+
var _hoisted_63 = { class: "upup-text-xs upup-opacity-70" };
|
|
955
|
+
var _hoisted_73 = ["disabled"];
|
|
956
|
+
var _hoisted_82 = ["disabled"];
|
|
957
|
+
var _hoisted_92 = ["disabled"];
|
|
958
|
+
var _hoisted_102 = ["disabled"];
|
|
959
|
+
function _sfc_render6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
960
|
+
return _openBlock6(), _createBlock4($setup["SourceViewContainer"], {
|
|
961
|
+
"is-loading": $setup.isLoading,
|
|
962
|
+
"data-upup-slot": $setup.props.dataUpupSlot
|
|
963
|
+
}, {
|
|
964
|
+
default: _withCtx3(() => {
|
|
965
|
+
var _a;
|
|
966
|
+
return [$setup.isLoading ? (_openBlock6(), _createBlock4(_resolveDynamicComponent2($setup.icons.LoaderIcon), { key: 0 })) : (_openBlock6(), _createElementBlock6("div", _hoisted_15, [
|
|
967
|
+
_createVNode4($setup["DriveBrowserHeader"], {
|
|
968
|
+
"show-search": !!((_a = $setup.items) == null ? void 0 : _a.length),
|
|
969
|
+
path: $setup.props.path,
|
|
970
|
+
"set-path": $setup.props.setPath,
|
|
971
|
+
"search-term": $setup.searchTerm,
|
|
972
|
+
"on-search": (v) => $setup.searchTerm = v,
|
|
973
|
+
user: $setup.props.user,
|
|
974
|
+
"handle-sign-out": $setup.props.handleSignOut
|
|
975
|
+
}, null, 8, [
|
|
976
|
+
"show-search",
|
|
977
|
+
"path",
|
|
978
|
+
"set-path",
|
|
979
|
+
"search-term",
|
|
980
|
+
"on-search",
|
|
981
|
+
"user",
|
|
982
|
+
"handle-sign-out"
|
|
983
|
+
]),
|
|
984
|
+
!!$setup.props.path ? (_openBlock6(), _createElementBlock6(
|
|
985
|
+
"div",
|
|
986
|
+
{
|
|
987
|
+
key: 0,
|
|
988
|
+
class: _normalizeClass6($setup.cn("upup-h-full upup-overflow-y-auto upup-pt-2", { "upup-text-[#fafafa] dark:upup-text-[#fafafa]": $setup.dark }, $setup.slotClasses.driveBody))
|
|
989
|
+
},
|
|
990
|
+
[
|
|
991
|
+
!!$setup.props.error ? (_openBlock6(), _createElementBlock6("div", _hoisted_25, [_createElementVNode5(
|
|
992
|
+
"p",
|
|
993
|
+
_hoisted_34,
|
|
994
|
+
_toDisplayString5($setup.t($setup.tr.driveLoadError, { message: $setup.props.error.message })),
|
|
995
|
+
1
|
|
996
|
+
/* TEXT */
|
|
997
|
+
)])) : _createCommentVNode5("v-if", true),
|
|
998
|
+
!!$setup.displayedItems.length ? (_openBlock6(), _createElementBlock6("ul", _hoisted_43, [(_openBlock6(true), _createElementBlock6(
|
|
999
|
+
_Fragment2,
|
|
1000
|
+
null,
|
|
1001
|
+
_renderList2($setup.displayedItems, (file) => {
|
|
1002
|
+
return _openBlock6(), _createBlock4($setup["DriveBrowserItem"], {
|
|
1003
|
+
key: file.id,
|
|
1004
|
+
file,
|
|
1005
|
+
"handle-click": $setup.props.isClickLoading || $setup.props.showLoader ? $setup.noopClick : $setup.props.handleClick,
|
|
1006
|
+
"selected-files": $setup.props.selectedFiles
|
|
1007
|
+
}, null, 8, [
|
|
1008
|
+
"file",
|
|
1009
|
+
"handle-click",
|
|
1010
|
+
"selected-files"
|
|
1011
|
+
]);
|
|
1012
|
+
}),
|
|
1013
|
+
128
|
|
1014
|
+
/* KEYED_FRAGMENT */
|
|
1015
|
+
))])) : _createCommentVNode5("v-if", true),
|
|
1016
|
+
!$setup.displayedItems.length && !$setup.props.error ? (_openBlock6(), _createElementBlock6("div", _hoisted_53, [_createElementVNode5(
|
|
1017
|
+
"p",
|
|
1018
|
+
_hoisted_63,
|
|
1019
|
+
_toDisplayString5($setup.tr.noAcceptedFilesFound),
|
|
1020
|
+
1
|
|
1021
|
+
/* TEXT */
|
|
1022
|
+
)])) : _createCommentVNode5("v-if", true),
|
|
1023
|
+
!!$setup.props.hasMore ? (_openBlock6(), _createElementBlock6("button", {
|
|
1024
|
+
key: 3,
|
|
1025
|
+
"data-testid": "upup-drive-load-more",
|
|
1026
|
+
"data-upup-slot": "drive-load-more",
|
|
1027
|
+
class: "upup-mx-auto upup-my-2 upup-block upup-rounded-md upup-px-3 upup-py-1.5 upup-text-sm upup-text-[#0284c7] disabled:upup-opacity-50",
|
|
1028
|
+
disabled: $setup.props.isLoadingMore,
|
|
1029
|
+
onClick: _cache[0] || (_cache[0] = ($event) => {
|
|
1030
|
+
var _a2, _b;
|
|
1031
|
+
return (_b = (_a2 = $setup.props).loadMore) == null ? void 0 : _b.call(_a2);
|
|
1032
|
+
})
|
|
1033
|
+
}, _toDisplayString5($setup.props.isLoadingMore ? $setup.tr.loading : $setup.tr.loadMore), 9, _hoisted_73)) : _createCommentVNode5("v-if", true)
|
|
1034
|
+
],
|
|
1035
|
+
2
|
|
1036
|
+
/* CLASS */
|
|
1037
|
+
)) : _createCommentVNode5("v-if", true),
|
|
1038
|
+
(!!$setup.props.selectedFiles.length || !!$setup.props.onSelectCurrentFolder) && !$setup.props.error ? (_openBlock6(), _createElementBlock6(
|
|
1039
|
+
"div",
|
|
1040
|
+
{
|
|
1041
|
+
key: 1,
|
|
1042
|
+
class: _normalizeClass6($setup.cn("upup-flex upup-origin-bottom upup-items-center upup-justify-start upup-gap-4 upup-border-t upup-px-3 upup-py-2", $setup.dark ? "upup-border-white/[0.08] upup-text-[#fafafa]" : "upup-border-black/[0.06]", $setup.slotClasses.driveFooter))
|
|
1043
|
+
},
|
|
1044
|
+
[
|
|
1045
|
+
!!$setup.props.onSelectCurrentFolder ? (_openBlock6(), _createElementBlock6("button", {
|
|
1046
|
+
key: 0,
|
|
1047
|
+
class: _normalizeClass6($setup.cn("upup-rounded-md upup-bg-transparent upup-px-3 upup-py-2 upup-text-sm upup-font-medium upup-text-[#0284c7] upup-transition-all upup-duration-300", { "upup-text-[#38bdf8] dark:upup-text-[#38bdf8]": $setup.dark })),
|
|
1048
|
+
disabled: $setup.props.showLoader,
|
|
1049
|
+
onClick: _cache[1] || (_cache[1] = ($event) => {
|
|
1050
|
+
var _a2, _b;
|
|
1051
|
+
return (_b = (_a2 = $setup.props).onSelectCurrentFolder) == null ? void 0 : _b.call(_a2);
|
|
1052
|
+
})
|
|
1053
|
+
}, _toDisplayString5($setup.tr.selectThisFolder), 11, _hoisted_82)) : _createCommentVNode5("v-if", true),
|
|
1054
|
+
_createElementVNode5("button", {
|
|
1055
|
+
class: _normalizeClass6($setup.cn("upup-rounded-md upup-bg-[#0ea5e9] upup-px-3 upup-py-2 upup-text-sm upup-font-medium upup-text-white upup-transition-all upup-duration-300", {
|
|
1056
|
+
"upup-animate-pulse": $setup.props.showLoader,
|
|
1057
|
+
"upup-bg-[#38bdf8] dark:upup-bg-[#38bdf8]": $setup.dark
|
|
1058
|
+
}, $setup.slotClasses.driveAddFilesButton)),
|
|
1059
|
+
disabled: $setup.props.showLoader,
|
|
1060
|
+
onClick: _cache[2] || (_cache[2] = (...args) => $setup.props.handleSubmit && $setup.props.handleSubmit(...args))
|
|
1061
|
+
}, _toDisplayString5($setup.t($setup.plural($setup.tr, "addFiles", $setup.props.selectedFiles.length), { count: $setup.props.selectedFiles.length })), 11, _hoisted_92),
|
|
1062
|
+
_createElementVNode5("button", {
|
|
1063
|
+
class: _normalizeClass6($setup.cn("upup-ml-auto upup-rounded-md upup-p-1 upup-text-sm upup-text-[#0284c7] upup-transition-all upup-duration-300", { "upup-text-[#38bdf8] dark:upup-text-[#38bdf8]": $setup.dark }, $setup.slotClasses.driveCancelFilesButton)),
|
|
1064
|
+
disabled: $setup.props.showLoader,
|
|
1065
|
+
onClick: _cache[3] || (_cache[3] = (...args) => $setup.props.handleCancelDownload && $setup.props.handleCancelDownload(...args))
|
|
1066
|
+
}, _toDisplayString5($setup.tr.cancel), 11, _hoisted_102)
|
|
1067
|
+
],
|
|
1068
|
+
2
|
|
1069
|
+
/* CLASS */
|
|
1070
|
+
)) : _createCommentVNode5("v-if", true)
|
|
1071
|
+
]))];
|
|
1072
|
+
}),
|
|
1073
|
+
_: 1
|
|
1074
|
+
}, 8, ["is-loading", "data-upup-slot"]);
|
|
1075
|
+
}
|
|
1076
|
+
var DriveBrowser_default = /* @__PURE__ */ export_helper_default(_sfc_main6, [["render", _sfc_render6], ["__file", "C:\\Users\\amind\\OneDrive\\Desktop\\Projects\\INTERNAL\\upup\\packages\\vue\\src\\components\\shared\\DriveBrowser.vue"]]);
|
|
1077
|
+
|
|
1078
|
+
export {
|
|
1079
|
+
DriveAuthFallback_default,
|
|
1080
|
+
DriveBrowser_default,
|
|
1081
|
+
ServerModeDriveUploader_default
|
|
1082
|
+
};
|
|
1083
|
+
//# sourceMappingURL=chunk-PPPFIWFQ.js.map
|