@deskhero/dh_ui 1.54.4 → 1.55.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/dist/dh_ui.es.js +13 -7
- package/dist/dh_ui.umd.js +2 -2
- package/dist/src/components/ImageCropper.vue.d.ts +11 -0
- package/dist/style.css +2 -2
- package/package.json +1 -1
package/dist/dh_ui.es.js
CHANGED
|
@@ -24285,7 +24285,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
24285
24285
|
setup(__props, { emit }) {
|
|
24286
24286
|
const props = __props;
|
|
24287
24287
|
useCssVars((_ctx) => ({
|
|
24288
|
-
"
|
|
24288
|
+
"92529aa8": __props.widthProp
|
|
24289
24289
|
}));
|
|
24290
24290
|
onMounted(() => {
|
|
24291
24291
|
document.addEventListener("click", (event) => {
|
|
@@ -24345,7 +24345,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
24345
24345
|
};
|
|
24346
24346
|
}
|
|
24347
24347
|
});
|
|
24348
|
-
var DropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-
|
|
24348
|
+
var DropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-f709127c"]]);
|
|
24349
24349
|
var Error_vue_vue_type_style_index_0_lang = "";
|
|
24350
24350
|
const _hoisted_1$g = {
|
|
24351
24351
|
key: 0,
|
|
@@ -46523,6 +46523,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
46523
46523
|
type: Boolean,
|
|
46524
46524
|
required: false,
|
|
46525
46525
|
default: false
|
|
46526
|
+
},
|
|
46527
|
+
isRound: {
|
|
46528
|
+
type: Boolean,
|
|
46529
|
+
required: false,
|
|
46530
|
+
default: false
|
|
46526
46531
|
}
|
|
46527
46532
|
},
|
|
46528
46533
|
emits: ["update"],
|
|
@@ -46559,14 +46564,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
46559
46564
|
}
|
|
46560
46565
|
function crop2() {
|
|
46561
46566
|
let croppedCanvas = cropper2.getCroppedCanvas();
|
|
46562
|
-
let
|
|
46563
|
-
if (!
|
|
46567
|
+
let finalCanvas = props.isRound ? getRoundedCanvas(croppedCanvas) : croppedCanvas;
|
|
46568
|
+
if (!finalCanvas)
|
|
46564
46569
|
return;
|
|
46565
46570
|
if (cropPreview.value) {
|
|
46566
|
-
cropPreview.value.src =
|
|
46571
|
+
cropPreview.value.src = finalCanvas.toDataURL();
|
|
46567
46572
|
showCroppedImage.value = true;
|
|
46568
46573
|
}
|
|
46569
|
-
emit("update",
|
|
46574
|
+
emit("update", finalCanvas);
|
|
46570
46575
|
}
|
|
46571
46576
|
function getRoundedCanvas(sourceCanvas) {
|
|
46572
46577
|
var canvas = document.createElement("canvas");
|
|
@@ -46589,6 +46594,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
46589
46594
|
return __props.image ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
46590
46595
|
createElementVNode("div", {
|
|
46591
46596
|
id: "cropper-container",
|
|
46597
|
+
class: normalizeClass({ "rounded-crop": __props.isRound }),
|
|
46592
46598
|
style: normalizeStyle({ "max-width": __props.width + "px" })
|
|
46593
46599
|
}, [
|
|
46594
46600
|
createElementVNode("img", {
|
|
@@ -46596,7 +46602,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
46596
46602
|
ref_key: "croppingImage",
|
|
46597
46603
|
ref: croppingImage
|
|
46598
46604
|
}, null, 512)
|
|
46599
|
-
],
|
|
46605
|
+
], 6),
|
|
46600
46606
|
createVNode(DhButton, {
|
|
46601
46607
|
color: "primary",
|
|
46602
46608
|
size: "small",
|