hrm_ui_lib 2.0.1 → 2.0.3

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.
@@ -120,7 +120,10 @@ var FormContainer = function FormContainer(props) {
120
120
  setError: setError,
121
121
  dirtyFields: dirtyFields,
122
122
  getFieldState: getFieldState,
123
- unregister: unregister
123
+ unregister: unregister,
124
+ onSubmit: function onSubmit() {
125
+ return handleSubmit(customSubmit)();
126
+ }
124
127
  }
125
128
  }, /*#__PURE__*/React.createElement(React.Fragment, null, children, buttonConfigs && /*#__PURE__*/React.createElement("div", {
126
129
  className: "form-container__buttons"
@@ -56,7 +56,7 @@ import '../SVGIcons/IconArrowDownloadFilled.js';
56
56
  import '../../helpers/download-file.js';
57
57
  import '../Button/consts.js';
58
58
 
59
- var _excluded = ["datePlaceHolderText", "className", "size", "error", "hasError", "label", "mask", "maskChar", "maskPlaceholder", "currentValue", "name", "leftIconProps", "rightIconProps", "disabled", "required", "readonly", "placeholder", "type", "helperText", "successMessage", "maxCount", "setFieldValue", "handleChange", "dataId", "isValid", "allowLeadingZeros", "thousandSeparator", "allowNegative", "hideCounter", "labelAddons", "witUpperCase", "isAllowed", "onChange"];
59
+ var _excluded = ["datePlaceHolderText", "className", "size", "error", "hasError", "label", "mask", "maskChar", "maskPlaceholder", "currentValue", "name", "leftIconProps", "rightIconProps", "disabled", "required", "readonly", "placeholder", "type", "helperText", "successMessage", "maxCount", "setFieldValue", "handleChange", "dataId", "isValid", "allowLeadingZeros", "thousandSeparator", "allowNegative", "hideCounter", "labelAddons", "witUpperCase", "isAllowed", "onChange", "handleBlurEvent"];
60
60
  var Input = /*#__PURE__*/React.forwardRef(function (_ref, _ref2) {
61
61
  var datePlaceHolderText = _ref.datePlaceHolderText,
62
62
  className = _ref.className,
@@ -98,6 +98,7 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, _ref2) {
98
98
  witUpperCase = _ref$witUpperCase === void 0 ? false : _ref$witUpperCase,
99
99
  isAllowed = _ref.isAllowed,
100
100
  onChange = _ref.onChange,
101
+ handleBlurEvent = _ref.handleBlurEvent,
101
102
  rest = _objectWithoutProperties(_ref, _excluded);
102
103
  var isErrorVisible = hasError !== undefined ? hasError : !!error;
103
104
  var placeHolder = label === placeholder ? '' : placeholder || datePlaceHolderText;
@@ -126,6 +127,11 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, _ref2) {
126
127
  }
127
128
  return 0;
128
129
  }, [rest, currentValue]);
130
+ var onBlurCallback = function onBlurCallback(e) {
131
+ var _rest$onBlur;
132
+ rest === null || rest === void 0 || (_rest$onBlur = rest.onBlur) === null || _rest$onBlur === void 0 || _rest$onBlur.call(rest, e);
133
+ handleBlurEvent === null || handleBlurEvent === void 0 || handleBlurEvent(e);
134
+ };
129
135
  var input = mask ?
130
136
  /*#__PURE__*/
131
137
  // @ts-ignore
@@ -139,6 +145,7 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, _ref2) {
139
145
  }
140
146
  }, rest, {
141
147
  placeholder: placeHolder,
148
+ onBlur: onBlurCallback,
142
149
  onChange: changeHandler,
143
150
  disabled: disabled,
144
151
  "data-id": dataId,
@@ -162,7 +169,8 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, _ref2) {
162
169
  maxLength: maxCount,
163
170
  inputMode: 'numeric',
164
171
  disabled: disabled,
165
- isAllowed: isAllowed
172
+ isAllowed: isAllowed,
173
+ onBlur: onBlurCallback
166
174
  }, currentValue !== undefined ? {
167
175
  value: currentValue
168
176
  } : {})) :
