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.
Files changed (36) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/components/date/dateRangeInput.js +5 -5
  3. package/components/date/dateRangeInput.js.map +1 -1
  4. package/components/date/dateRangeInputAdvancedPanel.js +26 -15
  5. package/components/date/dateRangeInputAdvancedPanel.js.map +1 -1
  6. package/components/date/dateRangeInputConfirm.js +16 -13
  7. package/components/date/dateRangeInputConfirm.js.map +1 -1
  8. package/components/date/dateTimeInput.d.ts +12 -3
  9. package/components/date/dateTimeInput.js +164 -93
  10. package/components/date/dateTimeInput.js.map +1 -1
  11. package/components/grid/config/dataGridEditor.d.ts +4 -3
  12. package/components/grid/config/dataGridEditor.js +16 -4
  13. package/components/grid/config/dataGridEditor.js.map +1 -1
  14. package/components/grid/dataGrid.d.ts +19 -5
  15. package/components/grid/dataGrid.js +9 -5
  16. package/components/grid/dataGrid.js.map +1 -1
  17. package/components/grid/export/contextMenu.d.ts +3 -2
  18. package/components/grid/export/contextMenu.js.map +1 -1
  19. package/components/grid/extendedDataGrid.d.ts +11 -4
  20. package/components/grid/extendedDataGrid.js +34 -24
  21. package/components/grid/extendedDataGrid.js.map +1 -1
  22. package/components/modal/impl/draggableModalInner.js +22 -10
  23. package/components/modal/impl/draggableModalInner.js.map +1 -1
  24. package/components/modal/impl/draggableModalReducer.d.ts +2 -3
  25. package/components/modal/impl/draggableModalReducer.js +9 -7
  26. package/components/modal/impl/draggableModalReducer.js.map +1 -1
  27. package/components/modal/modalDialog.d.ts +2 -1
  28. package/components/modal/modalDialog.js +2 -1
  29. package/components/modal/modalDialog.js.map +1 -1
  30. package/components/style/withCss.d.ts +9 -4
  31. package/components/style/withCss.js +7 -3
  32. package/components/style/withCss.js.map +1 -1
  33. package/i18n/components.cs.json +2 -0
  34. package/i18n/components.sk.json +2 -0
  35. package/i18n/components.uk.json +2 -0
  36. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"dateRangeInputAdvancedPanel.js","sourceRoot":"","sources":["../../../../components/date/dateRangeInputAdvancedPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAC,MAAM,MAAM,CAAC;AAC5C,OAAO,IAAI,MAAM,kBAAkB,CAAC;AAGpC,OAAO,IAAI,MAAM,sCAAsC,CAAC;AACxD,OAAO,EAAC,YAAY,EAAC,MAAM,YAAY,CAAC;AACxC,OAAO,OAAO,MAAM,kBAAkB,CAAC;AAEvC,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,EAAC,KAAK,EAAE,GAAG,EAAC,EAAE,EAAE;IAC5C,OAAO;QACH,KAAK,EAAE,GAAG,CAAA;qBACG,KAAK,CAAC,kBAAkB;SACpC;QACD,aAAa,EAAE,GAAG,CAAA;qBACL,KAAK,CAAC,kBAAkB;SACpC;QACD,oBAAoB,EAAE,GAAG,CAAA;qBACZ,KAAK,CAAC,YAAY;SAC9B;KACJ,CAAA;AACL,CAAC,CAAC,CAAC;AAEH,kFAAkF;AAClF,MAAM,CAAN,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC1B,8CAA8C;IAC9C,qEAAS,CAAA;IACT,+CAA+C;IAC/C,qEAAS,CAAA;AACb,CAAC,EALW,kBAAkB,KAAlB,kBAAkB,QAK7B;AAwCD;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,KAAK,CAAC,SAA6E;IACxI,YAAY,KAAiD;QACzD,KAAK,CAAC,KAAK,CAAC,CAAC;QAEb,IAAI,CAAC,KAAK,GAAG;YACT,cAAc,EAAE,KAAK;YACrB,aAAa,EAAE,IAAI;YACnB,YAAY,EAAE,KAAK;SACtB,CAAA;IACL,CAAC;IAEO,kBAAkB,CAAC,KAAsB;QAC7C,OAAO,CACH,8BAAM,KAAK,EAAE,EA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AM,CAAC,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CACpL;gBACP,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO;oBAChB,oBAAC,KAAK,IAAC,KAAK,EAAE,EAAC,KAAK,EAAE,aAAa,EAAC,EAAE,SAAS,EAAC,UAAU;wBACrD,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;wBAC7C,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;wBAC9E,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;wBAC7E,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CACxE,CAER,CACN,CACK,CACd,CAAC;IACN,CAAC;CAEJ","sourcesContent":["import React from \"react\";\r\nimport {Button, Divider, Space} from \"antd\";\r\nimport i18n from \"d2core/i18n/i18n\";\r\nimport {OpUnitType} from \"dayjs\";\r\nimport {DurationUnitType} from \"d2core/dayjs/duration\";\r\nimport Icon from \"@ant-design/icons/es/components/Icon\";\r\nimport {createStyles} from \"antd-style\";\r\nimport WithCss from \"../style/withCss\";\r\n\r\nconst useStyles = createStyles(({token, css}) => {\r\n return {\r\n panel: css`\r\n color: ${token.colorTextSecondary};\r\n `,\r\n timeShiftIcon: css`\r\n color: ${token.colorTextSecondary};\r\n `,\r\n timeShiftIconChecked: css`\r\n color: ${token.colorPrimary};\r\n `,\r\n }\r\n});\r\n\r\n/** Direction of a time shift requested by {@link DateRangeInputAdvancedPanel}. */\r\nexport enum TimeShiftDirection {\r\n /** Shift forward in time (the \"+\" button). */\r\n INCREMENT,\r\n /** Shift backward in time (the \"-\" button). */\r\n DECREMENT,\r\n}\r\n\r\n/** Props of {@link DateRangeInputAdvancedPanel}. */\r\ninterface DateRangeInputAdvancedPanelProps {\r\n /** Hides the \"Interval End\" column. */\r\n compact?: boolean\r\n\r\n /**\r\n * Called by the \"Interval Begin\" buttons: `\"15minutes\"` (Now), `\"day\"` (Today), `\"week\"`, `\"month\"`, `\"year\"`.\r\n * `DateRangeInput` sets the begin to the start of that unit containing now (the current quarter-hour for `\"15minutes\"`).\r\n */\r\n onBeginIntervalChange(unit: OpUnitType | \"15minutes\"): void\r\n\r\n /**\r\n * Called by the duration buttons (`\"hour\"`, `\"day\"`, `\"week\"`, `\"month\"`, `\"year\"`).\r\n * `DateRangeInput` sets the end to begin + 1 unit - 1 ms.\r\n */\r\n onIntervalDurationChange(unitOfTime: DurationUnitType): void\r\n\r\n /**\r\n * Called by the \"-\"/\"+\" buttons beside a duration button.\r\n * @param shiftBegin whether the begin is to be shifted - per the begin/both/end toggle icons (both by default)\r\n * @param shiftEnd whether the end is to be shifted\r\n * @param unitOfTime shift by one of this unit\r\n */\r\n onTimeShift(shiftBegin: boolean, shiftEnd: boolean, unitOfTime: DurationUnitType, direction: TimeShiftDirection): void\r\n\r\n /**\r\n * Called by the \"Interval End\" buttons: `\"15minutes\"`, `\"hour\"`, `\"day\"`.\r\n * `DateRangeInput` sets the end to 1 ms before the start of that unit containing now.\r\n */\r\n onEndIntervalChange(unit: OpUnitType | \"15minutes\"): void\r\n}\r\n\r\ninterface DateRangeInputAdvancedPanelState {\r\n timeShiftBegin: boolean\r\n timeShiftBoth: boolean\r\n timeShiftEnd: boolean\r\n}\r\n\r\n/**\r\n * Shortcut buttons of the `DateRangeInputMode.ADVANCED` popup of `DateRangeInput`: interval begin,\r\n * duration with time shift, and interval end. It only reports which button was pressed; the caller computes the range.\r\n */\r\nexport default class DateRangeInputAdvancedPanel extends React.Component<DateRangeInputAdvancedPanelProps, DateRangeInputAdvancedPanelState> {\r\n constructor(props: Readonly<DateRangeInputAdvancedPanelProps>) {\r\n super(props);\r\n\r\n this.state = {\r\n timeShiftBegin: false,\r\n timeShiftBoth: true,\r\n timeShiftEnd: false,\r\n }\r\n }\r\n\r\n private renderSectionTitle(title: React.ReactNode) {\r\n return (\r\n <span style={{display: \"block\", fontWeight: \"bold\", textAlign: \"center\", marginBottom: 4}}>\r\n {title}\r\n </span>\r\n );\r\n }\r\n\r\n private renderButton(title: React.ReactNode, callback: () => void) {\r\n return (\r\n <Button\r\n size=\"small\"\r\n block\r\n onClick={callback}\r\n >\r\n {title}\r\n </Button>\r\n );\r\n }\r\n\r\n private renderButtonWithTimeShift(title: React.ReactNode, onClick: () => void, onTimeShift: (direction: TimeShiftDirection) => void) {\r\n const timeShiftDisabled = !this.state.timeShiftBegin && !this.state.timeShiftEnd && !this.state.timeShiftBoth;\r\n\r\n return (\r\n <Space.Compact block size=\"small\">\r\n <Button\r\n disabled={timeShiftDisabled}\r\n icon=\"-\"\r\n onClick={() => onTimeShift(TimeShiftDirection.DECREMENT)}\r\n />\r\n <Button\r\n size=\"small\"\r\n block\r\n onClick={onClick}\r\n >\r\n {title}\r\n </Button>\r\n <Button\r\n disabled={timeShiftDisabled}\r\n icon=\"+\"\r\n onClick={() => onTimeShift(TimeShiftDirection.INCREMENT)}\r\n />\r\n </Space.Compact>\r\n );\r\n }\r\n\r\n private renderTimeShiftIcon(shiftType: \"begin\" | \"both\" | \"end\", styles: ReturnType<typeof useStyles>[\"styles\"]) {\r\n let checked = false;\r\n if (shiftType === \"begin\") {\r\n checked = this.state.timeShiftBegin;\r\n } else if (shiftType === \"both\") {\r\n checked = this.state.timeShiftBoth;\r\n } else if (shiftType === \"end\") {\r\n checked = this.state.timeShiftEnd;\r\n }\r\n\r\n return (\r\n <Icon component={() =>\r\n <svg\r\n className={`icon ${checked ? styles.timeShiftIconChecked : styles.timeShiftIcon}`}\r\n viewBox=\"64 64 896 896\"\r\n version=\"1.1\"\r\n width={40}\r\n height={40}\r\n cursor=\"pointer\"\r\n onClick={() => {\r\n if (shiftType === \"begin\") {\r\n this.setState({\r\n timeShiftBegin: !this.state.timeShiftBegin,\r\n timeShiftBoth: false,\r\n timeShiftEnd: false\r\n });\r\n } else if (shiftType === \"both\") {\r\n this.setState({\r\n timeShiftBegin: false,\r\n timeShiftBoth: !this.state.timeShiftBoth,\r\n timeShiftEnd: false\r\n });\r\n } else if (shiftType === \"end\") {\r\n this.setState({\r\n timeShiftBegin: false,\r\n timeShiftBoth: false,\r\n timeShiftEnd: !this.state.timeShiftEnd\r\n });\r\n }\r\n }}\r\n >\r\n <path\r\n d=\"m 880.43128,184.00001 h -168 v -64 c 0,-4.4 -3.6,-8 -8,-8 h -56 c -4.4,0 -8,3.6 -8,8 v 64 h -256 v -64 c 0,-4.4 -3.6,-8 -8,-8 h -56 c -4.4,0 -8,3.6 -8,8 v 64 h -168 c -17.7,0 -32,14.3 -32,32 v 664 c 0,17.7 14.3,32 32,32 h 736 c 17.7,0 32,-14.3 32,-32 v -664 c 0,-17.7 -14.3,-32 -32,-32 z m -40,656 h -656 v -380 h 656 z m -656,-448 v -136 h 128 v 48 c 0,4.4 3.6,8 8,8 h 56 c 4.4,0 8,-3.6 8,-8 v -48 h 256 v 48 c 0,4.4 3.6,8 8,8 h 56 c 4.4,0 8,-3.6 8,-8 v -48 h 128 v 136 z\"\r\n id=\"path2231\"\r\n style={{fill: \"currentcolor\"}}\r\n />\r\n {[\"begin\", \"end\"].includes(shiftType) &&\r\n <g id=\"g41\">\r\n <g id=\"path2822\"/>\r\n <g id=\"path2824\"/>\r\n <g id=\"path2826\"\r\n transform={shiftType === \"end\" ? \"rotate(180,512.9334,646.24561)\" : \"unset\"}>\r\n <path\r\n id=\"path50\"\r\n style={{fill: \"currentcolor\"}}\r\n d=\"m 358.80859,510.14062 a 34.41795,34.41795 0 0 0 -23.58789,9.24219 L 226.40625,620.82422 a 34.41795,34.41795 0 0 0 -1.70508,48.64453 34.41795,34.41795 0 0 0 48.64453,1.70703 l 108.8125,-101.4414 a 34.41795,34.41795 0 0 0 1.70703,-48.64454 34.41795,34.41795 0 0 0 -25.05664,-10.94922 z M 249.87565,645.99998 358.68957,544.55871 M 249.7207,611.58203 a 34.41795,34.41795 0 0 0 -24.90625,10.82813 34.41795,34.41795 0 0 0 1.47071,48.65234 l 108.29492,101.93164 a 34.41795,34.41795 0 0 0 48.65234,-1.4707 34.41795,34.41795 0 0 0 -1.47265,-48.65235 L 273.46484,620.9375 a 34.41795,34.41795 0 0 0 -23.74414,-9.35547 z m 0.15495,34.41795 108.29422,101.93273 M 264.8125,610.01953 A 35.98045,35.98045 0 0 0 228.83203,646 35.98045,35.98045 0 0 0 264.8125,681.98047 H 550.48633 A 35.98045,35.98045 0 0 0 586.4668,646 35.98045,35.98045 0 0 0 550.48633,610.01953 Z m 285.67298,35.98045 h -285.6727\"/>\r\n </g>\r\n </g>\r\n }\r\n {shiftType === \"both\" &&\r\n <g id=\"g65\" transform=\"rotate(180,512.9334,646.0254)\">\r\n <path\r\n id=\"path63\"\r\n style={{fill: \"currentcolor\"}}\r\n d=\"m 358.80859,510.14062 a 34.41795,34.41795 0 0 0 -23.58789,9.24219 L 226.40625,620.82422 a 34.41795,34.41795 0 0 0 -1.70508,48.64453 34.41795,34.41795 0 0 0 48.64453,1.70703 l 108.8125,-101.4414 a 34.41795,34.41795 0 0 0 1.70703,-48.64454 34.41795,34.41795 0 0 0 -25.05664,-10.94922 z M 249.87565,645.99998 358.68957,544.55871 M 249.7207,611.58203 a 34.41795,34.41795 0 0 0 -24.90625,10.82813 34.41795,34.41795 0 0 0 1.47071,48.65234 l 108.29492,101.93164 a 34.41795,34.41795 0 0 0 48.65234,-1.4707 34.41795,34.41795 0 0 0 -1.47265,-48.65235 L 273.46484,620.9375 a 34.41795,34.41795 0 0 0 -23.74414,-9.35547 z m 0.15495,34.41795 108.29422,101.93273 M 264.8125,610.01953 A 35.98045,35.98045 0 0 0 228.83203,646 35.98045,35.98045 0 0 0 264.8125,681.98047 H 550.48633 A 35.98045,35.98045 0 0 0 586.4668,646 35.98045,35.98045 0 0 0 550.48633,610.01953 Z m 285.67298,35.98045 h -285.6727 m 402.24543,135.9102 a -34.41795,-34.41795 0 0 0 23.58789,-9.24219 L 799.46055,671.22658 a -34.41795,-34.41795 0 0 0 1.70508,-48.64453 -34.41795,-34.41795 0 0 0 -48.64453,-1.70703 l -108.8125,101.4414 a -34.41795,-34.41795 0 0 0 -1.70703,48.64454 -34.41795,-34.41795 0 0 0 25.05664,10.94922 z M 775.99115,646.05082 667.17723,747.49209 M 776.1461,680.46877 a -34.41795,-34.41795 0 0 0 24.90625,-10.82813 -34.41795,-34.41795 0 0 0 -1.47071,-48.65234 L 691.28672,519.05666 a -34.41795,-34.41795 0 0 0 -48.65234,1.4707 -34.41795,-34.41795 0 0 0 1.47265,48.65235 L 752.40196,671.1133 a -34.41795,-34.41795 0 0 0 23.74414,9.35547 z M 775.99115,646.05082 667.69693,544.11809 M 761.0543,682.03127 A -35.98045,-35.98045 0 0 0 797.03477,646.0508 -35.98045,-35.98045 0 0 0 761.0543,610.07033 H 475.38047 A -35.98045,-35.98045 0 0 0 439.4,646.0508 -35.98045,-35.98045 0 0 0 475.38047,682.03127 Z M 475.38132,646.05082 h 285.6727\"/>\r\n </g>\r\n }\r\n </svg>\r\n }/>\r\n );\r\n }\r\n\r\n render() {\r\n const timeShiftBegin = this.state.timeShiftBegin || this.state.timeShiftBoth;\r\n const timeShiftEnd = this.state.timeShiftEnd || this.state.timeShiftBoth;\r\n\r\n return (\r\n <WithCss useStyles={useStyles}>{({styles}) =>\r\n <div className={styles.panel}>\r\n <Divider style={{margin: \"8px 0px 6px\"}}/>\r\n <Space style={{marginBottom: 8}} size={24} align=\"start\">\r\n <Space style={{width: \"max-content\"}} direction=\"vertical\">\r\n {this.renderSectionTitle(i18n(\"Interval Begin\"))}\r\n {this.renderButton(i18n(\"Now\"), () => this.props.onBeginIntervalChange(\"15minutes\"))}\r\n {this.renderButton(i18n(\"Today\"), () => this.props.onBeginIntervalChange(\"day\"))}\r\n {this.renderButton(i18n(\"Week\"), () => this.props.onBeginIntervalChange(\"week\"))}\r\n {this.renderButton(i18n(\"Month\"), () => this.props.onBeginIntervalChange(\"month\"))}\r\n {this.renderButton(i18n(\"Year\"), () => this.props.onBeginIntervalChange(\"year\"))}\r\n </Space>\r\n <Space style={{width: \"max-content\"}} direction=\"vertical\">\r\n {this.renderSectionTitle(i18n(\"Duration and Time Shift\"))}\r\n <div style={{display: \"flex\", justifyContent: \"center\", alignItems: \"center\"}}>\r\n {this.renderTimeShiftIcon(\"begin\", styles)}\r\n {this.renderTimeShiftIcon(\"both\", styles)}\r\n {this.renderTimeShiftIcon(\"end\", styles)}\r\n </div>\r\n {this.renderButtonWithTimeShift(i18n(\"Hour\"), () => this.props.onIntervalDurationChange(\"hour\"), (direction) => this.props.onTimeShift(timeShiftBegin, timeShiftEnd, \"hour\", direction))}\r\n {this.renderButtonWithTimeShift(i18n(\"Day\"), () => this.props.onIntervalDurationChange(\"day\"), (direction) => this.props.onTimeShift(timeShiftBegin, timeShiftEnd, \"day\", direction))}\r\n {this.renderButtonWithTimeShift(i18n(\"Week\"), () => this.props.onIntervalDurationChange(\"week\"), (direction) => this.props.onTimeShift(timeShiftBegin, timeShiftEnd, \"week\", direction))}\r\n {this.renderButtonWithTimeShift(i18n(\"Month\"), () => this.props.onIntervalDurationChange(\"month\"), (direction) => this.props.onTimeShift(timeShiftBegin, timeShiftEnd, \"month\", direction))}\r\n {this.renderButtonWithTimeShift(i18n(\"Year\"), () => this.props.onIntervalDurationChange(\"year\"), (direction) => this.props.onTimeShift(timeShiftBegin, timeShiftEnd, \"year\", direction))}\r\n </Space>\r\n {!this.props.compact &&\r\n <Space style={{width: \"max-content\"}} direction=\"vertical\">\r\n {this.renderSectionTitle(i18n(\"Interval End\"))}\r\n {this.renderButton(\"15 min\", () => this.props.onEndIntervalChange(\"15minutes\"))}\r\n {this.renderButton(i18n(\"Hour\"), () => this.props.onEndIntervalChange(\"hour\"))}\r\n {this.renderButton(i18n(\"Day\"), () => this.props.onEndIntervalChange(\"day\"))}\r\n </Space>\r\n }\r\n </Space>\r\n </div>\r\n }</WithCss>\r\n );\r\n }\r\n\r\n}"]}
