Skip to content

Commit

Permalink
feat: move and prefix core components with letter D
Browse files Browse the repository at this point in the history
  • Loading branch information
tada5hi committed Jan 3, 2024
1 parent 82a51ff commit becfa81
Show file tree
Hide file tree
Showing 50 changed files with 198 additions and 192 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"**/test/**/*.spec.js",
"**/test/**/*.spec.ts",
"**/rollup.config.mjs",
"packages/core/**",
"packages/portal/**",
"packages/mtb/**",
"packages/rd/**"
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions packages/core/assets/form-range-slider.css
Original file line number Diff line number Diff line change
@@ -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;
}
54 changes: 54 additions & 0 deletions packages/core/assets/form-search.css
Original file line number Diff line number Diff line change
@@ -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;
}
4 changes: 3 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion packages/core/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
3 changes: 0 additions & 3 deletions packages/core/src/components/alert/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/core/src/components/code-system/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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',
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/components/core/code-system/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as DCodeSystem } from './DCodeSystem';
2 changes: 2 additions & 0 deletions packages/core/src/components/core/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './code-system';
export * from './value-set';
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/components/core/value-set/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as DValueSet } from './DValueSet';
1 change: 0 additions & 1 deletion packages/core/src/components/error/index.ts

This file was deleted.

7 changes: 2 additions & 5 deletions packages/core/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -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';
4 changes: 0 additions & 4 deletions packages/core/src/components/nav/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { hasNormalizedSlot, normalizeSlot } from '@dnpm-dip/core';
import type { PropType } from 'vue';
import { computed, defineComponent, h } from 'vue';
import { hasNormalizedSlot, normalizeSlot } from '../../core';
export default defineComponent({
props: {
Expand All @@ -14,7 +14,7 @@ export default defineComponent({
},
},
emits: ['update:modelValue'],
setup(props, { emit, slots }) {
setup(props, { slots }) {
const codings = computed(() => {
if (!props.items.length) {
return [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ export default defineComponent({
<slot>
<ul class="list-unstyled mb-0 d-flex flex-wrap align-items-center">
<template
v-for="(item, index) in tags"
:key="index"
v-for="(item) in tags"
:key="item.id"
>
<slot
name="tag"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { PropType } from 'vue';
import { defineComponent, h } from 'vue';

export default defineComponent({
name: 'AlertError',
props: {
error: {
type: Object as PropType<Error>,
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/components/utility/alert/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export {
default as DAlertError,
} from './DAlertError';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { PropType, SlotsType } from 'vue';
import { defineComponent } from 'vue';
import type { ErrorCollectionSlotProps, ErrorSlotProps } from '../../core';
import { renderError } from '../../core';
import type { ErrorCollectionSlotProps, ErrorSlotProps } from '../../../core';
import { renderError } from '../../../core';

export default defineComponent({
props: {
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/components/utility/error/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as DAPIClientError } from './DAPIClientError';
Original file line number Diff line number Diff line change
Expand Up @@ -79,45 +79,3 @@ export default defineComponent({
</div>
</div>
</template>
<style>
.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;
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as DFormRangeSlider } from './DFormRangeSlider.vue';
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export class FormRangeSlider {
this.mouseX = event.x;
}

protected mouseUpEventHandler(event: MouseEvent) {
protected mouseUpEventHandler() {
if (!this.sliderMin || !this.sliderMax) return;

this.sliderMin.stopDrag();
Expand All @@ -173,7 +173,7 @@ export class FormRangeSlider {
this.mouseX = FormRangeSlider.getTouchPosition(event);
}

protected touchEndEventHandler(event: TouchEvent) {
protected touchEndEventHandler() {
if (!this.sliderMin || !this.sliderMax) return;

this.sliderMin.stopDrag();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import type { PropType } from 'vue';
import {
computed, defineComponent, ref, toRef, watch,
} from 'vue';
import FormSelectSearchEntry from './FormSelectSearchEntry.vue';
import FormSelectSearchEntry from './DFormSelectSearchEntry.vue';
type Option = {
id: string | number,
Expand Down Expand Up @@ -311,60 +311,3 @@ export default defineComponent({
},
});
</script>

<style scoped>
.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;
}
</style>
1 change: 1 addition & 0 deletions packages/core/src/components/utility/form-select/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as DFormSelectSearch } from './DFormSelectSearch.vue';
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default defineComponent({
init();
watch(modelValue, (val) => {
watch(modelValue, () => {
init();
}, { deep: true });
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/components/utility/form-tab/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as DFormTabGroups } from './DFormTabGroups.vue';
Loading

0 comments on commit becfa81

Please sign in to comment.