From 84dffe43a6c97f0d110bc199d26791b795590bd0 Mon Sep 17 00:00:00 2001
From: CodexAdrian <83074853+CodexAdrian@users.noreply.github.com>
Date: Mon, 21 Aug 2023 15:53:48 -0400
Subject: [PATCH 1/4] Bar charts
---
docs/components/analytics.md | 27 +++++++
lib/components/base/BarChart.vue | 115 ++++++++++++++++++++++++++++++
lib/components/base/LineChart.vue | 6 +-
lib/components/base/PieChart.vue | 6 +-
lib/components/index.js | 1 +
5 files changed, 150 insertions(+), 5 deletions(-)
create mode 100644 lib/components/base/BarChart.vue
diff --git a/docs/components/analytics.md b/docs/components/analytics.md
index a8ac71a24..0ba7cfcd9 100644
--- a/docs/components/analytics.md
+++ b/docs/components/analytics.md
@@ -28,6 +28,33 @@
]
}"
/>
+
+
+
+
diff --git a/lib/components/base/LineChart.vue b/lib/components/base/LineChart.vue
index 7aee0212b..332f76fb5 100644
--- a/lib/components/base/LineChart.vue
+++ b/lib/components/base/LineChart.vue
@@ -42,7 +42,7 @@ const chartData = ref({
labels: props.data.labels.map((date) => props.formatLabels(date)),
datasets: props.data.data.map((project) => ({
label: project.title,
- backgroundColor: decimalToRgba(project.color, 0.75),
+ backgroundColor: decimalToRgba(project.color, 0.5),
borderColor: decimalToRgba(project.color),
data: project.data,
})),
@@ -69,7 +69,9 @@ const chartOptions = ref({
},
},
interaction: {
- mode: 'x',
+ mode: 'index',
+ intersect: false,
+ axis: 'xy',
},
plugins: {
legend: {
diff --git a/lib/components/base/PieChart.vue b/lib/components/base/PieChart.vue
index caa5c0f58..e30317a45 100644
--- a/lib/components/base/PieChart.vue
+++ b/lib/components/base/PieChart.vue
@@ -21,7 +21,7 @@ const props = defineProps({
},
})
-const decimalToRgba = (decimalColor, alpha = 0.75) => {
+const decimalToRgba = (decimalColor, alpha = 1) => {
const red = (decimalColor >> 16) & 255
const green = (decimalColor >> 8) & 255
const blue = decimalColor & 255
@@ -34,8 +34,8 @@ const chartData = ref({
datasets: [
{
label: props.data.title,
- backgroundColor: props.data.data.map((project) => decimalToRgba(project.color)),
- borderColor: getComputedStyle(document.documentElement).getPropertyValue('--color-button-bg'),
+ backgroundColor: props.data.data.map((project) => decimalToRgba(project.color, 0.5)),
+ borderColor: props.data.data.map((project) => decimalToRgba(project.color)),
data: props.data.data.map((project) => project.data),
fill: true,
},
diff --git a/lib/components/index.js b/lib/components/index.js
index 6151b05eb..41faa5859 100644
--- a/lib/components/index.js
+++ b/lib/components/index.js
@@ -26,6 +26,7 @@ export { default as DropdownButton } from './base/DropdownButton.vue'
export { default as ShareModal } from './base/ShareModal.vue'
export { default as LineChart } from './base/LineChart.vue'
export { default as PieChart } from './base/PieChart.vue'
+export { default as BarChart } from './base/BarChart.vue'
export { default as Categories } from './search/Categories.vue'
export { default as SearchFilter } from './search/SearchFilter.vue'
From 0a7989bbe61e2ad4c2fc7a76d6218518152109fb Mon Sep 17 00:00:00 2001
From: CodexAdrian <83074853+CodexAdrian@users.noreply.github.com>
Date: Mon, 21 Aug 2023 15:54:41 -0400
Subject: [PATCH 2/4] Update package.json
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 66ecf50e5..bd790694d 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "omorphia",
"type": "module",
- "version": "0.4.39",
+ "version": "0.4.40",
"files": [
"dist",
"lib"
From 71cdb5cd7cd2c675d7da5a0cea11e458d2d173f2 Mon Sep 17 00:00:00 2001
From: CodexAdrian <83074853+CodexAdrian@users.noreply.github.com>
Date: Tue, 12 Sep 2023 14:21:46 -0400
Subject: [PATCH 3/4] Search Dropdown
---
docs/.vitepress/config.js | 1 +
docs/components/search-dropdown.md | 190 +++++++++++++
lib/components/index.js | 1 +
lib/components/search/SearchDropdown.vue | 325 +++++++++++++++++++++++
4 files changed, 517 insertions(+)
create mode 100644 docs/components/search-dropdown.md
create mode 100644 lib/components/search/SearchDropdown.vue
diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js
index 023231ae2..56011ad8e 100644
--- a/docs/.vitepress/config.js
+++ b/docs/.vitepress/config.js
@@ -46,6 +46,7 @@ export default {
{ text: 'Notifications', link: '/components/notifications' },
{ text: 'Share Modal', link: '/components/share-modal' },
{ text: 'Analytics', link: '/components/analytics' },
+ { text: 'Search dropdown', link: '/components/search-dropdown' },
],
},
],
diff --git a/docs/components/search-dropdown.md b/docs/components/search-dropdown.md
new file mode 100644
index 000000000..199c16f5e
--- /dev/null
+++ b/docs/components/search-dropdown.md
@@ -0,0 +1,190 @@
+# Search Dropdown
+
+
+
+
+
+{{options}}
+
+{{text}}
+
+
+
+
+
+
+
+
+
diff --git a/lib/components/index.js b/lib/components/index.js
index 41faa5859..67f1a74c1 100644
--- a/lib/components/index.js
+++ b/lib/components/index.js
@@ -27,6 +27,7 @@ export { default as ShareModal } from './base/ShareModal.vue'
export { default as LineChart } from './base/LineChart.vue'
export { default as PieChart } from './base/PieChart.vue'
export { default as BarChart } from './base/BarChart.vue'
+export { default as SearchDropdown } from './search/SearchDropdown.vue'
export { default as Categories } from './search/Categories.vue'
export { default as SearchFilter } from './search/SearchFilter.vue'
diff --git a/lib/components/search/SearchDropdown.vue b/lib/components/search/SearchDropdown.vue
new file mode 100644
index 000000000..1bd2b77fd
--- /dev/null
+++ b/lib/components/search/SearchDropdown.vue
@@ -0,0 +1,325 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ displayName(option.title) }}
+
+
+ {{ displayName(option.author) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
From 71c89cb5a13751fdae0672ffc13cfa1067973105 Mon Sep 17 00:00:00 2001
From: CodexAdrian <83074853+CodexAdrian@users.noreply.github.com>
Date: Wed, 13 Sep 2023 16:06:03 -0400
Subject: [PATCH 4/4] Add circle icon option
---
docs/components/search-dropdown.md | 201 ++++++-----------------
lib/components/search/SearchDropdown.vue | 8 +-
2 files changed, 58 insertions(+), 151 deletions(-)
diff --git a/docs/components/search-dropdown.md b/docs/components/search-dropdown.md
index 199c16f5e..0d00ffb3c 100644
--- a/docs/components/search-dropdown.md
+++ b/docs/components/search-dropdown.md
@@ -1,190 +1,93 @@
# Search Dropdown
-
{{options}}
-
{{text}}
-
-
+
+
+```vue
-
-
-
-
+```
diff --git a/lib/components/search/SearchDropdown.vue b/lib/components/search/SearchDropdown.vue
index 1bd2b77fd..0cd05f18e 100644
--- a/lib/components/search/SearchDropdown.vue
+++ b/lib/components/search/SearchDropdown.vue
@@ -48,13 +48,13 @@
@click="selectOption(option)"
>
-
+
{{ displayName(option.title) }}
- {{ displayName(option.author) }}
+ {{ displayName(option.subtitle) }}
@@ -98,6 +98,10 @@ const props = defineProps({
type: Function,
default: (option) => option,
},
+ circledIcons: {
+ type: Boolean,
+ default: false,
+ },
})
const emit = defineEmits(['input', 'onSelected', 'update:modelValue', 'enter'])