UNPKG

@openui5/sap.m

Version:

OpenUI5 UI Library sap.m

51 lines (48 loc) 1.77 kB
/*! * OpenUI5 * (c) Copyright 2026 SAP SE or an SAP affiliate company. * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. */ /** * Defines support rules of the Tokenizer control of sap.m library. */ sap.ui.define(["sap/ui/support/library"], function(SupportLib) { "use strict"; // shortcuts var Categories = SupportLib.Categories, // Accessibility, Performance, Memory, ... Severity = SupportLib.Severity, // Hint, Warning, Error Audiences = SupportLib.Audiences; // Control, Internal, Application var oTokenizerParentRule = { id : "tokenizerParentRule", audiences: [Audiences.Application], categories: [Categories.Usage], enabled: true, minversion: "1.28", title : "Tokenizer: Tokenizer parent control", description : "The tokenizer can only be used as part of MultiComboBox, MultiInput or ValueHelpDialog.", resolution : "Do not use the Tokenizer control standalone.", check : function(oIssueManager, oCoreFacade, oScope) { var oTokenizers = oScope.getElementsByClassName("sap.m.Tokenizer"), bParent, oParent; oTokenizers.forEach(function (oTokenizer) { oParent = oTokenizer.getParent(); bParent = oParent && ( oParent.isA(["sap.m.MultiInput", "sap.m.MultiComboBox"]) || // Value Help Dialog uses the tokenizer in a horizontal layout with special style class oParent.hasStyleClass("compVHTokenizerHLayout") ); if (!bParent) { oIssueManager.addIssue({ severity: Severity.High, details: "Tokenizer with id: " + oTokenizer.getId() + " is not inside a MultiComboBox, MultiInput or ValueHelpDialog", context: { id: oTokenizer.getId() } }); } }); } }; return [oTokenizerParentRule]; }, true);