@flatfile/plugin-dxp-configure
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

The @flatfile/plugin-dxp-configure plugin lets you easily attach your implementation of the class-based schema configuration library @flatfile/configure to @flatfile/listener.

If you're upgrading from Portal 3, check out the Upgrade Guide.

Parameters

workbook - Workbook

The workbook parameter takes a Flatfile Workbook.

Usage

You can simply attach any existing workbook configuration you have to a listener, and it'll automatically apply to your next Space.

Install

npm i @flatfile/plugin-dxp-configure

Import

import { dxpConfigure } from "@flatfile/plugin-dxp-configure";

listener.js

import { MyWorkbook } from './my-dxp-workbook.js'
import { dxpConfigure } from '@flatfile/plugin-dxp-configure'

export default (listener) => {
  listener.use(dxpConfigure(MyWorkbook))
}

listener.ts

import { MyWorkbook } from "./my-dxp-workbook.js";
import { dxpConfigure } from "@flatfile/plugin-dxp-configure";
import { FlatfileListener } from "@flatfile/listener";

export default (listener: FlatfileListener) => {
  listener.use(dxpConfigure(MyWorkbook));
};

my-dxp-workbook.js

import { Sheet, TextField, Workbook } from "@flatfile/configure";

export const MyWorkbook = new Workbook({
  name: "My Workbook",
  namespace: "test",
  sheets: {
    mySheet: new Sheet("Test", {
      name: TextField("Full Name"),
      email: TextField({
        label: "Email Address",
        compute: (val) => {
          return val.toLowerCase();
        },
      }),
    }),
  },
});

Package Sidebar

Install

npm i @flatfile/plugin-dxp-configure

Weekly Downloads

75

Version

1.0.4

License

ISC

Unpacked Size

4.35 MB

Total Files

7

Last publish

Collaborators

  • sambarrowclough
  • carlbrugger
  • hansjhoffman
  • haleymt
  • mmccooyyy
  • ahollenbeck
  • maerf0x0
  • rjhyde
  • mpoythress
  • flatderek
  • ashleygmulligan
  • alnoor
  • flatfilecolin
  • bigcountrycrane
  • flatfileinfra
  • bangarang
  • madmandrit
  • roberto-alcantara-ffile
  • mairechew
  • jmmander
  • srmotter
  • driscollrp
  • sarocu
  • dboskovic
  • brentkulwicki
  • nate.ferrero
  • jaredwalters