firstly 0.0.9 → 0.0.10
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 +8 -0
- package/esm/BaseEnum.d.ts +1 -1
- package/esm/FF_Entity.d.ts +1 -1
- package/esm/FF_Entity.js +7 -3
- package/esm/ROUTES.d.ts +2 -2
- package/esm/api/index.d.ts +0 -1
- package/esm/feedback/FeedbackController.d.ts +1 -1
- package/esm/handle/index.d.ts +0 -1
- package/esm/helper.d.ts +16 -14
- package/esm/helper.js +55 -0
- package/esm/index.d.ts +1 -2
- package/esm/index.js +1 -1
- package/esm/mail/templates/DefaultMail.svelte.d.ts +3 -3
- package/esm/storeItem.d.ts +1 -2
- package/esm/storeList.d.ts +1 -2
- package/esm/ui/Clipboardable.svelte.d.ts +1 -1
- package/esm/ui/Field.svelte.d.ts +3 -2
- package/esm/ui/FieldGroup.svelte.d.ts +1 -1
- package/esm/ui/Grid.svelte.d.ts +6 -6
- package/esm/ui/GridLoading.svelte.d.ts +1 -1
- package/esm/ui/GridPaginate.svelte.d.ts +2 -2
- package/esm/ui/Icon.svelte.d.ts +3 -3
- package/esm/ui/Loading.svelte.d.ts +1 -1
- package/esm/ui/Tooltip.svelte.d.ts +2 -2
- package/esm/ui/dialog/DialogPrimitive.svelte +1 -1
- package/esm/ui/dialog/DialogPrimitive.svelte.d.ts +3 -3
- package/esm/ui/dialog/dialog.d.ts +1 -1
- package/esm/ui/internals/FieldContainer.svelte.d.ts +6 -6
- package/esm/ui/internals/Input.svelte.d.ts +1 -1
- package/esm/ui/internals/Textarea.svelte.d.ts +2 -2
- package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +4 -4
- package/esm/ui/internals/select/SelectMelt.svelte.d.ts +7 -7
- package/esm/ui/internals/select/SelectRadio.svelte.d.ts +3 -3
- package/esm/ui/link/Link.svelte +1 -1
- package/esm/ui/link/Link.svelte.d.ts +2 -2
- package/esm/ui/link/LinkPlus.svelte.d.ts +2 -2
- package/esm/utils/transition.d.ts +0 -1
- package/esm/vite/index.js +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# firstly
|
|
2
2
|
|
|
3
|
+
## 0.0.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#51](https://github.com/jycouet/firstly/pull/51)
|
|
8
|
+
[`803023a`](https://github.com/jycouet/firstly/commit/803023a6257c0bfb9396bc0a7bd454bd1281e26c)
|
|
9
|
+
Thanks [@jycouet](https://github.com/jycouet)! - prepare 0.0.10
|
|
10
|
+
|
|
3
11
|
## 0.0.9
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/esm/BaseEnum.d.ts
CHANGED
package/esm/FF_Entity.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type EntityOptions } from 'remult';
|
|
2
|
-
export declare function FF_Entity<entityType>(key: string, options: EntityOptions<entityType extends new (...args: any) => any ? InstanceType<entityType> : entityType>): (target: any, info?: import("remult/src/remult3/remult3").ClassDecoratorContextStub<entityType extends infer T ? T extends entityType ? T extends new (...args: any) => any ?
|
|
2
|
+
export declare function FF_Entity<entityType>(key: string, options: EntityOptions<entityType extends new (...args: any) => any ? InstanceType<entityType> : entityType>): (target: any, info?: import("remult/src/remult3/remult3").ClassDecoratorContextStub<entityType extends infer T ? T extends entityType ? T extends new (...args: any) => any ? entityType : never : never : never> | undefined) => any;
|
package/esm/FF_Entity.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Entity } from 'remult';
|
|
1
|
+
import { Entity, isBackend } from 'remult';
|
|
2
2
|
import { recordDeleted, recordSaved } from './changeLog';
|
|
3
3
|
const toAllow = (permission) => {
|
|
4
4
|
if (permission) {
|
|
@@ -24,7 +24,9 @@ export function FF_Entity(key, options) {
|
|
|
24
24
|
// Don't log changes
|
|
25
25
|
}
|
|
26
26
|
else {
|
|
27
|
-
|
|
27
|
+
if (isBackend()) {
|
|
28
|
+
await recordSaved(entity, e, options.changeLog);
|
|
29
|
+
}
|
|
28
30
|
}
|
|
29
31
|
},
|
|
30
32
|
deleted: async (entity, e) => {
|
|
@@ -33,7 +35,9 @@ export function FF_Entity(key, options) {
|
|
|
33
35
|
// Don't log changes
|
|
34
36
|
}
|
|
35
37
|
else {
|
|
36
|
-
|
|
38
|
+
if (isBackend()) {
|
|
39
|
+
await recordDeleted(entity, e, options.changeLog);
|
|
40
|
+
}
|
|
37
41
|
}
|
|
38
42
|
},
|
|
39
43
|
});
|
package/esm/ROUTES.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ type ParamValue = string | number | undefined;
|
|
|
7
7
|
/**
|
|
8
8
|
* Append search params to a string
|
|
9
9
|
*/
|
|
10
|
-
export declare const appendSp: (sp?: Record<string, ParamValue | ParamValue[]>, prefix?:
|
|
10
|
+
export declare const appendSp: (sp?: Record<string, ParamValue | ParamValue[]>, prefix?: "?" | "&") => string;
|
|
11
11
|
/**
|
|
12
12
|
* get the current search params
|
|
13
13
|
*
|
|
@@ -41,7 +41,7 @@ declare const AllObjs: {
|
|
|
41
41
|
};
|
|
42
42
|
type AllTypes = typeof AllObjs;
|
|
43
43
|
export type Routes = keyof AllTypes extends `${string}/${infer Route}` ? `/${Route}` : keyof AllTypes;
|
|
44
|
-
export declare const routes:
|
|
44
|
+
export declare const routes: Routes[];
|
|
45
45
|
/**
|
|
46
46
|
* To be used like this:
|
|
47
47
|
* ```ts
|
package/esm/api/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types=".pnpm/@sveltejs+kit@2.5.24_@sveltejs+vite-plugin-svelte@3.1.2_svelte@4.2.18_vite@5.4.1_@types+node@_lnml5jetshdinsnlj53joqxhde/node_modules/@sveltejs/kit" />
|
|
2
1
|
import type { Handle, RequestEvent } from '@sveltejs/kit';
|
|
3
2
|
import { type ClassType } from 'remult';
|
|
4
3
|
import type { RemultServerOptions } from 'remult/server';
|
package/esm/handle/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types=".pnpm/@sveltejs+kit@2.5.24_@sveltejs+vite-plugin-svelte@3.1.2_svelte@4.2.18_vite@5.4.1_@types+node@_lnml5jetshdinsnlj53joqxhde/node_modules/@sveltejs/kit" />
|
|
2
1
|
import type { Handle } from '@sveltejs/kit';
|
|
3
2
|
import type { RemultSveltekitServer } from 'remult/remult-sveltekit';
|
|
4
3
|
import type { Module } from '../api';
|
package/esm/helper.d.ts
CHANGED
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import type { ClassType, ErrorInfo, FieldMetadata, Repository } from 'remult';
|
|
1
|
+
import type { ClassType, ErrorInfo, FieldMetadata, LifecycleEvent, Repository } from 'remult';
|
|
2
2
|
import type { BaseEnum, BaseItem } from './index.js';
|
|
3
3
|
export declare function isError<T>(object: any): object is ErrorInfo<T>;
|
|
4
4
|
export declare const getFirstInterestingField: <Entity>(repo: Repository<Entity>) => FieldMetadata<any, Entity>;
|
|
5
5
|
export declare const getEntityDisplayValue: <Entity>(repo: Repository<Entity>, row: Entity) => BaseItem;
|
|
6
|
-
export declare const getFieldLinkDisplayValue: (field: FieldMetadata, row: any) =>
|
|
7
|
-
id: string;
|
|
8
|
-
captionSub?: string | (string | undefined)[] | undefined;
|
|
9
|
-
href?: string | undefined;
|
|
10
|
-
repo?: Repository<any> | undefined;
|
|
11
|
-
sub?: {
|
|
12
|
-
captionPre?: string | undefined;
|
|
13
|
-
repo?: Repository<any> | undefined;
|
|
14
|
-
item?: any;
|
|
15
|
-
} | undefined;
|
|
16
|
-
} & {
|
|
6
|
+
export declare const getFieldLinkDisplayValue: (field: FieldMetadata, row: any) => BaseItem & {
|
|
17
7
|
href: string;
|
|
18
8
|
};
|
|
19
9
|
export declare const getEntityDisplayValueFromField: (field: FieldMetadata, row: any) => BaseItem & {
|
|
@@ -43,6 +33,18 @@ type MetaTypeSlot = {
|
|
|
43
33
|
export type FieldMetaType = MetaTypeRelation | MetaTypeEnum | MetaTypePrimitive | MetaTypeSlot;
|
|
44
34
|
export declare const getFieldMetaType: (field?: FieldMetadata) => FieldMetaType;
|
|
45
35
|
export declare const displayWithDefaultAndSuffix: (field: FieldMetadata<any, any> | undefined, value: any) => string;
|
|
46
|
-
export declare const getEnum: <T extends BaseEnum
|
|
47
|
-
export declare const getEnums: <T extends BaseEnum
|
|
36
|
+
export declare const getEnum: <T extends BaseEnum>(baseEnum: ClassType<T>, id: string | undefined | null) => T | undefined;
|
|
37
|
+
export declare const getEnums: <T extends BaseEnum>(baseEnum: ClassType<T>) => T[];
|
|
38
|
+
export declare const upsert: <Entity>(currentRepo: Repository<Entity>, id: Parameters<typeof currentRepo.findId>[0], entity: Partial<Entity>) => Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* To be used like:
|
|
41
|
+
* ```ts
|
|
42
|
+
* \@Entity('tasks', {
|
|
43
|
+
* async deleting(item, e) {
|
|
44
|
+
* await onDelete(item, e, 'prevent')
|
|
45
|
+
* },
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare const onDelete: <T>(item: T, e: LifecycleEvent<T>, mode?: "prevent" | "cascade") => Promise<void>;
|
|
48
50
|
export {};
|
package/esm/helper.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getEntityRef, getValueList } from 'remult';
|
|
2
2
|
import { getRelationFieldInfo } from 'remult/internals';
|
|
3
|
+
import { stryEq } from '@kitql/helpers';
|
|
3
4
|
import { suffixWithS } from './formats/strings.js';
|
|
4
5
|
export function isError(object) {
|
|
5
6
|
return object;
|
|
@@ -118,3 +119,57 @@ export const getEnum = (baseEnum, id) => {
|
|
|
118
119
|
export const getEnums = (baseEnum) => {
|
|
119
120
|
return getValueList(baseEnum) || [];
|
|
120
121
|
};
|
|
122
|
+
export const upsert = async (currentRepo, id, entity) => {
|
|
123
|
+
const found = await currentRepo.findId(id);
|
|
124
|
+
if (found) {
|
|
125
|
+
// @ts-ignore
|
|
126
|
+
if (!stryEq(found, entity)) {
|
|
127
|
+
// Opti => Sedn only the diff?
|
|
128
|
+
await currentRepo.update(id, entity);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
await currentRepo.insert(entity);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* To be used like:
|
|
137
|
+
* ```ts
|
|
138
|
+
* \@Entity('tasks', {
|
|
139
|
+
* async deleting(item, e) {
|
|
140
|
+
* await onDelete(item, e, 'prevent')
|
|
141
|
+
* },
|
|
142
|
+
* }
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
export const onDelete = async (item, e, mode = 'prevent') => {
|
|
146
|
+
const toManies = e.repository.fields
|
|
147
|
+
.toArray()
|
|
148
|
+
.map((f) => {
|
|
149
|
+
return {
|
|
150
|
+
f: f,
|
|
151
|
+
fi: getRelationFieldInfo(f),
|
|
152
|
+
};
|
|
153
|
+
})
|
|
154
|
+
.filter((f) => f.fi?.type === 'toMany');
|
|
155
|
+
const checks = await Promise.all(toManies.map(async (f_fi) => {
|
|
156
|
+
// @ts-ignore
|
|
157
|
+
const count = await e.repository.relations(item)[f_fi.f.key].count();
|
|
158
|
+
return { ...f_fi, count };
|
|
159
|
+
}));
|
|
160
|
+
const nonEmptyRelations = checks.filter((check) => check.count > 0);
|
|
161
|
+
if (nonEmptyRelations.length > 0) {
|
|
162
|
+
if (mode === 'prevent') {
|
|
163
|
+
const relationNames = nonEmptyRelations.map((r) => r.f.caption).join(', ');
|
|
164
|
+
throw Error(`Can't with existing: ${relationNames}`);
|
|
165
|
+
}
|
|
166
|
+
else if (mode === 'cascade') {
|
|
167
|
+
nonEmptyRelations.forEach(async (r) => {
|
|
168
|
+
const where = Object.entries(r.fi?.getFields().fields ?? {}).map(([key, value]) => {
|
|
169
|
+
return { [key]: item[value] };
|
|
170
|
+
});
|
|
171
|
+
await r.fi?.toRepo.deleteMany({ where });
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
};
|
package/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types=".pnpm/@sveltejs+kit@2.5.24_@sveltejs+vite-plugin-svelte@3.1.2_svelte@4.2.18_vite@5.4.1_@types+node@_lnml5jetshdinsnlj53joqxhde/node_modules/@sveltejs/kit" />
|
|
2
1
|
import type { RequestEvent } from '@sveltejs/kit';
|
|
3
2
|
import type { FindOptionsBase } from 'remult';
|
|
4
3
|
import { Log } from '@kitql/helpers';
|
|
@@ -44,7 +43,7 @@ export { FF_Entity } from './FF_Entity.js';
|
|
|
44
43
|
export { FF_LogToConsole } from './SqlDatabase/FF_LogToConsole.js';
|
|
45
44
|
export { BaseEnum } from './BaseEnum.js';
|
|
46
45
|
export { dialog } from './ui/dialog/dialog.js';
|
|
47
|
-
export { getEntityDisplayValue, isError, getFieldLinkDisplayValue, getEnum, getEnums, } from './helper.js';
|
|
46
|
+
export { getEntityDisplayValue, isError, getFieldLinkDisplayValue, getEnum, getEnums, upsert, onDelete, } from './helper.js';
|
|
48
47
|
export { buildWhere, getPlaceholder, buildSearchWhere, cellsBuildor, cellBuildor, fieldsOf, containsWords, } from './cellsBuildor.js';
|
|
49
48
|
export { storeItem };
|
|
50
49
|
export { storeList };
|
package/esm/index.js
CHANGED
|
@@ -36,7 +36,7 @@ export { FF_Entity } from './FF_Entity.js';
|
|
|
36
36
|
export { FF_LogToConsole } from './SqlDatabase/FF_LogToConsole.js';
|
|
37
37
|
export { BaseEnum } from './BaseEnum.js';
|
|
38
38
|
export { dialog } from './ui/dialog/dialog.js';
|
|
39
|
-
export { getEntityDisplayValue, isError, getFieldLinkDisplayValue, getEnum, getEnums, } from './helper.js';
|
|
39
|
+
export { getEntityDisplayValue, isError, getFieldLinkDisplayValue, getEnum, getEnums, upsert, onDelete, } from './helper.js';
|
|
40
40
|
export { buildWhere, getPlaceholder, buildSearchWhere, cellsBuildor, cellBuildor, fieldsOf, containsWords, } from './cellsBuildor.js';
|
|
41
41
|
export { storeItem };
|
|
42
42
|
export { storeList };
|
|
@@ -5,13 +5,13 @@ declare const __propDef: {
|
|
|
5
5
|
title: string | undefined;
|
|
6
6
|
sections?: {
|
|
7
7
|
text: string;
|
|
8
|
-
highlighted?: boolean
|
|
8
|
+
highlighted?: boolean;
|
|
9
9
|
cta?: {
|
|
10
10
|
text: string;
|
|
11
11
|
link: string;
|
|
12
12
|
} | undefined;
|
|
13
|
-
}[]
|
|
14
|
-
brandColor?: string
|
|
13
|
+
}[];
|
|
14
|
+
brandColor?: string;
|
|
15
15
|
};
|
|
16
16
|
events: {
|
|
17
17
|
[evt: string]: CustomEvent<any>;
|
package/esm/storeItem.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="svelte" />
|
|
2
1
|
import type { ErrorInfo, FindOptions, Repository } from 'remult';
|
|
3
2
|
type TheStoreItem<T> = {
|
|
4
3
|
item: T | undefined;
|
|
@@ -17,7 +16,7 @@ export declare const storeItem: <T>(repo: Repository<T>, initValues?: TheStoreIt
|
|
|
17
16
|
* store.fetch(id)
|
|
18
17
|
* ```
|
|
19
18
|
*/
|
|
20
|
-
fetch: (id: Parameters<Repository<T>[
|
|
19
|
+
fetch: (id: Parameters<Repository<T>["findId"]>[0], options?: FindOptions<T>, onNewData?: (item: T) => void) => Promise<void>;
|
|
21
20
|
/**
|
|
22
21
|
* `.save()` will `update` or `insert` the current item.
|
|
23
22
|
*/
|
package/esm/storeList.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="svelte" />
|
|
2
1
|
import type { FindOptions, GroupByOptions, MembersOnly, Repository } from 'remult';
|
|
3
2
|
type TheStoreList<T> = {
|
|
4
3
|
items: T[];
|
|
@@ -28,7 +27,7 @@ export type FF_FindOptions<T> = FindOptions<T> & {
|
|
|
28
27
|
export declare const storeList: <T>(repo: Repository<T>, initValues?: TheStoreList<T>) => {
|
|
29
28
|
subscribe: (this: void, run: import("svelte/store").Subscriber<TheStoreList<T>>, invalidate?: import("svelte/store").Invalidator<TheStoreList<T>> | undefined) => import("svelte/store").Unsubscriber;
|
|
30
29
|
manualSet: (info: TheStoreList<T>) => void;
|
|
31
|
-
fetch: (options?: FF_FindOptions<T>, onNewData?: (
|
|
30
|
+
fetch: (options?: FF_FindOptions<T>, onNewData?: (items?: T[], totalCount?: number) => void) => Promise<void>;
|
|
32
31
|
listen: (options?: FF_FindOptions<T>) => Promise<void>;
|
|
33
32
|
getRepo: () => Repository<T>;
|
|
34
33
|
};
|
|
@@ -6,7 +6,7 @@ declare const __propDef: {
|
|
|
6
6
|
*
|
|
7
7
|
* Don't put this on an input, if not, when a user will select the input via the mouse, this clipboard will be copied (usually you wanted to paste)!
|
|
8
8
|
*/ value: string | null;
|
|
9
|
-
class?: string
|
|
9
|
+
class?: string;
|
|
10
10
|
};
|
|
11
11
|
events: {
|
|
12
12
|
[evt: string]: CustomEvent<any>;
|
package/esm/ui/Field.svelte.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
2
3
|
import { type Cell } from '../';
|
|
3
4
|
declare class __sveltets_Render<T extends Record<any, any>> {
|
|
4
5
|
props(): {
|
|
5
6
|
[x: string]: any;
|
|
6
7
|
cell: Cell<T>;
|
|
7
|
-
value?:
|
|
8
|
+
value?: HTMLInputAttributes["value"];
|
|
8
9
|
cellsValues?: any;
|
|
9
10
|
withDedounce?: boolean | undefined;
|
|
10
11
|
error?: string | undefined;
|
|
11
|
-
mode?: "
|
|
12
|
+
mode?: ("edit" | "view" | "filtre") | undefined;
|
|
12
13
|
focus?: boolean | undefined;
|
|
13
14
|
clearable?: boolean | undefined;
|
|
14
15
|
disabled?: boolean | undefined;
|
|
@@ -4,7 +4,7 @@ import { type StoreItem } from '../';
|
|
|
4
4
|
import type { Cell } from '../cellsBuildor';
|
|
5
5
|
declare class __sveltets_Render<T extends Record<any, any>> {
|
|
6
6
|
props(): {
|
|
7
|
-
mode?:
|
|
7
|
+
mode?: "view" | "edit" | "filtre";
|
|
8
8
|
cells: Cell<T>[];
|
|
9
9
|
store: StoreItem<T>;
|
|
10
10
|
focusKey?: string | null | undefined;
|
package/esm/ui/Grid.svelte.d.ts
CHANGED
|
@@ -6,17 +6,17 @@ declare class __sveltets_Render<T extends Record<any, any>> {
|
|
|
6
6
|
props(): {
|
|
7
7
|
cells: Cell<T>[];
|
|
8
8
|
store: StoreList<T>;
|
|
9
|
-
withAdd?: boolean
|
|
10
|
-
withEdit?: boolean
|
|
11
|
-
withDelete?: boolean
|
|
12
|
-
loadingRows?: number
|
|
9
|
+
withAdd?: boolean;
|
|
10
|
+
withEdit?: boolean;
|
|
11
|
+
withDelete?: boolean;
|
|
12
|
+
loadingRows?: number;
|
|
13
13
|
classes?: {
|
|
14
14
|
table: string;
|
|
15
15
|
} | undefined;
|
|
16
16
|
orderBy?: EntityOrderBy<T> | undefined;
|
|
17
17
|
orderByCols?: true | (keyof T)[] | undefined;
|
|
18
|
-
settingsLeft?: boolean
|
|
19
|
-
dicoNoResult?: string
|
|
18
|
+
settingsLeft?: boolean;
|
|
19
|
+
dicoNoResult?: string;
|
|
20
20
|
};
|
|
21
21
|
events(): {
|
|
22
22
|
refresh: any;
|
|
@@ -2,10 +2,10 @@ import { SvelteComponent } from "svelte";
|
|
|
2
2
|
import './LibIcon';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
label?: string
|
|
5
|
+
label?: string;
|
|
6
6
|
pageDisplayed: number;
|
|
7
7
|
totalCount?: number | undefined | null;
|
|
8
|
-
pageSize?: number
|
|
8
|
+
pageSize?: number;
|
|
9
9
|
};
|
|
10
10
|
events: {
|
|
11
11
|
[evt: string]: CustomEvent<any>;
|
package/esm/ui/Icon.svelte.d.ts
CHANGED
|
@@ -16,14 +16,14 @@ declare const __propDef: {
|
|
|
16
16
|
* import Woman from "virtual:icons/mdi/account-tie-woman";
|
|
17
17
|
* <Icon data={mdiAccountTieWoman} style="background-color: blue;" size={"4rem"}></Icon>
|
|
18
18
|
* ```
|
|
19
|
-
*/ data?: string | string[]
|
|
20
|
-
size?: string | number
|
|
19
|
+
*/ data?: string | string[];
|
|
20
|
+
size?: string | number;
|
|
21
21
|
caption?: string | undefined;
|
|
22
22
|
/**
|
|
23
23
|
* By default, svg are not rendered on the server side.
|
|
24
24
|
* But the size will be respected to not have glitch on the client side when the icon is coming.
|
|
25
25
|
* @default false
|
|
26
|
-
*/ ssr?: boolean
|
|
26
|
+
*/ ssr?: boolean;
|
|
27
27
|
class?: string | string[] | undefined;
|
|
28
28
|
style?: string | string[] | undefined;
|
|
29
29
|
};
|
|
@@ -40,7 +40,7 @@ function dispatchChange(_data) {
|
|
|
40
40
|
/>
|
|
41
41
|
<div
|
|
42
42
|
class={tw(
|
|
43
|
-
`border-base-content/60 bg-base-100 relative z-40 max-h-[90vh] overflow-
|
|
43
|
+
`border-base-content/60 bg-base-100 relative z-40 max-h-[90vh] overflow-auto rounded-xl border p-6 shadow-lg`,
|
|
44
44
|
classes.root,
|
|
45
45
|
)}
|
|
46
46
|
transition:flyAndScale={{
|
|
@@ -3,10 +3,10 @@ import { type BaseItemLight } from '../../';
|
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
detail?: BaseItemLight | undefined;
|
|
6
|
-
open?: boolean
|
|
6
|
+
open?: boolean;
|
|
7
7
|
classes?: {
|
|
8
|
-
root?: string
|
|
9
|
-
}
|
|
8
|
+
root?: string;
|
|
9
|
+
};
|
|
10
10
|
};
|
|
11
11
|
events: {
|
|
12
12
|
change: CustomEvent<any>;
|
|
@@ -46,7 +46,7 @@ export type DialogMetaDataInternal<entityType = any> = DialogMetaData<entityType
|
|
|
46
46
|
export declare const dialog: {
|
|
47
47
|
confirm: (topic: string, text: string, icon?: string) => Promise<ResultClose<any>>;
|
|
48
48
|
confirmDelete: (topic: string) => Promise<ResultClose<any>>;
|
|
49
|
-
form: <entityType>(type:
|
|
49
|
+
form: <entityType>(type: "insert" | "update" | "view", topic: string, repo: Repository<entityType>, settings: DialogFormType<entityType>) => Promise<ResultClose<any>>;
|
|
50
50
|
show: (dialog: DialogMetaData) => Promise<ResultClose<any>>;
|
|
51
51
|
close: (id: number, result: ResultClose) => void;
|
|
52
52
|
closeAll: () => void;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
label?: string
|
|
4
|
+
label?: string;
|
|
5
5
|
forId: string;
|
|
6
|
-
required?: boolean
|
|
7
|
-
error?: string
|
|
6
|
+
required?: boolean;
|
|
7
|
+
error?: string;
|
|
8
8
|
/**
|
|
9
9
|
* example usage for paginate
|
|
10
10
|
* classes={{ label: 'justify-end' }}
|
|
11
11
|
*/ classes?: {
|
|
12
|
-
label?: string
|
|
13
|
-
slot?: string
|
|
14
|
-
}
|
|
12
|
+
label?: string;
|
|
13
|
+
slot?: string;
|
|
14
|
+
};
|
|
15
15
|
};
|
|
16
16
|
events: {
|
|
17
17
|
[evt: string]: CustomEvent<any>;
|
|
@@ -3,7 +3,7 @@ import type { HTMLInputAttributes } from 'svelte/elements';
|
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
[x: string]: any;
|
|
6
|
-
value?: HTMLInputAttributes[
|
|
6
|
+
value?: HTMLInputAttributes["value"];
|
|
7
7
|
focus?: boolean | undefined;
|
|
8
8
|
withDedounce?: boolean | undefined;
|
|
9
9
|
class?: string | undefined | null;
|
|
@@ -2,7 +2,7 @@ import { SvelteComponent } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
[x: string]: any;
|
|
5
|
-
name?: string | null | undefined;
|
|
5
|
+
name?: (string | null) | undefined;
|
|
6
6
|
id?: string | undefined;
|
|
7
7
|
rows?: number | undefined;
|
|
8
8
|
placeholder?: string | undefined;
|
|
@@ -10,7 +10,7 @@ declare const __propDef: {
|
|
|
10
10
|
value?: string | undefined;
|
|
11
11
|
readonly?: boolean | undefined;
|
|
12
12
|
error?: false | undefined;
|
|
13
|
-
align?:
|
|
13
|
+
align?: (`left` | `right`) | undefined;
|
|
14
14
|
};
|
|
15
15
|
events: {
|
|
16
16
|
input: CustomEvent<any>;
|
|
@@ -3,15 +3,15 @@ import { type BaseItem } from '../../..';
|
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
id: string;
|
|
6
|
-
disabled?: boolean
|
|
7
|
-
placeholder?: string
|
|
8
|
-
items?: BaseItem[]
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
items?: BaseItem[];
|
|
9
9
|
loadOptions?: ((str: string) => Promise<{
|
|
10
10
|
items: BaseItem[];
|
|
11
11
|
totalCount: number;
|
|
12
12
|
}>) | undefined;
|
|
13
13
|
values?: string[] | undefined;
|
|
14
|
-
clearable?: boolean
|
|
14
|
+
clearable?: boolean;
|
|
15
15
|
};
|
|
16
16
|
events: {
|
|
17
17
|
selected: CustomEvent<any>;
|
|
@@ -3,18 +3,18 @@ import { type BaseItem } from '../../../';
|
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
id: string;
|
|
6
|
-
disabled?: boolean
|
|
7
|
-
placeholder?: string
|
|
8
|
-
items?: BaseItem[]
|
|
9
|
-
focus?: boolean
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
items?: BaseItem[];
|
|
9
|
+
focus?: boolean;
|
|
10
10
|
loadOptions?: ((str: string) => Promise<{
|
|
11
11
|
items: BaseItem[];
|
|
12
12
|
totalCount: number;
|
|
13
13
|
}>) | undefined;
|
|
14
14
|
value?: string | undefined;
|
|
15
|
-
clearable?: boolean
|
|
16
|
-
createOptionWhenNoResult?: boolean
|
|
17
|
-
default_select_if_one_item?: boolean
|
|
15
|
+
clearable?: boolean;
|
|
16
|
+
createOptionWhenNoResult?: boolean;
|
|
17
|
+
default_select_if_one_item?: boolean;
|
|
18
18
|
};
|
|
19
19
|
events: {
|
|
20
20
|
selected: CustomEvent<any>;
|
|
@@ -3,9 +3,9 @@ import type { BaseItem } from '../../../';
|
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
id: string;
|
|
6
|
-
disabled?: boolean
|
|
7
|
-
placeholder?: string
|
|
8
|
-
items?: BaseItem[]
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
items?: BaseItem[];
|
|
9
9
|
value?: string | number | undefined;
|
|
10
10
|
};
|
|
11
11
|
events: {
|
package/esm/ui/link/Link.svelte
CHANGED
|
@@ -7,7 +7,7 @@ export { className as class };
|
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<a
|
|
10
|
-
class={`${daisy[kind]} link no-underline hover:underline ${className ?? ''}`}
|
|
10
|
+
class={`${daisy[kind]} link inline-block text-left no-underline hover:underline ${className ?? ''}`}
|
|
11
11
|
{href}
|
|
12
12
|
rel="noopener"
|
|
13
13
|
{target}
|
|
@@ -4,8 +4,8 @@ declare const __propDef: {
|
|
|
4
4
|
props: {
|
|
5
5
|
[x: string]: any;
|
|
6
6
|
href: string;
|
|
7
|
-
target?: HTMLAnchorAttributes[
|
|
8
|
-
kind?: "info" | "ghost" | undefined;
|
|
7
|
+
target?: HTMLAnchorAttributes["target"];
|
|
8
|
+
kind?: ("info" | "ghost") | undefined;
|
|
9
9
|
class?: string | undefined | null;
|
|
10
10
|
};
|
|
11
11
|
events: {
|
|
@@ -3,8 +3,8 @@ import { type BaseItemLight } from '../..';
|
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
item: BaseItemLight | undefined;
|
|
6
|
-
noIcon?: boolean
|
|
7
|
-
captionSubStyle?: "
|
|
6
|
+
noIcon?: boolean;
|
|
7
|
+
captionSubStyle?: "under" | "inline" | "none";
|
|
8
8
|
};
|
|
9
9
|
events: {
|
|
10
10
|
[evt: string]: CustomEvent<any>;
|
package/esm/vite/index.js
CHANGED
|
@@ -29,6 +29,7 @@ export function firstly(options) {
|
|
|
29
29
|
});
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
|
+
// @ts-ignore
|
|
32
33
|
...kitRoutes({
|
|
33
34
|
...(options?.kitRoutes ?? {}),
|
|
34
35
|
...{
|
|
@@ -40,6 +41,7 @@ export function firstly(options) {
|
|
|
40
41
|
},
|
|
41
42
|
},
|
|
42
43
|
}),
|
|
44
|
+
// @ts-ignore
|
|
43
45
|
...stripper({
|
|
44
46
|
decorators: ['BackendMethod'],
|
|
45
47
|
hard: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firstly",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Firstly, an opinionated Remult setup!",
|
|
6
6
|
"repository": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@sveltejs/kit": ">=1.0.0 <3.0.0",
|
|
17
|
-
"remult": "0.27.
|
|
17
|
+
"remult": "0.27.20",
|
|
18
18
|
"svelte": ">=4.2.18"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|