@speckle/ui-components 2.17.2 → 2.17.4
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/AvatarEditor-e223a145.cjs +2 -0
- package/dist/AvatarEditor-e223a145.cjs.map +1 -0
- package/dist/{AvatarEditor-8531c565.js → AvatarEditor-fda5ba41.js} +52 -52
- package/dist/AvatarEditor-fda5ba41.js.map +1 -0
- package/dist/components/InfiniteLoading.vue.d.ts +42 -29
- package/dist/components/SourceAppBadge.vue.d.ts +14 -11
- package/dist/components/common/Alert.vue.d.ts +48 -49
- package/dist/components/common/Badge.vue.d.ts +64 -47
- package/dist/components/common/loading/Bar.vue.d.ts +13 -10
- package/dist/components/common/loading/Icon.vue.d.ts +30 -19
- package/dist/components/common/steps/Bullet.vue.d.ts +31 -56
- package/dist/components/common/steps/Number.vue.d.ts +29 -50
- package/dist/components/common/text/Link.vue.d.ts +9 -9
- package/dist/components/form/Button.vue.d.ts +12 -11
- package/dist/components/form/CardButton.vue.d.ts +17 -16
- package/dist/components/form/Checkbox.vue.d.ts +3 -3
- package/dist/components/form/ClipboardInput.vue.d.ts +28 -26
- package/dist/components/form/Tags.vue.d.ts +69 -126
- package/dist/components/form/TextArea.vue.d.ts +71 -119
- package/dist/components/form/TextInput.vue.d.ts +7 -6
- package/dist/components/form/file-upload/Zone.vue.d.ts +60 -37
- package/dist/components/form/select/Badges.vue.d.ts +30 -60
- package/dist/components/form/select/Base.vue.d.ts +31 -244
- package/dist/components/form/select/SourceApps.vue.d.ts +4 -4
- package/dist/components/global/ToastRenderer.vue.d.ts +17 -14
- package/dist/components/layout/Dialog.vue.d.ts +51 -60
- package/dist/components/layout/DialogSection.vue.d.ts +3 -3
- package/dist/components/layout/Disclosure.vue.d.ts +37 -26
- package/dist/components/layout/GridListToggle.vue.d.ts +15 -10
- package/dist/components/layout/Menu.vue.d.ts +24 -19
- package/dist/components/layout/Table.vue.d.ts +8 -16
- package/dist/components/layout/Tabs.vue.d.ts +15 -12
- package/dist/components/user/Avatar.vue.d.ts +42 -46
- package/dist/components/user/AvatarEditable.vue.d.ts +2 -2
- package/dist/components/user/AvatarEditor.vue.d.ts +21 -26
- package/dist/components/user/AvatarGroup.vue.d.ts +39 -38
- package/dist/composables/common/async.d.ts +3 -3
- package/dist/composables/common/steps.d.ts +2 -2
- package/dist/composables/common/window.d.ts +2 -2
- package/dist/composables/form/fileUpload.d.ts +3 -3
- package/dist/composables/form/input.d.ts +1 -1
- package/dist/composables/form/select.d.ts +2 -2
- package/dist/composables/form/textInput.d.ts +3 -3
- package/dist/composables/layout/resize.d.ts +2 -2
- package/dist/composables/user/avatar.d.ts +1 -1
- package/dist/helpers/common/components.d.ts +2 -2
- package/dist/helpers/common/validation.d.ts +1 -1
- package/dist/helpers/form/file.d.ts +1 -1
- package/dist/lib.cjs +1 -1
- package/dist/lib.cjs.map +1 -1
- package/dist/lib.d.ts +12 -8
- package/dist/lib.js +1715 -1721
- package/dist/lib.js.map +1 -1
- package/dist/stories/composables/toast.d.ts +1 -1
- package/dist/style.css +1 -1
- package/package.json +9 -9
- package/tsconfig.json +1 -0
- package/dist/AvatarEditor-0cf61750.cjs +0 -2
- package/dist/AvatarEditor-0cf61750.cjs.map +0 -1
- package/dist/AvatarEditor-8531c565.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("@heroicons/vue/24/outline"),q=require("vue-advanced-cropper");require("vue-advanced-cropper/dist/style.css");const i=require("./lib.cjs"),c=require("vue-tippy");require("lodash");require("@heroicons/vue/24/solid");require("@heroicons/vue/20/solid");require("vee-validate");require("nanoid");require("@speckle/shared");require("@vueuse/core");require("@headlessui/vue");require("v3-infinite-loading");const R={class:"flex flex-col space-y-2"},B={class:"flex"},_={class:"flex mx-14 space-x-2"},F=e.createElementVNode("div",{class:"grow"},null,-1),D=e.defineComponent({__name:"AvatarEditor",props:{user:null,disabled:{type:Boolean},size:null},emits:["cancel","save"],setup(u,{emit:m}){const h=m,d=u,o=e.ref(null),f=e.ref(null),a=e.ref(null),r=e.ref(null),s=e.computed(()=>{switch(d.size){case"xs":return{width:64,height:64};case"xxl":return{width:140,height:140};case"editable":return{width:240,height:240};case"base":default:return{width:32,height:32}}}),p=t=>{r.value&&URL.revokeObjectURL(r.value),r.value=t},x=t=>{const l=t.files[0];l&&(a.value=l)},g=t=>{var l;return t?"border-primary":(l=a.value)!=null&&l.error?"border-danger":"border-outline-2"},C=()=>{var t;return(t=o.value)==null?void 0:t.rotate(-90)},w=()=>{var t;return(t=o.value)==null?void 0:t.rotate(90)},k=()=>{var t;return(t=o.value)==null?void 0:t.flip(1,0)},y=()=>{var t;return(t=o.value)==null?void 0:t.flip(0,1)},N=()=>{var t;return(t=f.value)==null?void 0:t.triggerPicker()},V=()=>{a.value=null,r.value=null},b=()=>{var l;const t=((l=o.value)==null?void 0:l.getResult().canvas.toDataURL("image/jpeg",.85))||null;h("save",t)};return e.onUnmounted(()=>{p(null)}),e.watch(()=>d.user.avatar,t=>{r.value=t||null},{immediate:!0}),e.watch(a,t=>{r.value=t!=null&&t.file&&!t.error?URL.createObjectURL(t.file):null},{deep:!0}),(t,l)=>(e.openBlock(),e.createElementBlock("div",R,[e.createElementVNode("div",B,[e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col px-2 space-y-1",{invisible:!r.value}])},[e.withDirectives(e.createVNode(i.FormButton,{"icon-left":e.unref(n.ArrowUturnLeftIcon),"hide-text":"",size:"sm",outlined:"",onClick:C},null,8,["icon-left"]),[[e.unref(c.directive),"Rotate left"]]),e.withDirectives(e.createVNode(i.FormButton,{"icon-left":e.unref(n.ArrowUturnRightIcon),"hide-text":"",size:"sm",outlined:"",onClick:w},null,8,["icon-left"]),[[e.unref(c.directive),"Rotate right"]]),e.withDirectives(e.createVNode(i.FormButton,{"icon-left":e.unref(n.ArrowUpOnSquareIcon),"hide-text":"",size:"sm",outlined:"",onClick:y},null,8,["icon-left"]),[[e.unref(c.directive),"Flip vertically"]]),e.withDirectives(e.createVNode(i.FormButton,{"icon-left":e.unref(n.ArrowLeftOnRectangleIcon),"hide-text":"",size:"sm",outlined:"",onClick:k},null,8,["icon-left"]),[[e.unref(c.directive),"Flip horizontally"]])],2),r.value?(e.openBlock(),e.createBlock(e.unref(q.Cropper),{key:0,ref_key:"cropper",ref:o,class:"cropper",src:r.value,"stencil-props":{aspectRatio:1/1},canvas:s.value,style:e.normalizeStyle(`width: ${s.value.width}px; height: ${s.value.height}px`)},null,8,["src","canvas","style"])):e.createCommentVNode("",!0),e.createVNode(i.FormFileUploadZone,{ref_key:"uploadZone",ref:f,class:e.normalizeClass(["cropper flex items-center justify-center",{hidden:r.value}]),accept:"image/*","size-limit":5*1024*1024,onFilesSelected:x},{default:e.withCtx(({isDraggingFiles:v,activatorOn:z})=>[e.createElementVNode("div",e.mergeProps({class:["cursor-pointer text-center w-full h-full border-dashed border-2 rounded-md p-4 flex items-center justify-center text-sm text-foreground-2",[g(v)]]},e.toHandlers(z,!0))," Click here or drag and drop an image ",16)]),_:1},8,["class"]),e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col px-2 space-y-1",{invisible:!r.value}])},[e.withDirectives(e.createVNode(i.FormButton,{"icon-left":e.unref(n.PhotoIcon),"hide-text":"",size:"sm",onClick:N},null,8,["icon-left"]),[[e.unref(c.directive),"Replace image"]]),e.withDirectives(e.createVNode(i.FormButton,{"icon-left":e.unref(n.XMarkIcon),"hide-text":"",size:"sm",color:"danger",onClick:V},null,8,["icon-left"]),[[e.unref(c.directive),"Remove"]])],2)]),e.createElementVNode("div",_,[F,e.createVNode(i.FormButton,{color:"secondary",size:"sm",onClick:l[0]||(l[0]=v=>t.$emit("cancel"))},{default:e.withCtx(()=>[e.createTextVNode(" Close ")]),_:1}),e.createVNode(i.FormButton,{size:"sm",disabled:u.disabled,onClick:b},{default:e.withCtx(()=>[e.createTextVNode("Save")]),_:1},8,["disabled"])])]))}});exports.default=D;
|
|
2
|
+
//# sourceMappingURL=AvatarEditor-e223a145.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AvatarEditor-e223a145.cjs","sources":["../src/components/user/AvatarEditor.vue"],"sourcesContent":["<template>\n <div class=\"flex flex-col space-y-2\">\n <div class=\"flex\">\n <div class=\"flex flex-col px-2 space-y-1\" :class=\"{ invisible: !activeImageUrl }\">\n <FormButton\n v-tippy=\"'Rotate left'\"\n :icon-left=\"ArrowUturnLeftIcon\"\n hide-text\n size=\"sm\"\n outlined\n @click=\"rotateLeft\"\n />\n <FormButton\n v-tippy=\"'Rotate right'\"\n :icon-left=\"ArrowUturnRightIcon\"\n hide-text\n size=\"sm\"\n outlined\n @click=\"rotateRight\"\n />\n <FormButton\n v-tippy=\"'Flip vertically'\"\n :icon-left=\"ArrowUpOnSquareIcon\"\n hide-text\n size=\"sm\"\n outlined\n @click=\"flipVertical\"\n />\n <FormButton\n v-tippy=\"'Flip horizontally'\"\n :icon-left=\"ArrowLeftOnRectangleIcon\"\n hide-text\n size=\"sm\"\n outlined\n @click=\"flipHorizontal\"\n />\n </div>\n <Cropper\n v-if=\"activeImageUrl\"\n ref=\"cropper\"\n class=\"cropper\"\n :src=\"activeImageUrl\"\n :stencil-props=\"{\n aspectRatio: 1 / 1\n }\"\n :canvas=\"canvasSize\"\n :style=\"`width: ${canvasSize.width}px; height: ${canvasSize.height}px`\"\n />\n <FormFileUploadZone\n ref=\"uploadZone\"\n v-slot=\"{ isDraggingFiles, activatorOn }\"\n class=\"cropper flex items-center justify-center\"\n :class=\"{ hidden: activeImageUrl }\"\n accept=\"image/*\"\n :size-limit=\"5 * 1024 * 1024\"\n @files-selected=\"onFilesSelected\"\n >\n <div\n class=\"cursor-pointer text-center w-full h-full border-dashed border-2 rounded-md p-4 flex items-center justify-center text-sm text-foreground-2\"\n :class=\"[getDashedBorderClasses(isDraggingFiles)]\"\n v-on=\"activatorOn\"\n >\n Click here or drag and drop an image\n </div>\n </FormFileUploadZone>\n <div class=\"flex flex-col px-2 space-y-1\" :class=\"{ invisible: !activeImageUrl }\">\n <FormButton\n v-tippy=\"'Replace image'\"\n :icon-left=\"PhotoIcon\"\n hide-text\n size=\"sm\"\n @click=\"onReplace\"\n />\n <FormButton\n v-tippy=\"'Remove'\"\n :icon-left=\"XMarkIcon\"\n hide-text\n size=\"sm\"\n color=\"danger\"\n @click=\"onRemove\"\n />\n </div>\n </div>\n <div class=\"flex mx-14 space-x-2\">\n <div class=\"grow\" />\n <FormButton color=\"secondary\" size=\"sm\" @click=\"$emit('cancel')\">\n Close\n </FormButton>\n <FormButton size=\"sm\" :disabled=\"disabled\" @click=\"onSave\">Save</FormButton>\n </div>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport {\n ArrowUturnLeftIcon,\n ArrowUturnRightIcon,\n ArrowLeftOnRectangleIcon,\n ArrowUpOnSquareIcon,\n XMarkIcon,\n PhotoIcon\n} from '@heroicons/vue/24/outline'\nimport type { Nullable } from '@speckle/shared'\nimport { onUnmounted, ref, watch, computed } from 'vue'\nimport { Cropper } from 'vue-advanced-cropper'\nimport 'vue-advanced-cropper/dist/style.css'\nimport FormButton from '~~/src/components/form/Button.vue'\nimport FormFileUploadZone from '~~/src/components/form/file-upload/Zone.vue'\nimport type { UploadableFileItem } from '~~/src/composables/form/fileUpload'\nimport type { AvatarUser, UserAvatarSize } from '~~/src/composables/user/avatar'\nimport { directive as vTippy } from 'vue-tippy'\n\n/**\n * Always try to lazy load this, as it's quite heavy\n */\n\nconst emit = defineEmits([\"cancel\", \"save\"])\n\nconst props = defineProps({\n user: null,\n disabled: { type: Boolean },\n size: null\n})\n\nconst cropper = ref(\n null as Nullable<{\n flip: (x: number, y: number) => void\n rotate: (angle: number) => void\n getResult: () => { canvas: HTMLCanvasElement }\n }>\n)\nconst uploadZone = ref(null as Nullable<{ triggerPicker: () => void }>)\nconst selectedUpload = ref(null as Nullable<UploadableFileItem>)\nconst activeImageUrl = ref(null as Nullable<string>)\n\nconst canvasSize = computed(() => {\n switch (props.size) {\n case 'xs' || 'sm' || 'lg' || 'xl':\n return { width: 64, height: 64 }\n case 'xxl':\n return { width: 140, height: 140 }\n case 'editable':\n return { width: 240, height: 240 }\n case 'base':\n default:\n return { width: 32, height: 32 }\n }\n})\n\nconst setNewActiveUrl = (url: Nullable<string>) => {\n if (activeImageUrl.value) {\n URL.revokeObjectURL(activeImageUrl.value)\n }\n\n activeImageUrl.value = url\n}\n\nconst onFilesSelected = (params: { files: UploadableFileItem[] }) => {\n const file = params.files[0]\n if (!file) return\n selectedUpload.value = file\n}\n\nconst getDashedBorderClasses = (isDraggingFiles: boolean) => {\n if (isDraggingFiles) return 'border-primary'\n if (selectedUpload.value?.error) return 'border-danger'\n\n return 'border-outline-2'\n}\n\nconst rotateLeft = () => cropper.value?.rotate(-90)\nconst rotateRight = () => cropper.value?.rotate(90)\nconst flipHorizontal = () => cropper.value?.flip(1, 0)\nconst flipVertical = () => cropper.value?.flip(0, 1)\n\nconst onReplace = () => uploadZone.value?.triggerPicker()\nconst onRemove = () => {\n selectedUpload.value = null\n activeImageUrl.value = null\n}\nconst onSave = () => {\n const newUrl = cropper.value?.getResult().canvas.toDataURL('image/jpeg', 0.85) || null\n emit('save', newUrl)\n}\n\nonUnmounted(() => {\n setNewActiveUrl(null)\n})\n\nwatch(\n () => props.user.avatar,\n (newAvatar) => {\n activeImageUrl.value = newAvatar || null\n },\n { immediate: true }\n)\n\nwatch(\n selectedUpload,\n (newUpload) => {\n activeImageUrl.value =\n newUpload?.file && !newUpload.error ? URL.createObjectURL(newUpload.file) : null\n },\n { deep: true }\n)\n</script>\n"],"names":["emit","__emit","props","__props","cropper","ref","uploadZone","selectedUpload","activeImageUrl","canvasSize","computed","setNewActiveUrl","url","onFilesSelected","params","file","getDashedBorderClasses","isDraggingFiles","_a","rotateLeft","rotateRight","flipHorizontal","flipVertical","onReplace","onRemove","onSave","newUrl","onUnmounted","watch","newAvatar","newUpload"],"mappings":"4xBAmHA,MAAMA,EAAOC,EAEPC,EAAQC,EAMRC,EAAUC,EAAA,IACd,IAAA,EAMIC,EAAaD,MAAI,IAA+C,EAChEE,EAAiBF,MAAI,IAAoC,EACzDG,EAAiBH,MAAI,IAAwB,EAE7CI,EAAaC,EAAAA,SAAS,IAAM,CAChC,OAAQR,EAAM,KAAM,CAClB,IAAK,KACH,MAAO,CAAE,MAAO,GAAI,OAAQ,EAAG,EACjC,IAAK,MACH,MAAO,CAAE,MAAO,IAAK,OAAQ,GAAI,EACnC,IAAK,WACH,MAAO,CAAE,MAAO,IAAK,OAAQ,GAAI,EACnC,IAAK,OACL,QACE,MAAO,CAAE,MAAO,GAAI,OAAQ,EAAG,CACnC,CAAA,CACD,EAEKS,EAAmBC,GAA0B,CAC7CJ,EAAe,OACb,IAAA,gBAAgBA,EAAe,KAAK,EAG1CA,EAAe,MAAQI,CAAA,EAGnBC,EAAmBC,GAA4C,CAC7D,MAAAC,EAAOD,EAAO,MAAM,CAAC,EACtBC,IACLR,EAAe,MAAQQ,EAAA,EAGnBC,EAA0BC,GAA6B,OACvD,OAAAA,EAAwB,kBACxBC,EAAAX,EAAe,QAAf,MAAAW,EAAsB,MAAc,gBAEjC,kBAAA,EAGHC,EAAa,IAAA,OAAM,OAAAD,EAAAd,EAAQ,QAAR,YAAAc,EAAe,OAAO,MACzCE,EAAc,IAAA,OAAM,OAAAF,EAAAd,EAAQ,QAAR,YAAAc,EAAe,OAAO,KAC1CG,EAAiB,IAAA,OAAM,OAAAH,EAAAd,EAAQ,QAAR,YAAAc,EAAe,KAAK,EAAG,IAC9CI,EAAe,IAAA,OAAM,OAAAJ,EAAAd,EAAQ,QAAR,YAAAc,EAAe,KAAK,EAAG,IAE5CK,EAAY,IAAM,OAAA,OAAAL,EAAAZ,EAAW,QAAX,YAAAY,EAAkB,iBACpCM,EAAW,IAAM,CACrBjB,EAAe,MAAQ,KACvBC,EAAe,MAAQ,IAAA,EAEnBiB,EAAS,IAAM,OACb,MAAAC,IAASR,EAAAd,EAAQ,QAAR,YAAAc,EAAe,YAAY,OAAO,UAAU,aAAc,OAAS,KAClFlB,EAAK,OAAQ0B,CAAM,CAAA,EAGrBC,OAAAA,EAAAA,YAAY,IAAM,CAChBhB,EAAgB,IAAI,CAAA,CACrB,EAEDiB,EAAA,MACE,IAAM1B,EAAM,KAAK,OAChB2B,GAAc,CACbrB,EAAe,MAAQqB,GAAa,IACtC,EACA,CAAE,UAAW,EAAK,CAAA,EAGpBD,EAAA,MACErB,EACCuB,GAAc,CACEtB,EAAA,MACbsB,GAAA,MAAAA,EAAW,MAAQ,CAACA,EAAU,MAAQ,IAAI,gBAAgBA,EAAU,IAAI,EAAI,IAChF,EACA,CAAE,KAAM,EAAK,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ArrowUturnLeftIcon as
|
|
3
|
-
import { Cropper as
|
|
1
|
+
import { defineComponent as N, ref as d, computed as V, onUnmounted as $, watch as k, openBlock as y, createElementBlock as O, createElementVNode as a, normalizeClass as f, withDirectives as s, createVNode as r, unref as t, createBlock as D, normalizeStyle as E, createCommentVNode as P, withCtx as p, mergeProps as Z, toHandlers as H, createTextVNode as z } from "vue";
|
|
2
|
+
import { ArrowUturnLeftIcon as q, ArrowUturnRightIcon as M, ArrowUpOnSquareIcon as T, ArrowLeftOnRectangleIcon as X, PhotoIcon as G, XMarkIcon as J } from "@heroicons/vue/24/outline";
|
|
3
|
+
import { Cropper as K } from "vue-advanced-cropper";
|
|
4
4
|
import "vue-advanced-cropper/dist/style.css";
|
|
5
|
-
import { FormButton as i, FormFileUploadZone as
|
|
5
|
+
import { FormButton as i, FormFileUploadZone as Q } from "./lib.js";
|
|
6
6
|
import { directive as c } from "vue-tippy";
|
|
7
7
|
import "lodash";
|
|
8
8
|
import "@heroicons/vue/24/solid";
|
|
@@ -13,7 +13,7 @@ import "@speckle/shared";
|
|
|
13
13
|
import "@vueuse/core";
|
|
14
14
|
import "@headlessui/vue";
|
|
15
15
|
import "v3-infinite-loading";
|
|
16
|
-
const
|
|
16
|
+
const W = { class: "flex flex-col space-y-2" }, Y = { class: "flex" }, ee = { class: "flex mx-14 space-x-2" }, te = /* @__PURE__ */ a("div", { class: "grow" }, null, -1), xe = /* @__PURE__ */ N({
|
|
17
17
|
__name: "AvatarEditor",
|
|
18
18
|
props: {
|
|
19
19
|
user: null,
|
|
@@ -22,9 +22,9 @@ const Q = { class: "flex flex-col space-y-2" }, W = { class: "flex" }, Y = { cla
|
|
|
22
22
|
},
|
|
23
23
|
emits: ["cancel", "save"],
|
|
24
24
|
setup(v, { emit: C }) {
|
|
25
|
-
const h = v, n = d(
|
|
25
|
+
const R = C, h = v, n = d(
|
|
26
26
|
null
|
|
27
|
-
), x = d(null), u = d(null), l = d(null),
|
|
27
|
+
), x = d(null), u = d(null), l = d(null), m = V(() => {
|
|
28
28
|
switch (h.size) {
|
|
29
29
|
case "xs":
|
|
30
30
|
return { width: 64, height: 64 };
|
|
@@ -36,38 +36,38 @@ const Q = { class: "flex flex-col space-y-2" }, W = { class: "flex" }, Y = { cla
|
|
|
36
36
|
default:
|
|
37
37
|
return { width: 32, height: 32 };
|
|
38
38
|
}
|
|
39
|
-
}),
|
|
39
|
+
}), _ = (e) => {
|
|
40
40
|
l.value && URL.revokeObjectURL(l.value), l.value = e;
|
|
41
|
-
},
|
|
41
|
+
}, b = (e) => {
|
|
42
42
|
const o = e.files[0];
|
|
43
43
|
o && (u.value = o);
|
|
44
|
-
},
|
|
44
|
+
}, w = (e) => {
|
|
45
45
|
var o;
|
|
46
46
|
return e ? "border-primary" : (o = u.value) != null && o.error ? "border-danger" : "border-outline-2";
|
|
47
|
-
},
|
|
47
|
+
}, L = () => {
|
|
48
48
|
var e;
|
|
49
49
|
return (e = n.value) == null ? void 0 : e.rotate(-90);
|
|
50
|
-
},
|
|
50
|
+
}, U = () => {
|
|
51
51
|
var e;
|
|
52
52
|
return (e = n.value) == null ? void 0 : e.rotate(90);
|
|
53
|
-
},
|
|
53
|
+
}, I = () => {
|
|
54
54
|
var e;
|
|
55
55
|
return (e = n.value) == null ? void 0 : e.flip(1, 0);
|
|
56
|
-
},
|
|
56
|
+
}, A = () => {
|
|
57
57
|
var e;
|
|
58
58
|
return (e = n.value) == null ? void 0 : e.flip(0, 1);
|
|
59
|
-
},
|
|
59
|
+
}, B = () => {
|
|
60
60
|
var e;
|
|
61
61
|
return (e = x.value) == null ? void 0 : e.triggerPicker();
|
|
62
|
-
}, B = () => {
|
|
63
|
-
u.value = null, l.value = null;
|
|
64
62
|
}, F = () => {
|
|
63
|
+
u.value = null, l.value = null;
|
|
64
|
+
}, S = () => {
|
|
65
65
|
var o;
|
|
66
66
|
const e = ((o = n.value) == null ? void 0 : o.getResult().canvas.toDataURL("image/jpeg", 0.85)) || null;
|
|
67
|
-
|
|
67
|
+
R("save", e);
|
|
68
68
|
};
|
|
69
|
-
return
|
|
70
|
-
|
|
69
|
+
return $(() => {
|
|
70
|
+
_(null);
|
|
71
71
|
}), k(
|
|
72
72
|
() => h.user.avatar,
|
|
73
73
|
(e) => {
|
|
@@ -80,49 +80,49 @@ const Q = { class: "flex flex-col space-y-2" }, W = { class: "flex" }, Y = { cla
|
|
|
80
80
|
l.value = e != null && e.file && !e.error ? URL.createObjectURL(e.file) : null;
|
|
81
81
|
},
|
|
82
82
|
{ deep: !0 }
|
|
83
|
-
), (e, o) => (y(),
|
|
84
|
-
a("div",
|
|
83
|
+
), (e, o) => (y(), O("div", W, [
|
|
84
|
+
a("div", Y, [
|
|
85
85
|
a("div", {
|
|
86
|
-
class:
|
|
86
|
+
class: f(["flex flex-col px-2 space-y-1", { invisible: !l.value }])
|
|
87
87
|
}, [
|
|
88
88
|
s(r(i, {
|
|
89
|
-
"icon-left": t(
|
|
89
|
+
"icon-left": t(q),
|
|
90
90
|
"hide-text": "",
|
|
91
91
|
size: "sm",
|
|
92
92
|
outlined: "",
|
|
93
|
-
onClick:
|
|
93
|
+
onClick: L
|
|
94
94
|
}, null, 8, ["icon-left"]), [
|
|
95
95
|
[t(c), "Rotate left"]
|
|
96
96
|
]),
|
|
97
97
|
s(r(i, {
|
|
98
|
-
"icon-left": t(
|
|
98
|
+
"icon-left": t(M),
|
|
99
99
|
"hide-text": "",
|
|
100
100
|
size: "sm",
|
|
101
101
|
outlined: "",
|
|
102
|
-
onClick:
|
|
102
|
+
onClick: U
|
|
103
103
|
}, null, 8, ["icon-left"]), [
|
|
104
104
|
[t(c), "Rotate right"]
|
|
105
105
|
]),
|
|
106
106
|
s(r(i, {
|
|
107
|
-
"icon-left": t(
|
|
107
|
+
"icon-left": t(T),
|
|
108
108
|
"hide-text": "",
|
|
109
109
|
size: "sm",
|
|
110
110
|
outlined: "",
|
|
111
|
-
onClick:
|
|
111
|
+
onClick: A
|
|
112
112
|
}, null, 8, ["icon-left"]), [
|
|
113
113
|
[t(c), "Flip vertically"]
|
|
114
114
|
]),
|
|
115
115
|
s(r(i, {
|
|
116
|
-
"icon-left": t(
|
|
116
|
+
"icon-left": t(X),
|
|
117
117
|
"hide-text": "",
|
|
118
118
|
size: "sm",
|
|
119
119
|
outlined: "",
|
|
120
|
-
onClick:
|
|
120
|
+
onClick: I
|
|
121
121
|
}, null, 8, ["icon-left"]), [
|
|
122
122
|
[t(c), "Flip horizontally"]
|
|
123
123
|
])
|
|
124
124
|
], 2),
|
|
125
|
-
l.value ? (y(),
|
|
125
|
+
l.value ? (y(), D(t(K), {
|
|
126
126
|
key: 0,
|
|
127
127
|
ref_key: "cropper",
|
|
128
128
|
ref: n,
|
|
@@ -131,48 +131,48 @@ const Q = { class: "flex flex-col space-y-2" }, W = { class: "flex" }, Y = { cla
|
|
|
131
131
|
"stencil-props": {
|
|
132
132
|
aspectRatio: 1 / 1
|
|
133
133
|
},
|
|
134
|
-
canvas:
|
|
135
|
-
style:
|
|
136
|
-
}, null, 8, ["src", "canvas", "style"])) :
|
|
137
|
-
r(
|
|
134
|
+
canvas: m.value,
|
|
135
|
+
style: E(`width: ${m.value.width}px; height: ${m.value.height}px`)
|
|
136
|
+
}, null, 8, ["src", "canvas", "style"])) : P("", !0),
|
|
137
|
+
r(Q, {
|
|
138
138
|
ref_key: "uploadZone",
|
|
139
139
|
ref: x,
|
|
140
|
-
class:
|
|
140
|
+
class: f(["cropper flex items-center justify-center", { hidden: l.value }]),
|
|
141
141
|
accept: "image/*",
|
|
142
142
|
"size-limit": 5 * 1024 * 1024,
|
|
143
|
-
onFilesSelected:
|
|
143
|
+
onFilesSelected: b
|
|
144
144
|
}, {
|
|
145
|
-
default: p(({ isDraggingFiles: g, activatorOn:
|
|
146
|
-
a("div",
|
|
147
|
-
class: ["cursor-pointer text-center w-full h-full border-dashed border-2 rounded-md p-4 flex items-center justify-center text-sm text-foreground-2", [
|
|
148
|
-
},
|
|
145
|
+
default: p(({ isDraggingFiles: g, activatorOn: j }) => [
|
|
146
|
+
a("div", Z({
|
|
147
|
+
class: ["cursor-pointer text-center w-full h-full border-dashed border-2 rounded-md p-4 flex items-center justify-center text-sm text-foreground-2", [w(g)]]
|
|
148
|
+
}, H(j, !0)), " Click here or drag and drop an image ", 16)
|
|
149
149
|
]),
|
|
150
150
|
_: 1
|
|
151
151
|
}, 8, ["class"]),
|
|
152
152
|
a("div", {
|
|
153
|
-
class:
|
|
153
|
+
class: f(["flex flex-col px-2 space-y-1", { invisible: !l.value }])
|
|
154
154
|
}, [
|
|
155
155
|
s(r(i, {
|
|
156
|
-
"icon-left": t(
|
|
156
|
+
"icon-left": t(G),
|
|
157
157
|
"hide-text": "",
|
|
158
158
|
size: "sm",
|
|
159
|
-
onClick:
|
|
159
|
+
onClick: B
|
|
160
160
|
}, null, 8, ["icon-left"]), [
|
|
161
161
|
[t(c), "Replace image"]
|
|
162
162
|
]),
|
|
163
163
|
s(r(i, {
|
|
164
|
-
"icon-left": t(
|
|
164
|
+
"icon-left": t(J),
|
|
165
165
|
"hide-text": "",
|
|
166
166
|
size: "sm",
|
|
167
167
|
color: "danger",
|
|
168
|
-
onClick:
|
|
168
|
+
onClick: F
|
|
169
169
|
}, null, 8, ["icon-left"]), [
|
|
170
170
|
[t(c), "Remove"]
|
|
171
171
|
])
|
|
172
172
|
], 2)
|
|
173
173
|
]),
|
|
174
|
-
a("div",
|
|
175
|
-
|
|
174
|
+
a("div", ee, [
|
|
175
|
+
te,
|
|
176
176
|
r(i, {
|
|
177
177
|
color: "secondary",
|
|
178
178
|
size: "sm",
|
|
@@ -186,7 +186,7 @@ const Q = { class: "flex flex-col space-y-2" }, W = { class: "flex" }, Y = { cla
|
|
|
186
186
|
r(i, {
|
|
187
187
|
size: "sm",
|
|
188
188
|
disabled: v.disabled,
|
|
189
|
-
onClick:
|
|
189
|
+
onClick: S
|
|
190
190
|
}, {
|
|
191
191
|
default: p(() => [
|
|
192
192
|
z("Save")
|
|
@@ -198,6 +198,6 @@ const Q = { class: "flex flex-col space-y-2" }, W = { class: "flex" }, Y = { cla
|
|
|
198
198
|
}
|
|
199
199
|
});
|
|
200
200
|
export {
|
|
201
|
-
|
|
201
|
+
xe as default
|
|
202
202
|
};
|
|
203
|
-
//# sourceMappingURL=AvatarEditor-
|
|
203
|
+
//# sourceMappingURL=AvatarEditor-fda5ba41.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AvatarEditor-fda5ba41.js","sources":["../src/components/user/AvatarEditor.vue"],"sourcesContent":["<template>\n <div class=\"flex flex-col space-y-2\">\n <div class=\"flex\">\n <div class=\"flex flex-col px-2 space-y-1\" :class=\"{ invisible: !activeImageUrl }\">\n <FormButton\n v-tippy=\"'Rotate left'\"\n :icon-left=\"ArrowUturnLeftIcon\"\n hide-text\n size=\"sm\"\n outlined\n @click=\"rotateLeft\"\n />\n <FormButton\n v-tippy=\"'Rotate right'\"\n :icon-left=\"ArrowUturnRightIcon\"\n hide-text\n size=\"sm\"\n outlined\n @click=\"rotateRight\"\n />\n <FormButton\n v-tippy=\"'Flip vertically'\"\n :icon-left=\"ArrowUpOnSquareIcon\"\n hide-text\n size=\"sm\"\n outlined\n @click=\"flipVertical\"\n />\n <FormButton\n v-tippy=\"'Flip horizontally'\"\n :icon-left=\"ArrowLeftOnRectangleIcon\"\n hide-text\n size=\"sm\"\n outlined\n @click=\"flipHorizontal\"\n />\n </div>\n <Cropper\n v-if=\"activeImageUrl\"\n ref=\"cropper\"\n class=\"cropper\"\n :src=\"activeImageUrl\"\n :stencil-props=\"{\n aspectRatio: 1 / 1\n }\"\n :canvas=\"canvasSize\"\n :style=\"`width: ${canvasSize.width}px; height: ${canvasSize.height}px`\"\n />\n <FormFileUploadZone\n ref=\"uploadZone\"\n v-slot=\"{ isDraggingFiles, activatorOn }\"\n class=\"cropper flex items-center justify-center\"\n :class=\"{ hidden: activeImageUrl }\"\n accept=\"image/*\"\n :size-limit=\"5 * 1024 * 1024\"\n @files-selected=\"onFilesSelected\"\n >\n <div\n class=\"cursor-pointer text-center w-full h-full border-dashed border-2 rounded-md p-4 flex items-center justify-center text-sm text-foreground-2\"\n :class=\"[getDashedBorderClasses(isDraggingFiles)]\"\n v-on=\"activatorOn\"\n >\n Click here or drag and drop an image\n </div>\n </FormFileUploadZone>\n <div class=\"flex flex-col px-2 space-y-1\" :class=\"{ invisible: !activeImageUrl }\">\n <FormButton\n v-tippy=\"'Replace image'\"\n :icon-left=\"PhotoIcon\"\n hide-text\n size=\"sm\"\n @click=\"onReplace\"\n />\n <FormButton\n v-tippy=\"'Remove'\"\n :icon-left=\"XMarkIcon\"\n hide-text\n size=\"sm\"\n color=\"danger\"\n @click=\"onRemove\"\n />\n </div>\n </div>\n <div class=\"flex mx-14 space-x-2\">\n <div class=\"grow\" />\n <FormButton color=\"secondary\" size=\"sm\" @click=\"$emit('cancel')\">\n Close\n </FormButton>\n <FormButton size=\"sm\" :disabled=\"disabled\" @click=\"onSave\">Save</FormButton>\n </div>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport {\n ArrowUturnLeftIcon,\n ArrowUturnRightIcon,\n ArrowLeftOnRectangleIcon,\n ArrowUpOnSquareIcon,\n XMarkIcon,\n PhotoIcon\n} from '@heroicons/vue/24/outline'\nimport type { Nullable } from '@speckle/shared'\nimport { onUnmounted, ref, watch, computed } from 'vue'\nimport { Cropper } from 'vue-advanced-cropper'\nimport 'vue-advanced-cropper/dist/style.css'\nimport FormButton from '~~/src/components/form/Button.vue'\nimport FormFileUploadZone from '~~/src/components/form/file-upload/Zone.vue'\nimport type { UploadableFileItem } from '~~/src/composables/form/fileUpload'\nimport type { AvatarUser, UserAvatarSize } from '~~/src/composables/user/avatar'\nimport { directive as vTippy } from 'vue-tippy'\n\n/**\n * Always try to lazy load this, as it's quite heavy\n */\n\nconst emit = defineEmits([\"cancel\", \"save\"])\n\nconst props = defineProps({\n user: null,\n disabled: { type: Boolean },\n size: null\n})\n\nconst cropper = ref(\n null as Nullable<{\n flip: (x: number, y: number) => void\n rotate: (angle: number) => void\n getResult: () => { canvas: HTMLCanvasElement }\n }>\n)\nconst uploadZone = ref(null as Nullable<{ triggerPicker: () => void }>)\nconst selectedUpload = ref(null as Nullable<UploadableFileItem>)\nconst activeImageUrl = ref(null as Nullable<string>)\n\nconst canvasSize = computed(() => {\n switch (props.size) {\n case 'xs' || 'sm' || 'lg' || 'xl':\n return { width: 64, height: 64 }\n case 'xxl':\n return { width: 140, height: 140 }\n case 'editable':\n return { width: 240, height: 240 }\n case 'base':\n default:\n return { width: 32, height: 32 }\n }\n})\n\nconst setNewActiveUrl = (url: Nullable<string>) => {\n if (activeImageUrl.value) {\n URL.revokeObjectURL(activeImageUrl.value)\n }\n\n activeImageUrl.value = url\n}\n\nconst onFilesSelected = (params: { files: UploadableFileItem[] }) => {\n const file = params.files[0]\n if (!file) return\n selectedUpload.value = file\n}\n\nconst getDashedBorderClasses = (isDraggingFiles: boolean) => {\n if (isDraggingFiles) return 'border-primary'\n if (selectedUpload.value?.error) return 'border-danger'\n\n return 'border-outline-2'\n}\n\nconst rotateLeft = () => cropper.value?.rotate(-90)\nconst rotateRight = () => cropper.value?.rotate(90)\nconst flipHorizontal = () => cropper.value?.flip(1, 0)\nconst flipVertical = () => cropper.value?.flip(0, 1)\n\nconst onReplace = () => uploadZone.value?.triggerPicker()\nconst onRemove = () => {\n selectedUpload.value = null\n activeImageUrl.value = null\n}\nconst onSave = () => {\n const newUrl = cropper.value?.getResult().canvas.toDataURL('image/jpeg', 0.85) || null\n emit('save', newUrl)\n}\n\nonUnmounted(() => {\n setNewActiveUrl(null)\n})\n\nwatch(\n () => props.user.avatar,\n (newAvatar) => {\n activeImageUrl.value = newAvatar || null\n },\n { immediate: true }\n)\n\nwatch(\n selectedUpload,\n (newUpload) => {\n activeImageUrl.value =\n newUpload?.file && !newUpload.error ? URL.createObjectURL(newUpload.file) : null\n },\n { deep: true }\n)\n</script>\n"],"names":["emit","__emit","props","__props","cropper","ref","uploadZone","selectedUpload","activeImageUrl","canvasSize","computed","setNewActiveUrl","url","onFilesSelected","params","file","getDashedBorderClasses","isDraggingFiles","_a","rotateLeft","rotateRight","flipHorizontal","flipVertical","onReplace","onRemove","onSave","newUrl","onUnmounted","watch","newAvatar","newUpload"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAmHA,UAAMA,IAAOC,GAEPC,IAAQC,GAMRC,IAAUC;AAAA,MACd;AAAA,IAAA,GAMIC,IAAaD,EAAI,IAA+C,GAChEE,IAAiBF,EAAI,IAAoC,GACzDG,IAAiBH,EAAI,IAAwB,GAE7CI,IAAaC,EAAS,MAAM;AAChC,cAAQR,EAAM,MAAM;AAAA,QAClB,KAAK;AACH,iBAAO,EAAE,OAAO,IAAI,QAAQ,GAAG;AAAA,QACjC,KAAK;AACH,iBAAO,EAAE,OAAO,KAAK,QAAQ,IAAI;AAAA,QACnC,KAAK;AACH,iBAAO,EAAE,OAAO,KAAK,QAAQ,IAAI;AAAA,QACnC,KAAK;AAAA,QACL;AACE,iBAAO,EAAE,OAAO,IAAI,QAAQ,GAAG;AAAA,MACnC;AAAA,IAAA,CACD,GAEKS,IAAkB,CAACC,MAA0B;AACjD,MAAIJ,EAAe,SACb,IAAA,gBAAgBA,EAAe,KAAK,GAG1CA,EAAe,QAAQI;AAAA,IAAA,GAGnBC,IAAkB,CAACC,MAA4C;AAC7D,YAAAC,IAAOD,EAAO,MAAM,CAAC;AAC3B,MAAKC,MACLR,EAAe,QAAQQ;AAAA,IAAA,GAGnBC,IAAyB,CAACC,MAA6B;;AACvD,aAAAA,IAAwB,oBACxBC,IAAAX,EAAe,UAAf,QAAAW,EAAsB,QAAc,kBAEjC;AAAA,IAAA,GAGHC,IAAa,MAAA;;AAAM,cAAAD,IAAAd,EAAQ,UAAR,gBAAAc,EAAe,OAAO;AAAA,OACzCE,IAAc,MAAA;;AAAM,cAAAF,IAAAd,EAAQ,UAAR,gBAAAc,EAAe,OAAO;AAAA,OAC1CG,IAAiB,MAAA;;AAAM,cAAAH,IAAAd,EAAQ,UAAR,gBAAAc,EAAe,KAAK,GAAG;AAAA,OAC9CI,IAAe,MAAA;;AAAM,cAAAJ,IAAAd,EAAQ,UAAR,gBAAAc,EAAe,KAAK,GAAG;AAAA,OAE5CK,IAAY,MAAM;;AAAA,cAAAL,IAAAZ,EAAW,UAAX,gBAAAY,EAAkB;AAAA,OACpCM,IAAW,MAAM;AACrB,MAAAjB,EAAe,QAAQ,MACvBC,EAAe,QAAQ;AAAA,IAAA,GAEnBiB,IAAS,MAAM;;AACb,YAAAC,MAASR,IAAAd,EAAQ,UAAR,gBAAAc,EAAe,YAAY,OAAO,UAAU,cAAc,UAAS;AAClF,MAAAlB,EAAK,QAAQ0B,CAAM;AAAA,IAAA;AAGrB,WAAAC,EAAY,MAAM;AAChB,MAAAhB,EAAgB,IAAI;AAAA,IAAA,CACrB,GAEDiB;AAAA,MACE,MAAM1B,EAAM,KAAK;AAAA,MACjB,CAAC2B,MAAc;AACb,QAAArB,EAAe,QAAQqB,KAAa;AAAA,MACtC;AAAA,MACA,EAAE,WAAW,GAAK;AAAA,IAAA,GAGpBD;AAAA,MACErB;AAAA,MACA,CAACuB,MAAc;AACE,QAAAtB,EAAA,QACbsB,KAAA,QAAAA,EAAW,QAAQ,CAACA,EAAU,QAAQ,IAAI,gBAAgBA,EAAU,IAAI,IAAI;AAAA,MAChF;AAAA,MACA,EAAE,MAAM,GAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,33 +1,46 @@
|
|
|
1
|
-
import { InfiniteLoaderState } from '../helpers/global/components';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import type { InfiniteLoaderState } from '../helpers/global/components';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
/**
|
|
4
|
+
* v3-infinite-loading props, see docs or type definitions
|
|
5
|
+
*/
|
|
6
|
+
settings?: {
|
|
7
|
+
target?: string | undefined;
|
|
8
|
+
distance?: number | undefined;
|
|
9
|
+
top?: boolean | undefined;
|
|
10
|
+
identifier?: any;
|
|
11
|
+
firstload?: boolean | undefined;
|
|
12
|
+
} | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to allow retry and show a retry button when loading fails
|
|
15
|
+
*/
|
|
16
|
+
allowRetry?: boolean | undefined;
|
|
17
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
18
|
infinite: ($state: InfiniteLoaderState) => void;
|
|
17
|
-
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
20
|
+
/**
|
|
21
|
+
* v3-infinite-loading props, see docs or type definitions
|
|
22
|
+
*/
|
|
23
|
+
settings?: {
|
|
24
|
+
target?: string | undefined;
|
|
25
|
+
distance?: number | undefined;
|
|
26
|
+
top?: boolean | undefined;
|
|
27
|
+
identifier?: any;
|
|
28
|
+
firstload?: boolean | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Whether to allow retry and show a retry button when loading fails
|
|
32
|
+
*/
|
|
33
|
+
allowRetry?: boolean | undefined;
|
|
34
|
+
}>>> & {
|
|
31
35
|
onInfinite?: (($state: InfiniteLoaderState) => any) | undefined;
|
|
32
36
|
}, {}, {}>;
|
|
33
37
|
export default _default;
|
|
38
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
39
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
40
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
41
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
42
|
+
} : {
|
|
43
|
+
type: import('vue').PropType<T[K]>;
|
|
44
|
+
required: true;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { SourceAppDefinition } from '@speckle/shared';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<{
|
|
3
|
-
sourceApp:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import type { SourceAppDefinition } from '@speckle/shared';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
sourceApp: SourceAppDefinition;
|
|
4
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
5
|
+
sourceApp: SourceAppDefinition;
|
|
6
|
+
}>>>, {}, {}>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
9
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
10
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
11
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
12
|
+
} : {
|
|
13
|
+
type: import('vue').PropType<T[K]>;
|
|
10
14
|
required: true;
|
|
11
15
|
};
|
|
12
|
-
}
|
|
13
|
-
export default _default;
|
|
16
|
+
};
|
|
@@ -1,55 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { PropAnyComponent } from '../../helpers/common/components';
|
|
2
2
|
type AlertColor = 'success' | 'danger' | 'warning' | 'info';
|
|
3
3
|
type Size = 'default' | 'xs';
|
|
4
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
url?: string | undefined;
|
|
20
|
-
onClick?: (() => void) | undefined;
|
|
21
|
-
externalUrl?: boolean | undefined;
|
|
22
|
-
}[]>;
|
|
23
|
-
};
|
|
24
|
-
customIcon: {
|
|
25
|
-
type: import("vue").PropType<ConcreteComponent>;
|
|
26
|
-
};
|
|
27
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
5
|
+
color?: AlertColor | undefined;
|
|
6
|
+
withDismiss?: boolean | undefined;
|
|
7
|
+
actions?: {
|
|
8
|
+
title: string;
|
|
9
|
+
url?: string | undefined;
|
|
10
|
+
onClick?: (() => void) | undefined;
|
|
11
|
+
externalUrl?: boolean | undefined;
|
|
12
|
+
}[] | undefined;
|
|
13
|
+
customIcon?: PropAnyComponent | undefined;
|
|
14
|
+
size?: Size | undefined;
|
|
15
|
+
}>, {
|
|
16
|
+
color: string;
|
|
17
|
+
size: string;
|
|
18
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
19
|
dismiss: () => void;
|
|
29
|
-
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
url?: string | undefined;
|
|
45
|
-
onClick?: (() => void) | undefined;
|
|
46
|
-
externalUrl?: boolean | undefined;
|
|
47
|
-
}[]>;
|
|
48
|
-
};
|
|
49
|
-
customIcon: {
|
|
50
|
-
type: import("vue").PropType<ConcreteComponent>;
|
|
51
|
-
};
|
|
52
|
-
}>> & {
|
|
20
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
21
|
+
color?: AlertColor | undefined;
|
|
22
|
+
withDismiss?: boolean | undefined;
|
|
23
|
+
actions?: {
|
|
24
|
+
title: string;
|
|
25
|
+
url?: string | undefined;
|
|
26
|
+
onClick?: (() => void) | undefined;
|
|
27
|
+
externalUrl?: boolean | undefined;
|
|
28
|
+
}[] | undefined;
|
|
29
|
+
customIcon?: PropAnyComponent | undefined;
|
|
30
|
+
size?: Size | undefined;
|
|
31
|
+
}>, {
|
|
32
|
+
color: string;
|
|
33
|
+
size: string;
|
|
34
|
+
}>>> & {
|
|
53
35
|
onDismiss?: (() => any) | undefined;
|
|
54
36
|
}, {
|
|
55
37
|
size: Size;
|
|
@@ -59,6 +41,23 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
59
41
|
description?(_: {}): any;
|
|
60
42
|
}>;
|
|
61
43
|
export default _default;
|
|
44
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
45
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
46
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
47
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
48
|
+
} : {
|
|
49
|
+
type: import('vue').PropType<T[K]>;
|
|
50
|
+
required: true;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
type __VLS_WithDefaults<P, D> = {
|
|
54
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
55
|
+
default: D[K];
|
|
56
|
+
}> : P[K];
|
|
57
|
+
};
|
|
58
|
+
type __VLS_Prettify<T> = {
|
|
59
|
+
[K in keyof T]: T[K];
|
|
60
|
+
} & {};
|
|
62
61
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
63
62
|
new (): {
|
|
64
63
|
$slots: S;
|
|
@@ -1,57 +1,74 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { PropAnyComponent } from '../../helpers/common/components';
|
|
2
2
|
type BadgeSize = 'base' | 'lg';
|
|
3
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
4
|
-
size
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
3
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
size?: BadgeSize | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Set text & bg color. Defaults to primary variation.
|
|
7
|
+
*/
|
|
8
|
+
colorClasses?: string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Show dot to the right
|
|
11
|
+
*/
|
|
12
|
+
dot?: boolean | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Set dot/icon bg color. Defaults to primary variation.
|
|
15
|
+
*/
|
|
16
|
+
dotIconColorClasses?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Optionally show icon to the left of the text
|
|
19
|
+
*/
|
|
20
|
+
iconLeft?: PropAnyComponent | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* A more square, but still rounded look
|
|
23
|
+
*/
|
|
24
|
+
rounded?: boolean | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Track icon clicks
|
|
27
|
+
*/
|
|
28
|
+
clickableIcon?: boolean | undefined;
|
|
29
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
26
30
|
"click-icon": (v: MouseEvent) => void;
|
|
27
|
-
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
28
|
-
size
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
31
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
32
|
+
size?: BadgeSize | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Set text & bg color. Defaults to primary variation.
|
|
35
|
+
*/
|
|
36
|
+
colorClasses?: string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Show dot to the right
|
|
39
|
+
*/
|
|
40
|
+
dot?: boolean | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Set dot/icon bg color. Defaults to primary variation.
|
|
43
|
+
*/
|
|
44
|
+
dotIconColorClasses?: string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Optionally show icon to the left of the text
|
|
47
|
+
*/
|
|
48
|
+
iconLeft?: PropAnyComponent | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* A more square, but still rounded look
|
|
51
|
+
*/
|
|
52
|
+
rounded?: boolean | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Track icon clicks
|
|
55
|
+
*/
|
|
56
|
+
clickableIcon?: boolean | undefined;
|
|
57
|
+
}>>> & {
|
|
50
58
|
"onClick-icon"?: ((v: MouseEvent) => any) | undefined;
|
|
51
59
|
}, {}, {}>, {
|
|
52
60
|
default?(_: {}): any;
|
|
53
61
|
}>;
|
|
54
62
|
export default _default;
|
|
63
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
64
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
65
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
66
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
67
|
+
} : {
|
|
68
|
+
type: import('vue').PropType<T[K]>;
|
|
69
|
+
required: true;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
55
72
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
56
73
|
new (): {
|
|
57
74
|
$slots: S;
|