poe-svelte-ui-lib 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,6 +18,7 @@
18
18
  let ID = `${id}-${crypto.randomUUID().slice(0, 6)}`
19
19
  let selectedFile = $state<File | null>(null)
20
20
  let previewUrl = $derived(currentImage ? (currentImage.startsWith('data:') ? currentImage : `data:image/png;base64,${currentImage}`) : null)
21
+ let fileName = $state('')
21
22
 
22
23
  const handleFileChange = (event: Event) => {
23
24
  const input = event.target as HTMLInputElement
@@ -39,9 +40,6 @@
39
40
  const input = document.getElementById(ID)
40
41
  input?.click()
41
42
  }
42
-
43
- let fileName = $state('')
44
- $effect(() => console.log(fileName))
45
43
  </script>
46
44
 
47
45
  <div class={twMerge(`flex flex-col items-center`, wrapperClass)}>
@@ -76,13 +74,24 @@
76
74
  </div>
77
75
  {:else}
78
76
  <label class="relative inline-block w-full">
79
- <input id={ID} type="file" class="absolute left-0 z-1 h-8.5 w-full opacity-0" {accept} {disabled} onchange={handleFileChange} />
77
+ <input
78
+ id={ID}
79
+ type="file"
80
+ class="absolute left-0 z-1 h-8.5 w-full opacity-0 {disabled ? 'cursor-not-allowed' : 'cursor-pointer'}"
81
+ {accept}
82
+ {disabled}
83
+ onchange={handleFileChange}
84
+ />
80
85
  <div
81
86
  class="flex h-8.5 w-full overflow-hidden rounded-2xl font-semibold shadow-sm transition duration-250 hover:shadow-md
82
- ${disabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer'}"
87
+ "
83
88
  >
84
- <div class="flex w-1/3 items-center justify-center bg-(--blue-color)">{$t('constructor.props.file.select')}</div>
85
- <div class="flex w-2/3 items-center justify-start bg-(--back-color) px-2">{fileName || $t('constructor.props.file.notselected')}</div>
89
+ <div class="flex w-1/3 items-center justify-center bg-(--blue-color) {disabled ? 'opacity-50' : ''}">
90
+ {$t('constructor.props.file.select')}
91
+ </div>
92
+ <div class="flex w-2/3 items-center justify-start bg-(--back-color) px-2 {disabled ? 'opacity-50' : ''}">
93
+ {fileName || $t('constructor.props.file.notselected')}
94
+ </div>
86
95
  </div>
87
96
  </label>
88
97
  {/if}
@@ -97,8 +97,6 @@
97
97
 
98
98
  const updateValue = (index: number, delta: number) => {
99
99
  const axis = axes[axes.length == 2 ? index - 1 : index]
100
- console.log(axis)
101
-
102
100
  const min = axis.minNum ?? -360
103
101
  const max = axis.maxNum ?? 360
104
102
 
@@ -198,7 +196,7 @@
198
196
  style="background: color-mix(in srgb, var(--bg-color), var(--shadow-color) 10%)"
199
197
  >
200
198
  <button
201
- class="h-full cursor-pointer rounded-l-full px-3.5"
199
+ class="h-full rotate-270 cursor-pointer rounded-l-full px-3.5"
202
200
  title=""
203
201
  onclick={() => {
204
202
  if (value[0] - sensitivity <= (axes[0].minNum ?? -360)) {
@@ -221,7 +219,7 @@
221
219
  ></button
222
220
  >
223
221
  <button
224
- class="h-full cursor-pointer rounded-r-full px-3.5"
222
+ class="h-full rotate-90 cursor-pointer rounded-r-full px-3.5"
225
223
  title=""
226
224
  onclick={() => {
227
225
  if (value[0] + sensitivity >= (axes[0].maxNum ?? 360)) {
@@ -248,7 +246,7 @@
248
246
  </div>
249
247
 
250
248
  <!-- Нижняя панель -->
251
- <div class="mt-4 flex w-80 flex-col gap-2">
249
+ <div class="mt-3 flex w-80 flex-col gap-1">
252
250
  <div id={`${id}-${crypto.randomUUID().slice(0, 6)}`} class="flex w-full justify-center rounded-full">
253
251
  {#each sensitivityOptions as option, index}
254
252
  <button
@@ -202,7 +202,6 @@
202
202
  component,
203
203
  onPropertyChange,
204
204
  )
205
- console.log(component.properties.axes)
206
205
  }
207
206
  }}
208
207
  />
@@ -336,7 +335,6 @@
336
335
  component,
337
336
  onPropertyChange,
338
337
  )
339
- console.log(component.properties.axes)
340
338
  }
341
339
  }}
342
340
  />
@@ -8,7 +8,7 @@
8
8
  wrapperClass = '',
9
9
  label = { name: '', class: '' },
10
10
  value = $bindable(0),
11
- type = 'vertical',
11
+ type = 'horizontal',
12
12
  number = {
13
13
  minNum: 0,
14
14
  maxNum: 100,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poe-svelte-ui-lib",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {