linear-react-components-ui 1.1.20-rc.1 → 1.1.20-rc.2
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/alerts/BaseAlert.js +1 -1
- package/lib/alerts/Message.js +1 -1
- package/lib/assets/styles/button.scss +1 -0
- package/lib/avatar/index.js +8 -9
- package/lib/badge/index.js +4 -4
- package/lib/buttons/DangerButton.js +1 -1
- package/lib/buttons/DefaultButton.js +10 -15
- package/lib/buttons/InfoButton.js +1 -1
- package/lib/buttons/PrimaryButton.js +1 -1
- package/lib/buttons/SuccessButton.js +1 -1
- package/lib/buttons/WarningButton.js +1 -1
- package/lib/buttons/button_container/index.js +1 -1
- package/lib/buttons/split_button/index.js +1 -1
- package/lib/buttons/types.d.ts +1 -0
- package/lib/calendar/base/Day.js +1 -1
- package/lib/calendar/base/Month.js +1 -1
- package/lib/calendar/base/helpers.js +2 -2
- package/lib/calendar/base/index.js +1 -1
- package/lib/checkbox/index.js +1 -1
- package/lib/dialog/Custom.js +1 -1
- package/lib/dialog/Question.js +4 -2
- package/lib/dialog/base/Content.js +1 -1
- package/lib/dialog/base/Header.js +2 -2
- package/lib/dialog/base/index.js +5 -4
- package/lib/dialog/form/index.js +1 -1
- package/lib/dialog/wizard/progressbar.js +1 -1
- package/lib/dialog/wizard/step.js +1 -1
- package/lib/drawer/Drawer.js +3 -3
- package/lib/drawer/Header.js +1 -1
- package/lib/dropdown/Popup.d.ts +1 -1
- package/lib/dropdown/Popup.js +43 -22
- package/lib/dropdown/helper.js +1 -1
- package/lib/dropdown/types.d.ts +6 -2
- package/lib/dropdown/withDropdown.js +7 -6
- package/lib/fieldset/index.js +7 -7
- package/lib/form/FieldArray.js +1 -1
- package/lib/form/FieldNumber.js +3 -3
- package/lib/form/FieldPeriod.js +2 -2
- package/lib/form/index.js +2 -2
- package/lib/gridlayout/GridCol.js +5 -5
- package/lib/gridlayout/GridRow.js +1 -4
- package/lib/hint/index.js +1 -7
- package/lib/icons/index.js +27 -24
- package/lib/inputs/base/InputTextBase.js +8 -6
- package/lib/inputs/base/Label.js +1 -1
- package/lib/inputs/base/helpers.js +3 -7
- package/lib/inputs/date/helpers.js +1 -4
- package/lib/inputs/date/index.js +15 -9
- package/lib/inputs/errorMessage/index.js +1 -1
- package/lib/inputs/file/DefaultFile.js +6 -5
- package/lib/inputs/file/DragDropFile.js +17 -15
- package/lib/inputs/file/File.js +4 -3
- package/lib/inputs/mask/BaseMask.js +2 -1
- package/lib/inputs/mask/helpers.d.ts +1 -1
- package/lib/inputs/multiSelect/Dropdown.js +10 -9
- package/lib/inputs/multiSelect/helper.js +2 -1
- package/lib/inputs/multiSelect/index.js +9 -7
- package/lib/inputs/number/BaseNumber.d.ts +1 -1
- package/lib/inputs/number/BaseNumber.js +9 -2
- package/lib/inputs/number/Currency.d.ts +1 -1
- package/lib/inputs/number/Currency.js +11 -4
- package/lib/inputs/number/index.js +2 -1
- package/lib/inputs/period/PeriodList.js +1 -1
- package/lib/inputs/period/helper.js +1 -3
- package/lib/inputs/period/index.js +14 -9
- package/lib/inputs/search/index.js +1 -1
- package/lib/inputs/select/Dropdown.js +1 -1
- package/lib/inputs/select/helper.js +13 -10
- package/lib/inputs/select/multiple/Selecteds.js +1 -1
- package/lib/inputs/select/multiple/index.js +14 -9
- package/lib/inputs/select/simple/index.js +17 -10
- package/lib/inputs/textarea/index.js +1 -1
- package/lib/internals/withTooltip.js +9 -9
- package/lib/labelMessages/index.js +3 -4
- package/lib/labels/DefaultLabel.js +1 -4
- package/lib/labels/label_container/index.js +1 -1
- package/lib/list/Header.js +1 -1
- package/lib/list/Item.js +9 -10
- package/lib/list/index.js +1 -2
- package/lib/menus/float/MenuItem.js +2 -2
- package/lib/menus/float/SubMenuContainer.js +1 -1
- package/lib/menus/float/index.js +1 -1
- package/lib/menus/sidenav/ExpandMenu.js +1 -1
- package/lib/menus/sidenav/NavMenuGroup.js +1 -1
- package/lib/menus/sidenav/NavMenuItem.js +9 -7
- package/lib/menus/sidenav/NavSubMenuItem.js +1 -1
- package/lib/menus/sidenav/helpers.js +1 -1
- package/lib/menus/sidenav/index.js +5 -5
- package/lib/panel/Content.js +7 -5
- package/lib/panel/Default.js +2 -2
- package/lib/panel/Header.js +3 -3
- package/lib/permissionValidations.js +1 -1
- package/lib/popover/PopoverText.d.ts +1 -0
- package/lib/popover/PopoverTitle.d.ts +1 -0
- package/lib/popover/index.d.ts +3 -5
- package/lib/popover/index.js +21 -15
- package/lib/popover/types.d.ts +11 -0
- package/lib/progress/Bar.js +6 -6
- package/lib/radio/index.js +2 -2
- package/lib/shortcuts/index.js +1 -1
- package/lib/skeleton/SkeletonContainer.js +1 -2
- package/lib/skeleton/index.js +1 -4
- package/lib/spinner/index.js +2 -2
- package/lib/split/Split.js +1 -1
- package/lib/split/SplitSide.js +3 -3
- package/lib/table/Body.js +3 -3
- package/lib/table/Header.js +11 -8
- package/lib/table/HeaderColumn.js +1 -1
- package/lib/table/Row.js +3 -3
- package/lib/table/RowColumn.js +1 -1
- package/lib/table/index.js +1 -6
- package/lib/tabs/DropdownTabs.js +1 -1
- package/lib/tabs/Menu.js +1 -1
- package/lib/tabs/MenuTabs.js +2 -2
- package/lib/tabs/Panel.js +7 -5
- package/lib/tabs/context.js +6 -3
- package/lib/textContent/index.js +1 -1
- package/lib/toolbar/ButtonBar.js +1 -1
- package/lib/toolbar/index.js +1 -1
- package/lib/tooltip/index.js +7 -7
- package/lib/treetable/Body.js +1 -1
- package/lib/treetable/Header.js +2 -2
- package/lib/treetable/Row.js +9 -9
- package/lib/treeview/Header.js +1 -1
- package/lib/treeview/Node.js +5 -5
- package/lib/treeview/index.js +4 -4
- package/lib/uitour/index.js +8 -6
- package/package.json +1 -1
package/lib/alerts/BaseAlert.js
CHANGED
|
@@ -26,7 +26,7 @@ const BaseAlert = _ref => {
|
|
|
26
26
|
alert.appendChild(messageContainerEl);
|
|
27
27
|
}
|
|
28
28
|
return () => {
|
|
29
|
-
alert
|
|
29
|
+
alert === null || alert === void 0 ? void 0 : alert.removeChild(messageContainerEl);
|
|
30
30
|
};
|
|
31
31
|
}, []);
|
|
32
32
|
return /*#__PURE__*/_reactDom.default.createPortal(children, messageContainerEl);
|
package/lib/alerts/Message.js
CHANGED
|
@@ -104,6 +104,7 @@ $shadow-button-inset-default: inset 0 0 0 1px $default-border-color, $shadow-but
|
|
|
104
104
|
opacity: 0.7;
|
|
105
105
|
border: solid 1px $font-color-disabled;
|
|
106
106
|
pointer-events: auto;
|
|
107
|
+
cursor: not-allowed;
|
|
107
108
|
}
|
|
108
109
|
&.-shadowsdisabled {
|
|
109
110
|
box-shadow: none!important;
|
package/lib/avatar/index.js
CHANGED
|
@@ -23,8 +23,7 @@ const getClass = _ref => {
|
|
|
23
23
|
disabled,
|
|
24
24
|
size = 'default'
|
|
25
25
|
} = _ref;
|
|
26
|
-
return
|
|
27
|
-
${square && '-square'} ${size && `-${size}`}`;
|
|
26
|
+
return "avatar-component ".concat(className).concat(disabled && '-disabled', " \n ").concat(square && '-square', " ").concat(size && "-".concat(size));
|
|
28
27
|
};
|
|
29
28
|
const getIcon = (iconName, icon) => {
|
|
30
29
|
if (icon) {
|
|
@@ -71,18 +70,18 @@ const Avatar = props => {
|
|
|
71
70
|
if (targetRef) targetRef(r);
|
|
72
71
|
dropdownRef.current = r;
|
|
73
72
|
},
|
|
74
|
-
className:
|
|
73
|
+
className: "".concat(getClass(props), " ").concat(customClass),
|
|
75
74
|
style: _objectSpread({
|
|
76
|
-
width:
|
|
77
|
-
height:
|
|
78
|
-
backgroundColor:
|
|
79
|
-
cursor:
|
|
75
|
+
width: "".concat(width),
|
|
76
|
+
height: "".concat(height),
|
|
77
|
+
backgroundColor: "".concat(color),
|
|
78
|
+
cursor: "".concat(dropdown ? 'pointer' : 'normal')
|
|
80
79
|
}, style)
|
|
81
80
|
}, (iconName || icon) && !src && getIcon(iconName, icon), src && /*#__PURE__*/_react.default.createElement("img", {
|
|
82
81
|
className: "imgavatar",
|
|
83
82
|
style: {
|
|
84
|
-
width:
|
|
85
|
-
height:
|
|
83
|
+
width: "".concat(width),
|
|
84
|
+
height: "".concat(height)
|
|
86
85
|
},
|
|
87
86
|
src: src,
|
|
88
87
|
alt: srcAlt
|
package/lib/badge/index.js
CHANGED
|
@@ -18,12 +18,12 @@ const Badge = props => {
|
|
|
18
18
|
right = '-11px'
|
|
19
19
|
} = props;
|
|
20
20
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
21
|
-
className:
|
|
21
|
+
className: "badge-component ".concat(customClass)
|
|
22
22
|
}, children, /*#__PURE__*/_react.default.createElement("span", {
|
|
23
|
-
className:
|
|
23
|
+
className: "badge -".concat(color, " ").concat(customClassForBadge),
|
|
24
24
|
style: {
|
|
25
|
-
top:
|
|
26
|
-
right:
|
|
25
|
+
top: "".concat(top),
|
|
26
|
+
right: "".concat(right)
|
|
27
27
|
}
|
|
28
28
|
}, content));
|
|
29
29
|
};
|
|
@@ -17,7 +17,7 @@ const DangerButton = _ref => {
|
|
|
17
17
|
} = _ref,
|
|
18
18
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
19
|
return /*#__PURE__*/_react.default.createElement(_Button.default, _extends({
|
|
20
|
-
customClass:
|
|
20
|
+
customClass: "-danger ".concat(customClass)
|
|
21
21
|
}, rest));
|
|
22
22
|
};
|
|
23
23
|
var _default = exports.default = DangerButton;
|
|
@@ -11,7 +11,7 @@ var _withTooltip = _interopRequireWildcard(require("../internals/withTooltip"));
|
|
|
11
11
|
var _spinner = _interopRequireDefault(require("../spinner"));
|
|
12
12
|
var _withDropdown = _interopRequireDefault(require("../dropdown/withDropdown"));
|
|
13
13
|
var _permissionValidations = require("../permissionValidations");
|
|
14
|
-
const _excluded = ["dropdown", "onClick", "disabled", "iconName", "icon", "targetRef", "tabIndex", "isLoading", "label", "showDropdown", "getDropdownPopup", "isDropdownOpened", "showIconDropdown", "content", "style", "toggleable", "activeIconColor", "iconStyle", "visible", "customClass", "className", "size", "iconAlign", "boxShadow", "transparent", "round", "permissionAttr", "skeletonize", "errorMessage", "
|
|
14
|
+
const _excluded = ["dropdown", "onClick", "disabled", "iconName", "icon", "targetRef", "tabIndex", "isLoading", "label", "showDropdown", "getDropdownPopup", "isDropdownOpened", "showIconDropdown", "content", "style", "toggleable", "activeIconColor", "iconStyle", "visible", "customClass", "className", "size", "iconAlign", "boxShadow", "transparent", "round", "permissionAttr", "skeletonize", "errorMessage", "isFloatMenu", "dropdownAlign", "customClassForDropdown", "buttonRef", "handlerClose", "onDeniedText", "tooltip", "tooltipWidth", "tooltipPosition"];
|
|
15
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
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
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; }
|
|
@@ -54,12 +54,15 @@ const DefaultButton = _ref => {
|
|
|
54
54
|
permissionAttr,
|
|
55
55
|
skeletonize,
|
|
56
56
|
errorMessage,
|
|
57
|
-
tooltipWidth,
|
|
58
57
|
isFloatMenu,
|
|
59
58
|
dropdownAlign,
|
|
60
59
|
customClassForDropdown,
|
|
61
60
|
buttonRef,
|
|
62
|
-
|
|
61
|
+
handlerClose,
|
|
62
|
+
onDeniedText = 'Permissão Negada! Consulte o Administrador do sistema.',
|
|
63
|
+
tooltip,
|
|
64
|
+
tooltipWidth,
|
|
65
|
+
tooltipPosition
|
|
63
66
|
} = _ref,
|
|
64
67
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
65
68
|
const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible];
|
|
@@ -72,16 +75,7 @@ const DefaultButton = _ref => {
|
|
|
72
75
|
const {
|
|
73
76
|
handlerSetOnDeniedText
|
|
74
77
|
} = (0, _react.useContext)(_withTooltip.TooltipContext);
|
|
75
|
-
const getClass = () =>
|
|
76
|
-
${customClass}
|
|
77
|
-
${transparent && '-transparent'}
|
|
78
|
-
${isDisabled && '-disabled'}
|
|
79
|
-
${size && `-${size}`}
|
|
80
|
-
${dropdown && !round && 'icon-right'}
|
|
81
|
-
${dropdown && round && 'icon-center'}
|
|
82
|
-
${iconAlign && !dropdown && `icon-${iconAlign}`}
|
|
83
|
-
${boxShadow ? '' : '-shadowsdisabled'}
|
|
84
|
-
${round && '-round'}`;
|
|
78
|
+
const getClass = () => "button-component ".concat(className, "\n ").concat(customClass, "\n ").concat(transparent && '-transparent', "\n ").concat(isDisabled && '-disabled', "\n ").concat(size && "-".concat(size), "\n ").concat(dropdown && !round && 'icon-right', "\n ").concat(dropdown && round && 'icon-center', "\n ").concat(iconAlign && !dropdown && "icon-".concat(iconAlign), "\n ").concat(boxShadow ? '' : '-shadowsdisabled', "\n ").concat(round && '-round');
|
|
85
79
|
const returnPadlockIcon = resultantStyle => /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
86
80
|
name: "padlock",
|
|
87
81
|
size: 16,
|
|
@@ -137,10 +131,11 @@ const DefaultButton = _ref => {
|
|
|
137
131
|
style: style,
|
|
138
132
|
onKeyDown: e => {
|
|
139
133
|
if (e && (e.key === 'Enter' || e.key === ' ')) {
|
|
134
|
+
var _refButton$current;
|
|
140
135
|
e.preventDefault();
|
|
141
136
|
e.stopPropagation();
|
|
142
137
|
if (isDisabled) return;
|
|
143
|
-
if (onClick) refButton
|
|
138
|
+
if (onClick) refButton === null || refButton === void 0 ? void 0 : (_refButton$current = refButton.current) === null || _refButton$current === void 0 ? void 0 : _refButton$current.click();
|
|
144
139
|
if (dropdown && showDropdown) showDropdown();
|
|
145
140
|
if (onClick && toggleable) setActiveButton(!activeButton);
|
|
146
141
|
}
|
|
@@ -153,7 +148,7 @@ const DefaultButton = _ref => {
|
|
|
153
148
|
if (dropdown && showDropdown) showDropdown();
|
|
154
149
|
if (onClick && toggleable) setActiveButton(!activeButton);
|
|
155
150
|
},
|
|
156
|
-
className:
|
|
151
|
+
className: "".concat(getClass(), " ").concat(activeButton ? '-toggleable' : '', " ").concat(skeletonize ? '-skeletonized' : ''),
|
|
157
152
|
ref: r => {
|
|
158
153
|
if (buttonRef) {
|
|
159
154
|
if (!_lodash.default.isFunction(buttonRef)) {
|
|
@@ -17,7 +17,7 @@ const InfoButton = _ref => {
|
|
|
17
17
|
} = _ref,
|
|
18
18
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
19
|
return /*#__PURE__*/_react.default.createElement(_Button.default, _extends({
|
|
20
|
-
customClass:
|
|
20
|
+
customClass: "-info ".concat(customClass)
|
|
21
21
|
}, rest));
|
|
22
22
|
};
|
|
23
23
|
var _default = exports.default = InfoButton;
|
|
@@ -17,7 +17,7 @@ const PrimaryButton = _ref => {
|
|
|
17
17
|
} = _ref,
|
|
18
18
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
19
|
return /*#__PURE__*/_react.default.createElement(_Button.default, _extends({
|
|
20
|
-
customClass:
|
|
20
|
+
customClass: "-primary ".concat(customClass)
|
|
21
21
|
}, rest));
|
|
22
22
|
};
|
|
23
23
|
var _default = exports.default = PrimaryButton;
|
|
@@ -17,7 +17,7 @@ const SuccessButton = _ref => {
|
|
|
17
17
|
} = _ref,
|
|
18
18
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
19
|
return /*#__PURE__*/_react.default.createElement(_Button.default, _extends({}, rest, {
|
|
20
|
-
customClass:
|
|
20
|
+
customClass: "-success ".concat(customClass)
|
|
21
21
|
}));
|
|
22
22
|
};
|
|
23
23
|
var _default = exports.default = SuccessButton;
|
|
@@ -17,7 +17,7 @@ const WarningButton = _ref => {
|
|
|
17
17
|
} = _ref,
|
|
18
18
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
19
|
return /*#__PURE__*/_react.default.createElement(_Button.default, _extends({}, rest, {
|
|
20
|
-
customClass:
|
|
20
|
+
customClass: "-warning ".concat(customClass)
|
|
21
21
|
}));
|
|
22
22
|
};
|
|
23
23
|
var _default = exports.default = WarningButton;
|
|
@@ -23,7 +23,7 @@ const ButtonContainer = _ref => {
|
|
|
23
23
|
} = _ref;
|
|
24
24
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
25
25
|
"data-testid": "button-container",
|
|
26
|
-
className:
|
|
26
|
+
className: "btn-container ".concat(customClass),
|
|
27
27
|
style: getStyles(style, position)
|
|
28
28
|
}, children);
|
|
29
29
|
};
|
|
@@ -37,7 +37,7 @@ const SplitButton = props => {
|
|
|
37
37
|
}
|
|
38
38
|
})), /*#__PURE__*/_react.default.createElement(_DefaultButton.default, _extends({}, splitProps, {
|
|
39
39
|
iconName: "down",
|
|
40
|
-
customClass:
|
|
40
|
+
customClass: "".concat(customClass, " -transparenttext"),
|
|
41
41
|
iconStyle: {
|
|
42
42
|
marginRight: -7,
|
|
43
43
|
marginLeft: 0
|
package/lib/buttons/types.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ interface IButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
41
41
|
customClassForDropdown?: string;
|
|
42
42
|
dropdownAlign?: 'left' | 'right';
|
|
43
43
|
onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
44
|
+
handlerClose?: (cb: () => void) => void;
|
|
44
45
|
closeDropdownOnClickOutside?: boolean;
|
|
45
46
|
errorMessage?: string;
|
|
46
47
|
onDeniedText?: string;
|
package/lib/calendar/base/Day.js
CHANGED
|
@@ -25,7 +25,7 @@ const Day = _ref => {
|
|
|
25
25
|
onClick: () => {
|
|
26
26
|
if (handleDateChange) handleDateChange(day);
|
|
27
27
|
},
|
|
28
|
-
customClass:
|
|
28
|
+
customClass: " ".concat((0, _helpers.getDayCssClass)(currentDate, day), " numberdaycalendar"),
|
|
29
29
|
label: day.format('D')
|
|
30
30
|
}));
|
|
31
31
|
};
|
|
@@ -21,7 +21,7 @@ const Month = _ref => {
|
|
|
21
21
|
const week = /*#__PURE__*/_react.default.createElement(_Week.default, {
|
|
22
22
|
currentDate: currentDate,
|
|
23
23
|
weekStartDate: startOfWeek,
|
|
24
|
-
key:
|
|
24
|
+
key: "week-".concat(startOfWeek.format('YYYYMMDD'))
|
|
25
25
|
});
|
|
26
26
|
weeks = [...weeks, week];
|
|
27
27
|
weekIndex += 1;
|
|
@@ -89,8 +89,8 @@ function getCalendarCssClass(_ref) {
|
|
|
89
89
|
customClass,
|
|
90
90
|
colorStyle
|
|
91
91
|
} = _ref;
|
|
92
|
-
let cssClass =
|
|
93
|
-
cssClass +=
|
|
92
|
+
let cssClass = "calendar-component ".concat(customClass);
|
|
93
|
+
cssClass += " -".concat(colorStyle);
|
|
94
94
|
cssClass += unpadding ? ' -unpadding' : '';
|
|
95
95
|
cssClass += drawGridLines ? ' -draw-grid-lines' : '';
|
|
96
96
|
return cssClass;
|
|
@@ -71,7 +71,7 @@ const Calendar = props => {
|
|
|
71
71
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
72
72
|
className: "daynames"
|
|
73
73
|
}, (0, _helpers.dayNames)().map(name => /*#__PURE__*/_react.default.createElement("div", {
|
|
74
|
-
key:
|
|
74
|
+
key: "day-".concat(name)
|
|
75
75
|
}, name))), /*#__PURE__*/_react.default.createElement(_Month.default, {
|
|
76
76
|
currentDate: dataAtual
|
|
77
77
|
})));
|
package/lib/checkbox/index.js
CHANGED
|
@@ -69,7 +69,7 @@ const CheckBox = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
69
69
|
onClick: () => {
|
|
70
70
|
if (!shouldDisable() && !skeletonize) {
|
|
71
71
|
setIsChecked(!isChecked);
|
|
72
|
-
onChange
|
|
72
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
73
73
|
target
|
|
74
74
|
});
|
|
75
75
|
}
|
package/lib/dialog/Custom.js
CHANGED
|
@@ -50,7 +50,7 @@ const Custom = props => {
|
|
|
50
50
|
}, props.text)), props.buttons && props.buttons.length > 0 && /*#__PURE__*/_react.default.createElement(_Footer.default, props, /*#__PURE__*/_react.default.createElement(_buttons.ButtonContainer, {
|
|
51
51
|
position: "right"
|
|
52
52
|
}, props.buttons.map(button => /*#__PURE__*/_react.default.cloneElement(button, {
|
|
53
|
-
key:
|
|
53
|
+
key: "button-".concat(uuid.v1())
|
|
54
54
|
})))));
|
|
55
55
|
};
|
|
56
56
|
var _default = exports.default = Custom;
|
package/lib/dialog/Question.js
CHANGED
|
@@ -39,12 +39,14 @@ const Question = props => {
|
|
|
39
39
|
(0, _react.useLayoutEffect)(() => {
|
|
40
40
|
const lastElementActive = document.activeElement;
|
|
41
41
|
return () => {
|
|
42
|
-
|
|
42
|
+
var _lastElementActive$fo;
|
|
43
|
+
lastElementActive === null || lastElementActive === void 0 ? void 0 : (_lastElementActive$fo = lastElementActive.focus) === null || _lastElementActive$fo === void 0 ? void 0 : _lastElementActive$fo.call(lastElementActive);
|
|
43
44
|
};
|
|
44
45
|
}, [visible]);
|
|
45
46
|
(0, _react.useEffect)(() => {
|
|
47
|
+
var _buttonUnconfirm$focu;
|
|
46
48
|
const buttonUnconfirm = document.getElementById(idUnconfirm);
|
|
47
|
-
buttonUnconfirm
|
|
49
|
+
buttonUnconfirm === null || buttonUnconfirm === void 0 ? void 0 : (_buttonUnconfirm$focu = buttonUnconfirm.focus) === null || _buttonUnconfirm$focu === void 0 ? void 0 : _buttonUnconfirm$focu.call(buttonUnconfirm);
|
|
48
50
|
}, [visible, document.activeElement]);
|
|
49
51
|
if (!visible) return null;
|
|
50
52
|
return /*#__PURE__*/_react.default.createElement(_Custom.default, _extends({}, props, {
|
|
@@ -15,7 +15,7 @@ const Content = _ref => {
|
|
|
15
15
|
} = _ref;
|
|
16
16
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
17
17
|
id: "modal-dialog-content",
|
|
18
|
-
className:
|
|
18
|
+
className: "dialog-content ".concat(className),
|
|
19
19
|
style: styleForContent
|
|
20
20
|
}, children);
|
|
21
21
|
};
|
|
@@ -46,10 +46,10 @@ const Header = _ref => {
|
|
|
46
46
|
tabIndex: -1,
|
|
47
47
|
onFocus: () => {},
|
|
48
48
|
onBlur: () => {},
|
|
49
|
-
ref: formDialogContext
|
|
49
|
+
ref: formDialogContext === null || formDialogContext === void 0 ? void 0 : formDialogContext.headerRef,
|
|
50
50
|
className: "dialog-header"
|
|
51
51
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
52
|
-
className:
|
|
52
|
+
className: "".concat(icon !== null || titleIcon !== null ? 'left' : '')
|
|
53
53
|
}, getIcon(titleIcon, icon)), /*#__PURE__*/_react.default.createElement("div", {
|
|
54
54
|
className: "right"
|
|
55
55
|
}, /*#__PURE__*/_react.default.createElement("h5", {
|
package/lib/dialog/base/index.js
CHANGED
|
@@ -58,7 +58,7 @@ const BaseDialog = props => {
|
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
const handleCloseOnEsc = event => {
|
|
61
|
-
if (event
|
|
61
|
+
if ((event === null || event === void 0 ? void 0 : event.key) === 'Escape') {
|
|
62
62
|
event.stopPropagation();
|
|
63
63
|
handleClose();
|
|
64
64
|
}
|
|
@@ -77,7 +77,7 @@ const BaseDialog = props => {
|
|
|
77
77
|
let y = positionY <= 0 ? 0 : positionY;
|
|
78
78
|
if (x + width >= window.innerWidth) x = window.innerWidth - width;
|
|
79
79
|
if (y + height >= window.innerHeight) y = window.innerHeight - height;
|
|
80
|
-
wrapperEl.current.style.transform =
|
|
80
|
+
wrapperEl.current.style.transform = "translate(".concat(x, "px, ").concat(y, "px)");
|
|
81
81
|
wrapperEl.current.style.transition = 'none';
|
|
82
82
|
wrapperEl.current.style.left = '0';
|
|
83
83
|
wrapperEl.current.style.top = '0';
|
|
@@ -97,8 +97,9 @@ const BaseDialog = props => {
|
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
const onMouseDown = event => {
|
|
100
|
+
var _headerRef$current;
|
|
100
101
|
const element = event.target;
|
|
101
|
-
const isHeader = headerRef
|
|
102
|
+
const isHeader = headerRef === null || headerRef === void 0 ? void 0 : (_headerRef$current = headerRef.current) === null || _headerRef$current === void 0 ? void 0 : _headerRef$current.contains(element);
|
|
102
103
|
if (wrapperEl.current && isHeader) setIsDragging(true);
|
|
103
104
|
};
|
|
104
105
|
const onMouseUp = () => {
|
|
@@ -115,7 +116,7 @@ const BaseDialog = props => {
|
|
|
115
116
|
className: "modal-overlay",
|
|
116
117
|
"data-testid": "modal-overlay"
|
|
117
118
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
118
|
-
className:
|
|
119
|
+
className: "dialog ".concat(className),
|
|
119
120
|
"data-testid": "dialog-component"
|
|
120
121
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
121
122
|
className: wrapperClassName,
|
package/lib/dialog/form/index.js
CHANGED
|
@@ -60,7 +60,7 @@ const ModalForm = props => {
|
|
|
60
60
|
height: height
|
|
61
61
|
}, props, {
|
|
62
62
|
className: className,
|
|
63
|
-
wrapperClassName:
|
|
63
|
+
wrapperClassName: "dialog-form-wrapper ".concat(wrapperClassName)
|
|
64
64
|
}), props.title && /*#__PURE__*/_react.default.createElement("div", {
|
|
65
65
|
className: "header-form"
|
|
66
66
|
}, /*#__PURE__*/_react.default.createElement(_Header.default, {
|
|
@@ -20,7 +20,7 @@ function Progressbar(_ref) {
|
|
|
20
20
|
currentStep
|
|
21
21
|
} = context;
|
|
22
22
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
23
|
-
className:
|
|
23
|
+
className: "wizard-progressbar ".concat(customClass),
|
|
24
24
|
style: customStyle,
|
|
25
25
|
"data-position": position
|
|
26
26
|
}, stepsTitle.map(step => /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -16,7 +16,7 @@ function WizardStep(_ref) {
|
|
|
16
16
|
const context = (0, _.useWizardContext)();
|
|
17
17
|
if (!context) throw new Error('WizardStep must be used within a Wizard component');
|
|
18
18
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
19
|
-
className:
|
|
19
|
+
className: "wizard-step-component ".concat(customClass),
|
|
20
20
|
style: customStyle
|
|
21
21
|
}, children);
|
|
22
22
|
}
|
package/lib/drawer/Drawer.js
CHANGED
|
@@ -83,7 +83,7 @@ const BaseDrawer = _ref => {
|
|
|
83
83
|
};
|
|
84
84
|
const closeDrawerOnEsc = e => {
|
|
85
85
|
if (closeOnEsc && e.key === 'Escape') {
|
|
86
|
-
handlerClose
|
|
86
|
+
handlerClose === null || handlerClose === void 0 ? void 0 : handlerClose();
|
|
87
87
|
e.stopPropagation();
|
|
88
88
|
}
|
|
89
89
|
};
|
|
@@ -124,12 +124,12 @@ const BaseDrawer = _ref => {
|
|
|
124
124
|
value: contextValues
|
|
125
125
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
126
126
|
"data-testid": "drawercontainer-component",
|
|
127
|
-
className:
|
|
127
|
+
className: "".concat(position, " ").concat(customClass),
|
|
128
128
|
style: style
|
|
129
129
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
130
130
|
style: overlayStyle,
|
|
131
131
|
"data-testid": "drawercontent",
|
|
132
|
-
className:
|
|
132
|
+
className: "drawercontent ".concat(skeletonize ? '-skeletonized' : '', " ").concat(customClassForContent)
|
|
133
133
|
}, title && /*#__PURE__*/_react.default.createElement(_.DrawerHeader, _extends({}, headerProps, {
|
|
134
134
|
customClass: customClassForDrawer
|
|
135
135
|
})), content ? /*#__PURE__*/_react.default.createElement(_.DrawerContent, null, content) : children, getSpinner())));
|
package/lib/drawer/Header.js
CHANGED
|
@@ -61,7 +61,7 @@ const Header = _ref => {
|
|
|
61
61
|
};
|
|
62
62
|
const checkHandlerClose = () => handlerClose ? handlerClose() : undefined;
|
|
63
63
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
64
|
-
className:
|
|
64
|
+
className: "drawerheader ".concat(customClass),
|
|
65
65
|
"data-testid": "drawerheader"
|
|
66
66
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
67
67
|
className: "left"
|
package/lib/dropdown/Popup.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { IPopUpProps } from './types.js';
|
|
3
3
|
|
|
4
|
-
declare const DropdownPopup: ({ id, customClassForDropdown, align, isFloatMenu, topPosition, leftPosition, rightPosition, minWidth, ...props }: IPopUpProps) => React.ReactPortal;
|
|
4
|
+
declare const DropdownPopup: ({ id, customClassForDropdown, align, isFloatMenu, topPosition, leftPosition, rightPosition, minWidth, targetRef, ...props }: IPopUpProps) => React.ReactPortal;
|
|
5
5
|
|
|
6
6
|
export { DropdownPopup as default };
|
package/lib/dropdown/Popup.js
CHANGED
|
@@ -7,28 +7,46 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
9
9
|
var _uuid = require("uuid");
|
|
10
|
-
const _excluded = ["id", "customClassForDropdown", "align", "isFloatMenu", "topPosition", "leftPosition", "rightPosition", "minWidth"];
|
|
10
|
+
const _excluded = ["id", "customClassForDropdown", "align", "isFloatMenu", "topPosition", "leftPosition", "rightPosition", "minWidth", "targetRef"];
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
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; }
|
|
13
13
|
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; }
|
|
14
|
-
const
|
|
14
|
+
const getDropdownStyles = _ref => {
|
|
15
15
|
let {
|
|
16
|
-
topPosition,
|
|
17
|
-
leftPosition,
|
|
18
|
-
rightPosition,
|
|
19
16
|
align,
|
|
20
17
|
isFloatMenu,
|
|
21
|
-
minWidth
|
|
18
|
+
minWidth,
|
|
19
|
+
container,
|
|
20
|
+
target
|
|
22
21
|
} = _ref;
|
|
23
|
-
|
|
22
|
+
if (!container || !target) return '';
|
|
23
|
+
const targetDimensions = target.getBoundingClientRect();
|
|
24
|
+
const rightPosition = !isFloatMenu ? window.innerWidth - targetDimensions.x - targetDimensions.width - 4 : undefined;
|
|
25
|
+
const leftPosition = targetDimensions.left;
|
|
26
|
+
let topPosition = targetDimensions.top + window.scrollY + targetDimensions.height;
|
|
27
|
+
let top = topPosition + (isFloatMenu ? 6 : 2);
|
|
28
|
+
let maxHeight = undefined;
|
|
29
|
+
let showScroll = false;
|
|
30
|
+
const isOverflowing = top + container.scrollHeight > window.innerHeight;
|
|
31
|
+
if (isOverflowing) {
|
|
32
|
+
const targetPosition = targetDimensions.top;
|
|
33
|
+
const containerHeight = container.scrollHeight;
|
|
34
|
+
showScroll = containerHeight > targetPosition;
|
|
35
|
+
maxHeight = showScroll ? targetPosition - 10 : containerHeight;
|
|
36
|
+
top = top - maxHeight - targetDimensions.height - (isFloatMenu ? 6 : 2) - 5;
|
|
37
|
+
}
|
|
38
|
+
let style = "top: ".concat(top, "px; min-width: ").concat(minWidth, "px;");
|
|
39
|
+
if (showScroll) style += "max-height: ".concat(maxHeight, "px; overflow-y: scroll;");
|
|
24
40
|
if (align === 'left') {
|
|
25
|
-
style +=
|
|
41
|
+
style += "left: ".concat(leftPosition, "px;");
|
|
26
42
|
} else if (align === 'right') {
|
|
27
|
-
style +=
|
|
43
|
+
style += "right: ".concat(rightPosition, "px;");
|
|
28
44
|
}
|
|
29
45
|
return style;
|
|
30
46
|
};
|
|
31
|
-
const
|
|
47
|
+
const {
|
|
48
|
+
body
|
|
49
|
+
} = document;
|
|
32
50
|
const DropdownPopup = _ref2 => {
|
|
33
51
|
let {
|
|
34
52
|
id,
|
|
@@ -38,28 +56,31 @@ const DropdownPopup = _ref2 => {
|
|
|
38
56
|
topPosition = 0,
|
|
39
57
|
leftPosition = 0,
|
|
40
58
|
rightPosition = 0,
|
|
41
|
-
minWidth = 0
|
|
59
|
+
minWidth = 0,
|
|
60
|
+
targetRef
|
|
42
61
|
} = _ref2,
|
|
43
62
|
props = _objectWithoutProperties(_ref2, _excluded);
|
|
44
63
|
const popup = (0, _react.useRef)(document.createElement('div'));
|
|
45
|
-
popup.current.className =
|
|
64
|
+
popup.current.className = "dropdown-component ".concat(customClassForDropdown);
|
|
46
65
|
popup.current.dataset.testid = 'dropdown-component';
|
|
47
|
-
popup.current.style.cssText = getCalendarDropdownStyle({
|
|
48
|
-
topPosition,
|
|
49
|
-
leftPosition,
|
|
50
|
-
rightPosition,
|
|
51
|
-
align,
|
|
52
|
-
isFloatMenu,
|
|
53
|
-
minWidth
|
|
54
|
-
});
|
|
55
66
|
if (popup && popup.current) {
|
|
56
67
|
const modalContainers = document.body.getElementsByClassName('modalcontainer');
|
|
57
68
|
const lastModalContainer = modalContainers[modalContainers.length - 1];
|
|
58
|
-
popup.current.style.zIndex =
|
|
69
|
+
popup.current.style.zIndex = "".concat(modalContainers.length ? Number(lastModalContainer.style.zIndex) + 1 : 99999);
|
|
59
70
|
}
|
|
60
71
|
(0, _react.useEffect)(() => {
|
|
61
72
|
body.appendChild(popup.current);
|
|
62
|
-
popup.current.id = id ||
|
|
73
|
+
popup.current.id = id || "dropdown-component-".concat((0, _uuid.v1)());
|
|
74
|
+
popup.current.style.cssText = getDropdownStyles({
|
|
75
|
+
topPosition,
|
|
76
|
+
leftPosition,
|
|
77
|
+
rightPosition,
|
|
78
|
+
align,
|
|
79
|
+
isFloatMenu,
|
|
80
|
+
minWidth,
|
|
81
|
+
container: popup.current,
|
|
82
|
+
target: targetRef
|
|
83
|
+
});
|
|
63
84
|
return () => {
|
|
64
85
|
body.removeChild(popup.current);
|
|
65
86
|
};
|
package/lib/dropdown/helper.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getDropdownItemCssClass = exports.contentClass = void 0;
|
|
7
|
-
const contentClass = showClearButton =>
|
|
7
|
+
const contentClass = showClearButton => "content ".concat(showClearButton ? '' : 'noclear');
|
|
8
8
|
exports.contentClass = contentClass;
|
|
9
9
|
const getDropdownItemCssClass = (selected, disabled, striped) => {
|
|
10
10
|
let className = 'item';
|
package/lib/dropdown/types.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ interface WithDropdownProps {
|
|
|
10
10
|
closeDropdownOnClickOutside?: boolean;
|
|
11
11
|
showDropdown?: () => void;
|
|
12
12
|
isFloatMenu?: boolean;
|
|
13
|
+
handlerClose?: (cb: () => void) => void;
|
|
13
14
|
}
|
|
14
15
|
interface WrappedComponentProps extends WithDropdownProps {
|
|
15
16
|
getDropdownPopup?: (ref: Ref<HTMLElement | null>) => ReactElement;
|
|
@@ -31,14 +32,17 @@ interface IPopUpProps {
|
|
|
31
32
|
leftPosition?: number;
|
|
32
33
|
rightPosition?: number;
|
|
33
34
|
minWidth?: number;
|
|
35
|
+
targetRef?: HTMLElement;
|
|
34
36
|
}
|
|
35
|
-
interface
|
|
37
|
+
interface GetDropdownStyleParams {
|
|
36
38
|
align: 'left' | 'right';
|
|
37
39
|
minWidth: number;
|
|
38
40
|
isFloatMenu: boolean;
|
|
39
41
|
topPosition: number;
|
|
40
42
|
leftPosition: number;
|
|
41
43
|
rightPosition: number;
|
|
44
|
+
container?: HTMLDivElement;
|
|
45
|
+
target?: HTMLElement;
|
|
42
46
|
}
|
|
43
47
|
|
|
44
|
-
export {
|
|
48
|
+
export { GetDisplayNameParams, GetDropdownStyleParams, IPopUpProps, WithDropdownContextProps, WithDropdownProps, WrappedComponentProps };
|