@tuya-miniapp/smart-ui 2.3.4-beta-6 → 2.3.4-beta-7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/popover/index.css +1 -1
- package/dist/popover/index.js +9 -7
- package/dist/popover/index.json +2 -1
- package/dist/popover/index.wxml +1 -1
- package/dist/popover/index.wxss +1 -1
- package/lib/popover/index.css +1 -1
- package/lib/popover/index.js +8 -8
- package/lib/popover/index.json +2 -1
- package/lib/popover/index.wxml +1 -1
- package/lib/popover/index.wxss +1 -1
- package/package.json +1 -1
package/dist/popover/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import '../common/index.css';.smart-popover{--overlay-background-color:transparent;position:relative}.smart-popover,.smart-popover-button{display:inline-block}.smart-popover-overlay{background-color:var(--popover-background-color,var(--app-B4,#fff));border-radius:var(--popover-border-radius,12px);box-shadow:var(--popover-box-shadow,0 6px 12px 0 rgba(0,0,0,.1));opacity:0;padding:var(--popover-padding,12px);position:absolute;transition:opacity .3s ease-in-out;z-index:102}.smart-popover-overlay-arrow{background-position:50%;background-repeat:no-repeat;position:absolute}
|
|
1
|
+
@import '../common/index.css';.smart-popover{--overlay-background-color:transparent;--icon-color:var(--popover-background-color,var(--app-B4,#fff));position:relative}.smart-popover,.smart-popover-button{display:inline-block}.smart-popover-overlay{background-color:var(--popover-background-color,var(--app-B4,#fff));border-radius:var(--popover-border-radius,12px);box-shadow:var(--popover-box-shadow,0 6px 12px 0 rgba(0,0,0,.1));opacity:0;padding:var(--popover-padding,12px);position:absolute;transition:opacity .3s ease-in-out;z-index:102}.smart-popover-overlay-arrow{background-position:50%;background-repeat:no-repeat;position:absolute}
|
package/dist/popover/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/* eslint-disable prefer-destructuring */
|
|
2
2
|
import { SmartComponent } from '../common/component';
|
|
3
|
-
const IconSrc = (
|
|
3
|
+
const IconSrc = () => `<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
+
<path d="M 10 90 L 90 90 L 50 30 Z" fill="currentColor" stroke="purple" stroke-width="1"/>
|
|
5
|
+
</svg>`;
|
|
4
6
|
function createSvgIcon(svg) {
|
|
5
7
|
return `data:image/svg+xml,${encodeURIComponent(`<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">${svg}`)}`;
|
|
6
8
|
}
|
|
@@ -60,10 +62,10 @@ SmartComponent({
|
|
|
60
62
|
// left: rect.left,
|
|
61
63
|
// top: rect.top,
|
|
62
64
|
transform: '',
|
|
63
|
-
iconTransform: '',
|
|
64
65
|
iconPos: '',
|
|
65
66
|
iconPosVal: 0,
|
|
66
|
-
iconSrc: createSvgIcon(IconSrc(
|
|
67
|
+
iconSrc: createSvgIcon(IconSrc()),
|
|
68
|
+
iconRotate: '0deg',
|
|
67
69
|
iconWidth: '18px',
|
|
68
70
|
iconHeight: '6px',
|
|
69
71
|
iconStyle: '',
|
|
@@ -88,7 +90,7 @@ SmartComponent({
|
|
|
88
90
|
params.top = '50%';
|
|
89
91
|
iconAlignPos = 'top: 50%';
|
|
90
92
|
}
|
|
91
|
-
params = Object.assign(Object.assign({}, params), { transform, iconSrc: createSvgIcon(IconSrc(
|
|
93
|
+
params = Object.assign(Object.assign({}, params), { transform, iconSrc: createSvgIcon(IconSrc()), iconStyle: `right:8px;transform:translate(100%, -50%) rotate(90deg);width:18px;height:18px;background-size: 18px 18px;${iconAlignPos}` });
|
|
92
94
|
}
|
|
93
95
|
if (placement.startsWith('top')) {
|
|
94
96
|
let iconAlignPos = '';
|
|
@@ -111,7 +113,7 @@ SmartComponent({
|
|
|
111
113
|
params.top = '-12px';
|
|
112
114
|
params.left = '50%';
|
|
113
115
|
}
|
|
114
|
-
params = Object.assign(Object.assign({}, params), { transform, iconSrc: createSvgIcon(IconSrc('0deg'
|
|
116
|
+
params = Object.assign(Object.assign({}, params), { transform, iconSrc: createSvgIcon(IconSrc()), iconRotate: '0deg', iconStyle: `bottom:0px;transform:translate(-50%, 100%) rotate(180deg);width:18px;height:6px;background-size: 18px 6px;${iconAlignPos}` });
|
|
115
117
|
}
|
|
116
118
|
if (placement.startsWith('right')) {
|
|
117
119
|
let iconAlignPos = '';
|
|
@@ -134,7 +136,7 @@ SmartComponent({
|
|
|
134
136
|
params.left = 'calc(100% + 8px)';
|
|
135
137
|
params.top = '50%';
|
|
136
138
|
}
|
|
137
|
-
params = Object.assign(Object.assign({}, params), { transform, iconSrc: createSvgIcon(IconSrc('90deg'
|
|
139
|
+
params = Object.assign(Object.assign({}, params), { transform, iconSrc: createSvgIcon(IconSrc()), iconRotate: '90deg', iconStyle: `left:-10px;transform:translate(0%, -50%) rotate(-90deg);width:18px;height:18px;background-size: 18px 18px;${iconAlignPos};` });
|
|
138
140
|
}
|
|
139
141
|
if (placement.startsWith('bottom')) {
|
|
140
142
|
let iconAlignPos = '';
|
|
@@ -157,7 +159,7 @@ SmartComponent({
|
|
|
157
159
|
params.bottom = '-10px';
|
|
158
160
|
params.left = '50%';
|
|
159
161
|
}
|
|
160
|
-
params = Object.assign(Object.assign({}, params), { transform, iconSrc: createSvgIcon(IconSrc('180deg'
|
|
162
|
+
params = Object.assign(Object.assign({}, params), { transform, iconSrc: createSvgIcon(IconSrc()), iconRotate: '180deg', iconStyle: `top:0px;transform:translate(-50%, -100%) rotate(0deg);width:18px;height:6px;background-size: 18px 6px;${iconAlignPos}` });
|
|
161
163
|
}
|
|
162
164
|
this.setData(params);
|
|
163
165
|
},
|
package/dist/popover/index.json
CHANGED
package/dist/popover/index.wxml
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<slot />
|
|
17
17
|
<view catch:tap="noop" wx:if="{{currentShow}}" class="smart-popover-overlay" style="left: {{left}};top: {{top}}; bottom:{{bottom}};right:{{right}}; transform:{{transform}}; {{customStyle}}; {{showStyle}}">
|
|
18
18
|
<slot name="overlay" />
|
|
19
|
-
<
|
|
19
|
+
<smart-icon class="smart-popover-overlay-arrow" name="{{iconSrc}}" style=" transform: {{iconTransform}}; {{iconPos}}: {{iconPosVal}}px;background-size: {{iconWidth}} {{iconHeight}};{{iconStyle}}"></smart-icon>
|
|
20
20
|
</view>
|
|
21
21
|
</view>
|
|
22
22
|
|
package/dist/popover/index.wxss
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import '../common/index.wxss';.smart-popover{--overlay-background-color:transparent;position:relative}.smart-popover,.smart-popover-button{display:inline-block}.smart-popover-overlay{background-color:var(--popover-background-color,var(--app-B4,#fff));border-radius:var(--popover-border-radius,12px);box-shadow:var(--popover-box-shadow,0 6px 12px 0 rgba(0,0,0,.1));opacity:0;padding:var(--popover-padding,12px);position:absolute;transition:opacity .3s ease-in-out;z-index:102}.smart-popover-overlay-arrow{background-position:50%;background-repeat:no-repeat;position:absolute}
|
|
1
|
+
@import '../common/index.wxss';.smart-popover{--overlay-background-color:transparent;--icon-color:var(--popover-background-color,var(--app-B4,#fff));position:relative}.smart-popover,.smart-popover-button{display:inline-block}.smart-popover-overlay{background-color:var(--popover-background-color,var(--app-B4,#fff));border-radius:var(--popover-border-radius,12px);box-shadow:var(--popover-box-shadow,0 6px 12px 0 rgba(0,0,0,.1));opacity:0;padding:var(--popover-padding,12px);position:absolute;transition:opacity .3s ease-in-out;z-index:102}.smart-popover-overlay-arrow{background-position:50%;background-repeat:no-repeat;position:absolute}
|
package/lib/popover/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import '../common/index.css';.smart-popover{--overlay-background-color:transparent;position:relative}.smart-popover,.smart-popover-button{display:inline-block}.smart-popover-overlay{background-color:var(--popover-background-color,var(--app-B4,#fff));border-radius:var(--popover-border-radius,12px);box-shadow:var(--popover-box-shadow,0 6px 12px 0 rgba(0,0,0,.1));opacity:0;padding:var(--popover-padding,12px);position:absolute;transition:opacity .3s ease-in-out;z-index:102}.smart-popover-overlay-arrow{background-position:50%;background-repeat:no-repeat;position:absolute}
|
|
1
|
+
@import '../common/index.css';.smart-popover{--overlay-background-color:transparent;--icon-color:var(--popover-background-color,var(--app-B4,#fff));position:relative}.smart-popover,.smart-popover-button{display:inline-block}.smart-popover-overlay{background-color:var(--popover-background-color,var(--app-B4,#fff));border-radius:var(--popover-border-radius,12px);box-shadow:var(--popover-box-shadow,0 6px 12px 0 rgba(0,0,0,.1));opacity:0;padding:var(--popover-padding,12px);position:absolute;transition:opacity .3s ease-in-out;z-index:102}.smart-popover-overlay-arrow{background-position:50%;background-repeat:no-repeat;position:absolute}
|
package/lib/popover/index.js
CHANGED
|
@@ -13,8 +13,8 @@ var __assign = (this && this.__assign) || function () {
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
/* eslint-disable prefer-destructuring */
|
|
15
15
|
var component_1 = require("../common/component");
|
|
16
|
-
var IconSrc = function (
|
|
17
|
-
return "<svg
|
|
16
|
+
var IconSrc = function () {
|
|
17
|
+
return "<svg width=\"100\" height=\"100\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M 10 90 L 90 90 L 50 30 Z\" fill=\"currentColor\" stroke=\"purple\" stroke-width=\"1\"/>\n</svg>";
|
|
18
18
|
};
|
|
19
19
|
function createSvgIcon(svg) {
|
|
20
20
|
return "data:image/svg+xml,".concat(encodeURIComponent("<?xml version=\"1.0\" standalone=\"no\"?><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">".concat(svg)));
|
|
@@ -75,10 +75,10 @@ function createSvgIcon(svg) {
|
|
|
75
75
|
// left: rect.left,
|
|
76
76
|
// top: rect.top,
|
|
77
77
|
transform: '',
|
|
78
|
-
iconTransform: '',
|
|
79
78
|
iconPos: '',
|
|
80
79
|
iconPosVal: 0,
|
|
81
|
-
iconSrc: createSvgIcon(IconSrc(
|
|
80
|
+
iconSrc: createSvgIcon(IconSrc()),
|
|
81
|
+
iconRotate: '0deg',
|
|
82
82
|
iconWidth: '18px',
|
|
83
83
|
iconHeight: '6px',
|
|
84
84
|
iconStyle: '',
|
|
@@ -103,7 +103,7 @@ function createSvgIcon(svg) {
|
|
|
103
103
|
params.top = '50%';
|
|
104
104
|
iconAlignPos = 'top: 50%';
|
|
105
105
|
}
|
|
106
|
-
params = __assign(__assign({}, params), { transform: transform, iconSrc: createSvgIcon(IconSrc(
|
|
106
|
+
params = __assign(__assign({}, params), { transform: transform, iconSrc: createSvgIcon(IconSrc()), iconStyle: "right:8px;transform:translate(100%, -50%) rotate(90deg);width:18px;height:18px;background-size: 18px 18px;".concat(iconAlignPos) });
|
|
107
107
|
}
|
|
108
108
|
if (placement.startsWith('top')) {
|
|
109
109
|
var iconAlignPos = '';
|
|
@@ -126,7 +126,7 @@ function createSvgIcon(svg) {
|
|
|
126
126
|
params.top = '-12px';
|
|
127
127
|
params.left = '50%';
|
|
128
128
|
}
|
|
129
|
-
params = __assign(__assign({}, params), { transform: transform, iconSrc: createSvgIcon(IconSrc('0deg'
|
|
129
|
+
params = __assign(__assign({}, params), { transform: transform, iconSrc: createSvgIcon(IconSrc()), iconRotate: '0deg', iconStyle: "bottom:0px;transform:translate(-50%, 100%) rotate(180deg);width:18px;height:6px;background-size: 18px 6px;".concat(iconAlignPos) });
|
|
130
130
|
}
|
|
131
131
|
if (placement.startsWith('right')) {
|
|
132
132
|
var iconAlignPos = '';
|
|
@@ -149,7 +149,7 @@ function createSvgIcon(svg) {
|
|
|
149
149
|
params.left = 'calc(100% + 8px)';
|
|
150
150
|
params.top = '50%';
|
|
151
151
|
}
|
|
152
|
-
params = __assign(__assign({}, params), { transform: transform, iconSrc: createSvgIcon(IconSrc('90deg'
|
|
152
|
+
params = __assign(__assign({}, params), { transform: transform, iconSrc: createSvgIcon(IconSrc()), iconRotate: '90deg', iconStyle: "left:-10px;transform:translate(0%, -50%) rotate(-90deg);width:18px;height:18px;background-size: 18px 18px;".concat(iconAlignPos, ";") });
|
|
153
153
|
}
|
|
154
154
|
if (placement.startsWith('bottom')) {
|
|
155
155
|
var iconAlignPos = '';
|
|
@@ -172,7 +172,7 @@ function createSvgIcon(svg) {
|
|
|
172
172
|
params.bottom = '-10px';
|
|
173
173
|
params.left = '50%';
|
|
174
174
|
}
|
|
175
|
-
params = __assign(__assign({}, params), { transform: transform, iconSrc: createSvgIcon(IconSrc('180deg'
|
|
175
|
+
params = __assign(__assign({}, params), { transform: transform, iconSrc: createSvgIcon(IconSrc()), iconRotate: '180deg', iconStyle: "top:0px;transform:translate(-50%, -100%) rotate(0deg);width:18px;height:6px;background-size: 18px 6px;".concat(iconAlignPos) });
|
|
176
176
|
}
|
|
177
177
|
this.setData(params);
|
|
178
178
|
},
|
package/lib/popover/index.json
CHANGED
package/lib/popover/index.wxml
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<slot />
|
|
17
17
|
<view catch:tap="noop" wx:if="{{currentShow}}" class="smart-popover-overlay" style="left: {{left}};top: {{top}}; bottom:{{bottom}};right:{{right}}; transform:{{transform}}; {{customStyle}}; {{showStyle}}">
|
|
18
18
|
<slot name="overlay" />
|
|
19
|
-
<
|
|
19
|
+
<smart-icon class="smart-popover-overlay-arrow" name="{{iconSrc}}" style=" transform: {{iconTransform}}; {{iconPos}}: {{iconPosVal}}px;background-size: {{iconWidth}} {{iconHeight}};{{iconStyle}}"></smart-icon>
|
|
20
20
|
</view>
|
|
21
21
|
</view>
|
|
22
22
|
|
package/lib/popover/index.wxss
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import '../common/index.wxss';.smart-popover{--overlay-background-color:transparent;position:relative}.smart-popover,.smart-popover-button{display:inline-block}.smart-popover-overlay{background-color:var(--popover-background-color,var(--app-B4,#fff));border-radius:var(--popover-border-radius,12px);box-shadow:var(--popover-box-shadow,0 6px 12px 0 rgba(0,0,0,.1));opacity:0;padding:var(--popover-padding,12px);position:absolute;transition:opacity .3s ease-in-out;z-index:102}.smart-popover-overlay-arrow{background-position:50%;background-repeat:no-repeat;position:absolute}
|
|
1
|
+
@import '../common/index.wxss';.smart-popover{--overlay-background-color:transparent;--icon-color:var(--popover-background-color,var(--app-B4,#fff));position:relative}.smart-popover,.smart-popover-button{display:inline-block}.smart-popover-overlay{background-color:var(--popover-background-color,var(--app-B4,#fff));border-radius:var(--popover-border-radius,12px);box-shadow:var(--popover-box-shadow,0 6px 12px 0 rgba(0,0,0,.1));opacity:0;padding:var(--popover-padding,12px);position:absolute;transition:opacity .3s ease-in-out;z-index:102}.smart-popover-overlay-arrow{background-position:50%;background-repeat:no-repeat;position:absolute}
|