d2coreui 23.0.37 → 23.0.38
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/components/date/dateRangeInput.js +3 -3
- package/components/date/dateRangeInput.js.map +1 -1
- package/components/date/dateRangeInputConfirm.js +3 -3
- package/components/date/dateRangeInputConfirm.js.map +1 -1
- package/components/date/dateTimeInput.d.ts +2 -1
- package/components/date/dateTimeInput.js +5 -5
- package/components/date/dateTimeInput.js.map +1 -1
- package/components/grid/cell/customEnumCellEditor.js +7 -7
- package/components/grid/cell/customEnumCellEditor.js.map +1 -1
- package/components/grid/cell/dateCellEditor.js +3 -4
- package/components/grid/cell/dateCellEditor.js.map +1 -1
- package/components/grid/cell/simpleStatusTextCellEditor.js +7 -7
- package/components/grid/cell/simpleStatusTextCellEditor.js.map +1 -1
- package/components/grid/cell/statusTextCellEditor.js +6 -6
- package/components/grid/cell/statusTextCellEditor.js.map +1 -1
- package/components/grid/dataGrid.js +3 -4
- package/components/grid/dataGrid.js.map +1 -1
- package/components/grid/extendedDataGrid.js +1 -1
- package/components/grid/extendedDataGrid.js.map +1 -1
- package/components/modal/impl/draggableModalInner.js +2 -2
- package/components/modal/impl/draggableModalInner.js.map +1 -1
- package/components/modal/impl/draggableModalReducer.d.ts +0 -2
- package/components/modal/impl/draggableModalReducer.js +5 -8
- package/components/modal/impl/draggableModalReducer.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statusTextCellEditor.js","sourceRoot":"","sources":["../../../../../components/grid/cell/statusTextCellEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAE,MAAM,EAAC,MAAM,MAAM,CAAC;AACzC,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAChC,OAAO,aAAa,MAAM,4CAA4C,CAAC;AACvE,OAAO,EAAC,YAAY,EAAC,MAAM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\"ts-key-enum\";\r\nimport KeyboardUtils from \"d2coreui/components/keyboard/keyboardUtils\";\r\nimport {LocaleHolder} from \"d2core/i18n/localeHolder\";\r\nimport ReactDOM from 'react-dom';\r\nimport scrollIntoView from \"dom-scroll-into-view\";\r\nimport {CustomCellEditorProps} from \"ag-grid-react\";\r\nimport {DataGridCellEditorComponent, withAgGridHooks} from \"./dataGridCellEditorComponent\";\r\n\r\ninterface StatusTextCellEditorProperties extends CustomCellEditorProps {\r\n decimalSeparator?: string\r\n precision?: number\r\n statusTexts: { text: string, value: number }[];\r\n}\r\n\r\ninterface StatusTextCellEditorState {\r\n value: number | null\r\n opened: boolean\r\n}\r\n\r\nclass StatusTextCellEditor extends DataGridCellEditorComponent<StatusTextCellEditorProperties, StatusTextCellEditorState> {\r\n private inputComponent: HTMLInputElement | null = null;\r\n\r\n constructor(props: Readonly<StatusTextCellEditorProperties>) {\r\n super(props);\r\n this.state = this.getInitialState(props);\r\n }\r\n\r\n getInitialState(props: Readonly<StatusTextCellEditorProperties>): StatusTextCellEditorState {\r\n let value: number | null;\r\n\r\n if (props.eventKey === Key.Backspace || props.eventKey === Key.Delete) {\r\n // if backspace or delete pressed, we clear the cell\r\n value = null;\r\n props.onValueChange(null);\r\n } else if (props.eventKey && props.eventKey.length === 1) {\r\n // if a letter was pressed, we start with the letter\r\n const parsedValue = Number.parseInt(props.eventKey);\r\n value = isNaN(parsedValue) ? props.value : parsedValue;\r\n props.onValueChange(value);\r\n } else {\r\n // otherwise we start with the current value\r\n value = props.initialValue;\r\n }\r\n return {value: value} as StatusTextCellEditorState;\r\n }\r\n\r\n focus() {\r\n this.inputComponent?.focus();\r\n }\r\n\r\n select() {\r\n this.inputComponent?.select();\r\n }\r\n\r\n placeCursorToEnd() {\r\n // when we started editing, we want the carot at the end, not the start.\r\n // this comes into play in two scenarios: a) when user hits F2 and b)\r\n // when user hits a printable character, then on IE (and only IE) the carot\r\n // was placed after the first character, thus 'apply' would end up as 'pplea'\r\n const length = this.inputComponent?.value ? this.inputComponent?.value.length : 0;\r\n if (length > 0) {\r\n this.inputComponent?.setSelectionRange(length, length);\r\n }\r\n }\r\n\r\n isCancelBeforeStart(): boolean {\r\n return !!this.props.eventKey && this.props.eventKey.length === 1 && '1234567890'.indexOf(this.props.eventKey) < 0;\r\n }\r\n\r\n // noinspection DuplicatedCode\r\n getScrollParent(element: HTMLElement, includeHidden = false): HTMLElement {\r\n var style = getComputedStyle(element);\r\n var excludeStaticParent = style.position === \"absolute\";\r\n var overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/;\r\n if (style.position === \"fixed\") return document.body;\r\n let parent: HTMLElement | null;\r\n for (parent = element; (parent = parent.parentElement);) {\r\n style = getComputedStyle(parent);\r\n if (excludeStaticParent && style.position === \"static\") {\r\n continue;\r\n }\r\n if (overflowRegex.test(style.overflow + style.overflowY + style.overflowX)) return parent;\r\n }\r\n return document.body;\r\n }\r\n\r\n scrollTo(value: number) {\r\n const elementToScroll = document.getElementById(\"select-value-\" + value);\r\n if (elementToScroll) {\r\n const parent = this.getScrollParent(elementToScroll, true);\r\n scrollIntoView(elementToScroll, parent, {\r\n onlyScrollIfNeeded: true,\r\n allowHorizontalScroll: false,\r\n alignWithTop: true,\r\n offsetTop: 20,\r\n offsetBottom: 20,\r\n });\r\n }\r\n }\r\n\r\n render() {\r\n return (\r\n <div style={{width: \"100%\", minWidth: 150}}>\r\n <Select<number>\r\n size={\"small\"}\r\n virtual={false}\r\n popupMatchSelectWidth={false}\r\n className={\"select-with-one-item\"}\r\n style={{width: \"100%\", overflow: \"auto\", visibility: \"hidden\"}}\r\n dropdownStyle={{maxHeight: 400, overflow: 'auto'}}\r\n allowClear\r\n dropdownAlign={{points: [\"tl\", \"tr\"], offset: [0, -100], overflow: {adjustX: true, adjustY: true}}}\r\n filterOption={(inputValue, option) => {\r\n const inputToSearch = inputValue.toLocaleLowerCase(LocaleHolder.formattingLocale);\r\n const value: number = option?.value as number;\r\n return (value?.toString().indexOf(inputToSearch) >= 0) || ((option?.title?.toLocaleLowerCase(LocaleHolder.formattingLocale).indexOf(inputToSearch) ?? -1) >= 0);\r\n }}\r\n value={this.state.value !== null ? this.state.value : undefined}\r\n onChange={(value) => {\r\n this.setState({value: value});\r\n this.props.onValueChange(value);\r\n }}\r\n open={this.state.opened}\r\n onDropdownVisibleChange={(visible) => {\r\n this.setState({opened: visible});\r\n }}\r\n getPopupContainer={(_trigger) => {\r\n // very nasty trick how to keep select's popup within focusable area of ag-grid cell editor popup (prevent closing cell editor when we click in select's dropdown area)\r\n return (ReactDOM.findDOMNode(this)?.parentNode ?? document.body) as HTMLElement;\r\n }}\r\n >\r\n {this.props.statusTexts?.map((statusTextItem) => {\r\n return <Select.Option\r\n id={\"select-value-\" + statusTextItem.value}\r\n key={\"\" + statusTextItem.value}\r\n value={statusTextItem.value}\r\n title={statusTextItem.text}\r\n >\r\n <span style={{\r\n color: \"rgba(0, 0, 0, 0.85)\",\r\n whiteSpace: \"nowrap\"\r\n }}>{`${statusTextItem.text} (${statusTextItem.value})`}</span>\r\n </Select.Option>;\r\n })}\r\n </Select>\r\n <InputNumber\r\n ref={(component) => {\r\n this.inputComponent = component;\r\n }}\r\n size=\"small\"\r\n style={{\r\n position: \"absolute\",\r\n top: 0,\r\n bottom: 0,\r\n left: 0,\r\n right: 0,\r\n width: \"100%\"\r\n }}\r\n autoFocus\r\n decimalSeparator={this.props.decimalSeparator}\r\n precision={this.props.precision}\r\n placeholder={this.state.value === null ? \"NULL\" : \"\"}\r\n value={this.state.value !== undefined && this.state.value !== null ? this.state.value : undefined}\r\n onChange={value => {\r\n if (KeyboardUtils.isKeyPressed(Key.Alt)) {\r\n // ignore navigational keystrokes ALT+cursor arrow\r\n return;\r\n }\r\n if (typeof value === \"number\") {\r\n this.setState({value: value, opened: true});\r\n this.scrollTo(value);\r\n this.props.onValueChange(value);\r\n } else if (value === undefined || value === \"\") {\r\n this.setState({value: null, opened: true});\r\n this.props.onValueChange(null);\r\n }\r\n }}\r\n onKeyDown={(e) => {\r\n if (e.key === Key.ArrowUp || e.key === Key.ArrowDown) {\r\n this.props.onKeyDown(e.nativeEvent);\r\n e.preventDefault();\r\n }\r\n }}\r\n onFocus={() => {\r\n this.setState({opened: true});\r\n }}\r\n onClick={() => {\r\n this.setState({opened: true});\r\n }}\r\n />\r\n </div>\r\n );\r\n }\r\n}\r\n\r\nexport default withAgGridHooks(StatusTextCellEditor)"]}
|
|
1
|
+
{"version":3,"file":"statusTextCellEditor.js","sourceRoot":"","sources":["../../../../../components/grid/cell/statusTextCellEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAE,MAAM,EAAC,MAAM,MAAM,CAAC;AACzC,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAChC,OAAO,aAAa,MAAM,4CAA4C,CAAC;AACvE,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACtD,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAC,2BAA2B,EAAE,eAAe,EAAC,MAAM,+BAA+B,CAAC;AAa3F,MAAM,oBAAqB,SAAQ,2BAAsF;IAIrH,YAAY,KAA+C;QACvD,KAAK,CAAC,KAAK,CAAC,CAAC;QAJT,mBAAc,GAA4B,IAAI,CAAC;QAC/C,iBAAY,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;QAIrD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IAED,eAAe,CAAC,KAA+C;QAC3D,IAAI,KAAoB,CAAC;QAEzB,IAAI,KAAK,CAAC,QAAQ,KAAK,GAAG,CAAC,SAAS,IAAI,KAAK,CAAC,QAAQ,KAAK,GAAG,CAAC,MAAM,EAAE,CAAC;YAEpE,KAAK,GAAG,IAAI,CAAC;YACb,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC9B,C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BACL,CAAC,EACD,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;oBACb,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,SAAS,EAAE,CAAC;wBACnD,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;wBACpC,CAAC,CAAC,cAAc,EAAE,CAAC;oBACvB,CAAC;gBACL,CAAC,EACD,OAAO,EAAE,GAAG,EAAE;oBACV,IAAI,CAAC,QAAQ,CAAC,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;gBAClC,CAAC,EACD,OAAO,EAAE,GAAG,EAAE;oBACV,IAAI,CAAC,QAAQ,CAAC,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;gBAClC,CAAC,GACH,CACA,CACT,CAAC;IACN,CAAC;CACJ;AAED,eAAe,eAAe,CAAC,oBAAoB,CAAC,CAAA","sourcesContent":["import React from 'react';\r\nimport {InputNumber, Select} from \"antd\";\r\nimport {Key} from \"ts-key-enum\";\r\nimport KeyboardUtils from \"d2coreui/components/keyboard/keyboardUtils\";\r\nimport {LocaleHolder} from \"d2core/i18n/localeHolder\";\r\nimport scrollIntoView from \"dom-scroll-into-view\";\r\nimport {CustomCellEditorProps} from \"ag-grid-react\";\r\nimport {DataGridCellEditorComponent, withAgGridHooks} from \"./dataGridCellEditorComponent\";\r\n\r\ninterface StatusTextCellEditorProperties extends CustomCellEditorProps {\r\n decimalSeparator?: string\r\n precision?: number\r\n statusTexts: { text: string, value: number }[];\r\n}\r\n\r\ninterface StatusTextCellEditorState {\r\n value: number | null\r\n opened: boolean\r\n}\r\n\r\nclass StatusTextCellEditor extends DataGridCellEditorComponent<StatusTextCellEditorProperties, StatusTextCellEditorState> {\r\n private inputComponent: HTMLInputElement | null = null;\r\n private containerRef = React.createRef<HTMLDivElement>();\r\n\r\n constructor(props: Readonly<StatusTextCellEditorProperties>) {\r\n super(props);\r\n this.state = this.getInitialState(props);\r\n }\r\n\r\n getInitialState(props: Readonly<StatusTextCellEditorProperties>): StatusTextCellEditorState {\r\n let value: number | null;\r\n\r\n if (props.eventKey === Key.Backspace || props.eventKey === Key.Delete) {\r\n // if backspace or delete pressed, we clear the cell\r\n value = null;\r\n props.onValueChange(null);\r\n } else if (props.eventKey && props.eventKey.length === 1) {\r\n // if a letter was pressed, we start with the letter\r\n const parsedValue = Number.parseInt(props.eventKey);\r\n value = isNaN(parsedValue) ? props.value : parsedValue;\r\n props.onValueChange(value);\r\n } else {\r\n // otherwise we start with the current value\r\n value = props.initialValue;\r\n }\r\n return {value: value} as StatusTextCellEditorState;\r\n }\r\n\r\n focus() {\r\n this.inputComponent?.focus();\r\n }\r\n\r\n select() {\r\n this.inputComponent?.select();\r\n }\r\n\r\n placeCursorToEnd() {\r\n // when we started editing, we want the carot at the end, not the start.\r\n // this comes into play in two scenarios: a) when user hits F2 and b)\r\n // when user hits a printable character, then on IE (and only IE) the carot\r\n // was placed after the first character, thus 'apply' would end up as 'pplea'\r\n const length = this.inputComponent?.value ? this.inputComponent?.value.length : 0;\r\n if (length > 0) {\r\n this.inputComponent?.setSelectionRange(length, length);\r\n }\r\n }\r\n\r\n isCancelBeforeStart(): boolean {\r\n return !!this.props.eventKey && this.props.eventKey.length === 1 && '1234567890'.indexOf(this.props.eventKey) < 0;\r\n }\r\n\r\n // noinspection DuplicatedCode\r\n getScrollParent(element: HTMLElement, includeHidden = false): HTMLElement {\r\n var style = getComputedStyle(element);\r\n var excludeStaticParent = style.position === \"absolute\";\r\n var overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/;\r\n if (style.position === \"fixed\") return document.body;\r\n let parent: HTMLElement | null;\r\n for (parent = element; (parent = parent.parentElement);) {\r\n style = getComputedStyle(parent);\r\n if (excludeStaticParent && style.position === \"static\") {\r\n continue;\r\n }\r\n if (overflowRegex.test(style.overflow + style.overflowY + style.overflowX)) return parent;\r\n }\r\n return document.body;\r\n }\r\n\r\n scrollTo(value: number) {\r\n const elementToScroll = document.getElementById(\"select-value-\" + value);\r\n if (elementToScroll) {\r\n const parent = this.getScrollParent(elementToScroll, true);\r\n scrollIntoView(elementToScroll, parent, {\r\n onlyScrollIfNeeded: true,\r\n allowHorizontalScroll: false,\r\n alignWithTop: true,\r\n offsetTop: 20,\r\n offsetBottom: 20,\r\n });\r\n }\r\n }\r\n\r\n render() {\r\n return (\r\n <div style={{width: \"100%\", minWidth: 150}} ref={this.containerRef}>\r\n <Select<number>\r\n size={\"small\"}\r\n virtual={false}\r\n popupMatchSelectWidth={false}\r\n className={\"select-with-one-item\"}\r\n style={{width: \"100%\", overflow: \"auto\", visibility: \"hidden\"}}\r\n styles={{popup: {root: {maxHeight: 400, overflow: 'auto'}}}}\r\n allowClear\r\n dropdownAlign={{points: [\"tl\", \"tr\"], offset: [0, -100], overflow: {adjustX: true, adjustY: true}}}\r\n filterOption={(inputValue, option) => {\r\n const inputToSearch = inputValue.toLocaleLowerCase(LocaleHolder.formattingLocale);\r\n const value: number = option?.value as number;\r\n return (value?.toString().indexOf(inputToSearch) >= 0) || ((option?.title?.toLocaleLowerCase(LocaleHolder.formattingLocale).indexOf(inputToSearch) ?? -1) >= 0);\r\n }}\r\n value={this.state.value !== null ? this.state.value : undefined}\r\n onChange={(value) => {\r\n this.setState({value: value});\r\n this.props.onValueChange(value);\r\n }}\r\n open={this.state.opened}\r\n onOpenChange={(visible) => {\r\n this.setState({opened: visible});\r\n }}\r\n getPopupContainer={() => {\r\n // very nasty trick how to keep select's popup within focusable area of ag-grid cell editor popup (prevent closing cell editor when we click in select's dropdown area)\r\n return (this.containerRef.current?.parentNode ?? document.body) as HTMLElement;\r\n }}\r\n >\r\n {this.props.statusTexts?.map((statusTextItem) => {\r\n return <Select.Option\r\n id={\"select-value-\" + statusTextItem.value}\r\n key={\"\" + statusTextItem.value}\r\n value={statusTextItem.value}\r\n title={statusTextItem.text}\r\n >\r\n <span style={{\r\n color: \"rgba(0, 0, 0, 0.85)\",\r\n whiteSpace: \"nowrap\"\r\n }}>{`${statusTextItem.text} (${statusTextItem.value})`}</span>\r\n </Select.Option>;\r\n })}\r\n </Select>\r\n <InputNumber\r\n ref={(component) => {\r\n this.inputComponent = component;\r\n }}\r\n size=\"small\"\r\n style={{\r\n position: \"absolute\",\r\n top: 0,\r\n bottom: 0,\r\n left: 0,\r\n right: 0,\r\n width: \"100%\"\r\n }}\r\n autoFocus\r\n decimalSeparator={this.props.decimalSeparator}\r\n precision={this.props.precision}\r\n placeholder={this.state.value === null ? \"NULL\" : \"\"}\r\n value={this.state.value !== undefined && this.state.value !== null ? this.state.value : undefined}\r\n onChange={value => {\r\n if (KeyboardUtils.isKeyPressed(Key.Alt)) {\r\n // ignore navigational keystrokes ALT+cursor arrow\r\n return;\r\n }\r\n if (typeof value === \"number\") {\r\n this.setState({value: value, opened: true});\r\n this.scrollTo(value);\r\n this.props.onValueChange(value);\r\n } else if (value === undefined || value === \"\") {\r\n this.setState({value: null, opened: true});\r\n this.props.onValueChange(null);\r\n }\r\n }}\r\n onKeyDown={(e) => {\r\n if (e.key === Key.ArrowUp || e.key === Key.ArrowDown) {\r\n this.props.onKeyDown(e.nativeEvent);\r\n e.preventDefault();\r\n }\r\n }}\r\n onFocus={() => {\r\n this.setState({opened: true});\r\n }}\r\n onClick={() => {\r\n this.setState({opened: true});\r\n }}\r\n />\r\n </div>\r\n );\r\n }\r\n}\r\n\r\nexport default withAgGridHooks(StatusTextCellEditor)"]}
|
|
@@ -49,7 +49,6 @@ import DurationCellEditor from "d2coreui/components/grid/cell/durationCellEditor
|
|
|
49
49
|
import CustomEnumCellEditor from "d2coreui/components/grid/cell/customEnumCellEditor";
|
|
50
50
|
import HexaValueCellEditor from "d2coreui/components/grid/cell/hexaValueCellEditor";
|
|
51
51
|
import HexaOctetStringCellEditor from "d2coreui/components/grid/cell/hexaOctetStringCellEditor";
|
|
52
|
-
import ReactDOM from "react-dom";
|
|
53
52
|
import { D2000UnixTimeNullValue, unixTimeToMoment } from "d2core/types/unixTimeUtils";
|
|
54
53
|
import { compileExpression } from "filtrex";
|
|
55
54
|
import DataGridPagination from "./panel/dataGridPagination";
|
|
@@ -1700,9 +1699,9 @@ class DataGrid extends React.Component {
|
|
|
1700
1699
|
React.createElement("div", { style: tPanelStyle },
|
|
1701
1700
|
React.createElement(WithCss, { useStyles: useStyles }, (styles) => {
|
|
1702
1701
|
var _a, _b, _c, _d;
|
|
1703
|
-
return React.createElement(Dropdown, { trigger: ["contextMenu"], getPopupContainer: () => {
|
|
1704
|
-
var _a
|
|
1705
|
-
const parentNode = ((
|
|
1702
|
+
return React.createElement(Dropdown, { trigger: ["contextMenu"], getPopupContainer: (triggerNode) => {
|
|
1703
|
+
var _a;
|
|
1704
|
+
const parentNode = ((_a = triggerNode === null || triggerNode === void 0 ? void 0 : triggerNode.parentNode) !== null && _a !== void 0 ? _a : document.body);
|
|
1706
1705
|
return parentNode;
|
|
1707
1706
|
}, menu: getContextMenu({
|
|
1708
1707
|
onlySelectedNodes: true,
|