From a7e4613dee395e798ef39130fea16f13177d1064 Mon Sep 17 00:00:00 2001 From: Yurii Date: Tue, 12 May 2026 11:26:36 +0300 Subject: [PATCH] Control component dataset support --- client/src/components/controls.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/client/src/components/controls.ts b/client/src/components/controls.ts index 38fc0ca586..6df9c398a1 100644 --- a/client/src/components/controls.ts +++ b/client/src/components/controls.ts @@ -45,6 +45,7 @@ interface ButtonOptions { hidden?: boolean; html?: string | null; iconHtml?: string | null; + dataset?: Record; } interface DropdownItemOptions { @@ -61,6 +62,7 @@ interface DropdownItemOptions { hidden?: boolean; html?: string | null; iconHtml?: string | null; + dataset?: Record; } /** @@ -115,6 +117,7 @@ export class ButtonComponent { class: classes, attrs: attrs, dataset: { + ...this.options.dataset, name: this.options.name, action: this.options.name, }, @@ -164,11 +167,6 @@ export class DropdownItemComponent { const {content, props} = prepareItemContent(this.options, this.language, true); - const dataset = { - name: this.options.name, - action: this.options.name, - } as Record; - if (!this.options.link) { attrs.role = 'button'; } @@ -176,7 +174,11 @@ export class DropdownItemComponent { const a = h('a', { class: classes, attrs: attrs, - dataset: dataset, + dataset: { + ...this.options.dataset, + name: this.options.name, + action: this.options.name, + }, props: props, }, content);