firstly 0.0.4 → 0.0.5

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 (64) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/esm/{KitBaseEnum.d.ts → BaseEnum.d.ts} +18 -9
  3. package/esm/{KitBaseEnum.js → BaseEnum.js} +2 -13
  4. package/esm/{KitEntity.d.ts → FF_Entity.d.ts} +1 -1
  5. package/esm/{KitEntity.js → FF_Entity.js} +9 -9
  6. package/esm/{KitFields.d.ts → FF_Fields.d.ts} +2 -3
  7. package/esm/{KitFields.js → FF_Fields.js} +13 -9
  8. package/esm/ROUTES.js +1 -1
  9. package/esm/SqlDatabase/FF_LogToConsole.d.ts +1 -0
  10. package/esm/SqlDatabase/{LogToConsoleCustom.js → FF_LogToConsole.js} +1 -1
  11. package/esm/api/index.d.ts +1 -0
  12. package/esm/auth/AuthController.server.js +9 -9
  13. package/esm/auth/Entities.d.ts +18 -17
  14. package/esm/auth/Entities.js +66 -63
  15. package/esm/auth/RoleHelpers.d.ts +2 -2
  16. package/esm/auth/RoleHelpers.js +1 -1
  17. package/esm/auth/client/Auth.js +1 -1
  18. package/esm/auth/index.d.ts +10 -10
  19. package/esm/auth/index.js +20 -18
  20. package/esm/auth/providers/github.d.ts +22 -17
  21. package/esm/auth/providers/github.js +29 -15
  22. package/esm/auth/providers/strava.d.ts +22 -17
  23. package/esm/auth/providers/strava.js +23 -15
  24. package/esm/auth/static/assets/Page-ByIhtXVt.d.ts +1 -1
  25. package/esm/auth/static/assets/Page-ByIhtXVt.js +8178 -6
  26. package/esm/bin/cmd.js +181 -83
  27. package/esm/{kitCellsBuildor.d.ts → cellsBuildor.d.ts} +9 -9
  28. package/esm/{kitCellsBuildor.js → cellsBuildor.js} +8 -8
  29. package/esm/feedback/ui/DialogIssue.svelte +2 -2
  30. package/esm/formats/dates.js +2 -2
  31. package/esm/handle/index.d.ts +1 -0
  32. package/esm/helper.d.ts +8 -10
  33. package/esm/helper.js +13 -8
  34. package/esm/index.d.ts +37 -49
  35. package/esm/index.js +29 -27
  36. package/esm/{kitStoreItem.d.ts → storeItem.d.ts} +1 -1
  37. package/esm/{kitStoreItem.js → storeItem.js} +1 -1
  38. package/esm/{kitStoreList.d.ts → storeList.d.ts} +4 -4
  39. package/esm/{kitStoreList.js → storeList.js} +1 -1
  40. package/esm/ui/Button.svelte +1 -1
  41. package/esm/ui/Button.svelte.d.ts +2 -2
  42. package/esm/ui/Field.svelte.d.ts +2 -2
  43. package/esm/ui/FieldGroup.svelte +2 -2
  44. package/esm/ui/FieldGroup.svelte.d.ts +4 -4
  45. package/esm/ui/Grid.svelte.d.ts +5 -5
  46. package/esm/ui/dialog/DialogForm.svelte +4 -4
  47. package/esm/ui/dialog/DialogPrimitive.svelte.d.ts +2 -2
  48. package/esm/ui/dialog/FormEditAction.svelte.d.ts +2 -2
  49. package/esm/ui/dialog/dialog.d.ts +5 -5
  50. package/esm/ui/index.d.ts +2 -2
  51. package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +3 -3
  52. package/esm/ui/internals/select/SelectMelt.svelte.d.ts +3 -3
  53. package/esm/ui/internals/select/SelectRadio.svelte.d.ts +2 -2
  54. package/esm/ui/link/LinkPlus.svelte.d.ts +2 -2
  55. package/esm/utils/types.d.ts +0 -15
  56. package/esm/utils/types.js +1 -17
  57. package/esm/virtual/Customer.js +2 -2
  58. package/esm/virtual/FilterEntity.js +1 -1
  59. package/esm/virtual/StateDemoEnum.d.ts +4 -4
  60. package/esm/virtual/StateDemoEnum.js +2 -2
  61. package/esm/virtual/UIEntity.js +4 -4
  62. package/esm/vite/index.js +1 -1
  63. package/package.json +4 -3
  64. package/esm/SqlDatabase/LogToConsoleCustom.d.ts +0 -1
package/esm/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
+ /// <reference types=".pnpm/@sveltejs+kit@2.5.24_@sveltejs+vite-plugin-svelte@3.1.1_svelte@4.2.18_vite@5.4.1_@types+node@_vtylvkjv5lewhfcl4vq2py4rce/node_modules/@sveltejs/kit" />
1
2
  import type { RequestEvent } from '@sveltejs/kit';
