yootd 0.2.1 → 0.2.2

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.
@@ -17,6 +17,8 @@ export var Areas = function Areas(_ref) {
17
17
  placeholder = _ref$placeholder === void 0 ? ['请选择学校', '请选择校区', '请选择楼栋', '请选择楼层', '请选择房间'] : _ref$placeholder,
18
18
  _ref$level = _ref.level1,
19
19
  level1 = _ref$level === void 0 ? true : _ref$level,
20
+ _ref$level2 = _ref.level5,
21
+ level5 = _ref$level2 === void 0 ? true : _ref$level2,
20
22
  areaType = _ref.areaType,
21
23
  areaSubType = _ref.areaSubType,
22
24
  _ref$disabled = _ref.disabled,
@@ -117,7 +119,7 @@ export var Areas = function Areas(_ref) {
117
119
  }
118
120
  });
119
121
  },
120
- enabled: level4Value != null
122
+ enabled: level4Value != null && level5
121
123
  }),
122
124
  level5AreaData = _useQuery5.data;
123
125
  // 将level1位置树处理成下拉框
@@ -170,6 +172,18 @@ export var Areas = function Areas(_ref) {
170
172
  };
171
173
  });
172
174
  }, [level5AreaData]);
175
+ // 搜索框宽度
176
+ var searchWidth = useMemo(function () {
177
+ if (level1 && level5) {
178
+ return '20%';
179
+ } else if (level1 && !level5) {
180
+ return '25%';
181
+ } else if (!level1 && level5) {
182
+ return '25%';
183
+ } else {
184
+ return '33.3%';
185
+ }
186
+ }, [level1, level5]);
173
187
  // level1选择事件
