firstly 0.0.13 → 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.
Files changed (104) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/esm/ROUTES.d.ts +2 -0
  3. package/esm/ROUTES.js +1 -0
  4. package/esm/api/index.d.ts +8 -0
  5. package/esm/auth/AuthController.d.ts +12 -23
  6. package/esm/auth/AuthController.js +12 -31
  7. package/esm/auth/server/AuthController.server.d.ts +11 -11
  8. package/esm/auth/server/AuthController.server.js +83 -18
  9. package/esm/auth/server/helperFirstly.d.ts +1 -1
  10. package/esm/auth/server/helperFirstly.js +1 -0
  11. package/esm/auth/server/module.d.ts +3 -6
  12. package/esm/auth/server/providers/github.d.ts +2 -1
  13. package/esm/auth/server/providers/github.js +1 -1
  14. package/esm/auth/static/assets/Page-B0XXxe0N.d.ts +6 -0
  15. package/esm/auth/static/assets/Page-B0XXxe0N.js +1 -0
  16. package/esm/auth/static/assets/Page-DdKMiUZn.d.ts +6 -0
  17. package/esm/auth/static/assets/Page-DdKMiUZn.js +20 -0
  18. package/esm/auth/static/assets/Page-UV_hqY7I.d.ts +6 -0
  19. package/esm/auth/static/assets/Page-UV_hqY7I.js +1 -0
  20. package/esm/auth/static/assets/Page-mK42zGEw.css +1 -0
  21. package/esm/auth/static/assets/index-C9jzxOBu.d.ts +151 -0
  22. package/esm/auth/static/assets/index-C9jzxOBu.js +42 -0
  23. package/esm/auth/static/index.html +2 -2
  24. package/esm/auth/types.d.ts +26 -3
  25. package/esm/bin/cmd.js +339 -139
  26. package/esm/feedback/FeedbackController.js +57 -51
  27. package/esm/feedback/server/index.d.ts +6 -15
  28. package/esm/feedback/server/index.js +4 -5
  29. package/esm/feedback/types.d.ts +14 -0
  30. package/esm/feedback/types.js +4 -0
  31. package/esm/feedback/ui/DialogIssue.svelte +78 -62
  32. package/esm/feedback/ui/DialogIssue.svelte.d.ts +20 -18
  33. package/esm/feedback/ui/DialogIssues.svelte +37 -28
  34. package/esm/feedback/ui/DialogIssues.svelte.d.ts +20 -18
  35. package/esm/feedback/ui/DialogMilestones.svelte +18 -12
  36. package/esm/feedback/ui/DialogMilestones.svelte.d.ts +18 -16
  37. package/esm/feedback/ui/Feedback.svelte +11 -9
  38. package/esm/feedback/ui/Feedback.svelte.d.ts +16 -14
  39. package/esm/mail/server/index.d.ts +9 -2
  40. package/esm/mail/server/index.js +3 -1
  41. package/esm/mail/templates/DefaultMail.svelte +64 -44
  42. package/esm/mail/templates/DefaultMail.svelte.d.ts +28 -26
  43. package/esm/server/index.d.ts +0 -0
  44. package/esm/server/index.js +1 -0
  45. package/esm/storeItem.d.ts +1 -1
  46. package/esm/storeList.d.ts +1 -1
  47. package/esm/sveltekit/server/index.d.ts +0 -9
  48. package/esm/ui/Button.svelte +79 -56
  49. package/esm/ui/Button.svelte.d.ts +34 -24
  50. package/esm/ui/Clipboardable.svelte +18 -11
  51. package/esm/ui/Clipboardable.svelte.d.ts +34 -23
  52. package/esm/ui/Field.svelte +189 -136
  53. package/esm/ui/Field.svelte.d.ts +13 -6
  54. package/esm/ui/FieldGroup.svelte +74 -53
  55. package/esm/ui/FieldGroup.svelte.d.ts +17 -6
  56. package/esm/ui/Grid.svelte +110 -86
  57. package/esm/ui/Grid.svelte.d.ts +17 -6
  58. package/esm/ui/GridLoading.svelte +10 -5
  59. package/esm/ui/GridLoading.svelte.d.ts +19 -17
  60. package/esm/ui/GridPaginate.svelte +30 -23
  61. package/esm/ui/GridPaginate.svelte.d.ts +21 -19
  62. package/esm/ui/Icon.svelte +67 -32
  63. package/esm/ui/Icon.svelte.d.ts +52 -43
  64. package/esm/ui/Loading.svelte +5 -3
  65. package/esm/ui/Loading.svelte.d.ts +29 -18
  66. package/esm/ui/Tooltip.svelte +22 -19
  67. package/esm/ui/Tooltip.svelte.d.ts +30 -20
  68. package/esm/ui/dialog/DialogForm.svelte +48 -41
  69. package/esm/ui/dialog/DialogForm.svelte.d.ts +18 -16
  70. package/esm/ui/dialog/DialogManagement.svelte.d.ts +22 -21
  71. package/esm/ui/dialog/DialogPrimitive.svelte +32 -26
  72. package/esm/ui/dialog/DialogPrimitive.svelte.d.ts +35 -25
  73. package/esm/ui/dialog/FormEditAction.svelte +20 -12
  74. package/esm/ui/dialog/FormEditAction.svelte.d.ts +13 -6
  75. package/esm/ui/dialog/dialog.d.ts +1 -1
  76. package/esm/ui/internals/FieldContainer.svelte +13 -6
  77. package/esm/ui/internals/FieldContainer.svelte.d.ts +37 -28
  78. package/esm/ui/internals/Input.svelte +110 -76
  79. package/esm/ui/internals/Input.svelte.d.ts +34 -32
  80. package/esm/ui/internals/Textarea.svelte +39 -31
  81. package/esm/ui/internals/Textarea.svelte.d.ts +31 -28
  82. package/esm/ui/internals/select/MultiSelectMelt.svelte +174 -126
  83. package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +29 -27
  84. package/esm/ui/internals/select/SelectMelt.svelte +168 -133
  85. package/esm/ui/internals/select/SelectMelt.svelte.d.ts +34 -32
  86. package/esm/ui/internals/select/SelectRadio.svelte +17 -11
  87. package/esm/ui/internals/select/SelectRadio.svelte.d.ts +24 -22
  88. package/esm/ui/link/Link.svelte +11 -6
  89. package/esm/ui/link/Link.svelte.d.ts +31 -22
  90. package/esm/ui/link/LinkPlus.svelte +19 -16
  91. package/esm/ui/link/LinkPlus.svelte.d.ts +20 -18
  92. package/esm/vite/index.d.ts +2 -3
  93. package/esm/vite/index.js +33 -26
  94. package/package.json +5 -5
  95. package/esm/auth/static/assets/Page-BUfjaN-D.d.ts +0 -5
  96. package/esm/auth/static/assets/Page-BUfjaN-D.js +0 -19
  97. package/esm/auth/static/assets/Page-CJ58H1vl.css +0 -1
  98. package/esm/auth/static/assets/Page-CaDAqmBS.d.ts +0 -5
  99. package/esm/auth/static/assets/Page-CaDAqmBS.js +0 -1
  100. package/esm/auth/static/assets/Page-DhdZddzJ.d.ts +0 -5
  101. package/esm/auth/static/assets/Page-DhdZddzJ.js +0 -1
  102. package/esm/auth/static/assets/index-D-Ztdt2o.d.ts +0 -54
  103. package/esm/auth/static/assets/index-D-Ztdt2o.js +0 -2
  104. /package/esm/auth/static/assets/{index-BDy4A_14.css → index-DKWpA6v7.css} +0 -0
