linear-react-components-ui 1.1.18-beta.17 → 1.1.18-beta.18
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/calendar.scss +64 -30
- package/lib/assets/styles/datepicker.scss +26 -6
- package/lib/assets/styles/input.scss +2 -2
- package/lib/assets/styles/periodpicker.scss +60 -20
- package/lib/assets/styles/popover.scss +0 -3
- package/lib/assets/styles/sidenav.scss +1 -1
- package/lib/assets/styles/tabs.scss +32 -15
- package/lib/calendar/DangerCalendar.d.ts +1 -0
- package/lib/calendar/InfoCalendar.d.ts +1 -0
- package/lib/calendar/PrimaryCalendar.d.ts +1 -0
- package/lib/calendar/SuccessCalendar.d.ts +1 -0
- package/lib/calendar/WarningCalendar.d.ts +1 -0
- package/lib/calendar/base/Day.d.ts +1 -0
- package/lib/calendar/base/Day.js +6 -2
- package/lib/calendar/base/Month.d.ts +2 -1
- package/lib/calendar/base/Month.js +2 -0
- package/lib/calendar/base/Week.d.ts +1 -0
- package/lib/calendar/base/index.d.ts +1 -0
- package/lib/calendar/base/index.js +63 -13
- package/lib/calendar/index.d.ts +1 -0
- package/lib/calendar/types.d.ts +5 -0
- package/lib/checkbox/Label.d.ts +11 -0
- package/lib/checkbox/index.js +18 -45
- package/lib/checkbox/types.d.ts +0 -4
- package/lib/dialog/base/Content.js +5 -4
- package/lib/dialog/base/Header.js +0 -1
- package/lib/dialog/base/index.js +27 -3
- package/lib/drawer/Drawer.js +1 -1
- package/lib/form/types.d.ts +0 -14
- package/lib/inputs/base/InputTextBase.js +8 -34
- package/lib/inputs/base/types.d.ts +0 -3
- package/lib/inputs/color/types.d.ts +0 -5
- package/lib/inputs/date/Dialog.js +5 -4
- package/lib/inputs/date/Dropdown.js +15 -7
- package/lib/inputs/date/helpers.d.ts +1 -11
- package/lib/inputs/date/helpers.js +1 -11
- package/lib/inputs/date/index.js +138 -100
- package/lib/inputs/date/types.d.ts +7 -10
- package/lib/inputs/file/DragDropFile.js +1 -2
- package/lib/inputs/file/types.d.ts +0 -3
- package/lib/inputs/mask/helpers.d.ts +0 -4
- package/lib/inputs/mask/types.d.ts +0 -4
- package/lib/inputs/multiSelect/types.d.ts +0 -4
- 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 +3 -7
- package/lib/inputs/number/types.d.ts +2 -14
- package/lib/inputs/period/Dialog.d.ts +1 -1
- package/lib/inputs/period/Dialog.js +5 -3
- package/lib/inputs/period/Dropdown.js +19 -8
- package/lib/inputs/period/PeriodList.js +3 -12
- package/lib/inputs/period/index.js +241 -112
- package/lib/inputs/period/types.d.ts +10 -11
- package/lib/inputs/select/ActionButtons.js +3 -2
- package/lib/inputs/select/multiple/index.js +10 -11
- package/lib/inputs/select/simple/index.js +10 -4
- package/lib/inputs/select/types.d.ts +4 -6
- package/lib/inputs/types.d.ts +1 -0
- package/lib/list/index.js +2 -2
- package/lib/popover/index.js +5 -3
- package/lib/popover/types.d.ts +1 -2
- package/lib/radio/index.d.ts +1 -1
- package/lib/radio/index.js +1 -32
- package/lib/radio/types.d.ts +0 -6
- package/lib/tabs/DropdownTabs.js +21 -7
- package/lib/tabs/context.d.ts +1 -1
- package/lib/tabs/context.js +3 -3
- package/lib/tabs/types.d.ts +2 -1
- package/lib/textContent/index.d.ts +4 -18
- package/lib/textContent/index.js +4 -14
- package/lib/toolbar/types.d.ts +2 -1
- package/package.json +1 -1
- package/lib/inputs/mask/imaskHOC.js +0 -203
- package/lib/menus/sidenav/popup_menu_help/index.js +0 -85
- package/lib/tabs/DropdownItems.js +0 -62
- package/lib/tabs/MenuItems.js +0 -70
- package/lib/treeview_old/Header.js +0 -29
- package/lib/treeview_old/Node.js +0 -68
- package/lib/treeview_old/index.js +0 -43
|
@@ -13,7 +13,6 @@ 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"));
|
|
17
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
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); }
|
|
19
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; }
|
|
@@ -27,8 +26,10 @@ const MultipleSelect = props => {
|
|
|
27
26
|
remoteSearch = false,
|
|
28
27
|
descriptionKey,
|
|
29
28
|
showClearButton,
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
customClassForLabel,
|
|
30
|
+
customClassForWrapper,
|
|
31
|
+
customClassForInputContent,
|
|
32
|
+
customClassForSideButtons
|
|
32
33
|
} = props;
|
|
33
34
|
const [dataCombo, setDataCombo] = (0, _react.useState)(dataSource);
|
|
34
35
|
const [currents, setCurrents] = (0, _react.useState)([]);
|
|
@@ -237,8 +238,9 @@ const MultipleSelect = props => {
|
|
|
237
238
|
},
|
|
238
239
|
onClick: onFocus,
|
|
239
240
|
onKeyDown: onInputKeyDown,
|
|
240
|
-
|
|
241
|
-
|
|
241
|
+
customClassForLabel: customClassForLabel,
|
|
242
|
+
customClassForWrapper: "selectwrapper ".concat((props.readOnly || shouldDisable() || shouldBeReadOnly()) && ' -undigitable', " ").concat(customClassForWrapper),
|
|
243
|
+
customClassForInputContent: "multiselect ".concat(customClassForInputContent),
|
|
242
244
|
inputBaseRef: r => {
|
|
243
245
|
selectWrapper.current = r;
|
|
244
246
|
},
|
|
@@ -251,7 +253,8 @@ const MultipleSelect = props => {
|
|
|
251
253
|
if (shouldDisable()) return null;
|
|
252
254
|
return onClearClick();
|
|
253
255
|
},
|
|
254
|
-
handlerOpenClose: onOpenClose
|
|
256
|
+
handlerOpenClose: onOpenClose,
|
|
257
|
+
customClassForSideButtons: customClassForSideButtons
|
|
255
258
|
})
|
|
256
259
|
}), /*#__PURE__*/_react.default.createElement(_Selecteds.default, _extends({}, props, {
|
|
257
260
|
currents: currents,
|
|
@@ -270,10 +273,6 @@ const MultipleSelect = props => {
|
|
|
270
273
|
dataCombo: dataCombo,
|
|
271
274
|
currents: currents,
|
|
272
275
|
dropdownWidth: dropdownWidth || 0
|
|
273
|
-
}))
|
|
274
|
-
visible: !!hint && hintPosition === 'below',
|
|
275
|
-
customClass: "hint",
|
|
276
|
-
description: hint
|
|
277
|
-
}));
|
|
276
|
+
})));
|
|
278
277
|
};
|
|
279
278
|
var _default = exports.default = MultipleSelect;
|
|
@@ -34,7 +34,11 @@ const SimpleSelect = props => {
|
|
|
34
34
|
searchOnDropdown = false,
|
|
35
35
|
allOptions = undefined,
|
|
36
36
|
showClearButton = false,
|
|
37
|
-
searchNotFoundText
|
|
37
|
+
searchNotFoundText,
|
|
38
|
+
customClassForWrapper,
|
|
39
|
+
customClassForInputContent,
|
|
40
|
+
customClassForLabel,
|
|
41
|
+
customClassForSideButtons
|
|
38
42
|
} = props;
|
|
39
43
|
const descriptionKeyIsString = typeof descriptionKey === 'string';
|
|
40
44
|
const dataSourceWithAllOptions = allOptions ? [{
|
|
@@ -268,8 +272,9 @@ const SimpleSelect = props => {
|
|
|
268
272
|
},
|
|
269
273
|
onClick: onFocus,
|
|
270
274
|
onKeyDown: onInputKeyDown,
|
|
271
|
-
|
|
272
|
-
|
|
275
|
+
customClassForLabel: customClassForLabel,
|
|
276
|
+
customClassForWrapper: "selectwrapper ".concat((undigitable || searchOnDropdown || shouldBeReadOnly()) && ' -undigitable', " ").concat(customClassForWrapper),
|
|
277
|
+
customClassForInputContent: "multiselect ".concat(customClassForInputContent),
|
|
273
278
|
inputBaseRef: r => {
|
|
274
279
|
selectWrapper.current = r;
|
|
275
280
|
},
|
|
@@ -282,7 +287,8 @@ const SimpleSelect = props => {
|
|
|
282
287
|
if (shouldDisable()) return null;
|
|
283
288
|
return onClearClick();
|
|
284
289
|
},
|
|
285
|
-
handlerOpenClose: onOpenClose
|
|
290
|
+
handlerOpenClose: onOpenClose,
|
|
291
|
+
customClassForSideButtons: customClassForSideButtons
|
|
286
292
|
})
|
|
287
293
|
})), opened && /*#__PURE__*/_react.default.createElement(_Dropdown.default, _extends({}, props, {
|
|
288
294
|
opened: opened,
|
|
@@ -50,9 +50,10 @@ interface ISimpleSelectProps {
|
|
|
50
50
|
onFocus?: () => void;
|
|
51
51
|
allOptions?: AllOptions;
|
|
52
52
|
inputRef?: MutableRefObject<HTMLInputElement | HTMLTextAreaElement | null> | ((ref: HTMLInputElement | HTMLTextAreaElement | null) => void);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
customClassForWrapper?: string;
|
|
54
|
+
customClassForInputContent?: string;
|
|
55
|
+
customClassForLabel?: string;
|
|
56
|
+
customClassForSideButtons?: string;
|
|
56
57
|
}
|
|
57
58
|
interface ISelectFieldProps extends Omit<ISimpleSelectProps, 'idKey' | 'value' | 'descriptionKey'> {
|
|
58
59
|
multiple?: boolean;
|
|
@@ -93,9 +94,6 @@ interface IMultipleSelectProps extends Omit<ISimpleSelectProps, 'idKey' | 'value
|
|
|
93
94
|
handlerClear?: () => void;
|
|
94
95
|
disabled?: boolean;
|
|
95
96
|
gridLayout?: string;
|
|
96
|
-
hintPosition?: 'below' | 'onLabelRight';
|
|
97
|
-
themePopover?: 'light' | 'dark';
|
|
98
|
-
popoverAlign?: 'right' | 'left';
|
|
99
97
|
}
|
|
100
98
|
interface ISelectedsMultipleProps {
|
|
101
99
|
idKey: string;
|
package/lib/inputs/types.d.ts
CHANGED
|
@@ -137,6 +137,7 @@ interface IActionButtonsSelectProps {
|
|
|
137
137
|
dropDownOpened: boolean;
|
|
138
138
|
showClearButton?: boolean;
|
|
139
139
|
disabled?: boolean;
|
|
140
|
+
customClassForSideButtons?: string;
|
|
140
141
|
}
|
|
141
142
|
interface IButtonsProps {
|
|
142
143
|
onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
|
package/lib/list/index.js
CHANGED
|
@@ -36,7 +36,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
36
36
|
const List = props => {
|
|
37
37
|
const {
|
|
38
38
|
children,
|
|
39
|
-
customClass,
|
|
39
|
+
customClass = '',
|
|
40
40
|
condensed,
|
|
41
41
|
transparent,
|
|
42
42
|
style,
|
|
@@ -175,7 +175,7 @@ const List = props => {
|
|
|
175
175
|
"data-testid": "list-component",
|
|
176
176
|
style: style,
|
|
177
177
|
ref: listRef,
|
|
178
|
-
className: "list-component ".concat(condensed && '-condensed', "
|
|
178
|
+
className: "list-component ".concat(condensed && '-condensed', " ").concat(!transparent && '-listbackground', " ").concat(customClass)
|
|
179
179
|
}, newChildren));
|
|
180
180
|
};
|
|
181
181
|
var _default = exports.default = List;
|
package/lib/popover/index.js
CHANGED
|
@@ -32,8 +32,7 @@ const Popover = _ref => {
|
|
|
32
32
|
iconName,
|
|
33
33
|
iconSize = 16,
|
|
34
34
|
iconColor = '',
|
|
35
|
-
customClass = ''
|
|
36
|
-
style
|
|
35
|
+
customClass = ''
|
|
37
36
|
} = _ref;
|
|
38
37
|
return /*#__PURE__*/_react.default.createElement(_buttons.default, {
|
|
39
38
|
round: true,
|
|
@@ -45,7 +44,10 @@ const Popover = _ref => {
|
|
|
45
44
|
dropdownAlign: align,
|
|
46
45
|
showIconDropdown: false,
|
|
47
46
|
customClass: "popover-component",
|
|
48
|
-
style:
|
|
47
|
+
style: {
|
|
48
|
+
height: '100%',
|
|
49
|
+
width: '100%'
|
|
50
|
+
},
|
|
49
51
|
icon: /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
50
52
|
customClass: "buttonicon",
|
|
51
53
|
name: iconName || 'information',
|
package/lib/popover/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { Position } from '../@types/Position.js';
|
|
3
3
|
import { SizePixels } from '../@types/SizePixels.js';
|
|
4
4
|
import { IconNames } from '../@types/Icon.js';
|
|
@@ -18,7 +18,6 @@ interface IPopoverProps {
|
|
|
18
18
|
theme?: 'light' | 'dark';
|
|
19
19
|
align?: Extract<Position, 'left' | 'right'>;
|
|
20
20
|
iconSize?: Extract<SizePixels, 10 | 16 | 24 | 32 | 40 | 64>;
|
|
21
|
-
style?: CSSProperties;
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
export { IPopoverProps, PopoverTextProps, PopoverTitleProps };
|
package/lib/radio/index.d.ts
CHANGED
|
@@ -8,6 +8,6 @@ import '../@types/Size.js';
|
|
|
8
8
|
* o componente Field dentro do componente Form, pois o mesmo leva em consideração o tipo do
|
|
9
9
|
* componente para gerar propriedades customizadas.
|
|
10
10
|
*/
|
|
11
|
-
declare const Radio: ({ id, label, value, checked, onChange, name, disabled, required, skeletonize, defaultChecked, forwardedRef, size,
|
|
11
|
+
declare const Radio: ({ id, label, value, checked, onChange, name, disabled, required, skeletonize, defaultChecked, forwardedRef, size, permissionAttr }: IRadioProps) => JSX.Element | null;
|
|
12
12
|
|
|
13
13
|
export { Radio as default };
|
package/lib/radio/index.js
CHANGED
|
@@ -7,9 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
require("../assets/styles/radio.scss");
|
|
9
9
|
var _permissionValidations = require("../permissionValidations");
|
|
10
|
-
var _popover = _interopRequireDefault(require("../popover"));
|
|
11
|
-
var _textContent = _interopRequireDefault(require("../textContent"));
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
10
|
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
11
|
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; }
|
|
15
12
|
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); }
|
|
@@ -38,12 +35,6 @@ const Radio = _ref => {
|
|
|
38
35
|
defaultChecked = false,
|
|
39
36
|
forwardedRef,
|
|
40
37
|
size = 'medium',
|
|
41
|
-
customClassForLabel,
|
|
42
|
-
labelUppercase,
|
|
43
|
-
hint,
|
|
44
|
-
hintPosition = 'onLabelRight',
|
|
45
|
-
themePopover = 'light',
|
|
46
|
-
popoverAlign = 'left',
|
|
47
38
|
permissionAttr
|
|
48
39
|
} = _ref;
|
|
49
40
|
const [isChecked, setIsChecked] = (0, _react.useState)(checked);
|
|
@@ -73,12 +64,6 @@ const Radio = _ref => {
|
|
|
73
64
|
};
|
|
74
65
|
if (onDenied.unvisible) return null;
|
|
75
66
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
76
|
-
className: "radio-input",
|
|
77
|
-
style: {
|
|
78
|
-
display: 'flex',
|
|
79
|
-
alignItems: 'center'
|
|
80
|
-
}
|
|
81
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
82
67
|
className: "radio-button ".concat(disabled ? 'disabled' : '', " ").concat(skeletonize ? '-skeletonized' : '')
|
|
83
68
|
}, /*#__PURE__*/_react.default.createElement("input", _extends({}, getCustomProps(), {
|
|
84
69
|
ref: forwardedRef,
|
|
@@ -92,22 +77,6 @@ const Radio = _ref => {
|
|
|
92
77
|
})), /*#__PURE__*/_react.default.createElement("label", {
|
|
93
78
|
className: "description ".concat(size && "-".concat(size)),
|
|
94
79
|
htmlFor: id
|
|
95
|
-
}, /*#__PURE__*/_react.default.createElement("span", null,
|
|
96
|
-
required: required,
|
|
97
|
-
disabled: shouldDisable(),
|
|
98
|
-
className: customClassForLabel,
|
|
99
|
-
labelUppercase: labelUppercase
|
|
100
|
-
}), label, /*#__PURE__*/_react.default.createElement(_textContent.default, null)))), !!hint && hintPosition === 'onLabelRight' && /*#__PURE__*/_react.default.createElement(_popover.default, {
|
|
101
|
-
theme: themePopover,
|
|
102
|
-
align: popoverAlign,
|
|
103
|
-
customClass: "-hint",
|
|
104
|
-
iconColor: "#03bde2",
|
|
105
|
-
iconSize: 16,
|
|
106
|
-
style: {
|
|
107
|
-
margin: '0px 5px',
|
|
108
|
-
height: 'auto',
|
|
109
|
-
width: 20
|
|
110
|
-
}
|
|
111
|
-
}, hint));
|
|
80
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, label)));
|
|
112
81
|
};
|
|
113
82
|
var _default = exports.default = Radio;
|
package/lib/radio/types.d.ts
CHANGED
|
@@ -16,12 +16,6 @@ interface IRadioProps {
|
|
|
16
16
|
permissionAttr?: PermissionAttr | PermissionAttr;
|
|
17
17
|
skeletonize?: boolean;
|
|
18
18
|
forwardedRef?: Ref<HTMLInputElement>;
|
|
19
|
-
customClassForLabel?: string;
|
|
20
|
-
labelUppercase?: boolean;
|
|
21
|
-
hint?: string;
|
|
22
|
-
hintPosition?: 'below' | 'onLabelRight';
|
|
23
|
-
themePopover?: 'light' | 'dark';
|
|
24
|
-
popoverAlign?: 'right' | 'left';
|
|
25
19
|
}
|
|
26
20
|
|
|
27
21
|
export { IRadioProps };
|
package/lib/tabs/DropdownTabs.js
CHANGED
|
@@ -4,11 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
7
8
|
var _react = _interopRequireDefault(require("react"));
|
|
8
9
|
var _buttons = _interopRequireDefault(require("../buttons"));
|
|
9
10
|
var _list = _interopRequireWildcard(require("../list"));
|
|
10
11
|
var _useTabs = require("./useTabs");
|
|
11
|
-
var
|
|
12
|
+
var _2 = require("..");
|
|
12
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -26,16 +27,25 @@ const DropdownTab = _ref => {
|
|
|
26
27
|
} = _ref;
|
|
27
28
|
const {
|
|
28
29
|
selectTab,
|
|
29
|
-
removeTab
|
|
30
|
+
removeTab,
|
|
31
|
+
selectedTabId
|
|
30
32
|
} = (0, _useTabs.useTabs)();
|
|
31
33
|
return /*#__PURE__*/_react.default.createElement(_list.ListItem, {
|
|
32
|
-
key: id
|
|
34
|
+
key: id,
|
|
35
|
+
onClick: () => selectTab(id)
|
|
33
36
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
34
37
|
className: "menuitem"
|
|
35
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
38
|
+
}, selectedTabId === id ? /*#__PURE__*/_react.default.createElement(_2.Icon, {
|
|
39
|
+
name: "checkmark",
|
|
40
|
+
color: "#A10D0D"
|
|
41
|
+
}) : /*#__PURE__*/_react.default.createElement("div", {
|
|
42
|
+
style: {
|
|
43
|
+
width: 16,
|
|
44
|
+
height: 16
|
|
45
|
+
}
|
|
46
|
+
}), /*#__PURE__*/_react.default.createElement(_buttons.default, {
|
|
36
47
|
className: "btn menubutton",
|
|
37
48
|
boxShadow: false,
|
|
38
|
-
onClick: () => selectTab(id),
|
|
39
49
|
iconAlign: iconAlign,
|
|
40
50
|
iconName: iconName,
|
|
41
51
|
icon: icon,
|
|
@@ -53,16 +63,20 @@ const DropdownTabs = _ref2 => {
|
|
|
53
63
|
tabs = [],
|
|
54
64
|
tabMenuSize = 'medium'
|
|
55
65
|
} = _ref2;
|
|
66
|
+
const {
|
|
67
|
+
selectedTabId
|
|
68
|
+
} = (0, _useTabs.useTabs)();
|
|
69
|
+
const hasSelectedTab = tabs.some(tab => tab.id === selectedTabId);
|
|
56
70
|
const hasTabs = tabs.length > 0;
|
|
57
71
|
const uniqueTabs = _lodash.default.uniqBy(tabs, 'id');
|
|
58
|
-
if (
|
|
72
|
+
if (!hasTabs) return null;
|
|
59
73
|
return /*#__PURE__*/_react.default.createElement(_buttons.default, {
|
|
60
74
|
dropdown: true,
|
|
61
75
|
dropdownAlign: "right",
|
|
62
76
|
transparent: true,
|
|
63
77
|
boxShadow: false,
|
|
64
78
|
size: "large",
|
|
65
|
-
customClass: "dropdownbutton ".concat(hasTabs ? 'show' : '')
|
|
79
|
+
customClass: "dropdownbutton ".concat(hasTabs ? 'show' : '', " ").concat(hasSelectedTab ? 'has-selected' : '')
|
|
66
80
|
}, /*#__PURE__*/_react.default.createElement(_list.default, {
|
|
67
81
|
customClass: "dropdown-hide-tabs"
|
|
68
82
|
}, uniqueTabs.map(tab => /*#__PURE__*/_react.default.createElement(DropdownTab, _extends({
|
package/lib/tabs/context.d.ts
CHANGED
|
@@ -7,6 +7,6 @@ import '../@types/Icon.js';
|
|
|
7
7
|
import '../icons/helper.js';
|
|
8
8
|
|
|
9
9
|
declare const TabsContext: React__default.Context<TabsContextType>;
|
|
10
|
-
declare function TabsProvider({ children, tabs: tabsProp, container, selectedTab, onTabChange, onTabClose, tabsWidth: tabsWidthProp, firstTabIdent, }: TabsProviderProps): JSX.Element;
|
|
10
|
+
declare function TabsProvider({ children, tabs: tabsProp, container, selectedTab, onTabChange, onTabClose, tabsWidth: tabsWidthProp, firstTabIdent, keepTabOriginalPosition, }: TabsProviderProps): JSX.Element;
|
|
11
11
|
|
|
12
12
|
export { TabsContext, TabsProvider };
|
package/lib/tabs/context.js
CHANGED
|
@@ -22,7 +22,8 @@ function TabsProvider(_ref) {
|
|
|
22
22
|
onTabChange,
|
|
23
23
|
onTabClose,
|
|
24
24
|
tabsWidth: tabsWidthProp,
|
|
25
|
-
firstTabIdent = false
|
|
25
|
+
firstTabIdent = false,
|
|
26
|
+
keepTabOriginalPosition = true
|
|
26
27
|
} = _ref;
|
|
27
28
|
const [selectedTabId, setSelectedTabId] = _react.default.useState(selectedTab);
|
|
28
29
|
const [containerWidth, setContainerWidth] = (0, _react.useState)(() => {
|
|
@@ -64,7 +65,7 @@ function TabsProvider(_ref) {
|
|
|
64
65
|
}
|
|
65
66
|
}, [setTabs, menuTabs, tabs, dropdownTabs]);
|
|
66
67
|
const selectTab = (0, _react.useCallback)(tabId => {
|
|
67
|
-
updateTabs(tabId);
|
|
68
|
+
if (!keepTabOriginalPosition) updateTabs(tabId);
|
|
68
69
|
setSelectedTabId(tabId);
|
|
69
70
|
if (onTabChange) {
|
|
70
71
|
onTabChange(tabId);
|
|
@@ -120,7 +121,6 @@ function TabsProvider(_ref) {
|
|
|
120
121
|
dropdownTabs,
|
|
121
122
|
containerWidth,
|
|
122
123
|
tabsCount,
|
|
123
|
-
updateTabs,
|
|
124
124
|
selectTab,
|
|
125
125
|
selectedTabId,
|
|
126
126
|
removeTab,
|
package/lib/tabs/types.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ type TabsContextType = {
|
|
|
11
11
|
dropdownTabs: TabProps[];
|
|
12
12
|
selectedTabId: string | number | null;
|
|
13
13
|
selectTab: (tabId: string | number) => void;
|
|
14
|
-
updateTabs: (tabId: string | number) => void;
|
|
15
14
|
removeTab: (tabId: string | number) => void;
|
|
16
15
|
containerWidth: number;
|
|
17
16
|
tabsCount: number;
|
|
@@ -26,6 +25,7 @@ interface TabsProviderProps {
|
|
|
26
25
|
onTabChange?: (tabId: string | number) => void;
|
|
27
26
|
onTabClose?: (tabId: string) => void;
|
|
28
27
|
firstTabIdent?: boolean;
|
|
28
|
+
keepTabOriginalPosition?: boolean;
|
|
29
29
|
}
|
|
30
30
|
interface ITabsPros {
|
|
31
31
|
style?: CSSProperties;
|
|
@@ -41,6 +41,7 @@ interface ITabsPros {
|
|
|
41
41
|
handlerCloseTab?: (id?: string, idx?: string) => void;
|
|
42
42
|
customClassForToolBar?: string;
|
|
43
43
|
tabsWidth?: string | number;
|
|
44
|
+
keepTabOriginalPositon?: boolean;
|
|
44
45
|
}
|
|
45
46
|
interface TabProps {
|
|
46
47
|
id: string | number;
|
|
@@ -1,22 +1,8 @@
|
|
|
1
|
-
import React__default
|
|
2
|
-
import { WithTooltipProps } from '../internals/types.js';
|
|
3
|
-
import '../@types/PermissionAttr.js';
|
|
4
|
-
import '../@types/Position.js';
|
|
1
|
+
import React__default from 'react';
|
|
5
2
|
|
|
6
|
-
interface TextContentProps extends React__default.HTMLAttributes<HTMLElement
|
|
3
|
+
interface TextContentProps extends React__default.HTMLAttributes<HTMLElement> {
|
|
7
4
|
as?: 'span' | 'strong' | 'p';
|
|
8
|
-
label?: string | string[];
|
|
9
|
-
styleForLabel?: object;
|
|
10
|
-
labelUppercase?: boolean;
|
|
11
|
-
required?: boolean;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
targetRef?: (ref: HTMLSpanElement | null) => void;
|
|
14
|
-
labelRef?: MutableRefObject<HTMLSpanElement | null>;
|
|
15
|
-
onHoverLabel?: (e: React__default.MouseEvent<HTMLSpanElement, MouseEvent>) => void;
|
|
16
5
|
}
|
|
17
|
-
declare const
|
|
18
|
-
(props: TextContentProps & React__default.RefAttributes<HTMLElement>): JSX.Element;
|
|
19
|
-
displayName: string;
|
|
20
|
-
};
|
|
6
|
+
declare const TextContent: React__default.ForwardRefExoticComponent<TextContentProps & React__default.RefAttributes<HTMLElement>>;
|
|
21
7
|
|
|
22
|
-
export {
|
|
8
|
+
export { TextContent as default };
|
package/lib/textContent/index.js
CHANGED
|
@@ -6,9 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
require("../assets/styles/textContent.scss");
|
|
9
|
-
|
|
10
|
-
const _excluded = ["as", "children", "className", "label", "styleForLabel", "disabled", "targetRef", "labelRef", "onHoverLabel"];
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const _excluded = ["as", "children", "className"];
|
|
12
10
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
11
|
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; }
|
|
14
12
|
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); }
|
|
@@ -18,23 +16,15 @@ const TextContent = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
18
16
|
let {
|
|
19
17
|
as: Comp = 'span',
|
|
20
18
|
children,
|
|
21
|
-
className
|
|
22
|
-
label,
|
|
23
|
-
styleForLabel,
|
|
24
|
-
disabled,
|
|
25
|
-
targetRef,
|
|
26
|
-
labelRef,
|
|
27
|
-
onHoverLabel
|
|
19
|
+
className
|
|
28
20
|
} = _ref,
|
|
29
21
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
30
22
|
const typedRef = ref;
|
|
31
23
|
return /*#__PURE__*/_react.default.createElement(Comp, _extends({
|
|
32
24
|
ref: typedRef,
|
|
33
|
-
style: styleForLabel,
|
|
34
25
|
className: "text-content-component ".concat(className),
|
|
35
|
-
"data-textcontent": Comp
|
|
36
|
-
onMouseEnter: onHoverLabel
|
|
26
|
+
"data-textcontent": Comp
|
|
37
27
|
}, props), children);
|
|
38
28
|
});
|
|
39
29
|
TextContent.displayName = 'TextContent';
|
|
40
|
-
var _default = exports.default =
|
|
30
|
+
var _default = exports.default = TextContent;
|
package/lib/toolbar/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode, CSSProperties, ReactElement } from 'react';
|
|
1
|
+
import { ReactNode, CSSProperties, ReactElement, MutableRefObject } from 'react';
|
|
2
2
|
import { ButtonTypes } from '../@types/ButtonTypes.js';
|
|
3
3
|
import { Position } from '../@types/Position.js';
|
|
4
4
|
import { Size } from '../@types/Size.js';
|
|
@@ -28,6 +28,7 @@ interface IButtonBarProps {
|
|
|
28
28
|
boxShadow?: boolean;
|
|
29
29
|
id?: string;
|
|
30
30
|
onNodeElementClick?: (node: NodeItem) => void;
|
|
31
|
+
buttonRef?: MutableRefObject<HTMLButtonElement | null> | ((ref: HTMLButtonElement | null) => void);
|
|
31
32
|
}
|
|
32
33
|
interface ILabelBarProps {
|
|
33
34
|
iconName?: IconNames;
|