@pisell/materials 6.11.5 → 6.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +7 -7
- package/build/lowcode/preview.js +9 -9
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +16 -16
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +15 -15
- package/es/components/PisellTabbar/PisellTabbar.js +47 -44
- package/es/components/PisellTabbar/template/Template1/PisellTabbar.d.ts +3 -18
- package/es/components/PisellTabbar/template/Template1/PisellTabbar.js +124 -28
- package/es/components/PisellTabbar/template/Template1/constants.js +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +2 -2
- package/es/components/pisellDataSourceContainer/hooks/useDataSourceKey.d.ts +2 -2
- package/es/components/pisellDateTimeDisplay/PisellDateTimeDisplay.js +47 -34
- package/es/components/pisellDateTimeDisplay/PisellDateTimeDisplay.stories.d.ts +19 -0
- package/es/components/pisellDateTimeDisplay/PisellDateTimeDisplay.stories.js +74 -0
- package/es/components/pisellDateTimeDisplay/components/DateDisplay.d.ts +6 -1
- package/es/components/pisellDateTimeDisplay/components/DateDisplay.js +10 -3
- package/es/components/pisellDateTimeDisplay/formats/dateTimeDisplayFormats.d.ts +7 -0
- package/es/components/pisellDateTimeDisplay/formats/dateTimeDisplayFormats.js +81 -0
- package/es/components/pisellDateTimeDisplay/formats/index.d.ts +1 -0
- package/es/components/pisellDateTimeDisplay/formats/index.js +1 -0
- package/es/components/pisellDateTimeDisplay/hooks/useCurrentTime.d.ts +2 -2
- package/es/components/pisellDateTimeDisplay/hooks/useCurrentTime.js +2 -2
- package/es/components/pisellDateTimeDisplay/types.d.ts +48 -2
- package/es/components/pisellDateTimeDisplay/utils/formatDate.js +25 -6
- package/es/components/pisellDateTimeDisplay/utils/formatDateOrRelative.d.ts +17 -0
- package/es/components/pisellDateTimeDisplay/utils/formatDateOrRelative.js +38 -0
- package/es/components/pisellDateTimeDisplay/utils/formatWeekday.js +11 -12
- package/es/components/pisellDateTimeDisplay/utils/index.d.ts +3 -1
- package/es/components/pisellDateTimeDisplay/utils/index.js +3 -1
- package/es/components/pisellDateTimeDisplay/utils/localeUtils.d.ts +2 -7
- package/es/components/pisellDateTimeDisplay/utils/localeUtils.js +4 -17
- package/es/components/pisellDateTimeDisplay/utils/relativeDay.d.ts +23 -0
- package/es/components/pisellDateTimeDisplay/utils/relativeDay.js +45 -0
- package/es/components/pisellLookup/components/LookupTrigger.js +66 -6
- package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.d.ts +32 -0
- package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.js +197 -0
- package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.less +49 -0
- package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.stories.d.ts +61 -0
- package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.stories.js +209 -0
- package/es/components/pisellTimeRangeDisplay/components/DateBlock.d.ts +20 -0
- package/es/components/pisellTimeRangeDisplay/components/DateBlock.js +30 -0
- package/es/components/pisellTimeRangeDisplay/components/DurationBlock.d.ts +19 -0
- package/es/components/pisellTimeRangeDisplay/components/DurationBlock.js +25 -0
- package/es/components/pisellTimeRangeDisplay/components/TimeRangeBlock.d.ts +30 -0
- package/es/components/pisellTimeRangeDisplay/components/TimeRangeBlock.js +86 -0
- package/es/components/pisellTimeRangeDisplay/components/WeekdayBlock.d.ts +18 -0
- package/es/components/pisellTimeRangeDisplay/components/WeekdayBlock.js +23 -0
- package/es/components/pisellTimeRangeDisplay/components/index.d.ts +8 -0
- package/es/components/pisellTimeRangeDisplay/components/index.js +4 -0
- package/es/components/pisellTimeRangeDisplay/index.d.ts +3 -0
- package/es/components/pisellTimeRangeDisplay/index.js +1 -0
- package/es/components/pisellTimeRangeDisplay/types.d.ts +137 -0
- package/es/components/pisellTimeRangeDisplay/types.js +1 -0
- package/es/components/pisellTimeRangeDisplay/utils/formatDuration.d.ts +14 -0
- package/es/components/pisellTimeRangeDisplay/utils/formatDuration.js +53 -0
- package/es/components/pisellTimeRangeDisplay/utils/index.d.ts +4 -0
- package/es/components/pisellTimeRangeDisplay/utils/index.js +5 -0
- package/es/components/pisellTimeRangeDisplay/utils/parseTimeRange.d.ts +23 -0
- package/es/components/pisellTimeRangeDisplay/utils/parseTimeRange.js +27 -0
- package/es/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
- package/es/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
- package/es/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
- package/es/index.d.ts +2 -0
- package/es/index.js +7 -0
- package/es/utils/index.d.ts +1 -1
- package/es/utils/platform.d.ts +1 -1
- package/lib/components/PisellTabbar/PisellTabbar.js +64 -57
- package/lib/components/PisellTabbar/template/Template1/PisellTabbar.d.ts +3 -18
- package/lib/components/PisellTabbar/template/Template1/PisellTabbar.js +171 -55
- package/lib/components/PisellTabbar/template/Template1/constants.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +2 -2
- package/lib/components/pisellDataSourceContainer/hooks/useDataSourceKey.d.ts +2 -2
- package/lib/components/pisellDateTimeDisplay/PisellDateTimeDisplay.js +27 -17
- package/lib/components/pisellDateTimeDisplay/PisellDateTimeDisplay.stories.d.ts +19 -0
- package/lib/components/pisellDateTimeDisplay/PisellDateTimeDisplay.stories.js +63 -0
- package/lib/components/pisellDateTimeDisplay/components/DateDisplay.d.ts +6 -1
- package/lib/components/pisellDateTimeDisplay/components/DateDisplay.js +5 -1
- package/lib/components/pisellDateTimeDisplay/formats/dateTimeDisplayFormats.d.ts +7 -0
- package/lib/components/pisellDateTimeDisplay/formats/dateTimeDisplayFormats.js +98 -0
- package/lib/components/pisellDateTimeDisplay/formats/index.d.ts +1 -0
- package/lib/components/pisellDateTimeDisplay/formats/index.js +29 -0
- package/lib/components/pisellDateTimeDisplay/hooks/useCurrentTime.d.ts +2 -2
- package/lib/components/pisellDateTimeDisplay/types.d.ts +48 -2
- package/lib/components/pisellDateTimeDisplay/utils/formatDate.js +14 -1
- package/lib/components/pisellDateTimeDisplay/utils/formatDateOrRelative.d.ts +17 -0
- package/lib/components/pisellDateTimeDisplay/utils/formatDateOrRelative.js +54 -0
- package/lib/components/pisellDateTimeDisplay/utils/formatWeekday.js +6 -6
- package/lib/components/pisellDateTimeDisplay/utils/index.d.ts +3 -1
- package/lib/components/pisellDateTimeDisplay/utils/index.js +8 -2
- package/lib/components/pisellDateTimeDisplay/utils/localeUtils.d.ts +2 -7
- package/lib/components/pisellDateTimeDisplay/utils/localeUtils.js +2 -11
- package/lib/components/pisellDateTimeDisplay/utils/relativeDay.d.ts +23 -0
- package/lib/components/pisellDateTimeDisplay/utils/relativeDay.js +54 -0
- package/lib/components/pisellLookup/components/LookupTrigger.js +45 -7
- package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.d.ts +32 -0
- package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.js +193 -0
- package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.less +49 -0
- package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.stories.d.ts +61 -0
- package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.stories.js +187 -0
- package/lib/components/pisellTimeRangeDisplay/components/DateBlock.d.ts +20 -0
- package/lib/components/pisellTimeRangeDisplay/components/DateBlock.js +69 -0
- package/lib/components/pisellTimeRangeDisplay/components/DurationBlock.d.ts +19 -0
- package/lib/components/pisellTimeRangeDisplay/components/DurationBlock.js +65 -0
- package/lib/components/pisellTimeRangeDisplay/components/TimeRangeBlock.d.ts +30 -0
- package/lib/components/pisellTimeRangeDisplay/components/TimeRangeBlock.js +120 -0
- package/lib/components/pisellTimeRangeDisplay/components/WeekdayBlock.d.ts +18 -0
- package/lib/components/pisellTimeRangeDisplay/components/WeekdayBlock.js +64 -0
- package/lib/components/pisellTimeRangeDisplay/components/index.d.ts +8 -0
- package/lib/components/pisellTimeRangeDisplay/components/index.js +38 -0
- package/lib/components/pisellTimeRangeDisplay/index.d.ts +3 -0
- package/lib/components/pisellTimeRangeDisplay/index.js +40 -0
- package/lib/components/pisellTimeRangeDisplay/types.d.ts +137 -0
- package/lib/components/pisellTimeRangeDisplay/types.js +17 -0
- package/lib/components/pisellTimeRangeDisplay/utils/formatDuration.d.ts +14 -0
- package/lib/components/pisellTimeRangeDisplay/utils/formatDuration.js +52 -0
- package/lib/components/pisellTimeRangeDisplay/utils/index.d.ts +4 -0
- package/lib/components/pisellTimeRangeDisplay/utils/index.js +47 -0
- package/lib/components/pisellTimeRangeDisplay/utils/parseTimeRange.d.ts +23 -0
- package/lib/components/pisellTimeRangeDisplay/utils/parseTimeRange.js +49 -0
- package/lib/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
- package/lib/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
- package/lib/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +3 -0
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/platform.d.ts +1 -1
- package/lowcode/pisell-time-range-display/index.ts +3 -0
- package/lowcode/pisell-time-range-display/meta.ts +375 -0
- package/lowcode/pisell-time-range-display/snippets.ts +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/pisellDateTimeDisplay/utils/relativeDay.ts
|
|
20
|
+
var relativeDay_exports = {};
|
|
21
|
+
__export(relativeDay_exports, {
|
|
22
|
+
getRelativeDay: () => getRelativeDay,
|
|
23
|
+
getRelativeDayLabel: () => getRelativeDayLabel
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(relativeDay_exports);
|
|
26
|
+
var import_localeUtils = require("./localeUtils");
|
|
27
|
+
var LABELS_ZH = {
|
|
28
|
+
today: "今天",
|
|
29
|
+
yesterday: "昨天",
|
|
30
|
+
tomorrow: "明天"
|
|
31
|
+
};
|
|
32
|
+
var LABELS_EN = {
|
|
33
|
+
today: "Today",
|
|
34
|
+
yesterday: "Yesterday",
|
|
35
|
+
tomorrow: "Tomorrow"
|
|
36
|
+
};
|
|
37
|
+
function getRelativeDay(date, reference) {
|
|
38
|
+
const d = date.startOf("day");
|
|
39
|
+
const r = reference.startOf("day");
|
|
40
|
+
const diff = d.diff(r, "day");
|
|
41
|
+
if (diff === 0) return "today";
|
|
42
|
+
if (diff === 1) return "tomorrow";
|
|
43
|
+
if (diff === -1) return "yesterday";
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
function getRelativeDayLabel(day, locale) {
|
|
47
|
+
const isZh = locale ? (0, import_localeUtils.isChinese)(locale) : false;
|
|
48
|
+
return isZh ? LABELS_ZH[day] : LABELS_EN[day];
|
|
49
|
+
}
|
|
50
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
51
|
+
0 && (module.exports = {
|
|
52
|
+
getRelativeDay,
|
|
53
|
+
getRelativeDayLabel
|
|
54
|
+
});
|
|
@@ -32,14 +32,16 @@ __export(LookupTrigger_exports, {
|
|
|
32
32
|
LookupTrigger: () => LookupTrigger
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(LookupTrigger_exports);
|
|
35
|
-
var import_react = __toESM(require("react"));
|
|
36
|
-
var import_antd = require("antd");
|
|
37
35
|
var import_icons = require("@ant-design/icons");
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
|
|
38
39
|
var import_locales = require("../../../locales");
|
|
39
|
-
var import_pisellQRScanner = __toESM(require("../../pisellQRScanner"));
|
|
40
40
|
var import_iconfont = __toESM(require("../../iconfont"));
|
|
41
|
+
var import_pisellQRScanner = __toESM(require("../../pisellQRScanner"));
|
|
41
42
|
var LookupTriggerComponent = (0, import_react.forwardRef)(
|
|
42
43
|
(props, ref) => {
|
|
44
|
+
var _a;
|
|
43
45
|
const {
|
|
44
46
|
type = "input",
|
|
45
47
|
trigger,
|
|
@@ -67,17 +69,19 @@ var LookupTriggerComponent = (0, import_react.forwardRef)(
|
|
|
67
69
|
className,
|
|
68
70
|
style
|
|
69
71
|
} = props;
|
|
72
|
+
const context = (0, import_useEngineContext.default)();
|
|
73
|
+
const { getApp } = (_a = context.appHelper) == null ? void 0 : _a.utils;
|
|
70
74
|
const inputRef = (0, import_react.useRef)(null);
|
|
71
75
|
(0, import_react.useImperativeHandle)(
|
|
72
76
|
ref,
|
|
73
77
|
() => ({
|
|
74
78
|
focus: () => {
|
|
75
|
-
var
|
|
76
|
-
(
|
|
79
|
+
var _a2;
|
|
80
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
77
81
|
},
|
|
78
82
|
select: () => {
|
|
79
|
-
var
|
|
80
|
-
(
|
|
83
|
+
var _a2;
|
|
84
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.select();
|
|
81
85
|
}
|
|
82
86
|
}),
|
|
83
87
|
[]
|
|
@@ -90,7 +94,41 @@ var LookupTriggerComponent = (0, import_react.forwardRef)(
|
|
|
90
94
|
onChange == null ? void 0 : onChange("");
|
|
91
95
|
onClear == null ? void 0 : onClear();
|
|
92
96
|
};
|
|
97
|
+
const getAppScanBarcodePlugin = () => {
|
|
98
|
+
var _a2;
|
|
99
|
+
if (getApp) {
|
|
100
|
+
const app = getApp();
|
|
101
|
+
const scanBarcode = (_a2 = app == null ? void 0 : app.getPlugin("scan")) == null ? void 0 : _a2.scanBarcode;
|
|
102
|
+
if (scanBarcode) {
|
|
103
|
+
return scanBarcode;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return null;
|
|
107
|
+
};
|
|
108
|
+
const appScan = () => {
|
|
109
|
+
const app = getApp();
|
|
110
|
+
try {
|
|
111
|
+
const scanBarcode = getAppScanBarcodePlugin();
|
|
112
|
+
scanBarcode({ hint: 17 }).then((res) => onScan == null ? void 0 : onScan(res == null ? void 0 : res.ScanResult)).catch((err) => {
|
|
113
|
+
app.logger.addLog({
|
|
114
|
+
type: "error",
|
|
115
|
+
title: "扫码失败",
|
|
116
|
+
metadata: { err }
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
} catch (err) {
|
|
120
|
+
app.logger.addLog({
|
|
121
|
+
type: "error",
|
|
122
|
+
title: "扫码代码执行异常",
|
|
123
|
+
metadata: { err }
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
};
|
|
93
127
|
const handleScanClick = () => {
|
|
128
|
+
if (getAppScanBarcodePlugin()) {
|
|
129
|
+
appScan();
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
94
132
|
setScanVisible(true);
|
|
95
133
|
};
|
|
96
134
|
const handleScanSuccess = (code) => {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import 'dayjs/locale/zh-cn';
|
|
3
|
+
import 'dayjs/locale/en';
|
|
4
|
+
import type { PisellTimeRangeDisplayProps } from './types';
|
|
5
|
+
import './PisellTimeRangeDisplay.less';
|
|
6
|
+
/**
|
|
7
|
+
* PisellTimeRangeDisplay 组件
|
|
8
|
+
*
|
|
9
|
+
* @description
|
|
10
|
+
* 纯展示型时间区间组件,将 startAt / endAt 格式化为「时间区间 + 持续时间」。
|
|
11
|
+
* - 同一天:HH:mm-HH:mm,可选显示日期/星期
|
|
12
|
+
* - 跨天:起止日期时间
|
|
13
|
+
* - 持续时间:d h m s 格式
|
|
14
|
+
* - 字段顺序由 fieldOrder 控制,可将 duration 放在中间
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <PisellTimeRangeDisplay
|
|
18
|
+
* startAt="2026-02-04 09:00"
|
|
19
|
+
* endAt="2026-02-04 18:00"
|
|
20
|
+
* />
|
|
21
|
+
* // => "09:00-18:00" + "9h"
|
|
22
|
+
*
|
|
23
|
+
* <PisellTimeRangeDisplay
|
|
24
|
+
* startAt={start}
|
|
25
|
+
* endAt={end}
|
|
26
|
+
* fields={{ fieldOrder: ['time', 'duration', 'date', 'weekday'] }}
|
|
27
|
+
* showDateForSameDay
|
|
28
|
+
* />
|
|
29
|
+
*/
|
|
30
|
+
export declare const PisellTimeRangeDisplay: React.FC<PisellTimeRangeDisplayProps>;
|
|
31
|
+
declare const _default: React.NamedExoticComponent<PisellTimeRangeDisplayProps>;
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.tsx
|
|
30
|
+
var PisellTimeRangeDisplay_exports = {};
|
|
31
|
+
__export(PisellTimeRangeDisplay_exports, {
|
|
32
|
+
PisellTimeRangeDisplay: () => PisellTimeRangeDisplay,
|
|
33
|
+
default: () => PisellTimeRangeDisplay_default
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(PisellTimeRangeDisplay_exports);
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
38
|
+
var import_zh_cn = require("dayjs/locale/zh-cn");
|
|
39
|
+
var import_en = require("dayjs/locale/en");
|
|
40
|
+
var import_utils = require("./utils");
|
|
41
|
+
var import_components = require("./components");
|
|
42
|
+
var import_PisellTimeRangeDisplay = require("./PisellTimeRangeDisplay.less");
|
|
43
|
+
var PisellTimeRangeDisplay = (props) => {
|
|
44
|
+
const {
|
|
45
|
+
startAt,
|
|
46
|
+
endAt,
|
|
47
|
+
textAlign = "center",
|
|
48
|
+
fields,
|
|
49
|
+
showDateForSameDay = true,
|
|
50
|
+
timeFormat,
|
|
51
|
+
dateFormat,
|
|
52
|
+
weekdayFormat,
|
|
53
|
+
durationFormat,
|
|
54
|
+
containerStyle,
|
|
55
|
+
timeStyle,
|
|
56
|
+
dateStyle,
|
|
57
|
+
weekdayStyle,
|
|
58
|
+
durationStyle,
|
|
59
|
+
locale: localeProp,
|
|
60
|
+
className,
|
|
61
|
+
style,
|
|
62
|
+
onClick
|
|
63
|
+
} = props;
|
|
64
|
+
const effectiveLocale = (0, import_react.useMemo)(
|
|
65
|
+
() => localeProp ?? (0, import_utils.getDayjsLocale)(),
|
|
66
|
+
[localeProp]
|
|
67
|
+
);
|
|
68
|
+
const { start, end, isSameDay } = (0, import_react.useMemo)(
|
|
69
|
+
() => (0, import_utils.parseTimeRange)(startAt, endAt, effectiveLocale),
|
|
70
|
+
[startAt, endAt, effectiveLocale]
|
|
71
|
+
);
|
|
72
|
+
const durationMs = (0, import_react.useMemo)(() => end.diff(start), [start, end]);
|
|
73
|
+
const {
|
|
74
|
+
showTimeRange = true,
|
|
75
|
+
showDate = true,
|
|
76
|
+
showWeekday = true,
|
|
77
|
+
showDuration = true,
|
|
78
|
+
fieldOrder = ["weekday", "date", "time", "duration"]
|
|
79
|
+
} = fields || {};
|
|
80
|
+
const showSeconds = (durationFormat == null ? void 0 : durationFormat.showSeconds) ?? false;
|
|
81
|
+
const effectiveDateFormat = (0, import_react.useMemo)(
|
|
82
|
+
() => ({ showRelativeDay: true, ...dateFormat }),
|
|
83
|
+
[dateFormat]
|
|
84
|
+
);
|
|
85
|
+
const referenceDate = (0, import_dayjs.default)();
|
|
86
|
+
const relativeDay = (effectiveDateFormat == null ? void 0 : effectiveDateFormat.showRelativeDay) ? (0, import_utils.getRelativeDay)(start, referenceDate) : null;
|
|
87
|
+
const hideWeekdayWhenDateRelative = showDate && relativeDay !== null;
|
|
88
|
+
const justifyContent = textAlign === "right" ? "flex-end" : textAlign === "left" ? "flex-start" : "center";
|
|
89
|
+
const containerInlineStyle = {
|
|
90
|
+
background: containerStyle == null ? void 0 : containerStyle.background,
|
|
91
|
+
borderRadius: containerStyle == null ? void 0 : containerStyle.borderRadius,
|
|
92
|
+
border: containerStyle == null ? void 0 : containerStyle.border,
|
|
93
|
+
boxShadow: containerStyle == null ? void 0 : containerStyle.boxShadow,
|
|
94
|
+
padding: containerStyle == null ? void 0 : containerStyle.padding,
|
|
95
|
+
gap: containerStyle == null ? void 0 : containerStyle.gap,
|
|
96
|
+
textAlign,
|
|
97
|
+
justifyContent,
|
|
98
|
+
...style
|
|
99
|
+
};
|
|
100
|
+
const renderField = (fieldType) => {
|
|
101
|
+
switch (fieldType) {
|
|
102
|
+
case "time":
|
|
103
|
+
return showTimeRange ? /* @__PURE__ */ import_react.default.createElement(
|
|
104
|
+
import_components.TimeRangeBlock,
|
|
105
|
+
{
|
|
106
|
+
key: "time",
|
|
107
|
+
start,
|
|
108
|
+
end,
|
|
109
|
+
isSameDay,
|
|
110
|
+
timeFormat,
|
|
111
|
+
dateFormat: effectiveDateFormat,
|
|
112
|
+
weekdayFormat,
|
|
113
|
+
referenceDate: (0, import_dayjs.default)(),
|
|
114
|
+
style: timeStyle
|
|
115
|
+
}
|
|
116
|
+
) : null;
|
|
117
|
+
case "date":
|
|
118
|
+
if (!showDate) return null;
|
|
119
|
+
if (!isSameDay) return null;
|
|
120
|
+
if (!showDateForSameDay) return null;
|
|
121
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
122
|
+
import_components.DateBlock,
|
|
123
|
+
{
|
|
124
|
+
key: "date",
|
|
125
|
+
date: start,
|
|
126
|
+
format: effectiveDateFormat,
|
|
127
|
+
referenceDate: (0, import_dayjs.default)(),
|
|
128
|
+
style: dateStyle
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
case "weekday":
|
|
132
|
+
if (!showWeekday) return null;
|
|
133
|
+
if (!isSameDay) return null;
|
|
134
|
+
if (!showDateForSameDay) return null;
|
|
135
|
+
if (hideWeekdayWhenDateRelative) return null;
|
|
136
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
137
|
+
import_components.WeekdayBlock,
|
|
138
|
+
{
|
|
139
|
+
key: "weekday",
|
|
140
|
+
weekday: start,
|
|
141
|
+
format: weekdayFormat,
|
|
142
|
+
style: weekdayStyle
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
case "duration":
|
|
146
|
+
return showDuration ? /* @__PURE__ */ import_react.default.createElement(
|
|
147
|
+
import_components.DurationBlock,
|
|
148
|
+
{
|
|
149
|
+
key: "duration",
|
|
150
|
+
durationMs,
|
|
151
|
+
showSeconds,
|
|
152
|
+
locale: effectiveLocale,
|
|
153
|
+
style: durationStyle
|
|
154
|
+
}
|
|
155
|
+
) : null;
|
|
156
|
+
default:
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
const items = [];
|
|
161
|
+
fieldOrder.forEach((fieldType) => {
|
|
162
|
+
const node = renderField(fieldType);
|
|
163
|
+
if (node != null) {
|
|
164
|
+
items.push({ type: fieldType, node });
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
if (items.length === 0) {
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
const renderedWithSeparator = items.flatMap(({ type, node }, index) => {
|
|
171
|
+
const needDotBefore = type === "duration" && index > 0;
|
|
172
|
+
const needDotAfter = type === "duration" && index < items.length - 1;
|
|
173
|
+
const sep = /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-time-range-display-sep", "aria-hidden": true }, " · ");
|
|
174
|
+
const el = import_react.default.cloneElement(node, { key: type });
|
|
175
|
+
if (needDotBefore) return [sep, el];
|
|
176
|
+
if (needDotAfter) return [el, sep];
|
|
177
|
+
return [el];
|
|
178
|
+
});
|
|
179
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
180
|
+
"div",
|
|
181
|
+
{
|
|
182
|
+
className: `pisell-time-range-display ${className || ""}`.trim(),
|
|
183
|
+
style: containerInlineStyle,
|
|
184
|
+
onClick
|
|
185
|
+
},
|
|
186
|
+
renderedWithSeparator
|
|
187
|
+
);
|
|
188
|
+
};
|
|
189
|
+
var PisellTimeRangeDisplay_default = import_react.default.memo(PisellTimeRangeDisplay);
|
|
190
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
191
|
+
0 && (module.exports = {
|
|
192
|
+
PisellTimeRangeDisplay
|
|
193
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time Range Display 样式
|
|
3
|
+
* 无 layout 配置:一行放不下时按块换行,块内不换行,换行后每行居中
|
|
4
|
+
*/
|
|
5
|
+
.pisell-time-range-display {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: row;
|
|
8
|
+
flex-wrap: wrap;
|
|
9
|
+
align-items: baseline;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
gap: 0 4px;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
color: rgba(0, 0, 0, 0.88);
|
|
14
|
+
|
|
15
|
+
.pisell-time-range-display-time,
|
|
16
|
+
.pisell-time-range-display-date,
|
|
17
|
+
.pisell-time-range-display-weekday,
|
|
18
|
+
.pisell-time-range-display-duration {
|
|
19
|
+
font-size: 14px;
|
|
20
|
+
font-weight: 400;
|
|
21
|
+
line-height: 1.5;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.pisell-time-range-display-sep {
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
font-weight: 400;
|
|
27
|
+
margin: 0 2px;
|
|
28
|
+
user-select: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// 各块内不换行,换行时以块为单位
|
|
32
|
+
&-time,
|
|
33
|
+
&-date,
|
|
34
|
+
&-weekday,
|
|
35
|
+
&-duration {
|
|
36
|
+
//display: inline-block;
|
|
37
|
+
//white-space: nowrap;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&-sep {
|
|
41
|
+
//display: inline-block;
|
|
42
|
+
//white-space: nowrap;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// 同天小宽度:「 - 结束时间」不拆开
|
|
46
|
+
&-time-end-wrap {
|
|
47
|
+
//white-space: nowrap;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { PisellTimeRangeDisplay } from './PisellTimeRangeDisplay';
|
|
3
|
+
/**
|
|
4
|
+
* PisellTimeRangeDisplay 组件 Storybook
|
|
5
|
+
* 用于时间区间 + 持续时长的展示(同一天 / 跨天)
|
|
6
|
+
*/
|
|
7
|
+
declare const meta: Meta<typeof PisellTimeRangeDisplay>;
|
|
8
|
+
export default meta;
|
|
9
|
+
declare type Story = StoryObj<typeof PisellTimeRangeDisplay>;
|
|
10
|
+
/**
|
|
11
|
+
* 默认:同一天时间区间 + 持续时长
|
|
12
|
+
*/
|
|
13
|
+
export declare const Default: Story;
|
|
14
|
+
/**
|
|
15
|
+
* 同一天 + 显示日期与星期
|
|
16
|
+
*/
|
|
17
|
+
export declare const SameDayWithDate: Story;
|
|
18
|
+
/**
|
|
19
|
+
* 跨天时间区间
|
|
20
|
+
*/
|
|
21
|
+
export declare const CrossDay: Story;
|
|
22
|
+
/**
|
|
23
|
+
* 跨年
|
|
24
|
+
*/
|
|
25
|
+
export declare const CrossYear: Story;
|
|
26
|
+
/**
|
|
27
|
+
* 持续时间在中间(默认 fieldOrder)
|
|
28
|
+
*/
|
|
29
|
+
export declare const DurationInMiddle: Story;
|
|
30
|
+
/**
|
|
31
|
+
* 持续时长在前
|
|
32
|
+
*/
|
|
33
|
+
export declare const DurationFirst: Story;
|
|
34
|
+
/**
|
|
35
|
+
* 持续时长显示秒
|
|
36
|
+
*/
|
|
37
|
+
export declare const DurationWithSeconds: Story;
|
|
38
|
+
/**
|
|
39
|
+
* 仅时间区间 + 持续时长(不显示日期星期)
|
|
40
|
+
*/
|
|
41
|
+
export declare const TimeAndDurationOnly: Story;
|
|
42
|
+
/**
|
|
43
|
+
* 12 小时制
|
|
44
|
+
*/
|
|
45
|
+
export declare const Time12Hour: Story;
|
|
46
|
+
/**
|
|
47
|
+
* 中文(日期 + 持续时长「天/时/分/秒」i18n)
|
|
48
|
+
*/
|
|
49
|
+
export declare const LocaleZhCN: Story;
|
|
50
|
+
/**
|
|
51
|
+
* 英文(日期 + 持续时长 d/h/m/s)
|
|
52
|
+
*/
|
|
53
|
+
export declare const LocaleEn: Story;
|
|
54
|
+
/**
|
|
55
|
+
* 小宽度:容器较窄时按块换行
|
|
56
|
+
*/
|
|
57
|
+
export declare const NarrowWidth: Story;
|
|
58
|
+
/**
|
|
59
|
+
* 自定义容器样式
|
|
60
|
+
*/
|
|
61
|
+
export declare const CustomContainerStyle: Story;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.stories.tsx
|
|
20
|
+
var PisellTimeRangeDisplay_stories_exports = {};
|
|
21
|
+
__export(PisellTimeRangeDisplay_stories_exports, {
|
|
22
|
+
CrossDay: () => CrossDay,
|
|
23
|
+
CrossYear: () => CrossYear,
|
|
24
|
+
CustomContainerStyle: () => CustomContainerStyle,
|
|
25
|
+
Default: () => Default,
|
|
26
|
+
DurationFirst: () => DurationFirst,
|
|
27
|
+
DurationInMiddle: () => DurationInMiddle,
|
|
28
|
+
DurationWithSeconds: () => DurationWithSeconds,
|
|
29
|
+
LocaleEn: () => LocaleEn,
|
|
30
|
+
LocaleZhCN: () => LocaleZhCN,
|
|
31
|
+
NarrowWidth: () => NarrowWidth,
|
|
32
|
+
SameDayWithDate: () => SameDayWithDate,
|
|
33
|
+
Time12Hour: () => Time12Hour,
|
|
34
|
+
TimeAndDurationOnly: () => TimeAndDurationOnly,
|
|
35
|
+
default: () => PisellTimeRangeDisplay_stories_default
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(PisellTimeRangeDisplay_stories_exports);
|
|
38
|
+
var import_PisellTimeRangeDisplay = require("./PisellTimeRangeDisplay");
|
|
39
|
+
var meta = {
|
|
40
|
+
title: "General/PisellTimeRangeDisplay",
|
|
41
|
+
component: import_PisellTimeRangeDisplay.PisellTimeRangeDisplay,
|
|
42
|
+
tags: ["autodocs"],
|
|
43
|
+
argTypes: {
|
|
44
|
+
textAlign: {
|
|
45
|
+
control: "radio",
|
|
46
|
+
options: ["left", "center", "right"],
|
|
47
|
+
description: "文本对齐"
|
|
48
|
+
},
|
|
49
|
+
showDateForSameDay: {
|
|
50
|
+
control: "boolean",
|
|
51
|
+
description: "同一天时是否显示日期与星期"
|
|
52
|
+
},
|
|
53
|
+
locale: {
|
|
54
|
+
control: "select",
|
|
55
|
+
options: ["zh-cn", "en"],
|
|
56
|
+
description: "语言"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
var PisellTimeRangeDisplay_stories_default = meta;
|
|
61
|
+
var Default = {
|
|
62
|
+
args: {
|
|
63
|
+
startAt: "2026-02-04 09:00",
|
|
64
|
+
endAt: "2026-02-04 18:00"
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
var SameDayWithDate = {
|
|
68
|
+
args: {
|
|
69
|
+
startAt: "2026-02-04 09:00",
|
|
70
|
+
endAt: "2026-02-04 18:00",
|
|
71
|
+
showDateForSameDay: true
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var CrossDay = {
|
|
75
|
+
args: {
|
|
76
|
+
startAt: "2026-02-04 18:00",
|
|
77
|
+
endAt: "2026-02-05 10:00"
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
var CrossYear = {
|
|
81
|
+
args: {
|
|
82
|
+
startAt: "2025-12-31 22:00",
|
|
83
|
+
endAt: "2026-01-01 02:00"
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
var DurationInMiddle = {
|
|
87
|
+
args: {
|
|
88
|
+
startAt: "2026-02-04 09:00",
|
|
89
|
+
endAt: "2026-02-04 18:00",
|
|
90
|
+
showDateForSameDay: true,
|
|
91
|
+
fields: {
|
|
92
|
+
fieldOrder: ["time", "duration", "date", "weekday"]
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
var DurationFirst = {
|
|
97
|
+
args: {
|
|
98
|
+
startAt: "2026-02-04 09:00",
|
|
99
|
+
endAt: "2026-02-04 18:00",
|
|
100
|
+
fields: {
|
|
101
|
+
fieldOrder: ["duration", "time"]
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
var DurationWithSeconds = {
|
|
106
|
+
args: {
|
|
107
|
+
startAt: "2026-02-04 09:00:00",
|
|
108
|
+
endAt: "2026-02-04 09:30:45",
|
|
109
|
+
durationFormat: { showSeconds: true }
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
var TimeAndDurationOnly = {
|
|
113
|
+
args: {
|
|
114
|
+
startAt: "2026-02-04 09:00",
|
|
115
|
+
endAt: "2026-02-04 18:00",
|
|
116
|
+
fields: {
|
|
117
|
+
showTimeRange: true,
|
|
118
|
+
showDate: false,
|
|
119
|
+
showWeekday: false,
|
|
120
|
+
showDuration: true
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
var Time12Hour = {
|
|
125
|
+
args: {
|
|
126
|
+
startAt: "2026-02-04 09:00",
|
|
127
|
+
endAt: "2026-02-04 18:00",
|
|
128
|
+
timeFormat: { use12Hour: true }
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
var LocaleZhCN = {
|
|
132
|
+
args: {
|
|
133
|
+
startAt: "2026-02-04 09:00",
|
|
134
|
+
endAt: "2026-02-04 18:00",
|
|
135
|
+
showDateForSameDay: true,
|
|
136
|
+
locale: "zh-cn",
|
|
137
|
+
dateFormat: { showChineseUnit: true, showYear: true }
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
var LocaleEn = {
|
|
141
|
+
args: {
|
|
142
|
+
startAt: "2026-02-04 09:00",
|
|
143
|
+
endAt: "2026-02-04 18:00",
|
|
144
|
+
showDateForSameDay: true,
|
|
145
|
+
locale: "en",
|
|
146
|
+
dateFormat: { order: "MDY", showYear: true }
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
var NarrowWidth = {
|
|
150
|
+
args: {
|
|
151
|
+
startAt: "2026-03-21 10:15",
|
|
152
|
+
endAt: "2026-03-21 10:45",
|
|
153
|
+
showDateForSameDay: true,
|
|
154
|
+
dateFormat: { order: "MDY", showYear: true }
|
|
155
|
+
},
|
|
156
|
+
decorators: [
|
|
157
|
+
(Story) => /* @__PURE__ */ React.createElement("div", { style: { maxWidth: 320, border: "1px dashed #ccc", padding: 8 } }, /* @__PURE__ */ React.createElement(Story, null))
|
|
158
|
+
]
|
|
159
|
+
};
|
|
160
|
+
var CustomContainerStyle = {
|
|
161
|
+
args: {
|
|
162
|
+
startAt: "2026-02-04 09:00",
|
|
163
|
+
endAt: "2026-02-04 18:00",
|
|
164
|
+
containerStyle: {
|
|
165
|
+
background: "#f5f5f5",
|
|
166
|
+
borderRadius: 8,
|
|
167
|
+
padding: 16,
|
|
168
|
+
gap: 8
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
173
|
+
0 && (module.exports = {
|
|
174
|
+
CrossDay,
|
|
175
|
+
CrossYear,
|
|
176
|
+
CustomContainerStyle,
|
|
177
|
+
Default,
|
|
178
|
+
DurationFirst,
|
|
179
|
+
DurationInMiddle,
|
|
180
|
+
DurationWithSeconds,
|
|
181
|
+
LocaleEn,
|
|
182
|
+
LocaleZhCN,
|
|
183
|
+
NarrowWidth,
|
|
184
|
+
SameDayWithDate,
|
|
185
|
+
Time12Hour,
|
|
186
|
+
TimeAndDurationOnly
|
|
187
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type Dayjs } from 'dayjs';
|
|
3
|
+
import type { DateFormatConfig, TextStyleConfig } from '../types';
|
|
4
|
+
export interface DateBlockProps {
|
|
5
|
+
/** 日期对象 */
|
|
6
|
+
date: Dayjs;
|
|
7
|
+
/** 日期格式配置(含 showRelativeDay:今天/昨天/明天) */
|
|
8
|
+
format?: DateFormatConfig;
|
|
9
|
+
/** 参考日期,用于相对日判定,默认 dayjs() */
|
|
10
|
+
referenceDate?: Dayjs;
|
|
11
|
+
/** 文本样式 */
|
|
12
|
+
style?: TextStyleConfig;
|
|
13
|
+
/** 自定义类名 */
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 日期展示块(复用 PisellDateTimeDisplay 的 formatDate 与相对日逻辑)
|
|
18
|
+
*/
|
|
19
|
+
export declare const DateBlock: React.FC<DateBlockProps>;
|
|
20
|
+
export default DateBlock;
|