0.3.14 • Published 10 months ago

@cdmx/wappler_ac_s3_upload v0.3.14

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

��#### Maintained by: Roney Dsilva

Custom S3 Upload Control

This is a custom S3 upload component designed to give more features to S3 AC module when uploading files.

S3 Upload Control Properties:

Properties for configuring the behavior and appearance of the upload control.

  • ID: Identifier for the upload control.
  • Class: CSS class for styling purposes.
  • Url: Wappler API endpoint (POST) having the Signed Upload module returning "url" as response.
  • Accept: Allowed file types/extensions for upload.
  • Validation Message: Message displayed when file type validation fails.
  • File Size Limit: File size limit in bytes.
  • Auto Upload: Option to automatically upload files after selection.
  • CSV Options: Additional properties specifically for handling CSV files.
  • CSV Row Limit: Maximum number of rows allowed in a CSV file.
  • CSV Limit Validation: Validation message displayed when the CSV row limit is exceeded.
  • CSV No Records Validation: Validation message displayed when a CSV file has no records.

Actions

  • Abort: Action to abort the upload process.
  • Reset: Action to reset the upload control.
  • Select: Action to select a file for upload.
  • Upload: Action to initiate the file upload process.

CSV Schema Validation

The following JavaScript code snippet defines the schema used for validating CSV files. If using, it needs to be defined on the page or accessible to the page:

<script>
  function isEmailValid(email) {
    // Regular expression to validate email
    const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
    return emailRegex.test(email);
  }

  let val_csv_schema = {
      headers: [
        {
          name: 'First Name',
          required: true,
          requiredError: function (headerName, rowNumber, columnNumber) {
            return `${headerName} is required in the ${rowNumber} row / ${columnNumber} column`
          }
        },
        {
          name: 'Last Name',
          required: true,
          requiredError: function (headerName, rowNumber, columnNumber) {
            return `${headerName} is required in the ${rowNumber} row / ${columnNumber} column`
          }
        },
        {
          name: 'Email',
          required: false,
          validate: function (email) {
            return isEmailValid(email)
          },
          validateError: function (headerName, rowNumber, columnNumber) {
            return `${headerName} is not valid in the ${rowNumber} row / ${columnNumber} column`
          }
        }
      ]
    }
</script>
0.3.9

11 months ago

0.3.14

10 months ago

0.3.13

10 months ago

0.3.12

10 months ago

0.3.11

10 months ago

0.3.10

11 months ago

0.3.0

1 year ago

0.3.6

11 months ago

0.2.7

1 year ago

0.3.5

12 months ago

0.2.6

1 year ago

0.3.8

11 months ago

0.3.7

11 months ago

0.2.8

1 year ago

0.3.2

12 months ago

0.3.1

12 months ago

0.3.4

12 months ago

0.3.3

12 months ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.9

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.4

1 year ago

0.1.5

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.3

1 year ago

0.1.0

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago