first commit
This commit is contained in:
24
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/common/AbortablePromise.js
vendored
Normal file
24
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/common/AbortablePromise.js
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
class AbortablePromise {
|
||||
constructor(executor) {
|
||||
this._reject = null;
|
||||
this.promise = new Promise((resolve, reject) => {
|
||||
executor(resolve, reject);
|
||||
this._reject = reject;
|
||||
});
|
||||
}
|
||||
// 提供abort方法来中止Promise
|
||||
abort(error) {
|
||||
if (this._reject) {
|
||||
this._reject(error);
|
||||
}
|
||||
}
|
||||
then(onfulfilled, onrejected) {
|
||||
return this.promise.then(onfulfilled, onrejected);
|
||||
}
|
||||
catch(onrejected) {
|
||||
return this.promise.catch(onrejected);
|
||||
}
|
||||
}
|
||||
exports.AbortablePromise = AbortablePromise;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/common/AbortablePromise.js.map
|
||||
28
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/common/base64.js
vendored
Normal file
28
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/common/base64.js
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
const _b64chars = [..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"];
|
||||
const _mkUriSafe = (src) => src.replace(/[+/]/g, (m0) => m0 === "+" ? "-" : "_").replace(/=+\$/m, "");
|
||||
const fromUint8Array = (src, rfc4648 = false) => {
|
||||
let b64 = "";
|
||||
for (let i = 0, l = src.length; i < l; i += 3) {
|
||||
const [a0, a1, a2] = [src[i], src[i + 1], src[i + 2]];
|
||||
const ord = a0 << 16 | a1 << 8 | a2;
|
||||
b64 += _b64chars[ord >>> 18];
|
||||
b64 += _b64chars[ord >>> 12 & 63];
|
||||
b64 += typeof a1 !== "undefined" ? _b64chars[ord >>> 6 & 63] : "=";
|
||||
b64 += typeof a2 !== "undefined" ? _b64chars[ord & 63] : "=";
|
||||
}
|
||||
return rfc4648 ? _mkUriSafe(b64) : b64;
|
||||
};
|
||||
const _btoa = typeof btoa === "function" ? (s) => btoa(s) : (s) => {
|
||||
if (s.charCodeAt(0) > 255) {
|
||||
throw new RangeError("The string contains invalid characters.");
|
||||
}
|
||||
return fromUint8Array(Uint8Array.from(s, (c) => c.charCodeAt(0)));
|
||||
};
|
||||
const utob = (src) => unescape(encodeURIComponent(src));
|
||||
function encode(src, rfc4648 = false) {
|
||||
const b64 = _btoa(utob(src));
|
||||
return rfc4648 ? _mkUriSafe(b64) : b64;
|
||||
}
|
||||
exports.encode = encode;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/common/base64.js.map
|
||||
2
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/common/clickoutside.js
vendored
Normal file
2
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/common/clickoutside.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/common/clickoutside.js.map
|
||||
31
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/common/interceptor.js
vendored
Normal file
31
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/common/interceptor.js
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
const uni_modules_wotDesignUni_components_common_util = require("./util.js");
|
||||
function noop() {
|
||||
}
|
||||
function callInterceptor(interceptor, {
|
||||
args = [],
|
||||
done,
|
||||
canceled,
|
||||
error
|
||||
}) {
|
||||
if (interceptor) {
|
||||
const returnVal = interceptor.apply(null, args);
|
||||
if (uni_modules_wotDesignUni_components_common_util.isPromise(returnVal)) {
|
||||
returnVal.then((value) => {
|
||||
if (value) {
|
||||
done();
|
||||
} else if (canceled) {
|
||||
canceled();
|
||||
}
|
||||
}).catch(error || noop);
|
||||
} else if (returnVal) {
|
||||
done();
|
||||
} else if (canceled) {
|
||||
canceled();
|
||||
}
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
exports.callInterceptor = callInterceptor;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/common/interceptor.js.map
|
||||
45
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/common/props.js
vendored
Normal file
45
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/common/props.js
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
const numericProp = [Number, String];
|
||||
const makeRequiredProp = (type) => ({
|
||||
type,
|
||||
required: true
|
||||
});
|
||||
const makeArrayProp = () => ({
|
||||
type: Array,
|
||||
default: () => []
|
||||
});
|
||||
const makeBooleanProp = (defaultVal) => ({
|
||||
type: Boolean,
|
||||
default: defaultVal
|
||||
});
|
||||
const makeNumberProp = (defaultVal) => ({
|
||||
type: Number,
|
||||
default: defaultVal
|
||||
});
|
||||
const makeNumericProp = (defaultVal) => ({
|
||||
type: numericProp,
|
||||
default: defaultVal
|
||||
});
|
||||
const makeStringProp = (defaultVal) => ({
|
||||
type: String,
|
||||
default: defaultVal
|
||||
});
|
||||
const baseProps = {
|
||||
/**
|
||||
* 自定义根节点样式
|
||||
*/
|
||||
customStyle: makeStringProp(""),
|
||||
/**
|
||||
* 自定义根节点样式类
|
||||
*/
|
||||
customClass: makeStringProp("")
|
||||
};
|
||||
exports.baseProps = baseProps;
|
||||
exports.makeArrayProp = makeArrayProp;
|
||||
exports.makeBooleanProp = makeBooleanProp;
|
||||
exports.makeNumberProp = makeNumberProp;
|
||||
exports.makeNumericProp = makeNumericProp;
|
||||
exports.makeRequiredProp = makeRequiredProp;
|
||||
exports.makeStringProp = makeStringProp;
|
||||
exports.numericProp = numericProp;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/common/props.js.map
|
||||
325
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/common/util.js
vendored
Normal file
325
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/common/util.js
vendored
Normal file
@@ -0,0 +1,325 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_wotDesignUni_components_common_AbortablePromise = require("./AbortablePromise.js");
|
||||
function uuid() {
|
||||
return s4() + s4() + s4() + s4() + s4() + s4() + s4() + s4();
|
||||
}
|
||||
function s4() {
|
||||
return Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
|
||||
}
|
||||
function addUnit(num) {
|
||||
return Number.isNaN(Number(num)) ? `${num}` : `${num}px`;
|
||||
}
|
||||
function isObj(value) {
|
||||
return Object.prototype.toString.call(value) === "[object Object]" || typeof value === "object";
|
||||
}
|
||||
function getType(target) {
|
||||
const typeStr = Object.prototype.toString.call(target);
|
||||
const match = typeStr.match(/\[object (\w+)\]/);
|
||||
const type = match && match.length ? match[1].toLowerCase() : "";
|
||||
return type;
|
||||
}
|
||||
const defaultDisplayFormat = function(items, kv) {
|
||||
const labelKey = (kv == null ? void 0 : kv.labelKey) || "value";
|
||||
if (Array.isArray(items)) {
|
||||
return items.map((item) => item[labelKey]).join(", ");
|
||||
} else {
|
||||
return items[labelKey];
|
||||
}
|
||||
};
|
||||
const isDef = (value) => value !== void 0 && value !== null;
|
||||
function rgbToHex(r, g, b) {
|
||||
const hex = (r << 16 | g << 8 | b).toString(16);
|
||||
const paddedHex = "#" + "0".repeat(Math.max(0, 6 - hex.length)) + hex;
|
||||
return paddedHex;
|
||||
}
|
||||
function hexToRgb(hex) {
|
||||
const rgb = [];
|
||||
for (let i = 1; i < 7; i += 2) {
|
||||
rgb.push(parseInt("0x" + hex.slice(i, i + 2), 16));
|
||||
}
|
||||
return rgb;
|
||||
}
|
||||
const gradient = (startColor, endColor, step = 2) => {
|
||||
const sColor = hexToRgb(startColor);
|
||||
const eColor = hexToRgb(endColor);
|
||||
const rStep = (eColor[0] - sColor[0]) / step;
|
||||
const gStep = (eColor[1] - sColor[1]) / step;
|
||||
const bStep = (eColor[2] - sColor[2]) / step;
|
||||
const gradientColorArr = [];
|
||||
for (let i = 0; i < step; i++) {
|
||||
gradientColorArr.push(
|
||||
rgbToHex(parseInt(String(rStep * i + sColor[0])), parseInt(String(gStep * i + sColor[1])), parseInt(String(bStep * i + sColor[2])))
|
||||
);
|
||||
}
|
||||
return gradientColorArr;
|
||||
};
|
||||
const range = (num, min, max) => {
|
||||
return Math.min(Math.max(num, min), max);
|
||||
};
|
||||
const isEqual = (value1, value2) => {
|
||||
if (value1 === value2) {
|
||||
return true;
|
||||
}
|
||||
if (!Array.isArray(value1) || !Array.isArray(value2)) {
|
||||
return false;
|
||||
}
|
||||
if (value1.length !== value2.length) {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < value1.length; ++i) {
|
||||
if (value1[i] !== value2[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const padZero = (number, length = 2) => {
|
||||
let numStr = number.toString();
|
||||
while (numStr.length < length) {
|
||||
numStr = "0" + numStr;
|
||||
}
|
||||
return numStr;
|
||||
};
|
||||
const context = {
|
||||
id: 1e3
|
||||
};
|
||||
function getRect(selector, all, scope, useFields) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let query = null;
|
||||
if (scope) {
|
||||
query = common_vendor.index.createSelectorQuery().in(scope);
|
||||
} else {
|
||||
query = common_vendor.index.createSelectorQuery();
|
||||
}
|
||||
const method = all ? "selectAll" : "select";
|
||||
const callback = (rect) => {
|
||||
if (all && isArray(rect) && rect.length > 0) {
|
||||
resolve(rect);
|
||||
} else if (!all && rect) {
|
||||
resolve(rect);
|
||||
} else {
|
||||
reject(new Error("No nodes found"));
|
||||
}
|
||||
};
|
||||
if (useFields) {
|
||||
query[method](selector).fields({ size: true, node: true }, callback).exec();
|
||||
} else {
|
||||
query[method](selector).boundingClientRect(callback).exec();
|
||||
}
|
||||
});
|
||||
}
|
||||
function kebabCase(word) {
|
||||
const newWord = word.replace(/[A-Z]/g, function(match) {
|
||||
return "-" + match;
|
||||
}).toLowerCase();
|
||||
return newWord;
|
||||
}
|
||||
function camelCase(word) {
|
||||
return word.replace(/-(\w)/g, (_, c) => c.toUpperCase());
|
||||
}
|
||||
function isArray(value) {
|
||||
if (typeof Array.isArray === "function") {
|
||||
return Array.isArray(value);
|
||||
}
|
||||
return Object.prototype.toString.call(value) === "[object Array]";
|
||||
}
|
||||
function isFunction(value) {
|
||||
return getType(value) === "function" || getType(value) === "asyncfunction";
|
||||
}
|
||||
function isString(value) {
|
||||
return getType(value) === "string";
|
||||
}
|
||||
function isNumber(value) {
|
||||
return getType(value) === "number";
|
||||
}
|
||||
function isPromise(value) {
|
||||
if (isObj(value) && isDef(value)) {
|
||||
return isFunction(value.then) && isFunction(value.catch);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isUndefined(value) {
|
||||
return typeof value === "undefined";
|
||||
}
|
||||
function objToStyle(styles) {
|
||||
if (isArray(styles)) {
|
||||
const result = styles.filter(function(item) {
|
||||
return item != null && item !== "";
|
||||
}).map(function(item) {
|
||||
return objToStyle(item);
|
||||
}).join(";");
|
||||
return result ? result.endsWith(";") ? result : result + ";" : "";
|
||||
}
|
||||
if (isString(styles)) {
|
||||
return styles ? styles.endsWith(";") ? styles : styles + ";" : "";
|
||||
}
|
||||
if (isObj(styles)) {
|
||||
const result = Object.keys(styles).filter(function(key) {
|
||||
return styles[key] != null && styles[key] !== "";
|
||||
}).map(function(key) {
|
||||
return [kebabCase(key), styles[key]].join(":");
|
||||
}).join(";");
|
||||
return result ? result.endsWith(";") ? result : result + ";" : "";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
const pause = (ms = 1e3 / 30) => {
|
||||
return new uni_modules_wotDesignUni_components_common_AbortablePromise.AbortablePromise((resolve) => {
|
||||
const timer = setTimeout(() => {
|
||||
clearTimeout(timer);
|
||||
resolve(true);
|
||||
}, ms);
|
||||
});
|
||||
};
|
||||
function deepClone(obj, cache = /* @__PURE__ */ new Map()) {
|
||||
if (obj === null || typeof obj !== "object") {
|
||||
return obj;
|
||||
}
|
||||
if (isDate(obj)) {
|
||||
return new Date(obj.getTime());
|
||||
}
|
||||
if (obj instanceof RegExp) {
|
||||
return new RegExp(obj.source, obj.flags);
|
||||
}
|
||||
if (obj instanceof Error) {
|
||||
const errorCopy = new Error(obj.message);
|
||||
errorCopy.stack = obj.stack;
|
||||
return errorCopy;
|
||||
}
|
||||
if (cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
const copy = Array.isArray(obj) ? [] : {};
|
||||
cache.set(obj, copy);
|
||||
for (const key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
copy[key] = deepClone(obj[key], cache);
|
||||
}
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
function deepMerge(target, source) {
|
||||
target = deepClone(target);
|
||||
if (typeof target !== "object" || typeof source !== "object") {
|
||||
throw new Error("Both target and source must be objects.");
|
||||
}
|
||||
for (const prop in source) {
|
||||
if (!source.hasOwnProperty(prop))
|
||||
continue;
|
||||
target[prop] = source[prop];
|
||||
}
|
||||
return target;
|
||||
}
|
||||
function deepAssign(target, source) {
|
||||
Object.keys(source).forEach((key) => {
|
||||
const targetValue = target[key];
|
||||
const newObjValue = source[key];
|
||||
if (isObj(targetValue) && isObj(newObjValue)) {
|
||||
deepAssign(targetValue, newObjValue);
|
||||
} else {
|
||||
target[key] = newObjValue;
|
||||
}
|
||||
});
|
||||
return target;
|
||||
}
|
||||
function debounce(func, wait, options = {}) {
|
||||
let timeoutId = null;
|
||||
let lastArgs;
|
||||
let lastThis;
|
||||
let result;
|
||||
const leading = isDef(options.leading) ? options.leading : false;
|
||||
const trailing = isDef(options.trailing) ? options.trailing : true;
|
||||
function invokeFunc() {
|
||||
if (lastArgs !== void 0) {
|
||||
result = func.apply(lastThis, lastArgs);
|
||||
lastArgs = void 0;
|
||||
}
|
||||
}
|
||||
function startTimer() {
|
||||
timeoutId = setTimeout(() => {
|
||||
timeoutId = null;
|
||||
if (trailing) {
|
||||
invokeFunc();
|
||||
}
|
||||
}, wait);
|
||||
}
|
||||
function cancelTimer() {
|
||||
if (timeoutId !== null) {
|
||||
clearTimeout(timeoutId);
|
||||
timeoutId = null;
|
||||
}
|
||||
}
|
||||
function debounced(...args) {
|
||||
lastArgs = args;
|
||||
lastThis = this;
|
||||
if (timeoutId === null) {
|
||||
if (leading) {
|
||||
invokeFunc();
|
||||
}
|
||||
startTimer();
|
||||
} else if (trailing) {
|
||||
cancelTimer();
|
||||
startTimer();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return debounced;
|
||||
}
|
||||
const getPropByPath = (obj, path) => {
|
||||
const keys = path.split(".");
|
||||
try {
|
||||
return keys.reduce((acc, key) => acc !== void 0 && acc !== null ? acc[key] : void 0, obj);
|
||||
} catch (error) {
|
||||
return void 0;
|
||||
}
|
||||
};
|
||||
const isDate = (val) => Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
|
||||
function isVideoUrl(url) {
|
||||
const videoRegex = /\.(ogm|webm|ogv|asx|m4v|mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv|video)(?=$|[?#])/i;
|
||||
return videoRegex.test(url);
|
||||
}
|
||||
function isImageUrl(url) {
|
||||
const imageRegex = /\.(xbm|tif|pjp|apng|svgz|jpeg|jpg|heif|ico|tiff|heic|pjpeg|avif|gif|png|svg|webp|jfif|bmp|dpg|image)(?=$|[?#])/i;
|
||||
return imageRegex.test(url);
|
||||
}
|
||||
const isH5 = /* @__PURE__ */ (() => {
|
||||
let isH52 = false;
|
||||
return isH52;
|
||||
})();
|
||||
function omitBy(obj, predicate) {
|
||||
const newObj = deepClone(obj);
|
||||
Object.keys(newObj).forEach((key) => predicate(newObj[key], key) && delete newObj[key]);
|
||||
return newObj;
|
||||
}
|
||||
exports.addUnit = addUnit;
|
||||
exports.camelCase = camelCase;
|
||||
exports.context = context;
|
||||
exports.debounce = debounce;
|
||||
exports.deepAssign = deepAssign;
|
||||
exports.deepClone = deepClone;
|
||||
exports.deepMerge = deepMerge;
|
||||
exports.defaultDisplayFormat = defaultDisplayFormat;
|
||||
exports.getPropByPath = getPropByPath;
|
||||
exports.getRect = getRect;
|
||||
exports.getType = getType;
|
||||
exports.gradient = gradient;
|
||||
exports.isArray = isArray;
|
||||
exports.isDef = isDef;
|
||||
exports.isEqual = isEqual;
|
||||
exports.isFunction = isFunction;
|
||||
exports.isH5 = isH5;
|
||||
exports.isImageUrl = isImageUrl;
|
||||
exports.isNumber = isNumber;
|
||||
exports.isObj = isObj;
|
||||
exports.isPromise = isPromise;
|
||||
exports.isString = isString;
|
||||
exports.isUndefined = isUndefined;
|
||||
exports.isVideoUrl = isVideoUrl;
|
||||
exports.objToStyle = objToStyle;
|
||||
exports.omitBy = omitBy;
|
||||
exports.padZero = padZero;
|
||||
exports.pause = pause;
|
||||
exports.range = range;
|
||||
exports.uuid = uuid;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/common/util.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/composables/index.js
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/composables/index.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
require("../../../../common/vendor.js");
|
||||
require("../../locale/index.js");
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/composables/index.js.map
|
||||
13
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/composables/useCell.js
vendored
Normal file
13
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/composables/useCell.js
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_wotDesignUni_components_composables_useParent = require("./useParent.js");
|
||||
const uni_modules_wotDesignUni_components_wdCellGroup_types = require("../wd-cell-group/types.js");
|
||||
function useCell() {
|
||||
const { parent: cellGroup, index } = uni_modules_wotDesignUni_components_composables_useParent.useParent(uni_modules_wotDesignUni_components_wdCellGroup_types.CELL_GROUP_KEY);
|
||||
const border = common_vendor.computed(() => {
|
||||
return cellGroup && cellGroup.props.border && index.value;
|
||||
});
|
||||
return { border };
|
||||
}
|
||||
exports.useCell = useCell;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/composables/useCell.js.map
|
||||
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
require("../../../../common/vendor.js");
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/composables/useChildren.js.map
|
||||
92
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/composables/useCountDown.js
vendored
Normal file
92
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/composables/useCountDown.js
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
"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_composables_useRaf = require("./useRaf.js");
|
||||
const SECOND = 1e3;
|
||||
const MINUTE = 60 * SECOND;
|
||||
const HOUR = 60 * MINUTE;
|
||||
const DAY = 24 * HOUR;
|
||||
function parseTime(time) {
|
||||
const days = Math.floor(time / DAY);
|
||||
const hours = Math.floor(time % DAY / HOUR);
|
||||
const minutes = Math.floor(time % HOUR / MINUTE);
|
||||
const seconds = Math.floor(time % MINUTE / SECOND);
|
||||
const milliseconds = Math.floor(time % SECOND);
|
||||
return {
|
||||
total: time,
|
||||
days,
|
||||
hours,
|
||||
minutes,
|
||||
seconds,
|
||||
milliseconds
|
||||
};
|
||||
}
|
||||
function isSameSecond(time1, time2) {
|
||||
return Math.floor(time1 / 1e3) === Math.floor(time2 / 1e3);
|
||||
}
|
||||
function useCountDown(options) {
|
||||
let endTime;
|
||||
let counting;
|
||||
const { start: startRaf, cancel: cancelRaf } = uni_modules_wotDesignUni_components_composables_useRaf.useRaf(tick);
|
||||
const remain = common_vendor.ref(options.time);
|
||||
const current = common_vendor.computed(() => parseTime(remain.value));
|
||||
const pause = () => {
|
||||
counting = false;
|
||||
cancelRaf();
|
||||
};
|
||||
const getCurrentRemain = () => Math.max(endTime - Date.now(), 0);
|
||||
const setRemain = (value) => {
|
||||
remain.value = value;
|
||||
uni_modules_wotDesignUni_components_common_util.isDef(options.onChange) && options.onChange(current.value);
|
||||
if (value === 0) {
|
||||
pause();
|
||||
uni_modules_wotDesignUni_components_common_util.isDef(options.onFinish) && options.onFinish();
|
||||
}
|
||||
};
|
||||
const microTick = () => {
|
||||
if (counting) {
|
||||
setRemain(getCurrentRemain());
|
||||
if (remain.value > 0) {
|
||||
startRaf();
|
||||
}
|
||||
}
|
||||
};
|
||||
const macroTick = () => {
|
||||
if (counting) {
|
||||
const remainRemain = getCurrentRemain();
|
||||
if (!isSameSecond(remainRemain, remain.value) || remainRemain === 0) {
|
||||
setRemain(remainRemain);
|
||||
}
|
||||
if (remain.value > 0) {
|
||||
startRaf();
|
||||
}
|
||||
}
|
||||
};
|
||||
function tick() {
|
||||
if (options.millisecond) {
|
||||
microTick();
|
||||
} else {
|
||||
macroTick();
|
||||
}
|
||||
}
|
||||
const start = () => {
|
||||
if (!counting) {
|
||||
endTime = Date.now() + remain.value;
|
||||
counting = true;
|
||||
startRaf();
|
||||
}
|
||||
};
|
||||
const reset = (totalTime = options.time) => {
|
||||
pause();
|
||||
remain.value = totalTime;
|
||||
};
|
||||
common_vendor.onBeforeUnmount(pause);
|
||||
return {
|
||||
start,
|
||||
pause,
|
||||
reset,
|
||||
current
|
||||
};
|
||||
}
|
||||
exports.useCountDown = useCountDown;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/composables/useCountDown.js.map
|
||||
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
require("../../../../common/vendor.js");
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/composables/useLockScroll.js.map
|
||||
22
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/composables/useParent.js
vendored
Normal file
22
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/composables/useParent.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
function useParent(key) {
|
||||
const parent = common_vendor.inject(key, null);
|
||||
if (parent) {
|
||||
const instance = common_vendor.getCurrentInstance();
|
||||
const { link, unlink, internalChildren } = parent;
|
||||
link(instance);
|
||||
common_vendor.onUnmounted(() => unlink(instance));
|
||||
const index = common_vendor.computed(() => internalChildren.indexOf(instance));
|
||||
return {
|
||||
parent,
|
||||
index
|
||||
};
|
||||
}
|
||||
return {
|
||||
parent: null,
|
||||
index: common_vendor.ref(-1)
|
||||
};
|
||||
}
|
||||
exports.useParent = useParent;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/composables/useParent.js.map
|
||||
3
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/composables/usePopover.js
vendored
Normal file
3
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/composables/usePopover.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
require("../../../../common/vendor.js");
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/composables/usePopover.js.map
|
||||
3
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/composables/useQueue.js
vendored
Normal file
3
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/composables/useQueue.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
require("../../../../common/vendor.js");
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/composables/useQueue.js.map
|
||||
29
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/composables/useRaf.js
vendored
Normal file
29
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/composables/useRaf.js
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_wotDesignUni_components_common_util = require("../common/util.js");
|
||||
function useRaf(callback) {
|
||||
const requestRef = common_vendor.ref(null);
|
||||
const start = () => {
|
||||
const handle = (time) => {
|
||||
callback(time);
|
||||
};
|
||||
if (uni_modules_wotDesignUni_components_common_util.isH5) {
|
||||
requestRef.value = requestAnimationFrame(handle);
|
||||
} else {
|
||||
requestRef.value = setTimeout(() => handle(Date.now()), 1e3 / 30);
|
||||
}
|
||||
};
|
||||
const cancel = () => {
|
||||
if (uni_modules_wotDesignUni_components_common_util.isH5 && uni_modules_wotDesignUni_components_common_util.isNumber(requestRef.value)) {
|
||||
cancelAnimationFrame(requestRef.value);
|
||||
} else if (uni_modules_wotDesignUni_components_common_util.isDef(requestRef.value)) {
|
||||
clearTimeout(requestRef.value);
|
||||
}
|
||||
};
|
||||
common_vendor.onUnmounted(() => {
|
||||
cancel();
|
||||
});
|
||||
return { start, cancel };
|
||||
}
|
||||
exports.useRaf = useRaf;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/composables/useRaf.js.map
|
||||
3
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/composables/useTouch.js
vendored
Normal file
3
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/composables/useTouch.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
require("../../../../common/vendor.js");
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/composables/useTouch.js.map
|
||||
14
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/composables/useTranslate.js
vendored
Normal file
14
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/composables/useTranslate.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
const uni_modules_wotDesignUni_components_common_util = require("../common/util.js");
|
||||
const uni_modules_wotDesignUni_locale_index = require("../../locale/index.js");
|
||||
const useTranslate = (name) => {
|
||||
const prefix = name ? uni_modules_wotDesignUni_components_common_util.camelCase(name) + "." : "";
|
||||
const translate = (key, ...args) => {
|
||||
const currentMessages = uni_modules_wotDesignUni_locale_index.Locale.messages();
|
||||
const message = uni_modules_wotDesignUni_components_common_util.getPropByPath(currentMessages, prefix + key);
|
||||
return uni_modules_wotDesignUni_components_common_util.isFunction(message) ? message(...args) : uni_modules_wotDesignUni_components_common_util.isDef(message) ? message : `${prefix}${key}`;
|
||||
};
|
||||
return { translate };
|
||||
};
|
||||
exports.useTranslate = useTranslate;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/composables/useTranslate.js.map
|
||||
3
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/composables/useUpload.js
vendored
Normal file
3
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/composables/useUpload.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
require("../../../../common/vendor.js");
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/composables/useUpload.js.map
|
||||
96
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-button/types.js
vendored
Normal file
96
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-button/types.js
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
"use strict";
|
||||
const uni_modules_wotDesignUni_components_common_props = require("../common/props.js");
|
||||
const buttonProps = {
|
||||
...uni_modules_wotDesignUni_components_common_props.baseProps,
|
||||
/**
|
||||
* 幽灵按钮
|
||||
*/
|
||||
plain: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 圆角按钮
|
||||
*/
|
||||
round: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 禁用按钮
|
||||
*/
|
||||
disabled: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 是否细边框
|
||||
*/
|
||||
hairline: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 块状按钮
|
||||
*/
|
||||
block: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 按钮类型,可选值:primary / success / info / warning / error / text / icon
|
||||
*/
|
||||
type: uni_modules_wotDesignUni_components_common_props.makeStringProp("primary"),
|
||||
/**
|
||||
* 按钮尺寸,可选值:small / medium / large
|
||||
*/
|
||||
size: uni_modules_wotDesignUni_components_common_props.makeStringProp("medium"),
|
||||
/**
|
||||
* 图标类名
|
||||
*/
|
||||
icon: String,
|
||||
/**
|
||||
* 类名前缀,用于使用自定义图标,用法参考Icon组件
|
||||
*/
|
||||
classPrefix: uni_modules_wotDesignUni_components_common_props.makeStringProp("wd-icon"),
|
||||
/**
|
||||
* 加载中按钮
|
||||
*/
|
||||
loading: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 加载图标颜色
|
||||
*/
|
||||
loadingColor: String,
|
||||
/**
|
||||
* 开放能力
|
||||
*/
|
||||
openType: String,
|
||||
/**
|
||||
* 指定是否阻止本节点的祖先节点出现点击态
|
||||
*/
|
||||
hoverStopPropagation: Boolean,
|
||||
/**
|
||||
* 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文
|
||||
*/
|
||||
lang: String,
|
||||
/**
|
||||
* 会话来源,open-type="contact"时有效
|
||||
*/
|
||||
sessionFrom: String,
|
||||
/**
|
||||
* 会话内消息卡片标题,open-type="contact"时有效
|
||||
*/
|
||||
sendMessageTitle: String,
|
||||
/**
|
||||
* 会话内消息卡片点击跳转小程序路径,open-type="contact"时有效
|
||||
*/
|
||||
sendMessagePath: String,
|
||||
/**
|
||||
* 会话内消息卡片图片,open-type="contact"时有效
|
||||
*/
|
||||
sendMessageImg: String,
|
||||
/**
|
||||
* 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效
|
||||
*/
|
||||
appParameter: String,
|
||||
/**
|
||||
* 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息,open-type="contact"时有效
|
||||
*/
|
||||
showMessageCard: Boolean,
|
||||
/**
|
||||
* 按钮的唯一标识,可用于设置隐私同意授权按钮的id
|
||||
*/
|
||||
buttonId: String,
|
||||
/**
|
||||
* 支付宝小程序,当 open-type 为 getAuthorize 时有效。
|
||||
* 可选值:'phoneNumber' | 'userInfo'
|
||||
*/
|
||||
scope: String
|
||||
};
|
||||
exports.buttonProps = buttonProps;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-button/types.js.map
|
||||
172
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-button/wd-button.js
vendored
Normal file
172
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-button/wd-button.js
vendored
Normal file
@@ -0,0 +1,172 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_wotDesignUni_components_common_base64 = require("../common/base64.js");
|
||||
const uni_modules_wotDesignUni_components_wdButton_types = require("./types.js");
|
||||
if (!Math) {
|
||||
wdIcon();
|
||||
}
|
||||
const wdIcon = () => "../wd-icon/wd-icon.js";
|
||||
const __default__ = {
|
||||
name: "wd-button",
|
||||
options: {
|
||||
addGlobalClass: true,
|
||||
virtualHost: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
};
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: uni_modules_wotDesignUni_components_wdButton_types.buttonProps,
|
||||
emits: [
|
||||
"click",
|
||||
"getuserinfo",
|
||||
"contact",
|
||||
"getphonenumber",
|
||||
"getrealtimephonenumber",
|
||||
"error",
|
||||
"launchapp",
|
||||
"opensetting",
|
||||
"chooseavatar",
|
||||
"agreeprivacyauthorization"
|
||||
],
|
||||
setup(__props, { emit: __emit }) {
|
||||
const loadingIcon = (color = "#4D80F0", reverse = true) => {
|
||||
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42 42"><defs><linearGradient x1="100%" y1="0%" x2="0%" y2="0%" id="a"><stop stop-color="${reverse ? color : "#fff"}" offset="0%" stop-opacity="0"/><stop stop-color="${reverse ? color : "#fff"}" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path d="M21 1c11.046 0 20 8.954 20 20s-8.954 20-20 20S1 32.046 1 21 9.954 1 21 1zm0 7C13.82 8 8 13.82 8 21s5.82 13 13 13 13-5.82 13-13S28.18 8 21 8z" fill="${reverse ? "#fff" : color}"/><path d="M4.599 21c0 9.044 7.332 16.376 16.376 16.376 9.045 0 16.376-7.332 16.376-16.376" stroke="url(#a)" stroke-width="3.5" stroke-linecap="round"/></g></svg>`;
|
||||
};
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const hoverStartTime = common_vendor.ref(20);
|
||||
const hoverStayTime = common_vendor.ref(70);
|
||||
const loadingIconSvg = common_vendor.ref("");
|
||||
const loadingStyle = common_vendor.computed(() => {
|
||||
return `background-image: url(${loadingIconSvg.value});`;
|
||||
});
|
||||
common_vendor.watch(
|
||||
() => props.loading,
|
||||
() => {
|
||||
buildLoadingSvg();
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
function handleClick(event) {
|
||||
if (!props.disabled && !props.loading) {
|
||||
emit("click", event);
|
||||
}
|
||||
}
|
||||
function handleGetAuthorize(event) {
|
||||
if (props.scope === "phoneNumber") {
|
||||
handleGetphonenumber(event);
|
||||
} else if (props.scope === "userInfo") {
|
||||
handleGetuserinfo(event);
|
||||
}
|
||||
}
|
||||
function handleGetuserinfo(event) {
|
||||
emit("getuserinfo", event.detail);
|
||||
}
|
||||
function handleConcat(event) {
|
||||
emit("contact", event.detail);
|
||||
}
|
||||
function handleGetphonenumber(event) {
|
||||
emit("getphonenumber", event.detail);
|
||||
}
|
||||
function handleGetrealtimephonenumber(event) {
|
||||
emit("getrealtimephonenumber", event.detail);
|
||||
}
|
||||
function handleError(event) {
|
||||
emit("error", event.detail);
|
||||
}
|
||||
function handleLaunchapp(event) {
|
||||
emit("launchapp", event.detail);
|
||||
}
|
||||
function handleOpensetting(event) {
|
||||
emit("opensetting", event.detail);
|
||||
}
|
||||
function handleChooseavatar(event) {
|
||||
emit("chooseavatar", event.detail);
|
||||
}
|
||||
function handleAgreePrivacyAuthorization(event) {
|
||||
emit("agreeprivacyauthorization", event.detail);
|
||||
}
|
||||
function buildLoadingSvg() {
|
||||
const { loadingColor, type, plain } = props;
|
||||
let color = loadingColor;
|
||||
if (!color) {
|
||||
switch (type) {
|
||||
case "primary":
|
||||
color = "#4D80F0";
|
||||
break;
|
||||
case "success":
|
||||
color = "#34d19d";
|
||||
break;
|
||||
case "info":
|
||||
color = "#333";
|
||||
break;
|
||||
case "warning":
|
||||
color = "#f0883a";
|
||||
break;
|
||||
case "error":
|
||||
color = "#fa4350";
|
||||
break;
|
||||
case "default":
|
||||
color = "#333";
|
||||
break;
|
||||
}
|
||||
}
|
||||
const svg = loadingIcon(color, !plain);
|
||||
loadingIconSvg.value = `"data:image/svg+xml;base64,${uni_modules_wotDesignUni_components_common_base64.encode(svg)}"`;
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: _ctx.loading
|
||||
}, _ctx.loading ? {
|
||||
b: common_vendor.s(loadingStyle.value)
|
||||
} : _ctx.icon ? {
|
||||
d: common_vendor.p({
|
||||
["custom-class"]: "wd-button__icon",
|
||||
name: _ctx.icon,
|
||||
classPrefix: _ctx.classPrefix
|
||||
})
|
||||
} : {}, {
|
||||
c: _ctx.icon,
|
||||
e: _ctx.buttonId,
|
||||
f: `${_ctx.disabled || _ctx.loading ? "" : "wd-button--active"}`,
|
||||
g: common_vendor.s(_ctx.customStyle),
|
||||
h: common_vendor.n("is-" + _ctx.type),
|
||||
i: common_vendor.n("is-" + _ctx.size),
|
||||
j: common_vendor.n(_ctx.round ? "is-round" : ""),
|
||||
k: common_vendor.n(_ctx.hairline ? "is-hairline" : ""),
|
||||
l: common_vendor.n(_ctx.plain ? "is-plain" : ""),
|
||||
m: common_vendor.n(_ctx.disabled ? "is-disabled" : ""),
|
||||
n: common_vendor.n(_ctx.block ? "is-block" : ""),
|
||||
o: common_vendor.n(_ctx.loading ? "is-loading" : ""),
|
||||
p: common_vendor.n(_ctx.customClass),
|
||||
q: hoverStartTime.value,
|
||||
r: hoverStayTime.value,
|
||||
s: _ctx.disabled || _ctx.loading ? void 0 : _ctx.openType,
|
||||
t: _ctx.sendMessageTitle,
|
||||
v: _ctx.sendMessagePath,
|
||||
w: _ctx.sendMessageImg,
|
||||
x: _ctx.appParameter,
|
||||
y: _ctx.showMessageCard,
|
||||
z: _ctx.sessionFrom,
|
||||
A: _ctx.lang,
|
||||
B: _ctx.hoverStopPropagation,
|
||||
C: _ctx.scope,
|
||||
D: common_vendor.o(handleClick),
|
||||
E: common_vendor.o(handleGetAuthorize),
|
||||
F: common_vendor.o(handleGetuserinfo),
|
||||
G: common_vendor.o(handleConcat),
|
||||
H: common_vendor.o(handleGetphonenumber),
|
||||
I: common_vendor.o(handleGetrealtimephonenumber),
|
||||
J: common_vendor.o(handleError),
|
||||
K: common_vendor.o(handleLaunchapp),
|
||||
L: common_vendor.o(handleOpensetting),
|
||||
M: common_vendor.o(handleChooseavatar),
|
||||
N: common_vendor.o(handleAgreePrivacyAuthorization)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-d858c170"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-button/wd-button.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-button/wd-button.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-button/wd-button.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"wd-icon": "../wd-icon/wd-icon"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-button/wd-button.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-button/wd-button.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<button id="{{e}}" hover-class="{{f}}" style="{{g}}" class="{{['data-v-d858c170', 'wd-button', h, i, j, k, l, m, n, o, p]}}" hover-start-time="{{q}}" hover-stay-time="{{r}}" open-type="{{s}}" send-message-title="{{t}}" send-message-path="{{v}}" send-message-img="{{w}}" app-parameter="{{x}}" show-message-card="{{y}}" session-from="{{z}}" lang="{{A}}" hover-stop-propagation="{{B}}" scope="{{C}}" bindtap="{{D}}" bindgetAuthorize="{{E}}" bindgetuserinfo="{{F}}" bindcontact="{{G}}" bindgetphonenumber="{{H}}" bindgetrealtimephonenumber="{{I}}" binderror="{{J}}" bindlaunchapp="{{K}}" bindopensetting="{{L}}" bindchooseavatar="{{M}}" bindagreeprivacyauthorization="{{N}}"><view class="wd-button__content data-v-d858c170"><view wx:if="{{a}}" class="wd-button__loading data-v-d858c170"><view class="wd-button__loading-svg data-v-d858c170" style="{{b}}"></view></view><wd-icon wx:elif="{{c}}" class="data-v-d858c170" u-i="d858c170-0" bind:__l="__l" u-p="{{d}}"></wd-icon><view class="wd-button__text data-v-d858c170"><slot/></view></view></button>
|
||||
430
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-button/wd-button.wxss
vendored
Normal file
430
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-button/wd-button.wxss
vendored
Normal file
@@ -0,0 +1,430 @@
|
||||
/* 水平间距 */
|
||||
/* 水平间距 */
|
||||
/**
|
||||
* 混合宏
|
||||
*/
|
||||
/**
|
||||
* 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-button.is-info.data-v-d858c170 {
|
||||
background: var(--wot-dark-background4, #323233);
|
||||
color: var(--wot-dark-color3, rgba(232, 230, 227, 0.8));
|
||||
}
|
||||
.wot-theme-dark .wd-button.is-plain.data-v-d858c170 {
|
||||
background: transparent;
|
||||
}
|
||||
.wot-theme-dark .wd-button.is-plain.is-info.data-v-d858c170 {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wot-theme-dark .wd-button.is-plain.is-info.data-v-d858c170::after {
|
||||
border-color: var(--wot-dark-background5, #646566);
|
||||
}
|
||||
.wot-theme-dark .wd-button.is-text.is-disabled.data-v-d858c170 {
|
||||
color: var(--wot-dark-color-gray, var(--wot-color-secondary, #595959));
|
||||
background: transparent;
|
||||
}
|
||||
.wot-theme-dark .wd-button.is-icon.data-v-d858c170 {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wot-theme-dark .wd-button.is-icon.is-disabled.data-v-d858c170 {
|
||||
color: var(--wot-dark-color-gray, var(--wot-color-secondary, #595959));
|
||||
background: transparent;
|
||||
}
|
||||
.wd-button.data-v-d858c170 {
|
||||
margin-left: initial;
|
||||
margin-right: initial;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
outline: none;
|
||||
-webkit-appearance: none;
|
||||
outline: none;
|
||||
background: transparent;
|
||||
box-sizing: border-box;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
color: var(--wot-button-normal-color, var(--wot-color-title, var(--wot-color-black, black)));
|
||||
transition: opacity 0.2s;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
font-weight: normal;
|
||||
}
|
||||
.wd-button.data-v-d858c170::before {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: var(--wot-color-black, black);
|
||||
border: inherit;
|
||||
border-color: var(--wot-color-black, black);
|
||||
border-radius: inherit;
|
||||
transform: translate(-50%, -50%);
|
||||
opacity: 0;
|
||||
content: " ";
|
||||
}
|
||||
.wd-button.data-v-d858c170::after {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
.wd-button__content.data-v-d858c170 {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
}
|
||||
.wd-button--active.data-v-d858c170:active::before {
|
||||
opacity: 0.15;
|
||||
}
|
||||
.wd-button.is-disabled.data-v-d858c170 {
|
||||
opacity: var(--wot-button-disabled-opacity, 0.6);
|
||||
}
|
||||
.wd-button__loading.data-v-d858c170 {
|
||||
margin-right: 5px;
|
||||
animation: wd-rotate-d858c170 0.8s linear infinite;
|
||||
animation-duration: 2s;
|
||||
}
|
||||
.wd-button__loading-svg.data-v-d858c170 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.wd-button.is-primary.data-v-d858c170 {
|
||||
background: var(--wot-button-primary-bg-color, var(--wot-color-theme, #4d80f0));
|
||||
color: var(--wot-button-primary-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wd-button.is-success.data-v-d858c170 {
|
||||
background: var(--wot-button-success-bg-color, var(--wot-color-success, #34d19d));
|
||||
color: var(--wot-button-success-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wd-button.is-info.data-v-d858c170 {
|
||||
background: var(--wot-button-info-bg-color, #f0f0f0);
|
||||
color: var(--wot-button-info-color, var(--wot-color-title, var(--wot-color-black, black)));
|
||||
}
|
||||
.wd-button.is-warning.data-v-d858c170 {
|
||||
background: var(--wot-button-warning-bg-color, var(--wot-color-warning, #f0883a));
|
||||
color: var(--wot-button-warning-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wd-button.is-error.data-v-d858c170 {
|
||||
background: var(--wot-button-error-bg-color, var(--wot-color-danger, #fa4350));
|
||||
color: var(--wot-button-error-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wd-button.is-small.data-v-d858c170 {
|
||||
height: var(--wot-button-small-height, 28px);
|
||||
padding: var(--wot-button-small-padding, 0 12px);
|
||||
border-radius: var(--wot-button-small-radius, 2px);
|
||||
font-size: var(--wot-button-small-fs, var(--wot-fs-secondary, 12px));
|
||||
font-weight: normal;
|
||||
}
|
||||
.wd-button.is-small .wd-button__loading.data-v-d858c170 {
|
||||
width: var(--wot-button-small-loading, 14px);
|
||||
height: var(--wot-button-small-loading, 14px);
|
||||
}
|
||||
.wd-button.is-medium.data-v-d858c170 {
|
||||
height: var(--wot-button-medium-height, 36px);
|
||||
padding: var(--wot-button-medium-padding, 0 16px);
|
||||
border-radius: var(--wot-button-medium-radius, 4px);
|
||||
font-size: var(--wot-button-medium-fs, var(--wot-fs-content, 14px));
|
||||
min-width: 120px;
|
||||
}
|
||||
.wd-button.is-medium.is-round.is-icon.data-v-d858c170 {
|
||||
min-width: 0;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.wd-button.is-medium.is-round.is-text.data-v-d858c170 {
|
||||
border-radius: 0;
|
||||
min-width: 0;
|
||||
}
|
||||
.wd-button.is-medium .wd-button__loading.data-v-d858c170 {
|
||||
width: var(--wot-button-medium-loading, 18px);
|
||||
height: var(--wot-button-medium-loading, 18px);
|
||||
}
|
||||
.wd-button.is-large.data-v-d858c170 {
|
||||
height: var(--wot-button-large-height, 44px);
|
||||
padding: var(--wot-button-large-padding, 0 36px);
|
||||
border-radius: var(--wot-button-large-radius, 8px);
|
||||
font-size: var(--wot-button-large-fs, var(--wot-fs-title, 16px));
|
||||
}
|
||||
.wd-button.is-large.data-v-d858c170::after {
|
||||
border-radius: var(--wot-button-large-radius, 8px);
|
||||
}
|
||||
.wd-button.is-large .wd-button__loading.data-v-d858c170 {
|
||||
width: var(--wot-button-large-loading, 24px);
|
||||
height: var(--wot-button-large-loading, 24px);
|
||||
}
|
||||
.wd-button.is-round.data-v-d858c170 {
|
||||
border-radius: 999px;
|
||||
}
|
||||
.wd-button.is-text.data-v-d858c170 {
|
||||
color: var(--wot-button-primary-bg-color, var(--wot-color-theme, #4d80f0));
|
||||
min-width: 0;
|
||||
padding: 4px 0;
|
||||
}
|
||||
.wd-button.is-text.data-v-d858c170::after {
|
||||
display: none;
|
||||
}
|
||||
.wd-button.is-text.wd-button--active.data-v-d858c170 {
|
||||
opacity: var(--wot-button-text-hover-opacity, 0.7);
|
||||
}
|
||||
.wd-button.is-text.wd-button--active.data-v-d858c170:active::before {
|
||||
display: none;
|
||||
}
|
||||
.wd-button.is-text.is-disabled.data-v-d858c170 {
|
||||
color: var(--wot-button-normal-disabled-color, rgba(0, 0, 0, 0.25));
|
||||
background: transparent;
|
||||
}
|
||||
.wd-button.is-plain.data-v-d858c170 {
|
||||
background: var(--wot-button-plain-bg-color, var(--wot-color-white, white));
|
||||
border: 1px solid currentColor;
|
||||
}
|
||||
.wd-button.is-plain.is-primary.data-v-d858c170 {
|
||||
color: var(--wot-button-primary-bg-color, var(--wot-color-theme, #4d80f0));
|
||||
}
|
||||
.wd-button.is-plain.is-success.data-v-d858c170 {
|
||||
color: var(--wot-button-success-bg-color, var(--wot-color-success, #34d19d));
|
||||
}
|
||||
.wd-button.is-plain.is-info.data-v-d858c170 {
|
||||
color: var(--wot-button-info-plain-normal-color, rgba(0, 0, 0, 0.85));
|
||||
border-color: var(--wot-button-info-plain-border-color, rgba(0, 0, 0, 0.45));
|
||||
}
|
||||
.wd-button.is-plain.is-warning.data-v-d858c170 {
|
||||
color: var(--wot-button-warning-bg-color, var(--wot-color-warning, #f0883a));
|
||||
}
|
||||
.wd-button.is-plain.is-error.data-v-d858c170 {
|
||||
color: var(--wot-button-error-bg-color, var(--wot-color-danger, #fa4350));
|
||||
}
|
||||
.wd-button.is-hairline.data-v-d858c170 {
|
||||
border-width: 0;
|
||||
}
|
||||
.wd-button.is-hairline.is-plain.data-v-d858c170 {
|
||||
position: relative;
|
||||
}
|
||||
.wd-button.is-hairline.is-plain.data-v-d858c170::after {
|
||||
position: absolute;
|
||||
display: block;
|
||||
content: " ";
|
||||
pointer-events: none;
|
||||
width: 200%;
|
||||
height: 200%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
border: 1px solid var(--wot-color-border-light, #e8e8e8);
|
||||
transform: scale(0.5);
|
||||
box-sizing: border-box;
|
||||
transform-origin: left top;
|
||||
}
|
||||
.wd-button.is-hairline.is-plain.data-v-d858c170::before {
|
||||
border-radius: inherit;
|
||||
}
|
||||
.wd-button.is-hairline.is-plain.data-v-d858c170::after {
|
||||
border-color: inherit;
|
||||
}
|
||||
.wd-button.is-hairline.is-plain.is-round.data-v-d858c170::after {
|
||||
border-radius: inherit !important;
|
||||
}
|
||||
.wd-button.is-hairline.is-plain.is-large.data-v-d858c170::after {
|
||||
border-radius: calc(2 * var(--wot-button-large-radius, 8px));
|
||||
}
|
||||
.wd-button.is-hairline.is-plain.is-medium.data-v-d858c170::after {
|
||||
border-radius: calc(2 * var(--wot-button-medium-radius, 4px));
|
||||
}
|
||||
.wd-button.is-hairline.is-plain.is-small.data-v-d858c170::after {
|
||||
border-radius: calc(2 * var(--wot-button-small-radius, 2px));
|
||||
}
|
||||
.wd-button.is-block.data-v-d858c170 {
|
||||
display: block;
|
||||
}
|
||||
.wd-button.is-icon.data-v-d858c170 {
|
||||
width: var(--wot-button-icon-size, 40px);
|
||||
height: var(--wot-button-icon-size, 40px);
|
||||
padding: 0;
|
||||
border-radius: 50%;
|
||||
color: var(--wot-button-icon-color, rgba(0, 0, 0, 0.65));
|
||||
}
|
||||
.wd-button.is-icon.data-v-d858c170::after {
|
||||
display: none;
|
||||
}
|
||||
.wd-button.is-icon.data-v-d858c170 .wd-button__icon {
|
||||
margin-right: 0;
|
||||
}
|
||||
.wd-button.is-icon.is-disabled.data-v-d858c170 {
|
||||
color: var(--wot-button-icon-disabled-color, var(--wot-color-icon-disabled, #a7a7a7));
|
||||
background: transparent;
|
||||
}
|
||||
.data-v-d858c170 .wd-button__icon {
|
||||
display: block;
|
||||
margin-right: 6px;
|
||||
font-size: var(--wot-button-icon-fs, 18px);
|
||||
vertical-align: middle;
|
||||
}
|
||||
.wd-button__text.data-v-d858c170 {
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
@keyframes wd-rotate-d858c170 {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
4
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-cell-group/types.js
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-cell-group/types.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
const CELL_GROUP_KEY = Symbol("wd-cell-group");
|
||||
exports.CELL_GROUP_KEY = CELL_GROUP_KEY;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-cell-group/types.js.map
|
||||
108
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-cell/types.js
vendored
Normal file
108
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-cell/types.js
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
"use strict";
|
||||
const uni_modules_wotDesignUni_components_common_props = require("../common/props.js");
|
||||
const cellProps = {
|
||||
...uni_modules_wotDesignUni_components_common_props.baseProps,
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
title: String,
|
||||
/**
|
||||
* 右侧内容
|
||||
*/
|
||||
value: uni_modules_wotDesignUni_components_common_props.makeNumericProp(""),
|
||||
/**
|
||||
* 图标类名
|
||||
*/
|
||||
icon: String,
|
||||
/**
|
||||
* 图标大小
|
||||
*/
|
||||
iconSize: uni_modules_wotDesignUni_components_common_props.numericProp,
|
||||
/**
|
||||
* 描述信息
|
||||
*/
|
||||
label: String,
|
||||
/**
|
||||
* 是否为跳转链接
|
||||
*/
|
||||
isLink: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 跳转地址
|
||||
*/
|
||||
to: String,
|
||||
/**
|
||||
* 跳转时是否替换栈顶页面
|
||||
*/
|
||||
replace: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 开启点击反馈,is-link 默认开启
|
||||
*/
|
||||
clickable: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 设置单元格大小,可选值:large
|
||||
*/
|
||||
size: String,
|
||||
/**
|
||||
* 是否展示边框线
|
||||
*/
|
||||
border: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(void 0),
|
||||
/**
|
||||
* 设置左侧标题宽度
|
||||
*/
|
||||
titleWidth: String,
|
||||
/**
|
||||
* 是否垂直居中,默认顶部居中
|
||||
*/
|
||||
center: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 是否必填
|
||||
*/
|
||||
required: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 表单属性,上下结构
|
||||
*/
|
||||
vertical: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 表单域 model 字段名,在使用表单校验功能的情况下,该属性是必填的
|
||||
*/
|
||||
prop: String,
|
||||
/**
|
||||
* 表单验证规则,结合wd-form组件使用
|
||||
*/
|
||||
rules: uni_modules_wotDesignUni_components_common_props.makeArrayProp(),
|
||||
/**
|
||||
* icon 使用 slot 时的自定义样式
|
||||
*/
|
||||
customIconClass: uni_modules_wotDesignUni_components_common_props.makeStringProp(""),
|
||||
/**
|
||||
* label 使用 slot 时的自定义样式
|
||||
*/
|
||||
customLabelClass: uni_modules_wotDesignUni_components_common_props.makeStringProp(""),
|
||||
/**
|
||||
* value 使用 slot 时的自定义样式
|
||||
*/
|
||||
customValueClass: uni_modules_wotDesignUni_components_common_props.makeStringProp(""),
|
||||
/**
|
||||
* title 使用 slot 时的自定义样式
|
||||
*/
|
||||
customTitleClass: uni_modules_wotDesignUni_components_common_props.makeStringProp(""),
|
||||
/**
|
||||
* value 文字对齐方式,可选值:left、right、center
|
||||
*/
|
||||
valueAlign: uni_modules_wotDesignUni_components_common_props.makeStringProp("right"),
|
||||
/**
|
||||
* 是否超出隐藏,显示省略号
|
||||
*/
|
||||
ellipsis: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 是否启用title插槽,默认启用,用来解决插槽传递时v-slot和v-if冲突问题。
|
||||
* 问题见:https://github.com/dcloudio/uni-app/issues/4847
|
||||
*/
|
||||
useTitleSlot: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 必填标记位置,可选值:before(标签前)、after(标签后)
|
||||
*/
|
||||
markerSide: uni_modules_wotDesignUni_components_common_props.makeStringProp("before")
|
||||
};
|
||||
exports.cellProps = cellProps;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-cell/types.js.map
|
||||
127
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-cell/wd-cell.js
vendored
Normal file
127
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-cell/wd-cell.js
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_wotDesignUni_components_composables_useCell = require("../composables/useCell.js");
|
||||
const uni_modules_wotDesignUni_components_composables_useParent = require("../composables/useParent.js");
|
||||
const uni_modules_wotDesignUni_components_wdForm_types = require("../wd-form/types.js");
|
||||
const uni_modules_wotDesignUni_components_wdCell_types = require("./types.js");
|
||||
const uni_modules_wotDesignUni_components_common_util = require("../common/util.js");
|
||||
if (!Math) {
|
||||
wdIcon();
|
||||
}
|
||||
const wdIcon = () => "../wd-icon/wd-icon.js";
|
||||
const __default__ = {
|
||||
name: "wd-cell",
|
||||
options: {
|
||||
addGlobalClass: true,
|
||||
virtualHost: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
};
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: uni_modules_wotDesignUni_components_wdCell_types.cellProps,
|
||||
emits: ["click"],
|
||||
setup(__props, { emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const slots = common_vendor.useSlots();
|
||||
const cell = uni_modules_wotDesignUni_components_composables_useCell.useCell();
|
||||
const isBorder = common_vendor.computed(() => {
|
||||
return Boolean(uni_modules_wotDesignUni_components_common_util.isDef(props.border) ? props.border : cell.border.value);
|
||||
});
|
||||
const { parent: form } = uni_modules_wotDesignUni_components_composables_useParent.useParent(uni_modules_wotDesignUni_components_wdForm_types.FORM_KEY);
|
||||
const errorMessage = common_vendor.computed(() => {
|
||||
if (form && props.prop && form.errorMessages && form.errorMessages[props.prop]) {
|
||||
return form.errorMessages[props.prop];
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
});
|
||||
const isRequired = common_vendor.computed(() => {
|
||||
let formRequired = false;
|
||||
if (form && form.props.rules) {
|
||||
const rules = form.props.rules;
|
||||
for (const key in rules) {
|
||||
if (Object.prototype.hasOwnProperty.call(rules, key) && key === props.prop && Array.isArray(rules[key])) {
|
||||
formRequired = rules[key].some((rule) => rule.required);
|
||||
}
|
||||
}
|
||||
}
|
||||
return props.required || props.rules.some((rule) => rule.required) || formRequired;
|
||||
});
|
||||
const showLeft = common_vendor.computed(() => {
|
||||
const hasIcon = slots.icon || props.icon;
|
||||
const hasTitle = slots.title && props.useTitleSlot || props.title;
|
||||
const hasLabel = slots.label || props.label;
|
||||
return hasIcon || hasTitle || hasLabel;
|
||||
});
|
||||
function onClick() {
|
||||
const url = props.to;
|
||||
if (props.clickable || props.isLink) {
|
||||
emit("click");
|
||||
}
|
||||
if (url && props.isLink) {
|
||||
if (props.replace) {
|
||||
common_vendor.index.redirectTo({ url });
|
||||
} else {
|
||||
common_vendor.index.navigateTo({ url });
|
||||
}
|
||||
}
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: showLeft.value
|
||||
}, showLeft.value ? common_vendor.e({
|
||||
b: isRequired.value && _ctx.markerSide === "before"
|
||||
}, isRequired.value && _ctx.markerSide === "before" ? {} : {}, {
|
||||
c: _ctx.icon
|
||||
}, _ctx.icon ? {
|
||||
d: common_vendor.p({
|
||||
name: _ctx.icon,
|
||||
size: _ctx.iconSize,
|
||||
["custom-class"]: `wd-cell__icon ${_ctx.customIconClass}`
|
||||
})
|
||||
} : {}, {
|
||||
e: _ctx.useTitleSlot && _ctx.$slots.title
|
||||
}, _ctx.useTitleSlot && _ctx.$slots.title ? {} : _ctx.title ? {
|
||||
g: common_vendor.t(_ctx.title),
|
||||
h: common_vendor.n(_ctx.customTitleClass)
|
||||
} : {}, {
|
||||
f: _ctx.title,
|
||||
i: _ctx.label
|
||||
}, _ctx.label ? {
|
||||
j: common_vendor.t(_ctx.label),
|
||||
k: common_vendor.n(`wd-cell__label ${_ctx.customLabelClass}`)
|
||||
} : {}, {
|
||||
l: isRequired.value && _ctx.markerSide === "after"
|
||||
}, isRequired.value && _ctx.markerSide === "after" ? {} : {}, {
|
||||
m: common_vendor.s(_ctx.titleWidth ? "min-width:" + _ctx.titleWidth + ";max-width:" + _ctx.titleWidth + ";" : "")
|
||||
}) : {}, {
|
||||
n: common_vendor.t(_ctx.value),
|
||||
o: common_vendor.n(`wd-cell__value ${_ctx.customValueClass} wd-cell__value--${_ctx.valueAlign} ${_ctx.ellipsis ? "wd-cell__value--ellipsis" : ""}`),
|
||||
p: _ctx.isLink
|
||||
}, _ctx.isLink ? {
|
||||
q: common_vendor.p({
|
||||
["custom-class"]: "wd-cell__arrow-right",
|
||||
name: "arrow-right"
|
||||
})
|
||||
} : {}, {
|
||||
r: errorMessage.value
|
||||
}, errorMessage.value ? {
|
||||
s: common_vendor.t(errorMessage.value)
|
||||
} : {}, {
|
||||
t: common_vendor.n(_ctx.vertical ? "is-vertical" : ""),
|
||||
v: common_vendor.n(isBorder.value ? "is-border" : ""),
|
||||
w: common_vendor.n(_ctx.size ? "is-" + _ctx.size : ""),
|
||||
x: common_vendor.n(_ctx.center ? "is-center" : ""),
|
||||
y: common_vendor.n(_ctx.customClass),
|
||||
z: common_vendor.s(_ctx.customStyle),
|
||||
A: _ctx.isLink || _ctx.clickable ? "is-hover" : "none",
|
||||
B: common_vendor.o(onClick)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f1c5bbe2"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-cell/wd-cell.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-cell/wd-cell.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-cell/wd-cell.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"wd-icon": "../wd-icon/wd-icon"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-cell/wd-cell.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-cell/wd-cell.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['data-v-f1c5bbe2', 'wd-cell', v, w, x, y]}}" style="{{z}}" hover-class="{{A}}" hover-stay-time="{{70}}" bindtap="{{B}}"><view class="{{['data-v-f1c5bbe2', 'wd-cell__wrapper', t]}}"><view wx:if="{{a}}" class="wd-cell__left data-v-f1c5bbe2" style="{{m}}"><text wx:if="{{b}}" class="wd-cell__required wd-cell__required--left data-v-f1c5bbe2">*</text><block wx:if="{{$slots.icon}}"><slot name="icon"></slot></block><block wx:else><wd-icon wx:if="{{c}}" class="data-v-f1c5bbe2" u-i="f1c5bbe2-0" bind:__l="__l" u-p="{{d}}"></wd-icon></block><view class="wd-cell__title data-v-f1c5bbe2"><slot wx:if="{{e}}" name="title"></slot><text wx:elif="{{f}}" class="{{['data-v-f1c5bbe2', h]}}">{{g}}</text><block wx:if="{{$slots.label}}"><slot name="label"></slot></block><block wx:else><view wx:if="{{i}}" class="{{['data-v-f1c5bbe2', k]}}">{{j}}</view></block></view><text wx:if="{{l}}" class="wd-cell__required data-v-f1c5bbe2">*</text></view><view class="wd-cell__right data-v-f1c5bbe2"><view class="wd-cell__body data-v-f1c5bbe2"><view class="{{['data-v-f1c5bbe2', o]}}"><block wx:if="{{$slots.d}}"><slot></slot></block><block wx:else>{{n}}</block></view><wd-icon wx:if="{{p}}" class="data-v-f1c5bbe2" u-i="f1c5bbe2-1" bind:__l="__l" u-p="{{q}}"/><slot wx:else name="right-icon"/></view><view wx:if="{{r}}" class="wd-cell__error-message data-v-f1c5bbe2">{{s}}</view></view></view></view>
|
||||
348
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-cell/wd-cell.wxss
vendored
Normal file
348
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-cell/wd-cell.wxss
vendored
Normal file
@@ -0,0 +1,348 @@
|
||||
/* 水平间距 */
|
||||
/* 水平间距 */
|
||||
/**
|
||||
* 辅助函数
|
||||
*/
|
||||
/**
|
||||
* 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 */
|
||||
/**
|
||||
* 混合宏
|
||||
*/
|
||||
/**
|
||||
* 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 阴影
|
||||
*/
|
||||
.wot-theme-dark .wd-cell.data-v-f1c5bbe2 {
|
||||
background-color: var(--wot-dark-background2, #1b1b1b);
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wot-theme-dark .wd-cell__value.data-v-f1c5bbe2 {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wot-theme-dark .wd-cell__label.data-v-f1c5bbe2 {
|
||||
color: var(--wot-dark-color3, rgba(232, 230, 227, 0.8));
|
||||
}
|
||||
.wot-theme-dark .wd-cell.is-hover.data-v-f1c5bbe2 {
|
||||
background-color: var(--wot-dark-background4, #323233);
|
||||
}
|
||||
.wot-theme-dark .wd-cell.is-border .wd-cell__wrapper.data-v-f1c5bbe2 {
|
||||
position: relative;
|
||||
}
|
||||
.wot-theme-dark .wd-cell.is-border .wd-cell__wrapper.data-v-f1c5bbe2::after {
|
||||
position: absolute;
|
||||
display: block;
|
||||
content: "";
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
left: 0;
|
||||
top: 0;
|
||||
transform: scaleY(0.5);
|
||||
background: var(--wot-dark-border-color, #3a3a3c);
|
||||
}
|
||||
.wot-theme-dark .wd-cell.data-v-f1c5bbe2 .wd-cell__arrow-right {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wd-cell.data-v-f1c5bbe2 {
|
||||
position: relative;
|
||||
padding-left: var(--wot-cell-padding, var(--wot-size-side-padding, 15px));
|
||||
background-color: var(--wot-color-white, white);
|
||||
text-decoration: none;
|
||||
color: var(--wot-cell-title-color, rgba(0, 0, 0, 0.85));
|
||||
line-height: var(--wot-cell-line-height, 24px);
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.wd-cell.is-border .wd-cell__wrapper.data-v-f1c5bbe2 {
|
||||
position: relative;
|
||||
}
|
||||
.wd-cell.is-border .wd-cell__wrapper.data-v-f1c5bbe2::after {
|
||||
position: absolute;
|
||||
display: block;
|
||||
content: "";
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
left: 0;
|
||||
top: 0;
|
||||
transform: scaleY(0.5);
|
||||
background: var(--wot-color-border-light, #e8e8e8);
|
||||
}
|
||||
.wd-cell__wrapper.data-v-f1c5bbe2 {
|
||||
position: relative;
|
||||
display: flex;
|
||||
padding: var(--wot-cell-wrapper-padding, 10px) var(--wot-cell-padding, var(--wot-size-side-padding, 15px)) var(--wot-cell-wrapper-padding, 10px) 0;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
overflow: hidden;
|
||||
}
|
||||
.wd-cell__wrapper.is-vertical.data-v-f1c5bbe2 {
|
||||
display: block;
|
||||
}
|
||||
.wd-cell__wrapper.is-vertical .wd-cell__right.data-v-f1c5bbe2 {
|
||||
margin-top: var(--wot-cell-vertical-top, 16px);
|
||||
}
|
||||
.wd-cell__wrapper.is-vertical .wd-cell__value.data-v-f1c5bbe2 {
|
||||
text-align: left;
|
||||
}
|
||||
.wd-cell__wrapper.is-vertical .wd-cell__left.data-v-f1c5bbe2 {
|
||||
margin-right: 0;
|
||||
}
|
||||
.wd-cell__wrapper.is-label.data-v-f1c5bbe2 {
|
||||
padding: var(--wot-cell-wrapper-padding-with-label, 16px) var(--wot-cell-padding, var(--wot-size-side-padding, 15px)) var(--wot-cell-wrapper-padding-with-label, 16px) 0;
|
||||
}
|
||||
.wd-cell__left.data-v-f1c5bbe2 {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
text-align: left;
|
||||
font-size: var(--wot-cell-title-fs, 14px);
|
||||
box-sizing: border-box;
|
||||
margin-right: var(--wot-cell-padding, var(--wot-size-side-padding, 15px));
|
||||
}
|
||||
.wd-cell__right.data-v-f1c5bbe2 {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
.wd-cell__title.data-v-f1c5bbe2 {
|
||||
font-size: var(--wot-cell-title-fs, 14px);
|
||||
}
|
||||
.wd-cell__required.data-v-f1c5bbe2 {
|
||||
font-size: var(--wot-cell-required-size, 18px);
|
||||
color: var(--wot-cell-required-color, var(--wot-color-danger, #fa4350));
|
||||
margin-left: var(--wot-cell-required-margin, 4px);
|
||||
}
|
||||
.wd-cell__required--left.data-v-f1c5bbe2 {
|
||||
margin-left: 0;
|
||||
margin-right: var(--wot-cell-required-margin, 4px);
|
||||
}
|
||||
.wd-cell__label.data-v-f1c5bbe2 {
|
||||
margin-top: 2px;
|
||||
font-size: var(--wot-cell-label-fs, 12px);
|
||||
color: var(--wot-cell-label-color, rgba(0, 0, 0, 0.45));
|
||||
}
|
||||
.data-v-f1c5bbe2 .wd-cell__icon {
|
||||
display: block;
|
||||
position: relative;
|
||||
margin-right: var(--wot-cell-icon-right, 4px);
|
||||
font-size: var(--wot-cell-icon-size, 16px);
|
||||
height: var(--wot-cell-line-height, 24px);
|
||||
line-height: var(--wot-cell-line-height, 24px);
|
||||
}
|
||||
.wd-cell__body.data-v-f1c5bbe2 {
|
||||
display: flex;
|
||||
min-width: 0;
|
||||
}
|
||||
.wd-cell__value.data-v-f1c5bbe2 {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
font-size: var(--wot-cell-value-fs, 14px);
|
||||
color: var(--wot-cell-value-color, rgba(0, 0, 0, 0.85));
|
||||
vertical-align: middle;
|
||||
}
|
||||
.wd-cell__value--left.data-v-f1c5bbe2 {
|
||||
text-align: left;
|
||||
}
|
||||
.wd-cell__value--right.data-v-f1c5bbe2 {
|
||||
text-align: right;
|
||||
}
|
||||
.wd-cell__value--ellipsis.data-v-f1c5bbe2 {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
min-width: 0;
|
||||
}
|
||||
.data-v-f1c5bbe2 .wd-cell__arrow-right {
|
||||
display: block;
|
||||
margin-left: 8px;
|
||||
width: var(--wot-cell-arrow-size, 18px);
|
||||
font-size: var(--wot-cell-arrow-size, 18px);
|
||||
color: var(--wot-cell-arrow-color, rgba(0, 0, 0, 0.25));
|
||||
height: var(--wot-cell-line-height, 24px);
|
||||
line-height: var(--wot-cell-line-height, 24px);
|
||||
}
|
||||
.wd-cell__error-message.data-v-f1c5bbe2 {
|
||||
color: var(--wot-form-item-error-message-color, var(--wot-color-danger, #fa4350));
|
||||
font-size: var(--wot-form-item-error-message-font-size, var(--wot-fs-secondary, 12px));
|
||||
line-height: var(--wot-form-item-error-message-line-height, 24px);
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.wd-cell.is-link.data-v-f1c5bbe2 {
|
||||
-webkit-tap-highlight-color: var(--wot-cell-tap-bg, rgba(0, 0, 0, 0.06));
|
||||
}
|
||||
.wd-cell.is-hover.data-v-f1c5bbe2 {
|
||||
background-color: var(--wot-cell-tap-bg, rgba(0, 0, 0, 0.06));
|
||||
}
|
||||
.wd-cell.is-large .wd-cell__title.data-v-f1c5bbe2 {
|
||||
font-size: var(--wot-cell-title-fs-large, 16px);
|
||||
}
|
||||
.wd-cell.is-large .wd-cell__wrapper.data-v-f1c5bbe2 {
|
||||
padding-top: var(--wot-cell-wrapper-padding-large, 12px);
|
||||
padding-bottom: var(--wot-cell-wrapper-padding-large, 12px);
|
||||
}
|
||||
.wd-cell.is-large .wd-cell__label.data-v-f1c5bbe2 {
|
||||
font-size: var(--wot-cell-label-fs-large, 14px);
|
||||
}
|
||||
.wd-cell.is-large .wd-cell__value.data-v-f1c5bbe2 {
|
||||
font-size: var(--wot-cell-value-fs-large, 16px);
|
||||
}
|
||||
.wd-cell.is-large.data-v-f1c5bbe2 .wd-cell__icon {
|
||||
font-size: var(--wot-cell-icon-size-large, 18px);
|
||||
}
|
||||
.wd-cell.is-center .wd-cell__wrapper.data-v-f1c5bbe2 {
|
||||
align-items: center;
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
"use strict";
|
||||
const uni_modules_wotDesignUni_components_common_props = require("../common/props.js");
|
||||
const datetimePickerViewProps = {
|
||||
...uni_modules_wotDesignUni_components_common_props.baseProps,
|
||||
/**
|
||||
* 选中项,当 type 为 time 时,类型为字符串,否则为 时间戳
|
||||
*/
|
||||
modelValue: uni_modules_wotDesignUni_components_common_props.makeRequiredProp([String, Number]),
|
||||
/**
|
||||
* 加载中
|
||||
*/
|
||||
loading: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 加载的颜色,只能使用十六进制的色值写法,且不能使用缩写
|
||||
*/
|
||||
loadingColor: uni_modules_wotDesignUni_components_common_props.makeStringProp("#4D80F0"),
|
||||
/**
|
||||
* picker内部滚筒高
|
||||
*/
|
||||
columnsHeight: uni_modules_wotDesignUni_components_common_props.makeNumberProp(217),
|
||||
/**
|
||||
* picker item的高度
|
||||
*/
|
||||
itemHeight: uni_modules_wotDesignUni_components_common_props.makeNumberProp(35),
|
||||
/**
|
||||
* 选项的key
|
||||
*/
|
||||
valueKey: uni_modules_wotDesignUni_components_common_props.makeStringProp("value"),
|
||||
/**
|
||||
* 选项的label
|
||||
*/
|
||||
labelKey: uni_modules_wotDesignUni_components_common_props.makeStringProp("label"),
|
||||
/**
|
||||
* 选择器类型,可选值:date / year-month / time
|
||||
*/
|
||||
type: uni_modules_wotDesignUni_components_common_props.makeStringProp("datetime"),
|
||||
/**
|
||||
* 自定义过滤选项的函数,返回列的选项数组
|
||||
*/
|
||||
filter: Function,
|
||||
/**
|
||||
* 自定义弹出层选项文案的格式化函数,返回一个字符串
|
||||
*/
|
||||
formatter: Function,
|
||||
/**
|
||||
* 自定义列的格式化函数
|
||||
*/
|
||||
columnFormatter: Function,
|
||||
/**
|
||||
* 最小日期
|
||||
*/
|
||||
minDate: uni_modules_wotDesignUni_components_common_props.makeNumberProp(new Date((/* @__PURE__ */ new Date()).getFullYear() - 10, 0, 1).getTime()),
|
||||
/**
|
||||
* 最大日期
|
||||
*/
|
||||
maxDate: uni_modules_wotDesignUni_components_common_props.makeNumberProp(new Date((/* @__PURE__ */ new Date()).getFullYear() + 10, 11, 31).getTime()),
|
||||
/**
|
||||
* 最小小时,time类型时生效
|
||||
*/
|
||||
minHour: uni_modules_wotDesignUni_components_common_props.makeNumberProp(0),
|
||||
/**
|
||||
* 最大小时,time类型时生效
|
||||
*/
|
||||
maxHour: uni_modules_wotDesignUni_components_common_props.makeNumberProp(23),
|
||||
/**
|
||||
* 最小分钟,time类型时生效
|
||||
*/
|
||||
minMinute: uni_modules_wotDesignUni_components_common_props.makeNumberProp(0),
|
||||
/**
|
||||
* 最大分钟,time类型时生效
|
||||
*/
|
||||
maxMinute: uni_modules_wotDesignUni_components_common_props.makeNumberProp(59),
|
||||
/**
|
||||
* 是否显示秒选择,仅在 time 和 datetime 类型下生效
|
||||
*/
|
||||
useSecond: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 最小秒数,仅在 time 和 datetime 类型下生效
|
||||
*/
|
||||
minSecond: uni_modules_wotDesignUni_components_common_props.makeNumberProp(0),
|
||||
/**
|
||||
* 最大秒数,仅在 time 和 datetime 类型下生效
|
||||
*/
|
||||
maxSecond: uni_modules_wotDesignUni_components_common_props.makeNumberProp(59),
|
||||
/**
|
||||
* 是否在手指松开时立即触发picker-view的 change 事件。若不开启则会在滚动动画结束后触发 change 事件,1.2.25版本起提供,仅微信小程序和支付宝小程序支持。
|
||||
*/
|
||||
immediateChange: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false)
|
||||
};
|
||||
exports.datetimePickerViewProps = datetimePickerViewProps;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-datetime-picker-view/types.js.map
|
||||
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
function getPickerValue(value, type, useSecond = false) {
|
||||
const values = [];
|
||||
const date = new Date(value);
|
||||
if (type === "time") {
|
||||
const pair = String(value).split(":");
|
||||
values.push(parseInt(pair[0]), parseInt(pair[1]));
|
||||
if (useSecond && pair[2]) {
|
||||
values.push(parseInt(pair[2]));
|
||||
}
|
||||
} else {
|
||||
values.push(date.getFullYear(), date.getMonth() + 1);
|
||||
if (type === "date") {
|
||||
values.push(date.getDate());
|
||||
} else if (type === "datetime") {
|
||||
values.push(date.getDate(), date.getHours(), date.getMinutes());
|
||||
if (useSecond) {
|
||||
values.push(date.getSeconds());
|
||||
}
|
||||
}
|
||||
}
|
||||
return values;
|
||||
}
|
||||
exports.getPickerValue = getPickerValue;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-datetime-picker-view/util.js.map
|
||||
@@ -0,0 +1,394 @@
|
||||
"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_wdDatetimePickerView_types = require("./types.js");
|
||||
const uni_modules_wotDesignUni_components_wdDatetimePickerView_util = require("./util.js");
|
||||
if (!Math) {
|
||||
wdPickerView();
|
||||
}
|
||||
const wdPickerView = () => "../wd-picker-view/wd-picker-view.js";
|
||||
const __default__ = {
|
||||
name: "wd-datetime-picker-view",
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
};
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: uni_modules_wotDesignUni_components_wdDatetimePickerView_types.datetimePickerViewProps,
|
||||
emits: ["change", "pickstart", "pickend", "update:modelValue"],
|
||||
setup(__props, { expose: __expose, emit: __emit }) {
|
||||
const isValidDate = (date) => uni_modules_wotDesignUni_components_common_util.isDef(date) && !Number.isNaN(date);
|
||||
const times = (n, iteratee) => {
|
||||
let index = -1;
|
||||
const length = n < 0 ? 0 : n;
|
||||
const result = Array(length);
|
||||
while (++index < n) {
|
||||
result[index] = iteratee(index);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
const getMonthEndDay = (year, month) => {
|
||||
return 32 - new Date(year, month - 1, 32).getDate();
|
||||
};
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const datePickerview = common_vendor.ref();
|
||||
const innerValue = common_vendor.ref(null);
|
||||
const columns = common_vendor.ref([]);
|
||||
const pickerValue = common_vendor.ref([]);
|
||||
const created = common_vendor.ref(false);
|
||||
const { proxy } = common_vendor.getCurrentInstance();
|
||||
const updateValue = uni_modules_wotDesignUni_components_common_util.debounce(() => {
|
||||
if (!created.value)
|
||||
return;
|
||||
const val = correctValue(props.modelValue);
|
||||
const isEqual = val === innerValue.value;
|
||||
if (!isEqual) {
|
||||
updateColumnValue(val);
|
||||
} else {
|
||||
columns.value = updateColumns();
|
||||
}
|
||||
}, 50);
|
||||
common_vendor.watch(
|
||||
() => props.modelValue,
|
||||
(val, oldVal) => {
|
||||
if (val === oldVal)
|
||||
return;
|
||||
const value = correctValue(val);
|
||||
updateColumnValue(value);
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
common_vendor.watch(
|
||||
() => props.type,
|
||||
(target) => {
|
||||
const type = ["date", "year-month", "time", "datetime", "year"];
|
||||
if (type.indexOf(target) === -1) {
|
||||
common_vendor.index.__f__("error", "at uni_modules/wot-design-uni/components/wd-datetime-picker-view/wd-datetime-picker-view.vue:110", `type must be one of ${type}`);
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
common_vendor.watch(
|
||||
[
|
||||
() => props.type,
|
||||
() => props.filter,
|
||||
() => props.formatter,
|
||||
() => props.columnFormatter,
|
||||
() => props.minDate,
|
||||
() => props.maxDate,
|
||||
() => props.minHour,
|
||||
() => props.maxHour,
|
||||
() => props.minMinute,
|
||||
() => props.maxMinute,
|
||||
() => props.minSecond,
|
||||
() => props.maxSecond,
|
||||
() => props.useSecond
|
||||
],
|
||||
() => {
|
||||
updateValue();
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
common_vendor.onBeforeMount(() => {
|
||||
created.value = true;
|
||||
const innerValue2 = correctValue(props.modelValue);
|
||||
updateColumnValue(innerValue2);
|
||||
});
|
||||
function onChange({ value }) {
|
||||
pickerValue.value = value;
|
||||
const result = updateInnerValue();
|
||||
emit("update:modelValue", result);
|
||||
emit("change", {
|
||||
value: result,
|
||||
picker: proxy.$.exposed
|
||||
});
|
||||
}
|
||||
function updateColumns() {
|
||||
const { formatter, columnFormatter } = props;
|
||||
if (columnFormatter) {
|
||||
return columnFormatter(proxy.$.exposed);
|
||||
} else {
|
||||
return getOriginColumns().map((column) => {
|
||||
return column.values.map((value) => {
|
||||
return {
|
||||
label: formatter ? formatter(column.type, uni_modules_wotDesignUni_components_common_util.padZero(value)) : uni_modules_wotDesignUni_components_common_util.padZero(value),
|
||||
value
|
||||
};
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
function setColumns(columnList) {
|
||||
columns.value = columnList;
|
||||
}
|
||||
function getOriginColumns() {
|
||||
const { filter } = props;
|
||||
return getRanges().map(({ type, range: range2 }) => {
|
||||
let values = times(range2[1] - range2[0] + 1, (index) => {
|
||||
return range2[0] + index;
|
||||
});
|
||||
if (filter) {
|
||||
values = filter(type, values);
|
||||
}
|
||||
return {
|
||||
type,
|
||||
values
|
||||
};
|
||||
});
|
||||
}
|
||||
function getRanges() {
|
||||
if (props.type === "time") {
|
||||
const result2 = [
|
||||
{
|
||||
type: "hour",
|
||||
range: [props.minHour, props.maxHour]
|
||||
},
|
||||
{
|
||||
type: "minute",
|
||||
range: [props.minMinute, props.maxMinute]
|
||||
}
|
||||
];
|
||||
if (props.useSecond) {
|
||||
result2.push({
|
||||
type: "second",
|
||||
range: [props.minSecond, props.maxSecond]
|
||||
});
|
||||
}
|
||||
return result2;
|
||||
}
|
||||
const { maxYear, maxDate, maxMonth, maxHour, maxMinute, maxSecond } = getBoundary("max", innerValue.value);
|
||||
const { minYear, minDate, minMonth, minHour, minMinute, minSecond } = getBoundary("min", innerValue.value);
|
||||
const result = [
|
||||
{
|
||||
type: "year",
|
||||
range: [minYear, maxYear]
|
||||
},
|
||||
{
|
||||
type: "month",
|
||||
range: [minMonth, maxMonth]
|
||||
},
|
||||
{
|
||||
type: "date",
|
||||
range: [minDate, maxDate]
|
||||
},
|
||||
{
|
||||
type: "hour",
|
||||
range: [minHour, maxHour]
|
||||
},
|
||||
{
|
||||
type: "minute",
|
||||
range: [minMinute, maxMinute]
|
||||
}
|
||||
];
|
||||
if (props.type === "datetime" && props.useSecond) {
|
||||
result.push({
|
||||
type: "second",
|
||||
range: [minSecond, maxSecond]
|
||||
});
|
||||
}
|
||||
if (props.type === "date")
|
||||
result.splice(3, 2);
|
||||
if (props.type === "year-month")
|
||||
result.splice(2, 3);
|
||||
if (props.type === "year")
|
||||
result.splice(1, 4);
|
||||
return result;
|
||||
}
|
||||
function correctValue(value) {
|
||||
const isDateType = props.type !== "time";
|
||||
if (isDateType && !isValidDate(value)) {
|
||||
value = props.minDate;
|
||||
} else if (!isDateType && !value) {
|
||||
value = props.useSecond ? `${uni_modules_wotDesignUni_components_common_util.padZero(props.minHour)}:00:00` : `${uni_modules_wotDesignUni_components_common_util.padZero(props.minHour)}:00`;
|
||||
}
|
||||
if (!isDateType) {
|
||||
let [hour, minute, second = "00"] = (uni_modules_wotDesignUni_components_common_util.isString(value) ? value : value.toString()).split(":");
|
||||
hour = uni_modules_wotDesignUni_components_common_util.padZero(uni_modules_wotDesignUni_components_common_util.range(Number(hour), props.minHour, props.maxHour));
|
||||
minute = uni_modules_wotDesignUni_components_common_util.padZero(uni_modules_wotDesignUni_components_common_util.range(Number(minute), props.minMinute, props.maxMinute));
|
||||
if (props.useSecond) {
|
||||
second = uni_modules_wotDesignUni_components_common_util.padZero(uni_modules_wotDesignUni_components_common_util.range(Number(second), props.minSecond, props.maxSecond));
|
||||
return `${hour}:${minute}:${second}`;
|
||||
}
|
||||
return `${hour}:${minute}`;
|
||||
}
|
||||
value = Math.min(Math.max(Number(value), props.minDate), props.maxDate);
|
||||
return value;
|
||||
}
|
||||
function getBoundary(type, innerValue2) {
|
||||
const value = new Date(innerValue2);
|
||||
const boundary = new Date(props[`${type}Date`]);
|
||||
const year = boundary.getFullYear();
|
||||
let month = 1;
|
||||
let date = 1;
|
||||
let hour = 0;
|
||||
let minute = 0;
|
||||
let second = 0;
|
||||
if (type === "max") {
|
||||
month = 12;
|
||||
date = getMonthEndDay(value.getFullYear(), value.getMonth() + 1);
|
||||
hour = 23;
|
||||
minute = 59;
|
||||
second = 59;
|
||||
}
|
||||
if (value.getFullYear() === year) {
|
||||
month = boundary.getMonth() + 1;
|
||||
if (value.getMonth() + 1 === month) {
|
||||
date = boundary.getDate();
|
||||
if (value.getDate() === date) {
|
||||
hour = boundary.getHours();
|
||||
if (value.getHours() === hour) {
|
||||
minute = boundary.getMinutes();
|
||||
if (value.getMinutes() === minute) {
|
||||
second = boundary.getSeconds();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
[`${type}Year`]: year,
|
||||
[`${type}Month`]: month,
|
||||
[`${type}Date`]: date,
|
||||
[`${type}Hour`]: hour,
|
||||
[`${type}Minute`]: minute,
|
||||
[`${type}Second`]: second
|
||||
};
|
||||
}
|
||||
function updateColumnValue(value) {
|
||||
const values = uni_modules_wotDesignUni_components_wdDatetimePickerView_util.getPickerValue(value, props.type, props.useSecond);
|
||||
if (props.modelValue !== value) {
|
||||
emit("update:modelValue", value);
|
||||
emit("change", {
|
||||
value,
|
||||
picker: proxy.$.exposed
|
||||
});
|
||||
}
|
||||
innerValue.value = value;
|
||||
columns.value = updateColumns();
|
||||
pickerValue.value = values;
|
||||
}
|
||||
function updateInnerValue() {
|
||||
var _a;
|
||||
const { type, useSecond } = props;
|
||||
let innerValue2 = "";
|
||||
const pickerVal = ((_a = datePickerview.value) == null ? void 0 : _a.getValues()) || [];
|
||||
const values = uni_modules_wotDesignUni_components_common_util.isArray(pickerVal) ? pickerVal : [pickerVal];
|
||||
if (type === "time") {
|
||||
if (useSecond) {
|
||||
innerValue2 = `${uni_modules_wotDesignUni_components_common_util.padZero(values[0])}:${uni_modules_wotDesignUni_components_common_util.padZero(values[1])}:${uni_modules_wotDesignUni_components_common_util.padZero(values[2])}`;
|
||||
} else {
|
||||
innerValue2 = `${uni_modules_wotDesignUni_components_common_util.padZero(values[0])}:${uni_modules_wotDesignUni_components_common_util.padZero(values[1])}`;
|
||||
}
|
||||
return innerValue2;
|
||||
}
|
||||
const year = values[0] && parseInt(values[0]);
|
||||
const month = type === "year" ? 1 : values[1] && parseInt(values[1]);
|
||||
const maxDate = getMonthEndDay(Number(year), Number(month));
|
||||
let date = 1;
|
||||
if (type !== "year-month" && type !== "year") {
|
||||
date = (Number(values[2]) && parseInt(String(values[2]))) > maxDate ? maxDate : values[2] && parseInt(String(values[2]));
|
||||
}
|
||||
let hour = 0;
|
||||
let minute = 0;
|
||||
let second = 0;
|
||||
if (type === "datetime") {
|
||||
hour = Number(values[3]) && parseInt(values[3]);
|
||||
minute = Number(values[4]) && parseInt(values[4]);
|
||||
if (useSecond) {
|
||||
second = Number(values[5]) && parseInt(values[5]);
|
||||
}
|
||||
}
|
||||
const value = new Date(Number(year), Number(month) - 1, Number(date), hour, minute, second).getTime();
|
||||
innerValue2 = correctValue(value);
|
||||
return innerValue2;
|
||||
}
|
||||
function columnChange(picker) {
|
||||
if (props.type === "time" || props.type === "year-month" || props.type === "year") {
|
||||
return;
|
||||
}
|
||||
const values = picker.getValues();
|
||||
const year = Number(values[0]);
|
||||
const month = Number(values[1]);
|
||||
const maxDate = getMonthEndDay(year, month);
|
||||
let date = Number(values[2]);
|
||||
date = date > maxDate ? maxDate : date;
|
||||
let hour = 0;
|
||||
let minute = 0;
|
||||
let second = 0;
|
||||
if (props.type === "datetime") {
|
||||
hour = Number(values[3]);
|
||||
minute = Number(values[4]);
|
||||
if (props.useSecond) {
|
||||
second = Number(values[5]);
|
||||
}
|
||||
}
|
||||
const value = new Date(year, month - 1, date, hour, minute, second).getTime();
|
||||
innerValue.value = correctValue(value);
|
||||
const newColumns = updateColumns();
|
||||
const selectedIndex = picker.getSelectedIndex().slice(0);
|
||||
newColumns.forEach((_columns, index) => {
|
||||
const nextColumnIndex = index + 1;
|
||||
const nextColumnData = newColumns[nextColumnIndex];
|
||||
if (nextColumnIndex > newColumns.length - 1)
|
||||
return;
|
||||
picker.setColumnData(
|
||||
nextColumnIndex,
|
||||
nextColumnData,
|
||||
selectedIndex[nextColumnIndex] <= nextColumnData.length - 1 ? selectedIndex[nextColumnIndex] : 0
|
||||
);
|
||||
});
|
||||
}
|
||||
function onPickStart() {
|
||||
emit("pickstart");
|
||||
}
|
||||
function onPickEnd() {
|
||||
emit("pickend");
|
||||
}
|
||||
function getSelects() {
|
||||
var _a;
|
||||
const pickerVal = (_a = datePickerview.value) == null ? void 0 : _a.getSelects();
|
||||
if (pickerVal == null)
|
||||
return void 0;
|
||||
if (uni_modules_wotDesignUni_components_common_util.isArray(pickerVal))
|
||||
return pickerVal;
|
||||
return [pickerVal];
|
||||
}
|
||||
__expose({
|
||||
updateColumns,
|
||||
setColumns,
|
||||
getSelects,
|
||||
correctValue,
|
||||
getOriginColumns
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.sr(datePickerview, "a76d8a1e-0", {
|
||||
"k": "datePickerview"
|
||||
}),
|
||||
b: common_vendor.o(onChange),
|
||||
c: common_vendor.o(onPickStart),
|
||||
d: common_vendor.o(onPickEnd),
|
||||
e: common_vendor.o(($event) => pickerValue.value = $event),
|
||||
f: common_vendor.p({
|
||||
["custom-class"]: _ctx.customClass,
|
||||
["custom-style"]: _ctx.customStyle,
|
||||
["immediate-change"]: _ctx.immediateChange,
|
||||
columns: columns.value,
|
||||
["columns-height"]: _ctx.columnsHeight,
|
||||
["item-height"]: _ctx.itemHeight,
|
||||
columnChange,
|
||||
loading: _ctx.loading,
|
||||
["loading-color"]: _ctx.loadingColor,
|
||||
modelValue: pickerValue.value
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-datetime-picker-view/wd-datetime-picker-view.js.map
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"wd-picker-view": "../wd-picker-view/wd-picker-view"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<wd-picker-view wx:if="{{f}}" class="r" u-r="datePickerview" bindchange="{{b}}" bindpickstart="{{c}}" bindpickend="{{d}}" u-i="a76d8a1e-0" bind:__l="__l" bindupdateModelValue="{{e}}" u-p="{{f}}"></wd-picker-view>
|
||||
199
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-datetime-picker/types.js
vendored
Normal file
199
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-datetime-picker/types.js
vendored
Normal file
@@ -0,0 +1,199 @@
|
||||
"use strict";
|
||||
const uni_modules_wotDesignUni_components_common_props = require("../common/props.js");
|
||||
const datetimePickerProps = {
|
||||
...uni_modules_wotDesignUni_components_common_props.baseProps,
|
||||
/**
|
||||
* 选择器左侧文案,label可以不传
|
||||
*/
|
||||
label: String,
|
||||
/**
|
||||
* 选择器占位符
|
||||
*/
|
||||
placeholder: String,
|
||||
/**
|
||||
* 禁用
|
||||
*/
|
||||
disabled: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 只读
|
||||
*/
|
||||
readonly: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 加载中
|
||||
*/
|
||||
loading: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 加载的颜色,只能使用十六进制的色值写法,且不能使用缩写
|
||||
*/
|
||||
loadingColor: uni_modules_wotDesignUni_components_common_props.makeStringProp("#4D80F0"),
|
||||
/**
|
||||
* 弹出层标题
|
||||
*/
|
||||
title: String,
|
||||
/**
|
||||
* 取消按钮文案
|
||||
*/
|
||||
cancelButtonText: String,
|
||||
/**
|
||||
* 确认按钮文案
|
||||
*/
|
||||
confirmButtonText: String,
|
||||
/**
|
||||
* 是否必填
|
||||
*/
|
||||
required: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 设置选择器大小,可选值:large
|
||||
*/
|
||||
size: String,
|
||||
/**
|
||||
* 设置左侧标题宽度
|
||||
*/
|
||||
labelWidth: uni_modules_wotDesignUni_components_common_props.makeStringProp("33%"),
|
||||
/**
|
||||
* 是否为错误状态,错误状态时右侧内容为红色
|
||||
*/
|
||||
error: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 选择器的值靠右展示
|
||||
*/
|
||||
alignRight: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 点击遮罩是否关闭
|
||||
*/
|
||||
closeOnClickModal: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 弹出面板是否设置底部安全距离(iphone X 类型的机型)
|
||||
*/
|
||||
safeAreaInsetBottom: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 是否超出隐藏
|
||||
*/
|
||||
ellipsis: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* picker内部滚筒高
|
||||
*/
|
||||
columnsHeight: uni_modules_wotDesignUni_components_common_props.makeNumberProp(217),
|
||||
/**
|
||||
* 选项的key
|
||||
*/
|
||||
valueKey: uni_modules_wotDesignUni_components_common_props.makeStringProp("value"),
|
||||
/**
|
||||
* 选项的label
|
||||
*/
|
||||
labelKey: uni_modules_wotDesignUni_components_common_props.makeStringProp("label"),
|
||||
/**
|
||||
* 选中项,当 type 为 time 时,类型为字符串;当 type 为 Array 时,类型为范围选择;否则为 时间戳
|
||||
*/
|
||||
modelValue: uni_modules_wotDesignUni_components_common_props.makeRequiredProp([String, Number, Array]),
|
||||
/**
|
||||
* 选择器类型,可选值为:date / year-month / time
|
||||
*/
|
||||
type: uni_modules_wotDesignUni_components_common_props.makeStringProp("datetime"),
|
||||
/**
|
||||
* 最小日期
|
||||
*/
|
||||
minDate: uni_modules_wotDesignUni_components_common_props.makeNumberProp(new Date((/* @__PURE__ */ new Date()).getFullYear() - 10, 0, 1).getTime()),
|
||||
/**
|
||||
* 最大日期
|
||||
*/
|
||||
maxDate: uni_modules_wotDesignUni_components_common_props.makeNumberProp(new Date((/* @__PURE__ */ new Date()).getFullYear() + 10, 11, 31, 23, 59, 59).getTime()),
|
||||
/**
|
||||
* 最小小时,time类型时生效
|
||||
*/
|
||||
minHour: uni_modules_wotDesignUni_components_common_props.makeNumberProp(0),
|
||||
/**
|
||||
* 最大小时,time类型时生效
|
||||
*/
|
||||
maxHour: uni_modules_wotDesignUni_components_common_props.makeNumberProp(23),
|
||||
/**
|
||||
* 最小分钟,time类型时生效
|
||||
*/
|
||||
minMinute: uni_modules_wotDesignUni_components_common_props.makeNumberProp(0),
|
||||
/**
|
||||
* 最大分钟,time类型时生效
|
||||
*/
|
||||
maxMinute: uni_modules_wotDesignUni_components_common_props.makeNumberProp(59),
|
||||
/**
|
||||
* 是否启用秒选择,仅在 time 和 datetime 类型下生效
|
||||
*/
|
||||
useSecond: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 最小秒数,仅在 time 和 datetime 类型下生效
|
||||
*/
|
||||
minSecond: uni_modules_wotDesignUni_components_common_props.makeNumberProp(0),
|
||||
/**
|
||||
* 最大秒数,仅在 time 和 datetime 类型下生效
|
||||
*/
|
||||
maxSecond: uni_modules_wotDesignUni_components_common_props.makeNumberProp(59),
|
||||
/**
|
||||
* 自定义过滤选项的函数,返回列的选项数组
|
||||
*/
|
||||
filter: Function,
|
||||
/**
|
||||
* 自定义弹出层选项文案的格式化函数,返回一个字符串
|
||||
*/
|
||||
formatter: Function,
|
||||
/**
|
||||
* 自定义展示文案的格式化函数,返回一个字符串
|
||||
*/
|
||||
displayFormat: Function,
|
||||
/**
|
||||
* 确定前校验函数,接收 (value, resolve, picker) 参数,通过 resolve 继续执行 picker,resolve 接收1个boolean参数
|
||||
*/
|
||||
beforeConfirm: Function,
|
||||
/**
|
||||
* 在区域选择模式下,自定义展示tab标签文案的格式化函数,返回一个字符串
|
||||
*/
|
||||
displayFormatTabLabel: Function,
|
||||
/**
|
||||
* 默认日期,类型保持与 value 一致,打开面板时面板自动选到默认日期
|
||||
*/
|
||||
defaultValue: [String, Number, Array],
|
||||
/**
|
||||
* 弹窗层级
|
||||
*/
|
||||
zIndex: uni_modules_wotDesignUni_components_common_props.makeNumberProp(15),
|
||||
/**
|
||||
* 表单域 model 字段名,在使用表单校验功能的情况下,该属性是必填的
|
||||
*/
|
||||
prop: String,
|
||||
/**
|
||||
* 表单验证规则,结合wd-form组件使用
|
||||
*/
|
||||
rules: uni_modules_wotDesignUni_components_common_props.makeArrayProp(),
|
||||
/**
|
||||
* picker cell 外部自定义样式
|
||||
*/
|
||||
customCellClass: uni_modules_wotDesignUni_components_common_props.makeStringProp(""),
|
||||
/**
|
||||
* pickerView 外部自定义样式
|
||||
*/
|
||||
customViewClass: uni_modules_wotDesignUni_components_common_props.makeStringProp(""),
|
||||
/**
|
||||
* label 外部自定义样式
|
||||
*/
|
||||
customLabelClass: uni_modules_wotDesignUni_components_common_props.makeStringProp(""),
|
||||
/**
|
||||
* value 外部自定义样式
|
||||
*/
|
||||
customValueClass: uni_modules_wotDesignUni_components_common_props.makeStringProp(""),
|
||||
/**
|
||||
* 是否在手指松开时立即触发picker-view的 change 事件。若不开启则会在滚动动画结束后触发 change 事件,1.2.25版本起提供,仅微信小程序和支付宝小程序支持。
|
||||
*/
|
||||
immediateChange: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 是否从页面中脱离出来,用于解决各种 fixed 失效问题 (H5: teleport, APP: renderjs, 小程序: root-portal)
|
||||
*/
|
||||
rootPortal: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 显示清空按钮
|
||||
*/
|
||||
clearable: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 必填标记位置,可选值:before、after
|
||||
*/
|
||||
markerSide: uni_modules_wotDesignUni_components_common_props.makeStringProp("before")
|
||||
};
|
||||
exports.datetimePickerProps = datetimePickerProps;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-datetime-picker/types.js.map
|
||||
@@ -0,0 +1,664 @@
|
||||
"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_composables_useTranslate = require("../composables/useTranslate.js");
|
||||
const uni_modules_wotDesignUni_components_wdDatetimePicker_types = require("./types.js");
|
||||
const uni_modules_wotDesignUni_dayjs_index = require("../../dayjs/index.js");
|
||||
const uni_modules_wotDesignUni_components_wdDatetimePickerView_util = require("../wd-datetime-picker-view/util.js");
|
||||
if (!Math) {
|
||||
(wdIcon + wdCell + wdDatetimePickerView + wdPopup)();
|
||||
}
|
||||
const wdPopup = () => "../wd-popup/wd-popup.js";
|
||||
const wdDatetimePickerView = () => "../wd-datetime-picker-view/wd-datetime-picker-view.js";
|
||||
const wdCell = () => "../wd-cell/wd-cell.js";
|
||||
const wdIcon = () => "../wd-icon/wd-icon.js";
|
||||
const __default__ = {
|
||||
name: "wd-datetime-picker",
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
};
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: uni_modules_wotDesignUni_components_wdDatetimePicker_types.datetimePickerProps,
|
||||
emits: ["change", "open", "toggle", "cancel", "confirm", "clear", "update:modelValue", "close"],
|
||||
setup(__props, { expose: __expose, emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const { translate } = uni_modules_wotDesignUni_components_composables_useTranslate.useTranslate("datetime-picker");
|
||||
const datetimePickerView = common_vendor.ref();
|
||||
const datetimePickerView1 = common_vendor.ref();
|
||||
const showValue = common_vendor.ref("");
|
||||
const popupShow = common_vendor.ref(false);
|
||||
const showStart = common_vendor.ref(true);
|
||||
const region = common_vendor.ref(false);
|
||||
const showTabLabel = common_vendor.ref([]);
|
||||
const innerValue = common_vendor.ref("");
|
||||
const endInnerValue = common_vendor.ref("");
|
||||
const isPicking = common_vendor.ref(false);
|
||||
const hasConfirmed = common_vendor.ref(false);
|
||||
const isLoading = common_vendor.ref(false);
|
||||
const { proxy } = common_vendor.getCurrentInstance();
|
||||
const cellClass = common_vendor.computed(() => {
|
||||
const classes = ["wd-datetime-picker__cell"];
|
||||
if (props.disabled)
|
||||
classes.push("is-disabled");
|
||||
if (props.readonly)
|
||||
classes.push("is-readonly");
|
||||
if (props.error)
|
||||
classes.push("is-error");
|
||||
return classes.join(" ");
|
||||
});
|
||||
common_vendor.watch(
|
||||
() => props.modelValue,
|
||||
(val, oldVal) => {
|
||||
if (uni_modules_wotDesignUni_components_common_util.isEqual(val, oldVal))
|
||||
return;
|
||||
if (uni_modules_wotDesignUni_components_common_util.isArray(val)) {
|
||||
region.value = true;
|
||||
innerValue.value = uni_modules_wotDesignUni_components_common_util.deepClone(getDefaultInnerValue(true));
|
||||
endInnerValue.value = uni_modules_wotDesignUni_components_common_util.deepClone(getDefaultInnerValue(true, true));
|
||||
} else {
|
||||
innerValue.value = uni_modules_wotDesignUni_components_common_util.deepClone(getDefaultInnerValue());
|
||||
}
|
||||
common_vendor.nextTick$1(() => {
|
||||
setShowValue(false, false, true);
|
||||
});
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
common_vendor.watch(
|
||||
() => props.displayFormat,
|
||||
(fn) => {
|
||||
if (fn && !uni_modules_wotDesignUni_components_common_util.isFunction(fn)) {
|
||||
common_vendor.index.__f__("error", "at uni_modules/wot-design-uni/components/wd-datetime-picker/wd-datetime-picker.vue:236", "The type of displayFormat must be Function");
|
||||
}
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
common_vendor.watch(
|
||||
() => props.filter,
|
||||
(fn) => {
|
||||
if (fn && !uni_modules_wotDesignUni_components_common_util.isFunction(fn)) {
|
||||
common_vendor.index.__f__("error", "at uni_modules/wot-design-uni/components/wd-datetime-picker/wd-datetime-picker.vue:248", "The type of filter must be Function");
|
||||
}
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
common_vendor.watch(
|
||||
() => props.formatter,
|
||||
(fn) => {
|
||||
if (fn && !uni_modules_wotDesignUni_components_common_util.isFunction(fn)) {
|
||||
common_vendor.index.__f__("error", "at uni_modules/wot-design-uni/components/wd-datetime-picker/wd-datetime-picker.vue:260", "The type of formatter must be Function");
|
||||
}
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
common_vendor.watch(
|
||||
() => props.beforeConfirm,
|
||||
(fn) => {
|
||||
if (fn && !uni_modules_wotDesignUni_components_common_util.isFunction(fn)) {
|
||||
common_vendor.index.__f__("error", "at uni_modules/wot-design-uni/components/wd-datetime-picker/wd-datetime-picker.vue:272", "The type of beforeConfirm must be Function");
|
||||
}
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
common_vendor.watch(
|
||||
() => props.displayFormatTabLabel,
|
||||
(fn) => {
|
||||
if (fn && !uni_modules_wotDesignUni_components_common_util.isFunction(fn)) {
|
||||
common_vendor.index.__f__("error", "at uni_modules/wot-design-uni/components/wd-datetime-picker/wd-datetime-picker.vue:284", "The type of displayFormatTabLabel must be Function");
|
||||
}
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
common_vendor.watch(
|
||||
() => props.defaultValue,
|
||||
(val) => {
|
||||
if (uni_modules_wotDesignUni_components_common_util.isArray(val) || region.value) {
|
||||
innerValue.value = uni_modules_wotDesignUni_components_common_util.deepClone(getDefaultInnerValue(true));
|
||||
endInnerValue.value = uni_modules_wotDesignUni_components_common_util.deepClone(getDefaultInnerValue(true, true));
|
||||
} else {
|
||||
innerValue.value = uni_modules_wotDesignUni_components_common_util.deepClone(getDefaultInnerValue());
|
||||
}
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
const showClear = common_vendor.computed(() => {
|
||||
return props.clearable && !props.disabled && !props.readonly && (!uni_modules_wotDesignUni_components_common_util.isArray(showValue.value) && showValue.value || uni_modules_wotDesignUni_components_common_util.isArray(showValue.value) && (showValue.value[0] || showValue.value[1]));
|
||||
});
|
||||
const showArrow = common_vendor.computed(() => {
|
||||
return !props.disabled && !props.readonly && !showClear.value;
|
||||
});
|
||||
function handleBoundaryValue(isStart, columnType, value, currentArray, boundary) {
|
||||
const { type, useSecond } = props;
|
||||
switch (type) {
|
||||
case "datetime": {
|
||||
const [year, month, date, hour, minute, second] = boundary;
|
||||
if (columnType === "year") {
|
||||
return isStart ? value > year : value < year;
|
||||
}
|
||||
if (columnType === "month" && currentArray[0] === year) {
|
||||
return isStart ? value > month : value < month;
|
||||
}
|
||||
if (columnType === "date" && currentArray[0] === year && currentArray[1] === month) {
|
||||
return isStart ? value > date : value < date;
|
||||
}
|
||||
if (columnType === "hour" && currentArray[0] === year && currentArray[1] === month && currentArray[2] === date) {
|
||||
return isStart ? value > hour : value < hour;
|
||||
}
|
||||
if (columnType === "minute" && currentArray[0] === year && currentArray[1] === month && currentArray[2] === date && currentArray[3] === hour) {
|
||||
return isStart ? value > minute : value < minute;
|
||||
}
|
||||
if (useSecond && columnType === "second" && currentArray[0] === year && currentArray[1] === month && currentArray[2] === date && currentArray[3] === hour && currentArray[4] === minute) {
|
||||
return isStart ? value > second : value < second;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "year-month": {
|
||||
const [year, month] = boundary;
|
||||
if (columnType === "year") {
|
||||
return isStart ? value > year : value < year;
|
||||
}
|
||||
if (columnType === "month" && currentArray[0] === year) {
|
||||
return isStart ? value > month : value < month;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "year": {
|
||||
const [year] = boundary;
|
||||
if (columnType === "year") {
|
||||
return isStart ? value > year : value < year;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "date": {
|
||||
const [year, month, date] = boundary;
|
||||
if (columnType === "year") {
|
||||
return isStart ? value > year : value < year;
|
||||
}
|
||||
if (columnType === "month" && currentArray[0] === year) {
|
||||
return isStart ? value > month : value < month;
|
||||
}
|
||||
if (columnType === "date" && currentArray[0] === year && currentArray[1] === month) {
|
||||
return isStart ? value > date : value < date;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "time": {
|
||||
const [hour, minute, second] = boundary;
|
||||
if (columnType === "hour") {
|
||||
return isStart ? value > hour : value < hour;
|
||||
}
|
||||
if (columnType === "minute" && currentArray[0] === hour) {
|
||||
return isStart ? value > minute : value < minute;
|
||||
}
|
||||
if (useSecond && columnType === "second" && currentArray[0] === hour && currentArray[1] === minute) {
|
||||
return isStart ? value > second : value < second;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function startColumnFormatter(picker) {
|
||||
return customColumnFormatter(picker, "start");
|
||||
}
|
||||
function endColumnFormatter(picker) {
|
||||
return customColumnFormatter(picker, "end");
|
||||
}
|
||||
const customColumnFormatter = (picker, pickerType) => {
|
||||
if (!picker)
|
||||
return [];
|
||||
const { type } = props;
|
||||
const startSymbol = pickerType === "start";
|
||||
const { formatter } = props;
|
||||
const start = picker.correctValue(innerValue.value);
|
||||
const end = picker.correctValue(endInnerValue.value);
|
||||
const currentValue = startSymbol ? uni_modules_wotDesignUni_components_wdDatetimePickerView_util.getPickerValue(start, type, props.useSecond) : uni_modules_wotDesignUni_components_wdDatetimePickerView_util.getPickerValue(end, type, props.useSecond);
|
||||
const boundary = startSymbol ? uni_modules_wotDesignUni_components_wdDatetimePickerView_util.getPickerValue(end, type, props.useSecond) : uni_modules_wotDesignUni_components_wdDatetimePickerView_util.getPickerValue(start, type, props.useSecond);
|
||||
const columns = picker.getOriginColumns();
|
||||
return columns.map((column, _) => {
|
||||
return column.values.map((value) => {
|
||||
const disabled = handleBoundaryValue(startSymbol, column.type, value, currentValue, boundary);
|
||||
return {
|
||||
label: formatter ? formatter(column.type, uni_modules_wotDesignUni_components_common_util.padZero(value)) : uni_modules_wotDesignUni_components_common_util.padZero(value),
|
||||
value,
|
||||
disabled
|
||||
};
|
||||
});
|
||||
});
|
||||
};
|
||||
common_vendor.onBeforeMount(() => {
|
||||
const { modelValue: value } = props;
|
||||
if (uni_modules_wotDesignUni_components_common_util.isArray(value)) {
|
||||
region.value = true;
|
||||
innerValue.value = uni_modules_wotDesignUni_components_common_util.deepClone(getDefaultInnerValue(true));
|
||||
endInnerValue.value = uni_modules_wotDesignUni_components_common_util.deepClone(getDefaultInnerValue(true, true));
|
||||
} else {
|
||||
innerValue.value = uni_modules_wotDesignUni_components_common_util.deepClone(getDefaultInnerValue());
|
||||
}
|
||||
});
|
||||
common_vendor.onMounted(() => {
|
||||
setShowValue(false, false, true);
|
||||
});
|
||||
function getSelects(picker) {
|
||||
let value = picker === "before" ? innerValue.value : endInnerValue.value;
|
||||
let selected = [];
|
||||
if (value) {
|
||||
selected = uni_modules_wotDesignUni_components_wdDatetimePickerView_util.getPickerValue(value, props.type, props.useSecond);
|
||||
}
|
||||
let selects = selected.map((value2) => {
|
||||
return {
|
||||
[props.labelKey]: uni_modules_wotDesignUni_components_common_util.padZero(value2),
|
||||
[props.valueKey]: value2
|
||||
};
|
||||
});
|
||||
return selects;
|
||||
}
|
||||
function noop() {
|
||||
}
|
||||
function getDefaultInnerValue(isRegion, isEnd) {
|
||||
const { modelValue: value, defaultValue, maxDate, minDate, type } = props;
|
||||
if (isRegion) {
|
||||
const index = isEnd ? 1 : 0;
|
||||
const targetValue = uni_modules_wotDesignUni_components_common_util.isArray(value) ? value[index] : "";
|
||||
const targetDefault = uni_modules_wotDesignUni_components_common_util.isArray(defaultValue) ? defaultValue[index] : "";
|
||||
const maxValue = type === "time" ? uni_modules_wotDesignUni_dayjs_index.dayjs(maxDate).format("HH:mm") : maxDate;
|
||||
const minValue = type === "time" ? uni_modules_wotDesignUni_dayjs_index.dayjs(minDate).format("HH:mm") : minDate;
|
||||
return targetValue || targetDefault || (isEnd ? maxValue : minValue);
|
||||
} else {
|
||||
return uni_modules_wotDesignUni_components_common_util.isDef(value || defaultValue) ? value || defaultValue : "";
|
||||
}
|
||||
}
|
||||
function open() {
|
||||
showPopup();
|
||||
}
|
||||
function close() {
|
||||
onCancel();
|
||||
}
|
||||
function showPopup() {
|
||||
if (props.disabled || props.readonly)
|
||||
return;
|
||||
emit("open");
|
||||
if (region.value) {
|
||||
popupShow.value = true;
|
||||
showStart.value = true;
|
||||
innerValue.value = uni_modules_wotDesignUni_components_common_util.deepClone(getDefaultInnerValue(true, false));
|
||||
endInnerValue.value = uni_modules_wotDesignUni_components_common_util.deepClone(getDefaultInnerValue(true, true));
|
||||
} else {
|
||||
popupShow.value = true;
|
||||
innerValue.value = uni_modules_wotDesignUni_components_common_util.deepClone(getDefaultInnerValue());
|
||||
}
|
||||
setShowValue(true, false, true);
|
||||
}
|
||||
function tabChange() {
|
||||
showStart.value = !showStart.value;
|
||||
const picker = showStart.value ? datetimePickerView.value : datetimePickerView1.value;
|
||||
picker.setColumns(picker.updateColumns());
|
||||
emit("toggle", showStart.value ? innerValue.value : endInnerValue.value);
|
||||
}
|
||||
function onChangeStart({ value }) {
|
||||
if (!datetimePickerView.value)
|
||||
return;
|
||||
if (region.value && !datetimePickerView1.value)
|
||||
return;
|
||||
if (region.value) {
|
||||
const currentArray = uni_modules_wotDesignUni_components_wdDatetimePickerView_util.getPickerValue(value, props.type, props.useSecond);
|
||||
const boundaryArray = uni_modules_wotDesignUni_components_wdDatetimePickerView_util.getPickerValue(endInnerValue.value, props.type, props.useSecond);
|
||||
const columns = datetimePickerView.value.getOriginColumns();
|
||||
const needsAdjust = columns.some((column, index) => {
|
||||
return handleBoundaryValue(true, column.type, currentArray[index], currentArray, boundaryArray);
|
||||
});
|
||||
innerValue.value = uni_modules_wotDesignUni_components_common_util.deepClone(needsAdjust ? endInnerValue.value : value);
|
||||
common_vendor.nextTick$1(() => {
|
||||
showTabLabel.value = [setTabLabel(), uni_modules_wotDesignUni_components_common_util.deepClone(showTabLabel.value[1])];
|
||||
emit("change", {
|
||||
value: [innerValue.value, endInnerValue.value]
|
||||
});
|
||||
datetimePickerView.value && datetimePickerView.value.setColumns(datetimePickerView.value.updateColumns());
|
||||
datetimePickerView1.value && datetimePickerView1.value.setColumns(datetimePickerView1.value.updateColumns());
|
||||
});
|
||||
} else {
|
||||
innerValue.value = uni_modules_wotDesignUni_components_common_util.deepClone(value);
|
||||
emit("change", {
|
||||
value: innerValue.value
|
||||
});
|
||||
}
|
||||
}
|
||||
function onChangeEnd({ value }) {
|
||||
if (!datetimePickerView.value || !datetimePickerView1.value)
|
||||
return;
|
||||
const currentArray = uni_modules_wotDesignUni_components_wdDatetimePickerView_util.getPickerValue(value, props.type);
|
||||
const boundaryArray = uni_modules_wotDesignUni_components_wdDatetimePickerView_util.getPickerValue(innerValue.value, props.type);
|
||||
const columns = datetimePickerView1.value.getOriginColumns();
|
||||
const needsAdjust = columns.some((column, index) => {
|
||||
return handleBoundaryValue(false, column.type, currentArray[index], currentArray, boundaryArray);
|
||||
});
|
||||
endInnerValue.value = uni_modules_wotDesignUni_components_common_util.deepClone(needsAdjust ? innerValue.value : value);
|
||||
common_vendor.nextTick$1(() => {
|
||||
showTabLabel.value = [uni_modules_wotDesignUni_components_common_util.deepClone(showTabLabel.value[0]), setTabLabel(1)];
|
||||
emit("change", {
|
||||
value: [innerValue.value, endInnerValue.value]
|
||||
});
|
||||
datetimePickerView.value && datetimePickerView.value.setColumns(datetimePickerView.value.updateColumns());
|
||||
datetimePickerView1.value && datetimePickerView1.value.setColumns(datetimePickerView1.value.updateColumns());
|
||||
});
|
||||
}
|
||||
function onCancel() {
|
||||
popupShow.value = false;
|
||||
emit("close");
|
||||
setTimeout(() => {
|
||||
if (region.value) {
|
||||
innerValue.value = uni_modules_wotDesignUni_components_common_util.deepClone(getDefaultInnerValue(true));
|
||||
endInnerValue.value = uni_modules_wotDesignUni_components_common_util.deepClone(getDefaultInnerValue(true, true));
|
||||
} else {
|
||||
innerValue.value = uni_modules_wotDesignUni_components_common_util.deepClone(getDefaultInnerValue());
|
||||
}
|
||||
}, 200);
|
||||
emit("cancel");
|
||||
}
|
||||
function onConfirm() {
|
||||
if (props.loading || isLoading.value)
|
||||
return;
|
||||
if (isPicking.value) {
|
||||
hasConfirmed.value = true;
|
||||
return;
|
||||
}
|
||||
const { beforeConfirm } = props;
|
||||
if (beforeConfirm) {
|
||||
beforeConfirm(
|
||||
region.value ? [innerValue.value, endInnerValue.value] : innerValue.value,
|
||||
(isPass) => {
|
||||
isPass && handleConfirm();
|
||||
},
|
||||
proxy.$.exposed
|
||||
);
|
||||
} else {
|
||||
handleConfirm();
|
||||
}
|
||||
}
|
||||
function onPickStart() {
|
||||
isPicking.value = true;
|
||||
}
|
||||
function onPickEnd() {
|
||||
isPicking.value = false;
|
||||
setTimeout(() => {
|
||||
if (hasConfirmed.value) {
|
||||
hasConfirmed.value = false;
|
||||
onConfirm();
|
||||
}
|
||||
}, 50);
|
||||
}
|
||||
function handleConfirm() {
|
||||
if (props.loading || isLoading.value || props.disabled) {
|
||||
popupShow.value = false;
|
||||
emit("close");
|
||||
return;
|
||||
}
|
||||
const value = region.value ? [innerValue.value, endInnerValue.value] : innerValue.value;
|
||||
popupShow.value = false;
|
||||
emit("close");
|
||||
emit("update:modelValue", value);
|
||||
emit("confirm", {
|
||||
value
|
||||
});
|
||||
setShowValue(false, true);
|
||||
}
|
||||
function setTabLabel(index = 0) {
|
||||
if (region.value) {
|
||||
let items = [];
|
||||
if (index === 0) {
|
||||
items = (datetimePickerView.value ? datetimePickerView.value.getSelects() : void 0) || innerValue.value && getSelects("before");
|
||||
} else {
|
||||
items = (datetimePickerView1.value ? datetimePickerView1.value.getSelects() : void 0) || endInnerValue.value && getSelects("after");
|
||||
}
|
||||
return defaultDisplayFormat(items, true);
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
function setShowValue(tab = false, isConfirm = false, beforeMount = false) {
|
||||
if (region.value) {
|
||||
const items = beforeMount ? innerValue.value && getSelects("before") || [] : datetimePickerView.value && datetimePickerView.value.getSelects && datetimePickerView.value.getSelects() || [];
|
||||
const endItems = beforeMount ? endInnerValue.value && getSelects("after") || [] : datetimePickerView1.value && datetimePickerView1.value.getSelects && datetimePickerView1.value.getSelects() || [];
|
||||
showValue.value = tab ? showValue.value : [
|
||||
props.modelValue[0] || isConfirm ? defaultDisplayFormat(items) : "",
|
||||
props.modelValue[1] || isConfirm ? defaultDisplayFormat(endItems) : ""
|
||||
];
|
||||
showTabLabel.value = [defaultDisplayFormat(items, true), defaultDisplayFormat(endItems, true)];
|
||||
} else {
|
||||
const items = beforeMount ? innerValue.value && getSelects("before") || [] : datetimePickerView.value && datetimePickerView.value.getSelects && datetimePickerView.value.getSelects() || [];
|
||||
showValue.value = uni_modules_wotDesignUni_components_common_util.deepClone(props.modelValue || isConfirm ? defaultDisplayFormat(items) : "");
|
||||
}
|
||||
}
|
||||
function defaultDisplayFormat(items, tabLabel = false) {
|
||||
if (items.length === 0)
|
||||
return "";
|
||||
if (tabLabel && props.displayFormatTabLabel) {
|
||||
return props.displayFormatTabLabel(items);
|
||||
}
|
||||
if (props.displayFormat) {
|
||||
return props.displayFormat(items);
|
||||
}
|
||||
if (props.formatter) {
|
||||
const typeMaps = {
|
||||
year: ["year"],
|
||||
datetime: props.useSecond ? ["year", "month", "date", "hour", "minute", "second"] : ["year", "month", "date", "hour", "minute"],
|
||||
date: ["year", "month", "date"],
|
||||
time: props.useSecond ? ["hour", "minute", "second"] : ["hour", "minute"],
|
||||
"year-month": ["year", "month"]
|
||||
};
|
||||
return items.map((item, index) => {
|
||||
return props.formatter(typeMaps[props.type][index], item.value);
|
||||
}).join("");
|
||||
}
|
||||
switch (props.type) {
|
||||
case "year":
|
||||
return items[0].label;
|
||||
case "date":
|
||||
return `${items[0].label}-${items[1].label}-${items[2].label}`;
|
||||
case "year-month":
|
||||
return `${items[0].label}-${items[1].label}`;
|
||||
case "time":
|
||||
return props.useSecond ? `${items[0].label}:${items[1].label}:${items[2].label}` : `${items[0].label}:${items[1].label}`;
|
||||
case "datetime":
|
||||
return props.useSecond ? `${items[0].label}-${items[1].label}-${items[2].label} ${items[3].label}:${items[4].label}:${items[5].label}` : `${items[0].label}-${items[1].label}-${items[2].label} ${items[3].label}:${items[4].label}`;
|
||||
}
|
||||
}
|
||||
function setLoading(loading) {
|
||||
isLoading.value = loading;
|
||||
}
|
||||
function handleClear() {
|
||||
emit("clear");
|
||||
emit("update:modelValue", "");
|
||||
setShowValue(false, true);
|
||||
}
|
||||
__expose({
|
||||
open,
|
||||
close,
|
||||
setLoading
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: !_ctx.$slots.default
|
||||
}, !_ctx.$slots.default ? common_vendor.e({
|
||||
b: _ctx.$slots.label
|
||||
}, _ctx.$slots.label ? {} : {}, {
|
||||
c: region.value
|
||||
}, region.value ? common_vendor.e({
|
||||
d: common_vendor.unref(uni_modules_wotDesignUni_components_common_util.isArray)(showValue.value)
|
||||
}, common_vendor.unref(uni_modules_wotDesignUni_components_common_util.isArray)(showValue.value) ? {
|
||||
e: common_vendor.t(showValue.value[0] ? showValue.value[0] : _ctx.placeholder || common_vendor.unref(translate)("placeholder")),
|
||||
f: common_vendor.n(showValue.value[0] ? "" : "wd-datetime-picker__placeholder"),
|
||||
g: common_vendor.t(common_vendor.unref(translate)("to")),
|
||||
h: common_vendor.t(showValue.value[1] ? showValue.value[1] : _ctx.placeholder || common_vendor.unref(translate)("placeholder")),
|
||||
i: common_vendor.n(showValue.value[1] ? "" : "wd-datetime-picker__placeholder")
|
||||
} : {
|
||||
j: common_vendor.t(_ctx.placeholder || common_vendor.unref(translate)("placeholder"))
|
||||
}) : {
|
||||
k: common_vendor.t(showValue.value ? showValue.value : _ctx.placeholder || common_vendor.unref(translate)("placeholder")),
|
||||
l: common_vendor.n(showValue.value ? "" : "wd-datetime-picker__placeholder")
|
||||
}, {
|
||||
m: showArrow.value
|
||||
}, showArrow.value ? {
|
||||
n: common_vendor.p({
|
||||
["custom-class"]: "wd-datetime-picker__arrow",
|
||||
name: "arrow-right"
|
||||
})
|
||||
} : showClear.value ? {
|
||||
p: common_vendor.p({
|
||||
["custom-class"]: "wd-datetime-picker__clear",
|
||||
name: "error-fill"
|
||||
}),
|
||||
q: common_vendor.o(handleClear)
|
||||
} : {}, {
|
||||
o: showClear.value,
|
||||
r: common_vendor.o(showPopup),
|
||||
s: common_vendor.p({
|
||||
title: _ctx.label,
|
||||
required: _ctx.required,
|
||||
size: _ctx.size,
|
||||
["title-width"]: _ctx.labelWidth,
|
||||
prop: _ctx.prop,
|
||||
rules: _ctx.rules,
|
||||
clickable: !_ctx.disabled && !_ctx.readonly,
|
||||
["value-align"]: _ctx.alignRight ? "right" : "left",
|
||||
["custom-class"]: cellClass.value,
|
||||
["custom-style"]: _ctx.customStyle,
|
||||
["custom-title-class"]: _ctx.customLabelClass,
|
||||
["custom-value-class"]: _ctx.customValueClass,
|
||||
ellipsis: _ctx.ellipsis,
|
||||
["use-title-slot"]: !!_ctx.$slots.label,
|
||||
["marker-side"]: _ctx.markerSide
|
||||
})
|
||||
}) : {
|
||||
t: common_vendor.o(showPopup)
|
||||
}, {
|
||||
v: common_vendor.t(_ctx.cancelButtonText || common_vendor.unref(translate)("cancel")),
|
||||
w: common_vendor.o(onCancel),
|
||||
x: _ctx.title
|
||||
}, _ctx.title ? {
|
||||
y: common_vendor.t(_ctx.title)
|
||||
} : {}, {
|
||||
z: common_vendor.t(_ctx.confirmButtonText || common_vendor.unref(translate)("confirm")),
|
||||
A: common_vendor.n(`wd-datetime-picker__action ${_ctx.loading || isLoading.value ? "is-loading" : ""}`),
|
||||
B: common_vendor.o(onConfirm),
|
||||
C: common_vendor.o(noop),
|
||||
D: region.value
|
||||
}, region.value ? {
|
||||
E: common_vendor.t(common_vendor.unref(translate)("start")),
|
||||
F: common_vendor.t(showTabLabel.value[0]),
|
||||
G: common_vendor.n(`wd-datetime-picker__region ${showStart.value ? "is-active" : ""} `),
|
||||
H: common_vendor.o(tabChange),
|
||||
I: common_vendor.t(common_vendor.unref(translate)("end")),
|
||||
J: common_vendor.t(showTabLabel.value[1]),
|
||||
K: common_vendor.n(`wd-datetime-picker__region ${showStart.value ? "" : "is-active"}`),
|
||||
L: common_vendor.o(tabChange)
|
||||
} : {}, {
|
||||
M: common_vendor.sr(datetimePickerView, "2a8ca3bd-4,2a8ca3bd-3", {
|
||||
"k": "datetimePickerView"
|
||||
}),
|
||||
N: common_vendor.o(onChangeStart),
|
||||
O: common_vendor.o(onPickStart),
|
||||
P: common_vendor.o(onPickEnd),
|
||||
Q: common_vendor.o(($event) => innerValue.value = $event),
|
||||
R: common_vendor.p({
|
||||
["custom-class"]: _ctx.customViewClass,
|
||||
type: _ctx.type,
|
||||
loading: _ctx.loading || isLoading.value,
|
||||
["loading-color"]: _ctx.loadingColor,
|
||||
["columns-height"]: _ctx.columnsHeight,
|
||||
["value-key"]: _ctx.valueKey,
|
||||
["label-key"]: _ctx.labelKey,
|
||||
formatter: _ctx.formatter,
|
||||
filter: _ctx.filter,
|
||||
["column-formatter"]: common_vendor.unref(uni_modules_wotDesignUni_components_common_util.isArray)(_ctx.modelValue) ? startColumnFormatter : void 0,
|
||||
["max-hour"]: _ctx.maxHour,
|
||||
["min-hour"]: _ctx.minHour,
|
||||
["max-date"]: _ctx.maxDate,
|
||||
["min-date"]: _ctx.minDate,
|
||||
["max-minute"]: _ctx.maxMinute,
|
||||
["min-minute"]: _ctx.minMinute,
|
||||
["use-second"]: _ctx.useSecond,
|
||||
["min-second"]: _ctx.minSecond,
|
||||
["max-second"]: _ctx.maxSecond,
|
||||
["immediate-change"]: _ctx.immediateChange,
|
||||
modelValue: innerValue.value
|
||||
}),
|
||||
S: common_vendor.n(showStart.value ? "wd-datetime-picker__show" : "wd-datetime-picker__hidden"),
|
||||
T: common_vendor.sr(datetimePickerView1, "2a8ca3bd-5,2a8ca3bd-3", {
|
||||
"k": "datetimePickerView1"
|
||||
}),
|
||||
U: common_vendor.o(onChangeEnd),
|
||||
V: common_vendor.o(onPickStart),
|
||||
W: common_vendor.o(onPickEnd),
|
||||
X: common_vendor.o(($event) => endInnerValue.value = $event),
|
||||
Y: common_vendor.p({
|
||||
["custom-class"]: _ctx.customViewClass,
|
||||
type: _ctx.type,
|
||||
loading: _ctx.loading || isLoading.value,
|
||||
["loading-color"]: _ctx.loadingColor,
|
||||
["columns-height"]: _ctx.columnsHeight,
|
||||
["value-key"]: _ctx.valueKey,
|
||||
["label-key"]: _ctx.labelKey,
|
||||
formatter: _ctx.formatter,
|
||||
filter: _ctx.filter,
|
||||
["column-formatter"]: common_vendor.unref(uni_modules_wotDesignUni_components_common_util.isArray)(_ctx.modelValue) ? endColumnFormatter : void 0,
|
||||
["max-hour"]: _ctx.maxHour,
|
||||
["min-hour"]: _ctx.minHour,
|
||||
["max-date"]: _ctx.maxDate,
|
||||
["min-date"]: _ctx.minDate,
|
||||
["max-minute"]: _ctx.maxMinute,
|
||||
["min-minute"]: _ctx.minMinute,
|
||||
["use-second"]: _ctx.useSecond,
|
||||
["min-second"]: _ctx.minSecond,
|
||||
["max-second"]: _ctx.maxSecond,
|
||||
["immediate-change"]: _ctx.immediateChange,
|
||||
modelValue: endInnerValue.value
|
||||
}),
|
||||
Z: common_vendor.n(showStart.value ? "wd-datetime-picker__hidden" : "wd-datetime-picker__show"),
|
||||
aa: common_vendor.o(onCancel),
|
||||
ab: common_vendor.o(($event) => popupShow.value = $event),
|
||||
ac: common_vendor.p({
|
||||
position: "bottom",
|
||||
["hide-when-close"]: false,
|
||||
["close-on-click-modal"]: _ctx.closeOnClickModal,
|
||||
["safe-area-inset-bottom"]: _ctx.safeAreaInsetBottom,
|
||||
["z-index"]: _ctx.zIndex,
|
||||
["root-portal"]: _ctx.rootPortal,
|
||||
["custom-class"]: "wd-datetime-picker__popup",
|
||||
modelValue: popupShow.value
|
||||
}),
|
||||
ad: common_vendor.n(`wd-datetime-picker ${_ctx.customClass}`),
|
||||
ae: common_vendor.s(_ctx.customStyle)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-2a8ca3bd"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-datetime-picker/wd-datetime-picker.js.map
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"wd-popup": "../wd-popup/wd-popup",
|
||||
"wd-datetime-picker-view": "../wd-datetime-picker-view/wd-datetime-picker-view",
|
||||
"wd-cell": "../wd-cell/wd-cell",
|
||||
"wd-icon": "../wd-icon/wd-icon"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view class="{{['data-v-2a8ca3bd', ad]}}" style="{{ae}}"><wd-cell wx:if="{{a}}" class="data-v-2a8ca3bd" u-s="{{['title','d','right-icon']}}" bindclick="{{r}}" u-i="2a8ca3bd-0" bind:__l="__l" u-p="{{s}}"><view wx:if="{{b}}" slot="title"><slot name="label"></slot></view><view><block wx:if="{{c}}"><view wx:if="{{d}}" class="data-v-2a8ca3bd"><text class="{{['data-v-2a8ca3bd', f]}}">{{e}}</text> {{g}} <text class="{{['data-v-2a8ca3bd', i]}}">{{h}}</text></view><view wx:else class="wd-datetime-picker__cell-placeholder data-v-2a8ca3bd">{{j}}</view></block><view wx:else class="{{['data-v-2a8ca3bd', l]}}">{{k}}</view></view><view slot="right-icon"><wd-icon wx:if="{{m}}" class="data-v-2a8ca3bd" u-i="2a8ca3bd-1,2a8ca3bd-0" bind:__l="__l" u-p="{{n}}"/><view wx:elif="{{o}}" class="data-v-2a8ca3bd" catchtap="{{q}}"><wd-icon wx:if="{{p}}" class="data-v-2a8ca3bd" u-i="2a8ca3bd-2,2a8ca3bd-0" bind:__l="__l" u-p="{{p}}"/></view></view></wd-cell><view wx:else class="data-v-2a8ca3bd" bindtap="{{t}}"><slot></slot></view><wd-popup wx:if="{{ac}}" class="data-v-2a8ca3bd" u-s="{{['d']}}" bindclose="{{aa}}" u-i="2a8ca3bd-3" bind:__l="__l" bindupdateModelValue="{{ab}}" u-p="{{ac}}"><view class="wd-datetime-picker__wraper data-v-2a8ca3bd"><view class="wd-datetime-picker__toolbar data-v-2a8ca3bd" bindtouchmove="{{C}}"><view class="wd-datetime-picker__action wd-datetime-picker__action--cancel data-v-2a8ca3bd" bindtap="{{w}}">{{v}}</view><view wx:if="{{x}}" class="wd-datetime-picker__title data-v-2a8ca3bd">{{y}}</view><view class="{{['data-v-2a8ca3bd', A]}}" bindtap="{{B}}">{{z}}</view></view><view wx:if="{{D}}" class="wd-datetime-picker__region-tabs data-v-2a8ca3bd"><view class="{{['data-v-2a8ca3bd', G]}}" bindtap="{{H}}"><view class="data-v-2a8ca3bd">{{E}}</view><view class="wd-datetime-picker__region-time data-v-2a8ca3bd">{{F}}</view></view><view class="{{['data-v-2a8ca3bd', K]}}" bindtap="{{L}}"><view class="data-v-2a8ca3bd">{{I}}</view><view class="wd-datetime-picker__region-time data-v-2a8ca3bd">{{J}}</view></view></view><view class="{{['data-v-2a8ca3bd', S]}}"><wd-datetime-picker-view wx:if="{{R}}" class="r data-v-2a8ca3bd" u-r="datetimePickerView" bindchange="{{N}}" bindpickstart="{{O}}" bindpickend="{{P}}" u-i="2a8ca3bd-4,2a8ca3bd-3" bind:__l="__l" bindupdateModelValue="{{Q}}" u-p="{{R}}"/></view><view class="{{['data-v-2a8ca3bd', Z]}}"><wd-datetime-picker-view wx:if="{{Y}}" class="r data-v-2a8ca3bd" u-r="datetimePickerView1" bindchange="{{U}}" bindpickstart="{{V}}" bindpickend="{{W}}" u-i="2a8ca3bd-5,2a8ca3bd-3" bind:__l="__l" bindupdateModelValue="{{X}}" u-p="{{Y}}"/></view></view></wd-popup></view>
|
||||
@@ -0,0 +1,289 @@
|
||||
/* 水平间距 */
|
||||
/* 水平间距 */
|
||||
/**
|
||||
* 混合宏
|
||||
*/
|
||||
/**
|
||||
* 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-datetime-picker__placeholder.data-v-2a8ca3bd {
|
||||
color: var(--wot-dark-color-gray, var(--wot-color-secondary, #595959));
|
||||
}
|
||||
.wot-theme-dark .wd-datetime-picker.data-v-2a8ca3bd .wd-datetime-picker__arrow,
|
||||
.wot-theme-dark .wd-datetime-picker.data-v-2a8ca3bd .wd-datetime-picker__clear {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wot-theme-dark .wd-datetime-picker__action--cancel.data-v-2a8ca3bd {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wot-theme-dark .wd-datetime-picker__region.data-v-2a8ca3bd {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wot-theme-dark .wd-datetime-picker__region.is-active.data-v-2a8ca3bd {
|
||||
background: var(--wot-picker-region-bg-active-color, var(--wot-color-theme, #4d80f0));
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.data-v-2a8ca3bd .wd-datetime-picker__cell.is-disabled .wd-cell__value {
|
||||
color: var(--wot-input-disabled-color, #d9d9d9);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.data-v-2a8ca3bd .wd-datetime-picker__cell.is-error .wd-cell__value {
|
||||
color: var(--wot-input-error-color, var(--wot-color-danger, #fa4350));
|
||||
}
|
||||
.data-v-2a8ca3bd .wd-datetime-picker__cell.is-error .wd-datetime-picker__arrow {
|
||||
color: var(--wot-input-error-color, var(--wot-color-danger, #fa4350));
|
||||
}
|
||||
.data-v-2a8ca3bd .wd-datetime-picker__cell.is-large .wd-datetime-picker__arrow {
|
||||
font-size: var(--wot-cell-icon-size-large, 18px);
|
||||
}
|
||||
.data-v-2a8ca3bd .wd-datetime-picker__cell .wd-cell__value--ellipsis view {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
}
|
||||
.data-v-2a8ca3bd .wd-datetime-picker__cell .wd-cell__value--ellipsis text {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
max-width: 100%;
|
||||
}
|
||||
.wd-datetime-picker__placeholder.data-v-2a8ca3bd {
|
||||
color: var(--wot-input-placeholder-color, #bfbfbf);
|
||||
}
|
||||
.data-v-2a8ca3bd .wd-datetime-picker__arrow {
|
||||
display: block;
|
||||
font-size: var(--wot-cell-icon-size, 16px);
|
||||
color: var(--wot-cell-arrow-color, rgba(0, 0, 0, 0.25));
|
||||
line-height: var(--wot-cell-line-height, 24px);
|
||||
}
|
||||
.data-v-2a8ca3bd .wd-datetime-picker__clear {
|
||||
display: block;
|
||||
font-size: var(--wot-cell-icon-size, 16px);
|
||||
color: var(--wot-cell-clear-color, #585858);
|
||||
line-height: var(--wot-cell-line-height, 24px);
|
||||
}
|
||||
.data-v-2a8ca3bd .wd-datetime-picker__popup {
|
||||
border-radius: 16px 16px 0px 0px;
|
||||
}
|
||||
.wd-datetime-picker__wraper.data-v-2a8ca3bd {
|
||||
padding-bottom: var(--window-bottom);
|
||||
}
|
||||
.wd-datetime-picker__toolbar.data-v-2a8ca3bd {
|
||||
position: relative;
|
||||
display: flex;
|
||||
font-size: var(--wot-picker-toolbar-fs, var(--wot-fs-title, 16px));
|
||||
height: var(--wot-picker-toolbar-height, 54px);
|
||||
line-height: var(--wot-picker-action-height, 16px);
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.wd-datetime-picker__action.data-v-2a8ca3bd {
|
||||
display: block;
|
||||
border: none;
|
||||
outline: none;
|
||||
font-size: var(--wot-picker-toolbar-fs, var(--wot-fs-title, 16px));
|
||||
color: var(--wot-picker-toolbar-finish-color, var(--wot-color-theme, #4d80f0));
|
||||
background: transparent;
|
||||
padding: 24px 15px 14px 15px;
|
||||
}
|
||||
.wd-datetime-picker__action--cancel.data-v-2a8ca3bd {
|
||||
color: var(--wot-picker-toolbar-cancel-color, #666666);
|
||||
}
|
||||
.wd-datetime-picker__action.is-loading.data-v-2a8ca3bd {
|
||||
color: var(--wot-picker-loading-button-color, rgba(0, 0, 0, 0.25));
|
||||
}
|
||||
.wd-datetime-picker__title.data-v-2a8ca3bd {
|
||||
display: block;
|
||||
float: 1;
|
||||
color: var(--wot-picker-toolbar-title-color, rgba(0, 0, 0, 0.85));
|
||||
}
|
||||
.wd-datetime-picker__region-tabs.data-v-2a8ca3bd {
|
||||
display: flex;
|
||||
}
|
||||
.wd-datetime-picker__region.data-v-2a8ca3bd {
|
||||
width: 50%;
|
||||
display: inline-block;
|
||||
color: var(--wot-picker-region-color, rgba(0, 0, 0, 0.45));
|
||||
text-align: center;
|
||||
padding: 14px 0;
|
||||
font-size: var(--wot-picker-region-fs, 14px);
|
||||
line-height: 16px;
|
||||
transition: all 0.15s ease-out;
|
||||
}
|
||||
.wd-datetime-picker__region.is-active.data-v-2a8ca3bd {
|
||||
background: var(--wot-picker-region-bg-active-color, var(--wot-color-theme, #4d80f0));
|
||||
color: var(--wot-color-white, white);
|
||||
}
|
||||
.wd-datetime-picker__region-time.data-v-2a8ca3bd {
|
||||
font-size: 16px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
.wd-datetime-picker__hidden.data-v-2a8ca3bd {
|
||||
visibility: hidden;
|
||||
overflow: hidden;
|
||||
height: 0;
|
||||
}
|
||||
.wd-datetime-picker__show.data-v-2a8ca3bd {
|
||||
visibility: visible;
|
||||
height: auto;
|
||||
}
|
||||
4
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-form/types.js
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-form/types.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
const FORM_KEY = Symbol("wd-form");
|
||||
exports.FORM_KEY = FORM_KEY;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-form/types.js.map
|
||||
23
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-icon/types.js
vendored
Normal file
23
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-icon/types.js
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
const uni_modules_wotDesignUni_components_common_props = require("../common/props.js");
|
||||
const iconProps = {
|
||||
...uni_modules_wotDesignUni_components_common_props.baseProps,
|
||||
/**
|
||||
* 使用的图标名字,可以使用链接图片
|
||||
*/
|
||||
name: uni_modules_wotDesignUni_components_common_props.makeRequiredProp(String),
|
||||
/**
|
||||
* 图标的颜色
|
||||
*/
|
||||
color: String,
|
||||
/**
|
||||
* 图标的字体大小
|
||||
*/
|
||||
size: uni_modules_wotDesignUni_components_common_props.numericProp,
|
||||
/**
|
||||
* 类名前缀,用于使用自定义图标
|
||||
*/
|
||||
classPrefix: uni_modules_wotDesignUni_components_common_props.makeStringProp("wd-icon")
|
||||
};
|
||||
exports.iconProps = iconProps;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-icon/types.js.map
|
||||
55
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-icon/wd-icon.js
vendored
Normal file
55
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-icon/wd-icon.js
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"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_wdIcon_types = require("./types.js");
|
||||
const __default__ = {
|
||||
name: "wd-icon",
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
};
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: uni_modules_wotDesignUni_components_wdIcon_types.iconProps,
|
||||
emits: ["click", "touch"],
|
||||
setup(__props, { emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const isImage = common_vendor.computed(() => {
|
||||
return uni_modules_wotDesignUni_components_common_util.isDef(props.name) && props.name.includes("/");
|
||||
});
|
||||
const rootClass = common_vendor.computed(() => {
|
||||
const prefix = props.classPrefix;
|
||||
return `${prefix} ${props.customClass} ${isImage.value ? "wd-icon--image" : prefix + "-" + props.name}`;
|
||||
});
|
||||
const rootStyle = common_vendor.computed(() => {
|
||||
const style = {};
|
||||
if (props.color) {
|
||||
style["color"] = props.color;
|
||||
}
|
||||
if (props.size) {
|
||||
style["font-size"] = uni_modules_wotDesignUni_components_common_util.addUnit(props.size);
|
||||
}
|
||||
return `${uni_modules_wotDesignUni_components_common_util.objToStyle(style)} ${props.customStyle}`;
|
||||
});
|
||||
function handleClick(event) {
|
||||
emit("click", event);
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: isImage.value
|
||||
}, isImage.value ? {
|
||||
b: _ctx.name
|
||||
} : {}, {
|
||||
c: common_vendor.o(handleClick),
|
||||
d: common_vendor.n(rootClass.value),
|
||||
e: common_vendor.s(rootStyle.value)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-24906af6"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-icon/wd-icon.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-icon/wd-icon.json
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-icon/wd-icon.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-icon/wd-icon.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-icon/wd-icon.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view bindtap="{{c}}" class="{{['data-v-24906af6', d]}}" style="{{e}}"><image wx:if="{{a}}" class="wd-icon__image data-v-24906af6" src="{{b}}"></image></view>
|
||||
1079
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-icon/wd-icon.wxss
vendored
Normal file
1079
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-icon/wd-icon.wxss
vendored
Normal file
File diff suppressed because it is too large
Load Diff
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;
|
||||
}
|
||||
175
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-input/types.js
vendored
Normal file
175
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-input/types.js
vendored
Normal file
@@ -0,0 +1,175 @@
|
||||
"use strict";
|
||||
const uni_modules_wotDesignUni_components_common_props = require("../common/props.js");
|
||||
const inputProps = {
|
||||
...uni_modules_wotDesignUni_components_common_props.baseProps,
|
||||
customInputClass: uni_modules_wotDesignUni_components_common_props.makeStringProp(""),
|
||||
customLabelClass: uni_modules_wotDesignUni_components_common_props.makeStringProp(""),
|
||||
// 原生属性
|
||||
/**
|
||||
* 占位文本
|
||||
*/
|
||||
placeholder: String,
|
||||
/**
|
||||
* 原生属性,指定 placeholder 的样式,目前仅支持color,font-size和font-weight
|
||||
*/
|
||||
placeholderStyle: String,
|
||||
/**
|
||||
* 原生属性,指定 placeholder 的样式类
|
||||
*/
|
||||
placeholderClass: uni_modules_wotDesignUni_components_common_props.makeStringProp(""),
|
||||
/**
|
||||
* 原生属性,指定光标与键盘的距离。取 input 距离底部的距离和cursor-spacing指定的距离的最小值作为光标与键盘的距离
|
||||
*/
|
||||
cursorSpacing: uni_modules_wotDesignUni_components_common_props.makeNumberProp(0),
|
||||
/**
|
||||
* 原生属性,指定focus时的光标位置
|
||||
*/
|
||||
cursor: uni_modules_wotDesignUni_components_common_props.makeNumberProp(-1),
|
||||
/**
|
||||
* 原生属性,光标起始位置,自动聚集时有效,需与selection-end搭配使用
|
||||
*/
|
||||
selectionStart: uni_modules_wotDesignUni_components_common_props.makeNumberProp(-1),
|
||||
/**
|
||||
* 原生属性,光标结束位置,自动聚集时有效,需与selection-start搭配使用
|
||||
*/
|
||||
selectionEnd: uni_modules_wotDesignUni_components_common_props.makeNumberProp(-1),
|
||||
/**
|
||||
* 原生属性,键盘弹起时,是否自动上推页面
|
||||
*/
|
||||
adjustPosition: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* focus时,点击页面的时候不收起键盘
|
||||
*/
|
||||
holdKeyboard: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 设置键盘右下角按钮的文字,仅在type='text'时生效,可选值:done / go / next / search / send
|
||||
*/
|
||||
confirmType: uni_modules_wotDesignUni_components_common_props.makeStringProp("done"),
|
||||
/**
|
||||
* 点击键盘右下角按钮时是否保持键盘不收起
|
||||
*/
|
||||
confirmHold: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 原生属性,获取焦点
|
||||
*/
|
||||
focus: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 类型,可选值:text / number / digit / idcard / safe-password / nickname / tel
|
||||
*/
|
||||
type: uni_modules_wotDesignUni_components_common_props.makeStringProp("text"),
|
||||
/**
|
||||
* 原生属性,最大长度
|
||||
*/
|
||||
maxlength: {
|
||||
type: Number,
|
||||
default: -1
|
||||
},
|
||||
/**
|
||||
* 原生属性,禁用
|
||||
*/
|
||||
disabled: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 微信小程序原生属性,强制 input 处于同层状态,默认 focus 时 input 会切到非同层状态 (仅在 iOS 下生效)
|
||||
*/
|
||||
alwaysEmbed: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
// 原生属性结束
|
||||
/**
|
||||
* 输入框的值靠右展示
|
||||
*/
|
||||
alignRight: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 绑定值
|
||||
*/
|
||||
modelValue: uni_modules_wotDesignUni_components_common_props.makeNumericProp(""),
|
||||
/**
|
||||
* 显示为密码框
|
||||
*/
|
||||
showPassword: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 显示清空按钮
|
||||
*/
|
||||
clearable: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 只读
|
||||
*/
|
||||
readonly: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 前置图标,icon组件中的图标类名
|
||||
*/
|
||||
prefixIcon: String,
|
||||
/**
|
||||
* 后置图标,icon组件中的图标类名
|
||||
*/
|
||||
suffixIcon: String,
|
||||
/**
|
||||
* 显示字数限制,需要同时设置 maxlength
|
||||
*/
|
||||
showWordLimit: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 设置左侧标题
|
||||
*/
|
||||
label: String,
|
||||
/**
|
||||
* 设置左侧标题宽度
|
||||
*/
|
||||
labelWidth: uni_modules_wotDesignUni_components_common_props.makeStringProp(""),
|
||||
/**
|
||||
* 设置输入框大小,可选值:large
|
||||
*/
|
||||
size: String,
|
||||
/**
|
||||
* 设置输入框错误状态,错误状态时为红色
|
||||
*/
|
||||
error: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 当有label属性时,设置标题和输入框垂直居中,默认为顶部居中
|
||||
*/
|
||||
center: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 非 cell 类型下是否隐藏下划线
|
||||
*/
|
||||
noBorder: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 是否必填
|
||||
*/
|
||||
required: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 表单域 model 字段名,在使用表单校验功能的情况下,该属性是必填的
|
||||
*/
|
||||
prop: String,
|
||||
/**
|
||||
* 表单验证规则,结合wd-form组件使用
|
||||
*/
|
||||
rules: uni_modules_wotDesignUni_components_common_props.makeArrayProp(),
|
||||
/**
|
||||
* 显示清除图标的时机,always 表示输入框不为空时展示,focus 表示输入框聚焦且不为空时展示
|
||||
* 类型: "focus" | "always"
|
||||
* 默认值: "always"
|
||||
*/
|
||||
clearTrigger: uni_modules_wotDesignUni_components_common_props.makeStringProp("always"),
|
||||
/**
|
||||
* 是否在点击清除按钮时聚焦输入框
|
||||
* 类型: boolean
|
||||
* 默认值: true
|
||||
*/
|
||||
focusWhenClear: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 是否忽略组件内对文本合成系统事件的处理。为 false 时将触发 compositionstart、compositionend、compositionupdate 事件,且在文本合成期间会触发 input 事件
|
||||
* 类型: boolean
|
||||
* 默认值: true
|
||||
*/
|
||||
ignoreCompositionEvent: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 它提供了用户在编辑元素或其内容时可能输入的数据类型的提示。在符合条件的高版本webview里,uni-app的web和app-vue平台中可使用本属性。
|
||||
* 类型: InputMode
|
||||
* 可选值: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | "password"
|
||||
* 默认值: "text"
|
||||
*/
|
||||
inputmode: uni_modules_wotDesignUni_components_common_props.makeStringProp("text"),
|
||||
/**
|
||||
* 必填标记位置,可选值:before(标签前)、after(标签后)
|
||||
*/
|
||||
markerSide: uni_modules_wotDesignUni_components_common_props.makeStringProp("before")
|
||||
};
|
||||
exports.inputProps = inputProps;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-input/types.js.map
|
||||
292
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-input/wd-input.js
vendored
Normal file
292
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-input/wd-input.js
vendored
Normal file
@@ -0,0 +1,292 @@
|
||||
"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_composables_useCell = require("../composables/useCell.js");
|
||||
const uni_modules_wotDesignUni_components_wdForm_types = require("../wd-form/types.js");
|
||||
const uni_modules_wotDesignUni_components_composables_useParent = require("../composables/useParent.js");
|
||||
const uni_modules_wotDesignUni_components_composables_useTranslate = require("../composables/useTranslate.js");
|
||||
const uni_modules_wotDesignUni_components_wdInput_types = require("./types.js");
|
||||
if (!Math) {
|
||||
wdIcon();
|
||||
}
|
||||
const wdIcon = () => "../wd-icon/wd-icon.js";
|
||||
const __default__ = {
|
||||
name: "wd-input",
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
};
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: uni_modules_wotDesignUni_components_wdInput_types.inputProps,
|
||||
emits: [
|
||||
"update:modelValue",
|
||||
"clear",
|
||||
"blur",
|
||||
"focus",
|
||||
"input",
|
||||
"keyboardheightchange",
|
||||
"confirm",
|
||||
"clicksuffixicon",
|
||||
"clickprefixicon",
|
||||
"click"
|
||||
],
|
||||
setup(__props, { emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const slots = common_vendor.useSlots();
|
||||
const { translate } = uni_modules_wotDesignUni_components_composables_useTranslate.useTranslate("input");
|
||||
const isPwdVisible = common_vendor.ref(false);
|
||||
const clearing = common_vendor.ref(false);
|
||||
const focused = common_vendor.ref(false);
|
||||
const focusing = common_vendor.ref(false);
|
||||
const inputValue = common_vendor.ref(getInitValue());
|
||||
const cell = uni_modules_wotDesignUni_components_composables_useCell.useCell();
|
||||
common_vendor.watch(
|
||||
() => props.focus,
|
||||
(newValue) => {
|
||||
focused.value = newValue;
|
||||
},
|
||||
{ immediate: true, deep: true }
|
||||
);
|
||||
common_vendor.watch(
|
||||
() => props.modelValue,
|
||||
(newValue) => {
|
||||
inputValue.value = uni_modules_wotDesignUni_components_common_util.isDef(newValue) ? String(newValue) : "";
|
||||
}
|
||||
);
|
||||
const { parent: form } = uni_modules_wotDesignUni_components_composables_useParent.useParent(uni_modules_wotDesignUni_components_wdForm_types.FORM_KEY);
|
||||
const placeholderValue = common_vendor.computed(() => {
|
||||
return uni_modules_wotDesignUni_components_common_util.isDef(props.placeholder) ? props.placeholder : translate("placeholder");
|
||||
});
|
||||
const showClear = common_vendor.computed(() => {
|
||||
const { disabled, readonly, clearable, clearTrigger } = props;
|
||||
if (clearable && !readonly && !disabled && inputValue.value && (clearTrigger === "always" || props.clearTrigger === "focus" && focusing.value)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
const showWordCount = common_vendor.computed(() => {
|
||||
const { disabled, readonly, maxlength, showWordLimit } = props;
|
||||
return Boolean(!disabled && !readonly && uni_modules_wotDesignUni_components_common_util.isDef(maxlength) && maxlength > -1 && showWordLimit);
|
||||
});
|
||||
const errorMessage = common_vendor.computed(() => {
|
||||
if (form && props.prop && form.errorMessages && form.errorMessages[props.prop]) {
|
||||
return form.errorMessages[props.prop];
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
});
|
||||
const isRequired = common_vendor.computed(() => {
|
||||
let formRequired = false;
|
||||
if (form && form.props.rules) {
|
||||
const rules = form.props.rules;
|
||||
for (const key in rules) {
|
||||
if (Object.prototype.hasOwnProperty.call(rules, key) && key === props.prop && Array.isArray(rules[key])) {
|
||||
formRequired = rules[key].some((rule) => rule.required);
|
||||
}
|
||||
}
|
||||
}
|
||||
return props.required || props.rules.some((rule) => rule.required) || formRequired;
|
||||
});
|
||||
const rootClass = common_vendor.computed(() => {
|
||||
return `wd-input ${props.label || slots.label ? "is-cell" : ""} ${props.center ? "is-center" : ""} ${cell.border.value ? "is-border" : ""} ${props.size ? "is-" + props.size : ""} ${props.error ? "is-error" : ""} ${props.disabled ? "is-disabled" : ""} ${inputValue.value && String(inputValue.value).length > 0 ? "is-not-empty" : ""} ${props.noBorder ? "is-no-border" : ""} ${props.customClass}`;
|
||||
});
|
||||
const labelClass = common_vendor.computed(() => {
|
||||
return `wd-input__label ${props.customLabelClass}`;
|
||||
});
|
||||
const inputPlaceholderClass = common_vendor.computed(() => {
|
||||
return `wd-input__placeholder ${props.placeholderClass}`;
|
||||
});
|
||||
const labelStyle = common_vendor.computed(() => {
|
||||
return props.labelWidth ? uni_modules_wotDesignUni_components_common_util.objToStyle({
|
||||
"min-width": props.labelWidth,
|
||||
"max-width": props.labelWidth
|
||||
}) : "";
|
||||
});
|
||||
function getInitValue() {
|
||||
const formatted = formatValue(props.modelValue);
|
||||
if (!isValueEqual(formatted, props.modelValue)) {
|
||||
emit("update:modelValue", formatted);
|
||||
}
|
||||
return formatted;
|
||||
}
|
||||
function formatValue(value) {
|
||||
const { maxlength } = props;
|
||||
if (uni_modules_wotDesignUni_components_common_util.isDef(maxlength) && maxlength !== -1 && String(value).length > maxlength) {
|
||||
return value.toString().slice(0, maxlength);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function togglePwdVisible() {
|
||||
isPwdVisible.value = !isPwdVisible.value;
|
||||
}
|
||||
async function handleClear() {
|
||||
focusing.value = false;
|
||||
inputValue.value = "";
|
||||
if (props.focusWhenClear) {
|
||||
clearing.value = true;
|
||||
focused.value = false;
|
||||
}
|
||||
await uni_modules_wotDesignUni_components_common_util.pause();
|
||||
if (props.focusWhenClear) {
|
||||
focused.value = true;
|
||||
focusing.value = true;
|
||||
}
|
||||
emit("update:modelValue", inputValue.value);
|
||||
emit("clear");
|
||||
}
|
||||
async function handleBlur() {
|
||||
await uni_modules_wotDesignUni_components_common_util.pause(150);
|
||||
if (clearing.value) {
|
||||
clearing.value = false;
|
||||
return;
|
||||
}
|
||||
focusing.value = false;
|
||||
emit("blur", {
|
||||
value: inputValue.value
|
||||
});
|
||||
}
|
||||
function handleFocus({ detail }) {
|
||||
focusing.value = true;
|
||||
emit("focus", detail);
|
||||
}
|
||||
function handleInput({ detail }) {
|
||||
emit("update:modelValue", inputValue.value);
|
||||
emit("input", detail);
|
||||
}
|
||||
function handleKeyboardheightchange({ detail }) {
|
||||
emit("keyboardheightchange", detail);
|
||||
}
|
||||
function handleConfirm({ detail }) {
|
||||
emit("confirm", detail);
|
||||
}
|
||||
function onClickSuffixIcon() {
|
||||
emit("clicksuffixicon");
|
||||
}
|
||||
function onClickPrefixIcon() {
|
||||
emit("clickprefixicon");
|
||||
}
|
||||
function handleClick(event) {
|
||||
emit("click", event);
|
||||
}
|
||||
function isValueEqual(value1, value2) {
|
||||
return uni_modules_wotDesignUni_components_common_util.isEqual(String(value1), String(value2));
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: _ctx.label || _ctx.$slots.label
|
||||
}, _ctx.label || _ctx.$slots.label ? common_vendor.e({
|
||||
b: isRequired.value && _ctx.markerSide === "before"
|
||||
}, isRequired.value && _ctx.markerSide === "before" ? {} : {}, {
|
||||
c: _ctx.prefixIcon || _ctx.$slots.prefix
|
||||
}, _ctx.prefixIcon || _ctx.$slots.prefix ? common_vendor.e({
|
||||
d: _ctx.prefixIcon && !_ctx.$slots.prefix
|
||||
}, _ctx.prefixIcon && !_ctx.$slots.prefix ? {
|
||||
e: common_vendor.o(onClickPrefixIcon),
|
||||
f: common_vendor.p({
|
||||
["custom-class"]: "wd-input__icon",
|
||||
name: _ctx.prefixIcon
|
||||
})
|
||||
} : {}) : {}, {
|
||||
g: _ctx.label && !_ctx.$slots.label
|
||||
}, _ctx.label && !_ctx.$slots.label ? {
|
||||
h: common_vendor.t(_ctx.label)
|
||||
} : _ctx.$slots.label ? {} : {}, {
|
||||
i: _ctx.$slots.label,
|
||||
j: isRequired.value && _ctx.markerSide === "after"
|
||||
}, isRequired.value && _ctx.markerSide === "after" ? {} : {}, {
|
||||
k: common_vendor.n(labelClass.value),
|
||||
l: common_vendor.s(labelStyle.value)
|
||||
}) : {}, {
|
||||
m: (_ctx.prefixIcon || _ctx.$slots.prefix) && !_ctx.label
|
||||
}, (_ctx.prefixIcon || _ctx.$slots.prefix) && !_ctx.label ? common_vendor.e({
|
||||
n: _ctx.prefixIcon && !_ctx.$slots.prefix
|
||||
}, _ctx.prefixIcon && !_ctx.$slots.prefix ? {
|
||||
o: common_vendor.o(onClickPrefixIcon),
|
||||
p: common_vendor.p({
|
||||
["custom-class"]: "wd-input__icon",
|
||||
name: _ctx.prefixIcon
|
||||
})
|
||||
} : {}) : {}, {
|
||||
q: common_vendor.n(_ctx.prefixIcon ? "wd-input__inner--prefix" : ""),
|
||||
r: common_vendor.n(showWordCount.value ? "wd-input__inner--count" : ""),
|
||||
s: common_vendor.n(_ctx.alignRight ? "is-align-right" : ""),
|
||||
t: common_vendor.n(_ctx.customInputClass),
|
||||
v: _ctx.type,
|
||||
w: _ctx.showPassword && !isPwdVisible.value,
|
||||
x: placeholderValue.value,
|
||||
y: _ctx.disabled || _ctx.readonly,
|
||||
z: _ctx.maxlength,
|
||||
A: focused.value,
|
||||
B: _ctx.confirmType,
|
||||
C: _ctx.confirmHold,
|
||||
D: _ctx.cursor,
|
||||
E: _ctx.cursorSpacing,
|
||||
F: _ctx.placeholderStyle,
|
||||
G: _ctx.selectionStart,
|
||||
H: _ctx.selectionEnd,
|
||||
I: _ctx.adjustPosition,
|
||||
J: _ctx.holdKeyboard,
|
||||
K: _ctx.alwaysEmbed,
|
||||
L: inputPlaceholderClass.value,
|
||||
M: _ctx.ignoreCompositionEvent,
|
||||
N: _ctx.inputmode,
|
||||
O: common_vendor.o([($event) => inputValue.value = $event.detail.value, handleInput]),
|
||||
P: common_vendor.o(handleFocus),
|
||||
Q: common_vendor.o(handleBlur),
|
||||
R: common_vendor.o(handleConfirm),
|
||||
S: common_vendor.o(handleKeyboardheightchange),
|
||||
T: inputValue.value,
|
||||
U: props.readonly
|
||||
}, props.readonly ? {} : {}, {
|
||||
V: showClear.value || _ctx.showPassword || _ctx.suffixIcon || showWordCount.value || _ctx.$slots.suffix
|
||||
}, showClear.value || _ctx.showPassword || _ctx.suffixIcon || showWordCount.value || _ctx.$slots.suffix ? common_vendor.e({
|
||||
W: showClear.value
|
||||
}, showClear.value ? {
|
||||
X: common_vendor.o(handleClear),
|
||||
Y: common_vendor.p({
|
||||
["custom-class"]: "wd-input__clear",
|
||||
name: "error-fill"
|
||||
})
|
||||
} : {}, {
|
||||
Z: _ctx.showPassword
|
||||
}, _ctx.showPassword ? {
|
||||
aa: common_vendor.o(togglePwdVisible),
|
||||
ab: common_vendor.p({
|
||||
["custom-class"]: "wd-input__icon",
|
||||
name: isPwdVisible.value ? "view" : "eye-close"
|
||||
})
|
||||
} : {}, {
|
||||
ac: showWordCount.value
|
||||
}, showWordCount.value ? {
|
||||
ad: common_vendor.t(String(inputValue.value).length),
|
||||
ae: common_vendor.n(inputValue.value && String(inputValue.value).length > 0 ? "wd-input__count-current" : ""),
|
||||
af: common_vendor.n(String(inputValue.value).length > _ctx.maxlength ? "is-error" : ""),
|
||||
ag: common_vendor.t(_ctx.maxlength)
|
||||
} : {}, {
|
||||
ah: _ctx.suffixIcon && !_ctx.$slots.suffix
|
||||
}, _ctx.suffixIcon && !_ctx.$slots.suffix ? {
|
||||
ai: common_vendor.o(onClickSuffixIcon),
|
||||
aj: common_vendor.p({
|
||||
["custom-class"]: "wd-input__icon",
|
||||
name: _ctx.suffixIcon
|
||||
})
|
||||
} : {}) : {}, {
|
||||
ak: errorMessage.value
|
||||
}, errorMessage.value ? {
|
||||
al: common_vendor.t(errorMessage.value)
|
||||
} : {}, {
|
||||
am: common_vendor.n(rootClass.value),
|
||||
an: common_vendor.s(_ctx.customStyle),
|
||||
ao: common_vendor.o(handleClick)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4e0c9774"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-input/wd-input.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-input/wd-input.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-input/wd-input.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"wd-icon": "../wd-icon/wd-icon"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-input/wd-input.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-input/wd-input.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['data-v-4e0c9774', am]}}" style="{{an}}" bindtap="{{ao}}"><view wx:if="{{a}}" class="{{['data-v-4e0c9774', k]}}" style="{{l}}"><text wx:if="{{b}}" class="wd-input__required wd-input__required--left data-v-4e0c9774">*</text><view wx:if="{{c}}" class="wd-input__prefix data-v-4e0c9774"><wd-icon wx:if="{{d}}" class="data-v-4e0c9774" bindclick="{{e}}" u-i="4e0c9774-0" bind:__l="__l" u-p="{{f}}"/><slot wx:else name="prefix"></slot></view><view class="wd-input__label-inner data-v-4e0c9774"><text wx:if="{{g}}" class="data-v-4e0c9774">{{h}}</text><slot wx:elif="{{i}}" name="label"></slot></view><text wx:if="{{j}}" class="wd-input__required data-v-4e0c9774">*</text></view><view class="wd-input__body data-v-4e0c9774"><view class="wd-input__value data-v-4e0c9774"><view wx:if="{{m}}" class="wd-input__prefix data-v-4e0c9774"><wd-icon wx:if="{{n}}" class="data-v-4e0c9774" bindclick="{{o}}" u-i="4e0c9774-1" bind:__l="__l" u-p="{{p}}"/><slot wx:else name="prefix"></slot></view><block wx:if="{{r0}}"><input class="{{['data-v-4e0c9774', 'wd-input__inner', q, r, s, t]}}" type="{{v}}" password="{{w}}" placeholder="{{x}}" disabled="{{y}}" maxlength="{{z}}" focus="{{A}}" confirm-type="{{B}}" confirm-hold="{{C}}" cursor="{{D}}" cursor-spacing="{{E}}" placeholder-style="{{F}}" selection-start="{{G}}" selection-end="{{H}}" adjust-position="{{I}}" hold-keyboard="{{J}}" always-embed="{{K}}" placeholder-class="{{L}}" ignoreCompositionEvent="{{M}}" inputmode="{{N}}" bindinput="{{O}}" bindfocus="{{P}}" bindblur="{{Q}}" bindconfirm="{{R}}" bindkeyboardheightchange="{{S}}" value="{{T}}"/></block><view wx:if="{{U}}" class="wd-input__readonly-mask data-v-4e0c9774"/><view wx:if="{{V}}" class="wd-input__suffix data-v-4e0c9774"><wd-icon wx:if="{{W}}" class="data-v-4e0c9774" bindclick="{{X}}" u-i="4e0c9774-2" bind:__l="__l" u-p="{{Y}}"/><wd-icon wx:if="{{Z}}" class="data-v-4e0c9774" bindclick="{{aa}}" u-i="4e0c9774-3" bind:__l="__l" u-p="{{ab}}"/><view wx:if="{{ac}}" class="wd-input__count data-v-4e0c9774"><text class="{{['data-v-4e0c9774', ae, af]}}">{{ad}}</text> /{{ag}}</view><wd-icon wx:if="{{ah}}" class="data-v-4e0c9774" bindclick="{{ai}}" u-i="4e0c9774-4" bind:__l="__l" u-p="{{aj}}"/><slot wx:else name="suffix"></slot></view></view><view wx:if="{{ak}}" class="wd-input__error-message data-v-4e0c9774">{{al}}</view></view></view>
|
||||
600
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-input/wd-input.wxss
vendored
Normal file
600
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-input/wd-input.wxss
vendored
Normal file
@@ -0,0 +1,600 @@
|
||||
/* 水平间距 */
|
||||
/* 水平间距 */
|
||||
/**
|
||||
* 辅助函数
|
||||
*/
|
||||
/**
|
||||
* 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 */
|
||||
/**
|
||||
* 混合宏
|
||||
*/
|
||||
/**
|
||||
* 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 阴影
|
||||
*/
|
||||
.wot-theme-dark .wd-input.data-v-4e0c9774 {
|
||||
background: var(--wot-dark-background2, #1b1b1b);
|
||||
}
|
||||
.wot-theme-dark .wd-input.data-v-4e0c9774::after {
|
||||
background: var(--wot-dark-color-gray, var(--wot-color-secondary, #595959));
|
||||
}
|
||||
.wot-theme-dark .wd-input.is-not-empty.data-v-4e0c9774:not(.is-disabled)::after {
|
||||
background-color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wot-theme-dark .wd-input__inner.data-v-4e0c9774 {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wot-theme-dark .wd-input__inner.data-v-4e0c9774::-webkit-input-placeholder {
|
||||
color: var(--wot-dark-color3, rgba(232, 230, 227, 0.8));
|
||||
}
|
||||
.wot-theme-dark .wd-input__count.data-v-4e0c9774 {
|
||||
color: var(--wot-dark-color3, rgba(232, 230, 227, 0.8));
|
||||
background: transparent;
|
||||
}
|
||||
.wot-theme-dark .wd-input__count-current.data-v-4e0c9774 {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wot-theme-dark .wd-input.data-v-4e0c9774 .wd-input__icon,
|
||||
.wot-theme-dark .wd-input.data-v-4e0c9774 .wd-input__clear {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
background: transparent;
|
||||
}
|
||||
.wot-theme-dark .wd-input.is-cell.data-v-4e0c9774 {
|
||||
background-color: var(--wot-dark-background2, #1b1b1b);
|
||||
line-height: var(--wot-cell-line-height, 24px);
|
||||
}
|
||||
.wot-theme-dark .wd-input.is-cell.is-border.data-v-4e0c9774 {
|
||||
position: relative;
|
||||
}
|
||||
.wot-theme-dark .wd-input.is-cell.is-border.data-v-4e0c9774::after {
|
||||
position: absolute;
|
||||
display: block;
|
||||
content: "";
|
||||
width: calc(100% - var(--wot-input-cell-padding, 10px));
|
||||
height: 1px;
|
||||
left: var(--wot-input-cell-padding, 10px);
|
||||
top: 0;
|
||||
transform: scaleY(0.5);
|
||||
background: var(--wot-dark-border-color, #3a3a3c);
|
||||
}
|
||||
.wot-theme-dark .wd-input.is-disabled .wd-input__inner.data-v-4e0c9774 {
|
||||
color: var(--wot-dark-color-gray, var(--wot-color-secondary, #595959));
|
||||
background: transparent;
|
||||
}
|
||||
.wot-theme-dark .wd-input__label.data-v-4e0c9774 {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wd-input.data-v-4e0c9774 {
|
||||
position: relative;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
text-align: left;
|
||||
background: var(--wot-input-bg, var(--wot-color-white, white));
|
||||
}
|
||||
.wd-input.data-v-4e0c9774::after {
|
||||
position: absolute;
|
||||
content: "";
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 1px;
|
||||
background: var(--wot-input-border-color, #dadada);
|
||||
transform: scaleY(0.5);
|
||||
transition: background-color 0.2s ease-in-out;
|
||||
}
|
||||
.wd-input.is-not-empty.data-v-4e0c9774:not(.is-disabled)::after {
|
||||
background-color: var(--wot-input-not-empty-border-color, #262626);
|
||||
}
|
||||
.wd-input__label.data-v-4e0c9774 {
|
||||
position: relative;
|
||||
display: flex;
|
||||
width: var(--wot-input-cell-label-width, 33%);
|
||||
color: var(--wot-cell-title-color, rgba(0, 0, 0, 0.85));
|
||||
margin-right: var(--wot-cell-padding, var(--wot-size-side-padding, 15px));
|
||||
box-sizing: border-box;
|
||||
font-size: var(--wot-input-fs, var(--wot-cell-title-fs, 14px));
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.wd-input__label-inner.data-v-4e0c9774 {
|
||||
display: inline-block;
|
||||
font-size: var(--wot-input-fs, var(--wot-cell-title-fs, 14px));
|
||||
line-height: var(--wot-cell-line-height, 24px);
|
||||
}
|
||||
.wd-input__required.data-v-4e0c9774 {
|
||||
font-size: var(--wot-cell-required-size, 18px);
|
||||
color: var(--wot-cell-required-color, var(--wot-color-danger, #fa4350));
|
||||
margin-left: var(--wot-cell-required-margin, 4px);
|
||||
}
|
||||
.wd-input__required--left.data-v-4e0c9774 {
|
||||
margin-left: 0;
|
||||
margin-right: var(--wot-cell-required-margin, 4px);
|
||||
}
|
||||
.wd-input__body.data-v-4e0c9774 {
|
||||
flex: 1;
|
||||
}
|
||||
.wd-input__value.data-v-4e0c9774 {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
.wd-input__prefix.data-v-4e0c9774 {
|
||||
margin-right: var(--wot-input-icon-margin, 8px);
|
||||
font-size: var(--wot-input-fs, var(--wot-cell-title-fs, 14px));
|
||||
line-height: initial;
|
||||
}
|
||||
.wd-input__prefix.data-v-4e0c9774 .wd-input__icon,
|
||||
.wd-input__prefix.data-v-4e0c9774 .wd-input__clear {
|
||||
margin-left: 0;
|
||||
}
|
||||
.wd-input__suffix.data-v-4e0c9774 {
|
||||
flex-shrink: 0;
|
||||
line-height: initial;
|
||||
}
|
||||
.wd-input__error-message.data-v-4e0c9774 {
|
||||
color: var(--wot-form-item-error-message-color, var(--wot-color-danger, #fa4350));
|
||||
font-size: var(--wot-form-item-error-message-font-size, var(--wot-fs-secondary, 12px));
|
||||
line-height: var(--wot-form-item-error-message-line-height, 24px);
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.wd-input.is-disabled .wd-input__inner.data-v-4e0c9774 {
|
||||
color: var(--wot-input-disabled-color, #d9d9d9);
|
||||
background: transparent;
|
||||
}
|
||||
.wd-input.is-error .wd-input__inner.data-v-4e0c9774 {
|
||||
color: var(--wot-input-error-color, var(--wot-color-danger, #fa4350));
|
||||
background: transparent;
|
||||
}
|
||||
.wd-input.is-no-border.data-v-4e0c9774::after {
|
||||
display: none;
|
||||
}
|
||||
.wd-input.is-no-border .wd-input__inner.data-v-4e0c9774 {
|
||||
height: var(--wot-input-inner-height-no-border, 24px);
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.wd-input.is-cell.data-v-4e0c9774 {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
padding: var(--wot-input-cell-padding, 10px) var(--wot-input-padding, var(--wot-size-side-padding, 15px));
|
||||
background-color: var(--wot-input-cell-bg, var(--wot-color-white, white));
|
||||
}
|
||||
.wd-input.is-cell.is-error.data-v-4e0c9774::after {
|
||||
background: var(--wot-input-cell-border-color, var(--wot-color-border-light, #e8e8e8));
|
||||
}
|
||||
.wd-input.is-cell.data-v-4e0c9774 .wd-input__icon,
|
||||
.wd-input.is-cell.data-v-4e0c9774 .wd-input__clear {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
height: var(--wot-input-cell-height, 24px);
|
||||
line-height: var(--wot-input-cell-height, 24px);
|
||||
}
|
||||
.wd-input.is-cell .wd-input__prefix.data-v-4e0c9774 {
|
||||
display: inline-block;
|
||||
margin-right: var(--wot-cell-icon-right, 4px);
|
||||
}
|
||||
.wd-input.is-cell .wd-input__inner.data-v-4e0c9774 {
|
||||
height: var(--wot-input-cell-height, 24px);
|
||||
}
|
||||
.wd-input.is-cell.wd-input.data-v-4e0c9774::after {
|
||||
display: none;
|
||||
}
|
||||
.wd-input.is-cell.is-center.data-v-4e0c9774 {
|
||||
align-items: center;
|
||||
}
|
||||
.wd-input.is-cell.is-border.data-v-4e0c9774 {
|
||||
position: relative;
|
||||
}
|
||||
.wd-input.is-cell.is-border.data-v-4e0c9774::after {
|
||||
position: absolute;
|
||||
display: block;
|
||||
content: "";
|
||||
width: calc(100% - var(--wot-input-cell-padding, 10px));
|
||||
height: 1px;
|
||||
left: var(--wot-input-cell-padding, 10px);
|
||||
top: 0;
|
||||
transform: scaleY(0.5);
|
||||
background: var(--wot-color-border-light, #e8e8e8);
|
||||
}
|
||||
.wd-input.is-large.data-v-4e0c9774 {
|
||||
padding: var(--wot-input-cell-padding-large, 12px);
|
||||
}
|
||||
.wd-input.is-large .wd-input__prefix.data-v-4e0c9774 {
|
||||
font-size: var(--wot-input-fs-large, var(--wot-cell-title-fs-large, 16px));
|
||||
}
|
||||
.wd-input.is-large .wd-input__label-inner.data-v-4e0c9774 {
|
||||
font-size: var(--wot-input-fs-large, var(--wot-cell-title-fs-large, 16px));
|
||||
}
|
||||
.wd-input.is-large .wd-input__inner.data-v-4e0c9774 {
|
||||
font-size: var(--wot-input-fs-large, var(--wot-cell-title-fs-large, 16px));
|
||||
}
|
||||
.wd-input.is-large .wd-input__count.data-v-4e0c9774 {
|
||||
font-size: var(--wot-input-count-fs-large, 14px);
|
||||
}
|
||||
.wd-input.is-large.data-v-4e0c9774 .wd-input__icon,
|
||||
.wd-input.is-large.data-v-4e0c9774 .wd-input__clear {
|
||||
font-size: var(--wot-input-icon-size-large, 18px);
|
||||
}
|
||||
.wd-input__inner.data-v-4e0c9774 {
|
||||
flex: 1;
|
||||
height: var(--wot-input-inner-height, 34px);
|
||||
font-size: var(--wot-input-fs, var(--wot-cell-title-fs, 14px));
|
||||
color: var(--wot-input-color, #262626);
|
||||
outline: none;
|
||||
border: none;
|
||||
background: none;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.wd-input__inner.data-v-4e0c9774::-webkit-input-placeholder {
|
||||
color: var(--wot-input-placeholder-color, #bfbfbf);
|
||||
}
|
||||
.wd-input__inner.is-align-right.data-v-4e0c9774 {
|
||||
text-align: right;
|
||||
}
|
||||
.wd-input__readonly-mask.data-v-4e0c9774 {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.data-v-4e0c9774 .wd-input__icon {
|
||||
margin-left: var(--wot-input-icon-margin, 8px);
|
||||
font-size: var(--wot-input-icon-size, 16px);
|
||||
color: var(--wot-input-icon-color, #bfbfbf);
|
||||
vertical-align: middle;
|
||||
background: var(--wot-input-bg, var(--wot-color-white, white));
|
||||
}
|
||||
.data-v-4e0c9774 .wd-input__clear {
|
||||
margin-left: var(--wot-input-icon-margin, 8px);
|
||||
font-size: var(--wot-input-icon-size, 16px);
|
||||
color: var(--wot-input-clear-color, #585858);
|
||||
vertical-align: middle;
|
||||
background: var(--wot-input-bg, var(--wot-color-white, white));
|
||||
}
|
||||
.wd-input__count.data-v-4e0c9774 {
|
||||
margin-left: 15px;
|
||||
font-size: var(--wot-input-count-fs, 14px);
|
||||
color: var(--wot-input-count-color, #bfbfbf);
|
||||
vertical-align: middle;
|
||||
background: var(--wot-input-bg, var(--wot-color-white, white));
|
||||
}
|
||||
.wd-input__count-current.data-v-4e0c9774 {
|
||||
color: var(--wot-input-count-current-color, #262626);
|
||||
}
|
||||
.wd-input__count-current.is-error.data-v-4e0c9774 {
|
||||
color: var(--wot-input-error-color, var(--wot-color-danger, #fa4350));
|
||||
}
|
||||
.wd-input .wd-input__count.data-v-4e0c9774,
|
||||
.wd-input .wd-input__count-current.data-v-4e0c9774 {
|
||||
display: inline-flex;
|
||||
}
|
||||
/* 水平间距 */
|
||||
/* 水平间距 */
|
||||
/**
|
||||
* 辅助函数
|
||||
*/
|
||||
/**
|
||||
* 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 */
|
||||
/**
|
||||
* 混合宏
|
||||
*/
|
||||
/**
|
||||
* 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 阴影
|
||||
*/
|
||||
.wot-theme-dark .wd-input__placeholder {
|
||||
color: var(--wot-dark-color3, rgba(232, 230, 227, 0.8));
|
||||
}
|
||||
.wd-input__placeholder {
|
||||
color: var(--wot-input-placeholder-color, #bfbfbf);
|
||||
}
|
||||
.wd-input__placeholder.is-error {
|
||||
color: var(--wot-input-error-color, var(--wot-color-danger, #fa4350));
|
||||
}
|
||||
19
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-loading/types.js
vendored
Normal file
19
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-loading/types.js
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
const uni_modules_wotDesignUni_components_common_props = require("../common/props.js");
|
||||
const loadingProps = {
|
||||
...uni_modules_wotDesignUni_components_common_props.baseProps,
|
||||
/**
|
||||
* 加载指示器类型,可选值:'outline' | 'ring'
|
||||
*/
|
||||
type: uni_modules_wotDesignUni_components_common_props.makeStringProp("ring"),
|
||||
/**
|
||||
* 设置加载指示器颜色
|
||||
*/
|
||||
color: uni_modules_wotDesignUni_components_common_props.makeStringProp("#4D80F0"),
|
||||
/**
|
||||
* 设置加载指示器大小
|
||||
*/
|
||||
size: uni_modules_wotDesignUni_components_common_props.makeNumericProp("")
|
||||
};
|
||||
exports.loadingProps = loadingProps;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-loading/types.js.map
|
||||
82
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-loading/wd-loading.js
vendored
Normal file
82
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-loading/wd-loading.js
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_wotDesignUni_components_common_base64 = require("../common/base64.js");
|
||||
const uni_modules_wotDesignUni_components_common_util = require("../common/util.js");
|
||||
const uni_modules_wotDesignUni_components_wdLoading_types = require("./types.js");
|
||||
const __default__ = {
|
||||
name: "wd-loading",
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
};
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: uni_modules_wotDesignUni_components_wdLoading_types.loadingProps,
|
||||
setup(__props) {
|
||||
const svgDefineId = uni_modules_wotDesignUni_components_common_util.context.id++;
|
||||
const svgDefineId1 = uni_modules_wotDesignUni_components_common_util.context.id++;
|
||||
const svgDefineId2 = uni_modules_wotDesignUni_components_common_util.context.id++;
|
||||
const icon = {
|
||||
outline(color = "#4D80F0") {
|
||||
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42 42"><defs><linearGradient x1="100%" y1="0%" x2="0%" y2="0%" id="${svgDefineId}"><stop stop-color="#FFF" offset="0%" stop-opacity="0"/><stop stop-color="#FFF" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path d="M21 1c11.046 0 20 8.954 20 20s-8.954 20-20 20S1 32.046 1 21 9.954 1 21 1zm0 7C13.82 8 8 13.82 8 21s5.82 13 13 13 13-5.82 13-13S28.18 8 21 8z" fill="${color}"/><path d="M4.599 21c0 9.044 7.332 16.376 16.376 16.376 9.045 0 16.376-7.332 16.376-16.376" stroke="url(#${svgDefineId}) " stroke-width="3.5" stroke-linecap="round"/></g></svg>`;
|
||||
},
|
||||
ring(color = "#4D80F0", intermediateColor2 = "#a6bff7") {
|
||||
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><linearGradient id="${svgDefineId1}" gradientUnits="userSpaceOnUse" x1="50" x2="50" y2="180"><stop offset="0" stop-color="${color}"></stop> <stop offset="1" stop-color="${intermediateColor2}"></stop></linearGradient> <path fill="url(#${svgDefineId1})" d="M20 100c0-44.1 35.9-80 80-80V0C44.8 0 0 44.8 0 100s44.8 100 100 100v-20c-44.1 0-80-35.9-80-80z"></path> <linearGradient id="${svgDefineId2}" gradientUnits="userSpaceOnUse" x1="150" y1="20" x2="150" y2="180"><stop offset="0" stop-color="#fff" stop-opacity="0"></stop> <stop offset="1" stop-color="${intermediateColor2}"></stop></linearGradient> <path fill="url(#${svgDefineId2})" d="M100 0v20c44.1 0 80 35.9 80 80s-35.9 80-80 80v20c55.2 0 100-44.8 100-100S155.2 0 100 0z"></path> <circle cx="100" cy="10" r="10" fill="${color}"></circle></svg>`;
|
||||
}
|
||||
};
|
||||
const props = __props;
|
||||
const svg = common_vendor.ref("");
|
||||
const intermediateColor = common_vendor.ref("");
|
||||
const iconSize = common_vendor.ref(null);
|
||||
common_vendor.watch(
|
||||
() => props.size,
|
||||
(newVal) => {
|
||||
iconSize.value = uni_modules_wotDesignUni_components_common_util.addUnit(newVal);
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
common_vendor.watch(
|
||||
() => props.type,
|
||||
() => {
|
||||
buildSvg();
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
const rootStyle = common_vendor.computed(() => {
|
||||
const style = {};
|
||||
if (uni_modules_wotDesignUni_components_common_util.isDef(iconSize.value)) {
|
||||
style.height = uni_modules_wotDesignUni_components_common_util.addUnit(iconSize.value);
|
||||
style.width = uni_modules_wotDesignUni_components_common_util.addUnit(iconSize.value);
|
||||
}
|
||||
return `${uni_modules_wotDesignUni_components_common_util.objToStyle(style)} ${props.customStyle}`;
|
||||
});
|
||||
common_vendor.onBeforeMount(() => {
|
||||
intermediateColor.value = uni_modules_wotDesignUni_components_common_util.gradient(props.color, "#ffffff", 2)[1];
|
||||
buildSvg();
|
||||
});
|
||||
function buildSvg() {
|
||||
const { type, color } = props;
|
||||
let ringType = uni_modules_wotDesignUni_components_common_util.isDef(type) ? type : "ring";
|
||||
const svgStr = `"data:image/svg+xml;base64,${uni_modules_wotDesignUni_components_common_base64.encode(ringType === "ring" ? icon[ringType](color, intermediateColor.value) : icon[ringType](color))}"`;
|
||||
svg.value = svgStr;
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.s(`background-image: url(${svg.value});`),
|
||||
b: common_vendor.n(`wd-loading ${props.customClass}`),
|
||||
c: common_vendor.s(rootStyle.value)
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f2b508ee"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-loading/wd-loading.js.map
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view class="{{['data-v-f2b508ee', b]}}" style="{{c}}"><view class="wd-loading__body data-v-f2b508ee"><view class="wd-loading__svg data-v-f2b508ee" style="{{a}}"></view></view></view>
|
||||
194
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-loading/wd-loading.wxss
vendored
Normal file
194
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-loading/wd-loading.wxss
vendored
Normal file
@@ -0,0 +1,194 @@
|
||||
/* 水平间距 */
|
||||
/* 水平间距 */
|
||||
/**
|
||||
* 混合宏
|
||||
*/
|
||||
/**
|
||||
* 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 */
|
||||
.wd-loading.data-v-f2b508ee {
|
||||
font-size: 0;
|
||||
line-height: 0;
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
width: var(--wot-loading-size, 32px);
|
||||
height: var(--wot-loading-size, 32px);
|
||||
}
|
||||
.wd-loading__body.data-v-f2b508ee {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
animation: wd-rotate-f2b508ee 0.8s linear infinite;
|
||||
animation-duration: 2s;
|
||||
}
|
||||
.wd-loading__svg.data-v-f2b508ee {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
@keyframes wd-rotate-f2b508ee {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
76
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-message-box/index.js
vendored
Normal file
76
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-message-box/index.js
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_wotDesignUni_components_common_util = require("../common/util.js");
|
||||
const messageDefaultOptionKey = "__MESSAGE_OPTION__";
|
||||
const None = Symbol("None");
|
||||
const defaultOptions = {
|
||||
title: "",
|
||||
showCancelButton: false,
|
||||
show: false,
|
||||
closeOnClickModal: true,
|
||||
msg: "",
|
||||
type: "alert",
|
||||
inputType: "text",
|
||||
inputValue: "",
|
||||
showErr: false,
|
||||
zIndex: 99,
|
||||
lazyRender: true,
|
||||
inputError: ""
|
||||
};
|
||||
function useMessage(selector = "") {
|
||||
const messageOptionKey = selector ? messageDefaultOptionKey + selector : messageDefaultOptionKey;
|
||||
const messageOption = common_vendor.inject(messageOptionKey, common_vendor.ref(None));
|
||||
if (messageOption.value === None) {
|
||||
messageOption.value = defaultOptions;
|
||||
common_vendor.provide(messageOptionKey, messageOption);
|
||||
}
|
||||
const createMethod = (type) => {
|
||||
return (options) => {
|
||||
const messageOptions = uni_modules_wotDesignUni_components_common_util.deepMerge({ type }, typeof options === "string" ? { title: options } : options);
|
||||
if (messageOptions.type === "confirm" || messageOptions.type === "prompt") {
|
||||
messageOptions.showCancelButton = true;
|
||||
} else {
|
||||
messageOptions.showCancelButton = false;
|
||||
}
|
||||
return show(messageOptions);
|
||||
};
|
||||
};
|
||||
const show = (option) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const options = uni_modules_wotDesignUni_components_common_util.deepMerge(defaultOptions, typeof option === "string" ? { title: option } : option);
|
||||
messageOption.value = uni_modules_wotDesignUni_components_common_util.deepMerge(options, {
|
||||
show: true,
|
||||
success: (res) => {
|
||||
close();
|
||||
resolve(res);
|
||||
},
|
||||
fail: (res) => {
|
||||
close();
|
||||
reject(res);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
const alert = createMethod("alert");
|
||||
const confirm = createMethod("confirm");
|
||||
const prompt = createMethod("prompt");
|
||||
const close = () => {
|
||||
if (messageOption.value !== None) {
|
||||
messageOption.value.show = false;
|
||||
}
|
||||
};
|
||||
return {
|
||||
show,
|
||||
alert,
|
||||
confirm,
|
||||
prompt,
|
||||
close
|
||||
};
|
||||
}
|
||||
const getMessageDefaultOptionKey = (selector) => {
|
||||
return selector ? `${messageDefaultOptionKey}${selector}` : messageDefaultOptionKey;
|
||||
};
|
||||
exports.defaultOptions = defaultOptions;
|
||||
exports.getMessageDefaultOptionKey = getMessageDefaultOptionKey;
|
||||
exports.useMessage = useMessage;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-message-box/index.js.map
|
||||
15
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-message-box/types.js
vendored
Normal file
15
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-message-box/types.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
const uni_modules_wotDesignUni_components_common_props = require("../common/props.js");
|
||||
const messageBoxProps = {
|
||||
...uni_modules_wotDesignUni_components_common_props.baseProps,
|
||||
/**
|
||||
* 指定唯一标识
|
||||
*/
|
||||
selector: uni_modules_wotDesignUni_components_common_props.makeStringProp(""),
|
||||
/**
|
||||
* 是否从页面中脱离出来,用于解决各种 fixed 失效问题 (H5: teleport, APP: renderjs, 小程序: root-portal)
|
||||
*/
|
||||
rootPortal: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false)
|
||||
};
|
||||
exports.messageBoxProps = messageBoxProps;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-message-box/types.js.map
|
||||
268
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-message-box/wd-message-box.js
vendored
Normal file
268
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-message-box/wd-message-box.js
vendored
Normal file
@@ -0,0 +1,268 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_wotDesignUni_components_wdMessageBox_types = require("./types.js");
|
||||
const uni_modules_wotDesignUni_components_wdMessageBox_index = require("./index.js");
|
||||
const uni_modules_wotDesignUni_components_common_util = require("../common/util.js");
|
||||
const uni_modules_wotDesignUni_components_composables_useTranslate = require("../composables/useTranslate.js");
|
||||
if (!Math) {
|
||||
(wdInput + wdButton + wdPopup)();
|
||||
}
|
||||
const wdPopup = () => "../wd-popup/wd-popup.js";
|
||||
const wdButton = () => "../wd-button/wd-button.js";
|
||||
const wdInput = () => "../wd-input/wd-input.js";
|
||||
const __default__ = {
|
||||
name: "wd-message-box",
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
};
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: uni_modules_wotDesignUni_components_wdMessageBox_types.messageBoxProps,
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
const { translate } = uni_modules_wotDesignUni_components_composables_useTranslate.useTranslate("message-box");
|
||||
const rootClass = common_vendor.computed(() => {
|
||||
return `wd-message-box__container ${props.customClass}`;
|
||||
});
|
||||
const bodyClass = common_vendor.computed(() => {
|
||||
return `wd-message-box__body ${!messageState.title ? "is-no-title" : ""} ${messageState.type === "prompt" ? "is-prompt" : ""}`;
|
||||
});
|
||||
const messageOptionKey = uni_modules_wotDesignUni_components_wdMessageBox_index.getMessageDefaultOptionKey(props.selector);
|
||||
const messageOption = common_vendor.inject(messageOptionKey, common_vendor.ref(uni_modules_wotDesignUni_components_wdMessageBox_index.defaultOptions));
|
||||
const messageState = common_vendor.reactive({
|
||||
msg: "",
|
||||
// 消息内容
|
||||
show: false,
|
||||
// 是否显示弹框
|
||||
title: "",
|
||||
// 标题
|
||||
showCancelButton: false,
|
||||
// 是否展示取消按钮
|
||||
closeOnClickModal: true,
|
||||
// 是否支持点击蒙层关闭
|
||||
confirmButtonText: "",
|
||||
// 确定按钮文案
|
||||
cancelButtonText: "",
|
||||
// 取消按钮文案
|
||||
type: "alert",
|
||||
// 弹框类型
|
||||
inputType: "text",
|
||||
// 输入框类型
|
||||
inputValue: "",
|
||||
// 输入框初始值
|
||||
inputPlaceholder: "",
|
||||
// 输入框placeholder
|
||||
inputError: "",
|
||||
// 输入框错误提示文案
|
||||
showErr: false,
|
||||
// 是否显示错误提示
|
||||
zIndex: 99,
|
||||
// 弹窗层级
|
||||
lazyRender: true
|
||||
// 弹层内容懒渲染
|
||||
});
|
||||
const customConfirmProps = common_vendor.computed(() => {
|
||||
const buttonProps = uni_modules_wotDesignUni_components_common_util.deepAssign(
|
||||
{
|
||||
block: true
|
||||
},
|
||||
uni_modules_wotDesignUni_components_common_util.isDef(messageState.confirmButtonProps) ? uni_modules_wotDesignUni_components_common_util.omitBy(messageState.confirmButtonProps, uni_modules_wotDesignUni_components_common_util.isUndefined) : {}
|
||||
);
|
||||
buttonProps.customClass = `${buttonProps.customClass || ""} wd-message-box__actions-btn`;
|
||||
return buttonProps;
|
||||
});
|
||||
const customCancelProps = common_vendor.computed(() => {
|
||||
const buttonProps = uni_modules_wotDesignUni_components_common_util.deepAssign(
|
||||
{
|
||||
block: true,
|
||||
type: "info"
|
||||
},
|
||||
uni_modules_wotDesignUni_components_common_util.isDef(messageState.cancelButtonProps) ? uni_modules_wotDesignUni_components_common_util.omitBy(messageState.cancelButtonProps, uni_modules_wotDesignUni_components_common_util.isUndefined) : {}
|
||||
);
|
||||
buttonProps.customClass = `${buttonProps.customClass || ""} wd-message-box__actions-btn`;
|
||||
return buttonProps;
|
||||
});
|
||||
common_vendor.watch(
|
||||
() => messageOption.value,
|
||||
(newVal) => {
|
||||
reset(newVal);
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
common_vendor.watch(
|
||||
() => messageState.show,
|
||||
(newValue) => {
|
||||
resetErr(!!newValue);
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
function toggleModal(action) {
|
||||
if (action === "modal" && !messageState.closeOnClickModal) {
|
||||
return;
|
||||
}
|
||||
if (messageState.type === "prompt" && action === "confirm" && !validate()) {
|
||||
return;
|
||||
}
|
||||
switch (action) {
|
||||
case "confirm":
|
||||
if (messageState.beforeConfirm) {
|
||||
messageState.beforeConfirm({
|
||||
resolve: (isPass) => {
|
||||
if (isPass) {
|
||||
handleConfirm({
|
||||
action,
|
||||
value: messageState.inputValue
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
handleConfirm({
|
||||
action,
|
||||
value: messageState.inputValue
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "cancel":
|
||||
handleCancel({
|
||||
action
|
||||
});
|
||||
break;
|
||||
default:
|
||||
handleCancel({
|
||||
action: "modal"
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
function handleConfirm(result) {
|
||||
messageState.show = false;
|
||||
if (uni_modules_wotDesignUni_components_common_util.isFunction(messageState.success)) {
|
||||
messageState.success(result);
|
||||
}
|
||||
}
|
||||
function handleCancel(result) {
|
||||
messageState.show = false;
|
||||
if (uni_modules_wotDesignUni_components_common_util.isFunction(messageState.fail)) {
|
||||
messageState.fail(result);
|
||||
}
|
||||
}
|
||||
function validate() {
|
||||
if (messageState.inputPattern && !messageState.inputPattern.test(String(messageState.inputValue))) {
|
||||
messageState.showErr = true;
|
||||
return false;
|
||||
}
|
||||
if (typeof messageState.inputValidate === "function") {
|
||||
const validateResult = messageState.inputValidate(messageState.inputValue);
|
||||
if (!validateResult) {
|
||||
messageState.showErr = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
messageState.showErr = false;
|
||||
return true;
|
||||
}
|
||||
function resetErr(val) {
|
||||
if (val === false) {
|
||||
messageState.showErr = false;
|
||||
}
|
||||
}
|
||||
function inputValChange({ value }) {
|
||||
if (value === "") {
|
||||
messageState.showErr = false;
|
||||
return;
|
||||
}
|
||||
messageState.inputValue = value;
|
||||
}
|
||||
function reset(option) {
|
||||
if (option) {
|
||||
messageState.title = uni_modules_wotDesignUni_components_common_util.isDef(option.title) ? option.title : "";
|
||||
messageState.showCancelButton = uni_modules_wotDesignUni_components_common_util.isDef(option.showCancelButton) ? option.showCancelButton : false;
|
||||
messageState.show = option.show;
|
||||
messageState.closeOnClickModal = option.closeOnClickModal;
|
||||
messageState.confirmButtonText = option.confirmButtonText;
|
||||
messageState.cancelButtonText = option.cancelButtonText;
|
||||
messageState.msg = option.msg;
|
||||
messageState.type = option.type;
|
||||
messageState.inputType = option.inputType;
|
||||
messageState.inputSize = option.inputSize;
|
||||
messageState.inputValue = option.inputValue;
|
||||
messageState.inputPlaceholder = option.inputPlaceholder;
|
||||
messageState.inputPattern = option.inputPattern;
|
||||
messageState.inputValidate = option.inputValidate;
|
||||
messageState.success = option.success;
|
||||
messageState.fail = option.fail;
|
||||
messageState.beforeConfirm = option.beforeConfirm;
|
||||
messageState.inputError = option.inputError;
|
||||
messageState.showErr = option.showErr;
|
||||
messageState.zIndex = option.zIndex;
|
||||
messageState.lazyRender = option.lazyRender;
|
||||
messageState.confirmButtonProps = option.confirmButtonProps;
|
||||
messageState.cancelButtonProps = option.cancelButtonProps;
|
||||
}
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: messageState.title
|
||||
}, messageState.title ? {
|
||||
b: common_vendor.t(messageState.title)
|
||||
} : {}, {
|
||||
c: messageState.type === "prompt"
|
||||
}, messageState.type === "prompt" ? common_vendor.e({
|
||||
d: common_vendor.o(inputValChange),
|
||||
e: common_vendor.o(($event) => messageState.inputValue = $event),
|
||||
f: common_vendor.p({
|
||||
type: messageState.inputType,
|
||||
size: messageState.inputSize,
|
||||
placeholder: messageState.inputPlaceholder,
|
||||
modelValue: messageState.inputValue
|
||||
}),
|
||||
g: messageState.showErr
|
||||
}, messageState.showErr ? {
|
||||
h: common_vendor.t(messageState.inputError || common_vendor.unref(translate)("inputNoValidate"))
|
||||
} : {}) : {}, {
|
||||
i: common_vendor.t(messageState.msg),
|
||||
j: common_vendor.n(bodyClass.value),
|
||||
k: messageState.showCancelButton
|
||||
}, messageState.showCancelButton ? {
|
||||
l: common_vendor.t(messageState.cancelButtonText || common_vendor.unref(translate)("cancel")),
|
||||
m: common_vendor.o(($event) => toggleModal("cancel")),
|
||||
n: common_vendor.p({
|
||||
...customCancelProps.value
|
||||
})
|
||||
} : {}, {
|
||||
o: common_vendor.t(messageState.confirmButtonText || common_vendor.unref(translate)("confirm")),
|
||||
p: common_vendor.o(($event) => toggleModal("confirm")),
|
||||
q: common_vendor.p({
|
||||
...customConfirmProps.value
|
||||
}),
|
||||
r: common_vendor.n(`wd-message-box__actions ${messageState.showCancelButton ? "wd-message-box__flex" : "wd-message-box__block"}`),
|
||||
s: common_vendor.n(rootClass.value),
|
||||
t: common_vendor.o(($event) => toggleModal("modal")),
|
||||
v: common_vendor.o(($event) => messageState.show = $event),
|
||||
w: common_vendor.p({
|
||||
transition: "zoom-in",
|
||||
["close-on-click-modal"]: messageState.closeOnClickModal,
|
||||
["lazy-render"]: messageState.lazyRender,
|
||||
["custom-class"]: "wd-message-box",
|
||||
["z-index"]: messageState.zIndex,
|
||||
duration: 200,
|
||||
["root-portal"]: _ctx.rootPortal,
|
||||
modelValue: messageState.show
|
||||
})
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-c8139c88"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-message-box/wd-message-box.js.map
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"wd-popup": "../wd-popup/wd-popup",
|
||||
"wd-button": "../wd-button/wd-button",
|
||||
"wd-input": "../wd-input/wd-input"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view class="data-v-c8139c88"><wd-popup wx:if="{{w}}" class="data-v-c8139c88" u-s="{{['d']}}" bindclickModal="{{t}}" u-i="c8139c88-0" bind:__l="__l" bindupdateModelValue="{{v}}" u-p="{{w}}"><view class="{{['data-v-c8139c88', s]}}"><view class="{{['data-v-c8139c88', j]}}"><view wx:if="{{a}}" class="wd-message-box__title data-v-c8139c88">{{b}}</view><view class="wd-message-box__content data-v-c8139c88"><block wx:if="{{c}}"><wd-input wx:if="{{f}}" class="data-v-c8139c88" bindinput="{{d}}" u-i="c8139c88-1,c8139c88-0" bind:__l="__l" bindupdateModelValue="{{e}}" u-p="{{f}}"/><view wx:if="{{g}}" class="wd-message-box__input-error data-v-c8139c88">{{h}}</view></block><block wx:if="{{$slots.d}}"><slot></slot></block><block wx:else>{{i}}</block></view></view><view class="{{['data-v-c8139c88', r]}}"><wd-button wx:if="{{k}}" class="data-v-c8139c88" u-s="{{['d']}}" bindclick="{{m}}" u-i="c8139c88-2,c8139c88-0" bind:__l="__l" u-p="{{n}}">{{l}}</wd-button><wd-button wx:if="{{q}}" class="data-v-c8139c88" u-s="{{['d']}}" bindclick="{{p}}" u-i="c8139c88-3,c8139c88-0" bind:__l="__l" u-p="{{q}}">{{o}}</wd-button></view></view></wd-popup></view>
|
||||
@@ -0,0 +1,246 @@
|
||||
/* 水平间距 */
|
||||
/* 水平间距 */
|
||||
/**
|
||||
* 辅助函数
|
||||
*/
|
||||
/**
|
||||
* 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 */
|
||||
/**
|
||||
* 混合宏
|
||||
*/
|
||||
/**
|
||||
* 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 阴影
|
||||
*/
|
||||
.wot-theme-dark .wd-message-box__body.data-v-c8139c88 {
|
||||
background-color: var(--wot-dark-background2, #1b1b1b);
|
||||
}
|
||||
.wot-theme-dark .wd-message-box__title.data-v-c8139c88 {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wot-theme-dark .wd-message-box__content.data-v-c8139c88 {
|
||||
color: var(--wot-dark-color3, rgba(232, 230, 227, 0.8));
|
||||
}
|
||||
.wot-theme-dark .wd-message-box__content.data-v-c8139c88::-webkit-scrollbar-thumb {
|
||||
background: var(--wot-dark-border-color, #3a3a3c);
|
||||
}
|
||||
.data-v-c8139c88 .wd-message-box {
|
||||
border-radius: var(--wot-message-box-radius, 16px);
|
||||
overflow: hidden;
|
||||
}
|
||||
.wd-message-box.data-v-c8139c88 {
|
||||
border-radius: var(--wot-message-box-radius, 16px);
|
||||
overflow: hidden;
|
||||
}
|
||||
.wd-message-box__container.data-v-c8139c88 {
|
||||
width: var(--wot-message-box-width, 300px);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.wd-message-box__body.data-v-c8139c88 {
|
||||
background-color: var(--wot-message-box-bg, var(--wot-color-white, white));
|
||||
padding: var(--wot-message-box-padding, 25px 24px 0);
|
||||
}
|
||||
.wd-message-box__body.is-no-title.data-v-c8139c88 {
|
||||
padding: 25px 24px 0px;
|
||||
}
|
||||
.wd-message-box__title.data-v-c8139c88 {
|
||||
text-align: center;
|
||||
font-size: var(--wot-message-box-title-fs, 16px);
|
||||
color: var(--wot-message-box-title-color, rgba(0, 0, 0, 0.85));
|
||||
line-height: 20px;
|
||||
font-weight: 500;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.wd-message-box__content.data-v-c8139c88 {
|
||||
max-height: var(--wot-message-box-content-max-height, 264px);
|
||||
color: var(--wot-message-box-content-color, #666666);
|
||||
font-size: var(--wot-message-box-content-fs, 14px);
|
||||
text-align: center;
|
||||
overflow: auto;
|
||||
line-height: 20px;
|
||||
}
|
||||
.wd-message-box__content.data-v-c8139c88::-webkit-scrollbar {
|
||||
width: var(--wot-message-box-content-scrollbar-width, 4px);
|
||||
}
|
||||
.wd-message-box__content.data-v-c8139c88::-webkit-scrollbar-thumb {
|
||||
width: var(--wot-message-box-content-scrollbar-width, 4px);
|
||||
background: var(--wot-message-box-content-scrollbar-color, rgba(0, 0, 0, 0.1));
|
||||
border-radius: calc(var(--wot-message-box-content-scrollbar-width, 4px) / 2);
|
||||
}
|
||||
.wd-message-box__input-error.data-v-c8139c88 {
|
||||
min-height: 18px;
|
||||
margin-top: 2px;
|
||||
color: var(--wot-message-box-input-error-color, var(--wot-input-error-color, var(--wot-color-danger, #fa4350)));
|
||||
text-align: left;
|
||||
}
|
||||
.wd-message-box__input-error.is-hidden.data-v-c8139c88 {
|
||||
visibility: hidden;
|
||||
}
|
||||
.wd-message-box__actions.data-v-c8139c88 {
|
||||
padding: 24px;
|
||||
}
|
||||
.data-v-c8139c88 .wd-message-box__actions-btn:not(:last-child) {
|
||||
margin-right: 16px;
|
||||
}
|
||||
.wd-message-box__flex.data-v-c8139c88 {
|
||||
display: flex;
|
||||
}
|
||||
.wd-message-box__block.data-v-c8139c88 {
|
||||
display: block;
|
||||
}
|
||||
.wd-message-box__cancel.data-v-c8139c88 {
|
||||
margin-right: 16px;
|
||||
}
|
||||
51
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/types.js
vendored
Normal file
51
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/types.js
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
"use strict";
|
||||
const uni_modules_wotDesignUni_components_common_props = require("../common/props.js");
|
||||
const navbarProps = {
|
||||
...uni_modules_wotDesignUni_components_common_props.baseProps,
|
||||
/**
|
||||
* 标题文字
|
||||
*/
|
||||
title: String,
|
||||
/**
|
||||
* 左侧文案
|
||||
*/
|
||||
leftText: String,
|
||||
/**
|
||||
* 右侧文案
|
||||
*/
|
||||
rightText: String,
|
||||
/**
|
||||
* 是否显示左侧箭头
|
||||
*/
|
||||
leftArrow: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 是否显示下边框
|
||||
*/
|
||||
bordered: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 是否固定到顶部
|
||||
*/
|
||||
fixed: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 固定在顶部时,是否在标签位置生成一个等高的占位元素
|
||||
*/
|
||||
placeholder: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 导航栏 z-index
|
||||
*/
|
||||
zIndex: uni_modules_wotDesignUni_components_common_props.makeNumberProp(500),
|
||||
/**
|
||||
* 是否开启顶部安全区适配
|
||||
*/
|
||||
safeAreaInsetTop: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 是否禁用左侧按钮,禁用时透明度降低,且无法点击
|
||||
*/
|
||||
leftDisabled: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 是否禁用右侧按钮,禁用时透明度降低,且无法点击
|
||||
*/
|
||||
rightDisabled: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false)
|
||||
};
|
||||
exports.navbarProps = navbarProps;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/types.js.map
|
||||
112
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/wd-navbar.js
vendored
Normal file
112
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/wd-navbar.js
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
"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_wdNavbar_types = require("./types.js");
|
||||
if (!Math) {
|
||||
wdIcon();
|
||||
}
|
||||
const wdIcon = () => "../wd-icon/wd-icon.js";
|
||||
const __default__ = {
|
||||
name: "wd-navbar",
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
};
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: uni_modules_wotDesignUni_components_wdNavbar_types.navbarProps,
|
||||
emits: ["click-left", "click-right"],
|
||||
setup(__props, { emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const height = common_vendor.ref("");
|
||||
const { statusBarHeight } = common_vendor.index.getSystemInfoSync();
|
||||
common_vendor.watch(
|
||||
[() => props.fixed, () => props.placeholder],
|
||||
() => {
|
||||
setPlaceholderHeight();
|
||||
},
|
||||
{ deep: true, immediate: false }
|
||||
);
|
||||
const rootStyle = common_vendor.computed(() => {
|
||||
const style = {};
|
||||
if (props.fixed && uni_modules_wotDesignUni_components_common_util.isDef(props.zIndex)) {
|
||||
style["z-index"] = props.zIndex;
|
||||
}
|
||||
if (props.safeAreaInsetTop) {
|
||||
style["padding-top"] = uni_modules_wotDesignUni_components_common_util.addUnit(statusBarHeight || 0);
|
||||
}
|
||||
return `${uni_modules_wotDesignUni_components_common_util.objToStyle(style)}${props.customStyle}`;
|
||||
});
|
||||
common_vendor.onMounted(() => {
|
||||
if (props.fixed && props.placeholder) {
|
||||
common_vendor.nextTick$1(() => {
|
||||
setPlaceholderHeight();
|
||||
});
|
||||
}
|
||||
});
|
||||
function handleClickLeft() {
|
||||
if (!props.leftDisabled) {
|
||||
emit("click-left");
|
||||
}
|
||||
}
|
||||
function handleClickRight() {
|
||||
if (!props.rightDisabled) {
|
||||
emit("click-right");
|
||||
}
|
||||
}
|
||||
const { proxy } = common_vendor.getCurrentInstance();
|
||||
function setPlaceholderHeight() {
|
||||
if (!props.fixed || !props.placeholder) {
|
||||
return;
|
||||
}
|
||||
uni_modules_wotDesignUni_components_common_util.getRect(".wd-navbar", false, proxy).then((res) => {
|
||||
height.value = res.height;
|
||||
});
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: _ctx.$slots.capsule
|
||||
}, _ctx.$slots.capsule ? {} : !_ctx.$slots.left ? common_vendor.e({
|
||||
c: _ctx.leftArrow
|
||||
}, _ctx.leftArrow ? {
|
||||
d: common_vendor.p({
|
||||
name: "arrow-left",
|
||||
["custom-class"]: "wd-navbar__arrow"
|
||||
})
|
||||
} : {}, {
|
||||
e: _ctx.leftText
|
||||
}, _ctx.leftText ? {
|
||||
f: common_vendor.t(_ctx.leftText)
|
||||
} : {}, {
|
||||
g: common_vendor.n(`wd-navbar__left ${_ctx.leftDisabled ? "is-disabled" : ""}`),
|
||||
h: common_vendor.o(handleClickLeft)
|
||||
}) : {
|
||||
i: common_vendor.n(`wd-navbar__left ${_ctx.leftDisabled ? "is-disabled" : ""}`),
|
||||
j: common_vendor.o(handleClickLeft)
|
||||
}, {
|
||||
b: !_ctx.$slots.left,
|
||||
k: !_ctx.$slots.title && _ctx.title
|
||||
}, !_ctx.$slots.title && _ctx.title ? {
|
||||
l: common_vendor.t(_ctx.title)
|
||||
} : {}, {
|
||||
m: _ctx.$slots.right || _ctx.rightText
|
||||
}, _ctx.$slots.right || _ctx.rightText ? common_vendor.e({
|
||||
n: !_ctx.$slots.right && _ctx.rightText
|
||||
}, !_ctx.$slots.right && _ctx.rightText ? {
|
||||
o: common_vendor.t(_ctx.rightText)
|
||||
} : {}, {
|
||||
p: common_vendor.n(`wd-navbar__right ${_ctx.rightDisabled ? "is-disabled" : ""}`),
|
||||
q: common_vendor.o(handleClickRight)
|
||||
}) : {}, {
|
||||
r: common_vendor.n(`wd-navbar ${_ctx.customClass} ${_ctx.fixed ? "is-fixed" : ""} ${_ctx.bordered ? "is-border" : ""}`),
|
||||
s: common_vendor.s(rootStyle.value),
|
||||
t: common_vendor.unref(uni_modules_wotDesignUni_components_common_util.addUnit)(height.value)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/wd-navbar.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/wd-navbar.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/wd-navbar.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"wd-icon": "../wd-icon/wd-icon"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/wd-navbar.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/wd-navbar.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view style="{{'height:' + t}}"><view class="{{r}}" style="{{s}}"><view class="wd-navbar__content"><view wx:if="{{a}}" class="wd-navbar__capsule"><slot name="capsule"/></view><view wx:elif="{{b}}" class="{{g}}" bindtap="{{h}}"><wd-icon wx:if="{{c}}" u-i="a56cc726-0" bind:__l="__l" u-p="{{d}}"/><view wx:if="{{e}}" class="wd-navbar__text">{{f}}</view></view><view wx:else class="{{i}}" bindtap="{{j}}"><slot name="left"/></view><view class="wd-navbar__title"><slot name="title"/><block wx:if="{{k}}">{{l}}</block></view><view wx:if="{{m}}" class="{{p}}" bindtap="{{q}}"><slot name="right"/><view wx:if="{{n}}" class="wd-navbar__text" hover-class="wd-navbar__text--hover" hover-stay-time="{{70}}">{{o}}</view></view></view></view></view>
|
||||
252
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/wd-navbar.wxss
vendored
Normal file
252
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/wd-navbar.wxss
vendored
Normal file
@@ -0,0 +1,252 @@
|
||||
/* 水平间距 */
|
||||
/* 水平间距 */
|
||||
/**
|
||||
* 混合宏
|
||||
*/
|
||||
/**
|
||||
* 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-navbar {
|
||||
background-color: var(--wot-dark-background, #131313);
|
||||
}
|
||||
.wot-theme-dark .wd-navbar__title {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wot-theme-dark .wd-navbar__text {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wot-theme-dark .wd-navbar .wd-navbar__arrow {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wd-navbar {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
height: var(--wot-navbar-height, 44px);
|
||||
line-height: var(--wot-navbar-height, 44px);
|
||||
background-color: var(--wot-navbar-background, var(--wot-color-white, white));
|
||||
box-sizing: content-box;
|
||||
}
|
||||
.wd-navbar__content {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.wd-navbar__title {
|
||||
max-width: 60%;
|
||||
height: 100%;
|
||||
margin: 0 auto;
|
||||
color: var(--wot-navbar-color, var(--wot-font-gray-1, rgba(0, 0, 0, 0.9)));
|
||||
font-weight: var(--wot-navbar-title-font-weight, 600);
|
||||
font-size: var(--wot-navbar-title-font-size, 18px);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.wd-navbar__text {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
color: var(--wot-navbar-desc-font-color, var(--wot-font-gray-1, rgba(0, 0, 0, 0.9)));
|
||||
}
|
||||
.wd-navbar__left, .wd-navbar__right, .wd-navbar__capsule {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
font-size: var(--wot-navbar-desc-font-size, 16px);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 12px;
|
||||
}
|
||||
.wd-navbar__left.is-disabled, .wd-navbar__right.is-disabled, .wd-navbar__capsule.is-disabled {
|
||||
opacity: var(--wot-navbar-disabled-opacity, 0.6);
|
||||
}
|
||||
.wd-navbar__left, .wd-navbar__capsule {
|
||||
left: 0;
|
||||
}
|
||||
.wd-navbar__right {
|
||||
right: 0;
|
||||
}
|
||||
.wd-navbar__arrow {
|
||||
font-size: var(--wot-navbar-arrow-size, 24px);
|
||||
color: var(--wot-navbar-color, var(--wot-font-gray-1, rgba(0, 0, 0, 0.9)));
|
||||
}
|
||||
.wd-navbar.is-border {
|
||||
position: relative;
|
||||
}
|
||||
.wd-navbar.is-border::after {
|
||||
position: absolute;
|
||||
display: block;
|
||||
content: "";
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
transform: scaleY(0.5);
|
||||
background: var(--wot-color-border-light, #e8e8e8);
|
||||
}
|
||||
.wd-navbar.is-fixed {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 500;
|
||||
}
|
||||
54
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-notice-bar/types.js
vendored
Normal file
54
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-notice-bar/types.js
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
"use strict";
|
||||
const uni_modules_wotDesignUni_components_common_props = require("../common/props.js");
|
||||
const noticeBarProps = {
|
||||
...uni_modules_wotDesignUni_components_common_props.baseProps,
|
||||
/**
|
||||
* 设置通知栏文案
|
||||
*/
|
||||
text: {
|
||||
type: [String, Array],
|
||||
default: ""
|
||||
},
|
||||
/**
|
||||
* 设置通知栏类型,可选值为:'warning' | 'info' | 'danger'
|
||||
*/
|
||||
type: uni_modules_wotDesignUni_components_common_props.makeStringProp("warning"),
|
||||
/**
|
||||
* 是否可滚动
|
||||
*/
|
||||
scrollable: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 滚动延迟时间(秒)
|
||||
*/
|
||||
delay: uni_modules_wotDesignUni_components_common_props.makeNumberProp(1),
|
||||
/**
|
||||
* 滚动速度(px/s)
|
||||
*/
|
||||
speed: uni_modules_wotDesignUni_components_common_props.makeNumberProp(50),
|
||||
/**
|
||||
* 是否可关闭
|
||||
*/
|
||||
closable: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 是否换行显示
|
||||
*/
|
||||
wrapable: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 设置左侧图标,使用 icon 章节中的图标名
|
||||
*/
|
||||
prefix: String,
|
||||
/**
|
||||
* 文字、图标颜色
|
||||
*/
|
||||
color: String,
|
||||
/**
|
||||
* 背景颜色
|
||||
*/
|
||||
backgroundColor: String,
|
||||
/**
|
||||
* 滚动方向
|
||||
*/
|
||||
direction: uni_modules_wotDesignUni_components_common_props.makeStringProp("horizontal")
|
||||
};
|
||||
exports.noticeBarProps = noticeBarProps;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-notice-bar/types.js.map
|
||||
249
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-notice-bar/wd-notice-bar.js
vendored
Normal file
249
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-notice-bar/wd-notice-bar.js
vendored
Normal file
@@ -0,0 +1,249 @@
|
||||
"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_wdNoticeBar_types = require("./types.js");
|
||||
if (!Math) {
|
||||
wdIcon();
|
||||
}
|
||||
const wdIcon = () => "../wd-icon/wd-icon.js";
|
||||
const __default__ = {
|
||||
name: "wd-notice-bar",
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
};
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: uni_modules_wotDesignUni_components_wdNoticeBar_types.noticeBarProps,
|
||||
emits: ["close", "next", "click"],
|
||||
setup(__props, { expose: __expose, emit: __emit }) {
|
||||
const $wrap = ".wd-notice-bar__wrap";
|
||||
const $content = ".wd-notice-bar__content";
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const wrapWidth = common_vendor.ref(0);
|
||||
const show = common_vendor.ref(true);
|
||||
const currentIndex = common_vendor.ref(0);
|
||||
const textArray = common_vendor.computed(() => Array.isArray(props.text) ? props.text : [props.text]);
|
||||
const currentText = common_vendor.computed(() => textArray.value[currentIndex.value]);
|
||||
const verticalIndex = common_vendor.ref(0);
|
||||
const wrapRect = common_vendor.ref(null);
|
||||
const contentRect = common_vendor.ref(null);
|
||||
const isHorizontal = common_vendor.computed(() => props.direction === "horizontal");
|
||||
const isVertical = common_vendor.computed(() => props.direction === "vertical");
|
||||
const transitionState = common_vendor.reactive({
|
||||
transitionProperty: "unset",
|
||||
transitionDelay: "unset",
|
||||
transitionDuration: "unset",
|
||||
transform: "none",
|
||||
transitionTimingFunction: "linear"
|
||||
});
|
||||
const animation = common_vendor.computed(() => {
|
||||
return uni_modules_wotDesignUni_components_common_util.objToStyle(transitionState);
|
||||
});
|
||||
const rootStyle = common_vendor.computed(() => {
|
||||
const style = {};
|
||||
if (uni_modules_wotDesignUni_components_common_util.isDef(props.color)) {
|
||||
style.color = props.color;
|
||||
}
|
||||
if (uni_modules_wotDesignUni_components_common_util.isDef(props.backgroundColor)) {
|
||||
style.background = props.backgroundColor;
|
||||
}
|
||||
return `${uni_modules_wotDesignUni_components_common_util.objToStyle(style)}${props.customStyle}`;
|
||||
});
|
||||
const noticeBarClass = common_vendor.computed(() => {
|
||||
const { type, wrapable, scrollable } = props;
|
||||
let noticeBarClasses = [];
|
||||
type && noticeBarClasses.push(`is-${type}`);
|
||||
if (isHorizontal.value) {
|
||||
!wrapable && !scrollable && noticeBarClasses.push("wd-notice-bar--ellipse");
|
||||
} else {
|
||||
noticeBarClasses.push("wd-notice-bar--ellipse");
|
||||
}
|
||||
wrapable && !scrollable && noticeBarClasses.push("wd-notice-bar--wrap");
|
||||
return noticeBarClasses.join(" ");
|
||||
});
|
||||
const { proxy } = common_vendor.getCurrentInstance();
|
||||
common_vendor.watch(
|
||||
() => props.text,
|
||||
() => {
|
||||
reset();
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
common_vendor.onMounted(() => {
|
||||
startTransition();
|
||||
});
|
||||
common_vendor.onActivated(() => {
|
||||
startTransition();
|
||||
});
|
||||
common_vendor.onDeactivated(() => {
|
||||
stopTransition();
|
||||
});
|
||||
function reset() {
|
||||
stopTransition();
|
||||
startTransition();
|
||||
}
|
||||
function startTransition() {
|
||||
common_vendor.nextTick$1(() => scroll());
|
||||
}
|
||||
function stopTransition() {
|
||||
transitionState.transitionProperty = "unset";
|
||||
transitionState.transitionDelay = "unset";
|
||||
transitionState.transitionDuration = "unset";
|
||||
transitionState.transform = "none";
|
||||
transitionState.transitionTimingFunction = "linear";
|
||||
currentIndex.value = 0;
|
||||
verticalIndex.value = 0;
|
||||
}
|
||||
function handleClose() {
|
||||
show.value = false;
|
||||
emit("close");
|
||||
}
|
||||
function setTransition({ duration, delay, translate }) {
|
||||
transitionState.transitionProperty = "all";
|
||||
transitionState.transitionDelay = `${delay}s`;
|
||||
transitionState.transitionDuration = `${duration}s`;
|
||||
transitionState.transform = `${props.direction === "vertical" ? "translateY" : "translateX"}(${translate}px)`;
|
||||
transitionState.transitionTimingFunction = "linear";
|
||||
}
|
||||
function queryRect() {
|
||||
return Promise.all([uni_modules_wotDesignUni_components_common_util.getRect($wrap, false, proxy), uni_modules_wotDesignUni_components_common_util.getRect($content, false, proxy)]);
|
||||
}
|
||||
async function verticalAnimate(height) {
|
||||
const translate = -(height / (textArray.value.length + 1)) * (currentIndex.value + 1);
|
||||
setTransition({
|
||||
duration: height / (textArray.value.length + 1) / props.speed,
|
||||
delay: props.delay,
|
||||
translate
|
||||
});
|
||||
}
|
||||
async function scroll() {
|
||||
const [wRect, cRect] = await queryRect();
|
||||
if (!wRect.width || !cRect.width || !cRect.height)
|
||||
return;
|
||||
wrapRect.value = wRect;
|
||||
contentRect.value = cRect;
|
||||
wrapWidth.value = wRect.width;
|
||||
if (isHorizontal.value) {
|
||||
if (props.scrollable) {
|
||||
setTransition({
|
||||
duration: cRect.width / props.speed,
|
||||
delay: props.delay,
|
||||
translate: -cRect.width
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (textArray.value.length > 1) {
|
||||
verticalAnimate(cRect.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
function next() {
|
||||
if (currentIndex.value >= textArray.value.length - 1) {
|
||||
currentIndex.value = 0;
|
||||
} else {
|
||||
currentIndex.value++;
|
||||
}
|
||||
emit("next", currentIndex.value);
|
||||
}
|
||||
function animationEnd() {
|
||||
if (isHorizontal.value) {
|
||||
setTransition({
|
||||
duration: 0,
|
||||
delay: 0,
|
||||
translate: wrapWidth.value + 1
|
||||
});
|
||||
} else {
|
||||
if (++verticalIndex.value >= textArray.value.length) {
|
||||
verticalIndex.value = 0;
|
||||
setTransition({
|
||||
duration: 0,
|
||||
delay: 0,
|
||||
translate: 0
|
||||
});
|
||||
}
|
||||
}
|
||||
const timer = setTimeout(() => {
|
||||
next();
|
||||
common_vendor.nextTick$1(async () => {
|
||||
try {
|
||||
const [wRect, cRect] = await queryRect();
|
||||
wrapRect.value = wRect;
|
||||
contentRect.value = cRect;
|
||||
wrapWidth.value = wRect.width || 0;
|
||||
} catch (error) {
|
||||
}
|
||||
if (!contentRect.value || !contentRect.value.width || !contentRect.value.height)
|
||||
return;
|
||||
if (isHorizontal.value) {
|
||||
setTransition({
|
||||
duration: (wrapWidth.value + contentRect.value.width) / props.speed,
|
||||
delay: props.delay,
|
||||
translate: -contentRect.value.width
|
||||
});
|
||||
} else {
|
||||
verticalAnimate(contentRect.value.height);
|
||||
}
|
||||
});
|
||||
clearTimeout(timer);
|
||||
}, 20);
|
||||
}
|
||||
function handleClick() {
|
||||
const result = uni_modules_wotDesignUni_components_common_util.isArray(props.text) ? {
|
||||
index: currentIndex.value,
|
||||
text: props.text[currentIndex.value]
|
||||
} : {
|
||||
index: 0,
|
||||
text: props.text
|
||||
};
|
||||
emit("click", result);
|
||||
}
|
||||
__expose({ reset });
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: show.value
|
||||
}, show.value ? common_vendor.e({
|
||||
b: _ctx.prefix
|
||||
}, _ctx.prefix ? {
|
||||
c: common_vendor.p({
|
||||
["custom-class"]: "wd-notice-bar__prefix",
|
||||
name: _ctx.prefix
|
||||
})
|
||||
} : {}, {
|
||||
d: isVertical.value
|
||||
}, isVertical.value ? common_vendor.e({
|
||||
e: common_vendor.f(textArray.value, (item, k0, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item),
|
||||
b: item
|
||||
};
|
||||
}),
|
||||
f: textArray.value.length > 1
|
||||
}, textArray.value.length > 1 ? {
|
||||
g: common_vendor.t(textArray.value[0])
|
||||
} : {}) : {
|
||||
h: common_vendor.t(currentText.value)
|
||||
}, {
|
||||
i: common_vendor.s(animation.value),
|
||||
j: common_vendor.o(animationEnd),
|
||||
k: common_vendor.o(handleClick),
|
||||
l: _ctx.closable
|
||||
}, _ctx.closable ? {
|
||||
m: common_vendor.o(handleClose),
|
||||
n: common_vendor.p({
|
||||
["custom-class"]: "wd-notice-bar__suffix",
|
||||
name: "close-bold"
|
||||
})
|
||||
} : {}, {
|
||||
o: common_vendor.n(`wd-notice-bar ${_ctx.customClass} ${noticeBarClass.value}`),
|
||||
p: common_vendor.s(rootStyle.value)
|
||||
}) : {});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-e7a73070"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-notice-bar/wd-notice-bar.js.map
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"wd-icon": "../wd-icon/wd-icon"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view wx:if="{{a}}" class="{{['data-v-e7a73070', o]}}" style="{{p}}"><wd-icon wx:if="{{b}}" class="data-v-e7a73070" u-i="e7a73070-0" bind:__l="__l" u-p="{{c}}"></wd-icon><slot wx:else name="prefix"></slot><view class="wd-notice-bar__wrap data-v-e7a73070"><view class="wd-notice-bar__content data-v-e7a73070" style="{{i}}" bindtransitionend="{{j}}" bindtap="{{k}}"><block wx:if="{{d}}"><view wx:for="{{e}}" wx:for-item="item" wx:key="b" class="data-v-e7a73070">{{item.a}}</view><view wx:if="{{f}}" class="data-v-e7a73070">{{g}}</view></block><block wx:else><block wx:if="{{$slots.d}}"><slot></slot></block><block wx:else>{{h}}</block></block></view></view><wd-icon wx:if="{{l}}" class="data-v-e7a73070" bindclick="{{m}}" u-i="e7a73070-1" bind:__l="__l" u-p="{{n}}"></wd-icon><slot wx:else name="suffix"></slot></view>
|
||||
227
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-notice-bar/wd-notice-bar.wxss
vendored
Normal file
227
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-notice-bar/wd-notice-bar.wxss
vendored
Normal file
@@ -0,0 +1,227 @@
|
||||
/* 水平间距 */
|
||||
/* 水平间距 */
|
||||
/**
|
||||
* 辅助函数
|
||||
*/
|
||||
/**
|
||||
* 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 */
|
||||
/**
|
||||
* 混合宏
|
||||
*/
|
||||
/**
|
||||
* 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 阴影
|
||||
*/
|
||||
.wd-notice-bar.data-v-e7a73070 {
|
||||
display: flex;
|
||||
padding: var(--wot-notice-bar-padding, 9px 20px 9px 15px);
|
||||
align-items: center;
|
||||
font-size: var(--wot-notice-bar-fs, 12px);
|
||||
border-radius: var(--wot-notice-bar-border-radius, 8px);
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.wd-notice-bar.is-warning.data-v-e7a73070 {
|
||||
background: var(--wot-notice-bar-warning-bg, #fff6c8);
|
||||
color: var(--wot-notice-bar-warning-color, var(--wot-color-warning, #f0883a));
|
||||
}
|
||||
.wd-notice-bar.is-info.data-v-e7a73070 {
|
||||
background: var(--wot-notice-bar-info-bg, #f4f9ff);
|
||||
color: var(--wot-notice-bar-info-color, var(--wot-color-theme, #4d80f0));
|
||||
}
|
||||
.wd-notice-bar.is-danger.data-v-e7a73070 {
|
||||
background: var(--wot-notice-bar-danger-bg, #feeced);
|
||||
color: var(--wot-notice-bar-danger-color, var(--wot-color-danger, #fa4350));
|
||||
}
|
||||
.data-v-e7a73070 .wd-notice-bar__prefix {
|
||||
padding-right: 4px;
|
||||
font-size: var(--wot-notice-bar-prefix-size, 18px);
|
||||
}
|
||||
.data-v-e7a73070 .wd-notice-bar__suffix {
|
||||
text-align: center;
|
||||
font-size: var(--wot-notice-bar-close-size, 18px);
|
||||
display: inline-block;
|
||||
background-color: var(--wot-notice-bar-close-bg, rgba(0, 0, 0, 0.15));
|
||||
color: var(--wot-notice-bar-close-color, var(--wot-color-white, white));
|
||||
padding: 0;
|
||||
border-radius: 0px 8px 0px 4px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
.wd-notice-bar__wrap.data-v-e7a73070 {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
height: var(--wot-notice-bar-line-height, 18px);
|
||||
overflow: hidden;
|
||||
line-height: var(--wot-notice-bar-line-height, 18px);
|
||||
}
|
||||
.wd-notice-bar__content.data-v-e7a73070 {
|
||||
position: absolute;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.wd-notice-bar--ellipse .wd-notice-bar__content.data-v-e7a73070 {
|
||||
position: static;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.wd-notice-bar--wrap .wd-notice-bar__wrap.data-v-e7a73070 {
|
||||
height: auto;
|
||||
}
|
||||
.wd-notice-bar--wrap .wd-notice-bar__content.data-v-e7a73070 {
|
||||
position: static;
|
||||
white-space: normal;
|
||||
}
|
||||
3
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-notify/index.js
vendored
Normal file
3
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-notify/index.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
require("../../../../common/vendor.js");
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-notify/index.js.map
|
||||
26
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-overlay/types.js
vendored
Normal file
26
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-overlay/types.js
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
const uni_modules_wotDesignUni_components_common_props = require("../common/props.js");
|
||||
const overlayProps = {
|
||||
...uni_modules_wotDesignUni_components_common_props.baseProps,
|
||||
/**
|
||||
* 是否展示遮罩层
|
||||
*/
|
||||
show: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 动画时长,单位毫秒
|
||||
*/
|
||||
duration: {
|
||||
type: [Object, Number, Boolean],
|
||||
default: 300
|
||||
},
|
||||
/**
|
||||
* 是否锁定滚动
|
||||
*/
|
||||
lockScroll: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 层级
|
||||
*/
|
||||
zIndex: uni_modules_wotDesignUni_components_common_props.makeNumberProp(10)
|
||||
};
|
||||
exports.overlayProps = overlayProps;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-overlay/types.js.map
|
||||
41
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-overlay/wd-overlay.js
vendored
Normal file
41
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-overlay/wd-overlay.js
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_wotDesignUni_components_wdOverlay_types = require("./types.js");
|
||||
if (!Math) {
|
||||
wdTransition();
|
||||
}
|
||||
const wdTransition = () => "../wd-transition/wd-transition.js";
|
||||
const __default__ = {
|
||||
name: "wd-overlay",
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
};
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: uni_modules_wotDesignUni_components_wdOverlay_types.overlayProps,
|
||||
emits: ["click"],
|
||||
setup(__props, { emit: __emit }) {
|
||||
const emit = __emit;
|
||||
function handleClick() {
|
||||
emit("click");
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.o(handleClick),
|
||||
b: common_vendor.p({
|
||||
show: _ctx.show,
|
||||
name: "fade",
|
||||
["custom-class"]: "wd-overlay",
|
||||
duration: _ctx.duration,
|
||||
["custom-style"]: `z-index: ${_ctx.zIndex}; ${_ctx.customStyle}`,
|
||||
["disable-touch-move"]: _ctx.lockScroll
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-overlay/wd-overlay.js.map
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"wd-transition": "../wd-transition/wd-transition"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<wd-transition wx:if="{{b}}" u-s="{{['d']}}" bindclick="{{a}}" u-i="7d2ead0b-0" bind:__l="__l" u-p="{{b}}"><slot></slot></wd-transition>
|
||||
177
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-overlay/wd-overlay.wxss
vendored
Normal file
177
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-overlay/wd-overlay.wxss
vendored
Normal file
@@ -0,0 +1,177 @@
|
||||
/* 水平间距 */
|
||||
/* 水平间距 */
|
||||
/**
|
||||
* 混合宏
|
||||
*/
|
||||
/**
|
||||
* 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-overlay {
|
||||
background: var(--wot-overlay-bg-dark, rgba(0, 0, 0, 0.75));
|
||||
}
|
||||
.wd-overlay {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: var(--wot-overlay-bg, rgba(0, 0, 0, 0.65));
|
||||
}
|
||||
84
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-picker-view/types.js
vendored
Normal file
84
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-picker-view/types.js
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
"use strict";
|
||||
const uni_modules_wotDesignUni_components_common_props = require("../common/props.js");
|
||||
const uni_modules_wotDesignUni_components_common_util = require("../common/util.js");
|
||||
const pickerViewProps = {
|
||||
...uni_modules_wotDesignUni_components_common_props.baseProps,
|
||||
/**
|
||||
* 加载状态
|
||||
*/
|
||||
loading: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 加载的颜色,只能使用十六进制的色值写法,且不能使用缩写
|
||||
*/
|
||||
loadingColor: uni_modules_wotDesignUni_components_common_props.makeStringProp("#4D80F0"),
|
||||
/**
|
||||
* picker内部滚筒高
|
||||
*/
|
||||
columnsHeight: uni_modules_wotDesignUni_components_common_props.makeNumberProp(217),
|
||||
/**
|
||||
* picker item的高度
|
||||
*/
|
||||
itemHeight: uni_modules_wotDesignUni_components_common_props.makeNumberProp(35),
|
||||
/**
|
||||
* 选项对象中,value对应的 key
|
||||
*/
|
||||
valueKey: uni_modules_wotDesignUni_components_common_props.makeStringProp("value"),
|
||||
/**
|
||||
* 选项对象中,展示的文本对应的 key
|
||||
*/
|
||||
labelKey: uni_modules_wotDesignUni_components_common_props.makeStringProp("label"),
|
||||
/**
|
||||
* 是否在手指松开时立即触发picker-view的 change 事件。若不开启则会在滚动动画结束后触发 change 事件,1.2.25版本起提供,仅微信小程序和支付宝小程序支持。
|
||||
*/
|
||||
immediateChange: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 选中项,如果为多列选择器,则其类型应为数组
|
||||
*/
|
||||
modelValue: {
|
||||
type: [String, Number, Boolean, Array, Array, Array],
|
||||
default: "",
|
||||
required: true
|
||||
},
|
||||
/**
|
||||
* 选择器数据,可以为字符串数组,也可以为对象数组,如果为二维数组,则为多列选择器
|
||||
*/
|
||||
columns: uni_modules_wotDesignUni_components_common_props.makeArrayProp(),
|
||||
/**
|
||||
* 接收 pickerView 实例、选中项、当前修改列的下标、resolve 作为入参,根据选中项和列下标进行判断,通过 pickerView 实例暴露出来的 setColumnData 方法修改其他列的数据源。
|
||||
*/
|
||||
columnChange: Function
|
||||
};
|
||||
function formatArray(array, valueKey, labelKey) {
|
||||
let tempArray = uni_modules_wotDesignUni_components_common_util.isArray(array) ? array : [array];
|
||||
const firstLevelTypeList = new Set(array.map(uni_modules_wotDesignUni_components_common_util.getType));
|
||||
if (firstLevelTypeList.size !== 1 && firstLevelTypeList.has("object")) {
|
||||
throw Error("The columns are correct");
|
||||
}
|
||||
if (!uni_modules_wotDesignUni_components_common_util.isArray(array[0])) {
|
||||
tempArray = [tempArray];
|
||||
}
|
||||
const result = tempArray.map((col) => {
|
||||
return col.map((row) => {
|
||||
if (!uni_modules_wotDesignUni_components_common_util.isObj(row)) {
|
||||
return {
|
||||
[valueKey]: row,
|
||||
[labelKey]: row
|
||||
};
|
||||
}
|
||||
if (!row.hasOwnProperty(valueKey) && !row.hasOwnProperty(labelKey)) {
|
||||
throw Error("Can't find valueKey and labelKey in columns");
|
||||
}
|
||||
if (!row.hasOwnProperty(labelKey)) {
|
||||
row[labelKey] = row[valueKey];
|
||||
}
|
||||
if (!row.hasOwnProperty(valueKey)) {
|
||||
row[valueKey] = row[labelKey];
|
||||
}
|
||||
return row;
|
||||
});
|
||||
});
|
||||
return result;
|
||||
}
|
||||
exports.formatArray = formatArray;
|
||||
exports.pickerViewProps = pickerViewProps;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-picker-view/types.js.map
|
||||
255
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-picker-view/wd-picker-view.js
vendored
Normal file
255
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-picker-view/wd-picker-view.js
vendored
Normal file
@@ -0,0 +1,255 @@
|
||||
"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_wdPickerView_types = require("./types.js");
|
||||
if (!Math) {
|
||||
wdLoading();
|
||||
}
|
||||
const wdLoading = () => "../wd-loading/wd-loading.js";
|
||||
const __default__ = {
|
||||
name: "wd-picker-view",
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
};
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: uni_modules_wotDesignUni_components_wdPickerView_types.pickerViewProps,
|
||||
emits: ["change", "pickstart", "pickend", "update:modelValue"],
|
||||
setup(__props, { expose: __expose, emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const formatColumns = common_vendor.ref([]);
|
||||
const selectedIndex = common_vendor.ref([]);
|
||||
common_vendor.watch(
|
||||
[() => props.modelValue, () => props.columns],
|
||||
(newValue, oldValue) => {
|
||||
if (!uni_modules_wotDesignUni_components_common_util.isEqual(oldValue[1], newValue[1])) {
|
||||
if (uni_modules_wotDesignUni_components_common_util.isArray(newValue[1]) && newValue[1].length > 0) {
|
||||
formatColumns.value = uni_modules_wotDesignUni_components_wdPickerView_types.formatArray(newValue[1], props.valueKey, props.labelKey);
|
||||
} else {
|
||||
formatColumns.value = [];
|
||||
selectedIndex.value = [];
|
||||
}
|
||||
}
|
||||
if (uni_modules_wotDesignUni_components_common_util.isDef(newValue[0])) {
|
||||
selectWithValue(newValue[0]);
|
||||
}
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
const { proxy } = common_vendor.getCurrentInstance();
|
||||
function selectWithValue(value) {
|
||||
if (formatColumns.value.length === 0) {
|
||||
selectedIndex.value = [];
|
||||
return;
|
||||
}
|
||||
if (value === "" || !uni_modules_wotDesignUni_components_common_util.isDef(value) || uni_modules_wotDesignUni_components_common_util.isArray(value) && value.length === 0) {
|
||||
value = formatColumns.value.map((col) => {
|
||||
return col[0][props.valueKey];
|
||||
});
|
||||
}
|
||||
const valueType = uni_modules_wotDesignUni_components_common_util.getType(value);
|
||||
const type = ["string", "number", "boolean", "array"];
|
||||
if (type.indexOf(valueType) === -1)
|
||||
common_vendor.index.__f__("error", "at uni_modules/wot-design-uni/components/wd-picker-view/wd-picker-view.vue:99", `value must be one of ${type.toString()}`);
|
||||
value = uni_modules_wotDesignUni_components_common_util.isArray(value) ? value : [value];
|
||||
value = value.slice(0, formatColumns.value.length);
|
||||
let selected = uni_modules_wotDesignUni_components_common_util.deepClone(selectedIndex.value);
|
||||
value.forEach((target, col) => {
|
||||
let row = formatColumns.value[col].findIndex((row2) => {
|
||||
return row2[props.valueKey].toString() === target.toString();
|
||||
});
|
||||
row = row === -1 ? 0 : row;
|
||||
selected = correctSelectedIndex(col, row, selected);
|
||||
});
|
||||
selectedIndex.value = selected.slice(0, value.length);
|
||||
}
|
||||
function correctSelected(value) {
|
||||
let selected = uni_modules_wotDesignUni_components_common_util.deepClone(value);
|
||||
value.forEach((row, col) => {
|
||||
row = uni_modules_wotDesignUni_components_common_util.range(row, 0, formatColumns.value[col].length - 1);
|
||||
selected = correctSelectedIndex(col, row, selected);
|
||||
});
|
||||
return selected;
|
||||
}
|
||||
function correctSelectedIndex(columnIndex, rowIndex, selected) {
|
||||
const col = formatColumns.value[columnIndex];
|
||||
if (!col || !col[rowIndex]) {
|
||||
throw Error(`The value to select with Col:${columnIndex} Row:${rowIndex} is incorrect`);
|
||||
}
|
||||
const select = uni_modules_wotDesignUni_components_common_util.deepClone(selected);
|
||||
select[columnIndex] = rowIndex;
|
||||
if (col[rowIndex].disabled) {
|
||||
const prev = col.slice(0, rowIndex).reverse().findIndex((s) => !s.disabled);
|
||||
const next = col.slice(rowIndex + 1).findIndex((s) => !s.disabled);
|
||||
if (prev !== -1) {
|
||||
select[columnIndex] = rowIndex - 1 - prev;
|
||||
} else if (next !== -1) {
|
||||
select[columnIndex] = rowIndex + 1 + next;
|
||||
} else if (select[columnIndex] === void 0) {
|
||||
select[columnIndex] = 0;
|
||||
}
|
||||
}
|
||||
return select;
|
||||
}
|
||||
function onChange({ detail: { value } }) {
|
||||
value = value.map((v) => {
|
||||
return Number(v || 0);
|
||||
});
|
||||
const index = getChangeDiff(value);
|
||||
selectedIndex.value = uni_modules_wotDesignUni_components_common_util.deepClone(value);
|
||||
common_vendor.nextTick$1(() => {
|
||||
selectedIndex.value = correctSelected(value);
|
||||
if (props.columnChange) {
|
||||
if (props.columnChange.length < 4) {
|
||||
props.columnChange(proxy.$.exposed, getSelects(), index || 0, () => {
|
||||
});
|
||||
handleChange(index || 0);
|
||||
} else {
|
||||
props.columnChange(proxy.$.exposed, getSelects(), index || 0, () => {
|
||||
handleChange(index || 0);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
handleChange(index || 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
function getChangeColumn(now, origin) {
|
||||
if (!now || !origin)
|
||||
return -1;
|
||||
const index = now.findIndex((row, index2) => row !== origin[index2]);
|
||||
return index;
|
||||
}
|
||||
function getChangeDiff(value) {
|
||||
value = value.slice(0, formatColumns.value.length);
|
||||
const origin = uni_modules_wotDesignUni_components_common_util.deepClone(selectedIndex.value);
|
||||
let selected = uni_modules_wotDesignUni_components_common_util.deepClone(selectedIndex.value);
|
||||
value.forEach((row, col) => {
|
||||
row = uni_modules_wotDesignUni_components_common_util.range(row, 0, formatColumns.value[col].length - 1);
|
||||
if (row === origin[col])
|
||||
return;
|
||||
selected = correctSelectedIndex(col, row, selected);
|
||||
});
|
||||
const diffCol = getChangeColumn(selected, origin);
|
||||
if (diffCol === -1)
|
||||
return;
|
||||
const diffRow = selected[diffCol];
|
||||
return selected.length === 1 ? diffRow : diffCol;
|
||||
}
|
||||
function handleChange(index) {
|
||||
const value = getValues();
|
||||
if (uni_modules_wotDesignUni_components_common_util.isEqual(value, props.modelValue))
|
||||
return;
|
||||
emit("update:modelValue", value);
|
||||
setTimeout(() => {
|
||||
emit("change", {
|
||||
picker: proxy.$.exposed,
|
||||
value,
|
||||
index
|
||||
});
|
||||
}, 0);
|
||||
}
|
||||
function getSelects() {
|
||||
const selects = selectedIndex.value.map((row, col) => formatColumns.value[col][row]);
|
||||
if (selects.length === 1) {
|
||||
return selects[0];
|
||||
}
|
||||
return selects;
|
||||
}
|
||||
function getValues() {
|
||||
const { valueKey } = props;
|
||||
const values = selectedIndex.value.map((row, col) => {
|
||||
return formatColumns.value[col][row][valueKey];
|
||||
});
|
||||
if (values.length === 1) {
|
||||
return values[0];
|
||||
}
|
||||
return values;
|
||||
}
|
||||
function getLabels() {
|
||||
const { labelKey } = props;
|
||||
return selectedIndex.value.map((row, col) => formatColumns.value[col][row][labelKey]);
|
||||
}
|
||||
function getColumnIndex(columnIndex) {
|
||||
return selectedIndex.value[columnIndex];
|
||||
}
|
||||
function getColumnData(columnIndex) {
|
||||
return formatColumns.value[columnIndex];
|
||||
}
|
||||
function setColumnData(columnIndex, data, rowIndex = 0) {
|
||||
formatColumns.value[columnIndex] = uni_modules_wotDesignUni_components_wdPickerView_types.formatArray(data, props.valueKey, props.labelKey).reduce((acc, val) => acc.concat(val), []);
|
||||
selectedIndex.value = correctSelectedIndex(columnIndex, rowIndex, selectedIndex.value);
|
||||
}
|
||||
function getColumnsData() {
|
||||
return uni_modules_wotDesignUni_components_common_util.deepClone(formatColumns.value);
|
||||
}
|
||||
function getSelectedIndex() {
|
||||
return selectedIndex.value;
|
||||
}
|
||||
function resetColumns(columns) {
|
||||
if (uni_modules_wotDesignUni_components_common_util.isArray(columns) && columns.length) {
|
||||
formatColumns.value = uni_modules_wotDesignUni_components_wdPickerView_types.formatArray(columns, props.valueKey, props.labelKey);
|
||||
}
|
||||
}
|
||||
function onPickStart() {
|
||||
emit("pickstart");
|
||||
}
|
||||
function onPickEnd() {
|
||||
emit("pickend");
|
||||
}
|
||||
__expose({
|
||||
getSelects,
|
||||
getValues,
|
||||
setColumnData,
|
||||
getColumnsData,
|
||||
getColumnData,
|
||||
getColumnIndex,
|
||||
getLabels,
|
||||
getSelectedIndex,
|
||||
resetColumns
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: _ctx.loading
|
||||
}, _ctx.loading ? {
|
||||
b: common_vendor.p({
|
||||
color: _ctx.loadingColor
|
||||
})
|
||||
} : {}, {
|
||||
c: common_vendor.f(formatColumns.value, (col, colIndex, i0) => {
|
||||
return {
|
||||
a: common_vendor.f(col, (row, rowIndex, i1) => {
|
||||
return {
|
||||
a: common_vendor.t(row[_ctx.labelKey]),
|
||||
b: rowIndex,
|
||||
c: common_vendor.n(`wd-picker-view-column__item ${row["disabled"] ? "wd-picker-view-column__item--disabled" : ""} ${selectedIndex.value[colIndex] == rowIndex ? "wd-picker-view-column__item--active" : ""}`)
|
||||
};
|
||||
}),
|
||||
b: colIndex
|
||||
};
|
||||
}),
|
||||
d: common_vendor.s(`line-height: ${_ctx.itemHeight}px;`),
|
||||
e: `height: ${_ctx.itemHeight}px;`,
|
||||
f: common_vendor.s(`height: ${_ctx.columnsHeight - 20}px;`),
|
||||
g: selectedIndex.value,
|
||||
h: _ctx.immediateChange,
|
||||
i: common_vendor.o(onChange),
|
||||
j: common_vendor.o(onPickStart),
|
||||
k: common_vendor.o(onPickEnd),
|
||||
l: common_vendor.s(`height: ${_ctx.columnsHeight - 20}px;`),
|
||||
m: common_vendor.n(`wd-picker-view ${_ctx.customClass}`),
|
||||
n: common_vendor.s(_ctx.customStyle)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-c3bc94ff"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-picker-view/wd-picker-view.js.map
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"wd-loading": "../wd-loading/wd-loading"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view class="{{['data-v-c3bc94ff', m]}}" style="{{n}}"><view wx:if="{{a}}" class="wd-picker-view__loading data-v-c3bc94ff"><wd-loading wx:if="{{b}}" class="data-v-c3bc94ff" u-i="c3bc94ff-0" bind:__l="__l" u-p="{{b}}"/></view><view class="data-v-c3bc94ff" style="{{l}}"><block wx:if="{{r0}}"><picker-view class="data-v-c3bc94ff" mask-class="wd-picker-view__mask" indicator-class="wd-picker-view__roller" indicator-style="{{e}}" style="{{f}}" value="{{g}}" immediate-change="{{h}}" bindchange="{{i}}" bindpickstart="{{j}}" bindpickend="{{k}}"><picker-view-column wx:for="{{c}}" wx:for-item="col" wx:key="b" class="wd-picker-view-column data-v-c3bc94ff"><view wx:for="{{col.a}}" wx:for-item="row" wx:key="b" class="{{['data-v-c3bc94ff', row.c]}}" style="{{d}}">{{row.a}}</view></picker-view-column></picker-view></block></view></view>
|
||||
@@ -0,0 +1,237 @@
|
||||
/* 水平间距 */
|
||||
/* 水平间距 */
|
||||
/**
|
||||
* 混合宏
|
||||
*/
|
||||
/**
|
||||
* 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-picker-view__columns.data-v-c3bc94ff {
|
||||
background: var(--wot-dark-background2, #1b1b1b);
|
||||
}
|
||||
.wot-theme-dark .wd-picker-view.data-v-c3bc94ff .wd-picker-view__roller {
|
||||
background: var(--wot-dark-background4, #323233);
|
||||
}
|
||||
.wot-theme-dark .wd-picker-view-column.data-v-c3bc94ff {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wot-theme-dark .wd-picker-view-column__item--disabled.data-v-c3bc94ff {
|
||||
color: var(--wot-dark-color-gray, var(--wot-color-secondary, #595959));
|
||||
}
|
||||
.wd-picker-view.data-v-c3bc94ff {
|
||||
position: relative;
|
||||
padding: 10px 0;
|
||||
}
|
||||
.wd-picker-view__columns.data-v-c3bc94ff {
|
||||
position: relative;
|
||||
display: flex;
|
||||
background: var(--wot-picker-bg, var(--wot-color-white, white));
|
||||
overflow: hidden;
|
||||
align-items: center;
|
||||
}
|
||||
.data-v-c3bc94ff .wd-picker-view__mask {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: var(--wot-picker-mask, linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.25))) linear-gradient(0deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.25));
|
||||
background-position: top, bottom;
|
||||
background-repeat: no-repeat;
|
||||
z-index: 2;
|
||||
pointer-events: none;
|
||||
filter: blur(4px);
|
||||
}
|
||||
.wd-picker-view__loading.data-v-c3bc94ff {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 3;
|
||||
background: var(--wot-picker-loading-bg, rgba(var(--wot-color-white, white), 0.8));
|
||||
}
|
||||
.data-v-c3bc94ff .wd-picker-view__roller {
|
||||
background: whitesmoke;
|
||||
z-index: 0;
|
||||
}
|
||||
.data-v-c3bc94ff .wd-picker-view__roller::before,.data-v-c3bc94ff .wd-picker-view__roller::after {
|
||||
display: none;
|
||||
}
|
||||
.wd-picker-view-column.data-v-c3bc94ff {
|
||||
flex: 1;
|
||||
font-size: var(--wot-picker-column-fs, 16px);
|
||||
color: var(--wot-picker-column-color, rgba(0, 0, 0, 0.85));
|
||||
text-align: center;
|
||||
transition-timing-function: cubic-bezier(0.28, 0.8, 0.63, 1);
|
||||
}
|
||||
.wd-picker-view-column__item.data-v-c3bc94ff {
|
||||
padding: var(--wot-picker-column-padding, 0 var(--wot-size-side-padding-small, 6px));
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.wd-picker-view-column__item--disabled.data-v-c3bc94ff {
|
||||
color: var(--wot-picker-column-disabled-color, rgba(0, 0, 0, 0.25));
|
||||
}
|
||||
164
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-picker/types.js
vendored
Normal file
164
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-picker/types.js
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
"use strict";
|
||||
const uni_modules_wotDesignUni_components_common_props = require("../common/props.js");
|
||||
const pickerProps = {
|
||||
...uni_modules_wotDesignUni_components_common_props.baseProps,
|
||||
/**
|
||||
* label 外部自定义样式
|
||||
*/
|
||||
customLabelClass: uni_modules_wotDesignUni_components_common_props.makeStringProp(""),
|
||||
/**
|
||||
* value 外部自定义样式
|
||||
*/
|
||||
customValueClass: uni_modules_wotDesignUni_components_common_props.makeStringProp(""),
|
||||
/**
|
||||
* pickerView 外部自定义样式
|
||||
*/
|
||||
customViewClass: uni_modules_wotDesignUni_components_common_props.makeStringProp(""),
|
||||
/**
|
||||
* 选择器左侧文案
|
||||
*/
|
||||
label: String,
|
||||
/**
|
||||
* 选择器占位符
|
||||
*/
|
||||
placeholder: String,
|
||||
/**
|
||||
* 是否禁用
|
||||
*/
|
||||
disabled: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 是否只读
|
||||
*/
|
||||
readonly: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 加载中
|
||||
*/
|
||||
loading: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 加载中颜色
|
||||
*/
|
||||
loadingColor: uni_modules_wotDesignUni_components_common_props.makeStringProp("#4D80F0"),
|
||||
/* popup */
|
||||
/**
|
||||
* 弹出层标题
|
||||
*/
|
||||
title: String,
|
||||
/**
|
||||
* 取消按钮文案
|
||||
*/
|
||||
cancelButtonText: String,
|
||||
/**
|
||||
* 确认按钮文案
|
||||
*/
|
||||
confirmButtonText: String,
|
||||
/**
|
||||
* 是否必填
|
||||
*/
|
||||
required: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 尺寸
|
||||
*/
|
||||
size: String,
|
||||
/**
|
||||
* 设置左侧标题宽度
|
||||
*/
|
||||
labelWidth: uni_modules_wotDesignUni_components_common_props.makeStringProp("33%"),
|
||||
/**
|
||||
* 使用默认插槽
|
||||
* @deprecated 可以直接使用默认插槽,无需配置此选项
|
||||
*/
|
||||
useDefaultSlot: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 使用标签插槽
|
||||
* @deprecated 可以直接使用标签插槽,无需配置此选项
|
||||
*/
|
||||
useLabelSlot: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 错误状态
|
||||
*/
|
||||
error: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 右对齐
|
||||
*/
|
||||
alignRight: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 确定前校验函数,接收 (value, resolve, picker) 参数,通过 resolve 继续执行 picker,resolve 接收1个boolean参数
|
||||
*/
|
||||
beforeConfirm: Function,
|
||||
/**
|
||||
* 点击蒙层关闭
|
||||
*/
|
||||
closeOnClickModal: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 底部安全区域内
|
||||
*/
|
||||
safeAreaInsetBottom: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 文本溢出显示省略号
|
||||
*/
|
||||
ellipsis: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 选项总高度
|
||||
*/
|
||||
columnsHeight: uni_modules_wotDesignUni_components_common_props.makeNumberProp(217),
|
||||
/**
|
||||
* 选项值对应的键名
|
||||
*/
|
||||
valueKey: uni_modules_wotDesignUni_components_common_props.makeStringProp("value"),
|
||||
/**
|
||||
* 选项文本对应的键名
|
||||
*/
|
||||
labelKey: uni_modules_wotDesignUni_components_common_props.makeStringProp("label"),
|
||||
/**
|
||||
* 选中项,如果为多列选择器,则其类型应为数组
|
||||
*/
|
||||
modelValue: {
|
||||
type: [String, Number, Array],
|
||||
default: ""
|
||||
},
|
||||
/**
|
||||
* 选择器数据,可以为字符串数组,也可以为对象数组,如果为二维数组,则为多列选择器
|
||||
*/
|
||||
columns: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
/**
|
||||
* 接收 pickerView 实例、选中项、当前修改列的下标、resolve 作为入参,根据选中项和列下标进行判断,通过 pickerView 实例暴露出来的 setColumnData 方法修改其他列的数据源。
|
||||
*/
|
||||
columnChange: Function,
|
||||
/**
|
||||
* 自定义展示文案的格式化函数,返回一个字符串
|
||||
*/
|
||||
displayFormat: Function,
|
||||
/**
|
||||
* 自定义层级
|
||||
*/
|
||||
zIndex: uni_modules_wotDesignUni_components_common_props.makeNumberProp(15),
|
||||
/**
|
||||
* 表单域 model 字段名,在使用表单校验功能的情况下,该属性是必填的
|
||||
*/
|
||||
prop: String,
|
||||
/**
|
||||
* 表单验证规则,结合wd-form组件使用
|
||||
*/
|
||||
rules: uni_modules_wotDesignUni_components_common_props.makeArrayProp(),
|
||||
/**
|
||||
* 是否在手指松开时立即触发 change 事件。若不开启则会在滚动动画结束后触发 change 事件,1.2.25版本起提供,仅微信小程序和支付宝小程序支持。
|
||||
*/
|
||||
immediateChange: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 是否从页面中脱离出来,用于解决各种 fixed 失效问题 (H5: teleport, APP: renderjs, 小程序: root-portal)
|
||||
*/
|
||||
rootPortal: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 显示清空按钮
|
||||
*/
|
||||
clearable: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 必填标记位置,可选值:before、after
|
||||
*/
|
||||
markerSide: uni_modules_wotDesignUni_components_common_props.makeStringProp("before")
|
||||
};
|
||||
exports.pickerProps = pickerProps;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-picker/types.js.map
|
||||
353
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-picker/wd-picker.js
vendored
Normal file
353
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-picker/wd-picker.js
vendored
Normal file
@@ -0,0 +1,353 @@
|
||||
"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_wdPickerView_types = require("../wd-picker-view/types.js");
|
||||
const uni_modules_wotDesignUni_components_composables_useTranslate = require("../composables/useTranslate.js");
|
||||
const uni_modules_wotDesignUni_components_wdPicker_types = require("./types.js");
|
||||
if (!Math) {
|
||||
(wdIcon + wdCell + wdPickerView + wdPopup)();
|
||||
}
|
||||
const wdIcon = () => "../wd-icon/wd-icon.js";
|
||||
const wdPopup = () => "../wd-popup/wd-popup.js";
|
||||
const wdPickerView = () => "../wd-picker-view/wd-picker-view.js";
|
||||
const wdCell = () => "../wd-cell/wd-cell.js";
|
||||
const __default__ = {
|
||||
name: "wd-picker",
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
};
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: uni_modules_wotDesignUni_components_wdPicker_types.pickerProps,
|
||||
emits: ["confirm", "open", "cancel", "clear", "update:modelValue", "close"],
|
||||
setup(__props, { expose: __expose, emit: __emit }) {
|
||||
const { translate } = uni_modules_wotDesignUni_components_composables_useTranslate.useTranslate("picker");
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const pickerViewWd = common_vendor.ref(null);
|
||||
const innerLoading = common_vendor.ref(false);
|
||||
const popupShow = common_vendor.ref(false);
|
||||
const showValue = common_vendor.ref("");
|
||||
const pickerValue = common_vendor.ref("");
|
||||
const displayColumns = common_vendor.ref([]);
|
||||
const resetColumns = common_vendor.ref([]);
|
||||
const isPicking = common_vendor.ref(false);
|
||||
const hasConfirmed = common_vendor.ref(false);
|
||||
const isLoading = common_vendor.computed(() => {
|
||||
return props.loading || innerLoading.value;
|
||||
});
|
||||
common_vendor.watch(
|
||||
() => props.displayFormat,
|
||||
(fn) => {
|
||||
if (fn && !uni_modules_wotDesignUni_components_common_util.isFunction(fn)) {
|
||||
common_vendor.index.__f__("error", "at uni_modules/wot-design-uni/components/wd-picker/wd-picker.vue:133", "The type of displayFormat must be Function");
|
||||
}
|
||||
if (pickerViewWd.value && pickerViewWd.value.getSelectedIndex().length !== 0) {
|
||||
handleShowValueUpdate(props.modelValue);
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
deep: true
|
||||
}
|
||||
);
|
||||
common_vendor.watch(
|
||||
() => props.modelValue,
|
||||
(newValue) => {
|
||||
pickerValue.value = newValue;
|
||||
handleShowValueUpdate(newValue);
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
common_vendor.watch(
|
||||
() => props.columns,
|
||||
(newValue) => {
|
||||
displayColumns.value = uni_modules_wotDesignUni_components_common_util.deepClone(newValue);
|
||||
resetColumns.value = uni_modules_wotDesignUni_components_common_util.deepClone(newValue);
|
||||
if (newValue.length === 0) {
|
||||
pickerValue.value = uni_modules_wotDesignUni_components_common_util.isArray(props.modelValue) ? [] : "";
|
||||
showValue.value = "";
|
||||
} else {
|
||||
handleShowValueUpdate(props.modelValue);
|
||||
}
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
common_vendor.watch(
|
||||
() => props.columnChange,
|
||||
(newValue) => {
|
||||
if (newValue && !uni_modules_wotDesignUni_components_common_util.isFunction(newValue)) {
|
||||
common_vendor.index.__f__("error", "at uni_modules/wot-design-uni/components/wd-picker/wd-picker.vue:182", "The type of columnChange must be Function");
|
||||
}
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
const showClear = common_vendor.computed(() => {
|
||||
return props.clearable && !props.disabled && !props.readonly && showValue.value.length > 0;
|
||||
});
|
||||
const showArrow = common_vendor.computed(() => {
|
||||
return !props.disabled && !props.readonly && !showClear.value;
|
||||
});
|
||||
const cellClass = common_vendor.computed(() => {
|
||||
const classes = ["wd-picker__cell"];
|
||||
if (props.disabled)
|
||||
classes.push("is-disabled");
|
||||
if (props.readonly)
|
||||
classes.push("is-readonly");
|
||||
if (props.error)
|
||||
classes.push("is-error");
|
||||
if (!showValue.value)
|
||||
classes.push("wd-picker__cell--placeholder");
|
||||
return classes.join(" ");
|
||||
});
|
||||
const { proxy } = common_vendor.getCurrentInstance();
|
||||
common_vendor.onMounted(() => {
|
||||
handleShowValueUpdate(props.modelValue);
|
||||
});
|
||||
common_vendor.onBeforeMount(() => {
|
||||
displayColumns.value = uni_modules_wotDesignUni_components_common_util.deepClone(props.columns);
|
||||
resetColumns.value = uni_modules_wotDesignUni_components_common_util.deepClone(props.columns);
|
||||
});
|
||||
function handleShowValueUpdate(value) {
|
||||
if (uni_modules_wotDesignUni_components_common_util.isArray(value) && value.length > 0 || uni_modules_wotDesignUni_components_common_util.isDef(value) && !uni_modules_wotDesignUni_components_common_util.isArray(value) && value !== "") {
|
||||
if (pickerViewWd.value) {
|
||||
common_vendor.nextTick$1(() => {
|
||||
setShowValue(pickerViewWd.value.getSelects());
|
||||
});
|
||||
} else {
|
||||
setShowValue(getSelects(value));
|
||||
}
|
||||
} else {
|
||||
showValue.value = "";
|
||||
}
|
||||
}
|
||||
function getSelects(value) {
|
||||
const formatColumns = uni_modules_wotDesignUni_components_wdPickerView_types.formatArray(props.columns, props.valueKey, props.labelKey);
|
||||
if (props.columns.length === 0)
|
||||
return;
|
||||
if (value === "" || !uni_modules_wotDesignUni_components_common_util.isDef(value) || uni_modules_wotDesignUni_components_common_util.isArray(value) && value.length === 0) {
|
||||
return;
|
||||
}
|
||||
const valueType = uni_modules_wotDesignUni_components_common_util.getType(value);
|
||||
const type = ["string", "number", "boolean", "array"];
|
||||
if (type.indexOf(valueType) === -1)
|
||||
return [];
|
||||
value = uni_modules_wotDesignUni_components_common_util.isArray(value) ? value : [value];
|
||||
value = value.slice(0, formatColumns.length);
|
||||
if (value.length === 0) {
|
||||
value = formatColumns.map(() => 0);
|
||||
}
|
||||
let selected = [];
|
||||
value.forEach((target, col) => {
|
||||
let row = formatColumns[col].findIndex((row2) => {
|
||||
return row2[props.valueKey].toString() === target.toString();
|
||||
});
|
||||
row = row === -1 ? 0 : row;
|
||||
selected.push(row);
|
||||
});
|
||||
const selects = selected.map((row, col) => formatColumns[col][row]);
|
||||
if (selects.length === 1) {
|
||||
return selects[0];
|
||||
}
|
||||
return selects;
|
||||
}
|
||||
function open() {
|
||||
showPopup();
|
||||
}
|
||||
function close() {
|
||||
onCancel();
|
||||
}
|
||||
function showPopup() {
|
||||
if (props.disabled || props.readonly)
|
||||
return;
|
||||
emit("open");
|
||||
popupShow.value = true;
|
||||
pickerValue.value = props.modelValue;
|
||||
displayColumns.value = resetColumns.value;
|
||||
}
|
||||
function onCancel() {
|
||||
popupShow.value = false;
|
||||
emit("close");
|
||||
emit("cancel");
|
||||
let timmer = setTimeout(() => {
|
||||
clearTimeout(timmer);
|
||||
uni_modules_wotDesignUni_components_common_util.isDef(pickerViewWd.value) && pickerViewWd.value.resetColumns(resetColumns.value);
|
||||
}, 300);
|
||||
}
|
||||
function onConfirm() {
|
||||
if (isLoading.value)
|
||||
return;
|
||||
if (isPicking.value) {
|
||||
hasConfirmed.value = true;
|
||||
return;
|
||||
}
|
||||
const { beforeConfirm } = props;
|
||||
if (beforeConfirm && uni_modules_wotDesignUni_components_common_util.isFunction(beforeConfirm)) {
|
||||
beforeConfirm(
|
||||
pickerValue.value,
|
||||
(isPass) => {
|
||||
isPass && handleConfirm();
|
||||
},
|
||||
proxy.$.exposed
|
||||
);
|
||||
} else {
|
||||
handleConfirm();
|
||||
}
|
||||
}
|
||||
function handleConfirm() {
|
||||
if (isLoading.value || props.disabled) {
|
||||
popupShow.value = false;
|
||||
emit("close");
|
||||
return;
|
||||
}
|
||||
const selects = pickerViewWd.value.getSelects();
|
||||
const values = pickerViewWd.value.getValues();
|
||||
const columns = pickerViewWd.value.getColumnsData();
|
||||
popupShow.value = false;
|
||||
emit("close");
|
||||
resetColumns.value = uni_modules_wotDesignUni_components_common_util.deepClone(columns);
|
||||
emit("update:modelValue", values);
|
||||
setShowValue(selects);
|
||||
emit("confirm", {
|
||||
value: values,
|
||||
selectedItems: selects
|
||||
});
|
||||
}
|
||||
function pickerViewChange({ value }) {
|
||||
pickerValue.value = value;
|
||||
}
|
||||
function setShowValue(items) {
|
||||
if (uni_modules_wotDesignUni_components_common_util.isArray(items) && !items.length || !items)
|
||||
return;
|
||||
const { valueKey, labelKey } = props;
|
||||
showValue.value = (props.displayFormat || uni_modules_wotDesignUni_components_common_util.defaultDisplayFormat)(items, { valueKey, labelKey });
|
||||
}
|
||||
function noop() {
|
||||
}
|
||||
function onPickStart() {
|
||||
isPicking.value = true;
|
||||
}
|
||||
function onPickEnd() {
|
||||
isPicking.value = false;
|
||||
if (hasConfirmed.value) {
|
||||
hasConfirmed.value = false;
|
||||
onConfirm();
|
||||
}
|
||||
}
|
||||
function setLoading(loading) {
|
||||
innerLoading.value = loading;
|
||||
}
|
||||
function handleClear() {
|
||||
const clearValue = uni_modules_wotDesignUni_components_common_util.isArray(pickerValue.value) ? [] : "";
|
||||
emit("update:modelValue", clearValue);
|
||||
emit("clear");
|
||||
}
|
||||
__expose({
|
||||
close,
|
||||
open,
|
||||
setLoading
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: !_ctx.$slots.default
|
||||
}, !_ctx.$slots.default ? common_vendor.e({
|
||||
b: _ctx.$slots.label
|
||||
}, _ctx.$slots.label ? {} : {}, {
|
||||
c: showArrow.value
|
||||
}, showArrow.value ? {
|
||||
d: common_vendor.p({
|
||||
["custom-class"]: "wd-picker__arrow",
|
||||
name: "arrow-right"
|
||||
})
|
||||
} : showClear.value ? {
|
||||
f: common_vendor.p({
|
||||
["custom-class"]: "wd-picker__clear",
|
||||
name: "error-fill"
|
||||
}),
|
||||
g: common_vendor.o(handleClear)
|
||||
} : {}, {
|
||||
e: showClear.value,
|
||||
h: common_vendor.o(showPopup),
|
||||
i: common_vendor.p({
|
||||
title: _ctx.label,
|
||||
value: showValue.value ? showValue.value : _ctx.placeholder || common_vendor.unref(translate)("placeholder"),
|
||||
required: _ctx.required,
|
||||
size: _ctx.size,
|
||||
["title-width"]: _ctx.labelWidth,
|
||||
prop: _ctx.prop,
|
||||
rules: _ctx.rules,
|
||||
clickable: !_ctx.disabled && !_ctx.readonly,
|
||||
["value-align"]: _ctx.alignRight ? "right" : "left",
|
||||
["custom-class"]: cellClass.value,
|
||||
["custom-style"]: _ctx.customStyle,
|
||||
["custom-title-class"]: _ctx.customLabelClass,
|
||||
["custom-value-class"]: _ctx.customValueClass,
|
||||
ellipsis: _ctx.ellipsis,
|
||||
["use-title-slot"]: !!_ctx.$slots.label,
|
||||
["marker-side"]: _ctx.markerSide
|
||||
})
|
||||
}) : {
|
||||
j: common_vendor.o(showPopup)
|
||||
}, {
|
||||
k: common_vendor.t(_ctx.cancelButtonText || common_vendor.unref(translate)("cancel")),
|
||||
l: common_vendor.o(onCancel),
|
||||
m: _ctx.title
|
||||
}, _ctx.title ? {
|
||||
n: common_vendor.t(_ctx.title)
|
||||
} : {}, {
|
||||
o: common_vendor.t(_ctx.confirmButtonText || common_vendor.unref(translate)("done")),
|
||||
p: common_vendor.n(`wd-picker__action ${isLoading.value ? "is-loading" : ""}`),
|
||||
q: common_vendor.o(onConfirm),
|
||||
r: common_vendor.o(noop),
|
||||
s: common_vendor.sr(pickerViewWd, "e228acd5-4,e228acd5-3", {
|
||||
"k": "pickerViewWd"
|
||||
}),
|
||||
t: common_vendor.o(pickerViewChange),
|
||||
v: common_vendor.o(onPickStart),
|
||||
w: common_vendor.o(onPickEnd),
|
||||
x: common_vendor.o(($event) => pickerValue.value = $event),
|
||||
y: common_vendor.p({
|
||||
["custom-class"]: _ctx.customViewClass,
|
||||
columns: displayColumns.value,
|
||||
loading: isLoading.value,
|
||||
["loading-color"]: _ctx.loadingColor,
|
||||
["columns-height"]: _ctx.columnsHeight,
|
||||
["value-key"]: _ctx.valueKey,
|
||||
["label-key"]: _ctx.labelKey,
|
||||
["immediate-change"]: _ctx.immediateChange,
|
||||
["column-change"]: _ctx.columnChange,
|
||||
modelValue: pickerValue.value
|
||||
}),
|
||||
z: common_vendor.o(onCancel),
|
||||
A: common_vendor.o(($event) => popupShow.value = $event),
|
||||
B: common_vendor.p({
|
||||
position: "bottom",
|
||||
["hide-when-close"]: false,
|
||||
["close-on-click-modal"]: _ctx.closeOnClickModal,
|
||||
["z-index"]: _ctx.zIndex,
|
||||
["safe-area-inset-bottom"]: _ctx.safeAreaInsetBottom,
|
||||
["root-portal"]: _ctx.rootPortal,
|
||||
["custom-class"]: "wd-picker__popup",
|
||||
modelValue: popupShow.value
|
||||
}),
|
||||
C: common_vendor.n(`wd-picker ${_ctx.disabled ? "is-disabled" : ""} ${_ctx.size ? "is-" + _ctx.size : ""} ${_ctx.alignRight ? "is-align-right" : ""} ${_ctx.error ? "is-error" : ""} ${_ctx.customClass}`),
|
||||
D: common_vendor.s(_ctx.customStyle)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-e228acd5"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-picker/wd-picker.js.map
|
||||
9
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-picker/wd-picker.json
vendored
Normal file
9
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-picker/wd-picker.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"wd-icon": "../wd-icon/wd-icon",
|
||||
"wd-popup": "../wd-popup/wd-popup",
|
||||
"wd-picker-view": "../wd-picker-view/wd-picker-view",
|
||||
"wd-cell": "../wd-cell/wd-cell"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-picker/wd-picker.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-picker/wd-picker.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['data-v-e228acd5', C]}}" style="{{D}}"><wd-cell wx:if="{{a}}" class="data-v-e228acd5" u-s="{{['title','right-icon']}}" bindclick="{{h}}" u-i="e228acd5-0" bind:__l="__l" u-p="{{i}}"><view wx:if="{{b}}" slot="title"><slot name="label"></slot></view><view slot="right-icon"><wd-icon wx:if="{{c}}" class="data-v-e228acd5" u-i="e228acd5-1,e228acd5-0" bind:__l="__l" u-p="{{d}}"/><view wx:elif="{{e}}" class="data-v-e228acd5" catchtap="{{g}}"><wd-icon wx:if="{{f}}" class="data-v-e228acd5" u-i="e228acd5-2,e228acd5-0" bind:__l="__l" u-p="{{f}}"/></view></view></wd-cell><view wx:else class="data-v-e228acd5" bindtap="{{j}}"><slot></slot></view><wd-popup wx:if="{{B}}" class="data-v-e228acd5" u-s="{{['d']}}" bindclose="{{z}}" u-i="e228acd5-3" bind:__l="__l" bindupdateModelValue="{{A}}" u-p="{{B}}"><view class="wd-picker__wraper data-v-e228acd5"><view class="wd-picker__toolbar data-v-e228acd5" bindtouchmove="{{r}}"><view class="wd-picker__action wd-picker__action--cancel data-v-e228acd5" bindtap="{{l}}">{{k}}</view><view wx:if="{{m}}" class="wd-picker__title data-v-e228acd5">{{n}}</view><view class="{{['data-v-e228acd5', p]}}" bindtap="{{q}}">{{o}}</view></view><wd-picker-view wx:if="{{y}}" class="r data-v-e228acd5" u-r="pickerViewWd" bindchange="{{t}}" bindpickstart="{{v}}" bindpickend="{{w}}" u-i="e228acd5-4,e228acd5-3" bind:__l="__l" bindupdateModelValue="{{x}}" u-p="{{y}}"/></view></wd-popup></view>
|
||||
240
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-picker/wd-picker.wxss
vendored
Normal file
240
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-picker/wd-picker.wxss
vendored
Normal file
@@ -0,0 +1,240 @@
|
||||
/* 水平间距 */
|
||||
/* 水平间距 */
|
||||
/**
|
||||
* 混合宏
|
||||
*/
|
||||
/**
|
||||
* 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-picker__action--cancel.data-v-e228acd5 {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wot-theme-dark .wd-picker__action.is-loading.data-v-e228acd5 {
|
||||
color: var(--wot-dark-color3, rgba(232, 230, 227, 0.8));
|
||||
}
|
||||
.wot-theme-dark .wd-picker.data-v-e228acd5 .wd-picker__arrow,
|
||||
.wot-theme-dark .wd-picker.data-v-e228acd5 .wd-picker__clear {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wot-theme-dark .wd-picker.data-v-e228acd5 .wd-picker__cell--placeholder .wd-cell__value {
|
||||
color: var(--wot-dark-color-gray, var(--wot-color-secondary, #595959));
|
||||
}
|
||||
.data-v-e228acd5 .wd-picker__popup {
|
||||
border-radius: 16px 16px 0px 0px;
|
||||
}
|
||||
.data-v-e228acd5 .wd-picker__cell.is-disabled .wd-cell__value {
|
||||
color: var(--wot-input-disabled-color, #d9d9d9);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.data-v-e228acd5 .wd-picker__cell.is-error .wd-cell__value {
|
||||
color: var(--wot-input-error-color, var(--wot-color-danger, #fa4350));
|
||||
}
|
||||
.data-v-e228acd5 .wd-picker__cell.is-error .wd-picker__arrow {
|
||||
color: var(--wot-input-error-color, var(--wot-color-danger, #fa4350));
|
||||
}
|
||||
.data-v-e228acd5 .wd-picker__cell.is-large .wd-picker__arrow,.data-v-e228acd5 .wd-picker__cell.is-large .wd-picker__clear {
|
||||
font-size: var(--wot-cell-icon-size-large, 18px);
|
||||
}
|
||||
.data-v-e228acd5 .wd-picker__cell--placeholder .wd-cell__value {
|
||||
color: var(--wot-input-placeholder-color, #bfbfbf);
|
||||
}
|
||||
.data-v-e228acd5 .wd-picker__arrow,.data-v-e228acd5 .wd-picker__clear {
|
||||
display: block;
|
||||
font-size: var(--wot-cell-icon-size, 16px);
|
||||
color: var(--wot-cell-arrow-color, rgba(0, 0, 0, 0.25));
|
||||
line-height: var(--wot-cell-line-height, 24px);
|
||||
}
|
||||
.data-v-e228acd5 .wd-picker__clear {
|
||||
color: var(--wot-cell-clear-color, #585858);
|
||||
}
|
||||
.wd-picker__wraper.data-v-e228acd5 {
|
||||
padding-bottom: var(--window-bottom);
|
||||
}
|
||||
.wd-picker__toolbar.data-v-e228acd5 {
|
||||
position: relative;
|
||||
display: flex;
|
||||
font-size: var(--wot-picker-toolbar-fs, var(--wot-fs-title, 16px));
|
||||
height: var(--wot-picker-toolbar-height, 54px);
|
||||
line-height: var(--wot-picker-action-height, 16px);
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.wd-picker__action.data-v-e228acd5 {
|
||||
display: block;
|
||||
border: none;
|
||||
outline: none;
|
||||
font-size: var(--wot-picker-toolbar-fs, var(--wot-fs-title, 16px));
|
||||
color: var(--wot-picker-toolbar-finish-color, var(--wot-color-theme, #4d80f0));
|
||||
background: transparent;
|
||||
padding: 24px 15px 14px 15px;
|
||||
}
|
||||
.wd-picker__action--cancel.data-v-e228acd5 {
|
||||
color: var(--wot-picker-toolbar-cancel-color, #666666);
|
||||
}
|
||||
.wd-picker__action.is-loading.data-v-e228acd5 {
|
||||
color: var(--wot-picker-loading-button-color, rgba(0, 0, 0, 0.25));
|
||||
}
|
||||
.wd-picker__title.data-v-e228acd5 {
|
||||
display: block;
|
||||
float: 1;
|
||||
color: var(--wot-picker-toolbar-title-color, rgba(0, 0, 0, 0.85));
|
||||
}
|
||||
93
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/types.js
vendored
Normal file
93
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/types.js
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
"use strict";
|
||||
const uni_modules_wotDesignUni_components_common_props = require("../common/props.js");
|
||||
const popupProps = {
|
||||
...uni_modules_wotDesignUni_components_common_props.baseProps,
|
||||
/**
|
||||
* 动画类型,参见 wd-transition 组件的name
|
||||
* 类型:string
|
||||
* 可选值:fade / fade-up / fade-down / fade-left / fade-right / slide-up / slide-down / slide-left / slide-right / zoom-in
|
||||
*/
|
||||
transition: String,
|
||||
/**
|
||||
* 关闭按钮
|
||||
* 类型:boolean
|
||||
* 默认值:false
|
||||
*/
|
||||
closable: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 弹出框的位置
|
||||
* 类型:string
|
||||
* 默认值:center
|
||||
* 可选值:center / top / right / bottom / left
|
||||
*/
|
||||
position: uni_modules_wotDesignUni_components_common_props.makeStringProp("center"),
|
||||
/**
|
||||
* 点击遮罩是否关闭
|
||||
* 类型:boolean
|
||||
* 默认值:true
|
||||
*/
|
||||
closeOnClickModal: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 动画持续时间
|
||||
* 类型:number | boolean
|
||||
* 默认值:300
|
||||
*/
|
||||
duration: {
|
||||
type: [Number, Boolean],
|
||||
default: 300
|
||||
},
|
||||
/**
|
||||
* 是否显示遮罩
|
||||
* 类型:boolean
|
||||
* 默认值:true
|
||||
*/
|
||||
modal: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 设置层级
|
||||
* 类型:number
|
||||
* 默认值:10
|
||||
*/
|
||||
zIndex: uni_modules_wotDesignUni_components_common_props.makeNumberProp(10),
|
||||
/**
|
||||
* 是否当关闭时将弹出层隐藏(display: none)
|
||||
* 类型:boolean
|
||||
* 默认值:true
|
||||
*/
|
||||
hideWhenClose: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 遮罩样式
|
||||
* 类型:string
|
||||
* 默认值:''
|
||||
*/
|
||||
modalStyle: uni_modules_wotDesignUni_components_common_props.makeStringProp(""),
|
||||
/**
|
||||
* 弹出面板是否设置底部安全距离(iphone X 类型的机型)
|
||||
* 类型:boolean
|
||||
* 默认值:false
|
||||
*/
|
||||
safeAreaInsetBottom: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 弹出层是否显示
|
||||
*/
|
||||
modelValue: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 弹层内容懒渲染,触发展示时才渲染内容
|
||||
* 类型:boolean
|
||||
* 默认值:true
|
||||
*/
|
||||
lazyRender: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 是否锁定滚动
|
||||
* 类型:boolean
|
||||
* 默认值:true
|
||||
*/
|
||||
lockScroll: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 是否从页面中脱离出来,用于解决各种 fixed 失效问题 (H5: teleport, APP: renderjs, 小程序: root-portal)
|
||||
* 类型:boolean
|
||||
* 默认值:false
|
||||
*/
|
||||
rootPortal: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false)
|
||||
};
|
||||
exports.popupProps = popupProps;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/types.js.map
|
||||
167
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/wd-popup.js
vendored
Normal file
167
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/wd-popup.js
vendored
Normal file
@@ -0,0 +1,167 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_wotDesignUni_components_wdPopup_types = require("./types.js");
|
||||
if (!Math) {
|
||||
(wdOverlay + wdIcon + wdTransition + wdRootPortal)();
|
||||
}
|
||||
const wdIcon = () => "../wd-icon/wd-icon.js";
|
||||
const wdOverlay = () => "../wd-overlay/wd-overlay.js";
|
||||
const wdTransition = () => "../wd-transition/wd-transition.js";
|
||||
const wdRootPortal = () => "../wd-root-portal/wd-root-portal.js";
|
||||
const __default__ = {
|
||||
name: "wd-popup",
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
};
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: uni_modules_wotDesignUni_components_wdPopup_types.popupProps,
|
||||
emits: [
|
||||
"update:modelValue",
|
||||
"before-enter",
|
||||
"enter",
|
||||
"before-leave",
|
||||
"leave",
|
||||
"after-leave",
|
||||
"after-enter",
|
||||
"click-modal",
|
||||
"close"
|
||||
],
|
||||
setup(__props, { emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const transitionName = common_vendor.computed(() => {
|
||||
if (props.transition) {
|
||||
return props.transition;
|
||||
}
|
||||
if (props.position === "center") {
|
||||
return ["zoom-in", "fade"];
|
||||
}
|
||||
if (props.position === "left") {
|
||||
return "slide-left";
|
||||
}
|
||||
if (props.position === "right") {
|
||||
return "slide-right";
|
||||
}
|
||||
if (props.position === "bottom") {
|
||||
return "slide-up";
|
||||
}
|
||||
if (props.position === "top") {
|
||||
return "slide-down";
|
||||
}
|
||||
return "slide-up";
|
||||
});
|
||||
const safeBottom = common_vendor.ref(0);
|
||||
const style = common_vendor.computed(() => {
|
||||
return `z-index:${props.zIndex}; padding-bottom: ${safeBottom.value}px;${props.customStyle}`;
|
||||
});
|
||||
const rootClass = common_vendor.computed(() => {
|
||||
return `wd-popup wd-popup--${props.position} ${!props.transition && props.position === "center" ? "is-deep" : ""} ${props.customClass || ""}`;
|
||||
});
|
||||
common_vendor.onBeforeMount(() => {
|
||||
if (props.safeAreaInsetBottom) {
|
||||
const { safeArea, screenHeight, safeAreaInsets } = common_vendor.index.getSystemInfoSync();
|
||||
if (safeArea) {
|
||||
safeBottom.value = screenHeight - (safeArea.bottom || 0);
|
||||
} else {
|
||||
safeBottom.value = 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
function handleClickModal() {
|
||||
emit("click-modal");
|
||||
if (props.closeOnClickModal) {
|
||||
close();
|
||||
}
|
||||
}
|
||||
function close() {
|
||||
emit("close");
|
||||
emit("update:modelValue", false);
|
||||
}
|
||||
function noop() {
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: _ctx.rootPortal
|
||||
}, _ctx.rootPortal ? common_vendor.e({
|
||||
b: _ctx.modal
|
||||
}, _ctx.modal ? {
|
||||
c: common_vendor.o(handleClickModal),
|
||||
d: common_vendor.o(noop),
|
||||
e: common_vendor.p({
|
||||
show: _ctx.modelValue,
|
||||
["z-index"]: _ctx.zIndex,
|
||||
["lock-scroll"]: _ctx.lockScroll,
|
||||
duration: _ctx.duration,
|
||||
["custom-style"]: _ctx.modalStyle
|
||||
})
|
||||
} : {}, {
|
||||
f: _ctx.closable
|
||||
}, _ctx.closable ? {
|
||||
g: common_vendor.o(close),
|
||||
h: common_vendor.p({
|
||||
["custom-class"]: "wd-popup__close",
|
||||
name: "add"
|
||||
})
|
||||
} : {}, {
|
||||
i: common_vendor.o(($event) => emit("before-enter")),
|
||||
j: common_vendor.o(($event) => emit("enter")),
|
||||
k: common_vendor.o(($event) => emit("after-enter")),
|
||||
l: common_vendor.o(($event) => emit("before-leave")),
|
||||
m: common_vendor.o(($event) => emit("leave")),
|
||||
n: common_vendor.o(($event) => emit("after-leave")),
|
||||
o: common_vendor.p({
|
||||
["lazy-render"]: _ctx.lazyRender,
|
||||
["custom-class"]: rootClass.value,
|
||||
["custom-style"]: style.value,
|
||||
duration: _ctx.duration,
|
||||
show: _ctx.modelValue,
|
||||
name: transitionName.value,
|
||||
destroy: _ctx.hideWhenClose
|
||||
})
|
||||
}) : common_vendor.e({
|
||||
p: _ctx.modal
|
||||
}, _ctx.modal ? {
|
||||
q: common_vendor.o(handleClickModal),
|
||||
r: common_vendor.o(noop),
|
||||
s: common_vendor.p({
|
||||
show: _ctx.modelValue,
|
||||
["z-index"]: _ctx.zIndex,
|
||||
["lock-scroll"]: _ctx.lockScroll,
|
||||
duration: _ctx.duration,
|
||||
["custom-style"]: _ctx.modalStyle
|
||||
})
|
||||
} : {}, {
|
||||
t: _ctx.closable
|
||||
}, _ctx.closable ? {
|
||||
v: common_vendor.o(close),
|
||||
w: common_vendor.p({
|
||||
["custom-class"]: "wd-popup__close",
|
||||
name: "add"
|
||||
})
|
||||
} : {}, {
|
||||
x: common_vendor.o(($event) => emit("before-enter")),
|
||||
y: common_vendor.o(($event) => emit("enter")),
|
||||
z: common_vendor.o(($event) => emit("after-enter")),
|
||||
A: common_vendor.o(($event) => emit("before-leave")),
|
||||
B: common_vendor.o(($event) => emit("leave")),
|
||||
C: common_vendor.o(($event) => emit("after-leave")),
|
||||
D: common_vendor.p({
|
||||
["lazy-render"]: _ctx.lazyRender,
|
||||
["custom-class"]: rootClass.value,
|
||||
["custom-style"]: style.value,
|
||||
duration: _ctx.duration,
|
||||
show: _ctx.modelValue,
|
||||
name: transitionName.value,
|
||||
destroy: _ctx.hideWhenClose
|
||||
})
|
||||
}));
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-25a8a9f7"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/wd-popup.js.map
|
||||
9
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/wd-popup.json
vendored
Normal file
9
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/wd-popup.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"wd-icon": "../wd-icon/wd-icon",
|
||||
"wd-overlay": "../wd-overlay/wd-overlay",
|
||||
"wd-transition": "../wd-transition/wd-transition",
|
||||
"wd-root-portal": "../wd-root-portal/wd-root-portal"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/wd-popup.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/wd-popup.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<wd-root-portal wx:if="{{a}}" class="data-v-25a8a9f7" u-s="{{['d']}}" u-i="25a8a9f7-0" bind:__l="__l"><view class="wd-popup-wrapper data-v-25a8a9f7"><wd-overlay wx:if="{{b}}" class="data-v-25a8a9f7" bindclick="{{c}}" bindtouchmove="{{d}}" u-i="25a8a9f7-1,25a8a9f7-0" bind:__l="__l" u-p="{{e}}"/><wd-transition wx:if="{{o}}" class="data-v-25a8a9f7" u-s="{{['d']}}" bindbeforeEnter="{{i}}" bindenter="{{j}}" bindafterEnter="{{k}}" bindbeforeLeave="{{l}}" bindleave="{{m}}" bindafterLeave="{{n}}" u-i="25a8a9f7-2,25a8a9f7-0" bind:__l="__l" u-p="{{o}}"><slot/><wd-icon wx:if="{{f}}" class="data-v-25a8a9f7" bindclick="{{g}}" u-i="25a8a9f7-3,25a8a9f7-2" bind:__l="__l" u-p="{{h}}"/></wd-transition></view></wd-root-portal><view wx:else class="wd-popup-wrapper data-v-25a8a9f7"><wd-overlay wx:if="{{p}}" class="data-v-25a8a9f7" bindclick="{{q}}" bindtouchmove="{{r}}" u-i="25a8a9f7-4" bind:__l="__l" u-p="{{s}}"/><wd-transition wx:if="{{D}}" class="data-v-25a8a9f7" u-s="{{['d']}}" bindbeforeEnter="{{x}}" bindenter="{{y}}" bindafterEnter="{{z}}" bindbeforeLeave="{{A}}" bindleave="{{B}}" bindafterLeave="{{C}}" u-i="25a8a9f7-5" bind:__l="__l" u-p="{{D}}"><slot/><wd-icon wx:if="{{t}}" class="data-v-25a8a9f7" bindclick="{{v}}" u-i="25a8a9f7-6,25a8a9f7-5" bind:__l="__l" u-p="{{w}}"/></wd-transition></view>
|
||||
218
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/wd-popup.wxss
vendored
Normal file
218
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/wd-popup.wxss
vendored
Normal file
@@ -0,0 +1,218 @@
|
||||
/* 水平间距 */
|
||||
/* 水平间距 */
|
||||
/**
|
||||
* 混合宏
|
||||
*/
|
||||
/**
|
||||
* 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-popup-wrapper.data-v-25a8a9f7 .wd-popup {
|
||||
background: var(--wot-dark-background2, #1b1b1b);
|
||||
}
|
||||
.wot-theme-dark .wd-popup-wrapper.data-v-25a8a9f7 .wd-popup__close {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wd-popup-wrapper.data-v-25a8a9f7 .wd-popup {
|
||||
position: fixed;
|
||||
max-height: 100%;
|
||||
overflow-y: auto;
|
||||
background: #fff;
|
||||
}
|
||||
.data-v-25a8a9f7 .wd-popup__close {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
color: var(--wot-popup-close-color, #666);
|
||||
font-size: var(--wot-popup-close-size, 24px);
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
.data-v-25a8a9f7 .wd-popup--center {
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate3d(-50%, -50%, 0);
|
||||
transform-origin: 0% 0%;
|
||||
}
|
||||
.data-v-25a8a9f7 .wd-popup--center.wd-zoom-in-enter,.data-v-25a8a9f7 .wd-popup--center.wd-zoom-in-leave-to {
|
||||
transform: scale(0.8) translate3d(-50%, -50%, 0) !important;
|
||||
}
|
||||
.data-v-25a8a9f7 .wd-popup--center.is-deep.wd-zoom-in-enter,.data-v-25a8a9f7 .wd-popup--center.is-deep.wd-zoom-in-leave-to {
|
||||
transform: scale(0.1) translate3d(-50%, -50%, 0) !important;
|
||||
}
|
||||
.data-v-25a8a9f7 .wd-popup--left {
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
.data-v-25a8a9f7 .wd-popup--right {
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.data-v-25a8a9f7 .wd-popup--top {
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
.data-v-25a8a9f7 .wd-popup--bottom {
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "wd-root-portal",
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {};
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-root-portal/wd-root-portal.js.map
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user