poe-svelte-ui-lib 1.5.2 → 1.5.4

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.
@@ -311,7 +311,12 @@
311
311
  </div>
312
312
 
313
313
  {#if body || dataBuffer}
314
- {@const rows = type == 'logger' ? dataBuffer.filter((str) => logType.includes(str.type)).slice(-rowsAmmount) : stashData ? dataBuffer : body}
314
+ {@const rows =
315
+ type == 'logger'
316
+ ? dataBuffer.filter((str) => logType.includes(str.type)).slice(-rowsAmmount)
317
+ : stashData
318
+ ? dataBuffer.slice(-rowsAmmount)
319
+ : body}
315
320
  <!-- Table Body с прокруткой -->
316
321
  <div class="flex-1 overflow-y-auto bg-(--container-color)/50" bind:this={container} onscroll={handleScroll}>
317
322
  <div class="grid min-w-0" style={`grid-template-columns: ${header.map((c) => c.width || 'minmax(0, 1fr)').join(' ')};`}>
@@ -57,14 +57,11 @@
57
57
  }
58
58
 
59
59
  const updateButtonProperty = (columnIndex: number, buttonIndex: number, field: string, value: any) => {
60
- if (field === 'eventHandler') {
61
- } else {
62
- const headers = [...component.properties.header]
63
- const buttons = [...headers[columnIndex].buttons]
64
- buttons[buttonIndex] = { ...buttons[buttonIndex], [field]: value }
65
- headers[columnIndex].buttons = buttons
66
- updateProperty('header', headers, component, onPropertyChange)
67
- }
60
+ const headers = [...component.properties.header]
61
+ const buttons = [...headers[columnIndex].buttons]
62
+ buttons[buttonIndex] = { ...buttons[buttonIndex], [field]: value }
63
+ headers[columnIndex].buttons = buttons
64
+ updateProperty('header', headers, component, onPropertyChange)
68
65
  }
69
66
 
70
67
  const removeButtonFromColumn = (columnIndex: number, buttonIndex: number) => {
@@ -143,12 +140,14 @@
143
140
  options={$optionsStore.TEXT_ALIGN_OPTIONS}
144
141
  onUpdate={(option) => updateProperty('label.class', twMerge(component.properties.label.class, option.value), component, onPropertyChange)}
145
142
  />
146
- <UI.Input
147
- label={{ name: $t('constructor.props.table.buffersize') }}
148
- type="number"
149
- value={component.properties.rowsAmmount}
150
- onUpdate={(value) => updateProperty('rowsAmmount', value as string, component, onPropertyChange)}
151
- />
143
+ {#if component.properties.stashData}
144
+ <UI.Input
145
+ label={{ name: $t('constructor.props.table.buffersize') }}
146
+ type="number"
147
+ value={component.properties.rowsAmmount}
148
+ onUpdate={(value) => updateProperty('rowsAmmount', value as string, component, onPropertyChange)}
149
+ />
150
+ {/if}
152
151
  </div>
153
152
  </div>
154
153
 
@@ -385,12 +384,14 @@
385
384
  updateProperty('stashData', value, component, onPropertyChange)
386
385
  }}
387
386
  />
