init
This commit is contained in:
32
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_constants/event.js
vendored
Normal file
32
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_constants/event.js
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
const UPDATE_MODEL_EVENT = "update:modelValue";
|
||||
const UPDATE_VISIBLE_EVENT = "update:visible";
|
||||
const CHANGE_EVENT = "change";
|
||||
const INPUT_EVENT = "input";
|
||||
const CLICK_EVENT = "click";
|
||||
const OPEN_EVENT = "open";
|
||||
const CLOSE_EVENT = "close";
|
||||
const OPENED_EVENT = "opened";
|
||||
const CLOSED_EVENT = "closed";
|
||||
const FOCUS_EVENT = "focus";
|
||||
const BLUR_EVENT = "blur";
|
||||
const CONFIRM_EVENT = "confirm";
|
||||
const SEARCH_EVENT = "search";
|
||||
const CLEAR_EVENT = "clear";
|
||||
const CANCEL_EVENT = "cancel";
|
||||
exports.BLUR_EVENT = BLUR_EVENT;
|
||||
exports.CANCEL_EVENT = CANCEL_EVENT;
|
||||
exports.CHANGE_EVENT = CHANGE_EVENT;
|
||||
exports.CLEAR_EVENT = CLEAR_EVENT;
|
||||
exports.CLICK_EVENT = CLICK_EVENT;
|
||||
exports.CLOSED_EVENT = CLOSED_EVENT;
|
||||
exports.CLOSE_EVENT = CLOSE_EVENT;
|
||||
exports.CONFIRM_EVENT = CONFIRM_EVENT;
|
||||
exports.FOCUS_EVENT = FOCUS_EVENT;
|
||||
exports.INPUT_EVENT = INPUT_EVENT;
|
||||
exports.OPENED_EVENT = OPENED_EVENT;
|
||||
exports.OPEN_EVENT = OPEN_EVENT;
|
||||
exports.SEARCH_EVENT = SEARCH_EVENT;
|
||||
exports.UPDATE_MODEL_EVENT = UPDATE_MODEL_EVENT;
|
||||
exports.UPDATE_VISIBLE_EVENT = UPDATE_VISIBLE_EVENT;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_constants/event.js.map
|
||||
2
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_constants/index.js
vendored
Normal file
2
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_constants/index.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_constants/index.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_constants/prefix.js
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_constants/prefix.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
const PREFIX = "nut";
|
||||
exports.PREFIX = PREFIX;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_constants/prefix.js.map
|
||||
10
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_constants/types.js
vendored
Normal file
10
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_constants/types.js
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
const animationName = {
|
||||
center: "fade",
|
||||
top: "slide-down",
|
||||
bottom: "slide-up",
|
||||
left: "slide-left",
|
||||
right: "slide-right"
|
||||
};
|
||||
exports.animationName = animationName;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_constants/types.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/index.js
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/index.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
require("../../../../common/vendor.js");
|
||||
require("../_utils/env.js");
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_hooks/index.js.map
|
||||
3
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useExpose.js
vendored
Normal file
3
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useExpose.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
require("../../../../common/vendor.js");
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_hooks/useExpose.js.map
|
||||
7
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useGlobalZIndex.js
vendored
Normal file
7
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useGlobalZIndex.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
let globalZIndex = 2e3;
|
||||
function useGlobalZIndex() {
|
||||
return ++globalZIndex;
|
||||
}
|
||||
exports.useGlobalZIndex = useGlobalZIndex;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_hooks/useGlobalZIndex.js.map
|
||||
22
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useInject.js
vendored
Normal file
22
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useInject.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
function useInject(key) {
|
||||
const parent = common_vendor.inject(key, null);
|
||||
if (parent) {
|
||||
const instance = common_vendor.getCurrentInstance();
|
||||
const { add, remove, internalChildren } = parent;
|
||||
add(instance);
|
||||
common_vendor.onUnmounted(() => remove(instance));
|
||||
const index = common_vendor.computed(() => internalChildren.indexOf(instance));
|
||||
return {
|
||||
parent,
|
||||
index
|
||||
};
|
||||
}
|
||||
return {
|
||||
parent: null,
|
||||
index: common_vendor.ref(-1)
|
||||
};
|
||||
}
|
||||
exports.useInject = useInject;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_hooks/useInject.js.map
|
||||
3
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useLockScroll.js
vendored
Normal file
3
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useLockScroll.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
require("../../../../common/vendor.js");
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_hooks/useLockScroll.js.map
|
||||
69
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useProvide.js
vendored
Normal file
69
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useProvide.js
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
function isVNode(value) {
|
||||
return value ? value.__v_isVNode === true : false;
|
||||
}
|
||||
function flattenVNodes(shouldTraverseChildren, childName) {
|
||||
const result = [];
|
||||
const traverse = (children) => {
|
||||
if (!Array.isArray(children))
|
||||
return;
|
||||
children.forEach((child) => {
|
||||
var _a;
|
||||
if (!isVNode(child))
|
||||
return;
|
||||
if (childName) {
|
||||
if (child.type && child.type.name === childName) {
|
||||
result.push(child);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
result.push(child);
|
||||
}
|
||||
if ((_a = child.component) == null ? void 0 : _a.subTree)
|
||||
traverse(child.component.subTree.children);
|
||||
if (child.children)
|
||||
traverse(child.children);
|
||||
});
|
||||
};
|
||||
traverse(shouldTraverseChildren);
|
||||
return result;
|
||||
}
|
||||
function sortChildren(parent, internalChildren, childName) {
|
||||
const vnodes = flattenVNodes(parent && parent.subTree && parent.subTree.children, childName);
|
||||
internalChildren.sort((a, b) => {
|
||||
return vnodes.indexOf(a.vnode) - vnodes.indexOf(b.vnode);
|
||||
});
|
||||
}
|
||||
function useProvide(key, childName) {
|
||||
const internalChildren = common_vendor.shallowReactive([]);
|
||||
const publicChildren = common_vendor.shallowReactive([]);
|
||||
const parent = common_vendor.getCurrentInstance();
|
||||
const add = (child) => {
|
||||
if (!child.proxy)
|
||||
return;
|
||||
internalChildren.push(common_vendor.markRaw(child));
|
||||
publicChildren.push(common_vendor.markRaw(child.proxy));
|
||||
sortChildren(parent, internalChildren, childName);
|
||||
};
|
||||
const remove = (child) => {
|
||||
if (child.proxy) {
|
||||
internalChildren.splice(internalChildren.indexOf(common_vendor.markRaw(child)), 1);
|
||||
publicChildren.splice(publicChildren.indexOf(common_vendor.markRaw(child.proxy)), 1);
|
||||
}
|
||||
};
|
||||
return (value) => {
|
||||
common_vendor.provide(key, {
|
||||
add,
|
||||
remove,
|
||||
internalChildren,
|
||||
...value
|
||||
});
|
||||
return {
|
||||
internalChildren,
|
||||
children: publicChildren
|
||||
};
|
||||
};
|
||||
}
|
||||
exports.useProvide = useProvide;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_hooks/useProvide.js.map
|
||||
8
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useRect.js
vendored
Normal file
8
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useRect.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
const uni_modules_nutuiUni_components__hooks_useSelectorQuery = require("./useSelectorQuery.js");
|
||||
function useRect(id, instance) {
|
||||
const { getSelectorNodeInfo } = uni_modules_nutuiUni_components__hooks_useSelectorQuery.useSelectorQuery(instance);
|
||||
return getSelectorNodeInfo(`#${id}`);
|
||||
}
|
||||
exports.useRect = useRect;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_hooks/useRect.js.map
|
||||
3
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useRelation.js
vendored
Normal file
3
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useRelation.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
require("../../../../common/vendor.js");
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_hooks/useRelation.js.map
|
||||
24
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useRouter.js
vendored
Normal file
24
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useRouter.js
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
function useRouter() {
|
||||
const push = (options) => {
|
||||
if (typeof options === "string") {
|
||||
common_vendor.index.navigateTo({ url: options });
|
||||
return;
|
||||
}
|
||||
common_vendor.index.navigateTo(options);
|
||||
};
|
||||
const replace = (options) => {
|
||||
if (typeof options === "string") {
|
||||
common_vendor.index.redirectTo({ url: options });
|
||||
return;
|
||||
}
|
||||
common_vendor.index.redirectTo(options);
|
||||
};
|
||||
return {
|
||||
push,
|
||||
replace
|
||||
};
|
||||
}
|
||||
exports.useRouter = useRouter;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_hooks/useRouter.js.map
|
||||
47
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useSelectorQuery.js
vendored
Normal file
47
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useSelectorQuery.js
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
function useSelectorQuery(instance) {
|
||||
let query = null;
|
||||
if (!instance)
|
||||
instance = common_vendor.getCurrentInstance();
|
||||
if (!instance)
|
||||
common_vendor.index.__f__("warn", "at uni_modules/nutui-uni/components/_hooks/useSelectorQuery.ts:11", "useSelectorQuery", "useSelectorQuery必须在setup函数中使用");
|
||||
query = common_vendor.index.createSelectorQuery().in(instance);
|
||||
const getSelectorNodeInfo = (selector) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (query) {
|
||||
query.select(selector).boundingClientRect((res) => {
|
||||
const selectRes = res;
|
||||
if (selectRes)
|
||||
resolve(selectRes);
|
||||
else
|
||||
reject(new Error(`未找到对应节点: ${selector}`));
|
||||
}).exec();
|
||||
} else {
|
||||
reject(new Error("未找到对应的SelectorQuery实例"));
|
||||
}
|
||||
});
|
||||
};
|
||||
const getSelectorNodeInfos = (selector) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (query) {
|
||||
query.selectAll(selector).boundingClientRect((res) => {
|
||||
const selectRes = res;
|
||||
if (selectRes && selectRes.length > 0)
|
||||
resolve(selectRes);
|
||||
else
|
||||
reject(new Error(`未找到对应节点: ${selector}`));
|
||||
}).exec();
|
||||
} else {
|
||||
reject(new Error("未找到对应的SelectorQuery实例"));
|
||||
}
|
||||
});
|
||||
};
|
||||
return {
|
||||
query,
|
||||
getSelectorNodeInfo,
|
||||
getSelectorNodeInfos
|
||||
};
|
||||
}
|
||||
exports.useSelectorQuery = useSelectorQuery;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_hooks/useSelectorQuery.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useStyle.js
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useStyle.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
require("../../../../common/vendor.js");
|
||||
require("../_utils/env.js");
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_hooks/useStyle.js.map
|
||||
64
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useTouch.js
vendored
Normal file
64
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_hooks/useTouch.js
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const MIN_DISTANCE = 10;
|
||||
function getDirection(x, y) {
|
||||
if (x > y && x > MIN_DISTANCE)
|
||||
return "horizontal";
|
||||
if (y > x && y > MIN_DISTANCE)
|
||||
return "vertical";
|
||||
return "";
|
||||
}
|
||||
function useTouch() {
|
||||
const startX = common_vendor.ref(0);
|
||||
const startY = common_vendor.ref(0);
|
||||
const moveX = common_vendor.ref(0);
|
||||
const moveY = common_vendor.ref(0);
|
||||
const deltaX = common_vendor.ref(0);
|
||||
const deltaY = common_vendor.ref(0);
|
||||
const offsetX = common_vendor.ref(0);
|
||||
const offsetY = common_vendor.ref(0);
|
||||
const direction = common_vendor.ref("");
|
||||
const isVertical = () => direction.value === "vertical";
|
||||
const isHorizontal = () => direction.value === "horizontal";
|
||||
const reset = () => {
|
||||
deltaX.value = 0;
|
||||
deltaY.value = 0;
|
||||
offsetX.value = 0;
|
||||
offsetY.value = 0;
|
||||
direction.value = "";
|
||||
};
|
||||
const start = (event) => {
|
||||
reset();
|
||||
startX.value = event.touches[0].clientX;
|
||||
startY.value = event.touches[0].clientY;
|
||||
};
|
||||
const move = (event) => {
|
||||
const touch = event.touches[0];
|
||||
deltaX.value = touch.clientX - startX.value;
|
||||
deltaY.value = touch.clientY - startY.value;
|
||||
moveX.value = touch.clientX;
|
||||
moveY.value = touch.clientY;
|
||||
offsetX.value = Math.abs(deltaX.value);
|
||||
offsetY.value = Math.abs(deltaY.value);
|
||||
if (!direction.value)
|
||||
direction.value = getDirection(offsetX.value, offsetY.value);
|
||||
};
|
||||
return {
|
||||
move,
|
||||
start,
|
||||
reset,
|
||||
startX,
|
||||
startY,
|
||||
moveX,
|
||||
moveY,
|
||||
deltaX,
|
||||
deltaY,
|
||||
offsetX,
|
||||
offsetY,
|
||||
direction,
|
||||
isVertical,
|
||||
isHorizontal
|
||||
};
|
||||
}
|
||||
exports.useTouch = useTouch;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_hooks/useTouch.js.map
|
||||
140
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_utils/common.js
vendored
Normal file
140
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_utils/common.js
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
"use strict";
|
||||
require("../../../../common/vendor.js");
|
||||
const uni_modules_nutuiUni_components__utils_is = require("./is.js");
|
||||
function TypeOfFun(value) {
|
||||
if (value === null)
|
||||
return "null";
|
||||
const type = typeof value;
|
||||
if (type === "undefined" || type === "string")
|
||||
return type;
|
||||
const typeString = toString.call(value);
|
||||
switch (typeString) {
|
||||
case "[object Array]":
|
||||
return "array";
|
||||
case "[object Date]":
|
||||
return "date";
|
||||
case "[object Boolean]":
|
||||
return "boolean";
|
||||
case "[object Number]":
|
||||
return "number";
|
||||
case "[object Function]":
|
||||
return "function";
|
||||
case "[object RegExp]":
|
||||
return "regexp";
|
||||
case "[object Object]":
|
||||
if (void 0 !== value.nodeType) {
|
||||
if (value.nodeType === 3)
|
||||
return /\S/.test(value.nodeValue) ? "textnode" : "whitespace";
|
||||
else
|
||||
return "element";
|
||||
} else {
|
||||
return "object";
|
||||
}
|
||||
default:
|
||||
return "unknow";
|
||||
}
|
||||
}
|
||||
function getPropByPath(obj, keyPath) {
|
||||
try {
|
||||
return keyPath.split(".").reduce((prev, curr) => prev[curr], obj);
|
||||
} catch (error) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
function cacheStringFunction(fn) {
|
||||
const cache = /* @__PURE__ */ Object.create(null);
|
||||
return (str) => {
|
||||
const hit = cache[str];
|
||||
return hit || (cache[str] = fn(str));
|
||||
};
|
||||
}
|
||||
const hyphenateRE = /\B([A-Z])/g;
|
||||
const hyphenate = cacheStringFunction(
|
||||
(str) => str.replace(hyphenateRE, "-$1").toLowerCase()
|
||||
);
|
||||
const { hasOwnProperty } = Object.prototype;
|
||||
function assignKey(to, from, key) {
|
||||
const val = from[key];
|
||||
if (!uni_modules_nutuiUni_components__utils_is.isDef(val))
|
||||
return;
|
||||
if (!hasOwnProperty.call(to, key) || !uni_modules_nutuiUni_components__utils_is.isObject(val))
|
||||
to[key] = val;
|
||||
else
|
||||
to[key] = deepAssign(Object(to[key]), val);
|
||||
}
|
||||
function deepAssign(to, from) {
|
||||
Object.keys(from).forEach((key) => {
|
||||
assignKey(to, from, key);
|
||||
});
|
||||
return to;
|
||||
}
|
||||
function getRandomId() {
|
||||
return Math.random().toString(36).slice(-8);
|
||||
}
|
||||
function isLooseEqual(a, b) {
|
||||
if (a === b)
|
||||
return true;
|
||||
const isObjectA = uni_modules_nutuiUni_components__utils_is.isObject(a);
|
||||
const isObjectB = uni_modules_nutuiUni_components__utils_is.isObject(b);
|
||||
if (isObjectA && isObjectB)
|
||||
return JSON.stringify(a) === JSON.stringify(b);
|
||||
else if (!isObjectA && !isObjectB)
|
||||
return String(a) === String(b);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
function isEqualArray(a, b) {
|
||||
if (a === b)
|
||||
return true;
|
||||
if (!uni_modules_nutuiUni_components__utils_is.isArray(a) || !uni_modules_nutuiUni_components__utils_is.isArray(b))
|
||||
return false;
|
||||
if (a.length !== b.length)
|
||||
return false;
|
||||
for (let i = 0; i < a.length; i++) {
|
||||
if (!isLooseEqual(a[i], b[i]))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function isEqualValue(a, b) {
|
||||
if (a === b)
|
||||
return true;
|
||||
if (uni_modules_nutuiUni_components__utils_is.isArray(a) && uni_modules_nutuiUni_components__utils_is.isArray(b))
|
||||
return isEqualArray(a, b);
|
||||
return isLooseEqual(a, b);
|
||||
}
|
||||
function cloneDeep(obj, cache = /* @__PURE__ */ new WeakMap()) {
|
||||
if (obj === null || typeof obj !== "object")
|
||||
return obj;
|
||||
if (cache.has(obj))
|
||||
return cache.get(obj);
|
||||
let clone;
|
||||
if (obj instanceof Date) {
|
||||
clone = new Date(obj.getTime());
|
||||
} else if (obj instanceof RegExp) {
|
||||
clone = new RegExp(obj);
|
||||
} else if (obj instanceof Map) {
|
||||
clone = new Map(Array.from(obj, ([key, value]) => [key, cloneDeep(value, cache)]));
|
||||
} else if (obj instanceof Set) {
|
||||
clone = new Set(Array.from(obj, (value) => cloneDeep(value, cache)));
|
||||
} else if (Array.isArray(obj)) {
|
||||
clone = obj.map((value) => cloneDeep(value, cache));
|
||||
} else if (Object.prototype.toString.call(obj) === "[object Object]") {
|
||||
clone = Object.create(Object.getPrototypeOf(obj));
|
||||
cache.set(obj, clone);
|
||||
for (const [key, value] of Object.entries(obj))
|
||||
clone[key] = cloneDeep(value, cache);
|
||||
} else {
|
||||
clone = Object.assign({}, obj);
|
||||
}
|
||||
cache.set(obj, clone);
|
||||
return clone;
|
||||
}
|
||||
exports.TypeOfFun = TypeOfFun;
|
||||
exports.cloneDeep = cloneDeep;
|
||||
exports.deepAssign = deepAssign;
|
||||
exports.getPropByPath = getPropByPath;
|
||||
exports.getRandomId = getRandomId;
|
||||
exports.hyphenate = hyphenate;
|
||||
exports.isEqualValue = isEqualValue;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_utils/common.js.map
|
||||
2
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_utils/date.js
vendored
Normal file
2
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_utils/date.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_utils/date.js.map
|
||||
13
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_utils/env.js
vendored
Normal file
13
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_utils/env.js
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
function ifDefPlatform() {
|
||||
let platform2;
|
||||
platform2 = "MP-WEIXIN";
|
||||
platform2 = "MP";
|
||||
return platform2;
|
||||
}
|
||||
const platform = ifDefPlatform();
|
||||
const isH5 = platform === "H5";
|
||||
const isMpAlipay = platform === "MP-ALIPAY";
|
||||
exports.isH5 = isH5;
|
||||
exports.isMpAlipay = isMpAlipay;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_utils/env.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_utils/index.js
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_utils/index.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
require("../../../../common/vendor.js");
|
||||
require("./env.js");
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_utils/index.js.map
|
||||
28
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_utils/interceptor.js
vendored
Normal file
28
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_utils/interceptor.js
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
const uni_modules_nutuiUni_components__utils_is = require("./is.js");
|
||||
function funInterceptor(interceptor, {
|
||||
args = [],
|
||||
done,
|
||||
canceled
|
||||
}) {
|
||||
if (interceptor) {
|
||||
const returnVal = interceptor(null, ...args);
|
||||
if (uni_modules_nutuiUni_components__utils_is.isPromise(returnVal)) {
|
||||
returnVal.then((value) => {
|
||||
if (value)
|
||||
done(value);
|
||||
else if (canceled)
|
||||
canceled();
|
||||
}).catch(() => {
|
||||
});
|
||||
} else if (returnVal) {
|
||||
done();
|
||||
} else if (canceled) {
|
||||
canceled();
|
||||
}
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
exports.funInterceptor = funInterceptor;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_utils/interceptor.js.map
|
||||
48
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_utils/is.js
vendored
Normal file
48
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_utils/is.js
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
const toString = Object.prototype.toString;
|
||||
function is(val, type) {
|
||||
return toString.call(val) === `[object ${type}]`;
|
||||
}
|
||||
function isDef(val) {
|
||||
return typeof val !== "undefined";
|
||||
}
|
||||
function isObject(val) {
|
||||
return val !== null && is(val, "Object");
|
||||
}
|
||||
function isEmpty(val) {
|
||||
if (isArray(val) || isString(val))
|
||||
return val.length === 0;
|
||||
if (val instanceof Map || val instanceof Set)
|
||||
return val.size === 0;
|
||||
if (isObject(val))
|
||||
return Object.keys(val).length === 0;
|
||||
return false;
|
||||
}
|
||||
function isNumber(val) {
|
||||
return is(val, "Number");
|
||||
}
|
||||
function isPromise(val) {
|
||||
return is(val, "Promise") || (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
|
||||
}
|
||||
function isString(val) {
|
||||
return is(val, "String");
|
||||
}
|
||||
function isFunction(val) {
|
||||
return typeof val === "function";
|
||||
}
|
||||
function isBoolean(val) {
|
||||
return is(val, "Boolean");
|
||||
}
|
||||
function isArray(val) {
|
||||
return val && Array.isArray(val);
|
||||
}
|
||||
exports.isArray = isArray;
|
||||
exports.isBoolean = isBoolean;
|
||||
exports.isDef = isDef;
|
||||
exports.isEmpty = isEmpty;
|
||||
exports.isFunction = isFunction;
|
||||
exports.isNumber = isNumber;
|
||||
exports.isObject = isObject;
|
||||
exports.isPromise = isPromise;
|
||||
exports.isString = isString;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_utils/is.js.map
|
||||
73
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_utils/props.js
vendored
Normal file
73
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_utils/props.js
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
"use strict";
|
||||
const numericProp = [Number, String];
|
||||
const truthProp = {
|
||||
type: Boolean,
|
||||
default: true
|
||||
};
|
||||
const nullableBooleanProp = {
|
||||
type: Boolean,
|
||||
default: void 0
|
||||
};
|
||||
function makeRequiredProp(type) {
|
||||
return {
|
||||
type,
|
||||
required: true
|
||||
};
|
||||
}
|
||||
function makeArrayProp(defaultVal = []) {
|
||||
return {
|
||||
type: Array,
|
||||
default: () => defaultVal
|
||||
};
|
||||
}
|
||||
function makeObjectProp(defaultVal) {
|
||||
return {
|
||||
type: Object,
|
||||
default: () => defaultVal
|
||||
};
|
||||
}
|
||||
function makeNumberProp(defaultVal) {
|
||||
return {
|
||||
type: Number,
|
||||
default: defaultVal
|
||||
};
|
||||
}
|
||||
function makeNumericProp(defaultVal) {
|
||||
return {
|
||||
type: numericProp,
|
||||
default: defaultVal
|
||||
};
|
||||
}
|
||||
function makeStringProp(defaultVal) {
|
||||
return {
|
||||
type: String,
|
||||
default: defaultVal
|
||||
};
|
||||
}
|
||||
const commonProps = {
|
||||
/**
|
||||
* @description 自定义类名
|
||||
*/
|
||||
customClass: {
|
||||
type: [String, Object, Array],
|
||||
default: ""
|
||||
},
|
||||
/**
|
||||
* @description 自定义样式
|
||||
*/
|
||||
customStyle: {
|
||||
type: [String, Object, Array],
|
||||
default: ""
|
||||
}
|
||||
};
|
||||
exports.commonProps = commonProps;
|
||||
exports.makeArrayProp = makeArrayProp;
|
||||
exports.makeNumberProp = makeNumberProp;
|
||||
exports.makeNumericProp = makeNumericProp;
|
||||
exports.makeObjectProp = makeObjectProp;
|
||||
exports.makeRequiredProp = makeRequiredProp;
|
||||
exports.makeStringProp = makeStringProp;
|
||||
exports.nullableBooleanProp = nullableBooleanProp;
|
||||
exports.numericProp = numericProp;
|
||||
exports.truthProp = truthProp;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_utils/props.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_utils/pxCheck.js
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_utils/pxCheck.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
function pxCheck(value) {
|
||||
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
||||
}
|
||||
exports.pxCheck = pxCheck;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_utils/pxCheck.js.map
|
||||
16
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_utils/raf.js
vendored
Normal file
16
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_utils/raf.js
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
const _window = window;
|
||||
function requestAniFrame() {
|
||||
if (typeof _window !== "undefined") {
|
||||
return _window.requestAnimationFrame || _window.webkitRequestAnimationFrame || function(callback) {
|
||||
_window.setTimeout(callback, 1e3 / 60);
|
||||
};
|
||||
} else {
|
||||
return function(callback) {
|
||||
setTimeout(callback, 1e3 / 60);
|
||||
};
|
||||
}
|
||||
}
|
||||
const requestAniFrame$1 = requestAniFrame();
|
||||
exports.requestAniFrame = requestAniFrame$1;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_utils/raf.js.map
|
||||
82
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_utils/style.js
vendored
Normal file
82
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/_utils/style.js
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
"use strict";
|
||||
const uni_modules_nutuiUni_components__utils_common = require("./common.js");
|
||||
const uni_modules_nutuiUni_components__utils_is = require("./is.js");
|
||||
const listDelimiterRE = /;(?![^(]*\))/g;
|
||||
const propertyDelimiterRE = /:([\s\S]+)/;
|
||||
const styleCommentRE = /\/\*.*?\*\//g;
|
||||
function parseStringStyle(cssText) {
|
||||
const ret = {};
|
||||
cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
|
||||
if (item) {
|
||||
const tmp = item.split(propertyDelimiterRE);
|
||||
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
|
||||
}
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
function stringifyStyle(styles) {
|
||||
let ret = "";
|
||||
if (!styles || uni_modules_nutuiUni_components__utils_is.isString(styles))
|
||||
return ret;
|
||||
for (const key in styles) {
|
||||
const value = styles[key];
|
||||
const normalizedKey = key.startsWith("--") ? key : uni_modules_nutuiUni_components__utils_common.hyphenate(key);
|
||||
if (uni_modules_nutuiUni_components__utils_is.isString(value) || typeof value === "number") {
|
||||
ret += `${normalizedKey}:${value};`;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
function getPx(value, unit = false) {
|
||||
if (uni_modules_nutuiUni_components__utils_is.isNumber(value))
|
||||
return unit ? `${value}px` : Number(value);
|
||||
return unit ? `${Number.parseInt(value)}px` : Number.parseInt(value);
|
||||
}
|
||||
function normalizeStyle(value) {
|
||||
if (uni_modules_nutuiUni_components__utils_is.isArray(value)) {
|
||||
const res = {};
|
||||
for (let i = 0; i < value.length; i++) {
|
||||
const item = value[i];
|
||||
const normalized = uni_modules_nutuiUni_components__utils_is.isString(item) ? parseStringStyle(item) : normalizeStyle(item);
|
||||
if (normalized) {
|
||||
for (const key in normalized) {
|
||||
if (!uni_modules_nutuiUni_components__utils_is.isEmpty(normalized[key]))
|
||||
res[key] = normalized[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
if (uni_modules_nutuiUni_components__utils_is.isString(value))
|
||||
return value;
|
||||
if (uni_modules_nutuiUni_components__utils_is.isObject(value))
|
||||
return value;
|
||||
}
|
||||
function normalizeClass(value) {
|
||||
let res = "";
|
||||
if (uni_modules_nutuiUni_components__utils_is.isString(value)) {
|
||||
res = value;
|
||||
} else if (uni_modules_nutuiUni_components__utils_is.isArray(value)) {
|
||||
for (let i = 0; i < value.length; i++) {
|
||||
const normalized = normalizeClass(value[i]);
|
||||
if (normalized)
|
||||
res += `${normalized} `;
|
||||
}
|
||||
} else if (uni_modules_nutuiUni_components__utils_is.isObject(value)) {
|
||||
for (const name in value) {
|
||||
if (value[name])
|
||||
res += `${name} `;
|
||||
}
|
||||
}
|
||||
return res.trim();
|
||||
}
|
||||
function getMainClass(props, componentName, cls) {
|
||||
return normalizeClass([props.customClass, { [componentName]: true }, cls]);
|
||||
}
|
||||
function getMainStyle(props, style) {
|
||||
return stringifyStyle(normalizeStyle([props.customStyle, style]));
|
||||
}
|
||||
exports.getMainClass = getMainClass;
|
||||
exports.getMainStyle = getMainStyle;
|
||||
exports.getPx = getPx;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_utils/style.js.map
|
||||
103
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/animate/animate.js
vendored
Normal file
103
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/animate/animate.js
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_nutuiUni_components__constants_event = require("../_constants/event.js");
|
||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_raf = require("../_utils/raf.js");
|
||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const animateProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 控制动画,当值从 false 变为 true 时会触发一次动画
|
||||
*/
|
||||
show: Boolean,
|
||||
/**
|
||||
* @description 动画类型
|
||||
* @values 'fade', 'slide', 'zoom', ...
|
||||
*/
|
||||
type: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
||||
/**
|
||||
* @description 是否循环执行。`true`-循环执行; `false`-执行一次
|
||||
*/
|
||||
loop: Boolean,
|
||||
/**
|
||||
* @description 动画时长,单位 ms
|
||||
*/
|
||||
duration: uni_modules_nutuiUni_components__utils_props.makeNumericProp(500),
|
||||
/**
|
||||
* @description (不能与 show 同时使用)触发方式,`initial`-初始化执行; `click`-点击执行
|
||||
* @values 'initial', 'click'
|
||||
* @default initial
|
||||
*/
|
||||
action: uni_modules_nutuiUni_components__utils_props.makeStringProp("initial")
|
||||
};
|
||||
const animateEmits = {
|
||||
[uni_modules_nutuiUni_components__constants_event.CLICK_EVENT]: (evt) => evt instanceof Object,
|
||||
animate: () => true
|
||||
};
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-animate`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: animateProps,
|
||||
emits: animateEmits,
|
||||
setup(__props, { emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const animated = common_vendor.ref(props.action === "initial" || props.show === true || props.loop);
|
||||
const classes = common_vendor.computed(() => {
|
||||
const obj = {
|
||||
[`${componentName}__container`]: true,
|
||||
[`${componentName}-${props.type}`]: animated.value,
|
||||
loop: props.loop
|
||||
};
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, obj);
|
||||
});
|
||||
const getStyle = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainStyle(props, {
|
||||
animationDuration: props.duration ? `${props.duration}ms` : void 0
|
||||
});
|
||||
});
|
||||
function animate() {
|
||||
animated.value = false;
|
||||
uni_modules_nutuiUni_components__utils_raf.requestAniFrame(() => {
|
||||
uni_modules_nutuiUni_components__utils_raf.requestAniFrame(() => {
|
||||
animated.value = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
function handleClick(event) {
|
||||
if (props.action === "click") {
|
||||
animate();
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CLICK_EVENT, event);
|
||||
emit("animate");
|
||||
}
|
||||
}
|
||||
common_vendor.watch(
|
||||
() => props.show,
|
||||
(val) => {
|
||||
if (val) {
|
||||
animate();
|
||||
emit("animate");
|
||||
}
|
||||
}
|
||||
);
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.n(classes.value),
|
||||
b: common_vendor.s(getStyle.value),
|
||||
c: common_vendor.o(handleClick)
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/animate/animate.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/animate/animate.json
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/animate/animate.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/animate/animate.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/animate/animate.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="nut-animate"><view class="{{a}}" style="{{b}}" bindtap="{{c}}"><slot/></view></view>
|
||||
284
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/animate/animate.wxss
vendored
Normal file
284
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/animate/animate.wxss
vendored
Normal file
@@ -0,0 +1,284 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.nut-animate {
|
||||
/* Animation css */
|
||||
}
|
||||
.nut-animate .nut-animate__container {
|
||||
display: inline-block;
|
||||
}
|
||||
.nut-animate [class*=nut-animate-] {
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: ease-out;
|
||||
animation-fill-mode: both;
|
||||
}
|
||||
.nut-animate .nut-animate-shake {
|
||||
animation-name: shake;
|
||||
}
|
||||
.nut-animate .nut-animate-ripple {
|
||||
animation-name: ripple;
|
||||
}
|
||||
.nut-animate .nut-animate-float {
|
||||
position: relative;
|
||||
animation-name: float-pop;
|
||||
}
|
||||
.nut-animate .nut-animate-breath {
|
||||
animation-name: breath;
|
||||
animation-duration: 2700ms;
|
||||
animation-timing-function: ease-in-out;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
.nut-animate .nut-animate-slide-right {
|
||||
animation-name: slide-right;
|
||||
}
|
||||
.nut-animate .nut-animate-slide-left {
|
||||
animation-name: slide-left;
|
||||
}
|
||||
.nut-animate .nut-animate-slide-top {
|
||||
animation-name: slide-top;
|
||||
}
|
||||
.nut-animate .nut-animate-slide-bottom {
|
||||
animation-name: slide-bottom;
|
||||
}
|
||||
.nut-animate .nut-animate-jump {
|
||||
transform-origin: center center;
|
||||
animation: jump 0.7s linear;
|
||||
}
|
||||
.nut-animate .loop {
|
||||
animation-iteration-count: infinite;
|
||||
}
|
||||
@keyframes shake {
|
||||
0%, 100% {
|
||||
transform: translateX(0);
|
||||
}
|
||||
10% {
|
||||
transform: translateX(-9px);
|
||||
}
|
||||
20% {
|
||||
transform: translateX(8px);
|
||||
}
|
||||
30% {
|
||||
transform: translateX(-7px);
|
||||
}
|
||||
40% {
|
||||
transform: translateX(6px);
|
||||
}
|
||||
50% {
|
||||
transform: translateX(-5px);
|
||||
}
|
||||
60% {
|
||||
transform: translateX(4px);
|
||||
}
|
||||
70% {
|
||||
transform: translateX(-3px);
|
||||
}
|
||||
80% {
|
||||
transform: translateX(2px);
|
||||
}
|
||||
90% {
|
||||
transform: translateX(-1px);
|
||||
}
|
||||
}
|
||||
@keyframes ripple {
|
||||
0% {
|
||||
transform: scale(1);
|
||||
}
|
||||
50% {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
}
|
||||
@keyframes breath {
|
||||
0% {
|
||||
transform: scale(1);
|
||||
}
|
||||
50% {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
100% {
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
@keyframes slide-right {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateX(100%);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
@keyframes slide-left {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
@keyframes slide-top {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(-100%);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
@keyframes slide-bottom {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(100%);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
@keyframes float-pop {
|
||||
0% {
|
||||
top: 0;
|
||||
}
|
||||
25% {
|
||||
top: 1px;
|
||||
}
|
||||
50% {
|
||||
top: 4px;
|
||||
}
|
||||
75% {
|
||||
top: 1px;
|
||||
}
|
||||
100% {
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
@keyframes jump {
|
||||
0% {
|
||||
transform: rotate(0deg) translateY(0);
|
||||
animation-timing-function: ease-in;
|
||||
}
|
||||
25% {
|
||||
transform: rotate(10deg) translateY(20px);
|
||||
animation-timing-function: ease-out;
|
||||
}
|
||||
50% {
|
||||
transform: rotate(0deg) translateY(-10px);
|
||||
animation-timing-function: ease-in;
|
||||
}
|
||||
75% {
|
||||
transform: rotate(-10deg) translateY(20px);
|
||||
animation-timing-function: ease-out;
|
||||
}
|
||||
100% {
|
||||
transform: rotate(0deg) translateY(0);
|
||||
animation-timing-function: ease-in;
|
||||
}
|
||||
}
|
||||
.nut-animate .nut-animate-twinkle {
|
||||
position: relative;
|
||||
}
|
||||
.nut-animate .nut-animate-twinkle::after, .nut-animate .nut-animate-twinkle::before {
|
||||
position: absolute;
|
||||
right: 50%;
|
||||
z-index: 1;
|
||||
box-sizing: border-box;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
margin-top: -15px;
|
||||
margin-right: -30px;
|
||||
content: "";
|
||||
border: 4px solid rgba(255, 255, 255, 0.6);
|
||||
border-radius: 30px;
|
||||
transform: scale(0);
|
||||
animation: twinkle 2s ease-out infinite;
|
||||
}
|
||||
.nut-animate .nut-animate-twinkle::after {
|
||||
animation-delay: 0.4s;
|
||||
}
|
||||
@keyframes twinkle {
|
||||
0% {
|
||||
transform: scale(0);
|
||||
}
|
||||
20% {
|
||||
opacity: 1;
|
||||
}
|
||||
50%, 100% {
|
||||
opacity: 0;
|
||||
transform: scale(1.4);
|
||||
}
|
||||
}
|
||||
.nut-animate .nut-animate-flicker {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.nut-animate .nut-animate-flicker::after {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100px;
|
||||
height: 60px;
|
||||
content: "";
|
||||
background-image: linear-gradient(106deg, rgba(232, 224, 255, 0) 24%, #e8e0ff 91%);
|
||||
filter: blur(3px);
|
||||
opacity: 0.73;
|
||||
transform: skewX(-20deg);
|
||||
animation: flicker 1.5s linear infinite;
|
||||
}
|
||||
@keyframes flicker {
|
||||
0% {
|
||||
transform: translateX(-100px) skewX(-20deg);
|
||||
}
|
||||
40%, 100% {
|
||||
transform: translateX(150px) skewX(-20deg);
|
||||
}
|
||||
}
|
||||
130
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/avatar/avatar.js
vendored
Normal file
130
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/avatar/avatar.js
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
||||
const uni_modules_nutuiUni_components__hooks_useInject = require("../_hooks/useInject.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_pxCheck = require("../_utils/pxCheck.js");
|
||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
||||
const uni_modules_nutuiUni_components_avatargroup_avatargroup = require("../avatargroup/avatargroup.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const uni_modules_nutuiUni_components_avatar_type = require("./type.js");
|
||||
const avatarProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 头像的大小,可选值为:`large`、`normal`、`small`,支持直接输入数字
|
||||
*/
|
||||
size: uni_modules_nutuiUni_components__utils_props.makeNumericProp(void 0),
|
||||
/**
|
||||
* @description 头像的形状,可选值为:`square`、`round`
|
||||
*/
|
||||
shape: uni_modules_nutuiUni_components__utils_props.makeStringProp(void 0),
|
||||
/**
|
||||
* @description 背景色
|
||||
*/
|
||||
bgColor: uni_modules_nutuiUni_components__utils_props.makeStringProp("#eee"),
|
||||
/**
|
||||
* @description 字体颜色
|
||||
*/
|
||||
customColor: uni_modules_nutuiUni_components__utils_props.makeStringProp("#666")
|
||||
};
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-avatar`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: avatarProps,
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
const instance = common_vendor.getCurrentInstance();
|
||||
const { parent } = uni_modules_nutuiUni_components__hooks_useInject.useInject(uni_modules_nutuiUni_components_avatargroup_avatargroup.AVATAR_GROUP_KEY);
|
||||
const show = common_vendor.ref(true);
|
||||
const innerZIndex = common_vendor.ref(void 0);
|
||||
common_vendor.watch(() => ({
|
||||
maxCount: parent == null ? void 0 : parent.props.maxCount,
|
||||
children: parent == null ? void 0 : parent.internalChildren
|
||||
}), ({ maxCount, children }) => {
|
||||
if (maxCount == null || Number(maxCount) <= 0 || children == null || instance == null) {
|
||||
show.value = true;
|
||||
innerZIndex.value = void 0;
|
||||
return;
|
||||
}
|
||||
const index = children.findIndex((item) => {
|
||||
var _a;
|
||||
return item.uid === instance.uid && !((_a = item.props.customClass) == null ? void 0 : _a.includes("avatar-fold"));
|
||||
});
|
||||
if (index < 0) {
|
||||
show.value = true;
|
||||
innerZIndex.value = void 0;
|
||||
return;
|
||||
}
|
||||
show.value = index < Number(maxCount);
|
||||
if ((parent == null ? void 0 : parent.props.zIndex) === "right")
|
||||
innerZIndex.value = children.length - index;
|
||||
else
|
||||
innerZIndex.value = void 0;
|
||||
}, {
|
||||
immediate: true,
|
||||
deep: true
|
||||
});
|
||||
function getTrulySize() {
|
||||
if (props.size != null)
|
||||
return props.size;
|
||||
if (parent != null && parent.props.size != null)
|
||||
return parent.props.size;
|
||||
return "normal";
|
||||
}
|
||||
const finalSize = common_vendor.computed(() => {
|
||||
const size = getTrulySize();
|
||||
const preset = uni_modules_nutuiUni_components_avatar_type.avatarSize.includes(size);
|
||||
return {
|
||||
preset,
|
||||
value: preset ? size : uni_modules_nutuiUni_components__utils_pxCheck.pxCheck(size)
|
||||
};
|
||||
});
|
||||
const finalShape = common_vendor.computed(() => {
|
||||
if (props.shape != null)
|
||||
return props.shape;
|
||||
if (parent != null && parent.props.shape != null)
|
||||
return parent.props.shape;
|
||||
return "round";
|
||||
});
|
||||
const classes = common_vendor.computed(() => {
|
||||
const value = {
|
||||
[`nut-avatar-${finalShape.value}`]: true,
|
||||
"nut-hidden": !show.value
|
||||
};
|
||||
if (finalSize.value.preset)
|
||||
value[`nut-avatar-${finalSize.value.value}`] = true;
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, value);
|
||||
});
|
||||
const styles = common_vendor.computed(() => {
|
||||
const value = {
|
||||
backgroundColor: props.bgColor,
|
||||
color: props.customColor
|
||||
};
|
||||
if (!finalSize.value.preset) {
|
||||
value.width = finalSize.value.value;
|
||||
value.height = finalSize.value.value;
|
||||
}
|
||||
if (parent == null ? void 0 : parent.props.span)
|
||||
value.marginLeft = uni_modules_nutuiUni_components__utils_pxCheck.pxCheck(parent == null ? void 0 : parent.props.span);
|
||||
if (innerZIndex.value !== void 0)
|
||||
value.zIndex = innerZIndex.value;
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainStyle(props, value);
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.s(styles.value),
|
||||
b: common_vendor.n(classes.value)
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/avatar/avatar.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/avatar/avatar.json
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/avatar/avatar.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/avatar/avatar.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/avatar/avatar.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view style="{{a}}" class="{{b}}"><slot/></view>
|
||||
97
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/avatar/avatar.wxss
vendored
Normal file
97
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/avatar/avatar.wxss
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.nut-avatar {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
flex: 0 0 auto;
|
||||
text-align: center;
|
||||
vertical-align: top;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.nut-avatar image {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.nut-avatar .nut-icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
background-size: 100% 100%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
.nut-avatar-large {
|
||||
width: var(--nut-avatar-large-width, 60px);
|
||||
height: var(--nut-avatar-large-height, 60px);
|
||||
line-height: var(--nut-avatar-large-height, 60px);
|
||||
}
|
||||
.nut-avatar-normal {
|
||||
width: var(--nut-avatar-normal-width, 40px);
|
||||
height: var(--nut-avatar-normal-height, 40px);
|
||||
line-height: var(--nut-avatar-normal-height, 40px);
|
||||
}
|
||||
.nut-avatar-small {
|
||||
width: var(--nut-avatar-small-width, 32px);
|
||||
height: var(--nut-avatar-small-height, 32px);
|
||||
line-height: var(--nut-avatar-small-height, 32px);
|
||||
}
|
||||
.nut-avatar-square {
|
||||
border-radius: var(--nut-avatar-square, 5px);
|
||||
}
|
||||
.nut-avatar-round {
|
||||
border-radius: 50%;
|
||||
}
|
||||
.nut-avatar-square,
|
||||
.nut-avatar-round {
|
||||
overflow: hidden;
|
||||
}
|
||||
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/avatar/type.js
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/avatar/type.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
const avatarSize = ["large", "normal", "small"];
|
||||
exports.avatarSize = avatarSize;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/avatar/type.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/avatargroup/avatargroup.js
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/avatargroup/avatargroup.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
require("../../../../common/vendor.js");
|
||||
require("../_utils/env.js");
|
||||
const AVATAR_GROUP_KEY = Symbol("avatarGroup");
|
||||
exports.AVATAR_GROUP_KEY = AVATAR_GROUP_KEY;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/avatargroup/avatargroup.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/avatargroup/index.js
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/avatargroup/index.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
require("../../../../common/vendor.js");
|
||||
require("../_utils/env.js");
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/avatargroup/index.js.map
|
||||
243
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/button/button.js
vendored
Normal file
243
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/button/button.js
vendored
Normal file
@@ -0,0 +1,243 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_nutuiUni_components__constants_event = require("../_constants/event.js");
|
||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const buttonProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 指定按钮按下去的样式类
|
||||
*/
|
||||
hoverClass: uni_modules_nutuiUni_components__utils_props.makeStringProp("button-hover"),
|
||||
/**
|
||||
* @description 按住后多久出现点击态,单位毫秒
|
||||
*/
|
||||
hoverStartTime: uni_modules_nutuiUni_components__utils_props.makeNumberProp(20),
|
||||
/**
|
||||
* @description 手指松开后点击态保留时间,单位毫秒
|
||||
*/
|
||||
hoverStayTime: uni_modules_nutuiUni_components__utils_props.makeNumberProp(70),
|
||||
/**
|
||||
* @description 按钮颜色,支持传入 `linear-gradient` 渐变色
|
||||
*/
|
||||
customColor: String,
|
||||
/**
|
||||
* @description 形状,可选值为 `square` `round`
|
||||
*/
|
||||
shape: uni_modules_nutuiUni_components__utils_props.makeStringProp("round"),
|
||||
/**
|
||||
* @description 是否为朴素按钮
|
||||
*/
|
||||
plain: Boolean,
|
||||
/**
|
||||
* @description 按钮 `loading` 状态
|
||||
*/
|
||||
loading: Boolean,
|
||||
/**
|
||||
* @description 是否禁用按钮
|
||||
*/
|
||||
disabled: Boolean,
|
||||
/**
|
||||
* @description 按钮类型,可选值为 `primary` `info` `warning` `danger` `success` `default`
|
||||
*/
|
||||
type: uni_modules_nutuiUni_components__utils_props.makeStringProp("default"),
|
||||
/**
|
||||
* @description 表单类型,可选值 `button` `submit` `reset`
|
||||
*/
|
||||
formType: uni_modules_nutuiUni_components__utils_props.makeStringProp("button"),
|
||||
/**
|
||||
* @description 尺寸,可选值为 `large` `small` `mini` `normal`
|
||||
*/
|
||||
size: uni_modules_nutuiUni_components__utils_props.makeStringProp("normal"),
|
||||
/**
|
||||
* @description 是否为块级元素
|
||||
*/
|
||||
block: Boolean,
|
||||
/**
|
||||
* @description 小程序开放能力
|
||||
*/
|
||||
openType: String,
|
||||
/**
|
||||
* @description 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文
|
||||
*/
|
||||
lang: uni_modules_nutuiUni_components__utils_props.makeStringProp("en"),
|
||||
/**
|
||||
* @description 会话来源,openType="contact"时有效
|
||||
*/
|
||||
sessionFrom: String,
|
||||
/**
|
||||
* @description 会话内消息卡片标题,openType="contact"时有效
|
||||
*/
|
||||
sendMessageTitle: String,
|
||||
/**
|
||||
* @description 会话内消息卡片点击跳转小程序路径,openType="contact"时有效
|
||||
*/
|
||||
sendMessagePath: String,
|
||||
/**
|
||||
* @description 会话内消息卡片图片,openType="contact"时有效
|
||||
*/
|
||||
sendMessageImg: String,
|
||||
/**
|
||||
* @description 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息,openType="contact"时有效
|
||||
*/
|
||||
showMessageCard: Boolean,
|
||||
/**
|
||||
* @description 打开群资料卡时,传递的群号,openType="openGroupProfile"时有效
|
||||
*/
|
||||
groupId: String,
|
||||
/**
|
||||
* @description 打开频道页面时,传递的频道号 openType="openGuildProfile"时有效
|
||||
*/
|
||||
guildId: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
||||
/**
|
||||
* @description 打开公众号资料卡时,传递的号码 openType="openPublicProfile"时有效
|
||||
*/
|
||||
publicId: String,
|
||||
/**
|
||||
* @description 客服的抖音号,openType="im"时有效
|
||||
*/
|
||||
dataImId: String,
|
||||
/**
|
||||
* @description IM卡片类型,openType="im"时有效
|
||||
*/
|
||||
dataImType: String,
|
||||
/**
|
||||
* @description 商品的id,仅支持泛知识课程库和生活服务商品库中的商品,openType="im"时有效
|
||||
*/
|
||||
dataGoodsId: String,
|
||||
/**
|
||||
* @description 订单的id,仅支持交易2.0订单, openType="im"时有效
|
||||
*/
|
||||
dataOrderId: String,
|
||||
/**
|
||||
* @description 商品类型,“1”代表生活服务,“2”代表泛知识。openType="im"时有效
|
||||
*/
|
||||
dataBizLine: String
|
||||
};
|
||||
const buttonEmits = {
|
||||
[uni_modules_nutuiUni_components__constants_event.CLICK_EVENT]: (evt) => evt instanceof Object,
|
||||
getphonenumber: (evt) => evt instanceof Object,
|
||||
getuserinfo: (evt) => evt instanceof Object,
|
||||
error: (evt) => evt instanceof Object,
|
||||
opensetting: (evt) => evt instanceof Object,
|
||||
launchapp: (evt) => evt instanceof Object,
|
||||
contact: (evt) => evt instanceof Object,
|
||||
chooseavatar: (evt) => evt instanceof Object,
|
||||
agreeprivacyauthorization: (evt) => evt instanceof Object,
|
||||
addgroupapp: (evt) => evt instanceof Object,
|
||||
chooseaddress: (evt) => evt instanceof Object,
|
||||
chooseinvoicetitle: (evt) => evt instanceof Object,
|
||||
subscribe: (evt) => evt instanceof Object,
|
||||
login: (evt) => evt instanceof Object,
|
||||
im: (evt) => evt instanceof Object
|
||||
};
|
||||
if (!Math) {
|
||||
Icon();
|
||||
}
|
||||
const Icon = () => "../icon/icon.js";
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-button`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: buttonProps,
|
||||
emits: buttonEmits,
|
||||
setup(__props, { emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, {
|
||||
[`${componentName}--${props.type}`]: !!props.type,
|
||||
[`${componentName}--${props.size}`]: !!props.size,
|
||||
[`${componentName}--${props.shape}`]: !!props.shape,
|
||||
[`${componentName}--plain`]: props.plain,
|
||||
[`${componentName}--block`]: props.block,
|
||||
[`${componentName}--disabled`]: props.disabled,
|
||||
[`${componentName}--loading`]: props.loading,
|
||||
[`${componentName}--hovercls`]: props.hoverClass !== "button-hover"
|
||||
});
|
||||
});
|
||||
const styles = common_vendor.computed(() => {
|
||||
const value = {};
|
||||
if (props.customColor) {
|
||||
if (props.plain) {
|
||||
value.color = props.customColor;
|
||||
value.background = "#fff";
|
||||
if (!props.customColor.includes("gradient"))
|
||||
value.borderColor = props.customColor;
|
||||
} else {
|
||||
value.color = "#fff";
|
||||
value.background = props.customColor;
|
||||
}
|
||||
}
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainStyle(props, value);
|
||||
});
|
||||
function handleClick(event) {
|
||||
if (props.disabled || props.loading)
|
||||
return;
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CLICK_EVENT, event);
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: _ctx.loading
|
||||
}, _ctx.loading ? {
|
||||
b: common_vendor.p({
|
||||
name: "loading"
|
||||
})
|
||||
} : {}, {
|
||||
c: _ctx.$slots.icon && !_ctx.loading
|
||||
}, _ctx.$slots.icon && !_ctx.loading ? {} : {}, {
|
||||
d: _ctx.$slots.default
|
||||
}, _ctx.$slots.default ? {
|
||||
e: _ctx.$slots.icon || _ctx.loading ? 1 : ""
|
||||
} : {}, {
|
||||
f: common_vendor.n(classes.value),
|
||||
g: common_vendor.s(styles.value),
|
||||
h: props.formType === "button" ? void 0 : props.formType,
|
||||
i: props.disabled || props.loading ? void 0 : props.openType,
|
||||
j: props.hoverClass,
|
||||
k: props.hoverStartTime,
|
||||
l: props.hoverStayTime,
|
||||
m: props.lang,
|
||||
n: props.sessionFrom,
|
||||
o: props.sendMessageTitle,
|
||||
p: props.sendMessagePath,
|
||||
q: props.sendMessageImg,
|
||||
r: props.showMessageCard,
|
||||
s: props.groupId,
|
||||
t: props.guildId,
|
||||
v: props.publicId,
|
||||
w: props.dataImId,
|
||||
x: props.dataImType,
|
||||
y: props.dataGoodsId,
|
||||
z: props.dataOrderId,
|
||||
A: props.dataBizLine,
|
||||
B: common_vendor.o(handleClick),
|
||||
C: common_vendor.o(($event) => emit("getphonenumber", $event)),
|
||||
D: common_vendor.o(($event) => emit("getuserinfo", $event)),
|
||||
E: common_vendor.o(($event) => emit("error", $event)),
|
||||
F: common_vendor.o(($event) => emit("opensetting", $event)),
|
||||
G: common_vendor.o(($event) => emit("addgroupapp", $event)),
|
||||
H: common_vendor.o(($event) => emit("chooseaddress", $event)),
|
||||
I: common_vendor.o(($event) => emit("chooseavatar", $event)),
|
||||
J: common_vendor.o(($event) => emit("chooseinvoicetitle", $event)),
|
||||
K: common_vendor.o(($event) => emit("launchapp", $event)),
|
||||
L: common_vendor.o(($event) => emit("login", $event)),
|
||||
M: common_vendor.o(($event) => emit("subscribe", $event)),
|
||||
N: common_vendor.o(($event) => emit("contact", $event)),
|
||||
O: common_vendor.o(($event) => emit("agreeprivacyauthorization", $event)),
|
||||
P: common_vendor.o(($event) => emit("im", $event))
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/button/button.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/button/button.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/button/button.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"icon": "../icon/icon"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/button/button.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/button/button.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<button class="{{f}}" style="{{g}}" form-type="{{h}}" open-type="{{i}}" hover-class="{{j}}" hover-start-time="{{k}}" hover-stay-time="{{l}}" hover-stop-propagation lang="{{m}}" session-from="{{n}}" send-message-title="{{o}}" send-message-path="{{p}}" send-message-img="{{q}}" show-message-card="{{r}}" group-id="{{s}}" guild-id="{{t}}" public-id="{{v}}" data-im-id="{{w}}" data-im-type="{{x}}" data-goods-id="{{y}}" data-order-id="{{z}}" data-biz-line="{{A}}" bindtap="{{B}}" bindgetphonenumber="{{C}}" bindgetuserinfo="{{D}}" binderror="{{E}}" bindopensetting="{{F}}" bindaddgroupapp="{{G}}" bindchooseaddress="{{H}}" bindchooseavatar="{{I}}" bindchooseinvoicetitle="{{J}}" bindlaunchapp="{{K}}" bindlogin="{{L}}" bindsubscribe="{{M}}" bindcontact="{{N}}" bindagreeprivacyauthorization="{{O}}" bindim="{{P}}"><view class="nut-button__wrap"><icon wx:if="{{a}}" class="nut-icon-loading" u-i="7c77dfda-0" bind:__l="__l" u-p="{{b}}"/><slot wx:if="{{c}}" name="icon"/><view wx:if="{{d}}" class="{{[e && 'nut-button__text']}}"><slot/></view></view></button>
|
||||
285
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/button/button.wxss
vendored
Normal file
285
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/button/button.wxss
vendored
Normal file
@@ -0,0 +1,285 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.nut-theme-dark .nut-button--default {
|
||||
color: var(--nut-dark-color3, rgba(232, 230, 227, 0.8));
|
||||
background: var(--nut-dark-background2, #1b1b1b);
|
||||
border: var(--nut-button-border-width, 1px) solid var(--nut-dark-background2, #1b1b1b);
|
||||
}
|
||||
.nut-theme-dark .nut-button--plain {
|
||||
background: var(--nut-dark-background2, #1b1b1b);
|
||||
}
|
||||
.nut-theme-dark .nut-button:not(.nut-button--hovercls) .nut-button--plain:not([disabled]):active {
|
||||
background: var(--nut-dark-background2, #1b1b1b);
|
||||
}
|
||||
.nut-theme-dark .nut-button:not(.nut-button--hovercls) .nut-button--default:not([disabled]):active {
|
||||
color: var(--nut-dark-color3, rgba(232, 230, 227, 0.8));
|
||||
background: var(--nut-dark-background2, #1b1b1b);
|
||||
border: var(--nut-button-border-width, 1px) solid var(--nut-dark-background2, #1b1b1b);
|
||||
}
|
||||
.nut-button {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
display: inline-block;
|
||||
flex-shrink: 0;
|
||||
width: auto;
|
||||
height: var(--nut-button-default-height, 38px);
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-size: var(--nut-button-default-font-size, var(--nut-font-size-2, 14px));
|
||||
line-height: var(--nut-button-default-line-height, 36px);
|
||||
text-align: center;
|
||||
vertical-align: bottom;
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
touch-action: manipulation;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
transition: opacity 0.2s;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
.nut-button .nut-button__text {
|
||||
margin-left: 5px;
|
||||
}
|
||||
.nut-button::before {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
content: "";
|
||||
background-color: var(--nut-black, #000);
|
||||
border: inherit;
|
||||
border-color: var(--nut-black, #000);
|
||||
border-radius: inherit;
|
||||
opacity: 0;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
.nut-button::after {
|
||||
display: none;
|
||||
}
|
||||
.nut-button:not(.nut-button--hovercls):active::before {
|
||||
opacity: 0.1;
|
||||
}
|
||||
.nut-button__wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.nut-button--loading::before, .nut-button--disabled::before {
|
||||
display: none;
|
||||
}
|
||||
.nut-button--default {
|
||||
color: var(--nut-button-default-color, #666666);
|
||||
background: var(--nut-button-default-bg-color, var(--nut-white, #fff));
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid var(--nut-button-default-border-color, #cccccc);
|
||||
}
|
||||
.nut-button--primary {
|
||||
color: var(--nut-button-primary-color, var(--nut-white, #fff));
|
||||
background: var(--nut-button-primary-background-color, linear-gradient(135deg, var(--nut-primary-color, var(--nut-primary-color, #fa2c19)) 0%, var(--nut-primary-color, var(--nut-primary-color, #fa2c19)) 100%));
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid transparent;
|
||||
}
|
||||
.nut-button--info {
|
||||
color: var(--nut-button-info-color, var(--nut-white, #fff));
|
||||
background: var(--nut-button-info-background-color, linear-gradient(315deg, #498ff2 0%, #4965f2 100%));
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid transparent;
|
||||
}
|
||||
.nut-button--success {
|
||||
color: var(--nut-button-success-color, var(--nut-white, #fff));
|
||||
background: var(--nut-button-success-background-color, linear-gradient(135deg, #26bf26 0%, #27c530 45%, #28cf3f 83%, #29d446 100%));
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid transparent;
|
||||
}
|
||||
.nut-button--danger {
|
||||
color: var(--nut-button-danger-color, var(--nut-white, #fff));
|
||||
background: var(--nut-button-danger-background-color, #fa2c19);
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid transparent;
|
||||
}
|
||||
.nut-button--warning {
|
||||
color: var(--nut-button-warning-color, var(--nut-white, #fff));
|
||||
background: var(--nut-button-warning-background-color, linear-gradient(135deg, #ff9e0d 0%, #ffa70d 45%, #ffb60d 83%, #ffbe0d 100%));
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid transparent;
|
||||
}
|
||||
.nut-button--plain {
|
||||
background: var(--nut-button-plain-background-color, var(--nut-white, #fff));
|
||||
background-origin: border-box;
|
||||
}
|
||||
.nut-button--plain.nut-button--primary {
|
||||
color: var(--nut-button-primary-border-color, var(--nut-primary-color, #fa2c19));
|
||||
border-color: var(--nut-button-primary-border-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-button--plain.nut-button--info {
|
||||
color: var(--nut-button-info-border-color, #496af2);
|
||||
border-color: var(--nut-button-info-border-color, #496af2);
|
||||
}
|
||||
.nut-button--plain.nut-button--success {
|
||||
color: var(--nut-button-success-border-color, #26bf26);
|
||||
border-color: var(--nut-button-success-border-color, #26bf26);
|
||||
}
|
||||
.nut-button--plain.nut-button--danger {
|
||||
color: var(--nut-button-danger-border-color, #fa2c19);
|
||||
border-color: var(--nut-button-danger-border-color, #fa2c19);
|
||||
}
|
||||
.nut-button--plain.nut-button--warning {
|
||||
color: var(--nut-button-warning-border-color, #ff9e0d);
|
||||
border-color: var(--nut-button-warning-border-color, #ff9e0d);
|
||||
}
|
||||
.nut-button--plain:not(.nut-button--hovercls).nut-button--primary:not([disabled]):active {
|
||||
color: var(--nut-button-primary-border-color, var(--nut-primary-color, #fa2c19));
|
||||
border-color: var(--nut-button-primary-border-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-button--plain:not(.nut-button--hovercls).nut-button--info:not([disabled]):active {
|
||||
color: var(--nut-button-info-border-color, #496af2);
|
||||
border-color: var(--nut-button-info-border-color, #496af2);
|
||||
}
|
||||
.nut-button--plain:not(.nut-button--hovercls).nut-button--success:not([disabled]):active {
|
||||
color: var(--nut-button-success-border-color, #26bf26);
|
||||
border-color: var(--nut-button-success-border-color, #26bf26);
|
||||
}
|
||||
.nut-button--plain:not(.nut-button--hovercls).nut-button--danger:not([disabled]):active {
|
||||
color: var(--nut-button-danger-border-color, #fa2c19);
|
||||
border-color: var(--nut-button-danger-border-color, #fa2c19);
|
||||
}
|
||||
.nut-button--plain:not(.nut-button--hovercls).nut-button--warning:not([disabled]):active {
|
||||
color: var(--nut-button-warning-border-color, #ff9e0d);
|
||||
border-color: var(--nut-button-warning-border-color, #ff9e0d);
|
||||
}
|
||||
.nut-button--large {
|
||||
width: 100%;
|
||||
height: var(--nut-button-large-height, 48px);
|
||||
font-size: var(--nut-button-large-font-size, var(--nut-button-default-font-size, var(--nut-font-size-2, 14px)));
|
||||
line-height: var(--nut-button-large-line-height, 46px);
|
||||
}
|
||||
.nut-button--normal {
|
||||
padding: var(--nut-button-default-padding, 0 18px);
|
||||
font-size: var(--nut-button-default-font-size, var(--nut-font-size-2, 14px));
|
||||
}
|
||||
.nut-button--small {
|
||||
height: var(--nut-button-small-height, 28px);
|
||||
padding: var(--nut-button-small-padding, 0 12px);
|
||||
font-size: var(--nut-button-small-font-size, var(--nut-font-size-1, 12px));
|
||||
line-height: var(--nut-button-small-line-height, 26px);
|
||||
}
|
||||
.nut-button--small.nut-button--round {
|
||||
border-radius: var(--nut-button-small-round-border-radius, var(--nut-button-border-radius, 25px));
|
||||
}
|
||||
.nut-button--mini {
|
||||
height: var(--nut-button-mini-height, 24px);
|
||||
padding: var(--nut-button-mini-padding, 0 12px);
|
||||
font-size: var(--nut-button-mini-font-size, var(--nut-font-size-1, 12px));
|
||||
line-height: var(--nut-button-mini-line-height, 1.2);
|
||||
}
|
||||
.nut-button--block {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
.nut-button--disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: var(--nut-button-disabled-opacity, 0.68);
|
||||
}
|
||||
.nut-button--loading {
|
||||
cursor: default;
|
||||
opacity: 0.9;
|
||||
}
|
||||
.nut-button--round {
|
||||
border-radius: var(--nut-button-border-radius, 25px);
|
||||
}
|
||||
.nut-button--square {
|
||||
border-radius: 0;
|
||||
}
|
||||
.nut-button:not(.nut-button--hovercls) .nut-button--default:not([disabled]):active {
|
||||
color: var(--nut-button-default-color, #666666);
|
||||
background: var(--nut-button-default-bg-color, var(--nut-white, #fff));
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid var(--nut-button-default-border-color, #cccccc);
|
||||
}
|
||||
.nut-button:not(.nut-button--hovercls) .nut-button--primary:not([disabled]):active {
|
||||
color: var(--nut-button-primary-color, var(--nut-white, #fff));
|
||||
background: var(--nut-button-primary-background-color, linear-gradient(135deg, var(--nut-primary-color, var(--nut-primary-color, #fa2c19)) 0%, var(--nut-primary-color, var(--nut-primary-color, #fa2c19)) 100%));
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid transparent;
|
||||
}
|
||||
.nut-button:not(.nut-button--hovercls) .nut-button--info:not([disabled]):active {
|
||||
color: var(--nut-button-info-color, var(--nut-white, #fff));
|
||||
background: var(--nut-button-info-background-color, linear-gradient(315deg, #498ff2 0%, #4965f2 100%));
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid transparent;
|
||||
}
|
||||
.nut-button:not(.nut-button--hovercls) .nut-button--success:not([disabled]):active {
|
||||
color: var(--nut-button-success-color, var(--nut-white, #fff));
|
||||
background: var(--nut-button-success-background-color, linear-gradient(135deg, #26bf26 0%, #27c530 45%, #28cf3f 83%, #29d446 100%));
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid transparent;
|
||||
}
|
||||
.nut-button:not(.nut-button--hovercls) .nut-button--danger:not([disabled]):active {
|
||||
color: var(--nut-button-danger-color, var(--nut-white, #fff));
|
||||
background: var(--nut-button-danger-background-color, #fa2c19);
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid transparent;
|
||||
}
|
||||
.nut-button:not(.nut-button--hovercls) .nut-button--warning:not([disabled]):active {
|
||||
color: var(--nut-button-warning-color, var(--nut-white, #fff));
|
||||
background: var(--nut-button-warning-background-color, linear-gradient(135deg, #ff9e0d 0%, #ffa70d 45%, #ffb60d 83%, #ffbe0d 100%));
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid transparent;
|
||||
}
|
||||
.nut-button:not(.nut-button--hovercls) .nut-button--plain:not([disabled]):active {
|
||||
background: var(--nut-button-plain-background-color, var(--nut-white, #fff));
|
||||
background-origin: border-box;
|
||||
}
|
||||
235
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cascader/cascader.js
vendored
Normal file
235
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cascader/cascader.js
vendored
Normal file
@@ -0,0 +1,235 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_nutuiUni_components__constants_event = require("../_constants/event.js");
|
||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const popup = require("../../../../popup.js");
|
||||
const cascaderProps = {
|
||||
...popup.popupProps,
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 选中值,双向绑定
|
||||
*/
|
||||
modelValue: Array,
|
||||
/**
|
||||
* @description 显示选择层
|
||||
*/
|
||||
visible: Boolean,
|
||||
/**
|
||||
* @description 级联数据
|
||||
*/
|
||||
options: uni_modules_nutuiUni_components__utils_props.makeArrayProp([]),
|
||||
/**
|
||||
* @description 是否开启动态加载
|
||||
*/
|
||||
lazy: Boolean,
|
||||
/**
|
||||
* @description 动态加载回调,开启动态加载时生效
|
||||
*/
|
||||
lazyLoad: Function,
|
||||
/**
|
||||
* @description 自定义 `options` 结构中 `value` 的字段
|
||||
*/
|
||||
valueKey: uni_modules_nutuiUni_components__utils_props.makeStringProp("value"),
|
||||
/**
|
||||
* @description 自定义 `options` 结构中 `text` 的字段
|
||||
*/
|
||||
textKey: uni_modules_nutuiUni_components__utils_props.makeStringProp("text"),
|
||||
/**
|
||||
* @description 自定义 `options` 结构中 `children` 的字段
|
||||
*/
|
||||
childrenKey: uni_modules_nutuiUni_components__utils_props.makeStringProp("children"),
|
||||
/**
|
||||
* @description 当 `options` 为可转换为树形结构的扁平结构时,配置转换规则
|
||||
*/
|
||||
convertConfig: Object,
|
||||
/**
|
||||
* @description 是否需要弹层展示(设置为 `false` 后,`title` 失效)
|
||||
*/
|
||||
poppable: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 标题
|
||||
*/
|
||||
title: String,
|
||||
/**
|
||||
* @description 选中底部展示样式 可选值: 'line', 'smile'
|
||||
*/
|
||||
titleType: uni_modules_nutuiUni_components__utils_props.makeStringProp("line"),
|
||||
/**
|
||||
* @description 标签栏字体尺寸大小 可选值: 'large', 'normal', 'small'
|
||||
*/
|
||||
titleSize: uni_modules_nutuiUni_components__utils_props.makeStringProp("normal"),
|
||||
/**
|
||||
* @description 标签间隙
|
||||
*/
|
||||
titleGutter: uni_modules_nutuiUni_components__utils_props.makeNumericProp(0),
|
||||
/**
|
||||
* @description 是否省略过长的标题文字
|
||||
*/
|
||||
titleEllipsis: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 自定义弹窗样式
|
||||
*/
|
||||
popStyle: {
|
||||
type: [String, Object, Array],
|
||||
default: ""
|
||||
},
|
||||
/**
|
||||
* @description 遮罩显示时的背景是否锁定
|
||||
*/
|
||||
lockScroll: uni_modules_nutuiUni_components__utils_props.truthProp
|
||||
};
|
||||
const cascaderEmits = {
|
||||
[uni_modules_nutuiUni_components__constants_event.UPDATE_MODEL_EVENT]: (value) => true,
|
||||
[uni_modules_nutuiUni_components__constants_event.UPDATE_VISIBLE_EVENT]: (value) => true,
|
||||
[uni_modules_nutuiUni_components__constants_event.CHANGE_EVENT]: (value, nodes) => true,
|
||||
pathChange: (nodes) => true,
|
||||
[uni_modules_nutuiUni_components__constants_event.OPEN_EVENT]: () => true,
|
||||
[uni_modules_nutuiUni_components__constants_event.OPENED_EVENT]: () => true,
|
||||
[uni_modules_nutuiUni_components__constants_event.CLOSE_EVENT]: () => true,
|
||||
[uni_modules_nutuiUni_components__constants_event.CLOSED_EVENT]: () => true
|
||||
};
|
||||
if (!Math) {
|
||||
(NutCascaderItem + NutPopup)();
|
||||
}
|
||||
const NutCascaderItem = () => "../cascaderitem/cascaderitem.js";
|
||||
const NutPopup = () => "../popup/popup.js";
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-cascader`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: cascaderProps,
|
||||
emits: cascaderEmits,
|
||||
setup(__props, { emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const slots = common_vendor.useSlots();
|
||||
const innerValue = common_vendor.ref(props.modelValue);
|
||||
const innerVisible = common_vendor.computed({
|
||||
get() {
|
||||
return props.visible;
|
||||
},
|
||||
set(value) {
|
||||
emit(uni_modules_nutuiUni_components__constants_event.UPDATE_VISIBLE_EVENT, value);
|
||||
}
|
||||
});
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName);
|
||||
});
|
||||
const popClasses = common_vendor.computed(() => {
|
||||
return `${componentName}__popup ${props.popClass}`;
|
||||
});
|
||||
const overlayClasses = common_vendor.computed(() => {
|
||||
return `${componentName}__overlay ${props.overlayClass}`;
|
||||
});
|
||||
function handleChange(value, pathNodes) {
|
||||
innerValue.value = value;
|
||||
innerVisible.value = false;
|
||||
emit(uni_modules_nutuiUni_components__constants_event.UPDATE_MODEL_EVENT, value);
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CHANGE_EVENT, value, pathNodes);
|
||||
}
|
||||
function handlePathChange(pathNodes) {
|
||||
emit("pathChange", pathNodes);
|
||||
}
|
||||
function handleOpen() {
|
||||
emit(uni_modules_nutuiUni_components__constants_event.OPEN_EVENT);
|
||||
}
|
||||
function handleOpened() {
|
||||
emit(uni_modules_nutuiUni_components__constants_event.OPENED_EVENT);
|
||||
}
|
||||
function handleClose() {
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CLOSE_EVENT);
|
||||
}
|
||||
function handleClosed() {
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CLOSED_EVENT);
|
||||
}
|
||||
common_vendor.watch(() => props.modelValue, (value) => {
|
||||
if (value !== innerValue.value) {
|
||||
innerValue.value = value;
|
||||
}
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: props.poppable
|
||||
}, props.poppable ? common_vendor.e({
|
||||
b: common_vendor.unref(slots).title
|
||||
}, common_vendor.unref(slots).title ? {} : common_vendor.e({
|
||||
c: props.title
|
||||
}, props.title ? {
|
||||
d: props.title
|
||||
} : {}), {
|
||||
e: common_vendor.o(handleChange),
|
||||
f: common_vendor.o(handlePathChange),
|
||||
g: common_vendor.p({
|
||||
["model-value"]: innerValue.value,
|
||||
visible: innerVisible.value,
|
||||
options: props.options,
|
||||
lazy: props.lazy,
|
||||
["lazy-load"]: props.lazyLoad,
|
||||
["value-key"]: props.valueKey,
|
||||
["text-key"]: props.textKey,
|
||||
["children-key"]: props.childrenKey,
|
||||
["convert-config"]: props.convertConfig,
|
||||
["title-type"]: props.titleType,
|
||||
["title-size"]: props.titleSize,
|
||||
["title-gutter"]: props.titleGutter,
|
||||
["title-ellipsis"]: props.titleEllipsis
|
||||
}),
|
||||
h: common_vendor.o(handleOpen),
|
||||
i: common_vendor.o(handleOpened),
|
||||
j: common_vendor.o(handleClose),
|
||||
k: common_vendor.o(handleClosed),
|
||||
l: common_vendor.o(($event) => innerVisible.value = $event),
|
||||
m: common_vendor.p({
|
||||
["custom-class"]: popClasses.value,
|
||||
["custom-style"]: props.popStyle,
|
||||
["overlay-class"]: overlayClasses.value,
|
||||
["overlay-style"]: props.overlayStyle,
|
||||
position: "bottom",
|
||||
round: true,
|
||||
closeable: props.closeable,
|
||||
["close-icon"]: props.closeIcon,
|
||||
["close-icon-position"]: props.closeIconPosition,
|
||||
["z-index"]: props.zIndex,
|
||||
["lock-scroll"]: props.lockScroll,
|
||||
overlay: props.overlay,
|
||||
["close-on-click-overlay"]: props.closeOnClickOverlay,
|
||||
["destroy-on-close"]: false,
|
||||
visible: innerVisible.value
|
||||
})
|
||||
}) : {
|
||||
n: common_vendor.o(handleChange),
|
||||
o: common_vendor.o(handlePathChange),
|
||||
p: common_vendor.p({
|
||||
["model-value"]: innerValue.value,
|
||||
visible: innerVisible.value,
|
||||
options: props.options,
|
||||
lazy: props.lazy,
|
||||
["lazy-load"]: props.lazyLoad,
|
||||
["value-key"]: props.valueKey,
|
||||
["text-key"]: props.textKey,
|
||||
["children-key"]: props.childrenKey,
|
||||
["convert-config"]: props.convertConfig,
|
||||
["title-type"]: props.titleType,
|
||||
["title-size"]: props.titleSize,
|
||||
["title-gutter"]: props.titleGutter,
|
||||
["title-ellipsis"]: props.titleEllipsis
|
||||
})
|
||||
}, {
|
||||
q: common_vendor.n(classes.value),
|
||||
r: common_vendor.s(props.customStyle)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/cascader/cascader.js.map
|
||||
7
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cascader/cascader.json
vendored
Normal file
7
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cascader/cascader.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"nut-cascader-item": "../cascaderitem/cascaderitem",
|
||||
"nut-popup": "../popup/popup"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cascader/cascader.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cascader/cascader.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{q}}" style="{{r}}"><block wx:if="{{a}}"><nut-popup wx:if="{{m}}" u-s="{{['d']}}" bindopen="{{h}}" bindopened="{{i}}" bindclose="{{j}}" bindclosed="{{k}}" u-i="36fa809a-0" bind:__l="__l" bindupdateVisible="{{l}}" u-p="{{m}}"><slot wx:if="{{b}}" name="title"/><block wx:else><rich-text wx:if="{{c}}" class="nut-cascader__bar" nodes="{{d}}"/></block><nut-cascader-item wx:if="{{g}}" bindchange="{{e}}" bindpathChange="{{f}}" u-i="36fa809a-1,36fa809a-0" bind:__l="__l" u-p="{{g}}"/></nut-popup></block><block wx:else><nut-cascader-item wx:if="{{p}}" bindchange="{{n}}" bindpathChange="{{o}}" u-i="36fa809a-2" bind:__l="__l" u-p="{{p}}"/></block></view>
|
||||
247
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cascader/cascader.wxss
vendored
Normal file
247
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cascader/cascader.wxss
vendored
Normal file
@@ -0,0 +1,247 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.nut-theme-dark .nut-cascader .nut-tabs__titles {
|
||||
background: var(--nut-dark-background3, #141414) !important;
|
||||
}
|
||||
.nut-theme-dark .nut-cascader__bar {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
background: var(--nut-dark-background2, #1b1b1b);
|
||||
}
|
||||
.nut-theme-dark .nut-cascader-item__inner {
|
||||
color: var(--nut-dark-color-gray, var(--nut-text-color, #808080));
|
||||
}
|
||||
.nut-cascader .nut-tab-pane {
|
||||
padding: 0;
|
||||
}
|
||||
.nut-cascader .nut-tabs__titles {
|
||||
padding: var(--nut-cascader-tabs-item-padding, 0 10px);
|
||||
background: #fff;
|
||||
}
|
||||
.nut-cascader-item {
|
||||
width: 100%;
|
||||
font-size: var(--nut-cascader-font-size, var(--nut-font-size-2, 14px));
|
||||
line-height: var(--nut-cascader-line-height, 22px);
|
||||
}
|
||||
.nut-cascader-item.nut-tabs.horizontal .nut-tabs__titles .nut-tabs__titles-item {
|
||||
flex: initial;
|
||||
padding: var(--nut-cascader-tabs-item-padding, 0 10px);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.nut-cascader-item__inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: var(--nut-cascader-item-padding, 10px 20px);
|
||||
margin: 0;
|
||||
font-size: var(--nut-cascader-item-font-size, var(--nut-font-size-2, 14px));
|
||||
color: var(--nut-cascader-item-color, var(--nut-title-color, #1a1a1a));
|
||||
cursor: pointer;
|
||||
}
|
||||
.nut-cascader-item__title {
|
||||
flex: 1;
|
||||
}
|
||||
.nut-cascader-item__icon-check {
|
||||
margin-left: 10px;
|
||||
visibility: hidden;
|
||||
}
|
||||
.nut-cascader-item__icon-loading {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.nut-cascader-item.active:not(.disabled) {
|
||||
color: var(--nut-cascader-item-active-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-cascader-item.active .nut-cascader-item__icon-check {
|
||||
color: var(--nut-cascader-item-active-color, var(--nut-primary-color, #fa2c19));
|
||||
visibility: visible;
|
||||
}
|
||||
.nut-cascader-item.disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.6;
|
||||
}
|
||||
.nut-cascader__bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: var(--nut-cascader-bar-padding, 24px 20px 17px);
|
||||
font-size: var(--nut-cascader-bar-font-size, var(--nut-font-size-4, 18px));
|
||||
font-weight: bold;
|
||||
line-height: var(--nut-cascader-bar-line-height, 20px);
|
||||
color: var(--nut-cascader-bar-color, var(--nut-title-color, #1a1a1a));
|
||||
text-align: center;
|
||||
}
|
||||
.nut-cascader-pane {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 342px;
|
||||
padding: 10px 0 0;
|
||||
margin: 0;
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.nut-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: var(--nut-overlay-bg-color, rgba(0, 0, 0, 0.7));
|
||||
}
|
||||
.nut-overflow-hidden {
|
||||
overflow: hidden !important;
|
||||
}
|
||||
.nut-theme-dark .nut-popup {
|
||||
background: var(--nut-dark-background2, #1b1b1b);
|
||||
}
|
||||
.nut-theme-dark .nut-popup__close-icon {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
}
|
||||
.nut-popup-slide-center-enter-active, .nut-popup-slide-center-leave-active {
|
||||
transition-timing-function: ease;
|
||||
transition-property: opacity;
|
||||
}
|
||||
.nut-popup-slide-center-enter-from, .nut-popup-slide-center-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
.nut-popup-slide-top-enter-from, .nut-popup-slide-top-leave-active {
|
||||
transform: translate(0, -100%);
|
||||
}
|
||||
.nut-popup-slide-right-enter-from, .nut-popup-slide-right-leave-active {
|
||||
transform: translate(100%, 0);
|
||||
}
|
||||
.nut-popup-slide-bottom-enter-from, .nut-popup-slide-bottom-leave-active {
|
||||
transform: translate(0, 100%);
|
||||
}
|
||||
.nut-popup-slide-left-enter-from, .nut-popup-slide-left-leave-active {
|
||||
transform: translate(-100%, 0);
|
||||
}
|
||||
.nut-popup--center {
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
.nut-popup--center.round {
|
||||
border-radius: var(--nut-popup-border-radius, 20px);
|
||||
}
|
||||
.nut-popup--bottom {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.nut-popup--bottom.round {
|
||||
border-radius: var(--nut-popup-border-radius, 20px) var(--nut-popup-border-radius, 20px) 0 0;
|
||||
}
|
||||
.nut-popup--bottom--safebottom {
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
.nut-popup--right {
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
.nut-popup--right.round {
|
||||
border-radius: var(--nut-popup-border-radius, 20px) 0 0 var(--nut-popup-border-radius, 20px);
|
||||
}
|
||||
.nut-popup--left {
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
.nut-popup--left.round {
|
||||
border-radius: 0 var(--nut-popup-border-radius, 20px) var(--nut-popup-border-radius, 20px) 0;
|
||||
}
|
||||
.nut-popup--top {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.nut-popup--top.round {
|
||||
border-radius: 0 0 var(--nut-popup-border-radius, 20px) var(--nut-popup-border-radius, 20px);
|
||||
}
|
||||
.nut-popup--top--safetop {
|
||||
padding-top: var(--status-bar-height);
|
||||
padding-top: constant(safe-area-inset-top);
|
||||
padding-top: env(safe-area-inset-top);
|
||||
}
|
||||
.nut-popup {
|
||||
position: fixed;
|
||||
max-height: 100%;
|
||||
overflow-y: auto;
|
||||
background-color: var(--nut-white, #fff);
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.nut-popup__close-icon {
|
||||
position: absolute !important;
|
||||
z-index: 1;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
font-size: 18px;
|
||||
line-height: 30px;
|
||||
color: #969799;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
.nut-popup__close-icon:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
.nut-popup__close-icon--top-left {
|
||||
top: var(--nut-popup-close-icon-margin, 16px);
|
||||
left: var(--nut-popup-close-icon-margin, 16px);
|
||||
}
|
||||
.nut-popup__close-icon--top-right {
|
||||
top: var(--nut-popup-close-icon-margin, 16px);
|
||||
right: var(--nut-popup-close-icon-margin, 16px);
|
||||
}
|
||||
.nut-popup__close-icon--bottom-left {
|
||||
bottom: var(--nut-popup-close-icon-margin, 16px);
|
||||
left: var(--nut-popup-close-icon-margin, 16px);
|
||||
}
|
||||
.nut-popup__close-icon--bottom-right {
|
||||
right: var(--nut-popup-close-icon-margin, 16px);
|
||||
bottom: var(--nut-popup-close-icon-margin, 16px);
|
||||
}
|
||||
65
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cascader/helper.js
vendored
Normal file
65
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cascader/helper.js
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
"use strict";
|
||||
function formatTree(tree, parent, config) {
|
||||
return tree.map((node) => {
|
||||
const { value: valueKey = "value", text: textKey = "text", children: childrenKey = "children" } = config;
|
||||
const { [valueKey]: value, [textKey]: text, [childrenKey]: children, ...others } = node;
|
||||
const newNode = {
|
||||
loading: false,
|
||||
...others,
|
||||
level: parent ? (parent && parent.level || 0) + 1 : 0,
|
||||
value,
|
||||
text,
|
||||
children,
|
||||
_parent: parent
|
||||
};
|
||||
if (newNode.children && newNode.children.length)
|
||||
newNode.children = formatTree(newNode.children, newNode, config);
|
||||
return newNode;
|
||||
});
|
||||
}
|
||||
function eachTree(tree, cb) {
|
||||
let i = 0;
|
||||
let node;
|
||||
while (node = tree[i++]) {
|
||||
if (cb(node) === true)
|
||||
break;
|
||||
if (node.children && node.children.length)
|
||||
eachTree(node.children, cb);
|
||||
}
|
||||
}
|
||||
const defaultConvertConfig = {
|
||||
topId: null,
|
||||
idKey: "id",
|
||||
pidKey: "pid",
|
||||
sortKey: ""
|
||||
};
|
||||
function convertListToOptions(list, options) {
|
||||
const mergedOptions = {
|
||||
...defaultConvertConfig,
|
||||
...options || {}
|
||||
};
|
||||
const { topId, idKey, pidKey, sortKey } = mergedOptions;
|
||||
let result = [];
|
||||
let map = {};
|
||||
list.forEach((node) => {
|
||||
node = { ...node };
|
||||
const { [idKey]: id, [pidKey]: pid } = node;
|
||||
const children = map[pid] = map[pid] || [];
|
||||
if (!result.length && pid === topId)
|
||||
result = children;
|
||||
children.push(node);
|
||||
node.children = map[id] || (map[id] = []);
|
||||
});
|
||||
if (sortKey) {
|
||||
Object.keys(map).forEach((i) => {
|
||||
if (map[i].length > 1)
|
||||
map[i].sort((a, b) => a[sortKey] - b[sortKey]);
|
||||
});
|
||||
}
|
||||
map = null;
|
||||
return result;
|
||||
}
|
||||
exports.convertListToOptions = convertListToOptions;
|
||||
exports.eachTree = eachTree;
|
||||
exports.formatTree = formatTree;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/cascader/helper.js.map
|
||||
56
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cascader/tree.js
vendored
Normal file
56
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cascader/tree.js
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
"use strict";
|
||||
const uni_modules_nutuiUni_components_cascader_helper = require("./helper.js");
|
||||
class Tree {
|
||||
constructor(nodes, config) {
|
||||
this.config = {
|
||||
value: "value",
|
||||
text: "text",
|
||||
children: "children",
|
||||
...config || {}
|
||||
};
|
||||
this.nodes = uni_modules_nutuiUni_components_cascader_helper.formatTree(nodes, null, this.config);
|
||||
}
|
||||
updateChildren(nodes, parent) {
|
||||
if (!parent)
|
||||
this.nodes = uni_modules_nutuiUni_components_cascader_helper.formatTree(nodes, null, this.config);
|
||||
else
|
||||
parent.children = uni_modules_nutuiUni_components_cascader_helper.formatTree(nodes, parent, this.config);
|
||||
}
|
||||
// for test
|
||||
getNodeByValue(value) {
|
||||
let foundNode;
|
||||
uni_modules_nutuiUni_components_cascader_helper.eachTree(this.nodes, (node) => {
|
||||
if (node.value === value) {
|
||||
foundNode = node;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
return foundNode;
|
||||
}
|
||||
getPathNodesByValue(value) {
|
||||
if (!value.length)
|
||||
return [];
|
||||
const pathNodes = [];
|
||||
let currentNodes = this.nodes;
|
||||
while (currentNodes && currentNodes.length) {
|
||||
const foundNode = currentNodes.find((node) => node.value === value[node.level]);
|
||||
if (!foundNode)
|
||||
break;
|
||||
pathNodes.push(foundNode);
|
||||
currentNodes = foundNode.children;
|
||||
}
|
||||
return pathNodes;
|
||||
}
|
||||
isLeaf(node, lazy) {
|
||||
const { leaf, children } = node;
|
||||
const hasChildren = Array.isArray(children) && Boolean(children.length);
|
||||
return leaf == null ? !hasChildren && !lazy : leaf;
|
||||
}
|
||||
hasChildren(node, lazy) {
|
||||
if (lazy)
|
||||
return Array.isArray(node.children) && Boolean(node.children.length);
|
||||
return !this.isLeaf(node, lazy);
|
||||
}
|
||||
}
|
||||
exports.Tree = Tree;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/cascader/tree.js.map
|
||||
343
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cascaderitem/cascaderitem.js
vendored
Normal file
343
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cascaderitem/cascaderitem.js
vendored
Normal file
@@ -0,0 +1,343 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_nutuiUni_components__constants_event = require("../_constants/event.js");
|
||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
||||
require("../../locale/locale.js");
|
||||
const uni_modules_nutuiUni_locale_useTranslate = require("../../locale/useTranslate.js");
|
||||
const uni_modules_nutuiUni_components_cascader_helper = require("../cascader/helper.js");
|
||||
const uni_modules_nutuiUni_components_cascader_tree = require("../cascader/tree.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const cascaderitemProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 选中值,双向绑定
|
||||
*/
|
||||
modelValue: Array,
|
||||
/**
|
||||
* @description 显示选择层
|
||||
*/
|
||||
visible: Boolean,
|
||||
/**
|
||||
* @description 级联数据
|
||||
*/
|
||||
options: uni_modules_nutuiUni_components__utils_props.makeArrayProp([]),
|
||||
/**
|
||||
* @description 是否开启动态加载
|
||||
*/
|
||||
lazy: Boolean,
|
||||
/**
|
||||
* @description 动态加载回调,开启动态加载时生效
|
||||
*/
|
||||
lazyLoad: Function,
|
||||
/**
|
||||
* @description 自定义 `options` 结构中 `value` 的字段
|
||||
*/
|
||||
valueKey: uni_modules_nutuiUni_components__utils_props.makeStringProp("value"),
|
||||
/**
|
||||
* @description 自定义 `options` 结构中 `text` 的字段
|
||||
*/
|
||||
textKey: uni_modules_nutuiUni_components__utils_props.makeStringProp("text"),
|
||||
/**
|
||||
* @description 自定义 `options` 结构中 `children` 的字段
|
||||
*/
|
||||
childrenKey: uni_modules_nutuiUni_components__utils_props.makeStringProp("children"),
|
||||
/**
|
||||
* @description 当 `options` 为可转换为树形结构的扁平结构时,配置转换规则
|
||||
*/
|
||||
convertConfig: Object,
|
||||
/**
|
||||
* @description 选中底部展示样式 可选值: 'line', 'smile'
|
||||
*/
|
||||
titleType: uni_modules_nutuiUni_components__utils_props.makeStringProp("line"),
|
||||
/**
|
||||
* @description 标签栏字体尺寸大小 可选值: 'large', 'normal', 'small'
|
||||
*/
|
||||
titleSize: uni_modules_nutuiUni_components__utils_props.makeStringProp("normal"),
|
||||
/**
|
||||
* @description 标签间隙
|
||||
*/
|
||||
titleGutter: uni_modules_nutuiUni_components__utils_props.makeNumericProp(0),
|
||||
/**
|
||||
* @description 是否省略过长的标题文字
|
||||
*/
|
||||
titleEllipsis: uni_modules_nutuiUni_components__utils_props.truthProp
|
||||
};
|
||||
const cascaderitemEmits = {
|
||||
[uni_modules_nutuiUni_components__constants_event.UPDATE_MODEL_EVENT]: (value) => true,
|
||||
[uni_modules_nutuiUni_components__constants_event.CHANGE_EVENT]: (value, nodes) => true,
|
||||
pathChange: (value) => true
|
||||
};
|
||||
if (!Math) {
|
||||
(NutIcon + NutTabPane + NutTabs)();
|
||||
}
|
||||
const NutIcon = () => "../icon/icon.js";
|
||||
const NutTabPane = () => "../tabpane/tabpane.js";
|
||||
const NutTabs = () => "../tabs/tabs.js";
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-cascader-item`;
|
||||
const { translate } = uni_modules_nutuiUni_locale_useTranslate.useTranslate(componentName);
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: cascaderitemProps,
|
||||
emits: cascaderitemEmits,
|
||||
setup(__props, { emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName);
|
||||
});
|
||||
const configs = common_vendor.computed(() => ({
|
||||
lazy: props.lazy,
|
||||
lazyLoad: props.lazyLoad,
|
||||
valueKey: props.valueKey,
|
||||
textKey: props.textKey,
|
||||
childrenKey: props.childrenKey,
|
||||
convertConfig: props.convertConfig
|
||||
}));
|
||||
const tabsCursor = common_vendor.ref(0);
|
||||
const initLoading = common_vendor.ref(false);
|
||||
const innerValue = common_vendor.ref(props.modelValue);
|
||||
const tree = common_vendor.ref(new uni_modules_nutuiUni_components_cascader_tree.Tree([], {}));
|
||||
const panes = common_vendor.ref([]);
|
||||
const isLazy = common_vendor.computed(() => configs.value.lazy && Boolean(configs.value.lazyLoad));
|
||||
const lazyLoadMap = /* @__PURE__ */ new Map();
|
||||
let currentProcessNode;
|
||||
async function init() {
|
||||
lazyLoadMap.clear();
|
||||
panes.value = [];
|
||||
tabsCursor.value = 0;
|
||||
initLoading.value = false;
|
||||
currentProcessNode = null;
|
||||
let { options } = props;
|
||||
if (configs.value.convertConfig) {
|
||||
options = uni_modules_nutuiUni_components_cascader_helper.convertListToOptions(options, configs.value.convertConfig);
|
||||
}
|
||||
tree.value = new uni_modules_nutuiUni_components_cascader_tree.Tree(options, {
|
||||
value: configs.value.valueKey,
|
||||
text: configs.value.textKey,
|
||||
children: configs.value.childrenKey
|
||||
});
|
||||
if (isLazy.value && !tree.value.nodes.length) {
|
||||
await invokeLazyLoad({
|
||||
root: true,
|
||||
loading: true,
|
||||
text: "",
|
||||
value: ""
|
||||
});
|
||||
}
|
||||
panes.value = [{ nodes: tree.value.nodes, selectedNode: null }];
|
||||
syncValue();
|
||||
}
|
||||
const methods = {
|
||||
// 选中一个节点,静默模式不触发事件
|
||||
async handleNode(node, silent) {
|
||||
const { disabled, loading } = node;
|
||||
if (!silent && disabled || !panes.value[tabsCursor.value])
|
||||
return;
|
||||
if (tree.value.isLeaf(node, isLazy.value)) {
|
||||
node.leaf = true;
|
||||
panes.value[tabsCursor.value].selectedNode = node;
|
||||
panes.value = panes.value.slice(0, node.level + 1);
|
||||
if (!silent) {
|
||||
const pathNodes = panes.value.map((pane) => pane.selectedNode);
|
||||
emitChange(pathNodes);
|
||||
emit("pathChange", pathNodes);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (tree.value.hasChildren(node, isLazy.value)) {
|
||||
const level = node.level + 1;
|
||||
panes.value[tabsCursor.value].selectedNode = node;
|
||||
panes.value = panes.value.slice(0, level);
|
||||
panes.value.push({
|
||||
nodes: node.children || [],
|
||||
selectedNode: null
|
||||
});
|
||||
tabsCursor.value = level;
|
||||
if (!silent) {
|
||||
const pathNodes = panes.value.map((pane) => pane.selectedNode);
|
||||
emit("pathChange", pathNodes);
|
||||
}
|
||||
return;
|
||||
}
|
||||
currentProcessNode = node;
|
||||
if (loading)
|
||||
return;
|
||||
await invokeLazyLoad(node);
|
||||
if (currentProcessNode === node) {
|
||||
panes.value[tabsCursor.value].selectedNode = node;
|
||||
methods.handleNode(node, silent);
|
||||
}
|
||||
},
|
||||
handleTabClick(tab) {
|
||||
currentProcessNode = null;
|
||||
tabsCursor.value = Number(tab.paneKey);
|
||||
},
|
||||
isSelected(pane, node) {
|
||||
var _a;
|
||||
return ((_a = pane == null ? void 0 : pane.selectedNode) == null ? void 0 : _a.value) === node.value;
|
||||
}
|
||||
};
|
||||
async function syncValue() {
|
||||
const currentValue = innerValue.value;
|
||||
if (currentValue === void 0 || !tree.value.nodes.length) {
|
||||
return;
|
||||
}
|
||||
if (currentValue.length === 0) {
|
||||
tabsCursor.value = 0;
|
||||
panes.value = [{ nodes: tree.value.nodes, selectedNode: null }];
|
||||
return;
|
||||
}
|
||||
let needToSync = currentValue;
|
||||
if (isLazy.value && Array.isArray(currentValue) && currentValue.length) {
|
||||
needToSync = [];
|
||||
const parent = tree.value.nodes.find((node) => node.value === currentValue[0]);
|
||||
if (parent) {
|
||||
needToSync = [parent.value];
|
||||
initLoading.value = true;
|
||||
const last = await currentValue.slice(1).reduce(async (p, value) => {
|
||||
var _a;
|
||||
const parent2 = await p;
|
||||
await invokeLazyLoad(parent2);
|
||||
const node = (_a = parent2 == null ? void 0 : parent2.children) == null ? void 0 : _a.find((item) => item.value === value);
|
||||
if (node)
|
||||
needToSync.push(value);
|
||||
return Promise.resolve(node);
|
||||
}, Promise.resolve(parent));
|
||||
await invokeLazyLoad(last);
|
||||
initLoading.value = false;
|
||||
}
|
||||
}
|
||||
if (needToSync.length && currentValue === props.modelValue) {
|
||||
const pathNodes = tree.value.getPathNodesByValue(needToSync);
|
||||
pathNodes.forEach((node, index) => {
|
||||
tabsCursor.value = index;
|
||||
methods.handleNode(node, true);
|
||||
});
|
||||
}
|
||||
}
|
||||
async function invokeLazyLoad(node) {
|
||||
if (!node)
|
||||
return;
|
||||
if (!configs.value.lazyLoad) {
|
||||
node.leaf = true;
|
||||
return;
|
||||
}
|
||||
if (tree.value.isLeaf(node, isLazy.value) || tree.value.hasChildren(node, isLazy.value))
|
||||
return;
|
||||
node.loading = true;
|
||||
const parent = node.root ? null : node;
|
||||
let lazyLoadPromise = lazyLoadMap.get(node);
|
||||
if (!lazyLoadPromise) {
|
||||
lazyLoadPromise = new Promise((resolve) => {
|
||||
var _a, _b;
|
||||
(_b = (_a = configs.value).lazyLoad) == null ? void 0 : _b.call(_a, node, resolve);
|
||||
});
|
||||
lazyLoadMap.set(node, lazyLoadPromise);
|
||||
}
|
||||
const nodes = await lazyLoadPromise;
|
||||
if (Array.isArray(nodes) && nodes.length > 0) {
|
||||
tree.value.updateChildren(nodes, parent);
|
||||
} else {
|
||||
node.leaf = true;
|
||||
}
|
||||
node.loading = false;
|
||||
lazyLoadMap.delete(node);
|
||||
}
|
||||
function emitChange(pathNodes) {
|
||||
const emitValue = pathNodes.map((node) => node.value);
|
||||
innerValue.value = emitValue;
|
||||
emit(uni_modules_nutuiUni_components__constants_event.UPDATE_MODEL_EVENT, emitValue);
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CHANGE_EVENT, emitValue, pathNodes);
|
||||
}
|
||||
function formatTabTitle(pane) {
|
||||
return pane.selectedNode ? pane.selectedNode.text : translate("select");
|
||||
}
|
||||
common_vendor.watch(() => [configs.value, props.options], () => {
|
||||
init();
|
||||
}, {
|
||||
deep: true,
|
||||
immediate: true
|
||||
});
|
||||
common_vendor.watch(() => props.modelValue, (value) => {
|
||||
if (value !== innerValue.value) {
|
||||
innerValue.value = value;
|
||||
syncValue();
|
||||
}
|
||||
});
|
||||
common_vendor.watch(() => props.visible, (value) => {
|
||||
if (value && Array.isArray(innerValue.value) && innerValue.value.length > 0) {
|
||||
syncValue();
|
||||
}
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: !initLoading.value && panes.value.length
|
||||
}, !initLoading.value && panes.value.length ? {
|
||||
b: common_vendor.f(panes.value, (pane, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.f(pane.nodes, (node, k1, i1) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(node.text),
|
||||
b: node.loading
|
||||
}, node.loading ? {
|
||||
c: "2a1ec3fa-2-" + i0 + "-" + i1 + "," + ("2a1ec3fa-1-" + i0),
|
||||
d: common_vendor.p({
|
||||
["custom-class"]: "nut-cascader-item__icon-loading",
|
||||
loading: true,
|
||||
name: "loading"
|
||||
})
|
||||
} : {
|
||||
e: "2a1ec3fa-3-" + i0 + "-" + i1 + "," + ("2a1ec3fa-1-" + i0),
|
||||
f: common_vendor.p({
|
||||
["custom-class"]: "nut-cascader-item__icon-check",
|
||||
name: "checklist"
|
||||
})
|
||||
}, {
|
||||
g: methods.isSelected(pane, node) ? 1 : "",
|
||||
h: node.disabled ? 1 : "",
|
||||
i: methods.isSelected(pane, node),
|
||||
j: node.disabled || void 0,
|
||||
k: common_vendor.o(($event) => methods.handleNode(node, false), node.value),
|
||||
l: node.value
|
||||
});
|
||||
}),
|
||||
b: index,
|
||||
c: "2a1ec3fa-1-" + i0 + ",2a1ec3fa-0",
|
||||
d: common_vendor.p({
|
||||
title: formatTabTitle(pane)
|
||||
})
|
||||
};
|
||||
})
|
||||
} : {
|
||||
c: common_vendor.p({
|
||||
title: "Loading..."
|
||||
})
|
||||
}, {
|
||||
d: common_vendor.o(methods.handleTabClick),
|
||||
e: common_vendor.o(($event) => tabsCursor.value = $event),
|
||||
f: common_vendor.p({
|
||||
["custom-class"]: classes.value,
|
||||
["custom-style"]: props.customStyle,
|
||||
type: props.titleType,
|
||||
size: props.titleSize,
|
||||
["title-gutter"]: props.titleGutter,
|
||||
ellipsis: props.titleEllipsis,
|
||||
["title-scroll"]: true,
|
||||
modelValue: tabsCursor.value
|
||||
})
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/cascaderitem/cascaderitem.js.map
|
||||
8
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cascaderitem/cascaderitem.json
vendored
Normal file
8
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cascaderitem/cascaderitem.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"nut-icon": "../icon/icon",
|
||||
"nut-tab-pane": "../tabpane/tabpane",
|
||||
"nut-tabs": "../tabs/tabs"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cascaderitem/cascaderitem.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cascaderitem/cascaderitem.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<nut-tabs wx:if="{{f}}" u-s="{{['d']}}" bindclick="{{d}}" u-i="2a1ec3fa-0" bind:__l="__l" bindupdateModelValue="{{e}}" u-p="{{f}}"><block wx:if="{{a}}"><nut-tab-pane wx:for="{{b}}" wx:for-item="pane" wx:key="b" u-s="{{['d']}}" u-i="{{pane.c}}" bind:__l="__l" u-p="{{pane.d}}"><view class="nut-cascader-pane" role="menu"><scroll-view style="height:100%" scroll-y="{{true}}"><block wx:for="{{pane.a}}" wx:for-item="node" wx:key="l"><view class="{{['nut-cascader-item__inner', node.g && 'active', node.h && 'disabled']}}" role="menuitemradio" aria-checked="{{node.i}}" aria-disabled="{{node.j}}" bindtap="{{node.k}}"><view class="nut-cascader-item__title">{{node.a}}</view><nut-icon wx:if="{{node.b}}" u-i="{{node.c}}" bind:__l="__l" u-p="{{node.d}}"/><nut-icon wx:else u-i="{{node.e}}" bind:__l="__l" u-p="{{node.f||''}}"/></view></block></scroll-view></view></nut-tab-pane></block><block wx:else><nut-tab-pane wx:if="{{c}}" u-s="{{['d']}}" u-i="2a1ec3fa-4,2a1ec3fa-0" bind:__l="__l" u-p="{{c}}"><view class="nut-cascader-pane"/></nut-tab-pane></block></nut-tabs>
|
||||
739
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cascaderitem/cascaderitem.wxss
vendored
Normal file
739
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cascaderitem/cascaderitem.wxss
vendored
Normal file
@@ -0,0 +1,739 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.nut-theme-dark .nut-cascader .nut-tabs__titles {
|
||||
background: var(--nut-dark-background3, #141414) !important;
|
||||
}
|
||||
.nut-theme-dark .nut-cascader__bar {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
background: var(--nut-dark-background2, #1b1b1b);
|
||||
}
|
||||
.nut-theme-dark .nut-cascader-item__inner {
|
||||
color: var(--nut-dark-color-gray, var(--nut-text-color, #808080));
|
||||
}
|
||||
.nut-cascader .nut-tab-pane {
|
||||
padding: 0;
|
||||
}
|
||||
.nut-cascader .nut-tabs__titles {
|
||||
padding: var(--nut-cascader-tabs-item-padding, 0 10px);
|
||||
background: #fff;
|
||||
}
|
||||
.nut-cascader-item {
|
||||
width: 100%;
|
||||
font-size: var(--nut-cascader-font-size, var(--nut-font-size-2, 14px));
|
||||
line-height: var(--nut-cascader-line-height, 22px);
|
||||
}
|
||||
.nut-cascader-item.nut-tabs.horizontal .nut-tabs__titles .nut-tabs__titles-item {
|
||||
flex: initial;
|
||||
padding: var(--nut-cascader-tabs-item-padding, 0 10px);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.nut-cascader-item__inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: var(--nut-cascader-item-padding, 10px 20px);
|
||||
margin: 0;
|
||||
font-size: var(--nut-cascader-item-font-size, var(--nut-font-size-2, 14px));
|
||||
color: var(--nut-cascader-item-color, var(--nut-title-color, #1a1a1a));
|
||||
cursor: pointer;
|
||||
}
|
||||
.nut-cascader-item__title {
|
||||
flex: 1;
|
||||
}
|
||||
.nut-cascader-item__icon-check {
|
||||
margin-left: 10px;
|
||||
visibility: hidden;
|
||||
}
|
||||
.nut-cascader-item__icon-loading {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.nut-cascader-item.active:not(.disabled) {
|
||||
color: var(--nut-cascader-item-active-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-cascader-item.active .nut-cascader-item__icon-check {
|
||||
color: var(--nut-cascader-item-active-color, var(--nut-primary-color, #fa2c19));
|
||||
visibility: visible;
|
||||
}
|
||||
.nut-cascader-item.disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.6;
|
||||
}
|
||||
.nut-cascader__bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: var(--nut-cascader-bar-padding, 24px 20px 17px);
|
||||
font-size: var(--nut-cascader-bar-font-size, var(--nut-font-size-4, 18px));
|
||||
font-weight: bold;
|
||||
line-height: var(--nut-cascader-bar-line-height, 20px);
|
||||
color: var(--nut-cascader-bar-color, var(--nut-title-color, #1a1a1a));
|
||||
text-align: center;
|
||||
}
|
||||
.nut-cascader-pane {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 342px;
|
||||
padding: 10px 0 0;
|
||||
margin: 0;
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.nut-sticky {
|
||||
position: -webkit-sticky;
|
||||
position: sticky;
|
||||
}
|
||||
.nut-theme-dark .nut-cascader .nut-tabs__titles {
|
||||
background: var(--nut-dark-background3, #141414) !important;
|
||||
}
|
||||
.nut-theme-dark .nut-cascader__bar {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
background: var(--nut-dark-background2, #1b1b1b);
|
||||
}
|
||||
.nut-theme-dark .nut-cascader-item__inner {
|
||||
color: var(--nut-dark-color-gray, var(--nut-text-color, #808080));
|
||||
}
|
||||
.nut-cascader .nut-tab-pane {
|
||||
padding: 0;
|
||||
}
|
||||
.nut-cascader .nut-tabs__titles {
|
||||
padding: var(--nut-cascader-tabs-item-padding, 0 10px);
|
||||
background: #fff;
|
||||
}
|
||||
.nut-cascader-item {
|
||||
width: 100%;
|
||||
font-size: var(--nut-cascader-font-size, var(--nut-font-size-2, 14px));
|
||||
line-height: var(--nut-cascader-line-height, 22px);
|
||||
}
|
||||
.nut-cascader-item.nut-tabs.horizontal .nut-tabs__titles .nut-tabs__titles-item {
|
||||
flex: initial;
|
||||
padding: var(--nut-cascader-tabs-item-padding, 0 10px);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.nut-cascader-item__inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: var(--nut-cascader-item-padding, 10px 20px);
|
||||
margin: 0;
|
||||
font-size: var(--nut-cascader-item-font-size, var(--nut-font-size-2, 14px));
|
||||
color: var(--nut-cascader-item-color, var(--nut-title-color, #1a1a1a));
|
||||
cursor: pointer;
|
||||
}
|
||||
.nut-cascader-item__title {
|
||||
flex: 1;
|
||||
}
|
||||
.nut-cascader-item__icon-check {
|
||||
margin-left: 10px;
|
||||
visibility: hidden;
|
||||
}
|
||||
.nut-cascader-item__icon-loading {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.nut-cascader-item.active:not(.disabled) {
|
||||
color: var(--nut-cascader-item-active-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-cascader-item.active .nut-cascader-item__icon-check {
|
||||
color: var(--nut-cascader-item-active-color, var(--nut-primary-color, #fa2c19));
|
||||
visibility: visible;
|
||||
}
|
||||
.nut-cascader-item.disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.6;
|
||||
}
|
||||
.nut-cascader__bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: var(--nut-cascader-bar-padding, 24px 20px 17px);
|
||||
font-size: var(--nut-cascader-bar-font-size, var(--nut-font-size-4, 18px));
|
||||
font-weight: bold;
|
||||
line-height: var(--nut-cascader-bar-line-height, 20px);
|
||||
color: var(--nut-cascader-bar-color, var(--nut-title-color, #1a1a1a));
|
||||
text-align: center;
|
||||
}
|
||||
.nut-cascader-pane {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 342px;
|
||||
padding: 10px 0 0;
|
||||
margin: 0;
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.nut-theme-dark .nut-tabs .nut-tabs__titles {
|
||||
background: var(--nut-dark-background3, #141414);
|
||||
}
|
||||
.nut-theme-dark .nut-tabs .nut-tabs__titles .nut-tabs__titles-item {
|
||||
color: var(--nut-dark-color-gray, var(--nut-text-color, #808080));
|
||||
}
|
||||
.nut-theme-dark .nut-tabs .nut-tabs__titles .nut-tabs__titles-item.nut-tabs-active {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
}
|
||||
.nut-theme-dark .nut-tabs.vertical .nut-tabs__titles .nut-tabs__titles-item.nut-tabs-active {
|
||||
background-color: var(--nut-dark-background2, #1b1b1b);
|
||||
}
|
||||
.nut-tabs {
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
white-space: nowrap;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
background: var(--nut-tabs-titles-background-color, var(--nut-help-color, #f5f5f5));
|
||||
border-radius: var(--nut-tabs-titles-border-radius, 0);
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles .nut-tabs__list {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles .nut-tabs__titles-item {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: var(--nut-tabs-titles-item-font-size, var(--nut-font-size-2, 14px));
|
||||
color: var(--nut-tabs-titles-item-color, var(--nut-title-color, #1a1a1a));
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles .nut-tabs__titles-item__text {
|
||||
text-align: center;
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles .nut-tabs__titles-item__text.ellipsis {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles .nut-tabs__titles-item__smile .nut-icon {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-size: 12px;
|
||||
color: var(--nut-tabs-tab-smile-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles .nut-tabs__titles-item__smile, .nut-tabs .nut-tabs__titles .nut-tabs__titles-item__line {
|
||||
position: absolute;
|
||||
bottom: 15%;
|
||||
left: 50%;
|
||||
width: 0;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
content: "";
|
||||
border-radius: var(--nut-tabs-titles-item-line-border-radius, 0);
|
||||
opacity: var(--nut-tabs-titles-item-line-opacity, 1);
|
||||
transition: width 0.3s ease;
|
||||
transform: translate(-50%, 0);
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles .nut-tabs__titles-item.nut-tabs-active {
|
||||
font-weight: bold;
|
||||
color: var(--nut-tabs-titles-item-active-color, var(--nut-title-color, #1a1a1a));
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles .nut-tabs__titles-item.nut-tabs-active .nut-tabs__titles-item__line {
|
||||
width: var(--nut-tabs-horizontal-titles-item-active-line-width, 40px);
|
||||
height: 3px;
|
||||
content: "";
|
||||
background: var(--nut-tabs-horizontal-tab-line-color, linear-gradient(90deg, var(--nut-primary-color, #fa2c19) 0%, rgba(250, 44, 25, 0.15) 100%));
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles .nut-tabs__titles-item.disabled {
|
||||
color: var(--nut-disable-color, #ccc);
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles-left {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.nut-tabs.horizontal {
|
||||
flex-direction: column;
|
||||
}
|
||||
.nut-tabs.horizontal .nut-sticky__box > .nut-tabs__titles,
|
||||
.nut-tabs.horizontal > .nut-tabs__titles {
|
||||
flex-direction: row;
|
||||
height: var(--nut-tabs-horizontal-titles-height, 46px);
|
||||
}
|
||||
.nut-tabs.horizontal .nut-sticky__box > .nut-tabs__titles .nut-tabs__list,
|
||||
.nut-tabs.horizontal > .nut-tabs__titles .nut-tabs__list {
|
||||
height: 100%;
|
||||
}
|
||||
.nut-tabs.horizontal .nut-sticky__box > .nut-tabs__titles.scrollable,
|
||||
.nut-tabs.horizontal > .nut-tabs__titles.scrollable {
|
||||
overflow: auto hidden;
|
||||
}
|
||||
.nut-tabs.horizontal .nut-sticky__box > .nut-tabs__titles .nut-tabs__titles-item,
|
||||
.nut-tabs.horizontal > .nut-tabs__titles .nut-tabs__titles-item {
|
||||
flex: 1 0 auto;
|
||||
width: 0;
|
||||
min-width: var(--nut-tabs-horizontal-titles-item-min-width, 50px);
|
||||
}
|
||||
.nut-tabs.horizontal .nut-sticky__box > .nut-tabs__titles .nut-tabs__titles-item__smile .nut-icon,
|
||||
.nut-tabs.horizontal > .nut-tabs__titles .nut-tabs__titles-item__smile .nut-icon {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-size: 12px;
|
||||
color: var(--nut-tabs-tab-smile-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-tabs.horizontal .nut-sticky__box > .nut-tabs__titles .nut-tabs__titles-item-left,
|
||||
.nut-tabs.horizontal > .nut-tabs__titles .nut-tabs__titles-item-left {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
.nut-tabs.vertical {
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
}
|
||||
.nut-tabs.vertical > .nut-tabs__titles {
|
||||
flex-direction: column;
|
||||
width: var(--nut-tabs-vertical-titles-width, 100px);
|
||||
height: auto;
|
||||
padding: 10px 0;
|
||||
}
|
||||
.nut-tabs.vertical > .nut-tabs__titles .nut-tabs__list {
|
||||
flex-direction: column;
|
||||
}
|
||||
.nut-tabs.vertical > .nut-tabs__titles.scrollable {
|
||||
height: auto;
|
||||
overflow: hidden auto;
|
||||
}
|
||||
.nut-tabs.vertical > .nut-tabs__titles.scrollable .nut-tabs__titles-placeholder {
|
||||
height: 22px;
|
||||
}
|
||||
.nut-tabs.vertical > .nut-tabs__titles .nut-tabs__titles-item {
|
||||
flex: none;
|
||||
width: 100%;
|
||||
min-width: var(--nut-tabs-horizontal-titles-item-min-width, 50px);
|
||||
height: var(--nut-tabs-vertical-titles-item-height, 40px);
|
||||
}
|
||||
.nut-tabs.vertical > .nut-tabs__titles .nut-tabs__titles-item__line {
|
||||
bottom: none;
|
||||
width: 0;
|
||||
height: 0;
|
||||
transition: height 0.3s ease;
|
||||
transform: translate(0, -50%);
|
||||
}
|
||||
.nut-tabs.vertical > .nut-tabs__titles .nut-tabs__titles-item.nut-tabs-active {
|
||||
background-color: #fff;
|
||||
}
|
||||
.nut-tabs.vertical > .nut-tabs__titles .nut-tabs__titles-item.nut-tabs-active .nut-tabs__titles-item__line {
|
||||
left: 10px;
|
||||
width: 3px;
|
||||
height: var(--nut-tabs-vertical-titles-item-active-line-height, 14px);
|
||||
background: var(--nut-tabs-vertical-tab-line-color, linear-gradient(180deg, var(--nut-primary-color, #fa2c19) 0%, rgba(250, 44, 25, 0.15) 100%));
|
||||
}
|
||||
.nut-tabs.vertical > .nut-tabs__titles .nut-tabs__titles-item.nut-tabs-active .nut-tabs__titles-item__smile {
|
||||
position: absolute;
|
||||
right: -8px;
|
||||
bottom: 2px;
|
||||
left: auto;
|
||||
width: 36px;
|
||||
height: var(--nut-tabs-vertical-titles-item-active-line-height, 14px);
|
||||
transform: rotate(320deg);
|
||||
}
|
||||
.nut-tabs.vertical .nut-tabs__content {
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
}
|
||||
.nut-tabs.vertical .nut-tabs__content .nut-tab-pane {
|
||||
height: 100%;
|
||||
}
|
||||
.nut-tabs__titles.large .nut-tabs__titles-item {
|
||||
font-size: var(--nut-tabs-titles-item-large-font-size, var(--nut-font-size-3, 16px));
|
||||
}
|
||||
.nut-tabs__titles.normal .nut-tabs__titles-item {
|
||||
font-size: var(--nut-tabs-titles-item-font-size, var(--nut-font-size-2, 14px));
|
||||
}
|
||||
.nut-tabs__titles.small .nut-tabs__titles-item {
|
||||
font-size: var(--nut-tabs-titles-item-small-font-size, var(--nut-font-size-1, 12px));
|
||||
}
|
||||
.nut-tabs__titles::-webkit-scrollbar {
|
||||
display: none;
|
||||
width: 0;
|
||||
background: transparent;
|
||||
}
|
||||
.nut-tabs__titles.smile .nut-tabs__titles-item .nut-tabs__titles-item__smile {
|
||||
display: none;
|
||||
}
|
||||
.nut-tabs__titles.smile .nut-tabs__titles-item.nut-tabs-active .nut-tabs__titles-item__smile {
|
||||
display: block;
|
||||
width: 36px;
|
||||
height: 10px;
|
||||
}
|
||||
.nut-tabs__content {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles-item .uni {
|
||||
height: 46px;
|
||||
line-height: 46px;
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles-placeholder {
|
||||
width: auto;
|
||||
min-width: 10px;
|
||||
}
|
||||
scroll-view ::-webkit-scrollbar {
|
||||
display: none;
|
||||
width: 0 !important;
|
||||
height: 0 !important;
|
||||
background: transparent;
|
||||
}
|
||||
.nut-sticky {
|
||||
position: -webkit-sticky;
|
||||
position: sticky;
|
||||
}
|
||||
.nut-theme-dark .nut-cascader .nut-tabs__titles {
|
||||
background: var(--nut-dark-background3, #141414) !important;
|
||||
}
|
||||
.nut-theme-dark .nut-cascader__bar {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
background: var(--nut-dark-background2, #1b1b1b);
|
||||
}
|
||||
.nut-theme-dark .nut-cascader-item__inner {
|
||||
color: var(--nut-dark-color-gray, var(--nut-text-color, #808080));
|
||||
}
|
||||
.nut-cascader .nut-tab-pane {
|
||||
padding: 0;
|
||||
}
|
||||
.nut-cascader .nut-tabs__titles {
|
||||
padding: var(--nut-cascader-tabs-item-padding, 0 10px);
|
||||
background: #fff;
|
||||
}
|
||||
.nut-cascader-item {
|
||||
width: 100%;
|
||||
font-size: var(--nut-cascader-font-size, var(--nut-font-size-2, 14px));
|
||||
line-height: var(--nut-cascader-line-height, 22px);
|
||||
}
|
||||
.nut-cascader-item.nut-tabs.horizontal .nut-tabs__titles .nut-tabs__titles-item {
|
||||
flex: initial;
|
||||
padding: var(--nut-cascader-tabs-item-padding, 0 10px);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.nut-cascader-item__inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: var(--nut-cascader-item-padding, 10px 20px);
|
||||
margin: 0;
|
||||
font-size: var(--nut-cascader-item-font-size, var(--nut-font-size-2, 14px));
|
||||
color: var(--nut-cascader-item-color, var(--nut-title-color, #1a1a1a));
|
||||
cursor: pointer;
|
||||
}
|
||||
.nut-cascader-item__title {
|
||||
flex: 1;
|
||||
}
|
||||
.nut-cascader-item__icon-check {
|
||||
margin-left: 10px;
|
||||
visibility: hidden;
|
||||
}
|
||||
.nut-cascader-item__icon-loading {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.nut-cascader-item.active:not(.disabled) {
|
||||
color: var(--nut-cascader-item-active-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-cascader-item.active .nut-cascader-item__icon-check {
|
||||
color: var(--nut-cascader-item-active-color, var(--nut-primary-color, #fa2c19));
|
||||
visibility: visible;
|
||||
}
|
||||
.nut-cascader-item.disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.6;
|
||||
}
|
||||
.nut-cascader__bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: var(--nut-cascader-bar-padding, 24px 20px 17px);
|
||||
font-size: var(--nut-cascader-bar-font-size, var(--nut-font-size-4, 18px));
|
||||
font-weight: bold;
|
||||
line-height: var(--nut-cascader-bar-line-height, 20px);
|
||||
color: var(--nut-cascader-bar-color, var(--nut-title-color, #1a1a1a));
|
||||
text-align: center;
|
||||
}
|
||||
.nut-cascader-pane {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 342px;
|
||||
padding: 10px 0 0;
|
||||
margin: 0;
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.nut-theme-dark .nut-tabs .nut-tabs__titles {
|
||||
background: var(--nut-dark-background3, #141414);
|
||||
}
|
||||
.nut-theme-dark .nut-tabs .nut-tabs__titles .nut-tabs__titles-item {
|
||||
color: var(--nut-dark-color-gray, var(--nut-text-color, #808080));
|
||||
}
|
||||
.nut-theme-dark .nut-tabs .nut-tabs__titles .nut-tabs__titles-item.nut-tabs-active {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
}
|
||||
.nut-theme-dark .nut-tabs.vertical .nut-tabs__titles .nut-tabs__titles-item.nut-tabs-active {
|
||||
background-color: var(--nut-dark-background2, #1b1b1b);
|
||||
}
|
||||
.nut-tabs {
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
white-space: nowrap;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
background: var(--nut-tabs-titles-background-color, var(--nut-help-color, #f5f5f5));
|
||||
border-radius: var(--nut-tabs-titles-border-radius, 0);
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles .nut-tabs__list {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles .nut-tabs__titles-item {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: var(--nut-tabs-titles-item-font-size, var(--nut-font-size-2, 14px));
|
||||
color: var(--nut-tabs-titles-item-color, var(--nut-title-color, #1a1a1a));
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles .nut-tabs__titles-item__text {
|
||||
text-align: center;
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles .nut-tabs__titles-item__text.ellipsis {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles .nut-tabs__titles-item__smile .nut-icon {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-size: 12px;
|
||||
color: var(--nut-tabs-tab-smile-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles .nut-tabs__titles-item__smile, .nut-tabs .nut-tabs__titles .nut-tabs__titles-item__line {
|
||||
position: absolute;
|
||||
bottom: 15%;
|
||||
left: 50%;
|
||||
width: 0;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
content: "";
|
||||
border-radius: var(--nut-tabs-titles-item-line-border-radius, 0);
|
||||
opacity: var(--nut-tabs-titles-item-line-opacity, 1);
|
||||
transition: width 0.3s ease;
|
||||
transform: translate(-50%, 0);
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles .nut-tabs__titles-item.nut-tabs-active {
|
||||
font-weight: bold;
|
||||
color: var(--nut-tabs-titles-item-active-color, var(--nut-title-color, #1a1a1a));
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles .nut-tabs__titles-item.nut-tabs-active .nut-tabs__titles-item__line {
|
||||
width: var(--nut-tabs-horizontal-titles-item-active-line-width, 40px);
|
||||
height: 3px;
|
||||
content: "";
|
||||
background: var(--nut-tabs-horizontal-tab-line-color, linear-gradient(90deg, var(--nut-primary-color, #fa2c19) 0%, rgba(250, 44, 25, 0.15) 100%));
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles .nut-tabs__titles-item.disabled {
|
||||
color: var(--nut-disable-color, #ccc);
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles-left {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.nut-tabs.horizontal {
|
||||
flex-direction: column;
|
||||
}
|
||||
.nut-tabs.horizontal .nut-sticky__box > .nut-tabs__titles,
|
||||
.nut-tabs.horizontal > .nut-tabs__titles {
|
||||
flex-direction: row;
|
||||
height: var(--nut-tabs-horizontal-titles-height, 46px);
|
||||
}
|
||||
.nut-tabs.horizontal .nut-sticky__box > .nut-tabs__titles .nut-tabs__list,
|
||||
.nut-tabs.horizontal > .nut-tabs__titles .nut-tabs__list {
|
||||
height: 100%;
|
||||
}
|
||||
.nut-tabs.horizontal .nut-sticky__box > .nut-tabs__titles.scrollable,
|
||||
.nut-tabs.horizontal > .nut-tabs__titles.scrollable {
|
||||
overflow: auto hidden;
|
||||
}
|
||||
.nut-tabs.horizontal .nut-sticky__box > .nut-tabs__titles .nut-tabs__titles-item,
|
||||
.nut-tabs.horizontal > .nut-tabs__titles .nut-tabs__titles-item {
|
||||
flex: 1 0 auto;
|
||||
width: 0;
|
||||
min-width: var(--nut-tabs-horizontal-titles-item-min-width, 50px);
|
||||
}
|
||||
.nut-tabs.horizontal .nut-sticky__box > .nut-tabs__titles .nut-tabs__titles-item__smile .nut-icon,
|
||||
.nut-tabs.horizontal > .nut-tabs__titles .nut-tabs__titles-item__smile .nut-icon {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-size: 12px;
|
||||
color: var(--nut-tabs-tab-smile-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-tabs.horizontal .nut-sticky__box > .nut-tabs__titles .nut-tabs__titles-item-left,
|
||||
.nut-tabs.horizontal > .nut-tabs__titles .nut-tabs__titles-item-left {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
.nut-tabs.vertical {
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
}
|
||||
.nut-tabs.vertical > .nut-tabs__titles {
|
||||
flex-direction: column;
|
||||
width: var(--nut-tabs-vertical-titles-width, 100px);
|
||||
height: auto;
|
||||
padding: 10px 0;
|
||||
}
|
||||
.nut-tabs.vertical > .nut-tabs__titles .nut-tabs__list {
|
||||
flex-direction: column;
|
||||
}
|
||||
.nut-tabs.vertical > .nut-tabs__titles.scrollable {
|
||||
height: auto;
|
||||
overflow: hidden auto;
|
||||
}
|
||||
.nut-tabs.vertical > .nut-tabs__titles.scrollable .nut-tabs__titles-placeholder {
|
||||
height: 22px;
|
||||
}
|
||||
.nut-tabs.vertical > .nut-tabs__titles .nut-tabs__titles-item {
|
||||
flex: none;
|
||||
width: 100%;
|
||||
min-width: var(--nut-tabs-horizontal-titles-item-min-width, 50px);
|
||||
height: var(--nut-tabs-vertical-titles-item-height, 40px);
|
||||
}
|
||||
.nut-tabs.vertical > .nut-tabs__titles .nut-tabs__titles-item__line {
|
||||
bottom: none;
|
||||
width: 0;
|
||||
height: 0;
|
||||
transition: height 0.3s ease;
|
||||
transform: translate(0, -50%);
|
||||
}
|
||||
.nut-tabs.vertical > .nut-tabs__titles .nut-tabs__titles-item.nut-tabs-active {
|
||||
background-color: #fff;
|
||||
}
|
||||
.nut-tabs.vertical > .nut-tabs__titles .nut-tabs__titles-item.nut-tabs-active .nut-tabs__titles-item__line {
|
||||
left: 10px;
|
||||
width: 3px;
|
||||
height: var(--nut-tabs-vertical-titles-item-active-line-height, 14px);
|
||||
background: var(--nut-tabs-vertical-tab-line-color, linear-gradient(180deg, var(--nut-primary-color, #fa2c19) 0%, rgba(250, 44, 25, 0.15) 100%));
|
||||
}
|
||||
.nut-tabs.vertical > .nut-tabs__titles .nut-tabs__titles-item.nut-tabs-active .nut-tabs__titles-item__smile {
|
||||
position: absolute;
|
||||
right: -8px;
|
||||
bottom: 2px;
|
||||
left: auto;
|
||||
width: 36px;
|
||||
height: var(--nut-tabs-vertical-titles-item-active-line-height, 14px);
|
||||
transform: rotate(320deg);
|
||||
}
|
||||
.nut-tabs.vertical .nut-tabs__content {
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
}
|
||||
.nut-tabs.vertical .nut-tabs__content .nut-tab-pane {
|
||||
height: 100%;
|
||||
}
|
||||
.nut-tabs__titles.large .nut-tabs__titles-item {
|
||||
font-size: var(--nut-tabs-titles-item-large-font-size, var(--nut-font-size-3, 16px));
|
||||
}
|
||||
.nut-tabs__titles.normal .nut-tabs__titles-item {
|
||||
font-size: var(--nut-tabs-titles-item-font-size, var(--nut-font-size-2, 14px));
|
||||
}
|
||||
.nut-tabs__titles.small .nut-tabs__titles-item {
|
||||
font-size: var(--nut-tabs-titles-item-small-font-size, var(--nut-font-size-1, 12px));
|
||||
}
|
||||
.nut-tabs__titles::-webkit-scrollbar {
|
||||
display: none;
|
||||
width: 0;
|
||||
background: transparent;
|
||||
}
|
||||
.nut-tabs__titles.smile .nut-tabs__titles-item .nut-tabs__titles-item__smile {
|
||||
display: none;
|
||||
}
|
||||
.nut-tabs__titles.smile .nut-tabs__titles-item.nut-tabs-active .nut-tabs__titles-item__smile {
|
||||
display: block;
|
||||
width: 36px;
|
||||
height: 10px;
|
||||
}
|
||||
.nut-tabs__content {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles-item .uni {
|
||||
height: 46px;
|
||||
line-height: 46px;
|
||||
}
|
||||
.nut-tabs .nut-tabs__titles-placeholder {
|
||||
width: auto;
|
||||
min-width: 10px;
|
||||
}
|
||||
scroll-view ::-webkit-scrollbar {
|
||||
display: none;
|
||||
width: 0 !important;
|
||||
height: 0 !important;
|
||||
background: transparent;
|
||||
}
|
||||
.nut-theme-dark .nut-tab-pane {
|
||||
background: var(--nut-dark-background2, #1b1b1b);
|
||||
}
|
||||
.nut-tab-pane {
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
flex-shrink: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: var(--nut-tab-pane-padding, 24px 20px);
|
||||
overflow: auto;
|
||||
word-break: break-all;
|
||||
background: var(--nut-tab-pane-background, var(--nut-white, #fff));
|
||||
}
|
||||
.nut-tab-pane.inactive {
|
||||
height: 0;
|
||||
overflow: visible;
|
||||
}
|
||||
175
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cell/cell.js
vendored
Normal file
175
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cell/cell.js
vendored
Normal file
@@ -0,0 +1,175 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_nutuiUni_components__constants_event = require("../_constants/event.js");
|
||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_pxCheck = require("../_utils/pxCheck.js");
|
||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const cellProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 标题名称
|
||||
*/
|
||||
title: String,
|
||||
/**
|
||||
* @description 左侧副标题
|
||||
*/
|
||||
subTitle: String,
|
||||
/**
|
||||
* @description 右侧描述
|
||||
*/
|
||||
desc: String,
|
||||
/**
|
||||
* @description 右侧描述文本对齐方式 [text-align](https://www.w3school.com.cn/cssref/pr_text_text-align.asp)
|
||||
*/
|
||||
descTextAlign: uni_modules_nutuiUni_components__utils_props.makeStringProp("right"),
|
||||
/**
|
||||
* @description 是否展示右侧箭头并开启点击反馈
|
||||
*/
|
||||
isLink: Boolean,
|
||||
/**
|
||||
* @description 点击后跳转的目标路由对象,
|
||||
*/
|
||||
to: String,
|
||||
/**
|
||||
* @description 圆角半径
|
||||
*/
|
||||
roundRadius: uni_modules_nutuiUni_components__utils_props.makeNumericProp(void 0),
|
||||
/**
|
||||
* @description 是否使内容垂直居中
|
||||
*/
|
||||
center: Boolean,
|
||||
/**
|
||||
* @description 单元格大小,可选值为 `large`
|
||||
*/
|
||||
size: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
||||
/**
|
||||
* @description 是否启用点击效果
|
||||
*/
|
||||
clickable: Boolean,
|
||||
/**
|
||||
* @description 左侧图标
|
||||
*/
|
||||
icon: String,
|
||||
/**
|
||||
* @description 标题宽度
|
||||
*/
|
||||
titleWidth: uni_modules_nutuiUni_components__utils_props.makeNumericProp(void 0)
|
||||
};
|
||||
const cellEmits = {
|
||||
[uni_modules_nutuiUni_components__constants_event.CLICK_EVENT]: (event) => event instanceof Object
|
||||
};
|
||||
if (!Math) {
|
||||
NutIcon();
|
||||
}
|
||||
const NutIcon = () => "../icon/icon.js";
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-cell`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: cellProps,
|
||||
emits: cellEmits,
|
||||
setup(__props, { emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const slots = common_vendor.useSlots();
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, {
|
||||
[`${componentName}--center`]: props.center,
|
||||
[`${componentName}--large`]: props.size === "large",
|
||||
[`${componentName}--clickable`]: props.isLink || props.to || props.clickable
|
||||
});
|
||||
});
|
||||
const styles = common_vendor.computed(() => {
|
||||
const value = {};
|
||||
if (props.roundRadius != null)
|
||||
value.borderRadius = uni_modules_nutuiUni_components__utils_pxCheck.pxCheck(props.roundRadius);
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainStyle(props, value);
|
||||
});
|
||||
const titleStyles = common_vendor.computed(() => {
|
||||
const value = {};
|
||||
if (props.titleWidth != null) {
|
||||
value.flex = "0 0 auto";
|
||||
value.width = uni_modules_nutuiUni_components__utils_pxCheck.pxCheck(props.titleWidth);
|
||||
value.minWidth = 0;
|
||||
}
|
||||
return value;
|
||||
});
|
||||
const descClasses = common_vendor.computed(() => {
|
||||
return {
|
||||
[`${componentName}__value--alone`]: !(props.title || props.subTitle || slots.title)
|
||||
};
|
||||
});
|
||||
const descStyles = common_vendor.computed(() => {
|
||||
return {
|
||||
textAlign: props.descTextAlign
|
||||
};
|
||||
});
|
||||
function handleClick(event) {
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CLICK_EVENT, event);
|
||||
if (props.to) {
|
||||
common_vendor.index.navigateTo({
|
||||
url: props.to
|
||||
});
|
||||
}
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.unref(slots).default
|
||||
}, common_vendor.unref(slots).default ? {} : common_vendor.e({
|
||||
b: props.icon || common_vendor.unref(slots).icon
|
||||
}, props.icon || common_vendor.unref(slots).icon ? common_vendor.e({
|
||||
c: common_vendor.unref(slots).icon
|
||||
}, common_vendor.unref(slots).icon ? {} : {
|
||||
d: common_vendor.p({
|
||||
["custom-class"]: "nut-cell__icon__inner",
|
||||
name: props.icon
|
||||
})
|
||||
}) : {}, {
|
||||
e: props.title || props.subTitle || common_vendor.unref(slots).title
|
||||
}, props.title || props.subTitle || common_vendor.unref(slots).title ? common_vendor.e({
|
||||
f: common_vendor.unref(slots).title
|
||||
}, common_vendor.unref(slots).title ? {} : {
|
||||
g: common_vendor.t(props.title)
|
||||
}, {
|
||||
h: props.subTitle
|
||||
}, props.subTitle ? {
|
||||
i: common_vendor.t(props.subTitle)
|
||||
} : {}, {
|
||||
j: common_vendor.s(titleStyles.value)
|
||||
}) : {}, {
|
||||
k: props.desc || common_vendor.unref(slots).desc
|
||||
}, props.desc || common_vendor.unref(slots).desc ? common_vendor.e({
|
||||
l: common_vendor.unref(slots).desc
|
||||
}, common_vendor.unref(slots).desc ? {} : {
|
||||
m: common_vendor.t(props.desc)
|
||||
}, {
|
||||
n: common_vendor.n(descClasses.value),
|
||||
o: common_vendor.s(descStyles.value)
|
||||
}) : {}, {
|
||||
p: common_vendor.unref(slots).link
|
||||
}, common_vendor.unref(slots).link ? {} : common_vendor.e({
|
||||
q: props.isLink || props.to
|
||||
}, props.isLink || props.to ? {
|
||||
r: common_vendor.p({
|
||||
["custom-class"]: "nut-cell__link",
|
||||
name: "right"
|
||||
})
|
||||
} : {})), {
|
||||
s: common_vendor.n(classes.value),
|
||||
t: common_vendor.s(styles.value),
|
||||
v: common_vendor.o(handleClick)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/cell/cell.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cell/cell.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cell/cell.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"nut-icon": "../icon/icon"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cell/cell.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cell/cell.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{s}}" style="{{t}}" bindtap="{{v}}"><slot wx:if="{{a}}"/><block wx:else><view wx:if="{{b}}" class="nut-cell__icon"><slot wx:if="{{c}}" name="icon"/><nut-icon wx:else u-i="5c2f5a9a-0" bind:__l="__l" u-p="{{d||''}}"/></view><view wx:if="{{e}}" class="nut-cell__title" style="{{j}}"><slot wx:if="{{f}}" name="title"/><view wx:else class="title">{{g}}</view><view wx:if="{{h}}" class="nut-cell__title-desc">{{i}}</view></view><view wx:if="{{k}}" class="{{['nut-cell__value', n]}}" style="{{o}}"><slot wx:if="{{l}}" name="desc"/><block wx:else>{{m}}</block></view><slot wx:if="{{p}}" name="link"/><block wx:else><nut-icon wx:if="{{q}}" u-i="5c2f5a9a-1" bind:__l="__l" u-p="{{r}}"/></block></block></view>
|
||||
141
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cell/cell.wxss
vendored
Normal file
141
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cell/cell.wxss
vendored
Normal file
@@ -0,0 +1,141 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.nut-theme-dark .nut-cell {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
background: var(--nut-dark-background2, #1b1b1b);
|
||||
box-shadow: none;
|
||||
}
|
||||
.nut-cell {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
padding: var(--nut-cell-padding, 13px 16px);
|
||||
margin: 10px 0;
|
||||
font-size: var(--nut-cell-title-font, var(--nut-font-size-2, 14px));
|
||||
line-height: var(--nut-cell-line-height, 20px);
|
||||
color: var(--nut-cell-color, var(--nut-title-color2, #666));
|
||||
background: var(--nut-cell-background, var(--nut-white, #fff));
|
||||
border-radius: var(--nut-cell-border-radius, 6px);
|
||||
box-shadow: var(--nut-cell-box-shadow, 0 1px 7px 0 #edeef1);
|
||||
}
|
||||
.nut-cell--center {
|
||||
align-items: center;
|
||||
}
|
||||
.nut-cell--large {
|
||||
padding: var(--nut-cell-large-padding, 15px 16px);
|
||||
font-size: var(--nut-cell-large-title-font, var(--nut-font-size-large, var(--nut-font-size-3, 16px)));
|
||||
}
|
||||
.nut-cell--large .nut-cell__title-desc {
|
||||
font-size: var(--nut-cell-large-title-desc-font, var(--nut-font-size-base, var(--nut-font-size-2, 14px)));
|
||||
}
|
||||
.nut-cell:last-child::after {
|
||||
border: 0 !important;
|
||||
}
|
||||
.nut-cell::after {
|
||||
position: absolute;
|
||||
right: var(--nut-cell-after-right, 16px);
|
||||
bottom: 0;
|
||||
left: 16px;
|
||||
box-sizing: border-box;
|
||||
pointer-events: none;
|
||||
content: "";
|
||||
transform: scaleY(0.5);
|
||||
}
|
||||
.nut-cell:active::before {
|
||||
opacity: 0.1;
|
||||
}
|
||||
.nut-cell--clickable {
|
||||
cursor: pointer;
|
||||
}
|
||||
.nut-cell--clickable::before {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
content: "";
|
||||
background-color: var(--nut-black, #000);
|
||||
border: inherit;
|
||||
border-color: var(--nut-black, #000);
|
||||
border-radius: inherit;
|
||||
opacity: 0;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
.nut-cell__icon {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
margin: var(--nut-cell-default-icon-margin, 0 4px 0 0);
|
||||
}
|
||||
.nut-cell__title {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
min-width: 80px;
|
||||
}
|
||||
.nut-cell__title-desc {
|
||||
font-size: var(--nut-cell-title-desc-font, var(--nut-font-size-1, 12px));
|
||||
}
|
||||
.nut-cell__value {
|
||||
display: inline-block;
|
||||
flex: 1;
|
||||
font-size: var(--nut-cell-desc-font, var(--nut-font-size-2, 14px));
|
||||
color: var(--nut-cell-desc-color, var(--nut-disable-color, #ccc));
|
||||
text-align: right;
|
||||
}
|
||||
.nut-cell__value--alone {
|
||||
color: var(--nut-cell-color, var(--nut-title-color2, #666));
|
||||
}
|
||||
.nut-cell__link {
|
||||
align-self: center;
|
||||
color: #979797;
|
||||
}
|
||||
57
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cellgroup/cellgroup.js
vendored
Normal file
57
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cellgroup/cellgroup.js
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const cellgroupProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 标题名称
|
||||
*/
|
||||
title: String,
|
||||
/**
|
||||
* @description 右侧描述
|
||||
*/
|
||||
desc: String
|
||||
};
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-cell-group`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: cellgroupProps,
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
const slots = common_vendor.useSlots();
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName);
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.unref(slots).title
|
||||
}, common_vendor.unref(slots).title ? {} : common_vendor.e({
|
||||
b: props.title
|
||||
}, props.title ? {
|
||||
c: common_vendor.t(props.title)
|
||||
} : {}), {
|
||||
d: common_vendor.unref(slots).desc
|
||||
}, common_vendor.unref(slots).desc ? {} : common_vendor.e({
|
||||
e: props.desc
|
||||
}, props.desc ? {
|
||||
f: common_vendor.t(props.desc)
|
||||
} : {}), {
|
||||
g: common_vendor.n(classes.value),
|
||||
h: common_vendor.s(props.customStyle)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/cellgroup/cellgroup.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cellgroup/cellgroup.json
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cellgroup/cellgroup.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cellgroup/cellgroup.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cellgroup/cellgroup.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{g}}" style="{{h}}"><slot wx:if="{{a}}" name="title"/><block wx:else><view wx:if="{{b}}" class="nut-cell-group__title">{{c}}</view></block><slot wx:if="{{d}}" name="desc"/><block wx:else><view wx:if="{{e}}" class="nut-cell-group__desc">{{f}}</view></block><view class="nut-cell-group__wrap"><slot/></view></view>
|
||||
92
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cellgroup/cellgroup.wxss
vendored
Normal file
92
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cellgroup/cellgroup.wxss
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.nut-theme-dark .nut-cell-group__wrap {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
background: var(--nut-dark-background3, #141414);
|
||||
box-shadow: none;
|
||||
}
|
||||
.nut-cell-group {
|
||||
display: block;
|
||||
}
|
||||
.nut-cell-group__title {
|
||||
display: inherit;
|
||||
padding: var(--nut-cell-group-title-padding, 0 10px);
|
||||
margin-top: 30px;
|
||||
margin-bottom: 10px;
|
||||
font-size: var(--nut-cell-group-title-font-size, var(--nut-font-size-2, 14px));
|
||||
line-height: var(--nut-cell-group-title-line-height, 20px);
|
||||
color: var(--nut-cell-group-title-color, #909ca4);
|
||||
}
|
||||
.nut-cell-group__desc {
|
||||
display: inherit;
|
||||
padding: var(--nut-cell-group-desc-padding, 0 10px);
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
font-size: var(--nut-cell-group-desc-font-size, var(--nut-font-size-1, 12px));
|
||||
line-height: var(--nut-cell-group-desc-line-height, 16px);
|
||||
color: var(--nut-cell-group-desc-color, #909ca4);
|
||||
}
|
||||
.nut-cell-group__wrap {
|
||||
display: inherit;
|
||||
margin: 10px 0;
|
||||
overflow: hidden;
|
||||
background-color: var(--nut-cell-group-background-color, var(--nut-white, #fff));
|
||||
border-radius: var(--nut-cell-border-radius, 6px);
|
||||
box-shadow: var(--nut-cell-box-shadow, 0 1px 7px 0 #edeef1);
|
||||
}
|
||||
.nut-cell-group__wrap .nut-cell {
|
||||
margin: 0;
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
.nut-cell-group .nut-cell::after {
|
||||
border-bottom: var(--nut-cell-after-border-bottom, 1px solid #f5f6f7);
|
||||
}
|
||||
92
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/collapse/collapse.js
vendored
Normal file
92
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/collapse/collapse.js
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_nutuiUni_components__constants_event = require("../_constants/event.js");
|
||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
||||
const uni_modules_nutuiUni_components__utils_is = require("../_utils/is.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const collapseProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 当前展开面板的 `name`
|
||||
*/
|
||||
modelValue: { type: [String, Number, Array] },
|
||||
/**
|
||||
* @description 是否开启手风琴模式
|
||||
*/
|
||||
accordion: Boolean
|
||||
};
|
||||
const collapseEmits = {
|
||||
[uni_modules_nutuiUni_components__constants_event.CHANGE_EVENT]: (val, name, status) => uni_modules_nutuiUni_components__utils_is.isString(val) || uni_modules_nutuiUni_components__utils_is.isNumber(val) || val instanceof Object && uni_modules_nutuiUni_components__utils_is.isNumber(name) || uni_modules_nutuiUni_components__utils_is.isString(name) && uni_modules_nutuiUni_components__utils_is.isBoolean(status),
|
||||
[uni_modules_nutuiUni_components__constants_event.UPDATE_MODEL_EVENT]: (val) => uni_modules_nutuiUni_components__utils_is.isString(val) || uni_modules_nutuiUni_components__utils_is.isNumber(val) || val instanceof Object
|
||||
};
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-collapse`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: collapseProps,
|
||||
emits: collapseEmits,
|
||||
setup(__props, { emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const innerValue = common_vendor.ref(props.modelValue || (props.accordion ? "" : []));
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName);
|
||||
});
|
||||
common_vendor.watch(() => props.modelValue, (val) => {
|
||||
innerValue.value = val;
|
||||
});
|
||||
function changeVal(val, name, status = true) {
|
||||
innerValue.value = val;
|
||||
emit(uni_modules_nutuiUni_components__constants_event.UPDATE_MODEL_EVENT, val);
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CHANGE_EVENT, val, name, status);
|
||||
}
|
||||
function updateVal(name) {
|
||||
if (props.accordion) {
|
||||
if (innerValue.value === name)
|
||||
changeVal("", name, false);
|
||||
else
|
||||
changeVal(name, name, true);
|
||||
} else {
|
||||
if (Array.isArray(innerValue.value)) {
|
||||
if (innerValue.value.includes(name)) {
|
||||
const newValue = innerValue.value.filter((v) => v !== name);
|
||||
changeVal(newValue, name, false);
|
||||
} else {
|
||||
const newValue = innerValue.value.concat([name]);
|
||||
changeVal(newValue, name, true);
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.__f__("warn", "at uni_modules/nutui-uni/components/collapse/collapse.vue:44", "[NutUI] <Collapse> 未开启手风琴模式时 v-model 应为数组");
|
||||
}
|
||||
}
|
||||
}
|
||||
function isExpanded(name) {
|
||||
if (props.accordion)
|
||||
return innerValue.value === name;
|
||||
else if (Array.isArray(innerValue.value))
|
||||
return innerValue.value.includes(name);
|
||||
return false;
|
||||
}
|
||||
common_vendor.provide("collapseParent", {
|
||||
updateVal,
|
||||
isExpanded
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.n(classes.value),
|
||||
b: common_vendor.s(_ctx.customStyle)
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/collapse/collapse.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/collapse/collapse.json
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/collapse/collapse.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/collapse/collapse.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/collapse/collapse.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{a}}" style="{{b}}"><slot/></view>
|
||||
50
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/collapse/collapse.wxss
vendored
Normal file
50
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/collapse/collapse.wxss
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
178
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/collapseitem/collapseitem.js
vendored
Normal file
178
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/collapseitem/collapseitem.js
vendored
Normal file
@@ -0,0 +1,178 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
||||
const uni_modules_nutuiUni_components__hooks_useSelectorQuery = require("../_hooks/useSelectorQuery.js");
|
||||
const uni_modules_nutuiUni_components__utils_common = require("../_utils/common.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const collapseitemProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 折叠面板的引用对象
|
||||
*/
|
||||
collapseRef: Object,
|
||||
/**
|
||||
* @description 标题栏左侧内容,支持插槽传入(`props` 传入的优先级更高)
|
||||
*/
|
||||
title: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
||||
/**
|
||||
* @description 唯一标识符,必填
|
||||
*/
|
||||
name: {
|
||||
...uni_modules_nutuiUni_components__utils_props.makeRequiredProp([String, Number]),
|
||||
default: -1
|
||||
},
|
||||
/**
|
||||
* @description 标题栏右侧内容,支持插槽传入(`props` 传入的优先级更高)
|
||||
*/
|
||||
value: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
||||
/**
|
||||
* @description 标题栏描述信息
|
||||
*/
|
||||
label: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
||||
/**
|
||||
* @description 标题栏是否禁用
|
||||
*/
|
||||
disabled: Boolean,
|
||||
/**
|
||||
* @description 是否显示边框
|
||||
* @type boolean
|
||||
* @default true
|
||||
*/
|
||||
border: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 标题栏左侧图标组件,等同于 `nutui-icon` 组件
|
||||
*/
|
||||
icon: uni_modules_nutuiUni_components__utils_props.makeStringProp("down-arrow"),
|
||||
/**
|
||||
* @description 点击折叠和展开的旋转角度,在自定义图标模式下生效
|
||||
*/
|
||||
rotate: uni_modules_nutuiUni_components__utils_props.makeNumericProp(180)
|
||||
};
|
||||
if (!Math) {
|
||||
NutIcon();
|
||||
}
|
||||
const NutIcon = () => "../icon/icon.js";
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-collapse-item`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: collapseitemProps,
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
const instance = common_vendor.getCurrentInstance();
|
||||
const { getSelectorNodeInfo } = uni_modules_nutuiUni_components__hooks_useSelectorQuery.useSelectorQuery(instance);
|
||||
const refRandomId = uni_modules_nutuiUni_components__utils_common.getRandomId();
|
||||
common_vendor.useSlots();
|
||||
const target = `#nut-collapse__item-${refRandomId}`;
|
||||
const currentHeight = common_vendor.ref("auto");
|
||||
const inAnimation = common_vendor.ref(false);
|
||||
const timeoutId = common_vendor.ref("");
|
||||
const collapse = common_vendor.inject("collapseParent");
|
||||
const parent = common_vendor.reactive(collapse);
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, {
|
||||
[`${componentName}__border`]: props.border
|
||||
});
|
||||
});
|
||||
common_vendor.onMounted(() => {
|
||||
setTimeout(() => {
|
||||
getRect(target).then((res) => {
|
||||
if (res == null ? void 0 : res.height)
|
||||
currentHeight.value = `${res.height}px`;
|
||||
});
|
||||
}, 100);
|
||||
});
|
||||
async function getRectHeight() {
|
||||
const rect = await getRect(target);
|
||||
return rect.height;
|
||||
}
|
||||
common_vendor.watch(
|
||||
() => getRectHeight(),
|
||||
(val) => {
|
||||
setTimeout(() => {
|
||||
currentHeight.value = `${val}px`;
|
||||
}, 200);
|
||||
},
|
||||
{
|
||||
deep: true
|
||||
}
|
||||
);
|
||||
function getRect(selector) {
|
||||
return getSelectorNodeInfo(selector);
|
||||
}
|
||||
const expanded = common_vendor.computed(() => {
|
||||
if (parent)
|
||||
return parent.isExpanded(props.name);
|
||||
return false;
|
||||
});
|
||||
const wrapperHeight = common_vendor.ref(expanded.value ? "auto" : "0px");
|
||||
function handleClick() {
|
||||
if (!inAnimation.value)
|
||||
parent.updateVal(props.name);
|
||||
}
|
||||
function toggle(open) {
|
||||
if (timeoutId.value) {
|
||||
clearTimeout(timeoutId.value);
|
||||
timeoutId.value = "";
|
||||
}
|
||||
const start = open ? "0px" : currentHeight.value;
|
||||
const end = open ? currentHeight.value : "0px";
|
||||
inAnimation.value = true;
|
||||
wrapperHeight.value = start;
|
||||
setTimeout(() => {
|
||||
wrapperHeight.value = end;
|
||||
inAnimation.value = false;
|
||||
if (open) {
|
||||
timeoutId.value = setTimeout(() => {
|
||||
wrapperHeight.value = "auto";
|
||||
}, 300);
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
common_vendor.watch(expanded, toggle);
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: _ctx.$slots.title
|
||||
}, _ctx.$slots.title ? {} : {
|
||||
b: _ctx.title
|
||||
}, {
|
||||
c: _ctx.label
|
||||
}, _ctx.label ? {
|
||||
d: common_vendor.t(_ctx.label)
|
||||
} : {}, {
|
||||
e: _ctx.$slots.value
|
||||
}, _ctx.$slots.value ? {} : {
|
||||
f: _ctx.value
|
||||
}, {
|
||||
g: common_vendor.p({
|
||||
name: _ctx.icon
|
||||
}),
|
||||
h: common_vendor.n({
|
||||
"nut-collapse-item__title-icon--expanded": expanded.value
|
||||
}),
|
||||
i: `rotate(${expanded.value ? _ctx.rotate : 0}deg)`,
|
||||
j: common_vendor.n({
|
||||
"nut-collapse-item__title--disabled": _ctx.disabled
|
||||
}),
|
||||
k: common_vendor.o(handleClick),
|
||||
l: _ctx.$slots.extra
|
||||
}, _ctx.$slots.extra ? {} : {}, {
|
||||
m: `nut-collapse__item-${common_vendor.unref(refRandomId)}`,
|
||||
n: wrapperHeight.value,
|
||||
o: common_vendor.n(classes.value),
|
||||
p: common_vendor.s(_ctx.customStyle)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/collapseitem/collapseitem.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/collapseitem/collapseitem.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/collapseitem/collapseitem.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"nut-icon": "../icon/icon"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/collapseitem/collapseitem.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/collapseitem/collapseitem.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{o}}" style="{{p}}"><view class="{{['nut-collapse-item__title', j]}}" bindtap="{{k}}"><view class="nut-collapse-item__title-main"><view class="nut-collapse-item__title-main-value"><slot wx:if="{{a}}" name="title"/><block wx:else><rich-text class="nut-collapse-item__title-mtitle" nodes="{{b}}"/></block><view wx:if="{{c}}" class="nut-collapse-item__title-label">{{d}}</view></view></view><view wx:if="{{e}}" class="nut-collapse-item__title-sub"><slot name="value"/></view><rich-text wx:else class="nut-collapse-item__title-sub" nodes="{{f}}"/><view class="{{['nut-collapse-item__title-icon', h]}}" style="{{'transform:' + i}}"><block wx:if="{{$slots.icon}}"><slot name="icon"></slot></block><block wx:else><nut-icon wx:if="{{g}}" u-i="64749f4c-0" bind:__l="__l" u-p="{{g}}"/></block></view></view><view wx:if="{{l}}" class="nut-collapse__item-extraWrapper"><view class="nut-collapse__item-extraWrapper__extraRender"><slot name="extra"/></view></view><view class="nut-collapse__item-wrapper" style="{{'will-change:' + 'height' + ';' + ('height:' + n)}}"><view id="{{m}}" class="nut-collapse__item-wrapper__content"><slot/></view></view></view>
|
||||
181
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/collapseitem/collapseitem.wxss
vendored
Normal file
181
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/collapseitem/collapseitem.wxss
vendored
Normal file
@@ -0,0 +1,181 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.nut-theme-dark .nut-collapse-item .nut-collapse-item__title {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
background: var(--nut-dark-background, #131313);
|
||||
box-shadow: none;
|
||||
}
|
||||
.nut-theme-dark .nut-collapse-item .nut-collapse-item__title--disabled {
|
||||
color: var(--nut-dark-color-gray, var(--nut-text-color, #808080));
|
||||
}
|
||||
.nut-theme-dark .nut-collapse-item .nut-collapse-item__title--disabled .collapse-icon {
|
||||
color: var(--nut-dark-color-gray, var(--nut-text-color, #808080));
|
||||
}
|
||||
.nut-theme-dark .nut-collapse-item .nut-collapse__item-wrapper .collapse-content,
|
||||
.nut-theme-dark .nut-collapse-item .nut-collapse__item-wrapper .nut-collapse__item-wrapper__content,
|
||||
.nut-theme-dark .nut-collapse-item .nut-collapse__item-wrapper .nut-collapse__item-extraWrapper__extraRender {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
background: var(--nut-dark-background2, #1b1b1b);
|
||||
}
|
||||
.nut-theme-dark .nut-collapse-item .nut-collapse__item-extraWrapper .nut-collapse__item-extraWrapper__extraRender,
|
||||
.nut-theme-dark .nut-collapse-item .nut-collapse__item-extraWrapper .nut-collapse__item-wrapper__content {
|
||||
background: var(--nut-dark-background2, #1b1b1b);
|
||||
}
|
||||
.nut-collapse-item__border .nut-collapse-item__title::after {
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
bottom: 0;
|
||||
left: 16px;
|
||||
box-sizing: border-box;
|
||||
pointer-events: none;
|
||||
content: "";
|
||||
border-bottom: 1px solid #ebedf0;
|
||||
transform: scaleY(0.5);
|
||||
}
|
||||
.nut-collapse-item {
|
||||
position: relative;
|
||||
}
|
||||
.nut-collapse-item .nut-collapse-item__title {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
padding: var(--nut-collapse-item-padding, 13px 36px 13px 26px);
|
||||
overflow: hidden;
|
||||
font-size: var(--nut-collapse-item-font-size, var(--nut-font-size-2, 14px));
|
||||
line-height: var(--nut-collapse-item-line-height, 24px);
|
||||
color: var(--nut-collapse-item-color, #666);
|
||||
background-color: #fff;
|
||||
}
|
||||
.nut-collapse-item .nut-collapse-item__title .nut-collapse-item__title-main {
|
||||
flex: 1;
|
||||
}
|
||||
.nut-collapse-item .nut-collapse-item__title .nut-collapse-item__title-main-value {
|
||||
display: block;
|
||||
}
|
||||
.nut-collapse-item .nut-collapse-item__title .nut-collapse-item__title-main-value .nut-collapse-item__title-main-icon {
|
||||
top: 2px;
|
||||
}
|
||||
.nut-collapse-item .nut-collapse-item__title .nut-collapse-item__title-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: var(--nut-collapse-item-icon-color, #666);
|
||||
transition: transform 0.3s;
|
||||
}
|
||||
.nut-collapse-item .nut-collapse-item__title .nut-collapse-item__title-icon--expanded {
|
||||
transform: rotate(-180deg);
|
||||
}
|
||||
.nut-collapse-item .nut-collapse-item__title .nut-collapse-item__title-sub {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 65px;
|
||||
margin-top: -12px;
|
||||
color: var(--nut-collapse-item-sub-title-color, #666);
|
||||
}
|
||||
.nut-collapse-item .nut-collapse-item__title .nut-collapse-item__title-label {
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
color: #969799;
|
||||
}
|
||||
.nut-collapse-item .nut-collapse__item-wrapper,
|
||||
.nut-collapse-item .nut-collapse__item-extraWrapper {
|
||||
position: relative;
|
||||
display: block;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
transition: height 0.3s ease-in-out;
|
||||
}
|
||||
.nut-collapse-item .nut-collapse__item-wrapper .nut-collapse__item-wrapper__content,
|
||||
.nut-collapse-item .nut-collapse__item-wrapper .nut-collapse__item-extraWrapper__extraRender,
|
||||
.nut-collapse-item .nut-collapse__item-extraWrapper .nut-collapse__item-wrapper__content,
|
||||
.nut-collapse-item .nut-collapse__item-extraWrapper .nut-collapse__item-extraWrapper__extraRender {
|
||||
display: block;
|
||||
padding: var(--nut-collapse-wrapper-content-padding, 12px 26px);
|
||||
font-size: var(--nut-collapse-wrapper-content-font-size, var(--nut-font-size-2, 14px));
|
||||
line-height: var(--nut-collapse-wrapper-content-line-height, 1.5);
|
||||
color: var(--nut-collapse-wrapper-content-color, #666);
|
||||
background-color: var(--nut-collapse-wrapper-content-background-color, var(--nut-white, #fff));
|
||||
}
|
||||
.nut-collapse-item .nut-collapse__item-wrapper .nut-collapse__item-wrapper__content--empty,
|
||||
.nut-collapse-item .nut-collapse__item-extraWrapper .nut-collapse__item-wrapper__content--empty {
|
||||
padding: var(--nut-collapse-wrapper-empty-content-padding, 0 26px);
|
||||
}
|
||||
.nut-collapse-item .nut-collapse__item-extraWrapper {
|
||||
height: auto;
|
||||
}
|
||||
.nut-collapse-item .nut-collapse__item-extraWrapper .nut-collapse__item-extraWrapper__extraRender {
|
||||
overflow: hidden;
|
||||
word-break: break-all;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
.nut-collapse-item .open-style {
|
||||
height: auto;
|
||||
will-change: height;
|
||||
}
|
||||
.nut-collapse-item .close-style {
|
||||
will-change: auto;
|
||||
}
|
||||
.nut-collapse-item .nut-collapse-item__title--disabled {
|
||||
color: var(--nut-collapse-item-disabled-color, #c8c9cc);
|
||||
pointer-events: none;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.nut-collapse-item .nut-collapse-item__title--disabled .collapse-icon {
|
||||
color: var(--nut-collapse-item-disabled-color, #c8c9cc);
|
||||
}
|
||||
.nut-collapse-item .nut-collapse-item__title-mtitle {
|
||||
display: inline-block;
|
||||
}
|
||||
.collapse-border-none .nut-collapse-item__title::after {
|
||||
display: none;
|
||||
}
|
||||
189
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/dialog/dialog.js
vendored
Normal file
189
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/dialog/dialog.js
vendored
Normal file
@@ -0,0 +1,189 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
||||
require("../../locale/locale.js");
|
||||
const uni_modules_nutuiUni_locale_useTranslate = require("../../locale/useTranslate.js");
|
||||
const uni_modules_nutuiUni_components__constants_event = require("../_constants/event.js");
|
||||
const uni_modules_nutuiUni_components__utils_is = require("../_utils/is.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const popup = require("../../../../popup.js");
|
||||
const uni_modules_nutuiUni_components_dialog_useDialog = require("./use-dialog.js");
|
||||
const dialogProps = {
|
||||
...popup.popupProps,
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 点击蒙层是否关闭对话框
|
||||
*/
|
||||
closeOnClickOverlay: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 标题
|
||||
*/
|
||||
title: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
||||
/**
|
||||
* @description 内容,支持 HTML
|
||||
*/
|
||||
content: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
||||
/**
|
||||
* @description 是否隐藏底部按钮栏
|
||||
*/
|
||||
noFooter: Boolean,
|
||||
/**
|
||||
* @description 是否隐藏确定按钮
|
||||
*/
|
||||
noOkBtn: Boolean,
|
||||
/**
|
||||
* @description 是否隐藏取消按钮
|
||||
*/
|
||||
noCancelBtn: Boolean,
|
||||
/**
|
||||
* @description 取消按钮文案
|
||||
*/
|
||||
cancelText: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
||||
/**
|
||||
* @description 确定按钮文案
|
||||
*/
|
||||
okText: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
||||
/**
|
||||
* @description 确认按钮是否默认关闭弹窗
|
||||
*/
|
||||
okAutoClose: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 取消按钮是否默认关闭弹窗
|
||||
*/
|
||||
cancelAutoClose: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 文字对齐方向,可选值同 css 的 text-align
|
||||
*/
|
||||
textAlign: uni_modules_nutuiUni_components__utils_props.makeStringProp("center"),
|
||||
/**
|
||||
* @description 是否在页面回退时自动关闭
|
||||
*/
|
||||
closeOnPopstate: Boolean,
|
||||
/**
|
||||
* @description 使用横纵方向,可选值`horizontal`、`vertical`
|
||||
*/
|
||||
footerDirection: uni_modules_nutuiUni_components__utils_props.makeStringProp("horizontal"),
|
||||
/**
|
||||
* @description 自定义类名
|
||||
*/
|
||||
customClass: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
||||
/**
|
||||
* @description 自定义 popup 弹框样式
|
||||
*/
|
||||
popStyle: {
|
||||
type: Object
|
||||
},
|
||||
/**
|
||||
* @description 是否在页面回退时自动关闭
|
||||
*/
|
||||
beforeClose: Function
|
||||
};
|
||||
const dialogEmits = {
|
||||
update: (val) => uni_modules_nutuiUni_components__utils_is.isBoolean(val),
|
||||
[uni_modules_nutuiUni_components__constants_event.UPDATE_VISIBLE_EVENT]: (val) => uni_modules_nutuiUni_components__utils_is.isBoolean(val),
|
||||
ok: () => true,
|
||||
[uni_modules_nutuiUni_components__constants_event.CANCEL_EVENT]: () => true,
|
||||
[uni_modules_nutuiUni_components__constants_event.OPENED_EVENT]: () => true,
|
||||
[uni_modules_nutuiUni_components__constants_event.CLOSED_EVENT]: () => true
|
||||
};
|
||||
if (!Math) {
|
||||
(NutButton + NutPopup)();
|
||||
}
|
||||
const NutButton = () => "../button/button.js";
|
||||
const NutPopup = () => "../popup/popup.js";
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-dialog`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
inheritAttrs: false,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const { translate } = uni_modules_nutuiUni_locale_useTranslate.useTranslate(componentName);
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: dialogProps,
|
||||
emits: dialogEmits,
|
||||
setup(__props, { expose: __expose, emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const {
|
||||
contentStyle,
|
||||
showPopup,
|
||||
onClickOverlay,
|
||||
onCancel,
|
||||
onOk,
|
||||
classes,
|
||||
closed,
|
||||
dialogStatus,
|
||||
showDialog
|
||||
} = uni_modules_nutuiUni_components_dialog_useDialog.useDialog(props, emit);
|
||||
__expose({ showDialog, onOk, onCancel });
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: _ctx.$slots.header || common_vendor.unref(dialogStatus).title
|
||||
}, _ctx.$slots.header || common_vendor.unref(dialogStatus).title ? common_vendor.e({
|
||||
b: _ctx.$slots.header
|
||||
}, _ctx.$slots.header ? {} : {
|
||||
c: common_vendor.t(common_vendor.unref(dialogStatus).title || props.title)
|
||||
}) : {}, {
|
||||
d: _ctx.$slots.default
|
||||
}, _ctx.$slots.default ? {} : typeof _ctx.content === "string" ? {
|
||||
f: common_vendor.unref(dialogStatus).content || props.content
|
||||
} : {}, {
|
||||
e: typeof _ctx.content === "string",
|
||||
g: common_vendor.s(common_vendor.unref(contentStyle)),
|
||||
h: !common_vendor.unref(dialogStatus).noFooter
|
||||
}, !common_vendor.unref(dialogStatus).noFooter ? common_vendor.e({
|
||||
i: _ctx.$slots.footer
|
||||
}, _ctx.$slots.footer ? {} : common_vendor.e({
|
||||
j: !common_vendor.unref(dialogStatus).noCancelBtn
|
||||
}, !common_vendor.unref(dialogStatus).noCancelBtn ? {
|
||||
k: common_vendor.t(common_vendor.unref(dialogStatus).cancelText || props.cancelText || common_vendor.unref(translate)("cancel")),
|
||||
l: common_vendor.o(common_vendor.unref(onCancel)),
|
||||
m: common_vendor.p({
|
||||
size: "small",
|
||||
plain: true,
|
||||
type: "primary",
|
||||
["custom-class"]: "nut-dialog__footer-cancel"
|
||||
})
|
||||
} : {}, {
|
||||
n: !common_vendor.unref(dialogStatus).noOkBtn
|
||||
}, !common_vendor.unref(dialogStatus).noOkBtn ? {
|
||||
o: common_vendor.t(common_vendor.unref(dialogStatus).okText || props.okText || common_vendor.unref(translate)("confirm")),
|
||||
p: common_vendor.o(common_vendor.unref(onOk)),
|
||||
q: common_vendor.p({
|
||||
size: "small",
|
||||
type: "primary",
|
||||
["custom-class"]: "nut-dialog__footer-ok"
|
||||
})
|
||||
} : {}), {
|
||||
r: _ctx.footerDirection,
|
||||
s: common_vendor.unref(dialogStatus).footerDirection ? 1 : ""
|
||||
}) : {}, {
|
||||
t: common_vendor.n(common_vendor.unref(classes)),
|
||||
v: common_vendor.s(_ctx.customStyle),
|
||||
w: common_vendor.o(common_vendor.unref(onClickOverlay)),
|
||||
x: common_vendor.o(common_vendor.unref(closed)),
|
||||
y: common_vendor.o(($event) => common_vendor.isRef(showPopup) ? showPopup.value = $event : null),
|
||||
z: common_vendor.p({
|
||||
["close-on-click-overlay"]: false,
|
||||
["lock-scroll"]: _ctx.lockScroll,
|
||||
["pop-class"]: _ctx.popClass,
|
||||
["overlay-class"]: _ctx.overlayClass,
|
||||
["overlay-style"]: _ctx.overlayStyle,
|
||||
["custom-style"]: _ctx.popStyle,
|
||||
["z-index"]: _ctx.zIndex,
|
||||
round: true,
|
||||
transition: _ctx.transition,
|
||||
visible: common_vendor.unref(showPopup)
|
||||
})
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/dialog/dialog.js.map
|
||||
7
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/dialog/dialog.json
vendored
Normal file
7
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/dialog/dialog.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"nut-button": "../button/button",
|
||||
"nut-popup": "../popup/popup"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/dialog/dialog.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/dialog/dialog.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<nut-popup wx:if="{{z}}" u-s="{{['d']}}" bindclickOverlay="{{w}}" bindclickCloseIcon="{{x}}" u-i="32f55b1a-0" bind:__l="__l" bindupdateVisible="{{y}}" u-p="{{z}}"><view class="{{t}}" style="{{v}}"><view wx:if="{{a}}" class="nut-dialog__header"><slot wx:if="{{b}}" name="header"/><block wx:else>{{c}}</block></view><view class="nut-dialog__content" style="{{g}}"><slot wx:if="{{d}}"/><rich-text wx:elif="{{e}}" nodes="{{f}}"/></view><view wx:if="{{h}}" class="{{['nut-dialog__footer', s && r]}}"><slot wx:if="{{i}}" name="footer"/><block wx:else><nut-button wx:if="{{j}}" u-s="{{['d']}}" bindclick="{{l}}" u-i="32f55b1a-1,32f55b1a-0" bind:__l="__l" u-p="{{m}}">{{k}}</nut-button><nut-button wx:if="{{n}}" u-s="{{['d']}}" bindclick="{{p}}" u-i="32f55b1a-2,32f55b1a-0" bind:__l="__l" u-p="{{q}}">{{o}}</nut-button></block></view></view></nut-popup>
|
||||
468
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/dialog/dialog.wxss
vendored
Normal file
468
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/dialog/dialog.wxss
vendored
Normal file
@@ -0,0 +1,468 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.nut-theme-dark .nut-button--default {
|
||||
color: var(--nut-dark-color3, rgba(232, 230, 227, 0.8));
|
||||
background: var(--nut-dark-background2, #1b1b1b);
|
||||
border: var(--nut-button-border-width, 1px) solid var(--nut-dark-background2, #1b1b1b);
|
||||
}
|
||||
.nut-theme-dark .nut-button--plain {
|
||||
background: var(--nut-dark-background2, #1b1b1b);
|
||||
}
|
||||
.nut-theme-dark .nut-button:not(.nut-button--hovercls) .nut-button--plain:not([disabled]):active {
|
||||
background: var(--nut-dark-background2, #1b1b1b);
|
||||
}
|
||||
.nut-theme-dark .nut-button:not(.nut-button--hovercls) .nut-button--default:not([disabled]):active {
|
||||
color: var(--nut-dark-color3, rgba(232, 230, 227, 0.8));
|
||||
background: var(--nut-dark-background2, #1b1b1b);
|
||||
border: var(--nut-button-border-width, 1px) solid var(--nut-dark-background2, #1b1b1b);
|
||||
}
|
||||
.nut-button {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
display: inline-block;
|
||||
flex-shrink: 0;
|
||||
width: auto;
|
||||
height: var(--nut-button-default-height, 38px);
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-size: var(--nut-button-default-font-size, var(--nut-font-size-2, 14px));
|
||||
line-height: var(--nut-button-default-line-height, 36px);
|
||||
text-align: center;
|
||||
vertical-align: bottom;
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
touch-action: manipulation;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
transition: opacity 0.2s;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
.nut-button .nut-button__text {
|
||||
margin-left: 5px;
|
||||
}
|
||||
.nut-button::before {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
content: "";
|
||||
background-color: var(--nut-black, #000);
|
||||
border: inherit;
|
||||
border-color: var(--nut-black, #000);
|
||||
border-radius: inherit;
|
||||
opacity: 0;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
.nut-button::after {
|
||||
display: none;
|
||||
}
|
||||
.nut-button:not(.nut-button--hovercls):active::before {
|
||||
opacity: 0.1;
|
||||
}
|
||||
.nut-button__wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.nut-button--loading::before, .nut-button--disabled::before {
|
||||
display: none;
|
||||
}
|
||||
.nut-button--default {
|
||||
color: var(--nut-button-default-color, #666666);
|
||||
background: var(--nut-button-default-bg-color, var(--nut-white, #fff));
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid var(--nut-button-default-border-color, #cccccc);
|
||||
}
|
||||
.nut-button--primary {
|
||||
color: var(--nut-button-primary-color, var(--nut-white, #fff));
|
||||
background: var(--nut-button-primary-background-color, linear-gradient(135deg, var(--nut-primary-color, var(--nut-primary-color, #fa2c19)) 0%, var(--nut-primary-color, var(--nut-primary-color, #fa2c19)) 100%));
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid transparent;
|
||||
}
|
||||
.nut-button--info {
|
||||
color: var(--nut-button-info-color, var(--nut-white, #fff));
|
||||
background: var(--nut-button-info-background-color, linear-gradient(315deg, #498ff2 0%, #4965f2 100%));
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid transparent;
|
||||
}
|
||||
.nut-button--success {
|
||||
color: var(--nut-button-success-color, var(--nut-white, #fff));
|
||||
background: var(--nut-button-success-background-color, linear-gradient(135deg, #26bf26 0%, #27c530 45%, #28cf3f 83%, #29d446 100%));
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid transparent;
|
||||
}
|
||||
.nut-button--danger {
|
||||
color: var(--nut-button-danger-color, var(--nut-white, #fff));
|
||||
background: var(--nut-button-danger-background-color, #fa2c19);
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid transparent;
|
||||
}
|
||||
.nut-button--warning {
|
||||
color: var(--nut-button-warning-color, var(--nut-white, #fff));
|
||||
background: var(--nut-button-warning-background-color, linear-gradient(135deg, #ff9e0d 0%, #ffa70d 45%, #ffb60d 83%, #ffbe0d 100%));
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid transparent;
|
||||
}
|
||||
.nut-button--plain {
|
||||
background: var(--nut-button-plain-background-color, var(--nut-white, #fff));
|
||||
background-origin: border-box;
|
||||
}
|
||||
.nut-button--plain.nut-button--primary {
|
||||
color: var(--nut-button-primary-border-color, var(--nut-primary-color, #fa2c19));
|
||||
border-color: var(--nut-button-primary-border-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-button--plain.nut-button--info {
|
||||
color: var(--nut-button-info-border-color, #496af2);
|
||||
border-color: var(--nut-button-info-border-color, #496af2);
|
||||
}
|
||||
.nut-button--plain.nut-button--success {
|
||||
color: var(--nut-button-success-border-color, #26bf26);
|
||||
border-color: var(--nut-button-success-border-color, #26bf26);
|
||||
}
|
||||
.nut-button--plain.nut-button--danger {
|
||||
color: var(--nut-button-danger-border-color, #fa2c19);
|
||||
border-color: var(--nut-button-danger-border-color, #fa2c19);
|
||||
}
|
||||
.nut-button--plain.nut-button--warning {
|
||||
color: var(--nut-button-warning-border-color, #ff9e0d);
|
||||
border-color: var(--nut-button-warning-border-color, #ff9e0d);
|
||||
}
|
||||
.nut-button--plain:not(.nut-button--hovercls).nut-button--primary:not([disabled]):active {
|
||||
color: var(--nut-button-primary-border-color, var(--nut-primary-color, #fa2c19));
|
||||
border-color: var(--nut-button-primary-border-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-button--plain:not(.nut-button--hovercls).nut-button--info:not([disabled]):active {
|
||||
color: var(--nut-button-info-border-color, #496af2);
|
||||
border-color: var(--nut-button-info-border-color, #496af2);
|
||||
}
|
||||
.nut-button--plain:not(.nut-button--hovercls).nut-button--success:not([disabled]):active {
|
||||
color: var(--nut-button-success-border-color, #26bf26);
|
||||
border-color: var(--nut-button-success-border-color, #26bf26);
|
||||
}
|
||||
.nut-button--plain:not(.nut-button--hovercls).nut-button--danger:not([disabled]):active {
|
||||
color: var(--nut-button-danger-border-color, #fa2c19);
|
||||
border-color: var(--nut-button-danger-border-color, #fa2c19);
|
||||
}
|
||||
.nut-button--plain:not(.nut-button--hovercls).nut-button--warning:not([disabled]):active {
|
||||
color: var(--nut-button-warning-border-color, #ff9e0d);
|
||||
border-color: var(--nut-button-warning-border-color, #ff9e0d);
|
||||
}
|
||||
.nut-button--large {
|
||||
width: 100%;
|
||||
height: var(--nut-button-large-height, 48px);
|
||||
font-size: var(--nut-button-large-font-size, var(--nut-button-default-font-size, var(--nut-font-size-2, 14px)));
|
||||
line-height: var(--nut-button-large-line-height, 46px);
|
||||
}
|
||||
.nut-button--normal {
|
||||
padding: var(--nut-button-default-padding, 0 18px);
|
||||
font-size: var(--nut-button-default-font-size, var(--nut-font-size-2, 14px));
|
||||
}
|
||||
.nut-button--small {
|
||||
height: var(--nut-button-small-height, 28px);
|
||||
padding: var(--nut-button-small-padding, 0 12px);
|
||||
font-size: var(--nut-button-small-font-size, var(--nut-font-size-1, 12px));
|
||||
line-height: var(--nut-button-small-line-height, 26px);
|
||||
}
|
||||
.nut-button--small.nut-button--round {
|
||||
border-radius: var(--nut-button-small-round-border-radius, var(--nut-button-border-radius, 25px));
|
||||
}
|
||||
.nut-button--mini {
|
||||
height: var(--nut-button-mini-height, 24px);
|
||||
padding: var(--nut-button-mini-padding, 0 12px);
|
||||
font-size: var(--nut-button-mini-font-size, var(--nut-font-size-1, 12px));
|
||||
line-height: var(--nut-button-mini-line-height, 1.2);
|
||||
}
|
||||
.nut-button--block {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
.nut-button--disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: var(--nut-button-disabled-opacity, 0.68);
|
||||
}
|
||||
.nut-button--loading {
|
||||
cursor: default;
|
||||
opacity: 0.9;
|
||||
}
|
||||
.nut-button--round {
|
||||
border-radius: var(--nut-button-border-radius, 25px);
|
||||
}
|
||||
.nut-button--square {
|
||||
border-radius: 0;
|
||||
}
|
||||
.nut-button:not(.nut-button--hovercls) .nut-button--default:not([disabled]):active {
|
||||
color: var(--nut-button-default-color, #666666);
|
||||
background: var(--nut-button-default-bg-color, var(--nut-white, #fff));
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid var(--nut-button-default-border-color, #cccccc);
|
||||
}
|
||||
.nut-button:not(.nut-button--hovercls) .nut-button--primary:not([disabled]):active {
|
||||
color: var(--nut-button-primary-color, var(--nut-white, #fff));
|
||||
background: var(--nut-button-primary-background-color, linear-gradient(135deg, var(--nut-primary-color, var(--nut-primary-color, #fa2c19)) 0%, var(--nut-primary-color, var(--nut-primary-color, #fa2c19)) 100%));
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid transparent;
|
||||
}
|
||||
.nut-button:not(.nut-button--hovercls) .nut-button--info:not([disabled]):active {
|
||||
color: var(--nut-button-info-color, var(--nut-white, #fff));
|
||||
background: var(--nut-button-info-background-color, linear-gradient(315deg, #498ff2 0%, #4965f2 100%));
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid transparent;
|
||||
}
|
||||
.nut-button:not(.nut-button--hovercls) .nut-button--success:not([disabled]):active {
|
||||
color: var(--nut-button-success-color, var(--nut-white, #fff));
|
||||
background: var(--nut-button-success-background-color, linear-gradient(135deg, #26bf26 0%, #27c530 45%, #28cf3f 83%, #29d446 100%));
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid transparent;
|
||||
}
|
||||
.nut-button:not(.nut-button--hovercls) .nut-button--danger:not([disabled]):active {
|
||||
color: var(--nut-button-danger-color, var(--nut-white, #fff));
|
||||
background: var(--nut-button-danger-background-color, #fa2c19);
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid transparent;
|
||||
}
|
||||
.nut-button:not(.nut-button--hovercls) .nut-button--warning:not([disabled]):active {
|
||||
color: var(--nut-button-warning-color, var(--nut-white, #fff));
|
||||
background: var(--nut-button-warning-background-color, linear-gradient(135deg, #ff9e0d 0%, #ffa70d 45%, #ffb60d 83%, #ffbe0d 100%));
|
||||
background-origin: border-box;
|
||||
border: var(--nut-button-border-width, 1px) solid transparent;
|
||||
}
|
||||
.nut-button:not(.nut-button--hovercls) .nut-button--plain:not([disabled]):active {
|
||||
background: var(--nut-button-plain-background-color, var(--nut-white, #fff));
|
||||
background-origin: border-box;
|
||||
}
|
||||
.nut-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: var(--nut-overlay-bg-color, rgba(0, 0, 0, 0.7));
|
||||
}
|
||||
.nut-overflow-hidden {
|
||||
overflow: hidden !important;
|
||||
}
|
||||
.nut-theme-dark .nut-popup {
|
||||
background: var(--nut-dark-background2, #1b1b1b);
|
||||
}
|
||||
.nut-theme-dark .nut-popup__close-icon {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
}
|
||||
.nut-popup-slide-center-enter-active, .nut-popup-slide-center-leave-active {
|
||||
transition-timing-function: ease;
|
||||
transition-property: opacity;
|
||||
}
|
||||
.nut-popup-slide-center-enter-from, .nut-popup-slide-center-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
.nut-popup-slide-top-enter-from, .nut-popup-slide-top-leave-active {
|
||||
transform: translate(0, -100%);
|
||||
}
|
||||
.nut-popup-slide-right-enter-from, .nut-popup-slide-right-leave-active {
|
||||
transform: translate(100%, 0);
|
||||
}
|
||||
.nut-popup-slide-bottom-enter-from, .nut-popup-slide-bottom-leave-active {
|
||||
transform: translate(0, 100%);
|
||||
}
|
||||
.nut-popup-slide-left-enter-from, .nut-popup-slide-left-leave-active {
|
||||
transform: translate(-100%, 0);
|
||||
}
|
||||
.nut-popup--center {
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
.nut-popup--center.round {
|
||||
border-radius: var(--nut-popup-border-radius, 20px);
|
||||
}
|
||||
.nut-popup--bottom {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.nut-popup--bottom.round {
|
||||
border-radius: var(--nut-popup-border-radius, 20px) var(--nut-popup-border-radius, 20px) 0 0;
|
||||
}
|
||||
.nut-popup--bottom--safebottom {
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
.nut-popup--right {
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
.nut-popup--right.round {
|
||||
border-radius: var(--nut-popup-border-radius, 20px) 0 0 var(--nut-popup-border-radius, 20px);
|
||||
}
|
||||
.nut-popup--left {
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
.nut-popup--left.round {
|
||||
border-radius: 0 var(--nut-popup-border-radius, 20px) var(--nut-popup-border-radius, 20px) 0;
|
||||
}
|
||||
.nut-popup--top {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.nut-popup--top.round {
|
||||
border-radius: 0 0 var(--nut-popup-border-radius, 20px) var(--nut-popup-border-radius, 20px);
|
||||
}
|
||||
.nut-popup--top--safetop {
|
||||
padding-top: var(--status-bar-height);
|
||||
padding-top: constant(safe-area-inset-top);
|
||||
padding-top: env(safe-area-inset-top);
|
||||
}
|
||||
.nut-popup {
|
||||
position: fixed;
|
||||
max-height: 100%;
|
||||
overflow-y: auto;
|
||||
background-color: var(--nut-white, #fff);
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.nut-popup__close-icon {
|
||||
position: absolute !important;
|
||||
z-index: 1;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
font-size: 18px;
|
||||
line-height: 30px;
|
||||
color: #969799;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
.nut-popup__close-icon:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
.nut-popup__close-icon--top-left {
|
||||
top: var(--nut-popup-close-icon-margin, 16px);
|
||||
left: var(--nut-popup-close-icon-margin, 16px);
|
||||
}
|
||||
.nut-popup__close-icon--top-right {
|
||||
top: var(--nut-popup-close-icon-margin, 16px);
|
||||
right: var(--nut-popup-close-icon-margin, 16px);
|
||||
}
|
||||
.nut-popup__close-icon--bottom-left {
|
||||
bottom: var(--nut-popup-close-icon-margin, 16px);
|
||||
left: var(--nut-popup-close-icon-margin, 16px);
|
||||
}
|
||||
.nut-popup__close-icon--bottom-right {
|
||||
right: var(--nut-popup-close-icon-margin, 16px);
|
||||
bottom: var(--nut-popup-close-icon-margin, 16px);
|
||||
}
|
||||
.nut-theme-dark .nut-dialog__header {
|
||||
color: var(--nut-dark-color3, rgba(232, 230, 227, 0.8));
|
||||
}
|
||||
.nut-dialog {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: var(--nut-dialog-width, 296px);
|
||||
min-height: 156px;
|
||||
padding: 28px 24px 16px;
|
||||
}
|
||||
.nut-dialog__header {
|
||||
display: block;
|
||||
height: 20px;
|
||||
font-size: 16px;
|
||||
font-weight: var(--nut-dialog-header-font-weight, normal);
|
||||
color: var(--nut-dialog-header-color, #262626);
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.nut-dialog__content {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
max-height: 268px;
|
||||
margin: 20px 0;
|
||||
overflow: auto;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
color: var(--nut-text-color, #808080);
|
||||
word-break: break-all;
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
.nut-dialog__footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: var(--nut-dialog-footer-justify-content, space-around);
|
||||
width: 100%;
|
||||
}
|
||||
.nut-dialog__footer.vertical {
|
||||
flex-direction: column;
|
||||
}
|
||||
.nut-dialog__footer.vertical .nut-button {
|
||||
min-width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
.nut-dialog__footer.vertical .nut-button.nut-dialog__footer-cancel {
|
||||
border: 0;
|
||||
}
|
||||
.nut-dialog__footer.vertical .nut-button.nut-dialog__footer-ok {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.nut-dialog__footer .nut-button {
|
||||
min-width: 100px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.nut-dialog__footer-ok {
|
||||
max-width: 128px;
|
||||
}
|
||||
106
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/dialog/use-dialog.js
vendored
Normal file
106
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/dialog/use-dialog.js
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_nutuiUni_components__constants_event = require("../_constants/event.js");
|
||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_interceptor = require("../_utils/interceptor.js");
|
||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-dialog`;
|
||||
function useDialog(props, emit) {
|
||||
const showPopup = common_vendor.ref(props.visible);
|
||||
const dialogStatus = common_vendor.ref({
|
||||
title: props.title,
|
||||
content: props.content,
|
||||
cancelText: props.cancelText,
|
||||
okText: props.okText,
|
||||
textAlign: props.textAlign,
|
||||
footerDirection: props.footerDirection,
|
||||
noFooter: props.noFooter,
|
||||
noOkBtn: props.noOkBtn,
|
||||
noCancelBtn: props.noCancelBtn,
|
||||
transition: props.transition,
|
||||
closeOnClickOverlay: props.closeOnClickOverlay,
|
||||
okAutoClose: props.okAutoClose
|
||||
});
|
||||
common_vendor.watch(() => props.title, (title) => dialogStatus.value.title = title);
|
||||
const showDialog = (options) => {
|
||||
dialogStatus.value = {
|
||||
title: options.title || props.title,
|
||||
content: options.content || props.content,
|
||||
cancelText: options.cancelText || props.cancelText,
|
||||
okText: options.okText || props.okText,
|
||||
okAutoClose: options.okAutoClose || props.okAutoClose,
|
||||
textAlign: options.textAlign || props.textAlign,
|
||||
footerDirection: options.footerDirection || props.footerDirection,
|
||||
noFooter: options.noFooter || props.noFooter,
|
||||
noOkBtn: options.noOkBtn || props.noOkBtn,
|
||||
transition: options.transition || props.transition,
|
||||
noCancelBtn: options.noCancelBtn || props.noCancelBtn,
|
||||
closeOnClickOverlay: options.closeOnClickOverlay || props.closeOnClickOverlay
|
||||
};
|
||||
showPopup.value = true;
|
||||
};
|
||||
common_vendor.onMounted(() => {
|
||||
if (props.closeOnPopstate)
|
||||
;
|
||||
});
|
||||
common_vendor.watch(
|
||||
() => props.visible,
|
||||
(value) => {
|
||||
showPopup.value = value;
|
||||
if (value)
|
||||
emit(uni_modules_nutuiUni_components__constants_event.OPENED_EVENT);
|
||||
}
|
||||
);
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName);
|
||||
});
|
||||
function update(val) {
|
||||
emit("update", val);
|
||||
emit(uni_modules_nutuiUni_components__constants_event.UPDATE_VISIBLE_EVENT, val);
|
||||
}
|
||||
function closed(action) {
|
||||
uni_modules_nutuiUni_components__utils_interceptor.funInterceptor(props.beforeClose, {
|
||||
args: [action],
|
||||
done: () => {
|
||||
showPopup.value = false;
|
||||
update(false);
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CLOSED_EVENT);
|
||||
}
|
||||
});
|
||||
}
|
||||
function onCancel() {
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CANCEL_EVENT);
|
||||
if (props.cancelAutoClose) {
|
||||
showPopup.value = false;
|
||||
closed(uni_modules_nutuiUni_components__constants_event.CANCEL_EVENT);
|
||||
}
|
||||
}
|
||||
function onOk() {
|
||||
emit("ok");
|
||||
if (props.okAutoClose)
|
||||
closed("ok");
|
||||
}
|
||||
function onClickOverlay() {
|
||||
if (props.closeOnClickOverlay)
|
||||
closed("");
|
||||
}
|
||||
const contentStyle = common_vendor.computed(() => {
|
||||
return {
|
||||
textAlign: dialogStatus.value.textAlign
|
||||
};
|
||||
});
|
||||
return {
|
||||
contentStyle,
|
||||
showPopup,
|
||||
onClickOverlay,
|
||||
onCancel,
|
||||
onOk,
|
||||
closed,
|
||||
classes,
|
||||
showDialog,
|
||||
dialogStatus
|
||||
};
|
||||
}
|
||||
exports.useDialog = useDialog;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/dialog/use-dialog.js.map
|
||||
172
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/form/form.js
vendored
Normal file
172
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/form/form.js
vendored
Normal file
@@ -0,0 +1,172 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
||||
const uni_modules_nutuiUni_components__hooks_useProvide = require("../_hooks/useProvide.js");
|
||||
const uni_modules_nutuiUni_components__utils_common = require("../_utils/common.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_is = require("../_utils/is.js");
|
||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
||||
const form = require("../../../../form.js");
|
||||
if (!Math) {
|
||||
NutCellGroup();
|
||||
}
|
||||
const NutCellGroup = () => "../cellgroup/cellgroup.js";
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-form`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: form.formProps,
|
||||
emits: form.formEmits,
|
||||
setup(__props, { expose: __expose, emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
__expose({ reset, submit, validate });
|
||||
const formErrorTip = common_vendor.computed(() => common_vendor.reactive({}));
|
||||
const { internalChildren } = uni_modules_nutuiUni_components__hooks_useProvide.useProvide(
|
||||
form.FORM_KEY,
|
||||
"nut-form-item"
|
||||
)({ props, formErrorTip });
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName);
|
||||
});
|
||||
function clearErrorTips() {
|
||||
Object.keys(formErrorTip.value).forEach((item) => {
|
||||
formErrorTip.value[item] = "";
|
||||
});
|
||||
}
|
||||
function reset() {
|
||||
clearErrorTips();
|
||||
}
|
||||
common_vendor.watch(
|
||||
() => props.modelValue,
|
||||
() => {
|
||||
clearErrorTips();
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
function findFormItem(vnodes) {
|
||||
let task = [];
|
||||
vnodes.forEach((vnode) => {
|
||||
var _a, _b, _c, _d;
|
||||
let type = vnode.type;
|
||||
type = type.name || type;
|
||||
if (type === "nut-form-item" || (type == null ? void 0 : type.toString().endsWith("form-item"))) {
|
||||
task.push({
|
||||
prop: (_a = vnode.props) == null ? void 0 : _a.prop,
|
||||
rules: ((_b = vnode.props) == null ? void 0 : _b.rules) || []
|
||||
});
|
||||
} else if (Array.isArray(vnode.children) && ((_c = vnode.children) == null ? void 0 : _c.length)) {
|
||||
task = task.concat(findFormItem(vnode.children));
|
||||
} else if (uni_modules_nutuiUni_components__utils_is.isObject(vnode.children) && Object.keys(vnode.children)) {
|
||||
if ((_d = vnode.children) == null ? void 0 : _d.default) {
|
||||
vnode.children = vnode.children.default();
|
||||
task = task.concat(findFormItem(vnode.children));
|
||||
}
|
||||
} else if (Array.isArray(vnode)) {
|
||||
task = task.concat(findFormItem(vnode));
|
||||
}
|
||||
});
|
||||
return task;
|
||||
}
|
||||
function tipMessage(errorMsg) {
|
||||
if (errorMsg.message)
|
||||
emit("validate", errorMsg);
|
||||
formErrorTip.value[errorMsg.prop] = errorMsg.message;
|
||||
}
|
||||
async function checkRule(item) {
|
||||
const { rules, prop } = item;
|
||||
const _Promise = (errorMsg) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
tipMessage(errorMsg);
|
||||
resolve(errorMsg);
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
};
|
||||
if (!prop)
|
||||
common_vendor.index.__f__("warn", "at uni_modules/nutui-uni/components/form/form.vue:95", "[NutUI] <FormItem> 使用 rules 校验规则时 , 必须设置 prop 参数");
|
||||
const value = uni_modules_nutuiUni_components__utils_common.getPropByPath(props.modelValue, prop || "");
|
||||
tipMessage({ prop, message: "" });
|
||||
const formRules = props.rules || {};
|
||||
const _rules = [...(formRules == null ? void 0 : formRules[prop]) || [], ...rules];
|
||||
while (_rules.length) {
|
||||
const rule = _rules.shift();
|
||||
const { validator, ...ruleWithoutValidator } = rule;
|
||||
const { required, regex, message } = ruleWithoutValidator;
|
||||
const errorMsg = { prop, message };
|
||||
if (required) {
|
||||
if (Array.isArray(value)) {
|
||||
if (!value.length)
|
||||
return _Promise(errorMsg);
|
||||
} else if (!value && value !== 0) {
|
||||
return _Promise(errorMsg);
|
||||
}
|
||||
}
|
||||
if (regex && !regex.test(String(value)))
|
||||
return _Promise(errorMsg);
|
||||
if (validator) {
|
||||
const result = validator(value, ruleWithoutValidator);
|
||||
if (uni_modules_nutuiUni_components__utils_is.isPromise(result)) {
|
||||
try {
|
||||
const value2 = await result;
|
||||
if (value2 === false)
|
||||
return _Promise(errorMsg);
|
||||
} catch (error) {
|
||||
const validateErrorMsg = { prop, message: error };
|
||||
return _Promise(validateErrorMsg);
|
||||
}
|
||||
} else {
|
||||
if (!result)
|
||||
return _Promise(errorMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
function validate(customProp = "") {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
const task = findFormItem(internalChildren == null ? void 0 : internalChildren.map((child) => child.vnode));
|
||||
const errors = task.map((item) => {
|
||||
if (customProp && customProp !== item.prop)
|
||||
return Promise.resolve(true);
|
||||
return checkRule(item);
|
||||
});
|
||||
Promise.all(errors).then((errorRes) => {
|
||||
errorRes = errorRes.filter((item) => item !== true);
|
||||
const res = { valid: true, errors: [] };
|
||||
if (errorRes.length) {
|
||||
res.valid = false;
|
||||
res.errors = errorRes;
|
||||
}
|
||||
resolve(res);
|
||||
});
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
function submit() {
|
||||
validate();
|
||||
return false;
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.n(classes.value),
|
||||
b: common_vendor.s(_ctx.customStyle),
|
||||
c: common_vendor.o(() => false)
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/form/form.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/form/form.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/form/form.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"nut-cell-group": "../cellgroup/cellgroup"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/form/form.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/form/form.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<form class="{{a}}" style="{{b}}" action="#" catchsubmit="{{c}}"><nut-cell-group u-s="{{['d']}}" u-i="393b87da-0" bind:__l="__l"><slot/></nut-cell-group></form>
|
||||
92
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/form/form.wxss
vendored
Normal file
92
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/form/form.wxss
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.nut-theme-dark .nut-cell-group__wrap {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
background: var(--nut-dark-background3, #141414);
|
||||
box-shadow: none;
|
||||
}
|
||||
.nut-cell-group {
|
||||
display: block;
|
||||
}
|
||||
.nut-cell-group__title {
|
||||
display: inherit;
|
||||
padding: var(--nut-cell-group-title-padding, 0 10px);
|
||||
margin-top: 30px;
|
||||
margin-bottom: 10px;
|
||||
font-size: var(--nut-cell-group-title-font-size, var(--nut-font-size-2, 14px));
|
||||
line-height: var(--nut-cell-group-title-line-height, 20px);
|
||||
color: var(--nut-cell-group-title-color, #909ca4);
|
||||
}
|
||||
.nut-cell-group__desc {
|
||||
display: inherit;
|
||||
padding: var(--nut-cell-group-desc-padding, 0 10px);
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
font-size: var(--nut-cell-group-desc-font-size, var(--nut-font-size-1, 12px));
|
||||
line-height: var(--nut-cell-group-desc-line-height, 16px);
|
||||
color: var(--nut-cell-group-desc-color, #909ca4);
|
||||
}
|
||||
.nut-cell-group__wrap {
|
||||
display: inherit;
|
||||
margin: 10px 0;
|
||||
overflow: hidden;
|
||||
background-color: var(--nut-cell-group-background-color, var(--nut-white, #fff));
|
||||
border-radius: var(--nut-cell-border-radius, 6px);
|
||||
box-shadow: var(--nut-cell-box-shadow, 0 1px 7px 0 #edeef1);
|
||||
}
|
||||
.nut-cell-group__wrap .nut-cell {
|
||||
margin: 0;
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
.nut-cell-group .nut-cell::after {
|
||||
border-bottom: var(--nut-cell-after-border-bottom, 1px solid #f5f6f7);
|
||||
}
|
||||
158
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/formitem/formitem.js
vendored
Normal file
158
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/formitem/formitem.js
vendored
Normal file
@@ -0,0 +1,158 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
||||
const uni_modules_nutuiUni_components__hooks_useInject = require("../_hooks/useInject.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_pxCheck = require("../_utils/pxCheck.js");
|
||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
||||
const form = require("../../../../form.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const formitemProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 是否显示必填字段的标签旁边的红色星号
|
||||
*/
|
||||
required: uni_modules_nutuiUni_components__utils_props.nullableBooleanProp,
|
||||
/**
|
||||
* @description 表单域 `v-model` 字段,在使用表单校验功能的情况下,该属性是必填的
|
||||
*/
|
||||
prop: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
||||
/**
|
||||
* @description
|
||||
*/
|
||||
label: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
||||
/**
|
||||
* @description 定义校验规则
|
||||
*/
|
||||
rules: uni_modules_nutuiUni_components__utils_props.makeArrayProp([]),
|
||||
/**
|
||||
* @description 表单项 `label` 宽度,默认单位为 `px`
|
||||
*/
|
||||
labelWidth: uni_modules_nutuiUni_components__utils_props.makeNumericProp(""),
|
||||
/**
|
||||
* @description 表单项 `label` 对齐方式,可选值为 `center`、`right`
|
||||
*/
|
||||
labelAlign: uni_modules_nutuiUni_components__utils_props.makeStringProp("left"),
|
||||
/**
|
||||
* @description 右侧插槽对齐方式,可选值为 `center`、`right`
|
||||
*/
|
||||
bodyAlign: uni_modules_nutuiUni_components__utils_props.makeStringProp("left"),
|
||||
/**
|
||||
* @description 错误提示文案对齐方式,可选值为 `center`、`right`
|
||||
*/
|
||||
errorMessageAlign: uni_modules_nutuiUni_components__utils_props.makeStringProp("left"),
|
||||
/**
|
||||
* @description 是否在校验不通过时标红输入框
|
||||
*/
|
||||
showErrorLine: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 是否在校验不通过时在输入框下方展示错误提示
|
||||
* @type {boolean}
|
||||
* @default true
|
||||
*/
|
||||
showErrorMessage: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 表单项 label 的位置,优先级高于 form 中的 `label-position`
|
||||
*/
|
||||
labelPosition: uni_modules_nutuiUni_components__utils_props.makeStringProp(void 0),
|
||||
/**
|
||||
* @description 必填表单项 label 的红色星标位置,优先级高于 form 中的 `star-position`
|
||||
*/
|
||||
starPosition: uni_modules_nutuiUni_components__utils_props.makeStringProp(void 0)
|
||||
};
|
||||
if (!Math) {
|
||||
NutCell();
|
||||
}
|
||||
const NutCell = () => "../cell/cell.js";
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-form-item`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
inheritAttrs: false,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: formitemProps,
|
||||
setup(__props) {
|
||||
var _a;
|
||||
const props = __props;
|
||||
const slots = common_vendor.useSlots();
|
||||
const Parent = uni_modules_nutuiUni_components__hooks_useInject.useInject(form.FORM_KEY);
|
||||
const isRequired = common_vendor.computed(() => {
|
||||
var _a2, _b;
|
||||
if (props.required === false)
|
||||
return false;
|
||||
const rules = (_b = (_a2 = Parent.parent) == null ? void 0 : _a2.props) == null ? void 0 : _b.rules;
|
||||
let formRequired = false;
|
||||
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 labelPositionClass = common_vendor.computed(() => {
|
||||
var _a2;
|
||||
const labelPosition = (_a2 = Parent.parent) == null ? void 0 : _a2.props.labelPosition;
|
||||
const position = props.labelPosition ? props.labelPosition : labelPosition;
|
||||
return `nut-form-item__${position}`;
|
||||
});
|
||||
const starPositionClass = common_vendor.computed(() => {
|
||||
var _a2;
|
||||
const starPosition = (_a2 = Parent.parent) == null ? void 0 : _a2.props.starPosition;
|
||||
const position = props.starPosition ? props.starPosition : starPosition;
|
||||
return `nut-form-item__star-${position}`;
|
||||
});
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName);
|
||||
});
|
||||
const labelStyle = common_vendor.computed(() => {
|
||||
return {
|
||||
width: uni_modules_nutuiUni_components__utils_pxCheck.pxCheck(props.labelWidth),
|
||||
textAlign: props.labelAlign
|
||||
};
|
||||
});
|
||||
const bodyStyle = common_vendor.computed(() => {
|
||||
return {
|
||||
textAlign: props.bodyAlign
|
||||
};
|
||||
});
|
||||
const formErrorTip = ((_a = Parent.parent) == null ? void 0 : _a.formErrorTip) || {};
|
||||
const errorMessageStyle = common_vendor.computed(() => {
|
||||
return {
|
||||
textAlign: props.errorMessageAlign
|
||||
};
|
||||
});
|
||||
const getSlots = (name) => slots[name];
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: _ctx.label || getSlots("label")
|
||||
}, _ctx.label || getSlots("label") ? {
|
||||
b: common_vendor.t(_ctx.label),
|
||||
c: common_vendor.s(labelStyle.value),
|
||||
d: isRequired.value ? 1 : "",
|
||||
e: starPositionClass.value,
|
||||
f: starPositionClass.value ? 1 : ""
|
||||
} : {}, {
|
||||
g: common_vendor.s(bodyStyle.value),
|
||||
h: common_vendor.unref(formErrorTip)[_ctx.prop] && _ctx.showErrorMessage
|
||||
}, common_vendor.unref(formErrorTip)[_ctx.prop] && _ctx.showErrorMessage ? {
|
||||
i: common_vendor.t(common_vendor.unref(formErrorTip)[_ctx.prop]),
|
||||
j: common_vendor.s(errorMessageStyle.value)
|
||||
} : {}, {
|
||||
k: common_vendor.p({
|
||||
["custom-class"]: [{
|
||||
error: common_vendor.unref(formErrorTip)[_ctx.prop],
|
||||
line: _ctx.showErrorLine
|
||||
}, classes.value, labelPositionClass.value],
|
||||
["custom-style"]: _ctx.customStyle
|
||||
})
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/formitem/formitem.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/formitem/formitem.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/formitem/formitem.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"nut-cell": "../cell/cell"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/formitem/formitem.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/formitem/formitem.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<nut-cell wx:if="{{k}}" u-s="{{['d']}}" u-i="8840a68c-0" bind:__l="__l" u-p="{{k}}"><view wx:if="{{a}}" style="{{c}}" class="{{['nut-cell__title', 'nut-form-item__label', d && 'required', f && e]}}"><block wx:if="{{$slots.label}}"><slot name="label"></slot></block><block wx:else>{{b}}</block></view><view class="nut-cell__value nut-form-item__body"><view class="nut-form-item__body__slots" style="{{g}}"><slot/></view><view wx:if="{{h}}" class="nut-form-item__body__tips" style="{{j}}">{{i}}</view></view></nut-cell>
|
||||
234
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/formitem/formitem.wxss
vendored
Normal file
234
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/formitem/formitem.wxss
vendored
Normal file
@@ -0,0 +1,234 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.nut-theme-dark .nut-cell {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
background: var(--nut-dark-background2, #1b1b1b);
|
||||
box-shadow: none;
|
||||
}
|
||||
.nut-cell {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
padding: var(--nut-cell-padding, 13px 16px);
|
||||
margin: 10px 0;
|
||||
font-size: var(--nut-cell-title-font, var(--nut-font-size-2, 14px));
|
||||
line-height: var(--nut-cell-line-height, 20px);
|
||||
color: var(--nut-cell-color, var(--nut-title-color2, #666));
|
||||
background: var(--nut-cell-background, var(--nut-white, #fff));
|
||||
border-radius: var(--nut-cell-border-radius, 6px);
|
||||
box-shadow: var(--nut-cell-box-shadow, 0 1px 7px 0 #edeef1);
|
||||
}
|
||||
.nut-cell--center {
|
||||
align-items: center;
|
||||
}
|
||||
.nut-cell--large {
|
||||
padding: var(--nut-cell-large-padding, 15px 16px);
|
||||
font-size: var(--nut-cell-large-title-font, var(--nut-font-size-large, var(--nut-font-size-3, 16px)));
|
||||
}
|
||||
.nut-cell--large .nut-cell__title-desc {
|
||||
font-size: var(--nut-cell-large-title-desc-font, var(--nut-font-size-base, var(--nut-font-size-2, 14px)));
|
||||
}
|
||||
.nut-cell:last-child::after {
|
||||
border: 0 !important;
|
||||
}
|
||||
.nut-cell::after {
|
||||
position: absolute;
|
||||
right: var(--nut-cell-after-right, 16px);
|
||||
bottom: 0;
|
||||
left: 16px;
|
||||
box-sizing: border-box;
|
||||
pointer-events: none;
|
||||
content: "";
|
||||
transform: scaleY(0.5);
|
||||
}
|
||||
.nut-cell:active::before {
|
||||
opacity: 0.1;
|
||||
}
|
||||
.nut-cell--clickable {
|
||||
cursor: pointer;
|
||||
}
|
||||
.nut-cell--clickable::before {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
content: "";
|
||||
background-color: var(--nut-black, #000);
|
||||
border: inherit;
|
||||
border-color: var(--nut-black, #000);
|
||||
border-radius: inherit;
|
||||
opacity: 0;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
.nut-cell__icon {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
margin: var(--nut-cell-default-icon-margin, 0 4px 0 0);
|
||||
}
|
||||
.nut-cell__title {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
min-width: 80px;
|
||||
}
|
||||
.nut-cell__title-desc {
|
||||
font-size: var(--nut-cell-title-desc-font, var(--nut-font-size-1, 12px));
|
||||
}
|
||||
.nut-cell__value {
|
||||
display: inline-block;
|
||||
flex: 1;
|
||||
font-size: var(--nut-cell-desc-font, var(--nut-font-size-2, 14px));
|
||||
color: var(--nut-cell-desc-color, var(--nut-disable-color, #ccc));
|
||||
text-align: right;
|
||||
}
|
||||
.nut-cell__value--alone {
|
||||
color: var(--nut-cell-color, var(--nut-title-color2, #666));
|
||||
}
|
||||
.nut-cell__link {
|
||||
align-self: center;
|
||||
color: #979797;
|
||||
}
|
||||
.nut-theme-dark .nut-form-item__body__slots .nut-input {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
background: transparent;
|
||||
}
|
||||
.nut-form-item {
|
||||
display: flex;
|
||||
}
|
||||
.nut-form-item::before {
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
bottom: 0;
|
||||
left: 16px;
|
||||
box-sizing: border-box;
|
||||
pointer-events: none;
|
||||
content: "";
|
||||
transform: scaleX(0);
|
||||
}
|
||||
.nut-form-item.error.line::before {
|
||||
border-bottom: 1px solid var(--nut-form-item-error-line-color, var(--nut-required-color, #fa2c19));
|
||||
transition: transform 200ms cubic-bezier(0, 0, 0.2, 1) 0ms;
|
||||
transform: scaleX(1);
|
||||
}
|
||||
.nut-form-item__label {
|
||||
display: inline-block !important;
|
||||
flex: none !important;
|
||||
width: var(--nut-form-item-label-width, 90px);
|
||||
margin-right: var(--nut-form-item-label-margin-right, 10px);
|
||||
font-size: var(--nut-form-item-label-font-size, 14px);
|
||||
font-weight: normal;
|
||||
text-align: var(--nut-form-item-label-text-align, left);
|
||||
word-wrap: break-word;
|
||||
}
|
||||
.nut-form-item__label .nut-cell__title {
|
||||
min-width: auto;
|
||||
}
|
||||
.nut-form-item__label.required::before {
|
||||
margin-right: var(--nut-form-item-required-margin-right, 4px);
|
||||
color: var(--nut-form-item-required-color, var(--nut-required-color, #fa2c19));
|
||||
content: "*";
|
||||
}
|
||||
.nut-form-item__label.required.nut-form-item__star-right::before {
|
||||
content: none;
|
||||
}
|
||||
.nut-form-item__label.required.nut-form-item__star-right::after {
|
||||
margin-left: var(--nut-form-item-required-margin-right, 4px);
|
||||
color: var(--nut-form-item-required-color, var(--nut-required-color, #fa2c19));
|
||||
content: "*";
|
||||
}
|
||||
.nut-form-item__body {
|
||||
display: flex !important;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
}
|
||||
.nut-form-item__body__slots {
|
||||
text-align: var(--nut-form-item-body-slots-text-align, left);
|
||||
}
|
||||
.nut-form-item__body__slots .nut-input {
|
||||
width: 100%;
|
||||
font-size: var(--nut-form-item-body-font-size, 14px);
|
||||
color: var(--nut-black, #000);
|
||||
text-align: var(--nut-form-item-body-input-text-align, left);
|
||||
text-decoration: none;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
outline: 0 none;
|
||||
}
|
||||
.nut-form-item__body__slots .nut-range-container {
|
||||
min-height: 24px;
|
||||
}
|
||||
.nut-form-item__body__slots .nut-textarea {
|
||||
padding: 0 !important;
|
||||
}
|
||||
.nut-form-item__body__slots .nut-textarea .nut-textarea__textarea {
|
||||
text-align: var(--nut-form-item-body-input-text-align, left);
|
||||
}
|
||||
.nut-form-item__body__tips {
|
||||
font-size: var(--nut-form-item-tip-font-size, 10px);
|
||||
color: var(--nut-form-item-error-message-color, var(--nut-required-color, #fa2c19));
|
||||
text-align: var(--nut-form-item-tip-text-align, left);
|
||||
}
|
||||
.nut-form-item__right {
|
||||
--nut-form-item-label-text-align: right;
|
||||
}
|
||||
.nut-form-item__top {
|
||||
flex-direction: column;
|
||||
}
|
||||
.nut-form-item__top .nut-form-item__label {
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding-right: 24px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
44
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/grid/grid.js
vendored
Normal file
44
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/grid/grid.js
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
||||
const uni_modules_nutuiUni_components__hooks_useProvide = require("../_hooks/useProvide.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_pxCheck = require("../_utils/pxCheck.js");
|
||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
||||
const uni_modules_nutuiUni_components_grid_index = require("./index.js");
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: "NutGrid",
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: uni_modules_nutuiUni_components_grid_index.gridProps,
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-grid`;
|
||||
uni_modules_nutuiUni_components__hooks_useProvide.useProvide(uni_modules_nutuiUni_components_grid_index.GRID_KEY, `${componentName}-item`)({ props });
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, {
|
||||
[`${componentName}--border`]: props.border && !props.gutter
|
||||
});
|
||||
});
|
||||
const styles = common_vendor.computed(() => {
|
||||
const style = {};
|
||||
if (props.gutter)
|
||||
style.paddingLeft = uni_modules_nutuiUni_components__utils_pxCheck.pxCheck(props.gutter);
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainStyle(props, style);
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.n(classes.value),
|
||||
b: common_vendor.s(styles.value)
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/grid/grid.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/grid/grid.json
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/grid/grid.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/grid/grid.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/grid/grid.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{a}}" style="{{b}}"><slot/></view>
|
||||
64
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/grid/grid.wxss
vendored
Normal file
64
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/grid/grid.wxss
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.nut-theme-dark .nut-grid {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
border: 0 solid var(--nut-dark-background, #131313);
|
||||
}
|
||||
.nut-grid {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
border: 0 solid var(--nut-grid-border-color, #f5f6f7);
|
||||
}
|
||||
.nut-grid--border {
|
||||
border-top-width: 1px;
|
||||
border-left-width: 1px;
|
||||
}
|
||||
43
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/grid/index.js
vendored
Normal file
43
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/grid/index.js
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
require("../../../../common/vendor.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const GRID_KEY = Symbol("grid");
|
||||
const gridProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 列数
|
||||
*/
|
||||
columnNum: uni_modules_nutuiUni_components__utils_props.makeNumericProp(4),
|
||||
/**
|
||||
* @description 是否显示边框
|
||||
*/
|
||||
border: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 格子之间的间距,默认单位为 `px`
|
||||
*/
|
||||
gutter: uni_modules_nutuiUni_components__utils_props.makeNumericProp(0),
|
||||
/**
|
||||
* @description 是否将格子内容居中显示
|
||||
*/
|
||||
center: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 是否将格子固定为正方形
|
||||
*/
|
||||
square: Boolean,
|
||||
/**
|
||||
* @description 内容翻转
|
||||
*/
|
||||
reverse: Boolean,
|
||||
/**
|
||||
* @description 格子内容排列的方向,可选值为 `horizontal`
|
||||
*/
|
||||
direction: uni_modules_nutuiUni_components__utils_props.makeStringProp("vertical"),
|
||||
/**
|
||||
* @description 是否开启格子点击反馈
|
||||
*/
|
||||
clickable: Boolean
|
||||
};
|
||||
exports.GRID_KEY = GRID_KEY;
|
||||
exports.gridProps = gridProps;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/grid/index.js.map
|
||||
113
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/griditem/griditem.js
vendored
Normal file
113
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/griditem/griditem.js
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_nutuiUni_components__constants_event = require("../_constants/event.js");
|
||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
||||
const uni_modules_nutuiUni_components__hooks_useInject = require("../_hooks/useInject.js");
|
||||
const uni_modules_nutuiUni_components__hooks_useRouter = require("../_hooks/useRouter.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_pxCheck = require("../_utils/pxCheck.js");
|
||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
||||
const uni_modules_nutuiUni_components_grid_index = require("../grid/index.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const gridItemProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 文字
|
||||
*/
|
||||
text: String,
|
||||
/**
|
||||
* @description 点击后跳转的目标路由对象,同 vue-router 的 to 属性
|
||||
*/
|
||||
to: [String, Object],
|
||||
/**
|
||||
* @description 点击后跳转的链接地址
|
||||
*/
|
||||
url: String,
|
||||
/**
|
||||
* @description 是否在跳转时替换当前页面历史
|
||||
*/
|
||||
replace: Boolean,
|
||||
background: String
|
||||
};
|
||||
const gridItemEmits = {
|
||||
[uni_modules_nutuiUni_components__constants_event.CLICK_EVENT]: (evt) => evt instanceof Object
|
||||
};
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: "NutGridItem",
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: gridItemProps,
|
||||
emits: gridItemEmits,
|
||||
setup(__props, { emit: __emit }) {
|
||||
var _a;
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-grid-item`;
|
||||
const Parent = uni_modules_nutuiUni_components__hooks_useInject.useInject(uni_modules_nutuiUni_components_grid_index.GRID_KEY);
|
||||
const index = Parent.index;
|
||||
const parent = (_a = Parent == null ? void 0 : Parent.parent) == null ? void 0 : _a.props;
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName);
|
||||
});
|
||||
const styles = common_vendor.computed(() => {
|
||||
if (!parent)
|
||||
return;
|
||||
const style = {
|
||||
flexBasis: `${100 / +parent.columnNum}%`
|
||||
};
|
||||
if (parent == null ? void 0 : parent.square) {
|
||||
style.paddingTop = `${100 / +parent.columnNum}%`;
|
||||
} else if (parent.gutter) {
|
||||
style.paddingRight = uni_modules_nutuiUni_components__utils_pxCheck.pxCheck(parent.gutter);
|
||||
if (index.value >= Number(parent.columnNum))
|
||||
style.marginTop = uni_modules_nutuiUni_components__utils_pxCheck.pxCheck(parent.gutter);
|
||||
}
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainStyle(props, style);
|
||||
});
|
||||
const contentClass = common_vendor.computed(() => {
|
||||
if (!parent)
|
||||
return;
|
||||
const prefixCls = `${componentName}__content`;
|
||||
return {
|
||||
[`${prefixCls}`]: true,
|
||||
[`${prefixCls}--border`]: parent.border,
|
||||
[`${prefixCls}--surround`]: parent.border && parent.gutter,
|
||||
[`${prefixCls}--center`]: parent.center,
|
||||
[`${prefixCls}--square`]: parent.square,
|
||||
[`${prefixCls}--reverse`]: parent.reverse,
|
||||
[`${prefixCls}--${parent.direction}`]: !!parent.direction,
|
||||
[`${prefixCls}--clickable`]: parent.clickable
|
||||
};
|
||||
});
|
||||
const router = uni_modules_nutuiUni_components__hooks_useRouter.useRouter();
|
||||
function handleClick(event) {
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CLICK_EVENT, event);
|
||||
if (props.to && router) {
|
||||
router[props.replace ? "replace" : "push"](props.to);
|
||||
}
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: _ctx.text
|
||||
}, _ctx.text ? {
|
||||
b: common_vendor.t(_ctx.text)
|
||||
} : {}, {
|
||||
c: common_vendor.n(contentClass.value),
|
||||
d: common_vendor.s(props.background ? {
|
||||
background: props.background
|
||||
} : {}),
|
||||
e: common_vendor.n(classes.value),
|
||||
f: common_vendor.s(styles.value),
|
||||
g: common_vendor.o(handleClick)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/griditem/griditem.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/griditem/griditem.json
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/griditem/griditem.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/griditem/griditem.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/griditem/griditem.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{e}}" style="{{f}}" bindtap="{{g}}"><view class="{{c}}" style="{{d}}"><slot/><view class="nut-grid-item__text"><block wx:if="{{a}}">{{b}}</block><slot wx:else name="text"/></view></view></view>
|
||||
134
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/griditem/griditem.wxss
vendored
Normal file
134
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/griditem/griditem.wxss
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.nut-theme-dark .nut-grid-item__content {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
background: var(--nut-dark-background, #131313);
|
||||
border: 0 solid var(--nut-dark-background2, #1b1b1b);
|
||||
}
|
||||
.nut-theme-dark .nut-grid-item__text {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
}
|
||||
.nut-grid-item {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.nut-grid-item__text {
|
||||
margin: var(--nut-grid-item-text-margin, 8px) 0 0 0;
|
||||
font-size: var(--nut-grid-item-text-font-size, var(--nut-font-size-1, 12px));
|
||||
line-height: 1.5;
|
||||
color: var(--nut-grid-item-text-color, var(--nut-title-color2, #666));
|
||||
word-break: break-all;
|
||||
}
|
||||
.nut-grid-item__content {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
padding: var(--nut-grid-item-content-padding, 16px 8px);
|
||||
background: var(--nut-grid-item-content-bg-color, var(--nut-white, #fff));
|
||||
border: 0 solid var(--nut-grid-border-color, #f5f6f7);
|
||||
}
|
||||
.nut-grid-item__content--border {
|
||||
border-right-width: 1px;
|
||||
border-bottom-width: 1px;
|
||||
}
|
||||
.nut-grid-item__content--surround {
|
||||
border-top-width: 1px;
|
||||
border-left-width: 1px;
|
||||
}
|
||||
.nut-grid-item__content--center {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.nut-grid-item__content--square {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
}
|
||||
.nut-grid-item__content--reverse {
|
||||
flex-direction: column-reverse;
|
||||
}
|
||||
.nut-grid-item__content--reverse .nut-grid-item__text {
|
||||
margin: 0 0 var(--nut-grid-item-text-margin, 8px);
|
||||
}
|
||||
.nut-grid-item__content--horizontal {
|
||||
flex-direction: row;
|
||||
}
|
||||
.nut-grid-item__content--horizontal .nut-grid-item__text {
|
||||
margin: 0 0 0 var(--nut-grid-item-text-margin, 8px);
|
||||
}
|
||||
.nut-grid-item__content--horizontal.nut-grid-item__content--reverse {
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
.nut-grid-item__content--horizontal.nut-grid-item__content--reverse .nut-grid-item__text {
|
||||
margin: 0 var(--nut-grid-item-text-margin, 8px) 0 0;
|
||||
}
|
||||
.nut-grid-item__content--clickable {
|
||||
cursor: pointer;
|
||||
}
|
||||
.nut-grid-item__content--clickable::before {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
content: "";
|
||||
background-color: var(--nut-black, #000);
|
||||
border: inherit;
|
||||
border-color: var(--nut-black, #000);
|
||||
border-radius: inherit;
|
||||
opacity: 0;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
.nut-grid-item__content--clickable:active::before {
|
||||
opacity: 0.1;
|
||||
}
|
||||
103
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/icon/icon.js
vendored
Normal file
103
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/icon/icon.js
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_nutuiUni_components__constants_event = require("../_constants/event.js");
|
||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_pxCheck = require("../_utils/pxCheck.js");
|
||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const iconProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
popClass: { type: String, default: "" },
|
||||
/**
|
||||
* @description 图标宽度
|
||||
*/
|
||||
width: uni_modules_nutuiUni_components__utils_props.makeNumericProp(""),
|
||||
/**
|
||||
* @description 图标高度
|
||||
*/
|
||||
height: uni_modules_nutuiUni_components__utils_props.makeNumericProp(""),
|
||||
/**
|
||||
* @description 图标名称
|
||||
*/
|
||||
name: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
||||
/**
|
||||
* @description 图标大小
|
||||
*/
|
||||
size: uni_modules_nutuiUni_components__utils_props.makeNumericProp(""),
|
||||
/**
|
||||
* @description 自定义 `icon` 类名前缀,用于使用自定义图标
|
||||
*/
|
||||
classPrefix: { type: String, default: "nut-icon" },
|
||||
/**
|
||||
* @description 自定义 `icon` 字体基础类名
|
||||
*/
|
||||
fontClassName: { type: String, default: "nutui-iconfont" },
|
||||
/**
|
||||
* @description 图标颜色
|
||||
*/
|
||||
customColor: { type: String, default: "" }
|
||||
};
|
||||
const iconEmits = {
|
||||
[uni_modules_nutuiUni_components__constants_event.CLICK_EVENT]: (evt) => evt instanceof Object
|
||||
};
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-icon`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: iconProps,
|
||||
emits: iconEmits,
|
||||
setup(__props, { emit: __emit }) {
|
||||
const props = __props;
|
||||
const emits = __emit;
|
||||
function handleClick(event) {
|
||||
emits(uni_modules_nutuiUni_components__constants_event.CLICK_EVENT, event);
|
||||
}
|
||||
const isImage = common_vendor.computed(() => {
|
||||
return props.name ? props.name.includes("/") : false;
|
||||
});
|
||||
const classes = common_vendor.computed(() => {
|
||||
const obj = {};
|
||||
if (isImage.value) {
|
||||
obj[`${componentName}__img`] = true;
|
||||
} else {
|
||||
obj[props.fontClassName] = true;
|
||||
obj[`${props.classPrefix}-${props.name}`] = true;
|
||||
obj[props.popClass] = true;
|
||||
}
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, obj);
|
||||
});
|
||||
const getStyle = common_vendor.computed(() => {
|
||||
const style = {
|
||||
color: props.customColor,
|
||||
fontSize: uni_modules_nutuiUni_components__utils_pxCheck.pxCheck(props.size),
|
||||
width: uni_modules_nutuiUni_components__utils_pxCheck.pxCheck(props.width),
|
||||
height: uni_modules_nutuiUni_components__utils_pxCheck.pxCheck(props.height)
|
||||
};
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainStyle(props, style);
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: isImage.value
|
||||
}, isImage.value ? {
|
||||
b: common_vendor.n(classes.value),
|
||||
c: common_vendor.s(getStyle.value),
|
||||
d: _ctx.name,
|
||||
e: common_vendor.o(handleClick)
|
||||
} : {
|
||||
f: common_vendor.n(classes.value),
|
||||
g: common_vendor.s(getStyle.value),
|
||||
h: common_vendor.o(handleClick)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/icon/icon.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/icon/icon.json
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/icon/icon.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/icon/icon.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/icon/icon.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<image wx:if="{{a}}" class="{{b}}" style="{{c}}" src="{{d}}" bindtap="{{e}}"/><text wx:else class="{{f}}" style="{{g}}" bindtap="{{h}}"/>
|
||||
130
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/icon/icon.wxss
vendored
Normal file
130
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/icon/icon.wxss
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.nut-icon {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: var(--nut-icon-width, 20px);
|
||||
height: var(--nut-icon-height, 20px);
|
||||
line-height: var(--nut-icon-line-height, 20px);
|
||||
text-align: right;
|
||||
--animate-duration: 1s;
|
||||
--animate-delay: 0s;
|
||||
}
|
||||
.nut-icon::before {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
.nut-icon__img {
|
||||
width: var(--nut-icon-width, 20px);
|
||||
height: var(--nut-icon-height, 20px);
|
||||
object-fit: contain;
|
||||
}
|
||||
.nut-icon-loading, .nut-icon-loading1 {
|
||||
display: inline-block;
|
||||
animation: rotation 1s infinite linear;
|
||||
}
|
||||
.nut-icon-am-infinite {
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
.nut-icon-am-jump {
|
||||
animation-name: nutJumpOne;
|
||||
animation-duration: var(--animate-duration);
|
||||
animation-timing-function: ease;
|
||||
animation-delay: var(--animate-delay);
|
||||
}
|
||||
.nut-icon-am-jump.nut-icon-am-infinite {
|
||||
animation-name: nutJump;
|
||||
}
|
||||
.nut-icon-am-rotate {
|
||||
animation-name: rotation;
|
||||
animation-duration: var(--animate-duration);
|
||||
animation-timing-function: linear;
|
||||
animation-delay: var(--animate-delay);
|
||||
}
|
||||
.nut-icon-am-rotate.nut-icon-am-infinite {
|
||||
animation-direction: normal;
|
||||
}
|
||||
.nut-icon-am-blink {
|
||||
animation-name: nutBlink;
|
||||
animation-duration: var(--animate-duration);
|
||||
animation-timing-function: linear;
|
||||
animation-delay: var(--animate-delay);
|
||||
}
|
||||
.nut-icon-am-breathe {
|
||||
animation-name: nutBreathe;
|
||||
animation-duration: var(--animate-duration);
|
||||
animation-timing-function: ease-in-out;
|
||||
animation-delay: var(--animate-delay);
|
||||
}
|
||||
.nut-icon-am-flash {
|
||||
animation-name: nutFlash;
|
||||
animation-duration: var(--animate-duration);
|
||||
animation-timing-function: ease-in-out;
|
||||
animation-delay: var(--animate-delay);
|
||||
}
|
||||
.nut-icon-am-bounce {
|
||||
animation-name: nutBounce;
|
||||
animation-duration: var(--animate-duration);
|
||||
animation-timing-function: ease-in-out;
|
||||
animation-delay: var(--animate-delay);
|
||||
}
|
||||
.nut-icon-am-bounce.nut-icon-am-infinite {
|
||||
animation-direction: normal;
|
||||
}
|
||||
.nut-icon-am-shake {
|
||||
animation-name: nutShake;
|
||||
animation-duration: var(--animate-duration);
|
||||
animation-timing-function: ease-in-out;
|
||||
animation-delay: var(--animate-delay);
|
||||
}
|
||||
373
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/input/input.js
vendored
Normal file
373
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/input/input.js
vendored
Normal file
@@ -0,0 +1,373 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_nutuiUni_components__constants_event = require("../_constants/event.js");
|
||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
||||
const uni_modules_nutuiUni_components__utils_env = require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
||||
const form = require("../../../../form.js");
|
||||
const uni_modules_nutuiUni_components__utils_is = require("../_utils/is.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const uni_modules_nutuiUni_components_input_util = require("./util.js");
|
||||
const inputProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 输入框类型,支持原生 `input` 标签的所有 `type` 属性,另外还支持 `number` `digit`
|
||||
*/
|
||||
type: uni_modules_nutuiUni_components__utils_props.makeStringProp("text"),
|
||||
/**
|
||||
* @description 输入值,双向绑定
|
||||
*/
|
||||
modelValue: uni_modules_nutuiUni_components__utils_props.makeNumericProp(""),
|
||||
/**
|
||||
* @description 输入框自定义类名
|
||||
*/
|
||||
inputClass: {
|
||||
type: [String, Object, Array],
|
||||
default: ""
|
||||
},
|
||||
/**
|
||||
* @description 输入框自定义样式
|
||||
*/
|
||||
inputStyle: {
|
||||
type: [String, Object, Array],
|
||||
default: ""
|
||||
},
|
||||
/**
|
||||
* @description 输入框为空时占位符
|
||||
*/
|
||||
placeholder: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
||||
/**
|
||||
* @description 指定 placeholder 的样式
|
||||
*/
|
||||
placeholderStyle: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
||||
/**
|
||||
* @description 指定 placeholder 的样式类
|
||||
*/
|
||||
placeholderClass: uni_modules_nutuiUni_components__utils_props.makeStringProp("input-placeholder"),
|
||||
/**
|
||||
* @description 输入框内容对齐方式,可选值 `left`、`center`、`right`
|
||||
*/
|
||||
inputAlign: uni_modules_nutuiUni_components__utils_props.makeStringProp("left"),
|
||||
/**
|
||||
* @description 是否显示必填字段的标签旁边的红色星号
|
||||
*/
|
||||
required: Boolean,
|
||||
/**
|
||||
* @description 是否禁用
|
||||
*/
|
||||
disabled: uni_modules_nutuiUni_components__utils_props.nullableBooleanProp,
|
||||
/**
|
||||
* @description 是否只读
|
||||
*/
|
||||
readonly: Boolean,
|
||||
/**
|
||||
* @description 是否标红
|
||||
*/
|
||||
error: Boolean,
|
||||
/**
|
||||
* @description 限制最长输入字符
|
||||
*/
|
||||
maxLength: uni_modules_nutuiUni_components__utils_props.makeNumericProp(140),
|
||||
/**
|
||||
* @description 展示清除 `Icon`
|
||||
*/
|
||||
clearable: Boolean,
|
||||
/**
|
||||
* @description 清除图标的 `font-size` 大小
|
||||
*/
|
||||
clearSize: uni_modules_nutuiUni_components__utils_props.makeNumericProp("14"),
|
||||
/**
|
||||
* @description 是否显示下边框
|
||||
*/
|
||||
border: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 格式化函数触发的时机,可选值为 `onChange`、`onBlur`
|
||||
*/
|
||||
formatTrigger: uni_modules_nutuiUni_components__utils_props.makeStringProp("onChange"),
|
||||
/**
|
||||
* @description 输入内容格式化函数
|
||||
*/
|
||||
formatter: {
|
||||
type: Function,
|
||||
default: null
|
||||
},
|
||||
/**
|
||||
* @description 是否显示限制最长输入字符,需要设置 `max-length` 属性
|
||||
*/
|
||||
showWordLimit: Boolean,
|
||||
/**
|
||||
* @description 是否自动获得焦点,`iOS` 系统不支持该属性
|
||||
*/
|
||||
autofocus: Boolean,
|
||||
/**
|
||||
* @description 键盘右下角按钮的文字,仅在`type='text'`时生效,可选值 `send`:发送、`search`:搜索、`next`:下一个、`go`:前往、`done`:完成
|
||||
*/
|
||||
confirmType: uni_modules_nutuiUni_components__utils_props.makeStringProp("done"),
|
||||
/**
|
||||
* @description 键盘弹起时,是否自动上推页面
|
||||
*/
|
||||
adjustPosition: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 是否强制使用系统键盘和 `Web-view` 创建的 `input` 元素。为 `true` 时,`confirm-type`、`confirm-hold` 可能失效
|
||||
*/
|
||||
alwaysSystem: Boolean,
|
||||
/**
|
||||
* @description 是否在失去焦点后,继续展示清除按钮,在设置 `clearable` 时生效
|
||||
*/
|
||||
showClearIcon: Boolean,
|
||||
/**
|
||||
* @description 输入框模式
|
||||
*/
|
||||
inputMode: uni_modules_nutuiUni_components__utils_props.makeStringProp("text"),
|
||||
/**
|
||||
* @description 指定光标与键盘的距离,取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离
|
||||
*/
|
||||
cursorSpacing: uni_modules_nutuiUni_components__utils_props.makeNumberProp(0),
|
||||
/**
|
||||
* @description 强制 input 处于同层状态,默认 focus 时 input 会切到非同层状态 (仅在 iOS 下生效)
|
||||
*/
|
||||
alwaysEmbed: Boolean,
|
||||
/**
|
||||
* @description 点击键盘右下角按钮时是否保持键盘不收起
|
||||
*/
|
||||
confirmHold: Boolean,
|
||||
/**
|
||||
* @description 指定focus时的光标位置
|
||||
*/
|
||||
cursor: Number,
|
||||
/**
|
||||
* @description 光标起始位置,自动聚集时有效,需与selection-end搭配使用
|
||||
*/
|
||||
selectionStart: uni_modules_nutuiUni_components__utils_props.makeNumberProp(-1),
|
||||
/**
|
||||
* @description 光标结束位置,自动聚集时有效,需与selection-start搭配使用
|
||||
*/
|
||||
selectionEnd: uni_modules_nutuiUni_components__utils_props.makeNumberProp(-1),
|
||||
/**
|
||||
* @description focus时,点击页面的时候不收起键盘
|
||||
*/
|
||||
holdKeyboard: Boolean
|
||||
};
|
||||
const inputEmits = {
|
||||
[uni_modules_nutuiUni_components__constants_event.CLICK_EVENT]: (evt) => evt instanceof Object,
|
||||
clickInput: (evt) => evt instanceof Object,
|
||||
[uni_modules_nutuiUni_components__constants_event.BLUR_EVENT]: (evt) => evt instanceof Object,
|
||||
[uni_modules_nutuiUni_components__constants_event.FOCUS_EVENT]: (evt) => evt instanceof Object,
|
||||
[uni_modules_nutuiUni_components__constants_event.CLEAR_EVENT]: () => true,
|
||||
[uni_modules_nutuiUni_components__constants_event.CONFIRM_EVENT]: (evt) => evt instanceof Object,
|
||||
[uni_modules_nutuiUni_components__constants_event.UPDATE_MODEL_EVENT]: (val1, val2) => (uni_modules_nutuiUni_components__utils_is.isString(val1) || uni_modules_nutuiUni_components__utils_is.isNumber(val1)) && (val2 instanceof Object || val2 === void 0),
|
||||
[uni_modules_nutuiUni_components__constants_event.INPUT_EVENT]: (val, evt) => (uni_modules_nutuiUni_components__utils_is.isString(val) || uni_modules_nutuiUni_components__utils_is.isNumber(val)) && evt instanceof Object
|
||||
};
|
||||
if (!Math) {
|
||||
NutIcon();
|
||||
}
|
||||
const NutIcon = () => "../icon/icon.js";
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-input`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: inputProps,
|
||||
emits: inputEmits,
|
||||
setup(__props, { emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const slots = common_vendor.useSlots();
|
||||
function hasSlot(name) {
|
||||
return Boolean(slots[name]);
|
||||
}
|
||||
const formDisabled = form.useFormDisabled(common_vendor.toRef(props, "disabled"));
|
||||
function stringModelValue() {
|
||||
if (props.modelValue == null)
|
||||
return "";
|
||||
return String(props.modelValue);
|
||||
}
|
||||
const innerValue = common_vendor.computed(() => {
|
||||
return stringModelValue();
|
||||
});
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, {
|
||||
[`${componentName}--disabled`]: formDisabled.value,
|
||||
[`${componentName}--required`]: props.required,
|
||||
[`${componentName}--error`]: props.error,
|
||||
[`${componentName}--border`]: props.border
|
||||
});
|
||||
});
|
||||
const inputStyles = common_vendor.computed(() => {
|
||||
return [props.inputStyle, {
|
||||
textAlign: props.inputAlign
|
||||
}];
|
||||
});
|
||||
const innerMaxLength = common_vendor.computed(() => {
|
||||
if (props.maxLength == null)
|
||||
return -1;
|
||||
return Number(props.maxLength);
|
||||
});
|
||||
function updateValue(value, trigger = "onChange") {
|
||||
if (innerMaxLength.value > 0 && value.length > innerMaxLength.value)
|
||||
value = value.slice(0, innerMaxLength.value);
|
||||
if (props.type === "number")
|
||||
value = uni_modules_nutuiUni_components_input_util.formatNumber(value, false, false);
|
||||
if (props.type === "digit")
|
||||
value = uni_modules_nutuiUni_components_input_util.formatNumber(value, true, true);
|
||||
if (props.formatter && trigger === props.formatTrigger)
|
||||
value = props.formatter(value);
|
||||
emit(uni_modules_nutuiUni_components__constants_event.UPDATE_MODEL_EVENT, value);
|
||||
}
|
||||
function _onInput(evt) {
|
||||
updateValue(evt.detail.value);
|
||||
common_vendor.nextTick$1(() => {
|
||||
emit(uni_modules_nutuiUni_components__constants_event.INPUT_EVENT, innerValue.value, evt);
|
||||
});
|
||||
}
|
||||
function handleInput(evt) {
|
||||
if (uni_modules_nutuiUni_components__utils_env.isH5) {
|
||||
const target = evt.target;
|
||||
if (!target.composing)
|
||||
_onInput(evt);
|
||||
} else {
|
||||
_onInput(evt);
|
||||
}
|
||||
}
|
||||
function handleClick(evt) {
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CLICK_EVENT, evt);
|
||||
}
|
||||
function handleClickInput(evt) {
|
||||
if (formDisabled.value)
|
||||
return;
|
||||
emit("clickInput", evt);
|
||||
}
|
||||
const active = common_vendor.ref(false);
|
||||
const clearing = common_vendor.ref(false);
|
||||
function handleFocus(evt) {
|
||||
if (formDisabled.value || props.readonly)
|
||||
return;
|
||||
emit(uni_modules_nutuiUni_components__constants_event.FOCUS_EVENT, evt);
|
||||
active.value = true;
|
||||
}
|
||||
function handleBlur(evt) {
|
||||
if (formDisabled.value || props.readonly)
|
||||
return;
|
||||
emit(uni_modules_nutuiUni_components__constants_event.BLUR_EVENT, evt);
|
||||
setTimeout(() => {
|
||||
active.value = false;
|
||||
}, 200);
|
||||
if (clearing.value) {
|
||||
clearing.value = false;
|
||||
return;
|
||||
}
|
||||
updateValue(evt.detail.value, "onBlur");
|
||||
}
|
||||
function handleConfirm(evt) {
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CONFIRM_EVENT, evt);
|
||||
}
|
||||
function handleClear(evt) {
|
||||
if (formDisabled.value)
|
||||
return;
|
||||
emit(uni_modules_nutuiUni_components__constants_event.UPDATE_MODEL_EVENT, "", evt);
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CLEAR_EVENT);
|
||||
clearing.value = true;
|
||||
}
|
||||
function startComposing(evt) {
|
||||
if (uni_modules_nutuiUni_components__utils_env.isH5) {
|
||||
const target = evt.target;
|
||||
target.composing = true;
|
||||
}
|
||||
}
|
||||
function endComposing(evt) {
|
||||
if (uni_modules_nutuiUni_components__utils_env.isH5) {
|
||||
const target = evt.target;
|
||||
if (target.composing) {
|
||||
target.composing = false;
|
||||
target.dispatchEvent(new Event("input"));
|
||||
}
|
||||
}
|
||||
}
|
||||
common_vendor.watch(
|
||||
() => props.modelValue,
|
||||
(value) => {
|
||||
if (value === innerValue.value)
|
||||
return;
|
||||
updateValue(stringModelValue());
|
||||
}
|
||||
);
|
||||
common_vendor.onMounted(() => {
|
||||
updateValue(stringModelValue(), props.formatTrigger);
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: hasSlot("left")
|
||||
}, hasSlot("left") ? {} : {}, {
|
||||
b: common_vendor.n(props.inputClass),
|
||||
c: common_vendor.s(inputStyles.value),
|
||||
d: innerValue.value,
|
||||
e: props.type,
|
||||
f: props.placeholder,
|
||||
g: props.placeholderStyle,
|
||||
h: props.placeholderClass,
|
||||
i: common_vendor.unref(formDisabled),
|
||||
j: props.readonly,
|
||||
k: props.autofocus,
|
||||
l: innerMaxLength.value,
|
||||
m: props.formatTrigger,
|
||||
n: props.autofocus ? true : void 0,
|
||||
o: props.confirmType,
|
||||
p: props.adjustPosition,
|
||||
q: props.alwaysSystem,
|
||||
r: props.inputMode,
|
||||
s: props.cursorSpacing,
|
||||
t: props.alwaysEmbed,
|
||||
v: props.confirmHold,
|
||||
w: props.cursor,
|
||||
x: props.selectionStart,
|
||||
y: props.selectionEnd,
|
||||
z: props.holdKeyboard,
|
||||
A: common_vendor.o(handleInput),
|
||||
B: common_vendor.o(handleFocus),
|
||||
C: common_vendor.o(handleBlur),
|
||||
D: common_vendor.o(handleClickInput),
|
||||
E: common_vendor.o(endComposing),
|
||||
F: common_vendor.o(startComposing),
|
||||
G: common_vendor.o(endComposing),
|
||||
H: common_vendor.o(handleConfirm),
|
||||
I: props.readonly
|
||||
}, props.readonly ? {
|
||||
J: common_vendor.o(handleClickInput)
|
||||
} : {}, {
|
||||
K: props.showWordLimit && innerMaxLength.value > 0
|
||||
}, props.showWordLimit && innerMaxLength.value > 0 ? {
|
||||
L: common_vendor.t(innerValue.value.length),
|
||||
M: common_vendor.t(innerMaxLength.value)
|
||||
} : {}, {
|
||||
N: props.clearable && !props.readonly
|
||||
}, props.clearable && !props.readonly ? common_vendor.e({
|
||||
O: hasSlot("clear")
|
||||
}, hasSlot("clear") ? {} : {
|
||||
P: common_vendor.p({
|
||||
name: "mask-close",
|
||||
["custom-class"]: "nut-input__clear-icon",
|
||||
size: props.clearSize,
|
||||
width: props.clearSize,
|
||||
height: props.clearSize
|
||||
})
|
||||
}, {
|
||||
Q: !((active.value || props.showClearIcon) && innerValue.value.length > 0) ? 1 : "",
|
||||
R: common_vendor.o(handleClear)
|
||||
}) : {}, {
|
||||
S: hasSlot("right")
|
||||
}, hasSlot("right") ? {} : {}, {
|
||||
T: common_vendor.n(classes.value),
|
||||
U: common_vendor.s(props.customStyle),
|
||||
V: common_vendor.o(handleClick)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/input/input.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/input/input.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/input/input.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"nut-icon": "../icon/icon"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/input/input.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/input/input.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{T}}" style="{{U}}" bindtap="{{V}}"><view wx:if="{{a}}" class="nut-input__left"><slot name="left"/></view><view class="nut-input__value"><block wx:if="{{r0}}"><input class="{{['nut-input__input', b]}}" style="{{c}}" value="{{d}}" type="{{e}}" placeholder="{{f}}" placeholder-style="{{g}}" placeholder-class="{{h}}" disabled="{{i}}" readonly="{{j}}" focus="{{k}}" maxlength="{{l}}" format-trigger="{{m}}" auto-blur="{{n}}" confirm-type="{{o}}" adjust-position="{{p}}" always-system="{{q}}" inputmode="{{r}}" cursor-spacing="{{s}}" always-embed="{{t}}" confirm-hold="{{v}}" cursor="{{w}}" selection-start="{{x}}" selection-end="{{y}}" hold-keyboard="{{z}}" bindinput="{{A}}" bindfocus="{{B}}" bindblur="{{C}}" bindtap="{{D}}" bindchange="{{E}}" bindcompositionstart="{{F}}" bindcompositionend="{{G}}" bindconfirm="{{H}}"></input></block><view wx:if="{{I}}" class="nut-input__mask" bindtap="{{J}}"/><view wx:if="{{K}}" class="nut-input__word-limit"><text class="nut-input__word-num">{{L}}</text>/{{M}}</view></view><view wx:if="{{N}}" class="{{['nut-input__clear', Q && 'nut-hidden']}}" catchtap="{{R}}"><slot wx:if="{{O}}" name="clear"/><nut-icon wx:else u-i="0910be30-0" bind:__l="__l" u-p="{{P||''}}"/></view><view wx:if="{{S}}" class="nut-input__right"><slot name="right"/></view></view>
|
||||
154
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/input/input.wxss
vendored
Normal file
154
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/input/input.wxss
vendored
Normal file
@@ -0,0 +1,154 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.nut-theme-dark .nut-input {
|
||||
background: var(--nut-dark-background, #131313);
|
||||
}
|
||||
.nut-theme-dark .nut-input__input {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
}
|
||||
.nut-input {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
padding: var(--nut-input-padding, 10px 25px);
|
||||
font-size: var(--nut-input-font-size, var(--nut-font-size-2, 14px));
|
||||
line-height: var(--nut-input-line-height, 20px);
|
||||
background: var(--nut-white, #fff);
|
||||
}
|
||||
.nut-input__left, .nut-input__right {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.nut-input__left {
|
||||
margin-right: 4px;
|
||||
}
|
||||
.nut-input__right {
|
||||
margin-left: 4px;
|
||||
}
|
||||
.nut-input__value {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
}
|
||||
.nut-input__input {
|
||||
flex: 1;
|
||||
padding: 0;
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
text-align: left;
|
||||
text-decoration: none;
|
||||
resize: none;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
outline: 0 none;
|
||||
}
|
||||
.nut-input__mask {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.nut-input__word-limit {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 0 10px;
|
||||
font-size: var(--nut-input-limit-font-size, var(--nut-font-size-1, 12px));
|
||||
color: var(--nut-input-limit-color, #808080);
|
||||
}
|
||||
.nut-input__clear {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.nut-input__clear-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin: 0 4px;
|
||||
line-height: 1;
|
||||
color: #c8c9cc;
|
||||
cursor: pointer;
|
||||
}
|
||||
.nut-input--disabled {
|
||||
color: var(--nut-input-disabled-color, #c8c9cc) !important;
|
||||
}
|
||||
.nut-input--disabled input:disabled {
|
||||
color: var(--nut-input-disabled-color, #c8c9cc);
|
||||
cursor: not-allowed;
|
||||
background: none;
|
||||
opacity: 1;
|
||||
-webkit-text-fill-color: var(--nut-input-disabled-color, #c8c9cc);
|
||||
}
|
||||
.nut-input--required::before {
|
||||
position: absolute;
|
||||
left: 14px;
|
||||
color: var(--nut-input-required-color, var(--nut-required-color, #fa2c19));
|
||||
content: "*";
|
||||
}
|
||||
.nut-input--error::-webkit-input-placeholder {
|
||||
color: var(--nut-input-required-color, var(--nut-required-color, #fa2c19));
|
||||
-webkit-text-fill-color: var(--nut-input-required-color, var(--nut-required-color, #fa2c19));
|
||||
}
|
||||
.nut-input--error, .nut-input--error::placeholder {
|
||||
color: var(--nut-input-required-color, var(--nut-required-color, #fa2c19));
|
||||
-webkit-text-fill-color: var(--nut-input-required-color, var(--nut-required-color, #fa2c19));
|
||||
}
|
||||
.nut-input--border {
|
||||
border-bottom: 1px solid var(--nut-input-border-bottom, #eaf0fb);
|
||||
}
|
||||
.nut-form-item .nut-input {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
line-height: var(--nut-cell-line-height);
|
||||
}
|
||||
23
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/input/util.js
vendored
Normal file
23
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/input/util.js
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
function trimExtraChar(value, char, regExp) {
|
||||
const index = value.indexOf(char);
|
||||
if (index === -1)
|
||||
return value;
|
||||
if (char === "-" && index !== 0)
|
||||
return value.slice(0, index);
|
||||
return value.slice(0, index + 1) + value.slice(index).replace(regExp, "");
|
||||
}
|
||||
function formatNumber(value, allowDot = true, allowMinus = true) {
|
||||
if (allowDot)
|
||||
value = trimExtraChar(value, ".", /\./g);
|
||||
else
|
||||
value = value.split(".")[0];
|
||||
if (allowMinus)
|
||||
value = trimExtraChar(value, "-", /-/g);
|
||||
else
|
||||
value = value.replace(/-/, "");
|
||||
const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
|
||||
return value.replace(regExp, "");
|
||||
}
|
||||
exports.formatNumber = formatNumber;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/input/util.js.map
|
||||
116
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/menu/menu.js
vendored
Normal file
116
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/menu/menu.js
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
||||
const uni_modules_nutuiUni_components__hooks_useProvide = require("../_hooks/useProvide.js");
|
||||
const uni_modules_nutuiUni_components__hooks_useRect = require("../_hooks/useRect.js");
|
||||
const uni_modules_nutuiUni_components__utils_common = require("../_utils/common.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
||||
const menu = require("../../../../menu.js");
|
||||
const Icon = () => "../icon/icon.js";
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-menu`;
|
||||
const _sfc_main = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
components: { Icon },
|
||||
props: menu.menuProps,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
},
|
||||
setup(props) {
|
||||
const barId = `nut-menu__bar${uni_modules_nutuiUni_components__utils_common.getRandomId()}`;
|
||||
const offset = common_vendor.ref(0);
|
||||
const instance = common_vendor.getCurrentInstance();
|
||||
const { children } = uni_modules_nutuiUni_components__hooks_useProvide.useProvide(menu.MENU_KEY)({ props, offset });
|
||||
const opened = common_vendor.computed(() => children.some((item) => {
|
||||
var _a;
|
||||
return (_a = item == null ? void 0 : item.state) == null ? void 0 : _a.showWrapper;
|
||||
}));
|
||||
const isScrollFixed = common_vendor.computed(() => {
|
||||
const { scrollFixed, scrollTop } = props;
|
||||
if (!scrollFixed)
|
||||
return false;
|
||||
return scrollTop > (typeof scrollFixed === "boolean" ? 30 : Number(scrollFixed));
|
||||
});
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, {
|
||||
"scroll-fixed": isScrollFixed.value
|
||||
});
|
||||
});
|
||||
function updateOffset(children2) {
|
||||
setTimeout(() => {
|
||||
uni_modules_nutuiUni_components__hooks_useRect.useRect(barId, instance).then((rect) => {
|
||||
if (props.direction === "down")
|
||||
offset.value = rect.bottom + common_vendor.index.getSystemInfoSync().windowTop;
|
||||
else
|
||||
offset.value = common_vendor.index.getSystemInfoSync().windowHeight - rect.top;
|
||||
children2.toggle();
|
||||
});
|
||||
}, 100);
|
||||
}
|
||||
function toggleItem(active) {
|
||||
children.forEach((item, index) => {
|
||||
if (index === active)
|
||||
updateOffset(item);
|
||||
else if (item.state.showPopup)
|
||||
item.toggle(false, { immediate: true });
|
||||
});
|
||||
}
|
||||
function getClasses(showPopup) {
|
||||
let str = "";
|
||||
const { titleClass } = props;
|
||||
if (showPopup)
|
||||
str += "active";
|
||||
if (titleClass)
|
||||
str += ` ${titleClass}`;
|
||||
return str;
|
||||
}
|
||||
return {
|
||||
barId,
|
||||
toggleItem,
|
||||
children,
|
||||
opened,
|
||||
classes,
|
||||
getClasses
|
||||
};
|
||||
}
|
||||
});
|
||||
if (!Array) {
|
||||
const _component_Icon = common_vendor.resolveComponent("Icon");
|
||||
_component_Icon();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.f(_ctx.children, (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item.renderTitle())
|
||||
}, _ctx.direction === "up" ? {
|
||||
b: "ff3f7e8c-0-" + i0,
|
||||
c: common_vendor.p({
|
||||
name: _ctx.upIcon
|
||||
})
|
||||
} : {
|
||||
d: "ff3f7e8c-1-" + i0,
|
||||
e: common_vendor.p({
|
||||
name: _ctx.downIcon
|
||||
})
|
||||
}, {
|
||||
f: common_vendor.n(_ctx.getClasses(item.state.showPopup)),
|
||||
g: item.disabled ? 1 : "",
|
||||
h: item.state.showPopup ? 1 : "",
|
||||
i: item.state.showPopup ? _ctx.activeColor : "",
|
||||
j: common_vendor.o(($event) => !item.disabled && _ctx.toggleItem(index), index),
|
||||
k: index
|
||||
});
|
||||
}),
|
||||
b: _ctx.direction === "up",
|
||||
c: _ctx.barId,
|
||||
d: _ctx.opened ? 1 : "",
|
||||
e: common_vendor.n(_ctx.classes),
|
||||
f: common_vendor.s(_ctx.customStyle)
|
||||
};
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/menu/menu.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/menu/menu.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/menu/menu.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"icon": "../icon/icon"
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user