d2coreui 23.0.55 → 23.0.57
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/CHANGELOG.md +47 -0
- package/components/date/dateRangeInput.js +5 -5
- package/components/date/dateRangeInput.js.map +1 -1
- package/components/date/dateRangeInputAdvancedPanel.js +26 -15
- package/components/date/dateRangeInputAdvancedPanel.js.map +1 -1
- package/components/date/dateRangeInputConfirm.js +16 -13
- package/components/date/dateRangeInputConfirm.js.map +1 -1
- package/components/date/dateTimeInput.d.ts +12 -3
- package/components/date/dateTimeInput.js +164 -93
- package/components/date/dateTimeInput.js.map +1 -1
- package/components/grid/config/dataGridEditor.d.ts +4 -3
- package/components/grid/config/dataGridEditor.js +16 -4
- package/components/grid/config/dataGridEditor.js.map +1 -1
- package/components/grid/dataGrid.d.ts +19 -5
- package/components/grid/dataGrid.js +9 -5
- package/components/grid/dataGrid.js.map +1 -1
- package/components/grid/export/contextMenu.d.ts +3 -2
- package/components/grid/export/contextMenu.js.map +1 -1
- package/components/grid/extendedDataGrid.d.ts +11 -4
- package/components/grid/extendedDataGrid.js +34 -24
- package/components/grid/extendedDataGrid.js.map +1 -1
- package/components/modal/impl/draggableModalInner.js +22 -10
- package/components/modal/impl/draggableModalInner.js.map +1 -1
- package/components/modal/impl/draggableModalReducer.d.ts +2 -3
- package/components/modal/impl/draggableModalReducer.js +9 -7
- package/components/modal/impl/draggableModalReducer.js.map +1 -1
- package/components/modal/modalDialog.d.ts +2 -1
- package/components/modal/modalDialog.js +2 -1
- package/components/modal/modalDialog.js.map +1 -1
- package/components/style/withCss.d.ts +9 -4
- package/components/style/withCss.js +7 -3
- package/components/style/withCss.js.map +1 -1
- package/i18n/components.cs.json +2 -0
- package/i18n/components.sk.json +2 -0
- package/i18n/components.uk.json +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 23.0.57
|
|
4
|
+
|
|
5
|
+
- `DateTimeInput` / `DateRangeInput`: `autoWidth` measures the right width with a theme `fontFamily` that is not a
|
|
6
|
+
valid unquoted CSS name (e.g. `"72"`); the input was too narrow and cut the value.
|
|
7
|
+
- `DateRangeInput`: in the advanced popup the begin / both / end time shift icons sit below the duration buttons,
|
|
8
|
+
so that "Now", "Hour" and "15 min" of the three columns are in one row.
|
|
9
|
+
- `DataGrid` / `ExtendedDataGrid`: the `oddRowBackgroundColor` of a `theme` passed in is applied; rows without a
|
|
10
|
+
background color from `rowStyleRules` no longer get an inline `background-color: inherit` that overrode it. The
|
|
11
|
+
default theme keeps odd rows unstriped unless the new antd token `gridOddRowBg` is set (`ConfigProvider`
|
|
12
|
+
`theme={{token: {gridOddRowBg: "#fafafa"}}}`).
|
|
13
|
+
- `ModalDialog`: a dialog opened larger than the window is shrunk to the window minus the margin a maximized dialog
|
|
14
|
+
keeps, and centred, instead of filling the window edge to edge.
|
|
15
|
+
- `ModalDialog`: a dialog kept in the DOM (`destroyOnHidden={false}`) opens on top of the modals opened since its first
|
|
16
|
+
opening, instead of under them.
|
|
17
|
+
- `DataGrid` / `ExtendedDataGrid`: changing the table configuration (column order, width, sort, …) no longer makes
|
|
18
|
+
ag-grid log `Updated property onShowUtcOffset` in development - the time format props stay out of `AgGridReact`.
|
|
19
|
+
- `DataGrid`: `onLoadData`, `defaultRowStyleRules` and the time format props no longer reach `AgGridReact`, which
|
|
20
|
+
warned about them as invalid grid options.
|
|
21
|
+
- `DataGrid` / `ExtendedDataGrid`: `showUtcOffset` takes a `UtcOffsetMode` of `d2core/i18n/localeHolder` - besides
|
|
22
|
+
`true` / `false` also `"hourLetter"` (the repeated hour at the end of the daylight saving time as `A2:00` / `B2:00`)
|
|
23
|
+
and `"offsetInFold"` (the UTC offset only in that hour); the table settings offer all four. `DataGrid` without
|
|
24
|
+
`showUtcOffset` follows the global mode of `LocaleHolder.setUtcOffsetMode`.
|
|
25
|
+
- `DateTimeInput` / `DateRangeInput`: a mask with `HH?` shows and takes the repeated hour as `A2` / `B2` - an hour
|
|
26
|
+
typed there without the letter is the second one (`B`) and a letter outside that hour is invalid; a mask with `Z?`
|
|
27
|
+
shows the UTC offset at every time, so that the input keeps its layout.
|
|
28
|
+
- `DateTimeInput` / `DateRangeInput`: a time skipped at the start of the daylight saving time (29.03. 02:30) and a day
|
|
29
|
+
that does not exist (31.02.) are invalid with any mask, instead of being silently moved to another time; the input
|
|
30
|
+
no longer keeps showing such a typed text while it holds the moved value.
|
|
31
|
+
|
|
32
|
+
## 23.0.56
|
|
33
|
+
|
|
34
|
+
- Components styled through `WithCss` (`DateTimeInput`, `DateRangeInput`, `DurationInput`, grid, pagination, …) take
|
|
35
|
+
the `componentSize` of an enclosing `ConfigProvider` when given no `size` and outside a `Space.Compact`, instead of
|
|
36
|
+
`middle` - the box no longer stays taller than the small inputs inside it.
|
|
37
|
+
- `DateTimeInput` / `DateRangeInput`: `autoWidth` measures the mask in the font of the resolved size, so a `large`
|
|
38
|
+
size taken from a `ConfigProvider` or a `Space.Compact` no longer cuts the value off.
|
|
39
|
+
- `WithCss`: the render function gets the resolved `size` and `variant` as its second argument.
|
|
40
|
+
- `DateRangeInputConfirm`: the Revert/Apply buttons are 48 px wide for a `small` size taken from a `ConfigProvider` or a
|
|
41
|
+
`Space.Compact` as well, not only for the `size` prop.
|
|
42
|
+
- `DateTimeInput`: the calendar icon is centred on the input even when a flex parent stretches the component.
|
|
43
|
+
- `DateRangeInput`: the inputs and the `⟷` separator of the advanced popup are vertically centred; `compact` and `ranges`
|
|
44
|
+
no longer reach the DOM as attributes.
|
|
45
|
+
- `DateRangeInput`: the inputs of the advanced popup are at least as wide as the mask, so the popup grows with a long
|
|
46
|
+
mask instead of cutting the values off; `autoWidth` inputs fill a root stretched by their parent.
|
|
47
|
+
- `DateRangeInput`: the three button columns of the advanced popup share the extra width of a popup widened by the
|
|
48
|
+
mask; the popup inputs are `small` like the rest of its controls.
|
|
49
|
+
|
|
3
50
|
## 23.0.55
|
|
4
51
|
|
|
5
52
|
- `DateTimeInput`, `DateRangeInput`: optional `autoWidth` prop sizes the component to the rendered mask instead of
|
|
@@ -674,16 +674,16 @@ export default class DateRangeInput extends React.Component {
|
|
|
674
674
|
})))));
|
|
675
675
|
}
|
|
676
676
|
renderAdvancedPart() {
|
|
677
|
-
const _a = this.props, { fromValue, toValue, onChange, style, allowClear, renderAsCalendar, hidePopup, align, defaultMode, compact, onModeChange, confirmButtonsRenderer, onPopupVisibleChange, showCustomIntervals, intervalStorage, autoWidth } = _a, props = __rest(_a, ["fromValue", "toValue", "onChange", "style", "allowClear", "renderAsCalendar", "hidePopup", "align", "defaultMode", "compact", "onModeChange", "confirmButtonsRenderer", "onPopupVisibleChange", "showCustomIntervals", "intervalStorage", "autoWidth"]);
|
|
677
|
+
const _a = this.props, { fromValue, toValue, onChange, style, allowClear, renderAsCalendar, hidePopup, align, defaultMode, compact, onModeChange, confirmButtonsRenderer, onPopupVisibleChange, showCustomIntervals, intervalStorage, autoWidth, ranges } = _a, props = __rest(_a, ["fromValue", "toValue", "onChange", "style", "allowClear", "renderAsCalendar", "hidePopup", "align", "defaultMode", "compact", "onModeChange", "confirmButtonsRenderer", "onPopupVisibleChange", "showCustomIntervals", "intervalStorage", "autoWidth", "ranges"]);
|
|
678
678
|
return (React.createElement(WithCss, { useStyles: usePopupStyles }, (context) => React.createElement("div", null,
|
|
679
|
-
React.createElement("div", { style: { display: "flex", gap: 8 } },
|
|
680
|
-
React.createElement(DateTimeInput, Object.assign({}, props, { style: { flexGrow: 1 }, value: fromValue, onChange: (value) => {
|
|
679
|
+
React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 8 } },
|
|
680
|
+
React.createElement(DateTimeInput, Object.assign({}, props, { style: { flexGrow: 1 }, size: "small", autoWidth: true, value: fromValue, onChange: (value) => {
|
|
681
681
|
var _a, _b;
|
|
682
682
|
(_b = (_a = this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, value, this.props.toValue);
|
|
683
683
|
} })),
|
|
684
684
|
!compact &&
|
|
685
685
|
React.createElement("span", { className: context.styles.advancedSeparator }, "\u27F7"),
|
|
686
|
-
React.createElement(DateTimeInput, Object.assign({}, props, { style: { flexGrow: 1 }, value: toValue, onChange: (value) => {
|
|
686
|
+
React.createElement(DateTimeInput, Object.assign({}, props, { style: { flexGrow: 1 }, size: "small", autoWidth: true, value: toValue, onChange: (value) => {
|
|
687
687
|
var _a, _b;
|
|
688
688
|
(_b = (_a = this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, this.props.fromValue, value);
|
|
689
689
|
} }))),
|
|
@@ -745,7 +745,7 @@ export default class DateRangeInput extends React.Component {
|
|
|
745
745
|
}
|
|
746
746
|
/** Renders the two inputs with their icons and the saved-intervals dialog, without the popup. */
|
|
747
747
|
renderInput() {
|
|
748
|
-
const _a = this.props, { className, fromValue, toValue, onChange, style, allowClear, renderAsCalendar, hidePopup, align, disabled, defaultMode, onModeChange, confirmButtonsRenderer, onPopupVisibleChange, showCustomIntervals, intervalStorage, size, status, variant, autoWidth } = _a, props = __rest(_a, ["className", "fromValue", "toValue", "onChange", "style", "allowClear", "renderAsCalendar", "hidePopup", "align", "disabled", "defaultMode", "onModeChange", "confirmButtonsRenderer", "onPopupVisibleChange", "showCustomIntervals", "intervalStorage", "size", "status", "variant", "autoWidth"]);
|
|
748
|
+
const _a = this.props, { className, fromValue, toValue, onChange, style, allowClear, renderAsCalendar, hidePopup, align, disabled, defaultMode, onModeChange, confirmButtonsRenderer, onPopupVisibleChange, showCustomIntervals, intervalStorage, size, status, variant, autoWidth, ranges, compact } = _a, props = __rest(_a, ["className", "fromValue", "toValue", "onChange", "style", "allowClear", "renderAsCalendar", "hidePopup", "align", "disabled", "defaultMode", "onModeChange", "confirmButtonsRenderer", "onPopupVisibleChange", "showCustomIntervals", "intervalStorage", "size", "status", "variant", "autoWidth", "ranges", "compact"]);
|
|
749
749
|
return (React.createElement("div", { style: Object.assign(Object.assign(Object.assign({}, (autoWidth ? { width: "fit-content" } : {})), style), { padding: 0, position: "relative" }), className: className, onFocus: this.props.onFocus, onBlur: this.props.onBlur },
|
|
750
750
|
React.createElement(WithCss, { useStyles: useStyles, props: { size, variant } }, (context) => React.createElement("div", { style: { display: "flex", justifyContent: "space-between" }, className: context.cx(context.styles.baseLayout, {
|
|
751
751
|
disabled: !!disabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateRangeInput.js","sourceRoot":"","sources":["../../../../components/date/dateRangeInput.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAc,MAAM,OAAO,CAAC;AACnC,OAAO,EAAC,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAa,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAC,MAAM,MAAM,CAAC;AAC9E,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,OAAO,aAAa,MAAM,2BAA2B,CAAC;AACtD,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,2BAA2B,EAAE,EAAC,kBAAkB,EAAC,MAAM,+BAA+B,CAAC;AAK9F,OAAO,OAA+B,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAC,YAAY,EAAC,MAAM,YAAY,CAAC;AACxC,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACtD,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EACH,aAAa,EAIb,eAAe,EACf,sBAAsB,GAEzB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,EAAC,KAAK,EAAE,GAAG,EAAC,EAAE,KAA2B,EAAE,EAAE;IACzE,MAAM,EAAC,IA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AAE,EAAC,IAAI,EAAE,EAAC,KAAK,EAAE,aAAa,EAAC,EAAC,EACtC,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE;;oBACtB,IAAI,OAAO,EAAE,CAAC;wBACV,MAAA,MAAA,IAAI,CAAC,KAAK,EAAC,OAAO,kDAAI,CAAC;oBAC3B,CAAC;yBAAM,CAAC;wBACJ,MAAA,MAAA,IAAI,CAAC,KAAK,EAAC,MAAM,kDAAI,CAAC;oBAC1B,CAAC;oBACD,IAAI,CAAC,QAAQ,CAAC,EAAC,YAAY,EAAE,OAAO,EAAC,CAAC,CAAC;gBAC3C,CAAC,EACD,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,IAC7B,IAAI,CAAC,WAAW,EAAE,CACb,CACC,CACd,CAAC;QACN,CAAC;IACL,CAAC;CACJ","sourcesContent":["import React, {HTMLAttributes} from \"react\";\r\nimport dayjs, {Dayjs} from \"dayjs\";\r\nimport {CalendarOutlined, FieldTimeOutlined, SwapRightOutlined} from \"@ant-design/icons\";\r\nimport {Divider, Dropdown, MenuProps, Spin, Switch, Tag, Tooltip} from \"antd\";\r\nimport DateTimeInput from \"./dateTimeInput\";\r\nimport memoizeOne from \"memoize-one\";\r\nimport {TooltipPlacement} from \"antd/es/tooltip\";\r\nimport KeyboardUtils from \"../keyboard/keyboardUtils\";\r\nimport i18n from \"d2core/i18n/i18n\";\r\nimport DateRangeInputAdvancedPanel, {TimeShiftDirection} from \"./dateRangeInputAdvancedPanel\";\r\nimport {DurationUnitType} from \"d2core/dayjs/duration\";\r\nimport {SizeType} from \"antd/lib/config-provider/SizeContext\";\r\nimport {InputStatus} from \"antd/es/_util/statusUtils\";\r\nimport {Variant} from \"antd/es/config-provider\";\r\nimport WithCss, {WithCssInjectedProps} from \"../style/withCss\";\r\nimport {createStyles} from \"antd-style\";\r\nimport {LocaleHolder} from \"d2core/i18n/localeHolder\";\r\nimport SavedIntervalsDialog from \"./savedIntervalsDialog\";\r\nimport {\r\n addQuickRange,\r\n IntervalStorage,\r\n IntervalStorageProvider,\r\n QuickRange,\r\n resolveInterval,\r\n resolveIntervalStorage,\r\n SavedInterval,\r\n} from \"./savedIntervals\";\r\n\r\nconst useStyles = createStyles(({token, css}, props: WithCssInjectedProps) => {\r\n const {size, variant} = props;\r\n\r\n const heightMap: Record<NonNullable<SizeType>, number> = {\r\n small: token.controlHeightSM,\r\n middle: token.controlHeight,\r\n large: token.controlHeightLG,\r\n };\r\n\r\n // mirrors antd input component tokens `paddingInline(SM|LG)`\r\n const paddingInlineMap: Record<NonNullable<SizeType>, number> = {\r\n small: token.controlPaddingHorizontalSM - token.lineWidth,\r\n middle: token.paddingSM - token.lineWidth,\r\n large: token.controlPaddingHorizontal - token.lineWidth,\r\n };\r\n\r\n /**\r\n * One block per antd input variant, mirroring `antd/es/input/style/variants.js`.\r\n * `.focused` stands for the open-popup state, which antd renders as active - not disabled.\r\n */\r\n\r\n // genOutlinedStyle + genOutlinedStatusStyle\r\n const outlined = css`\r\n background-color: ${token.colorBgContainer};\r\n border: ${token.lineWidth}px ${token.lineType} ${token.colorBorder};\r\n border-radius: ${token.borderRadius}px;\r\n\r\n &:hover {\r\n border-color: ${token.colorPrimaryHover};\r\n background-color: ${token.colorBgContainer};\r\n }\r\n\r\n &:focus-within, &.focused {\r\n border-color: ${token.colorPrimary};\r\n box-shadow: 0 0 0 ${token.controlOutlineWidth}px ${token.controlOutline};\r\n background-color: ${token.colorBgContainer};\r\n }\r\n\r\n &.disabled {\r\n background-color: ${token.colorBgContainerDisabled};\r\n border-color: ${token.colorBorder};\r\n\r\n &:hover, &:focus-within {\r\n border-color: ${token.colorBorder};\r\n background-color: ${token.colorBgContainerDisabled};\r\n }\r\n }\r\n\r\n /* status must stay after .disabled - in antd a status border wins over the disabled one */\r\n &.status-error {\r\n border-color: ${token.colorError};\r\n\r\n &:hover {\r\n border-color: ${token.colorErrorBorderHover};\r\n }\r\n\r\n &:focus-within, &.focused {\r\n border-color: ${token.colorError};\r\n box-shadow: 0 0 0 ${token.controlOutlineWidth}px ${token.colorErrorOutline};\r\n }\r\n\r\n &.disabled, &.disabled:hover {\r\n border-color: ${token.colorError};\r\n }\r\n }\r\n\r\n &.status-warning {\r\n border-color: ${token.colorWarning};\r\n\r\n &:hover {\r\n border-color: ${token.colorWarningBorderHover};\r\n }\r\n\r\n &:focus-within, &.focused {\r\n border-color: ${token.colorWarning};\r\n box-shadow: 0 0 0 ${token.controlOutlineWidth}px ${token.colorWarningOutline};\r\n }\r\n\r\n &.disabled, &.disabled:hover {\r\n border-color: ${token.colorWarning};\r\n }\r\n }\r\n `;\r\n\r\n // genUnderlinedStyle - bottom border only, no radius, no focus shadow and, notably,\r\n // no disabled background fill\r\n const underlined = css`\r\n background-color: ${token.colorBgContainer};\r\n border-width: ${token.lineWidth}px 0;\r\n border-style: ${token.lineType} none;\r\n border-color: transparent transparent ${token.colorBorder} transparent;\r\n border-radius: 0;\r\n\r\n &:hover {\r\n border-color: transparent transparent ${token.colorPrimaryHover} transparent;\r\n background-color: ${token.colorBgContainer};\r\n }\r\n\r\n &:focus-within, &.focused {\r\n border-color: transparent transparent ${token.colorPrimary} transparent;\r\n background-color: ${token.colorBgContainer};\r\n }\r\n\r\n &.disabled {\r\n border-color: transparent transparent ${token.colorBorder} transparent;\r\n\r\n &:hover, &:focus-within {\r\n border-color: transparent transparent ${token.colorBorder} transparent;\r\n }\r\n }\r\n\r\n &.status-error {\r\n border-color: transparent transparent ${token.colorError} transparent;\r\n\r\n &:hover {\r\n border-color: transparent transparent ${token.colorErrorBorderHover} transparent;\r\n }\r\n\r\n &:focus-within, &.focused, &.disabled, &.disabled:hover {\r\n border-color: transparent transparent ${token.colorError} transparent;\r\n }\r\n }\r\n\r\n &.status-warning {\r\n border-color: transparent transparent ${token.colorWarning} transparent;\r\n\r\n &:hover {\r\n border-color: transparent transparent ${token.colorWarningBorderHover} transparent;\r\n }\r\n\r\n &:focus-within, &.focused, &.disabled, &.disabled:hover {\r\n border-color: transparent transparent ${token.colorWarning} transparent;\r\n }\r\n }\r\n `;\r\n\r\n // genFilledStyle + genFilledStatusStyle\r\n const filled = css`\r\n background: ${token.colorFillTertiary};\r\n border: ${token.lineWidth}px ${token.lineType} transparent;\r\n border-radius: ${token.borderRadius}px;\r\n\r\n &:hover {\r\n background: ${token.colorFillSecondary};\r\n }\r\n\r\n &:focus-within, &.focused {\r\n border-color: ${token.colorPrimary};\r\n background-color: ${token.colorBgContainer};\r\n }\r\n\r\n &.disabled {\r\n background-color: ${token.colorBgContainerDisabled};\r\n border-color: ${token.colorBorder};\r\n\r\n &:hover, &:focus-within {\r\n border-color: ${token.colorBorder};\r\n background-color: ${token.colorBgContainerDisabled};\r\n }\r\n }\r\n\r\n /* antd guards the filled status style with :not(-disabled), so a disabled input keeps\r\n the plain disabled background instead of the tinted one */\r\n &.status-error:not(.disabled) {\r\n background: ${token.colorErrorBg};\r\n border-color: transparent;\r\n\r\n && input {\r\n color: ${token.colorErrorText};\r\n }\r\n\r\n &:hover {\r\n background: ${token.colorErrorBgHover};\r\n }\r\n\r\n &:focus-within, &.focused {\r\n border-color: ${token.colorError};\r\n background-color: ${token.colorBgContainer};\r\n }\r\n }\r\n\r\n &.status-warning:not(.disabled) {\r\n background: ${token.colorWarningBg};\r\n border-color: transparent;\r\n\r\n && input {\r\n color: ${token.colorWarningText};\r\n }\r\n\r\n &:hover {\r\n background: ${token.colorWarningBgHover};\r\n }\r\n\r\n &:focus-within, &.focused {\r\n border-color: ${token.colorWarning};\r\n background-color: ${token.colorBgContainer};\r\n }\r\n }\r\n `;\r\n\r\n // genBorderlessStyle - only the text colour reacts to status, the affix is left alone\r\n const borderless = css`\r\n background: transparent;\r\n border: none;\r\n border-radius: ${token.borderRadius}px;\r\n\r\n &:focus-within, &.focused {\r\n outline: none;\r\n }\r\n\r\n /* the value lives in the nested inputs, so the colour has to reach them;\r\n disabled wins over status, the same way antd pickers behave */\r\n &.status-error:not(.disabled) {\r\n color: ${token.colorError};\r\n\r\n && input {\r\n color: ${token.colorError};\r\n }\r\n }\r\n\r\n &.status-warning:not(.disabled) {\r\n color: ${token.colorWarning};\r\n\r\n && input {\r\n color: ${token.colorWarning};\r\n }\r\n }\r\n `;\r\n\r\n const variantStyles = {outlined, underlined, filled, borderless}[variant];\r\n // underlined is the only variant antd renders without a radius\r\n const hasRadius = variant !== \"underlined\";\r\n // antd derives the height from padding + border, so a borderless input ends up 2 * lineWidth shorter\r\n const height = heightMap[size] - (variant === \"borderless\" ? 2 * token.lineWidth : 0);\r\n // antd colours prefix/suffix by status in every variant except borderless\r\n const statusAffix = variant !== \"borderless\";\r\n\r\n return {\r\n baseLayout: css`\r\n display: inline-block;\r\n position: relative;\r\n width: 100%;\r\n height: ${height}px;\r\n padding: 0 ${paddingInlineMap[size]}px 0 0;\r\n color: ${token.colorText};\r\n font-size: ${token.fontSize}px;\r\n line-height: ${token.lineHeight};\r\n transition: border ${token.motionDurationMid}, box-shadow ${token.motionDurationMid}, background ${token.motionDurationMid};\r\n\r\n ${variantStyles}\r\n\r\n &:hover, &:focus-within, &.focused {\r\n z-index: 3;\r\n }\r\n\r\n &:focus-within, &.focused {\r\n outline: 0;\r\n }\r\n\r\n /* inputs are disabled while the popup is open, but the value must stay readable */\r\n &.focused input[disabled] {\r\n color: ${token.colorText};\r\n -webkit-text-fill-color: ${token.colorText};\r\n cursor: default;\r\n }\r\n\r\n &.disabled {\r\n color: ${token.colorTextDisabled};\r\n box-shadow: none;\r\n opacity: 1;\r\n cursor: not-allowed;\r\n\r\n &:hover, &:focus-within {\r\n box-shadow: none;\r\n }\r\n }\r\n\r\n .ant-space-compact & {\r\n border-radius: 0;\r\n }\r\n\r\n .ant-space-compact > *:not(:last-child) & {\r\n width: calc(100% + ${token.lineWidth}px);\r\n }\r\n\r\n ${hasRadius ? css`\r\n .ant-space-compact > *:first-child & {\r\n border-start-start-radius: ${token.borderRadius}px;\r\n border-end-start-radius: ${token.borderRadius}px;\r\n border-inline-end-width: ${token.lineWidth}px;\r\n }\r\n\r\n .ant-space-compact > *:last-child & {\r\n border-start-end-radius: ${token.borderRadius}px;\r\n border-end-end-radius: ${token.borderRadius}px;\r\n }\r\n\r\n .ant-space-compact > *:first-child:last-child & {\r\n border-radius: ${token.borderRadius}px;\r\n }\r\n ` : \"\"}\r\n `,\r\n // mirrors antd `.ant-picker-range-separator` + `.ant-picker-separator`\r\n rangeSeparator: css`\r\n display: inline-flex;\r\n align-self: center;\r\n align-items: center;\r\n justify-content: center;\r\n box-sizing: content-box;\r\n width: 1em;\r\n height: ${token.fontSizeLG}px;\r\n padding: 0 ${token.paddingXS}px;\r\n color: ${token.colorTextQuaternary};\r\n /* antd fixes the separator at fontSizeLG for every size */\r\n font-size: ${token.fontSizeLG}px;\r\n line-height: 1;\r\n cursor: default;\r\n\r\n .focused & {\r\n color: ${token.colorIcon};\r\n }\r\n\r\n .disabled & {\r\n color: ${token.colorTextDisabled};\r\n cursor: not-allowed;\r\n }\r\n `,\r\n suffixIcon: css`\r\n align-self: center;\r\n margin-inline-start: ${token.paddingXS / 2}px;\r\n color: ${token.colorTextQuaternary};\r\n line-height: 1;\r\n\r\n ${statusAffix ? css`\r\n .status-error & {\r\n color: ${token.colorError};\r\n }\r\n\r\n .status-warning & {\r\n color: ${token.colorWarning};\r\n }\r\n ` : \"\"}\r\n\r\n .disabled & {\r\n color: ${token.colorTextDisabled};\r\n }\r\n `,\r\n }\r\n})\r\n\r\nconst usePopupStyles = createStyles(({token, css}) => {\r\n return {\r\n presetsBar: css`\r\n border-top: ${token.lineWidth}px ${token.lineType} ${token.colorSplit};\r\n padding-top: 6px;\r\n `,\r\n advancedSeparator: css`\r\n margin: 4px;\r\n color: ${token.colorTextSecondary};\r\n text-align: center;\r\n `,\r\n }\r\n})\r\n\r\n/** Layout of the {@link DateRangeInput} popup. */\r\nexport enum DateRangeInputMode {\r\n /** Two month calendars (click a day or drag across days) plus the {@link DateRangeInputProps.ranges} presets. */\r\n SIMPLE,\r\n /** Two date-time inputs plus buttons for interval begin/end, duration and time shift. */\r\n ADVANCED,\r\n}\r\n\r\n/**\r\n * Props of {@link DateRangeInput}. Remaining HTML attributes are forwarded to the inner {@link DateTimeInput}s,\r\n * except `style` and `className`, which apply to the root element.\r\n */\r\nexport interface DateRangeInputProps extends Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> {\r\n /** dayjs format of both bounds - see {@link DateTimeInput} `mask` for the supported tokens. */\r\n mask: string\r\n /** Start of the range (controlled), in local time. */\r\n fromValue: Dayjs | null\r\n /** End of the range (controlled), in local time. The component does not enforce `fromValue <= toValue`. */\r\n toValue: Dayjs | null\r\n /**\r\n * Called with both bounds whenever either one changes: typing in one of the inputs, picking or dragging\r\n * days in the calendars (the time of day of the current bounds is kept - 00:00:00.000 / 23:59:59.999 when\r\n * they are `null`), a preset from {@link DateRangeInputProps.ranges}, an advanced-mode button or a saved interval.\r\n * Advanced-mode buttons and saved intervals clamp the result to {@link DateRangeInputProps.minDateTime}/{@link DateRangeInputProps.maxDateTime}.\r\n */\r\n onChange?: (fromValue: Dayjs | null, toValue: Dayjs | null) => void\r\n /** Called with the raw text of a bound whose typed text is not a valid (or allowed) value. */\r\n onInvalidValue?: (input: string) => void\r\n /** Disables both inputs and the popup. */\r\n disabled?: boolean\r\n /** Earliest allowed value of both bounds (inclusive). */\r\n minDateTime?: Dayjs\r\n /** Latest allowed value of both bounds (inclusive). */\r\n maxDateTime?: Dayjs\r\n /** Allows a bound to be cleared by emptying its input; it is then reported as `null`. */\r\n allowClear?: boolean\r\n /** Preset ranges shown as clickable tags in the {@link DateRangeInputMode.SIMPLE} popup; the key is the label, the function returns `[from, to]` when clicked. */\r\n ranges?: { [rangeName: string]: () => [Dayjs, Dayjs] }\r\n /** antd control size. */\r\n size?: SizeType;\r\n /** antd validation status of the whole range input. */\r\n status?: InputStatus\r\n /** antd input variant of the whole range input; defaults to the `ConfigProvider` one. */\r\n variant?: Variant\r\n /**\r\n * Compact popup: always the advanced layout without the mode switch, the separator and the \"Interval End\"\r\n * column; {@link DateRangeInputProps.defaultMode} is ignored.\r\n */\r\n compact?: boolean\r\n /**\r\n * Sizes the component to the rendered {@link DateRangeInputProps.mask} instead of filling the parent: both\r\n * inputs are as wide as the formatted value and the box shrinks around them. A `width` in `style` still wins.\r\n */\r\n autoWidth?: boolean\r\n\r\n /** Renders only the two inputs - no calendar icon and no popup. */\r\n hidePopup?: boolean\r\n /** Renders only the popup content inline, without the inputs. */\r\n renderAsCalendar?: boolean\r\n /** Placement of the popup relative to the input. */\r\n placement?: TooltipPlacement\r\n /** Fine alignment of the popup (rc-trigger `align`), applied on top of {@link DateRangeInputProps.placement}. */\r\n align?: {\r\n points?: [string, string];\r\n offset?: [number, number];\r\n targetOffset?: [number, number];\r\n overflow?: {\r\n adjustX?: boolean;\r\n adjustY?: boolean;\r\n };\r\n useCssRight?: boolean;\r\n useCssBottom?: boolean;\r\n useCssTransform?: boolean;\r\n }\r\n\r\n /**\r\n * Initial popup mode (uncontrolled - read only on mount); the user switches it with the switch in the popup.\r\n * @default DateRangeInputMode.SIMPLE\r\n */\r\n defaultMode?: DateRangeInputMode\r\n\r\n /**\r\n * Shows an icon opening a dropdown with: saving the current range to quick access (the latest\r\n * `MAX_QUICK_RANGES` are kept), the quick-access ranges, the {@link SavedIntervalsDialog} and the\r\n * saved relative intervals. Intervals are loaded when this becomes `true` and whenever {@link DateRangeInputProps.intervalStorage} changes.\r\n */\r\n showCustomIntervals?: boolean\r\n /**\r\n * Where quick-access ranges and saved intervals are persisted - see {@link IntervalStorage}. Compared by\r\n * reference, so pass a stable object: a new one reloads the intervals.\r\n * @default true\r\n */\r\n intervalStorage?: IntervalStorage\r\n\r\n /** Called when the user toggles the popup between {@link DateRangeInputMode.SIMPLE} and {@link DateRangeInputMode.ADVANCED}. */\r\n onModeChange?(mode: DateRangeInputMode): void\r\n\r\n /** Called when the popup opens and when focus enters the inputs or the popup content. */\r\n onFocus?(): void\r\n\r\n /** Called when the popup closes and when focus leaves the inputs or the popup content. */\r\n onBlur?(): void\r\n\r\n /** Renders extra content (e.g. confirm buttons) at the right side of the popup footer. */\r\n confirmButtonsRenderer?(): React.ReactNode\r\n\r\n /** Called when the popup opens or closes. */\r\n onPopupVisibleChange?(visible: boolean): void\r\n}\r\n\r\ninterface DateRangeInputState {\r\n valid: boolean\r\n selectionStartDate: Dayjs | null\r\n popupKeyIndex: number\r\n popupVisible: boolean\r\n\r\n mode?: DateRangeInputMode\r\n\r\n quickRanges: QuickRange[]\r\n savedIntervals: SavedInterval[]\r\n intervalsLoading: boolean\r\n configDialogOpen: boolean\r\n}\r\n\r\n// a value within 1 minute before the end of a month (23:59, 23:59:59, 23:59:59.999) counts as the end of the month\r\nconst MONTH_END_TOLERANCE_MS = 60_000;\r\n// units whose length depends on the length of a month\r\nconst MONTH_BASED_UNITS: DurationUnitType[] = [\"month\", \"months\", \"M\", \"year\", \"years\", \"y\"];\r\n\r\n/**\r\n * Shifts the value by `amount` units of `unit`. If the value lies at the end of a month and is shifted by a month\r\n * or a year, it stays at the end of the month after the shift (30.09. 23:59:59.999 - 1 month = 31.08. 23:59:59.999, not 30.08.).\r\n * Other values are shifted normally (15.09. - 1 month = 15.08.).\r\n */\r\nfunction shiftDateValue(value: Dayjs, amount: number, unit: DurationUnitType): Dayjs {\r\n if (MONTH_BASED_UNITS.includes(unit)) {\r\n const nextMonthStart = value.endOf(\"month\").add(1, \"millisecond\");\r\n const gap = nextMonthStart.diff(value);\r\n if (gap <= MONTH_END_TOLERANCE_MS) {\r\n return nextMonthStart.add(amount, unit).subtract(gap, \"millisecond\");\r\n }\r\n }\r\n return value.add(amount, unit);\r\n}\r\n\r\n/**\r\n * Controlled date-time range input: two masked {@link DateTimeInput}s in one antd-styled box with a popup\r\n * that opens on right-click or via the calendar icon. The popup offers calendars and presets\r\n * ({@link DateRangeInputMode.SIMPLE}) or interval shortcuts ({@link DateRangeInputMode.ADVANCED}).\r\n * Every change is reported immediately; use `DateRangeInputConfirm` to apply changes only on confirmation.\r\n *\r\n * @example\r\n * const [range, setRange] = useState<[Dayjs | null, Dayjs | null]>([dayjs().startOf(\"day\"), dayjs().endOf(\"day\")]);\r\n *\r\n * <DateRangeInput\r\n * mask={LocaleHolder.getDateTimeFormat(true, true)}\r\n * fromValue={range[0]}\r\n * toValue={range[1]}\r\n * onChange={(from, to) => setRange([from, to])}\r\n * ranges={DateTimeUtils.getRanges([DateTimeInterval.DAY_ACT, DateTimeInterval.WEEK_ACT])}\r\n * />\r\n */\r\nexport default class DateRangeInput extends React.Component<DateRangeInputProps, DateRangeInputState> {\r\n private storageProvider: IntervalStorageProvider | null;\r\n\r\n constructor(props: Readonly<DateRangeInputProps>) {\r\n super(props);\r\n this.state = {\r\n valid: !!props.fromValue && props.fromValue.isValid() && !!props.toValue && props.toValue.isValid(),\r\n selectionStartDate: null,\r\n popupKeyIndex: 0,\r\n popupVisible: false,\r\n\r\n mode: props.compact ? undefined : props.defaultMode ?? DateRangeInputMode.SIMPLE,\r\n\r\n quickRanges: [],\r\n savedIntervals: [],\r\n intervalsLoading: false,\r\n configDialogOpen: false,\r\n };\r\n this.storageProvider = resolveIntervalStorage(props.intervalStorage);\r\n this.getDefaultSelectedDateForFromPanel = memoizeOne(this.getDefaultSelectedDateForFromPanel.bind(this));\r\n }\r\n\r\n componentDidMount() {\r\n if (this.props.showCustomIntervals) {\r\n this.loadIntervals();\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps: Readonly<DateRangeInputProps>, prevState: Readonly<DateRangeInputState>) {\r\n if (prevState.popupVisible !== this.state.popupVisible && this.props.onPopupVisibleChange) {\r\n this.props.onPopupVisibleChange(this.state.popupVisible);\r\n }\r\n\r\n if (prevProps.intervalStorage !== this.props.intervalStorage) {\r\n this.storageProvider = resolveIntervalStorage(this.props.intervalStorage);\r\n\r\n if (this.props.showCustomIntervals) {\r\n this.loadIntervals();\r\n }\r\n } else if (!prevProps.showCustomIntervals && this.props.showCustomIntervals) {\r\n this.loadIntervals();\r\n }\r\n }\r\n\r\n private async loadIntervals() {\r\n const provider = this.storageProvider;\r\n\r\n if (!provider) {\r\n return;\r\n }\r\n\r\n this.setState({intervalsLoading: true});\r\n\r\n try {\r\n const [quickRanges, savedIntervals] = await Promise.all([provider.loadQuickRanges(), provider.loadIntervals()]);\r\n this.setState({quickRanges, savedIntervals});\r\n } finally {\r\n this.setState({intervalsLoading: false});\r\n }\r\n }\r\n\r\n private async runStorageOperation(operation: (provider: IntervalStorageProvider) => Promise<void>) {\r\n const provider = this.storageProvider;\r\n\r\n if (!provider) {\r\n return;\r\n }\r\n\r\n this.setState({intervalsLoading: true});\r\n\r\n try {\r\n await operation(provider);\r\n } finally {\r\n this.setState({intervalsLoading: false});\r\n }\r\n }\r\n\r\n private saveCurrentRangeToQuickAccess() {\r\n const {fromValue, toValue} = this.props;\r\n\r\n if (!fromValue || !toValue) {\r\n return;\r\n }\r\n\r\n const quickRanges = addQuickRange(this.state.quickRanges, fromValue, toValue);\r\n\r\n this.setState({quickRanges});\r\n this.runStorageOperation(provider => provider.saveQuickRanges(quickRanges));\r\n }\r\n\r\n private buildIntervalMenu(): MenuProps {\r\n if (this.state.intervalsLoading) {\r\n return {items: [{key: \"loading\", label: <Spin size=\"small\"/>, disabled: true}]};\r\n }\r\n\r\n const dateMask = LocaleHolder.getDateFormat(true);\r\n const items: NonNullable<MenuProps[\"items\"]> = [{\r\n key: \"save-current\",\r\n label: i18n(\"Save Current Interval to Quick Access\"),\r\n disabled: !this.props.fromValue || !this.props.toValue,\r\n }];\r\n\r\n if (this.state.quickRanges.length > 0) {\r\n items.push({type: \"divider\"});\r\n this.state.quickRanges.forEach((range, index) => {\r\n items.push({\r\n key: `quick-${index}`,\r\n label: `${dayjs(range.from).format(dateMask)} - ${dayjs(range.to).format(dateMask)}`,\r\n });\r\n });\r\n }\r\n\r\n items.push({type: \"divider\"});\r\n items.push({key: \"config\", label: i18n(\"Saved Intervals Configuration\")});\r\n\r\n if (this.state.savedIntervals.length > 0) {\r\n items.push({type: \"divider\"});\r\n this.state.savedIntervals.forEach(interval => {\r\n const resolved = resolveInterval(interval);\r\n\r\n items.push({\r\n key: `interval-${interval.id}`,\r\n disabled: !resolved,\r\n label: resolved\r\n ? `${interval.name} (${resolved[0].format(dateMask)} - ${resolved[1].format(dateMask)})`\r\n : interval.name,\r\n });\r\n });\r\n }\r\n\r\n return {\r\n items,\r\n onClick: ({key}) => this.onIntervalMenuClick(key),\r\n };\r\n }\r\n\r\n private onIntervalMenuClick(key: string) {\r\n if (key === \"save-current\") {\r\n this.saveCurrentRangeToQuickAccess();\r\n } else if (key === \"config\") {\r\n this.setState({configDialogOpen: true});\r\n } else if (key.startsWith(\"quick-\")) {\r\n const range = this.state.quickRanges[Number(key.substring(\"quick-\".length))];\r\n\r\n if (range) {\r\n this.onChange(dayjs(range.from), dayjs(range.to));\r\n }\r\n } else if (key.startsWith(\"interval-\")) {\r\n const interval = this.state.savedIntervals.find(item => item.id === key.substring(\"interval-\".length));\r\n const resolved = interval ? resolveInterval(interval) : null;\r\n\r\n if (resolved) {\r\n this.onChange(resolved[0], resolved[1]);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Day whose month the left (\"from\") calendar shows: one month before `fromDate` when both bounds fall on the\r\n * same day (so the two calendars show different months), otherwise `fromDate` (one month before today when `null`).\r\n */\r\n getDefaultSelectedDateForFromPanel(fromDate: Dayjs | null, toDate: Dayjs | null): Dayjs {\r\n if (!!fromDate && !!toDate && fromDate.isSame(toDate, \"date\")) {\r\n return fromDate.clone().subtract(1, \"month\");\r\n } else {\r\n return fromDate ?? dayjs().startOf(\"day\").subtract(1, \"month\");\r\n }\r\n }\r\n\r\n private getFromValue(date: Dayjs) {\r\n return (this.props.fromValue?.clone() ?? dayjs().startOf(\"day\")).year(date.year()).month(date.month()).date(date.date());\r\n }\r\n\r\n private getToValue(date: Dayjs) {\r\n return (this.props.toValue?.clone() ?? dayjs().endOf(\"day\")).year(date.year()).month(date.month()).date(date.date());\r\n }\r\n\r\n /** Closes the popup and calls {@link DateRangeInputProps.onPopupVisibleChange} with `false`. */\r\n closePopup() {\r\n // close tooltip\r\n this.setState({popupKeyIndex: this.state.popupKeyIndex + 1, popupVisible: false});\r\n this.props.onPopupVisibleChange?.(false);\r\n }\r\n\r\n private onChange(fromValue: Dayjs | null, toValue: Dayjs | null) {\r\n if (this.props.minDateTime && fromValue?.isBefore(this.props.minDateTime)) {\r\n fromValue = this.props.minDateTime;\r\n }\r\n if (this.props.maxDateTime && toValue?.isAfter(this.props.maxDateTime)) {\r\n toValue = this.props.maxDateTime;\r\n }\r\n this.props.onChange?.(fromValue, toValue);\r\n }\r\n\r\n private renderSimplePart() {\r\n const {\r\n fromValue,\r\n toValue,\r\n onChange,\r\n style,\r\n allowClear,\r\n renderAsCalendar,\r\n hidePopup,\r\n align,\r\n defaultMode,\r\n onModeChange,\r\n confirmButtonsRenderer,\r\n onPopupVisibleChange,\r\n showCustomIntervals,\r\n intervalStorage,\r\n autoWidth,\r\n ...props\r\n } = this.props;\r\n const markedDateInterval: [Dayjs, Dayjs] | undefined = this.props.fromValue && this.props.toValue ? [this.props.fromValue, this.props.toValue] : undefined;\r\n\r\n return (\r\n <WithCss useStyles={usePopupStyles}>{(context) =>\r\n <div>\r\n <div style={{display: \"flex\"}}>\r\n <DateTimeInput value={fromValue} {...props}\r\n allowClear={allowClear}\r\n renderAsCalendar\r\n style={{width: \"100%\"}}\r\n onChange={(date) => {\r\n if (date) {\r\n const fromValue = this.getFromValue(date);\r\n const toValue = this.getToValue(date);\r\n this.props.onChange?.(fromValue, toValue);\r\n }\r\n }}\r\n defaultSelectedDate={this.getDefaultSelectedDateForFromPanel(fromValue, toValue)}\r\n markedDateInterval={markedDateInterval}\r\n onDateItemMouseDown={(date) => {\r\n this.setState({selectionStartDate: date});\r\n const dateFrom = this.getFromValue(date);\r\n const dateTo = this.getToValue(date);\r\n this.props.onChange?.(dateFrom, dateTo);\r\n }}\r\n onDateItemMouseOver={(date) => {\r\n if (KeyboardUtils.isMouseDown() && !!this.state.selectionStartDate) {\r\n let dateFrom: Dayjs;\r\n let dateTo: Dayjs;\r\n if (this.state.selectionStartDate.isBefore(date)) {\r\n dateFrom = this.state.selectionStartDate;\r\n dateTo = date;\r\n } else {\r\n dateFrom = date;\r\n dateTo = this.state.selectionStartDate;\r\n }\r\n dateFrom = this.getFromValue(dateFrom);\r\n dateTo = this.getToValue(dateTo);\r\n this.props.onChange?.(dateFrom, dateTo);\r\n }\r\n }}\r\n onDateItemMouseUp={(_date) => {\r\n this.setState({selectionStartDate: null});\r\n }}\r\n ignoreKeyStrokes\r\n />\r\n <Divider type=\"vertical\" style={{height: \"auto\"}}/>\r\n <DateTimeInput value={toValue} {...props}\r\n renderAsCalendar\r\n allowClear={allowClear}\r\n style={{width: \"100%\"}}\r\n onChange={(date) => {\r\n if (date) {\r\n const fromValue = this.getFromValue(date);\r\n const toValue = this.getToValue(date);\r\n this.props.onChange?.(fromValue, toValue);\r\n }\r\n }}\r\n markedDateInterval={markedDateInterval}\r\n onDateItemMouseDown={(date) => {\r\n this.setState({selectionStartDate: date});\r\n const dateFrom = this.getFromValue(date);\r\n const dateTo = this.getToValue(date);\r\n this.props.onChange?.(dateFrom, dateTo);\r\n }}\r\n onDateItemMouseOver={(date) => {\r\n if (KeyboardUtils.isMouseDown() && !!this.state.selectionStartDate) {\r\n let dateFrom: Dayjs;\r\n let dateTo: Dayjs;\r\n if (this.state.selectionStartDate.isBefore(date)) {\r\n dateFrom = this.state.selectionStartDate;\r\n dateTo = date;\r\n } else {\r\n dateFrom = date;\r\n dateTo = this.state.selectionStartDate;\r\n }\r\n dateFrom = this.getFromValue(dateFrom);\r\n dateTo = this.getToValue(dateTo);\r\n this.props.onChange?.(dateFrom, dateTo);\r\n }\r\n }}\r\n onDateItemMouseUp={(_date) => {\r\n this.setState({selectionStartDate: null});\r\n }}\r\n ignoreKeyStrokes\r\n />\r\n </div>\r\n <div className={context.styles.presetsBar}>\r\n {\r\n this.props.ranges && Object.keys(this.props.ranges).map((rangeName, index) => {\r\n return (<Tag style={{userSelect: \"none\", cursor: \"pointer\"}} color=\"blue\"\r\n key={`range-${index}`}\r\n onClick={() => {\r\n const rangeFunction = this.props.ranges?.[rangeName];\r\n if (rangeFunction) {\r\n const range = rangeFunction();\r\n this.props.onChange?.(range[0], range[1]);\r\n }\r\n }}>\r\n {rangeName}</Tag>);\r\n })\r\n }\r\n </div>\r\n </div>\r\n }</WithCss>\r\n )\r\n }\r\n\r\n private renderAdvancedPart() {\r\n const {\r\n fromValue,\r\n toValue,\r\n onChange,\r\n style,\r\n allowClear,\r\n renderAsCalendar,\r\n hidePopup,\r\n align,\r\n defaultMode,\r\n compact,\r\n onModeChange,\r\n confirmButtonsRenderer,\r\n onPopupVisibleChange,\r\n showCustomIntervals,\r\n intervalStorage,\r\n autoWidth,\r\n ...props\r\n } = this.props;\r\n return (\r\n <WithCss useStyles={usePopupStyles}>{(context) =>\r\n <div>\r\n <div style={{display: \"flex\", gap: 8}}>\r\n <DateTimeInput\r\n {...props}\r\n style={{flexGrow: 1}}\r\n value={fromValue}\r\n onChange={(value) => {\r\n this.props.onChange?.(value, this.props.toValue);\r\n }}\r\n />\r\n {!compact &&\r\n <span className={context.styles.advancedSeparator}>{\"\\u27F7\"}</span>\r\n }\r\n <DateTimeInput\r\n {...props}\r\n style={{flexGrow: 1}}\r\n value={toValue}\r\n onChange={(value) => {\r\n this.props.onChange?.(this.props.fromValue, value);\r\n }}\r\n />\r\n </div>\r\n <DateRangeInputAdvancedPanel\r\n compact={compact}\r\n onBeginIntervalChange={unit => {\r\n let from: Dayjs;\r\n if (unit === \"15minutes\") {\r\n const roundedMinutes = Math.floor(dayjs().minute() / 15) * 15;\r\n from = dayjs().startOf(\"hour\").minute(roundedMinutes);\r\n } else {\r\n from = dayjs().startOf(unit);\r\n }\r\n this.onChange(from, this.props.toValue);\r\n }}\r\n onIntervalDurationChange={unitOfTime => {\r\n if (this.props.fromValue) {\r\n let to: Dayjs = this.props.fromValue.clone().add(1, unitOfTime).subtract(1, \"millisecond\")\r\n this.onChange(this.props.fromValue, to);\r\n }\r\n }}\r\n onTimeShift={(shiftBegin, shiftEnd, unitOfTime, type) => {\r\n let fromValue = this.props.fromValue ?? null;\r\n let toValue = this.props.toValue ?? null;\r\n\r\n const amount = type === TimeShiftDirection.INCREMENT ? 1 : -1;\r\n\r\n if (shiftBegin && fromValue) {\r\n fromValue = shiftDateValue(fromValue, amount, unitOfTime);\r\n }\r\n\r\n if (shiftEnd && toValue) {\r\n toValue = shiftDateValue(toValue, amount, unitOfTime);\r\n }\r\n\r\n this.onChange(fromValue, toValue);\r\n }}\r\n onEndIntervalChange={unit => {\r\n let to: Dayjs;\r\n if (unit === \"15minutes\") {\r\n const roundedMinutes = Math.floor(dayjs().minute() / 15) * 15;\r\n to = dayjs().startOf(\"hour\").minute(roundedMinutes).subtract(1, \"millisecond\");\r\n } else {\r\n to = dayjs().startOf(unit).subtract(1, \"millisecond\");\r\n }\r\n this.onChange(this.props.fromValue, to);\r\n }}\r\n />\r\n </div>\r\n }</WithCss>\r\n )\r\n }\r\n\r\n /** Renders the popup content - the whole component with {@link DateRangeInputProps.renderAsCalendar}. */\r\n renderPopup(): React.ReactElement {\r\n return (\r\n <div onFocus={this.props.onFocus} onBlur={this.props.onBlur}>\r\n {this.props.compact && this.renderAdvancedPart()}\r\n {this.state.mode === DateRangeInputMode.SIMPLE && this.renderSimplePart()}\r\n {this.state.mode === DateRangeInputMode.ADVANCED && this.renderAdvancedPart()}\r\n <div style={{height: 28, display: \"flex\", justifyContent: \"space-between\", alignItems: \"flex-end\"}}>\r\n <div>\r\n {!this.props.compact &&\r\n <Switch\r\n checked={this.state.mode === DateRangeInputMode.ADVANCED}\r\n onChange={checked => {\r\n const mode = checked ? DateRangeInputMode.ADVANCED : DateRangeInputMode.SIMPLE;\r\n this.setState({mode: mode});\r\n this.props.onModeChange?.(mode);\r\n }}\r\n checkedChildren={i18n(\"Advanced Mode\")}\r\n unCheckedChildren={i18n(\"Simple Mode\")}\r\n />\r\n }\r\n </div>\r\n {this.props.confirmButtonsRenderer?.()}\r\n </div>\r\n </div>\r\n );\r\n }\r\n\r\n /** Renders the two inputs with their icons and the saved-intervals dialog, without the popup. */\r\n renderInput() {\r\n const {\r\n className,\r\n fromValue,\r\n toValue,\r\n onChange,\r\n style,\r\n allowClear,\r\n renderAsCalendar,\r\n hidePopup,\r\n align,\r\n disabled,\r\n defaultMode,\r\n onModeChange,\r\n confirmButtonsRenderer,\r\n onPopupVisibleChange,\r\n showCustomIntervals,\r\n intervalStorage,\r\n size,\r\n status,\r\n variant,\r\n autoWidth,\r\n ...props\r\n } = this.props;\r\n\r\n return (\r\n <div style={{...(autoWidth ? {width: \"fit-content\"} : {}), ...style, padding: 0, position: \"relative\"}} className={className}\r\n onFocus={this.props.onFocus}\r\n onBlur={this.props.onBlur}>\r\n <WithCss useStyles={useStyles} props={{size, variant}}>\r\n {(context) =>\r\n <div style={{display: \"flex\", justifyContent: \"space-between\"}}\r\n className={context.cx(context.styles.baseLayout, {\r\n disabled: !!disabled,\r\n focused: !disabled && this.state.popupVisible,\r\n \"status-error\": status === \"error\",\r\n \"status-warning\": status === \"warning\",\r\n })}>\r\n <DateTimeInput value={fromValue} {...props}\r\n disabled={disabled}\r\n inputDisabled={this.state.popupVisible}\r\n allowClear={allowClear}\r\n variant={\"borderless\"}\r\n hidePopup={true}\r\n size={size}\r\n style={{width: \"auto\"}}\r\n autoWidth={autoWidth}\r\n inputStyle={{paddingRight: 0}}\r\n onChange={(value) => {\r\n this.props.onChange?.(value, this.props.toValue);\r\n }}\r\n />\r\n <span aria-label=\"to\" className={context.styles.rangeSeparator}><SwapRightOutlined/></span>\r\n <DateTimeInput value={toValue} {...props}\r\n disabled={disabled}\r\n inputDisabled={this.state.popupVisible}\r\n allowClear={allowClear}\r\n variant={\"borderless\"}\r\n hidePopup={true}\r\n size={size}\r\n style={{width: \"auto\"}}\r\n autoWidth={autoWidth}\r\n inputStyle={{paddingLeft: 0}}\r\n onChange={(value) => {\r\n this.props.onChange?.(this.props.fromValue, value);\r\n }}\r\n />\r\n {showCustomIntervals &&\r\n <Dropdown menu={this.buildIntervalMenu()} trigger={[\"click\"]} disabled={disabled}>\r\n <FieldTimeOutlined\r\n className={context.styles.suffixIcon}\r\n style={{cursor: disabled ? \"not-allowed\" : \"pointer\"}}\r\n onClick={event => event.stopPropagation()}\r\n />\r\n </Dropdown>\r\n }\r\n {!hidePopup && !renderAsCalendar &&\r\n <CalendarOutlined\r\n className={context.styles.suffixIcon}\r\n style={{cursor: (disabled || this.state.popupVisible) ? \"not-allowed\" : \"pointer\"}}\r\n onClick={(event) => {\r\n if (!disabled && document.createEvent) {\r\n if (this.state.popupVisible) {\r\n this.closePopup();\r\n } else {\r\n var ev = document.createEvent('HTMLEvents');\r\n ev.initEvent('contextmenu', true, false);\r\n event.target.dispatchEvent(ev);\r\n this.props.onFocus?.();\r\n }\r\n }\r\n }}\r\n />\r\n }\r\n </div>\r\n }\r\n </WithCss>\r\n {showCustomIntervals && this.state.configDialogOpen &&\r\n <SavedIntervalsDialog\r\n open={this.state.configDialogOpen}\r\n intervals={this.state.savedIntervals}\r\n onCancel={() => this.setState({configDialogOpen: false})}\r\n onSave={async (intervals) => {\r\n await this.runStorageOperation(provider => provider.saveIntervals(intervals));\r\n this.setState({savedIntervals: intervals, configDialogOpen: false});\r\n }}\r\n />\r\n }\r\n </div>\r\n );\r\n }\r\n\r\n render(): any {\r\n if (this.props.renderAsCalendar) {\r\n return this.renderPopup();\r\n } else if (this.props.hidePopup) {\r\n return this.renderInput();\r\n } else {\r\n return (\r\n <WithCss useStyles={usePopupStyles}>{({theme}) =>\r\n <Tooltip color={theme.colorBgElevated}\r\n key={\"date-range-popup-\" + this.state.popupKeyIndex}\r\n trigger={this.props.disabled ? [] : [\"contextMenu\"]}\r\n align={this.props.align}\r\n placement={this.props.placement}\r\n styles={{body: {width: \"fit-content\"}}}\r\n onOpenChange={(visible) => {\r\n if (visible) {\r\n this.props.onFocus?.();\r\n } else {\r\n this.props.onBlur?.();\r\n }\r\n this.setState({popupVisible: visible});\r\n }}\r\n title={this.renderPopup()}>\r\n {this.renderInput()}\r\n </Tooltip>\r\n }</WithCss>\r\n );\r\n }\r\n }\r\n}"]}
|
|
1
|
+
{"version":3,"file":"dateRangeInput.js","sourceRoot":"","sources":["../../../../components/date/dateRangeInput.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAc,MAAM,OAAO,CAAC;AACnC,OAAO,EAAC,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAa,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAC,MAAM,MAAM,CAAC;AAC9E,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,OAAO,aAAa,MAAM,2BAA2B,CAAC;AACtD,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,2BAA2B,EAAE,EAAC,kBAAkB,EAAC,MAAM,+BAA+B,CAAC;AAK9F,OAAO,OAA+B,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAC,YAAY,EAAC,MAAM,YAAY,CAAC;AACxC,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACtD,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EACH,aAAa,EAIb,eAAe,EACf,sBAAsB,GAEzB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,EAAC,KAAK,EAAE,GAAG,EAAC,EAAE,KAA2B,EAAE,EAAE;IACzE,MAAM,EAAC,IAAI,EAAE,OAAO,EAAC,GAAG,KAAK,CAAC;IAE9B,MAAM,SAAS,GAA0C;QACrD,KAAK,EAAE,KAAK,CAAC,eAAe;QAC5B,MAA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,EAC/B,MAAM,EAAE,EAAC,IAAI,EAAE,EAAC,KAAK,EAAE,aAAa,EAAC,EAAC,EACtC,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE;;oBACtB,IAAI,OAAO,EAAE,CAAC;wBACV,MAAA,MAAA,IAAI,CAAC,KAAK,EAAC,OAAO,kDAAI,CAAC;oBAC3B,CAAC;yBAAM,CAAC;wBACJ,MAAA,MAAA,IAAI,CAAC,KAAK,EAAC,MAAM,kDAAI,CAAC;oBAC1B,CAAC;oBACD,IAAI,CAAC,QAAQ,CAAC,EAAC,YAAY,EAAE,OAAO,EAAC,CAAC,CAAC;gBAC3C,CAAC,EACD,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,IAC7B,IAAI,CAAC,WAAW,EAAE,CACb,CACC,CACd,CAAC;QACN,CAAC;IACL,CAAC;CACJ","sourcesContent":["import React, {HTMLAttributes} from \"react\";\r\nimport dayjs, {Dayjs} from \"dayjs\";\r\nimport {CalendarOutlined, FieldTimeOutlined, SwapRightOutlined} from \"@ant-design/icons\";\r\nimport {Divider, Dropdown, MenuProps, Spin, Switch, Tag, Tooltip} from \"antd\";\r\nimport DateTimeInput from \"./dateTimeInput\";\r\nimport memoizeOne from \"memoize-one\";\r\nimport {TooltipPlacement} from \"antd/es/tooltip\";\r\nimport KeyboardUtils from \"../keyboard/keyboardUtils\";\r\nimport i18n from \"d2core/i18n/i18n\";\r\nimport DateRangeInputAdvancedPanel, {TimeShiftDirection} from \"./dateRangeInputAdvancedPanel\";\r\nimport {DurationUnitType} from \"d2core/dayjs/duration\";\r\nimport {SizeType} from \"antd/lib/config-provider/SizeContext\";\r\nimport {InputStatus} from \"antd/es/_util/statusUtils\";\r\nimport {Variant} from \"antd/es/config-provider\";\r\nimport WithCss, {WithCssInjectedProps} from \"../style/withCss\";\r\nimport {createStyles} from \"antd-style\";\r\nimport {LocaleHolder} from \"d2core/i18n/localeHolder\";\r\nimport SavedIntervalsDialog from \"./savedIntervalsDialog\";\r\nimport {\r\n addQuickRange,\r\n IntervalStorage,\r\n IntervalStorageProvider,\r\n QuickRange,\r\n resolveInterval,\r\n resolveIntervalStorage,\r\n SavedInterval,\r\n} from \"./savedIntervals\";\r\n\r\nconst useStyles = createStyles(({token, css}, props: WithCssInjectedProps) => {\r\n const {size, variant} = props;\r\n\r\n const heightMap: Record<NonNullable<SizeType>, number> = {\r\n small: token.controlHeightSM,\r\n middle: token.controlHeight,\r\n large: token.controlHeightLG,\r\n };\r\n\r\n // mirrors antd input component tokens `paddingInline(SM|LG)`\r\n const paddingInlineMap: Record<NonNullable<SizeType>, number> = {\r\n small: token.controlPaddingHorizontalSM - token.lineWidth,\r\n middle: token.paddingSM - token.lineWidth,\r\n large: token.controlPaddingHorizontal - token.lineWidth,\r\n };\r\n\r\n /**\r\n * One block per antd input variant, mirroring `antd/es/input/style/variants.js`.\r\n * `.focused` stands for the open-popup state, which antd renders as active - not disabled.\r\n */\r\n\r\n // genOutlinedStyle + genOutlinedStatusStyle\r\n const outlined = css`\r\n background-color: ${token.colorBgContainer};\r\n border: ${token.lineWidth}px ${token.lineType} ${token.colorBorder};\r\n border-radius: ${token.borderRadius}px;\r\n\r\n &:hover {\r\n border-color: ${token.colorPrimaryHover};\r\n background-color: ${token.colorBgContainer};\r\n }\r\n\r\n &:focus-within, &.focused {\r\n border-color: ${token.colorPrimary};\r\n box-shadow: 0 0 0 ${token.controlOutlineWidth}px ${token.controlOutline};\r\n background-color: ${token.colorBgContainer};\r\n }\r\n\r\n &.disabled {\r\n background-color: ${token.colorBgContainerDisabled};\r\n border-color: ${token.colorBorder};\r\n\r\n &:hover, &:focus-within {\r\n border-color: ${token.colorBorder};\r\n background-color: ${token.colorBgContainerDisabled};\r\n }\r\n }\r\n\r\n /* status must stay after .disabled - in antd a status border wins over the disabled one */\r\n &.status-error {\r\n border-color: ${token.colorError};\r\n\r\n &:hover {\r\n border-color: ${token.colorErrorBorderHover};\r\n }\r\n\r\n &:focus-within, &.focused {\r\n border-color: ${token.colorError};\r\n box-shadow: 0 0 0 ${token.controlOutlineWidth}px ${token.colorErrorOutline};\r\n }\r\n\r\n &.disabled, &.disabled:hover {\r\n border-color: ${token.colorError};\r\n }\r\n }\r\n\r\n &.status-warning {\r\n border-color: ${token.colorWarning};\r\n\r\n &:hover {\r\n border-color: ${token.colorWarningBorderHover};\r\n }\r\n\r\n &:focus-within, &.focused {\r\n border-color: ${token.colorWarning};\r\n box-shadow: 0 0 0 ${token.controlOutlineWidth}px ${token.colorWarningOutline};\r\n }\r\n\r\n &.disabled, &.disabled:hover {\r\n border-color: ${token.colorWarning};\r\n }\r\n }\r\n `;\r\n\r\n // genUnderlinedStyle - bottom border only, no radius, no focus shadow and, notably,\r\n // no disabled background fill\r\n const underlined = css`\r\n background-color: ${token.colorBgContainer};\r\n border-width: ${token.lineWidth}px 0;\r\n border-style: ${token.lineType} none;\r\n border-color: transparent transparent ${token.colorBorder} transparent;\r\n border-radius: 0;\r\n\r\n &:hover {\r\n border-color: transparent transparent ${token.colorPrimaryHover} transparent;\r\n background-color: ${token.colorBgContainer};\r\n }\r\n\r\n &:focus-within, &.focused {\r\n border-color: transparent transparent ${token.colorPrimary} transparent;\r\n background-color: ${token.colorBgContainer};\r\n }\r\n\r\n &.disabled {\r\n border-color: transparent transparent ${token.colorBorder} transparent;\r\n\r\n &:hover, &:focus-within {\r\n border-color: transparent transparent ${token.colorBorder} transparent;\r\n }\r\n }\r\n\r\n &.status-error {\r\n border-color: transparent transparent ${token.colorError} transparent;\r\n\r\n &:hover {\r\n border-color: transparent transparent ${token.colorErrorBorderHover} transparent;\r\n }\r\n\r\n &:focus-within, &.focused, &.disabled, &.disabled:hover {\r\n border-color: transparent transparent ${token.colorError} transparent;\r\n }\r\n }\r\n\r\n &.status-warning {\r\n border-color: transparent transparent ${token.colorWarning} transparent;\r\n\r\n &:hover {\r\n border-color: transparent transparent ${token.colorWarningBorderHover} transparent;\r\n }\r\n\r\n &:focus-within, &.focused, &.disabled, &.disabled:hover {\r\n border-color: transparent transparent ${token.colorWarning} transparent;\r\n }\r\n }\r\n `;\r\n\r\n // genFilledStyle + genFilledStatusStyle\r\n const filled = css`\r\n background: ${token.colorFillTertiary};\r\n border: ${token.lineWidth}px ${token.lineType} transparent;\r\n border-radius: ${token.borderRadius}px;\r\n\r\n &:hover {\r\n background: ${token.colorFillSecondary};\r\n }\r\n\r\n &:focus-within, &.focused {\r\n border-color: ${token.colorPrimary};\r\n background-color: ${token.colorBgContainer};\r\n }\r\n\r\n &.disabled {\r\n background-color: ${token.colorBgContainerDisabled};\r\n border-color: ${token.colorBorder};\r\n\r\n &:hover, &:focus-within {\r\n border-color: ${token.colorBorder};\r\n background-color: ${token.colorBgContainerDisabled};\r\n }\r\n }\r\n\r\n /* antd guards the filled status style with :not(-disabled), so a disabled input keeps\r\n the plain disabled background instead of the tinted one */\r\n &.status-error:not(.disabled) {\r\n background: ${token.colorErrorBg};\r\n border-color: transparent;\r\n\r\n && input {\r\n color: ${token.colorErrorText};\r\n }\r\n\r\n &:hover {\r\n background: ${token.colorErrorBgHover};\r\n }\r\n\r\n &:focus-within, &.focused {\r\n border-color: ${token.colorError};\r\n background-color: ${token.colorBgContainer};\r\n }\r\n }\r\n\r\n &.status-warning:not(.disabled) {\r\n background: ${token.colorWarningBg};\r\n border-color: transparent;\r\n\r\n && input {\r\n color: ${token.colorWarningText};\r\n }\r\n\r\n &:hover {\r\n background: ${token.colorWarningBgHover};\r\n }\r\n\r\n &:focus-within, &.focused {\r\n border-color: ${token.colorWarning};\r\n background-color: ${token.colorBgContainer};\r\n }\r\n }\r\n `;\r\n\r\n // genBorderlessStyle - only the text colour reacts to status, the affix is left alone\r\n const borderless = css`\r\n background: transparent;\r\n border: none;\r\n border-radius: ${token.borderRadius}px;\r\n\r\n &:focus-within, &.focused {\r\n outline: none;\r\n }\r\n\r\n /* the value lives in the nested inputs, so the colour has to reach them;\r\n disabled wins over status, the same way antd pickers behave */\r\n &.status-error:not(.disabled) {\r\n color: ${token.colorError};\r\n\r\n && input {\r\n color: ${token.colorError};\r\n }\r\n }\r\n\r\n &.status-warning:not(.disabled) {\r\n color: ${token.colorWarning};\r\n\r\n && input {\r\n color: ${token.colorWarning};\r\n }\r\n }\r\n `;\r\n\r\n const variantStyles = {outlined, underlined, filled, borderless}[variant];\r\n // underlined is the only variant antd renders without a radius\r\n const hasRadius = variant !== \"underlined\";\r\n // antd derives the height from padding + border, so a borderless input ends up 2 * lineWidth shorter\r\n const height = heightMap[size] - (variant === \"borderless\" ? 2 * token.lineWidth : 0);\r\n // antd colours prefix/suffix by status in every variant except borderless\r\n const statusAffix = variant !== \"borderless\";\r\n\r\n return {\r\n baseLayout: css`\r\n display: inline-block;\r\n position: relative;\r\n width: 100%;\r\n height: ${height}px;\r\n padding: 0 ${paddingInlineMap[size]}px 0 0;\r\n color: ${token.colorText};\r\n font-size: ${token.fontSize}px;\r\n line-height: ${token.lineHeight};\r\n transition: border ${token.motionDurationMid}, box-shadow ${token.motionDurationMid}, background ${token.motionDurationMid};\r\n\r\n ${variantStyles}\r\n\r\n &:hover, &:focus-within, &.focused {\r\n z-index: 3;\r\n }\r\n\r\n &:focus-within, &.focused {\r\n outline: 0;\r\n }\r\n\r\n /* inputs are disabled while the popup is open, but the value must stay readable */\r\n &.focused input[disabled] {\r\n color: ${token.colorText};\r\n -webkit-text-fill-color: ${token.colorText};\r\n cursor: default;\r\n }\r\n\r\n &.disabled {\r\n color: ${token.colorTextDisabled};\r\n box-shadow: none;\r\n opacity: 1;\r\n cursor: not-allowed;\r\n\r\n &:hover, &:focus-within {\r\n box-shadow: none;\r\n }\r\n }\r\n\r\n .ant-space-compact & {\r\n border-radius: 0;\r\n }\r\n\r\n .ant-space-compact > *:not(:last-child) & {\r\n width: calc(100% + ${token.lineWidth}px);\r\n }\r\n\r\n ${hasRadius ? css`\r\n .ant-space-compact > *:first-child & {\r\n border-start-start-radius: ${token.borderRadius}px;\r\n border-end-start-radius: ${token.borderRadius}px;\r\n border-inline-end-width: ${token.lineWidth}px;\r\n }\r\n\r\n .ant-space-compact > *:last-child & {\r\n border-start-end-radius: ${token.borderRadius}px;\r\n border-end-end-radius: ${token.borderRadius}px;\r\n }\r\n\r\n .ant-space-compact > *:first-child:last-child & {\r\n border-radius: ${token.borderRadius}px;\r\n }\r\n ` : \"\"}\r\n `,\r\n // mirrors antd `.ant-picker-range-separator` + `.ant-picker-separator`\r\n rangeSeparator: css`\r\n display: inline-flex;\r\n align-self: center;\r\n align-items: center;\r\n justify-content: center;\r\n box-sizing: content-box;\r\n width: 1em;\r\n height: ${token.fontSizeLG}px;\r\n padding: 0 ${token.paddingXS}px;\r\n color: ${token.colorTextQuaternary};\r\n /* antd fixes the separator at fontSizeLG for every size */\r\n font-size: ${token.fontSizeLG}px;\r\n line-height: 1;\r\n cursor: default;\r\n\r\n .focused & {\r\n color: ${token.colorIcon};\r\n }\r\n\r\n .disabled & {\r\n color: ${token.colorTextDisabled};\r\n cursor: not-allowed;\r\n }\r\n `,\r\n suffixIcon: css`\r\n align-self: center;\r\n margin-inline-start: ${token.paddingXS / 2}px;\r\n color: ${token.colorTextQuaternary};\r\n line-height: 1;\r\n\r\n ${statusAffix ? css`\r\n .status-error & {\r\n color: ${token.colorError};\r\n }\r\n\r\n .status-warning & {\r\n color: ${token.colorWarning};\r\n }\r\n ` : \"\"}\r\n\r\n .disabled & {\r\n color: ${token.colorTextDisabled};\r\n }\r\n `,\r\n }\r\n})\r\n\r\nconst usePopupStyles = createStyles(({token, css}) => {\r\n return {\r\n presetsBar: css`\r\n border-top: ${token.lineWidth}px ${token.lineType} ${token.colorSplit};\r\n padding-top: 6px;\r\n `,\r\n advancedSeparator: css`\r\n margin: 4px;\r\n color: ${token.colorTextSecondary};\r\n text-align: center;\r\n `,\r\n }\r\n})\r\n\r\n/** Layout of the {@link DateRangeInput} popup. */\r\nexport enum DateRangeInputMode {\r\n /** Two month calendars (click a day or drag across days) plus the {@link DateRangeInputProps.ranges} presets. */\r\n SIMPLE,\r\n /** Two date-time inputs plus buttons for interval begin/end, duration and time shift. */\r\n ADVANCED,\r\n}\r\n\r\n/**\r\n * Props of {@link DateRangeInput}. Remaining HTML attributes are forwarded to the inner {@link DateTimeInput}s,\r\n * except `style` and `className`, which apply to the root element.\r\n */\r\nexport interface DateRangeInputProps extends Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> {\r\n /** dayjs format of both bounds - see {@link DateTimeInput} `mask` for the supported tokens. */\r\n mask: string\r\n /** Start of the range (controlled), in local time. */\r\n fromValue: Dayjs | null\r\n /** End of the range (controlled), in local time. The component does not enforce `fromValue <= toValue`. */\r\n toValue: Dayjs | null\r\n /**\r\n * Called with both bounds whenever either one changes: typing in one of the inputs, picking or dragging\r\n * days in the calendars (the time of day of the current bounds is kept - 00:00:00.000 / 23:59:59.999 when\r\n * they are `null`), a preset from {@link DateRangeInputProps.ranges}, an advanced-mode button or a saved interval.\r\n * Advanced-mode buttons and saved intervals clamp the result to {@link DateRangeInputProps.minDateTime}/{@link DateRangeInputProps.maxDateTime}.\r\n */\r\n onChange?: (fromValue: Dayjs | null, toValue: Dayjs | null) => void\r\n /** Called with the raw text of a bound whose typed text is not a valid (or allowed) value. */\r\n onInvalidValue?: (input: string) => void\r\n /** Disables both inputs and the popup. */\r\n disabled?: boolean\r\n /** Earliest allowed value of both bounds (inclusive). */\r\n minDateTime?: Dayjs\r\n /** Latest allowed value of both bounds (inclusive). */\r\n maxDateTime?: Dayjs\r\n /** Allows a bound to be cleared by emptying its input; it is then reported as `null`. */\r\n allowClear?: boolean\r\n /** Preset ranges shown as clickable tags in the {@link DateRangeInputMode.SIMPLE} popup; the key is the label, the function returns `[from, to]` when clicked. */\r\n ranges?: { [rangeName: string]: () => [Dayjs, Dayjs] }\r\n /** antd control size. */\r\n size?: SizeType;\r\n /** antd validation status of the whole range input. */\r\n status?: InputStatus\r\n /** antd input variant of the whole range input; defaults to the `ConfigProvider` one. */\r\n variant?: Variant\r\n /**\r\n * Compact popup: always the advanced layout without the mode switch, the separator and the \"Interval End\"\r\n * column; {@link DateRangeInputProps.defaultMode} is ignored.\r\n */\r\n compact?: boolean\r\n /**\r\n * Sizes the component to the rendered {@link DateRangeInputProps.mask} instead of filling the parent: both\r\n * inputs are as wide as the formatted value and the box shrinks around them. A `width` in `style` still wins.\r\n */\r\n autoWidth?: boolean\r\n\r\n /** Renders only the two inputs - no calendar icon and no popup. */\r\n hidePopup?: boolean\r\n /** Renders only the popup content inline, without the inputs. */\r\n renderAsCalendar?: boolean\r\n /** Placement of the popup relative to the input. */\r\n placement?: TooltipPlacement\r\n /** Fine alignment of the popup (rc-trigger `align`), applied on top of {@link DateRangeInputProps.placement}. */\r\n align?: {\r\n points?: [string, string];\r\n offset?: [number, number];\r\n targetOffset?: [number, number];\r\n overflow?: {\r\n adjustX?: boolean;\r\n adjustY?: boolean;\r\n };\r\n useCssRight?: boolean;\r\n useCssBottom?: boolean;\r\n useCssTransform?: boolean;\r\n }\r\n\r\n /**\r\n * Initial popup mode (uncontrolled - read only on mount); the user switches it with the switch in the popup.\r\n * @default DateRangeInputMode.SIMPLE\r\n */\r\n defaultMode?: DateRangeInputMode\r\n\r\n /**\r\n * Shows an icon opening a dropdown with: saving the current range to quick access (the latest\r\n * `MAX_QUICK_RANGES` are kept), the quick-access ranges, the {@link SavedIntervalsDialog} and the\r\n * saved relative intervals. Intervals are loaded when this becomes `true` and whenever {@link DateRangeInputProps.intervalStorage} changes.\r\n */\r\n showCustomIntervals?: boolean\r\n /**\r\n * Where quick-access ranges and saved intervals are persisted - see {@link IntervalStorage}. Compared by\r\n * reference, so pass a stable object: a new one reloads the intervals.\r\n * @default true\r\n */\r\n intervalStorage?: IntervalStorage\r\n\r\n /** Called when the user toggles the popup between {@link DateRangeInputMode.SIMPLE} and {@link DateRangeInputMode.ADVANCED}. */\r\n onModeChange?(mode: DateRangeInputMode): void\r\n\r\n /** Called when the popup opens and when focus enters the inputs or the popup content. */\r\n onFocus?(): void\r\n\r\n /** Called when the popup closes and when focus leaves the inputs or the popup content. */\r\n onBlur?(): void\r\n\r\n /** Renders extra content (e.g. confirm buttons) at the right side of the popup footer. */\r\n confirmButtonsRenderer?(): React.ReactNode\r\n\r\n /** Called when the popup opens or closes. */\r\n onPopupVisibleChange?(visible: boolean): void\r\n}\r\n\r\ninterface DateRangeInputState {\r\n valid: boolean\r\n selectionStartDate: Dayjs | null\r\n popupKeyIndex: number\r\n popupVisible: boolean\r\n\r\n mode?: DateRangeInputMode\r\n\r\n quickRanges: QuickRange[]\r\n savedIntervals: SavedInterval[]\r\n intervalsLoading: boolean\r\n configDialogOpen: boolean\r\n}\r\n\r\n// a value within 1 minute before the end of a month (23:59, 23:59:59, 23:59:59.999) counts as the end of the month\r\nconst MONTH_END_TOLERANCE_MS = 60_000;\r\n// units whose length depends on the length of a month\r\nconst MONTH_BASED_UNITS: DurationUnitType[] = [\"month\", \"months\", \"M\", \"year\", \"years\", \"y\"];\r\n\r\n/**\r\n * Shifts the value by `amount` units of `unit`. If the value lies at the end of a month and is shifted by a month\r\n * or a year, it stays at the end of the month after the shift (30.09. 23:59:59.999 - 1 month = 31.08. 23:59:59.999, not 30.08.).\r\n * Other values are shifted normally (15.09. - 1 month = 15.08.).\r\n */\r\nfunction shiftDateValue(value: Dayjs, amount: number, unit: DurationUnitType): Dayjs {\r\n if (MONTH_BASED_UNITS.includes(unit)) {\r\n const nextMonthStart = value.endOf(\"month\").add(1, \"millisecond\");\r\n const gap = nextMonthStart.diff(value);\r\n if (gap <= MONTH_END_TOLERANCE_MS) {\r\n return nextMonthStart.add(amount, unit).subtract(gap, \"millisecond\");\r\n }\r\n }\r\n return value.add(amount, unit);\r\n}\r\n\r\n/**\r\n * Controlled date-time range input: two masked {@link DateTimeInput}s in one antd-styled box with a popup\r\n * that opens on right-click or via the calendar icon. The popup offers calendars and presets\r\n * ({@link DateRangeInputMode.SIMPLE}) or interval shortcuts ({@link DateRangeInputMode.ADVANCED}).\r\n * Every change is reported immediately; use `DateRangeInputConfirm` to apply changes only on confirmation.\r\n *\r\n * @example\r\n * const [range, setRange] = useState<[Dayjs | null, Dayjs | null]>([dayjs().startOf(\"day\"), dayjs().endOf(\"day\")]);\r\n *\r\n * <DateRangeInput\r\n * mask={LocaleHolder.getDateTimeFormat(true, true)}\r\n * fromValue={range[0]}\r\n * toValue={range[1]}\r\n * onChange={(from, to) => setRange([from, to])}\r\n * ranges={DateTimeUtils.getRanges([DateTimeInterval.DAY_ACT, DateTimeInterval.WEEK_ACT])}\r\n * />\r\n */\r\nexport default class DateRangeInput extends React.Component<DateRangeInputProps, DateRangeInputState> {\r\n private storageProvider: IntervalStorageProvider | null;\r\n\r\n constructor(props: Readonly<DateRangeInputProps>) {\r\n super(props);\r\n this.state = {\r\n valid: !!props.fromValue && props.fromValue.isValid() && !!props.toValue && props.toValue.isValid(),\r\n selectionStartDate: null,\r\n popupKeyIndex: 0,\r\n popupVisible: false,\r\n\r\n mode: props.compact ? undefined : props.defaultMode ?? DateRangeInputMode.SIMPLE,\r\n\r\n quickRanges: [],\r\n savedIntervals: [],\r\n intervalsLoading: false,\r\n configDialogOpen: false,\r\n };\r\n this.storageProvider = resolveIntervalStorage(props.intervalStorage);\r\n this.getDefaultSelectedDateForFromPanel = memoizeOne(this.getDefaultSelectedDateForFromPanel.bind(this));\r\n }\r\n\r\n componentDidMount() {\r\n if (this.props.showCustomIntervals) {\r\n this.loadIntervals();\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps: Readonly<DateRangeInputProps>, prevState: Readonly<DateRangeInputState>) {\r\n if (prevState.popupVisible !== this.state.popupVisible && this.props.onPopupVisibleChange) {\r\n this.props.onPopupVisibleChange(this.state.popupVisible);\r\n }\r\n\r\n if (prevProps.intervalStorage !== this.props.intervalStorage) {\r\n this.storageProvider = resolveIntervalStorage(this.props.intervalStorage);\r\n\r\n if (this.props.showCustomIntervals) {\r\n this.loadIntervals();\r\n }\r\n } else if (!prevProps.showCustomIntervals && this.props.showCustomIntervals) {\r\n this.loadIntervals();\r\n }\r\n }\r\n\r\n private async loadIntervals() {\r\n const provider = this.storageProvider;\r\n\r\n if (!provider) {\r\n return;\r\n }\r\n\r\n this.setState({intervalsLoading: true});\r\n\r\n try {\r\n const [quickRanges, savedIntervals] = await Promise.all([provider.loadQuickRanges(), provider.loadIntervals()]);\r\n this.setState({quickRanges, savedIntervals});\r\n } finally {\r\n this.setState({intervalsLoading: false});\r\n }\r\n }\r\n\r\n private async runStorageOperation(operation: (provider: IntervalStorageProvider) => Promise<void>) {\r\n const provider = this.storageProvider;\r\n\r\n if (!provider) {\r\n return;\r\n }\r\n\r\n this.setState({intervalsLoading: true});\r\n\r\n try {\r\n await operation(provider);\r\n } finally {\r\n this.setState({intervalsLoading: false});\r\n }\r\n }\r\n\r\n private saveCurrentRangeToQuickAccess() {\r\n const {fromValue, toValue} = this.props;\r\n\r\n if (!fromValue || !toValue) {\r\n return;\r\n }\r\n\r\n const quickRanges = addQuickRange(this.state.quickRanges, fromValue, toValue);\r\n\r\n this.setState({quickRanges});\r\n this.runStorageOperation(provider => provider.saveQuickRanges(quickRanges));\r\n }\r\n\r\n private buildIntervalMenu(): MenuProps {\r\n if (this.state.intervalsLoading) {\r\n return {items: [{key: \"loading\", label: <Spin size=\"small\"/>, disabled: true}]};\r\n }\r\n\r\n const dateMask = LocaleHolder.getDateFormat(true);\r\n const items: NonNullable<MenuProps[\"items\"]> = [{\r\n key: \"save-current\",\r\n label: i18n(\"Save Current Interval to Quick Access\"),\r\n disabled: !this.props.fromValue || !this.props.toValue,\r\n }];\r\n\r\n if (this.state.quickRanges.length > 0) {\r\n items.push({type: \"divider\"});\r\n this.state.quickRanges.forEach((range, index) => {\r\n items.push({\r\n key: `quick-${index}`,\r\n label: `${dayjs(range.from).format(dateMask)} - ${dayjs(range.to).format(dateMask)}`,\r\n });\r\n });\r\n }\r\n\r\n items.push({type: \"divider\"});\r\n items.push({key: \"config\", label: i18n(\"Saved Intervals Configuration\")});\r\n\r\n if (this.state.savedIntervals.length > 0) {\r\n items.push({type: \"divider\"});\r\n this.state.savedIntervals.forEach(interval => {\r\n const resolved = resolveInterval(interval);\r\n\r\n items.push({\r\n key: `interval-${interval.id}`,\r\n disabled: !resolved,\r\n label: resolved\r\n ? `${interval.name} (${resolved[0].format(dateMask)} - ${resolved[1].format(dateMask)})`\r\n : interval.name,\r\n });\r\n });\r\n }\r\n\r\n return {\r\n items,\r\n onClick: ({key}) => this.onIntervalMenuClick(key),\r\n };\r\n }\r\n\r\n private onIntervalMenuClick(key: string) {\r\n if (key === \"save-current\") {\r\n this.saveCurrentRangeToQuickAccess();\r\n } else if (key === \"config\") {\r\n this.setState({configDialogOpen: true});\r\n } else if (key.startsWith(\"quick-\")) {\r\n const range = this.state.quickRanges[Number(key.substring(\"quick-\".length))];\r\n\r\n if (range) {\r\n this.onChange(dayjs(range.from), dayjs(range.to));\r\n }\r\n } else if (key.startsWith(\"interval-\")) {\r\n const interval = this.state.savedIntervals.find(item => item.id === key.substring(\"interval-\".length));\r\n const resolved = interval ? resolveInterval(interval) : null;\r\n\r\n if (resolved) {\r\n this.onChange(resolved[0], resolved[1]);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Day whose month the left (\"from\") calendar shows: one month before `fromDate` when both bounds fall on the\r\n * same day (so the two calendars show different months), otherwise `fromDate` (one month before today when `null`).\r\n */\r\n getDefaultSelectedDateForFromPanel(fromDate: Dayjs | null, toDate: Dayjs | null): Dayjs {\r\n if (!!fromDate && !!toDate && fromDate.isSame(toDate, \"date\")) {\r\n return fromDate.clone().subtract(1, \"month\");\r\n } else {\r\n return fromDate ?? dayjs().startOf(\"day\").subtract(1, \"month\");\r\n }\r\n }\r\n\r\n private getFromValue(date: Dayjs) {\r\n return (this.props.fromValue?.clone() ?? dayjs().startOf(\"day\")).year(date.year()).month(date.month()).date(date.date());\r\n }\r\n\r\n private getToValue(date: Dayjs) {\r\n return (this.props.toValue?.clone() ?? dayjs().endOf(\"day\")).year(date.year()).month(date.month()).date(date.date());\r\n }\r\n\r\n /** Closes the popup and calls {@link DateRangeInputProps.onPopupVisibleChange} with `false`. */\r\n closePopup() {\r\n // close tooltip\r\n this.setState({popupKeyIndex: this.state.popupKeyIndex + 1, popupVisible: false});\r\n this.props.onPopupVisibleChange?.(false);\r\n }\r\n\r\n private onChange(fromValue: Dayjs | null, toValue: Dayjs | null) {\r\n if (this.props.minDateTime && fromValue?.isBefore(this.props.minDateTime)) {\r\n fromValue = this.props.minDateTime;\r\n }\r\n if (this.props.maxDateTime && toValue?.isAfter(this.props.maxDateTime)) {\r\n toValue = this.props.maxDateTime;\r\n }\r\n this.props.onChange?.(fromValue, toValue);\r\n }\r\n\r\n private renderSimplePart() {\r\n const {\r\n fromValue,\r\n toValue,\r\n onChange,\r\n style,\r\n allowClear,\r\n renderAsCalendar,\r\n hidePopup,\r\n align,\r\n defaultMode,\r\n onModeChange,\r\n confirmButtonsRenderer,\r\n onPopupVisibleChange,\r\n showCustomIntervals,\r\n intervalStorage,\r\n autoWidth,\r\n ...props\r\n } = this.props;\r\n const markedDateInterval: [Dayjs, Dayjs] | undefined = this.props.fromValue && this.props.toValue ? [this.props.fromValue, this.props.toValue] : undefined;\r\n\r\n return (\r\n <WithCss useStyles={usePopupStyles}>{(context) =>\r\n <div>\r\n <div style={{display: \"flex\"}}>\r\n <DateTimeInput value={fromValue} {...props}\r\n allowClear={allowClear}\r\n renderAsCalendar\r\n style={{width: \"100%\"}}\r\n onChange={(date) => {\r\n if (date) {\r\n const fromValue = this.getFromValue(date);\r\n const toValue = this.getToValue(date);\r\n this.props.onChange?.(fromValue, toValue);\r\n }\r\n }}\r\n defaultSelectedDate={this.getDefaultSelectedDateForFromPanel(fromValue, toValue)}\r\n markedDateInterval={markedDateInterval}\r\n onDateItemMouseDown={(date) => {\r\n this.setState({selectionStartDate: date});\r\n const dateFrom = this.getFromValue(date);\r\n const dateTo = this.getToValue(date);\r\n this.props.onChange?.(dateFrom, dateTo);\r\n }}\r\n onDateItemMouseOver={(date) => {\r\n if (KeyboardUtils.isMouseDown() && !!this.state.selectionStartDate) {\r\n let dateFrom: Dayjs;\r\n let dateTo: Dayjs;\r\n if (this.state.selectionStartDate.isBefore(date)) {\r\n dateFrom = this.state.selectionStartDate;\r\n dateTo = date;\r\n } else {\r\n dateFrom = date;\r\n dateTo = this.state.selectionStartDate;\r\n }\r\n dateFrom = this.getFromValue(dateFrom);\r\n dateTo = this.getToValue(dateTo);\r\n this.props.onChange?.(dateFrom, dateTo);\r\n }\r\n }}\r\n onDateItemMouseUp={(_date) => {\r\n this.setState({selectionStartDate: null});\r\n }}\r\n ignoreKeyStrokes\r\n />\r\n <Divider type=\"vertical\" style={{height: \"auto\"}}/>\r\n <DateTimeInput value={toValue} {...props}\r\n renderAsCalendar\r\n allowClear={allowClear}\r\n style={{width: \"100%\"}}\r\n onChange={(date) => {\r\n if (date) {\r\n const fromValue = this.getFromValue(date);\r\n const toValue = this.getToValue(date);\r\n this.props.onChange?.(fromValue, toValue);\r\n }\r\n }}\r\n markedDateInterval={markedDateInterval}\r\n onDateItemMouseDown={(date) => {\r\n this.setState({selectionStartDate: date});\r\n const dateFrom = this.getFromValue(date);\r\n const dateTo = this.getToValue(date);\r\n this.props.onChange?.(dateFrom, dateTo);\r\n }}\r\n onDateItemMouseOver={(date) => {\r\n if (KeyboardUtils.isMouseDown() && !!this.state.selectionStartDate) {\r\n let dateFrom: Dayjs;\r\n let dateTo: Dayjs;\r\n if (this.state.selectionStartDate.isBefore(date)) {\r\n dateFrom = this.state.selectionStartDate;\r\n dateTo = date;\r\n } else {\r\n dateFrom = date;\r\n dateTo = this.state.selectionStartDate;\r\n }\r\n dateFrom = this.getFromValue(dateFrom);\r\n dateTo = this.getToValue(dateTo);\r\n this.props.onChange?.(dateFrom, dateTo);\r\n }\r\n }}\r\n onDateItemMouseUp={(_date) => {\r\n this.setState({selectionStartDate: null});\r\n }}\r\n ignoreKeyStrokes\r\n />\r\n </div>\r\n <div className={context.styles.presetsBar}>\r\n {\r\n this.props.ranges && Object.keys(this.props.ranges).map((rangeName, index) => {\r\n return (<Tag style={{userSelect: \"none\", cursor: \"pointer\"}} color=\"blue\"\r\n key={`range-${index}`}\r\n onClick={() => {\r\n const rangeFunction = this.props.ranges?.[rangeName];\r\n if (rangeFunction) {\r\n const range = rangeFunction();\r\n this.props.onChange?.(range[0], range[1]);\r\n }\r\n }}>\r\n {rangeName}</Tag>);\r\n })\r\n }\r\n </div>\r\n </div>\r\n }</WithCss>\r\n )\r\n }\r\n\r\n private renderAdvancedPart() {\r\n const {\r\n fromValue,\r\n toValue,\r\n onChange,\r\n style,\r\n allowClear,\r\n renderAsCalendar,\r\n hidePopup,\r\n align,\r\n defaultMode,\r\n compact,\r\n onModeChange,\r\n confirmButtonsRenderer,\r\n onPopupVisibleChange,\r\n showCustomIntervals,\r\n intervalStorage,\r\n autoWidth,\r\n ranges,\r\n ...props\r\n } = this.props;\r\n return (\r\n <WithCss useStyles={usePopupStyles}>{(context) =>\r\n <div>\r\n <div style={{display: \"flex\", alignItems: \"center\", gap: 8}}>\r\n <DateTimeInput\r\n {...props}\r\n style={{flexGrow: 1}}\r\n size=\"small\"\r\n autoWidth\r\n value={fromValue}\r\n onChange={(value) => {\r\n this.props.onChange?.(value, this.props.toValue);\r\n }}\r\n />\r\n {!compact &&\r\n <span className={context.styles.advancedSeparator}>{\"\\u27F7\"}</span>\r\n }\r\n <DateTimeInput\r\n {...props}\r\n style={{flexGrow: 1}}\r\n size=\"small\"\r\n autoWidth\r\n value={toValue}\r\n onChange={(value) => {\r\n this.props.onChange?.(this.props.fromValue, value);\r\n }}\r\n />\r\n </div>\r\n <DateRangeInputAdvancedPanel\r\n compact={compact}\r\n onBeginIntervalChange={unit => {\r\n let from: Dayjs;\r\n if (unit === \"15minutes\") {\r\n const roundedMinutes = Math.floor(dayjs().minute() / 15) * 15;\r\n from = dayjs().startOf(\"hour\").minute(roundedMinutes);\r\n } else {\r\n from = dayjs().startOf(unit);\r\n }\r\n this.onChange(from, this.props.toValue);\r\n }}\r\n onIntervalDurationChange={unitOfTime => {\r\n if (this.props.fromValue) {\r\n let to: Dayjs = this.props.fromValue.clone().add(1, unitOfTime).subtract(1, \"millisecond\")\r\n this.onChange(this.props.fromValue, to);\r\n }\r\n }}\r\n onTimeShift={(shiftBegin, shiftEnd, unitOfTime, type) => {\r\n let fromValue = this.props.fromValue ?? null;\r\n let toValue = this.props.toValue ?? null;\r\n\r\n const amount = type === TimeShiftDirection.INCREMENT ? 1 : -1;\r\n\r\n if (shiftBegin && fromValue) {\r\n fromValue = shiftDateValue(fromValue, amount, unitOfTime);\r\n }\r\n\r\n if (shiftEnd && toValue) {\r\n toValue = shiftDateValue(toValue, amount, unitOfTime);\r\n }\r\n\r\n this.onChange(fromValue, toValue);\r\n }}\r\n onEndIntervalChange={unit => {\r\n let to: Dayjs;\r\n if (unit === \"15minutes\") {\r\n const roundedMinutes = Math.floor(dayjs().minute() / 15) * 15;\r\n to = dayjs().startOf(\"hour\").minute(roundedMinutes).subtract(1, \"millisecond\");\r\n } else {\r\n to = dayjs().startOf(unit).subtract(1, \"millisecond\");\r\n }\r\n this.onChange(this.props.fromValue, to);\r\n }}\r\n />\r\n </div>\r\n }</WithCss>\r\n )\r\n }\r\n\r\n /** Renders the popup content - the whole component with {@link DateRangeInputProps.renderAsCalendar}. */\r\n renderPopup(): React.ReactElement {\r\n return (\r\n <div onFocus={this.props.onFocus} onBlur={this.props.onBlur}>\r\n {this.props.compact && this.renderAdvancedPart()}\r\n {this.state.mode === DateRangeInputMode.SIMPLE && this.renderSimplePart()}\r\n {this.state.mode === DateRangeInputMode.ADVANCED && this.renderAdvancedPart()}\r\n <div style={{height: 28, display: \"flex\", justifyContent: \"space-between\", alignItems: \"flex-end\"}}>\r\n <div>\r\n {!this.props.compact &&\r\n <Switch\r\n checked={this.state.mode === DateRangeInputMode.ADVANCED}\r\n onChange={checked => {\r\n const mode = checked ? DateRangeInputMode.ADVANCED : DateRangeInputMode.SIMPLE;\r\n this.setState({mode: mode});\r\n this.props.onModeChange?.(mode);\r\n }}\r\n checkedChildren={i18n(\"Advanced Mode\")}\r\n unCheckedChildren={i18n(\"Simple Mode\")}\r\n />\r\n }\r\n </div>\r\n {this.props.confirmButtonsRenderer?.()}\r\n </div>\r\n </div>\r\n );\r\n }\r\n\r\n /** Renders the two inputs with their icons and the saved-intervals dialog, without the popup. */\r\n renderInput() {\r\n const {\r\n className,\r\n fromValue,\r\n toValue,\r\n onChange,\r\n style,\r\n allowClear,\r\n renderAsCalendar,\r\n hidePopup,\r\n align,\r\n disabled,\r\n defaultMode,\r\n onModeChange,\r\n confirmButtonsRenderer,\r\n onPopupVisibleChange,\r\n showCustomIntervals,\r\n intervalStorage,\r\n size,\r\n status,\r\n variant,\r\n autoWidth,\r\n ranges,\r\n compact,\r\n ...props\r\n } = this.props;\r\n\r\n return (\r\n <div style={{...(autoWidth ? {width: \"fit-content\"} : {}), ...style, padding: 0, position: \"relative\"}} className={className}\r\n onFocus={this.props.onFocus}\r\n onBlur={this.props.onBlur}>\r\n <WithCss useStyles={useStyles} props={{size, variant}}>\r\n {(context) =>\r\n <div style={{display: \"flex\", justifyContent: \"space-between\"}}\r\n className={context.cx(context.styles.baseLayout, {\r\n disabled: !!disabled,\r\n focused: !disabled && this.state.popupVisible,\r\n \"status-error\": status === \"error\",\r\n \"status-warning\": status === \"warning\",\r\n })}>\r\n <DateTimeInput value={fromValue} {...props}\r\n disabled={disabled}\r\n inputDisabled={this.state.popupVisible}\r\n allowClear={allowClear}\r\n variant={\"borderless\"}\r\n hidePopup={true}\r\n size={size}\r\n style={{width: \"auto\"}}\r\n autoWidth={autoWidth}\r\n inputStyle={{paddingRight: 0}}\r\n onChange={(value) => {\r\n this.props.onChange?.(value, this.props.toValue);\r\n }}\r\n />\r\n <span aria-label=\"to\" className={context.styles.rangeSeparator}><SwapRightOutlined/></span>\r\n <DateTimeInput value={toValue} {...props}\r\n disabled={disabled}\r\n inputDisabled={this.state.popupVisible}\r\n allowClear={allowClear}\r\n variant={\"borderless\"}\r\n hidePopup={true}\r\n size={size}\r\n style={{width: \"auto\"}}\r\n autoWidth={autoWidth}\r\n inputStyle={{paddingLeft: 0}}\r\n onChange={(value) => {\r\n this.props.onChange?.(this.props.fromValue, value);\r\n }}\r\n />\r\n {showCustomIntervals &&\r\n <Dropdown menu={this.buildIntervalMenu()} trigger={[\"click\"]} disabled={disabled}>\r\n <FieldTimeOutlined\r\n className={context.styles.suffixIcon}\r\n style={{cursor: disabled ? \"not-allowed\" : \"pointer\"}}\r\n onClick={event => event.stopPropagation()}\r\n />\r\n </Dropdown>\r\n }\r\n {!hidePopup && !renderAsCalendar &&\r\n <CalendarOutlined\r\n className={context.styles.suffixIcon}\r\n style={{cursor: (disabled || this.state.popupVisible) ? \"not-allowed\" : \"pointer\"}}\r\n onClick={(event) => {\r\n if (!disabled && document.createEvent) {\r\n if (this.state.popupVisible) {\r\n this.closePopup();\r\n } else {\r\n var ev = document.createEvent('HTMLEvents');\r\n ev.initEvent('contextmenu', true, false);\r\n event.target.dispatchEvent(ev);\r\n this.props.onFocus?.();\r\n }\r\n }\r\n }}\r\n />\r\n }\r\n </div>\r\n }\r\n </WithCss>\r\n {showCustomIntervals && this.state.configDialogOpen &&\r\n <SavedIntervalsDialog\r\n open={this.state.configDialogOpen}\r\n intervals={this.state.savedIntervals}\r\n onCancel={() => this.setState({configDialogOpen: false})}\r\n onSave={async (intervals) => {\r\n await this.runStorageOperation(provider => provider.saveIntervals(intervals));\r\n this.setState({savedIntervals: intervals, configDialogOpen: false});\r\n }}\r\n />\r\n }\r\n </div>\r\n );\r\n }\r\n\r\n render(): any {\r\n if (this.props.renderAsCalendar) {\r\n return this.renderPopup();\r\n } else if (this.props.hidePopup) {\r\n return this.renderInput();\r\n } else {\r\n return (\r\n <WithCss useStyles={usePopupStyles}>{({theme}) =>\r\n <Tooltip color={theme.colorBgElevated}\r\n key={\"date-range-popup-\" + this.state.popupKeyIndex}\r\n trigger={this.props.disabled ? [] : [\"contextMenu\"]}\r\n align={this.props.align}\r\n placement={this.props.placement}\r\n styles={{body: {width: \"fit-content\"}}}\r\n onOpenChange={(visible) => {\r\n if (visible) {\r\n this.props.onFocus?.();\r\n } else {\r\n this.props.onBlur?.();\r\n }\r\n this.setState({popupVisible: visible});\r\n }}\r\n title={this.renderPopup()}>\r\n {this.renderInput()}\r\n </Tooltip>\r\n }</WithCss>\r\n );\r\n }\r\n }\r\n}"]}
|
|
@@ -6,14 +6,25 @@ import { createStyles } from "antd-style";
|
|
|
6
6
|
import WithCss from "../style/withCss";
|
|
7
7
|
const useStyles = createStyles(({ token, css }) => {
|
|
8
8
|
return {
|
|
9
|
-
panel: css `
|
|
10
|
-
color: ${token.colorTextSecondary};
|
|
9
|
+
panel: css `
|
|
10
|
+
color: ${token.colorTextSecondary};
|
|
11
11
|
`,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
// the popup grows with a long date-time mask - the columns share the extra width, never below their content
|
|
13
|
+
columns: css `
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: flex-start;
|
|
16
|
+
gap: 24px;
|
|
17
|
+
margin-bottom: 8px;
|
|
14
18
|
`,
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
column: css `
|
|
20
|
+
flex: 1 1 0;
|
|
21
|
+
min-width: max-content;
|
|
22
|
+
`,
|
|
23
|
+
timeShiftIcon: css `
|
|
24
|
+
color: ${token.colorTextSecondary};
|
|
25
|
+
`,
|
|
26
|
+
timeShiftIconChecked: css `
|
|
27
|
+
color: ${token.colorPrimary};
|
|
17
28
|
`,
|
|
18
29
|
};
|
|
19
30
|
});
|
|
@@ -101,27 +112,27 @@ export default class DateRangeInputAdvancedPanel extends React.Component {
|
|
|
101
112
|
const timeShiftEnd = this.state.timeShiftEnd || this.state.timeShiftBoth;
|
|
102
113
|
return (React.createElement(WithCss, { useStyles: useStyles }, ({ styles }) => React.createElement("div", { className: styles.panel },
|
|
103
114
|
React.createElement(Divider, { style: { margin: "8px 0px 6px" } }),
|
|
104
|
-
React.createElement(
|
|
105
|
-
React.createElement(Space, {
|
|
115
|
+
React.createElement("div", { className: styles.columns },
|
|
116
|
+
React.createElement(Space, { className: styles.column, direction: "vertical" },
|
|
106
117
|
this.renderSectionTitle(i18n("Interval Begin")),
|
|
107
118
|
this.renderButton(i18n("Now"), () => this.props.onBeginIntervalChange("15minutes")),
|
|
108
119
|
this.renderButton(i18n("Today"), () => this.props.onBeginIntervalChange("day")),
|
|
109
120
|
this.renderButton(i18n("Week"), () => this.props.onBeginIntervalChange("week")),
|
|
110
121
|
this.renderButton(i18n("Month"), () => this.props.onBeginIntervalChange("month")),
|
|
111
122
|
this.renderButton(i18n("Year"), () => this.props.onBeginIntervalChange("year"))),
|
|
112
|
-
React.createElement(Space, {
|
|
123
|
+
React.createElement(Space, { className: styles.column, direction: "vertical" },
|
|
113
124
|
this.renderSectionTitle(i18n("Duration and Time Shift")),
|
|
114
|
-
React.createElement("div", { style: { display: "flex", justifyContent: "center", alignItems: "center" } },
|
|
115
|
-
this.renderTimeShiftIcon("begin", styles),
|
|
116
|
-
this.renderTimeShiftIcon("both", styles),
|
|
117
|
-
this.renderTimeShiftIcon("end", styles)),
|
|
118
125
|
this.renderButtonWithTimeShift(i18n("Hour"), () => this.props.onIntervalDurationChange("hour"), (direction) => this.props.onTimeShift(timeShiftBegin, timeShiftEnd, "hour", direction)),
|
|
119
126
|
this.renderButtonWithTimeShift(i18n("Day"), () => this.props.onIntervalDurationChange("day"), (direction) => this.props.onTimeShift(timeShiftBegin, timeShiftEnd, "day", direction)),
|
|
120
127
|
this.renderButtonWithTimeShift(i18n("Week"), () => this.props.onIntervalDurationChange("week"), (direction) => this.props.onTimeShift(timeShiftBegin, timeShiftEnd, "week", direction)),
|
|
121
128
|
this.renderButtonWithTimeShift(i18n("Month"), () => this.props.onIntervalDurationChange("month"), (direction) => this.props.onTimeShift(timeShiftBegin, timeShiftEnd, "month", direction)),
|
|
122
|
-
this.renderButtonWithTimeShift(i18n("Year"), () => this.props.onIntervalDurationChange("year"), (direction) => this.props.onTimeShift(timeShiftBegin, timeShiftEnd, "year", direction))
|
|
129
|
+
this.renderButtonWithTimeShift(i18n("Year"), () => this.props.onIntervalDurationChange("year"), (direction) => this.props.onTimeShift(timeShiftBegin, timeShiftEnd, "year", direction)),
|
|
130
|
+
React.createElement("div", { style: { display: "flex", justifyContent: "center", alignItems: "center" } },
|
|
131
|
+
this.renderTimeShiftIcon("begin", styles),
|
|
132
|
+
this.renderTimeShiftIcon("both", styles),
|
|
133
|
+
this.renderTimeShiftIcon("end", styles))),
|
|
123
134
|
!this.props.compact &&
|
|
124
|
-
React.createElement(Space, {
|
|
135
|
+
React.createElement(Space, { className: styles.column, direction: "vertical" },
|
|
125
136
|
this.renderSectionTitle(i18n("Interval End")),
|
|
126
137
|
this.renderButton("15 min", () => this.props.onEndIntervalChange("15minutes")),
|
|
127
138
|
this.renderButton(i18n("Hour"), () => this.props.onEndIntervalChange("hour")),
|