@dckj-npm/dc-material 0.1.28 → 0.1.30
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/docs/404.html +47 -0
- package/build/docs/_demos/:uuid +47 -0
- package/build/docs/colorful-button.html +4 -4
- package/build/docs/colorful-input.html +4 -4
- package/build/docs/index.html +4 -4
- package/build/docs/umi.19a78b0f.js +1 -0
- package/build/docs/{umi.1db9e2cc.css → umi.5357b0f6.css} +1 -1
- package/build/docs/~demos/:uuid.html +47 -0
- package/build/docs/~demos/colorful-button-demo.html +4 -4
- package/build/docs/~demos/colorful-input-demo.html +4 -4
- package/build/index.js +12 -19
- 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/index.js +1 -1
- package/build/lowcode/meta.design.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +10 -10
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +10 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +10 -10
- package/dist/BizComps.css +1 -1
- package/dist/BizComps.js +4 -4
- package/dist/BizComps.js.map +1 -1
- package/es/assets/icon/position/arror.png +0 -0
- package/es/components/bottom-navigation/bottom-navigation.d.ts +15 -15
- package/es/components/bottom-navigation/index.d.ts +3 -3
- package/es/components/bottom-navigation/index.scss +23 -23
- package/es/components/button/button.d.ts +14 -14
- package/es/components/button/index.d.ts +6 -6
- package/es/components/button/index.js +2 -2
- package/es/components/carousel/carousel.d.ts +14 -0
- package/es/components/carousel/carousel.js +75 -0
- package/es/components/carousel/carousel.scss +32 -0
- package/es/components/colorful-button/colorful-button.d.ts +12 -12
- package/es/components/colorful-button/index.d.ts +3 -3
- package/es/components/colorful-input/colorful-input.d.ts +8 -8
- package/es/components/colorful-input/index.d.ts +3 -3
- package/es/components/goods-card-list/goods-card-list.d.ts +5 -0
- package/es/components/goods-card-list/goods-card-list.js +139 -0
- package/es/components/goods-card-list/goods-card-list.scss +93 -0
- package/es/components/goods-card-list/index.d.ts +3 -0
- package/es/components/goods-card-list/index.js +2 -0
- package/es/components/goods-card-list/types.d.ts +41 -0
- package/es/components/goods-card-list/types.js +1 -0
- package/es/components/grid-nav/grid-nav.d.ts +13 -13
- package/es/components/grid-nav/index.d.ts +3 -3
- package/es/components/grid-nav/index.scss +37 -37
- package/es/components/integral-task/index.d.ts +6 -6
- package/es/components/integral-task/index.js +2 -2
- package/es/components/integral-task/integral-task.d.ts +40 -40
- package/es/components/menu-list/index.d.ts +6 -6
- package/es/components/menu-list/index.js +2 -2
- package/es/components/menu-list/index.scss +16 -16
- package/es/components/menu-list/menu-list-item.d.ts +5 -5
- package/es/components/menu-list/menu-list-item.scss +49 -49
- package/es/components/menu-list/menu-list.d.ts +5 -5
- package/es/components/menu-list/types.d.ts +23 -23
- package/es/components/message-list/index.d.ts +6 -6
- package/es/components/message-list/index.js +2 -2
- package/es/components/message-list/index.scss +22 -22
- package/es/components/message-list/message-list-item.d.ts +29 -29
- package/es/components/message-list/message-list-item.js +2 -2
- package/es/components/message-list/message-list-item.scss +49 -49
- package/es/components/message-list/message-list.d.ts +32 -32
- package/es/components/notice-bar/index.d.ts +3 -3
- package/es/components/notice-bar/index.scss +26 -26
- package/es/components/notice-bar/notice-bar-item.d.ts +31 -31
- package/es/components/notice-bar/notice-bar-item.scss +26 -26
- package/es/components/notice-bar/notice-bar.d.ts +50 -50
- package/es/components/position/entity.d.ts +5 -5
- package/es/components/position/index.d.ts +3 -3
- package/es/components/position/index.scss +27 -23
- package/es/components/position/position-left.d.ts +9 -9
- package/es/components/position/position-list.d.ts +12 -12
- package/es/components/position/position.d.ts +8 -8
- package/es/components/radio-group/index.d.ts +8 -8
- package/es/components/radio-group/index.js +2 -2
- package/es/components/radio-group/index.scss +40 -40
- package/es/components/radio-group/radio-group-item.d.ts +48 -48
- package/es/components/radio-group/radio-group.d.ts +52 -52
- package/es/components/search-bar/index.d.ts +3 -3
- package/es/components/search-bar/index.scss +13 -13
- package/es/components/search-bar/search-bar.d.ts +7 -7
- package/es/components/swiper/index.d.ts +3 -3
- package/es/components/swiper/swiper.d.ts +47 -47
- package/es/components/tab/index.d.ts +6 -6
- package/es/components/tab/index.js +2 -2
- package/es/components/tab/index.scss +22 -22
- package/es/components/tab/tab.d.ts +23 -23
- package/es/components/tab-container/index.d.ts +3 -3
- package/es/components/tab-container/index.scss +47 -47
- package/es/components/tab-container/tab-container.d.ts +10 -10
- package/es/components/tab-container-item/index.d.ts +3 -3
- package/es/components/tab-container-item/tab-container-item.d.ts +9 -9
- package/es/components/tag/index.d.ts +6 -6
- package/es/components/tag/index.js +2 -2
- package/es/components/tag/tag.d.ts +14 -14
- package/es/components/teletext-list/index.d.ts +6 -6
- package/es/components/teletext-list/index.js +2 -2
- package/es/components/teletext-list/index.scss +19 -19
- package/es/components/teletext-list/teletext-list-item.d.ts +42 -42
- package/es/components/teletext-list/teletext-list-item.js +10 -7
- package/es/components/teletext-list/teletext-list-item.scss +55 -55
- package/es/components/teletext-list/teletext-list.d.ts +61 -61
- package/es/components/teletext-list/teletext-list.js +2 -2
- package/es/components/title/index.d.ts +8 -8
- package/es/components/title/index.js +2 -2
- package/es/components/title/title-1.d.ts +10 -10
- package/es/components/title/title-1.scss +25 -25
- package/es/components/title/title-2.d.ts +18 -18
- package/es/components/title/title-2.scss +22 -22
- package/es/index.d.ts +40 -38
- package/es/index.js +4 -0
- package/es/index.scss +5 -5
- package/es/utils/children-node-handle.d.ts +9 -9
- package/es/utils/children-node-handle.js +0 -2
- package/es/utils/component-wrapper.d.ts +9 -9
- package/es/utils/debounce.d.ts +1 -0
- package/es/utils/debounce.js +14 -0
- package/es/variables.d.ts +2 -2
- package/lib/assets/icon/position/arror.png +0 -0
- package/lib/components/bottom-navigation/bottom-navigation.d.ts +15 -15
- package/lib/components/bottom-navigation/index.d.ts +3 -3
- package/lib/components/bottom-navigation/index.scss +23 -23
- package/lib/components/button/button.d.ts +14 -14
- package/lib/components/button/index.d.ts +6 -6
- package/lib/components/button/index.js +2 -2
- package/lib/components/carousel/carousel.d.ts +14 -0
- package/lib/components/carousel/carousel.js +81 -0
- package/lib/components/carousel/carousel.scss +32 -0
- package/lib/components/colorful-button/colorful-button.d.ts +12 -12
- package/lib/components/colorful-button/index.d.ts +3 -3
- package/lib/components/colorful-input/colorful-input.d.ts +8 -8
- package/lib/components/colorful-input/index.d.ts +3 -3
- package/lib/components/goods-card-list/goods-card-list.d.ts +5 -0
- package/lib/components/goods-card-list/goods-card-list.js +146 -0
- package/lib/components/goods-card-list/goods-card-list.scss +93 -0
- package/lib/components/goods-card-list/index.d.ts +3 -0
- package/lib/components/goods-card-list/index.js +6 -0
- package/lib/components/goods-card-list/types.d.ts +41 -0
- package/lib/components/goods-card-list/types.js +3 -0
- package/lib/components/grid-nav/grid-nav.d.ts +13 -13
- package/lib/components/grid-nav/index.d.ts +3 -3
- package/lib/components/grid-nav/index.scss +37 -37
- package/lib/components/integral-task/index.d.ts +6 -6
- package/lib/components/integral-task/index.js +2 -2
- package/lib/components/integral-task/integral-task.d.ts +40 -40
- package/lib/components/menu-list/index.d.ts +6 -6
- package/lib/components/menu-list/index.js +2 -2
- package/lib/components/menu-list/index.scss +16 -16
- package/lib/components/menu-list/menu-list-item.d.ts +5 -5
- package/lib/components/menu-list/menu-list-item.scss +49 -49
- package/lib/components/menu-list/menu-list.d.ts +5 -5
- package/lib/components/menu-list/types.d.ts +23 -23
- package/lib/components/message-list/index.d.ts +6 -6
- package/lib/components/message-list/index.js +2 -2
- package/lib/components/message-list/index.scss +22 -22
- package/lib/components/message-list/message-list-item.d.ts +29 -29
- package/lib/components/message-list/message-list-item.js +2 -2
- package/lib/components/message-list/message-list-item.scss +49 -49
- package/lib/components/message-list/message-list.d.ts +32 -32
- package/lib/components/notice-bar/index.d.ts +3 -3
- package/lib/components/notice-bar/index.scss +26 -26
- package/lib/components/notice-bar/notice-bar-item.d.ts +31 -31
- package/lib/components/notice-bar/notice-bar-item.scss +26 -26
- package/lib/components/notice-bar/notice-bar.d.ts +50 -50
- package/lib/components/position/entity.d.ts +5 -5
- package/lib/components/position/index.d.ts +3 -3
- package/lib/components/position/index.scss +27 -23
- package/lib/components/position/position-left.d.ts +9 -9
- package/lib/components/position/position-list.d.ts +12 -12
- package/lib/components/position/position.d.ts +8 -8
- package/lib/components/radio-group/index.d.ts +8 -8
- package/lib/components/radio-group/index.scss +40 -40
- package/lib/components/radio-group/radio-group-item.d.ts +48 -48
- package/lib/components/radio-group/radio-group.d.ts +52 -52
- package/lib/components/search-bar/index.d.ts +3 -3
- package/lib/components/search-bar/index.scss +13 -13
- package/lib/components/search-bar/search-bar.d.ts +7 -7
- package/lib/components/swiper/index.d.ts +3 -3
- package/lib/components/swiper/swiper.d.ts +47 -47
- package/lib/components/tab/index.d.ts +6 -6
- package/lib/components/tab/index.js +2 -2
- package/lib/components/tab/index.scss +22 -22
- package/lib/components/tab/tab.d.ts +23 -23
- package/lib/components/tab-container/index.d.ts +3 -3
- package/lib/components/tab-container/index.scss +47 -47
- package/lib/components/tab-container/tab-container.d.ts +10 -10
- package/lib/components/tab-container-item/index.d.ts +3 -3
- package/lib/components/tab-container-item/tab-container-item.d.ts +9 -9
- package/lib/components/tag/index.d.ts +6 -6
- package/lib/components/tag/index.js +2 -2
- package/lib/components/tag/tag.d.ts +14 -14
- package/lib/components/teletext-list/index.d.ts +6 -6
- package/lib/components/teletext-list/index.scss +19 -19
- package/lib/components/teletext-list/teletext-list-item.d.ts +42 -42
- package/lib/components/teletext-list/teletext-list-item.js +10 -7
- package/lib/components/teletext-list/teletext-list-item.scss +55 -55
- package/lib/components/teletext-list/teletext-list.d.ts +61 -61
- package/lib/components/teletext-list/teletext-list.js +2 -2
- package/lib/components/title/index.d.ts +8 -8
- package/lib/components/title/title-1.d.ts +10 -10
- package/lib/components/title/title-1.scss +25 -25
- package/lib/components/title/title-2.d.ts +18 -18
- package/lib/components/title/title-2.scss +22 -22
- package/lib/index.d.ts +40 -38
- package/lib/index.js +5 -1
- package/lib/index.scss +5 -5
- package/lib/utils/children-node-handle.d.ts +9 -9
- package/lib/utils/children-node-handle.js +0 -2
- package/lib/utils/component-wrapper.d.ts +9 -9
- package/lib/utils/debounce.d.ts +1 -0
- package/lib/utils/debounce.js +18 -0
- package/lib/variables.d.ts +2 -2
- package/lowcode/custom-radio-group/meta.ts +293 -293
- package/lowcode/custom-radio-group-item/meta.ts +229 -229
- package/lowcode/d-c-slider/meta.design.ts +173 -173
- package/lowcode/d-c-slider/meta.ts +342 -342
- package/lowcode/d-c-slider/snippets.ts +68 -68
- package/lowcode/goods-card-list/meta.ts +262 -0
- package/lowcode/grid-nav/meta.ts +212 -212
- package/lowcode/menu-list/meta.ts +147 -147
- package/lowcode/message-list/meta.ts +205 -205
- package/lowcode/navigation/meta.ts +173 -173
- package/lowcode/notice-bar/meta.ts +291 -291
- package/lowcode/search-bar/meta.ts +54 -54
- package/lowcode/tab-container/meta.ts +69 -69
- package/lowcode/tab-container/props.ts +194 -194
- package/lowcode/tab-container-item/meta.ts +195 -195
- package/lowcode/tag-c/meta.ts +75 -75
- package/lowcode/teletext-list/meta.ts +329 -329
- package/lowcode/title1/meta.ts +59 -59
- package/lowcode/title2/meta.ts +93 -93
- package/lowcode_es/button2/meta.d.ts +22 -22
- package/lowcode_es/custom-radio-group/meta.d.ts +22 -22
- package/lowcode_es/custom-radio-group-item/meta.d.ts +23 -23
- package/lowcode_es/d-c-slider/meta.d.ts +148 -148
- package/lowcode_es/d-c-slider/meta.design.d.ts +100 -100
- package/lowcode_es/d-c-slider/snippets.d.ts +36 -36
- package/lowcode_es/goods-card-list/meta.d.ts +22 -0
- package/lowcode_es/goods-card-list/meta.js +245 -0
- package/lowcode_es/grid-nav/meta.d.ts +22 -22
- package/lowcode_es/integral-task/meta.d.ts +22 -22
- package/lowcode_es/menu-list/meta.d.ts +22 -22
- package/lowcode_es/message-list/meta.d.ts +22 -22
- package/lowcode_es/meta.js +23 -22
- package/lowcode_es/navigation/meta.d.ts +22 -22
- package/lowcode_es/notice-bar/meta.d.ts +22 -22
- package/lowcode_es/position/meta.d.ts +22 -22
- package/lowcode_es/search-bar/meta.d.ts +22 -22
- package/lowcode_es/swiper/meta.d.ts +22 -22
- package/lowcode_es/tab-container/meta.d.ts +22 -22
- package/lowcode_es/tab-container/props.d.ts +90 -90
- package/lowcode_es/tab-container-item/meta.d.ts +22 -22
- package/lowcode_es/tab-message/meta.d.ts +22 -22
- package/lowcode_es/tag-c/meta.d.ts +22 -22
- package/lowcode_es/teletext-list/meta.d.ts +22 -22
- package/lowcode_es/title1/meta.d.ts +22 -22
- package/lowcode_es/title2/meta.d.ts +22 -22
- package/lowcode_es/view.js +3 -3
- package/lowcode_lib/button2/meta.d.ts +22 -22
- package/lowcode_lib/custom-radio-group/meta.d.ts +22 -22
- package/lowcode_lib/custom-radio-group-item/meta.d.ts +23 -23
- package/lowcode_lib/d-c-slider/meta.d.ts +148 -148
- package/lowcode_lib/d-c-slider/meta.design.d.ts +100 -100
- package/lowcode_lib/d-c-slider/snippets.d.ts +36 -36
- package/lowcode_lib/goods-card-list/meta.d.ts +22 -0
- package/lowcode_lib/goods-card-list/meta.js +250 -0
- package/lowcode_lib/grid-nav/meta.d.ts +22 -22
- package/lowcode_lib/integral-task/meta.d.ts +22 -22
- package/lowcode_lib/menu-list/meta.d.ts +22 -22
- package/lowcode_lib/message-list/meta.d.ts +22 -22
- package/lowcode_lib/meta.js +23 -22
- package/lowcode_lib/navigation/meta.d.ts +22 -22
- package/lowcode_lib/notice-bar/meta.d.ts +22 -22
- package/lowcode_lib/position/meta.d.ts +22 -22
- package/lowcode_lib/search-bar/meta.d.ts +22 -22
- package/lowcode_lib/swiper/meta.d.ts +22 -22
- package/lowcode_lib/tab-container/meta.d.ts +22 -22
- package/lowcode_lib/tab-container/props.d.ts +90 -90
- package/lowcode_lib/tab-container-item/meta.d.ts +22 -22
- package/lowcode_lib/tab-message/meta.d.ts +22 -22
- package/lowcode_lib/tag-c/meta.d.ts +22 -22
- package/lowcode_lib/teletext-list/meta.d.ts +22 -22
- package/lowcode_lib/title1/meta.d.ts +22 -22
- package/lowcode_lib/title2/meta.d.ts +22 -22
- package/lowcode_lib/view.js +2 -2
- package/package.json +3 -3
- package/build/docs/umi.c18d41ab.js +0 -1
|
Binary file
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import './index.scss';
|
|
3
|
-
interface Navigation {
|
|
4
|
-
text: string;
|
|
5
|
-
icon: string;
|
|
6
|
-
selectedIcon: string;
|
|
7
|
-
pageId: string;
|
|
8
|
-
}
|
|
9
|
-
export interface NavigationProps {
|
|
10
|
-
itemArray: Navigation[];
|
|
11
|
-
selectedColor: string;
|
|
12
|
-
onClick?: (pageId: string) => void;
|
|
13
|
-
}
|
|
14
|
-
declare const Navigation: React.FC<NavigationProps>;
|
|
15
|
-
export default Navigation;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
interface Navigation {
|
|
4
|
+
text: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
selectedIcon: string;
|
|
7
|
+
pageId: string;
|
|
8
|
+
}
|
|
9
|
+
export interface NavigationProps {
|
|
10
|
+
itemArray: Navigation[];
|
|
11
|
+
selectedColor: string;
|
|
12
|
+
onClick?: (pageId: string) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const Navigation: React.FC<NavigationProps>;
|
|
15
|
+
export default Navigation;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import Navigation from './bottom-navigation';
|
|
2
|
-
export type { NavigationProps } from './bottom-navigation';
|
|
3
|
-
export default Navigation;
|
|
1
|
+
import Navigation from './bottom-navigation';
|
|
2
|
+
export type { NavigationProps } from './bottom-navigation';
|
|
3
|
+
export default Navigation;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
.navigation-panel {
|
|
2
|
-
display: flex;
|
|
3
|
-
justify-content: space-between;
|
|
4
|
-
align-items: center;
|
|
5
|
-
padding: 9px 0px 6px 0px;
|
|
6
|
-
width: 100%;
|
|
7
|
-
position: fixed;
|
|
8
|
-
bottom: 0;
|
|
9
|
-
background-color: #fff;
|
|
10
|
-
box-sizing: border-box;
|
|
11
|
-
z-index: 10;
|
|
12
|
-
&-item {
|
|
13
|
-
display: flex;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
justify-content: center;
|
|
16
|
-
align-items: center;
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
flex: 1;
|
|
19
|
-
.navigation-item-image {
|
|
20
|
-
margin-bottom: 3px;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
1
|
+
.navigation-panel {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: space-between;
|
|
4
|
+
align-items: center;
|
|
5
|
+
padding: 9px 0px 6px 0px;
|
|
6
|
+
width: 100%;
|
|
7
|
+
position: fixed;
|
|
8
|
+
bottom: 0;
|
|
9
|
+
background-color: #fff;
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
z-index: 10;
|
|
12
|
+
&-item {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
align-items: center;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
flex: 1;
|
|
19
|
+
.navigation-item-image {
|
|
20
|
+
margin-bottom: 3px;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import './index.scss';
|
|
3
|
-
export interface ButtonProps {
|
|
4
|
-
/**
|
|
5
|
-
* 标签名称
|
|
6
|
-
*/
|
|
7
|
-
name: string;
|
|
8
|
-
/**
|
|
9
|
-
* 标签颜色
|
|
10
|
-
*/
|
|
11
|
-
color: string;
|
|
12
|
-
}
|
|
13
|
-
declare const Button: React.FC<ButtonProps>;
|
|
14
|
-
export default Button;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
export interface ButtonProps {
|
|
4
|
+
/**
|
|
5
|
+
* 标签名称
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
/**
|
|
9
|
+
* 标签颜色
|
|
10
|
+
*/
|
|
11
|
+
color: string;
|
|
12
|
+
}
|
|
13
|
+
declare const Button: React.FC<ButtonProps>;
|
|
14
|
+
export default Button;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 标签tag
|
|
3
|
-
*/
|
|
4
|
-
import Button from './button';
|
|
5
|
-
export type { ButtonProps } from './button';
|
|
6
|
-
export default Button;
|
|
1
|
+
/**
|
|
2
|
+
* 标签tag
|
|
3
|
+
*/
|
|
4
|
+
import Button from './button';
|
|
5
|
+
export type { ButtonProps } from './button';
|
|
6
|
+
export default Button;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './carousel.scss';
|
|
3
|
+
export interface CarouselProps {
|
|
4
|
+
/**
|
|
5
|
+
* 图片列表
|
|
6
|
+
*/
|
|
7
|
+
images: string[];
|
|
8
|
+
/**
|
|
9
|
+
* 定时播放的时间
|
|
10
|
+
*/
|
|
11
|
+
interval?: number;
|
|
12
|
+
}
|
|
13
|
+
declare const Carousel: React.FC<CarouselProps>;
|
|
14
|
+
export default Carousel;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import "./carousel.scss";
|
|
3
|
+
var Carousel = function Carousel(_ref) {
|
|
4
|
+
var _ref$images = _ref.images,
|
|
5
|
+
images = _ref$images === void 0 ? [] : _ref$images,
|
|
6
|
+
_ref$interval = _ref.interval,
|
|
7
|
+
interval = _ref$interval === void 0 ? 3000 : _ref$interval;
|
|
8
|
+
// 如果没有图片则返回提示
|
|
9
|
+
if (images.length === 0) {
|
|
10
|
+
return /*#__PURE__*/React.createElement("div", null);
|
|
11
|
+
}
|
|
12
|
+
// 如果只有一张图片,则直接显示
|
|
13
|
+
if (images.length === 1) {
|
|
14
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
className: "carousel"
|
|
16
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
17
|
+
src: images[0],
|
|
18
|
+
alt: "Single slide",
|
|
19
|
+
className: "carousel-image"
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
// 添加复制的第一张和最后一张图片以实现无缝切换
|
|
23
|
+
var extendedImages = [images[images.length - 1]].concat(images, [images[0]]);
|
|
24
|
+
// 初始显示第二张图片
|
|
25
|
+
var _useState = useState(1),
|
|
26
|
+
currentIndex = _useState[0],
|
|
27
|
+
setCurrentIndex = _useState[1];
|
|
28
|
+
// 切换到下一张图片
|
|
29
|
+
var goToNext = function goToNext() {
|
|
30
|
+
setCurrentIndex(function (prevIndex) {
|
|
31
|
+
return prevIndex + 1;
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
// 自动播放逻辑:在组件挂载时启动定时器
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
var timer = setInterval(function () {
|
|
37
|
+
goToNext();
|
|
38
|
+
}, interval);
|
|
39
|
+
// 清除定时器,避免内存泄漏
|
|
40
|
+
return function () {
|
|
41
|
+
return clearInterval(timer);
|
|
42
|
+
};
|
|
43
|
+
}, [interval]);
|
|
44
|
+
useEffect(function () {
|
|
45
|
+
// 当切换到最后一张复制的图片时,设置为第二张图片
|
|
46
|
+
if (currentIndex === extendedImages.length - 1) {
|
|
47
|
+
setTimeout(function () {
|
|
48
|
+
// 跳转到第二张
|
|
49
|
+
setCurrentIndex(1);
|
|
50
|
+
}, 1000);
|
|
51
|
+
}
|
|
52
|
+
}, [currentIndex]);
|
|
53
|
+
// 计算当前显示的图像索引
|
|
54
|
+
var displayIndex = currentIndex > images.length ? currentIndex - images.length : currentIndex;
|
|
55
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
className: "carousel"
|
|
57
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
58
|
+
className: "carousel-track",
|
|
59
|
+
style: {
|
|
60
|
+
transform: "translateX(-" + currentIndex * 100 + "%)",
|
|
61
|
+
// 只有在平滑切换时才应用过渡
|
|
62
|
+
transition: currentIndex === 1 ? 'none' : 'transform 1s ease-in-out'
|
|
63
|
+
}
|
|
64
|
+
}, extendedImages.map(function (image, index) {
|
|
65
|
+
return /*#__PURE__*/React.createElement("img", {
|
|
66
|
+
key: index,
|
|
67
|
+
src: image,
|
|
68
|
+
alt: "Slide " + index,
|
|
69
|
+
className: "carousel-image"
|
|
70
|
+
});
|
|
71
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
72
|
+
className: "carousel-counter"
|
|
73
|
+
}, /*#__PURE__*/React.createElement("span", null, displayIndex), /*#__PURE__*/React.createElement("span", null, "/"), /*#__PURE__*/React.createElement("span", null, images.length)));
|
|
74
|
+
};
|
|
75
|
+
export default Carousel;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.carousel {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.carousel-track {
|
|
9
|
+
display: flex;
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.carousel-image {
|
|
15
|
+
min-width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
object-fit: cover;
|
|
18
|
+
object-position: center;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.carousel-counter {
|
|
22
|
+
position: absolute;
|
|
23
|
+
bottom: 2px;
|
|
24
|
+
right: 2px;
|
|
25
|
+
color: white;
|
|
26
|
+
background: rgba(0, 0, 0, 0.5);
|
|
27
|
+
padding: 2px 8px;
|
|
28
|
+
border-radius: 5px;
|
|
29
|
+
font-size: 12px;
|
|
30
|
+
display: flex;
|
|
31
|
+
gap: 2px;
|
|
32
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import './index.scss';
|
|
3
|
-
export interface ColorfulButtonProps {
|
|
4
|
-
/**
|
|
5
|
-
* 类型
|
|
6
|
-
*/
|
|
7
|
-
type?: "primary" | "secondary" | "normal";
|
|
8
|
-
color?: string;
|
|
9
|
-
style?: object;
|
|
10
|
-
}
|
|
11
|
-
declare const ColorfulButton: React.FC<ColorfulButtonProps>;
|
|
12
|
-
export default ColorfulButton;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
export interface ColorfulButtonProps {
|
|
4
|
+
/**
|
|
5
|
+
* 类型
|
|
6
|
+
*/
|
|
7
|
+
type?: "primary" | "secondary" | "normal";
|
|
8
|
+
color?: string;
|
|
9
|
+
style?: object;
|
|
10
|
+
}
|
|
11
|
+
declare const ColorfulButton: React.FC<ColorfulButtonProps>;
|
|
12
|
+
export default ColorfulButton;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import ColorfulButton from './colorful-button';
|
|
2
|
-
export type { ColorfulButtonProps } from './colorful-button';
|
|
3
|
-
export default ColorfulButton;
|
|
1
|
+
import ColorfulButton from './colorful-button';
|
|
2
|
+
export type { ColorfulButtonProps } from './colorful-button';
|
|
3
|
+
export default ColorfulButton;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import './index.scss';
|
|
3
|
-
export interface ColorfulInputProps {
|
|
4
|
-
color?: string;
|
|
5
|
-
style?: object;
|
|
6
|
-
}
|
|
7
|
-
declare const ColorfulInput: React.FC<ColorfulInputProps>;
|
|
8
|
-
export default ColorfulInput;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
export interface ColorfulInputProps {
|
|
4
|
+
color?: string;
|
|
5
|
+
style?: object;
|
|
6
|
+
}
|
|
7
|
+
declare const ColorfulInput: React.FC<ColorfulInputProps>;
|
|
8
|
+
export default ColorfulInput;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import ColorfulInput from './colorful-input';
|
|
2
|
-
export type { ColorfulInputProps } from './colorful-input';
|
|
3
|
-
export default ColorfulInput;
|
|
1
|
+
import ColorfulInput from './colorful-input';
|
|
2
|
+
export type { ColorfulInputProps } from './colorful-input';
|
|
3
|
+
export default ColorfulInput;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["dataList", "maxSales", "onClick"];
|
|
4
|
+
import React, { useEffect, useState } from 'react';
|
|
5
|
+
import { debounce } from "../../utils/debounce";
|
|
6
|
+
import Carousel from "../carousel/carousel";
|
|
7
|
+
import "./goods-card-list.scss";
|
|
8
|
+
var GoodsCardList = function GoodsCardList(_ref) {
|
|
9
|
+
var _ref$dataList = _ref.dataList,
|
|
10
|
+
dataList = _ref$dataList === void 0 ? [] : _ref$dataList,
|
|
11
|
+
_ref$maxSales = _ref.maxSales,
|
|
12
|
+
maxSales = _ref$maxSales === void 0 ? 1000 : _ref$maxSales,
|
|
13
|
+
_ref$onClick = _ref.onClick,
|
|
14
|
+
_onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
15
|
+
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
16
|
+
var _otherProps = otherProps || {};
|
|
17
|
+
var _useState = useState([]),
|
|
18
|
+
positions = _useState[0],
|
|
19
|
+
setPositions = _useState[1];
|
|
20
|
+
var _useState2 = useState(0),
|
|
21
|
+
columnWidth = _useState2[0],
|
|
22
|
+
setColumnWidth = _useState2[1];
|
|
23
|
+
var _useState3 = useState(0),
|
|
24
|
+
maxContainerHeight = _useState3[0],
|
|
25
|
+
setMaxContainerHeight = _useState3[1];
|
|
26
|
+
useEffect(function () {
|
|
27
|
+
var updateLayout = function updateLayout() {
|
|
28
|
+
var container = document.querySelector('.waterfall-container');
|
|
29
|
+
if (container) {
|
|
30
|
+
var itemElements = document.querySelectorAll('.waterfall-item');
|
|
31
|
+
// 横向间距
|
|
32
|
+
var horizontalGap = 12;
|
|
33
|
+
// 纵向间距
|
|
34
|
+
var verticalGap = 10;
|
|
35
|
+
var containerWidth = container.offsetWidth;
|
|
36
|
+
// 每列宽度为容器宽度的一半减去间距
|
|
37
|
+
var calculatedColumnWidth = (containerWidth - horizontalGap) / 2;
|
|
38
|
+
setColumnWidth(calculatedColumnWidth);
|
|
39
|
+
// 两列布局
|
|
40
|
+
var columnHeights = Array.from({
|
|
41
|
+
length: 2
|
|
42
|
+
}).fill(0);
|
|
43
|
+
var newPositions = [];
|
|
44
|
+
// 循环计算所有的子元素的信息
|
|
45
|
+
itemElements.forEach(function (item) {
|
|
46
|
+
var _item$getBoundingClie = item.getBoundingClientRect(),
|
|
47
|
+
height = _item$getBoundingClie.height;
|
|
48
|
+
// 找到最短的那一列
|
|
49
|
+
var minHeight = Math.min.apply(Math, columnHeights);
|
|
50
|
+
// 获取该列的索引
|
|
51
|
+
var columnIndex = columnHeights.indexOf(minHeight);
|
|
52
|
+
var left = columnIndex * (calculatedColumnWidth + horizontalGap);
|
|
53
|
+
var top = columnHeights[columnIndex];
|
|
54
|
+
// 存储元素的定位
|
|
55
|
+
newPositions.push({
|
|
56
|
+
left: left,
|
|
57
|
+
top: top
|
|
58
|
+
});
|
|
59
|
+
// 更新该列的高度
|
|
60
|
+
columnHeights[columnIndex] += height + verticalGap;
|
|
61
|
+
});
|
|
62
|
+
// 更新位置
|
|
63
|
+
setPositions(newPositions);
|
|
64
|
+
setMaxContainerHeight(Math.max.apply(Math, columnHeights));
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
var debouncedUpdateLayout = dataList.length < 15 ? updateLayout : debounce(updateLayout, 200);
|
|
68
|
+
// 图片加载完成后更新布局
|
|
69
|
+
var handleImageLoad = function handleImageLoad() {
|
|
70
|
+
debouncedUpdateLayout();
|
|
71
|
+
};
|
|
72
|
+
// 初始化布局
|
|
73
|
+
debouncedUpdateLayout();
|
|
74
|
+
// 监听图片加载事件,以确保所有图片都加载完后再更新布局
|
|
75
|
+
var images = document.querySelectorAll('.waterfall-container img');
|
|
76
|
+
images.forEach(function (img) {
|
|
77
|
+
// 如果图片已经加载完成(缓存中加载),则立即更新布局
|
|
78
|
+
if (img.complete) {
|
|
79
|
+
handleImageLoad();
|
|
80
|
+
} else {
|
|
81
|
+
// 如果图片未加载完成,监听加载事件
|
|
82
|
+
img.addEventListener('load', handleImageLoad);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// 窗口变化时更新布局
|
|
87
|
+
window.addEventListener('resize', debouncedUpdateLayout);
|
|
88
|
+
return function () {
|
|
89
|
+
// 清理事件监听
|
|
90
|
+
window.removeEventListener('resize', debouncedUpdateLayout);
|
|
91
|
+
images.forEach(function (img) {
|
|
92
|
+
return img.removeEventListener('load', handleImageLoad);
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
// 当 dataList 变化时重新计算
|
|
97
|
+
[dataList]);
|
|
98
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
99
|
+
className: "card-list-goods__container waterfall-container",
|
|
100
|
+
style: {
|
|
101
|
+
height: maxContainerHeight + 20 + "px"
|
|
102
|
+
}
|
|
103
|
+
}, _otherProps), dataList.map(function (item, index) {
|
|
104
|
+
var _positions$index, _positions$index2;
|
|
105
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
106
|
+
key: item.key,
|
|
107
|
+
className: "card-list-goods__item waterfall-item",
|
|
108
|
+
onClick: function onClick() {
|
|
109
|
+
return _onClick(item);
|
|
110
|
+
},
|
|
111
|
+
style: {
|
|
112
|
+
left: ((_positions$index = positions[index]) === null || _positions$index === void 0 ? void 0 : _positions$index.left) + "px",
|
|
113
|
+
top: ((_positions$index2 = positions[index]) === null || _positions$index2 === void 0 ? void 0 : _positions$index2.top) + "px",
|
|
114
|
+
width: columnWidth + "px"
|
|
115
|
+
}
|
|
116
|
+
}, item.imageList && item.imageList.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
117
|
+
className: "card-list-goods__image"
|
|
118
|
+
}, /*#__PURE__*/React.createElement(Carousel, {
|
|
119
|
+
images: item.imageList,
|
|
120
|
+
interval: 3000
|
|
121
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
122
|
+
className: "card-list-goods__content"
|
|
123
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
124
|
+
className: "card-list-goods__title"
|
|
125
|
+
}, item.title), /*#__PURE__*/React.createElement("div", {
|
|
126
|
+
className: "card-list-goods__desc"
|
|
127
|
+
}, item.desc), /*#__PURE__*/React.createElement("div", {
|
|
128
|
+
className: "card-list-goods__bottom"
|
|
129
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
130
|
+
className: "card-list-goods__unit"
|
|
131
|
+
}, "\uFFE5"), /*#__PURE__*/React.createElement("div", {
|
|
132
|
+
className: "card-list-goods__price"
|
|
133
|
+
}, item.price), /*#__PURE__*/React.createElement("div", {
|
|
134
|
+
className: "card-list-goods__sales"
|
|
135
|
+
}, "\u5DF2\u552E", item.sales > maxSales ? maxSales + "+" : item.sales))));
|
|
136
|
+
}));
|
|
137
|
+
};
|
|
138
|
+
GoodsCardList.displayName = 'GoodsCardList';
|
|
139
|
+
export default GoodsCardList;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
.card-list-goods__container {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
|
|
5
|
+
& > .card-list-goods__item {
|
|
6
|
+
position: absolute;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
transition: top 0.35s ease, left 0.35s ease, width 0.35s ease;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
border-radius: 8px;
|
|
11
|
+
box-shadow: 0 3px 9px 1px rgba(204,204,204,0.35);
|
|
12
|
+
|
|
13
|
+
& > .card-list-goods__image {
|
|
14
|
+
height: 200px;
|
|
15
|
+
width: 100%;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
display: flex;
|
|
18
|
+
|
|
19
|
+
& > img {
|
|
20
|
+
height: 100%;
|
|
21
|
+
width: 100%;
|
|
22
|
+
object-fit: cover;
|
|
23
|
+
object-position: center;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
& > .card-list-goods__content {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
padding: 0.5rem;
|
|
32
|
+
|
|
33
|
+
.card-list-goods__title {
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
display: -webkit-box;
|
|
36
|
+
-webkit-box-orient: vertical;
|
|
37
|
+
-webkit-line-clamp: 2;
|
|
38
|
+
line-clamp: 2;
|
|
39
|
+
margin-top: 0.25rem;
|
|
40
|
+
margin-bottom: 0.25rem;
|
|
41
|
+
font-size: 14px;
|
|
42
|
+
font-weight: 700;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.card-list-goods__desc {
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
text-overflow: ellipsis;
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
line-clamp: 2;
|
|
50
|
+
margin-top: 0.25rem;
|
|
51
|
+
margin-bottom: 0.25rem;
|
|
52
|
+
font-size: 12px;
|
|
53
|
+
color: #333333;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.card-list-goods__bottom {
|
|
57
|
+
margin-top: 0.25rem;
|
|
58
|
+
margin-bottom: 0.25rem;
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: baseline;
|
|
61
|
+
|
|
62
|
+
.card-list-goods__unit {
|
|
63
|
+
font-size: 12px;
|
|
64
|
+
color: #F57D51;
|
|
65
|
+
font-weight: 700;
|
|
66
|
+
line-height: 1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.card-list-goods__price {
|
|
70
|
+
font-size: 17px;
|
|
71
|
+
color: #F57D51;
|
|
72
|
+
font-weight: 700;
|
|
73
|
+
line-height: 1;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.card-list-goods__sales {
|
|
77
|
+
margin-left: 0.5rem;
|
|
78
|
+
margin-right: 0.5rem;
|
|
79
|
+
font-size: 12px;
|
|
80
|
+
color: #666666;
|
|
81
|
+
line-height: 1;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface GoodsCardListProps {
|
|
2
|
+
/**
|
|
3
|
+
* 卡片列表数据
|
|
4
|
+
*/
|
|
5
|
+
dataList: GoodsCardListItemProps[];
|
|
6
|
+
/**
|
|
7
|
+
* 最大销量
|
|
8
|
+
*/
|
|
9
|
+
maxSales?: number;
|
|
10
|
+
/**
|
|
11
|
+
* 点击事件
|
|
12
|
+
* @param item
|
|
13
|
+
*/
|
|
14
|
+
onClick?: (item: GoodsCardListItemProps) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface GoodsCardListItemProps {
|
|
17
|
+
/**
|
|
18
|
+
* 唯一标识
|
|
19
|
+
*/
|
|
20
|
+
key: string;
|
|
21
|
+
/**
|
|
22
|
+
* 缩略图列表
|
|
23
|
+
*/
|
|
24
|
+
imageList: string[];
|
|
25
|
+
/**
|
|
26
|
+
* 标题
|
|
27
|
+
*/
|
|
28
|
+
title: string;
|
|
29
|
+
/**
|
|
30
|
+
* 简介
|
|
31
|
+
*/
|
|
32
|
+
desc: string;
|
|
33
|
+
/**
|
|
34
|
+
* 价格
|
|
35
|
+
*/
|
|
36
|
+
price: string;
|
|
37
|
+
/**
|
|
38
|
+
* 销量
|
|
39
|
+
*/
|
|
40
|
+
sales: number;
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export interface GridNavProps {
|
|
3
|
-
dataSourceSetting: [];
|
|
4
|
-
columns: number;
|
|
5
|
-
iconSize: string;
|
|
6
|
-
fontWeight: string;
|
|
7
|
-
fontSize: number;
|
|
8
|
-
fontColor: string;
|
|
9
|
-
lineHeight: string;
|
|
10
|
-
lineNum: number;
|
|
11
|
-
}
|
|
12
|
-
declare const GridNav: React.ForwardRefExoticComponent<GridNavProps & React.RefAttributes<any>>;
|
|
13
|
-
export default GridNav;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface GridNavProps {
|
|
3
|
+
dataSourceSetting: [];
|
|
4
|
+
columns: number;
|
|
5
|
+
iconSize: string;
|
|
6
|
+
fontWeight: string;
|
|
7
|
+
fontSize: number;
|
|
8
|
+
fontColor: string;
|
|
9
|
+
lineHeight: string;
|
|
10
|
+
lineNum: number;
|
|
11
|
+
}
|
|
12
|
+
declare const GridNav: React.ForwardRefExoticComponent<GridNavProps & React.RefAttributes<any>>;
|
|
13
|
+
export default GridNav;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import GridNav from "./grid-nav";
|
|
2
|
-
export type { GridNavProps } from './grid-nav';
|
|
3
|
-
export default GridNav;
|
|
1
|
+
import GridNav from "./grid-nav";
|
|
2
|
+
export type { GridNavProps } from './grid-nav';
|
|
3
|
+
export default GridNav;
|