2
- import type { FieldMetadata, FindOptionsBase, Repository } from 'remult';
3
+ import type { FindOptionsBase } from 'remult';
3
4
  import { Log } from '@kitql/helpers';
4
- import type { KitBaseEnum, KitBaseEnumOptions, KitIcon } from './KitBaseEnum.js';
5
- import type { KitCellsInput as KitCellsInputForExport } from './kitCellsBuildor.js';
6
- import { kitStoreItem } from './kitStoreItem.js';
7
- import { kitStoreList } from './kitStoreList.js';
5
+ import type { BaseEnum, BaseItem, FF_Icon } from './BaseEnum.js';
6
+ import type { CellsInput as CellsInput_ForExport } from './cellsBuildor.js';
7
+ import { storeItem } from './storeItem.js';
8
+ import { storeList } from './storeList.js';
8
9
  import { default as Button } from './ui/Button.svelte';
9
10
  import { default as Clipboardable } from './ui/Clipboardable.svelte';
10
11
  import { default as DialogManagement } from './ui/dialog/DialogManagement.svelte';
@@ -20,48 +21,37 @@ import { default as Link } from './ui/link/Link.svelte';
20
21
  import { default as LinkPlus } from './ui/link/LinkPlus.svelte';
21
22
  import { default as Loading } from './ui/Loading.svelte';
22
23
  import { default as Tooltip } from './ui/Tooltip.svelte';