1
+ {"version":3,"file":"dateRangeInputAdvancedPanel.js","sourceRoot":"","sources":["../../../../components/date/dateRangeInputAdvancedPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAC,MAAM,MAAM,CAAC;AAC5C,OAAO,IAAI,MAAM,kBAAkB,CAAC;AAGpC,OAAO,IAAI,MAAM,sCAAsC,CAAC;AACxD,OAAO,EAAC,YAAY,EAAC,MAAM,YAAY,CAAC;AACxC,OAAO,OAAO,MAAM,kBAAkB,CAAC;AAEvC,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,EAAC,KAAK,EAAE,GAAG,EAAC,EAAE,EAAE;IAC5C,OAAO;QACH,KAAK,EAAE,GAAG,CAAA;qBACG,KAAK,CAAC,kBAAkB;SACpC;QACD,4GAA4G;QAC5G,OAAO,EAAE,GAAG,CAAA;;;;;SAKX;QACD,MAAM,EAAE,GAAG,CAAA;;;SAGV;QACD,aAAa,EAAE,GAAG,CAAA;qBACL,KAAK,CAAC,kBAAkB;SACpC;QACD,oBAAoB,EAAE,GAAG,CAAA;qBACZ,KAAK,CAAC,YAAY;SAC9B;KACJ,CAAA;AACL,CAAC,CAAC,CAAC;AAEH,kFAAkF;AAClF,MAAM,CAAN,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC1B,8CAA8C;IAC9C,qEAAS,CAAA;IACT,+CAA+C;IAC/C,qEAAS,CAAA;AACb,CAAC,EALW,kBAAkB,KAAlB,kBAAkB,QAK7B;AAwCD;;;GAGG;AACH,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,CAAC,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;oBACxL,6BAAK,KAAK,EAAE,EAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAC;wBACxE,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,MAAM,CAAC;wBACzC,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC;wBACxC,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,CACtC,CACF;gBACP,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO;oBAChB,oBAAC,KAAK,IAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,EAAC,UAAU;wBAChD,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;wBAC7C,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;wBAC9E,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;wBAC7E,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CACxE,CAEV,CACJ,CACK,CACd,CAAC;IACN,CAAC;CAEJ","sourcesContent":["import React from \"react\";\nimport {Button, Divider, Space} from \"antd\";\nimport i18n from \"d2core/i18n/i18n\";\nimport {OpUnitType} from \"dayjs\";\nimport {DurationUnitType} from \"d2core/dayjs/duration\";\nimport Icon from \"@ant-design/icons/es/components/Icon\";\nimport {createStyles} from \"antd-style\";\nimport WithCss from \"../style/withCss\";\n\nconst useStyles = createStyles(({token, css}) => {\n return {\n panel: css`\n color: ${token.colorTextSecondary};\n `,\n // the popup grows with a long date-time mask - the columns share the extra width, never below their content\n columns: css`\n display: flex;\n align-items: flex-start;\n gap: 24px;\n margin-bottom: 8px;\n `,\n column: css`\n flex: 1 1 0;\n min-width: max-content;\n `,\n timeShiftIcon: css`\n color: ${token.colorTextSecondary};\n `,\n timeShiftIconChecked: css`\n color: ${token.colorPrimary};\n `,\n }\n});\n\n/** Direction of a time shift requested by {@link DateRangeInputAdvancedPanel}. */\nexport enum TimeShiftDirection {\n /** Shift forward in time (the \"+\" button). */\n INCREMENT,\n /** Shift backward in time (the \"-\" button). */\n DECREMENT,\n}\n\n/** Props of {@link DateRangeInputAdvancedPanel}. */\ninterface DateRangeInputAdvancedPanelProps {\n /** Hides the \"Interval End\" column. */\n compact?: boolean\n\n /**\n * Called by the \"Interval Begin\" buttons: `\"15minutes\"` (Now), `\"day\"` (Today), `\"week\"`, `\"month\"`, `\"year\"`.\n * `DateRangeInput` sets the begin to the start of that unit containing now (the current quarter-hour for `\"15minutes\"`).\n */\n onBeginIntervalChange(unit: OpUnitType | \"15minutes\"): void\n\n /**\n * Called by the duration buttons (`\"hour\"`, `\"day\"`, `\"week\"`, `\"month\"`, `\"year\"`).\n * `DateRangeInput` sets the end to begin + 1 unit - 1 ms.\n */\n onIntervalDurationChange(unitOfTime: DurationUnitType): void\n\n /**\n * Called by the \"-\"/\"+\" buttons beside a duration button.\n * @param shiftBegin whether the begin is to be shifted - per the begin/both/end toggle icons (both by default)\n * @param shiftEnd whether the end is to be shifted\n * @param unitOfTime shift by one of this unit\n */\n onTimeShift(shiftBegin: boolean, shiftEnd: boolean, unitOfTime: DurationUnitType, direction: TimeShiftDirection): void\n\n /**\n * Called by the \"Interval End\" buttons: `\"15minutes\"`, `\"hour\"`, `\"day\"`.\n * `DateRangeInput` sets the end to 1 ms before the start of that unit containing now.\n */\n onEndIntervalChange(unit: OpUnitType | \"15minutes\"): void\n}\n\ninterface DateRangeInputAdvancedPanelState {\n timeShiftBegin: boolean\n timeShiftBoth: boolean\n timeShiftEnd: boolean\n}\n\n/**\n * Shortcut buttons of the `DateRangeInputMode.ADVANCED` popup of `DateRangeInput`: interval begin,\n * duration with time shift, and interval end. It only reports which button was pressed; the caller computes the range.\n */\nexport default class DateRangeInputAdvancedPanel extends React.Component<DateRangeInputAdvancedPanelProps, DateRangeInputAdvancedPanelState> {\n constructor(props: Readonly<DateRangeInputAdvancedPanelProps>) {\n super(props);\n\n this.state = {\n timeShiftBegin: false,\n timeShiftBoth: true,\n timeShiftEnd: false,\n }\n }\n\n private renderSectionTitle(title: React.ReactNode) {\n return (\n <span style={{display: \"block\", fontWeight: \"bold\", textAlign: \"center\", marginBottom: 4}}>\n {title}\n </span>\n );\n }\n\n private renderButton(title: React.ReactNode, callback: () => void) {\n return (\n <Button\n size=\"small\"\n block\n onClick={callback}\n >\n {title}\n </Button>\n );\n }\n\n private renderButtonWithTimeShift(title: React.ReactNode, onClick: () => void, onTimeShift: (direction: TimeShiftDirection) => void) {\n const timeShiftDisabled = !this.state.timeShiftBegin && !this.state.timeShiftEnd && !this.state.timeShiftBoth;\n\n return (\n <Space.Compact block size=\"small\">\n <Button\n disabled={timeShiftDisabled}\n icon=\"-\"\n onClick={() => onTimeShift(TimeShiftDirection.DECREMENT)}\n />\n <Button\n size=\"small\"\n block\n onClick={onClick}\n >\n {title}\n </Button>\n <Button\n disabled={timeShiftDisabled}\n icon=\"+\"\n onClick={() => onTimeShift(TimeShiftDirection.INCREMENT)}\n />\n </Space.Compact>\n );\n }\n\n private renderTimeShiftIcon(shiftType: \"begin\" | \"both\" | \"end\", styles: ReturnType<typeof useStyles>[\"styles\"]) {\n let checked = false;\n if (shiftType === \"begin\") {\n checked = this.state.timeShiftBegin;\n } else if (shiftType === \"both\") {\n checked = this.state.timeShiftBoth;\n } else if (shiftType === \"end\") {\n checked = this.state.timeShiftEnd;\n }\n\n return (\n <Icon component={() =>\n <svg\n className={`icon ${checked ? styles.timeShiftIconChecked : styles.timeShiftIcon}`}\n viewBox=\"64 64 896 896\"\n version=\"1.1\"\n width={40}\n height={40}\n cursor=\"pointer\"\n onClick={() => {\n if (shiftType === \"begin\") {\n this.setState({\n timeShiftBegin: !this.state.timeShiftBegin,\n timeShiftBoth: false,\n timeShiftEnd: false\n });\n } else if (shiftType === \"both\") {\n this.setState({\n timeShiftBegin: false,\n timeShiftBoth: !this.state.timeShiftBoth,\n timeShiftEnd: false\n });\n } else if (shiftType === \"end\") {\n this.setState({\n timeShiftBegin: false,\n timeShiftBoth: false,\n timeShiftEnd: !this.state.timeShiftEnd\n });\n }\n }}\n >\n <path\n d=\"m 880.43128,184.00001 h -168 v -64 c 0,-4.4 -3.6,-8 -8,-8 h -56 c -4.4,0 -8,3.6 -8,8 v 64 h -256 v -64 c 0,-4.4 -3.6,-8 -8,-8 h -56 c -4.4,0 -8,3.6 -8,8 v 64 h -168 c -17.7,0 -32,14.3 -32,32 v 664 c 0,17.7 14.3,32 32,32 h 736 c 17.7,0 32,-14.3 32,-32 v -664 c 0,-17.7 -14.3,-32 -32,-32 z m -40,656 h -656 v -380 h 656 z m -656,-448 v -136 h 128 v 48 c 0,4.4 3.6,8 8,8 h 56 c 4.4,0 8,-3.6 8,-8 v -48 h 256 v 48 c 0,4.4 3.6,8 8,8 h 56 c 4.4,0 8,-3.6 8,-8 v -48 h 128 v 136 z\"\n id=\"path2231\"\n style={{fill: \"currentcolor\"}}\n />\n {[\"begin\", \"end\"].includes(shiftType) &&\n <g id=\"g41\">\n <g id=\"path2822\"/>\n <g id=\"path2824\"/>\n <g id=\"path2826\"\n transform={shiftType === \"end\" ? \"rotate(180,512.9334,646.24561)\" : \"unset\"}>\n <path\n id=\"path50\"\n style={{fill: \"currentcolor\"}}\n d=\"m 358.80859,510.14062 a 34.41795,34.41795 0 0 0 -23.58789,9.24219 L 226.40625,620.82422 a 34.41795,34.41795 0 0 0 -1.70508,48.64453 34.41795,34.41795 0 0 0 48.64453,1.70703 l 108.8125,-101.4414 a 34.41795,34.41795 0 0 0 1.70703,-48.64454 34.41795,34.41795 0 0 0 -25.05664,-10.94922 z M 249.87565,645.99998 358.68957,544.55871 M 249.7207,611.58203 a 34.41795,34.41795 0 0 0 -24.90625,10.82813 34.41795,34.41795 0 0 0 1.47071,48.65234 l 108.29492,101.93164 a 34.41795,34.41795 0 0 0 48.65234,-1.4707 34.41795,34.41795 0 0 0 -1.47265,-48.65235 L 273.46484,620.9375 a 34.41795,34.41795 0 0 0 -23.74414,-9.35547 z m 0.15495,34.41795 108.29422,101.93273 M 264.8125,610.01953 A 35.98045,35.98045 0 0 0 228.83203,646 35.98045,35.98045 0 0 0 264.8125,681.98047 H 550.48633 A 35.98045,35.98045 0 0 0 586.4668,646 35.98045,35.98045 0 0 0 550.48633,610.01953 Z m 285.67298,35.98045 h -285.6727\"/>\n </g>\n </g>\n }\n {shiftType === \"both\" &&\n <g id=\"g65\" transform=\"rotate(180,512.9334,646.0254)\">\n <path\n id=\"path63\"\n style={{fill: \"currentcolor\"}}\n d=\"m 358.80859,510.14062 a 34.41795,34.41795 0 0 0 -23.58789,9.24219 L 226.40625,620.82422 a 34.41795,34.41795 0 0 0 -1.70508,48.64453 34.41795,34.41795 0 0 0 48.64453,1.70703 l 108.8125,-101.4414 a 34.41795,34.41795 0 0 0 1.70703,-48.64454 34.41795,34.41795 0 0 0 -25.05664,-10.94922 z M 249.87565,645.99998 358.68957,544.55871 M 249.7207,611.58203 a 34.41795,34.41795 0 0 0 -24.90625,10.82813 34.41795,34.41795 0 0 0 1.47071,48.65234 l 108.29492,101.93164 a 34.41795,34.41795 0 0 0 48.65234,-1.4707 34.41795,34.41795 0 0 0 -1.47265,-48.65235 L 273.46484,620.9375 a 34.41795,34.41795 0 0 0 -23.74414,-9.35547 z m 0.15495,34.41795 108.29422,101.93273 M 264.8125,610.01953 A 35.98045,35.98045 0 0 0 228.83203,646 35.98045,35.98045 0 0 0 264.8125,681.98047 H 550.48633 A 35.98045,35.98045 0 0 0 586.4668,646 35.98045,35.98045 0 0 0 550.48633,610.01953 Z m 285.67298,35.98045 h -285.6727 m 402.24543,135.9102 a -34.41795,-34.41795 0 0 0 23.58789,-9.24219 L 799.46055,671.22658 a -34.41795,-34.41795 0 0 0 1.70508,-48.64453 -34.41795,-34.41795 0 0 0 -48.64453,-1.70703 l -108.8125,101.4414 a -34.41795,-34.41795 0 0 0 -1.70703,48.64454 -34.41795,-34.41795 0 0 0 25.05664,10.94922 z M 775.99115,646.05082 667.17723,747.49209 M 776.1461,680.46877 a -34.41795,-34.41795 0 0 0 24.90625,-10.82813 -34.41795,-34.41795 0 0 0 -1.47071,-48.65234 L 691.28672,519.05666 a -34.41795,-34.41795 0 0 0 -48.65234,1.4707 -34.41795,-34.41795 0 0 0 1.47265,48.65235 L 752.40196,671.1133 a -34.41795,-34.41795 0 0 0 23.74414,9.35547 z M 775.99115,646.05082 667.69693,544.11809 M 761.0543,682.03127 A -35.98045,-35.98045 0 0 0 797.03477,646.0508 -35.98045,-35.98045 0 0 0 761.0543,610.07033 H 475.38047 A -35.98045,-35.98045 0 0 0 439.4,646.0508 -35.98045,-35.98045 0 0 0 475.38047,682.03127 Z M 475.38132,646.05082 h 285.6727\"/>\n </g>\n }\n </svg>\n }/>\n );\n }\n\n render() {\n const timeShiftBegin = this.state.timeShiftBegin || this.state.timeShiftBoth;\n const timeShiftEnd = this.state.timeShiftEnd || this.state.timeShiftBoth;\n\n return (\n <WithCss useStyles={useStyles}>{({styles}) =>\n <div className={styles.panel}>\n <Divider style={{margin: \"8px 0px 6px\"}}/>\n <div className={styles.columns}>\n <Space className={styles.column} direction=\"vertical\">\n {this.renderSectionTitle(i18n(\"Interval Begin\"))}\n {this.renderButton(i18n(\"Now\"), () => this.props.onBeginIntervalChange(\"15minutes\"))}\n {this.renderButton(i18n(\"Today\"), () => this.props.onBeginIntervalChange(\"day\"))}\n {this.renderButton(i18n(\"Week\"), () => this.props.onBeginIntervalChange(\"week\"))}\n {this.renderButton(i18n(\"Month\"), () => this.props.onBeginIntervalChange(\"month\"))}\n {this.renderButton(i18n(\"Year\"), () => this.props.onBeginIntervalChange(\"year\"))}\n </Space>\n <Space className={styles.column} direction=\"vertical\">\n {this.renderSectionTitle(i18n(\"Duration and Time Shift\"))}\n {this.renderButtonWithTimeShift(i18n(\"Hour\"), () => this.props.onIntervalDurationChange(\"hour\"), (direction) => this.props.onTimeShift(timeShiftBegin, timeShiftEnd, \"hour\", direction))}\n {this.renderButtonWithTimeShift(i18n(\"Day\"), () => this.props.onIntervalDurationChange(\"day\"), (direction) => this.props.onTimeShift(timeShiftBegin, timeShiftEnd, \"day\", direction))}\n {this.renderButtonWithTimeShift(i18n(\"Week\"), () => this.props.onIntervalDurationChange(\"week\"), (direction) => this.props.onTimeShift(timeShiftBegin, timeShiftEnd, \"week\", direction))}\n {this.renderButtonWithTimeShift(i18n(\"Month\"), () => this.props.onIntervalDurationChange(\"month\"), (direction) => this.props.onTimeShift(timeShiftBegin, timeShiftEnd, \"month\", direction))}\n {this.renderButtonWithTimeShift(i18n(\"Year\"), () => this.props.onIntervalDurationChange(\"year\"), (direction) => this.props.onTimeShift(timeShiftBegin, timeShiftEnd, \"year\", direction))}\n <div style={{display: \"flex\", justifyContent: \"center\", alignItems: \"center\"}}>\n {this.renderTimeShiftIcon(\"begin\", styles)}\n {this.renderTimeShiftIcon(\"both\", styles)}\n {this.renderTimeShiftIcon(\"end\", styles)}\n </div>\n </Space>\n {!this.props.compact &&\n <Space className={styles.column} direction=\"vertical\">\n {this.renderSectionTitle(i18n(\"Interval End\"))}\n {this.renderButton(\"15 min\", () => this.props.onEndIntervalChange(\"15minutes\"))}\n {this.renderButton(i18n(\"Hour\"), () => this.props.onEndIntervalChange(\"hour\"))}\n {this.renderButton(i18n(\"Day\"), () => this.props.onEndIntervalChange(\"day\"))}\n </Space>\n }\n </div>\n </div>\n }</WithCss>\n );\n }\n\n}"]}
@@ -22,13 +22,13 @@ import WithCss from "../style/withCss";
22
22
  const useStyles = createStyles(({ token, css }) => {
23
23
  return {
24
24
  // the confirm buttons float above the page on a transparent tooltip, so they need their own surface
25
- buttonsSurface: css `
26
- background: ${token.colorBgElevated};
25
+ buttonsSurface: css `
26
+ background: ${token.colorBgElevated};
27
27
  `,
28
28
  // ghost button is transparent by default - give it the same opaque surface
29
- revertButton: css `
30
- background: ${token.colorBgElevated};
31
- border-right-width: 2px;
29
+ revertButton: css `
30
+ background: ${token.colorBgElevated};
31
+ border-right-width: 2px;
32
32
  `,
33
33
  };
34
34
  });
@@ -99,15 +99,18 @@ export default class DateRangeInputConfirm extends React.Component {
99
99
  });
