function getProps(opts, name) { const data = {}; const {args = [], props = {}, el} = opts; if (!props) { return data; } for (const key in props) { const prop = hyphenate(key); let value = getData(el, prop); if (!isUndefined(value)) { value = props[key] === Boolean && value === '' ? true : coerce(props[key], value); if (prop === 'target' && (!value || startsWith(value, '_'))) { continue; } data[key] = value; } } const options = parseOptions(getData(el, name), args); for (const key in options) { const prop = camelize(key); if (props[prop] !== undefined) { data[prop] = coerce(props[prop], options[key]); } } return data; }
return toNodes(nodes).sort((a, b) => data(a, sort).localeCompare(data(b, sort)) * (order === 'asc' || -1));
function getFilter(el, attr) { return parseOptions(data(el, attr), ['filter']); }
$$(`[${this.attrItem}],[data-${this.attrItem}]`, this.$el).forEach(el => { const index = data(el, this.attrItem); this.maxIndex && toggleClass(el, 'uk-hidden', isNumeric(index) && (this.sets && !includes(this.sets, toFloat(index)) || index > this.maxIndex)); });
}, { name: 'click', el() { return this.connects; }, delegate() { return `[${this.attrItem}],[data-${this.attrItem}]`; }, handler(e) { e.preventDefault(); this.show(data(e.current, this.attrItem)); } }, { name: 'swipeRight swipeLeft', filter() { return this.swiping; }, el() { return this.connects; }, handler({type}) {
items.push(['href', 'caption', 'type', 'poster', 'alt'].reduce((obj, attr) => { obj[attr === 'href' ? 'source' : attr] = data(el, attr); return obj; }, {}));