yootd 0.2.18 → 0.2.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aside/components/SortableItem.js +11 -6
- package/dist/aside/components/SortableItem.scss +7 -3
- package/dist/aside/index.js +3 -1
- package/dist/aside/types/types.d.ts +8 -0
- package/dist/zones/index.d.ts +1 -0
- package/dist/zones/index.js +6 -4
- package/dist/zones/index.scss +21 -0
- package/package.json +1 -1
- package/dist/zones/index.module.scss +0 -23
@@ -34,7 +34,11 @@ var SortableItem = function SortableItem(_ref) {
|
|
34
34
|
subId = _ref.subId,
|
35
35
|
isSubNode = _ref.isSubNode,
|
36
36
|
subNode = _ref.subNode,
|
37
|
-
onSubClick = _ref.onSubClick
|
37
|
+
onSubClick = _ref.onSubClick,
|
38
|
+
_ref$showEditBtn = _ref.showEditBtn,
|
39
|
+
showEditBtn = _ref$showEditBtn === void 0 ? true : _ref$showEditBtn,
|
40
|
+
_ref$showDelBtn = _ref.showDelBtn,
|
41
|
+
showDelBtn = _ref$showDelBtn === void 0 ? true : _ref$showDelBtn;
|
38
42
|
var _useSortable = useSortable({
|
39
43
|
id: id
|
40
44
|
}),
|
@@ -44,7 +48,6 @@ var SortableItem = function SortableItem(_ref) {
|
|
44
48
|
transform = _useSortable.transform,
|
45
49
|
transition = _useSortable.transition,
|
46
50
|
isDragging = _useSortable.isDragging;
|
47
|
-
console.log(statusColor[status !== null && status !== void 0 ? status : '']);
|
48
51
|
var style = _objectSpread({
|
49
52
|
transform: CSS.Transform.toString(transform),
|
50
53
|
transition: transition
|
@@ -92,11 +95,13 @@ var SortableItem = function SortableItem(_ref) {
|
|
92
95
|
marginLeft: dragBtnIcon ? '6px' : '0'
|
93
96
|
}
|
94
97
|
}, title))), /*#__PURE__*/React.createElement("div", {
|
98
|
+
className: "".concat(top.b('top-right'))
|
99
|
+
}, /*#__PURE__*/React.createElement("div", {
|
95
100
|
className: "".concat(top.b('top-middle')),
|
96
101
|
style: {
|
97
102
|
marginLeft: editBtnIcon || delBtnIcon ? '12px' : 0
|
98
103
|
}
|
99
|
-
}, /*#__PURE__*/React.createElement("div", {
|
104
|
+
}, showEditBtn ? /*#__PURE__*/React.createElement("div", {
|
100
105
|
className: "".concat(top.b('top-middle').b('top-edit-btn-icon')),
|
101
106
|
style: {
|
102
107
|
opacity: id === activeKey ? 1 : 0,
|
@@ -117,7 +122,7 @@ var SortableItem = function SortableItem(_ref) {
|
|
117
122
|
}
|
118
123
|
}, /*#__PURE__*/React.createElement(EditBtnIcon, {
|
119
124
|
className: "".concat(top.b('top-middle').b('top-edit-btn-icon').e('edit-btn-icon-svg'))
|
120
|
-
})), /*#__PURE__*/React.createElement("div", {
|
125
|
+
})) : null, showDelBtn ? /*#__PURE__*/React.createElement("div", {
|
121
126
|
className: "".concat(top.b('top-middle').b('top-del-btn-icon')),
|
122
127
|
style: {
|
123
128
|
opacity: id === activeKey ? 1 : 0,
|
@@ -138,7 +143,7 @@ var SortableItem = function SortableItem(_ref) {
|
|
138
143
|
}
|
139
144
|
}, /*#__PURE__*/React.createElement(DelBtnIcon, {
|
140
145
|
className: "".concat(top.b('top-middle').b('top-del-btn-icon').e('del-btn-icon-svg'))
|
141
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
146
|
+
})) : null), /*#__PURE__*/React.createElement("div", {
|
142
147
|
style: {
|
143
148
|
display: switchBtnIcon ? 'block' : 'none',
|
144
149
|
marginLeft: switchBtnIcon ? '12px' : '0'
|
@@ -152,7 +157,7 @@ var SortableItem = function SortableItem(_ref) {
|
|
152
157
|
onChange: function onChange(e) {
|
153
158
|
onSwitch === null || onSwitch === void 0 || onSwitch(id, e);
|
154
159
|
}
|
155
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
160
|
+
})))), /*#__PURE__*/React.createElement("div", {
|
156
161
|
className: "".concat(mb.b('content').b('bottom')),
|
157
162
|
style: {
|
158
163
|
marginLeft: dragBtnIcon ? '22px' : '0'
|
@@ -54,6 +54,9 @@
|
|
54
54
|
}
|
55
55
|
}
|
56
56
|
}
|
57
|
+
&-top-right {
|
58
|
+
display: flex;
|
59
|
+
}
|
57
60
|
}
|
58
61
|
&-bottom {
|
59
62
|
text-overflow: ellipsis;
|
@@ -100,11 +103,12 @@
|
|
100
103
|
-webkit-line-clamp: 2; //超出2行隐藏,并显示省略号
|
101
104
|
line-clamp: 2;
|
102
105
|
}
|
103
|
-
&__top-title-active{
|
106
|
+
&__top-title-active {
|
104
107
|
font-weight: bold;
|
105
108
|
}
|
106
109
|
}
|
107
110
|
}
|
111
|
+
|
108
112
|
&-top-middle {
|
109
113
|
display: flex;
|
110
114
|
align-items: center;
|
@@ -150,7 +154,7 @@
|
|
150
154
|
background-color: #e5e5e5;
|
151
155
|
z-index: 100;
|
152
156
|
}
|
153
|
-
&-content-no-bg::before{
|
157
|
+
&-content-no-bg::before {
|
154
158
|
content: '';
|
155
159
|
position: absolute;
|
156
160
|
bottom: -0.5px;
|
@@ -194,7 +198,7 @@
|
|
194
198
|
box-sizing: border-box;
|
195
199
|
cursor: pointer;
|
196
200
|
background-color: #fff;
|
197
|
-
border-bottom:1 px solid
|
201
|
+
border-bottom: 1 px solid;
|
198
202
|
&-top {
|
199
203
|
display: flex;
|
200
204
|
justify-content: space-between;
|
package/dist/aside/index.js
CHANGED
@@ -231,7 +231,9 @@ export var Aside = function Aside(_ref) {
|
|
231
231
|
status: item.status,
|
232
232
|
subId: subKey !== null && subKey !== void 0 ? subKey : (_item$children = item.children) === null || _item$children === void 0 || (_item$children = _item$children[0]) === null || _item$children === void 0 ? void 0 : _item$children.key,
|
233
233
|
isSubNode: isSubNode,
|
234
|
-
subNode: item.children
|
234
|
+
subNode: item.children,
|
235
|
+
showDelBtn: item.showDelBtn,
|
236
|
+
showEditBtn: item.showEditBtn
|
235
237
|
});
|
236
238
|
})))));
|
237
239
|
};
|
@@ -6,6 +6,8 @@ type IdataItem = {
|
|
6
6
|
checked?: boolean;
|
7
7
|
status?: string;
|
8
8
|
data?: any;
|
9
|
+
showEditBtn?: boolean;
|
10
|
+
showDelBtn?: boolean;
|
9
11
|
children?: Array<{
|
10
12
|
key: string;
|
11
13
|
title: string;
|
@@ -13,6 +15,8 @@ type IdataItem = {
|
|
13
15
|
checked?: boolean;
|
14
16
|
status?: string;
|
15
17
|
data?: any;
|
18
|
+
showEditBtn?: boolean;
|
19
|
+
showDelBtn?: boolean;
|
16
20
|
}>;
|
17
21
|
};
|
18
22
|
export type AsideProps = {
|
@@ -56,6 +60,8 @@ export type AsideItemProps = {
|
|
56
60
|
extra?: string;
|
57
61
|
status?: string;
|
58
62
|
data?: any;
|
63
|
+
showEditBtn?: boolean;
|
64
|
+
showDelBtn?: boolean;
|
59
65
|
onClick?: (key: string | undefined, e: IdataItem) => void;
|
60
66
|
onEdit?: (key: string, e: IdataItem) => void;
|
61
67
|
onDel?: (key: string, e: IdataItem) => void;
|
@@ -69,6 +75,8 @@ export type AsideItemProps = {
|
|
69
75
|
checked?: boolean;
|
70
76
|
status?: string;
|
71
77
|
data?: any;
|
78
|
+
showEditBtn?: boolean;
|
79
|
+
showDelBtn?: boolean;
|
72
80
|
}>;
|
73
81
|
onSubClick?: (key, subKey: string | undefined, e: IdataItem) => void;
|
74
82
|
};
|
package/dist/zones/index.d.ts
CHANGED
package/dist/zones/index.js
CHANGED
@@ -5,7 +5,8 @@ import { useQuery } from '@tanstack/react-query';
|
|
5
5
|
import React, { useEffect, useState } from 'react';
|
6
6
|
import { Select } from "./..";
|
7
7
|
import { useRequest } from "../hooks/useRequest";
|
8
|
-
import
|
8
|
+
import { useBem } from "../hooks/useBem";
|
9
|
+
import "./index.scss";
|
9
10
|
export var Zone = function Zone(_ref) {
|
10
11
|
var _allProvinceData$cont, _cityData$content, _districtData$content;
|
11
12
|
var _ref$zoneLevel = _ref.zoneLevel,
|
@@ -19,6 +20,7 @@ export var Zone = function Zone(_ref) {
|
|
19
20
|
allowClear = _ref$allowClear === void 0 ? true : _ref$allowClear,
|
20
21
|
_ref$showSearch = _ref.showSearch,
|
21
22
|
showSearch = _ref$showSearch === void 0 ? false : _ref$showSearch;
|
23
|
+
var mb = useBem('Zones');
|
22
24
|
var request = useRequest();
|
23
25
|
// 用户所选择的省市区的id数组
|
24
26
|
var _useState = useState([]),
|
@@ -129,12 +131,12 @@ export var Zone = function Zone(_ref) {
|
|
129
131
|
}
|
130
132
|
}, [value]);
|
131
133
|
return /*#__PURE__*/React.createElement("div", {
|
132
|
-
className: zoneLevel === 'province' ? '' : "".concat(
|
134
|
+
className: zoneLevel === 'province' ? '' : "".concat(mb),
|
133
135
|
style: zoneLevel === 'province' ? {} : style
|
134
136
|
}, /*#__PURE__*/React.createElement(Select, {
|
135
137
|
allowClear: allowClear,
|
136
138
|
showSearch: showSearch,
|
137
|
-
className: "zone-select
|
139
|
+
className: "".concat(mb.b('zone-select')),
|
138
140
|
value: zoneIds === null || zoneIds === void 0 ? void 0 : zoneIds[0],
|
139
141
|
onChange: changeProvince,
|
140
142
|
options: provinceOptions,
|
@@ -147,7 +149,7 @@ export var Zone = function Zone(_ref) {
|
|
147
149
|
}), zoneLevel !== 'province' ? /*#__PURE__*/React.createElement(Select, {
|
148
150
|
allowClear: allowClear,
|
149
151
|
showSearch: showSearch,
|
150
|
-
className: zoneLevel === 'city' ? '' : 'zone-select',
|
152
|
+
className: zoneLevel === 'city' ? '' : "".concat(mb.b('zone-select')),
|
151
153
|
value: zoneIds === null || zoneIds === void 0 ? void 0 : zoneIds[1],
|
152
154
|
onChange: changeCity,
|
153
155
|
options: cityOptions,
|
@@ -0,0 +1,21 @@
|
|
1
|
+
.yot-Zones {
|
2
|
+
border: var(--ant-line-width) var(--ant-line-type) var(--ant-color-border);
|
3
|
+
border-radius: var(--ant-border-radius);
|
4
|
+
&-zone-select::after {
|
5
|
+
content: '';
|
6
|
+
position: absolute;
|
7
|
+
right: 0;
|
8
|
+
top: 50%; /* 从中间开始 */
|
9
|
+
width: 1px; /* 边框宽度 */
|
10
|
+
height: 50%; /* 设为盒子高度的百分之五十 */
|
11
|
+
background-color: var(--ant-color-border); /* 边框颜色 */
|
12
|
+
transform: translateY(-50%);
|
13
|
+
}
|
14
|
+
.ant-select.ant-select-outlined.css-var-yootd.ant-select-css-var.ant-select-single.ant-select-show-arrow {
|
15
|
+
.ant-select-selector {
|
16
|
+
padding-left: var(--ant-padding);
|
17
|
+
padding-right: var(--ant-padding);
|
18
|
+
border: 0;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
package/package.json
CHANGED
@@ -1,23 +0,0 @@
|
|
1
|
-
.content {
|
2
|
-
border: var(--ant-line-width) var(--ant-line-type) var(--ant-color-border);
|
3
|
-
border-radius: var(--ant-border-radius);
|
4
|
-
:global {
|
5
|
-
.zone-select::after {
|
6
|
-
content: '';
|
7
|
-
position: absolute;
|
8
|
-
right: 0;
|
9
|
-
top: 50%; /* 从中间开始 */
|
10
|
-
width: 1px; /* 边框宽度 */
|
11
|
-
height: 50%; /* 设为盒子高度的百分之五十 */
|
12
|
-
background-color: var(--ant-color-border); /* 边框颜色 */
|
13
|
-
transform: translateY(-50%);
|
14
|
-
}
|
15
|
-
.ant-select.ant-select-outlined.css-var-yootd.ant-select-css-var.ant-select-single.ant-select-show-arrow {
|
16
|
-
.ant-select-selector {
|
17
|
-
padding-left: var(--ant-padding);
|
18
|
-
padding-right: var(--ant-padding);
|
19
|
-
border: 0;
|
20
|
-
}
|
21
|
-
}
|
22
|
-
}
|
23
|
-
}
|