firstly 0.0.12 → 0.0.14
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/CHANGELOG.md +16 -0
- package/esm/ROUTES.d.ts +2 -0
- package/esm/ROUTES.js +1 -0
- package/esm/api/index.d.ts +9 -0
- package/esm/api/index.js +3 -1
- package/esm/auth/AuthController.d.ts +12 -23
- package/esm/auth/AuthController.js +12 -31
- package/esm/auth/server/AuthController.server.d.ts +11 -11
- package/esm/auth/server/AuthController.server.js +99 -34
- package/esm/auth/server/handleGuard.d.ts +16 -0
- package/esm/auth/server/handleGuard.js +67 -0
- package/esm/auth/server/helperFirstly.d.ts +1 -1
- package/esm/auth/server/helperFirstly.js +1 -0
- package/esm/auth/server/index.d.ts +3 -1
- package/esm/auth/server/index.js +3 -1
- package/esm/auth/server/module.d.ts +105 -89
- package/esm/auth/server/module.js +55 -42
- package/esm/auth/server/providers/github.d.ts +4 -2
- package/esm/auth/server/providers/github.js +2 -2
- package/esm/auth/static/assets/Page-B0XXxe0N.d.ts +6 -0
- package/esm/auth/static/assets/Page-B0XXxe0N.js +1 -0
- package/esm/auth/static/assets/Page-DdKMiUZn.d.ts +6 -0
- package/esm/auth/static/assets/Page-DdKMiUZn.js +20 -0
- package/esm/auth/static/assets/Page-UV_hqY7I.d.ts +6 -0
- package/esm/auth/static/assets/Page-UV_hqY7I.js +1 -0
- package/esm/auth/static/assets/Page-mK42zGEw.css +1 -0
- package/esm/auth/static/assets/index-C9jzxOBu.d.ts +151 -0
- package/esm/auth/static/assets/index-C9jzxOBu.js +42 -0
- package/esm/auth/static/assets/index-DKWpA6v7.css +4 -0
- package/esm/auth/static/index.html +11 -11
- package/esm/auth/types.d.ts +26 -3
- package/esm/bin/cmd.js +423 -152
- package/esm/cellsBuildor.js +1 -1
- package/esm/common.d.ts +5 -0
- package/esm/common.js +8 -0
- package/esm/cron/server/index.js +1 -1
- package/esm/feedback/FeedbackController.js +58 -53
- package/esm/feedback/server/index.d.ts +6 -15
- package/esm/feedback/server/index.js +4 -5
- package/esm/feedback/types.d.ts +14 -0
- package/esm/feedback/types.js +4 -0
- package/esm/feedback/ui/DialogIssue.svelte +131 -119
- package/esm/feedback/ui/DialogIssue.svelte.d.ts +20 -18
- package/esm/feedback/ui/DialogIssues.svelte +108 -99
- package/esm/feedback/ui/DialogIssues.svelte.d.ts +20 -18
- package/esm/feedback/ui/DialogMilestones.svelte +40 -34
- package/esm/feedback/ui/DialogMilestones.svelte.d.ts +18 -16
- package/esm/feedback/ui/Feedback.svelte +11 -9
- package/esm/feedback/ui/Feedback.svelte.d.ts +16 -14
- package/esm/index.d.ts +2 -5
- package/esm/index.js +2 -8
- package/esm/mail/server/index.d.ts +9 -2
- package/esm/mail/server/index.js +3 -1
- package/esm/mail/templates/DefaultMail.svelte +81 -61
- package/esm/mail/templates/DefaultMail.svelte.d.ts +28 -26
- package/esm/server/index.d.ts +0 -0
- package/esm/server/index.js +1 -0
- package/esm/storeItem.d.ts +1 -4
- package/esm/storeItem.js +1 -1
- package/esm/storeList.d.ts +1 -4
- package/esm/sveltekit/server/index.d.ts +3 -9
- package/esm/sveltekit/server/index.js +3 -0
- package/esm/ui/Button.svelte +112 -89
- package/esm/ui/Button.svelte.d.ts +34 -24
- package/esm/ui/Clipboardable.svelte +24 -17
- package/esm/ui/Clipboardable.svelte.d.ts +34 -23
- package/esm/ui/Field.svelte +328 -285
- package/esm/ui/Field.svelte.d.ts +15 -8
- package/esm/ui/FieldGroup.svelte +112 -91
- package/esm/ui/FieldGroup.svelte.d.ts +17 -6
- package/esm/ui/Grid.svelte +322 -308
- package/esm/ui/Grid.svelte.d.ts +17 -6
- package/esm/ui/GridLoading.svelte +28 -27
- package/esm/ui/GridLoading.svelte.d.ts +19 -17
- package/esm/ui/GridPaginate.svelte +68 -61
- package/esm/ui/GridPaginate.svelte.d.ts +21 -19
- package/esm/ui/Icon.svelte +116 -80
- package/esm/ui/Icon.svelte.d.ts +52 -43
- package/esm/ui/Loading.svelte +10 -8
- package/esm/ui/Loading.svelte.d.ts +29 -18
- package/esm/ui/Tooltip.svelte +38 -35
- package/esm/ui/Tooltip.svelte.d.ts +30 -20
- package/esm/ui/dialog/DialogForm.svelte +70 -63
- package/esm/ui/dialog/DialogForm.svelte.d.ts +18 -16
- package/esm/ui/dialog/DialogManagement.svelte +74 -74
- package/esm/ui/dialog/DialogManagement.svelte.d.ts +22 -21
- package/esm/ui/dialog/DialogPrimitive.svelte +82 -76
- package/esm/ui/dialog/DialogPrimitive.svelte.d.ts +35 -25
- package/esm/ui/dialog/FormEditAction.svelte +58 -50
- package/esm/ui/dialog/FormEditAction.svelte.d.ts +13 -6
- package/esm/ui/dialog/dialog.d.ts +1 -4
- package/esm/ui/internals/FieldContainer.svelte +24 -17
- package/esm/ui/internals/FieldContainer.svelte.d.ts +37 -28
- package/esm/ui/internals/Input.svelte +136 -102
- package/esm/ui/internals/Input.svelte.d.ts +34 -32
- package/esm/ui/internals/Textarea.svelte +60 -52
- package/esm/ui/internals/Textarea.svelte.d.ts +31 -28
- package/esm/ui/internals/select/MultiSelectMelt.svelte +243 -199
- package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +29 -27
- package/esm/ui/internals/select/SelectMelt.svelte +254 -219
- package/esm/ui/internals/select/SelectMelt.svelte.d.ts +34 -32
- package/esm/ui/internals/select/SelectRadio.svelte +39 -33
- package/esm/ui/internals/select/SelectRadio.svelte.d.ts +24 -22
- package/esm/ui/link/Link.svelte +25 -20
- package/esm/ui/link/Link.svelte.d.ts +31 -23
- package/esm/ui/link/LinkPlus.svelte +52 -51
- package/esm/ui/link/LinkPlus.svelte.d.ts +20 -18
- package/esm/vite/index.d.ts +2 -3
- package/esm/vite/index.js +33 -26
- package/package.json +16 -20
- package/esm/auth/static/assets/Page-Bb8bFlrP.d.ts +0 -4
- package/esm/auth/static/assets/Page-Bb8bFlrP.js +0 -1
- package/esm/auth/static/assets/Page-BxomFlZ8.d.ts +0 -4
- package/esm/auth/static/assets/Page-BxomFlZ8.js +0 -1
- package/esm/auth/static/assets/Page-CaIYu0-y.d.ts +0 -6
- package/esm/auth/static/assets/Page-CaIYu0-y.js +0 -19
- package/esm/auth/static/assets/Page-MkYglNtu.css +0 -1
- package/esm/auth/static/assets/index-Bl0Bk5u0.d.ts +0 -64
- package/esm/auth/static/assets/index-Bl0Bk5u0.js +0 -2
- package/esm/auth/static/assets/index-R27C_TlP.css +0 -4
package/esm/ui/Grid.svelte.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { EntityOrderBy } from 'remult';
|
|
3
2
|
import type { Cell } from '../cellsBuildor.js';
|
|
4
3
|
import { type StoreList } from '../index.js';
|
|
@@ -38,10 +37,22 @@ declare class __sveltets_Render<T extends Record<any, any>> {
|
|
|
38
37
|
};
|
|
39
38
|
extra: {};
|
|
40
39
|
};
|
|
40
|
+
bindings(): string;
|
|
41
|
+
exports(): {};
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
interface $$IsomorphicComponent {
|
|
44
|
+
new <T extends Record<any, any>>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']> & {
|
|
45
|
+
children?: any;
|
|
46
|
+
}>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
47
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
48
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
49
|
+
<T extends Record<any, any>>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {
|
|
50
|
+
$$events?: ReturnType<__sveltets_Render<T>['events']>;
|
|
51
|
+
$$slots?: ReturnType<__sveltets_Render<T>['slots']>;
|
|
52
|
+
children?: any;
|
|
53
|
+
}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
54
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
46
55
|
}
|
|
47
|
-
|
|
56
|
+
declare const Grid: $$IsomorphicComponent;
|
|
57
|
+
type Grid<T extends Record<any, any>> = InstanceType<typeof Grid<T>>;
|
|
58
|
+
export default Grid;
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tw } from '../utils/tailwind'
|
|
3
|
+
import type { Align } from './index.js'
|
|
4
|
+
import Loading from './Loading.svelte'
|
|
5
|
+
|
|
6
|
+
export let columns: Align[]
|
|
7
|
+
export let loadingRows = 5
|
|
8
|
+
|
|
9
|
+
// Random with different size
|
|
10
|
+
let size = ['', 'w-1/2', 'w-1/3', 'w-1/4', 'w-1/5', 'w-1/6']
|
|
6
11
|
</script>
|
|
7
12
|
|
|
8
13
|
<!-- Do 10 rows -->
|
|
9
14
|
{#each new Array(loadingRows) as _row, r}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</div>
|
|
29
|
-
</td>
|
|
30
|
-
{/each}
|
|
31
|
-
</tr>
|
|
15
|
+
<tr>
|
|
16
|
+
{#each columns as column, c}
|
|
17
|
+
<td class="{column} ">
|
|
18
|
+
<div class={tw('flex justify-between', column === 'text-right' && 'flex-row-reverse')}>
|
|
19
|
+
{#if column === 'text-center'}
|
|
20
|
+
<div></div>
|
|
21
|
+
{/if}
|
|
22
|
+
<Loading
|
|
23
|
+
class={tw(
|
|
24
|
+
`h-4`,
|
|
25
|
+
size[parseInt((((r + 1) * (c + 1) * Math.random() * size.length) % size.length).toString())],
|
|
26
|
+
)}
|
|
27
|
+
/>
|
|
28
|
+
<div></div>
|
|
29
|
+
</div>
|
|
30
|
+
</td>
|
|
31
|
+
{/each}
|
|
32
|
+
</tr>
|
|
32
33
|
{/each}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { Align } from './index.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
7
12
|
};
|
|
8
|
-
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots: {};
|
|
12
|
-
exports?: {} | undefined;
|
|
13
|
-
bindings?: string | undefined;
|
|
14
|
-
};
|
|
15
|
-
export type GridLoadingProps = typeof __propDef.props;
|
|
16
|
-
export type GridLoadingEvents = typeof __propDef.events;
|
|
17
|
-
export type GridLoadingSlots = typeof __propDef.slots;
|
|
18
|
-
export default class GridLoading extends SvelteComponent<GridLoadingProps, GridLoadingEvents, GridLoadingSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
19
14
|
}
|
|
20
|
-
|
|
15
|
+
declare const GridLoading: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
columns: Align[];
|
|
17
|
+
loadingRows?: number;
|
|
18
|
+
}, {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
}, {}, {}, string>;
|
|
21
|
+
type GridLoading = InstanceType<typeof GridLoading>;
|
|
22
|
+
export default GridLoading;
|
|
@@ -1,65 +1,72 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Icon from './Icon.svelte'
|
|
3
|
+
import FieldContainer from './internals/FieldContainer.svelte'
|
|
4
|
+
|
|
5
|
+
import './LibIcon'
|
|
6
|
+
|
|
7
|
+
import { LibIcon_ChevronLeft, LibIcon_ChevronRight } from './LibIcon'
|
|
8
|
+
import Loading from './Loading.svelte'
|
|
9
|
+
|
|
10
|
+
export let label = 'Pagination'
|
|
11
|
+
export let pageDisplayed: number
|
|
12
|
+
export let totalCount: number | undefined | null = undefined
|
|
13
|
+
export let pageSize: number = 25
|
|
14
|
+
|
|
15
|
+
const update = (op: '+' | '-') => {
|
|
16
|
+
if (op === '+') {
|
|
17
|
+
if (canGoNext) {
|
|
18
|
+
pageDisplayed = pageDisplayed + 1
|
|
19
|
+
}
|
|
20
|
+
} else {
|
|
21
|
+
if (pageDisplayed > 1) {
|
|
22
|
+
pageDisplayed = pageDisplayed - 1
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
$: isValidValue = totalCount !== undefined && totalCount !== null
|
|
28
|
+
$: needPaginate = isValidValue && (totalCount ?? 0) > pageSize
|
|
29
|
+
$: canGoNext =
|
|
30
|
+
isValidValue && needPaginate && pageDisplayed < Math.ceil((totalCount ?? 0) / pageSize)
|
|
24
31
|
</script>
|
|
25
32
|
|
|
26
33
|
<FieldContainer {label} forId="paginate" classes={{ label: 'justify-end' }}>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
34
|
+
<div class="flex w-36 items-center justify-end">
|
|
35
|
+
{#if totalCount === undefined}
|
|
36
|
+
<Loading class="ml-6 mr-2 h-3 w-1/6"></Loading>
|
|
37
|
+
<Loading class="mx-2 h-4 w-1/2"></Loading>
|
|
38
|
+
<Loading class="mx-2 h-3 w-1/6"></Loading>
|
|
39
|
+
{:else if !needPaginate}
|
|
40
|
+
<span class="text-primary justify-end px-2 font-bold">
|
|
41
|
+
{totalCount}
|
|
42
|
+
</span>
|
|
43
|
+
{:else}
|
|
44
|
+
<div class="join">
|
|
45
|
+
<button
|
|
46
|
+
aria-label="left"
|
|
47
|
+
on:click={() => update('-')}
|
|
48
|
+
class="btn join-item p-1 {pageDisplayed === 1 ? 'btn-disabled' : ''}"
|
|
49
|
+
>
|
|
50
|
+
<Icon data={LibIcon_ChevronLeft} />
|
|
51
|
+
</button>
|
|
52
|
+
{#if isValidValue}
|
|
53
|
+
<button aria-label="current" class="btn join-item px-0">
|
|
54
|
+
<span class="text-primary font-bold">{totalCount}</span>
|
|
55
|
+
<span class="text-[0.55rem] italic"
|
|
56
|
+
>({pageDisplayed} / {Math.ceil((totalCount ?? 0) / pageSize)})</span
|
|
57
|
+
>
|
|
58
|
+
</button>
|
|
59
|
+
{:else}
|
|
60
|
+
<button aria-label="loading" class="btn join-item animate-pulse">.....</button>
|
|
61
|
+
{/if}
|
|
62
|
+
<button
|
|
63
|
+
aria-label="right"
|
|
64
|
+
on:click={() => update('+')}
|
|
65
|
+
class="btn join-item p-1 {!canGoNext ? 'btn-disabled' : ''}"
|
|
66
|
+
>
|
|
67
|
+
<Icon data={LibIcon_ChevronRight} />
|
|
68
|
+
</button>
|
|
69
|
+
</div>
|
|
70
|
+
{/if}
|
|
71
|
+
</div>
|
|
65
72
|
</FieldContainer>
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import './LibIcon';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
9
12
|
};
|
|
10
|
-
|
|
11
|
-
[evt: string]: CustomEvent<any>;
|
|
12
|
-
};
|
|
13
|
-
slots: {};
|
|
14
|
-
exports?: {} | undefined;
|
|
15
|
-
bindings?: string | undefined;
|
|
16
|
-
};
|
|
17
|
-
export type GridPaginateProps = typeof __propDef.props;
|
|
18
|
-
export type GridPaginateEvents = typeof __propDef.events;
|
|
19
|
-
export type GridPaginateSlots = typeof __propDef.slots;
|
|
20
|
-
export default class GridPaginate extends SvelteComponent<GridPaginateProps, GridPaginateEvents, GridPaginateSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
21
14
|
}
|
|
22
|
-
|
|
15
|
+
declare const GridPaginate: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
label?: string;
|
|
17
|
+
pageDisplayed: number;
|
|
18
|
+
totalCount?: number | undefined | null;
|
|
19
|
+
pageSize?: number;
|
|
20
|
+
}, {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
}, {}, {}, string>;
|
|
23
|
+
type GridPaginate = InstanceType<typeof GridPaginate>;
|
|
24
|
+
export default GridPaginate;
|
package/esm/ui/Icon.svelte
CHANGED
|
@@ -1,85 +1,121 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { BROWSER } from 'esm-env'
|
|
3
|
+
|
|
4
|
+
import './LibIcon'
|
|
5
|
+
|
|
6
|
+
import { LibIcon_Empty } from './LibIcon'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* directly <svg ... /> or d of <path ... />
|
|
10
|
+
*
|
|
11
|
+
* with \@mdi/js
|
|
12
|
+
* ```js
|
|
13
|
+
* import { mdiAccountTieWoman } from "@mdi/js";
|
|
14
|
+
* <Icon data={mdiAccountTieWoman} style="background-color: blue;" size={"4rem"}></Icon>
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* with \@iconify-json/mdi && unplugin-icons with Icons({ compiler: "raw" })
|
|
18
|
+
* ```js
|
|
19
|
+
* import Woman from "virtual:icons/mdi/account-tie-woman";
|
|
20
|
+
* <Icon data={mdiAccountTieWoman} style="background-color: blue;" size={"4rem"}></Icon>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export let data: string | string[] = ''
|
|
24
|
+
|
|
25
|
+
export let size: string | number = '1.5rem'
|
|
26
|
+
|
|
27
|
+
export let caption: string | undefined = undefined
|
|
28
|
+
const rmvWarning = caption
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* By default, svg are not rendered on the server side.
|
|
32
|
+
* But the size will be respected to not have glitch on the client side when the icon is coming.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
export let ssr = false
|
|
36
|
+
|
|
37
|
+
let className: string | string[] | undefined = ''
|
|
38
|
+
export { className as class }
|
|
39
|
+
export let style: string | string[] | undefined = ''
|
|
40
|
+
|
|
41
|
+
let width = size
|
|
42
|
+
let height = size
|
|
43
|
+
let viewBox = '0 0 24 24'
|
|
44
|
+
|
|
45
|
+
let svg = ''
|
|
46
|
+
let path: string | string[] = ''
|
|
47
|
+
|
|
48
|
+
$: if (typeof data === 'string') {
|
|
49
|
+
if (data.toLowerCase().includes('<svg')) {
|
|
50
|
+
svg = data
|
|
51
|
+
.replace(/width="[^"]*"/, `width="${width}"`)
|
|
52
|
+
.replace(/height="[^"]*"/, `height="${height}"`)
|
|
53
|
+
} else {
|
|
54
|
+
path = data
|
|
55
|
+
}
|
|
56
|
+
} else {
|
|
57
|
+
path = data
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const getInfoProps = (props: string | string[] | undefined, i: number = 0) => {
|
|
61
|
+
if (Array.isArray(props)) {
|
|
62
|
+
return props[i] ?? ''
|
|
63
|
+
}
|
|
64
|
+
return props ?? ''
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const role = 'img'
|
|
32
68
|
</script>
|
|
33
69
|
|
|
34
70
|
{#if BROWSER || ssr}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
71
|
+
{#if svg || $$slots.default}
|
|
72
|
+
<span
|
|
73
|
+
class={getInfoProps(className)}
|
|
74
|
+
style={getInfoProps(style)}
|
|
75
|
+
style:width
|
|
76
|
+
style:height
|
|
77
|
+
{role}
|
|
78
|
+
on:click
|
|
79
|
+
>
|
|
80
|
+
<slot>
|
|
81
|
+
{@html svg ?? ''}
|
|
82
|
+
</slot>
|
|
83
|
+
</span>
|
|
84
|
+
{:else}
|
|
85
|
+
<svg
|
|
86
|
+
{width}
|
|
87
|
+
{height}
|
|
88
|
+
{viewBox}
|
|
89
|
+
class={getInfoProps(className)}
|
|
90
|
+
style={getInfoProps(style)}
|
|
91
|
+
{role}
|
|
92
|
+
on:click
|
|
93
|
+
>
|
|
94
|
+
{#each Array.isArray(path) ? path : [path] as d, i}
|
|
95
|
+
<path
|
|
96
|
+
{d}
|
|
97
|
+
fill="currentColor"
|
|
98
|
+
class={getInfoProps(className, i)}
|
|
99
|
+
style={getInfoProps(style, i)}
|
|
100
|
+
/>
|
|
101
|
+
{/each}
|
|
102
|
+
</svg>
|
|
103
|
+
{/if}
|
|
68
104
|
{:else}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
105
|
+
<svg
|
|
106
|
+
{width}
|
|
107
|
+
{height}
|
|
108
|
+
{viewBox}
|
|
109
|
+
class={getInfoProps(className)}
|
|
110
|
+
style={getInfoProps(style)}
|
|
111
|
+
{role}
|
|
112
|
+
on:click
|
|
113
|
+
>
|
|
114
|
+
<path
|
|
115
|
+
d={LibIcon_Empty}
|
|
116
|
+
fill="currentColor"
|
|
117
|
+
class={getInfoProps(className)}
|
|
118
|
+
style={getInfoProps(style)}
|
|
119
|
+
/>
|
|
120
|
+
</svg>
|
|
85
121
|
{/if}
|
package/esm/ui/Icon.svelte.d.ts
CHANGED
|
@@ -1,46 +1,55 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import './LibIcon';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*
|
|
14
|
-
* with \@iconify-json/mdi && unplugin-icons with Icons({ compiler: "raw" })
|
|
15
|
-
* ```js
|
|
16
|
-
* import Woman from "virtual:icons/mdi/account-tie-woman";
|
|
17
|
-
* <Icon data={mdiAccountTieWoman} style="background-color: blue;" size={"4rem"}></Icon>
|
|
18
|
-
* ```
|
|
19
|
-
*/ data?: string | string[];
|
|
20
|
-
size?: string | number;
|
|
21
|
-
caption?: string | undefined;
|
|
22
|
-
/**
|
|
23
|
-
* By default, svg are not rendered on the server side.
|
|
24
|
-
* But the size will be respected to not have glitch on the client side when the icon is coming.
|
|
25
|
-
* @default false
|
|
26
|
-
*/ ssr?: boolean;
|
|
27
|
-
class?: string | string[] | undefined;
|
|
28
|
-
style?: string | string[] | undefined;
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
29
12
|
};
|
|
30
|
-
|
|
31
|
-
click: MouseEvent;
|
|
32
|
-
} & {
|
|
33
|
-
[evt: string]: CustomEvent<any>;
|
|
34
|
-
};
|
|
35
|
-
slots: {
|
|
36
|
-
default: {};
|
|
37
|
-
};
|
|
38
|
-
exports?: {} | undefined;
|
|
39
|
-
bindings?: string | undefined;
|
|
40
|
-
};
|
|
41
|
-
export type IconProps = typeof __propDef.props;
|
|
42
|
-
export type IconEvents = typeof __propDef.events;
|
|
43
|
-
export type IconSlots = typeof __propDef.slots;
|
|
44
|
-
export default class Icon extends SvelteComponent<IconProps, IconEvents, IconSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
45
14
|
}
|
|
46
|
-
|
|
15
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
16
|
+
default: any;
|
|
17
|
+
} ? Props extends Record<string, never> ? any : {
|
|
18
|
+
children?: any;
|
|
19
|
+
} : {});
|
|
20
|
+
declare const Icon: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
21
|
+
/**
|
|
22
|
+
* directly <svg ... /> or d of <path ... />
|
|
23
|
+
*
|
|
24
|
+
* with \@mdi/js
|
|
25
|
+
* ```js
|
|
26
|
+
* import { mdiAccountTieWoman } from "@mdi/js";
|
|
27
|
+
* <Icon data={mdiAccountTieWoman} style="background-color: blue;" size={"4rem"}></Icon>
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* with \@iconify-json/mdi && unplugin-icons with Icons({ compiler: "raw" })
|
|
31
|
+
* ```js
|
|
32
|
+
* import Woman from "virtual:icons/mdi/account-tie-woman";
|
|
33
|
+
* <Icon data={mdiAccountTieWoman} style="background-color: blue;" size={"4rem"}></Icon>
|
|
34
|
+
* ```
|
|
35
|
+
*/ data?: string | string[];
|
|
36
|
+
size?: string | number;
|
|
37
|
+
caption?: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* By default, svg are not rendered on the server side.
|
|
40
|
+
* But the size will be respected to not have glitch on the client side when the icon is coming.
|
|
41
|
+
* @default false
|
|
42
|
+
*/ ssr?: boolean;
|
|
43
|
+
class?: string | string[] | undefined;
|
|
44
|
+
style?: string | string[] | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
default: {};
|
|
47
|
+
}>, {
|
|
48
|
+
click: MouseEvent;
|
|
49
|
+
} & {
|
|
50
|
+
[evt: string]: CustomEvent<any>;
|
|
51
|
+
}, {
|
|
52
|
+
default: {};
|
|
53
|
+
}, {}, string>;
|
|
54
|
+
type Icon = InstanceType<typeof Icon>;
|
|
55
|
+
export default Icon;
|
package/esm/ui/Loading.svelte
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tw } from '../utils/tailwind'
|
|
3
|
+
|
|
4
|
+
export { extraClass as class }
|
|
5
|
+
let extraClass = ''
|
|
4
6
|
</script>
|
|
5
7
|
|
|
6
8
|
<!-- To fix one capa & cadb are on the same css -->
|
|
7
9
|
<div
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
class={tw(
|
|
11
|
+
'skeleton bg-base-content/20 flex h-4 w-full items-center justify-center rounded-lg',
|
|
12
|
+
extraClass,
|
|
13
|
+
)}
|
|
12
14
|
>
|
|
13
|
-
|
|
15
|
+
<slot />
|
|
14
16
|
</div>
|