100
100
  (_c = this.dateRangeInput) === null || _c === void 0 ? void 0 : _c.closePopup();
101
101
  }
102
- renderConfirmButtons(size, buttonWidth) {
102
+ renderConfirmButtons(size) {
103
103
  const validInterval = this.props.allowClear ?
104
104
  (!this.state.currentFromValue || this.state.currentFromValue.isValid()) && (!this.state.currentToValue || this.state.currentToValue.isValid()) :
105
105
  this.state.currentFromValue && this.state.currentFromValue.isValid() && this.state.currentToValue && this.state.currentToValue.isValid();
106
- return (React.createElement(WithCss, { useStyles: useStyles }, ({ styles }) => React.createElement(Space.Compact, { className: styles.buttonsSurface },
107
- React.createElement(Button, { className: styles.revertButton, style: { width: buttonWidth }, size: size, title: i18n("Revert"), key: "revert", danger: true, ghost: true, onClick: this.onRevert },
108
- React.createElement(UndoIcon, null)),
109
- React.createElement(Button, { style: { width: buttonWidth }, title: i18n("Apply"), key: "apply-button", size: size, type: "primary", disabled: !validInterval || this.state.invalidDatesPresent, onClick: this.onConfirm },
110
- React.createElement(CheckOutlined, null)))));
106
+ return (React.createElement(WithCss, { useStyles: useStyles, props: { size } }, ({ styles }, { size: mergedSize }) => {
107
+ const buttonWidth = mergedSize === "small" ? 48 : undefined;
108
+ return (React.createElement(Space.Compact, { className: styles.buttonsSurface },
109
+ React.createElement(Button, { className: styles.revertButton, style: { width: buttonWidth }, size: size, title: i18n("Revert"), key: "revert", danger: true, ghost: true, onClick: this.onRevert },
110
+ React.createElement(UndoIcon, null)),
111
+ React.createElement(Button, { style: { width: buttonWidth }, title: i18n("Apply"), key: "apply-button", size: size, type: "primary", disabled: !validInterval || this.state.invalidDatesPresent, onClick: this.onConfirm },
112
+ React.createElement(CheckOutlined, null))));
113
+ }));
111
114
  }
112
115
  confirmButtonsVisible() {
113
116
  const { originalFromValue, originalToValue, currentFromValue, currentToValue } = this.state;
@@ -129,7 +132,7 @@ export default class DateRangeInputConfirm extends React.Component {
129
132
  align = { points: ["tr", "br"], offset: [0, -6] };
130
133
  }
131
134
  return (React.createElement("span", { onKeyDown: this.onKeyDown, ref: this.parentRef },
132
- React.createElement(Tooltip, { color: "transparent", styles: { body: { boxShadow: "none" } }, open: this.confirmButtonsVisible() && !this.state.popupVisible, align: align, title: this.renderConfirmButtons(rest.size, rest.size === "small" ? 48 : undefined), getPopupContainer: () => {
135
+ React.createElement(Tooltip, { color: "transparent", styles: { body: { boxShadow: "none" } }, open: this.confirmButtonsVisible() && !this.state.popupVisible, align: align, title: this.renderConfirmButtons(rest.size), getPopupContainer: () => {
133
136
  var _a, _b;
134
137
  // very nasty trick how remove error of ResizeObservers infinite cycling - because popover (with dynamic size) is placed in resizable panel
135
138
  const parentNode = ((_b = (_a = this.parentRef.current) === null || _a === void 0 ? void 0 : _a.parentNode) !== null && _b !== void 0 ? _b : document.body);
@@ -145,7 +148,7 @@ export default class DateRangeInputConfirm extends React.Component {
145
148
  });
146
149
  }, confirmButtonsRenderer: () => {
147
150
  if (this.confirmButtonsVisible()) {
148
- return this.renderConfirmButtons("small", 48);
151
+ return this.renderConfirmButtons("small");
149
152
  }
150
153
  return undefined;
151
154
  }, onPopupVisibleChange: visible => {
@@ -1 +1 @@
1
- {"version":3,"file":"dateRangeInputConfirm.js","sourceRoot":"","sources":["../../../../components/date/dateRangeInputConfirm.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAEvC,OAAO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AC,YAAY,EAAE,OAAO,EAAC,CAAC,CAAC;oBAC3C,CAAC,EACD,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAC5B,YAAY,EAAE,IAAI,CAAC,EAAE;wBACjB,IAAI,CAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;oBAChC,CAAC,IACG,IAAI,EACV,CACI,CACP,CACV,CAAC;IACN,CAAC;CACJ","sourcesContent":["import React, {createRef} from \"react\";\r\nimport {Dayjs} from \"dayjs\";\r\nimport {Button, Space, Tooltip} from \"antd\";\r\nimport {DateTimeUtils} from \"d2core/utils/dateTimeUtils\";\r\nimport {CheckOutlined} from \"@ant-design/icons\";\r\nimport i18n from \"d2core/i18n/i18n\";\r\nimport DateRangeInput, {DateRangeInputMode, DateRangeInputProps} from \"./dateRangeInput\";\r\nimport {TooltipPlacement} from \"antd/es/tooltip\";\r\nimport {AlignType} from \"@rc-component/trigger/lib/interface\";\r\nimport {UndoIcon} from \"../icons/undoIcon\";\r\nimport {SizeType} from \"antd/lib/config-provider/SizeContext\";\r\nimport {Key} from \"ts-key-enum\";\r\nimport {createStyles} from \"antd-style\";\r\nimport WithCss from \"../style/withCss\";\r\n\r\nconst useStyles = createStyles(({token, css}) => {\r\n return {\r\n // the confirm buttons float above the page on a transparent tooltip, so they need their own surface\r\n buttonsSurface: css`\r\n background: ${token.colorBgElevated};\r\n `,\r\n // ghost button is transparent by default - give it the same opaque surface\r\n revertButton: css`\r\n background: ${token.colorBgElevated};\r\n border-right-width: 2px;\r\n `,\r\n }\r\n});\r\n\r\n/**\r\n * Props of {@link DateRangeInputConfirm} - those of {@link DateRangeInput}, except that `onChange` is called only\r\n * on confirmation. `onInvalidValue`, `onPopupVisibleChange`, `onModeChange`, `defaultMode` and\r\n * `confirmButtonsRenderer` are used internally and passing them overrides the confirm behaviour.\r\n */\r\ninterface DateRangeInputConfirmProps extends DateRangeInputProps {\r\n /** Shows the confirm buttons from the start, even before anything is changed, until the first confirmation. */\r\n requireConfirmationAtStart?: boolean\r\n /**\r\n * Where the floating confirm buttons are shown next to the input: `\"right\"`, `\"topRight\"`; any other value\r\n * (or none) means below the right edge.\r\n */\r\n confirmPlacement?: TooltipPlacement\r\n}\r\n\r\ninterface DateRangeInputConfirmState {\r\n originalFromValue: Dayjs | null\r\n originalToValue: Dayjs | null\r\n currentFromValue: Dayjs | null\r\n currentToValue: Dayjs | null\r\n invalidDatesPresent: boolean\r\n requireConfirmation: boolean\r\n\r\n popupVisible: boolean\r\n mode: DateRangeInputMode\r\n}\r\n\r\n/**\r\n * {@link DateRangeInput} that buffers edits and reports them through `onChange` only when confirmed with the\r\n * Apply button or Enter; the Revert button or Escape restores the last value from props. The Revert/Apply buttons\r\n * float next to the input (and appear in the popup footer) while the range differs from the props, contains an\r\n * invalid text or {@link DateRangeInputConfirmProps.requireConfirmationAtStart} is pending. A change of\r\n * `fromValue`/`toValue` from props discards the buffered edit.\r\n */\r\nexport default class DateRangeInputConfirm extends React.Component<DateRangeInputConfirmProps, DateRangeInputConfirmState> {\r\n private dateRangeInput: DateRangeInput | null = null;\r\n private parentRef: React.RefObject<HTMLSpanElement> = createRef();\r\n\r\n constructor(props: Readonly<DateRangeInputConfirmProps>) {\r\n super(props);\r\n this.state = {\r\n originalFromValue: props.fromValue ?? null,\r\n originalToValue: props.toValue ?? null,\r\n currentFromValue: props.fromValue ?? null,\r\n currentToValue: props.toValue ?? null,\r\n invalidDatesPresent: false,\r\n requireConfirmation: !!props.requireConfirmationAtStart,\r\n\r\n popupVisible: false,\r\n mode: props.defaultMode ?? DateRangeInputMode.SIMPLE,\r\n };\r\n\r\n this.onKeyDown = this.onKeyDown.bind(this);\r\n this.onConfirm = this.onConfirm.bind(this);\r\n this.onRevert = this.onRevert.bind(this);\r\n }\r\n\r\n /** Confirms on Enter and reverts on Escape; attached to the wrapping element. */\r\n onKeyDown(event: React.KeyboardEvent) {\r\n if (event.key === Key.Enter) {\r\n this.onConfirm();\r\n } else if (event.key === Key.Escape) {\r\n this.onRevert();\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps: Readonly<DateRangeInputProps>) {\r\n const preFromValueUnixTime = DateTimeUtils.toUnixTime(prevProps.fromValue);\r\n const currentFromValueUnixTime = DateTimeUtils.toUnixTime(this.props.fromValue);\r\n const prevToValueUnixTime = DateTimeUtils.toUnixTime(prevProps.toValue);\r\n const currentToValueUnixTime = DateTimeUtils.toUnixTime(this.props.toValue);\r\n if (preFromValueUnixTime !== currentFromValueUnixTime ||\r\n prevToValueUnixTime !== currentToValueUnixTime) {\r\n this.setState({\r\n originalFromValue: this.props.fromValue ?? null,\r\n originalToValue: this.props.toValue ?? null,\r\n currentFromValue: this.props.fromValue ?? null,\r\n currentToValue: this.props.toValue ?? null\r\n })\r\n }\r\n }\r\n\r\n private onConfirm() {\r\n this.setState({requireConfirmation: false});\r\n this.props.onChange?.(this.state.currentFromValue, this.state.currentToValue);\r\n this.dateRangeInput?.closePopup();\r\n }\r\n\r\n private onRevert() {\r\n this.setState({\r\n currentFromValue: this.state.originalFromValue ?? null,\r\n currentToValue: this.state.originalToValue ?? null,\r\n invalidDatesPresent: false,\r\n });\r\n this.dateRangeInput?.closePopup();\r\n }\r\n\r\n private renderConfirmButtons(size?: SizeType, buttonWidth?: number) {\r\n const validInterval = this.props.allowClear ?\r\n (!this.state.currentFromValue || this.state.currentFromValue.isValid()) && (!this.state.currentToValue || this.state.currentToValue.isValid()) :\r\n this.state.currentFromValue && this.state.currentFromValue.isValid() && this.state.currentToValue && this.state.currentToValue.isValid();\r\n\r\n return (\r\n <WithCss useStyles={useStyles}>{({styles}) =>\r\n <Space.Compact className={styles.buttonsSurface}>\r\n <Button\r\n className={styles.revertButton}\r\n style={{width: buttonWidth}}\r\n size={size}\r\n title={i18n(\"Revert\")}\r\n key=\"revert\"\r\n danger\r\n ghost\r\n onClick={this.onRevert}\r\n >\r\n <UndoIcon/>\r\n </Button>\r\n <Button\r\n style={{width: buttonWidth}}\r\n title={i18n(\"Apply\")} key=\"apply-button\"\r\n size={size}\r\n type=\"primary\"\r\n disabled={!validInterval || this.state.invalidDatesPresent}\r\n onClick={this.onConfirm}\r\n >\r\n <CheckOutlined/>\r\n </Button>\r\n </Space.Compact>\r\n }</WithCss>\r\n );\r\n }\r\n\r\n private confirmButtonsVisible() {\r\n const {originalFromValue, originalToValue, currentFromValue, currentToValue} = this.state;\r\n const valueChanged = DateTimeUtils.toUnixTime(currentFromValue) !== DateTimeUtils.toUnixTime(originalFromValue) ||\r\n DateTimeUtils.toUnixTime(currentToValue) !== DateTimeUtils.toUnixTime(originalToValue);\r\n\r\n return valueChanged || this.state.invalidDatesPresent || this.state.requireConfirmation;\r\n }\r\n\r\n render(): any {\r\n const {\r\n fromValue,\r\n toValue,\r\n onChange,\r\n allowClear,\r\n requireConfirmationAtStart,\r\n confirmPlacement,\r\n compact,\r\n ...rest\r\n } = this.props;\r\n let align: AlignType;\r\n if (confirmPlacement === \"right\") {\r\n align = {points: [\"tl\", \"tr\"], offset: [-8, 0]};\r\n } else if (confirmPlacement === \"topRight\") {\r\n align = {points: [\"br\", \"tr\"], offset: [0, 8]};\r\n } else {\r\n // default bottomRight\r\n align = {points: [\"tr\", \"br\"], offset: [0, -6]};\r\n }\r\n return (\r\n <span onKeyDown={this.onKeyDown} ref={this.parentRef}>\r\n <Tooltip\r\n color={\"transparent\"}\r\n styles={{body: {boxShadow: \"none\"}}}\r\n open={this.confirmButtonsVisible() && !this.state.popupVisible}\r\n align={align}\r\n title={this.renderConfirmButtons(rest.size, rest.size === \"small\" ? 48 : undefined)}\r\n getPopupContainer={() => {\r\n // very nasty trick how remove error of ResizeObservers infinite cycling - because popover (with dynamic size) is placed in resizable panel\r\n const parentNode = (this.parentRef.current?.parentNode ?? document.body) as HTMLElement;\r\n return parentNode;\r\n }}\r\n >\r\n <DateRangeInput\r\n ref={component => this.dateRangeInput = component}\r\n fromValue={this.state.currentFromValue}\r\n toValue={this.state.currentToValue}\r\n allowClear={allowClear}\r\n compact={compact}\r\n onInvalidValue={(_) => {\r\n this.setState({invalidDatesPresent: true});\r\n }}\r\n onChange={(fromValue: Dayjs | null, toValue: Dayjs | null) => {\r\n this.setState({\r\n currentFromValue: fromValue,\r\n currentToValue: toValue,\r\n invalidDatesPresent: false,\r\n })\r\n }}\r\n confirmButtonsRenderer={() => {\r\n if (this.confirmButtonsVisible()) {\r\n return this.renderConfirmButtons(\"small\", 48);\r\n }\r\n return undefined;\r\n }}\r\n onPopupVisibleChange={visible => {\r\n this.setState({popupVisible: visible});\r\n }}\r\n defaultMode={this.state.mode}\r\n onModeChange={mode => {\r\n this.setState({mode: mode});\r\n }}\r\n {...rest}\r\n />\r\n </Tooltip>\r\n </span>\r\n );\r\n }\r\n}"]}
1
+ {"version":3,"file":"dateRangeInputConfirm.js","sourceRoot":"","sources":["../../../../components/date/dateRangeInputConfirm.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAC,MAAM,MAAM,CAAC;AAC5C,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,cAAc,EAAE,EAAC,kBAAkB,EAAsB,MAAM,kBAAkB,CAAC;AAGzF,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAChC,OAAO,EAAC,YAAY,EAAC,MAAM,YAAY,CAAC;AACxC,OAAO,OAAO,MAAM,kBAAkB,CAAC;AAEvC,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,EAAC,KAAK,EAAE,GAAG,EAAC,EAAE,EAAE;IAC5C,OAAO;QACH,oGAAoG;QACpG,cAAc,E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D,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,gBAAgB,EACtC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EAClC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,CAAC,CAAC,EAAE,EAAE;wBAClB,IAAI,CAAC,QAAQ,CAAC,EAAC,mBAAmB,EAAE,IAAI,EAAC,CAAC,CAAC;oBAC/C,CAAC,EACD,QAAQ,EAAE,CAAC,SAAuB,EAAE,OAAqB,EAAE,EAAE;wBACzD,IAAI,CAAC,QAAQ,CAAC;4BACV,gBAAgB,EAAE,SAAS;4BAC3B,cAAc,EAAE,OAAO;4BACvB,mBAAmB,EAAE,KAAK;yBAC7B,CAAC,CAAA;oBACN,CAAC,EACD,sBAAsB,EAAE,GAAG,EAAE;wBACzB,IAAI,IAAI,CAAC,qBAAqB,EAAE,EAAE,CAAC;4BAC/B,OAAO,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;wBAC9C,CAAC;wBACD,OAAO,SAAS,CAAC;oBACrB,CAAC,EACD,oBAAoB,EAAE,OAAO,CAAC,EAAE;wBAC5B,IAAI,CAAC,QAAQ,CAAC,EAAC,YAAY,EAAE,OAAO,EAAC,CAAC,CAAC;oBAC3C,CAAC,EACD,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAC5B,YAAY,EAAE,IAAI,CAAC,EAAE;wBACjB,IAAI,CAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;oBAChC,CAAC,IACG,IAAI,EACV,CACI,CACP,CACV,CAAC;IACN,CAAC;CACJ","sourcesContent":["import React, {createRef} from \"react\";\nimport {Dayjs} from \"dayjs\";\nimport {Button, Space, Tooltip} from \"antd\";\nimport {DateTimeUtils} from \"d2core/utils/dateTimeUtils\";\nimport {CheckOutlined} from \"@ant-design/icons\";\nimport i18n from \"d2core/i18n/i18n\";\nimport DateRangeInput, {DateRangeInputMode, DateRangeInputProps} from \"./dateRangeInput\";\nimport {TooltipPlacement} from \"antd/es/tooltip\";\nimport {AlignType} from \"@rc-component/trigger/lib/interface\";\nimport {UndoIcon} from \"../icons/undoIcon\";\nimport {SizeType} from \"antd/lib/config-provider/SizeContext\";\nimport {Key} from \"ts-key-enum\";\nimport {createStyles} from \"antd-style\";\nimport WithCss from \"../style/withCss\";\n\nconst useStyles = createStyles(({token, css}) => {\n return {\n // the confirm buttons float above the page on a transparent tooltip, so they need their own surface\n buttonsSurface: css`\n background: ${token.colorBgElevated};\n `,\n // ghost button is transparent by default - give it the same opaque surface\n revertButton: css`\n background: ${token.colorBgElevated};\n border-right-width: 2px;\n `,\n }\n});\n\n/**\n * Props of {@link DateRangeInputConfirm} - those of {@link DateRangeInput}, except that `onChange` is called only\n * on confirmation. `onInvalidValue`, `onPopupVisibleChange`, `onModeChange`, `defaultMode` and\n * `confirmButtonsRenderer` are used internally and passing them overrides the confirm behaviour.\n */\ninterface DateRangeInputConfirmProps extends DateRangeInputProps {\n /** Shows the confirm buttons from the start, even before anything is changed, until the first confirmation. */\n requireConfirmationAtStart?: boolean\n /**\n * Where the floating confirm buttons are shown next to the input: `\"right\"`, `\"topRight\"`; any other value\n * (or none) means below the right edge.\n */\n confirmPlacement?: TooltipPlacement\n}\n\ninterface DateRangeInputConfirmState {\n originalFromValue: Dayjs | null\n originalToValue: Dayjs | null\n currentFromValue: Dayjs | null\n currentToValue: Dayjs | null\n invalidDatesPresent: boolean\n requireConfirmation: boolean\n\n popupVisible: boolean\n mode: DateRangeInputMode\n}\n\n/**\n * {@link DateRangeInput} that buffers edits and reports them through `onChange` only when confirmed with the\n * Apply button or Enter; the Revert button or Escape restores the last value from props. The Revert/Apply buttons\n * float next to the input (and appear in the popup footer) while the range differs from the props, contains an\n * invalid text or {@link DateRangeInputConfirmProps.requireConfirmationAtStart} is pending. A change of\n * `fromValue`/`toValue` from props discards the buffered edit.\n */\nexport default class DateRangeInputConfirm extends React.Component<DateRangeInputConfirmProps, DateRangeInputConfirmState> {\n private dateRangeInput: DateRangeInput | null = null;\n private parentRef: React.RefObject<HTMLSpanElement> = createRef();\n\n constructor(props: Readonly<DateRangeInputConfirmProps>) {\n super(props);\n this.state = {\n originalFromValue: props.fromValue ?? null,\n originalToValue: props.toValue ?? null,\n currentFromValue: props.fromValue ?? null,\n currentToValue: props.toValue ?? null,\n invalidDatesPresent: false,\n requireConfirmation: !!props.requireConfirmationAtStart,\n\n popupVisible: false,\n mode: props.defaultMode ?? DateRangeInputMode.SIMPLE,\n };\n\n this.onKeyDown = this.onKeyDown.bind(this);\n this.onConfirm = this.onConfirm.bind(this);\n this.onRevert = this.onRevert.bind(this);\n }\n\n /** Confirms on Enter and reverts on Escape; attached to the wrapping element. */\n onKeyDown(event: React.KeyboardEvent) {\n if (event.key === Key.Enter) {\n this.onConfirm();\n } else if (event.key === Key.Escape) {\n this.onRevert();\n }\n }\n\n componentDidUpdate(prevProps: Readonly<DateRangeInputProps>) {\n const preFromValueUnixTime = DateTimeUtils.toUnixTime(prevProps.fromValue);\n const currentFromValueUnixTime = DateTimeUtils.toUnixTime(this.props.fromValue);\n const prevToValueUnixTime = DateTimeUtils.toUnixTime(prevProps.toValue);\n const currentToValueUnixTime = DateTimeUtils.toUnixTime(this.props.toValue);\n if (preFromValueUnixTime !== currentFromValueUnixTime ||\n prevToValueUnixTime !== currentToValueUnixTime) {\n this.setState({\n originalFromValue: this.props.fromValue ?? null,\n originalToValue: this.props.toValue ?? null,\n currentFromValue: this.props.fromValue ?? null,\n currentToValue: this.props.toValue ?? null\n })\n }\n }\n\n private onConfirm() {\n this.setState({requireConfirmation: false});\n this.props.onChange?.(this.state.currentFromValue, this.state.currentToValue);\n this.dateRangeInput?.closePopup();\n }\n\n private onRevert() {\n this.setState({\n currentFromValue: this.state.originalFromValue ?? null,\n currentToValue: this.state.originalToValue ?? null,\n invalidDatesPresent: false,\n });\n this.dateRangeInput?.closePopup();\n }\n\n private renderConfirmButtons(size?: SizeType) {\n const validInterval = this.props.allowClear ?\n (!this.state.currentFromValue || this.state.currentFromValue.isValid()) && (!this.state.currentToValue || this.state.currentToValue.isValid()) :\n this.state.currentFromValue && this.state.currentFromValue.isValid() && this.state.currentToValue && this.state.currentToValue.isValid();\n\n return (\n <WithCss useStyles={useStyles} props={{size}}>{({styles}, {size: mergedSize}) => {\n const buttonWidth = mergedSize === \"small\" ? 48 : undefined;\n return (\n <Space.Compact className={styles.buttonsSurface}>\n <Button\n className={styles.revertButton}\n style={{width: buttonWidth}}\n size={size}\n title={i18n(\"Revert\")}\n key=\"revert\"\n danger\n ghost\n onClick={this.onRevert}\n >\n <UndoIcon/>\n </Button>\n <Button\n style={{width: buttonWidth}}\n title={i18n(\"Apply\")} key=\"apply-button\"\n size={size}\n type=\"primary\"\n disabled={!validInterval || this.state.invalidDatesPresent}\n onClick={this.onConfirm}\n >\n <CheckOutlined/>\n </Button>\n </Space.Compact>\n );\n }}</WithCss>\n );\n }\n\n private confirmButtonsVisible() {\n const {originalFromValue, originalToValue, currentFromValue, currentToValue} = this.state;\n const valueChanged = DateTimeUtils.toUnixTime(currentFromValue) !== DateTimeUtils.toUnixTime(originalFromValue) ||\n DateTimeUtils.toUnixTime(currentToValue) !== DateTimeUtils.toUnixTime(originalToValue);\n\n return valueChanged || this.state.invalidDatesPresent || this.state.requireConfirmation;\n }\n\n render(): any {\n const {\n fromValue,\n toValue,\n onChange,\n allowClear,\n requireConfirmationAtStart,\n confirmPlacement,\n compact,\n ...rest\n } = this.props;\n let align: AlignType;\n if (confirmPlacement === \"right\") {\n align = {points: [\"tl\", \"tr\"], offset: [-8, 0]};\n } else if (confirmPlacement === \"topRight\") {\n align = {points: [\"br\", \"tr\"], offset: [0, 8]};\n } else {\n // default bottomRight\n align = {points: [\"tr\", \"br\"], offset: [0, -6]};\n }\n return (\n <span onKeyDown={this.onKeyDown} ref={this.parentRef}>\n <Tooltip\n color={\"transparent\"}\n styles={{body: {boxShadow: \"none\"}}}\n open={this.confirmButtonsVisible() && !this.state.popupVisible}\n align={align}\n title={this.renderConfirmButtons(rest.size)}\n getPopupContainer={() => {\n // very nasty trick how remove error of ResizeObservers infinite cycling - because popover (with dynamic size) is placed in resizable panel\n const parentNode = (this.parentRef.current?.parentNode ?? document.body) as HTMLElement;\n return parentNode;\n }}\n >\n <DateRangeInput\n ref={component => this.dateRangeInput = component}\n fromValue={this.state.currentFromValue}\n toValue={this.state.currentToValue}\n allowClear={allowClear}\n compact={compact}\n onInvalidValue={(_) => {\n this.setState({invalidDatesPresent: true});\n }}\n onChange={(fromValue: Dayjs | null, toValue: Dayjs | null) => {\n this.setState({\n currentFromValue: fromValue,\n currentToValue: toValue,\n invalidDatesPresent: false,\n })\n }}\n confirmButtonsRenderer={() => {\n if (this.confirmButtonsVisible()) {\n return this.renderConfirmButtons(\"small\");\n }\n return undefined;\n }}\n onPopupVisibleChange={visible => {\n this.setState({popupVisible: visible});\n }}\n defaultMode={this.state.mode}\n onModeChange={mode => {\n this.setState({mode: mode});\n }}\n {...rest}\n />\n </Tooltip>\n </span>\n );\n }\n}"]}
@@ -15,8 +15,12 @@ interface DateTimeInputProps extends Omit<HTMLAttributes<HTMLDivElement>, "onCha
15
15
  * Editable tokens: `YYYY`, `YY`, `MM`, `DD`, `HH`, `mm`, `ss`, `SSS` and the UTC offset `Z` (`+02:00`) or
16
16
  * `ZZ` (`+0200`); other characters are literals. Fields missing from the mask are taken from the start
17
17
  * of the current day. A 2-digit year keeps the century of the previous value (without one, `> 70` means 19xx,
18
- * otherwise 20xx). Including the UTC offset makes both instants of a DST fold enterable and rejects a
19
- * wall clock inside a DST gap.
18
+ * otherwise 20xx). A wall clock inside a DST gap and a day that does not exist (31.02.) are invalid.
19
+ * Including the UTC offset makes both instants of a DST fold enterable. `Z?` (`d2core/dayjs/ambiguousTime`) is shown as `Z` - always, so that the input
20
+ * does not change its layout while typed into.
21
+ * `HH?` (`d2core/dayjs/ambiguousTime`) is the hour shown as `A2` / `B2` in the repeated hour of a DST fold; `A` or
22
+ * `B` typed in place of the leading digit picks the occurrence, a repeated hour typed without it is the second
23
+ * one (`B`), a letter outside a DST fold is invalid.
20
24
  */
21
25
  mask: string;
22
26
  /**
@@ -129,7 +133,7 @@ interface MaskSegment {
129
133
  index: number;
130
134
  /** length of the segment in the rendered value */
131
135
  length: number;
132
- /** numeric field description - undefined for the UTC-offset segment */
136
+ /** numeric field description - undefined for the UTC-offset segment; the `HH?` segment has the `HH` entry */
133
137
  entry: InfoEntry | undefined;
134
138
  min: number;
135
139
  max: number;
@@ -166,6 +170,11 @@ export default class DateTimeInput extends React.Component<DateTimeInputProps, D
166
170
  /** The underlying `<input>` element, `undefined` before mount or with {@link DateTimeInputProps.renderAsCalendar}. */
167
171
  get input(): HTMLInputElement | undefined;
168
172
  private getLayout;
173
+ /**
174
+ * A typed text can stand for a value shown differently (`02` of a repeated hour is `B2`). When that value is the
175
+ * current one, the `value` prop does not change and MaskedInput would keep the typed text.
176
+ */
177
+ private rewriteInputIfShownDifferently;
169
178
  /** Moves the keyboard focus to the text input. */
170
179
  focus(): void;
171
180
  private canStep;