@syncfusion/ej2-ribbon 21.1.35 → 21.2.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.
Files changed (62) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/README.md +61 -1
  3. package/dist/ej2-ribbon.umd.min.js +2 -2
  4. package/dist/ej2-ribbon.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-ribbon.es2015.js +137 -36
  6. package/dist/es6/ej2-ribbon.es2015.js.map +1 -1
  7. package/dist/es6/ej2-ribbon.es5.js +139 -36
  8. package/dist/es6/ej2-ribbon.es5.js.map +1 -1
  9. package/dist/global/ej2-ribbon.min.js +2 -2
  10. package/dist/global/ej2-ribbon.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +13 -16
  13. package/src/ribbon/base/constant.d.ts +2 -0
  14. package/src/ribbon/base/constant.js +2 -0
  15. package/src/ribbon/base/ribbon-model.d.ts +1 -1
  16. package/src/ribbon/base/ribbon.js +26 -16
  17. package/src/ribbon/base/utils.d.ts +15 -1
  18. package/src/ribbon/base/utils.js +16 -1
  19. package/src/ribbon/items/ribbon-button.d.ts +0 -1
  20. package/src/ribbon/items/ribbon-button.js +2 -1
  21. package/src/ribbon/items/ribbon-checkbox.d.ts +0 -1
  22. package/src/ribbon/items/ribbon-checkbox.js +0 -1
  23. package/src/ribbon/items/ribbon-colorpicker.d.ts +7 -1
  24. package/src/ribbon/items/ribbon-colorpicker.js +40 -4
  25. package/src/ribbon/items/ribbon-combobox.d.ts +0 -1
  26. package/src/ribbon/items/ribbon-combobox.js +4 -2
  27. package/src/ribbon/items/ribbon-dropdown.d.ts +0 -1
  28. package/src/ribbon/items/ribbon-dropdown.js +21 -3
  29. package/src/ribbon/items/ribbon-splitbutton.d.ts +0 -1
  30. package/src/ribbon/items/ribbon-splitbutton.js +21 -3
  31. package/src/ribbon/modules/ribbon-filemenu.js +6 -4
  32. package/styles/bootstrap-dark.css +47 -12
  33. package/styles/bootstrap.css +47 -12
  34. package/styles/bootstrap4.css +47 -12
  35. package/styles/bootstrap5-dark.css +47 -12
  36. package/styles/bootstrap5.css +47 -12
  37. package/styles/fabric-dark.css +47 -12
  38. package/styles/fabric.css +47 -12
  39. package/styles/fluent-dark.css +47 -12
  40. package/styles/fluent.css +47 -12
  41. package/styles/highcontrast-light.css +47 -12
  42. package/styles/highcontrast.css +47 -12
  43. package/styles/material-dark.css +47 -12
  44. package/styles/material.css +47 -12
  45. package/styles/ribbon/_layout.scss +77 -18
  46. package/styles/ribbon/bootstrap-dark.css +47 -12
  47. package/styles/ribbon/bootstrap.css +47 -12
  48. package/styles/ribbon/bootstrap4.css +47 -12
  49. package/styles/ribbon/bootstrap5-dark.css +47 -12
  50. package/styles/ribbon/bootstrap5.css +47 -12
  51. package/styles/ribbon/fabric-dark.css +47 -12
  52. package/styles/ribbon/fabric.css +47 -12
  53. package/styles/ribbon/fluent-dark.css +47 -12
  54. package/styles/ribbon/fluent.css +47 -12
  55. package/styles/ribbon/highcontrast-light.css +47 -12
  56. package/styles/ribbon/highcontrast.css +47 -12
  57. package/styles/ribbon/material-dark.css +47 -12
  58. package/styles/ribbon/material.css +47 -12
  59. package/styles/ribbon/tailwind-dark.css +47 -12
  60. package/styles/ribbon/tailwind.css +47 -12
  61. package/styles/tailwind-dark.css +47 -12
  62. package/styles/tailwind.css +47 -12
@@ -861,6 +861,8 @@ const DROPDOWNBUTTON = 'e-dropdown-btn';
861
861
  /** @hidden */
862
862
  const DROPDOWNBUTTON_HIDE = 'e-caret-hide';
863
863
  /** @hidden */
864
+ const RIBBON_TEMPLATE = 'e-ribbon-template';
865
+ /** @hidden */
864
866
  const RIBBON_HELP_TEMPLATE = 'e-ribbon-help-template';
865
867
  /** @hidden */
866
868
  const RIBBON_TOOLTIP = 'e-ribbon-tooltip';
@@ -960,6 +962,7 @@ class RibbonButton {
960
962
  btnSettings.clicked.call(this, e);
961
963
  }
962
964
  };
965
+ buttonEle.setAttribute('aria-label', btnSettings.content);
963
966
  }
964
967
  /**
965
968
  * Adds the additional event handlers as the item moved into overflow popup.
@@ -986,7 +989,6 @@ class RibbonButton {
986
989
  *
987
990
  * @param {RibbonItemModel} item - Gets the ribbon item model.
988
991
  * @param {HTMLElement} itemEle - Gets the ribbon item element.
989
- * @param {DropDownButton} overflowButton - Gets the overflow button.
990
992
  * @returns {void}
991
993
  * @hidden
992
994
  */
@@ -1039,6 +1041,7 @@ class RibbonButton {
1039
1041
  }
1040
1042
  if (prop.content) {
1041
1043
  prop.content = itemProp.item.activeSize === RibbonItemSize.Small ? '' : prop.content;
1044
+ buttonEle.setAttribute('aria-label', prop.content);
1042
1045
  }
