@xelto.npm/xc2-lib 0.0.38 → 0.0.39

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,56 +1,5 @@
1
- /// <reference types="react" />
2
- import propTypes from "prop-types";
1
+ import { FunctionComponent } from "react";
2
+ import { TextFieldProps } from "./TextFieldProps";
3
3
  export declare const StyledTextField: import("@emotion/styled").StyledComponent<import("@mui/material/TextField").TextFieldProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
4
- declare const TextField: {
5
- ({ label, error, icon, disabled, fluid, type, min, max, small, helperText, value, onChange, onBlur, forwardedRef, endAdornment, ...props }: {
6
- [x: string]: any;
7
- label: any;
8
- error: any;
9
- icon: any;
10
- disabled: any;
11
- fluid: any;
12
- type: any;
13
- min: any;
14
- max: any;
15
- small: any;
16
- helperText: any;
17
- value: any;
18
- onChange: any;
19
- onBlur: any;
20
- forwardedRef: any;
21
- endAdornment: any;
22
- }): JSX.Element;
23
- propTypes: {
24
- label: propTypes.Requireable<string>;
25
- icon: propTypes.Requireable<string>;
26
- type: propTypes.Requireable<string>;
27
- fluid: propTypes.Requireable<boolean>;
28
- helperText: propTypes.Requireable<string>;
29
- min: propTypes.Requireable<string>;
30
- max: propTypes.Requireable<string>;
31
- error: propTypes.Requireable<boolean>;
32
- disabled: propTypes.Requireable<boolean>;
33
- endAdornment: propTypes.Requireable<string>;
34
- small: propTypes.Requireable<boolean>;
35
- onChange: propTypes.Requireable<(...args: any[]) => any>;
36
- onBlur: propTypes.Requireable<(...args: any[]) => any>;
37
- };
38
- defaultProps: {
39
- label: string;
40
- icon: string;
41
- type: string;
42
- fluid: boolean;
43
- helperText: string;
44
- min: string;
45
- max: string;
46
- error: boolean;
47
- disabled: boolean;
48
- endAdornment: string;
49
- small: boolean;
50
- value: string;
51
- forwardedRef: null;
52
- onChange: () => null;
53
- onBlur: () => null;
54
- };
55
- };
4
+ declare const TextField: FunctionComponent<TextFieldProps>;
56
5
  export default TextField;
@@ -0,0 +1,18 @@
1
+ import * as React from "react";
2
+ export interface TextFieldProps {
3
+ label: string;
4
+ error: boolean;
5
+ icon: string;
6
+ disabled: boolean;
7
+ fluid: boolean;
8
+ type: string;
9
+ min: string;
10
+ max: string;
11
+ small: boolean;
12
+ helperText?: string;
13
+ value: string;
14
+ onChange?: React.ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;
15
+ onBlur?: React.ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;
16
+ forwardedRef?: null;
17
+ endAdornment?: string;
18
+ }
package/dist/esm/index.js CHANGED
@@ -81420,53 +81420,32 @@ var StyledTextField = styled(TextField$1)(function (_a) {
81420
81420
  }
81421
81421
  });
81422
81422
  });
