poe-svelte-ui-lib 1.109.0 → 1.110.0
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/dist/Tabs/README.md +1 -1
- package/dist/Tabs/Tabs.svelte +4 -1
- package/package.json +1 -1
package/dist/Tabs/README.md
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
Содержимое можно передать тремя способами (если переданы несколько, работает первый по списку):
|
|
45
45
|
|
|
46
|
-
1. список компонентов `apiArray` и сниппет `Components`, который их рисует. Так делают конструктор и превью интерфейса. На вкладке показываются компоненты, у которых `id` оканчивается номером этой вкладки (с нуля)
|
|
46
|
+
1. список компонентов `apiArray` и сниппет `Components`, который их рисует. Так делают конструктор и превью интерфейса. На вкладке показываются компоненты, у которых `id` оканчивается номером этой вкладки (с нуля). У id из конструктора (UUID без первого символа, 35 знаков, + номер) номер берётся после 35-го знака, поэтому цифра в конце UUID не мешает;
|
|
47
47
|
2. общий сниппет `children`, он получает текущую вкладку;
|
|
48
48
|
3. сниппет у каждой вкладки `items[].children`.
|
|
49
49
|
|
package/dist/Tabs/Tabs.svelte
CHANGED
|
@@ -20,6 +20,9 @@
|
|
|
20
20
|
}: ITabsProps = $props()
|
|
21
21
|
|
|
22
22
|
const isCol = $derived(!!items.find((item) => item.class?.startsWith("flex-col")))
|
|
23
|
+
|
|
24
|
+
/* Номер вкладки дочернего компонента. Конструктор даёт id = UUID без первого символа (35 знаков) + номер вкладки: берём всё после 35-го знака, иначе цифра в конце UUID приклеилась бы к номеру. Прочие id - число в конце */
|
|
25
|
+
const tabOfComponent = (componentId: string) => (/^[0-9a-f-]{35}\d+$/i.test(componentId) ? componentId.slice(35) : componentId.match(/(\d+)$/)?.[1])
|
|
23
26
|
</script>
|
|
24
27
|
|
|
25
28
|
<div id={`${id}-${crypto.randomUUID().slice(0, 6)}`} class="h-full w-full" style={widgetAccentStyle(wrapperClass)}>
|
|
@@ -73,7 +76,7 @@
|
|
|
73
76
|
style="grid-template-columns: repeat({size.width || 1}, minmax(0, 1fr)); grid-template-rows: repeat({size.height || 1}, auto);"
|
|
74
77
|
>
|
|
75
78
|
{#if Components}
|
|
76
|
-
{#each (apiArray ?? []).filter((c) => c.id
|
|
79
|
+
{#each (apiArray ?? []).filter((c) => tabOfComponent(c.id) === `${activeTab}`) as comp}
|
|
77
80
|
{@render Components(comp, false)}
|
|
78
81
|
{/each}
|
|
79
82
|
{:else if children}
|