@pinnacle0/web-ui 0.3.80 → 0.3.82
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/README.md +0 -6
- package/core/AntDatePicker.d.ts +49 -0
- package/core/AntDatePicker.js +5 -0
- package/core/AntDatePicker.js.map +1 -0
- package/core/DateCalendar.d.ts +5 -6
- package/core/DateCalendar.js +10 -5
- package/core/DateCalendar.js.map +1 -1
- package/core/DatePicker/index.d.ts +3 -5
- package/core/DatePicker/index.js +3 -4
- package/core/DatePicker/index.js.map +1 -1
- package/core/DateRangePicker/index.d.ts +3 -5
- package/core/DateRangePicker/index.js +4 -7
- package/core/DateRangePicker/index.js.map +1 -1
- package/core/DateTimePicker/index.d.ts +3 -4
- package/core/DateTimePicker/index.js +4 -7
- package/core/DateTimePicker/index.js.map +1 -1
- package/core/DateTimeRangePicker/index.d.ts +4 -5
- package/core/DateTimeRangePicker/index.js +4 -7
- package/core/DateTimeRangePicker/index.js.map +1 -1
- package/core/RelativeTime.js +10 -5
- package/core/RelativeTime.js.map +1 -1
- package/core/TimePicker/index.d.ts +2 -3
- package/core/TimePicker/index.js +3 -4
- package/core/TimePicker/index.js.map +1 -1
- package/core/TimeRangePicker/index.d.ts +2 -2
- package/core/TimeRangePicker/index.js +3 -3
- package/core/TimeRangePicker/index.js.map +1 -1
- package/core/YearMonthSelector.d.ts +3 -4
- package/core/YearMonthSelector.js +7 -4
- package/core/YearMonthSelector.js.map +1 -1
- package/package.json +8 -8
- package/util/LocaleUtil.js +3 -1
- package/util/LocaleUtil.js.map +1 -1
package/README.md
CHANGED
|
@@ -15,9 +15,3 @@ If you want to use existing library color, `import "@pinnacle0/web-ui/css/variba
|
|
|
15
15
|
|
|
16
16
|
- Do not import anything from `@pinnacle0/web-ui/internal/*`.
|
|
17
17
|
|
|
18
|
-
## Moment Local Tree-shaking Issue
|
|
19
|
-
|
|
20
|
-
To support this, please do both of following:
|
|
21
|
-
|
|
22
|
-
- Add `new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),` to your webpack plugins.
|
|
23
|
-
This line is to skip all locale imports by moment library itself.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Dayjs } from "dayjs";
|
|
2
|
+
import "antd/lib/date-picker/style";
|
|
3
|
+
export declare const AntDatePicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<import("antd/es/date-picker/generatePicker").PickerProps<Dayjs> & {
|
|
4
|
+
status?: "" | "error" | "warning" | undefined;
|
|
5
|
+
dropdownClassName?: string | undefined;
|
|
6
|
+
popupClassName?: string | undefined;
|
|
7
|
+
}, unknown> & {
|
|
8
|
+
WeekPicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<Omit<import("antd/es/date-picker/generatePicker").PickerProps<Dayjs> & {
|
|
9
|
+
status?: "" | "error" | "warning" | undefined;
|
|
10
|
+
dropdownClassName?: string | undefined;
|
|
11
|
+
popupClassName?: string | undefined;
|
|
12
|
+
}, "picker">, unknown>;
|
|
13
|
+
MonthPicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<Omit<import("antd/es/date-picker/generatePicker").PickerProps<Dayjs> & {
|
|
14
|
+
status?: "" | "error" | "warning" | undefined;
|
|
15
|
+
dropdownClassName?: string | undefined;
|
|
16
|
+
popupClassName?: string | undefined;
|
|
17
|
+
}, "picker">, unknown>;
|
|
18
|
+
YearPicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<Omit<import("antd/es/date-picker/generatePicker").PickerProps<Dayjs> & {
|
|
19
|
+
status?: "" | "error" | "warning" | undefined;
|
|
20
|
+
dropdownClassName?: string | undefined;
|
|
21
|
+
popupClassName?: string | undefined;
|
|
22
|
+
}, "picker">, unknown>;
|
|
23
|
+
RangePicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<import("antd/es/date-picker/generatePicker").RangePickerProps<Dayjs> & {
|
|
24
|
+
dropdownClassName?: string | undefined;
|
|
25
|
+
popupClassName?: string | undefined;
|
|
26
|
+
}, unknown>;
|
|
27
|
+
TimePicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<Omit<Omit<import("rc-picker/lib/Picker").PickerTimeProps<Dayjs>, "locale" | "generateConfig" | "hideHeader" | "components"> & {
|
|
28
|
+
locale?: import("antd/es/date-picker/generatePicker").PickerLocale | undefined;
|
|
29
|
+
size?: import("antd/es/button").ButtonSize;
|
|
30
|
+
placement?: "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | undefined;
|
|
31
|
+
bordered?: boolean | undefined;
|
|
32
|
+
status?: "" | "error" | "warning" | undefined;
|
|
33
|
+
} & {
|
|
34
|
+
status?: "" | "error" | "warning" | undefined;
|
|
35
|
+
dropdownClassName?: string | undefined;
|
|
36
|
+
popupClassName?: string | undefined;
|
|
37
|
+
}, "picker">, unknown>;
|
|
38
|
+
QuarterPicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<Omit<Omit<import("rc-picker/lib/Picker").PickerTimeProps<Dayjs>, "locale" | "generateConfig" | "hideHeader" | "components"> & {
|
|
39
|
+
locale?: import("antd/es/date-picker/generatePicker").PickerLocale | undefined;
|
|
40
|
+
size?: import("antd/es/button").ButtonSize;
|
|
41
|
+
placement?: "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | undefined;
|
|
42
|
+
bordered?: boolean | undefined;
|
|
43
|
+
status?: "" | "error" | "warning" | undefined;
|
|
44
|
+
} & {
|
|
45
|
+
status?: "" | "error" | "warning" | undefined;
|
|
46
|
+
dropdownClassName?: string | undefined;
|
|
47
|
+
popupClassName?: string | undefined;
|
|
48
|
+
}, "picker">, unknown>;
|
|
49
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import dayjsGenerateConfig from "rc-picker/lib/generate/dayjs";
|
|
2
|
+
import generatePicker from "antd/es/date-picker/generatePicker";
|
|
3
|
+
import "antd/lib/date-picker/style";
|
|
4
|
+
export var AntDatePicker = generatePicker(dayjsGenerateConfig);
|
|
5
|
+
//# sourceMappingURL=AntDatePicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AntDatePicker.js","sourceRoot":"","sources":["../../src/core/AntDatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,8BAA8B,CAAC;AAC/D,OAAO,cAAc,MAAM,oCAAoC,CAAC;AAEhE,OAAO,4BAA4B,CAAC;AAEpC,MAAM,CAAC,IAAM,aAAa,GAAG,cAAc,CAAQ,mBAAmB,CAAC,CAAC"}
|
package/core/DateCalendar.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { HeaderRender } from "antd/lib/calendar/generateCalendar";
|
|
3
|
-
import type { Moment } from "moment";
|
|
4
|
-
import moment from "moment";
|
|
5
2
|
import type { ControlledFormValue } from "../internal/type";
|
|
3
|
+
import type { HeaderRender } from "antd/lib/calendar/generateCalendar";
|
|
4
|
+
import type { Dayjs } from "dayjs";
|
|
6
5
|
import "antd/lib/calendar/style";
|
|
7
6
|
interface Props extends ControlledFormValue<string> {
|
|
8
7
|
}
|
|
@@ -10,9 +9,9 @@ export declare class DateCalendar extends React.PureComponent<Props> {
|
|
|
10
9
|
static displayName: string;
|
|
11
10
|
private readonly headerStyle;
|
|
12
11
|
private readonly now;
|
|
13
|
-
isDateDisabled: (current:
|
|
14
|
-
onChange: (date:
|
|
15
|
-
renderHeader: HeaderRender<
|
|
12
|
+
isDateDisabled: (current: Dayjs) => boolean;
|
|
13
|
+
onChange: (date: Dayjs) => void;
|
|
14
|
+
renderHeader: HeaderRender<Dayjs>;
|
|
16
15
|
render(): JSX.Element;
|
|
17
16
|
}
|
|
18
17
|
export {};
|
package/core/DateCalendar.js
CHANGED
|
@@ -14,17 +14,22 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
};
|
|
15
15
|
})();
|
|
16
16
|
import React from "react";
|
|
17
|
-
import
|
|
18
|
-
import
|
|
17
|
+
import dayjs from "dayjs";
|
|
18
|
+
import generateCalendar from "antd/es/calendar/generateCalendar";
|
|
19
|
+
import dayjsGenerateConfig from "rc-picker/lib/generate/dayjs";
|
|
20
|
+
import localeData from "dayjs/plugin/localeData";
|
|
19
21
|
import { Select } from "./Select";
|
|
20
22
|
import { Space } from "./Space";
|
|
21
23
|
import "antd/lib/calendar/style";
|
|
24
|
+
// load plugin when component is imported
|
|
25
|
+
dayjs.extend(localeData);
|
|
26
|
+
var AntCalendar = generateCalendar(dayjsGenerateConfig);
|
|
22
27
|
var DateCalendar = /** @class */ (function (_super) {
|
|
23
28
|
__extends(DateCalendar, _super);
|
|
24
29
|
function DateCalendar() {
|
|
25
30
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
26
31
|
_this.headerStyle = { padding: 8 };
|
|
27
|
-
_this.now =
|
|
32
|
+
_this.now = dayjs();
|
|
28
33
|
_this.isDateDisabled = function (current) {
|
|
29
34
|
if (!current) {
|
|
30
35
|
return false;
|
|
@@ -39,7 +44,7 @@ var DateCalendar = /** @class */ (function (_super) {
|
|
|
39
44
|
}
|
|
40
45
|
return false;
|
|
41
46
|
};
|
|
42
|
-
_this.onChange = function (date) { return _this.props.onChange(
|
|
47
|
+
_this.onChange = function (date) { return _this.props.onChange(dayjs(date).format("YYYY-MM-DD")); };
|
|
43
48
|
_this.renderHeader = function (_a) {
|
|
44
49
|
var value = _a.value, onChange = _a.onChange;
|
|
45
50
|
var start = 0;
|
|
@@ -79,7 +84,7 @@ var DateCalendar = /** @class */ (function (_super) {
|
|
|
79
84
|
return _this;
|
|
80
85
|
}
|
|
81
86
|
DateCalendar.prototype.render = function () {
|
|
82
|
-
return React.createElement(AntCalendar, { disabledDate: this.isDateDisabled, headerRender: this.renderHeader, value:
|
|
87
|
+
return React.createElement(AntCalendar, { disabledDate: this.isDateDisabled, headerRender: this.renderHeader, value: dayjs(this.props.value, "YYYY-MM-DD"), fullscreen: false, onChange: this.onChange });
|
|
83
88
|
};
|
|
84
89
|
DateCalendar.displayName = "DateCalendar";
|
|
85
90
|
return DateCalendar;
|
package/core/DateCalendar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateCalendar.js","sourceRoot":"","sources":["../../src/core/DateCalendar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"DateCalendar.js","sourceRoot":"","sources":["../../src/core/DateCalendar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,gBAAgB,MAAM,mCAAmC,CAAC;AACjE,OAAO,mBAAmB,MAAM,8BAA8B,CAAC;AAC/D,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAI9B,OAAO,yBAAyB,CAAC;AAEjC,yCAAyC;AACzC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AAEzB,IAAM,WAAW,GAAG,gBAAgB,CAAQ,mBAAmB,CAAC,CAAC;AAIjE;IAAkC,gCAA0B;IAA5D;QAAA,qEAiGC;QA9FoB,iBAAW,GAAwB,EAAC,OAAO,EAAE,CAAC,EAAC,CAAC;QAEhD,SAAG,GAAG,KAAK,EAAE,CAAC;QAE/B,oBAAc,GAAG,UAAC,OAAc;YAC5B,IAAI,CAAC,OAAO,EAAE;gBACV,OAAO,KAAK,CAAC;aAChB;YAED;;;;eAIG;YACH,IAAI,OAAO,CAAC,OAAO,EAAE,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE;gBAClD,OAAO,IAAI,CAAC;aACf;YACD,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC;QAEF,cAAQ,GAAG,UA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CAAkC,KAAK,CAAC,aAAa,GAiGpD;SAjGY,YAAY"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type { Moment } from "moment";
|
|
2
|
-
import moment from "moment";
|
|
3
1
|
import React from "react";
|
|
2
|
+
import type { Dayjs } from "dayjs";
|
|
4
3
|
import type { ControlledFormValue } from "../../internal/type";
|
|
5
|
-
import "antd/lib/date-picker/style";
|
|
6
4
|
import "./index.less";
|
|
7
5
|
export interface Props<T extends boolean> extends ControlledFormValue<T extends false ? string : string | null> {
|
|
8
6
|
allowNull: T;
|
|
@@ -12,7 +10,7 @@ export interface Props<T extends boolean> extends ControlledFormValue<T extends
|
|
|
12
10
|
}
|
|
13
11
|
export declare class DatePicker<T extends boolean> extends React.PureComponent<Props<T>> {
|
|
14
12
|
static displayName: string;
|
|
15
|
-
isDateDisabled: (current:
|
|
16
|
-
onChange: (date:
|
|
13
|
+
isDateDisabled: (current: Dayjs) => boolean;
|
|
14
|
+
onChange: (date: Dayjs | null, dateString: string) => void;
|
|
17
15
|
render(): JSX.Element;
|
|
18
16
|
}
|
package/core/DatePicker/index.js
CHANGED
|
@@ -13,10 +13,9 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
13
13
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
14
|
};
|
|
15
15
|
})();
|
|
16
|
-
import AntDatePicker from "antd/lib/date-picker";
|
|
17
|
-
import moment from "moment";
|
|
18
16
|
import React from "react";
|
|
19
|
-
import "
|
|
17
|
+
import { AntDatePicker } from "../AntDatePicker";
|
|
18
|
+
import dayjs from "dayjs";
|
|
20
19
|
import "./index.less";
|
|
21
20
|
var DatePicker = /** @class */ (function (_super) {
|
|
22
21
|
__extends(DatePicker, _super);
|
|
@@ -47,7 +46,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
47
46
|
}
|
|
48
47
|
DatePicker.prototype.render = function () {
|
|
49
48
|
var _a = this.props, value = _a.value, allowNull = _a.allowNull, placeholder = _a.placeholder, disabled = _a.disabled, className = _a.className;
|
|
50
|
-
return (React.createElement(AntDatePicker, { className: className, showTime: false, disabledDate: this.isDateDisabled, placeholder: placeholder, value: value ?
|
|
49
|
+
return (React.createElement(AntDatePicker, { className: className, showTime: false, disabledDate: this.isDateDisabled, placeholder: placeholder, value: value ? dayjs(value) : null, onChange: this.onChange, allowClear: allowNull, disabled: disabled }));
|
|
51
50
|
};
|
|
52
51
|
DatePicker.displayName = "DatePicker";
|
|
53
52
|
return DatePicker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/DatePicker/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/DatePicker/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,cAAc,CAAC;AAStB;IAAmD,8BAA6B;IAAhF;QAAA,qEA0CC;QAvCG,oBAAc,GAAG,UAAC,OAAc;YAC5B,IAAI,CAAC,OAAO,EAAE;gBACV,OAAO,KAAK,CAAC;aAChB;YAED;;;;eAIG;YACH,IAAI,OAAO,CAAC,OAAO,EAAE,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE;gBAClD,OAAO,IAAI,CAAC;aACf;YACD,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC;QAEF,cAAQ,GAAG,UAAC,IAAkB,EAAE,UAAkB;YACxC,IAAA,KAAwB,KAAI,CAAC,KAAK,EAAjC,QAAQ,cAAA,EAAE,SAAS,eAAc,CAAC;YACzC,IAAI,UAAU,IAAI,SAAS,EAAE;gBACzB,IAAM,aAAa,GAAG,QAA0C,CAAC;gBACjE,aAAa,CAAC,UAAU,CAAC,CAAC;aAC7B;QACL,CAAC,CAAC;;IAiBN,CAAC;IAfG,2BAAM,GAAN;QACU,IAAA,KAAuD,IAAI,CAAC,KAAK,EAAhE,KAAK,WAAA,EAAE,SAAS,eAAA,EAAE,WAAW,iBAAA,EAAE,QAAQ,cAAA,EAAE,SAAS,eAAc,CAAC;QACxE,OAAO,CACH,oBAAC,aAAa,IACV,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,KAAK,EACf,YAAY,EAAE,IAAI,CAAC,cAAc,EACjC,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAClC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,UAAU,EAAE,SAAS,EACrB,QAAQ,EAAE,QAAQ,GACpB,CACL,CAAC;IACN,CAAC;IAxCM,sBAAW,GAAG,YAAY,CAAC;IAyCtC,iBAAC;CAAA,AA1CD,CAAmD,KAAK,CAAC,aAAa,GA0CrE;SA1CY,UAAU"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
2
|
+
import type { Dayjs } from "dayjs";
|
|
3
3
|
import type { ControlledFormValue } from "../../internal/type";
|
|
4
|
-
import "antd/lib/date-picker/style";
|
|
5
|
-
import "./index.less";
|
|
6
4
|
export interface Props<T extends boolean> extends ControlledFormValue<T extends false ? [string, string] : [string | null, string | null]> {
|
|
7
5
|
allowNull: T;
|
|
8
6
|
disabledRange?: (diffToToday: number, date: Date) => boolean;
|
|
@@ -12,7 +10,7 @@ export interface Props<T extends boolean> extends ControlledFormValue<T extends
|
|
|
12
10
|
export declare class DateRangePicker<T extends boolean> extends React.PureComponent<Props<T>> {
|
|
13
11
|
static displayName: string;
|
|
14
12
|
private readonly dateFormatter;
|
|
15
|
-
isDateDisabled: (current:
|
|
16
|
-
onChange: (dates: [
|
|
13
|
+
isDateDisabled: (current: Dayjs) => boolean;
|
|
14
|
+
onChange: (dates: [Dayjs | null, Dayjs | null] | null) => void;
|
|
17
15
|
render(): JSX.Element;
|
|
18
16
|
}
|
|
@@ -14,10 +14,8 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
};
|
|
15
15
|
})();
|
|
16
16
|
import React from "react";
|
|
17
|
-
import
|
|
18
|
-
import AntDatePicker from "
|
|
19
|
-
import "antd/lib/date-picker/style";
|
|
20
|
-
import "./index.less";
|
|
17
|
+
import dayjs from "dayjs";
|
|
18
|
+
import { AntDatePicker } from "../AntDatePicker";
|
|
21
19
|
var DateRangePicker = /** @class */ (function (_super) {
|
|
22
20
|
__extends(DateRangePicker, _super);
|
|
23
21
|
function DateRangePicker() {
|
|
@@ -36,8 +34,7 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
36
34
|
if (current.valueOf() >= new Date(2038, 0).valueOf()) {
|
|
37
35
|
return true;
|
|
38
36
|
}
|
|
39
|
-
|
|
40
|
-
var diffToToday = Math.floor(current.diff(moment().startOf("day"), "day", true));
|
|
37
|
+
var diffToToday = Math.floor(current.diff(dayjs().startOf("day"), "day", true));
|
|
41
38
|
return ((_b = (_a = _this.props).disabledRange) === null || _b === void 0 ? void 0 : _b.call(_a, diffToToday, current.toDate())) || false;
|
|
42
39
|
};
|
|
43
40
|
_this.onChange = function (dates) {
|
|
@@ -53,7 +50,7 @@ var DateRangePicker = /** @class */ (function (_super) {
|
|
|
53
50
|
}
|
|
54
51
|
DateRangePicker.prototype.render = function () {
|
|
55
52
|
var _a = this.props, value = _a.value, allowNull = _a.allowNull, disabled = _a.disabled, className = _a.className;
|
|
56
|
-
return (React.createElement(AntDatePicker.RangePicker, { disabledDate: this.isDateDisabled, className: className, showTime: false, value: value[0] && value[1] ? [
|
|
53
|
+
return (React.createElement(AntDatePicker.RangePicker, { disabledDate: this.isDateDisabled, className: className, showTime: false, value: value[0] && value[1] ? [dayjs(value[0]), dayjs(value[1])] : [null, null], onChange: this.onChange, allowClear: allowNull, disabled: disabled }));
|
|
57
54
|
};
|
|
58
55
|
DateRangePicker.displayName = "DateRangePicker";
|
|
59
56
|
return DateRangePicker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/DateRangePicker/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/DateRangePicker/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAU/C;IAAwD,mCAA6B;IAArF;QAAA,qEA8CC;QA3CoB,mBAAa,GAAG,YAAY,CAAC;QAE9C,oBAAc,GAAG,UAAC,OAAc;;YAC5B,IAAI,CAAC,OAAO,EAAE;gBACV,OAAO,KAAK,CAAC;aAChB;YAED;;;;eAIG;YACH,IAAI,OAAO,CAAC,OAAO,EAAE,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE;gBAClD,OAAO,IAAI,CAAC;aACf;YAED,IAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;YAClF,OAAO,CAAA,MAAA,MAAA,KAAI,CAAC,KAAK,EAAC,aAAa,mDAAG,WAAW,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,KAAI,KAAK,CAAC;QAC9E,CAAC,CAAC;QAEF,cAAQ,GAAG,UAAC,KAA0C;YAClD,IAAM,aAAa,GAAG,KAAI,CAAC,KAAK,CAAC,QAA2D,CA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lledFormValue } from "../../internal/type";
|
|
4
|
-
import "antd/lib/date-picker/style";
|
|
5
4
|
import "./index.less";
|
|
6
5
|
export interface Props<T extends boolean> extends ControlledFormValue<T extends false ? Date : Date | null> {
|
|
7
6
|
allowNull: T;
|
|
@@ -13,7 +12,7 @@ export interface Props<T extends boolean> extends ControlledFormValue<T extends
|
|
|
13
12
|
}
|
|
14
13
|
export declare class DateTimePicker<T extends boolean> extends React.PureComponent<Props<T>> {
|
|
15
14
|
static displayName: string;
|
|
16
|
-
isDateDisabled: (current:
|
|
17
|
-
onChange: (date:
|
|
15
|
+
isDateDisabled: (current: Dayjs) => boolean;
|
|
16
|
+
onChange: (date: Dayjs | null) => void;
|
|
18
17
|
render(): JSX.Element;
|
|
19
18
|
}
|
|
@@ -13,10 +13,9 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
13
13
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
14
|
};
|
|
15
15
|
})();
|
|
16
|
-
import AntDatePicker from "
|
|
17
|
-
import
|
|
16
|
+
import { AntDatePicker } from "../AntDatePicker";
|
|
17
|
+
import dayjs from "dayjs";
|
|
18
18
|
import React from "react";
|
|
19
|
-
import "antd/lib/date-picker/style";
|
|
20
19
|
import "./index.less";
|
|
21
20
|
var DateTimePicker = /** @class */ (function (_super) {
|
|
22
21
|
__extends(DateTimePicker, _super);
|
|
@@ -35,9 +34,7 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
35
34
|
if (current.valueOf() >= new Date(2038, 0).valueOf()) {
|
|
36
35
|
return true;
|
|
37
36
|
}
|
|
38
|
-
|
|
39
|
-
// ref: https://momentjs.com/docs/#/displaying/difference/
|
|
40
|
-
var diffHourToToday = Math.floor(current.diff(moment().startOf("hour"), "hour", true));
|
|
37
|
+
var diffHourToToday = Math.floor(current.diff(dayjs().startOf("hour"), "hour", true));
|
|
41
38
|
return ((_b = (_a = _this.props).disabledRange) === null || _b === void 0 ? void 0 : _b.call(_a, diffHourToToday, current.toDate())) || false;
|
|
42
39
|
};
|
|
43
40
|
_this.onChange = function (date) {
|
|
@@ -53,7 +50,7 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
|
53
50
|
}
|
|
54
51
|
DateTimePicker.prototype.render = function () {
|
|
55
52
|
var _a = this.props, value = _a.value, allowNull = _a.allowNull, disabled = _a.disabled, showNow = _a.showNow, className = _a.className, placeholder = _a.placeholder;
|
|
56
|
-
return (React.createElement(AntDatePicker, { className: className, placeholder: placeholder, disabledDate: this.isDateDisabled, value: value ?
|
|
53
|
+
return (React.createElement(AntDatePicker, { className: className, placeholder: placeholder, disabledDate: this.isDateDisabled, value: value ? dayjs(value) : null, onChange: this.onChange, allowClear: allowNull, disabled: disabled, showTime: true, showNow: showNow }));
|
|
57
54
|
};
|
|
58
55
|
DateTimePicker.displayName = "DateTimePicker";
|
|
59
56
|
return DateTimePicker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/DateTimePicker/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,aAAa,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/DateTimePicker/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,cAAc,CAAC;AAWtB;IAAuD,kCAA6B;IAApF;QAAA,qEA8CC;QA3CG,oBAAc,GAAG,UAAC,OAAc;;YAC5B,IAAI,CAAC,OAAO,EAAE;gBACV,OAAO,KAAK,CAAC;aAChB;YAED;;;;eAIG;YACH,IAAI,OAAO,CAAC,OAAO,EAAE,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE;gBAClD,OAAO,IAAI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+1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import moment from "moment";
|
|
3
2
|
import type { ControlledFormValue } from "../../internal/type";
|
|
4
|
-
import "
|
|
3
|
+
import type { Dayjs } from "dayjs";
|
|
5
4
|
import "./index.less";
|
|
6
5
|
export interface Props<T extends boolean> extends ControlledFormValue<T extends false ? [Date, Date] : [Date | null, Date | null]> {
|
|
7
6
|
allowNull: T;
|
|
@@ -9,12 +8,12 @@ export interface Props<T extends boolean> extends ControlledFormValue<T extends
|
|
|
9
8
|
className?: string;
|
|
10
9
|
disabledRange?: (diffToToday: number, date: Date) => boolean;
|
|
11
10
|
ranges?: {
|
|
12
|
-
[range: string]: [
|
|
11
|
+
[range: string]: [Dayjs, Dayjs];
|
|
13
12
|
};
|
|
14
13
|
}
|
|
15
14
|
export declare class DateTimeRangePicker<T extends boolean> extends React.PureComponent<Props<T>> {
|
|
16
15
|
static displayName: string;
|
|
17
|
-
isDateDisabled: (current:
|
|
18
|
-
onChange: (dates: [
|
|
16
|
+
isDateDisabled: (current: Dayjs) => boolean;
|
|
17
|
+
onChange: (dates: [Dayjs | null, Dayjs | null] | null) => void;
|
|
19
18
|
render(): JSX.Element;
|
|
20
19
|
}
|
|
@@ -14,9 +14,8 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
};
|
|
15
15
|
})();
|
|
16
16
|
import React from "react";
|
|
17
|
-
import
|
|
18
|
-
import AntDatePicker from "
|
|
19
|
-
import "antd/lib/date-picker/style";
|
|
17
|
+
import dayjs from "dayjs";
|
|
18
|
+
import { AntDatePicker } from "../AntDatePicker";
|
|
20
19
|
import "./index.less";
|
|
21
20
|
var DateTimeRangePicker = /** @class */ (function (_super) {
|
|
22
21
|
__extends(DateTimeRangePicker, _super);
|
|
@@ -35,9 +34,7 @@ var DateTimeRangePicker = /** @class */ (function (_super) {
|
|
|
35
34
|
if (current.valueOf() >= new Date(2038, 0).valueOf()) {
|
|
36
35
|
return true;
|
|
37
36
|
}
|
|
38
|
-
|
|
39
|
-
// ref: https://momentjs.com/docs/#/displaying/difference/
|
|
40
|
-
var diffToToday = Math.floor(current.diff(moment().startOf("day"), "day", true));
|
|
37
|
+
var diffToToday = Math.floor(current.diff(dayjs().startOf("day"), "day", true));
|
|
41
38
|
return ((_b = (_a = _this.props).disabledRange) === null || _b === void 0 ? void 0 : _b.call(_a, diffToToday, current.toDate())) || false;
|
|
42
39
|
};
|
|
43
40
|
_this.onChange = function (dates) {
|
|
@@ -53,7 +50,7 @@ var DateTimeRangePicker = /** @class */ (function (_super) {
|
|
|
53
50
|
}
|
|
54
51
|
DateTimeRangePicker.prototype.render = function () {
|
|
55
52
|
var _a = this.props, value = _a.value, allowNull = _a.allowNull, disabled = _a.disabled, className = _a.className, ranges = _a.ranges;
|
|
56
|
-
return (React.createElement(AntDatePicker.RangePicker, { className: className, value: value[0] && value[1] ? [
|
|
53
|
+
return (React.createElement(AntDatePicker.RangePicker, { className: className, value: value[0] && value[1] ? [dayjs(value[0]), dayjs(value[1])] : [null, null], onChange: this.onChange, disabledDate: this.isDateDisabled, allowClear: allowNull, disabled: disabled, ranges: ranges, showTime: true }));
|
|
57
54
|
};
|
|
58
55
|
DateTimeRangePicker.displayName = "DateTimeRangePicker";
|
|
59
56
|
return DateTimeRangePicker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/DateTimeRangePicker/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/DateTimeRangePicker/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAG/C,OAAO,cAAc,CAAC;AAW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S,EACpB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAC/E,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,YAAY,EAAE,IAAI,CAAC,cAAc,EACjC,UAAU,EAAE,SAAS,EACrB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,SACV,CACL,CAAC;IACN,CAAC;IA3CM,+BAAW,GAAG,qBAAqB,CAAC;IA4C/C,0BAAC;CAAA,AA7CD,CAA4D,KAAK,CAAC,aAAa,GA6C9E;SA7CY,mBAAmB"}
|
package/core/RelativeTime.js
CHANGED
|
@@ -14,18 +14,23 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
};
|
|
15
15
|
})();
|
|
16
16
|
import React from "react";
|
|
17
|
-
import
|
|
17
|
+
import dayjs from "dayjs";
|
|
18
|
+
import relativeTime from "dayjs/plugin/relativeTime";
|
|
19
|
+
// load plugin when component is imported
|
|
20
|
+
dayjs.extend(relativeTime);
|
|
18
21
|
var RelativeTime = /** @class */ (function (_super) {
|
|
19
22
|
__extends(RelativeTime, _super);
|
|
20
23
|
function RelativeTime(props) {
|
|
21
24
|
var _this = _super.call(this, props) || this;
|
|
22
25
|
_this.repaint = function () {
|
|
23
26
|
clearTimeout(_this.repaintTimeout);
|
|
24
|
-
var elapsedText =
|
|
27
|
+
var elapsedText = dayjs(_this.props.date).fromNow();
|
|
25
28
|
_this.setState({ elapsedText: elapsedText });
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
/**
|
|
30
|
+
* dayjs relative time plugin uses 45 minutes for "an hour ago" threshold and 45 seconds for "a minute ago" threshold.
|
|
31
|
+
* Repaint after 15 minutes / seconds interval should be good enough for now.
|
|
32
|
+
* See: https://day.js.org/docs/en/customization/relative-time
|
|
33
|
+
*/
|
|
29
34
|
var isAnHourAgo = Date.now() - _this.props.date.getTime() > 3600 * 1000;
|
|
30
35
|
var timeoutDuration = isAnHourAgo ? 15 * 1000 * 60 : 15 * 1000;
|
|
31
36
|
_this.repaintTimeout = window.setTimeout(_this.repaint, timeoutDuration);
|
package/core/RelativeTime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelativeTime.js","sourceRoot":"","sources":["../../src/core/RelativeTime.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"RelativeTime.js","sourceRoot":"","sources":["../../src/core/RelativeTime.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,2BAA2B,CAAC;AAErD,yCAAyC;AACzC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAU3B;IAAkC,gCAAiC;IAK/D,sBAAY,KAAY;QAAxB,YACI,kBAAM,KAAK,CAAC,SAIf;QAgBD,aAAO,GAAG;YACN,YAAY,CAAC,KAAI,CAAC,cAAc,CAAC,CAAC;YAElC,IAAM,WAAW,GAAG,KAAK,CAAC,KAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;YACrD,KAAI,CAAC,QAAQ,CAAC,EAAC,WAAW,aAAA,EAAC,CAAC,CAAC;YAC7B;;;;eAIG;YACH,IAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,KAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;YACzE,IAAM,eAAe,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC;YACjE,KAAI,CAAC,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,KAAI,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;QAC3E,CAAC,CAAC;QAhCE,KAAI,CAAC,KAAK,GAAG;YACT,WAAW,EAAE,GAAG;SACnB,CAAC;;IACN,CAAC;IAED,wCAAiB,GAAjB;QACI,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IAED,yCAAkB,GAAlB,UAAmB,SAA0B;QACzC,IAAI,SAAS,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;YACpC,IAAI,CAAC,OAAO,EAAE,CAAC;SAClB;IACL,CAAC;IAED,2CAAoB,GAApB;QACI,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACtC,CAAC;IAiBD,6BAAM,GAAN;QACI,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC;IAClC,CAAC;IA1CM,wBAAW,GAAG,cAAc,CAAC;IA2CxC,mBAAC;CAAA,AA5CD,CAAkC,KAAK,CAAC,aAAa,GA4CpD;SA5CY,YAAY"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Dayjs } from "dayjs";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import type { ControlledFormValue } from "../../internal/type";
|
|
4
|
-
import "antd/lib/time-picker/style";
|
|
5
4
|
import "./index.less";
|
|
6
5
|
export interface Props<T extends boolean> extends ControlledFormValue<T extends false ? string : string | null> {
|
|
7
6
|
allowNull: T;
|
|
@@ -12,6 +11,6 @@ export interface Props<T extends boolean> extends ControlledFormValue<T extends
|
|
|
12
11
|
export declare class TimePicker<T extends boolean> extends React.PureComponent<Props<T>> {
|
|
13
12
|
static displayName: string;
|
|
14
13
|
private readonly timeFormatter;
|
|
15
|
-
onTimeChange: (time:
|
|
14
|
+
onTimeChange: (time: Dayjs | null) => void;
|
|
16
15
|
render(): JSX.Element;
|
|
17
16
|
}
|
package/core/TimePicker/index.js
CHANGED
|
@@ -13,10 +13,9 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
13
13
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
14
|
};
|
|
15
15
|
})();
|
|
16
|
-
import
|
|
17
|
-
import
|
|
16
|
+
import { AntDatePicker } from "../AntDatePicker";
|
|
17
|
+
import dayjs from "dayjs";
|
|
18
18
|
import React from "react";
|
|
19
|
-
import "antd/lib/time-picker/style";
|
|
20
19
|
import "./index.less";
|
|
21
20
|
var TimePicker = /** @class */ (function (_super) {
|
|
22
21
|
__extends(TimePicker, _super);
|
|
@@ -37,7 +36,7 @@ var TimePicker = /** @class */ (function (_super) {
|
|
|
37
36
|
}
|
|
38
37
|
TimePicker.prototype.render = function () {
|
|
39
38
|
var _a = this.props, value = _a.value, allowNull = _a.allowNull, placeholder = _a.placeholder, disabled = _a.disabled, className = _a.className;
|
|
40
|
-
return (React.createElement(
|
|
39
|
+
return (React.createElement(AntDatePicker, { picker: "time", mode: undefined, className: className, placeholder: placeholder, value: value ? dayjs(value, this.timeFormatter) : null, onChange: this.onTimeChange, allowClear: allowNull, disabled: disabled }));
|
|
41
40
|
};
|
|
42
41
|
TimePicker.displayName = "TimePicker";
|
|
43
42
|
return TimePicker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/TimePicker/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,aAAa,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/TimePicker/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,cAAc,CAAC;AAStB;IAAmD,8BAA6B;IAAhF;QAAA,qEA8BC;QA3BoB,mBAAa,GAAG,UAAU,CAAC;QAE5C,kBAAY,GAAG,UAAC,IAAkB;YACvB,IAAA,QAAQ,GAAI,KAAI,CAAC,KAAK,SAAd,CAAe;YAC9B,IAAM,aAAa,GAAG,QAA0C,CAAC;YACjE,IAAI,IAAI,EAAE;gBACN,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,KAAI,CAAC,aAAa,CAAC,CAAC,CAAC;aAClD;iBAAM;gBACH,aAAa,CAAC,IAAI,CAAC,CAAC;aACvB;QACL,CAAC,CAAC;;IAiBN,CAAC;IAfG,2BAAM,GAAN;QACU,IAAA,KAAuD,IAAI,CAAC,KAAK,EAAhE,KAAK,WAAA,EAAE,SAAS,eAAA,EAAE,WAAW,iBAAA,EAAE,QAAQ,cAAA,EAAE,SAAS,eAAc,CAAC;QACxE,OAAO,CACH,oBAAC,aAAa,IACV,MAAM,EAAC,MAAM,EACb,IAAI,EAAE,SAAS,EACf,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,EACtD,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,UAAU,EAAE,SAAS,EACrB,QAAQ,EAAE,QAAQ,GACpB,CACL,CAAC;IACN,CAAC;IA5BM,sBAAW,GAAG,YAAY,CAAC;IA6BtC,iBAAC;CAAA,AA9BD,CAAmD,KAAK,CAAC,aAAa,GA8BrE;SA9BY,UAAU"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
2
|
+
import type { Dayjs } from "dayjs";
|
|
3
3
|
import type { ControlledFormValue } from "../../internal/type";
|
|
4
4
|
import "antd/lib/time-picker/style";
|
|
5
5
|
import "./index.less";
|
|
@@ -12,6 +12,6 @@ export interface Props<T extends boolean> extends ControlledFormValue<T extends
|
|
|
12
12
|
export declare class TimeRangePicker<T extends boolean> extends React.PureComponent<Props<T>> {
|
|
13
13
|
static displayName: string;
|
|
14
14
|
private readonly timeFormatter;
|
|
15
|
-
onChange: (dates: [
|
|
15
|
+
onChange: (dates: [Dayjs | null, Dayjs | null] | null) => void;
|
|
16
16
|
render(): JSX.Element;
|
|
17
17
|
}
|
|
@@ -14,8 +14,8 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
};
|
|
15
15
|
})();
|
|
16
16
|
import React from "react";
|
|
17
|
-
import
|
|
18
|
-
import
|
|
17
|
+
import dayjs from "dayjs";
|
|
18
|
+
import { AntDatePicker } from "../AntDatePicker";
|
|
19
19
|
import "antd/lib/time-picker/style";
|
|
20
20
|
import "./index.less";
|
|
21
21
|
var TimeRangePicker = /** @class */ (function (_super) {
|
|
@@ -36,7 +36,7 @@ var TimeRangePicker = /** @class */ (function (_super) {
|
|
|
36
36
|
}
|
|
37
37
|
TimeRangePicker.prototype.render = function () {
|
|
38
38
|
var _a = this.props, value = _a.value, disabled = _a.disabled, className = _a.className, allowNull = _a.allowNull, order = _a.order;
|
|
39
|
-
return (React.createElement(
|
|
39
|
+
return (React.createElement(AntDatePicker.RangePicker, { picker: "time", mode: undefined, className: className, value: value[0] && value[1] ? [dayjs(value[0], this.timeFormatter), dayjs(value[1], this.timeFormatter)] : [null, null], onChange: this.onChange, disabled: disabled, allowClear: allowNull, order: order }));
|
|
40
40
|
};
|
|
41
41
|
TimeRangePicker.displayName = "TimeRangePicker";
|
|
42
42
|
return TimeRangePicker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/TimeRangePicker/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"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AC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EACvH,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,SAAS,EACrB,KAAK,EAAE,KAAK,GACd,CACL,CAAC;IACN,CAAC;IA3BM,2BAAW,GAAG,iBAAiB,CAAC;IA4B3C,sBAAC;CAAA,AA7BD,CAAwD,KAAK,CAAC,aAAa,GA6B1E;SA7BY,eAAe"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
2
|
+
import type { Dayjs } from "dayjs";
|
|
3
3
|
import type { ControlledFormValue } from "../internal/type";
|
|
4
|
-
import type { Moment } from "moment";
|
|
5
4
|
export interface Props<T extends boolean> extends ControlledFormValue<T extends false ? [number, number] : [number, number] | null> {
|
|
6
5
|
allowNull: T;
|
|
7
6
|
disabledRange?: (diffMonthToThisMonth: number, date: Date) => boolean;
|
|
@@ -10,7 +9,7 @@ export interface Props<T extends boolean> extends ControlledFormValue<T extends
|
|
|
10
9
|
}
|
|
11
10
|
export declare class YearMonthSelector<T extends boolean> extends React.PureComponent<Props<T>> {
|
|
12
11
|
static displayName: string;
|
|
13
|
-
isDateDisabled: (current:
|
|
14
|
-
onChange: (date:
|
|
12
|
+
isDateDisabled: (current: Dayjs) => boolean;
|
|
13
|
+
onChange: (date: Dayjs | null, dateString: string) => void;
|
|
15
14
|
render(): JSX.Element;
|
|
16
15
|
}
|
|
@@ -14,8 +14,11 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
};
|
|
15
15
|
})();
|
|
16
16
|
import React from "react";
|
|
17
|
-
import
|
|
18
|
-
import AntDatePicker from "
|
|
17
|
+
import dayjs from "dayjs";
|
|
18
|
+
import { AntDatePicker } from "./AntDatePicker";
|
|
19
|
+
import arraySupport from "dayjs/plugin/arraySupport";
|
|
20
|
+
// load plugin when component is imported
|
|
21
|
+
dayjs.extend(arraySupport);
|
|
19
22
|
var YearMonthSelector = /** @class */ (function (_super) {
|
|
20
23
|
__extends(YearMonthSelector, _super);
|
|
21
24
|
function YearMonthSelector() {
|
|
@@ -33,7 +36,7 @@ var YearMonthSelector = /** @class */ (function (_super) {
|
|
|
33
36
|
if (current.valueOf() >= new Date(2038, 0).valueOf()) {
|
|
34
37
|
return true;
|
|
35
38
|
}
|
|
36
|
-
var diffMonthToThisMonth = Math.floor(current.diff(
|
|
39
|
+
var diffMonthToThisMonth = Math.floor(current.diff(dayjs().startOf("month"), "month", true));
|
|
37
40
|
return ((_b = (_a = _this.props).disabledRange) === null || _b === void 0 ? void 0 : _b.call(_a, diffMonthToThisMonth, current.toDate())) || false;
|
|
38
41
|
};
|
|
39
42
|
_this.onChange = function (date, dateString) {
|
|
@@ -47,7 +50,7 @@ var YearMonthSelector = /** @class */ (function (_super) {
|
|
|
47
50
|
}
|
|
48
51
|
YearMonthSelector.prototype.render = function () {
|
|
49
52
|
var _a = this.props, value = _a.value, allowNull = _a.allowNull, disabled = _a.disabled, className = _a.className;
|
|
50
|
-
return (React.createElement(AntDatePicker, { className: className, disabledDate: this.isDateDisabled, value: value ?
|
|
53
|
+
return (React.createElement(AntDatePicker, { className: className, disabledDate: this.isDateDisabled, value: value ? dayjs([value[0], value[1] - 1]) : null, onChange: this.onChange, allowClear: allowNull, disabled: disabled, picker: "month" }));
|
|
51
54
|
};
|
|
52
55
|
YearMonthSelector.displayName = "DatePicker";
|
|
53
56
|
return YearMonthSelector;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YearMonthSelector.js","sourceRoot":"","sources":["../../src/core/YearMonthSelector.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"YearMonthSelector.js","sourceRoot":"","sources":["../../src/core/Year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;IAdG,kCAAM,GAAN;QACU,IAAA,KAA0C,IAAI,CAAC,KAAK,EAAnD,KAAK,WAAA,EAAE,SAAS,eAAA,EAAE,QAAQ,cAAA,EAAE,SAAS,eAAc,CAAC;QAC3D,OAAO,CACH,oBAAC,aAAa,IACV,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,IAAI,CAAC,cAAc,EACjC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EACrD,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,UAAU,EAAE,SAAS,EACrB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAC,OAAO,GAChB,CACL,CAAC;IACN,CAAC;IAzCM,6BAAW,GAAG,YAAY,CAAC;IA0CtC,wBAAC;CAAA,AA3CD,CAA0D,KAAK,CAAC,aAAa,GA2C5E;SA3CY,iBAAiB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pinnacle0/web-ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.82",
|
|
4
4
|
"author": "Pinnacle",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": [
|
|
@@ -16,12 +16,13 @@
|
|
|
16
16
|
"node": ">= 16.0.0"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@ant-design/icons": "4.
|
|
19
|
+
"@ant-design/icons": "4.8.0",
|
|
20
20
|
"@juggle/resize-observer": "3.4.0",
|
|
21
21
|
"@tanstack/react-virtual": "3.0.0-beta.18",
|
|
22
22
|
"antd": "4.24.2",
|
|
23
23
|
"classnames": "2.3.2",
|
|
24
|
-
"
|
|
24
|
+
"dayjs": "1.11.6",
|
|
25
|
+
"rc-picker": "2.7.0",
|
|
25
26
|
"rc-resize-observer": "1.2.0",
|
|
26
27
|
"react-virtual": "2.10.4"
|
|
27
28
|
},
|
|
@@ -33,8 +34,6 @@
|
|
|
33
34
|
"devDependencies": {
|
|
34
35
|
"@babel/core": "7.20.2",
|
|
35
36
|
"@babel/runtime": "7.20.1",
|
|
36
|
-
"@pinnacle0/devtool-util": "1.1.4",
|
|
37
|
-
"@pinnacle0/webpack-util": "0.3.39",
|
|
38
37
|
"@testing-library/dom": "8.19.0",
|
|
39
38
|
"@testing-library/jest-dom": "5.16.5",
|
|
40
39
|
"@testing-library/react": "13.4.0",
|
|
@@ -50,7 +49,9 @@
|
|
|
50
49
|
"react": "18.2.0",
|
|
51
50
|
"react-dom": "18.2.0",
|
|
52
51
|
"react-router-dom": "5.3.0",
|
|
53
|
-
"typescript": "4.8.4"
|
|
52
|
+
"typescript": "4.8.4",
|
|
53
|
+
"@pinnacle0/devtool-util": "1.1.5",
|
|
54
|
+
"@pinnacle0/webpack-util": "0.3.40"
|
|
54
55
|
},
|
|
55
56
|
"publishConfig": {
|
|
56
57
|
"directory": "build"
|
|
@@ -61,7 +62,6 @@
|
|
|
61
62
|
"start": "pnpm run run-script script/start.ts",
|
|
62
63
|
"start:mobile": "pnpm run run-script script/start-mobile.ts",
|
|
63
64
|
"format": "pnpm run run-script script/format.ts",
|
|
64
|
-
"test": "jest --config config/jest.config.ts"
|
|
65
|
-
"prepublish": "pnpm build"
|
|
65
|
+
"test": "jest --config config/jest.config.ts"
|
|
66
66
|
}
|
|
67
67
|
}
|
package/util/LocaleUtil.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import dayjs from "dayjs";
|
|
2
3
|
import { LocalStorageUtil } from "./LocalStorageUtil";
|
|
3
4
|
export var LocaleContext = React.createContext("en");
|
|
4
5
|
var LocaleManager = /** @class */ (function () {
|
|
@@ -11,7 +12,8 @@ var LocaleManager = /** @class */ (function () {
|
|
|
11
12
|
if (this.locale === "zh") {
|
|
12
13
|
// if tree-shaking (ref README) is enabled, only English locale is imported by default
|
|
13
14
|
// import Chinese locale on the fly, if the current app language is Chinese
|
|
14
|
-
require("
|
|
15
|
+
require("dayjs/locale/zh-cn");
|
|
16
|
+
dayjs.locale("zh-cn");
|
|
15
17
|
}
|
|
16
18
|
};
|
|
17
19
|
LocaleManager.prototype.change = function (locale) {
|
package/util/LocaleUtil.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocaleUtil.js","sourceRoot":"","sources":["../../src/util/LocaleUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAapD,MAAM,CAAC,IAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAS,IAAI,CAAC,CAAC;AAE/D;IAAA;QACqB,eAAU,GAAG,gBAAgB,CAAC;QACvC,WAAM,GAAW,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"LocaleUtil.js","sourceRoot":"","sources":["../../src/util/LocaleUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAapD,MAAM,CAAC,IAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAS,IAAI,CAAC,CAAC;AAE/D;IAAA;QACqB,eAAU,GAAG,gBAAgB,CAAC;QACvC,WAAM,GAAW,IAAI,CAAC;IAgClC,CAAC;IA9BG,kCAAU,GAAV,UAAW,MAAuB;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;QAClE,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,EAAE;YACtB,sFAAsF;YACtF,2EAA2E;YAC3E,OAAO,CAAC,o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