@vaadin/component-base
Advanced tools
Comparing version 23.0.0-alpha1 to 23.0.0-alpha2
@@ -7,4 +7,6 @@ export { ActiveMixin } from './src/active-mixin.js'; | ||
export { FocusMixin } from './src/focus-mixin.js'; | ||
export { FocusTrapController } from './src/focus-trap-controller.js'; | ||
export { KeyboardMixin } from './src/keyboard-mixin.js'; | ||
export { SlotController } from './src/slot-controller.js'; | ||
export { SlotMixin } from './src/slot-mixin.js'; | ||
export { TabindexMixin } from './src/tabindex-mixin.js'; |
@@ -7,4 +7,6 @@ export { ActiveMixin } from './src/active-mixin.js'; | ||
export { FocusMixin } from './src/focus-mixin.js'; | ||
export { FocusTrapController } from './src/focus-trap-controller.js'; | ||
export { KeyboardMixin } from './src/keyboard-mixin.js'; | ||
export { SlotController } from './src/slot-controller.js'; | ||
export { SlotMixin } from './src/slot-mixin.js'; | ||
export { TabindexMixin } from './src/tabindex-mixin.js'; |
{ | ||
"name": "@vaadin/component-base", | ||
"version": "23.0.0-alpha1", | ||
"version": "23.0.0-alpha2", | ||
"publishConfig": { | ||
@@ -44,3 +44,3 @@ "access": "public" | ||
}, | ||
"gitHead": "fbcb07328fdf88260e3b461088d207426b21c710" | ||
"gitHead": "070f586dead02ca41b66717820c647f48bf1665f" | ||
} |
@@ -6,3 +6,3 @@ /** | ||
*/ | ||
import { GestureEventListeners } from '@polymer/polymer/lib/mixins/gesture-event-listeners.js'; | ||
import { addListener } from '@vaadin/component-base/src/gestures.js'; | ||
import { DisabledMixin } from './disabled-mixin.js'; | ||
@@ -23,3 +23,3 @@ import { KeyboardMixin } from './keyboard-mixin.js'; | ||
export const ActiveMixin = (superclass) => | ||
class ActiveMixinClass extends DisabledMixin(GestureEventListeners(KeyboardMixin(superclass))) { | ||
class ActiveMixinClass extends DisabledMixin(KeyboardMixin(superclass)) { | ||
/** | ||
@@ -42,3 +42,3 @@ * An array of activation keys. | ||
this._addEventListenerToNode(this, 'down', (event) => { | ||
addListener(this, 'down', (event) => { | ||
if (this._shouldSetActive(event)) { | ||
@@ -49,3 +49,3 @@ this._setActive(true); | ||
this._addEventListenerToNode(this, 'up', () => { | ||
addListener(this, 'up', () => { | ||
this._setActive(false); | ||
@@ -52,0 +52,0 @@ }); |
@@ -26,6 +26,6 @@ /** | ||
let microtaskLastHandle = 0; | ||
let microtaskCallbacks = []; | ||
const microtaskCallbacks = []; | ||
let microtaskNodeContent = 0; | ||
let microtaskScheduled = false; | ||
let microtaskNode = document.createTextNode(''); | ||
const microtaskNode = document.createTextNode(''); | ||
new window.MutationObserver(microtaskFlush).observe(microtaskNode, { characterData: true }); | ||
@@ -37,3 +37,3 @@ | ||
for (let i = 0; i < len; i++) { | ||
let cb = microtaskCallbacks[i]; | ||
const cb = microtaskCallbacks[i]; | ||
if (cb) { | ||
@@ -40,0 +40,0 @@ try { |
@@ -20,2 +20,3 @@ /** | ||
} | ||
/** | ||
@@ -39,2 +40,3 @@ * Sets the scheduler; that is, a module with the Async interface, | ||
} | ||
/** | ||
@@ -55,2 +57,3 @@ * Cancels an active debouncer and returns a reference to itself. | ||
} | ||
/** | ||
@@ -67,2 +70,3 @@ * Cancels a debouncer's async callback. | ||
} | ||
/** | ||
@@ -79,2 +83,3 @@ * Flushes an active debouncer and returns a reference to itself. | ||
} | ||
/** | ||
@@ -88,2 +93,3 @@ * Returns true if the debouncer is active. | ||
} | ||
/** | ||
@@ -144,5 +150,5 @@ * Creates a debouncer if no debouncer is passed as a parameter | ||
*/ | ||
export const enqueueDebouncer = function (debouncer) { | ||
export function enqueueDebouncer(debouncer) { | ||
debouncerQueue.add(debouncer); | ||
}; | ||
} | ||
@@ -154,3 +160,3 @@ /** | ||
*/ | ||
export const flushDebouncers = function () { | ||
export function flushDebouncers() { | ||
const didFlush = Boolean(debouncerQueue.size); | ||
@@ -169,3 +175,3 @@ // If new debouncers are added while flushing, Set.forEach will ensure | ||
return didFlush; | ||
}; | ||
} | ||
@@ -172,0 +178,0 @@ export const flush = () => { |
@@ -60,4 +60,5 @@ /** | ||
return element.scrollWidth - element.clientWidth - scrollLeft; | ||
default: | ||
return scrollLeft; | ||
} | ||
return scrollLeft; | ||
} | ||
@@ -64,0 +65,0 @@ |
@@ -12,3 +12,3 @@ /** | ||
const directionSubscribers = []; | ||
const directionUpdater = function () { | ||
function directionUpdater() { | ||
const documentDir = getDocumentDir(); | ||
@@ -18,3 +18,3 @@ directionSubscribers.forEach((element) => { | ||
}); | ||
}; | ||
} | ||
@@ -26,3 +26,3 @@ let scrollType; | ||
const alignDirs = function (element, documentDir, elementDir = element.getAttribute('dir')) { | ||
function alignDirs(element, documentDir, elementDir = element.getAttribute('dir')) { | ||
if (documentDir) { | ||
@@ -33,7 +33,7 @@ element.setAttribute('dir', documentDir); | ||
} | ||
}; | ||
} | ||
const getDocumentDir = function () { | ||
function getDocumentDir() { | ||
return document.documentElement.getAttribute('dir'); | ||
}; | ||
} | ||
@@ -40,0 +40,0 @@ /** |
@@ -35,3 +35,3 @@ /** | ||
static get version() { | ||
return '23.0.0-alpha1'; | ||
return '23.0.0-alpha2'; | ||
} | ||
@@ -38,0 +38,0 @@ |
@@ -189,2 +189,6 @@ /** | ||
get _virtualStart() { | ||
return this._virtualStartVal || 0; | ||
}, | ||
set _virtualStart(val) { | ||
@@ -198,4 +202,4 @@ val = this._clamp(val, 0, this._maxVirtualStart); | ||
get _virtualStart() { | ||
return this._virtualStartVal || 0; | ||
get _physicalStart() { | ||
return this._physicalStartVal || 0; | ||
}, | ||
@@ -217,6 +221,2 @@ | ||
get _physicalStart() { | ||
return this._physicalStartVal || 0; | ||
}, | ||
/** | ||
@@ -229,2 +229,6 @@ * The k-th tile that is at the bottom of the scrolling list. | ||
get _physicalCount() { | ||
return this._physicalCountVal || 0; | ||
}, | ||
set _physicalCount(val) { | ||
@@ -234,6 +238,2 @@ this._physicalCountVal = val; | ||
get _physicalCount() { | ||
return this._physicalCountVal || 0; | ||
}, | ||
/** | ||
@@ -556,3 +556,5 @@ * An optimal physical size such that we will have enough physical items | ||
_gridChanged: function (newGrid, oldGrid) { | ||
if (typeof oldGrid === 'undefined') return; | ||
if (typeof oldGrid === 'undefined') { | ||
return; | ||
} | ||
this.notifyResize(); | ||
@@ -559,0 +561,0 @@ flush(); |
@@ -40,3 +40,5 @@ /** | ||
if (slotContent instanceof Element) { | ||
slotContent.setAttribute('slot', slotName); | ||
if (slotName !== '') { | ||
slotContent.setAttribute('slot', slotName); | ||
} | ||
this.appendChild(slotContent); | ||
@@ -50,5 +52,11 @@ } | ||
_getDirectSlotChild(slotName) { | ||
return Array.from(this.children).find((el) => el.slot === slotName); | ||
return Array.from(this.childNodes).find((node) => { | ||
// Either an element (any slot) or a text node (only un-named slot). | ||
return ( | ||
(node.nodeType === Node.ELEMENT_NODE && node.slot === slotName) || | ||
(node.nodeType === Node.TEXT_NODE && node.textContent.trim() && slotName === '') | ||
); | ||
}); | ||
} | ||
} | ||
); |
@@ -158,2 +158,6 @@ /** | ||
get size() { | ||
return this.__size; | ||
} | ||
set size(size) { | ||
@@ -208,6 +212,2 @@ if (size === this.size) { | ||
get size() { | ||
return this.__size; | ||
} | ||
/** @private */ | ||
@@ -471,3 +471,2 @@ get _scrollTop() { | ||
this.__skipNextVirtualIndexAdjust = false; | ||
return; | ||
} else if (Math.abs(delta) > 10000) { | ||
@@ -474,0 +473,0 @@ // Process a large scroll position change |
@@ -20,6 +20,6 @@ import { IronListAdapter } from './virtualizer-iron-list-adapter.js'; | ||
* The size of the virtualizer | ||
* @param {number} size The size of the virtualizer | ||
* @return {number | undefined} The size of the virtualizer | ||
*/ | ||
set size(size) { | ||
this.__adapter.size = size; | ||
get size() { | ||
return this.__adapter.size; | ||
} | ||
@@ -29,6 +29,6 @@ | ||
* The size of the virtualizer | ||
* @return {number | undefined} The size of the virtualizer | ||
* @param {number} size The size of the virtualizer | ||
*/ | ||
get size() { | ||
return this.__adapter.size; | ||
set size(size) { | ||
this.__adapter.size = size; | ||
} | ||
@@ -35,0 +35,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
154475
42
4320