armtek-uikit-react 1.0.235 → 1.0.237

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/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"armtek-uikit-react","version":"1.0.235","description":"Armtek UIKit for React","main":"cjs/index.js","module":"esm/index.js","types":"esm/index.d.ts","repository":{"type":"git","url":"ssh://git@gl.corp:10022/int/uikit/uikit_react.git"},"author":"","license":"ISC","dependencies":{"@popperjs/core":"^2.11.8","clsx":"^2.0.0","date-fns":"^4.1.0","rc-slider":"^10.2.1","react":"<=18.2.0","react-datepicker":"^8.3.0","react-dom":"<=18.2.0","react-transition-group":"^4.4.5"},"peerDependencies":{"react":"<=18.2.0","react-dom":"<=18.2.0"},"engines":{"node":">=14.0.0"},"scripts":{"pub":"npm version patch && npm publish"}}
1
+ {"name":"armtek-uikit-react","version":"1.0.237","description":"Armtek UIKit for React","main":"cjs/index.js","module":"esm/index.js","types":"esm/index.d.ts","repository":{"type":"git","url":"ssh://git@gl.corp:10022/int/uikit/uikit_react.git"},"author":"","license":"ISC","dependencies":{"@popperjs/core":"^2.11.8","clsx":"^2.0.0","date-fns":"^4.1.0","rc-slider":"^10.2.1","react":"<=18.2.0","react-datepicker":"^8.3.0","react-dom":"<=18.2.0","react-transition-group":"^4.4.5"},"peerDependencies":{"react":"<=18.2.0","react-dom":"<=18.2.0"},"engines":{"node":">=14.0.0"},"scripts":{"pub":"npm version patch && npm publish"}}
@@ -83,6 +83,7 @@ const DateField = exports.DateField = /*#__PURE__*/(0, _react.forwardRef)((props
83
83
  handleChange(date);
84
84
  };
85
85
  const processChange = value => {
86
+ if (disabled) return;
86
87
  //backspace
87
88
  const bs = (text.endsWith('.') || text.endsWith(' ') || text.endsWith(':')) && text.length > value.length;
88
89
  let matcher = /^\d{2}\.\d{2}\.\d{4}$/;
@@ -155,6 +156,19 @@ const DateField = exports.DateField = /*#__PURE__*/(0, _react.forwardRef)((props
155
156
  if (!(dateValue instanceof Date && !isNaN(dateValue.getDate()))) dateValue = null;
156
157
 
157
158
  //TODO Подключение Popover ломает тесты, разобраться почему
159
+
160
+ const calendarBtn = /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonIcon.default, {
161
+ disabled: disabled,
162
+ size: 'medium',
163
+ variant: 'transparent',
164
+ onClick: handleClick,
165
+ color: 'neutral',
166
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
167
+ ref: btnRef,
168
+ className: 'material_icon',
169
+ children: inputIcon
170
+ })
171
+ });
158
172
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
159
173
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, {
160
174
  ref: ref,
@@ -165,19 +179,10 @@ const DateField = exports.DateField = /*#__PURE__*/(0, _react.forwardRef)((props
165
179
  helperText: helperText,
166
180
  ...inputProps,
167
181
  value: text || '',
182
+ disabled: disabled,
168
183
  onChange: handleChangeText,
169
184
  onPaste: handlePaste,
170
- endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonIcon.default, {
171
- size: 'medium',
172
- variant: 'transparent',
173
- onClick: handleClick,
174
- color: 'neutral',
175
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
176
- ref: btnRef,
177
- className: 'material_icon',
178
- children: inputIcon
179
- })
180
- })
185
+ endAdornment: calendarBtn
181
186
  }), open && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BackDrop.default, {
182
187
  onClick: () => setOpen(false),
183
188
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PopperBase.PopperBase, {
@@ -42,6 +42,7 @@ const Period = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
42
42
  showYearDropdown,
43
43
  showMonthDropdown,
44
44
  datePickerProps,
45
+ disabled,
45
46
  ...restProps
46
47
  } = props;
47
48
  const [active, setActive] = (0, _react.useState)(false);
@@ -58,6 +59,7 @@ const Period = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
58
59
  setActive(prev => !prev);
59
60
  };
60
61
  const handleSelect = date => {
62
+ if (disabled) return;
61
63
  if (date[0] && date[1] && disableSameDate && (0, _DateService.isDateEqual)(date[0], date[1])) {
62
64
  setTextValue('');
63
65
  return;
@@ -83,6 +85,7 @@ const Period = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
83
85
  // const mask = '--.--.---- - --.--.----'
84
86
 
85
87
  const handleChange = e => {
88
+ if (disabled) return;
86
89
  let value = e.target.value;
87
90
  const bs = (textValue.endsWith('.') || textValue.endsWith(' ') || textValue.endsWith('-')) && textValue.length > value.length;
88
91
  if (!bs) {
@@ -127,6 +130,7 @@ const Period = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
127
130
  size: 'medium',
128
131
  variant: 'transparent',
129
132
  color: 'neutral',
133
+ disabled: disabled,
130
134
  onClick: handleClick,
131
135
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
132
136
  className: 'material_icon',
@@ -142,6 +146,7 @@ const Period = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
142
146
  ref: ref,
143
147
  placeholder: 'дд.мм.гггг - дд.мм.гггг',
144
148
  ...restProps,
149
+ disabled: disabled,
145
150
  id: 'period',
146
151
  value: textValue,
147
152
  onBlur: () => setActive(false),