mountain-ui 1.0.141 → 1.0.143
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/package.json +1 -1
- package/src/lib/registry/entityRegistry/components/FieldButton.svelte +1 -1
- package/src/lib/registry/entityRegistry/components/FieldCondition.svelte +138 -0
- package/src/lib/registry/fieldTypeRegistry/conditions.js +39 -0
- package/src/lib/registry/fieldTypeRegistry/createFieldType.js +3 -1
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/files/FilesImage/Input.svelte +67 -35
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/number/NumberInt/Input.svelte +3 -1
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/number/NumberInt/index.js +51 -0
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/number/float/NumberFloatDefault/Input.svelte +3 -1
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/number/float/NumberFloatDefault/index.js +51 -0
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/number/float/NumberFloatPercent/Input.svelte +3 -1
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/number/float/NumberFloatPercent/index.js +51 -0
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/number/float/NumberFloatPrice/Input.svelte +3 -1
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/number/float/NumberFloatPrice/index.js +51 -0
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/text/TextTextarea/index.js +31 -0
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/text/varchar/TextVarcharDefault/Input.svelte +3 -1
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/text/varchar/TextVarcharDefault/index.js +31 -0
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/text/varchar/TextVarcharEmail/Input.svelte +3 -1
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/text/varchar/TextVarcharEmail/index.js +31 -0
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/text/varchar/TextVarcharPassword/Input.svelte +3 -1
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/text/varchar/TextVarcharPhone/Input.svelte +3 -1
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/text/varchar/TextVarcharPhone/index.js +33 -2
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/text/varchar/TextVarcharUrl/Input.svelte +3 -1
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/text/varchar/TextVarcharUrl/index.js +31 -0
- package/src/routes/exemple/[project_normalized_name]/home/+page.svelte +3 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mountain-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.143",
|
|
5
5
|
"description": "A comprehensive UI component library for ERP systems with field types, entities, and registry management built with Svelte",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"module": "index.js",
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import FieldTypeIcon from '../../fieldTypeRegistry/components/FieldTypeIcon.svelte';
|
|
3
|
+
import { fieldTypeRegistry } from '../../fieldTypeRegistry/registry.svelte.js';
|
|
4
|
+
import { Button, DropdownMenu } from 'hamzus-ui';
|
|
5
|
+
import { entityRegistry } from '../registry.svelte';
|
|
6
|
+
import FieldIsSecretIcon from './FieldIsSecretIcon.svelte';
|
|
7
|
+
import FieldIsUniqueIcon from './FieldIsUniqueIcon.svelte';
|
|
8
|
+
import FieldIsRequiredIcon from './FieldIsRequiredIcon.svelte';
|
|
9
|
+
import FieldButton from './FieldButton.svelte';
|
|
10
|
+
import { conditions } from '$lib/registry/fieldTypeRegistry/conditions';
|
|
11
|
+
import FieldTypeInput from '$lib/registry/fieldTypeRegistry/components/FieldTypeInput.svelte';
|
|
12
|
+
|
|
13
|
+
let {
|
|
14
|
+
id,
|
|
15
|
+
variant = 'ghost',
|
|
16
|
+
entityId = null,
|
|
17
|
+
conditionType = $bindable(null),
|
|
18
|
+
fieldId = $bindable(null),
|
|
19
|
+
fieldContentType = $bindable(null),
|
|
20
|
+
fieldContent = $bindable(null),
|
|
21
|
+
allowedFields = $bindable(null),
|
|
22
|
+
...props
|
|
23
|
+
} = $props();
|
|
24
|
+
|
|
25
|
+
const field = $derived(entityRegistry.selectField(id, entityId));
|
|
26
|
+
const fieldType = $derived(fieldTypeRegistry.get($field.type));
|
|
27
|
+
const allowedConditions = $derived(fieldType?.allowedConditions($field) ?? null);
|
|
28
|
+
|
|
29
|
+
let condition = $state(null)
|
|
30
|
+
let freeFieldType = $state(null)
|
|
31
|
+
|
|
32
|
+
function handleSetCondition(newCondition) {
|
|
33
|
+
condition = newCondition
|
|
34
|
+
conditionType = newCondition.type;
|
|
35
|
+
freeFieldType = newCondition.freeField
|
|
36
|
+
fieldContent = null;
|
|
37
|
+
fieldContentType = null;
|
|
38
|
+
fieldId = null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function handleSetField(newFieldId) {
|
|
42
|
+
fieldContent = null;
|
|
43
|
+
fieldContentType = null;
|
|
44
|
+
fieldId = newFieldId;
|
|
45
|
+
}
|
|
46
|
+
function handleSetFieldContent(newFieldContentType) {
|
|
47
|
+
fieldId = null;
|
|
48
|
+
fieldContent = '';
|
|
49
|
+
fieldContentType = newFieldContentType;
|
|
50
|
+
}
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<div class="condition">
|
|
54
|
+
<FieldButton style="border-radius: var(--radius-m) 0 0 var(--radius-m);" id={$field.id} entityId={$field.entityId}></FieldButton>
|
|
55
|
+
<DropdownMenu.Root direction="bottom">
|
|
56
|
+
<DropdownMenu.Trigger slot="trigger">
|
|
57
|
+
<Button style="border-radius: 0;height:100%;" variant="secondary">
|
|
58
|
+
<h5>{conditions[conditionType]?.name ?? '-'}</h5>
|
|
59
|
+
</Button>
|
|
60
|
+
</DropdownMenu.Trigger>
|
|
61
|
+
<DropdownMenu.Content slot="content" width="250px">
|
|
62
|
+
{#if allowedConditions}
|
|
63
|
+
{#each allowedConditions as allowedCondition}
|
|
64
|
+
<Button
|
|
65
|
+
onClick={() => {
|
|
66
|
+
handleSetCondition(allowedCondition);
|
|
67
|
+
}}
|
|
68
|
+
variant="ghost"
|
|
69
|
+
style="width:100%;"
|
|
70
|
+
>
|
|
71
|
+
<h5>{conditions[allowedCondition.type].name}</h5>
|
|
72
|
+
{#if allowedCondition.type === conditionType}
|
|
73
|
+
<svg class="reset" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
74
|
+
<path d="M12.0001 22.7499C6.80008 22.7499 2.58008 18.5199 2.58008 13.3299C2.58008 8.1399 6.80008 3.8999 12.0001 3.8999C13.0701 3.8999 14.1101 4.0499 15.1101 4.3599C15.5101 4.4799 15.7301 4.8999 15.6101 5.2999C15.4901 5.6999 15.0701 5.9199 14.6701 5.7999C13.8201 5.5399 12.9201 5.3999 12.0001 5.3999C7.63008 5.3999 4.08008 8.9499 4.08008 13.3199C4.08008 17.6899 7.63008 21.2399 12.0001 21.2399C16.3701 21.2399 19.9201 17.6899 19.9201 13.3199C19.9201 11.7399 19.4601 10.2199 18.5901 8.9199C18.3601 8.5799 18.4501 8.1099 18.8001 7.8799C19.1401 7.6499 19.6101 7.7399 19.8401 8.0899C20.8801 9.6399 21.4301 11.4499 21.4301 13.3299C21.4201 18.5199 17.2001 22.7499 12.0001 22.7499Z" fill="#292D32"/>
|
|
75
|
+
<path d="M16.1304 6.07021C15.9204 6.07021 15.7104 5.98021 15.5604 5.81021L12.6704 2.49021C12.4004 2.18021 12.4304 1.70021 12.7404 1.43021C13.0504 1.16021 13.5304 1.19021 13.8004 1.50021L16.6904 4.82021C16.9604 5.13021 16.9304 5.61021 16.6204 5.88021C16.4904 6.01021 16.3104 6.07021 16.1304 6.07021Z" fill="#292D32"/>
|
|
76
|
+
<path d="M12.7602 8.5302C12.5302 8.5302 12.3002 8.4202 12.1502 8.2202C11.9102 7.8902 11.9802 7.4202 12.3102 7.1702L15.6802 4.7102C16.0102 4.4602 16.4802 4.5402 16.7302 4.8702C16.9802 5.2002 16.9002 5.6702 16.5702 5.9202L13.2002 8.3902C13.0702 8.4902 12.9202 8.5302 12.7602 8.5302Z" fill="#292D32"/>
|
|
77
|
+
</svg>
|
|
78
|
+
|
|
79
|
+
{/if}
|
|
80
|
+
</Button>
|
|
81
|
+
{/each}
|
|
82
|
+
{/if}
|
|
83
|
+
</DropdownMenu.Content>
|
|
84
|
+
</DropdownMenu.Root>
|
|
85
|
+
{#if fieldId}
|
|
86
|
+
<FieldButton style="border-radius: 0 var(--radius-m) var(--radius-m) 0;height:100%;" id={$field.id} entityId={$field.entityId}></FieldButton>
|
|
87
|
+
{:else if fieldContentType !== null}
|
|
88
|
+
<FieldTypeInput padding="0px var(--pad-m)" compact type={fieldContentType}></FieldTypeInput>
|
|
89
|
+
{:else if conditionType}
|
|
90
|
+
<DropdownMenu.Root direction="bottom">
|
|
91
|
+
<DropdownMenu.Trigger slot="trigger">
|
|
92
|
+
<Button style="border-radius: 0 var(--radius-m) var(--radius-m) 0;height:100%;" variant="ghost">
|
|
93
|
+
<h5>valeur</h5>
|
|
94
|
+
</Button>
|
|
95
|
+
</DropdownMenu.Trigger>
|
|
96
|
+
<DropdownMenu.Content slot="content" width="250px">
|
|
97
|
+
<Button
|
|
98
|
+
onClick={() => {
|
|
99
|
+
handleSetFieldContent(freeFieldType);
|
|
100
|
+
}}
|
|
101
|
+
variant="ghost"
|
|
102
|
+
style="width:100%;"
|
|
103
|
+
>
|
|
104
|
+
<h5>champs libre</h5>
|
|
105
|
+
</Button>
|
|
106
|
+
{#each allowedFields as fieldId}
|
|
107
|
+
{@const field = entityRegistry.getField(fieldId)}
|
|
108
|
+
{#if condition.allowedTypes.find(t=>field.type.startsWith(t))}
|
|
109
|
+
<FieldButton onClick={()=>{handleSetField(fieldId)}} style="width:100%;" id={field.id}></FieldButton>
|
|
110
|
+
{/if}
|
|
111
|
+
{/each}
|
|
112
|
+
</DropdownMenu.Content>
|
|
113
|
+
</DropdownMenu.Root>
|
|
114
|
+
{/if}
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<style>
|
|
118
|
+
.condition {
|
|
119
|
+
display: flex;
|
|
120
|
+
border-radius: var(--radius-l);
|
|
121
|
+
background-color: var(--bg-blur);
|
|
122
|
+
width: fit-content;
|
|
123
|
+
}
|
|
124
|
+
.condition > :global(.line) {
|
|
125
|
+
align-items: center;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.reset {
|
|
129
|
+
width: 16px;
|
|
130
|
+
height: auto;
|
|
131
|
+
margin-left: auto;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.reset > path {
|
|
135
|
+
fill: var(--font-2);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
</style>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
export const conditions = {
|
|
3
|
+
"eq":{
|
|
4
|
+
type:"eq",
|
|
5
|
+
name:"égale"
|
|
6
|
+
},
|
|
7
|
+
"ne":{
|
|
8
|
+
type:"ne",
|
|
9
|
+
name:"différent"
|
|
10
|
+
},
|
|
11
|
+
"gt":{
|
|
12
|
+
type:"gt",
|
|
13
|
+
name:"plus grand que"
|
|
14
|
+
},
|
|
15
|
+
"gte":{
|
|
16
|
+
type:"gte",
|
|
17
|
+
name:"plus grand que ou égale à"
|
|
18
|
+
},
|
|
19
|
+
"lt":{
|
|
20
|
+
type:"lt",
|
|
21
|
+
name:"plus petit que"
|
|
22
|
+
},
|
|
23
|
+
"lte":{
|
|
24
|
+
type:"lte",
|
|
25
|
+
name:"plus petit que ou égale"
|
|
26
|
+
},
|
|
27
|
+
"starts_with":{
|
|
28
|
+
type:"starts_with",
|
|
29
|
+
name:"commence par"
|
|
30
|
+
},
|
|
31
|
+
"ends_with":{
|
|
32
|
+
type:"ends_with",
|
|
33
|
+
name:"termine par"
|
|
34
|
+
},
|
|
35
|
+
"contains":{
|
|
36
|
+
type:"contains",
|
|
37
|
+
name:"contient"
|
|
38
|
+
},
|
|
39
|
+
}
|
|
@@ -25,32 +25,33 @@
|
|
|
25
25
|
let isUploading = $state(false);
|
|
26
26
|
|
|
27
27
|
async function handleFileChange(event) {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
isUploading = true;
|
|
29
|
+
for (const file of event.target.files ?? []) {
|
|
30
|
+
if (!file) return;
|
|
30
31
|
|
|
31
|
-
isUploading = true;
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
if (request.statusType === 'error') {
|
|
41
|
-
isUploading = false;
|
|
42
|
-
toast.error({
|
|
43
|
-
title: 'Erreur !',
|
|
44
|
-
description: request.message
|
|
33
|
+
const request = await sendRequest({
|
|
34
|
+
path: '/upload-image',
|
|
35
|
+
data: {
|
|
36
|
+
file
|
|
37
|
+
}
|
|
45
38
|
});
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
39
|
|
|
49
|
-
|
|
40
|
+
if (request.statusType === 'error') {
|
|
41
|
+
isUploading = false;
|
|
42
|
+
toast.error({
|
|
43
|
+
title: 'Erreur !',
|
|
44
|
+
description: request.message
|
|
45
|
+
});
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const fileId = request.data.id;
|
|
50
50
|
|
|
51
|
-
isUploading = false;
|
|
52
51
|
|
|
53
|
-
|
|
52
|
+
addFieldId(fileId);
|
|
53
|
+
}
|
|
54
|
+
isUploading = false;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
function addFieldId(fieldId) {
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
|
|
65
66
|
value = JSON.stringify(decodedValue);
|
|
66
67
|
|
|
67
|
-
|
|
68
|
+
onChange(value);
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
function removeFieldId(fieldId) {
|
|
@@ -74,20 +75,20 @@
|
|
|
74
75
|
|
|
75
76
|
value = JSON.stringify(decodedValue);
|
|
76
77
|
|
|
77
|
-
|
|
78
|
+
onChange(value);
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
function openFilePicker() {
|
|
81
82
|
fileInput.click();
|
|
82
83
|
}
|
|
83
84
|
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
function resetInput(params) {
|
|
86
|
+
value = '[]';
|
|
86
87
|
|
|
87
|
-
|
|
88
|
+
if (fileInput) fileInput.value = '';
|
|
88
89
|
|
|
89
90
|
onChange(null);
|
|
90
|
-
|
|
91
|
+
}
|
|
91
92
|
</script>
|
|
92
93
|
|
|
93
94
|
<Line {compact}>
|
|
@@ -99,6 +100,7 @@
|
|
|
99
100
|
bind:this={fileInput}
|
|
100
101
|
on:change={handleFileChange}
|
|
101
102
|
disabled={isUploading}
|
|
103
|
+
multiple
|
|
102
104
|
style="display: none;"
|
|
103
105
|
/>
|
|
104
106
|
|
|
@@ -109,15 +111,45 @@
|
|
|
109
111
|
src="{import.meta.env
|
|
110
112
|
.VITE_API_URL}/get-image?__project_normalized_name={targetProject.normalized_name}&fileId={fileId}"
|
|
111
113
|
/>
|
|
112
|
-
<IconButton
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
114
|
+
<IconButton
|
|
115
|
+
onClick={() => {
|
|
116
|
+
removeFieldId(fileId);
|
|
117
|
+
}}
|
|
118
|
+
loading={isUploading}
|
|
119
|
+
variant="secondary"
|
|
120
|
+
size="24px"
|
|
121
|
+
>
|
|
122
|
+
<svg
|
|
123
|
+
width="24"
|
|
124
|
+
height="24"
|
|
125
|
+
viewBox="0 0 24 24"
|
|
126
|
+
fill="none"
|
|
127
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
128
|
+
>
|
|
129
|
+
<path
|
|
130
|
+
opacity="0.4"
|
|
131
|
+
d="M20.46 3.54L3.54 20.46C2.54 19.46 2 18.01 2 16.19V7.81C2 4.17 4.17 2 7.81 2H16.19C18.01 2 19.46 2.54 20.46 3.54Z"
|
|
132
|
+
fill="#292D32"
|
|
133
|
+
/>
|
|
134
|
+
<path
|
|
135
|
+
opacity="0.4"
|
|
136
|
+
d="M21.9993 7.81014V13.9001L20.3693 12.5001C19.5893 11.8301 18.3293 11.8301 17.5493 12.5001L13.3893 16.0701C12.6793 16.6801 11.5593 16.7401 10.7793 16.2201L21.6093 5.39014C21.7493 5.77014 21.8493 6.17014 21.9093 6.60014C21.9693 6.98014 21.9993 7.39014 21.9993 7.81014Z"
|
|
137
|
+
fill="#292D32"
|
|
138
|
+
/>
|
|
139
|
+
<path
|
|
140
|
+
d="M22.0006 13.9001V16.1901C22.0006 19.8301 19.8306 22.0001 16.1906 22.0001H7.81063C7.39062 22.0001 6.98063 21.9701 6.60063 21.9101C6.17063 21.8501 5.77062 21.7501 5.39062 21.6101L10.7806 16.2201C11.5606 16.7401 12.6806 16.6801 13.3906 16.0701L17.5506 12.5001C18.3306 11.8301 19.5906 11.8301 20.3706 12.5001L22.0006 13.9001Z"
|
|
141
|
+
fill="#292D32"
|
|
142
|
+
/>
|
|
143
|
+
<path
|
|
144
|
+
d="M21.7709 2.22988C21.4709 1.92988 20.9809 1.92988 20.6809 2.22988L2.23086 20.6899C1.93086 20.9899 1.93086 21.4799 2.23086 21.7799C2.38086 21.9199 2.57086 21.9999 2.77086 21.9999C2.97086 21.9999 3.16086 21.9199 3.31086 21.7699L21.7709 3.30988C22.0809 3.00988 22.0809 2.52988 21.7709 2.22988Z"
|
|
145
|
+
fill="#292D32"
|
|
146
|
+
/>
|
|
147
|
+
<path
|
|
148
|
+
d="M7.99914 10.3801C9.31358 10.3801 10.3791 9.31456 10.3791 8.00012C10.3791 6.68568 9.31358 5.62012 7.99914 5.62012C6.6847 5.62012 5.61914 6.68568 5.61914 8.00012C5.61914 9.31456 6.6847 10.3801 7.99914 10.3801Z"
|
|
149
|
+
fill="#292D32"
|
|
150
|
+
/>
|
|
151
|
+
</svg>
|
|
152
|
+
</IconButton>
|
|
121
153
|
</div>
|
|
122
154
|
{/each}
|
|
123
155
|
<Button
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<Line {compact}>
|
|
10
|
-
|
|
10
|
+
{#if label}
|
|
11
|
+
<Label {unique} {secret} {label} {required}></Label>
|
|
12
|
+
{/if}
|
|
11
13
|
<Input {...props} type="number" step="1" placeholder="un nombre entier" {required} />
|
|
12
14
|
</Line>
|
|
@@ -37,6 +37,57 @@ export default createFieldType({
|
|
|
37
37
|
properties: null
|
|
38
38
|
},
|
|
39
39
|
|
|
40
|
+
// condition
|
|
41
|
+
allowedConditions : (field)=>{
|
|
42
|
+
return [
|
|
43
|
+
{
|
|
44
|
+
type:"eq",
|
|
45
|
+
allowedTypes:["number-int"],
|
|
46
|
+
freeField:"number-int"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type:"ne",
|
|
50
|
+
allowedTypes:["number-int"],
|
|
51
|
+
freeField:"number-int"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type:"gt",
|
|
55
|
+
allowedTypes:["number-int"],
|
|
56
|
+
freeField:"number-int"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
type:"gte",
|
|
60
|
+
allowedTypes:["number-int"],
|
|
61
|
+
freeField:"number-int"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
type:"lt",
|
|
65
|
+
allowedTypes:["number-int"],
|
|
66
|
+
freeField:"number-int"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
type:"lte",
|
|
70
|
+
allowedTypes:["number-int"],
|
|
71
|
+
freeField:"number-int"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
type:"starts_with",
|
|
75
|
+
allowedTypes:["number-int"],
|
|
76
|
+
freeField:"number-int"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type:"ends_with",
|
|
80
|
+
allowedTypes:["number-int"],
|
|
81
|
+
freeField:"number-int"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
type:"contains",
|
|
85
|
+
allowedTypes:["number-int"],
|
|
86
|
+
freeField:"number-int"
|
|
87
|
+
},
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
|
|
40
91
|
allowBindings:["number", "text"],
|
|
41
92
|
formatter: (value) => value,
|
|
42
93
|
parser: (value) => value,
|
package/src/lib/registry/fieldTypeRegistry/fieldTypes/number/float/NumberFloatDefault/Input.svelte
CHANGED
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<Line {compact}>
|
|
10
|
-
|
|
10
|
+
{#if label}
|
|
11
|
+
<Label {unique} {secret} {label} {required}></Label>
|
|
12
|
+
{/if}
|
|
11
13
|
<FieldTypeInputFloat {required} placeholder="un nombre flotant" type="number" {...props}
|
|
12
14
|
></FieldTypeInputFloat>
|
|
13
15
|
</Line>
|
package/src/lib/registry/fieldTypeRegistry/fieldTypes/number/float/NumberFloatDefault/index.js
CHANGED
|
@@ -37,6 +37,57 @@ export default createFieldType({
|
|
|
37
37
|
properties: null
|
|
38
38
|
},
|
|
39
39
|
|
|
40
|
+
// condition
|
|
41
|
+
allowedConditions : (field)=>{
|
|
42
|
+
return [
|
|
43
|
+
{
|
|
44
|
+
type:"eq",
|
|
45
|
+
allowedTypes:["number-float"],
|
|
46
|
+
freeField:"number-float-default"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type:"ne",
|
|
50
|
+
allowedTypes:["number-float"],
|
|
51
|
+
freeField:"number-float-default"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type:"gt",
|
|
55
|
+
allowedTypes:["number-float"],
|
|
56
|
+
freeField:"number-float-default"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
type:"gte",
|
|
60
|
+
allowedTypes:["number-float"],
|
|
61
|
+
freeField:"number-float-default"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
type:"lt",
|
|
65
|
+
allowedTypes:["number-float"],
|
|
66
|
+
freeField:"number-float-default"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
type:"lte",
|
|
70
|
+
allowedTypes:["number-float"],
|
|
71
|
+
freeField:"number-float-default"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
type:"starts_with",
|
|
75
|
+
allowedTypes:["number-float"],
|
|
76
|
+
freeField:"number-float-default"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type:"ends_with",
|
|
80
|
+
allowedTypes:["number-float"],
|
|
81
|
+
freeField:"number-float-default"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
type:"contains",
|
|
85
|
+
allowedTypes:["number-float"],
|
|
86
|
+
freeField:"number-float-default"
|
|
87
|
+
},
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
|
|
40
91
|
allowBindings:["number-float", "text"],
|
|
41
92
|
|
|
42
93
|
formatter: (value) => value,
|
package/src/lib/registry/fieldTypeRegistry/fieldTypes/number/float/NumberFloatPercent/Input.svelte
CHANGED
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<Line {compact}>
|
|
10
|
-
|
|
10
|
+
{#if label}
|
|
11
|
+
<Label {unique} {secret} {label} {required}></Label>
|
|
12
|
+
{/if}
|
|
11
13
|
<FieldTypeInputFloat {...props} {required} placeholder="un pourcentage" type="number" symbol="%"
|
|
12
14
|
></FieldTypeInputFloat>
|
|
13
15
|
</Line>
|
package/src/lib/registry/fieldTypeRegistry/fieldTypes/number/float/NumberFloatPercent/index.js
CHANGED
|
@@ -37,6 +37,57 @@ export default createFieldType({
|
|
|
37
37
|
properties: null
|
|
38
38
|
},
|
|
39
39
|
|
|
40
|
+
// condition
|
|
41
|
+
allowedConditions : (field)=>{
|
|
42
|
+
return [
|
|
43
|
+
{
|
|
44
|
+
type:"eq",
|
|
45
|
+
allowedTypes:["number-float"],
|
|
46
|
+
freeField:"number-float-percent"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type:"ne",
|
|
50
|
+
allowedTypes:["number-float"],
|
|
51
|
+
freeField:"number-float-percent"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type:"gt",
|
|
55
|
+
allowedTypes:["number-float"],
|
|
56
|
+
freeField:"number-float-percent"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
type:"gte",
|
|
60
|
+
allowedTypes:["number-float"],
|
|
61
|
+
freeField:"number-float-percent"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
type:"lt",
|
|
65
|
+
allowedTypes:["number-float"],
|
|
66
|
+
freeField:"number-float-percent"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
type:"lte",
|
|
70
|
+
allowedTypes:["number-float"],
|
|
71
|
+
freeField:"number-float-percent"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
type:"starts_with",
|
|
75
|
+
allowedTypes:["number-float"],
|
|
76
|
+
freeField:"number-float-percent"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type:"ends_with",
|
|
80
|
+
allowedTypes:["number-float"],
|
|
81
|
+
freeField:"number-float-percent"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
type:"contains",
|
|
85
|
+
allowedTypes:["number-float"],
|
|
86
|
+
freeField:"number-float-percent"
|
|
87
|
+
},
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
|
|
40
91
|
allowBindings:["number-float", "text"],
|
|
41
92
|
formatter: (value) => value,
|
|
42
93
|
parser: (value) => value,
|
package/src/lib/registry/fieldTypeRegistry/fieldTypes/number/float/NumberFloatPrice/Input.svelte
CHANGED
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<Line {compact}>
|
|
10
|
-
|
|
10
|
+
{#if label}
|
|
11
|
+
<Label {unique} {secret} {label} {required}></Label>
|
|
12
|
+
{/if}
|
|
11
13
|
<FieldTypeInputFloat {required} placeholder="un prix" type="number" {...props} symbol="€"
|
|
12
14
|
></FieldTypeInputFloat>
|
|
13
15
|
</Line>
|
package/src/lib/registry/fieldTypeRegistry/fieldTypes/number/float/NumberFloatPrice/index.js
CHANGED
|
@@ -37,6 +37,57 @@ export default createFieldType({
|
|
|
37
37
|
properties: null
|
|
38
38
|
},
|
|
39
39
|
|
|
40
|
+
// condition
|
|
41
|
+
allowedConditions : (field)=>{
|
|
42
|
+
return [
|
|
43
|
+
{
|
|
44
|
+
type:"eq",
|
|
45
|
+
allowedTypes:["number-float"],
|
|
46
|
+
freeField:"number-float-price"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type:"ne",
|
|
50
|
+
allowedTypes:["number-float"],
|
|
51
|
+
freeField:"number-float-price"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type:"gt",
|
|
55
|
+
allowedTypes:["number-float"],
|
|
56
|
+
freeField:"number-float-price"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
type:"gte",
|
|
60
|
+
allowedTypes:["number-float"],
|
|
61
|
+
freeField:"number-float-price"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
type:"lt",
|
|
65
|
+
allowedTypes:["number-float"],
|
|
66
|
+
freeField:"number-float-price"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
type:"lte",
|
|
70
|
+
allowedTypes:["number-float"],
|
|
71
|
+
freeField:"number-float-price"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
type:"starts_with",
|
|
75
|
+
allowedTypes:["number-float"],
|
|
76
|
+
freeField:"number-float-price"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type:"ends_with",
|
|
80
|
+
allowedTypes:["number-float"],
|
|
81
|
+
freeField:"number-float-price"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
type:"contains",
|
|
85
|
+
allowedTypes:["number-float"],
|
|
86
|
+
freeField:"number-float-price"
|
|
87
|
+
},
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
|
|
40
91
|
allowBindings:["number-float", "text"],
|
|
41
92
|
formatter: (value) => value,
|
|
42
93
|
parser: (value) => value,
|
|
@@ -33,6 +33,37 @@ export default createFieldType({
|
|
|
33
33
|
properties: null
|
|
34
34
|
},
|
|
35
35
|
|
|
36
|
+
// condition
|
|
37
|
+
allowedConditions : (field)=>{
|
|
38
|
+
return [
|
|
39
|
+
{
|
|
40
|
+
type:"eq",
|
|
41
|
+
allowedTypes:["text"],
|
|
42
|
+
freeField:"text-varchar-default"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
type:"ne",
|
|
46
|
+
allowedTypes:["text"],
|
|
47
|
+
freeField:"text-varchar-default"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
type:"starts_with",
|
|
51
|
+
allowedTypes:["text"],
|
|
52
|
+
freeField:"text-varchar-default"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
type:"ends_with",
|
|
56
|
+
allowedTypes:["text"],
|
|
57
|
+
freeField:"text-varchar-default"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
type:"contains",
|
|
61
|
+
allowedTypes:["text"],
|
|
62
|
+
freeField:"text-varchar-default"
|
|
63
|
+
},
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
|
|
36
67
|
allowBindings:["text-textarea"],
|
|
37
68
|
|
|
38
69
|
formatter: (value) => value,
|
package/src/lib/registry/fieldTypeRegistry/fieldTypes/text/varchar/TextVarcharDefault/Input.svelte
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<Line {compact}>
|
|
10
|
-
|
|
10
|
+
{#if label}
|
|
11
|
+
<Label {unique} {secret} {label} {required}></Label>
|
|
12
|
+
{/if}
|
|
11
13
|
<FieldTypeInputText {...props} placeholder="votre texte" {required}></FieldTypeInputText>
|
|
12
14
|
</Line>
|
package/src/lib/registry/fieldTypeRegistry/fieldTypes/text/varchar/TextVarcharDefault/index.js
CHANGED
|
@@ -33,6 +33,37 @@ export default createFieldType({
|
|
|
33
33
|
properties: null
|
|
34
34
|
},
|
|
35
35
|
|
|
36
|
+
// condition
|
|
37
|
+
allowedConditions : (field)=>{
|
|
38
|
+
return [
|
|
39
|
+
{
|
|
40
|
+
type:"eq",
|
|
41
|
+
allowedTypes:["text"],
|
|
42
|
+
freeField:"text-varchar-default"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
type:"ne",
|
|
46
|
+
allowedTypes:["text"],
|
|
47
|
+
freeField:"text-varchar-default"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
type:"starts_with",
|
|
51
|
+
allowedTypes:["text"],
|
|
52
|
+
freeField:"text-varchar-default"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
type:"ends_with",
|
|
56
|
+
allowedTypes:["text"],
|
|
57
|
+
freeField:"text-varchar-default"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
type:"contains",
|
|
61
|
+
allowedTypes:["text"],
|
|
62
|
+
freeField:"text-varchar-default"
|
|
63
|
+
},
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
|
|
36
67
|
allowBindings:["text"],
|
|
37
68
|
|
|
38
69
|
formatter: (value) => value,
|
package/src/lib/registry/fieldTypeRegistry/fieldTypes/text/varchar/TextVarcharEmail/Input.svelte
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<Line {compact}>
|
|
9
|
-
|
|
9
|
+
{#if label}
|
|
10
|
+
<Label {unique} {secret} {label} {required}></Label>
|
|
11
|
+
{/if}
|
|
10
12
|
<FieldTypeInputText {...props} placeholder="votre texte" {required}></FieldTypeInputText>
|
|
11
13
|
</Line>
|
package/src/lib/registry/fieldTypeRegistry/fieldTypes/text/varchar/TextVarcharEmail/index.js
CHANGED
|
@@ -33,6 +33,37 @@ export default createFieldType({
|
|
|
33
33
|
properties: null
|
|
34
34
|
},
|
|
35
35
|
|
|
36
|
+
// condition
|
|
37
|
+
allowedConditions : (field)=>{
|
|
38
|
+
return [
|
|
39
|
+
{
|
|
40
|
+
type:"eq",
|
|
41
|
+
allowedTypes:["text"],
|
|
42
|
+
freeField:"text-varchar-default"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
type:"ne",
|
|
46
|
+
allowedTypes:["text"],
|
|
47
|
+
freeField:"text-varchar-default"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
type:"starts_with",
|
|
51
|
+
allowedTypes:["text"],
|
|
52
|
+
freeField:"text-varchar-default"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
type:"ends_with",
|
|
56
|
+
allowedTypes:["text"],
|
|
57
|
+
freeField:"text-varchar-default"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
type:"contains",
|
|
61
|
+
allowedTypes:["text"],
|
|
62
|
+
freeField:"text-varchar-default"
|
|
63
|
+
},
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
|
|
36
67
|
allowBindings:["text"],
|
|
37
68
|
formatter: (value) => value,
|
|
38
69
|
parser: (value) => value,
|
package/src/lib/registry/fieldTypeRegistry/fieldTypes/text/varchar/TextVarcharPhone/Input.svelte
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<Line {compact}>
|
|
9
|
-
|
|
9
|
+
{#if label}
|
|
10
|
+
<Label {unique} {secret} {label} {required}></Label>
|
|
11
|
+
{/if}
|
|
10
12
|
<FieldTypeInputText {...props} placeholder="votre texte" {required}></FieldTypeInputText>
|
|
11
13
|
</Line>
|
package/src/lib/registry/fieldTypeRegistry/fieldTypes/text/varchar/TextVarcharPhone/index.js
CHANGED
|
@@ -12,8 +12,8 @@ export default createFieldType({
|
|
|
12
12
|
|
|
13
13
|
category_path: 'text-varchar',
|
|
14
14
|
|
|
15
|
-
label: '
|
|
16
|
-
description: '
|
|
15
|
+
label: 'Téléphone',
|
|
16
|
+
description: 'Numéro de téléphone au format international ou local.',
|
|
17
17
|
|
|
18
18
|
is_hidden: false,
|
|
19
19
|
|
|
@@ -33,6 +33,37 @@ export default createFieldType({
|
|
|
33
33
|
properties: null
|
|
34
34
|
},
|
|
35
35
|
|
|
36
|
+
// condition
|
|
37
|
+
allowedConditions : (field)=>{
|
|
38
|
+
return [
|
|
39
|
+
{
|
|
40
|
+
type:"eq",
|
|
41
|
+
allowedTypes:["text"],
|
|
42
|
+
freeField:"text-varchar-default"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
type:"ne",
|
|
46
|
+
allowedTypes:["text"],
|
|
47
|
+
freeField:"text-varchar-default"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
type:"starts_with",
|
|
51
|
+
allowedTypes:["text"],
|
|
52
|
+
freeField:"text-varchar-default"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
type:"ends_with",
|
|
56
|
+
allowedTypes:["text"],
|
|
57
|
+
freeField:"text-varchar-default"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
type:"contains",
|
|
61
|
+
allowedTypes:["text"],
|
|
62
|
+
freeField:"text-varchar-default"
|
|
63
|
+
},
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
|
|
36
67
|
allowBindings:["text"],
|
|
37
68
|
formatter: (value) => value,
|
|
38
69
|
parser: (value) => value,
|
package/src/lib/registry/fieldTypeRegistry/fieldTypes/text/varchar/TextVarcharUrl/Input.svelte
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<Line {compact}>
|
|
9
|
-
|
|
9
|
+
{#if label}
|
|
10
|
+
<Label {unique} {secret} {label} {required}></Label>
|
|
11
|
+
{/if}
|
|
10
12
|
<FieldTypeInputText {...props} placeholder="votre texte" {required}></FieldTypeInputText>
|
|
11
13
|
</Line>
|
|
@@ -33,6 +33,37 @@ export default createFieldType({
|
|
|
33
33
|
properties: null
|
|
34
34
|
},
|
|
35
35
|
|
|
36
|
+
// condition
|
|
37
|
+
allowedConditions : (field)=>{
|
|
38
|
+
return [
|
|
39
|
+
{
|
|
40
|
+
type:"eq",
|
|
41
|
+
allowedTypes:["text"],
|
|
42
|
+
freeField:"text-varchar-default"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
type:"ne",
|
|
46
|
+
allowedTypes:["text"],
|
|
47
|
+
freeField:"text-varchar-default"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
type:"starts_with",
|
|
51
|
+
allowedTypes:["text"],
|
|
52
|
+
freeField:"text-varchar-default"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
type:"ends_with",
|
|
56
|
+
allowedTypes:["text"],
|
|
57
|
+
freeField:"text-varchar-default"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
type:"contains",
|
|
61
|
+
allowedTypes:["text"],
|
|
62
|
+
freeField:"text-varchar-default"
|
|
63
|
+
},
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
|
|
36
67
|
allowBindings:["text"],
|
|
37
68
|
formatter: (value) => value,
|
|
38
69
|
parser: (value) => value,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import
|
|
2
|
+
import FieldCondition from '$lib/registry/entityRegistry/components/FieldCondition.svelte';
|
|
3
|
+
import WidgetGroup from '$lib/registry/widgetGroupRegistry/components/WidgetGroup.svelte';
|
|
3
4
|
import { registerWidgetGroups } from '$lib/registry/widgetGroupRegistry/registerWidgetGroups';
|
|
4
5
|
import { widgetGroupRegistry } from '$lib/registry/widgetGroupRegistry/registry.svelte';
|
|
5
6
|
import { IconButton, sendRequest, toast } from 'hamzus-ui';
|
|
@@ -12,7 +13,7 @@
|
|
|
12
13
|
});
|
|
13
14
|
|
|
14
15
|
</script>
|
|
15
|
-
|
|
16
|
+
<FieldCondition id={728} allowedFields={[728,707]}></FieldCondition>
|
|
16
17
|
<div class="content">
|
|
17
18
|
<div class="container">
|
|
18
19
|
<div class="title">
|