mountain-ui 1.0.141 → 1.0.142

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mountain-ui",
3
3
  "private": false,
4
- "version": "1.0.141",
4
+ "version": "1.0.142",
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",
@@ -25,32 +25,33 @@
25
25
  let isUploading = $state(false);
26
26
 
27
27
  async function handleFileChange(event) {
28
- const file = event.target.files?.[0];
29
- if (!file) return;
28
+ isUploading = true;
29
+ for (const file of event.target.files ?? []) {
30
+ if (!file) return;
30
31
 
31
- isUploading = true;
32
32
 
33
- const request = await sendRequest({
34
- path: '/upload-image',
35
- data: {
36
- file
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
- const fileId = request.data.id;
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
- addFieldId(fileId)
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
- onChange(value)
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
- onChange(value)
78
+ onChange(value);
78
79
  }
79
80
 
80
81
  function openFilePicker() {
81
82
  fileInput.click();
82
83
  }
83
84
 
84
- function resetInput(params) {
85
- value = "[]"
85
+ function resetInput(params) {
86
+ value = '[]';
86
87
 
87
- if (fileInput) fileInput.value = '';
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 onClick={()=>{removeFieldId(fileId)}} loading={isUploading} variant="secondary" size="24px">
113
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
114
- <path opacity="0.4" 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" fill="#292D32"/>
115
- <path opacity="0.4" 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" fill="#292D32"/>
116
- <path 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" fill="#292D32"/>
117
- <path 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" fill="#292D32"/>
118
- <path 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" fill="#292D32"/>
119
- </svg>
120
- </IconButton>
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