81423
+ // type TextFieldProps = {
81424
+ // label: string,
81425
+ // error: boolean,
81426
+ // icon: string,
81427
+ // disabled: boolean,
81428
+ // fluid: boolean,
81429
+ // type: string,
81430
+ // min: string,
81431
+ // max: string,
81432
+ // small: boolean,
81433
+ // helperText: string,
81434
+ // value: string,
81435
+ // onChange: { () : void } | null,
81436
+ // onBlur: { () : void} | null,
81437
+ // forwardedRef: null,
81438
+ // endAdornment: string,
81439
+ // }
81423
81440
  var TextField = function (_a) {
81424
- var label = _a.label, error = _a.error, icon = _a.icon, disabled = _a.disabled, fluid = _a.fluid, type = _a.type, min = _a.min, max = _a.max, small = _a.small, helperText = _a.helperText, value = _a.value, onChange = _a.onChange, onBlur = _a.onBlur, forwardedRef = _a.forwardedRef, endAdornment = _a.endAdornment, props = __rest(_a, ["label", "error", "icon", "disabled", "fluid", "type", "min", "max", "small", "helperText", "value", "onChange", "onBlur", "forwardedRef", "endAdornment"]);
81425
- var handleChange = function (e) {
81426
- return onChange(e);
81427
- };
81428
- var handleBlur = function (e) {
81429
- return onBlur(e);
81430
- };
81431
- return (jsxRuntime.exports.jsx(StyledTextField, __assign({}, props, { value: value, onChange: function (e) { return handleChange(e); }, label: label, type: type, variant: "outlined", error: error, onBlur: function (e) { return handleBlur(e); }, disabled: disabled, helperText: error ? helperText : '', fluid: fluid === true ? 'true' : 'false', ref: forwardedRef, small: small, InputProps: {
81441
+ var _b = _a.label, label = _b === void 0 ? '' : _b, _c = _a.error, error = _c === void 0 ? false : _c, _d = _a.icon, icon = _d === void 0 ? 'icon_wf_keyboard' : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.fluid, fluid = _f === void 0 ? false : _f, _g = _a.type, type = _g === void 0 ? 'text' : _g, _h = _a.min, min = _h === void 0 ? '' : _h, _j = _a.max, max = _j === void 0 ? '' : _j, _k = _a.small, small = _k === void 0 ? false : _k, _l = _a.helperText, helperText = _l === void 0 ? '' : _l, _m = _a.value, value = _m === void 0 ? '' : _m, onChange = _a.onChange, onBlur = _a.onBlur, forwardedRef = _a.forwardedRef, _o = _a.endAdornment, endAdornment = _o === void 0 ? '' : _o, props = __rest(_a, ["label", "error", "icon", "disabled", "fluid", "type", "min", "max", "small", "helperText", "value", "onChange", "onBlur", "forwardedRef", "endAdornment"]);
81442
+ return (jsxRuntime.exports.jsx(StyledTextField, __assign({}, props, { value: value, onChange: onChange, label: label, type: type, variant: "outlined", error: error, onBlur: onBlur, disabled: disabled, helperText: error ? helperText : '', fluid: fluid === true ? 'true' : 'false', ref: forwardedRef, small: small, InputProps: {
81432
81443
  inputProps: {
81433
81444
  min: min,
81434
81445
  max: max,
81435
81446
  },
81436
81447
  endAdornment: jsxRuntime.exports.jsx(InputAdornment, __assign({ position: "end" }, { children: endAdornment ? endAdornment : jsxRuntime.exports.jsx(Icon, { iconName: icon, color: disabled ? 'disabled' : error ? 'red' : 'red-navy', style: { display: 'flex', alignItems: 'center' }, size: "responsive" }) }))
81437
81448
  } })));
81438
- };
81439
- TextField.propTypes = {
81440
- label: propTypes.exports.string,
81441
- icon: propTypes.exports.string,
81442
- type: propTypes.exports.string,
81443
- fluid: propTypes.exports.bool,
81444
- helperText: propTypes.exports.string,
81445
- min: propTypes.exports.string,
81446
- max: propTypes.exports.string,
81447
- error: propTypes.exports.bool,
81448
- disabled: propTypes.exports.bool,
81449
- endAdornment: propTypes.exports.string,
81450
- small: propTypes.exports.bool,
81451
- onChange: propTypes.exports.func,
81452
- onBlur: propTypes.exports.func,
81453
- };
81454
- TextField.defaultProps = {
81455
- label: 'Textfield',
81456
- icon: 'icon_wf_keyboard',
81457
- type: 'text',
81458
- fluid: false,
81459
- helperText: 'fill in the field correctly',
81460
- min: '',
81461
- max: '',
81462
- error: false,
81463
- disabled: false,
81464
- endAdornment: '',
81465
- small: false,
81466
- value: '',
81467
- forwardedRef: null,
81468
- onChange: function () { return null; },
81469
- onBlur: function () { return null; },
81470
81449
  };
81471
81450
 
81472
81451
  export { AppTileComponent as AppTile, BottomBarComponent as BottomBar, BottomInfoBar, CustomButtonComponent as Button, CheckboxComponent as Checkbox, DatePicker, Icon, IconButtonComponent as IconButton, Illustration, Logo, TextField, TypographyComponent as Typography };