23
- export declare const logFirstly: Log;
24
- export declare const KitRole: {
24
+ export { Field, FormEditAction, Grid, GridPaginate, FieldGroup, Icon, Link, LinkPlus, Loading, Button, Tooltip, DialogManagement, FieldContainer, SelectMelt, Clipboardable, };
25
+ export declare const ff_Log: Log;
26
+ export declare const FF_Role: {
25
27
  Admin: string;
26
28
  };
27
- export { Field, FormEditAction, Grid, GridPaginate, FieldGroup, Icon, Link, LinkPlus, Loading, Button, Tooltip, DialogManagement, FieldContainer, SelectMelt, Clipboardable, };
28
- export { dialog } from './ui/dialog/dialog.js';
29
+ export type { BaseEnumOptions } from './BaseEnum.js';
30
+ export type { BaseItem };
31
+ export type BaseItemLight = Partial<BaseItem>;
29
32
  export type { DialogMetaDataInternal } from './ui/dialog/dialog.js';
30
- export { KitBaseEnum, getEnum, getEnums } from './KitBaseEnum.js';
31
- export type { KitBaseEnumOptions } from './KitBaseEnum.js';
32
- export { KitFields } from './KitFields.js';
33
- export { KitEntity } from './KitEntity.js';
34
- export { LogToConsoleCustom } from './SqlDatabase/LogToConsoleCustom.js';
35
- export { getEntityDisplayValue, isError, kitDbNamesOf, getFieldLinkDisplayValue } from './helper.js';
36
- export { buildWhere, getPlaceholder, buildSearchWhere, kitCellsBuildor, kitCellBuildor, fieldsOf, } from './kitCellsBuildor.js';
37
- export { kitStoreItem };
38
- export { kitStoreList };
39
- export type KitCellsInput<entityType> = KitCellsInputForExport<entityType>;
40
- export type { KitCell, VisibilityMode } from './kitCellsBuildor.js';
41
- export type { FindOptionsPlus } from './kitStoreList.js';
42
- export type KitBaseItem = KitBaseEnumOptions & {
43
- id: string;
44
- captionSub?: string | (string | undefined)[];
45
- href?: string;
46
- repo?: Repository<any>;
47
- sub?: {
48
- captionPre?: string;
49
- repo?: Repository<any>;
50
- item?: any;
51
- };
52
- };
53
- export type KitStoreItem<T> = ReturnType<typeof kitStoreItem<T>>;
54
- export type KitStoreList<T> = ReturnType<typeof kitStoreList<T>>;
55
- export type KitBaseItemLight = Partial<KitBaseItem>;
56
- export { FilterEntity } from './virtual/FilterEntity.js';
57
- export { UIEntity } from './virtual/UIEntity.js';
58
- export { LibIcon_Empty, LibIcon_Forbidden, LibIcon_ChevronDown, LibIcon_ChevronUp, LibIcon_ChevronLeft, LibIcon_ChevronRight, LibIcon_Search, LibIcon_Check, LibIcon_MultiCheck, LibIcon_Add, LibIcon_MultiAdd, LibIcon_Edit, LibIcon_Delete, LibIcon_Cross, LibIcon_Save, LibIcon_Man, LibIcon_Woman, LibIcon_Send, LibIcon_Load, LibIcon_Settings, LibIcon_Sort, LibIcon_SortAsc, LibIcon_SortDesc, } from './ui/LibIcon.js';
59
- export type { KitIcon };
33
+ export type CellsInput<entityType> = CellsInput_ForExport<entityType>;
34
+ export type { Cell, VisibilityMode } from './cellsBuildor.js';
35
+ export type { FF_FindOptions } from './storeList.js';
36
+ export type StoreItem<T> = ReturnType<typeof storeItem<T>>;
37
+ export type StoreList<T> = ReturnType<typeof storeList<T>>;
38
+ export type { ResolvedType, UnArray } from './utils/types.js';
39
+ export { FF_Fields } from './FF_Fields.js';
40
+ export { FF_Entity } from './FF_Entity.js';
41
+ export { FF_LogToConsole } from './SqlDatabase/FF_LogToConsole.js';
42
+ export { BaseEnum } from './BaseEnum.js';
43
+ export { dialog } from './ui/dialog/dialog.js';
44
+ export { getEntityDisplayValue, isError, getFieldLinkDisplayValue, getEnum, getEnums, } from './helper.js';
45
+ export { buildWhere, getPlaceholder, buildSearchWhere, cellsBuildor, cellBuildor, fieldsOf, } from './cellsBuildor.js';
46
+ export { storeItem };
47
+ export { storeList };
60
48
  export { displayPhone, arrToStr } from './formats/strings.js';
61
49
  export { displayCurrency } from './formats/numbers.js';
62
50
  export { tw } from './utils/tailwind.js';
63
- export { litOrStr } from './utils/types.js';
64
- export type { ResolvedType, UnArray } from './utils/types.js';
51
+ export { FilterEntity } from './virtual/FilterEntity.js';
52
+ export { UIEntity } from './virtual/UIEntity.js';
53
+ export { LibIcon_Empty, LibIcon_Forbidden, LibIcon_ChevronDown, LibIcon_ChevronUp, LibIcon_ChevronLeft, LibIcon_ChevronRight, LibIcon_Search, LibIcon_Check, LibIcon_MultiCheck, LibIcon_Add, LibIcon_MultiAdd, LibIcon_Edit, LibIcon_Delete, LibIcon_Cross, LibIcon_Save, LibIcon_Man, LibIcon_Woman, LibIcon_Send, LibIcon_Load, LibIcon_Settings, LibIcon_Sort, LibIcon_SortAsc, LibIcon_SortDesc, } from './ui/LibIcon.js';
54
+ export type { FF_Icon };
65
55
  declare module 'remult' {
66
56
  interface RemultContext {
67
57
  url: URL;
@@ -83,16 +73,15 @@ declare module 'remult' {
83
73
  createOptionWhenNoResult?: boolean;
84
74
  multiSelect?: boolean;
85
75
  skipForDefaultField?: boolean;
86
- isHidden?: (item: entityType) => boolean;
87
76
  }
88
77
  interface EntityOptions<entityType> {
89
78
  searchableFind?: (str: string) => FindOptionsBase<entityType>;
90
- displayValue?: (item: entityType) => KitBaseItem;
91
- permissionApiCrud?: KitBaseEnum[] | KitBaseEnum;
92
- permissionApiDelete?: KitBaseEnum[] | KitBaseEnum;
93
- permissionApiInsert?: KitBaseEnum[] | KitBaseEnum;
94
- permissionApiRead?: KitBaseEnum[] | KitBaseEnum;
95
- permissionApiUpdate?: KitBaseEnum[] | KitBaseEnum;
79
+ displayValue?: (item: entityType) => BaseItem;
80
+ permissionApiCrud?: BaseEnum[] | BaseEnum;
81
+ permissionApiDelete?: BaseEnum[] | BaseEnum;
82
+ permissionApiInsert?: BaseEnum[] | BaseEnum;
83
+ permissionApiRead?: BaseEnum[] | BaseEnum;
84
+ permissionApiUpdate?: BaseEnum[] | BaseEnum;
96
85
  }
97
86
  interface UserInfo {
98
87
  session: {
@@ -101,4 +90,3 @@ declare module 'remult' {
101
90
  };
102
91
  }
103
92
  }
104
- export declare const isHidden: (fm: FieldMetadata, row: any) => boolean;
package/esm/index.js CHANGED
@@ -1,8 +1,6 @@
1
- // I'm not sure I can remove this or not ?
2
- // import 'remult'
3
1
  import { Log } from '@kitql/helpers';
4
- import { kitStoreItem } from './kitStoreItem.js';
5
- import { kitStoreList } from './kitStoreList.js';
2
+ import { storeItem } from './storeItem.js';
3
+ import { storeList } from './storeList.js';
6
4
  import { default as Button } from './ui/Button.svelte';
7
5
  import { default as Clipboardable } from './ui/Clipboardable.svelte';
8
6
  import { default as DialogManagement } from './ui/dialog/DialogManagement.svelte';
@@ -18,32 +16,36 @@ import { default as Link } from './ui/link/Link.svelte';
18
16
  import { default as LinkPlus } from './ui/link/LinkPlus.svelte';
19
17
  import { default as Loading } from './ui/Loading.svelte';
20
18
  import { default as Tooltip } from './ui/Tooltip.svelte';
21
- export const logFirstly = new Log('firstly');
22
- export const KitRole = {
23
- Admin: 'KitAdmin',
24
- };
19
+ // ******************************
20
+ // Svelte Components
21
+ // ******************************
25
22
  export { Field, FormEditAction, Grid, GridPaginate, FieldGroup, Icon, Link, LinkPlus, Loading, Button, Tooltip, DialogManagement, FieldContainer, SelectMelt, Clipboardable, };
23
+ // ******************************
24
+ // Objects
25
+ // ******************************
26
+ export const ff_Log = new Log('firstly');
27
+ export const FF_Role = {
28
+ Admin: 'FF_Role.Admin',
29
+ };
30
+ // ******************************
31
+ // Helpers
32
+ // ******************************
33
+ export { FF_Fields } from './FF_Fields.js';
34
+ export { FF_Entity } from './FF_Entity.js';
35
+ export { FF_LogToConsole } from './SqlDatabase/FF_LogToConsole.js';
36
+ export { BaseEnum } from './BaseEnum.js';
26
37
  export { dialog } from './ui/dialog/dialog.js';
27
- export { KitBaseEnum, getEnum, getEnums } from './KitBaseEnum.js';
28
- export { KitFields } from './KitFields.js';
29
- export { KitEntity } from './KitEntity.js';
30
- export { LogToConsoleCustom } from './SqlDatabase/LogToConsoleCustom.js';
31
- export { getEntityDisplayValue, isError, kitDbNamesOf, getFieldLinkDisplayValue } from './helper.js';
32
- export { buildWhere, getPlaceholder, buildSearchWhere, kitCellsBuildor, kitCellBuildor, fieldsOf, } from './kitCellsBuildor.js';
33
- export { kitStoreItem };
34
- export { kitStoreList };
38
+ export { getEntityDisplayValue, isError, getFieldLinkDisplayValue, getEnum, getEnums, } from './helper.js';
39
+ export { buildWhere, getPlaceholder, buildSearchWhere, cellsBuildor, cellBuildor, fieldsOf, } from './cellsBuildor.js';
40
+ export { storeItem };
41
+ export { storeList };
42
+ export { displayPhone, arrToStr } from './formats/strings.js';
43
+ export { displayCurrency } from './formats/numbers.js';
44
+ export { tw } from './utils/tailwind.js';
45
+ // Hummm... I don't know if we should keep it...
35
46
  export { FilterEntity } from './virtual/FilterEntity.js';
36
47
  export { UIEntity } from './virtual/UIEntity.js';
48
+ // ******************************
37
49
  // Icons
50
+ // ******************************
38
51
  export { LibIcon_Empty, LibIcon_Forbidden, LibIcon_ChevronDown, LibIcon_ChevronUp, LibIcon_ChevronLeft, LibIcon_ChevronRight, LibIcon_Search, LibIcon_Check, LibIcon_MultiCheck, LibIcon_Add, LibIcon_MultiAdd, LibIcon_Edit, LibIcon_Delete, LibIcon_Cross, LibIcon_Save, LibIcon_Man, LibIcon_Woman, LibIcon_Send, LibIcon_Load, LibIcon_Settings, LibIcon_Sort, LibIcon_SortAsc, LibIcon_SortDesc, } from './ui/LibIcon.js';
39
- // Formats & Utils
40
- export { displayPhone, arrToStr } from './formats/strings.js';
41
- export { displayCurrency } from './formats/numbers.js';
42
- export { tw } from './utils/tailwind.js';
43
- export { litOrStr } from './utils/types.js';
44
- export const isHidden = (fm, row) => {
45
- if (fm.options.isHidden) {
46
- return fm.options.isHidden(row);
47
- }
48
- return false;
49
- };
@@ -6,7 +6,7 @@ type TheStoreItem<T> = {
6
6
  errors: ErrorInfo<T> | undefined;
7
7
  globalError?: string | undefined;
8
8
  };
9
- export declare const kitStoreItem: <T>(repo: Repository<T>, initValues?: TheStoreItem<T>) => {
9
+ export declare const storeItem: <T>(repo: Repository<T>, initValues?: TheStoreItem<T>) => {
10
10
  subscribe: (this: void, run: import("svelte/store").Subscriber<TheStoreItem<T>>, invalidate?: import("svelte/store").Invalidator<TheStoreItem<T>> | undefined) => import("svelte/store").Unsubscriber;
11
11
  create: (item: Partial<T>) => void;
12
12
  set: (newItem: TheStoreItem<T>) => void;
@@ -2,7 +2,7 @@ import { BROWSER } from 'esm-env';
2
2
  import { derived, get, writable } from 'svelte/store';
3
3
  import { Log } from '@kitql/helpers';
4
4
  import { isError } from './helper';
5
- export const kitStoreItem = (repo, initValues = {
5
+ export const storeItem = (repo, initValues = {
6
6
  item: undefined,
7
7
  loading: true,
8
8
  errors: undefined,
@@ -5,7 +5,7 @@ type TheStoreList<T> = {
5
5
  loading: boolean;
6
6
  totalCount: number | undefined;
7
7
  };
8
- export type FindOptionsPlus<T> = FindOptions<T> & {
8
+ export type FF_FindOptions<T> = FindOptions<T> & {
9
9
  withCount?: boolean;
10
10
  withItems?: boolean;
11
11
  };
@@ -23,11 +23,11 @@ export type FindOptionsPlus<T> = FindOptions<T> & {
23
23
  * $: browser && tasks.listen(data.options)
24
24
  * ```
25
25
  */
26
- export declare const kitStoreList: <T>(repo: Repository<T>, initValues?: TheStoreList<T>) => {
26
+ export declare const storeList: <T>(repo: Repository<T>, initValues?: TheStoreList<T>) => {
27
27
  subscribe: (this: void, run: import("svelte/store").Subscriber<TheStoreList<T>>, invalidate?: import("svelte/store").Invalidator<TheStoreList<T>> | undefined) => import("svelte/store").Unsubscriber;
28
28
  manualSet: (info: TheStoreList<T>) => void;
29
- fetch: (options?: FindOptionsPlus<T>, onNewData?: ((items?: T[], totalCount?: number) => void) | undefined) => Promise<void>;
30
- listen: (options?: FindOptionsPlus<T>) => Promise<void>;
29
+ fetch: (options?: FF_FindOptions<T>, onNewData?: ((items?: T[], totalCount?: number) => void) | undefined) => Promise<void>;
30
+ listen: (options?: FF_FindOptions<T>) => Promise<void>;
31
31
  getRepo: () => Repository<T>;
32
32
  };
33
33
  export {};
@@ -15,7 +15,7 @@ import { writable } from 'svelte/store';
15
15
  * $: browser && tasks.listen(data.options)
16
16
  * ```
17
17
  */
18
- export const kitStoreList = (repo, initValues = { items: [], loading: true, totalCount: undefined }) => {
18
+ export const storeList = (repo, initValues = { items: [], loading: true, totalCount: undefined }) => {
19
19
  const { subscribe, set, update } = writable(initValues);
20
20
  let unSub = null;
21
21
  onDestroy(async () => {
@@ -1,7 +1,7 @@
1
1
  <script>import { createTooltip } from "@melt-ui/svelte";
2
2
  import { fade, fly } from "svelte/transition";
3
3
  import { remult } from "remult";
4
- import { KitBaseEnum, tw } from "../";
4
+ import { BaseEnum, tw } from "../";
5
5
  export let isLoading = false;
6
6
  let className = void 0;
7
7
  export { className as class };
@@ -1,11 +1,11 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import { KitBaseEnum } from '../';
2
+ import { BaseEnum } from '../';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  [x: string]: any;
6
6
  isLoading?: boolean | undefined;
7
7
  class?: string | undefined | null;
8
- permission?: KitBaseEnum[] | KitBaseEnum | undefined;
8
+ permission?: BaseEnum[] | BaseEnum | undefined;
9
9
  };
10
10
  events: {
11
11
  click: MouseEvent;
@@ -1,9 +1,9 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import { type KitCell } from '../';
2
+ import { type Cell } from '../';
3
3
  declare class __sveltets_Render<T extends Record<any, any>> {
4
4
  props(): {
5
5
  [x: string]: any;
6
- cell: KitCell<T>;
6
+ cell: Cell<T>;
7
7
  value?: any;
8
8
  cellsValues?: any;
9
9
  withDedounce?: boolean | undefined;
@@ -1,6 +1,6 @@
1
1
  <script generics="T extends Record<any, any>">import { createEventDispatcher } from "svelte";
2
2
  import { getRelationFieldInfo } from "remult/internals";
3
- import { isHidden, tw } from "..";
3
+ import { tw } from "../";
4
4
  import Field from "./Field.svelte";
5
5
  import FieldContainer from "./internals/FieldContainer.svelte";
6
6
  import Loading from "./Loading.svelte";
@@ -55,7 +55,7 @@ function isToFocus(currentKey, focusKey2, i) {
55
55
  {@const focus = isToFocus(cell.field?.key, focusKey, i)}
56
56
  {#if shouldHide(cell, mode)}
57
57
  <!-- Do nothing -->
58
- {:else if cell.field && isHidden(cell.field, $store.item)}
58
+ {:else if cell.field && !cell.field.includedInApi($store.item)}
59
59
  <!-- Do nothing, but keep the class... -->
60
60
  <div class={cell.class}></div>
61
61
  {:else}
@@ -1,12 +1,12 @@
1
1
  import { SvelteComponent } from "svelte";
2
2
  import type { FieldMetadata } from 'remult';
3
- import { type KitStoreItem } from '..';
4
- import type { KitCell } from '../kitCellsBuildor';
3
+ import { type StoreItem } from '../';
4
+ import type { Cell } from '../cellsBuildor';
5
5
  declare class __sveltets_Render<T extends Record<any, any>> {
6
6
  props(): {
7
7
  mode?: ("view" | "edit" | "filtre") | undefined;
8
- cells: KitCell<T>[];
9
- store: KitStoreItem<T>;
8
+ cells: Cell<T>[];
9
+ store: StoreItem<T>;
10
10
  focusKey?: string | null | undefined;
11
11
  };
12
12
  events(): {
@@ -1,11 +1,11 @@
1
1
  import { SvelteComponent } from "svelte";
2
2
  import type { EntityOrderBy } from 'remult';
3
- import { type KitStoreList } from '../index.js';
4
- import type { KitCell } from '../kitCellsBuildor.js';
3
+ import type { Cell } from '../cellsBuildor.js';
4
+ import { type StoreList } from '../index.js';
5
5
  declare class __sveltets_Render<T extends Record<any, any>> {
6
6
  props(): {
7
- cells: KitCell<T>[];
8
- store: KitStoreList<T>;
7
+ cells: Cell<T>[];
8
+ store: StoreList<T>;
9
9
  withAdd?: boolean | undefined;
10
10
  withEdit?: boolean | undefined;
11
11
  withDelete?: boolean | undefined;
@@ -33,7 +33,7 @@ declare class __sveltets_Render<T extends Record<any, any>> {
33
33
  cell: {
34
34
  row: T;
35
35
  field: import("remult").FieldMetadata<any, T> | undefined;
36
- cell: KitCell<T>;
36
+ cell: Cell<T>;
37
37
  };
38
38
  extra: {};
39
39
  };
@@ -1,11 +1,11 @@
1
- <script>import { FieldGroup, kitStoreItem } from "../..";
2
- import { kitCellsBuildor } from "../../kitCellsBuildor";
1
+ <script>import { FieldGroup, storeItem } from "../..";
2
+ import { cellsBuildor } from "../../cellsBuildor";
3
3
  import { dialog } from "./dialog";
4
4
  import DialogPrimitive from "./DialogPrimitive.svelte";
5
5
  import FormEditAction from "./FormEditAction.svelte";
6
6
  export let toShow;
7
- $: cells = kitCellsBuildor(toShow.repo, toShow.cells);
8
- $: store = toShow.store ?? kitStoreItem(toShow.repo);
7
+ $: cells = cellsBuildor(toShow.repo, toShow.cells);
8
+ $: store = toShow.store ?? storeItem(toShow.repo);
9
9
  $: {
10
10
  if (toShow.type === "update" || toShow.type === "view") {
11
11
  store.set({ item: toShow.defaults, errors: {}, loading: false, globalError: void 0 });
@@ -1,8 +1,8 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import { type KitBaseItemLight } from '../../';
2
+ import { type BaseItemLight } from '../../';
3
3
  declare const __propDef: {
4
4
  props: {
5
- detail?: KitBaseItemLight | undefined;
5
+ detail?: BaseItemLight | undefined;
6
6
  open?: boolean | undefined;
7
7
  classes?: {
8
8
  root?: string | undefined;
@@ -1,10 +1,10 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import type { KitStoreItem } from '../..';
2
+ import type { StoreItem } from '../..';
3
3
  import type { DialogType } from './dialog';
4
4
  declare class __sveltets_Render<T extends any> {
5
5
  props(): {
6
6
  [x: string]: any;
7
- store: KitStoreItem<T>;
7
+ store: StoreItem<T>;
8
8
  type: DialogType;
9
9
  wDelete?: boolean | undefined;
10
10
  textCreate?: string | undefined;
@@ -1,6 +1,6 @@
1
1
  import type { SvelteComponent } from 'svelte';
2
2
  import type { Repository } from 'remult';
3
- import { type KitBaseItemLight, type KitCellsInput, type KitStoreItem } from '../../';
3
+ import { type BaseItemLight, type CellsInput, type StoreItem } from '../../';
4
4
  export type DialogClasses = {
5
5
  /**
6
6
  * for example `overflow-auto` to have a scrollbar in the dialog
@@ -10,10 +10,10 @@ export type DialogClasses = {
10
10
  };
11
11
  export type FormGrid = 'grid-cols-1' | 'grid-cols-2' | 'grid-cols-3' | 'grid-cols-4' | 'grid-cols-1 lg:grid-cols-4';
12
12
  export type DialogMetaData<entityType = any> = {
13
- detail?: KitBaseItemLight;
13
+ detail?: BaseItemLight;
14
14
  repo?: Repository<entityType>;
15
- store?: KitStoreItem<entityType>;
16
- cells?: KitCellsInput<entityType>;
15
+ store?: StoreItem<entityType>;
16
+ cells?: CellsInput<entityType>;
17
17
  defaults?: Partial<entityType>;
18
18
  classes?: DialogClasses;
19
19
  component?: new (...args: any[]) => SvelteComponent;
@@ -37,7 +37,7 @@ export type DialogMetaDataInternal<entityType = any> = DialogMetaData<entityType
37
37
  export declare const dialog: {
38
38
  confirm: (topic: string, text: string, icon?: string) => Promise<ResultClose<any>>;
39
39
  confirmDelete: (topic: string) => Promise<ResultClose<any>>;
40
- form: <entityType>(type: 'insert' | 'update' | 'view', topic: string, repo: Repository<entityType>, cells: KitCellsInput<entityType>, options?: {
40
+ form: <entityType>(type: 'insert' | 'update' | 'view', topic: string, repo: Repository<entityType>, cells: CellsInput<entityType>, options?: {
41
41
  defaults?: Partial<entityType>;
42
42
  classes?: DialogClasses;
43
43
  noThrow?: boolean;
package/esm/ui/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { FieldMetadata } from 'remult';
2
- import type { KitCell } from '../';
2
+ import type { Cell } from '../';
3
3
  export type Align = 'text-left' | 'text-center' | 'text-right';
4
4
  export declare const align: (f?: FieldMetadata, isSlot?: boolean) => Align;
5
- export declare const getAligns: (cells: KitCell<any>[], withAction: boolean) => Align[];
5
+ export declare const getAligns: (cells: Cell<any>[], withAction: boolean) => Align[];
@@ -1,13 +1,13 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import { type KitBaseItem } from '../../..';
2
+ import { type BaseItem } from '../../..';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  id: string;
6
6
  disabled?: boolean | undefined;
7
7
  placeholder?: string | undefined;
8
- items?: KitBaseItem[] | undefined;
8
+ items?: BaseItem[] | undefined;
9
9
  loadOptions?: ((str: string) => Promise<{
10
- items: KitBaseItem[];
10
+ items: BaseItem[];
11
11
  totalCount: number;
12
12
  }>) | undefined;
13
13
  values?: string[] | undefined;
@@ -1,14 +1,14 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import { type KitBaseItem } from '../../../';
2
+ import { type BaseItem } from '../../../';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  id: string;
6
6
  disabled?: boolean | undefined;
7
7
  placeholder?: string | undefined;
8
- items?: KitBaseItem[] | undefined;
8
+ items?: BaseItem[] | undefined;
9
9
  focus?: boolean | undefined;
10
10
  loadOptions?: ((str: string) => Promise<{
11
- items: KitBaseItem[];
11
+ items: BaseItem[];
12
12
  totalCount: number;
13
13
  }>) | undefined;
14
14
  value?: string | undefined;
@@ -1,11 +1,11 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import type { KitBaseItem } from '../../../';
2
+ import type { BaseItem } from '../../../';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  id: string;
6
6
  disabled?: boolean | undefined;
7
7
  placeholder?: string | undefined;
8
- items?: KitBaseItem[] | undefined;
8
+ items?: BaseItem[] | undefined;
9
9
  value?: string | number | undefined;
10
10
  };
11
11
  events: {
@@ -1,8 +1,8 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import { type KitBaseItemLight } from '../..';
2
+ import { type BaseItemLight } from '../..';
3
3
  declare const __propDef: {
4
4
  props: {
5
- item: KitBaseItemLight | undefined;
5
+ item: BaseItemLight | undefined;
6
6
  noIcon?: boolean | undefined;
7
7
  captionSubStyle?: "none" | "under" | "inline" | undefined;
8
8
  };
@@ -1,17 +1,2 @@
1
- /**
2
- *
3
- * ```ts
4
- * type KnownTypes = 'password' | 'otp' | 'oAuths' | 'demo'
5
- *
6
- * // literal or string
7
- * const knownType = litOrStr<KnownTypes>('demo')
8
- * const escapedType = litOrStr('coucou')
9
- *
10
- * // literal[] or string[]
11
- * const knownType = litOrStr<KnownTypes[]>(['demo', 'oAuths'])
12
- * const escapedType = litOrStr(['hello', 'coucou'])
13
- * ```
14
- */
15
- export declare function litOrStr<T extends string | string[]>(value: T): T;
16
1
  export type ResolvedType<T> = T extends Promise<infer R> ? R : T;
17
2
  export type UnArray<T extends any[]> = T extends (infer U)[] ? U : never;
@@ -1,17 +1 @@
1
- /**
2
- *
3
- * ```ts
4
- * type KnownTypes = 'password' | 'otp' | 'oAuths' | 'demo'
5
- *
6
- * // literal or string
7
- * const knownType = litOrStr<KnownTypes>('demo')
8
- * const escapedType = litOrStr('coucou')
9
- *
10
- * // literal[] or string[]
11
- * const knownType = litOrStr<KnownTypes[]>(['demo', 'oAuths'])
12
- * const escapedType = litOrStr(['hello', 'coucou'])
13
- * ```
14
- */
15
- export function litOrStr(value) {
16
- return value;
17
- }
1
+ export {};
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { Entity, Fields } from 'remult';
8
- import { KitFields } from '../KitFields';
8
+ import { FF_Fields } from '../FF_Fields';
9
9
  let Customer = class Customer {
10
10
  id;
11
11
  name;
@@ -14,7 +14,7 @@ __decorate([
14
14
  Fields.cuid()
15
15
  ], Customer.prototype, "id", void 0);
16
16
  __decorate([
17
- KitFields.string({ caption: 'Nom de la société', placeholder: 'Dynamic Process' })
17
+ FF_Fields.string({ caption: 'Nom de la société', placeholder: 'Dynamic Process' })
18
18
  ], Customer.prototype, "name", void 0);
19
19
  Customer = __decorate([
20
20
  Entity('customers', {
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { Entity, Fields } from 'remult';
8
- // import { KitFields } from '../KitFields.js'
8
+ // import { FF_Fields } from '../FF_Fields.js'
9
9
  let FilterEntity = class FilterEntity {
10
10
  search = '';
11
11
  title = '';
@@ -1,9 +1,9 @@
1
- import { KitBaseEnum } from '../KitBaseEnum';
2
- import type { KitBaseEnumOptions } from '../KitBaseEnum';
1
+ import { BaseEnum } from '../BaseEnum';
2
+ import type { BaseEnumOptions } from '../BaseEnum';
3
3
  import '../ui/LibIcon';
4
- export declare class StateDemoEnum extends KitBaseEnum {
4
+ export declare class StateDemoEnum extends BaseEnum {
5
5
  static CHECK: StateDemoEnum;
6
6
  static EDIT: StateDemoEnum;
7
7
  static DELETE: StateDemoEnum;
8
- constructor(id: string, options?: KitBaseEnumOptions<StateDemoEnum>);
8
+ constructor(id: string, options?: BaseEnumOptions<StateDemoEnum>);
9
9
  }
@@ -6,10 +6,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  var StateDemoEnum_1;
8
8
  import { ValueListFieldType } from 'remult';
9
- import { KitBaseEnum } from '../KitBaseEnum';
9
+ import { BaseEnum } from '../BaseEnum';
10
10
  import '../ui/LibIcon';
11
11
  import { LibIcon_Add, LibIcon_Delete, LibIcon_Edit } from '../ui/LibIcon';
12
- let StateDemoEnum = class StateDemoEnum extends KitBaseEnum {
12
+ let StateDemoEnum = class StateDemoEnum extends BaseEnum {
13
13
  static { StateDemoEnum_1 = this; }
14
14
  static CHECK = new StateDemoEnum_1('CHECK', {
15
15
  caption: 'Check',
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { Entity, Field, Fields } from 'remult';
8
- import { KitFields } from '../KitFields.js';
8
+ import { FF_Fields } from '../FF_Fields.js';
9
9
  import { StateDemoEnum } from './StateDemoEnum.js';
10
10
  let UIEntity = class UIEntity {
11
11
  id;
@@ -39,13 +39,13 @@ __decorate([
39
39
  Fields.updatedAt()
40
40
  ], UIEntity.prototype, "updatedAt", void 0);
41
41
  __decorate([
42
- KitFields.string({ caption: "Nom de l'utilisateur", placeholder: 'Jean-Yves', suffix: 'sdsd' })
42
+ FF_Fields.string({ caption: "Nom de l'utilisateur", placeholder: 'Jean-Yves', suffix: 'sdsd' })
43
43
  ], UIEntity.prototype, "username", void 0);
44
44
  __decorate([
45
45
  Fields.string({ caption: 'E Mail', inputType: 'email', placeholder: 'prénom.nom@se.com' })
46
46
  ], UIEntity.prototype, "email", void 0);
47
47
  __decorate([
48
- KitFields.string({
48
+ FF_Fields.string({
49
49
  caption: 'Mot de passe',
50
50
  inputType: 'password',
51
51
  placeholder: '********',
@@ -73,7 +73,7 @@ __decorate([
73
73
  Fields.date({ allowNull: true, allowApiUpdate: false })
74
74
  ], UIEntity.prototype, "arrivalDate", void 0);
75
75
  __decorate([
76
- KitFields.dateOnly({ allowNull: true })
76
+ FF_Fields.dateOnly({ allowNull: true })
77
77
  ], UIEntity.prototype, "arrivalDateOnly", void 0);
78
78
  UIEntity = __decorate([
79
79
  Entity('uiEntities', {