174
188
  var changeLevel1Select = function changeLevel1Select(value) {
175
189
  setLevel1Value(value);
@@ -253,7 +267,7 @@ export var Areas = function Areas(_ref) {
253
267
  showSearch: showSearch,
254
268
  optionFilterProp: "label",
255
269
  style: {
256
- width: level1 ? '20%' : '25%',
270
+ width: searchWidth,
257
271
  height: style === null || style === void 0 ? void 0 : style.height
258
272
  },
259
273
  options: level1AreaOptions,
@@ -267,7 +281,7 @@ export var Areas = function Areas(_ref) {
267
281
  showSearch: showSearch,
268
282
  optionFilterProp: "label",
269
283
  style: {
270
- width: level1 ? '20%' : '25%',
284
+ width: searchWidth,
271
285
  height: style === null || style === void 0 ? void 0 : style.height
272
286
  },
273
287
  options: level2AreaOptions,
@@ -281,7 +295,7 @@ export var Areas = function Areas(_ref) {
281
295
  showSearch: showSearch,
282
296
  optionFilterProp: "label",
283
297
  style: {
284
- width: level1 ? '20%' : '25%',
298
+ width: searchWidth,
285
299
  height: style === null || style === void 0 ? void 0 : style.height
286
300
  },
287
301
  options: level3AreaOptions,
@@ -291,24 +305,24 @@ export var Areas = function Areas(_ref) {
291
305
  }), /*#__PURE__*/React.createElement(Select, {
292
306
  value: level4Value,
293
307
  allowClear: allowClear,
294
- className: "".concat(mb.b('areas-select')),
308
+ className: "".concat(level5 ? mb.b('areas-select') : ''),
295
309
  showSearch: showSearch,
296
310
  optionFilterProp: "label",
297
311
  style: {
298
- width: level1 ? '20%' : '25%',
312
+ width: searchWidth,
299
313
  height: style === null || style === void 0 ? void 0 : style.height
300
314
  },
301
315
  options: level4AreaOptions,
302
316
  onChange: changeLevel4Select,
303
317
  placeholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder[3],
304
318
  disabled: disabled
305
- }), /*#__PURE__*/React.createElement(Select, {
319
+ }), level5 && /*#__PURE__*/React.createElement(Select, {
306
320
  value: level5Value,
307
321
  allowClear: allowClear,
308
322
  showSearch: showSearch,
309
323
  optionFilterProp: "label",
310
324
  style: {
311
- width: level1 ? '20%' : '25%',
325
+ width: searchWidth,
312
326
  height: style === null || style === void 0 ? void 0 : style.height
313
327
  },
314
328
  options: level5AreaOptions,
@@ -9,6 +9,7 @@ export interface PageData<T> {
9
9
  }
10
10
  type SchoolProps = {
11
11
  level1?: boolean;
12
+ level5?: boolean;
12
13
  areaType?: number;
13
14
  areaSubType?: number;
14
15
  style?: React.CSSProperties;
package/package.json CHANGED
@@ -1,91 +1,91 @@
1
- {
2
- "name": "yootd",
3
- "version": "0.2.1",
4
- "description": "基于 Antd 二次开发的组件库",
5
- "license": "MIT",
6
- "module": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "files": [
9
- "dist"
10
- ],
11
- "scripts": {
12
- "build": "father build",
13
- "build:watch": "father dev",
14
- "dev": "dumi dev",
15
- "docs:build": "dumi build",
16
- "docs:preview": "dumi preview",
17
- "doctor": "father doctor",
18
- "lint": "npm run lint:es && npm run lint:css",
19
- "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
20
- "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
21
- "prepare": "husky install && dumi setup",
22
- "prepublishOnly": "father doctor && npm run build",
23
- "start": "npm run dev"
24
- },
25
- "commitlint": {
26
- "extends": [
27
- "@commitlint/config-conventional"
28
- ]
29
- },
30
- "lint-staged": {
31
- "*.{md,json}": [
32
- "prettier --write --no-error-on-unmatched-pattern"
33
- ],
34
- "*.{css,less}": [
35
- "stylelint --fix",
36
- "prettier --write"
37
- ],
38
- "*.{js,jsx}": [
39
- "eslint --fix",
40
- "prettier --write"
41
- ],
42
- "*.{ts,tsx}": [
43
- "eslint --fix",
44
- "prettier --parser=typescript --write"
45
- ]
46
- },
47
- "dependencies": {
48
- "@babel/runtime": "^7.26.9"
49
- },
50
- "devDependencies": {
51
- "@commitlint/cli": "^17.1.2",
52
- "@commitlint/config-conventional": "^17.1.0",
53
- "@types/lodash": "^4.17.12",
54
- "@types/react": "^18.0.0",
55
- "@types/react-dom": "^18.0.0",
56
- "@umijs/lint": "^4.0.0",
57
- "dumi": "^2.3.0",
58
- "dumi-theme-antd": "^0.4.2",
59
- "eslint": "^8.23.0",
60
- "father": "^4.1.0",
61
- "husky": "^8.0.1",
62
- "lint-staged": "^13.0.3",
63
- "prettier": "^2.7.1",
64
- "prettier-plugin-organize-imports": "^3.0.0",
65
- "prettier-plugin-packagejson": "^2.2.18",
66
- "sass": "^1.80.0",
67
- "stylelint": "^14.9.1"
68
- },
69
- "peerDependencies": {
70
- "@dnd-kit/core": ">=6.1.0",
71
- "@dnd-kit/modifiers": ">=7.0.0",
72
- "@dnd-kit/sortable": ">=8.0.0",
73
- "@dnd-kit/utilities": ">=3.2.2",
74
- "@tanstack/react-query": ">=5.59.15",
75
- "@tensorflow-models/pose-detection": ">=2.1.3",
76
- "@tensorflow/tfjs": ">=4.22.0",
77
- "@vladmandic/face-api": ">=1.7.14",
78
- "@xyflow/react": ">=12.3.3",
79
- "antd": ">=5.21.4",
80
- "axios": ">=1.7.7",
81
- "dayjs": ">=1.11.13",
82
- "lodash": ">=4.17.21",
83
- "react": ">=18.0.0",
84
- "react-dom": ">=18.0.0",
85
- "yootd-webrtc-sdk": ">=1.0.1"
86
- },
87
- "publishConfig": {
88
- "access": "public"
89
- },
90
- "authors": []
91
- }
1
+ {
2
+ "name": "yootd",
3
+ "version": "0.2.2",
4
+ "description": "基于 Antd 二次开发的组件库",
5
+ "license": "MIT",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "scripts": {
12
+ "build": "father build",
13
+ "build:watch": "father dev",
14
+ "dev": "dumi dev",
15
+ "docs:build": "dumi build",
16
+ "docs:preview": "dumi preview",
17
+ "doctor": "father doctor",
18
+ "lint": "npm run lint:es && npm run lint:css",
19
+ "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
20
+ "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
21
+ "prepare": "husky install && dumi setup",
22
+ "prepublishOnly": "father doctor && npm run build",
23
+ "start": "npm run dev"
24
+ },
25
+ "commitlint": {
26
+ "extends": [
27
+ "@commitlint/config-conventional"
28
+ ]
29
+ },
30
+ "lint-staged": {
31
+ "*.{md,json}": [
32
+ "prettier --write --no-error-on-unmatched-pattern"
33
+ ],
34
+ "*.{css,less}": [
35
+ "stylelint --fix",
36
+ "prettier --write"
37
+ ],
38
+ "*.{js,jsx}": [
39
+ "eslint --fix",
40
+ "prettier --write"
41
+ ],
42
+ "*.{ts,tsx}": [
43
+ "eslint --fix",
44
+ "prettier --parser=typescript --write"
45
+ ]
46
+ },
47
+ "dependencies": {
48
+ "@babel/runtime": "^7.26.9"
49
+ },
50
+ "devDependencies": {
51
+ "@commitlint/cli": "^17.1.2",
52
+ "@commitlint/config-conventional": "^17.1.0",
53
+ "@types/lodash": "^4.17.12",
54
+ "@types/react": "^18.0.0",
55
+ "@types/react-dom": "^18.0.0",
56
+ "@umijs/lint": "^4.0.0",
57
+ "dumi": "^2.3.0",
58
+ "dumi-theme-antd": "^0.4.2",
59
+ "eslint": "^8.23.0",
60
+ "father": "^4.1.0",
61
+ "husky": "^8.0.1",
62
+ "lint-staged": "^13.0.3",
63
+ "prettier": "^2.7.1",
64
+ "prettier-plugin-organize-imports": "^3.0.0",
65
+ "prettier-plugin-packagejson": "^2.2.18",
66
+ "sass": "^1.80.0",
67
+ "stylelint": "^14.9.1"
68
+ },
69
+ "peerDependencies": {
70
+ "@dnd-kit/core": ">=6.1.0",
71
+ "@dnd-kit/modifiers": ">=7.0.0",
72
+ "@dnd-kit/sortable": ">=8.0.0",
73
+ "@dnd-kit/utilities": ">=3.2.2",
74
+ "@tanstack/react-query": ">=5.59.15",
75
+ "@tensorflow-models/pose-detection": ">=2.1.3",
76
+ "@tensorflow/tfjs": ">=4.22.0",
77
+ "@vladmandic/face-api": ">=1.7.14",
78
+ "@xyflow/react": ">=12.3.3",
79
+ "antd": ">=5.21.4",
80
+ "axios": ">=1.7.7",
81
+ "dayjs": ">=1.11.13",
82
+ "lodash": ">=4.17.21",
83
+ "react": ">=18.0.0",
84
+ "react-dom": ">=18.0.0",
85
+ "yootd-webrtc-sdk": ">=1.0.1"
86
+ },
87
+ "publishConfig": {
88
+ "access": "public"
89
+ },
90
+ "authors": []
91
+ }