linear-react-components-ui 1.1.20-beta.4 → 1.1.20-beta.6

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.
Files changed (54) hide show
  1. package/lib/assets/styles/select.scss +2 -1
  2. package/lib/assets/styles/wizard.scss +125 -0
  3. package/lib/dialog/base/Content.d.ts +1 -1
  4. package/lib/dialog/base/Content.js +3 -2
  5. package/lib/dialog/base/index.js +3 -2
  6. package/lib/dialog/form/index.js +8 -3
  7. package/lib/dialog/types.d.ts +34 -4
  8. package/lib/dialog/wizard/index.d.ts +13 -0
  9. package/lib/dialog/wizard/index.js +74 -0
  10. package/lib/dialog/wizard/progressbar.d.ts +13 -0
  11. package/lib/dialog/wizard/progressbar.js +36 -0
  12. package/lib/dialog/wizard/step.d.ts +9 -0
  13. package/lib/dialog/wizard/step.js +22 -0
  14. package/lib/dialog/wizard/useWizard.d.ts +9 -0
  15. package/lib/dialog/wizard/useWizard.js +48 -0
  16. package/lib/form/Field.d.ts +3 -1
  17. package/lib/form/FieldArray.d.ts +3 -1
  18. package/lib/form/FieldNumber.d.ts +3 -1
  19. package/lib/form/FieldPeriod.d.ts +3 -1
  20. package/lib/form/helpers.d.ts +3 -1
  21. package/lib/form/index.d.ts +3 -1
  22. package/lib/form/types.d.ts +3 -1
  23. package/lib/form/withFieldHOC.d.ts +3 -1
  24. package/lib/form/withFormSecurity.d.ts +3 -1
  25. package/lib/icons/helper.d.ts +12 -4
  26. package/lib/icons/helper.js +12 -4
  27. package/lib/inputs/base/InputTextBase.js +1 -2
  28. package/lib/inputs/errorMessage/index.d.ts +5 -4
  29. package/lib/inputs/inputHOC.d.ts +5 -4
  30. package/lib/inputs/number/BaseNumber.d.ts +2 -1
  31. package/lib/inputs/number/Currency.d.ts +2 -1
  32. package/lib/inputs/number/Decimal.d.ts +2 -1
  33. package/lib/inputs/number/index.d.ts +2 -1
  34. package/lib/inputs/number/types.d.ts +2 -1
  35. package/lib/inputs/search/index.d.ts +5 -4
  36. package/lib/inputs/select/ActionButtons.d.ts +5 -4
  37. package/lib/inputs/select/ActionButtons.js +14 -2
  38. package/lib/inputs/select/Dropdown.d.ts +5 -4
  39. package/lib/inputs/select/index.d.ts +3 -1
  40. package/lib/inputs/select/multiple/Selecteds.d.ts +3 -1
  41. package/lib/inputs/select/multiple/index.d.ts +3 -1
  42. package/lib/inputs/select/multiple/index.js +4 -2
  43. package/lib/inputs/select/simple/index.d.ts +3 -1
  44. package/lib/inputs/select/simple/index.js +4 -2
  45. package/lib/inputs/select/types.d.ts +14 -3
  46. package/lib/inputs/types.d.ts +5 -3
  47. package/package.json +1 -1
  48. package/lib/inputs/mask/imaskHOC.js +0 -203
  49. package/lib/menus/sidenav/popup_menu_help/index.js +0 -85
  50. package/lib/tabs/DropdownItems.js +0 -62
  51. package/lib/tabs/MenuItems.js +0 -70
  52. package/lib/treeview_old/Header.js +0 -29
  53. package/lib/treeview_old/Node.js +0 -68
  54. package/lib/treeview_old/index.js +0 -43
@@ -19,6 +19,7 @@
19
19
  cursor: pointer;
20
20
  display: flex;
21
21
  align-items: center;
22
+ padding: 0 4px;
22
23
  }
23
24
  }
24
25
 
@@ -151,4 +152,4 @@
151
152
  font-style: italic;
152
153
  font-size: 13px;
153
154
  }
154
- }
155
+ }
@@ -0,0 +1,125 @@
1
+ @import "colors.scss";
2
+
3
+ .wizard-dialog {
4
+ .wizard-wrapper {
5
+ .wizard-content {
6
+ display: flex !important;
7
+ flex-direction: column;
8
+ .wizard-progresbar {
9
+ width: 100%;
10
+ display: grid;
11
+ grid-auto-columns: 1fr;
12
+ grid-auto-flow: column;
13
+ justify-content: space-between;
14
+ padding: 20px;
15
+ margin-bottom: 20px;
16
+ border-bottom: 2px solid $component-border-color;
17
+ gap: 10px;
18
+ overflow: hidden;
19
+ > .title {
20
+ font-size: 16px;
21
+ font-weight: 600;
22
+ display: flex;
23
+ align-items: center;
24
+ flex-direction: column;
25
+ position: relative;
26
+ flex: 1;
27
+ text-align: center;
28
+ &:first-child {
29
+ .step {
30
+ align-self: flex-start;
31
+ }
32
+ .step-title {
33
+ align-self: flex-start;
34
+ text-align: left;
35
+ }
36
+ &:before {
37
+ right: auto;
38
+ left: 45px;
39
+ }
40
+ }
41
+ &:last-child {
42
+ .step {
43
+ align-self: flex-end;
44
+ }
45
+ .step-title {
46
+ align-self: flex-end;
47
+ text-align: right;
48
+ }
49
+ &:after {
50
+ left: auto;
51
+ right: 45px;
52
+ }
53
+ }
54
+ &::after, &::before {
55
+ content: "";
56
+ position: absolute;
57
+ height: 2px;
58
+ background-color: $component-border-color;
59
+ top: 18px;
60
+ width: calc(100% - 25px);
61
+ transition: all 0.2s ease-in-out;
62
+ }
63
+ &::after {
64
+ left: calc(50% + 18px);
65
+ }
66
+ &::before {
67
+ right: calc(50% + 18px);
68
+ }
69
+ &[data-completed="true"] {
70
+ &::after {
71
+ background-color: $success-color !important;
72
+ }
73
+ + .title::before {
74
+ background-color: $success-color !important;
75
+ }
76
+ &:first-child::before {
77
+ background-color: $success-color !important;
78
+ }
79
+ & + .title:after {
80
+ background-color: $success-color !important;
81
+ }
82
+ > .step {
83
+ > .number {
84
+ background-color: $success-color;
85
+ border-color: $success-color;
86
+ }
87
+ }
88
+ }
89
+ &[data-disabled="true"] .step {
90
+ opacity: 0.3;
91
+ }
92
+ > .step {
93
+ display: flex;
94
+ flex-direction: column;
95
+ align-items: center;
96
+ justify-content: center;
97
+ width: 54px;
98
+ > .number {
99
+ display: flex;
100
+ align-items: center;
101
+ justify-content: center;
102
+ font-size: 20px;
103
+ font-weight: 600;
104
+ width: 36px;
105
+ height: 36px;
106
+ border-radius: 100%;
107
+ color: #fff;
108
+ background-color: $color-light-dark;
109
+ z-index: 1;
110
+ transition: all 0.2s ease-in-out;
111
+ border: 2px solid $color-light-dark;
112
+ }
113
+ }
114
+ > .step-title {
115
+ max-width: 150px;
116
+ overflow: hidden;
117
+ margin-top: 6px;
118
+ font-weight: 500;
119
+ color: $font-color-soft;
120
+ }
121
+ }
122
+ }
123
+ }
124
+ }
125
+ }
@@ -4,6 +4,6 @@ import '../../@types/Align.js';
4
4
  import '../../@types/Icon.js';
5
5
  import '../../icons/helper.js';
6
6
 
7
- declare const Content: ({ children, styleForContent }: IContentProps) => JSX.Element;
7
+ declare const Content: ({ children, styleForContent, className }: IContentProps) => JSX.Element;
8
8
 
9
9
  export { Content as default };
@@ -10,11 +10,12 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
10
10
  const Content = _ref => {
11
11
  let {
12
12
  children,
13
- styleForContent
13
+ styleForContent,
14
+ className = ''
14
15
  } = _ref;
15
16
  return /*#__PURE__*/_react.default.createElement("div", {
16
17
  id: "modal-dialog-content",
17
- className: "dialog-content",
18
+ className: "dialog-content ".concat(className),
18
19
  style: styleForContent
19
20
  }, children);
20
21
  };
