@zgfe/business-lib 1.1.49-dev.0 → 1.1.50-title.0
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/es/addToPanel/components/styleList.js +1 -1
- package/es/addToPanel/demo/edit.d.ts +1 -2
- package/es/addToPanel/demo/edit.js +0 -32
- package/es/addToPanel/demo/index.d.ts +1 -2
- package/es/addToPanel/demo/index.js +1 -32
- package/es/addToPanel/index.js +22 -15
- package/es/addToPanel/types.d.ts +3 -3
- package/es/addToScene/demo/index.d.ts +1 -2
- package/es/assets/demo/input.d.ts +1 -2
- package/es/attrConditions/demo/group.d.ts +1 -2
- package/es/attrConditions/demo/index.d.ts +1 -2
- package/es/attributeSelector/demo/disable.d.ts +1 -2
- package/es/attributeSelector/demo/index.d.ts +1 -2
- package/es/chart/demo/bar.d.ts +1 -2
- package/es/chart/demo/index.d.ts +1 -2
- package/es/chart/demo/map.d.ts +1 -2
- package/es/chart/demo/pie.d.ts +1 -2
- package/es/colorIcon/demo/index.d.ts +1 -2
- package/es/constants/apis.d.ts +2 -0
- package/es/constants/apis.js +2 -0
- package/es/constants/common.d.ts +29 -0
- package/es/constants/common.js +38 -1
- package/es/cycleTime/demo/disable.d.ts +1 -2
- package/es/cycleTime/demo/index.d.ts +1 -2
- package/es/cycleTime/demo/multi.d.ts +1 -2
- package/es/datePicker/demo/customType.d.ts +1 -2
- package/es/datePicker/demo/day.d.ts +1 -2
- package/es/datePicker/demo/index.d.ts +1 -2
- package/es/demoWrapper/demo/index.d.ts +1 -2
- package/es/dialog/demo/index.d.ts +1 -2
- package/es/dnd/demo/data.d.ts +1 -2
- package/es/dnd/demo/handle.d.ts +1 -2
- package/es/dnd/demo/index.d.ts +1 -2
- package/es/eventSelector/demo/index.d.ts +1 -2
- package/es/icon/demo/index.d.ts +1 -2
- package/es/icon/demo/list.d.ts +1 -2
- package/es/index.d.ts +3 -1
- package/es/index.js +3 -1
- package/es/layout/analysisLayout/demo/index.d.ts +1 -2
- package/es/layout/detail/demo/index.d.ts +1 -2
- package/es/layout/optionTitle/components/btnMenu/api.d.ts +4 -0
- package/es/layout/optionTitle/components/btnMenu/api.js +7 -0
- package/es/layout/optionTitle/components/btnMenu/demo.d.ts +2 -0
- package/es/layout/optionTitle/components/btnMenu/demo.js +80 -0
- package/es/layout/optionTitle/components/btnMenu/index.d.ts +5 -0
- package/es/layout/optionTitle/components/btnMenu/index.js +48 -0
- package/es/layout/optionTitle/components/btnMenu/index.less +18 -0
- package/es/layout/optionTitle/components/title/demo.d.ts +2 -0
- package/es/layout/optionTitle/components/title/demo.js +50 -0
- package/es/layout/optionTitle/components/title/index.d.ts +5 -0
- package/es/layout/optionTitle/components/title/index.js +106 -0
- package/es/layout/optionTitle/components/title/index.less +42 -0
- package/es/layout/optionTitle/data.d.ts +3 -0
- package/es/layout/optionTitle/data.js +77 -0
- package/es/layout/optionTitle/demo/index.d.ts +2 -0
- package/es/layout/optionTitle/demo/index.js +84 -0
- package/es/layout/optionTitle/demo/index.less +12 -0
- package/es/layout/optionTitle/demo/layout.d.ts +3 -0
- package/es/layout/optionTitle/demo/layout.js +41 -0
- package/es/layout/optionTitle/demo/panelCreate.d.ts +2 -0
- package/es/layout/optionTitle/demo/panelCreate.js +82 -0
- package/es/layout/optionTitle/index.d.ts +6 -0
- package/es/layout/optionTitle/index.js +154 -0
- package/es/layout/optionTitle/layout.d.ts +5 -0
- package/es/layout/optionTitle/layout.js +38 -0
- package/es/layout/optionTitle/styles/index.less +19 -0
- package/es/layout/optionTitle/styles/layout.less +43 -0
- package/es/layout/optionTitle/styles/search.less +27 -0
- package/es/layout/optionTitle/types.d.ts +83 -0
- package/es/layout/optionTitle/types.js +15 -0
- package/es/layout/optionTitle/typesValue.d.ts +4 -0
- package/es/layout/optionTitle/typesValue.js +7 -0
- package/es/loginForm/demo/index.d.ts +1 -2
- package/es/searchInput/demo/index.d.ts +1 -2
- package/es/select/demo/children.d.ts +1 -2
- package/es/select/demo/customLabel.d.ts +1 -2
- package/es/select/demo/group.d.ts +1 -2
- package/es/select/demo/index.d.ts +1 -2
- package/es/select/demo/loading.d.ts +1 -2
- package/es/select/demo/multiple.d.ts +1 -2
- package/es/socket/demo/demo.d.ts +1 -2
- package/es/table/demo/index.d.ts +1 -2
- package/es/table/demo/index2.d.ts +1 -2
- package/es/table/demo/index3.d.ts +1 -2
- package/es/targetConditionGroup/demo/group.d.ts +1 -2
- package/es/targetConditionGroup/demo/index.d.ts +1 -2
- package/es/targetSelector/demo/index.d.ts +1 -2
- package/es/userCondition/conditions/business/paramsCondition.js +1 -5
- package/es/userCondition/demo/business.d.ts +1 -2
- package/es/userCondition/demo/index.d.ts +1 -2
- package/es/userGroup/demo/group.d.ts +1 -2
- package/es/userGroup/demo/index.d.ts +1 -2
- package/es/userTagsSelector/demo/index.d.ts +1 -2
- package/package.json +2 -2
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
4
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
12
|
+
import BizOptionLayout from './layout';
|
|
13
|
+
import { BizOptionTitleProps, BizTargetFromPanelContext } from './types';
|
|
14
|
+
import BizAddToPanel from '../../addToPanel';
|
|
15
|
+
import { panelBtn, panelCreateBtn } from './data';
|
|
16
|
+
import './styles/index.less';
|
|
17
|
+
import { ajax } from '../../utils';
|
|
18
|
+
import Apis from '../../constants/apis';
|
|
19
|
+
import { Spin, message } from 'antd';
|
|
20
|
+
export var classPrefix = 'biz-layout-panel';
|
|
21
|
+
var BizTargetFromPanel = function BizTargetFromPanel(props) {
|
|
22
|
+
var _props$value$target$p;
|
|
23
|
+
var _useState = useState([]),
|
|
24
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
25
|
+
options = _useState2[0],
|
|
26
|
+
setOptions = _useState2[1];
|
|
27
|
+
var _useState3 = useState(props.value.target.name || '洞察'),
|
|
28
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
29
|
+
title = _useState4[0],
|
|
30
|
+
setTitle = _useState4[1];
|
|
31
|
+
var _useState5 = useState(false),
|
|
32
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
33
|
+
showDialog = _useState6[0],
|
|
34
|
+
setShowDialog = _useState6[1];
|
|
35
|
+
var _useState7 = useState(BizOptionTitleProps.OptionTypes.SAVE),
|
|
36
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
37
|
+
saveType = _useState8[0],
|
|
38
|
+
setSaveType = _useState8[1];
|
|
39
|
+
var _useState9 = useState(false),
|
|
40
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
41
|
+
loading = _useState10[0],
|
|
42
|
+
setLoading = _useState10[1];
|
|
43
|
+
var titleRef = useRef(null);
|
|
44
|
+
useEffect(function () {
|
|
45
|
+
setOptions(props.value.target.id ? panelBtn(onClick) : panelCreateBtn(onClick));
|
|
46
|
+
}, []);
|
|
47
|
+
var onClick = function onClick(type) {
|
|
48
|
+
if (type === BizOptionTitleProps.OptionTypes.CANCEL) {
|
|
49
|
+
var param = props.value.target.id ? {
|
|
50
|
+
panelId: props.value.panelId,
|
|
51
|
+
elementId: props.value.target.id,
|
|
52
|
+
name: title
|
|
53
|
+
} : null;
|
|
54
|
+
props.afterEditTarget && props.afterEditTarget(type, param);
|
|
55
|
+
} else if (type === BizOptionTitleProps.OptionTypes.EDIT) {
|
|
56
|
+
titleRef.current.setEdit();
|
|
57
|
+
} else if (type === BizOptionTitleProps.OptionTypes.DELETE) {
|
|
58
|
+
onDelete();
|
|
59
|
+
} else {
|
|
60
|
+
setShowDialog(true);
|
|
61
|
+
setSaveType(type);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var onDelete = function onDelete() {
|
|
65
|
+
setLoading(true);
|
|
66
|
+
ajax(Apis.delPanelElement, {
|
|
67
|
+
method: 'post',
|
|
68
|
+
data: {
|
|
69
|
+
panel_id: props.value.panelId,
|
|
70
|
+
element_id: props.value.target.id
|
|
71
|
+
}
|
|
72
|
+
}).then(function (res) {
|
|
73
|
+
if (!res) return;
|
|
74
|
+
if (res.flag === 101) {
|
|
75
|
+
message.success('删除成功');
|
|
76
|
+
props.afterEditTarget && props.afterEditTarget(BizOptionTitleProps.OptionTypes.DELETE);
|
|
77
|
+
} else {
|
|
78
|
+
message.error('删除失败');
|
|
79
|
+
}
|
|
80
|
+
}).finally(function () {
|
|
81
|
+
setLoading(false);
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
var onService = function onService(value, callback) {
|
|
85
|
+
setTitle(value);
|
|
86
|
+
setBtnOptions(!value);
|
|
87
|
+
if (!value) return;
|
|
88
|
+
setLoading(true);
|
|
89
|
+
ajax(Apis.updateElementName, {
|
|
90
|
+
method: 'post',
|
|
91
|
+
data: {
|
|
92
|
+
panel_id: props.value.panelId,
|
|
93
|
+
element_id: props.value.target.id,
|
|
94
|
+
name: value
|
|
95
|
+
}
|
|
96
|
+
}).then(function (res) {
|
|
97
|
+
if (!res) return;
|
|
98
|
+
callback(res.flag !== 101);
|
|
99
|
+
}).finally(function () {
|
|
100
|
+
callback(true, '');
|
|
101
|
+
setLoading(false);
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
var onCancel = function onCancel() {
|
|
105
|
+
setShowDialog(false);
|
|
106
|
+
};
|
|
107
|
+
var onPanelSave = function onPanelSave(data) {
|
|
108
|
+
setShowDialog(false);
|
|
109
|
+
props.afterEditTarget && props.afterEditTarget(BizOptionTitleProps.OptionTypes.PANEL, data);
|
|
110
|
+
};
|
|
111
|
+
var setBtnOptions = function setBtnOptions(disabled) {
|
|
112
|
+
setOptions(function (option) {
|
|
113
|
+
if (!option.length) return [];
|
|
114
|
+
option[option.length - 1].disabled = disabled;
|
|
115
|
+
if (props.value.target.id) {
|
|
116
|
+
option[option.length - 2].disabled = disabled;
|
|
117
|
+
}
|
|
118
|
+
return _toConsumableArray(option);
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
return /*#__PURE__*/React.createElement(BizTargetFromPanelContext.Provider, {
|
|
122
|
+
value: {
|
|
123
|
+
handleSearch: setBtnOptions
|
|
124
|
+
}
|
|
125
|
+
}, /*#__PURE__*/React.createElement(Spin, {
|
|
126
|
+
spinning: loading
|
|
127
|
+
}, /*#__PURE__*/React.createElement(BizOptionLayout, {
|
|
128
|
+
ref: titleRef,
|
|
129
|
+
value: title,
|
|
130
|
+
options: options,
|
|
131
|
+
isInput: true,
|
|
132
|
+
onService: onService,
|
|
133
|
+
onChange: setTitle,
|
|
134
|
+
onBack: function onBack() {
|
|
135
|
+
return onClick(BizOptionTitleProps.OptionTypes.CANCEL);
|
|
136
|
+
}
|
|
137
|
+
}, props.children, showDialog && /*#__PURE__*/React.createElement(BizAddToPanel, {
|
|
138
|
+
defaultValue: {
|
|
139
|
+
panel: {
|
|
140
|
+
id: props.value.panelId
|
|
141
|
+
},
|
|
142
|
+
name: saveType === BizOptionTitleProps.OptionTypes.SAVE_AS ? title + '(1)' : title,
|
|
143
|
+
chartType: ((_props$value$target$p = props.value.target.params) === null || _props$value$target$p === void 0 ? void 0 : _props$value$target$p.chartType) || 'line',
|
|
144
|
+
showList: 'fix'
|
|
145
|
+
},
|
|
146
|
+
type: props.value.target.id && saveType === BizOptionTitleProps.OptionTypes.SAVE ? BizOptionTitleProps.OptionTypes.EDIT : BizOptionTitleProps.OptionTypes.CREATE,
|
|
147
|
+
params: props.value.target.params,
|
|
148
|
+
elementId: props.value.target.id,
|
|
149
|
+
showList: props.value.target.showList,
|
|
150
|
+
onCancel: onCancel,
|
|
151
|
+
onOk: onPanelSave
|
|
152
|
+
}))));
|
|
153
|
+
};
|
|
154
|
+
export default BizTargetFromPanel;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconFont } from '../..';
|
|
3
|
+
import BizEditText from './components/title';
|
|
4
|
+
import './styles/layout.less';
|
|
5
|
+
import BizBtnMenu from './components/btnMenu';
|
|
6
|
+
var BizOptionLayout = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
7
|
+
var className = props.className;
|
|
8
|
+
var classPrefix = 'biz-option-layout';
|
|
9
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
10
|
+
className: "".concat(classPrefix, " ").concat(className)
|
|
11
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
className: "".concat(classPrefix, "-header")
|
|
13
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: "".concat(classPrefix, "-header-title")
|
|
15
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
className: "".concat(classPrefix, "-header-title-text")
|
|
17
|
+
}, props.backExtra || /*#__PURE__*/React.createElement("a", {
|
|
18
|
+
onClick: props.onBack,
|
|
19
|
+
className: "".concat(classPrefix, "-header-title-btn")
|
|
20
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
21
|
+
type: "fanhuiicon"
|
|
22
|
+
}), "\u8FD4\u56DE")), /*#__PURE__*/React.createElement(BizEditText, {
|
|
23
|
+
ref: ref,
|
|
24
|
+
name: props.name,
|
|
25
|
+
value: props.value,
|
|
26
|
+
max: props.max,
|
|
27
|
+
isInput: props.isInput,
|
|
28
|
+
canEdit: props.canEdit,
|
|
29
|
+
onChange: props.onChange,
|
|
30
|
+
onService: props.onService
|
|
31
|
+
})), props.extra, /*#__PURE__*/React.createElement(BizBtnMenu, {
|
|
32
|
+
className: props.optionClass,
|
|
33
|
+
menu: props.options || []
|
|
34
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
className: "".concat(classPrefix, "-content")
|
|
36
|
+
}, props.children));
|
|
37
|
+
});
|
|
38
|
+
export default BizOptionLayout;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@import '~@zgfe/business-lib/es/assets/styles/inner.less';
|
|
2
|
+
|
|
3
|
+
.biz-layout-panel {
|
|
4
|
+
/*更多按钮*/
|
|
5
|
+
&-btn-more {
|
|
6
|
+
width: @height-base;
|
|
7
|
+
height: @height-base;
|
|
8
|
+
color: @text-color-secondary;
|
|
9
|
+
font-size: 16px;
|
|
10
|
+
line-height: @height-base;
|
|
11
|
+
text-align: center;
|
|
12
|
+
border-radius: @border-radius-small;
|
|
13
|
+
transform: rotate(90deg);
|
|
14
|
+
|
|
15
|
+
&:hover {
|
|
16
|
+
.__default-hover();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
@import '~@zgfe/business-lib/es/assets/styles/variable.less';
|
|
2
|
+
|
|
3
|
+
.biz-option-layout {
|
|
4
|
+
height: 100%;
|
|
5
|
+
background-color: #fff;
|
|
6
|
+
border-radius: @border-radius-normal;
|
|
7
|
+
&-header {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: 64px;
|
|
13
|
+
padding: 0 16px;
|
|
14
|
+
border-bottom: 1px solid @border-color-base;
|
|
15
|
+
|
|
16
|
+
&-title {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
&-text {
|
|
20
|
+
margin-right: @margin-md;
|
|
21
|
+
color: @text-color-secondary;
|
|
22
|
+
}
|
|
23
|
+
&-btn {
|
|
24
|
+
color: @text-color-secondary;
|
|
25
|
+
&:hover {
|
|
26
|
+
color: @primary-color;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
&-option {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex: 1;
|
|
33
|
+
flex-direction: row-reverse;
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-content: space-between;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&-content {
|
|
40
|
+
width: 100%;
|
|
41
|
+
height: calc(100% - 64px);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@import '~@zgfe/business-lib/es/assets/styles/inner.less';
|
|
2
|
+
|
|
3
|
+
.search-title {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
height: 24px;
|
|
7
|
+
transition: all 0.3s;
|
|
8
|
+
|
|
9
|
+
&-title {
|
|
10
|
+
margin-right: 15px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&-input {
|
|
14
|
+
min-width: 100px;
|
|
15
|
+
max-width: 200px;
|
|
16
|
+
height: 24px;
|
|
17
|
+
background-color: #fff !important;
|
|
18
|
+
.ant-input {
|
|
19
|
+
background-color: #fff !important;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&-icon {
|
|
24
|
+
color: #5f6085;
|
|
25
|
+
font-size: 12px;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare namespace BizOptionTitleProps {
|
|
3
|
+
export interface Props {
|
|
4
|
+
value: Value;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
afterEditTarget?: (type: string, value?: any) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface Value {
|
|
9
|
+
panelId: number;
|
|
10
|
+
target: TargetValue;
|
|
11
|
+
}
|
|
12
|
+
export interface TargetValue {
|
|
13
|
+
id?: number;
|
|
14
|
+
name?: string;
|
|
15
|
+
params: Record<string, any>;
|
|
16
|
+
showList?: string[];
|
|
17
|
+
}
|
|
18
|
+
export interface LayoutProps extends CommonProps {
|
|
19
|
+
}
|
|
20
|
+
interface CommonProps extends TitleProps {
|
|
21
|
+
options?: BtnItem[];
|
|
22
|
+
optionClass?: string;
|
|
23
|
+
className?: string;
|
|
24
|
+
extra?: React.ReactNode;
|
|
25
|
+
backExtra?: React.ReactNode;
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
onBack?: () => void;
|
|
28
|
+
}
|
|
29
|
+
export enum OptionTypes {
|
|
30
|
+
SAVE = "save",
|
|
31
|
+
SAVE_AS = "saveAs",
|
|
32
|
+
DELETE = "delete",
|
|
33
|
+
CANCEL = "cancel",
|
|
34
|
+
EDIT = "edit",
|
|
35
|
+
CREATE = "create",
|
|
36
|
+
PANEL = "panel"
|
|
37
|
+
}
|
|
38
|
+
export interface OptionProps {
|
|
39
|
+
title?: string;
|
|
40
|
+
type?: string;
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
onClick: (type: OptionTypes) => void;
|
|
43
|
+
}
|
|
44
|
+
export interface TitleProps {
|
|
45
|
+
name?: string;
|
|
46
|
+
value?: string;
|
|
47
|
+
max?: number;
|
|
48
|
+
isInput?: boolean;
|
|
49
|
+
canEdit?: boolean;
|
|
50
|
+
required?: boolean;
|
|
51
|
+
width?: number;
|
|
52
|
+
onChange?: (value: string) => void;
|
|
53
|
+
onService?: (value: string, callback: Function) => void;
|
|
54
|
+
}
|
|
55
|
+
const BtnTypes: ['default', 'primary', 'ghost', 'dashed', 'link', 'text'];
|
|
56
|
+
const MenuItemTypes: ['button', 'dropdownBtn', 'dropdown', 'divider'];
|
|
57
|
+
export type BtnType = (typeof BtnTypes)[number];
|
|
58
|
+
export type MenuItemType = (typeof MenuItemTypes)[number];
|
|
59
|
+
type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
|
|
60
|
+
export interface CommonBtnProps {
|
|
61
|
+
key: string;
|
|
62
|
+
label: React.ReactNode;
|
|
63
|
+
type?: BtnType;
|
|
64
|
+
icon?: React.ReactNode;
|
|
65
|
+
disabled?: boolean;
|
|
66
|
+
loading?: boolean;
|
|
67
|
+
className?: string;
|
|
68
|
+
onClick?: () => void;
|
|
69
|
+
}
|
|
70
|
+
export type BtnItem = Merge<CommonBtnProps, {
|
|
71
|
+
itemType?: MenuItemType;
|
|
72
|
+
overlayClassName?: string;
|
|
73
|
+
children?: CommonBtnProps[];
|
|
74
|
+
}>;
|
|
75
|
+
export interface BtnMenuProps {
|
|
76
|
+
menu: BtnItem[];
|
|
77
|
+
className?: string;
|
|
78
|
+
}
|
|
79
|
+
export {};
|
|
80
|
+
}
|
|
81
|
+
export declare const BizTargetFromPanelContext: React.Context<{
|
|
82
|
+
handleSearch?: ((isSearch?: boolean) => void) | undefined;
|
|
83
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
export var BizOptionTitleProps;
|
|
3
|
+
(function (BizOptionTitleProps) {
|
|
4
|
+
var OptionTypes;
|
|
5
|
+
(function (OptionTypes) {
|
|
6
|
+
OptionTypes["SAVE"] = "save";
|
|
7
|
+
OptionTypes["SAVE_AS"] = "saveAs";
|
|
8
|
+
OptionTypes["DELETE"] = "delete";
|
|
9
|
+
OptionTypes["CANCEL"] = "cancel";
|
|
10
|
+
OptionTypes["EDIT"] = "edit";
|
|
11
|
+
OptionTypes["CREATE"] = "create";
|
|
12
|
+
OptionTypes["PANEL"] = "panel";
|
|
13
|
+
})(OptionTypes = BizOptionTitleProps.OptionTypes || (BizOptionTitleProps.OptionTypes = {}));
|
|
14
|
+
})(BizOptionTitleProps || (BizOptionTitleProps = {}));
|
|
15
|
+
export var BizTargetFromPanelContext = /*#__PURE__*/createContext({});
|
package/es/socket/demo/demo.d.ts
CHANGED
package/es/table/demo/index.d.ts
CHANGED
|
@@ -16,11 +16,7 @@ var ParamsCondition = function ParamsCondition(props) {
|
|
|
16
16
|
onChange = props.onChange;
|
|
17
17
|
var onValue0Change = function onValue0Change(e) {
|
|
18
18
|
var value = e.target.value;
|
|
19
|
-
|
|
20
|
-
condition.attrs[index].params = [value, '0'];
|
|
21
|
-
} else {
|
|
22
|
-
condition.attrs[index].params[0] = value;
|
|
23
|
-
}
|
|
19
|
+
condition.attrs[index].params[0] = value;
|
|
24
20
|
onChange(_objectSpread({}, condition));
|
|
25
21
|
};
|
|
26
22
|
var onValue1Change = function onValue1Change(e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.50-title.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": "^16.12.0 || ^17.0.0",
|
|
61
61
|
"yorkie": "^2.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "1703cca49cd7f36d3137e4758cb363ed0cea078a"
|
|
64
64
|
}
|