@medyll/idae-machine 0.128.0 → 0.135.2
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/LICENSE +21 -21
- package/README.md +360 -393
- package/cli.js +46 -0
- package/dist/demo/dbSchema.d.ts +446 -0
- package/dist/demo/dbSchema.js +449 -0
- package/dist/demo/testScheme.d.ts +56 -0
- package/dist/demo/testScheme.js +42 -0
- package/dist/form/CreateUpdate.svelte +219 -0
- package/dist/{demo/form → form}/CreateUpdate.svelte.d.ts +5 -7
- package/dist/form/DataProvider.svelte +23 -0
- package/dist/form/DataProvider.svelte.d.ts +7 -0
- package/dist/form/FieldInPlace.svelte +98 -0
- package/dist/form/FieldInPlace.svelte.d.ts +14 -0
- package/dist/form/FieldValue.svelte +148 -0
- package/dist/{demo/form → form}/FieldValue.svelte.d.ts +8 -9
- package/dist/fragments/Confirm.svelte +73 -58
- package/dist/fragments/Confirm.svelte.d.ts +4 -8
- package/dist/fragments/Frame.svelte +19 -19
- package/dist/fragments/InfoLine.svelte +21 -21
- package/dist/fragments/Selector.svelte +26 -26
- package/dist/fragments/Skeleton.svelte +21 -21
- package/dist/index.d.ts +20 -28
- package/dist/index.js +20 -28
- package/dist/main/machine/MachineError.d.ts +33 -0
- package/dist/main/machine/MachineError.js +49 -0
- package/dist/main/machine/MachineErrorValidation.d.ts +19 -0
- package/dist/main/machine/MachineErrorValidation.js +24 -0
- package/dist/main/machine/MachineFieldType.d.ts +121 -0
- package/dist/main/machine/MachineFieldType.js +250 -0
- package/dist/main/machine/MachineScheme.d.ts +84 -0
- package/dist/main/machine/MachineScheme.js +146 -0
- package/dist/main/machine/MachineSchemeField.d.ts +19 -0
- package/dist/main/machine/MachineSchemeField.js +51 -0
- package/dist/main/machine/MachineSchemeFieldForge.d.ts +84 -0
- package/dist/main/machine/MachineSchemeFieldForge.js +128 -0
- package/dist/main/machine/MachineSchemeFieldValues.d.ts +69 -0
- package/dist/main/machine/MachineSchemeFieldValues.js +94 -0
- package/dist/main/machine/MachineSchemeValidate.d.ts +51 -0
- package/dist/main/machine/MachineSchemeValidate.js +120 -0
- package/dist/main/machine/MachineSchemeValues.d.ts +109 -0
- package/dist/main/machine/{IDbCollectionValues.js → MachineSchemeValues.js} +116 -41
- package/dist/main/machine/SchemeFieldDefaultValues.d.ts +74 -0
- package/dist/main/machine/SchemeFieldDefaultValues.js +98 -0
- package/dist/main/machine.d.ts +71 -44
- package/dist/main/machine.js +74 -43
- package/dist/main/machineDb.d.ts +14 -56
- package/dist/main/machineDb.js +15 -98
- package/dist/main/{machineForge.d.ts → machineParserForge.d.ts} +15 -25
- package/dist/main/{machineForge.js → machineParserForge.js} +16 -10
- package/dist/ui/CollectionButton.svelte +29 -26
- package/dist/ui/CollectionButton.svelte.d.ts +3 -3
- package/dist/ui/CollectionFks.svelte +24 -24
- package/dist/ui/CollectionFks.svelte.d.ts +2 -2
- package/dist/ui/CollectionList.svelte +100 -95
- package/dist/ui/CollectionList.svelte.d.ts +1 -2
- package/dist/ui/CollectionListFieldValues.svelte +59 -0
- package/dist/ui/CollectionListFieldValues.svelte.d.ts +9 -0
- package/dist/ui/CollectionListMenu.svelte +39 -47
- package/dist/ui/CollectionListMenu.svelte.d.ts +1 -1
- package/dist/ui/CollectionReverseFks.svelte +37 -56
- package/dist/ui/CollectionReverseFks.svelte.d.ts +4 -8
- package/package.json +18 -5
- package/dist/db/dbSchema.d.ts +0 -201
- package/dist/db/dbSchema.js +0 -205
- package/dist/db/fieldTypes.d.ts +0 -13
- package/dist/db/fieldTypes.js +0 -67
- package/dist/db/types.d.ts +0 -124
- package/dist/demo/form/CreateUpdate.svelte +0 -198
- package/dist/demo/form/CrudZone.svelte +0 -22
- package/dist/demo/form/CrudZone.svelte.d.ts +0 -29
- package/dist/demo/form/DataProvider.svelte +0 -20
- package/dist/demo/form/DataProvider.svelte.d.ts +0 -9
- package/dist/demo/form/FieldInPlace.svelte +0 -49
- package/dist/demo/form/FieldInPlace.svelte.d.ts +0 -11
- package/dist/demo/form/FieldValue.svelte +0 -212
- package/dist/demo/form/types.js +0 -1
- package/dist/demo/testDbSchema.d.ts +0 -6
- package/dist/demo/testDbSchema.js +0 -58
- package/dist/demo/types.d.ts +0 -140
- package/dist/demo/types.js +0 -1
- package/dist/fragments/List.svelte +0 -21
- package/dist/fragments/List.svelte.d.ts +0 -38
- package/dist/main/machine/IDbCollection.d.ts +0 -71
- package/dist/main/machine/IDbCollection.js +0 -102
- package/dist/main/machine/IDbCollectionFieldForge.d.ts +0 -42
- package/dist/main/machine/IDbCollectionFieldForge.js +0 -74
- package/dist/main/machine/IDbCollectionFieldValues.d.ts +0 -57
- package/dist/main/machine/IDbCollectionFieldValues.js +0 -82
- package/dist/main/machine/IDbCollectionValues.d.ts +0 -78
- package/dist/main/machine/IDbError.d.ts +0 -6
- package/dist/main/machine/IDbError.js +0 -61
- package/dist/main/machine/IDbFormValidate.d.ts +0 -55
- package/dist/main/machine/IDbFormValidate.js +0 -183
- package/dist/main/machine/IDbValidationError.d.ts +0 -19
- package/dist/main/machine/IDbValidationError.js +0 -24
- package/dist/main/machine/types.d.ts +0 -1
- package/dist/main/machine/types.js +0 -1
- package/dist/ui/CollectionFieldGuess.svelte +0 -29
- package/dist/ui/CollectionFieldGuess.svelte.d.ts +0 -11
- /package/dist/{demo/form → form}/types.d.ts +0 -0
- /package/dist/{db → form}/types.js +0 -0
|
@@ -1,58 +1,73 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
{
|
|
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
|
-
|
|
1
|
+
|
|
2
|
+
<!--
|
|
3
|
+
Confirm.svelte
|
|
4
|
+
Svelte 5 confirm/cancel fragment
|
|
5
|
+
@role fragment
|
|
6
|
+
@prop {Function} validate - Validation callback
|
|
7
|
+
@prop {string} [message] - Confirm message
|
|
8
|
+
@slot initial - Initial content
|
|
9
|
+
@slot children - Button content
|
|
10
|
+
@slot confirm - Confirm button content (optional)
|
|
11
|
+
@slot cancel - Cancel button content (optional)
|
|
12
|
+
@event confirm - Emitted on confirm
|
|
13
|
+
@event cancel - Emitted on cancel
|
|
14
|
+
-->
|
|
15
|
+
|
|
16
|
+
<script lang="ts">
|
|
17
|
+
import { Icon } from '@medyll/idae-slotui-svelte';
|
|
18
|
+
let { validate, message = undefined } = $props<{ validate: Function; message?: string }>();
|
|
19
|
+
let status = $state('default');
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
{#snippet initial()}
|
|
23
|
+
<!-- Default initial content: empty -->
|
|
24
|
+
{/snippet}
|
|
25
|
+
|
|
26
|
+
{#snippet children()}
|
|
27
|
+
<Icon icon="mdi:pencil" class="md" />
|
|
28
|
+
{/snippet}
|
|
29
|
+
|
|
30
|
+
{#snippet confirm(message)}
|
|
31
|
+
{message ?? ''}
|
|
32
|
+
<Icon class="color-success md text-green-800" icon="mdi:done" />
|
|
33
|
+
{/snippet}
|
|
34
|
+
|
|
35
|
+
{#snippet cancel()}
|
|
36
|
+
<Icon icon="typcn:cancel" style="color: red" class="md fill-red-800" />
|
|
37
|
+
{/snippet}
|
|
38
|
+
|
|
39
|
+
<div class="line-gap-2 w-full">
|
|
40
|
+
{@render initial()}
|
|
41
|
+
{#if status === 'default'}
|
|
42
|
+
<button
|
|
43
|
+
class="line-gap-2"
|
|
44
|
+
aria-label="Editer"
|
|
45
|
+
onclick={() => { status = 'show_confirm'; }}
|
|
46
|
+
>
|
|
47
|
+
{@render children()}
|
|
48
|
+
</button>
|
|
49
|
+
{/if}
|
|
50
|
+
{#if status === 'show_confirm'}
|
|
51
|
+
<button
|
|
52
|
+
aria-label="Confirmer"
|
|
53
|
+
onclick={() => { validate?.(); status = 'default'; }}
|
|
54
|
+
>
|
|
55
|
+
{@render confirm(message)}
|
|
56
|
+
</button>
|
|
57
|
+
<button
|
|
58
|
+
aria-label="Annuler"
|
|
59
|
+
onclick={() => { status = 'default'; }}
|
|
60
|
+
>
|
|
61
|
+
{@render cancel()}
|
|
62
|
+
</button>
|
|
63
|
+
{/if}
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<style>
|
|
67
|
+
@reference "../../styles/references.css";
|
|
68
|
+
svg {
|
|
69
|
+
> path {
|
|
70
|
+
color: red !important;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
</style>
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
collection: string;
|
|
3
|
-
field: string;
|
|
1
|
+
type $$ComponentProps = {
|
|
4
2
|
validate: Function;
|
|
5
|
-
message?: string
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
declare const Confirm: import("svelte").Component<ConfirmProps, {}, "">;
|
|
3
|
+
message?: string;
|
|
4
|
+
};
|
|
5
|
+
declare const Confirm: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
10
6
|
type Confirm = ReturnType<typeof Confirm>;
|
|
11
7
|
export default Confirm;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { slide } from 'svelte/transition';
|
|
3
|
-
|
|
4
|
-
export let showPanel: boolean = true;
|
|
5
|
-
export let panelMode: 'expanded' | 'reduced' = 'expanded';
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<div class="relative flex h-full gap-4">
|
|
9
|
-
{#if showPanel}
|
|
10
|
-
<div transition:slide={{ axis: 'x' }} class="paper h-64 w-64 overflow-auto overflow-x-hidden">
|
|
11
|
-
<slot name="leftNav" />
|
|
12
|
-
</div>
|
|
13
|
-
{/if}
|
|
14
|
-
<div class="flex-1">
|
|
15
|
-
<div class="flex h-full w-96 flex-col gap-1">
|
|
16
|
-
<slot />
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { slide } from 'svelte/transition';
|
|
3
|
+
|
|
4
|
+
export let showPanel: boolean = true;
|
|
5
|
+
export let panelMode: 'expanded' | 'reduced' = 'expanded';
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div class="relative flex h-full gap-4">
|
|
9
|
+
{#if showPanel}
|
|
10
|
+
<div transition:slide={{ axis: 'x' }} class="paper h-64 w-64 overflow-auto overflow-x-hidden">
|
|
11
|
+
<slot name="leftNav" />
|
|
12
|
+
</div>
|
|
13
|
+
{/if}
|
|
14
|
+
<div class="flex-1">
|
|
15
|
+
<div class="flex h-full w-96 flex-col gap-1">
|
|
16
|
+
<slot />
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
let className = '';
|
|
3
|
-
export let title: string | undefined = undefined;
|
|
4
|
-
export let vertical: boolean = false;
|
|
5
|
-
export { className as class };
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
{#if $$slots.input && !title}
|
|
9
|
-
<div class="w-full py-2 text-sm font-semibold">
|
|
10
|
-
{title}
|
|
11
|
-
</div>
|
|
12
|
-
{/if}
|
|
13
|
-
<div class="{vertical ? 'flex-v' : 'flex-align-middle'} gap-4 py-4">
|
|
14
|
-
<div class="flex flex-1 text-sm">
|
|
15
|
-
<div class="flex-1 font-semibold"><slot name="input">- {title}</slot></div>
|
|
16
|
-
<slot name="titleButton" />
|
|
17
|
-
</div>
|
|
18
|
-
<div class="{vertical ? 'px-2' : ''} {className}">
|
|
19
|
-
<slot />
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let className = '';
|
|
3
|
+
export let title: string | undefined = undefined;
|
|
4
|
+
export let vertical: boolean = false;
|
|
5
|
+
export { className as class };
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
{#if $$slots.input && !title}
|
|
9
|
+
<div class="w-full py-2 text-sm font-semibold">
|
|
10
|
+
{title}
|
|
11
|
+
</div>
|
|
12
|
+
{/if}
|
|
13
|
+
<div class="{vertical ? 'flex-v' : 'flex-align-middle'} gap-4 py-4">
|
|
14
|
+
<div class="flex flex-1 text-sm">
|
|
15
|
+
<div class="flex-1 font-semibold"><slot name="input">- {title}</slot></div>
|
|
16
|
+
<slot name="titleButton" />
|
|
17
|
+
</div>
|
|
18
|
+
<div class="{vertical ? 'px-2' : ''} {className}">
|
|
19
|
+
<slot />
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
let className = '';
|
|
3
|
-
export let values: any = [];
|
|
4
|
-
export let value: any | undefined = undefined;
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
{#each values as valueO}
|
|
8
|
-
<div class={' ' + (valueO == value ? 'active ' : 'inactive')}>
|
|
9
|
-
<slot item={valueO} active={valueO === value} />
|
|
10
|
-
</div>
|
|
11
|
-
{/each}
|
|
12
|
-
{#if !values.length}
|
|
13
|
-
<slot name="selectorFallback" />
|
|
14
|
-
{/if}
|
|
15
|
-
|
|
16
|
-
<style>
|
|
17
|
-
@reference "../../styles/references.css";
|
|
18
|
-
.active {
|
|
19
|
-
@apply border border-b-2 border-neutral-500; /* active */
|
|
20
|
-
}
|
|
21
|
-
.inactive {
|
|
22
|
-
@apply border border-b-2 border-transparent opacity-60; /* inactive */
|
|
23
|
-
}
|
|
24
|
-
/* @apply border border-b-2 border-neutral-500;
|
|
25
|
-
@apply opacity-60 border border-b-2 border-transparent; */
|
|
26
|
-
</style>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let className = '';
|
|
3
|
+
export let values: any = [];
|
|
4
|
+
export let value: any | undefined = undefined;
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
{#each values as valueO}
|
|
8
|
+
<div class={' ' + (valueO == value ? 'active ' : 'inactive')}>
|
|
9
|
+
<slot item={valueO} active={valueO === value} />
|
|
10
|
+
</div>
|
|
11
|
+
{/each}
|
|
12
|
+
{#if !values.length}
|
|
13
|
+
<slot name="selectorFallback" />
|
|
14
|
+
{/if}
|
|
15
|
+
|
|
16
|
+
<style>
|
|
17
|
+
@reference "../../styles/references.css";
|
|
18
|
+
.active {
|
|
19
|
+
@apply border border-b-2 border-neutral-500; /* active */
|
|
20
|
+
}
|
|
21
|
+
.inactive {
|
|
22
|
+
@apply border border-b-2 border-transparent opacity-60; /* inactive */
|
|
23
|
+
}
|
|
24
|
+
/* @apply border border-b-2 border-neutral-500;
|
|
25
|
+
@apply opacity-60 border border-b-2 border-transparent; */
|
|
26
|
+
</style>
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import List from '
|
|
3
|
-
|
|
4
|
-
let className = '';
|
|
5
|
-
export { className as class };
|
|
6
|
-
|
|
7
|
-
function skeletonLine() {
|
|
8
|
-
return [...Array(Math.ceil(Math.random() * 5))]
|
|
9
|
-
.map(
|
|
10
|
-
() =>
|
|
11
|
-
'<div class="h-2 bg-gray-200 dark:bg-gray-600 rounded-md p-1 col-span-2 animate-pulse flex-auto" ></div>'
|
|
12
|
-
)
|
|
13
|
-
.join('');
|
|
14
|
-
}
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<div class={className}>
|
|
18
|
-
<List class="flex flex-col gap-2" data={[...Array(4)]}>
|
|
19
|
-
<div class="flex gap-2">{@html skeletonLine()}</div>
|
|
20
|
-
</List>
|
|
21
|
-
</div>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import List from './List.svelte';
|
|
3
|
+
|
|
4
|
+
let className = '';
|
|
5
|
+
export { className as class };
|
|
6
|
+
|
|
7
|
+
function skeletonLine() {
|
|
8
|
+
return [...Array(Math.ceil(Math.random() * 5))]
|
|
9
|
+
.map(
|
|
10
|
+
() =>
|
|
11
|
+
'<div class="h-2 bg-gray-200 dark:bg-gray-600 rounded-md p-1 col-span-2 animate-pulse flex-auto" ></div>'
|
|
12
|
+
)
|
|
13
|
+
.join('');
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div class={className}>
|
|
18
|
+
<List class="flex flex-col gap-2" data={[...Array(4)]}>
|
|
19
|
+
<div class="flex gap-2">{@html skeletonLine()}</div>
|
|
20
|
+
</List>
|
|
21
|
+
</div>
|
package/dist/index.d.ts
CHANGED
|
@@ -2,42 +2,34 @@ export { default as CollectionReverseFks } from './ui/CollectionReverseFks.svelt
|
|
|
2
2
|
export { default as CollectionListMenu } from './ui/CollectionListMenu.svelte';
|
|
3
3
|
export { default as CollectionList } from './ui/CollectionList.svelte';
|
|
4
4
|
export { default as CollectionFks } from './ui/CollectionFks.svelte';
|
|
5
|
-
export { default as CollectionFieldGuess } from '
|
|
5
|
+
export { default as CollectionFieldGuess } from '../_old/CollectionFieldGuess.svelte';
|
|
6
6
|
export { default as CollectionButton } from './ui/CollectionButton.svelte';
|
|
7
7
|
export * from './types/appschemeTypes.js';
|
|
8
|
-
export * from './main/
|
|
8
|
+
export * from './main/machineParserForge.js';
|
|
9
9
|
export * from './main/machineDb.js';
|
|
10
|
-
export * from './main/machineDb.spec.js';
|
|
11
10
|
export * from './main/machine.js';
|
|
12
|
-
export * from './main/machine.spec.js';
|
|
13
11
|
export { default as Skeleton } from './fragments/Skeleton.svelte';
|
|
14
12
|
export { default as Selector } from './fragments/Selector.svelte';
|
|
15
13
|
export { default as List } from './fragments/List.svelte';
|
|
16
14
|
export { default as InfoLine } from './fragments/InfoLine.svelte';
|
|
17
15
|
export { default as Frame } from './fragments/Frame.svelte';
|
|
18
16
|
export { default as Confirm } from './fragments/Confirm.svelte';
|
|
19
|
-
export * from './
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export
|
|
26
|
-
export * from './
|
|
27
|
-
export * from './
|
|
28
|
-
export * from './db/dbCollectionFieldForge.spec.js';
|
|
17
|
+
export * from './form/types.js';
|
|
18
|
+
export { default as FieldValue } from './form/FieldValue.svelte';
|
|
19
|
+
export { default as FieldInPlace } from './form/FieldInPlace.svelte';
|
|
20
|
+
export { default as DataProvider } from './form/DataProvider.svelte';
|
|
21
|
+
export { default as CrudZone } from '../_old/CrudZone.svelte';
|
|
22
|
+
export { default as CreateUpdate } from './form/CreateUpdate.svelte';
|
|
23
|
+
export { default as CreateOnly } from './form/CreateOnly.svelte';
|
|
24
|
+
export * from './demo/testScheme.js';
|
|
25
|
+
export * from './demo/dbSchema.js';
|
|
29
26
|
export * from './db/CrudService.js';
|
|
30
|
-
export * from './main/machine/
|
|
31
|
-
export * from './main/machine/
|
|
32
|
-
export * from './main/machine/
|
|
33
|
-
export * from './main/machine/
|
|
34
|
-
export * from './main/machine/
|
|
35
|
-
export * from './main/machine/
|
|
36
|
-
export * from './main/machine/
|
|
37
|
-
export * from './main/machine/
|
|
38
|
-
export * from './
|
|
39
|
-
export { default as FieldValue } from './demo/form/FieldValue.svelte';
|
|
40
|
-
export { default as FieldInPlace } from './demo/form/FieldInPlace.svelte';
|
|
41
|
-
export { default as DataProvider } from './demo/form/DataProvider.svelte';
|
|
42
|
-
export { default as CrudZone } from './demo/form/CrudZone.svelte';
|
|
43
|
-
export { default as CreateUpdate } from './demo/form/CreateUpdate.svelte';
|
|
27
|
+
export * from './main/machine/SchemeFieldDefaultValues.js';
|
|
28
|
+
export * from './main/machine/MachineSchemeValues.js';
|
|
29
|
+
export * from './main/machine/MachineSchemeValidate.js';
|
|
30
|
+
export * from './main/machine/MachineSchemeFieldValues.js';
|
|
31
|
+
export * from './main/machine/MachineSchemeFieldForge.js';
|
|
32
|
+
export * from './main/machine/MachineScheme.js';
|
|
33
|
+
export * from './main/machine/MachineFieldType.js';
|
|
34
|
+
export * from './main/machine/MachineErrorValidation.js';
|
|
35
|
+
export * from './main/machine/MachineError.js';
|
package/dist/index.js
CHANGED
|
@@ -3,42 +3,34 @@ export { default as CollectionReverseFks } from './ui/CollectionReverseFks.svelt
|
|
|
3
3
|
export { default as CollectionListMenu } from './ui/CollectionListMenu.svelte';
|
|
4
4
|
export { default as CollectionList } from './ui/CollectionList.svelte';
|
|
5
5
|
export { default as CollectionFks } from './ui/CollectionFks.svelte';
|
|
6
|
-
export { default as CollectionFieldGuess } from '
|
|
6
|
+
export { default as CollectionFieldGuess } from '../_old/CollectionFieldGuess.svelte';
|
|
7
7
|
export { default as CollectionButton } from './ui/CollectionButton.svelte';
|
|
8
8
|
export * from './types/appschemeTypes.js';
|
|
9
|
-
export * from './main/
|
|
9
|
+
export * from './main/machineParserForge.js';
|
|
10
10
|
export * from './main/machineDb.js';
|
|
11
|
-
export * from './main/machineDb.spec.js';
|
|
12
11
|
export * from './main/machine.js';
|
|
13
|
-
export * from './main/machine.spec.js';
|
|
14
12
|
export { default as Skeleton } from './fragments/Skeleton.svelte';
|
|
15
13
|
export { default as Selector } from './fragments/Selector.svelte';
|
|
16
14
|
export { default as List } from './fragments/List.svelte';
|
|
17
15
|
export { default as InfoLine } from './fragments/InfoLine.svelte';
|
|
18
16
|
export { default as Frame } from './fragments/Frame.svelte';
|
|
19
17
|
export { default as Confirm } from './fragments/Confirm.svelte';
|
|
20
|
-
export * from './
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export * from './
|
|
28
|
-
export * from './
|
|
29
|
-
export * from './db/dbCollectionFieldForge.spec.js';
|
|
18
|
+
export * from './form/types.js';
|
|
19
|
+
export { default as FieldValue } from './form/FieldValue.svelte';
|
|
20
|
+
export { default as FieldInPlace } from './form/FieldInPlace.svelte';
|
|
21
|
+
export { default as DataProvider } from './form/DataProvider.svelte';
|
|
22
|
+
export { default as CrudZone } from '../_old/CrudZone.svelte';
|
|
23
|
+
export { default as CreateUpdate } from './form/CreateUpdate.svelte';
|
|
24
|
+
export { default as CreateOnly } from './form/CreateOnly.svelte';
|
|
25
|
+
export * from './demo/testScheme.js';
|
|
26
|
+
export * from './demo/dbSchema.js';
|
|
30
27
|
export * from './db/CrudService.js';
|
|
31
|
-
export * from './main/machine/
|
|
32
|
-
export * from './main/machine/
|
|
33
|
-
export * from './main/machine/
|
|
34
|
-
export * from './main/machine/
|
|
35
|
-
export * from './main/machine/
|
|
36
|
-
export * from './main/machine/
|
|
37
|
-
export * from './main/machine/
|
|
38
|
-
export * from './main/machine/
|
|
39
|
-
export * from './
|
|
40
|
-
export { default as FieldValue } from './demo/form/FieldValue.svelte';
|
|
41
|
-
export { default as FieldInPlace } from './demo/form/FieldInPlace.svelte';
|
|
42
|
-
export { default as DataProvider } from './demo/form/DataProvider.svelte';
|
|
43
|
-
export { default as CrudZone } from './demo/form/CrudZone.svelte';
|
|
44
|
-
export { default as CreateUpdate } from './demo/form/CreateUpdate.svelte';
|
|
28
|
+
export * from './main/machine/SchemeFieldDefaultValues.js';
|
|
29
|
+
export * from './main/machine/MachineSchemeValues.js';
|
|
30
|
+
export * from './main/machine/MachineSchemeValidate.js';
|
|
31
|
+
export * from './main/machine/MachineSchemeFieldValues.js';
|
|
32
|
+
export * from './main/machine/MachineSchemeFieldForge.js';
|
|
33
|
+
export * from './main/machine/MachineScheme.js';
|
|
34
|
+
export * from './main/machine/MachineFieldType.js';
|
|
35
|
+
export * from './main/machine/MachineErrorValidation.js';
|
|
36
|
+
export * from './main/machine/MachineError.js';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @class MachineError
|
|
3
|
+
* @role Custom error class for collection-related errors.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* throw new MachineError('Message', 'ERROR_CODE');
|
|
7
|
+
* MachineError.handleError(error);
|
|
8
|
+
*/
|
|
9
|
+
export declare class MachineError extends Error {
|
|
10
|
+
readonly code: string;
|
|
11
|
+
/**
|
|
12
|
+
* Create a new MachineError instance.
|
|
13
|
+
* @role Constructor
|
|
14
|
+
* @param {string} message The error message.
|
|
15
|
+
* @param {string} code The error code.
|
|
16
|
+
*/
|
|
17
|
+
constructor(message: string, code: string);
|
|
18
|
+
/**
|
|
19
|
+
* Throw a new MachineError.
|
|
20
|
+
* @role Error throwing
|
|
21
|
+
* @param {string} message The error message.
|
|
22
|
+
* @param {string} code The error code.
|
|
23
|
+
* @throws {MachineError}
|
|
24
|
+
*/
|
|
25
|
+
static throwError(message: string, code: string): void;
|
|
26
|
+
/**
|
|
27
|
+
* Handle an error, logging details if it's an MachineError.
|
|
28
|
+
* @role Error handling
|
|
29
|
+
* @param {unknown} error The error to handle.
|
|
30
|
+
* @return {void}
|
|
31
|
+
*/
|
|
32
|
+
static handleError(error: unknown): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
renamed from DbCollectionError to MachineError
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @class MachineError
|
|
6
|
+
* @role Custom error class for collection-related errors.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* throw new MachineError('Message', 'ERROR_CODE');
|
|
10
|
+
* MachineError.handleError(error);
|
|
11
|
+
*/
|
|
12
|
+
export class MachineError extends Error {
|
|
13
|
+
code;
|
|
14
|
+
/**
|
|
15
|
+
* Create a new MachineError instance.
|
|
16
|
+
* @role Constructor
|
|
17
|
+
* @param {string} message The error message.
|
|
18
|
+
* @param {string} code The error code.
|
|
19
|
+
*/
|
|
20
|
+
constructor(message, code) {
|
|
21
|
+
super(message);
|
|
22
|
+
this.code = code;
|
|
23
|
+
this.name = "MachineError";
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Throw a new MachineError.
|
|
27
|
+
* @role Error throwing
|
|
28
|
+
* @param {string} message The error message.
|
|
29
|
+
* @param {string} code The error code.
|
|
30
|
+
* @throws {MachineError}
|
|
31
|
+
*/
|
|
32
|
+
static throwError(message, code) {
|
|
33
|
+
throw new MachineError(message, code);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Handle an error, logging details if it's an MachineError.
|
|
37
|
+
* @role Error handling
|
|
38
|
+
* @param {unknown} error The error to handle.
|
|
39
|
+
* @return {void}
|
|
40
|
+
*/
|
|
41
|
+
static handleError(error) {
|
|
42
|
+
if (error instanceof MachineError) {
|
|
43
|
+
console.error(`${error.name}: ${error.message} (Code: ${error.code})`);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
console.error("Unexpected error:", error);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @class IDbValidationError
|
|
3
|
+
* @role Custom error class for validation errors on form fields.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* throw new MachineErrorValidation('email', 'INVALID_EMAIL', 'Invalid email address');
|
|
7
|
+
*/
|
|
8
|
+
export declare class MachineErrorValidation extends Error {
|
|
9
|
+
field: string;
|
|
10
|
+
code: string;
|
|
11
|
+
/**
|
|
12
|
+
* Create a new MachineErrorValidation instance.
|
|
13
|
+
* @role Constructor
|
|
14
|
+
* @param {string} field The field name.
|
|
15
|
+
* @param {string} code The error code.
|
|
16
|
+
* @param {string} message The error message.
|
|
17
|
+
*/
|
|
18
|
+
constructor(field: string, code: string, message: string);
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @class IDbValidationError
|
|
3
|
+
* @role Custom error class for validation errors on form fields.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* throw new MachineErrorValidation('email', 'INVALID_EMAIL', 'Invalid email address');
|
|
7
|
+
*/
|
|
8
|
+
export class MachineErrorValidation extends Error {
|
|
9
|
+
field;
|
|
10
|
+
code;
|
|
11
|
+
/**
|
|
12
|
+
* Create a new MachineErrorValidation instance.
|
|
13
|
+
* @role Constructor
|
|
14
|
+
* @param {string} field The field name.
|
|
15
|
+
* @param {string} code The error code.
|
|
16
|
+
* @param {string} message The error message.
|
|
17
|
+
*/
|
|
18
|
+
constructor(field, code, message) {
|
|
19
|
+
super(message);
|
|
20
|
+
this.field = field;
|
|
21
|
+
this.code = code;
|
|
22
|
+
this.name = 'MachineErrorValidation';
|
|
23
|
+
}
|
|
24
|
+
}
|