@lapis-notes/bases 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +1 -1
- package/dist/bases-plugin.js +18 -21
- package/dist/bases-view/bases.svelte.d.ts +7 -0
- package/dist/bases-view/bases.svelte.js +37 -7
- package/dist/bases-view/card-view/components/card-placeholder.svelte +7 -3
- package/dist/bases-view/card-view/components/card.svelte +23 -15
- package/dist/bases-view/cell.svelte +147 -16
- package/dist/bases-view/cell.svelte.d.ts +2 -0
- package/dist/bases-view/columns.js +3 -2
- package/dist/bases-view/components/bases-embed.svelte +28 -0
- package/dist/bases-view/components/bases-embed.svelte.d.ts +12 -0
- package/dist/bases-view/components/bases-error.svelte +26 -0
- package/dist/bases-view/components/bases-error.svelte.d.ts +6 -0
- package/dist/bases-view/components/datetime.svelte +3 -0
- package/dist/bases-view/components/datetime.svelte.d.ts +1 -0
- package/dist/bases-view/components/file-preview.svelte +57 -0
- package/dist/bases-view/components/file-preview.svelte.d.ts +8 -0
- package/dist/bases-view/components/file.svelte +22 -5
- package/dist/bases-view/components/property-picker.svelte +147 -0
- package/dist/bases-view/components/property-picker.svelte.d.ts +13 -0
- package/dist/bases-view/components/sort/sort-root.svelte +107 -88
- package/dist/bases-view/components/sort/sort-root.svelte.d.ts +1 -0
- package/dist/bases-view/components/views.svelte +96 -42
- package/dist/bases-view/document-core.js +30 -0
- package/dist/bases-view/filter-parser.d.ts +1 -1
- package/dist/bases-view/filter-parser.js +2 -1
- package/dist/bases-view/index.js +15 -0
- package/dist/bases-view/kanban-view/configuration.d.ts +8 -0
- package/dist/bases-view/kanban-view/configuration.js +40 -0
- package/dist/bases-view/kanban-view/index.d.ts +55 -0
- package/dist/bases-view/kanban-view/index.js +296 -0
- package/dist/bases-view/kanban-view/kanban.svelte +284 -0
- package/dist/bases-view/kanban-view/kanban.svelte.d.ts +7 -0
- package/dist/bases-view/kanban-view/mapping.d.ts +77 -0
- package/dist/bases-view/kanban-view/mapping.js +206 -0
- package/dist/bases-view/kanban-view/markdown-detail.svelte +123 -0
- package/dist/bases-view/kanban-view/markdown-detail.svelte.d.ts +13 -0
- package/dist/bases-view/kanban-view/settings.svelte +87 -0
- package/dist/bases-view/kanban-view/settings.svelte.d.ts +7 -0
- package/dist/bases-view/list-view/list.svelte +84 -84
- package/dist/bases-view/map-view/view.svelte +6 -1
- package/dist/bases-view/metadata-invalidation-core.d.ts +1 -0
- package/dist/bases-view/metadata-invalidation-core.js +3 -2
- package/dist/bases-view/models.d.ts +26 -0
- package/dist/bases-view/unknown-view/view.svelte +13 -6
- package/dist/bases-view/view-header.svelte +20 -6
- package/dist/bases-view/view-registration-inventory.d.ts +8 -0
- package/dist/bases-view/view-registration-inventory.js +2 -0
- package/dist/bases-view/view-settings.svelte +213 -237
- package/dist/index.d.ts +1 -1
- package/dist/styles.css +495 -74
- package/manifest.json +2 -1
- package/package.json +3 -2
- package/registry.json +85 -1
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
const commandListId = $props.id();
|
|
3
2
|
import { Icon } from "@lapis-notes/api/icon";
|
|
4
|
-
import {
|
|
3
|
+
import { ColorPicker } from "@lapismd/design-core/forms";
|
|
4
|
+
import PropertyPicker from "./components/property-picker.svelte";
|
|
5
|
+
import KanbanSettings from "./kanban-view/settings.svelte";
|
|
6
|
+
import * as Field from "@lapismd/design-core/shadcn/field";
|
|
5
7
|
import { Input } from "@lapismd/design-core/shadcn/input";
|
|
6
8
|
import { Textarea } from "@lapismd/design-core/shadcn/textarea";
|
|
7
9
|
import * as Select from "@lapismd/design-core/shadcn/select";
|
|
8
10
|
import { Slider } from "@lapismd/design-core/shadcn/slider";
|
|
9
11
|
import { Switch } from "@lapismd/design-core/shadcn/switch";
|
|
10
|
-
import * as Popover from "@lapismd/design-core/shadcn/popover";
|
|
11
|
-
import * as Command from "@lapismd/design-core/shadcn/command";
|
|
12
|
-
import { Button } from "@lapismd/design-core/shadcn/button";
|
|
13
|
-
import ArrowUpDown from "@lucide/svelte/icons/chevrons-up-down";
|
|
14
|
-
import X from "@lucide/svelte/icons/x";
|
|
15
|
-
import CheckIcon from "@lucide/svelte/icons/check";
|
|
16
|
-
import { cn } from "@lapis-notes/api";
|
|
17
12
|
import type {
|
|
18
13
|
BasesAllOptions,
|
|
19
14
|
BasesOptions,
|
|
@@ -48,7 +43,11 @@
|
|
|
48
43
|
}
|
|
49
44
|
if (item.shouldHide?.()) return [];
|
|
50
45
|
return [
|
|
51
|
-
{
|
|
46
|
+
{
|
|
47
|
+
kind: "group",
|
|
48
|
+
key,
|
|
49
|
+
displayName: item.displayName,
|
|
50
|
+
} satisfies OptionEntry,
|
|
52
51
|
...flattenOptions(item.items, key),
|
|
53
52
|
];
|
|
54
53
|
});
|
|
@@ -57,7 +56,6 @@
|
|
|
57
56
|
const selectedLayout = $derived(
|
|
58
57
|
layoutOptions.find((f) => f.value === view.type) ?? layoutOptions[0],
|
|
59
58
|
);
|
|
60
|
-
let openPropertyKey = $state<string | null>(null);
|
|
61
59
|
|
|
62
60
|
function dropDownOptions(data: Record<string, string>) {
|
|
63
61
|
return Object.entries(data).map(([value, label]) => {
|
|
@@ -66,9 +64,9 @@
|
|
|
66
64
|
}
|
|
67
65
|
</script>
|
|
68
66
|
|
|
69
|
-
<
|
|
70
|
-
<
|
|
71
|
-
<Label for="layout"
|
|
67
|
+
<Field.Group class="bases-view-settings">
|
|
68
|
+
<Field.Field class="bases-view-setting">
|
|
69
|
+
<Field.Label for="layout">Layout</Field.Label>
|
|
72
70
|
<Select.Root
|
|
73
71
|
type="single"
|
|
74
72
|
name="layout"
|
|
@@ -95,7 +93,10 @@
|
|
|
95
93
|
</Select.Group>
|
|
96
94
|
</Select.Content>
|
|
97
95
|
</Select.Root>
|
|
98
|
-
</
|
|
96
|
+
</Field.Field>
|
|
97
|
+
{#if view.type === "kanban" || view.type === "activity"}<KanbanSettings
|
|
98
|
+
{controller}
|
|
99
|
+
/>{/if}
|
|
99
100
|
{#each optionEntries as entry (entry.key)}
|
|
100
101
|
{#if entry.kind === "group"}
|
|
101
102
|
<h3 class="bases-view-settings__group" data-ui-part="option-group">
|
|
@@ -103,245 +104,220 @@
|
|
|
103
104
|
</h3>
|
|
104
105
|
{:else}
|
|
105
106
|
{@const option = entry.option}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
107
|
+
{#if option.type === "dropdown"}
|
|
108
|
+
{@const selectOptions = dropDownOptions(option.options)}
|
|
109
|
+
{@const selectedOption =
|
|
110
|
+
selectOptions.find(
|
|
111
|
+
(it) =>
|
|
112
|
+
it.value ===
|
|
113
|
+
(controller.view.config.get(option.key) ?? option.default),
|
|
114
|
+
) ?? selectOptions[0]}
|
|
115
|
+
<Field.Field
|
|
116
|
+
class="bases-view-setting"
|
|
117
|
+
data-option-type="dropdown"
|
|
117
118
|
>
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
option.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
119
|
+
<Field.Label for={option.key}>{option.displayName}</Field.Label>
|
|
120
|
+
<Select.Root
|
|
121
|
+
type="single"
|
|
122
|
+
name={option.key}
|
|
123
|
+
bind:value={
|
|
124
|
+
() => {
|
|
125
|
+
return (controller.view.config.get(option.key) ||
|
|
126
|
+
option.default) as string;
|
|
127
|
+
},
|
|
128
|
+
(value) => {
|
|
129
|
+
controller.view.config.set(option.key, value);
|
|
130
|
+
}
|
|
128
131
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
<Select.
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
132
|
+
>
|
|
133
|
+
<Select.Trigger
|
|
134
|
+
aria-label={option.displayName}
|
|
135
|
+
class="bases-style-w-full-6da6a3"
|
|
136
|
+
>
|
|
137
|
+
{selectedOption.label}
|
|
138
|
+
</Select.Trigger>
|
|
139
|
+
<Select.Content>
|
|
140
|
+
<Select.Group>
|
|
141
|
+
<Select.Label>{option.displayName}</Select.Label>
|
|
142
|
+
{#each selectOptions as opt (opt.value)}
|
|
143
|
+
<Select.Item value={opt.value} label={opt.label}>
|
|
144
|
+
{opt.label}
|
|
145
|
+
</Select.Item>
|
|
146
|
+
{/each}
|
|
147
|
+
</Select.Group>
|
|
148
|
+
</Select.Content>
|
|
149
|
+
</Select.Root>
|
|
150
|
+
</Field.Field>
|
|
151
|
+
{:else if option.type === "slider"}
|
|
152
|
+
<Field.Field
|
|
153
|
+
class="bases-view-setting"
|
|
154
|
+
data-option-type="slider"
|
|
150
155
|
>
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
option.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
156
|
+
<Field.Label for={option.key}>{option.displayName}</Field.Label>
|
|
157
|
+
<Slider
|
|
158
|
+
data-tooltip={controller.view.config.get(option.key)}
|
|
159
|
+
type="single"
|
|
160
|
+
bind:value={
|
|
161
|
+
() => {
|
|
162
|
+
return (controller.view.config.get(option.key) ||
|
|
163
|
+
option.default) as number;
|
|
164
|
+
},
|
|
165
|
+
(value) => {
|
|
166
|
+
controller.view.config.set(option.key, value);
|
|
167
|
+
}
|
|
161
168
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
>{option.displayName}</Label
|
|
169
|
+
min={option.min}
|
|
170
|
+
max={option.max}
|
|
171
|
+
step={option.step}
|
|
172
|
+
class="bases-style-w-full-6da6a3"
|
|
173
|
+
/>
|
|
174
|
+
</Field.Field>
|
|
175
|
+
{:else if option.type === "text"}
|
|
176
|
+
<Field.Field
|
|
177
|
+
class="bases-view-setting"
|
|
178
|
+
data-option-type="text"
|
|
173
179
|
>
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
180
|
+
<Field.Label for={option.key}>{option.displayName}</Field.Label>
|
|
181
|
+
{#if option.key === "badgeColor" && (view.type === "kanban" || view.type === "activity")}
|
|
182
|
+
<ColorPicker
|
|
183
|
+
value={String(controller.view.config.get(option.key) ?? "")}
|
|
184
|
+
placeholder="#15803d"
|
|
185
|
+
ariaLabel={option.displayName}
|
|
186
|
+
onChange={(value) =>
|
|
187
|
+
controller.view.config.set(option.key, value)}
|
|
188
|
+
/>
|
|
189
|
+
{:else}
|
|
190
|
+
<Input
|
|
191
|
+
bind:value={
|
|
192
|
+
() => {
|
|
193
|
+
return (controller.view.config.get(option.key) ??
|
|
194
|
+
option.default ??
|
|
195
|
+
"") as string;
|
|
196
|
+
},
|
|
197
|
+
(value) => {
|
|
198
|
+
controller.view.config.set(option.key, value);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
id={option.key}
|
|
202
|
+
placeholder={option.placeholder}
|
|
203
|
+
/>
|
|
204
|
+
{/if}
|
|
205
|
+
</Field.Field>
|
|
206
|
+
{:else if option.type === "multitext"}
|
|
207
|
+
<Field.Field
|
|
208
|
+
class="bases-view-setting"
|
|
209
|
+
data-option-type="multitext"
|
|
210
|
+
>
|
|
211
|
+
<Field.Label for={option.key}>{option.displayName}</Field.Label>
|
|
212
|
+
<Input
|
|
213
|
+
id={option.key}
|
|
214
|
+
value={(
|
|
215
|
+
(controller.view.config.get(option.key) ??
|
|
178
216
|
option.default ??
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
-
(
|
|
182
|
-
controller.view.config.set(
|
|
217
|
+
[]) as string[]
|
|
218
|
+
).join(", ")}
|
|
219
|
+
onblur={(event) => {
|
|
220
|
+
controller.view.config.set(
|
|
221
|
+
option.key,
|
|
222
|
+
event.currentTarget.value
|
|
223
|
+
.split(",")
|
|
224
|
+
.map((value) => value.trim())
|
|
225
|
+
.filter(Boolean),
|
|
226
|
+
);
|
|
227
|
+
}}
|
|
228
|
+
/>
|
|
229
|
+
</Field.Field>
|
|
230
|
+
{:else if option.type === "toggle"}
|
|
231
|
+
<Field.Field
|
|
232
|
+
class="bases-view-setting"
|
|
233
|
+
data-option-type="toggle"
|
|
234
|
+
>
|
|
235
|
+
<Field.Label for={option.key}>{option.displayName}</Field.Label>
|
|
236
|
+
<Switch
|
|
237
|
+
bind:checked={
|
|
238
|
+
() => {
|
|
239
|
+
return Boolean(
|
|
240
|
+
controller.view.config.get(option.key) ?? option.default,
|
|
241
|
+
);
|
|
242
|
+
},
|
|
243
|
+
(value) => {
|
|
244
|
+
controller.view.config.set(option.key, value);
|
|
245
|
+
}
|
|
183
246
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
<Label for={option.key} class="bases-style-text-sm-fc7473 bases-style-opacity-50-0b8c50">{option.displayName}</Label>
|
|
192
|
-
<Input
|
|
193
|
-
id={option.key}
|
|
194
|
-
value={((controller.view.config.get(option.key) ?? option.default ?? []) as string[]).join(", ")}
|
|
195
|
-
onblur={(event) => {
|
|
196
|
-
controller.view.config.set(
|
|
197
|
-
option.key,
|
|
198
|
-
event.currentTarget.value
|
|
199
|
-
.split(",")
|
|
200
|
-
.map((value) => value.trim())
|
|
201
|
-
.filter(Boolean),
|
|
202
|
-
);
|
|
203
|
-
}}
|
|
204
|
-
/>
|
|
205
|
-
</div>
|
|
206
|
-
{:else if option.type === "toggle"}
|
|
207
|
-
<div class="bases-style-grid-f3c543 bases-style-grid-cols-1-d7c833 bases-style-items-center-3960ff bases-style-gap-2-77a2a2 bases-style-px-2-d5eab2 bases-style-pt-1-6b7d6e" data-ui-part="view-option" data-option-type="toggle">
|
|
208
|
-
<Label for={option.key} class="bases-style-text-sm-fc7473 bases-style-opacity-50-0b8c50"
|
|
209
|
-
>{option.displayName}</Label
|
|
247
|
+
id={option.key}
|
|
248
|
+
/>
|
|
249
|
+
</Field.Field>
|
|
250
|
+
{:else if option.type === "file" || option.type === "folder"}
|
|
251
|
+
<Field.Field
|
|
252
|
+
class="bases-view-setting"
|
|
253
|
+
data-option-type={option.type}
|
|
210
254
|
>
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
)
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
255
|
+
<Field.Label for={option.key}>{option.displayName}</Field.Label>
|
|
256
|
+
<Input
|
|
257
|
+
id={option.key}
|
|
258
|
+
placeholder={option.placeholder}
|
|
259
|
+
bind:value={
|
|
260
|
+
() =>
|
|
261
|
+
(controller.view.config.get(option.key) ??
|
|
262
|
+
option.default ??
|
|
263
|
+
"") as string,
|
|
264
|
+
(value) => controller.view.config.set(option.key, value)
|
|
220
265
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
<Label for={option.key} class="bases-style-text-sm-fc7473 bases-style-opacity-50-0b8c50">{option.displayName}</Label>
|
|
228
|
-
<Input
|
|
229
|
-
id={option.key}
|
|
230
|
-
placeholder={option.placeholder}
|
|
231
|
-
bind:value={
|
|
232
|
-
() => (controller.view.config.get(option.key) ?? option.default ?? "") as string,
|
|
233
|
-
(value) => controller.view.config.set(option.key, value)
|
|
234
|
-
}
|
|
235
|
-
/>
|
|
236
|
-
</div>
|
|
237
|
-
{:else if option.type === "formula"}
|
|
238
|
-
<div class="bases-style-grid-f3c543 bases-style-grid-cols-1-d7c833 bases-style-items-center-3960ff bases-style-gap-2-77a2a2 bases-style-px-2-d5eab2 bases-style-pt-1-6b7d6e" data-ui-part="view-option" data-option-type="formula">
|
|
239
|
-
<Label for={option.key} class="bases-style-text-sm-fc7473 bases-style-opacity-50-0b8c50">{option.displayName}</Label>
|
|
240
|
-
<Textarea
|
|
241
|
-
id={option.key}
|
|
242
|
-
placeholder={option.placeholder}
|
|
243
|
-
bind:value={
|
|
244
|
-
() => (controller.view.config.get(option.key) ?? option.default ?? "") as string,
|
|
245
|
-
(value) => controller.view.config.set(option.key, value)
|
|
246
|
-
}
|
|
247
|
-
/>
|
|
248
|
-
</div>
|
|
249
|
-
{:else if option.type === "property"}
|
|
250
|
-
<div class="bases-style-grid-f3c543 bases-style-grid-cols-1-d7c833 bases-style-items-center-3960ff bases-style-gap-2-77a2a2 bases-style-px-2-d5eab2 bases-style-pt-1-6b7d6e" data-ui-part="view-option" data-option-type="property">
|
|
251
|
-
<Label for={option.key} class="bases-style-text-sm-fc7473 bases-style-opacity-50-0b8c50"
|
|
252
|
-
>{option.displayName}</Label
|
|
266
|
+
/>
|
|
267
|
+
</Field.Field>
|
|
268
|
+
{:else if option.type === "formula"}
|
|
269
|
+
<Field.Field
|
|
270
|
+
class="bases-view-setting"
|
|
271
|
+
data-option-type="formula"
|
|
253
272
|
>
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
273
|
+
<Field.Label for={option.key}>{option.displayName}</Field.Label>
|
|
274
|
+
<Textarea
|
|
275
|
+
id={option.key}
|
|
276
|
+
placeholder={option.placeholder}
|
|
277
|
+
bind:value={
|
|
278
|
+
() =>
|
|
279
|
+
(controller.view.config.get(option.key) ??
|
|
280
|
+
option.default ??
|
|
281
|
+
"") as string,
|
|
282
|
+
(value) => controller.view.config.set(option.key, value)
|
|
259
283
|
}
|
|
260
|
-
|
|
284
|
+
/>
|
|
285
|
+
</Field.Field>
|
|
286
|
+
{:else if option.type === "property"}
|
|
287
|
+
<Field.Field
|
|
288
|
+
class="bases-view-setting"
|
|
289
|
+
data-option-type="property"
|
|
261
290
|
>
|
|
262
|
-
<
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
class="bases-style-h-8-ed8a5d grow bases-style-justify-between-8ef226 bases-style-rounded-none-0c5e91 bases-style-border-none-4a5f0e bases-style-shadow-none-ad47d1 bases-style-outline-none-df37b1"
|
|
277
|
-
>
|
|
278
|
-
<Icon name={[column?.icon ?? "lucide-file"]} />
|
|
279
|
-
{#if column?.displayName}
|
|
280
|
-
{column.displayName}
|
|
281
|
-
{:else}
|
|
282
|
-
<span class="bases-style-text-muted-foreground-bfa603"
|
|
283
|
-
>{option.placeholder ?? "Property"}</span
|
|
284
|
-
>{/if}
|
|
285
|
-
<ArrowUpDown />
|
|
286
|
-
</Button>
|
|
287
|
-
<X
|
|
288
|
-
onclick={(event) => {
|
|
289
|
-
event.preventDefault();
|
|
290
|
-
event.stopPropagation();
|
|
291
|
-
controller.view.config.set(option.key, "");
|
|
292
|
-
openPropertyKey = null;
|
|
293
|
-
}}
|
|
294
|
-
class="absolute bases-style-top-2-9a2db8 bases-style-right-6-82d7e5 bases-style-size-4-f7b5fa"
|
|
295
|
-
/>
|
|
296
|
-
</div>
|
|
297
|
-
{/snippet}
|
|
298
|
-
</Popover.Trigger>
|
|
299
|
-
<Popover.Content class="bases-style-w-310px-8357f2 bases-style-p-0-8a539c" align="start">
|
|
300
|
-
<Command.Root>
|
|
301
|
-
<Command.Input aria-controls={`${commandListId}-${option.key}`} placeholder="Find or create" />
|
|
302
|
-
<Command.List id={`${commandListId}-${option.key}`} class="bases-style-p-1-eb6a3c">
|
|
303
|
-
<Command.Empty>No results found.</Command.Empty>
|
|
304
|
-
{#each controller
|
|
305
|
-
.getAllColumns()
|
|
306
|
-
.filter((p) => !option.filter || option.filter(p.id)) as column (column.id)}
|
|
307
|
-
<Command.Item
|
|
308
|
-
onSelect={() => {
|
|
309
|
-
controller.view.config.set(option.key, column.id);
|
|
310
|
-
openPropertyKey = null;
|
|
311
|
-
}}
|
|
312
|
-
>
|
|
313
|
-
<div
|
|
314
|
-
class={cn(
|
|
315
|
-
"bases-style-mr-2-d2347e bases-style-flex-60fbb7 bases-style-size-4-f7b5fa bases-style-items-center-3960ff bases-style-justify-center-86843c",
|
|
316
|
-
(controller.view.config.get(option.key) ??
|
|
317
|
-
option.default) === column.id
|
|
318
|
-
? ""
|
|
319
|
-
: "bases-style-opacity-50-0b8c50 [&_svg]:invisible",
|
|
320
|
-
)}
|
|
321
|
-
>
|
|
322
|
-
<CheckIcon class="bases-style-size-4-f7b5fa" />
|
|
323
|
-
</div>
|
|
324
|
-
<Icon name={[column?.icon ?? "lucide-info"]} />
|
|
325
|
-
<span>{column?.displayName ?? column.id}</span>
|
|
326
|
-
<Command.Shortcut class="bases-style-font-mono-0e6570 bases-style-text-0-75em-c425cc"
|
|
327
|
-
>{column.id}</Command.Shortcut
|
|
328
|
-
>
|
|
329
|
-
</Command.Item>
|
|
330
|
-
{/each}
|
|
331
|
-
</Command.List>
|
|
332
|
-
</Command.Root>
|
|
333
|
-
</Popover.Content>
|
|
334
|
-
</Popover.Root>
|
|
335
|
-
</div>
|
|
336
|
-
{/if}
|
|
291
|
+
<Field.Label for={option.key}>{option.displayName}</Field.Label>
|
|
292
|
+
<PropertyPicker
|
|
293
|
+
id={option.key}
|
|
294
|
+
label={option.displayName}
|
|
295
|
+
columns={controller
|
|
296
|
+
.getAllColumns()
|
|
297
|
+
.filter((column) => !option.filter || option.filter(column.id))}
|
|
298
|
+
value={(controller.view.config.get(option.key) ??
|
|
299
|
+
option.default) as BasesPropertyId | undefined}
|
|
300
|
+
placeholder={option.placeholder ?? "Property"}
|
|
301
|
+
onChange={(value) => controller.view.config.set(option.key, value)}
|
|
302
|
+
/>
|
|
303
|
+
</Field.Field>
|
|
304
|
+
{/if}
|
|
337
305
|
{/if}
|
|
338
306
|
{/each}
|
|
339
|
-
</
|
|
307
|
+
</Field.Group>
|
|
340
308
|
|
|
341
309
|
<style>
|
|
310
|
+
:global(.bases-view-settings) {
|
|
311
|
+
gap: 1rem;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
:global(.bases-view-setting) {
|
|
315
|
+
min-width: 0;
|
|
316
|
+
gap: 0.5rem;
|
|
317
|
+
}
|
|
318
|
+
|
|
342
319
|
.bases-view-settings__group {
|
|
343
|
-
margin: 0
|
|
344
|
-
padding: 0 0.5rem;
|
|
320
|
+
margin: 0;
|
|
345
321
|
color: var(--ui-workspace-muted-foreground);
|
|
346
322
|
font-size: 0.75rem;
|
|
347
323
|
font-weight: 600;
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ export { default as manifest } from "@lapis-notes/bases/manifest.json";
|
|
|
5
5
|
export { BasesPlugin };
|
|
6
6
|
export { default as BasesViewSurface } from "./bases-view-surface.svelte";
|
|
7
7
|
export { BasesViewType, parseBasesDocument, serializeBasesDocument, } from "./bases-view";
|
|
8
|
-
export type { AnyBasesView, BasesDocument, BasesViewBase, CardsView, CustomBasesView, FilterLine, Filters, ListView, MapView, SortColumn, TableView, } from "./bases-view/models";
|
|
8
|
+
export type { ActivityBasesViewDocument, MarkdownCardViewOptions, AnyBasesView, BasesDocument, BasesViewBase, CardsView, CustomBasesView, FilterLine, Filters, KanbanBasesViewDocument, ListView, MapView, SortColumn, TableView, } from "./bases-view/models";
|
|
9
9
|
export type { BasesViewRegistration } from "./bases-view/bases.svelte";
|
|
10
10
|
export default BasesPlugin;
|