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,28 +1,28 @@
|
|
|
1
|
-
import { KeyboardEvent } from 'react';
|
|
2
|
-
export declare function isUndo(e: KeyboardEvent): boolean;
|
|
3
|
-
export declare function isRedo(e: KeyboardEvent): boolean;
|
|
4
|
-
|
|
5
|
-
start: number;
|
|
6
|
-
end: number;
|
|
7
|
-
};
|
|
8
|
-
export declare function getSelection(el: HTMLInputElement): GetSelectionResult;
|
|
9
|
-
export declare function setSelection(el: HTMLInputElement, selection: GetSelectionResult): void;
|
|
10
|
-
export declare function mergeFormatCharacters(formatCharacters: FormatCharacters): {
|
|
11
|
-
[x: string]: {
|
|
12
|
-
transform?(str: string): string;
|
|
13
|
-
validate(str: string): boolean;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export declare const ESCAPE_CHAR = "\\";
|
|
17
|
-
export declare const DIGIT_RE: RegExp;
|
|
18
|
-
export declare const LETTER_RE: RegExp;
|
|
19
|
-
export declare const ALPHANNUMERIC_RE: RegExp;
|
|
20
|
-
export declare const DEFAULT_PLACEHOLDER_CHAR = "_";
|
|
21
|
-
export declare const DEFAULT_FORMAT_CHARACTERS: FormatCharacters;
|
|
22
|
-
export
|
|
23
|
-
[key: string]: {
|
|
24
|
-
transform?(str: string): string;
|
|
25
|
-
validate(str: string): boolean;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
export {};
|
|
1
|
+
import { KeyboardEvent } from 'react';
|
|
2
|
+
export declare function isUndo(e: KeyboardEvent): boolean;
|
|
3
|
+
export declare function isRedo(e: KeyboardEvent): boolean;
|
|
4
|
+
type GetSelectionResult = {
|
|
5
|
+
start: number;
|
|
6
|
+
end: number;
|
|
7
|
+
};
|
|
8
|
+
export declare function getSelection(el: HTMLInputElement): GetSelectionResult;
|
|
9
|
+
export declare function setSelection(el: HTMLInputElement, selection: GetSelectionResult): void;
|
|
10
|
+
export declare function mergeFormatCharacters(formatCharacters: FormatCharacters): {
|
|
11
|
+
[x: string]: {
|
|
12
|
+
transform?(str: string): string;
|
|
13
|
+
validate(str: string): boolean;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare const ESCAPE_CHAR = "\\";
|
|
17
|
+
export declare const DIGIT_RE: RegExp;
|
|
18
|
+
export declare const LETTER_RE: RegExp;
|
|
19
|
+
export declare const ALPHANNUMERIC_RE: RegExp;
|
|
20
|
+
export declare const DEFAULT_PLACEHOLDER_CHAR = "_";
|
|
21
|
+
export declare const DEFAULT_FORMAT_CHARACTERS: FormatCharacters;
|
|
22
|
+
export type FormatCharacters = {
|
|
23
|
+
[key: string]: {
|
|
24
|
+
transform?(str: string): string;
|
|
25
|
+
validate(str: string): boolean;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export {};
|
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
let KEYCODE_Z =
|
|
2
|
-
let KEYCODE_Y =
|
|
3
|
-
export function isUndo(e) {
|
|
4
|
-
return ((e.ctrlKey || e.metaKey) &&
|
|
5
|
-
e.
|
|
6
|
-
}
|
|
7
|
-
export function isRedo(e) {
|
|
8
|
-
return ((e.ctrlKey || e.metaKey) &&
|
|
9
|
-
e.
|
|
10
|
-
}
|
|
11
|
-
export function getSelection(el) {
|
|
12
|
-
let start, end;
|
|
13
|
-
if (el.selectionStart !== undefined) {
|
|
14
|
-
start = el.selectionStart;
|
|
15
|
-
end = el.selectionEnd;
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
try {
|
|
19
|
-
el.focus();
|
|
20
|
-
let rangeEl = el.createTextRange();
|
|
21
|
-
let clone = rangeEl.duplicate();
|
|
22
|
-
rangeEl.moveToBookmark(document.selection.createRange().getBookmark());
|
|
23
|
-
clone.setEndPoint('EndToStart', rangeEl);
|
|
24
|
-
start = clone.text.length;
|
|
25
|
-
end = start + rangeEl.text.length;
|
|
26
|
-
}
|
|
27
|
-
catch (e) {
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return { start, end };
|
|
31
|
-
}
|
|
32
|
-
let selectionTimeout;
|
|
33
|
-
export function setSelection(el, selection) {
|
|
34
|
-
clearTimeout(selectionTimeout);
|
|
35
|
-
try {
|
|
36
|
-
if (el.selectionStart === selection.start &&
|
|
37
|
-
el.selectionEnd === selection.end) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
if (el.selectionStart !== undefined) {
|
|
41
|
-
el.focus();
|
|
42
|
-
el.setSelectionRange(selection.start, selection.end);
|
|
43
|
-
selectionTimeout = setTimeout(() => {
|
|
44
|
-
setSelection(el, selection);
|
|
45
|
-
}, 0);
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
el.focus();
|
|
49
|
-
let rangeEl = el.createTextRange();
|
|
50
|
-
rangeEl.collapse(true);
|
|
51
|
-
rangeEl.moveStart('character', selection.start);
|
|
52
|
-
rangeEl.moveEnd('character', selection.end - selection.start);
|
|
53
|
-
rangeEl.select();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
catch (e) {
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
export function mergeFormatCharacters(formatCharacters) {
|
|
60
|
-
var merged = Object.assign({}, DEFAULT_FORMAT_CHARACTERS);
|
|
61
|
-
if (formatCharacters) {
|
|
62
|
-
var chars = Object.keys(formatCharacters);
|
|
63
|
-
for (var i = 0, l = chars.length; i < l; i++) {
|
|
64
|
-
var char = chars[i];
|
|
65
|
-
if (formatCharacters[char] == null) {
|
|
66
|
-
delete merged[char];
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
merged[char] = formatCharacters[char];
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return merged;
|
|
74
|
-
}
|
|
75
|
-
export const ESCAPE_CHAR = '\\';
|
|
76
|
-
export const DIGIT_RE = /^\d$/;
|
|
77
|
-
export const LETTER_RE = /^[A-Za-z]$/;
|
|
78
|
-
export const ALPHANNUMERIC_RE = /^[\dA-Za-z]$/;
|
|
79
|
-
export const DEFAULT_PLACEHOLDER_CHAR = '_';
|
|
80
|
-
export const DEFAULT_FORMAT_CHARACTERS = {
|
|
81
|
-
'*': {
|
|
82
|
-
validate: function (char) {
|
|
83
|
-
return ALPHANNUMERIC_RE.test(char);
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
'1': {
|
|
87
|
-
validate: function (char) {
|
|
88
|
-
return DIGIT_RE.test(char);
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
a: {
|
|
92
|
-
validate: function (char) {
|
|
93
|
-
return LETTER_RE.test(char);
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
A: {
|
|
97
|
-
validate: function (char) {
|
|
98
|
-
return LETTER_RE.test(char);
|
|
99
|
-
},
|
|
100
|
-
transform: function (char) {
|
|
101
|
-
return char.toUpperCase();
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
'#': {
|
|
105
|
-
validate: function (char) {
|
|
106
|
-
return ALPHANNUMERIC_RE.test(char);
|
|
107
|
-
},
|
|
108
|
-
transform: function (char) {
|
|
109
|
-
return char.toUpperCase();
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
};
|
|
1
|
+
let KEYCODE_Z = "KeyZ";
|
|
2
|
+
let KEYCODE_Y = "KeyY";
|
|
3
|
+
export function isUndo(e) {
|
|
4
|
+
return ((e.ctrlKey || e.metaKey) &&
|
|
5
|
+
e.code === (e.shiftKey ? KEYCODE_Y : KEYCODE_Z));
|
|
6
|
+
}
|
|
7
|
+
export function isRedo(e) {
|
|
8
|
+
return ((e.ctrlKey || e.metaKey) &&
|
|
9
|
+
e.code === (e.shiftKey ? KEYCODE_Z : KEYCODE_Y));
|
|
10
|
+
}
|
|
11
|
+
export function getSelection(el) {
|
|
12
|
+
let start, end;
|
|
13
|
+
if (el.selectionStart !== undefined) {
|
|
14
|
+
start = el.selectionStart;
|
|
15
|
+
end = el.selectionEnd;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
try {
|
|
19
|
+
el.focus();
|
|
20
|
+
let rangeEl = el.createTextRange();
|
|
21
|
+
let clone = rangeEl.duplicate();
|
|
22
|
+
rangeEl.moveToBookmark(document.selection.createRange().getBookmark());
|
|
23
|
+
clone.setEndPoint('EndToStart', rangeEl);
|
|
24
|
+
start = clone.text.length;
|
|
25
|
+
end = start + rangeEl.text.length;
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return { start, end };
|
|
31
|
+
}
|
|
32
|
+
let selectionTimeout;
|
|
33
|
+
export function setSelection(el, selection) {
|
|
34
|
+
clearTimeout(selectionTimeout);
|
|
35
|
+
try {
|
|
36
|
+
if (el.selectionStart === selection.start &&
|
|
37
|
+
el.selectionEnd === selection.end) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (el.selectionStart !== undefined) {
|
|
41
|
+
el.focus();
|
|
42
|
+
el.setSelectionRange(selection.start, selection.end);
|
|
43
|
+
selectionTimeout = setTimeout(() => {
|
|
44
|
+
setSelection(el, selection);
|
|
45
|
+
}, 0);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
el.focus();
|
|
49
|
+
let rangeEl = el.createTextRange();
|
|
50
|
+
rangeEl.collapse(true);
|
|
51
|
+
rangeEl.moveStart('character', selection.start);
|
|
52
|
+
rangeEl.moveEnd('character', selection.end - selection.start);
|
|
53
|
+
rangeEl.select();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export function mergeFormatCharacters(formatCharacters) {
|
|
60
|
+
var merged = Object.assign({}, DEFAULT_FORMAT_CHARACTERS);
|
|
61
|
+
if (formatCharacters) {
|
|
62
|
+
var chars = Object.keys(formatCharacters);
|
|
63
|
+
for (var i = 0, l = chars.length; i < l; i++) {
|
|
64
|
+
var char = chars[i];
|
|
65
|
+
if (formatCharacters[char] == null) {
|
|
66
|
+
delete merged[char];
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
merged[char] = formatCharacters[char];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return merged;
|
|
74
|
+
}
|
|
75
|
+
export const ESCAPE_CHAR = '\\';
|
|
76
|
+
export const DIGIT_RE = /^\d$/;
|
|
77
|
+
export const LETTER_RE = /^[A-Za-z]$/;
|
|
78
|
+
export const ALPHANNUMERIC_RE = /^[\dA-Za-z]$/;
|
|
79
|
+
export const DEFAULT_PLACEHOLDER_CHAR = '_';
|
|
80
|
+
export const DEFAULT_FORMAT_CHARACTERS = {
|
|
81
|
+
'*': {
|
|
82
|
+
validate: function (char) {
|
|
83
|
+
return ALPHANNUMERIC_RE.test(char);
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
'1': {
|
|
87
|
+
validate: function (char) {
|
|
88
|
+
return DIGIT_RE.test(char);
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
a: {
|
|
92
|
+
validate: function (char) {
|
|
93
|
+
return LETTER_RE.test(char);
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
A: {
|
|
97
|
+
validate: function (char) {
|
|
98
|
+
return LETTER_RE.test(char);
|
|
99
|
+
},
|
|
100
|
+
transform: function (char) {
|
|
101
|
+
return char.toUpperCase();
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
'#': {
|
|
105
|
+
validate: function (char) {
|
|
106
|
+
return ALPHANNUMERIC_RE.test(char);
|
|
107
|
+
},
|
|
108
|
+
transform: function (char) {
|
|
109
|
+
return char.toUpperCase();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
113
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../components/input/mask/helpers.ts"],"names":[],"mappings":"AAEA,IAAI,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../components/input/mask/helpers.ts"],"names":[],"mappings":"AAEA,IAAI,SAAS,GAAG,MAAM,CAAC;AACvB,IAAI,SAAS,GAAG,MAAM,CAAC;AAEvB,MAAM,UAAU,MAAM,CAAC,CAAgB;IACnC,OAAO,CACH,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC;QACxB,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAClD,CAAC;AACN,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,CAAgB;IACnC,OAAO,CACH,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC;QACxB,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAClD,CAAC;AACN,CAAC;AAID,MAAM,UAAU,YAAY,CAAC,E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=== (e.shiftKey ? KEYCODE_Y : KEYCODE_Z)\r\n );\r\n}\r\n\r\nexport function isRedo(e: KeyboardEvent): boolean {\r\n return (\r\n (e.ctrlKey || e.metaKey) &&\r\n e.code === (e.shiftKey ? KEYCODE_Z : KEYCODE_Y)\r\n );\r\n}\r\n\r\ntype GetSelectionResult = { start: number; end: number };\r\n\r\nexport function getSelection(el: HTMLInputElement): GetSelectionResult {\r\n let start, end;\r\n if (el.selectionStart !== undefined) {\r\n start = el.selectionStart;\r\n end = el.selectionEnd;\r\n } else {\r\n try {\r\n el.focus();\r\n // @ts-ignore (IE only)\r\n let rangeEl = el.createTextRange();\r\n let clone = rangeEl.duplicate();\r\n\r\n // @ts-ignore (IE only)\r\n rangeEl.moveToBookmark(document.selection.createRange().getBookmark());\r\n clone.setEndPoint('EndToStart', rangeEl);\r\n\r\n start = clone.text.length;\r\n end = start + rangeEl.text.length;\r\n } catch (e) {\r\n /* not focused or not visible */\r\n }\r\n }\r\n\r\n return { start, end };\r\n}\r\n\r\nlet selectionTimeout: any;\r\nexport function setSelection(\r\n el: HTMLInputElement,\r\n selection: GetSelectionResult\r\n) {\r\n clearTimeout(selectionTimeout);\r\n\r\n try {\r\n if (\r\n el.selectionStart === selection.start &&\r\n el.selectionEnd === selection.end\r\n ) {\r\n return;\r\n }\r\n\r\n if (el.selectionStart !== undefined) {\r\n el.focus();\r\n el.setSelectionRange(selection.start, selection.end);\r\n\r\n // fix https://bugs.chromium.org/p/chromium/issues/detail?id=32865\r\n selectionTimeout = setTimeout(() => {\r\n setSelection(el, selection);\r\n }, 0);\r\n\r\n } else {\r\n el.focus();\r\n // @ts-ignore (IE only)\r\n let rangeEl = el.createTextRange();\r\n rangeEl.collapse(true);\r\n rangeEl.moveStart('character', selection.start);\r\n rangeEl.moveEnd('character', selection.end - selection.start);\r\n rangeEl.select();\r\n }\r\n } catch (e) {\r\n /* not focused or not visible */\r\n }\r\n}\r\n\r\n/**\r\n * Merge an object defining format characters into the defaults.\r\n * Passing null/undefined for en existing format character removes it.\r\n * Passing a definition for an existing format character overrides it.\r\n */\r\nexport function mergeFormatCharacters(formatCharacters: FormatCharacters) {\r\n var merged = { ...DEFAULT_FORMAT_CHARACTERS };\r\n if (formatCharacters) {\r\n var chars = Object.keys(formatCharacters);\r\n for (var i = 0, l = chars.length; i < l; i++) {\r\n var char = chars[i];\r\n if (formatCharacters[char] == null) {\r\n delete merged[char];\r\n } else {\r\n merged[char] = formatCharacters[char];\r\n }\r\n }\r\n }\r\n return merged;\r\n}\r\n\r\nexport const ESCAPE_CHAR = '\\\\';\r\n\r\nexport const DIGIT_RE = /^\\d$/;\r\nexport const LETTER_RE = /^[A-Za-z]$/;\r\nexport const ALPHANNUMERIC_RE = /^[\\dA-Za-z]$/;\r\n\r\nexport const DEFAULT_PLACEHOLDER_CHAR = '_';\r\n\r\nexport const DEFAULT_FORMAT_CHARACTERS: FormatCharacters = {\r\n '*': {\r\n validate: function(char: string) {\r\n return ALPHANNUMERIC_RE.test(char);\r\n }\r\n },\r\n '1': {\r\n validate: function(char: string) {\r\n return DIGIT_RE.test(char);\r\n }\r\n },\r\n a: {\r\n validate: function(char: string) {\r\n return LETTER_RE.test(char);\r\n }\r\n },\r\n A: {\r\n validate: function(char: string) {\r\n return LETTER_RE.test(char);\r\n },\r\n transform: function(char: string) {\r\n return char.toUpperCase();\r\n }\r\n },\r\n '#': {\r\n validate: function(char: string) {\r\n return ALPHANNUMERIC_RE.test(char);\r\n },\r\n transform: function(char: string) {\r\n return char.toUpperCase();\r\n }\r\n }\r\n};\r\n\r\nexport type FormatCharacters = {\r\n [key: string]: {\r\n transform?(str: string): string;\r\n validate(str: string): boolean;\r\n };\r\n};"]}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { FormatCharacters } from './helpers';
|
|
2
|
-
import { Pattern } from './pattern';
|
|
3
|
-
|
|
4
|
-
start: number;
|
|
5
|
-
end: number;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
formatCharacters: FormatCharacters;
|
|
9
|
-
pattern: string;
|
|
10
|
-
isRevealingMask: boolean;
|
|
11
|
-
placeholderChar: string;
|
|
12
|
-
selection: SelectionObject;
|
|
13
|
-
value: string;
|
|
14
|
-
};
|
|
15
|
-
export declare class InputMask {
|
|
16
|
-
static Pattern: typeof Pattern;
|
|
17
|
-
formatCharacters: FormatCharacters;
|
|
18
|
-
pattern: Pattern;
|
|
19
|
-
isRevealingMask: boolean;
|
|
20
|
-
placeholderChar: string;
|
|
21
|
-
selection: SelectionObject;
|
|
22
|
-
value: string[];
|
|
23
|
-
emptyValue: string;
|
|
24
|
-
_history: {
|
|
25
|
-
value: string;
|
|
26
|
-
selection: SelectionObject;
|
|
27
|
-
lastOp: string | null;
|
|
28
|
-
startUndo?: boolean;
|
|
29
|
-
}[];
|
|
30
|
-
_historyIndex: null | number;
|
|
31
|
-
_lastOp: null | string;
|
|
32
|
-
_lastSelection: null | SelectionObject;
|
|
33
|
-
constructor(options: Partial<Options>);
|
|
34
|
-
setPattern(patternSource: string, options: Partial<Options>): void;
|
|
35
|
-
setValue(value?: string): void;
|
|
36
|
-
_resetHistory(): void;
|
|
37
|
-
getValue(): string;
|
|
38
|
-
getRawValue(): string;
|
|
39
|
-
input(char: string): boolean;
|
|
40
|
-
backspace(): boolean;
|
|
41
|
-
paste(input: string): boolean;
|
|
42
|
-
undo(): boolean;
|
|
43
|
-
redo(): boolean;
|
|
44
|
-
setSelection(selection: SelectionObject): boolean;
|
|
45
|
-
}
|
|
46
|
-
export default InputMask;
|
|
1
|
+
import { FormatCharacters } from './helpers';
|
|
2
|
+
import { Pattern } from './pattern';
|
|
3
|
+
type SelectionObject = {
|
|
4
|
+
start: number;
|
|
5
|
+
end: number;
|
|
6
|
+
};
|
|
7
|
+
type Options = {
|
|
8
|
+
formatCharacters: FormatCharacters;
|
|
9
|
+
pattern: string;
|
|
10
|
+
isRevealingMask: boolean;
|
|
11
|
+
placeholderChar: string;
|
|
12
|
+
selection: SelectionObject;
|
|
13
|
+
value: string;
|
|
14
|
+
};
|
|
15
|
+
export declare class InputMask {
|
|
16
|
+
static Pattern: typeof Pattern;
|
|
17
|
+
formatCharacters: FormatCharacters;
|
|
18
|
+
pattern: Pattern;
|
|
19
|
+
isRevealingMask: boolean;
|
|
20
|
+
placeholderChar: string;
|
|
21
|
+
selection: SelectionObject;
|
|
22
|
+
value: string[];
|
|
23
|
+
emptyValue: string;
|
|
24
|
+
_history: {
|
|
25
|
+
value: string;
|
|
26
|
+
selection: SelectionObject;
|
|
27
|
+
lastOp: string | null;
|
|
28
|
+
startUndo?: boolean;
|
|
29
|
+
}[];
|
|
30
|
+
_historyIndex: null | number;
|
|
31
|
+
_lastOp: null | string;
|
|
32
|
+
_lastSelection: null | SelectionObject;
|
|
33
|
+
constructor(options: Partial<Options>);
|
|
34
|
+
setPattern(patternSource: string, options: Partial<Options>): void;
|
|
35
|
+
setValue(value?: string): void;
|
|
36
|
+
_resetHistory(): void;
|
|
37
|
+
getValue(): string;
|
|
38
|
+
getRawValue(): string;
|
|
39
|
+
input(char: string): boolean;
|
|
40
|
+
backspace(): boolean;
|
|
41
|
+
paste(input: string): boolean;
|
|
42
|
+
undo(): boolean;
|
|
43
|
+
redo(): boolean;
|
|
44
|
+
setSelection(selection: SelectionObject): boolean;
|
|
45
|
+
}
|
|
46
|
+
export default InputMask;
|