@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
|
@@ -13,26 +13,77 @@ const _excluded = [
|
|
|
13
13
|
"formFiltersPrefix",
|
|
14
14
|
"hiddenQuickFilter",
|
|
15
15
|
"hiddenOtherFilter",
|
|
16
|
-
"hasForm"
|
|
16
|
+
"hasForm",
|
|
17
|
+
"onChange"
|
|
17
18
|
];
|
|
18
19
|
const PisellFilter = (props) => {
|
|
19
|
-
const { value: originalValue, quickFilterMaxLength, formFiltersPrefix, hiddenQuickFilter = true, hiddenOtherFilter = false, hasForm = true } = props, otherProps = require_objectWithoutProperties._objectWithoutProperties(props, _excluded);
|
|
20
|
-
const [
|
|
20
|
+
const { value: originalValue, quickFilterMaxLength, formFiltersPrefix, hiddenQuickFilter = true, hiddenOtherFilter = false, hasForm = true, onChange } = props, otherProps = require_objectWithoutProperties._objectWithoutProperties(props, _excluded);
|
|
21
|
+
const [form] = antd.Form.useForm();
|
|
22
|
+
const [value, setValue] = (0, react.useState)(() => ({
|
|
23
|
+
quickFilter: (originalValue === null || originalValue === void 0 ? void 0 : originalValue.quickFilter) || [],
|
|
24
|
+
otherFilter: (originalValue === null || originalValue === void 0 ? void 0 : originalValue.otherFilter) || [],
|
|
25
|
+
values: (originalValue === null || originalValue === void 0 ? void 0 : originalValue.values) || {}
|
|
26
|
+
}));
|
|
27
|
+
const isInternalChange = (0, react.useRef)(false);
|
|
21
28
|
(0, react.useEffect)(() => {
|
|
22
|
-
setValue({
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
setValue((prev) => {
|
|
30
|
+
var _originalValue$quickF, _originalValue$otherF, _ref, _originalValue$values;
|
|
31
|
+
return {
|
|
32
|
+
quickFilter: (_originalValue$quickF = originalValue === null || originalValue === void 0 ? void 0 : originalValue.quickFilter) !== null && _originalValue$quickF !== void 0 ? _originalValue$quickF : prev.quickFilter,
|
|
33
|
+
otherFilter: (_originalValue$otherF = originalValue === null || originalValue === void 0 ? void 0 : originalValue.otherFilter) !== null && _originalValue$otherF !== void 0 ? _originalValue$otherF : prev.otherFilter,
|
|
34
|
+
values: (_ref = (_originalValue$values = originalValue === null || originalValue === void 0 ? void 0 : originalValue.values) !== null && _originalValue$values !== void 0 ? _originalValue$values : prev.values) !== null && _ref !== void 0 ? _ref : {}
|
|
35
|
+
};
|
|
25
36
|
});
|
|
26
|
-
}, [
|
|
37
|
+
}, [
|
|
38
|
+
originalValue === null || originalValue === void 0 ? void 0 : originalValue.quickFilter,
|
|
39
|
+
originalValue === null || originalValue === void 0 ? void 0 : originalValue.otherFilter,
|
|
40
|
+
originalValue === null || originalValue === void 0 ? void 0 : originalValue.values
|
|
41
|
+
]);
|
|
42
|
+
(0, react.useEffect)(() => {
|
|
43
|
+
if (!hasForm || !(originalValue === null || originalValue === void 0 ? void 0 : originalValue.values) || typeof originalValue.values !== "object") return;
|
|
44
|
+
if (isInternalChange.current) {
|
|
45
|
+
isInternalChange.current = false;
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
form.setFieldsValue(originalValue.values);
|
|
49
|
+
}, [
|
|
50
|
+
hasForm,
|
|
51
|
+
form,
|
|
52
|
+
originalValue === null || originalValue === void 0 ? void 0 : originalValue.values
|
|
53
|
+
]);
|
|
54
|
+
const handleChange = (0, react.useCallback)((newVal) => {
|
|
55
|
+
setValue((prev) => {
|
|
56
|
+
var _newVal$values;
|
|
57
|
+
return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, prev), newVal), {}, { values: (_newVal$values = newVal.values) !== null && _newVal$values !== void 0 ? _newVal$values : prev.values });
|
|
58
|
+
});
|
|
59
|
+
onChange === null || onChange === void 0 || onChange(newVal);
|
|
60
|
+
}, [onChange]);
|
|
61
|
+
const handleFormValuesChange = (0, react.useCallback)((_, allValues) => {
|
|
62
|
+
if (typeof allValues !== "object" || allValues === null) return;
|
|
63
|
+
isInternalChange.current = true;
|
|
64
|
+
const mergedValues = require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, value.values), allValues);
|
|
65
|
+
const next = {
|
|
66
|
+
quickFilter: value.quickFilter,
|
|
67
|
+
otherFilter: value.otherFilter,
|
|
68
|
+
values: mergedValues
|
|
69
|
+
};
|
|
70
|
+
setValue(next);
|
|
71
|
+
onChange === null || onChange === void 0 || onChange(next);
|
|
72
|
+
}, [
|
|
73
|
+
value.quickFilter,
|
|
74
|
+
value.otherFilter,
|
|
75
|
+
value.values,
|
|
76
|
+
onChange
|
|
77
|
+
]);
|
|
27
78
|
const content = (0, react.useMemo)(() => {
|
|
28
79
|
return /* @__PURE__ */ react.default.createElement(require_index.default, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, otherProps), {}, {
|
|
80
|
+
onChange: handleChange,
|
|
29
81
|
value: {
|
|
30
82
|
quickFilter: value.quickFilter,
|
|
31
83
|
otherFilter: value.otherFilter
|
|
32
84
|
},
|
|
33
85
|
hiddenQuickFilter,
|
|
34
86
|
hiddenOtherFilter,
|
|
35
|
-
onChange: setValue,
|
|
36
87
|
quickFilterMaxLength: quickFilterMaxLength || 100,
|
|
37
88
|
formFiltersPrefix: formFiltersPrefix || ""
|
|
38
89
|
}));
|
|
@@ -41,11 +92,15 @@ const PisellFilter = (props) => {
|
|
|
41
92
|
hiddenQuickFilter,
|
|
42
93
|
hiddenOtherFilter,
|
|
43
94
|
quickFilterMaxLength,
|
|
44
|
-
formFiltersPrefix
|
|
95
|
+
formFiltersPrefix,
|
|
96
|
+
handleChange
|
|
45
97
|
]);
|
|
46
98
|
if (hasForm) return /* @__PURE__ */ react.default.createElement(antd.Form, require_objectSpread2._objectSpread2({
|
|
99
|
+
form,
|
|
47
100
|
size: "large",
|
|
48
|
-
layout: "vertical"
|
|
101
|
+
layout: "vertical",
|
|
102
|
+
initialValues: value.values,
|
|
103
|
+
onValuesChange: handleFormValuesChange
|
|
49
104
|
}, otherProps), content);
|
|
50
105
|
return content;
|
|
51
106
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* PisellLongText 组件样式
|
|
3
|
+
* 基于 Figma 设计规范,与 SingleLineText 设计体系一致
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
6
|
.pisell-long-text {
|
|
@@ -7,16 +8,78 @@
|
|
|
7
8
|
position: relative;
|
|
8
9
|
width: 100%;
|
|
9
10
|
|
|
10
|
-
//
|
|
11
|
+
// TextArea 样式(Figma 设计规范,覆盖时使用 pisell-lowcode-xxx)
|
|
11
12
|
.pisell-lowcode-input {
|
|
12
|
-
|
|
13
|
+
// 基础样式
|
|
14
|
+
font-size: 16px !important;
|
|
15
|
+
line-height: 24px !important;
|
|
16
|
+
|
|
17
|
+
// 边框和圆角
|
|
18
|
+
border-radius: 8px !important;
|
|
19
|
+
border: 1px solid #d0d5dd !important; // Gray/300
|
|
20
|
+
|
|
21
|
+
// 内边距(Figma: 垂直 12px,水平 14px)
|
|
22
|
+
padding: 12px 14px !important;
|
|
23
|
+
min-height: 80px !important; // 多行最小高度,由 rows 进一步控制
|
|
24
|
+
|
|
25
|
+
// 颜色
|
|
26
|
+
color: #101828 !important; // Gray/900
|
|
27
|
+
background-color: #ffffff !important;
|
|
28
|
+
|
|
29
|
+
&::placeholder {
|
|
30
|
+
color: #667085 !important; // Gray/500
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// 聚焦态
|
|
34
|
+
&:focus,
|
|
35
|
+
&:focus-within {
|
|
36
|
+
border-color: #d6bbfb !important; // Primary/300
|
|
37
|
+
box-shadow: 0 0 0 4px #f4ebff !important; // Primary/100
|
|
38
|
+
outline: none !important;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Hover 态
|
|
42
|
+
&:hover:not(:focus):not(:focus-within):not([disabled]) {
|
|
43
|
+
border-color: #b692f6 !important; // Primary/400
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// 禁用态
|
|
47
|
+
&[disabled],
|
|
48
|
+
&.pisell-lowcode-input-disabled {
|
|
49
|
+
background-color: #f9fafb !important; // Gray/50
|
|
50
|
+
color: #98a2b3 !important; // Gray/400
|
|
51
|
+
border-color: #d0d5dd !important;
|
|
52
|
+
cursor: not-allowed !important;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// 字数统计样式(TextArea showCount)
|
|
57
|
+
.pisell-lowcode-input-data-count,
|
|
58
|
+
.pisell-lowcode-input-show-count-suffix {
|
|
59
|
+
color: #667085 !important; // Gray/500
|
|
60
|
+
font-size: 14px !important;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// 错误状态
|
|
64
|
+
.pisell-lowcode-input-status-error {
|
|
65
|
+
border-color: #fda29b !important; // Error/300
|
|
66
|
+
|
|
67
|
+
&:focus,
|
|
68
|
+
&:focus-within {
|
|
69
|
+
border-color: #f97066 !important; // Error/400
|
|
70
|
+
box-shadow: 0 0 0 4px #fee4e2 !important; // Error/100
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&:hover:not(:focus):not(:focus-within) {
|
|
74
|
+
border-color: #f97066 !important; // Error/400
|
|
75
|
+
}
|
|
13
76
|
}
|
|
14
77
|
}
|
|
15
78
|
|
|
16
79
|
&-error {
|
|
17
80
|
margin-top: 4px;
|
|
18
81
|
font-size: 12px;
|
|
19
|
-
color: #
|
|
82
|
+
color: #d92d20; // Error/600
|
|
20
83
|
line-height: 1.5;
|
|
21
84
|
animation: fadeIn 0.3s ease-in-out;
|
|
22
85
|
}
|
|
@@ -32,12 +95,17 @@
|
|
|
32
95
|
height: auto;
|
|
33
96
|
font-size: 14px;
|
|
34
97
|
margin-top: 8px;
|
|
98
|
+
color: #6d48c4;
|
|
99
|
+
|
|
100
|
+
&:hover {
|
|
101
|
+
color: #6d48c4 !important;
|
|
102
|
+
}
|
|
35
103
|
}
|
|
36
104
|
|
|
37
105
|
&-word-count {
|
|
38
106
|
margin-top: 8px;
|
|
39
107
|
font-size: 12px;
|
|
40
|
-
color: #667085;
|
|
108
|
+
color: #667085; // Gray/500
|
|
41
109
|
text-align: right;
|
|
42
110
|
}
|
|
43
111
|
|
|
@@ -243,10 +243,10 @@ const PisellLookupComponent = (0, react.forwardRef)((props, ref) => {
|
|
|
243
243
|
}, 200);
|
|
244
244
|
}, [displayType, close]);
|
|
245
245
|
/**
|
|
246
|
-
* 处理确认触发(点击 Lookup 按钮或按 Enter
|
|
246
|
+
* 处理确认触发(点击 Lookup 按钮或按 Enter 键)。支持传入当前输入值,回车时由 Trigger 传入以避免受控下 keyword 未更新导致历史未保存。
|
|
247
247
|
*/
|
|
248
|
-
const handleConfirm = (0, react.useCallback)(() => {
|
|
249
|
-
handleConfirmSearch(keyword);
|
|
248
|
+
const handleConfirm = (0, react.useCallback)((valueFromTrigger) => {
|
|
249
|
+
handleConfirmSearch(valueFromTrigger !== null && valueFromTrigger !== void 0 ? valueFromTrigger : keyword);
|
|
250
250
|
}, [keyword, handleConfirmSearch]);
|
|
251
251
|
/**
|
|
252
252
|
* 处理清除
|
|
@@ -132,8 +132,9 @@
|
|
|
132
132
|
|
|
133
133
|
// ============ Input 样式覆盖 ============
|
|
134
134
|
|
|
135
|
-
// 覆盖 Ant Design Input
|
|
135
|
+
// 覆盖 Ant Design Input 默认样式(适用于所有尺寸);默认高度 50px
|
|
136
136
|
&-trigger-input.pisell-lowcode-input-affix-wrapper {
|
|
137
|
+
min-height: 50px;
|
|
137
138
|
border: 1px solid #d0d5dd;
|
|
138
139
|
border-radius: 8px;
|
|
139
140
|
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
|
|
@@ -192,8 +193,9 @@
|
|
|
192
193
|
}
|
|
193
194
|
}
|
|
194
195
|
|
|
195
|
-
//
|
|
196
|
+
// 大号输入框,高度 58px
|
|
196
197
|
&-trigger-input.pisell-lowcode-input-affix-wrapper-lg {
|
|
198
|
+
min-height: 58px;
|
|
197
199
|
padding: 6px 6px 6px 16px;
|
|
198
200
|
|
|
199
201
|
.pisell-lookup-input-clear {
|
|
@@ -210,6 +212,11 @@
|
|
|
210
212
|
|
|
211
213
|
.pisell-lookup-input-confirm {
|
|
212
214
|
padding: 10px;
|
|
215
|
+
line-height: 24px;
|
|
216
|
+
|
|
217
|
+
span {
|
|
218
|
+
line-height: 24px;
|
|
219
|
+
}
|
|
213
220
|
}
|
|
214
221
|
}
|
|
215
222
|
|
|
@@ -270,8 +277,8 @@
|
|
|
270
277
|
}
|
|
271
278
|
|
|
272
279
|
&-confirm {
|
|
280
|
+
border: none;
|
|
273
281
|
background-color: #7f56d9;
|
|
274
|
-
border-color: #7f56d9;
|
|
275
282
|
border-radius: 8px;
|
|
276
283
|
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
|
|
277
284
|
padding: 10px;
|
|
@@ -279,39 +286,37 @@
|
|
|
279
286
|
min-width: auto;
|
|
280
287
|
font-size: 16px;
|
|
281
288
|
font-weight: 600;
|
|
282
|
-
line-height:
|
|
289
|
+
line-height: 20px;
|
|
283
290
|
color: #ffffff;
|
|
284
291
|
|
|
285
292
|
&:hover {
|
|
286
293
|
background-color: #6941c6 !important;
|
|
287
|
-
border-color: #6941c6 !important;
|
|
288
294
|
color: #ffffff !important;
|
|
289
295
|
}
|
|
290
296
|
|
|
291
297
|
&:active {
|
|
292
298
|
background-color: #53389e !important;
|
|
293
|
-
border-color: #53389e !important;
|
|
294
299
|
color: #ffffff !important;
|
|
295
300
|
}
|
|
296
301
|
|
|
297
302
|
span {
|
|
298
303
|
font-size: 16px;
|
|
299
304
|
font-weight: 600;
|
|
300
|
-
line-height:
|
|
305
|
+
line-height: 20px;
|
|
301
306
|
}
|
|
302
307
|
|
|
303
308
|
&.pisell-lowcode-btn-sm {
|
|
304
309
|
padding: 10px;
|
|
305
310
|
height: auto;
|
|
306
311
|
font-size: 16px;
|
|
307
|
-
line-height:
|
|
312
|
+
line-height: 20px;
|
|
308
313
|
}
|
|
309
314
|
|
|
310
315
|
&.pisell-lowcode-btn-middle {
|
|
311
316
|
padding: 10px;
|
|
312
317
|
height: auto;
|
|
313
318
|
font-size: 16px;
|
|
314
|
-
line-height:
|
|
319
|
+
line-height: 20px;
|
|
315
320
|
}
|
|
316
321
|
}
|
|
317
322
|
}
|
|
@@ -121,10 +121,14 @@ const LookupTriggerComponent = (0, react.forwardRef)((props, ref) => {
|
|
|
121
121
|
onConfirm === null || onConfirm === void 0 || onConfirm();
|
|
122
122
|
};
|
|
123
123
|
/**
|
|
124
|
-
* 处理按 Enter
|
|
124
|
+
* 处理按 Enter 键:传入当前输入值,避免受控模式下 state 未更新导致历史未保存
|
|
125
125
|
*/
|
|
126
126
|
const handleKeyPress = (e) => {
|
|
127
|
-
if (e.key === "Enter")
|
|
127
|
+
if (e.key === "Enter") {
|
|
128
|
+
var _ref, _e$currentTarget$valu, _e$currentTarget;
|
|
129
|
+
const currentValue = (_ref = (_e$currentTarget$valu = (_e$currentTarget = e.currentTarget) === null || _e$currentTarget === void 0 ? void 0 : _e$currentTarget.value) !== null && _e$currentTarget$valu !== void 0 ? _e$currentTarget$valu : value) !== null && _ref !== void 0 ? _ref : "";
|
|
130
|
+
onConfirm === null || onConfirm === void 0 || onConfirm(currentValue);
|
|
131
|
+
}
|
|
128
132
|
};
|
|
129
133
|
/**
|
|
130
134
|
* 渲染输入框触发器
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { PisellMetricCardProps } from "./types.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import "./PisellMetricCard.less";
|
|
4
|
+
|
|
5
|
+
//#region src/components/pisellMetricCard/PisellMetricCard.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* PisellMetricCard 指标卡片组件
|
|
8
|
+
*
|
|
9
|
+
* 用于展示单一核心指标的专业卡片组件
|
|
10
|
+
* 支持标题、数值、环比、趋势箭头、标签等信息展示
|
|
11
|
+
*
|
|
12
|
+
* @example 基础用法
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <PisellMetricCard
|
|
15
|
+
* title="Total Sales"
|
|
16
|
+
* value={1580}
|
|
17
|
+
* />
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @example 使用对象配置
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <PisellMetricCard
|
|
23
|
+
* title="Revenue"
|
|
24
|
+
* value={1580}
|
|
25
|
+
* format={{
|
|
26
|
+
* showCurrencySymbol: true,
|
|
27
|
+
* currencySymbol: '$',
|
|
28
|
+
* useGrouping: true
|
|
29
|
+
* }}
|
|
30
|
+
* comparison={{
|
|
31
|
+
* value: 120
|
|
32
|
+
* }}
|
|
33
|
+
* />
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
declare const PisellMetricCard: React.FC<PisellMetricCardProps>;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { PisellMetricCard };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.js');
|
|
2
|
+
const require_objectSpread2 = require('../../_virtual/_@oxc-project_runtime@0.108.0/helpers/objectSpread2.js');
|
|
3
|
+
const require_index = require('../pisellCard/index.js');
|
|
4
|
+
const require_MetricValue = require('./components/MetricValue.js');
|
|
5
|
+
const require_MetricTitle = require('./components/MetricTitle.js');
|
|
6
|
+
const require_formatMetricValue = require('./utils/formatMetricValue.js');
|
|
7
|
+
const require_MetricComparison = require('./components/MetricComparison.js');
|
|
8
|
+
let react = require("react");
|
|
9
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
10
|
+
require("./PisellMetricCard.less");
|
|
11
|
+
|
|
12
|
+
//#region src/components/pisellMetricCard/PisellMetricCard.tsx
|
|
13
|
+
/**
|
|
14
|
+
* PisellMetricCard 指标卡片组件
|
|
15
|
+
*
|
|
16
|
+
* 用于展示单一核心指标的专业卡片组件
|
|
17
|
+
* 支持标题、数值、环比、趋势箭头、标签等信息展示
|
|
18
|
+
*
|
|
19
|
+
* @example 基础用法
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <PisellMetricCard
|
|
22
|
+
* title="Total Sales"
|
|
23
|
+
* value={1580}
|
|
24
|
+
* />
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @example 使用对象配置
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <PisellMetricCard
|
|
30
|
+
* title="Revenue"
|
|
31
|
+
* value={1580}
|
|
32
|
+
* format={{
|
|
33
|
+
* showCurrencySymbol: true,
|
|
34
|
+
* currencySymbol: '$',
|
|
35
|
+
* useGrouping: true
|
|
36
|
+
* }}
|
|
37
|
+
* comparison={{
|
|
38
|
+
* value: 120
|
|
39
|
+
* }}
|
|
40
|
+
* />
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
const PisellMetricCard = (props) => {
|
|
44
|
+
const { title, subtitle, value, tag, tooltip, format, comparison, styleConfig, showSubtitle = false, showTag = false, showTooltip = false, loading = false, hoverable = true, className, style, onClick } = props;
|
|
45
|
+
const formatConfig = (0, react.useMemo)(() => {
|
|
46
|
+
var _format$precision, _format$useGrouping, _format$showCurrencyS, _format$currencySymbo, _format$hideDecimalFo;
|
|
47
|
+
return {
|
|
48
|
+
precision: (_format$precision = format === null || format === void 0 ? void 0 : format.precision) !== null && _format$precision !== void 0 ? _format$precision : 0,
|
|
49
|
+
useGrouping: (_format$useGrouping = format === null || format === void 0 ? void 0 : format.useGrouping) !== null && _format$useGrouping !== void 0 ? _format$useGrouping : false,
|
|
50
|
+
showCurrencySymbol: (_format$showCurrencyS = format === null || format === void 0 ? void 0 : format.showCurrencySymbol) !== null && _format$showCurrencyS !== void 0 ? _format$showCurrencyS : false,
|
|
51
|
+
currencySymbol: (_format$currencySymbo = format === null || format === void 0 ? void 0 : format.currencySymbol) !== null && _format$currencySymbo !== void 0 ? _format$currencySymbo : "",
|
|
52
|
+
formatter: format === null || format === void 0 ? void 0 : format.formatter,
|
|
53
|
+
hideDecimalForWholeNumbers: (_format$hideDecimalFo = format === null || format === void 0 ? void 0 : format.hideDecimalForWholeNumbers) !== null && _format$hideDecimalFo !== void 0 ? _format$hideDecimalFo : true
|
|
54
|
+
};
|
|
55
|
+
}, [format]);
|
|
56
|
+
const cardStyle = (0, react.useMemo)(() => {
|
|
57
|
+
var _styleConfig$card$bor, _styleConfig$card, _styleConfig$card$bor2, _styleConfig$card2, _styleConfig$card$pad, _styleConfig$card3, _styleConfig$card$sha, _styleConfig$card4, _styleConfig$card$bac, _styleConfig$card5, _styleConfig$card$wid, _styleConfig$card6;
|
|
58
|
+
return {
|
|
59
|
+
bordered: (_styleConfig$card$bor = styleConfig === null || styleConfig === void 0 || (_styleConfig$card = styleConfig.card) === null || _styleConfig$card === void 0 ? void 0 : _styleConfig$card.bordered) !== null && _styleConfig$card$bor !== void 0 ? _styleConfig$card$bor : true,
|
|
60
|
+
borderRadius: (_styleConfig$card$bor2 = styleConfig === null || styleConfig === void 0 || (_styleConfig$card2 = styleConfig.card) === null || _styleConfig$card2 === void 0 ? void 0 : _styleConfig$card2.borderRadius) !== null && _styleConfig$card$bor2 !== void 0 ? _styleConfig$card$bor2 : 12,
|
|
61
|
+
padding: (_styleConfig$card$pad = styleConfig === null || styleConfig === void 0 || (_styleConfig$card3 = styleConfig.card) === null || _styleConfig$card3 === void 0 ? void 0 : _styleConfig$card3.padding) !== null && _styleConfig$card$pad !== void 0 ? _styleConfig$card$pad : 16,
|
|
62
|
+
shadow: (_styleConfig$card$sha = styleConfig === null || styleConfig === void 0 || (_styleConfig$card4 = styleConfig.card) === null || _styleConfig$card4 === void 0 ? void 0 : _styleConfig$card4.shadow) !== null && _styleConfig$card$sha !== void 0 ? _styleConfig$card$sha : true,
|
|
63
|
+
background: (_styleConfig$card$bac = styleConfig === null || styleConfig === void 0 || (_styleConfig$card5 = styleConfig.card) === null || _styleConfig$card5 === void 0 ? void 0 : _styleConfig$card5.background) !== null && _styleConfig$card$bac !== void 0 ? _styleConfig$card$bac : "#ffffff",
|
|
64
|
+
width: (_styleConfig$card$wid = styleConfig === null || styleConfig === void 0 || (_styleConfig$card6 = styleConfig.card) === null || _styleConfig$card6 === void 0 ? void 0 : _styleConfig$card6.width) !== null && _styleConfig$card$wid !== void 0 ? _styleConfig$card$wid : "auto"
|
|
65
|
+
};
|
|
66
|
+
}, [styleConfig]);
|
|
67
|
+
const titleStyle = (0, react.useMemo)(() => {
|
|
68
|
+
var _styleConfig$title$si, _styleConfig$title, _styleConfig$title$we, _styleConfig$title2, _styleConfig$title$co, _styleConfig$title3;
|
|
69
|
+
return {
|
|
70
|
+
size: (_styleConfig$title$si = styleConfig === null || styleConfig === void 0 || (_styleConfig$title = styleConfig.title) === null || _styleConfig$title === void 0 ? void 0 : _styleConfig$title.size) !== null && _styleConfig$title$si !== void 0 ? _styleConfig$title$si : 14,
|
|
71
|
+
weight: (_styleConfig$title$we = styleConfig === null || styleConfig === void 0 || (_styleConfig$title2 = styleConfig.title) === null || _styleConfig$title2 === void 0 ? void 0 : _styleConfig$title2.weight) !== null && _styleConfig$title$we !== void 0 ? _styleConfig$title$we : 400,
|
|
72
|
+
color: (_styleConfig$title$co = styleConfig === null || styleConfig === void 0 || (_styleConfig$title3 = styleConfig.title) === null || _styleConfig$title3 === void 0 ? void 0 : _styleConfig$title3.color) !== null && _styleConfig$title$co !== void 0 ? _styleConfig$title$co : "rgba(0, 0, 0, 0.45)"
|
|
73
|
+
};
|
|
74
|
+
}, [styleConfig]);
|
|
75
|
+
const valueStyle = (0, react.useMemo)(() => {
|
|
76
|
+
var _styleConfig$value$si, _styleConfig$value, _styleConfig$value$we, _styleConfig$value2, _styleConfig$value$co, _styleConfig$value3;
|
|
77
|
+
return {
|
|
78
|
+
size: (_styleConfig$value$si = styleConfig === null || styleConfig === void 0 || (_styleConfig$value = styleConfig.value) === null || _styleConfig$value === void 0 ? void 0 : _styleConfig$value.size) !== null && _styleConfig$value$si !== void 0 ? _styleConfig$value$si : 30,
|
|
79
|
+
weight: (_styleConfig$value$we = styleConfig === null || styleConfig === void 0 || (_styleConfig$value2 = styleConfig.value) === null || _styleConfig$value2 === void 0 ? void 0 : _styleConfig$value2.weight) !== null && _styleConfig$value$we !== void 0 ? _styleConfig$value$we : 600,
|
|
80
|
+
color: (_styleConfig$value$co = styleConfig === null || styleConfig === void 0 || (_styleConfig$value3 = styleConfig.value) === null || _styleConfig$value3 === void 0 ? void 0 : _styleConfig$value3.color) !== null && _styleConfig$value$co !== void 0 ? _styleConfig$value$co : "rgba(0, 0, 0, 0.85)"
|
|
81
|
+
};
|
|
82
|
+
}, [styleConfig]);
|
|
83
|
+
const formattedValue = (0, react.useMemo)(() => {
|
|
84
|
+
return require_formatMetricValue.formatMetricValue(value, formatConfig);
|
|
85
|
+
}, [value, formatConfig]);
|
|
86
|
+
const comparisonConfig = (0, react.useMemo)(() => {
|
|
87
|
+
var _comparison$text, _comparison$showTrend, _comparison$positiveC, _comparison$negativeC, _comparison$size;
|
|
88
|
+
if (!(comparison === null || comparison === void 0 ? void 0 : comparison.value)) return null;
|
|
89
|
+
return {
|
|
90
|
+
value: comparison.value,
|
|
91
|
+
text: (_comparison$text = comparison.text) !== null && _comparison$text !== void 0 ? _comparison$text : "v.s. pre",
|
|
92
|
+
showTrendIcon: (_comparison$showTrend = comparison.showTrendIcon) !== null && _comparison$showTrend !== void 0 ? _comparison$showTrend : true,
|
|
93
|
+
positiveColor: (_comparison$positiveC = comparison.positiveColor) !== null && _comparison$positiveC !== void 0 ? _comparison$positiveC : "#52c41a",
|
|
94
|
+
negativeColor: (_comparison$negativeC = comparison.negativeColor) !== null && _comparison$negativeC !== void 0 ? _comparison$negativeC : "#ff4d4f",
|
|
95
|
+
size: (_comparison$size = comparison.size) !== null && _comparison$size !== void 0 ? _comparison$size : 14
|
|
96
|
+
};
|
|
97
|
+
}, [comparison]);
|
|
98
|
+
return /* @__PURE__ */ react.default.createElement(require_index.default, {
|
|
99
|
+
bordered: cardStyle.bordered,
|
|
100
|
+
borderRadius: cardStyle.borderRadius,
|
|
101
|
+
padding: cardStyle.padding,
|
|
102
|
+
loading,
|
|
103
|
+
isClickable: !!onClick,
|
|
104
|
+
onClick,
|
|
105
|
+
style: require_objectSpread2._objectSpread2({
|
|
106
|
+
width: typeof cardStyle.width === "number" ? `${cardStyle.width}px` : cardStyle.width,
|
|
107
|
+
background: cardStyle.background,
|
|
108
|
+
boxShadow: typeof cardStyle.shadow === "string" ? cardStyle.shadow : cardStyle.shadow ? "0px 1px 2px 0px rgba(16, 24, 40, 0.05)" : "none"
|
|
109
|
+
}, style),
|
|
110
|
+
className: `pisell-metric-card ${className || ""}`
|
|
111
|
+
}, /* @__PURE__ */ react.default.createElement(require_MetricTitle.default, {
|
|
112
|
+
title,
|
|
113
|
+
subtitle: showSubtitle ? subtitle : void 0,
|
|
114
|
+
tooltip: showTooltip ? tooltip : void 0,
|
|
115
|
+
titleSize: titleStyle.size,
|
|
116
|
+
titleWeight: titleStyle.weight,
|
|
117
|
+
titleColor: titleStyle.color
|
|
118
|
+
}), /* @__PURE__ */ react.default.createElement(require_MetricValue.default, {
|
|
119
|
+
value: formattedValue,
|
|
120
|
+
valueSize: valueStyle.size,
|
|
121
|
+
valueWeight: valueStyle.weight,
|
|
122
|
+
valueColor: valueStyle.color
|
|
123
|
+
}), comparisonConfig && /* @__PURE__ */ react.default.createElement(require_MetricComparison.default, {
|
|
124
|
+
comparison: comparisonConfig.value,
|
|
125
|
+
comparisonText: comparisonConfig.text,
|
|
126
|
+
showTrendIcon: comparisonConfig.showTrendIcon,
|
|
127
|
+
positiveColor: comparisonConfig.positiveColor,
|
|
128
|
+
negativeColor: comparisonConfig.negativeColor,
|
|
129
|
+
comparisonSize: comparisonConfig.size,
|
|
130
|
+
precision: formatConfig.precision,
|
|
131
|
+
showCurrencySymbol: formatConfig.showCurrencySymbol,
|
|
132
|
+
currencySymbol: formatConfig.currencySymbol
|
|
133
|
+
}), showTag && tag && /* @__PURE__ */ react.default.createElement("div", { className: "pisell-metric-card-tag" }, tag));
|
|
134
|
+
};
|
|
135
|
+
var PisellMetricCard_default = PisellMetricCard;
|
|
136
|
+
|
|
137
|
+
//#endregion
|
|
138
|
+
exports.default = PisellMetricCard_default;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.js');
|
|
2
|
+
const require_TrendIcon = require('./TrendIcon.js');
|
|
3
|
+
const require_formatMetricValue = require('../utils/formatMetricValue.js');
|
|
4
|
+
const require_calculateTrend = require('../utils/calculateTrend.js');
|
|
5
|
+
let react = require("react");
|
|
6
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
7
|
+
|
|
8
|
+
//#region src/components/pisellMetricCard/components/MetricComparison.tsx
|
|
9
|
+
/**
|
|
10
|
+
* MetricComparison 环比信息组件
|
|
11
|
+
*
|
|
12
|
+
* 负责渲染环比数值和趋势箭头
|
|
13
|
+
* - 自动根据正负值显示不同颜色
|
|
14
|
+
* - 支持格式化环比数值
|
|
15
|
+
* - 集成趋势箭头组件
|
|
16
|
+
*
|
|
17
|
+
* @param props 组件属性
|
|
18
|
+
*/
|
|
19
|
+
const MetricComparison = ({ comparison, comparisonText = "v.s. pre", showTrendIcon = true, positiveColor = "#52c41a", negativeColor = "#ff4d4f", comparisonSize = 14, precision, showCurrencySymbol, currencySymbol }) => {
|
|
20
|
+
const trend = (0, react.useMemo)(() => {
|
|
21
|
+
return require_calculateTrend.calculateTrend(comparison);
|
|
22
|
+
}, [comparison]);
|
|
23
|
+
const formattedComparison = (0, react.useMemo)(() => {
|
|
24
|
+
if (comparison === null || comparison === void 0) return null;
|
|
25
|
+
const numComparison = typeof comparison === "string" ? parseFloat(comparison) : comparison;
|
|
26
|
+
if (isNaN(numComparison)) return null;
|
|
27
|
+
return require_formatMetricValue.formatMetricValue(Math.abs(numComparison), {
|
|
28
|
+
precision,
|
|
29
|
+
showCurrencySymbol,
|
|
30
|
+
currencySymbol,
|
|
31
|
+
useGrouping: false
|
|
32
|
+
});
|
|
33
|
+
}, [
|
|
34
|
+
comparison,
|
|
35
|
+
precision,
|
|
36
|
+
showCurrencySymbol,
|
|
37
|
+
currencySymbol
|
|
38
|
+
]);
|
|
39
|
+
if (formattedComparison === null || trend === "neutral") return null;
|
|
40
|
+
const color = trend === "up" ? positiveColor : negativeColor;
|
|
41
|
+
const sign = trend === "up" ? "+" : "-";
|
|
42
|
+
return /* @__PURE__ */ react.default.createElement("div", {
|
|
43
|
+
className: "pisell-metric-card-comparison",
|
|
44
|
+
style: {
|
|
45
|
+
fontSize: typeof comparisonSize === "number" ? `${comparisonSize}px` : comparisonSize,
|
|
46
|
+
color
|
|
47
|
+
}
|
|
48
|
+
}, /* @__PURE__ */ react.default.createElement("span", null, comparisonText), /* @__PURE__ */ react.default.createElement("span", null, sign, formattedComparison), showTrendIcon && /* @__PURE__ */ react.default.createElement(require_TrendIcon.default, {
|
|
49
|
+
trend,
|
|
50
|
+
color
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
53
|
+
var MetricComparison_default = MetricComparison;
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
exports.default = MetricComparison_default;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.js');
|
|
2
|
+
let antd = require("antd");
|
|
3
|
+
let react = require("react");
|
|
4
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
5
|
+
let _ant_design_icons = require("@ant-design/icons");
|
|
6
|
+
|
|
7
|
+
//#region src/components/pisellMetricCard/components/MetricTitle.tsx
|
|
8
|
+
/**
|
|
9
|
+
* MetricTitle 标题组件
|
|
10
|
+
*
|
|
11
|
+
* 负责渲染标题、副标题和提示信息
|
|
12
|
+
* 支持自定义字号、字重、颜色等样式
|
|
13
|
+
*
|
|
14
|
+
* @param props 组件属性
|
|
15
|
+
*/
|
|
16
|
+
const MetricTitle = ({ title, subtitle, tooltip, titleSize = 14, titleWeight = 400, titleColor = "rgba(0, 0, 0, 0.45)" }) => {
|
|
17
|
+
return /* @__PURE__ */ react.default.createElement("div", { className: "pisell-metric-card-title-wrapper" }, /* @__PURE__ */ react.default.createElement("div", {
|
|
18
|
+
className: "pisell-metric-card-title",
|
|
19
|
+
style: {
|
|
20
|
+
fontSize: typeof titleSize === "number" ? `${titleSize}px` : titleSize,
|
|
21
|
+
fontWeight: titleWeight,
|
|
22
|
+
color: titleColor,
|
|
23
|
+
display: "flex",
|
|
24
|
+
alignItems: "center",
|
|
25
|
+
gap: "4px"
|
|
26
|
+
}
|
|
27
|
+
}, title, tooltip && /* @__PURE__ */ react.default.createElement(antd.Tooltip, { title: tooltip }, /* @__PURE__ */ react.default.createElement(_ant_design_icons.QuestionCircleOutlined, { style: {
|
|
28
|
+
fontSize: 12,
|
|
29
|
+
color: titleColor,
|
|
30
|
+
cursor: "help"
|
|
31
|
+
} }))), subtitle && /* @__PURE__ */ react.default.createElement("div", {
|
|
32
|
+
className: "pisell-metric-card-subtitle",
|
|
33
|
+
style: {
|
|
34
|
+
fontSize: 12,
|
|
35
|
+
fontWeight: 400,
|
|
36
|
+
color: titleColor
|
|
37
|
+
}
|
|
38
|
+
}, subtitle));
|
|
39
|
+
};
|
|
40
|
+
var MetricTitle_default = MetricTitle;
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
exports.default = MetricTitle_default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.js');
|
|
2
|
+
let react = require("react");
|
|
3
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
4
|
+
|
|
5
|
+
//#region src/components/pisellMetricCard/components/MetricValue.tsx
|
|
6
|
+
/**
|
|
7
|
+
* MetricValue 数值展示组件
|
|
8
|
+
*
|
|
9
|
+
* 负责渲染格式化后的主数值
|
|
10
|
+
* 支持自定义字号、字重、颜色等样式
|
|
11
|
+
*
|
|
12
|
+
* @param props 组件属性
|
|
13
|
+
*/
|
|
14
|
+
const MetricValue = ({ value, valueSize = 30, valueWeight = 600, valueColor = "rgba(0, 0, 0, 0.85)" }) => {
|
|
15
|
+
const displayValue = value !== null && value !== void 0 ? value : "-";
|
|
16
|
+
return /* @__PURE__ */ react.default.createElement("div", {
|
|
17
|
+
className: "pisell-metric-card-value",
|
|
18
|
+
style: {
|
|
19
|
+
fontSize: typeof valueSize === "number" ? `${valueSize}px` : valueSize,
|
|
20
|
+
fontWeight: valueWeight,
|
|
21
|
+
color: valueColor
|
|
22
|
+
}
|
|
23
|
+
}, displayValue);
|
|
24
|
+
};
|
|
25
|
+
var MetricValue_default = MetricValue;
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
exports.default = MetricValue_default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.js');
|
|
2
|
+
let react = require("react");
|
|
3
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
4
|
+
let _ant_design_icons = require("@ant-design/icons");
|
|
5
|
+
|
|
6
|
+
//#region src/components/pisellMetricCard/components/TrendIcon.tsx
|
|
7
|
+
/**
|
|
8
|
+
* TrendIcon 趋势箭头组件
|
|
9
|
+
*
|
|
10
|
+
* 根据趋势类型显示上升或下降箭头
|
|
11
|
+
* - up: 显示上升箭头 ↑
|
|
12
|
+
* - down: 显示下降箭头 ↓
|
|
13
|
+
* - neutral: 不显示箭头
|
|
14
|
+
*
|
|
15
|
+
* @param props 组件属性
|
|
16
|
+
*/
|
|
17
|
+
const TrendIcon = ({ trend, color }) => {
|
|
18
|
+
if (trend === "neutral") return null;
|
|
19
|
+
const Icon = trend === "up" ? _ant_design_icons.ArrowUpOutlined : _ant_design_icons.ArrowDownOutlined;
|
|
20
|
+
return /* @__PURE__ */ react.default.createElement(Icon, {
|
|
21
|
+
className: "pisell-metric-card-trend-icon",
|
|
22
|
+
style: { color }
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
var TrendIcon_default = TrendIcon;
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
exports.default = TrendIcon_default;
|