frappe-ui 0.1.261 → 0.1.262
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/frappe/Filter/utils.ts +5 -4
- package/frappe/drive/components/AppSwitcher.vue +47 -0
- package/frappe/drive/components/DriveLogo.vue +18 -0
- package/frappe/drive/components/InfoDialog.vue +207 -0
- package/frappe/drive/components/MoveDialog.vue +450 -0
- package/frappe/drive/components/RenameDialog.vue +76 -0
- package/frappe/drive/components/Select/Select.vue +136 -0
- package/frappe/drive/components/Select/types.ts +18 -0
- package/frappe/drive/components/ShareDialog.vue +397 -0
- package/frappe/drive/components/TagInput/TagInput.vue +113 -0
- package/frappe/drive/components/TagInput/types.ts +45 -0
- package/frappe/drive/components/TagInput/utils.ts +63 -0
- package/frappe/drive/components/TeamSelector.vue +50 -0
- package/frappe/drive/index.js +6 -0
- package/frappe/drive/js/icons.js +705 -0
- package/frappe/drive/js/resources.js +110 -0
- package/frappe/drive/js/utils.js +110 -0
- package/package.json +46 -31
- package/src/components/Alert/Alert.vue +12 -0
- package/src/components/Alert/stories/Controlled.vue +16 -0
- package/src/components/Alert/stories/Slots.vue +20 -0
- package/src/components/Alert/stories/Themes.vue +14 -0
- package/src/components/Alert/types.ts +26 -1
- package/src/components/Avatar/Avatar.vue +9 -0
- package/src/components/Avatar/stories/Shapes.vue +12 -0
- package/src/components/Avatar/stories/Sizes.vue +10 -0
- package/src/components/Avatar/types.ts +7 -0
- package/src/components/Badge/Badge.vue +14 -2
- package/src/components/Badge/stories/Themes.vue +10 -0
- package/src/components/Badge/stories/Variants.vue +10 -0
- package/src/components/Badge/types.ts +8 -0
- package/src/components/Breadcrumbs/Breadcrumbs.vue +26 -0
- package/src/components/Breadcrumbs/stories/Example.vue +13 -0
- package/src/components/Breadcrumbs/stories/Slots.vue +24 -0
- package/src/components/Breadcrumbs/types.ts +9 -1
- package/src/components/Button/Button.vue +14 -0
- package/src/components/Button/stories/Icons.vue +27 -0
- package/src/components/Button/stories/Sizes.vue +11 -0
- package/src/components/Button/stories/Themes.vue +10 -0
- package/src/components/Button/stories/Variants.vue +10 -0
- package/src/components/Button/types.ts +29 -1
- package/src/components/Calendar/Calendar.vue +0 -1
- package/src/components/Calendar/stories/CustomHeader.vue +151 -0
- package/src/components/Calendar/stories/Examples.vue +102 -0
- package/src/components/Charts/{Charts.story.vue → stories/Examples.vue} +37 -29
- package/src/components/Checkbox/stories/Examples.vue +8 -0
- package/src/components/Checkbox/types.ts +11 -0
- package/src/components/CircularProgressBar/CircularProgressBar.story.vue +62 -59
- package/src/components/CircularProgressBar/types.ts +17 -3
- package/src/components/Combobox/Combobox.vue +29 -9
- package/src/components/Combobox/stories/CustomRender.vue +26 -0
- package/src/components/Combobox/stories/Grouped.vue +40 -0
- package/src/components/Combobox/stories/OptionSlots.vue +42 -0
- package/src/components/Combobox/stories/Simple.vue +19 -0
- package/src/components/Combobox/stories/WithIcons.vue +16 -0
- package/src/components/Combobox/types.ts +15 -0
- package/src/components/DatePicker/DatePicker.vue +1 -1
- package/src/components/DatePicker/DateRangePicker.vue +1 -1
- package/src/components/DatePicker/DateTimePicker.vue +1 -1
- package/src/components/DatePicker/stories/DateTime.vue +16 -0
- package/src/components/DatePicker/stories/Examples.vue +11 -0
- package/src/components/DatePicker/stories/Range.vue +12 -0
- package/src/components/DatePicker/types.ts +1 -1
- package/src/components/DatePicker/utils.ts +1 -1
- package/src/components/Dialog/Dialog.vue +22 -0
- package/src/components/Dialog/stories/Confirm.vue +38 -0
- package/src/components/Dialog/stories/Custom.vue +38 -0
- package/src/components/Dialog/stories/Interactive.vue +48 -0
- package/src/components/Dialog/stories/Modal.vue +21 -0
- package/src/components/Dialog/types.ts +5 -0
- package/src/components/Dropdown/Dropdown.vue +13 -7
- package/src/components/Dropdown/stories/CustomTrigger.vue +19 -0
- package/src/components/Dropdown/stories/Examples.vue +17 -0
- package/src/components/Dropdown/stories/Grouped.vue +36 -0
- package/src/components/Dropdown/stories/Submenus.vue +31 -0
- package/src/components/Dropdown/stories/Switches.vue +28 -0
- package/src/components/Dropdown/types.ts +13 -1
- package/src/components/ErrorMessage/stories/ErrorObject.vue +15 -0
- package/src/components/ErrorMessage/stories/Examples.vue +10 -0
- package/src/components/ErrorMessage/types.ts +1 -0
- package/src/components/FileUploader/stories/Examples.vue +25 -0
- package/src/components/FormControl/FormControl.story.vue +85 -101
- package/src/components/FormControl/FormControl.vue +13 -0
- package/src/components/FormControl/types.ts +6 -0
- package/src/components/ListView/stories/CellSlot.vue +65 -0
- package/src/components/ListView/stories/CustomList.vue +120 -0
- package/src/components/ListView/stories/Empty.vue +40 -0
- package/src/components/ListView/stories/Examples.vue +56 -0
- package/src/components/ListView/stories/GroupedRows.vue +152 -0
- package/src/components/MonthPicker/MonthPicker.vue +7 -1
- package/src/components/MonthPicker/stories/Example.vue +10 -0
- package/src/components/MonthPicker/types.ts +4 -0
- package/src/components/MultiSelect/MultiSelect.vue +8 -0
- package/src/components/MultiSelect/stories/Example.vue +24 -0
- package/src/components/MultiSelect/stories/Footer.vue +43 -0
- package/src/components/MultiSelect/stories/Options.vue +33 -0
- package/src/components/MultiSelect/types.ts +5 -0
- package/src/components/Password/Password.vue +19 -14
- package/src/components/Password/stories/Example.vue +10 -0
- package/src/components/Password/types.ts +3 -0
- package/src/components/Popover/Popover.vue +39 -7
- package/src/components/Popover/stories/Click.vue +14 -0
- package/src/components/Popover/stories/Hover.vue +14 -0
- package/src/components/Popover/types.ts +15 -6
- package/src/components/Progress/Progress.vue +7 -0
- package/src/components/Progress/stories/Examples.vue +7 -0
- package/src/components/Progress/stories/Hint.vue +7 -0
- package/src/components/Progress/stories/Intervals.vue +12 -0
- package/src/components/Progress/stories/Sizes.vue +10 -0
- package/src/components/Progress/types.ts +11 -0
- package/src/components/Rating/stories/Examples.vue +7 -0
- package/src/components/Rating/types.ts +10 -1
- package/src/components/Select/Select.vue +17 -2
- package/src/components/Select/stories/Example.vue +42 -0
- package/src/components/Select/stories/OptionSlot.vue +62 -0
- package/src/components/Select/stories/TriggerSlots.vue +51 -0
- package/src/components/Select/types.ts +14 -1
- package/src/components/Sidebar/Sidebar.vue +19 -15
- package/src/components/Sidebar/stories/Example.vue +88 -0
- package/src/components/Slider/Slider.vue +38 -0
- package/src/components/Slider/index.ts +1 -0
- package/src/components/Slider/stories/Example.vue +11 -0
- package/src/components/Slider/stories/Range.vue +11 -0
- package/src/components/Slider/types.ts +5 -0
- package/src/components/Switch/Switch.vue +5 -1
- package/src/components/Switch/stories/Example.vue +7 -0
- package/src/components/Switch/stories/Labels.vue +17 -0
- package/src/components/Switch/types.ts +12 -1
- package/src/components/TabButtons/TabButtons.story.vue +17 -17
- package/src/components/Tabs/Tabs.vue +8 -0
- package/src/components/Tabs/stories/Icons.vue +40 -0
- package/src/components/Tabs/stories/Orientation.vue +44 -0
- package/src/components/Tabs/types.ts +11 -1
- package/src/components/TextEditor/TextEditor.vue +34 -154
- package/src/components/TextEditor/commands.js +55 -39
- package/src/components/TextEditor/{FontColor.vue → components/FontColor.vue} +2 -2
- package/src/components/TextEditor/{ImageViewerModal.vue → components/ImageViewerModal.vue} +4 -4
- package/src/components/TextEditor/{InsertImage.vue → components/InsertImage.vue} +1 -1
- package/src/components/TextEditor/{LinkPopup.vue → components/LinkPopup.vue} +4 -4
- package/src/components/TextEditor/components/MediaNodeView.vue +377 -0
- package/src/components/TextEditor/components/Menu.vue +206 -0
- package/src/components/TextEditor/{TextEditorBubbleMenu.vue → components/TextEditorBubbleMenu.vue} +5 -13
- package/src/components/TextEditor/{TextEditorFixedMenu.vue → components/TextEditorFixedMenu.vue} +10 -6
- package/src/components/TextEditor/{TextEditorFloatingMenu.vue → components/TextEditorFloatingMenu.vue} +4 -3
- package/src/components/TextEditor/components/index.js +0 -0
- package/src/components/TextEditor/extensions/code-block.ts +2 -2
- package/src/components/TextEditor/extensions/content-paste-extension.ts +45 -37
- package/src/components/TextEditor/extensions/copy-styles.ts +159 -0
- package/src/components/TextEditor/extensions/highlight/highlight-styles.css +0 -1
- package/src/components/TextEditor/extensions/iframe/InsertIframe.vue +13 -3
- package/src/components/TextEditor/extensions/image/image-extension.ts +26 -5
- package/src/components/TextEditor/extensions/image-group/ImageGroupNodeView.vue +18 -53
- package/src/components/TextEditor/extensions/image-group/image-group-extension.ts +71 -0
- package/src/components/TextEditor/{image-viewer-extension.ts → extensions/image-viewer-extension.ts} +1 -1
- package/src/components/TextEditor/extensions/link/index.ts +1 -0
- package/src/components/TextEditor/{link-extension.ts → extensions/link/link-extension.ts} +5 -15
- package/src/components/TextEditor/{linkPasteHandler.ts → extensions/link/linkPasteHandler.ts} +1 -1
- package/src/components/TextEditor/extensions/mention/mention-extension.ts +22 -1
- package/src/components/TextEditor/extensions/slash-commands/slash-commands-extension.ts +13 -0
- package/src/components/TextEditor/extensions/toc-node/TocNodeView.vue +438 -0
- package/src/components/TextEditor/extensions/toc-node/index.ts +3 -0
- package/src/components/TextEditor/extensions/toc-node/toc-node-extension.ts +166 -0
- package/src/components/TextEditor/extensions/video-extension.ts +603 -0
- package/src/components/TextEditor/index.ts +3 -3
- package/src/components/TextEditor/stories/Comment.vue +53 -0
- package/src/components/TextEditor/stories/Example.vue +33 -0
- package/src/components/TextEditor/style.css +164 -0
- package/src/components/TextEditor/types.ts +36 -0
- package/src/components/TextInput/TextInput.vue +9 -1
- package/src/components/TextInput/stories/List.vue +71 -0
- package/src/components/TextInput/types.ts +17 -0
- package/src/components/Textarea/stories/Variants.vue +8 -0
- package/src/components/Textarea/types.ts +17 -0
- package/src/components/TimePicker/TimePicker.vue +18 -0
- package/src/components/TimePicker/stories/Basic.vue +15 -0
- package/src/components/TimePicker/stories/CustomOptions.vue +26 -0
- package/src/components/TimePicker/stories/Range.vue +15 -0
- package/src/components/TimePicker/stories/TwentyFour.vue +11 -0
- package/src/components/TimePicker/types.ts +38 -0
- package/src/components/Tooltip/Tooltip.vue +21 -0
- package/src/components/Tooltip/stories/Examples.vue +9 -0
- package/src/components/Tooltip/stories/Slots.vue +16 -0
- package/src/components/Tooltip/types.ts +21 -0
- package/src/components/Tree/Tree.vue +5 -0
- package/src/components/Tree/{Tree.story.vue → stories/Example.vue} +15 -25
- package/src/components/Tree/types.ts +34 -6
- package/src/data-fetching/docStore.ts +17 -5
- package/src/data-fetching/useDoc/useDoc.ts +19 -15
- package/src/data-fetching/useList/useList.ts +1 -1
- package/src/directives/focus.ts +46 -0
- package/src/env.d.ts +0 -1
- package/src/index.ts +2 -1
- package/src/components/Alert/Alert.story.vue +0 -78
- package/src/components/Autocomplete/Autocomplete.story.vue +0 -104
- package/src/components/Avatar/Avatar.story.vue +0 -28
- package/src/components/Badge/Badge.story.vue +0 -26
- package/src/components/Breadcrumbs/Breadcrumbs.story.vue +0 -73
- package/src/components/Button/Button.story.vue +0 -34
- package/src/components/Calendar/Calendar.story.md +0 -197
- package/src/components/Calendar/Calendar.story.vue +0 -191
- package/src/components/Checkbox/Checkbox.story.vue +0 -22
- package/src/components/CircularProgressBar/CircularProgressBar.story.md +0 -43
- package/src/components/Combobox/Combobox.story.vue +0 -348
- package/src/components/DatePicker/DatePicker.story.vue +0 -36
- package/src/components/Dialog/Dialog.story.vue +0 -229
- package/src/components/Dropdown/Dropdown.story.vue +0 -225
- package/src/components/ErrorMessage/ErrorMessage.story.vue +0 -28
- package/src/components/FileUploader/FileUploader.story.vue +0 -34
- package/src/components/ListView/ListView.story.md +0 -137
- package/src/components/ListView/ListView.story.vue +0 -437
- package/src/components/MonthPicker/MonthPicker.story.vue +0 -21
- package/src/components/MultiSelect/MultiSelect.story.vue +0 -68
- package/src/components/Password/Password.story.vue +0 -14
- package/src/components/Popover/Popover.story.vue +0 -29
- package/src/components/Progress/Progress.story.vue +0 -34
- package/src/components/Rating/Rating.story.vue +0 -18
- package/src/components/Select/Select.story.vue +0 -78
- package/src/components/Sidebar/Sidebar.story.vue +0 -80
- package/src/components/Spinner/Spinner.story.vue +0 -14
- package/src/components/Spinner/Spinner.vue +0 -50
- package/src/components/Spinner/index.ts +0 -1
- package/src/components/Switch/Switch.story.vue +0 -59
- package/src/components/Tabs/Tabs.story.vue +0 -100
- package/src/components/TextEditor/Menu.vue +0 -110
- package/src/components/TextEditor/TextEditor.story.vue +0 -89
- package/src/components/TextEditor/extensions/image/ImageNodeView.vue +0 -263
- package/src/components/TextEditor/extensions/list-extension.ts +0 -32
- package/src/components/TextEditor/icons/align-center.vue +0 -14
- package/src/components/TextEditor/icons/align-justify.vue +0 -14
- package/src/components/TextEditor/icons/align-left.vue +0 -14
- package/src/components/TextEditor/icons/align-right.vue +0 -14
- package/src/components/TextEditor/icons/arrow-go-back-line.vue +0 -14
- package/src/components/TextEditor/icons/arrow-go-forward-line.vue +0 -14
- package/src/components/TextEditor/icons/bold.vue +0 -14
- package/src/components/TextEditor/icons/code-view.vue +0 -14
- package/src/components/TextEditor/icons/double-quotes-r.vue +0 -14
- package/src/components/TextEditor/icons/font-color.vue +0 -14
- package/src/components/TextEditor/icons/format-clear.vue +0 -14
- package/src/components/TextEditor/icons/h-1.vue +0 -14
- package/src/components/TextEditor/icons/h-2.vue +0 -14
- package/src/components/TextEditor/icons/h-3.vue +0 -14
- package/src/components/TextEditor/icons/h-4.vue +0 -14
- package/src/components/TextEditor/icons/h-5.vue +0 -14
- package/src/components/TextEditor/icons/h-6.vue +0 -14
- package/src/components/TextEditor/icons/image-add-line.vue +0 -14
- package/src/components/TextEditor/icons/italic.vue +0 -14
- package/src/components/TextEditor/icons/link.vue +0 -14
- package/src/components/TextEditor/icons/list-ordered.vue +0 -14
- package/src/components/TextEditor/icons/list-task.vue +0 -20
- package/src/components/TextEditor/icons/list-unordered.vue +0 -14
- package/src/components/TextEditor/icons/readme.md +0 -1
- package/src/components/TextEditor/icons/separator.vue +0 -14
- package/src/components/TextEditor/icons/strikethrough.vue +0 -14
- package/src/components/TextEditor/icons/table-2.vue +0 -14
- package/src/components/TextEditor/icons/text.vue +0 -11
- package/src/components/TextEditor/icons/underline.vue +0 -14
- package/src/components/TextEditor/icons/video-add-line.vue +0 -14
- package/src/components/TextEditor/mention.js +0 -72
- package/src/components/TextEditor/video-extension.ts +0 -162
- package/src/components/TextInput/TextInput.story.vue +0 -81
- package/src/components/Textarea/Textarea.story.vue +0 -27
- package/src/components/TimePicker/TimePicker.story.vue +0 -138
- package/src/components/Tooltip/Tooltip.story.vue +0 -51
- package/src/components/Tree/Tree.story.md +0 -56
- /package/src/components/TextEditor/{CodeBlockComponent.vue → components/CodeBlockComponent.vue} +0 -0
- /package/src/components/TextEditor/{InsertLink.vue → components/InsertLink.vue} +0 -0
- /package/src/components/TextEditor/{InsertVideo.vue → components/InsertVideo.vue} +0 -0
- /package/src/components/TextEditor/{MentionList.vue → components/MentionList.vue} +0 -0
package/frappe/Filter/utils.ts
CHANGED
|
@@ -140,7 +140,7 @@ export const getValueControl = (row: StateRow) => {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
if (typeSelect.includes(fieldType) || typeCheck.includes(fieldType)) {
|
|
143
|
-
let _options = options || ['
|
|
143
|
+
let _options = options || ['Yes', 'No']
|
|
144
144
|
|
|
145
145
|
return h(Select, { placeholder: 'Select Option', options: _options })
|
|
146
146
|
}
|
|
@@ -225,9 +225,10 @@ export const parseFilters = (filters: any) => {
|
|
|
225
225
|
|
|
226
226
|
return _filters.map(transformIn).reduce((acc, cur) => {
|
|
227
227
|
if (['equals', '='].includes(cur.operator)) {
|
|
228
|
-
cur.value = cur.
|
|
229
|
-
}
|
|
230
|
-
|
|
228
|
+
cur.value = cur.value == 'Yes' ? true : cur.value == 'No' ? false : cur.value
|
|
229
|
+
} else if (cur.operator === 'between') {
|
|
230
|
+
cur.value = [...cur.value.split(',')]
|
|
231
|
+
}
|
|
231
232
|
|
|
232
233
|
return [
|
|
233
234
|
...acc,
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import { useRouter } from 'vue-router'
|
|
4
|
+
|
|
5
|
+
const router = useRouter()
|
|
6
|
+
|
|
7
|
+
router.afterEach(() => {
|
|
8
|
+
open.value = false
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
defineProps<{
|
|
12
|
+
apps: Array<{
|
|
13
|
+
title: string
|
|
14
|
+
logo: string
|
|
15
|
+
route: string
|
|
16
|
+
}>
|
|
17
|
+
}>()
|
|
18
|
+
|
|
19
|
+
const open = ref(false)
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<div class="fixed left-0 top-0 h-screen w-3 z-40" @mouseenter="open = true" />
|
|
24
|
+
<aside
|
|
25
|
+
class="fixed left-0 top-0 h-screen z-50 transition-transform duration-300 ease-out bg-surface-white border-r border-gray-200 px-2"
|
|
26
|
+
:class="!open && '-translate-x-full'"
|
|
27
|
+
@mouseleave="open = false"
|
|
28
|
+
>
|
|
29
|
+
<div class="flex h-full items-center justify-center">
|
|
30
|
+
<div class="flex flex-col gap-6">
|
|
31
|
+
<a
|
|
32
|
+
v-for="app in apps"
|
|
33
|
+
:key="app.route"
|
|
34
|
+
:href="app.route"
|
|
35
|
+
:title="app.title"
|
|
36
|
+
class="group flex items-center justify-center rounded-md hover:shadow-sm transition"
|
|
37
|
+
>
|
|
38
|
+
<img
|
|
39
|
+
:src="app.logo"
|
|
40
|
+
:alt="app.title"
|
|
41
|
+
class="size-7 opacity-80 group-hover:opacity-100"
|
|
42
|
+
/>
|
|
43
|
+
</a>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</aside>
|
|
47
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg
|
|
3
|
+
width="118"
|
|
4
|
+
height="118"
|
|
5
|
+
viewBox="0 0 118 118"
|
|
6
|
+
fill="none"
|
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
+
>
|
|
9
|
+
<path
|
|
10
|
+
d="M93.9278 0H23.1013C10.3428 0 0 10.3428 0 23.1013V93.9278C0 106.686 10.3428 117.029 23.1013 117.029H93.9278C106.686 117.029 117.029 106.686 117.029 93.9278V23.1013C117.029 10.3428 106.686 0 93.9278 0Z"
|
|
11
|
+
fill="#016E7D"
|
|
12
|
+
/>
|
|
13
|
+
<path
|
|
14
|
+
d="M80.1723 35.7545H59.7487L55.7059 28.2466H20.8965V38.7472H49.4056L53.4483 46.2551H82.955C83.9525 46.2551 84.7926 47.0951 84.7926 48.0927V76.4968C84.7926 77.4943 83.9525 78.3344 82.955 78.3344H33.2347C32.2371 78.3344 31.3971 77.4943 31.3971 76.4968V50.5603H20.8965V73.6616C20.8965 82.0096 27.6694 88.835 36.0173 88.835H80.1723C88.5203 88.835 95.2932 82.0621 95.2932 73.6616V50.8754C95.2932 42.5274 88.5203 35.702 80.1723 35.702V35.7545Z"
|
|
15
|
+
fill="#EEFBFF"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Dialog v-model="open" @close="dialogType = ''">
|
|
3
|
+
<template #body-title>
|
|
4
|
+
<h3 class="text-2xl font-semibold leading-6 text-ink-gray-9 cursor-pointer pr-2" @click="emitter.emit('rename')">
|
|
5
|
+
{{ entity.title }}
|
|
6
|
+
</h3>
|
|
7
|
+
</template>
|
|
8
|
+
<template #body-content>
|
|
9
|
+
<ul class="space-y-3 text-sm mb-4 text-ink-gray-8">
|
|
10
|
+
<span class="text-base font-semibold">Information</span>
|
|
11
|
+
<li>
|
|
12
|
+
<span class="inline-block w-24 text-ink-gray-5">{{ __('Owner') }}:</span>
|
|
13
|
+
<span class="col-span-1">
|
|
14
|
+
<a :href="`mailto:${entity.owner}`">{{ entity.owner }}</a>
|
|
15
|
+
</span>
|
|
16
|
+
</li>
|
|
17
|
+
<li>
|
|
18
|
+
<span class="inline-block w-24 text-ink-gray-5">{{ __('Type') }}:</span>
|
|
19
|
+
<span class="col-span-1">{{ entity.file_type }}</span>
|
|
20
|
+
</li>
|
|
21
|
+
<li v-if="entity.file_size">
|
|
22
|
+
<span class="inline-block w-24 text-ink-gray-5">{{ __('Size') }}:</span>
|
|
23
|
+
<span class="col-span-1">
|
|
24
|
+
{{ entity.file_size_pretty }}{{ ` (${entity.file_size})` }}
|
|
25
|
+
</span>
|
|
26
|
+
</li>
|
|
27
|
+
<li>
|
|
28
|
+
<span class="inline-block w-24 text-ink-gray-5">{{ __('Modified') }}:</span>
|
|
29
|
+
<span class="col-span-1">{{ formatDate(entity.modified) }}</span>
|
|
30
|
+
</li>
|
|
31
|
+
<li>
|
|
32
|
+
<span class="inline-block w-24 text-ink-gray-5">{{ __('Added') }}:</span>
|
|
33
|
+
<span class="col-span-1">{{ formatDate(entity.creation) }}</span>
|
|
34
|
+
</li>
|
|
35
|
+
<li class="flex items-center">
|
|
36
|
+
<span class="inline-block w-24 text-ink-gray-5">{{ __('Tags') }}:</span>
|
|
37
|
+
<TagInput class="flex-grow bg-transparent" :entity />
|
|
38
|
+
</li>
|
|
39
|
+
</ul>
|
|
40
|
+
|
|
41
|
+
<ul v-if="editor?.storage?.characterCount" class="space-y-3 text-sm mb-4 text-ink-gray-8">
|
|
42
|
+
<span class="text-base font-semibold">{{ __('Stats') }}</span>
|
|
43
|
+
<li>
|
|
44
|
+
<span class="inline-block w-24 text-ink-gray-5">{{ __('Words') }}:</span>
|
|
45
|
+
<span class="col-span-1">{{
|
|
46
|
+
editor.storage.characterCount.words()
|
|
47
|
+
}}</span>
|
|
48
|
+
</li>
|
|
49
|
+
<li>
|
|
50
|
+
<span class="inline-block w-24 text-ink-gray-5">{{ __('Characters') }}:</span>
|
|
51
|
+
<span class="col-span-1">{{
|
|
52
|
+
editor.storage.characterCount.characters()
|
|
53
|
+
}}</span>
|
|
54
|
+
</li>
|
|
55
|
+
<li>
|
|
56
|
+
<span class="inline-block w-24 text-ink-gray-5">{{ __('Reading time') }}:</span>
|
|
57
|
+
<span class="col-span-1">
|
|
58
|
+
{{ Math.ceil(editor.storage.characterCount.words() / 200) }}
|
|
59
|
+
{{
|
|
60
|
+
Math.ceil(editor.storage.characterCount.words() / 200) > 1
|
|
61
|
+
? 'minutes'
|
|
62
|
+
: 'minute'
|
|
63
|
+
}}
|
|
64
|
+
</span>
|
|
65
|
+
</li>
|
|
66
|
+
</ul>
|
|
67
|
+
<div class="flex justify-between items-center">
|
|
68
|
+
<span class="text-base font-semibold text-ink-gray-8">Access</span>
|
|
69
|
+
<Button v-if="entity.share" :variant="'subtle'" size="sm"
|
|
70
|
+
class="rounded flex justify-center items-center scale-[90%]" @click="emitter.emit('share')">
|
|
71
|
+
{{ __('Manage') }}
|
|
72
|
+
</Button>
|
|
73
|
+
</div>
|
|
74
|
+
<LoadingIndicator v-if="!getGeneralAccess.data?.type" class="size-4 mx-auto my-1" />
|
|
75
|
+
<ul v-else class="space-y-3 text-sm py-2">
|
|
76
|
+
<li class="flex">
|
|
77
|
+
<span class="inline-block w-24 text-ink-gray-5">{{ __('General') }}:</span>
|
|
78
|
+
<div class="col-span-1 flex gap-2">
|
|
79
|
+
<div class="col-span-1 flex gap-2 items-center text-ink-gray-8">
|
|
80
|
+
<div class="rounded-full flex items-center justify-center p-0.5 size-4.5"
|
|
81
|
+
:class="accessConfig[getGeneralAccess.data.type].color">
|
|
82
|
+
<component :is="accessConfig[getGeneralAccess.data.type].icon" class="h-[90%] w-[90%]" />
|
|
83
|
+
</div>
|
|
84
|
+
<span>{{ accessConfig[getGeneralAccess.data.type].label }}</span>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</li>
|
|
88
|
+
<li>
|
|
89
|
+
<span class="inline-block w-24 text-ink-gray-5">{{ __('Shared') }}:</span>
|
|
90
|
+
<span v-if="userAccess.data?.length" class="col-span-1 text-ink-gray-8">
|
|
91
|
+
{{
|
|
92
|
+
userAccess.data.length +
|
|
93
|
+
' ' +
|
|
94
|
+
(userAccess.data.length === 1 ? __('person') : __('people'))
|
|
95
|
+
}}
|
|
96
|
+
{{
|
|
97
|
+
userAccess.data.length < 3 ? '(' + userAccess.data.map((k) => k.user).join(', ') + ')'
|
|
98
|
+
: ''
|
|
99
|
+
}}
|
|
100
|
+
</span>
|
|
101
|
+
<span v-else>-</span>
|
|
102
|
+
</li>
|
|
103
|
+
</ul>
|
|
104
|
+
<ul v-if="developer" class="space-y-3 text-sm text-ink-gray-8 mb-4 mt-4">
|
|
105
|
+
<div>
|
|
106
|
+
<span class="text-base font-semibold">{{ __('Developer') }}</span>
|
|
107
|
+
<Button variant="subtle" size="sm" class="scale-[90%] float-right">
|
|
108
|
+
<a :href="'/app/drive-file/' + entity.name" target="_blank">Open in Desk</a>
|
|
109
|
+
</Button>
|
|
110
|
+
</div>
|
|
111
|
+
<li>
|
|
112
|
+
<span class="inline-block w-24">ID:</span>
|
|
113
|
+
<span class="col-span-1">{{ entity.name }}</span>
|
|
114
|
+
</li>
|
|
115
|
+
<li>
|
|
116
|
+
<span class="inline-block w-24">Disk path:</span>
|
|
117
|
+
<span class="col-span-1">{{ entity.path }}</span>
|
|
118
|
+
</li>
|
|
119
|
+
<li>
|
|
120
|
+
<span class="inline-block w-24">Team:</span>
|
|
121
|
+
<span class="col-span-1">{{ entity.team }}</span>
|
|
122
|
+
</li>
|
|
123
|
+
<li>
|
|
124
|
+
<span class="inline-block w-24">MIME type:</span>
|
|
125
|
+
<span class="col-span-1">{{ entity.mime_type }}</span>
|
|
126
|
+
</li>
|
|
127
|
+
</ul>
|
|
128
|
+
</template>
|
|
129
|
+
</Dialog>
|
|
130
|
+
</template>
|
|
131
|
+
|
|
132
|
+
<script setup>
|
|
133
|
+
import {
|
|
134
|
+
Dialog,
|
|
135
|
+
Button,
|
|
136
|
+
LoadingIndicator,
|
|
137
|
+
createResource,
|
|
138
|
+
} from '../../../src'
|
|
139
|
+
import TagInput from './TagInput/TagInput.vue'
|
|
140
|
+
import { ref, inject } from 'vue'
|
|
141
|
+
import { onKeyDown } from '@vueuse/core'
|
|
142
|
+
import { formatDate } from '../js/utils'
|
|
143
|
+
|
|
144
|
+
import LucideBuilding2 from '~icons/lucide/building-2'
|
|
145
|
+
import LucideLock from '~icons/lucide/lock'
|
|
146
|
+
import LucideGlobe2 from '~icons/lucide/globe-2'
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
const dialogType = defineModel()
|
|
150
|
+
const open = ref(true)
|
|
151
|
+
|
|
152
|
+
const editor = inject('editor')
|
|
153
|
+
const props = defineProps({
|
|
154
|
+
entity: Object,
|
|
155
|
+
emitter: Object,
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
// Refactor to share with ShareDialog
|
|
159
|
+
const getGeneralAccess = createResource({
|
|
160
|
+
url: 'drive.api.permissions.get_user_access',
|
|
161
|
+
makeParams: (params) => ({
|
|
162
|
+
...params,
|
|
163
|
+
entity: props.entity.name,
|
|
164
|
+
}),
|
|
165
|
+
transform: (data) => {
|
|
166
|
+
if (!data || !data.read) {
|
|
167
|
+
if (getGeneralAccess.params.user === 'Guest')
|
|
168
|
+
getGeneralAccess.fetch({ team: 1 })
|
|
169
|
+
else
|
|
170
|
+
return {
|
|
171
|
+
type: 'restricted',
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return { ...data, type: getGeneralAccess.params.team ? 'team' : 'public' }
|
|
175
|
+
},
|
|
176
|
+
})
|
|
177
|
+
getGeneralAccess.fetch({ user: 'Guest' })
|
|
178
|
+
|
|
179
|
+
const userAccess = createResource({
|
|
180
|
+
url: 'drive.api.permissions.get_shared_with_list',
|
|
181
|
+
params: { entity: props.entity.name },
|
|
182
|
+
auto: true,
|
|
183
|
+
})
|
|
184
|
+
|
|
185
|
+
const developer = ref(false)
|
|
186
|
+
onKeyDown('D', () => {
|
|
187
|
+
developer.value = !developer.value
|
|
188
|
+
})
|
|
189
|
+
|
|
190
|
+
const accessConfig = {
|
|
191
|
+
team: {
|
|
192
|
+
icon: LucideBuilding2,
|
|
193
|
+
color: 'bg-surface-blue-2 text-ink-blue-2',
|
|
194
|
+
label: 'Team',
|
|
195
|
+
},
|
|
196
|
+
public: {
|
|
197
|
+
icon: LucideGlobe2,
|
|
198
|
+
color: 'bg-surface-red-2 text-ink-red-3',
|
|
199
|
+
label: 'Public',
|
|
200
|
+
},
|
|
201
|
+
restricted: {
|
|
202
|
+
icon: LucideLock,
|
|
203
|
+
color: 'text-ink-gray-7 bg-surface-gray-4',
|
|
204
|
+
label: 'Restricted',
|
|
205
|
+
},
|
|
206
|
+
}
|
|
207
|
+
</script>
|