mountain-ui 1.0.142 → 1.0.144
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 +2 -2
- 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/Lines/Input.svelte +107 -90
- 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/lib/registry/fieldTypeRegistry/fieldTypes/time/TimeFrequency/Button.svelte +8 -0
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/time/TimeFrequency/Card.svelte +6 -0
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/time/TimeFrequency/Icon.svelte +5 -0
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/time/TimeFrequency/Input.svelte +12 -0
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/time/TimeFrequency/TableView.svelte +41 -0
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/time/TimeFrequency/View.svelte +45 -0
- package/src/lib/registry/fieldTypeRegistry/fieldTypes/time/TimeFrequency/index.js +41 -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.144",
|
|
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",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"vitest-browser-svelte": "^2.1.1"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"hamzus-ui": "^0.0.
|
|
79
|
+
"hamzus-ui": "^0.0.262"
|
|
80
80
|
},
|
|
81
81
|
"engines": {
|
|
82
82
|
"node": ">=18.0.0"
|
|
@@ -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
|
+
}
|
|
@@ -153,106 +153,114 @@
|
|
|
153
153
|
}
|
|
154
154
|
</script>
|
|
155
155
|
|
|
156
|
-
<div class="
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
<ResponsiveTable.
|
|
161
|
-
|
|
162
|
-
{#
|
|
163
|
-
|
|
164
|
-
<
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
{#
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
id={row.fieldId}
|
|
191
|
-
value={table[lineIndex].ctx?.[row.fieldId] ?? null}
|
|
192
|
-
registerCalculation={(config) => {
|
|
193
|
-
handleRegisterCalculation(lineIndex, config);
|
|
194
|
-
}}
|
|
195
|
-
></FieldInput>
|
|
196
|
-
{/each}
|
|
197
|
-
{#if columnIndex + 1 === columns.length}
|
|
198
|
-
<div class="delete">
|
|
199
|
-
<IconButton
|
|
200
|
-
variant="destructive"
|
|
201
|
-
onClick={() => {
|
|
202
|
-
handleDeleteLine(lineIndex);
|
|
156
|
+
<div class="table">
|
|
157
|
+
<div class="title">
|
|
158
|
+
<Label {label} {required} {secret} {unique}></Label>
|
|
159
|
+
</div>
|
|
160
|
+
<ResponsiveTable.Root let:ctx>
|
|
161
|
+
<ResponsiveTable.Header>
|
|
162
|
+
{#if columns.length > 0}
|
|
163
|
+
{#each columns as column, columnIndex}
|
|
164
|
+
<ResponsiveTable.HeaderCell align="left" label={column.name ?? '-'} {ctx}>
|
|
165
|
+
<h6>{columns[columnIndex].name ?? ''}</h6>
|
|
166
|
+
<!-- {column.columnIndex} -->
|
|
167
|
+
</ResponsiveTable.HeaderCell>
|
|
168
|
+
{/each}
|
|
169
|
+
{/if}
|
|
170
|
+
</ResponsiveTable.Header>
|
|
171
|
+
<ResponsiveTable.Body>
|
|
172
|
+
{#if $entity}
|
|
173
|
+
{#each table as line, lineIndex (line.id)}
|
|
174
|
+
<ResponsiveTable.Line>
|
|
175
|
+
{#each columns as column, columnIndex}
|
|
176
|
+
<ResponsiveTable.Cell {ctx}>
|
|
177
|
+
{#each column.rows as row, rowIndex}
|
|
178
|
+
<FieldInput
|
|
179
|
+
compact
|
|
180
|
+
detailsCtx={table[lineIndex].detailsCtx}
|
|
181
|
+
ctx={table[lineIndex].ctx}
|
|
182
|
+
onChangeDetails={(value) => {
|
|
183
|
+
handleChangeDetails(lineIndex, row.fieldId, value);
|
|
184
|
+
}}
|
|
185
|
+
onChange={(value) => {
|
|
186
|
+
handleChange(lineIndex, row.fieldId, value);
|
|
187
|
+
}}
|
|
188
|
+
changeCtx={(fieldId, value) => {
|
|
189
|
+
handleChange(lineIndex, fieldId, value);
|
|
203
190
|
}}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
191
|
+
id={row.fieldId}
|
|
192
|
+
value={table[lineIndex].ctx?.[row.fieldId] ?? null}
|
|
193
|
+
registerCalculation={(config) => {
|
|
194
|
+
handleRegisterCalculation(lineIndex, config);
|
|
195
|
+
}}
|
|
196
|
+
></FieldInput>
|
|
197
|
+
{/each}
|
|
198
|
+
{#if columnIndex + 1 === columns.length}
|
|
199
|
+
<div class="delete">
|
|
200
|
+
<IconButton
|
|
201
|
+
variant="destructive"
|
|
202
|
+
onClick={() => {
|
|
203
|
+
handleDeleteLine(lineIndex);
|
|
204
|
+
}}
|
|
211
205
|
>
|
|
212
|
-
<
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
206
|
+
<svg
|
|
207
|
+
width="24"
|
|
208
|
+
height="24"
|
|
209
|
+
viewBox="0 0 24 24"
|
|
210
|
+
fill="none"
|
|
211
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
212
|
+
>
|
|
213
|
+
<path
|
|
214
|
+
d="M20.9997 6.72998C20.9797 6.72998 20.9497 6.72998 20.9197 6.72998C15.6297 6.19998 10.3497 5.99998 5.11967 6.52998L3.07967 6.72998C2.65967 6.76998 2.28967 6.46998 2.24967 6.04998C2.20967 5.62998 2.50967 5.26998 2.91967 5.22998L4.95967 5.02998C10.2797 4.48998 15.6697 4.69998 21.0697 5.22998C21.4797 5.26998 21.7797 5.63998 21.7397 6.04998C21.7097 6.43998 21.3797 6.72998 20.9997 6.72998Z"
|
|
215
|
+
fill="#292D32"
|
|
216
|
+
/>
|
|
217
|
+
<path
|
|
218
|
+
d="M8.50074 5.72C8.46074 5.72 8.42074 5.72 8.37074 5.71C7.97074 5.64 7.69074 5.25 7.76074 4.85L7.98074 3.54C8.14074 2.58 8.36074 1.25 10.6907 1.25H13.3107C15.6507 1.25 15.8707 2.63 16.0207 3.55L16.2407 4.85C16.3107 5.26 16.0307 5.65 15.6307 5.71C15.2207 5.78 14.8307 5.5 14.7707 5.1L14.5507 3.8C14.4107 2.93 14.3807 2.76 13.3207 2.76H10.7007C9.64074 2.76 9.62074 2.9 9.47074 3.79L9.24074 5.09C9.18074 5.46 8.86074 5.72 8.50074 5.72Z"
|
|
219
|
+
fill="#292D32"
|
|
220
|
+
/>
|
|
221
|
+
<path
|
|
222
|
+
d="M15.2104 22.7501H8.79039C5.30039 22.7501 5.16039 20.8201 5.05039 19.2601L4.40039 9.19007C4.37039 8.78007 4.69039 8.42008 5.10039 8.39008C5.52039 8.37008 5.87039 8.68008 5.90039 9.09008L6.55039 19.1601C6.66039 20.6801 6.70039 21.2501 8.79039 21.2501H15.2104C17.3104 21.2501 17.3504 20.6801 17.4504 19.1601L18.1004 9.09008C18.1304 8.68008 18.4904 8.37008 18.9004 8.39008C19.3104 8.42008 19.6304 8.77007 19.6004 9.19007L18.9504 19.2601C18.8404 20.8201 18.7004 22.7501 15.2104 22.7501Z"
|
|
223
|
+
fill="#292D32"
|
|
224
|
+
/>
|
|
225
|
+
<path
|
|
226
|
+
d="M13.6601 17.25H10.3301C9.92008 17.25 9.58008 16.91 9.58008 16.5C9.58008 16.09 9.92008 15.75 10.3301 15.75H13.6601C14.0701 15.75 14.4101 16.09 14.4101 16.5C14.4101 16.91 14.0701 17.25 13.6601 17.25Z"
|
|
227
|
+
fill="#292D32"
|
|
228
|
+
/>
|
|
229
|
+
<path
|
|
230
|
+
d="M14.5 13.25H9.5C9.09 13.25 8.75 12.91 8.75 12.5C8.75 12.09 9.09 11.75 9.5 11.75H14.5C14.91 11.75 15.25 12.09 15.25 12.5C15.25 12.91 14.91 13.25 14.5 13.25Z"
|
|
231
|
+
fill="#292D32"
|
|
232
|
+
/>
|
|
233
|
+
</svg>
|
|
234
|
+
</IconButton>
|
|
235
|
+
</div>
|
|
236
|
+
{/if}
|
|
237
|
+
</ResponsiveTable.Cell>
|
|
238
|
+
{/each}
|
|
239
|
+
</ResponsiveTable.Line>
|
|
240
|
+
{/each}
|
|
241
|
+
{/if}
|
|
242
|
+
</ResponsiveTable.Body>
|
|
243
|
+
</ResponsiveTable.Root>
|
|
244
|
+
<div class="title">
|
|
245
|
+
<Button onClick={handleAddLine}>
|
|
246
|
+
<h5>ajouter une rangée</h5>
|
|
247
|
+
</Button>
|
|
248
|
+
<Label label="/{label}" {required} {secret} {unique}></Label>
|
|
249
|
+
</div>
|
|
247
250
|
</div>
|
|
248
251
|
|
|
249
252
|
<style>
|
|
250
253
|
.title {
|
|
251
254
|
display: flex;
|
|
252
255
|
align-items: center;
|
|
256
|
+
justify-content: space-between;
|
|
257
|
+
padding: var(--pad-m);
|
|
253
258
|
width: 100%;
|
|
254
259
|
}
|
|
255
|
-
|
|
260
|
+
.title:last-child {
|
|
261
|
+
border-top: 1px solid var(--bg-blur);
|
|
262
|
+
}
|
|
263
|
+
:global(.table-container .line:has( > .cell > .delete .button:hover)) {
|
|
256
264
|
background-color: var(--red-b);
|
|
257
265
|
}
|
|
258
266
|
|
|
@@ -265,4 +273,13 @@
|
|
|
265
273
|
justify-content: end;
|
|
266
274
|
padding: var(--pad-s);
|
|
267
275
|
}
|
|
276
|
+
|
|
277
|
+
.table {
|
|
278
|
+
width: 100%;
|
|
279
|
+
height: fit-content;
|
|
280
|
+
border-radius: var(--radius-m);
|
|
281
|
+
overflow: clip;
|
|
282
|
+
border: 1px solid var(--stroke);
|
|
283
|
+
padding: var(--pad-s);
|
|
284
|
+
}
|
|
268
285
|
</style>
|
|
@@ -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,
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M12 22.75C6.76 22.75 2.5 18.49 2.5 13.25C2.5 8.01 6.76 3.75 12 3.75C17.24 3.75 21.5 8.01 21.5 13.25C21.5 18.49 17.24 22.75 12 22.75ZM12 5.25C7.59 5.25 4 8.84 4 13.25C4 17.66 7.59 21.25 12 21.25C16.41 21.25 20 17.66 20 13.25C20 8.84 16.41 5.25 12 5.25Z" fill="#292D32"/>
|
|
3
|
+
<path d="M12 13.75C11.59 13.75 11.25 13.41 11.25 13V8C11.25 7.59 11.59 7.25 12 7.25C12.41 7.25 12.75 7.59 12.75 8V13C12.75 13.41 12.41 13.75 12 13.75Z" fill="#292D32"/>
|
|
4
|
+
<path d="M15 2.75H9C8.59 2.75 8.25 2.41 8.25 2C8.25 1.59 8.59 1.25 9 1.25H15C15.41 1.25 15.75 1.59 15.75 2C15.75 2.41 15.41 2.75 15 2.75Z" fill="#292D32"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import Label from '../../../components/Label.svelte';
|
|
3
|
+
import Line from '../../../components/Line.svelte';
|
|
4
|
+
import { FrequencyPicker, MonthPicker } from 'hamzus-ui';
|
|
5
|
+
|
|
6
|
+
let { label, unique = false, secret = false, compact = false, required, ...props } = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<Line {compact}>
|
|
10
|
+
<Label {unique} {secret} {label} {required}></Label>
|
|
11
|
+
<FrequencyPicker {...props} {required}></FrequencyPicker>
|
|
12
|
+
</Line>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import ViewText from "../../../components/ViewText.svelte";
|
|
3
|
+
|
|
4
|
+
let { value } = $props();
|
|
5
|
+
|
|
6
|
+
function getText(frequencyType, weekDays, monthDay, firstBusinessDay) {
|
|
7
|
+
let text = MODES[frequencyType];
|
|
8
|
+
|
|
9
|
+
if (frequencyType === 'weekly') {
|
|
10
|
+
text += ' | ';
|
|
11
|
+
for (let i = 0; i < weekDays.length; i++) {
|
|
12
|
+
const weekDay = weekDays[i];
|
|
13
|
+
|
|
14
|
+
text += DAYS[weekDay];
|
|
15
|
+
if (i < weekDays.length - 1) {
|
|
16
|
+
text += ', ';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (frequencyType === 'monthly') {
|
|
21
|
+
text += ' | ';
|
|
22
|
+
for (let i = 0; i < monthDay.length; i++) {
|
|
23
|
+
const day = monthDay[i];
|
|
24
|
+
|
|
25
|
+
text += day === 'last' ? 'dernier jour' : day;
|
|
26
|
+
if (i < monthDay.length - 1) {
|
|
27
|
+
text += ', ';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (ALLOWED_BUSINESS_TYPES.includes(frequencyType) && firstBusinessDay) {
|
|
33
|
+
text += ' | ignoré le weekend';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return text;
|
|
37
|
+
}
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
<ViewText>{value === null || !value.flat ? '-' : getText(value.flat)}</ViewText>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import Label from '../../../components/Label.svelte';
|
|
3
|
+
import LineView from '../../../components/LineView.svelte';
|
|
4
|
+
import ViewText from '../../../components/ViewText.svelte';
|
|
5
|
+
|
|
6
|
+
let { value, compact, unique, secret, label, required } = $props();
|
|
7
|
+
|
|
8
|
+
function getText(frequencyType, weekDays, monthDay, firstBusinessDay) {
|
|
9
|
+
let text = MODES[frequencyType];
|
|
10
|
+
|
|
11
|
+
if (frequencyType === 'weekly') {
|
|
12
|
+
text += ' | ';
|
|
13
|
+
for (let i = 0; i < weekDays.length; i++) {
|
|
14
|
+
const weekDay = weekDays[i];
|
|
15
|
+
|
|
16
|
+
text += DAYS[weekDay];
|
|
17
|
+
if (i < weekDays.length - 1) {
|
|
18
|
+
text += ', ';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (frequencyType === 'monthly') {
|
|
23
|
+
text += ' | ';
|
|
24
|
+
for (let i = 0; i < monthDay.length; i++) {
|
|
25
|
+
const day = monthDay[i];
|
|
26
|
+
|
|
27
|
+
text += day === 'last' ? 'dernier jour' : day;
|
|
28
|
+
if (i < monthDay.length - 1) {
|
|
29
|
+
text += ', ';
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (ALLOWED_BUSINESS_TYPES.includes(frequencyType) && firstBusinessDay) {
|
|
35
|
+
text += ' | ignoré le weekend';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return text;
|
|
39
|
+
}
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<LineView {compact}>
|
|
43
|
+
<Label {unique} {secret} {label} {required}></Label>
|
|
44
|
+
<ViewText>{value === null || !value.flat ? '-' : getText(value.flat)}</ViewText>
|
|
45
|
+
</LineView>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { createFieldType } from '../../../createFieldType.js';
|
|
2
|
+
|
|
3
|
+
import Icon from './Icon.svelte';
|
|
4
|
+
import Button from './Button.svelte';
|
|
5
|
+
import Card from './Card.svelte';
|
|
6
|
+
import Input from './Input.svelte';
|
|
7
|
+
import TableView from './TableView.svelte';
|
|
8
|
+
import View from './View.svelte';
|
|
9
|
+
|
|
10
|
+
export default createFieldType({
|
|
11
|
+
type: 'time-frequency',
|
|
12
|
+
|
|
13
|
+
category_path: 'time',
|
|
14
|
+
|
|
15
|
+
label: 'Fréquence',
|
|
16
|
+
description: "Fréquence de répétition journalière, choisissez quelle jour répéter une action.",
|
|
17
|
+
|
|
18
|
+
is_hidden: false,
|
|
19
|
+
|
|
20
|
+
defaultProps: {},
|
|
21
|
+
|
|
22
|
+
can_be_required: true,
|
|
23
|
+
can_be_unique: false,
|
|
24
|
+
|
|
25
|
+
components: {
|
|
26
|
+
icon: Icon,
|
|
27
|
+
button: Button,
|
|
28
|
+
card: Card,
|
|
29
|
+
input: Input,
|
|
30
|
+
tableView: TableView,
|
|
31
|
+
view: View,
|
|
32
|
+
filter: null,
|
|
33
|
+
properties: null
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
allowBindings:["time-frequency"],
|
|
37
|
+
formatter: (value) => value,
|
|
38
|
+
parser: (value) => value,
|
|
39
|
+
|
|
40
|
+
validate: () => true
|
|
41
|
+
});
|
|
@@ -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">
|