@streamscloud/kit 0.16.0 → 0.16.2
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/dist/core/repository/map-container.svelte.d.ts +1 -0
- package/dist/core/repository/map-container.svelte.js +3 -0
- package/dist/core/repository/repository.svelte.js +3 -0
- package/dist/core/repository/types.d.ts +2 -0
- package/dist/ui/page-toolbar/cmp.toolbar-search-input.svelte +7 -6
- package/dist/ui/page-toolbar/cmp.toolbar-search-input.svelte.d.ts +7 -4
- package/dist/ui/table/cmp.table.svelte +1 -1
- package/dist/ui/table/table-cells/table-checkbox-cell.svelte +1 -1
- package/dist/ui/table/table-headers/table-checkbox-header.svelte +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,8 @@ export type WithId = {
|
|
|
4
4
|
export interface Repository<T extends WithId> {
|
|
5
5
|
items: T[];
|
|
6
6
|
limit?: number;
|
|
7
|
+
/** O(1) membership check by id, backed by the keyed container. */
|
|
8
|
+
has(id: T['id']): boolean;
|
|
7
9
|
add(...item: T[]): void;
|
|
8
10
|
remove(...item: T[]): void;
|
|
9
11
|
set(...item: T[]): void;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { CONTROL_ICON_SIZE, scaleUp } from '../icon';
|
|
3
3
|
import { Input } from '../input';
|
|
4
4
|
import IconSearch from '@fluentui/svg-icons/icons/search_20_regular.svg?raw';
|
|
5
|
-
const { value, collapsedIconColor, collapsedIconSize, placeholder = '', size = 'sm', debounce = 0, shortcut = false, clearOnEscape = false, on } = $props();
|
|
5
|
+
const { value, collapsedIconColor, collapsedIconSize, placeholder = '', size = 'sm', debounce = 0, collapsible = true, shortcut = false, clearOnEscape = false, on } = $props();
|
|
6
6
|
let inputRef = $state.raw(undefined);
|
|
7
7
|
let focused = $state(false);
|
|
8
|
-
const expanded = $derived(focused || !!value);
|
|
8
|
+
const expanded = $derived(!collapsible || focused || !!value);
|
|
9
9
|
const collapsedSize = $derived(collapsedIconSize ?? scaleUp(CONTROL_ICON_SIZE[size]));
|
|
10
10
|
const onInput = (v) => {
|
|
11
11
|
on?.input?.(v);
|
|
@@ -47,10 +47,11 @@ const handleKeydown = (event) => {
|
|
|
47
47
|
|
|
48
48
|
<!--
|
|
49
49
|
@component
|
|
50
|
-
A
|
|
51
|
-
when empty + unfocused
|
|
52
|
-
Shares Input's size preset so it lines up with
|
|
53
|
-
for a document-wide Cmd/Ctrl+K focus-and-select,
|
|
50
|
+
A search input for toolbars. By default collapses to an icon-only square at the chosen field height
|
|
51
|
+
when empty + unfocused, and expands to the full input width when focused or when a value is present;
|
|
52
|
+
set `collapsible={false}` to keep it always expanded. Shares Input's size preset so it lines up with
|
|
53
|
+
other field-shaped controls. Opt into `shortcut` for a document-wide Cmd/Ctrl+K focus-and-select,
|
|
54
|
+
and `clearOnEscape` to clear on Escape.
|
|
54
55
|
|
|
55
56
|
### CSS Custom Properties
|
|
56
57
|
| Property | Description | Default |
|
|
@@ -7,6 +7,8 @@ type Props = {
|
|
|
7
7
|
placeholder?: string;
|
|
8
8
|
/** Size preset (shared with Input / DatePicker / Select). @default 'sm' */
|
|
9
9
|
size?: 'sm' | 'md' | 'lg';
|
|
10
|
+
/** Collapse to an icon-only square when empty + unfocused. Set false to keep the input always expanded. @default true */
|
|
11
|
+
collapsible?: boolean;
|
|
10
12
|
/** Debounce delay in ms @default 0 */
|
|
11
13
|
debounce?: number;
|
|
12
14
|
/** Bind Cmd/Ctrl+K document-wide to focus the input and select its text. Enable on a single instance per view. @default false */
|
|
@@ -18,10 +20,11 @@ type Props = {
|
|
|
18
20
|
};
|
|
19
21
|
};
|
|
20
22
|
/**
|
|
21
|
-
* A
|
|
22
|
-
* when empty + unfocused
|
|
23
|
-
* Shares Input's size preset so it lines up with
|
|
24
|
-
* for a document-wide Cmd/Ctrl+K focus-and-select,
|
|
23
|
+
* A search input for toolbars. By default collapses to an icon-only square at the chosen field height
|
|
24
|
+
* when empty + unfocused, and expands to the full input width when focused or when a value is present;
|
|
25
|
+
* set `collapsible={false}` to keep it always expanded. Shares Input's size preset so it lines up with
|
|
26
|
+
* other field-shaped controls. Opt into `shortcut` for a document-wide Cmd/Ctrl+K focus-and-select,
|
|
27
|
+
* and `clearOnEscape` to clear on Escape.
|
|
25
28
|
*
|
|
26
29
|
* ### CSS Custom Properties
|
|
27
30
|
* | Property | Description | Default |
|
|
@@ -238,7 +238,7 @@ const getEditorColumnOrDefault = (column, editMode) => {
|
|
|
238
238
|
{/snippet}
|
|
239
239
|
{#each model.items as item, itemIndex (item)}
|
|
240
240
|
{@const editMode = model.editingItem?.id === item.id}
|
|
241
|
-
{@const isSelected =
|
|
241
|
+
{@const isSelected = model.selection.has(item.id)}
|
|
242
242
|
{@const isHighlighted = model.highlightedItemIds.includes(item.id)}
|
|
243
243
|
{@const flushBottom = model.styles?.variant === 'card' && itemIndex === model.items.length - 1}
|
|
244
244
|
{@const zebra = model.styles?.zebra === true && itemIndex % 2 === 1 && !isSelected && !isHighlighted}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" generics="T extends {id: string}">import { Checkbox } from '../../checkbox';
|
|
2
2
|
let { item, selection } = $props();
|
|
3
|
-
const selected = $derived(
|
|
3
|
+
const selected = $derived(selection.has(item.id));
|
|
4
4
|
const disabled = $derived(!selected && !!selection.limit && selection.items.length >= selection.limit);
|
|
5
5
|
const toggle = () => {
|
|
6
6
|
if (selected) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" generics="T extends {id: string}">import { Checkbox } from '../../checkbox';
|
|
2
2
|
import TableHeader from './table-header.svelte';
|
|
3
3
|
let { column } = $props();
|
|
4
|
-
const allSelected = $derived(!!column.data.items.length && column.data.items.every((x) =>
|
|
4
|
+
const allSelected = $derived(!!column.data.items.length && column.data.items.every((x) => column.selection.has(x.id)));
|
|
5
5
|
const canSelectAll = $derived(column.data.items.length > 0 && (!column.selection.limit || column.data.items.length <= column.selection.limit));
|
|
6
6
|
const toggleSelectedAll = () => {
|
|
7
7
|
if (allSelected) {
|