@typeolymp/ui-components 1.19.1 → 1.19.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
@@ -47849,8 +47849,11 @@ var TimeChart = function (_a) {
47849
47849
  };
47850
47850
 
47851
47851
  var Chart = function (_a) {
47852
- var type = _a.type, locale = _a.locale, exerciseResults = _a.exerciseResults, nExercisesInCourse = _a.nExercisesInCourse;
47853
- var _b = React$3.useState(Period.TODAY), period = _b[0], setPeriod = _b[1];
47852
+ var type = _a.type, locale = _a.locale, exerciseResults = _a.exerciseResults, _b = _a.defaultPeriod, defaultPeriod = _b === void 0 ? Period.TODAY : _b, onChangePeriod = _a.onChangePeriod, nExercisesInCourse = _a.nExercisesInCourse;
47853
+ var _c = React$3.useState(defaultPeriod), period = _c[0], setPeriod = _c[1];
47854
+ React$3.useEffect(function () {
47855
+ setPeriod(defaultPeriod);
47856
+ }, [defaultPeriod]);
47854
47857
  var periods = [
47855
47858
  { value: Period.TODAY, label: translations[locale]["Today"] },
47856
47859
  { value: Period.LAST_7_DAYS, label: translations[locale]["Last 7 days"] },
@@ -47890,10 +47893,13 @@ var Chart = function (_a) {
47890
47893
  justifyContent: "space-between",
47891
47894
  marginBottom: 10,
47892
47895
  padding: "0 15px 0 5px",
47893
- } }, { 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) {
47896
+ } }, { children: [jsxRuntime.jsx(Heading, __assign$2({ type: "h3" }, { children: titles[type] })), jsxRuntime.jsx(Select, __assign$2({ defaultValue: period, onChange: function (value) {
47897
+ setPeriod(value);
47898
+ onChangePeriod(value);
47899
+ }, id: "period", name: "period" }, { children: periods.map(function (_a) {
47894
47900
  var value = _a.value, label = _a.label;
47895
47901
  return (jsxRuntime.jsx("option", __assign$2({ value: value }, { children: label }), value));
47896
- }) }))] })), renderChart()] }));
47902
+ }) }), period)] })), renderChart()] }));
47897
47903
  };
47898
47904
 
47899
47905
  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) {