1043
1046
  delete prop.clicked;
1044
1047
  buttonObj.setProperties(prop);
@@ -1130,7 +1133,6 @@ class RibbonCheckBox {
1130
1133
  *
1131
1134
  * @param {RibbonItemModel} item - Gets the ribbon item model.
1132
1135
  * @param {HTMLElement} itemEle - Gets the ribbon item element.
1133
- * @param {DropDownButton} overflowButton - Gets the overflow button.
1134
1136
  * @returns {void}
1135
1137
  * @hidden
1136
1138
  */
@@ -1247,8 +1249,16 @@ class RibbonColorPicker {
1247
1249
  select: colorPickerSettings.select
1248
1250
  }, inputEle);
1249
1251
  const wrapper = colorPicker.element.parentElement;
1250
- EventHandler.add(wrapper, 'mouseenter', () => { wrapper.classList.add(RIBBON_HOVER); }, this);
1251
- EventHandler.add(wrapper, 'mouseleave', () => { wrapper.classList.remove(RIBBON_HOVER); }, this);
1252
+ EventHandler.add(wrapper, 'mouseenter', this.toggleWrapperHover.bind(this, wrapper, true), this);
1253
+ EventHandler.add(wrapper, 'mouseleave', this.toggleWrapperHover.bind(this, wrapper, false), this);
1254
+ }
1255
+ toggleWrapperHover(wrapper, isAdd) {
1256
+ if (isAdd) {
1257
+ wrapper.classList.add(RIBBON_HOVER);
1258
+ }
1259
+ else {
1260
+ wrapper.classList.remove(RIBBON_HOVER);
1261
+ }
1252
1262
  }
1253
1263
  /**
1254
1264
  * Adds the additional event handlers as the item moved into overflow popup.
@@ -1265,8 +1275,18 @@ class RibbonColorPicker {
1265
1275
  colorPickerObj.setProperties({ cssClass: colorPickerObj.cssClass + SPACE + RIBBON_POPUP_CONTROL });
1266
1276
  //Accessing the private property 'splitBtn' of ColorPicker component to get the colorpicker instance as there is no close event in colorpicker.
1267
1277
  const splitBtn = colorPickerObj['splitBtn'];
1278
+ let target;
1279
+ colorPickerObj.beforeClose = (e) => {
1280
+ target = e.event ? e.event.target : null;
1281
+ colorPickerObj.element.parentElement.classList.remove(RIBBON_POPUP_OPEN);
1282
+ if (item.colorPickerSettings.beforeClose) {
1283
+ item.colorPickerSettings.beforeClose.call(this);
1284
+ }
1285
+ };
1268
1286
  splitBtn.close = () => {
1269
- overflowButton.toggle();
1287
+ if (target && !target.closest('.e-ribbon-group-overflow-ddb')) {
1288
+ overflowButton.toggle();
1289
+ }
1270
1290
  };
1271
1291
  }
1272
1292
  /**
@@ -1274,7 +1294,6 @@ class RibbonColorPicker {
1274
1294
  *
1275
1295
  * @param {RibbonItemModel} item - Gets the ribbon item model.
1276
1296
  * @param {HTMLElement} itemEle - Gets the ribbon item element.
1277
- * @param {DropDownButton} overflowButton - Gets the overflow button.
1278
1297
  * @returns {void}
1279
1298
  * @hidden
1280
1299
  */
@@ -1287,6 +1306,12 @@ class RibbonColorPicker {
1287
1306
  const splitBtn = colorPickerObj['splitBtn'];
1288
1307
  //Accessing the private property 'splitBtn' of ColorPicker component to get the colorpicker instance as there is no close event in colorpicker.
1289
1308
  splitBtn.close = null;
1309
+ colorPickerObj.beforeClose = (e) => {
1310
+ colorPickerObj.element.parentElement.classList.remove(RIBBON_POPUP_OPEN);
1311
+ if (item.colorPickerSettings.beforeClose) {
1312
+ item.colorPickerSettings.beforeClose.call(this);
1313
+ }
1314
+ };
1290
1315
  }
1291
1316
  getColorPickerObj(controlId) {
1292
1317
  const inputEle = getItemElement(this.parent, controlId);
@@ -1342,6 +1367,17 @@ class RibbonColorPicker {
1342
1367
  const colorPickerObj = getComponent(inputEle, ColorPicker);
1343
1368
  colorPickerObj.setProperties(prop);
1344
1369
  }
1370
+ /**
1371
+ * @param {HTMLElement} element - Gets the colorpicker element to be destroyed.
1372
+ * @returns {void}
1373
+ * @hidden
1374
+ */
1375
+ unwireColorPickerEvents(element) {
1376
+ const colorPickerObj = getComponent(element, ColorPicker);
1377
+ const wrapper = colorPickerObj.element.parentElement;
1378
+ EventHandler.remove(wrapper, 'mouseenter', this.toggleWrapperHover);
1379
+ EventHandler.remove(wrapper, 'mouseleave', this.toggleWrapperHover);
1380
+ }
1345
1381
  }
1346
1382
 
