"use strict";
const uni_modules_uniSwipeAction_components_uniSwipeActionItem_mpwxs = require("./mpwxs.js");
const uni_modules_uniSwipeAction_components_uniSwipeActionItem_bindingx = require("./bindingx.js");
const uni_modules_uniSwipeAction_components_uniSwipeActionItem_mpother = require("./mpother.js");
const common_vendor = require("../../../../common/vendor.js");
const block0 = {};
const block1 = {};
const _sfc_main = {
  mixins: [uni_modules_uniSwipeAction_components_uniSwipeActionItem_mpwxs.mpMixins, uni_modules_uniSwipeAction_components_uniSwipeActionItem_bindingx.bindIngXMixins, uni_modules_uniSwipeAction_components_uniSwipeActionItem_mpother.mpother],
  emits: ["click", "change"],
  props: {
    // 控制开关
    show: {
      type: String,
      default: "none"
    },
    // 禁用
    disabled: {
      type: Boolean,
      default: false
    },
    // 是否自动关闭
    autoClose: {
      type: Boolean,
      default: true
    },
    // 滑动缺省距离
    threshold: {
      type: Number,
      default: 20
    },
    // 左侧按钮内容
    leftOptions: {
      type: Array,
      default() {
        return [];
      }
    },
    // 右侧按钮内容
    rightOptions: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  // TODO vue3
  unmounted() {
    this.__isUnmounted = true;
    this.uninstall();
  },
  methods: {
    uninstall() {
      if (this.swipeaction) {
        this.swipeaction.children.forEach((item, index) => {
          if (item === this) {
            this.swipeaction.children.splice(index, 1);
          }
        });
      }
    },
    /**
     * 获取父元素实例
     */
    getSwipeAction(name = "uniSwipeAction") {
      let parent = this.$parent;
      let parentName = parent.$options.name;
      while (parentName !== name) {
        parent = parent.$parent;
        if (!parent)
          return false;
        parentName = parent.$options.name;
      }
      return parent;
    }
  }
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  return {
    a: common_vendor.f($props.leftOptions, (item, index, i0) => {
      return {
        a: common_vendor.t(item.text),
        b: item.style && item.style.color ? item.style.color : "#FFFFFF",
        c: index,
        d: item.style && item.style.backgroundColor ? item.style.backgroundColor : "#C7C6CD",
        e: item.style && item.style.fontSize ? item.style.fontSize : "16px",
        f: common_vendor.o(($event) => _ctx.appTouchEnd($event, index, item, "left"))
      };
    }),
    b: common_vendor.o((...args) => _ctx.appTouchStart && _ctx.appTouchStart(...args)),
    c: common_vendor.n(_ctx.elClass),
    d: common_vendor.f($props.rightOptions, (item, index, i0) => {
      return {
        a: common_vendor.t(item.text),
        b: item.style && item.style.color ? item.style.color : "#FFFFFF",
        c: index,
        d: item.style && item.style.backgroundColor ? item.style.backgroundColor : "#C7C6CD",
        e: item.style && item.style.fontSize ? item.style.fontSize : "16px",
        f: common_vendor.o(($event) => _ctx.appTouchEnd($event, index, item, "right"))
      };
    }),
    e: common_vendor.o((...args) => _ctx.appTouchStart && _ctx.appTouchStart(...args)),
    f: common_vendor.n(_ctx.elClass),
    g: common_vendor.o((...args) => _ctx.touchstart && _ctx.touchstart(...args)),
    h: common_vendor.o((...args) => _ctx.touchmove && _ctx.touchmove(...args)),
    i: common_vendor.o((...args) => _ctx.touchend && _ctx.touchend(...args)),
    j: _ctx.moveLeft,
    k: _ctx.ani ? 1 : ""
  };
}
if (typeof block0 === "function")
  block0(_sfc_main);
if (typeof block1 === "function")
  block1(_sfc_main);
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:/111111000000/uniapp04/uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.vue"]]);
my.createComponent(Component);
