d2coreui 23.0.55 → 23.0.56
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 +18 -0
- package/components/date/dateRangeInput.js +5 -5
- package/components/date/dateRangeInput.js.map +1 -1
- package/components/date/dateRangeInputAdvancedPanel.js +15 -4
- 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.js +38 -28
- package/components/date/dateTimeInput.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/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateTimeInput.js","sourceRoot":"","sources":["../../../../components/date/dateTimeInput.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AACvD,OAAO,WAAW,MAAM,sBAAsB,CAAC;AAC/C,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAEvC,OAAO,KAAK,MAAM,cAAc,CAAC;AACjC,OAAO,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAC,MAAM,MAAM,CAAC;AAChE,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAChC,OAAO,EAAC,sBAAsB,EAAC,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAC,YAAY,EAAC,MAAM,YAAY,CAAC;AACxC,OAAO,OAA+B,MAAM,mCAAmC,CAAC;AAEhF,OAAO,IAAI,MAAM,kBAAkB,CAAC;AAGpC,OAAO,EAAC,yBAAyB,EAAE,W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IAC/D,CAAC;IAEO,MAAM,CAAC,YAAY,CAAC,KAAoB,EAAE,WAAmB,EAAE,WAAmB,EAAE,UAAoB;QAC5G,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,WAAW,IAAI,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,IAAI,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC;IACzL,CAAC;CACJ","sourcesContent":["import React, {HTMLAttributes, RefObject} from \"react\";\r\nimport MaskedInput from \"../input/maskedInput\";\r\nimport padStart from 'lodash/padStart';\r\nimport isEqual from 'lodash/isEqual';\r\nimport debounce from 'lodash/debounce';\r\nimport {Dayjs, ManipulateType} from \"dayjs\";\r\nimport dayjs from \"d2core/dayjs\";\r\nimport {CalendarOutlined} from \"@ant-design/icons\";\r\nimport {Button, Calendar, Divider, Select, Tooltip} from \"antd\";\r\nimport {Key} from \"ts-key-enum\";\r\nimport {D2000UnixTimeNullValue} from \"d2core/types/unixTimeUtils\";\r\nimport {TooltipPlacement} from \"antd/lib/tooltip\";\r\nimport {createStyles} from \"antd-style\";\r\nimport WithCss, {WithCssInjectedProps} from \"d2coreui/components/style/withCss\";\r\nimport {SizeType} from \"antd/lib/config-provider/SizeContext\";\r\nimport i18n from \"d2core/i18n/i18n\";\r\nimport {InputProps} from \"antd/es\";\r\nimport {InputStatus} from \"antd/es/_util/statusUtils\";\r\nimport {DEFAULT_FORMAT_CHARACTERS, ESCAPE_CHAR} from \"d2coreui/components/input/mask/helpers\";\r\n\r\nconst useStyles = createStyles(({token, css}, props: WithCssInjectedProps) => {\r\n // antd colours prefix/suffix by status in every variant except borderless\r\n const statusAffix = props.variant !== \"borderless\";\r\n\r\n return {\r\n dateTimeInputCalendar: css`\r\n // adaptations of date-picker calendar styles\r\n .ant-picker-cell-in-view.ant-picker-cell-selected .ant-picker-cell-inner:not(.date-picker-item-marked) {\r\n color: inherit;\r\n background: inherit;\r\n }\r\n\r\n .ant-picker-panel:focus > .ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-selected .ant-picker-cell-inner:before {\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n bottom: 0;\r\n left: 0;\r\n z-index: 1;\r\n border: ${token.lineWidth}px ${token.lineType} ${token.colorPrimary};\r\n border-radius: ${token.borderRadiusSM}px;\r\n content: '';\r\n }\r\n\r\n .ant-picker-content thead {\r\n user-select: none;\r\n }\r\n\r\n // plays the role of antd's selected cell\r\n .date-picker-item-marked {\r\n color: ${token.colorTextLightSolid};\r\n background: ${token.colorPrimary};\r\n }\r\n\r\n .ant-picker-cell-in-view.ant-picker-cell-today .ant-picker-cell-inner::before {\r\n border: ${token.lineWidth}px ${token.lineType} ${token.colorPrimary};\r\n }\r\n\r\n // antd's cellHoverBg, text colour is left untouched on hover\r\n .ant-picker-cell:hover:not(.ant-picker-cell-in-view) .ant-picker-cell-inner, .ant-picker-cell:hover:not(.ant-picker-cell-selected):not(.ant-picker-cell-range-start):not(.ant-picker-cell-range-end):not(.ant-picker-cell-range-hover-start):not(.ant-picker-cell-range-hover-end) .ant-picker-cell-inner {\r\n background: ${token.controlItemBgHover};\r\n }\r\n\r\n .ant-picker-body {\r\n padding-bottom: 0 !important;\r\n }\r\n `,\r\n suffixIcon: css`\r\n color: ${token.colorTextQuaternary};\r\n vertical-align: middle;\r\n height: 100%;\r\n `,\r\n // antd colours the affix by status - see `genOutlinedStatusStyle.affixColor`\r\n suffixIconError: css`\r\n ${statusAffix ? `color: ${token.colorError};` : \"\"}\r\n `,\r\n suffixIconWarning: css`\r\n ${statusAffix ? `color: ${token.colorWarning};` : \"\"}\r\n `,\r\n suffixIconDisabled: css`\r\n color: ${token.colorTextDisabled};\r\n `,\r\n /**\r\n * antd's borderless/filled status styles colour the value text and are not guarded\r\n * against the disabled state - pickers keep colorTextDisabled, so match the picker.\r\n * Applied only for a truly disabled component, never for `inputDisabled` (open popup).\r\n */\r\n disabledText: css`\r\n && input[disabled] {\r\n color: ${token.colorTextDisabled};\r\n -webkit-text-fill-color: ${token.colorTextDisabled};\r\n }\r\n `,\r\n }\r\n});\r\n\r\n\r\n/**\r\n * Props of {@link DateTimeInput}. Remaining HTML attributes (`style`, `className`, `id`, ...) are\r\n * applied to the root `div` of the input; with {@link DateTimeInputProps.renderAsCalendar} only\r\n * `style` is used (on the calendar).\r\n */\r\ninterface DateTimeInputProps extends Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> {\r\n /**\r\n * dayjs format of the displayed and typed value, typically from `LocaleHolder.getDateTimeFormat()`.\r\n * Editable tokens: `YYYY`, `YY`, `MM`, `DD`, `HH`, `mm`, `ss`, `SSS` and the UTC offset `Z` (`+02:00`) or\r\n * `ZZ` (`+0200`); other characters are literals. Fields missing from the mask are taken from the start\r\n * of the current day. A 2-digit year keeps the century of the previous value (without one, `> 70` means 19xx,\r\n * otherwise 20xx). Including the UTC offset makes both instants of a DST fold enterable and rejects a\r\n * wall clock inside a DST gap.\r\n */\r\n mask: string\r\n /**\r\n * Current value (controlled), in the browser's local time zone. `null` shows an empty input. The D2000\r\n * \"null time\" instant is shown as an empty input with a \"Null Time\" placeholder while not focused.\r\n */\r\n value: Dayjs | null\r\n /**\r\n * Called with a new value whenever the typed text parses to a valid instant within\r\n * {@link DateTimeInputProps.minDateTime}/{@link DateTimeInputProps.maxDateTime}, when a field is stepped\r\n * (arrow keys, mouse wheel - clamped to min/max), when a day is picked in the calendar (the time of day\r\n * of the current value is kept, 00:00 when there is none) and when \"Today\" is clicked (start of today).\r\n * Called with `null` when the input is emptied and {@link DateTimeInputProps.allowClear} is set.\r\n */\r\n onChange?: (time: Dayjs | null) => void\r\n /** Called with the raw input text when an edit results in text that is not a valid (or allowed) value. */\r\n onInvalidValue?: (inputString: string) => void\r\n /** Allows the value to be cleared: an emptied input is reported as `null` and `null` counts as valid. */\r\n allowClear?: boolean\r\n /** Disables the input and the calendar popup. */\r\n disabled?: boolean\r\n /** Disables only the text input without the disabled look of the whole component - e.g. while a popup is open. */\r\n inputDisabled?: boolean\r\n /** Earliest allowed value (inclusive); earlier typed values are invalid, steps are clamped, calendar days are disabled. */\r\n minDateTime?: Dayjs\r\n /** Latest allowed value (inclusive); later typed values are invalid, steps are clamped, calendar days are disabled. */\r\n maxDateTime?: Dayjs\r\n\r\n /** antd input variant. */\r\n variant?: InputProps[\"variant\"]\r\n /** antd validation status; an unparseable or out-of-range value is always drawn as `\"error\"` regardless. */\r\n status?: InputStatus\r\n /** Renders only the masked input - no calendar icon and no calendar popup. */\r\n hidePopup?: boolean\r\n /** Renders only the calendar panel inline (no input, no \"Today\" button). */\r\n renderAsCalendar?: boolean\r\n /** Focuses the input on mount. */\r\n autoFocus?: boolean\r\n /** Placement of the calendar popup relative to the input. */\r\n placement?: TooltipPlacement;\r\n /** antd control size. */\r\n size?: SizeType;\r\n /**\r\n * Sizes the component to the rendered {@link DateTimeInputProps.mask} instead of filling the parent: the input\r\n * is as wide as the formatted value. A `width` in `style` or `inputStyle` still wins.\r\n */\r\n autoWidth?: boolean;\r\n\r\n /** Day whose month the calendar shows initially and whenever the popup opens, instead of the value's month. */\r\n defaultSelectedDate?: Dayjs\r\n /** Inclusive range of days highlighted in the calendar as selected. Intended for range pickers. */\r\n markedDateInterval?: [Dayjs, Dayjs]\r\n /** Called on mouse down over a calendar day, with that day combined with the time of day of the current value. */\r\n onDateItemMouseDown?: (date: Dayjs) => void\r\n /** Called on mouse up over a calendar day, with that day combined with the time of day of the current value. */\r\n onDateItemMouseUp?: (date: Dayjs) => void\r\n /** Called (debounced by 100 ms) when the mouse moves over a calendar day, with the start of that day. */\r\n onDateItemMouseOver?: (date: Dayjs) => void\r\n\r\n /** Style of the inner text input element (the `style` prop styles the wrapper). */\r\n inputStyle?: React.CSSProperties\r\n /** Container the calendar popup and its month/year dropdowns are rendered into. */\r\n getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;\r\n\r\n /** Disables the Enter key in the calendar, which otherwise commits the day currently shown as selected. */\r\n ignoreKeyStrokes?: boolean\r\n}\r\n\r\ninterface DateTimeInputState {\r\n valid: boolean\r\n currentPos: number | null\r\n currentInfo: MaskResult\r\n popupCalendarVisible: boolean\r\n\r\n calendarSelectedDate: Dayjs\r\n focused: boolean\r\n}\r\n\r\ninterface MaskResult {\r\n time: Dayjs | undefined\r\n info: MaskSegment | undefined\r\n length: number\r\n}\r\n\r\n/** the units the mask can address - a subset of ManipulateType, without the week units */\r\ntype DateTimeUnit = \"ms\" | \"s\" | \"m\" | \"h\" | \"y\" | \"M\" | \"d\";\r\n\r\ninterface InfoEntry {\r\n key: string | string[]\r\n min: number | number[]\r\n max: number | number[]\r\n unit: DateTimeUnit\r\n part: keyof WallClockParts\r\n}\r\n\r\n/**\r\n * Calendar reading of a value, as typed. Kept apart from Dayjs on purpose - assembling a Dayjs\r\n * normalises a wall clock that does not exist (during a DST gap 02:30 silently becomes 03:30),\r\n * which would hide exactly the case the UTC offset is there to resolve.\r\n */\r\ninterface WallClockParts {\r\n y: number\r\n /** 0-11, as in Dayjs */\r\n M: number\r\n D: number\r\n h: number\r\n m: number\r\n s: number\r\n ms: number\r\n}\r\n\r\n/**\r\n * One editable field of the mask, located in the *rendered* value rather than in the mask\r\n * string. The two differ as soon as the mask contains a token whose rendered width is not\r\n * its own length - dayjs prints `Z` as \"+02:00\" and `ZZ` as \"+0200\".\r\n */\r\ninterface MaskSegment {\r\n /** the mask token this segment was built from, e.g. \"YYYY\" or \"Z\" */\r\n token: string\r\n /** offset of the segment in the rendered value */\r\n index: number\r\n /** length of the segment in the rendered value */\r\n length: number\r\n /** numeric field description - undefined for the UTC-offset segment */\r\n entry: InfoEntry | undefined\r\n min: number\r\n max: number\r\n}\r\n\r\ninterface MaskLayout {\r\n /** MaskedInput pattern, in rendered-value coordinates */\r\n pattern: string\r\n segments: MaskSegment[]\r\n}\r\n\r\nconst DATE_TIME_DATA_MAP: InfoEntry[] = [\r\n {key: \"SSS\", min: 0, max: 999, unit: \"ms\", part: \"ms\"},\r\n {key: \"ss\", min: 0, max: 59, unit: \"s\", part: \"s\"},\r\n {key: \"mm\", min: 0, max: 59, unit: \"m\", part: \"m\"},\r\n {key: \"HH\", min: 0, max: 23, unit: \"h\", part: \"h\"},\r\n {key: [\"YYYY\", \"YY\"], min: [1900, 0], max: [9999, 99], unit: \"y\", part: \"y\"},\r\n {key: \"MM\", min: 1, max: 12, unit: \"M\", part: \"M\"},\r\n {key: \"DD\", min: 1, max: 31, unit: \"d\", part: \"D\"},\r\n];\r\n\r\n/** numeric mask tokens, longest first so that YYYY is not read as YY */\r\nconst NUMBER_TOKENS: string[] = [\"SSS\", \"YYYY\", \"YY\", \"DD\", \"MM\", \"HH\", \"mm\", \"ss\"];\r\n\r\n/** UTC-offset tokens mapped to the width dayjs renders them with */\r\nconst OFFSET_TOKENS: { token: string, length: number }[] = [\r\n {token: \"ZZ\", length: 5}, // +0200\r\n {token: \"Z\", length: 6}, // +02:00\r\n];\r\n\r\n/**\r\n * MaskedInput format character for the sign of the UTC offset. A letter can never collide with\r\n * a literal of the generated pattern - letters of the mask are always turned into field slots.\r\n */\r\nconst SIGN_FORMAT_CHAR = \"S\";\r\nconst SIGN_FORMAT_CHARACTERS = {\r\n [SIGN_FORMAT_CHAR]: {validate: (char: string) => char === \"+\" || char === \"-\"},\r\n};\r\n\r\nconst MAX_UTC_OFFSET_MINUTES = 14 * 60;\r\n\r\nconst MIN_TIME = dayjs.unix(0);\r\nconst MAX_TIME = dayjs().add(1000, \"year\");\r\n\r\n/**\r\n * Globally changes the lowest year accepted in a `YYYY` field of every {@link DateTimeInput} from 1900 to 1902.\r\n * Stepping and the calendar stay limited to dates from the Unix epoch on.\r\n */\r\nexport function allowDatesBeforeEpoch() {\r\n DATE_TIME_DATA_MAP[4].min = 1902;\r\n}\r\n\r\n/** the numeric field a mask token belongs to, with the min/max of that particular token */\r\nfunction findInfoEntry(token: string): { entry: InfoEntry, min: number, max: number } | undefined {\r\n for (const entry of DATE_TIME_DATA_MAP) {\r\n if (Array.isArray(entry.key)) {\r\n const i = entry.key.indexOf(token);\r\n if (i !== -1) {\r\n return {\r\n entry,\r\n min: Array.isArray(entry.min) ? entry.min[i] : entry.min,\r\n max: Array.isArray(entry.max) ? entry.max[i] : entry.max,\r\n };\r\n }\r\n } else if (entry.key === token) {\r\n return {entry, min: entry.min as number, max: entry.max as number};\r\n }\r\n }\r\n return undefined;\r\n}\r\n\r\nfunction escapePatternChar(char: string): string {\r\n return char in DEFAULT_FORMAT_CHARACTERS || char === SIGN_FORMAT_CHAR || char === ESCAPE_CHAR\r\n ? ESCAPE_CHAR + char\r\n : char;\r\n}\r\n\r\n/**\r\n * Walks the mask once and records, for every editable field, where it lands in the value as\r\n * dayjs renders it. Both the MaskedInput pattern and the parser positions are derived from\r\n * this, so tokens wider than their mask representation (`Z`, `ZZ`) no longer shift everything\r\n * that follows them.\r\n */\r\nfunction buildMaskLayout(mask: string): MaskLayout {\r\n const segments: MaskSegment[] = [];\r\n let pattern = \"\";\r\n // kept separately from pattern.length - an escaped literal takes two characters of the\r\n // pattern source but still only one character of the rendered value\r\n let renderIndex = 0;\r\n let i = 0;\r\n\r\n while (i < mask.length) {\r\n const offset = OFFSET_TOKENS.find((t) => mask.startsWith(t.token, i));\r\n if (offset !== undefined) {\r\n segments.push({token: offset.token, index: renderIndex, length: offset.length, entry: undefined, min: 0, max: 0});\r\n pattern += SIGN_FORMAT_CHAR + (offset.length === 6 ? \"11:11\" : \"1111\");\r\n renderIndex += offset.length;\r\n i += offset.token.length;\r\n continue;\r\n }\r\n\r\n const token = NUMBER_TOKENS.find((t) => mask.startsWith(t, i));\r\n const found = token !== undefined ? findInfoEntry(token) : undefined;\r\n if (token !== undefined && found !== undefined) {\r\n segments.push({token, index: renderIndex, length: token.length, entry: found.entry, min: found.min, max: found.max});\r\n pattern += \"1\".repeat(token.length);\r\n renderIndex += token.length;\r\n i += token.length;\r\n continue;\r\n }\r\n\r\n // unknown token - keep the historical behaviour of one digit slot per letter\r\n pattern += /[a-zA-Z]/.test(mask[i]) ? \"1\" : escapePatternChar(mask[i]);\r\n renderIndex++;\r\n i++;\r\n }\r\n\r\n return {pattern, segments};\r\n}\r\n\r\nconst CALENDAR_ICON_WIDTH = 28;\r\n\r\nlet measureContext: CanvasRenderingContext2D | null = null;\r\n\r\nfunction measureTextWidth(text: string, font: string): number {\r\n measureContext ??= document.createElement(\"canvas\").getContext(\"2d\");\r\n\r\n if (!measureContext) {\r\n return 0;\r\n }\r\n\r\n measureContext.font = font;\r\n return measureContext.measureText(text).width;\r\n}\r\n\r\n/**\r\n * Masked date-time input with a calendar popup - a controlled replacement for antd `DatePicker`.\r\n * The value is typed field by field according to {@link DateTimeInputProps.mask}; ArrowUp/ArrowDown and the\r\n * mouse wheel step the field under the cursor. The calendar opens on right-click or via the calendar icon.\r\n *\r\n * @example\r\n * const [value, setValue] = useState<Dayjs | null>(dayjs().startOf(\"hour\"));\r\n *\r\n * <DateTimeInput\r\n * mask={LocaleHolder.getDateTimeFormat(true, true)}\r\n * value={value}\r\n * onChange={setValue}\r\n * allowClear\r\n * />\r\n */\r\nexport default class DateTimeInput extends React.Component<DateTimeInputProps, DateTimeInputState> {\r\n private inputRef: RefObject<MaskedInput> = React.createRef();\r\n private today: Dayjs = dayjs();\r\n private layoutMask: string;\r\n private layout: MaskLayout;\r\n\r\n constructor(props: Readonly<DateTimeInputProps>) {\r\n super(props);\r\n this.layoutMask = props.mask;\r\n this.layout = buildMaskLayout(props.mask);\r\n this.state = {\r\n valid: DateTimeInput.isValidValue(props.value, props.minDateTime, props.maxDateTime, props.allowClear),\r\n currentPos: null,\r\n currentInfo: {\r\n info: undefined,\r\n time: undefined,\r\n length: 0\r\n },\r\n popupCalendarVisible: false,\r\n calendarSelectedDate: props.defaultSelectedDate?.clone() ?? props.value?.clone() ?? dayjs().startOf('day'),\r\n focused: false,\r\n };\r\n\r\n this.recalc = this.recalc.bind(this);\r\n this.increment = this.increment.bind(this);\r\n this.decrement = this.decrement.bind(this);\r\n this.onItemMouseOver = debounce(this.onItemMouseOver.bind(this), 100, {maxWait: 100});\r\n }\r\n\r\n componentDidMount(): void {\r\n // React registers `wheel` as a passive listener, so preventDefault() from an onWheel\r\n // prop is ignored and the page scrolls along with the value - hence a native listener\r\n this.input?.addEventListener(\"wheel\", this.onWheel, {passive: false});\r\n document.fonts?.ready.then(() => {\r\n if (this.props.autoWidth) {\r\n this.forceUpdate();\r\n }\r\n });\r\n }\r\n\r\n componentWillUnmount(): void {\r\n this.input?.removeEventListener(\"wheel\", this.onWheel);\r\n }\r\n\r\n componentDidUpdate(prevProps: Readonly<DateTimeInputProps>, _prevState: Readonly<DateTimeInputState>, _snapshot?: any): void {\r\n if (!isEqual(prevProps, this.props) && this.inputRef.current !== null) {\r\n this.inputRef.current.input.selectionStart = this.state.currentPos;\r\n this.inputRef.current.input.selectionEnd = this.state.currentPos;\r\n if (prevProps.value !== this.props.value) {\r\n this.setState({valid: DateTimeInput.isValidValue(this.props.value, this.props.minDateTime, this.props.maxDateTime, this.props.allowClear)});\r\n }\r\n }\r\n }\r\n\r\n /** The underlying `<input>` element, `undefined` before mount or with {@link DateTimeInputProps.renderAsCalendar}. */\r\n get input() {\r\n return this.inputRef.current?.input;\r\n }\r\n\r\n private getLayout(): MaskLayout {\r\n if (this.layoutMask !== this.props.mask) {\r\n this.layoutMask = this.props.mask;\r\n this.layout = buildMaskLayout(this.props.mask);\r\n }\r\n return this.layout;\r\n }\r\n\r\n /** Moves the keyboard focus to the text input. */\r\n focus() {\r\n this.inputRef.current?.focus();\r\n }\r\n\r\n private canStep(direction: number): boolean {\r\n return this.nextValue(direction) !== undefined;\r\n }\r\n\r\n /**\r\n * The value one step up/down from the current one, or undefined when the field under the\r\n * cursor cannot be stepped. Over the UTC-offset field a step means \"the other offset of the\r\n * same wall clock\", which only exists inside a DST fold - elsewhere the arrows stay inert.\r\n */\r\n private nextValue(direction: number): Dayjs | undefined {\r\n const segment = this.state.currentInfo.info;\r\n const value = this.props.value;\r\n const step = direction > 0 ? 1 : -1;\r\n\r\n if (segment === undefined || !value) {\r\n return undefined;\r\n }\r\n\r\n if (segment.entry === undefined) {\r\n const candidate = value.clone().add(step, \"h\");\r\n return DateTimeInput.isSameWallClock(DateTimeInput.toWallClock(candidate), DateTimeInput.toWallClock(value))\r\n ? candidate\r\n : undefined;\r\n }\r\n\r\n return DateTimeInput.checkDateValueValidity(value, step, segment.entry.unit)\r\n ? value.clone().add(step, segment.entry.unit)\r\n : undefined;\r\n }\r\n\r\n private step(direction: number): void {\r\n const next = this.nextValue(direction);\r\n\r\n if (next !== undefined) {\r\n if (!!this.props.maxDateTime && next.isAfter(this.props.maxDateTime)) {\r\n this.props.onChange?.(this.props.maxDateTime.clone());\r\n } else if (!!this.props.minDateTime && next.isBefore(this.props.minDateTime)) {\r\n this.props.onChange?.(this.props.minDateTime.clone());\r\n } else {\r\n this.props.onChange?.(next);\r\n }\r\n }\r\n\r\n this.inputRef.current?.focus();\r\n }\r\n\r\n /** the page must not scroll while the wheel is editing the value */\r\n private onWheel = (event: WheelEvent): void => {\r\n if (this.props.disabled || this.props.inputDisabled) {\r\n return;\r\n }\r\n if (event.deltaY > 0 && this.canStep(-1)) {\r\n this.decrement();\r\n event.preventDefault();\r\n } else if (event.deltaY < 0 && this.canStep(1)) {\r\n this.increment();\r\n event.preventDefault();\r\n }\r\n };\r\n\r\n /** Re-reads the cursor position and the mask field under it; called internally on key up and mouse up. */\r\n recalc(): void {\r\n if (this.inputRef.current !== null) {\r\n this.setState({\r\n currentInfo: DateTimeInput.parseDateTimeFormat(this.props.value, this.inputRef.current.input.value, this.getLayout(), this.inputRef.current.input.selectionStart),\r\n currentPos: this.inputRef.current.input.selectionStart,\r\n });\r\n }\r\n }\r\n\r\n private increment(): void {\r\n this.step(1);\r\n }\r\n\r\n private decrement(): void {\r\n this.step(-1);\r\n }\r\n\r\n /** Forwards a hovered calendar day to {@link DateTimeInputProps.onDateItemMouseOver}; debounced by 100 ms. */\r\n onItemMouseOver(itemDate: Dayjs) {\r\n this.props.onDateItemMouseOver?.(itemDate);\r\n }\r\n\r\n private renderCalendarNavigation(value: Dayjs) {\r\n const start = 0;\r\n const end = 12;\r\n const monthOptions = [];\r\n\r\n const current = value.clone();\r\n const localeData = value.localeData();\r\n const months = [];\r\n for (let i = 0; i < 12; i++) {\r\n months.push(localeData.months(current.month(i)));\r\n }\r\n\r\n for (let index = start; index < end; index++) {\r\n monthOptions.push(\r\n <Select.Option key={`${index}`} value={`${index}`}>\r\n {months[index]}\r\n </Select.Option>,\r\n );\r\n }\r\n const month = value.month();\r\n\r\n const year = value.year();\r\n const options = [];\r\n for (let i = year - 4; i <= year + 2; i += 1) {\r\n options.push(\r\n <Select.Option key={`${i}`} value={`${i}`}>\r\n {i}\r\n </Select.Option>,\r\n );\r\n }\r\n\r\n const calendarSelectedDate = this.state.calendarSelectedDate;\r\n\r\n return (\r\n <div style={{display: \"flex\", marginBottom: 6}}>\r\n <div style={{display: \"flex\", width: 140}}>\r\n <Button style={{width: 10, padding: 0}} size=\"small\" type=\"text\" tabIndex={-1}\r\n disabled={!DateTimeInput.checkDateValueValidity(calendarSelectedDate, -1, \"month\")}\r\n onClick={() => {\r\n this.setState({calendarSelectedDate: calendarSelectedDate.subtract(1, \"month\")});\r\n }}\r\n className=\"ant-picker-header-prev-btn\"><span\r\n className=\"ant-picker-prev-icon\"/></Button>\r\n <Select\r\n style={{flex: \"1 1 auto\"}}\r\n size=\"small\"\r\n popupMatchSelectWidth={false}\r\n styles={{popup: {root: {zIndex: 2070}}}}\r\n getPopupContainer={this.props.getPopupContainer}\r\n value={String(month)}\r\n onChange={selectedMonth => {\r\n this.setState({calendarSelectedDate: calendarSelectedDate.month(parseInt(selectedMonth, 10))});\r\n }}\r\n >\r\n {monthOptions}\r\n </Select>\r\n <Button style={{width: 10, padding: 0}} size=\"small\" type=\"text\" tabIndex={-1}\r\n className=\"ant-picker-header-next-btn\"\r\n onClick={() => {\r\n this.setState({calendarSelectedDate: calendarSelectedDate.add(1, \"month\")});\r\n }}>\r\n <span className=\"ant-picker-next-icon\"/>\r\n </Button>\r\n </div>\r\n <div style={{display: \"flex\", width: 110}}>\r\n <Button style={{width: 12, padding: 0}} size=\"small\" type=\"text\" tabIndex={-1}\r\n className=\"ant-picker-header-prev-btn\"\r\n onClick={() => {\r\n this.setState({calendarSelectedDate: calendarSelectedDate.subtract(1, \"year\")});\r\n }}>\r\n <span className=\"ant-picker-prev-icon\"/>\r\n </Button>\r\n <Select\r\n size=\"small\"\r\n style={{width: 84}}\r\n popupMatchSelectWidth={false}\r\n styles={{popup: {root: {zIndex: 2070}}}}\r\n getPopupContainer={this.props.getPopupContainer}\r\n onChange={newYear => {\r\n this.setState({calendarSelectedDate: calendarSelectedDate.year(parseInt(newYear, 10))});\r\n }}\r\n value={String(year)}\r\n >\r\n {options}\r\n </Select>\r\n <Button style={{width: 12, padding: 0}} size=\"small\" type=\"text\" tabIndex={-1}\r\n className=\"ant-picker-header-next-btn\"\r\n onClick={() => {\r\n this.setState({calendarSelectedDate: calendarSelectedDate.add(1, \"year\")});\r\n }}>\r\n <span className=\"ant-picker-next-icon\"/>\r\n </Button>\r\n </div>\r\n </div>\r\n );\r\n }\r\n\r\n /** Renders the calendar panel - the popup content, or the whole component with {@link DateTimeInputProps.renderAsCalendar}. */\r\n renderCalendar(): React.ReactElement {\r\n return (<div\r\n onKeyDown={!this.props.ignoreKeyStrokes ? (e) => {\r\n if (e.key === Key.Enter) {\r\n var tagName = (e.target as any)?.tagName?.toLowerCase();\r\n if (tagName !== \"input\") {\r\n this.props.onChange?.(this.state.calendarSelectedDate);\r\n }\r\n }\r\n } : undefined}\r\n onMouseOver={(e) => {\r\n if (e.target instanceof HTMLTableCellElement) {\r\n const date = dayjs(e.target.title, \"YYYY-MM-DD\");\r\n this.onItemMouseOver(date);\r\n }\r\n }}>\r\n <WithCss useStyles={useStyles}>{(css) =>\r\n <Calendar\r\n className={css.styles.dateTimeInputCalendar}\r\n fullscreen={false}\r\n style={this.props.renderAsCalendar ? this.props.style : undefined}\r\n fullCellRender={((date: Dayjs) => {\r\n let className = date.isSame(this.today, \"date\") ? 'ant-picker-cell-inner ant-picker-calendar-date ant-picker-calendar-date-today' : 'ant-picker-cell-inner ant-picker-calendar-date';\r\n const markedDateInterval = this.props.markedDateInterval;\r\n if (markedDateInterval && (markedDateInterval[0].isBefore(date) || markedDateInterval[0].isSame(date, \"millisecond\")) &&\r\n (markedDateInterval[1].isAfter(date) || markedDateInterval[1].isSame(date, \"millisecond\"))) {\r\n className += \" date-picker-item-marked\";\r\n } else if (date.isSame(this.props.value, \"date\")) {\r\n className += \" date-picker-item-marked\";\r\n }\r\n return (\r\n <div className={className} style={{userSelect: \"none\"}}\r\n onKeyDown={(e) => {\r\n if (e.key === Key.Enter) {\r\n let newValue = this.props.value?.clone() ?? dayjs().startOf(\"day\");\r\n newValue = newValue.year(date.year()).month(date.month()).date(date.date());\r\n this.props.onChange?.(newValue);\r\n }\r\n }}\r\n onMouseDown={() => {\r\n let newValue = this.props.value?.clone() ?? dayjs().startOf(\"day\");\r\n newValue = newValue.year(date.year()).month(date.month()).date(date.date());\r\n this.props.onDateItemMouseDown?.(newValue);\r\n }}\r\n onMouseUp={() => {\r\n let newValue = this.props.value?.clone() ?? dayjs().startOf(\"day\");\r\n newValue = newValue.year(date.year()).month(date.month()).date(date.date());\r\n this.props.onDateItemMouseUp?.(newValue);\r\n }}\r\n >\r\n <div className={`ant-picker-calendar-date-value`}>\r\n {padStart(\"\" + date.date(), 2, '0')}\r\n </div>\r\n <div className={`ant-picker-calendar-date-content`}>\r\n </div>\r\n </div>\r\n );\r\n })}\r\n headerRender={({value}) => {\r\n return this.renderCalendarNavigation(value);\r\n }}\r\n value={this.state.calendarSelectedDate}\r\n validRange={[this.props.minDateTime ?? MIN_TIME, this.props.maxDateTime ?? MAX_TIME]}\r\n onSelect={(value) => {\r\n if (window.event instanceof MouseEvent) {\r\n let newValue = this.props.value?.clone() ?? dayjs().startOf(\"day\");\r\n newValue = newValue.year(value.year()).month(value.month()).date(value.date());\r\n this.props.onChange?.(newValue);\r\n }\r\n this.setState({calendarSelectedDate: value, popupCalendarVisible: false});\r\n }}\r\n />\r\n }</WithCss>\r\n {!this.props.renderAsCalendar &&\r\n <>\r\n <Divider style={{margin: \"0 0 4px\"}}/>\r\n <Button\r\n block\r\n size=\"small\"\r\n color=\"primary\"\r\n variant=\"text\"\r\n onClick={() => {\r\n this.props.onChange?.(dayjs().startOf(\"day\"));\r\n this.setState({popupCalendarVisible: false});\r\n }}\r\n >\r\n {i18n(\"Today\")}\r\n </Button>\r\n </>\r\n }\r\n </div>\r\n );\r\n }\r\n\r\n /**\r\n * Width of the formatted {@link DateTimeInputProps.mask} in the font antd gives the input (`fontSizeLG` for\r\n * `large`, `fontSize` otherwise). Computed from the theme rather than read from the DOM, so it is right in the\r\n * very first render - a later correction would be animated by the input's `transition`.\r\n * `tabular-nums` must stay off - in Segoe UI it widens the digits past the measured \"0\" and the value overflows.\r\n */\r\n private getInputTextWidth(fontFamily: string, fontSize: number): number {\r\n // all digits as \"0\" so that the width holds for any value, not just today's\r\n const sample = dayjs().locale(\"locale.d2000\").format(this.props.mask).replace(/\\d/g, \"0\");\r\n return Math.ceil(measureTextWidth(sample, `${fontSize}px ${fontFamily}`));\r\n }\r\n\r\n /** Renders the masked input with its calendar icon, without the popup. */\r\n renderInput() {\r\n const {\r\n mask,\r\n value,\r\n onChange,\r\n onInvalidValue,\r\n style,\r\n disabled,\r\n inputDisabled,\r\n variant,\r\n hidePopup,\r\n renderAsCalendar,\r\n allowClear,\r\n minDateTime,\r\n maxDateTime,\r\n onDateItemMouseDown,\r\n onDateItemMouseOver,\r\n onDateItemMouseUp,\r\n markedDateInterval,\r\n inputStyle,\r\n getPopupContainer,\r\n autoFocus,\r\n className,\r\n size,\r\n status,\r\n autoWidth,\r\n ...props\r\n } = this.props;\r\n\r\n const unix: number | undefined = value?.valueOf();\r\n // an unparseable input is an error even when the caller reports no status\r\n const mergedStatus: InputStatus = status || (!this.state.valid ? \"error\" : \"\");\r\n\r\n // the root has to stay a plain DOM element - Tooltip in render() clones it to inject\r\n // its trigger handlers, and a WithCss root would swallow them\r\n return (\r\n <div style={{...(autoWidth ? {width: \"fit-content\"} : {}), ...style, position: \"relative\"}} {...props} className={className}>\r\n <WithCss useStyles={useStyles} props={{variant}}>{({styles, cx, theme}) => {\r\n const maskedInputStyle: React.CSSProperties = !this.state.valid ? {color: theme.colorError} : {};\r\n if (autoWidth) {\r\n Object.assign(maskedInputStyle, {\r\n boxSizing: \"content-box\",\r\n width: this.getInputTextWidth(theme.fontFamily, size === \"large\" ? theme.fontSizeLG : theme.fontSize),\r\n }, !hidePopup && {paddingRight: CALENDAR_ICON_WIDTH});\r\n }\r\n if (inputStyle) {\r\n Object.assign(maskedInputStyle, inputStyle);\r\n }\r\n\r\n return (\r\n <>\r\n <div\r\n className={cx({[styles.disabledText]: !!disabled})}\r\n onKeyDown={(event) => {\r\n if (event.code === \"ArrowUp\") { // up\r\n this.increment();\r\n event.preventDefault();\r\n event.stopPropagation();\r\n } else if (event.code === \"ArrowDown\") { // down\r\n this.decrement();\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }\r\n }}>\r\n <MaskedInput mask={this.getLayout().pattern}\r\n formatCharacters={SIGN_FORMAT_CHARACTERS}\r\n variant={variant}\r\n status={mergedStatus}\r\n ref={this.inputRef}\r\n style={maskedInputStyle}\r\n size={size}\r\n value={(this.state.focused || unix !== D2000UnixTimeNullValue * 1000) ? (value?.locale(\"locale.d2000\").format(this.props.mask) ?? \"\") : \"\"}\r\n placeholder={(!this.state.focused && unix === D2000UnixTimeNullValue * 1000) ? \"Null Time\" : undefined}\r\n onFocus={(event => {\r\n event.target.selectionStart = event.target.selectionEnd = this.state.currentPos;\r\n this.setState({focused: true});\r\n })}\r\n onBlur={() => {\r\n this.setState({focused: false});\r\n }}\r\n autoFocus={autoFocus}\r\n disabled={disabled || inputDisabled}\r\n onMouseUp={this.recalc}\r\n onKeyUp={this.recalc}\r\n onChange={(event) => {\r\n const inputString = event.target.value;\r\n const value: MaskResult = DateTimeInput.parseDateTimeFormat(this.props.value, inputString, this.getLayout(), event.target.selectionStart);\r\n const valid: boolean = DateTimeInput.isValidValue(value.time, this.props.minDateTime, this.props.maxDateTime, this.props.allowClear) || (!!this.props.allowClear && !inputString);\r\n\r\n if (value.time !== undefined && valid) {\r\n onChange?.(value.time.clone());\r\n } else if (!!this.props.allowClear && !inputString) {\r\n onChange?.(null);\r\n } else {\r\n onInvalidValue?.(inputString);\r\n }\r\n this.setState({\r\n valid: valid,\r\n currentInfo: value\r\n })\r\n }}/>\r\n </div>\r\n {!hidePopup && !renderAsCalendar && <div\r\n style={{\r\n width: CALENDAR_ICON_WIDTH,\r\n opacity: 1,\r\n height: \"100%\",\r\n textAlign: \"center\",\r\n cursor: disabled ? \"not-allowed\" : \"pointer\",\r\n background: \"transparent\",\r\n position: \"absolute\",\r\n top: 0,\r\n right: 0,\r\n }}\r\n onClick={(event) => {\r\n if (document.createEvent) {\r\n var ev = document.createEvent('HTMLEvents');\r\n ev.initEvent('contextmenu', true, false);\r\n event.target.dispatchEvent(ev);\r\n }\r\n }}\r\n >\r\n <CalendarOutlined className={cx(styles.suffixIcon, {\r\n [styles.suffixIconError]: !disabled && mergedStatus === \"error\",\r\n [styles.suffixIconWarning]: !disabled && mergedStatus === \"warning\",\r\n [styles.suffixIconDisabled]: !!disabled,\r\n })}/>\r\n </div>}\r\n </>\r\n );\r\n }}</WithCss>\r\n </div>\r\n );\r\n }\r\n\r\n render(): any {\r\n if (this.props.renderAsCalendar) {\r\n return this.renderCalendar();\r\n } else if (this.props.hidePopup) {\r\n return this.renderInput();\r\n } else {\r\n return (\r\n <WithCss useStyles={useStyles}>{({theme}) =>\r\n <Tooltip color={theme.colorBgElevated} trigger={this.props.disabled ? [] : [\"contextMenu\"]}\r\n getPopupContainer={this.props.getPopupContainer}\r\n styles={{body: {maxHeight: \"100vh\", overflowY: \"auto\", overflowX: \"hidden\", width: 266}}}\r\n open={this.state.popupCalendarVisible}\r\n onOpenChange={(visible) => {\r\n this.setState({popupCalendarVisible: visible});\r\n if (visible) {\r\n this.setState({calendarSelectedDate: this.props.defaultSelectedDate?.clone() ?? this.props.value?.clone() ?? dayjs().startOf(\"day\")})\r\n }\r\n }}\r\n title={this.renderCalendar()}\r\n placement={this.props.placement}\r\n >\r\n {this.renderInput()}\r\n </Tooltip>\r\n }</WithCss>\r\n );\r\n }\r\n }\r\n\r\n private static toWallClock(value: Dayjs): WallClockParts {\r\n return {\r\n y: value.year(), M: value.month(), D: value.date(),\r\n h: value.hour(), m: value.minute(), s: value.second(), ms: value.millisecond(),\r\n };\r\n }\r\n\r\n /** the two instants of a DST fold share the wall clock and differ only in the UTC offset */\r\n private static isSameWallClock(a: WallClockParts, b: WallClockParts): boolean {\r\n return a.y === b.y && a.M === b.M && a.D === b.D &&\r\n a.h === b.h && a.m === b.m && a.s === b.s && a.ms === b.ms;\r\n }\r\n\r\n private static parseUtcOffset(text: string): number | undefined {\r\n const match = /^([+-])(\\d{2}):?(\\d{2})$/.exec(text);\r\n\r\n if (match === null) {\r\n return undefined;\r\n }\r\n\r\n const minutes = Number(match[2]) * 60 + Number(match[3]);\r\n if (Number(match[3]) > 59 || minutes > MAX_UTC_OFFSET_MINUTES) {\r\n return undefined;\r\n }\r\n\r\n return match[1] === \"-\" ? -minutes : minutes;\r\n }\r\n\r\n /**\r\n * Picks the instant that shows the given wall clock at the given UTC offset. Inside a DST\r\n * fold two instants share the wall clock and the offset is what tells them apart; inside a\r\n * DST gap no instant matches, so the value is reported as invalid. A wall clock that does\r\n * not exist at all (31.02.) is rejected by the same check rather than rolled over.\r\n */\r\n private static resolveWallClock(nominal: WallClockParts, offsetMinutes: number): Dayjs | undefined {\r\n const utcMs = Date.UTC(nominal.y, nominal.M, nominal.D, nominal.h, nominal.m, nominal.s, nominal.ms);\r\n const candidate = dayjs(utcMs - offsetMinutes * 60000);\r\n\r\n return candidate.utcOffset() === offsetMinutes && DateTimeInput.isSameWallClock(DateTimeInput.toWallClock(candidate), nominal)\r\n ? candidate\r\n : undefined;\r\n }\r\n\r\n private static checkDateValueValidity(value: Dayjs | null, offset: number, unit: ManipulateType | undefined) {\r\n if (value === null) {\r\n return false;\r\n }\r\n let v = value.clone().add(offset, unit);\r\n return v.isValid() && v.isSameOrAfter(dayjs(0));\r\n }\r\n\r\n private static parseDateTimeFormat(previousTime: Dayjs | null, value: string, layout: MaskLayout, cursorPos: number | null): MaskResult {\r\n const invalid: MaskResult = {time: undefined, info: undefined, length: 0};\r\n const base = dayjs().startOf(\"day\");\r\n // fields the mask does not carry keep the value they have in `base`\r\n const nominal: WallClockParts = DateTimeInput.toWallClock(base);\r\n let time: Dayjs | undefined = base;\r\n\r\n // iterated in DATE_TIME_DATA_MAP order, not in mask order - the day has to be set after\r\n // the year and the month so that it is not clamped by the month it is temporarily in\r\n for (const v of DATE_TIME_DATA_MAP) {\r\n const segment = layout.segments.find((s) => s.entry === v);\r\n\r\n if (segment === undefined) {\r\n continue;\r\n }\r\n\r\n let val: number = Number(value.substring(segment.index, segment.index + segment.length));\r\n\r\n if (isNaN(val) || val < segment.min || val > segment.max) {\r\n return invalid;\r\n }\r\n\r\n if (v.unit === \"M\") {\r\n val--; // 0-11\r\n }\r\n\r\n if (v.unit === \"y\" && segment.length === 2) {\r\n const century: number = (previousTime != null && previousTime.isValid()) ? Math.floor(previousTime.year() / 100) * 100 : (val > 70 ? 1900 : 2000); // if short year\r\n val += century;\r\n }\r\n\r\n nominal[v.part] = val;\r\n time = time?.set(v.unit === \"d\" ? 'D' : v.unit, val);\r\n }\r\n\r\n // `time` has already normalised a wall clock that does not exist - when the mask carries\r\n // the UTC offset, rebuild the instant from the typed reading instead, so that both sides\r\n // of a DST fold are reachable and a DST gap comes out invalid\r\n const offsetSegment = layout.segments.find((s) => s.entry === undefined);\r\n if (offsetSegment !== undefined) {\r\n const offset = DateTimeInput.parseUtcOffset(value.substring(offsetSegment.index, offsetSegment.index + offsetSegment.length));\r\n time = offset === undefined ? undefined : DateTimeInput.resolveWallClock(nominal, offset);\r\n }\r\n\r\n if (time === undefined) {\r\n return invalid;\r\n }\r\n\r\n const current = cursorPos === null ? undefined\r\n : layout.segments.find((s) => cursorPos >= s.index && cursorPos <= s.index + s.length);\r\n\r\n return {time, info: current, length: current?.length ?? 0};\r\n }\r\n\r\n private static isValidValue(value?: Dayjs | null, minDateTime?: Dayjs, maxDateTime?: Dayjs, allowClear?: boolean): boolean {\r\n return (!!value && value.isValid() && (!minDateTime || value.isSameOrAfter(minDateTime)) && (!maxDateTime || value.isSameOrBefore(maxDateTime))) || (!!allowClear && value === null);\r\n }\r\n}"]}
|
|
1
|
+
{"version":3,"file":"dateTimeInput.js","sourceRoot":"","sources":["../../../../components/date/dateTimeInput.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AACvD,OAAO,WAAW,MAAM,sBAAsB,CAAC;AAC/C,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAEvC,OAAO,KAAK,MAAM,cAAc,CAAC;AACjC,OAAO,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAC,MAAM,MAAM,CAAC;AAChE,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAChC,OAAO,EAAC,sBAAsB,EAAC,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAC,YAAY,EAAC,MAAM,YAAY,CAAC;AACxC,OAAO,OAA+B,MAAM,mCAAmC,CAAC;AAEhF,OAA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,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,IAAI,CAAC,CAAC,KAAK,IAAI,SAAS,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;QAE3F,OAAO,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,mCAAI,CAAC,EAAC,CAAC;IAC/D,CAAC;IAEO,MAAM,CAAC,YAAY,CAAC,KAAoB,EAAE,WAAmB,EAAE,WAAmB,EAAE,UAAoB;QAC5G,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,WAAW,IAAI,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,IAAI,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC;IACzL,CAAC;CACJ","sourcesContent":["import React, {HTMLAttributes, RefObject} from \"react\";\r\nimport MaskedInput from \"../input/maskedInput\";\r\nimport padStart from 'lodash/padStart';\r\nimport isEqual from 'lodash/isEqual';\r\nimport debounce from 'lodash/debounce';\r\nimport {Dayjs, ManipulateType} from \"dayjs\";\r\nimport dayjs from \"d2core/dayjs\";\r\nimport {CalendarOutlined} from \"@ant-design/icons\";\r\nimport {Button, Calendar, Divider, Select, Tooltip} from \"antd\";\r\nimport {Key} from \"ts-key-enum\";\r\nimport {D2000UnixTimeNullValue} from \"d2core/types/unixTimeUtils\";\r\nimport {TooltipPlacement} from \"antd/lib/tooltip\";\r\nimport {createStyles} from \"antd-style\";\r\nimport WithCss, {WithCssInjectedProps} from \"d2coreui/components/style/withCss\";\r\nimport {SizeType} from \"antd/lib/config-provider/SizeContext\";\r\nimport i18n from \"d2core/i18n/i18n\";\r\nimport {InputProps} from \"antd/es\";\r\nimport {InputStatus} from \"antd/es/_util/statusUtils\";\r\nimport {DEFAULT_FORMAT_CHARACTERS, ESCAPE_CHAR} from \"d2coreui/components/input/mask/helpers\";\r\n\r\nconst useStyles = createStyles(({token, css}, props: WithCssInjectedProps) => {\r\n // antd colours prefix/suffix by status in every variant except borderless\r\n const statusAffix = props.variant !== \"borderless\";\r\n\r\n return {\r\n dateTimeInputCalendar: css`\r\n // adaptations of date-picker calendar styles\r\n .ant-picker-cell-in-view.ant-picker-cell-selected .ant-picker-cell-inner:not(.date-picker-item-marked) {\r\n color: inherit;\r\n background: inherit;\r\n }\r\n\r\n .ant-picker-panel:focus > .ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-selected .ant-picker-cell-inner:before {\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n bottom: 0;\r\n left: 0;\r\n z-index: 1;\r\n border: ${token.lineWidth}px ${token.lineType} ${token.colorPrimary};\r\n border-radius: ${token.borderRadiusSM}px;\r\n content: '';\r\n }\r\n\r\n .ant-picker-content thead {\r\n user-select: none;\r\n }\r\n\r\n // plays the role of antd's selected cell\r\n .date-picker-item-marked {\r\n color: ${token.colorTextLightSolid};\r\n background: ${token.colorPrimary};\r\n }\r\n\r\n .ant-picker-cell-in-view.ant-picker-cell-today .ant-picker-cell-inner::before {\r\n border: ${token.lineWidth}px ${token.lineType} ${token.colorPrimary};\r\n }\r\n\r\n // antd's cellHoverBg, text colour is left untouched on hover\r\n .ant-picker-cell:hover:not(.ant-picker-cell-in-view) .ant-picker-cell-inner, .ant-picker-cell:hover:not(.ant-picker-cell-selected):not(.ant-picker-cell-range-start):not(.ant-picker-cell-range-end):not(.ant-picker-cell-range-hover-start):not(.ant-picker-cell-range-hover-end) .ant-picker-cell-inner {\r\n background: ${token.controlItemBgHover};\r\n }\r\n\r\n .ant-picker-body {\r\n padding-bottom: 0 !important;\r\n }\r\n `,\r\n // the calendar icon is centred on this wrapper, not on the root, which a flex parent may stretch; as a block\r\n // it would put the inline-block antd input on a line box and grow by the descender gap\r\n inputWrapper: css`\r\n display: flex;\r\n position: relative;\r\n `,\r\n suffixIconHost: css`\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n `,\r\n suffixIcon: css`\r\n color: ${token.colorTextQuaternary};\r\n `,\r\n // antd colours the affix by status - see `genOutlinedStatusStyle.affixColor`\r\n suffixIconError: css`\r\n ${statusAffix ? `color: ${token.colorError};` : \"\"}\r\n `,\r\n suffixIconWarning: css`\r\n ${statusAffix ? `color: ${token.colorWarning};` : \"\"}\r\n `,\r\n suffixIconDisabled: css`\r\n color: ${token.colorTextDisabled};\r\n `,\r\n /**\r\n * antd's borderless/filled status styles colour the value text and are not guarded\r\n * against the disabled state - pickers keep colorTextDisabled, so match the picker.\r\n * Applied only for a truly disabled component, never for `inputDisabled` (open popup).\r\n */\r\n disabledText: css`\r\n && input[disabled] {\r\n color: ${token.colorTextDisabled};\r\n -webkit-text-fill-color: ${token.colorTextDisabled};\r\n }\r\n `,\r\n }\r\n});\r\n\r\n\r\n/**\r\n * Props of {@link DateTimeInput}. Remaining HTML attributes (`style`, `className`, `id`, ...) are\r\n * applied to the root `div` of the input; with {@link DateTimeInputProps.renderAsCalendar} only\r\n * `style` is used (on the calendar).\r\n */\r\ninterface DateTimeInputProps extends Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> {\r\n /**\r\n * dayjs format of the displayed and typed value, typically from `LocaleHolder.getDateTimeFormat()`.\r\n * Editable tokens: `YYYY`, `YY`, `MM`, `DD`, `HH`, `mm`, `ss`, `SSS` and the UTC offset `Z` (`+02:00`) or\r\n * `ZZ` (`+0200`); other characters are literals. Fields missing from the mask are taken from the start\r\n * of the current day. A 2-digit year keeps the century of the previous value (without one, `> 70` means 19xx,\r\n * otherwise 20xx). Including the UTC offset makes both instants of a DST fold enterable and rejects a\r\n * wall clock inside a DST gap.\r\n */\r\n mask: string\r\n /**\r\n * Current value (controlled), in the browser's local time zone. `null` shows an empty input. The D2000\r\n * \"null time\" instant is shown as an empty input with a \"Null Time\" placeholder while not focused.\r\n */\r\n value: Dayjs | null\r\n /**\r\n * Called with a new value whenever the typed text parses to a valid instant within\r\n * {@link DateTimeInputProps.minDateTime}/{@link DateTimeInputProps.maxDateTime}, when a field is stepped\r\n * (arrow keys, mouse wheel - clamped to min/max), when a day is picked in the calendar (the time of day\r\n * of the current value is kept, 00:00 when there is none) and when \"Today\" is clicked (start of today).\r\n * Called with `null` when the input is emptied and {@link DateTimeInputProps.allowClear} is set.\r\n */\r\n onChange?: (time: Dayjs | null) => void\r\n /** Called with the raw input text when an edit results in text that is not a valid (or allowed) value. */\r\n onInvalidValue?: (inputString: string) => void\r\n /** Allows the value to be cleared: an emptied input is reported as `null` and `null` counts as valid. */\r\n allowClear?: boolean\r\n /** Disables the input and the calendar popup. */\r\n disabled?: boolean\r\n /** Disables only the text input without the disabled look of the whole component - e.g. while a popup is open. */\r\n inputDisabled?: boolean\r\n /** Earliest allowed value (inclusive); earlier typed values are invalid, steps are clamped, calendar days are disabled. */\r\n minDateTime?: Dayjs\r\n /** Latest allowed value (inclusive); later typed values are invalid, steps are clamped, calendar days are disabled. */\r\n maxDateTime?: Dayjs\r\n\r\n /** antd input variant. */\r\n variant?: InputProps[\"variant\"]\r\n /** antd validation status; an unparseable or out-of-range value is always drawn as `\"error\"` regardless. */\r\n status?: InputStatus\r\n /** Renders only the masked input - no calendar icon and no calendar popup. */\r\n hidePopup?: boolean\r\n /** Renders only the calendar panel inline (no input, no \"Today\" button). */\r\n renderAsCalendar?: boolean\r\n /** Focuses the input on mount. */\r\n autoFocus?: boolean\r\n /** Placement of the calendar popup relative to the input. */\r\n placement?: TooltipPlacement;\r\n /** antd control size. */\r\n size?: SizeType;\r\n /**\r\n * Sizes the component to the rendered {@link DateTimeInputProps.mask} instead of filling the parent: the input\r\n * is as wide as the formatted value. A `width` in `style` or `inputStyle` still wins.\r\n */\r\n autoWidth?: boolean;\r\n\r\n /** Day whose month the calendar shows initially and whenever the popup opens, instead of the value's month. */\r\n defaultSelectedDate?: Dayjs\r\n /** Inclusive range of days highlighted in the calendar as selected. Intended for range pickers. */\r\n markedDateInterval?: [Dayjs, Dayjs]\r\n /** Called on mouse down over a calendar day, with that day combined with the time of day of the current value. */\r\n onDateItemMouseDown?: (date: Dayjs) => void\r\n /** Called on mouse up over a calendar day, with that day combined with the time of day of the current value. */\r\n onDateItemMouseUp?: (date: Dayjs) => void\r\n /** Called (debounced by 100 ms) when the mouse moves over a calendar day, with the start of that day. */\r\n onDateItemMouseOver?: (date: Dayjs) => void\r\n\r\n /** Style of the inner text input element (the `style` prop styles the wrapper). */\r\n inputStyle?: React.CSSProperties\r\n /** Container the calendar popup and its month/year dropdowns are rendered into. */\r\n getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;\r\n\r\n /** Disables the Enter key in the calendar, which otherwise commits the day currently shown as selected. */\r\n ignoreKeyStrokes?: boolean\r\n}\r\n\r\ninterface DateTimeInputState {\r\n valid: boolean\r\n currentPos: number | null\r\n currentInfo: MaskResult\r\n popupCalendarVisible: boolean\r\n\r\n calendarSelectedDate: Dayjs\r\n focused: boolean\r\n}\r\n\r\ninterface MaskResult {\r\n time: Dayjs | undefined\r\n info: MaskSegment | undefined\r\n length: number\r\n}\r\n\r\n/** the units the mask can address - a subset of ManipulateType, without the week units */\r\ntype DateTimeUnit = \"ms\" | \"s\" | \"m\" | \"h\" | \"y\" | \"M\" | \"d\";\r\n\r\ninterface InfoEntry {\r\n key: string | string[]\r\n min: number | number[]\r\n max: number | number[]\r\n unit: DateTimeUnit\r\n part: keyof WallClockParts\r\n}\r\n\r\n/**\r\n * Calendar reading of a value, as typed. Kept apart from Dayjs on purpose - assembling a Dayjs\r\n * normalises a wall clock that does not exist (during a DST gap 02:30 silently becomes 03:30),\r\n * which would hide exactly the case the UTC offset is there to resolve.\r\n */\r\ninterface WallClockParts {\r\n y: number\r\n /** 0-11, as in Dayjs */\r\n M: number\r\n D: number\r\n h: number\r\n m: number\r\n s: number\r\n ms: number\r\n}\r\n\r\n/**\r\n * One editable field of the mask, located in the *rendered* value rather than in the mask\r\n * string. The two differ as soon as the mask contains a token whose rendered width is not\r\n * its own length - dayjs prints `Z` as \"+02:00\" and `ZZ` as \"+0200\".\r\n */\r\ninterface MaskSegment {\r\n /** the mask token this segment was built from, e.g. \"YYYY\" or \"Z\" */\r\n token: string\r\n /** offset of the segment in the rendered value */\r\n index: number\r\n /** length of the segment in the rendered value */\r\n length: number\r\n /** numeric field description - undefined for the UTC-offset segment */\r\n entry: InfoEntry | undefined\r\n min: number\r\n max: number\r\n}\r\n\r\ninterface MaskLayout {\r\n /** MaskedInput pattern, in rendered-value coordinates */\r\n pattern: string\r\n segments: MaskSegment[]\r\n}\r\n\r\nconst DATE_TIME_DATA_MAP: InfoEntry[] = [\r\n {key: \"SSS\", min: 0, max: 999, unit: \"ms\", part: \"ms\"},\r\n {key: \"ss\", min: 0, max: 59, unit: \"s\", part: \"s\"},\r\n {key: \"mm\", min: 0, max: 59, unit: \"m\", part: \"m\"},\r\n {key: \"HH\", min: 0, max: 23, unit: \"h\", part: \"h\"},\r\n {key: [\"YYYY\", \"YY\"], min: [1900, 0], max: [9999, 99], unit: \"y\", part: \"y\"},\r\n {key: \"MM\", min: 1, max: 12, unit: \"M\", part: \"M\"},\r\n {key: \"DD\", min: 1, max: 31, unit: \"d\", part: \"D\"},\r\n];\r\n\r\n/** numeric mask tokens, longest first so that YYYY is not read as YY */\r\nconst NUMBER_TOKENS: string[] = [\"SSS\", \"YYYY\", \"YY\", \"DD\", \"MM\", \"HH\", \"mm\", \"ss\"];\r\n\r\n/** UTC-offset tokens mapped to the width dayjs renders them with */\r\nconst OFFSET_TOKENS: { token: string, length: number }[] = [\r\n {token: \"ZZ\", length: 5}, // +0200\r\n {token: \"Z\", length: 6}, // +02:00\r\n];\r\n\r\n/**\r\n * MaskedInput format character for the sign of the UTC offset. A letter can never collide with\r\n * a literal of the generated pattern - letters of the mask are always turned into field slots.\r\n */\r\nconst SIGN_FORMAT_CHAR = \"S\";\r\nconst SIGN_FORMAT_CHARACTERS = {\r\n [SIGN_FORMAT_CHAR]: {validate: (char: string) => char === \"+\" || char === \"-\"},\r\n};\r\n\r\nconst MAX_UTC_OFFSET_MINUTES = 14 * 60;\r\n\r\nconst MIN_TIME = dayjs.unix(0);\r\nconst MAX_TIME = dayjs().add(1000, \"year\");\r\n\r\n/**\r\n * Globally changes the lowest year accepted in a `YYYY` field of every {@link DateTimeInput} from 1900 to 1902.\r\n * Stepping and the calendar stay limited to dates from the Unix epoch on.\r\n */\r\nexport function allowDatesBeforeEpoch() {\r\n DATE_TIME_DATA_MAP[4].min = 1902;\r\n}\r\n\r\n/** the numeric field a mask token belongs to, with the min/max of that particular token */\r\nfunction findInfoEntry(token: string): { entry: InfoEntry, min: number, max: number } | undefined {\r\n for (const entry of DATE_TIME_DATA_MAP) {\r\n if (Array.isArray(entry.key)) {\r\n const i = entry.key.indexOf(token);\r\n if (i !== -1) {\r\n return {\r\n entry,\r\n min: Array.isArray(entry.min) ? entry.min[i] : entry.min,\r\n max: Array.isArray(entry.max) ? entry.max[i] : entry.max,\r\n };\r\n }\r\n } else if (entry.key === token) {\r\n return {entry, min: entry.min as number, max: entry.max as number};\r\n }\r\n }\r\n return undefined;\r\n}\r\n\r\nfunction escapePatternChar(char: string): string {\r\n return char in DEFAULT_FORMAT_CHARACTERS || char === SIGN_FORMAT_CHAR || char === ESCAPE_CHAR\r\n ? ESCAPE_CHAR + char\r\n : char;\r\n}\r\n\r\n/**\r\n * Walks the mask once and records, for every editable field, where it lands in the value as\r\n * dayjs renders it. Both the MaskedInput pattern and the parser positions are derived from\r\n * this, so tokens wider than their mask representation (`Z`, `ZZ`) no longer shift everything\r\n * that follows them.\r\n */\r\nfunction buildMaskLayout(mask: string): MaskLayout {\r\n const segments: MaskSegment[] = [];\r\n let pattern = \"\";\r\n // kept separately from pattern.length - an escaped literal takes two characters of the\r\n // pattern source but still only one character of the rendered value\r\n let renderIndex = 0;\r\n let i = 0;\r\n\r\n while (i < mask.length) {\r\n const offset = OFFSET_TOKENS.find((t) => mask.startsWith(t.token, i));\r\n if (offset !== undefined) {\r\n segments.push({token: offset.token, index: renderIndex, length: offset.length, entry: undefined, min: 0, max: 0});\r\n pattern += SIGN_FORMAT_CHAR + (offset.length === 6 ? \"11:11\" : \"1111\");\r\n renderIndex += offset.length;\r\n i += offset.token.length;\r\n continue;\r\n }\r\n\r\n const token = NUMBER_TOKENS.find((t) => mask.startsWith(t, i));\r\n const found = token !== undefined ? findInfoEntry(token) : undefined;\r\n if (token !== undefined && found !== undefined) {\r\n segments.push({token, index: renderIndex, length: token.length, entry: found.entry, min: found.min, max: found.max});\r\n pattern += \"1\".repeat(token.length);\r\n renderIndex += token.length;\r\n i += token.length;\r\n continue;\r\n }\r\n\r\n // unknown token - keep the historical behaviour of one digit slot per letter\r\n pattern += /[a-zA-Z]/.test(mask[i]) ? \"1\" : escapePatternChar(mask[i]);\r\n renderIndex++;\r\n i++;\r\n }\r\n\r\n return {pattern, segments};\r\n}\r\n\r\nconst CALENDAR_ICON_WIDTH = 28;\r\n\r\nlet measureContext: CanvasRenderingContext2D | null = null;\r\n\r\nfunction measureTextWidth(text: string, font: string): number {\r\n measureContext ??= document.createElement(\"canvas\").getContext(\"2d\");\r\n\r\n if (!measureContext) {\r\n return 0;\r\n }\r\n\r\n measureContext.font = font;\r\n return measureContext.measureText(text).width;\r\n}\r\n\r\n/**\r\n * Masked date-time input with a calendar popup - a controlled replacement for antd `DatePicker`.\r\n * The value is typed field by field according to {@link DateTimeInputProps.mask}; ArrowUp/ArrowDown and the\r\n * mouse wheel step the field under the cursor. The calendar opens on right-click or via the calendar icon.\r\n *\r\n * @example\r\n * const [value, setValue] = useState<Dayjs | null>(dayjs().startOf(\"hour\"));\r\n *\r\n * <DateTimeInput\r\n * mask={LocaleHolder.getDateTimeFormat(true, true)}\r\n * value={value}\r\n * onChange={setValue}\r\n * allowClear\r\n * />\r\n */\r\nexport default class DateTimeInput extends React.Component<DateTimeInputProps, DateTimeInputState> {\r\n private inputRef: RefObject<MaskedInput> = React.createRef();\r\n private today: Dayjs = dayjs();\r\n private layoutMask: string;\r\n private layout: MaskLayout;\r\n\r\n constructor(props: Readonly<DateTimeInputProps>) {\r\n super(props);\r\n this.layoutMask = props.mask;\r\n this.layout = buildMaskLayout(props.mask);\r\n this.state = {\r\n valid: DateTimeInput.isValidValue(props.value, props.minDateTime, props.maxDateTime, props.allowClear),\r\n currentPos: null,\r\n currentInfo: {\r\n info: undefined,\r\n time: undefined,\r\n length: 0\r\n },\r\n popupCalendarVisible: false,\r\n calendarSelectedDate: props.defaultSelectedDate?.clone() ?? props.value?.clone() ?? dayjs().startOf('day'),\r\n focused: false,\r\n };\r\n\r\n this.recalc = this.recalc.bind(this);\r\n this.increment = this.increment.bind(this);\r\n this.decrement = this.decrement.bind(this);\r\n this.onItemMouseOver = debounce(this.onItemMouseOver.bind(this), 100, {maxWait: 100});\r\n }\r\n\r\n componentDidMount(): void {\r\n // React registers `wheel` as a passive listener, so preventDefault() from an onWheel\r\n // prop is ignored and the page scrolls along with the value - hence a native listener\r\n this.input?.addEventListener(\"wheel\", this.onWheel, {passive: false});\r\n document.fonts?.ready.then(() => {\r\n if (this.props.autoWidth) {\r\n this.forceUpdate();\r\n }\r\n });\r\n }\r\n\r\n componentWillUnmount(): void {\r\n this.input?.removeEventListener(\"wheel\", this.onWheel);\r\n }\r\n\r\n componentDidUpdate(prevProps: Readonly<DateTimeInputProps>, _prevState: Readonly<DateTimeInputState>, _snapshot?: any): void {\r\n if (!isEqual(prevProps, this.props) && this.inputRef.current !== null) {\r\n this.inputRef.current.input.selectionStart = this.state.currentPos;\r\n this.inputRef.current.input.selectionEnd = this.state.currentPos;\r\n if (prevProps.value !== this.props.value) {\r\n this.setState({valid: DateTimeInput.isValidValue(this.props.value, this.props.minDateTime, this.props.maxDateTime, this.props.allowClear)});\r\n }\r\n }\r\n }\r\n\r\n /** The underlying `<input>` element, `undefined` before mount or with {@link DateTimeInputProps.renderAsCalendar}. */\r\n get input() {\r\n return this.inputRef.current?.input;\r\n }\r\n\r\n private getLayout(): MaskLayout {\r\n if (this.layoutMask !== this.props.mask) {\r\n this.layoutMask = this.props.mask;\r\n this.layout = buildMaskLayout(this.props.mask);\r\n }\r\n return this.layout;\r\n }\r\n\r\n /** Moves the keyboard focus to the text input. */\r\n focus() {\r\n this.inputRef.current?.focus();\r\n }\r\n\r\n private canStep(direction: number): boolean {\r\n return this.nextValue(direction) !== undefined;\r\n }\r\n\r\n /**\r\n * The value one step up/down from the current one, or undefined when the field under the\r\n * cursor cannot be stepped. Over the UTC-offset field a step means \"the other offset of the\r\n * same wall clock\", which only exists inside a DST fold - elsewhere the arrows stay inert.\r\n */\r\n private nextValue(direction: number): Dayjs | undefined {\r\n const segment = this.state.currentInfo.info;\r\n const value = this.props.value;\r\n const step = direction > 0 ? 1 : -1;\r\n\r\n if (segment === undefined || !value) {\r\n return undefined;\r\n }\r\n\r\n if (segment.entry === undefined) {\r\n const candidate = value.clone().add(step, \"h\");\r\n return DateTimeInput.isSameWallClock(DateTimeInput.toWallClock(candidate), DateTimeInput.toWallClock(value))\r\n ? candidate\r\n : undefined;\r\n }\r\n\r\n return DateTimeInput.checkDateValueValidity(value, step, segment.entry.unit)\r\n ? value.clone().add(step, segment.entry.unit)\r\n : undefined;\r\n }\r\n\r\n private step(direction: number): void {\r\n const next = this.nextValue(direction);\r\n\r\n if (next !== undefined) {\r\n if (!!this.props.maxDateTime && next.isAfter(this.props.maxDateTime)) {\r\n this.props.onChange?.(this.props.maxDateTime.clone());\r\n } else if (!!this.props.minDateTime && next.isBefore(this.props.minDateTime)) {\r\n this.props.onChange?.(this.props.minDateTime.clone());\r\n } else {\r\n this.props.onChange?.(next);\r\n }\r\n }\r\n\r\n this.inputRef.current?.focus();\r\n }\r\n\r\n /** the page must not scroll while the wheel is editing the value */\r\n private onWheel = (event: WheelEvent): void => {\r\n if (this.props.disabled || this.props.inputDisabled) {\r\n return;\r\n }\r\n if (event.deltaY > 0 && this.canStep(-1)) {\r\n this.decrement();\r\n event.preventDefault();\r\n } else if (event.deltaY < 0 && this.canStep(1)) {\r\n this.increment();\r\n event.preventDefault();\r\n }\r\n };\r\n\r\n /** Re-reads the cursor position and the mask field under it; called internally on key up and mouse up. */\r\n recalc(): void {\r\n if (this.inputRef.current !== null) {\r\n this.setState({\r\n currentInfo: DateTimeInput.parseDateTimeFormat(this.props.value, this.inputRef.current.input.value, this.getLayout(), this.inputRef.current.input.selectionStart),\r\n currentPos: this.inputRef.current.input.selectionStart,\r\n });\r\n }\r\n }\r\n\r\n private increment(): void {\r\n this.step(1);\r\n }\r\n\r\n private decrement(): void {\r\n this.step(-1);\r\n }\r\n\r\n /** Forwards a hovered calendar day to {@link DateTimeInputProps.onDateItemMouseOver}; debounced by 100 ms. */\r\n onItemMouseOver(itemDate: Dayjs) {\r\n this.props.onDateItemMouseOver?.(itemDate);\r\n }\r\n\r\n private renderCalendarNavigation(value: Dayjs) {\r\n const start = 0;\r\n const end = 12;\r\n const monthOptions = [];\r\n\r\n const current = value.clone();\r\n const localeData = value.localeData();\r\n const months = [];\r\n for (let i = 0; i < 12; i++) {\r\n months.push(localeData.months(current.month(i)));\r\n }\r\n\r\n for (let index = start; index < end; index++) {\r\n monthOptions.push(\r\n <Select.Option key={`${index}`} value={`${index}`}>\r\n {months[index]}\r\n </Select.Option>,\r\n );\r\n }\r\n const month = value.month();\r\n\r\n const year = value.year();\r\n const options = [];\r\n for (let i = year - 4; i <= year + 2; i += 1) {\r\n options.push(\r\n <Select.Option key={`${i}`} value={`${i}`}>\r\n {i}\r\n </Select.Option>,\r\n );\r\n }\r\n\r\n const calendarSelectedDate = this.state.calendarSelectedDate;\r\n\r\n return (\r\n <div style={{display: \"flex\", marginBottom: 6}}>\r\n <div style={{display: \"flex\", width: 140}}>\r\n <Button style={{width: 10, padding: 0}} size=\"small\" type=\"text\" tabIndex={-1}\r\n disabled={!DateTimeInput.checkDateValueValidity(calendarSelectedDate, -1, \"month\")}\r\n onClick={() => {\r\n this.setState({calendarSelectedDate: calendarSelectedDate.subtract(1, \"month\")});\r\n }}\r\n className=\"ant-picker-header-prev-btn\"><span\r\n className=\"ant-picker-prev-icon\"/></Button>\r\n <Select\r\n style={{flex: \"1 1 auto\"}}\r\n size=\"small\"\r\n popupMatchSelectWidth={false}\r\n styles={{popup: {root: {zIndex: 2070}}}}\r\n getPopupContainer={this.props.getPopupContainer}\r\n value={String(month)}\r\n onChange={selectedMonth => {\r\n this.setState({calendarSelectedDate: calendarSelectedDate.month(parseInt(selectedMonth, 10))});\r\n }}\r\n >\r\n {monthOptions}\r\n </Select>\r\n <Button style={{width: 10, padding: 0}} size=\"small\" type=\"text\" tabIndex={-1}\r\n className=\"ant-picker-header-next-btn\"\r\n onClick={() => {\r\n this.setState({calendarSelectedDate: calendarSelectedDate.add(1, \"month\")});\r\n }}>\r\n <span className=\"ant-picker-next-icon\"/>\r\n </Button>\r\n </div>\r\n <div style={{display: \"flex\", width: 110}}>\r\n <Button style={{width: 12, padding: 0}} size=\"small\" type=\"text\" tabIndex={-1}\r\n className=\"ant-picker-header-prev-btn\"\r\n onClick={() => {\r\n this.setState({calendarSelectedDate: calendarSelectedDate.subtract(1, \"year\")});\r\n }}>\r\n <span className=\"ant-picker-prev-icon\"/>\r\n </Button>\r\n <Select\r\n size=\"small\"\r\n style={{width: 84}}\r\n popupMatchSelectWidth={false}\r\n styles={{popup: {root: {zIndex: 2070}}}}\r\n getPopupContainer={this.props.getPopupContainer}\r\n onChange={newYear => {\r\n this.setState({calendarSelectedDate: calendarSelectedDate.year(parseInt(newYear, 10))});\r\n }}\r\n value={String(year)}\r\n >\r\n {options}\r\n </Select>\r\n <Button style={{width: 12, padding: 0}} size=\"small\" type=\"text\" tabIndex={-1}\r\n className=\"ant-picker-header-next-btn\"\r\n onClick={() => {\r\n this.setState({calendarSelectedDate: calendarSelectedDate.add(1, \"year\")});\r\n }}>\r\n <span className=\"ant-picker-next-icon\"/>\r\n </Button>\r\n </div>\r\n </div>\r\n );\r\n }\r\n\r\n /** Renders the calendar panel - the popup content, or the whole component with {@link DateTimeInputProps.renderAsCalendar}. */\r\n renderCalendar(): React.ReactElement {\r\n return (<div\r\n onKeyDown={!this.props.ignoreKeyStrokes ? (e) => {\r\n if (e.key === Key.Enter) {\r\n var tagName = (e.target as any)?.tagName?.toLowerCase();\r\n if (tagName !== \"input\") {\r\n this.props.onChange?.(this.state.calendarSelectedDate);\r\n }\r\n }\r\n } : undefined}\r\n onMouseOver={(e) => {\r\n if (e.target instanceof HTMLTableCellElement) {\r\n const date = dayjs(e.target.title, \"YYYY-MM-DD\");\r\n this.onItemMouseOver(date);\r\n }\r\n }}>\r\n <WithCss useStyles={useStyles}>{(css) =>\r\n <Calendar\r\n className={css.styles.dateTimeInputCalendar}\r\n fullscreen={false}\r\n style={this.props.renderAsCalendar ? this.props.style : undefined}\r\n fullCellRender={((date: Dayjs) => {\r\n let className = date.isSame(this.today, \"date\") ? 'ant-picker-cell-inner ant-picker-calendar-date ant-picker-calendar-date-today' : 'ant-picker-cell-inner ant-picker-calendar-date';\r\n const markedDateInterval = this.props.markedDateInterval;\r\n if (markedDateInterval && (markedDateInterval[0].isBefore(date) || markedDateInterval[0].isSame(date, \"millisecond\")) &&\r\n (markedDateInterval[1].isAfter(date) || markedDateInterval[1].isSame(date, \"millisecond\"))) {\r\n className += \" date-picker-item-marked\";\r\n } else if (date.isSame(this.props.value, \"date\")) {\r\n className += \" date-picker-item-marked\";\r\n }\r\n return (\r\n <div className={className} style={{userSelect: \"none\"}}\r\n onKeyDown={(e) => {\r\n if (e.key === Key.Enter) {\r\n let newValue = this.props.value?.clone() ?? dayjs().startOf(\"day\");\r\n newValue = newValue.year(date.year()).month(date.month()).date(date.date());\r\n this.props.onChange?.(newValue);\r\n }\r\n }}\r\n onMouseDown={() => {\r\n let newValue = this.props.value?.clone() ?? dayjs().startOf(\"day\");\r\n newValue = newValue.year(date.year()).month(date.month()).date(date.date());\r\n this.props.onDateItemMouseDown?.(newValue);\r\n }}\r\n onMouseUp={() => {\r\n let newValue = this.props.value?.clone() ?? dayjs().startOf(\"day\");\r\n newValue = newValue.year(date.year()).month(date.month()).date(date.date());\r\n this.props.onDateItemMouseUp?.(newValue);\r\n }}\r\n >\r\n <div className={`ant-picker-calendar-date-value`}>\r\n {padStart(\"\" + date.date(), 2, '0')}\r\n </div>\r\n <div className={`ant-picker-calendar-date-content`}>\r\n </div>\r\n </div>\r\n );\r\n })}\r\n headerRender={({value}) => {\r\n return this.renderCalendarNavigation(value);\r\n }}\r\n value={this.state.calendarSelectedDate}\r\n validRange={[this.props.minDateTime ?? MIN_TIME, this.props.maxDateTime ?? MAX_TIME]}\r\n onSelect={(value) => {\r\n if (window.event instanceof MouseEvent) {\r\n let newValue = this.props.value?.clone() ?? dayjs().startOf(\"day\");\r\n newValue = newValue.year(value.year()).month(value.month()).date(value.date());\r\n this.props.onChange?.(newValue);\r\n }\r\n this.setState({calendarSelectedDate: value, popupCalendarVisible: false});\r\n }}\r\n />\r\n }</WithCss>\r\n {!this.props.renderAsCalendar &&\r\n <>\r\n <Divider style={{margin: \"0 0 4px\"}}/>\r\n <Button\r\n block\r\n size=\"small\"\r\n color=\"primary\"\r\n variant=\"text\"\r\n onClick={() => {\r\n this.props.onChange?.(dayjs().startOf(\"day\"));\r\n this.setState({popupCalendarVisible: false});\r\n }}\r\n >\r\n {i18n(\"Today\")}\r\n </Button>\r\n </>\r\n }\r\n </div>\r\n );\r\n }\r\n\r\n /**\r\n * Width of the formatted {@link DateTimeInputProps.mask} in the font antd gives the input (`fontSizeLG` for\r\n * `large`, `fontSize` otherwise). Computed from the theme rather than read from the DOM, so it is right in the\r\n * very first render - a later correction would be animated by the input's `transition`.\r\n * `tabular-nums` must stay off - in Segoe UI it widens the digits past the measured \"0\" and the value overflows.\r\n */\r\n private getInputTextWidth(fontFamily: string, fontSize: number): number {\r\n // all digits as \"0\" so that the width holds for any value, not just today's\r\n const sample = dayjs().locale(\"locale.d2000\").format(this.props.mask).replace(/\\d/g, \"0\");\r\n return Math.ceil(measureTextWidth(sample, `${fontSize}px ${fontFamily}`));\r\n }\r\n\r\n /** Renders the masked input with its calendar icon, without the popup. */\r\n renderInput() {\r\n const {\r\n mask,\r\n value,\r\n onChange,\r\n onInvalidValue,\r\n style,\r\n disabled,\r\n inputDisabled,\r\n variant,\r\n hidePopup,\r\n renderAsCalendar,\r\n allowClear,\r\n minDateTime,\r\n maxDateTime,\r\n onDateItemMouseDown,\r\n onDateItemMouseOver,\r\n onDateItemMouseUp,\r\n markedDateInterval,\r\n inputStyle,\r\n getPopupContainer,\r\n autoFocus,\r\n className,\r\n size,\r\n status,\r\n autoWidth,\r\n ...props\r\n } = this.props;\r\n\r\n const unix: number | undefined = value?.valueOf();\r\n // an unparseable input is an error even when the caller reports no status\r\n const mergedStatus: InputStatus = status || (!this.state.valid ? \"error\" : \"\");\r\n\r\n // the root has to stay a plain DOM element - Tooltip in render() clones it to inject\r\n // its trigger handlers, and a WithCss root would swallow them\r\n return (\r\n <div style={{...(autoWidth ? {width: \"fit-content\"} : {}), ...style, position: \"relative\"}} {...props} className={className}>\r\n <WithCss useStyles={useStyles} props={{variant, size}}>{({styles, cx, theme}, {size: mergedSize}) => {\r\n const maskedInputStyle: React.CSSProperties = !this.state.valid ? {color: theme.colorError} : {};\r\n if (autoWidth) {\r\n Object.assign(maskedInputStyle, {\r\n // the measured width is the minimum - the input still fills a root stretched by the caller\r\n flexGrow: 1,\r\n boxSizing: \"content-box\",\r\n width: this.getInputTextWidth(theme.fontFamily, mergedSize === \"large\" ? theme.fontSizeLG : theme.fontSize),\r\n }, !hidePopup && {paddingRight: CALENDAR_ICON_WIDTH});\r\n }\r\n if (inputStyle) {\r\n Object.assign(maskedInputStyle, inputStyle);\r\n }\r\n\r\n return (\r\n <>\r\n <div\r\n className={cx(styles.inputWrapper, {[styles.disabledText]: !!disabled})}\r\n onKeyDown={(event) => {\r\n if (event.code === \"ArrowUp\") { // up\r\n this.increment();\r\n event.preventDefault();\r\n event.stopPropagation();\r\n } else if (event.code === \"ArrowDown\") { // down\r\n this.decrement();\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }\r\n }}>\r\n <MaskedInput mask={this.getLayout().pattern}\r\n formatCharacters={SIGN_FORMAT_CHARACTERS}\r\n variant={variant}\r\n status={mergedStatus}\r\n ref={this.inputRef}\r\n style={maskedInputStyle}\r\n size={size}\r\n value={(this.state.focused || unix !== D2000UnixTimeNullValue * 1000) ? (value?.locale(\"locale.d2000\").format(this.props.mask) ?? \"\") : \"\"}\r\n placeholder={(!this.state.focused && unix === D2000UnixTimeNullValue * 1000) ? \"Null Time\" : undefined}\r\n onFocus={(event => {\r\n event.target.selectionStart = event.target.selectionEnd = this.state.currentPos;\r\n this.setState({focused: true});\r\n })}\r\n onBlur={() => {\r\n this.setState({focused: false});\r\n }}\r\n autoFocus={autoFocus}\r\n disabled={disabled || inputDisabled}\r\n onMouseUp={this.recalc}\r\n onKeyUp={this.recalc}\r\n onChange={(event) => {\r\n const inputString = event.target.value;\r\n const value: MaskResult = DateTimeInput.parseDateTimeFormat(this.props.value, inputString, this.getLayout(), event.target.selectionStart);\r\n const valid: boolean = DateTimeInput.isValidValue(value.time, this.props.minDateTime, this.props.maxDateTime, this.props.allowClear) || (!!this.props.allowClear && !inputString);\r\n\r\n if (value.time !== undefined && valid) {\r\n onChange?.(value.time.clone());\r\n } else if (!!this.props.allowClear && !inputString) {\r\n onChange?.(null);\r\n } else {\r\n onInvalidValue?.(inputString);\r\n }\r\n this.setState({\r\n valid: valid,\r\n currentInfo: value\r\n })\r\n }}/>\r\n {!hidePopup && !renderAsCalendar && <div\r\n className={styles.suffixIconHost}\r\n style={{\r\n width: CALENDAR_ICON_WIDTH,\r\n opacity: 1,\r\n height: \"100%\",\r\n cursor: disabled ? \"not-allowed\" : \"pointer\",\r\n background: \"transparent\",\r\n position: \"absolute\",\r\n top: 0,\r\n right: 0,\r\n }}\r\n onClick={(event) => {\r\n if (document.createEvent) {\r\n var ev = document.createEvent('HTMLEvents');\r\n ev.initEvent('contextmenu', true, false);\r\n event.target.dispatchEvent(ev);\r\n }\r\n }}\r\n >\r\n <CalendarOutlined className={cx(styles.suffixIcon, {\r\n [styles.suffixIconError]: !disabled && mergedStatus === \"error\",\r\n [styles.suffixIconWarning]: !disabled && mergedStatus === \"warning\",\r\n [styles.suffixIconDisabled]: !!disabled,\r\n })}/>\r\n </div>}\r\n </div>\r\n </>\r\n );\r\n }}</WithCss>\r\n </div>\r\n );\r\n }\r\n\r\n render(): any {\r\n if (this.props.renderAsCalendar) {\r\n return this.renderCalendar();\r\n } else if (this.props.hidePopup) {\r\n return this.renderInput();\r\n } else {\r\n return (\r\n <WithCss useStyles={useStyles}>{({theme}) =>\r\n <Tooltip color={theme.colorBgElevated} trigger={this.props.disabled ? [] : [\"contextMenu\"]}\r\n getPopupContainer={this.props.getPopupContainer}\r\n styles={{body: {maxHeight: \"100vh\", overflowY: \"auto\", overflowX: \"hidden\", width: 266}}}\r\n open={this.state.popupCalendarVisible}\r\n onOpenChange={(visible) => {\r\n this.setState({popupCalendarVisible: visible});\r\n if (visible) {\r\n this.setState({calendarSelectedDate: this.props.defaultSelectedDate?.clone() ?? this.props.value?.clone() ?? dayjs().startOf(\"day\")})\r\n }\r\n }}\r\n title={this.renderCalendar()}\r\n placement={this.props.placement}\r\n >\r\n {this.renderInput()}\r\n </Tooltip>\r\n }</WithCss>\r\n );\r\n }\r\n }\r\n\r\n private static toWallClock(value: Dayjs): WallClockParts {\r\n return {\r\n y: value.year(), M: value.month(), D: value.date(),\r\n h: value.hour(), m: value.minute(), s: value.second(), ms: value.millisecond(),\r\n };\r\n }\r\n\r\n /** the two instants of a DST fold share the wall clock and differ only in the UTC offset */\r\n private static isSameWallClock(a: WallClockParts, b: WallClockParts): boolean {\r\n return a.y === b.y && a.M === b.M && a.D === b.D &&\r\n a.h === b.h && a.m === b.m && a.s === b.s && a.ms === b.ms;\r\n }\r\n\r\n private static parseUtcOffset(text: string): number | undefined {\r\n const match = /^([+-])(\\d{2}):?(\\d{2})$/.exec(text);\r\n\r\n if (match === null) {\r\n return undefined;\r\n }\r\n\r\n const minutes = Number(match[2]) * 60 + Number(match[3]);\r\n if (Number(match[3]) > 59 || minutes > MAX_UTC_OFFSET_MINUTES) {\r\n return undefined;\r\n }\r\n\r\n return match[1] === \"-\" ? -minutes : minutes;\r\n }\r\n\r\n /**\r\n * Picks the instant that shows the given wall clock at the given UTC offset. Inside a DST\r\n * fold two instants share the wall clock and the offset is what tells them apart; inside a\r\n * DST gap no instant matches, so the value is reported as invalid. A wall clock that does\r\n * not exist at all (31.02.) is rejected by the same check rather than rolled over.\r\n */\r\n private static resolveWallClock(nominal: WallClockParts, offsetMinutes: number): Dayjs | undefined {\r\n const utcMs = Date.UTC(nominal.y, nominal.M, nominal.D, nominal.h, nominal.m, nominal.s, nominal.ms);\r\n const candidate = dayjs(utcMs - offsetMinutes * 60000);\r\n\r\n return candidate.utcOffset() === offsetMinutes && DateTimeInput.isSameWallClock(DateTimeInput.toWallClock(candidate), nominal)\r\n ? candidate\r\n : undefined;\r\n }\r\n\r\n private static checkDateValueValidity(value: Dayjs | null, offset: number, unit: ManipulateType | undefined) {\r\n if (value === null) {\r\n return false;\r\n }\r\n let v = value.clone().add(offset, unit);\r\n return v.isValid() && v.isSameOrAfter(dayjs(0));\r\n }\r\n\r\n private static parseDateTimeFormat(previousTime: Dayjs | null, value: string, layout: MaskLayout, cursorPos: number | null): MaskResult {\r\n const invalid: MaskResult = {time: undefined, info: undefined, length: 0};\r\n const base = dayjs().startOf(\"day\");\r\n // fields the mask does not carry keep the value they have in `base`\r\n const nominal: WallClockParts = DateTimeInput.toWallClock(base);\r\n let time: Dayjs | undefined = base;\r\n\r\n // iterated in DATE_TIME_DATA_MAP order, not in mask order - the day has to be set after\r\n // the year and the month so that it is not clamped by the month it is temporarily in\r\n for (const v of DATE_TIME_DATA_MAP) {\r\n const segment = layout.segments.find((s) => s.entry === v);\r\n\r\n if (segment === undefined) {\r\n continue;\r\n }\r\n\r\n let val: number = Number(value.substring(segment.index, segment.index + segment.length));\r\n\r\n if (isNaN(val) || val < segment.min || val > segment.max) {\r\n return invalid;\r\n }\r\n\r\n if (v.unit === \"M\") {\r\n val--; // 0-11\r\n }\r\n\r\n if (v.unit === \"y\" && segment.length === 2) {\r\n const century: number = (previousTime != null && previousTime.isValid()) ? Math.floor(previousTime.year() / 100) * 100 : (val > 70 ? 1900 : 2000); // if short year\r\n val += century;\r\n }\r\n\r\n nominal[v.part] = val;\r\n time = time?.set(v.unit === \"d\" ? 'D' : v.unit, val);\r\n }\r\n\r\n // `time` has already normalised a wall clock that does not exist - when the mask carries\r\n // the UTC offset, rebuild the instant from the typed reading instead, so that both sides\r\n // of a DST fold are reachable and a DST gap comes out invalid\r\n const offsetSegment = layout.segments.find((s) => s.entry === undefined);\r\n if (offsetSegment !== undefined) {\r\n const offset = DateTimeInput.parseUtcOffset(value.substring(offsetSegment.index, offsetSegment.index + offsetSegment.length));\r\n time = offset === undefined ? undefined : DateTimeInput.resolveWallClock(nominal, offset);\r\n }\r\n\r\n if (time === undefined) {\r\n return invalid;\r\n }\r\n\r\n const current = cursorPos === null ? undefined\r\n : layout.segments.find((s) => cursorPos >= s.index && cursorPos <= s.index + s.length);\r\n\r\n return {time, info: current, length: current?.length ?? 0};\r\n }\r\n\r\n private static isValidValue(value?: Dayjs | null, minDateTime?: Dayjs, maxDateTime?: Dayjs, allowClear?: boolean): boolean {\r\n return (!!value && value.isValid() && (!minDateTime || value.isSameOrAfter(minDateTime)) && (!maxDateTime || value.isSameOrBefore(maxDateTime))) || (!!allowClear && value === null);\r\n }\r\n}"]}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { BaseReturnType } from 'antd-style';
|
|
2
2
|
import { ReturnStyles } from "antd-style/lib/factories/createStyles/types";
|
|
3
|
-
import { SizeType } from "antd/
|
|
3
|
+
import { SizeType } from "antd/es/config-provider/SizeContext";
|
|
4
4
|
import { Variant } from "antd/es/config-provider";
|
|
5
|
-
/**
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Render function of {@link WithCss}; receives the result of `useStyles` (`styles`, `cx`, `theme`, ...) and the
|
|
7
|
+
* resolved `size` and `variant` - read them from here, not from the component's own props, which may leave them to
|
|
8
|
+
* the antd context.
|
|
9
|
+
*/
|
|
10
|
+
type WithCssChildren<T extends BaseReturnType> = (css: ReturnStyles<T>, resolved: WithCssInjectedProps) => any;
|
|
7
11
|
/** Props that {@link WithCss} resolves before passing them to `useStyles`. */
|
|
8
12
|
type WithCssOwnProps = {
|
|
9
13
|
size?: SizeType;
|
|
@@ -28,7 +32,8 @@ interface WithCssProperties<T extends BaseReturnType, P extends WithCssOwnProps>
|
|
|
28
32
|
}
|
|
29
33
|
/**
|
|
30
34
|
* Lets class components use an antd-style `createStyles` hook: calls `useStyles` and renders `children(css)`.
|
|
31
|
-
* `size` is resolved as `props.size`, then the enclosing `Space.Compact` size, then
|
|
35
|
+
* `size` is resolved as `props.size`, then the enclosing `Space.Compact` size, then the `ConfigProvider`
|
|
36
|
+
* `componentSize`, then `'middle'`; `variant` as
|
|
32
37
|
* `props.variant`, then the `ConfigProvider` variant, then `'outlined'`.
|
|
33
38
|
*/
|
|
34
39
|
export default function WithCss<T extends BaseReturnType, P extends WithCssOwnProps = {}>({ useStyles, children, props }: WithCssProperties<T, P>): any;
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
2
|
import { SpaceCompactItemContext } from "antd/es/space/Compact";
|
|
3
|
+
import SizeContext from "antd/es/config-provider/SizeContext";
|
|
3
4
|
import { ConfigContext } from "antd/es/config-provider";
|
|
4
5
|
/**
|
|
5
6
|
* Lets class components use an antd-style `createStyles` hook: calls `useStyles` and renders `children(css)`.
|
|
6
|
-
* `size` is resolved as `props.size`, then the enclosing `Space.Compact` size, then
|
|
7
|
+
* `size` is resolved as `props.size`, then the enclosing `Space.Compact` size, then the `ConfigProvider`
|
|
8
|
+
* `componentSize`, then `'middle'`; `variant` as
|
|
7
9
|
* `props.variant`, then the `ConfigProvider` variant, then `'outlined'`.
|
|
8
10
|
*/
|
|
9
11
|
export default function WithCss({ useStyles, children, props }) {
|
|
10
12
|
var _a, _b;
|
|
11
13
|
const contextSize = useContext(SpaceCompactItemContext);
|
|
14
|
+
const configSize = useContext(SizeContext);
|
|
12
15
|
const { variant: configVariant } = useContext(ConfigContext);
|
|
13
|
-
|
|
16
|
+
// same precedence as antd's internal useSize: own prop > Space.Compact > ConfigProvider > middle
|
|
17
|
+
const mergedSize = (props === null || props === void 0 ? void 0 : props.size) || (contextSize === null || contextSize === void 0 ? void 0 : contextSize.compactSize) || configSize || 'middle';
|
|
14
18
|
// same precedence as antd's internal useVariant: own prop > ConfigProvider > outlined
|
|
15
19
|
const mergedVariant = (_b = (_a = props === null || props === void 0 ? void 0 : props.variant) !== null && _a !== void 0 ? _a : configVariant) !== null && _b !== void 0 ? _b : 'outlined';
|
|
16
20
|
const css = useStyles(Object.assign(Object.assign({}, props), { size: mergedSize, variant: mergedVariant }));
|
|
17
|
-
return children(css);
|
|
21
|
+
return children(css, { size: mergedSize, variant: mergedVariant });
|
|
18
22
|
}
|
|
19
23
|
;
|
|
20
24
|
//# sourceMappingURL=withCss.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withCss.js","sourceRoot":"","sources":["../../../../components/style/withCss.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAC,MAAM,OAAO,CAAC;AACjC,OAAO,EAAC,uBAAuB,EAAC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"withCss.js","sourceRoot":"","sources":["../../../../components/style/withCss.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAC,MAAM,OAAO,CAAC;AACjC,OAAO,EAAC,uBAAuB,EAAC,MAAM,uBAAuB,CAAC;AAC9D,OAAO,WAAuB,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAC,aAAa,EAAU,MAAM,yBAAyB,CAAC;AA4B/D;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAA4D,EAAC,SAAS,EAAE,QAAQ,EAAE,KAAK,EAA0B;;IAC5I,MAAM,WAAW,GAAG,UAAU,CAAC,uBAAuB,CAAC,CAAC;IACxD,MAAM,UAAU,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IAC3C,MAAM,EAAC,OAAO,EAAE,aAAa,EAAC,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;IAC3D,iGAAiG;IACjG,MAAM,UAAU,GAA0B,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,MAAI,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,WAAW,CAAA,IAAI,UAAU,IAAI,QAAQ,CAAC;IAC5G,sFAAsF;IACtF,MAAM,aAAa,GAAY,MAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,mCAAI,aAAa,mCAAI,UAAU,CAAC;IAC7E,MAAM,GAAG,GAAG,SAAS,iCAAM,KAAW,KAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,IAAE,CAAC;IACnF,OAAO,QAAQ,CAAC,GAAG,EAAE,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAC,CAAC,CAAC;AACrE,CAAC;AAAA,CAAC","sourcesContent":["import {BaseReturnType} from 'antd-style';\r\nimport {ReturnStyles} from \"antd-style/lib/factories/createStyles/types\";\r\nimport {useContext} from \"react\";\r\nimport {SpaceCompactItemContext} from \"antd/es/space/Compact\";\r\nimport SizeContext, {SizeType} from \"antd/es/config-provider/SizeContext\";\r\nimport {ConfigContext, Variant} from \"antd/es/config-provider\";\r\n\r\n/**\r\n * Render function of {@link WithCss}; receives the result of `useStyles` (`styles`, `cx`, `theme`, ...) and the\r\n * resolved `size` and `variant` - read them from here, not from the component's own props, which may leave them to\r\n * the antd context.\r\n */\r\ntype WithCssChildren<T extends BaseReturnType> = (css: ReturnStyles<T>, resolved: WithCssInjectedProps) => any;\r\n\r\n/** Props that {@link WithCss} resolves before passing them to `useStyles`. */\r\ntype WithCssOwnProps = { size?: SizeType, variant?: Variant };\r\n\r\n/**\r\n * Props always passed to `useStyles` by {@link WithCss}. `size` and `variant` are resolved from the passed props\r\n * and the antd context, so they are never `undefined`.\r\n */\r\nexport type WithCssInjectedProps = { size: NonNullable<SizeType>, variant: Variant };\r\n\r\n/** Props of {@link WithCss}. */\r\ninterface WithCssProperties<T extends BaseReturnType, P extends WithCssOwnProps> {\r\n /** Render function called with the computed styles. */\r\n children: WithCssChildren<T>;\r\n /** Style hook created by antd-style `createStyles`. */\r\n useStyles: (props?: P & WithCssInjectedProps) => ReturnStyles<T>\r\n /** Props passed to `useStyles`, merged with the resolved `size` and `variant`. */\r\n props?: P;\r\n}\r\n\r\n/**\r\n * Lets class components use an antd-style `createStyles` hook: calls `useStyles` and renders `children(css)`.\r\n * `size` is resolved as `props.size`, then the enclosing `Space.Compact` size, then the `ConfigProvider`\r\n * `componentSize`, then `'middle'`; `variant` as\r\n * `props.variant`, then the `ConfigProvider` variant, then `'outlined'`.\r\n */\r\nexport default function WithCss<T extends BaseReturnType, P extends WithCssOwnProps = {}> ({useStyles, children, props}: WithCssProperties<T, P>) {\r\n const contextSize = useContext(SpaceCompactItemContext);\r\n const configSize = useContext(SizeContext);\r\n const {variant: configVariant} = useContext(ConfigContext);\r\n // same precedence as antd's internal useSize: own prop > Space.Compact > ConfigProvider > middle\r\n const mergedSize: NonNullable<SizeType> = props?.size || contextSize?.compactSize || configSize || 'middle';\r\n // same precedence as antd's internal useVariant: own prop > ConfigProvider > outlined\r\n const mergedVariant: Variant = props?.variant ?? configVariant ?? 'outlined';\r\n const css = useStyles({...(props as P), size: mergedSize, variant: mergedVariant});\r\n return children(css, {size: mergedSize, variant: mergedVariant});\r\n};\r\n"]}
|