UNPKG

mine-h5-ui

Version:

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

88 lines (87 loc) 2.77 kB
import { defineComponent as m, mergeModels as p, useModel as f, createElementBlock as v, openBlock as b, normalizeStyle as h, unref as a, createElementVNode as l, withDirectives as g, vModelText as x } from "vue"; import { useHandle as c } from "./hooks.js"; /*! * mine-h5-ui v2.16.0 * Copyright (c) 2025 biaov * @license MIT */ const q = ["disabled"], B = ["disabled"], C = ["maxlength", "disabled"], M = ["disabled"], w = /* @__PURE__ */ m({ name: "MeStepper", __name: "index", props: /* @__PURE__ */ p({ max: { default: 999 }, min: { default: 1 }, step: { default: 1 }, maxlength: { default: 3 }, height: { default: 36 }, inputWidth: { default: 60 }, color: {}, borderColor: {}, borderRadius: {}, disabledColor: {}, disabled: { type: Boolean, default: !1 }, fontSize: { default: 14 } }, { modelValue: { default: 1 }, modelModifiers: {} }), emits: ["update:modelValue"], setup(s) { const t = s, d = f(s, "modelValue"), { onClickBtn: n, onBlur: u, getStyle: r } = c(t, d); return (i, e) => (b(), v("div", { class: "me-stepper", disabled: i.disabled, style: h(a(r)) }, [ l("div", { class: "button", disabled: +d.value <= t.min, onClick: e[0] || (e[0] = (o) => a(n)(-t.step)) }, [...e[4] || (e[4] = [ l("svg", { focusable: "false", "data-icon": "minus", width: "1em", height: "1em", fill: "currentColor", "aria-hidden": "true", viewBox: "64 64 896 896" }, [ l("path", { d: "M872 474H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h720c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z" }) ], -1) ])], 8, B), g(l("input", { type: "text", "onUpdate:modelValue": e[1] || (e[1] = (o) => d.value = o), class: "input", maxlength: i.maxlength, onBlur: e[2] || (e[2] = //@ts-ignore (...o) => a(u) && a(u)(...o)), disabled: i.disabled }, null, 40, C), [ [x, d.value] ]), l("div", { class: "button", disabled: +d.value >= t.max, onClick: e[3] || (e[3] = (o) => a(n)(t.step)) }, [...e[5] || (e[5] = [ l("svg", { focusable: "false", "data-icon": "plus", width: "1em", height: "1em", fill: "currentColor", "aria-hidden": "true", viewBox: "64 64 896 896" }, [ l("path", { d: "M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z" }), l("path", { d: "M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z" }) ], -1) ])], 8, M) ], 12, q)); } }); export { w as default };