d2coreui 21.0.33 → 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 -26
- 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,56 +1,56 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { EyeInvisibleOutlined, EyeOutlined } from "@ant-design/icons";
|
|
3
|
-
import { Input } from "antd";
|
|
4
|
-
export default class PasswordInput extends React.Component {
|
|
5
|
-
constructor(props) {
|
|
6
|
-
super(props);
|
|
7
|
-
this.component = null;
|
|
8
|
-
this.getIcon = (visible) => {
|
|
9
|
-
const IconRenderer = class IconRend extends React.Component {
|
|
10
|
-
render() {
|
|
11
|
-
const IconClass = visible ? EyeOutlined : EyeInvisibleOutlined;
|
|
12
|
-
return (React.createElement(IconClass, { key: "password-icon", className: "ant-input-password-icon", onTouchStart: (e) => {
|
|
13
|
-
var _a, _b;
|
|
14
|
-
e.preventDefault();
|
|
15
|
-
if (!visible) {
|
|
16
|
-
(_b = (_a = this.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
17
|
-
}
|
|
18
|
-
}, onTouchEnd: () => {
|
|
19
|
-
var _a, _b;
|
|
20
|
-
if (visible) {
|
|
21
|
-
(_b = (_a = this.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
22
|
-
}
|
|
23
|
-
}, onMouseDown: (e) => {
|
|
24
|
-
var _a, _b;
|
|
25
|
-
e.preventDefault();
|
|
26
|
-
if (!visible) {
|
|
27
|
-
(_b = (_a = this.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
28
|
-
}
|
|
29
|
-
}, onMouseUp: () => {
|
|
30
|
-
var _a, _b;
|
|
31
|
-
if (visible) {
|
|
32
|
-
(_b = (_a = this.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
33
|
-
}
|
|
34
|
-
}, onMouseLeave: () => {
|
|
35
|
-
var _a, _b;
|
|
36
|
-
if (visible) {
|
|
37
|
-
(_b = (_a = this.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
38
|
-
}
|
|
39
|
-
} }));
|
|
40
|
-
}
|
|
41
|
-
;
|
|
42
|
-
};
|
|
43
|
-
return React.createElement(IconRenderer, null);
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
focus() {
|
|
47
|
-
var _a, _b;
|
|
48
|
-
(_b = (_a = this.component) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
49
|
-
}
|
|
50
|
-
render() {
|
|
51
|
-
return React.createElement(Input.Password, Object.assign({}, this.props, { iconRender: this.getIcon, visibilityToggle: true, ref: (component) => {
|
|
52
|
-
this.component = component;
|
|
53
|
-
} }));
|
|
54
|
-
}
|
|
55
|
-
}
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { EyeInvisibleOutlined, EyeOutlined } from "@ant-design/icons";
|
|
3
|
+
import { Input } from "antd";
|
|
4
|
+
export default class PasswordInput extends React.Component {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
super(props);
|
|
7
|
+
this.component = null;
|
|
8
|
+
this.getIcon = (visible) => {
|
|
9
|
+
const IconRenderer = class IconRend extends React.Component {
|
|
10
|
+
render() {
|
|
11
|
+
const IconClass = visible ? EyeOutlined : EyeInvisibleOutlined;
|
|
12
|
+
return (React.createElement(IconClass, { key: "password-icon", className: "ant-input-password-icon", onTouchStart: (e) => {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
e.preventDefault();
|
|
15
|
+
if (!visible) {
|
|
16
|
+
(_b = (_a = this.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
17
|
+
}
|
|
18
|
+
}, onTouchEnd: () => {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
if (visible) {
|
|
21
|
+
(_b = (_a = this.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
22
|
+
}
|
|
23
|
+
}, onMouseDown: (e) => {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
e.preventDefault();
|
|
26
|
+
if (!visible) {
|
|
27
|
+
(_b = (_a = this.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
28
|
+
}
|
|
29
|
+
}, onMouseUp: () => {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
if (visible) {
|
|
32
|
+
(_b = (_a = this.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
33
|
+
}
|
|
34
|
+
}, onMouseLeave: () => {
|
|
35
|
+
var _a, _b;
|
|
36
|
+
if (visible) {
|
|
37
|
+
(_b = (_a = this.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
38
|
+
}
|
|
39
|
+
} }));
|
|
40
|
+
}
|
|
41
|
+
;
|
|
42
|
+
};
|
|
43
|
+
return React.createElement(IconRenderer, null);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
focus() {
|
|
47
|
+
var _a, _b;
|
|
48
|
+
(_b = (_a = this.component) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
49
|
+
}
|
|
50
|
+
render() {
|
|
51
|
+
return React.createElement(Input.Password, Object.assign({}, this.props, { iconRender: this.getIcon, visibilityToggle: true, ref: (component) => {
|
|
52
|
+
this.component = component;
|
|
53
|
+
} }));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
56
|
//# sourceMappingURL=passwordInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"passwordInput.js","sourceRoot":"","sources":["../../../../components/input/passwordInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAC,oBAAoB,EAAE,WAAW,EAAC,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAC,KAAK,EAAC,MAAM,MAAM,CAAC;AAE3B,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK,CAAC,SAAiC;IAG9E,YAAY,KAA8B;QACtC,KAAK,CAAC,KAAK,CAAC,CAAC;QAHT,cAAS,GAAe,IAAI,CAAC;QAUrC,YAAO,GAAG,CAAC,OAAgB,EAAE,EAAE;YAC3B,MAAM,YAAY,GAAG,MAAM,QAAS,SAAQ,KAAK,CAAC,SAAmB;gBACjE,MAAM;oBACF,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,oBAAoB,CAAC;oBAC/D,OAAO,CAAC,oBAAC,SAAS,IACd,GAAG,EAAC,eAAe,EACnB,SAAS,EAAC,yBAAyB,EACnC,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE;;4BAChB,CAAC,CAAC,cAAc,EAAE,CAAC;4BACnB,IAAI,CAAC,OAAO,EAAE;
|
|
1
|
+
{"version":3,"file":"passwordInput.js","sourceRoot":"","sources":["../../../../components/input/passwordInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAC,oBAAoB,EAAE,WAAW,EAAC,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAC,KAAK,EAAC,MAAM,MAAM,CAAC;AAE3B,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAA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AC;wBACL,CAAC,GACH,CAAC,CAAC;gBACR,CAAC;gBAAA,CAAC;aACL,CAAC;YACF,OAAO,oBAAC,YAAY,OAAE,CAAC;QAC3B,CAAC,CAAA;IA5CD,CAAC;IAED,KAAK;;QACD,MAAA,MAAA,IAAI,CAAC,SAAS,0CAAE,KAAK,kDAAI,CAAC;IAC9B,CAAC;IA0CD,MAAM;QACF,OAAO,oBAAC,KAAK,CAAC,QAAQ,oBAAK,IAAI,CAAC,KAAK,IAAE,UAAU,EAAE,IAAI,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,EAAE;gBACxG,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;YAC/B,CAAC,IAAG,CAAA;IACR,CAAC;CACJ","sourcesContent":["import React from \"react\"\nimport {PasswordProps} from \"antd/lib/input/Password\";\nimport {EyeInvisibleOutlined, EyeOutlined} from \"@ant-design/icons\";\nimport {Input} from \"antd\";\n\nexport default class PasswordInput extends React.Component<PasswordProps, unknown> {\n private component: any | null = null;\n\n constructor(props: Readonly<PasswordProps>) {\n super(props);\n }\n\n focus() {\n this.component?.focus?.();\n }\n\n getIcon = (visible: boolean) => {\n const IconRenderer = class IconRend extends React.Component<any, any> {\n render() {\n const IconClass = visible ? EyeOutlined : EyeInvisibleOutlined;\n return (<IconClass\n key=\"password-icon\"\n className=\"ant-input-password-icon\"\n onTouchStart={(e) => {\n e.preventDefault();\n if (!visible) {\n this.props.onClick?.();\n }\n }}\n onTouchEnd={() => {\n if (visible) {\n this.props.onClick?.();\n }\n }}\n onMouseDown={(e) => {\n e.preventDefault();\n if (!visible) {\n this.props.onClick?.();\n }\n }}\n onMouseUp={() => {\n if (visible) {\n this.props.onClick?.();\n }\n }}\n onMouseLeave={() => {\n if (visible) {\n this.props.onClick?.();\n }\n }}\n />);\n };\n };\n return <IconRenderer/>;\n }\n\n render() {\n return <Input.Password {...this.props} iconRender={this.getIcon} visibilityToggle={true} ref={(component) => {\n this.component = component;\n }}/>\n }\n}\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { AutoCompleteProps } from "antd/es/auto-complete";
|
|
2
|
-
import React from "react";
|
|
3
|
-
interface SimpleAutoCompleteState {
|
|
4
|
-
opened: boolean;
|
|
5
|
-
}
|
|
6
|
-
export default class SimpleAutoComplete extends React.Component<AutoCompleteProps, SimpleAutoCompleteState> {
|
|
7
|
-
private autocomplete;
|
|
8
|
-
constructor(props: Readonly<AutoCompleteProps>);
|
|
9
|
-
focus(): void;
|
|
10
|
-
render(): JSX.Element;
|
|
11
|
-
}
|
|
12
|
-
export {};
|
|
1
|
+
import { AutoCompleteProps } from "antd/es/auto-complete";
|
|
2
|
+
import React from "react";
|
|
3
|
+
interface SimpleAutoCompleteState {
|
|
4
|
+
opened: boolean;
|
|
5
|
+
}
|
|
6
|
+
export default class SimpleAutoComplete extends React.Component<AutoCompleteProps, SimpleAutoCompleteState> {
|
|
7
|
+
private autocomplete;
|
|
8
|
+
constructor(props: Readonly<AutoCompleteProps>);
|
|
9
|
+
focus(): void;
|
|
10
|
+
render(): React.JSX.Element;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -1,44 +1,42 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import React from "react";
|
|
13
|
-
import { AutoComplete, Input } from "antd";
|
|
14
|
-
import
|
|
15
|
-
export default class SimpleAutoComplete extends React.Component {
|
|
16
|
-
constructor(props) {
|
|
17
|
-
super(props);
|
|
18
|
-
this.state = {
|
|
19
|
-
opened: false,
|
|
20
|
-
};
|
|
21
|
-
this.autocomplete = React.createRef();
|
|
22
|
-
this.focus = this.focus.bind(this);
|
|
23
|
-
}
|
|
24
|
-
focus() {
|
|
25
|
-
var _a;
|
|
26
|
-
(_a = this.autocomplete.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
27
|
-
}
|
|
28
|
-
render() {
|
|
29
|
-
let _a = this.props, { disabled, options, size } = _a, rest = __rest(_a, ["disabled", "options", "size"]);
|
|
30
|
-
const searchHistoryPresent = this.props.options && this.props.options.length > 0;
|
|
31
|
-
return (React.createElement(AutoComplete, Object.assign({
|
|
32
|
-
this.setState({ opened: false });
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
}
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React from "react";
|
|
13
|
+
import { AutoComplete, Input } from "antd";
|
|
14
|
+
import DropdownArrow from "../icons/dropdownArrow";
|
|
15
|
+
export default class SimpleAutoComplete extends React.Component {
|
|
16
|
+
constructor(props) {
|
|
17
|
+
super(props);
|
|
18
|
+
this.state = {
|
|
19
|
+
opened: false,
|
|
20
|
+
};
|
|
21
|
+
this.autocomplete = React.createRef();
|
|
22
|
+
this.focus = this.focus.bind(this);
|
|
23
|
+
}
|
|
24
|
+
focus() {
|
|
25
|
+
var _a;
|
|
26
|
+
(_a = this.autocomplete.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
27
|
+
}
|
|
28
|
+
render() {
|
|
29
|
+
let _a = this.props, { disabled, options, size } = _a, rest = __rest(_a, ["disabled", "options", "size"]);
|
|
30
|
+
const searchHistoryPresent = this.props.options && this.props.options.length > 0;
|
|
31
|
+
return (React.createElement(AutoComplete, Object.assign({ options: this.state.opened ? options : [], style: { width: 200 }, defaultOpen: false, defaultActiveFirstOption: false, disabled: disabled, onSelect: () => {
|
|
32
|
+
this.setState({ opened: false });
|
|
33
|
+
} }, rest),
|
|
34
|
+
React.createElement(Input, { size: size, allowClear: !disabled, suffix: searchHistoryPresent &&
|
|
35
|
+
React.createElement(DropdownArrow, { opened: this.state.opened, onClick: () => {
|
|
36
|
+
if (!this.props.disabled) {
|
|
37
|
+
this.setState({ opened: !this.state.opened });
|
|
38
|
+
}
|
|
39
|
+
} }), disabled: disabled })));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
44
42
|
//# sourceMappingURL=simpleAutoComplete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simpleAutoComplete.js","sourceRoot":"","sources":["../../../../components/input/simpleAutoComplete.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,YAAY,EAAE,KAAK,EAAC,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"simpleAutoComplete.js","sourceRoot":"","sources":["../../../../components/input/simpleAutoComplete.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,YAAY,EAAE,KAAK,EAAC,MAAM,MAAM,CAAC;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,IAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EACzB,OAAO,EAAE,GAAG,EAAE;4BACV,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;gCACvB,IAAI,CAAC,QAAQ,CAAC,EAAC,MAAM,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAC,CAAC,CAAC;4BAChD,CAAC;wBACL,CAAC,GAAG,EAEvB,QAAQ,EAAE,QAAQ,GAAI,CACf,CAClB,CAAC;IACN,CAAC;CACJ","sourcesContent":["import {AutoCompleteProps} from \"antd/es/auto-complete\";\r\nimport React from \"react\";\r\nimport {AutoComplete, Input} from \"antd\";\r\nimport {RefSelectProps} from \"antd/es/select\";\r\nimport DropdownArrow from \"../icons/dropdownArrow\";\r\n\r\ninterface SimpleAutoCompleteState {\r\n opened: boolean\r\n}\r\n\r\nexport default class SimpleAutoComplete extends React.Component<AutoCompleteProps, SimpleAutoCompleteState> {\r\n\r\n private autocomplete: React.RefObject<RefSelectProps>;\r\n\r\n constructor(props: Readonly<AutoCompleteProps>) {\r\n super(props);\r\n this.state = {\r\n opened: false,\r\n };\r\n\r\n this.autocomplete = React.createRef();\r\n this.focus = this.focus.bind(this);\r\n }\r\n\r\n focus() {\r\n this.autocomplete.current?.focus();\r\n }\r\n\r\n render() {\r\n let {disabled, options, size, ...rest} = this.props;\r\n const searchHistoryPresent = this.props.options && this.props.options.length > 0;\r\n return (\r\n <AutoComplete\r\n options={this.state.opened ? options : []}\r\n style={{width: 200}}\r\n defaultOpen={false}\r\n defaultActiveFirstOption={false}\r\n disabled={disabled}\r\n onSelect={() => {\r\n this.setState({opened: false});\r\n }}\r\n {...rest}\r\n >\r\n <Input\r\n size={size}\r\n allowClear={!disabled}\r\n suffix={\r\n searchHistoryPresent &&\r\n <DropdownArrow opened={this.state.opened}\r\n onClick={() => {\r\n if (!this.props.disabled) {\r\n this.setState({opened: !this.state.opened});\r\n }\r\n }}/>\r\n }\r\n disabled={disabled} />\r\n </AutoComplete>\r\n );\r\n }\r\n}"]}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
declare class Span {
|
|
3
|
-
beginIndex: number;
|
|
4
|
-
endIndex: number;
|
|
5
|
-
text: string;
|
|
6
|
-
isMark: boolean;
|
|
7
|
-
markClasses: Set<string>;
|
|
8
|
-
constructor(text: string, beginIndex: number);
|
|
9
|
-
setMark(className: string): void;
|
|
10
|
-
carve(beginIndex2: number): Span;
|
|
11
|
-
get className(): string;
|
|
12
|
-
render(): JSX.Element;
|
|
13
|
-
}
|
|
14
|
-
export default function extractSpansOfClasses(value: string, ranges: number[][]): Span[];
|
|
15
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare class Span {
|
|
3
|
+
beginIndex: number;
|
|
4
|
+
endIndex: number;
|
|
5
|
+
text: string;
|
|
6
|
+
isMark: boolean;
|
|
7
|
+
markClasses: Set<string>;
|
|
8
|
+
constructor(text: string, beginIndex: number);
|
|
9
|
+
setMark(className: string): void;
|
|
10
|
+
carve(beginIndex2: number): Span;
|
|
11
|
+
get className(): string;
|
|
12
|
+
render(): React.JSX.Element;
|
|
13
|
+
}
|
|
14
|
+
export default function extractSpansOfClasses(value: string, ranges: number[][]): Span[];
|
|
15
|
+
export {};
|
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
class Span {
|
|
3
|
-
constructor(text, beginIndex) {
|
|
4
|
-
this.beginIndex = beginIndex;
|
|
5
|
-
this.endIndex = beginIndex + text.length;
|
|
6
|
-
this.text = text;
|
|
7
|
-
this.isMark = false;
|
|
8
|
-
this.markClasses = new Set();
|
|
9
|
-
}
|
|
10
|
-
setMark(className) {
|
|
11
|
-
this.isMark = true;
|
|
12
|
-
if (className) {
|
|
13
|
-
for (let c of className.split(' ')) {
|
|
14
|
-
this.markClasses.add(c);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
carve(beginIndex2) {
|
|
19
|
-
let rightText = this.text.slice(beginIndex2 - this.beginIndex);
|
|
20
|
-
this.text = this.text.slice(0, beginIndex2 - this.beginIndex);
|
|
21
|
-
this.endIndex = beginIndex2;
|
|
22
|
-
let right = new Span(rightText, beginIndex2);
|
|
23
|
-
right.isMark = this.isMark;
|
|
24
|
-
right.markClasses = new Set([...this.markClasses]);
|
|
25
|
-
return right;
|
|
26
|
-
}
|
|
27
|
-
get className() {
|
|
28
|
-
if (this.markClasses && this.markClasses.size > 0) {
|
|
29
|
-
return [...this.markClasses].sort().join(" ");
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
return "";
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
render() {
|
|
36
|
-
if (this.isMark) {
|
|
37
|
-
let className = this.className;
|
|
38
|
-
if (className) {
|
|
39
|
-
return (React.createElement("mark", { key: this.beginIndex, className: className, title: this.text }, this.text));
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
return (React.createElement("mark", { key: this.beginIndex, title: this.text }, this.text));
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
return (React.createElement("span", { key: this.beginIndex, title: this.text }, this.text));
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
export default function extractSpansOfClasses(value, ranges) {
|
|
51
|
-
let spans = [new Span(value, 0)];
|
|
52
|
-
for (let range of ranges) {
|
|
53
|
-
let beginIndex = range[0];
|
|
54
|
-
let endIndex = range[1];
|
|
55
|
-
let className = range.className;
|
|
56
|
-
for (let i = 0; i < spans.length; i++) {
|
|
57
|
-
let span = spans[i];
|
|
58
|
-
if (beginIndex < span.endIndex) {
|
|
59
|
-
if (beginIndex == span.beginIndex) {
|
|
60
|
-
if (endIndex < span.endIndex) {
|
|
61
|
-
let span2 = span.carve(endIndex);
|
|
62
|
-
span.setMark(className);
|
|
63
|
-
spans.splice(i + 1, 0, span2);
|
|
64
|
-
beginIndex = endIndex;
|
|
65
|
-
i += 1;
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
span.setMark(className);
|
|
69
|
-
beginIndex = span.endIndex;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
if (endIndex < span.endIndex) {
|
|
74
|
-
let span2 = span.carve(beginIndex);
|
|
75
|
-
let span3 = span2.carve(endIndex);
|
|
76
|
-
span2.setMark(className);
|
|
77
|
-
spans.splice(i + 1, 0, span2, span3);
|
|
78
|
-
beginIndex = endIndex;
|
|
79
|
-
i += 2;
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
let span2 = span.carve(beginIndex);
|
|
83
|
-
span2.setMark(className);
|
|
84
|
-
spans.splice(i + 1, 0, span2);
|
|
85
|
-
beginIndex = span2.endIndex;
|
|
86
|
-
i += 1;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
if (beginIndex == endIndex) {
|
|
91
|
-
break;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return spans;
|
|
96
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
class Span {
|
|
3
|
+
constructor(text, beginIndex) {
|
|
4
|
+
this.beginIndex = beginIndex;
|
|
5
|
+
this.endIndex = beginIndex + text.length;
|
|
6
|
+
this.text = text;
|
|
7
|
+
this.isMark = false;
|
|
8
|
+
this.markClasses = new Set();
|
|
9
|
+
}
|
|
10
|
+
setMark(className) {
|
|
11
|
+
this.isMark = true;
|
|
12
|
+
if (className) {
|
|
13
|
+
for (let c of className.split(' ')) {
|
|
14
|
+
this.markClasses.add(c);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
carve(beginIndex2) {
|
|
19
|
+
let rightText = this.text.slice(beginIndex2 - this.beginIndex);
|
|
20
|
+
this.text = this.text.slice(0, beginIndex2 - this.beginIndex);
|
|
21
|
+
this.endIndex = beginIndex2;
|
|
22
|
+
let right = new Span(rightText, beginIndex2);
|
|
23
|
+
right.isMark = this.isMark;
|
|
24
|
+
right.markClasses = new Set([...this.markClasses]);
|
|
25
|
+
return right;
|
|
26
|
+
}
|
|
27
|
+
get className() {
|
|
28
|
+
if (this.markClasses && this.markClasses.size > 0) {
|
|
29
|
+
return [...this.markClasses].sort().join(" ");
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
return "";
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
if (this.isMark) {
|
|
37
|
+
let className = this.className;
|
|
38
|
+
if (className) {
|
|
39
|
+
return (React.createElement("mark", { key: this.beginIndex, className: className, title: this.text }, this.text));
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
return (React.createElement("mark", { key: this.beginIndex, title: this.text }, this.text));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return (React.createElement("span", { key: this.beginIndex, title: this.text }, this.text));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export default function extractSpansOfClasses(value, ranges) {
|
|
51
|
+
let spans = [new Span(value, 0)];
|
|
52
|
+
for (let range of ranges) {
|
|
53
|
+
let beginIndex = range[0];
|
|
54
|
+
let endIndex = range[1];
|
|
55
|
+
let className = range.className;
|
|
56
|
+
for (let i = 0; i < spans.length; i++) {
|
|
57
|
+
let span = spans[i];
|
|
58
|
+
if (beginIndex < span.endIndex) {
|
|
59
|
+
if (beginIndex == span.beginIndex) {
|
|
60
|
+
if (endIndex < span.endIndex) {
|
|
61
|
+
let span2 = span.carve(endIndex);
|
|
62
|
+
span.setMark(className);
|
|
63
|
+
spans.splice(i + 1, 0, span2);
|
|
64
|
+
beginIndex = endIndex;
|
|
65
|
+
i += 1;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
span.setMark(className);
|
|
69
|
+
beginIndex = span.endIndex;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
if (endIndex < span.endIndex) {
|
|
74
|
+
let span2 = span.carve(beginIndex);
|
|
75
|
+
let span3 = span2.carve(endIndex);
|
|
76
|
+
span2.setMark(className);
|
|
77
|
+
spans.splice(i + 1, 0, span2, span3);
|
|
78
|
+
beginIndex = endIndex;
|
|
79
|
+
i += 2;
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
let span2 = span.carve(beginIndex);
|
|
83
|
+
span2.setMark(className);
|
|
84
|
+
spans.splice(i + 1, 0, span2);
|
|
85
|
+
beginIndex = span2.endIndex;
|
|
86
|
+
i += 1;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (beginIndex == endIndex) {
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return spans;
|
|
96
|
+
}
|
|
97
97
|
//# sourceMappingURL=extractSpansOfClasses.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractSpansOfClasses.js","sourceRoot":"","sources":["../../../../../components/input/textarea/extractSpansOfClasses.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,IAAI;IAON,YAAY,IAAW,EAAE,UAAiB;QACtC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,WAAW,GAAG,IAAI,GAAG,EAAE,CAAC;IACjC,CAAC;IAED,OAAO,CAAC,SAAiB;QACrB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,SAAS,EAAE;
|
|
1
|
+
{"version":3,"file":"extractSpansOfClasses.js","sourceRoot":"","sources":["../../../../../components/input/textarea/extractSpansOfClasses.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CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;wBACnC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;wBACzB,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;wBAC9B,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC;wBAC5B,CAAC,IAAI,CAAC,CAAC;oBACX,CAAC;gBACL,CAAC;YACL,CAAC;YACD,IAAI,UAAU,IAAI,QAAQ,EAAE,CAAC;gBACzB,MAAM;YACV,CAAC;QACL,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC","sourcesContent":["import React from 'react';\n\nclass Span {\n beginIndex: number\n endIndex: number\n text: string\n isMark: boolean\n markClasses: Set<string>\n\n constructor(text:string, beginIndex:number) {\n this.beginIndex = beginIndex;\n this.endIndex = beginIndex + text.length; // Like String.slice, it is inclusive.\n this.text = text;\n this.isMark = false;\n this.markClasses = new Set();\n }\n\n setMark(className: string) {\n this.isMark = true;\n if (className) {\n for (let c of className.split(' ')) {\n this.markClasses.add(c);\n }\n }\n }\n\n carve(beginIndex2: number) {\n // Carves self to take a bit off the right and returns that carving.\n let rightText = this.text.slice(beginIndex2 - this.beginIndex);\n this.text = this.text.slice(0, beginIndex2 - this.beginIndex);\n this.endIndex = beginIndex2;\n\n let right = new Span(rightText, beginIndex2);\n right.isMark = this.isMark;\n right.markClasses = new Set([...this.markClasses]);\n\n return right;\n }\n\n get className() {\n if (this.markClasses && this.markClasses.size > 0) {\n return [...this.markClasses].sort().join(\" \");\n } else {\n return \"\";\n }\n }\n\n render() {\n if (this.isMark) {\n let className = this.className;\n if (className) {\n return(\n <mark key={this.beginIndex} className={className} title={this.text}>\n {this.text}\n </mark>\n );\n } else {\n return(<mark key={this.beginIndex} title={this.text}>{this.text}</mark>);\n }\n } else {\n return(<span key={this.beginIndex} title={this.text}>{this.text}</span>);\n }\n }\n}\n\nexport default function extractSpansOfClasses(value:string, ranges:number[][]) {\n /* Returns value broken into a series of Span classes. These\n * can be converted to JSX via the render command.\n */\n \n let spans = [new Span(value, 0)];\n\n for (let range of ranges) {\n let beginIndex = range[0];\n let endIndex = range[1];\n let className = (range as any).className as string;\n\n for (let i = 0; i < spans.length; i++) {\n let span = spans[i];\n\n // since spans are sorted, So this is always true: beginIndex >= span.beginIndex.\n if (beginIndex < span.endIndex) {\n if (beginIndex == span.beginIndex) {\n if (endIndex < span.endIndex) {\n // [range]\n // [s p a n]\n let span2 = span.carve(endIndex);\n span.setMark(className);\n spans.splice(i + 1, 0, span2);\n beginIndex = endIndex;\n i += 1;\n } else {\n // [range] or [r a n g e]\n // [span-] [span]\n span.setMark(className);\n beginIndex = span.endIndex;\n }\n } else {\n if (endIndex < span.endIndex) {\n // [range]\n // [s p a n]\n let span2 = span.carve(beginIndex);\n let span3 = span2.carve(endIndex);\n span2.setMark(className);\n spans.splice(i + 1, 0, span2, span3);\n beginIndex = endIndex;\n i += 2;\n } else {\n // [range] or [range]\n // [s p a n] [span]\n let span2 = span.carve(beginIndex);\n span2.setMark(className);\n spans.splice(i + 1, 0, span2);\n beginIndex = span2.endIndex;\n i += 1;\n }\n }\n }\n if (beginIndex == endIndex) {\n break;\n }\n }\n }\n return spans;\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function getRanges(input: any, highlight: any): number[][];
|
|
1
|
+
export default function getRanges(input: any, highlight: any): number[][];
|