@@ -177,6 +185,7 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, _ref2) {
177
185
  placeholder: placeHolder,
178
186
  "data-id": dataId
179
187
  }, rest, {
188
+ onBlur: onBlurCallback,
180
189
  onChange: changeHandler
181
190
  }, currentValue !== undefined ? {
182
191
  value: currentValue
@@ -1,4 +1,4 @@
1
- import { InputHTMLAttributes, ReactElement, RefObject } from 'react';
1
+ import { InputHTMLAttributes, ReactElement, RefObject, FocusEvent } from 'react';
2
2
  import { ISVGIconProps } from '../SVGIcons/types';
3
3
  export interface InputCustomProps extends IFormCompProps, Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'onFocus' | 'value' | 'onChange' | 'autoComplete'> {
4
4
  mask?: string;
@@ -24,6 +24,7 @@ export interface InputCustomProps extends IFormCompProps, Omit<InputHTMLAttribut
24
24
  successMessage?: string;
25
25
  maxCount?: number;
26
26
  onFocus?: (event: TClickEventType) => void;
27
+ handleBlurEvent?: (e: FocusEvent<HTMLInputElement>) => void;
27
28
  hideCounter?: boolean;
28
29
  allowNegative?: boolean;
29
30
  currencySymbol?: string;
@@ -0,0 +1,4 @@
1
+ import { ReactElement } from 'react';
2
+ import { ISVGIconProps } from './types';
3
+ export declare const IconFood: ({ size, type, className, onClick, refHandler, id, dataId }: ISVGIconProps) => ReactElement;
4
+ export default IconFood;
@@ -0,0 +1,29 @@
1
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
+ import React from 'react';
3
+ import classNames from 'classnames';
4
+
5
+ var IconFood = function IconFood(_ref) {
6
+ var size = _ref.size,
7
+ type = _ref.type,
8
+ _ref$className = _ref.className,
9
+ className = _ref$className === void 0 ? '' : _ref$className,
10
+ onClick = _ref.onClick,
11
+ refHandler = _ref.refHandler,
12
+ id = _ref.id,
13
+ dataId = _ref.dataId;
14
+ return /*#__PURE__*/React.createElement("svg", {
15
+ xmlns: "http://www.w3.org/2000/svg",
16
+ className: classNames('svg-icon', _defineProperty(_defineProperty(_defineProperty({}, "svg-icon__size-".concat(size), size), "svg-icon__type-".concat(type), type), className, className)),
17
+ viewBox: "0 0 24 24",
18
+ fill: "none",
19
+ onClick: onClick,
20
+ ref: refHandler,
21
+ id: id,
22
+ "data-id": dataId ? "".concat(dataId, "-svg-icon") : ''
23
+ }, /*#__PURE__*/React.createElement("path", {
24
+ d: "M18.25 3.25C18.6297 3.25 18.9435 3.53215 18.9932 3.89823L19 4V20C19 20.4142 18.6642 20.75 18.25 20.75C17.8703 20.75 17.5565 20.4678 17.5068 20.1018L17.5 20V15H15.25C14.8703 15 14.5565 14.7178 14.5068 14.3518L14.5 14.25V7C14.5 4.92893 16.1789 3.25 18.25 3.25ZM12.25 3.25C12.6297 3.25 12.9435 3.53215 12.9932 3.89823L13 4V8C13 9.95258 11.6009 11.5784 9.7506 11.9297L9.75 20C9.75 20.4142 9.41421 20.75 9 20.75C8.6203 20.75 8.30651 20.4678 8.25685 20.1018L8.25 20L8.25039 11.9299C6.46566 11.5915 5.10054 10.0675 5.00531 8.20795L5 8V4C5 3.58579 5.33579 3.25 5.75 3.25C6.1297 3.25 6.44349 3.53215 6.49315 3.89823L6.5 4V8C6.5 9.11957 7.23593 10.0672 8.25042 10.3857L8.25 4C8.25 3.58579 8.58579 3.25 9 3.25C9.3797 3.25 9.69349 3.53215 9.74315 3.89823L9.75 4L9.75057 10.3854C10.7082 10.0843 11.4174 9.22253 11.4933 8.18486L11.5 8V4C11.5 3.58579 11.8358 3.25 12.25 3.25ZM17.5 13.5V4.87803C16.6775 5.16874 16.0745 5.9241 16.0064 6.82871L16 7V13.5H17.5V4.87803V13.5Z",
25
+ fill: "#0E121B"
26
+ }));
27
+ };
28
+
29
+ export { IconFood, IconFood as default };
@@ -0,0 +1,4 @@
1
+ import { ReactElement } from 'react';
2
+ import { ISVGIconProps } from './types';
3
+ export declare const IconFoodFilled: ({ size, type, className, onClick, refHandler, id, dataId }: ISVGIconProps) => ReactElement;
4
+ export default IconFoodFilled;
@@ -0,0 +1,29 @@
1
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
+ import React from 'react';
3
+ import classNames from 'classnames';
4
+
5
+ var IconFoodFilled = function IconFoodFilled(_ref) {
6
+ var size = _ref.size,
7
+ type = _ref.type,
8
+ _ref$className = _ref.className,
9
+ className = _ref$className === void 0 ? '' : _ref$className,
10
+ onClick = _ref.onClick,
11
+ refHandler = _ref.refHandler,
12
+ id = _ref.id,
13
+ dataId = _ref.dataId;
14
+ return /*#__PURE__*/React.createElement("svg", {
15
+ xmlns: "http://www.w3.org/2000/svg",
16
+ className: classNames('svg-icon', _defineProperty(_defineProperty(_defineProperty({}, "svg-icon__size-".concat(size), size), "svg-icon__type-".concat(type), type), className, className)),
17
+ viewBox: "0 0 24 24",
18
+ fill: "none",
19
+ onClick: onClick,
20
+ ref: refHandler,
21
+ id: id,
22
+ "data-id": dataId ? "".concat(dataId, "-svg-icon") : ''
23
+ }, /*#__PURE__*/React.createElement("path", {
24
+ d: "M18 3C18.5128 3 18.9355 3.38604 18.9933 3.88338L19 4V20C19 20.5523 18.5523 21 18 21C17.4872 21 17.0645 20.614 17.0067 20.1166L17 20V15H16C15.4872 15 15.0645 14.614 15.0067 14.1166L15 14V8C15 5.79086 16.5 3 18 3ZM12 3C12.5128 3 12.9355 3.38604 12.9933 3.88338L13 4V9C13 10.8636 11.7256 12.4295 10.0008 12.8738L10 20C10 20.5523 9.55228 21 9 21C8.48716 21 8.06449 20.614 8.00673 20.1166L8 20L8.00024 12.874C6.33879 12.4465 5.09505 10.9784 5.0052 9.20584L5 9V4C5 3.44772 5.44772 3 6 3C6.51284 3 6.93551 3.38604 6.99327 3.88338L7 4V9C7 9.74025 7.40217 10.3866 7.99993 10.7324L8 4C8 3.44772 8.44772 3 9 3C9.51284 3 9.93551 3.38604 9.99327 3.88338L10 4L10.0011 10.7318C10.5523 10.4125 10.937 9.83745 10.993 9.16897L11 9V4C11 3.44772 11.4477 3 12 3Z",
25
+ fill: "#0E121B"
26
+ }));
27
+ };
28
+
29
+ export { IconFoodFilled, IconFoodFilled as default };
@@ -158,6 +158,8 @@ export * from './IconFlag';
158
158
  export * from './IconFlagFilled';
159
159
  export * from './IconFolderLink';
160
160
  export * from './IconFolderLinkFilled';
161
+ export * from './IconFood';
162
+ export * from './IconFoodFilled';
161
163
  export * from './IconGb';
162
164
  export * from './IconGlobe';
163
165
  export * from './IconGlobeFilled';
@@ -158,6 +158,8 @@ export { IconFlag } from './IconFlag.js';
158
158
  export { IconFlagFilled } from './IconFlagFilled.js';
159
159
  export { IconFolderLink } from './IconFolderLink.js';
160
160
  export { IconFolderLinkFilled } from './IconFolderLinkFilled.js';
161
+ export { IconFood } from './IconFood.js';
162
+ export { IconFoodFilled } from './IconFoodFilled.js';
161
163
  export { IconGb } from './IconGb.js';
162
164
  export { IconGlobe } from './IconGlobe.js';
163
165
  export { IconGlobeFilled } from './IconGlobeFilled.js';
@@ -16,5 +16,6 @@ export type TFormContextProps = {
16
16
  trigger?: UseFormTrigger<TFormData>;
17
17
  getFieldState?: UseFormGetFieldState<TFormData>;
18
18
  unregister?: UseFormUnregister<TFormData>;
19
+ onSubmit?: () => void;
19
20
  };
20
21
  export declare const FormContext: import("react").Context<TFormContextProps>;
package/index.js CHANGED
@@ -206,6 +206,8 @@ export { IconFlag } from './components/SVGIcons/IconFlag.js';
206
206
  export { IconFlagFilled } from './components/SVGIcons/IconFlagFilled.js';
207
207
  export { IconFolderLink } from './components/SVGIcons/IconFolderLink.js';
208
208
  export { IconFolderLinkFilled } from './components/SVGIcons/IconFolderLinkFilled.js';
209
+ export { IconFood } from './components/SVGIcons/IconFood.js';
210
+ export { IconFoodFilled } from './components/SVGIcons/IconFoodFilled.js';
209
211
  export { IconGb } from './components/SVGIcons/IconGb.js';
210
212
  export { IconGlobe } from './components/SVGIcons/IconGlobe.js';
211
213
  export { IconGlobeFilled } from './components/SVGIcons/IconGlobeFilled.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hrm_ui_lib",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "UI library for Dino",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",