@mw-kit/mw-ui 1.7.107 → 1.7.109
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/Tabs/components/TabItem/index.d.ts +3 -2
- package/dist/components/Tabs/functions.d.ts +3 -1
- package/dist/components/Tabs/index.d.ts +5 -2
- package/dist/components/Tabs/interfaces.d.ts +18 -12
- package/dist/components/Tabs/styled.d.ts +1 -0
- package/dist/index.js +44 -24
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +44 -24
- package/dist/index.modern.js.map +1 -1
- package/dist/interfaces.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -19503,6 +19503,14 @@ var hasChildren = function hasChildren(tabs, group) {
|
|
|
19503
19503
|
return tab.group === group && !tab.primary;
|
|
19504
19504
|
}) : false;
|
|
19505
19505
|
};
|
|
19506
|
+
var mapComponents = function mapComponents(obj) {
|
|
19507
|
+
return obj;
|
|
19508
|
+
};
|
|
19509
|
+
var buildComponent = function buildComponent(component, provider) {
|
|
19510
|
+
return provider ? Object.assign(component, {
|
|
19511
|
+
provider: provider
|
|
19512
|
+
}) : component;
|
|
19513
|
+
};
|
|
19506
19514
|
|
|
19507
19515
|
var _templateObject$19;
|
|
19508
19516
|
var Close = styled.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"])));
|
|
@@ -19532,13 +19540,12 @@ var Close$1 = function Close$1(props) {
|
|
|
19532
19540
|
return;
|
|
19533
19541
|
}
|
|
19534
19542
|
|
|
19535
|
-
|
|
19536
|
-
|
|
19537
|
-
|
|
19538
|
-
|
|
19539
|
-
setActive(newactive, newOptions[newactive].data);
|
|
19540
|
-
}
|
|
19543
|
+
var newactive = function () {
|
|
19544
|
+
if (index < active) return active - 1;
|
|
19545
|
+
return active > 0 ? active - 1 : active;
|
|
19546
|
+
}();
|
|
19541
19547
|
|
|
19548
|
+
setActive(newactive, newOptions[newactive].data);
|
|
19542
19549
|
setOptions(newOptions);
|
|
19543
19550
|
});
|
|
19544
19551
|
} catch (e) {
|
|
@@ -19616,10 +19623,11 @@ var TabItem = function TabItem(props) {
|
|
|
19616
19623
|
_props$tabs = props.tabs,
|
|
19617
19624
|
tabs = _props$tabs[0],
|
|
19618
19625
|
setTabs = _props$tabs[1],
|
|
19626
|
+
sortedTabs = props.sortedTabs,
|
|
19619
19627
|
onClose = props.onClose,
|
|
19620
19628
|
alwaysOpen = props.alwaysOpen;
|
|
19621
19629
|
var CloseComponent = alwaysOpen || tabs.length < 2 ? VoidClose : Close$1;
|
|
19622
|
-
return React__default.createElement(React__default.Fragment, null,
|
|
19630
|
+
return React__default.createElement(React__default.Fragment, null, sortedTabs.map(function (_ref) {
|
|
19623
19631
|
var index = _ref.index,
|
|
19624
19632
|
tab = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
19625
19633
|
|
|
@@ -19647,12 +19655,13 @@ var TabItem = function TabItem(props) {
|
|
|
19647
19655
|
}));
|
|
19648
19656
|
};
|
|
19649
19657
|
|
|
19650
|
-
var _templateObject$1c, _templateObject2$S, _templateObject3$J;
|
|
19658
|
+
var _templateObject$1c, _templateObject2$S, _templateObject3$J, _templateObject4$x;
|
|
19651
19659
|
var delimiters = {
|
|
19652
19660
|
blue: ['blue'],
|
|
19653
19661
|
grey: ['warningGray']
|
|
19654
19662
|
};
|
|
19655
|
-
var
|
|
19663
|
+
var ComponentContainer = styled.div(_templateObject$1c || (_templateObject$1c = _taggedTemplateLiteralLoose([""])));
|
|
19664
|
+
var Tabs = styled.div(_templateObject2$S || (_templateObject2$S = _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) {
|
|
19656
19665
|
var spacing = _ref.$spacing;
|
|
19657
19666
|
|
|
19658
19667
|
var _getSpacings$split = getSpacings(spacing || {}, {
|
|
@@ -19666,13 +19675,13 @@ var Tabs = styled.div(_templateObject$1c || (_templateObject$1c = _taggedTemplat
|
|
|
19666
19675
|
bottom = _getSpacings$split[2],
|
|
19667
19676
|
left = _getSpacings$split[3];
|
|
19668
19677
|
|
|
19669
|
-
return css(
|
|
19678
|
+
return css(_templateObject3$J || (_templateObject3$J = _taggedTemplateLiteralLoose(["\n margin: ", " 0 ", " 0;\n padding: 0 ", " 0 ", ";\n "])), top, bottom, right, left);
|
|
19670
19679
|
}, function (_ref2) {
|
|
19671
19680
|
var theme = _ref2.theme,
|
|
19672
19681
|
internal = _ref2.$internal,
|
|
19673
19682
|
delimiter = _ref2.$delimiter;
|
|
19674
19683
|
var border = delimiter === 'none' ? 'none' : internal ? "1px solid " + theme.getColor.apply(theme, delimiters[delimiter || 'grey']) : "2px solid " + theme.getColor.apply(theme, delimiters[delimiter || 'blue']);
|
|
19675
|
-
return css(
|
|
19684
|
+
return css(_templateObject4$x || (_templateObject4$x = _taggedTemplateLiteralLoose(["\n border-bottom: ", ";\n + ", " {\n border: 1px solid ", ";\n border-top-width: 0px;\n border-radius: 0px 0px 2px 2px;\n padding: ", ";\n }\n "])), border, ComponentContainer, theme.getColor.apply(theme, delimiters.grey), theme.spacings.s3);
|
|
19676
19685
|
});
|
|
19677
19686
|
|
|
19678
19687
|
var VoidProvider = function VoidProvider(props) {
|
|
@@ -19681,7 +19690,9 @@ var VoidProvider = function VoidProvider(props) {
|
|
|
19681
19690
|
});
|
|
19682
19691
|
};
|
|
19683
19692
|
|
|
19684
|
-
var
|
|
19693
|
+
var Component$3 = function Component(props) {
|
|
19694
|
+
var components = props.components || {};
|
|
19695
|
+
|
|
19685
19696
|
var _ref = typeof props.options[1] === 'function' ? props.options : useState(props.options),
|
|
19686
19697
|
options = _ref[0],
|
|
19687
19698
|
setOptions = _ref[1];
|
|
@@ -19709,17 +19720,20 @@ var Tabs$1 = function Tabs$1(props) {
|
|
|
19709
19720
|
internal: props.internal
|
|
19710
19721
|
}), React__default.createElement(TabItem, {
|
|
19711
19722
|
active: [active, setActive],
|
|
19712
|
-
tabs: [
|
|
19723
|
+
tabs: [options, setOptions],
|
|
19724
|
+
sortedTabs: sortedTabs,
|
|
19713
19725
|
onClose: props.onClose,
|
|
19714
19726
|
alwaysOpen: props.alwaysOpen,
|
|
19715
19727
|
internal: props.internal
|
|
19716
19728
|
}))), options.map(function (tab, index) {
|
|
19717
|
-
if (
|
|
19718
|
-
|
|
19719
|
-
|
|
19720
|
-
|
|
19721
|
-
|
|
19722
|
-
|
|
19729
|
+
if (tab.component === undefined) {
|
|
19730
|
+
return React__default.createElement(React__default.Fragment, {
|
|
19731
|
+
key: index
|
|
19732
|
+
});
|
|
19733
|
+
}
|
|
19734
|
+
|
|
19735
|
+
var Component = components[tab.component];
|
|
19736
|
+
var Provider = Component.provider || VoidProvider;
|
|
19723
19737
|
|
|
19724
19738
|
var setTab = function setTab(s) {
|
|
19725
19739
|
setOptions(function (prev) {
|
|
@@ -19749,8 +19763,9 @@ var Tabs$1 = function Tabs$1(props) {
|
|
|
19749
19763
|
setLabel: setLabel
|
|
19750
19764
|
}, index === active ? {
|
|
19751
19765
|
active: true,
|
|
19752
|
-
children: React__default.createElement(
|
|
19766
|
+
children: React__default.createElement(ComponentContainer, null, React__default.createElement(Component, {
|
|
19753
19767
|
data: tab.data,
|
|
19768
|
+
label: tab.label,
|
|
19754
19769
|
setLabel: setLabel
|
|
19755
19770
|
}))
|
|
19756
19771
|
} : {
|
|
@@ -19759,6 +19774,11 @@ var Tabs$1 = function Tabs$1(props) {
|
|
|
19759
19774
|
}));
|
|
19760
19775
|
};
|
|
19761
19776
|
|
|
19777
|
+
var Tabs$1 = Object.assign(Component$3, {
|
|
19778
|
+
mapComponents: mapComponents,
|
|
19779
|
+
buildComponent: buildComponent
|
|
19780
|
+
});
|
|
19781
|
+
|
|
19762
19782
|
var _templateObject$1d;
|
|
19763
19783
|
var Container$q = styled.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) {
|
|
19764
19784
|
return "" + props.width;
|
|
@@ -19770,7 +19790,7 @@ var TextArea = function TextArea(props) {
|
|
|
19770
19790
|
return React__default.createElement(Container$q, Object.assign({}, props));
|
|
19771
19791
|
};
|
|
19772
19792
|
|
|
19773
|
-
var _templateObject$1e, _templateObject2$T, _templateObject3$K, _templateObject4$
|
|
19793
|
+
var _templateObject$1e, _templateObject2$T, _templateObject3$K, _templateObject4$y, _templateObject5$t, _templateObject6$q;
|
|
19774
19794
|
var Container$r = styled.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) {
|
|
19775
19795
|
return props.size === 'large' ? '837px' : '460px';
|
|
19776
19796
|
}, function (props) {
|
|
@@ -19778,7 +19798,7 @@ var Container$r = styled.div(_templateObject$1e || (_templateObject$1e = _tagged
|
|
|
19778
19798
|
}, function (props) {
|
|
19779
19799
|
return props.color === 'error' && 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 "])));
|
|
19780
19800
|
}, function (props) {
|
|
19781
|
-
return props.color === 'warning' && css(_templateObject4$
|
|
19801
|
+
return props.color === 'warning' && css(_templateObject4$y || (_templateObject4$y = _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 "])));
|
|
19782
19802
|
});
|
|
19783
19803
|
var IconContainer$2 = styled.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"])));
|
|
19784
19804
|
var IconContent = styled.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"])));
|
|
@@ -19793,7 +19813,7 @@ var Toast = function Toast(props) {
|
|
|
19793
19813
|
})), React__default.createElement(IconContent, null, React__default.createElement("h4", null, props.title), React__default.createElement("p", null, " ", props.description)));
|
|
19794
19814
|
};
|
|
19795
19815
|
|
|
19796
|
-
var _templateObject$1f, _templateObject2$U, _templateObject3$L, _templateObject4$
|
|
19816
|
+
var _templateObject$1f, _templateObject2$U, _templateObject3$L, _templateObject4$z, _templateObject5$u;
|
|
19797
19817
|
var Image = styled.img(_templateObject$1f || (_templateObject$1f = _taggedTemplateLiteralLoose(["\n max-width: 100%;\n max-height: 100%;\n"])));
|
|
19798
19818
|
var Container$s = styled.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) {
|
|
19799
19819
|
var width = _ref.width;
|
|
@@ -19826,7 +19846,7 @@ var Dimmer = styled.div(_templateObject3$L || (_templateObject3$L = _taggedTempl
|
|
|
19826
19846
|
var theme = _ref3.theme;
|
|
19827
19847
|
return theme.getColor('greyishBlue', 50);
|
|
19828
19848
|
});
|
|
19829
|
-
var Button$6 = styled(Button$1)(_templateObject4$
|
|
19849
|
+
var Button$6 = styled(Button$1)(_templateObject4$z || (_templateObject4$z = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n"])), function (_ref4) {
|
|
19830
19850
|
var theme = _ref4.theme;
|
|
19831
19851
|
return theme.getColor('white', 50);
|
|
19832
19852
|
});
|