init
This commit is contained in:
103
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/icon/icon.js
vendored
Normal file
103
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/icon/icon.js
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_nutuiUni_components__constants_event = require("../_constants/event.js");
|
||||
const uni_modules_nutuiUni_components__constants_prefix = require("../_constants/prefix.js");
|
||||
require("../_utils/env.js");
|
||||
const uni_modules_nutuiUni_components__utils_pxCheck = require("../_utils/pxCheck.js");
|
||||
const uni_modules_nutuiUni_components__utils_style = require("../_utils/style.js");
|
||||
const uni_modules_nutuiUni_components__utils_props = require("../_utils/props.js");
|
||||
const iconProps = {
|
||||
...uni_modules_nutuiUni_components__utils_props.commonProps,
|
||||
popClass: { type: String, default: "" },
|
||||
/**
|
||||
* @description 图标宽度
|
||||
*/
|
||||
width: uni_modules_nutuiUni_components__utils_props.makeNumericProp(""),
|
||||
/**
|
||||
* @description 图标高度
|
||||
*/
|
||||
height: uni_modules_nutuiUni_components__utils_props.makeNumericProp(""),
|
||||
/**
|
||||
* @description 图标名称
|
||||
*/
|
||||
name: uni_modules_nutuiUni_components__utils_props.makeStringProp(""),
|
||||
/**
|
||||
* @description 图标大小
|
||||
*/
|
||||
size: uni_modules_nutuiUni_components__utils_props.makeNumericProp(""),
|
||||
/**
|
||||
* @description 自定义 `icon` 类名前缀,用于使用自定义图标
|
||||
*/
|
||||
classPrefix: { type: String, default: "nut-icon" },
|
||||
/**
|
||||
* @description 自定义 `icon` 字体基础类名
|
||||
*/
|
||||
fontClassName: { type: String, default: "nutui-iconfont" },
|
||||
/**
|
||||
* @description 图标颜色
|
||||
*/
|
||||
customColor: { type: String, default: "" }
|
||||
};
|
||||
const iconEmits = {
|
||||
[uni_modules_nutuiUni_components__constants_event.CLICK_EVENT]: (evt) => evt instanceof Object
|
||||
};
|
||||
const componentName = `${uni_modules_nutuiUni_components__constants_prefix.PREFIX}-icon`;
|
||||
const __default__ = common_vendor.defineComponent({
|
||||
name: componentName,
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: iconProps,
|
||||
emits: iconEmits,
|
||||
setup(__props, { emit: __emit }) {
|
||||
const props = __props;
|
||||
const emits = __emit;
|
||||
function handleClick(event) {
|
||||
emits(uni_modules_nutuiUni_components__constants_event.CLICK_EVENT, event);
|
||||
}
|
||||
const isImage = common_vendor.computed(() => {
|
||||
return props.name ? props.name.includes("/") : false;
|
||||
});
|
||||
const classes = common_vendor.computed(() => {
|
||||
const obj = {};
|
||||
if (isImage.value) {
|
||||
obj[`${componentName}__img`] = true;
|
||||
} else {
|
||||
obj[props.fontClassName] = true;
|
||||
obj[`${props.classPrefix}-${props.name}`] = true;
|
||||
obj[props.popClass] = true;
|
||||
}
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainClass(props, componentName, obj);
|
||||
});
|
||||
const getStyle = common_vendor.computed(() => {
|
||||
const style = {
|
||||
color: props.customColor,
|
||||
fontSize: uni_modules_nutuiUni_components__utils_pxCheck.pxCheck(props.size),
|
||||
width: uni_modules_nutuiUni_components__utils_pxCheck.pxCheck(props.width),
|
||||
height: uni_modules_nutuiUni_components__utils_pxCheck.pxCheck(props.height)
|
||||
};
|
||||
return uni_modules_nutuiUni_components__utils_style.getMainStyle(props, style);
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: isImage.value
|
||||
}, isImage.value ? {
|
||||
b: common_vendor.n(classes.value),
|
||||
c: common_vendor.s(getStyle.value),
|
||||
d: _ctx.name,
|
||||
e: common_vendor.o(handleClick)
|
||||
} : {
|
||||
f: common_vendor.n(classes.value),
|
||||
g: common_vendor.s(getStyle.value),
|
||||
h: common_vendor.o(handleClick)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/nutui-uni/components/icon/icon.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/icon/icon.json
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/icon/icon.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/icon/icon.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/icon/icon.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<image wx:if="{{a}}" class="{{b}}" style="{{c}}" src="{{d}}" bindtap="{{e}}"/><text wx:else class="{{f}}" style="{{g}}" bindtap="{{h}}"/>
|
||||
130
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/icon/icon.wxss
vendored
Normal file
130
unpackage/dist/dev/mp-weixin/uni_modules/nutui-uni/components/icon/icon.wxss
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.nut-icon {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: var(--nut-icon-width, 20px);
|
||||
height: var(--nut-icon-height, 20px);
|
||||
line-height: var(--nut-icon-line-height, 20px);
|
||||
text-align: right;
|
||||
--animate-duration: 1s;
|
||||
--animate-delay: 0s;
|
||||
}
|
||||
.nut-icon::before {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
.nut-icon__img {
|
||||
width: var(--nut-icon-width, 20px);
|
||||
height: var(--nut-icon-height, 20px);
|
||||
object-fit: contain;
|
||||
}
|
||||
.nut-icon-loading, .nut-icon-loading1 {
|
||||
display: inline-block;
|
||||
animation: rotation 1s infinite linear;
|
||||
}
|
||||
.nut-icon-am-infinite {
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
.nut-icon-am-jump {
|
||||
animation-name: nutJumpOne;
|
||||
animation-duration: var(--animate-duration);
|
||||
animation-timing-function: ease;
|
||||
animation-delay: var(--animate-delay);
|
||||
}
|
||||
.nut-icon-am-jump.nut-icon-am-infinite {
|
||||
animation-name: nutJump;
|
||||
}
|
||||
.nut-icon-am-rotate {
|
||||
animation-name: rotation;
|
||||
animation-duration: var(--animate-duration);
|
||||
animation-timing-function: linear;
|
||||
animation-delay: var(--animate-delay);
|
||||
}
|
||||
.nut-icon-am-rotate.nut-icon-am-infinite {
|
||||
animation-direction: normal;
|
||||
}
|
||||
.nut-icon-am-blink {
|
||||
animation-name: nutBlink;
|
||||
animation-duration: var(--animate-duration);
|
||||
animation-timing-function: linear;
|
||||
animation-delay: var(--animate-delay);
|
||||
}
|
||||
.nut-icon-am-breathe {
|
||||
animation-name: nutBreathe;
|
||||
animation-duration: var(--animate-duration);
|
||||
animation-timing-function: ease-in-out;
|
||||
animation-delay: var(--animate-delay);
|
||||
}
|
||||
.nut-icon-am-flash {
|
||||
animation-name: nutFlash;
|
||||
animation-duration: var(--animate-duration);
|
||||
animation-timing-function: ease-in-out;
|
||||
animation-delay: var(--animate-delay);
|
||||
}
|
||||
.nut-icon-am-bounce {
|
||||
animation-name: nutBounce;
|
||||
animation-duration: var(--animate-duration);
|
||||
animation-timing-function: ease-in-out;
|
||||
animation-delay: var(--animate-delay);
|
||||
}
|
||||
.nut-icon-am-bounce.nut-icon-am-infinite {
|
||||
animation-direction: normal;
|
||||
}
|
||||
.nut-icon-am-shake {
|
||||
animation-name: nutShake;
|
||||
animation-duration: var(--animate-duration);
|
||||
animation-timing-function: ease-in-out;
|
||||
animation-delay: var(--animate-delay);
|
||||
}
|
||||
Reference in New Issue
Block a user