poe-svelte-ui-lib 1.5.10 → 1.5.11

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.
@@ -14,7 +14,7 @@
14
14
  body = $bindable(),
15
15
  header = [],
16
16
  footer = '',
17
- dataBuffer = { stashData: false, rowsAmmount: 10, cleanButton: true, cleanClass: '' },
17
+ dataBuffer = { stashData: false, rowsAmmount: 10, clearButton: true, clearClass: '' },
18
18
  type = 'table',
19
19
  outline = false,
20
20
  cursor = null,
@@ -165,8 +165,8 @@
165
165
  },
166
166
  ]
167
167
 
168
- if (dataBuffer && buffer.length > (dataBuffer.rowsAmmount ?? 10) * 5) {
169
- buffer = buffer.slice(-((dataBuffer.rowsAmmount ?? 10) * 5))
168
+ if (dataBuffer && buffer.length > (dataBuffer.rowsAmmount ?? 10)) {
169
+ buffer = buffer.slice(-(dataBuffer.rowsAmmount ?? 10))
170
170
  }
171
171
 
172
172
  body = null
@@ -309,9 +309,9 @@
309
309
  </div>
310
310
  {/each}
311
311
  </div>
312
- {#if dataBuffer.cleanButton}
312
+ {#if dataBuffer.clearButton}
313
313
  <button
314
- class={twMerge('absolute right-2 bg-(--back-color) rounded-full p-1 cursor-pointer', dataBuffer.cleanClass)}
314
+ class={twMerge('absolute right-2 bg-(--back-color) rounded-full p-1 cursor-pointer', dataBuffer.clearClass)}
315
315
  onclick={() => (buffer = [])}
316
316
  >
317
317
  <ButtonClear />
@@ -374,22 +374,37 @@
374
374
  onUpdate={(option) => {
375
375
  updateProperty('type', option.value as string, component, onPropertyChange)
376
376
  if (option.value === 'logger') updateProperty('dataBuffer.stashData', true, component, onPropertyChange)
377
+ if (option.value === 'table') updateProperty('dataBuffer.clearButton', false, component, onPropertyChange)
377
378
  }}
378
379
  />
379
- <UI.Switch
380
- label={{ name: $t('constructor.props.table.stashData') }}
381
- value={component.properties.dataBuffer.stashData}
382
- options={[{ id: crypto.randomUUID(), value: 0, class: '', disabled: component.properties.type === 'logger' }]}
383
- onChange={(value) => {
384
- updateProperty('dataBuffer.stashData', value, component, onPropertyChange)
385
- }}
386
- />
387
- {#if component.properties.stashData}
388
- <UI.Input
380
+ <div class="flex">
381
+ <UI.Switch
382
+ label={{ name: $t('constructor.props.table.stashData') }}
383
+ value={component.properties.dataBuffer.stashData}
384
+ options={[{ id: crypto.randomUUID(), value: 0, class: '', disabled: component.properties.type === 'logger' }]}
385
+ onChange={(value) => {
386
+ updateProperty('dataBuffer.stashData', value, component, onPropertyChange)
387
+ }}
388
+ />
389
+ {#if component.properties.type === 'logger'}
390
+ <UI.Switch
391
+ label={{ name: $t('constructor.props.table.clearButton') }}
392
+ value={component.properties.dataBuffer.clearButton}
393
+ options={[{ id: crypto.randomUUID(), value: 0, class: '' }]}
394
+ onChange={(value) => {
395
+ updateProperty('dataBuffer.clearButton', value, component, onPropertyChange)
396
+ }}
397
+ />
398
+ {/if}
399
+ </div>
400
+
401
+ {#if component.properties.dataBuffer.stashData}
402
+ <UI.Select
389
403
  label={{ name: $t('constructor.props.table.buffersize') }}
390
- type="number"
391
- value={component.properties.dataBuffer.rowsAmmount}
392
- onUpdate={(value) => updateProperty('dataBuffer.rowsAmmount', value as string, component, onPropertyChange)}
404
+ type="buttons"
405
+ options={$optionsStore.BUFFER_SIFE_OPTIONS}
406
+ value={$optionsStore.BUFFER_SIFE_OPTIONS.find((o) => o.value === component.properties.dataBuffer.rowsAmmount)}
407
+ onUpdate={(value) => updateProperty('dataBuffer.rowsAmmount', value.value as number, component, onPropertyChange)}
393
408
  />
394
409
  {/if}
395
410
  </div>
@@ -153,6 +153,7 @@ const translations = {
153
153
  'constructor.props.table.keys.info': 'Ключи таблицы, значения которых будут возвращаться',
154
154
  'constructor.props.table.stashData': 'Накопление данных',
155
155
  'constructor.props.table.buffersize': 'Размер буфера',
156
+ 'constructor.props.table.clearButton': 'Кнопка очистки',
156
157
  'constructor.props.icon.access': 'Доступ',
157
158
  'constructor.props.icon.common': 'Общее',
158
159
  'constructor.props.icon.scenarios': 'Сценарии',
package/dist/options.d.ts CHANGED
@@ -120,6 +120,11 @@ export declare const optionsStore: import("svelte/store").Readable<{
120
120
  value: string;
121
121
  name: string;
122
122
  }[];
123
+ BUFFER_SIFE_OPTIONS: {
124
+ id: `${string}-${string}-${string}-${string}-${string}`;
125
+ value: number;
126
+ name: string;
127
+ }[];
123
128
  AUTOCOMPLETE_CONSTRUCTOR_OPTIONS: {
124
129
  id: string;
125
130
  value: string;
package/dist/options.js CHANGED
@@ -128,6 +128,13 @@ export const optionsStore = derived(t, ($t) => {
128
128
  { id: id(), value: 'table', name: $t('constructor.props.table.type.table') },
129
129
  { id: id(), value: 'logger', name: $t('constructor.props.table.type.logger') },
130
130
  ],
131
+ BUFFER_SIFE_OPTIONS: [
132
+ { id: crypto.randomUUID(), value: 10, name: '10' },
133
+ { id: crypto.randomUUID(), value: 50, name: '50' },
134
+ { id: crypto.randomUUID(), value: 100, name: '100' },
135
+ { id: crypto.randomUUID(), value: 500, name: '500' },
136
+ { id: crypto.randomUUID(), value: 1000, name: '1000' },
137
+ ],
131
138
  AUTOCOMPLETE_CONSTRUCTOR_OPTIONS: [
132
139
  { id: id(), value: 'on', name: $t('constructor.props.autocomplete.on') },
133
140
  { id: id(), value: 'off', name: $t('constructor.props.autocomplete.off') },
package/dist/types.d.ts CHANGED
@@ -270,8 +270,8 @@ export interface ITableProps<T extends object> {
270
270
  dataBuffer?: {
271
271
  stashData?: boolean;
272
272
  rowsAmmount?: number;
273
- cleanButton?: boolean;
274
- cleanClass?: string;
273
+ clearButton?: boolean;
274
+ clearClass?: string;
275
275
  };
276
276
  outline?: boolean;
277
277
  cursor?: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poe-svelte-ui-lib",
3
- "version": "1.5.10",
3
+ "version": "1.5.11",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@tailwindcss/vite": "^4.1.18",
36
- "prettier": "^3.6.2",
36
+ "prettier": "^3.7.4",
37
37
  "prettier-plugin-svelte": "^3.4.0",
38
38
  "prettier-plugin-tailwindcss": "^0.7.2",
39
39
  "svelte-maplibre-gl": "^1.0.2",