d2coreui 21.0.34 → 23.0.0
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.d.ts +4 -3
- package/components/clipboard/clipboardUtils.js +47 -22
- package/components/clipboard/clipboardUtils.js.map +1 -1
- package/components/codemirror/SyntaxHighlighter.d.ts +21 -21
- package/components/codemirror/SyntaxHighlighter.js +45 -44
- package/components/codemirror/SyntaxHighlighter.js.map +1 -1
- package/components/collapse/expandable.d.ts +13 -12
- package/components/collapse/expandable.js +20 -20
- package/components/collapse/expandable.js.map +1 -1
- package/components/color/colorPicker.d.ts +20 -20
- package/components/color/colorPicker.js +53 -53
- package/components/color/colorPicker.js.map +1 -1
- package/components/color/colorSwatch.d.ts +13 -12
- package/components/color/colorSwatch.js +62 -62
- package/components/color/colorSwatch.js.map +1 -1
- package/components/color/colorUtils.d.ts +7 -7
- package/components/color/colorUtils.js +43 -43
- package/components/color/colorUtils.js.map +1 -1
- package/components/date/dateRangeInput.d.ts +66 -64
- package/components/date/dateRangeInput.js +292 -297
- package/components/date/dateRangeInput.js.map +1 -1
- package/components/date/dateRangeInputAdvancedPanel.d.ts +27 -26
- package/components/date/dateRangeInputAdvancedPanel.js +130 -115
- package/components/date/dateRangeInputAdvancedPanel.js.map +1 -1
- package/components/date/dateRangeInputConfirm.d.ts +31 -29
- package/components/date/dateRangeInputConfirm.js +132 -121
- package/components/date/dateRangeInputConfirm.js.map +1 -1
- package/components/date/dateTimeInput.d.ts +72 -69
- package/components/date/dateTimeInput.js +440 -412
- package/components/date/dateTimeInput.js.map +1 -1
- package/components/date/durationInput.d.ts +59 -56
- package/components/date/durationInput.js +269 -280
- package/components/date/durationInput.js.map +1 -1
- package/components/form/NiceFormItem.d.ts +14 -14
- package/components/form/NiceFormItem.js +28 -31
- package/components/form/NiceFormItem.js.map +1 -1
- package/components/grid/cell/beanAccessor.d.ts +9 -0
- package/components/grid/cell/beanAccessor.js +13 -0
- package/components/grid/cell/beanAccessor.js.map +1 -0
- package/components/grid/cell/cellEditorUtils.d.ts +4 -4
- package/components/grid/cell/cellEditorUtils.js +8 -8
- package/components/grid/cell/customEnumCellEditor.d.ts +4 -27
- package/components/grid/cell/customEnumCellEditor.js +82 -91
- package/components/grid/cell/customEnumCellEditor.js.map +1 -1
- package/components/grid/cell/dataGridCellEditorComponent.d.ts +14 -0
- package/components/grid/cell/dataGridCellEditorComponent.js +49 -0
- package/components/grid/cell/dataGridCellEditorComponent.js.map +1 -0
- package/components/grid/cell/dateCellEditor.d.ts +4 -25
- package/components/grid/cell/dateCellEditor.js +53 -72
- package/components/grid/cell/dateCellEditor.js.map +1 -1
- package/components/grid/cell/durationCellEditor.d.ts +4 -24
- package/components/grid/cell/durationCellEditor.js +74 -97
- package/components/grid/cell/durationCellEditor.js.map +1 -1
- package/components/grid/cell/hexaOctetStringCellEditor.d.ts +4 -24
- package/components/grid/cell/hexaOctetStringCellEditor.js +70 -94
- package/components/grid/cell/hexaOctetStringCellEditor.js.map +1 -1
- package/components/grid/cell/hexaValueCellEditor.d.ts +4 -24
- package/components/grid/cell/hexaValueCellEditor.js +65 -89
- package/components/grid/cell/hexaValueCellEditor.js.map +1 -1
- package/components/grid/cell/numberCellEditor.d.ts +4 -27
- package/components/grid/cell/numberCellEditor.js +73 -95
- package/components/grid/cell/numberCellEditor.js.map +1 -1
- package/components/grid/cell/rangeSelector.d.ts +78 -78
- package/components/grid/cell/rangeSelector.js +526 -518
- package/components/grid/cell/rangeSelector.js.map +1 -1
- package/components/grid/cell/simpleStatusTextCellEditor.d.ts +4 -32
- package/components/grid/cell/simpleStatusTextCellEditor.js +106 -116
- package/components/grid/cell/simpleStatusTextCellEditor.js.map +1 -1
- package/components/grid/cell/statusTextCellEditor.d.ts +4 -32
- package/components/grid/cell/statusTextCellEditor.js +136 -159
- package/components/grid/cell/statusTextCellEditor.js.map +1 -1
- package/components/grid/cell/tableDefaultRowStyleRules.d.ts +20 -20
- package/components/grid/cell/tableDefaultRowStyleRules.js +29 -18
- package/components/grid/cell/tableDefaultRowStyleRules.js.map +1 -1
- package/components/grid/cell/textCellEditor.d.ts +4 -21
- package/components/grid/cell/textCellEditor.js +63 -85
- package/components/grid/cell/textCellEditor.js.map +1 -1
- package/components/grid/cell/withAgGridHooks.d.ts +3 -0
- package/components/grid/cell/withAgGridHooks.js +15 -0
- package/components/grid/cell/withAgGridHooks.js.map +1 -0
- package/components/grid/columnUtils.d.ts +5 -5
- package/components/grid/columnUtils.js +26 -26
- package/components/grid/columnUtils.js.map +1 -1
- package/components/grid/config/columnTransfer.d.ts +21 -22
- package/components/grid/config/columnTransfer.js +205 -201
- package/components/grid/config/columnTransfer.js.map +1 -1
- package/components/grid/config/dataGridEditor.d.ts +41 -41
- package/components/grid/config/dataGridEditor.js +181 -160
- package/components/grid/config/dataGridEditor.js.map +1 -1
- package/components/grid/config/rowHeightCalculator.d.ts +8 -0
- package/components/grid/config/rowHeightCalculator.js +20 -0
- package/components/grid/config/rowHeightCalculator.js.map +1 -0
- package/components/grid/config/rowStylePicker.d.ts +27 -25
- package/components/grid/config/rowStylePicker.js +127 -109
- package/components/grid/config/rowStylePicker.js.map +1 -1
- package/components/grid/dataGrid.d.ts +218 -206
- package/components/grid/dataGrid.js +1629 -1538
- package/components/grid/dataGrid.js.map +1 -1
- package/components/grid/detail/detailHeaderPanel.d.ts +13 -13
- package/components/grid/detail/detailHeaderPanel.js +25 -25
- package/components/grid/detail/detailHeaderPanel.js.map +1 -1
- package/components/grid/export/contextMenu.d.ts +18 -24
- package/components/grid/export/contextMenu.js +116 -113
- package/components/grid/export/contextMenu.js.map +1 -1
- package/components/grid/export/progressPopup.d.ts +29 -29
- package/components/grid/export/progressPopup.js +93 -93
- package/components/grid/export/progressPopup.js.map +1 -1
- package/components/grid/export/worker/clipboardExport.d.ts +1 -1
- package/components/grid/export/worker/clipboardExport.js +8 -8
- package/components/grid/export/worker/csvExport.d.ts +1 -1
- package/components/grid/export/worker/csvExport.js +8 -8
- package/components/grid/export/worker/pdfExport.d.ts +1 -1
- package/components/grid/export/worker/pdfExport.js +81 -81
- package/components/grid/export/worker/pdfExport.js.map +1 -1
- package/components/grid/export/worker/txtExport.d.ts +1 -1
- package/components/grid/export/worker/txtExport.js +19 -19
- package/components/grid/extendedDataGrid.d.ts +140 -140
- package/components/grid/extendedDataGrid.js +704 -695
- package/components/grid/extendedDataGrid.js.map +1 -1
- package/components/grid/filter/customColumnFilter.d.ts +5 -21
- package/components/grid/filter/customColumnFilter.js +11 -82
- package/components/grid/filter/customColumnFilter.js.map +1 -1
- package/components/grid/filter/dataGridColumnFilter.d.ts +17 -0
- package/components/grid/filter/dataGridColumnFilter.js +49 -0
- package/components/grid/filter/dataGridColumnFilter.js.map +1 -0
- package/components/grid/filter/dateColumnFilter.d.ts +7 -11
- package/components/grid/filter/dateColumnFilter.js +22 -56
- package/components/grid/filter/dateColumnFilter.js.map +1 -1
- package/components/grid/filter/textColumnFilter.d.ts +8 -20
- package/components/grid/filter/textColumnFilter.js +24 -76
- package/components/grid/filter/textColumnFilter.js.map +1 -1
- package/components/grid/filter/wildcardQuickFilterEngine.d.ts +7 -0
- package/components/grid/filter/wildcardQuickFilterEngine.js +48 -0
- package/components/grid/filter/wildcardQuickFilterEngine.js.map +1 -0
- package/components/grid/header/simpleHeader.d.ts +17 -16
- package/components/grid/header/simpleHeader.js +230 -186
- package/components/grid/header/simpleHeader.js.map +1 -1
- package/components/grid/panel/dataGridPagination.d.ts +16 -16
- package/components/grid/panel/dataGridPagination.js +58 -58
- package/components/grid/panel/dataGridPagination.js.map +1 -1
- package/components/grid/panel/loadingOverlay.d.ts +6 -6
- package/components/grid/panel/loadingOverlay.js +10 -10
- package/components/grid/panel/loadingOverlay.js.map +1 -1
- package/components/grid/panel/noRecordsOverlay.d.ts +6 -6
- package/components/grid/panel/noRecordsOverlay.js +10 -10
- package/components/grid/panel/noRecordsOverlay.js.map +1 -1
- package/components/grid/panel/tablePagination.d.ts +10 -10
- package/components/grid/panel/tablePagination.js +45 -45
- package/components/grid/panel/tablePagination.js.map +1 -1
- package/components/icons/dropdownArrow.d.ts +8 -0
- package/components/icons/dropdownArrow.js +59 -0
- package/components/icons/dropdownArrow.js.map +1 -0
- package/components/icons/undoIcon.d.ts +8 -8
- package/components/icons/undoIcon.js +6 -6
- package/components/input/autoCompleteInput.d.ts +35 -35
- package/components/input/autoCompleteInput.js +122 -121
- package/components/input/autoCompleteInput.js.map +1 -1
- package/components/input/draftUtils.d.ts +4 -4
- package/components/input/draftUtils.js +48 -48
- package/components/input/draftUtils.js.map +1 -1
- package/components/input/draftail.d.ts +1 -1
- package/components/input/draftail.js +1 -1
- package/components/input/hexaFormattedInput.d.ts +16 -16
- package/components/input/hexaFormattedInput.js +54 -54
- package/components/input/hexaFormattedInput.js.map +1 -1
- package/components/input/mask/helpers.d.ts +28 -28
- package/components/input/mask/helpers.js +112 -112
- package/components/input/mask/helpers.js.map +1 -1
- package/components/input/mask/inputMaskCore.d.ts +46 -46
- package/components/input/mask/inputMaskCore.js +278 -278
- package/components/input/mask/inputMaskCore.js.map +1 -1
- package/components/input/mask/pattern.d.ts +20 -20
- package/components/input/mask/pattern.js +78 -78
- package/components/input/mask/pattern.js.map +1 -1
- package/components/input/maskedInput.d.ts +373 -351
- package/components/input/maskedInput.js +224 -224
- package/components/input/maskedInput.js.map +1 -1
- package/components/input/passwordInput.d.ts +9 -9
- package/components/input/passwordInput.js +55 -55
- package/components/input/passwordInput.js.map +1 -1
- package/components/input/simpleAutoComplete.d.ts +12 -12
- package/components/input/simpleAutoComplete.js +41 -43
- package/components/input/simpleAutoComplete.js.map +1 -1
- package/components/input/textarea/extractSpansOfClasses.d.ts +15 -15
- package/components/input/textarea/extractSpansOfClasses.js +96 -96
- package/components/input/textarea/extractSpansOfClasses.js.map +1 -1
- package/components/input/textarea/getRanges.d.ts +1 -1
- package/components/input/textarea/getRanges.js +73 -73
- package/components/input/textarea/getRanges.js.map +1 -1
- package/components/input/textarea/getType.d.ts +1 -1
- package/components/input/textarea/getType.js +26 -26
- package/components/input/textarea/getType.js.map +1 -1
- package/components/input/textarea/highlighedContents.d.ts +6 -6
- package/components/input/textarea/highlighedContents.js +10 -10
- package/components/input/textarea/mentionsWithHighlighting.d.ts +27 -27
- package/components/input/textarea/mentionsWithHighlighting.js +60 -60
- package/components/input/textarea/mentionsWithHighlighting.js.map +1 -1
- package/components/keyboard/keyboardUtils.d.ts +5 -5
- package/components/keyboard/keyboardUtils.js +32 -32
- package/components/modal/draggableModalProvider.d.ts +4 -4
- package/components/modal/draggableModalProvider.js +21 -21
- package/components/modal/draggableModalProvider.js.map +1 -1
- package/components/modal/impl/clamp.d.ts +1 -1
- package/components/modal/impl/clamp.js +1 -1
- package/components/modal/impl/clamp.js.map +1 -1
- package/components/modal/impl/draggableModal.d.ts +12 -12
- package/components/modal/impl/draggableModal.js +17 -17
- package/components/modal/impl/draggableModal.js.map +1 -1
- package/components/modal/impl/draggableModalContext.d.ts +9 -9
- package/components/modal/impl/draggableModalContext.js +2 -2
- package/components/modal/impl/draggableModalContext.js.map +1 -1
- package/components/modal/impl/draggableModalInner.d.ts +15 -13
- package/components/modal/impl/draggableModalInner.js +57 -55
- package/components/modal/impl/draggableModalInner.js.map +1 -1
- package/components/modal/impl/draggableModalReducer.d.ts +66 -62
- package/components/modal/impl/draggableModalReducer.js +77 -78
- package/components/modal/impl/draggableModalReducer.js.map +1 -1
- package/components/modal/impl/getWindowSize.d.ts +4 -4
- package/components/modal/impl/getWindowSize.js +4 -4
- package/components/modal/impl/getWindowSize.js.map +1 -1
- package/components/modal/impl/index.d.ts +3 -3
- package/components/modal/impl/index.js +3 -3
- package/components/modal/impl/index.js.map +1 -1
- package/components/modal/impl/resizeHandle.d.ts +3 -3
- package/components/modal/impl/resizeHandle.js +4 -4
- package/components/modal/impl/resizeHandle.js.map +1 -1
- package/components/modal/impl/useDrag.d.ts +5 -5
- package/components/modal/impl/useDrag.js +42 -42
- package/components/modal/impl/useDrag.js.map +1 -1
- package/components/modal/impl/usePrevious.d.ts +1 -1
- package/components/modal/impl/usePrevious.js +8 -8
- package/components/modal/impl/usePrevious.js.map +1 -1
- package/components/modal/impl/useResize.d.ts +7 -7
- package/components/modal/impl/useResize.js +46 -46
- package/components/modal/impl/useResize.js.map +1 -1
- package/components/modal/modalDialog.d.ts +49 -49
- package/components/modal/modalDialog.js +152 -152
- package/components/modal/modalDialog.js.map +1 -1
- package/components/picker/enumValuePicker.d.ts +16 -16
- package/components/picker/enumValuePicker.js +34 -34
- package/components/picker/enumValuePicker.js.map +1 -1
- package/components/platformSpecific.d.ts +10 -10
- package/components/platformSpecific.js +27 -27
- package/components/scrollTo/onlyText.d.ts +4 -4
- package/components/scrollTo/onlyText.js +30 -30
- package/components/scrollTo/onlyText.js.map +1 -1
- package/components/scrollTo/scrollTo.d.ts +41 -39
- package/components/scrollTo/scrollTo.js +264 -264
- package/components/scrollTo/scrollTo.js.map +1 -1
- package/components/style/withCss.d.ts +9 -0
- package/components/style/withCss.js +6 -0
- package/components/style/withCss.js.map +1 -0
- package/components/style/withInputNumberCss.d.ts +6 -0
- package/components/style/withInputNumberCss.js +13 -0
- package/components/style/withInputNumberCss.js.map +1 -0
- package/components/table/dragSortingTable.d.ts +13 -14
- package/components/table/dragSortingTable.js +96 -82
- package/components/table/dragSortingTable.js.map +1 -1
- package/components/text/impl/innerSize.d.ts +2 -2
- package/components/text/impl/innerSize.js +12 -12
- package/components/text/impl/series.d.ts +1 -1
- package/components/text/impl/series.js +28 -28
- package/components/text/impl/shallowEqual.d.ts +1 -1
- package/components/text/impl/shallowEqual.js +18 -18
- package/components/text/impl/shallowEqual.js.map +1 -1
- package/components/text/impl/uniqueId.d.ts +1 -1
- package/components/text/impl/uniqueId.js +4 -4
- package/components/text/impl/whilst.d.ts +1 -1
- package/components/text/impl/whilst.js +19 -19
- package/components/text/impl/whilst.js.map +1 -1
- package/components/text/textFit.d.ts +38 -38
- package/components/text/textFit.js +165 -168
- package/components/text/textFit.js.map +1 -1
- package/i18n/components.cs.json +101 -100
- package/i18n/components.sk.json +101 -100
- package/i18n/components.uk.json +101 -100
- package/i18n/componentsLocaleHolder.d.ts +3 -3
- package/i18n/componentsLocaleHolder.js +28 -28
- package/i18n/componentsLocaleHolder.js.map +1 -1
- package/package.json +71 -70
- package/style/index.less +274 -298
- package/style/modal/DraggableModal.css +43 -40
- package/style/modal/ResizeHandle.css +27 -19
- package/tsconfig.build.json +24 -24
- package/tsconfig.json +11 -11
- package/components/grid/cell/wildcardQuickFilter.d.ts +0 -11
- package/components/grid/cell/wildcardQuickFilter.js +0 -61
- package/components/grid/cell/wildcardQuickFilter.js.map +0 -1
- package/components/table/dataTable.d.ts +0 -17
- package/components/table/dataTable.js +0 -79
- package/components/table/dataTable.js.map +0 -1
- package/style/antd/antd-tree-showline.css +0 -25
- package/style/antd/full-height-tabs.scss +0 -63
- package/style/draftail/draftail-editor.css +0 -179
- package/style/table/dragSortingTable.css +0 -7
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import reactCSS, { handleHover } from 'reactcss';
|
|
3
|
-
import { Swatch } from 'react-color/lib/components/common/Swatch';
|
|
4
|
-
function invertColor(hex, bw) {
|
|
5
|
-
if (hex.indexOf('#') === 0) {
|
|
6
|
-
hex = hex.slice(1);
|
|
7
|
-
}
|
|
8
|
-
if (hex.length === 3) {
|
|
9
|
-
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
|
|
10
|
-
}
|
|
11
|
-
if (hex.length !== 6) {
|
|
12
|
-
throw new Error('Invalid HEX color.');
|
|
13
|
-
}
|
|
14
|
-
var r = parseInt(hex.slice(0, 2), 16), g = parseInt(hex.slice(2, 4), 16), b = parseInt(hex.slice(4, 6), 16);
|
|
15
|
-
if (bw) {
|
|
16
|
-
return (r * 0.299 + g * 0.587 + b * 0.114) > 186
|
|
17
|
-
? '#000000'
|
|
18
|
-
: '#FFFFFF';
|
|
19
|
-
}
|
|
20
|
-
r = (255 - r).toString(16);
|
|
21
|
-
g = (255 - g).toString(16);
|
|
22
|
-
b = (255 - b).toString(16);
|
|
23
|
-
return "#" + padZero(r) + padZero(g) + padZero(b);
|
|
24
|
-
}
|
|
25
|
-
export const ColorSwatch = ({ hover, color, onClick, onSwatchHover, style, title, active, small }) => {
|
|
26
|
-
const hoverSwatch = {
|
|
27
|
-
transform: "scale(1.5)",
|
|
28
|
-
position: 'relative',
|
|
29
|
-
zIndex: '3',
|
|
30
|
-
};
|
|
31
|
-
const focusSwatch = {
|
|
32
|
-
position: 'relative',
|
|
33
|
-
zIndex: '2',
|
|
34
|
-
transform: "scale(1.2)",
|
|
35
|
-
boxShadow: '0 0 5px 2px rgba(0,0,0,0.25)',
|
|
36
|
-
cursor: "pointer"
|
|
37
|
-
};
|
|
38
|
-
const styles = reactCSS({
|
|
39
|
-
'default': {
|
|
40
|
-
swatch: {
|
|
41
|
-
display: "inline-block",
|
|
42
|
-
transform: "scale(1)",
|
|
43
|
-
width: !!small ? '15px' : '22px',
|
|
44
|
-
height: !!small ? '15px' : '22px',
|
|
45
|
-
margin: '2px',
|
|
46
|
-
marginTop: 0,
|
|
47
|
-
marginBottom: 0,
|
|
48
|
-
fontSize: '0',
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
'hover': {
|
|
52
|
-
swatch: small ? {} : hoverSwatch,
|
|
53
|
-
},
|
|
54
|
-
}, { hover });
|
|
55
|
-
return (React.createElement("div", { style: styles.swatch },
|
|
56
|
-
active &&
|
|
57
|
-
React.createElement("div", { style: { fill: invertColor(color, true), position: "absolute", left: 1, top: 1, zIndex: 10, } },
|
|
58
|
-
React.createElement("svg", { viewBox: "0 0 24 24", style: { width: 20, height: 20 } },
|
|
59
|
-
React.createElement("path", { d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" }))),
|
|
60
|
-
React.createElement(Swatch, { color: color, onClick: onClick, onHover: onSwatchHover, focus: active, focusStyle: focusSwatch, style: style, title: title })));
|
|
61
|
-
};
|
|
62
|
-
export default handleHover(ColorSwatch);
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import reactCSS, { handleHover } from 'reactcss';
|
|
3
|
+
import { Swatch } from 'react-color/lib/components/common/Swatch';
|
|
4
|
+
function invertColor(hex, bw) {
|
|
5
|
+
if (hex.indexOf('#') === 0) {
|
|
6
|
+
hex = hex.slice(1);
|
|
7
|
+
}
|
|
8
|
+
if (hex.length === 3) {
|
|
9
|
+
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
|
|
10
|
+
}
|
|
11
|
+
if (hex.length !== 6) {
|
|
12
|
+
throw new Error('Invalid HEX color.');
|
|
13
|
+
}
|
|
14
|
+
var r = parseInt(hex.slice(0, 2), 16), g = parseInt(hex.slice(2, 4), 16), b = parseInt(hex.slice(4, 6), 16);
|
|
15
|
+
if (bw) {
|
|
16
|
+
return (r * 0.299 + g * 0.587 + b * 0.114) > 186
|
|
17
|
+
? '#000000'
|
|
18
|
+
: '#FFFFFF';
|
|
19
|
+
}
|
|
20
|
+
r = (255 - r).toString(16);
|
|
21
|
+
g = (255 - g).toString(16);
|
|
22
|
+
b = (255 - b).toString(16);
|
|
23
|
+
return "#" + padZero(r) + padZero(g) + padZero(b);
|
|
24
|
+
}
|
|
25
|
+
export const ColorSwatch = ({ hover, color, onClick, onSwatchHover, style, title, active, small }) => {
|
|
26
|
+
const hoverSwatch = {
|
|
27
|
+
transform: "scale(1.5)",
|
|
28
|
+
position: 'relative',
|
|
29
|
+
zIndex: '3',
|
|
30
|
+
};
|
|
31
|
+
const focusSwatch = {
|
|
32
|
+
position: 'relative',
|
|
33
|
+
zIndex: '2',
|
|
34
|
+
transform: "scale(1.2)",
|
|
35
|
+
boxShadow: '0 0 5px 2px rgba(0,0,0,0.25)',
|
|
36
|
+
cursor: "pointer"
|
|
37
|
+
};
|
|
38
|
+
const styles = reactCSS({
|
|
39
|
+
'default': {
|
|
40
|
+
swatch: {
|
|
41
|
+
display: "inline-block",
|
|
42
|
+
transform: "scale(1)",
|
|
43
|
+
width: !!small ? '15px' : '22px',
|
|
44
|
+
height: !!small ? '15px' : '22px',
|
|
45
|
+
margin: '2px',
|
|
46
|
+
marginTop: 0,
|
|
47
|
+
marginBottom: 0,
|
|
48
|
+
fontSize: '0',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
'hover': {
|
|
52
|
+
swatch: small ? {} : hoverSwatch,
|
|
53
|
+
},
|
|
54
|
+
}, { hover });
|
|
55
|
+
return (React.createElement("div", { style: styles.swatch },
|
|
56
|
+
active &&
|
|
57
|
+
React.createElement("div", { style: { fill: invertColor(color, true), position: "absolute", left: 1, top: 1, zIndex: 10, } },
|
|
58
|
+
React.createElement("svg", { viewBox: "0 0 24 24", style: { width: 20, height: 20 } },
|
|
59
|
+
React.createElement("path", { d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" }))),
|
|
60
|
+
React.createElement(Swatch, { color: color, onClick: onClick, onHover: onSwatchHover, focus: active, focusStyle: focusSwatch, style: style, title: title })));
|
|
61
|
+
};
|
|
62
|
+
export default handleHover(ColorSwatch);
|
|
63
63
|
//# sourceMappingURL=colorSwatch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorSwatch.js","sourceRoot":"","sources":["../../../../components/color/colorSwatch.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,QAAQ,EAAE,EAAC,WAAW,EAAC,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAC,MAAM,EAAC,MAAM,0CAA0C,CAAA;AAE/D,SAAS,WAAW,CAAC,GAAG,EAAE,EAAE;IACxB,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"colorSwatch.js","sourceRoot":"","sources":["../../../../components/color/colorSwatch.jsx"],"names":[],"mappings":"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,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW;SACnC;KACJ,EAAE,EAAC,KAAK,EAAC,CAAC,CAAA;IAGX,OAAO,CACH,6BAAK,KAAK,EAAE,MAAM,CAAC,MAAM;QACpB,MAAM;YACP,6BAAK,KAAK,EAAE,EAAC,IAAI,EAAE,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,GAAE;gBAC5F,6BAAK,OAAO,EAAC,WAAW,EAAC,KAAK,EAAE,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAC;oBACnD,8BAAM,CAAC,EAAC,yDAAyD,GAAE,CACjE,CACJ;QACN,oBAAC,MAAM,IACH,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,WAAW,EACvB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,GACd,CACA,CACT,CAAA;AACL,CAAC,CAAA;AAED,eAAe,WAAW,CAAC,WAAW,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport reactCSS, {handleHover} from 'reactcss'\nimport {Swatch} from 'react-color/lib/components/common/Swatch'\n\nfunction invertColor(hex, bw) {\n if (hex.indexOf('#') === 0) {\n hex = hex.slice(1);\n }\n // convert 3-digit hex to 6-digits.\n if (hex.length === 3) {\n hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];\n }\n if (hex.length !== 6) {\n throw new Error('Invalid HEX color.');\n }\n var r = parseInt(hex.slice(0, 2), 16),\n g = parseInt(hex.slice(2, 4), 16),\n b = parseInt(hex.slice(4, 6), 16);\n if (bw) {\n // http://stackoverflow.com/a/3943023/112731\n return (r * 0.299 + g * 0.587 + b * 0.114) > 186\n ? '#000000'\n : '#FFFFFF';\n }\n // invert color components\n r = (255 - r).toString(16);\n g = (255 - g).toString(16);\n b = (255 - b).toString(16);\n // pad each with zeros and return\n return \"#\" + padZero(r) + padZero(g) + padZero(b);\n}\n\nexport const ColorSwatch = ({hover, color, onClick, onSwatchHover, style, title, active, small}) => {\n const hoverSwatch = {\n transform: \"scale(1.5)\",\n position: 'relative',\n zIndex: '3',\n }\n const focusSwatch = {\n position: 'relative',\n zIndex: '2',\n transform: \"scale(1.2)\",\n boxShadow: '0 0 5px 2px rgba(0,0,0,0.25)',\n cursor:\"pointer\"\n }\n\n const styles = reactCSS({\n 'default': {\n swatch: {\n display: \"inline-block\",\n transform: \"scale(1)\",\n width: !!small ? '15px' : '22px',\n height: !!small ? '15px' : '22px',\n margin: '2px',\n marginTop: 0,\n marginBottom: 0,\n fontSize: '0',\n },\n },\n 'hover': {\n swatch: small ? {} : hoverSwatch,\n },\n }, {hover})\n\n\n return (\n <div style={styles.swatch}>\n {active &&\n <div style={{fill: invertColor(color, true), position: \"absolute\", left: 1, top: 1, zIndex: 10,}}>\n <svg viewBox=\"0 0 24 24\" style={{width: 20, height: 20}}>\n <path d=\"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z\"/>\n </svg>\n </div>}\n <Swatch\n color={color}\n onClick={onClick}\n onHover={onSwatchHover}\n focus={active}\n focusStyle={focusSwatch}\n style={style}\n title={title}\n />\n </div>\n )\n}\n\nexport default handleHover(ColorSwatch)"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export default class ColorUtils {
|
|
2
|
-
static d2IntToRGB(num: number): string;
|
|
3
|
-
static d2IntToHex(num: number): string;
|
|
4
|
-
static hexToD2Int(hex: string): number;
|
|
5
|
-
private static padZero;
|
|
6
|
-
static invertColor(hex: string, bw: boolean): string;
|
|
7
|
-
}
|
|
1
|
+
export default class ColorUtils {
|
|
2
|
+
static d2IntToRGB(num: number): string;
|
|
3
|
+
static d2IntToHex(num: number): string;
|
|
4
|
+
static hexToD2Int(hex: string): number;
|
|
5
|
+
private static padZero;
|
|
6
|
+
static invertColor(hex: string, bw: boolean): string;
|
|
7
|
+
}
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
export default class ColorUtils {
|
|
2
|
-
static d2IntToRGB(num) {
|
|
3
|
-
const b = (num & 0xFF0000) >>> 16, g = (num & 0xFF00) >>> 8, r = num & 0xFF;
|
|
4
|
-
return "rgb(" + [r, g, b].join(",") + ")";
|
|
5
|
-
}
|
|
6
|
-
static d2IntToHex(num) {
|
|
7
|
-
const b = (num & 0xFF0000) >>> 16, g = (num & 0xFF00) >>> 8, r = num & 0xFF;
|
|
8
|
-
return "#" + r.toString(16).padStart(2, '0') + g.toString(16).padStart(2, '0') + b.toString(16).padStart(2, '0');
|
|
9
|
-
}
|
|
10
|
-
static hexToD2Int(hex) {
|
|
11
|
-
const r = parseInt(hex.
|
|
12
|
-
return r + g + b;
|
|
13
|
-
}
|
|
14
|
-
static padZero(s, length = 2) {
|
|
15
|
-
while (s.length < length) {
|
|
16
|
-
s = '0' + s;
|
|
17
|
-
}
|
|
18
|
-
return s;
|
|
19
|
-
}
|
|
20
|
-
static invertColor(hex, bw) {
|
|
21
|
-
if (hex.indexOf('#') === 0) {
|
|
22
|
-
hex = hex.slice(1);
|
|
23
|
-
}
|
|
24
|
-
if (hex.length === 3) {
|
|
25
|
-
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
|
|
26
|
-
}
|
|
27
|
-
if (hex.length !== 6) {
|
|
28
|
-
throw new Error('Invalid HEX color.');
|
|
29
|
-
}
|
|
30
|
-
const r = parseInt(hex.slice(0, 2), 16);
|
|
31
|
-
const g = parseInt(hex.slice(2, 4), 16);
|
|
32
|
-
const b = parseInt(hex.slice(4, 6), 16);
|
|
33
|
-
if (bw) {
|
|
34
|
-
return (r * 0.299 + g * 0.587 + b * 0.114) > 186
|
|
35
|
-
? '#000000'
|
|
36
|
-
: '#FFFFFF';
|
|
37
|
-
}
|
|
38
|
-
const rString = (255 - r).toString(16);
|
|
39
|
-
const gString = (255 - g).toString(16);
|
|
40
|
-
const bString = (255 - b).toString(16);
|
|
41
|
-
return "#" + this.padZero(rString) + this.padZero(gString) + this.padZero(bString);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
1
|
+
export default class ColorUtils {
|
|
2
|
+
static d2IntToRGB(num) {
|
|
3
|
+
const b = (num & 0xFF0000) >>> 16, g = (num & 0xFF00) >>> 8, r = num & 0xFF;
|
|
4
|
+
return "rgb(" + [r, g, b].join(",") + ")";
|
|
5
|
+
}
|
|
6
|
+
static d2IntToHex(num) {
|
|
7
|
+
const b = (num & 0xFF0000) >>> 16, g = (num & 0xFF00) >>> 8, r = num & 0xFF;
|
|
8
|
+
return "#" + r.toString(16).padStart(2, '0') + g.toString(16).padStart(2, '0') + b.toString(16).padStart(2, '0');
|
|
9
|
+
}
|
|
10
|
+
static hexToD2Int(hex) {
|
|
11
|
+
const r = parseInt(hex.slice(1, 1 + 2), 16), g = (parseInt(hex.slice(3, 3 + 2), 16) << 8), b = (parseInt(hex.slice(5, 5 + 2), 16) << 16);
|
|
12
|
+
return r + g + b;
|
|
13
|
+
}
|
|
14
|
+
static padZero(s, length = 2) {
|
|
15
|
+
while (s.length < length) {
|
|
16
|
+
s = '0' + s;
|
|
17
|
+
}
|
|
18
|
+
return s;
|
|
19
|
+
}
|
|
20
|
+
static invertColor(hex, bw) {
|
|
21
|
+
if (hex.indexOf('#') === 0) {
|
|
22
|
+
hex = hex.slice(1);
|
|
23
|
+
}
|
|
24
|
+
if (hex.length === 3) {
|
|
25
|
+
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
|
|
26
|
+
}
|
|
27
|
+
if (hex.length !== 6) {
|
|
28
|
+
throw new Error('Invalid HEX color.');
|
|
29
|
+
}
|
|
30
|
+
const r = parseInt(hex.slice(0, 2), 16);
|
|
31
|
+
const g = parseInt(hex.slice(2, 4), 16);
|
|
32
|
+
const b = parseInt(hex.slice(4, 6), 16);
|
|
33
|
+
if (bw) {
|
|
34
|
+
return (r * 0.299 + g * 0.587 + b * 0.114) > 186
|
|
35
|
+
? '#000000'
|
|
36
|
+
: '#FFFFFF';
|
|
37
|
+
}
|
|
38
|
+
const rString = (255 - r).toString(16);
|
|
39
|
+
const gString = (255 - g).toString(16);
|
|
40
|
+
const bString = (255 - b).toString(16);
|
|
41
|
+
return "#" + this.padZero(rString) + this.padZero(gString) + this.padZero(bString);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
44
|
//# sourceMappingURL=colorUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorUtils.js","sourceRoot":"","sources":["../../../../components/color/colorUtils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,UAAU;IAC3B,MAAM,CAAC,UAAU,CAAC,GAAW;QAEzB,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,QAAQ,CAAC,KAAK,EAAE,EAC7B,CAAC,GAAG,CAAC,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,EACxB,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC;QACnB,OAAO,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;IAC9C,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,GAAW;QAEzB,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,QAAQ,CAAC,KAAK,EAAE,EAC7B,CAAC,GAAG,CAAC,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,EACxB,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC;QACnB,OAAO,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,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,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACxC,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACxC,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACxC,IAAI,EAAE,EAAE,CAAC;YAEL,OAAO,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,GAAG;gBAC5C,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,SAAS,CAAC;QACpB,CAAC;QAED,MAAM,OAAO,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACvC,MAAM,OAAO,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACvC,MAAM,OAAO,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAEvC,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvF,CAAC;CACJ","sourcesContent":["export default class ColorUtils {\r\n static d2IntToRGB(num: number): string {\r\n // d2000 posiela farbu vo formate bgr\r\n const b = (num & 0xFF0000) >>> 16,\r\n g = (num & 0xFF00) >>> 8,\r\n r = num & 0xFF;\r\n return \"rgb(\" + [r, g, b].join(\",\") + \")\";\r\n }\r\n\r\n static d2IntToHex(num: number): string {\r\n // d2000 posiela farbu vo formate bgr\r\n const b = (num & 0xFF0000) >>> 16,\r\n g = (num & 0xFF00) >>> 8,\r\n r = num & 0xFF;\r\n return \"#\" + r.toString(16).padStart(2, '0') + g.toString(16).padStart(2, '0') + b.toString(16).padStart(2, '0');\r\n }\r\n\r\n static hexToD2Int(hex: string): number {\r\n const r = parseInt(hex.slice(1, 1 + 2), 16),\r\n g = (parseInt(hex.slice(3, 3 + 2), 16) << 8),\r\n b = (parseInt(hex.slice(5, 5 + 2), 16) << 16);\r\n\r\n return r + g + b;\r\n }\r\n\r\n private static padZero(s: string, length: number = 2) {\r\n while (s.length < length) {\r\n s = '0' + s;\r\n }\r\n return s;\r\n }\r\n\r\n static invertColor(hex: string, bw: boolean) {\r\n if (hex.indexOf('#') === 0) {\r\n hex = hex.slice(1);\r\n }\r\n // convert 3-digit hex to 6-digits.\r\n if (hex.length === 3) {\r\n hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];\r\n }\r\n if (hex.length !== 6) {\r\n throw new Error('Invalid HEX color.');\r\n }\r\n const r = parseInt(hex.slice(0, 2), 16);\r\n const g = parseInt(hex.slice(2, 4), 16);\r\n const b = parseInt(hex.slice(4, 6), 16);\r\n if (bw) {\r\n // http://stackoverflow.com/a/3943023/112731\r\n return (r * 0.299 + g * 0.587 + b * 0.114) > 186\r\n ? '#000000'\r\n : '#FFFFFF';\r\n }\r\n // invert color components\r\n const rString = (255 - r).toString(16);\r\n const gString = (255 - g).toString(16);\r\n const bString = (255 - b).toString(16);\r\n // pad each with zeros and return\r\n return \"#\" + this.padZero(rString) + this.padZero(gString) + this.padZero(bString);\r\n }\r\n}"]}
|
|
@@ -1,64 +1,66 @@
|
|
|
1
|
-
import React, { HTMLAttributes } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { TooltipPlacement } from "antd/es/tooltip";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
private
|
|
58
|
-
|
|
59
|
-
private
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
1
|
+
import React, { HTMLAttributes } from "react";
|
|
2
|
+
import { Dayjs } from "dayjs";
|
|
3
|
+
import { TooltipPlacement } from "antd/es/tooltip";
|
|
4
|
+
import { SizeType } from "antd/lib/config-provider/SizeContext";
|
|
5
|
+
export declare enum DateRangeInputMode {
|
|
6
|
+
SIMPLE = 0,
|
|
7
|
+
ADVANCED = 1
|
|
8
|
+
}
|
|
9
|
+
export interface DateRangeInputProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
10
|
+
mask: string;
|
|
11
|
+
fromValue: Dayjs | null;
|
|
12
|
+
toValue: Dayjs | null;
|
|
13
|
+
onChange?: (fromValue: Dayjs | null, toValue: Dayjs | null) => void;
|
|
14
|
+
onInvalidValue?: (input: string) => void;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
minDateTime?: Dayjs;
|
|
17
|
+
maxDateTime?: Dayjs;
|
|
18
|
+
allowClear?: boolean;
|
|
19
|
+
ranges?: {
|
|
20
|
+
[rangeName: string]: () => [Dayjs, Dayjs];
|
|
21
|
+
};
|
|
22
|
+
size?: SizeType;
|
|
23
|
+
hidePopup?: boolean;
|
|
24
|
+
renderAsCalendar?: boolean;
|
|
25
|
+
placement?: TooltipPlacement;
|
|
26
|
+
align?: {
|
|
27
|
+
points?: [string, string];
|
|
28
|
+
offset?: [number, number];
|
|
29
|
+
targetOffset?: [number, number];
|
|
30
|
+
overflow?: {
|
|
31
|
+
adjustX?: boolean;
|
|
32
|
+
adjustY?: boolean;
|
|
33
|
+
};
|
|
34
|
+
useCssRight?: boolean;
|
|
35
|
+
useCssBottom?: boolean;
|
|
36
|
+
useCssTransform?: boolean;
|
|
37
|
+
};
|
|
38
|
+
defaultMode?: DateRangeInputMode;
|
|
39
|
+
onModeChange?(mode: DateRangeInputMode): void;
|
|
40
|
+
onFocus?(): void;
|
|
41
|
+
onBlur?(): void;
|
|
42
|
+
confirmButtonsRenderer?(): React.ReactNode;
|
|
43
|
+
onPopupVisibleChange?(visible: boolean): void;
|
|
44
|
+
}
|
|
45
|
+
interface DateRangeInputState {
|
|
46
|
+
valid: boolean;
|
|
47
|
+
selectionStartDate: Dayjs | null;
|
|
48
|
+
popupKeyIndex: number;
|
|
49
|
+
popupVisible: boolean;
|
|
50
|
+
mode: DateRangeInputMode;
|
|
51
|
+
}
|
|
52
|
+
export default class DateRangeInput extends React.Component<DateRangeInputProps, DateRangeInputState> {
|
|
53
|
+
constructor(props: Readonly<DateRangeInputProps>);
|
|
54
|
+
componentDidUpdate(_prevProps: Readonly<DateRangeInputProps>, prevState: Readonly<DateRangeInputState>): void;
|
|
55
|
+
getDefaultSelectedDateForFromPanel(fromDate: Dayjs | null, toDate: Dayjs | null): Dayjs;
|
|
56
|
+
private getFromValue;
|
|
57
|
+
private getToValue;
|
|
58
|
+
closePopup(): void;
|
|
59
|
+
private onChange;
|
|
60
|
+
private renderSimplePart;
|
|
61
|
+
private renderAdvancedPart;
|
|
62
|
+
renderPopup(): React.ReactElement;
|
|
63
|
+
renderInput(): React.JSX.Element;
|
|
64
|
+
render(): any;
|
|
65
|
+
}
|
|
66
|
+
export {};
|