@pisell/materials 6.0.6 → 6.0.8
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +7 -7
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +21 -53
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +18 -50
- package/es/components/config-provider/index.js +1 -1
- package/es/components/dataSourceComponents/dataSourceForm/BaseForm.js +20 -11
- package/es/components/dataSourceComponents/dataSourceForm/formItem.js +1 -1
- package/es/components/dataSourceComponents/dataSourceForm/group/index.less +2 -2
- package/es/components/dataSourceComponents/dataSourceForm/index.js +4 -2
- package/es/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingContext.d.ts +4 -0
- package/es/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.js +11 -3
- package/es/components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperProvider.js +10 -3
- package/es/components/dataSourceComponents/dataSourceForm/serve.d.ts +3 -2
- package/es/components/dataSourceComponents/dataSourceForm/serve.js +36 -20
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.js +46 -25
- package/es/components/dataSourceComponents/dataSourceForm/type.d.ts +5 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +3 -1
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +38 -10
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.js +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useColumns.js +4 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +7 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +28 -5
- package/es/components/dataSourceComponents/dataSourceTable/index.js +4 -2
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +9 -1
- package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.js +7 -1
- package/es/components/dataSourceComponents/fields/Input.Url/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Input.Url/ReadPretty.js +16 -1
- package/es/components/dataSourceComponents/fields/Input.Url/ReadPretty.less +1 -1
- package/es/components/dataSourceComponents/fields/Select/index.js +7 -1
- package/es/components/dataSourceComponents/fields/Upload/serve.d.ts +4 -1
- package/es/components/dataSourceComponents/fields/Upload/serve.js +10 -31
- package/es/components/dataSourceComponents/hooks/useActions.d.ts +2 -1
- package/es/components/dataSourceComponents/hooks/useActions.js +73 -36
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +7 -0
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceProvider.js +3 -1
- package/es/components/dataSourceComponents/provider/variables/VariablesProvider.js +49 -3
- package/es/components/login-and-register/index.d.ts +82 -0
- package/es/components/login-and-register/index.js +360 -0
- package/es/components/login-and-register/index.less +211 -0
- package/es/components/organizationTenantSwitcher/defaultLogo.png +0 -0
- package/es/components/organizationTenantSwitcher/index.d.ts +17 -0
- package/es/components/organizationTenantSwitcher/index.js +96 -0
- package/es/components/organizationTenantSwitcher/index.less +88 -0
- package/es/components/page/index.js +4 -4
- package/es/components/page-header/index.d.ts +14 -0
- package/es/components/page-header/index.js +36 -0
- package/es/components/page-header/index.less +45 -0
- package/es/components/pisellAvatar/index.d.ts +19 -0
- package/es/components/pisellAvatar/index.js +89 -0
- package/es/components/pisellAvatar/index.less +26 -0
- package/es/components/pisellModal/components/PcModal/index.js +1 -1
- package/es/components/pisellTags/index.d.ts +13 -0
- package/es/components/pisellTags/index.js +83 -0
- package/es/components/pisellTags/index.less +17 -0
- package/es/components/pisellTags/utils.d.ts +1 -0
- package/es/components/pisellTags/utils.js +89 -0
- package/es/components/pisellText/components/Amount/index.js +1 -1
- package/es/components/pisellViewGrid/index.d.ts +16 -0
- package/es/components/pisellViewGrid/index.js +66 -0
- package/es/components/pisellViewGrid/index.less +31 -0
- package/es/components/profileMenu/index.d.ts +26 -0
- package/es/components/profileMenu/index.js +115 -0
- package/es/components/profileMenu/index.less +135 -0
- package/es/components/table/Header/index.js +8 -11
- package/es/index.d.ts +7 -0
- package/es/index.js +8 -1
- package/es/locales/en-US.d.ts +1 -0
- package/es/locales/en-US.js +1 -0
- package/es/locales/zh-CN.d.ts +1 -0
- package/es/locales/zh-CN.js +1 -0
- package/es/locales/zh-TW.d.ts +1 -0
- package/es/locales/zh-TW.js +1 -0
- package/lib/components/config-provider/index.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/BaseForm.js +22 -4
- package/lib/components/dataSourceComponents/dataSourceForm/formItem.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/group/index.less +2 -2
- package/lib/components/dataSourceComponents/dataSourceForm/index.js +3 -2
- package/lib/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingContext.d.ts +4 -0
- package/lib/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.js +17 -3
- package/lib/components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperProvider.js +16 -6
- package/lib/components/dataSourceComponents/dataSourceForm/serve.d.ts +3 -2
- package/lib/components/dataSourceComponents/dataSourceForm/serve.js +9 -5
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.js +15 -4
- package/lib/components/dataSourceComponents/dataSourceForm/type.d.ts +5 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +3 -1
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +51 -5
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useColumns.js +4 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +7 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +24 -3
- package/lib/components/dataSourceComponents/dataSourceTable/index.js +2 -2
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +9 -1
- package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.js +6 -1
- package/lib/components/dataSourceComponents/fields/Input.Url/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Input.Url/ReadPretty.js +17 -2
- package/lib/components/dataSourceComponents/fields/Input.Url/ReadPretty.less +1 -1
- package/lib/components/dataSourceComponents/fields/Select/index.js +5 -1
- package/lib/components/dataSourceComponents/fields/Upload/serve.d.ts +4 -1
- package/lib/components/dataSourceComponents/fields/Upload/serve.js +20 -12
- package/lib/components/dataSourceComponents/hooks/useActions.d.ts +2 -1
- package/lib/components/dataSourceComponents/hooks/useActions.js +25 -7
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +7 -0
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceProvider.js +3 -1
- package/lib/components/dataSourceComponents/provider/variables/VariablesProvider.js +49 -3
- package/lib/components/login-and-register/index.d.ts +82 -0
- package/lib/components/login-and-register/index.js +261 -0
- package/lib/components/login-and-register/index.less +211 -0
- package/lib/components/organizationTenantSwitcher/defaultLogo.png +0 -0
- package/lib/components/organizationTenantSwitcher/index.d.ts +17 -0
- package/lib/components/organizationTenantSwitcher/index.js +119 -0
- package/lib/components/organizationTenantSwitcher/index.less +88 -0
- package/lib/components/page/index.js +4 -4
- package/lib/components/page-header/index.d.ts +14 -0
- package/lib/components/page-header/index.js +63 -0
- package/lib/components/page-header/index.less +45 -0
- package/lib/components/pisellAvatar/index.d.ts +19 -0
- package/lib/components/pisellAvatar/index.js +108 -0
- package/lib/components/pisellAvatar/index.less +26 -0
- package/lib/components/pisellModal/components/PcModal/index.js +1 -1
- package/lib/components/pisellTags/index.d.ts +13 -0
- package/lib/components/pisellTags/index.js +113 -0
- package/lib/components/pisellTags/index.less +17 -0
- package/lib/components/pisellTags/utils.d.ts +1 -0
- package/lib/components/pisellTags/utils.js +86 -0
- package/lib/components/pisellText/components/Amount/index.js +2 -2
- package/lib/components/pisellViewGrid/index.d.ts +16 -0
- package/lib/components/pisellViewGrid/index.js +98 -0
- package/lib/components/pisellViewGrid/index.less +31 -0
- package/lib/components/profileMenu/index.d.ts +26 -0
- package/lib/components/profileMenu/index.js +113 -0
- package/lib/components/profileMenu/index.less +135 -0
- package/lib/components/table/Header/index.js +11 -1
- package/lib/index.d.ts +7 -0
- package/lib/index.js +21 -0
- package/lib/locales/en-US.d.ts +1 -0
- package/lib/locales/en-US.js +1 -0
- package/lib/locales/zh-CN.d.ts +1 -0
- package/lib/locales/zh-CN.js +1 -0
- package/lib/locales/zh-TW.d.ts +1 -0
- package/lib/locales/zh-TW.js +1 -0
- package/lowcode/_utils/defaultSchema.ts +64 -0
- package/lowcode/data-source-form/meta.ts +130 -0
- package/lowcode/data-source-form/utils.ts +33 -3
- package/lowcode/data-source-table/meta.ts +139 -3
- package/lowcode/data-source-table/utils.tsx +6 -0
- package/lowcode/form-item-date-picker/snippets.ts +3 -0
- package/lowcode/form-item-input/snippets.ts +3 -1
- package/lowcode/form-item-input-number/snippets.ts +4 -0
- package/lowcode/form-item-input.email/snippets.ts +3 -0
- package/lowcode/form-item-input.json/snippets.ts +4 -1
- package/lowcode/form-item-input.password/snippets.ts +3 -0
- package/lowcode/form-item-input.phone/snippets.ts +3 -0
- package/lowcode/form-item-input.text-area/snippets.ts +3 -1
- package/lowcode/form-item-input.url/snippets.ts +3 -0
- package/lowcode/form-item-select/meta.ts +2 -1
- package/lowcode/form-item-select/snippets.ts +6 -0
- package/lowcode/form-item-time-picker/snippets.ts +3 -0
- package/lowcode/form-item-translation/snippets.ts +3 -1
- package/lowcode/login-and-register/meta.ts +541 -0
- package/lowcode/login-and-register/snippets.ts +38 -0
- package/lowcode/organization-tenant-switch/meta.ts +127 -0
- package/lowcode/page-header/meta.ts +68 -124
- package/lowcode/page-header/snippets.ts +1 -1
- package/lowcode/pisell-avatar/__screenshots__/avatar-1.jpg +0 -0
- package/lowcode/pisell-avatar/meta.ts +111 -0
- package/lowcode/pisell-avatar/snippets.ts +14 -0
- package/lowcode/pisell-tags/__screenshots__/tag-1.png +0 -0
- package/lowcode/pisell-tags/meta.ts +123 -0
- package/lowcode/pisell-tags/snippets.ts +14 -0
- package/lowcode/pisell-view-grid/__screenshots__/card-1.png +0 -0
- package/lowcode/pisell-view-grid/meta.ts +167 -0
- package/lowcode/pisell-view-grid/snippets.ts +54 -0
- package/lowcode/profile-menu/meta.ts +175 -0
- package/lowcode/profile-menu/snippets.ts +71 -0
- package/lowcode/submit-button/meta.ts +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,108 @@
|
|
|
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/components/pisellAvatar/index.tsx
|
|
30
|
+
var pisellAvatar_exports = {};
|
|
31
|
+
__export(pisellAvatar_exports, {
|
|
32
|
+
default: () => pisellAvatar_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(pisellAvatar_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_classnames = __toESM(require("classnames"));
|
|
38
|
+
var import_iconfont = __toESM(require("../iconfont"));
|
|
39
|
+
var import_index = require("./index.less");
|
|
40
|
+
var sizeMap = {
|
|
41
|
+
xs: 24,
|
|
42
|
+
sm: 32,
|
|
43
|
+
md: 40,
|
|
44
|
+
lg: 48,
|
|
45
|
+
xl: 56,
|
|
46
|
+
xxl: 64
|
|
47
|
+
};
|
|
48
|
+
var fontSizeMap = {
|
|
49
|
+
xs: 12,
|
|
50
|
+
sm: 14,
|
|
51
|
+
md: 16,
|
|
52
|
+
lg: 18,
|
|
53
|
+
xl: 20,
|
|
54
|
+
xxl: 24
|
|
55
|
+
};
|
|
56
|
+
var PisellAvatar = ({
|
|
57
|
+
shape = "circle",
|
|
58
|
+
size = "xs",
|
|
59
|
+
src,
|
|
60
|
+
alt,
|
|
61
|
+
icon,
|
|
62
|
+
children,
|
|
63
|
+
className,
|
|
64
|
+
style,
|
|
65
|
+
useTextAvatar,
|
|
66
|
+
borderRadius = 4,
|
|
67
|
+
onError,
|
|
68
|
+
...restProps
|
|
69
|
+
}) => {
|
|
70
|
+
const classes = (0, import_classnames.default)(
|
|
71
|
+
"pisell-avatar",
|
|
72
|
+
`pisell-avatar-${size}`,
|
|
73
|
+
`pisell-avatar-${shape}`,
|
|
74
|
+
{
|
|
75
|
+
"pisell-avatar-with-text": !src && !icon && children
|
|
76
|
+
},
|
|
77
|
+
className
|
|
78
|
+
);
|
|
79
|
+
const mergedStyle = {
|
|
80
|
+
...style,
|
|
81
|
+
width: sizeMap[size],
|
|
82
|
+
height: sizeMap[size],
|
|
83
|
+
fontSize: children || icon ? fontSizeMap[size] : void 0,
|
|
84
|
+
lineHeight: `${sizeMap[size]}px`,
|
|
85
|
+
borderRadius: shape === "square" ? `${borderRadius}px` : "50%"
|
|
86
|
+
};
|
|
87
|
+
const renderChildren = (0, import_react.useMemo)(() => {
|
|
88
|
+
if (useTextAvatar && children) {
|
|
89
|
+
return children;
|
|
90
|
+
}
|
|
91
|
+
return /* @__PURE__ */ import_react.default.createElement(import_iconfont.default, { type: "pisell2-user-01" });
|
|
92
|
+
}, [useTextAvatar, children]);
|
|
93
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
94
|
+
import_antd.Avatar,
|
|
95
|
+
{
|
|
96
|
+
...restProps,
|
|
97
|
+
className: classes,
|
|
98
|
+
shape,
|
|
99
|
+
style: mergedStyle,
|
|
100
|
+
src,
|
|
101
|
+
alt,
|
|
102
|
+
icon,
|
|
103
|
+
onError
|
|
104
|
+
},
|
|
105
|
+
renderChildren
|
|
106
|
+
);
|
|
107
|
+
};
|
|
108
|
+
var pisellAvatar_default = PisellAvatar;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@prefix: pisell-avatar;
|
|
2
|
+
|
|
3
|
+
.@{prefix} {
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
background: var(--Gray-100, #f2f4f7); // 默认背景色
|
|
8
|
+
border: 1px solid #D0D5DD; // 移除默认边框
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
|
|
11
|
+
img {
|
|
12
|
+
object-fit: cover;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.anticon {
|
|
16
|
+
font-size: inherit !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// 文本头像样式
|
|
20
|
+
&.pisell-avatar-with-text {
|
|
21
|
+
background: var(--Gray-100, #f2f4f7); // 文本头像的背景色
|
|
22
|
+
color: var(--Gray-600, #475467); // 文本颜色
|
|
23
|
+
font-weight: 600;
|
|
24
|
+
// border: 0.75px solid var(--Gray-900, #101828);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -37,7 +37,7 @@ var import_antd = require("antd");
|
|
|
37
37
|
var import_classnames = __toESM(require("classnames"));
|
|
38
38
|
var import_utils = require("@pisell/utils");
|
|
39
39
|
var import_XClose = __toESM(require("@pisell/icon/es/XClose"));
|
|
40
|
-
var import_Delete_wght300_24px = __toESM(require("@pisell/icon/
|
|
40
|
+
var import_Delete_wght300_24px = __toESM(require("@pisell/icon/es/Delete_wght300_24px"));
|
|
41
41
|
var import_modal = __toESM(require("../../../modal"));
|
|
42
42
|
var import_constants = require("../../constants");
|
|
43
43
|
var import_index = require("./index.less");
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export declare type PisellTagsType = 'pill_color' | 'pill_outline';
|
|
4
|
+
export declare type PisellTagsColor = 'success' | 'warning' | 'error' | 'gray' | string;
|
|
5
|
+
export interface PisellTagsProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
others?: React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
|
|
8
|
+
type: PisellTagsType;
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
color?: PisellTagsColor;
|
|
11
|
+
}
|
|
12
|
+
declare const PisellTags: (props: PisellTagsProps) => React.JSX.Element;
|
|
13
|
+
export default PisellTags;
|
|
@@ -0,0 +1,113 @@
|
|
|
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/components/pisellTags/index.tsx
|
|
30
|
+
var pisellTags_exports = {};
|
|
31
|
+
__export(pisellTags_exports, {
|
|
32
|
+
default: () => pisellTags_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(pisellTags_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_classnames = __toESM(require("classnames"));
|
|
37
|
+
var import_utils = require("./utils");
|
|
38
|
+
var import_index = require("./index.less");
|
|
39
|
+
var pisellTagsColors = {
|
|
40
|
+
success: "#067647",
|
|
41
|
+
warning: "#B54708",
|
|
42
|
+
error: "#B42318",
|
|
43
|
+
gray: "#344054"
|
|
44
|
+
};
|
|
45
|
+
var getColor = (_color) => {
|
|
46
|
+
if (_color) {
|
|
47
|
+
return pisellTagsColors[_color] || _color;
|
|
48
|
+
}
|
|
49
|
+
return "#344054";
|
|
50
|
+
};
|
|
51
|
+
var getPillColorStyles = (_color) => {
|
|
52
|
+
const colorShades = (0, import_utils.generateColorShades)(_color);
|
|
53
|
+
return {
|
|
54
|
+
"--pisell-tags-bg-color": colorShades["color_50"],
|
|
55
|
+
"--pisell-tags-font-color": colorShades["color_700"],
|
|
56
|
+
"--pisell-tags-border-color": colorShades["color_200"]
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
var getPillOutlineStyles = (_color) => {
|
|
60
|
+
const colorShades = (0, import_utils.generateColorShades)(_color);
|
|
61
|
+
return {
|
|
62
|
+
"--pisell-tags-bg-color": "transparent",
|
|
63
|
+
"--pisell-tags-font-color": colorShades["color_700"],
|
|
64
|
+
"--pisell-tags-border-color": colorShades["color_600"]
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
var PisellTags = (props) => {
|
|
68
|
+
const {
|
|
69
|
+
children,
|
|
70
|
+
type,
|
|
71
|
+
icon,
|
|
72
|
+
color,
|
|
73
|
+
style = {},
|
|
74
|
+
others = {},
|
|
75
|
+
...otherProps
|
|
76
|
+
} = props;
|
|
77
|
+
const styles = (0, import_react.useMemo)(() => {
|
|
78
|
+
let obj = {
|
|
79
|
+
...style,
|
|
80
|
+
...others.style
|
|
81
|
+
};
|
|
82
|
+
const _color = getColor(props.color);
|
|
83
|
+
if (type === "pill_color") {
|
|
84
|
+
obj = {
|
|
85
|
+
...obj,
|
|
86
|
+
...getPillColorStyles(_color)
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
if (type === "pill_outline") {
|
|
90
|
+
obj = {
|
|
91
|
+
...obj,
|
|
92
|
+
...getPillOutlineStyles(_color)
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
return obj;
|
|
96
|
+
}, [color, style, others.style, type]);
|
|
97
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
98
|
+
"span",
|
|
99
|
+
{
|
|
100
|
+
style: { ...styles, ...style },
|
|
101
|
+
...others,
|
|
102
|
+
...otherProps,
|
|
103
|
+
className: (0, import_classnames.default)(
|
|
104
|
+
"pisell-tags",
|
|
105
|
+
others.className,
|
|
106
|
+
otherProps.className
|
|
107
|
+
)
|
|
108
|
+
},
|
|
109
|
+
icon ? icon : null,
|
|
110
|
+
children
|
|
111
|
+
);
|
|
112
|
+
};
|
|
113
|
+
var pisellTags_default = PisellTags;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.pisell-tags {
|
|
2
|
+
--pisell-tags-bg-color: #F9FAFB;
|
|
3
|
+
--pisell-tags-font-color: #344054;
|
|
4
|
+
--pisell-tags-border-color: #EAECF0;
|
|
5
|
+
border-radius: 16px;
|
|
6
|
+
border: 1px solid var(--pisell-tags-border-color);
|
|
7
|
+
background: var(--pisell-tags-bg-color);
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
padding: 2px 12px;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: 6px;
|
|
12
|
+
|
|
13
|
+
color: var(--pisell-tags-font-color);
|
|
14
|
+
font-size: 14px;
|
|
15
|
+
font-style: normal;
|
|
16
|
+
font-weight: 500;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generateColorShades: (color: string) => Record<string, string>;
|
|
@@ -0,0 +1,86 @@
|
|
|
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/components/pisellTags/utils.ts
|
|
20
|
+
var utils_exports = {};
|
|
21
|
+
__export(utils_exports, {
|
|
22
|
+
generateColorShades: () => generateColorShades
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(utils_exports);
|
|
25
|
+
var hexToRgb = (hex) => {
|
|
26
|
+
hex = hex.replace(/^#/, "");
|
|
27
|
+
if (hex.length === 3) {
|
|
28
|
+
hex = hex.split("").map((h) => h + h).join("");
|
|
29
|
+
}
|
|
30
|
+
const intVal = parseInt(hex, 16);
|
|
31
|
+
return {
|
|
32
|
+
r: intVal >> 16 & 255,
|
|
33
|
+
// 提取红色分量
|
|
34
|
+
g: intVal >> 8 & 255,
|
|
35
|
+
// 提取绿色分量
|
|
36
|
+
b: intVal & 255
|
|
37
|
+
// 提取蓝色分量
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
var rgbToHex = (r, g, b) => {
|
|
41
|
+
return "#" + [r, g, b].map((x) => {
|
|
42
|
+
const hex = x.toString(16);
|
|
43
|
+
return hex.length === 1 ? "0" + hex : hex;
|
|
44
|
+
}).join("");
|
|
45
|
+
};
|
|
46
|
+
var parseColor = (color) => {
|
|
47
|
+
if (color.startsWith("#")) {
|
|
48
|
+
return hexToRgb(color);
|
|
49
|
+
} else if (color.startsWith("rgb")) {
|
|
50
|
+
const rgba = color.replace(/rgba?\(|\s+|\)/g, "").split(",").map(Number);
|
|
51
|
+
return { r: rgba[0], g: rgba[1], b: rgba[2], a: rgba[3] !== void 0 ? rgba[3] : 1 };
|
|
52
|
+
} else {
|
|
53
|
+
throw new Error("无效的颜色格式");
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var generateColorShades = (color) => {
|
|
57
|
+
const { r, g, b, a } = parseColor(color);
|
|
58
|
+
const max = 700;
|
|
59
|
+
const gap = 1 / max;
|
|
60
|
+
const ratios = {
|
|
61
|
+
50: gap * 50,
|
|
62
|
+
200: gap * 200,
|
|
63
|
+
500: gap * 500,
|
|
64
|
+
600: gap * 600,
|
|
65
|
+
700: gap * 700
|
|
66
|
+
};
|
|
67
|
+
const adjustColorComponent = (component, ratio) => Math.round(component * ratio + 255 * (1 - ratio));
|
|
68
|
+
const shades = {
|
|
69
|
+
"color_50": rgbToHex(adjustColorComponent(r, ratios[50]), adjustColorComponent(g, ratios[50]), adjustColorComponent(b, ratios[50])),
|
|
70
|
+
"color_200": rgbToHex(adjustColorComponent(r, ratios[200]), adjustColorComponent(g, ratios[200]), adjustColorComponent(b, ratios[200])),
|
|
71
|
+
"color_500": rgbToHex(adjustColorComponent(r, ratios[500]), adjustColorComponent(g, ratios[500]), adjustColorComponent(b, ratios[500])),
|
|
72
|
+
"color_600": rgbToHex(adjustColorComponent(r, ratios[600]), adjustColorComponent(g, ratios[600]), adjustColorComponent(b, ratios[600])),
|
|
73
|
+
"color_700": color
|
|
74
|
+
};
|
|
75
|
+
if (a !== void 0) {
|
|
76
|
+
shades["color_50"] = `rgba(${adjustColorComponent(r, ratios[50])}, ${adjustColorComponent(g, ratios[50])}, ${adjustColorComponent(b, ratios[50])}, ${a})`;
|
|
77
|
+
shades["color_200"] = `rgba(${adjustColorComponent(r, ratios[200])}, ${adjustColorComponent(g, ratios[200])}, ${adjustColorComponent(b, ratios[200])}, ${a})`;
|
|
78
|
+
shades["color_500"] = `rgba(${adjustColorComponent(r, ratios[500])}, ${adjustColorComponent(g, ratios[500])}, ${adjustColorComponent(b, ratios[500])}, ${a})`;
|
|
79
|
+
shades["color_600"] = `rgba(${adjustColorComponent(r, ratios[600])}, ${adjustColorComponent(g, ratios[600])}, ${adjustColorComponent(b, ratios[600])}, ${a})`;
|
|
80
|
+
}
|
|
81
|
+
return shades;
|
|
82
|
+
};
|
|
83
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
84
|
+
0 && (module.exports = {
|
|
85
|
+
generateColorShades
|
|
86
|
+
});
|
|
@@ -33,7 +33,7 @@ __export(Amount_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(Amount_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
|
-
var
|
|
36
|
+
var import_utils = require("@pisell/utils");
|
|
37
37
|
var import_usePisellConfig = __toESM(require("../../../pisell-config-provider/hooks/usePisellConfig"));
|
|
38
38
|
var Amount = (props) => {
|
|
39
39
|
const {
|
|
@@ -46,7 +46,7 @@ var Amount = (props) => {
|
|
|
46
46
|
} = props;
|
|
47
47
|
const config = (0, import_usePisellConfig.default)();
|
|
48
48
|
const amount = (0, import_react.useMemo)(() => {
|
|
49
|
-
return (0,
|
|
49
|
+
return (0, import_utils.formatAmountWithOptions)(value, (config == null ? void 0 : config.symbol) || "", {
|
|
50
50
|
precision,
|
|
51
51
|
showCurrencySymbol,
|
|
52
52
|
useThousandsSeparator,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export interface PisellViewGridProps {
|
|
4
|
+
columns?: number;
|
|
5
|
+
horizontalGap?: number;
|
|
6
|
+
verticalGap?: number;
|
|
7
|
+
singleRow?: boolean;
|
|
8
|
+
dataSource?: any[];
|
|
9
|
+
renderItem?: (item: any, index: number) => React.ReactNode;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
}
|
|
15
|
+
declare const PisellViewGrid: React.FC<PisellViewGridProps>;
|
|
16
|
+
export default PisellViewGrid;
|
|
@@ -0,0 +1,98 @@
|
|
|
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/components/pisellViewGrid/index.tsx
|
|
30
|
+
var pisellViewGrid_exports = {};
|
|
31
|
+
__export(pisellViewGrid_exports, {
|
|
32
|
+
default: () => pisellViewGrid_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(pisellViewGrid_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_pisellLoading = __toESM(require("../pisellLoading"));
|
|
37
|
+
var import_classnames = __toESM(require("classnames"));
|
|
38
|
+
var import_index = require("./index.less");
|
|
39
|
+
var PisellViewGrid = ({
|
|
40
|
+
columns = 3,
|
|
41
|
+
horizontalGap = 10,
|
|
42
|
+
verticalGap = 10,
|
|
43
|
+
singleRow = false,
|
|
44
|
+
dataSource = [],
|
|
45
|
+
renderItem,
|
|
46
|
+
loading = false,
|
|
47
|
+
children,
|
|
48
|
+
className,
|
|
49
|
+
style
|
|
50
|
+
}) => {
|
|
51
|
+
const classes = (0, import_classnames.default)(
|
|
52
|
+
"pisell-view-grid",
|
|
53
|
+
{
|
|
54
|
+
"pisell-view-grid-single-row": singleRow
|
|
55
|
+
},
|
|
56
|
+
className
|
|
57
|
+
);
|
|
58
|
+
return /* @__PURE__ */ import_react.default.createElement(import_pisellLoading.default, { loading, fullscreen: false, style: { width: "100%" } }, /* @__PURE__ */ import_react.default.createElement(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
className: classes,
|
|
62
|
+
style: {
|
|
63
|
+
...style,
|
|
64
|
+
width: "100%",
|
|
65
|
+
overflow: "hidden"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
className: "pisell-view-grid-content",
|
|
72
|
+
style: !singleRow ? {
|
|
73
|
+
gap: `${verticalGap}px ${horizontalGap}px`,
|
|
74
|
+
gridTemplateColumns: `repeat(${columns}, 1fr)`,
|
|
75
|
+
width: "100%"
|
|
76
|
+
} : {
|
|
77
|
+
display: "flex",
|
|
78
|
+
flexWrap: "nowrap",
|
|
79
|
+
overflowX: "auto",
|
|
80
|
+
width: "100%"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
dataSource.map((item, index) => /* @__PURE__ */ import_react.default.createElement(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
key: index,
|
|
87
|
+
className: "pisell-view-grid-item",
|
|
88
|
+
style: {
|
|
89
|
+
minWidth: 0,
|
|
90
|
+
flex: `0 0 calc(100% / ${columns})`
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
renderItem == null ? void 0 : renderItem(item, index)
|
|
94
|
+
))
|
|
95
|
+
)
|
|
96
|
+
));
|
|
97
|
+
};
|
|
98
|
+
var pisellViewGrid_default = PisellViewGrid;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.pisell-view-grid {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
|
|
7
|
+
&-content {
|
|
8
|
+
display: grid;
|
|
9
|
+
width: 100%;
|
|
10
|
+
// grid-template-columns: repeat(4, 1fr);
|
|
11
|
+
// gap: 10px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&-item {
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&-single-row {
|
|
19
|
+
&::-webkit-scrollbar {
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
22
|
+
-ms-overflow-style: none;
|
|
23
|
+
scrollbar-width: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// &-item {
|
|
27
|
+
// box-sizing: border-box;
|
|
28
|
+
// display: inline-block;
|
|
29
|
+
// vertical-align: top;
|
|
30
|
+
// }
|
|
31
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MenuProps } from 'antd';
|
|
3
|
+
import './index.less';
|
|
4
|
+
interface AvatarConfig {
|
|
5
|
+
src?: string;
|
|
6
|
+
alt?: string;
|
|
7
|
+
}
|
|
8
|
+
interface ProfileMenuProps {
|
|
9
|
+
menuIcon?: React.ReactNode;
|
|
10
|
+
userName?: string;
|
|
11
|
+
email?: string;
|
|
12
|
+
isShowUserName?: boolean;
|
|
13
|
+
isShowEmail?: boolean;
|
|
14
|
+
isShowUserInfo?: boolean;
|
|
15
|
+
onClick?: () => void;
|
|
16
|
+
avatar?: AvatarConfig;
|
|
17
|
+
className?: string;
|
|
18
|
+
style?: React.CSSProperties;
|
|
19
|
+
menuItems?: MenuProps['items'];
|
|
20
|
+
placement?: 'bottomLeft' | 'bottomCenter' | 'bottomRight' | 'topLeft' | 'topCenter' | 'topRight';
|
|
21
|
+
trigger?: ('click' | 'hover')[];
|
|
22
|
+
showBadge?: boolean;
|
|
23
|
+
badgeCount?: number;
|
|
24
|
+
}
|
|
25
|
+
declare const ProfileMenu: React.FC<ProfileMenuProps>;
|
|
26
|
+
export default ProfileMenu;
|