math-main-components 0.0.35 → 0.0.36

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.
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
- export declare function OptionFieldHorizontal({ title, iconName, preselected }: {
2
+ export declare function OptionFieldHorizontal({ title, iconName, onClick, preselected }: {
3
3
  title: string;
4
4
  iconName?: string;
5
+ onClick?: (event: any) => void;
5
6
  preselected?: boolean;
6
7
  }): React.JSX.Element;
@@ -4,9 +4,10 @@ export declare class RadioOption {
4
4
  name: string;
5
5
  constructor(text: string, name: string);
6
6
  }
7
- export declare function RadioButtons({ options, group, selected, width }: {
7
+ export declare function RadioButtons({ options, group, selected, onClick, width }: {
8
8
  options: RadioOption[];
9
9
  group: string;
10
10
  selected?: string;
11
+ onClick?: (event: any) => void;
11
12
  width?: string;
12
13
  }): React.JSX.Element;
package/dist/index.cjs.js CHANGED
@@ -374,8 +374,13 @@ var css_248z$b = ".styles-module_container__XCtqW {\n background: white;\n bor
374
374
  var styles$b = {"container":"styles-module_container__XCtqW","preselected":"styles-module_preselected__WoSbB"};
375
375
  styleInject(css_248z$b);
376
376
 
377
- function OptionFieldHorizontal({ title, iconName, preselected = false }) {
378
- return (React__default["default"].createElement("div", { className: [styles$b.container, preselected ? styles$b.preselected : styles$b.not_preselected].join(" ") },
377
+ function OptionFieldHorizontal({ title, iconName, onClick, preselected = false }) {
378
+ function onClickDiv(event) {
379
+ event.preventDefault();
380
+ if (onClick)
381
+ onClick(event);
382
+ }
383
+ return (React__default["default"].createElement("div", { className: [styles$b.container, preselected ? styles$b.preselected : styles$b.not_preselected].join(" "), onClick: onClickDiv },
379
384
  iconName && React__default["default"].createElement(SvgIcon, { iconName: iconName, size: "32px" }),
380
385
  React__default["default"].createElement("h3", null, title)));
381
386
  }
@@ -419,10 +424,12 @@ class RadioOption {
419
424
  this.name = name;
420
425
  }
421
426
  }
422
- function RadioButtons({ options, group, selected, width = "100%" }) {
427
+ function RadioButtons({ options, group, selected, onClick, width = "100%" }) {
423
428
  const [selectedOption, setSelected] = React.useState(selected);
424
429
  function onUpdateSelected(event) {
425
430
  setSelected(event.target.value);
431
+ if (onClick)
432
+ onClick(event);
426
433
  }
427
434
  return (React__default["default"].createElement("div", { className: styles$8.container, style: { width: width } }, options.map((option) => React__default["default"].createElement("div", { className: styles$8.option, key: option.name },
428
435
  selected && selected == option.name ?
package/dist/index.esm.js CHANGED
@@ -366,8 +366,13 @@ var css_248z$b = ".styles-module_container__XCtqW {\n background: white;\n bor
366
366
  var styles$b = {"container":"styles-module_container__XCtqW","preselected":"styles-module_preselected__WoSbB"};
367
367
  styleInject(css_248z$b);
368
368
 
369
- function OptionFieldHorizontal({ title, iconName, preselected = false }) {
370
- return (React.createElement("div", { className: [styles$b.container, preselected ? styles$b.preselected : styles$b.not_preselected].join(" ") },
369
+ function OptionFieldHorizontal({ title, iconName, onClick, preselected = false }) {
370
+ function onClickDiv(event) {
371
+ event.preventDefault();
372
+ if (onClick)
373
+ onClick(event);
374
+ }
375
+ return (React.createElement("div", { className: [styles$b.container, preselected ? styles$b.preselected : styles$b.not_preselected].join(" "), onClick: onClickDiv },
371
376
  iconName && React.createElement(SvgIcon, { iconName: iconName, size: "32px" }),
372
377
  React.createElement("h3", null, title)));
373
378
  }
@@ -411,10 +416,12 @@ class RadioOption {
411
416
  this.name = name;
412
417
  }
413
418
  }
414
- function RadioButtons({ options, group, selected, width = "100%" }) {
419
+ function RadioButtons({ options, group, selected, onClick, width = "100%" }) {
415
420
  const [selectedOption, setSelected] = useState(selected);
416
421
  function onUpdateSelected(event) {
417
422
  setSelected(event.target.value);
423
+ if (onClick)
424
+ onClick(event);
418
425
  }
419
426
  return (React.createElement("div", { className: styles$8.container, style: { width: width } }, options.map((option) => React.createElement("div", { className: styles$8.option, key: option.name },
420
427
  selected && selected == option.name ?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-main-components",
3
- "version": "0.0.35",
3
+ "version": "0.0.36",
4
4
  "author": "Emilian Scheel",
5
5
  "files": [
6
6
  "dist/**/*"