init
This commit is contained in:
175
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cell/cell.js
vendored
Normal file
175
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cell/cell.js
vendored
Normal file
@@ -0,0 +1,175 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_nutuiUni_components__constants_event = require("../_constants/event.js");
|
||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_pxCheck = require("../_utils/pxCheck.js");
|
||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const cellProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
/**
|
||||
* @description 标题名称
|
||||
*/
|
||||
title: String,
|
||||
/**
|
||||
* @description 左侧副标题
|
||||
*/
|
||||
subTitle: String,
|
||||
/**
|
||||
* @description 右侧描述
|
||||
*/
|
||||
desc: String,
|
||||
/**
|
||||
* @description 右侧描述文本对齐方式 [text-align](https://www.w3school.com.cn/cssref/pr_text_text-align.asp)
|
||||
*/
|
||||
descTextAlign: uni_modules_nutuiUni_components__utils_props.makeStringProp("right"),
|
||||
/**
|
||||
* @description 是否展示右侧箭头并开启点击反馈
|
||||
*/
|
||||
isLink: Boolean,
|
||||
/**
|
||||
* @description 点击后跳转的目标路由对象,
|
||||
*/
|
||||
to: String,
|
||||
/**
|
||||
* @description 圆角半径
|
||||
*/
|
||||
roundRadius: uni_modules_nutuiUni_components__utils_props.makeNumericProp(void 0),
|
||||
/**
|
||||
* @description 是否使内容垂直居中
|
||||
*/
|
||||
center: Boolean,
|
||||
/**
|
||||
* @description 单元格大小,可选值为 `large`
|
||||
*/
|
||||
size: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
||||
/**
|
||||
* @description 是否启用点击效果
|
||||
*/
|
||||
clickable: Boolean,
|
||||
/**
|
||||
* @description 左侧图标
|
||||
*/
|
||||
icon: String,
|
||||
/**
|
||||
* @description 标题宽度
|
||||
*/
|
||||
titleWidth: uni_modules_nutuiUni_components__utils_props.makeNumericProp(void 0)
|
||||
};
|
||||
const cellEmits = {
|
||||
[uni_modules_nutuiUni_components__constants_event.CLICK_EVENT]: (event) => event instanceof Object
|
||||
};
|
||||
if (!Math) {
|
||||
NutIcon();
|
||||
}
|
||||
const NutIcon = () => "../icon/icon.js";
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-cell`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: cellProps,
|
||||
emits: cellEmits,
|
||||
setup(__props, { emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const slots = common_vendor.useSlots();
|
||||
const classes = common_vendor.computed(() => {
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, {
|
||||
[`${componentName}--center`]: props.center,
|
||||
[`${componentName}--large`]: props.size === "large",
|
||||
[`${componentName}--clickable`]: props.isLink || props.to || props.clickable
|
||||
});
|
||||
});
|
||||
const styles = common_vendor.computed(() => {
|
||||
const value = {};
|
||||
if (props.roundRadius != null)
|
||||
value.borderRadius = uni_modules_nutuiUni_components__utils_pxCheck.pxCheck(props.roundRadius);
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainStyle(props, value);
|
||||
});
|
||||
const titleStyles = common_vendor.computed(() => {
|
||||
const value = {};
|
||||
if (props.titleWidth != null) {
|
||||
value.flex = "0 0 auto";
|
||||
value.width = uni_modules_nutuiUni_components__utils_pxCheck.pxCheck(props.titleWidth);
|
||||
value.minWidth = 0;
|
||||
}
|
||||
return value;
|
||||
});
|
||||
const descClasses = common_vendor.computed(() => {
|
||||
return {
|
||||
[`${componentName}__value--alone`]: !(props.title || props.subTitle || slots.title)
|
||||
};
|
||||
});
|
||||
const descStyles = common_vendor.computed(() => {
|
||||
return {
|
||||
textAlign: props.descTextAlign
|
||||
};
|
||||
});
|
||||
function handleClick(event) {
|
||||
emit(uni_modules_nutuiUni_components__constants_event.CLICK_EVENT, event);
|
||||
if (props.to) {
|
||||
common_vendor.index.navigateTo({
|
||||
url: props.to
|
||||
});
|
||||
}
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.unref(slots).default
|
||||
}, common_vendor.unref(slots).default ? {} : common_vendor.e({
|
||||
b: props.icon || common_vendor.unref(slots).icon
|
||||
}, props.icon || common_vendor.unref(slots).icon ? common_vendor.e({
|
||||
c: common_vendor.unref(slots).icon
|
||||
}, common_vendor.unref(slots).icon ? {} : {
|
||||
d: common_vendor.p({
|
||||
["custom-class"]: "nut-cell__icon__inner",
|
||||
name: props.icon
|
||||
})
|
||||
}) : {}, {
|
||||
e: props.title || props.subTitle || common_vendor.unref(slots).title
|
||||
}, props.title || props.subTitle || common_vendor.unref(slots).title ? common_vendor.e({
|
||||
f: common_vendor.unref(slots).title
|
||||
}, common_vendor.unref(slots).title ? {} : {
|
||||
g: common_vendor.t(props.title)
|
||||
}, {
|
||||
h: props.subTitle
|
||||
}, props.subTitle ? {
|
||||
i: common_vendor.t(props.subTitle)
|
||||
} : {}, {
|
||||
j: common_vendor.s(titleStyles.value)
|
||||
}) : {}, {
|
||||
k: props.desc || common_vendor.unref(slots).desc
|
||||
}, props.desc || common_vendor.unref(slots).desc ? common_vendor.e({
|
||||
l: common_vendor.unref(slots).desc
|
||||
}, common_vendor.unref(slots).desc ? {} : {
|
||||
m: common_vendor.t(props.desc)
|
||||
}, {
|
||||
n: common_vendor.n(descClasses.value),
|
||||
o: common_vendor.s(descStyles.value)
|
||||
}) : {}, {
|
||||
p: common_vendor.unref(slots).link
|
||||
}, common_vendor.unref(slots).link ? {} : common_vendor.e({
|
||||
q: props.isLink || props.to
|
||||
}, props.isLink || props.to ? {
|
||||
r: common_vendor.p({
|
||||
["custom-class"]: "nut-cell__link",
|
||||
name: "right"
|
||||
})
|
||||
} : {})), {
|
||||
s: common_vendor.n(classes.value),
|
||||
t: common_vendor.s(styles.value),
|
||||
v: common_vendor.o(handleClick)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/cell/cell.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cell/cell.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cell/cell.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"nut-icon": "../icon/icon"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cell/cell.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cell/cell.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{s}}" style="{{t}}" bindtap="{{v}}"><slot wx:if="{{a}}"/><block wx:else><view wx:if="{{b}}" class="nut-cell__icon"><slot wx:if="{{c}}" name="icon"/><nut-icon wx:else u-i="5c2f5a9a-0" bind:__l="__l" u-p="{{d||''}}"/></view><view wx:if="{{e}}" class="nut-cell__title" style="{{j}}"><slot wx:if="{{f}}" name="title"/><view wx:else class="title">{{g}}</view><view wx:if="{{h}}" class="nut-cell__title-desc">{{i}}</view></view><view wx:if="{{k}}" class="{{['nut-cell__value', n]}}" style="{{o}}"><slot wx:if="{{l}}" name="desc"/><block wx:else>{{m}}</block></view><slot wx:if="{{p}}" name="link"/><block wx:else><nut-icon wx:if="{{q}}" u-i="5c2f5a9a-1" bind:__l="__l" u-p="{{r}}"/></block></block></view>
|
||||
141
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cell/cell.wxss
vendored
Normal file
141
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/cell/cell.wxss
vendored
Normal file
@@ -0,0 +1,141 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.nut-theme-dark .nut-cell {
|
||||
color: var(--nut-dark-color, var(--nut-white, #fff));
|
||||
background: var(--nut-dark-background2, #1b1b1b);
|
||||
box-shadow: none;
|
||||
}
|
||||
.nut-cell {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
padding: var(--nut-cell-padding, 13px 16px);
|
||||
margin: 10px 0;
|
||||
font-size: var(--nut-cell-title-font, var(--nut-font-size-2, 14px));
|
||||
line-height: var(--nut-cell-line-height, 20px);
|
||||
color: var(--nut-cell-color, var(--nut-title-color2, #666));
|
||||
background: var(--nut-cell-background, var(--nut-white, #fff));
|
||||
border-radius: var(--nut-cell-border-radius, 6px);
|
||||
box-shadow: var(--nut-cell-box-shadow, 0 1px 7px 0 #edeef1);
|
||||
}
|
||||
.nut-cell--center {
|
||||
align-items: center;
|
||||
}
|
||||
.nut-cell--large {
|
||||
padding: var(--nut-cell-large-padding, 15px 16px);
|
||||
font-size: var(--nut-cell-large-title-font, var(--nut-font-size-large, var(--nut-font-size-3, 16px)));
|
||||
}
|
||||
.nut-cell--large .nut-cell__title-desc {
|
||||
font-size: var(--nut-cell-large-title-desc-font, var(--nut-font-size-base, var(--nut-font-size-2, 14px)));
|
||||
}
|
||||
.nut-cell:last-child::after {
|
||||
border: 0 !important;
|
||||
}
|
||||
.nut-cell::after {
|
||||
position: absolute;
|
||||
right: var(--nut-cell-after-right, 16px);
|
||||
bottom: 0;
|
||||
left: 16px;
|
||||
box-sizing: border-box;
|
||||
pointer-events: none;
|
||||
content: "";
|
||||
transform: scaleY(0.5);
|
||||
}
|
||||
.nut-cell:active::before {
|
||||
opacity: 0.1;
|
||||
}
|
||||
.nut-cell--clickable {
|
||||
cursor: pointer;
|
||||
}
|
||||
.nut-cell--clickable::before {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
content: "";
|
||||
background-color: var(--nut-black, #000);
|
||||
border: inherit;
|
||||
border-color: var(--nut-black, #000);
|
||||
border-radius: inherit;
|
||||
opacity: 0;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
.nut-cell__icon {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
margin: var(--nut-cell-default-icon-margin, 0 4px 0 0);
|
||||
}
|
||||
.nut-cell__title {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
min-width: 80px;
|
||||
}
|
||||
.nut-cell__title-desc {
|
||||
font-size: var(--nut-cell-title-desc-font, var(--nut-font-size-1, 12px));
|
||||
}
|
||||
.nut-cell__value {
|
||||
display: inline-block;
|
||||
flex: 1;
|
||||
font-size: var(--nut-cell-desc-font, var(--nut-font-size-2, 14px));
|
||||
color: var(--nut-cell-desc-color, var(--nut-disable-color, #ccc));
|
||||
text-align: right;
|
||||
}
|
||||
.nut-cell__value--alone {
|
||||
color: var(--nut-cell-color, var(--nut-title-color2, #666));
|
||||
}
|
||||
.nut-cell__link {
|
||||
align-self: center;
|
||||
color: #979797;
|
||||
}
|
||||
Reference in New Issue
Block a user