wini-web-components 2.2.5 → 2.2.7

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,17 +1,18 @@
1
1
  import React, { CSSProperties } from 'react';
2
2
  import { ComponentStatus } from '../component-status';
3
- interface ObjWithKnownKeys {
4
- [k: string]: any;
5
- }
6
3
  interface ImportFileState {
7
4
  status?: ComponentStatus;
8
- preview: File | ObjWithKnownKeys | undefined | null;
5
+ preview: File | {
6
+ [k: string]: any;
7
+ } | undefined | null;
9
8
  }
10
9
  type ChangeFileFunction = (a?: File) => void;
11
10
  interface ImportFileProps {
12
11
  id?: string;
13
12
  status?: ComponentStatus;
14
- value?: File | ObjWithKnownKeys;
13
+ value?: File | {
14
+ [k: string]: any;
15
+ };
15
16
  buttonOnly?: boolean;
16
17
  onChange?: ChangeFileFunction;
17
18
  label?: string;
@@ -41,9 +41,6 @@ var fileSvg = (react_1.default.createElement("svg", { className: import_file_mod
41
41
  react_1.default.createElement("path", { d: 'M29.9264 10.7084H23.3469V4.12884L29.9264 10.7084Z', style: { fill: "var(--primary-main-color)" } })));
42
42
  var closeSvg = (react_1.default.createElement("svg", { width: '100%', height: '100%', style: { width: '2.4rem', height: '2.4rem' }, fill: 'none', xmlns: 'http://www.w3.org/2000/svg' },
43
43
  react_1.default.createElement("path", { d: 'M13.4144 12.0002L20.4144 5.00015L19.0002 3.58594L12.0002 10.5859L5.00015 3.58594L3.58594 5.00015L10.5859 12.0002L3.58594 19.0002L5.00015 20.4144L12.0002 13.4144L19.0002 20.4144L20.4144 19.0002L13.4144 12.0002Z', style: { fill: "var(--error-main-color)" } })));
44
- var uploadSvg = (react_1.default.createElement("svg", { width: '100%', height: '100%', style: { width: '1.4rem', height: '1.4rem' }, fill: 'none', xmlns: 'http://www.w3.org/2000/svg' },
45
- react_1.default.createElement("path", { d: 'M3.66732 3.88889L7.00065 0L10.334 3.88889H7.55621V8.88889H6.4451V3.88889H3.66732Z', style: { fill: "var(--neutral-text-subtitle-color)" } }),
46
- react_1.default.createElement("path", { d: 'M12.5562 11.1111H1.4451V7.77778H0.333984V11.6667C0.333984 11.9733 0.582873 12.2222 0.88954 12.2222H13.1118C13.4184 12.2222 13.6673 11.9733 13.6673 11.6667V7.77778H12.5562V11.1111Z', style: { fill: "var(--neutral-text-subtitle-color)" } })));
47
44
  var ImportFile = /** @class */ (function (_super) {
48
45
  __extends(ImportFile, _super);
49
46
  function ImportFile(props) {
@@ -21,6 +21,8 @@ interface TextAreaProps {
21
21
  register?: UseFormRegister<{}>;
22
22
  }
23
23
  export declare class TextArea extends React.Component<TextAreaProps> {
24
+ private containerRef;
25
+ getTextarea: () => HTMLTextAreaElement | null | undefined;
24
26
  render(): React.ReactNode;
25
27
  }
26
28
  export {};
@@ -25,21 +25,47 @@ var __assign = (this && this.__assign) || function () {
25
25
  };
26
26
  return __assign.apply(this, arguments);
27
27
  };
28
- var __importDefault = (this && this.__importDefault) || function (mod) {
29
- return (mod && mod.__esModule) ? mod : { "default": mod };
28
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
29
+ if (k2 === undefined) k2 = k;
30
+ var desc = Object.getOwnPropertyDescriptor(m, k);
31
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
32
+ desc = { enumerable: true, get: function() { return m[k]; } };
33
+ }
34
+ Object.defineProperty(o, k2, desc);
35
+ }) : (function(o, m, k, k2) {
36
+ if (k2 === undefined) k2 = k;
37
+ o[k2] = m[k];
38
+ }));
39
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
40
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
41
+ }) : function(o, v) {
42
+ o["default"] = v;
43
+ });
44
+ var __importStar = (this && this.__importStar) || function (mod) {
45
+ if (mod && mod.__esModule) return mod;
46
+ var result = {};
47
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
48
+ __setModuleDefault(result, mod);
49
+ return result;
30
50
  };
31
51
  Object.defineProperty(exports, "__esModule", { value: true });
32
52
  exports.TextArea = void 0;
33
- var react_1 = __importDefault(require("react"));
53
+ var react_1 = __importStar(require("react"));
34
54
  require("./text-area.css");
35
55
  var TextArea = /** @class */ (function (_super) {
36
56
  __extends(TextArea, _super);
37
57
  function TextArea() {
38
- return _super !== null && _super.apply(this, arguments) || this;
58
+ var _this = _super !== null && _super.apply(this, arguments) || this;
59
+ _this.containerRef = (0, react_1.createRef)();
60
+ _this.getTextarea = function () {
61
+ var _a;
62
+ return (_a = _this.containerRef.current) === null || _a === void 0 ? void 0 : _a.querySelector("textarea");
63
+ };
64
+ return _this;
39
65
  }
40
66
  TextArea.prototype.render = function () {
41
67
  var _a, _b, _c, _d;
42
- return react_1.default.createElement("div", { id: this.props.id, className: "text-area-container row ".concat((_a = this.props.className) !== null && _a !== void 0 ? _a : 'body-3', " ").concat(((_b = this.props.helperText) === null || _b === void 0 ? void 0 : _b.length) && 'helper-text'), "helper-text": this.props.helperText, style: this.props.style ? __assign(__assign({}, { '--helper-text-color': (_c = this.props.helperTextColor) !== null && _c !== void 0 ? _c : '#e14337' }), this.props.style) : { '--helper-text-color': (_d = this.props.helperTextColor) !== null && _d !== void 0 ? _d : '#e14337' } }, this.props.register ?
68
+ return react_1.default.createElement("div", { ref: this.containerRef, id: this.props.id, className: "text-area-container row ".concat((_a = this.props.className) !== null && _a !== void 0 ? _a : 'body-3', " ").concat(((_b = this.props.helperText) === null || _b === void 0 ? void 0 : _b.length) && 'helper-text'), "helper-text": this.props.helperText, style: this.props.style ? __assign(__assign({}, { '--helper-text-color': (_c = this.props.helperTextColor) !== null && _c !== void 0 ? _c : '#e14337' }), this.props.style) : { '--helper-text-color': (_d = this.props.helperTextColor) !== null && _d !== void 0 ? _d : '#e14337' } }, this.props.register ?
43
69
  react_1.default.createElement("textarea", __assign({ autoFocus: this.props.autoFocus }, this.props.register, { maxLength: this.props.maxLength, name: this.props.name, placeholder: this.props.placeholder, readOnly: this.props.readOnly, disabled: this.props.disabled, onFocus: this.props.onFocus })) : react_1.default.createElement("textarea", { autoFocus: this.props.autoFocus, maxLength: this.props.maxLength, name: this.props.name, defaultValue: this.props.defaultValue, value: this.props.value, placeholder: this.props.placeholder, readOnly: this.props.readOnly, disabled: this.props.disabled, onChange: this.props.onChange, onFocus: this.props.onFocus, onBlur: this.props.onBlur }));
44
70
  };
45
71
  return TextArea;