Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Tag): update style #507

Merged
merged 4 commits into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"prebuild": "rimraf dist/* lib/* es/* esm/* typings/*",
"build": "cross-env NODE_ENV=production rollup -c scripts/rollup.config.js && npm run build:tsc",
"build:tsc": "concurrently \"npm:build:tsc-*\"",
"build:tsc-es": "vue-tsc --declaration --emitDeclarationOnly --outDir es/ -p tsconfig.build.json",
"build:tsc-esm": "vue-tsc --declaration --emitDeclarationOnly --outDir esm/ -p tsconfig.build.json",
"build:tsc-lib": "vue-tsc --declaration --emitDeclarationOnly --outDir lib/ -p tsconfig.build.json",
"build:tsc-es": "vue-tsc --declaration --emitDeclarationOnly --outDir es/",
"build:tsc-esm": "vue-tsc --declaration --emitDeclarationOnly --outDir esm/",
"build:tsc-lib": "vue-tsc --declaration --emitDeclarationOnly --outDir lib/",
"site": "cd site && vite build",
"site:intranet": "cd site && vite build --mode intranet",
"site:preview": "cd site && vite build --mode preview",
Expand Down Expand Up @@ -109,15 +109,15 @@
"@rollup/plugin-url": "^6.0.0",
"@soerenmartius/vue3-clipboard": "^0.1.1",
"@types/jest": "^28.1.6",
"@types/prismjs": "^1.16.2",
"@types/node": "18.8.0",
"@types/prismjs": "^1.16.2",
"@typescript-eslint/eslint-plugin": "^5.5.0",
"@typescript-eslint/parser": "~5.34.0",
"@vitejs/plugin-vue": "^1.2.3",
"@vitejs/plugin-vue-jsx": "^1.3.3",
"@vitest/ui": "^0.16.0",
"@vue/eslint-config-typescript": "^9.1.0",
"@vue/runtime-core": "3.2.41",
"@vue/runtime-core": "^3.2.41",
"@vue/test-utils": "^2.0.0-rc.17",
"autoprefixer": "^10.2.4",
"axios": "^0.21.0",
Expand Down Expand Up @@ -167,7 +167,7 @@
"vite": "^2.9.14",
"vite-plugin-tdoc": "^2.0.1",
"vitest": "^0.16.0",
"vue": "^3.2.33",
"vue": "^3.2.47",
"vue-eslint-parser": "^8.0.1",
"vue-router": "4.0.11",
"vue-tsc": "^0.40.0"
Expand Down
2 changes: 1 addition & 1 deletion src/_common
Submodule _common updated 147 files
4 changes: 2 additions & 2 deletions src/action-sheet/action-sheet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</template>