@@ -1,89 +1,113 @@
1
- <script generics="T extends Record<any, any>">import { createEventDispatcher } from "svelte";
2
- import {
3
- displayWithDefaultAndSuffix,
4
- getEntityDisplayValue,
5
- getEntityDisplayValueFromField,
6
- getFieldLinkDisplayValue,
7
- getFieldMetaType
8
- } from "../helper.js";
9
- import { LibIcon_Delete, LibIcon_Edit } from "../index.js";
10
- import Button from "./Button.svelte";
11
- import Clipboardable from "./Clipboardable.svelte";
12
- import GridLoading from "./GridLoading.svelte";
13
- import Icon from "./Icon.svelte";
14
- import { align, getAligns } from "./index.js";
15
- import {
16
- LibIcon_Add,
17
- LibIcon_Settings,
18
- LibIcon_Sort,
19
- LibIcon_SortAsc,
20
- LibIcon_SortDesc
21
- } from "./LibIcon.js";
22
- import LinkPlus from "./link/LinkPlus.svelte";
23
- export let cells;
24
- export let store;
25
- export let withAdd = false;
26
- export let withEdit = false;
27
- export let withDelete = false;
28
- export let loadingRows = 5;
29
- export let classes = {
30
- table: "table-pin-rows table-pin-cols"
31
- };
32
- export let orderBy = void 0;
33
- export let orderByCols = void 0;
34
- export let settingsLeft = false;
35
- export let dicoNoResult = "Aucun r\xE9sultat !";
36
- const dispatch = createEventDispatcher();
37
- const sorting = (toSort, b) => {
38
- if (!toSort) {
39
- return;
40
- }
41
- if (orderBy === void 0) {
42
- orderBy = { [b.field.key]: "asc" };
43
- } else if (orderBy[b.field.key] === "asc") {
44
- orderBy = { [b.field.key]: "desc" };
45
- } else if (orderBy[b.field.key] === void 0) {
46
- orderBy = { [b.field.key]: "asc" };
47
- } else {
48
- orderBy = void 0;
49
- }
50
- };
51
- const sortingIcon = (toSort, b, _orderBy) => {
52
- if (!toSort) {
53
- return;
54
- }
55
- if (_orderBy && _orderBy[b.field.key] === "asc") {
56
- return { data: LibIcon_SortAsc, class: "text-primary" };
57
- }
58
- if (_orderBy && _orderBy[b.field.key] === "desc") {
59
- return { data: LibIcon_SortDesc, class: "text-primary" };
60
- }
61
- return { data: LibIcon_Sort };
62
- };
63
- const cellsToTake = (cells2) => {
64
- return cells2.filter((c) => c.modeView !== "hide");
65
- };
66
- const classForRounding = (i) => {
67
- if (settingsLeft && (withEdit || withDelete || withAdd)) {
68
- if (i === 0) {
69
- return "";
70
- } else if (i === cells.length - 1) {
71
- return "rounded-tr-lg";
72
- }
73
- }
74
- if (!settingsLeft && (withEdit || withDelete || withAdd)) {
75
- if (i === 0) {
76
- return "rounded-tl-lg";
77
- } else if (i === cells.length - 1) {
78
- return "";
79
- }
80
- }
81
- if (i === 0) {
82
- return "rounded-tl-lg";
83
- } else if (i === cells.length - 1) {
84
- return "rounded-tr-lg";
85
- }
86
- };
1
+ <script lang="ts" generics="T extends Record<any, any>">
2
+ import { createEventDispatcher } from 'svelte'
3
+
4
+ import type { EntityOrderBy } from 'remult'
5
+
6
+ import type { Cell } from '../cellsBuildor.js'
7
+ import {
8
+ displayWithDefaultAndSuffix,
9
+ getEntityDisplayValue,
10
+ getEntityDisplayValueFromField,
11
+ getFieldLinkDisplayValue,
12
+ getFieldMetaType,
13
+ } from '../helper.js'
14
+ import { LibIcon_Delete, LibIcon_Edit, type StoreList } from '../index.js'
15
+ import Button from './Button.svelte'
16
+ import Clipboardable from './Clipboardable.svelte'
17
+ import GridLoading from './GridLoading.svelte'
18
+ import Icon from './Icon.svelte'
19
+ import { align, getAligns } from './index.js'
20
+ import {
21
+ LibIcon_Add,
22
+ LibIcon_Settings,
23
+ LibIcon_Sort,
24
+ LibIcon_SortAsc,
25
+ LibIcon_SortDesc,
26
+ } from './LibIcon.js'
27
+ import LinkPlus from './link/LinkPlus.svelte'
28
+
29
+ export let cells: Cell<T>[]
30
+ export let store: StoreList<T>
31
+
32
+ export let withAdd = false
33
+ export let withEdit = false
34
+ export let withDelete = false
35
+
36
+ export let loadingRows = 5
37
+
38
+ export let classes = {
39
+ table: 'table-pin-rows table-pin-cols',
40
+ }
41
+ export let orderBy: EntityOrderBy<T> | undefined = undefined
42
+ export let orderByCols: (keyof T)[] | true | undefined = undefined
43
+ export let settingsLeft = false
44
+
45
+ export let dicoNoResult = 'Aucun résultat !'
46
+
47
+ const dispatch = createEventDispatcher()
48
+
49
+ const sorting = (toSort: boolean, b: Cell<T>) => {
50
+ if (!toSort) {
51
+ return
52
+ }
53
+ if (orderBy === undefined) {
54
+ // @ts-ignore
55
+ orderBy = { [b.field.key]: 'asc' }
56
+ // @ts-ignore
57
+ } else if (orderBy[b.field.key] === 'asc') {
58
+ // @ts-ignore
59
+ orderBy = { [b.field.key]: 'desc' }
60
+ // @ts-ignore
61
+ } else if (orderBy[b.field.key] === undefined) {
62
+ // @ts-ignore
63
+ orderBy = { [b.field.key]: 'asc' }
64
+ } else {
65
+ orderBy = undefined
66
+ }
67
+ }
68
+
69
+ const sortingIcon = (toSort: boolean, b: Cell<T>, _orderBy: EntityOrderBy<T> | undefined) => {
70
+ if (!toSort) {
71
+ return
72
+ }
73
+ // @ts-ignore
74
+ if (_orderBy && _orderBy[b.field.key] === 'asc') {
75
+ return { data: LibIcon_SortAsc, class: 'text-primary' }
76
+ }
77
+ // @ts-ignore
78
+ if (_orderBy && _orderBy[b.field.key] === 'desc') {
79
+ return { data: LibIcon_SortDesc, class: 'text-primary' }
80
+ }
81
+ return { data: LibIcon_Sort }
82
+ }
83
+
84
+ const cellsToTake = (cells: Cell<T>[]) => {
85
+ return cells.filter((c) => c.modeView !== 'hide')
86
+ }
87
+
88
+ const classForRounding = (i: number) => {
89
+ if (settingsLeft && (withEdit || withDelete || withAdd)) {
90
+ if (i === 0) {
91
+ return ''
92
+ } else if (i === cells.length - 1) {
93
+ return 'rounded-tr-lg'
94
+ }
95
+ }
96
+
97
+ if (!settingsLeft && (withEdit || withDelete || withAdd)) {
98
+ if (i === 0) {
99
+ return 'rounded-tl-lg'
100
+ } else if (i === cells.length - 1) {
101
+ return ''
102
+ }
103
+ }
104
+
105
+ if (i === 0) {
106
+ return 'rounded-tl-lg'
107
+ } else if (i === cells.length - 1) {
108
+ return 'rounded-tr-lg'
109
+ }
110
+ }
87
111
  </script>
