@invopop/popui 0.0.108 → 0.1.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/AlertDialog.svelte +84 -59
- package/dist/AlertDialog.svelte.d.ts +5 -29
- package/dist/BaseButton.svelte +106 -101
- package/dist/BaseButton.svelte.d.ts +4 -34
- package/dist/BaseCard.svelte +20 -12
- package/dist/BaseCard.svelte.d.ts +4 -26
- package/dist/BaseCounter.svelte +13 -9
- package/dist/BaseCounter.svelte.d.ts +4 -17
- package/dist/BaseDropdown.svelte +54 -38
- package/dist/BaseDropdown.svelte.d.ts +6 -26
- package/dist/BaseFlag.svelte +6 -4
- package/dist/BaseFlag.svelte.d.ts +4 -17
- package/dist/BaseTable.svelte +226 -188
- package/dist/BaseTable.svelte.d.ts +4 -39
- package/dist/BaseTableActions.svelte +43 -33
- package/dist/BaseTableActions.svelte.d.ts +6 -21
- package/dist/BaseTableCellContent.svelte +19 -13
- package/dist/BaseTableCellContent.svelte.d.ts +4 -24
- package/dist/BaseTableCheckbox.svelte +19 -12
- package/dist/BaseTableCheckbox.svelte.d.ts +4 -21
- package/dist/BaseTableHeaderContent.svelte +30 -22
- package/dist/BaseTableHeaderContent.svelte.d.ts +4 -21
- package/dist/BaseTableHeaderOrderBy.svelte +24 -0
- package/dist/BaseTableHeaderOrderBy.svelte.d.ts +4 -0
- package/dist/BaseTableRow.svelte +78 -60
- package/dist/BaseTableRow.svelte.d.ts +4 -32
- package/dist/Breadcrumbs.svelte +14 -10
- package/dist/Breadcrumbs.svelte.d.ts +4 -19
- package/dist/ButtonFile.svelte +40 -29
- package/dist/ButtonFile.svelte.d.ts +4 -25
- package/dist/ButtonUuidCopy.svelte +27 -20
- package/dist/ButtonUuidCopy.svelte.d.ts +4 -22
- package/dist/CardCheckbox.svelte +28 -19
- package/dist/CardCheckbox.svelte.d.ts +4 -28
- package/dist/CardRelation.svelte +9 -8
- package/dist/CardRelation.svelte.d.ts +4 -22
- package/dist/CompanySelector.svelte +49 -43
- package/dist/CompanySelector.svelte.d.ts +4 -22
- package/dist/CounterWorkflow.svelte +12 -8
- package/dist/CounterWorkflow.svelte.d.ts +4 -17
- package/dist/DataListItem.svelte +24 -14
- package/dist/DataListItem.svelte.d.ts +4 -22
- package/dist/DatePicker.svelte +186 -386
- package/dist/DatePicker.svelte.d.ts +4 -22
- package/dist/DrawerContext.svelte +33 -22
- package/dist/DrawerContext.svelte.d.ts +4 -24
- package/dist/DrawerContextItem.svelte +69 -56
- package/dist/DrawerContextItem.svelte.d.ts +4 -23
- package/dist/DrawerContextSeparator.svelte +1 -1
- package/dist/DrawerContextSeparator.svelte.d.ts +22 -19
- package/dist/DrawerContextWorkspace.svelte +31 -32
- package/dist/DrawerContextWorkspace.svelte.d.ts +4 -20
- package/dist/DropdownSelect.svelte +93 -81
- package/dist/DropdownSelect.svelte.d.ts +4 -27
- package/dist/EmptyStateIcon.svelte +13 -7
- package/dist/EmptyStateIcon.svelte.d.ts +4 -22
- package/dist/EmptyStateIllustration.svelte +41 -33
- package/dist/EmptyStateIllustration.svelte.d.ts +4 -21
- package/dist/FeedEvents.svelte +5 -2
- package/dist/FeedEvents.svelte.d.ts +4 -17
- package/dist/FeedIconEvent.svelte +5 -3
- package/dist/FeedIconEvent.svelte.d.ts +4 -19
- package/dist/FeedIconStatus.svelte +23 -18
- package/dist/FeedIconStatus.svelte.d.ts +4 -17
- package/dist/FeedItem.svelte +33 -28
- package/dist/FeedItem.svelte.d.ts +4 -30
- package/dist/FeedItemDetail.svelte +21 -13
- package/dist/FeedItemDetail.svelte.d.ts +4 -23
- package/dist/FeedViewer.svelte +6 -13
- package/dist/FeedViewer.svelte.d.ts +4 -21
- package/dist/FormLayoutModal.svelte +9 -3
- package/dist/FormLayoutModal.svelte.d.ts +4 -29
- package/dist/GlobalSearch.svelte +38 -31
- package/dist/GlobalSearch.svelte.d.ts +4 -18
- package/dist/InputCheckbox.svelte +23 -14
- package/dist/InputCheckbox.svelte.d.ts +4 -23
- package/dist/InputError.svelte +4 -1
- package/dist/InputError.svelte.d.ts +4 -16
- package/dist/InputLabel.svelte +5 -3
- package/dist/InputLabel.svelte.d.ts +4 -18
- package/dist/InputRadio.svelte +25 -19
- package/dist/InputRadio.svelte.d.ts +4 -21
- package/dist/InputSearch.svelte +66 -46
- package/dist/InputSearch.svelte.d.ts +9 -32
- package/dist/InputSelect.svelte +36 -33
- package/dist/InputSelect.svelte.d.ts +4 -31
- package/dist/InputText.svelte +64 -48
- package/dist/InputText.svelte.d.ts +4 -28
- package/dist/InputTextarea.svelte +38 -29
- package/dist/InputTextarea.svelte.d.ts +4 -25
- package/dist/InputToggle.svelte +29 -22
- package/dist/InputToggle.svelte.d.ts +4 -20
- package/dist/MenuItem.svelte +99 -87
- package/dist/MenuItem.svelte.d.ts +5 -29
- package/dist/MenuItemCollapsible.svelte +26 -18
- package/dist/MenuItemCollapsible.svelte.d.ts +4 -24
- package/dist/Notification.svelte +35 -31
- package/dist/Notification.svelte.d.ts +4 -20
- package/dist/ProfileAvatar.svelte +26 -19
- package/dist/ProfileAvatar.svelte.d.ts +4 -21
- package/dist/ProfileSelector.svelte +25 -17
- package/dist/ProfileSelector.svelte.d.ts +4 -22
- package/dist/SectionLayout.svelte +6 -3
- package/dist/SectionLayout.svelte.d.ts +4 -18
- package/dist/SeparatorHorizontal.svelte +1 -1
- package/dist/SeparatorHorizontal.svelte.d.ts +22 -19
- package/dist/ShortcutWrapper.svelte +7 -1
- package/dist/ShortcutWrapper.svelte.d.ts +4 -27
- package/dist/StatusLabel.svelte +16 -12
- package/dist/StatusLabel.svelte.d.ts +4 -18
- package/dist/StepIconList.svelte +44 -41
- package/dist/StepIconList.svelte.d.ts +4 -17
- package/dist/TagBeta.svelte.d.ts +22 -19
- package/dist/TagSearch.svelte +19 -20
- package/dist/TagSearch.svelte.d.ts +4 -22
- package/dist/TagStatus.svelte +42 -37
- package/dist/TagStatus.svelte.d.ts +4 -19
- package/dist/TitleMain.svelte +9 -2
- package/dist/TitleMain.svelte.d.ts +4 -18
- package/dist/TitleSection.svelte +9 -2
- package/dist/TitleSection.svelte.d.ts +4 -18
- package/dist/UuidCopy.svelte +61 -48
- package/dist/UuidCopy.svelte.d.ts +4 -26
- package/dist/alert-dialog/alert-dialog-action.svelte +15 -15
- package/dist/alert-dialog/alert-dialog-action.svelte.d.ts +5 -26
- package/dist/alert-dialog/alert-dialog-cancel.svelte +13 -10
- package/dist/alert-dialog/alert-dialog-cancel.svelte.d.ts +3 -22
- package/dist/alert-dialog/alert-dialog-content.svelte +19 -15
- package/dist/alert-dialog/alert-dialog-content.svelte.d.ts +6 -15
- package/dist/alert-dialog/alert-dialog-description.svelte +11 -6
- package/dist/alert-dialog/alert-dialog-description.svelte.d.ts +3 -16
- package/dist/alert-dialog/alert-dialog-footer.svelte +11 -5
- package/dist/alert-dialog/alert-dialog-footer.svelte.d.ts +4 -16
- package/dist/alert-dialog/alert-dialog-header.svelte +14 -5
- package/dist/alert-dialog/alert-dialog-header.svelte.d.ts +4 -16
- package/dist/alert-dialog/alert-dialog-overlay.svelte +10 -13
- package/dist/alert-dialog/alert-dialog-overlay.svelte.d.ts +3 -14
- package/dist/alert-dialog/alert-dialog-title.svelte +11 -8
- package/dist/alert-dialog/alert-dialog-title.svelte.d.ts +3 -16
- package/dist/alert-dialog/alert-dialog-trigger.svelte +6 -0
- package/dist/alert-dialog/alert-dialog-trigger.svelte.d.ts +4 -0
- package/dist/alert-dialog/index.d.ts +3 -4
- package/dist/alert-dialog/index.js +2 -2
- package/dist/button/button.svelte +76 -18
- package/dist/button/button.svelte.d.ts +62 -14
- package/dist/button/index.d.ts +2 -60
- package/dist/button/index.js +1 -26
- package/dist/helpers.d.ts +4 -1
- package/dist/helpers.js +35 -0
- package/dist/index.d.ts +1 -3
- package/dist/index.js +0 -4
- package/dist/range-calendar/index.d.ts +20 -0
- package/dist/range-calendar/index.js +22 -0
- package/dist/range-calendar/range-calendar-caption.svelte +71 -0
- package/dist/range-calendar/range-calendar-caption.svelte.d.ts +19 -0
- package/dist/range-calendar/range-calendar-cell.svelte +18 -0
- package/dist/range-calendar/range-calendar-cell.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-day.svelte +41 -0
- package/dist/range-calendar/range-calendar-day.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-grid-row.svelte +11 -0
- package/dist/range-calendar/range-calendar-grid-row.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-grid.svelte +15 -0
- package/dist/range-calendar/range-calendar-grid.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-head-cell.svelte +18 -0
- package/dist/range-calendar/range-calendar-head-cell.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-header.svelte +18 -0
- package/dist/range-calendar/range-calendar-header.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-heading.svelte +15 -0
- package/dist/range-calendar/range-calendar-heading.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-month-select.svelte +44 -0
- package/dist/range-calendar/range-calendar-month-select.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-month.svelte +14 -0
- package/dist/range-calendar/range-calendar-month.svelte.d.ts +5 -0
- package/dist/range-calendar/range-calendar-months.svelte +18 -0
- package/dist/range-calendar/range-calendar-months.svelte.d.ts +5 -0
- package/dist/range-calendar/range-calendar-nav.svelte +18 -0
- package/dist/range-calendar/range-calendar-nav.svelte.d.ts +5 -0
- package/dist/range-calendar/range-calendar-next-button.svelte +30 -0
- package/dist/range-calendar/range-calendar-next-button.svelte.d.ts +8 -0
- package/dist/range-calendar/range-calendar-prev-button.svelte +30 -0
- package/dist/range-calendar/range-calendar-prev-button.svelte.d.ts +8 -0
- package/dist/range-calendar/range-calendar-year-select.svelte +43 -0
- package/dist/range-calendar/range-calendar-year-select.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar.svelte +109 -0
- package/dist/range-calendar/range-calendar.svelte.d.ts +21 -0
- package/dist/svg/BgPattern.svelte.d.ts +22 -19
- package/dist/svg/IconContact.svelte +6 -1
- package/dist/svg/IconContact.svelte.d.ts +5 -15
- package/dist/svg/IconEmpty.svelte.d.ts +22 -19
- package/dist/svg/IconFile.svelte +6 -1
- package/dist/svg/IconFile.svelte.d.ts +5 -15
- package/dist/svg/IconInvoice.svelte +6 -1
- package/dist/svg/IconInvoice.svelte.d.ts +5 -15
- package/dist/svg/IconNoResults.svelte +6 -1
- package/dist/svg/IconNoResults.svelte.d.ts +5 -15
- package/dist/svg/IconPdf.svelte +6 -1
- package/dist/svg/IconPdf.svelte.d.ts +5 -15
- package/dist/svg/IconProduct.svelte +6 -1
- package/dist/svg/IconProduct.svelte.d.ts +5 -15
- package/dist/table/table-body.svelte +10 -5
- package/dist/table/table-body.svelte.d.ts +4 -16
- package/dist/table/table-caption.svelte +14 -5
- package/dist/table/table-caption.svelte.d.ts +4 -16
- package/dist/table/table-cell.svelte +16 -7
- package/dist/table/table-cell.svelte.d.ts +4 -19
- package/dist/table/table-footer.svelte +14 -5
- package/dist/table/table-footer.svelte.d.ts +4 -16
- package/dist/table/table-head.svelte +11 -5
- package/dist/table/table-head.svelte.d.ts +4 -16
- package/dist/table/table-header.svelte +17 -8
- package/dist/table/table-header.svelte.d.ts +4 -19
- package/dist/table/table-row.svelte +22 -8
- package/dist/table/table-row.svelte.d.ts +4 -22
- package/dist/table/table.svelte +11 -6
- package/dist/table/table.svelte.d.ts +4 -16
- package/dist/tabs/tabs-content.svelte +13 -8
- package/dist/tabs/tabs-content.svelte.d.ts +3 -16
- package/dist/tabs/tabs-list.svelte +7 -6
- package/dist/tabs/tabs-list.svelte.d.ts +3 -16
- package/dist/tabs/tabs-trigger.svelte +13 -9
- package/dist/tabs/tabs-trigger.svelte.d.ts +3 -14
- package/dist/tabs/tabs.svelte +12 -7
- package/dist/tabs/tabs.svelte.d.ts +3 -16
- package/dist/tooltip/index.d.ts +5 -3
- package/dist/tooltip/index.js +5 -3
- package/dist/tooltip/tooltip-content.svelte +42 -23
- package/dist/tooltip/tooltip-content.svelte.d.ts +5 -15
- package/dist/tooltip/tooltip-trigger.svelte +8 -0
- package/dist/tooltip/tooltip-trigger.svelte.d.ts +4 -0
- package/dist/tw.theme.d.ts +2 -9
- package/dist/tw.theme.js +0 -5
- package/dist/types.d.ts +484 -25
- package/dist/utils.d.ts +10 -1
- package/package.json +32 -41
- package/README.md +0 -234
- package/dist/BaseTableHeaderSortBy.svelte +0 -22
- package/dist/BaseTableHeaderSortBy.svelte.d.ts +0 -20
- package/dist/ComboBox.svelte +0 -12
- package/dist/ComboBox.svelte.d.ts +0 -21
- package/dist/ComboBoxContent.svelte +0 -33
- package/dist/ComboBoxContent.svelte.d.ts +0 -20
- package/dist/ProgressBar.svelte +0 -6
- package/dist/ProgressBar.svelte.d.ts +0 -16
- package/dist/alert-dialog/alert-dialog-portal.svelte +0 -6
- package/dist/alert-dialog/alert-dialog-portal.svelte.d.ts +0 -17
- package/dist/popui.css +0 -1
- package/dist/wcdispatch.d.ts +0 -1
- package/dist/wcdispatch.js +0 -9
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { BaseTableCellContentProps } from './types'
|
|
3
|
+
import TagStatus from './TagStatus.svelte'
|
|
4
|
+
import FeedIconStatus from './FeedIconStatus.svelte'
|
|
5
|
+
import BaseFlag from './BaseFlag.svelte'
|
|
6
|
+
import { getCountryName } from './helpers.js'
|
|
7
|
+
import UuidCopy from './UuidCopy.svelte'
|
|
8
|
+
import { Icon } from '@steeze-ui/svelte-icon'
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
field,
|
|
12
|
+
data = '',
|
|
13
|
+
isMobile = false,
|
|
14
|
+
badge = null,
|
|
15
|
+
status = null,
|
|
16
|
+
icons = null,
|
|
17
|
+
onCopied
|
|
18
|
+
}: BaseTableCellContentProps = $props()
|
|
13
19
|
</script>
|
|
14
20
|
|
|
15
21
|
<div class="flex flex-col">
|
|
@@ -31,7 +37,7 @@ export let icons = null;
|
|
|
31
37
|
full
|
|
32
38
|
compact
|
|
33
39
|
dark={isMobile}
|
|
34
|
-
|
|
40
|
+
{onCopied}
|
|
35
41
|
/>
|
|
36
42
|
{:else}
|
|
37
43
|
<span class="hidden md:inline">{data}</span>
|
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
field: TableField;
|
|
6
|
-
data?: unknown;
|
|
7
|
-
isMobile?: boolean | undefined;
|
|
8
|
-
badge?: Badge | null | undefined;
|
|
9
|
-
status?: FeedItemStatus | null | undefined;
|
|
10
|
-
icons?: any[] | null | undefined;
|
|
11
|
-
};
|
|
12
|
-
events: {
|
|
13
|
-
copied: CustomEvent<any>;
|
|
14
|
-
} & {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
};
|
|
17
|
-
slots: {};
|
|
18
|
-
};
|
|
19
|
-
export type BaseTableCellContentProps = typeof __propDef.props;
|
|
20
|
-
export type BaseTableCellContentEvents = typeof __propDef.events;
|
|
21
|
-
export type BaseTableCellContentSlots = typeof __propDef.slots;
|
|
22
|
-
export default class BaseTableCellContent extends SvelteComponent<BaseTableCellContentProps, BaseTableCellContentEvents, BaseTableCellContentSlots> {
|
|
23
|
-
}
|
|
24
|
-
export {};
|
|
1
|
+
import type { BaseTableCellContentProps } from './types';
|
|
2
|
+
declare const BaseTableCellContent: import("svelte").Component<BaseTableCellContentProps, {}, "">;
|
|
3
|
+
type BaseTableCellContent = ReturnType<typeof BaseTableCellContent>;
|
|
4
|
+
export default BaseTableCellContent;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import InputCheckbox from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import InputCheckbox from './InputCheckbox.svelte'
|
|
3
|
+
import type { BaseTableCheckboxProps } from './types'
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
checkboxButton = $bindable(undefined),
|
|
7
|
+
checked = false,
|
|
8
|
+
hidden = false,
|
|
9
|
+
indeterminate = false,
|
|
10
|
+
onChecked
|
|
11
|
+
}: BaseTableCheckboxProps = $props()
|
|
12
|
+
|
|
13
|
+
function handleClick(event: MouseEvent) {
|
|
14
|
+
event.stopPropagation()
|
|
15
|
+
onChecked?.(!checked)
|
|
16
|
+
}
|
|
8
17
|
</script>
|
|
9
18
|
|
|
10
19
|
<button
|
|
@@ -12,16 +21,14 @@ export let indeterminate = false;
|
|
|
12
21
|
aria-checked={checked}
|
|
13
22
|
bind:this={checkboxButton}
|
|
14
23
|
class="absolute inset-0 h-full w-full flex items-center justify-center outline-none group cursor-default"
|
|
15
|
-
|
|
16
|
-
dispatch('checked', !checked)
|
|
17
|
-
}}
|
|
24
|
+
onclick={handleClick}
|
|
18
25
|
>
|
|
19
26
|
<div class:invisible={hidden} class="group-hover:visible">
|
|
20
27
|
<InputCheckbox
|
|
21
28
|
{checked}
|
|
22
29
|
{indeterminate}
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
onchange={(changed) => {
|
|
31
|
+
onChecked?.(changed)
|
|
25
32
|
}}
|
|
26
33
|
/>
|
|
27
34
|
</div>
|
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
checked?: boolean | undefined;
|
|
6
|
-
hidden?: boolean | undefined;
|
|
7
|
-
indeterminate?: boolean | undefined;
|
|
8
|
-
};
|
|
9
|
-
events: {
|
|
10
|
-
checked: CustomEvent<any>;
|
|
11
|
-
} & {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {};
|
|
15
|
-
};
|
|
16
|
-
export type BaseTableCheckboxProps = typeof __propDef.props;
|
|
17
|
-
export type BaseTableCheckboxEvents = typeof __propDef.events;
|
|
18
|
-
export type BaseTableCheckboxSlots = typeof __propDef.slots;
|
|
19
|
-
export default class BaseTableCheckbox extends SvelteComponent<BaseTableCheckboxProps, BaseTableCheckboxEvents, BaseTableCheckboxSlots> {
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
1
|
+
import type { BaseTableCheckboxProps } from './types';
|
|
2
|
+
declare const BaseTableCheckbox: import("svelte").Component<BaseTableCheckboxProps, {}, "checkboxButton">;
|
|
3
|
+
type BaseTableCheckbox = ReturnType<typeof BaseTableCheckbox>;
|
|
4
|
+
export default BaseTableCheckbox;
|
|
@@ -1,28 +1,34 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import clsx from 'clsx'
|
|
3
|
+
import type { BaseTableHeaderProps, TableSortBy } from './types.js'
|
|
4
|
+
import BaseDropdown from './BaseDropdown.svelte'
|
|
5
|
+
import BaseTableHeaderOrderBy from './BaseTableHeaderOrderBy.svelte'
|
|
6
|
+
|
|
7
|
+
let sortDropdown: BaseDropdown | undefined = $state()
|
|
8
|
+
|
|
9
|
+
let {
|
|
10
|
+
field,
|
|
11
|
+
sortBy = '',
|
|
12
|
+
sortDirection = $bindable(),
|
|
13
|
+
onOrderBy
|
|
14
|
+
}: BaseTableHeaderProps = $props()
|
|
15
|
+
|
|
16
|
+
let headerStyles = $derived(
|
|
17
|
+
clsx({
|
|
18
|
+
'hover:bg-neutral-50 focus:bg-neutral-100': field.sortable
|
|
19
|
+
})
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
function handleSortBy(direction: TableSortBy) {
|
|
23
|
+
onOrderBy?.(field.slug, direction)
|
|
24
|
+
sortDropdown?.toggle()
|
|
25
|
+
}
|
|
19
26
|
</script>
|
|
20
27
|
|
|
21
28
|
<span class="flex" class:justify-end={field.rightAlign}>
|
|
22
29
|
{#if field.sortable}
|
|
23
|
-
|
|
30
|
+
{#snippet trigger()}
|
|
24
31
|
<span
|
|
25
|
-
slot="trigger"
|
|
26
32
|
class="{headerStyles} w-full p-3 flex items-center justify-start space-x-1 text-left text-base tracking-normal whitespace-nowrap font-normal"
|
|
27
33
|
>
|
|
28
34
|
<span class="w-full" class:text-right={field.rightAlign}>{field.headerLabel}</span>
|
|
@@ -43,10 +49,12 @@ function handleSortBy(event) {
|
|
|
43
49
|
</svg>
|
|
44
50
|
{/if}
|
|
45
51
|
</span>
|
|
46
|
-
|
|
52
|
+
{/snippet}
|
|
53
|
+
<BaseDropdown bind:this={sortDropdown} {trigger} fullWidth>
|
|
54
|
+
<BaseTableHeaderOrderBy
|
|
47
55
|
{sortDirection}
|
|
48
56
|
isActive={sortBy === field.slug}
|
|
49
|
-
|
|
57
|
+
onOrderBy={handleSortBy}
|
|
50
58
|
/>
|
|
51
59
|
</BaseDropdown>
|
|
52
60
|
{:else}
|
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
field: TableField;
|
|
6
|
-
sortBy?: string | undefined;
|
|
7
|
-
sortDirection: TableSortBy;
|
|
8
|
-
};
|
|
9
|
-
events: {
|
|
10
|
-
orderBy: CustomEvent<any>;
|
|
11
|
-
} & {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {};
|
|
15
|
-
};
|
|
16
|
-
export type BaseTableHeaderContentProps = typeof __propDef.props;
|
|
17
|
-
export type BaseTableHeaderContentEvents = typeof __propDef.events;
|
|
18
|
-
export type BaseTableHeaderContentSlots = typeof __propDef.slots;
|
|
19
|
-
export default class BaseTableHeaderContent extends SvelteComponent<BaseTableHeaderContentProps, BaseTableHeaderContentEvents, BaseTableHeaderContentSlots> {
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
1
|
+
import type { BaseTableHeaderProps } from './types.js';
|
|
2
|
+
declare const BaseTableHeaderContent: import("svelte").Component<BaseTableHeaderProps, {}, "sortDirection">;
|
|
3
|
+
type BaseTableHeaderContent = ReturnType<typeof BaseTableHeaderContent>;
|
|
4
|
+
export default BaseTableHeaderContent;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { SortAscending, SortDescending } from '@invopop/ui-icons'
|
|
3
|
+
import type { TableSortBy, DrawerOption, BaseTableHeaderOrderByProps } from './types.js'
|
|
4
|
+
import DrawerContext from './DrawerContext.svelte'
|
|
5
|
+
|
|
6
|
+
let { isActive = false, sortDirection, onOrderBy }: BaseTableHeaderOrderByProps = $props()
|
|
7
|
+
|
|
8
|
+
let items = $derived(
|
|
9
|
+
[
|
|
10
|
+
{ icon: SortAscending, label: 'Sort Ascending', value: 'asc' },
|
|
11
|
+
{ icon: SortDescending, label: 'Sort Descending', value: 'desc' }
|
|
12
|
+
].map((o) => ({
|
|
13
|
+
...o,
|
|
14
|
+
selected: isActive && sortDirection === o.value
|
|
15
|
+
})) as DrawerOption[]
|
|
16
|
+
)
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<DrawerContext
|
|
20
|
+
{items}
|
|
21
|
+
onclick={(e) => {
|
|
22
|
+
onOrderBy?.(e as TableSortBy)
|
|
23
|
+
}}
|
|
24
|
+
/>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BaseTableHeaderOrderByProps } from './types.js';
|
|
2
|
+
declare const BaseTableHeaderOrderBy: import("svelte").Component<BaseTableHeaderOrderByProps, {}, "">;
|
|
3
|
+
type BaseTableHeaderOrderBy = ReturnType<typeof BaseTableHeaderOrderBy>;
|
|
4
|
+
export default BaseTableHeaderOrderBy;
|
package/dist/BaseTableRow.svelte
CHANGED
|
@@ -1,71 +1,89 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import BaseTableActions from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
let
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
$:
|
|
38
|
-
rowClass = clsx({
|
|
39
|
-
"cursor-pointer": !disableRowClick,
|
|
40
|
-
"!hover:bg-transparent": disableRowClick
|
|
41
|
-
});
|
|
42
|
-
$: {
|
|
43
|
-
if (selected) {
|
|
44
|
-
dataState = "selected";
|
|
45
|
-
} else if (checked) {
|
|
46
|
-
dataState = "checked";
|
|
47
|
-
} else {
|
|
48
|
-
dataState = void 0;
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import BaseTableActions from './BaseTableActions.svelte'
|
|
3
|
+
import type { BaseTableRowProps } from './types.js'
|
|
4
|
+
import { scrollIntoTableView } from './helpers.js'
|
|
5
|
+
import { TableCell, TableRow } from './table'
|
|
6
|
+
import clsx from 'clsx'
|
|
7
|
+
import BaseTableCellContent from './BaseTableCellContent.svelte'
|
|
8
|
+
import BaseTableCheckbox from './BaseTableCheckbox.svelte'
|
|
9
|
+
|
|
10
|
+
let actionsDropdown: BaseTableActions | undefined = $state()
|
|
11
|
+
let checkboxButton: HTMLButtonElement | undefined = $state()
|
|
12
|
+
let dataState: 'selected' | 'checked' | undefined = $state(undefined)
|
|
13
|
+
|
|
14
|
+
let {
|
|
15
|
+
row,
|
|
16
|
+
getActions = undefined,
|
|
17
|
+
fields = [],
|
|
18
|
+
disableRowClick = false,
|
|
19
|
+
selectable = false,
|
|
20
|
+
selected = false,
|
|
21
|
+
selectionMode = 'keyboard',
|
|
22
|
+
selectedTrackedBy = 'id',
|
|
23
|
+
selectedRows = [],
|
|
24
|
+
onclick,
|
|
25
|
+
onfocus,
|
|
26
|
+
onmouseover,
|
|
27
|
+
oncontextmenu,
|
|
28
|
+
onChecked,
|
|
29
|
+
onCopied,
|
|
30
|
+
onClickAction
|
|
31
|
+
}: BaseTableRowProps = $props()
|
|
32
|
+
|
|
33
|
+
function scrollIntoView() {
|
|
34
|
+
if (!checkboxButton) return
|
|
35
|
+
scrollIntoTableView(checkboxButton)
|
|
49
36
|
}
|
|
50
|
-
|
|
37
|
+
|
|
38
|
+
let actions = $derived(getActions instanceof Function ? getActions(row) : [])
|
|
39
|
+
let checked = $derived(
|
|
40
|
+
!!selectedRows.find((r) => {
|
|
41
|
+
const field = r[selectedTrackedBy]
|
|
42
|
+
|
|
43
|
+
if (field === undefined) return false
|
|
44
|
+
|
|
45
|
+
return field === row[selectedTrackedBy]
|
|
46
|
+
})
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
$effect(() => {
|
|
50
|
+
if (selectionMode === 'keyboard' && selected) {
|
|
51
|
+
scrollIntoView()
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
let rowClass = $derived(
|
|
55
|
+
clsx({
|
|
56
|
+
'cursor-pointer': !disableRowClick,
|
|
57
|
+
'!hover:bg-transparent': disableRowClick
|
|
58
|
+
})
|
|
59
|
+
)
|
|
60
|
+
$effect(() => {
|
|
61
|
+
if (selected) {
|
|
62
|
+
dataState = 'selected'
|
|
63
|
+
} else if (checked) {
|
|
64
|
+
dataState = 'checked'
|
|
65
|
+
} else {
|
|
66
|
+
dataState = undefined
|
|
67
|
+
}
|
|
68
|
+
})
|
|
51
69
|
</script>
|
|
52
70
|
|
|
53
71
|
<TableRow
|
|
54
72
|
data-state={dataState}
|
|
55
73
|
class={rowClass}
|
|
56
|
-
|
|
57
|
-
|
|
74
|
+
{onclick}
|
|
75
|
+
oncontextmenu={() => {
|
|
58
76
|
if (!actionsDropdown) return
|
|
59
77
|
|
|
60
78
|
actionsDropdown.toggle()
|
|
79
|
+
|
|
80
|
+
oncontextmenu?.()
|
|
61
81
|
}}
|
|
62
|
-
|
|
82
|
+
onmouseover={() => {
|
|
63
83
|
if (selectionMode === 'keyboard') return
|
|
64
|
-
|
|
65
|
-
}}
|
|
66
|
-
on:focus={() => {
|
|
67
|
-
dispatch('focus')
|
|
84
|
+
onmouseover?.()
|
|
68
85
|
}}
|
|
86
|
+
{onfocus}
|
|
69
87
|
>
|
|
70
88
|
{#if selectable}
|
|
71
89
|
<TableCell>
|
|
@@ -73,7 +91,7 @@ $: {
|
|
|
73
91
|
bind:checkboxButton
|
|
74
92
|
{checked}
|
|
75
93
|
hidden={selectedRows.length === 0}
|
|
76
|
-
|
|
94
|
+
{onChecked}
|
|
77
95
|
/>
|
|
78
96
|
</TableCell>
|
|
79
97
|
{/if}
|
|
@@ -89,7 +107,7 @@ $: {
|
|
|
89
107
|
status={field.helperStatus ? field.helperStatus(row) : null}
|
|
90
108
|
icons={field.helperIcons ? field.helperIcons(row) : null}
|
|
91
109
|
data={field.formatter ? field.formatter(row) : row[field.slug] || ''}
|
|
92
|
-
|
|
110
|
+
{onCopied}
|
|
93
111
|
/>
|
|
94
112
|
</TableCell>
|
|
95
113
|
{/each}
|
|
@@ -98,8 +116,8 @@ $: {
|
|
|
98
116
|
<BaseTableActions
|
|
99
117
|
bind:this={actionsDropdown}
|
|
100
118
|
{actions}
|
|
101
|
-
|
|
102
|
-
|
|
119
|
+
onclick={(action) => {
|
|
120
|
+
onClickAction?.({ row, action })
|
|
103
121
|
}}
|
|
104
122
|
/>
|
|
105
123
|
</TableCell>
|
|
@@ -1,32 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
row: TableDataRow;
|
|
6
|
-
getActions?: TableActionProp;
|
|
7
|
-
fields?: TableField[] | undefined;
|
|
8
|
-
disableRowClick?: boolean | undefined;
|
|
9
|
-
selectable?: boolean | undefined;
|
|
10
|
-
selected?: boolean | undefined;
|
|
11
|
-
selectionMode?: string | undefined;
|
|
12
|
-
selectedTrackedBy?: string | undefined;
|
|
13
|
-
selectedRows?: TableDataRow[] | undefined;
|
|
14
|
-
};
|
|
15
|
-
events: {
|
|
16
|
-
click: MouseEvent;
|
|
17
|
-
checked: CustomEvent<any>;
|
|
18
|
-
copied: CustomEvent<any>;
|
|
19
|
-
hover: CustomEvent<any>;
|
|
20
|
-
focus: CustomEvent<any>;
|
|
21
|
-
action: CustomEvent<any>;
|
|
22
|
-
} & {
|
|
23
|
-
[evt: string]: CustomEvent<any>;
|
|
24
|
-
};
|
|
25
|
-
slots: {};
|
|
26
|
-
};
|
|
27
|
-
export type BaseTableRowProps = typeof __propDef.props;
|
|
28
|
-
export type BaseTableRowEvents = typeof __propDef.events;
|
|
29
|
-
export type BaseTableRowSlots = typeof __propDef.slots;
|
|
30
|
-
export default class BaseTableRow extends SvelteComponent<BaseTableRowProps, BaseTableRowEvents, BaseTableRowSlots> {
|
|
31
|
-
}
|
|
32
|
-
export {};
|
|
1
|
+
import type { BaseTableRowProps } from './types.js';
|
|
2
|
+
declare const BaseTableRow: import("svelte").Component<BaseTableRowProps, {}, "">;
|
|
3
|
+
type BaseTableRow = ReturnType<typeof BaseTableRow>;
|
|
4
|
+
export default BaseTableRow;
|
package/dist/Breadcrumbs.svelte
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { BreadcrumbsProps } from './types.js'
|
|
3
|
+
import { Slash } from '@invopop/ui-icons'
|
|
4
|
+
import BaseFlag from './BaseFlag.svelte'
|
|
5
|
+
import { Icon } from '@steeze-ui/svelte-icon'
|
|
6
|
+
|
|
7
|
+
let { breadcrumbs = [], oncopied }: BreadcrumbsProps = $props()
|
|
8
|
+
|
|
9
|
+
async function handleClick(event: MouseEvent, label: string) {
|
|
10
|
+
event.stopPropagation()
|
|
11
|
+
await navigator.clipboard.writeText(label)
|
|
12
|
+
oncopied?.(label)
|
|
13
|
+
}
|
|
7
14
|
</script>
|
|
8
15
|
|
|
9
16
|
<ul class="flex items-center justify-start text-neutral-800">
|
|
@@ -16,10 +23,7 @@ const dispatch = createEventDispatcher();
|
|
|
16
23
|
{:else if breadcrumb.copiable}
|
|
17
24
|
<button
|
|
18
25
|
class={i < breadcrumbs.length - 1 ? 'text-neutral-400' : 'font-medium'}
|
|
19
|
-
|
|
20
|
-
await navigator.clipboard.writeText(breadcrumb.label)
|
|
21
|
-
dispatch('copied', breadcrumb.label)
|
|
22
|
-
}}
|
|
26
|
+
onclick={(e) => handleClick(e, breadcrumb.label)}
|
|
23
27
|
>
|
|
24
28
|
{breadcrumb.label}
|
|
25
29
|
</button>
|
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
breadcrumbs?: Breadcrumb[] | undefined;
|
|
6
|
-
};
|
|
7
|
-
events: {
|
|
8
|
-
copied: CustomEvent<any>;
|
|
9
|
-
} & {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {};
|
|
13
|
-
};
|
|
14
|
-
export type BreadcrumbsProps = typeof __propDef.props;
|
|
15
|
-
export type BreadcrumbsEvents = typeof __propDef.events;
|
|
16
|
-
export type BreadcrumbsSlots = typeof __propDef.slots;
|
|
17
|
-
export default class Breadcrumbs extends SvelteComponent<BreadcrumbsProps, BreadcrumbsEvents, BreadcrumbsSlots> {
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
1
|
+
import type { BreadcrumbsProps } from './types.js';
|
|
2
|
+
declare const Breadcrumbs: import("svelte").Component<BreadcrumbsProps, {}, "">;
|
|
3
|
+
type Breadcrumbs = ReturnType<typeof Breadcrumbs>;
|
|
4
|
+
export default Breadcrumbs;
|
package/dist/ButtonFile.svelte
CHANGED
|
@@ -1,35 +1,46 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import { Icon } from
|
|
3
|
-
import { Invoice, Download } from
|
|
4
|
-
import BaseButton from
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Icon } from '@steeze-ui/svelte-icon'
|
|
3
|
+
import { Invoice, Download } from '@invopop/ui-icons'
|
|
4
|
+
import BaseButton from './BaseButton.svelte'
|
|
5
|
+
import type { ButtonFileProps } from './types.js'
|
|
6
|
+
import clsx from 'clsx'
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
icon = Invoice,
|
|
10
|
+
name = '',
|
|
11
|
+
disabled = false,
|
|
12
|
+
date = '',
|
|
13
|
+
iconColor = 'grey',
|
|
14
|
+
onPreview,
|
|
15
|
+
onDownload,
|
|
16
|
+
...rest
|
|
17
|
+
}: ButtonFileProps = $props()
|
|
18
|
+
|
|
19
|
+
let iconStyles = $derived(
|
|
20
|
+
clsx({
|
|
21
|
+
'border-positive-100 bg-positive-50 text-positive-500': iconColor === 'green',
|
|
22
|
+
'border-yellow-100 bg-yellow-50 text-yellow-500': iconColor === 'yellow',
|
|
23
|
+
'border-red-100 bg-red-50 text-red-500': iconColor === 'red',
|
|
24
|
+
'border-warning-100 bg-warning-50 text-warning-500': iconColor === 'orange',
|
|
25
|
+
'border-blue-100 bg-blue-50 text-blue-500': iconColor === 'blue',
|
|
26
|
+
'border-purple-100 bg-purple-50 text-purple-500': iconColor === 'purple',
|
|
27
|
+
'border-dashed border-neutral-100 text-neutral-400': iconColor === 'empty',
|
|
28
|
+
'border-neutral-100 bg-neutral-50 text-neutral-500': iconColor === 'grey'
|
|
29
|
+
})
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
function handleClick(event: MouseEvent) {
|
|
33
|
+
event.stopPropagation()
|
|
34
|
+
onPreview?.()
|
|
35
|
+
}
|
|
23
36
|
</script>
|
|
24
37
|
|
|
25
38
|
<button
|
|
26
39
|
class:opacity-40={disabled}
|
|
27
|
-
class="border border-neutral-100 hover:bg-neutral-50 active:bg-neutral-100 hover:border-neutral-200 active:border-neutral-300 rounded-lg flex items-center space-x-3 py-1.5 pr-3 pl-2.5 w-full"
|
|
40
|
+
class="border border-neutral-100 hover:bg-neutral-50 active:bg-neutral-100 hover:border-neutral-200 active:border-neutral-300 rounded-lg flex items-center space-x-3 py-1.5 pr-3 pl-2.5 w-full cursor-pointer"
|
|
28
41
|
{disabled}
|
|
29
|
-
{
|
|
30
|
-
|
|
31
|
-
dispatch('preview')
|
|
32
|
-
}}
|
|
42
|
+
{...rest}
|
|
43
|
+
onclick={handleClick}
|
|
33
44
|
>
|
|
34
45
|
<span class="flex items-center justify-start space-x-2.5 flex-1">
|
|
35
46
|
<div class="{iconStyles} p-2 border rounded">
|
|
@@ -45,8 +56,8 @@ $:
|
|
|
45
56
|
<BaseButton
|
|
46
57
|
{disabled}
|
|
47
58
|
icon={Download}
|
|
48
|
-
|
|
49
|
-
|
|
59
|
+
onclick={() => {
|
|
60
|
+
onDownload?.()
|
|
50
61
|
}}
|
|
51
62
|
/>
|
|
52
63
|
</button>
|