@invopop/popui 0.1.4-beta.43 → 0.1.4-beta.45
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/DatePicker.svelte +15 -2
- package/dist/DatePicker.svelte.d.ts +5 -1
- package/dist/data-table/column-definitions.js +3 -3
- package/dist/data-table/data-table-toolbar.svelte +1 -1
- package/dist/data-table/data-table.svelte +5 -4
- package/dist/data-table/table-styles.js +1 -1
- package/dist/table/table-head.svelte +1 -1
- package/dist/table/table-header.svelte +1 -1
- package/dist/tailwind.theme.css +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/DatePicker.svelte
CHANGED
|
@@ -120,7 +120,8 @@
|
|
|
120
120
|
stackLeft = false,
|
|
121
121
|
stackRight = false,
|
|
122
122
|
icon = undefined,
|
|
123
|
-
iconTheme = 'default'
|
|
123
|
+
iconTheme = 'default',
|
|
124
|
+
isOpen = $bindable(false)
|
|
124
125
|
}: DatePickerProps = $props()
|
|
125
126
|
|
|
126
127
|
const [floatingRef, floatingContent] = createFloatingActions({
|
|
@@ -140,7 +141,6 @@
|
|
|
140
141
|
start: undefined,
|
|
141
142
|
end: undefined
|
|
142
143
|
})
|
|
143
|
-
let isOpen = $state(false)
|
|
144
144
|
let selectedLabel = $state(label)
|
|
145
145
|
let isStacked = $derived(stackLeft || stackRight)
|
|
146
146
|
let hasSelectedDates = $derived(value.start !== undefined)
|
|
@@ -219,6 +219,19 @@
|
|
|
219
219
|
|
|
220
220
|
onSelect?.({ from: value.start?.toString() || '', to: value.end?.toString() || '' })
|
|
221
221
|
}
|
|
222
|
+
|
|
223
|
+
// Exposed methods
|
|
224
|
+
export function open() {
|
|
225
|
+
isOpen = true
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export function close() {
|
|
229
|
+
isOpen = false
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export function toggle() {
|
|
233
|
+
isOpen = !isOpen
|
|
234
|
+
}
|
|
222
235
|
</script>
|
|
223
236
|
|
|
224
237
|
<div>
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { DatePickerProps } from './types';
|
|
2
|
-
declare const DatePicker: import("svelte").Component<DatePickerProps, {
|
|
2
|
+
declare const DatePicker: import("svelte").Component<DatePickerProps, {
|
|
3
|
+
open: () => void;
|
|
4
|
+
close: () => void;
|
|
5
|
+
toggle: () => void;
|
|
6
|
+
}, "isOpen">;
|
|
3
7
|
type DatePicker = ReturnType<typeof DatePicker>;
|
|
4
8
|
export default DatePicker;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
let { table, filters, frozenColumns, onFreezeColumn, disabled = false }: { table: Table<TData>; filters?: Snippet; frozenColumns: Set<string>; onFreezeColumn: (columnId: string) => void; disabled?: boolean } = $props()
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
|
-
<div class={clsx('flex items-center justify-between px-4 py-
|
|
10
|
+
<div class={clsx('flex items-center justify-between px-4 py-2.5', {
|
|
11
11
|
'pointer-events-none opacity-30': disabled
|
|
12
12
|
})}>
|
|
13
13
|
{#if filters}
|
|
@@ -393,7 +393,7 @@
|
|
|
393
393
|
})}
|
|
394
394
|
<div
|
|
395
395
|
class={cn(
|
|
396
|
-
'absolute inset-0 flex items-center bg-background group-hover/row:bg-background-default-secondary group-data-[state=selected]/row:bg-background-selected group-data-[state=selected]/row:group-hover/row:bg-background-selected group-data-[state=error]/row:bg-background-critical group-data-[state=error]/row:group-hover/row:bg-background-critical group-data-[state=success]/row:bg-background-selected group-data-[state=success]/row:group-hover/row:bg-background-selected group-data-[focused=true]/row:bg-background-default-secondary px-3',
|
|
396
|
+
'absolute inset-0 flex items-center bg-background group-hover/row:bg-background-default-secondary group-data-[state=selected]/row:bg-background-selected group-data-[state=selected]/row:group-hover/row:bg-background-selected group-data-[state=error]/row:bg-background-critical group-data-[state=error]/row:group-hover/row:bg-background-critical group-data-[state=success]/row:bg-background-selected group-data-[state=success]/row:group-hover/row:bg-background-selected group-data-[focused=true]/row:bg-background-default-secondary px-3 shadow-[inset_0_-1px_0_0_var(--color-border)]',
|
|
397
397
|
align === 'right' ? 'justify-end' : '',
|
|
398
398
|
{ 'pl-4': isFirst, 'pr-4': isLast, 'border-r border-border': isFrozen && isLastFrozen }
|
|
399
399
|
)}
|
|
@@ -600,13 +600,14 @@
|
|
|
600
600
|
data-state={dataState}
|
|
601
601
|
data-row-index={rowIndex}
|
|
602
602
|
data-focused={focusedRowIndex === rowIndex ? 'true' : undefined}
|
|
603
|
-
class={cn(clsx('
|
|
603
|
+
class={cn(clsx('shadow-[inset_0_-1px_0_0_var(--color-border)]', {
|
|
604
604
|
'cursor-pointer': onRowClick
|
|
605
605
|
}), getRowClassName?.(row.original as TData))}
|
|
606
606
|
onclick={() => onRowClick?.(row.original as TData)}
|
|
607
607
|
>
|
|
608
608
|
{#each row.getVisibleCells() as cell, index (cell.id)}
|
|
609
609
|
{@const visibleCells = row.getVisibleCells()}
|
|
610
|
+
{@const allCells = row.getAllCells()}
|
|
610
611
|
{@const isLastScrollable = index === visibleCells.length - 2}
|
|
611
612
|
{@const firstDataColumnIndex = visibleCells.findIndex(
|
|
612
613
|
(c) => c.column.id !== 'select' && c.column.id !== 'actions'
|
|
@@ -615,9 +616,9 @@
|
|
|
615
616
|
{@const isFirstCell = index === 0}
|
|
616
617
|
{@const isLastCell = index === visibleCells.length - 1}
|
|
617
618
|
{@const isFrozen = frozenColumns.has(cell.column.id)}
|
|
618
|
-
{@const lastFrozenColumnId =
|
|
619
|
+
{@const lastFrozenColumnId = allCells.map(c => c.column).reverse().find(col => frozenColumns.has(col.id))?.id}
|
|
619
620
|
{@const isLastFrozen = isFrozen && cell.column.id === lastFrozenColumnId}
|
|
620
|
-
{@const frozenOffset = isFrozen ? calculateFrozenOffset(cell.column.id,
|
|
621
|
+
{@const frozenOffset = isFrozen ? calculateFrozenOffset(cell.column.id, allCells.map(c => c.column)) : 0}
|
|
621
622
|
<Table.Cell
|
|
622
623
|
style={getCellStyle(cell, isLastScrollable, isFrozen, frozenOffset)}
|
|
623
624
|
class={getCellClasses(
|
|
@@ -24,7 +24,7 @@ export function getHeaderClasses(header, isLastScrollable, isFirstHeader = false
|
|
|
24
24
|
return clsx('relative whitespace-nowrap overflow-hidden before:content-[""] before:absolute before:inset-x-0 before:top-0 before:h-px before:bg-border', {
|
|
25
25
|
'sticky right-0 text-right bg-background before:z-20': header.id === 'actions',
|
|
26
26
|
'sticky left-0 bg-background z-10 before:z-20': header.id === 'select' || isFrozen,
|
|
27
|
-
'after:content-[""] after:absolute after:right-0 after:top-1/2 after:-translate-y-1/2 after:h-4 after:w-px after:bg-background-default-tertiary after:z-20': isResizable && (header.id !== 'actions' && header.id !== 'select'),
|
|
27
|
+
'after:content-[""] after:absolute after:right-0 after:top-1/2 after:-translate-y-1/2 after:h-4 after:w-px after:bg-background-default-tertiary after:z-20': isResizable && (header.id !== 'actions' && header.id !== 'select') && !isLastFrozen,
|
|
28
28
|
'w-full': isLastScrollable,
|
|
29
29
|
'!pr-4': isLastHeader && !isSticky,
|
|
30
30
|
'px-3': isSticky,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
bind:this={ref}
|
|
14
14
|
data-slot="table-head"
|
|
15
15
|
class={cn(
|
|
16
|
-
'text-foreground-default-secondary text-base font-normal text-left align-middle [&:has([role=checkbox])]:p-0 [&:has(button)]:p-0 px-3 bg-background',
|
|
16
|
+
'text-foreground-default-secondary text-base font-normal text-left align-middle [&:has([role=checkbox])]:p-0 [&:has(button)]:p-0 px-3 bg-background shadow-[inset_0_-1px_0_0_var(--color-border)]',
|
|
17
17
|
className
|
|
18
18
|
)}
|
|
19
19
|
{...restProps}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<thead
|
|
16
16
|
bind:this={ref}
|
|
17
17
|
data-slot="table-header"
|
|
18
|
-
class={cn('sticky top-0 z-20
|
|
18
|
+
class={cn('sticky top-0 z-20 bg-background', className)}
|
|
19
19
|
onclick={bubble('click')}
|
|
20
20
|
onkeydown={bubble('keydown')}
|
|
21
21
|
>
|
package/dist/tailwind.theme.css
CHANGED
|
@@ -621,7 +621,7 @@
|
|
|
621
621
|
--color-background-warning-bold: var(--color-warning-60);
|
|
622
622
|
--color-background-warning-inverse: var(--color-warning-50);
|
|
623
623
|
|
|
624
|
-
--color-background-critical-default: var(--color-critical-alpha-
|
|
624
|
+
--color-background-critical-default: var(--color-critical-alpha-5);
|
|
625
625
|
--color-background-critical-bold: var(--color-critical-50);
|
|
626
626
|
--color-background-critical-inverse: var(--color-critical-40);
|
|
627
627
|
|
package/dist/types.d.ts
CHANGED