mountain-ui 1.0.142 → 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/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
|
+
}
|
|
@@ -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">
|