yootd 0.0.59 → 0.0.60

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.
@@ -14,11 +14,11 @@ import { Background, ReactFlow } from '@xyflow/react';
14
14
  import '@xyflow/react/dist/style.css';
15
15
  import React, { useEffect, useState } from 'react';
16
16
  import { useBem } from "../hooks/useBem";
17
+ import "./index.scss";
17
18
  import Phone from "./components/preview/phone";
18
19
  import Web from "./components/preview/web";
19
20
  import Controls from "./components/reactflow/Controls";
20
21
  import TopPreview from "./components/reactflow/TopPreview";
21
- import "./index.scss";
22
22
  export var Preview = function Preview(_ref) {
23
23
  var _ref$controls = _ref.controls,
24
24
  controls = _ref$controls === void 0 ? true : _ref$controls,
@@ -7,8 +7,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import { useQuery } from '@tanstack/react-query';
8
8
  import React, { useEffect, useMemo, useState } from 'react';
9
9
  import { Select } from "./..";
10
- import { useRequest } from "../hooks/useRequest";
11
10
  import { useBem } from "../hooks/useBem";
11
+ import { useRequest } from "../hooks/useRequest";
12
12
  import "./index.scss";
13
13
  export var Areas = function Areas(_ref) {
14
14
  var style = _ref.style,
@@ -15,10 +15,10 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
15
15
  import { useQuery } from '@tanstack/react-query';
16
16
  import { TreeSelect } from 'antd';
17
17
  import React, { useMemo, useState } from 'react';
18
+ var SHOW_PARENT = TreeSelect.SHOW_PARENT;
18
19
  import { useBem } from "../hooks/useBem";
19
20
  import { useRequest } from "../hooks/useRequest";
20
21
  import "./index.scss";
21
- var SHOW_PARENT = TreeSelect.SHOW_PARENT;
22
22
  export var AreasTreeSelect = function AreasTreeSelect(_ref) {
23
23
  var _ref$depth = _ref.depth,
24
24
  depth = _ref$depth === void 0 ? 5 : _ref$depth,
@@ -53,7 +53,12 @@ var SortableItem = function SortableItem(_ref) {
53
53
  className: "".concat(mb.b('content'), " ").concat(id === activeKey ? "".concat(mb.e('content-active')) : ''),
54
54
  key: id,
55
55
  onClick: function onClick() {
56
- _onClick === null || _onClick === void 0 || _onClick(id);
56
+ _onClick === null || _onClick === void 0 || _onClick(id, {
57
+ key: id,
58
+ title: title,
59
+ extra: extra,
60
+ checked: checked
61
+ });
57
62
  }
58
63
  }, /*#__PURE__*/React.createElement("div", {
59
64
  className: "".concat(top)
@@ -86,8 +91,17 @@ var SortableItem = function SortableItem(_ref) {
86
91
  opacity: id === activeKey ? 1 : 0,
87
92
  display: editBtnIcon ? 'block' : 'none'
88
93
  },
89
- onClick: function onClick() {
90
- return onEdit === null || onEdit === void 0 ? void 0 : onEdit(id);
94
+ onClick: function onClick(e) {
95
+ if (id !== activeKey) {
96
+ return;
97
+ }
98
+ e.stopPropagation();
99
+ onEdit === null || onEdit === void 0 || onEdit(id, {
100
+ key: id,
101
+ title: title,
102
+ extra: extra,
103
+ checked: checked
104
+ });
91
105
  }
92
106
  }, /*#__PURE__*/React.createElement(EditBtnIcon, {
93
107
  className: "".concat(top.b('top-middle').b('top-edit-btn-icon').e('edit-btn-icon-svg'))
@@ -97,8 +111,17 @@ var SortableItem = function SortableItem(_ref) {
97
111
  opacity: id === activeKey ? 1 : 0,
98
112
  display: delBtnIcon ? 'block' : 'none'
99
113
  },
100
- onClick: function onClick() {
101
- return onDel === null || onDel === void 0 ? void 0 : onDel(id);
114
+ onClick: function onClick(e) {
115
+ if (id !== activeKey) {
116
+ return;
117
+ }
118
+ e.stopPropagation();
119
+ onDel === null || onDel === void 0 || onDel(id, {
120
+ key: id,
121
+ title: title,
122
+ extra: extra,
123
+ checked: checked
124
+ });
102
125
  }
103
126
  }, /*#__PURE__*/React.createElement(DelBtnIcon, {
104
127
  className: "".concat(top.b('top-middle').b('top-del-btn-icon').e('del-btn-icon-svg'))
@@ -64,10 +64,10 @@ export var Aside = function Aside(_ref) {
64
64
  coordinateGetter: sortableKeyboardCoordinates
65
65
  }));
66
66
  // 切换选中项
67
- var handleClick = function handleClick(key) {
67
+ var handleClick = function handleClick(key, e) {
68
68
  if (key != null) {
69
69
  setKey(key);
70
- onClick === null || onClick === void 0 || onClick(key);
70
+ onClick === null || onClick === void 0 || onClick(key, e);
71
71
  }
72
72
  };
73
73
  // 添加
@@ -75,12 +75,12 @@ export var Aside = function Aside(_ref) {
75
75
  onAdd === null || onAdd === void 0 || onAdd();
76
76
  };
77
77
  // 编辑
78
- var handleEdit = function handleEdit(key) {
79
- onEdit === null || onEdit === void 0 || onEdit(key);
78
+ var handleEdit = function handleEdit(key, e) {
79
+ onEdit === null || onEdit === void 0 || onEdit(key, e);
80
80
  };
81
81
  // 删除
82
- var handleDel = function handleDel(key) {
83
- onDel === null || onDel === void 0 || onDel(key);
82
+ var handleDel = function handleDel(key, e) {
83
+ onDel === null || onDel === void 0 || onDel(key, e);
84
84
  };
85
85
  // 开关
86
86
  var handleSwitch = function handleSwitch(key, e) {
@@ -17,10 +17,10 @@ export type AsideProps = {
17
17
  delBtnIcon?: boolean;
18
18
  switchBtnIcon?: boolean;
19
19
  dragBtnIcon?: boolean;
20
- onClick?: (key: string) => void;
20
+ onClick?: (key: string, e: IdataItem) => void;
21
21
  onAdd?: () => void;
22
- onEdit?: (key: string) => void;
23
- onDel?: (key: string) => void;
22
+ onEdit?: (key: string, e: IdataItem) => void;
23
+ onDel?: (key: string, e: IdataItem) => void;
24
24
  onSwitch?: (
25
25
  changeValue: { key: string; checked: boolean },
26
26
  data: IdataItem[],
@@ -37,8 +37,8 @@ export type AsideItemProps = {
37
37
  dragBtnIcon?: boolean;
38
38
  checked?: boolean;
39
39
  extra?: string;
40
- onClick?: (key: string) => void;
41
- onEdit?: (key: string) => void;
42
- onDel?: (key: string) => void;
40
+ onClick?: (key: string, e: IdataItem) => void;
41
+ onEdit?: (key: string, e: IdataItem) => void;
42
+ onDel?: (key: string, e: IdataItem) => void;
43
43
  onSwitch?: (key: string, e: boolean) => void;
44
44
  };
@@ -7,9 +7,9 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import { Dropdown } from 'antd';
8
8
  import React, { useState } from 'react';
9
9
  import { useBem } from "../hooks/useBem";
10
+ import "./index.scss";
10
11
  import { DownIcon } from "./components/DownIcon";
11
12
  import { UpIcon } from "./components/UpIcon";
12
- import "./index.scss";
13
13
  export var Export = function Export(_ref) {
14
14
  var _ref$items = _ref.items,
15
15
  items = _ref$items === void 0 ? [{
@@ -17,8 +17,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
17
17
  import { useQuery } from '@tanstack/react-query';
18
18
  import React, { useEffect, useMemo, useState } from 'react';
19
19
  import { Select } from "./..";
20
- import { useRequest } from "../hooks/useRequest";
21
20
  import { useBem } from "../hooks/useBem";
21
+ import { useRequest } from "../hooks/useRequest";
22
22
  import "./index.scss";
23
23
  export var School = function School(_ref) {
24
24
  var _ref$type = _ref.type,
@@ -11,8 +11,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
11
11
  import { useQuery } from '@tanstack/react-query';
12
12
  import React, { useEffect, useMemo, useState } from 'react';
13
13
  import { Select } from "./..";
14
- import { useRequest } from "../hooks/useRequest";
15
14
  import { useBem } from "../hooks/useBem";
15
+ import { useRequest } from "../hooks/useRequest";
16
16
  import "./index.scss";
17
17
  export var YearTerm = function YearTerm(_ref) {
18
18
  var _ref$type = _ref.type,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yootd",
3
- "version": "0.0.59",
3
+ "version": "0.0.60",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",