tp-react-elements-dev 1.5.2 → 1.5.4

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,2 +1,5 @@
1
- declare const FormRenderFileUpload: ({ props }: any) => import("react/jsx-runtime").JSX.Element;
1
+ import { FormRenderProps } from "../FormRender";
2
+ declare const FormRenderFileUpload: ({ props }: {
3
+ props: FormRenderProps;
4
+ }) => import("react/jsx-runtime").JSX.Element;
2
5
  export default FormRenderFileUpload;
@@ -26,6 +26,7 @@ export interface FormSectionPropsItem {
26
26
  maxDate?: string;
27
27
  placeholder?: string;
28
28
  minRows?: string | number;
29
+ maxRows?: string | number;
29
30
  CustomProps?: any;
30
31
  numberOfColumns?: number;
31
32
  monthSpan?: number;
@@ -36,8 +37,9 @@ export interface FormSectionPropsItem {
36
37
  sx?: SxProps<Theme>;
37
38
  donotAllowSpace?: boolean;
38
39
  onInputProps?: (e: React.FocusEvent<HTMLInputElement>) => void;
39
- fileType?: 'excel' | '';
40
+ fileType?: 'excel' | 'pdf' | 'all' | '';
40
41
  handleFileError?: (message: string) => void;
42
+ doNotAllowPaste?: boolean;
41
43
  }
42
44
  export interface FormRenderProps {
43
45
  item: FormSectionPropsItem;
package/dist/index.esm.js CHANGED
@@ -52092,6 +52092,12 @@ const PasswordField = ({ props }) => {
52092
52092
  onInput: (e) => {
52093
52093
  props.item.onInputProps && props.item.onInputProps(e);
52094
52094
  },
52095
+ onPaste: (e) => {
52096
+ var _a;
52097
+ if ((_a = props.item) === null || _a === void 0 ? void 0 : _a.doNotAllowPaste) {
52098
+ e.preventDefault();
52099
+ }
52100
+ }
52095
52101
  }, value: field.value || null, disabled: props.item.disable })), jsxRuntimeExports.jsx(IconButton, Object.assign({ sx: {
52096
52102
  position: "absolute",
52097
52103
  right: "14px",
@@ -52231,7 +52237,7 @@ const FormRenderFileUpload = ({ props }) => {
52231
52237
  ? ".pdf,.jpg,.jpeg,.png,.xls,.xlsx,.doc,.docx"
52232
52238
  : "",
52233
52239
  }, onChange: (event) => {
52234
- var _a, _b, _c, _d, _e, _f;
52240
+ var _a, _b, _c, _d, _e;
52235
52241
  const file = event.target.files[0];
52236
52242
  const fileName = file ? file.name : null;
52237
52243
  const allowedExtensions = {
@@ -52257,10 +52263,10 @@ const FormRenderFileUpload = ({ props }) => {
52257
52263
  // Proceed if valid
52258
52264
  props.setValue((_d = props.item) === null || _d === void 0 ? void 0 : _d.name, file);
52259
52265
  props.setValue(((_e = props.item) === null || _e === void 0 ? void 0 : _e.name) + "Name", fileName);
52260
- (_f = props === null || props === void 0 ? void 0 : props.item) === null || _f === void 0 ? void 0 : _f.onChangeInput({
52261
- [props.item.name]: file,
52262
- [props.item.name + "Name"]: fileName,
52263
- });
52266
+ // props?.item?.onChangeFn({
52267
+ // [props.item.name]: file,
52268
+ // [props.item.name + "Name"]: fileName,
52269
+ // });
52264
52270
  // props.setValue(props.item?.name, file);
52265
52271
  // props.setValue(props.item?.name + "Name", fileName);
52266
52272
  // props?.item?.onChangeInput({
@@ -52385,6 +52391,11 @@ const RenderForm = (props) => {
52385
52391
  }
52386
52392
  props.item.onInputProps && props.item.onInputProps(e);
52387
52393
  },
52394
+ onPaste: (e) => {
52395
+ if (props.item.doNotAllowPaste) {
52396
+ e.preventDefault();
52397
+ }
52398
+ }
52388
52399
  } })), ((_a = props === null || props === void 0 ? void 0 : props.item) === null || _a === void 0 ? void 0 : _a.helperText) && (jsxRuntimeExports.jsxs("span", Object.assign({ style: {
52389
52400
  fontFamily: "Roboto-Reg",
52390
52401
  fontSize: "11px",
@@ -52764,9 +52775,7 @@ const RenderForm = (props) => {
52764
52775
  // textTransform:'uppercase'
52765
52776
  maxHeight: "500px !important",
52766
52777
  overflow: "auto",
52767
- } }, props.item.sx), minRows: props.item.minRows || 1,
52768
- // maxRows={2}
52769
- placeholder: props.item.placeholder || "Type Something..." }, field, { label: `${props.item.label}${props.item.required ? " *" : ""}`, value: field.value || "", disabled: props.item.disable, inputProps: {
52778
+ } }, props.item.sx), minRows: props.item.minRows || 1, maxRows: props.item.maxRows || 100, placeholder: props.item.placeholder || "Type Something..." }, field, { label: `${props.item.label}${props.item.required ? " *" : ""}`, value: field.value || "", disabled: props.item.disable, inputProps: {
52770
52779
  onInput: (e) => {
52771
52780
  var _a;
52772
52781
  if (!((_a = props === null || props === void 0 ? void 0 : props.item) === null || _a === void 0 ? void 0 : _a.allowSpecialChars)) {
@@ -55172,7 +55181,7 @@ const useFormValidatingContext = (formArray) => {
55172
55181
  const renderCustomError = (field) => {
55173
55182
  if (field.customErrorMessage) {
55174
55183
  validationShape[field.name] = validationShape[field.name].test("custom-check", field.customErrorMessage, // Use the actual custom message
55175
- (value) => field.customErrorMessage && field.customErrorMessage > 0 // No additional validation logic required
55184
+ (value) => field.customErrorMessage && field.customErrorMessage // No additional validation logic required
55176
55185
  );
55177
55186
  }
55178
55187
  };