d2coreui 21.0.15 → 21.0.17
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/clipboard/clipboardUtils.js.map +1 -1
- package/components/codemirror/SyntaxHighlighter.js.map +1 -1
- package/components/collapse/expandable.js.map +1 -1
- package/components/color/colorPicker.d.ts +1 -0
- package/components/color/colorPicker.js +1 -1
- package/components/color/colorPicker.js.map +1 -1
- package/components/color/colorSwatch.js.map +1 -1
- package/components/color/colorUtils.js.map +1 -1
- package/components/date/dateRangeInput.js +2 -2
- package/components/date/dateRangeInput.js.map +1 -1
- package/components/date/dateRangeInputAdvancedPanel.js.map +1 -1
- package/components/date/dateRangeInputConfirm.js.map +1 -1
- package/components/date/dateTimeInput.d.ts +2 -0
- package/components/date/dateTimeInput.js +10 -4
- package/components/date/dateTimeInput.js.map +1 -1
- package/components/date/durationInput.d.ts +7 -7
- package/components/date/durationInput.js +128 -75
- package/components/date/durationInput.js.map +1 -1
- package/components/form/NiceFormItem.d.ts +13 -0
- package/components/form/NiceFormItem.js +29 -0
- package/components/form/NiceFormItem.js.map +1 -0
- package/components/grid/cell/cellEditorUtils.js.map +1 -1
- package/components/grid/cell/customEnumCellEditor.js.map +1 -1
- package/components/grid/cell/dateCellEditor.js +1 -1
- package/components/grid/cell/dateCellEditor.js.map +1 -1
- package/components/grid/cell/durationCellEditor.js.map +1 -1
- package/components/grid/cell/hexaOctetStringCellEditor.js.map +1 -1
- package/components/grid/cell/hexaValueCellEditor.js.map +1 -1
- package/components/grid/cell/numberCellEditor.js.map +1 -1
- package/components/grid/cell/rangeSelector.js.map +1 -1
- package/components/grid/cell/simpleStatusTextCellEditor.js.map +1 -1
- package/components/grid/cell/statusTextCellEditor.js.map +1 -1
- package/components/grid/cell/tableDefaultRowStyleRules.js.map +1 -1
- package/components/grid/cell/textCellEditor.js +5 -1
- package/components/grid/cell/textCellEditor.js.map +1 -1
- package/components/grid/cell/wildcardQuickFilter.js.map +1 -1
- package/components/grid/columnUtils.js.map +1 -1
- package/components/grid/config/columnTransfer.js.map +1 -1
- package/components/grid/config/dataGridEditor.js.map +1 -1
- package/components/grid/config/rowStylePicker.js.map +1 -1
- package/components/grid/dataGrid.d.ts +3 -2
- package/components/grid/dataGrid.js +51 -54
- package/components/grid/dataGrid.js.map +1 -1
- package/components/grid/export/contextMenu.d.ts +2 -1
- package/components/grid/export/contextMenu.js +3 -3
- package/components/grid/export/contextMenu.js.map +1 -1
- package/components/grid/export/progressPopup.js.map +1 -1
- package/components/grid/export/worker/clipboardExport.js.map +1 -1
- package/components/grid/export/worker/csvExport.js.map +1 -1
- package/components/grid/export/worker/pdfExport.js.map +1 -1
- package/components/grid/export/worker/txtExport.js.map +1 -1
- package/components/grid/extendedDataGrid.d.ts +1 -0
- package/components/grid/extendedDataGrid.js +6 -2
- package/components/grid/extendedDataGrid.js.map +1 -1
- package/components/grid/filter/customColumnFilter.js.map +1 -1
- package/components/grid/filter/dateColumnFilter.js.map +1 -1
- package/components/grid/filter/textColumnFilter.js.map +1 -1
- package/components/grid/header/simpleHeader.js.map +1 -1
- package/components/grid/panel/dataGridPagination.d.ts +16 -0
- package/components/grid/panel/dataGridPagination.js +59 -0
- package/components/grid/panel/dataGridPagination.js.map +1 -0
- package/components/grid/panel/loadingOverlay.js.map +1 -1
- package/components/grid/panel/noRecordsOverlay.js.map +1 -1
- package/components/grid/panel/tablePagination.js.map +1 -1
- package/components/icons/ant-design-double-right-outline.svg +5 -5
- package/components/icons/ant-design_close-outline.svg +5 -5
- package/components/icons/undoIcon.js.map +1 -1
- package/components/input/autoCompleteInput.js.map +1 -1
- package/components/input/draftUtils.js.map +1 -1
- package/components/input/draftail.js.map +1 -1
- package/components/input/hexaFormattedInput.js.map +1 -1
- package/components/input/mask/helpers.js.map +1 -1
- package/components/input/mask/inputMaskCore.js.map +1 -1
- package/components/input/mask/pattern.js.map +1 -1
- package/components/input/maskedInput.d.ts +2 -2
- package/components/input/maskedInput.js.map +1 -1
- package/components/input/passwordInput.js.map +1 -1
- package/components/input/simpleAutoComplete.js.map +1 -1
- package/components/input/textarea/extractSpansOfClasses.js.map +1 -1
- package/components/input/textarea/getRanges.js.map +1 -1
- package/components/input/textarea/getType.js.map +1 -1
- package/components/input/textarea/highlighedContents.js.map +1 -1
- package/components/input/textarea/mentionsWithHighlighting.js +1 -1
- package/components/input/textarea/mentionsWithHighlighting.js.map +1 -1
- package/components/keyboard/keyboardUtils.js.map +1 -1
- package/components/modal/draggableModalProvider.js.map +1 -1
- package/components/modal/impl/clamp.js.map +1 -1
- package/components/modal/impl/draggableModal.js.map +1 -1
- package/components/modal/impl/draggableModalContext.js.map +1 -1
- package/components/modal/impl/draggableModalInner.js.map +1 -1
- package/components/modal/impl/draggableModalReducer.js.map +1 -1
- package/components/modal/impl/getWindowSize.js.map +1 -1
- package/components/modal/impl/index.js.map +1 -1
- package/components/modal/impl/resizeHandle.js.map +1 -1
- package/components/modal/impl/useDrag.js.map +1 -1
- package/components/modal/impl/usePrevious.js.map +1 -1
- package/components/modal/impl/useResize.js.map +1 -1
- package/components/modal/modalDialog.js.map +1 -1
- package/components/picker/enumValuePicker.js.map +1 -1
- package/components/platformSpecific.js.map +1 -1
- package/components/scrollTo/onlyText.js.map +1 -1
- package/components/scrollTo/scrollTo.js.map +1 -1
- package/components/table/dataTable.d.ts +1 -0
- package/components/table/dataTable.js.map +1 -1
- package/components/table/dragSortingTable.js.map +1 -1
- package/components/text/impl/innerSize.js.map +1 -1
- package/components/text/impl/series.js.map +1 -1
- package/components/text/impl/shallowEqual.js.map +1 -1
- package/components/text/impl/uniqueId.js.map +1 -1
- package/components/text/impl/whilst.js.map +1 -1
- package/components/text/textFit.js.map +1 -1
- package/i18n/components.cs.json +100 -0
- package/i18n/components.sk.json +5 -1
- package/i18n/componentsLocaleHolder.d.ts +1 -1
- package/i18n/componentsLocaleHolder.js +6 -4
- package/i18n/componentsLocaleHolder.js.map +1 -1
- package/package.json +70 -70
- package/style/ag-grid/_ag-theme-antd-vars.scss +194 -194
- package/style/ag-grid/ag-theme-antd.scss +87 -87
- package/style/ag-grid/aggrid-adaptations.css +42 -42
- package/style/ag-grid/aggrid.scss +11 -11
- package/style/antd/antd-tree-showline.css +24 -24
- package/style/antd/full-height-tabs.scss +62 -62
- package/style/draftail/draftail-editor.css +179 -179
- package/style/flexLayout/flexLayout.scss +130 -130
- package/style/flexLayout/flexLayoutBase.scss +623 -623
- package/style/flexLayout/new/flexLayoutBase.scss +621 -621
- package/style/form/niceFormItem.css +39 -0
- package/style/index.less +291 -291
- package/style/loading.css +31 -31
- package/style/modal/DraggableModal.css +40 -40
- package/style/modal/ResizeHandle.css +19 -19
- package/style/splitPane/splitPane.css +48 -48
- package/style/table/dragSortingTable.css +6 -6
- package/components/date/millisecondDatePicker.d.ts +0 -16
- package/components/date/millisecondDatePicker.js +0 -56
- package/components/date/millisecondDatePicker.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"durationCellEditor.js","sourceRoot":"","sources":["../../../../../components/grid/cell/durationCellEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAChC,OAAO,aAAa,MAAM,4CAA4C,CAAC;AACvE,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,aAAa,MAAM,wCAAwC,CAAC;AACnE,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,MAAM,GAAG,GAAG,CAAC;AAYnB,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,KAAK,CAAC,SAAgE;IAIlH,YAAY,KAA6C;QACrD,KAAK,CAAC,KAAK,CAAC,CAAC;QAJT,mBAAc,GAAyB,IAAI,CAAC;QAC5C,cAAS,GAAkB,IAAI,CAA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CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EACpH,QAAQ,EAAE,CAAC,IAA4B,EAAE,EAAE;gBACvC,IAAI,aAAa,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;oBAErC,OAAO;iBACV;gBACD,IAAI,IAAI,EAAE;oBACN,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC,EAAC,CAAC,CAAC;iBAC1D;qBAAM,IAAI,IAAI,KAAK,SAAS,EAAE;oBAC3B,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC;iBAChC;YACL,CAAC,EACD,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;gBACb,IAAI,eAAe,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE;oBACzC,CAAC,CAAC,cAAc,EAAE,CAAC;oBACnB,CAAC,CAAC,WAAW,CAAC,wBAAwB,EAAE,CAAC;oBACzC,CAAC,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC;iBAClC;YACL,CAAC,EACD,KAAK,EAAE,EAAC,KAAK,EAAE,MAAM,EAAC,GACxB,CACL,CAAC;IACN,CAAC;CACJ","sourcesContent":["import React from 'react';\
|
|
1
|
+
{"version":3,"file":"durationCellEditor.js","sourceRoot":"","sources":["../../../../../components/grid/cell/durationCellEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAChC,OAAO,aAAa,MAAM,4CAA4C,CAAC;AACvE,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,aAAa,MAAM,wCAAwC,CAAC;AACnE,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB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C3B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EACpD,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EACpH,QAAQ,EAAE,CAAC,IAA4B,EAAE,EAAE;gBACvC,IAAI,aAAa,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;oBAErC,OAAO;iBACV;gBACD,IAAI,IAAI,EAAE;oBACN,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC,EAAC,CAAC,CAAC;iBAC1D;qBAAM,IAAI,IAAI,KAAK,SAAS,EAAE;oBAC3B,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC;iBAChC;YACL,CAAC,EACD,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;gBACb,IAAI,eAAe,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE;oBACzC,CAAC,CAAC,cAAc,EAAE,CAAC;oBACnB,CAAC,CAAC,WAAW,CAAC,wBAAwB,EAAE,CAAC;oBACzC,CAAC,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC;iBAClC;YACL,CAAC,EACD,KAAK,EAAE,EAAC,KAAK,EAAE,MAAM,EAAC,GACxB,CACL,CAAC;IACN,CAAC;CACJ","sourcesContent":["import React from 'react';\nimport {ICellEditor, ICellEditorParams} from \"ag-grid-community\";\nimport {Key} from \"ts-key-enum\";\nimport KeyboardUtils from \"d2coreui/components/keyboard/keyboardUtils\";\nimport {CellEditorUtils} from \"./cellEditorUtils\";\nimport DurationInput from \"d2coreui/components/date/durationInput\";\nimport moment from \"moment\";\n\nconst KEY_BACKSPACE = 8;\nconst KEY_DELETE = 46;\nconst KEY_F2 = 113;\n\ninterface DurationCellEditorProperties extends ICellEditorParams {\n mask?: string\n}\n\ninterface DurationCellEditorState {\n value: number | null\n highlightAllOnFocus: boolean\n cancelEdit: boolean\n}\n\nexport default class DurationCellEditor extends React.Component<DurationCellEditorProperties, DurationCellEditorState> implements ICellEditor {\n private inputComponent: DurationInput | null = null;\n private focusOpId: number | null = null;\n\n constructor(props: Readonly<DurationCellEditorProperties>) {\n super(props);\n this.state = this.getInitialState(props);\n }\n\n getInitialState(props: Readonly<DurationCellEditorProperties>): DurationCellEditorState {\n let value: number | null;\n let highlightAllOnFocus = true;\n\n if (props.keyPress === KEY_BACKSPACE || props.keyPress === KEY_DELETE) {\n // if backspace or delete pressed, we clear the cell\n value = null;\n } else if (props.charPress) {\n // if a letter was pressed, we start with the letter\n const parsedValue = Number.parseInt(props.charPress);\n value = isNaN(parsedValue) ? props.value : parsedValue;\n highlightAllOnFocus = false;\n } else {\n // otherwise we start with the current value\n value = props.value;\n if (props.keyPress === KEY_F2) {\n highlightAllOnFocus = false;\n }\n }\n return {\n value: value,\n highlightAllOnFocus,\n cancelEdit: false\n } as DurationCellEditorState;\n }\n\n componentWillUnmount() {\n if (this.focusOpId) {\n clearTimeout(this.focusOpId);\n }\n }\n\n afterGuiAttached() {\n this.focusOpId = window.setTimeout(() => {\n this.inputComponent?.focus();\n if (this.state.highlightAllOnFocus) {\n this.inputComponent?.input?.select();\n this.setState({\n highlightAllOnFocus: false,\n });\n } else {\n // when we started editing, we want the carot at the end, not the start.\n // this comes into play in two scenarios: a) when user hits F2 and b)\n // when user hits a printable character, then on IE (and only IE) the carot\n // was placed after the first character, thus 'apply' would end up as 'pplea'\n const length = this.inputComponent?.input?.value ? this.inputComponent?.input.value.length : 0;\n if (length > 0) {\n this.inputComponent?.input?.setSelectionRange(length, length);\n }\n }\n }, 200);\n }\n\n getValue() {\n return this.state.value;\n }\n\n isPopup(): boolean {\n return true;\n }\n\n isCancelBeforeStart(): boolean {\n return !!this.props.charPress && '1234567890'.indexOf(this.props.charPress) < 0;\n }\n\n isCancelAfterEnd() {\n return false;\n }\n\n render() {\n return (\n <DurationInput\n ref={(component) => {\n this.inputComponent = component as DurationInput | null;\n }}\n mask={this.props.mask ?? \"\"}\n placeholder={this.state.value === null ? \"NULL\" : \"\"}\n value={this.state.value !== undefined && this.state.value !== null ? moment.duration(this.state.value * 1000) : null}\n onChange={(time: moment.Duration | null) => {\n if (KeyboardUtils.isKeyPressed(Key.Alt)) {\n // ignore navigational keystrokes ALT+cursor arrow\n return;\n }\n if (time) {\n this.setState({value: (time.asMilliseconds() / 1000)});\n } else if (time === undefined) {\n this.setState({value: null});\n }\n }}\n onKeyDown={(e) => {\n if (CellEditorUtils.shouldIgnoreKeyEvent(e)) {\n e.preventDefault();\n e.nativeEvent.stopImmediatePropagation();\n e.nativeEvent.preventDefault();\n }\n }}\n style={{width: '100%'}}\n />\n );\n }\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hexaOctetStringCellEditor.js","sourceRoot":"","sources":["../../../../../components/grid/cell/hexaOctetStringCellEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAChC,OAAO,aAAa,MAAM,4CAA4C,CAAC;AACvE,OAAO,SAAS,MAAM,iBAAiB,CAAC;AAExC,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,MAAM,GAAG,GAAG,CAAC;AAYnB,MAAM,CAAC,OAAO,OAAO,yBAA0B,SAAQ,KAAK,CAAC,SAAyE;IAIlI,YAAY,KAA+C;QACvD,KAAK,CAAC,KAAK,CAAC,CAAC;QAJT,mBAAc,GAA4B,IAAI,CAAC;QA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CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,EACxG,aAAa,EAAE,KAAK,CAAC,EAAE;gBACnB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;gBAC1B,IAAI,aAAa,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;oBAErC,OAAO;iBACV;gBAED,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;oBAC/B,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE,EAAC,CAAC,CAAC;iBAC/C;qBAAM,IAAI,KAAK,KAAK,EAAE,EAAE;oBACrB,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,EAAE,EAAC,CAAC,CAAC;iBAC9B;YACL,CAAC,EACD,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EACjB,QAAQ,EAAC,GAAG,EACZ,QAAQ,EAAE,KAAK,GACjB,CACL,CAAC;IACN,CAAC;CACJ","sourcesContent":["import React from 'react';\
|
|
1
|
+
{"version":3,"file":"hexaOctetStringCellEditor.js","sourceRoot":"","sources":["../../../../../components/grid/cell/hexaOctetStringCellEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAChC,OAAO,aAAa,MAAM,4CAA4C,CAAC;AACvE,OAAO,SAAS,MAAM,iBAAiB,CAAC;AAExC,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,MAAM,GAAG,GAAG,CAAC;AAYnB,MAAM,CAAC,OAAO,OAAO,yBAA0B,SAAQ,KAAK,CAAC,SAAyE;IAIlI,YAAY,KAA+C;QACvD,KAAK,CAAC,KAAK,CAAC,CAAC;QAJT,mBAAc,GAA4B,IAAI,CAAC;QAC/C,cAAS,GAAkB,IAAI,CAAC;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CAAC,CAAC,CAAC,EAAE,EACxG,aAAa,EAAE,KAAK,CAAC,EAAE;gBACnB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;gBAC1B,IAAI,aAAa,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;oBAErC,OAAO;iBACV;gBAED,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;oBAC/B,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE,EAAC,CAAC,CAAC;iBAC/C;qBAAM,IAAI,KAAK,KAAK,EAAE,EAAE;oBACrB,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,EAAE,EAAC,CAAC,CAAC;iBAC9B;YACL,CAAC,EACD,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EACjB,QAAQ,EAAC,GAAG,EACZ,QAAQ,EAAE,KAAK,GACjB,CACL,CAAC;IACN,CAAC;CACJ","sourcesContent":["import React from 'react';\nimport {ICellEditor, ICellEditorParams} from \"ag-grid-community\";\nimport {Key} from \"ts-key-enum\";\nimport KeyboardUtils from \"d2coreui/components/keyboard/keyboardUtils\";\nimport MaskInput from 'react-maskinput';\n\nconst KEY_BACKSPACE = 8;\nconst KEY_DELETE = 46;\nconst KEY_F2 = 113;\n\ninterface HexaOctetStringCellEditorProps extends ICellEditorParams {\n hexaStringMaxLength: number\n}\n\ninterface HexaOctetStringCellEditorState {\n value: string | null\n highlightAllOnFocus: boolean\n cancelEdit: boolean\n}\n\nexport default class HexaOctetStringCellEditor extends React.Component<HexaOctetStringCellEditorProps, HexaOctetStringCellEditorState> implements ICellEditor {\n private inputComponent: HTMLInputElement | null = null;\n private focusOpId: number | null = null;\n\n constructor(props: Readonly<HexaOctetStringCellEditorProps>) {\n super(props);\n this.state = this.getInitialState(props);\n }\n\n getInitialState(props: Readonly<HexaOctetStringCellEditorProps>): HexaOctetStringCellEditorState {\n let value: number | null;\n let highlightAllOnFocus = true;\n\n if (props.keyPress === KEY_BACKSPACE || props.keyPress === KEY_DELETE) {\n // if backspace or delete pressed, we clear the cell\n value = null;\n } else if (props.charPress) {\n // if a letter was pressed, we start with the letter\n const parsedValue = Number.parseInt(props.charPress);\n value = isNaN(parsedValue) ? props.value : parsedValue;\n highlightAllOnFocus = false;\n } else {\n // otherwise we start with the current value\n value = props.value;\n if (props.keyPress === KEY_F2) {\n highlightAllOnFocus = false;\n }\n }\n return {\n value: value,\n highlightAllOnFocus,\n cancelEdit: false\n } as HexaOctetStringCellEditorState;\n }\n\n componentWillUnmount() {\n if (this.focusOpId) {\n clearTimeout(this.focusOpId);\n }\n }\n\n afterGuiAttached() {\n this.focusOpId = window.setTimeout(() => {\n this.inputComponent?.focus();\n if (this.state.highlightAllOnFocus) {\n this.inputComponent?.select();\n this.setState({\n highlightAllOnFocus: false,\n });\n } else {\n // when we started editing, we want the carot at the end, not the start.\n // this comes into play in two scenarios: a) when user hits F2 and b)\n // when user hits a printable character, then on IE (and only IE) the carot\n // was placed after the first character, thus 'apply' would end up as 'pplea'\n const length = this.inputComponent?.value ? this.inputComponent?.value.length : 0;\n if (length > 0) {\n this.inputComponent?.setSelectionRange(length, length);\n }\n }\n }, 200);\n }\n\n getValue() {\n return this.state.value;\n }\n\n isPopup(): boolean {\n return true;\n }\n\n isCancelBeforeStart(): boolean {\n return !!this.props.charPress && '1234567890'.indexOf(this.props.charPress) < 0;\n }\n\n isCancelAfterEnd() {\n return false;\n }\n\n render() {\n let mask = \"\";\n for (let i = 0; i < this.props.hexaStringMaxLength; i++) {\n mask += \"** \";\n }\n\n return (\n <MaskInput\n getReference={component => {\n this.inputComponent = component;\n component.className = \"ant-input ant-input-sm\";\n }}\n value={this.state.value !== undefined && this.state.value !== null ? this.state.value.toUpperCase() : \"\"}\n onValueChange={event => {\n const value = event.value;\n if (KeyboardUtils.isKeyPressed(Key.Alt)) {\n // ignore navigational keystrokes ALT+cursor arrow\n return;\n }\n\n if (/^[0-9A-Fa-f ]+$/.test(value)) {\n this.setState({value: value.toUpperCase()});\n } else if (value === \"\") {\n this.setState({value: \"\"});\n }\n }}\n mask={mask.trim()}\n maskChar=\" \"\n showMask={false}\n />\n );\n }\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hexaValueCellEditor.js","sourceRoot":"","sources":["../../../../../components/grid/cell/hexaValueCellEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAChC,OAAO,aAAa,MAAM,4CAA4C,CAAC;AACvE,OAAO,kBAAkB,MAAM,8CAA8C,CAAC;AAE9E,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,MAAM,GAAG,GAAG,CAAC;AAYnB,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,KAAK,CAAC,SAA6D;IAIhH,YAAY,KAAyC;QACjD,KAAK,CAAC,KAAK,CAAC,CAAC;QAJT,mBAAc,GAA8B,IAAI,CAAC;QACjD,cAAS,GAAkB,IAAI,CAAC;QAIpC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IAED,eAAe,CAAC,KAAyC;QACrD,IAAI,KAAoB,CAAC;QACzB,IAAI,mBAAmB,GAAG,IAAI,CAAC;QAE/B,IAAI,KAAK,CAAC,QAAQ,KAAK,aAAa,IAAI,KAAK,CAAC,QAAQ,KAAK,UAAU,EAAE;YAEnE,KAAK,GAAG,IAAI,CAAC;SAChB;aAAM,IAAI,KAAK,CAAC,SAAS,EAAE;YAExB,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YACrD,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAA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C5B,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,mBAAmB;QACf,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACpF,CAAC;IAED,gBAAgB;QACZ,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM;;QACF,OAAO,CACH,oBAAC,kBAAkB,IACf,GAAG,EAAE,CAAC,SAAS,EAAE,EAAE;gBACf,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;YACpC,CAAC,EACD,KAAK,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,mCAAI,EAAE,EAC7B,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,QAAQ,EAAE,KAAK,CAAC,EAAE;gBACd,IAAI,aAAa,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;oBAErC,OAAO;iBACV;gBACD,IAAI,KAAK,EAAE;oBACP,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,KAAK,EAAC,CAAC,CAAC;iBACjC;qBAAM;oBACH,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC;iBAChC;YACL,CAAC,EACD,IAAI,EAAE,OAAO,GACf,CACL,CAAA;IACL,CAAC;CACJ","sourcesContent":["import React from 'react';\
|
|
1
|
+
{"version":3,"file":"hexaValueCellEditor.js","sourceRoot":"","sources":["../../../../../components/grid/cell/hexaValueCellEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAChC,OAAO,aAAa,MAAM,4CAA4C,CAAC;AACvE,OAAO,kBAAkB,MAAM,8CAA8C,CAAC;AAE9E,MAAM,aAAa,GAAG,CAAC,CAAC;A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,EAC7B,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,QAAQ,EAAE,KAAK,CAAC,EAAE;gBACd,IAAI,aAAa,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;oBAErC,OAAO;iBACV;gBACD,IAAI,KAAK,EAAE;oBACP,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,KAAK,EAAC,CAAC,CAAC;iBACjC;qBAAM;oBACH,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC;iBAChC;YACL,CAAC,EACD,IAAI,EAAE,OAAO,GACf,CACL,CAAA;IACL,CAAC;CACJ","sourcesContent":["import React from 'react';\nimport {ICellEditor, ICellEditorParams} from \"ag-grid-community\";\nimport {Key} from \"ts-key-enum\";\nimport KeyboardUtils from \"d2coreui/components/keyboard/keyboardUtils\";\nimport HexaFormattedInput from \"d2coreui/components/input/hexaFormattedInput\";\n\nconst KEY_BACKSPACE = 8;\nconst KEY_DELETE = 46;\nconst KEY_F2 = 113;\n\ninterface HexaValueCellEditorProps extends ICellEditorParams {\n maxLength: number\n}\n\ninterface HexaValueCellEditorState {\n value: string | null\n highlightAllOnFocus: boolean\n cancelEdit: boolean\n}\n\nexport default class HexaValueCellEditor extends React.Component<HexaValueCellEditorProps, HexaValueCellEditorState> implements ICellEditor {\n private inputComponent: HexaFormattedInput | null = null;\n private focusOpId: number | null = null;\n\n constructor(props: Readonly<HexaValueCellEditorProps>) {\n super(props);\n this.state = this.getInitialState(props);\n }\n\n getInitialState(props: Readonly<HexaValueCellEditorProps>): HexaValueCellEditorState {\n let value: number | null;\n let highlightAllOnFocus = true;\n\n if (props.keyPress === KEY_BACKSPACE || props.keyPress === KEY_DELETE) {\n // if backspace or delete pressed, we clear the cell\n value = null;\n } else if (props.charPress) {\n // if a letter was pressed, we start with the letter\n const parsedValue = Number.parseInt(props.charPress);\n value = isNaN(parsedValue) ? props.value : parsedValue;\n highlightAllOnFocus = false;\n } else {\n // otherwise we start with the current value\n value = props.value;\n if (props.keyPress === KEY_F2) {\n highlightAllOnFocus = false;\n }\n }\n return {\n value: value,\n highlightAllOnFocus,\n cancelEdit: false\n } as HexaValueCellEditorState;\n }\n\n componentWillUnmount() {\n if (this.focusOpId) {\n clearTimeout(this.focusOpId);\n }\n }\n\n afterGuiAttached() {\n this.focusOpId = window.setTimeout(() => {\n this.inputComponent?.focus();\n if (this.state.highlightAllOnFocus) {\n this.inputComponent?.input?.select();\n this.setState({\n highlightAllOnFocus: false,\n });\n } else {\n // when we started editing, we want the carot at the end, not the start.\n // this comes into play in two scenarios: a) when user hits F2 and b)\n // when user hits a printable character, then on IE (and only IE) the carot\n // was placed after the first character, thus 'apply' would end up as 'pplea'\n const length = this.inputComponent?.input?.value ? this.inputComponent?.input.value.length : 0;\n if (length > 0) {\n this.inputComponent?.input?.setSelectionRange(length, length);\n }\n }\n }, 200);\n }\n\n getValue() {\n return this.state.value;\n }\n\n isPopup(): boolean {\n return true;\n }\n\n isCancelBeforeStart(): boolean {\n return !!this.props.charPress && '1234567890'.indexOf(this.props.charPress) < 0;\n }\n\n isCancelAfterEnd() {\n return false;\n }\n\n render() {\n return (\n <HexaFormattedInput\n ref={(component) => {\n this.inputComponent = component;\n }}\n value={this.state.value ?? \"\"}\n maxLength={this.props.maxLength}\n onChange={value => {\n if (KeyboardUtils.isKeyPressed(Key.Alt)) {\n // ignore navigational keystrokes ALT+cursor arrow\n return;\n }\n if (value) {\n this.setState({value: value});\n } else {\n this.setState({value: null});\n }\n }}\n size={\"small\"}\n />\n )\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numberCellEditor.js","sourceRoot":"","sources":["../../../../../components/grid/cell/numberCellEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,MAAM,CAAC;AAEjC,OAAO,EAAC,GAAG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,EAAE,MAAM,EAAC,GACxB,CACL,CAAC;IACN,CAAC;CACJ","sourcesContent":["import React from 'react';\
|
|
1
|
+
{"version":3,"file":"numberCellEditor.js","sourceRoot":"","sources":["../../../../../components/grid/cell/numberCellEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,MAAM,CAAC;AAEjC,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAChC,OAAO,aAAa,MAAM,4CAA4C,CAAC;AACvE,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAElD,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,MAAM,GAAG,GAAG,CAAC;AAenB,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,KAAK,CAAC,SAA6D;IAI7G,YAAY,KAA2C;QACnD,KAAK,CAAC,KAAK,CAAC,CAAC;QAJT,mBAAc,GAA4B,IAAI,CAAC;QAC/C,cAAS,GAAkB,IAAI,CAAC;QAIpC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IAED,eAAe,CAAC,KAA2C;QACvD,IAAI,KAAoB,CAAC;QACzB,IAAI,mBAAmB,GAAG,IAAI,CAAC;QAE/B,IAAI,KAAK,CAAC,QAAQ,KAAK,aAAa,IAAI,KAAK,CAAC,QAAQ,KAAK,UAAU,EAAE;YAEnE,KAAK,GAAG,IAAI,CAAC;SAChB;aAAM,IAAI,KAAK,CAAC,SAAS,EAAE;YAExB,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YACrD,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC;YACvD,mBAAmB,GAAG,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,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;gBACb,IAAI,eAAe,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE;oBAEzC,CAAC,CAAC,cAAc,EAAE,CAAC;oBACnB,CAAC,CAAC,WAAW,CAAC,wBAAwB,EAAE,CAAC;oBACzC,CAAC,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC;iBAClC;YACL,CAAC,EACD,KAAK,EAAE,EAAC,KAAK,EAAE,MAAM,EAAC,GACxB,CACL,CAAC;IACN,CAAC;CACJ","sourcesContent":["import React from 'react';\nimport {InputNumber} from \"antd\";\nimport {ICellEditor, ICellEditorParams} from \"ag-grid-community\";\nimport {Key} from \"ts-key-enum\";\nimport KeyboardUtils from \"d2coreui/components/keyboard/keyboardUtils\";\nimport {CellEditorUtils} from \"./cellEditorUtils\";\n\nconst KEY_BACKSPACE = 8;\nconst KEY_DELETE = 46;\nconst KEY_F2 = 113;\n\ninterface NumberCellEditorProperties extends ICellEditorParams {\n decimalSeparator?: string\n precision?: number\n min?: number\n max?: number\n}\n\ninterface NumericCellEditorState {\n value: number | null\n highlightAllOnFocus: boolean\n cancelEdit: boolean\n}\n\nexport default class NumberCellEditor extends React.Component<NumberCellEditorProperties, NumericCellEditorState> implements ICellEditor {\n private inputComponent: HTMLInputElement | null = null;\n private focusOpId: number | null = null;\n\n constructor(props: Readonly<NumberCellEditorProperties>) {\n super(props);\n this.state = this.getInitialState(props);\n }\n\n getInitialState(props: Readonly<NumberCellEditorProperties>): NumericCellEditorState {\n let value: number | null;\n let highlightAllOnFocus = true;\n\n if (props.keyPress === KEY_BACKSPACE || props.keyPress === KEY_DELETE) {\n // if backspace or delete pressed, we clear the cell\n value = null;\n } else if (props.charPress) {\n // if a letter was pressed, we start with the letter\n const parsedValue = Number.parseInt(props.charPress);\n value = isNaN(parsedValue) ? props.value : parsedValue;\n highlightAllOnFocus = false;\n } else {\n // otherwise we start with the current value\n value = props.value;\n if (props.keyPress === KEY_F2) {\n highlightAllOnFocus = false;\n }\n }\n return {\n value: value,\n highlightAllOnFocus,\n cancelEdit: false\n } as NumericCellEditorState;\n }\n\n componentWillUnmount() {\n if (this.focusOpId) {\n clearTimeout(this.focusOpId);\n }\n }\n\n afterGuiAttached() {\n this.focusOpId = window.setTimeout(() => {\n this.inputComponent?.focus();\n if (this.state.highlightAllOnFocus) {\n this.inputComponent?.select();\n this.setState({\n highlightAllOnFocus: false,\n });\n } else {\n // when we started editing, we want the carot at the end, not the start.\n // this comes into play in two scenarios: a) when user hits F2 and b)\n // when user hits a printable character, then on IE (and only IE) the carot\n // was placed after the first character, thus 'apply' would end up as 'pplea'\n const length = this.inputComponent?.value ? this.inputComponent?.value.length : 0;\n if (length > 0) {\n this.inputComponent?.setSelectionRange(length, length);\n }\n }\n }, 200);\n }\n\n getValue() {\n return this.state.value;\n }\n\n isPopup(): boolean {\n return true;\n }\n\n isCancelBeforeStart(): boolean {\n return !!this.props.charPress && '1234567890'.indexOf(this.props.charPress) < 0;\n }\n\n isCancelAfterEnd() {\n return false;\n }\n\n render() {\n return (\n <InputNumber\n ref={(component) => {\n this.inputComponent = component;\n }}\n size=\"small\"\n autoFocus\n decimalSeparator={this.props.decimalSeparator}\n precision={this.props.precision}\n min={this.props.min}\n max={this.props.max}\n placeholder={this.state.value === null ? \"NULL\" : \"\"}\n value={this.state.value !== undefined && this.state.value !== null ? this.state.value : undefined}\n onChange={(value: number | string | undefined) => {\n if (KeyboardUtils.isKeyPressed(Key.Alt)) {\n // ignore navigational keystrokes ALT+cursor arrow\n return;\n }\n if (typeof value === \"number\") {\n this.setState({value: value});\n } else if (value === undefined || value === \"\") {\n this.setState({value: null});\n }\n }}\n onKeyDown={(e) => {\n if (CellEditorUtils.shouldIgnoreKeyEvent(e)) {\n // this.props.onKeyDown(e.nativeEvent);\n e.preventDefault();\n e.nativeEvent.stopImmediatePropagation();\n e.nativeEvent.preventDefault();\n }\n }}\n style={{width: '100%'}}\n />\n );\n }\n}"]}
|
|
@@ -1 +1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AAU,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,EAAE,EAAE;YAC1C,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;SAC/B;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ","sourcesContent":["import {_, AutoScrollService, Constants, Events} from \"ag-grid-community\";\r\nimport React from \"react\";\r\n\r\nexport class RangeSelector {\r\n constructor(wrappingDiv) {\r\n this.wrappingDiv = wrappingDiv;\r\n }\r\n\r\n init(gridApi, gridColumnApi) {\r\n this.rowModel = gridApi.rowModel;\r\n this.mouseEventService = gridApi.navigationService.mouseEventService;\r\n this.columnApi = gridColumnApi;\r\n this.columnModel = gridColumnApi.columnModel;\r\n this.gridApi = gridApi;\r\n this.cellNavigationService = gridApi.navigationService.cellNavigationService;\r\n this.pinnedRowModel = gridApi.pinnedRowModel;\r\n this.rowPositionUtils = gridApi.menuFactory.focusService.rowPositionUtils;\r\n this.rowRenderer = gridApi.rowRenderer;\r\n this.eventService = gridApi.eventService;\r\n this.gridOptionsWrapper = gridApi.gridOptionsWrapper;\r\n this.focusService = gridApi.focusService;\r\n this.cellPositionUtils = gridApi.cellPositionUtils;\r\n this.ctrlsService = gridApi.menuFactory.focusService.headerNavigationService.headerPositionUtils.ctrlsService;\r\n\r\n this.cellRanges = [];\r\n this.bodyScrollListener = this.onBodyScroll.bind(this);\r\n this.dragging = false;\r\n\r\n this.eventService.addEventListener(Events.EVENT_NEW_COLUMNS_LOADED, () => this.removeAllCellRanges());\r\n this.eventService.addEventListener(Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, () => this.removeAllCellRanges());\r\n this.eventService.addEventListener(Events.EVENT_COLUMN_ROW_GROUP_CHANGED, () => this.removeAllCellRanges());\r\n this.eventService.addEventListener(Events.EVENT_COLUMN_PIVOT_CHANGED, () => this.removeAllCellRanges());\r\n this.eventService.addEventListener(Events.EVENT_COLUMN_GROUP_OPENED, this.refreshLastRangeStart.bind(this));\r\n this.eventService.addEventListener(Events.EVENT_COLUMN_MOVED, this.refreshLastRangeStart.bind(this));\r\n this.eventService.addEventListener(Events.EVENT_COLUMN_PINNED, this.refreshLastRangeStart.bind(this));\r\n this.eventService.addEventListener(Events.EVENT_COLUMN_VISIBLE, this.onColumnVisibleChange.bind(this));\r\n\r\n this.gridPanel = gridApi.gridPanel;\r\n\r\n this.ctrlsService.whenReady(() => {\r\n const gridBodyCon = this.ctrlsService.getGridBodyCtrl();\r\n this.autoScrollService = new AutoScrollService({\r\n scrollContainer: gridBodyCon.getBodyViewportElement(),\r\n scrollAxis: 'xy',\r\n getVerticalPosition: () => gridBodyCon.getScrollFeature().getVScrollPosition().top,\r\n setVerticalPosition: (position) => gridBodyCon.getScrollFeature().setVerticalScrollPosition(position),\r\n getHorizontalPosition: () => gridBodyCon.getScrollFeature().getHScrollPosition().left,\r\n setHorizontalPosition: (position) => gridBodyCon.getScrollFeature().setHorizontalScrollPosition(position),\r\n shouldSkipVerticalScroll: () => this.gridOptionsWrapper.getDomLayout() !== Constants.DOM_LAYOUT_NORMAL,\r\n shouldSkipHorizontalScroll: () => gridBodyCon.getScrollFeature().isHorizontalScrollShowing()\r\n });\r\n });\r\n\r\n //intitialization of drag event handling\r\n this.dragService = this.gridApi.dragAndDropService.dragService;\r\n const eContainers = this.wrappingDiv.querySelectorAll(`[ref=\"eContainer\"]`);\r\n for (const eContainer of eContainers) {\r\n const params = {\r\n eElement: eContainer,\r\n onDragStart: this.onDragStart.bind(this),\r\n onDragStop: this.onDragStop.bind(this),\r\n onDragging: this.onDragging.bind(this)\r\n };\r\n\r\n this.dragService.addDragSource(params);\r\n this.dragService.addDestroyFunc(() => this.dragService.removeDragSource(params));\r\n }\r\n }\r\n\r\n cellPositionEquals(cellA, cellB) {\r\n const colsMatch = cellA.column === cellB.column;\r\n const floatingMatch = cellA.rowPinned === cellB.rowPinned;\r\n const indexMatch = cellA.rowIndex === cellB.rowIndex;\r\n return colsMatch && floatingMatch && indexMatch;\r\n }\r\n\r\n onColumnVisibleChange() {\r\n // first move start column in last cell range (i.e. series chart range)\r\n this.refreshLastRangeStart();\r\n\r\n // then check if the column visibility has changed in any cell range\r\n this.cellRanges.forEach(cellRange => {\r\n const beforeCols = cellRange.columns;\r\n\r\n // remove hidden cols from cell range\r\n cellRange.columns = cellRange.columns.filter(col => col.isVisible());\r\n\r\n const colsInRangeChanged = !_.areEqual(beforeCols, cellRange.columns);\r\n if (colsInRangeChanged) {\r\n this.dispatchChangedEvent(false, true, cellRange.id);\r\n }\r\n });\r\n }\r\n\r\n refreshLastRangeStart() {\r\n const lastRange = _.last(this.cellRanges);\r\n if (!lastRange) {\r\n return;\r\n }\r\n\r\n this.refreshRangeStart(lastRange);\r\n }\r\n\r\n isContiguousRange(cellRange) {\r\n const rangeColumns = cellRange.columns;\r\n\r\n if (!rangeColumns.length) {\r\n return false;\r\n }\r\n\r\n const allColumns = this.columnModel.getAllDisplayedColumns();\r\n const allPositions = rangeColumns.map(c => allColumns.indexOf(c)).sort((a, b) => a - b);\r\n\r\n return _.last(allPositions) - allPositions[0] + 1 === rangeColumns.length;\r\n }\r\n\r\n getRangeStartRow(cellRange) {\r\n if (cellRange.startRow && cellRange.endRow) {\r\n return this.rowPositionUtils.before(cellRange.startRow, cellRange.endRow) ?\r\n cellRange.startRow : cellRange.endRow;\r\n }\r\n const rowPinned = this.pinnedRowModel.getPinnedTopRowCount() > 0 ? Constants.PINNED_TOP : null;\r\n return {rowIndex: 0, rowPinned};\r\n }\r\n\r\n getRangeEndRow(cellRange) {\r\n if (cellRange.startRow && cellRange.endRow) {\r\n return this.rowPositionUtils.before(cellRange.startRow, cellRange.endRow) ?\r\n cellRange.endRow : cellRange.startRow;\r\n }\r\n\r\n const pinnedBottomRowCount = this.pinnedRowModel.getPinnedBottomRowCount();\r\n const pinnedBottom = pinnedBottomRowCount > 0;\r\n\r\n if (pinnedBottom) {\r\n return {\r\n rowIndex: pinnedBottomRowCount - 1,\r\n rowPinned: Constants.PINNED_BOTTOM\r\n };\r\n }\r\n\r\n return {\r\n rowIndex: this.rowModel.getRowCount() - 1,\r\n rowPinned: null\r\n };\r\n }\r\n\r\n setRangeToCell(cell, appendRange = false) {\r\n const columns = this.calculateColumnsBetween(cell.column, cell.column);\r\n if (!columns) {\r\n return;\r\n }\r\n this.removeAllCellRanges(true);\r\n const rowForCell = {\r\n rowIndex: cell.rowIndex,\r\n rowPinned: cell.rowPinned\r\n };\r\n\r\n // if there is already a range for this cell, then we reuse the same range, otherwise the user\r\n // can ctrl & click a cell many times and hit ctrl+c, which would result in the cell getting copied\r\n // many times to the clipboard.\r\n let cellRange;\r\n for (let i = 0; i < this.cellRanges.length; i++) {\r\n const range = this.cellRanges[i];\r\n const matches =\r\n // check cols are same\r\n (range.columns && range.columns.length === 1 && range.columns[0] === cell.column) &&\r\n // check rows are same\r\n this.rowPositionUtils.sameRow(rowForCell, range.startRow) &&\r\n this.rowPositionUtils.sameRow(rowForCell, range.endRow);\r\n if (matches) {\r\n cellRange = range;\r\n break;\r\n }\r\n }\r\n\r\n if (cellRange) {\r\n // we need it at the end of the list, as the dragStart picks the last created\r\n // range as the start point for the drag\r\n const atEndOfList = _.last(this.cellRanges) === cellRange;\r\n\r\n if (!atEndOfList) {\r\n _.removeFromArray(this.cellRanges, cellRange);\r\n this.cellRanges.push(cellRange);\r\n }\r\n } else {\r\n cellRange = {\r\n startRow: rowForCell,\r\n endRow: rowForCell,\r\n columns: columns,\r\n startColumn: cell.column\r\n };\r\n this.cellRanges.push(newRange);\r\n }\r\n\r\n this.newestRangeStartCell = cell;\r\n this.onDragStop();\r\n this.dispatchChangedEvent(true, true, cellRange.id);\r\n }\r\n\r\n extendLatestRangeToCell(cellPosition) {\r\n if (this.isEmpty() || !this.newestRangeStartCell) {\r\n return;\r\n }\r\n const cellRange = _.last(this.cellRanges);\r\n\r\n this.updateRangeEnd(cellRange, cellPosition);\r\n }\r\n\r\n updateRangeEnd(cellRange, cellPosition, silent) {\r\n silent = !!silent;\r\n const endColumn = cellPosition.column;\r\n const colsToAdd = this.calculateColumnsBetween(cellRange.startColumn, endColumn);\r\n if (!colsToAdd || this.isLastCellOfRange(cellRange, cellPosition)) {\r\n return;\r\n }\r\n\r\n cellRange.columns = colsToAdd;\r\n cellRange.endRow = {rowIndex: cellPosition.rowIndex, rowPinned: cellPosition.rowPinned};\r\n\r\n if (!silent) {\r\n this.dispatchChangedEvent(true, true, cellRange.id);\r\n }\r\n }\r\n\r\n refreshRangeStart(cellRange) {\r\n const {startColumn, columns} = cellRange;\r\n\r\n const moveColInCellRange = (colToMove, moveToFront) => {\r\n const otherCols = cellRange.columns.filter(col => col !== colToMove);\r\n if (colToMove) {\r\n cellRange.startColumn = colToMove;\r\n cellRange.columns = moveToFront ? [colToMove, ...otherCols] : [...otherCols, colToMove];\r\n } else {\r\n cellRange.columns = otherCols;\r\n }\r\n };\r\n\r\n const {left, right} = this.getRangeEdgeColumns(cellRange);\r\n const shouldMoveLeftCol = startColumn === columns[0] && startColumn !== left;\r\n if (shouldMoveLeftCol) {\r\n moveColInCellRange(left, true);\r\n return;\r\n }\r\n const shouldMoveRightCol = startColumn === _.last(columns) && startColumn === right;\r\n if (shouldMoveRightCol) {\r\n moveColInCellRange(right, false);\r\n return;\r\n }\r\n }\r\n\r\n getRangeEdgeColumns(cellRange) {\r\n const allColumns = this.columnModel.getAllDisplayedColumns();\r\n const allIndices = cellRange.columns\r\n .map(c => allColumns.indexOf(c))\r\n .filter(i => i > -1)\r\n .sort((a, b) => a - b);\r\n\r\n return {\r\n left: allColumns[allIndices[0]],\r\n right: allColumns[_.last(allIndices)]\r\n };\r\n }\r\n\r\n // returns true if successful, false if not successful\r\n extendLatestRangeInDirection(key) {\r\n if (this.isEmpty() || !this.newestRangeStartCell) {\r\n return;\r\n }\r\n\r\n const lastRange = _.last(this.cellRanges);\r\n\r\n const startCell = this.newestRangeStartCell;\r\n\r\n const firstCol = lastRange.columns[0];\r\n const lastCol = _.last(lastRange.columns);\r\n\r\n // find the cell that is at the furthest away corner from the starting cell\r\n const endCellIndex = lastRange.endRow.rowIndex;\r\n const endCellFloating = lastRange.endRow.rowPinned;\r\n const endCellColumn = startCell.column === firstCol ? lastCol : firstCol;\r\n\r\n const endCell = {column: endCellColumn, rowIndex: endCellIndex, rowPinned: endCellFloating};\r\n const newEndCell = this.cellNavigationService.getNextCellToFocus(key, endCell);\r\n\r\n // if user is at end of grid, so no cell to extend to, we return false\r\n if (!newEndCell) {\r\n return;\r\n }\r\n\r\n this.setCellRange({\r\n rowStartIndex: startCell.rowIndex,\r\n rowStartPinned: startCell.rowPinned,\r\n rowEndIndex: newEndCell.rowIndex,\r\n rowEndPinned: newEndCell.rowPinned,\r\n columnStart: startCell.column,\r\n columnEnd: newEndCell.column\r\n });\r\n\r\n return newEndCell;\r\n }\r\n\r\n setCellRange(params) {\r\n this.removeAllCellRanges(true);\r\n this.addCellRange(params);\r\n }\r\n\r\n setCellRanges(cellRanges) {\r\n if (_.shallowCompare(this.cellRanges, cellRanges)) {\r\n return;\r\n }\r\n this.removeAllCellRanges(true);\r\n\r\n cellRanges.forEach(newRange => {\r\n if (newRange.columns && newRange.startRow) {\r\n this.newestRangeStartCell = {\r\n rowIndex: newRange.startRow.rowIndex,\r\n rowPinned: newRange.startRow.rowPinned,\r\n column: newRange.columns[0]\r\n };\r\n }\r\n this.cellRanges.push(newRange);\r\n });\r\n\r\n this.dispatchChangedEvent(false, true);\r\n }\r\n\r\n createCellRangeFromCellRangeParams(params) {\r\n let columns;\r\n if (params.columns) {\r\n columns = params.columns.map(c => this.columnModel.getColumnWithValidation(c)).filter(c => c);\r\n } else {\r\n const columnStart = this.columnModel.getColumnWithValidation(params.columnStart);\r\n const columnEnd = this.columnModel.getColumnWithValidation(params.columnEnd);\r\n if (!columnStart || !columnEnd) {\r\n return;\r\n }\r\n columns = this.calculateColumnsBetween(columnStart, columnEnd);\r\n }\r\n\r\n if (!columns) {\r\n return;\r\n }\r\n\r\n const startRow = params.rowStartIndex != null ? {\r\n rowIndex: params.rowStartIndex,\r\n rowPinned: params.rowStartPinned\r\n } : undefined;\r\n\r\n const endRow = params.rowEndIndex != null ? {\r\n rowIndex: params.rowEndIndex,\r\n rowPinned: params.rowEndPinned\r\n } : undefined;\r\n\r\n return {\r\n startRow: startRow,\r\n endRow: endRow,\r\n columns: columns,\r\n startColumn: columns[0]\r\n };\r\n }\r\n\r\n addCellRange(params) {\r\n const newRange = this.createCellRangeFromCellRangeParams(params);\r\n if (newRange) {\r\n this.cellRanges.push(newRange);\r\n this.dispatchChangedEvent(false, true, newRange.id);\r\n }\r\n }\r\n\r\n getCellRanges() {\r\n return this.cellRanges;\r\n }\r\n\r\n isEmpty() {\r\n return this.cellRanges.length === 0;\r\n }\r\n\r\n isMoreThanOneCell() {\r\n if (this.cellRanges.length === 0) {\r\n // no ranges, so not more than one cell\r\n return false;\r\n } else if (this.cellRanges.length > 1) {\r\n // many ranges, so more than one cell\r\n return true;\r\n }\r\n\r\n // only one range, return true if range has more than one\r\n const range = this.cellRanges[0];\r\n const startRow = this.getRangeStartRow(range);\r\n const endRow = this.getRangeEndRow(range);\r\n return startRow.rowPinned !== endRow.rowPinned ||\r\n startRow.rowIndex !== endRow.rowIndex ||\r\n range.columns.length !== 1;\r\n }\r\n\r\n removeAllCellRanges(silent) {\r\n if (this.isEmpty()) {\r\n return;\r\n }\r\n\r\n this.onDragStop();\r\n this.cellRanges.length = 0;\r\n\r\n if (!silent) {\r\n this.dispatchChangedEvent(false, true);\r\n }\r\n }\r\n\r\n// as the user is dragging outside of the panel, the div starts to scroll, which in turn\r\n// means we are selection more (or less) cells, but the mouse isn't moving, so we recalculate\r\n// the selection my mimicking a new mouse event\r\n onBodyScroll() {\r\n this.onDragging(this.lastMouseEvent);\r\n }\r\n\r\n isCellInAnyRange(cell) {\r\n return this.getCellRangeCount(cell) > 0;\r\n }\r\n\r\n isCellInSpecificRange(cell, range) {\r\n const columnInRange = range.columns !== null && _.includes(range.columns, cell.column);\r\n const rowInRange = this.isRowInRange(cell.rowIndex, cell.rowPinned, range);\r\n return columnInRange && rowInRange;\r\n }\r\n\r\n isLastCellOfRange(cellRange, cell) {\r\n const {startRow, endRow} = cellRange;\r\n const lastRow = this.rowPositionUtils.before(startRow, endRow) ? endRow : startRow;\r\n const isLastRow = cell.rowIndex === lastRow.rowIndex && cell.rowPinned === lastRow.rowPinned;\r\n const rangeFirstIndexColumn = cellRange.columns[0];\r\n const rangeLastIndexColumn = _.last(cellRange.columns);\r\n const lastRangeColumn = cellRange.startColumn === rangeFirstIndexColumn ? rangeLastIndexColumn : rangeFirstIndexColumn;\r\n const isLastColumn = cell.column === lastRangeColumn;\r\n return isLastColumn && isLastRow;\r\n }\r\n\r\n isBottomRightCell(cellRange, cell) {\r\n const allColumns = this.columnModel.getAllDisplayedColumns();\r\n const allPositions = cellRange.columns.map(c => allColumns.indexOf(c)).sort((a, b) => a - b);\r\n const {startRow, endRow} = cellRange;\r\n const lastRow = this.rowPositionUtils.before(startRow, endRow) ? endRow : startRow;\r\n\r\n const isRightColumn = allColumns.indexOf(cell.column) === _.last(allPositions);\r\n const isLastRow = cell.rowIndex === lastRow.rowIndex && _.makeNull(cell.rowPinned) === _.makeNull(lastRow.rowPinned);\r\n\r\n return isRightColumn && isLastRow;\r\n }\r\n\r\n// returns the number of ranges this cell is in\r\n getCellRangeCount(cell) {\r\n if (this.isEmpty()) {\r\n return 0;\r\n }\r\n return this.cellRanges.filter(cellRange => this.isCellInSpecificRange(cell, cellRange)).length;\r\n }\r\n\r\n isRowInRange(rowIndex, floating, cellRange) {\r\n\r\n const firstRow = this.getRangeStartRow(cellRange);\r\n const lastRow = this.getRangeEndRow(cellRange);\r\n\r\n const thisRow = {rowIndex: rowIndex, rowPinned: floating};\r\n\r\n // compare rowPinned with == instead of === because it can be `null` or `undefined`\r\n const equalsFirstRow = thisRow.rowIndex === firstRow.rowIndex && thisRow.rowPinned == firstRow.rowPinned;\r\n const equalsLastRow = thisRow.rowIndex === lastRow.rowIndex && thisRow.rowPinned == lastRow.rowPinned;\r\n\r\n if (equalsFirstRow || equalsLastRow) {\r\n return true;\r\n }\r\n\r\n const afterFirstRow = !this.rowPositionUtils.before(thisRow, firstRow);\r\n const beforeLastRow = this.rowPositionUtils.before(thisRow, lastRow);\r\n return afterFirstRow && beforeLastRow;\r\n }\r\n\r\n getDraggingRange() {\r\n return this.draggingRange;\r\n }\r\n\r\n onDragStart(mouseEvent) {\r\n const {shiftKey} = mouseEvent;\r\n const mouseCell = this.mouseEventService.getCellPositionForEvent(mouseEvent);\r\n if (_.missing(mouseCell)) {\r\n // if drag wasn't on cell, then do nothing, including do not set dragging=true,\r\n // (which them means onDragging and onDragStop do nothing)\r\n return;\r\n }\r\n\r\n if (!shiftKey || _.exists(_.last(this.cellRanges).type)) {\r\n this.removeAllCellRanges(true);\r\n }\r\n\r\n this.dragging = true;\r\n this.draggingCell = mouseCell;\r\n this.lastMouseEvent = mouseEvent;\r\n\r\n if (!shiftKey) {\r\n this.newestRangeStartCell = mouseCell;\r\n }\r\n\r\n // if we didn't clear the ranges, then dragging means the user clicked, and when the\r\n // user clicks it means a range of one cell was created. we need to extend this range\r\n // rather than creating another range. otherwise we end up with two distinct ranges\r\n // from a drag operation (one from click, and one from drag).\r\n if (this.cellRanges.length > 0) {\r\n this.draggingRange = _.last(this.cellRanges);\r\n } else {\r\n const mouseRowPosition = {\r\n rowIndex: mouseCell.rowIndex,\r\n rowPinned: mouseCell.rowPinned\r\n };\r\n\r\n this.draggingRange = {\r\n startRow: mouseRowPosition,\r\n endRow: mouseRowPosition,\r\n columns: [mouseCell.column],\r\n startColumn: this.newestRangeStartCell.column\r\n };\r\n this.cellRanges.push(this.draggingRange);\r\n }\r\n\r\n this.ctrlsService.getGridBodyCtrl().addScrollEventListener(this.bodyScrollListener);\r\n\r\n this.dispatchChangedEvent(true, false, this.draggingRange.id);\r\n }\r\n\r\n onDragging(mouseEvent) {\r\n if (!this.dragging || !mouseEvent) {\r\n return;\r\n }\r\n this.lastMouseEvent = mouseEvent;\r\n\r\n const cellPosition = this.mouseEventService.getCellPositionForEvent(mouseEvent);\r\n\r\n const isMouseAndStartInPinned = (position) =>\r\n cellPosition && cellPosition.rowPinned === position && this.newestRangeStartCell.rowPinned === position;\r\n\r\n const skipVerticalScroll = isMouseAndStartInPinned('top') || isMouseAndStartInPinned('bottom');\r\n\r\n this.autoScrollService.check(mouseEvent, skipVerticalScroll);\r\n\r\n if (\r\n !cellPosition ||\r\n !this.draggingCell ||\r\n this.cellPositionEquals(this.draggingCell, cellPosition)\r\n ) {\r\n return;\r\n }\r\n\r\n const columns = this.calculateColumnsBetween(this.newestRangeStartCell.column, cellPosition.column);\r\n\r\n if (!columns) {\r\n return;\r\n }\r\n\r\n this.draggingCell = cellPosition;\r\n\r\n this.draggingRange.endRow = {\r\n rowIndex: cellPosition.rowIndex,\r\n rowPinned: cellPosition.rowPinned\r\n };\r\n this.draggingRange.columns = columns;\r\n\r\n this.dispatchChangedEvent(false, false, this.draggingRange.id);\r\n this.focusCell(cellPosition);\r\n }\r\n\r\n focusCell(cellPosition) {\r\n const cellFocused = this.focusService.isCellFocused(cellPosition);\r\n if (!cellFocused) {\r\n this.focusService.setFocusedCell(cellPosition.rowIndex, cellPosition.column, cellPosition.rowPinned, true);\r\n }\r\n }\r\n\r\n onDragStop() {\r\n if (!this.dragging) {\r\n return;\r\n }\r\n const {id} = this.draggingRange;\r\n this.autoScrollService.ensureCleared();\r\n\r\n this.ctrlsService.getGridBodyCtrl().removeScrollEventListener(this.bodyScrollListener);\r\n this.lastMouseEvent = null;\r\n this.dragging = false;\r\n this.draggingRange = undefined;\r\n this.draggingCell = undefined;\r\n\r\n this.dispatchChangedEvent(false, true, id);\r\n }\r\n\r\n dispatchChangedEvent(started, finished, id) {\r\n this.cellRanges.map((cellRange) => {\r\n let currentRow = this.getRangeStartRow(cellRange);\r\n const lastRow = this.getRangeEndRow(cellRange);\r\n const nodesToBeSelected = [];\r\n while (true) {\r\n const finishedAllRows = _.missing(currentRow) || !currentRow || this.rowPositionUtils.before(lastRow, currentRow);\r\n if (finishedAllRows || !currentRow || !cellRange.columns) {\r\n break;\r\n }\r\n const rowNode = this.rowRenderer.getRowNode(currentRow);\r\n if (!rowNode.isSelected()) {\r\n rowNode.setSelected(true);\r\n }\r\n nodesToBeSelected.push(rowNode.data);\r\n currentRow = this.cellNavigationService.getRowBelow(currentRow);\r\n }\r\n this.gridApi.getSelectedNodes().forEach((node) => {\r\n if (!nodesToBeSelected.some(nodeToBeSelected => node.data === nodeToBeSelected)) {\r\n node.setSelected(false);\r\n }\r\n });\r\n });\r\n const event = Object.freeze({\r\n type: Events.EVENT_RANGE_SELECTION_CHANGED,\r\n api: this.gridApi,\r\n columnApi: this.columnApi,\r\n started: started,\r\n finished: finished,\r\n id: id,\r\n });\r\n this.eventService.dispatchEvent(event);\r\n }\r\n\r\n calculateColumnsBetween(columnFrom, columnTo) {\r\n const allColumns = this.columnModel.getAllDisplayedColumns();\r\n const isSameColumn = columnFrom === columnTo;\r\n const fromIndex = allColumns.indexOf(columnFrom);\r\n\r\n if (fromIndex < 0) {\r\n console.warn(`ag-Grid: column ${columnFrom.getId()} is not visible`);\r\n return undefined;\r\n }\r\n\r\n const toIndex = isSameColumn ? fromIndex : allColumns.indexOf(columnTo);\r\n\r\n if (toIndex < 0) {\r\n console.warn(`ag-Grid: column ${columnTo.getId()} is not visible`);\r\n return undefined;\r\n }\r\n\r\n if (isSameColumn) {\r\n return [columnFrom];\r\n }\r\n\r\n const firstIndex = Math.min(fromIndex, toIndex);\r\n const lastIndex = firstIndex === fromIndex ? toIndex : fromIndex;\r\n\r\n const columns = [];\r\n\r\n for (let i = firstIndex; i <= lastIndex; i++) {\r\n columns.push(allColumns[i]);\r\n }\r\n\r\n return columns;\r\n }\r\n}"]}
|
|
1
|
+
{"version":3,"file":"rangeSelector.js","sourceRoot":"","sources":["../../../../../components/grid/cell/rangeSelector.js"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAE,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AED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ","sourcesContent":["import {_, AutoScrollService, Constants, Events} from \"ag-grid-community\";\nimport React from \"react\";\n\nexport class RangeSelector {\n constructor(wrappingDiv) {\n this.wrappingDiv = wrappingDiv;\n }\n\n init(gridApi, gridColumnApi) {\n this.rowModel = gridApi.rowModel;\n this.mouseEventService = gridApi.navigationService.mouseEventService;\n this.columnApi = gridColumnApi;\n this.columnModel = gridColumnApi.columnModel;\n this.gridApi = gridApi;\n this.cellNavigationService = gridApi.navigationService.cellNavigationService;\n this.pinnedRowModel = gridApi.pinnedRowModel;\n this.rowPositionUtils = gridApi.menuFactory.focusService.rowPositionUtils;\n this.rowRenderer = gridApi.rowRenderer;\n this.eventService = gridApi.eventService;\n this.gridOptionsWrapper = gridApi.gridOptionsWrapper;\n this.focusService = gridApi.focusService;\n this.cellPositionUtils = gridApi.cellPositionUtils;\n this.ctrlsService = gridApi.menuFactory.focusService.headerNavigationService.headerPositionUtils.ctrlsService;\n\n this.cellRanges = [];\n this.bodyScrollListener = this.onBodyScroll.bind(this);\n this.dragging = false;\n\n this.eventService.addEventListener(Events.EVENT_NEW_COLUMNS_LOADED, () => this.removeAllCellRanges());\n this.eventService.addEventListener(Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, () => this.removeAllCellRanges());\n this.eventService.addEventListener(Events.EVENT_COLUMN_ROW_GROUP_CHANGED, () => this.removeAllCellRanges());\n this.eventService.addEventListener(Events.EVENT_COLUMN_PIVOT_CHANGED, () => this.removeAllCellRanges());\n this.eventService.addEventListener(Events.EVENT_COLUMN_GROUP_OPENED, this.refreshLastRangeStart.bind(this));\n this.eventService.addEventListener(Events.EVENT_COLUMN_MOVED, this.refreshLastRangeStart.bind(this));\n this.eventService.addEventListener(Events.EVENT_COLUMN_PINNED, this.refreshLastRangeStart.bind(this));\n this.eventService.addEventListener(Events.EVENT_COLUMN_VISIBLE, this.onColumnVisibleChange.bind(this));\n\n this.gridPanel = gridApi.gridPanel;\n\n this.ctrlsService.whenReady(() => {\n const gridBodyCon = this.ctrlsService.getGridBodyCtrl();\n this.autoScrollService = new AutoScrollService({\n scrollContainer: gridBodyCon.getBodyViewportElement(),\n scrollAxis: 'xy',\n getVerticalPosition: () => gridBodyCon.getScrollFeature().getVScrollPosition().top,\n setVerticalPosition: (position) => gridBodyCon.getScrollFeature().setVerticalScrollPosition(position),\n getHorizontalPosition: () => gridBodyCon.getScrollFeature().getHScrollPosition().left,\n setHorizontalPosition: (position) => gridBodyCon.getScrollFeature().setHorizontalScrollPosition(position),\n shouldSkipVerticalScroll: () => this.gridOptionsWrapper.getDomLayout() !== Constants.DOM_LAYOUT_NORMAL,\n shouldSkipHorizontalScroll: () => gridBodyCon.getScrollFeature().isHorizontalScrollShowing()\n });\n });\n\n //intitialization of drag event handling\n this.dragService = this.gridApi.dragAndDropService.dragService;\n const eContainers = this.wrappingDiv.querySelectorAll(`[ref=\"eContainer\"]`);\n for (const eContainer of eContainers) {\n const params = {\n eElement: eContainer,\n onDragStart: this.onDragStart.bind(this),\n onDragStop: this.onDragStop.bind(this),\n onDragging: this.onDragging.bind(this)\n };\n\n this.dragService.addDragSource(params);\n this.dragService.addDestroyFunc(() => this.dragService.removeDragSource(params));\n }\n }\n\n cellPositionEquals(cellA, cellB) {\n const colsMatch = cellA.column === cellB.column;\n const floatingMatch = cellA.rowPinned === cellB.rowPinned;\n const indexMatch = cellA.rowIndex === cellB.rowIndex;\n return colsMatch && floatingMatch && indexMatch;\n }\n\n onColumnVisibleChange() {\n // first move start column in last cell range (i.e. series chart range)\n this.refreshLastRangeStart();\n\n // then check if the column visibility has changed in any cell range\n this.cellRanges.forEach(cellRange => {\n const beforeCols = cellRange.columns;\n\n // remove hidden cols from cell range\n cellRange.columns = cellRange.columns.filter(col => col.isVisible());\n\n const colsInRangeChanged = !_.areEqual(beforeCols, cellRange.columns);\n if (colsInRangeChanged) {\n this.dispatchChangedEvent(false, true, cellRange.id);\n }\n });\n }\n\n refreshLastRangeStart() {\n const lastRange = _.last(this.cellRanges);\n if (!lastRange) {\n return;\n }\n\n this.refreshRangeStart(lastRange);\n }\n\n isContiguousRange(cellRange) {\n const rangeColumns = cellRange.columns;\n\n if (!rangeColumns.length) {\n return false;\n }\n\n const allColumns = this.columnModel.getAllDisplayedColumns();\n const allPositions = rangeColumns.map(c => allColumns.indexOf(c)).sort((a, b) => a - b);\n\n return _.last(allPositions) - allPositions[0] + 1 === rangeColumns.length;\n }\n\n getRangeStartRow(cellRange) {\n if (cellRange.startRow && cellRange.endRow) {\n return this.rowPositionUtils.before(cellRange.startRow, cellRange.endRow) ?\n cellRange.startRow : cellRange.endRow;\n }\n const rowPinned = this.pinnedRowModel.getPinnedTopRowCount() > 0 ? Constants.PINNED_TOP : null;\n return {rowIndex: 0, rowPinned};\n }\n\n getRangeEndRow(cellRange) {\n if (cellRange.startRow && cellRange.endRow) {\n return this.rowPositionUtils.before(cellRange.startRow, cellRange.endRow) ?\n cellRange.endRow : cellRange.startRow;\n }\n\n const pinnedBottomRowCount = this.pinnedRowModel.getPinnedBottomRowCount();\n const pinnedBottom = pinnedBottomRowCount > 0;\n\n if (pinnedBottom) {\n return {\n rowIndex: pinnedBottomRowCount - 1,\n rowPinned: Constants.PINNED_BOTTOM\n };\n }\n\n return {\n rowIndex: this.rowModel.getRowCount() - 1,\n rowPinned: null\n };\n }\n\n setRangeToCell(cell, appendRange = false) {\n const columns = this.calculateColumnsBetween(cell.column, cell.column);\n if (!columns) {\n return;\n }\n this.removeAllCellRanges(true);\n const rowForCell = {\n rowIndex: cell.rowIndex,\n rowPinned: cell.rowPinned\n };\n\n // if there is already a range for this cell, then we reuse the same range, otherwise the user\n // can ctrl & click a cell many times and hit ctrl+c, which would result in the cell getting copied\n // many times to the clipboard.\n let cellRange;\n for (let i = 0; i < this.cellRanges.length; i++) {\n const range = this.cellRanges[i];\n const matches =\n // check cols are same\n (range.columns && range.columns.length === 1 && range.columns[0] === cell.column) &&\n // check rows are same\n this.rowPositionUtils.sameRow(rowForCell, range.startRow) &&\n this.rowPositionUtils.sameRow(rowForCell, range.endRow);\n if (matches) {\n cellRange = range;\n break;\n }\n }\n\n if (cellRange) {\n // we need it at the end of the list, as the dragStart picks the last created\n // range as the start point for the drag\n const atEndOfList = _.last(this.cellRanges) === cellRange;\n\n if (!atEndOfList) {\n _.removeFromArray(this.cellRanges, cellRange);\n this.cellRanges.push(cellRange);\n }\n } else {\n cellRange = {\n startRow: rowForCell,\n endRow: rowForCell,\n columns: columns,\n startColumn: cell.column\n };\n this.cellRanges.push(newRange);\n }\n\n this.newestRangeStartCell = cell;\n this.onDragStop();\n this.dispatchChangedEvent(true, true, cellRange.id);\n }\n\n extendLatestRangeToCell(cellPosition) {\n if (this.isEmpty() || !this.newestRangeStartCell) {\n return;\n }\n const cellRange = _.last(this.cellRanges);\n\n this.updateRangeEnd(cellRange, cellPosition);\n }\n\n updateRangeEnd(cellRange, cellPosition, silent) {\n silent = !!silent;\n const endColumn = cellPosition.column;\n const colsToAdd = this.calculateColumnsBetween(cellRange.startColumn, endColumn);\n if (!colsToAdd || this.isLastCellOfRange(cellRange, cellPosition)) {\n return;\n }\n\n cellRange.columns = colsToAdd;\n cellRange.endRow = {rowIndex: cellPosition.rowIndex, rowPinned: cellPosition.rowPinned};\n\n if (!silent) {\n this.dispatchChangedEvent(true, true, cellRange.id);\n }\n }\n\n refreshRangeStart(cellRange) {\n const {startColumn, columns} = cellRange;\n\n const moveColInCellRange = (colToMove, moveToFront) => {\n const otherCols = cellRange.columns.filter(col => col !== colToMove);\n if (colToMove) {\n cellRange.startColumn = colToMove;\n cellRange.columns = moveToFront ? [colToMove, ...otherCols] : [...otherCols, colToMove];\n } else {\n cellRange.columns = otherCols;\n }\n };\n\n const {left, right} = this.getRangeEdgeColumns(cellRange);\n const shouldMoveLeftCol = startColumn === columns[0] && startColumn !== left;\n if (shouldMoveLeftCol) {\n moveColInCellRange(left, true);\n return;\n }\n const shouldMoveRightCol = startColumn === _.last(columns) && startColumn === right;\n if (shouldMoveRightCol) {\n moveColInCellRange(right, false);\n return;\n }\n }\n\n getRangeEdgeColumns(cellRange) {\n const allColumns = this.columnModel.getAllDisplayedColumns();\n const allIndices = cellRange.columns\n .map(c => allColumns.indexOf(c))\n .filter(i => i > -1)\n .sort((a, b) => a - b);\n\n return {\n left: allColumns[allIndices[0]],\n right: allColumns[_.last(allIndices)]\n };\n }\n\n // returns true if successful, false if not successful\n extendLatestRangeInDirection(key) {\n if (this.isEmpty() || !this.newestRangeStartCell) {\n return;\n }\n\n const lastRange = _.last(this.cellRanges);\n\n const startCell = this.newestRangeStartCell;\n\n const firstCol = lastRange.columns[0];\n const lastCol = _.last(lastRange.columns);\n\n // find the cell that is at the furthest away corner from the starting cell\n const endCellIndex = lastRange.endRow.rowIndex;\n const endCellFloating = lastRange.endRow.rowPinned;\n const endCellColumn = startCell.column === firstCol ? lastCol : firstCol;\n\n const endCell = {column: endCellColumn, rowIndex: endCellIndex, rowPinned: endCellFloating};\n const newEndCell = this.cellNavigationService.getNextCellToFocus(key, endCell);\n\n // if user is at end of grid, so no cell to extend to, we return false\n if (!newEndCell) {\n return;\n }\n\n this.setCellRange({\n rowStartIndex: startCell.rowIndex,\n rowStartPinned: startCell.rowPinned,\n rowEndIndex: newEndCell.rowIndex,\n rowEndPinned: newEndCell.rowPinned,\n columnStart: startCell.column,\n columnEnd: newEndCell.column\n });\n\n return newEndCell;\n }\n\n setCellRange(params) {\n this.removeAllCellRanges(true);\n this.addCellRange(params);\n }\n\n setCellRanges(cellRanges) {\n if (_.shallowCompare(this.cellRanges, cellRanges)) {\n return;\n }\n this.removeAllCellRanges(true);\n\n cellRanges.forEach(newRange => {\n if (newRange.columns && newRange.startRow) {\n this.newestRangeStartCell = {\n rowIndex: newRange.startRow.rowIndex,\n rowPinned: newRange.startRow.rowPinned,\n column: newRange.columns[0]\n };\n }\n this.cellRanges.push(newRange);\n });\n\n this.dispatchChangedEvent(false, true);\n }\n\n createCellRangeFromCellRangeParams(params) {\n let columns;\n if (params.columns) {\n columns = params.columns.map(c => this.columnModel.getColumnWithValidation(c)).filter(c => c);\n } else {\n const columnStart = this.columnModel.getColumnWithValidation(params.columnStart);\n const columnEnd = this.columnModel.getColumnWithValidation(params.columnEnd);\n if (!columnStart || !columnEnd) {\n return;\n }\n columns = this.calculateColumnsBetween(columnStart, columnEnd);\n }\n\n if (!columns) {\n return;\n }\n\n const startRow = params.rowStartIndex != null ? {\n rowIndex: params.rowStartIndex,\n rowPinned: params.rowStartPinned\n } : undefined;\n\n const endRow = params.rowEndIndex != null ? {\n rowIndex: params.rowEndIndex,\n rowPinned: params.rowEndPinned\n } : undefined;\n\n return {\n startRow: startRow,\n endRow: endRow,\n columns: columns,\n startColumn: columns[0]\n };\n }\n\n addCellRange(params) {\n const newRange = this.createCellRangeFromCellRangeParams(params);\n if (newRange) {\n this.cellRanges.push(newRange);\n this.dispatchChangedEvent(false, true, newRange.id);\n }\n }\n\n getCellRanges() {\n return this.cellRanges;\n }\n\n isEmpty() {\n return this.cellRanges.length === 0;\n }\n\n isMoreThanOneCell() {\n if (this.cellRanges.length === 0) {\n // no ranges, so not more than one cell\n return false;\n } else if (this.cellRanges.length > 1) {\n // many ranges, so more than one cell\n return true;\n }\n\n // only one range, return true if range has more than one\n const range = this.cellRanges[0];\n const startRow = this.getRangeStartRow(range);\n const endRow = this.getRangeEndRow(range);\n return startRow.rowPinned !== endRow.rowPinned ||\n startRow.rowIndex !== endRow.rowIndex ||\n range.columns.length !== 1;\n }\n\n removeAllCellRanges(silent) {\n if (this.isEmpty()) {\n return;\n }\n\n this.onDragStop();\n this.cellRanges.length = 0;\n\n if (!silent) {\n this.dispatchChangedEvent(false, true);\n }\n }\n\n// as the user is dragging outside of the panel, the div starts to scroll, which in turn\n// means we are selection more (or less) cells, but the mouse isn't moving, so we recalculate\n// the selection my mimicking a new mouse event\n onBodyScroll() {\n this.onDragging(this.lastMouseEvent);\n }\n\n isCellInAnyRange(cell) {\n return this.getCellRangeCount(cell) > 0;\n }\n\n isCellInSpecificRange(cell, range) {\n const columnInRange = range.columns !== null && _.includes(range.columns, cell.column);\n const rowInRange = this.isRowInRange(cell.rowIndex, cell.rowPinned, range);\n return columnInRange && rowInRange;\n }\n\n isLastCellOfRange(cellRange, cell) {\n const {startRow, endRow} = cellRange;\n const lastRow = this.rowPositionUtils.before(startRow, endRow) ? endRow : startRow;\n const isLastRow = cell.rowIndex === lastRow.rowIndex && cell.rowPinned === lastRow.rowPinned;\n const rangeFirstIndexColumn = cellRange.columns[0];\n const rangeLastIndexColumn = _.last(cellRange.columns);\n const lastRangeColumn = cellRange.startColumn === rangeFirstIndexColumn ? rangeLastIndexColumn : rangeFirstIndexColumn;\n const isLastColumn = cell.column === lastRangeColumn;\n return isLastColumn && isLastRow;\n }\n\n isBottomRightCell(cellRange, cell) {\n const allColumns = this.columnModel.getAllDisplayedColumns();\n const allPositions = cellRange.columns.map(c => allColumns.indexOf(c)).sort((a, b) => a - b);\n const {startRow, endRow} = cellRange;\n const lastRow = this.rowPositionUtils.before(startRow, endRow) ? endRow : startRow;\n\n const isRightColumn = allColumns.indexOf(cell.column) === _.last(allPositions);\n const isLastRow = cell.rowIndex === lastRow.rowIndex && _.makeNull(cell.rowPinned) === _.makeNull(lastRow.rowPinned);\n\n return isRightColumn && isLastRow;\n }\n\n// returns the number of ranges this cell is in\n getCellRangeCount(cell) {\n if (this.isEmpty()) {\n return 0;\n }\n return this.cellRanges.filter(cellRange => this.isCellInSpecificRange(cell, cellRange)).length;\n }\n\n isRowInRange(rowIndex, floating, cellRange) {\n\n const firstRow = this.getRangeStartRow(cellRange);\n const lastRow = this.getRangeEndRow(cellRange);\n\n const thisRow = {rowIndex: rowIndex, rowPinned: floating};\n\n // compare rowPinned with == instead of === because it can be `null` or `undefined`\n const equalsFirstRow = thisRow.rowIndex === firstRow.rowIndex && thisRow.rowPinned == firstRow.rowPinned;\n const equalsLastRow = thisRow.rowIndex === lastRow.rowIndex && thisRow.rowPinned == lastRow.rowPinned;\n\n if (equalsFirstRow || equalsLastRow) {\n return true;\n }\n\n const afterFirstRow = !this.rowPositionUtils.before(thisRow, firstRow);\n const beforeLastRow = this.rowPositionUtils.before(thisRow, lastRow);\n return afterFirstRow && beforeLastRow;\n }\n\n getDraggingRange() {\n return this.draggingRange;\n }\n\n onDragStart(mouseEvent) {\n const {shiftKey} = mouseEvent;\n const mouseCell = this.mouseEventService.getCellPositionForEvent(mouseEvent);\n if (_.missing(mouseCell)) {\n // if drag wasn't on cell, then do nothing, including do not set dragging=true,\n // (which them means onDragging and onDragStop do nothing)\n return;\n }\n\n if (!shiftKey || _.exists(_.last(this.cellRanges).type)) {\n this.removeAllCellRanges(true);\n }\n\n this.dragging = true;\n this.draggingCell = mouseCell;\n this.lastMouseEvent = mouseEvent;\n\n if (!shiftKey) {\n this.newestRangeStartCell = mouseCell;\n }\n\n // if we didn't clear the ranges, then dragging means the user clicked, and when the\n // user clicks it means a range of one cell was created. we need to extend this range\n // rather than creating another range. otherwise we end up with two distinct ranges\n // from a drag operation (one from click, and one from drag).\n if (this.cellRanges.length > 0) {\n this.draggingRange = _.last(this.cellRanges);\n } else {\n const mouseRowPosition = {\n rowIndex: mouseCell.rowIndex,\n rowPinned: mouseCell.rowPinned\n };\n\n this.draggingRange = {\n startRow: mouseRowPosition,\n endRow: mouseRowPosition,\n columns: [mouseCell.column],\n startColumn: this.newestRangeStartCell.column\n };\n this.cellRanges.push(this.draggingRange);\n }\n\n this.ctrlsService.getGridBodyCtrl().addScrollEventListener(this.bodyScrollListener);\n\n this.dispatchChangedEvent(true, false, this.draggingRange.id);\n }\n\n onDragging(mouseEvent) {\n if (!this.dragging || !mouseEvent) {\n return;\n }\n this.lastMouseEvent = mouseEvent;\n\n const cellPosition = this.mouseEventService.getCellPositionForEvent(mouseEvent);\n\n const isMouseAndStartInPinned = (position) =>\n cellPosition && cellPosition.rowPinned === position && this.newestRangeStartCell.rowPinned === position;\n\n const skipVerticalScroll = isMouseAndStartInPinned('top') || isMouseAndStartInPinned('bottom');\n\n this.autoScrollService.check(mouseEvent, skipVerticalScroll);\n\n if (\n !cellPosition ||\n !this.draggingCell ||\n this.cellPositionEquals(this.draggingCell, cellPosition)\n ) {\n return;\n }\n\n const columns = this.calculateColumnsBetween(this.newestRangeStartCell.column, cellPosition.column);\n\n if (!columns) {\n return;\n }\n\n this.draggingCell = cellPosition;\n\n this.draggingRange.endRow = {\n rowIndex: cellPosition.rowIndex,\n rowPinned: cellPosition.rowPinned\n };\n this.draggingRange.columns = columns;\n\n this.dispatchChangedEvent(false, false, this.draggingRange.id);\n this.focusCell(cellPosition);\n }\n\n focusCell(cellPosition) {\n const cellFocused = this.focusService.isCellFocused(cellPosition);\n if (!cellFocused) {\n this.focusService.setFocusedCell(cellPosition.rowIndex, cellPosition.column, cellPosition.rowPinned, true);\n }\n }\n\n onDragStop() {\n if (!this.dragging) {\n return;\n }\n const {id} = this.draggingRange;\n this.autoScrollService.ensureCleared();\n\n this.ctrlsService.getGridBodyCtrl().removeScrollEventListener(this.bodyScrollListener);\n this.lastMouseEvent = null;\n this.dragging = false;\n this.draggingRange = undefined;\n this.draggingCell = undefined;\n\n this.dispatchChangedEvent(false, true, id);\n }\n\n dispatchChangedEvent(started, finished, id) {\n this.cellRanges.map((cellRange) => {\n let currentRow = this.getRangeStartRow(cellRange);\n const lastRow = this.getRangeEndRow(cellRange);\n const nodesToBeSelected = [];\n while (true) {\n const finishedAllRows = _.missing(currentRow) || !currentRow || this.rowPositionUtils.before(lastRow, currentRow);\n if (finishedAllRows || !currentRow || !cellRange.columns) {\n break;\n }\n const rowNode = this.rowRenderer.getRowNode(currentRow);\n if (!rowNode.isSelected()) {\n rowNode.setSelected(true);\n }\n nodesToBeSelected.push(rowNode.data);\n currentRow = this.cellNavigationService.getRowBelow(currentRow);\n }\n this.gridApi.getSelectedNodes().forEach((node) => {\n if (!nodesToBeSelected.some(nodeToBeSelected => node.data === nodeToBeSelected)) {\n node.setSelected(false);\n }\n });\n });\n const event = Object.freeze({\n type: Events.EVENT_RANGE_SELECTION_CHANGED,\n api: this.gridApi,\n columnApi: this.columnApi,\n started: started,\n finished: finished,\n id: id,\n });\n this.eventService.dispatchEvent(event);\n }\n\n calculateColumnsBetween(columnFrom, columnTo) {\n const allColumns = this.columnModel.getAllDisplayedColumns();\n const isSameColumn = columnFrom === columnTo;\n const fromIndex = allColumns.indexOf(columnFrom);\n\n if (fromIndex < 0) {\n console.warn(`ag-Grid: column ${columnFrom.getId()} is not visible`);\n return undefined;\n }\n\n const toIndex = isSameColumn ? fromIndex : allColumns.indexOf(columnTo);\n\n if (toIndex < 0) {\n console.warn(`ag-Grid: column ${columnTo.getId()} is not visible`);\n return undefined;\n }\n\n if (isSameColumn) {\n return [columnFrom];\n }\n\n const firstIndex = Math.min(fromIndex, toIndex);\n const lastIndex = firstIndex === fromIndex ? toIndex : fromIndex;\n\n const columns = [];\n\n for (let i = firstIndex; i <= lastIndex; i++) {\n columns.push(allColumns[i]);\n }\n\n return columns;\n }\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simpleStatusTextCellEditor.js","sourceRoot":"","sources":["../../../../../components/grid/cell/simpleStatusTextCellEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,MAAM,EAAC,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACtD,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAChC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAGvC,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,UAAU,GAAG,EAAE,CAAC;AActB,MAAM,CAAC,OAAO,OAAO,0BAA2B,SAAQ,KAAK,CAAC,SAAgF;IAK1I,YAAY,KAAqD;QAC7D,KAAK,CAAC,KAAK,CAAC,CAAC;QALT,oBAAe,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C,+BAA+B,CAAC,mCAAI,EAAE,CAAkB,CAAC;QACpJ,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;YACxB,MAAM,iBAAiB,GAAG,MAAA,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,0CAAE,WAAW,CAAC;YAC9D,MAAM,WAAW,GAAG,iBAAiB,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;YACtG,IAAI,WAAW,EAAE;gBACb,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,WAAW,EAAC,CAAC,CAAC;aACvC;SACJ;IACL,CAAC;CACJ","sourcesContent":["import React from 'react';\r\nimport {Select} from \"antd\";\r\nimport {ICellEditor, ICellEditorParams} from \"ag-grid-community\";\r\nimport {LocaleHolder} from \"d2core/i18n/localeHolder\";\r\nimport ReactDOM from 'react-dom';\r\nimport {Key} from \"ts-key-enum\";\r\nimport debounce from \"lodash/debounce\";\r\nimport {RefSelectProps} from \"antd/es/select\";\r\n\r\nconst KEY_BACKSPACE = 8;\r\nconst KEY_DELETE = 46;\r\n\r\ninterface SimpleStatusTextCellEditorProperties extends ICellEditorParams {\r\n decimalSeparator?: string\r\n precision?: number\r\n statusTexts: { text: string, value: number }[];\r\n}\r\n\r\ninterface SimpleStatusTextCellEditorState {\r\n value: number | null\r\n cancelEdit: boolean\r\n opened: boolean\r\n}\r\n\r\nexport default class SimpleStatusTextCellEditor extends React.Component<SimpleStatusTextCellEditorProperties, SimpleStatusTextCellEditorState> implements ICellEditor {\r\n private selectComponent: RefSelectProps | null = null;\r\n private focusOpId: number | null = null;\r\n private wrappingComponent: HTMLDivElement | null = null;\r\n\r\n constructor(props: Readonly<SimpleStatusTextCellEditorProperties>) {\r\n super(props);\r\n this.state = this.getInitialState(props);\r\n this.updateValueFromPreselection = debounce(this.updateValueFromPreselection.bind(this), 200, {maxWait: 200});\r\n }\r\n\r\n getInitialState(props: Readonly<SimpleStatusTextCellEditorProperties>): SimpleStatusTextCellEditorState {\r\n let value: number | null;\r\n if (props.keyPress === KEY_BACKSPACE || props.keyPress === KEY_DELETE) {\r\n // if backspace or delete pressed, we clear the cell\r\n value = null;\r\n } else if (props.charPress) {\r\n // if a letter was pressed, we start with the letter\r\n const parsedValue = Number.parseInt(props.charPress);\r\n value = isNaN(parsedValue) ? props.value : parsedValue;\r\n } else {\r\n // otherwise we start with the current value\r\n value = props.value;\r\n }\r\n return {\r\n value: value,\r\n cancelEdit: false,\r\n opened: true,\r\n } as SimpleStatusTextCellEditorState;\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.focusOpId) {\r\n clearTimeout(this.focusOpId);\r\n }\r\n }\r\n\r\n afterGuiAttached() {\r\n this.focusOpId = window.setTimeout(() => {\r\n this.selectComponent?.focus();\r\n }, 200);\r\n }\r\n\r\n getValue() {\r\n return this.state.value;\r\n }\r\n\r\n isPopup(): boolean {\r\n return true;\r\n }\r\n\r\n isCancelBeforeStart(): boolean {\r\n return false;\r\n }\r\n\r\n isCancelAfterEnd() {\r\n return false;\r\n }\r\n\r\n render() {\r\n return (\r\n <div style={{width: \"100%\", minWidth: 150}}>\r\n <Select<number>\r\n ref={(component) => {\r\n this.selectComponent = component;\r\n }}\r\n size={\"small\"}\r\n virtual={false}\r\n className={\"select-with-one-item\"}\r\n showSearch\r\n dropdownMatchSelectWidth={false}\r\n style={{width: \"100%\", overflow: \"auto\", padding: 0, margin: 0}}\r\n dropdownStyle={{maxHeight: 400, overflow: 'auto'}}\r\n allowClear\r\n showAction={['focus', 'click']}\r\n filterOption={(inputValue, option) => {\r\n const inputToSearch = inputValue.toLocaleLowerCase(LocaleHolder.formattingLocale);\r\n return (option?.value !== undefined && LocaleHolder.formatNumber(option?.value).indexOf(inputToSearch) >= 0) || (option?.title?.toLocaleLowerCase(LocaleHolder.formattingLocale).indexOf(inputToSearch) >= 0);\r\n }}\r\n value={this.state.value !== null ? this.state.value : undefined}\r\n onChange={(value) => {\r\n this.setState({value: value === undefined ? null : value});\r\n }}\r\n onSelect={(value) => {\r\n this.setState({value: value === undefined ? null : value});\r\n }}\r\n onMouseDown={() => {\r\n this.updateValueImmediately();\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 onInputKeyDown={(e) => {\r\n if (!e.altKey && (e.key === Key.ArrowUp || e.key === Key.ArrowDown)) {\r\n this.updateValueFromPreselection();\r\n }\r\n }}\r\n onSearch={() => {\r\n this.updateValueFromPreselection();\r\n }}\r\n dropdownRender={(menu) => {\r\n return (\r\n <div ref={(component) => {\r\n this.wrappingComponent = component;\r\n }}>\r\n {menu}\r\n </div>\r\n );\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 data-optionvalue={\"\" + statusTextItem.value}\r\n >\r\n <span\r\n onMouseDown={() => {\r\n this.setState({value: statusTextItem.value});\r\n }}\r\n style={{\r\n color: \"rgba(0, 0, 0, 0.85)\",\r\n whiteSpace: \"nowrap\"\r\n }}>\r\n {`${statusTextItem.text} (${statusTextItem.value})`}\r\n </span>\r\n </Select.Option>;\r\n })}\r\n </Select>\r\n </div>\r\n );\r\n }\r\n\r\n private updateValueFromPreselection() {\r\n setTimeout(() => {\r\n this.updateValueImmediately();\r\n }, 200)\r\n }\r\n\r\n private updateValueImmediately() {\r\n let selectables: HTMLElement[] = Array.from(this.wrappingComponent?.getElementsByClassName(\"ant-select-item-option-active\") ?? []) as HTMLElement[];\r\n if (selectables.length > 0) {\r\n const optionStringValue = selectables[0].dataset?.optionvalue;\r\n const optionValue = optionStringValue !== undefined ? Number.parseFloat(optionStringValue) : undefined\r\n if (optionValue) {\r\n this.setState({value: optionValue});\r\n }\r\n }\r\n }\r\n}"]}
|
|
1
|
+
{"version":3,"file":"simpleStatusTextCellEditor.js","sourceRoot":"","sources":["../../../../../components/grid/cell/simpleStatusTextCellEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,MAAM,EAAC,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACtD,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAChC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAGvC,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,UAAU,GAAG,EAAE,CAAC;AActB,MAAM,CAAC,OAAO,OAAO,0BAA2B,SAAQ,KAAK,CAAC,SAAgF;IAK1I,YAAY,KAAqD;QAC7D,KAAK,CAAC,KAAK,CAAC,CAAC;QALT,oBAAe,GAA0B,IAAI,CAAC;QAC9C,cAAS,GAAkB,IAAI,CAAC;QAChC,sBAAiB,GAA0B,IAAI,CAAC;QAIpD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACzC,IAAI,CAAC,2BAA2B,GAAG,QAAQ,CAAC,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,EAAC,OAAO,EAAE,GAAG,EAAC,CAAC,CAAC;IAClH,CAAC;IAED,eAAe,CAAC,KAAqD;QACjE,IAAI,KAAoB,CAAC;QACzB,IAAI,KAAK,CAAC,QAAQ,KAAK,aAAa,IAAI,KAAK,CAAC,QAAQ,KAAK,UAAU,EAAE;YAEnE,KAAK,GAAG,IAAI,CAAC;SAChB;aAAM,IAAI,KA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AAc,CAAC,KAAK,EAC9B,KAAK,EAAE,cAAc,CAAC,KAAK,EAC3B,KAAK,EAAE,cAAc,CAAC,IAAI,sBACR,EAAE,GAAG,cAAc,CAAC,KAAK;oBAE/B,8BACI,WAAW,EAAE,GAAG,EAAE;4BACd,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,cAAc,CAAC,KAAK,EAAC,CAAC,CAAC;wBACjD,CAAC,EACD,KAAK,EAAE;4BACH,KAAK,EAAE,qBAAqB;4BAC5B,UAAU,EAAE,QAAQ;yBACvB,IACA,GAAG,cAAc,CAAC,IAAI,KAAK,cAAc,CAAC,KAAK,GAAG,CAChD,CACP,CAAC;YACrB,CAAC,CAAC,CACG,CACP,CACT,CAAC;IACN,CAAC;IAEO,2BAA2B;QAC/B,UAAU,CAAC,GAAG,EAAE;YACZ,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAClC,CAAC,EAAE,GAAG,CAAC,CAAA;IACX,CAAC;IAEO,sBAAsB;;QAC1B,IAAI,WAAW,GAAkB,KAAK,CAAC,IAAI,CAAC,MAAA,MAAA,IAAI,CAAC,iBAAiB,0CAAE,sBAAsB,CAAC,+BAA+B,CAAC,mCAAI,EAAE,CAAkB,CAAC;QACpJ,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;YACxB,MAAM,iBAAiB,GAAG,MAAA,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,0CAAE,WAAW,CAAC;YAC9D,MAAM,WAAW,GAAG,iBAAiB,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;YACtG,IAAI,WAAW,EAAE;gBACb,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,WAAW,EAAC,CAAC,CAAC;aACvC;SACJ;IACL,CAAC;CACJ","sourcesContent":["import React from 'react';\nimport {Select} from \"antd\";\nimport {ICellEditor, ICellEditorParams} from \"ag-grid-community\";\nimport {LocaleHolder} from \"d2core/i18n/localeHolder\";\nimport ReactDOM from 'react-dom';\nimport {Key} from \"ts-key-enum\";\nimport debounce from \"lodash/debounce\";\nimport {RefSelectProps} from \"antd/es/select\";\n\nconst KEY_BACKSPACE = 8;\nconst KEY_DELETE = 46;\n\ninterface SimpleStatusTextCellEditorProperties extends ICellEditorParams {\n decimalSeparator?: string\n precision?: number\n statusTexts: { text: string, value: number }[];\n}\n\ninterface SimpleStatusTextCellEditorState {\n value: number | null\n cancelEdit: boolean\n opened: boolean\n}\n\nexport default class SimpleStatusTextCellEditor extends React.Component<SimpleStatusTextCellEditorProperties, SimpleStatusTextCellEditorState> implements ICellEditor {\n private selectComponent: RefSelectProps | null = null;\n private focusOpId: number | null = null;\n private wrappingComponent: HTMLDivElement | null = null;\n\n constructor(props: Readonly<SimpleStatusTextCellEditorProperties>) {\n super(props);\n this.state = this.getInitialState(props);\n this.updateValueFromPreselection = debounce(this.updateValueFromPreselection.bind(this), 200, {maxWait: 200});\n }\n\n getInitialState(props: Readonly<SimpleStatusTextCellEditorProperties>): SimpleStatusTextCellEditorState {\n let value: number | null;\n if (props.keyPress === KEY_BACKSPACE || props.keyPress === KEY_DELETE) {\n // if backspace or delete pressed, we clear the cell\n value = null;\n } else if (props.charPress) {\n // if a letter was pressed, we start with the letter\n const parsedValue = Number.parseInt(props.charPress);\n value = isNaN(parsedValue) ? props.value : parsedValue;\n } else {\n // otherwise we start with the current value\n value = props.value;\n }\n return {\n value: value,\n cancelEdit: false,\n opened: true,\n } as SimpleStatusTextCellEditorState;\n }\n\n componentWillUnmount() {\n if (this.focusOpId) {\n clearTimeout(this.focusOpId);\n }\n }\n\n afterGuiAttached() {\n this.focusOpId = window.setTimeout(() => {\n this.selectComponent?.focus();\n }, 200);\n }\n\n getValue() {\n return this.state.value;\n }\n\n isPopup(): boolean {\n return true;\n }\n\n isCancelBeforeStart(): boolean {\n return false;\n }\n\n isCancelAfterEnd() {\n return false;\n }\n\n render() {\n return (\n <div style={{width: \"100%\", minWidth: 150}}>\n <Select<number>\n ref={(component) => {\n this.selectComponent = component;\n }}\n size={\"small\"}\n virtual={false}\n className={\"select-with-one-item\"}\n showSearch\n dropdownMatchSelectWidth={false}\n style={{width: \"100%\", overflow: \"auto\", padding: 0, margin: 0}}\n dropdownStyle={{maxHeight: 400, overflow: 'auto'}}\n allowClear\n showAction={['focus', 'click']}\n filterOption={(inputValue, option) => {\n const inputToSearch = inputValue.toLocaleLowerCase(LocaleHolder.formattingLocale);\n return (option?.value !== undefined && LocaleHolder.formatNumber(option?.value).indexOf(inputToSearch) >= 0) || (option?.title?.toLocaleLowerCase(LocaleHolder.formattingLocale).indexOf(inputToSearch) >= 0);\n }}\n value={this.state.value !== null ? this.state.value : undefined}\n onChange={(value) => {\n this.setState({value: value === undefined ? null : value});\n }}\n onSelect={(value) => {\n this.setState({value: value === undefined ? null : value});\n }}\n onMouseDown={() => {\n this.updateValueImmediately();\n }}\n open={this.state.opened}\n onDropdownVisibleChange={(visible) => {\n this.setState({opened: visible});\n }}\n getPopupContainer={(_trigger) => {\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)\n return (ReactDOM.findDOMNode(this)?.parentNode ?? document.body) as HTMLElement;\n }}\n onInputKeyDown={(e) => {\n if (!e.altKey && (e.key === Key.ArrowUp || e.key === Key.ArrowDown)) {\n this.updateValueFromPreselection();\n }\n }}\n onSearch={() => {\n this.updateValueFromPreselection();\n }}\n dropdownRender={(menu) => {\n return (\n <div ref={(component) => {\n this.wrappingComponent = component;\n }}>\n {menu}\n </div>\n );\n }}\n >\n {this.props.statusTexts?.map((statusTextItem) => {\n return <Select.Option\n id={\"select-value-\" + statusTextItem.value}\n key={\"\" + statusTextItem.value}\n value={statusTextItem.value}\n title={statusTextItem.text}\n data-optionvalue={\"\" + statusTextItem.value}\n >\n <span\n onMouseDown={() => {\n this.setState({value: statusTextItem.value});\n }}\n style={{\n color: \"rgba(0, 0, 0, 0.85)\",\n whiteSpace: \"nowrap\"\n }}>\n {`${statusTextItem.text} (${statusTextItem.value})`}\n </span>\n </Select.Option>;\n })}\n </Select>\n </div>\n );\n }\n\n private updateValueFromPreselection() {\n setTimeout(() => {\n this.updateValueImmediately();\n }, 200)\n }\n\n private updateValueImmediately() {\n let selectables: HTMLElement[] = Array.from(this.wrappingComponent?.getElementsByClassName(\"ant-select-item-option-active\") ?? []) as HTMLElement[];\n if (selectables.length > 0) {\n const optionStringValue = selectables[0].dataset?.optionvalue;\n const optionValue = optionStringValue !== undefined ? Number.parseFloat(optionStringValue) : undefined\n if (optionValue) {\n this.setState({value: optionValue});\n }\n }\n }\n}"]}
|
|
@@ -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;AAEzC,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAChC,OAAO,aAAa,MAAM,4CAA4C,CAAC;AACvE,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACtD,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAElD,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,MAAM,GAAG,GAAG,CAAC;AAenB,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,KAAK,CAAC,SAAoE;IAIxH,YAAY,KAA+C;QACvD,KAAK,CAAC,KAAK,CAAC,CAAC;QAJT,mBAAc,GAA4B,IAAI,CAAC;QAC/C,cAAS,GAAkB,IAAI,CAAC;QAIpC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC7C,C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K,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;wBAC5C,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;qBACxB;yBAAM,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,EAAE;wBAC5C,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;qBAC9C;gBACL,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;wBAClD,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;wBACpC,CAAC,CAAC,cAAc,EAAE,CAAC;qBACtB;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","sourcesContent":["import React from 'react';\r\nimport {InputNumber, Select} from \"antd\";\r\nimport {ICellEditor, ICellEditorParams} from \"ag-grid-community\";\r\nimport {Key} from \"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\n\r\nconst KEY_BACKSPACE = 8;\r\nconst KEY_DELETE = 46;\r\nconst KEY_F2 = 113;\r\n\r\ninterface StatusTextCellEditorProperties extends ICellEditorParams {\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 highlightAllOnFocus: boolean\r\n cancelEdit: boolean\r\n opened: boolean\r\n}\r\n\r\nexport default class StatusTextCellEditor extends React.Component<StatusTextCellEditorProperties, StatusTextCellEditorState> implements ICellEditor {\r\n private inputComponent: HTMLInputElement | null = null;\r\n private focusOpId: number | 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 let highlightAllOnFocus = true;\r\n\r\n if (props.keyPress === KEY_BACKSPACE || props.keyPress === KEY_DELETE) {\r\n // if backspace or delete pressed, we clear the cell\r\n value = null;\r\n } else if (props.charPress) {\r\n // if a letter was pressed, we start with the letter\r\n const parsedValue = Number.parseInt(props.charPress);\r\n value = isNaN(parsedValue) ? props.value : parsedValue;\r\n highlightAllOnFocus = false;\r\n } else {\r\n // otherwise we start with the current value\r\n value = props.value;\r\n if (props.keyPress === KEY_F2) {\r\n highlightAllOnFocus = false;\r\n }\r\n }\r\n return {\r\n value: value,\r\n highlightAllOnFocus,\r\n cancelEdit: false\r\n } as StatusTextCellEditorState;\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.focusOpId) {\r\n clearTimeout(this.focusOpId);\r\n }\r\n }\r\n\r\n afterGuiAttached() {\r\n this.focusOpId = window.setTimeout(() => {\r\n this.inputComponent?.focus();\r\n if (this.state.highlightAllOnFocus) {\r\n this.inputComponent?.select();\r\n this.setState({\r\n highlightAllOnFocus: false,\r\n });\r\n } else {\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 }, 200);\r\n }\r\n\r\n getValue() {\r\n return this.state.value;\r\n }\r\n\r\n isPopup(): boolean {\r\n return true;\r\n }\r\n\r\n isCancelBeforeStart(): boolean {\r\n return !!this.props.charPress && '1234567890'.indexOf(this.props.charPress) < 0;\r\n }\r\n\r\n isCancelAfterEnd() {\r\n return false;\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 dropdownMatchSelectWidth={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 return (option?.value.toLocaleLowerCase(LocaleHolder.formattingLocale).indexOf(inputToSearch) >= 0) || (option?.title?.toLocaleLowerCase(LocaleHolder.formattingLocale).indexOf(inputToSearch) >= 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 }}\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: number | string | undefined) => {\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 } else if (value === undefined || value === \"\") {\r\n this.setState({value: null, opened: true});\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}"]}
|
|
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;AAEzC,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAChC,OAAO,aAAa,MAAM,4CAA4C,CAAC;AACvE,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACtD,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAElD,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,MAAM,GAAG,GAAG,CAAC;AAenB,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,KAAK,CAAC,SAAoE;IAIxH,YAAY,KAA+C;QACvD,KAAK,CAAC,KAAK,CAAC,CAAC;QAJT,mBAAc,GAA4B,IAAI,CAAC;QAC/C,cAAS,GAAkB,IAAI,CAAC;QAIpC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IAED,eAAe,CAAC,KAA+C;QAC3D,IAAI,KAAoB,CAAC;QACzB,IAAI,mBAAmB,GAAG,IAAI,CAAC;QAE/B,IAAI,KAAK,CAAC,QAAQ,KAAK,aAAa,IAAI,KAAK,CAAC,QAAQ,KA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AAE,EAAE;wBAC5C,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;qBAC9C;gBACL,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;wBAClD,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;wBACpC,CAAC,CAAC,cAAc,EAAE,CAAC;qBACtB;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","sourcesContent":["import React from 'react';\nimport {InputNumber, Select} from \"antd\";\nimport {ICellEditor, ICellEditorParams} from \"ag-grid-community\";\nimport {Key} from \"ts-key-enum\";\nimport KeyboardUtils from \"d2coreui/components/keyboard/keyboardUtils\";\nimport {LocaleHolder} from \"d2core/i18n/localeHolder\";\nimport ReactDOM from 'react-dom';\nimport scrollIntoView from \"dom-scroll-into-view\";\n\nconst KEY_BACKSPACE = 8;\nconst KEY_DELETE = 46;\nconst KEY_F2 = 113;\n\ninterface StatusTextCellEditorProperties extends ICellEditorParams {\n decimalSeparator?: string\n precision?: number\n statusTexts: { text: string, value: number }[];\n}\n\ninterface StatusTextCellEditorState {\n value: number | null\n highlightAllOnFocus: boolean\n cancelEdit: boolean\n opened: boolean\n}\n\nexport default class StatusTextCellEditor extends React.Component<StatusTextCellEditorProperties, StatusTextCellEditorState> implements ICellEditor {\n private inputComponent: HTMLInputElement | null = null;\n private focusOpId: number | null = null;\n\n constructor(props: Readonly<StatusTextCellEditorProperties>) {\n super(props);\n this.state = this.getInitialState(props);\n }\n\n getInitialState(props: Readonly<StatusTextCellEditorProperties>): StatusTextCellEditorState {\n let value: number | null;\n let highlightAllOnFocus = true;\n\n if (props.keyPress === KEY_BACKSPACE || props.keyPress === KEY_DELETE) {\n // if backspace or delete pressed, we clear the cell\n value = null;\n } else if (props.charPress) {\n // if a letter was pressed, we start with the letter\n const parsedValue = Number.parseInt(props.charPress);\n value = isNaN(parsedValue) ? props.value : parsedValue;\n highlightAllOnFocus = false;\n } else {\n // otherwise we start with the current value\n value = props.value;\n if (props.keyPress === KEY_F2) {\n highlightAllOnFocus = false;\n }\n }\n return {\n value: value,\n highlightAllOnFocus,\n cancelEdit: false\n } as StatusTextCellEditorState;\n }\n\n componentWillUnmount() {\n if (this.focusOpId) {\n clearTimeout(this.focusOpId);\n }\n }\n\n afterGuiAttached() {\n this.focusOpId = window.setTimeout(() => {\n this.inputComponent?.focus();\n if (this.state.highlightAllOnFocus) {\n this.inputComponent?.select();\n this.setState({\n highlightAllOnFocus: false,\n });\n } else {\n // when we started editing, we want the carot at the end, not the start.\n // this comes into play in two scenarios: a) when user hits F2 and b)\n // when user hits a printable character, then on IE (and only IE) the carot\n // was placed after the first character, thus 'apply' would end up as 'pplea'\n const length = this.inputComponent?.value ? this.inputComponent?.value.length : 0;\n if (length > 0) {\n this.inputComponent?.setSelectionRange(length, length);\n }\n }\n }, 200);\n }\n\n getValue() {\n return this.state.value;\n }\n\n isPopup(): boolean {\n return true;\n }\n\n isCancelBeforeStart(): boolean {\n return !!this.props.charPress && '1234567890'.indexOf(this.props.charPress) < 0;\n }\n\n isCancelAfterEnd() {\n return false;\n }\n\n // noinspection DuplicatedCode\n getScrollParent(element: HTMLElement, includeHidden = false): HTMLElement {\n var style = getComputedStyle(element);\n var excludeStaticParent = style.position === \"absolute\";\n var overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/;\n if (style.position === \"fixed\") return document.body;\n let parent: HTMLElement | null;\n for (parent = element; (parent = parent.parentElement);) {\n style = getComputedStyle(parent);\n if (excludeStaticParent && style.position === \"static\") {\n continue;\n }\n if (overflowRegex.test(style.overflow + style.overflowY + style.overflowX)) return parent;\n }\n return document.body;\n }\n\n scrollTo(value: number) {\n const elementToScroll = document.getElementById(\"select-value-\" + value);\n if (elementToScroll) {\n const parent = this.getScrollParent(elementToScroll, true);\n scrollIntoView(elementToScroll, parent, {\n onlyScrollIfNeeded: true,\n allowHorizontalScroll: false,\n alignWithTop: true,\n offsetTop: 20,\n offsetBottom: 20,\n });\n }\n }\n\n render() {\n return (\n <div style={{width: \"100%\", minWidth: 150}}>\n <Select<number>\n size={\"small\"}\n virtual={false}\n dropdownMatchSelectWidth={false}\n className={\"select-with-one-item\"}\n style={{width: \"100%\", overflow: \"auto\", visibility: \"hidden\"}}\n dropdownStyle={{maxHeight: 400, overflow: 'auto'}}\n allowClear\n dropdownAlign={{points: [\"tl\", \"tr\"], offset: [0, -100], overflow: {adjustX: true, adjustY: true}}}\n filterOption={(inputValue, option) => {\n const inputToSearch = inputValue.toLocaleLowerCase(LocaleHolder.formattingLocale);\n return (option?.value.toLocaleLowerCase(LocaleHolder.formattingLocale).indexOf(inputToSearch) >= 0) || (option?.title?.toLocaleLowerCase(LocaleHolder.formattingLocale).indexOf(inputToSearch) >= 0);\n }}\n value={this.state.value !== null ? this.state.value : undefined}\n onChange={(value) => {\n this.setState({value: value});\n }}\n open={this.state.opened}\n onDropdownVisibleChange={(visible) => {\n this.setState({opened: visible});\n }}\n getPopupContainer={(_trigger) => {\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)\n return (ReactDOM.findDOMNode(this)?.parentNode ?? document.body) as HTMLElement;\n }}\n >\n {this.props.statusTexts?.map((statusTextItem) => {\n return <Select.Option\n id={\"select-value-\" + statusTextItem.value}\n key={\"\" + statusTextItem.value}\n value={statusTextItem.value}\n title={statusTextItem.text}\n >\n <span style={{\n color: \"rgba(0, 0, 0, 0.85)\",\n whiteSpace: \"nowrap\"\n }}>{`${statusTextItem.text} (${statusTextItem.value})`}</span>\n </Select.Option>;\n })}\n </Select>\n <InputNumber\n ref={(component) => {\n this.inputComponent = component;\n }}\n size=\"small\"\n style={{\n position: \"absolute\",\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n width: \"100%\"\n }}\n autoFocus\n decimalSeparator={this.props.decimalSeparator}\n precision={this.props.precision}\n placeholder={this.state.value === null ? \"NULL\" : \"\"}\n value={this.state.value !== undefined && this.state.value !== null ? this.state.value : undefined}\n onChange={(value: number | string | undefined) => {\n if (KeyboardUtils.isKeyPressed(Key.Alt)) {\n // ignore navigational keystrokes ALT+cursor arrow\n return;\n }\n if (typeof value === \"number\") {\n this.setState({value: value, opened: true});\n this.scrollTo(value);\n } else if (value === undefined || value === \"\") {\n this.setState({value: null, opened: true});\n }\n }}\n onKeyDown={(e) => {\n if (e.key === Key.ArrowUp || e.key === Key.ArrowDown) {\n this.props.onKeyDown(e.nativeEvent);\n e.preventDefault();\n }\n }}\n onFocus={() => {\n this.setState({opened: true});\n }}\n onClick={() => {\n this.setState({opened: true});\n }}\n />\n </div>\n );\n }\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tableDefaultRowStyleRules.js","sourceRoot":"","sources":["../../../../../components/grid/cell/tableDefaultRowStyleRules.ts"],"names":[],"mappings":"AAoBA,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAEzC,MAAM,yBAAyB,GAAG;IAC9B,OAAO;QACH;YACI,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,UAAU;YACnB,GAAG,EAAE,iBAAiB;YACtB,UAAU,EAAE,IAAI;YAChB,KAAK,EAAE;gBACH,QAAQ,EAAE,sBAAsB;aACnC;YACD,WAAW,EAAE;gBACT,QAAQ,EAAE,IAAI;aACjB;SACJ;KACJ,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,yBAAyB,CAAC","sourcesContent":["import {RGBColor} from \"react-color\";\
|
|
1
|
+
{"version":3,"file":"tableDefaultRowStyleRules.js","sourceRoot":"","sources":["../../../../../components/grid/cell/tableDefaultRowStyleRules.ts"],"names":[],"mappings":"AAoBA,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAEzC,MAAM,yBAAyB,GAAG;IAC9B,OAAO;QACH;YACI,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,UAAU;YACnB,GAAG,EAAE,iBAAiB;YACtB,UAAU,EAAE,IAAI;YAChB,KAAK,EAAE;gBACH,QAAQ,EAAE,sBAAsB;aACnC;YACD,WAAW,EAAE;gBACT,QAAQ,EAAE,IAAI;aACjB;SACJ;KACJ,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,yBAAyB,CAAC","sourcesContent":["import {RGBColor} from \"react-color\";\n\nexport interface GridRowStyle {\n [cssProperty: string]: string | number | RGBColor\n}\n\nexport interface RowStyleRule {\n name: string\n divider?: string\n key: string\n expression: string | null\n style: GridRowStyle\n styleEditor?: {\n backgroundColor?: boolean\n color?: boolean\n fontSize?: boolean\n fontWeight?: boolean\n }\n}\n\nexport const GRID_DEFAULT_FONT_SIZE = 12;\n\nconst tableDefaultRowStyleRules = function (): RowStyleRule[] {\n return [\n {\n name: \"Font Size\",\n divider: \"All Rows\",\n key: \"table-font-size\",\n expression: null,\n style: {\n fontSize: GRID_DEFAULT_FONT_SIZE\n },\n styleEditor: {\n fontSize: true,\n }\n }\n ];\n};\n\nexport default tableDefaultRowStyleRules;"]}
|
|
@@ -64,6 +64,7 @@ export default class TextCellEditor extends React.Component {
|
|
|
64
64
|
return true;
|
|
65
65
|
}
|
|
66
66
|
render() {
|
|
67
|
+
const inputWidth = !!this.state.value && this.state.value.length > 40 ? this.state.value.length : 40;
|
|
67
68
|
return (React.createElement(Input, { ref: (component) => {
|
|
68
69
|
this.inputComponent = component;
|
|
69
70
|
}, size: "small", autoFocus: true, placeholder: this.state.value === null ? "NULL" : "", value: this.state.value != undefined ? this.state.value : undefined, onChange: (event) => {
|
|
@@ -76,7 +77,10 @@ export default class TextCellEditor extends React.Component {
|
|
|
76
77
|
this.props.onKeyDown(e.nativeEvent);
|
|
77
78
|
e.preventDefault();
|
|
78
79
|
}
|
|
79
|
-
|
|
80
|
+
if (e.key === Key.Delete) {
|
|
81
|
+
e.stopPropagation();
|
|
82
|
+
}
|
|
83
|
+
}, style: { width: '100%', minWidth: `min( 85vw, ${inputWidth}ch)` } }));
|
|
80
84
|
}
|
|
81
85
|
}
|
|
82
86
|
//# sourceMappingURL=textCellEditor.js.map
|