@invopop/popui 0.0.7 → 0.0.9
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/BaseTable.svelte +18 -14
- package/dist/BaseTable.svelte.d.ts +1 -0
- package/dist/BaseTableCell.svelte +10 -3
- package/dist/BaseTableCell.svelte.d.ts +4 -1
- package/dist/BaseTableHeader.svelte +7 -5
- package/dist/BaseTableRow.svelte +17 -9
- package/dist/InputCheckbox.svelte +1 -1
- package/package.json +1 -1
package/dist/BaseTable.svelte
CHANGED
|
@@ -151,27 +151,32 @@ function selectRange(to) {
|
|
|
151
151
|
}}
|
|
152
152
|
/>
|
|
153
153
|
|
|
154
|
-
<div class="w-full
|
|
155
|
-
<table class="hidden md:table w-full
|
|
154
|
+
<div class="w-full font-sans">
|
|
155
|
+
<table class="hidden md:table w-full">
|
|
156
156
|
<thead>
|
|
157
157
|
<tr class="border-b border-neutral-100 relative">
|
|
158
158
|
{#if selectable}
|
|
159
159
|
<!-- if table is selectable we need to add an extra header with a checkbox -->
|
|
160
|
-
<th scope="col" class="bg-white sticky top-0 z-10 rounded-tr-md
|
|
160
|
+
<th scope="col" class="bg-white sticky top-0 z-10 rounded-tr-md">
|
|
161
161
|
{#if !hideSelectAll}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
162
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
163
|
+
<!-- svelte-ignore a11y-label-has-associated-control -->
|
|
164
|
+
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
|
|
165
|
+
<label class="pl-5 pr-3 h-[40px] flex items-center" on:click|stopPropagation>
|
|
166
|
+
<InputCheckbox
|
|
167
|
+
checked={allChecked}
|
|
168
|
+
{indeterminate}
|
|
169
|
+
on:change={(event) => {
|
|
170
|
+
toggleAllSelected(event.detail)
|
|
171
|
+
}}
|
|
172
|
+
/>
|
|
173
|
+
</label>
|
|
169
174
|
{/if}
|
|
170
175
|
</th>
|
|
171
176
|
{/if}
|
|
172
177
|
{#each fields as field, i (i)}
|
|
173
178
|
<BaseTableHeader
|
|
174
|
-
isFirst={i === 0}
|
|
179
|
+
isFirst={i === 0 && !selectable}
|
|
175
180
|
isLast={!addExtraCell && i === fields.length - 1}
|
|
176
181
|
{sortBy}
|
|
177
182
|
{sortDirection}
|
|
@@ -191,8 +196,8 @@ function selectRange(to) {
|
|
|
191
196
|
<tr>
|
|
192
197
|
<th
|
|
193
198
|
scope="colgroup"
|
|
194
|
-
colspan={fields.length + 1}
|
|
195
|
-
class="bg-neutral-50 px-
|
|
199
|
+
colspan={fields.length + (selectable ? 2 : 1)}
|
|
200
|
+
class="bg-neutral-50 px-5 text-left text-sm font-medium text-neutral-500 sticky top-11 tracking-normal border-t border-b border-neutral-100 h-8"
|
|
196
201
|
>
|
|
197
202
|
<span>{group.label}</span>
|
|
198
203
|
{#if !hideCounter}
|
|
@@ -261,7 +266,6 @@ function selectRange(to) {
|
|
|
261
266
|
{#each fields as field, i (i)}
|
|
262
267
|
<BaseTableCell
|
|
263
268
|
tag="div"
|
|
264
|
-
currentIndex={i}
|
|
265
269
|
{field}
|
|
266
270
|
badge={field.helperBadge ? field.helperBadge(row) : null}
|
|
267
271
|
status={field.helperStatus ? field.helperStatus(row) : null}
|
|
@@ -7,23 +7,30 @@ import { getCountryName } from "./helpers.js";
|
|
|
7
7
|
import UuidCopy from "./UuidCopy.svelte";
|
|
8
8
|
import { Icon } from "@steeze-ui/svelte-icon";
|
|
9
9
|
export let field;
|
|
10
|
-
export let
|
|
10
|
+
export let isFirst = false;
|
|
11
|
+
export let isLast = false;
|
|
11
12
|
export let badge = null;
|
|
12
13
|
export let status = null;
|
|
13
14
|
export let icons = null;
|
|
14
15
|
export let data = "";
|
|
15
16
|
export let freeWrap = false;
|
|
16
17
|
export let tag = "td";
|
|
18
|
+
export let selectable = false;
|
|
19
|
+
export let hasActions = false;
|
|
17
20
|
$:
|
|
18
21
|
cellStyles = clsx(
|
|
19
22
|
{ "tabular-nums slashed-zero lining-nums": field.monospacedNums },
|
|
20
23
|
{ "font-mono": field.monospaced },
|
|
21
|
-
{ "text-neutral-800 font-medium":
|
|
22
|
-
{ "text-neutral-800 md:text-neutral-500":
|
|
24
|
+
{ "text-neutral-800 font-medium": isFirst && !field.grayed },
|
|
25
|
+
{ "text-neutral-800 md:text-neutral-500": !isFirst || field.grayed },
|
|
23
26
|
{ "md:text-right": field.rightAlign },
|
|
24
27
|
{ "md:w-full md:max-w-0": field.fullWidth },
|
|
25
28
|
{ "py-2 md:py-[11.25px]": badge },
|
|
26
29
|
{ "py-2 md:py-[11.75px]": !badge },
|
|
30
|
+
{ "pl-5": isFirst && !selectable },
|
|
31
|
+
{ "pl-3": !isFirst || selectable },
|
|
32
|
+
{ "pr-5": isLast && !hasActions },
|
|
33
|
+
{ "pr-3": !isLast || hasActions },
|
|
27
34
|
{ "px-3": !field.noPadding },
|
|
28
35
|
{ "px-0": field.noPadding },
|
|
29
36
|
{ "whitespace-nowrap truncate": !freeWrap }
|
|
@@ -3,13 +3,16 @@ import type { Badge, FeedItemStatus, TableField, TableIcon } from './types.js';
|
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
field: TableField;
|
|
6
|
-
|
|
6
|
+
isFirst?: boolean | undefined;
|
|
7
|
+
isLast?: boolean | undefined;
|
|
7
8
|
badge?: Badge | null | undefined;
|
|
8
9
|
status?: FeedItemStatus | null | undefined;
|
|
9
10
|
icons?: TableIcon[] | null | undefined;
|
|
10
11
|
data?: unknown;
|
|
11
12
|
freeWrap?: boolean | undefined;
|
|
12
13
|
tag?: string | undefined;
|
|
14
|
+
selectable?: boolean | undefined;
|
|
15
|
+
hasActions?: boolean | undefined;
|
|
13
16
|
};
|
|
14
17
|
events: {
|
|
15
18
|
copied: CustomEvent<any>;
|
|
@@ -11,14 +11,16 @@ export let isFirst = false;
|
|
|
11
11
|
export let isLast = false;
|
|
12
12
|
$:
|
|
13
13
|
outerStyles = clsx({
|
|
14
|
-
"w-full": field.fullWidth
|
|
15
|
-
"rounded-tl-md": isFirst,
|
|
16
|
-
"rounded-tr-md": isLast
|
|
14
|
+
"w-full": field.fullWidth
|
|
17
15
|
});
|
|
18
16
|
$:
|
|
19
17
|
headerStyles = clsx({
|
|
20
18
|
"justify-end": field.rightAlign,
|
|
21
|
-
"hover:bg-neutral-50 focus:bg-neutral-100": field.sortable
|
|
19
|
+
"hover:bg-neutral-50 focus:bg-neutral-100": field.sortable,
|
|
20
|
+
"pl-5": isFirst,
|
|
21
|
+
"pl-3": !isFirst,
|
|
22
|
+
"pr-5": isLast,
|
|
23
|
+
"pr-3": !isLast
|
|
22
24
|
});
|
|
23
25
|
function handleSortBy(event) {
|
|
24
26
|
sortDirection = event.detail;
|
|
@@ -38,7 +40,7 @@ function handleSortBy(event) {
|
|
|
38
40
|
<BaseDropdown bind:this={sortDropdown} fullWidth>
|
|
39
41
|
<span
|
|
40
42
|
slot="trigger"
|
|
41
|
-
class="{headerStyles} w-full
|
|
43
|
+
class="{headerStyles} w-full py-3 flex items-center justify-start space-x-1 text-left text-base tracking-normal whitespace-nowrap font-normal"
|
|
42
44
|
>
|
|
43
45
|
<span>{field.headerLabel}</span>
|
|
44
46
|
{#if sortBy === field.slug}
|
package/dist/BaseTableRow.svelte
CHANGED
|
@@ -35,20 +35,28 @@ $:
|
|
|
35
35
|
}}
|
|
36
36
|
>
|
|
37
37
|
{#if selectable}
|
|
38
|
-
<td
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
<td>
|
|
39
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
40
|
+
<!-- svelte-ignore a11y-label-has-associated-control -->
|
|
41
|
+
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
|
|
42
|
+
<label class="pl-5 pr-1.5 h-[40px] flex items-center" on:click|stopPropagation>
|
|
43
|
+
<InputCheckbox
|
|
44
|
+
{checked}
|
|
45
|
+
on:change={(event) => {
|
|
46
|
+
dispatch('checked', event.detail)
|
|
47
|
+
}}
|
|
48
|
+
/>
|
|
49
|
+
</label>
|
|
45
50
|
</td>
|
|
46
51
|
{/if}
|
|
47
52
|
{#each fields as field, i (i)}
|
|
48
53
|
<BaseTableCell
|
|
49
|
-
|
|
54
|
+
isFirst={i === 0}
|
|
55
|
+
isLast={i === fields.length - 1}
|
|
50
56
|
{field}
|
|
51
57
|
{freeWrap}
|
|
58
|
+
{selectable}
|
|
59
|
+
hasActions={!!actions.length}
|
|
52
60
|
badge={field.helperBadge ? field.helperBadge(row) : null}
|
|
53
61
|
status={field.helperStatus ? field.helperStatus(row) : null}
|
|
54
62
|
icons={field.helperIcons ? field.helperIcons(row) : null}
|
|
@@ -57,7 +65,7 @@ $:
|
|
|
57
65
|
/>
|
|
58
66
|
{/each}
|
|
59
67
|
{#if actions.length}
|
|
60
|
-
<td class="pl-1 pr-
|
|
68
|
+
<td class="pl-1 pr-5">
|
|
61
69
|
<BaseTableActions
|
|
62
70
|
bind:this={actionsDropdown}
|
|
63
71
|
{actions}
|
|
@@ -17,7 +17,7 @@ function updateInput(event) {
|
|
|
17
17
|
type="checkbox"
|
|
18
18
|
{checked}
|
|
19
19
|
{indeterminate}
|
|
20
|
-
class="form-checkbox w-5 h-5 text-workspace-accent focus:text-workspace-accent rounded border border-neutral-200 focus:ring-0 focus:ring-offset-0"
|
|
20
|
+
class="form-checkbox w-5 h-5 text-workspace-accent focus:text-workspace-accent rounded border border-neutral-200 hover:border-neutral-300 focus:ring-0 focus:ring-offset-0"
|
|
21
21
|
on:change={updateInput}
|
|
22
22
|
on:click|stopPropagation
|
|
23
23
|
/>
|