@zgfe/business-lib 1.1.49 → 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.js +0 -32
- 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/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/index.d.ts +3 -1
- package/es/index.js +3 -1
- 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/package.json +2 -2
|
@@ -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/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
|
}
|