import { unref as u, isRef as s } from "vue";
import { n, x as l, y as r, B as o } from "./index-e250a75e.mjs";
function g({ config: t, data: a }) {
  const i = {
    "~component": "el-pagination",
    "~modelValueName": "currentPage",
    //modelValue: unref(value)[config['_key-current-page'] || 'page'],
    "~modelValue": u(a),
    "~modelValuePath": t["_key-current-page"] || "page",
    "@update:current-page": function(e, p) {
      !t._sync_to_data || !a || (s(a) ? a.value[t["_key-current-page"] || "page"] = p : a[t["_key-current-page"] || "page"] = p);
    },
    "@update:page-size": function(e, p) {
      !t._sync_to_data || !a || !t["_key-page-size"] || (s(a) ? a.value[t["_key-page-size"] || "page"] = p : a[t["_key-page-size"] || "page"] = p);
    }
  };
  for (const e of Object.keys(t))
    if (t[e]) {
      if (e == "page-sizes") {
        i[e] = JSON.parse(t[e]);
        continue;
      } else {
        if (e == "_key-current-page")
          continue;
        if (e == "_sync_to_data")
          continue;
        if (e == "_key-total") {
          i.total = u(a)[t[e]];
          continue;
        } else if (e == "_key-page-count") {
          i["page-count"] = u(a)[t[e]];
          continue;
        } else if (e == "_key-page-size") {
          i["page-size"] = u(a)[t[e]];
          continue;
        }
      }
      i[e] = t[e];
    }
  return i.total == null && (i.total = 0), i;
}
const y = {
  key: "_pagination",
  name: n("_.builtIn.element.pagination.name"),
  description: "",
  icon: "mdiBookOpenPageVariantOutline",
  sequence: 41,
  transform: g,
  editor: {
    basic: {
      ui: [
        l("layout", n("_.builtIn.element.pagination.layout")),
        r("pager-count", n("_.builtIn.element.pagination.pager-count")),
        o("small", n("_.builtIn.element.pagination.small")),
        o("background", n("_.builtIn.element.pagination.background")),
        l("page-sizes", n("_.builtIn.element.pagination.page-size")),
        l("prev-text", n("_.builtIn.element.pagination.prev-text")),
        // uiUtil.createIconPicker('_prev-icon'),
        l("next-text", n("_.builtIn.element.pagination.next-text")),
        // uiUtil.createIconPicker('_next-icon'),
        o("disabled", n("_.builtIn.element.pagination.disabled")),
        o("hide-on-single-page", n("_.builtIn.element.pagination.hide-on-single-page")),
        o("_sync_to_data", n("_.builtIn.element.pagination.sync_to_data")),
        l("_key-current-page", n("_.builtIn.element.pagination.key-current-page")),
        l("_key-total", n("_.builtIn.element.pagination.key-total")),
        l("_key-page-count", n("_.builtIn.element.pagination.key-page-count")),
        l("_key-page-size", n("_.builtIn.element.pagination.key-page-size"))
      ],
      init: {
        layout: "prev, pager, next, jumper, total",
        "pager-count": 7,
        small: !1,
        background: !1,
        "page-sizes": "[10, 20, 30, 40, 50, 100]",
        //'default-page-size':10,
        disabled: !1,
        "hide-on-single-page": !1,
        _sync_to_data: !0,
        "_key-current-page": "page",
        "_key-total": "total",
        "_key-page-count": "page-count",
        "_key-page-size": "size"
      }
    },
    data: {
      //readonly:true,
      type: "Object"
    },
    event: {
      list: ["size-change", "current-change", "prev-click", "next-click"],
      init: []
    },
    display: {
      init: {
        style: {
          margin: "6px 0"
        }
      }
    }
  }
};
export {
  y as default
};
