@rokkit/ui 1.0.0-next.128 → 1.0.0-next.130
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rokkit/ui",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.130",
|
|
4
4
|
"description": "Data driven UI components for Rokkit applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"svelte": "./src/index.ts",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"dropdown"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@rokkit/core": "1.0.0-next.
|
|
39
|
-
"@rokkit/data": "1.0.0-next.
|
|
40
|
-
"@rokkit/states": "1.0.0-next.
|
|
41
|
-
"@rokkit/actions": "1.0.0-next.
|
|
38
|
+
"@rokkit/core": "1.0.0-next.130",
|
|
39
|
+
"@rokkit/data": "1.0.0-next.130",
|
|
40
|
+
"@rokkit/states": "1.0.0-next.130",
|
|
41
|
+
"@rokkit/actions": "1.0.0-next.130"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"shiki": "^3.23.0",
|
|
@@ -71,6 +71,18 @@
|
|
|
71
71
|
{@render defaultCrumb(proxy, isLast)}
|
|
72
72
|
{/if}
|
|
73
73
|
</span>
|
|
74
|
+
{:else if proxy.get('href')}
|
|
75
|
+
<a
|
|
76
|
+
href={proxy.get('href')}
|
|
77
|
+
data-breadcrumb-link
|
|
78
|
+
onclick={() => handleClick(proxy)}
|
|
79
|
+
>
|
|
80
|
+
{#if crumb}
|
|
81
|
+
{@render crumb(proxy, isLast)}
|
|
82
|
+
{:else}
|
|
83
|
+
{@render defaultCrumb(proxy, isLast)}
|
|
84
|
+
{/if}
|
|
85
|
+
</a>
|
|
74
86
|
{:else}
|
|
75
87
|
<button
|
|
76
88
|
type="button"
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
</script>
|
|
92
92
|
|
|
93
93
|
{#snippet collapsibleIcon(proxy: ProxyItem)}
|
|
94
|
-
{#if collapsible}
|
|
94
|
+
{#if collapsible && proxy.hasChildren}
|
|
95
95
|
<span
|
|
96
96
|
data-list-expand-icon
|
|
97
97
|
class={proxy.expanded ? icons.opened : icons.closed}
|
|
@@ -139,6 +139,7 @@
|
|
|
139
139
|
{:else}
|
|
140
140
|
<ItemContent {proxy} />
|
|
141
141
|
{/if}
|
|
142
|
+
|
|
142
143
|
{@render collapsibleIcon(proxy)}
|
|
143
144
|
</button>
|
|
144
145
|
{:else if proxy.get('href')}
|
|
@@ -160,7 +161,6 @@
|
|
|
160
161
|
{:else}
|
|
161
162
|
<ItemContent {proxy} />
|
|
162
163
|
{/if}
|
|
163
|
-
{@render collapsibleIcon(proxy)}
|
|
164
164
|
</a>
|
|
165
165
|
{:else}
|
|
166
166
|
<!--
|
|
@@ -36,23 +36,11 @@
|
|
|
36
36
|
class: className = '',
|
|
37
37
|
children
|
|
38
38
|
}: RevealProps = $props()
|
|
39
|
-
|
|
40
|
-
let el: HTMLDivElement | null = $state(null)
|
|
41
|
-
|
|
42
|
-
function handleReveal(e: CustomEvent<{ visible: boolean }>) {
|
|
43
|
-
if (!e.detail.visible || stagger <= 0 || !el) return
|
|
44
|
-
const children = el.children
|
|
45
|
-
for (let i = 0; i < children.length; i++) {
|
|
46
|
-
;(children[i] as HTMLElement).style.transitionDelay = `${delay + i * stagger}ms`
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
39
|
</script>
|
|
50
40
|
|
|
51
41
|
<div
|
|
52
|
-
bind:this={el}
|
|
53
42
|
class={className || undefined}
|
|
54
|
-
use:reveal={{ direction, distance, duration, delay
|
|
55
|
-
onreveal={handleReveal}
|
|
43
|
+
use:reveal={{ direction, distance, duration, delay, stagger, once, threshold, easing }}
|
|
56
44
|
>
|
|
57
45
|
{@render children?.()}
|
|
58
46
|
</div>
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
let filterQuery = $state('')
|
|
99
99
|
let filterInputRef = $state<HTMLInputElement | null>(null)
|
|
100
100
|
|
|
101
|
-
const textField = $derived(fields?.
|
|
101
|
+
const textField = $derived(fields?.label || 'label')
|
|
102
102
|
const childrenField = $derived(fields?.children || 'children')
|
|
103
103
|
|
|
104
104
|
const filteredItems = $derived.by(() => {
|
package/src/types/menu.ts
CHANGED
|
@@ -21,7 +21,7 @@ export interface MenuProps {
|
|
|
21
21
|
/** Array of items (same as List: supports groups, separators, nested children) */
|
|
22
22
|
items?: unknown[]
|
|
23
23
|
|
|
24
|
-
/** Field mapping — overrides BASE_FIELDS defaults (
|
|
24
|
+
/** Field mapping — overrides BASE_FIELDS defaults (label → 'label', value → 'value', …) */
|
|
25
25
|
fields?: Record<string, string>
|
|
26
26
|
|
|
27
27
|
/** Current active value (highlights matching item) */
|