armtek-uikit-react 1.0.227 → 1.0.229

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.227","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.229","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"}}
@@ -11,6 +11,7 @@ var _ButtonIcon = _interopRequireDefault(require("../../ButtonIcon"));
11
11
  var _Card = _interopRequireDefault(require("../../Card/Card"));
12
12
  var _DatePicker = _interopRequireDefault(require("../DatePicker/DatePicker"));
13
13
  var _DateService = require("../../../lib/services/DateService");
14
+ var _Adornment = require("../../Adornment");
14
15
  var _jsxRuntime = require("react/jsx-runtime");
15
16
  const DELIMITER = ' - ';
16
17
  const format = 'dd.MM.yyyy';
@@ -47,7 +48,7 @@ const Period = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
47
48
  const [textValue, setTextValue] = (0, _react.useState)(displayText);
48
49
  const [startValue, endValue] = value || [];
49
50
  (0, _react.useEffect)(() => {
50
- if (startValue && endValue) setTextValue(getPeriodDisplay(startValue, endValue));
51
+ if (startValue && endValue) setTextValue(getPeriodDisplay(startValue, endValue));else if (startValue === null && endValue === null) setTextValue('');
51
52
  }, [startValue, endValue]);
52
53
  const handleClick = e => {
53
54
  e.stopPropagation();
@@ -117,6 +118,19 @@ const Period = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
117
118
  if (!e.target.closest('[data-calendar-btn]') && !e.target.closest('.arm-datepicker__select-option')) setActive(false);
118
119
  };
119
120
  let realValue = Array.isArray(props.value) ? props.value : currentValue;
121
+ const endAdornment = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Adornment.AdornmentContainer, {
122
+ children: [restProps.endAdornment, /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonIcon.default, {
123
+ "data-calendar-btn": true,
124
+ size: 'medium',
125
+ variant: 'transparent',
126
+ color: 'neutral',
127
+ onClick: handleClick,
128
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
129
+ className: 'material_icon',
130
+ children: "calendar_today"
131
+ })
132
+ })]
133
+ });
120
134
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
121
135
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
122
136
  className: 'arm-period',
@@ -130,17 +144,7 @@ const Period = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
130
144
  onChange: handleChange,
131
145
  onFocus: () => setActive(false),
132
146
  autoComplete: 'off',
133
- endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonIcon.default, {
134
- "data-calendar-btn": true,
135
- size: 'medium',
136
- variant: 'transparent',
137
- color: 'neutral',
138
- onClick: handleClick,
139
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
140
- className: 'material_icon',
141
- children: "calendar_today"
142
- })
143
- })
147
+ endAdornment: endAdornment
144
148
  }), active && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Card.default, {
145
149
  className: 'arm-period__picker',
146
150
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DatePicker.default, {