1347
1383
  /**
@@ -1427,10 +1463,13 @@ class RibbonComboBox {
1427
1463
  const comboBoxObj = getComponent(inputEle, ComboBox);
1428
1464
  comboBoxObj.setProperties({ cssClass: comboBoxObj.cssClass + SPACE + RIBBON_POPUP_CONTROL });
1429
1465
  comboBoxObj.close = (e) => {
1466
+ let target = e.event ? e.event.target : null;
1430
1467
  if (item.comboBoxSettings.close) {
1431
1468
  item.comboBoxSettings.close.call(this, e);
1432
1469
  }
1433
- overflowButton.toggle();
1470
+ if (target && !target.closest('.e-ribbon-group-overflow-ddb')) {
1471
+ overflowButton.toggle();
1472
+ }
1434
1473
  };
1435
1474
  }
1436
1475
  /**
@@ -1438,7 +1477,6 @@ class RibbonComboBox {
1438
1477
  *
1439
1478
  * @param {RibbonItemModel} item - Gets the ribbon item model.
1440
1479
  * @param {HTMLElement} itemEle - Gets the ribbon item element.
1441
- * @param {DropDownButton} overflowButton - Gets the overflow button.
1442
1480
  * @returns {void}
1443
1481
  * @hidden
1444
1482
  */
@@ -1563,7 +1601,11 @@ class RibbonDropDown {
1563
1601
  iconCss: dropDownSettings.iconCss,
1564
1602
  items: dropDownSettings.items,
1565
1603
  target: dropDownSettings.target,
1566
- beforeClose: dropDownSettings.beforeClose,
1604
+ beforeClose: (e) => {
1605
+ if (dropDownSettings.beforeClose) {
1606
+ dropDownSettings.beforeClose.call(this, e);
1607
+ }
1608
+ },
1567
1609
  beforeItemRender: dropDownSettings.beforeItemRender,
1568
1610
  beforeOpen: dropDownSettings.beforeOpen,
1569
1611
  close: (e) => {
@@ -1590,11 +1632,20 @@ class RibbonDropDown {
1590
1632
  const dropdown = getComponent(dropdownElement, DropDownButton);
1591
1633
  dropdown.cssClass = dropdown.cssClass + SPACE + RIBBON_POPUP_CONTROL;
1592
1634
  dropdown.dataBind();
1635
+ let target;
1636
+ dropdown.beforeClose = (e) => {
1637
+ if (item.dropDownSettings.beforeClose) {
1638
+ item.dropDownSettings.beforeClose.call(this, e);
1639
+ }
1640
+ target = e.event ? e.event.target : null;
1641
+ };
1593
1642
  dropdown.close = (e) => {
1594
1643
  if (item.dropDownSettings.close) {
1595
1644
  item.dropDownSettings.close.call(this, e);
1596
1645
  }
1597
- overflowButton.toggle();
1646
+ if (target && !target.closest('.e-ribbon-group-overflow-ddb')) {
1647
+ overflowButton.toggle();
1648
+ }
1598
1649
  };
1599
1650
  }
1600
1651
  /**
@@ -1602,7 +1653,6 @@ class RibbonDropDown {
1602
1653
  *
1603
1654
  * @param {RibbonItemModel} item - Gets the ribbon item model.
1604
1655
  * @param {HTMLElement} itemEle - Gets the ribbon item element.
1605
- * @param {DropDownButton} overflowButton - Gets the overflow button.
1606
1656
  * @returns {void}
1607
1657
  * @hidden
1608
1658
  */
@@ -1618,6 +1668,11 @@ class RibbonDropDown {
1618
1668
  item.dropDownSettings.close.call(this, e);
1619
1669
  }
1620
1670
  };
1671
+ dropdown.beforeClose = (e) => {
1672
+ if (item.dropDownSettings.beforeClose) {
1673
+ item.dropDownSettings.beforeClose.call(this, e);
1674
+ }
1675
+ };
1621
1676
  }
1622
1677
  /**
1623
1678
  * Creates Overflow DropDown.
@@ -1753,6 +1808,7 @@ class RibbonDropDown {
1753
1808
  control.cssClass = prop.cssClass;
1754
1809
  }
1755
1810
  delete prop.close;
1811
+ delete prop.beforeClose;
1756
1812
  if (prop.content) {
1757
1813
  prop.content = itemProp.item.activeSize === RibbonItemSize.Small ? '' : prop.content;
1758
1814
  }
@@ -1821,7 +1877,11 @@ class RibbonSplitButton {
1821
1877
  iconCss: splitButtonSettings.iconCss,
1822
1878
  items: splitButtonSettings.items,
1823
1879
  target: splitButtonSettings.target,
1824
- beforeClose: splitButtonSettings.beforeClose,
1880
+ beforeClose: (e) => {
1881
+ if (splitButtonSettings.beforeClose) {
1882
+ splitButtonSettings.beforeClose.call(this, e);
1883
+ }
1884
+ },
1825
1885
  beforeItemRender: splitButtonSettings.beforeItemRender,
1826
1886
  beforeOpen: splitButtonSettings.beforeOpen,
1827
1887
  close: () => {
@@ -1863,6 +1923,13 @@ class RibbonSplitButton {
1863
1923
  const splitbutton = getComponent(splitButtonEle, SplitButton);
1864
1924
  splitbutton.cssClass = splitbutton.cssClass + SPACE + RIBBON_POPUP_CONTROL;
1865
1925
  splitbutton.dataBind();
1926
+ let target;
1927
+ splitbutton.beforeClose = (e) => {
1928
+ if (item.splitButtonSettings.beforeClose) {
1929
+ item.splitButtonSettings.beforeClose.call(this, e);
1930
+ }
1931
+ target = e.event ? e.event.target : null;
1932
+ };
1866
1933
  splitbutton.click = (e) => {
1867
1934
  if (item.splitButtonSettings.click) {
1868
1935
  item.splitButtonSettings.click.call(this, e);
@@ -1874,7 +1941,9 @@ class RibbonSplitButton {
1874
1941
  item.splitButtonSettings.close.call(this, e);
1875
1942
  }
1876
1943
  splitbutton['wrapper'].classList.remove(RIBBON_POPUP_OPEN);
1877
- overflowButton.toggle();
1944
+ if (target && !target.closest('.e-ribbon-group-overflow-ddb')) {
1945
+ overflowButton.toggle();
1946
+ }
1878
1947
  };
1879
1948
  }
1880
1949
  /**
@@ -1882,7 +1951,6 @@ class RibbonSplitButton {
1882
1951
  *
1883
1952
  * @param {RibbonItemModel} item - Gets the ribbon item model.
1884
1953
  * @param {HTMLElement} itemEle - Gets the ribbon item element.
1885
- * @param {DropDownButton} overflowButton - Gets the overflow button.
1886
1954
  * @returns {void}
1887
1955
  * @hidden
1888
1956
  */