88
112
 
89
113
  <div class="overflow-x-auto">
@@ -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
- export type GridProps<T extends Record<any, any>> = ReturnType<__sveltets_Render<T>['props']>;
43
- export type GridEvents<T extends Record<any, any>> = ReturnType<__sveltets_Render<T>['events']>;
44
- export type GridSlots<T extends Record<any, any>> = ReturnType<__sveltets_Render<T>['slots']>;
45
- export default class Grid<T extends Record<any, any>> extends SvelteComponent<GridProps<T>, GridEvents<T>, GridSlots<T>> {
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
- export {};
56
+ declare const Grid: $$IsomorphicComponent;
57
+ type Grid<T extends Record<any, any>> = InstanceType<typeof Grid<T>>;
58
+ export default Grid;
@@ -1,8 +1,13 @@
1
- <script>import { tw } from "../utils/tailwind";
2
- import Loading from "./Loading.svelte";
3
- export let columns;
4
- export let loadingRows = 5;
5
- let size = ["", "w-1/2", "w-1/3", "w-1/4", "w-1/5", "w-1/6"];
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 -->
@@ -1,20 +1,22 @@
1
- import { SvelteComponent } from "svelte";
2
1
  import type { Align } from './index.js';
3
- declare const __propDef: {
4
- props: {
5
- columns: Align[];
6
- loadingRows?: number;
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
- events: {
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
- export {};
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,26 +1,33 @@
1
- <script>import Icon from "./Icon.svelte";
2
- import FieldContainer from "./internals/FieldContainer.svelte";
3
- import "./LibIcon";
4
- import { LibIcon_ChevronLeft, LibIcon_ChevronRight } from "./LibIcon";
5
- import Loading from "./Loading.svelte";
6
- export let label = "Pagination";
7
- export let pageDisplayed;
8
- export let totalCount = void 0;
9
- export let pageSize = 25;
10
- const update = (op) => {
11
- if (op === "+") {
12
- if (canGoNext) {
13
- pageDisplayed = pageDisplayed + 1;
14
- }
15
- } else {
16
- if (pageDisplayed > 1) {
17
- pageDisplayed = pageDisplayed - 1;
18
- }
19
- }
20
- };
21
- $: isValidValue = totalCount !== void 0 && totalCount !== null;
22
- $: needPaginate = isValidValue && (totalCount ?? 0) > pageSize;
23
- $: canGoNext = isValidValue && needPaginate && pageDisplayed < Math.ceil((totalCount ?? 0) / pageSize);
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' }}>
@@ -1,22 +1,24 @@
1
- import { SvelteComponent } from "svelte";
2
1
  import './LibIcon';
3
- declare const __propDef: {
4
- props: {
5
- label?: string;
6
- pageDisplayed: number;
7
- totalCount?: number | undefined | null;
8
- pageSize?: number;
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
- events: {
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
- export {};
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;
@@ -1,35 +1,70 @@
1
- <script>import { BROWSER } from "esm-env";
2
- import "./LibIcon";
3
- import { LibIcon_Empty } from "./LibIcon";
4
- export let data = "";
5
- export let size = "1.5rem";
6
- export let caption = void 0;
7
- const rmvWarning = caption;
8
- export let ssr = false;
9
- let className = "";
10
- export { className as class };
11
- export let style = "";
12
- let width = size;
13
- let height = size;
14
- let viewBox = "0 0 24 24";
15
- let svg = "";
16
- let path = "";
17
- $: if (typeof data === "string") {
18
- if (data.toLowerCase().includes("<svg")) {
19
- svg = data.replace(/width="[^"]*"/, `width="${width}"`).replace(/height="[^"]*"/, `height="${height}"`);
20
- } else {
21
- path = data;
22
- }
23
- } else {
24
- path = data;
25
- }
26
- const getInfoProps = (props, i = 0) => {
27
- if (Array.isArray(props)) {
28
- return props[i] ?? "";
29
- }
30
- return props ?? "";
31
- };
32
- const role = "img";
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'
33
68
  </script>
34
69
 
35
70
  {#if BROWSER || ssr}
@@ -1,46 +1,55 @@
1
- import { SvelteComponent } from "svelte";
2
1
  import './LibIcon';
3
- declare const __propDef: {
4
- props: {
5
- /**
6
- * directly <svg ... /> or d of <path ... />
7
- *
8
- * with \@mdi/js
9
- * ```js
10
- * import { mdiAccountTieWoman } from "@mdi/js";
11
- * <Icon data={mdiAccountTieWoman} style="background-color: blue;" size={"4rem"}></Icon>
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
- events: {
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
- export {};
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;
@@ -1,6 +1,8 @@
1
- <script>import { tw } from "../utils/tailwind";
2
- export { extraClass as class };
3
- let extraClass = "";
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 -->