@typeolymp/ui-components 1.18.0 → 1.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js CHANGED
@@ -47390,16 +47390,7 @@ var Period;
47390
47390
  Period["LAST_30_DAYS"] = "30d";
47391
47391
  Period["LAST_3_MONTHS"] = "90d";
47392
47392
  Period["LAST_12_MONTHS"] = "1y";
47393
- })(Period || (Period = {}));
47394
- var ChartType;
47395
- (function (ChartType) {
47396
- ChartType["ACCURACY"] = "accuracy";
47397
- ChartType["RESULTS"] = "results";
47398
- ChartType["HITS"] = "hits";
47399
- ChartType["SPEED"] = "speed";
47400
- ChartType["PROGRESS"] = "progress";
47401
- ChartType["TIME"] = "time";
47402
- })(ChartType || (ChartType = {}));
47393
+ })(Period || (Period = {}));
47403
47394
 
47404
47395
  var getInterval = function (period) {
47405
47396
  var start = undefined;
@@ -47666,8 +47657,8 @@ var ProgressChart = function (_a) {
47666
47657
  return parseISO(date) >= start;
47667
47658
  });
47668
47659
  var _a = prepareData(period, passedExercisesAfterStart), resultsByInterval = _a.resultsByInterval, xAxisTicks = _a.xAxisTicks;
47669
- var count = passedExercisesBeforeStart.length;
47670
47660
  setData(function () {
47661
+ var count = passedExercisesBeforeStart.length;
47671
47662
  return resultsByInterval.map(function (exercises, index) {
47672
47663
  count += exercises.length;
47673
47664
  var progress = Math.floor(100 / (nExercisesInCourse / count));
@@ -47725,11 +47716,7 @@ var Chart = function (_a) {
47725
47716
  time: translations[locale]["Time practised"],
47726
47717
  };
47727
47718
  var renderChart = function () {
47728
- var props = {
47729
- exerciseResults: exerciseResults,
47730
- locale: locale,
47731
- period: period,
47732
- };
47719
+ var props = { exerciseResults: exerciseResults, locale: locale, period: period };
47733
47720
  switch (type) {
47734
47721
  case "accuracy":
47735
47722
  return jsxRuntime.jsx(AccuracyChart, __assign$2({}, props));
@@ -47750,10 +47737,11 @@ var Chart = function (_a) {
47750
47737
  alignItems: "baseline",
47751
47738
  justifyContent: "space-between",
47752
47739
  marginBottom: 10,
47753
- } }, { children: [jsxRuntime.jsx(Heading, __assign$2({ type: "h3" }, { children: titles[type] })), jsxRuntime.jsx("div", __assign$2({ style: { paddingRight: 10 } }, { children: jsxRuntime.jsx(Select, __assign$2({ defaultValue: period, onChange: function (value) { return setPeriod(value); }, id: "period", name: "period" }, { children: periods.map(function (_a) {
47754
- var value = _a.value, label = _a.label;
47755
- return (jsxRuntime.jsx("option", __assign$2({ value: value }, { children: label }), value));
47756
- }) })) }))] })), renderChart()] }));
47740
+ paddingRight: 15,
47741
+ } }, { children: [jsxRuntime.jsx(Heading, __assign$2({ type: "h3" }, { children: titles[type] })), jsxRuntime.jsx(Select, __assign$2({ defaultValue: period, onChange: function (value) { return setPeriod(value); }, id: "period", name: "period" }, { children: periods.map(function (_a) {
47742
+ var value = _a.value, label = _a.label;
47743
+ return (jsxRuntime.jsx("option", __assign$2({ value: value }, { children: label }), value));
47744
+ }) }))] })), renderChart()] }));
47757
47745
  };
47758
47746
 
47759
47747
  var StyledTextarea = styled__default["default"].textarea(templateObject_1$a || (templateObject_1$a = __makeTemplateObject$1(["\n width: 100%;\n min-width: 228px;\n min-height: 50px;\n background-color: ", ";\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n box-sizing: border-box;\n border-radius: 4px;\n padding: 13px 15px;\n cursor: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: 500;\n font-style: normal;\n line-height: ", ";\n color: ", ";\n resize: vertical;\n\n ::placeholder {\n font-family: ", ";\n font-size: ", ";\n font-weight: 500;\n font-style: normal;\n line-height: ", ";\n color: ", ";\n }\n\n ::-webkit-calendar-picker-indicator {\n display: none;\n }\n\n :focus {\n outline: 0;\n border-color: ", ";\n box-shadow: ", ";\n }\n"], ["\n width: 100%;\n min-width: 228px;\n min-height: 50px;\n background-color: ", ";\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n box-sizing: border-box;\n border-radius: 4px;\n padding: 13px 15px;\n cursor: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: 500;\n font-style: normal;\n line-height: ", ";\n color: ", ";\n resize: vertical;\n\n ::placeholder {\n font-family: ", ";\n font-size: ", ";\n font-weight: 500;\n font-style: normal;\n line-height: ", ";\n color: ", ";\n }\n\n ::-webkit-calendar-picker-indicator {\n display: none;\n }\n\n :focus {\n outline: 0;\n border-color: ", ";\n box-shadow: ", ";\n }\n"])), function (_a) {