ontotext-yasgui-web-component 1.8.2 → 1.8.3
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/cjs/confirmation-dialog_10.cjs.entry.js +36 -15
- package/dist/collection/components/ontotext-yasgui-web-component/ontotext-yasgui-web-component.js +1 -1
- package/dist/collection/components/yasgui/yasgui-script.js +1 -1
- package/dist/collection/services/tooltip-service.js +0 -1
- package/dist/collection/services/yasqe/yasqe-service.js +28 -12
- package/dist/components/ontotext-yasgui.js +30 -15
- package/dist/components/translation.service.js +6 -0
- package/dist/esm/confirmation-dialog_10.entry.js +36 -15
- package/dist/ontotext-yasgui-web-component/ontotext-yasgui-web-component.esm.js +1 -1
- package/dist/ontotext-yasgui-web-component/{p-efec0333.entry.js → p-cace841c.entry.js} +2 -2
- package/dist/types/home/ubuntu/workspace/PRO/GraphDB UI Jobs/ontotext-yasgui/ontotext-yasgui-release/ontotext-yasgui-web-component/.stencil/Yasgui/packages/yasqe/src/CodeMirror.d.ts +1 -0
- package/dist/types/home/ubuntu/workspace/PRO/GraphDB UI Jobs/ontotext-yasgui/ontotext-yasgui-release/ontotext-yasgui-web-component/.stencil/Yasgui/packages/yasqe/src/index.d.ts +2 -0
- package/dist/types/services/yasqe/yasqe-service.d.ts +5 -0
- package/package.json +1 -1
|
@@ -24,14 +24,11 @@ export class YasqeService {
|
|
|
24
24
|
}
|
|
25
25
|
onLanguageChange(_currentLang) {
|
|
26
26
|
let button = document.querySelector(`.${YasqeService.getActionButtonClassName(YasqeButtonName.CREATE_SAVED_QUERY)}`);
|
|
27
|
-
|
|
28
|
-
TooltipService.updateTooltip(button, tooltip);
|
|
27
|
+
this.updateLabel(button, 'yasqe.actions.save_query.button.tooltip');
|
|
29
28
|
button = document.querySelector(`.${YasqeService.getActionButtonClassName(YasqeButtonName.SHOW_SAVED_QUERIES)}`);
|
|
30
|
-
|
|
31
|
-
TooltipService.updateTooltip(button, tooltip);
|
|
29
|
+
this.updateLabel(button, 'yasqe.actions.show_saved_queries.button.tooltip');
|
|
32
30
|
button = document.querySelector(`.${YasqeService.getActionButtonClassName(YasqeButtonName.SHARE_QUERY)}`);
|
|
33
|
-
|
|
34
|
-
TooltipService.updateTooltip(button, tooltip);
|
|
31
|
+
this.updateLabel(button, 'yasqe.actions.share_query.button.tooltip');
|
|
35
32
|
const ontotextYasgui = this.yasguiBuilder.getInstance();
|
|
36
33
|
const yasqe = ontotextYasgui === null || ontotextYasgui === void 0 ? void 0 : ontotextYasgui.getYasqe();
|
|
37
34
|
if (ontotextYasgui && yasqe) {
|
|
@@ -47,6 +44,22 @@ export class YasqeService {
|
|
|
47
44
|
}
|
|
48
45
|
}
|
|
49
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Sets the translated label as both tooltip and accessible name of an icon-only button.
|
|
49
|
+
*/
|
|
50
|
+
updateLabel(button, labelKey) {
|
|
51
|
+
if (!button) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const label = this.translationService.translate(labelKey);
|
|
55
|
+
button.setAttribute('aria-label', label);
|
|
56
|
+
TooltipService.updateTooltip(button, label);
|
|
57
|
+
}
|
|
58
|
+
addLabelledTooltip(button, labelKey) {
|
|
59
|
+
const tooltipElement = TooltipService.addTooltip(button);
|
|
60
|
+
this.updateLabel(button, labelKey);
|
|
61
|
+
return tooltipElement;
|
|
62
|
+
}
|
|
50
63
|
static initPluginButtonNameToClassNameMapping() {
|
|
51
64
|
YasqeService.pluginButtonNameToClassNameMapping = new Map();
|
|
52
65
|
YasqeService.pluginButtonNameToClassNameMapping.set(YasqeButtonName.FULLSCREEN, `yasqe_${YasqeButtonName.FULLSCREEN}Button`);
|
|
@@ -121,8 +134,7 @@ export class YasqeService {
|
|
|
121
134
|
const handleShowSavedQuery = () => this.eventService.emit(new InternalShowSavedQueriesEvent(buttonElement));
|
|
122
135
|
buttonElement.addEventListener('click', handleShowSavedQuery);
|
|
123
136
|
yasqe.addDestroyCallback(() => buttonElement.removeEventListener('click', handleShowSavedQuery));
|
|
124
|
-
|
|
125
|
-
return TooltipService.addTooltip(buttonElement, tooltip);
|
|
137
|
+
return this.addLabelledTooltip(buttonElement, 'yasqe.actions.show_saved_queries.button.tooltip');
|
|
126
138
|
}
|
|
127
139
|
buildCreateSaveQueryButton(yasqe) {
|
|
128
140
|
const buttonElement = document.createElement('button');
|
|
@@ -130,8 +142,7 @@ export class YasqeService {
|
|
|
130
142
|
const handleCreateSaveQuery = () => this.eventService.emit(new InternalCreateSavedQueryEvent());
|
|
131
143
|
buttonElement.addEventListener('click', handleCreateSaveQuery);
|
|
132
144
|
yasqe.addDestroyCallback(() => buttonElement.removeEventListener('click', handleCreateSaveQuery));
|
|
133
|
-
|
|
134
|
-
return TooltipService.addTooltip(buttonElement, tooltip);
|
|
145
|
+
return this.addLabelledTooltip(buttonElement, 'yasqe.actions.save_query.button.tooltip');
|
|
135
146
|
}
|
|
136
147
|
buildShareQueryButton(yasqe) {
|
|
137
148
|
const buttonElement = document.createElement('button');
|
|
@@ -139,8 +150,7 @@ export class YasqeService {
|
|
|
139
150
|
const handleShareQuery = () => this.eventService.emit(new InternalShareQueryEvent());
|
|
140
151
|
buttonElement.addEventListener('click', handleShareQuery);
|
|
141
152
|
yasqe.addDestroyCallback(() => buttonElement.removeEventListener('click', handleShareQuery));
|
|
142
|
-
|
|
143
|
-
return TooltipService.addTooltip(buttonElement, tooltip);
|
|
153
|
+
return this.addLabelledTooltip(buttonElement, 'yasqe.actions.share_query.button.tooltip');
|
|
144
154
|
}
|
|
145
155
|
buildInferAndSameAsButtons(yasguiConfiguration, yasqe) {
|
|
146
156
|
// When a new tab is open and infer action is configured to be visible infer and sameAs are undefined, so we have to initialized them.
|
|
@@ -203,6 +213,9 @@ export class YasqeService {
|
|
|
203
213
|
const sameAsButtonElement = sameAsTooltipElement.querySelector('button');
|
|
204
214
|
const sameAsTitleLabelKey = inferred ? `yasqe.actions.expand_results_same_as.${sameAs}.button.tooltip` : 'yasqe.actions.expand_results_same_as.disable.button.tooltip';
|
|
205
215
|
TooltipService.updateTooltip(sameAsButtonElement, this.translationService.translate(sameAsTitleLabelKey));
|
|
216
|
+
sameAsButtonElement.setAttribute('aria-label', this.translationService.translate('yasqe.actions.expand_results_same_as.button.label'));
|
|
217
|
+
sameAsButtonElement.setAttribute('aria-pressed', `${sameAs}`);
|
|
218
|
+
sameAsButtonElement.removeAttribute('aria-disabled');
|
|
206
219
|
sameAsButtonElement.classList.remove('icon-same-as-on', 'icon-same-as-off', 'disabled');
|
|
207
220
|
if (sameAs) {
|
|
208
221
|
sameAsButtonElement.classList.add('icon-same-as-on');
|
|
@@ -213,12 +226,15 @@ export class YasqeService {
|
|
|
213
226
|
if (!inferred) {
|
|
214
227
|
// Disables the same as button. The Disabled attribute is not used because it stops firing events and breaks the button tooltip.
|
|
215
228
|
sameAsButtonElement.classList.add('disabled');
|
|
229
|
+
sameAsButtonElement.setAttribute('aria-disabled', 'true');
|
|
216
230
|
}
|
|
217
231
|
}
|
|
218
232
|
updateInferredElement(inferredElement, sameAsElement, inferred, sameAs) {
|
|
219
233
|
const inferredButtonElement = inferredElement.querySelector('button');
|
|
220
234
|
const inferredButtonTitle = this.translationService.translate(`yasqe.actions.include_inferred.${inferred}.button.tooltip`);
|
|
221
235
|
TooltipService.updateTooltip(inferredButtonElement, inferredButtonTitle);
|
|
236
|
+
inferredButtonElement.setAttribute('aria-label', this.translationService.translate('yasqe.actions.include_inferred.button.label'));
|
|
237
|
+
inferredButtonElement.setAttribute('aria-pressed', `${inferred}`);
|
|
222
238
|
inferredButtonElement.classList.remove('icon-inferred-on', 'icon-inferred-off');
|
|
223
239
|
if (inferred) {
|
|
224
240
|
inferredButtonElement.classList.add('icon-inferred-on');
|