@kalisio/kdk 2.4.0 → 2.5.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/core/api/application.js +12 -12
- package/core/api/authentication.js +51 -7
- package/core/api/hooks/hooks.authentication.js +1 -59
- package/core/api/hooks/hooks.authorisations.js +8 -102
- package/core/api/hooks/hooks.model.js +4 -0
- package/core/api/hooks/hooks.push.js +18 -14
- package/core/api/hooks/hooks.users.js +0 -91
- package/core/api/hooks/index.js +0 -2
- package/core/api/services/account/account.service.js +1 -1
- package/core/api/services/authorisations/authorisations.service.js +28 -29
- package/core/api/services/index.js +38 -50
- package/core/api/services/messages/messages.hooks.js +4 -3
- package/core/api/services/users/users.service.js +5 -0
- package/core/client/api.js +182 -71
- package/core/client/broadcaster.js +20 -0
- package/core/client/capabilities.js +17 -7
- package/core/client/components/KActivity.vue +29 -34
- package/core/client/components/KAvatar.vue +0 -6
- package/core/client/components/KChip.vue +142 -39
- package/core/client/components/KContent.vue +13 -32
- package/core/client/components/KDialog.vue +29 -8
- package/core/client/components/KEditor.vue +120 -0
- package/core/client/components/KFollower.vue +75 -0
- package/core/client/components/KLogo.vue +2 -3
- package/core/client/components/KModal.vue +30 -10
- package/core/client/components/KSponsor.vue +1 -1
- package/core/client/components/KTextArea.vue +2 -5
- package/core/client/components/account/KDeleteAccountManager.vue +1 -1
- package/core/client/components/account/KProfile.vue +52 -14
- package/core/client/components/account/KSubscription.vue +19 -9
- package/core/client/components/account/KSubscriptionsManager.vue +10 -11
- package/core/client/components/action/KAction.vue +44 -24
- package/core/client/components/action/KBugReportAction.vue +4 -5
- package/core/client/components/action/KToggleStickyVisibility.vue +41 -0
- package/core/client/components/action/KToggleWidgetVisibility.vue +41 -0
- package/core/client/components/app/KPlatform.vue +122 -35
- package/core/client/components/app/KRequestProgressBar.vue +59 -0
- package/core/client/components/app/KSettings.vue +13 -2
- package/core/client/components/app/KTour.vue +2 -2
- package/core/client/components/chart/KTimeSeriesChart.vue +11 -3
- package/core/client/components/collection/KCard.vue +27 -33
- package/core/client/components/collection/KCardSection.vue +3 -23
- package/core/client/components/collection/KColumn.vue +0 -5
- package/core/client/components/collection/KDescriptionCardSection.vue +10 -5
- package/core/client/components/collection/KFilterView.vue +15 -0
- package/core/client/components/collection/KGrid.vue +4 -9
- package/core/client/components/collection/KHistory.vue +0 -5
- package/core/client/components/collection/KHistoryEntry.vue +0 -2
- package/core/client/components/collection/KItem.vue +1 -2
- package/core/client/components/collection/KSearchFilterControl.vue +139 -0
- package/core/client/components/collection/KTable.vue +1 -4
- package/core/client/components/collection/KTagsFilterControl.vue +70 -0
- package/core/client/components/collection/KTagsFilterView.vue +61 -0
- package/core/client/components/collection/KTimeFilterControl.vue +40 -0
- package/core/client/components/collection/KTimeFilterView.vue +106 -0
- package/core/client/components/collection/KTimeLine.vue +18 -11
- package/core/client/components/document/KBrowser.vue +283 -0
- package/core/client/components/document/KCsv.vue +52 -0
- package/core/client/components/document/KDocument.vue +19 -5
- package/core/client/components/document/KImage.vue +50 -19
- package/core/client/components/document/KMarkdown.vue +10 -2
- package/core/client/components/document/KUploader.vue +126 -0
- package/core/client/components/document/KVideo.vue +39 -0
- package/core/client/components/form/KDateField.vue +70 -0
- package/core/client/components/form/KDateTimeRangeField.vue +6 -17
- package/core/client/components/form/KDatetimeField.vue +6 -13
- package/core/client/components/form/KForm.vue +8 -8
- package/core/client/components/form/KOptionsField.vue +2 -0
- package/core/client/components/form/KResolutionField.vue +54 -52
- package/core/client/components/form/KSelectField.vue +27 -13
- package/core/client/components/form/KTextareaField.vue +23 -5
- package/core/client/components/graphics/KIcon.vue +64 -0
- package/core/client/components/index.js +1 -3
- package/core/client/components/input/KColorPicker.vue +70 -0
- package/core/client/components/input/KIconPicker.vue +188 -0
- package/core/client/components/input/KShapePicker.vue +81 -0
- package/core/client/components/input/index.js +7 -1
- package/core/client/components/layout/KFab.vue +1 -1
- package/core/client/components/layout/KLayout.vue +14 -2
- package/core/client/components/layout/KOpener.vue +9 -11
- package/core/client/components/layout/KPage.vue +31 -17
- package/core/client/components/layout/KWindow.vue +34 -18
- package/core/client/components/menu/KMenu.vue +52 -36
- package/core/client/components/menu/KSubMenu.vue +105 -0
- package/core/client/components/messages/KMessageCard.vue +207 -0
- package/core/client/components/messages/KMessageComposer.vue +199 -0
- package/core/client/components/messages/KMessagesTimeLine.vue +137 -0
- package/core/client/components/messages/index.js +7 -0
- package/core/client/components/screen/KErrorScreen.vue +2 -3
- package/core/client/components/screen/KLogoutScreen.vue +3 -1
- package/core/client/components/screen/KOAuthLoginScreen.vue +15 -0
- package/core/client/components/screen/KOAuthLogoutScreen.vue +33 -0
- package/core/client/components/screen/KUnauthorizedScreen.vue +16 -0
- package/core/client/components/time/KAbsoluteTimeRange.vue +7 -14
- package/core/client/components/time/KDate.vue +56 -26
- package/core/client/components/time/KDateTime.vue +93 -37
- package/core/client/components/time/KDateTimeRange.vue +197 -52
- package/core/client/components/time/KTime.vue +56 -26
- package/core/client/composables/activity.js +40 -30
- package/core/client/composables/{counter.js → collection-counter.js} +2 -4
- package/core/client/composables/collection-filter.js +111 -0
- package/core/client/composables/collection-timerange.js +56 -0
- package/core/client/composables/collection.js +13 -11
- package/core/client/composables/context.js +92 -0
- package/core/client/composables/errors.js +83 -0
- package/core/client/composables/index.js +5 -1
- package/core/client/composables/layout.js +14 -11
- package/core/client/composables/messages.js +4 -4
- package/core/client/composables/pwa.js +20 -27
- package/core/client/composables/schema.js +1 -1
- package/core/client/composables/screen.js +21 -9
- package/core/client/composables/selection.js +16 -4
- package/core/client/composables/session.js +13 -7
- package/core/client/composables/store.js +2 -1
- package/core/client/context.js +38 -0
- package/core/client/directives/v-hover.js +7 -4
- package/core/client/document.js +43 -15
- package/core/client/events.js +2 -2
- package/core/client/exporter.js +5 -4
- package/core/client/filter.js +1 -8
- package/core/client/guards.js +3 -3
- package/core/client/hooks/hooks.logger.js +1 -1
- package/core/client/hooks/hooks.offline.js +32 -0
- package/core/client/hooks/index.js +2 -1
- package/core/client/i18n/core_en.json +95 -268
- package/core/client/i18n/core_fr.json +181 -353
- package/core/client/index.js +22 -8
- package/core/client/layout.js +64 -25
- package/core/client/local-cache.js +67 -0
- package/core/client/local-storage.js +6 -2
- package/core/client/mixins/index.js +0 -1
- package/core/client/mixins/mixin.base-activity.js +22 -10
- package/core/client/mixins/mixin.base-editor.js +1 -1
- package/core/client/mixins/mixin.base-field.js +10 -1
- package/core/client/mixins/mixin.base-item.js +14 -11
- package/core/client/mixins/mixin.service.js +1 -5
- package/core/client/platform.js +44 -0
- package/core/client/readers/reader.blob.js +3 -3
- package/core/client/readers/reader.csv.js +2 -2
- package/core/client/readers/reader.json.js +2 -2
- package/core/client/services/index.js +7 -11
- package/core/client/storage.js +43 -8
- package/core/client/template-context.js +14 -14
- package/core/client/time.js +3 -3
- package/core/client/units.js +7 -4
- package/core/client/utils/index.js +6 -5
- package/core/client/utils/utils.collection.js +71 -0
- package/core/client/utils/utils.colors.js +29 -8
- package/core/client/utils/utils.content.js +14 -14
- package/core/client/utils/utils.files.js +17 -0
- package/core/client/utils/utils.items.js +4 -0
- package/core/client/utils/utils.math.js +18 -1
- package/core/client/utils/utils.push.js +22 -13
- package/core/client/utils/utils.screen.js +6 -2
- package/core/client/utils/utils.services.js +42 -0
- package/core/client/utils/utils.session.js +48 -12
- package/core/client/utils/utils.shapes.js +15 -11
- package/core/common/permissions.js +3 -108
- package/core/common/schemas/messages.update.json +16 -0
- package/core/common/schemas/settings.update.json +27 -8
- package/core/common/utils.js +2 -0
- package/core/common/utils.offline.js +38 -0
- package/coverage/core/api/application.js.html +296 -296
- package/coverage/core/api/authentication.js.html +206 -74
- package/coverage/core/api/db.js.html +61 -61
- package/coverage/core/api/hooks/hooks.authentication.js.html +15 -189
- package/coverage/core/api/hooks/hooks.authorisations.js.html +180 -462
- package/coverage/core/api/hooks/hooks.groups.js.html +1 -1
- package/coverage/core/api/hooks/hooks.logger.js.html +16 -16
- package/coverage/core/api/hooks/hooks.model.js.html +69 -57
- package/coverage/core/api/hooks/hooks.organisations.js.html +1 -1
- package/coverage/core/api/hooks/hooks.push.js.html +58 -46
- package/coverage/core/api/hooks/hooks.query.js.html +142 -142
- package/coverage/core/api/hooks/hooks.schemas.js.html +1 -1
- package/coverage/core/api/hooks/hooks.service.js.html +1 -1
- package/coverage/core/api/hooks/hooks.storage.js.html +1 -1
- package/coverage/core/api/hooks/hooks.users.js.html +54 -327
- package/coverage/core/api/hooks/index.html +64 -94
- package/coverage/core/api/hooks/index.js.html +4 -10
- package/coverage/core/api/index.html +41 -56
- package/coverage/core/api/index.js.html +1 -1
- package/coverage/core/api/marshall.js.html +9 -9
- package/coverage/core/api/models/groups.model.mongodb.js.html +1 -1
- package/coverage/core/api/models/index.html +13 -58
- package/coverage/core/api/models/messages.model.mongodb.js.html +35 -35
- package/coverage/core/api/models/organisations.model.mongodb.js.html +3 -3
- package/coverage/core/api/models/tags.model.mongodb.js.html +1 -1
- package/coverage/core/api/models/users.model.mongodb.js.html +1 -1
- package/coverage/core/api/services/account/account.hooks.js.html +1 -1
- package/coverage/core/api/services/account/account.service.js.html +67 -67
- package/coverage/core/api/services/account/index.html +16 -16
- package/coverage/core/api/services/authorisations/authorisations.hooks.js.html +1 -1
- package/coverage/core/api/services/authorisations/authorisations.service.js.html +141 -144
- package/coverage/core/api/services/authorisations/index.html +19 -19
- package/coverage/core/api/services/databases/databases.hooks.js.html +82 -82
- package/coverage/core/api/services/databases/databases.service.js.html +20 -20
- package/coverage/core/api/services/databases/index.html +32 -32
- package/coverage/core/api/services/groups/groups.hooks.js.html +1 -1
- package/coverage/core/api/services/groups/index.html +1 -1
- package/coverage/core/api/services/import-export/import-export.hooks.js.html +1 -1
- package/coverage/core/api/services/import-export/import-export.service.js.html +1 -1
- package/coverage/core/api/services/import-export/index.html +1 -1
- package/coverage/core/api/services/index.html +21 -21
- package/coverage/core/api/services/index.js.html +118 -154
- package/coverage/core/api/services/mailer/index.html +1 -1
- package/coverage/core/api/services/mailer/mailer.hooks.js.html +1 -1
- package/coverage/core/api/services/mailer/mailer.service.js.html +1 -1
- package/coverage/core/api/services/messages/index.html +21 -21
- package/coverage/core/api/services/messages/messages.hooks.js.html +89 -86
- package/coverage/core/api/services/organisations/index.html +1 -1
- package/coverage/core/api/services/organisations/organisations.hooks.js.html +1 -1
- package/coverage/core/api/services/organisations/organisations.service.js.html +23 -23
- package/coverage/core/api/services/push/index.html +1 -1
- package/coverage/core/api/services/push/push.hooks.js.html +1 -1
- package/coverage/core/api/services/push/push.service.js.html +1 -1
- package/coverage/core/api/services/storage/index.html +5 -5
- package/coverage/core/api/services/storage/storage.hooks.js.html +1 -1
- package/coverage/core/api/services/storage/storage.service.js.html +27 -27
- package/coverage/core/api/services/tags/index.html +1 -1
- package/coverage/core/api/services/tags/tags.hooks.js.html +1 -1
- package/coverage/core/api/services/users/index.html +23 -8
- package/coverage/core/api/services/users/users.hooks.js.html +1 -1
- package/coverage/core/api/services/users/users.service.js.html +100 -0
- package/coverage/core/api/utils.js.html +1 -1
- package/coverage/core/common/errors.js.html +1 -1
- package/coverage/core/common/index.html +42 -27
- package/coverage/core/common/index.js.html +1 -1
- package/coverage/core/common/permissions.js.html +195 -510
- package/coverage/core/common/schema.js.html +1 -1
- package/coverage/core/common/utils.js.html +12 -6
- package/coverage/core/common/utils.offline.js.html +199 -0
- package/coverage/index.html +142 -172
- package/coverage/lcov-report/core/api/application.js.html +296 -296
- package/coverage/lcov-report/core/api/authentication.js.html +206 -74
- package/coverage/lcov-report/core/api/db.js.html +61 -61
- package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +15 -189
- package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +180 -462
- package/coverage/lcov-report/core/api/hooks/hooks.groups.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +16 -16
- package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +69 -57
- package/coverage/lcov-report/core/api/hooks/hooks.organisations.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.push.js.html +58 -46
- package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +142 -142
- package/coverage/lcov-report/core/api/hooks/hooks.schemas.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.service.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.storage.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.users.js.html +54 -327
- package/coverage/lcov-report/core/api/hooks/index.html +64 -94
- package/coverage/lcov-report/core/api/hooks/index.js.html +4 -10
- package/coverage/lcov-report/core/api/index.html +41 -56
- package/coverage/lcov-report/core/api/index.js.html +1 -1
- package/coverage/lcov-report/core/api/marshall.js.html +9 -9
- package/coverage/lcov-report/core/api/models/groups.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/core/api/models/index.html +13 -58
- package/coverage/lcov-report/core/api/models/messages.model.mongodb.js.html +35 -35
- package/coverage/lcov-report/core/api/models/organisations.model.mongodb.js.html +3 -3
- package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/core/api/models/users.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/core/api/services/account/account.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/account/account.service.js.html +67 -67
- package/coverage/lcov-report/core/api/services/account/index.html +16 -16
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.service.js.html +141 -144
- package/coverage/lcov-report/core/api/services/authorisations/index.html +19 -19
- package/coverage/lcov-report/core/api/services/databases/databases.hooks.js.html +82 -82
- package/coverage/lcov-report/core/api/services/databases/databases.service.js.html +20 -20
- package/coverage/lcov-report/core/api/services/databases/index.html +32 -32
- package/coverage/lcov-report/core/api/services/groups/groups.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/groups/index.html +1 -1
- package/coverage/lcov-report/core/api/services/import-export/import-export.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/import-export/import-export.service.js.html +1 -1
- package/coverage/lcov-report/core/api/services/import-export/index.html +1 -1
- package/coverage/lcov-report/core/api/services/index.html +21 -21
- package/coverage/lcov-report/core/api/services/index.js.html +118 -154
- package/coverage/lcov-report/core/api/services/mailer/index.html +1 -1
- package/coverage/lcov-report/core/api/services/mailer/mailer.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/mailer/mailer.service.js.html +1 -1
- package/coverage/lcov-report/core/api/services/messages/index.html +21 -21
- package/coverage/lcov-report/core/api/services/messages/messages.hooks.js.html +89 -86
- package/coverage/lcov-report/core/api/services/organisations/index.html +1 -1
- package/coverage/lcov-report/core/api/services/organisations/organisations.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/organisations/organisations.service.js.html +23 -23
- package/coverage/lcov-report/core/api/services/push/index.html +1 -1
- package/coverage/lcov-report/core/api/services/push/push.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/push/push.service.js.html +1 -1
- package/coverage/lcov-report/core/api/services/storage/index.html +5 -5
- package/coverage/lcov-report/core/api/services/storage/storage.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/storage/storage.service.js.html +27 -27
- package/coverage/lcov-report/core/api/services/tags/index.html +1 -1
- package/coverage/lcov-report/core/api/services/tags/tags.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/users/index.html +23 -8
- package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/users/users.service.js.html +100 -0
- package/coverage/lcov-report/core/api/utils.js.html +1 -1
- package/coverage/lcov-report/core/common/errors.js.html +1 -1
- package/coverage/lcov-report/core/common/index.html +42 -27
- package/coverage/lcov-report/core/common/index.js.html +1 -1
- package/coverage/lcov-report/core/common/permissions.js.html +195 -510
- package/coverage/lcov-report/core/common/schema.js.html +1 -1
- package/coverage/lcov-report/core/common/utils.js.html +12 -6
- package/coverage/lcov-report/core/common/utils.offline.js.html +199 -0
- package/coverage/lcov-report/index.html +142 -172
- package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +125 -29
- package/coverage/lcov-report/map/api/hooks/hooks.features.js.html +1 -1
- package/coverage/lcov-report/map/api/hooks/hooks.query.js.html +20 -44
- package/coverage/lcov-report/map/api/hooks/index.html +7 -7
- package/coverage/lcov-report/map/api/hooks/index.js.html +1 -1
- package/coverage/lcov-report/map/api/index.html +1 -1
- package/coverage/lcov-report/map/api/index.js.html +1 -1
- package/coverage/lcov-report/map/api/marshall.js.html +1 -1
- package/coverage/lcov-report/map/api/models/alerts.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/map/api/models/catalog.model.mongodb.js.html +49 -7
- package/coverage/lcov-report/map/api/models/features.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/map/api/models/index.html +22 -7
- package/coverage/lcov-report/map/api/models/projects.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/map/api/models/styles.model.mongodb.js.html +112 -0
- package/coverage/lcov-report/map/api/services/alerts/alerts.hooks.js.html +1 -1
- package/coverage/lcov-report/map/api/services/alerts/alerts.service.js.html +1 -1
- package/coverage/lcov-report/map/api/services/alerts/index.html +1 -1
- package/coverage/lcov-report/map/api/services/catalog/catalog.hooks.js.html +29 -11
- package/coverage/lcov-report/map/api/services/catalog/index.html +5 -5
- package/coverage/lcov-report/map/api/services/daptiles/daptiles.service.js.html +1 -1
- package/coverage/lcov-report/map/api/services/daptiles/index.html +1 -1
- package/coverage/lcov-report/map/api/services/features/features.hooks.js.html +78 -9
- package/coverage/lcov-report/map/api/services/features/features.service.js.html +307 -4
- package/coverage/lcov-report/map/api/services/features/index.html +7 -7
- package/coverage/lcov-report/map/api/services/index.html +5 -5
- package/coverage/lcov-report/map/api/services/index.js.html +287 -50
- package/coverage/lcov-report/map/api/services/projects/index.html +1 -1
- package/coverage/lcov-report/map/api/services/projects/projects.hooks.js.html +1 -1
- package/coverage/lcov-report/map/api/services/styles/index.html +116 -0
- package/coverage/lcov-report/map/api/services/styles/styles.hooks.js.html +196 -0
- package/coverage/lcov-report/map/common/dynamic-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/errors.js.html +1 -1
- package/coverage/lcov-report/map/common/geotiff-grid-source.js.html +8 -5
- package/coverage/lcov-report/map/common/grid.js.html +1 -1
- package/coverage/lcov-report/map/common/index.html +7 -7
- package/coverage/lcov-report/map/common/index.js.html +1 -1
- package/coverage/lcov-report/map/common/meteo-model-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/moment-utils.js.html +1 -1
- package/coverage/lcov-report/map/common/opendap-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/opendap-utils.js.html +1 -1
- package/coverage/lcov-report/map/common/permissions.js.html +10 -4
- package/coverage/lcov-report/map/common/time-based-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/tms-utils.js.html +6 -6
- package/coverage/lcov-report/map/common/wcs-grid-source.js.html +3 -3
- package/coverage/lcov-report/map/common/wcs-utils.js.html +9 -9
- package/coverage/lcov-report/map/common/weacast-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/wfs-utils.js.html +11 -11
- package/coverage/lcov-report/map/common/wms-utils.js.html +8 -8
- package/coverage/lcov-report/map/common/wmts-utils.js.html +7 -7
- package/coverage/lcov.info +2581 -3278
- package/coverage/map/api/hooks/hooks.catalog.js.html +125 -29
- package/coverage/map/api/hooks/hooks.features.js.html +1 -1
- package/coverage/map/api/hooks/hooks.query.js.html +20 -44
- package/coverage/map/api/hooks/index.html +7 -7
- package/coverage/map/api/hooks/index.js.html +1 -1
- package/coverage/map/api/index.html +1 -1
- package/coverage/map/api/index.js.html +1 -1
- package/coverage/map/api/marshall.js.html +1 -1
- package/coverage/map/api/models/alerts.model.mongodb.js.html +1 -1
- package/coverage/map/api/models/catalog.model.mongodb.js.html +49 -7
- package/coverage/map/api/models/features.model.mongodb.js.html +1 -1
- package/coverage/map/api/models/index.html +22 -7
- package/coverage/map/api/models/projects.model.mongodb.js.html +1 -1
- package/coverage/map/api/models/styles.model.mongodb.js.html +112 -0
- package/coverage/map/api/services/alerts/alerts.hooks.js.html +1 -1
- package/coverage/map/api/services/alerts/alerts.service.js.html +1 -1
- package/coverage/map/api/services/alerts/index.html +1 -1
- package/coverage/map/api/services/catalog/catalog.hooks.js.html +29 -11
- package/coverage/map/api/services/catalog/index.html +5 -5
- package/coverage/map/api/services/daptiles/daptiles.service.js.html +1 -1
- package/coverage/map/api/services/daptiles/index.html +1 -1
- package/coverage/map/api/services/features/features.hooks.js.html +78 -9
- package/coverage/map/api/services/features/features.service.js.html +307 -4
- package/coverage/map/api/services/features/index.html +7 -7
- package/coverage/map/api/services/index.html +5 -5
- package/coverage/map/api/services/index.js.html +287 -50
- package/coverage/map/api/services/projects/index.html +1 -1
- package/coverage/map/api/services/projects/projects.hooks.js.html +1 -1
- package/coverage/map/api/services/styles/index.html +116 -0
- package/coverage/map/api/services/styles/styles.hooks.js.html +196 -0
- package/coverage/map/common/dynamic-grid-source.js.html +1 -1
- package/coverage/map/common/errors.js.html +1 -1
- package/coverage/map/common/geotiff-grid-source.js.html +8 -5
- package/coverage/map/common/grid.js.html +1 -1
- package/coverage/map/common/index.html +7 -7
- package/coverage/map/common/index.js.html +1 -1
- package/coverage/map/common/meteo-model-grid-source.js.html +1 -1
- package/coverage/map/common/moment-utils.js.html +1 -1
- package/coverage/map/common/opendap-grid-source.js.html +1 -1
- package/coverage/map/common/opendap-utils.js.html +1 -1
- package/coverage/map/common/permissions.js.html +10 -4
- package/coverage/map/common/time-based-grid-source.js.html +1 -1
- package/coverage/map/common/tms-utils.js.html +6 -6
- package/coverage/map/common/wcs-grid-source.js.html +3 -3
- package/coverage/map/common/wcs-utils.js.html +9 -9
- package/coverage/map/common/weacast-grid-source.js.html +1 -1
- package/coverage/map/common/wfs-utils.js.html +11 -11
- package/coverage/map/common/wms-utils.js.html +8 -8
- package/coverage/map/common/wmts-utils.js.html +7 -7
- package/coverage/tmp/coverage-323534-1747828879483-0.json +1 -0
- package/coverage/tmp/coverage-323546-1747828879453-0.json +1 -0
- package/coverage/tmp/coverage-323557-1747828879439-0.json +1 -0
- package/coverage/tmp/coverage-323569-1747828879416-0.json +1 -0
- package/coverage/tmp/coverage-323576-1747828879390-0.json +1 -0
- package/extras/configs/helpers.js +78 -0
- package/extras/configs/panes.left.js +118 -0
- package/extras/configs/panes.top.js +222 -0
- package/extras/configs/stickies.js +57 -0
- package/extras/configs/widgets.left.js +23 -0
- package/extras/configs/widgets.top.js +73 -0
- package/extras/css/core.variables.scss +8 -0
- package/extras/images/north.svg +3 -0
- package/extras/tours/map/side-nav.js +3 -3
- package/map/api/hooks/hooks.catalog.js +56 -23
- package/map/api/hooks/hooks.query.js +16 -24
- package/map/api/models/catalog.model.mongodb.js +16 -2
- package/{core/api/models/groups.model.mongodb.js → map/api/models/styles.model.mongodb.js} +2 -1
- package/map/api/services/catalog/catalog.hooks.js +13 -7
- package/map/api/services/features/features.hooks.js +28 -5
- package/map/api/services/features/features.service.js +101 -0
- package/map/api/services/index.js +125 -46
- package/map/api/services/styles/styles.hooks.js +37 -0
- package/map/client/cesium/utils/index.js +1 -0
- package/map/client/cesium/utils/utils.cesium.js +397 -0
- package/map/client/cesium/utils/utils.features.js +8 -0
- package/map/client/cesium/utils/utils.geojson.js +59 -0
- package/map/client/cesium/utils/utils.style.js +134 -17
- package/map/client/components/KEditLayerData.vue +17 -79
- package/map/client/components/KFeatureEditor.vue +2 -7
- package/map/client/components/KFeaturesChart.vue +2 -6
- package/map/client/components/KFeaturesFilterEditor.vue +300 -0
- package/map/client/components/KFeaturesFilterManager.vue +196 -0
- package/map/client/components/KFeaturesTable.vue +0 -5
- package/map/client/components/KFilterCondition.vue +303 -0
- package/map/client/components/KLayerEditionToolbar.vue +4 -3
- package/map/client/components/KLayerEditor.vue +451 -36
- package/map/client/components/KMeasureTool.vue +36 -9
- package/map/client/components/KProjectMenu.vue +14 -8
- package/map/client/components/catalog/KAddLayer.vue +0 -4
- package/map/client/components/catalog/KBaseLayersSelector.vue +42 -46
- package/map/client/components/catalog/KConnectLayer.vue +295 -291
- package/map/client/components/catalog/KCreateLayer.vue +141 -146
- package/map/client/components/catalog/KCreateOfflineView.vue +100 -0
- package/map/client/components/catalog/KCreateView.vue +2 -8
- package/map/client/components/catalog/KFilteredLayerItem.vue +72 -25
- package/map/client/components/catalog/KImportLayer.vue +121 -129
- package/map/client/components/catalog/KLayerItem.vue +44 -32
- package/map/client/components/catalog/KLayersPanel.vue +45 -17
- package/map/client/components/catalog/KLayersSelector.vue +51 -50
- package/map/client/components/catalog/KProjectManager.vue +4 -8
- package/map/client/components/catalog/KProjectSelector.vue +33 -2
- package/map/client/components/catalog/KProjectsPanel.vue +84 -106
- package/map/client/components/catalog/KSelectLayers.vue +56 -69
- package/map/client/components/catalog/KSelectViews.vue +56 -69
- package/map/client/components/catalog/KViewSelector.vue +32 -2
- package/map/client/components/catalog/KViewsPanel.vue +178 -110
- package/map/client/components/catalog/KWeatherLayersSelector.vue +77 -85
- package/map/client/components/form/KLocationField.vue +21 -2
- package/map/client/components/form/KOwsLayerField.vue +1 -1
- package/map/client/components/form/KOwsServiceField.vue +102 -63
- package/map/client/components/form/KSelectLayersField.vue +1 -1
- package/map/client/components/form/KSelectViewsField.vue +1 -1
- package/map/client/components/form/KTimezoneField.vue +0 -1
- package/map/client/components/legend/KLegend.vue +4 -4
- package/map/client/components/location/KLocationCardSection.vue +16 -0
- package/map/client/components/location/KLocationMap.vue +3 -2
- package/map/client/components/location/KLocationSearch.vue +46 -8
- package/map/client/components/location/KLocationTimeLineCard.vue +25 -3
- package/map/client/components/location/KLocationTip.vue +57 -10
- package/map/client/components/selection/KFeaturesSelection.vue +71 -0
- package/map/client/components/selection/KSelectedLayerFeatures.vue +343 -0
- package/map/client/components/{KAttribution.vue → stickies/KAttribution.vue} +39 -33
- package/map/client/components/stickies/KLevelSlider.vue +114 -0
- package/map/client/components/stickies/KNorthArrow.vue +26 -0
- package/map/client/components/stickies/KPosition.vue +103 -0
- package/map/client/components/stickies/KTarget.vue +34 -0
- package/map/client/components/styles/KLayerStyleAction.vue +58 -0
- package/map/client/components/styles/KStyleEditor.vue +273 -0
- package/map/client/components/styles/KStyleEditorSection.vue +79 -0
- package/map/client/components/styles/KStyleManager.vue +183 -0
- package/map/client/components/styles/KStylePreview.vue +64 -0
- package/map/client/components/styles/KStylePreviewItem.vue +68 -0
- package/map/client/components/styles/KStylePropertiesGroup.vue +76 -0
- package/map/client/components/styles/KStyleProperty.vue +136 -0
- package/map/client/components/styles/KStyleTip.vue +118 -0
- package/map/client/components/tools/KGeolocateTool.vue +3 -2
- package/map/client/components/tools/KSearchTool.vue +34 -6
- package/map/client/components/widget/KMapillaryViewer.vue +1 -1
- package/map/client/components/widget/KStackableTimeSeries.vue +8 -5
- package/map/client/composables/activity.js +29 -43
- package/map/client/composables/catalog.js +1 -1
- package/map/client/composables/highlight.js +117 -57
- package/map/client/composables/location.js +33 -14
- package/map/client/composables/project.js +9 -10
- package/map/client/composables/selection.js +136 -23
- package/map/client/geocoder.js +104 -0
- package/map/client/geolocation.js +1 -1
- package/map/client/globe.js +3 -0
- package/map/client/hooks/hooks.offline.js +95 -0
- package/map/client/hooks/index.js +1 -0
- package/map/client/i18n/map_en.json +159 -94
- package/map/client/i18n/map_fr.json +186 -127
- package/map/client/index.js +3 -0
- package/map/client/init.js +44 -8
- package/map/client/leaflet/BoxSelection.js +2 -2
- package/map/client/leaflet/GradientPath.js +84 -4
- package/map/client/leaflet/TiledFeatureLayer.js +2 -3
- package/map/client/leaflet/WindBarb.js +323 -0
- package/map/client/leaflet/utils/index.js +1 -0
- package/map/client/leaflet/utils/utils.events.js +8 -3
- package/map/client/leaflet/utils/utils.geojson.js +221 -0
- package/map/client/leaflet/utils/utils.style.js +10 -9
- package/map/client/map.js +3 -0
- package/map/client/mixins/globe/mixin.base-globe.js +151 -19
- package/map/client/mixins/globe/mixin.geojson-layers.js +208 -86
- package/map/client/mixins/globe/mixin.popup.js +3 -2
- package/map/client/mixins/globe/mixin.style.js +3 -1
- package/map/client/mixins/globe/mixin.tooltip.js +3 -2
- package/map/client/mixins/map/index.js +1 -3
- package/map/client/mixins/map/mixin.base-map.js +267 -79
- package/map/client/mixins/map/mixin.canvas-layers.js +44 -10
- package/map/client/mixins/map/mixin.edit-layers.js +142 -57
- package/map/client/mixins/map/mixin.geojson-layers.js +129 -205
- package/map/client/mixins/map/mixin.pmtiles-layers.js +24 -11
- package/map/client/mixins/map/mixin.tiled-mesh-layers.js +1 -2
- package/map/client/mixins/map/mixin.tiled-wind-layers.js +2 -1
- package/map/client/mixins/mixin.activity.js +61 -41
- package/map/client/mixins/mixin.context.js +19 -14
- package/map/client/mixins/mixin.feature-selection.js +0 -1
- package/map/client/mixins/mixin.feature-service.js +41 -59
- package/map/client/mixins/mixin.weacast.js +1 -1
- package/map/client/navigator.js +38 -0
- package/map/client/pixi-utils.js +1 -1
- package/map/client/planets.js +1 -1
- package/map/client/readers/reader.kml.js +57 -1
- package/map/client/utils/index.js +1 -0
- package/map/client/utils/utils.capture.js +10 -7
- package/map/client/utils/utils.catalog.js +2 -2
- package/map/client/utils/utils.features.js +193 -39
- package/map/client/utils/utils.js +8 -19
- package/map/client/utils/utils.layers.js +381 -4
- package/map/client/utils/utils.location.js +39 -74
- package/map/client/utils/utils.offline.js +89 -0
- package/map/client/utils/utils.style.js +133 -80
- package/map/client/utils/utils.time-series.js +99 -25
- package/map/common/geotiff-grid-source.js +2 -1
- package/map/common/permissions.js +2 -0
- package/map/common/schemas/capture.create.json +4 -4
- package/map/common/schemas/catalog.update.json +18 -2
- package/map/common/schemas/projects.create.json +2 -2
- package/map/common/schemas/projects.update.json +2 -2
- package/map/common/tms-utils.js +5 -5
- package/map/common/wcs-grid-source.js +2 -2
- package/map/common/wcs-utils.js +8 -8
- package/map/common/wfs-utils.js +10 -10
- package/map/common/wms-utils.js +7 -7
- package/map/common/wmts-utils.js +6 -6
- package/package.json +7 -4
- package/test/api/core/account.test.js +0 -72
- package/test/api/core/authentication.test.js +184 -0
- package/test/api/core/config/default.cjs +1 -3
- package/test/api/core/index.test.js +33 -96
- package/test/api/core/offline.test.js +55 -0
- package/test/api/core/push.test.js +3 -3
- package/test/api/core/{test-log-2024-06-06.log → test-log-2025-02-05.log} +3 -3
- package/test/api/core/{test-log-2024-11-15.log → test-log-2025-05-21.log} +1 -9
- package/test/api/map/alerts.test.js +1 -1
- package/test/api/map/config/default.cjs +2 -1
- package/test/api/map/data/vigicrues.observations.Q.json +47042 -0
- package/test/api/map/index.test.js +113 -9
- package/test/api/map/style.test.js +62 -0
- package/test/client/core/layout.js +2 -2
- package/test/client/core/runner.js +1 -1
- package/test/client/core/utils.js +52 -0
- package/test/client/map/catalog.js +1 -0
- package/core/api/hooks/hooks.groups.js +0 -48
- package/core/api/hooks/hooks.organisations.js +0 -152
- package/core/api/models/organisations.model.mongodb.js +0 -3
- package/core/api/models/tags.model.mongodb.js +0 -10
- package/core/api/services/groups/groups.hooks.js +0 -31
- package/core/api/services/organisations/organisations.hooks.js +0 -31
- package/core/api/services/organisations/organisations.service.js +0 -86
- package/core/api/services/tags/tags.hooks.js +0 -31
- package/core/api/utils.js +0 -11
- package/core/client/components/KChipsPane.vue +0 -103
- package/core/client/components/document/index.js +0 -9
- package/core/client/components/team/KAddMember.vue +0 -378
- package/core/client/components/team/KAddTag.vue +0 -121
- package/core/client/components/team/KChangeRole.vue +0 -118
- package/core/client/components/team/KGroupCard.vue +0 -110
- package/core/client/components/team/KGroupsActivity.vue +0 -78
- package/core/client/components/team/KJoinGroup.vue +0 -132
- package/core/client/components/team/KMemberCard.vue +0 -328
- package/core/client/components/team/KMemberFilter.vue +0 -49
- package/core/client/components/team/KMembersActivity.vue +0 -136
- package/core/client/components/team/KOrganisationsActivity.vue +0 -51
- package/core/client/components/team/KTagCard.vue +0 -72
- package/core/client/components/team/KTagsActivity.vue +0 -73
- package/core/client/components/team/index.js +0 -9
- package/core/client/mixins/mixin.base-context.js +0 -54
- package/core/client/utils/utils.platform.js +0 -12
- package/core/common/schemas/groups.create.json +0 -28
- package/core/common/schemas/groups.update.json +0 -28
- package/core/common/schemas/organisations.create.json +0 -28
- package/core/common/schemas/organisations.update.json +0 -49
- package/core/common/schemas/tags.create.json +0 -35
- package/core/common/schemas/tags.update.json +0 -35
- package/coverage/tmp/coverage-280506-1731704745613-0.json +0 -1
- package/coverage/tmp/coverage-280518-1731704745599-0.json +0 -1
- package/coverage/tmp/coverage-280529-1731704745588-0.json +0 -1
- package/coverage/tmp/coverage-280541-1731704745574-0.json +0 -1
- package/coverage/tmp/coverage-280548-1731704745545-0.json +0 -1
- package/map/client/components/KFeaturesFilter.vue +0 -259
- package/map/client/components/KLayerStyleEditor.vue +0 -118
- package/map/client/components/KLayerStyleForm.vue +0 -740
- package/map/client/components/KLevelSlider.vue +0 -100
- package/map/client/components/KNorth.vue +0 -31
- package/map/client/components/KPositionIndicator.vue +0 -83
- package/map/client/components/catalog/KCreateProject.vue +0 -100
- package/map/client/mixins/map/mixin.forecast-layers.js +0 -81
- package/map/client/mixins/map/mixin.georaster-layers.js +0 -107
- package/test/api/core/team.test.js +0 -670
- package/test/api/core/test-log-2023-12-19.log +0 -7
- package/test/api/core/test-log-2024-01-04.log +0 -14
- package/test/api/core/test-log-2024-05-14.log +0 -6
- package/test/api/core/test-log-2024-06-26.log +0 -25
- package/test/api/core/test-log-2024-06-28.log +0 -2
- package/test/api/core/test-log-2024-07-09.log +0 -0
- package/test/api/core/test-log-2024-08-13.log +0 -69
- package/test/api/core/test-log-2024-10-28.log +0 -53
- package/test/api/core/test-log-2024-11-05.log +0 -30
- package/test/api/map/test-log-2023-11-24.log +0 -121
- package/test/api/map/test-log-2023-12-12.log +0 -29
- package/test/api/map/test-log-2023-12-13.log +0 -5
- package/test/api/map/test-log-2024-01-04.log +0 -2
- package/test/api/map/test-log-2024-01-11.log +0 -1
- package/test/api/map/test-log-2024-01-25.log +0 -19
- package/test/api/map/test-log-2024-06-06.log +0 -39
- package/test/api/map/test-log-2024-08-13.log +0 -13
- package/test/api/map/test-log-2024-08-20.log +0 -55
- package/test/api/map/test-log-2024-09-09.log +0 -92
- package/test/api/map/test-log-2024-10-28.log +0 -11
- /package/extras/{logos → images}/kalisio.png +0 -0
- /package/extras/{icons → images}/target.svg +0 -0
- /package/test/api/map/data/{vigicrues.observations.json → vigicrues.observations.H.json} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<KPage
|
|
2
|
+
<KPage>
|
|
3
3
|
<slot />
|
|
4
4
|
</KPage>
|
|
5
5
|
</template>
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
<script>
|
|
8
8
|
import _ from 'lodash'
|
|
9
9
|
import logger from 'loglevel'
|
|
10
|
-
import config from 'config'
|
|
11
10
|
import { useActivity, useLayout } from '../composables'
|
|
12
11
|
import KPage from './layout/KPage.vue'
|
|
13
12
|
|
|
@@ -20,6 +19,13 @@ export default {
|
|
|
20
19
|
type: String,
|
|
21
20
|
required: true
|
|
22
21
|
},
|
|
22
|
+
options: {
|
|
23
|
+
type: Object,
|
|
24
|
+
default: () => {},
|
|
25
|
+
validator: (value) => {
|
|
26
|
+
return _.isObject(value)
|
|
27
|
+
}
|
|
28
|
+
},
|
|
23
29
|
layout: {
|
|
24
30
|
type: [Object, Function],
|
|
25
31
|
default: () => null
|
|
@@ -29,29 +35,9 @@ export default {
|
|
|
29
35
|
default: null
|
|
30
36
|
}
|
|
31
37
|
},
|
|
32
|
-
setup (props) {
|
|
33
|
-
const keyName = `${_.camelCase(props.name)}Activity`
|
|
34
|
-
logger.debug(`[KDK] Reading '${props.name}' activity options with key ${keyName}`)
|
|
35
|
-
const options = _.get(config, keyName, {})
|
|
36
|
-
const { setCurrentActivity } = useActivity(keyName, options)
|
|
37
|
-
const { Layout, configureLayout, clearLayout, setLayoutMode } = useLayout()
|
|
38
|
-
return {
|
|
39
|
-
options,
|
|
40
|
-
setCurrentActivity,
|
|
41
|
-
Layout,
|
|
42
|
-
configureLayout,
|
|
43
|
-
clearLayout,
|
|
44
|
-
setLayoutMode
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
computed: {
|
|
48
|
-
padding () {
|
|
49
|
-
return this.Layout.padding
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
38
|
watch: {
|
|
53
39
|
mode: {
|
|
54
|
-
// [!] cannot be immediate
|
|
40
|
+
// [!] It cannot be immediate because the activity must first be configured
|
|
55
41
|
handler (value) {
|
|
56
42
|
logger.debug(`[KDK] Setting layout on '${value}' mode`)
|
|
57
43
|
if (value) this.setLayoutMode(value)
|
|
@@ -60,26 +46,37 @@ export default {
|
|
|
60
46
|
},
|
|
61
47
|
methods: {
|
|
62
48
|
async configure () {
|
|
63
|
-
|
|
49
|
+
// set the current activity
|
|
64
50
|
// because this component is wrapped within an AsyncComponent it returns the grand parent
|
|
65
51
|
const concreteActivity = this.$parent.$parent
|
|
66
|
-
//
|
|
52
|
+
// set the current activity
|
|
53
|
+
this.setCurrentActivity(concreteActivity)
|
|
54
|
+
// configure the activity
|
|
67
55
|
let customLayout = {}
|
|
68
56
|
if (this.layout) {
|
|
69
57
|
if (typeof this.layout === 'function') customLayout = await this.layout()
|
|
70
58
|
else customLayout = this.layout
|
|
71
59
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
this.
|
|
60
|
+
const configuration = _.merge({}, this.CurrentActivityContext.config, customLayout)
|
|
61
|
+
this.configureLayout(configuration, concreteActivity)
|
|
62
|
+
logger.debug(`[KDK] Activity ${this.name} configured with`, configuration)
|
|
75
63
|
// apply the mode if needed
|
|
76
64
|
if (this.mode) this.setLayoutMode(this.mode)
|
|
77
|
-
},
|
|
78
|
-
getOptions () {
|
|
79
|
-
return this.options
|
|
80
65
|
}
|
|
81
66
|
},
|
|
82
|
-
|
|
67
|
+
setup (props) {
|
|
68
|
+
const activityName = `${_.camelCase(props.name)}Activity`
|
|
69
|
+
const { CurrentActivityContext, setCurrentActivity } = useActivity(activityName, props.options)
|
|
70
|
+
const { configureLayout, clearLayout, setLayoutMode } = useLayout()
|
|
71
|
+
return {
|
|
72
|
+
CurrentActivityContext,
|
|
73
|
+
setCurrentActivity,
|
|
74
|
+
configureLayout,
|
|
75
|
+
clearLayout,
|
|
76
|
+
setLayoutMode
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
async created () {
|
|
83
80
|
await this.configure()
|
|
84
81
|
// whenever the user abilities are updated, update activity as well
|
|
85
82
|
this.$events.on('user-abilities-changed', this.configure)
|
|
@@ -87,8 +84,6 @@ export default {
|
|
|
87
84
|
beforeUnmount () {
|
|
88
85
|
logger.debug(`[KDK] Clearing '${this.name}' activity`)
|
|
89
86
|
this.$events.off('user-abilities-changed', this.configure)
|
|
90
|
-
// clear the current activity
|
|
91
|
-
this.setCurrentActivity(null)
|
|
92
87
|
// Clear the layout
|
|
93
88
|
this.clearLayout()
|
|
94
89
|
}
|
|
@@ -29,10 +29,6 @@ export default {
|
|
|
29
29
|
type: Object,
|
|
30
30
|
required: true
|
|
31
31
|
},
|
|
32
|
-
contextId: {
|
|
33
|
-
type: String,
|
|
34
|
-
default: ''
|
|
35
|
-
},
|
|
36
32
|
size: {
|
|
37
33
|
type: String,
|
|
38
34
|
default: 'md'
|
|
@@ -74,7 +70,6 @@ export default {
|
|
|
74
70
|
const data = await Storage.download({
|
|
75
71
|
file: _.get(avatar, 'name'),
|
|
76
72
|
key: avatarId,
|
|
77
|
-
context: this.contextId,
|
|
78
73
|
asDataUrl: true
|
|
79
74
|
})
|
|
80
75
|
avatar.uri = data.uri
|
|
@@ -83,7 +78,6 @@ export default {
|
|
|
83
78
|
this.avatar = await Storage.getObjectUrl({
|
|
84
79
|
file: _.get(avatar, 'name'),
|
|
85
80
|
key: avatarId,
|
|
86
|
-
context: this.contextId,
|
|
87
81
|
query: {
|
|
88
82
|
timestamp: Date.now()
|
|
89
83
|
}
|
|
@@ -1,68 +1,171 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<q-chip
|
|
3
|
-
v-
|
|
4
|
-
:
|
|
5
|
-
:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
v-model="computedState"
|
|
4
|
+
:selected="selected"
|
|
5
|
+
:icon="icon"
|
|
6
|
+
:iconRight="iconRight"
|
|
7
|
+
:iconRemove="iconRemove"
|
|
8
|
+
:iconSelected="iconSelected"
|
|
9
|
+
:size="size"
|
|
10
|
+
:dense="dense"
|
|
11
|
+
:square="square"
|
|
12
|
+
:clickable="clickable"
|
|
13
|
+
:removable="removable"
|
|
14
|
+
:disable="disable"
|
|
15
|
+
@updated:selected="state => emit('updated:selected', state)"
|
|
16
|
+
@remove="emit('remove')"
|
|
17
|
+
@click="event => emit('click', event)"
|
|
18
|
+
class="k-chip"
|
|
19
|
+
>
|
|
20
|
+
<div v-if="computedLabel"
|
|
21
|
+
:id="id"
|
|
22
|
+
class="ellipsis"
|
|
23
|
+
:class="{ 'q-pl-sm': !dense && icon, 'q-pl-xs': dense && icon }"
|
|
24
|
+
>
|
|
16
25
|
{{ computedLabel }}
|
|
17
|
-
<q-
|
|
18
|
-
{{ computedLabel }}
|
|
19
|
-
</q-tooltip>
|
|
26
|
+
<q-resize-observer @resize="onResize" />
|
|
20
27
|
</div>
|
|
28
|
+
<q-tooltip v-if="computedTooltip">
|
|
29
|
+
<div v-html="Document.sanitizeHtml(computedTooltip)" />
|
|
30
|
+
</q-tooltip>
|
|
31
|
+
<slot />
|
|
21
32
|
</q-chip>
|
|
22
33
|
</template>
|
|
23
34
|
|
|
24
35
|
<script setup>
|
|
25
36
|
import _ from 'lodash'
|
|
26
|
-
import { ref, computed
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
37
|
+
import { ref, computed } from 'vue'
|
|
38
|
+
import { uid } from 'quasar'
|
|
39
|
+
import { i18n } from '../i18n.js'
|
|
40
|
+
import { Document } from '../document.js'
|
|
41
|
+
import { getHtmlColor, getContrastColor } from '../utils'
|
|
29
42
|
|
|
30
43
|
// Props
|
|
31
44
|
const props = defineProps({
|
|
32
|
-
|
|
33
|
-
type:
|
|
34
|
-
default:
|
|
45
|
+
label: {
|
|
46
|
+
type: [String, Number],
|
|
47
|
+
default: ''
|
|
35
48
|
},
|
|
36
|
-
|
|
49
|
+
tooltip: {
|
|
37
50
|
type: String,
|
|
38
|
-
default:
|
|
51
|
+
default: undefined
|
|
52
|
+
},
|
|
53
|
+
icon: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: undefined
|
|
56
|
+
},
|
|
57
|
+
iconRight: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: undefined
|
|
60
|
+
},
|
|
61
|
+
iconRemove: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: 'cancel'
|
|
64
|
+
},
|
|
65
|
+
iconSelected: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: 'check'
|
|
68
|
+
},
|
|
69
|
+
modelValue: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: true
|
|
72
|
+
},
|
|
73
|
+
selected: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: null
|
|
76
|
+
},
|
|
77
|
+
color: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: 'grey-7'
|
|
80
|
+
},
|
|
81
|
+
textColor: {
|
|
82
|
+
type: String,
|
|
83
|
+
default: undefined
|
|
84
|
+
},
|
|
85
|
+
size: {
|
|
86
|
+
type: String,
|
|
87
|
+
default: 'md'
|
|
88
|
+
},
|
|
89
|
+
dense: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: false
|
|
92
|
+
},
|
|
93
|
+
square: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
default: false
|
|
96
|
+
},
|
|
97
|
+
outline: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
default: false
|
|
100
|
+
},
|
|
101
|
+
clickable: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
default: false
|
|
104
|
+
},
|
|
105
|
+
removable: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
default: false
|
|
108
|
+
},
|
|
109
|
+
disable: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: false
|
|
39
112
|
}
|
|
40
113
|
})
|
|
41
114
|
|
|
115
|
+
// Emits
|
|
116
|
+
const emit = defineEmits(['update:modelValue', 'update:selected', 'remove', 'click'])
|
|
117
|
+
|
|
42
118
|
// Data
|
|
43
|
-
const
|
|
119
|
+
const isTruncated = ref(false)
|
|
120
|
+
const id = uid()
|
|
44
121
|
|
|
45
122
|
// Computed
|
|
46
|
-
const
|
|
47
|
-
|
|
123
|
+
const computedState = computed({
|
|
124
|
+
get: function () {
|
|
125
|
+
return props.modelValue
|
|
126
|
+
},
|
|
127
|
+
set: function (state) {
|
|
128
|
+
emit('updated:modelValue', state)
|
|
129
|
+
}
|
|
48
130
|
})
|
|
49
131
|
const computedLabel = computed(() => {
|
|
50
|
-
return
|
|
132
|
+
return i18n.tie(props.label)
|
|
51
133
|
})
|
|
52
|
-
const
|
|
53
|
-
return
|
|
134
|
+
const computedTooltip = computed(() => {
|
|
135
|
+
if (props.tooltip) return i18n.tie(props.tooltip)
|
|
136
|
+
if (props.label && isTruncated.value) return computedLabel.value
|
|
54
137
|
})
|
|
55
138
|
const computedColor = computed(() => {
|
|
56
|
-
return
|
|
139
|
+
return props.outline ? 'transparent' : getHtmlColor(props.color)
|
|
140
|
+
})
|
|
141
|
+
const computedTextColor = computed(() => {
|
|
142
|
+
if (_.isEmpty(props.textColor)) {
|
|
143
|
+
if (props.outline) return computedBorderColor.value
|
|
144
|
+
return getContrastColor(props.color)
|
|
145
|
+
}
|
|
146
|
+
return getHtmlColor(props.textColor)
|
|
147
|
+
})
|
|
148
|
+
const computedBorderColor = computed(() => {
|
|
149
|
+
return props.outline ? getHtmlColor(props.color) : 'transparent'
|
|
57
150
|
})
|
|
58
151
|
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
// wait for the chip to be rendered
|
|
62
|
-
await nextTick()
|
|
63
|
-
// get the element
|
|
64
|
-
const chipElement = document.getElementById(computedId.value)
|
|
152
|
+
// Function
|
|
153
|
+
function onResize () {
|
|
65
154
|
// check whether the label is truncated
|
|
66
|
-
|
|
67
|
-
|
|
155
|
+
const chipElement = document.getElementById(id)
|
|
156
|
+
if (chipElement) isTruncated.value = (chipElement && chipElement.offsetWidth < chipElement.scrollWidth)
|
|
157
|
+
}
|
|
68
158
|
</script>
|
|
159
|
+
|
|
160
|
+
<style lang="scss">
|
|
161
|
+
.k-chip {
|
|
162
|
+
background-color: v-bind(computedColor);
|
|
163
|
+
color: v-bind(computedTextColor);
|
|
164
|
+
}
|
|
165
|
+
.q-chip {
|
|
166
|
+
border: solid 1px v-bind(computedBorderColor);
|
|
167
|
+
}
|
|
168
|
+
.q-chip__icon {
|
|
169
|
+
color: v-bind(computedTextColor);
|
|
170
|
+
}
|
|
171
|
+
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<template v-for="component in
|
|
3
|
+
<template v-for="component in filteredComponents" :key="component.uid">
|
|
4
4
|
<Suspense v-if="component.suspense">
|
|
5
5
|
<component
|
|
6
6
|
v-if="component.isVisible && !component.isHidden"
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
|
|
26
26
|
<script setup>
|
|
27
27
|
import _ from 'lodash'
|
|
28
|
-
import logger from 'loglevel'
|
|
29
28
|
import { computed } from 'vue'
|
|
30
29
|
import { uid } from 'quasar'
|
|
31
30
|
import { filterContent, getBoundValue, loadComponent } from '../utils/index.js'
|
|
@@ -61,24 +60,21 @@ const props = defineProps({
|
|
|
61
60
|
const emit = defineEmits(['triggered'])
|
|
62
61
|
|
|
63
62
|
// Computed
|
|
64
|
-
const
|
|
63
|
+
const filteredComponents = computed(() => {
|
|
65
64
|
if (_.isEmpty(props.content)) return []
|
|
66
|
-
|
|
67
|
-
components =
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
// Retrieve the components
|
|
66
|
+
let components = props.content
|
|
67
|
+
if (!Array.isArray(components)) components = _.get(components, props.mode, [])
|
|
68
|
+
// Filter the components
|
|
69
|
+
if (!_.isEmpty(props.filter)) components = filterContent(components, props.filter)
|
|
70
|
+
// Configure the components
|
|
71
|
+
for (const component of components) {
|
|
72
|
+
component.name = _.get(component, 'component', 'action/KAction')
|
|
73
|
+
component.uid = uid()
|
|
73
74
|
component.isHidden = getVisibility(component, 'hidden', false)
|
|
74
75
|
component.isVisible = getVisibility(component, 'visible', true)
|
|
75
|
-
if (!_.startsWith(component.name, 'Q'))
|
|
76
|
-
|
|
77
|
-
component.instance = loadComponent(component.name)
|
|
78
|
-
} else {
|
|
79
|
-
logger.trace(`Using component ${component.name}`)
|
|
80
|
-
component.instance = component.name
|
|
81
|
-
}
|
|
76
|
+
if (!_.startsWith(component.name, 'Q')) component.instance = loadComponent(component.name)
|
|
77
|
+
else component.instance = component.name
|
|
82
78
|
}
|
|
83
79
|
return components
|
|
84
80
|
})
|
|
@@ -94,21 +90,6 @@ function getVisibility (component, property, defaultValue) {
|
|
|
94
90
|
}
|
|
95
91
|
return isVisible
|
|
96
92
|
}
|
|
97
|
-
function getComponents (content, mode) {
|
|
98
|
-
let components = []
|
|
99
|
-
// Get component config for given mode if any
|
|
100
|
-
if (Array.isArray(content)) components = content
|
|
101
|
-
else components = _.get(content, mode)
|
|
102
|
-
const processedComponents = []
|
|
103
|
-
// Then create component objects
|
|
104
|
-
_.forEach(components, component => {
|
|
105
|
-
// Get the component and add the required props
|
|
106
|
-
component.name = _.get(component, 'component', 'action/KAction')
|
|
107
|
-
component.uid = uid()
|
|
108
|
-
processedComponents.push(component)
|
|
109
|
-
})
|
|
110
|
-
return processedComponents
|
|
111
|
-
}
|
|
112
93
|
function onTriggered (params) {
|
|
113
94
|
emit('triggered', params)
|
|
114
95
|
}
|
|
@@ -2,26 +2,28 @@
|
|
|
2
2
|
<KModal
|
|
3
3
|
ref="dialogRef"
|
|
4
4
|
:title="title"
|
|
5
|
-
:maximized="maximized"
|
|
6
|
-
:buttons="computedButtons"
|
|
7
5
|
:toolbar="toolbar"
|
|
6
|
+
:buttons="computedButtons"
|
|
8
7
|
:width-policy="widthPolicy"
|
|
8
|
+
:maximized="maximized"
|
|
9
9
|
>
|
|
10
10
|
<Suspense>
|
|
11
11
|
<!-- component with v-model -->
|
|
12
12
|
<component
|
|
13
|
-
v-if="
|
|
13
|
+
v-if="useModel"
|
|
14
14
|
ref="componentRef"
|
|
15
15
|
:is="computedComponent"
|
|
16
16
|
v-model="computedModel"
|
|
17
|
-
v-bind="
|
|
17
|
+
v-bind="computedAttrs"
|
|
18
|
+
v-on="computedHandlers"
|
|
18
19
|
/>
|
|
19
20
|
<!-- component without v-model -->
|
|
20
21
|
<component
|
|
21
22
|
v-else
|
|
22
23
|
ref="componentRef"
|
|
23
24
|
:is="computedComponent"
|
|
24
|
-
v-bind="
|
|
25
|
+
v-bind="computedAttrs"
|
|
26
|
+
v-on="computedHandlers"
|
|
25
27
|
/>
|
|
26
28
|
</Suspense>
|
|
27
29
|
</KModal>
|
|
@@ -49,6 +51,10 @@ const props = defineProps({
|
|
|
49
51
|
type: String,
|
|
50
52
|
default: null
|
|
51
53
|
},
|
|
54
|
+
handlers: {
|
|
55
|
+
type: Object,
|
|
56
|
+
default: null
|
|
57
|
+
},
|
|
52
58
|
okAction: {
|
|
53
59
|
type: [String, Object],
|
|
54
60
|
default: 'OK'
|
|
@@ -77,7 +83,9 @@ const emit = defineEmits([...useDialogPluginComponent.emits, 'update:modelValue'
|
|
|
77
83
|
const { dialogRef, onDialogOK, onDialogCancel } = useDialogPluginComponent()
|
|
78
84
|
const componentRef = ref()
|
|
79
85
|
const attrs = useAttrs()
|
|
86
|
+
const useModel = _.has(attrs, 'v-model')
|
|
80
87
|
const model = ref(attrs['v-model'])
|
|
88
|
+
const loading = ref(false)
|
|
81
89
|
|
|
82
90
|
// Computed
|
|
83
91
|
const computedButtons = computed(() => {
|
|
@@ -90,11 +98,12 @@ const computedButtons = computed(() => {
|
|
|
90
98
|
label: props.cancelAction,
|
|
91
99
|
outline: true,
|
|
92
100
|
renderer: 'form-button',
|
|
101
|
+
disabled: loading.value,
|
|
93
102
|
handler: onDialogCancel
|
|
94
103
|
})
|
|
95
104
|
} else {
|
|
96
105
|
// clone the action to overload the handler
|
|
97
|
-
const cancelButton = _.
|
|
106
|
+
const cancelButton = _.merge({ disabled: loading.value }, props.cancelAction)
|
|
98
107
|
if (cancelButton.handler) {
|
|
99
108
|
cancelButton.handler = async () => {
|
|
100
109
|
// ! call the original handler to avoid recursive call
|
|
@@ -111,16 +120,19 @@ const computedButtons = computed(() => {
|
|
|
111
120
|
id: 'ok-action',
|
|
112
121
|
label: props.okAction,
|
|
113
122
|
renderer: 'form-button',
|
|
123
|
+
loading: loading.value,
|
|
114
124
|
handler: onDialogOK
|
|
115
125
|
})
|
|
116
126
|
} else {
|
|
117
127
|
// clone the action to overload the handler
|
|
118
|
-
const okButton = _.
|
|
128
|
+
const okButton = _.merge({ loading: loading.value }, props.okAction)
|
|
119
129
|
if (okButton.handler) {
|
|
120
130
|
// overload the handler to call Quasar onDialogOK
|
|
121
131
|
okButton.handler = async () => {
|
|
122
|
-
// ! call the
|
|
132
|
+
// ! call the orignal handler to avoid recursive call
|
|
133
|
+
loading.value = true
|
|
123
134
|
const result = await callHandler(props.okAction.handler)
|
|
135
|
+
loading.value = false
|
|
124
136
|
// close dialog if and only if the handler returns true
|
|
125
137
|
if (result) onDialogOK(result)
|
|
126
138
|
}
|
|
@@ -132,6 +144,10 @@ const computedButtons = computed(() => {
|
|
|
132
144
|
const computedComponent = computed(() => {
|
|
133
145
|
return loadComponent(props.component)
|
|
134
146
|
})
|
|
147
|
+
const computedHandlers = computed(() => {
|
|
148
|
+
if (_.isEmpty(props.handlers)) return {}
|
|
149
|
+
return props.handlers
|
|
150
|
+
})
|
|
135
151
|
const computedModel = computed({
|
|
136
152
|
get: function () {
|
|
137
153
|
return model.value
|
|
@@ -141,6 +157,11 @@ const computedModel = computed({
|
|
|
141
157
|
emit('update:modelValue', value)
|
|
142
158
|
}
|
|
143
159
|
})
|
|
160
|
+
const computedAttrs = computed(() => {
|
|
161
|
+
return _.mapKeys(attrs, (value, key) => {
|
|
162
|
+
return _.replace(key, 'component.', '')
|
|
163
|
+
})
|
|
164
|
+
})
|
|
144
165
|
|
|
145
166
|
// Functions
|
|
146
167
|
async function callHandler (handler) {
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<KForm
|
|
3
|
+
ref="formRef"
|
|
4
|
+
:values="object"
|
|
5
|
+
:schema="schema"
|
|
6
|
+
:filter="filter"
|
|
7
|
+
/>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup>
|
|
11
|
+
import _ from 'lodash'
|
|
12
|
+
import logger from 'loglevel'
|
|
13
|
+
import { ref } from 'vue'
|
|
14
|
+
import { api, Context, i18n } from '@kalisio/kdk/core.client'
|
|
15
|
+
import { Notify } from 'quasar'
|
|
16
|
+
|
|
17
|
+
// Props
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
service: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: true
|
|
22
|
+
},
|
|
23
|
+
baseObject: {
|
|
24
|
+
type: Object,
|
|
25
|
+
default: () => null
|
|
26
|
+
},
|
|
27
|
+
object: {
|
|
28
|
+
type: Object,
|
|
29
|
+
default: () => null
|
|
30
|
+
},
|
|
31
|
+
schema: {
|
|
32
|
+
type: [String, Object],
|
|
33
|
+
default: () => null
|
|
34
|
+
},
|
|
35
|
+
filter: {
|
|
36
|
+
type: [String, Array],
|
|
37
|
+
default: () => null
|
|
38
|
+
},
|
|
39
|
+
beforeRequest: {
|
|
40
|
+
type: Function,
|
|
41
|
+
default: null
|
|
42
|
+
},
|
|
43
|
+
afterRequest: {
|
|
44
|
+
type: Function,
|
|
45
|
+
default: null
|
|
46
|
+
},
|
|
47
|
+
dense: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: false
|
|
50
|
+
},
|
|
51
|
+
notify: {
|
|
52
|
+
type: Object,
|
|
53
|
+
default: () => null
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
// Data
|
|
58
|
+
const formRef = ref(null)
|
|
59
|
+
const mode = props.object ? 'edition' : 'creation'
|
|
60
|
+
|
|
61
|
+
// Functions
|
|
62
|
+
function getContext () {
|
|
63
|
+
return { props, mode, form: formRef.value }
|
|
64
|
+
}
|
|
65
|
+
async function apply () {
|
|
66
|
+
// validate the form
|
|
67
|
+
const { isValid, values: formValues } = formRef.value.validate()
|
|
68
|
+
if (isValid) {
|
|
69
|
+
// merge values with base object
|
|
70
|
+
const values = _.merge(formValues, props.baseObject)
|
|
71
|
+
// retrieve the service
|
|
72
|
+
const context = Context.get()
|
|
73
|
+
const service = api.getService(props.service, context?.value)
|
|
74
|
+
if (!service) {
|
|
75
|
+
logger.error(`[KDK] Cannot find service ${props.service}`)
|
|
76
|
+
return
|
|
77
|
+
}
|
|
78
|
+
// run the beforeRequest hook
|
|
79
|
+
let response = { isOk: true, values }
|
|
80
|
+
if (props.beforeRequest) {
|
|
81
|
+
logger.debug('[KDK] Apply beforeRequest hook')
|
|
82
|
+
response = await props.beforeRequest(values, getContext())
|
|
83
|
+
}
|
|
84
|
+
if (!response.isOk) return false
|
|
85
|
+
// do the request
|
|
86
|
+
if (mode === 'creation') {
|
|
87
|
+
logger.debug('[KDK] Create object with data', response.values)
|
|
88
|
+
try {
|
|
89
|
+
await service.create(response.values)
|
|
90
|
+
if (_.has(props, 'notify.created.success')) Notify.create({ type: 'positive', message: i18n.t(_.get(props, 'notify.created.success')) })
|
|
91
|
+
} catch (error) {
|
|
92
|
+
if (_.has(props, 'notify.created.error')) Notify.create({ type: 'negative', message: i18n.t(_.get(props, 'notify.created.error')) })
|
|
93
|
+
}
|
|
94
|
+
} else {
|
|
95
|
+
logger.debug(`[KDK] Patch object ${props.object._id} with data`, response.values)
|
|
96
|
+
try {
|
|
97
|
+
await service.patch(props.object._id, response.values)
|
|
98
|
+
if (_.has(props, 'notify.updated.success')) Notify.create({ type: 'positive', message: i18n.t(_.get(props, 'notify.updated.success')) })
|
|
99
|
+
} catch (error) {
|
|
100
|
+
if (_.has(props, 'notify.updated.error')) Notify.create({ type: 'negative', message: i18n.t(_.get(props, 'notify.updated.error')) })
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// run the afterRequest hook
|
|
104
|
+
if (props.afterRequest) {
|
|
105
|
+
logger.debug('[KDK] Apply afterRequest hook')
|
|
106
|
+
response = await props.afterRequest(values, { mode, form: formRef.value, ...props })
|
|
107
|
+
}
|
|
108
|
+
if (!response.isOk) return false
|
|
109
|
+
return true
|
|
110
|
+
} else {
|
|
111
|
+
logger.debug('[KDK] Form is invalid')
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Expose
|
|
116
|
+
defineExpose({
|
|
117
|
+
apply,
|
|
118
|
+
getContext
|
|
119
|
+
})
|
|
120
|
+
</script>
|