|
1 | 1 | import { DOM } from 'aurelia-pal';
|
2 |
| -import { AccessMember, AccessScope, AccessKeyed, BindingBehavior, ValueConverter, getContextFor, Parser, bindingMode, LiteralString, Binary, Conditional, LiteralPrimitive, CallMember } from 'aurelia-binding'; |
| 2 | +import { AccessMember, AccessScope, AccessKeyed, BindingBehavior, ValueConverter, getContextFor, Parser, bindingBehavior, bindingMode, LiteralString, Binary, Conditional, LiteralPrimitive, CallMember } from 'aurelia-binding'; |
3 | 3 | import { Optional, Lazy } from 'aurelia-dependency-injection';
|
4 | 4 | import { TaskQueue } from 'aurelia-task-queue';
|
5 | 5 | import { customAttribute, bindable, BindingLanguage, ViewResources } from 'aurelia-templating';
|
@@ -111,6 +111,28 @@ function getAccessorExpression(fn) {
|
111 | 111 | return match[1];
|
112 | 112 | }
|
113 | 113 |
|
| 114 | +/*! ***************************************************************************** |
| 115 | +Copyright (c) Microsoft Corporation. All rights reserved. |
| 116 | +Licensed under the Apache License, Version 2.0 (the "License"); you may not use |
| 117 | +this file except in compliance with the License. You may obtain a copy of the |
| 118 | +License at http://www.apache.org/licenses/LICENSE-2.0 |
| 119 | +
|
| 120 | +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 121 | +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED |
| 122 | +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, |
| 123 | +MERCHANTABLITY OR NON-INFRINGEMENT. |
| 124 | +
|
| 125 | +See the Apache Version 2.0 License for specific language governing permissions |
| 126 | +and limitations under the License. |
| 127 | +***************************************************************************** */ |
| 128 | + |
| 129 | +function __decorate(decorators, target, key, desc) { |
| 130 | + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
| 131 | + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); |
| 132 | + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; |
| 133 | + return c > 3 && r && Object.defineProperty(target, key, r), r; |
| 134 | +} |
| 135 | + |
114 | 136 | /**
|
115 | 137 | * Validation triggers.
|
116 | 138 | */
|
@@ -669,55 +691,70 @@ class ValidateBindingBehaviorBase {
|
669 | 691 | * when the validate trigger specified by the associated controller's
|
670 | 692 | * validateTrigger property occurs.
|
671 | 693 | */
|
672 |
| -class ValidateBindingBehavior extends ValidateBindingBehaviorBase { |
| 694 | +let ValidateBindingBehavior = class ValidateBindingBehavior extends ValidateBindingBehaviorBase { |
673 | 695 | getValidateTrigger(controller) {
|
674 | 696 | return controller.validateTrigger;
|
675 | 697 | }
|
676 |
| -} |
| 698 | +}; |
677 | 699 | ValidateBindingBehavior.inject = [TaskQueue];
|
| 700 | +ValidateBindingBehavior = __decorate([ |
| 701 | + bindingBehavior('validate') |
| 702 | +], ValidateBindingBehavior); |
678 | 703 | /**
|
679 | 704 | * Binding behavior. Indicates the bound property will be validated
|
680 | 705 | * manually, by calling controller.validate(). No automatic validation
|
681 | 706 | * triggered by data-entry or blur will occur.
|
682 | 707 | */
|
683 |
| -class ValidateManuallyBindingBehavior extends ValidateBindingBehaviorBase { |
| 708 | +let ValidateManuallyBindingBehavior = class ValidateManuallyBindingBehavior extends ValidateBindingBehaviorBase { |
684 | 709 | getValidateTrigger() {
|
685 | 710 | return validateTrigger.manual;
|
686 | 711 | }
|
687 |
| -} |
| 712 | +}; |
688 | 713 | ValidateManuallyBindingBehavior.inject = [TaskQueue];
|
| 714 | +ValidateManuallyBindingBehavior = __decorate([ |
| 715 | + bindingBehavior('validateManually') |
| 716 | +], ValidateManuallyBindingBehavior); |
689 | 717 | /**
|
690 | 718 | * Binding behavior. Indicates the bound property should be validated
|
691 | 719 | * when the associated element blurs.
|
692 | 720 | */
|
693 |
| -class ValidateOnBlurBindingBehavior extends ValidateBindingBehaviorBase { |
| 721 | +let ValidateOnBlurBindingBehavior = class ValidateOnBlurBindingBehavior extends ValidateBindingBehaviorBase { |
694 | 722 | getValidateTrigger() {
|
695 | 723 | return validateTrigger.blur;
|
696 | 724 | }
|
697 |
| -} |
| 725 | +}; |
698 | 726 | ValidateOnBlurBindingBehavior.inject = [TaskQueue];
|
| 727 | +ValidateOnBlurBindingBehavior = __decorate([ |
| 728 | + bindingBehavior('validateOnBlur') |
| 729 | +], ValidateOnBlurBindingBehavior); |
699 | 730 | /**
|
700 | 731 | * Binding behavior. Indicates the bound property should be validated
|
701 | 732 | * when the associated element is changed by the user, causing a change
|
702 | 733 | * to the model.
|
703 | 734 | */
|
704 |
| -class ValidateOnChangeBindingBehavior extends ValidateBindingBehaviorBase { |
| 735 | +let ValidateOnChangeBindingBehavior = class ValidateOnChangeBindingBehavior extends ValidateBindingBehaviorBase { |
705 | 736 | getValidateTrigger() {
|
706 | 737 | return validateTrigger.change;
|
707 | 738 | }
|
708 |
| -} |
| 739 | +}; |
709 | 740 | ValidateOnChangeBindingBehavior.inject = [TaskQueue];
|
| 741 | +ValidateOnChangeBindingBehavior = __decorate([ |
| 742 | + bindingBehavior('validateOnChange') |
| 743 | +], ValidateOnChangeBindingBehavior); |
710 | 744 | /**
|
711 | 745 | * Binding behavior. Indicates the bound property should be validated
|
712 | 746 | * when the associated element blurs or is changed by the user, causing
|
713 | 747 | * a change to the model.
|
714 | 748 | */
|
715 |
| -class ValidateOnChangeOrBlurBindingBehavior extends ValidateBindingBehaviorBase { |
| 749 | +let ValidateOnChangeOrBlurBindingBehavior = class ValidateOnChangeOrBlurBindingBehavior extends ValidateBindingBehaviorBase { |
716 | 750 | getValidateTrigger() {
|
717 | 751 | return validateTrigger.changeOrBlur;
|
718 | 752 | }
|
719 |
| -} |
720 |
| -ValidateOnChangeOrBlurBindingBehavior.inject = [TaskQueue]; |
| 753 | +}; |
| 754 | +ValidateOnChangeOrBlurBindingBehavior.inject = [TaskQueue]; |
| 755 | +ValidateOnChangeOrBlurBindingBehavior = __decorate([ |
| 756 | + bindingBehavior('validateOnChangeOrBlur') |
| 757 | +], ValidateOnChangeOrBlurBindingBehavior); |
721 | 758 |
|
722 | 759 | /**
|
723 | 760 | * Creates ValidationController instances.
|
@@ -751,28 +788,6 @@ class ValidationControllerFactory {
|
751 | 788 | }
|
752 | 789 | ValidationControllerFactory['protocol:aurelia:resolver'] = true;
|
753 | 790 |
|
754 |
| -/*! ***************************************************************************** |
755 |
| -Copyright (c) Microsoft Corporation. All rights reserved. |
756 |
| -Licensed under the Apache License, Version 2.0 (the "License"); you may not use |
757 |
| -this file except in compliance with the License. You may obtain a copy of the |
758 |
| -License at http://www.apache.org/licenses/LICENSE-2.0 |
759 |
| -
|
760 |
| -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
761 |
| -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED |
762 |
| -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, |
763 |
| -MERCHANTABLITY OR NON-INFRINGEMENT. |
764 |
| -
|
765 |
| -See the Apache Version 2.0 License for specific language governing permissions |
766 |
| -and limitations under the License. |
767 |
| -***************************************************************************** */ |
768 |
| - |
769 |
| -function __decorate(decorators, target, key, desc) { |
770 |
| - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
771 |
| - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); |
772 |
| - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; |
773 |
| - return c > 3 && r && Object.defineProperty(target, key, r), r; |
774 |
| -} |
775 |
| - |
776 | 791 | let ValidationErrorsCustomAttribute = class ValidationErrorsCustomAttribute {
|
777 | 792 | constructor(boundaryElement, controllerAccessor) {
|
778 | 793 | this.boundaryElement = boundaryElement;
|
|
0 commit comments