@pisell/materials 1.0.1046 → 1.0.1047
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/meta.js +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.js +7 -7
- 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/Checkbox/WithMode.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Radio/WithMode.d.ts +2 -2
- package/es/components/date-picker/index.d.ts +2 -2
- package/es/components/pisellDateTimeDisplay/PisellDateTimeDisplay.js +9 -4
- package/es/components/pisellDateTimeDisplay/hooks/useCurrentTime.js +5 -1
- package/es/components/pisellDateTimeDisplay/utils/localeUtils.js +10 -4
- package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.js +5 -2
- package/lib/components/dataSourceComponents/fields/Checkbox/WithMode.d.ts +2 -2
- package/lib/components/pisellDataSourceContainer/components/Pagination/index.d.ts +2 -2
- package/lib/components/pisellDataSourceContainer/components/Table/index.d.ts +2 -2
- package/lib/components/pisellDateTimeDisplay/PisellDateTimeDisplay.js +9 -4
- package/lib/components/pisellDateTimeDisplay/hooks/useCurrentTime.js +5 -1
- package/lib/components/pisellDateTimeDisplay/utils/localeUtils.js +10 -4
- package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.js +5 -2
- package/lib/components/section-footers/index.d.ts +2 -2
- package/lib/components/skeleton/index.d.ts +2 -2
- package/lib/components/time-picker/index.d.ts +2 -2
- package/lib/components/upload/index.d.ts +2 -2
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react2 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/checkbox/index.d.ts
|
|
5
|
-
declare const Checkbox: (props: any) =>
|
|
5
|
+
declare const Checkbox: (props: any) => react2.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Checkbox };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react0 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts
|
|
5
|
-
declare const DataSourceQRCode: (props: any) =>
|
|
5
|
+
declare const DataSourceQRCode: (props: any) => react0.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { DataSourceQRCode };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CheckboxGroupProps } from "./type.js";
|
|
3
3
|
import { WithModeProps } from "../../dataSourceForm/utils.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react36 from "react";
|
|
5
5
|
|
|
6
6
|
//#region src/components/dataSourceComponents/fields/Checkbox/WithMode.d.ts
|
|
7
7
|
type CheckboxComponent = React.FC & {
|
|
8
8
|
Group: typeof CheckboxGroupWithMode;
|
|
9
9
|
};
|
|
10
10
|
declare const CheckboxWithMode: CheckboxComponent;
|
|
11
|
-
declare const CheckboxGroupWithMode:
|
|
11
|
+
declare const CheckboxGroupWithMode: react36.FC<CheckboxGroupProps & WithModeProps>;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { CheckboxWithMode };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { WithModeProps } from "../../dataSourceForm/utils.js";
|
|
3
3
|
import { RadioGroupProps } from "./type.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react35 from "react";
|
|
5
5
|
|
|
6
6
|
//#region src/components/dataSourceComponents/fields/Radio/WithMode.d.ts
|
|
7
7
|
type RadioComponent = React.FC & {
|
|
8
8
|
Group: typeof RadioGroupWithMode;
|
|
9
9
|
};
|
|
10
10
|
declare const RadioWithMode: RadioComponent;
|
|
11
|
-
declare const RadioGroupWithMode:
|
|
11
|
+
declare const RadioGroupWithMode: react35.FC<RadioGroupProps & WithModeProps>;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { RadioWithMode };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react1 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/date-picker/index.d.ts
|
|
5
|
-
declare const DatePicker: (props: any) =>
|
|
5
|
+
declare const DatePicker: (props: any) => react1.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { DatePicker };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.108.0/helpers/objectSpread2.js";
|
|
2
|
+
import useEngineContext_default from "../../hooks/useEngineContext.js";
|
|
2
3
|
import { getDayjsLocale, isChinese } from "./utils/localeUtils.js";
|
|
3
4
|
import { useCurrentTime } from "./hooks/useCurrentTime.js";
|
|
4
5
|
import { getRelativeDay, getRelativeDayLabel } from "./utils/relativeDay.js";
|
|
@@ -42,9 +43,13 @@ import "./PisellDateTimeDisplay.less";
|
|
|
42
43
|
* />
|
|
43
44
|
*/
|
|
44
45
|
const PisellDateTimeDisplay = (props) => {
|
|
45
|
-
var _ref, _presetSource$localeK;
|
|
46
|
+
var _context$engine, _ref, _presetSource$localeK;
|
|
46
47
|
const { value: valueProp, layout = "horizontal", textAlign = "center", fields, formatByLocale, timeFormat, dateFormat, weekdayFormat, customFormat, inlineSeparator = " · ", containerStyle, timeStyle, dateStyle, weekdayStyle, refreshInterval, disableAutoRefresh = false, locale, onTimeUpdate, onClick, className, style } = props;
|
|
47
|
-
const
|
|
48
|
+
const context = useEngineContext_default();
|
|
49
|
+
const resolvedLocale = locale || (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || "en";
|
|
50
|
+
console.log("resolvedLocale", resolvedLocale);
|
|
51
|
+
const localeKey = getDayjsLocale(resolvedLocale);
|
|
52
|
+
console.log("localeKey", localeKey);
|
|
48
53
|
const baseLocale = localeKey.split("-")[0];
|
|
49
54
|
const presetSource = formatByLocale !== null && formatByLocale !== void 0 ? formatByLocale : DATETIME_DISPLAY_FORMATS;
|
|
50
55
|
const preset = (_ref = (_presetSource$localeK = presetSource[localeKey]) !== null && _presetSource$localeK !== void 0 ? _presetSource$localeK : presetSource[baseLocale]) !== null && _ref !== void 0 ? _ref : {};
|
|
@@ -55,10 +60,10 @@ const PisellDateTimeDisplay = (props) => {
|
|
|
55
60
|
const currentTime = useCurrentTime({
|
|
56
61
|
refreshInterval: refreshInterval !== null && refreshInterval !== void 0 ? refreshInterval : getRefreshInterval(effectiveTimeFormat),
|
|
57
62
|
disabled: disableAutoRefresh || valueProp !== void 0,
|
|
58
|
-
locale,
|
|
63
|
+
locale: resolvedLocale,
|
|
59
64
|
onUpdate: onTimeUpdate
|
|
60
65
|
});
|
|
61
|
-
const displayTime = valueProp !== void 0 && valueProp !== null ? dayjs(valueProp) : currentTime;
|
|
66
|
+
const displayTime = valueProp !== void 0 && valueProp !== null ? dayjs(valueProp).locale(localeKey) : currentTime;
|
|
62
67
|
if (customFormat) {
|
|
63
68
|
const formattedTime = displayTime.format(customFormat);
|
|
64
69
|
const containerInlineStyle$1 = _objectSpread2({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import usePisellConfig_default from "../../pisell-config-provider/hooks/usePisellConfig.js";
|
|
2
|
+
import useEngineContext_default from "../../../hooks/useEngineContext.js";
|
|
2
3
|
import { getDayjsLocale } from "../utils/localeUtils.js";
|
|
3
4
|
import { useEffect, useState } from "react";
|
|
4
5
|
import dayjs from "dayjs";
|
|
@@ -24,10 +25,13 @@ import dayjs from "dayjs";
|
|
|
24
25
|
* @returns 当前时间(Dayjs 对象)
|
|
25
26
|
*/
|
|
26
27
|
function useCurrentTime(options) {
|
|
28
|
+
var _context$engine;
|
|
27
29
|
const { refreshInterval = 6e4, disabled = false, locale: userLocale, onUpdate } = options || {};
|
|
28
30
|
const globalConfig = usePisellConfig_default();
|
|
31
|
+
const context = useEngineContext_default();
|
|
29
32
|
const globalLocale = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.locale;
|
|
30
|
-
const
|
|
33
|
+
const engineLocale = context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale;
|
|
34
|
+
const dayjsLocale = getDayjsLocale(userLocale || globalLocale || engineLocale || "en");
|
|
31
35
|
const [currentTime, setCurrentTime] = useState(() => {
|
|
32
36
|
return dayjs().locale(dayjsLocale);
|
|
33
37
|
});
|
|
@@ -20,19 +20,25 @@ function normalizeLocale(locale) {
|
|
|
20
20
|
function isChinese(locale) {
|
|
21
21
|
return normalizeLocale(locale).startsWith("zh");
|
|
22
22
|
}
|
|
23
|
+
/** dayjs 常用 locale 与项目已加载的 locale 对齐(zh-cn、en),en-us 等统一用 en */
|
|
24
|
+
function toDayjsLoadedLocale(normalized) {
|
|
25
|
+
if (normalized.startsWith("en")) return "en";
|
|
26
|
+
return normalized;
|
|
27
|
+
}
|
|
23
28
|
/**
|
|
24
29
|
* 获取 dayjs 兼容的 locale 代码
|
|
25
|
-
* 未传 locale
|
|
30
|
+
* 未传 locale 时:优先 materials 当前语言(globalConfig / umi_locale),若为默认 en-US 则用 @pisell/utils getLocale
|
|
26
31
|
* @param locale 原始 locale 代码(可选)
|
|
27
|
-
* @returns dayjs 兼容的 locale
|
|
32
|
+
* @returns dayjs 兼容的 locale 代码(与已加载的 zh-cn、en 对齐)
|
|
28
33
|
* @example 'zh-CN' -> 'zh-cn', 'en-US' -> 'en'
|
|
29
34
|
*/
|
|
30
35
|
function getDayjsLocale(locale) {
|
|
31
36
|
if (!locale) {
|
|
37
|
+
const fromMaterials = getCurrentLocale();
|
|
32
38
|
const fromUtils = typeof locales.getLocale === "function" ? locales.getLocale() : void 0;
|
|
33
|
-
return normalizeLocale(typeof fromUtils === "string" && fromUtils ? fromUtils :
|
|
39
|
+
return toDayjsLoadedLocale(normalizeLocale((fromMaterials && fromMaterials !== "en-US" ? fromMaterials : void 0) || (typeof fromUtils === "string" && fromUtils ? fromUtils : void 0) || fromMaterials));
|
|
34
40
|
}
|
|
35
|
-
return normalizeLocale(locale);
|
|
41
|
+
return toDayjsLoadedLocale(normalizeLocale(locale));
|
|
36
42
|
}
|
|
37
43
|
|
|
38
44
|
//#endregion
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.108.0/helpers/objectSpread2.js";
|
|
2
|
+
import useEngineContext_default from "../../hooks/useEngineContext.js";
|
|
2
3
|
import { getDayjsLocale } from "../pisellDateTimeDisplay/utils/localeUtils.js";
|
|
3
4
|
import { getRelativeDay } from "../pisellDateTimeDisplay/utils/relativeDay.js";
|
|
4
5
|
import { parseTimeRange } from "./utils/parseTimeRange.js";
|
|
@@ -38,9 +39,11 @@ import "./PisellTimeRangeDisplay.less";
|
|
|
38
39
|
* />
|
|
39
40
|
*/
|
|
40
41
|
const PisellTimeRangeDisplay = (props) => {
|
|
41
|
-
var _durationFormat$showS;
|
|
42
|
+
var _context$engine, _durationFormat$showS;
|
|
42
43
|
const { startAt, endAt, textAlign = "center", fields, showDateForSameDay = true, timeFormat, dateFormat, weekdayFormat, durationFormat, containerStyle, timeStyle, dateStyle, weekdayStyle, durationStyle, locale: localeProp, className, style, onClick } = props;
|
|
43
|
-
const
|
|
44
|
+
const context = useEngineContext_default();
|
|
45
|
+
const resolvedLocale = localeProp || (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || "en";
|
|
46
|
+
const effectiveLocale = useMemo(() => getDayjsLocale(resolvedLocale), [resolvedLocale]);
|
|
44
47
|
const { start, end, isSameDay } = useMemo(() => parseTimeRange(startAt, endAt, effectiveLocale), [
|
|
45
48
|
startAt,
|
|
46
49
|
endAt,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CheckboxGroupProps } from "./type.js";
|
|
3
3
|
import { WithModeProps } from "../../dataSourceForm/utils.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react35 from "react";
|
|
5
5
|
|
|
6
6
|
//#region src/components/dataSourceComponents/fields/Checkbox/WithMode.d.ts
|
|
7
7
|
type CheckboxComponent = React.FC & {
|
|
8
8
|
Group: typeof CheckboxGroupWithMode;
|
|
9
9
|
};
|
|
10
10
|
declare const CheckboxWithMode: CheckboxComponent;
|
|
11
|
-
declare const CheckboxGroupWithMode:
|
|
11
|
+
declare const CheckboxGroupWithMode: react35.FC<CheckboxGroupProps & WithModeProps>;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { CheckboxWithMode };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DataSourceContainerContextType } from "../../type.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as antd24 from "antd";
|
|
3
3
|
import React from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/pisellDataSourceContainer/components/Pagination/index.d.ts
|
|
6
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<Partial<
|
|
6
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<Partial<antd24.PaginationProps> & DataSourceContainerContextType & React.RefAttributes<unknown> & {
|
|
7
7
|
refId?: string | undefined;
|
|
8
8
|
}, "ref"> & React.RefAttributes<any>>;
|
|
9
9
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DataSourceContainerContextType } from "../../type.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as antd23 from "antd";
|
|
3
3
|
import React from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/pisellDataSourceContainer/components/Table/index.d.ts
|
|
6
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<Partial<
|
|
6
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<Partial<antd23.TableProps<any>> & DataSourceContainerContextType & {
|
|
7
7
|
scopeId?: string | undefined;
|
|
8
8
|
__id?: string | undefined;
|
|
9
9
|
} & React.RefAttributes<unknown> & {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.js');
|
|
2
2
|
const require_objectSpread2 = require('../../_virtual/_@oxc-project_runtime@0.108.0/helpers/objectSpread2.js');
|
|
3
|
+
const require_useEngineContext = require('../../hooks/useEngineContext.js');
|
|
3
4
|
const require_localeUtils = require('./utils/localeUtils.js');
|
|
4
5
|
const require_useCurrentTime = require('./hooks/useCurrentTime.js');
|
|
5
6
|
const require_relativeDay = require('./utils/relativeDay.js');
|
|
@@ -45,9 +46,13 @@ require("./PisellDateTimeDisplay.less");
|
|
|
45
46
|
* />
|
|
46
47
|
*/
|
|
47
48
|
const PisellDateTimeDisplay = (props) => {
|
|
48
|
-
var _ref, _presetSource$localeK;
|
|
49
|
+
var _context$engine, _ref, _presetSource$localeK;
|
|
49
50
|
const { value: valueProp, layout = "horizontal", textAlign = "center", fields, formatByLocale, timeFormat, dateFormat, weekdayFormat, customFormat, inlineSeparator = " · ", containerStyle, timeStyle, dateStyle, weekdayStyle, refreshInterval, disableAutoRefresh = false, locale, onTimeUpdate, onClick, className, style } = props;
|
|
50
|
-
const
|
|
51
|
+
const context = require_useEngineContext.default();
|
|
52
|
+
const resolvedLocale = locale || (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || "en";
|
|
53
|
+
console.log("resolvedLocale", resolvedLocale);
|
|
54
|
+
const localeKey = require_localeUtils.getDayjsLocale(resolvedLocale);
|
|
55
|
+
console.log("localeKey", localeKey);
|
|
51
56
|
const baseLocale = localeKey.split("-")[0];
|
|
52
57
|
const presetSource = formatByLocale !== null && formatByLocale !== void 0 ? formatByLocale : require_dateTimeDisplayFormats.DATETIME_DISPLAY_FORMATS;
|
|
53
58
|
const preset = (_ref = (_presetSource$localeK = presetSource[localeKey]) !== null && _presetSource$localeK !== void 0 ? _presetSource$localeK : presetSource[baseLocale]) !== null && _ref !== void 0 ? _ref : {};
|
|
@@ -58,10 +63,10 @@ const PisellDateTimeDisplay = (props) => {
|
|
|
58
63
|
const currentTime = require_useCurrentTime.useCurrentTime({
|
|
59
64
|
refreshInterval: refreshInterval !== null && refreshInterval !== void 0 ? refreshInterval : require_getRefreshInterval.getRefreshInterval(effectiveTimeFormat),
|
|
60
65
|
disabled: disableAutoRefresh || valueProp !== void 0,
|
|
61
|
-
locale,
|
|
66
|
+
locale: resolvedLocale,
|
|
62
67
|
onUpdate: onTimeUpdate
|
|
63
68
|
});
|
|
64
|
-
const displayTime = valueProp !== void 0 && valueProp !== null ? (0, dayjs.default)(valueProp) : currentTime;
|
|
69
|
+
const displayTime = valueProp !== void 0 && valueProp !== null ? (0, dayjs.default)(valueProp).locale(localeKey) : currentTime;
|
|
65
70
|
if (customFormat) {
|
|
66
71
|
const formattedTime = displayTime.format(customFormat);
|
|
67
72
|
const containerInlineStyle$1 = require_objectSpread2._objectSpread2({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.js');
|
|
2
2
|
const require_usePisellConfig = require('../../pisell-config-provider/hooks/usePisellConfig.js');
|
|
3
|
+
const require_useEngineContext = require('../../../hooks/useEngineContext.js');
|
|
3
4
|
const require_localeUtils = require('../utils/localeUtils.js');
|
|
4
5
|
let react = require("react");
|
|
5
6
|
let dayjs = require("dayjs");
|
|
@@ -26,10 +27,13 @@ dayjs = require_rolldown_runtime.__toESM(dayjs);
|
|
|
26
27
|
* @returns 当前时间(Dayjs 对象)
|
|
27
28
|
*/
|
|
28
29
|
function useCurrentTime(options) {
|
|
30
|
+
var _context$engine;
|
|
29
31
|
const { refreshInterval = 6e4, disabled = false, locale: userLocale, onUpdate } = options || {};
|
|
30
32
|
const globalConfig = require_usePisellConfig.default();
|
|
33
|
+
const context = require_useEngineContext.default();
|
|
31
34
|
const globalLocale = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.locale;
|
|
32
|
-
const
|
|
35
|
+
const engineLocale = context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale;
|
|
36
|
+
const dayjsLocale = require_localeUtils.getDayjsLocale(userLocale || globalLocale || engineLocale || "en");
|
|
33
37
|
const [currentTime, setCurrentTime] = (0, react.useState)(() => {
|
|
34
38
|
return (0, dayjs.default)().locale(dayjsLocale);
|
|
35
39
|
});
|
|
@@ -21,19 +21,25 @@ function normalizeLocale(locale) {
|
|
|
21
21
|
function isChinese(locale) {
|
|
22
22
|
return normalizeLocale(locale).startsWith("zh");
|
|
23
23
|
}
|
|
24
|
+
/** dayjs 常用 locale 与项目已加载的 locale 对齐(zh-cn、en),en-us 等统一用 en */
|
|
25
|
+
function toDayjsLoadedLocale(normalized) {
|
|
26
|
+
if (normalized.startsWith("en")) return "en";
|
|
27
|
+
return normalized;
|
|
28
|
+
}
|
|
24
29
|
/**
|
|
25
30
|
* 获取 dayjs 兼容的 locale 代码
|
|
26
|
-
* 未传 locale
|
|
31
|
+
* 未传 locale 时:优先 materials 当前语言(globalConfig / umi_locale),若为默认 en-US 则用 @pisell/utils getLocale
|
|
27
32
|
* @param locale 原始 locale 代码(可选)
|
|
28
|
-
* @returns dayjs 兼容的 locale
|
|
33
|
+
* @returns dayjs 兼容的 locale 代码(与已加载的 zh-cn、en 对齐)
|
|
29
34
|
* @example 'zh-CN' -> 'zh-cn', 'en-US' -> 'en'
|
|
30
35
|
*/
|
|
31
36
|
function getDayjsLocale(locale) {
|
|
32
37
|
if (!locale) {
|
|
38
|
+
const fromMaterials = require_locale.getCurrentLocale();
|
|
33
39
|
const fromUtils = typeof _pisell_utils.locales.getLocale === "function" ? _pisell_utils.locales.getLocale() : void 0;
|
|
34
|
-
return normalizeLocale(typeof fromUtils === "string" && fromUtils ? fromUtils :
|
|
40
|
+
return toDayjsLoadedLocale(normalizeLocale((fromMaterials && fromMaterials !== "en-US" ? fromMaterials : void 0) || (typeof fromUtils === "string" && fromUtils ? fromUtils : void 0) || fromMaterials));
|
|
35
41
|
}
|
|
36
|
-
return normalizeLocale(locale);
|
|
42
|
+
return toDayjsLoadedLocale(normalizeLocale(locale));
|
|
37
43
|
}
|
|
38
44
|
|
|
39
45
|
//#endregion
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.js');
|
|
2
2
|
const require_objectSpread2 = require('../../_virtual/_@oxc-project_runtime@0.108.0/helpers/objectSpread2.js');
|
|
3
|
+
const require_useEngineContext = require('../../hooks/useEngineContext.js');
|
|
3
4
|
const require_localeUtils = require('../pisellDateTimeDisplay/utils/localeUtils.js');
|
|
4
5
|
const require_relativeDay = require('../pisellDateTimeDisplay/utils/relativeDay.js');
|
|
5
6
|
const require_parseTimeRange = require('./utils/parseTimeRange.js');
|
|
@@ -41,9 +42,11 @@ require("./PisellTimeRangeDisplay.less");
|
|
|
41
42
|
* />
|
|
42
43
|
*/
|
|
43
44
|
const PisellTimeRangeDisplay = (props) => {
|
|
44
|
-
var _durationFormat$showS;
|
|
45
|
+
var _context$engine, _durationFormat$showS;
|
|
45
46
|
const { startAt, endAt, textAlign = "center", fields, showDateForSameDay = true, timeFormat, dateFormat, weekdayFormat, durationFormat, containerStyle, timeStyle, dateStyle, weekdayStyle, durationStyle, locale: localeProp, className, style, onClick } = props;
|
|
46
|
-
const
|
|
47
|
+
const context = require_useEngineContext.default();
|
|
48
|
+
const resolvedLocale = localeProp || (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || "en";
|
|
49
|
+
const effectiveLocale = (0, react.useMemo)(() => require_localeUtils.getDayjsLocale(resolvedLocale), [resolvedLocale]);
|
|
47
50
|
const { start, end, isSameDay } = (0, react.useMemo)(() => require_parseTimeRange.parseTimeRange(startAt, endAt, effectiveLocale), [
|
|
48
51
|
startAt,
|
|
49
52
|
endAt,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react19 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/section-footers/index.d.ts
|
|
5
5
|
interface SectionFooterProps {
|
|
@@ -8,6 +8,6 @@ interface SectionFooterProps {
|
|
|
8
8
|
right?: React.ReactNode;
|
|
9
9
|
className?: string;
|
|
10
10
|
}
|
|
11
|
-
declare const SectionFooters: (props: SectionFooterProps) =>
|
|
11
|
+
declare const SectionFooters: (props: SectionFooterProps) => react19.JSX.Element;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { SectionFooters };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react20 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/skeleton/index.d.ts
|
|
5
|
-
declare const Skeleton: (props: any) =>
|
|
5
|
+
declare const Skeleton: (props: any) => react20.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Skeleton };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react21 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/time-picker/index.d.ts
|
|
5
|
-
declare const TimePicker: (props: any) =>
|
|
5
|
+
declare const TimePicker: (props: any) => react21.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { TimePicker };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react17 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/upload/index.d.ts
|
|
5
|
-
declare const Upload: (props: any) =>
|
|
5
|
+
declare const Upload: (props: any) => react17.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Upload };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1047",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -89,9 +89,9 @@
|
|
|
89
89
|
"swiper": "^8.4.7",
|
|
90
90
|
"antd-mobile": "^5.38.1",
|
|
91
91
|
"vod-js-sdk-v6": "^1.4.11",
|
|
92
|
+
"@pisell/icon": "0.0.10",
|
|
92
93
|
"@pisell/date-picker": "1.0.134",
|
|
93
|
-
"@pisell/utils": "1.0.61"
|
|
94
|
-
"@pisell/icon": "0.0.10"
|
|
94
|
+
"@pisell/utils": "1.0.61"
|
|
95
95
|
},
|
|
96
96
|
"peerDependencies": {
|
|
97
97
|
"react": "^18.0.0",
|