@dckj-npm/dc-material 0.1.147 → 0.1.149
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 +13 -13
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +13 -13
- package/build/lowcode/meta.design.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/bottom-navigation/bottom-navigation.d.ts +15 -0
- package/es/components/bottom-navigation/index.d.ts +3 -0
- package/es/components/button/button.d.ts +14 -0
- package/es/components/button/index.d.ts +6 -0
- package/es/components/carousel/carousel.d.ts +14 -0
- package/es/components/colorful-button/colorful-button.d.ts +12 -0
- package/es/components/colorful-button/index.d.ts +3 -0
- package/es/components/colorful-input/colorful-input.d.ts +8 -0
- package/es/components/colorful-input/index.d.ts +3 -0
- package/es/components/form/form-item.d.ts +42 -0
- package/es/components/form/form.d.ts +57 -0
- package/es/components/form/form.js +46 -0
- package/es/components/form/index.d.ts +6 -0
- package/es/components/form/index.js +6 -0
- package/es/components/form/index.scss +22 -0
- package/es/components/form/next-wrapper.d.ts +54 -0
- package/es/components/form/next-wrapper.js +43 -0
- package/es/components/goods-card-list/goods-card-list-common.d.ts +5 -0
- package/es/components/goods-card-list/goods-card-list-common.js +60 -0
- package/es/components/goods-card-list/goods-card-list-common.scss +118 -0
- package/es/components/goods-card-list/goods-card-list.d.ts +5 -0
- package/es/components/goods-card-list/goods-card-list.js +156 -0
- package/es/components/goods-card-list/goods-card-list.scss +112 -0
- package/es/components/goods-card-list/index.d.ts +4 -0
- package/es/components/goods-card-list/index.js +3 -0
- package/es/components/goods-card-list/types.d.ts +45 -0
- package/es/components/goods-card-list/types.js +1 -0
- package/es/components/grid-nav/grid-nav.d.ts +13 -0
- package/es/components/grid-nav/grid-nav.js +102 -0
- package/es/components/grid-nav/index.d.ts +3 -0
- package/es/components/grid-nav/index.js +2 -0
- package/es/components/grid-nav/index.scss +50 -0
- package/es/components/integral-task/index.d.ts +6 -0
- package/es/components/integral-task/index.js +5 -0
- package/es/components/integral-task/index.scss +35 -0
- package/es/components/integral-task/integral-task.d.ts +40 -0
- package/es/components/integral-task/integral-task.js +54 -0
- package/es/components/menu-list/index.d.ts +6 -0
- package/es/components/menu-list/index.js +6 -0
- package/es/components/menu-list/index.scss +16 -0
- package/es/components/menu-list/menu-list-item.d.ts +5 -0
- package/es/components/menu-list/menu-list-item.js +32 -0
- package/es/components/menu-list/menu-list-item.scss +49 -0
- package/es/components/menu-list/menu-list.d.ts +5 -0
- package/es/components/menu-list/menu-list.js +25 -0
- package/es/components/menu-list/types.d.ts +23 -0
- package/es/components/menu-list/types.js +1 -0
- package/es/components/message-list/index.d.ts +6 -0
- package/es/components/message-list/index.js +6 -0
- package/es/components/message-list/index.scss +22 -0
- package/es/components/message-list/message-list-item.d.ts +33 -0
- package/es/components/message-list/message-list-item.js +41 -0
- package/es/components/message-list/message-list-item.scss +60 -0
- package/es/components/message-list/message-list.d.ts +28 -0
- package/es/components/message-list/message-list.js +53 -0
- package/es/components/notice-bar/index.d.ts +3 -0
- package/es/components/notice-bar/index.js +2 -0
- package/es/components/notice-bar/index.scss +84 -0
- package/es/components/notice-bar/notice-bar-item.d.ts +18 -0
- package/es/components/notice-bar/notice-bar-item.js +30 -0
- package/es/components/notice-bar/notice-bar-item.scss +26 -0
- package/es/components/notice-bar/notice-bar.d.ts +46 -0
- package/es/components/notice-bar/notice-bar.js +57 -0
- package/es/components/position/entity.d.ts +5 -0
- package/es/components/position/entity.js +1 -0
- package/es/components/position/index.d.ts +3 -0
- package/es/components/position/index.js +2 -0
- package/es/components/position/index.scss +27 -0
- package/es/components/position/position-left.d.ts +9 -0
- package/es/components/position/position-left.js +28 -0
- package/es/components/position/position-list.d.ts +11 -0
- package/es/components/position/position-list.js +29 -0
- package/es/components/position/position.d.ts +8 -0
- package/es/components/position/position.js +48 -0
- package/es/components/radio-group/index.d.ts +8 -0
- package/es/components/radio-group/index.js +7 -0
- package/es/components/radio-group/index.scss +40 -0
- package/es/components/radio-group/radio-group-item.d.ts +48 -0
- package/es/components/radio-group/radio-group-item.js +74 -0
- package/es/components/radio-group/radio-group.d.ts +52 -0
- package/es/components/radio-group/radio-group.js +80 -0
- package/es/components/rich-text/index.d.ts +6 -0
- package/es/components/rich-text/index.js +6 -0
- package/es/components/rich-text/index.scss +19 -0
- package/es/components/rich-text/rich-text.d.ts +14 -0
- package/es/components/rich-text/rich-text.js +37 -0
- package/es/components/search-bar/index.d.ts +3 -0
- package/es/components/search-bar/index.js +2 -0
- package/es/components/search-bar/index.scss +39 -0
- package/es/components/search-bar/search-bar.d.ts +10 -0
- package/es/components/search-bar/search-bar.js +73 -0
- package/es/components/stream-list/index.d.ts +6 -0
- package/es/components/stream-list/index.js +6 -0
- package/es/components/stream-list/index.scss +26 -0
- package/es/components/stream-list/stream-list.d.ts +54 -0
- package/es/components/stream-list/stream-list.js +159 -0
- package/es/components/swiper/index.d.ts +3 -0
- package/es/components/swiper/index.js +2 -0
- package/es/components/swiper/index.scss +33 -0
- package/es/components/swiper/swiper.d.ts +26 -0
- package/es/components/swiper/swiper.js +77 -0
- package/es/components/tab/index.d.ts +6 -0
- package/es/components/tab/index.js +5 -0
- package/es/components/tab/index.scss +39 -0
- package/es/components/tab/tab.d.ts +27 -0
- package/es/components/tab/tab.js +50 -0
- package/es/components/tab-container/index.d.ts +3 -0
- package/es/components/tab-container/index.js +2 -0
- package/es/components/tab-container/index.scss +48 -0
- package/es/components/tab-container/tab-container.d.ts +10 -0
- package/es/components/tab-container/tab-container.js +26 -0
- package/es/components/tab-container-item/index.d.ts +3 -0
- package/es/components/tab-container-item/index.js +2 -0
- package/es/components/tab-container-item/index.scss +0 -0
- package/es/components/tab-container-item/tab-container-item.d.ts +11 -0
- package/es/components/tab-container-item/tab-container-item.js +19 -0
- package/es/components/tag/index.d.ts +6 -0
- package/es/components/tag/index.js +5 -0
- package/es/components/tag/index.scss +24 -0
- package/es/components/tag/tag.d.ts +14 -0
- package/es/components/tag/tag.js +14 -0
- package/es/components/teletext-list/index.d.ts +6 -0
- package/es/components/teletext-list/index.js +6 -0
- package/es/components/teletext-list/index.scss +40 -0
- package/es/components/teletext-list/teletext-list-item.d.ts +33 -0
- package/es/components/teletext-list/teletext-list-item.js +61 -0
- package/es/components/teletext-list/teletext-list-item.scss +57 -0
- package/es/components/teletext-list/teletext-list.d.ts +61 -0
- package/es/components/teletext-list/teletext-list.js +48 -0
- package/es/components/title/index.d.ts +8 -0
- package/es/components/title/index.js +7 -0
- package/es/components/title/title-1.d.ts +10 -0
- package/es/components/title/title-1.js +16 -0
- package/es/components/title/title-1.scss +25 -0
- package/es/components/title/title-2.d.ts +18 -0
- package/es/components/title/title-2.js +31 -0
- package/es/components/title/title-2.scss +22 -0
- package/es/entity/dynamic-column-data-type.d.ts +47 -0
- package/es/entity/dynamic-column-data-type.js +165 -0
- package/es/index.d.ts +46 -0
- package/es/index.js +86 -0
- package/es/index.scss +6 -0
- package/es/style.js +4 -0
- package/es/utils/children-node-handle.d.ts +9 -0
- package/es/utils/children-node-handle.js +25 -0
- package/es/utils/component-wrapper.d.ts +9 -0
- package/es/utils/component-wrapper.js +38 -0
- package/es/utils/debounce.d.ts +1 -0
- package/es/utils/debounce.js +14 -0
- package/es/utils/textUtil.d.ts +10 -0
- package/es/utils/textUtil.js +51 -0
- package/es/utils/time-util.d.ts +5 -0
- package/es/utils/time-util.js +18 -0
- package/es/variables.d.ts +2 -0
- package/es/variables.js +2 -0
- package/es/variables.scss +3 -0
- package/lib/assets/icon/grid-nav/right.png +0 -0
- package/lib/assets/icon/position/img.png +0 -0
- package/lib/assets/icon/position/location.png +0 -0
- package/lib/assets/icon/search/delete.png +0 -0
- package/lib/assets/icon/search/search.png +0 -0
- package/lib/assets/icon/teletext-list/arr.png +0 -0
- package/lib/components/bottom-navigation/bottom-navigation.d.ts +15 -0
- package/lib/components/bottom-navigation/index.d.ts +3 -0
- package/lib/components/button/button.d.ts +14 -0
- package/lib/components/button/index.d.ts +6 -0
- package/lib/components/carousel/carousel.d.ts +14 -0
- package/lib/components/colorful-button/colorful-button.d.ts +12 -0
- package/lib/components/colorful-button/index.d.ts +3 -0
- package/lib/components/colorful-input/colorful-input.d.ts +8 -0
- package/lib/components/colorful-input/index.d.ts +3 -0
- package/lib/components/form/form-item.d.ts +42 -0
- package/lib/components/form/form-item.js +86 -0
- package/lib/components/form/form-item.scss +20 -0
- package/lib/components/form/form.d.ts +57 -0
- package/lib/components/form/form.js +49 -0
- package/lib/components/form/index.d.ts +6 -0
- package/lib/components/form/index.js +6 -0
- package/lib/components/form/index.scss +22 -0
- package/lib/components/form/next-wrapper.d.ts +54 -0
- package/lib/components/form/next-wrapper.js +49 -0
- package/lib/components/goods-card-list/goods-card-list-common.d.ts +5 -0
- package/lib/components/goods-card-list/goods-card-list.d.ts +5 -0
- package/lib/components/goods-card-list/index.d.ts +4 -0
- package/lib/components/goods-card-list/types.d.ts +45 -0
- package/lib/components/grid-nav/grid-nav.d.ts +13 -0
- package/lib/components/grid-nav/grid-nav.js +15 -4
- package/lib/components/grid-nav/index.d.ts +3 -0
- package/lib/components/grid-nav/index.scss +27 -18
- package/lib/components/integral-task/index.d.ts +6 -0
- package/lib/components/integral-task/integral-task.d.ts +40 -0
- package/lib/components/menu-list/index.d.ts +6 -0
- package/lib/components/menu-list/menu-list-item.d.ts +5 -0
- package/lib/components/menu-list/menu-list.d.ts +5 -0
- package/lib/components/menu-list/types.d.ts +23 -0
- package/lib/components/message-list/index.d.ts +6 -0
- package/lib/components/message-list/message-list-item.d.ts +33 -0
- package/lib/components/message-list/message-list-item.scss +1 -1
- package/lib/components/message-list/message-list.d.ts +28 -0
- package/lib/components/notice-bar/index.d.ts +3 -0
- package/lib/components/notice-bar/index.scss +56 -14
- package/lib/components/notice-bar/notice-bar-item.d.ts +18 -0
- package/lib/components/notice-bar/notice-bar-item.js +6 -5
- package/lib/components/notice-bar/notice-bar-item.scss +1 -1
- package/lib/components/notice-bar/notice-bar.d.ts +46 -0
- package/lib/components/notice-bar/notice-bar.js +28 -56
- package/lib/components/position/entity.d.ts +5 -0
- package/lib/components/position/index.d.ts +3 -0
- package/lib/components/position/position-left.d.ts +9 -0
- package/lib/components/position/position-list.d.ts +11 -0
- package/lib/components/position/position-list.js +2 -3
- package/lib/components/position/position.d.ts +8 -0
- package/lib/components/radio-group/index.d.ts +8 -0
- package/lib/components/radio-group/radio-group-item.d.ts +48 -0
- package/lib/components/radio-group/radio-group.d.ts +52 -0
- package/lib/components/rich-text/index.d.ts +6 -0
- package/lib/components/rich-text/rich-text.d.ts +14 -0
- package/lib/components/search-bar/index.d.ts +3 -0
- package/lib/components/search-bar/index.scss +36 -10
- package/lib/components/search-bar/search-bar.d.ts +10 -0
- package/lib/components/search-bar/search-bar.js +67 -27
- package/lib/components/stream-list/index.d.ts +6 -0
- package/lib/components/stream-list/index.js +6 -0
- package/lib/components/stream-list/index.scss +26 -0
- package/lib/components/stream-list/stream-list.d.ts +54 -0
- package/lib/components/stream-list/stream-list.js +166 -0
- package/lib/components/swiper/index.d.ts +3 -0
- package/lib/components/swiper/index.scss +29 -8
- package/lib/components/swiper/swiper.d.ts +26 -0
- package/lib/components/swiper/swiper.js +60 -19
- package/lib/components/tab/index.d.ts +6 -0
- package/lib/components/tab/tab.d.ts +27 -0
- package/lib/components/tab-container/index.d.ts +3 -0
- package/lib/components/tab-container/tab-container.d.ts +10 -0
- package/lib/components/tab-container-item/index.d.ts +3 -0
- package/lib/components/tab-container-item/tab-container-item.d.ts +11 -0
- package/lib/components/tag/index.d.ts +6 -0
- package/lib/components/tag/tag.d.ts +14 -0
- package/lib/components/teletext-list/index.d.ts +6 -0
- package/lib/components/teletext-list/index.scss +21 -0
- package/lib/components/teletext-list/teletext-list-item.d.ts +33 -0
- package/lib/components/teletext-list/teletext-list-item.scss +4 -2
- package/lib/components/teletext-list/teletext-list.d.ts +61 -0
- package/lib/components/teletext-list/teletext-list.js +17 -7
- package/lib/components/title/index.d.ts +8 -0
- package/lib/components/title/title-1.d.ts +10 -0
- package/lib/components/title/title-2.d.ts +18 -0
- package/lib/entity/dynamic-column-data-type.d.ts +47 -0
- package/lib/entity/dynamic-column-data-type.js +169 -0
- package/lib/index.d.ts +46 -0
- package/lib/index.js +9 -1
- package/lib/style.js +1 -2
- package/lib/utils/children-node-handle.d.ts +9 -0
- package/lib/utils/component-wrapper.d.ts +9 -0
- package/lib/utils/debounce.d.ts +1 -0
- package/lib/utils/textUtil.d.ts +10 -0
- package/lib/utils/textUtil.js +55 -0
- package/lib/utils/time-util.d.ts +5 -0
- package/lib/variables.d.ts +2 -0
- package/lowcode/{d-c-form → form}/meta.ts +6 -6
- package/lowcode_es/{d-c-form → form}/meta.js +6 -6
- package/lowcode_es/meta.js +3 -3
- package/lowcode_lib/{d-c-form → form}/meta.js +6 -6
- package/lowcode_lib/meta.js +3 -3
- package/package.json +3 -3
- package/lib/components/notice-bar/components/ScrollSwitcher.js +0 -52
- package/lib/components/notice-bar/components/ScrollSwitcher.scss +0 -17
- /package/lowcode_es/{d-c-form → form}/meta.d.ts +0 -0
- /package/lowcode_lib/{d-c-form → form}/meta.d.ts +0 -0
|
@@ -3,38 +3,78 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports["default"] = void 0;
|
|
6
|
-
var
|
|
7
|
-
var
|
|
6
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
7
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var React = _react;
|
|
10
|
+
var _search = _interopRequireDefault(require("../../assets/icon/search/search.png"));
|
|
11
|
+
var _delete = _interopRequireDefault(require("../../assets/icon/search/delete.png"));
|
|
12
|
+
var _excluded = ["onSearch", "searchText", "autofocus", "placeholder", "onConfirm"];
|
|
10
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
11
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
var SearchBar = function SearchBar(props) {
|
|
16
|
+
var onSearch = props.onSearch,
|
|
17
|
+
_props$searchText = props.searchText,
|
|
18
|
+
searchText = _props$searchText === void 0 ? true : _props$searchText,
|
|
19
|
+
_props$autofocus = props.autofocus,
|
|
20
|
+
autofocus = _props$autofocus === void 0 ? false : _props$autofocus,
|
|
21
|
+
_props$placeholder = props.placeholder,
|
|
22
|
+
placeholder = _props$placeholder === void 0 ? '请输入' : _props$placeholder,
|
|
23
|
+
onConfirm = props.onConfirm,
|
|
24
|
+
otherProps = (0, _objectWithoutPropertiesLoose2["default"])(props, _excluded);
|
|
25
|
+
var _useState = (0, _react.useState)(),
|
|
26
|
+
searchValue = _useState[0],
|
|
27
|
+
setSearchValue = _useState[1];
|
|
28
|
+
var searchInput = (0, _react.useRef)(null);
|
|
29
|
+
var handleChange = function handleChange(e) {
|
|
30
|
+
setSearchValue(e.target.value); // 更新 state
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* 触发confirm事件
|
|
34
|
+
*/
|
|
35
|
+
var confirm = function confirm() {
|
|
36
|
+
var _searchInput$current;
|
|
37
|
+
if (onConfirm) {
|
|
38
|
+
onConfirm(searchValue);
|
|
20
39
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
onClick: function onClick() {
|
|
28
|
-
return onSearch();
|
|
29
|
-
}
|
|
30
|
-
}),
|
|
31
|
-
placeholder: defaultValue,
|
|
32
|
-
"aria-label": "input with config of innerBefore",
|
|
33
|
-
onFocus: function onFocus() {
|
|
34
|
-
return onSearch();
|
|
40
|
+
searchInput === null || searchInput === void 0 ? void 0 : (_searchInput$current = searchInput.current) === null || _searchInput$current === void 0 ? void 0 : _searchInput$current.blur();
|
|
41
|
+
};
|
|
42
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
43
|
+
if (e.key === "Enter") {
|
|
44
|
+
confirm();
|
|
35
45
|
}
|
|
36
|
-
}
|
|
46
|
+
};
|
|
47
|
+
var clearValue = function clearValue() {
|
|
48
|
+
setSearchValue('');
|
|
49
|
+
};
|
|
50
|
+
return /*#__PURE__*/React.createElement("form", (0, _extends2["default"])({
|
|
51
|
+
action: "",
|
|
52
|
+
className: "search-bar-form"
|
|
53
|
+
}, otherProps, {
|
|
54
|
+
onSubmit: confirm
|
|
55
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
className: "search-bar",
|
|
57
|
+
onClick: onSearch
|
|
58
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
59
|
+
className: "search-bar-icon"
|
|
60
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
61
|
+
src: _search["default"],
|
|
62
|
+
className: "search-bar-icon-img"
|
|
63
|
+
})), /*#__PURE__*/React.createElement("input", {
|
|
64
|
+
className: "search-bar-input",
|
|
65
|
+
placeholder: placeholder,
|
|
66
|
+
value: searchValue,
|
|
67
|
+
autoFocus: autofocus,
|
|
68
|
+
onChange: handleChange,
|
|
69
|
+
onKeyDown: handleKeyDown,
|
|
70
|
+
ref: searchInput
|
|
71
|
+
}), searchValue ? /*#__PURE__*/React.createElement("img", {
|
|
72
|
+
className: "search-bar-delete-img",
|
|
73
|
+
src: _delete["default"],
|
|
74
|
+
onClick: clearValue
|
|
75
|
+
}) : '', searchText ? /*#__PURE__*/React.createElement("span", {
|
|
76
|
+
className: "search-bar-enter",
|
|
77
|
+
onClick: confirm
|
|
78
|
+
}, "\u641C\u7D22") : ''));
|
|
37
79
|
};
|
|
38
|
-
var SearchBar = /*#__PURE__*/(0, _react.forwardRef)(ExampleComponent);
|
|
39
|
-
SearchBar.displayName = 'SearchBar';
|
|
40
80
|
var _default = exports["default"] = SearchBar;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@import '../../variables.scss';
|
|
2
|
+
|
|
3
|
+
.stream-list-container {
|
|
4
|
+
|
|
5
|
+
.refresh-indicator {
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
height: 40px;
|
|
10
|
+
font-size: 14px;
|
|
11
|
+
color: #333;
|
|
12
|
+
pointer-events: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// 加载更多提示的样式
|
|
16
|
+
.spin, .loading-text {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
height: 40px; // 提示高度
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
color: #666;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
}
|
|
26
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './index.scss';
|
|
4
|
+
export interface PageHelperType<T = any> {
|
|
5
|
+
page: number;
|
|
6
|
+
rows: number;
|
|
7
|
+
isLastPage: boolean;
|
|
8
|
+
total: number;
|
|
9
|
+
list: T[];
|
|
10
|
+
}
|
|
11
|
+
export interface StreamListProps {
|
|
12
|
+
/**
|
|
13
|
+
* 子组件内容
|
|
14
|
+
*/
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* 请求下一页数据的函数
|
|
18
|
+
* @param page
|
|
19
|
+
* @param rows
|
|
20
|
+
*/
|
|
21
|
+
onNextPage?: (options: {
|
|
22
|
+
page: number;
|
|
23
|
+
rows?: number;
|
|
24
|
+
}) => Promise<PageHelperType>;
|
|
25
|
+
/**
|
|
26
|
+
* 请求刷新数据的函数
|
|
27
|
+
*/
|
|
28
|
+
onRefreshPage?: () => Promise<PageHelperType>;
|
|
29
|
+
/**
|
|
30
|
+
* 是否是最后一页
|
|
31
|
+
*/
|
|
32
|
+
isLastPage?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* 当前页
|
|
35
|
+
*/
|
|
36
|
+
nowPage?: number;
|
|
37
|
+
/**
|
|
38
|
+
* 刷新中的文字提示
|
|
39
|
+
*/
|
|
40
|
+
refreshingText?: string;
|
|
41
|
+
/**
|
|
42
|
+
* 加载中的文字提示
|
|
43
|
+
*/
|
|
44
|
+
loadingText?: string;
|
|
45
|
+
/**
|
|
46
|
+
* 加载更多的文字提示
|
|
47
|
+
*/
|
|
48
|
+
loadMoreText?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* StreamList 组件
|
|
52
|
+
*/
|
|
53
|
+
declare const StreamList: React.FC<StreamListProps>;
|
|
54
|
+
export default StreamList;
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports["default"] = void 0;
|
|
6
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
7
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
require("./index.scss");
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
12
|
+
/**
|
|
13
|
+
* StreamList 组件
|
|
14
|
+
*/
|
|
15
|
+
var StreamList = function StreamList(_ref) {
|
|
16
|
+
var children = _ref.children,
|
|
17
|
+
onNextPage = _ref.onNextPage,
|
|
18
|
+
onRefreshPage = _ref.onRefreshPage,
|
|
19
|
+
_ref$refreshingText = _ref.refreshingText,
|
|
20
|
+
refreshingText = _ref$refreshingText === void 0 ? '正在刷新中...' : _ref$refreshingText,
|
|
21
|
+
_ref$loadingText = _ref.loadingText,
|
|
22
|
+
loadingText = _ref$loadingText === void 0 ? '加载中...' : _ref$loadingText,
|
|
23
|
+
_ref$loadMoreText = _ref.loadMoreText,
|
|
24
|
+
loadMoreText = _ref$loadMoreText === void 0 ? '加载更多' : _ref$loadMoreText,
|
|
25
|
+
_ref$isLastPage = _ref.isLastPage,
|
|
26
|
+
isLastPage = _ref$isLastPage === void 0 ? false : _ref$isLastPage,
|
|
27
|
+
_ref$nowPage = _ref.nowPage,
|
|
28
|
+
nowPage = _ref$nowPage === void 0 ? 1 : _ref$nowPage;
|
|
29
|
+
var _useState = (0, _react.useState)(false),
|
|
30
|
+
isLoading = _useState[0],
|
|
31
|
+
setIsLoading = _useState[1];
|
|
32
|
+
var _useState2 = (0, _react.useState)(false),
|
|
33
|
+
isRefreshing = _useState2[0],
|
|
34
|
+
setIsRefreshing = _useState2[1];
|
|
35
|
+
// 下拉刷新的阈值
|
|
36
|
+
var threshold = 50;
|
|
37
|
+
// 最大下拉距离
|
|
38
|
+
var maxPullDistance = 100;
|
|
39
|
+
var _useState3 = (0, _react.useState)(0),
|
|
40
|
+
pullDistance = _useState3[0],
|
|
41
|
+
setPullDistance = _useState3[1];
|
|
42
|
+
var startYRef = (0, _react.useRef)(0);
|
|
43
|
+
var _useState4 = (0, _react.useState)(false),
|
|
44
|
+
isDragging = _useState4[0],
|
|
45
|
+
setIsDragging = _useState4[1];
|
|
46
|
+
var observerRef = (0, _react.useRef)(null);
|
|
47
|
+
// 防止初始加载直接请求下一页
|
|
48
|
+
var hasInitialLoad = (0, _react.useRef)(false);
|
|
49
|
+
|
|
50
|
+
// 监听加载下一页数据
|
|
51
|
+
(0, _react.useEffect)(function () {
|
|
52
|
+
if (isRefreshing || isLastPage) {
|
|
53
|
+
// @ts-ignore
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
var spinElement = document.querySelector('.spin');
|
|
57
|
+
if (spinElement && !observerRef.current) {
|
|
58
|
+
// 创建 IntersectionObserver 观察器
|
|
59
|
+
observerRef.current = new IntersectionObserver(function (entries) {
|
|
60
|
+
var entry = entries[0];
|
|
61
|
+
if (entry.isIntersecting && !isLoading) {
|
|
62
|
+
setIsLoading(true);
|
|
63
|
+
var nextPage = nowPage + 1;
|
|
64
|
+
onNextPage({
|
|
65
|
+
page: nextPage
|
|
66
|
+
}).then(function (res) {})["catch"](function (err) {
|
|
67
|
+
console.error('加载下一页失败:', err);
|
|
68
|
+
})["finally"](function () {
|
|
69
|
+
return setIsLoading(false);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
threshold: 0.4
|
|
74
|
+
});
|
|
75
|
+
// 观察加载更多元素
|
|
76
|
+
observerRef.current.observe(spinElement);
|
|
77
|
+
}
|
|
78
|
+
return function () {
|
|
79
|
+
if (observerRef.current) {
|
|
80
|
+
// 清除观察者
|
|
81
|
+
observerRef.current.disconnect();
|
|
82
|
+
observerRef.current = null;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}, [nowPage, isLoading, isRefreshing, isLastPage]);
|
|
86
|
+
|
|
87
|
+
// 初始化加载标记
|
|
88
|
+
(0, _react.useEffect)(function () {
|
|
89
|
+
hasInitialLoad.current = true;
|
|
90
|
+
}, []);
|
|
91
|
+
|
|
92
|
+
// 处理触摸和鼠标事件
|
|
93
|
+
var handleTouchStart = function handleTouchStart(e) {
|
|
94
|
+
startYRef.current = 'touches' in e ? e.touches[0].clientY : e.clientY;
|
|
95
|
+
setIsDragging(true);
|
|
96
|
+
};
|
|
97
|
+
var handleTouchMove = function handleTouchMove(e) {
|
|
98
|
+
if (isRefreshing || !isDragging && !('touches' in e)) return;
|
|
99
|
+
var clientY = 'touches' in e ? e.touches[0].clientY : e.clientY;
|
|
100
|
+
var distance = clientY - startYRef.current;
|
|
101
|
+
|
|
102
|
+
// 更新下拉距离
|
|
103
|
+
if (distance > 0 && distance <= maxPullDistance) {
|
|
104
|
+
setPullDistance(distance);
|
|
105
|
+
} else if (distance > maxPullDistance) {
|
|
106
|
+
setPullDistance(maxPullDistance);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
var handleTouchEnd = /*#__PURE__*/function () {
|
|
110
|
+
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
111
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
112
|
+
while (1) switch (_context.prev = _context.next) {
|
|
113
|
+
case 0:
|
|
114
|
+
setIsDragging(false);
|
|
115
|
+
if (pullDistance > threshold) {
|
|
116
|
+
setIsRefreshing(true);
|
|
117
|
+
setPullDistance(0);
|
|
118
|
+
onRefreshPage().then(function (res) {})["catch"](function (err) {
|
|
119
|
+
console.error('刷新失败:', err);
|
|
120
|
+
})["finally"](function () {
|
|
121
|
+
setIsRefreshing(false);
|
|
122
|
+
});
|
|
123
|
+
} else {
|
|
124
|
+
setPullDistance(0); // 重置下拉距离
|
|
125
|
+
}
|
|
126
|
+
case 2:
|
|
127
|
+
case "end":
|
|
128
|
+
return _context.stop();
|
|
129
|
+
}
|
|
130
|
+
}, _callee);
|
|
131
|
+
}));
|
|
132
|
+
return function handleTouchEnd() {
|
|
133
|
+
return _ref2.apply(this, arguments);
|
|
134
|
+
};
|
|
135
|
+
}();
|
|
136
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
137
|
+
onTouchStart: handleTouchStart,
|
|
138
|
+
onTouchMove: handleTouchMove,
|
|
139
|
+
onTouchEnd: handleTouchEnd,
|
|
140
|
+
onMouseDown: handleTouchStart,
|
|
141
|
+
onMouseMove: handleTouchMove,
|
|
142
|
+
onMouseUp: handleTouchEnd,
|
|
143
|
+
className: "stream-list-container"
|
|
144
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
145
|
+
className: "refresh-indicator",
|
|
146
|
+
style: {
|
|
147
|
+
position: 'fixed',
|
|
148
|
+
top: 0,
|
|
149
|
+
left: 0,
|
|
150
|
+
right: 0,
|
|
151
|
+
transform: "translateY(" + (isRefreshing ? threshold : pullDistance) + "px)",
|
|
152
|
+
transition: isRefreshing || pullDistance === 0 ? 'transform 0.3s ease' : 'none'
|
|
153
|
+
}
|
|
154
|
+
}, isRefreshing && /*#__PURE__*/_react["default"].createElement("span", null, refreshingText)), /*#__PURE__*/_react["default"].createElement("div", {
|
|
155
|
+
style: {
|
|
156
|
+
transform: "translateY(" + (isRefreshing ? threshold : pullDistance) + "px)",
|
|
157
|
+
transition: 'transform 0.3s ease'
|
|
158
|
+
}
|
|
159
|
+
}, children), !isRefreshing && !isLastPage && (isLoading ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
160
|
+
className: "loading-text"
|
|
161
|
+
}, loadingText) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
162
|
+
className: "spin"
|
|
163
|
+
}, loadMoreText)));
|
|
164
|
+
};
|
|
165
|
+
StreamList.displayName = 'StreamList';
|
|
166
|
+
var _default = exports["default"] = StreamList;
|
|
@@ -1,12 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
.carousel {
|
|
2
|
+
position: relative;
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
width: 100%;
|
|
3
5
|
margin: 0;
|
|
4
|
-
&__sliede {
|
|
5
|
-
position: relative;
|
|
6
|
-
height: 100%;
|
|
7
|
-
}
|
|
8
6
|
}
|
|
9
|
-
.
|
|
7
|
+
.carousel__wrapper {
|
|
8
|
+
display: flex;
|
|
9
|
+
}
|
|
10
|
+
.carousel__slide {
|
|
11
|
+
min-width: 100%;
|
|
12
|
+
transition: transform ease-in-out;
|
|
13
|
+
}
|
|
14
|
+
.carousel__slide img {
|
|
10
15
|
width: 100%;
|
|
11
|
-
height:
|
|
16
|
+
height: auto;
|
|
17
|
+
}
|
|
18
|
+
.carousel__button {
|
|
19
|
+
position: absolute;
|
|
20
|
+
top: 50%;
|
|
21
|
+
transform: translateY(-50%);
|
|
22
|
+
background: rgba(0, 0, 0, 0.5);
|
|
23
|
+
color: white;
|
|
24
|
+
border: none;
|
|
25
|
+
padding: 10px;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
}
|
|
28
|
+
.carousel__button--prev {
|
|
29
|
+
left: 10px;
|
|
30
|
+
}
|
|
31
|
+
.carousel__button--next {
|
|
32
|
+
right: 10px;
|
|
12
33
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
export interface ComponentProps {
|
|
4
|
+
/**
|
|
5
|
+
* 切换速度,单位ms
|
|
6
|
+
*/
|
|
7
|
+
speed?: number;
|
|
8
|
+
/**
|
|
9
|
+
* 高度
|
|
10
|
+
*/
|
|
11
|
+
height: number;
|
|
12
|
+
/**
|
|
13
|
+
* 自动播放
|
|
14
|
+
*/
|
|
15
|
+
autoplay: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* 循环播放
|
|
18
|
+
*/
|
|
19
|
+
loop: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* 图片路径
|
|
22
|
+
*/
|
|
23
|
+
picUrls: string[];
|
|
24
|
+
}
|
|
25
|
+
declare const DCSlider: React.FC<ComponentProps>;
|
|
26
|
+
export default DCSlider;
|
|
@@ -4,40 +4,81 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports["default"] = void 0;
|
|
6
6
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var _core = _interopRequireWildcard(require("swiper/core"));
|
|
7
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var React = _react;
|
|
11
10
|
require("./index.scss");
|
|
12
|
-
|
|
11
|
+
var _excluded = ["speed", "autoplay", "loop", "picUrls", "height"];
|
|
13
12
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
13
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
var DCSlider = function DCSlider(_ref) {
|
|
15
|
+
var _ref$speed = _ref.speed,
|
|
16
|
+
speed = _ref$speed === void 0 ? 500 : _ref$speed,
|
|
17
|
+
autoplay = _ref.autoplay,
|
|
18
|
+
loop = _ref.loop,
|
|
19
|
+
_ref$picUrls = _ref.picUrls,
|
|
20
|
+
picUrls = _ref$picUrls === void 0 ? [] : _ref$picUrls,
|
|
21
|
+
height = _ref.height,
|
|
22
|
+
otherProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
23
|
+
var _useState = (0, _react.useState)(0),
|
|
24
|
+
currentIndex = _useState[0],
|
|
25
|
+
setCurrentIndex = _useState[1];
|
|
26
|
+
var autoplayRef = (0, _react.useRef)(null);
|
|
27
|
+
var nextSlide = function nextSlide() {
|
|
28
|
+
if (currentIndex < picUrls.length - 1) {
|
|
29
|
+
setCurrentIndex(currentIndex + 1);
|
|
30
|
+
} else if (loop) {
|
|
31
|
+
setCurrentIndex(0);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var startAutoplay = function startAutoplay() {
|
|
35
|
+
if (autoplay && !autoplayRef.current) {
|
|
36
|
+
autoplayRef.current = setInterval(nextSlide, speed);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var stopAutoplay = function stopAutoplay() {
|
|
40
|
+
if (autoplayRef.current) {
|
|
41
|
+
clearInterval(autoplayRef.current);
|
|
42
|
+
autoplayRef.current = null;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
(0, _react.useEffect)(function () {
|
|
46
|
+
if (autoplay) {
|
|
47
|
+
startAutoplay();
|
|
48
|
+
}
|
|
49
|
+
return function () {
|
|
50
|
+
stopAutoplay();
|
|
51
|
+
};
|
|
52
|
+
}, [autoplay, speed, loop, picUrls]);
|
|
53
|
+
return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
|
|
54
|
+
className: "carousel",
|
|
55
|
+
onMouseEnter: stopAutoplay,
|
|
56
|
+
onMouseLeave: startAutoplay,
|
|
22
57
|
style: {
|
|
23
58
|
height: height ? height + "px" : '100%'
|
|
24
59
|
}
|
|
25
|
-
}),
|
|
26
|
-
|
|
27
|
-
|
|
60
|
+
}, otherProps), /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: "carousel__wrapper",
|
|
62
|
+
style: {
|
|
63
|
+
transform: "translateX(-" + currentIndex * 100 + "%)",
|
|
64
|
+
transitionDuration: speed + "ms"
|
|
65
|
+
}
|
|
66
|
+
}, picUrls.map(function (url, index) {
|
|
67
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
68
|
+
key: index,
|
|
69
|
+
className: "carousel__slide",
|
|
28
70
|
style: {
|
|
29
71
|
width: '100%',
|
|
30
72
|
height: height ? height + "px" : '100%'
|
|
31
73
|
}
|
|
32
|
-
}, /*#__PURE__*/React.createElement(
|
|
74
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
33
75
|
src: url,
|
|
34
|
-
alt: "Slide",
|
|
35
|
-
key: index,
|
|
76
|
+
alt: "Slide " + index,
|
|
36
77
|
style: {
|
|
37
78
|
width: '100%',
|
|
38
79
|
height: height ? height + "px" : '100%'
|
|
39
80
|
}
|
|
40
81
|
}));
|
|
41
|
-
})
|
|
82
|
+
})));
|
|
42
83
|
};
|
|
43
84
|
var _default = exports["default"] = DCSlider;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
export interface TabProps {
|
|
4
|
+
/**
|
|
5
|
+
* 选中背景颜色
|
|
6
|
+
*/
|
|
7
|
+
selectedBGColor: string;
|
|
8
|
+
/**
|
|
9
|
+
* 选中字体颜色
|
|
10
|
+
*/
|
|
11
|
+
selectedFontColor: string;
|
|
12
|
+
/**
|
|
13
|
+
* 尺寸 small | large
|
|
14
|
+
*/
|
|
15
|
+
size: string;
|
|
16
|
+
/**
|
|
17
|
+
* 点击事件
|
|
18
|
+
* @param e
|
|
19
|
+
*/
|
|
20
|
+
onClickHandle?: (e: string) => void;
|
|
21
|
+
/**
|
|
22
|
+
* 未读消息数量
|
|
23
|
+
*/
|
|
24
|
+
unreadCount?: number;
|
|
25
|
+
}
|
|
26
|
+
declare const Tab: React.FC<TabProps>;
|
|
27
|
+
export default Tab;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tab } from '@alifd/next';
|
|
3
|
+
import './index.scss';
|
|
4
|
+
export interface TabContainerProps extends React.ComponentProps<typeof Tab> {
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const TabContainer: {
|
|
8
|
+
(props: TabContainerProps): JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tab } from '@alifd/next';
|
|
3
|
+
export interface TabContainerItemProps extends React.ComponentProps<typeof Tab> {
|
|
4
|
+
className?: string;
|
|
5
|
+
tab: string;
|
|
6
|
+
key: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const TabContainerItem: {
|
|
9
|
+
(props: TabContainerItemProps): JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|