@kalisio/kdk 2.3.2 → 2.4.0
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/.eslintignore +2 -1
- package/.github/workflows/main.yaml +3 -3
- package/README.md +1 -0
- package/core/api/db.js +6 -1
- package/core/api/hooks/hooks.model.js +1 -1
- package/core/api/hooks/hooks.schemas.js +0 -2
- package/core/api/models/messages.model.mongodb.js +13 -0
- package/core/api/services/authorisations/authorisations.service.js +13 -4
- package/core/api/services/index.js +19 -0
- package/core/api/services/messages/messages.hooks.js +38 -0
- package/core/client/api.js +7 -32
- package/core/client/capabilities.js +2 -2
- package/core/client/components/KActivity.vue +29 -6
- package/core/client/components/KContent.vue +2 -2
- package/core/client/components/KDialog.vue +4 -7
- package/core/client/components/KStamp.vue +3 -9
- package/core/client/components/KStore.vue +2 -4
- package/core/client/components/KTab.vue +95 -0
- package/core/client/components/action/KAction.vue +15 -2
- package/core/client/components/action/KBugReportAction.vue +4 -2
- package/core/client/components/action/KToggleFullscreenAction.vue +25 -0
- package/core/client/components/app/KSettings.vue +17 -13
- package/core/client/components/chart/KDataTable.vue +6 -9
- package/core/client/components/chart/KTimeSeriesChart.vue +62 -49
- package/core/client/components/collection/KBoard.vue +22 -33
- package/core/client/components/collection/KCard.vue +71 -56
- package/core/client/components/collection/KCardSection.vue +20 -10
- package/core/client/components/collection/KDescriptionCardSection.vue +47 -0
- package/core/client/components/collection/KGrid.vue +234 -54
- package/core/client/components/collection/KScrollDown.vue +97 -0
- package/core/client/components/collection/KScrollToTop.vue +93 -0
- package/core/client/components/collection/KTable.vue +87 -33
- package/core/client/components/collection/KTimeLine.vue +406 -0
- package/core/client/components/collection/index.js +1 -5
- package/core/client/components/document/KDocument.vue +20 -55
- package/core/client/components/document/KHtml.vue +17 -7
- package/core/client/components/document/KImage.vue +78 -0
- package/core/client/components/document/KMarkdown.vue +12 -16
- package/core/client/components/document/KPdf.vue +69 -0
- package/core/client/components/form/KFileField.vue +2 -2
- package/core/client/components/form/KSelectField.vue +2 -1
- package/core/client/components/form/KUnitField.vue +3 -1
- package/core/client/components/layout/KFab.vue +9 -10
- package/core/client/components/layout/KLayout.vue +104 -6
- package/core/client/components/layout/KOpener.vue +14 -19
- package/core/client/components/layout/KPage.vue +195 -105
- package/core/client/components/layout/KWindow.vue +54 -32
- package/core/client/components/layout/index.js +0 -2
- package/core/client/components/media/KRibbon.vue +95 -0
- package/core/client/components/menu/KMenu.vue +4 -4
- package/core/client/components/team/KGroupsActivity.vue +25 -27
- package/core/client/components/team/KMembersActivity.vue +21 -23
- package/core/client/components/team/KOrganisationsActivity.vue +20 -22
- package/core/client/components/team/KTagsActivity.vue +21 -23
- package/core/client/components/time/KAbsoluteTimeRange.vue +70 -170
- package/core/client/composables/activity.js +14 -12
- package/core/client/composables/collection.js +3 -1
- package/core/client/composables/counter.js +51 -0
- package/core/client/composables/index.js +3 -0
- package/core/client/composables/layout.js +13 -2
- package/core/client/composables/messages.js +15 -0
- package/core/client/composables/pwa.js +1 -1
- package/core/client/composables/schema.js +6 -6
- package/core/client/composables/screen.js +23 -0
- package/core/client/directives/index.js +1 -0
- package/core/client/directives/v-hover.js +23 -0
- package/core/client/document.js +61 -0
- package/core/client/exporter.js +1 -1
- package/core/client/filter.js +0 -1
- package/core/client/guards.js +1 -1
- package/core/client/i18n/core_en.json +14 -8
- package/core/client/i18n/core_fr.json +15 -9
- package/core/client/index.js +9 -3
- package/core/client/layout.js +129 -29
- package/core/client/local-storage.js +1 -1
- package/core/client/mixins/index.js +0 -1
- package/core/client/mixins/mixin.base-activity.js +23 -13
- package/core/client/mixins/mixin.base-item.js +6 -3
- package/core/client/services/index.js +4 -1
- package/core/client/services/local-settings.service.js +4 -0
- package/core/client/storage.js +1 -1
- package/core/client/store.js +1 -1
- package/core/client/template-context.js +17 -0
- package/core/client/units.js +49 -27
- package/core/client/utils/index.js +3 -2
- package/core/client/utils/utils.actions.js +4 -0
- package/core/client/utils/utils.colors.js +155 -2
- package/core/client/utils/utils.items.js +26 -0
- package/core/client/utils/utils.math.js +3 -0
- package/core/client/utils/utils.platform.js +3 -1
- package/core/client/utils/utils.screen.js +82 -0
- package/core/client/utils/utils.time.js +0 -1
- package/core/common/schemas/settings.update.json +12 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/core/api/application.js.html +1870 -0
- package/coverage/core/api/authentication.js.html +742 -0
- package/coverage/core/api/db.js.html +793 -0
- package/coverage/core/api/hooks/hooks.authentication.js.html +313 -0
- package/coverage/core/api/hooks/hooks.authorisations.js.html +1243 -0
- package/coverage/core/api/hooks/hooks.groups.js.html +229 -0
- package/coverage/core/api/hooks/hooks.logger.js.html +163 -0
- package/coverage/core/api/hooks/hooks.model.js.html +955 -0
- package/coverage/core/api/hooks/hooks.organisations.js.html +541 -0
- package/coverage/core/api/hooks/hooks.push.js.html +253 -0
- package/coverage/core/api/hooks/hooks.query.js.html +862 -0
- package/coverage/core/api/hooks/hooks.schemas.js.html +298 -0
- package/coverage/core/api/hooks/hooks.service.js.html +319 -0
- package/coverage/core/api/hooks/hooks.storage.js.html +193 -0
- package/coverage/core/api/hooks/hooks.users.js.html +868 -0
- package/coverage/core/api/hooks/index.html +296 -0
- package/coverage/core/api/hooks/index.js.html +121 -0
- package/coverage/core/api/index.html +191 -0
- package/coverage/core/api/index.js.html +148 -0
- package/coverage/core/api/marshall.js.html +448 -0
- package/coverage/core/api/models/groups.model.mongodb.js.html +109 -0
- package/coverage/core/api/models/index.html +176 -0
- package/coverage/core/api/models/messages.model.mongodb.js.html +121 -0
- package/coverage/core/api/models/organisations.model.mongodb.js.html +94 -0
- package/coverage/core/api/models/tags.model.mongodb.js.html +115 -0
- package/coverage/core/api/models/users.model.mongodb.js.html +115 -0
- package/coverage/core/api/services/account/account.hooks.js.html +208 -0
- package/coverage/core/api/services/account/account.service.js.html +436 -0
- package/coverage/core/api/services/account/index.html +131 -0
- package/coverage/core/api/services/authorisations/authorisations.hooks.js.html +184 -0
- package/coverage/core/api/services/authorisations/authorisations.service.js.html +529 -0
- package/coverage/core/api/services/authorisations/index.html +131 -0
- package/coverage/core/api/services/databases/databases.hooks.js.html +193 -0
- package/coverage/core/api/services/databases/databases.service.js.html +100 -0
- package/coverage/core/api/services/databases/index.html +131 -0
- package/coverage/core/api/services/groups/groups.hooks.js.html +178 -0
- package/coverage/core/api/services/groups/index.html +116 -0
- package/coverage/core/api/services/import-export/import-export.hooks.js.html +184 -0
- package/coverage/core/api/services/import-export/import-export.service.js.html +118 -0
- package/coverage/core/api/services/import-export/index.html +131 -0
- package/coverage/core/api/services/index.html +116 -0
- package/coverage/core/api/services/index.js.html +556 -0
- package/coverage/core/api/services/mailer/index.html +131 -0
- package/coverage/core/api/services/mailer/mailer.hooks.js.html +190 -0
- package/coverage/core/api/services/mailer/mailer.service.js.html +118 -0
- package/coverage/core/api/services/messages/index.html +116 -0
- package/coverage/core/api/services/messages/messages.hooks.js.html +199 -0
- package/coverage/core/api/services/organisations/index.html +131 -0
- package/coverage/core/api/services/organisations/organisations.hooks.js.html +178 -0
- package/coverage/core/api/services/organisations/organisations.service.js.html +343 -0
- package/coverage/core/api/services/push/index.html +131 -0
- package/coverage/core/api/services/push/push.hooks.js.html +190 -0
- package/coverage/core/api/services/push/push.service.js.html +121 -0
- package/coverage/core/api/services/storage/index.html +131 -0
- package/coverage/core/api/services/storage/storage.hooks.js.html +190 -0
- package/coverage/core/api/services/storage/storage.service.js.html +172 -0
- package/coverage/core/api/services/tags/index.html +116 -0
- package/coverage/core/api/services/tags/tags.hooks.js.html +178 -0
- package/coverage/core/api/services/users/index.html +116 -0
- package/coverage/core/api/services/users/users.hooks.js.html +307 -0
- package/coverage/core/api/utils.js.html +118 -0
- package/coverage/core/common/errors.js.html +88 -0
- package/coverage/core/common/index.html +176 -0
- package/coverage/core/common/index.js.html +115 -0
- package/coverage/core/common/permissions.js.html +1048 -0
- package/coverage/core/common/schema.js.html +190 -0
- package/coverage/core/common/utils.js.html +220 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +506 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/core/api/application.js.html +1870 -0
- package/coverage/lcov-report/core/api/authentication.js.html +742 -0
- package/coverage/lcov-report/core/api/db.js.html +793 -0
- package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +313 -0
- package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +1243 -0
- package/coverage/lcov-report/core/api/hooks/hooks.groups.js.html +229 -0
- package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +163 -0
- package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +955 -0
- package/coverage/lcov-report/core/api/hooks/hooks.organisations.js.html +541 -0
- package/coverage/lcov-report/core/api/hooks/hooks.push.js.html +253 -0
- package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +862 -0
- package/coverage/lcov-report/core/api/hooks/hooks.schemas.js.html +298 -0
- package/coverage/lcov-report/core/api/hooks/hooks.service.js.html +319 -0
- package/coverage/lcov-report/core/api/hooks/hooks.storage.js.html +193 -0
- package/coverage/lcov-report/core/api/hooks/hooks.users.js.html +868 -0
- package/coverage/lcov-report/core/api/hooks/index.html +296 -0
- package/coverage/lcov-report/core/api/hooks/index.js.html +121 -0
- package/coverage/lcov-report/core/api/index.html +191 -0
- package/coverage/lcov-report/core/api/index.js.html +148 -0
- package/coverage/lcov-report/core/api/marshall.js.html +448 -0
- package/coverage/lcov-report/core/api/models/groups.model.mongodb.js.html +109 -0
- package/coverage/lcov-report/core/api/models/index.html +176 -0
- package/coverage/lcov-report/core/api/models/messages.model.mongodb.js.html +121 -0
- package/coverage/lcov-report/core/api/models/organisations.model.mongodb.js.html +94 -0
- package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +115 -0
- package/coverage/lcov-report/core/api/models/users.model.mongodb.js.html +115 -0
- package/coverage/lcov-report/core/api/services/account/account.hooks.js.html +208 -0
- package/coverage/lcov-report/core/api/services/account/account.service.js.html +436 -0
- package/coverage/lcov-report/core/api/services/account/index.html +131 -0
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.hooks.js.html +184 -0
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.service.js.html +529 -0
- package/coverage/lcov-report/core/api/services/authorisations/index.html +131 -0
- package/coverage/lcov-report/core/api/services/databases/databases.hooks.js.html +193 -0
- package/coverage/lcov-report/core/api/services/databases/databases.service.js.html +100 -0
- package/coverage/lcov-report/core/api/services/databases/index.html +131 -0
- package/coverage/lcov-report/core/api/services/groups/groups.hooks.js.html +178 -0
- package/coverage/lcov-report/core/api/services/groups/index.html +116 -0
- package/coverage/lcov-report/core/api/services/import-export/import-export.hooks.js.html +184 -0
- package/coverage/lcov-report/core/api/services/import-export/import-export.service.js.html +118 -0
- package/coverage/lcov-report/core/api/services/import-export/index.html +131 -0
- package/coverage/lcov-report/core/api/services/index.html +116 -0
- package/coverage/lcov-report/core/api/services/index.js.html +556 -0
- package/coverage/lcov-report/core/api/services/mailer/index.html +131 -0
- package/coverage/lcov-report/core/api/services/mailer/mailer.hooks.js.html +190 -0
- package/coverage/lcov-report/core/api/services/mailer/mailer.service.js.html +118 -0
- package/coverage/lcov-report/core/api/services/messages/index.html +116 -0
- package/coverage/lcov-report/core/api/services/messages/messages.hooks.js.html +199 -0
- package/coverage/lcov-report/core/api/services/organisations/index.html +131 -0
- package/coverage/lcov-report/core/api/services/organisations/organisations.hooks.js.html +178 -0
- package/coverage/lcov-report/core/api/services/organisations/organisations.service.js.html +343 -0
- package/coverage/lcov-report/core/api/services/push/index.html +131 -0
- package/coverage/lcov-report/core/api/services/push/push.hooks.js.html +190 -0
- package/coverage/lcov-report/core/api/services/push/push.service.js.html +121 -0
- package/coverage/lcov-report/core/api/services/storage/index.html +131 -0
- package/coverage/lcov-report/core/api/services/storage/storage.hooks.js.html +190 -0
- package/coverage/lcov-report/core/api/services/storage/storage.service.js.html +172 -0
- package/coverage/lcov-report/core/api/services/tags/index.html +116 -0
- package/coverage/lcov-report/core/api/services/tags/tags.hooks.js.html +178 -0
- package/coverage/lcov-report/core/api/services/users/index.html +116 -0
- package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +307 -0
- package/coverage/lcov-report/core/api/utils.js.html +118 -0
- package/coverage/lcov-report/core/common/errors.js.html +88 -0
- package/coverage/lcov-report/core/common/index.html +176 -0
- package/coverage/lcov-report/core/common/index.js.html +115 -0
- package/coverage/lcov-report/core/common/permissions.js.html +1048 -0
- package/coverage/lcov-report/core/common/schema.js.html +190 -0
- package/coverage/lcov-report/core/common/utils.js.html +220 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +506 -0
- package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +457 -0
- package/coverage/lcov-report/map/api/hooks/hooks.features.js.html +397 -0
- package/coverage/lcov-report/map/api/hooks/hooks.query.js.html +1309 -0
- package/coverage/lcov-report/map/api/hooks/index.html +161 -0
- package/coverage/lcov-report/map/api/hooks/index.js.html +94 -0
- package/coverage/lcov-report/map/api/index.html +131 -0
- package/coverage/lcov-report/map/api/index.js.html +139 -0
- package/coverage/lcov-report/map/api/marshall.js.html +178 -0
- package/coverage/lcov-report/map/api/models/alerts.model.mongodb.js.html +106 -0
- package/coverage/lcov-report/map/api/models/catalog.model.mongodb.js.html +127 -0
- package/coverage/lcov-report/map/api/models/features.model.mongodb.js.html +196 -0
- package/coverage/lcov-report/map/api/models/index.html +161 -0
- package/coverage/lcov-report/map/api/models/projects.model.mongodb.js.html +109 -0
- package/coverage/lcov-report/map/api/services/alerts/alerts.hooks.js.html +274 -0
- package/coverage/lcov-report/map/api/services/alerts/alerts.service.js.html +610 -0
- package/coverage/lcov-report/map/api/services/alerts/index.html +131 -0
- package/coverage/lcov-report/map/api/services/catalog/catalog.hooks.js.html +310 -0
- package/coverage/lcov-report/map/api/services/catalog/index.html +116 -0
- package/coverage/lcov-report/map/api/services/daptiles/daptiles.service.js.html +1510 -0
- package/coverage/lcov-report/map/api/services/daptiles/index.html +116 -0
- package/coverage/lcov-report/map/api/services/features/features.hooks.js.html +241 -0
- package/coverage/lcov-report/map/api/services/features/features.service.js.html +241 -0
- package/coverage/lcov-report/map/api/services/features/index.html +131 -0
- package/coverage/lcov-report/map/api/services/index.html +116 -0
- package/coverage/lcov-report/map/api/services/index.js.html +817 -0
- package/coverage/lcov-report/map/api/services/projects/index.html +116 -0
- package/coverage/lcov-report/map/api/services/projects/projects.hooks.js.html +439 -0
- package/coverage/lcov-report/map/common/dynamic-grid-source.js.html +466 -0
- package/coverage/lcov-report/map/common/errors.js.html +94 -0
- package/coverage/lcov-report/map/common/geotiff-grid-source.js.html +541 -0
- package/coverage/lcov-report/map/common/grid.js.html +1612 -0
- package/coverage/lcov-report/map/common/index.html +371 -0
- package/coverage/lcov-report/map/common/index.js.html +172 -0
- package/coverage/lcov-report/map/common/meteo-model-grid-source.js.html +556 -0
- package/coverage/lcov-report/map/common/moment-utils.js.html +157 -0
- package/coverage/lcov-report/map/common/opendap-grid-source.js.html +868 -0
- package/coverage/lcov-report/map/common/opendap-utils.js.html +826 -0
- package/coverage/lcov-report/map/common/permissions.js.html +124 -0
- package/coverage/lcov-report/map/common/time-based-grid-source.js.html +418 -0
- package/coverage/lcov-report/map/common/tms-utils.js.html +274 -0
- package/coverage/lcov-report/map/common/wcs-grid-source.js.html +364 -0
- package/coverage/lcov-report/map/common/wcs-utils.js.html +586 -0
- package/coverage/lcov-report/map/common/weacast-grid-source.js.html +1033 -0
- package/coverage/lcov-report/map/common/wfs-utils.js.html +574 -0
- package/coverage/lcov-report/map/common/wms-utils.js.html +451 -0
- package/coverage/lcov-report/map/common/wmts-utils.js.html +547 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov.info +11245 -0
- package/coverage/map/api/hooks/hooks.catalog.js.html +457 -0
- package/coverage/map/api/hooks/hooks.features.js.html +397 -0
- package/coverage/map/api/hooks/hooks.query.js.html +1309 -0
- package/coverage/map/api/hooks/index.html +161 -0
- package/coverage/map/api/hooks/index.js.html +94 -0
- package/coverage/map/api/index.html +131 -0
- package/coverage/map/api/index.js.html +139 -0
- package/coverage/map/api/marshall.js.html +178 -0
- package/coverage/map/api/models/alerts.model.mongodb.js.html +106 -0
- package/coverage/map/api/models/catalog.model.mongodb.js.html +127 -0
- package/coverage/map/api/models/features.model.mongodb.js.html +196 -0
- package/coverage/map/api/models/index.html +161 -0
- package/coverage/map/api/models/projects.model.mongodb.js.html +109 -0
- package/coverage/map/api/services/alerts/alerts.hooks.js.html +274 -0
- package/coverage/map/api/services/alerts/alerts.service.js.html +610 -0
- package/coverage/map/api/services/alerts/index.html +131 -0
- package/coverage/map/api/services/catalog/catalog.hooks.js.html +310 -0
- package/coverage/map/api/services/catalog/index.html +116 -0
- package/coverage/map/api/services/daptiles/daptiles.service.js.html +1510 -0
- package/coverage/map/api/services/daptiles/index.html +116 -0
- package/coverage/map/api/services/features/features.hooks.js.html +241 -0
- package/coverage/map/api/services/features/features.service.js.html +241 -0
- package/coverage/map/api/services/features/index.html +131 -0
- package/coverage/map/api/services/index.html +116 -0
- package/coverage/map/api/services/index.js.html +817 -0
- package/coverage/map/api/services/projects/index.html +116 -0
- package/coverage/map/api/services/projects/projects.hooks.js.html +439 -0
- package/coverage/map/common/dynamic-grid-source.js.html +466 -0
- package/coverage/map/common/errors.js.html +94 -0
- package/coverage/map/common/geotiff-grid-source.js.html +541 -0
- package/coverage/map/common/grid.js.html +1612 -0
- package/coverage/map/common/index.html +371 -0
- package/coverage/map/common/index.js.html +172 -0
- package/coverage/map/common/meteo-model-grid-source.js.html +556 -0
- package/coverage/map/common/moment-utils.js.html +157 -0
- package/coverage/map/common/opendap-grid-source.js.html +868 -0
- package/coverage/map/common/opendap-utils.js.html +826 -0
- package/coverage/map/common/permissions.js.html +124 -0
- package/coverage/map/common/time-based-grid-source.js.html +418 -0
- package/coverage/map/common/tms-utils.js.html +274 -0
- package/coverage/map/common/wcs-grid-source.js.html +364 -0
- package/coverage/map/common/wcs-utils.js.html +586 -0
- package/coverage/map/common/weacast-grid-source.js.html +1033 -0
- package/coverage/map/common/wfs-utils.js.html +574 -0
- package/coverage/map/common/wms-utils.js.html +451 -0
- package/coverage/map/common/wmts-utils.js.html +547 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +196 -0
- package/coverage/tmp/coverage-280506-1731704745613-0.json +1 -0
- package/coverage/tmp/coverage-280518-1731704745599-0.json +1 -0
- package/coverage/tmp/coverage-280529-1731704745588-0.json +1 -0
- package/coverage/tmp/coverage-280541-1731704745574-0.json +1 -0
- package/coverage/tmp/coverage-280548-1731704745545-0.json +1 -0
- package/extras/css/core.variables.scss +32 -8
- package/extras/icons/attribution.png +0 -0
- package/map/api/services/catalog/catalog.hooks.js +5 -7
- package/map/api/services/features/features.hooks.js +1 -1
- package/map/client/cesium/utils/utils.style.js +11 -2
- package/map/client/components/KAttribution.vue +108 -0
- package/map/client/components/KPositionIndicator.vue +11 -18
- package/map/client/components/KProjectMenu.vue +4 -4
- package/map/client/components/catalog/KCategoryItem.vue +74 -0
- package/map/client/components/catalog/KLayerCategories.vue +24 -12
- package/map/client/components/catalog/KLayersPanel.vue +139 -116
- package/map/client/components/catalog/KProjectSelector.vue +29 -17
- package/map/client/components/catalog/KProjectsPanel.vue +19 -35
- package/map/client/components/catalog/KViewSelector.vue +37 -25
- package/map/client/components/catalog/KViewsPanel.vue +19 -35
- package/map/client/components/form/KLocationField.vue +1 -2
- package/map/client/components/legend/KLegend.vue +34 -34
- package/map/client/components/location/KLocationCardSection.vue +18 -22
- package/map/client/components/location/KLocationMap.vue +36 -38
- package/map/client/components/location/KLocationTimeLineCard.vue +147 -0
- package/map/client/components/location/KLocationTip.vue +12 -2
- package/map/client/components/widget/KInformationBox.vue +0 -4
- package/map/client/components/widget/KStackableTimeSeries.vue +8 -1
- package/map/client/components/widget/KTimeSeries.vue +1 -1
- package/map/client/composables/highlight.js +29 -31
- package/map/client/composables/probe.js +7 -3
- package/map/client/composables/weather.js +71 -31
- package/map/client/i18n/map_en.json +3 -0
- package/map/client/i18n/map_fr.json +3 -0
- package/map/client/init.js +4 -3
- package/map/client/leaflet/ShapeMarker.js +1 -1
- package/map/client/leaflet/utils/utils.events.js +1 -1
- package/map/client/leaflet/utils/utils.style.js +20 -8
- package/map/client/mixins/globe/mixin.base-globe.js +111 -13
- package/map/client/mixins/globe/mixin.file-layers.js +10 -10
- package/map/client/mixins/globe/mixin.geojson-layers.js +90 -15
- package/map/client/mixins/globe/mixin.style.js +2 -0
- package/map/client/mixins/index.js +0 -1
- package/map/client/mixins/map/index.js +1 -0
- package/map/client/mixins/map/mixin.base-map.js +21 -2
- package/map/client/mixins/map/mixin.canvas-layers.js +7 -2
- package/map/client/mixins/map/mixin.edit-layers.js +12 -4
- package/map/client/mixins/map/mixin.file-layers.js +3 -0
- package/map/client/mixins/map/mixin.geojson-layers.js +90 -5
- package/map/client/mixins/map/mixin.pmtiles-layers.js +106 -0
- package/map/client/mixins/mixin.activity.js +8 -3
- package/map/client/mixins/mixin.feature-service.js +73 -32
- package/map/client/mixins/mixin.levels.js +1 -0
- package/map/client/mixins/mixin.weacast.js +10 -87
- package/map/client/utils/index.js +1 -0
- package/map/client/utils/utils.capture.js +1 -1
- package/map/client/utils/utils.catalog.js +7 -7
- package/map/client/utils/utils.features.js +59 -1
- package/map/client/utils/utils.layers.js +8 -0
- package/map/client/utils/utils.time-series.js +121 -0
- package/map/client/utils/utils.weacast.js +102 -0
- package/package.json +6 -6
- package/scripts/init_runner.sh +2 -2
- package/scripts/kash/CHANGELOG.md +12 -0
- package/scripts/kash/README.md +2 -0
- package/scripts/kash/kash.sh +34 -32
- package/scripts/run_tests.sh +2 -2
- package/scripts/setup_workspace.sh +24 -6
- package/test/api/core/hooks.test.js +6 -3
- package/test/api/core/test-log-2023-12-19.log +7 -0
- package/test/api/core/test-log-2024-01-04.log +14 -0
- package/test/api/core/test-log-2024-05-14.log +6 -0
- package/test/api/core/{test-log-2024-04-23.log → test-log-2024-06-06.log} +3 -3
- package/test/api/core/test-log-2024-06-26.log +25 -0
- package/test/api/core/test-log-2024-06-28.log +2 -0
- package/test/api/core/test-log-2024-07-09.log +0 -0
- package/test/api/core/test-log-2024-08-13.log +69 -0
- package/test/api/core/test-log-2024-10-28.log +53 -0
- package/test/api/core/test-log-2024-11-05.log +30 -0
- package/test/api/core/test-log-2024-11-15.log +23 -0
- package/test/api/map/alerts.test.js +3 -1
- package/test/api/map/config/layers.json +3 -1
- package/test/api/map/index.test.js +18 -1
- package/test/api/map/test-log-2023-11-24.log +121 -0
- package/test/api/map/test-log-2023-12-12.log +29 -0
- package/test/api/map/test-log-2023-12-13.log +5 -0
- package/test/api/map/test-log-2024-01-04.log +2 -0
- package/test/api/map/test-log-2024-01-11.log +1 -0
- package/test/api/map/test-log-2024-01-25.log +19 -0
- package/test/api/map/test-log-2024-06-06.log +39 -0
- package/test/api/map/test-log-2024-08-13.log +13 -0
- package/test/api/map/test-log-2024-08-20.log +55 -0
- package/test/api/map/test-log-2024-09-09.log +92 -0
- package/test/api/map/test-log-2024-10-28.log +11 -0
- package/test/client/core/utils.js +13 -0
- package/test/client/map/api.js +34 -0
- package/test/client/map/catalog.js +6 -2
- package/test/client/map/index.js +1 -0
- package/test/client/map/utils.js +4 -2
- package/core/client/components/collection/KList.vue +0 -135
- package/core/client/components/layout/KPageSticky.vue +0 -53
- package/core/client/mixins/mixin.base-collection.js +0 -162
- package/core/client/utils/utils.data.js +0 -22
- package/map/client/mixins/mixin.catalog-panel.js +0 -26
- package/test/api/core/test-log-2024-04-22.log +0 -84
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/>
|
|
10
|
-
</Suspense>
|
|
2
|
+
<KForm
|
|
3
|
+
id="settings"
|
|
4
|
+
ref="formRef"
|
|
5
|
+
:values="settings"
|
|
6
|
+
:schema="schema"
|
|
7
|
+
:filter="schemaFilter"
|
|
8
|
+
/>
|
|
11
9
|
</template>
|
|
12
10
|
|
|
13
11
|
<script setup>
|
|
14
12
|
import _ from 'lodash'
|
|
15
|
-
import { ref } from 'vue'
|
|
13
|
+
import { ref, onMounted } from 'vue'
|
|
16
14
|
import { api } from '../../api.js'
|
|
17
15
|
import KForm from '../form/KForm.vue'
|
|
18
16
|
|
|
@@ -21,6 +19,7 @@ const serviceSettings = api.getService('settings')
|
|
|
21
19
|
const formRef = ref(null)
|
|
22
20
|
const settings = ref(null)
|
|
23
21
|
const schemaFilter = ref(null)
|
|
22
|
+
const schema = ref('settings.update')
|
|
24
23
|
|
|
25
24
|
// Functions
|
|
26
25
|
async function apply () {
|
|
@@ -31,10 +30,15 @@ async function apply () {
|
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
|
|
33
|
+
// Hooks
|
|
34
|
+
onMounted(async () => {
|
|
35
|
+
settings.value = await serviceSettings.get('settings')
|
|
36
|
+
const mapping = serviceSettings.getSettingsMapping()
|
|
37
|
+
schemaFilter.value = Object.keys(mapping).filter(value => _.get(mapping, value))
|
|
38
|
+
})
|
|
39
|
+
|
|
34
40
|
// Immediate
|
|
35
|
-
|
|
36
|
-
const mapping = serviceSettings.getSettingsMapping()
|
|
37
|
-
schemaFilter.value = Object.keys(mapping).filter(value => _.get(mapping, value))
|
|
41
|
+
schema.value = serviceSettings.getSchema()
|
|
38
42
|
|
|
39
43
|
// Expose
|
|
40
44
|
defineExpose({
|
|
@@ -30,7 +30,7 @@ import _ from 'lodash'
|
|
|
30
30
|
import moment from 'moment'
|
|
31
31
|
import Papa from 'papaparse'
|
|
32
32
|
import { ref, watch } from 'vue'
|
|
33
|
-
import { downloadAsBlob
|
|
33
|
+
import { downloadAsBlob } from '../../utils'
|
|
34
34
|
import { useSchema } from '../../composables'
|
|
35
35
|
import { Units } from '../../units.js'
|
|
36
36
|
import { Time } from '../../time.js'
|
|
@@ -71,25 +71,23 @@ const height = ref(0)
|
|
|
71
71
|
// Used to store template compilers per field
|
|
72
72
|
const compilers = {}
|
|
73
73
|
const exportCompilers = {}
|
|
74
|
-
let propertiesToConvert = []
|
|
75
74
|
|
|
76
75
|
// Watch
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
// We use debounce here to avoid multiple refresh when initializing props
|
|
77
|
+
const requestUpdate = _.debounce(() => update(), 250)
|
|
78
|
+
watch(() => props.tables, requestUpdate)
|
|
79
|
+
watch(() => props.schema, requestUpdate)
|
|
79
80
|
|
|
80
81
|
// Functions
|
|
81
82
|
async function update () {
|
|
82
83
|
await compile(props.schema)
|
|
83
84
|
columns.value = []
|
|
84
85
|
const invisibleColumns = []
|
|
85
|
-
propertiesToConvert = []
|
|
86
86
|
_.forOwn(schema.value.properties, (value, key) => {
|
|
87
87
|
const type = _.get(value, 'type')
|
|
88
88
|
// FIXME: allow for custom representation of complex objects
|
|
89
89
|
if (type === 'object') return
|
|
90
90
|
const label = _.get(value, 'field.label', _.get(value, 'field.helper', key))
|
|
91
|
-
const convertToDefaultUnit = _.get(value, 'field.defaultUnit', false)
|
|
92
|
-
if (convertToDefaultUnit) propertiesToConvert.push(key)
|
|
93
91
|
const visible = _.get(value, 'field.visible', true)
|
|
94
92
|
if (!visible) invisibleColumns.push(key)
|
|
95
93
|
const formatter = _.has(value, 'field.formatter') ? _.get(props.formatters, value.field.formatter) : null
|
|
@@ -135,7 +133,6 @@ async function update () {
|
|
|
135
133
|
rows.value = []
|
|
136
134
|
for (const table of props.tables) {
|
|
137
135
|
const data = await table.data
|
|
138
|
-
convertTimeSerie(data, table.variable, propertiesToConvert)
|
|
139
136
|
rows.value = rows.value.concat(data)
|
|
140
137
|
}
|
|
141
138
|
}
|
|
@@ -148,7 +145,6 @@ async function exportData (options = {}) {
|
|
|
148
145
|
for (let i = 0; i < props.tables.length; i++) {
|
|
149
146
|
const table = props.tables[i]
|
|
150
147
|
const data = await table.data
|
|
151
|
-
await convertTimeSerie(data, table.variable, propertiesToConvert)
|
|
152
148
|
for (const item of data) {
|
|
153
149
|
const row = {}
|
|
154
150
|
_.forOwn(schema.value.properties, (value, key) => {
|
|
@@ -187,6 +183,7 @@ update()
|
|
|
187
183
|
// Exposed
|
|
188
184
|
defineExpose({
|
|
189
185
|
update,
|
|
186
|
+
requestUpdate,
|
|
190
187
|
exportData
|
|
191
188
|
})
|
|
192
189
|
</script>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="fit">
|
|
2
|
+
<div class="fit position-relative">
|
|
3
3
|
<canvas :ref="onCanvasRef" />
|
|
4
|
+
<KStamp v-if="!hasData" icon="las la-exclamation-circle" icon-size="3rem"
|
|
5
|
+
:text="$t('KTimeSeriesChart.NO_DATA_AVAILABLE')" text-size="1rem" class="absolute-center" />
|
|
4
6
|
</div>
|
|
5
7
|
</template>
|
|
6
8
|
|
|
@@ -47,36 +49,31 @@ const emit = defineEmits(['zoom-start', 'zoom-end', 'legend-click'])
|
|
|
47
49
|
let canvas = null
|
|
48
50
|
let chart = null
|
|
49
51
|
const unit2axis = new Map()
|
|
52
|
+
const hasData = ref(false)
|
|
53
|
+
// Min/Max time (ie for x axis)
|
|
50
54
|
const startTime = ref(props.startTime ? moment.utc(props.startTime) : null)
|
|
51
55
|
const endTime = ref(props.endTime ? moment.utc(props.endTime) : null)
|
|
52
|
-
|
|
53
|
-
let
|
|
56
|
+
// Min/max value by unit (ie for y axes)
|
|
57
|
+
let min = {}
|
|
58
|
+
let max = {}
|
|
54
59
|
|
|
55
60
|
// Watch
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
watch(() => props.
|
|
59
|
-
watch(() => props.
|
|
60
|
-
watch(() => props.
|
|
61
|
-
watch(() => props.
|
|
62
|
-
watch(() => props.
|
|
63
|
-
watch(() => props.
|
|
64
|
-
watch(() => props.
|
|
61
|
+
// We use debounce here to avoid multiple refresh when initializing props
|
|
62
|
+
const requestUpdate = _.debounce(() => update(), 250)
|
|
63
|
+
watch(() => props.timeSeries, requestUpdate)
|
|
64
|
+
watch(() => props.xAxisKey, requestUpdate)
|
|
65
|
+
watch(() => props.yAxisKey, requestUpdate)
|
|
66
|
+
watch(() => props.startTime, requestUpdate)
|
|
67
|
+
watch(() => props.endTime, requestUpdate)
|
|
68
|
+
watch(() => props.zoomable, requestUpdate)
|
|
69
|
+
watch(() => props.logarithmic, requestUpdate)
|
|
70
|
+
watch(() => props.currentTime, requestUpdate)
|
|
71
|
+
watch(() => props.options, requestUpdate)
|
|
65
72
|
|
|
66
73
|
// Functions
|
|
67
74
|
async function onCanvasRef (ref) {
|
|
68
|
-
if (ref) {
|
|
69
|
-
if (!chart) {
|
|
70
|
-
const config = await makeChartConfig()
|
|
71
|
-
chart = new Chart(ref.getContext('2d'), config)
|
|
72
|
-
}
|
|
73
|
-
} else {
|
|
74
|
-
if (chart) {
|
|
75
|
-
chart.destroy()
|
|
76
|
-
chart = null
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
75
|
canvas = ref
|
|
76
|
+
update()
|
|
80
77
|
}
|
|
81
78
|
function getUnit (timeSerie) {
|
|
82
79
|
return _.get(timeSerie, 'variable.unit')
|
|
@@ -84,9 +81,6 @@ function getUnit (timeSerie) {
|
|
|
84
81
|
function getTargetUnit (timeSerie) {
|
|
85
82
|
return _.get(timeSerie, 'variable.targetUnit')
|
|
86
83
|
}
|
|
87
|
-
function setUnit (timeserie, targetUnit) {
|
|
88
|
-
_.set(timeserie, 'variable.unit', targetUnit)
|
|
89
|
-
}
|
|
90
84
|
function getZoom () {
|
|
91
85
|
const start = moment.utc(_.get(chart, 'scales.x.min'))
|
|
92
86
|
const end = moment.utc(_.get(chart, 'scales.x.max'))
|
|
@@ -112,7 +106,9 @@ function computeScaleBound (scale, property, min, max) {
|
|
|
112
106
|
async function makeChartConfig () {
|
|
113
107
|
// Order matters as we compute internals like data time range
|
|
114
108
|
const datasets = await makeDatasets()
|
|
115
|
-
|
|
109
|
+
// No data ?
|
|
110
|
+
if (_.isEmpty(datasets)) return null
|
|
111
|
+
const scales = makeScales(datasets)
|
|
116
112
|
const annotation = makeAnnotation()
|
|
117
113
|
const config = {
|
|
118
114
|
type: 'line',
|
|
@@ -194,7 +190,7 @@ async function makeChartConfig () {
|
|
|
194
190
|
computeScaleBound(scales.x, 'suggestedMax', startTime.value, endTime.value)
|
|
195
191
|
return config
|
|
196
192
|
}
|
|
197
|
-
function makeScales () {
|
|
193
|
+
function makeScales (datasets) {
|
|
198
194
|
// Setup time ticks unit
|
|
199
195
|
const hours = endTime.value.diff(startTime.value, 'hours')
|
|
200
196
|
const days = endTime.value.diff(startTime.value, 'days')
|
|
@@ -247,30 +243,36 @@ function makeScales () {
|
|
|
247
243
|
let axisId = 0
|
|
248
244
|
for (const timeSerie of props.timeSeries) {
|
|
249
245
|
const unit = getUnit(timeSerie)
|
|
250
|
-
const targetUnit = getTargetUnit(timeSerie)
|
|
251
|
-
|
|
246
|
+
const targetUnit = getTargetUnit(timeSerie)
|
|
247
|
+
const unitName = (targetUnit ? targetUnit.name : unit.name)
|
|
248
|
+
if (!unit2axis.has(unitName)) {
|
|
249
|
+
// Ensure a related dataset does exist
|
|
250
|
+
const axisDatasets = _.filter(datasets, dataset => (_.get(dataset, 'targetUnit.name', _.get(dataset, 'unit.name')) === unitName))
|
|
251
|
+
if (axisDatasets.length === 0) continue
|
|
252
252
|
const axis = `y${axisId}`
|
|
253
|
-
|
|
253
|
+
// Set axis to related datasets
|
|
254
|
+
axisDatasets.forEach(dataset => Object.assign(dataset, { yAxisID: axis }))
|
|
255
|
+
unit2axis.set(unitName, axis)
|
|
254
256
|
scales[axis] = _.merge({
|
|
255
|
-
targetUnit: targetUnit.name,
|
|
256
257
|
type: props.logarithmic ? 'logarithmic' : 'linear',
|
|
257
258
|
position: (axisId + 1) % 2 ? 'left' : 'right',
|
|
258
259
|
title: {
|
|
259
260
|
display: true,
|
|
260
|
-
text: i18n.tie(targetUnit.symbol)
|
|
261
|
+
text: i18n.tie(targetUnit ? targetUnit.symbol : unit.symbol)
|
|
261
262
|
},
|
|
262
263
|
ticks: {
|
|
263
264
|
callback: function (value, index, values) {
|
|
264
265
|
if (values[index] !== undefined) {
|
|
266
|
+
// We do not convert using units here as data should have already be converted
|
|
265
267
|
return Units.format(values[index].value, null, null, { symbol: false })
|
|
266
268
|
}
|
|
267
269
|
}
|
|
268
270
|
}
|
|
269
271
|
}, _.get(timeSerie.variable.chartjs, 'yAxis', {}))
|
|
270
|
-
computeScaleBound(scales[axis], 'min', min, max)
|
|
271
|
-
computeScaleBound(scales[axis], 'max', min, max)
|
|
272
|
-
computeScaleBound(scales[axis], 'suggestedMin', min, max)
|
|
273
|
-
computeScaleBound(scales[axis], 'suggestedMax', min, max)
|
|
272
|
+
computeScaleBound(scales[axis], 'min', min[unitName], max[unitName])
|
|
273
|
+
computeScaleBound(scales[axis], 'max', min[unitName], max[unitName])
|
|
274
|
+
computeScaleBound(scales[axis], 'suggestedMin', min[unitName], max[unitName])
|
|
275
|
+
computeScaleBound(scales[axis], 'suggestedMax', min[unitName], max[unitName])
|
|
274
276
|
++axisId
|
|
275
277
|
}
|
|
276
278
|
}
|
|
@@ -282,28 +284,28 @@ async function makeDatasets () {
|
|
|
282
284
|
const label = _.get(timeSerie, 'variable.label')
|
|
283
285
|
const unit = getUnit(timeSerie)
|
|
284
286
|
const targetUnit = getTargetUnit(timeSerie)
|
|
285
|
-
if (targetUnit) setUnit(timeSerie, targetUnit)
|
|
286
287
|
const data = await timeSerie.data
|
|
288
|
+
// No data ?
|
|
289
|
+
if (_.isEmpty(data)) continue
|
|
290
|
+
const unitName = (targetUnit ? targetUnit.name : unit.name)
|
|
287
291
|
const dataset = Object.assign({
|
|
288
292
|
label,
|
|
289
293
|
data,
|
|
290
294
|
unit,
|
|
291
|
-
targetUnit
|
|
292
|
-
yAxisID: unit2axis.get(unit.name)
|
|
295
|
+
targetUnit
|
|
293
296
|
}, _.omit(_.get(timeSerie, 'variable.chartjs', {}), 'yAxis'))
|
|
294
297
|
const xAxisKey = _.get(dataset, 'parsing.xAxisKey', props.xAxisKey)
|
|
295
298
|
const yAxisKey = _.get(dataset, 'parsing.yAxisKey', props.yAxisKey)
|
|
296
299
|
// Update time/value range
|
|
297
300
|
data.forEach(item => {
|
|
298
301
|
const time = moment.utc(_.get(item, xAxisKey))
|
|
299
|
-
|
|
300
|
-
if (
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
_.
|
|
302
|
+
// Take zero into account
|
|
303
|
+
if (_.has(item, yAxisKey)) {
|
|
304
|
+
const value = _.get(item, yAxisKey)
|
|
305
|
+
if (_.isFinite(value)) {
|
|
306
|
+
if (_.isNil(min[unitName]) || (value < min[unitName])) min[unitName] = value
|
|
307
|
+
if (_.isNil(max[unitName]) || (value > max[unitName])) max[unitName] = value
|
|
304
308
|
}
|
|
305
|
-
if (_.isNil(min) || (value < min)) min = value
|
|
306
|
-
if (_.isNil(max) || (value > max)) max = value
|
|
307
309
|
if (!props.startTime) {
|
|
308
310
|
if (!startTime.value || time.isBefore(startTime.value)) startTime.value = time
|
|
309
311
|
}
|
|
@@ -398,12 +400,22 @@ async function update () {
|
|
|
398
400
|
// Reset time/value range
|
|
399
401
|
startTime.value = (props.startTime ? moment.utc(props.startTime) : null)
|
|
400
402
|
endTime.value = (props.endTime ? moment.utc(props.endTime) : null)
|
|
401
|
-
min =
|
|
402
|
-
max =
|
|
403
|
+
min = {}
|
|
404
|
+
max = {}
|
|
403
405
|
|
|
404
406
|
const config = await makeChartConfig()
|
|
407
|
+
if (!config) {
|
|
408
|
+
if (chart) {
|
|
409
|
+
chart.clear()
|
|
410
|
+
chart.destroy()
|
|
411
|
+
}
|
|
412
|
+
chart = null
|
|
413
|
+
hasData.value = false
|
|
414
|
+
return
|
|
415
|
+
}
|
|
405
416
|
if (!chart) {
|
|
406
417
|
chart = new Chart(canvas.getContext('2d'), config)
|
|
418
|
+
hasData.value = true
|
|
407
419
|
} else {
|
|
408
420
|
Object.assign(chart, config)
|
|
409
421
|
chart.update()
|
|
@@ -425,6 +437,7 @@ onBeforeUnmount(() => {
|
|
|
425
437
|
// Expose
|
|
426
438
|
defineExpose({
|
|
427
439
|
update,
|
|
440
|
+
requestUpdate,
|
|
428
441
|
getZoom,
|
|
429
442
|
exportSeries
|
|
430
443
|
})
|
|
@@ -1,48 +1,32 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<div class="
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class: 'justify-center'
|
|
18
|
-
}, {
|
|
19
|
-
component: 'QSpace'
|
|
20
|
-
}]"
|
|
21
|
-
v-bind="column.props"
|
|
22
|
-
:height="height"
|
|
23
|
-
:width="column.width"
|
|
24
|
-
:style="{ minWidth: `${column.width}px`, maxWidth: `${column.width}px` }"
|
|
25
|
-
>
|
|
26
|
-
</KColumn>
|
|
27
|
-
</template>
|
|
28
|
-
<div class="col-*" />
|
|
29
|
-
</div>
|
|
2
|
+
<q-scroll-area class="fit">
|
|
3
|
+
<div class="fit row justify-between q-gutter-x-sm no-wrap">
|
|
4
|
+
<template v-for="column in columns" :key="column.value">
|
|
5
|
+
<KGrid
|
|
6
|
+
ref="columnRefs"
|
|
7
|
+
:id="column.value"
|
|
8
|
+
:name="column.value"
|
|
9
|
+
v-bind="column.props"
|
|
10
|
+
:append-items="true"
|
|
11
|
+
:header="getHeader(column.label)"
|
|
12
|
+
headerClass="full-width justify-center"
|
|
13
|
+
/>
|
|
14
|
+
</template>
|
|
15
|
+
</div>
|
|
16
|
+
</q-scroll-area>
|
|
30
17
|
</template>
|
|
31
18
|
|
|
32
19
|
<script setup>
|
|
33
20
|
import _ from 'lodash'
|
|
34
21
|
import { ref } from 'vue'
|
|
35
|
-
import
|
|
22
|
+
import { i18n } from '../../i18n.js'
|
|
23
|
+
import KGrid from './KGrid.vue'
|
|
36
24
|
|
|
37
25
|
// Props
|
|
38
26
|
defineProps({
|
|
39
27
|
columns: {
|
|
40
28
|
type: Array,
|
|
41
29
|
default: () => null
|
|
42
|
-
},
|
|
43
|
-
height: {
|
|
44
|
-
type: Number,
|
|
45
|
-
required: true
|
|
46
30
|
}
|
|
47
31
|
})
|
|
48
32
|
|
|
@@ -56,6 +40,11 @@ function getColumn (value) {
|
|
|
56
40
|
function getColumns (values) {
|
|
57
41
|
return values.map(value => getColumn(value))
|
|
58
42
|
}
|
|
43
|
+
function getHeader (label) {
|
|
44
|
+
return [{
|
|
45
|
+
component: 'QChip', label: i18n.tie(label), color: 'grey-10', 'text-color': 'white', square: true
|
|
46
|
+
}]
|
|
47
|
+
}
|
|
59
48
|
|
|
60
49
|
// Expose
|
|
61
50
|
defineExpose({
|
|
@@ -9,22 +9,22 @@
|
|
|
9
9
|
-->
|
|
10
10
|
<div v-if="hasHeader">
|
|
11
11
|
<div v-bind:class="{ 'q-px-sm q-pt-xs': dense, 'q-px-md q-pt-sm': !dense }">
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/>
|
|
19
|
-
</slot>
|
|
12
|
+
<KPanel
|
|
13
|
+
id="card-header-panel"
|
|
14
|
+
:content="computedHeader"
|
|
15
|
+
:context="$props"
|
|
16
|
+
class="full-width no-wrap"
|
|
17
|
+
/>
|
|
20
18
|
</div>
|
|
21
19
|
</div>
|
|
22
20
|
<!--
|
|
23
|
-
|
|
21
|
+
Heading section
|
|
24
22
|
-->
|
|
25
|
-
<div
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
<div
|
|
24
|
+
class="column full-width"
|
|
25
|
+
v-bind:class="{ 'q-px-sm q-pt-xs': dense, 'q-px-md q-pt-sm': !dense }"
|
|
26
|
+
>
|
|
27
|
+
<slot name="card-heading">
|
|
28
28
|
<div class="row full-width items-center no-wrap">
|
|
29
29
|
<div
|
|
30
30
|
v-if="avatar"
|
|
@@ -47,54 +47,56 @@
|
|
|
47
47
|
</div>
|
|
48
48
|
</div>
|
|
49
49
|
</slot>
|
|
50
|
-
<slot name="card-description">
|
|
51
|
-
<!-- Description -->
|
|
52
|
-
<KCardSection
|
|
53
|
-
:title="$t('KCard.DESCRIPTION_SECTION')"
|
|
54
|
-
:actions="descriptionActions"
|
|
55
|
-
:hideHeader="!isExpanded"
|
|
56
|
-
:dense="dense"
|
|
57
|
-
>
|
|
58
|
-
<div class="q-pb-xs">
|
|
59
|
-
<KTextArea
|
|
60
|
-
:text="description || $tie('KCard.NO_DESCRIPTION_LABEL')"
|
|
61
|
-
:minHeight="44"
|
|
62
|
-
:dense="dense"
|
|
63
|
-
/>
|
|
64
|
-
</div>
|
|
65
|
-
</KCardSection>
|
|
66
|
-
</slot>
|
|
67
50
|
</div>
|
|
68
51
|
<!--
|
|
69
52
|
Content section
|
|
70
53
|
-->
|
|
71
54
|
<div v-bind:class="{ 'q-px-sm': dense, 'q-px-md': !dense }">
|
|
72
|
-
<slot name="card-content"
|
|
55
|
+
<slot name="card-content">
|
|
56
|
+
<!-- Visible sections -->
|
|
57
|
+
<KPanel
|
|
58
|
+
:content="visibleSections"
|
|
59
|
+
:context="$props"
|
|
60
|
+
direction="vertical"
|
|
61
|
+
/>
|
|
62
|
+
<!-- Expansion sections -->
|
|
63
|
+
<KPanel v-if="isExpanded"
|
|
64
|
+
:content="expandableSections"
|
|
65
|
+
:context="$props"
|
|
66
|
+
direction="vertical"
|
|
67
|
+
/>
|
|
68
|
+
</slot>
|
|
73
69
|
</div>
|
|
74
70
|
<!--
|
|
75
71
|
Footer section
|
|
76
72
|
-->
|
|
77
73
|
<div v-if="hasFooter">
|
|
78
74
|
<q-separator />
|
|
79
|
-
<div
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
<div :class="{ 'q-px-sm q-pt-xs': dense, 'q-px-md q-pt-sm': !dense }">
|
|
76
|
+
<KPanel
|
|
77
|
+
id="card-footer-panel"
|
|
78
|
+
:content="computedFooter"
|
|
79
|
+
:context="$props"
|
|
80
|
+
class="full-width no-wrap"
|
|
81
|
+
/>
|
|
83
82
|
</div>
|
|
84
83
|
</div>
|
|
85
84
|
<!--
|
|
86
85
|
Expand action
|
|
87
86
|
-->
|
|
88
|
-
<div v-if="
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
87
|
+
<div v-if="isExpandable" class="row justify-center">
|
|
88
|
+
<KAction
|
|
89
|
+
id="expand-action"
|
|
90
|
+
icon="las la-angle-down"
|
|
91
|
+
tooltip="KCard.MORE_DETAILS"
|
|
92
|
+
:toggle="{ icon: 'las la-angle-up', tooltip: 'KCard.LESS_DETAILS', color: 'grey-7' }"
|
|
93
|
+
:size="dense ? 'xs' : 'sm'"
|
|
94
|
+
dense
|
|
95
|
+
@triggered="onExpandTriggered"
|
|
96
|
+
/>
|
|
97
97
|
</div>
|
|
98
|
+
<!-- Extra bottom padding if no expand action -->
|
|
99
|
+
<div v-else :class="{ 'q-pt-xs': dense, 'q-pt-sm': !dense }" />
|
|
98
100
|
</q-card>
|
|
99
101
|
</template>
|
|
100
102
|
|
|
@@ -102,18 +104,16 @@
|
|
|
102
104
|
import _ from 'lodash'
|
|
103
105
|
import KAction from '../action/KAction.vue'
|
|
104
106
|
import KPanel from '../KPanel.vue'
|
|
105
|
-
import KTextArea from '../KTextArea.vue'
|
|
106
107
|
import KAvatar from '../KAvatar.vue'
|
|
107
|
-
import
|
|
108
|
+
import KDescriptionCardSection from './KDescriptionCardSection.vue'
|
|
108
109
|
import { baseItem } from '../../mixins'
|
|
109
110
|
|
|
110
111
|
export default {
|
|
111
112
|
components: {
|
|
112
113
|
KPanel,
|
|
113
114
|
KAvatar,
|
|
114
|
-
KTextArea,
|
|
115
115
|
KAction,
|
|
116
|
-
|
|
116
|
+
KDescriptionCardSection
|
|
117
117
|
},
|
|
118
118
|
mixins: [baseItem],
|
|
119
119
|
emits: [
|
|
@@ -125,14 +125,14 @@ export default {
|
|
|
125
125
|
type: [Object, Array],
|
|
126
126
|
default: () => null
|
|
127
127
|
},
|
|
128
|
+
sections: {
|
|
129
|
+
type: Object,
|
|
130
|
+
default: () => null
|
|
131
|
+
},
|
|
128
132
|
footer: {
|
|
129
133
|
type: [Object, Array],
|
|
130
134
|
default: () => null
|
|
131
135
|
},
|
|
132
|
-
expandable: {
|
|
133
|
-
type: Boolean,
|
|
134
|
-
default: false
|
|
135
|
-
},
|
|
136
136
|
avatar: {
|
|
137
137
|
type: Boolean,
|
|
138
138
|
default: true
|
|
@@ -163,11 +163,26 @@ export default {
|
|
|
163
163
|
hasHeader () {
|
|
164
164
|
return !_.isEmpty(this.computedHeader)
|
|
165
165
|
},
|
|
166
|
-
|
|
167
|
-
return
|
|
166
|
+
computedSections () {
|
|
167
|
+
return _.map(this.sections, (value, key) => {
|
|
168
|
+
return {
|
|
169
|
+
...value,
|
|
170
|
+
item: this.item,
|
|
171
|
+
actions: _.filter(this.itemActions, { scope: key }),
|
|
172
|
+
dense: this.dense
|
|
173
|
+
}
|
|
174
|
+
})
|
|
175
|
+
},
|
|
176
|
+
visibleSections () {
|
|
177
|
+
return _.filter(this.computedSections, section => {
|
|
178
|
+
return section.scope !== 'expansion'
|
|
179
|
+
})
|
|
180
|
+
},
|
|
181
|
+
expandableSections () {
|
|
182
|
+
return _.filter(this.computedSections, { scope: 'expansion' })
|
|
168
183
|
},
|
|
169
|
-
|
|
170
|
-
return _.
|
|
184
|
+
isExpandable () {
|
|
185
|
+
return !_.isEmpty(this.expandableSections)
|
|
171
186
|
},
|
|
172
187
|
computedFooter () {
|
|
173
188
|
if (this.footer) return this.footer
|
|
@@ -182,7 +197,7 @@ export default {
|
|
|
182
197
|
},
|
|
183
198
|
data () {
|
|
184
199
|
return {
|
|
185
|
-
isExpanded:
|
|
200
|
+
isExpanded: false
|
|
186
201
|
}
|
|
187
202
|
},
|
|
188
203
|
methods: {
|
|
@@ -4,15 +4,13 @@
|
|
|
4
4
|
<!--
|
|
5
5
|
Header section
|
|
6
6
|
-->
|
|
7
|
-
<div v-if="!hideHeader" class="row full-width items-center no-wrap"
|
|
7
|
+
<div v-if="!hideHeader" class="row full-width justify-between items-center no-wrap">
|
|
8
8
|
<span class="text-grey-7 text-body-2 ellipsis">
|
|
9
9
|
{{ title }}
|
|
10
10
|
</span>
|
|
11
|
-
<q-space />
|
|
12
11
|
<KPanel
|
|
13
|
-
v-if="
|
|
14
|
-
:content="
|
|
15
|
-
:context="context"
|
|
12
|
+
v-if="filteredActions"
|
|
13
|
+
:content="filteredActions"
|
|
16
14
|
class="no-wrap"
|
|
17
15
|
/>
|
|
18
16
|
</div>
|
|
@@ -26,9 +24,11 @@
|
|
|
26
24
|
</template>
|
|
27
25
|
|
|
28
26
|
<script setup>
|
|
27
|
+
import _ from 'lodash'
|
|
28
|
+
import { computed } from 'vue'
|
|
29
29
|
|
|
30
30
|
// Props
|
|
31
|
-
defineProps({
|
|
31
|
+
const props = defineProps({
|
|
32
32
|
title: {
|
|
33
33
|
type: String,
|
|
34
34
|
default: ''
|
|
@@ -37,6 +37,10 @@ defineProps({
|
|
|
37
37
|
type: Array,
|
|
38
38
|
default: () => null
|
|
39
39
|
},
|
|
40
|
+
actionsFilter: {
|
|
41
|
+
type: [String, Array],
|
|
42
|
+
default: () => null
|
|
43
|
+
},
|
|
40
44
|
hideHeader: {
|
|
41
45
|
type: Boolean,
|
|
42
46
|
default: false
|
|
@@ -44,10 +48,16 @@ defineProps({
|
|
|
44
48
|
dense: {
|
|
45
49
|
type: Boolean,
|
|
46
50
|
default: false
|
|
47
|
-
},
|
|
48
|
-
context: {
|
|
49
|
-
type: Object,
|
|
50
|
-
default: () => null
|
|
51
51
|
}
|
|
52
52
|
})
|
|
53
|
+
|
|
54
|
+
// Computed
|
|
55
|
+
const filteredActions = computed(() => {
|
|
56
|
+
if (!props.actionsFilter) return props.actions
|
|
57
|
+
let filter = props.actionsFilter
|
|
58
|
+
if (_.isString(filter)) filter = [filter]
|
|
59
|
+
return _.filter(props.actions, action => {
|
|
60
|
+
return _.indexOf(filter, action.id) >= 0
|
|
61
|
+
})
|
|
62
|
+
})
|
|
53
63
|
</script>
|