d2coreui 23.0.14 → 23.0.15
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.ts +53 -0
- package/components/codemirror/SyntaxHighlighter.tsx +58 -0
- package/components/collapse/expandable.tsx +48 -0
- package/components/color/colorPicker.tsx +121 -0
- package/components/color/colorSwatch.d.ts +18 -13
- package/components/color/colorSwatch.jsx +87 -0
- package/components/color/colorUtils.ts +60 -0
- package/components/date/dateRangeInput.tsx +468 -0
- package/components/date/dateRangeInputAdvancedPanel.tsx +238 -0
- package/components/date/dateRangeInputConfirm.tsx +200 -0
- package/components/date/dateTimeInput.tsx +633 -0
- package/components/date/durationInput.tsx +375 -0
- package/components/form/NiceFormItem.tsx +32 -0
- package/components/grid/cell/beanAccessor.ts +17 -0
- package/components/grid/cell/cellEditorUtils.ts +12 -0
- package/components/grid/cell/customEnumCellEditor.tsx +130 -0
- package/components/grid/cell/dataGridCellEditorComponent.tsx +61 -0
- package/components/grid/cell/dateCellEditor.tsx +83 -0
- package/components/grid/cell/durationCellEditor.tsx +105 -0
- package/components/grid/cell/hexaOctetStringCellEditor.tsx +101 -0
- package/components/grid/cell/hexaValueCellEditor.tsx +92 -0
- package/components/grid/cell/numberCellEditor.tsx +115 -0
- package/components/grid/cell/rangeSelector.d.ts +9 -78
- package/components/grid/cell/rangeSelector.js +674 -527
- package/components/grid/cell/simpleStatusTextCellEditor.tsx +168 -0
- package/components/grid/cell/statusTextCellEditor.tsx +198 -0
- package/components/grid/cell/tableDefaultRowStyleRules.ts +51 -0
- package/components/grid/cell/textCellEditor.tsx +94 -0
- package/components/grid/cell/withAgGridHooks.tsx +15 -0
- package/components/grid/columnUtils.ts +29 -0
- package/components/grid/config/columnTransfer.tsx +258 -0
- package/components/grid/config/dataGridEditor.tsx +328 -0
- package/components/grid/config/rowHeightCalculator.tsx +29 -0
- package/components/grid/config/rowStylePicker.tsx +196 -0
- package/components/grid/dataGrid.tsx +2183 -0
- package/components/grid/detail/detailHeaderPanel.tsx +59 -0
- package/components/grid/export/contextMenu.tsx +154 -0
- package/components/grid/export/progressPopup.tsx +106 -0
- package/components/grid/export/worker/clipboardExport.ts +10 -0
- package/components/grid/export/worker/csvExport.ts +10 -0
- package/components/grid/export/worker/pdfExport.ts +98 -0
- package/components/grid/export/worker/txtExport.ts +21 -0
- package/components/grid/extendedDataGrid.tsx +974 -0
- package/components/grid/filter/customColumnFilter.tsx +14 -0
- package/components/grid/filter/dataGridColumnFilter.tsx +70 -0
- package/components/grid/filter/dateColumnFilter.tsx +34 -0
- package/components/grid/filter/textColumnFilter.tsx +37 -0
- package/components/grid/filter/wildcardQuickFilterEngine.ts +50 -0
- package/components/grid/header/simpleHeader.tsx +270 -0
- package/components/grid/panel/dataGridPagination.tsx +123 -0
- package/components/grid/panel/loadingOverlay.tsx +14 -0
- package/components/grid/panel/noRecordsOverlay.tsx +16 -0
- package/components/grid/panel/tablePagination.tsx +77 -0
- package/components/icons/dropdownArrow.tsx +67 -0
- package/components/icons/undoIcon.tsx +16 -0
- package/components/input/autoCompleteInput.tsx +174 -0
- package/components/input/draftUtils.tsx +62 -0
- package/components/input/draftail.d.ts +186 -1
- package/components/input/draftail.js +1 -2
- package/components/input/hexaFormattedInput.tsx +64 -0
- package/components/input/mask/helpers.ts +154 -0
- package/components/input/mask/inputMaskCore.ts +452 -0
- package/components/input/mask/pattern.ts +122 -0
- package/components/input/maskedInput.tsx +275 -0
- package/components/input/passwordInput.tsx +62 -0
- package/components/input/simpleAutoComplete.tsx +60 -0
- package/components/input/textarea/extractSpansOfClasses.tsx +125 -0
- package/components/input/textarea/getRanges.ts +82 -0
- package/components/input/textarea/getType.ts +23 -0
- package/components/input/textarea/highlighedContents.tsx +20 -0
- package/components/input/textarea/highlightedTextarea.css +61 -0
- package/components/input/textarea/mentionsWithHighlighting.tsx +95 -0
- package/components/keyboard/keyboardUtils.ts +42 -0
- package/components/modal/draggableModalProvider.tsx +37 -0
- package/components/modal/impl/clamp.ts +4 -0
- package/components/modal/impl/draggableModal.tsx +36 -0
- package/components/modal/impl/draggableModalContext.ts +14 -0
- package/components/modal/impl/draggableModalInner.tsx +114 -0
- package/components/modal/impl/draggableModalReducer.ts +285 -0
- package/components/modal/impl/getWindowSize.ts +6 -0
- package/components/modal/impl/index.ts +5 -0
- package/components/modal/impl/resizeHandle.tsx +12 -0
- package/components/modal/impl/useDrag.ts +57 -0
- package/components/modal/impl/usePrevious.ts +11 -0
- package/components/modal/impl/useResize.ts +79 -0
- package/components/modal/modalDialog.tsx +172 -0
- package/components/picker/enumValuePicker.tsx +48 -0
- package/components/platformSpecific.ts +39 -0
- package/components/scrollTo/dom-scroll-into-view.d.ts +1 -0
- package/components/scrollTo/onlyText.ts +36 -0
- package/components/scrollTo/scrollTo.tsx +324 -0
- package/components/style/withCss.tsx +14 -0
- package/components/style/withInputNumberCss.tsx +18 -0
- package/components/svg.d.ts +1 -0
- package/components/table/dragSortingTable.tsx +123 -0
- package/components/text/impl/innerSize.ts +15 -0
- package/components/text/impl/series.ts +37 -0
- package/components/text/impl/shallowEqual.ts +19 -0
- package/components/text/impl/uniqueId.ts +5 -0
- package/components/text/impl/whilst.ts +25 -0
- package/components/text/textFit.tsx +229 -0
- package/i18n/components.cs.json +101 -101
- package/i18n/components.sk.json +101 -101
- package/i18n/components.uk.json +101 -101
- package/i18n/componentsLocaleHolder.js +24 -29
- package/i18n/componentsLocaleLoader.d.ts +9 -0
- package/lib/esm/components/color/colorSwatch.d.ts +13 -0
- package/lib/esm/components/grid/cell/rangeSelector.d.ts +78 -0
- package/lib/esm/components/grid/cell/rangeSelector.js +527 -0
- package/{components → lib/esm/components}/grid/export/contextMenu.js +4 -4
- package/lib/esm/components/input/draftail.d.ts +1 -0
- package/lib/esm/components/input/draftail.js +2 -0
- package/lib/esm/i18n/components.cs.json +101 -0
- package/lib/esm/i18n/components.sk.json +101 -0
- package/lib/esm/i18n/components.uk.json +101 -0
- package/lib/esm/i18n/componentsLocaleHolder.js +29 -0
- package/lib/esm/package.json +70 -0
- package/lib/esm/tsconfig.build.json +24 -0
- package/lib/esm/tsconfig.json +11 -0
- package/package.json +3 -3
- package/tsconfig.build.json +24 -24
- package/tsconfig.json +11 -11
- /package/{components → lib/esm/components}/clipboard/clipboardUtils.d.ts +0 -0
- /package/{components → lib/esm/components}/clipboard/clipboardUtils.js +0 -0
- /package/{components → lib/esm/components}/clipboard/clipboardUtils.js.map +0 -0
- /package/{components → lib/esm/components}/codemirror/SyntaxHighlighter.d.ts +0 -0
- /package/{components → lib/esm/components}/codemirror/SyntaxHighlighter.js +0 -0
- /package/{components → lib/esm/components}/codemirror/SyntaxHighlighter.js.map +0 -0
- /package/{components → lib/esm/components}/collapse/expandable.d.ts +0 -0
- /package/{components → lib/esm/components}/collapse/expandable.js +0 -0
- /package/{components → lib/esm/components}/collapse/expandable.js.map +0 -0
- /package/{components → lib/esm/components}/color/colorPicker.d.ts +0 -0
- /package/{components → lib/esm/components}/color/colorPicker.js +0 -0
- /package/{components → lib/esm/components}/color/colorPicker.js.map +0 -0
- /package/{components → lib/esm/components}/color/colorSwatch.js +0 -0
- /package/{components → lib/esm/components}/color/colorSwatch.js.map +0 -0
- /package/{components → lib/esm/components}/color/colorUtils.d.ts +0 -0
- /package/{components → lib/esm/components}/color/colorUtils.js +0 -0
- /package/{components → lib/esm/components}/color/colorUtils.js.map +0 -0
- /package/{components → lib/esm/components}/date/dateRangeInput.d.ts +0 -0
- /package/{components → lib/esm/components}/date/dateRangeInput.js +0 -0
- /package/{components → lib/esm/components}/date/dateRangeInput.js.map +0 -0
- /package/{components → lib/esm/components}/date/dateRangeInputAdvancedPanel.d.ts +0 -0
- /package/{components → lib/esm/components}/date/dateRangeInputAdvancedPanel.js +0 -0
- /package/{components → lib/esm/components}/date/dateRangeInputAdvancedPanel.js.map +0 -0
- /package/{components → lib/esm/components}/date/dateRangeInputConfirm.d.ts +0 -0
- /package/{components → lib/esm/components}/date/dateRangeInputConfirm.js +0 -0
- /package/{components → lib/esm/components}/date/dateRangeInputConfirm.js.map +0 -0
- /package/{components → lib/esm/components}/date/dateTimeInput.d.ts +0 -0
- /package/{components → lib/esm/components}/date/dateTimeInput.js +0 -0
- /package/{components → lib/esm/components}/date/dateTimeInput.js.map +0 -0
- /package/{components → lib/esm/components}/date/durationInput.d.ts +0 -0
- /package/{components → lib/esm/components}/date/durationInput.js +0 -0
- /package/{components → lib/esm/components}/date/durationInput.js.map +0 -0
- /package/{components → lib/esm/components}/form/NiceFormItem.d.ts +0 -0
- /package/{components → lib/esm/components}/form/NiceFormItem.js +0 -0
- /package/{components → lib/esm/components}/form/NiceFormItem.js.map +0 -0
- /package/{components → lib/esm/components}/grid/cell/beanAccessor.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/cell/beanAccessor.js +0 -0
- /package/{components → lib/esm/components}/grid/cell/beanAccessor.js.map +0 -0
- /package/{components → lib/esm/components}/grid/cell/cellEditorUtils.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/cell/cellEditorUtils.js +0 -0
- /package/{components → lib/esm/components}/grid/cell/cellEditorUtils.js.map +0 -0
- /package/{components → lib/esm/components}/grid/cell/customEnumCellEditor.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/cell/customEnumCellEditor.js +0 -0
- /package/{components → lib/esm/components}/grid/cell/customEnumCellEditor.js.map +0 -0
- /package/{components → lib/esm/components}/grid/cell/dataGridCellEditorComponent.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/cell/dataGridCellEditorComponent.js +0 -0
- /package/{components → lib/esm/components}/grid/cell/dataGridCellEditorComponent.js.map +0 -0
- /package/{components → lib/esm/components}/grid/cell/dateCellEditor.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/cell/dateCellEditor.js +0 -0
- /package/{components → lib/esm/components}/grid/cell/dateCellEditor.js.map +0 -0
- /package/{components → lib/esm/components}/grid/cell/durationCellEditor.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/cell/durationCellEditor.js +0 -0
- /package/{components → lib/esm/components}/grid/cell/durationCellEditor.js.map +0 -0
- /package/{components → lib/esm/components}/grid/cell/hexaOctetStringCellEditor.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/cell/hexaOctetStringCellEditor.js +0 -0
- /package/{components → lib/esm/components}/grid/cell/hexaOctetStringCellEditor.js.map +0 -0
- /package/{components → lib/esm/components}/grid/cell/hexaValueCellEditor.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/cell/hexaValueCellEditor.js +0 -0
- /package/{components → lib/esm/components}/grid/cell/hexaValueCellEditor.js.map +0 -0
- /package/{components → lib/esm/components}/grid/cell/numberCellEditor.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/cell/numberCellEditor.js +0 -0
- /package/{components → lib/esm/components}/grid/cell/numberCellEditor.js.map +0 -0
- /package/{components → lib/esm/components}/grid/cell/rangeSelector.js.map +0 -0
- /package/{components → lib/esm/components}/grid/cell/simpleStatusTextCellEditor.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/cell/simpleStatusTextCellEditor.js +0 -0
- /package/{components → lib/esm/components}/grid/cell/simpleStatusTextCellEditor.js.map +0 -0
- /package/{components → lib/esm/components}/grid/cell/statusTextCellEditor.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/cell/statusTextCellEditor.js +0 -0
- /package/{components → lib/esm/components}/grid/cell/statusTextCellEditor.js.map +0 -0
- /package/{components → lib/esm/components}/grid/cell/tableDefaultRowStyleRules.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/cell/tableDefaultRowStyleRules.js +0 -0
- /package/{components → lib/esm/components}/grid/cell/tableDefaultRowStyleRules.js.map +0 -0
- /package/{components → lib/esm/components}/grid/cell/textCellEditor.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/cell/textCellEditor.js +0 -0
- /package/{components → lib/esm/components}/grid/cell/textCellEditor.js.map +0 -0
- /package/{components → lib/esm/components}/grid/cell/withAgGridHooks.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/cell/withAgGridHooks.js +0 -0
- /package/{components → lib/esm/components}/grid/cell/withAgGridHooks.js.map +0 -0
- /package/{components → lib/esm/components}/grid/columnUtils.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/columnUtils.js +0 -0
- /package/{components → lib/esm/components}/grid/columnUtils.js.map +0 -0
- /package/{components → lib/esm/components}/grid/config/columnTransfer.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/config/columnTransfer.js +0 -0
- /package/{components → lib/esm/components}/grid/config/columnTransfer.js.map +0 -0
- /package/{components → lib/esm/components}/grid/config/dataGridEditor.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/config/dataGridEditor.js +0 -0
- /package/{components → lib/esm/components}/grid/config/dataGridEditor.js.map +0 -0
- /package/{components → lib/esm/components}/grid/config/rowHeightCalculator.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/config/rowHeightCalculator.js +0 -0
- /package/{components → lib/esm/components}/grid/config/rowHeightCalculator.js.map +0 -0
- /package/{components → lib/esm/components}/grid/config/rowStylePicker.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/config/rowStylePicker.js +0 -0
- /package/{components → lib/esm/components}/grid/config/rowStylePicker.js.map +0 -0
- /package/{components → lib/esm/components}/grid/dataGrid.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/dataGrid.js +0 -0
- /package/{components → lib/esm/components}/grid/dataGrid.js.map +0 -0
- /package/{components → lib/esm/components}/grid/detail/detailHeaderPanel.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/detail/detailHeaderPanel.js +0 -0
- /package/{components → lib/esm/components}/grid/detail/detailHeaderPanel.js.map +0 -0
- /package/{components → lib/esm/components}/grid/export/contextMenu.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/export/contextMenu.js.map +0 -0
- /package/{components → lib/esm/components}/grid/export/progressPopup.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/export/progressPopup.js +0 -0
- /package/{components → lib/esm/components}/grid/export/progressPopup.js.map +0 -0
- /package/{components → lib/esm/components}/grid/export/worker/clipboardExport.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/export/worker/clipboardExport.js +0 -0
- /package/{components → lib/esm/components}/grid/export/worker/clipboardExport.js.map +0 -0
- /package/{components → lib/esm/components}/grid/export/worker/csvExport.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/export/worker/csvExport.js +0 -0
- /package/{components → lib/esm/components}/grid/export/worker/csvExport.js.map +0 -0
- /package/{components → lib/esm/components}/grid/export/worker/pdfExport.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/export/worker/pdfExport.js +0 -0
- /package/{components → lib/esm/components}/grid/export/worker/pdfExport.js.map +0 -0
- /package/{components → lib/esm/components}/grid/export/worker/txtExport.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/export/worker/txtExport.js +0 -0
- /package/{components → lib/esm/components}/grid/export/worker/txtExport.js.map +0 -0
- /package/{components → lib/esm/components}/grid/extendedDataGrid.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/extendedDataGrid.js +0 -0
- /package/{components → lib/esm/components}/grid/extendedDataGrid.js.map +0 -0
- /package/{components → lib/esm/components}/grid/filter/customColumnFilter.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/filter/customColumnFilter.js +0 -0
- /package/{components → lib/esm/components}/grid/filter/customColumnFilter.js.map +0 -0
- /package/{components → lib/esm/components}/grid/filter/dataGridColumnFilter.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/filter/dataGridColumnFilter.js +0 -0
- /package/{components → lib/esm/components}/grid/filter/dataGridColumnFilter.js.map +0 -0
- /package/{components → lib/esm/components}/grid/filter/dateColumnFilter.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/filter/dateColumnFilter.js +0 -0
- /package/{components → lib/esm/components}/grid/filter/dateColumnFilter.js.map +0 -0
- /package/{components → lib/esm/components}/grid/filter/textColumnFilter.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/filter/textColumnFilter.js +0 -0
- /package/{components → lib/esm/components}/grid/filter/textColumnFilter.js.map +0 -0
- /package/{components → lib/esm/components}/grid/filter/wildcardQuickFilterEngine.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/filter/wildcardQuickFilterEngine.js +0 -0
- /package/{components → lib/esm/components}/grid/filter/wildcardQuickFilterEngine.js.map +0 -0
- /package/{components → lib/esm/components}/grid/header/simpleHeader.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/header/simpleHeader.js +0 -0
- /package/{components → lib/esm/components}/grid/header/simpleHeader.js.map +0 -0
- /package/{components → lib/esm/components}/grid/panel/dataGridPagination.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/panel/dataGridPagination.js +0 -0
- /package/{components → lib/esm/components}/grid/panel/dataGridPagination.js.map +0 -0
- /package/{components → lib/esm/components}/grid/panel/loadingOverlay.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/panel/loadingOverlay.js +0 -0
- /package/{components → lib/esm/components}/grid/panel/loadingOverlay.js.map +0 -0
- /package/{components → lib/esm/components}/grid/panel/noRecordsOverlay.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/panel/noRecordsOverlay.js +0 -0
- /package/{components → lib/esm/components}/grid/panel/noRecordsOverlay.js.map +0 -0
- /package/{components → lib/esm/components}/grid/panel/tablePagination.d.ts +0 -0
- /package/{components → lib/esm/components}/grid/panel/tablePagination.js +0 -0
- /package/{components → lib/esm/components}/grid/panel/tablePagination.js.map +0 -0
- /package/{components → lib/esm/components}/icons/dropdownArrow.d.ts +0 -0
- /package/{components → lib/esm/components}/icons/dropdownArrow.js +0 -0
- /package/{components → lib/esm/components}/icons/dropdownArrow.js.map +0 -0
- /package/{components → lib/esm/components}/icons/undoIcon.d.ts +0 -0
- /package/{components → lib/esm/components}/icons/undoIcon.js +0 -0
- /package/{components → lib/esm/components}/icons/undoIcon.js.map +0 -0
- /package/{components → lib/esm/components}/input/autoCompleteInput.d.ts +0 -0
- /package/{components → lib/esm/components}/input/autoCompleteInput.js +0 -0
- /package/{components → lib/esm/components}/input/autoCompleteInput.js.map +0 -0
- /package/{components → lib/esm/components}/input/draftUtils.d.ts +0 -0
- /package/{components → lib/esm/components}/input/draftUtils.js +0 -0
- /package/{components → lib/esm/components}/input/draftUtils.js.map +0 -0
- /package/{components → lib/esm/components}/input/draftail.js.map +0 -0
- /package/{components → lib/esm/components}/input/hexaFormattedInput.d.ts +0 -0
- /package/{components → lib/esm/components}/input/hexaFormattedInput.js +0 -0
- /package/{components → lib/esm/components}/input/hexaFormattedInput.js.map +0 -0
- /package/{components → lib/esm/components}/input/mask/helpers.d.ts +0 -0
- /package/{components → lib/esm/components}/input/mask/helpers.js +0 -0
- /package/{components → lib/esm/components}/input/mask/helpers.js.map +0 -0
- /package/{components → lib/esm/components}/input/mask/inputMaskCore.d.ts +0 -0
- /package/{components → lib/esm/components}/input/mask/inputMaskCore.js +0 -0
- /package/{components → lib/esm/components}/input/mask/inputMaskCore.js.map +0 -0
- /package/{components → lib/esm/components}/input/mask/pattern.d.ts +0 -0
- /package/{components → lib/esm/components}/input/mask/pattern.js +0 -0
- /package/{components → lib/esm/components}/input/mask/pattern.js.map +0 -0
- /package/{components → lib/esm/components}/input/maskedInput.d.ts +0 -0
- /package/{components → lib/esm/components}/input/maskedInput.js +0 -0
- /package/{components → lib/esm/components}/input/maskedInput.js.map +0 -0
- /package/{components → lib/esm/components}/input/passwordInput.d.ts +0 -0
- /package/{components → lib/esm/components}/input/passwordInput.js +0 -0
- /package/{components → lib/esm/components}/input/passwordInput.js.map +0 -0
- /package/{components → lib/esm/components}/input/simpleAutoComplete.d.ts +0 -0
- /package/{components → lib/esm/components}/input/simpleAutoComplete.js +0 -0
- /package/{components → lib/esm/components}/input/simpleAutoComplete.js.map +0 -0
- /package/{components → lib/esm/components}/input/textarea/extractSpansOfClasses.d.ts +0 -0
- /package/{components → lib/esm/components}/input/textarea/extractSpansOfClasses.js +0 -0
- /package/{components → lib/esm/components}/input/textarea/extractSpansOfClasses.js.map +0 -0
- /package/{components → lib/esm/components}/input/textarea/getRanges.d.ts +0 -0
- /package/{components → lib/esm/components}/input/textarea/getRanges.js +0 -0
- /package/{components → lib/esm/components}/input/textarea/getRanges.js.map +0 -0
- /package/{components → lib/esm/components}/input/textarea/getType.d.ts +0 -0
- /package/{components → lib/esm/components}/input/textarea/getType.js +0 -0
- /package/{components → lib/esm/components}/input/textarea/getType.js.map +0 -0
- /package/{components → lib/esm/components}/input/textarea/highlighedContents.d.ts +0 -0
- /package/{components → lib/esm/components}/input/textarea/highlighedContents.js +0 -0
- /package/{components → lib/esm/components}/input/textarea/highlighedContents.js.map +0 -0
- /package/{components → lib/esm/components}/input/textarea/mentionsWithHighlighting.d.ts +0 -0
- /package/{components → lib/esm/components}/input/textarea/mentionsWithHighlighting.js +0 -0
- /package/{components → lib/esm/components}/input/textarea/mentionsWithHighlighting.js.map +0 -0
- /package/{components → lib/esm/components}/keyboard/keyboardUtils.d.ts +0 -0
- /package/{components → lib/esm/components}/keyboard/keyboardUtils.js +0 -0
- /package/{components → lib/esm/components}/keyboard/keyboardUtils.js.map +0 -0
- /package/{components → lib/esm/components}/modal/draggableModalProvider.d.ts +0 -0
- /package/{components → lib/esm/components}/modal/draggableModalProvider.js +0 -0
- /package/{components → lib/esm/components}/modal/draggableModalProvider.js.map +0 -0
- /package/{components → lib/esm/components}/modal/impl/clamp.d.ts +0 -0
- /package/{components → lib/esm/components}/modal/impl/clamp.js +0 -0
- /package/{components → lib/esm/components}/modal/impl/clamp.js.map +0 -0
- /package/{components → lib/esm/components}/modal/impl/draggableModal.d.ts +0 -0
- /package/{components → lib/esm/components}/modal/impl/draggableModal.js +0 -0
- /package/{components → lib/esm/components}/modal/impl/draggableModal.js.map +0 -0
- /package/{components → lib/esm/components}/modal/impl/draggableModalContext.d.ts +0 -0
- /package/{components → lib/esm/components}/modal/impl/draggableModalContext.js +0 -0
- /package/{components → lib/esm/components}/modal/impl/draggableModalContext.js.map +0 -0
- /package/{components → lib/esm/components}/modal/impl/draggableModalInner.d.ts +0 -0
- /package/{components → lib/esm/components}/modal/impl/draggableModalInner.js +0 -0
- /package/{components → lib/esm/components}/modal/impl/draggableModalInner.js.map +0 -0
- /package/{components → lib/esm/components}/modal/impl/draggableModalReducer.d.ts +0 -0
- /package/{components → lib/esm/components}/modal/impl/draggableModalReducer.js +0 -0
- /package/{components → lib/esm/components}/modal/impl/draggableModalReducer.js.map +0 -0
- /package/{components → lib/esm/components}/modal/impl/getWindowSize.d.ts +0 -0
- /package/{components → lib/esm/components}/modal/impl/getWindowSize.js +0 -0
- /package/{components → lib/esm/components}/modal/impl/getWindowSize.js.map +0 -0
- /package/{components → lib/esm/components}/modal/impl/index.d.ts +0 -0
- /package/{components → lib/esm/components}/modal/impl/index.js +0 -0
- /package/{components → lib/esm/components}/modal/impl/index.js.map +0 -0
- /package/{components → lib/esm/components}/modal/impl/resizeHandle.d.ts +0 -0
- /package/{components → lib/esm/components}/modal/impl/resizeHandle.js +0 -0
- /package/{components → lib/esm/components}/modal/impl/resizeHandle.js.map +0 -0
- /package/{components → lib/esm/components}/modal/impl/useDrag.d.ts +0 -0
- /package/{components → lib/esm/components}/modal/impl/useDrag.js +0 -0
- /package/{components → lib/esm/components}/modal/impl/useDrag.js.map +0 -0
- /package/{components → lib/esm/components}/modal/impl/usePrevious.d.ts +0 -0
- /package/{components → lib/esm/components}/modal/impl/usePrevious.js +0 -0
- /package/{components → lib/esm/components}/modal/impl/usePrevious.js.map +0 -0
- /package/{components → lib/esm/components}/modal/impl/useResize.d.ts +0 -0
- /package/{components → lib/esm/components}/modal/impl/useResize.js +0 -0
- /package/{components → lib/esm/components}/modal/impl/useResize.js.map +0 -0
- /package/{components → lib/esm/components}/modal/modalDialog.d.ts +0 -0
- /package/{components → lib/esm/components}/modal/modalDialog.js +0 -0
- /package/{components → lib/esm/components}/modal/modalDialog.js.map +0 -0
- /package/{components → lib/esm/components}/picker/enumValuePicker.d.ts +0 -0
- /package/{components → lib/esm/components}/picker/enumValuePicker.js +0 -0
- /package/{components → lib/esm/components}/picker/enumValuePicker.js.map +0 -0
- /package/{components → lib/esm/components}/platformSpecific.d.ts +0 -0
- /package/{components → lib/esm/components}/platformSpecific.js +0 -0
- /package/{components → lib/esm/components}/platformSpecific.js.map +0 -0
- /package/{components → lib/esm/components}/scrollTo/onlyText.d.ts +0 -0
- /package/{components → lib/esm/components}/scrollTo/onlyText.js +0 -0
- /package/{components → lib/esm/components}/scrollTo/onlyText.js.map +0 -0
- /package/{components → lib/esm/components}/scrollTo/scrollTo.d.ts +0 -0
- /package/{components → lib/esm/components}/scrollTo/scrollTo.js +0 -0
- /package/{components → lib/esm/components}/scrollTo/scrollTo.js.map +0 -0
- /package/{components → lib/esm/components}/style/withCss.d.ts +0 -0
- /package/{components → lib/esm/components}/style/withCss.js +0 -0
- /package/{components → lib/esm/components}/style/withCss.js.map +0 -0
- /package/{components → lib/esm/components}/style/withInputNumberCss.d.ts +0 -0
- /package/{components → lib/esm/components}/style/withInputNumberCss.js +0 -0
- /package/{components → lib/esm/components}/style/withInputNumberCss.js.map +0 -0
- /package/{components → lib/esm/components}/table/dragSortingTable.d.ts +0 -0
- /package/{components → lib/esm/components}/table/dragSortingTable.js +0 -0
- /package/{components → lib/esm/components}/table/dragSortingTable.js.map +0 -0
- /package/{components → lib/esm/components}/text/impl/innerSize.d.ts +0 -0
- /package/{components → lib/esm/components}/text/impl/innerSize.js +0 -0
- /package/{components → lib/esm/components}/text/impl/innerSize.js.map +0 -0
- /package/{components → lib/esm/components}/text/impl/series.d.ts +0 -0
- /package/{components → lib/esm/components}/text/impl/series.js +0 -0
- /package/{components → lib/esm/components}/text/impl/series.js.map +0 -0
- /package/{components → lib/esm/components}/text/impl/shallowEqual.d.ts +0 -0
- /package/{components → lib/esm/components}/text/impl/shallowEqual.js +0 -0
- /package/{components → lib/esm/components}/text/impl/shallowEqual.js.map +0 -0
- /package/{components → lib/esm/components}/text/impl/uniqueId.d.ts +0 -0
- /package/{components → lib/esm/components}/text/impl/uniqueId.js +0 -0
- /package/{components → lib/esm/components}/text/impl/uniqueId.js.map +0 -0
- /package/{components → lib/esm/components}/text/impl/whilst.d.ts +0 -0
- /package/{components → lib/esm/components}/text/impl/whilst.js +0 -0
- /package/{components → lib/esm/components}/text/impl/whilst.js.map +0 -0
- /package/{components → lib/esm/components}/text/textFit.d.ts +0 -0
- /package/{components → lib/esm/components}/text/textFit.js +0 -0
- /package/{components → lib/esm/components}/text/textFit.js.map +0 -0
- /package/{i18n → lib/esm/i18n}/componentsLocaleHolder.d.ts +0 -0
- /package/{i18n → lib/esm/i18n}/componentsLocaleHolder.js.map +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {CheckOutlined} from "@ant-design/icons";
|
|
3
|
+
import {Button, InputNumber, Pagination, Popover, Space} from "antd";
|
|
4
|
+
import i18n from "d2core/i18n/i18n";
|
|
5
|
+
import {PaginationProps} from "antd/es/pagination";
|
|
6
|
+
|
|
7
|
+
interface PaginationComponentState {
|
|
8
|
+
gotoPageNumber?: number | null
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default class PaginationComponent extends React.Component<PaginationProps, PaginationComponentState> {
|
|
12
|
+
constructor(props: Readonly<PaginationProps>) {
|
|
13
|
+
super(props);
|
|
14
|
+
this.state = {
|
|
15
|
+
gotoPageNumber: null
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
render() {
|
|
20
|
+
const pageCount = this.props.total && this.props.pageSize ? Math.ceil(this.props.total / this.props.pageSize) : 1;
|
|
21
|
+
return (
|
|
22
|
+
<div>
|
|
23
|
+
<Pagination
|
|
24
|
+
showSizeChanger={false}
|
|
25
|
+
{...this.props}
|
|
26
|
+
itemRender={(page, type, originalElement) => {
|
|
27
|
+
if (page === this.props.current && type === "page") {
|
|
28
|
+
return (
|
|
29
|
+
<Popover
|
|
30
|
+
title=""
|
|
31
|
+
placement="bottom"
|
|
32
|
+
content={
|
|
33
|
+
<Space.Compact>
|
|
34
|
+
<InputNumber min={1} max={pageCount}
|
|
35
|
+
value={this.state.gotoPageNumber ? this.state.gotoPageNumber : this.props.current}
|
|
36
|
+
onChange={(newValue) => {
|
|
37
|
+
if (typeof newValue === "number") {
|
|
38
|
+
this.setState({gotoPageNumber: newValue});
|
|
39
|
+
}
|
|
40
|
+
}}
|
|
41
|
+
onKeyDown={(e) => {
|
|
42
|
+
if (e.code === "Enter") {
|
|
43
|
+
if (this.state.gotoPageNumber && this.props.onChange) {
|
|
44
|
+
this.props.onChange(this.state.gotoPageNumber, this.props.pageSize!);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}}
|
|
48
|
+
/>
|
|
49
|
+
<Button title={i18n("Goto Page")} type="primary" onClick={() => {
|
|
50
|
+
if (this.state.gotoPageNumber && this.props.onChange) {
|
|
51
|
+
this.props.onChange(this.state.gotoPageNumber, this.props.pageSize!);
|
|
52
|
+
}
|
|
53
|
+
}}>
|
|
54
|
+
<CheckOutlined/>
|
|
55
|
+
</Button>
|
|
56
|
+
</Space.Compact>
|
|
57
|
+
}
|
|
58
|
+
trigger="hover"
|
|
59
|
+
onOpenChange={(visible) => {
|
|
60
|
+
if (!visible) {
|
|
61
|
+
this.setState({gotoPageNumber: null});
|
|
62
|
+
}
|
|
63
|
+
}}
|
|
64
|
+
overlayClassName="control-panel-popover"
|
|
65
|
+
>
|
|
66
|
+
{originalElement}
|
|
67
|
+
</Popover>
|
|
68
|
+
);
|
|
69
|
+
} else {
|
|
70
|
+
return originalElement;
|
|
71
|
+
}
|
|
72
|
+
}}
|
|
73
|
+
/>
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {createStyles} from "antd-style";
|
|
3
|
+
import {DownOutlined} from "@ant-design/icons";
|
|
4
|
+
import WithCss from "d2coreui/components/style/withCss";
|
|
5
|
+
import {AntdIconProps} from "@ant-design/icons/lib/components/AntdIcon";
|
|
6
|
+
|
|
7
|
+
// @ts-ignore
|
|
8
|
+
const useStyles = createStyles(({token, css, cx}) => {
|
|
9
|
+
return {
|
|
10
|
+
dropdownArrow: css`
|
|
11
|
+
transform-origin: 50% 50%;
|
|
12
|
+
margin-left: ${token.controlPaddingHorizontalSM}px;
|
|
13
|
+
`,
|
|
14
|
+
|
|
15
|
+
dropdownArrowIcon: css`
|
|
16
|
+
color: ${token.colorTextDisabled};
|
|
17
|
+
font-size: ${token.fontSizeSM}px;
|
|
18
|
+
vertical-align: center;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
transition: color 0.3s;
|
|
21
|
+
|
|
22
|
+
&:hover {
|
|
23
|
+
color: ${token.colorTextSecondary};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:active {
|
|
27
|
+
color: ${token.colorText};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
+ i {
|
|
31
|
+
margin-left: 6px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
svg {
|
|
35
|
+
transition: transform 0.3s;
|
|
36
|
+
}
|
|
37
|
+
`,
|
|
38
|
+
|
|
39
|
+
dropdownArrowIconOpen: css`
|
|
40
|
+
svg {
|
|
41
|
+
transform: rotate(180deg);
|
|
42
|
+
}
|
|
43
|
+
`
|
|
44
|
+
};
|
|
45
|
+
}, {label: "dropdownArrow"});
|
|
46
|
+
|
|
47
|
+
export interface DropdownArrowProps extends AntdIconProps {
|
|
48
|
+
opened?: boolean
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default class DropdownArrow extends React.PureComponent<DropdownArrowProps> {
|
|
52
|
+
render() {
|
|
53
|
+
const {opened, ...restProps} = this.props;
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<WithCss useStyles={useStyles}>{
|
|
57
|
+
(css) =>
|
|
58
|
+
<span className={css.styles.dropdownArrow}>
|
|
59
|
+
<DownOutlined {...restProps}
|
|
60
|
+
className={opened ? css.cx(css.styles.dropdownArrowIcon, css.styles.dropdownArrowIconOpen) : css.styles.dropdownArrowIcon}
|
|
61
|
+
role="button" tabIndex={-1}
|
|
62
|
+
/>
|
|
63
|
+
</span>
|
|
64
|
+
}</WithCss>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, {CSSProperties} from "react";
|
|
2
|
+
import Icon from "@ant-design/icons/es/components/Icon";
|
|
3
|
+
|
|
4
|
+
const UndoIcon = (props: { style?: CSSProperties }) => (
|
|
5
|
+
<Icon component={() => <svg preserveAspectRatio="xMidYMid meet" viewBox="0 0 14 14" width={14} height={14}
|
|
6
|
+
style={props.style}>
|
|
7
|
+
<path
|
|
8
|
+
d="m 8.327691,3.3283097 c 2.800837,0 5.07135,2.3743226 5.07135,5.303197 0,2.9288733 -2.270513,5.3031963 -5.07135,5.3031963 H 4.946796 v -0.883866 h 3.380895 c 2.334032,0 4.226127,-1.978602 4.226127,-4.4193303 0,-2.4407292 -1.892095,-4.4193308 -4.226127,-4.4193308 H 2.338436 L 4.904535,6.8955935 4.306962,7.5204869 0.720677,3.7702428 4.306962,0.01999879 4.904535,0.64489216 2.338436,3.3283097 Z"
|
|
9
|
+
style={{display: "inline", fill: "currentColor"}}/>
|
|
10
|
+
</svg>}/>);
|
|
11
|
+
|
|
12
|
+
const UndoMenuIcon = (props: { style?: CSSProperties }) => (
|
|
13
|
+
<UndoIcon style={Object.assign({marginRight: 6, width: 12, height: 12}, props.style)}/>
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
export {UndoIcon, UndoMenuIcon};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import {AutoComplete, Input} from "antd";
|
|
3
|
+
import {AutoCompleteProps} from "antd/es/auto-complete";
|
|
4
|
+
import {DefaultOptionType, RefSelectProps} from "antd/es/select";
|
|
5
|
+
import {Key} from "ts-key-enum";
|
|
6
|
+
import DropdownArrow from "../icons/dropdownArrow";
|
|
7
|
+
|
|
8
|
+
interface InputSearchWithHistoryProps extends Omit<AutoCompleteProps, "onChange" | "onSearch" | "placeholder" | "options"> {
|
|
9
|
+
value?: string
|
|
10
|
+
|
|
11
|
+
options?: string[]
|
|
12
|
+
|
|
13
|
+
placeholder?: string
|
|
14
|
+
|
|
15
|
+
prefix?: React.ReactNode
|
|
16
|
+
|
|
17
|
+
onChange(searchString: string): void
|
|
18
|
+
|
|
19
|
+
onSearch(): void
|
|
20
|
+
|
|
21
|
+
onPressEnter?(): void
|
|
22
|
+
|
|
23
|
+
stringFormatter?(rawString: string): string
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface InputSearchWithHistoryState {
|
|
27
|
+
opened: boolean
|
|
28
|
+
loading: boolean
|
|
29
|
+
searchString?: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default class AutoCompleteInput extends React.Component<InputSearchWithHistoryProps, InputSearchWithHistoryState> {
|
|
33
|
+
static get defaultProps() {
|
|
34
|
+
return {
|
|
35
|
+
onSearch: () => {
|
|
36
|
+
},
|
|
37
|
+
onChange: () => {
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
private autocomplete: React.RefObject<RefSelectProps>;
|
|
43
|
+
|
|
44
|
+
constructor(props: Readonly<InputSearchWithHistoryProps>) {
|
|
45
|
+
super(props);
|
|
46
|
+
this.state = {
|
|
47
|
+
opened: false,
|
|
48
|
+
loading: false,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
this.autocomplete = React.createRef();
|
|
52
|
+
this.focus = this.focus.bind(this);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
focus() {
|
|
56
|
+
this.autocomplete.current?.focus();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Handling setting search string from parent component
|
|
61
|
+
*/
|
|
62
|
+
static getDerivedStateFromProps(props: InputSearchWithHistoryProps, state: InputSearchWithHistoryState): Partial<InputSearchWithHistoryState> {
|
|
63
|
+
const newState: Partial<InputSearchWithHistoryState> = {};
|
|
64
|
+
if (props.value !== state.searchString) {
|
|
65
|
+
newState.searchString = props.value;
|
|
66
|
+
}
|
|
67
|
+
return newState;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
setSearchString(searchString: string) {
|
|
71
|
+
if(this.props.stringFormatter) {
|
|
72
|
+
if (searchString.indexOf("ðð") < 0 && this.props.options && this.props.options.length > 0) {
|
|
73
|
+
for (let i = 0; i < this.props.options.length; i++) {
|
|
74
|
+
if (searchString === this.props.stringFormatter(this.props.options[i])) {
|
|
75
|
+
searchString = this.props.options[i];
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (this.state.searchString !== searchString) {
|
|
81
|
+
this.setState({opened: false, searchString: searchString}, () => {
|
|
82
|
+
this.props.onChange(searchString);
|
|
83
|
+
});
|
|
84
|
+
} else {
|
|
85
|
+
this.setState({opened: false});
|
|
86
|
+
}
|
|
87
|
+
} else {
|
|
88
|
+
this.setState({opened: false, searchString: searchString});
|
|
89
|
+
this.props.onChange(searchString);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
getAutocompleteOptions(): DefaultOptionType[] {
|
|
94
|
+
const autocompleteData = [];
|
|
95
|
+
if (this.props.options && this.props.options.length > 0) {
|
|
96
|
+
autocompleteData.push(...this.props.options);
|
|
97
|
+
}
|
|
98
|
+
return autocompleteData.filter((e) => !!e).map((e) => {
|
|
99
|
+
return ({
|
|
100
|
+
value: "" + (this.props.stringFormatter ? this.props.stringFormatter(e) : e),
|
|
101
|
+
label: "" + (this.props.stringFormatter ? this.props.stringFormatter(e) : e)
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Handling search confirmation by pressing enter
|
|
108
|
+
*/
|
|
109
|
+
onSearch() {
|
|
110
|
+
this.props.onSearch();
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
onSelect(searchString: string) {
|
|
114
|
+
this.setSearchString(searchString);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
render() {
|
|
118
|
+
let {disabled, stringFormatter, onChange, onSearch, placeholder, onPressEnter, options, value, size, ...rest} = this.props;
|
|
119
|
+
const searchHistoryPresent = this.props.options && this.props.options.length > 0;
|
|
120
|
+
return (
|
|
121
|
+
<AutoComplete
|
|
122
|
+
options={this.state.opened ? this.getAutocompleteOptions() : []}
|
|
123
|
+
style={{width: 200}}
|
|
124
|
+
value={this.state.searchString && stringFormatter ? stringFormatter(this.state.searchString) : this.state.searchString}
|
|
125
|
+
defaultOpen={false}
|
|
126
|
+
defaultActiveFirstOption={false}
|
|
127
|
+
onChange={(searchString) => {
|
|
128
|
+
if (typeof searchString === "string") {
|
|
129
|
+
this.setSearchString(searchString as string);
|
|
130
|
+
}
|
|
131
|
+
}}
|
|
132
|
+
onSelect={(searchString) => {
|
|
133
|
+
if (typeof searchString === "string") {
|
|
134
|
+
this.onSelect(searchString as string);
|
|
135
|
+
}
|
|
136
|
+
}}
|
|
137
|
+
onBlur={() => {
|
|
138
|
+
this.setState({opened: false});
|
|
139
|
+
}}
|
|
140
|
+
{...rest}
|
|
141
|
+
disabled={disabled || this.state.loading}
|
|
142
|
+
>
|
|
143
|
+
<Input
|
|
144
|
+
size={size}
|
|
145
|
+
allowClear={!disabled}
|
|
146
|
+
onKeyDown={(e) => {
|
|
147
|
+
if (!this.state.opened && e.key === Key.ArrowDown) {
|
|
148
|
+
this.setState({opened: true});
|
|
149
|
+
} else if (e.key === Key.Escape) {
|
|
150
|
+
this.setState({opened: false});
|
|
151
|
+
} else if (this.state.opened && e.key === Key.Enter) {
|
|
152
|
+
this.setState({opened: false});
|
|
153
|
+
this.onSearch();
|
|
154
|
+
} else if (!this.state.opened && e.key === Key.Enter) {
|
|
155
|
+
this.onSearch();
|
|
156
|
+
}
|
|
157
|
+
}}
|
|
158
|
+
placeholder={placeholder}
|
|
159
|
+
prefix={this.props.prefix}
|
|
160
|
+
suffix={
|
|
161
|
+
searchHistoryPresent &&
|
|
162
|
+
<DropdownArrow opened={this.state.opened}
|
|
163
|
+
onClick={() => {
|
|
164
|
+
if (!this.props.disabled && !this.state.loading) {
|
|
165
|
+
this.setState({opened: !this.state.opened});
|
|
166
|
+
}
|
|
167
|
+
}}/>
|
|
168
|
+
}
|
|
169
|
+
disabled={disabled || this.state.loading}
|
|
170
|
+
onPressEnter={this.state.opened ? undefined : onPressEnter}/>
|
|
171
|
+
</AutoComplete>
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import {convertFromRaw, DraftInlineStyleType, RawDraftContentState} from "draft-js"
|
|
2
|
+
import {convertToHTML, IConvertToHTMLConfig} from "draft-convert"
|
|
3
|
+
import {BLOCK_TYPE, ENTITY_TYPE} from "./draftail"
|
|
4
|
+
import React from "react";
|
|
5
|
+
|
|
6
|
+
const exporterConfig: IConvertToHTMLConfig = {
|
|
7
|
+
styleToHTML: (style: DraftInlineStyleType) => {
|
|
8
|
+
if ((style as string)=== 'MARK') {
|
|
9
|
+
return <span className={"marked-message-content"} />;
|
|
10
|
+
}
|
|
11
|
+
style;
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
return;
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
blockToHTML: (block) => {
|
|
17
|
+
if ((block as any).type === BLOCK_TYPE.BLOCKQUOTE) {
|
|
18
|
+
return <blockquote/>
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Discard atomic blocks, as they get converted based on their entity.
|
|
22
|
+
if ((block as any).type === BLOCK_TYPE.ATOMIC) {
|
|
23
|
+
return {
|
|
24
|
+
start: "",
|
|
25
|
+
end: "",
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return null
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
entityToHTML: (entity, originalText) => {
|
|
33
|
+
if (entity.type === ENTITY_TYPE.LINK) {
|
|
34
|
+
return <a href={entity.data.url}>{originalText}</a>
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (entity.type === ENTITY_TYPE.IMAGE) {
|
|
38
|
+
return <img src={entity.data.src} alt={entity.data.alt}/>
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (entity.type === ENTITY_TYPE.HORIZONTAL_RULE) {
|
|
42
|
+
return <hr/>
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return originalText
|
|
46
|
+
},
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
const conversionFunction = convertToHTML(exporterConfig);
|
|
51
|
+
|
|
52
|
+
export default class DraftUtils {
|
|
53
|
+
|
|
54
|
+
static toHTML(raw: RawDraftContentState): string {
|
|
55
|
+
if (raw) {
|
|
56
|
+
return conversionFunction(convertFromRaw(raw));
|
|
57
|
+
} else {
|
|
58
|
+
return "";
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
}
|
|
@@ -1 +1,186 @@
|
|
|
1
|
-
|
|
1
|
+
import * as CSS from 'csstype'
|
|
2
|
+
import * as Draft from 'draft-js'
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
|
|
5
|
+
export = Draftail
|
|
6
|
+
export as namespace Draftail
|
|
7
|
+
|
|
8
|
+
declare namespace Draftail {
|
|
9
|
+
interface DraftailEditorProps {
|
|
10
|
+
// Initial content of the editor. Use this to edit pre-existing content.
|
|
11
|
+
rawContentState?: Draft.RawDraftContentState
|
|
12
|
+
// Called when changes occured. Use this to persist editor content.
|
|
13
|
+
onSave?: (contentState: Draft.RawDraftContentState) => void
|
|
14
|
+
|
|
15
|
+
editorState?: Draft.EditorState
|
|
16
|
+
onChange?: (contentState: Draft.EditorState) => void
|
|
17
|
+
// Displayed when the editor is empty. Hidden if the user changes styling.
|
|
18
|
+
placeholder?: string
|
|
19
|
+
// Enable the use of horizontal rules in the editor. [Default: false]
|
|
20
|
+
enableHorizontalRule?: boolean
|
|
21
|
+
// Enable the use of line breaks in the editor. [Default: false]
|
|
22
|
+
enableLineBreak?: boolean
|
|
23
|
+
// Show undo control in the toolbar. [Default: false]
|
|
24
|
+
showUndoControl?: boolean
|
|
25
|
+
// Show redo control in the toolbar. [Default: false]
|
|
26
|
+
showRedoControl?: boolean
|
|
27
|
+
// Disable copy/paste of rich text in the editor. [Default: true]
|
|
28
|
+
stripPastedStyles?: boolean
|
|
29
|
+
// Set whether spellcheck is turned on for your editor. [Default: false]
|
|
30
|
+
// See https://draftjs.org/docs/api-reference-editor.html#spellcheck.
|
|
31
|
+
spellCheck?: boolean
|
|
32
|
+
// Set whether the editor should be rendered in readOnly mode.
|
|
33
|
+
// See https://draftjs.org/docs/api-reference-editor.html#readonly
|
|
34
|
+
readOnly?: boolean,
|
|
35
|
+
// Optionally set the overriding text alignment for this editor.
|
|
36
|
+
// See https://draftjs.org/docs/api-reference-editor.html#textalignment.
|
|
37
|
+
textAlignment?: any
|
|
38
|
+
// Optionally set the overriding text directionality for this editor.
|
|
39
|
+
// See https://draftjs.org/docs/api-reference-editor.html#textdirectionality.
|
|
40
|
+
textDirectionality?: any
|
|
41
|
+
// Set if auto capitalization is turned on and how it behaves.
|
|
42
|
+
// See https://draftjs.org/docs/api-reference-editor.html#autocapitalize-string.
|
|
43
|
+
autoCapitalize?: any
|
|
44
|
+
// Set if auto complete is turned on and how it behaves.
|
|
45
|
+
// See https://draftjs.org/docs/api-reference-editor.html#autocomplete-string.
|
|
46
|
+
autoComplete?: any
|
|
47
|
+
// Set if auto correct is turned on and how it behaves.
|
|
48
|
+
// See https://draftjs.org/docs/api-reference-editor.html#autocorrect-string.
|
|
49
|
+
autoCorrect?: any
|
|
50
|
+
// See https://draftjs.org/docs/api-reference-editor.html#aria-props.
|
|
51
|
+
ariaDescribedBy?: any
|
|
52
|
+
// List of the available block types.
|
|
53
|
+
blockTypes?: Array<any>
|
|
54
|
+
// List of the available inline styles.
|
|
55
|
+
inlineStyles?: Array<any>
|
|
56
|
+
// List of the available entity types.
|
|
57
|
+
entityTypes?: Array<any>
|
|
58
|
+
// List of active decorators.
|
|
59
|
+
decorators?: Array<any>
|
|
60
|
+
// Additional React components to render in the toolbar.
|
|
61
|
+
controls?: Array<any>
|
|
62
|
+
// Max level of nesting for list items. 0 = no nesting. Maximum = 10. [Default: 1]
|
|
63
|
+
maxListNesting?: number
|
|
64
|
+
// Frequency at which to call the save callback (ms). [Default: 250]
|
|
65
|
+
stateSaveInterval?: number
|
|
66
|
+
topToolbar: any
|
|
67
|
+
bottomToolbar: any
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export class DraftailEditor extends React.Component<DraftailEditorProps> {
|
|
71
|
+
focus(): void
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function createEditorStateFromRaw(rawContentState?: Draft.RawDraftContentState): Draft.EditorState
|
|
75
|
+
|
|
76
|
+
export function serialiseEditorStateToRaw(editorState: Draft.EditorState): Draft.RawDraftContentState
|
|
77
|
+
|
|
78
|
+
interface InlineStyle {
|
|
79
|
+
// Unique type shared between inline style instances.
|
|
80
|
+
type: string
|
|
81
|
+
// Describes the inline style in the editor UI, concisely.
|
|
82
|
+
label?: string
|
|
83
|
+
// Describes the inline style in the editor UI.
|
|
84
|
+
description?: string
|
|
85
|
+
// Represents the inline style in the editor UI.
|
|
86
|
+
icon: any
|
|
87
|
+
// CSS properties (in JS format) to apply for styling within the editor area.
|
|
88
|
+
style: CSS.Properties<string | number>
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
interface BlockType {
|
|
92
|
+
// Unique type shared between block instances.
|
|
93
|
+
type: string
|
|
94
|
+
// Describes the block in the editor UI, concisely.
|
|
95
|
+
label?: string
|
|
96
|
+
// Describes the block in the editor UI.
|
|
97
|
+
description?: string
|
|
98
|
+
// Represents the block in the editor UI.
|
|
99
|
+
icon?: any
|
|
100
|
+
// DOM element used to display the block within the editor area.
|
|
101
|
+
element?: string
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
interface EntityType {
|
|
105
|
+
// Unique type shared between entity instances.
|
|
106
|
+
type: string
|
|
107
|
+
// Describes the entity in the editor UI, concisely.
|
|
108
|
+
label?: string
|
|
109
|
+
// Describes the entity in the editor UI.
|
|
110
|
+
description?: string
|
|
111
|
+
// Represents the entity in the editor UI.
|
|
112
|
+
icon: any
|
|
113
|
+
// React component providing the UI to manage entities of this type.
|
|
114
|
+
source: React.Component
|
|
115
|
+
// React component to display inline entities.
|
|
116
|
+
decorator?: React.Component
|
|
117
|
+
// React component to display block-level entities.
|
|
118
|
+
block?: React.Component
|
|
119
|
+
// Array of attributes the entity uses, to preserve when filtering entities on paste.
|
|
120
|
+
// If undefined, all entity data is preserved.
|
|
121
|
+
attributes?: Array<string>
|
|
122
|
+
// Attribute - regex mapping, to whitelist entities based on their data on paste.
|
|
123
|
+
// For example, { url: '^https:' } will only preserve links that point to HTTPS URLs.
|
|
124
|
+
whitelist: { [key: string]: string }
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
interface Decorator {
|
|
128
|
+
// Determines which pieces of content are to be decorated.
|
|
129
|
+
strategy?: () => void
|
|
130
|
+
// React component to display the decoration.
|
|
131
|
+
component?: React.Component
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
interface Control {
|
|
135
|
+
// Retrieve the full Draft.js EditorState.
|
|
136
|
+
getEditorState?: () => void
|
|
137
|
+
// Change any part of the EditorState.
|
|
138
|
+
onChange?: () => void
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// See https://github.com/facebook/draft-js/blob/master/src/model/immutable/DefaultDraftInlineStyle.js
|
|
142
|
+
export const INLINE_STYLE: {
|
|
143
|
+
BOLD: 'BOLD'
|
|
144
|
+
ITALIC: 'ITALIC'
|
|
145
|
+
CODE: 'CODE'
|
|
146
|
+
UNDERLINE: 'UNDERLINE'
|
|
147
|
+
STRIKETHROUGH: 'STRIKETHROUGH'
|
|
148
|
+
MARK: 'MARK'
|
|
149
|
+
QUOTATION: 'QUOTATION'
|
|
150
|
+
SMALL: 'SMALL'
|
|
151
|
+
SAMPLE: 'SAMPLE'
|
|
152
|
+
INSERT: 'INSERT'
|
|
153
|
+
DELETE: 'DELETE'
|
|
154
|
+
KEYBOARD: 'KEYBOARD'
|
|
155
|
+
SUPERSCRIPT: 'SUPERSCRIPT'
|
|
156
|
+
SUBSCRIPT: 'SUBSCRIPT'
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// See https://github.com/facebook/draft-js/blob/master/src/model/immutable/DefaultDraftBlockRenderMap.js
|
|
160
|
+
export const BLOCK_TYPE: {
|
|
161
|
+
// This is used to represent a normal text block (paragraph).
|
|
162
|
+
UNSTYLED: 'unstyled'
|
|
163
|
+
HEADER_ONE: 'header-one'
|
|
164
|
+
HEADER_TWO: 'header-two'
|
|
165
|
+
HEADER_THREE: 'header-three'
|
|
166
|
+
HEADER_FOUR: 'header-four'
|
|
167
|
+
HEADER_FIVE: 'header-five'
|
|
168
|
+
HEADER_SIX: 'header-six'
|
|
169
|
+
UNORDERED_LIST_ITEM: 'unordered-list-item'
|
|
170
|
+
ORDERED_LIST_ITEM: 'ordered-list-item'
|
|
171
|
+
BLOCKQUOTE: 'blockquote'
|
|
172
|
+
CODE: 'code-block'
|
|
173
|
+
// This represents a "custom" block, not for rich text, with arbitrary content.
|
|
174
|
+
ATOMIC: 'atomic'
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export const ENTITY_TYPE: {
|
|
178
|
+
LINK: 'LINK'
|
|
179
|
+
IMAGE: 'IMAGE'
|
|
180
|
+
HORIZONTAL_RULE: 'HORIZONTAL_RULE'
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export const Icon: any
|
|
184
|
+
export const ToolbarButton: any
|
|
185
|
+
export const DraftUtils: any
|
|
186
|
+
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export * from "draftail"
|
|
2
|
-
//# sourceMappingURL=draftail.js.map
|
|
1
|
+
export * from "draftail"
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Input, InputRef} from "antd";
|
|
3
|
+
import {InputProps} from "antd/es";
|
|
4
|
+
|
|
5
|
+
interface HexaFormattedInputProps extends Omit<InputProps, "value" | "onChange"> {
|
|
6
|
+
value: string
|
|
7
|
+
maxLength: number
|
|
8
|
+
|
|
9
|
+
onChange(value: string | undefined): void
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default class HexaFormattedInput extends React.Component<HexaFormattedInputProps, any> {
|
|
13
|
+
private inputRef: InputRef | null = null;
|
|
14
|
+
|
|
15
|
+
constructor(props: Readonly<HexaFormattedInputProps>) {
|
|
16
|
+
super(props);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
get input() {
|
|
20
|
+
return this.inputRef?.input;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
focus() {
|
|
24
|
+
this.inputRef?.focus();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
private getFormattedValue(value: string): string {
|
|
28
|
+
let valueToFormat = value;
|
|
29
|
+
for (let i = 0; i < this.props.maxLength - value.length; i++) {
|
|
30
|
+
valueToFormat = "0" + valueToFormat;
|
|
31
|
+
}
|
|
32
|
+
return valueToFormat.toUpperCase();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
render() {
|
|
36
|
+
const {value, maxLength, onChange, ...rest} = this.props;
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Input
|
|
40
|
+
{...rest}
|
|
41
|
+
ref={component => {
|
|
42
|
+
this.inputRef = component;
|
|
43
|
+
}}
|
|
44
|
+
value={this.props.value.toUpperCase()}
|
|
45
|
+
onChange={event => {
|
|
46
|
+
const value = event.target.value;
|
|
47
|
+
if (/^[0-9A-Fa-f]+$/.test(value) || value === "") {
|
|
48
|
+
this.props.onChange(value);
|
|
49
|
+
}
|
|
50
|
+
}}
|
|
51
|
+
onBlur={event => {
|
|
52
|
+
let value = event.target.value;
|
|
53
|
+
if (!value) {
|
|
54
|
+
this.props.onChange(undefined);
|
|
55
|
+
} else {
|
|
56
|
+
const formattedValue = this.getFormattedValue(value);
|
|
57
|
+
this.props.onChange(formattedValue);
|
|
58
|
+
}
|
|
59
|
+
}}
|
|
60
|
+
maxLength={this.props.maxLength}
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
}
|