npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@flatfile/ember

v0.1.1

Published

Ember Flatfile Adapter

Downloads

6

Readme

The Flatfile Component - @flatfile/ember

We've made it really simple for you to get started with Flatfile with our new Flatfile Component. Here's what you'll need to know to get started.

First, install the dependency via npm:

ember install @flatfile/ember

This will give you access to the <FlatfileButton /> component as well as the same basic functionality as our Adapter.

FlatfileButton usage

<FlatfileButton
  @licenseKey="License Key Here"
  @customer={{hash userId="12345"}}
  @settings={{hash
    type="Contract"
    fields=(array
      (hash label="Full Name" key="name")
      (hash label="Email" key="name")
    )
  }}>
  Import Contacts
</FlatfileButton>

| FlatfileButton Arguments | Info | Example | | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------- | -------------------------------------- | |licenseKey - Your Flatfile license key can be found in your dashboard when you login here.|Required. string | licenseKey={'ah12-alksjs2738-shdkaj123'} | |customer - Refers to the setCustomer function. | Required. object - CustomerObject | customer={{ usedId: "1234",companyId: "12", companyName: "ABC",email: "[email protected]",name: "John Doe"}}| |settings - This is where you will pass your Flatfile settings/options. | Required. object | settings={{ type: "Customers", fields: [ {key: "name", label: "Name"}, {key: "email", label: "Email"}]}} | |onCancel - An optional callback for handling a user cancelling.|Optional. function - callback| onCancel={() => { // do something }}| |onInteractionEvent - An optional way to use registerInteractionEventCallback to receive user interaction events. By default, the onInteractionEvent function will be called every 5 seconds, as long as there is user activity inside of Flatfile Portal.|Optional. function| onInteractionEvent={({mousemove, mousedown, keydown}) => // do something}| |onBeforeFetch - An optional callback called before fetching | Optional. function | onBeforeFetch={() => { // do something} | |onData- An optional way to use FlatfileResults to return a new Promise.|Optional. function| onData={async results => // do something}| |onRecordChange- An optional way to use registerRecordHook when a record changes.| Optional. function |onRecordChange={(data, index) => IDataHookResponse | Promise<IDataHookResponse>}| |onRecordInit- An optional way to use registerRecordHook on initialization.|Optional. function|onRecordInit={(data, index) => IDataHookResponse | Promise<IDataHookResponse>}| |fieldHooks- An optional way to pass in one or more callback functions to use with registerFieldHook.|Optional. object function(s) - callback(s)|fieldHooks={fieldName: (values) => { return // [IDataHookRecord, index][]}| |preload- An optional flag that can be set to false to delay loading the importer until the button is clicked. Useful in situations where there is more than one <FlatfileButton/> instance on a single page or minimizing page load size is important. Default is true.|Optional. boolean |preload={false}|

The component also yields out the component state to allow handling of loading states how you wish.

  as | flatfileState |>

| FlatfileButton Yields | Info | Example | | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------- | -------------------------------------- | |isLoading - start true if the preload argument is true, otherwise is false until loading starts | boolean | flatfileState.isLoading | |isReady - starts false, becomes true when Flatfile has been initialized and loaded | boolean | flatfileState.isReady |

FlatfileProvider usage

<FlatfileProvider
  @licenseKey="License Key Here"
  @customer={{hash userId="12345"}}
  @settings={{hash
    type="Contract"
    fields=(array
      (hash label="Full Name" key="name")
      (hash label="Email" key="name")
    )
  }} as | flatfile |>
  <a href="#" {{on "click" flatfile.open}}>
    FlatfileProvider with html anchor link
  </a>
</FlatfileProvider>

All of the same component arguments are available for FlatfileProvider as are available above for FlatfileButton.

The component also yields out the component state to allow handling of loading states how you wish.

  as | flatfile |>

| FlatfileProvider Yields | Info | Example | | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------- | -------------------------------------- | |flatfile.open - can be tied to an event to open the flatfile importer, this is the default click event for FlatfileButton | action or function | {{on "click" flatfile.open}} | |flatfile.state.isLoading - start true if the preload argument is true, otherwise is false until loading starts | boolean | flatfile.state.isLoading | |flatfile.state.isReady - starts false, becomes true when Flatfile has been initialized and loaded | boolean | flatfile.state.isReady |