@syncfusion/ej2-ribbon 25.1.41 → 25.2.5

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.
@@ -1725,6 +1725,17 @@ var RIBBON_FILE_MENU_WIDTH = '--fileMenuWidth';
1725
1725
  /** @hidden */
1726
1726
  var RIBBON_HELP_PANE_TEMPLATE_WIDTH = '--helpTemplateWidth';
1727
1727
 
1728
+ var __assign = (undefined && undefined.__assign) || function () {
1729
+ __assign = Object.assign || function(t) {
1730
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
1731
+ s = arguments[i];
1732
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
1733
+ t[p] = s[p];
1734
+ }
1735
+ return t;
1736
+ };
1737
+ return __assign.apply(this, arguments);
1738
+ };
1728
1739
  /**
1729
1740
  * Defines the items of Ribbon.
1730
1741
  */
@@ -1767,7 +1778,11 @@ var RibbonButton = /** @__PURE__ @class */ (function () {
1767
1778
  created: btnSettings.created
1768
1779
  }, buttonEle);
1769
1780
  if (btnSettings.htmlAttributes) {
1770
- setCustomAttributes(buttonEle, btnSettings.htmlAttributes);
1781
+ var htmlAttr = __assign({}, btnSettings.htmlAttributes);
1782
+ if (htmlAttr.id) {
1783
+ delete htmlAttr.id;
1784
+ }
1785
+ setCustomAttributes(buttonEle, htmlAttr);
1771
1786
  }
