@pisell/materials 1.0.1034 → 1.0.1035
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 +1 -1
- package/build/lowcode/preview.js +17 -17
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +18 -23
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +27 -32
- package/es/components/Pagination/index.js +1 -1
- package/es/components/PisellCards/index.d.ts +6 -6
- package/es/components/calendar/index.d.ts +2 -2
- package/es/components/checkbox/index.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Input.Email/index.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Input.Password/index.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +3 -3
- package/es/components/dataSourceComponents/fields/Input.TextArea/index.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/es/components/date-picker/index.d.ts +2 -2
- package/es/components/filter/components/Dropdown/index.js +6 -2
- package/es/components/filter/components/FilterButton/index.js +3 -2
- package/es/components/filter/components/FilterButton/types.d.ts +5 -2
- package/es/components/filter/components/FilterItem/AsyncOptionsSelectWrapper.js +67 -0
- package/es/components/filter/components/FilterItem/index.js +105 -6
- package/es/components/filter/components/FilterItem/index.less +90 -0
- package/es/components/filter/types.d.ts +4 -2
- package/es/components/input/index.d.ts +2 -2
- package/es/components/pisell-config-provider/context.d.ts +2 -2
- package/es/components/pisellCurrency/PisellCurrency.less +163 -25
- package/es/components/pisellDatePicker/index.d.ts +2 -2
- package/es/components/pisellDateTimeDisplay/PisellDateTimeDisplay.js +11 -10
- package/es/components/pisellDateTimeDisplay/types.d.ts +5 -0
- package/es/components/pisellEmail/PisellEmail.d.ts +2 -33
- package/es/components/pisellEmail/PisellEmail.js +1 -1
- package/es/components/pisellEmail/PisellEmail.less +119 -10
- package/es/components/pisellEmail/index.d.ts +1 -1
- package/es/components/pisellFilter/docs/PisellFilter.md +289 -232
- package/es/components/pisellFilter/index.js +66 -11
- package/es/components/pisellLongText/PisellLongText.less +72 -4
- package/es/components/pisellLookup/PisellLookup.js +3 -3
- package/es/components/pisellLookup/PisellLookup.less +14 -9
- package/es/components/pisellLookup/components/LookupTrigger.js +6 -2
- package/es/components/pisellMetricCard/PisellMetricCard.d.ts +38 -0
- package/es/components/pisellMetricCard/PisellMetricCard.js +136 -0
- package/es/components/pisellMetricCard/components/MetricComparison.js +54 -0
- package/es/components/pisellMetricCard/components/MetricTitle.js +41 -0
- package/es/components/pisellMetricCard/components/MetricValue.js +26 -0
- package/es/components/pisellMetricCard/components/TrendIcon.js +26 -0
- package/es/components/pisellMetricCard/docs/pisellMetricCard.$tab-design.md +2 -6
- package/es/components/pisellMetricCard/index.d.ts +2 -0
- package/es/components/pisellMetricCard/types.d.ts +143 -0
- package/es/components/pisellMetricCard/utils/calculateTrend.js +22 -0
- package/es/components/pisellMetricCard/utils/formatMetricValue.js +52 -0
- package/es/components/pisellMultipleSelect/PisellMultipleSelect.less +151 -124
- package/es/components/pisellMultipleSelect/components/EditView.js +8 -1
- package/es/components/pisellMultipleSelect/components/ReadOnlyView.js +18 -6
- package/es/components/pisellNumber/PisellNumber.less +135 -17
- package/es/components/pisellPercent/PisellPercent.less +142 -24
- package/es/components/pisellPhone/PisellPhone.less +122 -27
- package/es/components/pisellPhone/components/EditView.js +1 -1
- package/es/components/pisellPhone/components/ReadOnlyView.js +15 -5
- package/es/components/pisellPhone/utils/countryCodeHelper.js +1 -10
- package/es/components/pisellRating/PisellRating.less +20 -12
- package/es/components/pisellRecordBoard/PisellRecordBoard.js +148 -0
- package/es/components/pisellRecordBoard/README.md +183 -0
- package/es/components/pisellRecordBoard/context/RecordBoardContext.js +7 -0
- package/es/components/pisellRecordBoard/context/RecordBoardProvider.js +14 -0
- package/es/components/pisellRecordBoard/docs/PisellRecordBoard.$tab-design.md +128 -0
- package/es/components/pisellRecordBoard/docs/PisellRecordBoard.$tab-dev.md +82 -0
- package/es/components/pisellRecordBoard/docs/PisellRecordBoard.$tab-test.md +70 -0
- package/es/components/pisellRecordBoard/docs/PisellRecordBoard.md +552 -0
- package/es/components/pisellRecordBoard/hooks/useRecordBoardContext.d.ts +20 -0
- package/es/components/pisellRecordBoard/hooks/useRecordBoardContext.js +16 -0
- package/es/components/pisellRecordBoard/index.d.ts +40 -0
- package/es/components/pisellRecordBoard/index.js +28 -0
- package/es/components/pisellRecordBoard/layouts/CardLayout/CardList.d.ts +15 -0
- package/es/components/pisellRecordBoard/layouts/CardLayout/CardList.js +24 -0
- package/es/components/pisellRecordBoard/layouts/CardLayout/index.d.ts +15 -0
- package/es/components/pisellRecordBoard/layouts/CardLayout/index.js +21 -0
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.d.ts +17 -0
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.js +105 -0
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.less +13 -0
- package/es/components/pisellRecordBoard/layouts/GridLayout/index.d.ts +15 -0
- package/es/components/pisellRecordBoard/layouts/GridLayout/index.js +21 -0
- package/es/components/pisellRecordBoard/shellFrame/BatchActionBar/index.d.ts +12 -0
- package/es/components/pisellRecordBoard/shellFrame/BatchActionBar/index.js +69 -0
- package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/ColumnSettingPopover.js +40 -0
- package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/index.js +60 -0
- package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/index.less +2 -0
- package/es/components/pisellRecordBoard/shellFrame/Pagination/index.d.ts +17 -0
- package/es/components/pisellRecordBoard/shellFrame/Pagination/index.js +52 -0
- package/es/components/pisellRecordBoard/shellFrame/Pagination/index.less +61 -0
- package/es/components/pisellRecordBoard/shellFrame/Search/index.d.ts +13 -0
- package/es/components/pisellRecordBoard/shellFrame/Search/index.js +34 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +77 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.d.ts +14 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.js +136 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBarQuickFilter/index.d.ts +2 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBarQuickFilter/index.js +62 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBarReset/index.d.ts +2 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBarReset/index.js +45 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBarReset/index.less +41 -0
- package/es/components/pisellRecordBoard/shellFrame/index.d.ts +27 -0
- package/es/components/pisellRecordBoard/shellFrame/index.js +38 -0
- package/es/components/pisellRecordBoard/types.d.ts +259 -0
- package/es/components/pisellRecordBoard/utils/recordBoardColumns.js +287 -0
- package/es/components/pisellShellFrame/PisellShellFrame.d.ts +16 -0
- package/es/components/pisellShellFrame/PisellShellFrame.js +60 -0
- package/es/components/pisellShellFrame/PisellShellFrame.less +73 -0
- package/es/components/pisellShellFrame/README.md +58 -0
- package/es/components/pisellShellFrame/index.d.ts +2 -0
- package/es/components/pisellShellFrame/types.d.ts +60 -0
- package/es/components/pisellSingleSelect/PisellSingleSelect.less +88 -46
- package/es/components/pisellSingleSelect/components/EditView.js +8 -1
- package/es/components/pisellSingleSelect/components/ReadOnlyView.js +8 -2
- package/es/components/pisellUrl/PisellUrl.d.ts +2 -33
- package/es/components/pisellUrl/PisellUrl.js +1 -1
- package/es/components/pisellUrl/PisellUrl.less +120 -11
- package/es/components/pisellUrl/index.d.ts +1 -1
- package/es/components/radio/index.d.ts +2 -2
- package/es/components/section-footers/index.d.ts +2 -2
- package/es/components/skeleton/index.d.ts +2 -2
- package/es/components/sort/index.js +12 -1
- package/es/components/sort/types.d.ts +8 -2
- package/es/components/time-picker/index.d.ts +2 -2
- package/es/index.d.ts +19 -11
- package/es/index.js +19 -15
- package/es/locales/en-US.js +16 -2
- package/es/locales/zh-CN.js +18 -4
- package/es/locales/zh-TW.js +18 -4
- package/es/utils/tagColor.js +31 -0
- package/lib/components/Pagination/index.js +1 -1
- package/lib/components/checkbox/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Checkbox/WithMode.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Input.Password/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Input.TextArea/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/lib/components/filter/components/Dropdown/index.js +6 -2
- package/lib/components/filter/components/FilterButton/index.js +3 -2
- package/lib/components/filter/components/FilterButton/types.d.ts +5 -2
- package/lib/components/filter/components/FilterItem/AsyncOptionsSelectWrapper.js +69 -0
- package/lib/components/filter/components/FilterItem/index.js +106 -6
- package/lib/components/filter/components/FilterItem/index.less +90 -0
- package/lib/components/filter/types.d.ts +4 -2
- package/lib/components/input/index.d.ts +2 -2
- package/lib/components/pisell-config-provider/context.d.ts +2 -2
- package/lib/components/pisellCurrency/PisellCurrency.less +163 -25
- package/lib/components/pisellDatePicker/index.d.ts +2 -2
- package/lib/components/pisellDateTimeDisplay/PisellDateTimeDisplay.js +11 -10
- package/lib/components/pisellDateTimeDisplay/types.d.ts +5 -0
- package/lib/components/pisellEmail/PisellEmail.d.ts +2 -33
- package/lib/components/pisellEmail/PisellEmail.js +1 -1
- package/lib/components/pisellEmail/PisellEmail.less +119 -10
- package/lib/components/pisellEmail/index.d.ts +1 -1
- package/lib/components/pisellFilter/docs/PisellFilter.md +289 -232
- package/lib/components/pisellFilter/index.js +65 -10
- package/lib/components/pisellLongText/PisellLongText.less +72 -4
- package/lib/components/pisellLookup/PisellLookup.js +3 -3
- package/lib/components/pisellLookup/PisellLookup.less +14 -9
- package/lib/components/pisellLookup/components/LookupTrigger.js +6 -2
- package/lib/components/pisellMetricCard/PisellMetricCard.d.ts +38 -0
- package/lib/components/pisellMetricCard/PisellMetricCard.js +138 -0
- package/lib/components/pisellMetricCard/components/MetricComparison.js +56 -0
- package/lib/components/pisellMetricCard/components/MetricTitle.js +43 -0
- package/lib/components/pisellMetricCard/components/MetricValue.js +28 -0
- package/lib/components/pisellMetricCard/components/TrendIcon.js +28 -0
- package/lib/components/pisellMetricCard/docs/pisellMetricCard.$tab-design.md +2 -6
- package/lib/components/pisellMetricCard/index.d.ts +2 -0
- package/lib/components/pisellMetricCard/types.d.ts +143 -0
- package/lib/components/pisellMetricCard/utils/calculateTrend.js +23 -0
- package/lib/components/pisellMetricCard/utils/formatMetricValue.js +53 -0
- package/lib/components/pisellMultipleSelect/PisellMultipleSelect.less +151 -124
- package/lib/components/pisellMultipleSelect/components/EditView.js +7 -0
- package/lib/components/pisellMultipleSelect/components/ReadOnlyView.js +17 -5
- package/lib/components/pisellNumber/PisellNumber.less +135 -17
- package/lib/components/pisellPercent/PisellPercent.less +142 -24
- package/lib/components/pisellPhone/PisellPhone.less +122 -27
- package/lib/components/pisellPhone/components/EditView.js +1 -1
- package/lib/components/pisellPhone/components/ReadOnlyView.js +15 -5
- package/lib/components/pisellPhone/utils/countryCodeHelper.js +0 -10
- package/lib/components/pisellRating/PisellRating.less +20 -12
- package/lib/components/pisellRecordBoard/PisellRecordBoard.js +150 -0
- package/lib/components/pisellRecordBoard/README.md +183 -0
- package/lib/components/pisellRecordBoard/context/RecordBoardContext.js +8 -0
- package/lib/components/pisellRecordBoard/context/RecordBoardProvider.js +16 -0
- package/lib/components/pisellRecordBoard/docs/PisellRecordBoard.$tab-design.md +128 -0
- package/lib/components/pisellRecordBoard/docs/PisellRecordBoard.$tab-dev.md +82 -0
- package/lib/components/pisellRecordBoard/docs/PisellRecordBoard.$tab-test.md +70 -0
- package/lib/components/pisellRecordBoard/docs/PisellRecordBoard.md +552 -0
- package/lib/components/pisellRecordBoard/hooks/useRecordBoardContext.d.ts +20 -0
- package/lib/components/pisellRecordBoard/hooks/useRecordBoardContext.js +17 -0
- package/lib/components/pisellRecordBoard/index.d.ts +40 -0
- package/lib/components/pisellRecordBoard/index.js +28 -0
- package/lib/components/pisellRecordBoard/layouts/CardLayout/CardList.d.ts +15 -0
- package/lib/components/pisellRecordBoard/layouts/CardLayout/CardList.js +26 -0
- package/lib/components/pisellRecordBoard/layouts/CardLayout/index.d.ts +15 -0
- package/lib/components/pisellRecordBoard/layouts/CardLayout/index.js +23 -0
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.d.ts +17 -0
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.js +107 -0
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.less +13 -0
- package/lib/components/pisellRecordBoard/layouts/GridLayout/index.d.ts +15 -0
- package/lib/components/pisellRecordBoard/layouts/GridLayout/index.js +23 -0
- package/lib/components/pisellRecordBoard/shellFrame/BatchActionBar/index.d.ts +12 -0
- package/lib/components/pisellRecordBoard/shellFrame/BatchActionBar/index.js +71 -0
- package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/ColumnSettingPopover.js +43 -0
- package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/index.js +62 -0
- package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/index.less +2 -0
- package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.d.ts +17 -0
- package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.js +54 -0
- package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.less +61 -0
- package/lib/components/pisellRecordBoard/shellFrame/Search/index.d.ts +13 -0
- package/lib/components/pisellRecordBoard/shellFrame/Search/index.js +36 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +77 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.d.ts +14 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.js +139 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBarQuickFilter/index.js +64 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBarReset/index.d.ts +2 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBarReset/index.js +47 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBarReset/index.less +41 -0
- package/lib/components/pisellRecordBoard/shellFrame/index.d.ts +26 -0
- package/lib/components/pisellRecordBoard/shellFrame/index.js +40 -0
- package/lib/components/pisellRecordBoard/types.d.ts +259 -0
- package/lib/components/pisellRecordBoard/utils/recordBoardColumns.js +292 -0
- package/lib/components/pisellShellFrame/PisellShellFrame.d.ts +16 -0
- package/lib/components/pisellShellFrame/PisellShellFrame.js +62 -0
- package/lib/components/pisellShellFrame/PisellShellFrame.less +73 -0
- package/lib/components/pisellShellFrame/README.md +58 -0
- package/lib/components/pisellShellFrame/index.d.ts +2 -0
- package/lib/components/pisellShellFrame/types.d.ts +60 -0
- package/lib/components/pisellSingleSelect/PisellSingleSelect.less +88 -46
- package/lib/components/pisellSingleSelect/components/EditView.js +7 -0
- package/lib/components/pisellSingleSelect/components/ReadOnlyView.js +8 -2
- package/lib/components/pisellUrl/PisellUrl.d.ts +2 -33
- package/lib/components/pisellUrl/PisellUrl.js +1 -1
- package/lib/components/pisellUrl/PisellUrl.less +120 -11
- package/lib/components/pisellUrl/index.d.ts +1 -1
- package/lib/components/radio/index.d.ts +2 -2
- package/lib/components/section-footers/index.d.ts +2 -2
- package/lib/components/skeleton/index.d.ts +2 -2
- package/lib/components/sort/index.js +12 -1
- package/lib/components/sort/types.d.ts +8 -2
- package/lib/components/time-picker/index.d.ts +2 -2
- package/lib/components/upload/index.d.ts +2 -2
- package/lib/index.d.ts +19 -11
- package/lib/index.js +33 -25
- package/lib/locales/en-US.js +16 -2
- package/lib/locales/zh-CN.js +18 -4
- package/lib/locales/zh-TW.js +18 -4
- package/lib/utils/tagColor.js +32 -0
- package/package.json +3 -3
|
@@ -254,9 +254,7 @@ https://www.figma.com/design/pM8Ho6d7kCMv9vIBvFHUlj/Pisell-2.0-Component-Library
|
|
|
254
254
|
- 显示数值 "3249"
|
|
255
255
|
- 显示环比 "v.s. pre -230" + 红色下降箭头
|
|
256
256
|
|
|
257
|
-
## 7.4
|
|
258
|
-
|
|
259
|
-
```
|
|
257
|
+
## 7.4 带副标题和标签示例```
|
|
260
258
|
<PisellMetricCard
|
|
261
259
|
title="Active Users"
|
|
262
260
|
subtitle="Last 30 days"
|
|
@@ -317,7 +315,5 @@ https://www.figma.com/design/pM8Ho6d7kCMv9vIBvFHUlj/Pisell-2.0-Component-Library
|
|
|
317
315
|
|
|
318
316
|
- 使用 Ant Design 图标库:`ArrowUpOutlined`、`ArrowDownOutlined`
|
|
319
317
|
- 根据 `comparison` 值自动判断正负
|
|
320
|
-
-
|
|
321
|
-
|
|
322
|
-
## 8.4 响应式设计- 支持移动端、平板、PC 端自适应
|
|
318
|
+
- 正值显示绿色上升箭头,负值显示红色下降箭头## 8.4 响应式设计- 支持移动端、平板、PC 端自适应
|
|
323
319
|
- 可根据容器宽度自动调整布局
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/pisellMetricCard/types.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* 数值格式化配置
|
|
6
|
+
*/
|
|
7
|
+
interface ValueFormatConfig {
|
|
8
|
+
/** 小数精度(小数位数),默认 0 */
|
|
9
|
+
precision?: number;
|
|
10
|
+
/** 是否使用千分位分隔符,默认 false */
|
|
11
|
+
useGrouping?: boolean;
|
|
12
|
+
/** 是否显示货币符号,默认 false */
|
|
13
|
+
showCurrencySymbol?: boolean;
|
|
14
|
+
/** 货币符号(如 $, ¥),默认 '' */
|
|
15
|
+
currencySymbol?: string;
|
|
16
|
+
/** 自定义格式化函数 */
|
|
17
|
+
formatter?: (value: number | null) => string;
|
|
18
|
+
/** 整数时隐藏小数部分,默认 true */
|
|
19
|
+
hideDecimalForWholeNumbers?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 环比配置
|
|
23
|
+
*/
|
|
24
|
+
interface ComparisonConfig {
|
|
25
|
+
/** 环比数值(支持正负值) */
|
|
26
|
+
value: number | string | null;
|
|
27
|
+
/** 环比前缀文本,默认 'v.s. pre' */
|
|
28
|
+
text?: string;
|
|
29
|
+
/** 是否显示趋势箭头,默认 true */
|
|
30
|
+
showTrendIcon?: boolean;
|
|
31
|
+
/** 正向趋势颜色,默认 '#52c41a' */
|
|
32
|
+
positiveColor?: string;
|
|
33
|
+
/** 负向趋势颜色,默认 '#ff4d4f' */
|
|
34
|
+
negativeColor?: string;
|
|
35
|
+
/** 环比字号,默认 14 */
|
|
36
|
+
size?: number | string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 样式配置
|
|
40
|
+
*/
|
|
41
|
+
interface MetricCardStyleConfig {
|
|
42
|
+
/** 卡片容器样式 */
|
|
43
|
+
card?: {
|
|
44
|
+
/** 是否显示边框,默认 true */bordered?: boolean; /** 圆角大小(px),默认 12 */
|
|
45
|
+
borderRadius?: number; /** 内边距(px),默认 16 */
|
|
46
|
+
padding?: number; /** 阴影效果,默认 true */
|
|
47
|
+
shadow?: boolean | string; /** 背景色,默认 '#ffffff' */
|
|
48
|
+
background?: string; /** 卡片宽度,默认 'auto' */
|
|
49
|
+
width?: string | number;
|
|
50
|
+
};
|
|
51
|
+
/** 标题样式 */
|
|
52
|
+
title?: {
|
|
53
|
+
/** 字号,默认 14 */size?: number | string; /** 字重,默认 400 */
|
|
54
|
+
weight?: number | string; /** 颜色,默认 'rgba(0, 0, 0, 0.45)' */
|
|
55
|
+
color?: string;
|
|
56
|
+
};
|
|
57
|
+
/** 数值样式 */
|
|
58
|
+
value?: {
|
|
59
|
+
/** 字号,默认 30 */size?: number | string; /** 字重,默认 600 */
|
|
60
|
+
weight?: number | string; /** 颜色,默认 'rgba(0, 0, 0, 0.85)' */
|
|
61
|
+
color?: string;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* PisellMetricCard 组件 Props
|
|
66
|
+
*
|
|
67
|
+
* 采用扁平 + 对象组合的设计,降低复杂度和耦合
|
|
68
|
+
*
|
|
69
|
+
* @example 基础用法
|
|
70
|
+
* ```tsx
|
|
71
|
+
* <PisellMetricCard
|
|
72
|
+
* title="Total Sales"
|
|
73
|
+
* value={1580}
|
|
74
|
+
* />
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* @example 带格式化和环比
|
|
78
|
+
* ```tsx
|
|
79
|
+
* <PisellMetricCard
|
|
80
|
+
* title="Revenue"
|
|
81
|
+
* value={1580}
|
|
82
|
+
* format={{
|
|
83
|
+
* showCurrencySymbol: true,
|
|
84
|
+
* currencySymbol: '$',
|
|
85
|
+
* useGrouping: true
|
|
86
|
+
* }}
|
|
87
|
+
* comparison={{
|
|
88
|
+
* value: 120,
|
|
89
|
+
* text: 'v.s. last month'
|
|
90
|
+
* }}
|
|
91
|
+
* />
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
interface PisellMetricCardProps {
|
|
95
|
+
/** 标题文本 */
|
|
96
|
+
title: string | ReactNode;
|
|
97
|
+
/** 主数值 */
|
|
98
|
+
value: number | string | null;
|
|
99
|
+
/** 副标题文本(可选) */
|
|
100
|
+
subtitle?: string | ReactNode;
|
|
101
|
+
/** 标签内容(可选) */
|
|
102
|
+
tag?: ReactNode;
|
|
103
|
+
/** 提示信息内容(可选) */
|
|
104
|
+
tooltip?: string | ReactNode;
|
|
105
|
+
/**
|
|
106
|
+
* 数值格式化配置
|
|
107
|
+
* @example format={{ precision: 2, useGrouping: true, currencySymbol: '$' }}
|
|
108
|
+
*/
|
|
109
|
+
format?: ValueFormatConfig;
|
|
110
|
+
/**
|
|
111
|
+
* 环比配置
|
|
112
|
+
* @example comparison={{ value: 120, text: 'v.s. pre' }}
|
|
113
|
+
*/
|
|
114
|
+
comparison?: ComparisonConfig;
|
|
115
|
+
/**
|
|
116
|
+
* 样式配置
|
|
117
|
+
* @example
|
|
118
|
+
* styleConfig={{
|
|
119
|
+
* card: { borderRadius: 8, padding: 24 },
|
|
120
|
+
* title: { size: 16, weight: 600 },
|
|
121
|
+
* value: { size: 36, color: '#1890ff' }
|
|
122
|
+
* }}
|
|
123
|
+
*/
|
|
124
|
+
styleConfig?: MetricCardStyleConfig;
|
|
125
|
+
/** 是否显示副标题,默认 false */
|
|
126
|
+
showSubtitle?: boolean;
|
|
127
|
+
/** 是否显示标签,默认 false */
|
|
128
|
+
showTag?: boolean;
|
|
129
|
+
/** 是否显示提示信息,默认 false */
|
|
130
|
+
showTooltip?: boolean;
|
|
131
|
+
/** 是否显示加载状态,默认 false */
|
|
132
|
+
loading?: boolean;
|
|
133
|
+
/** 鼠标悬停是否有交互效果,默认 true */
|
|
134
|
+
hoverable?: boolean;
|
|
135
|
+
/** 自定义类名 */
|
|
136
|
+
className?: string;
|
|
137
|
+
/** 自定义样式 */
|
|
138
|
+
style?: CSSProperties;
|
|
139
|
+
/** 点击卡片回调 */
|
|
140
|
+
onClick?: () => void;
|
|
141
|
+
}
|
|
142
|
+
//#endregion
|
|
143
|
+
export { PisellMetricCardProps };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/components/pisellMetricCard/utils/calculateTrend.ts
|
|
3
|
+
/**
|
|
4
|
+
* 计算趋势方向
|
|
5
|
+
*
|
|
6
|
+
* @param comparison 环比数值
|
|
7
|
+
* @returns 'up' | 'down' | 'neutral'
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* calculateTrend(120) // 'up'
|
|
11
|
+
* calculateTrend(-230) // 'down'
|
|
12
|
+
* calculateTrend(0) // 'neutral'
|
|
13
|
+
* calculateTrend(null) // 'neutral'
|
|
14
|
+
*/
|
|
15
|
+
function calculateTrend(comparison) {
|
|
16
|
+
if (comparison === null || comparison === void 0) return "neutral";
|
|
17
|
+
const numComparison = typeof comparison === "string" ? parseFloat(comparison) : comparison;
|
|
18
|
+
if (isNaN(numComparison) || numComparison === 0) return "neutral";
|
|
19
|
+
return numComparison > 0 ? "up" : "down";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.calculateTrend = calculateTrend;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.js');
|
|
2
|
+
let _pisell_utils = require("@pisell/utils");
|
|
3
|
+
|
|
4
|
+
//#region src/components/pisellMetricCard/utils/formatMetricValue.ts
|
|
5
|
+
/**
|
|
6
|
+
* 格式化指标数值
|
|
7
|
+
*
|
|
8
|
+
* 支持以下格式化选项:
|
|
9
|
+
* - 小数精度控制
|
|
10
|
+
* - 千分位分隔符
|
|
11
|
+
* - 货币符号显示
|
|
12
|
+
* - 自定义格式化函数
|
|
13
|
+
* - 整数时隐藏小数部分
|
|
14
|
+
*
|
|
15
|
+
* @param value 数值
|
|
16
|
+
* @param options 格式化选项
|
|
17
|
+
* @returns 格式化后的字符串,null 时返回 null
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* formatMetricValue(1234.56, { precision: 2, useGrouping: true })
|
|
21
|
+
* // 返回: "1,234.56"
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* formatMetricValue(1580, {
|
|
25
|
+
* showCurrencySymbol: true,
|
|
26
|
+
* currencySymbol: '$'
|
|
27
|
+
* })
|
|
28
|
+
* // 返回: "$1580"
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* formatMetricValue(100.00, {
|
|
32
|
+
* precision: 2,
|
|
33
|
+
* hideDecimalForWholeNumbers: true
|
|
34
|
+
* })
|
|
35
|
+
* // 返回: "100"
|
|
36
|
+
*/
|
|
37
|
+
function formatMetricValue(value, options = {}) {
|
|
38
|
+
var _options$precision, _options$useGrouping, _options$showCurrency, _options$hideDecimalF;
|
|
39
|
+
if (value === null || value === void 0) return null;
|
|
40
|
+
const numValue = typeof value === "string" ? parseFloat(value) : value;
|
|
41
|
+
if (isNaN(numValue)) return null;
|
|
42
|
+
if (options.formatter) return options.formatter(numValue);
|
|
43
|
+
const formatted = (0, _pisell_utils.formatAmountWithOptions)(numValue, options.currencySymbol || "", {
|
|
44
|
+
precision: (_options$precision = options.precision) !== null && _options$precision !== void 0 ? _options$precision : 0,
|
|
45
|
+
useThousandsSeparator: (_options$useGrouping = options.useGrouping) !== null && _options$useGrouping !== void 0 ? _options$useGrouping : false,
|
|
46
|
+
showCurrencySymbol: (_options$showCurrency = options.showCurrencySymbol) !== null && _options$showCurrency !== void 0 ? _options$showCurrency : false,
|
|
47
|
+
hideDecimalForWholeNumbers: (_options$hideDecimalF = options.hideDecimalForWholeNumbers) !== null && _options$hideDecimalF !== void 0 ? _options$hideDecimalF : true
|
|
48
|
+
});
|
|
49
|
+
return String(formatted);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
exports.formatMetricValue = formatMetricValue;
|
|
@@ -1,53 +1,131 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* PisellMultipleSelect 组件样式
|
|
3
|
-
*
|
|
4
|
-
* 注意:大部分样式通过 tokens.ts 中的 Select Token 配置实现
|
|
5
|
-
* 此文件仅包含 Token 无法实现的样式
|
|
3
|
+
* 基于 Figma 设计规范,覆盖时使用 pisell-lowcode-xxx
|
|
6
4
|
*/
|
|
7
5
|
|
|
8
6
|
.pisell-multiple-select {
|
|
7
|
+
height: 48px !important;
|
|
9
8
|
width: 100%;
|
|
10
9
|
|
|
11
|
-
//
|
|
10
|
+
// Select 触发器(Figma 设计规范,与 SingleSelect / Input 体系一致)
|
|
11
|
+
.pisell-lowcode-select:not(.pisell-lowcode-select-disabled):not(.pisell-lowcode-select-customize-input) {
|
|
12
|
+
.pisell-lowcode-select-selector {
|
|
13
|
+
font-size: 16px !important;
|
|
14
|
+
line-height: 24px !important;
|
|
15
|
+
border-radius: 8px !important;
|
|
16
|
+
border: 1px solid #d0d5dd !important; // Gray/300
|
|
17
|
+
padding: 12px 16px !important;
|
|
18
|
+
min-height: 48px !important;
|
|
19
|
+
color: #101828 !important; // Gray/900
|
|
20
|
+
background-color: #ffffff !important;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// 多选模式:内边距适配标签,高度保持 48px
|
|
24
|
+
&.pisell-lowcode-select-multiple .pisell-lowcode-select-selector {
|
|
25
|
+
padding: 6px 16px !important;
|
|
26
|
+
min-height: 48px !important;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&.pisell-lowcode-select-open .pisell-lowcode-select-selector {
|
|
30
|
+
border-color: #d6bbfb !important; // Primary/300
|
|
31
|
+
box-shadow: 0 0 0 4px #f4ebff !important; // Primary/100
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:not(.pisell-lowcode-select-open):not(.pisell-lowcode-select-disabled)
|
|
35
|
+
.pisell-lowcode-select-selector:hover {
|
|
36
|
+
border-color: #b692f6 !important; // Primary/400
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.pisell-lowcode-select-disabled .pisell-lowcode-select-selector {
|
|
40
|
+
background-color: #f9fafb !important; // Gray/50
|
|
41
|
+
color: #98a2b3 !important; // Gray/400
|
|
42
|
+
border-color: #d0d5dd !important;
|
|
43
|
+
cursor: not-allowed !important;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.pisell-lowcode-select-selection-placeholder {
|
|
47
|
+
color: #667085 !important; // Gray/500
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.pisell-lowcode-select-arrow {
|
|
51
|
+
color: #667085;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.pisell-lowcode-select-clear {
|
|
55
|
+
color: #667085;
|
|
56
|
+
|
|
57
|
+
&:hover {
|
|
58
|
+
color: #344054;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// 多选标签(选择后展示的 item)高度 36px
|
|
63
|
+
.pisell-lowcode-select-selection-item {
|
|
64
|
+
border-radius: 6px !important;
|
|
65
|
+
padding: 0 10px !important;
|
|
66
|
+
margin-inline-end: 4px !important;
|
|
67
|
+
height: 36px !important;
|
|
68
|
+
min-height: 36px !important;
|
|
69
|
+
line-height: 36px !important;
|
|
70
|
+
|
|
71
|
+
&-content {
|
|
72
|
+
line-height: 36px !important;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&-remove {
|
|
76
|
+
margin-left: 4px !important;
|
|
77
|
+
|
|
78
|
+
&:hover {
|
|
79
|
+
background-color: transparent !important;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
12
85
|
&-wrapper {
|
|
13
86
|
display: flex;
|
|
14
87
|
flex-direction: column;
|
|
15
88
|
gap: 8px;
|
|
89
|
+
position: relative;
|
|
90
|
+
|
|
91
|
+
// 下拉选项高度 48px(通过 getPopupContainer 挂到 wrapper 内,无需 :global)
|
|
92
|
+
.pisell-multiple-select-dropdown .pisell-lowcode-select-item {
|
|
93
|
+
min-height: 48px !important;
|
|
94
|
+
height: 48px !important;
|
|
95
|
+
line-height: 48px !important;
|
|
96
|
+
padding: 0 16px !important;
|
|
97
|
+
font-size: 16px !important;
|
|
98
|
+
}
|
|
16
99
|
}
|
|
17
100
|
|
|
18
|
-
// 标签(Token 无法配置的自定义元素)
|
|
19
101
|
&-label {
|
|
20
|
-
font-family: 'Inter', sans-serif;
|
|
21
102
|
font-size: 14px;
|
|
22
103
|
font-weight: 600;
|
|
23
|
-
color: #344054;
|
|
104
|
+
color: #344054; // Gray/700
|
|
24
105
|
line-height: 20px;
|
|
25
106
|
|
|
26
107
|
&-required::after {
|
|
27
108
|
content: ' *';
|
|
28
|
-
color: #
|
|
109
|
+
color: #d92d20; // Error/600
|
|
29
110
|
margin-left: 0;
|
|
30
111
|
}
|
|
31
112
|
}
|
|
32
113
|
|
|
33
|
-
// 辅助文本(Token 无法配置的自定义元素)
|
|
34
114
|
&-helper-text {
|
|
35
115
|
font-size: 14px;
|
|
36
116
|
font-weight: 400;
|
|
37
|
-
color: #667085;
|
|
117
|
+
color: #667085; // Gray/500
|
|
38
118
|
line-height: 20px;
|
|
39
119
|
}
|
|
40
120
|
|
|
41
|
-
// 错误文本(Token 无法配置的自定义元素)
|
|
42
121
|
&-error-text {
|
|
43
|
-
font-size:
|
|
122
|
+
font-size: 12px;
|
|
44
123
|
font-weight: 400;
|
|
45
|
-
color: #
|
|
46
|
-
line-height:
|
|
47
|
-
animation: fadeIn 0.3s ease-in-out;
|
|
124
|
+
color: #d92d20; // Error/600
|
|
125
|
+
line-height: 1.5;
|
|
126
|
+
animation: pisell-multiple-select-fadeIn 0.3s ease-in-out;
|
|
48
127
|
}
|
|
49
128
|
|
|
50
|
-
// 下拉选项中的勾选图标(Figma 设计)
|
|
51
129
|
&-option-content {
|
|
52
130
|
display: flex;
|
|
53
131
|
align-items: center;
|
|
@@ -56,99 +134,34 @@
|
|
|
56
134
|
}
|
|
57
135
|
|
|
58
136
|
&-option-check {
|
|
59
|
-
color: #
|
|
137
|
+
color: #7f56d9; // Primary/600
|
|
60
138
|
font-size: 16px;
|
|
61
139
|
margin-left: 8px;
|
|
62
140
|
}
|
|
63
141
|
|
|
64
|
-
//
|
|
65
|
-
:global {
|
|
66
|
-
// 选择框垂直内边距(多选时需要更小的内边距以容纳标签)
|
|
67
|
-
.pisell-lowcode-select-multiple .pisell-lowcode-select-selector {
|
|
68
|
-
padding: 6px 16px !important;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// 标签圆角(Token 不支持 multipleItemBorderRadius)
|
|
72
|
-
.pisell-lowcode-select-selection-item {
|
|
73
|
-
border-radius: 6px !important;
|
|
74
|
-
padding: 6px 10px !important;
|
|
75
|
-
margin-inline-end: 4px !important;
|
|
76
|
-
|
|
77
|
-
// 确保标签内容垂直居中
|
|
78
|
-
&-content {
|
|
79
|
-
line-height: 24px !important;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// 删除图标样式微调
|
|
83
|
-
&-remove {
|
|
84
|
-
margin-left: 4px !important;
|
|
85
|
-
|
|
86
|
-
&:hover {
|
|
87
|
-
background-color: transparent !important;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// hover 边框颜色(Token 不支持 colorBorderHover)
|
|
93
|
-
.pisell-lowcode-select-multiple:not(.pisell-lowcode-select-disabled):not(.pisell-lowcode-select-customize-input):not(.ant-select-open) {
|
|
94
|
-
.ant-select-selector:hover {
|
|
95
|
-
border-color: #D6BBFB !important;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// 下拉框内的搜索框样式(Figma 设计)
|
|
102
|
-
:global {
|
|
103
|
-
.pisell-select-search-wrapper {
|
|
104
|
-
padding: 6px;
|
|
105
|
-
border-bottom: 1px solid #EAECF0;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.pisell-select-search-input {
|
|
109
|
-
padding: 9px 10px !important;
|
|
110
|
-
font-size: 14px;
|
|
111
|
-
|
|
112
|
-
.ant-input {
|
|
113
|
-
font-size: 14px !important;
|
|
114
|
-
color: #344054 !important;
|
|
115
|
-
|
|
116
|
-
&::placeholder {
|
|
117
|
-
color: #98A2B3 !important;
|
|
118
|
-
font-size: 12px !important;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
&:hover,
|
|
123
|
-
&:focus-within {
|
|
124
|
-
background-color: transparent !important;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.pisell-multiple-select {
|
|
130
|
-
// 错误状态(Token 无法单独配置错误边框颜色)
|
|
142
|
+
// 错误状态(Figma 设计体系 Error 色)
|
|
131
143
|
&-error {
|
|
132
|
-
|
|
133
|
-
border-color: #
|
|
144
|
+
.pisell-lowcode-select .pisell-lowcode-select-selector {
|
|
145
|
+
border-color: #fda29b !important; // Error/300
|
|
134
146
|
|
|
135
147
|
&:hover {
|
|
136
|
-
border-color: #
|
|
148
|
+
border-color: #f97066 !important; // Error/400
|
|
137
149
|
}
|
|
138
150
|
}
|
|
139
151
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
152
|
+
.pisell-lowcode-select.pisell-lowcode-select-focused .pisell-lowcode-select-selector,
|
|
153
|
+
.pisell-lowcode-select.pisell-lowcode-select-open .pisell-lowcode-select-selector {
|
|
154
|
+
border-color: #f97066 !important; // Error/400
|
|
155
|
+
box-shadow: 0 0 0 4px #fee4e2 !important; // Error/100
|
|
143
156
|
}
|
|
144
157
|
}
|
|
145
158
|
|
|
146
|
-
//
|
|
159
|
+
// 聚合标签(maxTagPlaceholder)
|
|
147
160
|
&-more-tag {
|
|
148
161
|
display: inline-flex;
|
|
149
162
|
align-items: center;
|
|
150
|
-
background-color: #
|
|
151
|
-
color: #344054;
|
|
163
|
+
background-color: #eaecf0;
|
|
164
|
+
color: #344054; // Gray/700
|
|
152
165
|
border: none;
|
|
153
166
|
border-radius: 6px;
|
|
154
167
|
padding: 6px 10px;
|
|
@@ -159,35 +172,28 @@
|
|
|
159
172
|
transition: background-color 0.2s ease;
|
|
160
173
|
|
|
161
174
|
&:hover {
|
|
162
|
-
background-color: #
|
|
175
|
+
background-color: #d0d5dd; // Gray/300
|
|
163
176
|
}
|
|
164
177
|
}
|
|
165
178
|
|
|
166
|
-
//
|
|
179
|
+
// 只读状态
|
|
167
180
|
&-readonly {
|
|
168
181
|
&-display {
|
|
169
182
|
display: flex;
|
|
170
183
|
flex-wrap: wrap;
|
|
171
184
|
gap: 4px;
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
border: 1px solid #EAECF0;
|
|
175
|
-
border-radius: 8px;
|
|
176
|
-
min-height: 48px;
|
|
185
|
+
align-items: center;
|
|
186
|
+
min-height: 24px;
|
|
177
187
|
}
|
|
178
188
|
|
|
179
189
|
&-tag {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
font-size: 16px;
|
|
188
|
-
font-weight: 500;
|
|
189
|
-
line-height: 24px;
|
|
190
|
-
color: #344054;
|
|
190
|
+
margin: 0;
|
|
191
|
+
cursor: default;
|
|
192
|
+
border-radius: 12px;
|
|
193
|
+
border: 1px solid transparent;
|
|
194
|
+
font-size: 14px;
|
|
195
|
+
line-height: 22px;
|
|
196
|
+
padding: 2px 10px;
|
|
191
197
|
|
|
192
198
|
&-icon {
|
|
193
199
|
display: flex;
|
|
@@ -196,17 +202,13 @@
|
|
|
196
202
|
}
|
|
197
203
|
|
|
198
204
|
&-more-tag {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
font-size: 16px;
|
|
207
|
-
font-weight: 500;
|
|
208
|
-
line-height: 24px;
|
|
209
|
-
cursor: pointer;
|
|
205
|
+
margin: 0;
|
|
206
|
+
cursor: default;
|
|
207
|
+
border-radius: 12px;
|
|
208
|
+
border: 1px solid transparent;
|
|
209
|
+
font-size: 14px;
|
|
210
|
+
line-height: 22px;
|
|
211
|
+
padding: 2px 10px;
|
|
210
212
|
}
|
|
211
213
|
|
|
212
214
|
&-empty {
|
|
@@ -218,8 +220,33 @@
|
|
|
218
220
|
}
|
|
219
221
|
}
|
|
220
222
|
|
|
221
|
-
//
|
|
222
|
-
|
|
223
|
+
// 下拉内搜索框(在 dropdown 内)
|
|
224
|
+
.pisell-select-search-wrapper {
|
|
225
|
+
padding: 6px;
|
|
226
|
+
border-bottom: 1px solid #eaecf0;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.pisell-select-search-input {
|
|
230
|
+
padding: 9px 10px !important;
|
|
231
|
+
font-size: 14px;
|
|
232
|
+
|
|
233
|
+
.pisell-lowcode-input {
|
|
234
|
+
font-size: 14px !important;
|
|
235
|
+
color: #344054 !important;
|
|
236
|
+
|
|
237
|
+
&::placeholder {
|
|
238
|
+
color: #98a2b3 !important;
|
|
239
|
+
font-size: 12px !important;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
&:hover,
|
|
244
|
+
&:focus-within {
|
|
245
|
+
background-color: transparent !important;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
@keyframes pisell-multiple-select-fadeIn {
|
|
223
250
|
from {
|
|
224
251
|
opacity: 0;
|
|
225
252
|
transform: translateY(-4px);
|
|
@@ -64,6 +64,7 @@ const EditView = (0, react.forwardRef)((props, ref) => {
|
|
|
64
64
|
filterOption,
|
|
65
65
|
options
|
|
66
66
|
]);
|
|
67
|
+
const wrapperRef = (0, react.useRef)(null);
|
|
67
68
|
const menuItemSelectedIcon = /* @__PURE__ */ react.default.createElement(_ant_design_icons.CheckOutlined, { style: {
|
|
68
69
|
color: "#7F56D9",
|
|
69
70
|
fontSize: 16
|
|
@@ -96,6 +97,7 @@ const EditView = (0, react.forwardRef)((props, ref) => {
|
|
|
96
97
|
return /* @__PURE__ */ react.default.createElement(antd.Tooltip, { title: tooltipContent }, /* @__PURE__ */ react.default.createElement("span", { className: "pisell-multiple-select-more-tag" }, "+", omittedValues.length));
|
|
97
98
|
}, [options, showTooltipOnOverflow]);
|
|
98
99
|
return /* @__PURE__ */ react.default.createElement("div", {
|
|
100
|
+
ref: wrapperRef,
|
|
99
101
|
className: (0, classnames.default)("pisell-multiple-select-wrapper", className),
|
|
100
102
|
style
|
|
101
103
|
}, label && /* @__PURE__ */ react.default.createElement("label", { className: (0, classnames.default)("pisell-multiple-select-label", { "pisell-multiple-select-label-required": required }) }, label), /* @__PURE__ */ react.default.createElement(antd.Select, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, restProps), {}, {
|
|
@@ -112,6 +114,11 @@ const EditView = (0, react.forwardRef)((props, ref) => {
|
|
|
112
114
|
maxTagCount,
|
|
113
115
|
maxTagPlaceholder,
|
|
114
116
|
size,
|
|
117
|
+
popupClassName: "pisell-multiple-select-dropdown",
|
|
118
|
+
getPopupContainer: () => {
|
|
119
|
+
var _wrapperRef$current;
|
|
120
|
+
return (_wrapperRef$current = wrapperRef.current) !== null && _wrapperRef$current !== void 0 ? _wrapperRef$current : document.body;
|
|
121
|
+
},
|
|
115
122
|
className: (0, classnames.default)("pisell-multiple-select", { "pisell-multiple-select-error": error })
|
|
116
123
|
})), helperText && !error && /* @__PURE__ */ react.default.createElement("div", { className: "pisell-multiple-select-helper-text" }, helperText), error && errorText && /* @__PURE__ */ react.default.createElement("div", { className: "pisell-multiple-select-error-text" }, errorText));
|
|
117
124
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.js');
|
|
2
|
+
const require_tagColor = require('../../../utils/tagColor.js');
|
|
2
3
|
let antd = require("antd");
|
|
3
4
|
let classnames = require("classnames");
|
|
4
5
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
@@ -9,7 +10,7 @@ let _pisell_utils = require("@pisell/utils");
|
|
|
9
10
|
//#region src/components/pisellMultipleSelect/components/ReadOnlyView.tsx
|
|
10
11
|
/**
|
|
11
12
|
* PisellMultipleSelect - ReadOnlyView (只读态视图)
|
|
12
|
-
*
|
|
13
|
+
* 只读状态下使用 Tag 展示选中值
|
|
13
14
|
*/
|
|
14
15
|
const ReadOnlyView = (props) => {
|
|
15
16
|
const { value = [], options, label, required, maxTagCount = 3, className, style } = props;
|
|
@@ -22,10 +23,21 @@ const ReadOnlyView = (props) => {
|
|
|
22
23
|
return /* @__PURE__ */ react.default.createElement("div", {
|
|
23
24
|
className: (0, classnames.default)("pisell-multiple-select-wrapper", "pisell-multiple-select-readonly", className),
|
|
24
25
|
style
|
|
25
|
-
}, label && /* @__PURE__ */ react.default.createElement("label", { className: (0, classnames.default)("pisell-multiple-select-label", { "pisell-multiple-select-label-required": required }) }, label), /* @__PURE__ */ react.default.createElement("div", { className: "pisell-multiple-select-readonly-display" }, selectedOptions.length > 0 ? /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, tagDisplayInfo.visibleTags.map((option) =>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
}, label && /* @__PURE__ */ react.default.createElement("label", { className: (0, classnames.default)("pisell-multiple-select-label", { "pisell-multiple-select-label-required": required }) }, label), /* @__PURE__ */ react.default.createElement("div", { className: "pisell-multiple-select-readonly-display" }, selectedOptions.length > 0 ? /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, tagDisplayInfo.visibleTags.map((option, idx) => {
|
|
27
|
+
var _option$color;
|
|
28
|
+
return /* @__PURE__ */ react.default.createElement(antd.Tag, {
|
|
29
|
+
key: option.value,
|
|
30
|
+
className: "pisell-multiple-select-readonly-tag",
|
|
31
|
+
color: (_option$color = option.color) !== null && _option$color !== void 0 ? _option$color : require_tagColor.getDefaultTagColor(option.value, idx)
|
|
32
|
+
}, option.icon && /* @__PURE__ */ react.default.createElement("span", { className: "pisell-multiple-select-readonly-tag-icon" }, option.icon), option.label);
|
|
33
|
+
}), tagDisplayInfo.hiddenCount > 0 && /* @__PURE__ */ react.default.createElement(antd.Tooltip, { title: tagDisplayInfo.hiddenTags.map((t) => t.label).join(", ") }, /* @__PURE__ */ react.default.createElement(antd.Tag, {
|
|
34
|
+
className: "pisell-multiple-select-readonly-more-tag",
|
|
35
|
+
style: {
|
|
36
|
+
backgroundColor: "#F2F4F7",
|
|
37
|
+
borderColor: "#EAECF0",
|
|
38
|
+
color: "#667085"
|
|
39
|
+
}
|
|
40
|
+
}, "+", tagDisplayInfo.hiddenCount))) : /* @__PURE__ */ react.default.createElement("span", { className: "pisell-multiple-select-readonly-empty" }, "-")));
|
|
29
41
|
};
|
|
30
42
|
ReadOnlyView.displayName = "PisellMultipleSelectReadOnlyView";
|
|
31
43
|
var ReadOnlyView_default = ReadOnlyView;
|