Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should set focus value to false when element loses focus', () => {
focus.attached();
setBindedFocusValue(true);
otherElement.focus();
element.dispatchEvent(DOM.createCustomEvent('blur'));
expect(focus.value).toBe(false);
});
function trackRequestStart(client) {
client.isRequesting = !!(++client.activeRequestCount);
if (client.isRequesting) {
let evt = DOM.createCustomEvent('aurelia-fetch-client-request-started', { bubbles: true, cancelable: true });
setTimeout(() => DOM.dispatchEvent(evt), 1);
}
}
function trackRequestEnd(client) {
function trackRequestStart(client: HttpClient) {
client.isRequesting = !!(++client.activeRequestCount);
if (client.isRequesting) {
let evt = DOM.createCustomEvent('aurelia-fetch-client-request-started', { bubbles: true, cancelable: true });
setTimeout(() => DOM.dispatchEvent(evt), 1);
}
}
function trackRequestStart() {
this.isRequesting = !!(++this.activeRequestCount);
if (this.isRequesting) {
let evt = DOM.createCustomEvent('aurelia-fetch-client-request-started', { bubbles: true, cancelable: true });
setTimeout(() => DOM.dispatchEvent(evt), 1);
}
}
function trackRequestEnd(client: HttpClient, processor: RequestMessageProcessor) {
let index = client.pendingRequests.indexOf(processor);
client.pendingRequests.splice(index, 1);
client.isRequesting = client.pendingRequests.length > 0;
if (!client.isRequesting) {
let evt = DOM.createCustomEvent('aurelia-http-client-requests-drained', { bubbles: true, cancelable: true });
setTimeout(() => DOM.dispatchEvent(evt), 1);
}
}
function trackRequestEnd(client: HttpClient, processor: RequestMessageProcessor) {
let index = client.pendingRequests.indexOf(processor);
client.pendingRequests.splice(index, 1);
client.isRequesting = client.pendingRequests.length > 0;
if (!client.isRequesting) {
let evt = DOM.createCustomEvent('aurelia-http-client-requests-drained', { bubbles: true, cancelable: true });
setTimeout(() => DOM.dispatchEvent(evt), 1);
}
}
UxChipInput.prototype.attached = function () {
var _this = this;
var blurEvent = DOM.createCustomEvent('blur', { bubbles: true });
this.textbox.addEventListener('focus', function () {
_this.element.classList.add('focused');
});
this.textbox.addEventListener('blur', function () {
_this.addChip();
_this.element.classList.remove('focused');
_this.element.dispatchEvent(blurEvent);
});
};
UxChipInput.prototype.detached = function () {
UxChipInput.prototype.attached = function () {
var _this = this;
var blurEvent = DOM.createCustomEvent('blur', { bubbles: true });
this.textbox.addEventListener('focus', function () {
_this.element.classList.add('ux-chip-input--focused');
});
this.textbox.addEventListener('blur', function () {
_this.addChip();
_this.element.classList.remove('ux-chip-input--focused');
_this.element.dispatchEvent(blurEvent);
});
};
UxChipInput.prototype.detached = function () {
UxChipInput.prototype.attached = function () {
var _this = this;
var blurEvent = DOM.createCustomEvent('blur', { bubbles: true });
this.textbox.addEventListener('focus', function () {
_this.element.classList.add('ux-chip-input--focused');
});
this.textbox.addEventListener('blur', function () {
_this.addChip();
_this.element.classList.remove('ux-chip-input--focused');
_this.element.dispatchEvent(blurEvent);
});
};
UxChipInput.prototype.detached = function () {
public setChecked(value: any) {
const oldValue = this.checked;
const newValue = !!value;
if (newValue !== oldValue) {
this.checked = newValue;
this.ignoreValueChanges = true;
this.value = newValue;
this.ignoreValueChanges = false;
this.element.dispatchEvent(DOM.createCustomEvent('change', { bubbles: true }));
}
}