first commit
This commit is contained in:
19
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-loading/types.js
vendored
Normal file
19
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-loading/types.js
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
const uni_modules_wotDesignUni_components_common_props = require("../common/props.js");
|
||||
const loadingProps = {
|
||||
...uni_modules_wotDesignUni_components_common_props.baseProps,
|
||||
/**
|
||||
* 加载指示器类型,可选值:'outline' | 'ring'
|
||||
*/
|
||||
type: uni_modules_wotDesignUni_components_common_props.makeStringProp("ring"),
|
||||
/**
|
||||
* 设置加载指示器颜色
|
||||
*/
|
||||
color: uni_modules_wotDesignUni_components_common_props.makeStringProp("#4D80F0"),
|
||||
/**
|
||||
* 设置加载指示器大小
|
||||
*/
|
||||
size: uni_modules_wotDesignUni_components_common_props.makeNumericProp("")
|
||||
};
|
||||
exports.loadingProps = loadingProps;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-loading/types.js.map
|
||||
82
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-loading/wd-loading.js
vendored
Normal file
82
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-loading/wd-loading.js
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_wotDesignUni_components_common_base64 = require("../common/base64.js");
|
||||
const uni_modules_wotDesignUni_components_common_util = require("../common/util.js");
|
||||
const uni_modules_wotDesignUni_components_wdLoading_types = require("./types.js");
|
||||
const __default__ = {
|
||||
name: "wd-loading",
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
};
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: uni_modules_wotDesignUni_components_wdLoading_types.loadingProps,
|
||||
setup(__props) {
|
||||
const svgDefineId = uni_modules_wotDesignUni_components_common_util.context.id++;
|
||||
const svgDefineId1 = uni_modules_wotDesignUni_components_common_util.context.id++;
|
||||
const svgDefineId2 = uni_modules_wotDesignUni_components_common_util.context.id++;
|
||||
const icon = {
|
||||
outline(color = "#4D80F0") {
|
||||
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42 42"><defs><linearGradient x1="100%" y1="0%" x2="0%" y2="0%" id="${svgDefineId}"><stop stop-color="#FFF" offset="0%" stop-opacity="0"/><stop stop-color="#FFF" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path d="M21 1c11.046 0 20 8.954 20 20s-8.954 20-20 20S1 32.046 1 21 9.954 1 21 1zm0 7C13.82 8 8 13.82 8 21s5.82 13 13 13 13-5.82 13-13S28.18 8 21 8z" fill="${color}"/><path d="M4.599 21c0 9.044 7.332 16.376 16.376 16.376 9.045 0 16.376-7.332 16.376-16.376" stroke="url(#${svgDefineId}) " stroke-width="3.5" stroke-linecap="round"/></g></svg>`;
|
||||
},
|
||||
ring(color = "#4D80F0", intermediateColor2 = "#a6bff7") {
|
||||
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><linearGradient id="${svgDefineId1}" gradientUnits="userSpaceOnUse" x1="50" x2="50" y2="180"><stop offset="0" stop-color="${color}"></stop> <stop offset="1" stop-color="${intermediateColor2}"></stop></linearGradient> <path fill="url(#${svgDefineId1})" d="M20 100c0-44.1 35.9-80 80-80V0C44.8 0 0 44.8 0 100s44.8 100 100 100v-20c-44.1 0-80-35.9-80-80z"></path> <linearGradient id="${svgDefineId2}" gradientUnits="userSpaceOnUse" x1="150" y1="20" x2="150" y2="180"><stop offset="0" stop-color="#fff" stop-opacity="0"></stop> <stop offset="1" stop-color="${intermediateColor2}"></stop></linearGradient> <path fill="url(#${svgDefineId2})" d="M100 0v20c44.1 0 80 35.9 80 80s-35.9 80-80 80v20c55.2 0 100-44.8 100-100S155.2 0 100 0z"></path> <circle cx="100" cy="10" r="10" fill="${color}"></circle></svg>`;
|
||||
}
|
||||
};
|
||||
const props = __props;
|
||||
const svg = common_vendor.ref("");
|
||||
const intermediateColor = common_vendor.ref("");
|
||||
const iconSize = common_vendor.ref(null);
|
||||
common_vendor.watch(
|
||||
() => props.size,
|
||||
(newVal) => {
|
||||
iconSize.value = uni_modules_wotDesignUni_components_common_util.addUnit(newVal);
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
common_vendor.watch(
|
||||
() => props.type,
|
||||
() => {
|
||||
buildSvg();
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
const rootStyle = common_vendor.computed(() => {
|
||||
const style = {};
|
||||
if (uni_modules_wotDesignUni_components_common_util.isDef(iconSize.value)) {
|
||||
style.height = uni_modules_wotDesignUni_components_common_util.addUnit(iconSize.value);
|
||||
style.width = uni_modules_wotDesignUni_components_common_util.addUnit(iconSize.value);
|
||||
}
|
||||
return `${uni_modules_wotDesignUni_components_common_util.objToStyle(style)} ${props.customStyle}`;
|
||||
});
|
||||
common_vendor.onBeforeMount(() => {
|
||||
intermediateColor.value = uni_modules_wotDesignUni_components_common_util.gradient(props.color, "#ffffff", 2)[1];
|
||||
buildSvg();
|
||||
});
|
||||
function buildSvg() {
|
||||
const { type, color } = props;
|
||||
let ringType = uni_modules_wotDesignUni_components_common_util.isDef(type) ? type : "ring";
|
||||
const svgStr = `"data:image/svg+xml;base64,${uni_modules_wotDesignUni_components_common_base64.encode(ringType === "ring" ? icon[ringType](color, intermediateColor.value) : icon[ringType](color))}"`;
|
||||
svg.value = svgStr;
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.s(`background-image: url(${svg.value});`),
|
||||
b: common_vendor.n(`wd-loading ${props.customClass}`),
|
||||
c: common_vendor.s(rootStyle.value)
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f2b508ee"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-loading/wd-loading.js.map
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view class="{{['data-v-f2b508ee', b]}}" style="{{c}}"><view class="wd-loading__body data-v-f2b508ee"><view class="wd-loading__svg data-v-f2b508ee" style="{{a}}"></view></view></view>
|
||||
194
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-loading/wd-loading.wxss
vendored
Normal file
194
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-loading/wd-loading.wxss
vendored
Normal file
@@ -0,0 +1,194 @@
|
||||
/* 水平间距 */
|
||||
/* 水平间距 */
|
||||
/**
|
||||
* 混合宏
|
||||
*/
|
||||
/**
|
||||
* SCSS 配置项:命名空间以及BEM
|
||||
*/
|
||||
/**
|
||||
* 辅助函数
|
||||
*/
|
||||
/**
|
||||
* SCSS 配置项:命名空间以及BEM
|
||||
*/
|
||||
/* 转换成字符串 */
|
||||
/* 判断是否存在 Modifier */
|
||||
/* 判断是否存在伪类 */
|
||||
/**
|
||||
* 主题色切换
|
||||
* @params $theme-color 主题色
|
||||
* @params $type 变暗’dark‘ 变亮 'light'
|
||||
* @params $mix-color 自己设置的混色
|
||||
*/
|
||||
/**
|
||||
* 颜色结果切换, 如果开启线性渐变色 使用渐变色,如果没有开启,那么使用主题色
|
||||
* @params $open-linear 是否开启线性渐变色
|
||||
* @params $deg 渐变色角度
|
||||
* @params $theme-color 当前配色
|
||||
* @params [Array] $set 主题色明暗设置,与 $color-list 数量对应
|
||||
* @params [Array] $color-list 渐变色顺序, $color-list 和 $per-list 数量相同
|
||||
* @params [Array] $per-list 渐变色比例
|
||||
*/
|
||||
/**
|
||||
* BEM,定义块(b)
|
||||
*/
|
||||
/* 定义元素(e),对于伪类,会自动将 e 嵌套在 伪类 底下 */
|
||||
/* 此方法用于生成穿透样式 */
|
||||
/* 定义元素(e),对于伪类,会自动将 e 嵌套在 伪类 底下 */
|
||||
/* 定义状态(m) */
|
||||
/* 定义状态(m) */
|
||||
/* 对于需要需要嵌套在 m 底下的 e,调用这个混合宏,一般在切换整个组件的状态,如切换颜色的时候 */
|
||||
/* 状态,生成 is-$state 类名 */
|
||||
/**
|
||||
* 常用混合宏
|
||||
*/
|
||||
/* 单行超出隐藏 */
|
||||
/* 多行超出隐藏 */
|
||||
/* 清除浮动 */
|
||||
/* 0.5px 边框 指定方向*/
|
||||
/* 0.5px 边框 环绕 */
|
||||
/**
|
||||
* 三角形实现尖角样式,适用于背景透明情况
|
||||
* @param $size 三角形高,底边为 $size * 2
|
||||
* @param $bg 三角形背景颜色
|
||||
*/
|
||||
/**
|
||||
* 正方形实现尖角样式,适用于背景不透明情况
|
||||
* @param $size 正方形边长
|
||||
* @param $bg 正方形背景颜色
|
||||
* @param $z-index z-index属性值,不得大于外部包裹器
|
||||
* @param $box-shadow 阴影
|
||||
*/
|
||||
/**
|
||||
* 辅助函数
|
||||
*/
|
||||
/**
|
||||
* SCSS 配置项:命名空间以及BEM
|
||||
*/
|
||||
/* 转换成字符串 */
|
||||
/* 判断是否存在 Modifier */
|
||||
/* 判断是否存在伪类 */
|
||||
/**
|
||||
* 主题色切换
|
||||
* @params $theme-color 主题色
|
||||
* @params $type 变暗’dark‘ 变亮 'light'
|
||||
* @params $mix-color 自己设置的混色
|
||||
*/
|
||||
/**
|
||||
* 颜色结果切换, 如果开启线性渐变色 使用渐变色,如果没有开启,那么使用主题色
|
||||
* @params $open-linear 是否开启线性渐变色
|
||||
* @params $deg 渐变色角度
|
||||
* @params $theme-color 当前配色
|
||||
* @params [Array] $set 主题色明暗设置,与 $color-list 数量对应
|
||||
* @params [Array] $color-list 渐变色顺序, $color-list 和 $per-list 数量相同
|
||||
* @params [Array] $per-list 渐变色比例
|
||||
*/
|
||||
/**
|
||||
* UI规范基础变量
|
||||
*/
|
||||
/*----------------------------------------- Theme color. start ----------------------------------------*/
|
||||
/* 主题颜色 */
|
||||
/* 辅助色 */
|
||||
/* 文字颜色(默认浅色背景下 */
|
||||
/* 暗黑模式 */
|
||||
/* 图形颜色 */
|
||||
/*----------------------------------------- Theme color. end -------------------------------------------*/
|
||||
/*-------------------------------- Theme color application size. start --------------------------------*/
|
||||
/* 文字字号 */
|
||||
/* 文字字重 */
|
||||
/* 尺寸 */
|
||||
/*-------------------------------- Theme color application size. end --------------------------------*/
|
||||
/* component var */
|
||||
/* action-sheet */
|
||||
/* badge */
|
||||
/* button */
|
||||
/* cell */
|
||||
/* calendar */
|
||||
/* checkbox */
|
||||
/* collapse */
|
||||
/* divider */
|
||||
/* drop-menu */
|
||||
/* input-number */
|
||||
/* input */
|
||||
/* textarea */
|
||||
/* loadmore */
|
||||
/* message-box */
|
||||
/* notice-bar */
|
||||
/* pagination */
|
||||
/* picker */
|
||||
/* col-picker */
|
||||
/* overlay */
|
||||
/* popup */
|
||||
/* progress */
|
||||
/* radio */
|
||||
/* search */
|
||||
/* slider */
|
||||
/* sort-button */
|
||||
/* steps */
|
||||
/* switch */
|
||||
/* tabs */
|
||||
/* tag */
|
||||
/* toast */
|
||||
/* loading */
|
||||
/* tooltip */
|
||||
/* popover */
|
||||
/* grid-item */
|
||||
/* statustip */
|
||||
/* card */
|
||||
/* upload */
|
||||
/* curtain */
|
||||
/* notify */
|
||||
/* skeleton */
|
||||
/* circle */
|
||||
/* swiper */
|
||||
/* swiper-nav */
|
||||
/* segmented */
|
||||
/* tabbar */
|
||||
/* tabbar-item */
|
||||
/* navbar */
|
||||
/* navbar-capsule */
|
||||
/* table */
|
||||
/* sidebar */
|
||||
/* sidebar-item */
|
||||
/* fab */
|
||||
/* count-down */
|
||||
/* keyboard */
|
||||
/* number-keyboard */
|
||||
/* passwod-input */
|
||||
/* form-item */
|
||||
/* backtop */
|
||||
/* index-bar */
|
||||
/* text */
|
||||
/* video-preview */
|
||||
/* img-cropper */
|
||||
/* floating-panel */
|
||||
/* signature */
|
||||
.wd-loading.data-v-f2b508ee {
|
||||
font-size: 0;
|
||||
line-height: 0;
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
width: var(--wot-loading-size, 32px);
|
||||
height: var(--wot-loading-size, 32px);
|
||||
}
|
||||
.wd-loading__body.data-v-f2b508ee {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
animation: wd-rotate-f2b508ee 0.8s linear infinite;
|
||||
animation-duration: 2s;
|
||||
}
|
||||
.wd-loading__svg.data-v-f2b508ee {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
@keyframes wd-rotate-f2b508ee {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user