<script lang="ts">
import { ref, computed, watch, defineComponent, PropType, ComputedRef, SetupContext } from 'vue';
import { ref, computed, watch, defineComponent, PropType, ComputedRef } from 'vue';
import { useEmitEvent } from '../shared';
import MenuList from './menu-list.vue';
import MenuGrid from './menu-grid.vue';
Expand Down Expand Up @@ -93,7 +93,7 @@ export default defineComponent({
},
},
emits: ['selected', 'update:modelValue', 'cancel', 'close'],
setup(props, context: SetupContext) {
setup(props, context) {
const emitEvent = useEmitEvent(props, context.emit);
const actionItems = ref([]);

Expand Down
4 changes: 2 additions & 2 deletions src/action-sheet/menu-grid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</template>

<script lang="ts">
import { ref, SetupContext, defineComponent, computed } from 'vue';
import { ref, defineComponent, computed } from 'vue';
import config from '../config';
import { Grid as TGrid, GridItem as TGridItem } from '../grid';

Expand All @@ -54,7 +54,7 @@ export default defineComponent({
},
},
emits: ['selected'],
setup(props, context: SetupContext) {
setup(props, context) {
const containerWrapper = ref<HTMLElement | null>(null);
const moveOffset = ref(0);
const currentIndex = ref(0);
Expand Down
4 changes: 2 additions & 2 deletions src/action-sheet/menu-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</template>

<script lang="ts">
import { ref, SetupContext, defineComponent, PropType } from 'vue';
import { ref, defineComponent, PropType } from 'vue';

import config from '../config';
import { ActionSheetItem } from './type';
Expand All @@ -32,7 +32,7 @@ export default defineComponent({
},
},
emits: ['selected'],
setup(props, context: SetupContext) {
setup(props, context) {
const handleSelected = (index: number) => {
context.emit('selected', index);
};
Expand Down
4 changes: 2 additions & 2 deletions src/avatar/avatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</template>

<script lang="ts">
import { computed, toRefs, defineComponent, getCurrentInstance, inject, ref, SetupContext } from 'vue';
import { computed, toRefs, defineComponent, getCurrentInstance, inject, ref } from 'vue';
import TBadge from '../badge';
import TImage from '../image';
import config from '../config';
Expand All @@ -47,7 +47,7 @@ export default defineComponent({
components: { TNode, TBadge, TImage },
props: AvatarProps,
emits: ['error'],
setup(props, context: SetupContext) {
setup(props, context) {
const emitEvent = useEmitEvent(props, context.emit);
const internalInstance = getCurrentInstance();
const avatarGroupProps = inject('avatarGroup', {}) as TdAvatarGroupProps;
Expand Down
236 changes: 0 additions & 236 deletions src/back-top/__test__/__snapshots__/demo.test.jsx.snap
Original file line number Diff line number Diff line change
@@ -1,168 +1,5 @@
// Vitest Snapshot v1

exports[`BackTop > BackTop baseVue demo works fine 1`] = `
<div
data-v-33e4f6e7=""
>
<div
class="button-group"
data-v-33e4f6e7=""
>
<button
aria-disabled="false"
class="t-button t-size-l t-button--outline t-button--default t-button--shape-rectangle t-is-block"
data-v-33e4f6e7=""
role="button"
>
<!---->
<span
class="t-button__text"
>

圆角白底

</span>
</button>
<button
aria-disabled="false"
class="t-button t-size-l t-button--outline t-button--default t-button--shape-rectangle t-is-block"
data-v-33e4f6e7=""
role="button"
>
<!---->
<span
class="t-button__text"
>

圆角黑底

</span>
</button>
<button
aria-disabled="false"
class="t-button t-size-l t-button--outline t-button--default t-button--shape-rectangle t-is-block"
data-v-33e4f6e7=""
role="button"
>
<!---->
<span
class="t-button__text"
>

圆白底纯图标

</span>
</button>
<button
aria-disabled="false"
class="t-button t-size-l t-button--outline t-button--default t-button--shape-rectangle t-is-block"
data-v-33e4f6e7=""
role="button"
>
<!---->
<span
class="t-button__text"
>

圆黑底纯图标

</span>
</button>
</div>
<p
class="tdesign-mobile-demo-block__summary"
data-v-33e4f6e7=""
>
半圆型返回顶部
</p>
<div
class="button-group"
data-v-33e4f6e7=""
>
<button
aria-disabled="false"
class="t-button t-size-l t-button--outline t-button--default t-button--shape-rectangle t-is-block"
data-v-33e4f6e7=""
role="button"
>
<!---->
<span
class="t-button__text"
>

半圆白底

</span>
</button>
<button
aria-disabled="false"
class="t-button t-size-l t-button--outline t-button--default t-button--shape-rectangle t-is-block"
data-v-33e4f6e7=""
role="button"
>
<!---->
<span
class="t-button__text"
>

半圆黑底

</span>
</button>
</div>
<div
class="t-back-top t-is-fixed t-back-top--round"
data-v-33e4f6e7=""
style="display: none;"
>
<svg
class="t-icon t-icon-backtop"
fill="none"
height="1em"
viewBox="0 0 16 16"
width="1em"
>
<path
d="M2 3h12V2H2v1zM3.38 10.23l4.1-4.03v8.64H8.5V6.2l4.18 4.08.71-.7-5.05-4.93a.5.5 0 00-.7 0l-4.98 4.9.72.69z"
fill="currentColor"
fill-opacity="0.9"
/>
</svg>
<span
class="t-back-top__text"
style="min-width: 12px; max-width: 24px; width: auto; display: inline-block;"
>
顶部
</span>
</div>
<div
class="t-back-top t-is-fixed t-back-top--round"
data-v-33e4f6e7=""
style="display: none;"
>
<svg
class="t-icon t-icon-backtop"
fill="none"
height="1em"
viewBox="0 0 16 16"
width="1em"
>
<path
d="M2 3h12V2H2v1zM3.38 10.23l4.1-4.03v8.64H8.5V6.2l4.18 4.08.71-.7-5.05-4.93a.5.5 0 00-.7 0l-4.98 4.9.72.69z"
fill="currentColor"
fill-opacity="0.9"
/>
</svg>
<span
class="t-back-top__text"
style="min-width: 12px; max-width: 24px; width: auto; display: inline-block;"
>
返回顶部
</span>
</div>
</div>
`;

exports[`BackTop > BackTop halfRoundVue demo works fine 1`] = `
<div
data-v-app=""
Expand Down Expand Up @@ -739,76 +576,3 @@ exports[`BackTop > BackTop roundVue demo works fine 1`] = `

</div>
`;

exports[`BackTop > BackTop targetVue demo works fine 1`] = `
<div>
<span />
<div
class="tdesign-demo-block"
>
<div
class="t-back-top t-is-fixed t-back-top--round"
style="display: none;"
>
<svg
class="t-icon t-icon-backtop"
fill="none"
height="1em"
viewBox="0 0 16 16"
width="1em"
>
<path
d="M2 3h12V2H2v1zM3.38 10.23l4.1-4.03v8.64H8.5V6.2l4.18 4.08.71-.7-5.05-4.93a.5.5 0 00-.7 0l-4.98 4.9.72.69z"
fill="currentColor"
fill-opacity="0.9"
/>
</svg>
<!--v-if-->
</div>
</div>
</div>
`;

exports[`BackTop > BackTop themeVue demo works fine 1`] = `
<div>
<div
class="tdesign-demo-block"
>
<div
class="t-back-top t-is-fixed t-back-top--half-round-dark"
style="display: none;"
>
<svg
class="t-icon t-icon-backtop"
fill="none"
height="1em"
viewBox="0 0 16 16"
width="1em"
>
<path
d="M2 3h12V2H2v1zM3.38 10.23l4.1-4.03v8.64H8.5V6.2l4.18 4.08.71-.7-5.05-4.93a.5.5 0 00-.7 0l-4.98 4.9.72.69z"
fill="currentColor"
fill-opacity="0.9"
/>
</svg>
<!--v-if-->
</div>
<div
class="t-back-top t-is-fixed t-back-top--round"
style="display: none;"
>

<div>
图标
</div>

<span
class="t-back-top__text"
style="min-width: 12px; max-width: 24px; width: auto; display: inline-block;"
>
顶部
</span>
</div>
</div>
</div>
`;
6 changes: 0 additions & 6 deletions src/back-top/__test__/demo.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@
*/

import { mount } from '@vue/test-utils';
import baseVue from '@/back-top/demos/base.vue';
import halfRoundVue from '@/back-top/demos/half-round.vue';
import mobileVue from '@/back-top/demos/mobile.vue';
import roundVue from '@/back-top/demos/round.vue';
import targetVue from '@/back-top/demos/target.vue';
import themeVue from '@/back-top/demos/theme.vue';

const mapper = {
baseVue,
halfRoundVue,
mobileVue,
roundVue,
targetVue,
themeVue,
};

describe('BackTop', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/back-top/back-top.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</template>

<script lang="ts">
import { computed, defineComponent, SetupContext, getCurrentInstance, h } from 'vue';
import { computed, defineComponent, getCurrentInstance, h } from 'vue';
import { useElementBounding } from '@vueuse/core';
import { BacktopIcon as TIconBackTop } from 'tdesign-icons-vue-next';

Expand All @@ -26,7 +26,7 @@ export default defineComponent({
name,
components: { TNode, TIconBackTop },
props: BackTopProps,
setup(props, context: SetupContext) {
setup(props, context) {
const emitEvent = useEmitEvent(props, context.emit);
const el = computed(() => {
return props.target ? props.target() : window.document.documentElement;
Expand Down
Loading