@formio/angular 5.2.2 → 5.3.0-rc.1
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.
- package/FormioBaseComponent.d.ts +3 -0
- package/FormioBaseComponent.d.ts.map +1 -1
- package/auth/auth.component.d.ts +3 -0
- package/auth/auth.component.d.ts.map +1 -1
- package/auth/auth.config.d.ts +3 -0
- package/auth/auth.config.d.ts.map +1 -1
- package/auth/auth.module.d.ts +11 -0
- package/auth/auth.module.d.ts.map +1 -1
- package/auth/auth.service.d.ts +3 -0
- package/auth/auth.service.d.ts.map +1 -1
- package/auth/formio-angular-auth.d.ts +1 -0
- package/auth/formio-angular-auth.d.ts.map +1 -1
- package/auth/login/login.component.d.ts +3 -0
- package/auth/login/login.component.d.ts.map +1 -1
- package/auth/package.json +5 -6
- package/auth/register/register.component.d.ts +3 -0
- package/auth/register/register.component.d.ts.map +1 -1
- package/auth/resetpass/resetpass.component.d.ts +3 -0
- package/auth/resetpass/resetpass.component.d.ts.map +1 -1
- package/components/alerts/formio.alerts.component.d.ts +3 -0
- package/components/alerts/formio.alerts.component.d.ts.map +1 -1
- package/components/alerts/parse-html-content.pipe.d.ts +3 -0
- package/components/alerts/parse-html-content.pipe.d.ts.map +1 -1
- package/components/formbuilder/formbuilder.component.d.ts +3 -0
- package/components/formbuilder/formbuilder.component.d.ts.map +1 -1
- package/components/formio/formio.component.d.ts +3 -0
- package/components/formio/formio.component.d.ts.map +1 -1
- package/components/loader/formio.loader.component.d.ts +3 -0
- package/components/loader/formio.loader.component.d.ts.map +1 -1
- package/custom-component/custom-tags.service.d.ts +3 -0
- package/custom-component/custom-tags.service.d.ts.map +1 -1
- package/esm2020/FormioBaseComponent.mjs +491 -0
- package/esm2020/auth/auth.component.mjs +12 -0
- package/esm2020/auth/auth.config.mjs +15 -0
- package/esm2020/auth/auth.module.mjs +48 -0
- package/{esm2015/auth/auth.routes.js → esm2020/auth/auth.routes.mjs} +0 -0
- package/esm2020/auth/auth.service.mjs +159 -0
- package/{esm2015/auth/formio-angular-auth.js → esm2020/auth/formio-angular-auth.mjs} +0 -0
- package/{esm2015/auth/index.js → esm2020/auth/index.mjs} +0 -0
- package/esm2020/auth/login/login.component.mjs +16 -0
- package/{esm2015/auth/public_api.js → esm2020/auth/public_api.mjs} +0 -0
- package/esm2020/auth/register/register.component.mjs +16 -0
- package/esm2020/auth/resetpass/resetpass.component.mjs +16 -0
- package/esm2020/components/alerts/formio.alerts.component.mjs +29 -0
- package/{esm2015/components/alerts/formio.alerts.js → esm2020/components/alerts/formio.alerts.mjs} +0 -0
- package/esm2020/components/alerts/parse-html-content.pipe.mjs +19 -0
- package/esm2020/components/formbuilder/formbuilder.component.mjs +190 -0
- package/esm2020/components/formio/formio.component.mjs +40 -0
- package/esm2020/components/loader/formio.loader.component.mjs +14 -0
- package/{esm2015/core.js → esm2020/core.mjs} +0 -0
- package/esm2020/custom-component/create-custom-component.mjs +144 -0
- package/esm2020/custom-component/custom-tags.service.mjs +16 -0
- package/{esm2015/custom-component/register-custom-component.js → esm2020/custom-component/register-custom-component.mjs} +0 -0
- package/{esm2015/elements.common.js → esm2020/elements.common.mjs} +0 -0
- package/esm2020/formio-angular.mjs +5 -0
- package/{esm2015/formio-promise.service.js → esm2020/formio-promise.service.mjs} +0 -0
- package/{esm2015/formio.common.js → esm2020/formio.common.mjs} +0 -0
- package/esm2020/formio.config.mjs +14 -0
- package/esm2020/formio.module.mjs +60 -0
- package/{esm2015/formio.service.js → esm2020/formio.service.mjs} +0 -0
- package/{esm2015/formio.utils.js → esm2020/formio.utils.mjs} +0 -0
- package/esm2020/grid/GridBodyComponent.mjs +81 -0
- package/esm2020/grid/GridFooterComponent.mjs +36 -0
- package/esm2020/grid/GridHeaderComponent.mjs +30 -0
- package/esm2020/grid/form/FormGridBody.component.mjs +19 -0
- package/esm2020/grid/form/FormGridFooter.component.mjs +26 -0
- package/esm2020/grid/form/FormGridHeader.component.mjs +26 -0
- package/{esm2015/grid/form/index.js → esm2020/grid/form/index.mjs} +0 -0
- package/esm2020/grid/form/time-since.pipe.mjs +37 -0
- package/esm2020/grid/formio-angular-grid.mjs +5 -0
- package/esm2020/grid/grid.component.mjs +230 -0
- package/esm2020/grid/grid.module.mjs +89 -0
- package/esm2020/grid/grid.service.mjs +17 -0
- package/{esm2015/grid/index.js → esm2020/grid/index.mjs} +0 -0
- package/{esm2015/grid/public_api.js → esm2020/grid/public_api.mjs} +0 -0
- package/esm2020/grid/submission/SubmissionGridBody.component.mjs +43 -0
- package/esm2020/grid/submission/SubmissionGridFooter.component.mjs +23 -0
- package/esm2020/grid/submission/SubmissionGridHeader.component.mjs +61 -0
- package/{esm2015/grid/submission/index.js → esm2020/grid/submission/index.mjs} +0 -0
- package/{esm2015/grid/types/grid-column.js → esm2020/grid/types/grid-column.mjs} +0 -0
- package/{esm2015/grid/types/grid-footer-positions.js → esm2020/grid/types/grid-footer-positions.mjs} +0 -0
- package/{esm2015/grid/types/grid-header.js → esm2020/grid/types/grid-header.mjs} +0 -0
- package/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/esm2020/manager/create/create.component.mjs +18 -0
- package/esm2020/manager/delete/delete.component.mjs +37 -0
- package/esm2020/manager/edit/edit.component.mjs +109 -0
- package/esm2020/manager/form/form.component.mjs +70 -0
- package/esm2020/manager/form-manager.config.mjs +15 -0
- package/esm2020/manager/form-manager.module.mjs +85 -0
- package/{esm2015/manager/form-manager.routes.js → esm2020/manager/form-manager.routes.mjs} +0 -0
- package/esm2020/manager/form-manager.service.mjs +178 -0
- package/{esm2015/manager/formio-angular-manager.js → esm2020/manager/formio-angular-manager.mjs} +0 -0
- package/esm2020/manager/index/index.component.mjs +84 -0
- package/{esm2015/manager/index.js → esm2020/manager/index.mjs} +0 -0
- package/{esm2015/manager/public_api.js → esm2020/manager/public_api.mjs} +0 -0
- package/esm2020/manager/submission/delete/delete.component.mjs +28 -0
- package/esm2020/manager/submission/edit/edit.component.mjs +22 -0
- package/esm2020/manager/submission/index/index.component.mjs +22 -0
- package/esm2020/manager/submission/submission/submission.component.mjs +26 -0
- package/esm2020/manager/submission/view/view.component.mjs +16 -0
- package/esm2020/manager/view/view.component.mjs +42 -0
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
- package/esm2020/resource/create/create.component.mjs +37 -0
- package/esm2020/resource/delete/delete.component.mjs +26 -0
- package/esm2020/resource/edit/edit.component.mjs +36 -0
- package/{esm2015/resource/formio-angular-resource.js → esm2020/resource/formio-angular-resource.mjs} +0 -0
- package/esm2020/resource/index/index.component.mjs +61 -0
- package/{esm2015/resource/index.js → esm2020/resource/index.mjs} +0 -0
- package/{esm2015/resource/public_api.js → esm2020/resource/public_api.mjs} +0 -0
- package/esm2020/resource/resource.component.mjs +46 -0
- package/esm2020/resource/resource.config.mjs +15 -0
- package/esm2020/resource/resource.module.mjs +64 -0
- package/{esm2015/resource/resource.routes.js → esm2020/resource/resource.routes.mjs} +0 -0
- package/esm2020/resource/resource.service.mjs +186 -0
- package/esm2020/resource/resources.service.mjs +22 -0
- package/esm2020/resource/view/view.component.mjs +23 -0
- package/{esm2015/types/alerts-position.js → esm2020/types/alerts-position.mjs} +0 -0
- package/{esm2015/types/formio-metadata.js → esm2020/types/formio-metadata.mjs} +0 -0
- package/{esm2015/types/formio-submission.js → esm2020/types/formio-submission.mjs} +0 -0
- package/fesm2015/formio-angular-auth.mjs +296 -0
- package/fesm2015/formio-angular-auth.mjs.map +1 -0
- package/fesm2015/formio-angular-grid.mjs +691 -0
- package/fesm2015/formio-angular-grid.mjs.map +1 -0
- package/fesm2015/formio-angular-manager.mjs +739 -0
- package/fesm2015/formio-angular-manager.mjs.map +1 -0
- package/fesm2015/formio-angular-resource.mjs +511 -0
- package/fesm2015/formio-angular-resource.mjs.map +1 -0
- package/fesm2015/formio-angular.mjs +1138 -0
- package/fesm2015/formio-angular.mjs.map +1 -0
- package/fesm2020/formio-angular-auth.mjs +296 -0
- package/fesm2020/formio-angular-auth.mjs.map +1 -0
- package/fesm2020/formio-angular-grid.mjs +690 -0
- package/fesm2020/formio-angular-grid.mjs.map +1 -0
- package/fesm2020/formio-angular-manager.mjs +739 -0
- package/fesm2020/formio-angular-manager.mjs.map +1 -0
- package/fesm2020/formio-angular-resource.mjs +509 -0
- package/fesm2020/formio-angular-resource.mjs.map +1 -0
- package/fesm2020/formio-angular.mjs +1146 -0
- package/fesm2020/formio-angular.mjs.map +1 -0
- package/formio-angular.d.ts +1 -2
- package/formio-angular.d.ts.map +1 -1
- package/formio.config.d.ts +3 -0
- package/formio.config.d.ts.map +1 -1
- package/formio.module.d.ts +11 -0
- package/formio.module.d.ts.map +1 -1
- package/grid/GridBodyComponent.d.ts +3 -0
- package/grid/GridBodyComponent.d.ts.map +1 -1
- package/grid/GridFooterComponent.d.ts +3 -0
- package/grid/GridFooterComponent.d.ts.map +1 -1
- package/grid/GridHeaderComponent.d.ts +3 -0
- package/grid/GridHeaderComponent.d.ts.map +1 -1
- package/grid/form/FormGridBody.component.d.ts +3 -0
- package/grid/form/FormGridBody.component.d.ts.map +1 -1
- package/grid/form/FormGridFooter.component.d.ts +3 -0
- package/grid/form/FormGridFooter.component.d.ts.map +1 -1
- package/grid/form/FormGridHeader.component.d.ts +3 -0
- package/grid/form/FormGridHeader.component.d.ts.map +1 -1
- package/grid/form/time-since.pipe.d.ts +3 -0
- package/grid/form/time-since.pipe.d.ts.map +1 -1
- package/grid/formio-angular-grid.d.ts +1 -1
- package/grid/formio-angular-grid.d.ts.map +1 -1
- package/grid/grid.component.d.ts +3 -0
- package/grid/grid.component.d.ts.map +1 -1
- package/grid/grid.module.d.ts +20 -0
- package/grid/grid.module.d.ts.map +1 -1
- package/grid/grid.service.d.ts +3 -0
- package/grid/grid.service.d.ts.map +1 -1
- package/grid/package.json +5 -6
- package/grid/submission/SubmissionGridBody.component.d.ts +3 -0
- package/grid/submission/SubmissionGridBody.component.d.ts.map +1 -1
- package/grid/submission/SubmissionGridFooter.component.d.ts +3 -0
- package/grid/submission/SubmissionGridFooter.component.d.ts.map +1 -1
- package/grid/submission/SubmissionGridHeader.component.d.ts +3 -0
- package/grid/submission/SubmissionGridHeader.component.d.ts.map +1 -1
- package/manager/create/create.component.d.ts +3 -0
- package/manager/create/create.component.d.ts.map +1 -1
- package/manager/delete/delete.component.d.ts +3 -0
- package/manager/delete/delete.component.d.ts.map +1 -1
- package/manager/edit/edit.component.d.ts +3 -0
- package/manager/edit/edit.component.d.ts.map +1 -1
- package/manager/form/form.component.d.ts +3 -0
- package/manager/form/form.component.d.ts.map +1 -1
- package/manager/form-manager.config.d.ts +3 -0
- package/manager/form-manager.config.d.ts.map +1 -1
- package/manager/form-manager.module.d.ts +22 -0
- package/manager/form-manager.module.d.ts.map +1 -1
- package/manager/form-manager.service.d.ts +3 -0
- package/manager/form-manager.service.d.ts.map +1 -1
- package/manager/formio-angular-manager.d.ts +1 -0
- package/manager/formio-angular-manager.d.ts.map +1 -1
- package/manager/index/index.component.d.ts +3 -0
- package/manager/index/index.component.d.ts.map +1 -1
- package/manager/package.json +5 -6
- package/manager/submission/delete/delete.component.d.ts +3 -0
- package/manager/submission/delete/delete.component.d.ts.map +1 -1
- package/manager/submission/edit/edit.component.d.ts +3 -0
- package/manager/submission/edit/edit.component.d.ts.map +1 -1
- package/manager/submission/index/index.component.d.ts +3 -0
- package/manager/submission/index/index.component.d.ts.map +1 -1
- package/manager/submission/submission/submission.component.d.ts +3 -0
- package/manager/submission/submission/submission.component.d.ts.map +1 -1
- package/manager/submission/view/view.component.d.ts +3 -0
- package/manager/submission/view/view.component.d.ts.map +1 -1
- package/manager/view/view.component.d.ts +3 -0
- package/manager/view/view.component.d.ts.map +1 -1
- package/package.json +54 -10
- package/resource/create/create.component.d.ts +3 -0
- package/resource/create/create.component.d.ts.map +1 -1
- package/resource/delete/delete.component.d.ts +3 -0
- package/resource/delete/delete.component.d.ts.map +1 -1
- package/resource/edit/edit.component.d.ts +3 -0
- package/resource/edit/edit.component.d.ts.map +1 -1
- package/resource/formio-angular-resource.d.ts +1 -0
- package/resource/formio-angular-resource.d.ts.map +1 -1
- package/resource/index/index.component.d.ts +3 -0
- package/resource/index/index.component.d.ts.map +1 -1
- package/resource/package.json +5 -6
- package/resource/resource.component.d.ts +3 -0
- package/resource/resource.component.d.ts.map +1 -1
- package/resource/resource.config.d.ts +3 -0
- package/resource/resource.config.d.ts.map +1 -1
- package/resource/resource.module.d.ts +14 -0
- package/resource/resource.module.d.ts.map +1 -1
- package/resource/resource.service.d.ts +3 -0
- package/resource/resource.service.d.ts.map +1 -1
- package/resource/resources.service.d.ts +3 -0
- package/resource/resources.service.d.ts.map +1 -1
- package/resource/view/view.component.d.ts +3 -0
- package/resource/view/view.component.d.ts.map +1 -1
- package/FormioBaseComponent.ngfactory.d.ts.map +0 -1
- package/auth/formio-angular-auth.metadata.json +0 -1
- package/bundles/formio-angular-auth.umd.js +0 -312
- package/bundles/formio-angular-auth.umd.js.map +0 -1
- package/bundles/formio-angular-grid.umd.js +0 -1010
- package/bundles/formio-angular-grid.umd.js.map +0 -1
- package/bundles/formio-angular-manager.umd.js +0 -1122
- package/bundles/formio-angular-manager.umd.js.map +0 -1
- package/bundles/formio-angular-resource.umd.js +0 -556
- package/bundles/formio-angular-resource.umd.js.map +0 -1
- package/bundles/formio-angular.umd.js +0 -1497
- package/bundles/formio-angular.umd.js.map +0 -1
- package/components/alerts/formio.alerts.component.ngfactory.d.ts.map +0 -1
- package/components/alerts/parse-html-content.pipe.ngfactory.d.ts.map +0 -1
- package/components/formbuilder/formbuilder.component.ngfactory.d.ts.map +0 -1
- package/components/formio/formio.component.ngfactory.d.ts.map +0 -1
- package/components/loader/formio.loader.component.ngfactory.d.ts.map +0 -1
- package/components/loader/formio.loader.component.scss.shim.ngstyle.d.ts.map +0 -1
- package/custom-component/custom-tags.service.ngfactory.d.ts.map +0 -1
- package/esm2015/FormioBaseComponent.js +0 -456
- package/esm2015/auth/auth.component.js +0 -9
- package/esm2015/auth/auth.config.js +0 -12
- package/esm2015/auth/auth.module.js +0 -34
- package/esm2015/auth/auth.service.js +0 -160
- package/esm2015/auth/login/login.component.js +0 -16
- package/esm2015/auth/register/register.component.js +0 -16
- package/esm2015/auth/resetpass/resetpass.component.js +0 -16
- package/esm2015/components/alerts/formio.alerts.component.js +0 -26
- package/esm2015/components/alerts/parse-html-content.pipe.js +0 -15
- package/esm2015/components/formbuilder/formbuilder.component.js +0 -185
- package/esm2015/components/formio/formio.component.js +0 -39
- package/esm2015/components/loader/formio.loader.component.js +0 -14
- package/esm2015/custom-component/create-custom-component.js +0 -130
- package/esm2015/custom-component/custom-tags.service.js +0 -13
- package/esm2015/formio-angular.js +0 -7
- package/esm2015/formio.config.js +0 -11
- package/esm2015/formio.module.js +0 -42
- package/esm2015/grid/GridBodyComponent.js +0 -76
- package/esm2015/grid/GridFooterComponent.js +0 -26
- package/esm2015/grid/GridHeaderComponent.js +0 -25
- package/esm2015/grid/form/FormGridBody.component.js +0 -16
- package/esm2015/grid/form/FormGridFooter.component.js +0 -24
- package/esm2015/grid/form/FormGridHeader.component.js +0 -24
- package/esm2015/grid/form/time-since.pipe.js +0 -33
- package/esm2015/grid/formio-angular-grid.js +0 -6
- package/esm2015/grid/grid.component.js +0 -211
- package/esm2015/grid/grid.module.js +0 -61
- package/esm2015/grid/grid.service.js +0 -16
- package/esm2015/grid/submission/SubmissionGridBody.component.js +0 -40
- package/esm2015/grid/submission/SubmissionGridFooter.component.js +0 -21
- package/esm2015/grid/submission/SubmissionGridHeader.component.js +0 -58
- package/esm2015/manager/create/create.component.js +0 -13
- package/esm2015/manager/delete/delete.component.js +0 -42
- package/esm2015/manager/edit/edit.component.js +0 -109
- package/esm2015/manager/form/form.component.js +0 -73
- package/esm2015/manager/form-manager.config.js +0 -12
- package/esm2015/manager/form-manager.module.js +0 -56
- package/esm2015/manager/form-manager.service.js +0 -180
- package/esm2015/manager/index/index.component.js +0 -86
- package/esm2015/manager/submission/delete/delete.component.js +0 -32
- package/esm2015/manager/submission/edit/edit.component.js +0 -24
- package/esm2015/manager/submission/index/index.component.js +0 -24
- package/esm2015/manager/submission/submission/submission.component.js +0 -27
- package/esm2015/manager/submission/view/view.component.js +0 -16
- package/esm2015/manager/view/view.component.js +0 -45
- package/esm2015/resource/create/create.component.js +0 -40
- package/esm2015/resource/delete/delete.component.js +0 -29
- package/esm2015/resource/edit/edit.component.js +0 -39
- package/esm2015/resource/index/index.component.js +0 -65
- package/esm2015/resource/resource.component.js +0 -48
- package/esm2015/resource/resource.config.js +0 -12
- package/esm2015/resource/resource.module.js +0 -44
- package/esm2015/resource/resource.service.js +0 -187
- package/esm2015/resource/resources.service.js +0 -22
- package/esm2015/resource/view/view.component.js +0 -24
- package/fesm2015/formio-angular-auth.js +0 -285
- package/fesm2015/formio-angular-auth.js.map +0 -1
- package/fesm2015/formio-angular-grid.js +0 -624
- package/fesm2015/formio-angular-grid.js.map +0 -1
- package/fesm2015/formio-angular-manager.js +0 -750
- package/fesm2015/formio-angular-manager.js.map +0 -1
- package/fesm2015/formio-angular-resource.js +0 -515
- package/fesm2015/formio-angular-resource.js.map +0 -1
- package/fesm2015/formio-angular.js +0 -1073
- package/fesm2015/formio-angular.js.map +0 -1
- package/formio-angular.metadata.json +0 -1
- package/formio.config.ngfactory.d.ts.map +0 -1
- package/formio.module.ngfactory.d.ts.map +0 -1
- package/grid/GridBodyComponent.ngfactory.d.ts.map +0 -1
- package/grid/GridFooterComponent.ngfactory.d.ts.map +0 -1
- package/grid/GridHeaderComponent.ngfactory.d.ts.map +0 -1
- package/grid/form/FormGridBody.component.ngfactory.d.ts.map +0 -1
- package/grid/form/FormGridBody.component.scss.shim.ngstyle.d.ts.map +0 -1
- package/grid/form/FormGridFooter.component.ngfactory.d.ts.map +0 -1
- package/grid/form/FormGridHeader.component.ngfactory.d.ts.map +0 -1
- package/grid/form/time-since.pipe.ngfactory.d.ts.map +0 -1
- package/grid/formio-angular-grid.metadata.json +0 -1
- package/grid/grid.component.ngfactory.d.ts.map +0 -1
- package/grid/grid.component.scss.shim.ngstyle.d.ts.map +0 -1
- package/grid/grid.footer.scss.ngstyle.d.ts.map +0 -1
- package/grid/grid.module.ngfactory.d.ts.map +0 -1
- package/grid/grid.service.ngfactory.d.ts.map +0 -1
- package/grid/submission/SubmissionGridBody.component.ngfactory.d.ts.map +0 -1
- package/grid/submission/SubmissionGridFooter.component.ngfactory.d.ts.map +0 -1
- package/grid/submission/SubmissionGridHeader.component.ngfactory.d.ts.map +0 -1
- package/manager/formio-angular-manager.metadata.json +0 -1
- package/resource/formio-angular-resource.metadata.json +0 -1
|
@@ -1,1122 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@formio/angular'), require('formiojs'), require('@formio/angular/auth'), require('lodash/intersection'), require('@angular/router'), require('@formio/angular/grid'), require('lodash'), require('ngx-bootstrap/modal'), require('@angular/common'), require('@angular/forms'), require('ngx-bootstrap/pagination')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@formio/angular/manager', ['exports', '@angular/core', '@formio/angular', 'formiojs', '@formio/angular/auth', 'lodash/intersection', '@angular/router', '@formio/angular/grid', 'lodash', 'ngx-bootstrap/modal', '@angular/common', '@angular/forms', 'ngx-bootstrap/pagination'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.formio = global.formio || {}, global.formio.angular = global.formio.angular || {}, global.formio.angular.manager = {}), global.ng.core, global.formio.angular, global.formiojs, global.formio.angular.auth, global._intersection, global.ng.router, global.formio.angular.grid, global._, global["ngx-bootstrap/modal"], global.ng.common, global.ng.forms, global["ngx-bootstrap/pagination"]));
|
|
5
|
-
})(this, (function (exports, core, angular, formiojs, auth, _intersection, router, grid, _, modal, common, forms, pagination) { 'use strict';
|
|
6
|
-
|
|
7
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
-
|
|
9
|
-
var _intersection__default = /*#__PURE__*/_interopDefaultLegacy(_intersection);
|
|
10
|
-
var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
|
|
11
|
-
|
|
12
|
-
var FormManagerConfig = /** @class */ (function () {
|
|
13
|
-
function FormManagerConfig() {
|
|
14
|
-
this.tag = '';
|
|
15
|
-
this.includeSearch = false;
|
|
16
|
-
this.saveDraft = false;
|
|
17
|
-
}
|
|
18
|
-
return FormManagerConfig;
|
|
19
|
-
}());
|
|
20
|
-
FormManagerConfig.decorators = [
|
|
21
|
-
{ type: core.Injectable }
|
|
22
|
-
];
|
|
23
|
-
|
|
24
|
-
var FormManagerService = /** @class */ (function () {
|
|
25
|
-
function FormManagerService(appConfig, config, auth) {
|
|
26
|
-
var _this = this;
|
|
27
|
-
this.appConfig = appConfig;
|
|
28
|
-
this.config = config;
|
|
29
|
-
this.auth = auth;
|
|
30
|
-
this.form = null;
|
|
31
|
-
this.formSrc = '';
|
|
32
|
-
this.perms = { delete: false, edit: false };
|
|
33
|
-
if (this.appConfig && this.appConfig.appUrl) {
|
|
34
|
-
formiojs.Formio.setBaseUrl(this.appConfig.apiUrl);
|
|
35
|
-
formiojs.Formio.setProjectUrl(this.appConfig.appUrl);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
console.error('You must provide an AppConfig within your application!');
|
|
39
|
-
}
|
|
40
|
-
this.allAccessMap = {
|
|
41
|
-
'update_all': 'formEdit',
|
|
42
|
-
'delete_all': 'formDelete'
|
|
43
|
-
};
|
|
44
|
-
this.ownAccessMap = {
|
|
45
|
-
'update_own': 'formEdit',
|
|
46
|
-
'delete_own': 'formDelete'
|
|
47
|
-
};
|
|
48
|
-
this.actionAllowed = function (action) { return _this.isActionAllowed(action); };
|
|
49
|
-
this.reset();
|
|
50
|
-
}
|
|
51
|
-
FormManagerService.prototype.isActionAllowed = function (action) {
|
|
52
|
-
return this.access[action];
|
|
53
|
-
};
|
|
54
|
-
FormManagerService.prototype.setAccess = function () {
|
|
55
|
-
var _this = this;
|
|
56
|
-
this.access = {
|
|
57
|
-
formCreate: true,
|
|
58
|
-
formView: true,
|
|
59
|
-
formSubmission: true,
|
|
60
|
-
formEdit: true,
|
|
61
|
-
formPermission: true,
|
|
62
|
-
formDelete: true,
|
|
63
|
-
projectSettings: true,
|
|
64
|
-
userManagement: true
|
|
65
|
-
};
|
|
66
|
-
if (this.auth) {
|
|
67
|
-
this.access = {
|
|
68
|
-
formCreate: false,
|
|
69
|
-
formView: false,
|
|
70
|
-
formSubmission: false,
|
|
71
|
-
formEdit: false,
|
|
72
|
-
formPermission: false,
|
|
73
|
-
formDelete: false,
|
|
74
|
-
projectSettings: false,
|
|
75
|
-
userManagement: false
|
|
76
|
-
};
|
|
77
|
-
this.ready = this.auth.ready.then(function () {
|
|
78
|
-
var administrator = _this.auth.roles["administrator"];
|
|
79
|
-
var formbuilder = _this.auth.roles["formbuilder"];
|
|
80
|
-
var formadmin = _this.auth.roles["formadmin"];
|
|
81
|
-
if (_this.auth.user && _this.auth.user.roles) {
|
|
82
|
-
_this.auth.user.roles.forEach(function (roleId) {
|
|
83
|
-
if (administrator._id === roleId) {
|
|
84
|
-
_this.access.formCreate = true;
|
|
85
|
-
_this.access.formView = true;
|
|
86
|
-
_this.access.formSubmission = true;
|
|
87
|
-
_this.access.formEdit = true;
|
|
88
|
-
_this.access.formPermission = true;
|
|
89
|
-
_this.access.formDelete = true;
|
|
90
|
-
_this.access.projectSettings = true;
|
|
91
|
-
_this.access.userManagement = true;
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
if (formadmin._id === roleId) {
|
|
95
|
-
_this.access.formCreate = _this.auth.formAccess.create_all.includes(roleId);
|
|
96
|
-
_this.access.formEdit = _this.auth.formAccess.update_all.includes(roleId);
|
|
97
|
-
_this.access.formPermission = _this.auth.formAccess.update_all.includes(roleId);
|
|
98
|
-
_this.access.formDelete = _this.auth.formAccess.delete_all.includes(roleId);
|
|
99
|
-
_this.access.formView = _this.auth.formAccess.read_all.includes(roleId);
|
|
100
|
-
_this.access.formSubmission = _this.auth.formAccess.read_all.includes(roleId);
|
|
101
|
-
}
|
|
102
|
-
if (formbuilder._id === roleId) {
|
|
103
|
-
_this.access.formCreate = _this.auth.formAccess.create_all.includes(roleId);
|
|
104
|
-
_this.access.formEdit = _this.auth.formAccess.update_all.includes(roleId);
|
|
105
|
-
_this.access.formPermission = _this.auth.formAccess.update_all.includes(roleId);
|
|
106
|
-
_this.access.formDelete = _this.auth.formAccess.delete_all.includes(roleId);
|
|
107
|
-
_this.access.formView = _this.auth.formAccess.read_all.includes(roleId);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
this.ready = Promise.resolve(false);
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
FormManagerService.prototype.reset = function (route) {
|
|
119
|
-
var _this = this;
|
|
120
|
-
if (route) {
|
|
121
|
-
route.params.subscribe(function (params) {
|
|
122
|
-
if (params.id) {
|
|
123
|
-
_this.formio = new formiojs.Formio(_this.formio.formsUrl + "/" + params.id);
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
_this.reset();
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
this.formio = new formiojs.Formio(this.appConfig.appUrl);
|
|
132
|
-
this.setAccess();
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
FormManagerService.prototype.hasAccess = function (roles) {
|
|
136
|
-
if (!this.auth.user) {
|
|
137
|
-
return false;
|
|
138
|
-
}
|
|
139
|
-
return !!_intersection__default["default"](roles, this.auth.user.roles).length;
|
|
140
|
-
};
|
|
141
|
-
FormManagerService.prototype.setForm = function (form) {
|
|
142
|
-
var _this = this;
|
|
143
|
-
this.form = form;
|
|
144
|
-
this.formSrc = this.appConfig.appUrl + '/' + form.path;
|
|
145
|
-
if (form.access) {
|
|
146
|
-
// Check if they have access here.
|
|
147
|
-
form.access.forEach(function (access) {
|
|
148
|
-
// Check for all access.
|
|
149
|
-
if (_this.allAccessMap[access.type] && !_this.access[_this.allAccessMap[access.type]]) {
|
|
150
|
-
_this.access[_this.allAccessMap[access.type]] = _this.hasAccess(access.roles);
|
|
151
|
-
}
|
|
152
|
-
// Check for own access.
|
|
153
|
-
if (_this.auth && _this.auth.user &&
|
|
154
|
-
(form._id === _this.auth.user._id) &&
|
|
155
|
-
_this.ownAccessMap[access.type] &&
|
|
156
|
-
!_this.access[_this.ownAccessMap[access.type]]) {
|
|
157
|
-
_this.access[_this.ownAccessMap[access.type]] = _this.hasAccess(access.roles);
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
return form;
|
|
162
|
-
};
|
|
163
|
-
FormManagerService.prototype.loadForm = function () {
|
|
164
|
-
var _this = this;
|
|
165
|
-
this.form = null;
|
|
166
|
-
this.formReady = this.formio.loadForm().then(function (form) { return _this.setForm(form); });
|
|
167
|
-
return this.formReady;
|
|
168
|
-
};
|
|
169
|
-
FormManagerService.prototype.setSubmission = function (route) {
|
|
170
|
-
var _this = this;
|
|
171
|
-
return new Promise(function (resolve) {
|
|
172
|
-
route.params.subscribe(function (params) {
|
|
173
|
-
_this.formio = new formiojs.Formio(_this.formio.submissionsUrl + "/" + params.id);
|
|
174
|
-
resolve(_this.formio);
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
};
|
|
178
|
-
FormManagerService.prototype.submissionLoaded = function (submission) {
|
|
179
|
-
var _this = this;
|
|
180
|
-
this.auth.ready.then(function () {
|
|
181
|
-
_this.formio.userPermissions(_this.auth.user, _this.form, submission).then(function (perms) {
|
|
182
|
-
_this.perms.delete = perms.delete;
|
|
183
|
-
_this.perms.edit = perms.edit;
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
};
|
|
187
|
-
FormManagerService.prototype.loadForms = function () {
|
|
188
|
-
return this.formio.loadForms({ params: {
|
|
189
|
-
tags: this.config.tag
|
|
190
|
-
} });
|
|
191
|
-
};
|
|
192
|
-
FormManagerService.prototype.createForm = function (form) {
|
|
193
|
-
return this.formio.createform(form);
|
|
194
|
-
};
|
|
195
|
-
return FormManagerService;
|
|
196
|
-
}());
|
|
197
|
-
FormManagerService.decorators = [
|
|
198
|
-
{ type: core.Injectable }
|
|
199
|
-
];
|
|
200
|
-
FormManagerService.ctorParameters = function () { return [
|
|
201
|
-
{ type: angular.FormioAppConfig },
|
|
202
|
-
{ type: FormManagerConfig },
|
|
203
|
-
{ type: auth.FormioAuthService }
|
|
204
|
-
]; };
|
|
205
|
-
|
|
206
|
-
var FormManagerIndexComponent = /** @class */ (function () {
|
|
207
|
-
function FormManagerIndexComponent(service, route, router, config) {
|
|
208
|
-
this.service = service;
|
|
209
|
-
this.route = route;
|
|
210
|
-
this.router = router;
|
|
211
|
-
this.config = config;
|
|
212
|
-
this.search = '';
|
|
213
|
-
this.gridQuery = { tags: this.config.tag, type: 'form', sort: 'title' };
|
|
214
|
-
this.onSearch = _.debounce(this.onSearch, 300);
|
|
215
|
-
}
|
|
216
|
-
FormManagerIndexComponent.prototype.loadGrid = function () {
|
|
217
|
-
var _this = this;
|
|
218
|
-
this.search = localStorage.getItem('searchInput');
|
|
219
|
-
this.gridQuery = JSON.parse(localStorage.getItem('query')) || this.gridQuery;
|
|
220
|
-
var currentPage = +localStorage.getItem('currentPage') || 0;
|
|
221
|
-
this.formGrid
|
|
222
|
-
.refreshGrid(this.gridQuery)
|
|
223
|
-
.then(function () { return _this.formGrid.setPage(currentPage - 1); });
|
|
224
|
-
};
|
|
225
|
-
FormManagerIndexComponent.prototype.ngOnInit = function () {
|
|
226
|
-
var _this = this;
|
|
227
|
-
this.gridQuery = { tags: this.config.tag, type: 'form', sort: 'title' };
|
|
228
|
-
this.service.reset();
|
|
229
|
-
this.service.ready.then(function () {
|
|
230
|
-
_this.loadGrid();
|
|
231
|
-
_this.formGrid.footer.pageChanged.subscribe(function (page) {
|
|
232
|
-
localStorage.setItem('currentPage', page.page);
|
|
233
|
-
});
|
|
234
|
-
});
|
|
235
|
-
};
|
|
236
|
-
FormManagerIndexComponent.prototype.onSearch = function (event) {
|
|
237
|
-
var searchInput = this.search;
|
|
238
|
-
if (searchInput.length > 0) {
|
|
239
|
-
this.gridQuery.skip = 0;
|
|
240
|
-
this.gridQuery.title__regex = '/' + searchInput + '/i';
|
|
241
|
-
this.gridQuery.title__regex = '/' + searchInput.trim() + '/i';
|
|
242
|
-
}
|
|
243
|
-
else {
|
|
244
|
-
delete this.gridQuery.title__regex;
|
|
245
|
-
}
|
|
246
|
-
localStorage.setItem('query', JSON.stringify(this.gridQuery));
|
|
247
|
-
localStorage.setItem('searchInput', this.search);
|
|
248
|
-
this.formGrid.pageChanged({ page: 1, itemPerPage: this.gridQuery.limit });
|
|
249
|
-
this.formGrid.refreshGrid(this.gridQuery);
|
|
250
|
-
};
|
|
251
|
-
FormManagerIndexComponent.prototype.clearSearch = function () {
|
|
252
|
-
this.gridQuery = { tags: this.config.tag, type: 'form', sort: 'title' };
|
|
253
|
-
localStorage.removeItem('query');
|
|
254
|
-
localStorage.removeItem('searchInput');
|
|
255
|
-
localStorage.removeItem('currentPage');
|
|
256
|
-
this.search = '';
|
|
257
|
-
this.formGrid.pageChanged({ page: 1 });
|
|
258
|
-
this.formGrid.query = {};
|
|
259
|
-
this.formGrid.refreshGrid({ tags: this.config.tag, type: 'form', sort: 'title' });
|
|
260
|
-
};
|
|
261
|
-
FormManagerIndexComponent.prototype.onAction = function (action) {
|
|
262
|
-
this.service.form = null; // Reset previous form data
|
|
263
|
-
this.router.navigate([action.row._id, action.action], { relativeTo: this.route });
|
|
264
|
-
};
|
|
265
|
-
FormManagerIndexComponent.prototype.onSelect = function (row) {
|
|
266
|
-
this.router.navigate([row._id], { relativeTo: this.route });
|
|
267
|
-
};
|
|
268
|
-
FormManagerIndexComponent.prototype.onCreateItem = function () {
|
|
269
|
-
this.router.navigate(['create'], { relativeTo: this.route });
|
|
270
|
-
};
|
|
271
|
-
return FormManagerIndexComponent;
|
|
272
|
-
}());
|
|
273
|
-
FormManagerIndexComponent.decorators = [
|
|
274
|
-
{ type: core.Component, args: [{
|
|
275
|
-
template: "<div role=\"search\" class=\"input-group mb-3\" *ngIf=\"config.includeSearch\">\n <input type=\"text\" (keyup)=\"onSearch()\" class=\"form-control\" [(ngModel)]=\"search\" placeholder=\"Search Forms\" aria-label=\"Search Forms\" aria-describedby=\"button-search\">\n <span *ngIf=\"search && search !== ''\" class=\"form-clear input-group-addon\" (click)=\"clearSearch()\"><span class=\"fa fa-times\"></span></span>\n</div>\n<formio-grid\n *ngIf=\"service.ready\"\n [formio]=\"service.formio\"\n [gridType]=\"'form'\"\n [query]=\"gridQuery\"\n [isActionAllowed]=\"service.actionAllowed\"\n (rowAction)=\"onAction($event)\"\n (rowSelect)=\"onSelect($event)\"\n (createItem)=\"onCreateItem()\"\n></formio-grid>\n",
|
|
276
|
-
styles: [".form-clear{background:#cecece;border-radius:50%;bottom:8px;color:#0000004d;cursor:pointer;display:flex;justify-content:center;align-items:center;padding-bottom:2px;height:24px;position:absolute;right:10px;top:6px;width:24px;z-index:10}.form-clear .fa{font-size:16px;font-weight:500}\n"]
|
|
277
|
-
},] }
|
|
278
|
-
];
|
|
279
|
-
FormManagerIndexComponent.ctorParameters = function () { return [
|
|
280
|
-
{ type: FormManagerService },
|
|
281
|
-
{ type: router.ActivatedRoute },
|
|
282
|
-
{ type: router.Router },
|
|
283
|
-
{ type: FormManagerConfig }
|
|
284
|
-
]; };
|
|
285
|
-
FormManagerIndexComponent.propDecorators = {
|
|
286
|
-
formGrid: [{ type: core.ViewChild, args: [grid.FormioGridComponent, { static: false },] }]
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
/*! *****************************************************************************
|
|
290
|
-
Copyright (c) Microsoft Corporation.
|
|
291
|
-
|
|
292
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
293
|
-
purpose with or without fee is hereby granted.
|
|
294
|
-
|
|
295
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
296
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
297
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
298
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
299
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
300
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
301
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
302
|
-
***************************************************************************** */
|
|
303
|
-
/* global Reflect, Promise */
|
|
304
|
-
var extendStatics = function (d, b) {
|
|
305
|
-
extendStatics = Object.setPrototypeOf ||
|
|
306
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
307
|
-
function (d, b) { for (var p in b)
|
|
308
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
309
|
-
d[p] = b[p]; };
|
|
310
|
-
return extendStatics(d, b);
|
|
311
|
-
};
|
|
312
|
-
function __extends(d, b) {
|
|
313
|
-
if (typeof b !== "function" && b !== null)
|
|
314
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
315
|
-
extendStatics(d, b);
|
|
316
|
-
function __() { this.constructor = d; }
|
|
317
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
318
|
-
}
|
|
319
|
-
var __assign = function () {
|
|
320
|
-
__assign = Object.assign || function __assign(t) {
|
|
321
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
322
|
-
s = arguments[i];
|
|
323
|
-
for (var p in s)
|
|
324
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
325
|
-
t[p] = s[p];
|
|
326
|
-
}
|
|
327
|
-
return t;
|
|
328
|
-
};
|
|
329
|
-
return __assign.apply(this, arguments);
|
|
330
|
-
};
|
|
331
|
-
function __rest(s, e) {
|
|
332
|
-
var t = {};
|
|
333
|
-
for (var p in s)
|
|
334
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
335
|
-
t[p] = s[p];
|
|
336
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
337
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
338
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
339
|
-
t[p[i]] = s[p[i]];
|
|
340
|
-
}
|
|
341
|
-
return t;
|
|
342
|
-
}
|
|
343
|
-
function __decorate(decorators, target, key, desc) {
|
|
344
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
345
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
346
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
347
|
-
else
|
|
348
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
349
|
-
if (d = decorators[i])
|
|
350
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
351
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
352
|
-
}
|
|
353
|
-
function __param(paramIndex, decorator) {
|
|
354
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
355
|
-
}
|
|
356
|
-
function __metadata(metadataKey, metadataValue) {
|
|
357
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
358
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
359
|
-
}
|
|
360
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
361
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
362
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
363
|
-
function fulfilled(value) { try {
|
|
364
|
-
step(generator.next(value));
|
|
365
|
-
}
|
|
366
|
-
catch (e) {
|
|
367
|
-
reject(e);
|
|
368
|
-
} }
|
|
369
|
-
function rejected(value) { try {
|
|
370
|
-
step(generator["throw"](value));
|
|
371
|
-
}
|
|
372
|
-
catch (e) {
|
|
373
|
-
reject(e);
|
|
374
|
-
} }
|
|
375
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
376
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
function __generator(thisArg, body) {
|
|
380
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
381
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
382
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
383
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
384
|
-
function step(op) {
|
|
385
|
-
if (f)
|
|
386
|
-
throw new TypeError("Generator is already executing.");
|
|
387
|
-
while (_)
|
|
388
|
-
try {
|
|
389
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
390
|
-
return t;
|
|
391
|
-
if (y = 0, t)
|
|
392
|
-
op = [op[0] & 2, t.value];
|
|
393
|
-
switch (op[0]) {
|
|
394
|
-
case 0:
|
|
395
|
-
case 1:
|
|
396
|
-
t = op;
|
|
397
|
-
break;
|
|
398
|
-
case 4:
|
|
399
|
-
_.label++;
|
|
400
|
-
return { value: op[1], done: false };
|
|
401
|
-
case 5:
|
|
402
|
-
_.label++;
|
|
403
|
-
y = op[1];
|
|
404
|
-
op = [0];
|
|
405
|
-
continue;
|
|
406
|
-
case 7:
|
|
407
|
-
op = _.ops.pop();
|
|
408
|
-
_.trys.pop();
|
|
409
|
-
continue;
|
|
410
|
-
default:
|
|
411
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
412
|
-
_ = 0;
|
|
413
|
-
continue;
|
|
414
|
-
}
|
|
415
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
416
|
-
_.label = op[1];
|
|
417
|
-
break;
|
|
418
|
-
}
|
|
419
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
420
|
-
_.label = t[1];
|
|
421
|
-
t = op;
|
|
422
|
-
break;
|
|
423
|
-
}
|
|
424
|
-
if (t && _.label < t[2]) {
|
|
425
|
-
_.label = t[2];
|
|
426
|
-
_.ops.push(op);
|
|
427
|
-
break;
|
|
428
|
-
}
|
|
429
|
-
if (t[2])
|
|
430
|
-
_.ops.pop();
|
|
431
|
-
_.trys.pop();
|
|
432
|
-
continue;
|
|
433
|
-
}
|
|
434
|
-
op = body.call(thisArg, _);
|
|
435
|
-
}
|
|
436
|
-
catch (e) {
|
|
437
|
-
op = [6, e];
|
|
438
|
-
y = 0;
|
|
439
|
-
}
|
|
440
|
-
finally {
|
|
441
|
-
f = t = 0;
|
|
442
|
-
}
|
|
443
|
-
if (op[0] & 5)
|
|
444
|
-
throw op[1];
|
|
445
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
449
|
-
if (k2 === undefined)
|
|
450
|
-
k2 = k;
|
|
451
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
452
|
-
}) : (function (o, m, k, k2) {
|
|
453
|
-
if (k2 === undefined)
|
|
454
|
-
k2 = k;
|
|
455
|
-
o[k2] = m[k];
|
|
456
|
-
});
|
|
457
|
-
function __exportStar(m, o) {
|
|
458
|
-
for (var p in m)
|
|
459
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
460
|
-
__createBinding(o, m, p);
|
|
461
|
-
}
|
|
462
|
-
function __values(o) {
|
|
463
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
464
|
-
if (m)
|
|
465
|
-
return m.call(o);
|
|
466
|
-
if (o && typeof o.length === "number")
|
|
467
|
-
return {
|
|
468
|
-
next: function () {
|
|
469
|
-
if (o && i >= o.length)
|
|
470
|
-
o = void 0;
|
|
471
|
-
return { value: o && o[i++], done: !o };
|
|
472
|
-
}
|
|
473
|
-
};
|
|
474
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
475
|
-
}
|
|
476
|
-
function __read(o, n) {
|
|
477
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
478
|
-
if (!m)
|
|
479
|
-
return o;
|
|
480
|
-
var i = m.call(o), r, ar = [], e;
|
|
481
|
-
try {
|
|
482
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
483
|
-
ar.push(r.value);
|
|
484
|
-
}
|
|
485
|
-
catch (error) {
|
|
486
|
-
e = { error: error };
|
|
487
|
-
}
|
|
488
|
-
finally {
|
|
489
|
-
try {
|
|
490
|
-
if (r && !r.done && (m = i["return"]))
|
|
491
|
-
m.call(i);
|
|
492
|
-
}
|
|
493
|
-
finally {
|
|
494
|
-
if (e)
|
|
495
|
-
throw e.error;
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
return ar;
|
|
499
|
-
}
|
|
500
|
-
/** @deprecated */
|
|
501
|
-
function __spread() {
|
|
502
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
503
|
-
ar = ar.concat(__read(arguments[i]));
|
|
504
|
-
return ar;
|
|
505
|
-
}
|
|
506
|
-
/** @deprecated */
|
|
507
|
-
function __spreadArrays() {
|
|
508
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
509
|
-
s += arguments[i].length;
|
|
510
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
511
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
512
|
-
r[k] = a[j];
|
|
513
|
-
return r;
|
|
514
|
-
}
|
|
515
|
-
function __spreadArray(to, from, pack) {
|
|
516
|
-
if (pack || arguments.length === 2)
|
|
517
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
518
|
-
if (ar || !(i in from)) {
|
|
519
|
-
if (!ar)
|
|
520
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
521
|
-
ar[i] = from[i];
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
525
|
-
}
|
|
526
|
-
function __await(v) {
|
|
527
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
528
|
-
}
|
|
529
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
530
|
-
if (!Symbol.asyncIterator)
|
|
531
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
532
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
533
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
534
|
-
function verb(n) { if (g[n])
|
|
535
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
536
|
-
function resume(n, v) { try {
|
|
537
|
-
step(g[n](v));
|
|
538
|
-
}
|
|
539
|
-
catch (e) {
|
|
540
|
-
settle(q[0][3], e);
|
|
541
|
-
} }
|
|
542
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
543
|
-
function fulfill(value) { resume("next", value); }
|
|
544
|
-
function reject(value) { resume("throw", value); }
|
|
545
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
546
|
-
resume(q[0][0], q[0][1]); }
|
|
547
|
-
}
|
|
548
|
-
function __asyncDelegator(o) {
|
|
549
|
-
var i, p;
|
|
550
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
551
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
552
|
-
}
|
|
553
|
-
function __asyncValues(o) {
|
|
554
|
-
if (!Symbol.asyncIterator)
|
|
555
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
556
|
-
var m = o[Symbol.asyncIterator], i;
|
|
557
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
558
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
559
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
560
|
-
}
|
|
561
|
-
function __makeTemplateObject(cooked, raw) {
|
|
562
|
-
if (Object.defineProperty) {
|
|
563
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
564
|
-
}
|
|
565
|
-
else {
|
|
566
|
-
cooked.raw = raw;
|
|
567
|
-
}
|
|
568
|
-
return cooked;
|
|
569
|
-
}
|
|
570
|
-
;
|
|
571
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
572
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
573
|
-
}) : function (o, v) {
|
|
574
|
-
o["default"] = v;
|
|
575
|
-
};
|
|
576
|
-
function __importStar(mod) {
|
|
577
|
-
if (mod && mod.__esModule)
|
|
578
|
-
return mod;
|
|
579
|
-
var result = {};
|
|
580
|
-
if (mod != null)
|
|
581
|
-
for (var k in mod)
|
|
582
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
583
|
-
__createBinding(result, mod, k);
|
|
584
|
-
__setModuleDefault(result, mod);
|
|
585
|
-
return result;
|
|
586
|
-
}
|
|
587
|
-
function __importDefault(mod) {
|
|
588
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
589
|
-
}
|
|
590
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
591
|
-
if (kind === "a" && !f)
|
|
592
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
593
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
594
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
595
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
596
|
-
}
|
|
597
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
598
|
-
if (kind === "m")
|
|
599
|
-
throw new TypeError("Private method is not writable");
|
|
600
|
-
if (kind === "a" && !f)
|
|
601
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
602
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
603
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
604
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
var FormManagerEditComponent = /** @class */ (function () {
|
|
608
|
-
function FormManagerEditComponent(service, router, route, config, ref, alerts) {
|
|
609
|
-
this.service = service;
|
|
610
|
-
this.router = router;
|
|
611
|
-
this.route = route;
|
|
612
|
-
this.config = config;
|
|
613
|
-
this.ref = ref;
|
|
614
|
-
this.alerts = alerts;
|
|
615
|
-
this.form = { components: [] };
|
|
616
|
-
this.formReady = false;
|
|
617
|
-
this.loading = false;
|
|
618
|
-
this.editMode = false;
|
|
619
|
-
}
|
|
620
|
-
FormManagerEditComponent.prototype.initBuilder = function (editing) {
|
|
621
|
-
var _this = this;
|
|
622
|
-
if (editing) {
|
|
623
|
-
this.loading = true;
|
|
624
|
-
this.editMode = true;
|
|
625
|
-
return this.service.formReady.then(function () {
|
|
626
|
-
_this.form = _this.service.form;
|
|
627
|
-
_this.formTitle.nativeElement.value = _this.service.form.title;
|
|
628
|
-
_this.formType.nativeElement.value = _this.service.form.display || 'form';
|
|
629
|
-
_this.formReady = true;
|
|
630
|
-
_this.loading = false;
|
|
631
|
-
_this.ref.detectChanges();
|
|
632
|
-
return true;
|
|
633
|
-
}).catch(function (err) {
|
|
634
|
-
_this.alerts.setAlert({ type: 'danger', message: (err.message || err) });
|
|
635
|
-
_this.loading = false;
|
|
636
|
-
_this.ref.detectChanges();
|
|
637
|
-
_this.formReady = true;
|
|
638
|
-
});
|
|
639
|
-
}
|
|
640
|
-
else {
|
|
641
|
-
this.formReady = true;
|
|
642
|
-
return Promise.resolve(true);
|
|
643
|
-
}
|
|
644
|
-
};
|
|
645
|
-
FormManagerEditComponent.prototype.ngAfterViewInit = function () {
|
|
646
|
-
var _this = this;
|
|
647
|
-
this.route.url.subscribe(function (url) {
|
|
648
|
-
setTimeout(function () { return _this.initBuilder((url[0].path === 'edit')); }, 0);
|
|
649
|
-
});
|
|
650
|
-
};
|
|
651
|
-
FormManagerEditComponent.prototype.onDisplaySelect = function (event) {
|
|
652
|
-
this.builder.setDisplay(event.target.value);
|
|
653
|
-
};
|
|
654
|
-
FormManagerEditComponent.prototype.saveForm = function () {
|
|
655
|
-
var _this = this;
|
|
656
|
-
this.loading = true;
|
|
657
|
-
this.form = ___default["default"].cloneDeep(this.builder.formio.schema);
|
|
658
|
-
this.form.title = this.formTitle.nativeElement.value.trim();
|
|
659
|
-
this.form.display = this.formType.nativeElement.value;
|
|
660
|
-
if (this.config.tag) {
|
|
661
|
-
this.form.tags = this.form.tags || [];
|
|
662
|
-
this.form.tags.push(this.config.tag);
|
|
663
|
-
this.form.tags = ___default["default"].uniq(this.form.tags);
|
|
664
|
-
}
|
|
665
|
-
if (!this.form._id) {
|
|
666
|
-
this.form.name = ___default["default"].camelCase(this.form.title).toLowerCase();
|
|
667
|
-
this.form.path = this.form.name;
|
|
668
|
-
}
|
|
669
|
-
return this.service.formio.saveForm(this.form).then(function (form) {
|
|
670
|
-
_this.form = _this.service.setForm(form);
|
|
671
|
-
_this.loading = false;
|
|
672
|
-
return _this.form;
|
|
673
|
-
}).catch(function (err) {
|
|
674
|
-
_this.loading = false;
|
|
675
|
-
// Catch if a form is returned as an error. This is a conflict.
|
|
676
|
-
if (err._id && err.type) {
|
|
677
|
-
throw err;
|
|
678
|
-
}
|
|
679
|
-
_this.alerts.setAlert({ type: 'danger', message: (err.message || err) });
|
|
680
|
-
});
|
|
681
|
-
};
|
|
682
|
-
FormManagerEditComponent.prototype.onSave = function () {
|
|
683
|
-
var _this = this;
|
|
684
|
-
return this.saveForm().then(function (form) {
|
|
685
|
-
if (_this.editMode) {
|
|
686
|
-
_this.router.navigate(['../', 'view'], { relativeTo: _this.route });
|
|
687
|
-
}
|
|
688
|
-
else {
|
|
689
|
-
_this.router.navigate(['../', form._id, 'view'], { relativeTo: _this.route });
|
|
690
|
-
}
|
|
691
|
-
});
|
|
692
|
-
};
|
|
693
|
-
return FormManagerEditComponent;
|
|
694
|
-
}());
|
|
695
|
-
FormManagerEditComponent.decorators = [
|
|
696
|
-
{ type: core.Component, args: [{
|
|
697
|
-
template: "<div class=\"loader\" *ngIf=\"loading\"></div>\n<div class=\"form-group row\">\n <div class=\"col-sm-8\">\n <input type=\"text\" class=\"form-control\" id=\"formTitle\" placeholder=\"Enter a Title\" #title>\n </div>\n <div class=\"col-sm-2\">\n <select class=\"form-control\" id=\"formSelect\" (change)=\"onDisplaySelect($event)\" #type>\n <option value=\"form\">Form</option>\n <option value=\"wizard\">Wizard</option>\n <option value=\"pdf\">PDF</option>\n </select>\n </div>\n <div class=\"col-sm-2\">\n <button class=\"btn btn-primary btn-block\" (click)=\"onSave()\">Save Form</button>\n </div>\n</div>\n<formio-alerts [alerts]=\"alerts\"></formio-alerts>\n<form-builder *ngIf=\"formReady\" [formbuilder]=\"config.builder\" [form]=\"form\" #builder></form-builder>\n<button class=\"btn btn-primary\" style=\"margin-top: 10px;\" (click)=\"onSave()\">Save Form</button>\n"
|
|
698
|
-
},] }
|
|
699
|
-
];
|
|
700
|
-
FormManagerEditComponent.ctorParameters = function () { return [
|
|
701
|
-
{ type: FormManagerService },
|
|
702
|
-
{ type: router.Router },
|
|
703
|
-
{ type: router.ActivatedRoute },
|
|
704
|
-
{ type: FormManagerConfig },
|
|
705
|
-
{ type: core.ChangeDetectorRef },
|
|
706
|
-
{ type: angular.FormioAlerts }
|
|
707
|
-
]; };
|
|
708
|
-
FormManagerEditComponent.propDecorators = {
|
|
709
|
-
builder: [{ type: core.ViewChild, args: [angular.FormBuilderComponent, { static: false },] }],
|
|
710
|
-
formTitle: [{ type: core.ViewChild, args: ['title', { static: false },] }],
|
|
711
|
-
formType: [{ type: core.ViewChild, args: ['type', { static: false },] }]
|
|
712
|
-
};
|
|
713
|
-
|
|
714
|
-
var FormManagerCreateComponent = /** @class */ (function (_super) {
|
|
715
|
-
__extends(FormManagerCreateComponent, _super);
|
|
716
|
-
function FormManagerCreateComponent() {
|
|
717
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
718
|
-
}
|
|
719
|
-
FormManagerCreateComponent.prototype.ngOnInit = function () {
|
|
720
|
-
this.service.reset();
|
|
721
|
-
};
|
|
722
|
-
return FormManagerCreateComponent;
|
|
723
|
-
}(FormManagerEditComponent));
|
|
724
|
-
FormManagerCreateComponent.decorators = [
|
|
725
|
-
{ type: core.Component, args: [{
|
|
726
|
-
template: "<div class=\"loader\" *ngIf=\"loading\"></div>\n<div class=\"form-group row\">\n <div class=\"col-sm-8\">\n <input type=\"text\" class=\"form-control\" id=\"formTitle\" placeholder=\"Enter a Title\" #title>\n </div>\n <div class=\"col-sm-2\">\n <select class=\"form-control\" id=\"formSelect\" (change)=\"onDisplaySelect($event)\" #type>\n <option value=\"form\">Form</option>\n <option value=\"wizard\">Wizard</option>\n <option value=\"pdf\">PDF</option>\n </select>\n </div>\n <div class=\"col-sm-2\">\n <button class=\"btn btn-primary btn-block\" (click)=\"onSave()\">Save Form</button>\n </div>\n</div>\n<formio-alerts [alerts]=\"alerts\"></formio-alerts>\n<form-builder *ngIf=\"formReady\" [formbuilder]=\"config.builder\" [form]=\"form\" #builder></form-builder>\n<button class=\"btn btn-primary\" style=\"margin-top: 10px;\" (click)=\"onSave()\">Save Form</button>\n"
|
|
727
|
-
},] }
|
|
728
|
-
];
|
|
729
|
-
|
|
730
|
-
var FormManagerFormComponent = /** @class */ (function () {
|
|
731
|
-
function FormManagerFormComponent(service, route, appConfig, options, modalService) {
|
|
732
|
-
this.service = service;
|
|
733
|
-
this.route = route;
|
|
734
|
-
this.appConfig = appConfig;
|
|
735
|
-
this.options = options;
|
|
736
|
-
this.modalService = modalService;
|
|
737
|
-
this.choice = 'isUrl';
|
|
738
|
-
this.goTo = '';
|
|
739
|
-
}
|
|
740
|
-
FormManagerFormComponent.prototype.ngOnInit = function () {
|
|
741
|
-
var _this = this;
|
|
742
|
-
this.service.reset(this.route);
|
|
743
|
-
this.service.loadForm().then(function (form) {
|
|
744
|
-
_this.service.formSrc = _this.appConfig.appUrl + '/' + form.path;
|
|
745
|
-
_this.projectId = form.project;
|
|
746
|
-
_this.pathName = form.path;
|
|
747
|
-
_this.getShareUrl();
|
|
748
|
-
});
|
|
749
|
-
};
|
|
750
|
-
FormManagerFormComponent.prototype.getShareUrl = function () {
|
|
751
|
-
var src = this.appConfig.appUrl + '/' + this.pathName;
|
|
752
|
-
this.shareUrl = this.options.viewer + "/#/?src=" + encodeURIComponent(src);
|
|
753
|
-
return this.shareUrl;
|
|
754
|
-
};
|
|
755
|
-
FormManagerFormComponent.prototype.openEmbed = function (content) {
|
|
756
|
-
var goto = '';
|
|
757
|
-
if (this.goTo) {
|
|
758
|
-
goto += "if (d && d.formSubmission && d.formSubmission._id) { window.location.href = \"" + this.goTo + "\";}";
|
|
759
|
-
}
|
|
760
|
-
var embedCode = '<script type="text/javascript">';
|
|
761
|
-
embedCode += '(function a(d, w, u) {';
|
|
762
|
-
embedCode += 'var h = d.getElementsByTagName("head")[0];';
|
|
763
|
-
embedCode += 'var s = d.createElement("script");';
|
|
764
|
-
embedCode += 's.type = "text/javascript";';
|
|
765
|
-
embedCode += 's.src = "' + this.options.viewer + '/assets/lib/seamless/seamless.parent.min.js";';
|
|
766
|
-
embedCode += 's.onload = function b() {';
|
|
767
|
-
embedCode += 'var f = d.getElementById("formio-form-' + this.service.formio.formId + '");';
|
|
768
|
-
embedCode += 'if (!f || (typeof w.seamless === u)) {';
|
|
769
|
-
embedCode += 'return setTimeout(b, 100);';
|
|
770
|
-
embedCode += '}';
|
|
771
|
-
embedCode += 'w.seamless(f, {fallback:false}).receive(function(d, e) {' + goto + '});';
|
|
772
|
-
embedCode += '};';
|
|
773
|
-
embedCode += 'h.appendChild(s);';
|
|
774
|
-
embedCode += '})(document, window);';
|
|
775
|
-
embedCode += '</script>';
|
|
776
|
-
embedCode += '<iframe id="formio-form-' + this.service.formio.formId + '" ';
|
|
777
|
-
embedCode += 'style="width:100%;border:none;" height="800px" src="' + this.shareUrl + '&iframe=1"></iframe>';
|
|
778
|
-
this.embedCode = embedCode;
|
|
779
|
-
this.modalRef = this.modalService.show(content, { class: 'modal-lg' });
|
|
780
|
-
};
|
|
781
|
-
FormManagerFormComponent.prototype.choices = function (string) {
|
|
782
|
-
this.choice = string;
|
|
783
|
-
};
|
|
784
|
-
return FormManagerFormComponent;
|
|
785
|
-
}());
|
|
786
|
-
FormManagerFormComponent.decorators = [
|
|
787
|
-
{ type: core.Component, args: [{
|
|
788
|
-
template: "<button *ngIf=\"options.viewer\" class=\"pull-right btn btn-outline-primary\" (click)=\"openEmbed(content)\"><i class=\"fa fa-share-alt glyphicon glyphicon-share\"></i> Share</button>\n<ul class=\"nav nav-tabs mb-2\">\n <li class=\"nav-item\"><a class=\"nav-link\" routerLink=\"../\"><i class=\"fa fa-chevron-left glyphicon glyphicon-chevron-left\"></i></a></li>\n <li class=\"nav-item\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"view\" routerLinkActive=\"active\"><i class=\"fa fa-pencil glyphicon glyphicon-pencil\"></i> Enter Data</a></li>\n <li class=\"nav-item\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"submission\" routerLinkActive=\"active\"><i class=\"fa fa-list-alt glyphicon glyphicon-list-alt\"></i> View Data</a></li>\n <li *ngIf=\"service.actionAllowed('formEdit')\" class=\"nav-item\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"edit\" routerLinkActive=\"active\"><i class=\"fa fa-edit glyphicon glyphicon-edit\"></i> Edit Form</a></li>\n <li *ngIf=\"service.actionAllowed('formDelete')\" class=\"nav-item\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"delete\" routerLinkActive=\"active\"><span class=\"fa fa-trash glyphicon glyphicon-trash\"></span></a></li>\n</ul>\n<router-outlet></router-outlet>\n<ng-template #content>\n <div class=\"modal-header\">\n <h4 class=\"modal-title\">Share or Embed this form</h4>\n <button type=\"button\" class=\"close\" aria-label=\"Close\" (click)=\"modalRef.hide()\">\n <span aria-hidden=\"true\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <ul class=\"nav nav-tabs mr-auto mb-2\">\n <li class=\"nav-item\">\n <a class=\"nav-link\" [ngClass]=\"{'active': choice === 'isUrl'}\" (click)=\"choices('isUrl')\"><i class=\"fa fa-link\"></i> URL</a>\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" [ngClass]=\"{'active': choice === 'isEmbed'}\" (click)=\"choices('isEmbed')\"><i class=\"fa fa-code\"></i> Embed</a>\n </li>\n </ul>\n <pre *ngIf=\"choice === 'isEmbed'\"><textarea onclick=\"this.focus();this.select()\" readonly=\"readonly\" style=\"width:100%;\" rows=\"8\" [ngModel]=\"embedCode\"></textarea></pre>\n <input *ngIf=\"choice === 'isUrl'\" type=\"text\" onclick=\"this.focus();this.select()\" readonly=\"readonly\" class=\"form-control\" [ngModel]=\"shareUrl\" placeholder=\"https://examples.form.io/example\">\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-light\" (click)=\"modalRef.hide()\">Close</button>\n </div>\n</ng-template>\n"
|
|
789
|
-
},] }
|
|
790
|
-
];
|
|
791
|
-
FormManagerFormComponent.ctorParameters = function () { return [
|
|
792
|
-
{ type: FormManagerService },
|
|
793
|
-
{ type: router.ActivatedRoute },
|
|
794
|
-
{ type: angular.FormioAppConfig },
|
|
795
|
-
{ type: FormManagerConfig },
|
|
796
|
-
{ type: modal.BsModalService }
|
|
797
|
-
]; };
|
|
798
|
-
|
|
799
|
-
var FormManagerViewComponent = /** @class */ (function () {
|
|
800
|
-
function FormManagerViewComponent(service, router, route, config, auth) {
|
|
801
|
-
this.service = service;
|
|
802
|
-
this.router = router;
|
|
803
|
-
this.route = route;
|
|
804
|
-
this.config = config;
|
|
805
|
-
this.auth = auth;
|
|
806
|
-
this.onSuccess = new core.EventEmitter();
|
|
807
|
-
this.onError = new core.EventEmitter();
|
|
808
|
-
this.renderOptions = {
|
|
809
|
-
saveDraft: this.config.saveDraft
|
|
810
|
-
};
|
|
811
|
-
this.submission = { data: {} };
|
|
812
|
-
}
|
|
813
|
-
FormManagerViewComponent.prototype.ngOnInit = function () {
|
|
814
|
-
this.service.formio = new formiojs.Formio(this.service.formio.formUrl);
|
|
815
|
-
};
|
|
816
|
-
FormManagerViewComponent.prototype.onSubmit = function (submission) {
|
|
817
|
-
var _this = this;
|
|
818
|
-
this.submission.data = submission.data;
|
|
819
|
-
this.submission.state = 'complete';
|
|
820
|
-
this.service.formio.saveSubmission(this.submission).then(function (saved) {
|
|
821
|
-
_this.onSuccess.emit();
|
|
822
|
-
_this.router.navigate(['../', 'submission', saved._id], { relativeTo: _this.route });
|
|
823
|
-
}).catch(function (err) { return _this.onError.emit(err); });
|
|
824
|
-
};
|
|
825
|
-
return FormManagerViewComponent;
|
|
826
|
-
}());
|
|
827
|
-
FormManagerViewComponent.decorators = [
|
|
828
|
-
{ type: core.Component, args: [{
|
|
829
|
-
template: "<formio *ngIf=\"service.form\"\n [renderer]=\"config.renderer\"\n [renderOptions]=\"renderOptions\"\n [url]=\"service.formio.formUrl\"\n [form]=\"service.form\"\n [submission]=\"submission\"\n [success]=\"onSuccess\"\n [error]=\"onError\"\n (submit)=\"onSubmit($event)\"\n></formio>\n"
|
|
830
|
-
},] }
|
|
831
|
-
];
|
|
832
|
-
FormManagerViewComponent.ctorParameters = function () { return [
|
|
833
|
-
{ type: FormManagerService },
|
|
834
|
-
{ type: router.Router },
|
|
835
|
-
{ type: router.ActivatedRoute },
|
|
836
|
-
{ type: FormManagerConfig },
|
|
837
|
-
{ type: auth.FormioAuthService }
|
|
838
|
-
]; };
|
|
839
|
-
|
|
840
|
-
var FormManagerDeleteComponent = /** @class */ (function () {
|
|
841
|
-
function FormManagerDeleteComponent(managerService, router, route, alerts, gridService) {
|
|
842
|
-
this.managerService = managerService;
|
|
843
|
-
this.router = router;
|
|
844
|
-
this.route = route;
|
|
845
|
-
this.alerts = alerts;
|
|
846
|
-
this.gridService = gridService;
|
|
847
|
-
}
|
|
848
|
-
FormManagerDeleteComponent.prototype.onDelete = function () {
|
|
849
|
-
var _this = this;
|
|
850
|
-
this.managerService.formio.deleteForm().then(function () {
|
|
851
|
-
if (_this.gridService) {
|
|
852
|
-
var currentPage = +localStorage.getItem('currentPage') || 0;
|
|
853
|
-
var formsNumberPerPage = _this.gridService.getFormsPerPage();
|
|
854
|
-
if (formsNumberPerPage === 1 && currentPage !== 0) {
|
|
855
|
-
localStorage.setItem('currentPage', "" + (currentPage - 1));
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
_this.router.navigate(['../../'], { relativeTo: _this.route });
|
|
859
|
-
}).catch(function (err) { return _this.alerts.setAlert({ type: 'danger', message: (err.message || err) }); });
|
|
860
|
-
};
|
|
861
|
-
FormManagerDeleteComponent.prototype.onCancel = function () {
|
|
862
|
-
this.router.navigate(['../', 'view'], { relativeTo: this.route });
|
|
863
|
-
};
|
|
864
|
-
return FormManagerDeleteComponent;
|
|
865
|
-
}());
|
|
866
|
-
FormManagerDeleteComponent.decorators = [
|
|
867
|
-
{ type: core.Component, args: [{
|
|
868
|
-
template: "<formio-alerts [alerts]=\"alerts\"></formio-alerts>\n<h3>Are you sure you wish to delete this form?</h3>\n<div class=\"btn-toolbar\">\n <button type=\"button\" (click)=\"onDelete()\" class=\"btn btn-danger\" style=\"margin-right: 10px;\">Yes</button>\n <button type=\"button\" (click)=\"onCancel()\" class=\"btn btn-default\">No</button>\n</div>\n"
|
|
869
|
-
},] }
|
|
870
|
-
];
|
|
871
|
-
FormManagerDeleteComponent.ctorParameters = function () { return [
|
|
872
|
-
{ type: FormManagerService },
|
|
873
|
-
{ type: router.Router },
|
|
874
|
-
{ type: router.ActivatedRoute },
|
|
875
|
-
{ type: angular.FormioAlerts },
|
|
876
|
-
{ type: grid.GridService }
|
|
877
|
-
]; };
|
|
878
|
-
|
|
879
|
-
var SubmissionEditComponent = /** @class */ (function () {
|
|
880
|
-
function SubmissionEditComponent(service, router, route) {
|
|
881
|
-
this.service = service;
|
|
882
|
-
this.router = router;
|
|
883
|
-
this.route = route;
|
|
884
|
-
}
|
|
885
|
-
SubmissionEditComponent.prototype.onSubmit = function (submission) {
|
|
886
|
-
this.router.navigate(['../../'], { relativeTo: this.route });
|
|
887
|
-
};
|
|
888
|
-
return SubmissionEditComponent;
|
|
889
|
-
}());
|
|
890
|
-
SubmissionEditComponent.decorators = [
|
|
891
|
-
{ type: core.Component, args: [{
|
|
892
|
-
template: "<formio\n [renderer]=\"service.config.renderer\"\n [src]=\"service.formio.submissionUrl\"\n (submit)=\"onSubmit($event)\"\n (formLoad)=\"service.setForm($event)\"\n (submissionLoad)=\"service.submissionLoaded($event)\"\n></formio>\n"
|
|
893
|
-
},] }
|
|
894
|
-
];
|
|
895
|
-
SubmissionEditComponent.ctorParameters = function () { return [
|
|
896
|
-
{ type: FormManagerService },
|
|
897
|
-
{ type: router.Router },
|
|
898
|
-
{ type: router.ActivatedRoute }
|
|
899
|
-
]; };
|
|
900
|
-
|
|
901
|
-
var SubmissionDeleteComponent = /** @class */ (function () {
|
|
902
|
-
function SubmissionDeleteComponent(service, router, route, alerts) {
|
|
903
|
-
this.service = service;
|
|
904
|
-
this.router = router;
|
|
905
|
-
this.route = route;
|
|
906
|
-
this.alerts = alerts;
|
|
907
|
-
}
|
|
908
|
-
SubmissionDeleteComponent.prototype.onDelete = function () {
|
|
909
|
-
var _this = this;
|
|
910
|
-
this.service.formio.deleteSubmission().then(function () {
|
|
911
|
-
_this.router.navigate(['../../'], { relativeTo: _this.route });
|
|
912
|
-
}).catch(function (err) { return _this.alerts.setAlert({ type: 'danger', message: (err.message || err) }); });
|
|
913
|
-
};
|
|
914
|
-
SubmissionDeleteComponent.prototype.onCancel = function () {
|
|
915
|
-
this.router.navigate(['../', 'view'], { relativeTo: this.route });
|
|
916
|
-
};
|
|
917
|
-
return SubmissionDeleteComponent;
|
|
918
|
-
}());
|
|
919
|
-
SubmissionDeleteComponent.decorators = [
|
|
920
|
-
{ type: core.Component, args: [{
|
|
921
|
-
template: "<formio-alerts [alerts]=\"alerts\"></formio-alerts>\n<h3>Are you sure you wish to delete this record?</h3>\n<div class=\"btn-toolbar\">\n <button type=\"button\" (click)=\"onDelete()\" class=\"btn btn-danger\" style=\"margin-right: 10px;\">Yes</button>\n <button type=\"button\" (click)=\"onCancel()\" class=\"btn btn-default\">No</button>\n</div>\n"
|
|
922
|
-
},] }
|
|
923
|
-
];
|
|
924
|
-
SubmissionDeleteComponent.ctorParameters = function () { return [
|
|
925
|
-
{ type: FormManagerService },
|
|
926
|
-
{ type: router.Router },
|
|
927
|
-
{ type: router.ActivatedRoute },
|
|
928
|
-
{ type: angular.FormioAlerts }
|
|
929
|
-
]; };
|
|
930
|
-
|
|
931
|
-
var SubmissionViewComponent = /** @class */ (function () {
|
|
932
|
-
function SubmissionViewComponent(service) {
|
|
933
|
-
this.service = service;
|
|
934
|
-
}
|
|
935
|
-
return SubmissionViewComponent;
|
|
936
|
-
}());
|
|
937
|
-
SubmissionViewComponent.decorators = [
|
|
938
|
-
{ type: core.Component, args: [{
|
|
939
|
-
template: "<formio\n [renderer]=\"service.config.renderer\"\n [src]=\"service.formio.submissionUrl\"\n [readOnly]=\"true\"\n (formLoad)=\"service.setForm($event)\"\n (submissionLoad)=\"service.submissionLoaded($event)\"\n></formio>\n"
|
|
940
|
-
},] }
|
|
941
|
-
];
|
|
942
|
-
SubmissionViewComponent.ctorParameters = function () { return [
|
|
943
|
-
{ type: FormManagerService }
|
|
944
|
-
]; };
|
|
945
|
-
|
|
946
|
-
var SubmissionIndexComponent = /** @class */ (function () {
|
|
947
|
-
function SubmissionIndexComponent(service, route, router) {
|
|
948
|
-
this.service = service;
|
|
949
|
-
this.route = route;
|
|
950
|
-
this.router = router;
|
|
951
|
-
}
|
|
952
|
-
SubmissionIndexComponent.prototype.onSelect = function (row) {
|
|
953
|
-
this.router.navigate([row._id, 'view'], { relativeTo: this.route });
|
|
954
|
-
};
|
|
955
|
-
return SubmissionIndexComponent;
|
|
956
|
-
}());
|
|
957
|
-
SubmissionIndexComponent.decorators = [
|
|
958
|
-
{ type: core.Component, args: [{
|
|
959
|
-
template: "<formio-grid [formio]=\"service.formio\" (rowSelect)=\"onSelect($event)\"></formio-grid>\n"
|
|
960
|
-
},] }
|
|
961
|
-
];
|
|
962
|
-
SubmissionIndexComponent.ctorParameters = function () { return [
|
|
963
|
-
{ type: FormManagerService },
|
|
964
|
-
{ type: router.ActivatedRoute },
|
|
965
|
-
{ type: router.Router }
|
|
966
|
-
]; };
|
|
967
|
-
|
|
968
|
-
var SubmissionComponent = /** @class */ (function () {
|
|
969
|
-
function SubmissionComponent(service, route) {
|
|
970
|
-
this.service = service;
|
|
971
|
-
this.route = route;
|
|
972
|
-
}
|
|
973
|
-
SubmissionComponent.prototype.setDownloadUrl = function (url) {
|
|
974
|
-
this.downloadUrl = url;
|
|
975
|
-
};
|
|
976
|
-
SubmissionComponent.prototype.ngOnInit = function () {
|
|
977
|
-
var _this = this;
|
|
978
|
-
this.service.setSubmission(this.route).then(function (formio) {
|
|
979
|
-
formio.getDownloadUrl().then(function (url) { return _this.setDownloadUrl(url); });
|
|
980
|
-
});
|
|
981
|
-
};
|
|
982
|
-
return SubmissionComponent;
|
|
983
|
-
}());
|
|
984
|
-
SubmissionComponent.decorators = [
|
|
985
|
-
{ type: core.Component, args: [{
|
|
986
|
-
template: "<a *ngIf=\"downloadUrl\" [href]=\"downloadUrl\" target=\"_blank\" class=\"pull-right\"><img src=\"https://pro.formview.io/assets/pdf.png\" style=\"height: 2em;\" /></a>\n<ul aria-label=\"Submission\" role=\"navigation\" class=\"nav nav-tabs\" style=\"margin-bottom:10px\">\n <li class=\"nav-item\"><a class=\"nav-link\" routerLink=\"../\"><i class=\"fa fa-chevron-left glyphicon glyphicon-chevron-left\"></i></a></li>\n <li class=\"nav-item\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"view\" routerLinkActive=\"active\"><i class=\"fa fa-eye glyphicon glyphicon-eye\"></i> View</a></li>\n <li class=\"nav-item\" routerLinkActive=\"active\" *ngIf=\"service.perms.edit\"><a class=\"nav-link\" routerLink=\"edit\" routerLinkActive=\"active\"><i class=\"fa fa-edit glyphicon glyphicon-edit\"></i> Edit</a></li>\n <li class=\"nav-item\" routerLinkActive=\"active\" *ngIf=\"service.perms.delete\"><a class=\"nav-link\" routerLink=\"delete\" routerLinkActive=\"active\"><span class=\"fa fa-trash glyphicon glyphicon-trash\"></span></a></li>\n</ul>\n<router-outlet></router-outlet>\n"
|
|
987
|
-
},] }
|
|
988
|
-
];
|
|
989
|
-
SubmissionComponent.ctorParameters = function () { return [
|
|
990
|
-
{ type: FormManagerService },
|
|
991
|
-
{ type: router.ActivatedRoute }
|
|
992
|
-
]; };
|
|
993
|
-
|
|
994
|
-
function FormManagerRoutes(config) {
|
|
995
|
-
return [
|
|
996
|
-
{
|
|
997
|
-
path: '',
|
|
998
|
-
component: config && config.formIndex ? config.formIndex : FormManagerIndexComponent
|
|
999
|
-
},
|
|
1000
|
-
{
|
|
1001
|
-
path: 'create',
|
|
1002
|
-
component: config && config.formCreate ? config.formCreate : FormManagerCreateComponent
|
|
1003
|
-
},
|
|
1004
|
-
{
|
|
1005
|
-
path: ':id',
|
|
1006
|
-
component: config && config.form ? config.form : FormManagerFormComponent,
|
|
1007
|
-
children: [
|
|
1008
|
-
{
|
|
1009
|
-
path: '',
|
|
1010
|
-
redirectTo: 'view',
|
|
1011
|
-
pathMatch: 'full'
|
|
1012
|
-
},
|
|
1013
|
-
{
|
|
1014
|
-
path: 'view',
|
|
1015
|
-
component: config && config.formView ? config.formView : FormManagerViewComponent
|
|
1016
|
-
},
|
|
1017
|
-
{
|
|
1018
|
-
path: 'edit',
|
|
1019
|
-
component: config && config.formEdit ? config.formEdit : FormManagerEditComponent
|
|
1020
|
-
},
|
|
1021
|
-
{
|
|
1022
|
-
path: 'delete',
|
|
1023
|
-
component: config && config.formDelete ? config.formDelete : FormManagerDeleteComponent
|
|
1024
|
-
},
|
|
1025
|
-
{
|
|
1026
|
-
path: 'submission',
|
|
1027
|
-
component: config && config.submissionIndex ? config.submissionIndex : SubmissionIndexComponent
|
|
1028
|
-
},
|
|
1029
|
-
{
|
|
1030
|
-
path: 'submission/:id',
|
|
1031
|
-
component: config && config.submission ? config.submission : SubmissionComponent,
|
|
1032
|
-
children: [
|
|
1033
|
-
{
|
|
1034
|
-
path: '',
|
|
1035
|
-
redirectTo: 'view',
|
|
1036
|
-
pathMatch: 'full'
|
|
1037
|
-
},
|
|
1038
|
-
{
|
|
1039
|
-
path: 'view',
|
|
1040
|
-
component: config && config.submissionView ? config.submissionView : SubmissionViewComponent
|
|
1041
|
-
},
|
|
1042
|
-
{
|
|
1043
|
-
path: 'edit',
|
|
1044
|
-
component: config && config.submissionEdit ? config.submissionEdit : SubmissionEditComponent
|
|
1045
|
-
},
|
|
1046
|
-
{
|
|
1047
|
-
path: 'delete',
|
|
1048
|
-
component: config && config.submissionDelete ? config.submissionDelete : SubmissionDeleteComponent
|
|
1049
|
-
}
|
|
1050
|
-
]
|
|
1051
|
-
}
|
|
1052
|
-
]
|
|
1053
|
-
}
|
|
1054
|
-
];
|
|
1055
|
-
}
|
|
1056
|
-
|
|
1057
|
-
var FormManagerModule = /** @class */ (function () {
|
|
1058
|
-
function FormManagerModule() {
|
|
1059
|
-
}
|
|
1060
|
-
FormManagerModule.forChild = function (config) {
|
|
1061
|
-
return angular.extendRouter(FormManagerModule, config, FormManagerRoutes);
|
|
1062
|
-
};
|
|
1063
|
-
FormManagerModule.forRoot = function (config) {
|
|
1064
|
-
return angular.extendRouter(FormManagerModule, config, FormManagerRoutes);
|
|
1065
|
-
};
|
|
1066
|
-
return FormManagerModule;
|
|
1067
|
-
}());
|
|
1068
|
-
FormManagerModule.decorators = [
|
|
1069
|
-
{ type: core.NgModule, args: [{
|
|
1070
|
-
imports: [
|
|
1071
|
-
common.CommonModule,
|
|
1072
|
-
angular.FormioModule,
|
|
1073
|
-
router.RouterModule,
|
|
1074
|
-
forms.FormsModule,
|
|
1075
|
-
grid.FormioGrid,
|
|
1076
|
-
modal.ModalModule.forRoot(),
|
|
1077
|
-
pagination.PaginationModule.forRoot()
|
|
1078
|
-
],
|
|
1079
|
-
declarations: [
|
|
1080
|
-
FormManagerIndexComponent,
|
|
1081
|
-
FormManagerCreateComponent,
|
|
1082
|
-
FormManagerFormComponent,
|
|
1083
|
-
FormManagerViewComponent,
|
|
1084
|
-
FormManagerEditComponent,
|
|
1085
|
-
FormManagerDeleteComponent,
|
|
1086
|
-
SubmissionComponent,
|
|
1087
|
-
SubmissionEditComponent,
|
|
1088
|
-
SubmissionDeleteComponent,
|
|
1089
|
-
SubmissionViewComponent,
|
|
1090
|
-
SubmissionIndexComponent
|
|
1091
|
-
]
|
|
1092
|
-
},] }
|
|
1093
|
-
];
|
|
1094
|
-
|
|
1095
|
-
/*
|
|
1096
|
-
* Public API Surface of @formio/angular
|
|
1097
|
-
*/
|
|
1098
|
-
|
|
1099
|
-
/**
|
|
1100
|
-
* Generated bundle index. Do not edit.
|
|
1101
|
-
*/
|
|
1102
|
-
|
|
1103
|
-
exports.FormManagerConfig = FormManagerConfig;
|
|
1104
|
-
exports.FormManagerCreateComponent = FormManagerCreateComponent;
|
|
1105
|
-
exports.FormManagerDeleteComponent = FormManagerDeleteComponent;
|
|
1106
|
-
exports.FormManagerEditComponent = FormManagerEditComponent;
|
|
1107
|
-
exports.FormManagerFormComponent = FormManagerFormComponent;
|
|
1108
|
-
exports.FormManagerIndexComponent = FormManagerIndexComponent;
|
|
1109
|
-
exports.FormManagerModule = FormManagerModule;
|
|
1110
|
-
exports.FormManagerRoutes = FormManagerRoutes;
|
|
1111
|
-
exports.FormManagerService = FormManagerService;
|
|
1112
|
-
exports.FormManagerViewComponent = FormManagerViewComponent;
|
|
1113
|
-
exports.SubmissionComponent = SubmissionComponent;
|
|
1114
|
-
exports.SubmissionDeleteComponent = SubmissionDeleteComponent;
|
|
1115
|
-
exports.SubmissionEditComponent = SubmissionEditComponent;
|
|
1116
|
-
exports.SubmissionIndexComponent = SubmissionIndexComponent;
|
|
1117
|
-
exports.SubmissionViewComponent = SubmissionViewComponent;
|
|
1118
|
-
|
|
1119
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1120
|
-
|
|
1121
|
-
}));
|
|
1122
|
-
//# sourceMappingURL=formio-angular-manager.umd.js.map
|