@@ -21,7 +21,8 @@ const BaseDialog = props => {
21
21
  overlay = true,
22
22
  closeOnEsc,
23
23
  closeOnOutsideClick,
24
- wrapperClassName,
24
+ wrapperClassName = '',
25
+ className = '',
25
26
  children,
26
27
  open: openProp,
27
28
  onOpenChange,
@@ -112,7 +113,7 @@ const BaseDialog = props => {
112
113
  className: "modal-overlay",
113
114
  "data-testid": "modal-overlay"
114
115
  }), /*#__PURE__*/_react.default.createElement("div", {
115
- className: "dialog",
116
+ className: "dialog ".concat(className),
116
117
  "data-testid": "dialog-component"
117
118
  }, /*#__PURE__*/_react.default.createElement("div", {
118
119
  className: wrapperClassName,
@@ -29,7 +29,10 @@ const ModalForm = props => {
29
29
  width = '50%',
30
30
  height = '50%',
31
31
  content,
32
- children
32
+ children,
33
+ className = '',
34
+ wrapperClassName = '',
35
+ contentClassName = ''
33
36
  } = props;
34
37
  const headerRef = (0, _react.useRef)(null);
35
38
  const context = (0, _react.useContext)(_withFormSecurity.FormSecurityContext);
@@ -56,7 +59,8 @@ const ModalForm = props => {
56
59
  width: width,
57
60
  height: height
58
61
  }, props, {
59
- wrapperClassName: "dialog-form-wrapper"
62
+ wrapperClassName: "dialog-form-wrapper ".concat(wrapperClassName),
63
+ className: className
60
64
  }), props.title && /*#__PURE__*/_react.default.createElement("div", {
61
65
  className: "header-form"
62
66
  }, /*#__PURE__*/_react.default.createElement(_Header.default, {
@@ -64,7 +68,8 @@ const ModalForm = props => {
64
68
  handlerClose: props.handlerClose,
65
69
  icon: props.icon
66
70
  })), /*#__PURE__*/_react.default.createElement(_Content.default, {
67
- styleForContent: _objectSpread(_objectSpread({}, props.styleForContent), overlayStyle)
71
+ styleForContent: _objectSpread(_objectSpread({}, props.styleForContent), overlayStyle),
72
+ className: contentClassName
68
73
  }, content || children), getSpinner(), showFooter && props.buttons && /*#__PURE__*/_react.default.createElement(_Footer.default, null, /*#__PURE__*/_react.default.createElement(_index.ButtonContainer, _extends({}, props, {
69
74
  style: _objectSpread({}, overlayStyle)
70
75
  }), _react.default.Children.toArray(props.buttons.map(button => {
@@ -1,4 +1,4 @@
1
- import { ReactNode, CSSProperties, ReactElement } from 'react';
1
+ import { ReactNode, CSSProperties, ReactElement, Dispatch } from 'react';
2
2
  import { TextAlign } from '../@types/Align.js';
3
3
  import { IconNames } from '../@types/Icon.js';
4
4
  import '../icons/helper.js';
@@ -6,6 +6,7 @@ import '../icons/helper.js';
6
6
  interface IContentProps {
7
7
  children: ReactNode | ReactNode[];
8
8
  styleForContent?: CSSProperties;
9
+ className?: string;
9
10
  }
10
11
  interface IFooterProps {
11
12
  children: ReactElement | ReactElement[];
@@ -18,10 +19,11 @@ interface IHeaderProps {
18
19
  titleIcon?: IconNames;
19
20
  }
20
21
  interface IBaseProps {
21
- wrapperClassName: string;
22
+ wrapperClassName?: string;
22
23
  width?: string;
23
24
  height?: string;
24
25
  children: ReactNode | ReactNode[];
26
+ className?: string;
25
27
  closeOnEsc?: boolean;
26
28
  closeOnOutsideClick?: boolean;
27
29
  overlay?: boolean;
@@ -31,7 +33,7 @@ interface IBaseProps {
31
33
  onOpenChange?: (open: boolean) => void;
32
34
  handlerClose?: () => void;
33
35
  }
34
- interface IFormProps extends Omit<IBaseProps, 'textAlign' | 'zIndex' | 'wrapperClassName'> {
36
+ interface IFormProps extends Omit<IBaseProps, 'textAlign' | 'zIndex'> {
35
37
  buttons?: JSX.Element[];
36
38
  styleForContent?: CSSProperties;
37
39
  title?: string;
@@ -39,6 +41,7 @@ interface IFormProps extends Omit<IBaseProps, 'textAlign' | 'zIndex' | 'wrapperC
39
41
  isWaiting?: boolean;
40
42
  icon?: JSX.Element;
41
43
  content?: ReactNode;
44
+ contentClassName?: string;
42
45
  }
43
46
  interface ICommonDialogProps {
44
47
  onConfirmClick?: () => void;
@@ -66,5 +69,32 @@ interface ICustomProps {
66
69
  interface IFormDialogContext {
67
70
  headerRef?: React.RefObject<HTMLDivElement>;
68
71
  }
72
+ interface WizardComponentProps extends Omit<IFormProps, 'content'> {
73
+ children: React.ReactNode;
74
+ buttons?: JSX.Element[];
75
+ showProgressbar?: boolean;
76
+ title?: string;
77
+ handlerClose?: () => void;
78
+ controls: WizardControls;
79
+ }
80
+ interface WizardStepComponentProps {
81
+ children: React.ReactNode;
82
+ title: string;
83
+ customClass?: string;
84
+ customStyle?: CSSProperties;
85
+ }
86
+ interface WizardControls extends Omit<UseWizardReturn, 'controls'> {
87
+ setTotalSteps: Dispatch<React.SetStateAction<number>>;
88
+ }
89
+ interface UseWizardReturn {
90
+ changeStep: (nextStep: number) => void;
91
+ nextStep: () => void;
92
+ hasNextStep: boolean;
93
+ previousStep: () => void;
94
+ hasPreviousStep: boolean;
95
+ currentStep: number;
96
+ totalSteps: number;
97
+ controls: WizardControls;
98
+ }
69
99
 
70
- export { IBaseProps, ICommonDialogProps, IContentProps, ICustomProps, IFooterProps, IFormDialogContext, IFormProps, IHeaderProps, IQuestionProps };
100
+ export { IBaseProps, ICommonDialogProps, IContentProps, ICustomProps, IFooterProps, IFormDialogContext, IFormProps, IHeaderProps, IQuestionProps, UseWizardReturn, WizardComponentProps, WizardControls, WizardStepComponentProps };
@@ -0,0 +1,13 @@
1
+ import React__default from 'react';
2
+ import { WizardControls, WizardComponentProps } from '../types.js';
3
+ export { WizardStep as Step } from './step.js';
4
+ export { useWizard } from './useWizard.js';
5
+ import '../../@types/Align.js';
6
+ import '../../@types/Icon.js';
7
+ import '../../icons/helper.js';
8
+
9
+ declare const WizardContext: React__default.Context<WizardControls | null>;
10
+ declare const useWizardContext: () => WizardControls | null;
11
+ declare function Wizard({ children, controls, showProgressbar, ...dialogProps }: Readonly<WizardComponentProps>): JSX.Element;
12
+
13
+ export { Wizard as Container, WizardContext, Wizard as default, useWizardContext };
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Container = Wizard;
7
+ Object.defineProperty(exports, "Step", {
8
+ enumerable: true,
9
+ get: function () {
10
+ return _step.WizardStep;
11
+ }
12
+ });
13
+ exports.default = exports.WizardContext = void 0;
14
+ Object.defineProperty(exports, "useWizard", {
15
+ enumerable: true,
16
+ get: function () {
17
+ return _useWizard.useWizard;
18
+ }
19
+ });
20
+ exports.useWizardContext = void 0;
21
+ var _react = _interopRequireWildcard(require("react"));
22
+ var _lodash = _interopRequireDefault(require("lodash"));
23
+ var _form = _interopRequireDefault(require("../form/"));
24
+ var _progressbar = require("./progressbar");
25
+ require("../../assets/styles/wizard.scss");
26
+ var _step = require("./step");
27
+ var _useWizard = require("./useWizard");
28
+ const _excluded = ["children", "controls", "showProgressbar"];
29
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
30
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
31
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
32
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
33
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
34
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
35
+ const WizardContext = exports.WizardContext = /*#__PURE__*/_react.default.createContext(null);
36
+ const useWizardContext = () => _react.default.useContext(WizardContext);
37
+ exports.useWizardContext = useWizardContext;
38
+ function Wizard(_ref) {
39
+ let {
40
+ children,
41
+ controls,
42
+ showProgressbar = true
43
+ } = _ref,
44
+ dialogProps = _objectWithoutProperties(_ref, _excluded);
45
+ const {
46
+ currentStep,
47
+ setTotalSteps
48
+ } = controls;
49
+ const steps = _react.default.Children.toArray(children);
50
+ const stepsTitle = steps.map((step, index) => {
51
+ return {
52
+ title: String(step.props.title),
53
+ number: index + 1,
54
+ completed: index < currentStep - 1 && index !== currentStep
55
+ };
56
+ });
57
+ const currentStepElement = steps[currentStep - 1];
58
+ if (!controls || _lodash.default.isEmpty(controls)) throw new Error('Wizard must be have controls by using useWizard hook or creating manually.');
59
+ (0, _react.useEffect)(() => {
60
+ setTotalSteps(steps.length);
61
+ }, [steps.length]);
62
+ return /*#__PURE__*/_react.default.createElement(WizardContext.Provider, {
63
+ value: controls
64
+ }, /*#__PURE__*/_react.default.createElement(_form.default, _extends({
65
+ className: "wizard-dialog",
66
+ wrapperClassName: "wizard-wrapper",
67
+ contentClassName: "wizard-content"
68
+ }, dialogProps), showProgressbar && /*#__PURE__*/_react.default.createElement(_progressbar.Progressbar, {
69
+ stepsTitle: stepsTitle
70
+ }), /*#__PURE__*/_react.default.createElement("div", {
71
+ className: "wizard-body"
72
+ }, currentStepElement)));
73
+ }
74
+ var _default = exports.default = Wizard;
@@ -0,0 +1,13 @@
1
+ import { CSSProperties } from 'react';
2
+
3
+ declare function Progressbar({ customClass, customStyle, stepsTitle }: Readonly<{
4
+ customClass?: string;
5
+ stepsTitle: {
6
+ title: string;
7
+ number: number;
8
+ completed: boolean;
9
+ }[];
10
+ customStyle?: CSSProperties;
11
+ }>): JSX.Element;
12
+
13
+ export { Progressbar };
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Progressbar = Progressbar;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _ = require(".");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ function Progressbar(_ref) {
11
+ let {
12
+ customClass,
13
+ customStyle,
14
+ stepsTitle
15
+ } = _ref;
16
+ const context = (0, _.useWizardContext)();
17
+ if (!context) throw new Error('WizardProgressbar must be used within a Wizard component');
18
+ const {
19
+ currentStep
20
+ } = context;
21
+ return /*#__PURE__*/_react.default.createElement("div", {
22
+ className: "wizard-progresbar ".concat(customClass),
23
+ style: customStyle
24
+ }, stepsTitle.map(step => /*#__PURE__*/_react.default.createElement("div", {
25
+ key: step.number,
26
+ className: "title",
27
+ "data-completed": step.completed,
28
+ "data-disabled": step.number > currentStep
29
+ }, /*#__PURE__*/_react.default.createElement("div", {
30
+ className: "step"
31
+ }, /*#__PURE__*/_react.default.createElement("span", {
32
+ className: "number"
33
+ }, step.number)), /*#__PURE__*/_react.default.createElement("span", {
34
+ className: "step-title"
35
+ }, step.title))));
36
+ }
@@ -0,0 +1,9 @@
1
+ import { WizardStepComponentProps } from '../types.js';
2
+ import 'react';
3
+ import '../../@types/Align.js';
4
+ import '../../@types/Icon.js';
5
+ import '../../icons/helper.js';
6
+
7
+ declare function WizardStep({ children, customClass, customStyle }: Readonly<WizardStepComponentProps>): JSX.Element;
8
+
9
+ export { WizardStep };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.WizardStep = WizardStep;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _ = require(".");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ function WizardStep(_ref) {
11
+ let {
12
+ children,
13
+ customClass = '',
14
+ customStyle
15
+ } = _ref;
16
+ const context = (0, _.useWizardContext)();
17
+ if (!context) throw new Error('WizardStep must be used within a Wizard component');
18
+ return /*#__PURE__*/_react.default.createElement("div", {
19
+ className: "wizard-step-component ".concat(customClass),
20
+ style: customStyle
21
+ }, children);
22
+ }
@@ -0,0 +1,9 @@
1
+ import { UseWizardReturn } from '../types.js';
2
+ import 'react';
3
+ import '../../@types/Align.js';
4
+ import '../../@types/Icon.js';
5
+ import '../../icons/helper.js';
6
+
7
+ declare const useWizard: () => UseWizardReturn;
8
+
9
+ export { useWizard };
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useWizard = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
9
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
10
+ const useWizard = () => {
11
+ const [totalSteps, setTotalSteps] = (0, _react.useState)(0);
12
+ const [currentStep, setCurrentStep] = _react.default.useState(1);
13
+ const hasNextStep = currentStep < totalSteps;
14
+ const hasPreviousStep = currentStep > 1;
15
+ const changeStep = nextStep => {
16
+ setCurrentStep(state => state + nextStep);
17
+ };
18
+ const nextStep = () => {
19
+ if (hasNextStep) {
20
+ changeStep(1);
21
+ }
22
+ };
23
+ const previousStep = () => {
24
+ if (hasPreviousStep) {
25
+ changeStep(-1);
26
+ }
27
+ };
28
+ return {
29
+ changeStep,
30
+ nextStep,
31
+ hasNextStep,
32
+ previousStep,
33
+ hasPreviousStep,
34
+ currentStep,
35
+ totalSteps,
36
+ controls: {
37
+ changeStep,
38
+ nextStep,
39
+ hasNextStep,
40
+ previousStep,
41
+ hasPreviousStep,
42
+ currentStep,
43
+ totalSteps,
44
+ setTotalSteps
45
+ }
46
+ };
47
+ };
48
+ exports.useWizard = useWizard;
@@ -2,12 +2,14 @@ import React__default from 'react';
2
2
  import { IFieldProps } from './types.js';
3
3
  import '../inputs/select/types.js';
4
4
  import '../@types/Align.js';
5
+ import '../@types/Icon.js';
6
+ import '../icons/helper.js';
7
+ import '../@types/Position.js';
5
8
  import '../@types/DataCombo.js';
6
9
  import '../@types/PermissionAttr.js';
7
10
  import '../inputs/base/types.js';
8
11
  import '../@types/Period.js';
9
12
  import '../internals/types.js';
10
- import '../@types/Position.js';
11
13
 
12
14
  declare const _default: React__default.ForwardRefExoticComponent<Pick<IFieldProps & React__default.RefAttributes<unknown>, "key" | keyof IFieldProps> & React__default.RefAttributes<HTMLElement>>;
13
15
 
@@ -2,12 +2,14 @@ import React__default from 'react';
2
2
  import { IFieldArrayProps } from './types.js';
3
3
  import '../inputs/select/types.js';
4
4
  import '../@types/Align.js';
5
+ import '../@types/Icon.js';
6
+ import '../icons/helper.js';
7
+ import '../@types/Position.js';
5
8
  import '../@types/DataCombo.js';
6
9
  import '../@types/PermissionAttr.js';
7
10
  import '../inputs/base/types.js';
8
11
  import '../@types/Period.js';
9
12
  import '../internals/types.js';
10
- import '../@types/Position.js';
11
13
 
12
14
  declare const _default: React__default.ForwardRefExoticComponent<IFieldArrayProps & React__default.RefAttributes<HTMLElement>>;
13
15
 
@@ -2,12 +2,14 @@ import React__default from 'react';
2
2
  import { IFieldProps } from './types.js';
3
3
  import '../inputs/select/types.js';
4
4
  import '../@types/Align.js';
5
+ import '../@types/Icon.js';
6
+ import '../icons/helper.js';
7
+ import '../@types/Position.js';
5
8
  import '../@types/DataCombo.js';
6
9
  import '../@types/PermissionAttr.js';
7
10
  import '../inputs/base/types.js';
8
11
  import '../@types/Period.js';
9
12
  import '../internals/types.js';
10
- import '../@types/Position.js';
11
13
 
12
14
  declare const _default: React__default.ForwardRefExoticComponent<IFieldProps & React__default.RefAttributes<HTMLElement>>;
13
15
 
@@ -2,12 +2,14 @@ import React__default from 'react';
2
2
  import { IFieldPeriodProps } from './types.js';
3
3
  import '../inputs/select/types.js';
4
4
  import '../@types/Align.js';
5
+ import '../@types/Icon.js';
6
+ import '../icons/helper.js';
7
+ import '../@types/Position.js';
5
8
  import '../@types/DataCombo.js';
6
9
  import '../@types/PermissionAttr.js';
7
10
  import '../inputs/base/types.js';
8
11
  import '../@types/Period.js';
9
12
  import '../internals/types.js';
10
- import '../@types/Position.js';
11
13
 
12
14
  declare const _default: React__default.ForwardRefExoticComponent<IFieldPeriodProps & React__default.RefAttributes<HTMLElement>>;
13
15
 
@@ -2,12 +2,14 @@ import React__default from 'react';
2
2
  import { FormContextProps, IWithFieldContext, IGetErrorMessagesParams, Validator } from './types.js';
3
3
  import '../inputs/select/types.js';
4
4
  import '../@types/Align.js';
5
+ import '../@types/Icon.js';
6
+ import '../icons/helper.js';
7
+ import '../@types/Position.js';
5
8
  import '../@types/DataCombo.js';
6
9
  import '../@types/PermissionAttr.js';
7
10
  import '../inputs/base/types.js';
8
11
  import '../@types/Period.js';
9
12
  import '../internals/types.js';
10
- import '../@types/Position.js';
11
13
 
12
14
  declare const securityBeforeUnload = "securityBeforeUnload";
13
15
  declare const FormContext: React__default.Context<FormContextProps>;
@@ -6,12 +6,14 @@ import { FormProps } from './types.js';
6
6
  import 'react';
7
7
  import '../inputs/select/types.js';
8
8
  import '../@types/Align.js';
9
+ import '../@types/Icon.js';
10
+ import '../icons/helper.js';
11
+ import '../@types/Position.js';
9
12
  import '../@types/DataCombo.js';
10
13
  import '../@types/PermissionAttr.js';
11
14
  import '../inputs/base/types.js';
12
15
  import '../@types/Period.js';
13
16
  import '../internals/types.js';
14
- import '../@types/Position.js';
15
17
 
16
18
  declare const Form: ({ submitOnPressEnterKey, dataSource, securityBeforeUnload, handlerReset, handlerSubmit, handlerValidates, style, customClass, securityTitle, securityText, securityData, onDataChange, onValidateForm, externalFieldErrors, onSubmit, skeletonize, disabled, children, useInternalState, }: FormProps) => JSX.Element;
17
19
 
@@ -1,12 +1,14 @@
1
1
  import { ChangeEvent, ComponentType, MouseEventHandler, ReactNode, CSSProperties } from 'react';
2
2
  import { AllOptions } from '../inputs/select/types.js';
3
3
  import '../@types/Align.js';
4
+ import '../@types/Icon.js';
5
+ import '../icons/helper.js';
6
+ import '../@types/Position.js';
4
7
  import '../@types/DataCombo.js';
5
8
  import '../@types/PermissionAttr.js';
6
9
  import '../inputs/base/types.js';
7
10
  import '../@types/Period.js';
8
11
  import '../internals/types.js';
9
- import '../@types/Position.js';
10
12
 
11
13
  type Validator = (value: string) => string | undefined;
12
14
  type PeriodValidator = (value: {
@@ -2,12 +2,14 @@ import React__default from 'react';
2
2
  import { WithFieldProps } from './types.js';
3
3
  import '../inputs/select/types.js';
4
4
  import '../@types/Align.js';
5
+ import '../@types/Icon.js';
6
+ import '../icons/helper.js';
7
+ import '../@types/Position.js';
5
8
  import '../@types/DataCombo.js';
6
9
  import '../@types/PermissionAttr.js';
7
10
  import '../inputs/base/types.js';
8
11
  import '../@types/Period.js';
9
12
  import '../internals/types.js';
10
- import '../@types/Position.js';
11
13
 
12
14
  declare const withFieldHOC: <ComponentProps extends WithFieldProps>(WrappedComponent: React__default.ComponentType<ComponentProps>) => React__default.ForwardRefExoticComponent<React__default.PropsWithoutRef<ComponentProps> & React__default.RefAttributes<HTMLElement>>;
13
15