@invopop/popui 0.0.1
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/README.md +146 -0
- package/dist/BaseButton.svelte +107 -0
- package/dist/BaseButton.svelte.d.ts +33 -0
- package/dist/BaseCard.svelte +50 -0
- package/dist/BaseCard.svelte.d.ts +25 -0
- package/dist/BaseCounter.svelte +16 -0
- package/dist/BaseCounter.svelte.d.ts +17 -0
- package/dist/BaseDropdown.svelte +46 -0
- package/dist/BaseDropdown.svelte.d.ts +24 -0
- package/dist/BaseFlag.svelte +14 -0
- package/dist/BaseFlag.svelte.d.ts +17 -0
- package/dist/BaseTable.svelte +148 -0
- package/dist/BaseTable.svelte.d.ts +33 -0
- package/dist/BaseTableActions.svelte +31 -0
- package/dist/BaseTableActions.svelte.d.ts +21 -0
- package/dist/BaseTableCell.svelte +90 -0
- package/dist/BaseTableCell.svelte.d.ts +26 -0
- package/dist/BaseTableHeader.svelte +75 -0
- package/dist/BaseTableHeader.svelte.d.ts +23 -0
- package/dist/BaseTableHeaderSortBy.svelte +22 -0
- package/dist/BaseTableHeaderSortBy.svelte.d.ts +20 -0
- package/dist/BaseTableRow.svelte +48 -0
- package/dist/BaseTableRow.svelte.d.ts +25 -0
- package/dist/ButtonFile.svelte +51 -0
- package/dist/ButtonFile.svelte.d.ts +25 -0
- package/dist/CardRelation.svelte +29 -0
- package/dist/CardRelation.svelte.d.ts +22 -0
- package/dist/CompanySelector.svelte +74 -0
- package/dist/CompanySelector.svelte.d.ts +23 -0
- package/dist/CounterWorkflow.svelte +15 -0
- package/dist/CounterWorkflow.svelte.d.ts +17 -0
- package/dist/DataListItem.svelte +22 -0
- package/dist/DataListItem.svelte.d.ts +22 -0
- package/dist/DatePicker.svelte +431 -0
- package/dist/DatePicker.svelte.d.ts +22 -0
- package/dist/DrawerContext.svelte +48 -0
- package/dist/DrawerContext.svelte.d.ts +23 -0
- package/dist/DrawerContextItem.svelte +93 -0
- package/dist/DrawerContextItem.svelte.d.ts +23 -0
- package/dist/DrawerContextWorkspace.svelte +40 -0
- package/dist/DrawerContextWorkspace.svelte.d.ts +20 -0
- package/dist/DropdownSelect.svelte +78 -0
- package/dist/DropdownSelect.svelte.d.ts +26 -0
- package/dist/EmptyStateIcon.svelte +46 -0
- package/dist/EmptyStateIcon.svelte.d.ts +22 -0
- package/dist/EmptyStateIllustration.svelte +58 -0
- package/dist/EmptyStateIllustration.svelte.d.ts +21 -0
- package/dist/FeedEvents.svelte +26 -0
- package/dist/FeedEvents.svelte.d.ts +17 -0
- package/dist/FeedIconEvent.svelte +10 -0
- package/dist/FeedIconEvent.svelte.d.ts +19 -0
- package/dist/FeedIconStatus.svelte +26 -0
- package/dist/FeedIconStatus.svelte.d.ts +17 -0
- package/dist/FeedItem.svelte +87 -0
- package/dist/FeedItem.svelte.d.ts +30 -0
- package/dist/FeedItemDetail.svelte +56 -0
- package/dist/FeedItemDetail.svelte.d.ts +23 -0
- package/dist/FeedViewer.svelte +19 -0
- package/dist/FeedViewer.svelte.d.ts +21 -0
- package/dist/FormLayoutModal.svelte +8 -0
- package/dist/FormLayoutModal.svelte.d.ts +29 -0
- package/dist/GlobalSearch.svelte +47 -0
- package/dist/GlobalSearch.svelte.d.ts +18 -0
- package/dist/InputCheckbox.svelte +20 -0
- package/dist/InputCheckbox.svelte.d.ts +18 -0
- package/dist/InputError.svelte +14 -0
- package/dist/InputError.svelte.d.ts +16 -0
- package/dist/InputLabel.svelte +5 -0
- package/dist/InputLabel.svelte.d.ts +17 -0
- package/dist/InputRadio.svelte +27 -0
- package/dist/InputRadio.svelte.d.ts +19 -0
- package/dist/InputSearch.svelte +69 -0
- package/dist/InputSearch.svelte.d.ts +32 -0
- package/dist/InputSelect.svelte +75 -0
- package/dist/InputSelect.svelte.d.ts +30 -0
- package/dist/InputText.svelte +63 -0
- package/dist/InputText.svelte.d.ts +26 -0
- package/dist/InputTextarea.svelte +42 -0
- package/dist/InputTextarea.svelte.d.ts +24 -0
- package/dist/InputToggle.svelte +33 -0
- package/dist/InputToggle.svelte.d.ts +18 -0
- package/dist/MenuItem.svelte +141 -0
- package/dist/MenuItem.svelte.d.ts +29 -0
- package/dist/ProfileAvatar.svelte +39 -0
- package/dist/ProfileAvatar.svelte.d.ts +21 -0
- package/dist/ProfileSelector.svelte +20 -0
- package/dist/ProfileSelector.svelte.d.ts +20 -0
- package/dist/SectionLayout.svelte +10 -0
- package/dist/SectionLayout.svelte.d.ts +18 -0
- package/dist/SeparatorHorizontal.svelte +14 -0
- package/dist/SeparatorHorizontal.svelte.d.ts +23 -0
- package/dist/ShortcutWrapper.svelte +6 -0
- package/dist/ShortcutWrapper.svelte.d.ts +27 -0
- package/dist/StatusLabel.svelte +20 -0
- package/dist/StatusLabel.svelte.d.ts +18 -0
- package/dist/Tabs.svelte +41 -0
- package/dist/Tabs.svelte.d.ts +20 -0
- package/dist/TagBeta.svelte +23 -0
- package/dist/TagBeta.svelte.d.ts +23 -0
- package/dist/TagSearch.svelte +46 -0
- package/dist/TagSearch.svelte.d.ts +22 -0
- package/dist/TagStatus.svelte +46 -0
- package/dist/TagStatus.svelte.d.ts +19 -0
- package/dist/TitleMain.svelte +6 -0
- package/dist/TitleMain.svelte.d.ts +18 -0
- package/dist/TitleSection.svelte +6 -0
- package/dist/TitleSection.svelte.d.ts +18 -0
- package/dist/UuidCopy.svelte +55 -0
- package/dist/UuidCopy.svelte.d.ts +26 -0
- package/dist/clickOutside.d.ts +4 -0
- package/dist/clickOutside.js +18 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/helpers.d.ts +6 -0
- package/dist/helpers.js +35 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.js +101 -0
- package/dist/popui.css +1 -0
- package/dist/svg/BgPattern.svelte +20 -0
- package/dist/svg/BgPattern.svelte.d.ts +23 -0
- package/dist/svg/IconContact.svelte +114 -0
- package/dist/svg/IconContact.svelte.d.ts +16 -0
- package/dist/svg/IconEmpty.svelte +138 -0
- package/dist/svg/IconEmpty.svelte.d.ts +23 -0
- package/dist/svg/IconFile.svelte +91 -0
- package/dist/svg/IconFile.svelte.d.ts +16 -0
- package/dist/svg/IconInvoice.svelte +97 -0
- package/dist/svg/IconInvoice.svelte.d.ts +16 -0
- package/dist/svg/IconNoResults.svelte +83 -0
- package/dist/svg/IconNoResults.svelte.d.ts +16 -0
- package/dist/svg/IconPdf.svelte +93 -0
- package/dist/svg/IconPdf.svelte.d.ts +16 -0
- package/dist/svg/IconProduct.svelte +105 -0
- package/dist/svg/IconProduct.svelte.d.ts +16 -0
- package/dist/tw.theme.d.ts +135 -0
- package/dist/tw.theme.js +152 -0
- package/dist/types.d.ts +128 -0
- package/dist/types.js +1 -0
- package/dist/wcdispatch.d.ts +1 -0
- package/dist/wcdispatch.js +9 -0
- package/package.json +102 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { TableActionProp, TableDataRow, TableField, TableGroupLabelProp, TableSortBy } from './types.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
sortBy?: string | undefined;
|
|
6
|
+
sortDirection?: TableSortBy | undefined;
|
|
7
|
+
fields?: TableField[] | undefined;
|
|
8
|
+
data?: TableDataRow[] | undefined;
|
|
9
|
+
getActions?: TableActionProp;
|
|
10
|
+
groupLabel?: TableGroupLabelProp;
|
|
11
|
+
disableRowClick?: boolean | undefined;
|
|
12
|
+
hideCounter?: boolean | undefined;
|
|
13
|
+
freeWrap?: boolean | undefined;
|
|
14
|
+
};
|
|
15
|
+
events: {
|
|
16
|
+
orderBy: CustomEvent<any>;
|
|
17
|
+
action: CustomEvent<any>;
|
|
18
|
+
copied: CustomEvent<any>;
|
|
19
|
+
rowNewTabClick: CustomEvent<any>;
|
|
20
|
+
rowClick: CustomEvent<any>;
|
|
21
|
+
rowRightClick: CustomEvent<any>;
|
|
22
|
+
tableEndReached: CustomEvent<any>;
|
|
23
|
+
} & {
|
|
24
|
+
[evt: string]: CustomEvent<any>;
|
|
25
|
+
};
|
|
26
|
+
slots: {};
|
|
27
|
+
};
|
|
28
|
+
export type BaseTableProps = typeof __propDef.props;
|
|
29
|
+
export type BaseTableEvents = typeof __propDef.events;
|
|
30
|
+
export type BaseTableSlots = typeof __propDef.slots;
|
|
31
|
+
export default class BaseTable extends SvelteComponent<BaseTableProps, BaseTableEvents, BaseTableSlots> {
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script>import { Icon } from "@steeze-ui/svelte-icon";
|
|
2
|
+
import BaseDropdown from "./BaseDropdown.svelte";
|
|
3
|
+
import { createEventDispatcher } from "svelte";
|
|
4
|
+
import DrawerContext from "./DrawerContext.svelte";
|
|
5
|
+
import { Options } from "@invopop/ui-icons";
|
|
6
|
+
const dispatch = createEventDispatcher();
|
|
7
|
+
export let actions;
|
|
8
|
+
let actionDropdown;
|
|
9
|
+
$:
|
|
10
|
+
items = actions.map((a) => ({
|
|
11
|
+
label: a.label,
|
|
12
|
+
value: a,
|
|
13
|
+
icon: a.icon,
|
|
14
|
+
footer: a.footer,
|
|
15
|
+
destructive: a.destructive
|
|
16
|
+
}));
|
|
17
|
+
export const toggle = () => {
|
|
18
|
+
actionDropdown.toggle();
|
|
19
|
+
};
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<BaseDropdown bind:this={actionDropdown}>
|
|
23
|
+
<Icon slot="trigger" src={Options} class="w-4 mt-1 text-neutral-500" />
|
|
24
|
+
<DrawerContext
|
|
25
|
+
{items}
|
|
26
|
+
on:click={(e) => {
|
|
27
|
+
dispatch('clickAction', e.detail)
|
|
28
|
+
actionDropdown.toggle()
|
|
29
|
+
}}
|
|
30
|
+
/>
|
|
31
|
+
</BaseDropdown>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { TableAction } from './types.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
actions: TableAction[];
|
|
6
|
+
toggle?: (() => void) | undefined;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
clickAction: CustomEvent<any>;
|
|
10
|
+
} & {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {};
|
|
14
|
+
};
|
|
15
|
+
export type BaseTableActionsProps = typeof __propDef.props;
|
|
16
|
+
export type BaseTableActionsEvents = typeof __propDef.events;
|
|
17
|
+
export type BaseTableActionsSlots = typeof __propDef.slots;
|
|
18
|
+
export default class BaseTableActions extends SvelteComponent<BaseTableActionsProps, BaseTableActionsEvents, BaseTableActionsSlots> {
|
|
19
|
+
get toggle(): () => void;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<script>import Viewport from "svelte-viewport-info";
|
|
2
|
+
import clsx from "clsx";
|
|
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
|
+
export let field;
|
|
10
|
+
export let currentIndex;
|
|
11
|
+
export let badge = null;
|
|
12
|
+
export let status = null;
|
|
13
|
+
export let icons = null;
|
|
14
|
+
export let data = "";
|
|
15
|
+
export let freeWrap = false;
|
|
16
|
+
export let tag = "td";
|
|
17
|
+
$:
|
|
18
|
+
cellStyles = clsx(
|
|
19
|
+
{ "tabular-nums slashed-zero lining-nums": field.monospacedNums },
|
|
20
|
+
{ "font-mono": field.monospaced },
|
|
21
|
+
{ "text-neutral-800 font-medium": currentIndex === 0 && !field.grayed },
|
|
22
|
+
{ "text-neutral-800 md:text-neutral-500": currentIndex > 0 || field.grayed },
|
|
23
|
+
{ "md:text-right": field.rightAlign },
|
|
24
|
+
{ "md:w-full md:max-w-0": field.fullWidth },
|
|
25
|
+
{ "py-2 md:py-[11.25px]": badge },
|
|
26
|
+
{ "py-2 md:py-[11.75px]": !badge },
|
|
27
|
+
{ "px-3": !field.noPadding },
|
|
28
|
+
{ "px-0": field.noPadding },
|
|
29
|
+
{ "whitespace-nowrap truncate": !freeWrap }
|
|
30
|
+
);
|
|
31
|
+
$:
|
|
32
|
+
isMobile = Viewport.Width < 769;
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<svelte:element
|
|
36
|
+
this={tag}
|
|
37
|
+
class="{cellStyles} text-base tracking-normal"
|
|
38
|
+
style:min-width={field.width}
|
|
39
|
+
style:max-width={isMobile ? `${Viewport.Width}px` : field.width}
|
|
40
|
+
>
|
|
41
|
+
<div class="flex flex-col">
|
|
42
|
+
<span class="md:hidden text-sm text-neutral-600 font-normal">
|
|
43
|
+
{field.headerLabel}
|
|
44
|
+
</span>
|
|
45
|
+
<span class="flex items-center" class:justify-end={field.rightAlign}>
|
|
46
|
+
{#if field.isCountry && data}
|
|
47
|
+
<span class="flex items-center space-x-1">
|
|
48
|
+
<BaseFlag country={String(data)} width={16} />
|
|
49
|
+
<span>{getCountryName(String(data))}</span>
|
|
50
|
+
</span>
|
|
51
|
+
{:else if field.copy && data}
|
|
52
|
+
<UuidCopy
|
|
53
|
+
rightAlign={isMobile ? false : field.rightAlign}
|
|
54
|
+
uuid={String(data)}
|
|
55
|
+
prefixLength={4}
|
|
56
|
+
suffixLength={4}
|
|
57
|
+
compact
|
|
58
|
+
dark={isMobile}
|
|
59
|
+
on:copied
|
|
60
|
+
/>
|
|
61
|
+
{:else}
|
|
62
|
+
<span class="hidden md:inline">{data}</span>
|
|
63
|
+
<span class="md:hidden">{data ? data : badge || status ? '' : '-'}</span>
|
|
64
|
+
{/if}
|
|
65
|
+
{#if badge}
|
|
66
|
+
<span class:ml-2={!!data}>
|
|
67
|
+
<TagStatus label={badge.label} status={badge.status} dot={Boolean(badge.dot)} />
|
|
68
|
+
</span>
|
|
69
|
+
{/if}
|
|
70
|
+
{#if status}
|
|
71
|
+
<span class:ml-2={!!data}>
|
|
72
|
+
<FeedIconStatus {status} />
|
|
73
|
+
</span>
|
|
74
|
+
{/if}
|
|
75
|
+
{#if icons}
|
|
76
|
+
<span class:ml-2={!!data} class="flex items-center gap-1 flex-shrink-0">
|
|
77
|
+
{#each icons as icon}
|
|
78
|
+
<div class="border border-neutral-200 rounded-md p-px">
|
|
79
|
+
{#if typeof icon === 'string'}
|
|
80
|
+
<img alt="icon" src={icon} class="h-4 w-4" />
|
|
81
|
+
{:else}
|
|
82
|
+
<Icon src={icon} class="h-4 w-4" />
|
|
83
|
+
{/if}
|
|
84
|
+
</div>
|
|
85
|
+
{/each}
|
|
86
|
+
</span>
|
|
87
|
+
{/if}
|
|
88
|
+
</span>
|
|
89
|
+
</div>
|
|
90
|
+
</svelte:element>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { Badge, FeedItemStatus, TableField, TableIcon } from './types.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
field: TableField;
|
|
6
|
+
currentIndex: number;
|
|
7
|
+
badge?: Badge | null | undefined;
|
|
8
|
+
status?: FeedItemStatus | null | undefined;
|
|
9
|
+
icons?: TableIcon[] | null | undefined;
|
|
10
|
+
data?: unknown;
|
|
11
|
+
freeWrap?: boolean | undefined;
|
|
12
|
+
tag?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
events: {
|
|
15
|
+
copied: CustomEvent<any>;
|
|
16
|
+
} & {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
};
|
|
19
|
+
slots: {};
|
|
20
|
+
};
|
|
21
|
+
export type BaseTableCellProps = typeof __propDef.props;
|
|
22
|
+
export type BaseTableCellEvents = typeof __propDef.events;
|
|
23
|
+
export type BaseTableCellSlots = typeof __propDef.slots;
|
|
24
|
+
export default class BaseTableCell extends SvelteComponent<BaseTableCellProps, BaseTableCellEvents, BaseTableCellSlots> {
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<script>import clsx from "clsx";
|
|
2
|
+
import { createEventDispatcher } from "svelte";
|
|
3
|
+
import BaseDropdown from "./BaseDropdown.svelte";
|
|
4
|
+
import BaseTableHeaderSortBy from "./BaseTableHeaderSortBy.svelte";
|
|
5
|
+
const dispatch = createEventDispatcher();
|
|
6
|
+
let sortDropdown;
|
|
7
|
+
export let field;
|
|
8
|
+
export let sortBy = "";
|
|
9
|
+
export let sortDirection;
|
|
10
|
+
export let isFirst = false;
|
|
11
|
+
export let isLast = false;
|
|
12
|
+
$:
|
|
13
|
+
outerStyles = clsx({
|
|
14
|
+
"w-full": field.fullWidth,
|
|
15
|
+
"rounded-tl-md": isFirst,
|
|
16
|
+
"rounded-tr-md": isLast
|
|
17
|
+
});
|
|
18
|
+
$:
|
|
19
|
+
headerStyles = clsx({
|
|
20
|
+
"justify-end": field.rightAlign,
|
|
21
|
+
"hover:bg-neutral-50 focus:bg-neutral-100": field.sortable
|
|
22
|
+
});
|
|
23
|
+
function handleSortBy(event) {
|
|
24
|
+
sortDirection = event.detail;
|
|
25
|
+
dispatch("orderBy", { field: field.slug, direction: sortDirection });
|
|
26
|
+
sortDropdown.toggle();
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<th
|
|
31
|
+
scope="col"
|
|
32
|
+
class="{outerStyles} bg-white text-neutral-500 group sticky z-10 top-0"
|
|
33
|
+
style:min-width={field.width}
|
|
34
|
+
style:max-width={field.width}
|
|
35
|
+
>
|
|
36
|
+
<span class="flex">
|
|
37
|
+
{#if field.sortable}
|
|
38
|
+
<BaseDropdown bind:this={sortDropdown} fullWidth>
|
|
39
|
+
<span
|
|
40
|
+
slot="trigger"
|
|
41
|
+
class="{headerStyles} w-full p-3 flex items-center justify-start space-x-1 text-left text-base tracking-normal whitespace-nowrap font-normal"
|
|
42
|
+
>
|
|
43
|
+
<span>{field.headerLabel}</span>
|
|
44
|
+
{#if sortBy === field.slug}
|
|
45
|
+
<svg
|
|
46
|
+
viewBox="0 0 12 12"
|
|
47
|
+
fill="none"
|
|
48
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
49
|
+
class:rotate-180={sortDirection === 'asc'}
|
|
50
|
+
class="mt-px text-neutral-400 h-3 w-3"
|
|
51
|
+
>
|
|
52
|
+
<path
|
|
53
|
+
fill-rule="evenodd"
|
|
54
|
+
clip-rule="evenodd"
|
|
55
|
+
d="M6.56519 8.8272L7.9966 7.39579L8.7037 8.1029L6.41082 10.3958L6.05726 10.7493L5.70371 10.3958L3.41082 8.1029L4.11793 7.39579L5.56507 8.84293L5.61453 1.24609L6.61451 1.2526L6.56519 8.8272Z"
|
|
56
|
+
fill="currentColor"
|
|
57
|
+
/>
|
|
58
|
+
</svg>
|
|
59
|
+
{/if}
|
|
60
|
+
</span>
|
|
61
|
+
<BaseTableHeaderSortBy
|
|
62
|
+
{sortDirection}
|
|
63
|
+
isActive={sortBy === field.slug}
|
|
64
|
+
on:sortBy={handleSortBy}
|
|
65
|
+
/>
|
|
66
|
+
</BaseDropdown>
|
|
67
|
+
{:else}
|
|
68
|
+
<div
|
|
69
|
+
class="{headerStyles} p-3 text-left text-base font-normal tracking-normal whitespace-nowrap"
|
|
70
|
+
>
|
|
71
|
+
{field.headerLabel}
|
|
72
|
+
</div>
|
|
73
|
+
{/if}
|
|
74
|
+
</span>
|
|
75
|
+
</th>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { TableField, TableSortBy } from './types.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
field: TableField;
|
|
6
|
+
sortBy?: string | undefined;
|
|
7
|
+
sortDirection: TableSortBy;
|
|
8
|
+
isFirst?: boolean | undefined;
|
|
9
|
+
isLast?: boolean | undefined;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
orderBy: CustomEvent<any>;
|
|
13
|
+
} & {
|
|
14
|
+
[evt: string]: CustomEvent<any>;
|
|
15
|
+
};
|
|
16
|
+
slots: {};
|
|
17
|
+
};
|
|
18
|
+
export type BaseTableHeaderProps = typeof __propDef.props;
|
|
19
|
+
export type BaseTableHeaderEvents = typeof __propDef.events;
|
|
20
|
+
export type BaseTableHeaderSlots = typeof __propDef.slots;
|
|
21
|
+
export default class BaseTableHeader extends SvelteComponent<BaseTableHeaderProps, BaseTableHeaderEvents, BaseTableHeaderSlots> {
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script>import { SortAscending, SortDescending } from "@invopop/ui-icons";
|
|
2
|
+
import { createEventDispatcher } from "svelte";
|
|
3
|
+
import DrawerContext from "./DrawerContext.svelte";
|
|
4
|
+
const dispatch = createEventDispatcher();
|
|
5
|
+
export let isActive = false;
|
|
6
|
+
export let sortDirection;
|
|
7
|
+
$:
|
|
8
|
+
items = [
|
|
9
|
+
{ icon: SortAscending, label: "Sort Ascending", value: "asc" },
|
|
10
|
+
{ icon: SortDescending, label: "Sort Descending", value: "desc" }
|
|
11
|
+
].map((o) => ({
|
|
12
|
+
...o,
|
|
13
|
+
selected: isActive && sortDirection === o.value
|
|
14
|
+
}));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<DrawerContext
|
|
18
|
+
{items}
|
|
19
|
+
on:click={(e) => {
|
|
20
|
+
dispatch('sortBy', e.detail)
|
|
21
|
+
}}
|
|
22
|
+
/>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { TableSortBy } from './types.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
isActive?: boolean | undefined;
|
|
6
|
+
sortDirection: TableSortBy;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
sortBy: CustomEvent<any>;
|
|
10
|
+
} & {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {};
|
|
14
|
+
};
|
|
15
|
+
export type BaseTableHeaderSortByProps = typeof __propDef.props;
|
|
16
|
+
export type BaseTableHeaderSortByEvents = typeof __propDef.events;
|
|
17
|
+
export type BaseTableHeaderSortBySlots = typeof __propDef.slots;
|
|
18
|
+
export default class BaseTableHeaderSortBy extends SvelteComponent<BaseTableHeaderSortByProps, BaseTableHeaderSortByEvents, BaseTableHeaderSortBySlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
+
import BaseTableActions from "./BaseTableActions.svelte";
|
|
3
|
+
import BaseTableCell from "./BaseTableCell.svelte";
|
|
4
|
+
const dispatch = createEventDispatcher();
|
|
5
|
+
let actionsDropdown;
|
|
6
|
+
export let row;
|
|
7
|
+
export let getActions = void 0;
|
|
8
|
+
export let fields = [];
|
|
9
|
+
export let disableRowClick = false;
|
|
10
|
+
export let freeWrap = false;
|
|
11
|
+
$:
|
|
12
|
+
actions = getActions instanceof Function ? getActions(row) : [];
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<tr
|
|
16
|
+
class:cursor-pointer={!disableRowClick}
|
|
17
|
+
class="hover:bg-neutral-50"
|
|
18
|
+
on:click
|
|
19
|
+
on:contextmenu|preventDefault={() => {
|
|
20
|
+
if (!actionsDropdown) return
|
|
21
|
+
|
|
22
|
+
actionsDropdown.toggle()
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
{#each fields as field, i (i)}
|
|
26
|
+
<BaseTableCell
|
|
27
|
+
currentIndex={i}
|
|
28
|
+
{field}
|
|
29
|
+
{freeWrap}
|
|
30
|
+
badge={field.helperBadge ? field.helperBadge(row) : null}
|
|
31
|
+
status={field.helperStatus ? field.helperStatus(row) : null}
|
|
32
|
+
icons={field.helperIcons ? field.helperIcons(row) : null}
|
|
33
|
+
data={field.formatter ? field.formatter(row) : row[field.slug] || ''}
|
|
34
|
+
on:copied
|
|
35
|
+
/>
|
|
36
|
+
{/each}
|
|
37
|
+
{#if actions.length}
|
|
38
|
+
<td class="pl-1 pr-3">
|
|
39
|
+
<BaseTableActions
|
|
40
|
+
bind:this={actionsDropdown}
|
|
41
|
+
{actions}
|
|
42
|
+
on:clickAction={(event) => {
|
|
43
|
+
dispatch('action', { row, action: event.detail })
|
|
44
|
+
}}
|
|
45
|
+
/>
|
|
46
|
+
</td>
|
|
47
|
+
{/if}
|
|
48
|
+
</tr>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { TableActionProp, TableDataRow, TableField } from './types.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
row: TableDataRow;
|
|
6
|
+
getActions?: TableActionProp;
|
|
7
|
+
fields?: TableField[] | undefined;
|
|
8
|
+
disableRowClick?: boolean | undefined;
|
|
9
|
+
freeWrap?: boolean | undefined;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
click: MouseEvent;
|
|
13
|
+
copied: CustomEvent<any>;
|
|
14
|
+
action: CustomEvent<any>;
|
|
15
|
+
} & {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
};
|
|
18
|
+
slots: {};
|
|
19
|
+
};
|
|
20
|
+
export type BaseTableRowProps = typeof __propDef.props;
|
|
21
|
+
export type BaseTableRowEvents = typeof __propDef.events;
|
|
22
|
+
export type BaseTableRowSlots = typeof __propDef.slots;
|
|
23
|
+
export default class BaseTableRow extends SvelteComponent<BaseTableRowProps, BaseTableRowEvents, BaseTableRowSlots> {
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
+
import { Icon } from "@steeze-ui/svelte-icon";
|
|
3
|
+
import { DocumentText, Download } from "@invopop/ui-icons";
|
|
4
|
+
import BaseButton from "./BaseButton.svelte";
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
export let icon = DocumentText;
|
|
7
|
+
export let name = "";
|
|
8
|
+
export let disabled = false;
|
|
9
|
+
export let date = "";
|
|
10
|
+
export let iconColor = "grey";
|
|
11
|
+
const dispatch = createEventDispatcher();
|
|
12
|
+
$:
|
|
13
|
+
iconStyles = clsx({
|
|
14
|
+
"border-positive-100 bg-positive-50 text-positive-500": iconColor === "green",
|
|
15
|
+
"border-yellow-100 bg-yellow-50 text-yellow-500": iconColor === "yellow",
|
|
16
|
+
"border-red-100 bg-red-50 text-red-500": iconColor === "red",
|
|
17
|
+
"border-warning-100 bg-warning-50 text-warning-500": iconColor === "orange",
|
|
18
|
+
"border-blue-100 bg-blue-50 text-blue-500": iconColor === "blue",
|
|
19
|
+
"border-purple-100 bg-purple-50 text-purple-500": iconColor === "purple",
|
|
20
|
+
"border-dashed border-neutral-100 text-neutral-400": iconColor === "empty",
|
|
21
|
+
"border-neutral-100 bg-neutral-50 text-neutral-500": iconColor === "grey"
|
|
22
|
+
});
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<button
|
|
26
|
+
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"
|
|
28
|
+
{disabled}
|
|
29
|
+
on:click|stopPropagation={() => {
|
|
30
|
+
dispatch('preview')
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
<span class="flex items-center justify-start space-x-2.5 flex-1">
|
|
34
|
+
<div class="{iconStyles} p-2 border rounded">
|
|
35
|
+
<Icon src={icon} class="w-4 h-4" />
|
|
36
|
+
</div>
|
|
37
|
+
<div class="flex flex-col items-start space-y-0.5">
|
|
38
|
+
<span class="text-base font-medium text-neutral-800 tracking-tight max-w-[174px] truncate">
|
|
39
|
+
{name}
|
|
40
|
+
</span>
|
|
41
|
+
<span class="text-sm text-neutral-500">{date}</span>
|
|
42
|
+
</div>
|
|
43
|
+
</span>
|
|
44
|
+
<BaseButton
|
|
45
|
+
{disabled}
|
|
46
|
+
icon={Download}
|
|
47
|
+
on:click={() => {
|
|
48
|
+
dispatch('download')
|
|
49
|
+
}}
|
|
50
|
+
/>
|
|
51
|
+
</button>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import { type IconSource } from '@steeze-ui/svelte-icon';
|
|
3
|
+
import type { StatusType } from './types.js';
|
|
4
|
+
declare const __propDef: {
|
|
5
|
+
props: {
|
|
6
|
+
icon?: IconSource | undefined;
|
|
7
|
+
name?: string | undefined;
|
|
8
|
+
disabled?: boolean | undefined;
|
|
9
|
+
date?: string | undefined;
|
|
10
|
+
iconColor?: StatusType | undefined;
|
|
11
|
+
};
|
|
12
|
+
events: {
|
|
13
|
+
preview: CustomEvent<any>;
|
|
14
|
+
download: CustomEvent<any>;
|
|
15
|
+
} & {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
};
|
|
18
|
+
slots: {};
|
|
19
|
+
};
|
|
20
|
+
export type ButtonFileProps = typeof __propDef.props;
|
|
21
|
+
export type ButtonFileEvents = typeof __propDef.events;
|
|
22
|
+
export type ButtonFileSlots = typeof __propDef.slots;
|
|
23
|
+
export default class ButtonFile extends SvelteComponent<ButtonFileProps, ButtonFileEvents, ButtonFileSlots> {
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script>import { Icon } from "@steeze-ui/svelte-icon";
|
|
2
|
+
import { ChevronRight } from "@invopop/ui-icons";
|
|
3
|
+
import SeparatorHorizontal from "./SeparatorHorizontal.svelte";
|
|
4
|
+
export let title = "";
|
|
5
|
+
export let icon = void 0;
|
|
6
|
+
export let items = [];
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<div class="border rounded-lg">
|
|
10
|
+
<button class="pl-3 py-2 pr-2 flex items-center justify-between space-x-3 w-full" on:click>
|
|
11
|
+
<div class="flex items-center space-x-1.5">
|
|
12
|
+
{#if icon}
|
|
13
|
+
<Icon src={icon} class="h-4 w-4 text-neutral-500" />
|
|
14
|
+
{/if}
|
|
15
|
+
<span class="text-base font-medium text-neutral-800">{title}</span>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<Icon src={ChevronRight} class="h-4 w-4 text-neutral-500" />
|
|
19
|
+
</button>
|
|
20
|
+
<SeparatorHorizontal />
|
|
21
|
+
<div class="py-1.5 text-sm">
|
|
22
|
+
{#each items as item}
|
|
23
|
+
<div class="px-3 py-1 flex items-center space-x-3">
|
|
24
|
+
<div class="min-w-[88px] text-neutral-500">{item.label}</div>
|
|
25
|
+
<div class="text-neutral-800">{item.value}</div>
|
|
26
|
+
</div>
|
|
27
|
+
{/each}
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import { type IconSource } from '@steeze-ui/svelte-icon';
|
|
3
|
+
import type { DataListItem } from './types.js';
|
|
4
|
+
declare const __propDef: {
|
|
5
|
+
props: {
|
|
6
|
+
title?: string | undefined;
|
|
7
|
+
icon?: IconSource | undefined;
|
|
8
|
+
items?: DataListItem[] | undefined;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
click: MouseEvent;
|
|
12
|
+
} & {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
};
|
|
15
|
+
slots: {};
|
|
16
|
+
};
|
|
17
|
+
export type CardRelationProps = typeof __propDef.props;
|
|
18
|
+
export type CardRelationEvents = typeof __propDef.events;
|
|
19
|
+
export type CardRelationSlots = typeof __propDef.slots;
|
|
20
|
+
export default class CardRelation extends SvelteComponent<CardRelationProps, CardRelationEvents, CardRelationSlots> {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<script>import { Icon } from "@steeze-ui/svelte-icon";
|
|
2
|
+
import ProfileAvatar from "./ProfileAvatar.svelte";
|
|
3
|
+
import BaseDropdown from "./BaseDropdown.svelte";
|
|
4
|
+
import DrawerContextWorkspace from "./DrawerContextWorkspace.svelte";
|
|
5
|
+
import { createEventDispatcher } from "svelte";
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import { DoubleArrow } from "@invopop/ui-icons";
|
|
8
|
+
const dispatch = createEventDispatcher();
|
|
9
|
+
export let companies = [];
|
|
10
|
+
export let selectedCompany = null;
|
|
11
|
+
let companyDropdown;
|
|
12
|
+
let isOpen = false;
|
|
13
|
+
export let collapsed = false;
|
|
14
|
+
$:
|
|
15
|
+
name = selectedCompany?.name || "";
|
|
16
|
+
$:
|
|
17
|
+
country = selectedCompany?.country || "";
|
|
18
|
+
$:
|
|
19
|
+
picture = selectedCompany?.logo_url || "";
|
|
20
|
+
$:
|
|
21
|
+
items = [
|
|
22
|
+
...companies.map((c) => ({
|
|
23
|
+
value: c.id,
|
|
24
|
+
label: c.name,
|
|
25
|
+
selected: c.slug === selectedCompany?.slug,
|
|
26
|
+
country: c.country,
|
|
27
|
+
picture: c.logo_url
|
|
28
|
+
}))
|
|
29
|
+
];
|
|
30
|
+
$:
|
|
31
|
+
styles = clsx(
|
|
32
|
+
{ "p-1": collapsed },
|
|
33
|
+
{ "space-x-2 w-full p-[7px]": !collapsed },
|
|
34
|
+
{ "border-white-10 bg-white-5": isOpen },
|
|
35
|
+
{ "border-transparent": !isOpen }
|
|
36
|
+
);
|
|
37
|
+
function selectCompany(event) {
|
|
38
|
+
companyDropdown.toggle();
|
|
39
|
+
if (event.detail === "add") {
|
|
40
|
+
dispatch("add");
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (event.detail === "settings") {
|
|
44
|
+
dispatch("settings");
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
selectedCompany = companies.find((c) => c.id === event.detail) || null;
|
|
48
|
+
dispatch("select", selectedCompany);
|
|
49
|
+
}
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<BaseDropdown
|
|
53
|
+
bind:isOpen
|
|
54
|
+
bind:this={companyDropdown}
|
|
55
|
+
placement="bottom-start"
|
|
56
|
+
fullWidth={!collapsed}
|
|
57
|
+
>
|
|
58
|
+
<span
|
|
59
|
+
slot="trigger"
|
|
60
|
+
title={name}
|
|
61
|
+
class="{styles} text-white text-base font-semibold flex items-center justify-between border focus:border-white-10 active:border-white-10 hover:bg-white-5 rounded"
|
|
62
|
+
>
|
|
63
|
+
<span class:space-x-2={!collapsed} class="flex items-center">
|
|
64
|
+
<ProfileAvatar {name} {picture} {country} dark large />
|
|
65
|
+
{#if !collapsed}
|
|
66
|
+
<div class="whitespace-nowrap max-w-[140px] truncate tracking-tight">{name}</div>
|
|
67
|
+
{/if}
|
|
68
|
+
</span>
|
|
69
|
+
{#if !collapsed}
|
|
70
|
+
<Icon src={DoubleArrow} class="h-4 w-4 text-white-40 mt-px" />
|
|
71
|
+
{/if}
|
|
72
|
+
</span>
|
|
73
|
+
<DrawerContextWorkspace {items} on:click={selectCompany} />
|
|
74
|
+
</BaseDropdown>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { Company } from './types.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
companies?: Company[] | undefined;
|
|
6
|
+
selectedCompany?: Company | null | undefined;
|
|
7
|
+
collapsed?: boolean | undefined;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
add: CustomEvent<any>;
|
|
11
|
+
settings: CustomEvent<any>;
|
|
12
|
+
select: CustomEvent<any>;
|
|
13
|
+
} & {
|
|
14
|
+
[evt: string]: CustomEvent<any>;
|
|
15
|
+
};
|
|
16
|
+
slots: {};
|
|
17
|
+
};
|
|
18
|
+
export type CompanySelectorProps = typeof __propDef.props;
|
|
19
|
+
export type CompanySelectorEvents = typeof __propDef.events;
|
|
20
|
+
export type CompanySelectorSlots = typeof __propDef.slots;
|
|
21
|
+
export default class CompanySelector extends SvelteComponent<CompanySelectorProps, CompanySelectorEvents, CompanySelectorSlots> {
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script>import clsx from "clsx";
|
|
2
|
+
export let content;
|
|
3
|
+
export let variant = "default";
|
|
4
|
+
$:
|
|
5
|
+
styles = clsx({
|
|
6
|
+
"bg-white rounded-md": variant === "default",
|
|
7
|
+
rounded: variant === "transparent"
|
|
8
|
+
});
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<div
|
|
12
|
+
class="{styles} border border-neutral-200 inline-flex items-center justify-center p-[3px] text-neutral-500 text-sm font-medium h-5 min-w-[20px] tracking-wide tabular-nums slashed-zero lining-nums"
|
|
13
|
+
>
|
|
14
|
+
{content}
|
|
15
|
+
</div>
|