处理数据看板
This commit is contained in:
@@ -13,9 +13,12 @@ const BLUR_EVENT = "blur";
|
||||
const CONFIRM_EVENT = "confirm";
|
||||
const CLEAR_EVENT = "clear";
|
||||
const CANCEL_EVENT = "cancel";
|
||||
const CHOOSE_EVENT = "choose";
|
||||
const SELECT_EVENT = "select";
|
||||
exports.BLUR_EVENT = BLUR_EVENT;
|
||||
exports.CANCEL_EVENT = CANCEL_EVENT;
|
||||
exports.CHANGE_EVENT = CHANGE_EVENT;
|
||||
exports.CHOOSE_EVENT = CHOOSE_EVENT;
|
||||
exports.CLEAR_EVENT = CLEAR_EVENT;
|
||||
exports.CLICK_EVENT = CLICK_EVENT;
|
||||
exports.CLOSED_EVENT = CLOSED_EVENT;
|
||||
@@ -25,6 +28,7 @@ exports.FOCUS_EVENT = FOCUS_EVENT;
|
||||
exports.INPUT_EVENT = INPUT_EVENT;
|
||||
exports.OPENED_EVENT = OPENED_EVENT;
|
||||
exports.OPEN_EVENT = OPEN_EVENT;
|
||||
exports.SELECT_EVENT = SELECT_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
|
||||
|
||||
@@ -1,2 +1,112 @@
|
||||
"use strict";
|
||||
function isLeapYear(y) {
|
||||
return y % 4 === 0 && y % 100 !== 0 || y % 400 === 0;
|
||||
}
|
||||
function getWhatDay(year, month, day) {
|
||||
const date = /* @__PURE__ */ new Date(`${year}/${month}/${day}`);
|
||||
const index = date.getDay();
|
||||
const dayNames = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
|
||||
return dayNames[index];
|
||||
}
|
||||
function getMonthPreDay(year, month) {
|
||||
const date = /* @__PURE__ */ new Date(`${year}/${month}/01`);
|
||||
let day = date.getDay();
|
||||
if (day === 0)
|
||||
day = 7;
|
||||
return day;
|
||||
}
|
||||
function getMonthDays(year, month) {
|
||||
if (month.startsWith("0"))
|
||||
month = month.split("")[1];
|
||||
return [0, 31, isLeapYear(Number(year)) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
|
||||
}
|
||||
function getNumTwoBit(n) {
|
||||
n = Number(n);
|
||||
return (n > 9 ? "" : "0") + n;
|
||||
}
|
||||
function date2Str(date, split) {
|
||||
split = split || "-";
|
||||
const y = date.getFullYear();
|
||||
const m = getNumTwoBit(date.getMonth() + 1);
|
||||
const d = getNumTwoBit(date.getDate());
|
||||
return [y, m, d].join(split);
|
||||
}
|
||||
function getDay(i) {
|
||||
i = i || 0;
|
||||
let date = /* @__PURE__ */ new Date();
|
||||
const diff = i * (1e3 * 60 * 60 * 24);
|
||||
date = new Date(date.getTime() + diff);
|
||||
return date2Str(date);
|
||||
}
|
||||
function compareDate(date1, date2) {
|
||||
const startTime = new Date(date1.replace("-", "/").replace("-", "/"));
|
||||
const endTime = new Date(date2.replace("-", "/").replace("-", "/"));
|
||||
if (startTime >= endTime)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
function isEqual(date1, date2) {
|
||||
const startTime = new Date(date1).getTime();
|
||||
const endTime = new Date(date2).getTime();
|
||||
if (startTime === endTime)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
function getMonthWeek(year, month, date, firstDayOfWeek = 0) {
|
||||
const dateNow = new Date(Number(year), Number.parseInt(month) - 1, Number(date));
|
||||
let w = dateNow.getDay();
|
||||
const d = dateNow.getDate();
|
||||
let remainder = 6 - w;
|
||||
if (firstDayOfWeek !== 0) {
|
||||
w = w === 0 ? 7 : w;
|
||||
remainder = 7 - w;
|
||||
}
|
||||
return Math.ceil((d + remainder) / 7);
|
||||
}
|
||||
function getYearWeek(year, month, date) {
|
||||
const dateNow = new Date(Number(year), Number.parseInt(month) - 1, Number(date));
|
||||
const dateFirst = new Date(Number(year), 0, 1);
|
||||
const dataNumber = Math.round((dateNow.valueOf() - dateFirst.valueOf()) / 864e5);
|
||||
return Math.ceil((dataNumber + (dateFirst.getDay() + 1 - 1)) / 7);
|
||||
}
|
||||
function getWeekDate(year, month, date, firstDayOfWeek = 0) {
|
||||
const dateNow = new Date(Number(year), Number.parseInt(month) - 1, Number(date));
|
||||
const nowTime = dateNow.getTime();
|
||||
let day = dateNow.getDay();
|
||||
if (firstDayOfWeek === 0) {
|
||||
const oneDayTime = 24 * 60 * 60 * 1e3;
|
||||
const SundayTime = nowTime - day * oneDayTime;
|
||||
const SaturdayTime = nowTime + (6 - day) * oneDayTime;
|
||||
const sunday = date2Str(new Date(SundayTime));
|
||||
const saturday = date2Str(new Date(SaturdayTime));
|
||||
return [sunday, saturday];
|
||||
} else {
|
||||
day = day === 0 ? 7 : day;
|
||||
const oneDayTime = 24 * 60 * 60 * 1e3;
|
||||
const MondayTime = nowTime - (day - 1) * oneDayTime;
|
||||
const SundayTime = nowTime + (7 - day) * oneDayTime;
|
||||
const monday = date2Str(new Date(MondayTime));
|
||||
const sunday = date2Str(new Date(SundayTime));
|
||||
return [monday, sunday];
|
||||
}
|
||||
}
|
||||
function formatResultDate(date) {
|
||||
const days = [...date.split("-")];
|
||||
days[2] = getNumTwoBit(Number(days[2]));
|
||||
days[3] = `${days[0]}-${days[1]}-${days[2]}`;
|
||||
days[4] = getWhatDay(+days[0], +days[1], +days[2]);
|
||||
return days;
|
||||
}
|
||||
exports.compareDate = compareDate;
|
||||
exports.date2Str = date2Str;
|
||||
exports.formatResultDate = formatResultDate;
|
||||
exports.getDay = getDay;
|
||||
exports.getMonthDays = getMonthDays;
|
||||
exports.getMonthPreDay = getMonthPreDay;
|
||||
exports.getMonthWeek = getMonthWeek;
|
||||
exports.getNumTwoBit = getNumTwoBit;
|
||||
exports.getWeekDate = getWeekDate;
|
||||
exports.getWhatDay = getWhatDay;
|
||||
exports.getYearWeek = getYearWeek;
|
||||
exports.isEqual = isEqual;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_utils/date.js.map
|
||||
|
||||
@@ -11,6 +11,6 @@ function requestAniFrame() {
|
||||
};
|
||||
}
|
||||
}
|
||||
const raf = requestAniFrame();
|
||||
exports.raf = raf;
|
||||
const requestAniFrame$1 = requestAniFrame();
|
||||
exports.requestAniFrame = requestAniFrame$1;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/_utils/raf.js.map
|
||||
|
||||
453
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/calendar/calendar.js
vendored
Normal file
453
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/calendar/calendar.js
vendored
Normal file
@@ -0,0 +1,453 @@
|
||||
"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_date = require("../_utils/date.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const popup = require("../../../../popup.js");
|
||||
const calendarProps = {
|
||||
...popup.popupProps,
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 是否可见
|
||||
*/
|
||||
visible: Boolean,
|
||||
/**
|
||||
* @description 类型,日期单选 `one`,区间选择 `range`,日期多选 `multiple`,周选择 `week`
|
||||
*/
|
||||
type: uni_modules_nutuiUni_components__utils_props.makeStringProp("one"),
|
||||
/**
|
||||
* @description 是否弹窗状态展示
|
||||
*/
|
||||
poppable: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 自动回填
|
||||
*/
|
||||
isAutoBackFill: Boolean,
|
||||
/**
|
||||
* @description 显示标题
|
||||
*/
|
||||
title: uni_modules_nutuiUni_components__utils_props.makeStringProp("日期选择"),
|
||||
/**
|
||||
* @description 默认值,单个日期选择为 `string`,其他为 `string[]`
|
||||
*/
|
||||
defaultValue: {
|
||||
type: [String, Array]
|
||||
},
|
||||
/**
|
||||
* @description 开始日期
|
||||
*/
|
||||
startDate: uni_modules_nutuiUni_components__utils_props.makeStringProp(uni_modules_nutuiUni_components__utils_date.getDay(0)),
|
||||
/**
|
||||
* @description 结束日期
|
||||
*/
|
||||
endDate: uni_modules_nutuiUni_components__utils_props.makeStringProp(uni_modules_nutuiUni_components__utils_date.getDay(365)),
|
||||
/**
|
||||
* @description 范围选择,开始信息文案
|
||||
*/
|
||||
startText: uni_modules_nutuiUni_components__utils_props.makeStringProp("开始"),
|
||||
/**
|
||||
* @description 范围选择,结束信息文案
|
||||
*/
|
||||
endText: uni_modules_nutuiUni_components__utils_props.makeStringProp("结束"),
|
||||
/**
|
||||
* @description 底部确认按钮文案
|
||||
*/
|
||||
confirmText: uni_modules_nutuiUni_components__utils_props.makeStringProp("确认"),
|
||||
/**
|
||||
* @description 是否展示今天标记
|
||||
*/
|
||||
showToday: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 是否在展示日历标题
|
||||
*/
|
||||
showTitle: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 是否展示日期标题
|
||||
*/
|
||||
showSubTitle: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 是否启动滚动动画
|
||||
*/
|
||||
toDateAnimation: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 设置周起始日
|
||||
*/
|
||||
firstDayOfWeek: uni_modules_nutuiUni_components__utils_props.makeNumberProp(0),
|
||||
/**
|
||||
* @description 一个用来判断该日期是否被禁用的函数,接受一个 `年 - 月 - 日` 作为参数。 应该返回一个 Boolean 值。
|
||||
* @default undefined
|
||||
*/
|
||||
disabledDate: Function,
|
||||
/**
|
||||
* @description 是否使用 footer 插槽,如果使用,此值必须为 true
|
||||
*/
|
||||
footerSlot: Boolean,
|
||||
/**
|
||||
* @description 是否使用 btn 插槽,如果使用,此值必须为 true
|
||||
*/
|
||||
btnSlot: Boolean,
|
||||
/**
|
||||
* @description 自定义弹窗样式
|
||||
*/
|
||||
popStyle: {
|
||||
type: [String, Object, Array],
|
||||
default: ""
|
||||
},
|
||||
/**
|
||||
* @description 遮罩显示时的背景是否锁定
|
||||
*/
|
||||
lockScroll: uni_modules_nutuiUni_components__utils_props.truthProp
|
||||
};
|
||||
const calendarEmits = {
|
||||
[uni_modules_nutuiUni_components__constants_event.UPDATE_VISIBLE_EVENT]: (value) => true,
|
||||
[uni_modules_nutuiUni_components__constants_event.CHOOSE_EVENT]: (value) => true,
|
||||
[uni_modules_nutuiUni_components__constants_event.SELECT_EVENT]: (value) => true,
|
||||
clickCloseIcon: () => true,
|
||||
clickOverlay: () => 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) {
|
||||
(NutCalendarItem + NutPopup)();
|
||||
}
|
||||
const NutCalendarItem = () => "../calendaritem/calendaritem.js";
|
||||
const NutPopup = () => "../popup/popup.js";
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-calendar`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: calendarProps,
|
||||
emits: calendarEmits,
|
||||
setup(__props, { expose: __expose, emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const slots = common_vendor.useSlots();
|
||||
const innerVisible = common_vendor.computed({
|
||||
get() {
|
||||
return props.visible;
|
||||
},
|
||||
set(value) {
|
||||
emit("update:visible", 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 popStyles = common_vendor.computed(() => {
|
||||
return [{
|
||||
height: "85vh"
|
||||
}, props.popStyle];
|
||||
});
|
||||
const overlayClasses = common_vendor.computed(() => {
|
||||
return `${componentName}__overlay ${props.overlayClass}`;
|
||||
});
|
||||
const calendarRef = common_vendor.ref(null);
|
||||
function scrollToDate(date) {
|
||||
var _a;
|
||||
(_a = calendarRef.value) == null ? void 0 : _a.scrollToDate(date);
|
||||
}
|
||||
function initPosition() {
|
||||
var _a;
|
||||
(_a = calendarRef.value) == null ? void 0 : _a.initPosition();
|
||||
}
|
||||
function close() {
|
||||
emit(uni_modules_nutuiUni_components__constants_event.UPDATE_VISIBLE_EVENT, false);
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CLOSE_EVENT);
|
||||
}
|
||||
function choose(param) {
|
||||
close();
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CHOOSE_EVENT, param);
|
||||
}
|
||||
function select(param) {
|
||||
emit(uni_modules_nutuiUni_components__constants_event.SELECT_EVENT, param);
|
||||
}
|
||||
function update() {
|
||||
emit(uni_modules_nutuiUni_components__constants_event.UPDATE_VISIBLE_EVENT, false);
|
||||
}
|
||||
function handleCloseIconClick() {
|
||||
emit("clickCloseIcon");
|
||||
}
|
||||
function handleOverlayClick() {
|
||||
emit("clickOverlay");
|
||||
}
|
||||
function handleOpen() {
|
||||
emit(uni_modules_nutuiUni_components__constants_event.OPEN_EVENT);
|
||||
}
|
||||
function handleOpened() {
|
||||
emit(uni_modules_nutuiUni_components__constants_event.OPENED_EVENT);
|
||||
if (props.defaultValue) {
|
||||
if (Array.isArray(props.defaultValue)) {
|
||||
if (props.defaultValue.length > 0) {
|
||||
scrollToDate(props.defaultValue[0]);
|
||||
}
|
||||
} else {
|
||||
scrollToDate(props.defaultValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
function handleClose() {
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CLOSE_EVENT);
|
||||
}
|
||||
function handleClosed() {
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CLOSED_EVENT);
|
||||
}
|
||||
__expose({
|
||||
scrollToDate,
|
||||
initPosition
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: props.poppable
|
||||
}, props.poppable ? common_vendor.e({
|
||||
b: common_vendor.unref(slots).btn
|
||||
}, common_vendor.unref(slots).btn ? {} : {}, {
|
||||
c: common_vendor.unref(slots).day
|
||||
}, common_vendor.unref(slots).day ? {
|
||||
d: common_vendor.w(({
|
||||
date
|
||||
}, s0, i0) => {
|
||||
return {
|
||||
a: common_vendor.r("day", {
|
||||
date
|
||||
}),
|
||||
b: i0,
|
||||
c: s0
|
||||
};
|
||||
}, {
|
||||
name: "day",
|
||||
path: "d",
|
||||
vueId: "4c9799f0-1,4c9799f0-0"
|
||||
})
|
||||
} : {}, {
|
||||
e: common_vendor.unref(slots).topInfo
|
||||
}, common_vendor.unref(slots).topInfo ? {
|
||||
f: common_vendor.w(({
|
||||
date
|
||||
}, s0, i0) => {
|
||||
return {
|
||||
a: common_vendor.r("topInfo", {
|
||||
date
|
||||
}),
|
||||
b: i0,
|
||||
c: s0
|
||||
};
|
||||
}, {
|
||||
name: "topInfo",
|
||||
path: "f",
|
||||
vueId: "4c9799f0-1,4c9799f0-0"
|
||||
})
|
||||
} : {}, {
|
||||
g: common_vendor.unref(slots).bottomInfo
|
||||
}, common_vendor.unref(slots).bottomInfo ? {
|
||||
h: common_vendor.w(({
|
||||
date
|
||||
}, s0, i0) => {
|
||||
return {
|
||||
a: common_vendor.r("bottomInfo", {
|
||||
date
|
||||
}),
|
||||
b: i0,
|
||||
c: s0
|
||||
};
|
||||
}, {
|
||||
name: "bottomInfo",
|
||||
path: "h",
|
||||
vueId: "4c9799f0-1,4c9799f0-0"
|
||||
})
|
||||
} : {}, {
|
||||
i: common_vendor.unref(slots).footer
|
||||
}, common_vendor.unref(slots).footer ? {
|
||||
j: common_vendor.w(({
|
||||
date
|
||||
}, s0, i0) => {
|
||||
return {
|
||||
a: common_vendor.r("footer", {
|
||||
date
|
||||
}),
|
||||
b: i0,
|
||||
c: s0
|
||||
};
|
||||
}, {
|
||||
name: "footer",
|
||||
path: "j",
|
||||
vueId: "4c9799f0-1,4c9799f0-0"
|
||||
})
|
||||
} : {}, {
|
||||
k: common_vendor.sr(calendarRef, "4c9799f0-1,4c9799f0-0", {
|
||||
"k": "calendarRef"
|
||||
}),
|
||||
l: common_vendor.o(choose),
|
||||
m: common_vendor.o(select),
|
||||
n: common_vendor.o(update),
|
||||
o: common_vendor.o(close),
|
||||
p: common_vendor.p({
|
||||
visible: innerVisible.value,
|
||||
type: props.type,
|
||||
poppable: props.poppable,
|
||||
["is-auto-back-fill"]: props.isAutoBackFill,
|
||||
title: props.title,
|
||||
["default-value"]: props.defaultValue,
|
||||
["start-date"]: props.startDate,
|
||||
["end-date"]: props.endDate,
|
||||
["start-text"]: props.startText,
|
||||
["end-text"]: props.endText,
|
||||
["confirm-text"]: props.confirmText,
|
||||
["show-today"]: props.showToday,
|
||||
["show-title"]: props.showTitle,
|
||||
["show-sub-title"]: props.showSubTitle,
|
||||
["to-date-animation"]: props.toDateAnimation,
|
||||
["first-day-of-week"]: props.firstDayOfWeek,
|
||||
["disabled-date"]: props.disabledDate,
|
||||
["footer-slot"]: props.footerSlot,
|
||||
["btn-slot"]: props.btnSlot
|
||||
}),
|
||||
q: common_vendor.o(handleCloseIconClick),
|
||||
r: common_vendor.o(handleOverlayClick),
|
||||
s: common_vendor.o(handleOpen),
|
||||
t: common_vendor.o(handleOpened),
|
||||
v: common_vendor.o(handleClose),
|
||||
w: common_vendor.o(handleClosed),
|
||||
x: common_vendor.o(($event) => innerVisible.value = $event),
|
||||
y: common_vendor.p({
|
||||
["custom-class"]: popClasses.value,
|
||||
["custom-style"]: popStyles.value,
|
||||
["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
|
||||
})
|
||||
}) : common_vendor.e({
|
||||
z: common_vendor.unref(slots).btn
|
||||
}, common_vendor.unref(slots).btn ? {} : {}, {
|
||||
A: common_vendor.unref(slots).day
|
||||
}, common_vendor.unref(slots).day ? {
|
||||
B: common_vendor.w(({
|
||||
date
|
||||
}, s0, i0) => {
|
||||
return {
|
||||
a: common_vendor.r("day", {
|
||||
date
|
||||
}),
|
||||
b: i0,
|
||||
c: s0
|
||||
};
|
||||
}, {
|
||||
name: "day",
|
||||
path: "B",
|
||||
vueId: "4c9799f0-2"
|
||||
})
|
||||
} : {}, {
|
||||
C: common_vendor.unref(slots).topInfo
|
||||
}, common_vendor.unref(slots).topInfo ? {
|
||||
D: common_vendor.w(({
|
||||
date
|
||||
}, s0, i0) => {
|
||||
return {
|
||||
a: common_vendor.r("topInfo", {
|
||||
date
|
||||
}),
|
||||
b: i0,
|
||||
c: s0
|
||||
};
|
||||
}, {
|
||||
name: "topInfo",
|
||||
path: "D",
|
||||
vueId: "4c9799f0-2"
|
||||
})
|
||||
} : {}, {
|
||||
E: common_vendor.unref(slots).bottomInfo
|
||||
}, common_vendor.unref(slots).bottomInfo ? {
|
||||
F: common_vendor.w(({
|
||||
date
|
||||
}, s0, i0) => {
|
||||
return {
|
||||
a: common_vendor.r("bottomInfo", {
|
||||
date
|
||||
}),
|
||||
b: i0,
|
||||
c: s0
|
||||
};
|
||||
}, {
|
||||
name: "bottomInfo",
|
||||
path: "F",
|
||||
vueId: "4c9799f0-2"
|
||||
})
|
||||
} : {}, {
|
||||
G: common_vendor.unref(slots).footer
|
||||
}, common_vendor.unref(slots).footer ? {
|
||||
H: common_vendor.w(({
|
||||
date
|
||||
}, s0, i0) => {
|
||||
return {
|
||||
a: common_vendor.r("footer", {
|
||||
date
|
||||
}),
|
||||
b: i0,
|
||||
c: s0
|
||||
};
|
||||
}, {
|
||||
name: "footer",
|
||||
path: "H",
|
||||
vueId: "4c9799f0-2"
|
||||
})
|
||||
} : {}, {
|
||||
I: common_vendor.sr(calendarRef, "4c9799f0-2", {
|
||||
"k": "calendarRef"
|
||||
}),
|
||||
J: common_vendor.o(choose),
|
||||
K: common_vendor.o(select),
|
||||
L: common_vendor.o(close),
|
||||
M: common_vendor.p({
|
||||
visible: innerVisible.value,
|
||||
type: props.type,
|
||||
poppable: props.poppable,
|
||||
["is-auto-back-fill"]: props.isAutoBackFill,
|
||||
title: props.title,
|
||||
["default-value"]: props.defaultValue,
|
||||
["start-date"]: props.startDate,
|
||||
["end-date"]: props.endDate,
|
||||
["start-text"]: props.startText,
|
||||
["end-text"]: props.endText,
|
||||
["confirm-text"]: props.confirmText,
|
||||
["show-today"]: props.showToday,
|
||||
["show-title"]: props.showTitle,
|
||||
["show-sub-title"]: props.showSubTitle,
|
||||
["to-date-animation"]: props.toDateAnimation,
|
||||
["first-day-of-week"]: props.firstDayOfWeek,
|
||||
["disabled-date"]: props.disabledDate,
|
||||
["footer-slot"]: props.footerSlot,
|
||||
["btn-slot"]: props.btnSlot
|
||||
})
|
||||
}), {
|
||||
N: common_vendor.n(classes.value),
|
||||
O: common_vendor.s(props.customStyle)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/calendar/calendar.js.map
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"nut-button": "../button/button",
|
||||
"nut-calendar-item": "../calendaritem/calendaritem",
|
||||
"nut-popup": "../popup/popup"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/calendar/calendar.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/calendar/calendar.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{N}}" style="{{O}}"><block wx:if="{{a}}"><nut-popup wx:if="{{y}}" u-s="{{['d']}}" bindclickCloseIcon="{{q}}" bindclickOverlay="{{r}}" bindopen="{{s}}" bindopened="{{t}}" bindclose="{{v}}" bindclosed="{{w}}" u-i="4c9799f0-0" bind:__l="__l" bindupdateVisible="{{x}}" u-p="{{y}}"><nut-calendar-item wx:if="{{p}}" class="r" u-s="{{['btn','day','topInfo','bottomInfo','footer']}}" u-r="calendarRef" bindchoose="{{l}}" bindselect="{{m}}" bindupdate="{{n}}" bindclose="{{o}}" u-i="4c9799f0-1,4c9799f0-0" bind:__l="__l" u-p="{{p}}"><view wx:if="{{b}}" slot="btn"><slot name="btn"/></view><block wx:if="{{c}}"><view wx:for="{{d}}" wx:for-item="v0" wx:key="b" slot="{{v0.c}}"><slot name="day"/></view></block><block wx:if="{{e}}"><view wx:for="{{f}}" wx:for-item="v0" wx:key="b" slot="{{v0.c}}"><slot name="topInfo"/></view></block><block wx:if="{{g}}"><view wx:for="{{h}}" wx:for-item="v0" wx:key="b" slot="{{v0.c}}"><slot name="bottomInfo"/></view></block><block wx:if="{{i}}"><view wx:for="{{j}}" wx:for-item="v0" wx:key="b" slot="{{v0.c}}"><slot name="footer"/></view></block></nut-calendar-item></nut-popup></block><block wx:else><nut-calendar-item wx:if="{{M}}" class="r" u-s="{{['btn','day','topInfo','bottomInfo','footer']}}" u-r="calendarRef" bindchoose="{{J}}" bindselect="{{K}}" bindclose="{{L}}" u-i="4c9799f0-2" bind:__l="__l" u-p="{{M}}"><view wx:if="{{z}}" slot="btn"><slot name="btn"/></view><block wx:if="{{A}}"><view wx:for="{{B}}" wx:for-item="v0" wx:key="b" slot="{{v0.c}}"><slot name="day"/></view></block><block wx:if="{{C}}"><view wx:for="{{D}}" wx:for-item="v0" wx:key="b" slot="{{v0.c}}"><slot name="topInfo"/></view></block><block wx:if="{{E}}"><view wx:for="{{F}}" wx:for-item="v0" wx:key="b" slot="{{v0.c}}"><slot name="bottomInfo"/></view></block><block wx:if="{{G}}"><view wx:for="{{H}}" wx:for-item="v0" wx:key="b" slot="{{v0.c}}"><slot name="footer"/></view></block></nut-calendar-item></block></view>
|
||||
170
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/calendar/calendar.wxss
vendored
Normal file
170
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/calendar/calendar.wxss
vendored
Normal file
@@ -0,0 +1,170 @@
|
||||
/**
|
||||
* 这里是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-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);
|
||||
}
|
||||
708
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/calendaritem/calendaritem.js
vendored
Normal file
708
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/calendaritem/calendaritem.js
vendored
Normal file
@@ -0,0 +1,708 @@
|
||||
"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_date = require("../_utils/date.js");
|
||||
const uni_modules_nutuiUni_components__utils_env = 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");
|
||||
require("../../locale/locale.js");
|
||||
const uni_modules_nutuiUni_locale_useTranslate = require("../../locale/useTranslate.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const calendaritemProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 是否可见
|
||||
*/
|
||||
visible: Boolean,
|
||||
/**
|
||||
* @description 类型,日期单选 `one`,区间选择 `range`,日期多选 `multiple`,周选择 `week`
|
||||
*/
|
||||
type: uni_modules_nutuiUni_components__utils_props.makeStringProp("one"),
|
||||
/**
|
||||
* @description 是否弹窗状态展示
|
||||
*/
|
||||
poppable: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 自动回填
|
||||
*/
|
||||
isAutoBackFill: Boolean,
|
||||
/**
|
||||
* @description 显示标题
|
||||
*/
|
||||
title: uni_modules_nutuiUni_components__utils_props.makeStringProp("日期选择"),
|
||||
/**
|
||||
* @description 默认值,单个日期选择为 `string`,其他为 `string[]`
|
||||
*/
|
||||
defaultValue: {
|
||||
type: [String, Array]
|
||||
},
|
||||
/**
|
||||
* @description 开始日期
|
||||
*/
|
||||
startDate: uni_modules_nutuiUni_components__utils_props.makeStringProp(uni_modules_nutuiUni_components__utils_date.getDay(0)),
|
||||
/**
|
||||
* @description 结束日期
|
||||
*/
|
||||
endDate: uni_modules_nutuiUni_components__utils_props.makeStringProp(uni_modules_nutuiUni_components__utils_date.getDay(365)),
|
||||
/**
|
||||
* @description 范围选择,开始信息文案
|
||||
*/
|
||||
startText: uni_modules_nutuiUni_components__utils_props.makeStringProp("开始"),
|
||||
/**
|
||||
* @description 范围选择,结束信息文案
|
||||
*/
|
||||
endText: uni_modules_nutuiUni_components__utils_props.makeStringProp("结束"),
|
||||
/**
|
||||
* @description 底部确认按钮文案
|
||||
*/
|
||||
confirmText: uni_modules_nutuiUni_components__utils_props.makeStringProp("确认"),
|
||||
/**
|
||||
* @description 是否展示今天标记
|
||||
*/
|
||||
showToday: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 是否在展示日历标题
|
||||
*/
|
||||
showTitle: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 是否展示日期标题
|
||||
*/
|
||||
showSubTitle: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 是否启动滚动动画
|
||||
*/
|
||||
toDateAnimation: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 设置周起始日
|
||||
*/
|
||||
firstDayOfWeek: uni_modules_nutuiUni_components__utils_props.makeNumberProp(0),
|
||||
/**
|
||||
* @description 一个用来判断该日期是否被禁用的函数,接受一个 `年 - 月 - 日` 作为参数。 应该返回一个 Boolean 值。
|
||||
* @default undefined
|
||||
*/
|
||||
disabledDate: Function,
|
||||
/**
|
||||
* @description 是否使用 footer 插槽,如果使用,此值必须为 true
|
||||
*/
|
||||
footerSlot: Boolean,
|
||||
/**
|
||||
* @description 是否使用 btn 插槽,如果使用,此值必须为 true
|
||||
*/
|
||||
btnSlot: Boolean
|
||||
};
|
||||
const calendaritemEmits = {
|
||||
[uni_modules_nutuiUni_components__constants_event.CHOOSE_EVENT]: (value) => true,
|
||||
[uni_modules_nutuiUni_components__constants_event.SELECT_EVENT]: (value) => true,
|
||||
update: () => true,
|
||||
close: () => true
|
||||
};
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-calendar-item`,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: calendaritemProps,
|
||||
emits: calendaritemEmits,
|
||||
setup(__props, { expose: __expose, emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
common_vendor.useSlots();
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-calendar-item`;
|
||||
const { translate } = uni_modules_nutuiUni_locale_useTranslate.useTranslate(componentName);
|
||||
const state = common_vendor.reactive({
|
||||
yearMonthTitle: "",
|
||||
defaultRange: [],
|
||||
containerHeight: "100%",
|
||||
currDate: "",
|
||||
propStartDate: "",
|
||||
propEndDate: "",
|
||||
unLoadPrev: false,
|
||||
touchParams: {
|
||||
startY: 0,
|
||||
endY: 0,
|
||||
startTime: 0,
|
||||
endTime: 0,
|
||||
lastY: 0,
|
||||
lastTime: 0
|
||||
},
|
||||
transformY: 0,
|
||||
translateY: 0,
|
||||
scrollDistance: 0,
|
||||
defaultData: [],
|
||||
chooseData: [],
|
||||
monthsData: [],
|
||||
dayPrefix: "nut-calendar__day",
|
||||
startData: "",
|
||||
endData: "",
|
||||
isRange: props.type === "range",
|
||||
timer: 0,
|
||||
currentIndex: 0,
|
||||
avgHeight: 0,
|
||||
scrollTop: 0,
|
||||
monthsNum: 0
|
||||
});
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, {
|
||||
"nut-calendar--nopop": !props.poppable,
|
||||
"nut-calendar--nofooter": props.isAutoBackFill
|
||||
});
|
||||
});
|
||||
const weekdays = translate("weekdays").map((day, index) => ({
|
||||
day,
|
||||
weekend: index === 0 || index === 6
|
||||
}));
|
||||
const weeks = common_vendor.ref([...weekdays.slice(props.firstDayOfWeek, 7), ...weekdays.slice(0, props.firstDayOfWeek)]);
|
||||
const months = common_vendor.ref(null);
|
||||
const scalePx = common_vendor.ref(2);
|
||||
const viewHeight = common_vendor.ref(0);
|
||||
const compConthsData = common_vendor.computed(() => {
|
||||
return state.monthsData.slice(state.defaultRange[0], state.defaultRange[1]);
|
||||
});
|
||||
const scrollWithAnimation = common_vendor.ref(false);
|
||||
function splitDate(date) {
|
||||
return date.split("-");
|
||||
}
|
||||
function isStart(currDate) {
|
||||
return uni_modules_nutuiUni_components__utils_date.isEqual(state.currDate[0], currDate);
|
||||
}
|
||||
function isEnd(currDate) {
|
||||
return uni_modules_nutuiUni_components__utils_date.isEqual(state.currDate[1], currDate);
|
||||
}
|
||||
function isMultiple(currDate) {
|
||||
var _a, _b;
|
||||
if (((_a = state.currDate) == null ? void 0 : _a.length) > 0) {
|
||||
return (_b = state.currDate) == null ? void 0 : _b.some((item) => {
|
||||
return uni_modules_nutuiUni_components__utils_date.isEqual(item, currDate);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function getCurrDate(day, month) {
|
||||
return `${month.curData[0]}-${month.curData[1]}-${uni_modules_nutuiUni_components__utils_date.getNumTwoBit(+day.day)}`;
|
||||
}
|
||||
function getClass(day, month, index) {
|
||||
const res = [];
|
||||
if (typeof index === "number" && ((index + 1 + props.firstDayOfWeek) % 7 === 0 || (index + props.firstDayOfWeek) % 7 === 0)) {
|
||||
res.push("weekend");
|
||||
}
|
||||
const currDate = getCurrDate(day, month);
|
||||
const { type } = props;
|
||||
if (day.type === "curr") {
|
||||
if (uni_modules_nutuiUni_components__utils_date.isEqual(state.currDate, currDate) || (type === "range" || type === "week") && (isStart(currDate) || isEnd(currDate)) || type === "multiple" && isMultiple(currDate)) {
|
||||
res.push(`${state.dayPrefix}--active`);
|
||||
} else if (state.propStartDate && uni_modules_nutuiUni_components__utils_date.compareDate(currDate, state.propStartDate) || state.propEndDate && uni_modules_nutuiUni_components__utils_date.compareDate(state.propEndDate, currDate) || props.disabledDate && props.disabledDate(currDate)) {
|
||||
res.push(`${state.dayPrefix}--disabled`);
|
||||
} else if ((type === "range" || type === "week") && Array.isArray(state.currDate) && Object.values(state.currDate).length === 2 && uni_modules_nutuiUni_components__utils_date.compareDate(state.currDate[0], currDate) && uni_modules_nutuiUni_components__utils_date.compareDate(currDate, state.currDate[1])) {
|
||||
res.push(`${state.dayPrefix}--choose`);
|
||||
}
|
||||
} else {
|
||||
res.push(`${state.dayPrefix}--disabled`);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
function confirm() {
|
||||
const { type } = props;
|
||||
if (type === "range" && state.chooseData.length === 2 || type !== "range") {
|
||||
let selectData = state.chooseData.slice(0);
|
||||
if (type === "week") {
|
||||
selectData = {
|
||||
weekDate: [handleWeekDate(state.chooseData[0]), handleWeekDate(state.chooseData[1])]
|
||||
};
|
||||
}
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CHOOSE_EVENT, selectData);
|
||||
if (props.poppable)
|
||||
emit("update");
|
||||
}
|
||||
}
|
||||
function chooseDay(day, month, isFirst = false) {
|
||||
var _a, _b;
|
||||
if (!getClass(day, month).includes(`${state.dayPrefix}--disabled`)) {
|
||||
const { type } = props;
|
||||
const [y, m] = month.curData;
|
||||
const days = [...month.curData];
|
||||
days[2] = uni_modules_nutuiUni_components__utils_date.getNumTwoBit(Number(day.day));
|
||||
days[3] = `${days[0]}-${days[1]}-${days[2]}`;
|
||||
days[4] = uni_modules_nutuiUni_components__utils_date.getWhatDay(+days[0], +days[1], +days[2]);
|
||||
if (type === "multiple") {
|
||||
if (((_a = state.currDate) == null ? void 0 : _a.length) > 0) {
|
||||
let hasIndex;
|
||||
(_b = state.currDate) == null ? void 0 : _b.forEach((item, index) => {
|
||||
if (item === days[3])
|
||||
hasIndex = index;
|
||||
});
|
||||
if (isFirst) {
|
||||
state.chooseData.push([...days]);
|
||||
} else {
|
||||
if (hasIndex !== void 0) {
|
||||
state.currDate.splice(hasIndex, 1);
|
||||
state.chooseData.splice(hasIndex, 1);
|
||||
} else {
|
||||
state.currDate.push(days[3]);
|
||||
state.chooseData.push([...days]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
state.currDate = [days[3]];
|
||||
state.chooseData = [[...days]];
|
||||
}
|
||||
} else if (type === "range") {
|
||||
const curDataLength = Object.values(state.currDate).length;
|
||||
if (curDataLength === 2 || curDataLength === 0) {
|
||||
state.currDate = [days[3]];
|
||||
} else {
|
||||
if (uni_modules_nutuiUni_components__utils_date.compareDate(state.currDate[0], days[3]))
|
||||
Array.isArray(state.currDate) && state.currDate.push(days[3]);
|
||||
else
|
||||
Array.isArray(state.currDate) && state.currDate.unshift(days[3]);
|
||||
}
|
||||
if (state.chooseData.length === 2 || !state.chooseData.length) {
|
||||
state.chooseData = [[...days]];
|
||||
} else {
|
||||
if (uni_modules_nutuiUni_components__utils_date.compareDate(state.chooseData[0][3], days[3]))
|
||||
state.chooseData = [...state.chooseData, [...days]];
|
||||
else
|
||||
state.chooseData = [[...days], ...state.chooseData];
|
||||
}
|
||||
} else if (type === "week") {
|
||||
const weekArr = uni_modules_nutuiUni_components__utils_date.getWeekDate(y, m, day.day, props.firstDayOfWeek);
|
||||
if (state.propStartDate && uni_modules_nutuiUni_components__utils_date.compareDate(weekArr[0], state.propStartDate))
|
||||
weekArr.splice(0, 1, state.propStartDate);
|
||||
if (state.propEndDate && uni_modules_nutuiUni_components__utils_date.compareDate(state.propEndDate, weekArr[1]))
|
||||
weekArr.splice(1, 1, state.propEndDate);
|
||||
state.currDate = weekArr;
|
||||
state.chooseData = [uni_modules_nutuiUni_components__utils_date.formatResultDate(weekArr[0]), uni_modules_nutuiUni_components__utils_date.formatResultDate(weekArr[1])];
|
||||
} else {
|
||||
state.currDate = days[3];
|
||||
state.chooseData = [...days];
|
||||
}
|
||||
if (!isFirst) {
|
||||
let selectData = state.chooseData;
|
||||
if (type === "week") {
|
||||
selectData = {
|
||||
weekDate: [
|
||||
handleWeekDate(state.chooseData[0]),
|
||||
handleWeekDate(state.chooseData[1])
|
||||
]
|
||||
};
|
||||
}
|
||||
emit(uni_modules_nutuiUni_components__constants_event.SELECT_EVENT, selectData);
|
||||
if (props.isAutoBackFill || !props.poppable)
|
||||
confirm();
|
||||
}
|
||||
}
|
||||
}
|
||||
function handleWeekDate(weekDate) {
|
||||
const [y, m, d] = weekDate;
|
||||
return {
|
||||
date: weekDate,
|
||||
monthWeekNum: uni_modules_nutuiUni_components__utils_date.getMonthWeek(y, m, d, props.firstDayOfWeek),
|
||||
yearWeekNum: uni_modules_nutuiUni_components__utils_date.getYearWeek(y, m, d)
|
||||
};
|
||||
}
|
||||
function getCurrData(type) {
|
||||
const monthData = type === "prev" ? state.monthsData[0] : state.monthsData[state.monthsData.length - 1];
|
||||
let year = Number.parseInt(monthData.curData[0]);
|
||||
let month = Number.parseInt(monthData.curData[1].toString().replace(/^0/, ""));
|
||||
switch (type) {
|
||||
case "prev":
|
||||
month === 1 && (year -= 1);
|
||||
month = month === 1 ? 12 : --month;
|
||||
break;
|
||||
case "next":
|
||||
month === 12 && (year += 1);
|
||||
month = month === 12 ? 1 : ++month;
|
||||
break;
|
||||
}
|
||||
return [`${year}`, uni_modules_nutuiUni_components__utils_date.getNumTwoBit(month), `${uni_modules_nutuiUni_components__utils_date.getMonthDays(String(year), String(month))}`];
|
||||
}
|
||||
function getDaysStatus(days, type, dateInfo) {
|
||||
const { year, month } = dateInfo;
|
||||
if (type === "prev" && days >= 7)
|
||||
days -= 7;
|
||||
return Array.from(Array.from({ length: days }), (v, k) => {
|
||||
return {
|
||||
day: String(k + 1),
|
||||
type,
|
||||
year,
|
||||
month
|
||||
};
|
||||
});
|
||||
}
|
||||
function getPreDaysStatus(days, type, dateInfo, preCurrMonthDays) {
|
||||
days = days - props.firstDayOfWeek;
|
||||
const { year, month } = dateInfo;
|
||||
if (type === "prev" && days >= 7)
|
||||
days -= 7;
|
||||
const months2 = Array.from(Array.from({ length: preCurrMonthDays }), (v, k) => {
|
||||
return {
|
||||
day: String(k + 1),
|
||||
type,
|
||||
year,
|
||||
month
|
||||
};
|
||||
});
|
||||
return months2.slice(preCurrMonthDays - days);
|
||||
}
|
||||
function getMonth(curData, type) {
|
||||
const preMonthDays = uni_modules_nutuiUni_components__utils_date.getMonthPreDay(+curData[0], +curData[1]);
|
||||
let preMonth = Number(curData[1]) - 1;
|
||||
let preYear = Number(curData[0]);
|
||||
if (preMonth <= 0) {
|
||||
preMonth = 12;
|
||||
preYear += 1;
|
||||
}
|
||||
const currMonthDays = uni_modules_nutuiUni_components__utils_date.getMonthDays(String(curData[0]), String(curData[1]));
|
||||
const preCurrMonthDays = uni_modules_nutuiUni_components__utils_date.getMonthDays(`${preYear}`, `${preMonth}`);
|
||||
const title = {
|
||||
year: curData[0],
|
||||
month: curData[1]
|
||||
};
|
||||
const monthInfo = {
|
||||
curData,
|
||||
title: translate("monthTitle", title.year, title.month),
|
||||
monthData: [
|
||||
...getPreDaysStatus(
|
||||
preMonthDays,
|
||||
"prev",
|
||||
{ month: String(preMonth), year: String(preYear) },
|
||||
preCurrMonthDays
|
||||
),
|
||||
...getDaysStatus(currMonthDays, "curr", title)
|
||||
],
|
||||
cssHeight: 0,
|
||||
cssScrollHeight: 0
|
||||
};
|
||||
let titleHeight, itemHeight;
|
||||
if (uni_modules_nutuiUni_components__utils_env.isH5) {
|
||||
titleHeight = 46 * scalePx.value + 16 * scalePx.value * 2;
|
||||
itemHeight = 128 * scalePx.value;
|
||||
} else {
|
||||
titleHeight = Math.floor(46 * scalePx.value) + Math.floor(16 * scalePx.value) * 2;
|
||||
itemHeight = Math.floor(128 * scalePx.value);
|
||||
}
|
||||
monthInfo.cssHeight = titleHeight + (monthInfo.monthData.length > 35 ? itemHeight * 6 : itemHeight * 5);
|
||||
let cssScrollHeight = 0;
|
||||
if (state.monthsData.length > 0) {
|
||||
cssScrollHeight = state.monthsData[state.monthsData.length - 1].cssScrollHeight + state.monthsData[state.monthsData.length - 1].cssHeight;
|
||||
}
|
||||
monthInfo.cssScrollHeight = cssScrollHeight;
|
||||
if (type === "next") {
|
||||
if (!state.endData || !uni_modules_nutuiUni_components__utils_date.compareDate(
|
||||
`${state.endData[0]}-${state.endData[1]}-${uni_modules_nutuiUni_components__utils_date.getMonthDays(state.endData[0], state.endData[1])}`,
|
||||
`${curData[0]}-${curData[1]}-${curData[2]}`
|
||||
)) {
|
||||
state.monthsData.push(monthInfo);
|
||||
}
|
||||
} else {
|
||||
if (!state.startData || !uni_modules_nutuiUni_components__utils_date.compareDate(
|
||||
`${curData[0]}-${curData[1]}-${curData[2]}`,
|
||||
`${state.startData[0]}-${state.startData[1]}-01`
|
||||
)) {
|
||||
state.monthsData.unshift(monthInfo);
|
||||
} else {
|
||||
state.unLoadPrev = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
function initData() {
|
||||
const propStartDate = props.startDate ? props.startDate : uni_modules_nutuiUni_components__utils_date.getDay(0);
|
||||
const propEndDate = props.endDate ? props.endDate : uni_modules_nutuiUni_components__utils_date.getDay(365);
|
||||
state.propStartDate = propStartDate;
|
||||
state.propEndDate = propEndDate;
|
||||
state.startData = splitDate(propStartDate);
|
||||
state.endData = splitDate(propEndDate);
|
||||
if (props.defaultValue || Array.isArray(props.defaultValue) && props.defaultValue.length > 0) {
|
||||
state.currDate = props.type !== "one" ? [...props.defaultValue] : props.defaultValue;
|
||||
}
|
||||
const startDate = {
|
||||
year: Number(state.startData[0]),
|
||||
month: Number(state.startData[1])
|
||||
};
|
||||
const endDate = {
|
||||
year: Number(state.endData[0]),
|
||||
month: Number(state.endData[1])
|
||||
};
|
||||
let monthsNum = endDate.month - startDate.month;
|
||||
if (endDate.year - startDate.year > 0)
|
||||
monthsNum = monthsNum + 12 * (endDate.year - startDate.year);
|
||||
if (monthsNum <= 0)
|
||||
monthsNum = 1;
|
||||
getMonth(state.startData, "next");
|
||||
let i = 1;
|
||||
do
|
||||
getMonth(getCurrData("next"), "next");
|
||||
while (i++ < monthsNum);
|
||||
state.monthsNum = monthsNum;
|
||||
if (props.type === "range" && Array.isArray(state.currDate)) {
|
||||
if (state.currDate.length > 0) {
|
||||
if (propStartDate && uni_modules_nutuiUni_components__utils_date.compareDate(state.currDate[0], propStartDate))
|
||||
state.currDate.splice(0, 1, propStartDate);
|
||||
if (propEndDate && uni_modules_nutuiUni_components__utils_date.compareDate(propEndDate, state.currDate[1]))
|
||||
state.currDate.splice(1, 1, propEndDate);
|
||||
state.defaultData = [...splitDate(state.currDate[0]), ...splitDate(state.currDate[1])];
|
||||
}
|
||||
} else if (props.type === "multiple" && Array.isArray(state.currDate)) {
|
||||
if (state.currDate.length > 0) {
|
||||
const defaultArr = [];
|
||||
const obj = {};
|
||||
state.currDate.forEach((item) => {
|
||||
if (propStartDate && !uni_modules_nutuiUni_components__utils_date.compareDate(item, propStartDate) && propEndDate && !uni_modules_nutuiUni_components__utils_date.compareDate(propEndDate, item)) {
|
||||
if (!Object.hasOwnProperty.call(obj, item)) {
|
||||
defaultArr.push(item);
|
||||
obj[item] = item;
|
||||
}
|
||||
}
|
||||
});
|
||||
state.currDate = [...defaultArr];
|
||||
state.defaultData = [...splitDate(defaultArr[0])];
|
||||
}
|
||||
} else if (props.type === "week" && Array.isArray(state.currDate)) {
|
||||
if (state.currDate.length > 0) {
|
||||
const [y, m, d] = splitDate(state.currDate[0]);
|
||||
state.currDate = uni_modules_nutuiUni_components__utils_date.getWeekDate(y, m, d, props.firstDayOfWeek);
|
||||
if (propStartDate && uni_modules_nutuiUni_components__utils_date.compareDate(state.currDate[0], propStartDate))
|
||||
state.currDate.splice(0, 1, propStartDate);
|
||||
if (propEndDate && uni_modules_nutuiUni_components__utils_date.compareDate(propEndDate, state.currDate[1]))
|
||||
state.currDate.splice(1, 1, propEndDate);
|
||||
state.defaultData = [...splitDate(state.currDate[0]), ...splitDate(state.currDate[1])];
|
||||
}
|
||||
} else {
|
||||
if (state.currDate) {
|
||||
if (propStartDate && uni_modules_nutuiUni_components__utils_date.compareDate(state.currDate, propStartDate))
|
||||
state.currDate = propStartDate;
|
||||
else if (propEndDate && !uni_modules_nutuiUni_components__utils_date.compareDate(state.currDate, propEndDate))
|
||||
state.currDate = propEndDate;
|
||||
state.defaultData = [...splitDate(state.currDate)];
|
||||
}
|
||||
}
|
||||
let current = 0;
|
||||
let lastCurrent = 0;
|
||||
if (state.defaultData.length > 0) {
|
||||
state.monthsData.forEach((item, index) => {
|
||||
if (item.title === translate("monthTitle", state.defaultData[0], state.defaultData[1]))
|
||||
current = index;
|
||||
if (props.type === "range" || props.type === "week") {
|
||||
if (item.title === translate("monthTitle", state.defaultData[3], state.defaultData[4]))
|
||||
lastCurrent = index;
|
||||
}
|
||||
});
|
||||
}
|
||||
setDefaultRange(monthsNum, current);
|
||||
state.currentIndex = current;
|
||||
state.yearMonthTitle = state.monthsData[state.currentIndex].title;
|
||||
if (state.defaultData.length > 0) {
|
||||
if (state.isRange) {
|
||||
chooseDay({ day: state.defaultData[2], type: "curr" }, state.monthsData[state.currentIndex], true);
|
||||
chooseDay({ day: state.defaultData[5], type: "curr" }, state.monthsData[lastCurrent], true);
|
||||
} else if (props.type === "week") {
|
||||
chooseDay({ day: state.defaultData[2], type: "curr" }, state.monthsData[state.currentIndex], true);
|
||||
} else if (props.type === "multiple") {
|
||||
[...state.currDate].forEach((item) => {
|
||||
const dateArr = splitDate(item);
|
||||
let current2 = state.currentIndex;
|
||||
state.monthsData.forEach((item2, index) => {
|
||||
if (item2.title === translate("monthTitle", dateArr[0], dateArr[1]))
|
||||
current2 = index;
|
||||
});
|
||||
chooseDay({ day: dateArr[2], type: "curr" }, state.monthsData[current2], true);
|
||||
});
|
||||
} else {
|
||||
chooseDay({ day: state.defaultData[2], type: "curr" }, state.monthsData[state.currentIndex], true);
|
||||
}
|
||||
}
|
||||
const lastItem = state.monthsData[state.monthsData.length - 1];
|
||||
const containerHeight = lastItem.cssHeight + lastItem.cssScrollHeight;
|
||||
state.containerHeight = `${containerHeight}px`;
|
||||
state.scrollTop = Math.ceil(state.monthsData[state.currentIndex].cssScrollHeight);
|
||||
state.avgHeight = Math.floor(containerHeight / (monthsNum + 1));
|
||||
if (months == null ? void 0 : months.value)
|
||||
viewHeight.value = months.value.clientHeight;
|
||||
}
|
||||
function scrollToDate(date) {
|
||||
if (uni_modules_nutuiUni_components__utils_date.compareDate(date, state.propStartDate))
|
||||
date = state.propStartDate;
|
||||
else if (!uni_modules_nutuiUni_components__utils_date.compareDate(date, state.propEndDate))
|
||||
date = state.propEndDate;
|
||||
const dateArr = splitDate(date);
|
||||
state.monthsData.forEach((item, index) => {
|
||||
if (item.title === translate("monthTitle", dateArr[0], dateArr[1])) {
|
||||
state.scrollTop += 1;
|
||||
scrollWithAnimation.value = props.toDateAnimation;
|
||||
uni_modules_nutuiUni_components__utils_raf.requestAniFrame(() => {
|
||||
setTimeout(() => {
|
||||
state.scrollTop = state.monthsData[index].cssScrollHeight;
|
||||
setTimeout(() => {
|
||||
scrollWithAnimation.value = false;
|
||||
}, 200);
|
||||
}, 10);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function initPosition() {
|
||||
state.scrollTop = Math.ceil(state.monthsData[state.currentIndex].cssScrollHeight);
|
||||
}
|
||||
function setDefaultRange(monthsNum, current) {
|
||||
if (monthsNum >= 3) {
|
||||
if (current > 0 && current < monthsNum)
|
||||
state.defaultRange = [current - 1, current + 3];
|
||||
else if (current === 0)
|
||||
state.defaultRange = [current, current + 4];
|
||||
else if (current === monthsNum)
|
||||
state.defaultRange = [current - 2, current + 2];
|
||||
} else {
|
||||
state.defaultRange = [0, monthsNum + 2];
|
||||
}
|
||||
state.translateY = state.monthsData[state.defaultRange[0]].cssScrollHeight;
|
||||
}
|
||||
function isActive(day, month) {
|
||||
return (props.type === "range" || props.type === "week") && day.type === "curr" && getClass(day, month).includes("nut-calendar__day--active");
|
||||
}
|
||||
function isStartTip(day, month) {
|
||||
return isActive(day, month) && isStart(getCurrDate(day, month));
|
||||
}
|
||||
function isEndTip(day, month) {
|
||||
if (state.currDate.length >= 2 && isEnd(getCurrDate(day, month)))
|
||||
return isActive(day, month);
|
||||
return false;
|
||||
}
|
||||
function rangeTip() {
|
||||
if (state.currDate.length >= 2)
|
||||
return uni_modules_nutuiUni_components__utils_date.isEqual(state.currDate[0], state.currDate[1]);
|
||||
}
|
||||
function isCurrDay(dateInfo) {
|
||||
const date = `${dateInfo.year}-${dateInfo.month}-${Number(dateInfo.day) < 10 ? `0${dateInfo.day}` : dateInfo.day}`;
|
||||
return uni_modules_nutuiUni_components__utils_date.isEqual(date, uni_modules_nutuiUni_components__utils_date.date2Str(/* @__PURE__ */ new Date()));
|
||||
}
|
||||
function mothsViewScroll(e) {
|
||||
if (state.monthsData.length <= 1)
|
||||
return;
|
||||
const currentScrollTop = e.detail.scrollTop;
|
||||
let current = Math.floor(currentScrollTop / state.avgHeight);
|
||||
if (current === 0) {
|
||||
if (currentScrollTop >= state.monthsData[current + 1].cssScrollHeight)
|
||||
current += 1;
|
||||
} else if (current > 0 && current < state.monthsNum - 1) {
|
||||
if (currentScrollTop >= state.monthsData[current + 1].cssScrollHeight)
|
||||
current += 1;
|
||||
if (currentScrollTop < state.monthsData[current].cssScrollHeight)
|
||||
current -= 1;
|
||||
}
|
||||
if (state.currentIndex !== current) {
|
||||
state.currentIndex = current;
|
||||
setDefaultRange(state.monthsNum, current);
|
||||
}
|
||||
state.yearMonthTitle = state.monthsData[current].title;
|
||||
}
|
||||
function resetRender() {
|
||||
state.chooseData.splice(0);
|
||||
state.monthsData.splice(0);
|
||||
initData();
|
||||
}
|
||||
common_vendor.watch(() => props.defaultValue, (value) => {
|
||||
if (value) {
|
||||
if (props.poppable) {
|
||||
resetRender();
|
||||
}
|
||||
}
|
||||
});
|
||||
common_vendor.onMounted(() => {
|
||||
common_vendor.index.getSystemInfo({
|
||||
success(res) {
|
||||
let scale = 2;
|
||||
let toFixed = 3;
|
||||
if (uni_modules_nutuiUni_components__utils_env.isH5) {
|
||||
toFixed = 5;
|
||||
const fontSize = document.documentElement.style.fontSize;
|
||||
scale = Number((Number.parseInt(fontSize) / 40).toFixed(toFixed));
|
||||
} else {
|
||||
const screenWidth = res.screenWidth;
|
||||
scale = Number((screenWidth / 750).toFixed(toFixed));
|
||||
}
|
||||
scalePx.value = scale;
|
||||
initData();
|
||||
}
|
||||
});
|
||||
});
|
||||
__expose({
|
||||
scrollToDate,
|
||||
initPosition
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: props.showTitle
|
||||
}, props.showTitle ? {
|
||||
b: common_vendor.t(props.title || common_vendor.unref(translate)("title"))
|
||||
} : {}, {
|
||||
c: props.btnSlot
|
||||
}, props.btnSlot ? {} : {}, {
|
||||
d: props.showSubTitle
|
||||
}, props.showSubTitle ? {
|
||||
e: common_vendor.t(state.yearMonthTitle)
|
||||
} : {}, {
|
||||
f: common_vendor.f(weeks.value, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.day),
|
||||
b: index,
|
||||
c: item.weekend ? 1 : ""
|
||||
};
|
||||
}),
|
||||
g: common_vendor.f(compConthsData.value, (month, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(month.title),
|
||||
b: common_vendor.f(month.monthData, (day, i, i1) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(day.type === "curr" ? day.day : ""),
|
||||
b: props.showToday && isCurrDay(day)
|
||||
}, props.showToday && isCurrDay(day) ? {
|
||||
c: common_vendor.t(common_vendor.unref(translate)("today"))
|
||||
} : {}, {
|
||||
d: isStartTip(day, month)
|
||||
}, isStartTip(day, month) ? {
|
||||
e: common_vendor.t(props.startText || common_vendor.unref(translate)("start")),
|
||||
f: rangeTip() ? 1 : ""
|
||||
} : {}, {
|
||||
g: isEndTip(day, month)
|
||||
}, isEndTip(day, month) ? {
|
||||
h: common_vendor.t(props.endText || common_vendor.unref(translate)("end"))
|
||||
} : {}, {
|
||||
i: common_vendor.n(getClass(day, month, i)),
|
||||
j: common_vendor.o(($event) => chooseDay(day, month), i),
|
||||
k: i
|
||||
});
|
||||
}),
|
||||
c: index
|
||||
};
|
||||
}),
|
||||
h: props.type === "range" ? 1 : "",
|
||||
i: `translateY(${state.translateY}px)`,
|
||||
j: state.containerHeight,
|
||||
k: state.scrollTop,
|
||||
l: scrollWithAnimation.value,
|
||||
m: common_vendor.o(mothsViewScroll),
|
||||
n: props.poppable && !props.isAutoBackFill
|
||||
}, props.poppable && !props.isAutoBackFill ? common_vendor.e({
|
||||
o: props.footerSlot
|
||||
}, props.footerSlot ? {
|
||||
p: common_vendor.r("footer", {
|
||||
date: state.chooseData
|
||||
})
|
||||
} : {
|
||||
q: common_vendor.t(props.confirmText || common_vendor.unref(translate)("confirm")),
|
||||
r: common_vendor.o(confirm)
|
||||
}) : {}, {
|
||||
s: common_vendor.n(classes.value),
|
||||
t: common_vendor.s(props.customStyle)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/calendaritem/calendaritem.js.map
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/calendaritem/calendaritem.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/calendaritem/calendaritem.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{s}}" style="{{t}}"><view class="nut-calendar__header"><view wx:if="{{a}}" class="nut-calendar__header-title">{{b}}</view><view wx:if="{{c}}" class="nut-calendar__header-slot"><slot name="btn"/></view><view wx:if="{{d}}" class="nut-calendar__header-subtitle">{{e}}</view><view class="nut-calendar__weekdays"><view wx:for="{{f}}" wx:for-item="item" wx:key="b" class="{{['nut-calendar__weekday', item.c && 'weekend']}}">{{item.a}}</view></view></view><scroll-view ref="months" class="nut-calendar__content" scroll-y="{{true}}" scroll-top="{{k}}" scroll-with-animation="{{l}}" bindscroll="{{m}}"><view class="nut-calendar__panel" style="{{'height:' + j}}"><view class="nut-calendar__body" style="{{'transform:' + i}}"><view wx:for="{{g}}" wx:for-item="month" wx:key="c" class="nut-calendar__month"><view class="nut-calendar__month-title">{{month.a}}</view><view class="nut-calendar__days"><view class="{{['nut-calendar__days-item', h && 'nut-calendar__days-item--range']}}"><block wx:for="{{month.b}}" wx:for-item="day" wx:key="k"><view class="{{['nut-calendar__day', day.i]}}" bindtap="{{day.j}}"><view class="nut-calendar__day-value">{{day.a}}</view><view wx:if="{{day.b}}" class="nut-calendar__day-tips--curr">{{day.c}}</view><view wx:if="{{day.d}}" class="{{['nut-calendar__day-tip', day.f && 'nut-calendar__day-tips--top']}}">{{day.e}}</view><view wx:if="{{day.g}}" class="nut-calendar__day-tip">{{day.h}}</view></view></block></view></view></view></view></view></scroll-view><view wx:if="{{n}}" class="nut-calendar__footer"><slot wx:if="{{o}}" name="footer"/><view wx:else class="nut-calendar__confirm" bindtap="{{r}}">{{q}}</view></view></view>
|
||||
253
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/calendaritem/calendaritem.wxss
vendored
Normal file
253
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/calendaritem/calendaritem.wxss
vendored
Normal file
@@ -0,0 +1,253 @@
|
||||
/**
|
||||
* 这里是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-calendar-item {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
background: var(--nut-dark-background, #131313);
|
||||
}
|
||||
.nut-theme-dark .nut-calendar__header {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
background: var(--nut-dark-background, #131313);
|
||||
}
|
||||
.nut-theme-dark .nut-calendar__content .nut-theme-dark .nut-calendar__panel .nut-theme-dark .nut-calendar__days .nut-theme-dark .nut-calendar__day--disabled {
|
||||
color: var(--nut-dark-calendar-disabled, #646566) !important;
|
||||
}
|
||||
.nut-theme-dark .nut-calendar__content .nut-theme-dark .nut-calendar__panel .nut-theme-dark .nut-calendar__days .calendar-month-day-choose {
|
||||
color: var(--nut-calendar-choose-font-color, var(--nut-primary-color, #fa2c19));
|
||||
background-color: var(--nut-dark-calendar-choose-color, rgba(227, 227, 227, 0.2));
|
||||
}
|
||||
.nut-theme-dark .nut-calendar__footer {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
background: var(--nut-dark-background2, #1b1b1b);
|
||||
}
|
||||
.nut-calendar-item {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
background-color: var(--nut-white, #fff);
|
||||
}
|
||||
.nut-calendar.nut-calendar--nopop .nut-calendar__header .nut-calendar__header-title {
|
||||
font-size: var(--nut-calendar-base-font, var(--nut-font-size-3, 16px));
|
||||
}
|
||||
.nut-calendar .popup-box {
|
||||
height: 100%;
|
||||
}
|
||||
.nut-calendar ::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
.nut-calendar__header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-top: 1px;
|
||||
text-align: center;
|
||||
background-color: var(--nut-white, #fff);
|
||||
}
|
||||
.nut-calendar__header-title {
|
||||
font-size: var(--nut-calendar-title-font, var(--nut-font-size-4, 18px));
|
||||
font-weight: var(--nut-calendar-title-font-weight, 500);
|
||||
line-height: 44px;
|
||||
}
|
||||
.nut-calendar__header-slot {
|
||||
min-height: 24px;
|
||||
}
|
||||
.nut-calendar__header-subtitle {
|
||||
padding: 7px 0;
|
||||
font-size: var(--nut-calendar-sub-title-font, var(--nut-font-size-2, 14px));
|
||||
line-height: 22px;
|
||||
}
|
||||
.nut-calendar__header .nut-calendar__weekdays {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
height: 36px;
|
||||
border-radius: 0 0 12px 12px;
|
||||
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
.nut-calendar__header .nut-calendar__weekdays .nut-calendar__weekday.weekend {
|
||||
color: var(--nut-calendar-day67-font-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-calendar__content {
|
||||
display: block;
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel .nut-calendar__body {
|
||||
display: block;
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel .nut-calendar__month {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel view:nth-of-type(2) .nut-calendar__month-title {
|
||||
padding-top: 0;
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel .calendar-loading-tip {
|
||||
position: absolute;
|
||||
top: -50px;
|
||||
right: 0;
|
||||
left: 0;
|
||||
height: 50px;
|
||||
font-size: var(--nut-calendar-text-font, var(--nut-font-size-1, 12px));
|
||||
line-height: 50px;
|
||||
color: var(--nut-text-color, #808080);
|
||||
text-align: center;
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel .nut-calendar__month-title {
|
||||
height: 23px;
|
||||
margin: 8px 0;
|
||||
font-size: var(--nut-calendar-month-title-font-size, inherit);
|
||||
line-height: 23px;
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel .nut-calendar__days {
|
||||
overflow: hidden;
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel .nut-calendar__days .nut-calendar__day {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
float: left;
|
||||
width: 14.28%;
|
||||
height: 64px;
|
||||
font-weight: var(--nut-calendar-day-font-weight, 500);
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel .nut-calendar__days .nut-calendar__day.weekend {
|
||||
color: var(--nut-calendar-day67-font-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel .nut-calendar__days .nut-calendar__day .nut-calendar__day-tips {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel .nut-calendar__days .nut-calendar__day .nut-calendar__day-tips--curr {
|
||||
position: absolute;
|
||||
bottom: 6px;
|
||||
width: 100%;
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel .nut-calendar__days .nut-calendar__day .nut-calendar__day-tip {
|
||||
position: absolute;
|
||||
bottom: 6px;
|
||||
width: 100%;
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
color: var(--nut-calendar-primary-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel .nut-calendar__days .nut-calendar__day .nut-calendar__day-tips--top {
|
||||
top: 6px;
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel .nut-calendar__days .nut-calendar__day .nut-calendar__day-tips--bottom {
|
||||
bottom: 6px;
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel .nut-calendar__days .nut-calendar__day--active {
|
||||
color: var(--nut-white, #fff) !important;
|
||||
background-color: var(--nut-calendar-primary-color, var(--nut-primary-color, #fa2c19));
|
||||
border-radius: var(--nut-calendar-day-active-border-radius, 0);
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel .nut-calendar__days .nut-calendar__day--active .nut-calendar__day-tips {
|
||||
visibility: hidden;
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel .nut-calendar__days .nut-calendar__day--active .nut-calendar__day-tips--curr {
|
||||
visibility: hidden;
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel .nut-calendar__days .nut-calendar__day--active .nut-calendar__day-tip {
|
||||
color: var(--nut-white, #fff);
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel .nut-calendar__days .nut-calendar__day--disabled {
|
||||
color: var(--nut-calendar-disable-color, #d1d0d0) !important;
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel .nut-calendar__days .nut-calendar__day--choose {
|
||||
color: var(--nut-calendar-choose-font-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel .nut-calendar__days .nut-calendar__day--choose::after {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
content: "";
|
||||
background-color: var(--nut-calendar-choose-color, var(--nut-primary-color, #fa2c19));
|
||||
opacity: 0.09;
|
||||
}
|
||||
.nut-calendar__content .nut-calendar__panel .nut-calendar__days .nut-calendar__day .nut-calendar__day-value {
|
||||
padding: 2px 0;
|
||||
font-size: var(--nut-calendar-day-font, 16px);
|
||||
}
|
||||
.nut-calendar__footer {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 62px;
|
||||
background-color: var(--nut-white, #fff);
|
||||
}
|
||||
.nut-calendar__footer .nut-calendar__confirm {
|
||||
width: 100%;
|
||||
height: 44px;
|
||||
margin: 10px 18px;
|
||||
line-height: 44px;
|
||||
color: var(--nut-white, #fff);
|
||||
text-align: center;
|
||||
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%));
|
||||
border-radius: 22px;
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
"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
|
||||
@@ -1 +0,0 @@
|
||||
<view class="{{a}}" style="{{b}}"><slot/></view>
|
||||
@@ -1,50 +0,0 @@
|
||||
/**
|
||||
* 这里是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 */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
@@ -1,178 +0,0 @@
|
||||
"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
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"nut-icon": "../icon/icon"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<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="78b69670-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>
|
||||
@@ -1,181 +0,0 @@
|
||||
/**
|
||||
* 这里是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;
|
||||
}
|
||||
@@ -1,189 +0,0 @@
|
||||
"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
|
||||
@@ -1 +0,0 @@
|
||||
<nut-popup wx:if="{{z}}" u-s="{{['d']}}" bindclickOverlay="{{w}}" bindclickCloseIcon="{{x}}" u-i="d955d6f0-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="d955d6f0-1,d955d6f0-0" bind:__l="__l" u-p="{{m}}">{{k}}</nut-button><nut-button wx:if="{{n}}" u-s="{{['d']}}" bindclick="{{p}}" u-i="d955d6f0-2,d955d6f0-0" bind:__l="__l" u-p="{{q}}">{{o}}</nut-button></block></view></view></nut-popup>
|
||||
@@ -1,468 +0,0 @@
|
||||
/**
|
||||
* 这里是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;
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
"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
|
||||
@@ -1,131 +0,0 @@
|
||||
"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 priceProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 价格数量
|
||||
*/
|
||||
price: uni_modules_nutuiUni_components__utils_props.makeNumericProp(0),
|
||||
/**
|
||||
* @description 是否需要加上 symbol 符号
|
||||
*/
|
||||
needSymbol: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 符号类型
|
||||
*/
|
||||
symbol: uni_modules_nutuiUni_components__utils_props.makeStringProp("¥"),
|
||||
/**
|
||||
* @description 小数位位数
|
||||
*/
|
||||
decimalDigits: uni_modules_nutuiUni_components__utils_props.makeNumberProp(2),
|
||||
/**
|
||||
* @description 是否按照千分号形式显示
|
||||
*/
|
||||
thousands: Boolean,
|
||||
/**
|
||||
* @description 符号显示在价格前或者后,`before`、`after`
|
||||
*/
|
||||
position: uni_modules_nutuiUni_components__utils_props.makeStringProp("before"),
|
||||
/**
|
||||
* @description 价格尺寸,`small`、`normal`、`large`
|
||||
*/
|
||||
size: uni_modules_nutuiUni_components__utils_props.makeStringProp("normal"),
|
||||
/**
|
||||
* @description 是否展示划线价
|
||||
*/
|
||||
strikeThrough: Boolean
|
||||
};
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-price`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: priceProps,
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, {
|
||||
[`${componentName}--strike`]: props.strikeThrough
|
||||
});
|
||||
});
|
||||
function replaceSpecialChar(url) {
|
||||
url = url.replace(/"/g, '"');
|
||||
url = url.replace(/&/g, "&");
|
||||
url = url.replace(/</g, "<");
|
||||
url = url.replace(/>/g, ">");
|
||||
url = url.replace(/ /g, " ");
|
||||
url = url.replace(/¥/g, "¥");
|
||||
return url;
|
||||
}
|
||||
const showSymbol = common_vendor.computed(() => {
|
||||
const symbol = props.needSymbol ? replaceSpecialChar(props.symbol) : "";
|
||||
return symbol;
|
||||
});
|
||||
function checkPoint(price) {
|
||||
return String(price).indexOf(".") > 0;
|
||||
}
|
||||
function formatThousands(num) {
|
||||
if (Number(num) === 0)
|
||||
num = 0;
|
||||
if (checkPoint(num)) {
|
||||
num = Number(num).toFixed(props.decimalDigits);
|
||||
num = typeof num.split(".") === "string" ? num.split(".") : num.split(".")[0];
|
||||
} else {
|
||||
num = num.toString();
|
||||
}
|
||||
if (props.thousands)
|
||||
return (num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, "$1,");
|
||||
else
|
||||
return num;
|
||||
}
|
||||
function formatDecimal(decimalNum) {
|
||||
if (Number(decimalNum) === 0)
|
||||
decimalNum = 0;
|
||||
if (checkPoint(decimalNum)) {
|
||||
decimalNum = Number(decimalNum).toFixed(props.decimalDigits);
|
||||
decimalNum = typeof decimalNum.split(".") === "string" ? 0 : decimalNum.split(".")[1] ? decimalNum.split(".")[1] : 0;
|
||||
} else {
|
||||
decimalNum = 0;
|
||||
}
|
||||
const result = `0.${decimalNum}`;
|
||||
const resultFixed = Number(result).toFixed(props.decimalDigits);
|
||||
return String(resultFixed).substring(2, resultFixed.length);
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: _ctx.needSymbol && _ctx.position === "before"
|
||||
}, _ctx.needSymbol && _ctx.position === "before" ? {
|
||||
b: common_vendor.n(`nut-price--symbol-${_ctx.size}`),
|
||||
c: showSymbol.value
|
||||
} : {}, {
|
||||
d: common_vendor.t(formatThousands(_ctx.price)),
|
||||
e: common_vendor.n(`nut-price--${_ctx.size}`),
|
||||
f: _ctx.decimalDigits !== 0
|
||||
}, _ctx.decimalDigits !== 0 ? {
|
||||
g: common_vendor.n(`nut-price--decimal-${_ctx.size}`)
|
||||
} : {}, {
|
||||
h: common_vendor.t(formatDecimal(_ctx.price)),
|
||||
i: common_vendor.n(`nut-price--decimal-${_ctx.size}`),
|
||||
j: _ctx.needSymbol && _ctx.position === "after"
|
||||
}, _ctx.needSymbol && _ctx.position === "after" ? {
|
||||
k: common_vendor.n(`nut-price--symbol-${_ctx.size}`),
|
||||
l: showSymbol.value
|
||||
} : {}, {
|
||||
m: common_vendor.n(classes.value),
|
||||
n: common_vendor.s(_ctx.customStyle)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/price/price.js.map
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<view class="{{m}}" style="{{n}}"><rich-text wx:if="{{a}}" class="{{['nut-price--symbol', b]}}" nodes="{{c}}"/><view class="{{e}}">{{d}}</view><view wx:if="{{f}}" class="{{g}}"> . </view><view class="{{i}}">{{h}}</view><rich-text wx:if="{{j}}" class="{{['nut-price--symbol', k]}}" nodes="{{l}}"/></view>
|
||||
@@ -1,102 +0,0 @@
|
||||
/**
|
||||
* 这里是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-price {
|
||||
display: inline;
|
||||
font-size: 0;
|
||||
color: var(--nut-primary-color, #fa2c19);
|
||||
}
|
||||
.nut-price--strike [class*=nut-price] {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.nut-price--symbol {
|
||||
display: inline-block;
|
||||
font-size: var(--nut-font-size-3, 16px);
|
||||
}
|
||||
.nut-price--large {
|
||||
display: inline-block;
|
||||
font-size: var(--nut-price-big-size, 24px);
|
||||
}
|
||||
.nut-price--point {
|
||||
display: inline-block;
|
||||
font-size: var(--nut-price-big-size, 24px);
|
||||
}
|
||||
.nut-price--decimal-large {
|
||||
display: inline-block;
|
||||
font-size: var(--nut-price-decimal-big-size, 18px);
|
||||
}
|
||||
.nut-price--symbol-large {
|
||||
display: inline-block;
|
||||
font-size: var(--nut-price-symbol-big-size, 18px);
|
||||
}
|
||||
.nut-price--normal {
|
||||
display: inline-block;
|
||||
font-size: var(--nut-price-medium-size, 16px);
|
||||
}
|
||||
.nut-price--decimal-normal {
|
||||
display: inline-block;
|
||||
font-size: var(--nut-price-decimal-medium-size, 14px);
|
||||
}
|
||||
.nut-price--symbol-normal {
|
||||
display: inline-block;
|
||||
font-size: var(--nut-price-symbol-medium-size, 14px);
|
||||
}
|
||||
.nut-price--small {
|
||||
display: inline-block;
|
||||
font-size: var(--nut-price-small-size, 12px);
|
||||
}
|
||||
.nut-price--decimal-small {
|
||||
display: inline-block;
|
||||
font-size: var(--nut-price-decimal-small-size, 10px);
|
||||
}
|
||||
.nut-price--symbol-small {
|
||||
display: inline-block;
|
||||
font-size: var(--nut-price-symbol-small-size, 10px);
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
"use strict";
|
||||
require("../../../../common/vendor.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const radioProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 是否禁用选择
|
||||
*/
|
||||
disabled: uni_modules_nutuiUni_components__utils_props.nullableBooleanProp,
|
||||
/**
|
||||
* @description 图标尺寸
|
||||
*/
|
||||
iconSize: uni_modules_nutuiUni_components__utils_props.makeNumericProp(""),
|
||||
/**
|
||||
* @description 单选框标识
|
||||
*/
|
||||
label: {
|
||||
type: [String, Number, Boolean],
|
||||
default: ""
|
||||
},
|
||||
/**
|
||||
* @description 形状,可选值为 button、round
|
||||
*/
|
||||
shape: uni_modules_nutuiUni_components__utils_props.makeStringProp("round"),
|
||||
/**
|
||||
* @description 尺寸,可选值为 `large` `small` `mini` `normal`,仅在 shape 为 `button` 时生效
|
||||
*/
|
||||
size: uni_modules_nutuiUni_components__utils_props.makeStringProp("normal")
|
||||
};
|
||||
const RADIO_KEY = Symbol("nut-radio");
|
||||
exports.RADIO_KEY = RADIO_KEY;
|
||||
exports.radioProps = radioProps;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/radio/index.js.map
|
||||
@@ -1,108 +0,0 @@
|
||||
"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_radio_index = require("./index.js");
|
||||
if (!Math) {
|
||||
NutIcon();
|
||||
}
|
||||
const NutIcon = () => "../icon/icon.js";
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-radio`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: uni_modules_nutuiUni_components_radio_index.radioProps,
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
const { parent } = uni_modules_nutuiUni_components__hooks_useInject.useInject(uni_modules_nutuiUni_components_radio_index.RADIO_KEY);
|
||||
const disabled = form.useFormDisabled(common_vendor.toRef(props, "disabled"));
|
||||
const reverseState = common_vendor.computed(() => parent.position.value === "left");
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, {
|
||||
[`${componentName}--reverse`]: reverseState.value,
|
||||
[`${componentName}--${props.shape}`]: true
|
||||
});
|
||||
});
|
||||
function handleClick() {
|
||||
if (isCurValue.value || disabled.value)
|
||||
return;
|
||||
parent.updateValue(props.label);
|
||||
}
|
||||
const isCurValue = common_vendor.computed(() => {
|
||||
return parent.label.value === props.label;
|
||||
});
|
||||
const color = common_vendor.computed(() => {
|
||||
return !disabled.value ? isCurValue.value ? "nut-radio__icon" : "nut-radio__icon--unchecked" : "nut-radio__icon--disable";
|
||||
});
|
||||
const getButtonClass = common_vendor.computed(() => {
|
||||
return `${componentName}__button ${componentName}__button--${props.size} ${isCurValue.value && `${componentName}__button--active`} ${disabled.value ? `${componentName}__button--disabled` : ""}`;
|
||||
});
|
||||
const getLabelClass = common_vendor.computed(() => {
|
||||
return `${componentName}__label ${disabled.value ? `${componentName}__label--disabled` : ""}`;
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: _ctx.shape === "button"
|
||||
}, _ctx.shape === "button" ? {
|
||||
b: common_vendor.n(getButtonClass.value)
|
||||
} : reverseState.value ? common_vendor.e({
|
||||
d: common_vendor.n(getLabelClass.value),
|
||||
e: !isCurValue.value
|
||||
}, !isCurValue.value ? {
|
||||
f: common_vendor.p({
|
||||
name: "check-normal",
|
||||
size: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
|
||||
width: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
|
||||
height: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
|
||||
["pop-class"]: color.value
|
||||
})
|
||||
} : {
|
||||
g: common_vendor.p({
|
||||
name: "check-checked",
|
||||
size: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
|
||||
width: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
|
||||
height: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
|
||||
["pop-class"]: color.value
|
||||
})
|
||||
}) : common_vendor.e({
|
||||
h: !isCurValue.value
|
||||
}, !isCurValue.value ? {
|
||||
i: common_vendor.p({
|
||||
name: "check-normal",
|
||||
size: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
|
||||
width: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
|
||||
height: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
|
||||
["pop-class"]: color.value
|
||||
})
|
||||
} : {
|
||||
j: common_vendor.p({
|
||||
name: "check-checked",
|
||||
size: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
|
||||
width: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
|
||||
height: common_vendor.unref(uni_modules_nutuiUni_components__utils_pxCheck.pxCheck)(_ctx.iconSize),
|
||||
["pop-class"]: color.value
|
||||
})
|
||||
}, {
|
||||
k: common_vendor.n(getLabelClass.value)
|
||||
}), {
|
||||
c: reverseState.value,
|
||||
l: common_vendor.n(classes.value),
|
||||
m: common_vendor.s(_ctx.customStyle),
|
||||
n: common_vendor.o(handleClick)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/radio/radio.js.map
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"nut-icon": "../icon/icon"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<view class="{{l}}" style="{{m}}" bindtap="{{n}}"><view wx:if="{{a}}" class="{{b}}"><slot/></view><block wx:elif="{{c}}"><view class="{{d}}"><slot/></view><block wx:if="{{e}}"><block wx:if="{{$slots.icon}}"><slot name="icon"></slot></block><block wx:else><nut-icon wx:if="{{f}}" u-i="ad85ac80-0" bind:__l="__l" u-p="{{f}}"/></block></block><block wx:else><block wx:if="{{$slots.checkedIcon}}"><slot name="checkedIcon"></slot></block><block wx:else><nut-icon wx:if="{{g}}" u-i="ad85ac80-1" bind:__l="__l" u-p="{{g}}"/></block></block></block><block wx:else><block wx:if="{{h}}"><block wx:if="{{$slots.icon}}"><slot name="icon"></slot></block><block wx:else><nut-icon wx:if="{{i}}" u-i="ad85ac80-2" bind:__l="__l" u-p="{{i}}"/></block></block><block wx:else><block wx:if="{{$slots.checkedIcon}}"><slot name="checkedIcon"></slot></block><block wx:else><nut-icon wx:if="{{j}}" u-i="ad85ac80-3" bind:__l="__l" u-p="{{j}}"/></block></block><view class="{{k}}"><slot/></view></block></view>
|
||||
@@ -1,159 +0,0 @@
|
||||
/**
|
||||
* 这里是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-radio-group {
|
||||
display: inline-block;
|
||||
}
|
||||
.nut-radio-group .nut-radio {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.nut-radio-group--horizontal .nut-radio {
|
||||
display: inline-flex !important;
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
.nut-radio-group--horizontal .nut-radio--round .nut-radio__label {
|
||||
margin: 0 6px !important;
|
||||
}
|
||||
.nut-theme-dark .nut-radio__label {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
}
|
||||
.nut-theme-dark .nut-radio__label--disabled {
|
||||
color: var(--nut-radio-label-disable-color, #999);
|
||||
}
|
||||
.nut-theme-dark .nut-radio__button {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
background: var(--nut-dark-background, #131313);
|
||||
}
|
||||
.nut-theme-dark .nut-radio__button--disabled {
|
||||
color: var(--nut-radio-label-disable-color, #999);
|
||||
border: 1px solid var(--nut-radio-label-disable-color, #999);
|
||||
}
|
||||
.nut-radio {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
}
|
||||
.nut-radio:last-child {
|
||||
margin-right: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
.nut-radio--reverse .nut-radio__label {
|
||||
margin-right: var(--nut-radio-label-margin-left, 15px);
|
||||
margin-left: 0;
|
||||
}
|
||||
.nut-radio__button {
|
||||
box-sizing: border-box;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: var(--nut-radio-button-padding, 5px 18px);
|
||||
font-size: var(--nut-radio-button-font-size, 12px);
|
||||
color: var(--nut-radio-label-font-color, #1d1e1e);
|
||||
background: #f6f7f9;
|
||||
border: 1px solid #f6f7f9;
|
||||
border-radius: var(--nut-radio-button-border-radius, 15px);
|
||||
}
|
||||
.nut-radio__button--active {
|
||||
position: relative;
|
||||
color: var(--nut-radio-label-font-active-color, var(--nut-primary-color, #fa2c19));
|
||||
background: transparent;
|
||||
border: 1px solid var(--nut-radio-label-button-border-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-radio__button--active::after {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
content: "";
|
||||
background-color: var(--nut-radio-label-button-background, var(--nut-primary-color, #fa2c19));
|
||||
border-radius: var(--nut-radio-button-border-radius, 15px);
|
||||
opacity: 0.05;
|
||||
}
|
||||
.nut-radio__button--disabled {
|
||||
color: var(--nut-radio-label-disable-color, #999);
|
||||
border: none;
|
||||
}
|
||||
.nut-radio__button--large {
|
||||
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-radio__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-radio__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-radio__label {
|
||||
flex: 1;
|
||||
margin-left: var(--nut-radio-label-margin-left, 15px);
|
||||
font-size: var(--nut-radio-label-font-size, 14px);
|
||||
color: var(--nut-radio-label-font-color, #1d1e1e);
|
||||
}
|
||||
.nut-radio__label--disabled {
|
||||
color: var(--nut-radio-label-disable-color, #999);
|
||||
}
|
||||
.nut-radio__icon {
|
||||
color: var(--nut-radio-label-font-active-color, var(--nut-primary-color, #fa2c19));
|
||||
transition-duration: 0.3s;
|
||||
transition-property: color, border-color, background-color;
|
||||
}
|
||||
.nut-radio__icon--unchecked {
|
||||
color: var(--nut-radio-icon-disable-color, #d6d6d6);
|
||||
}
|
||||
.nut-radio__icon--disable {
|
||||
color: var(--nut-radio-icon-disable-color2, var(--nut-help-color, #f5f5f5));
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
"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_useProvide = require("../_hooks/useProvide.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
||||
const uni_modules_nutuiUni_components_radio_index = require("../radio/index.js");
|
||||
const uni_modules_nutuiUni_components__utils_is = require("../_utils/is.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const radiogroupProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 当前选中项的标识符,与 `label` 值一致时呈选中状态
|
||||
*/
|
||||
modelValue: {
|
||||
type: [Number, String, Boolean],
|
||||
default: ""
|
||||
},
|
||||
/**
|
||||
* @description 使用横纵方向,可选值 `horizontal`、`vertical`
|
||||
*/
|
||||
direction: uni_modules_nutuiUni_components__utils_props.makeStringProp("vertical"),
|
||||
/**
|
||||
* @description 文本所在的位置,可选值:`left`,`right`
|
||||
*/
|
||||
textPosition: uni_modules_nutuiUni_components__utils_props.makeStringProp("right")
|
||||
};
|
||||
const radiogroupEmits = {
|
||||
[uni_modules_nutuiUni_components__constants_event.CHANGE_EVENT]: (val) => uni_modules_nutuiUni_components__utils_is.isString(val) || uni_modules_nutuiUni_components__utils_is.isNumber(val) || uni_modules_nutuiUni_components__utils_is.isBoolean(val),
|
||||
[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) || uni_modules_nutuiUni_components__utils_is.isBoolean(val)
|
||||
};
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-radio-group`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: radiogroupProps,
|
||||
emits: radiogroupEmits,
|
||||
setup(__props, { emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const updateValue = (value) => emit(uni_modules_nutuiUni_components__constants_event.UPDATE_MODEL_EVENT, value);
|
||||
uni_modules_nutuiUni_components__hooks_useProvide.useProvide(uni_modules_nutuiUni_components_radio_index.RADIO_KEY)({
|
||||
label: common_vendor.readonly(common_vendor.computed(() => props.modelValue)),
|
||||
position: common_vendor.readonly(common_vendor.computed(() => props.textPosition)),
|
||||
updateValue
|
||||
});
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, {
|
||||
[`${componentName}--${props.direction}`]: true
|
||||
});
|
||||
});
|
||||
common_vendor.watch(
|
||||
() => props.modelValue,
|
||||
(value) => emit(uni_modules_nutuiUni_components__constants_event.CHANGE_EVENT, value)
|
||||
);
|
||||
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/radiogroup/radiogroup.js.map
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<view class="{{a}}" style="{{b}}"><slot/></view>
|
||||
@@ -1,63 +0,0 @@
|
||||
/**
|
||||
* 这里是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-radio-group {
|
||||
display: inline-block;
|
||||
}
|
||||
.nut-radio-group .nut-radio {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.nut-radio-group--horizontal .nut-radio {
|
||||
display: inline-flex !important;
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
.nut-radio-group--horizontal .nut-radio--round .nut-radio__label {
|
||||
margin: 0 6px !important;
|
||||
}
|
||||
@@ -1,251 +0,0 @@
|
||||
"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 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 searchbarProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 当前输入的值
|
||||
*/
|
||||
modelValue: uni_modules_nutuiUni_components__utils_props.makeNumericProp(""),
|
||||
/**
|
||||
* @description 输入框类型
|
||||
*/
|
||||
inputType: uni_modules_nutuiUni_components__utils_props.makeStringProp("text"),
|
||||
/**
|
||||
* @description 搜索框形状,可选值为 `square` `round`
|
||||
*/
|
||||
shape: uni_modules_nutuiUni_components__utils_props.makeStringProp("round"),
|
||||
/**
|
||||
* @description 最大输入长度
|
||||
*/
|
||||
maxLength: uni_modules_nutuiUni_components__utils_props.numericProp,
|
||||
/**
|
||||
* @description 输入框默认占位符
|
||||
*/
|
||||
placeholder: String,
|
||||
/**
|
||||
* @description 是否展示清除按钮
|
||||
*/
|
||||
clearable: uni_modules_nutuiUni_components__utils_props.truthProp,
|
||||
/**
|
||||
* @description 自定义清除按钮图标
|
||||
*/
|
||||
clearIcon: uni_modules_nutuiUni_components__utils_props.makeStringProp("circle-close"),
|
||||
/**
|
||||
* @description 输入框外部背景
|
||||
*/
|
||||
background: String,
|
||||
/**
|
||||
* @description 输入框内部背景
|
||||
*/
|
||||
inputBackground: String,
|
||||
/**
|
||||
* @description 聚焦时搜索框样式
|
||||
*/
|
||||
focusStyle: uni_modules_nutuiUni_components__utils_props.makeObjectProp({}),
|
||||
/**
|
||||
* @description 是否自动聚焦
|
||||
*/
|
||||
autofocus: Boolean,
|
||||
/**
|
||||
* @description 是否禁用输入框
|
||||
*/
|
||||
disabled: uni_modules_nutuiUni_components__utils_props.nullableBooleanProp,
|
||||
/**
|
||||
* @description 输入框只读
|
||||
*/
|
||||
readonly: Boolean,
|
||||
/**
|
||||
* @description 对齐方式,可选 `left` `center` `right`
|
||||
*/
|
||||
inputAlign: uni_modules_nutuiUni_components__utils_props.makeStringProp("left"),
|
||||
/**
|
||||
* @description 键盘右下角按钮的文字,仅在`type='text'`时生效,可选值 `send`:发送、`search`:搜索、`next`:下一个、`go`:前往、`done`:完成
|
||||
*/
|
||||
confirmType: uni_modules_nutuiUni_components__utils_props.makeStringProp("done"),
|
||||
/**
|
||||
* @description 是否开启 iphone 系列全面屏底部安全区适配
|
||||
*/
|
||||
safeAreaInsetBottom: Boolean,
|
||||
/**
|
||||
* @description 指定的距离的最小值作为光标与键盘的距离
|
||||
*/
|
||||
cursorSpacing: uni_modules_nutuiUni_components__utils_props.makeNumberProp(0)
|
||||
};
|
||||
const searchbarEmits = {
|
||||
[uni_modules_nutuiUni_components__constants_event.UPDATE_MODEL_EVENT]: (val, event) => (uni_modules_nutuiUni_components__utils_is.isString(val) || val === void 0) && event instanceof Object,
|
||||
[uni_modules_nutuiUni_components__constants_event.CHANGE_EVENT]: (val, event) => (uni_modules_nutuiUni_components__utils_is.isString(val) || val === void 0) && event instanceof Object,
|
||||
[uni_modules_nutuiUni_components__constants_event.BLUR_EVENT]: (val, event) => (uni_modules_nutuiUni_components__utils_is.isString(val) || val === void 0) && event instanceof Object,
|
||||
[uni_modules_nutuiUni_components__constants_event.FOCUS_EVENT]: (val, event) => (uni_modules_nutuiUni_components__utils_is.isString(val) || val === void 0) && event instanceof Object,
|
||||
[uni_modules_nutuiUni_components__constants_event.CLEAR_EVENT]: (val) => uni_modules_nutuiUni_components__utils_is.isString(val) || val === void 0,
|
||||
[uni_modules_nutuiUni_components__constants_event.SEARCH_EVENT]: (val) => uni_modules_nutuiUni_components__utils_is.isString(val) || val === void 0,
|
||||
clickInput: (val, event) => (uni_modules_nutuiUni_components__utils_is.isString(val) || val === void 0) && event instanceof Object,
|
||||
clickLeftIcon: (val, event) => (uni_modules_nutuiUni_components__utils_is.isString(val) || val === void 0) && event instanceof Object,
|
||||
clickRightIcon: (val, event) => (uni_modules_nutuiUni_components__utils_is.isString(val) || val === void 0) && event instanceof Object
|
||||
};
|
||||
if (!Math) {
|
||||
NutIcon();
|
||||
}
|
||||
const NutIcon = () => "../icon/icon.js";
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-searchbar`;
|
||||
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: searchbarProps,
|
||||
emits: searchbarEmits,
|
||||
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"));
|
||||
const state = common_vendor.reactive({
|
||||
active: false
|
||||
});
|
||||
function stringModelValue() {
|
||||
if (props.modelValue == null)
|
||||
return "";
|
||||
return String(props.modelValue);
|
||||
}
|
||||
const innerValue = common_vendor.computed(() => {
|
||||
return stringModelValue();
|
||||
});
|
||||
const innerMaxLength = common_vendor.computed(() => {
|
||||
if (props.maxLength == null)
|
||||
return -1;
|
||||
return Number(props.maxLength);
|
||||
});
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, {
|
||||
"safe-area-inset-bottom": props.safeAreaInsetBottom
|
||||
});
|
||||
});
|
||||
const styles = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainStyle(props, {
|
||||
background: props.background
|
||||
});
|
||||
});
|
||||
const inputWrapperStyles = common_vendor.computed(() => {
|
||||
const style = {
|
||||
background: props.inputBackground
|
||||
};
|
||||
if (state.active)
|
||||
Object.assign(style, props.focusStyle);
|
||||
return style;
|
||||
});
|
||||
const inputStyles = common_vendor.computed(() => {
|
||||
return {
|
||||
textAlign: props.inputAlign
|
||||
};
|
||||
});
|
||||
function handleValue(value) {
|
||||
if (innerMaxLength.value > 0 && value.length > innerMaxLength.value)
|
||||
value = value.slice(0, innerMaxLength.value);
|
||||
return value;
|
||||
}
|
||||
function handleInput(event) {
|
||||
const value = handleValue(event.detail.value);
|
||||
emit(uni_modules_nutuiUni_components__constants_event.UPDATE_MODEL_EVENT, value, event);
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CHANGE_EVENT, value, event);
|
||||
}
|
||||
function handleFocus(event) {
|
||||
const value = handleValue(event.detail.value);
|
||||
state.active = true;
|
||||
emit(uni_modules_nutuiUni_components__constants_event.FOCUS_EVENT, value, event);
|
||||
}
|
||||
function handleBlur(event) {
|
||||
const value = handleValue(event.detail.value);
|
||||
setTimeout(() => {
|
||||
state.active = false;
|
||||
}, 200);
|
||||
emit(uni_modules_nutuiUni_components__constants_event.BLUR_EVENT, value, event);
|
||||
}
|
||||
function handleClear(event) {
|
||||
emit(uni_modules_nutuiUni_components__constants_event.UPDATE_MODEL_EVENT, "", event);
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CHANGE_EVENT, "", event);
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CLEAR_EVENT, "");
|
||||
}
|
||||
function handleSubmit() {
|
||||
emit(uni_modules_nutuiUni_components__constants_event.SEARCH_EVENT, innerValue.value);
|
||||
}
|
||||
function handleInputClick(event) {
|
||||
emit("clickInput", innerValue.value, event);
|
||||
}
|
||||
function handleLeftIconClick(event) {
|
||||
emit("clickLeftIcon", innerValue.value, event);
|
||||
}
|
||||
function handleRightIconClick(event) {
|
||||
emit("clickRightIcon", innerValue.value, event);
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: hasSlot("leftout")
|
||||
}, hasSlot("leftout") ? {
|
||||
b: common_vendor.o(handleLeftIconClick)
|
||||
} : {}, {
|
||||
c: hasSlot("leftin")
|
||||
}, hasSlot("leftin") ? {} : {}, {
|
||||
d: props.clearable ? 1 : "",
|
||||
e: common_vendor.s(inputStyles.value),
|
||||
f: props.inputType,
|
||||
g: innerMaxLength.value,
|
||||
h: props.placeholder || common_vendor.unref(translate)("placeholder"),
|
||||
i: innerValue.value,
|
||||
j: props.autofocus,
|
||||
k: props.confirmType,
|
||||
l: common_vendor.unref(formDisabled),
|
||||
m: props.readonly,
|
||||
n: props.cursorSpacing,
|
||||
o: common_vendor.o(handleInputClick),
|
||||
p: common_vendor.o(handleInput),
|
||||
q: common_vendor.o(handleFocus),
|
||||
r: common_vendor.o(handleBlur),
|
||||
s: common_vendor.o(handleSubmit),
|
||||
t: common_vendor.o(handleSubmit),
|
||||
v: hasSlot("rightin") ? 1 : "",
|
||||
w: props.clearable
|
||||
}, props.clearable ? common_vendor.e({
|
||||
x: hasSlot("clear-icon")
|
||||
}, hasSlot("clear-icon") ? {} : {
|
||||
y: common_vendor.p({
|
||||
name: props.clearIcon
|
||||
})
|
||||
}, {
|
||||
z: innerValue.value.length <= 0 ? 1 : "",
|
||||
A: common_vendor.o(handleClear)
|
||||
}) : {}, {
|
||||
B: hasSlot("rightin")
|
||||
}, hasSlot("rightin") ? {
|
||||
C: common_vendor.o(handleRightIconClick)
|
||||
} : {}, {
|
||||
D: hasSlot("rightin") ? 1 : "",
|
||||
E: common_vendor.n(props.shape),
|
||||
F: common_vendor.s(inputWrapperStyles.value),
|
||||
G: hasSlot("rightout")
|
||||
}, hasSlot("rightout") ? {} : {}, {
|
||||
H: common_vendor.n(classes.value),
|
||||
I: common_vendor.s(styles.value)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/searchbar/searchbar.js.map
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"nut-icon": "../icon/icon"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<view class="{{H}}" style="{{I}}"><view wx:if="{{a}}" class="nut-searchbar__search-icon nut-searchbar__left-search-icon" bindtap="{{b}}"><slot name="leftout"/></view><view class="{{['nut-searchbar__search-input', E]}}" style="{{F}}"><view wx:if="{{c}}" class="nut-searchbar__search-icon nut-searchbar__iptleft-search-icon"><slot name="leftin"/></view><view class="{{['nut-searchbar__input-inner', v && 'nut-searchbar__input-inner-absolute']}}"><form class="nut-searchbar__input-form" action="#" onsubmit="return false" catchsubmit="{{t}}"><block wx:if="{{r0}}"><input class="{{['nut-searchbar__input-bar', d && 'nut-searchbar__input-bar_clear']}}" style="{{e}}" type="{{f}}" maxlength="{{g}}" placeholder="{{h}}" value="{{i}}" focus="{{j}}" confirm-type="{{k}}" disabled="{{l}}" readonly="{{m}}" cursor-spacing="{{n}}" bindtap="{{o}}" bindinput="{{p}}" bindfocus="{{q}}" bindblur="{{r}}" bindconfirm="{{s}}"></input></block></form></view><view class="{{['nut-searchbar__input-inner-icon', D && 'nut-searchbar__input-inner-icon-absolute']}}"><view wx:if="{{w}}" class="{{['nut-searchbar__search-icon', 'nut-searchbar__input-clear', z && 'nut-hidden']}}" bindtap="{{A}}"><block wx:if="{{x}}"><slot name="clear-icon"/></block><nut-icon wx:else u-i="7e94ecc0-0" bind:__l="__l" u-p="{{y||''}}"/></view><view wx:if="{{B}}" class="nut-searchbar__search-icon nut-searchbar__iptright-search-icon" bindtap="{{C}}"><slot name="rightin"/></view></view></view><view wx:if="{{G}}" class="nut-searchbar__search-icon nut-searchbar__right-search-icon"><slot name="rightout"/></view></view>
|
||||
@@ -1,165 +0,0 @@
|
||||
/**
|
||||
* 这里是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-searchbar {
|
||||
background: var(--nut-dark-background, #131313);
|
||||
}
|
||||
.nut-theme-dark .nut-searchbar__search-input {
|
||||
background: var(--nut-dark-background4, #323233);
|
||||
}
|
||||
.nut-theme-dark .nut-searchbar__right-search-icon, .nut-theme-dark .nut-searchbar__left-search-icon {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
}
|
||||
.nut-searchbar {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: var(--nut-searchbar-width, 100%);
|
||||
padding: var(--nut-searchbar-padding, 9px 16px);
|
||||
color: var(--nut-searchbar-input-bar-color, inherit);
|
||||
background: var(--nut-searchbar-background, var(--nut-white, #fff));
|
||||
}
|
||||
.nut-searchbar.safe-area-inset-bottom {
|
||||
position: relative;
|
||||
margin-bottom: constant(safe-area-inset-bottom);
|
||||
margin-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
.nut-searchbar.safe-area-inset-bottom::after {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: constant(safe-area-inset-bottom);
|
||||
height: env(safe-area-inset-bottom);
|
||||
content: "";
|
||||
background: var(--nut-searchbar-background, var(--nut-white, #fff));
|
||||
}
|
||||
.nut-searchbar::-webkit-input-placeholder {
|
||||
color: var(--nut-searchbar-input-bar-placeholder-color, inherit);
|
||||
}
|
||||
.nut-searchbar::placeholder {
|
||||
color: var(--nut-searchbar-input-bar-placeholder-color, inherit);
|
||||
}
|
||||
.nut-searchbar__search-input {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
height: var(--nut-searchbar-input-height, 32px);
|
||||
padding: var(--nut-searchbar-input-padding, 0 0 0 13px);
|
||||
background: var(--nut-searchbar-input-background, #f7f7f7);
|
||||
border-radius: var(--nut-searchbar-input-border-radius, 16px);
|
||||
box-shadow: var(--nut-searchbar-input-box-shadow, 0 0 8px 0 rgba(0, 0, 0, 0.04));
|
||||
}
|
||||
.nut-searchbar__search-input.square {
|
||||
border-radius: 0;
|
||||
}
|
||||
.nut-searchbar__search-input .nut-searchbar__input-inner {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
.nut-searchbar__search-input .nut-searchbar__input-inner .nut-searchbar__input-form {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
.nut-searchbar__search-input .nut-searchbar__input-inner-icon {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 7px;
|
||||
}
|
||||
.nut-searchbar__search-input .nut-searchbar__input-clear {
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
padding: 0 5px;
|
||||
}
|
||||
.nut-searchbar__search-input .nut-searchbar__input-inner-icon-absolute .nut-searchbar__input-clear {
|
||||
position: absolute;
|
||||
left: -20px;
|
||||
}
|
||||
.nut-searchbar__search-input .nut-searchbar__iptleft-search-icon {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
.nut-searchbar__search-input .nut-searchbar__iptright-search-icon {
|
||||
margin-left: 5px;
|
||||
}
|
||||
.nut-searchbar__search-input .nut-searchbar__input-bar {
|
||||
flex: 1;
|
||||
height: var(--nut-searchbar-input-height, 32px);
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
line-height: var(--nut-searchbar-input-height, 32px);
|
||||
background-color: transparent;
|
||||
border-color: transparent;
|
||||
outline: none;
|
||||
}
|
||||
.nut-searchbar__search-input .nut-searchbar__input-inner-absolute .nut-searchbar__input-bar {
|
||||
box-sizing: border-box;
|
||||
padding-right: 20px;
|
||||
}
|
||||
.nut-searchbar__left-search-icon {
|
||||
margin-right: 8px;
|
||||
}
|
||||
.nut-searchbar__search-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.nut-searchbar__right-search-icon {
|
||||
margin-left: 16px;
|
||||
font-size: 14px;
|
||||
color: var(--nut-searchbar-right-out-color, var(--nut-black, #000));
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
"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_is = require("../_utils/is.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const stepProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 流程步骤的标题
|
||||
*/
|
||||
title: String,
|
||||
/**
|
||||
* @description 流程步骤的描述性文字(支持 html 结构)
|
||||
*/
|
||||
content: String
|
||||
};
|
||||
const stepEmits = {
|
||||
clickStep: (val) => uni_modules_nutuiUni_components__utils_is.isNumber(val)
|
||||
};
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-step`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: stepProps,
|
||||
emits: stepEmits,
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
const instance = common_vendor.getCurrentInstance();
|
||||
const parent = common_vendor.inject("parent");
|
||||
parent.relation(instance);
|
||||
const state = common_vendor.reactive({
|
||||
dot: parent.props.progressDot
|
||||
});
|
||||
const index = common_vendor.computed(() => parent.state.children.indexOf(instance) + 1);
|
||||
function getCurrentStatus() {
|
||||
const activeIndex = index.value;
|
||||
if (activeIndex < +parent.props.current)
|
||||
return "finish";
|
||||
return activeIndex === +parent.props.current ? "process" : "wait";
|
||||
}
|
||||
const status = common_vendor.computed(() => {
|
||||
return getCurrentStatus();
|
||||
});
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, {
|
||||
[`${componentName}-${status.value}`]: true
|
||||
});
|
||||
});
|
||||
function handleClickStep() {
|
||||
parent.onEmit(index.value);
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: state.dot
|
||||
}, state.dot ? {} : {
|
||||
b: common_vendor.t(index.value)
|
||||
}, {
|
||||
c: common_vendor.n(!state.dot ? "is-icon" : ""),
|
||||
d: !_ctx.$slots.title
|
||||
}, !_ctx.$slots.title ? {
|
||||
e: common_vendor.t(_ctx.title)
|
||||
} : {}, {
|
||||
f: _ctx.content || _ctx.$slots.content
|
||||
}, _ctx.content || _ctx.$slots.content ? common_vendor.e({
|
||||
g: !_ctx.$slots.content
|
||||
}, !_ctx.$slots.content ? {
|
||||
h: _ctx.content
|
||||
} : {}) : {}, {
|
||||
i: common_vendor.n(classes.value),
|
||||
j: common_vendor.s(_ctx.customStyle),
|
||||
k: common_vendor.o(handleClickStep)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/step/step.js.map
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<view class="{{i}}" style="{{j}}" bindtap="{{k}}"><view class="nut-step-head"><view class="nut-step-line"/><view class="{{['nut-step-icon', c]}}"><view class="nut-step-icon-inner"><block wx:if="{{$slots.icon}}"><slot name="icon"></slot></block><block wx:else><block wx:if="{{a}}"/><block wx:else><view class="nut-step-inner">{{b}}</view></block></block></view></view></view><view class="nut-step-main"><view class="nut-step-title"><view wx:if="{{d}}">{{e}}</view><slot name="title"/></view><view wx:if="{{f}}" class="nut-step-content"><rich-text wx:if="{{g}}" nodes="{{h}}"/><slot name="content"/></view></view></view>
|
||||
@@ -1,253 +0,0 @@
|
||||
/**
|
||||
* 这里是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-step {
|
||||
flex: 1;
|
||||
font-size: 0;
|
||||
text-align: center;
|
||||
}
|
||||
.nut-step-head {
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.nut-step-line {
|
||||
position: absolute;
|
||||
top: 11px;
|
||||
right: -50%;
|
||||
left: 50%;
|
||||
display: inline-block;
|
||||
height: 1px;
|
||||
background: var(--nut-steps-base-line-color, #909ca4);
|
||||
}
|
||||
.nut-step-icon {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: var(--nut-steps-base-icon-width, 25px);
|
||||
height: var(--nut-steps-base-icon-height, 25px);
|
||||
font-size: var(--nut-steps-base-icon-font-size, 13px);
|
||||
line-height: var(--nut-steps-base-icon-line-height, 25px);
|
||||
}
|
||||
.nut-step-icon-inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.nut-step-icon .nut-icon {
|
||||
width: var(--nut-steps-base-icon-font-size, 13px);
|
||||
height: var(--nut-steps-base-icon-font-size, 13px);
|
||||
}
|
||||
.nut-step-icon.is-icon {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.nut-step-main {
|
||||
display: inline-block;
|
||||
padding-right: 10%;
|
||||
padding-left: 10%;
|
||||
text-align: center;
|
||||
}
|
||||
.nut-step-title {
|
||||
display: block;
|
||||
margin-bottom: var(--nut-steps-base-title-margin-bottom, 10px);
|
||||
font-size: var(--nut-steps-base-title-font-size, 14px);
|
||||
color: var(--nut-steps-base-title-color, #909ca4);
|
||||
}
|
||||
.nut-step-content {
|
||||
display: block;
|
||||
font-size: var(--nut-steps-base-content-font-size, 14px);
|
||||
color: var(--nut-steps-base-content-color, #666);
|
||||
}
|
||||
.nut-step:last-child .nut-step-line {
|
||||
display: none;
|
||||
}
|
||||
.nut-step.nut-step-finish .nut-step-head {
|
||||
color: var(--nut-steps-finish-head-color, var(--nut-primary-color, #fa2c19));
|
||||
border-color: var(--nut-steps-finish-head-border-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-step.nut-step-finish .nut-step-icon.is-icon {
|
||||
background-color: var(--nut-steps-finish-icon-text-color, var(--nut-white, #fff));
|
||||
}
|
||||
.nut-step.nut-step-finish .nut-step-line {
|
||||
background: var(--nut-steps-finish-line-background, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-step.nut-step-finish .nut-step-title {
|
||||
color: var(--nut-steps-finish-title-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-step.nut-step-process .nut-step-head {
|
||||
color: var(--nut-steps-process-head-color, var(--nut-white, #fff));
|
||||
border-color: var(--nut-steps-process-head-border-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-step.nut-step-process .nut-step-icon.is-icon {
|
||||
background-color: var(--nut-steps-process-icon-text-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-step.nut-step-process .nut-step-title {
|
||||
color: var(--nut-steps-process-title-color, var(--nut-primary-color, #fa2c19));
|
||||
}
|
||||
.nut-step.nut-step-wait .nut-step-head {
|
||||
color: var(--nut-steps-wait-head-color, #909ca4);
|
||||
border-color: var(--nut-steps-wait-head-border-color, #909ca4);
|
||||
}
|
||||
.nut-step.nut-step-wait .nut-step-icon.is-icon {
|
||||
color: var(--nut-steps-wait-icon-text-color, #fff);
|
||||
background-color: var(--nut-steps-wait-icon-bg-color, #959fb1);
|
||||
}
|
||||
.nut-step.nut-step-wait .nut-step-icon.is-icon .nut-icon {
|
||||
color: var(--nut-steps-wait-icon-color, var(--nut-white, #fff));
|
||||
}
|
||||
.nut-step.nut-step-wait .nut-step-content {
|
||||
color: var(--nut-steps-wait-content-color, #909ca4);
|
||||
}
|
||||
.nut-steps-horizontal.nut-steps-dot .nut-step-head {
|
||||
margin-top: 7px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.nut-steps-horizontal.nut-steps-dot .nut-step-line {
|
||||
top: 50%;
|
||||
bottom: -50%;
|
||||
}
|
||||
.nut-steps-horizontal.nut-steps-dot .nut-step-icon {
|
||||
box-sizing: content-box;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
background: var(--nut-primary-color, #fa2c19);
|
||||
border-radius: 50%;
|
||||
}
|
||||
.nut-steps-horizontal.nut-steps-dot .nut-step-wait .nut-step-icon {
|
||||
background-color: var(--nut-steps-wait-icon-bg-color, #959fb1);
|
||||
}
|
||||
.nut-steps-horizontal.nut-steps-dot .nut-step-wait .nut-step-content {
|
||||
color: var(--nut-steps-wait-content-color, #909ca4);
|
||||
}
|
||||
.nut-steps-horizontal.nut-steps-dot .nut-step-finish .nut-step-icon {
|
||||
background-color: var(--nut-primary-color, #fa2c19);
|
||||
}
|
||||
.nut-steps-horizontal.nut-steps-dot .nut-step-process .nut-step-icon {
|
||||
position: relative;
|
||||
background-color: var(--nut-primary-color, #fa2c19);
|
||||
}
|
||||
.nut-steps-horizontal.nut-steps-dot .nut-step-process .nut-step-icon::before {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
display: inline-block;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
margin-top: -7px;
|
||||
margin-left: -7px;
|
||||
content: "";
|
||||
background-color: var(--nut-primary-color-end, #fa6419);
|
||||
border-radius: 50%;
|
||||
opacity: 0.23;
|
||||
}
|
||||
.nut-steps-vertical .nut-step {
|
||||
display: flex;
|
||||
height: 33.34%;
|
||||
}
|
||||
.nut-steps-vertical .nut-step-line {
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
width: 1px;
|
||||
height: 100%;
|
||||
background: #909ca4;
|
||||
}
|
||||
.nut-steps-vertical .nut-step-main {
|
||||
display: inline-block;
|
||||
padding-left: 6%;
|
||||
text-align: left;
|
||||
}
|
||||
.nut-steps-vertical.nut-steps-dot .nut-step-head {
|
||||
margin-top: 7px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.nut-steps-vertical.nut-steps-dot .nut-step-line {
|
||||
top: 7px;
|
||||
right: -50%;
|
||||
left: 50%;
|
||||
}
|
||||
.nut-steps-vertical.nut-steps-dot .nut-step-icon {
|
||||
box-sizing: content-box;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
background: var(--nut-primary-color, #fa2c19);
|
||||
border-radius: 50%;
|
||||
}
|
||||
.nut-steps-vertical.nut-steps-dot .nut-step-wait .nut-step-icon {
|
||||
background-color: var(--nut-steps-wait-icon-bg-color, #959fb1);
|
||||
}
|
||||
.nut-steps-vertical.nut-steps-dot .nut-step-wait .nut-step-content {
|
||||
color: var(--nut-steps-wait-content-color, #909ca4);
|
||||
}
|
||||
.nut-steps-vertical.nut-steps-dot .nut-step-finish .nut-step-icon {
|
||||
background-color: var(--nut-primary-color, #fa2c19);
|
||||
}
|
||||
.nut-steps-vertical.nut-steps-dot .nut-step-process .nut-step-icon {
|
||||
position: relative;
|
||||
background-color: var(--nut-primary-color, #fa2c19);
|
||||
}
|
||||
.nut-steps-vertical.nut-steps-dot .nut-step-process .nut-step-icon::before {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
display: inline-block;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
margin-top: -7px;
|
||||
margin-left: -7px;
|
||||
content: "";
|
||||
background-color: var(--nut-primary-color-end, #fa6419);
|
||||
border-radius: 50%;
|
||||
opacity: 0.23;
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
"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_is = require("../_utils/is.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const stepsProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 显示方向,`horizontal`,`vertical`
|
||||
*/
|
||||
direction: uni_modules_nutuiUni_components__utils_props.makeStringProp("horizontal"),
|
||||
/**
|
||||
* @description 当前所在的步骤
|
||||
*/
|
||||
current: uni_modules_nutuiUni_components__utils_props.makeNumericProp(0),
|
||||
/**
|
||||
* @description 点状步骤条
|
||||
*/
|
||||
progressDot: Boolean
|
||||
};
|
||||
const stepsEmits = {
|
||||
clickStep: (val) => uni_modules_nutuiUni_components__utils_is.isNumber(val)
|
||||
};
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-steps`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: stepsProps,
|
||||
emits: stepsEmits,
|
||||
setup(__props, { emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const state = common_vendor.reactive({
|
||||
children: []
|
||||
});
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, {
|
||||
[`${componentName}-${props.direction}`]: true,
|
||||
[`${componentName}-dot`]: !!props.progressDot
|
||||
});
|
||||
});
|
||||
function relation(child) {
|
||||
child && state.children.push(child);
|
||||
}
|
||||
function onEmit(index) {
|
||||
emit("clickStep", index);
|
||||
}
|
||||
common_vendor.provide("parent", {
|
||||
relation,
|
||||
state,
|
||||
props,
|
||||
onEmit
|
||||
});
|
||||
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/steps/steps.js.map
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<view class="{{a}}" style="{{b}}"><slot/></view>
|
||||
@@ -1,57 +0,0 @@
|
||||
/**
|
||||
* 这里是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-steps {
|
||||
display: flex;
|
||||
}
|
||||
.nut-steps-vertical {
|
||||
flex-flow: column;
|
||||
height: 100%;
|
||||
}
|
||||
@@ -87,7 +87,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
function scrollIntoView() {
|
||||
if (!props.titleScroll)
|
||||
return;
|
||||
uni_modules_nutuiUni_components__utils_raf.raf(() => {
|
||||
uni_modules_nutuiUni_components__utils_raf.requestAniFrame(() => {
|
||||
Promise.all([
|
||||
getSelectorNodeInfo(`#nut-tabs__titles_${refRandomId}`),
|
||||
getSelectorNodeInfos(`#nut-tabs__titles_${refRandomId} .nut-tabs__titles-item`)
|
||||
@@ -136,7 +136,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
else
|
||||
scrollTop.value += (to - from) / frames;
|
||||
if (++count < frames)
|
||||
uni_modules_nutuiUni_components__utils_raf.raf(animate);
|
||||
uni_modules_nutuiUni_components__utils_raf.requestAniFrame(animate);
|
||||
}
|
||||
animate();
|
||||
}
|
||||
|
||||
@@ -1,229 +0,0 @@
|
||||
"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__constants_event = require("../_constants/event.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const watermarkProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 水印的名称
|
||||
*/
|
||||
name: String,
|
||||
/**
|
||||
* @description 水印之间的垂直间距
|
||||
*/
|
||||
gapY: uni_modules_nutuiUni_components__utils_props.makeNumberProp(48),
|
||||
/**
|
||||
* @description 水印之间的水平间距
|
||||
*/
|
||||
gapX: uni_modules_nutuiUni_components__utils_props.makeNumberProp(24),
|
||||
/**
|
||||
* @description 追加的水印元素的z-index
|
||||
*/
|
||||
zIndex: uni_modules_nutuiUni_components__utils_props.makeNumberProp(2e3),
|
||||
/**
|
||||
* @description 水印的宽度
|
||||
*/
|
||||
width: uni_modules_nutuiUni_components__utils_props.makeNumberProp(120),
|
||||
/**
|
||||
* @description 水印的高度
|
||||
*/
|
||||
height: uni_modules_nutuiUni_components__utils_props.makeNumberProp(64),
|
||||
/**
|
||||
* @description 水印绘制时,旋转的角度
|
||||
*/
|
||||
rotate: uni_modules_nutuiUni_components__utils_props.makeNumberProp(-22),
|
||||
/**
|
||||
* @description 图片源,建议导出 2 倍或 3 倍图,优先使用图片渲染水印
|
||||
*/
|
||||
image: String,
|
||||
/**
|
||||
* @description 图片宽度
|
||||
*/
|
||||
imageWidth: uni_modules_nutuiUni_components__utils_props.makeNumberProp(120),
|
||||
/**
|
||||
* @description 图片高度
|
||||
*/
|
||||
imageHeight: uni_modules_nutuiUni_components__utils_props.makeNumberProp(64),
|
||||
/**
|
||||
* @description 水印文字内容
|
||||
*/
|
||||
content: {
|
||||
type: [String, Array],
|
||||
default: ""
|
||||
},
|
||||
/**
|
||||
* @description 水印文字颜色
|
||||
*/
|
||||
fontColor: uni_modules_nutuiUni_components__utils_props.makeStringProp("rgba(0,0,0,.15)"),
|
||||
/**
|
||||
* @description 水印文字样式
|
||||
*/
|
||||
fontStyle: uni_modules_nutuiUni_components__utils_props.makeStringProp("normal"),
|
||||
/**
|
||||
* @description 水印文字字体
|
||||
*/
|
||||
fontFamily: uni_modules_nutuiUni_components__utils_props.makeStringProp("PingFang SC"),
|
||||
/**
|
||||
* @description 水印文字粗细
|
||||
*/
|
||||
fontWeight: uni_modules_nutuiUni_components__utils_props.makeStringProp("normal"),
|
||||
/**
|
||||
* @description 水印文字大小
|
||||
*/
|
||||
fontSize: uni_modules_nutuiUni_components__utils_props.makeNumericProp(14),
|
||||
/**
|
||||
* @description 是否覆盖整个页面
|
||||
*/
|
||||
fullPage: uni_modules_nutuiUni_components__utils_props.truthProp
|
||||
};
|
||||
const watermarkEmits = {
|
||||
[uni_modules_nutuiUni_components__constants_event.CLICK_EVENT]: (val) => val instanceof Object
|
||||
};
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-watermark`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: watermarkProps,
|
||||
emits: watermarkEmits,
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
const state = common_vendor.reactive({
|
||||
base64Url: ""
|
||||
});
|
||||
const {
|
||||
zIndex,
|
||||
gapX,
|
||||
gapY,
|
||||
width,
|
||||
height,
|
||||
rotate,
|
||||
image,
|
||||
imageWidth,
|
||||
imageHeight,
|
||||
content,
|
||||
fontStyle,
|
||||
fontWeight,
|
||||
fontColor,
|
||||
fontSize,
|
||||
fontFamily
|
||||
} = common_vendor.toRefs(props);
|
||||
async function init() {
|
||||
let ratio = 1;
|
||||
common_vendor.index.getSystemInfo({
|
||||
success(res) {
|
||||
ratio = res.pixelRatio;
|
||||
}
|
||||
});
|
||||
const canvasWidth = `${(gapX.value + width.value) * ratio}`;
|
||||
const canvasHeight = `${(gapY.value + height.value) * ratio}`;
|
||||
const markWidth = width.value * ratio;
|
||||
const markHeight = height.value * ratio;
|
||||
const canvas = common_vendor.index.createOffscreenCanvas({
|
||||
type: "2d",
|
||||
width: Number(canvasWidth),
|
||||
height: Number(canvasHeight)
|
||||
});
|
||||
const ctx = canvas.getContext("2d");
|
||||
if (ctx) {
|
||||
if (image == null ? void 0 : image.value) {
|
||||
const img = canvas.createImage();
|
||||
dealWithImage(ctx, img, ratio, ctx.canvas, markWidth, markHeight);
|
||||
} else if (content == null ? void 0 : content.value) {
|
||||
dealWithText(ctx, ratio, ctx.canvas, markWidth, markHeight);
|
||||
}
|
||||
} else {
|
||||
throw new Error("当前环境不支持Canvas");
|
||||
}
|
||||
}
|
||||
function dealWithImage(ctx, img, ratio, canvas, markWidth, markHeight) {
|
||||
ctx.translate(markWidth / 2, markHeight / 2);
|
||||
ctx.rotate(Math.PI / 180 * Number(rotate.value));
|
||||
img.crossOrigin = "anonymous";
|
||||
img.referrerPolicy = "no-referrer";
|
||||
img.src = image.value;
|
||||
img.onload = () => {
|
||||
ctx.drawImage(
|
||||
img,
|
||||
-imageWidth.value * ratio / 2,
|
||||
-imageHeight.value * ratio / 2,
|
||||
imageWidth.value * ratio,
|
||||
imageHeight.value * ratio
|
||||
);
|
||||
ctx.restore();
|
||||
state.base64Url = canvas.toDataURL();
|
||||
};
|
||||
}
|
||||
function dealWithText(ctx, ratio, canvas, markWidth, markHeight) {
|
||||
var _a;
|
||||
ctx.textBaseline = "middle";
|
||||
ctx.textAlign = "center";
|
||||
ctx.translate(markWidth / 2, markHeight / 2);
|
||||
ctx.rotate(Math.PI / 180 * Number(rotate.value));
|
||||
const markSize = Number(fontSize.value) * ratio;
|
||||
ctx.font = `${fontStyle.value} normal ${fontWeight.value} ${markSize}px/${markHeight}px ${fontFamily.value}`;
|
||||
ctx.fillStyle = fontColor.value;
|
||||
if (Array.isArray(content.value)) {
|
||||
(_a = content.value) == null ? void 0 : _a.forEach((item, index) => {
|
||||
ctx.fillText(item, 0, (index - 1) * markSize);
|
||||
});
|
||||
} else {
|
||||
ctx.fillText(content.value, 0, 0);
|
||||
}
|
||||
ctx.restore();
|
||||
state.base64Url = canvas.toDataURL();
|
||||
}
|
||||
init();
|
||||
common_vendor.watch(
|
||||
() => [
|
||||
zIndex.value,
|
||||
gapX.value,
|
||||
gapY.value,
|
||||
width.value,
|
||||
height.value,
|
||||
rotate.value,
|
||||
image == null ? void 0 : image.value,
|
||||
imageWidth.value,
|
||||
imageHeight.value,
|
||||
content == null ? void 0 : content.value,
|
||||
fontStyle.value,
|
||||
fontWeight.value,
|
||||
fontColor.value,
|
||||
fontSize.value,
|
||||
fontFamily.value
|
||||
],
|
||||
() => {
|
||||
init();
|
||||
}
|
||||
);
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, {
|
||||
[`${componentName}-full-page`]: props.fullPage
|
||||
});
|
||||
});
|
||||
const styles = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainStyle(props, {
|
||||
zIndex: props.zIndex,
|
||||
backgroundSize: `${props.gapX + props.width}px`,
|
||||
backgroundImage: `url('${state.base64Url}')`
|
||||
});
|
||||
});
|
||||
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/watermark/watermark.js.map
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<view class="{{a}}" style="{{b}}"/>
|
||||
@@ -1,63 +0,0 @@
|
||||
/**
|
||||
* 这里是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-watermark {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: var(--nut-watermark-z-index, 2000);
|
||||
pointer-events: none;
|
||||
background-repeat: repeat;
|
||||
}
|
||||
.nut-watermark-full-page {
|
||||
position: fixed;
|
||||
}
|
||||
Reference in New Issue
Block a user