Created
October 16, 2020 11:36
-
-
Save mb8z/3ea319e1addf42f3703bb795fe90182b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Services from 'tripetto-services'; | |
import { Export } from 'tripetto-runner-foundation'; | |
import { run } from 'tripetto-runner-autoscroll'; | |
const token = 'my-token-here'; | |
const config = Services.init({ token }); | |
// Picking params as spreaing the `config` does not work properly | |
const params = _.pick(config, ['definition', 'styles', 'l10n', 'locales', 'translations', 'attachments']); | |
const element = document.getElementById('my-tripetto-form'); | |
run({ | |
...params, | |
element, | |
onSubmit: (instance) => { | |
const { fields } = Export.exportables(instance); | |
const csv = Export.CSV(instance); | |
console.log('[Tripetto] Export.exportables.fields:', fields); | |
console.log('[Tripetto] Export.CSV:', csv); | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment