@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,1010 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('@angular/router'), require('@formio/angular'), require('lodash'), require('formiojs'), require('ngx-bootstrap/pagination')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@formio/angular/grid', ['exports', '@angular/core', '@angular/common', '@angular/forms', '@angular/router', '@formio/angular', 'lodash', 'formiojs', 'ngx-bootstrap/pagination'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.formio = global.formio || {}, global.formio.angular = global.formio.angular || {}, global.formio.angular.grid = {}), global.ng.core, global.ng.common, global.ng.forms, global.ng.router, global.formio.angular, global._, global.formiojs, global["ngx-bootstrap/pagination"]));
|
|
5
|
-
})(this, (function (exports, core, common, forms, router, angular, lodash, formiojs, pagination) { 'use strict';
|
|
6
|
-
|
|
7
|
-
var GridFooterPositions;
|
|
8
|
-
(function (GridFooterPositions) {
|
|
9
|
-
GridFooterPositions[GridFooterPositions["bottom"] = 0] = "bottom";
|
|
10
|
-
GridFooterPositions[GridFooterPositions["top"] = 1] = "top";
|
|
11
|
-
GridFooterPositions[GridFooterPositions["both"] = 2] = "both";
|
|
12
|
-
})(GridFooterPositions || (GridFooterPositions = {}));
|
|
13
|
-
|
|
14
|
-
/*! *****************************************************************************
|
|
15
|
-
Copyright (c) Microsoft Corporation.
|
|
16
|
-
|
|
17
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
18
|
-
purpose with or without fee is hereby granted.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
21
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
22
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
23
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
24
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
25
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
26
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
27
|
-
***************************************************************************** */
|
|
28
|
-
/* global Reflect, Promise */
|
|
29
|
-
var extendStatics = function (d, b) {
|
|
30
|
-
extendStatics = Object.setPrototypeOf ||
|
|
31
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
32
|
-
function (d, b) { for (var p in b)
|
|
33
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
34
|
-
d[p] = b[p]; };
|
|
35
|
-
return extendStatics(d, b);
|
|
36
|
-
};
|
|
37
|
-
function __extends(d, b) {
|
|
38
|
-
if (typeof b !== "function" && b !== null)
|
|
39
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
40
|
-
extendStatics(d, b);
|
|
41
|
-
function __() { this.constructor = d; }
|
|
42
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
43
|
-
}
|
|
44
|
-
var __assign = function () {
|
|
45
|
-
__assign = Object.assign || function __assign(t) {
|
|
46
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
47
|
-
s = arguments[i];
|
|
48
|
-
for (var p in s)
|
|
49
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
50
|
-
t[p] = s[p];
|
|
51
|
-
}
|
|
52
|
-
return t;
|
|
53
|
-
};
|
|
54
|
-
return __assign.apply(this, arguments);
|
|
55
|
-
};
|
|
56
|
-
function __rest(s, e) {
|
|
57
|
-
var t = {};
|
|
58
|
-
for (var p in s)
|
|
59
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
60
|
-
t[p] = s[p];
|
|
61
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
62
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
63
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
64
|
-
t[p[i]] = s[p[i]];
|
|
65
|
-
}
|
|
66
|
-
return t;
|
|
67
|
-
}
|
|
68
|
-
function __decorate(decorators, target, key, desc) {
|
|
69
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
70
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
71
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
72
|
-
else
|
|
73
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
74
|
-
if (d = decorators[i])
|
|
75
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
76
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
77
|
-
}
|
|
78
|
-
function __param(paramIndex, decorator) {
|
|
79
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
80
|
-
}
|
|
81
|
-
function __metadata(metadataKey, metadataValue) {
|
|
82
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
83
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
84
|
-
}
|
|
85
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
86
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
87
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
88
|
-
function fulfilled(value) { try {
|
|
89
|
-
step(generator.next(value));
|
|
90
|
-
}
|
|
91
|
-
catch (e) {
|
|
92
|
-
reject(e);
|
|
93
|
-
} }
|
|
94
|
-
function rejected(value) { try {
|
|
95
|
-
step(generator["throw"](value));
|
|
96
|
-
}
|
|
97
|
-
catch (e) {
|
|
98
|
-
reject(e);
|
|
99
|
-
} }
|
|
100
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
101
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
function __generator(thisArg, body) {
|
|
105
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
106
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
107
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
108
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
109
|
-
function step(op) {
|
|
110
|
-
if (f)
|
|
111
|
-
throw new TypeError("Generator is already executing.");
|
|
112
|
-
while (_)
|
|
113
|
-
try {
|
|
114
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
115
|
-
return t;
|
|
116
|
-
if (y = 0, t)
|
|
117
|
-
op = [op[0] & 2, t.value];
|
|
118
|
-
switch (op[0]) {
|
|
119
|
-
case 0:
|
|
120
|
-
case 1:
|
|
121
|
-
t = op;
|
|
122
|
-
break;
|
|
123
|
-
case 4:
|
|
124
|
-
_.label++;
|
|
125
|
-
return { value: op[1], done: false };
|
|
126
|
-
case 5:
|
|
127
|
-
_.label++;
|
|
128
|
-
y = op[1];
|
|
129
|
-
op = [0];
|
|
130
|
-
continue;
|
|
131
|
-
case 7:
|
|
132
|
-
op = _.ops.pop();
|
|
133
|
-
_.trys.pop();
|
|
134
|
-
continue;
|
|
135
|
-
default:
|
|
136
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
137
|
-
_ = 0;
|
|
138
|
-
continue;
|
|
139
|
-
}
|
|
140
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
141
|
-
_.label = op[1];
|
|
142
|
-
break;
|
|
143
|
-
}
|
|
144
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
145
|
-
_.label = t[1];
|
|
146
|
-
t = op;
|
|
147
|
-
break;
|
|
148
|
-
}
|
|
149
|
-
if (t && _.label < t[2]) {
|
|
150
|
-
_.label = t[2];
|
|
151
|
-
_.ops.push(op);
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
if (t[2])
|
|
155
|
-
_.ops.pop();
|
|
156
|
-
_.trys.pop();
|
|
157
|
-
continue;
|
|
158
|
-
}
|
|
159
|
-
op = body.call(thisArg, _);
|
|
160
|
-
}
|
|
161
|
-
catch (e) {
|
|
162
|
-
op = [6, e];
|
|
163
|
-
y = 0;
|
|
164
|
-
}
|
|
165
|
-
finally {
|
|
166
|
-
f = t = 0;
|
|
167
|
-
}
|
|
168
|
-
if (op[0] & 5)
|
|
169
|
-
throw op[1];
|
|
170
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
174
|
-
if (k2 === undefined)
|
|
175
|
-
k2 = k;
|
|
176
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
177
|
-
}) : (function (o, m, k, k2) {
|
|
178
|
-
if (k2 === undefined)
|
|
179
|
-
k2 = k;
|
|
180
|
-
o[k2] = m[k];
|
|
181
|
-
});
|
|
182
|
-
function __exportStar(m, o) {
|
|
183
|
-
for (var p in m)
|
|
184
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
185
|
-
__createBinding(o, m, p);
|
|
186
|
-
}
|
|
187
|
-
function __values(o) {
|
|
188
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
189
|
-
if (m)
|
|
190
|
-
return m.call(o);
|
|
191
|
-
if (o && typeof o.length === "number")
|
|
192
|
-
return {
|
|
193
|
-
next: function () {
|
|
194
|
-
if (o && i >= o.length)
|
|
195
|
-
o = void 0;
|
|
196
|
-
return { value: o && o[i++], done: !o };
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
200
|
-
}
|
|
201
|
-
function __read(o, n) {
|
|
202
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
203
|
-
if (!m)
|
|
204
|
-
return o;
|
|
205
|
-
var i = m.call(o), r, ar = [], e;
|
|
206
|
-
try {
|
|
207
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
208
|
-
ar.push(r.value);
|
|
209
|
-
}
|
|
210
|
-
catch (error) {
|
|
211
|
-
e = { error: error };
|
|
212
|
-
}
|
|
213
|
-
finally {
|
|
214
|
-
try {
|
|
215
|
-
if (r && !r.done && (m = i["return"]))
|
|
216
|
-
m.call(i);
|
|
217
|
-
}
|
|
218
|
-
finally {
|
|
219
|
-
if (e)
|
|
220
|
-
throw e.error;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
return ar;
|
|
224
|
-
}
|
|
225
|
-
/** @deprecated */
|
|
226
|
-
function __spread() {
|
|
227
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
228
|
-
ar = ar.concat(__read(arguments[i]));
|
|
229
|
-
return ar;
|
|
230
|
-
}
|
|
231
|
-
/** @deprecated */
|
|
232
|
-
function __spreadArrays() {
|
|
233
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
234
|
-
s += arguments[i].length;
|
|
235
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
236
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
237
|
-
r[k] = a[j];
|
|
238
|
-
return r;
|
|
239
|
-
}
|
|
240
|
-
function __spreadArray(to, from, pack) {
|
|
241
|
-
if (pack || arguments.length === 2)
|
|
242
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
243
|
-
if (ar || !(i in from)) {
|
|
244
|
-
if (!ar)
|
|
245
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
246
|
-
ar[i] = from[i];
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
250
|
-
}
|
|
251
|
-
function __await(v) {
|
|
252
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
253
|
-
}
|
|
254
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
255
|
-
if (!Symbol.asyncIterator)
|
|
256
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
257
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
258
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
259
|
-
function verb(n) { if (g[n])
|
|
260
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
261
|
-
function resume(n, v) { try {
|
|
262
|
-
step(g[n](v));
|
|
263
|
-
}
|
|
264
|
-
catch (e) {
|
|
265
|
-
settle(q[0][3], e);
|
|
266
|
-
} }
|
|
267
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
268
|
-
function fulfill(value) { resume("next", value); }
|
|
269
|
-
function reject(value) { resume("throw", value); }
|
|
270
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
271
|
-
resume(q[0][0], q[0][1]); }
|
|
272
|
-
}
|
|
273
|
-
function __asyncDelegator(o) {
|
|
274
|
-
var i, p;
|
|
275
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
276
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
277
|
-
}
|
|
278
|
-
function __asyncValues(o) {
|
|
279
|
-
if (!Symbol.asyncIterator)
|
|
280
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
281
|
-
var m = o[Symbol.asyncIterator], i;
|
|
282
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
283
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
284
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
285
|
-
}
|
|
286
|
-
function __makeTemplateObject(cooked, raw) {
|
|
287
|
-
if (Object.defineProperty) {
|
|
288
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
289
|
-
}
|
|
290
|
-
else {
|
|
291
|
-
cooked.raw = raw;
|
|
292
|
-
}
|
|
293
|
-
return cooked;
|
|
294
|
-
}
|
|
295
|
-
;
|
|
296
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
297
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
298
|
-
}) : function (o, v) {
|
|
299
|
-
o["default"] = v;
|
|
300
|
-
};
|
|
301
|
-
function __importStar(mod) {
|
|
302
|
-
if (mod && mod.__esModule)
|
|
303
|
-
return mod;
|
|
304
|
-
var result = {};
|
|
305
|
-
if (mod != null)
|
|
306
|
-
for (var k in mod)
|
|
307
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
308
|
-
__createBinding(result, mod, k);
|
|
309
|
-
__setModuleDefault(result, mod);
|
|
310
|
-
return result;
|
|
311
|
-
}
|
|
312
|
-
function __importDefault(mod) {
|
|
313
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
314
|
-
}
|
|
315
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
316
|
-
if (kind === "a" && !f)
|
|
317
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
318
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
319
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
320
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
321
|
-
}
|
|
322
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
323
|
-
if (kind === "m")
|
|
324
|
-
throw new TypeError("Private method is not writable");
|
|
325
|
-
if (kind === "a" && !f)
|
|
326
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
327
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
328
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
329
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
var GridHeaderComponent = /** @class */ (function () {
|
|
333
|
-
function GridHeaderComponent() {
|
|
334
|
-
this.headers = [];
|
|
335
|
-
this.sort = new core.EventEmitter();
|
|
336
|
-
}
|
|
337
|
-
Object.defineProperty(GridHeaderComponent.prototype, "numHeaders", {
|
|
338
|
-
get: function () {
|
|
339
|
-
return this.headers.length;
|
|
340
|
-
},
|
|
341
|
-
enumerable: false,
|
|
342
|
-
configurable: true
|
|
343
|
-
});
|
|
344
|
-
GridHeaderComponent.prototype.load = function (formio, query, columns) {
|
|
345
|
-
return Promise.resolve([]);
|
|
346
|
-
};
|
|
347
|
-
return GridHeaderComponent;
|
|
348
|
-
}());
|
|
349
|
-
GridHeaderComponent.decorators = [
|
|
350
|
-
{ type: core.Component, args: [{
|
|
351
|
-
template: ''
|
|
352
|
-
},] }
|
|
353
|
-
];
|
|
354
|
-
GridHeaderComponent.ctorParameters = function () { return []; };
|
|
355
|
-
GridHeaderComponent.propDecorators = {
|
|
356
|
-
actionAllowed: [{ type: core.Input }],
|
|
357
|
-
sort: [{ type: core.Output }],
|
|
358
|
-
template: [{ type: core.ViewChild, args: [core.TemplateRef, { static: true },] }]
|
|
359
|
-
};
|
|
360
|
-
|
|
361
|
-
var SortType;
|
|
362
|
-
(function (SortType) {
|
|
363
|
-
SortType["ASC"] = "asc";
|
|
364
|
-
SortType["DESC"] = "desc";
|
|
365
|
-
})(SortType || (SortType = {}));
|
|
366
|
-
|
|
367
|
-
var FormGridHeaderComponent = /** @class */ (function (_super) {
|
|
368
|
-
__extends(FormGridHeaderComponent, _super);
|
|
369
|
-
function FormGridHeaderComponent() {
|
|
370
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
371
|
-
}
|
|
372
|
-
FormGridHeaderComponent.prototype.load = function (formio) {
|
|
373
|
-
this.header = {
|
|
374
|
-
label: 'Title',
|
|
375
|
-
key: 'title',
|
|
376
|
-
sort: SortType.ASC
|
|
377
|
-
};
|
|
378
|
-
this.headers = [this.header];
|
|
379
|
-
return Promise.resolve(this.headers);
|
|
380
|
-
};
|
|
381
|
-
Object.defineProperty(FormGridHeaderComponent.prototype, "numHeaders", {
|
|
382
|
-
get: function () {
|
|
383
|
-
return 2;
|
|
384
|
-
},
|
|
385
|
-
enumerable: false,
|
|
386
|
-
configurable: true
|
|
387
|
-
});
|
|
388
|
-
return FormGridHeaderComponent;
|
|
389
|
-
}(GridHeaderComponent));
|
|
390
|
-
FormGridHeaderComponent.decorators = [
|
|
391
|
-
{ type: core.Component, args: [{
|
|
392
|
-
selector: 'form-grid-header',
|
|
393
|
-
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"
|
|
394
|
-
},] }
|
|
395
|
-
];
|
|
396
|
-
|
|
397
|
-
var GridService = /** @class */ (function () {
|
|
398
|
-
function GridService() {
|
|
399
|
-
}
|
|
400
|
-
GridService.prototype.setRows = function (rows) {
|
|
401
|
-
this.rows = rows;
|
|
402
|
-
};
|
|
403
|
-
GridService.prototype.getFormsPerPage = function () {
|
|
404
|
-
var _a;
|
|
405
|
-
return (_a = this.rows) === null || _a === void 0 ? void 0 : _a.length;
|
|
406
|
-
};
|
|
407
|
-
return GridService;
|
|
408
|
-
}());
|
|
409
|
-
GridService.decorators = [
|
|
410
|
-
{ type: core.Injectable }
|
|
411
|
-
];
|
|
412
|
-
GridService.ctorParameters = function () { return []; };
|
|
413
|
-
|
|
414
|
-
var GridBodyComponent = /** @class */ (function () {
|
|
415
|
-
function GridBodyComponent(service) {
|
|
416
|
-
this.service = service;
|
|
417
|
-
this.firstItem = 0;
|
|
418
|
-
this.lastItem = 0;
|
|
419
|
-
this.skip = 0;
|
|
420
|
-
this.limit = 0;
|
|
421
|
-
this.total = 0;
|
|
422
|
-
this.rowSelect = new core.EventEmitter();
|
|
423
|
-
this.rowAction = new core.EventEmitter();
|
|
424
|
-
this.loading = true;
|
|
425
|
-
}
|
|
426
|
-
GridBodyComponent.prototype.load = function (formio, query) {
|
|
427
|
-
return formio.loadForm(query);
|
|
428
|
-
};
|
|
429
|
-
GridBodyComponent.prototype.onRowSelect = function (event, row) {
|
|
430
|
-
event.preventDefault();
|
|
431
|
-
this.rowSelect.emit(row);
|
|
432
|
-
};
|
|
433
|
-
GridBodyComponent.prototype.onRowAction = function (event, row, action) {
|
|
434
|
-
event.preventDefault();
|
|
435
|
-
this.rowAction.emit({ row: row, action: action });
|
|
436
|
-
};
|
|
437
|
-
/**
|
|
438
|
-
* Set the rows for this Grid body.
|
|
439
|
-
*
|
|
440
|
-
* @param query
|
|
441
|
-
* @param items
|
|
442
|
-
* @return any
|
|
443
|
-
*/
|
|
444
|
-
GridBodyComponent.prototype.setRows = function (query, items) {
|
|
445
|
-
var _this = this;
|
|
446
|
-
this.rows = [];
|
|
447
|
-
if (typeof items !== 'object') {
|
|
448
|
-
this.firstItem = 0;
|
|
449
|
-
this.lastItem = 0;
|
|
450
|
-
this.total = 0;
|
|
451
|
-
this.skip = 0;
|
|
452
|
-
this.loading = false;
|
|
453
|
-
this.service.setRows(this.rows);
|
|
454
|
-
return this.rows;
|
|
455
|
-
}
|
|
456
|
-
this.firstItem = query.skip + 1;
|
|
457
|
-
this.lastItem = this.firstItem + items.length - 1;
|
|
458
|
-
if (this.lastItem === 0) {
|
|
459
|
-
this.firstItem = 0;
|
|
460
|
-
}
|
|
461
|
-
this.total = items.serverCount;
|
|
462
|
-
this.limit = query.limit;
|
|
463
|
-
this.skip = Math.floor(items.skip / query.limit) + 1;
|
|
464
|
-
this.loading = false;
|
|
465
|
-
lodash.each(items, function (item) {
|
|
466
|
-
_this.rows.push(lodash.clone(item));
|
|
467
|
-
});
|
|
468
|
-
this.service.setRows(this.rows);
|
|
469
|
-
return this.rows;
|
|
470
|
-
};
|
|
471
|
-
return GridBodyComponent;
|
|
472
|
-
}());
|
|
473
|
-
GridBodyComponent.decorators = [
|
|
474
|
-
{ type: core.Component, args: [{
|
|
475
|
-
template: ''
|
|
476
|
-
},] }
|
|
477
|
-
];
|
|
478
|
-
GridBodyComponent.ctorParameters = function () { return [
|
|
479
|
-
{ type: GridService }
|
|
480
|
-
]; };
|
|
481
|
-
GridBodyComponent.propDecorators = {
|
|
482
|
-
header: [{ type: core.Input }],
|
|
483
|
-
actionAllowed: [{ type: core.Input }],
|
|
484
|
-
rowSelect: [{ type: core.Output }],
|
|
485
|
-
rowAction: [{ type: core.Output }],
|
|
486
|
-
template: [{ type: core.ViewChild, args: [core.TemplateRef, { static: true },] }]
|
|
487
|
-
};
|
|
488
|
-
|
|
489
|
-
var FormGridBodyComponent = /** @class */ (function (_super) {
|
|
490
|
-
__extends(FormGridBodyComponent, _super);
|
|
491
|
-
function FormGridBodyComponent() {
|
|
492
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
493
|
-
}
|
|
494
|
-
FormGridBodyComponent.prototype.load = function (formio, query) {
|
|
495
|
-
var _this = this;
|
|
496
|
-
query = query || {};
|
|
497
|
-
return formio.loadForms({ params: query }).then(function (forms) { return _this.setRows(query, forms); });
|
|
498
|
-
};
|
|
499
|
-
return FormGridBodyComponent;
|
|
500
|
-
}(GridBodyComponent));
|
|
501
|
-
FormGridBodyComponent.decorators = [
|
|
502
|
-
{ type: core.Component, args: [{
|
|
503
|
-
selector: 'form-grid-body',
|
|
504
|
-
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",
|
|
505
|
-
styles: [".form-btn{font-size:.75rem;margin:2px 0}\n"]
|
|
506
|
-
},] }
|
|
507
|
-
];
|
|
508
|
-
|
|
509
|
-
var GridFooterComponent = /** @class */ (function () {
|
|
510
|
-
function GridFooterComponent() {
|
|
511
|
-
this.footerPositions = GridFooterPositions;
|
|
512
|
-
this.pageChanged = new core.EventEmitter();
|
|
513
|
-
this.createItem = new core.EventEmitter();
|
|
514
|
-
}
|
|
515
|
-
return GridFooterComponent;
|
|
516
|
-
}());
|
|
517
|
-
GridFooterComponent.decorators = [
|
|
518
|
-
{ type: core.Component, args: [{
|
|
519
|
-
template: ''
|
|
520
|
-
},] }
|
|
521
|
-
];
|
|
522
|
-
GridFooterComponent.ctorParameters = function () { return []; };
|
|
523
|
-
GridFooterComponent.propDecorators = {
|
|
524
|
-
header: [{ type: core.Input }],
|
|
525
|
-
body: [{ type: core.Input }],
|
|
526
|
-
createText: [{ type: core.Input }],
|
|
527
|
-
size: [{ type: core.Input }],
|
|
528
|
-
actionAllowed: [{ type: core.Input }],
|
|
529
|
-
pageChanged: [{ type: core.Output }],
|
|
530
|
-
createItem: [{ type: core.Output }],
|
|
531
|
-
template: [{ type: core.ViewChild, args: [core.TemplateRef, { static: true },] }]
|
|
532
|
-
};
|
|
533
|
-
|
|
534
|
-
var FormGridFooterComponent = /** @class */ (function (_super) {
|
|
535
|
-
__extends(FormGridFooterComponent, _super);
|
|
536
|
-
function FormGridFooterComponent() {
|
|
537
|
-
return _super.call(this) || this;
|
|
538
|
-
}
|
|
539
|
-
FormGridFooterComponent.prototype.ngOnInit = function () {
|
|
540
|
-
if (!this.createText) {
|
|
541
|
-
this.createText = 'Create Form';
|
|
542
|
-
}
|
|
543
|
-
if (!this.size) {
|
|
544
|
-
this.size = 7;
|
|
545
|
-
}
|
|
546
|
-
};
|
|
547
|
-
return FormGridFooterComponent;
|
|
548
|
-
}(GridFooterComponent));
|
|
549
|
-
FormGridFooterComponent.decorators = [
|
|
550
|
-
{ type: core.Component, args: [{
|
|
551
|
-
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",
|
|
552
|
-
encapsulation: core.ViewEncapsulation.None,
|
|
553
|
-
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"]
|
|
554
|
-
},] }
|
|
555
|
-
];
|
|
556
|
-
FormGridFooterComponent.ctorParameters = function () { return []; };
|
|
557
|
-
|
|
558
|
-
var FormComponents = {
|
|
559
|
-
header: FormGridHeaderComponent,
|
|
560
|
-
body: FormGridBodyComponent,
|
|
561
|
-
footer: FormGridFooterComponent
|
|
562
|
-
};
|
|
563
|
-
|
|
564
|
-
var SubmissionGridHeaderComponent = /** @class */ (function (_super) {
|
|
565
|
-
__extends(SubmissionGridHeaderComponent, _super);
|
|
566
|
-
function SubmissionGridHeaderComponent() {
|
|
567
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
568
|
-
}
|
|
569
|
-
SubmissionGridHeaderComponent.prototype.load = function (formio, query, columns) {
|
|
570
|
-
var _this = this;
|
|
571
|
-
query = query || {};
|
|
572
|
-
return formio.loadForm({ params: query }).then(function (form) {
|
|
573
|
-
_this.headers = [];
|
|
574
|
-
_this.formComponents = new Map();
|
|
575
|
-
_this.setComponents(form.components);
|
|
576
|
-
columns ? columns.forEach(function (column) {
|
|
577
|
-
_this.setHeader(_this.getHeaderForColumn(column, _this.formComponents.get(column.path)));
|
|
578
|
-
}) : _this.setComponentsHeaders(_this.formComponents);
|
|
579
|
-
return _this.headers;
|
|
580
|
-
});
|
|
581
|
-
};
|
|
582
|
-
SubmissionGridHeaderComponent.prototype.setHeader = function (header) {
|
|
583
|
-
this.headers.push(header);
|
|
584
|
-
};
|
|
585
|
-
SubmissionGridHeaderComponent.prototype.getHeaderForColumn = function (column, component, sort) {
|
|
586
|
-
return {
|
|
587
|
-
label: column.label,
|
|
588
|
-
key: column.path,
|
|
589
|
-
sort: sort,
|
|
590
|
-
component: component ? formiojs.Components.create(component, null, null, true) : undefined,
|
|
591
|
-
renderCell: column ? column.renderCell : undefined
|
|
592
|
-
};
|
|
593
|
-
};
|
|
594
|
-
SubmissionGridHeaderComponent.prototype.getHeaderForComponent = function (component, path, sort) {
|
|
595
|
-
return {
|
|
596
|
-
label: component.label,
|
|
597
|
-
key: path,
|
|
598
|
-
sort: sort,
|
|
599
|
-
component: component ? formiojs.Components.create(component, null, null, true) : undefined,
|
|
600
|
-
};
|
|
601
|
-
};
|
|
602
|
-
// Set headers from components in case if columns are not provided
|
|
603
|
-
SubmissionGridHeaderComponent.prototype.setComponentsHeaders = function (components, sort) {
|
|
604
|
-
var _this = this;
|
|
605
|
-
components.forEach(function (component, path) {
|
|
606
|
-
if (component.input &&
|
|
607
|
-
(!component.hasOwnProperty('tableView') || component.tableView)) {
|
|
608
|
-
_this.setHeader(_this.getHeaderForComponent(component, path, sort));
|
|
609
|
-
}
|
|
610
|
-
});
|
|
611
|
-
};
|
|
612
|
-
// Map components
|
|
613
|
-
SubmissionGridHeaderComponent.prototype.setComponents = function (components) {
|
|
614
|
-
var _this = this;
|
|
615
|
-
formiojs.Utils.eachComponent(components, function (component, newPath) {
|
|
616
|
-
_this.formComponents.set("data." + newPath, component);
|
|
617
|
-
});
|
|
618
|
-
};
|
|
619
|
-
return SubmissionGridHeaderComponent;
|
|
620
|
-
}(GridHeaderComponent));
|
|
621
|
-
SubmissionGridHeaderComponent.decorators = [
|
|
622
|
-
{ type: core.Component, args: [{
|
|
623
|
-
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"
|
|
624
|
-
},] }
|
|
625
|
-
];
|
|
626
|
-
|
|
627
|
-
var SubmissionGridBodyComponent = /** @class */ (function (_super) {
|
|
628
|
-
__extends(SubmissionGridBodyComponent, _super);
|
|
629
|
-
function SubmissionGridBodyComponent() {
|
|
630
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
631
|
-
}
|
|
632
|
-
SubmissionGridBodyComponent.prototype.load = function (formio, query) {
|
|
633
|
-
var _this = this;
|
|
634
|
-
query = query || {};
|
|
635
|
-
return formio.loadSubmissions({ params: query })
|
|
636
|
-
.then(function (submissions) { return _this.setRows(query, submissions); });
|
|
637
|
-
};
|
|
638
|
-
/**
|
|
639
|
-
* Render the cell data.
|
|
640
|
-
*
|
|
641
|
-
* @param submission
|
|
642
|
-
* @param header
|
|
643
|
-
* @return any
|
|
644
|
-
*/
|
|
645
|
-
SubmissionGridBodyComponent.prototype.view = function (submission, header) {
|
|
646
|
-
var cellValue = lodash.get(submission, header.key);
|
|
647
|
-
if (header.renderCell) {
|
|
648
|
-
return header.renderCell(cellValue, header.component);
|
|
649
|
-
}
|
|
650
|
-
else {
|
|
651
|
-
if (header.component) {
|
|
652
|
-
if (header.component.getView) {
|
|
653
|
-
return header.component.getView(cellValue);
|
|
654
|
-
}
|
|
655
|
-
return header.component.asString(cellValue);
|
|
656
|
-
}
|
|
657
|
-
else {
|
|
658
|
-
return cellValue.toString();
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
};
|
|
662
|
-
return SubmissionGridBodyComponent;
|
|
663
|
-
}(GridBodyComponent));
|
|
664
|
-
SubmissionGridBodyComponent.decorators = [
|
|
665
|
-
{ type: core.Component, args: [{
|
|
666
|
-
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"
|
|
667
|
-
},] }
|
|
668
|
-
];
|
|
669
|
-
|
|
670
|
-
var SubmissionGridFooterComponent = /** @class */ (function (_super) {
|
|
671
|
-
__extends(SubmissionGridFooterComponent, _super);
|
|
672
|
-
function SubmissionGridFooterComponent() {
|
|
673
|
-
return _super.call(this) || this;
|
|
674
|
-
}
|
|
675
|
-
SubmissionGridFooterComponent.prototype.ngOnInit = function () {
|
|
676
|
-
if (!this.size) {
|
|
677
|
-
this.size = 7;
|
|
678
|
-
}
|
|
679
|
-
};
|
|
680
|
-
return SubmissionGridFooterComponent;
|
|
681
|
-
}(GridFooterComponent));
|
|
682
|
-
SubmissionGridFooterComponent.decorators = [
|
|
683
|
-
{ type: core.Component, args: [{
|
|
684
|
-
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",
|
|
685
|
-
encapsulation: core.ViewEncapsulation.None,
|
|
686
|
-
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"]
|
|
687
|
-
},] }
|
|
688
|
-
];
|
|
689
|
-
SubmissionGridFooterComponent.ctorParameters = function () { return []; };
|
|
690
|
-
|
|
691
|
-
var SubmissionComponents = {
|
|
692
|
-
header: SubmissionGridHeaderComponent,
|
|
693
|
-
body: SubmissionGridBodyComponent,
|
|
694
|
-
footer: SubmissionGridFooterComponent
|
|
695
|
-
};
|
|
696
|
-
|
|
697
|
-
var FormioGridComponent = /** @class */ (function () {
|
|
698
|
-
function FormioGridComponent(alerts, resolver, ref) {
|
|
699
|
-
this.alerts = alerts;
|
|
700
|
-
this.resolver = resolver;
|
|
701
|
-
this.ref = ref;
|
|
702
|
-
this.footerPosition = GridFooterPositions.bottom;
|
|
703
|
-
this.page = 0;
|
|
704
|
-
this.isLoading = false;
|
|
705
|
-
this.initialized = false;
|
|
706
|
-
this.footerPositions = GridFooterPositions;
|
|
707
|
-
this.select = this.rowSelect = new core.EventEmitter();
|
|
708
|
-
this.rowAction = new core.EventEmitter();
|
|
709
|
-
this.createItem = new core.EventEmitter();
|
|
710
|
-
this.error = new core.EventEmitter();
|
|
711
|
-
this.isLoading = true;
|
|
712
|
-
}
|
|
713
|
-
FormioGridComponent.prototype.createComponent = function (property, component) {
|
|
714
|
-
var factory = this.resolver.resolveComponentFactory(component);
|
|
715
|
-
var componentRef = property.createComponent(factory);
|
|
716
|
-
return componentRef.instance;
|
|
717
|
-
};
|
|
718
|
-
FormioGridComponent.prototype.loadGrid = function (src) {
|
|
719
|
-
var _this = this;
|
|
720
|
-
// If no source is provided, then skip.
|
|
721
|
-
if (!src && !this.formio) {
|
|
722
|
-
return;
|
|
723
|
-
}
|
|
724
|
-
// Do not double load.
|
|
725
|
-
if (this.formio && this.src && (src === this.src)) {
|
|
726
|
-
return;
|
|
727
|
-
}
|
|
728
|
-
if (src) {
|
|
729
|
-
this.src = src;
|
|
730
|
-
this.formio = new angular.FormioPromiseService(this.src, { formOnly: true });
|
|
731
|
-
}
|
|
732
|
-
// Load the header.
|
|
733
|
-
this.header.load(this.formio, {}, this.columns)
|
|
734
|
-
.then(function () { return _this.setPage(0); })
|
|
735
|
-
.catch(function (error) { return _this.onError(error); });
|
|
736
|
-
};
|
|
737
|
-
FormioGridComponent.prototype.ngOnInit = function () {
|
|
738
|
-
var _this = this;
|
|
739
|
-
// Create our components.
|
|
740
|
-
var comps = this.components || ((this.gridType === 'form') ? FormComponents : SubmissionComponents);
|
|
741
|
-
this.header = this.createComponent(this.headerElement, comps.header);
|
|
742
|
-
this.header.actionAllowed = this.actionAllowed.bind(this);
|
|
743
|
-
this.header.sort.subscribe(function (header) { return _this.sortColumn(header); });
|
|
744
|
-
this.body = this.createComponent(this.bodyElement, comps.body);
|
|
745
|
-
this.body.header = this.header;
|
|
746
|
-
this.body.actionAllowed = this.actionAllowed.bind(this);
|
|
747
|
-
this.body.rowSelect.subscribe(function (row) { return _this.rowSelect.emit(row); });
|
|
748
|
-
this.body.rowAction.subscribe(function (action) { return _this.rowAction.emit(action); });
|
|
749
|
-
this.footer = this.createComponent(this.footerElement, comps.footer);
|
|
750
|
-
this.footer.header = this.header;
|
|
751
|
-
this.footer.body = this.body;
|
|
752
|
-
this.footer.actionAllowed = this.actionAllowed.bind(this);
|
|
753
|
-
this.footer.createText = this.createText;
|
|
754
|
-
this.footer.size = this.size;
|
|
755
|
-
this.footer.pageChanged.subscribe(function (page) { return _this.pageChanged(page); });
|
|
756
|
-
this.footer.createItem.subscribe(function (item) { return _this.createItem.emit(item); });
|
|
757
|
-
};
|
|
758
|
-
FormioGridComponent.prototype.ngOnChanges = function (changes) {
|
|
759
|
-
if (this.initialized) {
|
|
760
|
-
if ((changes.src && changes.src.currentValue) ||
|
|
761
|
-
(changes.formio && changes.formio.currentValue)) {
|
|
762
|
-
this.loadGrid(changes.src.currentValue);
|
|
763
|
-
}
|
|
764
|
-
if (changes.items && changes.items.currentValue) {
|
|
765
|
-
this.refreshGrid();
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
if (this.footer &&
|
|
769
|
-
(changes.createText && changes.createText.currentValue)) {
|
|
770
|
-
this.footer.createText = changes.createText.currentValue;
|
|
771
|
-
}
|
|
772
|
-
};
|
|
773
|
-
FormioGridComponent.prototype.ngAfterViewInit = function () {
|
|
774
|
-
var _this = this;
|
|
775
|
-
this.alerts.setAlerts([]);
|
|
776
|
-
this.query = this.query || {};
|
|
777
|
-
if (this.refresh) {
|
|
778
|
-
this.refresh.subscribe(function (query) { return _this.refreshGrid(query); });
|
|
779
|
-
}
|
|
780
|
-
this.loadGrid(this.src);
|
|
781
|
-
this.initialized = true;
|
|
782
|
-
this.ref.detectChanges();
|
|
783
|
-
};
|
|
784
|
-
FormioGridComponent.prototype.actionAllowed = function (action) {
|
|
785
|
-
if (this.isActionAllowed) {
|
|
786
|
-
return this.isActionAllowed(action);
|
|
787
|
-
}
|
|
788
|
-
else {
|
|
789
|
-
return true;
|
|
790
|
-
}
|
|
791
|
-
};
|
|
792
|
-
FormioGridComponent.prototype.onError = function (error) {
|
|
793
|
-
this.isLoading = false;
|
|
794
|
-
this.error.emit(error);
|
|
795
|
-
if (typeof error === 'string' || error.message) {
|
|
796
|
-
this.alerts.setAlert({
|
|
797
|
-
type: 'danger',
|
|
798
|
-
message: error.message || error
|
|
799
|
-
});
|
|
800
|
-
}
|
|
801
|
-
};
|
|
802
|
-
FormioGridComponent.prototype.refreshGrid = function (query) {
|
|
803
|
-
var _this = this;
|
|
804
|
-
this.alerts.setAlerts([]);
|
|
805
|
-
this.query = query || this.query;
|
|
806
|
-
if (!this.query.hasOwnProperty('limit')) {
|
|
807
|
-
this.query.limit = 10;
|
|
808
|
-
}
|
|
809
|
-
if (!this.query.hasOwnProperty('skip')) {
|
|
810
|
-
this.query.skip = 0;
|
|
811
|
-
}
|
|
812
|
-
this.isLoading = true;
|
|
813
|
-
this.ref.detectChanges();
|
|
814
|
-
formiojs.Formio.cache = {};
|
|
815
|
-
var loader = null;
|
|
816
|
-
if (this.items) {
|
|
817
|
-
loader = Promise.resolve(this.body.setRows(this.query, this.items));
|
|
818
|
-
}
|
|
819
|
-
else {
|
|
820
|
-
loader = this.body.load(this.formio, this.query);
|
|
821
|
-
}
|
|
822
|
-
return loader.then(function (info) {
|
|
823
|
-
_this.isLoading = false;
|
|
824
|
-
_this.initialized = true;
|
|
825
|
-
_this.ref.detectChanges();
|
|
826
|
-
}).catch(function (error) { return _this.onError(error); });
|
|
827
|
-
};
|
|
828
|
-
FormioGridComponent.prototype.setPage = function (num) {
|
|
829
|
-
if (num === void 0) { num = -1; }
|
|
830
|
-
this.page = num !== -1 ? num : this.page;
|
|
831
|
-
if (!this.query.hasOwnProperty('limit')) {
|
|
832
|
-
this.query.limit = 10;
|
|
833
|
-
}
|
|
834
|
-
if (!this.query.hasOwnProperty('skip')) {
|
|
835
|
-
this.query.skip = 0;
|
|
836
|
-
}
|
|
837
|
-
this.query.skip = this.page * this.query.limit;
|
|
838
|
-
this.refreshGrid();
|
|
839
|
-
};
|
|
840
|
-
FormioGridComponent.prototype.sortColumn = function (header) {
|
|
841
|
-
// Reset all other column sorts.
|
|
842
|
-
lodash.each(this.header.headers, function (col) {
|
|
843
|
-
if (col.key !== header.key) {
|
|
844
|
-
col.sort = '';
|
|
845
|
-
}
|
|
846
|
-
});
|
|
847
|
-
switch (header.sort) {
|
|
848
|
-
case 'asc':
|
|
849
|
-
header.sort = SortType.DESC;
|
|
850
|
-
this.query.sort = '-' + header.key;
|
|
851
|
-
break;
|
|
852
|
-
case 'desc':
|
|
853
|
-
header.sort = undefined;
|
|
854
|
-
delete this.query.sort;
|
|
855
|
-
break;
|
|
856
|
-
case undefined:
|
|
857
|
-
header.sort = SortType.ASC;
|
|
858
|
-
this.query.sort = header.key;
|
|
859
|
-
break;
|
|
860
|
-
}
|
|
861
|
-
this.refreshGrid();
|
|
862
|
-
};
|
|
863
|
-
FormioGridComponent.prototype.pageChanged = function (page) {
|
|
864
|
-
this.setPage(page.page - 1);
|
|
865
|
-
};
|
|
866
|
-
return FormioGridComponent;
|
|
867
|
-
}());
|
|
868
|
-
FormioGridComponent.decorators = [
|
|
869
|
-
{ type: core.Component, args: [{
|
|
870
|
-
selector: 'formio-grid',
|
|
871
|
-
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",
|
|
872
|
-
styles: [".formio-grid{position:relative;width:100%}.grid-refresh{height:400px;width:100%}\n"]
|
|
873
|
-
},] }
|
|
874
|
-
];
|
|
875
|
-
FormioGridComponent.ctorParameters = function () { return [
|
|
876
|
-
{ type: angular.FormioAlerts },
|
|
877
|
-
{ type: core.ComponentFactoryResolver },
|
|
878
|
-
{ type: core.ChangeDetectorRef }
|
|
879
|
-
]; };
|
|
880
|
-
FormioGridComponent.propDecorators = {
|
|
881
|
-
footerPosition: [{ type: core.Input }],
|
|
882
|
-
src: [{ type: core.Input }],
|
|
883
|
-
items: [{ type: core.Input }],
|
|
884
|
-
onForm: [{ type: core.Input }],
|
|
885
|
-
query: [{ type: core.Input }],
|
|
886
|
-
refresh: [{ type: core.Input }],
|
|
887
|
-
columns: [{ type: core.Input }],
|
|
888
|
-
gridType: [{ type: core.Input }],
|
|
889
|
-
size: [{ type: core.Input }],
|
|
890
|
-
components: [{ type: core.Input }],
|
|
891
|
-
formio: [{ type: core.Input }],
|
|
892
|
-
label: [{ type: core.Input }],
|
|
893
|
-
createText: [{ type: core.Input }],
|
|
894
|
-
isActionAllowed: [{ type: core.Input }],
|
|
895
|
-
select: [{ type: core.Output }],
|
|
896
|
-
rowSelect: [{ type: core.Output }],
|
|
897
|
-
rowAction: [{ type: core.Output }],
|
|
898
|
-
createItem: [{ type: core.Output }],
|
|
899
|
-
error: [{ type: core.Output }],
|
|
900
|
-
headerElement: [{ type: core.ViewChild, args: ['headerTemplate', { read: core.ViewContainerRef, static: true },] }],
|
|
901
|
-
bodyElement: [{ type: core.ViewChild, args: ['bodyTemplate', { read: core.ViewContainerRef, static: true },] }],
|
|
902
|
-
footerElement: [{ type: core.ViewChild, args: ['footerTemplate', { read: core.ViewContainerRef, static: true },] }]
|
|
903
|
-
};
|
|
904
|
-
|
|
905
|
-
var TimeSince = /** @class */ (function () {
|
|
906
|
-
function TimeSince() {
|
|
907
|
-
}
|
|
908
|
-
TimeSince.prototype.transform = function (date) {
|
|
909
|
-
var elapsed = (new Date().getTime() - new Date(date).getTime()) / 1000;
|
|
910
|
-
var interval;
|
|
911
|
-
if (interval >= 1) {
|
|
912
|
-
return interval + ' year' + (interval > 1 ? 's' : '');
|
|
913
|
-
}
|
|
914
|
-
interval = Math.floor(elapsed / 2592000);
|
|
915
|
-
if (interval >= 1) {
|
|
916
|
-
return interval + ' month' + (interval > 1 ? 's' : '');
|
|
917
|
-
}
|
|
918
|
-
interval = Math.floor(elapsed / 86400);
|
|
919
|
-
if (interval >= 1) {
|
|
920
|
-
return interval + ' day' + (interval > 1 ? 's' : '');
|
|
921
|
-
}
|
|
922
|
-
interval = Math.floor(elapsed / 3600);
|
|
923
|
-
if (interval >= 1) {
|
|
924
|
-
return interval + ' hour' + (interval > 1 ? 's' : '');
|
|
925
|
-
}
|
|
926
|
-
interval = Math.floor(elapsed / 60);
|
|
927
|
-
if (interval >= 1) {
|
|
928
|
-
return interval + ' minute' + (interval > 1 ? 's' : '');
|
|
929
|
-
}
|
|
930
|
-
return Math.floor(elapsed) + ' second' + (elapsed > 1 ? 's' : '');
|
|
931
|
-
};
|
|
932
|
-
return TimeSince;
|
|
933
|
-
}());
|
|
934
|
-
TimeSince.decorators = [
|
|
935
|
-
{ type: core.Pipe, args: [{
|
|
936
|
-
name: 'timeSince'
|
|
937
|
-
},] }
|
|
938
|
-
];
|
|
939
|
-
|
|
940
|
-
var FormioGrid = /** @class */ (function () {
|
|
941
|
-
function FormioGrid() {
|
|
942
|
-
}
|
|
943
|
-
return FormioGrid;
|
|
944
|
-
}());
|
|
945
|
-
FormioGrid.decorators = [
|
|
946
|
-
{ type: core.NgModule, args: [{
|
|
947
|
-
imports: [
|
|
948
|
-
common.CommonModule,
|
|
949
|
-
forms.FormsModule,
|
|
950
|
-
angular.FormioModule,
|
|
951
|
-
router.RouterModule,
|
|
952
|
-
pagination.PaginationModule.forRoot()
|
|
953
|
-
],
|
|
954
|
-
declarations: [
|
|
955
|
-
FormioGridComponent,
|
|
956
|
-
FormGridHeaderComponent,
|
|
957
|
-
FormGridBodyComponent,
|
|
958
|
-
FormGridFooterComponent,
|
|
959
|
-
SubmissionGridHeaderComponent,
|
|
960
|
-
SubmissionGridBodyComponent,
|
|
961
|
-
SubmissionGridFooterComponent,
|
|
962
|
-
GridHeaderComponent,
|
|
963
|
-
GridBodyComponent,
|
|
964
|
-
GridFooterComponent,
|
|
965
|
-
TimeSince
|
|
966
|
-
],
|
|
967
|
-
exports: [
|
|
968
|
-
FormioGridComponent
|
|
969
|
-
],
|
|
970
|
-
entryComponents: [
|
|
971
|
-
FormGridHeaderComponent,
|
|
972
|
-
FormGridBodyComponent,
|
|
973
|
-
FormGridFooterComponent,
|
|
974
|
-
SubmissionGridHeaderComponent,
|
|
975
|
-
SubmissionGridBodyComponent,
|
|
976
|
-
SubmissionGridFooterComponent
|
|
977
|
-
],
|
|
978
|
-
providers: [
|
|
979
|
-
angular.FormioAlerts,
|
|
980
|
-
GridService
|
|
981
|
-
]
|
|
982
|
-
},] }
|
|
983
|
-
];
|
|
984
|
-
|
|
985
|
-
/*
|
|
986
|
-
* Public API Surface of angular-formio
|
|
987
|
-
*/
|
|
988
|
-
|
|
989
|
-
/**
|
|
990
|
-
* Generated bundle index. Do not edit.
|
|
991
|
-
*/
|
|
992
|
-
|
|
993
|
-
exports.FormGridBodyComponent = FormGridBodyComponent;
|
|
994
|
-
exports.FormGridFooterComponent = FormGridFooterComponent;
|
|
995
|
-
exports.FormGridHeaderComponent = FormGridHeaderComponent;
|
|
996
|
-
exports.FormioGrid = FormioGrid;
|
|
997
|
-
exports.FormioGridComponent = FormioGridComponent;
|
|
998
|
-
exports.GridBodyComponent = GridBodyComponent;
|
|
999
|
-
exports.GridFooterComponent = GridFooterComponent;
|
|
1000
|
-
exports.GridHeaderComponent = GridHeaderComponent;
|
|
1001
|
-
exports.GridService = GridService;
|
|
1002
|
-
exports.SubmissionGridBodyComponent = SubmissionGridBodyComponent;
|
|
1003
|
-
exports.SubmissionGridFooterComponent = SubmissionGridFooterComponent;
|
|
1004
|
-
exports.SubmissionGridHeaderComponent = SubmissionGridHeaderComponent;
|
|
1005
|
-
exports["ɵa"] = TimeSince;
|
|
1006
|
-
|
|
1007
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1008
|
-
|
|
1009
|
-
}));
|
|
1010
|
-
//# sourceMappingURL=formio-angular-grid.umd.js.map
|