diff --git a/app/.vitepress/src/shared/styles/markdown.scss b/app/.vitepress/src/shared/styles/markdown.scss index 15892cd79e9c09f820c6ab52277995500fe91706..dc13edb5c0e39c9f15a7ded5928451de34cb58d9 100644 --- a/app/.vitepress/src/shared/styles/markdown.scss +++ b/app/.vitepress/src/shared/styles/markdown.scss @@ -187,10 +187,6 @@ width: 100% !important; } } - - a[href^='#'] { - display: none; - } code, pre { text-align: left; diff --git a/app/.vitepress/theme/index.ts b/app/.vitepress/theme/index.ts index 0494512992900788ca94b11553222df2bbb2627c..0fa9d688bcc3030e5efe1adbd47c5d3af81aa285 100644 --- a/app/.vitepress/theme/index.ts +++ b/app/.vitepress/theme/index.ts @@ -1,5 +1,4 @@ import type { App } from 'vue'; -import { createPinia } from 'pinia'; import '@/shared/styles/element-plus/index.scss'; import '@/shared/styles/index.scss'; @@ -19,7 +18,6 @@ export default { // @ts-ignore global.window = {}; } - app.use(createPinia()); app.use(ElementPlus); app.use(OpenDesign); diff --git a/opendesign/checkbox/index.ts b/opendesign/checkbox/index.ts deleted file mode 100644 index 4992370144fecef6c5fa2847d94461481990b747..0000000000000000000000000000000000000000 --- a/opendesign/checkbox/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { App } from 'vue'; -import Checkbox from './src/checkbox'; -import CheckboxGroup from './src/checkbox-group'; - -Checkbox.install = function (app: App) { - app.component(Checkbox.name, Checkbox); -}; - -CheckboxGroup.install = function (app: App) { - app.component(CheckboxGroup.name, CheckboxGroup); -}; - -export { Checkbox, CheckboxGroup }; diff --git a/opendesign/checkbox/src/checkbox-group-types.ts b/opendesign/checkbox/src/checkbox-group-types.ts deleted file mode 100644 index 608fe1a1a2767c66c863bc97c830c922ddc9093a..0000000000000000000000000000000000000000 --- a/opendesign/checkbox/src/checkbox-group-types.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { ExtractDefaultPropTypes, InjectionKey, PropType, Ref } from 'vue'; - -export const checkboxGroupProps = { - // 双向绑定值 - modelValue: { - type: Array as PropType>, - default: null, - }, - // 是否禁用 - disabled: { - type: Boolean, - default: false, - }, -}; - -export type CheckboxGroupProps = ExtractDefaultPropTypes< - typeof checkboxGroupProps ->; - -interface CheckboxGroupInjection { - modelValue: Ref>; - disabled: Ref; - // eslint-disable-next-line no-unused-vars - onChange: (val: Array) => void; -} - -export const checkboxGroupKey: InjectionKey = - Symbol('OCheckboxGroup'); diff --git a/opendesign/checkbox/src/checkbox-group.scss b/opendesign/checkbox/src/checkbox-group.scss deleted file mode 100644 index 4b7bd0f3a9a6216085936106622224228a5ae96c..0000000000000000000000000000000000000000 --- a/opendesign/checkbox/src/checkbox-group.scss +++ /dev/null @@ -1,7 +0,0 @@ -.o-checkbox-group { - display: flex; - align-items: center; - .o-checkbox + .o-checkbox { - margin-left: 24px; - } -} diff --git a/opendesign/checkbox/src/checkbox-group.tsx b/opendesign/checkbox/src/checkbox-group.tsx deleted file mode 100644 index 62bd5f34c7e8c1fd0892d453ff421e05c2e9272c..0000000000000000000000000000000000000000 --- a/opendesign/checkbox/src/checkbox-group.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { defineComponent, provide, toRefs } from 'vue'; -import { - checkboxGroupKey, - checkboxGroupProps, - CheckboxGroupProps, -} from './checkbox-group-types'; -import './checkbox-group.scss'; - -export default defineComponent({ - name: 'OCheckboxGroup', - props: checkboxGroupProps, - emits: ['update:modelValue', 'change'], - setup(props: CheckboxGroupProps, { emit, slots }) { - const { modelValue, disabled } = toRefs(props); - - const onChange = (val: Array) => { - emit('update:modelValue', val); - emit('change', val); - }; - - // 注入 - provide(checkboxGroupKey, { modelValue, disabled, onChange }); - - return () => { - return
{slots.default?.()}
; - }; - }, -}); diff --git a/opendesign/checkbox/src/checkbox-types.ts b/opendesign/checkbox/src/checkbox-types.ts deleted file mode 100644 index 695189bfef4606477520997412e00d09f461d7a3..0000000000000000000000000000000000000000 --- a/opendesign/checkbox/src/checkbox-types.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { ExtractDefaultPropTypes, PropType } from 'vue'; - -export const checkboxProps = { - // 双向绑定值 - modelValue: { - type: [String, Number, Boolean] as PropType, - default: null, - }, - // value - value: { - type: [String, Number, Boolean] as PropType, - required: true, - default: null, - }, - // 是否禁用 - disabled: { - type: Boolean, - default: false, - }, - // name - name: { - type: String, - default: '', - }, -}; - -export type CheckboxProps = ExtractDefaultPropTypes; diff --git a/opendesign/checkbox/src/checkbox.scss b/opendesign/checkbox/src/checkbox.scss deleted file mode 100644 index e4fbfd1316b3d8a897edf1ab7524ec200f72be64..0000000000000000000000000000000000000000 --- a/opendesign/checkbox/src/checkbox.scss +++ /dev/null @@ -1,49 +0,0 @@ -.o-checkbox { - display: inline-flex; - align-items: center; - position: relative; - font-size: var(--o-font-size-text); - line-height: var(--o-line-height-text); - cursor: pointer; - - input[type='checkbox'] { - position: absolute; - outline: none; - z-index: -1; - top: 0; - left: 0; - right: 0; - bottom: 0; - opacity: 0; - } - - &-icon { - width: 16px; - height: 16px; - border: 1px solid var(--o-color-division1); - display: inline-flex; - justify-content: center; - align-items: center; - color: var(--o-color-white); - // transition: border-color 0.25s cubic-bezier(0.645, 0.045, 0.355, 1), - // background-color 0.25s cubic-bezier(0.645, 0.045, 0.355, 1); - } - - &-label { - margin-left: 8px; - color: var(--o-color-text1); - } - - &:hover { - .o-checkbox-icon { - border-color: var(--o-color-brand1); - } - } - - &.o-checkbox-checked { - .o-checkbox-icon { - background-color: var(--o-color-brand1); - border-color: var(--o-color-brand1); - } - } -} diff --git a/opendesign/checkbox/src/checkbox.tsx b/opendesign/checkbox/src/checkbox.tsx deleted file mode 100644 index 9b69eb1277b6fc54e9aafb98e95a604ebf9dfeec..0000000000000000000000000000000000000000 --- a/opendesign/checkbox/src/checkbox.tsx +++ /dev/null @@ -1,102 +0,0 @@ -import { computed, defineComponent, inject } from 'vue'; -import { checkboxGroupKey } from './checkbox-group-types'; -import { checkboxProps, CheckboxProps } from './checkbox-types'; -import './checkbox.scss'; - -export default defineComponent({ - name: 'OCheckbox', - props: checkboxProps, - emits: ['update:modelValue', 'change'], - setup(props: CheckboxProps, { emit, slots }) { - const checkboxGroupInjection = inject(checkboxGroupKey, null); - - // 是否禁用 - const isDisabled = computed( - () => checkboxGroupInjection?.disabled.value || props.disabled - ); - - // 是否选中 - const isChecked = computed(() => - checkboxGroupInjection - ? checkboxGroupInjection.modelValue.value.includes(props.value) - : props.value === props.modelValue - ); - - const onClick = (e: Event) => { - e.stopPropagation(); - }; - - const onChange = (e: Event) => { - if (isDisabled.value) { - return; - } - const { checked } = e.target as HTMLInputElement; - let newValue; - if (checkboxGroupInjection) { - newValue = [...checkboxGroupInjection.modelValue.value]; - if (checked) { - newValue.push(props.value); - } else { - newValue = newValue.filter((item) => item !== props.value); - } - - checkboxGroupInjection?.onChange(newValue); - } else { - newValue = props.value; - } - - emit('update:modelValue', newValue); - emit('change', newValue); - }; - - const getContent = () => { - if (slots.checkbox) { - return slots.checkbox({ - checked: isChecked.value, - disabled: isDisabled.value, - }); - } else { - return ( - <> - - {isChecked.value ? ( - - - - ) : ( - '' - )} - - {slots.default?.()} - - ); - } - }; - - return () => { - return ( - - ); - }; - }, -}); diff --git a/opendesign/collapse/OCollapse.vue b/opendesign/collapse/OCollapse.vue deleted file mode 100644 index ec3b1ed9654b8f8be8f9d8b13f6b48dd4306a9e9..0000000000000000000000000000000000000000 --- a/opendesign/collapse/OCollapse.vue +++ /dev/null @@ -1,64 +0,0 @@ - - - - - diff --git a/opendesign/collapse/OCollapseItem.vue b/opendesign/collapse/OCollapseItem.vue deleted file mode 100644 index 263ccfb9f56c1180f47afa5e21e9804198e2e147..0000000000000000000000000000000000000000 --- a/opendesign/collapse/OCollapseItem.vue +++ /dev/null @@ -1,16 +0,0 @@ - - - - - diff --git a/opendesign/collapse/index.ts b/opendesign/collapse/index.ts deleted file mode 100644 index bccdd918fa0140c17ef82682a304a76609fd0d86..0000000000000000000000000000000000000000 --- a/opendesign/collapse/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { App } from 'vue'; -import Collapse from './OCollapse.vue'; -import CollapseItem from './OCollapseItem.vue'; -Collapse.install = function (app: App) { - app.component('OCollapse', Collapse); -}; -CollapseItem.install = function (app: App) { - app.component('OCollapseItem', CollapseItem); -}; -export { Collapse, CollapseItem }; diff --git a/opendesign/container/index.ts b/opendesign/container/index.ts deleted file mode 100644 index d4355f5bb927b2d5a7e4876fa4a269fbf588386c..0000000000000000000000000000000000000000 --- a/opendesign/container/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { App } from 'vue'; -import Container from './src/container'; - -Container.install = function (app: App) { - app.component(Container.name, Container); -}; - -export { Container }; diff --git a/opendesign/container/src/container-types.ts b/opendesign/container/src/container-types.ts deleted file mode 100644 index 8f97141fc197f1c928d5a6d1b58718687b7740ad..0000000000000000000000000000000000000000 --- a/opendesign/container/src/container-types.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { ExtractDefaultPropTypes, PropType } from 'vue'; - -type ContainerLevelIndex = 1 | 2 | 3 | 4 | 5; - -export const containerProps = { - // 层级 - levelIndex: { - type: Number as PropType, - default: 2, - }, - // 是否有阴影 - shadow: { - type: Boolean, - default: true, - }, -}; - -export type ContainerProps = ExtractDefaultPropTypes; diff --git a/opendesign/container/src/container.scss b/opendesign/container/src/container.scss deleted file mode 100644 index b6a8bcd5b799118e7dd23f0d819701aa82340694..0000000000000000000000000000000000000000 --- a/opendesign/container/src/container.scss +++ /dev/null @@ -1,31 +0,0 @@ -@import './var.scss'; - -.o-container { - &-level1 { - background-color: var(--o-container-bg-color-level1); - box-shadow: var(--o-container-shadow-level1); - } - &-level2 { - background-color: var(--o-container-bg-color-level2); - box-shadow: var(--o-container-shadow-level2); - - &:hover { - @media screen and (min-width: 1100px) { - background-color: var(--o-container-bg-color-level2_hover); - box-shadow: var(--o-container-shadow-level2_hover); - } - } - } - &-level3 { - background-color: var(--o-container-bg-color-level3); - box-shadow: var(--o-container-shadow-level3); - } - &-level4 { - background-color: var(--o-container-bg-color-level4); - box-shadow: var(--o-container-shadow-level4); - } - &-level5 { - background-color: var(--o-container-bg-color-level5); - box-shadow: var(--o-container-shadow-level5); - } -} diff --git a/opendesign/container/src/container.tsx b/opendesign/container/src/container.tsx deleted file mode 100644 index bba10b223678837551901d25f69d31ec30072250..0000000000000000000000000000000000000000 --- a/opendesign/container/src/container.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { defineComponent } from 'vue'; -import { containerProps, ContainerProps } from './container-types'; -import './container.scss'; - -export default defineComponent({ - name: 'OContainer', - props: containerProps, - setup(props: ContainerProps, { slots }) { - return () => { - return ( -
- {slots.default?.()} -
- ); - }; - }, -}); diff --git a/opendesign/container/src/var.scss b/opendesign/container/src/var.scss deleted file mode 100644 index 31dbca79815de4a00b062fbca1b45ca25f48d1de..0000000000000000000000000000000000000000 --- a/opendesign/container/src/var.scss +++ /dev/null @@ -1,17 +0,0 @@ -.o-container { - // 背景颜色 - --o-container-bg-color-level1: var(--o-color-fill1); - --o-container-bg-color-level2: var(--o-color-fill2); - --o-container-bg-color-level2_hover: var(--o-color-fill2_hover); - --o-container-bg-color-level3: var(--o-color-fill3); - --o-container-bg-color-level4: var(--o-color-fill4); - --o-container-bg-color-level5: var(--o-color-fill5); - - // 阴影 - --o-container-shadow-level1: var(--o-shadow-l1); - --o-container-shadow-level2: var(--o-shadow-l2); - --o-container-shadow-level2_hover: var(--o-shadow-l2_hover); - --o-container-shadow-level3: var(--o-shadow-l3); - --o-container-shadow-level4: var(--o-shadow-l4); - --o-container-shadow-level5: var(--o-shadow-l5); -} diff --git a/opendesign/data-picker/ODatePicker.vue b/opendesign/data-picker/ODatePicker.vue deleted file mode 100644 index 0b63fde22b82f752394d18430a6e6b1ccf0717ba..0000000000000000000000000000000000000000 --- a/opendesign/data-picker/ODatePicker.vue +++ /dev/null @@ -1,41 +0,0 @@ - - - - - diff --git a/opendesign/data-picker/index.ts b/opendesign/data-picker/index.ts deleted file mode 100644 index a8990ef66c97c3d42cd7b57db6761d164492183b..0000000000000000000000000000000000000000 --- a/opendesign/data-picker/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { App } from 'vue'; -import DatePicker from './ODatePicker.vue'; -DatePicker.install = function (app: App) { - app.component('ODatePicker', DatePicker); -}; - -export { DatePicker }; diff --git a/opendesign/dialog/ODialog.vue b/opendesign/dialog/ODialog.vue deleted file mode 100644 index 5b718eca981d5e6d4ee97036499d2dcfa562cd3e..0000000000000000000000000000000000000000 --- a/opendesign/dialog/ODialog.vue +++ /dev/null @@ -1,33 +0,0 @@ - - - - - diff --git a/opendesign/dialog/index.ts b/opendesign/dialog/index.ts deleted file mode 100644 index 7d58df2b66238288dd48af4d96e7c5c5c293dccc..0000000000000000000000000000000000000000 --- a/opendesign/dialog/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { App } from 'vue'; -import Dialog from './ODialog.vue'; -Dialog.install = function (app: App) { - app.component('ODialog', Dialog); -}; - -export { Dialog }; diff --git a/opendesign/drawer/ODrawer.vue b/opendesign/drawer/ODrawer.vue deleted file mode 100644 index 136ac5366bb6244e623b59c546f34b7a4c7fcc6d..0000000000000000000000000000000000000000 --- a/opendesign/drawer/ODrawer.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - - - diff --git a/opendesign/drawer/index.ts b/opendesign/drawer/index.ts deleted file mode 100644 index fb09bdd38c8219163740cfbdbaa79a22e9bfdea1..0000000000000000000000000000000000000000 --- a/opendesign/drawer/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { App } from 'vue'; -import Drawer from './ODrawer.vue'; - -Drawer.install = function (app: App) { - app.component('ODrawer', Drawer); -}; -export { Drawer }; diff --git a/opendesign/index.ts b/opendesign/index.ts index f78abbc75741287ef045f52a90d04807250ec163..328ba90047287e5bf09333f4abfee060c4ae7a20 100644 --- a/opendesign/index.ts +++ b/opendesign/index.ts @@ -3,57 +3,13 @@ import type { App } from 'vue'; import './style/variable.scss'; import { Button } from './button'; -import { Radio, RadioGroup } from './radio'; -import { Checkbox, CheckboxGroup } from './checkbox'; import { Select, Option } from './select'; -import { DatePicker } from './data-picker'; -import { TimeSelect } from './time-select'; - import { Icon } from './icon'; import { Card } from './card'; -import { Dialog } from './dialog'; import { Tag } from './tag'; -import { Tabs, TabPane } from './tabs'; -import { Input } from './input'; -import { Tree } from './tree'; import { Pagination } from './pagination'; -import { Table, TableColumn } from './table'; -import { Timeline } from './timeline'; -import { Search } from './search'; -import { Drawer } from './drawer'; -import { Switch } from './switch'; -import { Collapse, CollapseItem } from './collapse'; -import { Container } from './container'; -const components = [ - Button, - Radio, - RadioGroup, - Checkbox, - CheckboxGroup, - Select, - Option, - DatePicker, - TimeSelect, - Icon, - Card, - Dialog, - Pagination, - Table, - TableColumn, - Tag, - Timeline, - Input, - Tabs, - TabPane, - Tree, - Search, - Drawer, - Switch, - Collapse, - CollapseItem, - Container, -]; +const components = [Button, Select, Option, Icon, Card, Pagination, Tag]; export default { install(app: App): void { components.forEach((component) => { diff --git a/opendesign/input/OInput.vue b/opendesign/input/OInput.vue deleted file mode 100644 index f4fa7015f6f416b0d80f34d8c28b079feda36b48..0000000000000000000000000000000000000000 --- a/opendesign/input/OInput.vue +++ /dev/null @@ -1,62 +0,0 @@ - - - - - diff --git a/opendesign/input/index.ts b/opendesign/input/index.ts deleted file mode 100644 index dd41787e6411b793c7f66027debd46dfbca4f176..0000000000000000000000000000000000000000 --- a/opendesign/input/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { App } from 'vue'; -import Input from './OInput.vue'; -Input.install = function (app: App) { - app.component('OInput', Input); -}; - -export { Input }; diff --git a/opendesign/radio/index.ts b/opendesign/radio/index.ts deleted file mode 100644 index 35f2f2c39d18d1d370c791ab5ce9055c3c017c93..0000000000000000000000000000000000000000 --- a/opendesign/radio/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { App } from 'vue'; -import Radio from './src/radio'; -import RadioGroup from './src/radio-group'; - -Radio.install = function (app: App) { - app.component(Radio.name, Radio); -}; - -RadioGroup.install = function (app: App) { - app.component(RadioGroup.name, RadioGroup); -}; - -export { Radio, RadioGroup }; diff --git a/opendesign/radio/src/radio-group-types.ts b/opendesign/radio/src/radio-group-types.ts deleted file mode 100644 index 2085a688c9130a9a143ed6b24625343bf30ce240..0000000000000000000000000000000000000000 --- a/opendesign/radio/src/radio-group-types.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { ExtractDefaultPropTypes, InjectionKey, PropType, Ref } from 'vue'; - -export const radioGroupProps = { - // 双向绑定值 - modelValue: { - type: [String, Number, Boolean] as PropType, - default: null, - }, - // 是否禁用 - disabled: { - type: Boolean, - default: false, - }, -}; - -export type RadioGroupProps = ExtractDefaultPropTypes; - -interface RadioGroupInjection { - modelValue: Ref; - disabled: Ref; - // eslint-disable-next-line no-unused-vars - onChange: (val: string | number | boolean) => void; -} - -export const radioGroupKey: InjectionKey = - Symbol('ORadioGroup'); diff --git a/opendesign/radio/src/radio-group.scss b/opendesign/radio/src/radio-group.scss deleted file mode 100644 index e74b34fd7bee7e63a40f04727770f22bc6cf060e..0000000000000000000000000000000000000000 --- a/opendesign/radio/src/radio-group.scss +++ /dev/null @@ -1,7 +0,0 @@ -.o-radio-group { - display: flex; - align-items: center; - .o-radio + .o-radio { - margin-left: 24px; - } -} diff --git a/opendesign/radio/src/radio-group.tsx b/opendesign/radio/src/radio-group.tsx deleted file mode 100644 index 1dd0aa01dae6980a1b007733740f2f7ecdeff3ab..0000000000000000000000000000000000000000 --- a/opendesign/radio/src/radio-group.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { defineComponent, provide, toRefs } from 'vue'; -import { - radioGroupKey, - radioGroupProps, - RadioGroupProps, -} from './radio-group-types'; -import './radio-group.scss'; - -export default defineComponent({ - name: 'ORadioGroup', - props: radioGroupProps, - emits: ['update:modelValue', 'change'], - setup(props: RadioGroupProps, { emit, slots }) { - const { modelValue, disabled } = toRefs(props); - - const onChange = (val: string | number | boolean) => { - emit('update:modelValue', val); - emit('change', val); - }; - - // 注入 - provide(radioGroupKey, { modelValue, disabled, onChange }); - - return () => { - return
{slots.default?.()}
; - }; - }, -}); diff --git a/opendesign/radio/src/radio-types.ts b/opendesign/radio/src/radio-types.ts deleted file mode 100644 index 19920b69c053ac7e6a75110e68645fbca05ad49f..0000000000000000000000000000000000000000 --- a/opendesign/radio/src/radio-types.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ExtractDefaultPropTypes, PropType } from 'vue'; - -export const radioProps = { - // 双向绑定值 - modelValue: { - type: [String, Number, Boolean] as PropType, - default: null, - }, - // value - value: { - type: [String, Number, Boolean] as PropType, - required: true, - default: null, - }, - // 是否禁用 - disabled: { - type: Boolean, - default: false, - }, -}; - -export type RadioProps = ExtractDefaultPropTypes; diff --git a/opendesign/radio/src/radio.scss b/opendesign/radio/src/radio.scss deleted file mode 100644 index 3fc31dc573acd59255943061177e1df36e2a3702..0000000000000000000000000000000000000000 --- a/opendesign/radio/src/radio.scss +++ /dev/null @@ -1,72 +0,0 @@ -.o-radio { - display: inline-flex; - align-items: center; - position: relative; - font-size: var(--o-font-size-text); - line-height: var(--o-line-height-text); - cursor: pointer; - - input[type='radio'] { - position: absolute; - outline: none; - z-index: -1; - top: 0; - left: 0; - right: 0; - bottom: 0; - opacity: 0; - } - - &-icon { - position: relative; - display: inline-block; - border-radius: 50%; - width: 18px; - height: 18px; - background: var(--o-color-bg2); - border: 1px solid var(--o-color-border1); - - &::after { - content: ''; - position: absolute; - left: 50%; - top: 50%; - transform: translate(-50%, -50%); - width: 12px; - height: 12px; - border-radius: 50%; - background-color: transparent; - transition: background-color 0.3s; - } - } - - &-label { - margin-left: 8px; - color: var(--o-color-text1); - } - - &.o-radio-checked { - .o-radio-icon { - &::after { - background-color: var(--o-color-brand1); - } - } - } - - &.o-radio-disabled { - cursor: not-allowed; - .o-radio-label { - color: var(--o-color-text5); - } - .o-radio-icon { - border-color: var(--o-color-border2); - } - &.o-radio-checked { - .o-radio-icon { - &::after { - background-color: var(--o-color-brand5); - } - } - } - } -} diff --git a/opendesign/radio/src/radio.tsx b/opendesign/radio/src/radio.tsx deleted file mode 100644 index fb2b4d29168cf6ef571d4e848ea829142ac7d7a2..0000000000000000000000000000000000000000 --- a/opendesign/radio/src/radio.tsx +++ /dev/null @@ -1,79 +0,0 @@ -import { computed, defineComponent, inject } from 'vue'; -import { radioGroupKey } from './radio-group-types'; -import { radioProps, RadioProps } from './radio-types'; -import './radio.scss'; - -export default defineComponent({ - name: 'ORadio', - props: radioProps, - emits: ['update:modelValue', 'change'], - setup(props: RadioProps, { emit, slots }) { - const radioGroupInjection = inject(radioGroupKey, null); - - // 是否禁用 - const isDisabled = computed( - () => radioGroupInjection?.disabled.value || props.disabled - ); - - // 是否选中 - const isChecked = computed( - () => - props.value === - (radioGroupInjection - ? radioGroupInjection.modelValue.value - : props.modelValue) - ); - - const onClick = (e: Event) => { - e.stopPropagation(); - }; - - const onChange = () => { - if (isDisabled.value) { - return; - } - - const val = props.value; - radioGroupInjection?.onChange(val); - emit('update:modelValue', val); - emit('change', val); - }; - - const getContent = () => { - if (slots.radio) { - return slots.radio({ - checked: isChecked.value, - disabled: isDisabled.value, - }); - } else { - return ( - <> - - {slots.default?.()} - - ); - } - }; - - return () => { - return ( - - ); - }; - }, -}); diff --git a/opendesign/radio/src/var.scss b/opendesign/radio/src/var.scss deleted file mode 100644 index ad6c1046b63d1d3cb21daac846fbbd871beaeda2..0000000000000000000000000000000000000000 --- a/opendesign/radio/src/var.scss +++ /dev/null @@ -1,6 +0,0 @@ -.o-radio { - --o-radio-font-size: var(--o-font-size-text); - --o-radio-line-height: var(--o-line-height-text); - --o-radio-icon-width: 18px; - --o-radio-icon-height: 18px; -} diff --git a/opendesign/search/OSearch.vue b/opendesign/search/OSearch.vue deleted file mode 100644 index f0f5fffe1c2354476aa99a410546da15831a0ada..0000000000000000000000000000000000000000 --- a/opendesign/search/OSearch.vue +++ /dev/null @@ -1,69 +0,0 @@ - - - - - diff --git a/opendesign/search/index.ts b/opendesign/search/index.ts deleted file mode 100644 index 119d1b73829ff42461c004d8be0511131a52d25c..0000000000000000000000000000000000000000 --- a/opendesign/search/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { App } from 'vue'; -import Search from './OSearch.vue'; -Search.install = function (app: App) { - app.component('OSearch', Search); -}; - -export { Search }; diff --git a/opendesign/switch/OSwitch.vue b/opendesign/switch/OSwitch.vue deleted file mode 100644 index ee3fea99196e7d7be3225a32b5c73f3300d82eae..0000000000000000000000000000000000000000 --- a/opendesign/switch/OSwitch.vue +++ /dev/null @@ -1,30 +0,0 @@ - - - - - diff --git a/opendesign/switch/index.ts b/opendesign/switch/index.ts deleted file mode 100644 index ae6cb44779dfc31495ed2a6a23b8401c850c0ba5..0000000000000000000000000000000000000000 --- a/opendesign/switch/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { App } from 'vue'; -import Switch from './OSwitch.vue'; -Switch.install = function (app: App) { - app.component('OSwitch', Switch); -}; - -export { Switch }; diff --git a/opendesign/table/OTable.vue b/opendesign/table/OTable.vue deleted file mode 100644 index c3298f45a36cfdd637ff602aa2d8209839b9c9b8..0000000000000000000000000000000000000000 --- a/opendesign/table/OTable.vue +++ /dev/null @@ -1,81 +0,0 @@ - - - - - diff --git a/opendesign/table/OTableColumn.vue b/opendesign/table/OTableColumn.vue deleted file mode 100644 index 982cabee1cd304c63253fc7d8908819392987141..0000000000000000000000000000000000000000 --- a/opendesign/table/OTableColumn.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - - - diff --git a/opendesign/table/index.ts b/opendesign/table/index.ts deleted file mode 100644 index 839f04b1bd57afaf223481e118399e5550ac776b..0000000000000000000000000000000000000000 --- a/opendesign/table/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { App } from 'vue'; -import Table from './OTable.vue'; -import TableColumn from './OTableColumn.vue'; -Table.install = function (app: App) { - app.component('OTable', Table); -}; -TableColumn.install = function (app: App) { - app.component('OTableColumn', TableColumn); -}; -export { Table, TableColumn }; diff --git a/opendesign/tabs/OTabPane.vue b/opendesign/tabs/OTabPane.vue deleted file mode 100644 index 074a678f34065aefb95d502397de207d15573f8c..0000000000000000000000000000000000000000 --- a/opendesign/tabs/OTabPane.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - - diff --git a/opendesign/tabs/OTabs.vue b/opendesign/tabs/OTabs.vue deleted file mode 100644 index 512563e966a82be5291cac6f858b727dab6896c5..0000000000000000000000000000000000000000 --- a/opendesign/tabs/OTabs.vue +++ /dev/null @@ -1,53 +0,0 @@ - - - - - diff --git a/opendesign/tabs/index.ts b/opendesign/tabs/index.ts deleted file mode 100644 index 7de648bb126b2b9658563f34bd70e83ec1cee1b3..0000000000000000000000000000000000000000 --- a/opendesign/tabs/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { App } from 'vue'; -import Tabs from './OTabs.vue'; -import TabPane from './OTabPane.vue'; -Tabs.install = function (app: App) { - app.component('OTabs', Tabs); -}; -TabPane.install = function (app: App) { - app.component('OTabPane', TabPane); -}; - -export { Tabs, TabPane }; diff --git a/opendesign/time-select/OTimeSelect.vue b/opendesign/time-select/OTimeSelect.vue deleted file mode 100644 index c29dffb056e68a5b306c285f42d9cefc46c16100..0000000000000000000000000000000000000000 --- a/opendesign/time-select/OTimeSelect.vue +++ /dev/null @@ -1,41 +0,0 @@ - - - - - diff --git a/opendesign/time-select/index.ts b/opendesign/time-select/index.ts deleted file mode 100644 index 85804f6a542e3153d8f8e38f6dd051f8e7cd26f5..0000000000000000000000000000000000000000 --- a/opendesign/time-select/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { App } from 'vue'; -import TimeSelect from './OTimeSelect.vue'; -TimeSelect.install = function (app: App) { - app.component('OTimeSelect', TimeSelect); -}; - -export { TimeSelect }; diff --git a/opendesign/timeline/index.ts b/opendesign/timeline/index.ts deleted file mode 100644 index 742ea80cb05308becec353ddc8f0c7b2620f0a68..0000000000000000000000000000000000000000 --- a/opendesign/timeline/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { App } from 'vue'; -import Timeline from './src/timeline'; - -Timeline.install = function (app: App) { - app.component(Timeline.name, Timeline); -}; - -export { Timeline }; diff --git a/opendesign/timeline/src/timeline-types.ts b/opendesign/timeline/src/timeline-types.ts deleted file mode 100644 index 6b400ff1b3d2fb9cb8e83fcbb4681e4d0faa6ed6..0000000000000000000000000000000000000000 --- a/opendesign/timeline/src/timeline-types.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { ExtractDefaultPropTypes } from 'vue'; - -export const timelineProps = { - leftArrow: { - type: Boolean, - default: true, - }, - rightArrow: { - type: Boolean, - default: true, - }, - modelValue: { - type: String, - default: '', - }, -}; - -export type TimelineProps = ExtractDefaultPropTypes; diff --git a/opendesign/timeline/src/timeline.scss b/opendesign/timeline/src/timeline.scss deleted file mode 100644 index f019985ed2f7e4d7b26b7940891fc44b67fab095..0000000000000000000000000000000000000000 --- a/opendesign/timeline/src/timeline.scss +++ /dev/null @@ -1,73 +0,0 @@ -@import './var.scss'; -.o-timeline { - position: relative; - - &-list { - display: flex; - justify-content: space-evenly; - position: relative; - - &::after { - width: 100%; - height: 2px; - background-color: var(--o-timeline-background-color); - content: ''; - display: block; - position: absolute; - top: 43px; - z-index: 2; - } - } - - &-item { - position: relative; - z-index: 3; - list-style: none; - text-align: center; - cursor: pointer; - } - - &-day { - font-size: var(--o-timeline-font-size); - color: var(--o-timeline-font-color); - line-height: var(--o-timeline-line-height); - margin-bottom: var(--o-timeline-spacing-word); - transition: var(--o-timeline-transition); - } - &-icon { - cursor: pointer; - width: var(--o-timeline-font-size-icon); - height: var(--o-timeline-font-size-icon); - color: var(--o-timeline-font-color); - display: inline-block; - background-color: var(--o-timeline-background-icon); - transition: var(--o-timeline-transition); - } - .active { - .o-timeline-day { - color: var(--o-timeline-font-color-active); - } - .o-timeline-icon { - color: var(--o-timeline-font-color-active); - } - } - - &-left-arrow { - cursor: pointer; - position: absolute; - top: 28px; - left: -10px; - z-index: 4; - color: var(--o-timeline-background-color); - font-size: var(--o-timeline-font-size-icon); - } - &-right-arrow { - cursor: pointer; - position: absolute; - top: 28px; - right: -10px; - z-index: 4; - color: var(--o-timeline-background-color); - font-size: var(--o-timeline-font-size-icon); - } -} diff --git a/opendesign/timeline/src/timeline.tsx b/opendesign/timeline/src/timeline.tsx deleted file mode 100644 index 3484334ac1e87e84b2110069d47615af6d2b31db..0000000000000000000000000000000000000000 --- a/opendesign/timeline/src/timeline.tsx +++ /dev/null @@ -1,148 +0,0 @@ -import { defineComponent, ref, Ref, toRefs, onMounted } from 'vue'; -import { timelineProps, TimelineProps } from './timeline-types'; -import IconLeft from '~icons/app/icon-chevron-left.svg'; -import IconRight from '~icons/app/icon-chevron-right'; -import IconChecked from '~icons/app/icon-checked.svg'; -import IconUnchecked from '~icons/app/icon-unchecked.svg'; -import './timeline.scss'; - -export default defineComponent({ - name: 'OTimeline', - props: timelineProps, - emits: ['update:modelValue'], - setup(props: TimelineProps, { emit }) { - const { leftArrow, rightArrow, modelValue } = toRefs(props); - // 六月 - const SPLITEMONTH = 6; - // 时间线列表 - const timeList: Ref = ref([]); - // 命中的tab - const activeTab = ref(5); - // 最左与最右阈值 - const leftThreshold = '2020-10'; - const rightThreshold: Ref = ref(''); - // 时间线列表赋值 - const changeDate = (year: number, month: number): Array => { - const result: Array = []; - if (month >= SPLITEMONTH) { - for (let i = 0; i < 6; i++) { - result.push( - year + - '-' + - (month - (6 - i - 1) >= 10 - ? month - (6 - i - 1) - : '0' + (month - (6 - i - 1))) - ); - } - } else { - // last year - for (let i = 1; i <= 6 - month; i++) { - result.push( - year - - 1 + - '-' + - (6 + i + month >= 10 ? 6 + i + month : '0' + (6 + i + month)) - ); - } - // this year - for (let i = 1; i < month + 1; i++) { - result.push(year + '-0' + i); - } - } - return result; - }; - // 初始化时间线列表赋值 - const initDate = () => { - const modelDate = !isNaN(new Date(modelValue.value).getTime()) - ? new Date(modelValue.value) - : new Date(); - const modelYear = modelDate.getFullYear(); - const _modelYear = - modelDate.getFullYear() === 2020 ? 2021 : modelDate.getFullYear(); - const modelMonth = - (modelYear === 2021 && modelDate.getMonth() + 1 < 3) || - modelYear === 2020 - ? 3 - : modelDate.getMonth() + 1; - const year = new Date().getFullYear(); - const month = new Date().getMonth() + 1; - rightThreshold.value = year + '-' + (month >= 10 ? month : '0' + month); - timeList.value = changeDate(_modelYear, modelMonth); - emit('update:modelValue', timeList.value[activeTab.value]); - }; - // 点击时间线tab - const useClickTab = (index: number): void => { - activeTab.value = index; - emit('update:modelValue', timeList.value[activeTab.value]); - }; - // 点击左侧按钮 - const useClickLeft = () => { - const date = new Date(timeList.value[4]); - const year = date.getFullYear(); - const month = date.getMonth() + 1; - timeList.value = changeDate(year, month); - emit('update:modelValue', timeList.value[activeTab.value]); - }; - // 点击右侧按钮 - const useClickRight = () => { - const date = new Date(timeList.value[5]); - const year = date.getFullYear(); - const month = date.getMonth() + 2; - timeList.value = - month <= 12 ? changeDate(year, month) : changeDate(year + 1, 1); - emit('update:modelValue', timeList.value[activeTab.value]); - }; - - onMounted(() => { - initDate(); - }); - - return () => { - return ( -
- {leftArrow && - leftArrow.value && - timeList.value[0] !== leftThreshold ? ( - useClickLeft()} - class="o-timeline-left-arrow" - > - ) : ( - '' - )} -
    - {timeList.value && - timeList.value.map((item, index) => { - return ( -
  • useClickTab(index)} - > -

    {item}

    - {index === activeTab.value ? ( - - ) : ( - - )} -
  • - ); - })} -