388
- <UI.Input
389
- label={{ name: $t('constructor.props.table.buffersize') }}
390
- type="number"
391
- value={component.properties.rowsAmmount}
392
- onUpdate={(value) => updateProperty('rowsAmmount', value as string, component, onPropertyChange)}
393
- />
387
+ {#if component.properties.stashData}
388
+ <UI.Input
389
+ label={{ name: $t('constructor.props.table.buffersize') }}
390
+ type="number"
391
+ value={component.properties.rowsAmmount}
392
+ onUpdate={(value) => updateProperty('rowsAmmount', value as string, component, onPropertyChange)}
393
+ />
394
+ {/if}
394
395
  </div>
395
396
  </div>
396
397
 
@@ -606,6 +607,7 @@
606
607
  onUpdate={(value) => {
607
608
  const handler = { ...button.eventHandler }
608
609
  handler.Variables = (value as string).trim().split(/\s+/)
610
+ console.log(handler)
609
611
  updateButtonProperty(columnIndex, buttonIndex, 'eventHandler', handler)
610
612
  }}
611
613
  />
@@ -26,10 +26,10 @@
26
26
  let currentTabIndex: number = $derived(activeTab)
27
27
  </script>
28
28
 
29
- <div id={`${id}-${crypto.randomUUID().slice(0, 6)}`} class="w-full rounded-2xl bg-(--back-color)">
29
+ <div id={`${id}-${crypto.randomUUID().slice(0, 6)}`} class="w-full h-full flex flex-col rounded-2xl bg-(--back-color) overflow-hidden">
30
30
  <!-- Вкладки -->
31
31
  <div
32
- class="{twMerge('bg-blue sticky top-0 z-50 flex h-fit items-center overflow-x-auto rounded-t-2xl px-1', wrapperClass)}
32
+ class="{twMerge(`bg-blue z-50 flex h-fit items-center rounded-t-2xl overflow-x-auto px-1`, wrapperClass)}
33
33
  bg-(--bg-color)"
34
34
  >
35
35
  {#each items as item, index}
@@ -72,7 +72,7 @@
72
72
 
73
73
  <!-- Контент вкладки -->
74
74
  <div
75
- class="grid w-full gap-2 rounded-2xl bg-(--back-color) p-4"
75
+ class="grid flex-1 overflow-y-scroll w-full gap-2 rounded-2xl bg-(--back-color) p-4"
76
76
  style="grid-template-columns: repeat({size.width || 1}, minmax(0, 1fr)); grid-template-rows: repeat({size.height || 1}, auto);"
77
77
  >
78
78
  {#if Components}
@@ -92,7 +92,7 @@
92
92
  background: var(--back-color);
93
93
  }
94
94
  ::-webkit-scrollbar-thumb {
95
- background-color: color-mix(in srgb, var(--bg-color), var(--back-color) 20%);
95
+ background-color: color-mix(in srgb, var(--blue-color), white);
96
96
  border-radius: 8px;
97
97
  cursor: pointer;
98
98
  }
package/dist/types.d.ts CHANGED
@@ -20,7 +20,7 @@ export declare const updateComponent: (component: UIComponent, updates: Partial<
20
20
  eventHandler: IUIComponentHandler | undefined;
21
21
  id: string;
22
22
  type: "Button" | "Accordion" | "Input" | "Select" | "Switch" | "ColorPicker" | "Slider" | "TextField" | "Joystick" | "ProgressBar" | "Graph" | "Table" | "Tabs" | "FileAttach" | "Map";
23
- position: Position;
23
+ position: Required<Position>;
24
24
  parentId: string;
25
25
  };
26
26
  export interface UIComponent {
@@ -29,7 +29,7 @@ export interface UIComponent {
29
29
  access?: 'full' | 'viewOnly' | 'hidden';
30
30
  type: 'Button' | 'Accordion' | 'Input' | 'Select' | 'Switch' | 'ColorPicker' | 'Slider' | 'TextField' | 'Joystick' | 'ProgressBar' | 'Graph' | 'Table' | 'Tabs' | 'FileAttach' | 'Map';
31
31
  properties: IAccordionProps | IButtonProps | IInputProps | ISelectProps | ISwitchProps | IColorPickerProps | ISliderProps | ITextFieldProps | IProgressBarProps | IGraphProps | ITableProps<object> | ITabsProps | IFileAttachProps | IJoystickProps | IMapProps;
32
- position: Position;
32
+ position: Required<Position>;
33
33
  parentId: string;
34
34
  eventHandler?: IUIComponentHandler;
35
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poe-svelte-ui-lib",
3
- "version": "1.5.2",
3
+ "version": "1.5.4",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {