Skip to content

Commit 0871dd3

Browse files
Christopher A. DhanarajGitHub Enterprise
Christopher A. Dhanaraj
authored and
GitHub Enterprise
committed
chore(build): 6.18 release (#2350)
1 parent ad20d7a commit 0871dd3

14 files changed

+454
-476
lines changed

consumables/js/es5/bluemix-components-without-polyfills.js

Lines changed: 143 additions & 150 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

consumables/js/es5/bluemix-components-without-polyfills.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

consumables/js/es5/bluemix-components-without-polyfills.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

consumables/js/es5/bluemix-components-without-polyfills.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

consumables/js/es5/bluemix-components.js

Lines changed: 143 additions & 150 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

consumables/js/es5/bluemix-components.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

consumables/js/es5/bluemix-components.min.js

Lines changed: 3 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

consumables/js/es5/bluemix-components.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

consumables/js/umd/lib/dropdown.js

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -135,21 +135,19 @@
135135
var _this2 = this;
136136

137137
if ([13, 32, 40].indexOf(event.which) >= 0 && !event.target.matches(this.options.selectorItem) || event.which === 27 || event.type === 'click') {
138-
(function () {
139-
var isOpen = _this2.element.classList.contains('bx--dropdown--open');
140-
var isOfSelf = _this2.element.contains(event.target);
141-
var actions = {
142-
add: isOfSelf && event.which === 40 && !isOpen,
143-
remove: (!isOfSelf || event.which === 27) && isOpen,
144-
toggle: isOfSelf && event.which !== 27 && event.which !== 40
145-
};
146-
(0, _keys2.default)(actions).forEach(function (action) {
147-
if (actions[action]) {
148-
_this2.element.classList[action]('bx--dropdown--open');
149-
_this2.element.focus();
150-
}
151-
});
152-
})();
138+
var isOpen = this.element.classList.contains('bx--dropdown--open');
139+
var isOfSelf = this.element.contains(event.target);
140+
var actions = {
141+
add: isOfSelf && event.which === 40 && !isOpen,
142+
remove: (!isOfSelf || event.which === 27) && isOpen,
143+
toggle: isOfSelf && event.which !== 27 && event.which !== 40
144+
};
145+
(0, _keys2.default)(actions).forEach(function (action) {
146+
if (actions[action]) {
147+
_this2.element.classList[action]('bx--dropdown--open');
148+
_this2.element.focus();
149+
}
150+
});
153151
}
154152
}
155153
}, {

consumables/js/umd/lib/inline-left-nav.js

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -100,23 +100,39 @@
100100

101101
_this.toggleLeftNav = function () {
102102
var collapsed = _this.element.dataset.collapsed === 'true';
103-
104-
if (!collapsed) {
105-
_this.element.dataset.collapsed = true;
106-
_this.element.classList.add(_this.options.classLeftNavCollapsing);
107-
108-
window.setTimeout(function () {
109-
_this.element.classList.add(_this.options.classLeftNavCollapsed);
110-
}, 250);
111-
} else {
112-
_this.element.dataset.collapsed = false;
113-
_this.element.classList.remove(_this.options.classLeftNavCollapsed);
114-
_this.element.classList.remove(_this.options.classLeftNavCollapsing);
115-
_this.element.classList.add(_this.options.classLeftNavExpanding);
116-
117-
window.setTimeout(function () {
118-
_this.element.classList.remove(_this.options.classLeftNavExpanding);
119-
}, 250);
103+
var eventStart = new CustomEvent(_this.options.eventBeforeLeftNavToggled, {
104+
bubbles: true,
105+
cancelable: true,
106+
detail: { collapsed: !collapsed } });
107+
108+
if (_this.element.dispatchEvent(eventStart)) {
109+
if (!collapsed) {
110+
_this.element.dataset.collapsed = true;
111+
_this.element.classList.add(_this.options.classLeftNavCollapsing);
112+
113+
window.setTimeout(function () {
114+
_this.element.classList.remove(_this.options.classLeftNavCollapsing);
115+
_this.element.classList.add(_this.options.classLeftNavCollapsed);
116+
_this.element.dispatchEvent(new CustomEvent(_this.options.eventAfterLeftNavToggled, {
117+
bubbles: true,
118+
cancelable: true,
119+
detail: { collapsed: true }
120+
}));
121+
}, 250);
122+
} else {
123+
_this.element.dataset.collapsed = false;
124+
_this.element.classList.remove(_this.options.classLeftNavCollapsed);
125+
_this.element.classList.add(_this.options.classLeftNavExpanding);
126+
127+
window.setTimeout(function () {
128+
_this.element.classList.remove(_this.options.classLeftNavExpanding);
129+
_this.element.dispatchEvent(new CustomEvent(_this.options.eventAfterLeftNavToggled, {
130+
bubbles: true,
131+
cancelable: true,
132+
detail: { collapsed: false }
133+
}));
134+
}, 250);
135+
}
120136
}
121137
};
122138

@@ -189,7 +205,10 @@
189205
classExpandedLeftNavListItem: 'left-nav-list__item--expanded',
190206
classLeftNavCollapsing: 'bx--inline-left-nav--collapsing',
191207
classLeftNavCollapsed: 'bx--inline-left-nav--collapsed',
192-
classLeftNavExpanding: 'bx--inline-left-nav--expanding'
208+
classLeftNavExpanding: 'bx--inline-left-nav--expanding',
209+
// Event
210+
eventBeforeLeftNavToggled: 'left-nav-beingtoggled',
211+
eventAfterLeftNavToggled: 'left-nav-toggled'
193212
};
194213
exports.default = InlineLeftNav;
195214
});

