From fd11ef8f49357ce9aedabc90327850a4cfab0455 Mon Sep 17 00:00:00 2001 From: Matthew White Date: Sun, 8 Dec 2024 22:38:11 -0500 Subject: [PATCH 1/6] Set up hover cards --- .eslintrc.js | 3 +- src/assets/scss/_variables.scss | 3 + src/assets/scss/app.scss | 5 +- src/components/app.vue | 9 +- src/components/audit/row.vue | 31 +++-- src/components/hover-card.vue | 167 +++++++++++++++++++++++++++ src/components/hover-cards.vue | 99 ++++++++++++++++ src/components/popover.vue | 16 ++- src/composables/event-listener.js | 31 ++++- src/composables/hover-card.js | 52 +++++++++ src/container.js | 4 + src/container/hover-card.js | 57 +++++++++ src/directives/tooltip.js | 8 +- src/request-data/hover-card.js | 24 ++++ src/util/dom.js | 8 ++ src/util/load-async.js | 4 + test/components/hover-card.spec.js | 13 +++ test/container/hover-card.spec.js | 35 ++++++ test/util/components/hover-cards.vue | 26 +++++ test/util/dom.js | 21 +++- test/util/request-data.js | 4 +- 21 files changed, 582 insertions(+), 38 deletions(-) create mode 100644 src/components/hover-card.vue create mode 100644 src/components/hover-cards.vue create mode 100644 src/composables/hover-card.js create mode 100644 src/container/hover-card.js create mode 100644 src/request-data/hover-card.js create mode 100644 test/components/hover-card.spec.js create mode 100644 test/container/hover-card.spec.js create mode 100644 test/util/components/hover-cards.vue diff --git a/.eslintrc.js b/.eslintrc.js index a90b749d1..d83512ef7 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -52,9 +52,8 @@ module.exports = { 'spaced-comment': 'off', 'vue/attributes-order': ['error', { order: [ - 'DEFINITION', 'LIST_RENDERING', - 'CONDITIONALS', + ['CONDITIONALS', 'DEFINITION'], 'RENDER_MODIFIERS', 'GLOBAL', ['UNIQUE', 'SLOT'], diff --git a/src/assets/scss/_variables.scss b/src/assets/scss/_variables.scss index b7f98400f..0493f80d0 100644 --- a/src/assets/scss/_variables.scss +++ b/src/assets/scss/_variables.scss @@ -61,6 +61,8 @@ $padding-top-btn: 6px; $font-size-dropdown-menu: $font-size-btn; $min-width-dropdown-menu: 150px; +$padding-block-dl: 10px; + // Forms $padding-top-form-control: 6px; @@ -94,6 +96,7 @@ $color-subpanel-border-strong: #c3c3c3; $ease-extreme-out: cubic-bezier(.05, .9, 0, 1); + //////////////////////////////////////////////////////////////////////////////// // COMPONENTS diff --git a/src/assets/scss/app.scss b/src/assets/scss/app.scss index 463a689cc..0f8954c84 100644 --- a/src/assets/scss/app.scss +++ b/src/assets/scss/app.scss @@ -42,8 +42,7 @@ p { @include text-block; } dl > * { border-bottom: 1px solid #ddd; - padding-bottom: 10px; - padding-top: 10px; + padding-block: $padding-block-dl; &:first-of-type { padding-top: 0; } @@ -75,7 +74,7 @@ dl:not(.dl-horizontal) { // down to the fact that .dl-horizontal uses a CSS grid, while other
// elements use flexbox. .dl-horizontal { - $padding-between: 10px; + $padding-between: 12px; $dt-width: 160px + $padding-panel-body + $padding-between; display: grid; diff --git a/src/components/app.vue b/src/components/app.vue index 0fc9331ff..85e91e509 100644 --- a/src/components/app.vue +++ b/src/components/app.vue @@ -27,7 +27,9 @@ except according to the terms contained in the LICENSE file. +
+ @@ -48,7 +50,12 @@ import { loadAsync } from '../util/load-async'; export default { name: 'App', - components: { Alert, Navbar, FeedbackButton: defineAsyncComponent(loadAsync('FeedbackButton')) }, + components: { + Alert, + HoverCards: defineAsyncComponent(loadAsync('HoverCards')), + Navbar, + FeedbackButton: defineAsyncComponent(loadAsync('FeedbackButton')) + }, inject: ['alert', 'config'], setup() { const { visiblyLoggedIn } = useSessions(); diff --git a/src/components/audit/row.vue b/src/components/audit/row.vue index 090e30bba..d52fb2c77 100644 --- a/src/components/audit/row.vue +++ b/src/components/audit/row.vue @@ -29,7 +29,9 @@ except according to the terms contained in the LICENSE file.