diff --git a/.eslintrc b/.eslintrc index e4c10441..8e6f7a78 100644 --- a/.eslintrc +++ b/.eslintrc @@ -18,6 +18,7 @@ "**/test/**/*.spec.js", "**/test/**/*.spec.ts", "**/rollup.config.mjs", + "packages/core/**", "packages/portal/**", "packages/mtb/**", "packages/rd/**" diff --git a/package-lock.json b/package-lock.json index 28f401ed..a412b4ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27012,6 +27012,7 @@ "@nuxt/kit": "^3.9.0", "@nuxt/schema": "^3.9.0", "@vuecs/link": "^1.0.0", + "bootstrap-vue-next": "^0.15.5", "vue": "^3.4.1", "vue-tsc": "^1.8.27" }, diff --git a/packages/core/assets/form-range-slider.css b/packages/core/assets/form-range-slider.css new file mode 100644 index 00000000..1ad57cb8 --- /dev/null +++ b/packages/core/assets/form-range-slider.css @@ -0,0 +1,40 @@ +.bs-multi-range { + width: 100%; +} + +.bs-multi-range>.track { + width: 100%; + background: #f0f0f0; + height: 8px; + border-radius: 1rem; +} + +.bs-multi-range .thumb { + z-index: 1; + height: 16px; + width: 16px; + + background: #6d7fcc; + + border-radius: 100%; + + position: relative; + + cursor: pointer; +} + +.bs-multi-range .upper { + bottom: calc(16px / 4); +} + +.bs-multi-range .lower { + bottom: calc(calc(16px / 4) + 16px) +} + +.bs-multi-range .track-diff { + height: 8px; + position: relative; + left: 0; + bottom: 32px; + background: lightgray; +} diff --git a/packages/core/assets/form-search.css b/packages/core/assets/form-search.css new file mode 100644 index 00000000..f48baf58 --- /dev/null +++ b/packages/core/assets/form-search.css @@ -0,0 +1,54 @@ +.dropdown { + position: relative; + display: block; +} + +.dropdown .dropdown-input { + cursor: pointer; + border: 1px solid #e7ecf5; + display: block; + padding: 0.375rem 0.75rem; + width: 100%; + color: var(--bs-body-color); + appearance: none; + background-color: var(--bs-body-bg); + background-clip: padding-box; + border: var(--bs-border-width) solid var(--bs-border-color); + border-radius: var(--bs-border-radius); + transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; +} + +.dropdown .dropdown-input:disabled { + background-color: var(--bs-secondary-bg); + opacity: 1; +} + +.dropdown .dropdown-content { + display: block; + position: absolute; + background-color: #fff; + width:100%; + border: var(--bs-border-width) solid var(--bs-border-color); + overflow: auto; + z-index: 999; +} + +.dropdown .dropdown-content .dropdown-item { + color: black; + cursor: pointer; + display: block; + padding: 0.35rem; +} + +.dropdown .dropdown-content .dropdown-item:hover, +.dropdown .dropdown-content .dropdown-item.current { + background-color: #e7ecf5 !important; +} + +.dropdown .dropdown-content .dropdown-item.active { + background-color: #a2b1f1; +} + +.dropdown .dropdown-selected { + margin-top: 0.25rem; +} diff --git a/packages/core/package.json b/packages/core/package.json index f0dfae8b..248de4dd 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -8,7 +8,8 @@ "types": "./dist/index.d.ts", "import": "./dist/index.mjs", "require": "./dist/index.cjs" - } + }, + "./dist/index.css": "./dist/index.css" }, "main": "./dist/index.cjs", "module": "./dist/index.mjs", @@ -46,6 +47,7 @@ "ufo": "^1.3.2" }, "devDependencies": { + "bootstrap-vue-next": "^0.15.5", "@nuxt/schema": "^3.9.0", "@nuxt/kit": "^3.9.0", "@vuecs/link": "^1.0.0", diff --git a/packages/core/rollup.config.mjs b/packages/core/rollup.config.mjs index 9b413947..13eee00a 100644 --- a/packages/core/rollup.config.mjs +++ b/packages/core/rollup.config.mjs @@ -5,7 +5,6 @@ * view the LICENSE file that was distributed with this source code. */ -import vue from '@vitejs/plugin-vue'; import fs from 'node:fs'; import { createConfig } from '../../rollup.config.mjs'; diff --git a/packages/core/src/components/alert/index.ts b/packages/core/src/components/alert/index.ts deleted file mode 100644 index 9719940b..00000000 --- a/packages/core/src/components/alert/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { - default as AlertError, -} from './AlertError'; diff --git a/packages/core/src/components/code-system/index.ts b/packages/core/src/components/code-system/index.ts deleted file mode 100644 index b0ba635f..00000000 --- a/packages/core/src/components/code-system/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as CodeSystemEntity } from './CodeSystemEntity'; diff --git a/packages/core/src/components/code-system/CodeSystemEntity.ts b/packages/core/src/components/core/code-system/DCodeSystem.ts similarity index 93% rename from packages/core/src/components/code-system/CodeSystemEntity.ts rename to packages/core/src/components/core/code-system/DCodeSystem.ts index 5989b2d7..5c27eabc 100644 --- a/packages/core/src/components/code-system/CodeSystemEntity.ts +++ b/packages/core/src/components/core/code-system/DCodeSystem.ts @@ -1,6 +1,6 @@ import { defineComponent, toRef } from 'vue'; -import type { APIClient } from '../../core'; -import { createResourceRecordManager, injectAPIClient } from '../../core'; +import type { APIClient } from '../../../core'; +import { createResourceRecordManager, injectAPIClient } from '../../../core'; export default defineComponent({ name: 'CodeSystemEntity', diff --git a/packages/core/src/components/core/code-system/index.ts b/packages/core/src/components/core/code-system/index.ts new file mode 100644 index 00000000..624afb83 --- /dev/null +++ b/packages/core/src/components/core/code-system/index.ts @@ -0,0 +1 @@ +export { default as DCodeSystem } from './DCodeSystem'; diff --git a/packages/core/src/components/core/index.ts b/packages/core/src/components/core/index.ts new file mode 100644 index 00000000..ea25ed24 --- /dev/null +++ b/packages/core/src/components/core/index.ts @@ -0,0 +1,2 @@ +export * from './code-system'; +export * from './value-set'; diff --git a/packages/core/src/components/value-set/ValueSetEntity.ts b/packages/core/src/components/core/value-set/DValueSet.ts similarity index 85% rename from packages/core/src/components/value-set/ValueSetEntity.ts rename to packages/core/src/components/core/value-set/DValueSet.ts index 358d1c66..ed09b788 100644 --- a/packages/core/src/components/value-set/ValueSetEntity.ts +++ b/packages/core/src/components/core/value-set/DValueSet.ts @@ -1,14 +1,13 @@ import type { SlotsType } from 'vue'; import { defineComponent, toRef } from 'vue'; -import type { APIClient, ResourceRecordSlots } from '../../core'; +import type { APIClient, ResourceRecordSlots } from '../../../core'; import { createResourceRecordManager, injectAPIClient, -} from '../../core'; -import type { ValueSet } from '../../domains'; +} from '../../../core'; +import type { ValueSet } from '../../../domains'; export default defineComponent({ - name: 'ValueSetEntity', props: { code: { type: String, diff --git a/packages/core/src/components/core/value-set/index.ts b/packages/core/src/components/core/value-set/index.ts new file mode 100644 index 00000000..6b286f8a --- /dev/null +++ b/packages/core/src/components/core/value-set/index.ts @@ -0,0 +1 @@ +export { default as DValueSet } from './DValueSet'; diff --git a/packages/core/src/components/error/index.ts b/packages/core/src/components/error/index.ts deleted file mode 100644 index 36a9ac19..00000000 --- a/packages/core/src/components/error/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as APIClientErrorBox } from './APIClientErrorBox'; diff --git a/packages/core/src/components/index.ts b/packages/core/src/components/index.ts index 2cb8d51a..74ea92a8 100644 --- a/packages/core/src/components/index.ts +++ b/packages/core/src/components/index.ts @@ -1,5 +1,2 @@ -export * from './alert'; -export * from './error'; -export * from './code-system'; -export * from './nav'; -export * from './value-set'; +export * from './core'; +export * from './utility'; diff --git a/packages/core/src/components/nav/index.ts b/packages/core/src/components/nav/index.ts deleted file mode 100644 index 29ac1c11..00000000 --- a/packages/core/src/components/nav/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { - default as Nav, -} from './Nav'; -export * from './types'; diff --git a/packages/rd/src/runtime/components/utility/CollectionTransform.vue b/packages/core/src/components/utility/DCollectionTransform.vue similarity index 89% rename from packages/rd/src/runtime/components/utility/CollectionTransform.vue rename to packages/core/src/components/utility/DCollectionTransform.vue index 9eb27fcb..9d3b47f5 100644 --- a/packages/rd/src/runtime/components/utility/CollectionTransform.vue +++ b/packages/core/src/components/utility/DCollectionTransform.vue @@ -1,7 +1,7 @@ - - diff --git a/packages/rd/src/runtime/components/utility/FormSelectSearchEntry.vue b/packages/core/src/components/utility/form-select/DFormSelectSearchEntry.vue similarity index 100% rename from packages/rd/src/runtime/components/utility/FormSelectSearchEntry.vue rename to packages/core/src/components/utility/form-select/DFormSelectSearchEntry.vue diff --git a/packages/core/src/components/utility/form-select/index.ts b/packages/core/src/components/utility/form-select/index.ts new file mode 100644 index 00000000..90584eee --- /dev/null +++ b/packages/core/src/components/utility/form-select/index.ts @@ -0,0 +1 @@ +export { default as DFormSelectSearch } from './DFormSelectSearch.vue'; diff --git a/packages/rd/src/runtime/components/utility/FormTabGroups.vue b/packages/core/src/components/utility/form-tab/DFormTabGroups.vue similarity index 99% rename from packages/rd/src/runtime/components/utility/FormTabGroups.vue rename to packages/core/src/components/utility/form-tab/DFormTabGroups.vue index 452ca097..e38112e1 100644 --- a/packages/rd/src/runtime/components/utility/FormTabGroups.vue +++ b/packages/core/src/components/utility/form-tab/DFormTabGroups.vue @@ -59,7 +59,7 @@ export default defineComponent({ init(); - watch(modelValue, (val) => { + watch(modelValue, () => { init(); }, { deep: true }); diff --git a/packages/core/src/components/utility/form-tab/index.ts b/packages/core/src/components/utility/form-tab/index.ts new file mode 100644 index 00000000..fa259ef4 --- /dev/null +++ b/packages/core/src/components/utility/form-tab/index.ts @@ -0,0 +1 @@ +export { default as DFormTabGroups } from './DFormTabGroups.vue'; diff --git a/packages/core/src/components/utility/index.ts b/packages/core/src/components/utility/index.ts new file mode 100644 index 00000000..0c979c3e --- /dev/null +++ b/packages/core/src/components/utility/index.ts @@ -0,0 +1,9 @@ +export * from './alert'; +export * from './error'; +export * from './form-range-slider'; +export * from './form-select'; +export * from './form-tab'; +export * from './nav'; + +export { default as DCollectionTransform } from './DCollectionTransform.vue'; +export { default as DTags } from './DTags.vue'; diff --git a/packages/core/src/components/nav/Nav.ts b/packages/core/src/components/utility/nav/DNav.ts similarity index 100% rename from packages/core/src/components/nav/Nav.ts rename to packages/core/src/components/utility/nav/DNav.ts diff --git a/packages/core/src/components/utility/nav/index.ts b/packages/core/src/components/utility/nav/index.ts new file mode 100644 index 00000000..48012652 --- /dev/null +++ b/packages/core/src/components/utility/nav/index.ts @@ -0,0 +1,4 @@ +export { + default as DNav, +} from './DNav'; +export * from './types'; diff --git a/packages/core/src/components/nav/types.ts b/packages/core/src/components/utility/nav/types.ts similarity index 100% rename from packages/core/src/components/nav/types.ts rename to packages/core/src/components/utility/nav/types.ts diff --git a/packages/core/src/components/nav/utils.ts b/packages/core/src/components/utility/nav/utils.ts similarity index 100% rename from packages/core/src/components/nav/utils.ts rename to packages/core/src/components/utility/nav/utils.ts diff --git a/packages/core/src/components/value-set/index.ts b/packages/core/src/components/value-set/index.ts deleted file mode 100644 index 3f5f5a3d..00000000 --- a/packages/core/src/components/value-set/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as ValueSetEntity } from './ValueSetEntity'; diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index ea979822..9059724b 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,3 +1,6 @@ +import '../assets/form-range-slider.css'; +import '../assets/form-search.css'; + export * from './core'; export * from './components'; export * from './domains'; diff --git a/packages/kit/src/module.ts b/packages/kit/src/module.ts index 6233e527..c01fd049 100644 --- a/packages/kit/src/module.ts +++ b/packages/kit/src/module.ts @@ -41,7 +41,13 @@ export async function register(context: RegistrationContext) { url: context.baseURL, }; - const sideNavigationItems : NavigationItem[] = context.navigationItems; + // todo: enable deeply nested nav items. + const sideNavigationItems : NavigationItem[] = context.navigationItems + .map((item) => { + item.url = context.baseURL + item.url; + + return item; + }); addPluginTemplate({ options: { diff --git a/packages/portal/nuxt.config.ts b/packages/portal/nuxt.config.ts index b36dd4cd..c72ef33a 100644 --- a/packages/portal/nuxt.config.ts +++ b/packages/portal/nuxt.config.ts @@ -21,6 +21,7 @@ export default defineNuxtConfig({ '@/assets/css/card.css', '@/assets/css/list.css', '@/assets/css/pagination.css', + '@dnpm-dip/core/../dist/index.css', ], alias: { '@dnpm-dip/core': path.join(__dirname, '..', 'core', 'src'), diff --git a/packages/rd/src/runtime/components/core/QueryPatientFilters.vue b/packages/rd/src/runtime/components/core/QueryPatientFilters.vue index 33b58902..53b14bd4 100644 --- a/packages/rd/src/runtime/components/core/QueryPatientFilters.vue +++ b/packages/rd/src/runtime/components/core/QueryPatientFilters.vue @@ -4,11 +4,11 @@ import { computed, defineComponent, ref, watch, } from 'vue'; import type { PatientFilter, URLQueryRecord } from '@dnpm-dip/core'; -import FormRangeSlider from '../utility/form-range-slider/FormRangeSlider.vue'; +import { DFormRangeSlider } from '@dnpm-dip/core'; export default defineComponent({ components: { - FormRangeSlider, + DFormRangeSlider, }, props: { availableFilters: { @@ -306,7 +306,7 @@ export default defineComponent({