linear-react-components-ui 1.1.18-beta.16 → 1.1.18-beta.17
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/.eslintcache +1 -1
- package/lib/assets/styles/input.scss +2 -2
- package/lib/assets/styles/popover.scss +3 -0
- package/lib/checkbox/index.js +45 -18
- package/lib/checkbox/types.d.ts +4 -0
- package/lib/form/types.d.ts +14 -0
- package/lib/inputs/base/InputTextBase.js +34 -8
- package/lib/inputs/base/types.d.ts +3 -0
- package/lib/inputs/color/types.d.ts +5 -0
- package/lib/inputs/date/types.d.ts +4 -0
- package/lib/inputs/file/DragDropFile.js +2 -1
- package/lib/inputs/file/types.d.ts +3 -0
- package/lib/inputs/mask/helpers.d.ts +4 -0
- package/lib/inputs/mask/types.d.ts +4 -0
- package/lib/inputs/multiSelect/types.d.ts +4 -0
- package/lib/inputs/number/BaseNumber.d.ts +1 -1
- package/lib/inputs/number/Currency.d.ts +1 -1
- package/lib/inputs/number/Decimal.d.ts +1 -1
- package/lib/inputs/number/index.d.ts +1 -1
- package/lib/inputs/number/index.js +7 -3
- package/lib/inputs/number/types.d.ts +14 -2
- package/lib/inputs/period/index.js +32 -5
- package/lib/inputs/period/types.d.ts +3 -0
- package/lib/inputs/select/multiple/index.js +9 -2
- package/lib/inputs/select/types.d.ts +6 -0
- package/lib/popover/index.js +3 -5
- package/lib/popover/types.d.ts +2 -1
- package/lib/radio/index.d.ts +1 -1
- package/lib/radio/index.js +32 -1
- package/lib/radio/types.d.ts +6 -0
- package/lib/textContent/index.d.ts +18 -4
- package/lib/textContent/index.js +14 -4
- package/package.json +1 -1
- package/lib/checkbox/Label.d.ts +0 -11
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@import "fonts.scss";
|
|
3
3
|
@import "colors.scss";
|
|
4
4
|
@import "effects";
|
|
5
|
-
.input-base-component > .labelcontainer {
|
|
5
|
+
.input-base-component > .labelcontainer > .text-content {
|
|
6
6
|
margin: 0;
|
|
7
7
|
padding: 0;
|
|
8
8
|
line-height: 14px;
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
.input-base-component.-skeletonized {
|
|
118
|
-
> .labelcontainer > .label,
|
|
118
|
+
> .labelcontainer > .text-content > .label,
|
|
119
119
|
> .hint {
|
|
120
120
|
@extend %skeleton-component;
|
|
121
121
|
color: transparent;
|
package/lib/checkbox/index.js
CHANGED
|
@@ -5,12 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _Label = _interopRequireDefault(require("./Label"));
|
|
9
8
|
var _gridlayout = _interopRequireDefault(require("../gridlayout"));
|
|
10
9
|
var _permissionValidations = require("../permissionValidations");
|
|
11
10
|
require("../assets/styles/checkbox.scss");
|
|
12
11
|
var _errorMessage = require("../inputs/errorMessage");
|
|
13
12
|
var _ = require("..");
|
|
13
|
+
var _textContent = _interopRequireDefault(require("../textContent"));
|
|
14
|
+
var _popover = _interopRequireDefault(require("../popover"));
|
|
15
|
+
var _hint = _interopRequireDefault(require("../hint"));
|
|
14
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
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); }
|
|
16
18
|
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; }
|
|
@@ -40,7 +42,11 @@ const CheckBox = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
40
42
|
tooltipWidth = 'auto',
|
|
41
43
|
skeletonize,
|
|
42
44
|
targetRef,
|
|
43
|
-
errorMessages
|
|
45
|
+
errorMessages,
|
|
46
|
+
customClassForLabel,
|
|
47
|
+
hintPosition = 'below',
|
|
48
|
+
themePopover = 'light',
|
|
49
|
+
popoverAlign = 'left'
|
|
44
50
|
} = _ref;
|
|
45
51
|
const [isChecked, setIsChecked] = (0, _react.useState)(checked);
|
|
46
52
|
const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible];
|
|
@@ -61,26 +67,30 @@ const CheckBox = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
61
67
|
};
|
|
62
68
|
return {
|
|
63
69
|
onClick: () => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
70
|
+
if (!shouldDisable() && !skeletonize) {
|
|
71
|
+
setIsChecked(!isChecked);
|
|
72
|
+
onChange({
|
|
73
|
+
target
|
|
74
|
+
});
|
|
75
|
+
}
|
|
67
76
|
},
|
|
68
77
|
onKeyDown: undefined,
|
|
69
78
|
role: 'checkbox',
|
|
70
79
|
tabIndex: -1
|
|
71
80
|
};
|
|
72
81
|
};
|
|
73
|
-
const renderInput = () => /*#__PURE__*/_react.default.createElement("div",
|
|
82
|
+
const renderInput = () => /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
83
|
+
"data-skeletonized": skeletonize,
|
|
74
84
|
className: "checkbox-component",
|
|
75
|
-
|
|
76
|
-
|
|
85
|
+
style: {
|
|
86
|
+
display: 'flex',
|
|
87
|
+
alignItems: 'center'
|
|
88
|
+
}
|
|
89
|
+
}, /*#__PURE__*/_react.default.createElement("span", _extends({
|
|
77
90
|
"data-testid": "checkbox-container",
|
|
78
91
|
className: "inputcontent",
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
role: "checkbox",
|
|
82
|
-
"aria-checked": "false"
|
|
83
|
-
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
92
|
+
"aria-checked": isChecked
|
|
93
|
+
}, getProps()), /*#__PURE__*/_react.default.createElement("input", {
|
|
84
94
|
id: id || undefined,
|
|
85
95
|
ref: r => {
|
|
86
96
|
if (targetRef) targetRef(r);
|
|
@@ -98,14 +108,31 @@ const CheckBox = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
98
108
|
}), /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_.Icon, {
|
|
99
109
|
size: 12,
|
|
100
110
|
name: "checkmark"
|
|
101
|
-
})), label && /*#__PURE__*/_react.default.createElement(
|
|
102
|
-
|
|
111
|
+
})), label && /*#__PURE__*/_react.default.createElement("div", {
|
|
112
|
+
className: "description"
|
|
113
|
+
}, /*#__PURE__*/_react.default.createElement(_textContent.default, {
|
|
114
|
+
required: required,
|
|
115
|
+
disabled: shouldDisable(),
|
|
116
|
+
className: customClassForLabel,
|
|
103
117
|
tooltip: tooltip,
|
|
104
118
|
tooltipWidth: tooltipWidth,
|
|
105
|
-
tooltipPosition: tooltipPosition
|
|
119
|
+
tooltipPosition: tooltipPosition
|
|
120
|
+
}), label, /*#__PURE__*/_react.default.createElement(_textContent.default, null), /*#__PURE__*/_react.default.createElement(_hint.default, {
|
|
106
121
|
disabled: disabled,
|
|
107
|
-
|
|
108
|
-
|
|
122
|
+
visible: !!hint && hintPosition === 'below',
|
|
123
|
+
description: hint,
|
|
124
|
+
customClass: "hint"
|
|
125
|
+
}))), !!hint && hintPosition === 'onLabelRight' && !skeletonize && /*#__PURE__*/_react.default.createElement(_popover.default, {
|
|
126
|
+
theme: themePopover,
|
|
127
|
+
align: popoverAlign,
|
|
128
|
+
customClass: "-hint",
|
|
129
|
+
iconColor: "#03bde2",
|
|
130
|
+
style: {
|
|
131
|
+
margin: '0px 5px',
|
|
132
|
+
height: 'auto',
|
|
133
|
+
width: 20
|
|
134
|
+
}
|
|
135
|
+
}, hint)), /*#__PURE__*/_react.default.createElement(_errorMessage.ErrorMessage, {
|
|
109
136
|
messages: errorMessages
|
|
110
137
|
}));
|
|
111
138
|
if (onDenied.unvisible) return null;
|
package/lib/checkbox/types.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ interface ICheckBoxProps {
|
|
|
29
29
|
children?: ReactElement;
|
|
30
30
|
autofocus?: boolean;
|
|
31
31
|
hint?: string;
|
|
32
|
+
hintPosition?: 'below' | 'onLabelRight';
|
|
32
33
|
gridLayout?: string;
|
|
33
34
|
permissionAttr?: PermissionAttr | PermissionAttr[];
|
|
34
35
|
tooltip?: string;
|
|
@@ -38,6 +39,9 @@ interface ICheckBoxProps {
|
|
|
38
39
|
targetRef?: (ref: HTMLInputElement | null) => void;
|
|
39
40
|
targetSpanRef?: (ref: HTMLSpanElement | null) => void;
|
|
40
41
|
errorMessages?: string[] | undefined;
|
|
42
|
+
customClassForLabel?: string;
|
|
43
|
+
themePopover?: 'light' | 'dark';
|
|
44
|
+
popoverAlign?: 'right' | 'left';
|
|
41
45
|
}
|
|
42
46
|
|
|
43
47
|
export { ChangeEvent, ICheckBoxProps };
|
package/lib/form/types.d.ts
CHANGED
|
@@ -85,7 +85,13 @@ interface IFieldProps extends WithFieldProps {
|
|
|
85
85
|
autoFocus?: boolean;
|
|
86
86
|
autoCompleteMask?: 'left' | 'right';
|
|
87
87
|
mask?: string;
|
|
88
|
+
hint?: string | string[];
|
|
89
|
+
hintPosition?: 'below' | 'onLabelRight';
|
|
90
|
+
themePopover?: 'light' | 'dark';
|
|
91
|
+
popoverAlign?: 'right' | 'left';
|
|
92
|
+
displayCurrencySymbol?: boolean;
|
|
88
93
|
removeZeroLeft?: boolean;
|
|
94
|
+
checked?: boolean;
|
|
89
95
|
}
|
|
90
96
|
interface CustomEvent {
|
|
91
97
|
target: {
|
|
@@ -122,6 +128,10 @@ interface IFieldArrayProps extends WithFieldProps {
|
|
|
122
128
|
onBlur?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
123
129
|
handlerFieldValidade?: (name: string, value: string, validatorsArray: Validator[] | Validator) => void;
|
|
124
130
|
required?: boolean;
|
|
131
|
+
hint?: string | string[];
|
|
132
|
+
hintPosition?: 'below' | 'onLabelRight';
|
|
133
|
+
themePopover?: 'light' | 'dark';
|
|
134
|
+
popoverAlign?: 'right' | 'left';
|
|
125
135
|
}
|
|
126
136
|
type PeriodChangeEvent = {
|
|
127
137
|
initial: string;
|
|
@@ -155,6 +165,10 @@ interface IFieldPeriodProps extends WithFieldProps {
|
|
|
155
165
|
handlerFieldValidade?: (name: string, value: object, validatorsArray: PeriodValidator[] | PeriodValidator) => void;
|
|
156
166
|
onChange?: (event: PeriodChangeEvent) => PeriodChangeEvent;
|
|
157
167
|
gridLayout?: string;
|
|
168
|
+
hint?: string | string[];
|
|
169
|
+
hintPosition?: 'below' | 'onLabelRight';
|
|
170
|
+
themePopover?: 'light' | 'dark';
|
|
171
|
+
popoverAlign?: 'right' | 'left';
|
|
158
172
|
}
|
|
159
173
|
interface FormContextProps {
|
|
160
174
|
skeletonize?: boolean;
|
|
@@ -13,7 +13,8 @@ var _withTooltip = _interopRequireDefault(require("../../internals/withTooltip")
|
|
|
13
13
|
var _permissionValidations = require("../../permissionValidations");
|
|
14
14
|
var _hint = _interopRequireDefault(require("../../hint"));
|
|
15
15
|
var _errorMessage = require("../errorMessage");
|
|
16
|
-
var
|
|
16
|
+
var _textContent = _interopRequireDefault(require("../../textContent"));
|
|
17
|
+
var _popover = _interopRequireDefault(require("../../popover"));
|
|
17
18
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
19
|
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); }
|
|
19
20
|
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; }
|
|
@@ -43,6 +44,7 @@ const InputTextBase = props => {
|
|
|
43
44
|
label,
|
|
44
45
|
labelUppercase,
|
|
45
46
|
hint,
|
|
47
|
+
hintPosition = 'below',
|
|
46
48
|
errorMessages,
|
|
47
49
|
visible = true,
|
|
48
50
|
permissionAttr,
|
|
@@ -68,7 +70,9 @@ const InputTextBase = props => {
|
|
|
68
70
|
onDragLeave,
|
|
69
71
|
onClick,
|
|
70
72
|
readOnlyClass,
|
|
71
|
-
autoComplete = 'on'
|
|
73
|
+
autoComplete = 'on',
|
|
74
|
+
themePopover = 'light',
|
|
75
|
+
popoverAlign = 'left'
|
|
72
76
|
} = props;
|
|
73
77
|
let propsInput;
|
|
74
78
|
const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible, _permissionValidations.OPTIONS_ON_DENIED.readOnly, _permissionValidations.OPTIONS_ON_DENIED.hideContent];
|
|
@@ -195,16 +199,38 @@ const InputTextBase = props => {
|
|
|
195
199
|
style: {
|
|
196
200
|
textAlign: textAlign === 'center' ? 'left' : textAlign
|
|
197
201
|
}
|
|
198
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
202
|
+
}, /*#__PURE__*/_react.default.createElement(_textContent.default, {
|
|
199
203
|
labelRef: labelRef,
|
|
200
|
-
label: label,
|
|
201
204
|
required: required,
|
|
205
|
+
label: label,
|
|
202
206
|
onHoverLabel: onHoverLabel,
|
|
203
|
-
|
|
207
|
+
className: customClassForLabel,
|
|
204
208
|
labelUppercase: labelUppercase,
|
|
205
|
-
tooltip:
|
|
209
|
+
tooltip: label.toString(),
|
|
206
210
|
tooltipPosition: "top"
|
|
207
|
-
})
|
|
211
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
212
|
+
className: "text-content",
|
|
213
|
+
style: {
|
|
214
|
+
display: 'flex'
|
|
215
|
+
}
|
|
216
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
217
|
+
className: "label ".concat(customClassForLabel, " ").concat(labelUppercase && ' -uppercase'),
|
|
218
|
+
style: {
|
|
219
|
+
alignSelf: 'center'
|
|
220
|
+
}
|
|
221
|
+
}, label, required && /*#__PURE__*/_react.default.createElement("span", {
|
|
222
|
+
className: "-requiredlabel"
|
|
223
|
+
}, "*"), !!hint && hintPosition === 'onLabelRight' && !skeletonize && /*#__PURE__*/_react.default.createElement(_popover.default, {
|
|
224
|
+
theme: themePopover,
|
|
225
|
+
align: popoverAlign,
|
|
226
|
+
customClass: "-hint",
|
|
227
|
+
iconColor: "#03bde2",
|
|
228
|
+
style: {
|
|
229
|
+
margin: '0px 5px',
|
|
230
|
+
height: 'auto',
|
|
231
|
+
width: 20
|
|
232
|
+
}
|
|
233
|
+
}, hint))), /*#__PURE__*/_react.default.createElement(_textContent.default, null)), /*#__PURE__*/_react.default.createElement("div", {
|
|
208
234
|
"data-testid": "testInputWrapper",
|
|
209
235
|
style: styleForWrapper,
|
|
210
236
|
className: helpers.getInputWrapperClass(_objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -226,7 +252,7 @@ const InputTextBase = props => {
|
|
|
226
252
|
"data-testid": "teste-123"
|
|
227
253
|
}, inputProps())), children), helpers.getRightElements(errorMessages || [], skeletonize, rightElements)), /*#__PURE__*/_react.default.createElement(_hint.default, {
|
|
228
254
|
disabled: disabled,
|
|
229
|
-
visible: !!hint,
|
|
255
|
+
visible: !!hint && hintPosition === 'below',
|
|
230
256
|
customClass: "hint",
|
|
231
257
|
description: hint
|
|
232
258
|
}), /*#__PURE__*/_react.default.createElement(_errorMessage.ErrorMessage, {
|
|
@@ -73,6 +73,7 @@ interface IBaseProps {
|
|
|
73
73
|
inputRef?: MutableRefObject<HTMLInputElement | HTMLTextAreaElement | null> | ((ref: HTMLInputElement | HTMLTextAreaElement | null) => void);
|
|
74
74
|
inputBaseRef?: RefObject<HTMLDivElement> | ((ref: HTMLDivElement) => void);
|
|
75
75
|
hint?: string | string[];
|
|
76
|
+
hintPosition?: 'below' | 'onLabelRight';
|
|
76
77
|
textAlign?: TextAlign;
|
|
77
78
|
rounded?: boolean;
|
|
78
79
|
errorMessages?: string[] | undefined;
|
|
@@ -92,6 +93,8 @@ interface IBaseProps {
|
|
|
92
93
|
multiple?: boolean;
|
|
93
94
|
readOnlyClass?: string;
|
|
94
95
|
autoComplete?: 'on' | 'off';
|
|
96
|
+
themePopover?: 'light' | 'dark';
|
|
97
|
+
popoverAlign?: 'right' | 'left';
|
|
95
98
|
}
|
|
96
99
|
|
|
97
100
|
export { CustomInputEvent, IBaseProps, InputLabelProps };
|
|
@@ -9,6 +9,11 @@ interface IColorProps {
|
|
|
9
9
|
name?: string;
|
|
10
10
|
permissionAttr?: PermissionAttr;
|
|
11
11
|
visible?: boolean;
|
|
12
|
+
label?: string;
|
|
13
|
+
hint?: string | string[];
|
|
14
|
+
hintPosition?: 'below' | 'onLabelRight';
|
|
15
|
+
themePopover?: 'light' | 'dark';
|
|
16
|
+
popoverAlign?: 'right' | 'left';
|
|
12
17
|
}
|
|
13
18
|
|
|
14
19
|
export { IColorProps };
|
|
@@ -37,6 +37,10 @@ interface IDatePickerProps {
|
|
|
37
37
|
disabled?: boolean;
|
|
38
38
|
permissionAttr?: PermissionAttr;
|
|
39
39
|
label?: string;
|
|
40
|
+
hint?: string | string[];
|
|
41
|
+
hintPosition?: 'below' | 'onLabelRight';
|
|
42
|
+
themePopover?: 'light' | 'dark';
|
|
43
|
+
popoverAlign?: 'right' | 'left';
|
|
40
44
|
}
|
|
41
45
|
interface IDateDropdownProps {
|
|
42
46
|
children: ReactNode | ReactNode[];
|
|
@@ -35,6 +35,7 @@ const DragDropFile = props => {
|
|
|
35
35
|
showSubtitle = true,
|
|
36
36
|
multiple = false,
|
|
37
37
|
hint = [],
|
|
38
|
+
hintPosition = 'below',
|
|
38
39
|
errorMessages = [],
|
|
39
40
|
skeletonize = false
|
|
40
41
|
} = props;
|
|
@@ -265,7 +266,7 @@ const DragDropFile = props => {
|
|
|
265
266
|
})), /*#__PURE__*/_react.default.createElement(_errorMessage.ErrorMessage, {
|
|
266
267
|
messages: errorMessages
|
|
267
268
|
}), /*#__PURE__*/_react.default.createElement(_hint.default, {
|
|
268
|
-
visible: !!hint,
|
|
269
|
+
visible: !!hint && hintPosition === 'below',
|
|
269
270
|
customClass: "hint",
|
|
270
271
|
description: hint
|
|
271
272
|
}));
|
|
@@ -18,6 +18,7 @@ interface IFileProps {
|
|
|
18
18
|
label?: string;
|
|
19
19
|
defaultFiles?: CustomFile;
|
|
20
20
|
hint?: string;
|
|
21
|
+
hintPosition?: 'below' | 'onLabelRight';
|
|
21
22
|
required?: boolean;
|
|
22
23
|
readOnly?: boolean;
|
|
23
24
|
name?: string;
|
|
@@ -34,6 +35,8 @@ interface IFileProps {
|
|
|
34
35
|
errorMessages?: string[];
|
|
35
36
|
skeletonize?: boolean;
|
|
36
37
|
showSubtitle?: boolean;
|
|
38
|
+
themePopover?: 'light' | 'dark';
|
|
39
|
+
popoverAlign?: 'right' | 'left';
|
|
37
40
|
}
|
|
38
41
|
interface IDefaultFileProps extends IFileProps {
|
|
39
42
|
onBtnClickInsert: () => void;
|
|
@@ -40,6 +40,10 @@ declare const getMaskOptions: ({ isDateField, placeholderChar, min, max, lazy, p
|
|
|
40
40
|
autoCompleteMask?: "left" | "right" | undefined;
|
|
41
41
|
definitions?: any;
|
|
42
42
|
mask?: any;
|
|
43
|
+
hint?: string | string[] | undefined;
|
|
44
|
+
hintPosition?: "below" | "onLabelRight" | undefined;
|
|
45
|
+
themePopover?: "light" | "dark" | undefined;
|
|
46
|
+
popoverAlign?: "left" | "right" | undefined;
|
|
43
47
|
placeholderChar: string;
|
|
44
48
|
min: any;
|
|
45
49
|
max: any;
|
|
@@ -50,6 +50,10 @@ type IBaseMaskProps = {
|
|
|
50
50
|
mask?: any;
|
|
51
51
|
min?: any;
|
|
52
52
|
max?: any;
|
|
53
|
+
hint?: string | string[];
|
|
54
|
+
hintPosition?: 'below' | 'onLabelRight';
|
|
55
|
+
themePopover?: 'light' | 'dark';
|
|
56
|
+
popoverAlign?: 'right' | 'left';
|
|
53
57
|
pattern?: string;
|
|
54
58
|
mapToRadix?: string[];
|
|
55
59
|
normalizeZeros?: boolean;
|
|
@@ -56,6 +56,10 @@ interface IMultiSelectProps {
|
|
|
56
56
|
disabled?: boolean;
|
|
57
57
|
dropdownAlignButton?: 'left' | 'right';
|
|
58
58
|
label?: string;
|
|
59
|
+
hint?: string | string[];
|
|
60
|
+
hintPosition?: 'below' | 'onLabelRight';
|
|
61
|
+
themePopover?: 'light' | 'dark';
|
|
62
|
+
popoverAlign?: 'right' | 'left';
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
export { DescriptionKey, GetFilteredParams, IActionButtonsProps, IDropdownMultiSelectProps, IMultiSelectProps };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IBaseNumberProps } from './types.js';
|
|
2
|
+
import '../../@types/PermissionAttr.js';
|
|
2
3
|
import '../base/types.js';
|
|
3
4
|
import 'react';
|
|
4
5
|
import '../../@types/Align.js';
|
|
5
6
|
import '../../@types/Period.js';
|
|
6
|
-
import '../../@types/PermissionAttr.js';
|
|
7
7
|
import '../../internals/types.js';
|
|
8
8
|
import '../../@types/Position.js';
|
|
9
9
|
import '../types.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ICurrencyProps } from './types.js';
|
|
2
|
+
import '../../@types/PermissionAttr.js';
|
|
2
3
|
import '../base/types.js';
|
|
3
4
|
import 'react';
|
|
4
5
|
import '../../@types/Align.js';
|
|
5
6
|
import '../../@types/Period.js';
|
|
6
|
-
import '../../@types/PermissionAttr.js';
|
|
7
7
|
import '../../internals/types.js';
|
|
8
8
|
import '../../@types/Position.js';
|
|
9
9
|
import '../types.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IBaseNumberProps } from './types.js';
|
|
2
|
+
import '../../@types/PermissionAttr.js';
|
|
2
3
|
import '../base/types.js';
|
|
3
4
|
import 'react';
|
|
4
5
|
import '../../@types/Align.js';
|
|
5
6
|
import '../../@types/Period.js';
|
|
6
|
-
import '../../@types/PermissionAttr.js';
|
|
7
7
|
import '../../internals/types.js';
|
|
8
8
|
import '../../@types/Position.js';
|
|
9
9
|
import '../types.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { default as CurrencyField } from './Currency.js';
|
|
2
2
|
export { default as DecimalField } from './Decimal.js';
|
|
3
3
|
import { INumberFieldProps } from './types.js';
|
|
4
|
+
import '../../@types/PermissionAttr.js';
|
|
4
5
|
import '../base/types.js';
|
|
5
6
|
import 'react';
|
|
6
7
|
import '../../@types/Align.js';
|
|
7
8
|
import '../../@types/Period.js';
|
|
8
|
-
import '../../@types/PermissionAttr.js';
|
|
9
9
|
import '../../internals/types.js';
|
|
10
10
|
import '../../@types/Position.js';
|
|
11
11
|
import '../types.js';
|
|
@@ -28,10 +28,12 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
28
28
|
const NumberField = props => {
|
|
29
29
|
const {
|
|
30
30
|
textAlign = 'left',
|
|
31
|
-
min,
|
|
32
|
-
max,
|
|
33
31
|
value = '',
|
|
34
|
-
|
|
32
|
+
themePopover = 'light',
|
|
33
|
+
popoverAlign = 'left',
|
|
34
|
+
removeZeroLeft = true,
|
|
35
|
+
min,
|
|
36
|
+
max
|
|
35
37
|
} = props;
|
|
36
38
|
const [numberValue, setNumberValue] = (0, _react.useState)();
|
|
37
39
|
const onChange = event => {
|
|
@@ -53,6 +55,8 @@ const NumberField = props => {
|
|
|
53
55
|
return /*#__PURE__*/_react.default.createElement(_InputTextBase.default, _extends({}, props, {
|
|
54
56
|
value: numberValue,
|
|
55
57
|
textAlign: textAlign,
|
|
58
|
+
themePopover: themePopover,
|
|
59
|
+
popoverAlign: popoverAlign,
|
|
56
60
|
onChange: onChange,
|
|
57
61
|
type: "number"
|
|
58
62
|
}));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { PermissionAttr } from '../../@types/PermissionAttr.js';
|
|
1
2
|
import { CustomInputEvent } from '../base/types.js';
|
|
2
3
|
import { IMaskHOCProps } from '../types.js';
|
|
4
|
+
import { TextAlign } from '../../@types/Align.js';
|
|
3
5
|
import 'react';
|
|
4
|
-
import '../../@types/Align.js';
|
|
5
6
|
import '../../@types/Period.js';
|
|
6
|
-
import '../../@types/PermissionAttr.js';
|
|
7
7
|
import '../../internals/types.js';
|
|
8
8
|
import '../../@types/Position.js';
|
|
9
9
|
import '../../@types/DataCombo.js';
|
|
@@ -12,8 +12,16 @@ import '../../@types/Icon.js';
|
|
|
12
12
|
import '../../icons/helper.js';
|
|
13
13
|
|
|
14
14
|
interface INumberFieldProps extends IMaskHOCProps {
|
|
15
|
+
value?: string;
|
|
16
|
+
permissionAttr?: PermissionAttr;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
hint?: string | string[];
|
|
19
|
+
hintPosition?: 'below' | 'onLabelRight';
|
|
20
|
+
themePopover?: 'light' | 'dark';
|
|
21
|
+
popoverAlign?: 'right' | 'left';
|
|
15
22
|
onChange?: (e?: CustomInputEvent) => void;
|
|
16
23
|
removeZeroLeft?: boolean;
|
|
24
|
+
textAlign?: TextAlign;
|
|
17
25
|
}
|
|
18
26
|
interface IBaseNumberProps extends IMaskHOCProps {
|
|
19
27
|
returnFormattedValueOnBlur?: boolean;
|
|
@@ -22,6 +30,10 @@ interface IBaseNumberProps extends IMaskHOCProps {
|
|
|
22
30
|
interface ICurrencyProps extends IMaskHOCProps {
|
|
23
31
|
currencySymbol?: string;
|
|
24
32
|
displayCurrencySymbol?: boolean;
|
|
33
|
+
hint?: string | string[];
|
|
34
|
+
hintPosition?: 'below' | 'onLabelRight';
|
|
35
|
+
themePopover?: 'light' | 'dark';
|
|
36
|
+
popoverAlign?: 'right' | 'left';
|
|
25
37
|
}
|
|
26
38
|
|
|
27
39
|
export { IBaseNumberProps, ICurrencyProps, INumberFieldProps };
|
|
@@ -17,6 +17,8 @@ var _hint = _interopRequireDefault(require("../../hint"));
|
|
|
17
17
|
var helperBase = _interopRequireWildcard(require("../base/helpers"));
|
|
18
18
|
require("../../assets/styles/periodpicker.scss");
|
|
19
19
|
var _errorMessage = require("../errorMessage");
|
|
20
|
+
var _textContent = _interopRequireDefault(require("../../textContent"));
|
|
21
|
+
var _popover = _interopRequireDefault(require("../../popover"));
|
|
20
22
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
23
|
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); }
|
|
22
24
|
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; }
|
|
@@ -36,7 +38,10 @@ const PeriodPicker = props => {
|
|
|
36
38
|
width: '350px',
|
|
37
39
|
height: '350px'
|
|
38
40
|
},
|
|
39
|
-
hint
|
|
41
|
+
hint,
|
|
42
|
+
hintPosition = 'below',
|
|
43
|
+
themePopover = 'light',
|
|
44
|
+
popoverAlign = 'left'
|
|
40
45
|
} = props;
|
|
41
46
|
const [valueInitial, setValueInitial] = (0, _react.useState)(props.value && (0, _moment.default)(props.value.initial, 'DD/MM/YYYY'));
|
|
42
47
|
const [valueFinal, setValueFinal] = (0, _react.useState)(props.value && (0, _moment.default)(props.value.final, 'DD/MM/YYYY'));
|
|
@@ -343,11 +348,33 @@ const PeriodPicker = props => {
|
|
|
343
348
|
className: "input-base-component"
|
|
344
349
|
}, props.label && /*#__PURE__*/_react.default.createElement("div", {
|
|
345
350
|
className: "labelcontainer"
|
|
346
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
347
|
-
|
|
351
|
+
}, /*#__PURE__*/_react.default.createElement(_textContent.default, {
|
|
352
|
+
required: props.required,
|
|
353
|
+
className: props.customClassForLabel,
|
|
354
|
+
labelUppercase: props.labelUppercase
|
|
355
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
356
|
+
className: "text-content",
|
|
357
|
+
style: {
|
|
358
|
+
display: 'flex'
|
|
359
|
+
}
|
|
360
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
361
|
+
className: "label ".concat(props.customClassForLabel, " ").concat(props.labelUppercase && ' -uppercase'),
|
|
362
|
+
style: {
|
|
363
|
+
alignSelf: 'center'
|
|
364
|
+
}
|
|
348
365
|
}, props.label, props.required && /*#__PURE__*/_react.default.createElement("span", {
|
|
349
366
|
className: "-requiredlabel"
|
|
350
|
-
}, "*")
|
|
367
|
+
}, "*"), !!hint && hintPosition === 'onLabelRight' && /*#__PURE__*/_react.default.createElement(_popover.default, {
|
|
368
|
+
theme: themePopover,
|
|
369
|
+
align: popoverAlign,
|
|
370
|
+
iconColor: "#03bde2",
|
|
371
|
+
customClass: "-hint",
|
|
372
|
+
style: {
|
|
373
|
+
margin: '0px 5px',
|
|
374
|
+
height: 'auto',
|
|
375
|
+
width: 20
|
|
376
|
+
}
|
|
377
|
+
}, hint))), /*#__PURE__*/_react.default.createElement(_textContent.default, null)), /*#__PURE__*/_react.default.createElement("div", {
|
|
351
378
|
className: "periodpicker-component ".concat(helperBase.getInputWrapperClass(_objectSpread(_objectSpread({}, props), {}, {
|
|
352
379
|
value: !valueInitial ? '' : (0, _moment.default)(valueInitial).format('DD/MM/YYYY'),
|
|
353
380
|
disabled: shouldDisable()
|
|
@@ -391,7 +418,7 @@ const PeriodPicker = props => {
|
|
|
391
418
|
handlerSetOnDenied: denied => setOnDenied(denied),
|
|
392
419
|
required: props.required
|
|
393
420
|
}), getButtonOpen(), getButtonSelectPeriod()), showCalendarValueInitial && getWrapperComponentCalendarValueInitial(), showCalendarValueFinal && getWrapperComponentCalendarValueFinal(), showPeriodSelection && getWrapperComponentPeriodSelection(), /*#__PURE__*/_react.default.createElement(_hint.default, {
|
|
394
|
-
visible: !!hint,
|
|
421
|
+
visible: !!hint && hintPosition === 'below',
|
|
395
422
|
customClass: "hint",
|
|
396
423
|
description: hint
|
|
397
424
|
}), /*#__PURE__*/_react.default.createElement(_errorMessage.ErrorMessage, {
|
|
@@ -59,8 +59,11 @@ interface IPeriodPickerProps {
|
|
|
59
59
|
errorMessages?: string[];
|
|
60
60
|
name?: string;
|
|
61
61
|
hint?: string;
|
|
62
|
+
hintPosition?: 'below' | 'onLabelRight';
|
|
62
63
|
onBlur?: (e: CustomInputEvent) => void;
|
|
63
64
|
onFocus?: (e: CustomInputEvent) => void;
|
|
65
|
+
themePopover?: 'light' | 'dark';
|
|
66
|
+
popoverAlign?: 'right' | 'left';
|
|
64
67
|
}
|
|
65
68
|
interface IPeriodListProps {
|
|
66
69
|
handleOnSelect: (value: DateTypes | 'custom', date: Moment[] | null) => void;
|
|
@@ -13,6 +13,7 @@ var _Selecteds = _interopRequireDefault(require("./Selecteds"));
|
|
|
13
13
|
var constants = _interopRequireWildcard(require("../../../internals/constants"));
|
|
14
14
|
var _InputTextBase = _interopRequireDefault(require("../../base/InputTextBase"));
|
|
15
15
|
var _helper = require("../helper");
|
|
16
|
+
var _hint = _interopRequireDefault(require("../../../hint"));
|
|
16
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
18
|
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); }
|
|
18
19
|
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; }
|
|
@@ -25,7 +26,9 @@ const MultipleSelect = props => {
|
|
|
25
26
|
value = [],
|
|
26
27
|
remoteSearch = false,
|
|
27
28
|
descriptionKey,
|
|
28
|
-
showClearButton
|
|
29
|
+
showClearButton,
|
|
30
|
+
hint,
|
|
31
|
+
hintPosition = 'below'
|
|
29
32
|
} = props;
|
|
30
33
|
const [dataCombo, setDataCombo] = (0, _react.useState)(dataSource);
|
|
31
34
|
const [currents, setCurrents] = (0, _react.useState)([]);
|
|
@@ -267,6 +270,10 @@ const MultipleSelect = props => {
|
|
|
267
270
|
dataCombo: dataCombo,
|
|
268
271
|
currents: currents,
|
|
269
272
|
dropdownWidth: dropdownWidth || 0
|
|
270
|
-
}))
|
|
273
|
+
})), /*#__PURE__*/_react.default.createElement(_hint.default, {
|
|
274
|
+
visible: !!hint && hintPosition === 'below',
|
|
275
|
+
customClass: "hint",
|
|
276
|
+
description: hint
|
|
277
|
+
}));
|
|
271
278
|
};
|
|
272
279
|
var _default = exports.default = MultipleSelect;
|
|
@@ -50,6 +50,9 @@ interface ISimpleSelectProps {
|
|
|
50
50
|
onFocus?: () => void;
|
|
51
51
|
allOptions?: AllOptions;
|
|
52
52
|
inputRef?: MutableRefObject<HTMLInputElement | HTMLTextAreaElement | null> | ((ref: HTMLInputElement | HTMLTextAreaElement | null) => void);
|
|
53
|
+
hintPosition?: 'below' | 'onLabelRight';
|
|
54
|
+
themePopover?: 'light' | 'dark';
|
|
55
|
+
popoverAlign?: 'right' | 'left';
|
|
53
56
|
}
|
|
54
57
|
interface ISelectFieldProps extends Omit<ISimpleSelectProps, 'idKey' | 'value' | 'descriptionKey'> {
|
|
55
58
|
multiple?: boolean;
|
|
@@ -90,6 +93,9 @@ interface IMultipleSelectProps extends Omit<ISimpleSelectProps, 'idKey' | 'value
|
|
|
90
93
|
handlerClear?: () => void;
|
|
91
94
|
disabled?: boolean;
|
|
92
95
|
gridLayout?: string;
|
|
96
|
+
hintPosition?: 'below' | 'onLabelRight';
|
|
97
|
+
themePopover?: 'light' | 'dark';
|
|
98
|
+
popoverAlign?: 'right' | 'left';
|
|
93
99
|
}
|
|
94
100
|
interface ISelectedsMultipleProps {
|
|
95
101
|
idKey: string;
|