linear-react-components-ui 1.0.2 → 1.0.3-beta.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/@types/Align.d.ts +1 -1
- package/lib/@types/ButtonTypes.d.ts +1 -1
- package/lib/@types/ColorStyles.d.ts +1 -1
- package/lib/@types/DataCombo.d.ts +1 -1
- package/lib/@types/Icon.d.ts +1 -1
- package/lib/@types/LabelStyles.d.ts +1 -1
- package/lib/@types/Period.d.ts +1 -1
- package/lib/@types/PermissionAttr.d.ts +2 -2
- package/lib/@types/PointerEvents.d.ts +1 -1
- package/lib/@types/Position.d.ts +1 -1
- package/lib/@types/PositionAlert.d.ts +1 -1
- package/lib/@types/Size.d.ts +1 -1
- package/lib/@types/SizePixels.d.ts +1 -1
- package/lib/alerts/AlertContainer.js +21 -5
- package/lib/alerts/AlertProvider.js +45 -15
- package/lib/alerts/BaseAlert.js +20 -4
- package/lib/alerts/Message.js +32 -21
- package/lib/alerts/helpers.js +2 -0
- package/lib/alerts/index.d.ts +1 -4
- package/lib/alerts/index.js +4 -0
- package/lib/alerts/types.d.ts +4 -4
- package/lib/alerts/withAlert.js +12 -1
- package/lib/avatar/index.js +35 -20
- package/lib/badge/index.js +14 -9
- package/lib/buttons/ActivateButton.js +6 -0
- package/lib/buttons/AddButton.js +7 -0
- package/lib/buttons/Button.js +15 -2
- package/lib/buttons/ButtonGroups.js +4 -0
- package/lib/buttons/CancelButton.js +11 -1
- package/lib/buttons/DangerButton.js +11 -1
- package/lib/buttons/DefaultButton.js +81 -45
- package/lib/buttons/DestroyButton.js +12 -1
- package/lib/buttons/EditButton.js +6 -0
- package/lib/buttons/InactivateButton.js +6 -0
- package/lib/buttons/InfoButton.js +11 -1
- package/lib/buttons/PrimaryButton.js +11 -1
- package/lib/buttons/RestoreButton.js +6 -0
- package/lib/buttons/SaveButton.js +11 -1
- package/lib/buttons/SuccessButton.js +11 -1
- package/lib/buttons/WarningButton.js +11 -1
- package/lib/buttons/button_container/index.js +11 -5
- package/lib/buttons/index.d.ts +1 -4
- package/lib/buttons/index.js +18 -0
- package/lib/buttons/split_button/index.js +17 -11
- package/lib/calendar/DangerCalendar.js +11 -1
- package/lib/calendar/InfoCalendar.js +11 -1
- package/lib/calendar/PrimaryCalendar.js +11 -1
- package/lib/calendar/SuccessCalendar.js +11 -1
- package/lib/calendar/WarningCalendar.js +11 -1
- package/lib/calendar/base/Day.js +13 -2
- package/lib/calendar/base/Month.js +18 -1
- package/lib/calendar/base/Week.js +18 -2
- package/lib/calendar/base/helpers.js +24 -8
- package/lib/calendar/base/index.js +37 -13
- package/lib/calendar/index.d.ts +1 -4
- package/lib/calendar/index.js +8 -0
- package/lib/checkbox/Label.js +7 -1
- package/lib/checkbox/index.js +53 -28
- package/lib/checkbox/types.d.ts +2 -2
- package/lib/dialog/Alert.js +8 -0
- package/lib/dialog/Custom.js +17 -5
- package/lib/dialog/Error.js +8 -0
- package/lib/dialog/Information.js +8 -0
- package/lib/dialog/Question.js +15 -4
- package/lib/dialog/Warning.js +8 -0
- package/lib/dialog/base/Content.js +6 -1
- package/lib/dialog/base/Footer.js +4 -0
- package/lib/dialog/base/Header.js +13 -5
- package/lib/dialog/base/index.js +28 -7
- package/lib/dialog/base/style.js +2 -0
- package/lib/dialog/form/index.js +29 -9
- package/lib/dialog/index.d.ts +1 -4
- package/lib/dialog/index.js +9 -0
- package/lib/drawer/Content.js +13 -2
- package/lib/drawer/Drawer.js +58 -22
- package/lib/drawer/Header.js +27 -10
- package/lib/drawer/helpers.js +4 -0
- package/lib/drawer/index.js +8 -0
- package/lib/dropdown/Popup.js +32 -19
- package/lib/dropdown/helper.js +4 -0
- package/lib/dropdown/withDropdown.js +47 -18
- package/lib/fieldset/index.js +46 -21
- package/lib/form/Field.js +42 -16
- package/lib/form/FieldArray.js +32 -15
- package/lib/form/FieldNumber.js +20 -6
- package/lib/form/FieldPeriod.js +21 -9
- package/lib/form/helpers.js +30 -5
- package/lib/form/index.js +91 -36
- package/lib/form/types.d.ts +6 -6
- package/lib/form/withFieldHOC.js +34 -15
- package/lib/form/withFormSecurity.js +28 -5
- package/lib/gridlayout/GridCol.js +11 -5
- package/lib/gridlayout/GridRow.js +9 -3
- package/lib/gridlayout/index.d.ts +1 -4
- package/lib/gridlayout/index.js +4 -0
- package/lib/icons/index.js +26 -16
- package/lib/icons/types.d.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +10 -0
- package/lib/inputs/base/InputTextBase.js +73 -49
- package/lib/inputs/base/helpers.js +19 -6
- package/lib/inputs/color/index.js +38 -11
- package/lib/inputs/date/Dialog.js +7 -2
- package/lib/inputs/date/Dropdown.js +8 -1
- package/lib/inputs/date/helpers.js +11 -2
- package/lib/inputs/date/index.js +101 -48
- package/lib/inputs/file/DefaultFile.js +42 -13
- package/lib/inputs/file/DragDropFile.js +90 -37
- package/lib/inputs/file/File.js +25 -4
- package/lib/inputs/file/FileButtonSettings.js +11 -5
- package/lib/inputs/file/helpers.js +5 -0
- package/lib/inputs/file/index.d.ts +1 -4
- package/lib/inputs/file/index.js +6 -0
- package/lib/inputs/file/types.d.ts +1 -1
- package/lib/inputs/inputHOC.js +34 -10
- package/lib/inputs/mask/BaseMask.js +17 -1
- package/lib/inputs/mask/Cnpj.js +37 -12
- package/lib/inputs/mask/Cpf.js +33 -10
- package/lib/inputs/mask/Phone.js +6 -0
- package/lib/inputs/mask/ZipCode.js +6 -0
- package/lib/inputs/mask/helpers.js +20 -8
- package/lib/inputs/mask/imaskHOC.js +83 -52
- package/lib/inputs/mask/index.d.ts +1 -4
- package/lib/inputs/mask/index.js +7 -0
- package/lib/inputs/multiSelect/ActionButtons.js +13 -4
- package/lib/inputs/multiSelect/Dropdown.js +46 -23
- package/lib/inputs/multiSelect/helper.d.ts +1 -1
- package/lib/inputs/multiSelect/helper.js +5 -3
- package/lib/inputs/multiSelect/index.js +105 -41
- package/lib/inputs/multiSelect/types.d.ts +2 -2
- package/lib/inputs/number/BaseNumber.js +16 -3
- package/lib/inputs/number/Currency.js +7 -1
- package/lib/inputs/number/Decimal.js +5 -0
- package/lib/inputs/number/format_number.js +7 -0
- package/lib/inputs/number/index.js +13 -3
- package/lib/inputs/period/Dialog.js +7 -2
- package/lib/inputs/period/Dropdown.js +7 -0
- package/lib/inputs/period/PeriodList.js +7 -1
- package/lib/inputs/period/helper.js +12 -2
- package/lib/inputs/period/index.js +114 -43
- package/lib/inputs/period/types.d.ts +1 -1
- package/lib/inputs/search/index.js +63 -18
- package/lib/inputs/select/ActionButtons.js +12 -4
- package/lib/inputs/select/Dropdown.js +49 -29
- package/lib/inputs/select/helper.d.ts +1 -1
- package/lib/inputs/select/helper.js +27 -11
- package/lib/inputs/select/index.js +22 -7
- package/lib/inputs/select/multiple/Selecteds.js +8 -4
- package/lib/inputs/select/multiple/index.js +100 -39
- package/lib/inputs/select/simple/index.js +123 -59
- package/lib/inputs/select/types.d.ts +4 -4
- package/lib/inputs/text/index.js +5 -1
- package/lib/inputs/text/types.d.ts +1 -1
- package/lib/inputs/textarea/index.js +10 -4
- package/lib/inputs/types.d.ts +1 -1
- package/lib/internals/withTooltip.js +70 -25
- package/lib/labelMessages/index.js +45 -25
- package/lib/labels/DangerLabel.js +11 -1
- package/lib/labels/DefaultLabel.js +41 -19
- package/lib/labels/InfoLabel.js +11 -1
- package/lib/labels/PrimaryLabel.js +11 -1
- package/lib/labels/SuccessLabel.js +11 -1
- package/lib/labels/WarningLabel.js +11 -1
- package/lib/labels/index.d.ts +1 -4
- package/lib/labels/index.js +10 -0
- package/lib/labels/label_container/index.js +7 -3
- package/lib/list/Header.js +7 -3
- package/lib/list/Item.js +68 -33
- package/lib/list/Separator.js +4 -0
- package/lib/list/helpers.js +4 -0
- package/lib/list/index.js +60 -25
- package/lib/list/types.d.ts +1 -1
- package/lib/menus/float/MenuItem.js +26 -9
- package/lib/menus/float/SubMenuContainer.js +17 -5
- package/lib/menus/float/helpers.js +4 -0
- package/lib/menus/float/index.js +21 -8
- package/lib/menus/index.d.ts +1 -4
- package/lib/menus/index.js +3 -0
- package/lib/menus/sidenav/ExpandMenu.js +7 -2
- package/lib/menus/sidenav/MenuLink.js +12 -3
- package/lib/menus/sidenav/NavMenuGroup.js +12 -3
- package/lib/menus/sidenav/NavMenuItem.js +56 -27
- package/lib/menus/sidenav/NavSubMenuItem.js +27 -8
- package/lib/menus/sidenav/helpers.js +9 -0
- package/lib/menus/sidenav/index.js +75 -26
- package/lib/menus/sidenav/popup_menu_search/EmptyList.js +7 -2
- package/lib/menus/sidenav/popup_menu_search/index.js +45 -15
- package/lib/menus/sidenav/types.d.ts +1 -1
- package/lib/noPermission/index.js +6 -0
- package/lib/panel/Content.d.ts +1 -1
- package/lib/panel/Content.js +22 -7
- package/lib/panel/DangerPanel.d.ts +1 -1
- package/lib/panel/DangerPanel.js +7 -0
- package/lib/panel/Default.d.ts +1 -1
- package/lib/panel/Default.js +44 -20
- package/lib/panel/Header.d.ts +1 -1
- package/lib/panel/Header.js +27 -12
- package/lib/panel/InfoPanel.d.ts +1 -1
- package/lib/panel/InfoPanel.js +7 -0
- package/lib/panel/PrimaryPanel.d.ts +1 -1
- package/lib/panel/PrimaryPanel.js +7 -0
- package/lib/panel/SuccessPanel.d.ts +1 -1
- package/lib/panel/SuccessPanel.js +7 -0
- package/lib/panel/ToolBar.d.ts +1 -1
- package/lib/panel/ToolBar.js +5 -0
- package/lib/panel/WarningPanel.d.ts +1 -1
- package/lib/panel/WarningPanel.js +7 -0
- package/lib/panel/helpers.d.ts +1 -1
- package/lib/panel/helpers.js +10 -2
- package/lib/panel/index.d.ts +2 -5
- package/lib/panel/index.js +11 -0
- package/lib/panel/types.d.ts +1 -1
- package/lib/permissionValidations.js +15 -3
- package/lib/popover/PopoverText.js +4 -0
- package/lib/popover/PopoverTitle.js +4 -0
- package/lib/popover/index.js +23 -12
- package/lib/progress/Bar.js +33 -20
- package/lib/progress/index.js +14 -5
- package/lib/radio/index.js +46 -23
- package/lib/skeleton/SkeletonContainer.js +9 -3
- package/lib/skeleton/index.js +22 -10
- package/lib/spinner/SpinnerLoading.js +7 -3
- package/lib/spinner/index.js +40 -18
- package/lib/split/Split.js +83 -32
- package/lib/split/SplitSide.js +18 -6
- package/lib/split/helpers.d.ts +1 -1
- package/lib/split/helpers.js +4 -0
- package/lib/split/index.d.ts +1 -4
- package/lib/split/index.js +5 -0
- package/lib/table/Body.js +29 -15
- package/lib/table/Header.js +28 -5
- package/lib/table/HeaderColumn.js +21 -10
- package/lib/table/Row.js +28 -18
- package/lib/table/RowColumn.js +29 -12
- package/lib/table/helpers.js +7 -0
- package/lib/table/index.js +62 -32
- package/lib/table/types.d.ts +1 -1
- package/lib/tabs/DropdownItems.js +21 -12
- package/lib/tabs/Menu.js +15 -5
- package/lib/tabs/MenuItems.js +33 -23
- package/lib/tabs/Panel.js +39 -14
- package/lib/tabs/index.js +113 -46
- package/lib/tabs/tabHelpers.js +16 -3
- package/lib/toolbar/ButtonBar.js +29 -13
- package/lib/toolbar/LabelBar.js +28 -11
- package/lib/toolbar/Separator.js +4 -0
- package/lib/toolbar/ToolBarGroup.js +6 -2
- package/lib/toolbar/helpers.js +2 -0
- package/lib/toolbar/index.js +23 -7
- package/lib/tooltip/index.js +25 -10
- package/lib/tooltip/types.d.ts +1 -1
- package/lib/treetable/Body.js +27 -9
- package/lib/treetable/Header.js +11 -1
- package/lib/treetable/Row.js +113 -58
- package/lib/treetable/helpers.js +10 -0
- package/lib/treetable/index.js +11 -0
- package/lib/treeview/Header.js +6 -2
- package/lib/treeview/Node.js +111 -47
- package/lib/treeview/constants.js +4 -0
- package/lib/treeview/index.js +134 -54
- package/lib/treeview/types.d.ts +2 -2
- package/lib/treeview_old/Header.js +6 -1
- package/lib/treeview_old/Node.js +32 -5
- package/lib/treeview_old/index.js +9 -1
- package/lib/{types-90c43ae1.d.ts → types-3c6f1c20.d.ts} +1 -1
- package/lib/uitour/index.js +73 -33
- package/lib/uitour/types.d.ts +1 -1
- package/package.json +1 -1
package/lib/radio/index.js
CHANGED
|
@@ -1,59 +1,78 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
9
12
|
require("../assets/styles/radio.scss");
|
|
13
|
+
|
|
10
14
|
var _permissionValidations = require("../permissionValidations");
|
|
15
|
+
|
|
11
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
+
|
|
12
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
+
|
|
13
20
|
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); }
|
|
21
|
+
|
|
14
22
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
23
|
+
|
|
15
24
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
25
|
+
|
|
16
26
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
-
|
|
18
|
-
function
|
|
27
|
+
|
|
28
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
29
|
+
|
|
30
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
31
|
+
|
|
19
32
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
|
+
|
|
20
34
|
/**
|
|
21
35
|
* IMPORTANTE: Caso seja necessário alterar o nome do componente, deverá ser refatorado
|
|
22
36
|
* o componente Field dentro do componente Form, pois o mesmo leva em consideração o tipo do
|
|
23
37
|
* componente para gerar propriedades customizadas.
|
|
24
38
|
*/
|
|
25
|
-
|
|
26
39
|
var Radio = function Radio(_ref) {
|
|
27
40
|
var id = _ref.id,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
label = _ref.label,
|
|
42
|
+
value = _ref.value,
|
|
43
|
+
checked = _ref.checked,
|
|
44
|
+
_onChange = _ref.onChange,
|
|
45
|
+
_ref$name = _ref.name,
|
|
46
|
+
name = _ref$name === void 0 ? '' : _ref$name,
|
|
47
|
+
_ref$disabled = _ref.disabled,
|
|
48
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
49
|
+
_ref$required = _ref.required,
|
|
50
|
+
required = _ref$required === void 0 ? false : _ref$required,
|
|
51
|
+
_ref$skeletonize = _ref.skeletonize,
|
|
52
|
+
skeletonize = _ref$skeletonize === void 0 ? false : _ref$skeletonize,
|
|
53
|
+
_ref$defaultChecked = _ref.defaultChecked,
|
|
54
|
+
defaultChecked = _ref$defaultChecked === void 0 ? false : _ref$defaultChecked,
|
|
55
|
+
permissionAttr = _ref.permissionAttr;
|
|
56
|
+
|
|
43
57
|
var _useState = (0, _react.useState)(checked),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
58
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
59
|
+
isChecked = _useState2[0],
|
|
60
|
+
setIsChecked = _useState2[1];
|
|
61
|
+
|
|
47
62
|
var options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible];
|
|
63
|
+
|
|
48
64
|
var _useState3 = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr)),
|
|
49
|
-
|
|
50
|
-
|
|
65
|
+
_useState4 = _slicedToArray(_useState3, 1),
|
|
66
|
+
onDenied = _useState4[0];
|
|
67
|
+
|
|
51
68
|
(0, _react.useEffect)(function () {
|
|
52
69
|
if (checked !== isChecked) setIsChecked(checked);
|
|
53
70
|
}, [checked]);
|
|
71
|
+
|
|
54
72
|
var shouldDisable = function shouldDisable() {
|
|
55
73
|
return disabled || !!onDenied.disabled || skeletonize;
|
|
56
74
|
};
|
|
75
|
+
|
|
57
76
|
var getCustomProps = function getCustomProps() {
|
|
58
77
|
var customProps = {};
|
|
59
78
|
var checkProps = defaultChecked && !checked ? {
|
|
@@ -62,6 +81,7 @@ var Radio = function Radio(_ref) {
|
|
|
62
81
|
checked: isChecked
|
|
63
82
|
};
|
|
64
83
|
customProps = _extends({}, checkProps);
|
|
84
|
+
|
|
65
85
|
if (_onChange && !shouldDisable()) {
|
|
66
86
|
customProps = _extends({}, customProps, {
|
|
67
87
|
onChange: function onChange(e) {
|
|
@@ -72,8 +92,10 @@ var Radio = function Radio(_ref) {
|
|
|
72
92
|
tabIndex: '0'
|
|
73
93
|
});
|
|
74
94
|
}
|
|
95
|
+
|
|
75
96
|
return customProps;
|
|
76
97
|
};
|
|
98
|
+
|
|
77
99
|
if (onDenied.unvisible) return null;
|
|
78
100
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
79
101
|
className: "radio-button ".concat(disabled ? 'disabled' : '', " ").concat(skeletonize ? '-skeletonized' : '')
|
|
@@ -90,5 +112,6 @@ var Radio = function Radio(_ref) {
|
|
|
90
112
|
htmlFor: id
|
|
91
113
|
}, /*#__PURE__*/_react.default.createElement("span", null, label)));
|
|
92
114
|
};
|
|
115
|
+
|
|
93
116
|
var _default = Radio;
|
|
94
117
|
exports.default = _default;
|
|
@@ -4,20 +4,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
8
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
9
12
|
var SkeletonContainer = function SkeletonContainer(_ref) {
|
|
10
13
|
var children = _ref.children,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
row = _ref.row,
|
|
15
|
+
customClass = _ref.customClass,
|
|
16
|
+
style = _ref.style;
|
|
17
|
+
|
|
14
18
|
var getClass = function getClass() {
|
|
15
19
|
return "skeletoncontainer-component ".concat(customClass, "\n ").concat(row && '-row');
|
|
16
20
|
};
|
|
21
|
+
|
|
17
22
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
18
23
|
className: getClass(),
|
|
19
24
|
style: style
|
|
20
25
|
}, children);
|
|
21
26
|
};
|
|
27
|
+
|
|
22
28
|
var _default = SkeletonContainer;
|
|
23
29
|
exports.default = _default;
|
package/lib/skeleton/index.js
CHANGED
|
@@ -10,44 +10,56 @@ Object.defineProperty(exports, "SkeletonContainer", {
|
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
exports.default = void 0;
|
|
13
|
+
|
|
13
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
14
16
|
var _gridlayout = _interopRequireDefault(require("../gridlayout"));
|
|
17
|
+
|
|
15
18
|
var _SkeletonContainer = _interopRequireDefault(require("./SkeletonContainer"));
|
|
19
|
+
|
|
16
20
|
require("../assets/styles/skeleton.scss");
|
|
21
|
+
|
|
17
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
18
24
|
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); }
|
|
25
|
+
|
|
19
26
|
var Skeleton = function Skeleton(props) {
|
|
20
27
|
var _props$customClass = props.customClass,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
customClass = _props$customClass === void 0 ? '' : _props$customClass,
|
|
29
|
+
style = props.style,
|
|
30
|
+
width = props.width,
|
|
31
|
+
height = props.height,
|
|
32
|
+
round = props.round,
|
|
33
|
+
_props$color = props.color,
|
|
34
|
+
color = _props$color === void 0 ? 'default' : _props$color,
|
|
35
|
+
_props$size = props.size,
|
|
36
|
+
size = _props$size === void 0 ? 'medium' : _props$size,
|
|
37
|
+
gridLayout = props.gridLayout;
|
|
31
38
|
var customStyles = {
|
|
32
39
|
width: width,
|
|
33
40
|
height: height
|
|
34
41
|
};
|
|
42
|
+
|
|
35
43
|
var getClass = function getClass() {
|
|
36
44
|
return "skeleton-component ".concat(customClass, "\n ").concat(color && "-".concat(color), "\n ").concat(round && '-round', "\n ").concat(round && size && "-".concat(size));
|
|
37
45
|
};
|
|
46
|
+
|
|
38
47
|
var renderContent = function renderContent() {
|
|
39
48
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
40
49
|
className: getClass(),
|
|
41
50
|
style: _extends({}, customStyles, style)
|
|
42
51
|
});
|
|
43
52
|
};
|
|
53
|
+
|
|
44
54
|
if (gridLayout !== undefined) {
|
|
45
55
|
return /*#__PURE__*/_react.default.createElement(_gridlayout.default, {
|
|
46
56
|
customClass: "-withskeleton",
|
|
47
57
|
cols: gridLayout
|
|
48
58
|
}, renderContent());
|
|
49
59
|
}
|
|
60
|
+
|
|
50
61
|
return renderContent();
|
|
51
62
|
};
|
|
63
|
+
|
|
52
64
|
var _default = Skeleton;
|
|
53
65
|
exports.default = _default;
|
|
@@ -4,13 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
8
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
9
12
|
var SpinnerLoading = function SpinnerLoading(_ref) {
|
|
10
13
|
var _ref$color = _ref.color,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
color = _ref$color === void 0 ? '#3B3B3B' : _ref$color,
|
|
15
|
+
_ref$size = _ref.size,
|
|
16
|
+
size = _ref$size === void 0 ? '50px' : _ref$size;
|
|
14
17
|
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
15
18
|
"data-testid": "spinner",
|
|
16
19
|
className: "lds-spinner spinnerloading",
|
|
@@ -216,5 +219,6 @@ var SpinnerLoading = function SpinnerLoading(_ref) {
|
|
|
216
219
|
repeatCount: "indefinite"
|
|
217
220
|
}))));
|
|
218
221
|
};
|
|
222
|
+
|
|
219
223
|
var _default = SpinnerLoading;
|
|
220
224
|
exports.default = _default;
|
package/lib/spinner/index.js
CHANGED
|
@@ -1,41 +1,57 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
9
12
|
var _SpinnerLoading = _interopRequireDefault(require("./SpinnerLoading"));
|
|
13
|
+
|
|
10
14
|
require("../assets/styles/spinner.scss");
|
|
15
|
+
|
|
11
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
12
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
|
|
13
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
|
|
14
22
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
23
|
+
|
|
15
24
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
25
|
+
|
|
16
26
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
-
|
|
18
|
-
function
|
|
27
|
+
|
|
28
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
29
|
+
|
|
30
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
31
|
+
|
|
19
32
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
|
+
|
|
20
34
|
var Spinner = function Spinner(props) {
|
|
21
35
|
var _props$align = props.align,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
align = _props$align === void 0 ? 'center' : _props$align,
|
|
37
|
+
customClass = props.customClass,
|
|
38
|
+
style = props.style,
|
|
39
|
+
text = props.text,
|
|
40
|
+
_props$visible = props.visible,
|
|
41
|
+
visible = _props$visible === void 0 ? true : _props$visible,
|
|
42
|
+
_props$delayTime = props.delayTime,
|
|
43
|
+
delayTime = _props$delayTime === void 0 ? 1000 : _props$delayTime,
|
|
44
|
+
heightAuto = props.heightAuto,
|
|
45
|
+
_props$color = props.color,
|
|
46
|
+
color = _props$color === void 0 ? '#3B3B3B' : _props$color,
|
|
47
|
+
_props$size = props.size,
|
|
48
|
+
size = _props$size === void 0 ? '50px' : _props$size;
|
|
49
|
+
|
|
35
50
|
var _useState = (0, _react.useState)(!!delayTime),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
51
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
52
|
+
delay = _useState2[0],
|
|
53
|
+
setDelay = _useState2[1];
|
|
54
|
+
|
|
39
55
|
var delayTimeout = (0, _react.useRef)(null);
|
|
40
56
|
(0, _react.useEffect)(function () {
|
|
41
57
|
if (delayTime) {
|
|
@@ -43,19 +59,23 @@ var Spinner = function Spinner(props) {
|
|
|
43
59
|
setDelay(false);
|
|
44
60
|
}, delayTime);
|
|
45
61
|
}
|
|
62
|
+
|
|
46
63
|
return function () {
|
|
47
64
|
if (delayTimeout.current) {
|
|
48
65
|
clearTimeout(delayTimeout.current);
|
|
49
66
|
}
|
|
50
67
|
};
|
|
51
68
|
}, []);
|
|
69
|
+
|
|
52
70
|
var getCssClass = function getCssClass() {
|
|
53
71
|
var css = "spinner-component -".concat(align, " ").concat(customClass, " ");
|
|
54
72
|
if (heightAuto) css = "".concat(css, " -heightauto");
|
|
55
73
|
return css;
|
|
56
74
|
};
|
|
75
|
+
|
|
57
76
|
if (delay) return null;
|
|
58
77
|
if (!visible) return null;
|
|
78
|
+
|
|
59
79
|
if (align !== 'none') {
|
|
60
80
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
61
81
|
style: style,
|
|
@@ -65,10 +85,12 @@ var Spinner = function Spinner(props) {
|
|
|
65
85
|
size: size
|
|
66
86
|
}), align === 'left' && text, align === 'center' && text);
|
|
67
87
|
}
|
|
88
|
+
|
|
68
89
|
return /*#__PURE__*/_react.default.createElement(_SpinnerLoading.default, {
|
|
69
90
|
color: color,
|
|
70
91
|
size: size
|
|
71
92
|
});
|
|
72
93
|
};
|
|
94
|
+
|
|
73
95
|
var _default = Spinner;
|
|
74
96
|
exports.default = _default;
|