@homecode/ui 4.25.0 → 4.25.2

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.
@@ -75,6 +75,7 @@ var ICONS = {
75
75
  soundWave: () => import('./soundWave.svg.js'),
76
76
  sparks: () => import('./sparks.svg.js'),
77
77
  star: () => import('./star.svg.js'),
78
+ stopInCircle: () => import('./stopInCircle.svg.js'),
78
79
  syncArrows: () => import('./syncArrows.svg.js'),
79
80
  table: () => import('./table.svg.js'),
80
81
  telegram: () => import('./telegram.svg.js'),
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+
3
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
+ var SvgStopInCircle = function SvgStopInCircle(props) {
5
+ return /*#__PURE__*/React.createElement("svg", _extends({
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ fill: "currentColor",
8
+ viewBox: "0 0 24 24"
9
+ }, props), /*#__PURE__*/React.createElement("path", {
10
+ d: "M12.119.373a11.746 11.746 0 1 0 11.745 11.746A11.746 11.746 0 0 0 12.12.373m5.034 15.102a1.68 1.68 0 0 1-1.678 1.678H8.763a1.68 1.68 0 0 1-1.678-1.678V8.763a1.68 1.68 0 0 1 1.678-1.678h6.712a1.68 1.68 0 0 1 1.678 1.678z",
11
+ style: {
12
+ strokeWidth: 0.838985
13
+ }
14
+ }));
15
+ };
16
+
17
+ export { SvgStopInCircle as default };
@@ -10,54 +10,6 @@ import { Scroll } from '../Scroll/Scroll.js';
10
10
  import { capitalize } from '../../tools/string.js';
11
11
  import { generateUID } from '../../tools/uid.js';
12
12
  import S from './Input.styl.js';
13
- import '../Autocomplete/Autocomplete.styl.js';
14
- import '../Shimmer/Shimmer.styl.js';
15
- import debounce from '../../tools/debounce.js';
16
- import '../ButtonGroup/ButtonGroup.styl.js';
17
- import '../Calendar/Calendar.styl.js';
18
- import '../../tools/dom.js';
19
- import 'timen';
20
- import 'compareq';
21
- import 'lodash.pick';
22
- import '../../tools/queryParams.js';
23
- import '../Portal/Portal.js';
24
- import '../Paranja/Paranja.styl.js';
25
- import '../Popup/Popup.styl.js';
26
- import '../Select/Select.styl.js';
27
- import 'justorm/react';
28
- import 'lodash.omit';
29
- import '../Checkbox/Checkbox.styl.js';
30
- import '../Container/Container.styl.js';
31
- import '../DatePicker/DatePicker.styl.js';
32
- import 'moment';
33
- import '../DatePickerInput/DatePickerInput.styl.js';
34
- import '../Draggable/Draggable.styl.js';
35
- import '../Expand/Expand.styl.js';
36
- import '../Flex/Flex.styl.js';
37
- import '../Form/Form.styl.js';
38
- import '../Form/Validator.js';
39
- import '../Form/SubmitButtons/SubmitButtons.styl.js';
40
- import '../Spinner/Spinner.styl.js';
41
- import '../Gallery/Gallery.styl.js';
42
- import '../Heading/Heading.js';
43
- import '../InputFile/InputFile.styl.js';
44
- import '../InputFile/Item/Item.styl.js';
45
- import '../LightBox/LightBox.styl.js';
46
- import '../Menu/Menu.js';
47
- import '../Notifications/store.js';
48
- import '../Notifications/Notifications.styl.js';
49
- import '../PopupMenu/PopupMenu.styl.js';
50
- import '../Progress/Progress.styl.js';
51
- import '../ProgressCircular/ProgressCircular.styl.js';
52
- import '../Router/Router.js';
53
- import '../Table/Table.styl.js';
54
- import '../Tabs/Tabs.styl.js';
55
- import '../Tooltip/Tooltip.styl.js';
56
- import '../Text/Text.js';
57
- import '../Virtualized/Virtualized.styl.js';
58
- import '../Virtualized/List/List.styl.js';
59
- import '../Virtualized/List/ListScroll.styl.js';
60
- import '../../services/i18n.js';
61
13
 
62
14
  const TEXTAREA_SCROLL_TOP_OFFSET = {
63
15
  s: 30,
@@ -116,34 +68,19 @@ const Input = forwardRef((props, ref) => {
116
68
  return val;
117
69
  };
118
70
  const onTextareaPaste = e => {
119
- if (!isFocusedRef.current)
120
- return;
121
- e.preventDefault();
122
- e.stopPropagation();
123
- pasteToTextarea(e.clipboardData.getData('text/plain'));
71
+ // wait for native paste operation completes in DOM
72
+ setTimeout(() => {
73
+ if (inputRef.current) {
74
+ const newValue = inputRef.current.innerText;
75
+ onChangeValue(newValue);
76
+ }
77
+ }, 0);
124
78
  };
125
79
  const setTextareaValue = (value) => {
126
80
  // @ts-ignore
127
81
  if (inputRef.current)
128
82
  inputRef.current.innerText = value;
129
83
  };
130
- const pasteToTextarea = debounce((text) => {
131
- const sel = window.getSelection();
132
- const textarea = inputRef.current;
133
- const prevText = textarea.innerText;
134
- const startPos = sel.getRangeAt(0).startOffset;
135
- const nextText = prevText.substring(0, startPos) + text + prevText.substring(startPos);
136
- textarea.innerText = nextText;
137
- onChangeValue(nextText);
138
- setTimeout(() => {
139
- try {
140
- window
141
- .getSelection()
142
- .setPosition(textarea.firstChild, startPos + text.length);
143
- }
144
- catch (e) { }
145
- }, 100);
146
- }, 100);
147
84
  const onClearPress = e => {
148
85
  e.preventDefault();
149
86
  e.stopPropagation();
@@ -75,6 +75,7 @@ declare const _default: {
75
75
  soundWave: () => Promise<any>;
76
76
  sparks: () => Promise<any>;
77
77
  star: () => Promise<any>;
78
+ stopInCircle: () => Promise<any>;
78
79
  syncArrows: () => Promise<any>;
79
80
  table: () => Promise<any>;
80
81
  telegram: () => Promise<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homecode/ui",
3
- "version": "4.25.0",
3
+ "version": "4.25.2",
4
4
  "description": "React UI components library",
5
5
  "scripts": {
6
6
  "test": "jest",