Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@
.map((field) => ({
value: field.key,
label: field.key,
leadingIcon: baseColumnOptions.find((option) => option.type === field.type)?.icon
leadingIcon: baseColumnOptions.find(
(option) =>
option.type === field.type &&
option.format ===
('format' in field && field.format ? field.format : undefined)
)?.icon
}))
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,26 +515,30 @@
{columnType.toLowerCase()}
</Spreadsheet.Cell>
<Spreadsheet.Cell column="indexed" {root} isEditable={false}>
<!-- $id is always indexed internally -->
{@const isActuallyIndexed =
isId || $indexes.some((index) => index.columns.includes(column.key))}

<!-- $id is always indexed internally -->
{@const checked = isId || isActuallyIndexed || !!columnIndexMap[column.key]}

<Selector.Checkbox
size="s"
{checked}
disabled={isActuallyIndexed}
on:change={(e) => {
if (!isActuallyIndexed) {
if (e.detail) {
columnIndexMap[column.key] = true;
$showCreateIndexSheet.show = true;
$showCreateIndexSheet.column = column.key;
{#if !isRelationship(column)}
<!-- $id is always indexed internally -->
{@const isActuallyIndexed =
isId ||
$indexes.some((index) => index.columns.includes(column.key))}

<!-- $id is always indexed internally -->
{@const checked =
isId || isActuallyIndexed || !!columnIndexMap[column.key]}

<Selector.Checkbox
size="s"
{checked}
disabled={isActuallyIndexed}
on:change={(e) => {
if (!isActuallyIndexed) {
if (e.detail) {
columnIndexMap[column.key] = true;
$showCreateIndexSheet.show = true;
$showCreateIndexSheet.column = column.key;
}
}
}
}} />
}} />
{/if}
</Spreadsheet.Cell>
<Spreadsheet.Cell column="default" {root} isEditable={false}>
{@const _default = column.required
Expand Down