@ark-ui/vue
Version:
A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.
53 lines (50 loc) • 1.6 kB
JavaScript
import { defineComponent, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue';
import { ark } from '../factory.js';
import { useImageCropper } from './use-image-cropper.js';
import { ImageCropperProvider } from './use-image-cropper-context.js';
import { useForwardExpose } from '../../utils/use-forward-expose.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "image-cropper-root",
props: {
ids: {},
translations: {},
initialCrop: {},
minWidth: {},
minHeight: {},
maxWidth: {},
maxHeight: {},
aspectRatio: {},
cropShape: {},
zoom: {},
rotation: {},
flip: {},
defaultZoom: {},
defaultRotation: {},
defaultFlip: {},
zoomStep: {},
zoomSensitivity: {},
minZoom: {},
maxZoom: {},
nudgeStep: {},
nudgeStepShift: {},
nudgeStepCtrl: {},
fixedCropArea: { type: Boolean },
asChild: { type: Boolean }
},
emits: ["zoomChange", "update:zoom", "rotationChange", "update:rotation", "flipChange", "update:flip", "cropChange", "update:crop"],
setup(__props, { emit: __emit }) {
const emits = __emit;
const imageCropper = useImageCropper({}, emits);
ImageCropperProvider(imageCropper);
useForwardExpose();
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ark).div, mergeProps(unref(imageCropper).getRootProps(), { "as-child": __props.asChild }), {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
}, 16, ["as-child"]);
};
}
});
export { _sfc_main as default };