- {rightArrow && - rightArrow.value && - timeList.value[5] !== rightThreshold.value ? ( - useClickRight()} - > - ) : ( - '' - )} -
- ); - }; - }, -}); diff --git a/opendesign/timeline/src/var.scss b/opendesign/timeline/src/var.scss deleted file mode 100644 index d75006df4825ce6892bb5aa8419ca235ab600340..0000000000000000000000000000000000000000 --- a/opendesign/timeline/src/var.scss +++ /dev/null @@ -1,22 +0,0 @@ -.o-timeline { - // 背景颜色 - --o-timeline-background-color: var(--o-color-neutral11); - --o-timeline-background-icon: var(--o-color-bg1); - - // 文字颜色 - --o-timeline-font-color-active: var(--o-color-brand1); - --o-timeline-font-color: var(--o-color-text4); - - // font-size - --o-timeline-font-size: var(--o-font-size-h6); - --o-timeline-font-size-icon: var(--o-font-size-h5); - - // line-height - --o-timeline-line-height: var(--o-line-height-h6); - - // 动画 - --o-timeline-transition: all 0.2s; - - // 间距 - --o-timeline-spacing-word: var(--o-spacing-h10); -} diff --git a/opendesign/tree/OTree.vue b/opendesign/tree/OTree.vue deleted file mode 100644 index 31034f608442509deb1417f05732ae69bcc29abe..0000000000000000000000000000000000000000 --- a/opendesign/tree/OTree.vue +++ /dev/null @@ -1,23 +0,0 @@ - - - - - diff --git a/opendesign/tree/index.ts b/opendesign/tree/index.ts deleted file mode 100644 index f1d3c7569f3b75656f38940f2e78e727d20750b7..0000000000000000000000000000000000000000 --- a/opendesign/tree/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { App } from 'vue'; -import Tree from './OTree.vue'; -Tree.install = function (app: App) { - app.component('OTree', Tree); -}; - -export { Tree }; diff --git a/package.json b/package.json index 4e1129ba9174a4ddad1dfcc462b86c69fa479200..856c55134dae72172ef919ba87dfa253cfd043cc 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ "element-plus": "2.2.34", "lodash": "4.17.21", "opendesign": "./opendesign", - "pinia": "2.0.33", "vue": "3.2.47" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 11c77eba0636475b34382f738613a4f55d60aef0..084231429a481ba3e5c7f5690cefd89bc2ec62f5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,9 +17,6 @@ dependencies: opendesign: specifier: ./opendesign version: link:opendesign - pinia: - specifier: 2.0.33 - version: registry.npmmirror.com/pinia@2.0.33(typescript@4.9.4)(vue@3.2.47) vue: specifier: 3.2.47 version: registry.npmmirror.com/vue@3.2.47 @@ -1193,12 +1190,6 @@ packages: '@vue/compiler-dom': registry.npmmirror.com/@vue/compiler-dom@3.2.47 '@vue/shared': registry.npmmirror.com/@vue/shared@3.2.47 - registry.npmmirror.com/@vue/devtools-api@6.5.0: - resolution: {integrity: sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.5.0.tgz} - name: '@vue/devtools-api' - version: 6.5.0 - dev: false - registry.npmmirror.com/@vue/reactivity-transform@3.2.47: resolution: {integrity: sha512-m8lGXw8rdnPVVIdIFhf0LeQ/ixyHkH5plYuS83yop5n7ggVJU+z5v0zecwEnX7fa7HNLBhh2qngJJkxpwEEmYA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@vue/reactivity-transform/-/reactivity-transform-3.2.47.tgz} name: '@vue/reactivity-transform' @@ -3075,27 +3066,6 @@ packages: engines: {node: '>=8.6'} dev: true - registry.npmmirror.com/pinia@2.0.33(typescript@4.9.4)(vue@3.2.47): - resolution: {integrity: sha512-HOj1yVV2itw6rNIrR2f7+MirGNxhORjrULL8GWgRwXsGSvEqIQ+SE0MYt6cwtpegzCda3i+rVTZM+AM7CG+kRg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/pinia/-/pinia-2.0.33.tgz} - id: registry.npmmirror.com/pinia/2.0.33 - name: pinia - version: 2.0.33 - peerDependencies: - '@vue/composition-api': ^1.4.0 - typescript: '>=4.4.4' - vue: ^2.6.14 || ^3.2.0 - peerDependenciesMeta: - '@vue/composition-api': - optional: true - typescript: - optional: true - dependencies: - '@vue/devtools-api': registry.npmmirror.com/@vue/devtools-api@6.5.0 - typescript: registry.npmmirror.com/typescript@4.9.4 - vue: registry.npmmirror.com/vue@3.2.47 - vue-demi: registry.npmmirror.com/vue-demi@0.14.5(vue@3.2.47) - dev: false - registry.npmmirror.com/pkg-types@1.0.3: resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/pkg-types/-/pkg-types-1.0.3.tgz} name: pkg-types @@ -3436,6 +3406,7 @@ packages: version: 4.9.4 engines: {node: '>=4.2.0'} hasBin: true + dev: true registry.npmmirror.com/ufo@1.3.1: resolution: {integrity: sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/ufo/-/ufo-1.3.1.tgz}