linear-react-components-ui 1.1.20-beta.1 → 1.1.20-beta.11
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/lib/assets/styles/select.scss +2 -1
- package/lib/assets/styles/wizard.scss +125 -0
- package/lib/buttons/DefaultButton.js +2 -1
- package/lib/dialog/base/Content.d.ts +1 -1
- package/lib/dialog/base/Content.js +3 -2
- package/lib/dialog/base/index.js +3 -2
- package/lib/dialog/form/index.js +8 -3
- package/lib/dialog/types.d.ts +34 -4
- package/lib/dialog/wizard/index.d.ts +13 -0
- package/lib/dialog/wizard/index.js +74 -0
- package/lib/dialog/wizard/progressbar.d.ts +13 -0
- package/lib/dialog/wizard/progressbar.js +36 -0
- package/lib/dialog/wizard/step.d.ts +9 -0
- package/lib/dialog/wizard/step.js +22 -0
- package/lib/dialog/wizard/useWizard.d.ts +9 -0
- package/lib/dialog/wizard/useWizard.js +48 -0
- package/lib/form/FieldNumber.js +1 -1
- package/lib/icons/helper.d.ts +20 -0
- package/lib/icons/helper.js +20 -0
- package/lib/inputs/base/InputTextBase.js +2 -1
- package/lib/inputs/select/multiple/index.js +5 -3
- package/lib/inputs/select/simple/index.js +5 -3
- package/lib/inputs/select/types.d.ts +1 -0
- package/lib/list/Header.d.ts +1 -0
- package/lib/list/Item.d.ts +6 -2
- package/lib/list/Item.js +15 -3
- package/lib/list/helpers.d.ts +1 -0
- package/lib/list/index.d.ts +1 -0
- package/lib/list/types.d.ts +6 -0
- package/lib/table/HeaderColumn.js +7 -7
- package/lib/table/types.d.ts +0 -2
- package/package.json +1 -1
|
@@ -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
|
+
}
|
|
@@ -89,8 +89,9 @@ const DefaultButton = _ref => {
|
|
|
89
89
|
}
|
|
90
90
|
if (dropdown && showIconDropdown) {
|
|
91
91
|
const openDropDownRule = isDropdownOpened ? 'mini_up' : 'mini_down';
|
|
92
|
+
const dropdownIcon = iconName || openDropDownRule;
|
|
92
93
|
return /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
93
|
-
name:
|
|
94
|
+
name: dropdownIcon,
|
|
94
95
|
size: 16,
|
|
95
96
|
customClass: "dropdown-icon",
|
|
96
97
|
pointerEvents: "none",
|
|
@@ -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
|
};
|
package/lib/dialog/base/index.js
CHANGED
|
@@ -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,
|
package/lib/dialog/form/index.js
CHANGED
|
@@ -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 => {
|
package/lib/dialog/types.d.ts
CHANGED
|
@@ -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
|
|
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'
|
|
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,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;
|
package/lib/form/FieldNumber.js
CHANGED
|
@@ -31,7 +31,7 @@ const getEventProps = _ref => {
|
|
|
31
31
|
} = _ref;
|
|
32
32
|
return {
|
|
33
33
|
onBlur: e => {
|
|
34
|
-
if (handlerFieldChange) handlerFieldChange(e);
|
|
34
|
+
if ((component === null || component === void 0 ? void 0 : component.name) !== 'NumberField' && handlerFieldChange) handlerFieldChange(e);
|
|
35
35
|
if (validators && handlerFieldValidate) handlerFieldValidate(name, e.target.value, validators);
|
|
36
36
|
if (onBlur) onBlur(e);
|
|
37
37
|
},
|
package/lib/icons/helper.d.ts
CHANGED
|
@@ -19,6 +19,10 @@ declare const _default: {
|
|
|
19
19
|
viewbox: string;
|
|
20
20
|
paths: string[];
|
|
21
21
|
};
|
|
22
|
+
supplier: {
|
|
23
|
+
viewbox: string;
|
|
24
|
+
paths: string[];
|
|
25
|
+
};
|
|
22
26
|
mail: {
|
|
23
27
|
viewbox: string;
|
|
24
28
|
paths: string[];
|
|
@@ -607,6 +611,22 @@ declare const _default: {
|
|
|
607
611
|
viewbox: string;
|
|
608
612
|
paths: string[];
|
|
609
613
|
};
|
|
614
|
+
similarity: {
|
|
615
|
+
viewbox: string;
|
|
616
|
+
paths: string[];
|
|
617
|
+
};
|
|
618
|
+
fileStack: {
|
|
619
|
+
viewbox: string;
|
|
620
|
+
paths: string[];
|
|
621
|
+
};
|
|
622
|
+
tree: {
|
|
623
|
+
viewbox: string;
|
|
624
|
+
paths: string[];
|
|
625
|
+
};
|
|
626
|
+
bank: {
|
|
627
|
+
viewbox: string;
|
|
628
|
+
paths: string[];
|
|
629
|
+
};
|
|
610
630
|
};
|
|
611
631
|
|
|
612
632
|
export { _default as default };
|
package/lib/icons/helper.js
CHANGED
|
@@ -25,6 +25,10 @@ var _default = exports.default = {
|
|
|
25
25
|
viewbox: '0 0 16 16',
|
|
26
26
|
paths: ['M4 5c0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.209-1.791 4-4 4s-4-1.791-4-4zM12 10h-8c-2.209 0-4 1.791-4 4v1h16v-1c0-2.209-1.791-4-4-4z']
|
|
27
27
|
},
|
|
28
|
+
supplier: {
|
|
29
|
+
viewbox: '0 0 16 16',
|
|
30
|
+
paths: ['M12 12.041v-0.825c1.101-0.621 2-2.168 2-3.716 0-2.485 0-4.5-3-4.5s-3 2.015-3 4.5c0 1.548 0.898 3.095 2 3.716v0.825c-3.392 0.277-6 1.944-6 3.959h14c0-2.015-2.608-3.682-6-3.959z', 'M3.242 9.625c-0.212 0.077-0.416 0.161-0.611 0.25h4.782c-0.038-0.083-0.075-0.166-0.109-0.25h-4.062z', 'M0.425 11.625c-0.053 0.082-0.101 0.165-0.144 0.25h5.834c0.192-0.089 0.389-0.172 0.593-0.25h-6.284z', 'M1.367 10.625c-0.105 0.081-0.204 0.164-0.299 0.25h6.933c-0.060-0.081-0.118-0.165-0.174-0.25h-6.461z', 'M5.261 9.125c-0.424 0.062-0.833 0.146-1.222 0.25h3.17c-0.030-0.083-0.057-0.166-0.083-0.25h-1.864z', 'M6 8.625v0.25h1.054c-0.022-0.083-0.041-0.166-0.059-0.25h-0.995z', 'M5.851 8.125c0.049 0.032 0.099 0.063 0.149 0.091v0.159h0.947c-0.014-0.083-0.025-0.167-0.035-0.25h-1.062z', 'M0.030 12.625c-0.013 0.083-0.022 0.166-0.027 0.25h4.501c0.102-0.085 0.209-0.169 0.321-0.25h-4.795z', 'M1.719 10.375h5.955c-0.024-0.042-0.048-0.084-0.072-0.127-0.022-0.041-0.044-0.082-0.066-0.123h-5.402c-0.145 0.080-0.283 0.163-0.415 0.25z', 'M4.005 3.625c-0.002 0.083-0.003 0.166-0.003 0.25h3.339c0.004-0.009 0.008-0.018 0.012-0.028 0.035-0.076 0.073-0.15 0.112-0.222h-3.46z', 'M0.168 12.125c-0.032 0.082-0.060 0.166-0.083 0.25h5.109c0.136-0.087 0.277-0.17 0.423-0.25h-5.449z', 'M4.643 0.875h4.713c-0.070-0.089-0.148-0.173-0.234-0.25h-4.245c-0.086 0.077-0.164 0.161-0.234 0.25z', 'M0.602 11.375h6.845c0.256-0.076 0.519-0.145 0.787-0.204-0.013-0.015-0.025-0.030-0.038-0.046h-7.381c-0.076 0.082-0.147 0.165-0.213 0.25z', 'M5.255 7.625c0.085 0.089 0.173 0.173 0.263 0.25h1.371c-0.006-0.083-0.010-0.167-0.012-0.25h-1.622z', 'M4.848 7.125c0.060 0.086 0.123 0.17 0.188 0.25h1.84c0-0.084 0-0.167 0-0.25h-2.027z', 'M4.255 1.625c-0.027 0.081-0.050 0.164-0.072 0.25h5.632c-0.021-0.086-0.045-0.169-0.072-0.25h-5.489z', 'M4.13 2.125c-0.015 0.082-0.029 0.165-0.041 0.25h4.625c0.179-0.098 0.372-0.181 0.578-0.25h-5.162z', 'M4.022 3.125c-0.004 0.082-0.008 0.166-0.010 0.25h3.605c0.058-0.087 0.12-0.17 0.185-0.25h-3.78z', 'M4.059 2.625c-0.008 0.082-0.016 0.165-0.022 0.25h3.995c0.092-0.089 0.189-0.173 0.292-0.25h-4.265z', 'M5.866 0.125c-0.243 0.062-0.455 0.146-0.638 0.25h3.544c-0.184-0.104-0.396-0.188-0.639-0.25h-2.266z', 'M4.544 6.625c0.045 0.085 0.092 0.169 0.141 0.25h2.192c0.001-0.084 0.002-0.167 0.003-0.25h-2.336z', 'M4.475 1.125c-0.046 0.080-0.088 0.163-0.125 0.25h5.3c-0.037-0.087-0.079-0.17-0.125-0.25h-5.050z', 'M4.152 5.625c0.022 0.084 0.048 0.167 0.074 0.25h2.683c0.005-0.084 0.012-0.167 0.019-0.25h-2.777z', 'M4.316 6.125c0.033 0.085 0.068 0.168 0.105 0.25h2.464c0.003-0.084 0.006-0.167 0.009-0.25h-2.579z', 'M4 4.125c-0 0.083-0 0.166-0 0.25h3.155c0.025-0.085 0.053-0.168 0.084-0.25h-3.238z', 'M4.002 4.625c0.003 0.083 0.008 0.167 0.016 0.25h3.014c0.016-0.084 0.035-0.168 0.055-0.25h-3.085z', 'M4.048 5.125c0.013 0.084 0.027 0.167 0.045 0.25h2.862c0.010-0.084 0.021-0.167 0.034-0.25h-2.941z']
|
|
31
|
+
},
|
|
28
32
|
mail: {
|
|
29
33
|
viewbox: '0 0 16 16',
|
|
30
34
|
paths: ['M13.333 0h-10.666c-1.467 0-2.667 1.2-2.667 2.667v10.666c0 1.468 1.2 2.667 2.667 2.667h10.666c1.467 0 2.667-1.199 2.667-2.667v-10.666c0-1.467-1.2-2.667-2.667-2.667zM2.854 13.854l-1.207-1.207 4-4 0.457 0.457-3.25 4.75zM2.396 3.104l0.457-0.457 5.146 4.146 5.146-4.146 0.457 0.457-5.604 6.604-5.604-6.604zM13.146 13.854l-3.25-4.75 0.457-0.457 4 4-1.207 1.207z']
|
|
@@ -612,5 +616,21 @@ var _default = exports.default = {
|
|
|
612
616
|
user_block: {
|
|
613
617
|
viewbox: '0 0 16 16',
|
|
614
618
|
paths: ['M7.5 16h-6.977c-0.14 0-0.274-0.059-0.369-0.163s-0.141-0.242-0.129-0.382c0.11-1.22 0.585-2.363 1.373-3.305 0.697-0.832 1.59-1.452 2.602-1.809l0-0.475c-0.562-0.385-1.037-0.926-1.385-1.582-0.402-0.758-0.615-1.634-0.615-2.535 0-1.251 0.405-2.431 1.139-3.323 0.758-0.92 1.774-1.427 2.861-1.427 2.119 0 3.874 1.966 3.993 4.476 0.013 0.276-0.2 0.51-0.476 0.523s-0.51-0.2-0.523-0.476c-0.094-1.976-1.41-3.524-2.995-3.524-1.654 0-3 1.682-3 3.75 0 1.457 0.687 2.795 1.75 3.408 0.155 0.089 0.25 0.254 0.25 0.433l-0 1.116c0 0.224-0.149 0.42-0.364 0.481-0.967 0.274-1.822 0.828-2.471 1.604-0.538 0.643-0.901 1.397-1.064 2.208h6.4c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5z', 'M11.5 7c-2.481 0-4.5 2.019-4.5 4.5s2.019 4.5 4.5 4.5 4.5-2.019 4.5-4.5-2.019-4.5-4.5-4.5zM8 11.5c0-1.93 1.57-3.5 3.5-3.5 0.785 0 1.511 0.26 2.095 0.698l-4.897 4.897c-0.438-0.584-0.698-1.31-0.698-2.095zM11.5 15c-0.785 0-1.511-0.26-2.095-0.698l4.897-4.897c0.438 0.584 0.698 1.31 0.698 2.095 0 1.93-1.57 3.5-3.5 3.5z']
|
|
619
|
+
},
|
|
620
|
+
similarity: {
|
|
621
|
+
viewbox: '0 0 16 16',
|
|
622
|
+
paths: ['M13 4h-3v-1l-3-3h-7v12h6v4h10v-9l-3-3zM13 5.414l1.586 1.586h-1.586v-1.586zM7 1.414l1.586 1.586h-1.586v-1.586zM1 1h5v3h3v7h-8v-10zM15 15h-8v-3h3v-7h2v3h3v7z']
|
|
623
|
+
},
|
|
624
|
+
fileStack: {
|
|
625
|
+
viewbox: '0 0 16 16',
|
|
626
|
+
paths: ['M13.75 4h-0.75v-0.75c0-0.689-0.561-1.25-1.25-1.25h-0.75v-0.75c0-0.689-0.561-1.25-1.25-1.25h-7.5c-0.689 0-1.25 0.561-1.25 1.25v9.5c0 0.689 0.561 1.25 1.25 1.25h0.75v0.75c0 0.689 0.561 1.25 1.25 1.25h0.75v0.75c0 0.689 0.561 1.25 1.25 1.25h7.5c0.689 0 1.25-0.561 1.25-1.25v-9.5c0-0.689-0.561-1.25-1.25-1.25zM2.25 11c-0.138 0-0.25-0.113-0.25-0.25v-9.5c0-0.137 0.112-0.25 0.25-0.25h7.5c0.137 0 0.25 0.113 0.25 0.25v0.75h-5.75c-0.689 0-1.25 0.561-1.25 1.25v7.75h-0.75zM4.25 13c-0.138 0-0.25-0.113-0.25-0.25v-9.5c0-0.138 0.112-0.25 0.25-0.25h7.5c0.137 0 0.25 0.112 0.25 0.25v0.75h-5.75c-0.689 0-1.25 0.561-1.25 1.25v7.75h-0.75zM14 14.75c0 0.137-0.113 0.25-0.25 0.25h-7.5c-0.138 0-0.25-0.113-0.25-0.25v-9.5c0-0.138 0.112-0.25 0.25-0.25h7.5c0.137 0 0.25 0.112 0.25 0.25v9.5z']
|
|
627
|
+
},
|
|
628
|
+
tree: {
|
|
629
|
+
viewbox: '0 0 16 16',
|
|
630
|
+
paths: ['M15.25 12h-0.25v-3.25c0-0.965-0.785-1.75-1.75-1.75h-4.25v-2h0.25c0.412 0 0.75-0.338 0.75-0.75v-2.5c0-0.413-0.338-0.75-0.75-0.75h-2.5c-0.412 0-0.75 0.337-0.75 0.75v2.5c0 0.412 0.338 0.75 0.75 0.75h0.25v2h-4.25c-0.965 0-1.75 0.785-1.75 1.75v3.25h-0.25c-0.412 0-0.75 0.338-0.75 0.75v2.5c0 0.412 0.338 0.75 0.75 0.75h2.5c0.413 0 0.75-0.338 0.75-0.75v-2.5c0-0.412-0.337-0.75-0.75-0.75h-0.25v-3h4v3h-0.25c-0.412 0-0.75 0.338-0.75 0.75v2.5c0 0.412 0.338 0.75 0.75 0.75h2.5c0.412 0 0.75-0.338 0.75-0.75v-2.5c0-0.412-0.338-0.75-0.75-0.75h-0.25v-3h4v3h-0.25c-0.412 0-0.75 0.338-0.75 0.75v2.5c0 0.412 0.338 0.75 0.75 0.75h2.5c0.412 0 0.75-0.338 0.75-0.75v-2.5c0-0.412-0.338-0.75-0.75-0.75zM3 15h-2v-2h2v2zM9 15h-2v-2h2v2zM7 4v-2h2v2h-2zM15 15h-2v-2h2v2z']
|
|
631
|
+
},
|
|
632
|
+
bank: {
|
|
633
|
+
viewbox: '0 0 16 16',
|
|
634
|
+
paths: ['M16 15v-1h-1v-6h1v-1h-3v1h1v6h-3v-6h1v-1h-3v1h1v6h-3v-6h1v-1h-3v1h1v6h-3v-6h1v-1h-3v1h1v6h-1v1h-1v1h17v-1h-1z', 'M8 0h1l8 5v1h-17v-1l8-5z']
|
|
615
635
|
}
|
|
616
636
|
};
|
|
@@ -219,7 +219,8 @@ const InputTextBase = props => {
|
|
|
219
219
|
className: "inputcontent ".concat(customClassForInputContent)
|
|
220
220
|
}, type === 'textarea' ? /*#__PURE__*/_react.default.createElement("textarea", _extends({
|
|
221
221
|
rows: props.rows,
|
|
222
|
-
cols: props.cols
|
|
222
|
+
cols: props.cols,
|
|
223
|
+
tabIndex: applyTabIndex()
|
|
223
224
|
}, inputProps())) : /*#__PURE__*/_react.default.createElement("input", _extends({
|
|
224
225
|
autoComplete: autoComplete,
|
|
225
226
|
tabIndex: applyTabIndex(),
|
|
@@ -25,7 +25,8 @@ const MultipleSelect = props => {
|
|
|
25
25
|
value = [],
|
|
26
26
|
remoteSearch = false,
|
|
27
27
|
descriptionKey,
|
|
28
|
-
showClearButton
|
|
28
|
+
showClearButton,
|
|
29
|
+
rightElements = []
|
|
29
30
|
} = props;
|
|
30
31
|
const [dataCombo, setDataCombo] = (0, _react.useState)(dataSource);
|
|
31
32
|
const [currents, setCurrents] = (0, _react.useState)([]);
|
|
@@ -240,7 +241,8 @@ const MultipleSelect = props => {
|
|
|
240
241
|
selectWrapper.current = r;
|
|
241
242
|
},
|
|
242
243
|
handlerSetOnDenied: setOnDenied,
|
|
243
|
-
rightElements: /*#__PURE__*/_react.default.createElement(_ActionButtons.default, {
|
|
244
|
+
rightElements: [...rightElements, /*#__PURE__*/_react.default.createElement(_ActionButtons.default, {
|
|
245
|
+
key: "action-buttons-multiselect",
|
|
244
246
|
showClearButton: showClearButton,
|
|
245
247
|
disabled: shouldDisable() || shouldBeReadOnly(),
|
|
246
248
|
dropDownOpened: opened,
|
|
@@ -249,7 +251,7 @@ const MultipleSelect = props => {
|
|
|
249
251
|
return onClearClick();
|
|
250
252
|
},
|
|
251
253
|
handlerOpenClose: onOpenClose
|
|
252
|
-
})
|
|
254
|
+
})]
|
|
253
255
|
}), /*#__PURE__*/_react.default.createElement(_Selecteds.default, _extends({}, props, {
|
|
254
256
|
currents: currents,
|
|
255
257
|
handlerOnUnselect: onUnselect
|
|
@@ -34,7 +34,8 @@ const SimpleSelect = props => {
|
|
|
34
34
|
searchOnDropdown = false,
|
|
35
35
|
allOptions = undefined,
|
|
36
36
|
showClearButton = false,
|
|
37
|
-
searchNotFoundText
|
|
37
|
+
searchNotFoundText,
|
|
38
|
+
rightElements = []
|
|
38
39
|
} = props;
|
|
39
40
|
const descriptionKeyIsString = typeof descriptionKey === 'string';
|
|
40
41
|
const dataSourceWithAllOptions = allOptions ? [{
|
|
@@ -274,7 +275,8 @@ const SimpleSelect = props => {
|
|
|
274
275
|
selectWrapper.current = r;
|
|
275
276
|
},
|
|
276
277
|
handlerSetOnDenied: inputOnDenied => setOnDenied(inputOnDenied),
|
|
277
|
-
rightElements: /*#__PURE__*/_react.default.createElement(_ActionButtons.default, {
|
|
278
|
+
rightElements: [...rightElements, /*#__PURE__*/_react.default.createElement(_ActionButtons.default, {
|
|
279
|
+
key: "action-buttons-simpleselect",
|
|
278
280
|
disabled: shouldDisable() || shouldBeReadOnly(),
|
|
279
281
|
showClearButton: showClearButton,
|
|
280
282
|
dropDownOpened: opened,
|
|
@@ -283,7 +285,7 @@ const SimpleSelect = props => {
|
|
|
283
285
|
return onClearClick();
|
|
284
286
|
},
|
|
285
287
|
handlerOpenClose: onOpenClose
|
|
286
|
-
})
|
|
288
|
+
})]
|
|
287
289
|
})), opened && /*#__PURE__*/_react.default.createElement(_Dropdown.default, _extends({}, props, {
|
|
288
290
|
opened: opened,
|
|
289
291
|
selected: selected,
|
|
@@ -50,6 +50,7 @@ interface ISimpleSelectProps {
|
|
|
50
50
|
onFocus?: () => void;
|
|
51
51
|
allOptions?: AllOptions;
|
|
52
52
|
inputRef?: MutableRefObject<HTMLInputElement | HTMLTextAreaElement | null> | ((ref: HTMLInputElement | HTMLTextAreaElement | null) => void);
|
|
53
|
+
rightElements?: JSX.Element[];
|
|
53
54
|
}
|
|
54
55
|
interface ISelectFieldProps extends Omit<ISimpleSelectProps, 'idKey' | 'value' | 'descriptionKey'> {
|
|
55
56
|
multiple?: boolean;
|
package/lib/list/Header.d.ts
CHANGED
package/lib/list/Item.d.ts
CHANGED
|
@@ -3,7 +3,11 @@ import 'react';
|
|
|
3
3
|
import '../@types/PermissionAttr.js';
|
|
4
4
|
import '../@types/Icon.js';
|
|
5
5
|
import '../icons/helper.js';
|
|
6
|
+
import '../@types/Position.js';
|
|
6
7
|
|
|
7
|
-
declare const
|
|
8
|
+
declare const _default: {
|
|
9
|
+
(props: IListItemProps): JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
8
12
|
|
|
9
|
-
export {
|
|
13
|
+
export { _default as default };
|
package/lib/list/Item.js
CHANGED
|
@@ -11,6 +11,7 @@ var _checkbox = _interopRequireDefault(require("../checkbox"));
|
|
|
11
11
|
var _helpers = require("./helpers");
|
|
12
12
|
var _withDropdown = require("../dropdown/withDropdown");
|
|
13
13
|
var constants = _interopRequireWildcard(require("../internals/constants"));
|
|
14
|
+
var _withTooltip = _interopRequireWildcard(require("../internals/withTooltip"));
|
|
14
15
|
var _permissionValidations = require("../permissionValidations");
|
|
15
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
17
|
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); }
|
|
@@ -38,7 +39,9 @@ const Item = props => {
|
|
|
38
39
|
separator = true,
|
|
39
40
|
visible = true,
|
|
40
41
|
permissionAttr,
|
|
41
|
-
skeletonize
|
|
42
|
+
skeletonize,
|
|
43
|
+
targetRef,
|
|
44
|
+
onDeniedText = 'Permissão Negada! Consulte o Administrador do sistema.'
|
|
42
45
|
} = props;
|
|
43
46
|
const {
|
|
44
47
|
handleSelectItem,
|
|
@@ -48,6 +51,9 @@ const Item = props => {
|
|
|
48
51
|
selectOnEnter
|
|
49
52
|
} = (0, _react.useContext)(_helpers.ListContext);
|
|
50
53
|
const dropdownContext = (0, _react.useContext)(_withDropdown.WithDropdownContext);
|
|
54
|
+
const {
|
|
55
|
+
handlerSetOnDeniedText
|
|
56
|
+
} = (0, _react.useContext)(_withTooltip.TooltipContext);
|
|
51
57
|
const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible];
|
|
52
58
|
const [onDenied] = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr));
|
|
53
59
|
const navigate = (0, _reactRouterDom.useNavigate)();
|
|
@@ -103,6 +109,9 @@ const Item = props => {
|
|
|
103
109
|
document.removeEventListener('keydown', onKeyDown);
|
|
104
110
|
};
|
|
105
111
|
}, [url, selectedItemId, itemId]);
|
|
112
|
+
(0, _react.useEffect)(() => {
|
|
113
|
+
if (disabledByPermission) handlerSetOnDeniedText(onDeniedText);
|
|
114
|
+
}, [disabledByPermission]);
|
|
106
115
|
const renderCheckBox = (0, _react.useMemo)(() => {
|
|
107
116
|
if (!disabledByPermission && displayCheckbox) {
|
|
108
117
|
return /*#__PURE__*/_react.default.createElement(_checkbox.default, {
|
|
@@ -117,7 +126,10 @@ const Item = props => {
|
|
|
117
126
|
}, [disabledByPermission && displayCheckbox]);
|
|
118
127
|
if (!visible || onDenied.unvisible) return null;
|
|
119
128
|
return /*#__PURE__*/_react.default.createElement("li", _extends({
|
|
120
|
-
ref:
|
|
129
|
+
ref: ref => {
|
|
130
|
+
if (targetRef) targetRef(ref);
|
|
131
|
+
return itemId && selectedItemId === itemId ? selectedItemRef : null;
|
|
132
|
+
},
|
|
121
133
|
style: style,
|
|
122
134
|
className: "item-container ".concat(hovered && 'hovered', "\n ").concat(itemId && selectedItemId === itemId ? '-activedlist' : '')
|
|
123
135
|
}, getProps(), {
|
|
@@ -137,4 +149,4 @@ const Item = props => {
|
|
|
137
149
|
className: "".concat(getClass(), " -icon-right")
|
|
138
150
|
}, getIcon(rightIconName, rightIcon), rightElement));
|
|
139
151
|
};
|
|
140
|
-
var _default = exports.default = Item;
|
|
152
|
+
var _default = exports.default = (0, _withTooltip.default)(Item);
|
package/lib/list/helpers.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { IListContext } from './types.js';
|
|
|
3
3
|
import '../@types/PermissionAttr.js';
|
|
4
4
|
import '../@types/Icon.js';
|
|
5
5
|
import '../icons/helper.js';
|
|
6
|
+
import '../@types/Position.js';
|
|
6
7
|
|
|
7
8
|
declare const ListContext: React__default.Context<IListContext>;
|
|
8
9
|
declare const LIST_ITEMS_TYPES: {
|
package/lib/list/index.d.ts
CHANGED
package/lib/list/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode, ReactElement, CSSProperties, Ref } from 'react';
|
|
2
2
|
import { PermissionAttr } from '../@types/PermissionAttr.js';
|
|
3
3
|
import { IconNames } from '../@types/Icon.js';
|
|
4
|
+
import { Position } from '../@types/Position.js';
|
|
4
5
|
import '../icons/helper.js';
|
|
5
6
|
|
|
6
7
|
type ItemId = string;
|
|
@@ -52,6 +53,11 @@ interface IListItemProps {
|
|
|
52
53
|
permissionAttr?: PermissionAttr | PermissionAttr[];
|
|
53
54
|
selectOnEnter?: boolean;
|
|
54
55
|
skeletonize?: boolean;
|
|
56
|
+
targetRef?: (ref: HTMLLIElement) => void;
|
|
57
|
+
tooltipPosition?: Exclude<Position, 'center'>;
|
|
58
|
+
tooltipWidth?: string | number;
|
|
59
|
+
tooltip?: string;
|
|
60
|
+
onDeniedText?: string;
|
|
55
61
|
}
|
|
56
62
|
interface IListContext {
|
|
57
63
|
selectable: boolean;
|
|
@@ -8,6 +8,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _icons = _interopRequireDefault(require("../icons"));
|
|
9
9
|
var _skeleton = _interopRequireDefault(require("../skeleton"));
|
|
10
10
|
var _helpers = _interopRequireDefault(require("./helpers"));
|
|
11
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
11
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
13
|
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); }
|
|
13
14
|
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; }
|
|
@@ -20,8 +21,6 @@ const HeaderColumn = props => {
|
|
|
20
21
|
textAlign,
|
|
21
22
|
visible = true,
|
|
22
23
|
id,
|
|
23
|
-
rowSpan,
|
|
24
|
-
colSpan,
|
|
25
24
|
isMenuColumn = false
|
|
26
25
|
} = props;
|
|
27
26
|
const {
|
|
@@ -38,13 +37,14 @@ const HeaderColumn = props => {
|
|
|
38
37
|
size: 22
|
|
39
38
|
});
|
|
40
39
|
};
|
|
40
|
+
const getProps = () => {
|
|
41
|
+
return _lodash.default.omit(props, ['isMenuColumn', 'customClass', 'children', 'textAlign', 'visible']);
|
|
42
|
+
};
|
|
41
43
|
if (!visible) return null;
|
|
42
|
-
return /*#__PURE__*/_react.default.createElement("th", _extends({},
|
|
44
|
+
return /*#__PURE__*/_react.default.createElement("th", _extends({}, getProps(), {
|
|
43
45
|
id: id,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
className: "headercolumn ".concat(customClass, " text-align-").concat(textAlign, " ").concat(isMenuColumn && 'menu-column'),
|
|
47
|
-
style: style
|
|
46
|
+
style: style,
|
|
47
|
+
className: "headercolumn ".concat(customClass, " text-align-").concat(textAlign, " ").concat(isMenuColumn && 'menu-column')
|
|
48
48
|
}), skeletonize && (skeletonInHeader || !skeletonInRows) && !vertical ? /*#__PURE__*/_react.default.createElement(_skeleton.default, {
|
|
49
49
|
height: style && style.height ? undefined : 16,
|
|
50
50
|
style: {
|
package/lib/table/types.d.ts
CHANGED
|
@@ -25,8 +25,6 @@ interface ITableHeaderProps extends ComponentProps<'th'> {
|
|
|
25
25
|
textAlign?: string;
|
|
26
26
|
visible?: boolean;
|
|
27
27
|
id?: string;
|
|
28
|
-
rowSpan?: number;
|
|
29
|
-
colSpan?: number;
|
|
30
28
|
isMenuColumn?: boolean;
|
|
31
29
|
}
|
|
32
30
|
interface ITableBodyProps extends TableHTMLAttributes<HTMLTableElement> {
|