@pisell/materials 1.8.49 → 1.8.51
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +32 -32
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +32 -32
- package/es/components/PisellScrollView/PisellScrollView.js +10 -0
- package/es/components/PisellScrollView/components/Actions/index.js +55 -0
- package/es/components/PisellScrollView/components/Actions/index.less +122 -0
- package/es/components/PisellScrollView/docs/PisellScrollView.md +1 -1
- package/es/components/PisellScrollView/types.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Input.Phone/serve.js +4 -1
- package/lib/components/PisellScrollView/PisellScrollView.js +10 -0
- package/lib/components/PisellScrollView/components/Actions/index.js +55 -0
- package/lib/components/PisellScrollView/components/Actions/index.less +122 -0
- package/lib/components/PisellScrollView/docs/PisellScrollView.md +1 -1
- package/lib/components/PisellScrollView/types.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Input.Phone/serve.js +4 -1
- package/lowcode/pisell-scroll-view/meta.ts +1 -0
- package/package.json +3 -3
|
@@ -151,6 +151,16 @@ const PisellScrollView = forwardRef((props, ref) => {
|
|
|
151
151
|
const handleButtonClick = (direction) => {
|
|
152
152
|
const container = containerRef.current;
|
|
153
153
|
if (!container) return;
|
|
154
|
+
if ((scrollActionsConfig === null || scrollActionsConfig === void 0 ? void 0 : scrollActionsConfig.type) === "indicator") {
|
|
155
|
+
const indicatorTargets = {
|
|
156
|
+
top: { top: 0 },
|
|
157
|
+
bottom: { top: container.scrollHeight },
|
|
158
|
+
left: { left: 0 },
|
|
159
|
+
right: { left: container.scrollWidth }
|
|
160
|
+
};
|
|
161
|
+
container.scrollTo(_objectSpread2(_objectSpread2({}, indicatorTargets[direction]), {}, { behavior: "smooth" }));
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
154
164
|
const distance = typeof (scrollActionsConfig === null || scrollActionsConfig === void 0 ? void 0 : scrollActionsConfig.scrollDistance) === "number" ? scrollActionsConfig.scrollDistance : 300;
|
|
155
165
|
let top = container.scrollTop;
|
|
156
166
|
let left = container.scrollLeft;
|
|
@@ -5,10 +5,65 @@ import { FloatButton } from "antd";
|
|
|
5
5
|
import classNames from "classnames";
|
|
6
6
|
import "./index.less";
|
|
7
7
|
//#region src/components/PisellScrollView/components/Actions/index.tsx
|
|
8
|
+
/**
|
|
9
|
+
* 生成 indicator action 的 CSS 变量,允许通过 config 调整柔光尺寸与颜色。
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const style = getIndicatorStyle({ size: 24, color: 'rgba(255,255,255,.35)' });
|
|
13
|
+
*/
|
|
14
|
+
const getIndicatorStyle = (config) => ({
|
|
15
|
+
"--pisell-scroll-view-actions-indicator-size": typeof (config === null || config === void 0 ? void 0 : config.size) === "number" ? `${config.size}px` : config === null || config === void 0 ? void 0 : config.size,
|
|
16
|
+
"--pisell-scroll-view-actions-indicator-color": config === null || config === void 0 ? void 0 : config.color
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* ActionsContainer 根据 scrollActionsConfig 渲染滚动辅助操作。
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* <ActionsContainer scrollActionsConfig={{ show: true, type: 'indicator' }} />
|
|
23
|
+
*/
|
|
8
24
|
const ActionsContainer = ({ containerRef, scrollState, overflow, scrollActionsConfig = { type: "backTop" }, onClick }) => {
|
|
9
25
|
if (overflow !== "x" && overflow !== "y") return null;
|
|
10
26
|
if (!scrollState.isOverflows) return null;
|
|
11
27
|
if (!(scrollActionsConfig === null || scrollActionsConfig === void 0 ? void 0 : scrollActionsConfig.show) || !scrollActionsConfig) return null;
|
|
28
|
+
if (scrollActionsConfig.type === "indicator") {
|
|
29
|
+
var _scrollActionsConfig$, _scrollActionsConfig$2, _scrollActionsConfig$3, _scrollActionsConfig$4, _scrollActionsConfig$5, _scrollActionsConfig$6;
|
|
30
|
+
const indicatorStyle = getIndicatorStyle(scrollActionsConfig.config);
|
|
31
|
+
const verticalProgress = Math.max(0, Math.min(1, scrollState.percentY / 100));
|
|
32
|
+
const horizontalProgress = Math.max(0, Math.min(1, scrollState.percentX / 100));
|
|
33
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
34
|
+
"aria-hidden": "true",
|
|
35
|
+
className: classNames("pisell-scroll-view-actions-indicator", (_scrollActionsConfig$ = scrollActionsConfig.config) === null || _scrollActionsConfig$ === void 0 ? void 0 : _scrollActionsConfig$.className),
|
|
36
|
+
style: _objectSpread2(_objectSpread2(_objectSpread2({}, indicatorStyle), scrollActionsConfig.style), (_scrollActionsConfig$2 = scrollActionsConfig.config) === null || _scrollActionsConfig$2 === void 0 ? void 0 : _scrollActionsConfig$2.style)
|
|
37
|
+
}, overflow === "y" && !scrollState.isScrollToTop && /* @__PURE__ */ React.createElement("div", {
|
|
38
|
+
className: "pisell-scroll-view-actions-indicator-item pisell-scroll-view-actions-indicator-item-top",
|
|
39
|
+
style: _objectSpread2({ opacity: Math.max(.6, verticalProgress) }, (_scrollActionsConfig$3 = scrollActionsConfig.config) === null || _scrollActionsConfig$3 === void 0 ? void 0 : _scrollActionsConfig$3.topStyle),
|
|
40
|
+
onClick: () => onClick("top")
|
|
41
|
+
}, /* @__PURE__ */ React.createElement(IconFont, {
|
|
42
|
+
type: "pisell2-chevron-up",
|
|
43
|
+
className: "pisell-scroll-view-actions-indicator-icon"
|
|
44
|
+
})), overflow === "y" && !scrollState.isScrollToBottom && /* @__PURE__ */ React.createElement("div", {
|
|
45
|
+
className: "pisell-scroll-view-actions-indicator-item pisell-scroll-view-actions-indicator-item-bottom",
|
|
46
|
+
style: _objectSpread2({ opacity: Math.max(.6, 1 - verticalProgress * .4) }, (_scrollActionsConfig$4 = scrollActionsConfig.config) === null || _scrollActionsConfig$4 === void 0 ? void 0 : _scrollActionsConfig$4.bottomStyle),
|
|
47
|
+
onClick: () => onClick("bottom")
|
|
48
|
+
}, /* @__PURE__ */ React.createElement(IconFont, {
|
|
49
|
+
type: "pisell2-chevron-down",
|
|
50
|
+
className: "pisell-scroll-view-actions-indicator-icon"
|
|
51
|
+
})), overflow === "x" && !scrollState.isScrollToLeft && /* @__PURE__ */ React.createElement("div", {
|
|
52
|
+
className: "pisell-scroll-view-actions-indicator-item pisell-scroll-view-actions-indicator-item-left",
|
|
53
|
+
style: _objectSpread2({ opacity: Math.max(.6, horizontalProgress) }, (_scrollActionsConfig$5 = scrollActionsConfig.config) === null || _scrollActionsConfig$5 === void 0 ? void 0 : _scrollActionsConfig$5.leftStyle),
|
|
54
|
+
onClick: () => onClick("left")
|
|
55
|
+
}, /* @__PURE__ */ React.createElement(IconFont, {
|
|
56
|
+
type: "pisell2-chevron-left",
|
|
57
|
+
className: "pisell-scroll-view-actions-indicator-icon"
|
|
58
|
+
})), overflow === "x" && !scrollState.isScrollToRight && /* @__PURE__ */ React.createElement("div", {
|
|
59
|
+
className: "pisell-scroll-view-actions-indicator-item pisell-scroll-view-actions-indicator-item-right",
|
|
60
|
+
style: _objectSpread2({ opacity: Math.max(.6, 1 - horizontalProgress * .4) }, (_scrollActionsConfig$6 = scrollActionsConfig.config) === null || _scrollActionsConfig$6 === void 0 ? void 0 : _scrollActionsConfig$6.rightStyle),
|
|
61
|
+
onClick: () => onClick("right")
|
|
62
|
+
}, /* @__PURE__ */ React.createElement(IconFont, {
|
|
63
|
+
type: "pisell2-chevron-right",
|
|
64
|
+
className: "pisell-scroll-view-actions-indicator-icon"
|
|
65
|
+
})));
|
|
66
|
+
}
|
|
12
67
|
if (overflow === "y" && scrollActionsConfig.type === "backTop") return /* @__PURE__ */ React.createElement(FloatButton.BackTop, _objectSpread2(_objectSpread2({
|
|
13
68
|
target: () => containerRef.current || window,
|
|
14
69
|
visibilityHeight: 300,
|
|
@@ -131,4 +131,126 @@
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.pisell-scroll-view-actions-indicator {
|
|
137
|
+
--pisell-scroll-view-actions-indicator-size: 28px;
|
|
138
|
+
--pisell-scroll-view-actions-indicator-color: rgba(255, 255, 255, 0.3);
|
|
139
|
+
|
|
140
|
+
inset: 0;
|
|
141
|
+
pointer-events: none;
|
|
142
|
+
position: absolute;
|
|
143
|
+
z-index: 99;
|
|
144
|
+
|
|
145
|
+
&-item {
|
|
146
|
+
align-items: center;
|
|
147
|
+
cursor: pointer;
|
|
148
|
+
display: flex;
|
|
149
|
+
justify-content: center;
|
|
150
|
+
pointer-events: auto;
|
|
151
|
+
position: absolute;
|
|
152
|
+
transition: all 0.3s ease;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&-item-top,
|
|
156
|
+
&-item-bottom {
|
|
157
|
+
height: var(--pisell-scroll-view-actions-indicator-size);
|
|
158
|
+
left: 0;
|
|
159
|
+
right: 0;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&-item-top {
|
|
163
|
+
background: linear-gradient(
|
|
164
|
+
0deg,
|
|
165
|
+
rgba(255, 255, 255, 0) 0%,
|
|
166
|
+
rgba(255, 255, 255, 0.15) 31.76%,
|
|
167
|
+
var(--pisell-scroll-view-actions-indicator-color) 104.17%
|
|
168
|
+
);
|
|
169
|
+
backdrop-filter: blur(2px);
|
|
170
|
+
top: 0;
|
|
171
|
+
|
|
172
|
+
&:hover {
|
|
173
|
+
background: linear-gradient(
|
|
174
|
+
0deg,
|
|
175
|
+
rgba(255, 255, 255, 0.1) 0%,
|
|
176
|
+
rgba(255, 255, 255, 0.25) 31.76%,
|
|
177
|
+
rgba(255, 255, 255, 0.4) 104.17%
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
.pisell-scroll-view-actions-indicator-icon {
|
|
181
|
+
transform: translateY(-2px);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&-item-bottom {
|
|
187
|
+
background: linear-gradient(
|
|
188
|
+
180deg,
|
|
189
|
+
rgba(255, 255, 255, 0) 0%,
|
|
190
|
+
rgba(255, 255, 255, 0.15) 31.76%,
|
|
191
|
+
var(--pisell-scroll-view-actions-indicator-color) 104.17%
|
|
192
|
+
);
|
|
193
|
+
backdrop-filter: blur(2px);
|
|
194
|
+
bottom: 0;
|
|
195
|
+
|
|
196
|
+
&:hover {
|
|
197
|
+
background: linear-gradient(
|
|
198
|
+
180deg,
|
|
199
|
+
rgba(255, 255, 255, 0.1) 0%,
|
|
200
|
+
rgba(255, 255, 255, 0.25) 31.76%,
|
|
201
|
+
rgba(255, 255, 255, 0.4) 104.17%
|
|
202
|
+
);
|
|
203
|
+
|
|
204
|
+
.pisell-scroll-view-actions-indicator-icon {
|
|
205
|
+
transform: translateY(2px);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
&-item-left,
|
|
211
|
+
&-item-right {
|
|
212
|
+
bottom: 0;
|
|
213
|
+
top: 0;
|
|
214
|
+
width: var(--pisell-scroll-view-actions-indicator-size);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
&-item-left {
|
|
218
|
+
background: linear-gradient(
|
|
219
|
+
270deg,
|
|
220
|
+
rgba(255, 255, 255, 0) 0%,
|
|
221
|
+
rgba(255, 255, 255, 0.15) 31.76%,
|
|
222
|
+
var(--pisell-scroll-view-actions-indicator-color) 104.17%
|
|
223
|
+
);
|
|
224
|
+
backdrop-filter: blur(2px);
|
|
225
|
+
left: 0;
|
|
226
|
+
|
|
227
|
+
&:hover {
|
|
228
|
+
.pisell-scroll-view-actions-indicator-icon {
|
|
229
|
+
transform: translateX(-2px);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
&-item-right {
|
|
235
|
+
background: linear-gradient(
|
|
236
|
+
90deg,
|
|
237
|
+
rgba(255, 255, 255, 0) 0%,
|
|
238
|
+
rgba(255, 255, 255, 0.15) 31.76%,
|
|
239
|
+
var(--pisell-scroll-view-actions-indicator-color) 104.17%
|
|
240
|
+
);
|
|
241
|
+
backdrop-filter: blur(2px);
|
|
242
|
+
right: 0;
|
|
243
|
+
|
|
244
|
+
&:hover {
|
|
245
|
+
.pisell-scroll-view-actions-indicator-icon {
|
|
246
|
+
transform: translateX(2px);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
&-icon {
|
|
252
|
+
color: #fff;
|
|
253
|
+
font-size: 16px;
|
|
254
|
+
transition: all 0.3s ease;
|
|
255
|
+
}
|
|
134
256
|
}
|
|
@@ -423,7 +423,7 @@ export default () => (
|
|
|
423
423
|
| 参数 | 说明 | 类型 | 默认值 |
|
|
424
424
|
| -------------- | -------------------------------- | ---------------------------------------------------------------- | ----------- |
|
|
425
425
|
| show | 是否显示按钮 | `boolean` | `true` |
|
|
426
|
-
| type | 按钮类型 | `'backTop' \| 'rArrows' \| 'lrArrows' \| 'tbArrows' \| 'custom'` | `'rArrows'` |
|
|
426
|
+
| type | 按钮类型 | `'backTop' \| 'rArrows' \| 'lrArrows' \| 'tbArrows' \| 'indicator' \| 'custom'` | `'rArrows'` |
|
|
427
427
|
| style | 按钮自定义样式 | `CSSProperties` | - |
|
|
428
428
|
| scrollDistance | 每次滚动距离(像素) | `number` | `300` |
|
|
429
429
|
| config | 按钮配置(根据 type 不同而不同) | `any` | - |
|
|
@@ -42,7 +42,7 @@ interface ScrollPercentage {
|
|
|
42
42
|
interface ScrollActionsConfig {
|
|
43
43
|
show?: boolean;
|
|
44
44
|
/** 按钮类型 */
|
|
45
|
-
type: "backTop" | "rArrows" | "lrArrows" | "tbArrows" | "custom";
|
|
45
|
+
type: "backTop" | "rArrows" | "lrArrows" | "tbArrows" | "indicator" | "custom";
|
|
46
46
|
style?: CSSProperties;
|
|
47
47
|
scrollDistance?: number;
|
|
48
48
|
/** 按钮配置 根据type不同,配置不同 */
|
|
@@ -13,7 +13,10 @@ const _excluded = ["appHelper"];
|
|
|
13
13
|
*/
|
|
14
14
|
const getCountryDataList = function() {
|
|
15
15
|
var _ref = _asyncToGenerator(function* () {
|
|
16
|
-
const { data } = yield request.getRequest().get(`/country:list`, {
|
|
16
|
+
const { data } = yield request.getRequest().get(`/country:list`, {
|
|
17
|
+
page: 1,
|
|
18
|
+
pageSize: 999
|
|
19
|
+
}, {
|
|
17
20
|
isNocobase: true,
|
|
18
21
|
fullResult: true,
|
|
19
22
|
headers: { "x-data-source": "pisell2" }
|
|
@@ -154,6 +154,16 @@ const PisellScrollView = (0, react.forwardRef)((props, ref) => {
|
|
|
154
154
|
const handleButtonClick = (direction) => {
|
|
155
155
|
const container = containerRef.current;
|
|
156
156
|
if (!container) return;
|
|
157
|
+
if ((scrollActionsConfig === null || scrollActionsConfig === void 0 ? void 0 : scrollActionsConfig.type) === "indicator") {
|
|
158
|
+
const indicatorTargets = {
|
|
159
|
+
top: { top: 0 },
|
|
160
|
+
bottom: { top: container.scrollHeight },
|
|
161
|
+
left: { left: 0 },
|
|
162
|
+
right: { left: container.scrollWidth }
|
|
163
|
+
};
|
|
164
|
+
container.scrollTo(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, indicatorTargets[direction]), {}, { behavior: "smooth" }));
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
157
167
|
const distance = typeof (scrollActionsConfig === null || scrollActionsConfig === void 0 ? void 0 : scrollActionsConfig.scrollDistance) === "number" ? scrollActionsConfig.scrollDistance : 300;
|
|
158
168
|
let top = container.scrollTop;
|
|
159
169
|
let left = container.scrollLeft;
|
|
@@ -8,10 +8,65 @@ let classnames = require("classnames");
|
|
|
8
8
|
classnames = require_runtime.__toESM(classnames);
|
|
9
9
|
require("./index.less");
|
|
10
10
|
//#region src/components/PisellScrollView/components/Actions/index.tsx
|
|
11
|
+
/**
|
|
12
|
+
* 生成 indicator action 的 CSS 变量,允许通过 config 调整柔光尺寸与颜色。
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* const style = getIndicatorStyle({ size: 24, color: 'rgba(255,255,255,.35)' });
|
|
16
|
+
*/
|
|
17
|
+
const getIndicatorStyle = (config) => ({
|
|
18
|
+
"--pisell-scroll-view-actions-indicator-size": typeof (config === null || config === void 0 ? void 0 : config.size) === "number" ? `${config.size}px` : config === null || config === void 0 ? void 0 : config.size,
|
|
19
|
+
"--pisell-scroll-view-actions-indicator-color": config === null || config === void 0 ? void 0 : config.color
|
|
20
|
+
});
|
|
21
|
+
/**
|
|
22
|
+
* ActionsContainer 根据 scrollActionsConfig 渲染滚动辅助操作。
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* <ActionsContainer scrollActionsConfig={{ show: true, type: 'indicator' }} />
|
|
26
|
+
*/
|
|
11
27
|
const ActionsContainer = ({ containerRef, scrollState, overflow, scrollActionsConfig = { type: "backTop" }, onClick }) => {
|
|
12
28
|
if (overflow !== "x" && overflow !== "y") return null;
|
|
13
29
|
if (!scrollState.isOverflows) return null;
|
|
14
30
|
if (!(scrollActionsConfig === null || scrollActionsConfig === void 0 ? void 0 : scrollActionsConfig.show) || !scrollActionsConfig) return null;
|
|
31
|
+
if (scrollActionsConfig.type === "indicator") {
|
|
32
|
+
var _scrollActionsConfig$, _scrollActionsConfig$2, _scrollActionsConfig$3, _scrollActionsConfig$4, _scrollActionsConfig$5, _scrollActionsConfig$6;
|
|
33
|
+
const indicatorStyle = getIndicatorStyle(scrollActionsConfig.config);
|
|
34
|
+
const verticalProgress = Math.max(0, Math.min(1, scrollState.percentY / 100));
|
|
35
|
+
const horizontalProgress = Math.max(0, Math.min(1, scrollState.percentX / 100));
|
|
36
|
+
return /* @__PURE__ */ react.default.createElement("div", {
|
|
37
|
+
"aria-hidden": "true",
|
|
38
|
+
className: (0, classnames.default)("pisell-scroll-view-actions-indicator", (_scrollActionsConfig$ = scrollActionsConfig.config) === null || _scrollActionsConfig$ === void 0 ? void 0 : _scrollActionsConfig$.className),
|
|
39
|
+
style: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, indicatorStyle), scrollActionsConfig.style), (_scrollActionsConfig$2 = scrollActionsConfig.config) === null || _scrollActionsConfig$2 === void 0 ? void 0 : _scrollActionsConfig$2.style)
|
|
40
|
+
}, overflow === "y" && !scrollState.isScrollToTop && /* @__PURE__ */ react.default.createElement("div", {
|
|
41
|
+
className: "pisell-scroll-view-actions-indicator-item pisell-scroll-view-actions-indicator-item-top",
|
|
42
|
+
style: require_objectSpread2._objectSpread2({ opacity: Math.max(.6, verticalProgress) }, (_scrollActionsConfig$3 = scrollActionsConfig.config) === null || _scrollActionsConfig$3 === void 0 ? void 0 : _scrollActionsConfig$3.topStyle),
|
|
43
|
+
onClick: () => onClick("top")
|
|
44
|
+
}, /* @__PURE__ */ react.default.createElement(require_index.default, {
|
|
45
|
+
type: "pisell2-chevron-up",
|
|
46
|
+
className: "pisell-scroll-view-actions-indicator-icon"
|
|
47
|
+
})), overflow === "y" && !scrollState.isScrollToBottom && /* @__PURE__ */ react.default.createElement("div", {
|
|
48
|
+
className: "pisell-scroll-view-actions-indicator-item pisell-scroll-view-actions-indicator-item-bottom",
|
|
49
|
+
style: require_objectSpread2._objectSpread2({ opacity: Math.max(.6, 1 - verticalProgress * .4) }, (_scrollActionsConfig$4 = scrollActionsConfig.config) === null || _scrollActionsConfig$4 === void 0 ? void 0 : _scrollActionsConfig$4.bottomStyle),
|
|
50
|
+
onClick: () => onClick("bottom")
|
|
51
|
+
}, /* @__PURE__ */ react.default.createElement(require_index.default, {
|
|
52
|
+
type: "pisell2-chevron-down",
|
|
53
|
+
className: "pisell-scroll-view-actions-indicator-icon"
|
|
54
|
+
})), overflow === "x" && !scrollState.isScrollToLeft && /* @__PURE__ */ react.default.createElement("div", {
|
|
55
|
+
className: "pisell-scroll-view-actions-indicator-item pisell-scroll-view-actions-indicator-item-left",
|
|
56
|
+
style: require_objectSpread2._objectSpread2({ opacity: Math.max(.6, horizontalProgress) }, (_scrollActionsConfig$5 = scrollActionsConfig.config) === null || _scrollActionsConfig$5 === void 0 ? void 0 : _scrollActionsConfig$5.leftStyle),
|
|
57
|
+
onClick: () => onClick("left")
|
|
58
|
+
}, /* @__PURE__ */ react.default.createElement(require_index.default, {
|
|
59
|
+
type: "pisell2-chevron-left",
|
|
60
|
+
className: "pisell-scroll-view-actions-indicator-icon"
|
|
61
|
+
})), overflow === "x" && !scrollState.isScrollToRight && /* @__PURE__ */ react.default.createElement("div", {
|
|
62
|
+
className: "pisell-scroll-view-actions-indicator-item pisell-scroll-view-actions-indicator-item-right",
|
|
63
|
+
style: require_objectSpread2._objectSpread2({ opacity: Math.max(.6, 1 - horizontalProgress * .4) }, (_scrollActionsConfig$6 = scrollActionsConfig.config) === null || _scrollActionsConfig$6 === void 0 ? void 0 : _scrollActionsConfig$6.rightStyle),
|
|
64
|
+
onClick: () => onClick("right")
|
|
65
|
+
}, /* @__PURE__ */ react.default.createElement(require_index.default, {
|
|
66
|
+
type: "pisell2-chevron-right",
|
|
67
|
+
className: "pisell-scroll-view-actions-indicator-icon"
|
|
68
|
+
})));
|
|
69
|
+
}
|
|
15
70
|
if (overflow === "y" && scrollActionsConfig.type === "backTop") return /* @__PURE__ */ react.default.createElement(antd.FloatButton.BackTop, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({
|
|
16
71
|
target: () => containerRef.current || window,
|
|
17
72
|
visibilityHeight: 300,
|
|
@@ -131,4 +131,126 @@
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.pisell-scroll-view-actions-indicator {
|
|
137
|
+
--pisell-scroll-view-actions-indicator-size: 28px;
|
|
138
|
+
--pisell-scroll-view-actions-indicator-color: rgba(255, 255, 255, 0.3);
|
|
139
|
+
|
|
140
|
+
inset: 0;
|
|
141
|
+
pointer-events: none;
|
|
142
|
+
position: absolute;
|
|
143
|
+
z-index: 99;
|
|
144
|
+
|
|
145
|
+
&-item {
|
|
146
|
+
align-items: center;
|
|
147
|
+
cursor: pointer;
|
|
148
|
+
display: flex;
|
|
149
|
+
justify-content: center;
|
|
150
|
+
pointer-events: auto;
|
|
151
|
+
position: absolute;
|
|
152
|
+
transition: all 0.3s ease;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&-item-top,
|
|
156
|
+
&-item-bottom {
|
|
157
|
+
height: var(--pisell-scroll-view-actions-indicator-size);
|
|
158
|
+
left: 0;
|
|
159
|
+
right: 0;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&-item-top {
|
|
163
|
+
background: linear-gradient(
|
|
164
|
+
0deg,
|
|
165
|
+
rgba(255, 255, 255, 0) 0%,
|
|
166
|
+
rgba(255, 255, 255, 0.15) 31.76%,
|
|
167
|
+
var(--pisell-scroll-view-actions-indicator-color) 104.17%
|
|
168
|
+
);
|
|
169
|
+
backdrop-filter: blur(2px);
|
|
170
|
+
top: 0;
|
|
171
|
+
|
|
172
|
+
&:hover {
|
|
173
|
+
background: linear-gradient(
|
|
174
|
+
0deg,
|
|
175
|
+
rgba(255, 255, 255, 0.1) 0%,
|
|
176
|
+
rgba(255, 255, 255, 0.25) 31.76%,
|
|
177
|
+
rgba(255, 255, 255, 0.4) 104.17%
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
.pisell-scroll-view-actions-indicator-icon {
|
|
181
|
+
transform: translateY(-2px);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&-item-bottom {
|
|
187
|
+
background: linear-gradient(
|
|
188
|
+
180deg,
|
|
189
|
+
rgba(255, 255, 255, 0) 0%,
|
|
190
|
+
rgba(255, 255, 255, 0.15) 31.76%,
|
|
191
|
+
var(--pisell-scroll-view-actions-indicator-color) 104.17%
|
|
192
|
+
);
|
|
193
|
+
backdrop-filter: blur(2px);
|
|
194
|
+
bottom: 0;
|
|
195
|
+
|
|
196
|
+
&:hover {
|
|
197
|
+
background: linear-gradient(
|
|
198
|
+
180deg,
|
|
199
|
+
rgba(255, 255, 255, 0.1) 0%,
|
|
200
|
+
rgba(255, 255, 255, 0.25) 31.76%,
|
|
201
|
+
rgba(255, 255, 255, 0.4) 104.17%
|
|
202
|
+
);
|
|
203
|
+
|
|
204
|
+
.pisell-scroll-view-actions-indicator-icon {
|
|
205
|
+
transform: translateY(2px);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
&-item-left,
|
|
211
|
+
&-item-right {
|
|
212
|
+
bottom: 0;
|
|
213
|
+
top: 0;
|
|
214
|
+
width: var(--pisell-scroll-view-actions-indicator-size);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
&-item-left {
|
|
218
|
+
background: linear-gradient(
|
|
219
|
+
270deg,
|
|
220
|
+
rgba(255, 255, 255, 0) 0%,
|
|
221
|
+
rgba(255, 255, 255, 0.15) 31.76%,
|
|
222
|
+
var(--pisell-scroll-view-actions-indicator-color) 104.17%
|
|
223
|
+
);
|
|
224
|
+
backdrop-filter: blur(2px);
|
|
225
|
+
left: 0;
|
|
226
|
+
|
|
227
|
+
&:hover {
|
|
228
|
+
.pisell-scroll-view-actions-indicator-icon {
|
|
229
|
+
transform: translateX(-2px);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
&-item-right {
|
|
235
|
+
background: linear-gradient(
|
|
236
|
+
90deg,
|
|
237
|
+
rgba(255, 255, 255, 0) 0%,
|
|
238
|
+
rgba(255, 255, 255, 0.15) 31.76%,
|
|
239
|
+
var(--pisell-scroll-view-actions-indicator-color) 104.17%
|
|
240
|
+
);
|
|
241
|
+
backdrop-filter: blur(2px);
|
|
242
|
+
right: 0;
|
|
243
|
+
|
|
244
|
+
&:hover {
|
|
245
|
+
.pisell-scroll-view-actions-indicator-icon {
|
|
246
|
+
transform: translateX(2px);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
&-icon {
|
|
252
|
+
color: #fff;
|
|
253
|
+
font-size: 16px;
|
|
254
|
+
transition: all 0.3s ease;
|
|
255
|
+
}
|
|
134
256
|
}
|
|
@@ -423,7 +423,7 @@ export default () => (
|
|
|
423
423
|
| 参数 | 说明 | 类型 | 默认值 |
|
|
424
424
|
| -------------- | -------------------------------- | ---------------------------------------------------------------- | ----------- |
|
|
425
425
|
| show | 是否显示按钮 | `boolean` | `true` |
|
|
426
|
-
| type | 按钮类型 | `'backTop' \| 'rArrows' \| 'lrArrows' \| 'tbArrows' \| 'custom'` | `'rArrows'` |
|
|
426
|
+
| type | 按钮类型 | `'backTop' \| 'rArrows' \| 'lrArrows' \| 'tbArrows' \| 'indicator' \| 'custom'` | `'rArrows'` |
|
|
427
427
|
| style | 按钮自定义样式 | `CSSProperties` | - |
|
|
428
428
|
| scrollDistance | 每次滚动距离(像素) | `number` | `300` |
|
|
429
429
|
| config | 按钮配置(根据 type 不同而不同) | `any` | - |
|
|
@@ -42,7 +42,7 @@ interface ScrollPercentage {
|
|
|
42
42
|
interface ScrollActionsConfig {
|
|
43
43
|
show?: boolean;
|
|
44
44
|
/** 按钮类型 */
|
|
45
|
-
type: "backTop" | "rArrows" | "lrArrows" | "tbArrows" | "custom";
|
|
45
|
+
type: "backTop" | "rArrows" | "lrArrows" | "tbArrows" | "indicator" | "custom";
|
|
46
46
|
style?: CSSProperties;
|
|
47
47
|
scrollDistance?: number;
|
|
48
48
|
/** 按钮配置 根据type不同,配置不同 */
|
|
@@ -14,7 +14,10 @@ const _excluded = ["appHelper"];
|
|
|
14
14
|
*/
|
|
15
15
|
const getCountryDataList = function() {
|
|
16
16
|
var _ref = require_asyncToGenerator._asyncToGenerator(function* () {
|
|
17
|
-
const { data } = yield require_utils.request.getRequest().get(`/country:list`, {
|
|
17
|
+
const { data } = yield require_utils.request.getRequest().get(`/country:list`, {
|
|
18
|
+
page: 1,
|
|
19
|
+
pageSize: 999
|
|
20
|
+
}, {
|
|
18
21
|
isNocobase: true,
|
|
19
22
|
fullResult: true,
|
|
20
23
|
headers: { "x-data-source": "pisell2" }
|
|
@@ -171,6 +171,7 @@ const PisellScrollViewMeta: IPublicTypeComponentMetadata = {
|
|
|
171
171
|
{ title: '右箭头', value: 'rArrows' },
|
|
172
172
|
{ title: '左右箭头', value: 'lrArrows' },
|
|
173
173
|
{ title: '上下箭头', value: 'tbArrows' },
|
|
174
|
+
{ title: '首尾提示', value: 'indicator' },
|
|
174
175
|
{ title: '自定义', value: 'custom' },
|
|
175
176
|
],
|
|
176
177
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.51",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
"antd-mobile": "^5.38.1",
|
|
100
100
|
"vod-js-sdk-v6": "^1.4.11",
|
|
101
101
|
"@pisell/date-picker": "3.0.8",
|
|
102
|
-
"@pisell/
|
|
103
|
-
"@pisell/
|
|
102
|
+
"@pisell/icon": "0.0.11",
|
|
103
|
+
"@pisell/utils": "3.0.2"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
106
106
|
"react": "^18.0.0",
|