From 2460e423224492a35a354ee6f3dc0dd4352d00d6 Mon Sep 17 00:00:00 2001 From: Jeffrey Barrus Date: Wed, 9 Dec 2015 14:24:54 -0700 Subject: [PATCH 001/385] feat(datepicker): add allowInvalid support - Adds support for invalid view values via `ngModelOptions` allowInvalid` setting Closes #4694 Closes #4837 --- src/datepicker/datepicker.js | 8 +++----- src/datepicker/docs/readme.md | 5 +++++ src/datepicker/test/datepicker.spec.js | 26 ++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/src/datepicker/datepicker.js b/src/datepicker/datepicker.js index e14a8d9..0caa38e 100644 --- a/src/datepicker/datepicker.js +++ b/src/datepicker/datepicker.js @@ -826,14 +826,12 @@ function(scope, element, attrs, $compile, $parse, $document, $rootScope, $positi if (angular.isString(viewValue)) { var date = parseDateString(viewValue); - if (isNaN(date)) { - return undefined; + if (!isNaN(date)) { + return date; } - - return date; } - return undefined; + return ngModel.$options && ngModel.$options.allowInvalid ? viewValue : undefined; } function validator(modelValue, viewValue) { diff --git a/src/datepicker/docs/readme.md b/src/datepicker/docs/readme.md index 5d02091..bfdc131 100644 --- a/src/datepicker/docs/readme.md +++ b/src/datepicker/docs/readme.md @@ -94,6 +94,11 @@ The datepicker has 3 modes: * `year-range` _(Default: `20`)_ - Number of years displayed in year selection. + +* `ng-model-options` + _(Default: {})_ - + allowInvalid support. [More on ngModelOptions](https://docs.angularjs.org/api/ng/directive/ngModelOptions). + ### uib-datepicker-popup settings ### diff --git a/src/datepicker/test/datepicker.spec.js b/src/datepicker/test/datepicker.spec.js index b81a47c..57ae84b 100644 --- a/src/datepicker/test/datepicker.spec.js +++ b/src/datepicker/test/datepicker.spec.js @@ -1266,6 +1266,32 @@ describe('datepicker', function() { }); }); + describe('ngModelOptions allowInvalid', function() { + var $sniffer, inputEl; + + beforeEach(inject(function(_$sniffer_) { + $sniffer = _$sniffer_; + + $rootScope.date = new Date('September 30, 2010 15:30:00'); + $rootScope.modelOptions = {allowInvalid: true}; + element = $compile('
')($rootScope); + inputEl = element.find('input'); + $rootScope.$digest(); + })); + + function changeInputValueTo(el, value) { + el.val(value); + el.trigger($sniffer.hasEvent('input') ? 'input' : 'change'); + $rootScope.$digest(); + } + + it('should update ng-model even if the date is invalid when allowInvalid is true', function() { + changeInputValueTo(inputEl, 'pizza'); + expect($rootScope.date).toBe('pizza'); + expect(inputEl.val()).toBe('pizza'); + }); + }); + describe('setting datepickerPopupConfig', function() { var originalConfig = {}; beforeEach(inject(function(uibDatepickerPopupConfig) { From b8969d1937fc055070076ce0538b27f0825d3ac9 Mon Sep 17 00:00:00 2001 From: Wesley Cho Date: Thu, 10 Dec 2015 09:15:11 -0800 Subject: [PATCH 002/385] fix(modal): fix bindToController - Fixes issue where `$scope` provided does not have properties present on controller instance due to $new resulting in the property on the prototype of the $scope copied from, which causes it to not be enumerable Closes #5048 Fixes #5039 --- src/modal/modal.js | 7 +++++-- src/modal/test/modal.spec.js | 20 +++++++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/modal/modal.js b/src/modal/modal.js index ab6c38e..c846cf9 100644 --- a/src/modal/modal.js +++ b/src/modal/modal.js @@ -616,8 +616,9 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap']) samePromise = promiseChain = $q.all([promiseChain]) .then(resolveWithTemplate, resolveWithTemplate) .then(function resolveSuccess(tplAndVars) { + var providedScope = modalOptions.scope || $rootScope; - var modalScope = (modalOptions.scope || $rootScope).$new(); + var modalScope = providedScope.$new(); modalScope.$close = modalInstance.close; modalScope.$dismiss = modalInstance.dismiss; @@ -641,7 +642,9 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap']) ctrlInstance = $controller(modalOptions.controller, ctrlLocals); if (modalOptions.controllerAs) { if (modalOptions.bindToController) { - angular.extend(ctrlInstance, modalScope); + ctrlInstance.$close = modalScope.$close; + ctrlInstance.$dismiss = modalScope.$dismiss; + angular.extend(ctrlInstance, providedScope); } modalScope[modalOptions.controllerAs] = ctrlInstance; diff --git a/src/modal/test/modal.spec.js b/src/modal/test/modal.spec.js index d9192aa..2220544 100644 --- a/src/modal/test/modal.spec.js +++ b/src/modal/test/modal.spec.js @@ -663,11 +663,21 @@ describe('$uibModal', function () { }); it('should allow usage of bindToController', function() { - open({template: '
{{test.fromCtrl}} {{test.isModalInstance}}
', controller: function($uibModalInstance) { - this.fromCtrl = 'Content from ctrl'; - this.isModalInstance = angular.isObject($uibModalInstance) && angular.isFunction($uibModalInstance.close); - }, controllerAs: 'test', bindToController: true}); - expect($document).toHaveModalOpenWithContent('Content from ctrl true', 'div'); + var $scope = $rootScope.$new(true); + $scope.foo = 'bar'; + open({ + template: '
{{test.fromCtrl}} {{test.closeDismissPresent()}} {{test.foo}}
', + controller: function($uibModalInstance) { + this.fromCtrl = 'Content from ctrl'; + this.closeDismissPresent = function() { + return angular.isFunction(this.$close) && angular.isFunction(this.$dismiss); + }; + }, + controllerAs: 'test', + bindToController: true, + scope: $scope + }); + expect($document).toHaveModalOpenWithContent('Content from ctrl true bar', 'div'); }); }); From fe689770335fa35cb9766137a1388c5e75bc1ced Mon Sep 17 00:00:00 2001 From: Wesley Cho Date: Thu, 10 Dec 2015 22:40:39 -0800 Subject: [PATCH 003/385] chore(modal): clean up code style --- src/dropdown/dropdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dropdown/dropdown.js b/src/dropdown/dropdown.js index ae0fe5d..2ed4ae1 100644 --- a/src/dropdown/dropdown.js +++ b/src/dropdown/dropdown.js @@ -34,7 +34,7 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position']) // unbound this event handler. So check openScope before proceeding. if (!openScope) { return; } - if (evt && openScope.getAutoClose() === 'disabled') { return ; } + if (evt && openScope.getAutoClose() === 'disabled') { return; } var toggleElement = openScope.getToggleElement(); if (evt && toggleElement && toggleElement[0].contains(evt.target)) { From b31f87cef630d1d332ade9d96f27d86fa3a2019f Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 11 Dec 2015 15:34:44 +0100 Subject: [PATCH 004/385] chore(modal): fix typo on test --- src/modal/test/modal.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modal/test/modal.spec.js b/src/modal/test/modal.spec.js index 2220544..b75f0de 100644 --- a/src/modal/test/modal.spec.js +++ b/src/modal/test/modal.spec.js @@ -1128,7 +1128,7 @@ describe('$uibModal', function () { }); describe('multiple modals', function() { - it('it should allow opening of multiple modals', function() { + it('should allow opening of multiple modals', function() { var modal1 = open({template: '
Modal1
'}); var modal2 = open({template: '
Modal2
'}); expect($document).toHaveModalsOpen(2); From 7be21c49830f2b73bd890d2413e668a4ade6be4f Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 11 Dec 2015 15:31:32 +0100 Subject: [PATCH 005/385] test(modal): test dismissAll Closes #5056 --- src/modal/test/modal.spec.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/modal/test/modal.spec.js b/src/modal/test/modal.spec.js index b75f0de..ba27fcb 100644 --- a/src/modal/test/modal.spec.js +++ b/src/modal/test/modal.spec.js @@ -1141,6 +1141,17 @@ describe('$uibModal', function () { expect($document).toHaveModalsOpen(0); }); + it('should be able to dismiss all modals at once', function() { + var modal1 = open({template: '
Modal1
'}); + var modal2 = open({template: '
Modal2
'}); + expect($document).toHaveModalsOpen(2); + + $uibModalStack.dismissAll(); + $animate.flush(); + $animate.flush(); + expect($document).toHaveModalsOpen(0); + }); + it('should not close any modals on ESC if the topmost one does not allow it', function() { var modal1 = open({template: '
Modal1
'}); var modal2 = open({template: '
Modal2
', keyboard: false}); From 1e24ff7bc12196fc597ac9749162cc026a9e8b13 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sat, 12 Dec 2015 00:02:48 +0100 Subject: [PATCH 006/385] chore(modal): remove empty line --- src/modal/test/modal.spec.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/modal/test/modal.spec.js b/src/modal/test/modal.spec.js index ba27fcb..d690347 100644 --- a/src/modal/test/modal.spec.js +++ b/src/modal/test/modal.spec.js @@ -368,7 +368,6 @@ describe('$uibModal', function () { }); it('should reject returned promise on dismiss', function() { - var modal = open({template: '
Content
'}); dismiss(modal, 'esc'); From 46882525f44bb5d35483c907039cf81098a3f142 Mon Sep 17 00:00:00 2001 From: Wesley Cho Date: Wed, 2 Dec 2015 23:15:43 -0800 Subject: [PATCH 007/385] chore(dropdown): remove class usage --- src/dropdown/docs/demo.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dropdown/docs/demo.html b/src/dropdown/docs/demo.html index 0c20744..9e26a52 100644 --- a/src/dropdown/docs/demo.html +++ b/src/dropdown/docs/demo.html @@ -133,7 +133,7 @@

append-to vs. append-to-body vs. inline example

diff --git a/src/tooltip/docs/readme.md b/src/tooltip/docs/readme.md index 167e07b..12645c6 100644 --- a/src/tooltip/docs/readme.md +++ b/src/tooltip/docs/readme.md @@ -4,60 +4,84 @@ directive supports multiple placements, optional transition animation, and more. There are three versions of the tooltip: `uib-tooltip`, `uib-tooltip-template`, and `uib-tooltip-html-unsafe`: -- `uib-tooltip` takes text only and will escape any HTML provided. -- `uib-tooltip-template` takes text that specifies the location of a template to - use for the tooltip. Note that this needs to be wrapped in a tag. -- `uib-tooltip-html` takes - whatever HTML is provided and displays it in a tooltip; *The user is responsible for ensuring the - content is safe to put into the DOM!* - -The tooltip directives provide several optional attributes to control how they -will display: - -- `tooltip-placement`: Where to place it? Defaults to "top". Passing in 'auto' seperated by a space before the placement will - enable auto positioning, e.g: "auto bottom-left". The tooltip will attempt to position where it fits in - the closest scrollable ancestor. Accepts: - - - "top" - tooltip on top, horizontally centered on host element. - - "top-left" - tooltip on top, left edge aligned with host element left edge. - - "top-right" - tooltip on top, right edge aligned with host element right edge. - - "bottom" - tooltip on bottom, horizontally centered on host element. - - "bottom-left" - tooltip on bottom, left edge aligned with host element left edge. - - "bottom-right" - tooltip on bottom, right edge aligned with host element right edge. - - "left" - tooltip on left, vertically centered on host element. - - "left-top" - tooltip on left, top edge aligned with host element top edge. - - "left-bottom" - tooltip on left, bottom edge aligned with host element bottom edge. - - "right" - tooltip on right, vertically centered on host element. - - "right-top" - tooltip on right, top edge aligned with host element top edge. - - "right-bottom" - tooltip on right, bottom edge aligned with host element bottom edge. -- `tooltip-animation`: Should it fade in and out? Defaults to "true". -- `tooltip-popup-delay`: For how long should the user have to have the mouse - over the element before the tooltip shows (in milliseconds)? Defaults to 0. -- `tooltip-popup-close-delay`: For how long should the tooltip remain open - after the close trigger event? Defaults to 0. -- `tooltip-trigger`: What should trigger a show of the tooltip? Supports a space separated list of event names. - Note: this attribute is no longer observable. See `tooltip-enable`. -- `tooltip-enable`: Is it enabled? It will enable or disable the configured - `tooltip-trigger`. -- `tooltip-append-to-body`_(Default: false)_: Should the tooltip be appended to `$body` instead of - the parent element? -- `tooltip-class`: Custom class to be applied to the tooltip. -- `tooltip-is-open` - _(Default: false)_: +* `uib-tooltip` - + Takes text only and will escape any HTML provided. +* `uib-tooltip-template` - + Takes text that specifies the location of a template to use for the tooltip. Note that this needs to be wrapped in a tag. +* `uib-tooltip-html` - + Takes whatever HTML is provided and displays it in a tooltip; *The user is responsible for ensuring the content is safe to put into the DOM!* + +### uib-tooltip-* settings + +All these settings are available for the three types of tooltips. + +* `tooltip-animation` + $ + C + _(Default: `true`, Config: `animation`)_ - + Should it fade in and out? + +* `tooltip-append-to-body` + $ + _(Default: `false`)_ - + Should the tooltip be appended to '$body' instead of the parent element? + +* `tooltip-class` - + Custom class to be applied to the tooltip. + +* `tooltip-enable` + $ + _(Default: `true`)_ - + Is it enabled? It will enable or disable the configured tooltip-trigger. + +* `tooltip-is-open` + + _(Default: `false`)_ - Whether to show the tooltip. -The tooltip directives require the `$position` service. - -**Triggers** - -The following show triggers are supported out of the box, along with their -provided hide triggers: +* `tooltip-placement` + C + _(Default: `top`, Config: `placement`)_ - + Passing in 'auto' seperated by a space before the placement will enable auto positioning, e.g: "auto bottom-left". The tooltip will attempt to position where it fits in the closest scrollable ancestor. Accepts: + + * `top` - tooltip on top, horizontally centered on host element. + * `top-left` - tooltip on top, left edge aligned with host element left edge. + * `top-right` - tooltip on top, right edge aligned with host element right edge. + * `bottom` - tooltip on bottom, horizontally centered on host element. + * `bottom-left` - tooltip on bottom, left edge aligned with host element left edge. + * `bottom-right` - tooltip on bottom, right edge aligned with host element right edge. + * `left` - tooltip on left, vertically centered on host element. + * `left-top` - tooltip on left, top edge aligned with host element top edge. + * `left-bottom` - tooltip on left, bottom edge aligned with host element bottom edge. + * `right` - tooltip on right, vertically centered on host element. + * `right-top` - tooltip on right, top edge aligned with host element top edge. + * `right-bottom` - tooltip on right, bottom edge aligned with host element bottom edge. + +* `tooltip-popup-close-delay` + C + _(Default: `0`, Config: `popupCloseDelay`)_ - + For how long should the tooltip remain open after the close trigger event? + +* `tooltip-popup-delay` + C + _(Default: `0`, Config: `popupDelay`)_ - + Popup delay in milliseconds until it opens. + +* `tooltip-trigger` + _(Default: `mouseenter`)_ - + What should trigger a show of the tooltip? Supports a space separated list of event names (see below). + +**Note:** To configure the tooltips, you need to do it on `$uibTooltipProvider` (also see below). + +### Triggers + +The following show triggers are supported out of the box, along with their provided hide triggers: - `mouseenter`: `mouseleave` - `click`: `click` - `outsideClick`: `outsideClick` - `focus`: `blur` -- `none`: `` +- `none` The `outsideClick` trigger will cause the tooltip to toggle on click, and hide when anything else is clicked. @@ -65,28 +89,20 @@ For any non-supported value, the trigger will be used to both show and hide the tooltip. Using the 'none' trigger will disable the internal trigger(s), one can then use the `tooltip-is-open` attribute exclusively to show and hide the tooltip. -**$uibTooltipProvider** +### $uibTooltipProvider Through the `$uibTooltipProvider`, you can change the way tooltips and popovers behave by default; the attributes above always take precedence. The following methods are available: -- `setTriggers(obj)`: Extends the default trigger mappings mentioned above - with mappings of your own. E.g. `{ 'openTrigger': 'closeTrigger' }`. -- `options(obj)`: Provide a set of defaults for certain tooltip and popover - attributes. Currently supports 'placement', 'placementClassPrefix', 'animation', 'popupDelay', and - `appendToBody`. Here are the defaults: - -
-  placement: 'top',
-  placementClassPrefix: '',
-  animation: true,
-  popupDelay: 0,
-  popupCloseDelay: 500,
-  appendToBody: false
-  
- -**Known issues** +* `setTriggers(obj)` + _(Example: `{ 'openTrigger': 'closeTrigger' }`)_ - + Extends the default trigger mappings mentioned above with mappings of your own. + +* `options(obj)` - + Provide a set of defaults for certain tooltip and popover attributes. Currently supports the ones with the C badge. + +### Known issues For Safari 7+ support, if you want to use the **focus** `tooltip-trigger`, you need to use an anchor tag with a tab index. For example: diff --git a/src/tooltip/tooltip.js b/src/tooltip/tooltip.js index f2c74f5..e7b922b 100644 --- a/src/tooltip/tooltip.js +++ b/src/tooltip/tooltip.js @@ -55,7 +55,7 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.s }; /** - * This is a helper function for translating camel-case to snake-case. + * This is a helper function for translating camel-case to snake_case. */ function snake_case(name) { var regexp = /[A-Z]/g; @@ -348,9 +348,9 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.s } /** - * Set the inital scope values. Once + * Set the initial scope values. Once * the tooltip is created, the observers - * will be added to keep things in synch. + * will be added to keep things in sync. */ function prepareTooltip() { ttScope.title = attrs[prefix + 'Title']; From dc229ac01f1480c415dc6f59e21bb406bef3600b Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Mon, 4 Jan 2016 20:21:24 +0100 Subject: [PATCH 060/385] docs(tooltip): there is no html unsafe version anymore --- src/tooltip/docs/readme.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/tooltip/docs/readme.md b/src/tooltip/docs/readme.md index 12645c6..f973c2b 100644 --- a/src/tooltip/docs/readme.md +++ b/src/tooltip/docs/readme.md @@ -2,7 +2,7 @@ A lightweight, extensible directive for fancy tooltip creation. The tooltip directive supports multiple placements, optional transition animation, and more. There are three versions of the tooltip: `uib-tooltip`, `uib-tooltip-template`, and -`uib-tooltip-html-unsafe`: +`uib-tooltip-html`: * `uib-tooltip` - Takes text only and will escape any HTML provided. @@ -20,20 +20,20 @@ All these settings are available for the three types of tooltips. C _(Default: `true`, Config: `animation`)_ - Should it fade in and out? - + * `tooltip-append-to-body` $ _(Default: `false`)_ - Should the tooltip be appended to '$body' instead of the parent element? - + * `tooltip-class` - Custom class to be applied to the tooltip. - + * `tooltip-enable` $ _(Default: `true`)_ - Is it enabled? It will enable or disable the configured tooltip-trigger. - + * `tooltip-is-open` _(Default: `false`)_ - @@ -43,7 +43,7 @@ All these settings are available for the three types of tooltips. C _(Default: `top`, Config: `placement`)_ - Passing in 'auto' seperated by a space before the placement will enable auto positioning, e.g: "auto bottom-left". The tooltip will attempt to position where it fits in the closest scrollable ancestor. Accepts: - + * `top` - tooltip on top, horizontally centered on host element. * `top-left` - tooltip on top, left edge aligned with host element left edge. * `top-right` - tooltip on top, right edge aligned with host element right edge. @@ -56,7 +56,7 @@ All these settings are available for the three types of tooltips. * `right` - tooltip on right, vertically centered on host element. * `right-top` - tooltip on right, top edge aligned with host element top edge. * `right-bottom` - tooltip on right, bottom edge aligned with host element bottom edge. - + * `tooltip-popup-close-delay` C _(Default: `0`, Config: `popupCloseDelay`)_ - @@ -66,7 +66,7 @@ All these settings are available for the three types of tooltips. C _(Default: `0`, Config: `popupDelay`)_ - Popup delay in milliseconds until it opens. - + * `tooltip-trigger` _(Default: `mouseenter`)_ - What should trigger a show of the tooltip? Supports a space separated list of event names (see below). @@ -98,7 +98,7 @@ methods are available: * `setTriggers(obj)` _(Example: `{ 'openTrigger': 'closeTrigger' }`)_ - Extends the default trigger mappings mentioned above with mappings of your own. - + * `options(obj)` - Provide a set of defaults for certain tooltip and popover attributes. Currently supports the ones with the C badge. From dbdffd4c4e11decd7b654e02527b60ae0100bbf3 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Mon, 4 Jan 2016 20:29:47 +0100 Subject: [PATCH 061/385] docs(tooltip): fix typo --- src/tooltip/docs/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tooltip/docs/readme.md b/src/tooltip/docs/readme.md index f973c2b..a683f91 100644 --- a/src/tooltip/docs/readme.md +++ b/src/tooltip/docs/readme.md @@ -42,7 +42,7 @@ All these settings are available for the three types of tooltips. * `tooltip-placement` C _(Default: `top`, Config: `placement`)_ - - Passing in 'auto' seperated by a space before the placement will enable auto positioning, e.g: "auto bottom-left". The tooltip will attempt to position where it fits in the closest scrollable ancestor. Accepts: + Passing in 'auto' separated by a space before the placement will enable auto positioning, e.g: "auto bottom-left". The tooltip will attempt to position where it fits in the closest scrollable ancestor. Accepts: * `top` - tooltip on top, horizontally centered on host element. * `top-left` - tooltip on top, left edge aligned with host element left edge. From ff5e72069097462f93ff73840fda9e6328aafaff Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Mon, 4 Jan 2016 20:37:42 +0100 Subject: [PATCH 062/385] docs(popover): tune up Closes #5146 --- src/popover/docs/demo.html | 1 + src/popover/docs/readme.md | 139 +++++++++++++++++++++++++------------ 2 files changed, 95 insertions(+), 45 deletions(-) diff --git a/src/popover/docs/demo.html b/src/popover/docs/demo.html index 948f0c9..7750afb 100644 --- a/src/popover/docs/demo.html +++ b/src/popover/docs/demo.html @@ -42,4 +42,5 @@

Triggers

Other

+ diff --git a/src/popover/docs/readme.md b/src/popover/docs/readme.md index 3365a58..e25fd69 100644 --- a/src/popover/docs/readme.md +++ b/src/popover/docs/readme.md @@ -4,55 +4,104 @@ directive supports multiple placements, optional transition animation, and more. Like the Bootstrap jQuery plugin, the popover **requires** the tooltip module. -There are two versions of the popover: `uib-popover` and `uib-popover-template`: - -- `uib-popover` takes text only and will escape any HTML provided for the popover - body. -- `uib-popover-html` takes an expression that evaluates to an html string. *The user is responsible for ensuring the - content is safe to put into the DOM!* -- `uib-popover-template` a URL representing the location of a template to - use for the popover body. Note that the contents of this template need to be - wrapped in a tag, e.g., `
`. - -The popover directives provides several optional attributes to control how it -will display: - -- `popover-title`: A string to display as a fancy title. -- `popover-placement`: Where to place it? Defaults to "top". Passing in 'auto' seperated by a space before the placement will - enable auto positioning, e.g: "auto bottom-left". The popover will attempt to position where it fits in - the closest scrollable ancestor. Accepts: - - - "top" - popover on top, horizontally centered on host element. - - "top-left" - popover on top, left edge aligned with host element left edge. - - "top-right" - popover on top, right edge aligned with host element right edge. - - "bottom" - popover on bottom, horizontally centered on host element. - - "bottom-left" - popover on bottom, left edge aligned with host element left edge. - - "bottom-right" - popover on bottom, right edge aligned with host element right edge. - - "left" - popover on left, vertically centered on host element. - - "left-top" - popover on left, top edge aligned with host element top edge. - - "left-bottom" - popover on left, bottom edge aligned with host element bottom edge. - - "right" - popover on right, vertically centered on host element. - - "right-top" - popover on right, top edge aligned with host element top edge. - - "right-bottom" - popover on right, bottom edge aligned with host element bottom edge. -- `popover-animation`: Should it fade in and out? Defaults to "true". -- `popover-popup-delay`: For how long should the user have to have the mouse - over the element before the popover shows (in milliseconds)? Defaults to 0. -- `popover-popup-close-delay`: For how long should the popover remain open - after the close trigger event? Defaults to 0. -- `popover-trigger`: What should trigger the show of the popover? See the - `tooltip` directive for supported values. -- `popover-append-to-body`_(Default: false)_: Should the popover be appended to `$body` instead of - the parent element? -- `popover-is-open` - _(Default: false)_: +There are three versions of the popover: `uib-popover` and `uib-popover-template`, and `uib-tooltip-html`: + +* `uib-popover` + Takes text only and will escape any HTML provided for the popover body. + +* `uib-popover-html` + Takes an expression that evaluates to an html string. *The user is responsible for ensuring the content is safe to put into the DOM!* + +* `uib-popover-template` + A URL representing the location of a template to use for the popover body. Note that the contents of this template need to be wrapped in a tag, e.g., `
`. + +### uib-popover-* settings + +All these settings are available for the three types of popovers. + +* `popover-animation` + $ + C + _(Default: `true`, Config: `animation`)_ - + Should it fade in and out? + +* `popover-append-to-body` + $ + _(Default: `false`)_ - + Should the popover be appended to '$body' instead of the parent element? + +* `popover-is-open` + + _(Default: `false`)_ - Whether to show the popover. -The popover directives require the `$position` service. +* `popover-placement` + C + _(Default: `top`, Config: `placement`)_ - + Passing in 'auto' separated by a space before the placement will enable auto positioning, e.g: "auto bottom-left". The popover will attempt to position where it fits in the closest scrollable ancestor. Accepts: + + * `top` - popover on top, horizontally centered on host element. + * `top-left` - popover on top, left edge aligned with host element left edge. + * `top-right` - popover on top, right edge aligned with host element right edge. + * `bottom` - popover on bottom, horizontally centered on host element. + * `bottom-left` - popover on bottom, left edge aligned with host element left edge. + * `bottom-right` - popover on bottom, right edge aligned with host element right edge. + * `left` - popover on left, vertically centered on host element. + * `left-top` - popover on left, top edge aligned with host element top edge. + * `left-bottom` - popover on left, bottom edge aligned with host element bottom edge. + * `right` - popover on right, vertically centered on host element. + * `right-top` - popover on right, top edge aligned with host element top edge. + * `right-bottom` - popover on right, bottom edge aligned with host element bottom edge. + +* `popover-popup-close-delay` + C + _(Default: `0`, Config: `popupCloseDelay`)_ - + For how long should the popover remain open after the close trigger event? + +* `popover-popup-delay` + C + _(Default: `0`, Config: `popupDelay`)_ - + Popup delay in milliseconds until it opens. + +* `popover-title` - + A string to display as a fancy title. + +* `popover-trigger` + _(Default: `mouseenter`)_ - + What should trigger a show of the popover? Supports a space separated list of event names (see below). + +**Note:** To configure the tooltips, you need to do it on `$uibTooltipProvider` (also see below). + +### Triggers + +The following show triggers are supported out of the box, along with their provided hide triggers: + +- `mouseenter`: `mouseleave` +- `click`: `click` +- `outsideClick`: `outsideClick` +- `focus`: `blur` +- `none` + +The `outsideClick` trigger will cause the popover to toggle on click, and hide when anything else is clicked. + +For any non-supported value, the trigger will be used to both show and hide the +popover. Using the 'none' trigger will disable the internal trigger(s), one can +then use the `popover-is-open` attribute exclusively to show and hide the popover. + +### $uibTooltipProvider + +Through the `$uibTooltipProvider`, you can change the way tooltips and popovers +behave by default; the attributes above always take precedence. The following +methods are available: -The popover directive also supports various default configurations through the -$tooltipProvider. See the [tooltip](#tooltip) section for more information. +* `setTriggers(obj)` + _(Example: `{ 'openTrigger': 'closeTrigger' }`)_ - + Extends the default trigger mappings mentioned above with mappings of your own. + +* `options(obj)` - + Provide a set of defaults for certain tooltip and popover attributes. Currently supports the ones with the C badge. -**Known issues** +### Known issues For Safari 7+ support, if you want to use **focus** `popover-trigger`, you need to use an anchor tag with a tab index. For example: From cab0945ac968a0946c22c8be5e50a892ebf298d4 Mon Sep 17 00:00:00 2001 From: Chenyu Zhang Date: Tue, 5 Jan 2016 18:27:04 -0500 Subject: [PATCH 063/385] fix(typeahead): fix programmatic focus issue - Fix issue where programmatic focus on typeahead input does not work Closes #5150 Fixes #764 --- src/typeahead/test/typeahead.spec.js | 1 + src/typeahead/typeahead.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/typeahead/test/typeahead.spec.js b/src/typeahead/test/typeahead.spec.js index ea250f4..a4d6a53 100644 --- a/src/typeahead/test/typeahead.spec.js +++ b/src/typeahead/test/typeahead.spec.js @@ -1337,6 +1337,7 @@ describe('typeahead tests', function() { var element = prepareInputEl('
'); var inputEl = findInput(element); inputEl.focus(); + $timeout.flush(); $scope.$digest(); expect(element).toBeOpenWithActive(3, 0); }); diff --git a/src/typeahead/typeahead.js b/src/typeahead/typeahead.js index e52e1bd..8be9507 100644 --- a/src/typeahead/typeahead.js +++ b/src/typeahead/typeahead.js @@ -407,7 +407,9 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap element.bind('focus', function () { hasFocus = true; if (minLength === 0 && !modelCtrl.$viewValue) { - getMatchesAsync(modelCtrl.$viewValue); + $timeout(function() { + getMatchesAsync(modelCtrl.$viewValue); + }, 0); } }); From 4d37c9240b1793124d9b3d2cd8be8c5bf15fecdd Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Tue, 5 Jan 2016 18:19:36 +0100 Subject: [PATCH 064/385] docs(progressbar): tune up Closes #5148 --- src/progressbar/docs/readme.md | 75 ++++++++++++++++++++++++---------- 1 file changed, 54 insertions(+), 21 deletions(-) diff --git a/src/progressbar/docs/readme.md b/src/progressbar/docs/readme.md index 45a4fe5..cc13bf0 100644 --- a/src/progressbar/docs/readme.md +++ b/src/progressbar/docs/readme.md @@ -1,32 +1,65 @@ A progress bar directive that is focused on providing feedback on the progress of a workflow or action. -It supports multiple (stacked) bars into the same `` element or a single `` element with optional `max` attribute and transition animations. +It supports multiple (stacked) `` into the same `` element or a single `` element with optional `max` attribute and transition animations. -### Settings ### +### uib-progressbar settings -#### `` #### +* `value` + $ + - + The current value of progress completed. - * `value` - : - The current value of progress completed. +* `type` + _(Default: `null`)_ - + Bootstrap style type. Possible values are 'success', 'info', 'warning', and, 'error' to use Bootstrap's pre-existing styling, or any desired custom suffix. - * `type` - _(Default: null)_ : - Style type. Possible values are 'success', 'warning' etc. +* `max` + $ + C + + _(Default: `100`)_ - + A number that specifies the total value of bars that is required. - * `max` - _(Default: 100)_ : - A number that specifies the total value of bars that is required. +* `animate` + $ + C + _(Default: `true`)_ - + Whether bars use transitions to achieve the width change. - * `animate` - _(Default: true)_ : - Whether bars use transitions to achieve the width change. +* `title` + _(Default: `progressbar`)_ - + Title to use as label (for accessibility). + +### uib-progress settings - * `title` - _(Default: progressbar)_ : - Title to use as label (for accessibility) +* `max` + $ + C + + _(Default: `100`)_ - + A number that specifies the total value of bars that is required. -### Stacked ### +* `animate` + $ + C + _(Default: `true`)_ - + Whether bars use transitions to achieve the width change. -Place multiple ``s into the same `` element to stack them. -`` supports `max`, `animate`, and `title` & `` supports `value`, `title`, and `type` attributes. +* `title` + _(Default: `progressbar`)_ - + Title to use as label (for accessibility). + +### uib-bar settings + +* `value` + $ + - + The current value of progress completed. + +* `type` + _(Default: `null`)_ - + Bootstrap style type. Possible values are 'success', 'info', 'warning', and, 'error' to use Bootstrap's pre-existing styling, or any desired custom suffix. + +* `title` + _(Default: `progressbar`)_ - + Title to use as label (for accessibility). From 86ed171e37b4eaea8936fcbf4d0ec4e1899192ad Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Wed, 6 Jan 2016 19:53:33 +0100 Subject: [PATCH 065/385] docs(rating): tune up Closes #5154 --- src/rating/docs/readme.md | 88 ++++++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 39 deletions(-) diff --git a/src/rating/docs/readme.md b/src/rating/docs/readme.md index 45cbeb9..9b0cd00 100644 --- a/src/rating/docs/readme.md +++ b/src/rating/docs/readme.md @@ -1,41 +1,51 @@ Rating directive that will take care of visualising a star rating bar. -### Settings ### - -#### `` #### - - * `ng-model` - : - The current rate. - - * `max` - _(Defaults: 5)_ : - Changes the number of icons. - - * `readonly` - _(Defaults: false)_ : - Prevent user's interaction. - - * `titles` - _(Defaults: ["one", "two", "three", "four", "five"])_ : - An array of Strings defining titles for all icons - - * `on-hover(value)` - : - An optional expression called when user's mouse is over a particular icon. - - * `on-leave()` - : - An optional expression called when user's mouse leaves the control altogether. - - * `state-on` - _(Defaults: null)_ : - A variable used in template to specify the state (class, src, etc) for selected icons. - - * `state-off` - _(Defaults: null)_ : - A variable used in template to specify the state for unselected icons. - - * `rating-states` - _(Defaults: null)_ : - An array of objects defining properties for all icons. In default template, `stateOn` & `stateOff` property is used to specify the icon's class. +### uib-rating settings + +* `max` + $ + C + _(Default: `5`)_ - + Changes the number of icons. + +* `ng-model` + $ + - + The current rate. + +* `on-hover(value)` + $ - + An optional expression called when user's mouse is over a particular icon. + +* `on-leave()` + $ - + An optional expression called when user's mouse leaves the control altogether. + +* `rating-states` + $ + _(Default: `null`)_ - + An array of objects defining properties for all icons. In default template, `stateOn` & `stateOff` property is used to specify the icon's class. + +* `readonly` + $ + + _(Default: `false`)_ - + Prevent user's interaction. + +* `titles` + $ + C + _(Default: ['one', 'two', 'three', 'four', 'five']`)_ - + An array of strings defining titles for all icons. + +* `state-off` + $ + C + _(Default: `null`)_ - + A variable used in the template to specify the state for unselected icons. + +* `state-on` + $ + C + _(Default: `null`)_ - + A variable used in the template to specify the state (class, src, etc) for selected icons. From e1723bf09d4581fad32d27d72423645304ceb3e6 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 7 Jan 2016 01:30:18 +0100 Subject: [PATCH 066/385] docs(datepicker): remove unneeded signs --- src/datepicker/docs/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/datepicker/docs/readme.md b/src/datepicker/docs/readme.md index 71c25a5..07c6193 100644 --- a/src/datepicker/docs/readme.md +++ b/src/datepicker/docs/readme.md @@ -10,7 +10,7 @@ The datepicker has 3 modes: * `month` - In this mode you can select a month within a selected year. * `year` - In this mode you are presented with a range of years (20 by default). -### uib-datepicker settings ### +### uib-datepicker settings * `custom-class (date, mode)` $ @@ -140,7 +140,7 @@ The datepicker has 3 modes: _(Default: `5`)_ - Number of columns displayed in year selection. -### uib-datepicker-popup settings ### +### uib-datepicker-popup settings Options for the uib-datepicker must be passed as JSON using the `datepicker-options` attribute. This list is only for popup settings. @@ -215,7 +215,7 @@ Options for the uib-datepicker must be passed as JSON using the `datepicker-opti _(Default: `yyyy-MM-dd`, Config: `datepickerConfig`)_ - The format for displayed dates. This string can take string literals by surrounding the value with backticks, i.e. ``yyyy-MM-dd h `o'clock` ``. -### Keyboard support ### +### Keyboard support Depending on datepicker's current mode, the date may refer either to day, month or year. Accordingly, the term view refers either to a month, year or year range. From f40066af9ea26279579e9c3b3265185dfc178f5f Mon Sep 17 00:00:00 2001 From: Wesley Cho Date: Wed, 6 Jan 2016 18:47:19 -0800 Subject: [PATCH 067/385] revert(dateparser): change template literal to ' This reverts commit 9513f1007f1fa800a50f83d8b71e8ed1bafdbdcd. Fixes #5091 BREAKING CHANGE: Reverts back to original template literal with `'` instead of `\'' --- src/dateparser/dateparser.js | 12 +++---- src/dateparser/docs/README.md | 44 +++++++++++++------------- src/dateparser/test/dateparser.spec.js | 15 +++++---- 3 files changed, 37 insertions(+), 34 deletions(-) diff --git a/src/dateparser/dateparser.js b/src/dateparser/dateparser.js index fd6670b..deaf548 100644 --- a/src/dateparser/dateparser.js +++ b/src/dateparser/dateparser.js @@ -179,16 +179,16 @@ angular.module('ui.bootstrap.dateparser', []) var map = [], regex = format.split(''); // check for literal values - var quoteIndex = format.indexOf('`'); + var quoteIndex = format.indexOf('\''); if (quoteIndex > -1) { var inLiteral = false; format = format.split(''); for (var i = quoteIndex; i < format.length; i++) { if (inLiteral) { - if (format[i] === '`') { - if (i + 1 < format.length && format[i + 1] === '\`') { // escaped backtick - format[i + 1] = '$'; - regex[i + 1] = ''; + if (format[i] === '\'') { + if (i + 1 < format.length && format[i+1] === '\'') { // escaped single quote + format[i+1] = '$'; + regex[i+1] = ''; } else { // end of literal regex[i] = ''; inLiteral = false; @@ -196,7 +196,7 @@ angular.module('ui.bootstrap.dateparser', []) } format[i] = '$'; } else { - if (format[i] === '`') { // start of literal + if (format[i] === '\'') { // start of literal format[i] = '$'; regex[i] = ''; inLiteral = true; diff --git a/src/dateparser/docs/README.md b/src/dateparser/docs/README.md index 9197e5e..df514ac 100644 --- a/src/dateparser/docs/README.md +++ b/src/dateparser/docs/README.md @@ -15,7 +15,7 @@ Certain format codes support i18n. Check this [guide](https://docs.angularjs.org * `format` _(Type: `string`, Example: `yyyy/MMM/d`)_ - The format we want to use. Check all the supported formats below. - + * `baseDate` _(Type: `Date`, Example: `new Date()`)_ - If you want to parse a date but maintain the timezone, you can pass an existing date here. @@ -23,33 +23,33 @@ Certain format codes support i18n. Check this [guide](https://docs.angularjs.org ##### return * If the specified input matches the format, a new date with the input will be returned, otherwise, it will return undefined. - + ### uibDateParser's format codes * `yyyy` _(Example: `2015`)_ - Parses a 4 digits year. - + * `yy` _(Example: `15`)_ - Parses a 2 digits year. - + * `y` _(Example: `15`)_ - Parses a year with 1, 2, 3, or 4 digits. - + * `MMMM` _(Example: `February`, i18n support)_ - Parses the full name of a month. - + * `MMM` _(Example: `Feb`, i18n support)_ - Parses the short name of a month. - + * `MM` _(Example: `12`, Leading 0)_ - Parses a numeric month. - + * `M` _(Example: `3`)_ - Parses a numeric month. @@ -61,7 +61,7 @@ Certain format codes support i18n. Check this [guide](https://docs.angularjs.org * `dd` _(Example: `05`, Leading 0)_ - Parses a numeric day. - + * `d` _(Example: `5`)_ - Parses a numeric day. @@ -69,11 +69,11 @@ Certain format codes support i18n. Check this [guide](https://docs.angularjs.org * `d!` _(Example: `3` or `03`)_ - Parses a numeric day, but allowing an optional leading zero - + * `EEEE` _(Example: `Sunday`, i18n support)_ - Parses the full name of a day. - + * `EEE` _(Example: `Mon`, i18n support)_ - Parses the short name of a day. @@ -81,39 +81,39 @@ Certain format codes support i18n. Check this [guide](https://docs.angularjs.org * `HH` _(Example: `14`, Leading 0)_ - Parses a 24 hours time. - + * `H` _(Example: `3`)_ - Parses a 24 hours time. - + * `hh` _(Example: `11`, Leading 0)_ - Parses a 12 hours time. - + * `h` _(Example: `3`)_ - Parses a 12 hours time. - + * `mm` _(Example: `09`, Leading 0)_ - Parses the minutes. - + * `m` _(Example: `3`)_ - Parses the minutes. - + * `sss` _(Example: `094`, Leading 0)_ - Parses the milliseconds. - + * `ss` _(Example: `08`, Leading 0)_ - Parses the seconds. - + * `s` _(Example: `22`)_ - Parses the seconds. - + * `a` _(Example: `10AM`)_ - Parses a 12 hours time with AM/PM. @@ -136,9 +136,9 @@ Certain format codes support i18n. Check this [guide](https://docs.angularjs.org * `GGGG` _(Example: `Anno Domini`)_ - Parses the long form of the era (`Anno Domini` or `Before Christ`) - + \* The ones marked with `Leading 0`, needs a leading 0 for values less than 10. Exception being milliseconds which needs it for values under 100. \** It also supports `fullDate|longDate|medium|mediumDate|mediumTime|short|shortDate|shortTime` as the format for parsing. -\*** It supports template literals as a string between the backtick `\`` character, i.e. `\`The Date is\` MM/DD/YYYY`. If one wants the literal backtick character, one must use `\`\`\`\``. +\*** It supports template literals as a string between the single quote `'` character, i.e. `\`The Date is\` MM/DD/YYYY`. If one wants the literal single quote character, one must use `''''`. diff --git a/src/dateparser/test/dateparser.spec.js b/src/dateparser/test/dateparser.spec.js index 3e94025..36ed89d 100644 --- a/src/dateparser/test/dateparser.spec.js +++ b/src/dateparser/test/dateparser.spec.js @@ -310,20 +310,23 @@ describe('date parser', function() { describe('with value literals', function() { it('should work with multiple literals', function() { - expect(dateParser.parse('29 de January de 2013', 'd `de` MMMM `de` y')).toEqual(new Date(2013, 0, 29)); - expect(dateParser.parse('22.March.15 12 o\'clock', 'd.MMMM.yy h `o\'clock`')).toEqual(new Date(2015, 2, 22, 12)); + expect(dateParser.parse('29 de January de 2013', 'd \'de\' MMMM \'de\' y')).toEqual(new Date(2013, 0, 29)); }); - it('should work with only a backtick', function() { - expect(dateParser.parse('22.March.15 `', 'd.MMMM.yy `\`\``')).toEqual(new Date(2015, 2, 22)); + it('should work with escaped single quote', function() { + expect(dateParser.parse('22.March.15 12 o\'clock', 'd.MMMM.yy h \'o\'\'clock\'')).toEqual(new Date(2015, 2, 22, 12)); + }); + + it('should work with only a single quote', function() { + expect(dateParser.parse('22.March.15 \'', 'd.MMMM.yy \'\'\'')).toEqual(new Date(2015, 2, 22)); }); it('should work with trailing literal', function() { - expect(dateParser.parse('year 2013', '`year` y')).toEqual(new Date(2013, 0, 1)); + expect(dateParser.parse('year 2013', '\'year\' y')).toEqual(new Date(2013, 0, 1)); }); it('should work without whitespace', function() { - expect(dateParser.parse('year:2013', '`year:`y')).toEqual(new Date(2013, 0, 1)); + expect(dateParser.parse('year:2013', '\'year:\'y')).toEqual(new Date(2013, 0, 1)); }); }); From d320df88a39b6075c162c5a581654fb68d3af19f Mon Sep 17 00:00:00 2001 From: Wesley Cho Date: Wed, 6 Jan 2016 19:57:57 -0800 Subject: [PATCH 068/385] chore(dateparser): fix docs --- src/dateparser/docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dateparser/docs/README.md b/src/dateparser/docs/README.md index df514ac..d5cc38f 100644 --- a/src/dateparser/docs/README.md +++ b/src/dateparser/docs/README.md @@ -141,4 +141,4 @@ Certain format codes support i18n. Check this [guide](https://docs.angularjs.org \** It also supports `fullDate|longDate|medium|mediumDate|mediumTime|short|shortDate|shortTime` as the format for parsing. -\*** It supports template literals as a string between the single quote `'` character, i.e. `\`The Date is\` MM/DD/YYYY`. If one wants the literal single quote character, one must use `''''`. +\*** It supports template literals as a string between the single quote `'` character, i.e. `'The Date is' MM/DD/YYYY`. If one wants the literal single quote character, one must use `''''`. From a5ca78ad2a0fac6fe8f7badec70c3c9bc4448c17 Mon Sep 17 00:00:00 2001 From: Wesley Cho Date: Wed, 6 Jan 2016 20:43:35 -0800 Subject: [PATCH 069/385] feat(tooltip): change back to jqLite listeners - Change event listeners to be handled by jqLite Closes #4886 Closes #5157 --- src/tooltip/test/tooltip-template.spec.js | 4 +-- src/tooltip/test/tooltip.spec.js | 24 +++++------------- src/tooltip/test/tooltip2.spec.js | 4 +-- src/tooltip/tooltip.js | 31 ++++++++++------------- 4 files changed, 22 insertions(+), 41 deletions(-) diff --git a/src/tooltip/test/tooltip-template.spec.js b/src/tooltip/test/tooltip-template.spec.js index d0cde43..cec7d4b 100644 --- a/src/tooltip/test/tooltip-template.spec.js +++ b/src/tooltip/test/tooltip-template.spec.js @@ -37,9 +37,7 @@ describe('tooltip template', function() { }); function trigger(element, evt) { - evt = new Event(evt); - - element[0].dispatchEvent(evt); + element.trigger(evt); element.scope().$$childTail.$digest(); } diff --git a/src/tooltip/test/tooltip.spec.js b/src/tooltip/test/tooltip.spec.js index 3508347..b04989e 100644 --- a/src/tooltip/test/tooltip.spec.js +++ b/src/tooltip/test/tooltip.spec.js @@ -31,9 +31,7 @@ describe('tooltip', function() { }); function trigger(element, evt) { - evt = new Event(evt); - - element[0].dispatchEvent(evt); + element.trigger(evt); element.scope().$$childTail.$digest(); } @@ -750,9 +748,7 @@ describe('tooltipWithDifferentSymbols', function() { })); function trigger(element, evt) { - evt = new Event(evt); - - element[0].dispatchEvent(evt); + element.trigger(evt); element.scope().$$childTail.$digest(); } @@ -798,9 +794,7 @@ describe('tooltip positioning', function() { })); function trigger(element, evt) { - evt = new Event(evt); - - element[0].dispatchEvent(evt); + element.trigger(evt); element.scope().$$childTail.$digest(); } @@ -856,9 +850,7 @@ describe('tooltipHtml', function() { })); function trigger(element, evt) { - evt = new Event(evt); - - element[0].dispatchEvent(evt); + element.trigger(evt); element.scope().$$childTail.$digest(); } @@ -897,9 +889,7 @@ describe('$uibTooltipProvider', function() { tooltipScope; function trigger(element, evt) { - evt = new Event(evt); - - element[0].dispatchEvent(evt); + element.trigger(evt); element.scope().$$childTail.$digest(); } @@ -1030,7 +1020,7 @@ describe('$uibTooltipProvider', function() { }); describe('triggers', function() { - describe('triggers with a mapped value', function() { + describe('with a mapped value', function() { beforeEach(module('ui.bootstrap.tooltip', function($uibTooltipProvider) { $uibTooltipProvider.options({trigger: 'focus'}); })); @@ -1077,7 +1067,7 @@ describe('$uibTooltipProvider', function() { })); }); - describe('triggers with a custom mapped value', function() { + describe('with a custom mapped value', function() { beforeEach(module('ui.bootstrap.tooltip', function($uibTooltipProvider) { $uibTooltipProvider.setTriggers({ customOpenTrigger: 'foo bar' }); $uibTooltipProvider.options({trigger: 'customOpenTrigger'}); diff --git a/src/tooltip/test/tooltip2.spec.js b/src/tooltip/test/tooltip2.spec.js index 00573eb..e8df646 100644 --- a/src/tooltip/test/tooltip2.spec.js +++ b/src/tooltip/test/tooltip2.spec.js @@ -56,9 +56,7 @@ describe('tooltip directive', function() { } function trigger(element, evt) { - evt = new Event(evt); - - element[0].dispatchEvent(evt); + element.trigger(evt); element.scope().$$childTail.$digest(); } diff --git a/src/tooltip/tooltip.js b/src/tooltip/tooltip.js index e7b922b..d6347f3 100644 --- a/src/tooltip/tooltip.js +++ b/src/tooltip/tooltip.js @@ -481,20 +481,18 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.s var unregisterTriggers = function() { triggers.show.forEach(function(trigger) { if (trigger === 'outsideClick') { - element[0].removeEventListener('click', toggleTooltipBind); + element.off('click', toggleTooltipBind); } else { - element[0].removeEventListener(trigger, showTooltipBind); - element[0].removeEventListener(trigger, toggleTooltipBind); + element.off(trigger, showTooltipBind); + element.off(trigger, toggleTooltipBind); } }); triggers.hide.forEach(function(trigger) { - trigger.split(' ').forEach(function(hideTrigger) { - if (trigger === 'outsideClick') { - $document[0].removeEventListener('click', bodyHideTooltipBind); - } else { - element[0].removeEventListener(hideTrigger, hideTooltipBind); - } - }); + if (trigger === 'outsideClick') { + $document.off('click', bodyHideTooltipBind); + } else { + element.off(trigger, hideTooltipBind); + } }); }; @@ -506,17 +504,14 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.s if (triggers.show !== 'none') { triggers.show.forEach(function(trigger, idx) { - // Using raw addEventListener due to jqLite/jQuery bug - #4060 if (trigger === 'outsideClick') { - element[0].addEventListener('click', toggleTooltipBind); - $document[0].addEventListener('click', bodyHideTooltipBind); + element.on('click', toggleTooltipBind); + $document.on('click', bodyHideTooltipBind); } else if (trigger === triggers.hide[idx]) { - element[0].addEventListener(trigger, toggleTooltipBind); + element.on(trigger, toggleTooltipBind); } else if (trigger) { - element[0].addEventListener(trigger, showTooltipBind); - triggers.hide[idx].split(' ').forEach(function(trigger) { - element[0].addEventListener(trigger, hideTooltipBind); - }); + element.on(trigger, showTooltipBind); + element.on(triggers.hide[idx], hideTooltipBind); } element.on('keypress', function(e) { From 3ef8992c5446f04bb8461bfac9fa287154e7ea24 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 7 Jan 2016 22:32:16 +0100 Subject: [PATCH 070/385] docs(tabs): tune up Closes #5163 --- src/tabs/docs/readme.md | 84 +++++++++++++++------------- src/tabs/tabs.js | 119 ---------------------------------------- 2 files changed, 46 insertions(+), 157 deletions(-) diff --git a/src/tabs/docs/readme.md b/src/tabs/docs/readme.md index d00461c..aa1319c 100644 --- a/src/tabs/docs/readme.md +++ b/src/tabs/docs/readme.md @@ -1,40 +1,48 @@ AngularJS version of the tabs directive. -### Settings ### - -#### `` #### - - * `vertical` - _(Defaults: false)_ : - Whether tabs appear vertically stacked. - - * `justified` - _(Defaults: false)_ : - Whether tabs fill the container and have a consistent width. - - * `type` - _(Defaults: 'tabs')_ : - Navigation type. Possible values are 'tabs' and 'pills'. - -#### `` #### - - * `heading` or `` - : - Heading text or HTML markup. - - * `active` - _(Defaults: false)_ : - Whether tab is currently selected. - - * `disable` - _(Defaults: false)_ : - Whether tab is clickable and can be activated. - Note that this was previously the `disabled` attribute, which is now deprecated. - - * `select()` - _(Defaults: null)_ : - An optional expression called when tab is activated. - - * `deselect()` - _(Defaults: null)_ : - An optional expression called when tab is deactivated. +### uib-tabset settings + +* `justified` + $ + _(Default: `false`)_ - + Whether tabs fill the container and have a consistent width. + +* `type` + _(Defaults: `tabs`)_ - + Navigation type. Possible values are 'tabs' and 'pills'. + +* `vertical` + $ + _(Default: `false`)_ - + Whether tabs appear vertically stacked. + +### uib-tab settings + +* `active` + $ + + _(Default: `false`)_ - + Whether tab is currently selected. + +* `deselect()` + $ + _(Default: `null`)_ - + An optional expression called when tab is deactivated. + +* `disable` + $ + + _(Default: `false`)_ - + Whether tab is clickable and can be activated. + +* `heading` - + Heading text. + +* `select()` + $ + _(Default: `null`)_ - + An optional expression called when tab is activated. + +### Tabset heading + +Instead of the `heading` attribute on the `uib-tabset`, you can use an `uib-tab-heading` element inside a tabset that will be used as the tabset's header. There you can use HTML as well. diff --git a/src/tabs/tabs.js b/src/tabs/tabs.js index fb2e80b..527db24 100644 --- a/src/tabs/tabs.js +++ b/src/tabs/tabs.js @@ -1,12 +1,3 @@ - -/** - * @ngdoc overview - * @name ui.bootstrap.tabs - * - * @description - * AngularJS version of the tabs directive. - */ - angular.module('ui.bootstrap.tabs', []) .controller('UibTabsetController', ['$scope', function ($scope) { @@ -59,36 +50,6 @@ angular.module('ui.bootstrap.tabs', []) }); }]) -/** - * @ngdoc directive - * @name ui.bootstrap.tabs.directive:tabset - * @restrict EA - * - * @description - * Tabset is the outer container for the tabs directive - * - * @param {boolean=} vertical Whether or not to use vertical styling for the tabs. - * @param {boolean=} justified Whether or not to use justified styling for the tabs. - * - * @example - - - - First Content! - Second Content! - -
- - First Vertical Content! - Second Vertical Content! - - - First Justified Content! - Second Justified Content! - -
-
- */ .directive('uibTabset', function() { return { transclude: true, @@ -105,86 +66,6 @@ angular.module('ui.bootstrap.tabs', []) }; }) -/** - * @ngdoc directive - * @name ui.bootstrap.tabs.directive:tab - * @restrict EA - * - * @param {string=} heading The visible heading, or title, of the tab. Set HTML headings with {@link ui.bootstrap.tabs.directive:tabHeading tabHeading}. - * @param {string=} select An expression to evaluate when the tab is selected. - * @param {boolean=} active A binding, telling whether or not this tab is selected. - * @param {boolean=} disabled A binding, telling whether or not this tab is disabled. - * - * @description - * Creates a tab with a heading and content. Must be placed within a {@link ui.bootstrap.tabs.directive:tabset tabset}. - * - * @example - - -
- - -
- - First Tab - - Alert me! - Second Tab, with alert callback and html heading! - - - {{item.content}} - - -
-
- - function TabsDemoCtrl($scope) { - $scope.items = [ - { title:"Dynamic Title 1", content:"Dynamic Item 0" }, - { title:"Dynamic Title 2", content:"Dynamic Item 1", disabled: true } - ]; - - $scope.alertMe = function() { - setTimeout(function() { - alert("You've selected the alert tab!"); - }); - }; - }; - -
- */ - -/** - * @ngdoc directive - * @name ui.bootstrap.tabs.directive:tabHeading - * @restrict EA - * - * @description - * Creates an HTML heading for a {@link ui.bootstrap.tabs.directive:tab tab}. Must be placed as a child of a tab element. - * - * @example - - - - - HTML in my titles?! - And some content, too! - - - Icon heading?!? - That's right. - - - - - */ .directive('uibTab', ['$parse', function($parse) { return { require: '^uibTabset', From 3e876b8fdd0d683029fca57695b44068a43cd243 Mon Sep 17 00:00:00 2001 From: Daniel Gornstein Date: Thu, 7 Jan 2016 15:44:41 -0800 Subject: [PATCH 071/385] feat(typeahead): add event object to onSelect - Add support for `$event` in expression with `onSelect` Closes #5165 --- src/typeahead/docs/readme.md | 4 +-- src/typeahead/test/typeahead.spec.js | 6 +++-- src/typeahead/typeahead.js | 33 +++++++++++++------------ template/typeahead/typeahead-popup.html | 2 +- 4 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/typeahead/docs/readme.md b/src/typeahead/docs/readme.md index 540f17d..127796e 100644 --- a/src/typeahead/docs/readme.md +++ b/src/typeahead/docs/readme.md @@ -55,9 +55,9 @@ The typeahead directives provide several attributes: _(Defaults: angular.noop)_ : Binding to a variable that indicates if no matching results were found -* `typeahead-on-select($item, $model, $label)` +* `typeahead-on-select($item, $model, $label, $event)` _(Defaults: null)_ : - A callback executed when a match is selected + A callback executed when a match is selected. $event can be undefined if selection not triggered from a user event. * `typeahead-select-on-exact` _(Defaults: false)_ : diff --git a/src/typeahead/test/typeahead.spec.js b/src/typeahead/test/typeahead.spec.js index a4d6a53..cf7640a 100644 --- a/src/typeahead/test/typeahead.spec.js +++ b/src/typeahead/test/typeahead.spec.js @@ -478,12 +478,13 @@ describe('typeahead tests', function() { }); it('should invoke select callback on select', function() { - $scope.onSelect = function($item, $model, $label) { + $scope.onSelect = function($item, $model, $label, $event) { $scope.$item = $item; $scope.$model = $model; $scope.$label = $label; + $scope.$event = $event; }; - var element = prepareInputEl('
'); + var element = prepareInputEl('
'); changeInputValueTo(element, 'Alas'); triggerKeyDown(element, 13); @@ -492,6 +493,7 @@ describe('typeahead tests', function() { expect($scope.$item).toEqual($scope.states[0]); expect($scope.$model).toEqual('AL'); expect($scope.$label).toEqual('Alaska'); + expect($scope.$event.type).toEqual("keydown"); }); it('should correctly update inputs value on mapping where label is not derived from the model', function() { diff --git a/src/typeahead/typeahead.js b/src/typeahead/typeahead.js index 8be9507..f2ddb1f 100644 --- a/src/typeahead/typeahead.js +++ b/src/typeahead/typeahead.js @@ -151,7 +151,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap id: popupId, matches: 'matches', active: 'activeIdx', - select: 'select(activeIdx)', + select: 'select(activeIdx, evt)', 'move-in-progress': 'moveInProgress', query: 'query', position: 'position', @@ -202,7 +202,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap return false; }; - var getMatchesAsync = function(inputValue) { + var getMatchesAsync = function(inputValue, evt) { var locals = {$viewValue: inputValue}; isLoadingSetter(originalScope, true); isNoResultsSetter(originalScope, false); @@ -238,10 +238,10 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap if (selectOnExact && scope.matches.length === 1 && inputIsExactMatch(inputValue, 0)) { if (angular.isNumber(scope.debounceUpdate) || angular.isObject(scope.debounceUpdate)) { $$debounce(function() { - scope.select(0); + scope.select(0, evt); }, angular.isNumber(scope.debounceUpdate) ? scope.debounceUpdate : scope.debounceUpdate['default']); } else { - scope.select(0); + scope.select(0, evt); } } @@ -329,7 +329,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap isOpenSetter(originalScope, isOpen); }; - scope.select = function(activeIdx) { + scope.select = function(activeIdx, evt) { //called from within the $digest() cycle var locals = {}; var model, item; @@ -344,7 +344,8 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap onSelectCallback(originalScope, { $item: item, $model: model, - $label: parserResult.viewMapper(originalScope, locals) + $label: parserResult.viewMapper(originalScope, locals), + $event: evt }); resetMatches(); @@ -378,10 +379,10 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap scope.$apply(function () { if (angular.isNumber(scope.debounceUpdate) || angular.isObject(scope.debounceUpdate)) { $$debounce(function() { - scope.select(scope.activeIdx); + scope.select(scope.activeIdx, evt); }, angular.isNumber(scope.debounceUpdate) ? scope.debounceUpdate : scope.debounceUpdate['default']); } else { - scope.select(scope.activeIdx); + scope.select(scope.activeIdx, evt); } }); break; @@ -404,25 +405,25 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap } }); - element.bind('focus', function () { + element.bind('focus', function (evt) { hasFocus = true; if (minLength === 0 && !modelCtrl.$viewValue) { $timeout(function() { - getMatchesAsync(modelCtrl.$viewValue); + getMatchesAsync(modelCtrl.$viewValue, evt); }, 0); } }); - element.bind('blur', function() { + element.bind('blur', function(evt) { if (isSelectOnBlur && scope.matches.length && scope.activeIdx !== -1 && !selected) { selected = true; scope.$apply(function() { if (angular.isObject(scope.debounceUpdate) && angular.isNumber(scope.debounceUpdate.blur)) { $$debounce(function() { - scope.select(scope.activeIdx); + scope.select(scope.activeIdx, evt); }, scope.debounceUpdate.blur); } else { - scope.select(scope.activeIdx); + scope.select(scope.activeIdx, evt); } }); } @@ -585,14 +586,14 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap scope.active = matchIdx; }; - scope.selectMatch = function(activeIdx) { + scope.selectMatch = function(activeIdx, evt) { var debounce = scope.debounce(); if (angular.isNumber(debounce) || angular.isObject(debounce)) { $$debounce(function() { - scope.select({activeIdx: activeIdx}); + scope.select({activeIdx: activeIdx, evt: evt}); }, angular.isNumber(debounce) ? debounce : debounce['default']); } else { - scope.select({activeIdx: activeIdx}); + scope.select({activeIdx: activeIdx, evt: evt}); } }; } diff --git a/template/typeahead/typeahead-popup.html b/template/typeahead/typeahead-popup.html index 20a362b..ecc508d 100644 --- a/template/typeahead/typeahead-popup.html +++ b/template/typeahead/typeahead-popup.html @@ -1,5 +1,5 @@ From e1e6e1bb62af33dc8140728fc59d6e0b2c972e8b Mon Sep 17 00:00:00 2001 From: Wesley Cho Date: Thu, 7 Jan 2016 17:08:56 -0800 Subject: [PATCH 072/385] fix(typeahead): use correct selector - With the addition of the header, the selector to scroll the dropdown onto the correct element is incorrect - this fixes it to select all list elements in the dropdown Closes #5168 Fixes #5167 --- src/typeahead/typeahead.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/typeahead/typeahead.js b/src/typeahead/typeahead.js index f2ddb1f..a566ed7 100644 --- a/src/typeahead/typeahead.js +++ b/src/typeahead/typeahead.js @@ -46,7 +46,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap var isEditable = originalScope.$eval(attrs.typeaheadEditable) !== false; originalScope.$watch(attrs.typeaheadEditable, function (newVal) { isEditable = newVal !== false; - }); + }); //binding to a variable that indicates if matches are being retrieved asynchronously var isLoadingSetter = $parse(attrs.typeaheadLoading).assign || angular.noop; @@ -395,12 +395,12 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap case 38: scope.activeIdx = (scope.activeIdx > 0 ? scope.activeIdx : scope.matches.length) - 1; scope.$digest(); - popUpEl.children()[scope.activeIdx].scrollIntoView(false); + popUpEl.find('li')[scope.activeIdx].scrollIntoView(false); break; case 40: scope.activeIdx = (scope.activeIdx + 1) % scope.matches.length; scope.$digest(); - popUpEl.children()[scope.activeIdx].scrollIntoView(false); + popUpEl.find('li')[scope.activeIdx].scrollIntoView(false); break; } }); From a9e476f0f7aeba841477b06f6829ec0ae49b70aa Mon Sep 17 00:00:00 2001 From: Wesley Cho Date: Sun, 27 Dec 2015 16:17:56 -0500 Subject: [PATCH 073/385] feat: add npm support in main repository - Add support for consuming the main repository via npm for releases Closes #4739 Closes #5129 --- index.js | 3 +++ package.json | 1 + 2 files changed, 4 insertions(+) create mode 100644 index.js diff --git a/index.js b/index.js new file mode 100644 index 0000000..722c734 --- /dev/null +++ b/index.js @@ -0,0 +1,3 @@ +require('./dist/ui-bootstrap-tpls'); + +module.exports = 'ui.bootstrap'; diff --git a/package.json b/package.json index c0519f7..64d2461 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "files": [ "dist/", "src/", "template/" ], + "main": "index.js", "scripts":{ "test": "grunt" }, From b6031d6bf0467eacac44abd8685c28cb1f272c71 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 8 Jan 2016 00:55:05 +0100 Subject: [PATCH 074/385] docs(timepicker): tune up Closes #5166 --- src/timepicker/docs/readme.md | 163 ++++++++++++++++++++-------------- 1 file changed, 97 insertions(+), 66 deletions(-) diff --git a/src/timepicker/docs/readme.md b/src/timepicker/docs/readme.md index a87c240..39b2f90 100644 --- a/src/timepicker/docs/readme.md +++ b/src/timepicker/docs/readme.md @@ -1,68 +1,99 @@ A lightweight & configurable timepicker directive. -### Settings ### - -All settings can be provided as attributes in the `` or globally configured through the `uibTimepickerConfig`. - - * `ng-model` - : - The Date object that provides the time state. - - * `template-url` (Defaults: `template/timepicker/timepicker.html`) : - Add the ability to override the template used on the component. - - * `hour-step` - _(Defaults: 1)_ : - Number of hours to increase or decrease when using a button. - - * `minute-step` - _(Defaults: 1)_ : - Number of minutes to increase or decrease when using a button. - - * `second-step` - _(Defaults: 1)_ : - Number of seconds to increase or decrease when using a button. - - * `show-meridian` - _(Defaults: true)_ : - Whether to display 12H or 24H mode. - - * `meridians` - _(Defaults: null)_ : - Meridian labels based on locale. To override you must supply an array like ['AM', 'PM']. - - * `readonly-input` - _(Defaults: false)_ : - Whether user can type inside the hours & minutes input. - - * `mousewheel` - _(Defaults: true)_ : - Whether user can scroll inside the hours & minutes input to increase or decrease it's values. - - * `arrowkeys` - _(Defaults: true)_ : - Whether user can use up/down arrowkeys inside the hours & minutes input to increase or decrease it's values. - - * `show-spinners` - _(Defaults: true)_ : - Shows spinner arrows above and below the inputs - - * `show_seconds` - _(Defaults: false)_ : - Shows seconds input - - * `min` - _(Defaults: undefined)_ : - Minimum time a user can select - - * `max` - _(Defaults: undefined)_ : - Maximum time a user can select - - * `tabindex` - _(Defaults: 0)_ : - Sets tabindex for each control in timepicker - - * `template-url` - _(Defaults: uib/template/timepicker/timepicker.html)_ : - Add the ability to override the template used on the component. +### uib-timepicker settings + +* `arrowkeys` + $ + C + _(Default: `true`)_ - + Whether user can use up/down arrow keys inside the hours & minutes input to increase or decrease its values. + +* `hour-step` + $ + C + + _(Default: `1`)_ - + Number of hours to increase or decrease when using a button. + +* `max` + $ + + _(Default: `undefined`)_ - + Maximum time a user can select. + +* `meridians` + $ + C + _(Default: `null`)_ - + Meridian labels based on locale. To override you must supply an array like `['AM', 'PM']`. + +* `min` + $ + + _(Default: `undefined`)_ - + Minimum time a user can select + +* `minute-step` + $ + C + + _(Default: `1`)_ - + Number of minutes to increase or decrease when using a button. + +* `mousewheel` + $ + C + _(Default: `true`)_ - + Whether user can scroll inside the hours & minutes input to increase or decrease its values. + +* `ng-disabled` + $ + + _(Default: `false`)_ - + Whether or not to disable the component. + +* `ng-model` + $ + - + Date object that provides the time state. + +* `readonly-input` + $ + C + _(Default: `false`)_ - + Whether user can type inside the hours & minutes input. + +* `second-step` + $ + C + + _(Default: `1`)_ - + Number of seconds to increase or decrease when using a button. + +* `show-meridian` + $ + C + + _(Default: `true`)_ - + Whether to display 12H or 24H mode. + +* `show-seconds` + $ + C + + _(Default: `false`)_ - + Show seconds input. + +* `show-spinners` + $ + C + _(Default: `true`)_ - + Show spinner arrows above and below the inputs. + +* `tabindex` + _(Defaults: `0`)_ - + Sets tabindex for each control in the timepicker. + +* `template-url` + _(Defaults: `uib/template/timepicker/timepicker.html`)_ - + Add the ability to override the template used on the component. From 1a3e2adf1a936c152f346942296d1f6959d1e019 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 8 Jan 2016 12:54:21 +0100 Subject: [PATCH 075/385] docs(typeahead): tune up Closes #5170 --- src/typeahead/docs/demo.html | 2 +- src/typeahead/docs/readme.md | 149 ++++++++++++++++++++--------------- 2 files changed, 88 insertions(+), 63 deletions(-) diff --git a/src/typeahead/docs/demo.html b/src/typeahead/docs/demo.html index c712959..aee4805 100644 --- a/src/typeahead/docs/demo.html +++ b/src/typeahead/docs/demo.html @@ -70,7 +70,7 @@

ngModelOptions support

Custom templates for results

Model: {{customSelected | json}}
- +

Custom popup templates for typeahead's dropdown

Model: {{customPopupSelected | json}}
diff --git a/src/typeahead/docs/readme.md b/src/typeahead/docs/readme.md index 127796e..e5ca9ce 100644 --- a/src/typeahead/docs/readme.md +++ b/src/typeahead/docs/readme.md @@ -11,82 +11,107 @@ The `sourceArray` expression can use a special `$viewValue` variable that corres This directive works with promises, meaning you can retrieve matches using the `$http` service with minimal effort. -The typeahead directives provide several attributes: +### uib-typeahead settings -* `ng-model` - : - Assignable angular expression to data-bind to +* `ng-model` + $ + - + Assignable angular expression to data-bind to. * `ng-model-options` - : - Options for ng-model (see [ng-model-options directive](https://docs.angularjs.org/api/ng/directive/ngModelOptions)). Currently supports the `debounce` and `getterSetter` options - -* `uib-typeahead` - : - Comprehension Angular expression (see [select directive](http://docs.angularjs.org/api/ng.directive:select)) - -* `typeahead-append-to-body` - _(Defaults: false)_ : Should the typeahead popup be appended to $body instead of the parent element? + $ - + Options for ng-model (see [ng-model-options directive](https://docs.angularjs.org/api/ng/directive/ngModelOptions)). Currently supports the `debounce` and `getterSetter` options. * `typeahead-append-to` - _(Defaults: null)_ : Should the typeahead popup be appended to an element instead of the parent element? - -* `typeahead-editable` - _(Defaults: true)_ : - Should it restrict model values to the ones selected from the popup only ? + $ + _(Default: `null`)_ - + Should the typeahead popup be appended to an element instead of the parent element? + +* `typeahead-append-to-body` + $ + + _(Default: `false`)_ - + Should the typeahead popup be appended to $body instead of the parent element? + +* `typeahead-editable` + $ + + _(Default: `true`)_ - + Should it restrict model values to the ones selected from the popup only? * `typeahead-focus-first` - _(Defaults: true)_ : - Should the first match automatically be focused as you type? - -* `typeahead-input-formatter` - _(Defaults: undefined)_ : - Format the ng-model result after selection + $ + _(Default: `true`)_ - + Should the first match automatically be focused as you type? -* `typeahead-loading` - _(Defaults: angular.noop)_ : - Binding to a variable that indicates if matches are being retrieved asynchronously - -* `typeahead-min-length` - _(Defaults: 1)_ : - Minimal no of characters that needs to be entered before typeahead kicks-in. Must be greater than or equal to 0. - -* `typeahead-no-results` - _(Defaults: angular.noop)_ : - Binding to a variable that indicates if no matching results were found +* `typeahead-focus-on-select` + _(Default: `true`)_ - + On selection, focus the input element the typeahead directive is associated with. + +* `typeahead-input-formatter` + + _(Default: `undefined`)_ - + Format the ng-model result after selection. + +* `typeahead-is-open` + $ + + _(Default: `angular.noop`)_ - + Binding to a variable that indicates if the dropdown is open. + +* `typeahead-loading` + $ + + _(Default: `angular.noop`)_ - + Binding to a variable that indicates if matches are being retrieved asynchronously. + +* `typeahead-min-length` + $ + + _(Default: `1`)_ - + Minimal no of characters that needs to be entered before typeahead kicks-in. Must be greater than or equal to 0. + +* `typeahead-no-results` + $ + + _(Default: `angular.noop`)_ - + Binding to a variable that indicates if no matching results were found. * `typeahead-on-select($item, $model, $label, $event)` - _(Defaults: null)_ : - A callback executed when a match is selected. $event can be undefined if selection not triggered from a user event. - -* `typeahead-select-on-exact` - _(Defaults: false)_ : - Should it automatically select an item when there is one option that exactly matches the user input? - -* `typeahead-template-url` - _(Defaults: `uib/template/typeahead/typeahead-match.html`)_ : - Set custom item template + $ + _(Default: `null`)_ - + A callback executed when a match is selected. $event can be undefined if selection not triggered from a user event. * `typeahead-popup-template-url` - _(Defaults: `uib/template/typeahead/typeahead-popup.html`)_ : - Set custom popup template - -* `typeahead-wait-ms` - _(Defaults: 0)_ : - Minimal wait time after last character typed before typeahead kicks-in + _(Default: `uib/template/typeahead/typeahead-popup.html`)_ - + Set custom popup template. * `typeahead-select-on-blur` - _(Defaults: false)_ : - On blur, select the currently highlighted match + $ + _(Default: `false`)_ - + On blur, select the currently highlighted match. -* `typeahead-focus-on-select` - _(Defaults: true) : - On selection, focus the input element the typeahead directive is associated with - -* `typeahead-is-open` - _(Defaults: angular.noop)_ : - Binding to a variable that indicates if dropdown is open +* `typeahead-select-on-exact` + $ + _(Default: `false`)_ - + Should it automatically select an item when there is one option that exactly matches the user input? * `typeahead-show-hint` - _(Defaults: false)_ : - Should input show hint that matches the first option? + $ + _(Default: `false`)_ - + Should input show hint that matches the first option? + +* `typeahead-template-url` + _(Default: `uib/template/typeahead/typeahead-match.html`)_ - + Set custom item template. + +* `typeahead-wait-ms` + $ + + _(Default: `0`)_ - + Minimal wait time after last character typed before typeahead kicks-in. + +* `uib-typeahead` + $ + - + Comprehension Angular expression (see [select directive](http://docs.angularjs.org/api/ng.directive:select)). From 859dccd7110376fea8931f31bd9bcf7d13f30056 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 8 Jan 2016 12:56:02 +0100 Subject: [PATCH 076/385] docs(homepage): add extra note Closes #5171 --- misc/demo/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/demo/index.html b/misc/demo/index.html index e42c9ca..9142c51 100644 --- a/misc/demo/index.html +++ b/misc/demo/index.html @@ -199,7 +199,7 @@

Reading the documentation

  • - This setting has an angular $watch listener applied to it.
  • B - This setting is a boolean. It doesn't need a parameter.
  • C - This setting can be configured globally in a constant service*.
  • -
  • $ - This setting expects an angular expression instead of a literal string. If the expression support a boolean, you can pass it directly.
  • +
  • $ - This setting expects an angular expression instead of a literal string. If the expression support a boolean / integer, you can pass it directly.
  • readonly - This setting is readonly.
  • From b32003bb8ca058ba93d941f5d7596be77a429d6e Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 8 Jan 2016 17:00:43 +0100 Subject: [PATCH 077/385] docs(buttons): add boolean badge --- src/buttons/docs/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buttons/docs/readme.md b/src/buttons/docs/readme.md index 497d01e..4084598 100644 --- a/src/buttons/docs/readme.md +++ b/src/buttons/docs/readme.md @@ -32,7 +32,7 @@ With the buttons directive, we can make a group of buttons behave like a set of An expression that evaluates to a truthy or falsy value that determines whether the `uncheckable` attribute is present. * `uncheckable` - _(Boolean attribute)_ - + B - Whether a radio button can be unchecked or not. ### Additional settings `uibButtonConfig` From ac32cbb4cfa22aa66eabf9be5598a0fa7d91b423 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 8 Jan 2016 17:06:01 +0100 Subject: [PATCH 078/385] chore: update homepage footer Closes #5176 --- misc/demo/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/demo/index.html b/misc/demo/index.html index 9142c51..0e848b9 100644 --- a/misc/demo/index.html +++ b/misc/demo/index.html @@ -254,7 +254,7 @@

    <%= module.displayName %>