@donglegeyu/company-ui 1.1.1 → 1.2.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/dist/cjs/shared-components/BaseInfoForm/index.d.ts +30 -0
- package/dist/cjs/shared-components/BaseInfoForm/index.js +154 -0
- package/dist/cjs/shared-components/BaseInfoForm/index.scss +18 -0
- package/dist/cjs/shared-components/FormFooterActions/index.d.ts +14 -0
- package/dist/cjs/shared-components/FormFooterActions/index.js +53 -0
- package/dist/cjs/shared-components/FormFooterActions/index.scss +11 -0
- package/dist/cjs/shared-components/PageTitle/index.d.ts +16 -0
- package/dist/cjs/shared-components/PageTitle/index.js +61 -0
- package/dist/cjs/shared-components/PageTitle/index.scss +64 -0
- package/dist/cjs/shared-components/SectionTitle/index.d.ts +6 -0
- package/dist/cjs/shared-components/SectionTitle/index.js +32 -0
- package/dist/cjs/shared-components/SectionTitle/index.scss +20 -0
- package/dist/cjs/shared-components/index.d.ts +5 -0
- package/dist/cjs/shared-components/index.js +12 -0
- package/dist/cjs/template-components/ColumnSettingsPanel/index.scss +5 -0
- package/dist/cjs/template-components/FormPageTemplate/index.d.ts +16 -0
- package/dist/cjs/template-components/FormPageTemplate/index.js +111 -0
- package/dist/cjs/template-components/FormPageTemplate/index.scss +82 -0
- package/dist/cjs/template-components/SmartListTemplate/index.d.ts +7 -1
- package/dist/cjs/template-components/SmartListTemplate/index.js +50 -5
- package/dist/cjs/template-components/index.d.ts +1 -0
- package/dist/cjs/template-components/index.js +3 -0
- package/dist/es/shared-components/BaseInfoForm/index.d.ts +30 -0
- package/dist/es/shared-components/BaseInfoForm/index.js +149 -0
- package/dist/es/shared-components/BaseInfoForm/index.scss +18 -0
- package/dist/es/shared-components/FormFooterActions/index.d.ts +14 -0
- package/dist/es/shared-components/FormFooterActions/index.js +39 -0
- package/dist/es/shared-components/FormFooterActions/index.scss +11 -0
- package/dist/es/shared-components/PageTitle/index.d.ts +16 -0
- package/dist/es/shared-components/PageTitle/index.js +63 -0
- package/dist/es/shared-components/PageTitle/index.scss +64 -0
- package/dist/es/shared-components/SectionTitle/index.d.ts +6 -0
- package/dist/es/shared-components/SectionTitle/index.js +15 -0
- package/dist/es/shared-components/SectionTitle/index.scss +20 -0
- package/dist/es/shared-components/index.d.ts +5 -0
- package/dist/es/shared-components/index.js +5 -1
- package/dist/es/template-components/ColumnSettingsPanel/index.scss +5 -0
- package/dist/es/template-components/FormPageTemplate/index.d.ts +16 -0
- package/dist/es/template-components/FormPageTemplate/index.js +84 -0
- package/dist/es/template-components/FormPageTemplate/index.scss +82 -0
- package/dist/es/template-components/SmartListTemplate/index.d.ts +7 -1
- package/dist/es/template-components/SmartListTemplate/index.js +54 -8
- package/dist/es/template-components/index.d.ts +1 -0
- package/dist/es/template-components/index.js +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { FormInstance } from 'antd';
|
|
3
|
+
import './index.scss';
|
|
4
|
+
export interface FormField {
|
|
5
|
+
name: string;
|
|
6
|
+
label: string;
|
|
7
|
+
type: 'input' | 'select' | 'textarea' | 'input-number';
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
readonly?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
options?: {
|
|
12
|
+
value: string | number;
|
|
13
|
+
label: string;
|
|
14
|
+
}[];
|
|
15
|
+
rules?: any[];
|
|
16
|
+
required?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface BaseInfoFormProps {
|
|
19
|
+
value: Record<string, any>;
|
|
20
|
+
fields: FormField[];
|
|
21
|
+
layout?: 'horizontal' | 'vertical';
|
|
22
|
+
onChange?: (value: Record<string, any>) => void;
|
|
23
|
+
onFieldChange?: (field: string, value: any) => void;
|
|
24
|
+
}
|
|
25
|
+
export interface BaseInfoFormRef {
|
|
26
|
+
validate: () => Promise<boolean>;
|
|
27
|
+
form: FormInstance | null;
|
|
28
|
+
}
|
|
29
|
+
declare const BaseInfoForm: import("react").ForwardRefExoticComponent<BaseInfoFormProps & import("react").RefAttributes<BaseInfoFormRef>>;
|
|
30
|
+
export default BaseInfoForm;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/shared-components/BaseInfoForm/index.tsx
|
|
20
|
+
var BaseInfoForm_exports = {};
|
|
21
|
+
__export(BaseInfoForm_exports, {
|
|
22
|
+
default: () => BaseInfoForm_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(BaseInfoForm_exports);
|
|
25
|
+
var import_react = require("react");
|
|
26
|
+
var import_antd = require("antd");
|
|
27
|
+
var import_basic_components = require("../../basic-components");
|
|
28
|
+
var import_index = require("./index.scss");
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
30
|
+
var BaseInfoForm = (0, import_react.forwardRef)(({
|
|
31
|
+
value,
|
|
32
|
+
fields,
|
|
33
|
+
layout = "horizontal",
|
|
34
|
+
onChange,
|
|
35
|
+
onFieldChange
|
|
36
|
+
}, ref) => {
|
|
37
|
+
const [form] = import_antd.Form.useForm();
|
|
38
|
+
const [contentWidth, setContentWidth] = (0, import_react.useState)(1200);
|
|
39
|
+
const formRef = (0, import_react.useRef)(null);
|
|
40
|
+
const prevValueRef = (0, import_react.useRef)(value);
|
|
41
|
+
(0, import_react.useEffect)(() => {
|
|
42
|
+
const el = formRef.current;
|
|
43
|
+
if (!el)
|
|
44
|
+
return;
|
|
45
|
+
const updateWidth = () => {
|
|
46
|
+
if (el) {
|
|
47
|
+
setContentWidth(el.clientWidth);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
updateWidth();
|
|
51
|
+
const observer = new ResizeObserver(updateWidth);
|
|
52
|
+
observer.observe(el);
|
|
53
|
+
return () => observer.disconnect();
|
|
54
|
+
}, []);
|
|
55
|
+
const getColSpan = () => {
|
|
56
|
+
if (contentWidth < 560)
|
|
57
|
+
return 24;
|
|
58
|
+
if (contentWidth < 860)
|
|
59
|
+
return 12;
|
|
60
|
+
if (contentWidth < 1200)
|
|
61
|
+
return 8;
|
|
62
|
+
return 6;
|
|
63
|
+
};
|
|
64
|
+
(0, import_react.useEffect)(() => {
|
|
65
|
+
if (prevValueRef.current !== value) {
|
|
66
|
+
prevValueRef.current = value;
|
|
67
|
+
const currentFormValues = form.getFieldsValue();
|
|
68
|
+
const diff = {};
|
|
69
|
+
for (const k of Object.keys(value)) {
|
|
70
|
+
if (value[k] !== currentFormValues[k]) {
|
|
71
|
+
diff[k] = value[k];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (Object.keys(diff).length > 0) {
|
|
75
|
+
form.setFieldsValue(diff);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}, [value, form]);
|
|
79
|
+
const handleValuesChange = (_changedValues, allValues) => {
|
|
80
|
+
const key = Object.keys(_changedValues)[0];
|
|
81
|
+
if (key) {
|
|
82
|
+
onFieldChange == null ? void 0 : onFieldChange(key, _changedValues[key]);
|
|
83
|
+
}
|
|
84
|
+
onChange == null ? void 0 : onChange(allValues);
|
|
85
|
+
};
|
|
86
|
+
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
87
|
+
validate: () => form.validateFields().then(() => true).catch(() => false),
|
|
88
|
+
form
|
|
89
|
+
}), [form]);
|
|
90
|
+
const renderField = (field) => {
|
|
91
|
+
switch (field.type) {
|
|
92
|
+
case "input":
|
|
93
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
94
|
+
import_basic_components.CompanyInput,
|
|
95
|
+
{
|
|
96
|
+
placeholder: field.placeholder ?? "请输入",
|
|
97
|
+
readOnly: field.readonly,
|
|
98
|
+
disabled: field.disabled
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
case "select":
|
|
102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
103
|
+
import_basic_components.CompanySelect,
|
|
104
|
+
{
|
|
105
|
+
placeholder: field.placeholder ?? "请选择",
|
|
106
|
+
disabled: field.disabled,
|
|
107
|
+
options: field.options,
|
|
108
|
+
style: { width: "100%" }
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
case "textarea":
|
|
112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
113
|
+
import_basic_components.CompanyInput.TextArea,
|
|
114
|
+
{
|
|
115
|
+
placeholder: field.placeholder ?? "请输入",
|
|
116
|
+
disabled: field.disabled,
|
|
117
|
+
style: { width: "100%" }
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
case "input-number":
|
|
121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
122
|
+
import_basic_components.CompanyInputNumber,
|
|
123
|
+
{
|
|
124
|
+
placeholder: field.placeholder ?? "请输入",
|
|
125
|
+
disabled: field.disabled,
|
|
126
|
+
style: { width: "100%" }
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
default:
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref: formRef, className: "base-info-form", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
134
|
+
import_antd.Form,
|
|
135
|
+
{
|
|
136
|
+
form,
|
|
137
|
+
initialValues: value,
|
|
138
|
+
layout,
|
|
139
|
+
onValuesChange: handleValuesChange,
|
|
140
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Row, { gutter: 24, children: fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Col, { span: getColSpan(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
141
|
+
import_antd.Form.Item,
|
|
142
|
+
{
|
|
143
|
+
label: field.label,
|
|
144
|
+
name: field.name,
|
|
145
|
+
rules: field.rules,
|
|
146
|
+
required: field.required,
|
|
147
|
+
children: renderField(field)
|
|
148
|
+
}
|
|
149
|
+
) }, field.name)) })
|
|
150
|
+
}
|
|
151
|
+
) });
|
|
152
|
+
});
|
|
153
|
+
BaseInfoForm.displayName = "BaseInfoForm";
|
|
154
|
+
var BaseInfoForm_default = BaseInfoForm;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.base-info-form.base-info-form {
|
|
2
|
+
width: 100%;
|
|
3
|
+
|
|
4
|
+
.ant-form-item.ant-form-item {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
width: 100%;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.ant-form-item-label.ant-form-item-label {
|
|
11
|
+
width: 80px;
|
|
12
|
+
flex-shrink: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.ant-form-item-label > label {
|
|
16
|
+
justify-content: flex-end;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import './index.scss';
|
|
2
|
+
interface FormFooterActionsProps {
|
|
3
|
+
submitLoading?: boolean;
|
|
4
|
+
submitText?: string;
|
|
5
|
+
cancelText?: string;
|
|
6
|
+
showSubmit?: boolean;
|
|
7
|
+
showCancel?: boolean;
|
|
8
|
+
submitDisabled?: boolean;
|
|
9
|
+
cancelDisabled?: boolean;
|
|
10
|
+
onSubmit?: () => void;
|
|
11
|
+
onCancel?: () => void;
|
|
12
|
+
}
|
|
13
|
+
export default function FormFooterActions({ submitLoading, submitText, cancelText, showSubmit, showCancel, submitDisabled, cancelDisabled, onSubmit, onCancel, }: FormFooterActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/shared-components/FormFooterActions/index.tsx
|
|
20
|
+
var FormFooterActions_exports = {};
|
|
21
|
+
__export(FormFooterActions_exports, {
|
|
22
|
+
default: () => FormFooterActions
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(FormFooterActions_exports);
|
|
25
|
+
var import_basic_components = require("../../basic-components");
|
|
26
|
+
var import_antd = require("antd");
|
|
27
|
+
var import_index = require("./index.scss");
|
|
28
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
+
function FormFooterActions({
|
|
30
|
+
submitLoading = false,
|
|
31
|
+
submitText = "确定",
|
|
32
|
+
cancelText = "取消",
|
|
33
|
+
showSubmit = true,
|
|
34
|
+
showCancel = true,
|
|
35
|
+
submitDisabled = false,
|
|
36
|
+
cancelDisabled = false,
|
|
37
|
+
onSubmit,
|
|
38
|
+
onCancel
|
|
39
|
+
}) {
|
|
40
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "form-footer-actions", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Space, { children: [
|
|
41
|
+
showCancel && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_basic_components.CompanyButton, { disabled: cancelDisabled, onClick: onCancel, children: cancelText }),
|
|
42
|
+
showSubmit && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
43
|
+
import_basic_components.CompanyButton,
|
|
44
|
+
{
|
|
45
|
+
type: "primary",
|
|
46
|
+
loading: submitLoading,
|
|
47
|
+
disabled: submitDisabled,
|
|
48
|
+
onClick: onSubmit,
|
|
49
|
+
children: submitText
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
] }) });
|
|
53
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
.form-footer-actions {
|
|
2
|
+
position: sticky;
|
|
3
|
+
bottom: 0;
|
|
4
|
+
padding: 12px 16px;
|
|
5
|
+
background: #ffffff;
|
|
6
|
+
border-top: 1px solid var(--ant-color-border-secondary, #f0f0f0);
|
|
7
|
+
display: flex;
|
|
8
|
+
justify-content: flex-end;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
z-index: 10;
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
interface PageTitleProps {
|
|
4
|
+
title: string;
|
|
5
|
+
showBack?: boolean;
|
|
6
|
+
showBackText?: boolean;
|
|
7
|
+
showDivider?: boolean;
|
|
8
|
+
backText?: string;
|
|
9
|
+
onBack?: () => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
backIcon?: ReactNode;
|
|
12
|
+
titleSuffix?: ReactNode;
|
|
13
|
+
actions?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export default function PageTitle({ title, showBack, showBackText, showDivider, backText, onBack, className, backIcon, titleSuffix, actions, }: PageTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/shared-components/PageTitle/index.tsx
|
|
20
|
+
var PageTitle_exports = {};
|
|
21
|
+
__export(PageTitle_exports, {
|
|
22
|
+
default: () => PageTitle
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(PageTitle_exports);
|
|
25
|
+
var import_react = require("react");
|
|
26
|
+
var import_index = require("./index.scss");
|
|
27
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
+
function PageTitle({
|
|
29
|
+
title,
|
|
30
|
+
showBack = false,
|
|
31
|
+
showBackText = true,
|
|
32
|
+
showDivider = true,
|
|
33
|
+
backText = "返回",
|
|
34
|
+
onBack,
|
|
35
|
+
className,
|
|
36
|
+
backIcon,
|
|
37
|
+
titleSuffix,
|
|
38
|
+
actions
|
|
39
|
+
}) {
|
|
40
|
+
const handleBack = (0, import_react.useCallback)(() => {
|
|
41
|
+
if (onBack) {
|
|
42
|
+
onBack();
|
|
43
|
+
} else if (typeof window !== "undefined") {
|
|
44
|
+
window.history.back();
|
|
45
|
+
}
|
|
46
|
+
}, [onBack]);
|
|
47
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `page-title${className ? ` ${className}` : ""}`, children: [
|
|
48
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "page-title-left", children: [
|
|
49
|
+
showBack && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
50
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: "page-title-back-btn", onClick: handleBack, children: [
|
|
51
|
+
backIcon || /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 1024 1024", className: "page-title-back-icon", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M609.344 226.906667L318.250667 512l291.093333 285.094667a42.666667 42.666667 0 0 1-60.330666 60.330666l-315.733334-309.12a42.666667 42.666667 0 0 1 0-60.330666l315.392-308.373333a42.666667 42.666667 0 0 1 60.672 24.32 42.666667 42.666667 0 0 1-0.341334 36.181333z", fill: "currentColor" }) }),
|
|
52
|
+
showBackText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "page-title-back-text", children: backText })
|
|
53
|
+
] }),
|
|
54
|
+
showDivider && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "page-title-divider" })
|
|
55
|
+
] }),
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "page-title-text", children: title }),
|
|
57
|
+
titleSuffix && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "page-title-suffix", children: titleSuffix })
|
|
58
|
+
] }),
|
|
59
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "page-title-actions", children: actions })
|
|
60
|
+
] });
|
|
61
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
.page-title {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
height: 48px;
|
|
6
|
+
padding: 0;
|
|
7
|
+
background: transparent;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.page-title-left {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: 8px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.page-title-back-btn {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
gap: 4px;
|
|
20
|
+
padding: 4px;
|
|
21
|
+
color: rgba(0, 0, 0, 0.65);
|
|
22
|
+
font-size: 14px;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
border: none;
|
|
25
|
+
background: transparent;
|
|
26
|
+
transition: color 0.2s;
|
|
27
|
+
|
|
28
|
+
&:hover {
|
|
29
|
+
color: #F95914;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.page-title-back-icon {
|
|
34
|
+
width: 14px;
|
|
35
|
+
height: 14px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.page-title-back-text {
|
|
39
|
+
font-size: 14px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.page-title-divider {
|
|
43
|
+
width: 1px;
|
|
44
|
+
height: 16px;
|
|
45
|
+
background: #E5E6EB;
|
|
46
|
+
margin: 0 4px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.page-title-text {
|
|
50
|
+
font-size: 16px;
|
|
51
|
+
font-weight: 600;
|
|
52
|
+
color: #1D2129;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.page-title-suffix {
|
|
56
|
+
font-size: 14px;
|
|
57
|
+
color: rgba(0, 0, 0, 0.65);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.page-title-actions {
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: 8px;
|
|
64
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/shared-components/SectionTitle/index.tsx
|
|
20
|
+
var SectionTitle_exports = {};
|
|
21
|
+
__export(SectionTitle_exports, {
|
|
22
|
+
default: () => SectionTitle
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(SectionTitle_exports);
|
|
25
|
+
var import_index = require("./index.scss");
|
|
26
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
27
|
+
function SectionTitle({ title }) {
|
|
28
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "section-title", children: [
|
|
29
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "section-title-bar" }),
|
|
30
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "section-title-text", children: title })
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.section-title {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 10px;
|
|
5
|
+
height: 38px;
|
|
6
|
+
padding: 8px 0;
|
|
7
|
+
margin-bottom: 8px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.section-title-bar {
|
|
11
|
+
width: 4px;
|
|
12
|
+
height: 16px;
|
|
13
|
+
border-radius: 12px;
|
|
14
|
+
background: #F95914;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.section-title-text {
|
|
18
|
+
font-size: 14px;
|
|
19
|
+
color: #1D2129;
|
|
20
|
+
}
|
|
@@ -2,3 +2,8 @@ export { default as SvgIcon } from "./SvgIcon";
|
|
|
2
2
|
export { default as ActionCell } from "./ActionCell";
|
|
3
3
|
export type { ActionButton } from "./ActionCell";
|
|
4
4
|
export { default as FilterOptionsDrawer } from "./FilterOptionsDrawer";
|
|
5
|
+
export { default as PageTitle } from "./PageTitle";
|
|
6
|
+
export { default as FormFooterActions } from "./FormFooterActions";
|
|
7
|
+
export { default as SectionTitle } from "./SectionTitle";
|
|
8
|
+
export { default as BaseInfoForm } from "./BaseInfoForm";
|
|
9
|
+
export type { FormField, BaseInfoFormProps, BaseInfoFormRef } from "./BaseInfoForm";
|
|
@@ -30,16 +30,28 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
var shared_components_exports = {};
|
|
31
31
|
__export(shared_components_exports, {
|
|
32
32
|
ActionCell: () => import_ActionCell.default,
|
|
33
|
+
BaseInfoForm: () => import_BaseInfoForm.default,
|
|
33
34
|
FilterOptionsDrawer: () => import_FilterOptionsDrawer.default,
|
|
35
|
+
FormFooterActions: () => import_FormFooterActions.default,
|
|
36
|
+
PageTitle: () => import_PageTitle.default,
|
|
37
|
+
SectionTitle: () => import_SectionTitle.default,
|
|
34
38
|
SvgIcon: () => import_SvgIcon.default
|
|
35
39
|
});
|
|
36
40
|
module.exports = __toCommonJS(shared_components_exports);
|
|
37
41
|
var import_SvgIcon = __toESM(require("./SvgIcon"));
|
|
38
42
|
var import_ActionCell = __toESM(require("./ActionCell"));
|
|
39
43
|
var import_FilterOptionsDrawer = __toESM(require("./FilterOptionsDrawer"));
|
|
44
|
+
var import_PageTitle = __toESM(require("./PageTitle"));
|
|
45
|
+
var import_FormFooterActions = __toESM(require("./FormFooterActions"));
|
|
46
|
+
var import_SectionTitle = __toESM(require("./SectionTitle"));
|
|
47
|
+
var import_BaseInfoForm = __toESM(require("./BaseInfoForm"));
|
|
40
48
|
// Annotate the CommonJS export names for ESM import in node:
|
|
41
49
|
0 && (module.exports = {
|
|
42
50
|
ActionCell,
|
|
51
|
+
BaseInfoForm,
|
|
43
52
|
FilterOptionsDrawer,
|
|
53
|
+
FormFooterActions,
|
|
54
|
+
PageTitle,
|
|
55
|
+
SectionTitle,
|
|
44
56
|
SvgIcon
|
|
45
57
|
});
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
.column-settings-popover {
|
|
2
2
|
width: 200px;
|
|
3
|
+
|
|
4
|
+
.ant-popover-inner {
|
|
5
|
+
padding: 12px 16px !important;
|
|
6
|
+
}
|
|
3
7
|
}
|
|
4
8
|
|
|
5
9
|
.column-settings-panel {
|
|
@@ -46,6 +50,7 @@
|
|
|
46
50
|
.search-input {
|
|
47
51
|
flex: 1;
|
|
48
52
|
height: 32px;
|
|
53
|
+
min-width: 0;
|
|
49
54
|
border: none;
|
|
50
55
|
background: transparent;
|
|
51
56
|
color: rgba(0, 0, 0, 0.85);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
interface FormPageTemplateProps {
|
|
4
|
+
title: string;
|
|
5
|
+
showBack?: boolean;
|
|
6
|
+
onBack?: () => void;
|
|
7
|
+
submitLoading?: boolean;
|
|
8
|
+
showFooter?: boolean;
|
|
9
|
+
footerPosition?: 'fixed' | 'static';
|
|
10
|
+
onSubmit?: () => void;
|
|
11
|
+
onCancel?: () => void;
|
|
12
|
+
titleActions?: ReactNode;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export default function FormPageTemplate({ title, showBack, onBack, submitLoading, showFooter, footerPosition, onSubmit, onCancel, titleActions, children, }: FormPageTemplateProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/template-components/FormPageTemplate/index.tsx
|
|
30
|
+
var FormPageTemplate_exports = {};
|
|
31
|
+
__export(FormPageTemplate_exports, {
|
|
32
|
+
default: () => FormPageTemplate
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(FormPageTemplate_exports);
|
|
35
|
+
var import_react = require("react");
|
|
36
|
+
var import_basic_components = require("../../basic-components");
|
|
37
|
+
var import_PageTitle = __toESM(require("../../shared-components/PageTitle"));
|
|
38
|
+
var import_FormFooterActions = __toESM(require("../../shared-components/FormFooterActions"));
|
|
39
|
+
var import_index = require("./index.scss");
|
|
40
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
+
function FormPageTemplate({
|
|
42
|
+
title,
|
|
43
|
+
showBack = false,
|
|
44
|
+
onBack,
|
|
45
|
+
submitLoading = false,
|
|
46
|
+
showFooter = true,
|
|
47
|
+
footerPosition = "fixed",
|
|
48
|
+
onSubmit,
|
|
49
|
+
onCancel,
|
|
50
|
+
titleActions,
|
|
51
|
+
children
|
|
52
|
+
}) {
|
|
53
|
+
const [isScrolling, setIsScrolling] = (0, import_react.useState)(false);
|
|
54
|
+
const scrollTimeoutRef = (0, import_react.useRef)(null);
|
|
55
|
+
const handleScroll = (0, import_react.useCallback)((e) => {
|
|
56
|
+
const target = e.currentTarget;
|
|
57
|
+
setIsScrolling(true);
|
|
58
|
+
if (scrollTimeoutRef.current) {
|
|
59
|
+
clearTimeout(scrollTimeoutRef.current);
|
|
60
|
+
}
|
|
61
|
+
scrollTimeoutRef.current = setTimeout(() => {
|
|
62
|
+
setIsScrolling(false);
|
|
63
|
+
}, 150);
|
|
64
|
+
const scrollTop = target.scrollTop;
|
|
65
|
+
if (scrollTop > 0) {
|
|
66
|
+
target.classList.add("scrolled");
|
|
67
|
+
} else {
|
|
68
|
+
target.classList.remove("scrolled");
|
|
69
|
+
}
|
|
70
|
+
}, []);
|
|
71
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "form-page-template", children: [
|
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
73
|
+
import_PageTitle.default,
|
|
74
|
+
{
|
|
75
|
+
title,
|
|
76
|
+
showBack,
|
|
77
|
+
onBack,
|
|
78
|
+
className: "form-page-title",
|
|
79
|
+
actions: titleActions
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "form-page-container", children: [
|
|
83
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
className: `form-page-content${isScrolling ? " scrolling" : ""}`,
|
|
87
|
+
onScroll: handleScroll,
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_basic_components.CompanyCard, { className: "form-page-card", children }),
|
|
90
|
+
showFooter && footerPosition === "static" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "form-page-footer static", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
91
|
+
import_FormFooterActions.default,
|
|
92
|
+
{
|
|
93
|
+
submitLoading,
|
|
94
|
+
onSubmit,
|
|
95
|
+
onCancel
|
|
96
|
+
}
|
|
97
|
+
) })
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
showFooter && footerPosition === "fixed" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "form-page-footer fixed", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
102
|
+
import_FormFooterActions.default,
|
|
103
|
+
{
|
|
104
|
+
submitLoading,
|
|
105
|
+
onSubmit,
|
|
106
|
+
onCancel
|
|
107
|
+
}
|
|
108
|
+
) })
|
|
109
|
+
] })
|
|
110
|
+
] });
|
|
111
|
+
}
|