math-main-components 0.0.26 → 0.0.28

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,7 +1,8 @@
1
1
  import React, { CSSProperties, MouseEvent } from 'react';
2
- export declare function FormButton({ text, style, iconName, onClick }: {
2
+ export declare function FormButton({ text, style, iconName, type, onClick }: {
3
3
  text: string;
4
4
  style?: CSSProperties;
5
5
  iconName?: string;
6
+ type?: "submit" | "button" | "reset";
6
7
  onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
7
8
  }): React.JSX.Element;
package/dist/index.cjs.js CHANGED
@@ -154,9 +154,9 @@ var css_248z$l = ".styles-module_container__HOoBj {\n margin-bottom: 30px;\n}\n
154
154
  var styles$l = {"container":"styles-module_container__HOoBj"};
155
155
  styleInject(css_248z$l);
156
156
 
157
- function FormButton({ text, style = {}, iconName = "", onClick = (event) => { } }) {
157
+ function FormButton({ text, style = {}, iconName = "", type = "submit", onClick = (event) => { } }) {
158
158
  return (React__default["default"].createElement("div", { className: styles$l.container, style: style },
159
- React__default["default"].createElement("button", { type: "submit", onClick: onClick },
159
+ React__default["default"].createElement("button", { type: type, onClick: onClick },
160
160
  text,
161
161
  iconName && React__default["default"].createElement(SvgIcon, { iconName: iconName, fill: "white" }))));
162
162
  }
@@ -208,8 +208,8 @@ var styles$h = {"container":"styles-module_container__IXTeq","input":"styles-mod
208
208
  styleInject(css_248z$h);
209
209
 
210
210
  function InputNames({ width = "100%", placeholder = { firstName: "", lastName: "" }, title = { firstName: "Vorname", lastName: "Nachname" }, defaultValue = { firstName: "", lastName: "" }, onInput = (name, event) => { }, onInputFirstName = (event) => { }, onInputLastName = (event) => { }, }) {
211
- const [value1, setValue1] = React.useState("");
212
- const [value2, setValue2] = React.useState("");
211
+ const [value1, setValue1] = React.useState(defaultValue.firstName ? defaultValue.firstName : "");
212
+ const [value2, setValue2] = React.useState(defaultValue.lastName ? defaultValue.lastName : "");
213
213
  function onInput1(event) {
214
214
  setValue1(event.target.value);
215
215
  onInputFirstName(event);
package/dist/index.esm.js CHANGED
@@ -146,9 +146,9 @@ var css_248z$l = ".styles-module_container__HOoBj {\n margin-bottom: 30px;\n}\n
146
146
  var styles$l = {"container":"styles-module_container__HOoBj"};
147
147
  styleInject(css_248z$l);
148
148
 
149
- function FormButton({ text, style = {}, iconName = "", onClick = (event) => { } }) {
149
+ function FormButton({ text, style = {}, iconName = "", type = "submit", onClick = (event) => { } }) {
150
150
  return (React.createElement("div", { className: styles$l.container, style: style },
151
- React.createElement("button", { type: "submit", onClick: onClick },
151
+ React.createElement("button", { type: type, onClick: onClick },
152
152
  text,
153
153
  iconName && React.createElement(SvgIcon, { iconName: iconName, fill: "white" }))));
154
154
  }
@@ -200,8 +200,8 @@ var styles$h = {"container":"styles-module_container__IXTeq","input":"styles-mod
200
200
  styleInject(css_248z$h);
201
201
 
202
202
  function InputNames({ width = "100%", placeholder = { firstName: "", lastName: "" }, title = { firstName: "Vorname", lastName: "Nachname" }, defaultValue = { firstName: "", lastName: "" }, onInput = (name, event) => { }, onInputFirstName = (event) => { }, onInputLastName = (event) => { }, }) {
203
- const [value1, setValue1] = useState("");
204
- const [value2, setValue2] = useState("");
203
+ const [value1, setValue1] = useState(defaultValue.firstName ? defaultValue.firstName : "");
204
+ const [value2, setValue2] = useState(defaultValue.lastName ? defaultValue.lastName : "");
205
205
  function onInput1(event) {
206
206
  setValue1(event.target.value);
207
207
  onInputFirstName(event);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-main-components",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "author": "Emilian Scheel",
5
5
  "files": [
6
6
  "dist/**/*"