Skip to content

Commit

Permalink
chore: update snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
uyarn committed Dec 26, 2024
1 parent 1c77e29 commit 9d06784
Show file tree
Hide file tree
Showing 4 changed files with 284 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/select-input/useMultiple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function useMultiple(
const iKeys = computed<SelectInputKeys>(() => ({ ...DEFAULT_KEYS, ...props.keys }));
const tags = computed<TagInputValue>(() => {
if (!(props.value instanceof Array)) {
if (['', null, undefined].includes(props.value as any)) return [];
// if (['', null, undefined].includes(props.value as any)) return [];
return isObject(props.value) ? [props.value[iKeys.value.label]] : [props.value];
}
return props.value.map((item) => (isObject(item) ? item[iKeys.value.label] : item));
Expand Down
4 changes: 2 additions & 2 deletions src/tag-input/tag-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default defineComponent({
const onClick: TdInputProps['onClick'] = (ctx) => {
if (isDisabled.value) return;
isFocused.value = true;
tagInputRef.value?.focus();
tagInputRef.value.focus();
props.onClick?.(ctx);
};

Expand All @@ -134,7 +134,7 @@ export default defineComponent({
};

const focus = () => {
tagInputRef.value?.focus();
tagInputRef.value.focus();
};

const blur = () => {
Expand Down
279 changes: 279 additions & 0 deletions test/unit/snap/__snapshots__/csr.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -48766,6 +48766,283 @@ exports[`csr snapshot test > csr test ./src/date-picker/_example/month.vue 1`] =
<!---->


</div>
`;

exports[`csr snapshot test > csr test ./src/date-picker/_example/multiple.vue 1`] = `
<div
class="t-space t-space-vertical"
style="gap: 16px;"
>


<div
class="t-space-item"
>
<div
class="t-date-picker"
>
<div
class="t-select-input t-select-input--multiple t-select-input--empty"
needconfirm="true"
>

<div
class="t-input__wrap t-tag-input t-tag-input--break-line t-tag-input--with-tag"
>
<div
class="t-input t-is-readonly t-input--prefix t-input--suffix"
>
<!---->
<div
class="t-input__prefix"
>

<div
class="t-tag t-tag--default t-tag--dark t-tag--close"
>
<!---->
<span>



</span>
<svg
class="t-icon t-icon-close t-tag__icon-close"
fill="none"
height="1em"
viewBox="0 0 24 24"
width="1em"
>
<path
d="M7.05 5.64L12 10.59l4.95-4.95 1.41 1.41L13.41 12l4.95 4.95-1.41 1.41L12 13.41l-4.95 4.95-1.41-1.41L10.59 12 5.64 7.05l1.41-1.41z"
fill="currentColor"
/>
</svg>
</div>

</div>
<input
class="t-input__inner t-input--soft-hidden"
placeholder=""
readonly=""
spellcheck="false"
type="text"
unselectable="on"
/>
<span
class="t-input__input-pre"
>

</span>
<!---->
<!---->
<span
class="t-input__suffix t-input__suffix-icon"
>
<svg
class="t-icon t-icon-calendar"
fill="none"
height="1em"
viewBox="0 0 24 24"
width="1em"
>
<path
d="M6 4V1.5h2V4h8V1.5h2V4h4v18H2V4h4zM4 6v3h16V6H4zm16 5H4v9h16v-9z"
fill="currentColor"
/>
</svg>
</span>
</div>
<!---->
</div>
<!---->

<!---->
</div>
</div>
</div>
<!---->


<div
class="t-space-item"
>
<div
class="t-date-picker"
>
<div
class="t-select-input t-select-input--multiple t-select-input--empty"
needconfirm="true"
>

<div
class="t-input__wrap t-tag-input t-tag-input--break-line t-tag-input--with-tag"
>
<div
class="t-input t-is-readonly t-input--prefix t-input--suffix"
>
<!---->
<div
class="t-input__prefix"
>

<div
class="t-tag t-tag--default t-tag--dark t-tag--close"
>
<!---->
<span>



</span>
<svg
class="t-icon t-icon-close t-tag__icon-close"
fill="none"
height="1em"
viewBox="0 0 24 24"
width="1em"
>
<path
d="M7.05 5.64L12 10.59l4.95-4.95 1.41 1.41L13.41 12l4.95 4.95-1.41 1.41L12 13.41l-4.95 4.95-1.41-1.41L10.59 12 5.64 7.05l1.41-1.41z"
fill="currentColor"
/>
</svg>
</div>

</div>
<input
class="t-input__inner t-input--soft-hidden"
placeholder=""
readonly=""
spellcheck="false"
type="text"
unselectable="on"
/>
<span
class="t-input__input-pre"
>

</span>
<!---->
<!---->
<span
class="t-input__suffix t-input__suffix-icon"
>
<svg
class="t-icon t-icon-calendar"
fill="none"
height="1em"
viewBox="0 0 24 24"
width="1em"
>
<path
d="M6 4V1.5h2V4h8V1.5h2V4h4v18H2V4h4zM4 6v3h16V6H4zm16 5H4v9h16v-9z"
fill="currentColor"
/>
</svg>
</span>
</div>
<!---->
</div>
<!---->

<!---->
</div>
</div>
</div>
<!---->


<div
class="t-space-item"
>
<div
class="t-date-picker"
>
<div
class="t-select-input t-select-input--multiple t-select-input--empty"
needconfirm="true"
>

<div
class="t-input__wrap t-tag-input t-tag-input--break-line t-tag-input--with-tag"
>
<div
class="t-input t-is-readonly t-input--prefix t-input--suffix"
>
<!---->
<div
class="t-input__prefix"
>

<div
class="t-tag t-tag--default t-tag--dark t-tag--close"
>
<!---->
<span>



</span>
<svg
class="t-icon t-icon-close t-tag__icon-close"
fill="none"
height="1em"
viewBox="0 0 24 24"
width="1em"
>
<path
d="M7.05 5.64L12 10.59l4.95-4.95 1.41 1.41L13.41 12l4.95 4.95-1.41 1.41L12 13.41l-4.95 4.95-1.41-1.41L10.59 12 5.64 7.05l1.41-1.41z"
fill="currentColor"
/>
</svg>
</div>

</div>
<input
class="t-input__inner t-input--soft-hidden"
placeholder=""
readonly=""
spellcheck="false"
type="text"
unselectable="on"
/>
<span
class="t-input__input-pre"
>

</span>
<!---->
<!---->
<span
class="t-input__suffix t-input__suffix-icon"
>
<svg
class="t-icon t-icon-calendar"
fill="none"
height="1em"
viewBox="0 0 24 24"
width="1em"
>
<path
d="M6 4V1.5h2V4h8V1.5h2V4h4v18H2V4h4zM4 6v3h16V6H4zm16 5H4v9h16v-9z"
fill="currentColor"
/>
</svg>
</span>
</div>
<!---->
</div>
<!---->

<!---->
</div>
</div>
</div>
<!---->


</div>
`;

Expand All @@ -48788,6 +49065,7 @@ exports[`csr snapshot test > csr test ./src/date-picker/_example/panel.vue 1`] =
<!---->
<div
class="t-date-picker__panel-content"
multiple="false"
>
<div
class="t-date-picker__panel-date"
Expand Down Expand Up @@ -49494,6 +49772,7 @@ exports[`csr snapshot test > csr test ./src/date-picker/_example/panel.vue 1`] =
<!---->
<div
class="t-date-picker__panel-content"
multiple="false"
>
<div
class="t-date-picker__panel-date"
Expand Down
2 changes: 2 additions & 0 deletions test/unit/snap/__snapshots__/ssr.test.js.snap

Large diffs are not rendered by default.

0 comments on commit 9d06784

Please sign in to comment.