@@ -1893,6 +1961,11 @@ class RibbonSplitButton {
1893
1961
  cssClass = cssClass.filter((value) => value !== RIBBON_POPUP_CONTROL);
1894
1962
  splitbutton.cssClass = cssClass.join(SPACE);
1895
1963
  splitbutton.dataBind();
1964
+ splitbutton.beforeClose = (e) => {
1965
+ if (item.splitButtonSettings.beforeClose) {
1966
+ item.splitButtonSettings.beforeClose.call(this, e);
1967
+ }
1968
+ };
1896
1969
  splitbutton.click = (e) => {
1897
1970
  if (item.splitButtonSettings.click) {
1898
1971
  item.splitButtonSettings.click.call(this, e);
@@ -1972,6 +2045,7 @@ class RibbonSplitButton {
1972
2045
  delete prop.open;
1973
2046
  delete prop.click;
1974
2047
  delete prop.close;
2048
+ delete prop.beforeClose;
1975
2049
  control.setProperties(prop);
1976
2050
  if (prop.content) {
1977
2051
  this.setContent(itemProp.item, control);
@@ -2006,6 +2080,7 @@ class RibbonSplitButton {
2006
2080
  * @param {Array} arr - Gets the array to find index.
2007
2081
  * @param {boolean} condition - Defines whether index matches with the value.
2008
2082
  * @returns {number} - Gets the index value.
2083
+ * @hidden
2009
2084
  */
2010
2085
  function getIndex(arr, condition) {
2011
2086
  for (let i = 0; i < arr.length; i++) {
@@ -2020,6 +2095,7 @@ function getIndex(arr, condition) {
2020
2095
  *
2021
2096
  * @param {string | HTMLElement} template - Template property value.
2022
2097
  * @returns {Function} - Return template function.
2098
+ * @hidden
2023
2099
  */
2024
2100
  function getTemplateFunction(template) {
2025
2101
  if (typeof template === 'string') {
@@ -2050,6 +2126,7 @@ function getTemplateFunction(template) {
2050
2126
  * @param {RibbonTabModel} tabs - Gets the ribbon tab model.
2051
2127
  * @param {string} id - Gets the ID of the tab.
2052
2128
  * @returns {itemProps} - Gets the ribbon item.
2129
+ * @hidden
2053
2130
  */
2054
2131
  function getItem(tabs, id) {
2055
2132
  for (let i = 0; i < tabs.length; i++) {
@@ -2078,6 +2155,7 @@ function getItem(tabs, id) {
2078
2155
  * @param {RibbonTabModel} tabs - Gets the ribbon tab model.
2079
2156
  * @param {string} id - Gets the ID of the tab.
2080
2157
  * @returns {itemProps} - Gets the ribbon collection.
2158
+ * @hidden
2081
2159
  */
2082
2160
  function getCollection(tabs, id) {
2083
2161
  for (let i = 0; i < tabs.length; i++) {
@@ -2103,6 +2181,7 @@ function getCollection(tabs, id) {
2103
2181
  * @param {RibbonTabModel} tabs - Gets the ribbon tab model.
2104
2182
  * @param {string} id - Gets the ID of the tab.
2105
2183
  * @returns {itemProps} - Gets the ribbon group.
2184
+ * @hidden
2106
2185
  */
2107
2186
  function getGroup(tabs, id) {
2108
2187
  for (let i = 0; i < tabs.length; i++) {
@@ -2122,6 +2201,7 @@ function getGroup(tabs, id) {
2122
2201
  * @param {HTMLElement} element - Gets the element to be destroyed.
2123
2202
  * @param {string} moduleName - Gets the module name.
2124
2203
  * @returns {void}
2204
+ * @hidden
2125
2205
  */
2126
2206
  function destroyControl(element, moduleName) {
2127
2207
  const control = getComponent(element, moduleName);
@@ -2134,6 +2214,7 @@ function destroyControl(element, moduleName) {
2134
2214
  * @param {string} moduleName - Gets the module name.
2135
2215
  * @param {commonProperties} commonProp - Gets the common properties to be updated.
2136
2216
  * @returns {void}
2217
+ * @hidden
2137
2218
  */
2138
2219
  function updateCommonProperty(element, moduleName, commonProp) {
2139
2220
  const control = getComponent(element, moduleName);
@@ -2146,6 +2227,7 @@ function updateCommonProperty(element, moduleName, commonProp) {
2146
2227
  * @param {string} moduleName - Gets the module name.
2147
2228
  * @param {boolean} disable - Defines whether the control to be disabled or not.
2148
2229
  * @returns {void}
2230
+ * @hidden
2149
2231
  */
2150
2232
  function updateControlDisabled(element, moduleName, disable) {
2151
2233
  const control = getComponent(element, moduleName);
@@ -2155,9 +2237,10 @@ function updateControlDisabled(element, moduleName, disable) {
2155
2237
  * Gets the ribbon item element.
2156
2238
  *
2157
2239
  * @param {Ribbon} parent - Gets the parent element.
2158
- * @param {itemProps} itemProp - Gets the ribbon item.
2159
2240
  * @param {string} id - Gets the ID of the item.
2241
+ * @param {itemProps} itemProp - Gets the ribbon item.
2160
2242
  * @returns {HTMLElement} - Gets the ribbon item element.
2243
+ * @hidden
2161
2244
  */
2162
2245
  function getItemElement(parent, id, itemProp) {
2163
2246
  if (!itemProp) {
@@ -2192,6 +2275,7 @@ function getItemElement(parent, id, itemProp) {
2192
2275
  /**
2193
2276
  * @param {RibbonTooltipModel} tooltip - Gets the property of tooltip.
2194
2277
  * @returns {boolean} - Gets whether the tooltip is present or not.
2278
+ * @hidden
2195
2279
  */
2196
2280
  function isTooltipPresent(tooltip) {
2197
2281
  return (tooltip.content || tooltip.iconCss || tooltip.title || tooltip.id || tooltip.cssClass) ? true : false;
@@ -2203,6 +2287,7 @@ function isTooltipPresent(tooltip) {
2203
2287
  * @param {Tooltip} tooltip - Gets the tooltip to set the content.
2204
2288
  * @param {ribbonTooltipData} tooltipData - Gets the tooltip data.
2205
2289
  * @returns {void}
2290
+ * @hidden
2206
2291
  */
2207
2292
  function setToolTipContent(args, tooltip, tooltipData) {
2208
2293
  const targetId = args.target.getAttribute('id');
@@ -2246,6 +2331,7 @@ function setToolTipContent(args, tooltip, tooltipData) {
2246
2331
  * @param {HTMLElement} element - Gets the element to add tooltip.
2247
2332
  * @param {Ribbon} ribbon - Gets the ribbon.
2248
2333
  * @returns {void}
2334
+ * @hidden
2249
2335
  */
2250
2336
  function createTooltip(element, ribbon) {
2251
2337
  const ribbonTooltip = new Tooltip({
@@ -2257,6 +2343,7 @@ function createTooltip(element, ribbon) {
2257
2343
  /**
2258
2344
  * @param {TooltipEventArgs} args - Gets the tooltip argument.
2259
2345
  * @returns {void}
2346
+ * @hidden
2260
2347
  */
2261
2348
  function beforeTooltipRender(args) {
2262
2349
  setToolTipContent(args, ribbonTooltip, ribbon.tooltipData);
@@ -2267,6 +2354,7 @@ function createTooltip(element, ribbon) {
2267
2354
  *
2268
2355
  * @param {HTMLElement} element - Gets the element in which the tooltip needs to be destroyed.
2269
2356
  * @returns {void}
2357
+ * @hidden
2270
2358
  */
2271
2359
  function destroyTooltip(element) {
2272
2360
  const control = getComponent(element, Tooltip);
@@ -2278,6 +2366,7 @@ function destroyTooltip(element) {
2278
2366
  * @param {HTMLElement} element - Gets the element in which the tooltip needs to be Updated.
2279
2367
  * @param {commonProperties} prop - Gets the property to be updated.
2280
2368
  * @returns {void}
2369
+ * @hidden
2281
2370
  */
2282
2371
  function updateTooltipProp(element, prop) {
2283
2372
  const control = getComponent(element, Tooltip);
@@ -2436,7 +2525,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
2436
2525
  selectedIndex = selectedIndex === -1 ? this.selectedTab : selectedIndex;
2437
2526
  const eventArgs = { previousIndex: this.selectedTab, selectedIndex: selectedIndex };
2438
2527
  this.setProperties({ selectedTab: selectedIndex }, true);
2439
- this.checkOverflow(selectedIndex, e.selectedContent);
2528
+ this.checkOverflow(selectedIndex, e.selectedContent.firstChild);
2440
2529
  if (this.activeLayout === 'Simplified' && this.overflowDDB) {
2441
2530
  const overflowTarget = this.overflowDDB.target;
2442
2531
  const ofTabContainer = overflowTarget.querySelector('.' + RIBBON_TAB_ACTIVE);
@@ -2455,9 +2544,6 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
2455
2544
  this.trigger('tabSelected', eventArgs);
2456
2545
  }
2457
2546
  checkOverflow(tabIndex, activeContent) {
2458
- if (!activeContent) {
2459
- activeContent = this.tabObj.element.querySelector('#' + this.tabs[parseInt(tabIndex.toString(), 10)].id + CONTENT_ID);
2460
- }
2461
2547
  const tabContent = activeContent.closest('.' + TAB_CONTENT);
2462
2548
  const isOverFlow = tabContent.offsetWidth < activeContent.offsetWidth;
2463
2549
  if (isOverFlow && !this.scrollModule) {
@@ -2480,7 +2566,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
2480
2566
  }
2481
2567
  //Adds Scroll if the tabwidth is less the content width even after adding overflow dropdown.
2482
2568
  if ((tabContent.offsetWidth < activeContent.offsetWidth) && (!this.scrollModule)) {
2483
- this.scrollModule = new HScroll({}, this.tabObj.element.querySelector('.' + TAB_CONTENT));
2569
+ this.scrollModule = new HScroll({
2570
+ enableRtl: this.enableRtl
2571
+ }, this.tabObj.element.querySelector('.' + TAB_CONTENT));
2484
2572
  }
2485
2573
  }
2486
2574
  else if (!isOverFlow) {
@@ -2561,8 +2649,8 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
2561
2649
  const group = orderedGroups[parseInt(i.toString(), 10)];
2562
2650
  const groupEle = tabContent.querySelector('#' + group.id);
2563
2651
  const groupContainer = groupEle.querySelector('#' + group.id + CONTAINER_ID);
2564
- for (let j = 0; ((j < group.collections.length) && (tabContent.offsetWidth < activeContent.offsetWidth)); j++) {
2565
- const collection = group.collections[parseInt(j.toString(), 10)];
2652
+ for (let j = group.collections.length; ((j >= 1) && (tabContent.offsetWidth < activeContent.offsetWidth)); j--) {
2653
+ const collection = group.collections[parseInt((j - 1).toString(), 10)];
2566
2654
  const collectionEle = groupEle.querySelector('#' + collection.id);
2567
2655
  for (let k = collection.items.length; ((k >= 1) && (tabContent.offsetWidth < activeContent.offsetWidth)); k--) {
2568
2656
  const item = collection.items[k - 1];
@@ -2628,8 +2716,8 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
2628
2716
  overflowDDB = this.overflowDDB;
2629
2717
  overflowtarget = this.overflowDDB ? this.overflowDDB.target : null;
2630
2718
  }
2631
- for (let j = (group.collections.length); ((j >= 1) && flag); j--) {
2632
- const collection = group.collections[parseInt((j - 1).toString(), 10)];
2719
+ for (let j = 0; ((j < group.collections.length) && flag); j++) {
2720
+ const collection = group.collections[parseInt(j.toString(), 10)];
2633
2721
  // eslint-disable-next-line max-len
2634
2722
  for (let k = 0; ((k < collection.items.length) && flag && !isClear && (tabContent.offsetWidth > activeContent.offsetWidth)); k++) {
2635
2723
  const item = collection.items[parseInt(k.toString(), 10)];
@@ -3430,11 +3518,11 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3430
3518
  this.collapseButton = this.createElement('span', {
3431
3519
  className: RIBBON_COLLAPSE_BUTTON + SPACE + EXPAND_COLLAPSE_ICON,
3432
3520
  id: this.tabObj.element.id + COLLAPSE_BUTTON_ID,
3433
- attrs: { 'tabindex': '0', 'type': 'button', 'aria-label': 'Layout Switcher' }
3521
+ attrs: { 'tabindex': '0', 'type': 'button', 'aria-label': 'Layout Switcher', 'role': 'button' }
3434
3522
  });
3435
3523
  this.collapseButton.onclick = () => { this.toggleLayout(); };
3436
3524
  this.collapseButton.onkeydown = (e) => {
3437
- if (e.key === "Enter") {
3525
+ if (e.key === 'Enter') {
3438
3526
  this.toggleLayout();
3439
3527
  }
3440
3528
  };
@@ -3678,13 +3766,13 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3678
3766
  const launcherIcon = this.createElement('div', {
3679
3767
  className: RIBBON_LAUNCHER_ICON_ELE + ' ' + (this.launcherIconCss ? this.launcherIconCss : RIBBON_LAUNCHER_ICON),
3680
3768
  id: group.id + LAUNCHER_ID,
3681
- attrs: { 'tabindex': '0', 'type': 'button', 'aria-label': 'Launcher Icon' }
3769
+ attrs: { 'tabindex': '0', 'type': 'button', 'aria-label': 'Launcher Icon', 'role': 'button' }
3682
3770
  });
3683
3771
  groupContainer.appendChild(launcherIcon);
3684
3772
  groupContainer.classList.add(RIBBON_LAUNCHER);
3685
3773
  EventHandler.add(launcherIcon, 'click', this.launcherIconClicked.bind(this, group.id), this);
3686
3774
  EventHandler.add(launcherIcon, 'keydown', (e) => {
3687
- if (e.key === "Enter") {
3775
+ if (e.key === 'Enter') {
3688
3776
  this.launcherIconClicked(group.id);
3689
3777
  }
3690
3778
  }, this);
@@ -3708,7 +3796,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3708
3796
  for (let j = 0; j < items.length; j++) {
3709
3797
  const ribbonitem = items[parseInt(j.toString(), 10)];
3710
3798
  if (!ribbonitem.allowedSizes || (ribbonitem.allowedSizes === 0)) {
3711
- ribbonitem.setProperties({ allowedSizes: (RibbonItemSize.Small | RibbonItemSize.Medium | RibbonItemSize.Large) }, true);
3799
+ ribbonitem.setProperties({
3800
+ allowedSizes: (RibbonItemSize.Small | RibbonItemSize.Medium | RibbonItemSize.Large)
3801
+ }, true);
3712
3802
  }
3713
3803
  if ((ribbonitem.type === 'ColorPicker') && (ribbonitem.allowedSizes !== RibbonItemSize.Small)) {
3714
3804
  ribbonitem.setProperties({ allowedSizes: RibbonItemSize.Small }, true);
@@ -3851,10 +3941,11 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
3851
3941
  }
3852
3942
  createTemplateContent(item, itemElement) {
3853
3943
  const itemEle = this.createElement('div', {
3854
- className: item.disabled ? DISABLED_CSS + SPACE + item.cssClass : item.cssClass,
3944
+ className: item.cssClass ? (RIBBON_TEMPLATE + SPACE + item.cssClass) : RIBBON_TEMPLATE,
3855
3945
  id: item.id
3856
3946
  });
3857
3947
  if (item.disabled) {
3948
+ itemEle.classList.add(DISABLED_CSS);
3858
3949
  itemEle.setAttribute('disabled', '');
3859
3950
  }
3860
3951
  itemElement.appendChild(itemEle);
@@ -4010,7 +4101,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4010
4101
  }
4011
4102
  destroyFunction(item, ele) {
4012
4103
  const moduleName = this.getItemModuleName(item);
4013
- if (moduleName !== 'template') {
4104
+ if (moduleName === 'colorpicker') {
4105
+ this.ribbonColorPickerModule.unwireColorPickerEvents(ele);
4106
+ }
4107
+ else if (moduleName !== 'template') {
4014
4108
  destroyControl(ele, moduleName);
4015
4109
  }
4016
4110
  if (item.ribbonTooltipSettings) {
@@ -4507,6 +4601,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4507
4601
  break;
4508
4602
  case 'isMinimized':
4509
4603
  this.element.classList.toggle(RIBBON_MINIMIZE, this.isMinimized);
4604
+ this.tabObj.element.querySelector('.e-content').style.display = this.isMinimized ? 'none' : 'block';
4510
4605
  break;
4511
4606
  case 'locale':
4512
4607
  this.updateCommonProperty({ locale: this.locale });
@@ -4517,6 +4612,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4517
4612
  case 'enableRtl':
4518
4613
  this.element.classList.toggle(RTL_CSS, this.enableRtl);
4519
4614
  this.updateCommonProperty({ enableRtl: newProp.enableRtl });
4615
+ if (this.scrollModule) {
4616
+ this.scrollModule.setProperties({ enableRtl: newProp.enableRtl });
4617
+ }
4520
4618
  break;
4521
4619
  case 'launcherIconCss':
4522
4620
  for (let i = 0; i < this.tabs.length; i++) {
@@ -4552,6 +4650,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
4552
4650
  break;
4553
4651
  case 'width':
4554
4652
  this.element.style.width = formatUnit(newProp.width);
4653
+ this.refreshLayout();
4555
4654
  break;
4556
4655
  case 'fileMenu':
4557
4656
  if (this.ribbonFileMenuModule) {
@@ -4654,7 +4753,7 @@ class RibbonFileMenu {
4654
4753
  return;
4655
4754
  }
4656
4755
  this.ddbElement = this.parent.createElement('button', {
4657
- id: this.parent.element.id + RIBBON_FILE_MENU_ID,
4756
+ id: this.parent.element.id + RIBBON_FILE_MENU_ID
4658
4757
  });
4659
4758
  const tabEle = this.parent.tabObj.element;
4660
4759
  const toolbarEle = tabEle.querySelector('.e-toolbar');
@@ -4745,7 +4844,7 @@ class RibbonFileMenu {
4745
4844
  select: this.menuSelect.bind(this)
4746
4845
  }, ulElem);
4747
4846
  EventHandler.add(ulElem, 'keydown', (e) => {
4748
- if (e.key === "Tab") {
4847
+ if (e.key === 'Tab') {
4749
4848
  this.fileMenuDDB.toggle();
4750
4849
  }
4751
4850
  }, this);
@@ -4754,8 +4853,10 @@ class RibbonFileMenu {
4754
4853
  const event = isOpen ? this.parent.fileMenu.beforeOpen :
4755
4854
  this.parent.fileMenu.beforeClose;
4756
4855
  if (event) {
4757
- const eventArgs = { cancel: args.cancel, element: args.element, event: args.event,
4758
- items: args.items, parentItem: args.parentItem };
4856
+ const eventArgs = {
4857
+ cancel: args.cancel, element: args.element, event: args.event,
4858
+ items: args.items, parentItem: args.parentItem
4859
+ };
4759
4860
  event.call(this, eventArgs);
4760
4861
  args.cancel = eventArgs.cancel;
4761
4862
  }
@@ -4942,5 +5043,5 @@ class RibbonFileMenu {
4942
5043
  // export all modules from current location
4943
5044
  // example: export * from './module'
4944
5045
 
4945
- export { Ribbon, RibbonLayout, ItemOrientation, RibbonItemSize, DisplayMode, RibbonItemType, ITEM_VERTICAL_CENTER, EXPAND_COLLAPSE_ICON, OVERFLOW_ICON, VERTICAL_DDB, DISABLED_CSS, RTL_CSS, RIBBON_HOVER, RIBBON_CONTROL, RIBBON_POPUP_CONTROL, RIBBON_POPUP_OPEN, SPACE, HORIZONTAL_SCROLLBAR, HIDE_CSS, RIBBON_TAB, RIBBON_TAB_ACTIVE, RIBBON_TAB_ITEM, RIBBON_COLLAPSE_BUTTON, RIBBON_EXPAND_BUTTON, RIBBON_COLLAPSIBLE, RIBBON_OVERALL_OF_BUTTON, RIBBON_GROUP_OF_BUTTON, RIBBON_OVERFLOW_TARGET, RIBBON_OVERFLOW, TAB_CONTENT, RIBBON_MINIMIZE, RIBBON_GROUP, RIBBON_GROUP_CONTAINER, RIBBON_OF_TAB_CONTAINER, RIBBON_OF_GROUP_CONTAINER, RIBBON_GROUP_CONTENT, RIBBON_GROUP_HEADER, RIBBON_OVERFLOW_HEADER, RIBBON_GROUP_OVERFLOW, RIBBON_GROUP_OVERFLOW_DDB, RIBBON_LAUNCHER, RIBBON_LAUNCHER_ICON_ELE, RIBBON_LAUNCHER_ICON, RIBBON_COLLECTION, RIBBON_ITEM, RIBBON_ROW, RIBBON_COLUMN, RIBBON_LARGE_ITEM, RIBBON_MEDIUM_ITEM, RIBBON_SMALL_ITEM, RIBBON_CONTENT_HEIGHT, DROPDOWNBUTTON, DROPDOWNBUTTON_HIDE, RIBBON_HELP_TEMPLATE, RIBBON_TOOLTIP, RIBBON_TOOLTIP_TARGET, RIBBON_TOOLTIP_TITLE, RIBBON_TOOLTIP_CONTENT, RIBBON_TOOLTIP_ICON, RIBBON_TOOLTIP_CONTAINER, RIBBON_TEXT_CONTAINER, RIBBON_SIMPLIFIED_MODE, TAB_ID, GROUP_ID, COLLECTION_ID, ITEM_ID, COLLAPSE_BUTTON_ID, OVRLOF_BUTTON_ID, GROUPOF_BUTTON_ID, HEADER_ID, LAUNCHER_ID, CONTENT_ID, CONTAINER_ID, OVERFLOW_ID, DROPDOWN_ID, RIBBON_FILE_MENU_ID, RIBBON_FILE_MENU_LIST, RIBBON_HELP_PANE_TEMPLATE_ID, RIBBON_FILE_MENU_WIDTH, RIBBON_HELP_PANE_TEMPLATE_WIDTH, getIndex, getTemplateFunction, getItem, getCollection, getGroup, destroyControl, updateCommonProperty, updateControlDisabled, getItemElement, isTooltipPresent, setToolTipContent, createTooltip, destroyTooltip, updateTooltipProp, RibbonTab, RibbonGroup, RibbonCollection, RibbonItem, RibbonButtonSettings, RibbonCheckBoxSettings, RibbonColorPickerSettings, RibbonComboBoxSettings, RibbonDropDownSettings, RibbonSplitButtonSettings, FileMenuSettings, RibbonTooltip, RibbonButton, RibbonCheckBox, RibbonColorPicker, RibbonComboBox, RibbonDropDown, RibbonSplitButton, RibbonFileMenu };
5046
+ export { Ribbon, RibbonLayout, ItemOrientation, RibbonItemSize, DisplayMode, RibbonItemType, ITEM_VERTICAL_CENTER, EXPAND_COLLAPSE_ICON, OVERFLOW_ICON, VERTICAL_DDB, DISABLED_CSS, RTL_CSS, RIBBON_HOVER, RIBBON_CONTROL, RIBBON_POPUP_CONTROL, RIBBON_POPUP_OPEN, SPACE, HORIZONTAL_SCROLLBAR, HIDE_CSS, RIBBON_TAB, RIBBON_TAB_ACTIVE, RIBBON_TAB_ITEM, RIBBON_COLLAPSE_BUTTON, RIBBON_EXPAND_BUTTON, RIBBON_COLLAPSIBLE, RIBBON_OVERALL_OF_BUTTON, RIBBON_GROUP_OF_BUTTON, RIBBON_OVERFLOW_TARGET, RIBBON_OVERFLOW, TAB_CONTENT, RIBBON_MINIMIZE, RIBBON_GROUP, RIBBON_GROUP_CONTAINER, RIBBON_OF_TAB_CONTAINER, RIBBON_OF_GROUP_CONTAINER, RIBBON_GROUP_CONTENT, RIBBON_GROUP_HEADER, RIBBON_OVERFLOW_HEADER, RIBBON_GROUP_OVERFLOW, RIBBON_GROUP_OVERFLOW_DDB, RIBBON_LAUNCHER, RIBBON_LAUNCHER_ICON_ELE, RIBBON_LAUNCHER_ICON, RIBBON_COLLECTION, RIBBON_ITEM, RIBBON_ROW, RIBBON_COLUMN, RIBBON_LARGE_ITEM, RIBBON_MEDIUM_ITEM, RIBBON_SMALL_ITEM, RIBBON_CONTENT_HEIGHT, DROPDOWNBUTTON, DROPDOWNBUTTON_HIDE, RIBBON_TEMPLATE, RIBBON_HELP_TEMPLATE, RIBBON_TOOLTIP, RIBBON_TOOLTIP_TARGET, RIBBON_TOOLTIP_TITLE, RIBBON_TOOLTIP_CONTENT, RIBBON_TOOLTIP_ICON, RIBBON_TOOLTIP_CONTAINER, RIBBON_TEXT_CONTAINER, RIBBON_SIMPLIFIED_MODE, TAB_ID, GROUP_ID, COLLECTION_ID, ITEM_ID, COLLAPSE_BUTTON_ID, OVRLOF_BUTTON_ID, GROUPOF_BUTTON_ID, HEADER_ID, LAUNCHER_ID, CONTENT_ID, CONTAINER_ID, OVERFLOW_ID, DROPDOWN_ID, RIBBON_FILE_MENU_ID, RIBBON_FILE_MENU_LIST, RIBBON_HELP_PANE_TEMPLATE_ID, RIBBON_FILE_MENU_WIDTH, RIBBON_HELP_PANE_TEMPLATE_WIDTH, getIndex, getTemplateFunction, getItem, getCollection, getGroup, destroyControl, updateCommonProperty, updateControlDisabled, getItemElement, isTooltipPresent, setToolTipContent, createTooltip, destroyTooltip, updateTooltipProp, RibbonTab, RibbonGroup, RibbonCollection, RibbonItem, RibbonButtonSettings, RibbonCheckBoxSettings, RibbonColorPickerSettings, RibbonComboBoxSettings, RibbonDropDownSettings, RibbonSplitButtonSettings, FileMenuSettings, RibbonTooltip, RibbonButton, RibbonCheckBox, RibbonColorPicker, RibbonComboBox, RibbonDropDown, RibbonSplitButton, RibbonFileMenu };
4946
5047
  //# sourceMappingURL=ej2-ribbon.es2015.js.map