import { defineComponent as m, toRefs as d, reactive as g, createVNode as c, resolveComponent as y } from "vue";
import { D as u } from "./index-BRrmKl1s.js";
const h = /* @__PURE__ */ m({
  name: "KlMarginPaddingSetter",
  components: {
    DirectionValueSetter: u
  },
  props: {
    styles: {
      type: Object,
      default: () => ({})
    }
  },
  setup(p) {
    const {
      styles: e
    } = d(p), l = g([{
      label: "外边距上",
      property: "marginTop",
      type: "margin",
      className: "outer-top"
    }, {
      label: "外边距右",
      property: "marginRight",
      type: "margin",
      className: "outer-right"
    }, {
      label: "外边距下",
      property: "marginBottom",
      type: "margin",
      className: "outer-bottom"
    }, {
      label: "外边距左",
      property: "marginLeft",
      type: "margin",
      className: "outer-left"
    }, {
      label: "内边距上",
      property: "paddingTop",
      type: "padding",
      className: "inner-top",
      min: 0
    }, {
      label: "内边距右",
      property: "paddingRight",
      type: "padding",
      className: "inner-right",
      min: 0
    }, {
      label: "内边距下",
      property: "paddingBottom",
      type: "padding",
      className: "inner-bottom",
      min: 0
    }, {
      label: "内边距左",
      property: "paddingLeft",
      type: "padding",
      className: "inner-left",
      min: 0
    }]), i = (r) => {
      if (!r) return;
      const {
        isSync: s,
        type: t,
        property: n,
        value: a
      } = r;
      s ? ["Top", "Right", "Bottom", "Left"].forEach((o) => {
        a ? e.value[`${t}${o}`] = a : delete e.value[`${t}${o}`];
      }) : a ? e.value[n] = a : delete e.value[n], t && delete e.value[t];
    };
    return () => c(y("direction-value-setter"), {
      styles: e.value,
      options: l,
      onChange: i
    }, null);
  }
});
export {
  h as default
};
