@mw-kit/mw-ui 1.7.103 → 1.7.105
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/dist/components/EllipsisContainer/functions.d.ts +6 -0
- package/dist/components/Tabs/components/ScrollButton/index.d.ts +7 -0
- package/dist/components/Tabs/components/ScrollButton/styled.d.ts +1 -0
- package/dist/components/Tabs/components/ScrollButtons/index.d.ts +9 -0
- package/dist/components/Tabs/components/ScrollButtons/styled.d.ts +3 -0
- package/dist/components/Tabs/components/{Close → TabItem/components/Close}/index.d.ts +1 -1
- package/dist/components/Tabs/components/TabItem/components/LabelItem/index.d.ts +12 -0
- package/dist/components/Tabs/components/TabItem/components/LabelItem/styled.d.ts +6 -0
- package/dist/components/Tabs/components/TabItem/components/index.d.ts +2 -0
- package/dist/components/Tabs/components/TabItem/index.d.ts +10 -0
- package/dist/components/Tabs/components/TabItem/styled.d.ts +1 -0
- package/dist/components/Tabs/components/index.d.ts +2 -1
- package/dist/components/Tabs/functions.d.ts +9 -0
- package/dist/components/Tabs/interfaces.d.ts +5 -14
- package/dist/components/Tabs/styled.d.ts +8 -0
- package/dist/index.js +323 -131
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +323 -131
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/Tabs/styles.d.ts +0 -10
- /package/dist/components/Tabs/components/{Close → TabItem/components/Close}/styles.d.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -12196,36 +12196,44 @@ var getMask = function getMask(mask) {
|
|
|
12196
12196
|
};
|
|
12197
12197
|
};
|
|
12198
12198
|
|
|
12199
|
-
var
|
|
12200
|
-
var
|
|
12201
|
-
var lines = _ref.lines;
|
|
12202
|
-
return lines ? styled.css(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteralLoose(["\n display: -webkit-box;\n\n -webkit-box-orient: vertical;\n -moz-box-orient: vertical;\n -ms-box-orient: vertical;\n box-orient: vertical;\n\n -webkit-line-clamp: ", ";\n -moz-line-clamp: ", ";\n -ms-line-clamp: ", ";\n line-clamp: ", ";\n "])), lines, lines, lines, lines) : styled.css(_templateObject3$4 || (_templateObject3$4 = _taggedTemplateLiteralLoose(["\n white-space: nowrap;\n "])));
|
|
12203
|
-
});
|
|
12199
|
+
var updateTitle = function updateTitle(event) {
|
|
12200
|
+
var target = event.target;
|
|
12204
12201
|
|
|
12205
|
-
|
|
12206
|
-
|
|
12202
|
+
while (target && !('ellipsis' in target.dataset)) {
|
|
12203
|
+
target = target.parentElement;
|
|
12204
|
+
}
|
|
12207
12205
|
|
|
12208
|
-
|
|
12206
|
+
if (!target) return;
|
|
12209
12207
|
|
|
12210
|
-
|
|
12211
|
-
|
|
12208
|
+
if (target.scrollWidth > target.offsetWidth || target.scrollHeight > target.offsetHeight) {
|
|
12209
|
+
target.title = target.innerText;
|
|
12210
|
+
} else target.removeAttribute('title');
|
|
12211
|
+
};
|
|
12212
12212
|
|
|
12213
|
-
|
|
12213
|
+
var voidF = function voidF() {};
|
|
12214
12214
|
|
|
12215
|
-
|
|
12216
|
-
|
|
12217
|
-
}
|
|
12215
|
+
var useEllipsis = function useEllipsis(onMouseOver) {
|
|
12216
|
+
var originalHandler = onMouseOver || voidF;
|
|
12218
12217
|
|
|
12219
|
-
|
|
12218
|
+
var handler = function handler(event) {
|
|
12219
|
+
originalHandler(event);
|
|
12220
|
+
updateTitle(event);
|
|
12221
|
+
};
|
|
12220
12222
|
|
|
12221
|
-
|
|
12222
|
-
|
|
12223
|
-
|
|
12223
|
+
return {
|
|
12224
|
+
onMouseOver: handler,
|
|
12225
|
+
'data-ellipsis': ''
|
|
12224
12226
|
};
|
|
12227
|
+
};
|
|
12225
12228
|
|
|
12226
|
-
|
|
12227
|
-
|
|
12228
|
-
|
|
12229
|
+
var _templateObject$4, _templateObject2$4, _templateObject3$4;
|
|
12230
|
+
var EllipsisContainer = styled__default.div(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteralLoose(["\n overflow: hidden;\n text-overflow: ellipsis;\n\n ", "\n"])), function (_ref) {
|
|
12231
|
+
var lines = _ref.lines;
|
|
12232
|
+
return lines ? styled.css(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteralLoose(["\n display: -webkit-box;\n\n -webkit-box-orient: vertical;\n -moz-box-orient: vertical;\n -ms-box-orient: vertical;\n box-orient: vertical;\n\n -webkit-line-clamp: ", ";\n -moz-line-clamp: ", ";\n -ms-line-clamp: ", ";\n line-clamp: ", ";\n "])), lines, lines, lines, lines) : styled.css(_templateObject3$4 || (_templateObject3$4 = _taggedTemplateLiteralLoose(["\n white-space: nowrap;\n "])));
|
|
12233
|
+
});
|
|
12234
|
+
|
|
12235
|
+
var EllipsisContainer$1 = function EllipsisContainer$1(props) {
|
|
12236
|
+
return React__default.createElement(EllipsisContainer, Object.assign({}, props, useEllipsis(props.onMouseOver)));
|
|
12229
12237
|
};
|
|
12230
12238
|
|
|
12231
12239
|
var _templateObject$5, _templateObject2$5, _templateObject3$5, _templateObject4$3, _templateObject5$3, _templateObject6$2, _templateObject7$2, _templateObject8$1, _templateObject9$1, _templateObject10$1, _templateObject11$1, _templateObject12$1, _templateObject13$1, _templateObject14$1, _templateObject15$1, _templateObject16$1, _templateObject17$1, _templateObject18$1, _templateObject19$1, _templateObject20$1, _templateObject21$1, _templateObject22$1;
|
|
@@ -19351,17 +19359,158 @@ var ProgressBar = function ProgressBar(props) {
|
|
|
19351
19359
|
};
|
|
19352
19360
|
|
|
19353
19361
|
var _templateObject$17;
|
|
19354
|
-
var
|
|
19362
|
+
var Container$n = styled__default.div(_templateObject$17 || (_templateObject$17 = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 0;\n height: 100%;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n background-color: #ecedef;\n opacity: 0.8;\n\n cursor: pointer;\n color: ", ";\n\n transition-property: left, right;\n transition-timing-function: linear;\n transition-duration: 0.25s;\n\n z-index: 3;\n"])), function (_ref) {
|
|
19355
19363
|
var theme = _ref.theme;
|
|
19356
|
-
return theme.
|
|
19357
|
-
}
|
|
19358
|
-
|
|
19359
|
-
|
|
19360
|
-
|
|
19361
|
-
|
|
19362
|
-
|
|
19364
|
+
return theme.colors.darkBlue;
|
|
19365
|
+
});
|
|
19366
|
+
|
|
19367
|
+
var ScrollButton = function ScrollButton(props) {
|
|
19368
|
+
var mode = props.mode,
|
|
19369
|
+
visible = props.visible,
|
|
19370
|
+
scrollRef = props.scrollRef;
|
|
19371
|
+
var icon = "chevron_" + mode;
|
|
19372
|
+
var onClick = React.useCallback(function () {
|
|
19373
|
+
if (!scrollRef) return;
|
|
19374
|
+
scrollRef.scrollBy({
|
|
19375
|
+
left: mode === 'left' ? -(scrollRef.scrollWidth + 1) : scrollRef.scrollWidth,
|
|
19376
|
+
behavior: 'smooth'
|
|
19377
|
+
});
|
|
19378
|
+
}, [scrollRef, mode]);
|
|
19379
|
+
return React__default.createElement(Container$n, {
|
|
19380
|
+
className: ['scroll-arrow'].concat(visible ? ['visible'] : []).join(' '),
|
|
19381
|
+
onClick: onClick
|
|
19382
|
+
}, React__default.createElement(Icon, {
|
|
19383
|
+
type: 'feather',
|
|
19384
|
+
icon: icon,
|
|
19385
|
+
width: 16,
|
|
19386
|
+
height: 16,
|
|
19387
|
+
color: 'black'
|
|
19388
|
+
}));
|
|
19389
|
+
};
|
|
19390
|
+
|
|
19391
|
+
var _templateObject$18, _templateObject2$Q;
|
|
19392
|
+
var Container$o = styled__default.div(_templateObject$18 || (_templateObject$18 = _taggedTemplateLiteralLoose(["\n overflow-x: auto;\n scrollbar-width: thin;\n scroll-behavior: smooth;\n display: flex;\n width: 100%;\n\n scrollbar-gutter: stable;\n\n -ms-overflow-style: none; /* IE / Edge antigos */\n scrollbar-width: none; /* Firefox */\n &::-webkit-scrollbar {\n display: none; /* Chrome, Safari, Opera */\n }\n\n ", "\n"])), function (_ref) {
|
|
19393
|
+
var theme = _ref.theme,
|
|
19394
|
+
internal = _ref.$internal;
|
|
19395
|
+
return internal && styled.css(_templateObject2$Q || (_templateObject2$Q = _taggedTemplateLiteralLoose(["\n gap: ", ";\n "])), theme.spacings.s6);
|
|
19363
19396
|
});
|
|
19364
19397
|
|
|
19398
|
+
var ScrollButtons = function ScrollButtons(props) {
|
|
19399
|
+
var activeTabIndex = props.activeTabIndex,
|
|
19400
|
+
tabsLength = props.tabsLength;
|
|
19401
|
+
|
|
19402
|
+
var _useState = React.useState(null),
|
|
19403
|
+
ref = _useState[0],
|
|
19404
|
+
setRef = _useState[1];
|
|
19405
|
+
|
|
19406
|
+
var _useState2 = React.useState(false),
|
|
19407
|
+
showLeftArrow = _useState2[0],
|
|
19408
|
+
setShowLeftArrow = _useState2[1];
|
|
19409
|
+
|
|
19410
|
+
var _useState3 = React.useState(false),
|
|
19411
|
+
showRightArrow = _useState3[0],
|
|
19412
|
+
setShowRightArrow = _useState3[1];
|
|
19413
|
+
|
|
19414
|
+
var checkScrollPosition = React.useCallback(function () {
|
|
19415
|
+
if (!ref) return;
|
|
19416
|
+
|
|
19417
|
+
if (ref.scrollWidth > ref.offsetWidth) {
|
|
19418
|
+
var scrollLeft = ref.scrollLeft,
|
|
19419
|
+
scrollWidth = ref.scrollWidth,
|
|
19420
|
+
clientWidth = ref.clientWidth;
|
|
19421
|
+
setShowLeftArrow(scrollLeft > 10);
|
|
19422
|
+
setShowRightArrow(scrollWidth - clientWidth - scrollLeft > 10);
|
|
19423
|
+
} else {
|
|
19424
|
+
setShowLeftArrow(false);
|
|
19425
|
+
setShowRightArrow(false);
|
|
19426
|
+
}
|
|
19427
|
+
}, [ref]);
|
|
19428
|
+
React.useEffect(function () {
|
|
19429
|
+
checkScrollPosition();
|
|
19430
|
+
window.addEventListener('resize', checkScrollPosition);
|
|
19431
|
+
return function () {
|
|
19432
|
+
return window.removeEventListener('resize', checkScrollPosition);
|
|
19433
|
+
};
|
|
19434
|
+
}, [checkScrollPosition, tabsLength]);
|
|
19435
|
+
React.useEffect(function () {
|
|
19436
|
+
if (!ref) return;
|
|
19437
|
+
if (ref.scrollWidth <= ref.offsetWidth) return;
|
|
19438
|
+
var element = ref.children[activeTabIndex];
|
|
19439
|
+
if (!element) return;
|
|
19440
|
+
element.scrollIntoView({
|
|
19441
|
+
behavior: 'smooth',
|
|
19442
|
+
inline: 'nearest'
|
|
19443
|
+
});
|
|
19444
|
+
}, [activeTabIndex, ref]);
|
|
19445
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(ScrollButton, {
|
|
19446
|
+
scrollRef: ref,
|
|
19447
|
+
mode: 'left',
|
|
19448
|
+
visible: showLeftArrow
|
|
19449
|
+
}), React__default.createElement(Container$o, Object.assign({
|
|
19450
|
+
ref: setRef
|
|
19451
|
+
}, props.divProps, {
|
|
19452
|
+
onWheel: function onWheel(e) {
|
|
19453
|
+
if (!ref) return;
|
|
19454
|
+
var x = ref.offsetWidth * 100 / ref.scrollWidth;
|
|
19455
|
+
ref.scrollLeft += x * (e.deltaY > 0 ? 1 : -1) * 2;
|
|
19456
|
+
e.preventDefault();
|
|
19457
|
+
},
|
|
19458
|
+
onScroll: checkScrollPosition,
|
|
19459
|
+
"$internal": props.internal,
|
|
19460
|
+
children: props.children
|
|
19461
|
+
})), React__default.createElement(ScrollButton, {
|
|
19462
|
+
scrollRef: ref,
|
|
19463
|
+
mode: 'right',
|
|
19464
|
+
visible: showRightArrow
|
|
19465
|
+
}));
|
|
19466
|
+
};
|
|
19467
|
+
|
|
19468
|
+
var sortTabs = function sortTabs(tabs, sorted) {
|
|
19469
|
+
if (sorted === void 0) {
|
|
19470
|
+
sorted = [];
|
|
19471
|
+
}
|
|
19472
|
+
|
|
19473
|
+
if (tabs.length < 1) return sorted;
|
|
19474
|
+
var tab = tabs[0];
|
|
19475
|
+
var group = tab.group;
|
|
19476
|
+
|
|
19477
|
+
if (!group) {
|
|
19478
|
+
return sortTabs(tabs.slice(1), [].concat(sorted, [tab]));
|
|
19479
|
+
}
|
|
19480
|
+
|
|
19481
|
+
var res = tabs.reduce(function (_ref, t) {
|
|
19482
|
+
var tabs = _ref.tabs,
|
|
19483
|
+
sorted = _ref.sorted;
|
|
19484
|
+
|
|
19485
|
+
if (t.group !== group) {
|
|
19486
|
+
return {
|
|
19487
|
+
tabs: [].concat(tabs, [t]),
|
|
19488
|
+
sorted: sorted
|
|
19489
|
+
};
|
|
19490
|
+
}
|
|
19491
|
+
|
|
19492
|
+
return t.primary ? {
|
|
19493
|
+
tabs: tabs,
|
|
19494
|
+
sorted: [t].concat(sorted)
|
|
19495
|
+
} : {
|
|
19496
|
+
tabs: tabs,
|
|
19497
|
+
sorted: [].concat(sorted, [t])
|
|
19498
|
+
};
|
|
19499
|
+
}, {
|
|
19500
|
+
tabs: [],
|
|
19501
|
+
sorted: []
|
|
19502
|
+
});
|
|
19503
|
+
return sortTabs(res.tabs, [].concat(sorted, res.sorted));
|
|
19504
|
+
};
|
|
19505
|
+
var hasChildren = function hasChildren(tabs, group) {
|
|
19506
|
+
return group ? tabs.some(function (tab) {
|
|
19507
|
+
return tab.group === group && !tab.primary;
|
|
19508
|
+
}) : false;
|
|
19509
|
+
};
|
|
19510
|
+
|
|
19511
|
+
var _templateObject$19;
|
|
19512
|
+
var Close = styled__default.div(_templateObject$19 || (_templateObject$19 = _taggedTemplateLiteralLoose(["\n position: relative;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n\n background-color: var(--bgColor);\n color: var(--color);\n padding: 4px 8px;\n\n transition: --color 0.5s, --bgColor 0.5s;\n\n svg {\n width: 14px;\n height: 14px;\n\n * {\n transition: --color 0.5s;\n stroke: var(--color);\n }\n }\n"])));
|
|
19513
|
+
|
|
19365
19514
|
var Close$1 = function Close$1(props) {
|
|
19366
19515
|
var index = props.index,
|
|
19367
19516
|
_props$active = props.active,
|
|
@@ -19406,18 +19555,108 @@ var Close$1 = function Close$1(props) {
|
|
|
19406
19555
|
onClick: onClickClose,
|
|
19407
19556
|
width: '14px',
|
|
19408
19557
|
height: '14px',
|
|
19409
|
-
strokeWidth: '3px'
|
|
19410
|
-
|
|
19558
|
+
strokeWidth: '3px'
|
|
19559
|
+
}));
|
|
19560
|
+
};
|
|
19561
|
+
|
|
19562
|
+
var _templateObject$1a, _templateObject2$R;
|
|
19563
|
+
var StyledTab = styled__default.div(_templateObject$1a || (_templateObject$1a = _taggedTemplateLiteralLoose(["\n position: relative;\n flex: 1;\n white-space: nowrap;\n overflow: hidden;\n cursor: ", ";\n\n background-color: var(--bgColor);\n color: var(--color);\n\n padding: ", ";\n box-shadow: ", ";\n transition: --color 0.5s, --bgColor 0.5s;\n\n border-radius: ", ";\n\n /* Pseudo-element para o degrad\xEA */\n &.overflow::after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n width: 34px;\n height: 100%;\n\n background-image: linear-gradient(\n to right,\n transparent,\n var(--bgColor) 80%\n );\n transition: --color 0.5s, --bgColor 0.5s;\n }\n\n ", "\n"])), function (_ref) {
|
|
19564
|
+
var onClick = _ref.onClick;
|
|
19565
|
+
return onClick ? 'pointer' : 'default';
|
|
19566
|
+
}, function (_ref2) {
|
|
19567
|
+
var theme = _ref2.theme;
|
|
19568
|
+
return theme.spacings.s1 + " " + theme.spacings.s3;
|
|
19569
|
+
}, function (_ref3) {
|
|
19570
|
+
var $internal = _ref3.$internal,
|
|
19571
|
+
theme = _ref3.theme;
|
|
19572
|
+
return $internal ? 'none' : "0px 3px 6px " + theme.getColor('black', 15);
|
|
19573
|
+
}, function (_ref4) {
|
|
19574
|
+
var $internal = _ref4.$internal;
|
|
19575
|
+
return $internal ? '4px 4px 0 0' : 'none';
|
|
19576
|
+
}, function (_ref5) {
|
|
19577
|
+
var $primary = _ref5.$primary,
|
|
19578
|
+
$hasSiblings = _ref5.$hasSiblings,
|
|
19579
|
+
$internal = _ref5.$internal;
|
|
19580
|
+
return $primary && $hasSiblings && !$internal && styled.css(_templateObject2$R || (_templateObject2$R = _taggedTemplateLiteralLoose(["\n &::before {\n content: '';\n position: absolute;\n left: 4px;\n top: 4px;\n bottom: 4px;\n width: 3px;\n background-color: var(--colorBefore);\n transition: --colorBefore 0.5s;\n border-radius: 2px;\n }\n "])));
|
|
19581
|
+
});
|
|
19582
|
+
|
|
19583
|
+
var LabelItem = function LabelItem(props) {
|
|
19584
|
+
var children = props.children,
|
|
19585
|
+
onClick = props.onClick,
|
|
19586
|
+
primary = props.primary,
|
|
19587
|
+
hasSiblings = props.hasSiblings,
|
|
19588
|
+
internal = props.internal;
|
|
19589
|
+
|
|
19590
|
+
var _useState = React.useState(null),
|
|
19591
|
+
ref = _useState[0],
|
|
19592
|
+
setRef = _useState[1];
|
|
19593
|
+
|
|
19594
|
+
return React__default.createElement(StyledTab, Object.assign({
|
|
19595
|
+
ref: setRef,
|
|
19596
|
+
"$primary": primary,
|
|
19597
|
+
"$hasSiblings": hasSiblings,
|
|
19598
|
+
"$internal": internal,
|
|
19599
|
+
onClick: onClick
|
|
19600
|
+
}, useEllipsis(), ref && ref.scrollWidth > ref.offsetWidth ? {
|
|
19601
|
+
className: 'overflow'
|
|
19602
|
+
} : {}, {
|
|
19603
|
+
children: children
|
|
19411
19604
|
}));
|
|
19412
19605
|
};
|
|
19413
19606
|
|
|
19414
|
-
var _templateObject$
|
|
19415
|
-
var Container$
|
|
19607
|
+
var _templateObject$1b;
|
|
19608
|
+
var Container$p = styled__default.div(_templateObject$1b || (_templateObject$1b = _taggedTemplateLiteralLoose(["\n @property --bgColor {\n syntax: '<color>';\n initial-value: #ffffff;\n inherits: false;\n }\n\n @property --color {\n syntax: '<color>';\n initial-value: #000000;\n inherits: false;\n }\n\n @property --colorBefore {\n syntax: '<color>';\n initial-value: #3455ab;\n inherits: false;\n }\n\n &.active *,\n &.active ::before,\n &.active ::after {\n --bgColor: #3455ab;\n --color: #ffffff;\n --colorBefore: #ffffff;\n }\n\n display: flex;\n\n max-width: 176px;\n position: relative;\n"])));
|
|
19609
|
+
|
|
19610
|
+
var _excluded$3 = ["index"];
|
|
19611
|
+
|
|
19612
|
+
var VoidClose = function VoidClose() {
|
|
19613
|
+
return React__default.createElement(React__default.Fragment, null);
|
|
19614
|
+
};
|
|
19615
|
+
|
|
19616
|
+
var TabItem = function TabItem(props) {
|
|
19617
|
+
var _props$active = props.active,
|
|
19618
|
+
active = _props$active[0],
|
|
19619
|
+
setActive = _props$active[1],
|
|
19620
|
+
_props$tabs = props.tabs,
|
|
19621
|
+
tabs = _props$tabs[0],
|
|
19622
|
+
setTabs = _props$tabs[1],
|
|
19623
|
+
onClose = props.onClose,
|
|
19624
|
+
alwaysOpen = props.alwaysOpen;
|
|
19625
|
+
var CloseComponent = alwaysOpen || tabs.length < 2 ? VoidClose : Close$1;
|
|
19626
|
+
return React__default.createElement(React__default.Fragment, null, tabs.map(function (_ref) {
|
|
19627
|
+
var index = _ref.index,
|
|
19628
|
+
tab = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
19629
|
+
|
|
19630
|
+
var isActive = index === active;
|
|
19631
|
+
var hasSiblings = hasChildren(tabs, tab.group);
|
|
19632
|
+
var canClose = !props.internal && (!tab.primary || !hasSiblings);
|
|
19633
|
+
return React__default.createElement(Container$p, Object.assign({
|
|
19634
|
+
key: index
|
|
19635
|
+
}, isActive ? {
|
|
19636
|
+
className: 'active'
|
|
19637
|
+
} : {}), React__default.createElement(LabelItem, {
|
|
19638
|
+
children: tab.label,
|
|
19639
|
+
primary: tab.primary,
|
|
19640
|
+
hasSiblings: hasSiblings,
|
|
19641
|
+
onClick: isActive ? undefined : function () {
|
|
19642
|
+
return setActive(index, tab.data);
|
|
19643
|
+
},
|
|
19644
|
+
internal: props.internal
|
|
19645
|
+
}), canClose && React__default.createElement(CloseComponent, {
|
|
19646
|
+
index: index,
|
|
19647
|
+
active: [active, setActive],
|
|
19648
|
+
options: [tabs, setTabs],
|
|
19649
|
+
onClose: onClose
|
|
19650
|
+
}));
|
|
19651
|
+
}));
|
|
19652
|
+
};
|
|
19653
|
+
|
|
19654
|
+
var _templateObject$1c, _templateObject2$S, _templateObject3$J;
|
|
19416
19655
|
var delimiters = {
|
|
19417
19656
|
blue: ['blue'],
|
|
19418
19657
|
grey: ['warningGray']
|
|
19419
19658
|
};
|
|
19420
|
-
var Tabs = styled__default.
|
|
19659
|
+
var Tabs = styled__default.div(_templateObject$1c || (_templateObject$1c = _taggedTemplateLiteralLoose(["\n position: relative;\n overflow: hidden;\n\n display: flex;\n width: 100%;\n white-space: nowrap;\n\n ", "\n\n ", "\n\n\n /* exibe as setas de navega\xE7\xE3o vis\xEDveis ao passar o mouse sobre o container */\n &:hover .scroll-arrow.visible:nth-child(1) {\n left: 0;\n }\n & .scroll-arrow:nth-child(1) {\n left: -16px;\n }\n\n &:hover .scroll-arrow.visible:nth-last-child(1) {\n right: 0;\n }\n & .scroll-arrow:nth-last-child(1) {\n right: -16px;\n }\n"])), function (_ref) {
|
|
19421
19660
|
var spacing = _ref.$spacing;
|
|
19422
19661
|
|
|
19423
19662
|
var _getSpacings$split = getSpacings(spacing || {}, {
|
|
@@ -19431,46 +19670,15 @@ var Tabs = styled__default.ul(_templateObject2$Q || (_templateObject2$Q = _tagge
|
|
|
19431
19670
|
bottom = _getSpacings$split[2],
|
|
19432
19671
|
left = _getSpacings$split[3];
|
|
19433
19672
|
|
|
19434
|
-
return styled.css(
|
|
19673
|
+
return styled.css(_templateObject2$S || (_templateObject2$S = _taggedTemplateLiteralLoose(["\n margin: ", " 0 ", " 0;\n padding: 0 ", " 0 ", ";\n "])), top, bottom, right, left);
|
|
19435
19674
|
}, function (_ref2) {
|
|
19436
19675
|
var theme = _ref2.theme,
|
|
19437
19676
|
internal = _ref2.$internal,
|
|
19438
19677
|
delimiter = _ref2.$delimiter;
|
|
19439
|
-
|
|
19440
|
-
|
|
19441
|
-
if (delimiter === 'none') {
|
|
19442
|
-
return 'none';
|
|
19443
|
-
}
|
|
19444
|
-
|
|
19445
|
-
return internal ? "1px solid " + theme.getColor.apply(theme, delimiters[delimiter || 'grey']) : "2px solid " + theme.getColor.apply(theme, delimiters[delimiter || 'blue']);
|
|
19446
|
-
}();
|
|
19447
|
-
|
|
19448
|
-
return styled.css(_templateObject4$x || (_templateObject4$x = _taggedTemplateLiteralLoose(["\n border-bottom: ", ";\n\n + div {\n border: 1px solid ", ";\n border-top-width: 0px;\n border-radius: 0px 0px 2px 2px;\n padding: ", ";\n }\n "])), border, theme.getColor.apply(theme, delimiters.grey), theme.spacings.s3);
|
|
19449
|
-
}, function (_ref3) {
|
|
19450
|
-
var theme = _ref3.theme,
|
|
19451
|
-
internal = _ref3.$internal;
|
|
19452
|
-
return internal ? theme.spacings.s6 : 0;
|
|
19453
|
-
});
|
|
19454
|
-
var Tab = styled__default.div(_templateObject5$t || (_templateObject5$t = _taggedTemplateLiteralLoose(["\n ", "\n\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n white-space: nowrap;\n\n ", "\n\n transition-property: padding-right, background-color, color;\n transition-duration: 0.25s;\n transition-timing-function: ease-in-out;\n"])), function (_ref4) {
|
|
19455
|
-
var onClick = _ref4.onClick;
|
|
19456
|
-
return onClick && styled.css(_templateObject6$q || (_templateObject6$q = _taggedTemplateLiteralLoose(["\n cursor: pointer;\n "])));
|
|
19457
|
-
}, function (_ref5) {
|
|
19458
|
-
var theme = _ref5.theme,
|
|
19459
|
-
active = _ref5.$active,
|
|
19460
|
-
internal = _ref5.$internal;
|
|
19461
|
-
return styled.css(_templateObject7$q || (_templateObject7$q = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n padding: calc(", " * 1.5) ", ";\n gap: ", ";\n\n ", "\n\n color: ", ";\n "])), theme.colors[active ? 'blue' : 'white'], theme.spacings.s1, theme.spacings.s3, theme.spacings.s3, internal ? styled.css(_templateObject8$n || (_templateObject8$n = _taggedTemplateLiteralLoose(["\n border-radius: 4px 4px 0 0;\n\n ", "\n line-height: 17px;\n "])), function (_ref6) {
|
|
19462
|
-
var theme = _ref6.theme;
|
|
19463
|
-
return theme.useTypography('h4');
|
|
19464
|
-
}) : styled.css(_templateObject9$k || (_templateObject9$k = _taggedTemplateLiteralLoose(["\n box-shadow: 0px 3px 6px ", ";\n\n ", "\n line-height: 19px;\n "])), theme.getColor('black', 15), function (_ref7) {
|
|
19465
|
-
var theme = _ref7.theme;
|
|
19466
|
-
return theme.useTypography('h2');
|
|
19467
|
-
}), theme.colors[active ? 'white' : 'darkBlue']);
|
|
19678
|
+
var border = delimiter === 'none' ? 'none' : internal ? "1px solid " + theme.getColor.apply(theme, delimiters[delimiter || 'grey']) : "2px solid " + theme.getColor.apply(theme, delimiters[delimiter || 'blue']);
|
|
19679
|
+
return styled.css(_templateObject3$J || (_templateObject3$J = _taggedTemplateLiteralLoose(["\n border-bottom: ", ";\n + div {\n border: 1px solid ", ";\n border-top-width: 0px;\n border-radius: 0px 0px 2px 2px;\n padding: ", ";\n }\n "])), border, theme.getColor.apply(theme, delimiters.grey), theme.spacings.s3);
|
|
19468
19680
|
});
|
|
19469
19681
|
|
|
19470
|
-
var VoidClose = function VoidClose() {
|
|
19471
|
-
return React__default.createElement(React__default.Fragment, null);
|
|
19472
|
-
};
|
|
19473
|
-
|
|
19474
19682
|
var VoidProvider = function VoidProvider(props) {
|
|
19475
19683
|
return React__default.createElement(React__default.Fragment, {
|
|
19476
19684
|
children: props.children
|
|
@@ -19478,55 +19686,39 @@ var VoidProvider = function VoidProvider(props) {
|
|
|
19478
19686
|
};
|
|
19479
19687
|
|
|
19480
19688
|
var Tabs$1 = function Tabs$1(props) {
|
|
19481
|
-
var _ref =
|
|
19482
|
-
|
|
19483
|
-
|
|
19689
|
+
var _ref = typeof props.options[1] === 'function' ? props.options : React.useState(props.options),
|
|
19690
|
+
options = _ref[0],
|
|
19691
|
+
setOptions = _ref[1];
|
|
19484
19692
|
|
|
19485
|
-
var _ref2 =
|
|
19486
|
-
|
|
19487
|
-
|
|
19693
|
+
var _ref2 = Array.isArray(props.active) ? props.active : React.useState(props.active),
|
|
19694
|
+
active = _ref2[0],
|
|
19695
|
+
setActive = _ref2[1];
|
|
19488
19696
|
|
|
19697
|
+
var sortedTabs = sortTabs(options.map(function (tab, index) {
|
|
19698
|
+
return _extends({}, tab, {
|
|
19699
|
+
index: index
|
|
19700
|
+
});
|
|
19701
|
+
}));
|
|
19702
|
+
var activeTabIndex = sortedTabs.findIndex(function (tab) {
|
|
19703
|
+
return tab.index === active;
|
|
19704
|
+
});
|
|
19489
19705
|
var divProps = filterObject(props, ['options', 'active', 'internal', 'maxTabs', 'onMaxTabsExceeded', 'onClose', 'alwaysOpen', 'delimiter', 'spacing']);
|
|
19490
|
-
|
|
19491
|
-
return React__default.createElement(Container$n, Object.assign({}, divProps), React__default.createElement(Tabs, {
|
|
19706
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(Tabs, {
|
|
19492
19707
|
"$internal": props.internal,
|
|
19493
19708
|
"$delimiter": props.delimiter,
|
|
19494
|
-
"$spacing": props.spacing
|
|
19495
|
-
|
|
19496
|
-
|
|
19497
|
-
|
|
19498
|
-
|
|
19499
|
-
|
|
19500
|
-
|
|
19501
|
-
|
|
19502
|
-
|
|
19503
|
-
|
|
19504
|
-
|
|
19505
|
-
|
|
19506
|
-
|
|
19507
|
-
var x = target.offsetWidth * 100 / target.scrollWidth;
|
|
19508
|
-
target.scrollLeft += x * (e.deltaY > 0 ? 1 : -1) * 2;
|
|
19509
|
-
e.preventDefault();
|
|
19510
|
-
}
|
|
19511
|
-
}, options.map(function (tab, index) {
|
|
19512
|
-
return React__default.createElement("li", {
|
|
19513
|
-
key: index
|
|
19514
|
-
}, React__default.createElement(CloseComponent, {
|
|
19515
|
-
index: index,
|
|
19516
|
-
active: [active, setActive],
|
|
19517
|
-
options: [options, setOptions],
|
|
19518
|
-
onClose: props.onClose
|
|
19519
|
-
}), React__default.createElement(Tab, Object.assign({}, index === active ? {
|
|
19520
|
-
$active: true
|
|
19521
|
-
} : {
|
|
19522
|
-
onClick: function onClick() {
|
|
19523
|
-
return setActive(index, tab.data);
|
|
19524
|
-
}
|
|
19525
|
-
}, {
|
|
19526
|
-
"$internal": props.internal,
|
|
19527
|
-
children: tab.label
|
|
19528
|
-
})));
|
|
19529
|
-
})), options.map(function (tab, index) {
|
|
19709
|
+
"$spacing": props.spacing
|
|
19710
|
+
}, React__default.createElement(ScrollButtons, Object.assign({}, {
|
|
19711
|
+
activeTabIndex: activeTabIndex,
|
|
19712
|
+
divProps: divProps,
|
|
19713
|
+
tabsLength: options.length,
|
|
19714
|
+
internal: props.internal
|
|
19715
|
+
}), React__default.createElement(TabItem, {
|
|
19716
|
+
active: [active, setActive],
|
|
19717
|
+
tabs: [sortedTabs, setOptions],
|
|
19718
|
+
onClose: props.onClose,
|
|
19719
|
+
alwaysOpen: props.alwaysOpen,
|
|
19720
|
+
internal: props.internal
|
|
19721
|
+
}))), options.map(function (tab, index) {
|
|
19530
19722
|
if (!('component' in tab)) return React__default.createElement(React__default.Fragment, {
|
|
19531
19723
|
key: index
|
|
19532
19724
|
});
|
|
@@ -19560,7 +19752,7 @@ var Tabs$1 = function Tabs$1(props) {
|
|
|
19560
19752
|
data: tab.data,
|
|
19561
19753
|
setTab: setTab,
|
|
19562
19754
|
setLabel: setLabel
|
|
19563
|
-
}, index ===
|
|
19755
|
+
}, index === activeTabIndex ? {
|
|
19564
19756
|
active: true,
|
|
19565
19757
|
children: React__default.createElement("div", null, React__default.createElement(Component, {
|
|
19566
19758
|
data: tab.data,
|
|
@@ -19572,32 +19764,32 @@ var Tabs$1 = function Tabs$1(props) {
|
|
|
19572
19764
|
}));
|
|
19573
19765
|
};
|
|
19574
19766
|
|
|
19575
|
-
var _templateObject$
|
|
19576
|
-
var Container$
|
|
19767
|
+
var _templateObject$1d;
|
|
19768
|
+
var Container$q = styled__default.textarea(_templateObject$1d || (_templateObject$1d = _taggedTemplateLiteralLoose(["\n width: ", ";\n height: ", ";\n resize: none;\n outline: 0;\n border: 1px solid #c8c8c8;\n padding: 14px;\n border-radius: 4px;\n color: #192338;\n"])), function (props) {
|
|
19577
19769
|
return "" + props.width;
|
|
19578
19770
|
}, function (props) {
|
|
19579
19771
|
return "" + props.height;
|
|
19580
19772
|
});
|
|
19581
19773
|
|
|
19582
19774
|
var TextArea = function TextArea(props) {
|
|
19583
|
-
return React__default.createElement(Container$
|
|
19775
|
+
return React__default.createElement(Container$q, Object.assign({}, props));
|
|
19584
19776
|
};
|
|
19585
19777
|
|
|
19586
|
-
var _templateObject$
|
|
19587
|
-
var Container$
|
|
19778
|
+
var _templateObject$1e, _templateObject2$T, _templateObject3$K, _templateObject4$x, _templateObject5$t, _templateObject6$q;
|
|
19779
|
+
var Container$r = styled__default.div(_templateObject$1e || (_templateObject$1e = _taggedTemplateLiteralLoose(["\n border-radius: 4px;\n width: ", ";\n height: 88px;\n border: 1px solid transparent;\n position: relative;\n\n ", "\n\n ", "\n\n ", "\n\n svg {\n cursor: pointer;\n position: absolute;\n top: 14px;\n right: 14px;\n width: 13px;\n height: 13px;\n }\n"])), function (props) {
|
|
19588
19780
|
return props.size === 'large' ? '837px' : '460px';
|
|
19589
19781
|
}, function (props) {
|
|
19590
|
-
return props.color === 'success' && styled.css(_templateObject2$
|
|
19782
|
+
return props.color === 'success' && styled.css(_templateObject2$T || (_templateObject2$T = _taggedTemplateLiteralLoose(["\n background-color: #fcfff5;\n opacity: 1;\n border-color: #a8c599;\n h4 {\n color: #1e561f;\n }\n p {\n color: #1e561fcc;\n }\n "])));
|
|
19591
19783
|
}, function (props) {
|
|
19592
19784
|
return props.color === 'error' && styled.css(_templateObject3$K || (_templateObject3$K = _taggedTemplateLiteralLoose(["\n background-color: #fff6f6;\n opacity: 1;\n border-color: #973937;\n h4 {\n color: #973937;\n }\n p {\n color: #973937;\n }\n "])));
|
|
19593
19785
|
}, function (props) {
|
|
19594
|
-
return props.color === 'warning' && styled.css(_templateObject4$
|
|
19786
|
+
return props.color === 'warning' && styled.css(_templateObject4$x || (_templateObject4$x = _taggedTemplateLiteralLoose(["\n background-color: #fffaf3;\n opacity: 1;\n border-color: #ccbea0;\n h4 {\n color: #7a4d05;\n }\n p {\n color: #7a4d05cc;\n }\n "])));
|
|
19595
19787
|
});
|
|
19596
|
-
var IconContainer$2 = styled__default.div(_templateObject5$
|
|
19597
|
-
var IconContent = styled__default.div(_templateObject6$
|
|
19788
|
+
var IconContainer$2 = styled__default.div(_templateObject5$t || (_templateObject5$t = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n padding: 14px 14px 0 0;\n margin: 0;\n"])));
|
|
19789
|
+
var IconContent = styled__default.div(_templateObject6$q || (_templateObject6$q = _taggedTemplateLiteralLoose(["\n width: 100%;\n padding: 13px 0 21px 28px;\n display: flex;\n flex: 1;\n flex-direction: column;\n\n h4 {\n margin-bottom: 7px;\n font-size: 18p;\n }\n p {\n margin: 0;\n font-size: 14px;\n max-width: 380px;\n }\n"])));
|
|
19598
19790
|
|
|
19599
19791
|
var Toast = function Toast(props) {
|
|
19600
|
-
return React__default.createElement(Container$
|
|
19792
|
+
return React__default.createElement(Container$r, Object.assign({}, props), React__default.createElement(IconContainer$2, null, React__default.createElement(Icon, {
|
|
19601
19793
|
type: 'feather',
|
|
19602
19794
|
icon: 'x',
|
|
19603
19795
|
onClick: function onClick() {
|
|
@@ -19606,9 +19798,9 @@ var Toast = function Toast(props) {
|
|
|
19606
19798
|
})), React__default.createElement(IconContent, null, React__default.createElement("h4", null, props.title), React__default.createElement("p", null, " ", props.description)));
|
|
19607
19799
|
};
|
|
19608
19800
|
|
|
19609
|
-
var _templateObject$
|
|
19610
|
-
var Image = styled__default.img(_templateObject$
|
|
19611
|
-
var Container$
|
|
19801
|
+
var _templateObject$1f, _templateObject2$U, _templateObject3$L, _templateObject4$y, _templateObject5$u;
|
|
19802
|
+
var Image = styled__default.img(_templateObject$1f || (_templateObject$1f = _taggedTemplateLiteralLoose(["\n max-width: 100%;\n max-height: 100%;\n"])));
|
|
19803
|
+
var Container$s = styled__default.div(_templateObject2$U || (_templateObject2$U = _taggedTemplateLiteralLoose(["\n position: relative;\n display: inline-flex;\n\n &,\n ", " {\n width: ", ";\n\n height: ", ";\n }\n"])), Image, function (_ref) {
|
|
19612
19804
|
var width = _ref.width;
|
|
19613
19805
|
|
|
19614
19806
|
switch (typeof width) {
|
|
@@ -19639,23 +19831,23 @@ var Dimmer = styled__default.div(_templateObject3$L || (_templateObject3$L = _ta
|
|
|
19639
19831
|
var theme = _ref3.theme;
|
|
19640
19832
|
return theme.getColor('greyishBlue', 50);
|
|
19641
19833
|
});
|
|
19642
|
-
var Button$6 = styled__default(Button$1)(_templateObject4$
|
|
19834
|
+
var Button$6 = styled__default(Button$1)(_templateObject4$y || (_templateObject4$y = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n"])), function (_ref4) {
|
|
19643
19835
|
var theme = _ref4.theme;
|
|
19644
19836
|
return theme.getColor('white', 50);
|
|
19645
19837
|
});
|
|
19646
|
-
var ModalContent = styled__default.div(_templateObject5$
|
|
19838
|
+
var ModalContent = styled__default.div(_templateObject5$u || (_templateObject5$u = _taggedTemplateLiteralLoose(["\n position: absolute;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n\n img {\n max-height: 100%;\n max-width: 100%;\n }\n"])));
|
|
19647
19839
|
|
|
19648
|
-
var _excluded$
|
|
19840
|
+
var _excluded$4 = ["src", "defaultClickOptions"];
|
|
19649
19841
|
|
|
19650
19842
|
var Zoom = function Zoom(props) {
|
|
19651
19843
|
var src = props.src,
|
|
19652
|
-
imgProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
19844
|
+
imgProps = _objectWithoutPropertiesLoose(props, _excluded$4);
|
|
19653
19845
|
|
|
19654
19846
|
var _useState = React.useState(false),
|
|
19655
19847
|
modalOpened = _useState[0],
|
|
19656
19848
|
setModalOpened = _useState[1];
|
|
19657
19849
|
|
|
19658
|
-
return React__default.createElement(React__default.Fragment, null, React__default.createElement(Container$
|
|
19850
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(Container$s, Object.assign({}, imgProps, {
|
|
19659
19851
|
onClick: function onClick() {
|
|
19660
19852
|
return setModalOpened(true);
|
|
19661
19853
|
}
|