linear-react-components-ui 1.1.14-beta.0 → 1.1.14-beta.1
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/.eslintrc.json +45 -77
- package/.gitlab-ci.yml +13 -5
- package/.nvmrc +1 -0
- package/.vscode/settings.json +12 -3
- package/babel.config.json +4 -4
- package/lib/@types/SizePixels.d.ts +1 -1
- package/lib/alerts/AlertContainer.js +48 -57
- package/lib/alerts/AlertProvider.js +36 -54
- package/lib/alerts/BaseAlert.js +12 -19
- package/lib/alerts/Message.d.ts +1 -1
- package/lib/alerts/Message.js +78 -45
- package/lib/alerts/helpers.js +2 -3
- package/lib/alerts/index.js +3 -4
- package/lib/alerts/types.d.ts +1 -0
- package/lib/alerts/withAlert.js +10 -11
- package/lib/assets/styles/alerts.scss +4 -7
- package/lib/assets/styles/button.scss +11 -9
- package/lib/assets/styles/checkbox.scss +45 -38
- package/lib/assets/styles/colors.scss +3 -1
- package/lib/assets/styles/commons.scss +1 -0
- package/lib/assets/styles/dialog.scss +37 -20
- package/lib/assets/styles/drawers.scss +9 -6
- package/lib/assets/styles/error.scss +9 -0
- package/lib/assets/styles/fieldset.scss +3 -0
- package/lib/assets/styles/gridlayout.scss +0 -2
- package/lib/assets/styles/hint.scss +21 -0
- package/lib/assets/styles/icon.scss +31 -4
- package/lib/assets/styles/input.scss +7 -7
- package/lib/assets/styles/multiSelect.scss +6 -1
- package/lib/assets/styles/radio.scss +37 -35
- package/lib/assets/styles/select.scss +13 -7
- package/lib/assets/styles/table.scss +9 -1
- package/lib/assets/styles/tabs.scss +28 -18
- package/lib/assets/styles/textContent.scss +9 -0
- package/lib/avatar/index.js +41 -41
- package/lib/badge/index.js +12 -14
- package/lib/buttons/ActivateButton.js +6 -9
- package/lib/buttons/AddButton.js +9 -12
- package/lib/buttons/Button.js +11 -12
- package/lib/buttons/ButtonGroups.js +6 -5
- package/lib/buttons/CancelButton.js +10 -9
- package/lib/buttons/DangerButton.js +10 -9
- package/lib/buttons/DefaultButton.js +90 -90
- package/lib/buttons/DestroyButton.js +10 -9
- package/lib/buttons/EditButton.js +6 -9
- package/lib/buttons/InactivateButton.js +6 -9
- package/lib/buttons/InfoButton.js +10 -9
- package/lib/buttons/PrimaryButton.js +10 -9
- package/lib/buttons/RestoreButton.js +6 -9
- package/lib/buttons/SaveButton.js +10 -9
- package/lib/buttons/SuccessButton.js +10 -9
- package/lib/buttons/WarningButton.js +10 -9
- package/lib/buttons/button_container/index.js +17 -21
- package/lib/buttons/index.js +16 -17
- package/lib/buttons/split_button/index.js +22 -25
- package/lib/buttons/types.d.ts +1 -0
- package/lib/calendar/DangerCalendar.js +10 -9
- package/lib/calendar/InfoCalendar.js +10 -9
- package/lib/calendar/PrimaryCalendar.js +10 -9
- package/lib/calendar/SuccessCalendar.js +10 -9
- package/lib/calendar/WarningCalendar.js +10 -9
- package/lib/calendar/base/Day.js +13 -12
- package/lib/calendar/base/Month.js +13 -18
- package/lib/calendar/base/Week.js +13 -18
- package/lib/calendar/base/helpers.js +12 -12
- package/lib/calendar/base/index.js +30 -44
- package/lib/calendar/index.js +7 -8
- package/lib/checkbox/Label.js +20 -10
- package/lib/checkbox/index.d.ts +2 -2
- package/lib/checkbox/index.js +83 -97
- package/lib/checkbox/types.d.ts +2 -1
- package/lib/dialog/Alert.js +5 -6
- package/lib/dialog/Custom.js +16 -18
- package/lib/dialog/Error.js +5 -6
- package/lib/dialog/Information.js +5 -6
- package/lib/dialog/Question.js +13 -14
- package/lib/dialog/Warning.js +7 -7
- package/lib/dialog/base/Content.js +8 -6
- package/lib/dialog/base/Footer.js +5 -8
- package/lib/dialog/base/Header.js +29 -29
- package/lib/dialog/base/index.d.ts +8 -2
- package/lib/dialog/base/index.js +109 -105
- package/lib/dialog/base/style.js +7 -10
- package/lib/dialog/form/index.js +31 -34
- package/lib/dialog/index.js +8 -9
- package/lib/dialog/types.d.ts +8 -13
- package/lib/drawer/Content.js +12 -11
- package/lib/drawer/Drawer.js +74 -88
- package/lib/drawer/Header.js +34 -37
- package/lib/drawer/helpers.js +3 -4
- package/lib/drawer/index.js +4 -5
- package/lib/dropdown/Popup.d.ts +1 -1
- package/lib/dropdown/Popup.js +41 -42
- package/lib/dropdown/helper.js +3 -5
- package/lib/dropdown/types.d.ts +1 -0
- package/lib/dropdown/withDropdown.js +39 -60
- package/lib/fieldset/index.js +52 -58
- package/lib/fieldset/types.d.ts +2 -0
- package/lib/form/Field.d.ts +2 -0
- package/lib/form/Field.js +73 -79
- package/lib/form/FieldArray.d.ts +2 -0
- package/lib/form/FieldArray.js +70 -94
- package/lib/form/FieldNumber.d.ts +2 -0
- package/lib/form/FieldNumber.js +39 -48
- package/lib/form/FieldPeriod.d.ts +2 -0
- package/lib/form/FieldPeriod.js +48 -54
- package/lib/form/helpers.d.ts +2 -0
- package/lib/form/helpers.js +22 -27
- package/lib/form/index.d.ts +2 -0
- package/lib/form/index.js +114 -146
- package/lib/form/types.d.ts +6 -2
- package/lib/form/withFieldHOC.d.ts +2 -0
- package/lib/form/withFieldHOC.js +32 -39
- package/lib/form/withFormSecurity.d.ts +2 -0
- package/lib/form/withFormSecurity.js +27 -35
- package/lib/gridlayout/GridCol.js +14 -14
- package/lib/gridlayout/GridRow.js +18 -12
- package/lib/gridlayout/index.js +3 -4
- package/lib/gridlayout/types.d.ts +1 -1
- package/lib/hint/helpers.d.ts +3 -0
- package/lib/hint/helpers.js +21 -0
- package/lib/hint/index.d.ts +2 -1
- package/lib/hint/index.js +18 -29
- package/lib/hint/types.d.ts +3 -0
- package/lib/icons/helper.d.ts +4 -0
- package/lib/icons/helper.js +7 -4
- package/lib/icons/index.d.ts +3 -2
- package/lib/icons/index.js +43 -48
- package/lib/icons/types.d.ts +22 -9
- package/lib/index.d.ts +2 -1
- package/lib/index.js +10 -10
- package/lib/inputs/base/InputTextBase.d.ts +2 -0
- package/lib/inputs/base/InputTextBase.js +149 -113
- package/lib/inputs/base/Label.d.ts +14 -0
- package/lib/inputs/base/Label.js +35 -0
- package/lib/inputs/base/helpers.d.ts +3 -2
- package/lib/inputs/base/helpers.js +21 -26
- package/lib/inputs/base/types.d.ts +17 -2
- package/lib/inputs/color/index.js +29 -40
- package/lib/inputs/date/Dialog.d.ts +2 -0
- package/lib/inputs/date/Dialog.js +9 -10
- package/lib/inputs/date/Dropdown.d.ts +2 -0
- package/lib/inputs/date/Dropdown.js +12 -11
- package/lib/inputs/date/helpers.d.ts +2 -0
- package/lib/inputs/date/helpers.js +14 -14
- package/lib/inputs/date/index.d.ts +2 -0
- package/lib/inputs/date/index.js +127 -152
- package/lib/inputs/date/types.d.ts +4 -1
- package/lib/inputs/{mask/imaskHOC.d.ts → errorMessage/index.d.ts} +5 -7
- package/lib/inputs/errorMessage/index.js +26 -0
- package/lib/inputs/file/DefaultFile.d.ts +2 -0
- package/lib/inputs/file/DefaultFile.js +47 -74
- package/lib/inputs/file/DragDropFile.d.ts +2 -0
- package/lib/inputs/file/DragDropFile.js +97 -149
- package/lib/inputs/file/File.d.ts +3 -1
- package/lib/inputs/file/File.js +26 -32
- package/lib/inputs/file/FileButtonSettings.d.ts +2 -0
- package/lib/inputs/file/FileButtonSettings.js +13 -13
- package/lib/inputs/file/helpers.d.ts +2 -0
- package/lib/inputs/file/helpers.js +4 -6
- package/lib/inputs/file/index.d.ts +2 -0
- package/lib/inputs/file/index.js +4 -5
- package/lib/inputs/file/types.d.ts +2 -0
- package/lib/inputs/inputHOC.d.ts +2 -1
- package/lib/inputs/inputHOC.js +21 -34
- package/lib/inputs/mask/BaseMask.d.ts +4 -5
- package/lib/inputs/mask/BaseMask.js +125 -37
- package/lib/inputs/mask/Cnpj.d.ts +2 -0
- package/lib/inputs/mask/Cnpj.js +18 -31
- package/lib/inputs/mask/Cpf.d.ts +2 -0
- package/lib/inputs/mask/Cpf.js +20 -37
- package/lib/inputs/mask/Phone.d.ts +2 -0
- package/lib/inputs/mask/Phone.js +7 -6
- package/lib/inputs/mask/ZipCode.d.ts +2 -0
- package/lib/inputs/mask/ZipCode.js +6 -9
- package/lib/inputs/mask/helpers.d.ts +50 -12
- package/lib/inputs/mask/helpers.js +77 -37
- package/lib/inputs/mask/index.d.ts +4 -2
- package/lib/inputs/mask/index.js +6 -7
- package/lib/inputs/mask/types.d.ts +18 -17
- package/lib/inputs/multiSelect/ActionButtons.d.ts +2 -0
- package/lib/inputs/multiSelect/ActionButtons.js +23 -22
- package/lib/inputs/multiSelect/Dropdown.d.ts +2 -0
- package/lib/inputs/multiSelect/Dropdown.js +50 -67
- package/lib/inputs/multiSelect/helper.d.ts +2 -0
- package/lib/inputs/multiSelect/helper.js +8 -7
- package/lib/inputs/multiSelect/index.d.ts +2 -0
- package/lib/inputs/multiSelect/index.js +83 -135
- package/lib/inputs/multiSelect/types.d.ts +2 -0
- package/lib/inputs/number/BaseNumber.d.ts +2 -1
- package/lib/inputs/number/BaseNumber.js +25 -24
- package/lib/inputs/number/Currency.d.ts +2 -1
- package/lib/inputs/number/Currency.js +8 -8
- package/lib/inputs/number/Decimal.d.ts +2 -1
- package/lib/inputs/number/Decimal.js +3 -6
- package/lib/inputs/number/format_number.js +5 -5
- package/lib/inputs/number/index.d.ts +2 -1
- package/lib/inputs/number/index.js +20 -32
- package/lib/inputs/number/types.d.ts +2 -9
- package/lib/inputs/period/Dialog.d.ts +3 -1
- package/lib/inputs/period/Dialog.js +9 -10
- package/lib/inputs/period/Dropdown.d.ts +2 -0
- package/lib/inputs/period/Dropdown.js +8 -9
- package/lib/inputs/period/PeriodList.d.ts +2 -0
- package/lib/inputs/period/PeriodList.js +14 -13
- package/lib/inputs/period/helper.d.ts +2 -0
- package/lib/inputs/period/helper.js +34 -37
- package/lib/inputs/period/index.d.ts +2 -0
- package/lib/inputs/period/index.js +162 -196
- package/lib/inputs/period/types.d.ts +3 -1
- package/lib/inputs/search/index.d.ts +2 -1
- package/lib/inputs/search/index.js +45 -68
- package/lib/inputs/select/ActionButtons.d.ts +2 -1
- package/lib/inputs/select/ActionButtons.js +25 -35
- package/lib/inputs/select/Dropdown.d.ts +2 -1
- package/lib/inputs/select/Dropdown.js +41 -60
- package/lib/inputs/select/helper.d.ts +2 -1
- package/lib/inputs/select/helper.js +49 -43
- package/lib/inputs/select/index.d.ts +2 -0
- package/lib/inputs/select/index.js +13 -12
- package/lib/inputs/select/multiple/Selecteds.d.ts +3 -1
- package/lib/inputs/select/multiple/Selecteds.js +17 -22
- package/lib/inputs/select/multiple/index.d.ts +2 -0
- package/lib/inputs/select/multiple/index.js +125 -162
- package/lib/inputs/select/simple/index.d.ts +2 -0
- package/lib/inputs/select/simple/index.js +154 -179
- package/lib/inputs/select/types.d.ts +5 -2
- package/lib/inputs/text/index.js +3 -6
- package/lib/inputs/textarea/index.d.ts +2 -0
- package/lib/inputs/textarea/index.js +10 -10
- package/lib/inputs/textarea/types.d.ts +2 -0
- package/lib/inputs/types.d.ts +12 -9
- package/lib/internals/colorStyles.js +2 -3
- package/lib/internals/constants.js +2 -4
- package/lib/internals/types.d.ts +5 -2
- package/lib/internals/withTooltip.d.ts +3 -2
- package/lib/internals/withTooltip.js +76 -76
- package/lib/labelMessages/index.js +22 -42
- package/lib/labels/DangerLabel.js +10 -9
- package/lib/labels/DefaultLabel.js +26 -40
- package/lib/labels/InfoLabel.js +10 -9
- package/lib/labels/PrimaryLabel.js +10 -9
- package/lib/labels/SuccessLabel.js +10 -9
- package/lib/labels/WarningLabel.js +10 -9
- package/lib/labels/index.js +8 -9
- package/lib/labels/label_container/index.js +8 -8
- package/lib/list/Header.js +9 -8
- package/lib/list/Item.js +74 -70
- package/lib/list/Separator.js +5 -8
- package/lib/list/helpers.js +4 -6
- package/lib/list/index.js +74 -101
- package/lib/menus/float/MenuItem.js +19 -20
- package/lib/menus/float/SubMenuContainer.js +27 -33
- package/lib/menus/float/helpers.js +3 -4
- package/lib/menus/float/index.js +17 -18
- package/lib/menus/float/types.d.ts +1 -1
- package/lib/menus/index.js +2 -3
- package/lib/menus/sidenav/ExpandMenu.js +9 -8
- package/lib/menus/sidenav/MenuLink.js +10 -9
- package/lib/menus/sidenav/NavMenuGroup.js +12 -11
- package/lib/menus/sidenav/NavMenuItem.js +48 -62
- package/lib/menus/sidenav/NavSubMenuItem.js +20 -25
- package/lib/menus/sidenav/helpers.js +6 -9
- package/lib/menus/sidenav/index.js +85 -113
- package/lib/menus/sidenav/popup_menu_search/EmptyList.js +7 -7
- package/lib/menus/sidenav/popup_menu_search/index.js +64 -84
- package/lib/menus/sidenav/types.d.ts +1 -1
- package/lib/noPermission/index.js +14 -17
- package/lib/panel/Content.d.ts +1 -1
- package/lib/panel/Content.js +47 -60
- package/lib/panel/DangerPanel.d.ts +1 -1
- package/lib/panel/DangerPanel.js +6 -9
- package/lib/panel/Default.d.ts +1 -1
- package/lib/panel/Default.js +45 -60
- package/lib/panel/Header.d.ts +1 -1
- package/lib/panel/Header.js +32 -30
- package/lib/panel/InfoPanel.d.ts +1 -1
- package/lib/panel/InfoPanel.js +6 -9
- package/lib/panel/PrimaryPanel.d.ts +1 -1
- package/lib/panel/PrimaryPanel.js +6 -9
- package/lib/panel/SuccessPanel.d.ts +1 -1
- package/lib/panel/SuccessPanel.js +6 -9
- package/lib/panel/ToolBar.d.ts +1 -1
- package/lib/panel/ToolBar.js +6 -5
- package/lib/panel/WarningPanel.d.ts +1 -1
- package/lib/panel/WarningPanel.js +6 -9
- package/lib/panel/helpers.d.ts +7 -2
- package/lib/panel/helpers.js +12 -24
- package/lib/panel/index.d.ts +1 -1
- package/lib/panel/index.js +9 -10
- package/lib/panel/types.d.ts +46 -5
- package/lib/permissionValidations.js +24 -29
- package/lib/popover/PopoverText.js +6 -5
- package/lib/popover/PopoverTitle.js +6 -5
- package/lib/popover/index.js +15 -19
- package/lib/progress/Bar.js +31 -37
- package/lib/progress/index.js +18 -20
- package/lib/radio/index.js +36 -57
- package/lib/shortcuts/index.js +10 -9
- package/lib/skeleton/SkeletonContainer.js +10 -11
- package/lib/skeleton/index.js +27 -34
- package/lib/spinner/SpinnerLoading.js +7 -8
- package/lib/spinner/index.js +23 -37
- package/lib/split/Split.js +95 -112
- package/lib/split/SplitSide.js +20 -19
- package/lib/split/helpers.js +3 -4
- package/lib/split/index.js +3 -4
- package/lib/table/Body.js +42 -45
- package/lib/table/Header.js +29 -32
- package/lib/table/HeaderColumn.d.ts +1 -1
- package/lib/table/HeaderColumn.js +35 -22
- package/lib/table/Row.js +45 -48
- package/lib/table/RowColumn.js +38 -39
- package/lib/table/helpers.js +7 -13
- package/lib/table/index.js +82 -102
- package/lib/table/types.d.ts +3 -0
- package/lib/tabs/DropdownTabs.d.ts +11 -0
- package/lib/tabs/DropdownTabs.js +71 -0
- package/lib/tabs/Menu.d.ts +1 -1
- package/lib/tabs/Menu.js +35 -23
- package/lib/tabs/{DropdownItems.d.ts → MenuTabs.d.ts} +3 -3
- package/lib/tabs/MenuTabs.js +82 -0
- package/lib/tabs/Panel.d.ts +1 -1
- package/lib/tabs/Panel.js +70 -66
- package/lib/tabs/context.d.ts +12 -0
- package/lib/tabs/context.js +130 -0
- package/lib/tabs/index.d.ts +1 -1
- package/lib/tabs/index.js +46 -225
- package/lib/tabs/tabHelpers.d.ts +4 -15
- package/lib/tabs/tabHelpers.js +37 -42
- package/lib/tabs/types.d.ts +48 -15
- package/lib/tabs/useTabs.d.ts +11 -0
- package/lib/tabs/useTabs.js +11 -0
- package/lib/textContent/index.d.ts +8 -0
- package/lib/textContent/index.js +30 -0
- package/lib/toolbar/ButtonBar.js +39 -43
- package/lib/toolbar/LabelBar.js +36 -40
- package/lib/toolbar/Separator.js +5 -8
- package/lib/toolbar/ToolBarGroup.js +7 -7
- package/lib/toolbar/helpers.js +2 -3
- package/lib/toolbar/index.js +23 -25
- package/lib/toolbar/types.d.ts +1 -0
- package/lib/tooltip/index.js +28 -33
- package/lib/treetable/Body.js +21 -33
- package/lib/treetable/Header.js +11 -14
- package/lib/treetable/Row.js +90 -142
- package/lib/treetable/helpers.js +15 -24
- package/lib/treetable/index.js +11 -13
- package/lib/treeview/Header.js +8 -7
- package/lib/treeview/Node.js +96 -136
- package/lib/treeview/constants.js +2 -3
- package/lib/treeview/index.js +150 -216
- package/lib/uitour/helpers.js +4 -7
- package/lib/uitour/index.d.ts +2 -1
- package/lib/uitour/index.js +113 -100
- package/lib/uitour/types.d.ts +9 -1
- package/package.json +77 -82
- package/tsconfig.json +1 -0
- package/.tool-versions +0 -1
- package/lib/inputs/mask/imaskHOC.js +0 -224
- package/lib/tabs/DropdownItems.js +0 -65
- package/lib/tabs/MenuItems.d.ts +0 -11
- package/lib/tabs/MenuItems.js +0 -76
- package/lib/treeview_old/Header.js +0 -28
- package/lib/treeview_old/Node.js +0 -88
- package/lib/treeview_old/index.js +0 -42
- package/lib/types-c2a0f035.d.ts +0 -50
|
@@ -1,54 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
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
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = exports.FormSecurityContext = void 0;
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
function _getRequireWildcardCache(
|
|
10
|
-
function _interopRequireWildcard(
|
|
11
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var changedData = (0, _react.useRef)(false);
|
|
24
|
-
var securityBeforeUnload = (0, _react.useRef)(false);
|
|
25
|
-
var _useState = (0, _react.useState)(false),
|
|
26
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
27
|
-
showQuestion = _useState2[0],
|
|
28
|
-
setShowQuestion = _useState2[1];
|
|
29
|
-
var newHandlerClose = function newHandlerClose() {
|
|
8
|
+
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); }
|
|
9
|
+
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; }
|
|
10
|
+
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); }
|
|
11
|
+
const FormSecurityContext = exports.FormSecurityContext = /*#__PURE__*/_react.default.createContext({});
|
|
12
|
+
const withFormSecurity = WrappedComponent => {
|
|
13
|
+
const EnhancedComponent = props => {
|
|
14
|
+
const {
|
|
15
|
+
onOpenChange,
|
|
16
|
+
handlerClose
|
|
17
|
+
} = props;
|
|
18
|
+
const changedData = (0, _react.useRef)(false);
|
|
19
|
+
const securityBeforeUnload = (0, _react.useRef)(false);
|
|
20
|
+
const [showQuestion, setShowQuestion] = (0, _react.useState)(false);
|
|
21
|
+
const newHandlerClose = () => {
|
|
30
22
|
if (changedData.current && securityBeforeUnload.current) {
|
|
31
23
|
setShowQuestion(true);
|
|
32
|
-
} else if (handlerClose) handlerClose();
|
|
24
|
+
} else if (onOpenChange) onOpenChange(false);else if (handlerClose) handlerClose();
|
|
33
25
|
};
|
|
34
|
-
|
|
26
|
+
const onConfirmClick = () => {
|
|
27
|
+
if (onOpenChange) onOpenChange(false);
|
|
35
28
|
if (handlerClose) handlerClose();
|
|
36
29
|
};
|
|
37
|
-
|
|
30
|
+
const onUnconfirmClick = () => {
|
|
38
31
|
setShowQuestion(false);
|
|
39
32
|
};
|
|
40
|
-
|
|
33
|
+
const onChangedData = value => {
|
|
41
34
|
changedData.current = value;
|
|
42
35
|
};
|
|
43
|
-
|
|
36
|
+
const setSecurityBeforeUnload = value => {
|
|
44
37
|
securityBeforeUnload.current = value;
|
|
45
38
|
};
|
|
46
|
-
|
|
47
|
-
onChangedData
|
|
48
|
-
showQuestion
|
|
49
|
-
onConfirmClick
|
|
50
|
-
onUnconfirmClick
|
|
51
|
-
setSecurityBeforeUnload
|
|
39
|
+
const contextValues = {
|
|
40
|
+
onChangedData,
|
|
41
|
+
showQuestion,
|
|
42
|
+
onConfirmClick,
|
|
43
|
+
onUnconfirmClick,
|
|
44
|
+
setSecurityBeforeUnload,
|
|
52
45
|
securityBeforeUnload: securityBeforeUnload.current
|
|
53
46
|
};
|
|
54
47
|
return /*#__PURE__*/_react.default.createElement(FormSecurityContext.Provider, {
|
|
@@ -59,5 +52,4 @@ var withFormSecurity = function withFormSecurity(WrappedComponent) {
|
|
|
59
52
|
};
|
|
60
53
|
return EnhancedComponent;
|
|
61
54
|
};
|
|
62
|
-
var _default = withFormSecurity;
|
|
63
|
-
exports.default = _default;
|
|
55
|
+
var _default = exports.default = withFormSecurity;
|
|
@@ -6,29 +6,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
require("../assets/styles/gridlayout.scss");
|
|
9
|
-
function _interopRequireDefault(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const getClass = col => {
|
|
11
|
+
const cols = col ? col.split(' ') : [];
|
|
12
|
+
let classes = 'grid-container ';
|
|
13
13
|
if (cols[0]) classes += "col-xs-".concat(cols[0]);
|
|
14
14
|
if (cols[1]) classes += " col-sm-".concat(cols[1]);
|
|
15
15
|
if (cols[2]) classes += " col-md-".concat(cols[2]);
|
|
16
16
|
if (cols[3]) classes += " col-lg-".concat(cols[3]);
|
|
17
17
|
return classes;
|
|
18
18
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
visible =
|
|
26
|
-
|
|
19
|
+
const GridCol = props => {
|
|
20
|
+
const {
|
|
21
|
+
cols,
|
|
22
|
+
customClass,
|
|
23
|
+
children,
|
|
24
|
+
style,
|
|
25
|
+
visible = true
|
|
26
|
+
} = props;
|
|
27
|
+
const gridClasses = getClass(cols || '');
|
|
27
28
|
if (!visible) return null;
|
|
28
29
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
29
30
|
className: "".concat(customClass, " ").concat(gridClasses),
|
|
30
31
|
style: style
|
|
31
32
|
}, children);
|
|
32
33
|
};
|
|
33
|
-
var _default = GridCol;
|
|
34
|
-
exports.default = _default;
|
|
34
|
+
var _default = exports.default = GridCol;
|
|
@@ -6,20 +6,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
require("../assets/styles/gridlayout.scss");
|
|
9
|
-
function _interopRequireDefault(
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
14
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
|
+
const getClass = props => "row ".concat(props.customClass, "\n ").concat(props.withTrim && ' -withtrim', "\n ").concat(props.verticalAlign && " align-items-".concat(props.verticalAlign), "\n ").concat(props.horizontalAlign && " justify-content-".concat(props.horizontalAlign));
|
|
16
|
+
const GridRow = props => {
|
|
17
|
+
const {
|
|
18
|
+
style,
|
|
19
|
+
children,
|
|
20
|
+
verticalAlign = 'start',
|
|
21
|
+
visible = true
|
|
22
|
+
} = props;
|
|
18
23
|
if (!visible) return null;
|
|
19
24
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
20
25
|
style: style,
|
|
21
|
-
className: getClass(props)
|
|
26
|
+
className: getClass(_objectSpread(_objectSpread({}, props), {}, {
|
|
27
|
+
verticalAlign
|
|
28
|
+
}))
|
|
22
29
|
}, children);
|
|
23
30
|
};
|
|
24
|
-
var _default = GridRow;
|
|
25
|
-
exports.default = _default;
|
|
31
|
+
var _default = exports.default = GridRow;
|
package/lib/gridlayout/index.js
CHANGED
|
@@ -5,13 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "GridRow", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _GridRow.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
exports.default = void 0;
|
|
13
13
|
var _GridRow = _interopRequireDefault(require("./GridRow"));
|
|
14
14
|
var _GridCol = _interopRequireDefault(require("./GridCol"));
|
|
15
|
-
function _interopRequireDefault(
|
|
16
|
-
var _default = _GridCol.default;
|
|
17
|
-
exports.default = _default;
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
var _default = exports.default = _GridCol.default;
|
|
@@ -9,7 +9,7 @@ interface IGridCol {
|
|
|
9
9
|
}
|
|
10
10
|
interface IGridRow {
|
|
11
11
|
children: ReactNode | ReactNode[];
|
|
12
|
-
verticalAlign?:
|
|
12
|
+
verticalAlign?: 'start' | 'center' | 'end' | 'baseline' | 'stretch';
|
|
13
13
|
horizontalAlign?: string;
|
|
14
14
|
style?: CSSProperties;
|
|
15
15
|
withTrim?: boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.showHintList = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const showHintList = arrayHint => /*#__PURE__*/_react.default.createElement("div", {
|
|
10
|
+
className: "rules-list",
|
|
11
|
+
style: {
|
|
12
|
+
padding: '15px 0px'
|
|
13
|
+
}
|
|
14
|
+
}, /*#__PURE__*/_react.default.createElement("ul", {
|
|
15
|
+
style: {
|
|
16
|
+
listStyleType: 'none'
|
|
17
|
+
}
|
|
18
|
+
}, arrayHint.map((hint, index) => /*#__PURE__*/_react.default.createElement("li", {
|
|
19
|
+
key: index.toString()
|
|
20
|
+
}, "- ", hint))));
|
|
21
|
+
exports.showHintList = showHintList;
|
package/lib/hint/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HintProps } from './types.js';
|
|
2
2
|
import 'react';
|
|
3
|
+
import '../@types/ColorStyles.js';
|
|
3
4
|
|
|
4
|
-
declare const Hint: ({ visible, description, customClass, skeletonize, style, }: HintProps) => JSX.Element | null;
|
|
5
|
+
declare const Hint: ({ visible, description, customClass, skeletonize, style, disabled, color, }: HintProps) => JSX.Element | null;
|
|
5
6
|
|
|
6
7
|
export { Hint as default };
|
package/lib/hint/index.js
CHANGED
|
@@ -5,37 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _helpers = require("./helpers");
|
|
8
9
|
require("../assets/styles/hint.scss");
|
|
9
|
-
function _interopRequireDefault(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
visible =
|
|
13
|
-
description
|
|
14
|
-
customClass
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
const Hint = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
visible = true,
|
|
14
|
+
description,
|
|
15
|
+
customClass,
|
|
16
|
+
skeletonize = false,
|
|
17
|
+
style,
|
|
18
|
+
disabled = false,
|
|
19
|
+
color
|
|
20
|
+
} = _ref;
|
|
18
21
|
if (!visible || !description) return null;
|
|
19
|
-
var showHintList = function showHintList(arrayHint) {
|
|
20
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
21
|
-
className: "rules-list",
|
|
22
|
-
style: {
|
|
23
|
-
padding: '15px 0px'
|
|
24
|
-
}
|
|
25
|
-
}, /*#__PURE__*/_react.default.createElement("ul", {
|
|
26
|
-
style: {
|
|
27
|
-
listStyleType: 'none'
|
|
28
|
-
}
|
|
29
|
-
}, arrayHint.map(function (hint, index) {
|
|
30
|
-
return /*#__PURE__*/_react.default.createElement("li", {
|
|
31
|
-
key: index.toString()
|
|
32
|
-
}, "- ", hint);
|
|
33
|
-
})));
|
|
34
|
-
};
|
|
35
22
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
23
|
+
"aria-disabled": disabled,
|
|
36
24
|
style: style,
|
|
37
|
-
className: "\n hint-component\n ".concat(customClass, "\n ").concat(skeletonize ? '-skeletonized' : '', "\n ")
|
|
38
|
-
}, Array.isArray(description) ? showHintList(description) : /*#__PURE__*/_react.default.createElement("span",
|
|
25
|
+
className: "\n hint-component\n ".concat(customClass, "\n ").concat(skeletonize ? '-skeletonized' : '', "\n ").concat(disabled ? '-disabled' : '', "\n -").concat(color, "\n ")
|
|
26
|
+
}, Array.isArray(description) ? (0, _helpers.showHintList)(description) : /*#__PURE__*/_react.default.createElement("span", {
|
|
27
|
+
"aria-disabled": disabled
|
|
28
|
+
}, description));
|
|
39
29
|
};
|
|
40
|
-
var _default = Hint;
|
|
41
|
-
exports.default = _default;
|
|
30
|
+
var _default = exports.default = Hint;
|
package/lib/hint/types.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
|
+
import { ColorStyles } from '../@types/ColorStyles.js';
|
|
2
3
|
|
|
3
4
|
interface HintProps {
|
|
4
5
|
description?: string | string[];
|
|
5
6
|
visible?: boolean;
|
|
6
7
|
customClass?: string;
|
|
7
8
|
skeletonize?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
8
10
|
style?: CSSProperties;
|
|
11
|
+
color?: ColorStyles;
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
export { HintProps };
|
package/lib/icons/helper.d.ts
CHANGED
package/lib/icons/helper.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _default = {
|
|
7
|
+
var _default = exports.default = {
|
|
8
8
|
paperplane: {
|
|
9
9
|
viewbox: '0 0 16 16',
|
|
10
10
|
paths: ['M7 11l6.151 2.195 2.849-12.459zM5 10.311l11-9.575-16 7.913zM7 12.062v3.938l2.902-2.902z']
|
|
@@ -575,7 +575,7 @@ var _default = {
|
|
|
575
575
|
},
|
|
576
576
|
cash3: {
|
|
577
577
|
viewbox: '0 0 17 16',
|
|
578
|
-
paths: ['9h1v1h-1v-1z', 'M0 6v9h17v-9h-17zM3 14h-2v-2h1v1h1v1zM3 8h-1v1h-1v-2h2v1zM10.5 10c0.276 0 0.5 0.224 0.5 0.5v2c0 0.276-0.224 0.5-0.5 0.5h-1.5v0.5c0 0.276-0.224 0.5-0.5 0.5s-0.5-0.224-0.5-0.5v-0.5h-1.5c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5h1.5v-1h-1.5c-0.276 0-0.5-0.224-0.5-0.5v-2c0-0.276 0.224-0.5 0.5-0.5h1.5v-0.5c0-0.276 0.224-0.5 0.5-0.5s0.5 0.224 0.5 0.5v0.5h1.5c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5h-1.5v1h1.5zM16 14h-2v-1h1v-1h1v2zM16 9h-1v-1h-1v-1h2v2z', 'M9 11h1v1h-1v-1z', 'M1 4h15v1.5h-15v-1.5z', 'M2 2h13v1.5h-13v-1.5z']
|
|
578
|
+
paths: ['M7 9h1v1h-1v-1z', 'M0 6v9h17v-9h-17zM3 14h-2v-2h1v1h1v1zM3 8h-1v1h-1v-2h2v1zM10.5 10c0.276 0 0.5 0.224 0.5 0.5v2c0 0.276-0.224 0.5-0.5 0.5h-1.5v0.5c0 0.276-0.224 0.5-0.5 0.5s-0.5-0.224-0.5-0.5v-0.5h-1.5c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5h1.5v-1h-1.5c-0.276 0-0.5-0.224-0.5-0.5v-2c0-0.276 0.224-0.5 0.5-0.5h1.5v-0.5c0-0.276 0.224-0.5 0.5-0.5s0.5 0.224 0.5 0.5v0.5h1.5c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5h-1.5v1h1.5zM16 14h-2v-1h1v-1h1v2zM16 9h-1v-1h-1v-1h2v2z', 'M9 11h1v1h-1v-1z', 'M1 4h15v1.5h-15v-1.5z', 'M2 2h13v1.5h-13v-1.5z']
|
|
579
579
|
},
|
|
580
580
|
wallet: {
|
|
581
581
|
viewbox: '0 0 17 16',
|
|
@@ -608,6 +608,9 @@ var _default = {
|
|
|
608
608
|
videoCamOutline: {
|
|
609
609
|
viewbox: '0 0 16 16',
|
|
610
610
|
paths: ['M15.294 4.004c-0.165 0-0.335 0.058-0.491 0.168l-2.803 1.978v-1.651c0-0.825-0.675-1.5-1.5-1.5h-9c-0.825 0-1.5 0.675-1.5 1.5v7c0 0.825 0.675 1.5 1.5 1.5h9c0.825 0 1.5-0.675 1.5-1.5v-1.65l2.803 1.978c0.156 0.11 0.326 0.168 0.491 0.168 0 0 0 0 0 0 0.22 0 0.421-0.101 0.551-0.278 0.101-0.137 0.154-0.313 0.154-0.51v-6.415c-0-0.518-0.355-0.788-0.706-0.788zM15 10.743l-2.469-1.743h-1.531v2.5c0 0.271-0.229 0.5-0.5 0.5h-9c-0.271 0-0.5-0.229-0.5-0.5v-7c0-0.271 0.229-0.5 0.5-0.5h9c0.271 0 0.5 0.229 0.5 0.5v2.5h1.531l2.469-1.743v5.486z', 'M4 5l5 3-5 3z']
|
|
611
|
+
},
|
|
612
|
+
user_block: {
|
|
613
|
+
viewbox: '0 0 16 16',
|
|
614
|
+
paths: ['M7.5 16h-6.977c-0.14 0-0.274-0.059-0.369-0.163s-0.141-0.242-0.129-0.382c0.11-1.22 0.585-2.363 1.373-3.305 0.697-0.832 1.59-1.452 2.602-1.809l0-0.475c-0.562-0.385-1.037-0.926-1.385-1.582-0.402-0.758-0.615-1.634-0.615-2.535 0-1.251 0.405-2.431 1.139-3.323 0.758-0.92 1.774-1.427 2.861-1.427 2.119 0 3.874 1.966 3.993 4.476 0.013 0.276-0.2 0.51-0.476 0.523s-0.51-0.2-0.523-0.476c-0.094-1.976-1.41-3.524-2.995-3.524-1.654 0-3 1.682-3 3.75 0 1.457 0.687 2.795 1.75 3.408 0.155 0.089 0.25 0.254 0.25 0.433l-0 1.116c0 0.224-0.149 0.42-0.364 0.481-0.967 0.274-1.822 0.828-2.471 1.604-0.538 0.643-0.901 1.397-1.064 2.208h6.4c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5z', 'M11.5 7c-2.481 0-4.5 2.019-4.5 4.5s2.019 4.5 4.5 4.5 4.5-2.019 4.5-4.5-2.019-4.5-4.5-4.5zM8 11.5c0-1.93 1.57-3.5 3.5-3.5 0.785 0 1.511 0.26 2.095 0.698l-4.897 4.897c-0.438-0.584-0.698-1.31-0.698-2.095zM11.5 15c-0.785 0-1.511-0.26-2.095-0.698l4.897-4.897c0.438 0.584 0.698 1.31 0.698 2.095 0 1.93-1.57 3.5-3.5 3.5z']
|
|
611
615
|
}
|
|
612
|
-
};
|
|
613
|
-
exports.default = _default;
|
|
616
|
+
};
|
package/lib/icons/index.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IconProps } from './types.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import '../@types/PointerEvents.js';
|
|
4
4
|
import '../@types/SizePixels.js';
|
|
5
5
|
import '../@types/Icon.js';
|
|
6
6
|
import './helper.js';
|
|
7
7
|
import '../@types/Position.js';
|
|
8
|
+
import '../@types/ColorStyles.js';
|
|
8
9
|
|
|
9
10
|
declare const _default: {
|
|
10
|
-
(props:
|
|
11
|
+
(props: IconProps): JSX.Element;
|
|
11
12
|
displayName: string;
|
|
12
13
|
};
|
|
13
14
|
|
package/lib/icons/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
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
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -9,71 +8,67 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
8
|
var _helper = _interopRequireDefault(require("./helper"));
|
|
10
9
|
var _withTooltip = _interopRequireDefault(require("../internals/withTooltip"));
|
|
11
10
|
require("../assets/styles/icon.scss");
|
|
12
|
-
function _interopRequireDefault(
|
|
13
|
-
function _getRequireWildcardCache(
|
|
14
|
-
function _interopRequireWildcard(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
size =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return name ? listIcon[name].paths : svgStruct === null || svgStruct === void 0 ? void 0 : svgStruct.paths;
|
|
42
|
-
};
|
|
43
|
-
var getSvg = function getSvg() {
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
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
|
+
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
|
+
const listIcon = _helper.default;
|
|
15
|
+
const disabledIconColor = 'rgb(193, 193, 193)';
|
|
16
|
+
const Icon = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
name,
|
|
19
|
+
onClick,
|
|
20
|
+
svgStruct,
|
|
21
|
+
size = 16,
|
|
22
|
+
style = {},
|
|
23
|
+
visible = true,
|
|
24
|
+
disabled = false,
|
|
25
|
+
customClass = '',
|
|
26
|
+
customClassForContainer = '',
|
|
27
|
+
colorStyle = 'default',
|
|
28
|
+
color,
|
|
29
|
+
viewBox,
|
|
30
|
+
pointerEvents = 'none',
|
|
31
|
+
targetRef,
|
|
32
|
+
tooltip
|
|
33
|
+
} = _ref;
|
|
34
|
+
const isUsingColorStyle = colorStyle !== 'default';
|
|
35
|
+
const colorFromProp = isUsingColorStyle || !color ? undefined : color;
|
|
36
|
+
const refSvg = (0, _react.useRef)(null);
|
|
37
|
+
const viewBoxFromIconOrSvgStrcut = name ? listIcon[name].viewbox : svgStruct === null || svgStruct === void 0 ? void 0 : svgStruct.viewbox;
|
|
38
|
+
const getPaths = () => name ? listIcon[name].paths : svgStruct === null || svgStruct === void 0 ? void 0 : svgStruct.paths;
|
|
39
|
+
const getSvg = () => {
|
|
44
40
|
var _getPaths;
|
|
45
41
|
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
46
42
|
"data-testid": "icon",
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
"data-color-style": colorStyle,
|
|
44
|
+
onClick: () => {
|
|
45
|
+
if (onClick && !disabled) onClick();
|
|
49
46
|
},
|
|
50
|
-
ref:
|
|
47
|
+
ref: r => {
|
|
51
48
|
refSvg.current = r;
|
|
52
49
|
},
|
|
53
50
|
width: "".concat(size, "px"),
|
|
54
51
|
height: "".concat(size, "px"),
|
|
55
|
-
fill: disabled ? disabledIconColor :
|
|
56
|
-
viewBox:
|
|
52
|
+
fill: disabled ? disabledIconColor : colorFromProp,
|
|
53
|
+
viewBox: viewBox || viewBoxFromIconOrSvgStrcut,
|
|
57
54
|
className: "icon-component ".concat(customClass),
|
|
58
55
|
pointerEvents: pointerEvents,
|
|
59
56
|
style: style
|
|
60
|
-
}, (_getPaths = getPaths()) === null || _getPaths === void 0 ? void 0 : _getPaths.map(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
});
|
|
66
|
-
}));
|
|
57
|
+
}, (_getPaths = getPaths()) === null || _getPaths === void 0 ? void 0 : _getPaths.map(value => /*#__PURE__*/_react.default.createElement("path", {
|
|
58
|
+
"data-testid": "icon-path",
|
|
59
|
+
d: value,
|
|
60
|
+
key: value
|
|
61
|
+
})));
|
|
67
62
|
};
|
|
63
|
+
if (color && colorStyle !== 'default') throw new Error('Expected only one of the two properties: colorStyle or color');
|
|
68
64
|
if (!name && !svgStruct) throw new Error('One of the "name" and "svgStruct" props must be filled');
|
|
69
65
|
if (!visible) return null;
|
|
70
66
|
if (!tooltip) return getSvg();
|
|
71
67
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
72
68
|
className: "icon-component-container ".concat(customClassForContainer),
|
|
73
|
-
ref:
|
|
69
|
+
ref: r => {
|
|
74
70
|
if (targetRef && r) targetRef(r);
|
|
75
71
|
}
|
|
76
72
|
}, getSvg());
|
|
77
73
|
};
|
|
78
|
-
var _default = (0, _withTooltip.default)(Icon);
|
|
79
|
-
exports.default = _default;
|
|
74
|
+
var _default = exports.default = (0, _withTooltip.default)(Icon);
|
package/lib/icons/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { PointerEvents } from '../@types/PointerEvents.js';
|
|
|
3
3
|
import { SizePixels } from '../@types/SizePixels.js';
|
|
4
4
|
import { IconNames } from '../@types/Icon.js';
|
|
5
5
|
import { Position } from '../@types/Position.js';
|
|
6
|
+
import { ColorStyles } from '../@types/ColorStyles.js';
|
|
6
7
|
import './helper.js';
|
|
7
8
|
|
|
8
9
|
type ListIconType = {
|
|
@@ -11,26 +12,38 @@ type ListIconType = {
|
|
|
11
12
|
paths: Array<string>;
|
|
12
13
|
};
|
|
13
14
|
};
|
|
14
|
-
|
|
15
|
+
type SvgStruct = {
|
|
16
|
+
viewbox: string;
|
|
17
|
+
paths: Array<string>;
|
|
18
|
+
};
|
|
19
|
+
type BaseIconProps = {
|
|
15
20
|
size?: SizePixels;
|
|
16
|
-
color?: string;
|
|
17
21
|
customClass?: string;
|
|
18
22
|
customClassForContainer?: string;
|
|
19
23
|
style?: CSSProperties;
|
|
20
24
|
visible?: boolean;
|
|
21
25
|
disabled?: boolean;
|
|
22
26
|
pointerEvents?: PointerEvents;
|
|
23
|
-
name?: IconNames;
|
|
24
27
|
viewBox?: string;
|
|
25
|
-
svgStruct?: {
|
|
26
|
-
viewbox: string;
|
|
27
|
-
paths: Array<string>;
|
|
28
|
-
};
|
|
29
28
|
onClick?: () => void;
|
|
30
29
|
tooltipPosition?: Exclude<Position, 'center'>;
|
|
31
30
|
tooltipWidth?: string | number;
|
|
32
31
|
tooltip?: string;
|
|
33
32
|
targetRef?: (ref: HTMLDivElement) => void;
|
|
34
|
-
}
|
|
33
|
+
};
|
|
34
|
+
type ColorProps = ({
|
|
35
|
+
colorStyle?: ColorStyles | 'default';
|
|
36
|
+
color?: null;
|
|
37
|
+
} | {
|
|
38
|
+
color?: string;
|
|
39
|
+
colorStyle?: undefined;
|
|
40
|
+
});
|
|
41
|
+
type IconProps = BaseIconProps & ColorProps & ({
|
|
42
|
+
name: IconNames;
|
|
43
|
+
svgStruct?: null;
|
|
44
|
+
} | {
|
|
45
|
+
svgStruct: SvgStruct;
|
|
46
|
+
name?: null;
|
|
47
|
+
});
|
|
35
48
|
|
|
36
|
-
export {
|
|
49
|
+
export { IconProps, ListIconType };
|
package/lib/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { default as List } from './list/index.js';
|
|
|
7
7
|
export { default as Radio } from './radio/index.js';
|
|
8
8
|
export { default as Tab } from './tabs/index.js';
|
|
9
9
|
export { default as Dialog } from './dialog/base/index.js';
|
|
10
|
-
import './types
|
|
10
|
+
import './panel/types.js';
|
|
11
11
|
import 'react';
|
|
12
12
|
import './@types/PermissionAttr.js';
|
|
13
13
|
import './internals/colorStyles.js';
|
|
@@ -27,6 +27,7 @@ import './labels/types.js';
|
|
|
27
27
|
import './icons/types.js';
|
|
28
28
|
import './@types/PointerEvents.js';
|
|
29
29
|
import './@types/SizePixels.js';
|
|
30
|
+
import './@types/ColorStyles.js';
|
|
30
31
|
import './list/Header.js';
|
|
31
32
|
import './list/types.js';
|
|
32
33
|
import './list/Item.js';
|