cosmic-components
Advanced tools
Comparing version 0.0.1-alpha.43 to 0.0.1-alpha.44
@@ -70,3 +70,3 @@ /** | ||
// 空图标 svg path | ||
iconEmptyPath: 'M543.004444 83.038815a70.637037 70.637037 0 0 1 32.483556 32.464592l101.584593 207.947852 229.243259 32.331852a70.637037 70.637037 0 0 1 39.253333 120.718222l-166.475852 160.843852L819.2 865.28a70.637037 70.637037 0 0 1-102.72237 74.600296L512 831.336296l-204.458667 108.544A70.674963 70.674963 0 0 1 204.8 865.28l40.087704-227.934815-166.456889-160.843852a70.618074 70.618074 0 0 1 39.253333-120.718222l229.224296-32.331852 101.603556-207.947852a70.674963 70.674963 0 0 1 94.492444-32.464592z m70.788741 295.253333l-84.764444-172.885333a18.962963 18.962963 0 0 0-34.038519 0l-84.764444 172.885333a37.925926 37.925926 0 0 1-28.766815 20.859259l-191.184593 26.851556a18.962963 18.962963 0 0 0-10.505481 32.426667l138.676148 133.556148a37.925926 37.925926 0 0 1 11.036444 33.905778l-33.393777 189.25037a18.962963 18.962963 0 0 0 27.534222 20.062815l170.666667-90.263704a37.925926 37.925926 0 0 1 35.46074 0l170.628741 90.263704a18.962963 18.962963 0 0 0 27.534222-20.062815l-33.374815-189.25037a37.925926 37.925926 0 0 1 11.036445-33.905778l138.657185-133.537185a18.962963 18.962963 0 0 0-10.505481-32.426667l-191.146667-26.870519a37.925926 37.925926 0 0 1-28.785778-20.859259z', | ||
iconEmptyPath: 'M543.004444 83.038815a70.637037 70.637037 0 0 1 32.483556 32.464592l101.584593 207.947852 229.243259 32.331852a70.637037 70.637037 0 0 1 39.253333 120.718222l-166.475852 160.843852L819.2 865.28a70.637037 70.637037 0 0 1-102.72237 74.600296L512 831.336296l-204.458667 108.544A70.674963 70.674963 0 0 1 204.8 865.28l40.087704-227.934815-166.456889-160.843852a70.618074 70.618074 0 0 1 39.253333-120.718222l229.224296-32.331852 101.603556-207.947852a70.674963 70.674963 0 0 1 94.492444-32.464592z', | ||
// 根元素距离屏幕左侧的距离 | ||
@@ -78,3 +78,7 @@ rootX: 0, | ||
}; | ||
Rate.prototype.attached = function () { | ||
Rate.prototype.handleClick = function (e) { | ||
if (this.data.get('disabled')) { | ||
return; | ||
} | ||
// 避免初始化无法获取宽度时计算报错,以及rootX为旧值问题,将宽度计算放在click中 | ||
var root = this.el; | ||
@@ -87,8 +91,2 @@ // 拿到根元素距离屏幕左侧的距离 | ||
this.data.set('rootWidth', rootWidth); | ||
}; | ||
Rate.prototype.handleClick = function (e) { | ||
if (this.data.get('disabled')) { | ||
return; | ||
} | ||
var rootX = this.data.get('rootX'); | ||
var diffX = e.clientX - rootX; | ||
@@ -123,3 +121,3 @@ var value = this.calculateRate(diffX); | ||
}; | ||
Rate.template = "\n <div\n s-ref=\"rate\"\n class=\"{{ newStyles.rate }}\"\n >\n <!-- \u56FE\u6807 -->\n <div\n class=\"{{ newStyles['iconsRow'] }}\"\n on-click=\"handleClick\"\n >\n\n <!-- \u5B9E\u5FC3\u884C -->\n <div\n class=\"{{ newStyles['row'] }}\"\n >\n <span\n s-for=\"item, index in intPartList\"\n :key=\"'icon' + index\"\n class=\"{{ newStyles['item'] }}\"\n >\n <svg\n t=\"1653032105143\"\n viewBox=\"0 0 1025 1024\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"{{ iconPath }}\"\n >\n </path>\n </svg>\n </span>\n <span\n s-if=\"decPart\"\n class=\"{{ newStyles['item'] }} {{ newStyles['decimal'] }}\"\n >\n <span\n style=\"{{\n {\n width: decPart * 100 + '%'\n }\n }}\"\n class=\"{{ newStyles['decimalInner'] }}\"\n >\n <svg\n t=\"1653032105143\"\n viewBox=\"0 0 1025 1024\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"{{ newStyles['item'] }}\"\n >\n <path\n d=\"{{ iconPath }}\"\n >\n </path>\n </svg>\n </span>\n </span>\n </div>\n <!-- \u7A7A\u5FC3\u884C -->\n <div\n class=\"{{ newStyles['rowEmpty'] }}\"\n >\n <span\n s-for=\"item, index in totalList\"\n :key=\"'icon' + index\"\n class=\"{{ newStyles['item'] }}\"\n >\n <svg\n t=\"1653032148593\"\n viewBox=\"0 0 1024 1024\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"{{ iconEmptyPath }}\"\n >\n </path>\n </svg>\n </span>\n </div>\n </div>\n </div>\n "; | ||
Rate.template = "\n <div\n s-ref=\"rate\"\n class=\"{{ newStyles.rate }} {{ disabled ? newStyles.disabled : '' }}\"\n >\n <!-- \u56FE\u6807 -->\n <div\n class=\"{{ newStyles['iconsRow'] }}\"\n on-click=\"handleClick\"\n >\n\n <!-- \u5B9E\u5FC3\u884C -->\n <div\n class=\"{{ newStyles['row'] }}\"\n >\n <span\n s-for=\"item, index in intPartList\"\n :key=\"'icon' + index\"\n class=\"{{ newStyles['item'] }}\"\n >\n <svg\n t=\"1653032105143\"\n viewBox=\"0 0 1025 1024\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"{{ iconPath }}\"\n >\n </path>\n </svg>\n </span>\n <span\n s-if=\"decPart\"\n class=\"{{ newStyles['item'] }} {{ newStyles['decimal'] }}\"\n >\n <span\n style=\"{{\n {\n width: decPart * 100 + '%'\n }\n }}\"\n class=\"{{ newStyles['decimalInner'] }}\"\n >\n <svg\n t=\"1653032105143\"\n viewBox=\"0 0 1025 1024\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"{{ newStyles['item'] }}\"\n >\n <path\n d=\"{{ iconPath }}\"\n >\n </path>\n </svg>\n </span>\n </span>\n </div>\n <!-- \u7A7A\u5FC3\u884C -->\n <div\n class=\"{{ newStyles['rowEmpty'] }}\"\n >\n <span\n s-for=\"item, index in totalList\"\n :key=\"'icon' + index\"\n class=\"{{ newStyles['item'] }} {{ newStyles['itemEmpty'] }}\"\n >\n <svg\n t=\"1653032148593\"\n viewBox=\"0 0 1024 1024\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"{{ iconEmptyPath }}\"\n >\n </path>\n </svg>\n </span>\n </div>\n </div>\n </div>\n "; | ||
Rate.computed = __assign(__assign({}, Base_1.default.computed), { | ||
@@ -126,0 +124,0 @@ // 整数部分 |
{ | ||
"name": "cosmic-components", | ||
"version": "0.0.1-alpha.43", | ||
"version": "0.0.1-alpha.44", | ||
"main": "./dist/index.js", | ||
@@ -8,5 +8,5 @@ "module": "./src/index.ts", | ||
"dependencies": { | ||
"cosmic-ui-alpha": "0.0.63", | ||
"prismjs": "~1.27.0", | ||
"san": "~3.11.1" | ||
"san": "~3.11.1", | ||
"cosmic-ui-alpha": "0.0.63" | ||
}, | ||
@@ -13,0 +13,0 @@ "devDependencies": { |
@@ -30,3 +30,3 @@ /** | ||
s-ref="rate" | ||
class="{{ newStyles.rate }}" | ||
class="{{ newStyles.rate }} {{ disabled ? newStyles.disabled : '' }}" | ||
> | ||
@@ -94,3 +94,3 @@ <!-- 图标 --> | ||
:key="'icon' + index" | ||
class="{{ newStyles['item'] }}" | ||
class="{{ newStyles['item'] }} {{ newStyles['itemEmpty'] }}" | ||
> | ||
@@ -175,3 +175,3 @@ <svg | ||
// 空图标 svg path | ||
iconEmptyPath: 'M543.004444 83.038815a70.637037 70.637037 0 0 1 32.483556 32.464592l101.584593 207.947852 229.243259 32.331852a70.637037 70.637037 0 0 1 39.253333 120.718222l-166.475852 160.843852L819.2 865.28a70.637037 70.637037 0 0 1-102.72237 74.600296L512 831.336296l-204.458667 108.544A70.674963 70.674963 0 0 1 204.8 865.28l40.087704-227.934815-166.456889-160.843852a70.618074 70.618074 0 0 1 39.253333-120.718222l229.224296-32.331852 101.603556-207.947852a70.674963 70.674963 0 0 1 94.492444-32.464592z m70.788741 295.253333l-84.764444-172.885333a18.962963 18.962963 0 0 0-34.038519 0l-84.764444 172.885333a37.925926 37.925926 0 0 1-28.766815 20.859259l-191.184593 26.851556a18.962963 18.962963 0 0 0-10.505481 32.426667l138.676148 133.556148a37.925926 37.925926 0 0 1 11.036444 33.905778l-33.393777 189.25037a18.962963 18.962963 0 0 0 27.534222 20.062815l170.666667-90.263704a37.925926 37.925926 0 0 1 35.46074 0l170.628741 90.263704a18.962963 18.962963 0 0 0 27.534222-20.062815l-33.374815-189.25037a37.925926 37.925926 0 0 1 11.036445-33.905778l138.657185-133.537185a18.962963 18.962963 0 0 0-10.505481-32.426667l-191.146667-26.870519a37.925926 37.925926 0 0 1-28.785778-20.859259z', | ||
iconEmptyPath: 'M543.004444 83.038815a70.637037 70.637037 0 0 1 32.483556 32.464592l101.584593 207.947852 229.243259 32.331852a70.637037 70.637037 0 0 1 39.253333 120.718222l-166.475852 160.843852L819.2 865.28a70.637037 70.637037 0 0 1-102.72237 74.600296L512 831.336296l-204.458667 108.544A70.674963 70.674963 0 0 1 204.8 865.28l40.087704-227.934815-166.456889-160.843852a70.618074 70.618074 0 0 1 39.253333-120.718222l229.224296-32.331852 101.603556-207.947852a70.674963 70.674963 0 0 1 94.492444-32.464592z', | ||
@@ -186,3 +186,8 @@ // 根元素距离屏幕左侧的距离 | ||
attached() { | ||
handleClick(e: EventRate) { | ||
if (this.data.get('disabled')) { | ||
return; | ||
} | ||
// 避免初始化无法获取宽度时计算报错,以及rootX为旧值问题,将宽度计算放在click中 | ||
const root = this.el as El; | ||
@@ -195,9 +200,2 @@ // 拿到根元素距离屏幕左侧的距离 | ||
this.data.set('rootWidth', rootWidth); | ||
} | ||
handleClick(e: EventRate) { | ||
if (this.data.get('disabled')) { | ||
return; | ||
} | ||
const rootX = this.data.get('rootX'); | ||
const diffX = e.clientX - rootX; | ||
@@ -204,0 +202,0 @@ const value = this.calculateRate(diffX); |
@@ -18,3 +18,2 @@ /** | ||
initData(): Data; | ||
attached(): void; | ||
handleClick(e: EventRate): void; | ||
@@ -21,0 +20,0 @@ calculateRate(diffX: number): number; |
Sorry, the diff of this file is not supported yet
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
8
510814
8746