678 lines
19 KiB
JavaScript
678 lines
19 KiB
JavaScript
// node_modules/@tuniao/tnui-vue3-uniapp/utils/is-empty.ts
|
|
var isEmptyVariableInDefault = (variable, defaultValue = void 0) => {
|
|
return variable === void 0 || variable === null ? defaultValue : variable;
|
|
};
|
|
var isEmptyDoubleVariableInDefault = (variable1, variable2, defaultValue = void 0) => {
|
|
return isEmptyVariableInDefault(
|
|
variable1,
|
|
isEmptyVariableInDefault(variable2, defaultValue)
|
|
);
|
|
};
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/utils/vue/install.ts
|
|
var withInstall = (main, extra) => {
|
|
;
|
|
main.install = (app) => {
|
|
for (const comp of [
|
|
main,
|
|
...Object.values(isEmptyVariableInDefault(extra, {}))
|
|
]) {
|
|
app.component(comp.name, comp);
|
|
}
|
|
};
|
|
if (extra) {
|
|
for (const [key, comp] of Object.entries(extra)) {
|
|
;
|
|
main[key] = comp;
|
|
}
|
|
}
|
|
return main;
|
|
};
|
|
var withInstallFunction = (fn, name) => {
|
|
;
|
|
fn.install = (app) => {
|
|
;
|
|
fn._content = app._context;
|
|
app.config.globalProperties[name] = fn;
|
|
};
|
|
return fn;
|
|
};
|
|
var withInstallDirective = (directive, name) => {
|
|
;
|
|
directive.install = (app) => {
|
|
app.directive(name, directive);
|
|
};
|
|
};
|
|
var withNoopInstall = (component) => {
|
|
;
|
|
component.install = () => {
|
|
};
|
|
return component;
|
|
};
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/utils/vue/props/runtime.ts
|
|
import { warn } from "vue";
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/from-pairs.ts
|
|
function fromPairs(pairs) {
|
|
const result = {};
|
|
if (pairs == null) {
|
|
return result;
|
|
}
|
|
for (const pair of pairs) {
|
|
result[pair[0]] = pair[1];
|
|
}
|
|
return result;
|
|
}
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/is-nil.ts
|
|
function isNil(value) {
|
|
return value == null;
|
|
}
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/is-object-like.ts
|
|
function isObjectLike(value) {
|
|
return value != null && typeof value == "object";
|
|
}
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/_objectToString.ts
|
|
var objectProto = Object.prototype;
|
|
var objectToString = objectProto.toString;
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/is-boolean.ts
|
|
var boolTag = "[object Boolean]";
|
|
function isBoolean(value) {
|
|
return value === true || value === false || isObjectLike(value) && objectToString.call(value) == boolTag;
|
|
}
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/is-number.ts
|
|
var numberTag = "[object Number]";
|
|
function isNumber(value) {
|
|
return typeof value == "number" || isObjectLike(value) && objectToString.call(value) == numberTag;
|
|
}
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/_isKey.ts
|
|
import { isSymbol } from "@vue/shared";
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/_common.ts
|
|
var reIsPlainProp = /^\w*$/;
|
|
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
|
|
var reLeadingDot = /^\./;
|
|
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
var reEscapeChar = /\\(\\)?/g;
|
|
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
var INFINITY = 1 / 0;
|
|
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/_isKey.ts
|
|
function isKey(value, object) {
|
|
if (Array.isArray(value)) {
|
|
return false;
|
|
}
|
|
const type = typeof value;
|
|
if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
|
|
return true;
|
|
}
|
|
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || // eslint-disable-next-line unicorn/new-for-builtins
|
|
object != null && value in Object(object);
|
|
}
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/_baseToString.ts
|
|
import { isSymbol as isSymbol2 } from "@vue/shared";
|
|
var symbolProto = Symbol ? Symbol.prototype : void 0;
|
|
var symbolToString = symbolProto ? symbolProto.toString : void 0;
|
|
function baseToString(value) {
|
|
if (typeof value == "string") {
|
|
return value;
|
|
}
|
|
if (isSymbol2(value)) {
|
|
return symbolToString ? symbolToString.call(value) : "";
|
|
}
|
|
const result = `${value}`;
|
|
return result == "0" && 1 / value == -INFINITY ? "-0" : result;
|
|
}
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/_toString.ts
|
|
function toString(value) {
|
|
return value == null ? "" : baseToString(value);
|
|
}
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/_stringToPath.ts
|
|
var stringToPath = function(string) {
|
|
string = toString(string);
|
|
const result = [];
|
|
if (reLeadingDot.test(string)) {
|
|
result.push("");
|
|
}
|
|
string.replace(
|
|
rePropName,
|
|
(match, number, quote, string2) => {
|
|
result.push(quote ? string2.replace(reEscapeChar, "$1") : number || match);
|
|
return "";
|
|
}
|
|
);
|
|
return result;
|
|
};
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/_castPath.ts
|
|
function castPath(value) {
|
|
return Array.isArray(value) ? value : stringToPath(value);
|
|
}
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/_toKey.ts
|
|
import { isSymbol as isSymbol3 } from "@vue/shared";
|
|
function toKey(value) {
|
|
if (typeof value == "string" || isSymbol3(value)) {
|
|
return value;
|
|
}
|
|
const result = `${value}`;
|
|
return result == "0" && 1 / value == -INFINITY ? "-0" : result;
|
|
}
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/get.ts
|
|
function baseGet(object, path) {
|
|
path = isKey(path, object) ? [path] : castPath(path);
|
|
let index = 0;
|
|
const length = path.length;
|
|
while (object != null && index < length) {
|
|
object = object[toKey(path[index++])];
|
|
}
|
|
return index && index == length ? object : void 0;
|
|
}
|
|
function get(object, path, defaultValue) {
|
|
const result = object == null ? void 0 : baseGet(object, path);
|
|
return result === void 0 ? defaultValue : result;
|
|
}
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/set.ts
|
|
import { isObject } from "@vue/shared";
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/_isIndex.ts
|
|
function isIndex(value, length) {
|
|
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
return !!length && (typeof value == "number" || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
|
|
}
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/_eq.ts
|
|
function eq(value, other) {
|
|
return value === other || value !== value && other !== other;
|
|
}
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/_assignValue.ts
|
|
var objectProto2 = Object.prototype;
|
|
var hasOwnProperty = objectProto2.hasOwnProperty;
|
|
function assignValue(object, key, value) {
|
|
const objValue = object[key];
|
|
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
|
|
object[key] = value;
|
|
}
|
|
}
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/set.ts
|
|
function baseSet(object, path, value, customizer) {
|
|
if (!isObject(object)) {
|
|
return object;
|
|
}
|
|
path = isKey(path, object) ? [path] : castPath(path);
|
|
let index = -1;
|
|
const length = path.length;
|
|
const lastIndex = length - 1;
|
|
let nested = object;
|
|
while (nested != null && ++index < length) {
|
|
const key = toKey(path[index]);
|
|
let newValue = value;
|
|
if (index != lastIndex) {
|
|
const objValue = nested[key];
|
|
newValue = customizer ? customizer(objValue, key, nested) : void 0;
|
|
if (newValue === void 0) {
|
|
newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
|
|
}
|
|
}
|
|
assignValue(nested, key, newValue);
|
|
nested = nested[key];
|
|
}
|
|
return object;
|
|
}
|
|
function set(object, path, value) {
|
|
return object == null ? object : baseSet(object, path, value);
|
|
}
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/debounce.ts
|
|
import { isObject as isObject3 } from "@vue/shared";
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/_toNumber.ts
|
|
import { isObject as isObject2, isSymbol as isSymbol4 } from "@vue/shared";
|
|
var NAN = 0 / 0;
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/throttle.ts
|
|
import { isObject as isObject4 } from "@vue/shared";
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/_hasUnicode.ts
|
|
var rsAstralRange = "\\ud800-\\udfff";
|
|
var rsComboMarksRange = "\\u0300-\\u036f";
|
|
var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
|
|
var rsComboSymbolsRange = "\\u20d0-\\u20ff";
|
|
var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
|
|
var rsVarRange = "\\ufe0e\\ufe0f";
|
|
var rsZWJ = "\\u200d";
|
|
var reHasUnicode = new RegExp(
|
|
`[${rsZWJ}${rsAstralRange}${rsComboRange}${rsVarRange}]`
|
|
);
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/_unicodeToArray.ts
|
|
var rsAstralRange2 = "\\ud800-\\udfff";
|
|
var rsComboMarksRange2 = "\\u0300-\\u036f";
|
|
var reComboHalfMarksRange2 = "\\ufe20-\\ufe2f";
|
|
var rsComboSymbolsRange2 = "\\u20d0-\\u20ff";
|
|
var rsComboRange2 = rsComboMarksRange2 + reComboHalfMarksRange2 + rsComboSymbolsRange2;
|
|
var rsVarRange2 = "\\ufe0e\\ufe0f";
|
|
var rsAstral = `[${rsAstralRange2}]`;
|
|
var rsCombo = `[${rsComboRange2}]`;
|
|
var rsFitz = "\\ud83c[\\udffb-\\udfff]";
|
|
var rsModifier = `(?:${rsCombo}|${rsFitz})`;
|
|
var rsNonAstral = `[^${rsAstralRange2}]`;
|
|
var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}";
|
|
var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]";
|
|
var rsZWJ2 = "\\u200d";
|
|
var reOptMod = `${rsModifier}?`;
|
|
var rsOptVar = `[${rsVarRange2}]?`;
|
|
var rsOptJoin = `(?:${rsZWJ2}(?:${[rsNonAstral, rsRegional, rsSurrPair].join(
|
|
"|"
|
|
)})${rsOptVar}${reOptMod})*`;
|
|
var rsSeq = rsOptVar + reOptMod + rsOptJoin;
|
|
var rsSymbol = `(?:${[
|
|
`${rsNonAstral + rsCombo}?`,
|
|
rsCombo,
|
|
rsRegional,
|
|
rsSurrPair,
|
|
rsAstral
|
|
].join("|")})`;
|
|
var reUnicode = new RegExp(`${rsFitz}(?=${rsFitz})|${rsSymbol}${rsSeq}`, "g");
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/utils/types.ts
|
|
import { isArray, isObject as isObject5, isString } from "@vue/shared";
|
|
import {
|
|
isArray as isArray2,
|
|
isFunction,
|
|
isObject as isObject6,
|
|
isString as isString2,
|
|
isDate,
|
|
isPromise,
|
|
isSymbol as isSymbol5
|
|
} from "@vue/shared";
|
|
var isUndefined = (val) => val === void 0;
|
|
var isEmpty = (val) => !val && val !== 0 || isArray(val) && val.length === 0 || isObject5(val) && !Object.keys(val).length;
|
|
var isElement = (e) => {
|
|
if (typeof Element === "undefined")
|
|
return false;
|
|
return e instanceof Element;
|
|
};
|
|
var isPropAbsent = (prop) => {
|
|
return isNil(prop);
|
|
};
|
|
var isStringNumber = (val) => {
|
|
if (!isString(val))
|
|
return false;
|
|
return !Number.isNaN(Number(val));
|
|
};
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/utils/objects.ts
|
|
import { hasOwn } from "@vue/shared";
|
|
var keysOf = (arr) => Object.keys(arr);
|
|
var entriesOf = (arr) => Object.entries(arr);
|
|
var getProp = (obj, path, defaultValue) => {
|
|
return {
|
|
get value() {
|
|
return get(obj, path, defaultValue);
|
|
},
|
|
set value(val) {
|
|
set(obj, path, val);
|
|
}
|
|
};
|
|
};
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/utils/vue/props/runtime.ts
|
|
var tnPropKey = "__tnPropKey";
|
|
var definePropType = (val) => val;
|
|
var isTnProp = (val) => isObject6(val) && !!val[tnPropKey];
|
|
var buildProp = (prop, key) => {
|
|
if (!isObject6(prop) || isTnProp(prop))
|
|
return prop;
|
|
const { values, required, default: defaultValue, type, validator } = prop;
|
|
const _validator = values || validator ? (val) => {
|
|
let valid = false;
|
|
let allowedValues = [];
|
|
if (values) {
|
|
allowedValues = Array.from(values);
|
|
if (hasOwn(prop, "default")) {
|
|
allowedValues.push(defaultValue);
|
|
}
|
|
valid || (valid = allowedValues.includes(val));
|
|
}
|
|
if (validator)
|
|
valid || (valid = validator(val));
|
|
if (!valid && allowedValues.length > 0) {
|
|
const allowValuesText = [...new Set(allowedValues)].map((value) => JSON.stringify(value)).join(", ");
|
|
warn(
|
|
`Invalid prop: validation failed${key ? ` for prop "${key}"` : ""}. Expected one of [${allowValuesText}], got value ${JSON.stringify(
|
|
val
|
|
)}.`
|
|
);
|
|
}
|
|
return valid;
|
|
} : void 0;
|
|
const tnProp = {
|
|
type,
|
|
required: !!required,
|
|
validator: _validator,
|
|
[tnPropKey]: true
|
|
};
|
|
if (hasOwn(prop, "default"))
|
|
tnProp.default = defaultValue;
|
|
return tnProp;
|
|
};
|
|
var buildProps = (props) => fromPairs(
|
|
Object.entries(props).map(([key, option]) => [
|
|
key,
|
|
buildProp(option, key)
|
|
])
|
|
);
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/utils/vue/icon.ts
|
|
var iconPropType = definePropType([String]);
|
|
var FormValidateIconsMap = {
|
|
validating: "loading",
|
|
success: "success-circle",
|
|
error: "close-circle"
|
|
};
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/utils/debounce.ts
|
|
var debounce2 = (fn, delay, immediate = false) => {
|
|
let timer = null;
|
|
let isInvoke = false;
|
|
const _debounce = function(thisArg, ...args) {
|
|
if (timer)
|
|
clearTimeout(timer);
|
|
if (immediate && !isInvoke) {
|
|
fn.apply(thisArg, args);
|
|
isInvoke = true;
|
|
} else {
|
|
timer = setTimeout(() => {
|
|
fn.apply(thisArg, args);
|
|
isInvoke = false;
|
|
}, delay);
|
|
}
|
|
};
|
|
_debounce.cancel = function() {
|
|
if (timer)
|
|
clearTimeout(timer);
|
|
timer = null;
|
|
isInvoke = false;
|
|
};
|
|
return _debounce;
|
|
};
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/utils/throttle.ts
|
|
var throttle2 = (fn, interval, option) => {
|
|
const { leading, trailing } = option;
|
|
let lastTime = 0;
|
|
let timer = null;
|
|
const _throttle = function(thisArg, ...args) {
|
|
const nowTime = Date.now();
|
|
if (!lastTime && !leading)
|
|
lastTime = nowTime;
|
|
const remainTime = interval - (nowTime - lastTime);
|
|
if (remainTime <= 0) {
|
|
if (timer) {
|
|
clearTimeout(timer);
|
|
timer = null;
|
|
}
|
|
fn.apply(thisArg, args);
|
|
lastTime = nowTime;
|
|
return;
|
|
}
|
|
if (trailing && !timer) {
|
|
timer = setTimeout(() => {
|
|
fn.apply(thisArg, args);
|
|
timer = null;
|
|
lastTime = leading ? Date.now() : 0;
|
|
}, remainTime);
|
|
}
|
|
};
|
|
_throttle.cancel = function() {
|
|
if (timer)
|
|
clearTimeout(timer);
|
|
timer = null;
|
|
lastTime = 0;
|
|
};
|
|
return _throttle;
|
|
};
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/utils/typescript.ts
|
|
var mutable = (val) => val;
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/utils/dom/unit.ts
|
|
var formatDomSizeValue = (value, unit = "rpx", empty = true) => {
|
|
if (!value)
|
|
return empty ? "" : `0${unit}`;
|
|
if (isString2(value) && /(^calc)|(%|vw|vh|px|rpx|auto)$/.test(value))
|
|
return value;
|
|
return `${value}${unit}`;
|
|
};
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/utils/dom/select-query.ts
|
|
var createSelectorQuery = (instance) => {
|
|
let query = null;
|
|
query = uni.createSelectorQuery().in(instance);
|
|
return query;
|
|
};
|
|
var getSelectorNodeInfo = (query, selector) => {
|
|
return new Promise((resolve, reject) => {
|
|
query.select(selector).boundingClientRect((res) => {
|
|
const selectRes = res;
|
|
if (selectRes) {
|
|
resolve(selectRes);
|
|
} else {
|
|
reject(new Error(`未找到对应节点: ${selector}`));
|
|
}
|
|
}).exec();
|
|
});
|
|
};
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/utils/rand.ts
|
|
var generateId = () => Math.floor(Math.random() * 1e4);
|
|
var getRandomInt = (max) => Math.floor(Math.random() * Math.floor(max));
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/utils/error.ts
|
|
import { isString as isString3 } from "@vue/shared";
|
|
var TuniaoUIError = class extends Error {
|
|
constructor(message) {
|
|
super(message);
|
|
this.name = "TuniaoUIError";
|
|
}
|
|
};
|
|
function throwError(scope, msg) {
|
|
throw new TuniaoUIError(`[${scope}] ${msg}`);
|
|
}
|
|
function debugWarn(scope, message) {
|
|
if (true) {
|
|
const error = isString3(scope) ? new TuniaoUIError(`[${scope}] ${message}`) : scope;
|
|
console.warn(error);
|
|
}
|
|
}
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/utils/uniapp/router.ts
|
|
function tnNavBack(indexUrl, delta = 1) {
|
|
const indexPageUrl = isEmptyVariableInDefault(indexUrl, "/pages/index/index");
|
|
const pages = getCurrentPages();
|
|
if (pages == null ? void 0 : pages.length) {
|
|
const firstPage = pages[0];
|
|
if (pages.length === 1 && (!firstPage.route || (firstPage == null ? void 0 : firstPage.route) != indexPageUrl)) {
|
|
return tnNavPage(indexPageUrl, "reLaunch");
|
|
} else {
|
|
uni.navigateBack({
|
|
delta
|
|
});
|
|
return Promise.resolve();
|
|
}
|
|
} else {
|
|
return tnNavPage(indexPageUrl, "reLaunch");
|
|
}
|
|
}
|
|
function tnNavPage(url, type = "navigateTo") {
|
|
function handelNavFail(err) {
|
|
debugWarn("tnNavPage", `跳转页面失败: ${err}`);
|
|
}
|
|
return new Promise((resolve, reject) => {
|
|
switch (type) {
|
|
case "navigateTo":
|
|
uni.navigateTo({
|
|
url,
|
|
success: () => {
|
|
resolve();
|
|
},
|
|
fail: (err) => {
|
|
handelNavFail(err);
|
|
reject(err);
|
|
}
|
|
});
|
|
break;
|
|
case "redirectTo":
|
|
uni.redirectTo({
|
|
url,
|
|
success: () => {
|
|
resolve();
|
|
},
|
|
fail: (err) => {
|
|
handelNavFail(err);
|
|
reject(err);
|
|
}
|
|
});
|
|
break;
|
|
case "reLaunch":
|
|
uni.reLaunch({
|
|
url,
|
|
success: () => {
|
|
resolve();
|
|
},
|
|
fail: (err) => {
|
|
handelNavFail(err);
|
|
reject(err);
|
|
}
|
|
});
|
|
break;
|
|
case "switchTab":
|
|
uni.switchTab({
|
|
url,
|
|
success: () => {
|
|
resolve();
|
|
},
|
|
fail: (err) => {
|
|
handelNavFail(err);
|
|
reject(err);
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/utils/format.ts
|
|
var formatNumber = (value, len = 2, prefixZero = true) => {
|
|
let number = 0;
|
|
if (typeof value === "string") {
|
|
if (value === "")
|
|
return value;
|
|
number = Number(value);
|
|
} else if (typeof value === "number") {
|
|
number = value;
|
|
}
|
|
if (Number.isNaN(number) || number === 0)
|
|
return prefixZero ? "00" : "0";
|
|
const maxNumber = Math.pow(10, len) - 1;
|
|
if (number > maxNumber)
|
|
return `${maxNumber}+`;
|
|
number = String(number);
|
|
return prefixZero ? `00${number}`.slice(Math.max(0, number.length > 2 ? 2 : number.length)) : number;
|
|
};
|
|
|
|
// node_modules/@tuniao/tnui-vue3-uniapp/utils/clone-deep.ts
|
|
var cloneDeep = (value, visited = /* @__PURE__ */ new WeakMap()) => {
|
|
if (value === null || typeof value !== "object") {
|
|
return value;
|
|
}
|
|
if (visited.has(value)) {
|
|
return visited.get(value);
|
|
}
|
|
if (Array.isArray(value)) {
|
|
const clonedArray = value.map((item) => cloneDeep(item, visited));
|
|
visited.set(value, clonedArray);
|
|
return clonedArray;
|
|
}
|
|
if (value instanceof Date) {
|
|
return new Date(value.getTime());
|
|
}
|
|
if (value instanceof RegExp) {
|
|
const flags = value.flags;
|
|
return new RegExp(value.source, flags);
|
|
}
|
|
const clonedObject = {};
|
|
visited.set(value, clonedObject);
|
|
for (const key in value) {
|
|
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
|
clonedObject[key] = cloneDeep(value[key], visited);
|
|
}
|
|
}
|
|
const prototype = Object.getPrototypeOf(value);
|
|
Object.setPrototypeOf(clonedObject, cloneDeep(prototype, visited));
|
|
return clonedObject;
|
|
};
|
|
|
|
export {
|
|
isEmptyVariableInDefault,
|
|
isEmptyDoubleVariableInDefault,
|
|
withInstall,
|
|
withInstallFunction,
|
|
withInstallDirective,
|
|
withNoopInstall,
|
|
isBoolean,
|
|
isNumber,
|
|
isUndefined,
|
|
isEmpty,
|
|
isElement,
|
|
isPropAbsent,
|
|
isStringNumber,
|
|
isArray2 as isArray,
|
|
isFunction,
|
|
isObject6 as isObject,
|
|
isString2 as isString,
|
|
isDate,
|
|
isPromise,
|
|
isSymbol5 as isSymbol,
|
|
keysOf,
|
|
entriesOf,
|
|
getProp,
|
|
hasOwn,
|
|
tnPropKey,
|
|
definePropType,
|
|
isTnProp,
|
|
buildProp,
|
|
buildProps,
|
|
iconPropType,
|
|
FormValidateIconsMap,
|
|
debounce2 as debounce,
|
|
throttle2 as throttle,
|
|
mutable,
|
|
formatDomSizeValue,
|
|
createSelectorQuery,
|
|
getSelectorNodeInfo,
|
|
generateId,
|
|
getRandomInt,
|
|
throwError,
|
|
debugWarn,
|
|
tnNavBack,
|
|
tnNavPage,
|
|
formatNumber,
|
|
cloneDeep
|
|
};
|
|
//# sourceMappingURL=chunk-7X6NDDPW.js.map
|