@intechstudio/grid-uikit 1.20260916.1336 → 1.20260922.819
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/ContextMenu.svelte +12 -3
- package/dist/context-target.js +7 -0
- package/package.json +1 -1
package/dist/ContextMenu.svelte
CHANGED
|
@@ -63,12 +63,15 @@
|
|
|
63
63
|
{#each items as item}
|
|
64
64
|
{@const disabled = item.isDisabled ? item.isDisabled() : false}
|
|
65
65
|
<button
|
|
66
|
-
|
|
66
|
+
class:disabled={disabled}
|
|
67
67
|
{disabled}
|
|
68
68
|
on:click={() => handleItemClicked(item)}
|
|
69
69
|
>
|
|
70
70
|
{#if item.iconPath}
|
|
71
|
-
<SvgIcon
|
|
71
|
+
<SvgIcon
|
|
72
|
+
fill={disabled ? "var(--foreground-disabled)" : "var(--foreground)"}
|
|
73
|
+
iconPath={item.iconPath}
|
|
74
|
+
/>
|
|
72
75
|
{/if}
|
|
73
76
|
<span>{item.text[0]}</span>
|
|
74
77
|
<!-- Spacer for alignment -->
|
|
@@ -116,9 +119,15 @@
|
|
|
116
119
|
letter-spacing: inherit; /* 1 */
|
|
117
120
|
margin: 0; /* 2 */
|
|
118
121
|
background-color: transparent; /* 2 */
|
|
122
|
+
color: inherit;
|
|
119
123
|
cursor: pointer;
|
|
120
124
|
}
|
|
121
|
-
button:hover {
|
|
125
|
+
button:hover:not(.disabled) {
|
|
122
126
|
background-color: var(--background-muted);
|
|
123
127
|
}
|
|
128
|
+
|
|
129
|
+
button.disabled {
|
|
130
|
+
color: var(--foreground-disabled);
|
|
131
|
+
cursor: default;
|
|
132
|
+
}
|
|
124
133
|
</style>
|
package/dist/context-target.js
CHANGED
|
@@ -37,6 +37,13 @@ export const contextTarget = (node, options) => {
|
|
|
37
37
|
};
|
|
38
38
|
node.addEventListener("contextmenu", (event) => handleContextMenu(event));
|
|
39
39
|
return {
|
|
40
|
+
update(newOptions) {
|
|
41
|
+
// Without this, `options` stays frozen at whatever it was when this
|
|
42
|
+
// node first mounted - an unkeyed #each reusing this element across
|
|
43
|
+
// data updates would keep opening a menu built from stale data (e.g.
|
|
44
|
+
// an item's name before a rename).
|
|
45
|
+
options = newOptions;
|
|
46
|
+
},
|
|
40
47
|
destroy() {
|
|
41
48
|
node.removeEventListener("contextmenu", handleContextMenu);
|
|
42
49
|
// Clean up the current context menu if the node is destroyed
|