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 inputnumber width and SSR render #664

Merged
merged 5 commits into from
Mar 29, 2022
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 examples/input-number/demos/align.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<div class="tdesign-demo-block-column">
<div style="width: 20%">
<t-input-number :default-value="100" align="left" style="width: 120px" />
<t-input-number :default-value="200" align="center" style="width: 120px" />
<t-input-number :default-value="300" align="right" style="width: 120px" />
<t-input-number :default-value="100" align="left" />
<t-input-number :default-value="200" align="center" />
<t-input-number :default-value="300" align="right" />
</div>
<div style="width: 20%">
<t-input-number :default-value="100" align="left" theme="normal" style="width: 120px" />
<t-input-number :default-value="200" align="center" theme="normal" style="width: 120px" />
<t-input-number :default-value="300" align="right" theme="normal" style="width: 120px" />
<t-input-number :default-value="100" align="left" theme="normal" />
<t-input-number :default-value="200" align="center" theme="normal" />
<t-input-number :default-value="300" align="right" theme="normal" />
</div>
</div>
</template>
2 changes: 1 addition & 1 deletion src/table/filter-controller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default defineComponent({
innerFilterValue: Object as PropType<TableFilterControllerProps['innerFilterValue']>,
tableFilterClasses: Object as PropType<TableFilterControllerProps['tableFilterClasses']>,
isFocusClass: String,
primaryTableElement: HTMLDivElement,
primaryTableElement: {},
},

// eslint-disable-next-line
Expand Down
2 changes: 1 addition & 1 deletion src/table/tbody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default defineComponent({
columns: Array as PropType<TableBodyProps['columns']>,
rowAndColFixedPosition: Map as PropType<TableBodyProps['rowAndColFixedPosition']>,
showColumnShadow: Object as PropType<TableBodyProps['showColumnShadow']>,
tableElm: HTMLDivElement as PropType<TableBodyProps['tableElm']>,
tableElm: {},
tableWidth: Number,
isWidthOverflow: Boolean,
// 以下内容为虚拟滚动所需参数
Expand Down
2 changes: 1 addition & 1 deletion src/table/tr.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default defineComponent({
trs: Map as PropType<TrProps['trs']>,
bufferSize: Number,
isVirtual: Boolean,
tableElm: HTMLDivElement as PropType<TrProps['tableElm']>,
tableElm: {},
},

setup(props: TrProps, context: SetupContext) {
Expand Down
12 changes: 6 additions & 6 deletions test/ssr/__snapshots__/ssr.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5658,7 +5658,7 @@ exports[`ssr snapshot test renders ./examples/input/demos/textarea.vue correctly
exports[`ssr snapshot test renders ./examples/input-number/demos/align.vue correctly 1`] = `
<div class="tdesign-demo-block-column">
<div style="width:20%;">
<div class="t-input-number t-size-m t-input-number--row" style="width:120px;"><button type="button" class="t-button t-size-m t-button--variant-outline t-button--theme-default t-button--shape-square t-input-number__decrease"><svg fill="none" viewBox="0 0 16 16" width="1em" height="1em" class="t-icon t-icon-remove t-size-m">
<div class="t-input-number t-size-m t-input-number--row"><button type="button" class="t-button t-size-m t-button--variant-outline t-button--theme-default t-button--shape-square t-input-number__decrease"><svg fill="none" viewBox="0 0 16 16" width="1em" height="1em" class="t-icon t-icon-remove t-size-m">
<path fill="currentColor" d="M3.5 7.35h9v1.3h-9v-1.3z" fill-opacity="0.9"></path>
</svg></button>
<div class="t-input__wrap">
Expand All @@ -5667,7 +5667,7 @@ exports[`ssr snapshot test renders ./examples/input-number/demos/align.vue corre
<path fill="currentColor" d="M7.35 8.65v3.85h1.3V8.65h3.85v-1.3H8.65V3.5h-1.3v3.85H3.5v1.3h3.85z" fill-opacity="0.9"></path>
</svg></button>
</div>
<div class="t-input-number t-size-m t-input-number--row" style="width:120px;"><button type="button" class="t-button t-size-m t-button--variant-outline t-button--theme-default t-button--shape-square t-input-number__decrease"><svg fill="none" viewBox="0 0 16 16" width="1em" height="1em" class="t-icon t-icon-remove t-size-m">
<div class="t-input-number t-size-m t-input-number--row"><button type="button" class="t-button t-size-m t-button--variant-outline t-button--theme-default t-button--shape-square t-input-number__decrease"><svg fill="none" viewBox="0 0 16 16" width="1em" height="1em" class="t-icon t-icon-remove t-size-m">
<path fill="currentColor" d="M3.5 7.35h9v1.3h-9v-1.3z" fill-opacity="0.9"></path>
</svg></button>
<div class="t-input__wrap">
Expand All @@ -5676,7 +5676,7 @@ exports[`ssr snapshot test renders ./examples/input-number/demos/align.vue corre
<path fill="currentColor" d="M7.35 8.65v3.85h1.3V8.65h3.85v-1.3H8.65V3.5h-1.3v3.85H3.5v1.3h3.85z" fill-opacity="0.9"></path>
</svg></button>
</div>
<div class="t-input-number t-size-m t-input-number--row" style="width:120px;"><button type="button" class="t-button t-size-m t-button--variant-outline t-button--theme-default t-button--shape-square t-input-number__decrease"><svg fill="none" viewBox="0 0 16 16" width="1em" height="1em" class="t-icon t-icon-remove t-size-m">
<div class="t-input-number t-size-m t-input-number--row"><button type="button" class="t-button t-size-m t-button--variant-outline t-button--theme-default t-button--shape-square t-input-number__decrease"><svg fill="none" viewBox="0 0 16 16" width="1em" height="1em" class="t-icon t-icon-remove t-size-m">
<path fill="currentColor" d="M3.5 7.35h9v1.3h-9v-1.3z" fill-opacity="0.9"></path>
</svg></button>
<div class="t-input__wrap">
Expand All @@ -5687,17 +5687,17 @@ exports[`ssr snapshot test renders ./examples/input-number/demos/align.vue corre
</div>
</div>
<div style="width:20%;">
<div class="t-input-number t-size-m t-input-number--normal" style="width:120px;">
<div class="t-input-number t-size-m t-input-number--normal">
<div class="t-input__wrap">
<div ref="refInputElem" class="t-input t-size-m"><input autocomplete="off" placeholder="请输入" type="text" unselectable="off" value="100" class="t-input__inner"></div>
</div>
</div>
<div class="t-input-number t-size-m t-input-number--normal" style="width:120px;">
<div class="t-input-number t-size-m t-input-number--normal">
<div class="t-input__wrap">
<div ref="refInputElem" class="t-input t-size-m t-align-center"><input autocomplete="off" placeholder="请输入" type="text" unselectable="off" value="200" class="t-input__inner"></div>
</div>
</div>
<div class="t-input-number t-size-m t-input-number--normal" style="width:120px;">
<div class="t-input-number t-size-m t-input-number--normal">
<div class="t-input__wrap">
<div ref="refInputElem" class="t-input t-size-m t-align-right"><input autocomplete="off" placeholder="请输入" type="text" unselectable="off" value="300" class="t-input__inner"></div>
</div>
Expand Down