UNPKG

mine-h5-ui

Version:

一款轻量级、模块化基于 Vue3.x 的 H5 前端 UI 组件库 👍

76 lines (75 loc) 3.31 kB
import { defineComponent as S, mergeModels as v, useModel as $, createBlock as A, openBlock as l, Transition as E, withCtx as z, createElementBlock as r, createCommentVNode as w, createElementVNode as a, unref as e, Fragment as u, renderList as d, withModifiers as T, normalizeStyle as H, toDisplayString as M } from "vue"; import { useHandMove as L, useBtns as O } from "./hooks.js"; /*! * mine-h5-ui v2.15.0 * Copyright (c) 2025 biaov * @license MIT */ const P = { key: 0, class: "me-datetime-picker" }, j = { class: "hd" }, q = { class: "bd" }, G = ["onTouchstart", "onTouchmove", "onTouchend", "onMousedown"], K = /* @__PURE__ */ S({ name: "MeDatetimePicker", __name: "index", props: /* @__PURE__ */ v({ type: { default: "datetime" }, visible: { type: Boolean, default: !1 }, minDate: { default: () => { const o = /* @__PURE__ */ new Date(); return o.setFullYear(o.getFullYear() - 10), o; } }, maxDate: { default: () => { const o = /* @__PURE__ */ new Date(); return o.setFullYear(o.getFullYear() + 10), o; } } }, { modelValue: { default: "" }, modelModifiers: {} }), emits: /* @__PURE__ */ v(["cancel", "sure"], ["update:modelValue"]), setup(o, { emit: b }) { const C = b, c = o, D = $(o, "modelValue"), { show: m, currentValue: V, listData: g, distance: x, duration: p, filterNumber: f, getCurNum: y, onTouchstart: _, onTouchmove: B, onTouchend: F, onMousedown: Y } = L(c), { onCancel: k, onSure: h } = O({ props: c, emit: C, currentValue: V, modelValue: D }); return (N, s) => (l(), A(E, { name: "translate" }, { default: z(() => [ N.visible ? (l(), r("div", P, [ a("div", j, [ a("button", { type: "button", class: "cancel", onClick: s[0] || (s[0] = //@ts-ignore (...t) => e(k) && e(k)(...t)) }, "取消"), s[2] || (s[2] = a("span", { class: "line" }, null, -1)), a("button", { type: "button", class: "sure", onClick: s[1] || (s[1] = //@ts-ignore (...t) => e(h) && e(h)(...t)) }, "确定") ]), a("ul", q, [ (l(!0), r(u, null, d(e(g), (t) => (l(), r(u, null, [ e(m).includes(t.id) ? (l(), r("li", { key: t.id, onTouchstart: T((n) => e(_)(n, t.id), ["prevent"]), onTouchmove: (n) => e(B)(n, t.id), onTouchend: (n) => e(F)(n, t.id), onMousedown: T((n) => e(Y)(n, t.id), ["prevent"]) }, [ a("ol", { style: H(`transform:translateY(${e(x)[e(m).indexOf(t.id)]}px);transition-property:${e(p) > 0 ? "all" : "none"};transition-duration: ${e(p)}ms;`) }, [ Array.isArray(t.list) ? (l(!0), r(u, { key: 0 }, d(t.list, (n, i) => (l(), r("li", { key: i }, M(e(f)(e(y)(t.id, n))), 1))), 128)) : (l(!0), r(u, { key: 1 }, d(t.list, (n, i) => (l(), r("li", { key: i }, M(e(f)(e(y)(t.id, n))), 1))), 128)) ], 4) ], 40, G)) : w("", !0) ], 64))), 256)) ]) ])) : w("", !0) ]), _: 1 })); } }); export { K as default };