yootd 0.0.6 → 0.0.8

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/README.md CHANGED
@@ -1,43 +1,43 @@
1
- # yootd
2
-
3
- [![NPM version](https://img.shields.io/npm/v/yootd.svg?style=flat)](https://npmjs.org/package/yootd)
4
- [![NPM downloads](http://img.shields.io/npm/dm/yootd.svg?style=flat)](https://npmjs.org/package/yootd)
5
-
6
- A react library developed with dumi
7
-
8
- ## Usage
9
-
10
- TODO
11
-
12
- ## Options
13
-
14
- TODO
15
-
16
- ## Development
17
-
18
- ```bash
19
- # install dependencies
20
- $ pnpm install
21
-
22
- # develop library by docs demo
23
- $ pnpm start
24
-
25
- # build library source code
26
- $ pnpm run build
27
-
28
- # build library source code in watch mode
29
- $ pnpm run build:watch
30
-
31
- # build docs
32
- $ pnpm run docs:build
33
-
34
- # Locally preview the production build.
35
- $ pnpm run docs:preview
36
-
37
- # check your project for potential problems
38
- $ pnpm run doctor
39
- ```
40
-
41
- ## LICENSE
42
-
43
- MIT
1
+ # yootd
2
+
3
+ [![NPM version](https://img.shields.io/npm/v/yootd.svg?style=flat)](https://npmjs.org/package/yootd)
4
+ [![NPM downloads](http://img.shields.io/npm/dm/yootd.svg?style=flat)](https://npmjs.org/package/yootd)
5
+
6
+ A react library developed with dumi
7
+
8
+ ## Usage
9
+
10
+ TODO
11
+
12
+ ## Options
13
+
14
+ TODO
15
+
16
+ ## Development
17
+
18
+ ```bash
19
+ # install dependencies
20
+ $ pnpm install
21
+
22
+ # develop library by docs demo
23
+ $ pnpm start
24
+
25
+ # build library source code
26
+ $ pnpm run build
27
+
28
+ # build library source code in watch mode
29
+ $ pnpm run build:watch
30
+
31
+ # build docs
32
+ $ pnpm run docs:build
33
+
34
+ # Locally preview the production build.
35
+ $ pnpm run docs:preview
36
+
37
+ # check your project for potential problems
38
+ $ pnpm run doctor
39
+ ```
40
+
41
+ ## LICENSE
42
+
43
+ MIT
@@ -1,8 +1,8 @@
1
- .yot-preview-phone {
2
- width: 398px;
3
- height: 829px;
4
- background-image: url('../../assets/phonebg.png');
5
- background-size: 100% 100%;
6
- padding: 96px 36px 20px 36px;
7
- box-sizing: border-box;
8
- }
1
+ .yot-preview-phone {
2
+ width: 398px;
3
+ height: 829px;
4
+ background-image: url('../../assets/phonebg.png');
5
+ background-size: 100% 100%;
6
+ padding: 96px 36px 20px 36px;
7
+ box-sizing: border-box;
8
+ }
@@ -1,21 +1,21 @@
1
- export interface PrevewProps {
2
- controls?: boolean; // 是否显示右下角的放大缩小组件
3
- defaultZoom?: number; // 初始化放大倍数
4
- maxZoom?: number; // 最大放大倍数
5
- minZoom?: number; // 最小放大倍数
6
- panOnDrag?: boolean; // 是否可以拖拽
7
- zoomOnScroll?: boolean; // 是否可以滚动
8
- modes?: ['phone', 'web'] | ['phone'] | ['web']; // 预览模式
9
- content?: ReactNode; // 数据
10
- width?: number | string; // 宽度
11
- height?: number | string; // 高度
12
- style?: React.CSSProperties; // 样式
13
- }
14
-
15
- export interface TopPreviewProps {
16
- mode: string;
17
- onChange: (value: string) => void;
18
- }
19
- export interface ControlsProps {
20
- defaultZoom?: number; // 初始化放大倍数
21
- }
1
+ export interface PrevewProps {
2
+ controls?: boolean; // 是否显示右下角的放大缩小组件
3
+ defaultZoom?: number; // 初始化放大倍数
4
+ maxZoom?: number; // 最大放大倍数
5
+ minZoom?: number; // 最小放大倍数
6
+ panOnDrag?: boolean; // 是否可以拖拽
7
+ zoomOnScroll?: boolean; // 是否可以滚动
8
+ modes?: ['phone', 'web'] | ['phone'] | ['web']; // 预览模式
9
+ content?: ReactNode; // 数据
10
+ width?: number | string; // 宽度
11
+ height?: number | string; // 高度
12
+ style?: React.CSSProperties; // 样式
13
+ }
14
+
15
+ export interface TopPreviewProps {
16
+ mode: string;
17
+ onChange: (value: string) => void;
18
+ }
19
+ export interface ControlsProps {
20
+ defaultZoom?: number; // 初始化放大倍数
21
+ }
@@ -1,23 +1,23 @@
1
- .yot-anchor {
2
- .ant-anchor .ant-anchor-link {
3
- padding-top: var(--ant-padding);
4
- padding-bottom: var(--ant-padding);
5
- box-sizing: border-box;
6
- font-size: var(--ant-font-size);
7
- }
8
- .ant-anchor .ant-anchor-link:nth-of-type(1) {
9
- padding-top: 5px;
10
- padding-bottom: var(--ant-padding);
11
- box-sizing: border-box;
12
- font-size: var(--ant-font-size);
13
- }
14
- .ant-anchor .ant-anchor-link:last-child {
15
- padding-top: var(--ant-padding);
16
- padding-bottom: 5px;
17
- box-sizing: border-box;
18
- font-size: var(--ant-font-size);
19
- }
20
- .ant-anchor .ant-anchor-link.ant-anchor-link-active {
21
- color: var(--ant-color-primary);
22
- }
23
- }
1
+ .yot-anchor {
2
+ .ant-anchor .ant-anchor-link {
3
+ padding-top: var(--ant-padding);
4
+ padding-bottom: var(--ant-padding);
5
+ box-sizing: border-box;
6
+ font-size: var(--ant-font-size);
7
+ }
8
+ .ant-anchor .ant-anchor-link:nth-of-type(1) {
9
+ padding-top: 5px;
10
+ padding-bottom: var(--ant-padding);
11
+ box-sizing: border-box;
12
+ font-size: var(--ant-font-size);
13
+ }
14
+ .ant-anchor .ant-anchor-link:last-child {
15
+ padding-top: var(--ant-padding);
16
+ padding-bottom: 5px;
17
+ box-sizing: border-box;
18
+ font-size: var(--ant-font-size);
19
+ }
20
+ .ant-anchor .ant-anchor-link.ant-anchor-link-active {
21
+ color: var(--ant-color-primary);
22
+ }
23
+ }
@@ -1,39 +1,39 @@
1
- export interface PageData<T> {
2
- content: T[];
3
- page: {
4
- number: number;
5
- size: number;
6
- totalElements: number;
7
- totalPages: number;
8
- };
9
- }
10
- type SchoolProps = {
11
- level1?: boolean;
12
- areaType?: number;
13
- areaSubType?: number;
14
- style?: React.CSSProperties;
15
- showSearch?: boolean;
16
- value?: {
17
- level1?: number;
18
- level2?: number;
19
- level3?: number;
20
- level4?: number;
21
- level5?: number;
22
- };
23
- onChange?: (record: {
24
- level1?: number;
25
- level2?: number;
26
- level3?: number;
27
- level4?: number;
28
- level5?: number;
29
- }) => void;
30
- allowClear?: boolean;
31
- placeholder?: string[];
32
- };
33
- // 查询位置接口返回的数据类型
34
- export interface IareaItem {
35
- areaId: number;
36
- areaLevel: number;
37
- areaName: string;
38
- areaType: number;
39
- }
1
+ export interface PageData<T> {
2
+ content: T[];
3
+ page: {
4
+ number: number;
5
+ size: number;
6
+ totalElements: number;
7
+ totalPages: number;
8
+ };
9
+ }
10
+ type SchoolProps = {
11
+ level1?: boolean;
12
+ areaType?: number;
13
+ areaSubType?: number;
14
+ style?: React.CSSProperties;
15
+ showSearch?: boolean;
16
+ value?: {
17
+ level1?: number;
18
+ level2?: number;
19
+ level3?: number;
20
+ level4?: number;
21
+ level5?: number;
22
+ };
23
+ onChange?: (record: {
24
+ level1?: number;
25
+ level2?: number;
26
+ level3?: number;
27
+ level4?: number;
28
+ level5?: number;
29
+ }) => void;
30
+ allowClear?: boolean;
31
+ placeholder?: string[];
32
+ };
33
+ // 查询位置接口返回的数据类型
34
+ export interface IareaItem {
35
+ areaId: number;
36
+ areaLevel: number;
37
+ areaName: string;
38
+ areaType: number;
39
+ }
@@ -1,93 +1,93 @@
1
- .yot-SortableItem {
2
- &-content {
3
- position: relative;
4
- padding: 12px 16px;
5
- box-sizing: border-box;
6
- cursor: pointer;
7
- &-top {
8
- display: flex;
9
- justify-content: space-between;
10
- align-items: start;
11
- &-top-left {
12
- display: flex;
13
- align-items: start;
14
- &-top-drag-btn-icon {
15
- cursor: move;
16
- &__drag-btn-icon-svg {
17
- display: inline-block;
18
- vertical-align: middle;
19
- }
20
- }
21
- &-top-title-wrap {
22
- display: flex;
23
- align-items: center;
24
- justify-content: center;
25
- &__top-title {
26
- font-size: 16px;
27
- font-weight: 400;
28
- line-height: 1.5em;
29
- overflow: hidden;
30
- display: -webkit-box; //将元素设为盒子伸缩模型显示
31
- -webkit-box-orient: vertical; //伸缩方向设为垂直方向
32
- -webkit-line-clamp: 2; //超出2行隐藏,并显示省略号
33
- line-clamp: 2;
34
- }
35
- }
36
- }
37
- &-top-middle {
38
- display: flex;
39
- align-items: center;
40
- &-top-edit-btn-icon {
41
- cursor: pointer;
42
- &__edit-btn-icon-svg {
43
- display: inline-block;
44
- vertical-align: middle;
45
- }
46
- }
47
- &-top-del-btn-icon {
48
- cursor: pointer;
49
- margin-left: 12px;
50
- &__del-btn-icon-svg {
51
- display: inline-block;
52
- vertical-align: middle;
53
- }
54
- }
55
- }
56
- }
57
- &-bottom {
58
- text-overflow: ellipsis;
59
- overflow: hidden;
60
- white-space: nowrap;
61
- &__extra {
62
- font-size: 12px;
63
- font-weight: 400;
64
- color: rgba(0, 0, 0, 0.45);
65
- }
66
- }
67
- }
68
- &-content:hover {
69
- background-color: #d1eaff;
70
- transition: all 0.05s ease;
71
- }
72
- &-content::before {
73
- content: '';
74
- position: absolute;
75
- bottom: -0.5px;
76
- left: 16px;
77
- right: 16px;
78
- height: 1px;
79
- background-color: #e5e5e5;
80
- }
81
- &__content-active {
82
- background-color: #d1eaff;
83
- }
84
- &__content-active::after {
85
- content: '';
86
- position: absolute;
87
- bottom: 0;
88
- left: 0;
89
- width: 4px;
90
- height: 100%;
91
- background-color: #4d8de2;
92
- }
93
- }
1
+ .yot-SortableItem {
2
+ &-content {
3
+ position: relative;
4
+ padding: 12px 16px;
5
+ box-sizing: border-box;
6
+ cursor: pointer;
7
+ &-top {
8
+ display: flex;
9
+ justify-content: space-between;
10
+ align-items: start;
11
+ &-top-left {
12
+ display: flex;
13
+ align-items: start;
14
+ &-top-drag-btn-icon {
15
+ cursor: move;
16
+ &__drag-btn-icon-svg {
17
+ display: inline-block;
18
+ vertical-align: middle;
19
+ }
20
+ }
21
+ &-top-title-wrap {
22
+ display: flex;
23
+ align-items: center;
24
+ justify-content: center;
25
+ &__top-title {
26
+ font-size: 16px;
27
+ font-weight: 400;
28
+ line-height: 1.5em;
29
+ overflow: hidden;
30
+ display: -webkit-box; //将元素设为盒子伸缩模型显示
31
+ -webkit-box-orient: vertical; //伸缩方向设为垂直方向
32
+ -webkit-line-clamp: 2; //超出2行隐藏,并显示省略号
33
+ line-clamp: 2;
34
+ }
35
+ }
36
+ }
37
+ &-top-middle {
38
+ display: flex;
39
+ align-items: center;
40
+ &-top-edit-btn-icon {
41
+ cursor: pointer;
42
+ &__edit-btn-icon-svg {
43
+ display: inline-block;
44
+ vertical-align: middle;
45
+ }
46
+ }
47
+ &-top-del-btn-icon {
48
+ cursor: pointer;
49
+ margin-left: 12px;
50
+ &__del-btn-icon-svg {
51
+ display: inline-block;
52
+ vertical-align: middle;
53
+ }
54
+ }
55
+ }
56
+ }
57
+ &-bottom {
58
+ text-overflow: ellipsis;
59
+ overflow: hidden;
60
+ white-space: nowrap;
61
+ &__extra {
62
+ font-size: 12px;
63
+ font-weight: 400;
64
+ color: rgba(0, 0, 0, 0.45);
65
+ }
66
+ }
67
+ }
68
+ &-content:hover {
69
+ background-color: #d1eaff;
70
+ transition: all 0.05s ease;
71
+ }
72
+ &-content::before {
73
+ content: '';
74
+ position: absolute;
75
+ bottom: -0.5px;
76
+ left: 16px;
77
+ right: 16px;
78
+ height: 1px;
79
+ background-color: #e5e5e5;
80
+ }
81
+ &__content-active {
82
+ background-color: #d1eaff;
83
+ }
84
+ &__content-active::after {
85
+ content: '';
86
+ position: absolute;
87
+ bottom: 0;
88
+ left: 0;
89
+ width: 4px;
90
+ height: 100%;
91
+ background-color: #4d8de2;
92
+ }
93
+ }
@@ -1,25 +1,25 @@
1
- .yot-aside {
2
- background-color: #ffffff;
3
- border-radius: 8px;
4
- box-sizing: border-box;
5
- &-title {
6
- border-bottom: 1px solid #e5e5e5;
7
- padding: 16px 0px;
8
- margin: 0px 16px;
9
- box-sizing: border-box;
10
- display: flex;
11
- align-items: start;
12
- justify-content: space-between;
13
- &__title-text {
14
- font-size: 18px;
15
- font-weight: bold;
16
- overflow: hidden;
17
- text-overflow: ellipsis;
18
- white-space: nowrap;
19
- }
20
- &__add-btn-icon {
21
- cursor: pointer;
22
- margin-top: 8px;
23
- }
24
- }
25
- }
1
+ .yot-aside {
2
+ background-color: #ffffff;
3
+ border-radius: 8px;
4
+ box-sizing: border-box;
5
+ &-title {
6
+ border-bottom: 1px solid #e5e5e5;
7
+ padding: 16px 0px;
8
+ margin: 0px 16px;
9
+ box-sizing: border-box;
10
+ display: flex;
11
+ align-items: start;
12
+ justify-content: space-between;
13
+ &__title-text {
14
+ font-size: 18px;
15
+ font-weight: bold;
16
+ overflow: hidden;
17
+ text-overflow: ellipsis;
18
+ white-space: nowrap;
19
+ }
20
+ &__add-btn-icon {
21
+ cursor: pointer;
22
+ margin-top: 8px;
23
+ }
24
+ }
25
+ }
@@ -1,44 +1,44 @@
1
- type IdataItem = {
2
- key: string;
3
- title: string;
4
- extra?: string;
5
- checked?: boolean;
6
- };
7
- export type AsideProps = {
8
- width?: number;
9
- height?: number | string;
10
- style?: React.CSSProperties;
11
- activeKey?: string;
12
- title?: string;
13
- data: IdataItem[];
14
- titleShow?: boolean;
15
- addBtnIcon?: boolean;
16
- editBtnIcon?: boolean;
17
- delBtnIcon?: boolean;
18
- switchBtnIcon?: boolean;
19
- dragBtnIcon?: boolean;
20
- onClick?: (key: string) => void;
21
- onAdd?: () => void;
22
- onEdit?: (key: string) => void;
23
- onDel?: (key: string) => void;
24
- onSwitch?: (
25
- changeValue: { key: string; checked: boolean },
26
- data: IdataItem[],
27
- ) => void;
28
- onDragEnd?: (data: IdataItem[]) => void;
29
- };
30
- export type AsideItemProps = {
31
- activeKey: string;
32
- id: string;
33
- title: string;
34
- editBtnIcon?: boolean;
35
- delBtnIcon?: boolean;
36
- switchBtnIcon?: boolean;
37
- dragBtnIcon?: boolean;
38
- checked?: boolean;
39
- extra?: string;
40
- onClick?: (key: string) => void;
41
- onEdit?: (key: string) => void;
42
- onDel?: (key: string) => void;
43
- onSwitch?: (key: string, e: boolean) => void;
44
- };
1
+ type IdataItem = {
2
+ key: string;
3
+ title: string;
4
+ extra?: string;
5
+ checked?: boolean;
6
+ };
7
+ export type AsideProps = {
8
+ width?: number;
9
+ height?: number | string;
10
+ style?: React.CSSProperties;
11
+ activeKey?: string;
12
+ title?: string;
13
+ data: IdataItem[];
14
+ titleShow?: boolean;
15
+ addBtnIcon?: boolean;
16
+ editBtnIcon?: boolean;
17
+ delBtnIcon?: boolean;
18
+ switchBtnIcon?: boolean;
19
+ dragBtnIcon?: boolean;
20
+ onClick?: (key: string) => void;
21
+ onAdd?: () => void;
22
+ onEdit?: (key: string) => void;
23
+ onDel?: (key: string) => void;
24
+ onSwitch?: (
25
+ changeValue: { key: string; checked: boolean },
26
+ data: IdataItem[],
27
+ ) => void;
28
+ onDragEnd?: (data: IdataItem[]) => void;
29
+ };
30
+ export type AsideItemProps = {
31
+ activeKey: string;
32
+ id: string;
33
+ title: string;
34
+ editBtnIcon?: boolean;
35
+ delBtnIcon?: boolean;
36
+ switchBtnIcon?: boolean;
37
+ dragBtnIcon?: boolean;
38
+ checked?: boolean;
39
+ extra?: string;
40
+ onClick?: (key: string) => void;
41
+ onEdit?: (key: string) => void;
42
+ onDel?: (key: string) => void;
43
+ onSwitch?: (key: string, e: boolean) => void;
44
+ };
@@ -1,5 +1,5 @@
1
- .yot-badge {
2
- .ant-scroll-number.ant-badge-count {
3
- background-color: var(--ant-color-error);
4
- }
5
- }
1
+ .yot-badge {
2
+ .ant-scroll-number.ant-badge-count {
3
+ background-color: var(--ant-color-error);
4
+ }
5
+ }
@@ -1,21 +1,21 @@
1
- export interface PageData<T> {
2
- content: T[];
3
- page: {
4
- number: number;
5
- size: number;
6
- totalElements: number;
7
- totalPages: number;
8
- };
9
- }
10
- // 查询位置接口返回的数据类型
11
- export interface IareaItem {
12
- areaId: number;
13
- areaLevel: number;
14
- areaName: string;
15
- areaType: number;
16
- }
17
- export interface IBuildingsProps {
18
- showSearch?: boolean;
19
- areaType?: number;
20
- areaSubType?: number;
21
- }
1
+ export interface PageData<T> {
2
+ content: T[];
3
+ page: {
4
+ number: number;
5
+ size: number;
6
+ totalElements: number;
7
+ totalPages: number;
8
+ };
9
+ }
10
+ // 查询位置接口返回的数据类型
11
+ export interface IareaItem {
12
+ areaId: number;
13
+ areaLevel: number;
14
+ areaName: string;
15
+ areaType: number;
16
+ }
17
+ export interface IBuildingsProps {
18
+ showSearch?: boolean;
19
+ areaType?: number;
20
+ areaSubType?: number;
21
+ }
@@ -1,5 +1,5 @@
1
- .yot-cascader {
2
- .ant-cascader-menu-item[aria-checked='true'] {
3
- background-color: var(--ant-color-primary-bg);
4
- }
5
- }
1
+ .yot-cascader {
2
+ .ant-cascader-menu-item[aria-checked='true'] {
3
+ background-color: var(--ant-color-primary-bg);
4
+ }
5
+ }