linear-react-components-ui 1.1.0-beta.6 → 1.1.0
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/babel.config.json +2 -2
- package/lib/alerts/AlertContainer.js +46 -54
- package/lib/alerts/AlertProvider.js +36 -53
- package/lib/alerts/BaseAlert.js +14 -20
- package/lib/alerts/Message.js +37 -46
- package/lib/alerts/helpers.js +3 -3
- package/lib/alerts/index.js +5 -5
- package/lib/alerts/withAlert.js +11 -11
- package/lib/assets/styles/checkbox.scss +0 -8
- package/lib/avatar/index.js +42 -41
- package/lib/badge/index.js +15 -16
- package/lib/buttons/ActivateButton.js +6 -8
- package/lib/buttons/AddButton.js +9 -11
- package/lib/buttons/Button.js +11 -11
- package/lib/buttons/ButtonGroups.js +8 -6
- package/lib/buttons/CancelButton.js +9 -7
- package/lib/buttons/DangerButton.js +9 -7
- package/lib/buttons/DefaultButton.js +66 -85
- package/lib/buttons/DestroyButton.js +10 -8
- package/lib/buttons/EditButton.js +6 -8
- package/lib/buttons/InactivateButton.js +6 -8
- package/lib/buttons/InfoButton.js +9 -7
- package/lib/buttons/PrimaryButton.js +9 -7
- package/lib/buttons/RestoreButton.js +6 -8
- package/lib/buttons/SaveButton.js +9 -7
- package/lib/buttons/SuccessButton.js +9 -7
- package/lib/buttons/WarningButton.js +9 -7
- package/lib/buttons/button_container/index.js +16 -19
- package/lib/buttons/index.js +31 -31
- package/lib/buttons/split_button/index.js +24 -26
- package/lib/calendar/DangerCalendar.js +9 -7
- package/lib/calendar/InfoCalendar.js +9 -7
- package/lib/calendar/PrimaryCalendar.js +9 -7
- package/lib/calendar/SuccessCalendar.js +9 -7
- package/lib/calendar/WarningCalendar.js +9 -7
- package/lib/calendar/base/Day.js +16 -14
- package/lib/calendar/base/Month.js +15 -19
- package/lib/calendar/base/Week.js +15 -19
- package/lib/calendar/base/helpers.js +17 -15
- package/lib/calendar/base/index.js +38 -51
- package/lib/calendar/index.js +13 -13
- package/lib/checkbox/Label.js +10 -8
- package/lib/checkbox/index.d.ts +1 -1
- package/lib/checkbox/index.js +75 -97
- package/lib/checkbox/types.d.ts +0 -1
- package/lib/dialog/Alert.js +7 -7
- package/lib/dialog/Custom.js +20 -23
- package/lib/dialog/Error.js +7 -7
- package/lib/dialog/Information.js +7 -7
- package/lib/dialog/Question.js +16 -16
- package/lib/dialog/Warning.js +7 -7
- package/lib/dialog/base/Content.js +9 -7
- package/lib/dialog/base/Footer.js +6 -8
- package/lib/dialog/base/Header.js +32 -34
- package/lib/dialog/base/index.js +64 -72
- package/lib/dialog/base/style.js +8 -10
- package/lib/dialog/form/index.js +35 -38
- package/lib/dialog/index.js +15 -15
- package/lib/drawer/Content.js +14 -12
- package/lib/drawer/Drawer.js +68 -82
- package/lib/drawer/Header.js +45 -48
- package/lib/drawer/helpers.js +4 -4
- package/lib/drawer/index.js +7 -7
- package/lib/dropdown/Popup.js +37 -40
- package/lib/dropdown/helper.js +6 -6
- package/lib/dropdown/withDropdown.js +44 -63
- package/lib/fieldset/index.js +49 -56
- package/lib/form/Field.js +73 -79
- package/lib/form/FieldArray.js +76 -85
- package/lib/form/FieldNumber.js +34 -42
- package/lib/form/FieldPeriod.js +54 -59
- package/lib/form/helpers.js +29 -28
- package/lib/form/index.js +121 -151
- package/lib/form/withFieldHOC.js +36 -42
- package/lib/form/withFormSecurity.js +27 -35
- package/lib/gridlayout/GridCol.js +16 -15
- package/lib/gridlayout/GridRow.js +11 -12
- package/lib/gridlayout/index.js +5 -5
- package/lib/hint/index.js +25 -29
- package/lib/icons/helper.js +2 -2
- package/lib/icons/index.js +37 -48
- package/lib/index.js +19 -19
- package/lib/inputs/base/InputTextBase.js +99 -109
- package/lib/inputs/base/helpers.js +29 -23
- package/lib/inputs/color/index.js +34 -44
- package/lib/inputs/date/Dialog.js +10 -8
- package/lib/inputs/date/Dropdown.js +14 -12
- package/lib/inputs/date/helpers.js +18 -14
- package/lib/inputs/date/index.js +96 -133
- package/lib/inputs/file/DefaultFile.js +50 -74
- package/lib/inputs/file/DragDropFile.js +119 -172
- package/lib/inputs/file/File.js +22 -28
- package/lib/inputs/file/FileButtonSettings.js +14 -16
- package/lib/inputs/file/helpers.js +6 -7
- package/lib/inputs/file/index.js +7 -7
- package/lib/inputs/inputHOC.js +23 -35
- package/lib/inputs/mask/BaseMask.js +33 -27
- package/lib/inputs/mask/Cnpj.js +19 -31
- package/lib/inputs/mask/Cpf.js +20 -35
- package/lib/inputs/mask/Phone.js +8 -6
- package/lib/inputs/mask/ZipCode.js +6 -8
- package/lib/inputs/mask/helpers.js +21 -26
- package/lib/inputs/mask/imaskHOC.js +102 -122
- package/lib/inputs/mask/index.js +11 -11
- package/lib/inputs/multiSelect/ActionButtons.js +18 -18
- package/lib/inputs/multiSelect/Dropdown.js +63 -75
- package/lib/inputs/multiSelect/helper.js +9 -7
- package/lib/inputs/multiSelect/index.js +85 -136
- package/lib/inputs/number/BaseNumber.js +23 -21
- package/lib/inputs/number/Currency.js +9 -8
- package/lib/inputs/number/Decimal.js +4 -6
- package/lib/inputs/number/format_number.js +9 -6
- package/lib/inputs/number/index.js +13 -13
- package/lib/inputs/period/Dialog.js +10 -8
- package/lib/inputs/period/Dropdown.js +12 -12
- package/lib/inputs/period/PeriodList.js +19 -17
- package/lib/inputs/period/helper.js +38 -37
- package/lib/inputs/period/index.js +147 -196
- package/lib/inputs/search/index.js +45 -67
- package/lib/inputs/select/ActionButtons.js +18 -18
- package/lib/inputs/select/Dropdown.js +51 -65
- package/lib/inputs/select/helper.js +55 -44
- package/lib/inputs/select/index.js +13 -11
- package/lib/inputs/select/multiple/Selecteds.js +20 -22
- package/lib/inputs/select/multiple/index.js +90 -143
- package/lib/inputs/select/simple/index.js +103 -156
- package/lib/inputs/text/index.js +4 -6
- package/lib/inputs/textarea/index.js +11 -10
- package/lib/internals/colorStyles.js +3 -3
- package/lib/internals/constants.js +2 -2
- package/lib/internals/withTooltip.js +54 -68
- package/lib/labelMessages/index.js +28 -47
- package/lib/labels/DangerLabel.js +9 -7
- package/lib/labels/DefaultLabel.js +29 -42
- package/lib/labels/InfoLabel.js +9 -7
- package/lib/labels/PrimaryLabel.js +9 -7
- package/lib/labels/SuccessLabel.js +9 -7
- package/lib/labels/WarningLabel.js +9 -7
- package/lib/labels/index.js +15 -15
- package/lib/labels/label_container/index.js +11 -10
- package/lib/list/Header.js +12 -10
- package/lib/list/Item.js +58 -72
- package/lib/list/Separator.js +6 -8
- package/lib/list/helpers.js +3 -3
- package/lib/list/index.js +81 -107
- package/lib/menus/float/MenuItem.js +27 -27
- package/lib/menus/float/SubMenuContainer.js +39 -44
- package/lib/menus/float/helpers.js +4 -4
- package/lib/menus/float/index.js +25 -25
- package/lib/menus/index.js +3 -3
- package/lib/menus/sidenav/ExpandMenu.js +12 -10
- package/lib/menus/sidenav/MenuLink.js +12 -10
- package/lib/menus/sidenav/NavMenuGroup.js +15 -13
- package/lib/menus/sidenav/NavMenuItem.js +56 -69
- package/lib/menus/sidenav/NavSubMenuItem.js +24 -28
- package/lib/menus/sidenav/helpers.js +7 -7
- package/lib/menus/sidenav/index.js +92 -119
- package/lib/menus/sidenav/popup_menu_search/EmptyList.js +12 -11
- package/lib/menus/sidenav/popup_menu_search/index.js +64 -84
- package/lib/noPermission/index.js +15 -17
- package/lib/panel/Content.js +46 -58
- package/lib/panel/DangerPanel.js +6 -8
- package/lib/panel/Default.js +45 -59
- package/lib/panel/Header.js +37 -34
- package/lib/panel/InfoPanel.js +6 -8
- package/lib/panel/PrimaryPanel.js +6 -8
- package/lib/panel/SuccessPanel.js +6 -8
- package/lib/panel/ToolBar.js +8 -6
- package/lib/panel/WarningPanel.js +6 -8
- package/lib/panel/helpers.js +13 -11
- package/lib/panel/index.js +17 -17
- package/lib/permissionValidations.js +26 -28
- package/lib/popover/PopoverText.js +8 -6
- package/lib/popover/PopoverTitle.js +8 -6
- package/lib/popover/index.js +21 -24
- package/lib/progress/Bar.js +34 -39
- package/lib/progress/index.js +19 -20
- package/lib/radio/index.js +37 -57
- package/lib/shortcuts/index.js +13 -11
- package/lib/skeleton/SkeletonContainer.js +12 -12
- package/lib/skeleton/index.js +27 -33
- package/lib/spinner/SpinnerLoading.js +46 -46
- package/lib/spinner/index.js +27 -40
- package/lib/split/Split.js +97 -113
- package/lib/split/SplitSide.js +22 -20
- package/lib/split/helpers.js +4 -4
- package/lib/split/index.js +5 -5
- package/lib/table/Body.js +47 -49
- package/lib/table/Header.js +39 -41
- package/lib/table/HeaderColumn.js +22 -22
- package/lib/table/Row.js +48 -50
- package/lib/table/RowColumn.js +37 -35
- package/lib/table/helpers.js +9 -12
- package/lib/table/index.js +89 -108
- package/lib/tabs/DropdownTabs.js +39 -43
- package/lib/tabs/Menu.js +20 -19
- package/lib/tabs/MenuTabs.js +48 -55
- package/lib/tabs/Panel.js +54 -73
- package/lib/tabs/context.js +62 -93
- package/lib/tabs/index.js +30 -35
- package/lib/tabs/tabHelpers.js +24 -21
- package/lib/toolbar/ButtonBar.js +49 -52
- package/lib/toolbar/LabelBar.js +38 -41
- package/lib/toolbar/Separator.js +6 -8
- package/lib/toolbar/ToolBarGroup.js +9 -8
- package/lib/toolbar/helpers.js +3 -3
- package/lib/toolbar/index.js +25 -26
- package/lib/tooltip/index.js +29 -33
- package/lib/treetable/Body.js +22 -33
- package/lib/treetable/Header.js +13 -15
- package/lib/treetable/Row.d.ts +1 -1
- package/lib/treetable/Row.js +107 -158
- package/lib/treetable/helpers.d.ts +1 -1
- package/lib/treetable/helpers.js +18 -24
- package/lib/treetable/index.d.ts +2 -2
- package/lib/treetable/index.js +11 -12
- package/lib/treeview/Header.js +11 -9
- package/lib/treeview/Node.js +109 -148
- package/lib/treeview/constants.js +2 -2
- package/lib/treeview/index.js +156 -221
- package/lib/uitour/helpers.js +3 -3
- package/lib/uitour/index.js +67 -106
- package/package.json +5 -14
- /package/lib/{types.d-BfM3lUbt.d.ts → types.d-DvJcBS8L.d.ts} +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
9
9
|
var _inputHOC = _interopRequireDefault(require("../inputHOC"));
|
|
@@ -12,105 +12,95 @@ var helpers = _interopRequireWildcard(require("./helpers"));
|
|
|
12
12
|
var _withTooltip = _interopRequireDefault(require("../../internals/withTooltip"));
|
|
13
13
|
var _permissionValidations = require("../../permissionValidations");
|
|
14
14
|
var _hint = _interopRequireDefault(require("../../hint"));
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
16
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
17
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
18
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
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); }
|
|
17
|
+
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; }
|
|
19
18
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
20
19
|
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; }
|
|
21
20
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22
21
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" ==
|
|
24
|
-
function _toPrimitive(t, r) { if ("object" !=
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
textAlign =
|
|
28
|
-
value
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
var hideContent = onDenied.hideContent,
|
|
79
|
-
unvisible = onDenied.unvisible;
|
|
80
|
-
(0, _react.useEffect)(function () {
|
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
23
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
24
|
+
const InputTextBase = props => {
|
|
25
|
+
const {
|
|
26
|
+
textAlign = 'left',
|
|
27
|
+
value,
|
|
28
|
+
type = 'text',
|
|
29
|
+
readOnly = false,
|
|
30
|
+
placeHolder,
|
|
31
|
+
required,
|
|
32
|
+
leftElements,
|
|
33
|
+
rightElements,
|
|
34
|
+
children,
|
|
35
|
+
customClass,
|
|
36
|
+
customClassForInputContent,
|
|
37
|
+
customClassForLabel,
|
|
38
|
+
customClassForSideButtons,
|
|
39
|
+
inputRef,
|
|
40
|
+
inputBaseRef,
|
|
41
|
+
label,
|
|
42
|
+
labelUppercase,
|
|
43
|
+
hint,
|
|
44
|
+
errorMessages,
|
|
45
|
+
visible = true,
|
|
46
|
+
permissionAttr,
|
|
47
|
+
onDeniedActions,
|
|
48
|
+
handlerSetOnDenied,
|
|
49
|
+
targetRef,
|
|
50
|
+
skeletonize = false,
|
|
51
|
+
style,
|
|
52
|
+
styleForInputContent,
|
|
53
|
+
styleForWrapper,
|
|
54
|
+
styleForLabel,
|
|
55
|
+
styleForSideButtons,
|
|
56
|
+
disabled = false,
|
|
57
|
+
autoFocus,
|
|
58
|
+
maxLength,
|
|
59
|
+
name,
|
|
60
|
+
id,
|
|
61
|
+
multiple = false,
|
|
62
|
+
accept,
|
|
63
|
+
onChange,
|
|
64
|
+
onDragOver,
|
|
65
|
+
onDrop,
|
|
66
|
+
onDragLeave,
|
|
67
|
+
readOnlyClass
|
|
68
|
+
} = props;
|
|
69
|
+
let propsInput;
|
|
70
|
+
const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible, _permissionValidations.OPTIONS_ON_DENIED.readOnly, _permissionValidations.OPTIONS_ON_DENIED.hideContent];
|
|
71
|
+
const onDenied = onDeniedActions || (0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr);
|
|
72
|
+
const {
|
|
73
|
+
hideContent,
|
|
74
|
+
unvisible
|
|
75
|
+
} = onDenied;
|
|
76
|
+
(0, _react.useEffect)(() => {
|
|
81
77
|
if (handlerSetOnDenied) handlerSetOnDenied(onDenied);
|
|
82
78
|
}, []);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
};
|
|
89
|
-
var shouldBeReadOnly = function shouldBeReadOnly() {
|
|
90
|
-
return readOnly || onDenied.readOnly;
|
|
91
|
-
};
|
|
92
|
-
var inputProps = function inputProps() {
|
|
93
|
-
var disableCallbacks = shouldBeReadOnly() || shouldDisable() || hideContent;
|
|
79
|
+
const applyTabIndex = () => readOnly ? -1 : 0;
|
|
80
|
+
const shouldDisable = () => disabled || onDenied.disabled;
|
|
81
|
+
const shouldBeReadOnly = () => readOnly || onDenied.readOnly;
|
|
82
|
+
const inputProps = () => {
|
|
83
|
+
const disableCallbacks = shouldBeReadOnly() || shouldDisable() || hideContent;
|
|
94
84
|
propsInput = {
|
|
95
85
|
value: hideContent ? '' : value,
|
|
96
|
-
accept
|
|
97
|
-
type
|
|
86
|
+
accept,
|
|
87
|
+
type,
|
|
98
88
|
readOnly: shouldBeReadOnly(),
|
|
99
89
|
placeholder: placeHolder,
|
|
100
90
|
disabled: shouldDisable() || hideContent,
|
|
101
|
-
autoFocus
|
|
102
|
-
maxLength
|
|
103
|
-
name
|
|
104
|
-
id
|
|
105
|
-
multiple
|
|
91
|
+
autoFocus,
|
|
92
|
+
maxLength,
|
|
93
|
+
name,
|
|
94
|
+
id,
|
|
95
|
+
multiple,
|
|
106
96
|
className: helpers.getInputClass({
|
|
107
|
-
textAlign
|
|
108
|
-
readOnly
|
|
109
|
-
readOnlyClass
|
|
97
|
+
textAlign,
|
|
98
|
+
readOnly,
|
|
99
|
+
readOnlyClass
|
|
110
100
|
}),
|
|
111
|
-
ref:
|
|
101
|
+
ref: r => {
|
|
112
102
|
if (inputRef) {
|
|
113
|
-
if (!_lodash
|
|
103
|
+
if (!_lodash.default.isFunction(inputRef)) {
|
|
114
104
|
inputRef.current = r;
|
|
115
105
|
} else {
|
|
116
106
|
inputRef(r);
|
|
@@ -121,75 +111,75 @@ var InputTextBase = function InputTextBase(props) {
|
|
|
121
111
|
};
|
|
122
112
|
if (!disableCallbacks) {
|
|
123
113
|
propsInput = _objectSpread(_objectSpread({}, propsInput), {}, {
|
|
124
|
-
onFocus
|
|
114
|
+
onFocus(e) {
|
|
125
115
|
var _props$onInputReceive;
|
|
126
116
|
(_props$onInputReceive = props.onInputReceiveFocus) === null || _props$onInputReceive === void 0 ? void 0 : _props$onInputReceive.call(props);
|
|
127
117
|
if (props.onFocus) props.onFocus(e);
|
|
128
118
|
},
|
|
129
|
-
onBlur:
|
|
119
|
+
onBlur: e => {
|
|
130
120
|
var _props$onInputLostFoc;
|
|
131
121
|
(_props$onInputLostFoc = props.onInputLostFocus) === null || _props$onInputLostFoc === void 0 ? void 0 : _props$onInputLostFoc.call(props);
|
|
132
122
|
if (props.onBlur) props.onBlur(e);
|
|
133
123
|
},
|
|
134
|
-
onKeyDown:
|
|
124
|
+
onKeyDown: e => {
|
|
135
125
|
if (props.onKeyDown) props.onKeyDown(e);
|
|
136
126
|
},
|
|
137
|
-
onKeyPress:
|
|
127
|
+
onKeyPress: e => {
|
|
138
128
|
if (props.onKeyPress) props.onKeyPress(e);
|
|
139
129
|
},
|
|
140
|
-
onChange:
|
|
141
|
-
if (
|
|
130
|
+
onChange: e => {
|
|
131
|
+
if (onChange) onChange(e);
|
|
142
132
|
},
|
|
143
|
-
onDragOver:
|
|
144
|
-
if (
|
|
133
|
+
onDragOver: e => {
|
|
134
|
+
if (onDragOver) onDragOver(e);
|
|
145
135
|
},
|
|
146
|
-
onDrop:
|
|
147
|
-
if (
|
|
136
|
+
onDrop: e => {
|
|
137
|
+
if (onDrop) onDrop(e);
|
|
148
138
|
},
|
|
149
|
-
onDragLeave:
|
|
150
|
-
if (
|
|
139
|
+
onDragLeave: e => {
|
|
140
|
+
if (onDragLeave) onDragLeave(e);
|
|
151
141
|
}
|
|
152
142
|
});
|
|
153
143
|
}
|
|
154
144
|
return propsInput;
|
|
155
145
|
};
|
|
156
146
|
if (!visible || unvisible) return null;
|
|
157
|
-
return /*#__PURE__*/_react
|
|
147
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
158
148
|
style: style,
|
|
159
149
|
className: "input-base-component ".concat(skeletonize ? '-skeletonized' : '', " ").concat(customClass),
|
|
160
150
|
ref: inputBaseRef
|
|
161
|
-
}, label && /*#__PURE__*/_react
|
|
151
|
+
}, label && /*#__PURE__*/_react.default.createElement("div", {
|
|
162
152
|
className: "labelcontainer",
|
|
163
153
|
style: {
|
|
164
154
|
textAlign: textAlign === 'center' ? 'left' : textAlign
|
|
165
155
|
}
|
|
166
|
-
}, /*#__PURE__*/_react
|
|
156
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
167
157
|
style: styleForLabel,
|
|
168
158
|
className: "label ".concat(customClassForLabel, " ").concat(labelUppercase && ' -uppercase')
|
|
169
|
-
}, label, required && /*#__PURE__*/_react
|
|
159
|
+
}, label, required && /*#__PURE__*/_react.default.createElement("span", {
|
|
170
160
|
className: "-requiredlabel"
|
|
171
|
-
}, "*"))), /*#__PURE__*/_react
|
|
161
|
+
}, "*"))), /*#__PURE__*/_react.default.createElement("div", {
|
|
172
162
|
"data-testid": "testInputWrapper",
|
|
173
163
|
style: styleForWrapper,
|
|
174
164
|
className: helpers.getInputWrapperClass(_objectSpread(_objectSpread({}, props), {}, {
|
|
175
165
|
disabled: shouldDisable() || hideContent
|
|
176
166
|
}))
|
|
177
|
-
}, leftElements && /*#__PURE__*/_react
|
|
167
|
+
}, leftElements && /*#__PURE__*/_react.default.createElement("div", {
|
|
178
168
|
style: styleForSideButtons,
|
|
179
169
|
className: "sidebuttons ".concat(customClassForSideButtons)
|
|
180
|
-
}, leftElements), /*#__PURE__*/_react
|
|
170
|
+
}, leftElements), /*#__PURE__*/_react.default.createElement("div", {
|
|
181
171
|
"data-testid": "testInputContent",
|
|
182
172
|
style: styleForInputContent,
|
|
183
173
|
className: "inputcontent ".concat(customClassForInputContent)
|
|
184
|
-
}, type === 'textarea' ? /*#__PURE__*/_react
|
|
174
|
+
}, type === 'textarea' ? /*#__PURE__*/_react.default.createElement("textarea", _extends({
|
|
185
175
|
rows: props.rows,
|
|
186
176
|
cols: props.cols
|
|
187
|
-
}, inputProps())) : /*#__PURE__*/_react
|
|
177
|
+
}, inputProps())) : /*#__PURE__*/_react.default.createElement("input", _extends({
|
|
188
178
|
tabIndex: applyTabIndex()
|
|
189
|
-
}, inputProps())), children), helpers.getRightElements(errorMessages || [], skeletonize, rightElements)), /*#__PURE__*/_react
|
|
179
|
+
}, inputProps())), children), helpers.getRightElements(errorMessages || [], skeletonize, rightElements)), /*#__PURE__*/_react.default.createElement(_hint.default, {
|
|
190
180
|
visible: !!hint,
|
|
191
181
|
customClass: "hint",
|
|
192
182
|
description: hint
|
|
193
183
|
}), errorMessages && helpers.getErrorMessages(errorMessages));
|
|
194
184
|
};
|
|
195
|
-
var _default = exports
|
|
185
|
+
var _default = exports.default = (0, _inputHOC.default)((0, _withTooltip.default)(InputTextBase));
|
|
@@ -6,38 +6,44 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getRightElements = exports.getInputWrapperClass = exports.getInputClass = exports.getErrorMessages = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
const getInputClass = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
textAlign,
|
|
13
|
+
readOnly,
|
|
14
|
+
readOnlyClass
|
|
15
|
+
} = _ref;
|
|
14
16
|
return "textinput text-align-".concat(textAlign, " ").concat(readOnlyClass, " ").concat(readOnly ? ' -readonly' : '');
|
|
15
17
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
exports.getInputClass = getInputClass;
|
|
19
|
+
const getInputWrapperClass = props => {
|
|
20
|
+
const {
|
|
21
|
+
inputHasFocus,
|
|
22
|
+
customClassForWrapper,
|
|
23
|
+
rounded,
|
|
24
|
+
errorMessages,
|
|
25
|
+
disabled
|
|
26
|
+
} = props;
|
|
22
27
|
return "inputwrapper ".concat(inputHasFocus && ' -focusable', "\n ").concat(customClassForWrapper, "\n ").concat(errorMessages && errorMessages.length > 0 && ' -requirederror', "\n ").concat(rounded && ' -roundedborders', "\n ").concat(disabled && ' -disabled');
|
|
23
28
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return /*#__PURE__*/_react
|
|
29
|
+
exports.getInputWrapperClass = getInputWrapperClass;
|
|
30
|
+
const getErrorMessages = messages => {
|
|
31
|
+
if (!messages || messages.length === 0) return /*#__PURE__*/_react.default.createElement("noscript", null);
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement("p", {
|
|
27
33
|
className: "errormessages"
|
|
28
34
|
}, messages.join(', '));
|
|
29
35
|
};
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
exports.getErrorMessages = getErrorMessages;
|
|
37
|
+
const getRightElements = (errorMessages, skeletonize, rightElements) => {
|
|
38
|
+
let elements = rightElements || [];
|
|
32
39
|
if (skeletonize) return null;
|
|
33
|
-
if (!_lodash
|
|
40
|
+
if (!_lodash.default.isArray(elements)) {
|
|
34
41
|
elements = [elements];
|
|
35
42
|
}
|
|
36
|
-
elements = elements.map(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
});
|
|
40
|
-
});
|
|
43
|
+
elements = elements.map((element, index) => element && /*#__PURE__*/_react.default.cloneElement(element, {
|
|
44
|
+
key: "rightelement-".concat(index + 1)
|
|
45
|
+
}));
|
|
41
46
|
if (errorMessages) return elements;
|
|
42
47
|
return elements;
|
|
43
|
-
};
|
|
48
|
+
};
|
|
49
|
+
exports.getRightElements = getRightElements;
|
|
@@ -1,43 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
8
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
10
9
|
var _text = _interopRequireDefault(require("../text"));
|
|
11
10
|
var _buttons = _interopRequireDefault(require("../../buttons"));
|
|
12
11
|
require("../../assets/styles/colorpicker.scss");
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
14
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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); }
|
|
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; }
|
|
16
15
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
onChange = props.onChange,
|
|
29
|
-
onButtonClick = props.onButtonClick,
|
|
30
|
-
name = props.name;
|
|
31
|
-
var _useState = (0, _react.useState)(value),
|
|
32
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
-
color = _useState2[0],
|
|
34
|
-
setColor = _useState2[1];
|
|
35
|
-
var inputRef = (0, _react.useRef)(null);
|
|
36
|
-
var debouncedOnChange = _lodash["default"].debounce(function (func, e) {
|
|
16
|
+
const ColorPicker = props => {
|
|
17
|
+
const {
|
|
18
|
+
asTextField = true,
|
|
19
|
+
value = '#aaaaaa',
|
|
20
|
+
onChange,
|
|
21
|
+
onButtonClick,
|
|
22
|
+
name
|
|
23
|
+
} = props;
|
|
24
|
+
const [color, setColor] = (0, _react.useState)(value);
|
|
25
|
+
const inputRef = (0, _react.useRef)(null);
|
|
26
|
+
const debouncedOnChange = _lodash.default.debounce((func, e) => {
|
|
37
27
|
func(e);
|
|
38
28
|
}, 300);
|
|
39
|
-
|
|
40
|
-
|
|
29
|
+
const onInputChange = e => {
|
|
30
|
+
const {
|
|
31
|
+
target
|
|
32
|
+
} = e;
|
|
41
33
|
setColor(target.value);
|
|
42
34
|
if (onChange) {
|
|
43
35
|
// Nota: A aplicação desta regra é limitada a projetos usando React 16 ou
|
|
@@ -46,60 +38,58 @@ var ColorPicker = function ColorPicker(props) {
|
|
|
46
38
|
debouncedOnChange(onChange, e);
|
|
47
39
|
}
|
|
48
40
|
};
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
const onInputChangeDefault = e => {
|
|
42
|
+
const {
|
|
43
|
+
target
|
|
44
|
+
} = e;
|
|
51
45
|
setColor(target.value);
|
|
52
46
|
if (onChange) {
|
|
53
47
|
e.persist();
|
|
54
48
|
debouncedOnChange(onChange, e);
|
|
55
49
|
}
|
|
56
50
|
};
|
|
57
|
-
|
|
51
|
+
const onPaletteButtonClick = () => {
|
|
58
52
|
if (inputRef.current) inputRef.current.click();
|
|
59
53
|
};
|
|
60
|
-
(0, _react.useEffect)(
|
|
54
|
+
(0, _react.useEffect)(() => {
|
|
61
55
|
setColor(value);
|
|
62
56
|
}, [value]);
|
|
63
|
-
return asTextField ? /*#__PURE__*/_react
|
|
57
|
+
return asTextField ? /*#__PURE__*/_react.default.createElement(_text.default, _extends({}, props, {
|
|
64
58
|
value: color,
|
|
65
|
-
onChange:
|
|
59
|
+
onChange: e => {
|
|
66
60
|
if (e) onInputChange(e);
|
|
67
61
|
},
|
|
68
|
-
leftElements: [/*#__PURE__*/_react
|
|
62
|
+
leftElements: [/*#__PURE__*/_react.default.createElement("div", {
|
|
69
63
|
key: "colorMirror",
|
|
70
64
|
className: "colorpicker-colormirror",
|
|
71
65
|
style: {
|
|
72
66
|
background: color
|
|
73
67
|
}
|
|
74
|
-
}), /*#__PURE__*/_react
|
|
68
|
+
}), /*#__PURE__*/_react.default.createElement("input", {
|
|
75
69
|
key: "inputColor",
|
|
76
70
|
className: "colorpicker-hideinputcolor",
|
|
77
71
|
ref: inputRef,
|
|
78
72
|
type: "color",
|
|
79
73
|
defaultValue: color,
|
|
80
74
|
name: name,
|
|
81
|
-
onClick:
|
|
82
|
-
return onButtonClick ? onButtonClick(e) : undefined;
|
|
83
|
-
},
|
|
75
|
+
onClick: e => onButtonClick ? onButtonClick(e) : undefined,
|
|
84
76
|
onInput: onInputChangeDefault
|
|
85
77
|
})],
|
|
86
|
-
rightElements: /*#__PURE__*/_react
|
|
78
|
+
rightElements: /*#__PURE__*/_react.default.createElement(_buttons.default, {
|
|
87
79
|
className: "colorpicker-palettebutton",
|
|
88
80
|
key: "palettebutton",
|
|
89
81
|
onClick: onPaletteButtonClick,
|
|
90
82
|
iconName: "pallete",
|
|
91
83
|
boxShadow: false
|
|
92
84
|
})
|
|
93
|
-
})) : /*#__PURE__*/_react
|
|
85
|
+
})) : /*#__PURE__*/_react.default.createElement("input", {
|
|
94
86
|
key: "inputColor",
|
|
95
87
|
name: name,
|
|
96
88
|
ref: inputRef,
|
|
97
89
|
type: "color",
|
|
98
90
|
defaultValue: color,
|
|
99
|
-
onClick:
|
|
100
|
-
return onButtonClick ? onButtonClick(e) : undefined;
|
|
101
|
-
},
|
|
91
|
+
onClick: e => onButtonClick ? onButtonClick(e) : undefined,
|
|
102
92
|
onInput: onInputChangeDefault
|
|
103
93
|
});
|
|
104
94
|
};
|
|
105
|
-
var _default = exports
|
|
95
|
+
var _default = exports.default = ColorPicker;
|
|
@@ -3,15 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _base = _interopRequireDefault(require("../../dialog/base"));
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
const Dialog = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
handlerClose,
|
|
13
|
+
children,
|
|
14
|
+
dialogSize
|
|
15
|
+
} = _ref;
|
|
16
|
+
return /*#__PURE__*/_react.default.createElement(_base.default, {
|
|
15
17
|
width: dialogSize.width,
|
|
16
18
|
height: dialogSize.height,
|
|
17
19
|
onOpenChange: handlerClose,
|
|
@@ -20,4 +22,4 @@ var Dialog = function Dialog(_ref) {
|
|
|
20
22
|
wrapperClassName: ""
|
|
21
23
|
}, children);
|
|
22
24
|
};
|
|
23
|
-
var _default = exports
|
|
25
|
+
var _default = exports.default = Dialog;
|
|
@@ -3,28 +3,30 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
9
9
|
var _helpers = require("./helpers");
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
const body = document.getElementsByTagName('body')[0];
|
|
12
|
+
const Dropdown = props => {
|
|
13
|
+
const {
|
|
14
|
+
dropdownRef,
|
|
15
|
+
children
|
|
16
|
+
} = props;
|
|
17
|
+
const elementRef = (0, _react.useRef)(document.createElement('div'));
|
|
18
|
+
(0, _react.useEffect)(() => {
|
|
17
19
|
elementRef.current.className = 'datepicker-component';
|
|
18
20
|
elementRef.current.setAttribute('style', (0, _helpers.getCalendarDropdownStyle)(props));
|
|
19
21
|
body.appendChild(elementRef.current);
|
|
20
22
|
dropdownRef(elementRef.current);
|
|
21
|
-
return
|
|
23
|
+
return () => {
|
|
22
24
|
body.removeChild(elementRef.current);
|
|
23
25
|
};
|
|
24
26
|
}, []);
|
|
25
|
-
(0, _react.useEffect)(
|
|
27
|
+
(0, _react.useEffect)(() => {
|
|
26
28
|
elementRef.current.setAttribute('style', (0, _helpers.getCalendarDropdownStyle)(props));
|
|
27
29
|
}, [props]);
|
|
28
|
-
return /*#__PURE__*/_reactDom
|
|
30
|
+
return /*#__PURE__*/_reactDom.default.createPortal(children, elementRef.current);
|
|
29
31
|
};
|
|
30
|
-
var _default = exports
|
|
32
|
+
var _default = exports.default = Dropdown;
|
|
@@ -5,20 +5,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getMomentValue = exports.getCalendarDropdownStyle = exports.PT_BR_FORMAT = exports.EN_US_FORMAT = void 0;
|
|
7
7
|
var _moment = _interopRequireDefault(require("moment"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
const PT_BR_FORMAT = exports.PT_BR_FORMAT = 'DD/MM/YYYY';
|
|
10
|
+
const EN_US_FORMAT = exports.EN_US_FORMAT = 'YYYY-MM-DD';
|
|
11
|
+
const getCalendarDropdownStyle = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
topPosition,
|
|
14
|
+
leftPosition,
|
|
15
|
+
width,
|
|
16
|
+
minWidth
|
|
17
|
+
} = _ref;
|
|
16
18
|
return "top: ".concat(topPosition, "px;\n left: ").concat(leftPosition, "px;\n width: ").concat(width, "px;\n min-width: ").concat(minWidth, "px;");
|
|
17
19
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
exports.getCalendarDropdownStyle = getCalendarDropdownStyle;
|
|
21
|
+
const getMomentValue = value => {
|
|
22
|
+
let newValue = value;
|
|
23
|
+
if ((0, _moment.default)(newValue, PT_BR_FORMAT).isValid()) {
|
|
24
|
+
newValue = (0, _moment.default)(newValue, PT_BR_FORMAT).format(EN_US_FORMAT);
|
|
22
25
|
}
|
|
23
|
-
return typeof newValue === 'string' ? (0, _moment
|
|
24
|
-
};
|
|
26
|
+
return typeof newValue === 'string' ? (0, _moment.default)(newValue, EN_US_FORMAT) : newValue;
|
|
27
|
+
};
|
|
28
|
+
exports.getMomentValue = getMomentValue;
|