@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,624 +0,0 @@
|
|
|
1
|
-
import { EventEmitter, Component, Input, Output, ViewChild, TemplateRef, Injectable, ViewEncapsulation, ComponentFactoryResolver, ChangeDetectorRef, ViewContainerRef, Pipe, NgModule } from '@angular/core';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { FormsModule } from '@angular/forms';
|
|
4
|
-
import { RouterModule } from '@angular/router';
|
|
5
|
-
import { FormioPromiseService, FormioAlerts, FormioModule } from '@formio/angular';
|
|
6
|
-
import { each, clone, get } from 'lodash';
|
|
7
|
-
import { Components, Utils, Formio } from 'formiojs';
|
|
8
|
-
import { PaginationModule } from 'ngx-bootstrap/pagination';
|
|
9
|
-
|
|
10
|
-
var GridFooterPositions;
|
|
11
|
-
(function (GridFooterPositions) {
|
|
12
|
-
GridFooterPositions[GridFooterPositions["bottom"] = 0] = "bottom";
|
|
13
|
-
GridFooterPositions[GridFooterPositions["top"] = 1] = "top";
|
|
14
|
-
GridFooterPositions[GridFooterPositions["both"] = 2] = "both";
|
|
15
|
-
})(GridFooterPositions || (GridFooterPositions = {}));
|
|
16
|
-
|
|
17
|
-
class GridHeaderComponent {
|
|
18
|
-
constructor() {
|
|
19
|
-
this.headers = [];
|
|
20
|
-
this.sort = new EventEmitter();
|
|
21
|
-
}
|
|
22
|
-
get numHeaders() {
|
|
23
|
-
return this.headers.length;
|
|
24
|
-
}
|
|
25
|
-
load(formio, query, columns) {
|
|
26
|
-
return Promise.resolve([]);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
GridHeaderComponent.decorators = [
|
|
30
|
-
{ type: Component, args: [{
|
|
31
|
-
template: ''
|
|
32
|
-
},] }
|
|
33
|
-
];
|
|
34
|
-
GridHeaderComponent.ctorParameters = () => [];
|
|
35
|
-
GridHeaderComponent.propDecorators = {
|
|
36
|
-
actionAllowed: [{ type: Input }],
|
|
37
|
-
sort: [{ type: Output }],
|
|
38
|
-
template: [{ type: ViewChild, args: [TemplateRef, { static: true },] }]
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
var SortType;
|
|
42
|
-
(function (SortType) {
|
|
43
|
-
SortType["ASC"] = "asc";
|
|
44
|
-
SortType["DESC"] = "desc";
|
|
45
|
-
})(SortType || (SortType = {}));
|
|
46
|
-
|
|
47
|
-
class FormGridHeaderComponent extends GridHeaderComponent {
|
|
48
|
-
load(formio) {
|
|
49
|
-
this.header = {
|
|
50
|
-
label: 'Title',
|
|
51
|
-
key: 'title',
|
|
52
|
-
sort: SortType.ASC
|
|
53
|
-
};
|
|
54
|
-
this.headers = [this.header];
|
|
55
|
-
return Promise.resolve(this.headers);
|
|
56
|
-
}
|
|
57
|
-
get numHeaders() {
|
|
58
|
-
return 2;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
FormGridHeaderComponent.decorators = [
|
|
62
|
-
{ type: Component, args: [{
|
|
63
|
-
selector: 'form-grid-header',
|
|
64
|
-
template: "<ng-template>\n <thead>\n <tr>\n <th>\n <div class=\"row\">\n <div class=\"col-sm-8\">\n <a (click)=\"sort.emit(header)\">\n {{ header.label }} <span [ngClass]=\"{'glyphicon-triangle-top fa-caret-up': (header.sort === 'asc'), 'glyphicon-triangle-bottom fa-caret-down': (header.sort === 'desc')}\" class=\"glyphicon fa\" *ngIf=\"header.sort\"></span>\n </a>\n </div>\n <div class=\"col-sm-4\">\n Operations\n </div>\n </div>\n </th>\n </tr>\n </thead>\n</ng-template>\n"
|
|
65
|
-
},] }
|
|
66
|
-
];
|
|
67
|
-
|
|
68
|
-
class GridService {
|
|
69
|
-
constructor() { }
|
|
70
|
-
setRows(rows) {
|
|
71
|
-
this.rows = rows;
|
|
72
|
-
}
|
|
73
|
-
getFormsPerPage() {
|
|
74
|
-
var _a;
|
|
75
|
-
return (_a = this.rows) === null || _a === void 0 ? void 0 : _a.length;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
GridService.decorators = [
|
|
79
|
-
{ type: Injectable }
|
|
80
|
-
];
|
|
81
|
-
GridService.ctorParameters = () => [];
|
|
82
|
-
|
|
83
|
-
class GridBodyComponent {
|
|
84
|
-
constructor(service) {
|
|
85
|
-
this.service = service;
|
|
86
|
-
this.firstItem = 0;
|
|
87
|
-
this.lastItem = 0;
|
|
88
|
-
this.skip = 0;
|
|
89
|
-
this.limit = 0;
|
|
90
|
-
this.total = 0;
|
|
91
|
-
this.rowSelect = new EventEmitter();
|
|
92
|
-
this.rowAction = new EventEmitter();
|
|
93
|
-
this.loading = true;
|
|
94
|
-
}
|
|
95
|
-
load(formio, query) {
|
|
96
|
-
return formio.loadForm(query);
|
|
97
|
-
}
|
|
98
|
-
onRowSelect(event, row) {
|
|
99
|
-
event.preventDefault();
|
|
100
|
-
this.rowSelect.emit(row);
|
|
101
|
-
}
|
|
102
|
-
onRowAction(event, row, action) {
|
|
103
|
-
event.preventDefault();
|
|
104
|
-
this.rowAction.emit({ row, action });
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Set the rows for this Grid body.
|
|
108
|
-
*
|
|
109
|
-
* @param query
|
|
110
|
-
* @param items
|
|
111
|
-
* @return any
|
|
112
|
-
*/
|
|
113
|
-
setRows(query, items) {
|
|
114
|
-
this.rows = [];
|
|
115
|
-
if (typeof items !== 'object') {
|
|
116
|
-
this.firstItem = 0;
|
|
117
|
-
this.lastItem = 0;
|
|
118
|
-
this.total = 0;
|
|
119
|
-
this.skip = 0;
|
|
120
|
-
this.loading = false;
|
|
121
|
-
this.service.setRows(this.rows);
|
|
122
|
-
return this.rows;
|
|
123
|
-
}
|
|
124
|
-
this.firstItem = query.skip + 1;
|
|
125
|
-
this.lastItem = this.firstItem + items.length - 1;
|
|
126
|
-
if (this.lastItem === 0) {
|
|
127
|
-
this.firstItem = 0;
|
|
128
|
-
}
|
|
129
|
-
this.total = items.serverCount;
|
|
130
|
-
this.limit = query.limit;
|
|
131
|
-
this.skip = Math.floor(items.skip / query.limit) + 1;
|
|
132
|
-
this.loading = false;
|
|
133
|
-
each(items, (item) => {
|
|
134
|
-
this.rows.push(clone(item));
|
|
135
|
-
});
|
|
136
|
-
this.service.setRows(this.rows);
|
|
137
|
-
return this.rows;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
GridBodyComponent.decorators = [
|
|
141
|
-
{ type: Component, args: [{
|
|
142
|
-
template: ''
|
|
143
|
-
},] }
|
|
144
|
-
];
|
|
145
|
-
GridBodyComponent.ctorParameters = () => [
|
|
146
|
-
{ type: GridService }
|
|
147
|
-
];
|
|
148
|
-
GridBodyComponent.propDecorators = {
|
|
149
|
-
header: [{ type: Input }],
|
|
150
|
-
actionAllowed: [{ type: Input }],
|
|
151
|
-
rowSelect: [{ type: Output }],
|
|
152
|
-
rowAction: [{ type: Output }],
|
|
153
|
-
template: [{ type: ViewChild, args: [TemplateRef, { static: true },] }]
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
class FormGridBodyComponent extends GridBodyComponent {
|
|
157
|
-
load(formio, query) {
|
|
158
|
-
query = query || {};
|
|
159
|
-
return formio.loadForms({ params: query }).then((forms) => this.setRows(query, forms));
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
FormGridBodyComponent.decorators = [
|
|
163
|
-
{ type: Component, args: [{
|
|
164
|
-
selector: 'form-grid-body',
|
|
165
|
-
template: "<ng-template>\n <tbody *ngIf=\"rows\">\n <tr *ngFor=\"let form of rows\">\n <td>\n <div class=\"row\">\n <div class=\"col-sm-8\">\n <a routerLink=\"{{form._id}}/view\" (click)=\"onRowSelect($event, form)\"><h5>{{ form.title }}</h5></a>\n <div class=\"form-updated small text-muted\">\n Updated {{ form.modified | timeSince }} ago\n </div>\n </div>\n <div class=\"col-sm-4\">\n <button *ngIf=\"actionAllowed('formView')\" class=\"btn btn-outline-secondary btn-sm form-btn form-btn-use\" (click)=\"onRowAction($event, form, 'view')\"><span class=\"fa fa-pencil\"></span> Enter Data</button> \n <button *ngIf=\"actionAllowed('formSubmission')\" class=\"btn btn-outline-secondary btn-sm form-btn\" (click)=\"onRowAction($event, form, 'submission')\"><span class=\"fa fa-list-alt\"></span> View Data</button> \n <button *ngIf=\"actionAllowed('formEdit')\" class=\"btn btn-outline-secondary btn-sm form-btn\" (click)=\"onRowAction($event, form, 'edit')\"><span class=\"fa fa-edit\"></span> Edit Form</button> \n <button *ngIf=\"actionAllowed('formPermission')\" class=\"btn btn-outline-secondary btn-sm form-btn\" (click)=\"onRowAction($event, form, 'permissions')\"><span class=\"fa fa-lock\"></span> Permissions</button> \n <button *ngIf=\"actionAllowed('formDelete')\" class=\"btn btn-danger btn-sm form-btn form-btn-delete\" (click)=\"onRowAction($event, form, 'delete')\" title=\"Delete form\"><span class=\"fa fa-trash\"></span></button>\n </div>\n </div>\n </td>\n </tr>\n </tbody>\n</ng-template>\n",
|
|
166
|
-
styles: [".form-btn{font-size:.75rem;margin:2px 0}\n"]
|
|
167
|
-
},] }
|
|
168
|
-
];
|
|
169
|
-
|
|
170
|
-
class GridFooterComponent {
|
|
171
|
-
constructor() {
|
|
172
|
-
this.footerPositions = GridFooterPositions;
|
|
173
|
-
this.pageChanged = new EventEmitter();
|
|
174
|
-
this.createItem = new EventEmitter();
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
GridFooterComponent.decorators = [
|
|
178
|
-
{ type: Component, args: [{
|
|
179
|
-
template: ''
|
|
180
|
-
},] }
|
|
181
|
-
];
|
|
182
|
-
GridFooterComponent.ctorParameters = () => [];
|
|
183
|
-
GridFooterComponent.propDecorators = {
|
|
184
|
-
header: [{ type: Input }],
|
|
185
|
-
body: [{ type: Input }],
|
|
186
|
-
createText: [{ type: Input }],
|
|
187
|
-
size: [{ type: Input }],
|
|
188
|
-
actionAllowed: [{ type: Input }],
|
|
189
|
-
pageChanged: [{ type: Output }],
|
|
190
|
-
createItem: [{ type: Output }],
|
|
191
|
-
template: [{ type: ViewChild, args: [TemplateRef, { static: true },] }]
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
class FormGridFooterComponent extends GridFooterComponent {
|
|
195
|
-
constructor() {
|
|
196
|
-
super();
|
|
197
|
-
}
|
|
198
|
-
ngOnInit() {
|
|
199
|
-
if (!this.createText) {
|
|
200
|
-
this.createText = 'Create Form';
|
|
201
|
-
}
|
|
202
|
-
if (!this.size) {
|
|
203
|
-
this.size = 7;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
FormGridFooterComponent.decorators = [
|
|
208
|
-
{ type: Component, args: [{
|
|
209
|
-
template: "<ng-template #footer let-position=\"position\" let-label=\"label\">\n <thead class=\"formio-grid-footer\" *ngIf=\"position === footerPositions.top\">\n <ng-container [ngTemplateOutlet]=\"defaultFooterTemplate\" [ngTemplateOutletContext]=\"{ label: label }\"></ng-container>\n </thead>\n <tfoot class=\"formio-grid-footer\" *ngIf=\"position === footerPositions.bottom\">\n <ng-container [ngTemplateOutlet]=\"defaultFooterTemplate\" [ngTemplateOutletContext]=\"{ label: label }\"></ng-container>\n </tfoot>\n</ng-template>\n\n<ng-template let-label=\"label\" #defaultFooterTemplate>\n <tr>\n <td *ngIf=\"header\" [colSpan]=\"header.numHeaders\">\n <button *ngIf=\"actionAllowed('formCreate')\" class=\"btn btn-primary form-btn-use pull-left float-left\" (click)=\"createItem.emit('form')\"><i class=\"glyphicon glyphicon-plus fa fa-plus\"></i> {{ createText }}</button>\n <span class=\"pull-right float-right item-counter\"><span class=\"page-num\">{{ body.firstItem }} - {{ body.lastItem }}</span> / {{ body.total }} total</span>\n <span [attr.aria-label]=\"label\" role=\"navigation\">\n <pagination [totalItems]=\"body.total\" [itemsPerPage]=\"body.limit\" [(ngModel)]=\"body.skip\" (pageChanged)=\"pageChanged.emit($event)\" [maxSize]=\"size\" class=\"justify-content-center pagination-sm\">\n </pagination>\n </span>\n </td>\n </tr>\n</ng-template>\n",
|
|
210
|
-
encapsulation: ViewEncapsulation.None,
|
|
211
|
-
styles: ["tfoot.formio-grid-footer td{padding:.3rem}tfoot.formio-grid-footer .page-num{font-size:1.4em}tfoot.formio-grid-footer ul.pagination{margin-top:5px;margin-bottom:0}\n"]
|
|
212
|
-
},] }
|
|
213
|
-
];
|
|
214
|
-
FormGridFooterComponent.ctorParameters = () => [];
|
|
215
|
-
|
|
216
|
-
var FormComponents = {
|
|
217
|
-
header: FormGridHeaderComponent,
|
|
218
|
-
body: FormGridBodyComponent,
|
|
219
|
-
footer: FormGridFooterComponent
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
class SubmissionGridHeaderComponent extends GridHeaderComponent {
|
|
223
|
-
load(formio, query, columns) {
|
|
224
|
-
query = query || {};
|
|
225
|
-
return formio.loadForm({ params: query }).then((form) => {
|
|
226
|
-
this.headers = [];
|
|
227
|
-
this.formComponents = new Map();
|
|
228
|
-
this.setComponents(form.components);
|
|
229
|
-
columns ? columns.forEach(column => {
|
|
230
|
-
this.setHeader(this.getHeaderForColumn(column, this.formComponents.get(column.path)));
|
|
231
|
-
}) : this.setComponentsHeaders(this.formComponents);
|
|
232
|
-
return this.headers;
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
setHeader(header) {
|
|
236
|
-
this.headers.push(header);
|
|
237
|
-
}
|
|
238
|
-
getHeaderForColumn(column, component, sort) {
|
|
239
|
-
return {
|
|
240
|
-
label: column.label,
|
|
241
|
-
key: column.path,
|
|
242
|
-
sort: sort,
|
|
243
|
-
component: component ? Components.create(component, null, null, true) : undefined,
|
|
244
|
-
renderCell: column ? column.renderCell : undefined
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
getHeaderForComponent(component, path, sort) {
|
|
248
|
-
return {
|
|
249
|
-
label: component.label,
|
|
250
|
-
key: path,
|
|
251
|
-
sort: sort,
|
|
252
|
-
component: component ? Components.create(component, null, null, true) : undefined,
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
// Set headers from components in case if columns are not provided
|
|
256
|
-
setComponentsHeaders(components, sort) {
|
|
257
|
-
components.forEach((component, path) => {
|
|
258
|
-
if (component.input &&
|
|
259
|
-
(!component.hasOwnProperty('tableView') || component.tableView)) {
|
|
260
|
-
this.setHeader(this.getHeaderForComponent(component, path, sort));
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
// Map components
|
|
265
|
-
setComponents(components) {
|
|
266
|
-
Utils.eachComponent(components, (component, newPath) => {
|
|
267
|
-
this.formComponents.set(`data.${newPath}`, component);
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
SubmissionGridHeaderComponent.decorators = [
|
|
272
|
-
{ type: Component, args: [{
|
|
273
|
-
template: "<ng-template>\n <thead>\n <tr>\n <th *ngFor=\"let header of headers\">\n <a (click)=\"sort.emit(header)\">\n {{ header.label }} <span [ngClass]=\"{'glyphicon-triangle-top': (header.sort === 'asc'), 'glyphicon-triangle-bottom': (header.sort === 'desc')}\" class=\"glyphicon\" *ngIf=\"header.sort\"></span>\n </a>\n </th>\n </tr>\n </thead>\n</ng-template>\n"
|
|
274
|
-
},] }
|
|
275
|
-
];
|
|
276
|
-
|
|
277
|
-
class SubmissionGridBodyComponent extends GridBodyComponent {
|
|
278
|
-
load(formio, query) {
|
|
279
|
-
query = query || {};
|
|
280
|
-
return formio.loadSubmissions({ params: query })
|
|
281
|
-
.then((submissions) => this.setRows(query, submissions));
|
|
282
|
-
}
|
|
283
|
-
/**
|
|
284
|
-
* Render the cell data.
|
|
285
|
-
*
|
|
286
|
-
* @param submission
|
|
287
|
-
* @param header
|
|
288
|
-
* @return any
|
|
289
|
-
*/
|
|
290
|
-
view(submission, header) {
|
|
291
|
-
const cellValue = get(submission, header.key);
|
|
292
|
-
if (header.renderCell) {
|
|
293
|
-
return header.renderCell(cellValue, header.component);
|
|
294
|
-
}
|
|
295
|
-
else {
|
|
296
|
-
if (header.component) {
|
|
297
|
-
if (header.component.getView) {
|
|
298
|
-
return header.component.getView(cellValue);
|
|
299
|
-
}
|
|
300
|
-
return header.component.asString(cellValue);
|
|
301
|
-
}
|
|
302
|
-
else {
|
|
303
|
-
return cellValue.toString();
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
SubmissionGridBodyComponent.decorators = [
|
|
309
|
-
{ type: Component, args: [{
|
|
310
|
-
template: "<ng-template>\n <tbody>\n <tr *ngFor=\"let row of rows\" (click)=\"onRowSelect($event, row)\">\n <td *ngFor=\"let rowHeader of header.headers\" [innerHTML]=\"view(row, rowHeader)\"></td>\n </tr>\n </tbody>\n</ng-template>\n"
|
|
311
|
-
},] }
|
|
312
|
-
];
|
|
313
|
-
|
|
314
|
-
class SubmissionGridFooterComponent extends GridFooterComponent {
|
|
315
|
-
constructor() {
|
|
316
|
-
super();
|
|
317
|
-
}
|
|
318
|
-
ngOnInit() {
|
|
319
|
-
if (!this.size) {
|
|
320
|
-
this.size = 7;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
SubmissionGridFooterComponent.decorators = [
|
|
325
|
-
{ type: Component, args: [{
|
|
326
|
-
template: "<ng-template #footer let-position=\"position\">\n <thead class=\"formio-grid-footer\" *ngIf=\"position === footerPositions.top\">\n <ng-container [ngTemplateOutlet]=\"defaultFooterTemplate\"></ng-container>\n </thead>\n <tfoot class=\"formio-grid-footer\" *ngIf=\"position === footerPositions.bottom\">\n <ng-container [ngTemplateOutlet]=\"defaultFooterTemplate\"></ng-container>\n </tfoot>\n</ng-template>\n\n<ng-template #defaultFooterTemplate>\n <tr>\n <td *ngIf=\"header\" [colSpan]=\"header.numHeaders\">\n <button *ngIf=\"actionAllowed('submissionCreate') && createText\" class=\"btn btn-primary pull-left float-left\" (click)=\"createItem.emit('form')\"><i class=\"glyphicon glyphicon-plus fa fa-plus\"></i> {{ createText }}</button>\n <span class=\"pull-right float-right item-counter\"><span class=\"page-num\">{{ body.firstItem }} - {{ body.lastItem }}</span> / {{ body.total }} total</span>\n <pagination [totalItems]=\"body.total\" [itemsPerPage]=\"body.limit\" [(ngModel)]=\"body.skip\" (pageChanged)=\"pageChanged.emit($event)\" [maxSize]=\"size\" class=\"justify-content-center pagination-sm\"></pagination>\n </td>\n </tr>\n</ng-template>\n",
|
|
327
|
-
encapsulation: ViewEncapsulation.None,
|
|
328
|
-
styles: ["tfoot.formio-grid-footer td{padding:.3rem}tfoot.formio-grid-footer .page-num{font-size:1.4em}tfoot.formio-grid-footer ul.pagination{margin-top:5px;margin-bottom:0}\n"]
|
|
329
|
-
},] }
|
|
330
|
-
];
|
|
331
|
-
SubmissionGridFooterComponent.ctorParameters = () => [];
|
|
332
|
-
|
|
333
|
-
var SubmissionComponents = {
|
|
334
|
-
header: SubmissionGridHeaderComponent,
|
|
335
|
-
body: SubmissionGridBodyComponent,
|
|
336
|
-
footer: SubmissionGridFooterComponent
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
class FormioGridComponent {
|
|
340
|
-
constructor(alerts, resolver, ref) {
|
|
341
|
-
this.alerts = alerts;
|
|
342
|
-
this.resolver = resolver;
|
|
343
|
-
this.ref = ref;
|
|
344
|
-
this.footerPosition = GridFooterPositions.bottom;
|
|
345
|
-
this.page = 0;
|
|
346
|
-
this.isLoading = false;
|
|
347
|
-
this.initialized = false;
|
|
348
|
-
this.footerPositions = GridFooterPositions;
|
|
349
|
-
this.select = this.rowSelect = new EventEmitter();
|
|
350
|
-
this.rowAction = new EventEmitter();
|
|
351
|
-
this.createItem = new EventEmitter();
|
|
352
|
-
this.error = new EventEmitter();
|
|
353
|
-
this.isLoading = true;
|
|
354
|
-
}
|
|
355
|
-
createComponent(property, component) {
|
|
356
|
-
const factory = this.resolver.resolveComponentFactory(component);
|
|
357
|
-
const componentRef = property.createComponent(factory);
|
|
358
|
-
return componentRef.instance;
|
|
359
|
-
}
|
|
360
|
-
loadGrid(src) {
|
|
361
|
-
// If no source is provided, then skip.
|
|
362
|
-
if (!src && !this.formio) {
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
// Do not double load.
|
|
366
|
-
if (this.formio && this.src && (src === this.src)) {
|
|
367
|
-
return;
|
|
368
|
-
}
|
|
369
|
-
if (src) {
|
|
370
|
-
this.src = src;
|
|
371
|
-
this.formio = new FormioPromiseService(this.src, { formOnly: true });
|
|
372
|
-
}
|
|
373
|
-
// Load the header.
|
|
374
|
-
this.header.load(this.formio, {}, this.columns)
|
|
375
|
-
.then(() => this.setPage(0))
|
|
376
|
-
.catch(error => this.onError(error));
|
|
377
|
-
}
|
|
378
|
-
ngOnInit() {
|
|
379
|
-
// Create our components.
|
|
380
|
-
const comps = this.components || ((this.gridType === 'form') ? FormComponents : SubmissionComponents);
|
|
381
|
-
this.header = this.createComponent(this.headerElement, comps.header);
|
|
382
|
-
this.header.actionAllowed = this.actionAllowed.bind(this);
|
|
383
|
-
this.header.sort.subscribe(header => this.sortColumn(header));
|
|
384
|
-
this.body = this.createComponent(this.bodyElement, comps.body);
|
|
385
|
-
this.body.header = this.header;
|
|
386
|
-
this.body.actionAllowed = this.actionAllowed.bind(this);
|
|
387
|
-
this.body.rowSelect.subscribe(row => this.rowSelect.emit(row));
|
|
388
|
-
this.body.rowAction.subscribe(action => this.rowAction.emit(action));
|
|
389
|
-
this.footer = this.createComponent(this.footerElement, comps.footer);
|
|
390
|
-
this.footer.header = this.header;
|
|
391
|
-
this.footer.body = this.body;
|
|
392
|
-
this.footer.actionAllowed = this.actionAllowed.bind(this);
|
|
393
|
-
this.footer.createText = this.createText;
|
|
394
|
-
this.footer.size = this.size;
|
|
395
|
-
this.footer.pageChanged.subscribe(page => this.pageChanged(page));
|
|
396
|
-
this.footer.createItem.subscribe(item => this.createItem.emit(item));
|
|
397
|
-
}
|
|
398
|
-
ngOnChanges(changes) {
|
|
399
|
-
if (this.initialized) {
|
|
400
|
-
if ((changes.src && changes.src.currentValue) ||
|
|
401
|
-
(changes.formio && changes.formio.currentValue)) {
|
|
402
|
-
this.loadGrid(changes.src.currentValue);
|
|
403
|
-
}
|
|
404
|
-
if (changes.items && changes.items.currentValue) {
|
|
405
|
-
this.refreshGrid();
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
if (this.footer &&
|
|
409
|
-
(changes.createText && changes.createText.currentValue)) {
|
|
410
|
-
this.footer.createText = changes.createText.currentValue;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
ngAfterViewInit() {
|
|
414
|
-
this.alerts.setAlerts([]);
|
|
415
|
-
this.query = this.query || {};
|
|
416
|
-
if (this.refresh) {
|
|
417
|
-
this.refresh.subscribe((query) => this.refreshGrid(query));
|
|
418
|
-
}
|
|
419
|
-
this.loadGrid(this.src);
|
|
420
|
-
this.initialized = true;
|
|
421
|
-
this.ref.detectChanges();
|
|
422
|
-
}
|
|
423
|
-
actionAllowed(action) {
|
|
424
|
-
if (this.isActionAllowed) {
|
|
425
|
-
return this.isActionAllowed(action);
|
|
426
|
-
}
|
|
427
|
-
else {
|
|
428
|
-
return true;
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
onError(error) {
|
|
432
|
-
this.isLoading = false;
|
|
433
|
-
this.error.emit(error);
|
|
434
|
-
if (typeof error === 'string' || error.message) {
|
|
435
|
-
this.alerts.setAlert({
|
|
436
|
-
type: 'danger',
|
|
437
|
-
message: error.message || error
|
|
438
|
-
});
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
refreshGrid(query) {
|
|
442
|
-
this.alerts.setAlerts([]);
|
|
443
|
-
this.query = query || this.query;
|
|
444
|
-
if (!this.query.hasOwnProperty('limit')) {
|
|
445
|
-
this.query.limit = 10;
|
|
446
|
-
}
|
|
447
|
-
if (!this.query.hasOwnProperty('skip')) {
|
|
448
|
-
this.query.skip = 0;
|
|
449
|
-
}
|
|
450
|
-
this.isLoading = true;
|
|
451
|
-
this.ref.detectChanges();
|
|
452
|
-
Formio.cache = {};
|
|
453
|
-
let loader = null;
|
|
454
|
-
if (this.items) {
|
|
455
|
-
loader = Promise.resolve(this.body.setRows(this.query, this.items));
|
|
456
|
-
}
|
|
457
|
-
else {
|
|
458
|
-
loader = this.body.load(this.formio, this.query);
|
|
459
|
-
}
|
|
460
|
-
return loader.then(info => {
|
|
461
|
-
this.isLoading = false;
|
|
462
|
-
this.initialized = true;
|
|
463
|
-
this.ref.detectChanges();
|
|
464
|
-
}).catch(error => this.onError(error));
|
|
465
|
-
}
|
|
466
|
-
setPage(num = -1) {
|
|
467
|
-
this.page = num !== -1 ? num : this.page;
|
|
468
|
-
if (!this.query.hasOwnProperty('limit')) {
|
|
469
|
-
this.query.limit = 10;
|
|
470
|
-
}
|
|
471
|
-
if (!this.query.hasOwnProperty('skip')) {
|
|
472
|
-
this.query.skip = 0;
|
|
473
|
-
}
|
|
474
|
-
this.query.skip = this.page * this.query.limit;
|
|
475
|
-
this.refreshGrid();
|
|
476
|
-
}
|
|
477
|
-
sortColumn(header) {
|
|
478
|
-
// Reset all other column sorts.
|
|
479
|
-
each(this.header.headers, (col) => {
|
|
480
|
-
if (col.key !== header.key) {
|
|
481
|
-
col.sort = '';
|
|
482
|
-
}
|
|
483
|
-
});
|
|
484
|
-
switch (header.sort) {
|
|
485
|
-
case 'asc':
|
|
486
|
-
header.sort = SortType.DESC;
|
|
487
|
-
this.query.sort = '-' + header.key;
|
|
488
|
-
break;
|
|
489
|
-
case 'desc':
|
|
490
|
-
header.sort = undefined;
|
|
491
|
-
delete this.query.sort;
|
|
492
|
-
break;
|
|
493
|
-
case undefined:
|
|
494
|
-
header.sort = SortType.ASC;
|
|
495
|
-
this.query.sort = header.key;
|
|
496
|
-
break;
|
|
497
|
-
}
|
|
498
|
-
this.refreshGrid();
|
|
499
|
-
}
|
|
500
|
-
pageChanged(page) {
|
|
501
|
-
this.setPage(page.page - 1);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
FormioGridComponent.decorators = [
|
|
505
|
-
{ type: Component, args: [{
|
|
506
|
-
selector: 'formio-grid',
|
|
507
|
-
template: "<ng-template #headerTemplate></ng-template>\n<ng-template #bodyTemplate></ng-template>\n<ng-template #footerTemplate></ng-template>\n<div class=\"formio-grid\">\n <formio-alerts [alerts]=\"alerts\"></formio-alerts>\n <table class=\"table table-bordered table-striped table-hover\">\n <ng-container *ngIf=\"initialized && [footerPositions.top, footerPositions.both].indexOf(footerPosition) !== -1\"\n [ngTemplateOutlet]=\"footer.template\" [ngTemplateOutletContext]=\"{ position: footerPositions.top, label: label }\">\n </ng-container>\n <ng-container *ngIf=\"initialized\"\n [ngTemplateOutlet]=\"header.template\"></ng-container>\n <formio-loader [isLoading]=\"isLoading\"></formio-loader>\n <ng-container *ngIf=\"initialized\" [ngTemplateOutlet]=\"body.template\"></ng-container>\n <ng-container *ngIf=\"initialized && [footerPositions.bottom, footerPositions.both].indexOf(footerPosition) !== -1\"\n [ngTemplateOutlet]=\"footer.template\" [ngTemplateOutletContext]=\"{ position: footerPositions.bottom, label: label }\">\n </ng-container>\n </table>\n</div>\n",
|
|
508
|
-
styles: [".formio-grid{position:relative;width:100%}.grid-refresh{height:400px;width:100%}\n"]
|
|
509
|
-
},] }
|
|
510
|
-
];
|
|
511
|
-
FormioGridComponent.ctorParameters = () => [
|
|
512
|
-
{ type: FormioAlerts },
|
|
513
|
-
{ type: ComponentFactoryResolver },
|
|
514
|
-
{ type: ChangeDetectorRef }
|
|
515
|
-
];
|
|
516
|
-
FormioGridComponent.propDecorators = {
|
|
517
|
-
footerPosition: [{ type: Input }],
|
|
518
|
-
src: [{ type: Input }],
|
|
519
|
-
items: [{ type: Input }],
|
|
520
|
-
onForm: [{ type: Input }],
|
|
521
|
-
query: [{ type: Input }],
|
|
522
|
-
refresh: [{ type: Input }],
|
|
523
|
-
columns: [{ type: Input }],
|
|
524
|
-
gridType: [{ type: Input }],
|
|
525
|
-
size: [{ type: Input }],
|
|
526
|
-
components: [{ type: Input }],
|
|
527
|
-
formio: [{ type: Input }],
|
|
528
|
-
label: [{ type: Input }],
|
|
529
|
-
createText: [{ type: Input }],
|
|
530
|
-
isActionAllowed: [{ type: Input }],
|
|
531
|
-
select: [{ type: Output }],
|
|
532
|
-
rowSelect: [{ type: Output }],
|
|
533
|
-
rowAction: [{ type: Output }],
|
|
534
|
-
createItem: [{ type: Output }],
|
|
535
|
-
error: [{ type: Output }],
|
|
536
|
-
headerElement: [{ type: ViewChild, args: ['headerTemplate', { read: ViewContainerRef, static: true },] }],
|
|
537
|
-
bodyElement: [{ type: ViewChild, args: ['bodyTemplate', { read: ViewContainerRef, static: true },] }],
|
|
538
|
-
footerElement: [{ type: ViewChild, args: ['footerTemplate', { read: ViewContainerRef, static: true },] }]
|
|
539
|
-
};
|
|
540
|
-
|
|
541
|
-
class TimeSince {
|
|
542
|
-
transform(date) {
|
|
543
|
-
const elapsed = (new Date().getTime() - new Date(date).getTime()) / 1000;
|
|
544
|
-
let interval;
|
|
545
|
-
if (interval >= 1) {
|
|
546
|
-
return interval + ' year' + (interval > 1 ? 's' : '');
|
|
547
|
-
}
|
|
548
|
-
interval = Math.floor(elapsed / 2592000);
|
|
549
|
-
if (interval >= 1) {
|
|
550
|
-
return interval + ' month' + (interval > 1 ? 's' : '');
|
|
551
|
-
}
|
|
552
|
-
interval = Math.floor(elapsed / 86400);
|
|
553
|
-
if (interval >= 1) {
|
|
554
|
-
return interval + ' day' + (interval > 1 ? 's' : '');
|
|
555
|
-
}
|
|
556
|
-
interval = Math.floor(elapsed / 3600);
|
|
557
|
-
if (interval >= 1) {
|
|
558
|
-
return interval + ' hour' + (interval > 1 ? 's' : '');
|
|
559
|
-
}
|
|
560
|
-
interval = Math.floor(elapsed / 60);
|
|
561
|
-
if (interval >= 1) {
|
|
562
|
-
return interval + ' minute' + (interval > 1 ? 's' : '');
|
|
563
|
-
}
|
|
564
|
-
return Math.floor(elapsed) + ' second' + (elapsed > 1 ? 's' : '');
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
TimeSince.decorators = [
|
|
568
|
-
{ type: Pipe, args: [{
|
|
569
|
-
name: 'timeSince'
|
|
570
|
-
},] }
|
|
571
|
-
];
|
|
572
|
-
|
|
573
|
-
class FormioGrid {
|
|
574
|
-
}
|
|
575
|
-
FormioGrid.decorators = [
|
|
576
|
-
{ type: NgModule, args: [{
|
|
577
|
-
imports: [
|
|
578
|
-
CommonModule,
|
|
579
|
-
FormsModule,
|
|
580
|
-
FormioModule,
|
|
581
|
-
RouterModule,
|
|
582
|
-
PaginationModule.forRoot()
|
|
583
|
-
],
|
|
584
|
-
declarations: [
|
|
585
|
-
FormioGridComponent,
|
|
586
|
-
FormGridHeaderComponent,
|
|
587
|
-
FormGridBodyComponent,
|
|
588
|
-
FormGridFooterComponent,
|
|
589
|
-
SubmissionGridHeaderComponent,
|
|
590
|
-
SubmissionGridBodyComponent,
|
|
591
|
-
SubmissionGridFooterComponent,
|
|
592
|
-
GridHeaderComponent,
|
|
593
|
-
GridBodyComponent,
|
|
594
|
-
GridFooterComponent,
|
|
595
|
-
TimeSince
|
|
596
|
-
],
|
|
597
|
-
exports: [
|
|
598
|
-
FormioGridComponent
|
|
599
|
-
],
|
|
600
|
-
entryComponents: [
|
|
601
|
-
FormGridHeaderComponent,
|
|
602
|
-
FormGridBodyComponent,
|
|
603
|
-
FormGridFooterComponent,
|
|
604
|
-
SubmissionGridHeaderComponent,
|
|
605
|
-
SubmissionGridBodyComponent,
|
|
606
|
-
SubmissionGridFooterComponent
|
|
607
|
-
],
|
|
608
|
-
providers: [
|
|
609
|
-
FormioAlerts,
|
|
610
|
-
GridService
|
|
611
|
-
]
|
|
612
|
-
},] }
|
|
613
|
-
];
|
|
614
|
-
|
|
615
|
-
/*
|
|
616
|
-
* Public API Surface of angular-formio
|
|
617
|
-
*/
|
|
618
|
-
|
|
619
|
-
/**
|
|
620
|
-
* Generated bundle index. Do not edit.
|
|
621
|
-
*/
|
|
622
|
-
|
|
623
|
-
export { FormGridBodyComponent, FormGridFooterComponent, FormGridHeaderComponent, FormioGrid, FormioGridComponent, GridBodyComponent, GridFooterComponent, GridHeaderComponent, GridService, SubmissionGridBodyComponent, SubmissionGridFooterComponent, SubmissionGridHeaderComponent, TimeSince as ɵa };
|
|
624
|
-
//# sourceMappingURL=formio-angular-grid.js.map
|