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