consumables/js/umd/lib/left-nav.js

Lines changed: 60 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
(function (global, factory) {
22
if (typeof define === "function" && define.amd) {
3-
define(['exports', 'babel-runtime/core-js/weak-map', 'babel-runtime/helpers/typeof', 'babel-runtime/helpers/toConsumableArray', 'babel-runtime/core-js/object/get-prototype-of', 'babel-runtime/helpers/classCallCheck', 'babel-runtime/helpers/createClass', 'babel-runtime/helpers/possibleConstructorReturn', 'babel-runtime/helpers/get', 'babel-runtime/helpers/inherits', '../misc/mixin', '../mixins/create-component', '../mixins/init-component-by-search', '../polyfills/toggle-class', '../polyfills/event-matches', '../misc/on', '../polyfills/array-from', '../polyfills/element-matches', '../polyfills/object-assign', '../polyfills/custom-event'], factory);
3+
define(['exports', 'babel-runtime/core-js/weak-map', 'babel-runtime/helpers/toConsumableArray', 'babel-runtime/core-js/object/get-prototype-of', 'babel-runtime/helpers/classCallCheck', 'babel-runtime/helpers/createClass', 'babel-runtime/helpers/possibleConstructorReturn', 'babel-runtime/helpers/get', 'babel-runtime/helpers/inherits', '../misc/mixin', '../mixins/create-component', '../mixins/init-component-by-search', '../polyfills/toggle-class', '../polyfills/event-matches', '../misc/on', '../polyfills/array-from', '../polyfills/element-matches', '../polyfills/object-assign', '../polyfills/custom-event'], factory);
44
} else if (typeof exports !== "undefined") {
5-
factory(exports, require('babel-runtime/core-js/weak-map'), require('babel-runtime/helpers/typeof'), require('babel-runtime/helpers/toConsumableArray'), require('babel-runtime/core-js/object/get-prototype-of'), require('babel-runtime/helpers/classCallCheck'), require('babel-runtime/helpers/createClass'), require('babel-runtime/helpers/possibleConstructorReturn'), require('babel-runtime/helpers/get'), require('babel-runtime/helpers/inherits'), require('../misc/mixin'), require('../mixins/create-component'), require('../mixins/init-component-by-search'), require('../polyfills/toggle-class'), require('../polyfills/event-matches'), require('../misc/on'), require('../polyfills/array-from'), require('../polyfills/element-matches'), require('../polyfills/object-assign'), require('../polyfills/custom-event'));
5+
factory(exports, require('babel-runtime/core-js/weak-map'), require('babel-runtime/helpers/toConsumableArray'), require('babel-runtime/core-js/object/get-prototype-of'), require('babel-runtime/helpers/classCallCheck'), require('babel-runtime/helpers/createClass'), require('babel-runtime/helpers/possibleConstructorReturn'), require('babel-runtime/helpers/get'), require('babel-runtime/helpers/inherits'), require('../misc/mixin'), require('../mixins/create-component'), require('../mixins/init-component-by-search'), require('../polyfills/toggle-class'), require('../polyfills/event-matches'), require('../misc/on'), require('../polyfills/array-from'), require('../polyfills/element-matches'), require('../polyfills/object-assign'), require('../polyfills/custom-event'));
66
} else {
77
var mod = {
88
exports: {}
99
};
10-
factory(mod.exports, global.weakMap, global._typeof, global.toConsumableArray, global.getPrototypeOf, global.classCallCheck, global.createClass, global.possibleConstructorReturn, global.get, global.inherits, global.mixin, global.createComponent, global.initComponentBySearch, global.toggleClass, global.eventMatches, global.on, global.arrayFrom, global.elementMatches, global.objectAssign, global.customEvent);
10+
factory(mod.exports, global.weakMap, global.toConsumableArray, global.getPrototypeOf, global.classCallCheck, global.createClass, global.possibleConstructorReturn, global.get, global.inherits, global.mixin, global.createComponent, global.initComponentBySearch, global.toggleClass, global.eventMatches, global.on, global.arrayFrom, global.elementMatches, global.objectAssign, global.customEvent);
1111
global.leftNav = mod.exports;
1212
}
13-
})(this, function (exports, _weakMap, _typeof2, _toConsumableArray2, _getPrototypeOf, _classCallCheck2, _createClass2, _possibleConstructorReturn2, _get2, _inherits2, _mixin2, _createComponent, _initComponentBySearch, _toggleClass, _eventMatches, _on) {
13+
})(this, function (exports, _weakMap, _toConsumableArray2, _getPrototypeOf, _classCallCheck2, _createClass2, _possibleConstructorReturn2, _get2, _inherits2, _mixin2, _createComponent, _initComponentBySearch, _toggleClass, _eventMatches, _on) {
1414
'use strict';
1515

1616
Object.defineProperty(exports, "__esModule", {
@@ -19,8 +19,6 @@
1919

2020
var _weakMap2 = _interopRequireDefault(_weakMap);
2121

22-
var _typeof3 = _interopRequireDefault(_typeof2);
23-
2422
var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
2523

2624
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
@@ -407,68 +405,62 @@
407405
// Sorry
408406
var leftNavSectionItem = (0, _eventMatches2.default)(evt, this.options.selectorLeftNavSection);
409407
if (leftNavSectionItem) {
410-
var _ret = function () {
411-
// currently selected
412-
var selectedLeftNavSectionItem = _this10.element.querySelector(_this10.options.selectorLeftNavCurrentSection);
413-
var selectedLeftNavSectionItemTitle = selectedLeftNavSectionItem.querySelector(_this10.options.selectorLeftNavCurrentSectionTitle);
414-
var selectedLeftNavSectionItemIcon = _this10.element.querySelector(_this10.options.selectorLeftNavCurrentSectionIcon);
415-
var selectedLeftNavSectionItemUse = selectedLeftNavSectionItemIcon.querySelector('use');
416-
var selectedLeftNavSectionValue = selectedLeftNavSectionItem.dataset.leftNavCurrentSection;
417-
418-
// clicked on item
419-
var leftNavSectionItemLink = leftNavSectionItem.querySelector(_this10.options.selectorLeftNavSectionLink);
420-
var leftNavSectionItemIcon = leftNavSectionItem.querySelector(_this10.options.selectorLeftNavSectionIcon);
421-
var leftNavSectionItemIconUse = leftNavSectionItemIcon.querySelector('use');
422-
var leftNavSectionValue = leftNavSectionItem.dataset.leftNavSection;
423-
424-
if (_this10.leftNavSectionActive) {
425-
return {
426-
v: void 0
427-
};
428-
}
429-
_this10.leftNavSectionActive = true;
430-
431-
var newLeftNavSectionItem = document.createElement('li');
432-
newLeftNavSectionItem.setAttribute('data-left-nav-section', selectedLeftNavSectionValue);
433-
newLeftNavSectionItem.classList.add(_this10.options.classNavSection);
434-
newLeftNavSectionItem.classList.add(_this10.options.classNavSection + '--' + selectedLeftNavSectionValue);
435-
436-
var newLeftNavSectionItemAnchor = document.createElement('a');
437-
newLeftNavSectionItemAnchor.setAttribute('href', 'javascript:void(0)'); // eslint-disable-line no-script-url
438-
newLeftNavSectionItemAnchor.setAttribute('tabindex', 0);
439-
newLeftNavSectionItemAnchor.classList.add(_this10.options.classNavSectionAnchor);
440-
441-
var newLeftNavSectionItemIcon = selectedLeftNavSectionItemIcon.cloneNode(true);
442-
// IE11 doesn't support classList on SVG, must revert to className
443-
newLeftNavSectionItemIcon.setAttribute('class', 'bx--left-nav__section--taxonomy-icon');
444-
newLeftNavSectionItemIcon.removeAttribute('data-left-nav-current-section-icon');
445-
newLeftNavSectionItemIcon.setAttribute('data-left-nav-section-icon', selectedLeftNavSectionValue);
446-
447-
var newLeftNavSectionItemLink = document.createElement('span');
448-
newLeftNavSectionItemLink.setAttribute('data-left-nav-section-link', '');
449-
newLeftNavSectionItemLink.classList.add(_this10.options.classNavSectionLink);
450-
newLeftNavSectionItemLink.textContent = selectedLeftNavSectionItemTitle.textContent;
451-
452-
_this10.animateNavSection(leftNavSectionItem);
453-
_this10.animateNavList(leftNavSectionValue);
454-
455-
newLeftNavSectionItemAnchor.appendChild(newLeftNavSectionItemIcon);
456-
newLeftNavSectionItemAnchor.appendChild(newLeftNavSectionItemLink);
457-
newLeftNavSectionItem.appendChild(newLeftNavSectionItemAnchor);
458-
leftNavSections.insertBefore(newLeftNavSectionItem, leftNavSections.firstChild);
459-
460-
setTimeout(function () {
461-
selectedLeftNavSectionItemTitle.textContent = leftNavSectionItemLink.textContent;
462-
selectedLeftNavSectionItem.setAttribute('data-left-nav-current-section', leftNavSectionValue);
463-
selectedLeftNavSectionItemIcon.setAttribute('data-left-nav-current-section-icon', leftNavSectionValue);
464-
selectedLeftNavSectionItemUse.setAttribute('xlink:href', leftNavSectionItemIconUse.getAttribute('xlink:href'));
465-
466-
leftNavSectionItem.parentNode.removeChild(leftNavSectionItem); // Cant use .remove() because of IE11
467-
_this10.leftNavSectionActive = false;
468-
}, 450); // Wait for nav items to animate
469-
}();
470-
471-
if ((typeof _ret === 'undefined' ? 'undefined' : (0, _typeof3.default)(_ret)) === "object") return _ret.v;
408+
// currently selected
409+
var selectedLeftNavSectionItem = this.element.querySelector(this.options.selectorLeftNavCurrentSection);
410+
var selectedLeftNavSectionItemTitle = selectedLeftNavSectionItem.querySelector(this.options.selectorLeftNavCurrentSectionTitle);
411+
var selectedLeftNavSectionItemIcon = this.element.querySelector(this.options.selectorLeftNavCurrentSectionIcon);
412+
var selectedLeftNavSectionItemUse = selectedLeftNavSectionItemIcon.querySelector('use');
413+
var selectedLeftNavSectionValue = selectedLeftNavSectionItem.dataset.leftNavCurrentSection;
414+
415+
// clicked on item
416+
var leftNavSectionItemLink = leftNavSectionItem.querySelector(this.options.selectorLeftNavSectionLink);
417+
var leftNavSectionItemIcon = leftNavSectionItem.querySelector(this.options.selectorLeftNavSectionIcon);
418+
var leftNavSectionItemIconUse = leftNavSectionItemIcon.querySelector('use');
419+
var leftNavSectionValue = leftNavSectionItem.dataset.leftNavSection;
420+
421+
if (this.leftNavSectionActive) {
422+
return;
423+
}
424+
this.leftNavSectionActive = true;
425+
426+
var newLeftNavSectionItem = document.createElement('li');
427+
newLeftNavSectionItem.setAttribute('data-left-nav-section', selectedLeftNavSectionValue);
428+
newLeftNavSectionItem.classList.add(this.options.classNavSection);
429+
newLeftNavSectionItem.classList.add(this.options.classNavSection + '--' + selectedLeftNavSectionValue);
430+
431+
var newLeftNavSectionItemAnchor = document.createElement('a');
432+
newLeftNavSectionItemAnchor.setAttribute('href', 'javascript:void(0)'); // eslint-disable-line no-script-url
433+
newLeftNavSectionItemAnchor.setAttribute('tabindex', 0);
434+
newLeftNavSectionItemAnchor.classList.add(this.options.classNavSectionAnchor);
435+
436+
var newLeftNavSectionItemIcon = selectedLeftNavSectionItemIcon.cloneNode(true);
437+
// IE11 doesn't support classList on SVG, must revert to className
438+
newLeftNavSectionItemIcon.setAttribute('class', 'bx--left-nav__section--taxonomy-icon');
439+
newLeftNavSectionItemIcon.removeAttribute('data-left-nav-current-section-icon');
440+
newLeftNavSectionItemIcon.setAttribute('data-left-nav-section-icon', selectedLeftNavSectionValue);
441+
442+
var newLeftNavSectionItemLink = document.createElement('span');
443+
newLeftNavSectionItemLink.setAttribute('data-left-nav-section-link', '');
444+
newLeftNavSectionItemLink.classList.add(this.options.classNavSectionLink);
445+
newLeftNavSectionItemLink.textContent = selectedLeftNavSectionItemTitle.textContent;
446+
447+
this.animateNavSection(leftNavSectionItem);
448+
this.animateNavList(leftNavSectionValue);
449+
450+
newLeftNavSectionItemAnchor.appendChild(newLeftNavSectionItemIcon);
451+
newLeftNavSectionItemAnchor.appendChild(newLeftNavSectionItemLink);
452+
newLeftNavSectionItem.appendChild(newLeftNavSectionItemAnchor);
453+
leftNavSections.insertBefore(newLeftNavSectionItem, leftNavSections.firstChild);
454+
455+
setTimeout(function () {
456+
selectedLeftNavSectionItemTitle.textContent = leftNavSectionItemLink.textContent;
457+
selectedLeftNavSectionItem.setAttribute('data-left-nav-current-section', leftNavSectionValue);
458+
selectedLeftNavSectionItemIcon.setAttribute('data-left-nav-current-section-icon', leftNavSectionValue);
459+
selectedLeftNavSectionItemUse.setAttribute('xlink:href', leftNavSectionItemIconUse.getAttribute('xlink:href'));
460+
461+
leftNavSectionItem.parentNode.removeChild(leftNavSectionItem); // Cant use .remove() because of IE11
462+
_this10.leftNavSectionActive = false;
463+
}, 450); // Wait for nav items to animate
472464
}
473465
}
474466
}, {

0 commit comments

Comments
 (0)