firstly 0.1.3 → 0.2.1
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 +24 -0
- package/esm/auth/Entities.js +2 -2
- package/esm/auth/server/AuthController.server.js +32 -12
- package/esm/auth/static/assets/Page-BRNWcY5Z.js +1 -0
- package/esm/auth/static/assets/Page-CFcEsGK8.d.ts +2 -0
- package/esm/auth/static/assets/Page-CFcEsGK8.js +7 -0
- package/esm/auth/static/assets/Page-tLVs5slF.js +1 -0
- package/esm/auth/static/assets/index-D38rqu4x.d.ts +201 -0
- package/esm/auth/static/assets/index-D38rqu4x.js +2 -0
- package/esm/auth/static/index.html +1 -1
- package/esm/bin/cmd.js +3 -3
- package/esm/carbone/CarboneController.d.ts +35 -0
- package/esm/carbone/CarboneController.js +155 -0
- package/esm/carbone/Roles_Carbon.d.ts +8 -0
- package/esm/carbone/Roles_Carbon.js +8 -0
- package/esm/carbone/carboneEntities.d.ts +21 -0
- package/esm/carbone/carboneEntities.js +83 -0
- package/esm/carbone/index.d.ts +29 -0
- package/esm/carbone/index.js +68 -0
- package/esm/carbone/server/CarboneServer.d.ts +19 -0
- package/esm/carbone/server/CarboneServer.js +38 -0
- package/esm/carbone/server/index.d.ts +7 -0
- package/esm/carbone/server/index.js +23 -0
- package/esm/changeLog/changeLogEntities.js +1 -1
- package/esm/cron/Cron.js +1 -1
- package/esm/feedback/FeedbackController.d.ts +6 -2
- package/esm/feedback/FeedbackController.js +145 -143
- package/esm/feedback/server/index.d.ts +2 -2
- package/esm/feedback/server/index.js +3 -3
- package/esm/feedback/types.d.ts +5 -0
- package/esm/feedback/ui/DialogIssue.svelte +5 -5
- package/esm/feedback/ui/DialogIssues.svelte +5 -5
- package/esm/feedback/ui/DialogMilestones.svelte +1 -1
- package/esm/internals/BaseEnum.d.ts +1 -0
- package/esm/internals/FF_Fields.d.ts +6 -4
- package/esm/internals/FF_Fields.js +27 -64
- package/esm/internals/cellsBuildor.d.ts +2 -1
- package/esm/internals/index.d.ts +7 -8
- package/esm/internals/storeItem.d.ts +1 -0
- package/esm/mail/Mail.js +1 -1
- package/esm/mail/server/index.d.ts +8 -2
- package/esm/mail/server/index.js +35 -7
- package/esm/server/index.d.ts +1 -1
- package/esm/svelte/FF_Cell.svelte +3 -5
- package/esm/svelte/FF_Cell.svelte.d.ts +13 -4
- package/esm/svelte/FF_Cell_Caption.svelte.d.ts +10 -3
- package/esm/svelte/FF_Cell_Display.svelte.d.ts +10 -3
- package/esm/svelte/FF_Cell_Edit.svelte.d.ts +11 -4
- package/esm/svelte/FF_Cell_Error.svelte.d.ts +10 -3
- package/esm/svelte/FF_Cell_Hint.svelte.d.ts +10 -3
- package/esm/svelte/FF_Form.svelte +4 -5
- package/esm/svelte/FF_Form.svelte.d.ts +10 -3
- package/esm/svelte/FF_Grid.svelte +2 -2
- package/esm/svelte/FF_Grid.svelte.d.ts +10 -3
- package/esm/svelte/FF_Layout.svelte +3 -3
- package/esm/svelte/FF_Layout.svelte.d.ts +10 -3
- package/esm/svelte/dialog/DialogManagement.svelte +2 -5
- package/esm/svelte/dialog/DialogPrimitive.svelte +1 -2
- package/esm/svelte/dialog/dialog.js +2 -2
- package/esm/svelte/ff_Config.svelte.js +2 -2
- package/esm/svelte/index.d.ts +2 -7
- package/esm/svelte/index.js +2 -7
- package/esm/ui/Button.svelte +40 -23
- package/esm/ui/Button.svelte.d.ts +10 -34
- package/esm/ui/Clipboardable.svelte +13 -17
- package/esm/ui/Clipboardable.svelte.d.ts +9 -33
- package/esm/ui/Field.svelte +38 -8
- package/esm/ui/FieldGroup.svelte.d.ts +1 -1
- package/esm/ui/Grid.svelte +11 -82
- package/esm/ui/Grid.svelte.d.ts +0 -1
- package/esm/ui/Grid2.svelte +25 -86
- package/esm/ui/Grid2.svelte.d.ts +1 -2
- package/esm/ui/GridPaginate.svelte +1 -1
- package/esm/ui/GridPaginate2.svelte +2 -2
- package/esm/ui/Icon.svelte +2 -18
- package/esm/ui/Icon.svelte.d.ts +0 -2
- package/esm/ui/LibIcon.js +2 -2
- package/esm/ui/Loading.svelte +1 -1
- package/esm/ui/Tooltip.svelte +3 -2
- package/esm/ui/dialog/DialogManagement.svelte +14 -5
- package/esm/ui/dialog/DialogPrimitive.svelte +4 -4
- package/esm/ui/dialog/FormEditAction.svelte +4 -4
- package/esm/ui/dialog/dialog.d.ts +5 -2
- package/esm/ui/dialog/dialog.js +2 -2
- package/esm/ui/index.d.ts +1 -0
- package/esm/ui/index.js +1 -0
- package/esm/ui/internals/FieldContainer.svelte +25 -14
- package/esm/ui/internals/FieldContainer.svelte.d.ts +9 -30
- package/esm/ui/internals/Input.svelte.d.ts +1 -1
- package/esm/ui/internals/Textarea.svelte +2 -5
- package/esm/ui/internals/select/MultiSelectMelt.svelte +6 -4
- package/esm/ui/internals/select/Select2.svelte +88 -0
- package/esm/ui/internals/select/Select2.svelte.d.ts +12 -0
- package/esm/ui/internals/select/SelectMelt.svelte +5 -5
- package/esm/ui/internals/select/SelectRadio.svelte +1 -1
- package/esm/ui/link/Link.svelte +1 -1
- package/esm/ui/link/LinkPlus.svelte +9 -5
- package/esm/ui/link/LinkPlus.svelte.d.ts +5 -19
- package/esm/virtual/Customer.js +2 -3
- package/esm/virtual/UIEntity.js +10 -6
- package/package.json +16 -9
- package/esm/auth/static/assets/Page-9Ytj29NS.js +0 -1
- package/esm/auth/static/assets/Page-C1pM-UDt.d.ts +0 -2
- package/esm/auth/static/assets/Page-C1pM-UDt.js +0 -20
- package/esm/auth/static/assets/Page-CPz6KCw_.js +0 -1
- package/esm/auth/static/assets/index-AoBb9Ds5.d.ts +0 -232
- package/esm/auth/static/assets/index-AoBb9Ds5.js +0 -2
- package/esm/svelte/FF_Display.svelte +0 -51
- package/esm/svelte/FF_Display.svelte.d.ts +0 -22
- package/esm/svelte/FF_Edit.svelte +0 -104
- package/esm/svelte/FF_Edit.svelte.d.ts +0 -25
- package/esm/svelte/FF_Error.svelte +0 -23
- package/esm/svelte/FF_Error.svelte.d.ts +0 -22
- package/esm/svelte/FF_Field.svelte +0 -62
- package/esm/svelte/FF_Field.svelte.d.ts +0 -22
- package/esm/svelte/FF_Hint.svelte +0 -21
- package/esm/svelte/FF_Hint.svelte.d.ts +0 -22
- package/esm/svelte/FF_Label.svelte +0 -23
- package/esm/svelte/FF_Label.svelte.d.ts +0 -22
- /package/esm/auth/static/assets/{Page-CPz6KCw_.d.ts → Page-BRNWcY5Z.d.ts} +0 -0
- /package/esm/auth/static/assets/{Page-9Ytj29NS.d.ts → Page-tLVs5slF.d.ts} +0 -0
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
{:else if layoutToUse.type === 'grid'}
|
|
29
29
|
<FF_Grid {r}></FF_Grid>
|
|
30
30
|
{:else if layoutToUse.type === 'tab'}
|
|
31
|
-
<div role="tablist" class="tabs tabs
|
|
31
|
+
<div role="tablist" class="tabs-lift tabs">
|
|
32
32
|
{#each layoutToUse.groups ?? [] as group (group.key)}
|
|
33
33
|
<input
|
|
34
34
|
type="radio"
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
onchange={() => (selectedThing = group.key)}
|
|
40
40
|
aria-label={group.caption}
|
|
41
41
|
/>
|
|
42
|
-
<div role="tabpanel" class="tab-content
|
|
42
|
+
<div role="tabpanel" class="tab-content border-base-300 bg-base-100 p-6">
|
|
43
43
|
<FF_Form {r} groups={[group]} show={{ title: false }}></FF_Form>
|
|
44
44
|
</div>
|
|
45
45
|
{/each}
|
|
46
46
|
</div>
|
|
47
47
|
{:else if layoutToUse.type === 'accordion'}
|
|
48
48
|
{#each layoutToUse.groups ?? [] as group (group.key)}
|
|
49
|
-
<div class="collapse bg-base-100">
|
|
49
|
+
<div class="collapse-arrow collapse bg-base-100">
|
|
50
50
|
<input
|
|
51
51
|
type="radio"
|
|
52
52
|
name="my-accordion"
|
|
@@ -5,10 +5,17 @@ interface Props<entityType = unknown> {
|
|
|
5
5
|
layout?: Layout<entityType>;
|
|
6
6
|
classes_goups?: string;
|
|
7
7
|
}
|
|
8
|
+
declare function $$render<entityType = unknown>(): {
|
|
9
|
+
props: Props<entityType>;
|
|
10
|
+
exports: {};
|
|
11
|
+
bindings: "";
|
|
12
|
+
slots: {};
|
|
13
|
+
events: {};
|
|
14
|
+
};
|
|
8
15
|
declare class __sveltets_Render<entityType = unknown> {
|
|
9
|
-
props():
|
|
10
|
-
events():
|
|
11
|
-
slots():
|
|
16
|
+
props(): ReturnType<typeof $$render<entityType>>['props'];
|
|
17
|
+
events(): ReturnType<typeof $$render<entityType>>['events'];
|
|
18
|
+
slots(): ReturnType<typeof $$render<entityType>>['slots'];
|
|
12
19
|
bindings(): "";
|
|
13
20
|
exports(): {};
|
|
14
21
|
}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
>
|
|
17
17
|
{@html toShow.children}
|
|
18
18
|
<svelte:fragment slot="actions">
|
|
19
|
-
<Button class="text-white"
|
|
19
|
+
<Button class="text-white" onclick={() => dialog.close(toShow.id, { success: true })}
|
|
20
20
|
>Confirmer</Button
|
|
21
21
|
>
|
|
22
22
|
</svelte:fragment>
|
|
@@ -29,10 +29,7 @@
|
|
|
29
29
|
>
|
|
30
30
|
{@html toShow.children}
|
|
31
31
|
<svelte:fragment slot="actions">
|
|
32
|
-
<Button
|
|
33
|
-
class="btn-outline btn-error"
|
|
34
|
-
on:click={() => dialog.close(toShow.id, { success: true })}
|
|
35
|
-
>
|
|
32
|
+
<Button class="btn-error" onclick={() => dialog.close(toShow.id, { success: true })}>
|
|
36
33
|
Confirmer
|
|
37
34
|
</Button>
|
|
38
35
|
</svelte:fragment>
|
|
@@ -18,7 +18,7 @@ const createDialogManagement = () => {
|
|
|
18
18
|
confirm: (topic, text, icon) => {
|
|
19
19
|
const detail = {
|
|
20
20
|
detail: {
|
|
21
|
-
caption: '
|
|
21
|
+
caption: 'A Confirmer',
|
|
22
22
|
icon: { data: icon },
|
|
23
23
|
},
|
|
24
24
|
children: `
|
|
@@ -34,7 +34,7 @@ const createDialogManagement = () => {
|
|
|
34
34
|
confirmDelete: (topic) => {
|
|
35
35
|
const detail = {
|
|
36
36
|
detail: {
|
|
37
|
-
caption: 'Supprimer',
|
|
37
|
+
caption: 'A Supprimer',
|
|
38
38
|
icon: { data: LibIcon_Delete },
|
|
39
39
|
},
|
|
40
40
|
children: topic
|
package/esm/svelte/index.d.ts
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import type { CellMetadata, getLayout } from './customField';
|
|
2
|
+
import { default as FF_Cell_Display } from './FF_Cell_Display.svelte';
|
|
2
3
|
import { default as FF_Cell } from './FF_Cell.svelte';
|
|
3
4
|
import { default as FF_Config } from './FF_Config.svelte';
|
|
4
|
-
import { default as FF_Display } from './FF_Display.svelte';
|
|
5
|
-
import { default as FF_Edit } from './FF_Edit.svelte';
|
|
6
|
-
import { default as FF_Error } from './FF_Error.svelte';
|
|
7
|
-
import { default as FF_Field } from './FF_Field.svelte';
|
|
8
5
|
import { default as FF_Form } from './FF_Form.svelte';
|
|
9
6
|
import { default as FF_Grid } from './FF_Grid.svelte';
|
|
10
|
-
import { default as FF_Hint } from './FF_Hint.svelte';
|
|
11
|
-
import { default as FF_Label } from './FF_Label.svelte';
|
|
12
7
|
import { default as FF_Layout } from './FF_Layout.svelte';
|
|
13
8
|
export type { FieldTheme, FormTheme, GridTheme, Theme, EditTheme, DisplayTheme, } from './ff_Config.svelte.js';
|
|
14
9
|
export { getDynamicCustomField, getTheme, setDynamicCustomField, setTheme, getClasses, daisyTheme, defaultTheme, emptyTheme, FF_Theme, } from './ff_Config.svelte.js';
|
|
15
|
-
export { FF_Grid, FF_Form,
|
|
10
|
+
export { FF_Grid, FF_Form, FF_Config, FF_Layout, FF_Cell, FF_Cell_Display };
|
|
16
11
|
export type { DynamicCustomField, FieldGroup } from './customField';
|
|
17
12
|
export { FF_Repo } from './FF_Repo.svelte.js';
|
|
18
13
|
export { tryCatch, tryCatchSync } from './tryCatch';
|
package/esm/svelte/index.js
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
|
+
import { default as FF_Cell_Display } from './FF_Cell_Display.svelte';
|
|
1
2
|
import { default as FF_Cell } from './FF_Cell.svelte';
|
|
2
3
|
import { default as FF_Config } from './FF_Config.svelte';
|
|
3
|
-
import { default as FF_Display } from './FF_Display.svelte';
|
|
4
|
-
import { default as FF_Edit } from './FF_Edit.svelte';
|
|
5
|
-
import { default as FF_Error } from './FF_Error.svelte';
|
|
6
|
-
import { default as FF_Field } from './FF_Field.svelte';
|
|
7
4
|
import { default as FF_Form } from './FF_Form.svelte';
|
|
8
5
|
import { default as FF_Grid } from './FF_Grid.svelte';
|
|
9
|
-
import { default as FF_Hint } from './FF_Hint.svelte';
|
|
10
|
-
import { default as FF_Label } from './FF_Label.svelte';
|
|
11
6
|
import { default as FF_Layout } from './FF_Layout.svelte';
|
|
12
7
|
export { getDynamicCustomField, getTheme, setDynamicCustomField, setTheme, getClasses, daisyTheme, defaultTheme, emptyTheme, FF_Theme, } from './ff_Config.svelte.js';
|
|
13
|
-
export { FF_Grid, FF_Form,
|
|
8
|
+
export { FF_Grid, FF_Form, FF_Config, FF_Layout, FF_Cell, FF_Cell_Display };
|
|
14
9
|
export { FF_Repo } from './FF_Repo.svelte.js';
|
|
15
10
|
export { tryCatch, tryCatchSync } from './tryCatch';
|
|
16
11
|
export { overwriteOptions, deepMerge, isOfType } from './helpers';
|
package/esm/ui/Button.svelte
CHANGED
|
@@ -7,24 +7,40 @@
|
|
|
7
7
|
|
|
8
8
|
import { BaseEnum, tw } from '../internals'
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
// TODO: extend HTMLButtonAttributes ?
|
|
11
|
+
interface Props {
|
|
12
|
+
isLoading?: boolean
|
|
13
|
+
permission?: BaseEnum[] | BaseEnum | undefined
|
|
14
|
+
tooltip?: import('svelte').Snippet
|
|
15
|
+
class?: string
|
|
16
|
+
children?: import('svelte').Snippet
|
|
17
|
+
disabled?: boolean | null
|
|
18
|
+
[key: string]: any
|
|
19
|
+
}
|
|
13
20
|
|
|
14
|
-
|
|
21
|
+
let {
|
|
22
|
+
isLoading = false,
|
|
23
|
+
class: className = '',
|
|
24
|
+
permission = undefined,
|
|
25
|
+
children,
|
|
26
|
+
tooltip,
|
|
27
|
+
disabled: disabledProp,
|
|
28
|
+
...rest
|
|
29
|
+
}: Props = $props()
|
|
15
30
|
|
|
16
|
-
let permissionDisabled = false
|
|
17
|
-
|
|
31
|
+
let permissionDisabled = $state(false)
|
|
32
|
+
let disabled = $derived(disabledProp || permissionDisabled || isLoading)
|
|
18
33
|
|
|
19
34
|
// let's trigger the annimation if it's more than 200ms
|
|
20
|
-
let triggerAnnimation = false
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
35
|
+
let triggerAnnimation = $state(false)
|
|
36
|
+
$effect(() => {
|
|
37
|
+
isLoading &&
|
|
38
|
+
setTimeout(() => {
|
|
39
|
+
if (isLoading) {
|
|
40
|
+
triggerAnnimation = true
|
|
41
|
+
}
|
|
42
|
+
}, 200)
|
|
43
|
+
})
|
|
28
44
|
|
|
29
45
|
let updates = (param: { permission: BaseEnum[] | BaseEnum | undefined }) => {
|
|
30
46
|
if (param && param.permission) {
|
|
@@ -42,7 +58,7 @@
|
|
|
42
58
|
}
|
|
43
59
|
}
|
|
44
60
|
|
|
45
|
-
let disabledWhy = ''
|
|
61
|
+
let disabledWhy = $state('')
|
|
46
62
|
const isAllowed: Action<HTMLElement, { permission: BaseEnum[] | BaseEnum | undefined }> = (
|
|
47
63
|
node,
|
|
48
64
|
param,
|
|
@@ -81,14 +97,14 @@
|
|
|
81
97
|
|
|
82
98
|
<button
|
|
83
99
|
{...$trigger}
|
|
100
|
+
use:trigger
|
|
84
101
|
use:isAllowed={{ permission }}
|
|
85
|
-
|
|
86
|
-
{
|
|
87
|
-
class={tw(['btn text-white', disabled ? '' : 'btn-primary', className])}
|
|
102
|
+
{...rest}
|
|
103
|
+
class={tw(['btn', className])}
|
|
88
104
|
{disabled}
|
|
89
105
|
>
|
|
90
106
|
<!-- btn-outline -->
|
|
91
|
-
|
|
107
|
+
{@render children?.()}
|
|
92
108
|
{#if triggerAnnimation && isLoading}
|
|
93
109
|
<div in:fly={{ x: -20 }}>
|
|
94
110
|
<span class="loading loading-spinner"></span>
|
|
@@ -96,16 +112,17 @@
|
|
|
96
112
|
{/if}
|
|
97
113
|
</button>
|
|
98
114
|
|
|
99
|
-
{#if $open && (disabledWhy ||
|
|
115
|
+
{#if $open && (disabledWhy || tooltip)}
|
|
100
116
|
<div
|
|
101
117
|
{...$content}
|
|
118
|
+
use:content
|
|
102
119
|
transition:fade={{ duration: 100 }}
|
|
103
120
|
class="z-30 rounded-lg bg-base-300 ring-1 ring-black"
|
|
104
121
|
>
|
|
105
|
-
<div {...$arrow}></div>
|
|
122
|
+
<div {...$arrow} use:arrow></div>
|
|
106
123
|
<div class="px-4 py-1">
|
|
107
|
-
{#if
|
|
108
|
-
|
|
124
|
+
{#if tooltip}
|
|
125
|
+
{@render tooltip?.()}
|
|
109
126
|
{:else}
|
|
110
127
|
{disabledWhy}
|
|
111
128
|
{/if}
|
|
@@ -1,37 +1,13 @@
|
|
|
1
1
|
import { BaseEnum } from '../internals';
|
|
2
|
-
interface
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
$set?: any;
|
|
11
|
-
$on?: any;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
2
|
+
interface Props {
|
|
3
|
+
isLoading?: boolean;
|
|
4
|
+
permission?: BaseEnum[] | BaseEnum | undefined;
|
|
5
|
+
tooltip?: import('svelte').Snippet;
|
|
6
|
+
class?: string;
|
|
7
|
+
children?: import('svelte').Snippet;
|
|
8
|
+
disabled?: boolean | null;
|
|
9
|
+
[key: string]: any;
|
|
14
10
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} ? Props extends Record<string, never> ? any : {
|
|
18
|
-
children?: any;
|
|
19
|
-
} : {});
|
|
20
|
-
declare const Button: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
21
|
-
[x: string]: any;
|
|
22
|
-
isLoading?: boolean | undefined;
|
|
23
|
-
class?: string | undefined | null | undefined;
|
|
24
|
-
permission?: BaseEnum<any> | BaseEnum<any>[] | undefined;
|
|
25
|
-
}, {
|
|
26
|
-
default: {};
|
|
27
|
-
tooltip: {};
|
|
28
|
-
}>, {
|
|
29
|
-
click: MouseEvent;
|
|
30
|
-
} & {
|
|
31
|
-
[evt: string]: CustomEvent<any>;
|
|
32
|
-
}, {
|
|
33
|
-
default: {};
|
|
34
|
-
tooltip: {};
|
|
35
|
-
}, {}, string>;
|
|
36
|
-
type Button = InstanceType<typeof Button>;
|
|
11
|
+
declare const Button: import("svelte").Component<Props, {}, "">;
|
|
12
|
+
type Button = ReturnType<typeof Button>;
|
|
37
13
|
export default Button;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* @param value to set in the clipboard if not null. *
|
|
5
|
+
* 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)!
|
|
6
|
+
*/
|
|
7
|
+
value: string | null
|
|
8
|
+
class?: string
|
|
9
|
+
children?: import('svelte').Snippet
|
|
10
|
+
}
|
|
9
11
|
|
|
10
|
-
let extraClass = ''
|
|
12
|
+
let { value, class: extraClass = '', children }: Props = $props()
|
|
11
13
|
|
|
12
14
|
async function clip(_value: string | null) {
|
|
13
15
|
if (_value) {
|
|
@@ -18,12 +20,6 @@
|
|
|
18
20
|
}
|
|
19
21
|
</script>
|
|
20
22
|
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
on:keyup={() => {}}
|
|
25
|
-
on:click={() => clip(value)}
|
|
26
|
-
class={`${value ? 'cursor-copy' : ''} ${extraClass}`}
|
|
27
|
-
>
|
|
28
|
-
<slot />
|
|
29
|
-
</span>
|
|
23
|
+
<button onclick={() => clip(value)} class={`text-left ${value ? 'cursor-copy' : ''} ${extraClass}`}>
|
|
24
|
+
{@render children?.()}
|
|
25
|
+
</button>
|
|
@@ -1,36 +1,12 @@
|
|
|
1
|
-
interface
|
|
2
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: Props & {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
-
default: any;
|
|
16
|
-
} ? Props extends Record<string, never> ? any : {
|
|
17
|
-
children?: any;
|
|
18
|
-
} : {});
|
|
19
|
-
declare const Clipboardable: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
1
|
+
interface Props {
|
|
20
2
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
3
|
+
* @param value to set in the clipboard if not null. *
|
|
4
|
+
* 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)!
|
|
5
|
+
*/
|
|
6
|
+
value: string | null;
|
|
25
7
|
class?: string;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
}, {
|
|
31
|
-
default: {};
|
|
32
|
-
}, {
|
|
33
|
-
class: string;
|
|
34
|
-
}, string>;
|
|
35
|
-
type Clipboardable = InstanceType<typeof Clipboardable>;
|
|
8
|
+
children?: import('svelte').Snippet;
|
|
9
|
+
}
|
|
10
|
+
declare const Clipboardable: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type Clipboardable = ReturnType<typeof Clipboardable>;
|
|
36
12
|
export default Clipboardable;
|
package/esm/ui/Field.svelte
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import type { HTMLInputAttributes } from 'svelte/elements'
|
|
4
4
|
|
|
5
5
|
import { type FieldMetadata, type FindOptions } from 'remult'
|
|
6
|
+
import { midTrim } from '@kitql/helpers'
|
|
6
7
|
|
|
7
8
|
import { suffixWithS } from '../formats/strings'
|
|
8
9
|
import { type BaseItem, type Cell } from '../internals'
|
|
@@ -23,8 +24,11 @@
|
|
|
23
24
|
import SelectRadio from './internals/select/SelectRadio.svelte'
|
|
24
25
|
import Textarea from './internals/Textarea.svelte'
|
|
25
26
|
import { LibIcon_Eye, LibIcon_EyeOff } from './LibIcon'
|
|
27
|
+
import Link from './link/Link.svelte'
|
|
26
28
|
import LinkPlus from './link/LinkPlus.svelte'
|
|
27
29
|
|
|
30
|
+
// import Select2 from './internals/select/Select2.svelte'
|
|
31
|
+
|
|
28
32
|
export let cell: Cell<T>
|
|
29
33
|
export let value: HTMLInputAttributes['value'] = undefined
|
|
30
34
|
|
|
@@ -203,9 +207,15 @@
|
|
|
203
207
|
{@const clearableComputed =
|
|
204
208
|
cell.clearable || clearable || (mode === 'filtre' && clearable === undefined)}
|
|
205
209
|
{#if isViewMode(mode, cell.field)}
|
|
206
|
-
<span class="
|
|
210
|
+
<span class="flex items-center pr-4 pl-2">
|
|
207
211
|
{#if cell.field?.inputType === 'checkbox'}
|
|
208
|
-
<input
|
|
212
|
+
<input
|
|
213
|
+
type="checkbox"
|
|
214
|
+
{...common(cell.field)}
|
|
215
|
+
class="checkbox ml-2 border-base-content/60"
|
|
216
|
+
disabled
|
|
217
|
+
checked={value}
|
|
218
|
+
/>
|
|
209
219
|
{:else if metaType.kind === 'relation'}
|
|
210
220
|
{@const item = getEntityDisplayValue(metaType.repoTarget, value)}
|
|
211
221
|
<div class={tw('flex items-center gap-4', 'h-12', 'pl-2')}>
|
|
@@ -219,10 +229,23 @@
|
|
|
219
229
|
{/if}
|
|
220
230
|
<Clipboardable value={v}>{v}</Clipboardable>
|
|
221
231
|
</div>
|
|
232
|
+
{:else if metaType.subKind === 'link'}
|
|
233
|
+
<div class="ml-2 flex h-12 max-w-sm items-center gap-4 truncate">
|
|
234
|
+
{#if value}
|
|
235
|
+
<Link href={value} target="_blank" isExternal
|
|
236
|
+
>{midTrim(value.replaceAll('https://', '').replaceAll('www.', ''), {
|
|
237
|
+
len: 38,
|
|
238
|
+
midStr: ' ... ',
|
|
239
|
+
})}</Link
|
|
240
|
+
>
|
|
241
|
+
{:else}
|
|
242
|
+
<span class="text-base-content/30">-</span>
|
|
243
|
+
{/if}
|
|
244
|
+
</div>
|
|
222
245
|
{:else}
|
|
223
246
|
{@const v = displayWithDefaultAndSuffix(cell.field, value)}
|
|
224
247
|
<div
|
|
225
|
-
class="ml-2 flex h-12 w-full items-center {metaType.subKind === 'number' ? 'justify-end' : ''}"
|
|
248
|
+
class="ml-2 pb-2 flex h-12 w-full items-center {metaType.subKind === 'number' ? 'justify-end' : ''}"
|
|
226
249
|
>
|
|
227
250
|
<Clipboardable value={v}>{v}</Clipboardable>
|
|
228
251
|
</div>
|
|
@@ -273,6 +296,13 @@
|
|
|
273
296
|
on:selected={(e) => dispatchSelected(e.detail)}
|
|
274
297
|
/>
|
|
275
298
|
{:else}
|
|
299
|
+
<!-- <Select2
|
|
300
|
+
{...common(cell.field, true)}
|
|
301
|
+
clearable={clearableComputed}
|
|
302
|
+
items={metaType.values}
|
|
303
|
+
value={value?.id || value}
|
|
304
|
+
onChange={(e) => dispatchSelected(metaType.values.find((v) => v.id === e))}
|
|
305
|
+
/> -->
|
|
276
306
|
<SelectMelt
|
|
277
307
|
{focus}
|
|
278
308
|
{...common(cell.field, true)}
|
|
@@ -286,7 +316,7 @@
|
|
|
286
316
|
/>
|
|
287
317
|
{/if}
|
|
288
318
|
{:else if metaType.subKind === 'checkbox'}
|
|
289
|
-
<div class="grid content-center items-center pl-4">
|
|
319
|
+
<div class="grid content-center items-center pl-4 pb-2">
|
|
290
320
|
<input
|
|
291
321
|
type="checkbox"
|
|
292
322
|
{...{ ...common(cell.field), required: undefined }}
|
|
@@ -299,20 +329,20 @@
|
|
|
299
329
|
}}
|
|
300
330
|
/>
|
|
301
331
|
</div>
|
|
302
|
-
{:else if metaType.subKind === 'text' || metaType.subKind === 'email' || metaType.subKind === 'password' || metaType.subKind === '
|
|
303
|
-
<div class="input
|
|
332
|
+
{:else if metaType.subKind === 'text' || metaType.subKind === 'email' || metaType.subKind === 'password' || metaType.subKind === 'date' || metaType.subKind === 'number' || metaType.subKind === 'textpsd' || metaType.subKind === 'link'}
|
|
333
|
+
<div class="input inline-flex w-full items-center pl-2">
|
|
304
334
|
<Input
|
|
305
335
|
{focus}
|
|
306
336
|
{...common(cell.field)}
|
|
307
337
|
autocomplete="off"
|
|
308
338
|
class={tw(
|
|
309
|
-
`join-item w-full
|
|
339
|
+
`join-item w-full placeholder:text-base-content/30`,
|
|
310
340
|
metaType.subKind === 'number' && 'text-end',
|
|
311
341
|
)}
|
|
312
342
|
style={cell.field?.inputType === 'textpsd' && textpsdVisible === false
|
|
313
343
|
? 'filter: blur(0.2rem)'
|
|
314
344
|
: ''}
|
|
315
|
-
type={metaType.subKind.replaceAll('
|
|
345
|
+
type={metaType.subKind.replaceAll('textpsd', 'text').replaceAll('link', 'text')}
|
|
316
346
|
value={toInput(cell.field, value)}
|
|
317
347
|
{withDedounce}
|
|
318
348
|
on:input={(e) => {
|
|
@@ -3,7 +3,7 @@ import { type StoreItem } from '../internals';
|
|
|
3
3
|
import type { Cell } from '../internals/cellsBuildor';
|
|
4
4
|
declare class __sveltets_Render<T extends Record<any, any>> {
|
|
5
5
|
props(): {
|
|
6
|
-
mode?: "
|
|
6
|
+
mode?: "view" | "edit" | "filtre";
|
|
7
7
|
cells: Cell<T>[];
|
|
8
8
|
store: StoreItem<T>;
|
|
9
9
|
focusKey?: string | null | undefined;
|