1document.addEventListener('alpine:init', () => { 2 Alpine.data( 3 'XCard', 4 (props = {}) => ({ 5 disabled: false, 6 focusRing: true, 7 interactive: false, 8 loading: false, 9 ripple: true, 10 ...props, 11 12 get isDisabled() { 13 return this.loading || this.disabled; 14 }, 15 16 get isInteractive() { 17 return (this.interactive || this.isLink) && !this.isDisabled; 18 }, 19 20 get isLink() { 21 return ( 22 this.$root.tagName.toLowerCase() === 'a' || 23 this.$root.hasAttribute('href') 24 ); 25 }, 26 27 xCardBind: { 28 ['x-focus-ring']() { 29 return this.isInteractive && this.focusRing ? this.focusRing : false; 30 }, 31 32 ['x-ripple']() { 33 return this.isInteractive && this.ripple ? this.ripple : false; 34 }, 35 36 'x-scope': 'XCard', 37 38 [':class']() { 39 return { 40 'x-card--disabled': this.disabled, 41 'x-card--interactive': this.isInteractive, 42 'x-card--loading': this.loading, 43 }; 44 }, 45 46 ':tabindex'() { 47 return this.isLink && this.loading ? -1 : null; 48 }, 49 }, 50 }), 51 ); 52});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.