1772
1787
  buttonEle.onclick = function (e) {
1773
1788
  if (btnSettings.clicked) {
@@ -1882,6 +1897,17 @@ var RibbonButton = /** @__PURE__ @class */ (function () {
1882
1897
  return RibbonButton;
1883
1898
  }());
1884
1899
 
1900
+ var __assign$1 = (undefined && undefined.__assign) || function () {
1901
+ __assign$1 = Object.assign || function(t) {
1902
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
1903
+ s = arguments[i];
1904
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
1905
+ t[p] = s[p];
1906
+ }
1907
+ return t;
1908
+ };
1909
+ return __assign$1.apply(this, arguments);
1910
+ };
1885
1911
  /**
1886
1912
  * Defines the items of Ribbon.
1887
1913
  */
@@ -1910,6 +1936,13 @@ var RibbonCheckBox = /** @__PURE__ @class */ (function () {
1910
1936
  });
1911
1937
  itemEle.appendChild(inputEle);
1912
1938
  var checkBoxSettings = item.checkBoxSettings;
1939
+ var htmlAttr = {};
1940
+ if (checkBoxSettings.htmlAttributes) {
1941
+ htmlAttr = __assign$1({}, checkBoxSettings.htmlAttributes);
1942
+ if (htmlAttr.id) {
1943
+ delete htmlAttr.id;
1944
+ }
1945
+ }
1913
1946
  new CheckBox({
1914
1947
  locale: this.parent.locale,
1915
1948
  enableRtl: this.parent.enableRtl,
@@ -1920,7 +1953,7 @@ var RibbonCheckBox = /** @__PURE__ @class */ (function () {
1920
1953
  labelPosition: checkBoxSettings.labelPosition,
1921
1954
  disabled: item.disabled,
1922
1955
  created: checkBoxSettings.created,
1923
- htmlAttributes: checkBoxSettings.htmlAttributes,
1956
+ htmlAttributes: htmlAttr,
1924
1957
  change: function (e) {
1925
1958
  if (checkBoxSettings.change) {
1926
1959
  checkBoxSettings.change.call(_this, e);
@@ -2014,6 +2047,17 @@ var RibbonCheckBox = /** @__PURE__ @class */ (function () {
2014
2047
  return RibbonCheckBox;
2015
2048
  }());
2016
2049
 
2050
+ var __assign$2 = (undefined && undefined.__assign) || function () {
2051
+ __assign$2 = Object.assign || function(t) {
2052
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
2053
+ s = arguments[i];
2054
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
2055
+ t[p] = s[p];
2056
+ }
2057
+ return t;
2058
+ };
2059
+ return __assign$2.apply(this, arguments);
2060
+ };
2017
2061
  /**
2018
2062
  * Defines the items of Ribbon.
2019
2063
  */
@@ -2080,7 +2124,11 @@ var RibbonColorPicker = /** @__PURE__ @class */ (function () {
2080
2124
  select: colorPickerSettings.select
2081
2125
  }, inputEle);
2082
2126
  if (colorPickerSettings.htmlAttributes) {
2083
- setCustomAttributes(inputEle, colorPickerSettings.htmlAttributes);
2127
+ var htmlAttr = __assign$2({}, colorPickerSettings.htmlAttributes);
2128
+ if (htmlAttr.id) {
2129
+ delete htmlAttr.id;
2130
+ }
2131
+ setCustomAttributes(inputEle, htmlAttr);
2084
2132
  }
2085
2133
  var wrapper = colorPicker.element.parentElement;
2086
2134
  EventHandler.add(wrapper, 'mouseenter', this.toggleWrapperHover.bind(this, wrapper, true), this);
@@ -2234,6 +2282,17 @@ var RibbonColorPicker = /** @__PURE__ @class */ (function () {
2234
2282
  return RibbonColorPicker;
2235
2283
  }());
2236
2284
 
2285
+ var __assign$3 = (undefined && undefined.__assign) || function () {
2286
+ __assign$3 = Object.assign || function(t) {
2287
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
2288
+ s = arguments[i];
2289
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
2290
+ t[p] = s[p];
2291
+ }
2292
+ return t;
2293
+ };
2294
+ return __assign$3.apply(this, arguments);
2295
+ };
2237
2296
  /**
2238
2297
  * Defines the items of Ribbon.
2239
2298
  */
@@ -2262,6 +2321,13 @@ var RibbonComboBox = /** @__PURE__ @class */ (function () {
2262
2321
  });
2263
2322
  itemEle.appendChild(inputEle);
2264
2323
  var comboBoxSettings = item.comboBoxSettings;
2324
+ var htmlAttr = {};
2325
+ if (comboBoxSettings.htmlAttributes) {
2326
+ htmlAttr = __assign$3({}, comboBoxSettings.htmlAttributes);
2327
+ if (htmlAttr.id) {
2328
+ delete htmlAttr.id;
2329
+ }
2330
+ }
2265
2331
  new ComboBox({
2266
2332
  locale: this.parent.locale,
2267
2333
  enableRtl: this.parent.enableRtl,
@@ -2293,7 +2359,7 @@ var RibbonComboBox = /** @__PURE__ @class */ (function () {
2293
2359
  width: comboBoxSettings.width,
2294
2360
  beforeOpen: comboBoxSettings.beforeOpen,
2295
2361
  open: comboBoxSettings.open,
2296
- htmlAttributes: comboBoxSettings.htmlAttributes,
2362
+ htmlAttributes: htmlAttr,
2297
2363
  close: function (e) {
2298
2364
  if (comboBoxSettings.close) {
2299
2365
  comboBoxSettings.close.call(_this, e);
@@ -2436,6 +2502,17 @@ var RibbonComboBox = /** @__PURE__ @class */ (function () {
2436
2502
  return RibbonComboBox;
2437
2503
  }());
2438
2504
 
2505
+ var __assign$4 = (undefined && undefined.__assign) || function () {
2506
+ __assign$4 = Object.assign || function(t) {
2507
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
2508
+ s = arguments[i];
2509
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
2510
+ t[p] = s[p];
2511
+ }
2512
+ return t;
2513
+ };
2514
+ return __assign$4.apply(this, arguments);
2515
+ };
2439
2516
  /**
2440
2517
  * Defines the items of Ribbon.
2441
2518
  */
@@ -2496,7 +2573,11 @@ var RibbonDropDown = /** @__PURE__ @class */ (function () {
2496
2573
  select: dropDownSettings.select
2497
2574
  }).appendTo(buttonEle);
2498
2575
  if (dropDownSettings.htmlAttributes) {
2499
- setCustomAttributes(buttonEle, dropDownSettings.htmlAttributes);
2576
+ var htmlAttr = __assign$4({}, dropDownSettings.htmlAttributes);
2577
+ if (htmlAttr.id) {
2578
+ delete htmlAttr.id;
2579
+ }
2580
+ setCustomAttributes(buttonEle, htmlAttr);
2500
2581
  }
2501
2582
  };
2502
2583
  /**
@@ -2874,6 +2955,17 @@ var RibbonDropDown = /** @__PURE__ @class */ (function () {
2874
2955
  return RibbonDropDown;
2875
2956
  }());
2876
2957
 
2958
+ var __assign$5 = (undefined && undefined.__assign) || function () {
2959
+ __assign$5 = Object.assign || function(t) {
2960
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
2961
+ s = arguments[i];
2962
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
2963
+ t[p] = s[p];
2964
+ }
2965
+ return t;
2966
+ };
2967
+ return __assign$5.apply(this, arguments);
2968
+ };
2877
2969
  /**
2878
2970
  * Defines the items of Ribbon.
2879
2971
  */
@@ -2943,7 +3035,11 @@ var RibbonSplitButton = /** @__PURE__ @class */ (function () {
2943
3035
  }
2944
3036
  }, buttonEle);
2945
3037
  if (splitButtonSettings.htmlAttributes) {
2946
- setCustomAttributes(buttonEle, splitButtonSettings.htmlAttributes);
3038
+ var htmlAttr = __assign$5({}, splitButtonSettings.htmlAttributes);
3039
+ if (htmlAttr.id) {
3040
+ delete htmlAttr.id;
3041
+ }
3042
+ setCustomAttributes(buttonEle, htmlAttr);
2947
3043
  }
2948
3044
  var dropdownEle = buttonEle.parentElement.querySelector('.e-dropdown-btn');
2949
3045
  dropdownEle.onkeydown = function (e) {
@@ -7573,7 +7669,11 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
7573
7669
  for (var i = 0; i < list.length; i++) {
7574
7670
  var listitem = list[parseInt(i.toString(), 10)];
7575
7671
  if (!listitem.id) {
7576
- listitem.setProperties({ id: initId + key + (this.idIndex++) }, true);
7672
+ var htmlAttrID = void 0;
7673
+ if (type === 'item') {
7674
+ htmlAttrID = this.hasHtmlAtrrID(listitem);
7675
+ }
7676
+ listitem.setProperties({ id: htmlAttrID ? htmlAttrID : initId + key + (this.idIndex++) }, true);
7577
7677
  }
7578
7678
  switch (type) {
7579
7679
  case 'tab':
@@ -7591,6 +7691,28 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
7591
7691
  }
7592
7692
  return list;
7593
7693
  };
7694
+ Ribbon.prototype.hasHtmlAtrrID = function (listItem) {
7695
+ var id = '';
7696
+ if (listItem.buttonSettings.htmlAttributes.id) {
7697
+ id = listItem.buttonSettings.htmlAttributes.id;
7698
+ }
7699
+ else if (listItem.checkBoxSettings.htmlAttributes.id) {
7700
+ id = listItem.checkBoxSettings.htmlAttributes.id;
7701
+ }
7702
+ else if (listItem.colorPickerSettings.htmlAttributes.id) {
7703
+ id = listItem.colorPickerSettings.htmlAttributes.id;
7704
+ }
7705
+ else if (listItem.comboBoxSettings.htmlAttributes.id) {
7706
+ id = listItem.comboBoxSettings.htmlAttributes.id;
7707
+ }
7708
+ else if (listItem.dropDownSettings.htmlAttributes.id) {
7709
+ id = listItem.dropDownSettings.htmlAttributes.id;
7710
+ }
7711
+ else if (listItem.splitButtonSettings.htmlAttributes.id) {
7712
+ id = listItem.splitButtonSettings.htmlAttributes.id;
7713
+ }
7714
+ return id;
7715
+ };
7594
7716
  Ribbon.prototype.updateCommonProperty = function (commonProp) {
7595
7717
  this.tabObj.setProperties(commonProp);
7596
7718
  if (this.ribbonFileMenuModule) {