@stokr/components-library 2.3.65-beta.1 → 2.3.65-beta.11
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/2FA/main-flow.js +28 -7
- package/dist/components/AdminDashboard/Table/ReactTable.js +123 -7
- package/dist/components/Chips/Chip.js +1 -2
- package/dist/components/Chips/Chip.styles.js +3 -2
- package/dist/components/Input/Input.js +33 -33
- package/dist/components/Input/MultiSelect.js +319 -0
- package/dist/components/Input/SearchInput.js +78 -0
- package/dist/components/Input/SearchInput.styles.js +25 -0
- package/dist/components/Input/Select.js +51 -28
- package/dist/components/Modal/SideModal.js +82 -0
- package/dist/components/Modal/SideModal.styles.js +21 -0
- package/dist/components/Payment/PaymentDetailsCard.js +189 -0
- package/dist/components/Payment/PaymentDisplay.js +2 -12
- package/dist/components/ProfileBox/ProfileBox.js +2 -1
- package/dist/components/Snackbar/Snackbar.js +193 -0
- package/dist/components/Snackbar/Snackbar.styles.js +97 -0
- package/dist/components/Snackbar/SnackbarProvider.js +81 -0
- package/dist/components/Snackbar/index.js +32 -0
- package/dist/components/Snackbar/useSnackbar.js +43 -0
- package/dist/components/StatusTag/StatusTag.js +175 -0
- package/dist/components/StatusTag/StatusTag.styles.js +37 -0
- package/dist/components/StepsProgress/StepIndicator.js +59 -0
- package/dist/components/StepsProgress/StepIndicator.styles.js +30 -0
- package/dist/components/TextLink/TextLink.styles.js +1 -1
- package/dist/components/Timeline/TimelineStep.js +2 -2
- package/dist/constants/globalVariables.js +41 -2
- package/dist/context/Checkbox/CheckboxContext.js +0 -1
- package/dist/index.js +66 -0
- package/dist/static/images/bmn2-logo.svg +9 -0
- package/dist/static/images/document-icon.svg +3 -0
- package/dist/static/images/plus-icon.svg +4 -0
- package/dist/static/images/search-icon.svg +3 -0
- package/dist/static/images/sent-icon.svg +10 -0
- package/dist/static/images/transfer-icon.svg +10 -0
- package/dist/utils/formatCurrencyValue.js +43 -3
- package/package.json +3 -2
- package/dist/components/2FA/EnterCode.stories.js +0 -35
- package/dist/components/2FA/disable-2fa-flow.stories.js +0 -31
- package/dist/components/2FA/enable-2fa-flow.stories.js +0 -31
- package/dist/components/2FA/login-with-otp-flow.stories.js +0 -31
- package/dist/components/2FA/main-flow.stories.js +0 -33
- package/dist/components/AccountBalance/AccountBalance.stories.js +0 -83
- package/dist/components/AdminDashboard/Table/ReactTable.stories.js +0 -406
- package/dist/components/AgreementItem/AgreementItem.stories.js +0 -105
- package/dist/components/AnalyticGraphs/Analytic.js +0 -541
- package/dist/components/AnalyticGraphs/Analytic.styles.js +0 -25
- package/dist/components/BackButton/BackButton.stories.js +0 -32
- package/dist/components/Background/Background.stories.js +0 -75
- package/dist/components/BarChart/BarChart.js +0 -263
- package/dist/components/BarChart/BarChart.stories.js +0 -66
- package/dist/components/BarChart/BarChart.styles.js +0 -26
- package/dist/components/BarChartLegend/BarChartLegend.js +0 -79
- package/dist/components/BarChartLegend/BarChartLegend.styles.js +0 -21
- package/dist/components/BasicTable/BasicTable.stories.js +0 -59
- package/dist/components/BlogPost/BlogPost.stories.js +0 -160
- package/dist/components/Button/Button.stories.js +0 -146
- package/dist/components/Button/GlareButton.stories.js +0 -132
- package/dist/components/CapitalRaisedSummary/CapitalRaisedSummery.stories.js +0 -42
- package/dist/components/ChartBox/ChartBox.js +0 -41
- package/dist/components/ChartBox/ChartBox.stories.js +0 -17
- package/dist/components/ChartBox/ChartBox.styles.js +0 -27
- package/dist/components/ChartBox/ChartBoxDistribution.js +0 -27
- package/dist/components/ChartBox/ChartBoxDistribution.stories.js +0 -18
- package/dist/components/ChartLegend/ChartLegend.stories.js +0 -90
- package/dist/components/Checkbox/Checkbox.stories.js +0 -88
- package/dist/components/Checklist/ChecklistCard.stories.js +0 -102
- package/dist/components/Checklist/UserChecklist.js +0 -184
- package/dist/components/Checklist/UserChecklist.stories.js +0 -317
- package/dist/components/Chips/Chip.stories.js +0 -36
- package/dist/components/Chips/ChipsWrapper.stories.js +0 -47
- package/dist/components/ComponentScroll/ComponentScroll.stories.js +0 -111
- package/dist/components/CryptoAddress/CryptoAddress.stories.js +0 -205
- package/dist/components/CryptoAddressDetails/CryptoAddressDetails.stories.js +0 -70
- package/dist/components/DonutChart/DonutChart.stories.js +0 -54
- package/dist/components/FAQ/FAQ.stories.js +0 -76
- package/dist/components/Footer/Footer.stories.js +0 -49
- package/dist/components/Footer/FooterLayout.stories.js +0 -26
- package/dist/components/Footer/FooterMenu.stories.js +0 -113
- package/dist/components/Footer/mangopay.png +0 -0
- package/dist/components/Footer/mangopay.svg +0 -20
- package/dist/components/ForgotPasswordModal/ForgotPasswordModal.stories.js +0 -69
- package/dist/components/Form/Form.stories.js +0 -32
- package/dist/components/FullscreenCard/FullscreenCard.styles.js +0 -27
- package/dist/components/Header/Header.stories.js +0 -192
- package/dist/components/InfoIcon/InfoIcon.stories.js +0 -299
- package/dist/components/InfoPanel/InfoPanel.js +0 -124
- package/dist/components/Input/DatePickerInput.stories.js +0 -87
- package/dist/components/Input/Input.stories.js +0 -142
- package/dist/components/Input/InputPassword.stories.js +0 -80
- package/dist/components/Input/InputWithButton.stories.js +0 -75
- package/dist/components/Input/OtpInput.stories.js +0 -57
- package/dist/components/Input/RangeInput.stories.js +0 -58
- package/dist/components/Input/Select.stories.js +0 -139
- package/dist/components/InvestCalculator/InvestCalculator.stories.js +0 -135
- package/dist/components/InvestmentStat/InvestmentStat.stories.js +0 -52
- package/dist/components/KYCFlow/BasicInfo.js +0 -448
- package/dist/components/KYCFlow/Confirmation.js +0 -46
- package/dist/components/KYCFlow/DocumentFileUpload.js +0 -263
- package/dist/components/KYCFlow/DocumentScan.js +0 -75
- package/dist/components/KYCFlow/DocumentScanUpload.js +0 -251
- package/dist/components/KYCFlow/DocumentSelect.js +0 -118
- package/dist/components/KYCFlow/DocumentSuccess.js +0 -63
- package/dist/components/KYCFlow/DocumentUpload.js +0 -53
- package/dist/components/KYCFlow/DocumentVerificationType.js +0 -131
- package/dist/components/KYCFlow/FaceScan.js +0 -54
- package/dist/components/KYCFlow/FaceScanRecognition.js +0 -61
- package/dist/components/KYCFlow/FaceScanSuccess.js +0 -56
- package/dist/components/KYCFlow/Terms.js +0 -119
- package/dist/components/KYCFlow/_styles.js +0 -111
- package/dist/components/KYCFlow/index.js +0 -97
- package/dist/components/KYCSelectBox/KYCSelectBox.styles.js +0 -29
- package/dist/components/LatestUpdate/LatestUpdate.stories.js +0 -58
- package/dist/components/Layout/Layout.stories.js +0 -60
- package/dist/components/LearnMoreCarousel/LearnMoreCarousel.stories.js +0 -66
- package/dist/components/LearnMorePage/LearnMore.stories.js +0 -48
- package/dist/components/LearnMorePage/LearnMoreItem.stories.js +0 -62
- package/dist/components/LearnMoreSection/LearnMore.stories.js +0 -30
- package/dist/components/LearnMoreSection/LearnMoreItem.stories.js +0 -59
- package/dist/components/LoginModal/LoginModal.stories.js +0 -74
- package/dist/components/MatomoConnect/Matomo.js +0 -228
- package/dist/components/MatomoConnect/Matomo_fuckup.js +0 -387
- package/dist/components/Modal/Modal.stories.js +0 -75
- package/dist/components/Modal/NewVentureModal/NewVentureModal.stories.js +0 -150
- package/dist/components/Modal/PaymentModal.stories.js +0 -57
- package/dist/components/MultiProgressBar/MultiProgressBar.stories.js +0 -67
- package/dist/components/Newsletter/Newsletter.stories.js +0 -16
- package/dist/components/NotificationContext/NotificationContext.js +0 -141
- package/dist/components/Number/Number.stories.js +0 -92
- package/dist/components/Pagination/Pagination.stories.js +0 -83
- package/dist/components/Pagination/PaginationControls.stories.js +0 -112
- package/dist/components/Payment/PaymentDisplay.stories.js +0 -302
- package/dist/components/Payment/TimerComponent.stories.js +0 -236
- package/dist/components/Process/Process.stories.js +0 -42
- package/dist/components/ProfileBadge/ProfileBadge.stories.js +0 -45
- package/dist/components/ProfileBox/ProfileBox.stories.js +0 -35
- package/dist/components/ProfileHeader/ProfileHeader.js +0 -252
- package/dist/components/ProfileHeader/ProfileHeader.styles.js +0 -65
- package/dist/components/ProfileStat/ProfileStat.stories.js +0 -66
- package/dist/components/ProofOfAddress/ProofOfAddress.styles.js +0 -53
- package/dist/components/QRCode/QRCode.stories.js +0 -104
- package/dist/components/Radio/Radio.stories.js +0 -73
- package/dist/components/RefreshButton/RefreshButton.stories.js +0 -38
- package/dist/components/RegisterAlgorand/AlgoAddressName.js +0 -138
- package/dist/components/RegisterAlgorand/AlgoAdressSelect.js +0 -443
- package/dist/components/RegisterAlgorand/AlgoConnectWallet.js +0 -47
- package/dist/components/RegisterAlgorand/AlgoSuccess.js +0 -38
- package/dist/components/RegisterAlgorand/Algorand.stories.js +0 -80
- package/dist/components/RegisterAlgorand/ChooseWallet.js +0 -97
- package/dist/components/RegisterAlgorand/SelectProject.js +0 -89
- package/dist/components/RegisterAlgorand/_styles.js +0 -28
- package/dist/components/RegisterAlgorand/flow.js +0 -409
- package/dist/components/RegisterAlgorand/flowWithMemo.js +0 -410
- package/dist/components/RegisterAlgorand/index.js +0 -48
- package/dist/components/RegisterConfirmModal/RegisterConfirmModal.stories.js +0 -41
- package/dist/components/RegisterEthereum/EthAddressLedger.js +0 -226
- package/dist/components/RegisterEthereum/EthAddressMetamask.js +0 -204
- package/dist/components/RegisterEthereum/EthAddressName.js +0 -135
- package/dist/components/RegisterEthereum/EthConnectLedger.js +0 -194
- package/dist/components/RegisterEthereum/EthConnectMetamask.js +0 -35
- package/dist/components/RegisterEthereum/EthFinish.js +0 -41
- package/dist/components/RegisterEthereum/EthIntro.js +0 -95
- package/dist/components/RegisterEthereum/_styles.js +0 -28
- package/dist/components/RegisterEthereum/index.js +0 -68
- package/dist/components/RegisterModal/RegisterModal.stories.js +0 -49
- package/dist/components/RequestDataBox/RequestDataBox.stories.js +0 -37
- package/dist/components/RiskQuestionnaire/RiskQuestionnaireContext.js +0 -185
- package/dist/components/RiskQuestionnaire/_styles.js +0 -15
- package/dist/components/SEO/SEO.stories.js +0 -60
- package/dist/components/SideLine/SideLine.stories.js +0 -28
- package/dist/components/SigningSubflow/SignSubAddressMetamask.js +0 -137
- package/dist/components/SigningSubflow/SignSubConnectLedger.js +0 -150
- package/dist/components/SigningSubflow/SignSubConnectMetamask.js +0 -137
- package/dist/components/SigningSubflow/SignSubIntro.js +0 -55
- package/dist/components/SigningSubflow/SignSubSendLedger.js +0 -150
- package/dist/components/SigningSubflow/SignSubSendMetamask.js +0 -62
- package/dist/components/SigningSubflow/SignSubTransactionLedger.js +0 -161
- package/dist/components/SigningSubflow/SignSubTransactionMetamask.js +0 -166
- package/dist/components/SigningSubflow/_styles.js +0 -34
- package/dist/components/SigningSubflow/index.js +0 -32
- package/dist/components/Slider/Slider.stories.js +0 -68
- package/dist/components/StepController/StepController.stories.js +0 -60
- package/dist/components/StepController/StepControllerProgress.stories.js +0 -49
- package/dist/components/StepsProgress/StepsProgress.stories.js +0 -49
- package/dist/components/Switch/Switch.stories.js +0 -81
- package/dist/components/Tabs/Tabs.stories.js +0 -36
- package/dist/components/TabsNav/TabNav.stories.js +0 -40
- package/dist/components/TabsNav/TabsNav.stories.js +0 -37
- package/dist/components/TeamOverview/TeamOverview.stories.js +0 -76
- package/dist/components/TermsModal/TermsModal.stories.js +0 -31
- package/dist/components/Text/Headline.stories.js +0 -48
- package/dist/components/Text/Text.stories.js +0 -70
- package/dist/components/Timeline/Timeline.stories.js +0 -393
- package/dist/components/ToDoList/ToDoList.stories.js +0 -133
- package/dist/components/ToDoList/ToDoListTask.stories.js +0 -70
- package/dist/components/TransactionDetails/TransactionDetails.stories.js +0 -55
- package/dist/components/TransactionDetails/TransactionDetailsTable.stories.js +0 -305
- package/dist/components/TransactionInfo/TransactionInfo.stories.js +0 -61
- package/dist/components/TwoFactorModal/TwoFactorModal.js +0 -100
- package/dist/components/VerifyEmailModal/VerifyEmailModal.stories.js +0 -59
- package/dist/components/headerHo/HeaderHo.stories.js +0 -35
- package/dist/components/icons/Arrow.stories.js +0 -42
- package/dist/components/icons/ArrowSimple.stories.js +0 -48
- package/dist/components/icons/Check.stories.js +0 -22
- package/dist/components/icons/Facebook.stories.js +0 -21
- package/dist/components/icons/Facebook_Logo.png +0 -0
- package/dist/components/icons/Info.stories.js +0 -16
- package/dist/components/icons/Instagram.stories.js +0 -21
- package/dist/components/icons/LI-In-Bug.png +0 -0
- package/dist/components/icons/LinkIcon.stories.js +0 -21
- package/dist/components/icons/LinkedIn.stories.js +0 -16
- package/dist/components/icons/Medium.stories.js +0 -16
- package/dist/components/icons/Reddit.stories.js +0 -21
- package/dist/components/icons/Share.stories.js +0 -16
- package/dist/components/icons/Telegram-Logo.png +0 -0
- package/dist/components/icons/Telegram.stories.js +0 -16
- package/dist/components/icons/Twitter.stories.js +0 -21
- package/dist/components/icons/X-logo-black.png +0 -0
- package/dist/components/icons/X.stories.js +0 -16
- package/dist/components/icons/Youtube.stories.js +0 -21
- package/dist/components/icons/youtube_social_circle_red.png +0 -0
- package/dist/components/taxId/TaxId.stories.js +0 -50
- package/dist/components/video/Video.stories.js +0 -52
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.BarChart = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var d3 = _interopRequireWildcard(require("d3"));
|
|
10
|
-
var _reactTippy = require("react-tippy");
|
|
11
|
-
var _BarChart2 = require("./BarChart.styles");
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
-
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; }
|
|
15
|
-
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; }
|
|
16
|
-
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; }
|
|
17
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
18
|
-
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); } /*
|
|
19
|
-
inspired on https://blog.risingstack.com/d3-js-tutorial-bar-charts-with-javascript/
|
|
20
|
-
*/
|
|
21
|
-
const gradients = {
|
|
22
|
-
default: {
|
|
23
|
-
start: '#0050ca',
|
|
24
|
-
end: '#0050ca'
|
|
25
|
-
},
|
|
26
|
-
red: {
|
|
27
|
-
start: '#f24f45',
|
|
28
|
-
end: '#ee220d'
|
|
29
|
-
},
|
|
30
|
-
blue: {
|
|
31
|
-
start: '#6a97e0',
|
|
32
|
-
end: '#0050ca'
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
class BarChart extends _react.PureComponent {
|
|
36
|
-
constructor() {
|
|
37
|
-
super(...arguments);
|
|
38
|
-
_defineProperty(this, "transitionDuration", 800);
|
|
39
|
-
_defineProperty(this, "transitionDatumDelay", 100);
|
|
40
|
-
_defineProperty(this, "state", {
|
|
41
|
-
tooltipOpen: false,
|
|
42
|
-
dataIndex: 0
|
|
43
|
-
});
|
|
44
|
-
_defineProperty(this, "onResize", () => {
|
|
45
|
-
clearTimeout(this.resizeTimeout);
|
|
46
|
-
this.resizeTimeout = setTimeout(this.onResizeTimeout, 200);
|
|
47
|
-
});
|
|
48
|
-
_defineProperty(this, "onResizeTimeout", () => {
|
|
49
|
-
this.updateChart(true);
|
|
50
|
-
});
|
|
51
|
-
_defineProperty(this, "onScroll", e => {
|
|
52
|
-
if (this.drawn) return;
|
|
53
|
-
if (this.chartEl.getBoundingClientRect().top < window.innerHeight) {
|
|
54
|
-
this.initialDrawChart();
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
_defineProperty(this, "initialDrawChart", () => {
|
|
58
|
-
this.updateChart();
|
|
59
|
-
this.drawn = true;
|
|
60
|
-
});
|
|
61
|
-
_defineProperty(this, "createChart", () => {
|
|
62
|
-
if (!this.chartEl) return;
|
|
63
|
-
const {
|
|
64
|
-
id,
|
|
65
|
-
data,
|
|
66
|
-
colorTheme
|
|
67
|
-
} = this.props;
|
|
68
|
-
const initData = data.map(datum => _objectSpread(_objectSpread({}, datum), {}, {
|
|
69
|
-
value: 0
|
|
70
|
-
}));
|
|
71
|
-
const {
|
|
72
|
-
dataIndex
|
|
73
|
-
} = this.state;
|
|
74
|
-
const tooltip = !!data[dataIndex].tooltip;
|
|
75
|
-
const wrapperWidth = this.chartEl.offsetWidth;
|
|
76
|
-
const wrapperHeight = 320;
|
|
77
|
-
const margin = {
|
|
78
|
-
top: 20,
|
|
79
|
-
left: 0,
|
|
80
|
-
right: 40,
|
|
81
|
-
bottom: 30
|
|
82
|
-
};
|
|
83
|
-
const width = wrapperWidth - (margin.left + margin.right);
|
|
84
|
-
const height = wrapperHeight - (margin.top + margin.bottom);
|
|
85
|
-
const thickness = 6;
|
|
86
|
-
const hThickness = thickness / 2;
|
|
87
|
-
this.hThickness = hThickness;
|
|
88
|
-
|
|
89
|
-
// #region x scale
|
|
90
|
-
const xScale = this.getXScale(data, width);
|
|
91
|
-
// #endregion x scale
|
|
92
|
-
|
|
93
|
-
// #region y scale
|
|
94
|
-
const yScale = this.getYScale(data, height);
|
|
95
|
-
// #endregion y scale
|
|
96
|
-
|
|
97
|
-
this.svg = d3.select(this.chartEl).append('svg').attr('width', wrapperWidth).attr('height', wrapperHeight);
|
|
98
|
-
this.chart = this.svg.append('g').attr('transform', "translate(".concat(margin.left, ", ").concat(margin.top, ")"));
|
|
99
|
-
const defs = this.svg.append('defs');
|
|
100
|
-
|
|
101
|
-
// #region gradient
|
|
102
|
-
const gradient = defs.append('linearGradient').attr('id', "".concat(id, "-barChart-gradient")).attr('x1', '50%').attr('x2', '50%').attr('y1', '100%').attr('y2', '0%');
|
|
103
|
-
gradient.append('stop').attr('class', 'start').attr('offset', '0%').attr('stop-color', gradients[colorTheme].start).attr('stop-opacity', 1);
|
|
104
|
-
gradient.append('stop').attr('class', 'end').attr('offset', '100%').attr('stop-color', gradients[colorTheme].end).attr('stop-opacity', 1);
|
|
105
|
-
// #endregion gradient
|
|
106
|
-
|
|
107
|
-
// #region grid x axis
|
|
108
|
-
this.xGrid = this.chart.append('g').attr('class', 'gridX').attr('transform', "translate(0, ".concat(height, ")")).call(d3.axisBottom().scale(xScale).tickSize(-height, 0, 0).tickFormat(''));
|
|
109
|
-
// #endregion grid x axis
|
|
110
|
-
|
|
111
|
-
// #region grid y axis
|
|
112
|
-
this.yGrid = this.chart.append('g').attr('class', 'gridY').attr('transform', "translate(".concat(width, ", 0)")).call(d3.axisRight().scale(yScale).tickSize(-width, 0, 0).ticks(4).tickFormat(''));
|
|
113
|
-
// #endregion grid y axis
|
|
114
|
-
|
|
115
|
-
const tickValues = xScale.domain().length > 20 ? xScale.domain().filter((datum, index) => !(index % 2)) : xScale.domain();
|
|
116
|
-
|
|
117
|
-
// #region x axis
|
|
118
|
-
this.xAxis = this.chart.append('g').attr('class', 'axisX').attr('transform', "translate(0, ".concat(height, ")")).call(d3.axisBottom().scale(xScale).tickValues(tickValues));
|
|
119
|
-
// #endregion x axis
|
|
120
|
-
|
|
121
|
-
// #region y axis
|
|
122
|
-
this.yAxis = this.chart.append('g').attr('class', 'axisY').attr('transform', "translate(".concat(width, ", 0)")).call(d3.axisRight().scale(yScale).ticks(4));
|
|
123
|
-
// #endregion y axis
|
|
124
|
-
|
|
125
|
-
// #region bars
|
|
126
|
-
const chartContext = this;
|
|
127
|
-
this.chart.selectAll().data(initData).enter().append('path').attr('class', 'bar').style('fill', "url(#".concat(id, "-barChart-gradient)")).attr('transform', "translate(".concat(-hThickness, ", 0)")).each(function bindContext(d, i) {
|
|
128
|
-
d3.select(this).node().chartContext = chartContext;
|
|
129
|
-
}).on('mouseenter', tooltip ? this.onMouseEnter : () => {}).on('mouseleave', tooltip ? this.onMouseLeave : () => {}).attr('d', this.getBarDAttrFn(xScale, yScale, height, hThickness, thickness));
|
|
130
|
-
// #endregion bars
|
|
131
|
-
});
|
|
132
|
-
_defineProperty(this, "setTooltip", (opened, dataIndex) => {
|
|
133
|
-
const newState = {
|
|
134
|
-
tooltipOpen: opened
|
|
135
|
-
};
|
|
136
|
-
if (dataIndex !== undefined) newState.dataIndex = dataIndex;
|
|
137
|
-
this.setState(newState);
|
|
138
|
-
});
|
|
139
|
-
_defineProperty(this, "onMouseEnter", function onMouseEnter(d, i) {
|
|
140
|
-
const chartRect = this.chartContext.chartEl.getBoundingClientRect();
|
|
141
|
-
const barRect = this.getBoundingClientRect();
|
|
142
|
-
const y = barRect.y - chartRect.y;
|
|
143
|
-
const x = barRect.x - chartRect.x + this.chartContext.hThickness;
|
|
144
|
-
this.chartContext.tooltipEl.style.left = "".concat(x, "px");
|
|
145
|
-
this.chartContext.tooltipEl.style.top = "".concat(y, "px");
|
|
146
|
-
this.chartContext.setTooltip(true, i);
|
|
147
|
-
});
|
|
148
|
-
_defineProperty(this, "onMouseLeave", function onMouseLeave(d, i) {
|
|
149
|
-
this.chartContext.setTooltip(false);
|
|
150
|
-
});
|
|
151
|
-
_defineProperty(this, "updateChart", resizeUpdate => {
|
|
152
|
-
if (!this.chartEl) return;
|
|
153
|
-
const {
|
|
154
|
-
data
|
|
155
|
-
} = this.props;
|
|
156
|
-
const durration = this.transitionDuration;
|
|
157
|
-
const delay = this.transitionDatumDelay;
|
|
158
|
-
const wrapperWidth = this.chartEl.offsetWidth;
|
|
159
|
-
const wrapperHeight = 320;
|
|
160
|
-
const margin = {
|
|
161
|
-
top: 20,
|
|
162
|
-
left: 0,
|
|
163
|
-
right: 40,
|
|
164
|
-
bottom: 30
|
|
165
|
-
};
|
|
166
|
-
const width = wrapperWidth - (margin.left + margin.right);
|
|
167
|
-
const height = wrapperHeight - (margin.top + margin.bottom);
|
|
168
|
-
const thickness = 6;
|
|
169
|
-
const hThickness = thickness / 2;
|
|
170
|
-
|
|
171
|
-
// #region x scale
|
|
172
|
-
const xScale = this.getXScale(data, width);
|
|
173
|
-
// #endregion x scale
|
|
174
|
-
|
|
175
|
-
// #region y scale
|
|
176
|
-
const yScale = this.getYScale(data, height);
|
|
177
|
-
// #endregion y scale
|
|
178
|
-
|
|
179
|
-
// #region root svg
|
|
180
|
-
this.svg.transition().duration(durration).attr('width', wrapperWidth).attr('height', wrapperHeight);
|
|
181
|
-
// #endregion root svg
|
|
182
|
-
|
|
183
|
-
// #region grid x axis
|
|
184
|
-
this.xGrid.transition().duration(durration).attr('transform', "translate(0, ".concat(height, ")")).call(d3.axisBottom().scale(xScale).tickSize(-height, 0, 0).tickFormat(''));
|
|
185
|
-
// #endregion grid x axis
|
|
186
|
-
|
|
187
|
-
// #region grid y axis
|
|
188
|
-
this.yGrid.transition().duration(durration).attr('transform', "translate(".concat(width, ", 0)")).call(d3.axisRight().scale(yScale).tickSize(-width, 0, 0).ticks(4).tickFormat(''));
|
|
189
|
-
// #endregion grid y axis
|
|
190
|
-
|
|
191
|
-
const tickValues = xScale.domain().length > 20 ? xScale.domain().filter((datum, index) => !(index % 2)) : xScale.domain();
|
|
192
|
-
|
|
193
|
-
// #region x axis
|
|
194
|
-
this.xAxis.transition().duration(durration).attr('transform', "translate(0, ".concat(height, ")")).call(d3.axisBottom().scale(xScale).tickValues(tickValues));
|
|
195
|
-
// #endregion x axis
|
|
196
|
-
|
|
197
|
-
// #region y axis
|
|
198
|
-
this.yAxis.transition().duration(durration).attr('transform', "translate(".concat(width, ", 0)")).call(d3.axisRight().scale(yScale).ticks(4));
|
|
199
|
-
// #endregion y axis
|
|
200
|
-
|
|
201
|
-
// #region bars
|
|
202
|
-
this.chart.selectAll('.bar').data(data).transition().delay((_, index) => resizeUpdate ? 0 : index * delay).duration(durration).attr('d', this.getBarDAttrFn(xScale, yScale, height, hThickness, thickness));
|
|
203
|
-
// #endregion bars
|
|
204
|
-
});
|
|
205
|
-
_defineProperty(this, "getBarDAttrFn", (xScale, yScale, height, hThickness, thickness) => datum => "\n M".concat(xScale(datum.name), ",").concat(yScale(datum.value) + hThickness, "\n a").concat(hThickness, ",").concat(hThickness, " 0 0 1 ").concat(hThickness, ",").concat(-hThickness, "\n a").concat(hThickness, ",").concat(hThickness, " 0 0 1 ").concat(hThickness, ",").concat(hThickness, "\n v").concat(height - yScale(datum.value) - hThickness, "\n h").concat(-thickness, "Z\n "));
|
|
206
|
-
_defineProperty(this, "getXScale", (data, width) => d3.scaleBand().range([0, width]).domain(data.map(datum => datum.name)).paddingInner(1).paddingOuter(0.5));
|
|
207
|
-
_defineProperty(this, "getYScale", (data, height) => d3.scaleLinear().range([height, 0]).domain([0, d3.max(data, datum => Math.ceil(datum.value / 10) * 10)]));
|
|
208
|
-
}
|
|
209
|
-
componentDidMount() {
|
|
210
|
-
this.createChart();
|
|
211
|
-
window.addEventListener('resize', this.onResize);
|
|
212
|
-
window.addEventListener('scroll', this.onScroll);
|
|
213
|
-
this.onScroll();
|
|
214
|
-
}
|
|
215
|
-
componentWillUnmount() {
|
|
216
|
-
clearTimeout(this.resizeTimeout);
|
|
217
|
-
window.removeEventListener('resize', this.onResize);
|
|
218
|
-
window.removeEventListener('scroll', this.onScroll);
|
|
219
|
-
}
|
|
220
|
-
render() {
|
|
221
|
-
const {
|
|
222
|
-
tooltipOpen,
|
|
223
|
-
dataIndex
|
|
224
|
-
} = this.state;
|
|
225
|
-
const {
|
|
226
|
-
data,
|
|
227
|
-
title
|
|
228
|
-
} = this.props;
|
|
229
|
-
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, title && /*#__PURE__*/_react.default.createElement(_BarChart2.ChartTitle, null, title), /*#__PURE__*/_react.default.createElement(_BarChart2.Chart, {
|
|
230
|
-
ref: el => {
|
|
231
|
-
this.chartEl = el;
|
|
232
|
-
}
|
|
233
|
-
}, data[dataIndex].tooltip && /*#__PURE__*/_react.default.createElement(_BarChart2.TooltipWrapper, {
|
|
234
|
-
ref: el => {
|
|
235
|
-
this.tooltipEl = el;
|
|
236
|
-
}
|
|
237
|
-
}, /*#__PURE__*/_react.default.createElement(_reactTippy.Tooltip, {
|
|
238
|
-
open: tooltipOpen,
|
|
239
|
-
position: "top",
|
|
240
|
-
animation: "fade",
|
|
241
|
-
html: data[dataIndex].tooltip,
|
|
242
|
-
theme: "light",
|
|
243
|
-
arrow: true,
|
|
244
|
-
duration: 200
|
|
245
|
-
}))));
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
exports.BarChart = BarChart;
|
|
249
|
-
BarChart.propTypes = {
|
|
250
|
-
id: _propTypes.default.string.isRequired,
|
|
251
|
-
title: _propTypes.default.string,
|
|
252
|
-
data: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
253
|
-
value: _propTypes.default.number.isRequired,
|
|
254
|
-
name: _propTypes.default.string,
|
|
255
|
-
tooltip: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node])
|
|
256
|
-
})).isRequired,
|
|
257
|
-
colorTheme: _propTypes.default.oneOf(['default', 'red', 'blue'])
|
|
258
|
-
};
|
|
259
|
-
BarChart.defaultProps = {
|
|
260
|
-
title: '',
|
|
261
|
-
colorTheme: 'default'
|
|
262
|
-
};
|
|
263
|
-
var _default = exports.default = BarChart;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.BarChartFull = exports.BarChartDefault = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _BarChart = require("./BarChart");
|
|
9
|
-
var _ComponentWrapper = require("../ComponentWrapper/ComponentWrapper.styles");
|
|
10
|
-
var _global = _interopRequireDefault(require("../../styles/global"));
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
var _default = exports.default = {
|
|
13
|
-
title: 'Components Library/BarChart',
|
|
14
|
-
component: _BarChart.BarChart,
|
|
15
|
-
argTypes: {
|
|
16
|
-
data: {
|
|
17
|
-
type: 'array of shape',
|
|
18
|
-
defaultValue: [{
|
|
19
|
-
value: 0
|
|
20
|
-
}, {
|
|
21
|
-
name: ''
|
|
22
|
-
}, {
|
|
23
|
-
tooltip: ''
|
|
24
|
-
}],
|
|
25
|
-
required: true
|
|
26
|
-
},
|
|
27
|
-
value: {
|
|
28
|
-
type: 'number',
|
|
29
|
-
required: true
|
|
30
|
-
},
|
|
31
|
-
name: {
|
|
32
|
-
type: 'string'
|
|
33
|
-
},
|
|
34
|
-
tooltip: {
|
|
35
|
-
type: 'string or node'
|
|
36
|
-
},
|
|
37
|
-
id: {
|
|
38
|
-
type: 'string',
|
|
39
|
-
required: true
|
|
40
|
-
},
|
|
41
|
-
title: {
|
|
42
|
-
type: 'string',
|
|
43
|
-
defaultValue: ''
|
|
44
|
-
},
|
|
45
|
-
colorTheme: {
|
|
46
|
-
type: 'string',
|
|
47
|
-
defaultValue: 'default'
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
const Template = args => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_global.default, null), /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_BarChart.BarChart, args)));
|
|
52
|
-
const BarChartDefault = exports.BarChartDefault = Template.bind({});
|
|
53
|
-
BarChartDefault.args = {};
|
|
54
|
-
const BarChartFull = exports.BarChartFull = Template.bind({});
|
|
55
|
-
BarChartFull.args = {
|
|
56
|
-
data: [{
|
|
57
|
-
value: 1560,
|
|
58
|
-
name: 'Name',
|
|
59
|
-
colorThem: 'red'
|
|
60
|
-
}],
|
|
61
|
-
id: 'Identity',
|
|
62
|
-
title: 'A Title'
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
// doublecheck:
|
|
66
|
-
// d3 causing SB to crash. cannot resolve
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.TooltipWrapper = exports.ChartTitle = exports.Chart = exports.BarChartTooltip = void 0;
|
|
7
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
-
var _theme = _interopRequireDefault(require("../../styles/theme"));
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
const Chart = exports.Chart = _styledComponents.default.div.withConfig({
|
|
11
|
-
displayName: "BarChartstyles__Chart",
|
|
12
|
-
componentId: "sc-2ptm80-0"
|
|
13
|
-
})(["position:relative;display:block;width:100%;height:auto;overflow:hidden;.axisX,.axisY{& > path{stroke:#e1e1e1;}.tick{text{font-family:'Open Sans';font-weight:600;font-size:14px;line-height:20px;color:", ";}line{stroke:none;}}}.axisY{& > path{stroke:none;}}.gridX,.gridY{& > path{stroke:none;}}.gridX{.tick line{stroke:none;}}.gridY{.tick line{stroke:#dfe5f1;}}"], props => _theme.default.cGrey2);
|
|
14
|
-
var _default = exports.default = Chart;
|
|
15
|
-
const TooltipWrapper = exports.TooltipWrapper = _styledComponents.default.div.withConfig({
|
|
16
|
-
displayName: "BarChartstyles__TooltipWrapper",
|
|
17
|
-
componentId: "sc-2ptm80-1"
|
|
18
|
-
})(["position:absolute;top:0;left:0;pointer-events:none;"]);
|
|
19
|
-
const BarChartTooltip = exports.BarChartTooltip = _styledComponents.default.div.withConfig({
|
|
20
|
-
displayName: "BarChartstyles__BarChartTooltip",
|
|
21
|
-
componentId: "sc-2ptm80-2"
|
|
22
|
-
})(["font-size:10px;min-width:40px;& > h3{font-weight:400;font-family:'Open Sans';font-size:16px;margin:0;padding:0;}& > p{color:#79ca65;font-family:'Open Sans';font-size:11px;text-transform:uppercase;}"]);
|
|
23
|
-
const ChartTitle = exports.ChartTitle = _styledComponents.default.div.withConfig({
|
|
24
|
-
displayName: "BarChartstyles__ChartTitle",
|
|
25
|
-
componentId: "sc-2ptm80-3"
|
|
26
|
-
})(["font-family:'Open Sans';font-size:12px;line-height:20px;text-align:center;letter-spacing:2px;text-transform:uppercase;padding:0;margin:0;"]);
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.BarChartLegend = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var d3 = _interopRequireWildcard(require("d3"));
|
|
10
|
-
var _BarChartLegend2 = require("./BarChartLegend.styles");
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
-
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; }
|
|
14
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
15
|
-
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); }
|
|
16
|
-
const gradients = {
|
|
17
|
-
default: {
|
|
18
|
-
start: '#0050ca',
|
|
19
|
-
end: '#0050ca'
|
|
20
|
-
},
|
|
21
|
-
red: {
|
|
22
|
-
start: '#f24f45',
|
|
23
|
-
end: '#ee220d'
|
|
24
|
-
},
|
|
25
|
-
blue: {
|
|
26
|
-
start: '#6a97e0',
|
|
27
|
-
end: '#0050ca'
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
class BarChartLegend extends _react.PureComponent {
|
|
31
|
-
constructor() {
|
|
32
|
-
super(...arguments);
|
|
33
|
-
_defineProperty(this, "createChart", () => {
|
|
34
|
-
if (!this.barEl) return;
|
|
35
|
-
const {
|
|
36
|
-
id,
|
|
37
|
-
colorTheme
|
|
38
|
-
} = this.props;
|
|
39
|
-
const width = 50;
|
|
40
|
-
const thickness = 6;
|
|
41
|
-
const radius = thickness / 2;
|
|
42
|
-
this.svg = d3.select(this.barEl).append('svg').attr('width', width).attr('height', thickness);
|
|
43
|
-
this.defs = this.svg.append('defs');
|
|
44
|
-
|
|
45
|
-
// #region gradient
|
|
46
|
-
this.gradient = this.defs.append('linearGradient').attr('id', "".concat(id, "-barChartLegend-gradient")).attr('x1', '0%').attr('x2', '100%').attr('y1', '50%').attr('y2', '50%');
|
|
47
|
-
this.gradient.append('stop').attr('class', 'start').attr('offset', '0%').attr('stop-color', gradients[colorTheme].start).attr('stop-opacity', 1);
|
|
48
|
-
this.gradient.append('stop').attr('class', 'end').attr('offset', '100%').attr('stop-color', gradients[colorTheme].end).attr('stop-opacity', 1);
|
|
49
|
-
// #endregion gradient
|
|
50
|
-
|
|
51
|
-
// #region bars
|
|
52
|
-
this.bar = this.svg.append('path').attr('class', 'bar').style('fill', "url(#".concat(id, "-barChartLegend-gradient)")).attr('d', item => "\n M 0 0\n A ".concat(radius, " ").concat(radius, " 0 0 1 ").concat(radius, " ").concat(-radius, "\n H ").concat(width - radius, "\n A ").concat(radius, " ").concat(radius, " 0 0 1 ").concat(width, " 0\n A ").concat(radius, " ").concat(radius, " 0 0 1 ").concat(width - radius, " ").concat(radius, "\n H ").concat(radius, "\n A ").concat(radius, " ").concat(radius, " 0 0 1 0 0 \n Z\n ")).attr('transform', "translate(0, ".concat(radius, ")"));
|
|
53
|
-
// #endregion bars
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
componentDidMount() {
|
|
57
|
-
this.createChart();
|
|
58
|
-
}
|
|
59
|
-
render() {
|
|
60
|
-
const {
|
|
61
|
-
label
|
|
62
|
-
} = this.props;
|
|
63
|
-
return /*#__PURE__*/_react.default.createElement(_BarChartLegend2.Container, null, /*#__PURE__*/_react.default.createElement(_BarChartLegend2.Bar, {
|
|
64
|
-
ref: el => {
|
|
65
|
-
this.barEl = el;
|
|
66
|
-
}
|
|
67
|
-
}), /*#__PURE__*/_react.default.createElement(_BarChartLegend2.Label, null, label));
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
exports.BarChartLegend = BarChartLegend;
|
|
71
|
-
BarChartLegend.propTypes = {
|
|
72
|
-
id: _propTypes.default.string.isRequired,
|
|
73
|
-
label: _propTypes.default.string.isRequired,
|
|
74
|
-
colorTheme: _propTypes.default.oneOf(['default', 'red', 'blue'])
|
|
75
|
-
};
|
|
76
|
-
BarChartLegend.defaultProps = {
|
|
77
|
-
colorTheme: 'default'
|
|
78
|
-
};
|
|
79
|
-
var _default = exports.default = BarChartLegend;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Label = exports.Container = exports.Bar = void 0;
|
|
7
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
-
var _theme = _interopRequireDefault(require("../../styles/theme"));
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
const Container = exports.Container = _styledComponents.default.div.withConfig({
|
|
11
|
-
displayName: "BarChartLegendstyles__Container",
|
|
12
|
-
componentId: "sc-442fg9-0"
|
|
13
|
-
})(["position:relative;font-size:0;padding:2px 0;"]);
|
|
14
|
-
const Bar = exports.Bar = _styledComponents.default.div.withConfig({
|
|
15
|
-
displayName: "BarChartLegendstyles__Bar",
|
|
16
|
-
componentId: "sc-442fg9-1"
|
|
17
|
-
})(["z-index:1;position:relative;display:inline-block;vertical-align:middle;width:50px;margin-right:-50px;"]);
|
|
18
|
-
const Label = exports.Label = _styledComponents.default.div.withConfig({
|
|
19
|
-
displayName: "BarChartLegendstyles__Label",
|
|
20
|
-
componentId: "sc-442fg9-2"
|
|
21
|
-
})(["z-index:0;position:relative;display:inline-block;vertical-align:middle;padding-left:70px;max-width:100%;color:", ";font-size:11px;line-height:16px;"], props => _theme.default.cGrey2);
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.BasicTableSeveral = exports.BasicTableExample = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _BasicTable = _interopRequireDefault(require("./BasicTable"));
|
|
9
|
-
var _ComponentWrapper = require("../ComponentWrapper/ComponentWrapper.styles");
|
|
10
|
-
var _global = _interopRequireDefault(require("../../styles/global"));
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
var _default = exports.default = {
|
|
13
|
-
title: 'Components Library/Basic Table',
|
|
14
|
-
component: _BasicTable.default,
|
|
15
|
-
argTypes: {
|
|
16
|
-
data: {
|
|
17
|
-
type: 'array of shape with two strings',
|
|
18
|
-
required: true,
|
|
19
|
-
defaultValue: [{
|
|
20
|
-
lable: ''
|
|
21
|
-
}]
|
|
22
|
-
},
|
|
23
|
-
filled: {
|
|
24
|
-
defaultValue: ''
|
|
25
|
-
},
|
|
26
|
-
smallPadding: {
|
|
27
|
-
defaultValue: ''
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
const Template = args => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_global.default, null), /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_BasicTable.default, args)));
|
|
32
|
-
const BasicTableExample = exports.BasicTableExample = Template.bind({});
|
|
33
|
-
BasicTableExample.args = {
|
|
34
|
-
data: [{
|
|
35
|
-
lable: 'table lable',
|
|
36
|
-
value: 'a value'
|
|
37
|
-
}]
|
|
38
|
-
};
|
|
39
|
-
const BasicTableSeveral = exports.BasicTableSeveral = Template.bind({});
|
|
40
|
-
BasicTableSeveral.args = {
|
|
41
|
-
data: [{
|
|
42
|
-
lable: 'table lable',
|
|
43
|
-
value: 'a value'
|
|
44
|
-
}, {
|
|
45
|
-
lable: 'table lable 1',
|
|
46
|
-
value: 'another value'
|
|
47
|
-
}, {
|
|
48
|
-
lable: 'table lable 2',
|
|
49
|
-
value: 'and another'
|
|
50
|
-
}, {
|
|
51
|
-
lable: 'table lable 3',
|
|
52
|
-
value: 'value'
|
|
53
|
-
}]
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
//doublecheck:
|
|
57
|
-
// why is lable not showing?
|
|
58
|
-
// took out {value:''} from default data array
|
|
59
|
-
// because since merge it includes a caption component that breaks SB
|