diff --git a/dist/accordion.js b/dist/accordion.js index e927c06..d4aa4f8 100644 --- a/dist/accordion.js +++ b/dist/accordion.js @@ -22,146 +22,145 @@ angular.module('ayAccordion', []) .directive('ayAccordionRoot', function () { return { restrict: 'A', - controller: function ($scope, $element, $attrs) { - "ngInject"; - // Helper Methods ////////////////////////////////////////////////////// - var filter = Array.prototype.filter; - var forEach = Array.prototype.forEach; - var map = Array.prototype.map; - var style = function (el, prop, value) { - var vendors = ['', '-webkit-', '-ms-']; - if (angular.isDefined(value)) { - for (var i = vendors.length - 1; i >= 0; --i) { - el.style[vendors[i] + prop] = value; + controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) { + // Helper Methods ////////////////////////////////////////////////////// + var filter = Array.prototype.filter; + var forEach = Array.prototype.forEach; + var map = Array.prototype.map; + var style = function (el, prop, value) { + var vendors = ['', '-webkit-', '-ms-']; + if (angular.isDefined(value)) { + for (var i = vendors.length - 1; i >= 0; --i) { + el.style[vendors[i] + prop] = value; + } } - } - else { - for (var i = vendors.length - 1; i >= 0; --i) { - if (el.style[vendors[i] + prop] !== '') { - return el.style[vendors[i] + prop]; + else { + for (var i = vendors.length - 1; i >= 0; --i) { + if (el.style[vendors[i] + prop] !== '') { + return el.style[vendors[i] + prop]; + } } + return null; } - return null; - } - }; - // Controller-level Variables ////////////////////////////////////////// - this.root = $element[0]; - this.multiple = angular.isDefined($attrs['multiple']); - this.curPanel = null; - this.blockClicks = false; - // Controller methods ////////////////////////////////////////////////// - this.run = function (fn, cb) { - var self = this; - self.blockClicks = true; - var elementsToWatch = filter.call(self.root.childNodes, function (el) { - /* Disregard text nodes and comments */ - return el.nodeType === 1; - }); - var preRoot = self.root.getBoundingClientRect(); - /* Take initial measurements */ - var measurements = map.call(elementsToWatch, function (el) { - return { - el: el, - initialDimensions: el.getBoundingClientRect(), - initialTransform: style(el, 'transform') || '' - }; - }); - self.root.style.minHeight = preRoot.height + 'px'; - /* Close existing panels if needed */ - if (!this.multiple && this.curPanel && fn !== this.curPanel.fn && fn !== this.curPanel.close) { - this.curPanel.close(); - } - /* Run the function to change the state */ - fn(); - /* Set the element states to appear as initial after the change */ - forEach.call(measurements, function (m) { - m.newDimensions = m.el.getBoundingClientRect(); - m.newScale = { - x: m.initialDimensions.width / m.newDimensions.width, - y: m.initialDimensions.height / m.newDimensions.height - }; - m.newOffset = { - x: m.initialDimensions.left - m.newDimensions.left, - y: m.initialDimensions.top - m.newDimensions.top - }; - requestAnimationFrame(function () { - style(m.el, 'transform-origin', '0 0'); + }; + // Controller-level Variables ////////////////////////////////////////// + this.root = $element[0]; + this.multiple = angular.isDefined($attrs['multiple']); + this.curPanel = null; + this.blockClicks = false; + // Controller methods ////////////////////////////////////////////////// + this.run = function (fn, cb) { + var self = this; + self.blockClicks = true; + var elementsToWatch = filter.call(self.root.childNodes, function (el) { + /* Disregard text nodes and comments */ + return el.nodeType === 1; }); - m.children = []; - /* Set the grandchildren to the inverse transform */ - if (m.initialDimensions.height !== m.newDimensions.height || - m.initialDimensions.width !== m.newDimensions.width) { - m.children = filter.call(m.el.childNodes, function (el) { - return el.nodeType === 1; - }); - forEach.call(m.children, function (el) { - var elDimensions = el.getBoundingClientRect(); - var offsetFromParent = { - x: m.newDimensions.left - elDimensions.left, - y: m.newDimensions.top - elDimensions.top - }; - var origin = offsetFromParent.x + 'px '; - origin += offsetFromParent.y + 'px'; - requestAnimationFrame(function () { - style(el, 'transform-origin', origin); - }); - }); - } - }); - var duration = 100; // In milliseconds - var t = 1; - function tween() { - forEach.call(measurements, function (m) { - if (m.initialDimensions.height === m.newDimensions.height && - m.initialDimensions.width === m.newDimensions.width && - m.initialDimensions.left === m.newDimensions.left && - m.initialDimensions.top === m.newDimensions.top) { - return; - } - var tScaleX = 1 + (m.newScale.x - 1) * t; - var tScaleY = 1 + (m.newScale.y - 1) * t; - var tOffsetX = m.newOffset.x * t; - var tOffsetY = m.newOffset.y * t; - var transform = 'translate('; - transform += tOffsetX + 'px, '; - transform += tOffsetY + 'px) '; - transform += 'scale(' + tScaleX + ',' + tScaleY + ') '; - transform += m.initialTransform; - style(m.el, 'transform', transform); - forEach.call(m.children, function (el) { - var scale = 'scale(' + (1 / tScaleX) + ',' + (1 / tScaleY) + ')'; - style(el, 'transform', scale); - }); + var preRoot = self.root.getBoundingClientRect(); + /* Take initial measurements */ + var measurements = map.call(elementsToWatch, function (el) { + return { + el: el, + initialDimensions: el.getBoundingClientRect(), + initialTransform: style(el, 'transform') || '' + }; }); - t -= (16 / duration); - if (t > 0) { - requestAnimationFrame(tween); - } - else { - cleanup(); + self.root.style.minHeight = preRoot.height + 'px'; + /* Close existing panels if needed */ + if (!this.multiple && this.curPanel && fn !== this.curPanel.fn && fn !== this.curPanel.close) { + this.curPanel.close(); } - } - requestAnimationFrame(function () { - tween(); - }); - function cleanup() { + /* Run the function to change the state */ + fn(); + /* Set the element states to appear as initial after the change */ forEach.call(measurements, function (m) { - style(m.el, 'transform-origin', ''); - style(m.el, 'transform', m.initialTransform); - forEach.call(m.children, function (el) { - style(el, 'transform-origin', ''); - style(el, 'transform', ''); + m.newDimensions = m.el.getBoundingClientRect(); + m.newScale = { + x: m.initialDimensions.width / m.newDimensions.width, + y: m.initialDimensions.height / m.newDimensions.height + }; + m.newOffset = { + x: m.initialDimensions.left - m.newDimensions.left, + y: m.initialDimensions.top - m.newDimensions.top + }; + requestAnimationFrame(function () { + style(m.el, 'transform-origin', '0 0'); }); + m.children = []; + /* Set the grandchildren to the inverse transform */ + if (m.initialDimensions.height !== m.newDimensions.height || + m.initialDimensions.width !== m.newDimensions.width) { + m.children = filter.call(m.el.childNodes, function (el) { + return el.nodeType === 1; + }); + forEach.call(m.children, function (el) { + var elDimensions = el.getBoundingClientRect(); + var offsetFromParent = { + x: m.newDimensions.left - elDimensions.left, + y: m.newDimensions.top - elDimensions.top + }; + var origin = offsetFromParent.x + 'px '; + origin += offsetFromParent.y + 'px'; + requestAnimationFrame(function () { + style(el, 'transform-origin', origin); + }); + }); + } }); - self.blockClicks = false; - self.root.style.minHeight = null; - /* Invoke our callback function when done */ - $scope.$applyAsync(function () { - cb(); + var duration = 100; // In milliseconds + var t = 1; + function tween() { + forEach.call(measurements, function (m) { + if (m.initialDimensions.height === m.newDimensions.height && + m.initialDimensions.width === m.newDimensions.width && + m.initialDimensions.left === m.newDimensions.left && + m.initialDimensions.top === m.newDimensions.top) { + return; + } + var tScaleX = 1 + (m.newScale.x - 1) * t; + var tScaleY = 1 + (m.newScale.y - 1) * t; + var tOffsetX = m.newOffset.x * t; + var tOffsetY = m.newOffset.y * t; + var transform = 'translate('; + transform += tOffsetX + 'px, '; + transform += tOffsetY + 'px) '; + transform += 'scale(' + tScaleX + ',' + tScaleY + ') '; + transform += m.initialTransform; + style(m.el, 'transform', transform); + forEach.call(m.children, function (el) { + var scale = 'scale(' + (1 / tScaleX) + ',' + (1 / tScaleY) + ')'; + style(el, 'transform', scale); + }); + }); + t -= (16 / duration); + if (t > 0) { + requestAnimationFrame(tween); + } + else { + cleanup(); + } + } + requestAnimationFrame(function () { + tween(); }); - } - }; - } + function cleanup() { + forEach.call(measurements, function (m) { + style(m.el, 'transform-origin', ''); + style(m.el, 'transform', m.initialTransform); + forEach.call(m.children, function (el) { + style(el, 'transform-origin', ''); + style(el, 'transform', ''); + }); + }); + self.blockClicks = false; + self.root.style.minHeight = null; + /* Invoke our callback function when done */ + $scope.$applyAsync(function () { + cb(); + }); + } + }; + }] }; }) .directive('ayAccordion', function () { @@ -172,60 +171,59 @@ angular.module('ayAccordion', []) bindToController: { onToggle: '&' }, - controller: function ($scope, $element, $attrs) { - "ngInject"; - var self = this; - self.rootCtrl = null; - self.isOpen = false; - self.open = function () { - $element.addClass('open'); - $element[0].setAttribute('open', 'open'); - if ($element[0] === $element[0].parentNode.lastElementChild) { - $element[0].scrollIntoView(); - } - self.isOpen = true; - $scope.$applyAsync(); - self['onToggle']({ state: true }); - if (!self.rootCtrl.multiple) { - self.rootCtrl.curPanel = self; - } - }; - self.close = function () { - $element.removeClass('open'); - $element[0].removeAttribute('open'); + controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) { + var self = this; + self.rootCtrl = null; self.isOpen = false; - $scope.$applyAsync(); - self['onToggle']({ state: false }); - if (self.rootCtrl.curPanel === self) { - self.rootCtrl.curPanel = null; - } - }; - self.fn = function () { - if (self.isOpen) { - self.close(); - } - else { - self.open(); - } - Array.prototype.forEach.call($element.children(), function (el) { - if (el.hasAttribute('ay-accordion-header')) { - return; + self.open = function () { + $element.addClass('open'); + $element[0].setAttribute('open', 'open'); + if ($element[0] === $element[0].parentNode.lastElementChild) { + $element[0].scrollIntoView(); + } + self.isOpen = true; + $scope.$applyAsync(); + self['onToggle']({ state: true }); + if (!self.rootCtrl.multiple) { + self.rootCtrl.curPanel = self; } + }; + self.close = function () { + $element.removeClass('open'); + $element[0].removeAttribute('open'); + self.isOpen = false; + $scope.$applyAsync(); + self['onToggle']({ state: false }); + if (self.rootCtrl.curPanel === self) { + self.rootCtrl.curPanel = null; + } + }; + self.fn = function () { if (self.isOpen) { - el.removeAttribute('hidden'); + self.close(); } else { - el.setAttribute('hidden', 'hidden'); + self.open(); } - }); - }; - self.toggle = function (cb) { - if (self.rootCtrl.blockClicks) { - return; - } - self.rootCtrl.run(self.fn, cb); - }; - }, + Array.prototype.forEach.call($element.children(), function (el) { + if (el.hasAttribute('ay-accordion-header')) { + return; + } + if (self.isOpen) { + el.removeAttribute('hidden'); + } + else { + el.setAttribute('hidden', 'hidden'); + } + }); + }; + self.toggle = function (cb) { + if (self.rootCtrl.blockClicks) { + return; + } + self.rootCtrl.run(self.fn, cb); + }; + }], link: function ($scope, $element, $attrs, $ctrls) { var selfCtrl = $ctrls[0]; var rootCtrl = $ctrls[1]; @@ -292,4 +290,4 @@ angular.module('ayAccordion', []) } }; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNjb3JkaW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiL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ggICE9PSBtLm5ld0RpbWVuc2lvbnMud2lkdGgpIHtcblxuICAgICAgICAgICAgbS5jaGlsZHJlbiA9IGZpbHRlci5jYWxsKG0uZWwuY2hpbGROb2RlcywgZnVuY3Rpb24oZWwpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGVsLm5vZGVUeXBlID09PSAxO1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGZvckVhY2guY2FsbChtLmNoaWxkcmVuLCBmdW5jdGlvbihlbCkge1xuICAgICAgICAgICAgICB2YXIgZWxEaW1lbnNpb25zID0gZWwuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCk7XG4gICAgICAgICAgICAgIHZhciBvZmZzZXRGcm9tUGFyZW50ID0ge1xuICAgICAgICAgICAgICAgIHg6IG0ubmV3RGltZW5zaW9ucy5sZWZ0IC0gZWxEaW1lbnNpb25zLmxlZnQsXG4gICAgICAgICAgICAgICAgeTogbS5uZXdEaW1lbnNpb25zLnRvcCAgLSBlbERpbWVuc2lvbnMudG9wXG4gICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgdmFyIG9yaWdpbiA9IG9mZnNldEZyb21QYXJlbnQueCArICdweCAnO1xuICAgICAgICAgICAgICBvcmlnaW4gKz0gb2Zmc2V0RnJvbVBhcmVudC55ICsgJ3B4JztcblxuICAgICAgICAgICAgICByZXF1ZXN0QW5pbWF0aW9uRnJhbWUoKCkgPT4ge1xuICAgICAgICAgICAgICAgIHN0eWxlKGVsLCAndHJhbnNmb3JtLW9yaWdpbicsIG9yaWdpbik7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICB2YXIgZHVyYXRpb24gPSAxMDA7IC8vIEluIG1pbGxpc2Vjb25kc1xuICAgICAgICB2YXIgdCA9IDE7XG5cbiAgICAgICAgZnVuY3Rpb24gdHdlZW4oKSB7XG4gICAgICAgICAgZm9yRWFjaC5jYWxsKG1lYXN1cmVtZW50cywgZnVuY3Rpb24obSkge1xuICAgICAgICAgICAgaWYgKG0uaW5pdGlhbERpbWVuc2lvbnMuaGVpZ2h0ID09PSBtLm5ld0RpbWVuc2lvbnMuaGVpZ2h0ICYmXG4gICAgICAgICAgICAgICAgbS5pbml0aWFsRGltZW5zaW9ucy53aWR0aCAgPT09IG0ubmV3RGltZW5zaW9ucy53aWR0aCAgJiZcbiAgICAgICAgICAgICAgICBtLmluaXRpYWxEaW1lbnNpb25zLmxlZnQgICA9PT0gbS5uZXdEaW1lbnNpb25zLmxlZnQgICAmJlxuICAgICAgICAgICAgICAgIG0uaW5pdGlhbERpbWVuc2lvbnMudG9wICAgID09PSBtLm5ld0RpbWVuc2lvbnMudG9wKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgdFNjYWxlWCAgID0gMSArIChtLm5ld1NjYWxlLnggLSAxKSAqIHQ7XG4gICAgICAgICAgICB2YXIgdFNjYWxlWSAgID0gMSArIChtLm5ld1NjYWxlLnkgLSAxKSAqIHQ7XG4gICAgICAgICAgICB2YXIgdE9mZnNldFggID0gbS5uZXdPZmZzZXQueCAqIHQ7XG4gICAgICAgICAgICB2YXIgdE9mZnNldFkgID0gbS5uZXdPZmZzZXQueSAqIHQ7XG5cbiAgICAgICAgICAgIHZhciB0cmFuc2Zvcm0gPSAndHJhbnNsYXRlKCc7XG4gICAgICAgICAgICB0cmFuc2Zvcm0gKz0gdE9mZnNldFggKyAncHgsICc7XG4gICAgICAgICAgICB0cmFuc2Zvcm0gKz0gdE9mZnNldFkgKyAncHgpICc7XG4gICAgICAgICAgICB0cmFuc2Zvcm0gKz0gJ3NjYWxlKCcgKyB0U2NhbGVYICsgJywnICsgdFNjYWxlWSArICcpICc7XG4gICAgICAgICAgICB0cmFuc2Zvcm0gKz0gbS5pbml0aWFsVHJhbnNmb3JtO1xuXG4gICAgICAgICAgICBzdHlsZShtLmVsLCAndHJhbnNmb3JtJywgdHJhbnNmb3JtKTtcblxuICAgICAgICAgICAgZm9yRWFjaC5jYWxsKG0uY2hpbGRyZW4sIGZ1bmN0aW9uKGVsKSB7XG4gICAgICAgICAgICAgIHZhciBzY2FsZSA9ICdzY2FsZSgnICsgKDEvdFNjYWxlWCkgKyAnLCcgKyAoMS90U2NhbGVZKSArICcpJztcblxuICAgICAgICAgICAgICBzdHlsZShlbCwgJ3RyYW5zZm9ybScsIHNjYWxlKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgdCAtPSAoMTYgLyBkdXJhdGlvbik7XG5cbiAgICAgICAgICBpZiAodCA+IDApIHtcbiAgICAgICAgICAgIHJlcXVlc3RBbmltYXRpb25GcmFtZSh0d2Vlbik7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNsZWFudXAoKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXF1ZXN0QW5pbWF0aW9uRnJhbWUoKCkgPT4ge1xuICAgICAgICAgIHR3ZWVuKCk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGZ1bmN0aW9uIGNsZWFudXAoKSB7XG4gICAgICAgICAgZm9yRWFjaC5jYWxsKG1lYXN1cmVtZW50cywgZnVuY3Rpb24obSkge1xuICAgICAgICAgICAgc3R5bGUobS5lbCwgJ3RyYW5zZm9ybS1vcmlnaW4nLCAnJyk7XG4gICAgICAgICAgICBzdHlsZShtLmVsLCAndHJhbnNmb3JtJywgbS5pbml0aWFsVHJhbnNmb3JtKTtcblxuICAgICAgICAgICAgZm9yRWFjaC5jYWxsKG0uY2hpbGRyZW4sIGZ1bmN0aW9uKGVsKSB7XG4gICAgICAgICAgICAgIHN0eWxlKGVsLCAndHJhbnNmb3JtLW9yaWdpbicsICcnKTtcbiAgICAgICAgICAgICAgc3R5bGUoZWwsICd0cmFuc2Zvcm0nLCAnJyk7XG4gICAgICAgICAgICB9KTtcbiAgICA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lbGVtZW50WzBdLnNjcm9sbEludG9WaWV3KCk7XG4gICAgICAgIH1cblxuICAgICAgICBzZWxmLmlzT3BlbiA9IHRydWU7XG4gICAgICAgICRzY29wZS4kYXBwbHlBc3luYygpO1xuICAgICAgICBzZWxmWydvblRvZ2dsZSddKHtzdGF0ZTogdHJ1ZX0pO1xuXG4gICAgICAgIGlmICghc2VsZi5yb290Q3RybC5tdWx0aXBsZSkge1xuICAgICAgICAgIHNlbGYucm9vdEN0cmwuY3VyUGFuZWwgPSBzZWxmO1xuICAgICAgICB9XG4gICAgICB9O1xuXG4gICAgICBzZWxmLmNsb3NlID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICRlbGVtZW50LnJlbW92ZUNsYXNzKCdvcGVuJyk7XG4gICAgICAgICRlbGVtZW50WzBdLnJlbW92ZUF0dHJpYnV0ZSgnb3BlbicpO1xuXG4gICAgICAgIHNlbGYuaXNPcGVuID0gZmFsc2U7XG4gICAgICAgICRzY29wZS4kYXBwbHlBc3luYygpO1xuICAgICAgICBzZWxmWydvblRvZ2dsZSddKHtzdGF0ZTogZmFsc2V9KTtcblxuXG4gICAgICAgIGlmIChzZWxmLnJvb3RDdHJsLmN1clBhbmVsID09PSBzZWxmKSB7XG4gICAgICAgICAgc2VsZi5yb290Q3RybC5jdXJQYW5lbCA9IG51bGw7XG4gICAgICAgIH1cbiAgICAgIH07XG5cbiAgICAgIHNlbGYuZm4gPSBmdW5jdGlvbigpIHtcbiAgICAgICAgaWYgKHNlbGYuaXNPcGVuKSB7XG4gICAgICAgICAgc2VsZi5jbG9zZSgpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHNlbGYub3BlbigpO1xuICAgICAgICB9XG5cbiAgICAgICAgQXJyYXkucHJvdG90eXBlLmZvckVhY2guY2FsbCgkZWxlbWVudC5jaGlsZHJlbigpLCBmdW5jdGlvbihlbCkge1xuICAgICAgICAgIGlmIChlbC5oYXNBdHRyaWJ1dGUoJ2F5LWFjY29yZGlvbi1oZWFkZXInKSkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChzZWxmLmlzT3Blbikge1xuICAgICAgICAgICAgZWwucmVtb3ZlQXR0cmlidXRlKCdoaWRkZW4nKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZWwuc2V0QXR0cmlidXRlKCdoaWRkZW4nLCAnaGlkZGVuJyk7XG4gICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgIH07XG5cblxuICAgICAgc2VsZi50b2dnbGUgPSBmdW5jdGlvbihjYikge1xuICAgICAgICBpZiAoc2VsZi5yb290Q3RybC5ibG9ja0NsaWNrcykge1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHNlbGYucm9vdEN0cmwucnVuKHNlbGYuZm4sIGNiKTtcbiAgICAgIH07XG4gICAgfSxcbiAgICBsaW5rOiBmdW5jdGlvbigkc2NvcGUsICRlbGVtZW50LCAkYXR0cnMsICRjdHJscykge1xuICAgICAgdmFyIHNlbGZDdHJsID0gJGN0cmxzWzBdO1xuICAgICAgdmFyIHJvb3RDdHJsID0gJGN0cmxzWzFdO1xuXG4gICAgICBzZWxmQ3RybC5yb290Q3RybCA9IHJvb3RDdHJsO1xuXG4gICAgICB2YXIgY2hpbGRDYWxsYmFjayA9IGZ1bmN0aW9uKGVsKSB7XG4gICAgICAgIGlmIChlbC5oYXNBdHRyaWJ1dGUoJ2F5LWFjY29yZGlvbi1oZWFkZXInKSkge1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICgkZWxlbWVudFswXS5oYXNBdHRyaWJ1dGUoJ29wZW4nKSkge1xuICAgICAgICAgIGVsLnJlbW92ZUF0dHJpYnV0ZSgnaGlkZGVuJyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgZWwuc2V0QXR0cmlidXRlKCdoaWRkZW4nLCAnaGlkZGVuJyk7XG4g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iAgICB9XG4gIH07XG59KTtcbiJdfQ== \ No newline at end of file +//# sourceMappingURL=accordion.js.map \ No newline at end of file diff --git a/dist/accordion.js.map b/dist/accordion.js.map new file mode 100644 index 0000000..8818be3 --- /dev/null +++ b/dist/accordion.js.map @@ -0,0 +1 @@ +{"version":3,"file":"accordion.js","sourceRoot":"","sources":["../src/accordion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAiBH,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,CAAC;KAChC,SAAS,CAAC,iBAAiB,EAAE;IAC5B,MAAM,CAAC;QACL,QAAQ,EAAE,GAAG;QACb,UAAU,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAS,MAAM,EAAE,QAAQ,EAAE,MAAM;gBAC5E,wEAAwE;gBACxE,IAAI,MAAM,GAAI,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC;gBACrC,IAAI,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC;gBACtC,IAAI,GAAG,GAAO,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC;gBAElC,IAAI,KAAK,GAAK,UAAS,EAAE,EAAE,IAAI,EAAE,KAAM;oBACrC,IAAI,OAAO,GAAG,CAAC,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;oBAEvC,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;wBAC7B,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;4BAC7C,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC;wBACtC,CAAC;oBACH,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACN,GAAG,CAAC,CAAC,IAAI,CAAC,GA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M,CAAC,cAAM,OAAA,KAAK,CAAC,MAAM,EAAZ,CAAY,EAAE,cAAM,OAAA,WAAW,EAAE,EAAb,CAAa,CAAC,CAAC;YAEvD,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,UAAS,MAAM;gBAClC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC1B,CAAC,CAAC,CAAC;YAEH,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,UAAS,MAAM;gBACpC,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,KAAK,EAAE,IAAI,MAAM,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC;oBACnD,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;gBAC1B,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*! Copyright (c) 2016 Ayogo Health Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* @internal */\ninterface IPanelController {\n rootCtrl : any;\n isOpen : boolean;\n open : () => void;\n close : () => void;\n toggle : (cb : any) => void;\n}\n\n/* @internal */\ninterface ITitleScope extends ng.IScope {\n isOpen : boolean;\n}\n\n\nangular.module('ayAccordion', [])\n.directive('ayAccordionRoot', function() {\n return {\n restrict: 'A',\n controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {\n // Helper Methods //////////////////////////////////////////////////////\n var filter = Array.prototype.filter;\n var forEach = Array.prototype.forEach;\n var map = Array.prototype.map;\n\n var style = function(el, prop, value?) {\n var vendors = ['', '-webkit-', '-ms-'];\n\n if (angular.isDefined(value)) {\n for (var i = vendors.length - 1; i >= 0; --i) {\n el.style[vendors[i] + prop] = value;\n }\n } else {\n for (var i = vendors.length - 1; i >= 0; --i) {\n if (el.style[vendors[i] + prop] !== '') {\n return el.style[vendors[i] + prop];\n }\n }\n return null;\n }\n };\n\n\n // Controller-level Variables //////////////////////////////////////////\n this.root = $element[0];\n this.multiple = angular.isDefined($attrs['multiple']);\n this.curPanel = null;\n this.blockClicks = false;\n\n\n // Controller methods //////////////////////////////////////////////////\n this.run = function(fn, cb) {\n var self = this;\n\n self.blockClicks = true;\n\n var elementsToWatch = filter.call(self.root.childNodes, function(el) {\n /* Disregard text nodes and comments */\n return el.nodeType === 1;\n });\n\n var preRoot = self.root.getBoundingClientRect();\n\n /* Take initial measurements */\n var measurements = map.call(elementsToWatch, function(el) {\n return {\n el: el,\n initialDimensions: el.getBoundingClientRect(),\n initialTransform: style(el, 'transform') || ''\n };\n });\n\n self.root.style.minHeight = preRoot.height + 'px';\n\n /* Close existing panels if needed */\n if (!this.multiple && this.curPanel && fn !== this.curPanel.fn && fn !== this.curPanel.close) {\n this.curPanel.close();\n }\n\n /* Run the function to change the state */\n fn();\n\n /* Set the element states to appear as initial after the change */\n forEach.call(measurements, function(m) {\n m.newDimensions = m.el.getBoundingClientRect();\n\n m.newScale = {\n x: m.initialDimensions.width / m.newDimensions.width,\n y: m.initialDimensions.height / m.newDimensions.height\n };\n\n m.newOffset = {\n x: m.initialDimensions.left - m.newDimensions.left,\n y: m.initialDimensions.top - m.newDimensions.top\n };\n\n requestAnimationFrame(() => {\n style(m.el, 'transform-origin', '0 0');\n });\n\n\n m.children = [];\n\n /* Set the grandchildren to the inverse transform */\n if (m.initialDimensions.height !== m.newDimensions.height ||\n m.initialDimensions.width !== m.newDimensions.width) {\n\n m.children = filter.call(m.el.childNodes, function(el) {\n return el.nodeType === 1;\n });\n\n forEach.call(m.children, function(el) {\n var elDimensions = el.getBoundingClientRect();\n var offsetFromParent = {\n x: m.newDimensions.left - elDimensions.left,\n y: m.newDimensions.top - elDimensions.top\n };\n\n var origin = offsetFromParent.x + 'px ';\n origin += offsetFromParent.y + 'px';\n\n requestAnimationFrame(() => {\n style(el, 'transform-origin', origin);\n });\n });\n }\n });\n\n var duration = 100; // In milliseconds\n var t = 1;\n\n function tween() {\n forEach.call(measurements, function(m) {\n if (m.initialDimensions.height === m.newDimensions.height &&\n m.initialDimensions.width === m.newDimensions.width &&\n m.initialDimensions.left === m.newDimensions.left &&\n m.initialDimensions.top === m.newDimensions.top) {\n return;\n }\n\n var tScaleX = 1 + (m.newScale.x - 1) * t;\n var tScaleY = 1 + (m.newScale.y - 1) * t;\n var tOffsetX = m.newOffset.x * t;\n var tOffsetY = m.newOffset.y * t;\n\n var transform = 'translate(';\n transform += tOffsetX + 'px, ';\n transform += tOffsetY + 'px) ';\n transform += 'scale(' + tScaleX + ',' + tScaleY + ') ';\n transform += m.initialTransform;\n\n style(m.el, 'transform', transform);\n\n forEach.call(m.children, function(el) {\n var scale = 'scale(' + (1/tScaleX) + ',' + (1/tScaleY) + ')';\n\n style(el, 'transform', scale);\n });\n });\n\n t -= (16 / duration);\n\n if (t > 0) {\n requestAnimationFrame(tween);\n } else {\n cleanup();\n }\n }\n\n requestAnimationFrame(() => {\n tween();\n });\n\n function cleanup() {\n forEach.call(measurements, function(m) {\n style(m.el, 'transform-origin', '');\n style(m.el, 'transform', m.initialTransform);\n\n forEach.call(m.children, function(el) {\n style(el, 'transform-origin', '');\n style(el, 'transform', '');\n });\n });\n\n self.blockClicks = false;\n self.root.style.minHeight = null;\n\n /* Invoke our callback function when done */\n $scope.$applyAsync(() => {\n cb();\n });\n }\n };\n }]\n };\n})\n\n.directive('ayAccordion', function() {\n return {\n restrict: 'A',\n require: ['ayAccordion', '^ayAccordionRoot'],\n controllerAs: 'accordion',\n bindToController: {\n onToggle: '&'\n },\n controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {\n var self = this;\n\n self.rootCtrl = null;\n self.isOpen = false;\n\n self.open = function() {\n $element.addClass('open');\n $element[0].setAttribute('open', 'open');\n\n if ($element[0] === $element[0].parentNode.lastElementChild) {\n $element[0].scrollIntoView();\n }\n\n self.isOpen = true;\n $scope.$applyAsync();\n self['onToggle']({state: true});\n\n if (!self.rootCtrl.multiple) {\n self.rootCtrl.curPanel = self;\n }\n };\n\n self.close = function() {\n $element.removeClass('open');\n $element[0].removeAttribute('open');\n\n self.isOpen = false;\n $scope.$applyAsync();\n self['onToggle']({state: false});\n\n\n if (self.rootCtrl.curPanel === self) {\n self.rootCtrl.curPanel = null;\n }\n };\n\n self.fn = function() {\n if (self.isOpen) {\n self.close();\n } else {\n self.open();\n }\n\n Array.prototype.forEach.call($element.children(), function(el) {\n if (el.hasAttribute('ay-accordion-header')) {\n return;\n }\n\n if (self.isOpen) {\n el.removeAttribute('hidden');\n } else {\n el.setAttribute('hidden', 'hidden');\n }\n });\n };\n\n\n self.toggle = function(cb) {\n if (self.rootCtrl.blockClicks) {\n return;\n }\n\n self.rootCtrl.run(self.fn, cb);\n };\n }],\n link: function($scope, $element, $attrs, $ctrls) {\n var selfCtrl = $ctrls[0];\n var rootCtrl = $ctrls[1];\n\n selfCtrl.rootCtrl = rootCtrl;\n\n var childCallback = function(el) {\n if (el.hasAttribute('ay-accordion-header')) {\n return;\n }\n\n if ($element[0].hasAttribute('open')) {\n el.removeAttribute('hidden');\n } else {\n el.setAttribute('hidden', 'hidden');\n }\n };\n\n Array.prototype.forEach.call($element.children(), childCallback);\n\n if ('MutationObserver' in window) {\n var observer = new MutationObserver(function() {\n Array.prototype.forEach.call($element.children(), childCallback);\n });\n\n observer.observe($element[0], { childList: true });\n\n $element.on('$destroy', function() {\n observer.disconnect();\n });\n }\n\n $attrs.$observe('open', function(newval) {\n if (newval || newval === \"\") {\n if (!$element.hasClass('open')) {\n selfCtrl.open();\n }\n } else if ($element.hasClass('open')) {\n selfCtrl.close();\n }\n });\n }\n };\n})\n\n.directive('ayAccordionHeader', function() {\n return {\n restrict: 'A',\n require: '^ayAccordion',\n scope: true, // Child scope\n\n link: function($scope, $element, $attrs, $ctrl : IPanelController) {\n $element[0].setAttribute('role', 'button');\n $element[0].setAttribute('tabIndex', '0');\n\n function updateState() {\n $element[0].setAttribute('aria-expanded', $ctrl.isOpen.toString());\n }\n\n function activate($event) {\n $ctrl.toggle(updateState);\n\n $event.preventDefault();\n return false;\n }\n\n $scope.$watch(() => $ctrl.isOpen, () => updateState());\n\n $element.on('click', function($event) {\n return activate($event);\n });\n\n $element.on('keydown', function($event) {\n if ($event.keyCode === 32 || $event.keyCode === 13) {\n return activate($event);\n }\n });\n }\n };\n});\n"]} \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts index f4691c4..7ce6a6e 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -19,5 +19,5 @@ * IN THE SOFTWARE. */ import './accordion'; -declare var _default: string; +declare var _default: "ayAccordion"; export default _default; diff --git a/dist/index.js b/dist/index.js index 53f6b27..fadaaf1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -19,7 +19,7 @@ * IN THE SOFTWARE. */ "use strict"; -require('./accordion'); +require("./accordion"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = "ayAccordion"; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIi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AqXG4gKiBUSEUgU09GVFdBUkUgSVMgUFJPVklERUQgXCJBUyBJU1wiLCBXSVRIT1VUIFdBUlJBTlRZIE9GIEFOWSBLSU5ELCBFWFBSRVNTIE9SXG4gKiBJTVBMSUVELCBJTkNMVURJTkcgQlVUIE5PVCBMSU1JVEVEIFRPIFRIRSBXQVJSQU5USUVTIE9GIE1FUkNIQU5UQUJJTElUWSxcbiAqIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFIEFORCBOT05JTkZSSU5HRU1FTlQuIElOIE5PIEVWRU5UIFNIQUxMIFRIRVxuICogQVVUSE9SUyBPUiBDT1BZUklHSFQgSE9MREVSUyBCRSBMSUFCTEUgRk9SIEFOWSBDTEFJTSwgREFNQUdFUyBPUiBPVEhFUlxuICogTElBQklMSVRZLCBXSEVUSEVSIElOIEFOIEFDVElPTiBPRiBDT05UUkFDVCwgVE9SVCBPUiBPVEhFUldJU0UsIEFSSVNJTkdcbiAqIEZST00sIE9VVCBPRiBPUiBJTiBDT05ORUNUSU9OIFdJVEggVEhFIFNPRlRXQVJFIE9SIFRIRSBVU0UgT1IgT1RIRVIgREVBTElOR1NcbiAqIElOIFRIRSBTT0ZUV0FSRS5cbiAqL1xuXG5pbXBvcnQgJy4vYWNjb3JkaW9uJztcbmV4cG9ydCBkZWZhdWx0IFwiYXlBY2NvcmRpb25cIjtcbiJdfQ== \ No newline at end of file +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 0000000..4c8578a --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;AAEH,uBAAqB;;AACrB,kBAAe,aAAa,CAAC","sourcesContent":["/*! Copyright (c) 2016 Ayogo Health Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport './accordion';\nexport default \"ayAccordion\";\n"]} \ No newline at end of file diff --git a/package.json b/package.json index a05ee68..b542787 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ay-accordion", - "version": "1.1.0", + "version": "1.2.0", "copyright": "Copyright 2016 Ayogo Health Inc.", "license": "MIT", "homepage": "http://ayogo.com",