linear-react-components-ui 1.1.25-beta.7 → 1.1.25-beta.8
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/{BaseMask-0c14ef51.d.ts → BaseMask-78847f45.d.ts} +1 -1
- package/lib/{Cnpj-53bfd6ab.d.ts → Cnpj-8366781f.d.ts} +1 -2
- package/lib/{Cpf-019b21e0.d.ts → Cpf-3dfd54eb.d.ts} +1 -2
- package/lib/{Phone-2bb0b397.d.ts → Phone-1962c0f2.d.ts} +1 -1
- package/lib/{ZipCode-09460e18.d.ts → ZipCode-be9c5b3b.d.ts} +1 -1
- package/lib/assets/styles/split.scss +1 -1
- package/lib/form2/useForm/index.js +21 -8
- package/lib/{index-3b70931d.d.ts → index-02a27c19.d.ts} +2 -20
- package/lib/index-053f615b.d.ts +26 -0
- package/lib/{index-7dfa8924.d.ts → index-25b80f32.d.ts} +1 -1
- package/lib/{index-9e576346.d.ts → index-6f5c772d.d.ts} +1 -1
- package/lib/{index-208e7f62.d.ts → index-6fcf446c.d.ts} +2 -20
- package/lib/index-7159df18.d.ts +21 -0
- package/lib/inputs2/checkboxfield/base.d.ts +29 -0
- package/lib/inputs2/checkboxfield/base.js +134 -0
- package/lib/inputs2/checkboxfield/index.d.ts +3 -2
- package/lib/inputs2/checkboxfield/index.js +32 -125
- package/lib/inputs2/colorfield/index.d.ts +6 -5
- package/lib/inputs2/date/datefield/base.d.ts +13 -0
- package/lib/inputs2/date/datefield/base.js +330 -0
- package/lib/inputs2/date/datefield/index.js +34 -322
- package/lib/inputs2/date/datefield/types.d.ts +5 -3
- package/lib/inputs2/date/dateperiodfield/base.d.ts +13 -0
- package/lib/inputs2/date/dateperiodfield/base.js +595 -0
- package/lib/inputs2/date/dateperiodfield/index.js +34 -587
- package/lib/inputs2/date/dateperiodfield/types.d.ts +5 -3
- package/lib/inputs2/filefield/index.d.ts +6 -5
- package/lib/inputs2/index.d.ts +17 -14
- package/lib/inputs2/mask/BaseMask.d.ts +6 -5
- package/lib/inputs2/mask/Cnpj.d.ts +7 -6
- package/lib/inputs2/mask/Cnpj.js +18 -21
- package/lib/inputs2/mask/Cpf.d.ts +7 -6
- package/lib/inputs2/mask/Cpf.js +12 -19
- package/lib/inputs2/mask/Phone.d.ts +7 -6
- package/lib/inputs2/mask/ZipCode.d.ts +7 -6
- package/lib/inputs2/numberfield/currency.d.ts +5 -4
- package/lib/inputs2/numberfield/decimal.d.ts +5 -4
- package/lib/inputs2/numberfield/index.d.ts +5 -4
- package/lib/inputs2/numberfield/types.d.ts +5 -4
- package/lib/inputs2/radiofield/base.d.ts +12 -0
- package/lib/inputs2/radiofield/base.js +156 -0
- package/lib/inputs2/radiofield/index.js +25 -126
- package/lib/inputs2/radiofield/types.d.ts +6 -4
- package/lib/inputs2/selectfield/base.d.ts +11 -0
- package/lib/inputs2/selectfield/base.js +513 -0
- package/lib/inputs2/selectfield/index.d.ts +1 -1
- package/lib/inputs2/selectfield/index.js +35 -502
- package/lib/inputs2/selectfield/types.d.ts +8 -6
- package/lib/inputs2/textareafield/base.d.ts +26 -0
- package/lib/inputs2/textareafield/base.js +166 -0
- package/lib/inputs2/textareafield/index.d.ts +4 -3
- package/lib/inputs2/textareafield/index.js +30 -154
- package/lib/inputs2/textfield/base.d.ts +26 -0
- package/lib/inputs2/textfield/base.js +131 -0
- package/lib/inputs2/textfield/index.d.ts +5 -4
- package/lib/inputs2/textfield/index.js +30 -120
- package/package.json +1 -1
- package/lib/index-19761a50.d.ts +0 -26
- package/lib/index-4bda404f.d.ts +0 -42
|
@@ -6,15 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.Input = void 0;
|
|
7
7
|
require("../../assets/styles/radiofield.scss");
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _lodash = _interopRequireDefault(require("lodash"));
|
|
10
|
-
var _uuid = require("uuid");
|
|
11
|
-
var _hint = _interopRequireDefault(require("../../hint"));
|
|
12
|
-
var _popover = _interopRequireDefault(require("../../popover"));
|
|
13
9
|
var _gridlayout = _interopRequireDefault(require("../../gridlayout"));
|
|
14
|
-
var Tooltip = _interopRequireWildcard(require("../../tooltip"));
|
|
15
10
|
var _permissionValidations = require("../../permissionValidations");
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
var _base = require("./base");
|
|
12
|
+
const _excluded = ["onDeniedActions", "permissionAttr", "disabled", "readOnly", "gridLayout"];
|
|
18
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
14
|
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); }
|
|
20
15
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -25,30 +20,15 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
25
20
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
26
21
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
27
22
|
const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible, _permissionValidations.OPTIONS_ON_DENIED.readOnly, _permissionValidations.OPTIONS_ON_DENIED.hideContent];
|
|
28
|
-
const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
size = 'medium',
|
|
38
|
-
onDeniedActions = undefined,
|
|
39
|
-
permissionAttr = undefined,
|
|
40
|
-
labelUppercase = false,
|
|
41
|
-
customClassLabel = '',
|
|
42
|
-
customClassInputContainer = '',
|
|
43
|
-
customClass = '',
|
|
44
|
-
customClassWrapper = '',
|
|
45
|
-
textAlign = 'left',
|
|
46
|
-
skeletonize = false,
|
|
47
|
-
hintPosition = 'below',
|
|
48
|
-
themePopover = 'light',
|
|
49
|
-
popoverAlign = 'left'
|
|
50
|
-
} = props,
|
|
51
|
-
rest = _objectWithoutProperties(props, _excluded);
|
|
23
|
+
const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
24
|
+
let {
|
|
25
|
+
onDeniedActions,
|
|
26
|
+
permissionAttr,
|
|
27
|
+
disabled,
|
|
28
|
+
readOnly,
|
|
29
|
+
gridLayout
|
|
30
|
+
} = _ref,
|
|
31
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
52
32
|
const onDenied = _react.default.useMemo(() => {
|
|
53
33
|
return onDeniedActions || (0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr);
|
|
54
34
|
}, [onDeniedActions, permissionAttr]);
|
|
@@ -56,101 +36,20 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
56
36
|
hideContent,
|
|
57
37
|
unvisible
|
|
58
38
|
} = onDenied;
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
const isReadOnly = Boolean(props.readOnly || onDenied.readOnly);
|
|
63
|
-
const isDisabled = Boolean(props.disabled || onDenied.disabled);
|
|
64
|
-
const hasHintMessages = Boolean(hint === null || hint === void 0 ? void 0 : hint.length);
|
|
65
|
-
const hasValidationErrors = Boolean(errors === null || errors === void 0 ? void 0 : errors.length);
|
|
66
|
-
const isChecked = (props === null || props === void 0 ? void 0 : props.checked) || _lodash.default.isEqual(props === null || props === void 0 ? void 0 : props.value, props === null || props === void 0 ? void 0 : props.fieldId);
|
|
67
|
-
const handleOnChange = event => {
|
|
68
|
-
var _rest$onChange;
|
|
69
|
-
if (isReadOnly) {
|
|
70
|
-
event.preventDefault();
|
|
71
|
-
event.stopPropagation();
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
const syntheticEvent = _objectSpread(_objectSpread({}, event), {}, {
|
|
75
|
-
target: _objectSpread(_objectSpread({}, event.target), {}, {
|
|
76
|
-
value: props === null || props === void 0 ? void 0 : props.fieldId
|
|
77
|
-
})
|
|
78
|
-
});
|
|
79
|
-
(_rest$onChange = rest.onChange) === null || _rest$onChange === void 0 ? void 0 : _rest$onChange.call(rest, syntheticEvent);
|
|
80
|
-
};
|
|
81
|
-
const handleOnClick = event => {
|
|
82
|
-
var _rest$onClick;
|
|
83
|
-
if (isReadOnly) {
|
|
84
|
-
event.preventDefault();
|
|
85
|
-
event.stopPropagation();
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
(_rest$onClick = rest.onClick) === null || _rest$onClick === void 0 ? void 0 : _rest$onClick.call(rest, event);
|
|
89
|
-
};
|
|
90
|
-
if (unvisible || hideContent) return null;
|
|
91
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_gridlayout.default, {
|
|
92
|
-
cols: gridLayout
|
|
93
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
94
|
-
"data-testid": "test-radio-field-root",
|
|
95
|
-
"data-state-error": hasValidationErrors,
|
|
96
|
-
className: "radio-field-root ".concat(customClassWrapper)
|
|
97
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
98
|
-
ref: inputContainerRef,
|
|
99
|
-
"data-state-skeletonize": skeletonize,
|
|
100
|
-
className: "container ".concat(customClassInputContainer)
|
|
101
|
-
}, /*#__PURE__*/_react.default.createElement("input", _extends({
|
|
102
|
-
"data-testid": "test-radio-field-input"
|
|
103
|
-
}, _lodash.default.omit(rest, ['fieldId']), {
|
|
104
|
-
ref: ref,
|
|
105
|
-
id: inputId,
|
|
106
|
-
type: "radio",
|
|
107
|
-
checked: isChecked,
|
|
39
|
+
const isReadOnly = Boolean(readOnly || onDenied.readOnly);
|
|
40
|
+
const isDisabled = Boolean(disabled || onDenied.disabled);
|
|
41
|
+
const inputProps = _objectSpread({
|
|
108
42
|
readOnly: isReadOnly,
|
|
109
|
-
disabled: isDisabled
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
})), hasLabel && /*#__PURE__*/_react.default.createElement("span", {
|
|
121
|
-
className: "root-label ".concat(customClassLabel),
|
|
122
|
-
"data-state-skeletonize": skeletonize
|
|
123
|
-
}, /*#__PURE__*/_react.default.createElement("label", {
|
|
124
|
-
className: "label",
|
|
125
|
-
title: label,
|
|
126
|
-
htmlFor: inputId,
|
|
127
|
-
"data-state-disabled": isDisabled,
|
|
128
|
-
"data-state-read-only": isReadOnly,
|
|
129
|
-
"data-state-input-required": props.required,
|
|
130
|
-
"data-state-label-uppercase": labelUppercase
|
|
131
|
-
}, label), hasHintMessages && hintPosition === 'onLabelRight' && !skeletonize && /*#__PURE__*/_react.default.createElement(_popover.default, {
|
|
132
|
-
customClass: "label-popover",
|
|
133
|
-
theme: themePopover,
|
|
134
|
-
align: popoverAlign,
|
|
135
|
-
iconColor: "#03bde2"
|
|
136
|
-
}, hint))), hintPosition === 'below' && /*#__PURE__*/_react.default.createElement(_hint.default, {
|
|
137
|
-
customClass: "hint",
|
|
138
|
-
description: hint,
|
|
139
|
-
disabled: isDisabled,
|
|
140
|
-
skeletonize: skeletonize,
|
|
141
|
-
visible: hasHintMessages
|
|
142
|
-
}), hasValidationErrors && /*#__PURE__*/_react.default.createElement("span", {
|
|
143
|
-
"data-testid": "test-radio-field-list-errors",
|
|
144
|
-
className: "error",
|
|
145
|
-
"data-state-skeletonize": skeletonize,
|
|
146
|
-
"aria-describedby": String(props.name).concat('-errors')
|
|
147
|
-
}, errors === null || errors === void 0 ? void 0 : errors.map((error, index) => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
148
|
-
key: "".concat(index + 1, "-").concat(error)
|
|
149
|
-
}, error, "\xA0"))))), /*#__PURE__*/_react.default.createElement(Tooltip.Tooltip, {
|
|
150
|
-
targetRef: inputContainerRef,
|
|
151
|
-
text: tooltip,
|
|
152
|
-
width: tooltipWidth,
|
|
153
|
-
position: tooltipPosition
|
|
154
|
-
}));
|
|
43
|
+
disabled: isDisabled
|
|
44
|
+
}, props);
|
|
45
|
+
if (unvisible || hideContent) return null;
|
|
46
|
+
if (gridLayout) {
|
|
47
|
+
return /*#__PURE__*/_react.default.createElement(_gridlayout.default, null, /*#__PURE__*/_react.default.createElement(_base.InputBase, _extends({
|
|
48
|
+
ref: ref
|
|
49
|
+
}, inputProps)));
|
|
50
|
+
}
|
|
51
|
+
return /*#__PURE__*/_react.default.createElement(_base.InputBase, _extends({
|
|
52
|
+
ref: ref
|
|
53
|
+
}, inputProps));
|
|
155
54
|
});
|
|
156
55
|
Input.displayName = 'RadioFieldInput';
|
|
@@ -8,7 +8,7 @@ import { PermissionAttr, OnDenied } from '../../@types/PermissionAttr.js';
|
|
|
8
8
|
|
|
9
9
|
type RadioValue = string | number | boolean | null;
|
|
10
10
|
type InputHTMLProps = Omit<React__default.ComponentPropsWithRef<'input'>, 'multiple' | 'type' | 'size'>;
|
|
11
|
-
interface
|
|
11
|
+
interface RadioFieldInputBaseProps extends InputHTMLProps, ITooltipCommonProps {
|
|
12
12
|
hint?: string;
|
|
13
13
|
label?: string;
|
|
14
14
|
errors?: string[];
|
|
@@ -18,7 +18,6 @@ interface RadioFieldInputProps extends InputHTMLProps, ITooltipCommonProps {
|
|
|
18
18
|
labelUppercase?: boolean;
|
|
19
19
|
customClassLabel?: string;
|
|
20
20
|
customClassWrapper?: string;
|
|
21
|
-
gridLayout?: string;
|
|
22
21
|
customClassInputContainer?: string;
|
|
23
22
|
getFieldValue?: (name: string) => any;
|
|
24
23
|
size?: Extract<Size, 'small' | 'medium' | 'large'>;
|
|
@@ -26,9 +25,12 @@ interface RadioFieldInputProps extends InputHTMLProps, ITooltipCommonProps {
|
|
|
26
25
|
hintPosition?: HintPosition;
|
|
27
26
|
themePopover?: ColorTheme;
|
|
28
27
|
popoverAlign?: Extract<Position, 'left' | 'right'>;
|
|
28
|
+
fieldId?: string;
|
|
29
|
+
}
|
|
30
|
+
interface RadioFieldInputProps extends RadioFieldInputBaseProps {
|
|
31
|
+
gridLayout?: string;
|
|
29
32
|
permissionAttr?: PermissionAttr;
|
|
30
33
|
onDeniedActions?: OnDenied;
|
|
31
|
-
fieldId?: string;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
|
-
export { RadioFieldInputProps, RadioValue };
|
|
36
|
+
export { RadioFieldInputBaseProps, RadioFieldInputProps, RadioValue };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { SelectFieldInputBaseProps } from './types.js';
|
|
3
|
+
import '../../@types/Align.js';
|
|
4
|
+
import '../../@types/ColorStyles.js';
|
|
5
|
+
import '../../tooltip/types.js';
|
|
6
|
+
import '../../@types/Position.js';
|
|
7
|
+
import '../../@types/PermissionAttr.js';
|
|
8
|
+
|
|
9
|
+
declare const InputBase: React__default.ForwardRefExoticComponent<SelectFieldInputBaseProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
10
|
+
|
|
11
|
+
export { InputBase };
|