Skip to content

Commit

Permalink
Merge pull request #955 from traPtitech/dependabot/npm_and_yarn/dashb…
Browse files Browse the repository at this point in the history
…oard/non-majors-6c674af8c2

build(deps): bump the non-majors group in /dashboard with 12 updates
  • Loading branch information
pirosiki197 authored Sep 3, 2024
2 parents fac5dbc + 51aed92 commit c92462b
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 189 deletions.
22 changes: 11 additions & 11 deletions dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,41 +23,41 @@
"@macaron-css/core": "1.5.2",
"@macaron-css/solid": "1.5.1",
"@macaron-css/vite": "1.5.1",
"@tanstack/virtual-core": "3.8.4",
"@types/node": "22.1.0",
"@tanstack/virtual-core": "3.10.6",
"@types/node": "22.5.2",
"jsdom": "24.1.1",
"rollup-plugin-visualizer": "5.12.0",
"typescript": "5.5.4",
"unplugin-fonts": "1.1.1",
"vite": "5.3.5",
"vite": "5.4.2",
"vite-plugin-compression": "0.5.1",
"vite-plugin-solid": "2.10.2",
"vite-plugin-solid-svg": "0.8.1",
"vitest": "2.0.3"
"vitest": "2.0.5"
},
"dependencies": {
"@bufbuild/protobuf": "1.10.0",
"@connectrpc/connect": "1.4.0",
"@connectrpc/connect-web": "1.4.0",
"@kobalte/core": "0.13.4",
"@kobalte/core": "0.13.6",
"@modular-forms/solid": "0.22.1",
"@solid-primitives/refs": "1.0.8",
"@solidjs/meta": "0.29.4",
"@solidjs/router": "0.14.1",
"@tanstack/solid-virtual": "3.8.4",
"@solidjs/router": "0.14.2",
"@tanstack/solid-virtual": "3.10.6",
"@types/async-lock": "1.4.2",
"ansi-to-html": "0.7.2",
"async-lock": "1.4.1",
"chart.js": "4.4.3",
"chart.js": "4.4.4",
"fuse.js": "7.0.0",
"solid-chartjs": "1.3.11",
"solid-icons": "1.1.0",
"solid-js": "1.8.19",
"solid-js": "1.8.22",
"solid-tippy": "0.2.1",
"solid-toast": "0.5.0",
"tippy.js": "6.3.7",
"ts-pattern": "5.2.0",
"valibot": "0.36.0"
"ts-pattern": "5.3.1",
"valibot": "0.41.0"
},
"packageManager": "yarn@4.1.1+sha512.ec40d0639bb307441b945d9467139cbb88d14394baac760b52eca038b330d16542d66fef61574271534ace5a200518dabf3b53a85f1f9e4bfa37141b538a9590"
}
30 changes: 11 additions & 19 deletions dashboard/src/components/templates/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ type SelectProps<T extends string | number> = {

export type SingleSelectProps<T extends string | number> = SelectProps<T> & {
value: T | undefined
setValue?: (v: T) => void
setValue?: (v: T | undefined) => void
}

export const SingleSelect = <T extends string | number>(props: SingleSelectProps<T>): JSX.Element => {
Expand All @@ -176,16 +176,12 @@ export const SingleSelect = <T extends string | number>(props: SingleSelectProps

// const selectedOption = () => props.options.find((o) => o.value === props.value)
const [selectedOption, setSelectedOption] = createSignal<SelectOption<T>>()
// KobalteのSelect/Comboboxではundefinedを使用できないため、空文字列を指定している
const defaultOption = { label: '', value: '' as T }

createEffect(() => {
const found = props.options.find((o) => o.value === props.value)
// KobalteのSelect/Comboboxではundefinedを使用できないため、空文字列を指定している
setSelectedOption(
found ?? {
label: '',
value: '' as T,
},
)
setSelectedOption(found ?? defaultOption)
})

return (
Expand All @@ -196,8 +192,8 @@ export const SingleSelect = <T extends string | number>(props: SingleSelectProps
disallowEmptySelection
value={selectedOption()}
onChange={(v) => {
props.setValue?.(v.value)
setSelectedOption(v)
props.setValue?.(v?.value)
setSelectedOption(v ?? defaultOption)
}}
optionValue="value"
optionTextValue="label"
Expand Down Expand Up @@ -372,16 +368,12 @@ export const ComboBox = <T extends string | number>(props: ComboBoxProps<T>): JS
)

const [selectedOption, setSelectedOption] = createSignal<SelectOption<T>>()
// KobalteのSelect/Comboboxではundefinedを使用できないため、空文字列を指定している
const defaultOption = { label: '', value: '' as T }

createEffect(() => {
const found = props.options.find((o) => o.value === props.value)
// KobalteのSelect/Comboboxではundefinedを使用できないため、空文字列を指定している
setSelectedOption(
found ?? {
label: '',
value: '' as T,
},
)
setSelectedOption(found ?? defaultOption)
})

return (
Expand All @@ -391,8 +383,8 @@ export const ComboBox = <T extends string | number>(props: ComboBoxProps<T>): JS
allowDuplicateSelectionEvents
value={selectedOption()}
onChange={(v) => {
props.setValue?.(v.value)
setSelectedOption(v)
props.setValue?.(v?.value)
setSelectedOption(v ?? defaultOption)
}}
optionValue="value"
optionTextValue="label"
Expand Down
Loading

0 comments on commit c92462b

Please sign in to comment.