first commit
This commit is contained in:
91
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-input-number/types.js
vendored
Normal file
91
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-input-number/types.js
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
"use strict";
|
||||
const uni_modules_wotDesignUni_components_common_props = require("../common/props.js");
|
||||
const inputNumberProps = {
|
||||
...uni_modules_wotDesignUni_components_common_props.baseProps,
|
||||
/**
|
||||
* 绑定值
|
||||
*/
|
||||
modelValue: uni_modules_wotDesignUni_components_common_props.makeRequiredProp(uni_modules_wotDesignUni_components_common_props.numericProp),
|
||||
/**
|
||||
* 最小值
|
||||
*/
|
||||
min: uni_modules_wotDesignUni_components_common_props.makeNumberProp(1),
|
||||
/**
|
||||
* 最大值
|
||||
*/
|
||||
max: uni_modules_wotDesignUni_components_common_props.makeNumberProp(Number.MAX_SAFE_INTEGER),
|
||||
/**
|
||||
* 步进值
|
||||
*/
|
||||
step: uni_modules_wotDesignUni_components_common_props.makeNumberProp(1),
|
||||
/**
|
||||
* 是否严格按照步进值递增或递减
|
||||
*/
|
||||
stepStrictly: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 数值精度
|
||||
*/
|
||||
precision: uni_modules_wotDesignUni_components_common_props.makeNumericProp(0),
|
||||
/**
|
||||
* 是否禁用
|
||||
*/
|
||||
disabled: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 是否禁用输入框
|
||||
*/
|
||||
disableInput: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 是否禁用减号按钮
|
||||
*/
|
||||
disableMinus: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 是否禁用加号按钮
|
||||
*/
|
||||
disablePlus: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 是否不显示输入框
|
||||
*/
|
||||
withoutInput: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 输入框宽度
|
||||
*/
|
||||
inputWidth: uni_modules_wotDesignUni_components_common_props.makeNumericProp(36),
|
||||
/**
|
||||
* 是否允许为空
|
||||
*/
|
||||
allowNull: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 输入框占位符
|
||||
*/
|
||||
placeholder: uni_modules_wotDesignUni_components_common_props.makeStringProp(""),
|
||||
/**
|
||||
* 原生属性,键盘弹起时,是否自动上推页面
|
||||
*/
|
||||
adjustPosition: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 输入值变化前的回调函数,返回 `false` 可阻止输入,支持返回 `Promise`
|
||||
*/
|
||||
beforeChange: Function,
|
||||
/**
|
||||
* 是否开启长按加减手势
|
||||
*/
|
||||
longPress: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 是否立即响应输入变化,false 时仅在失焦和按钮点击时更新
|
||||
*/
|
||||
immediateChange: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 是否在初始化时更新 v-model 为修正后的值
|
||||
* true: 自动修正并更新 v-model
|
||||
* false: 保持原始值不修正,但仍会进行显示格式化
|
||||
*/
|
||||
updateOnInit: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 输入框类型
|
||||
* number: 数字输入
|
||||
* digit: 整数输入
|
||||
*/
|
||||
inputType: uni_modules_wotDesignUni_components_common_props.makeStringProp("digit")
|
||||
};
|
||||
exports.inputNumberProps = inputNumberProps;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-input-number/types.js.map
|
||||
@@ -0,0 +1,327 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_wotDesignUni_components_common_util = require("../common/util.js");
|
||||
const uni_modules_wotDesignUni_components_wdInputNumber_types = require("./types.js");
|
||||
const uni_modules_wotDesignUni_components_common_interceptor = require("../common/interceptor.js");
|
||||
if (!Math) {
|
||||
wdIcon();
|
||||
}
|
||||
const wdIcon = () => "../wd-icon/wd-icon.js";
|
||||
const __default__ = {
|
||||
name: "wd-input-number",
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
};
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: uni_modules_wotDesignUni_components_wdInputNumber_types.inputNumberProps,
|
||||
emits: ["change", "focus", "blur", "update:modelValue"],
|
||||
setup(__props, { emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const inputValue = common_vendor.ref(getInitValue());
|
||||
let longPressTimer = null;
|
||||
const minDisabled = common_vendor.computed(() => {
|
||||
const val = toNumber(inputValue.value);
|
||||
return props.disabled || val <= props.min || addStep(val, -props.step) < props.min;
|
||||
});
|
||||
const maxDisabled = common_vendor.computed(() => {
|
||||
const val = toNumber(inputValue.value);
|
||||
return props.disabled || val >= props.max || addStep(val, props.step) > props.max;
|
||||
});
|
||||
common_vendor.watch(
|
||||
() => props.modelValue,
|
||||
(val) => {
|
||||
inputValue.value = formatValue(val);
|
||||
}
|
||||
);
|
||||
common_vendor.watch([() => props.max, () => props.min, () => props.precision], () => {
|
||||
const val = toNumber(inputValue.value);
|
||||
inputValue.value = formatValue(val);
|
||||
});
|
||||
function getInitValue() {
|
||||
if (!props.updateOnInit) {
|
||||
return formatDisplay(props.modelValue);
|
||||
}
|
||||
const formatted = formatValue(props.modelValue);
|
||||
if (!uni_modules_wotDesignUni_components_common_util.isEqual(String(formatted), String(props.modelValue))) {
|
||||
emit("update:modelValue", formatted);
|
||||
}
|
||||
return formatted;
|
||||
}
|
||||
function getPrecision(val) {
|
||||
if (!uni_modules_wotDesignUni_components_common_util.isDef(val))
|
||||
return 0;
|
||||
const str = val.toString();
|
||||
const dotIndex = str.indexOf(".");
|
||||
return dotIndex === -1 ? 0 : str.length - dotIndex - 1;
|
||||
}
|
||||
function toPrecision(val) {
|
||||
const precision = Number(props.precision);
|
||||
return Math.round(val * Math.pow(10, precision)) / Math.pow(10, precision);
|
||||
}
|
||||
function toNumber(val) {
|
||||
if (props.allowNull && (!uni_modules_wotDesignUni_components_common_util.isDef(val) || val === "")) {
|
||||
return NaN;
|
||||
}
|
||||
if (!uni_modules_wotDesignUni_components_common_util.isDef(val) || val === "") {
|
||||
return props.min;
|
||||
}
|
||||
let str = String(val);
|
||||
if (str.endsWith("."))
|
||||
str = str.slice(0, -1);
|
||||
if (str.startsWith("."))
|
||||
str = "0" + str;
|
||||
if (str.startsWith("-."))
|
||||
str = "-0" + str.substring(1);
|
||||
if (str === "-" || str === "")
|
||||
return props.min;
|
||||
let num = Number(str);
|
||||
if (isNaN(num))
|
||||
num = props.min;
|
||||
return normalizeValue(num);
|
||||
}
|
||||
function normalizeValue(val) {
|
||||
let result = val;
|
||||
if (props.stepStrictly) {
|
||||
const stepPrecision = getPrecision(props.step);
|
||||
const factor = Math.pow(10, stepPrecision);
|
||||
result = Math.round(result / props.step) * factor * props.step / factor;
|
||||
}
|
||||
if (props.stepStrictly) {
|
||||
result = applyStrictBounds(result, props.min, props.max);
|
||||
} else {
|
||||
result = Math.min(Math.max(result, props.min), props.max);
|
||||
}
|
||||
if (uni_modules_wotDesignUni_components_common_util.isDef(props.precision)) {
|
||||
result = toPrecision(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function applyStrictBounds(val, min, max) {
|
||||
if (val >= min && val <= max)
|
||||
return val;
|
||||
const stepPrecision = getPrecision(props.step);
|
||||
const factor = Math.pow(10, stepPrecision);
|
||||
if (val < min) {
|
||||
const minSteps = Math.ceil(min * factor / (props.step * factor));
|
||||
const candidate = toPrecision(minSteps * props.step * factor / factor);
|
||||
if (candidate > max) {
|
||||
const maxSteps = Math.floor(max * factor / (props.step * factor));
|
||||
return toPrecision(maxSteps * props.step * factor / factor);
|
||||
}
|
||||
return candidate;
|
||||
}
|
||||
if (val > max) {
|
||||
const maxSteps = Math.floor(max * factor / (props.step * factor));
|
||||
const candidate = toPrecision(maxSteps * props.step * factor / factor);
|
||||
if (candidate < min) {
|
||||
const minSteps = Math.ceil(min * factor / (props.step * factor));
|
||||
return toPrecision(minSteps * props.step * factor / factor);
|
||||
}
|
||||
return candidate;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
function formatValue(val) {
|
||||
if (props.allowNull && (!uni_modules_wotDesignUni_components_common_util.isDef(val) || val === "")) {
|
||||
return "";
|
||||
}
|
||||
const num = toNumber(val);
|
||||
const precision = Number(props.precision);
|
||||
if (!uni_modules_wotDesignUni_components_common_util.isDef(props.precision)) {
|
||||
return num;
|
||||
}
|
||||
return precision === 0 ? Number(num.toFixed(0)) : num.toFixed(precision);
|
||||
}
|
||||
function formatDisplay(val) {
|
||||
if (props.allowNull && (!uni_modules_wotDesignUni_components_common_util.isDef(val) || val === "")) {
|
||||
return "";
|
||||
}
|
||||
if (!uni_modules_wotDesignUni_components_common_util.isDef(val) || val === "") {
|
||||
return props.min;
|
||||
}
|
||||
let num = Number(val);
|
||||
if (isNaN(num)) {
|
||||
return props.min;
|
||||
}
|
||||
const precision = Number(props.precision);
|
||||
if (!uni_modules_wotDesignUni_components_common_util.isDef(props.precision)) {
|
||||
return num;
|
||||
}
|
||||
return precision === 0 ? Number(num.toFixed(0)) : num.toFixed(precision);
|
||||
}
|
||||
function isIntermediate(val) {
|
||||
if (!val)
|
||||
return false;
|
||||
const str = String(val);
|
||||
return str.endsWith(".") || str.startsWith(".") || str.startsWith("-.") || str === "-" || Number(props.precision) > 0 && str.indexOf(".") === -1;
|
||||
}
|
||||
function cleanInput(val) {
|
||||
if (!val)
|
||||
return "";
|
||||
let cleaned = val.replace(/[^\d.-]/g, "");
|
||||
const hasNegative = cleaned.startsWith("-");
|
||||
cleaned = cleaned.replace(/-/g, "");
|
||||
if (hasNegative)
|
||||
cleaned = "-" + cleaned;
|
||||
const precision = Number(props.precision);
|
||||
if (precision > 0) {
|
||||
const parts = cleaned.split(".");
|
||||
if (parts.length > 2) {
|
||||
cleaned = parts[0] + "." + parts.slice(1).join("");
|
||||
}
|
||||
} else {
|
||||
cleaned = cleaned.split(".")[0];
|
||||
}
|
||||
if (cleaned.startsWith("."))
|
||||
return "0" + cleaned;
|
||||
if (cleaned.startsWith("-."))
|
||||
return "-0" + cleaned.substring(1);
|
||||
return cleaned;
|
||||
}
|
||||
function updateValue(val) {
|
||||
if (props.allowNull && (!uni_modules_wotDesignUni_components_common_util.isDef(val) || val === "")) {
|
||||
if (uni_modules_wotDesignUni_components_common_util.isEqual("", String(props.modelValue))) {
|
||||
inputValue.value = "";
|
||||
return;
|
||||
}
|
||||
const doUpdate2 = () => {
|
||||
inputValue.value = "";
|
||||
emit("update:modelValue", "");
|
||||
emit("change", { value: "" });
|
||||
};
|
||||
uni_modules_wotDesignUni_components_common_interceptor.callInterceptor(props.beforeChange, { args: [""], done: doUpdate2 });
|
||||
return;
|
||||
}
|
||||
const num = toNumber(val);
|
||||
const display = formatValue(val);
|
||||
if (uni_modules_wotDesignUni_components_common_util.isEqual(String(num), String(props.modelValue))) {
|
||||
inputValue.value = display;
|
||||
return;
|
||||
}
|
||||
const doUpdate = () => {
|
||||
inputValue.value = display;
|
||||
emit("update:modelValue", num);
|
||||
emit("change", { value: num });
|
||||
};
|
||||
uni_modules_wotDesignUni_components_common_interceptor.callInterceptor(props.beforeChange, { args: [num], done: doUpdate });
|
||||
}
|
||||
function addStep(val, step) {
|
||||
const num = Number(val);
|
||||
if (isNaN(num))
|
||||
return normalizeValue(props.min);
|
||||
const precision = Math.max(getPrecision(num), getPrecision(step));
|
||||
const factor = Math.pow(10, precision);
|
||||
const result = (num * factor + step * factor) / factor;
|
||||
return normalizeValue(result);
|
||||
}
|
||||
function handleClick(type) {
|
||||
const step = type === "add" ? props.step : -props.step;
|
||||
if (step < 0 && (minDisabled.value || props.disableMinus) || step > 0 && (maxDisabled.value || props.disablePlus))
|
||||
return;
|
||||
const newVal = addStep(inputValue.value, step);
|
||||
updateValue(newVal);
|
||||
}
|
||||
function handleInput(event) {
|
||||
const rawVal = event.detail.value || "";
|
||||
inputValue.value = rawVal;
|
||||
common_vendor.nextTick$1(() => {
|
||||
if (rawVal === "") {
|
||||
inputValue.value = "";
|
||||
if (props.immediateChange && props.allowNull) {
|
||||
updateValue("");
|
||||
}
|
||||
return;
|
||||
}
|
||||
const cleaned = cleanInput(rawVal);
|
||||
if (Number(props.precision) > 0 && isIntermediate(cleaned)) {
|
||||
inputValue.value = cleaned;
|
||||
return;
|
||||
}
|
||||
inputValue.value = cleaned;
|
||||
if (props.immediateChange) {
|
||||
updateValue(cleaned);
|
||||
}
|
||||
});
|
||||
}
|
||||
function handleBlur(event) {
|
||||
const val = event.detail.value || "";
|
||||
updateValue(val);
|
||||
emit("blur", { value: val });
|
||||
}
|
||||
function handleFocus(event) {
|
||||
emit("focus", event.detail);
|
||||
}
|
||||
function longPressStep(type) {
|
||||
clearLongPressTimer();
|
||||
longPressTimer = setTimeout(() => {
|
||||
handleClick(type);
|
||||
longPressStep(type);
|
||||
}, 250);
|
||||
}
|
||||
function handleTouchStart(type) {
|
||||
if (!props.longPress)
|
||||
return;
|
||||
clearLongPressTimer();
|
||||
longPressTimer = setTimeout(() => {
|
||||
handleClick(type);
|
||||
longPressStep(type);
|
||||
}, 600);
|
||||
}
|
||||
function handleTouchEnd() {
|
||||
if (!props.longPress)
|
||||
return;
|
||||
clearLongPressTimer();
|
||||
}
|
||||
function clearLongPressTimer() {
|
||||
if (longPressTimer) {
|
||||
clearTimeout(longPressTimer);
|
||||
longPressTimer = null;
|
||||
}
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.p({
|
||||
name: "decrease",
|
||||
["custom-class"]: "wd-input-number__action-icon"
|
||||
}),
|
||||
b: common_vendor.n(`wd-input-number__action ${minDisabled.value || _ctx.disableMinus ? "is-disabled" : ""}`),
|
||||
c: common_vendor.o(($event) => handleClick("sub")),
|
||||
d: common_vendor.o(($event) => handleTouchStart("sub")),
|
||||
e: common_vendor.o(handleTouchEnd),
|
||||
f: !_ctx.withoutInput
|
||||
}, !_ctx.withoutInput ? {
|
||||
g: common_vendor.s(`${_ctx.inputWidth ? "width: " + _ctx.inputWidth : ""}`),
|
||||
h: _ctx.inputType,
|
||||
i: _ctx.precision ? "decimal" : "numeric",
|
||||
j: _ctx.disabled || _ctx.disableInput,
|
||||
k: String(inputValue.value),
|
||||
l: _ctx.placeholder,
|
||||
m: _ctx.adjustPosition,
|
||||
n: common_vendor.o(handleInput),
|
||||
o: common_vendor.o(handleFocus),
|
||||
p: common_vendor.o(handleBlur),
|
||||
q: common_vendor.o(() => {
|
||||
})
|
||||
} : {}, {
|
||||
r: common_vendor.p({
|
||||
name: "add",
|
||||
["custom-class"]: "wd-input-number__action-icon"
|
||||
}),
|
||||
s: common_vendor.n(`wd-input-number__action ${maxDisabled.value || _ctx.disablePlus ? "is-disabled" : ""}`),
|
||||
t: common_vendor.o(($event) => handleClick("add")),
|
||||
v: common_vendor.o(($event) => handleTouchStart("add")),
|
||||
w: common_vendor.o(handleTouchEnd),
|
||||
x: common_vendor.n(`wd-input-number ${_ctx.customClass} ${_ctx.disabled ? "is-disabled" : ""} ${_ctx.withoutInput ? "is-without-input" : ""}`),
|
||||
y: common_vendor.s(_ctx.customStyle)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-a2d9dd24"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-input-number/wd-input-number.js.map
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"wd-icon": "../wd-icon/wd-icon"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view class="{{['data-v-a2d9dd24', x]}}" style="{{y}}"><view class="{{['data-v-a2d9dd24', b]}}" bindtap="{{c}}" bindtouchstart="{{d}}" catchtouchend="{{e}}"><wd-icon wx:if="{{a}}" class="data-v-a2d9dd24" u-i="a2d9dd24-0" bind:__l="__l" u-p="{{a}}"></wd-icon></view><view wx:if="{{f}}" class="wd-input-number__inner data-v-a2d9dd24" catchtap="{{q}}"><block wx:if="{{r0}}"><input class="wd-input-number__input data-v-a2d9dd24" style="{{g}}" type="{{h}}" input-mode="{{i}}" disabled="{{j}}" value="{{k}}" placeholder="{{l}}" adjust-position="{{m}}" bindinput="{{n}}" bindfocus="{{o}}" bindblur="{{p}}"/></block><view class="wd-input-number__input-border data-v-a2d9dd24"></view></view><view class="{{['data-v-a2d9dd24', s]}}" bindtap="{{t}}" bindtouchstart="{{v}}" catchtouchend="{{w}}"><wd-icon wx:if="{{r}}" class="data-v-a2d9dd24" u-i="a2d9dd24-1" bind:__l="__l" u-p="{{r}}"></wd-icon></view></view>
|
||||
@@ -0,0 +1,275 @@
|
||||
/* 水平间距 */
|
||||
/* 水平间距 */
|
||||
/**
|
||||
* 混合宏
|
||||
*/
|
||||
/**
|
||||
* SCSS 配置项:命名空间以及BEM
|
||||
*/
|
||||
/**
|
||||
* 辅助函数
|
||||
*/
|
||||
/**
|
||||
* SCSS 配置项:命名空间以及BEM
|
||||
*/
|
||||
/* 转换成字符串 */
|
||||
/* 判断是否存在 Modifier */
|
||||
/* 判断是否存在伪类 */
|
||||
/**
|
||||
* 主题色切换
|
||||
* @params $theme-color 主题色
|
||||
* @params $type 变暗’dark‘ 变亮 'light'
|
||||
* @params $mix-color 自己设置的混色
|
||||
*/
|
||||
/**
|
||||
* 颜色结果切换, 如果开启线性渐变色 使用渐变色,如果没有开启,那么使用主题色
|
||||
* @params $open-linear 是否开启线性渐变色
|
||||
* @params $deg 渐变色角度
|
||||
* @params $theme-color 当前配色
|
||||
* @params [Array] $set 主题色明暗设置,与 $color-list 数量对应
|
||||
* @params [Array] $color-list 渐变色顺序, $color-list 和 $per-list 数量相同
|
||||
* @params [Array] $per-list 渐变色比例
|
||||
*/
|
||||
/**
|
||||
* BEM,定义块(b)
|
||||
*/
|
||||
/* 定义元素(e),对于伪类,会自动将 e 嵌套在 伪类 底下 */
|
||||
/* 此方法用于生成穿透样式 */
|
||||
/* 定义元素(e),对于伪类,会自动将 e 嵌套在 伪类 底下 */
|
||||
/* 定义状态(m) */
|
||||
/* 定义状态(m) */
|
||||
/* 对于需要需要嵌套在 m 底下的 e,调用这个混合宏,一般在切换整个组件的状态,如切换颜色的时候 */
|
||||
/* 状态,生成 is-$state 类名 */
|
||||
/**
|
||||
* 常用混合宏
|
||||
*/
|
||||
/* 单行超出隐藏 */
|
||||
/* 多行超出隐藏 */
|
||||
/* 清除浮动 */
|
||||
/* 0.5px 边框 指定方向*/
|
||||
/* 0.5px 边框 环绕 */
|
||||
/**
|
||||
* 三角形实现尖角样式,适用于背景透明情况
|
||||
* @param $size 三角形高,底边为 $size * 2
|
||||
* @param $bg 三角形背景颜色
|
||||
*/
|
||||
/**
|
||||
* 正方形实现尖角样式,适用于背景不透明情况
|
||||
* @param $size 正方形边长
|
||||
* @param $bg 正方形背景颜色
|
||||
* @param $z-index z-index属性值,不得大于外部包裹器
|
||||
* @param $box-shadow 阴影
|
||||
*/
|
||||
/**
|
||||
* 辅助函数
|
||||
*/
|
||||
/**
|
||||
* SCSS 配置项:命名空间以及BEM
|
||||
*/
|
||||
/* 转换成字符串 */
|
||||
/* 判断是否存在 Modifier */
|
||||
/* 判断是否存在伪类 */
|
||||
/**
|
||||
* 主题色切换
|
||||
* @params $theme-color 主题色
|
||||
* @params $type 变暗’dark‘ 变亮 'light'
|
||||
* @params $mix-color 自己设置的混色
|
||||
*/
|
||||
/**
|
||||
* 颜色结果切换, 如果开启线性渐变色 使用渐变色,如果没有开启,那么使用主题色
|
||||
* @params $open-linear 是否开启线性渐变色
|
||||
* @params $deg 渐变色角度
|
||||
* @params $theme-color 当前配色
|
||||
* @params [Array] $set 主题色明暗设置,与 $color-list 数量对应
|
||||
* @params [Array] $color-list 渐变色顺序, $color-list 和 $per-list 数量相同
|
||||
* @params [Array] $per-list 渐变色比例
|
||||
*/
|
||||
/**
|
||||
* UI规范基础变量
|
||||
*/
|
||||
/*----------------------------------------- Theme color. start ----------------------------------------*/
|
||||
/* 主题颜色 */
|
||||
/* 辅助色 */
|
||||
/* 文字颜色(默认浅色背景下 */
|
||||
/* 暗黑模式 */
|
||||
/* 图形颜色 */
|
||||
/*----------------------------------------- Theme color. end -------------------------------------------*/
|
||||
/*-------------------------------- Theme color application size. start --------------------------------*/
|
||||
/* 文字字号 */
|
||||
/* 文字字重 */
|
||||
/* 尺寸 */
|
||||
/*-------------------------------- Theme color application size. end --------------------------------*/
|
||||
/* component var */
|
||||
/* action-sheet */
|
||||
/* badge */
|
||||
/* button */
|
||||
/* cell */
|
||||
/* calendar */
|
||||
/* checkbox */
|
||||
/* collapse */
|
||||
/* divider */
|
||||
/* drop-menu */
|
||||
/* input-number */
|
||||
/* input */
|
||||
/* textarea */
|
||||
/* loadmore */
|
||||
/* message-box */
|
||||
/* notice-bar */
|
||||
/* pagination */
|
||||
/* picker */
|
||||
/* col-picker */
|
||||
/* overlay */
|
||||
/* popup */
|
||||
/* progress */
|
||||
/* radio */
|
||||
/* search */
|
||||
/* slider */
|
||||
/* sort-button */
|
||||
/* steps */
|
||||
/* switch */
|
||||
/* tabs */
|
||||
/* tag */
|
||||
/* toast */
|
||||
/* loading */
|
||||
/* tooltip */
|
||||
/* popover */
|
||||
/* grid-item */
|
||||
/* statustip */
|
||||
/* card */
|
||||
/* upload */
|
||||
/* curtain */
|
||||
/* notify */
|
||||
/* skeleton */
|
||||
/* circle */
|
||||
/* swiper */
|
||||
/* swiper-nav */
|
||||
/* segmented */
|
||||
/* tabbar */
|
||||
/* tabbar-item */
|
||||
/* navbar */
|
||||
/* navbar-capsule */
|
||||
/* table */
|
||||
/* sidebar */
|
||||
/* sidebar-item */
|
||||
/* fab */
|
||||
/* count-down */
|
||||
/* keyboard */
|
||||
/* number-keyboard */
|
||||
/* passwod-input */
|
||||
/* form-item */
|
||||
/* backtop */
|
||||
/* index-bar */
|
||||
/* text */
|
||||
/* video-preview */
|
||||
/* img-cropper */
|
||||
/* floating-panel */
|
||||
/* signature */
|
||||
.wot-theme-dark .wd-input-number__action.data-v-a2d9dd24 {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wot-theme-dark .wd-input-number__action.is-disabled.data-v-a2d9dd24 {
|
||||
color: var(--wot-dark-color-gray, var(--wot-color-secondary, #595959));
|
||||
}
|
||||
.wot-theme-dark .wd-input-number__input.data-v-a2d9dd24 {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wot-theme-dark .wd-input-number.is-disabled .wd-input-number__input.data-v-a2d9dd24 {
|
||||
color: var(--wot-dark-color-gray, var(--wot-color-secondary, #595959));
|
||||
}
|
||||
.wot-theme-dark .wd-input-number.is-disabled .wd-input-number__sub.data-v-a2d9dd24,
|
||||
.wot-theme-dark .wd-input-number.is-disabled .wd-input-number__add.data-v-a2d9dd24 {
|
||||
color: var(--wot-dark-color-gray, var(--wot-color-secondary, #595959));
|
||||
}
|
||||
.wd-input-number.data-v-a2d9dd24 {
|
||||
display: inline-block;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
line-height: 1.15;
|
||||
}
|
||||
.wd-input-number__action.data-v-a2d9dd24 {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: var(--wot-input-number-btn-width, 26px);
|
||||
height: var(--wot-input-number-height, 24px);
|
||||
vertical-align: middle;
|
||||
color: var(--wot-input-number-icon-color, rgba(0, 0, 0, 0.65));
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.wd-input-number__action.data-v-a2d9dd24::after {
|
||||
position: absolute;
|
||||
content: "";
|
||||
width: calc(200% - 2px);
|
||||
height: calc(200% - 2px);
|
||||
left: 0;
|
||||
top: 0;
|
||||
border: 1px solid var(--wot-input-number-border-color, #e8e8e8);
|
||||
border-top-left-radius: calc(var(--wot-input-number-radius, 4px) * 2);
|
||||
border-bottom-left-radius: calc(var(--wot-input-number-radius, 4px) * 2);
|
||||
transform: scale(0.5);
|
||||
transform-origin: left top;
|
||||
}
|
||||
.wd-input-number__action.data-v-a2d9dd24:last-child::after {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
border-top-right-radius: calc(var(--wot-input-number-radius, 4px) * 2);
|
||||
border-bottom-right-radius: calc(var(--wot-input-number-radius, 4px) * 2);
|
||||
}
|
||||
.wd-input-number__action.is-disabled.data-v-a2d9dd24 {
|
||||
color: var(--wot-input-number-disabled-color, rgba(0, 0, 0, 0.25));
|
||||
}
|
||||
.wd-input-number__inner.data-v-a2d9dd24 {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.wd-input-number__input.data-v-a2d9dd24 {
|
||||
position: relative;
|
||||
display: block;
|
||||
width: var(--wot-input-number-input-width, 36px);
|
||||
height: var(--wot-input-number-height, 24px);
|
||||
padding: 0 2px;
|
||||
box-sizing: border-box;
|
||||
z-index: 1;
|
||||
background: transparent;
|
||||
border: none;
|
||||
outline: none;
|
||||
text-align: center;
|
||||
color: var(--wot-input-number-color, #262626);
|
||||
font-size: var(--wot-input-number-fs, 12px);
|
||||
-webkit-appearance: none;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
.wd-input-number__input-border.data-v-a2d9dd24 {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: calc(200% - 2px);
|
||||
left: 0;
|
||||
top: 0;
|
||||
border-top: 1px solid var(--wot-input-number-border-color, #e8e8e8);
|
||||
border-bottom: 1px solid var(--wot-input-number-border-color, #e8e8e8);
|
||||
transform: scaleY(0.5);
|
||||
transform-origin: left top;
|
||||
z-index: 0;
|
||||
}
|
||||
.data-v-a2d9dd24 .wd-input-number__action-icon {
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
font-size: var(--wot-input-number-icon-size, 14px);
|
||||
width: var(--wot-input-number-icon-size, 14px);
|
||||
height: var(--wot-input-number-icon-size, 14px);
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
.wd-input-number.is-disabled .wd-input-number__input.data-v-a2d9dd24 {
|
||||
color: var(--wot-input-number-disabled-color, rgba(0, 0, 0, 0.25));
|
||||
z-index: inherit;
|
||||
}
|
||||
.wd-input-number.is-disabled .wd-input-number__sub.data-v-a2d9dd24,
|
||||
.wd-input-number.is-disabled .wd-input-number__add.data-v-a2d9dd24 {
|
||||
color: var(--wot-input-number-disabled-color, rgba(0, 0, 0, 0.25));
|
||||
}
|
||||
.wd-input-number.is-without-input .wd-input-number__action.data-v-a2d9dd24:last-child::after {
|
||||
border-left: none;
|
||||
}
|
||||
Reference in New Issue
Block a user