拿掉 build files

This commit is contained in:
2022-07-18 16:33:23 +08:00
parent 41e2287bcb
commit 3707f158a3
31953 changed files with 0 additions and 4411796 deletions
-192
View File
@@ -1,192 +0,0 @@
// Mixins
import Delayable from '../delayable';
import Toggleable from '../toggleable'; // Utilities
import mixins from '../../util/mixins';
import { getSlot, getSlotType } from '../../util/helpers';
import { consoleError } from '../../util/console';
const baseMixins = mixins(Delayable, Toggleable);
/* @vue/component */
export default baseMixins.extend({
name: 'activatable',
props: {
activator: {
default: null,
validator: val => {
return ['string', 'object'].includes(typeof val);
}
},
disabled: Boolean,
internalActivator: Boolean,
openOnHover: Boolean,
openOnFocus: Boolean
},
data: () => ({
// Do not use this directly, call getActivator() instead
activatorElement: null,
activatorNode: [],
events: ['click', 'mouseenter', 'mouseleave', 'focus'],
listeners: {}
}),
watch: {
activator: 'resetActivator',
openOnFocus: 'resetActivator',
openOnHover: 'resetActivator'
},
mounted() {
const slotType = getSlotType(this, 'activator', true);
if (slotType && ['v-slot', 'normal'].includes(slotType)) {
consoleError(`The activator slot must be bound, try '<template v-slot:activator="{ on }"><v-btn v-on="on">'`, this);
}
this.addActivatorEvents();
},
beforeDestroy() {
this.removeActivatorEvents();
},
methods: {
addActivatorEvents() {
if (!this.activator || this.disabled || !this.getActivator()) return;
this.listeners = this.genActivatorListeners();
const keys = Object.keys(this.listeners);
for (const key of keys) {
this.getActivator().addEventListener(key, this.listeners[key]);
}
},
genActivator() {
const node = getSlot(this, 'activator', Object.assign(this.getValueProxy(), {
on: this.genActivatorListeners(),
attrs: this.genActivatorAttributes()
})) || [];
this.activatorNode = node;
return node;
},
genActivatorAttributes() {
return {
role: 'button',
'aria-haspopup': true,
'aria-expanded': String(this.isActive)
};
},
genActivatorListeners() {
if (this.disabled) return {};
const listeners = {};
if (this.openOnHover) {
listeners.mouseenter = e => {
this.getActivator(e);
this.runDelay('open');
};
listeners.mouseleave = e => {
this.getActivator(e);
this.runDelay('close');
};
} else {
listeners.click = e => {
const activator = this.getActivator(e);
if (activator) activator.focus();
e.stopPropagation();
this.isActive = !this.isActive;
};
}
if (this.openOnFocus) {
listeners.focus = e => {
this.getActivator(e);
e.stopPropagation();
this.isActive = !this.isActive;
};
}
return listeners;
},
getActivator(e) {
// If we've already fetched the activator, re-use
if (this.activatorElement) return this.activatorElement;
let activator = null;
if (this.activator) {
const target = this.internalActivator ? this.$el : document;
if (typeof this.activator === 'string') {
// Selector
activator = target.querySelector(this.activator);
} else if (this.activator.$el) {
// Component (ref)
activator = this.activator.$el;
} else {
// HTMLElement | Element
activator = this.activator;
}
} else if (this.activatorNode.length === 1 || this.activatorNode.length && !e) {
// Use the contents of the activator slot
// There's either only one element in it or we
// don't have a click event to use as a last resort
const vm = this.activatorNode[0].componentInstance;
if (vm && vm.$options.mixins && // Activatable is indirectly used via Menuable
vm.$options.mixins.some(m => m.options && ['activatable', 'menuable'].includes(m.options.name))) {
// Activator is actually another activatible component, use its activator (#8846)
activator = vm.getActivator();
} else {
activator = this.activatorNode[0].elm;
}
} else if (e) {
// Activated by a click or focus event
activator = e.currentTarget || e.target;
}
this.activatorElement = activator;
return this.activatorElement;
},
getContentSlot() {
return getSlot(this, 'default', this.getValueProxy(), true);
},
getValueProxy() {
const self = this;
return {
get value() {
return self.isActive;
},
set value(isActive) {
self.isActive = isActive;
}
};
},
removeActivatorEvents() {
if (!this.activator || !this.activatorElement) return;
const keys = Object.keys(this.listeners);
for (const key of keys) {
this.activatorElement.removeEventListener(key, this.listeners[key]);
}
this.listeners = {};
},
resetActivator() {
this.removeActivatorEvents();
this.activatorElement = null;
this.getActivator();
this.addActivatorEvents();
}
}
});
//# sourceMappingURL=index.js.map
File diff suppressed because one or more lines are too long
-69
View File
@@ -1,69 +0,0 @@
import { factory as PositionableFactory } from '../positionable'; // Util
import mixins from '../../util/mixins';
export default function applicationable(value, events = []) {
/* @vue/component */
return mixins(PositionableFactory(['absolute', 'fixed'])).extend({
name: 'applicationable',
props: {
app: Boolean
},
computed: {
applicationProperty() {
return value;
}
},
watch: {
// If previous value was app
// reset the provided prop
app(x, prev) {
prev ? this.removeApplication(true) : this.callUpdate();
},
applicationProperty(newVal, oldVal) {
this.$vuetify.application.unregister(this._uid, oldVal);
}
},
activated() {
this.callUpdate();
},
created() {
for (let i = 0, length = events.length; i < length; i++) {
this.$watch(events[i], this.callUpdate);
}
this.callUpdate();
},
mounted() {
this.callUpdate();
},
deactivated() {
this.removeApplication();
},
destroyed() {
this.removeApplication();
},
methods: {
callUpdate() {
if (!this.app) return;
this.$vuetify.application.register(this._uid, this.applicationProperty, this.updateApplication());
},
removeApplication(force = false) {
if (!force && !this.app) return;
this.$vuetify.application.unregister(this._uid, this.applicationProperty);
},
updateApplication: () => 0
}
});
}
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/applicationable/index.ts"],"names":[],"mappings":"AAAA,SAAS,OAAO,IAAI,mBAApB,QAA+C,iBAA/C,C,CAGA;;AACA,OAAO,MAAP,MAAmB,mBAAnB;AAEA,eAAc,SAAU,eAAV,CAA2B,KAA3B,EAA8C,MAAA,GAAmB,EAAjE,EAAmE;AAC/E;AACA,SAAO,MAAM,CAAC,mBAAmB,CAAC,CAAC,UAAD,EAAa,OAAb,CAAD,CAApB,CAAN,CAAmD,MAAnD,CAA0D;AAC/D,IAAA,IAAI,EAAE,iBADyD;AAG/D,IAAA,KAAK,EAAE;AACL,MAAA,GAAG,EAAE;AADA,KAHwD;AAO/D,IAAA,QAAQ,EAAE;AACR,MAAA,mBAAmB,GAAA;AACjB,eAAO,KAAP;AACD;;AAHO,KAPqD;AAa/D,IAAA,KAAK,EAAE;AACL;AACA;AACA,MAAA,GAAG,CAAE,CAAF,EAAc,IAAd,EAA2B;AAC5B,QAAA,IAAI,GACA,KAAK,iBAAL,CAAuB,IAAvB,CADA,GAEA,KAAK,UAAL,EAFJ;AAGD,OAPI;;AAQL,MAAA,mBAAmB,CAAE,MAAF,EAAU,MAAV,EAAgB;AACjC,aAAK,QAAL,CAAc,WAAd,CAA0B,UAA1B,CAAqC,KAAK,IAA1C,EAAgD,MAAhD;AACD;;AAVI,KAbwD;;AA0B/D,IAAA,SAAS,GAAA;AACP,WAAK,UAAL;AACD,KA5B8D;;AA8B/D,IAAA,OAAO,GAAA;AACL,WAAK,IAAI,CAAC,GAAG,CAAR,EAAW,MAAM,GAAG,MAAM,CAAC,MAAhC,EAAwC,CAAC,GAAG,MAA5C,EAAoD,CAAC,EAArD,EAAyD;AACvD,aAAK,MAAL,CAAY,MAAM,CAAC,CAAD,CAAlB,EAAuB,KAAK,UAA5B;AACD;;AACD,WAAK,UAAL;AACD,KAnC8D;;AAqC/D,IAAA,OAAO,GAAA;AACL,WAAK,UAAL;AACD,KAvC8D;;AAyC/D,IAAA,WAAW,GAAA;AACT,WAAK,iBAAL;AACD,KA3C8D;;AA6C/D,IAAA,SAAS,GAAA;AACP,WAAK,iBAAL;AACD,KA/C8D;;AAiD/D,IAAA,OAAO,EAAE;AACP,MAAA,UAAU,GAAA;AACR,YAAI,CAAC,KAAK,GAAV,EAAe;AAEf,aAAK,QAAL,CAAc,WAAd,CAA0B,QAA1B,CACE,KAAK,IADP,EAEE,KAAK,mBAFP,EAGE,KAAK,iBAAL,EAHF;AAKD,OATM;;AAUP,MAAA,iBAAiB,CAAE,KAAK,GAAG,KAAV,EAAe;AAC9B,YAAI,CAAC,KAAD,IAAU,CAAC,KAAK,GAApB,EAAyB;AAEzB,aAAK,QAAL,CAAc,WAAd,CAA0B,UAA1B,CACE,KAAK,IADP,EAEE,KAAK,mBAFP;AAID,OAjBM;;AAkBP,MAAA,iBAAiB,EAAE,MAAM;AAlBlB;AAjDsD,GAA1D,CAAP;AAsED","sourcesContent":["import { factory as PositionableFactory } from '../positionable'\nimport { TargetProp } from 'vuetify/types/services/application'\n\n// Util\nimport mixins from '../../util/mixins'\n\nexport default function applicationable (value: TargetProp, events: string[] = []) {\n /* @vue/component */\n return mixins(PositionableFactory(['absolute', 'fixed'])).extend({\n name: 'applicationable',\n\n props: {\n app: Boolean,\n },\n\n computed: {\n applicationProperty (): TargetProp {\n return value\n },\n },\n\n watch: {\n // If previous value was app\n // reset the provided prop\n app (x: boolean, prev: boolean) {\n prev\n ? this.removeApplication(true)\n : this.callUpdate()\n },\n applicationProperty (newVal, oldVal) {\n this.$vuetify.application.unregister(this._uid, oldVal)\n },\n },\n\n activated () {\n this.callUpdate()\n },\n\n created () {\n for (let i = 0, length = events.length; i < length; i++) {\n this.$watch(events[i], this.callUpdate)\n }\n this.callUpdate()\n },\n\n mounted () {\n this.callUpdate()\n },\n\n deactivated () {\n this.removeApplication()\n },\n\n destroyed () {\n this.removeApplication()\n },\n\n methods: {\n callUpdate () {\n if (!this.app) return\n\n this.$vuetify.application.register(\n this._uid,\n this.applicationProperty,\n this.updateApplication()\n )\n },\n removeApplication (force = false) {\n if (!force && !this.app) return\n\n this.$vuetify.application.unregister(\n this._uid,\n this.applicationProperty\n )\n },\n updateApplication: () => 0,\n },\n })\n}\n"],"sourceRoot":"","file":"index.js"}
-39
View File
@@ -1,39 +0,0 @@
import Vue from 'vue';
/**
* This mixin provides `attrs$` and `listeners$` to work around
* vue bug https://github.com/vuejs/vue/issues/10115
*/
function makeWatcher(property) {
return function (val, oldVal) {
for (const attr in oldVal) {
if (!Object.prototype.hasOwnProperty.call(val, attr)) {
this.$delete(this.$data[property], attr);
}
}
for (const attr in val) {
this.$set(this.$data[property], attr, val[attr]);
}
};
}
export default Vue.extend({
data: () => ({
attrs$: {},
listeners$: {}
}),
created() {
// Work around unwanted re-renders: https://github.com/vuejs/vue/issues/10115
// Make sure to use `attrs$` instead of `$attrs` (confusing right?)
this.$watch('$attrs', makeWatcher('attrs$'), {
immediate: true
});
this.$watch('$listeners', makeWatcher('listeners$'), {
immediate: true
});
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/binds-attrs/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAkC,KAAlC;AAEA;;;;;AAKA,SAAS,WAAT,CAAsB,QAAtB,EAAsC;AACpC,SAAO,UAAqB,GAArB,EAA0B,MAA1B,EAAgC;AACrC,SAAK,MAAM,IAAX,IAAmB,MAAnB,EAA2B;AACzB,UAAI,CAAC,MAAM,CAAC,SAAP,CAAiB,cAAjB,CAAgC,IAAhC,CAAqC,GAArC,EAA0C,IAA1C,CAAL,EAAsD;AACpD,aAAK,OAAL,CAAa,KAAK,KAAL,CAAW,QAAX,CAAb,EAAmC,IAAnC;AACD;AACF;;AACD,SAAK,MAAM,IAAX,IAAmB,GAAnB,EAAwB;AACtB,WAAK,IAAL,CAAU,KAAK,KAAL,CAAW,QAAX,CAAV,EAAgC,IAAhC,EAAsC,GAAG,CAAC,IAAD,CAAzC;AACD;AACF,GATD;AAUD;;AAED,eAAe,GAAG,CAAC,MAAJ,CAAW;AACxB,EAAA,IAAI,EAAE,OAAO;AACX,IAAA,MAAM,EAAE,EADG;AAEX,IAAA,UAAU,EAAE;AAFD,GAAP,CADkB;;AAMxB,EAAA,OAAO,GAAA;AACL;AACA;AACA,SAAK,MAAL,CAAY,QAAZ,EAAsB,WAAW,CAAC,QAAD,CAAjC,EAA6C;AAAE,MAAA,SAAS,EAAE;AAAb,KAA7C;AACA,SAAK,MAAL,CAAY,YAAZ,EAA0B,WAAW,CAAC,YAAD,CAArC,EAAqD;AAAE,MAAA,SAAS,EAAE;AAAb,KAArD;AACD;;AAXuB,CAAX,CAAf","sourcesContent":["import Vue, { WatchHandler } from 'vue'\n\n/**\n * This mixin provides `attrs$` and `listeners$` to work around\n * vue bug https://github.com/vuejs/vue/issues/10115\n */\n\nfunction makeWatcher (property: string): ThisType<Vue> & WatchHandler<any> {\n return function (this: Vue, val, oldVal) {\n for (const attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr)\n }\n }\n for (const attr in val) {\n this.$set(this.$data[property], attr, val[attr])\n }\n }\n}\n\nexport default Vue.extend({\n data: () => ({\n attrs$: {} as Dictionary<string>,\n listeners$: {} as Dictionary<Function | Function[]>,\n }),\n\n created () {\n // Work around unwanted re-renders: https://github.com/vuejs/vue/issues/10115\n // Make sure to use `attrs$` instead of `$attrs` (confusing right?)\n this.$watch('$attrs', makeWatcher('attrs$'), { immediate: true })\n this.$watch('$listeners', makeWatcher('listeners$'), { immediate: true })\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-51
View File
@@ -1,51 +0,0 @@
// Utilities
import { removed } from '../../util/console'; // Types
import Vue from 'vue';
/**
* Bootable
* @mixin
*
* Used to add lazy content functionality to components
* Looks for change in "isActive" to automatically boot
* Otherwise can be set manually
*/
/* @vue/component */
export default Vue.extend().extend({
name: 'bootable',
props: {
eager: Boolean
},
data: () => ({
isBooted: false
}),
computed: {
hasContent() {
return this.isBooted || this.eager || this.isActive;
}
},
watch: {
isActive() {
this.isBooted = true;
}
},
created() {
/* istanbul ignore next */
if ('lazy' in this.$attrs) {
removed('lazy', this);
}
},
methods: {
showLazyContent(content) {
return this.hasContent && content ? content() : [this.$createElement()];
}
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/bootable/index.ts"],"names":[],"mappings":"AAAA;AACA,SAAS,OAAT,QAAwB,oBAAxB,C,CAEA;;AACA,OAAO,GAAP,MAA2B,KAA3B;AAKA;;;;;;;;;AAQA;;AACA,eAAe,GAAG,CAAC,MAAJ,GAA+B,MAA/B,CAAsC;AACnD,EAAA,IAAI,EAAE,UAD6C;AAGnD,EAAA,KAAK,EAAE;AACL,IAAA,KAAK,EAAE;AADF,GAH4C;AAOnD,EAAA,IAAI,EAAE,OAAO;AACX,IAAA,QAAQ,EAAE;AADC,GAAP,CAP6C;AAWnD,EAAA,QAAQ,EAAE;AACR,IAAA,UAAU,GAAA;AACR,aAAO,KAAK,QAAL,IAAiB,KAAK,KAAtB,IAA+B,KAAK,QAA3C;AACD;;AAHO,GAXyC;AAiBnD,EAAA,KAAK,EAAE;AACL,IAAA,QAAQ,GAAA;AACN,WAAK,QAAL,GAAgB,IAAhB;AACD;;AAHI,GAjB4C;;AAuBnD,EAAA,OAAO,GAAA;AACL;AACA,QAAI,UAAU,KAAK,MAAnB,EAA2B;AACzB,MAAA,OAAO,CAAC,MAAD,EAAS,IAAT,CAAP;AACD;AACF,GA5BkD;;AA8BnD,EAAA,OAAO,EAAE;AACP,IAAA,eAAe,CAAE,OAAF,EAAyB;AACtC,aAAQ,KAAK,UAAL,IAAmB,OAApB,GAA+B,OAAO,EAAtC,GAA2C,CAAC,KAAK,cAAL,EAAD,CAAlD;AACD;;AAHM;AA9B0C,CAAtC,CAAf","sourcesContent":["// Utilities\nimport { removed } from '../../util/console'\n\n// Types\nimport Vue, { VNode } from 'vue'\ninterface Toggleable extends Vue {\n isActive?: boolean\n}\n\n/**\n * Bootable\n * @mixin\n *\n * Used to add lazy content functionality to components\n * Looks for change in \"isActive\" to automatically boot\n * Otherwise can be set manually\n */\n/* @vue/component */\nexport default Vue.extend<Vue & Toggleable>().extend({\n name: 'bootable',\n\n props: {\n eager: Boolean,\n },\n\n data: () => ({\n isBooted: false,\n }),\n\n computed: {\n hasContent (): boolean | undefined {\n return this.isBooted || this.eager || this.isActive\n },\n },\n\n watch: {\n isActive () {\n this.isBooted = true\n },\n },\n\n created () {\n /* istanbul ignore next */\n if ('lazy' in this.$attrs) {\n removed('lazy', this)\n }\n },\n\n methods: {\n showLazyContent (content?: () => VNode[]): VNode[] {\n return (this.hasContent && content) ? content() : [this.$createElement()]\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-25
View File
@@ -1,25 +0,0 @@
// Extensions
import { BaseItemGroup } from '../../components/VItemGroup/VItemGroup';
/* @vue/component */
export default BaseItemGroup.extend({
name: 'button-group',
provide() {
return {
btnToggle: this
};
},
computed: {
classes() {
return BaseItemGroup.options.computed.classes.call(this);
}
},
methods: {
// Isn't being passed down through types
genData: BaseItemGroup.options.methods.genData
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/button-group/index.ts"],"names":[],"mappings":"AAAA;AACA,SAAS,aAAT,QAA8B,wCAA9B;AAEA;;AACA,eAAe,aAAa,CAAC,MAAd,CAAqB;AAClC,EAAA,IAAI,EAAE,cAD4B;;AAGlC,EAAA,OAAO,GAAA;AACL,WAAO;AACL,MAAA,SAAS,EAAE;AADN,KAAP;AAGD,GAPiC;;AASlC,EAAA,QAAQ,EAAE;AACR,IAAA,OAAO,GAAA;AACL,aAAO,aAAa,CAAC,OAAd,CAAsB,QAAtB,CAA+B,OAA/B,CAAuC,IAAvC,CAA4C,IAA5C,CAAP;AACD;;AAHO,GATwB;AAelC,EAAA,OAAO,EAAE;AACP;AACA,IAAA,OAAO,EAAE,aAAa,CAAC,OAAd,CAAsB,OAAtB,CAA8B;AAFhC;AAfyB,CAArB,CAAf","sourcesContent":["// Extensions\nimport { BaseItemGroup } from '../../components/VItemGroup/VItemGroup'\n\n/* @vue/component */\nexport default BaseItemGroup.extend({\n name: 'button-group',\n\n provide (): object {\n return {\n btnToggle: this,\n }\n },\n\n computed: {\n classes (): object {\n return BaseItemGroup.options.computed.classes.call(this)\n },\n },\n\n methods: {\n // Isn't being passed down through types\n genData: BaseItemGroup.options.methods.genData,\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-75
View File
@@ -1,75 +0,0 @@
import Vue from 'vue';
import { consoleError } from '../../util/console';
import { isCssColor } from '../../util/colorUtils';
export default Vue.extend({
name: 'colorable',
props: {
color: String
},
methods: {
setBackgroundColor(color, data = {}) {
if (typeof data.style === 'string') {
// istanbul ignore next
consoleError('style must be an object', this); // istanbul ignore next
return data;
}
if (typeof data.class === 'string') {
// istanbul ignore next
consoleError('class must be an object', this); // istanbul ignore next
return data;
}
if (isCssColor(color)) {
data.style = { ...data.style,
'background-color': `${color}`,
'border-color': `${color}`
};
} else if (color) {
data.class = { ...data.class,
[color]: true
};
}
return data;
},
setTextColor(color, data = {}) {
if (typeof data.style === 'string') {
// istanbul ignore next
consoleError('style must be an object', this); // istanbul ignore next
return data;
}
if (typeof data.class === 'string') {
// istanbul ignore next
consoleError('class must be an object', this); // istanbul ignore next
return data;
}
if (isCssColor(color)) {
data.style = { ...data.style,
color: `${color}`,
'caret-color': `${color}`
};
} else if (color) {
const [colorName, colorModifier] = color.toString().trim().split(' ', 2);
data.class = { ...data.class,
[colorName + '--text']: true
};
if (colorModifier) {
data.class['text--' + colorModifier] = true;
}
}
return data;
}
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/colorable/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAgB,KAAhB;AAEA,SAAS,YAAT,QAA6B,oBAA7B;AACA,SAAS,UAAT,QAA2B,uBAA3B;AAEA,eAAe,GAAG,CAAC,MAAJ,CAAW;AACxB,EAAA,IAAI,EAAE,WADkB;AAGxB,EAAA,KAAK,EAAE;AACL,IAAA,KAAK,EAAE;AADF,GAHiB;AAOxB,EAAA,OAAO,EAAE;AACP,IAAA,kBAAkB,CAAE,KAAF,EAA0B,IAAA,GAAkB,EAA5C,EAA8C;AAC9D,UAAI,OAAO,IAAI,CAAC,KAAZ,KAAsB,QAA1B,EAAoC;AAClC;AACA,QAAA,YAAY,CAAC,yBAAD,EAA4B,IAA5B,CAAZ,CAFkC,CAGlC;;AACA,eAAO,IAAP;AACD;;AACD,UAAI,OAAO,IAAI,CAAC,KAAZ,KAAsB,QAA1B,EAAoC;AAClC;AACA,QAAA,YAAY,CAAC,yBAAD,EAA4B,IAA5B,CAAZ,CAFkC,CAGlC;;AACA,eAAO,IAAP;AACD;;AACD,UAAI,UAAU,CAAC,KAAD,CAAd,EAAuB;AACrB,QAAA,IAAI,CAAC,KAAL,GAAa,EACX,GAAG,IAAI,CAAC,KADG;AAEX,8BAAoB,GAAG,KAAK,EAFjB;AAGX,0BAAgB,GAAG,KAAK;AAHb,SAAb;AAKD,OAND,MAMO,IAAI,KAAJ,EAAW;AAChB,QAAA,IAAI,CAAC,KAAL,GAAa,EACX,GAAG,IAAI,CAAC,KADG;AAEX,WAAC,KAAD,GAAS;AAFE,SAAb;AAID;;AAED,aAAO,IAAP;AACD,KA5BM;;AA8BP,IAAA,YAAY,CAAE,KAAF,EAA0B,IAAA,GAAkB,EAA5C,EAA8C;AACxD,UAAI,OAAO,IAAI,CAAC,KAAZ,KAAsB,QAA1B,EAAoC;AAClC;AACA,QAAA,YAAY,CAAC,yBAAD,EAA4B,IAA5B,CAAZ,CAFkC,CAGlC;;AACA,eAAO,IAAP;AACD;;AACD,UAAI,OAAO,IAAI,CAAC,KAAZ,KAAsB,QAA1B,EAAoC;AAClC;AACA,QAAA,YAAY,CAAC,yBAAD,EAA4B,IAA5B,CAAZ,CAFkC,CAGlC;;AACA,eAAO,IAAP;AACD;;AACD,UAAI,UAAU,CAAC,KAAD,CAAd,EAAuB;AACrB,QAAA,IAAI,CAAC,KAAL,GAAa,EACX,GAAG,IAAI,CAAC,KADG;AAEX,UAAA,KAAK,EAAE,GAAG,KAAK,EAFJ;AAGX,yBAAe,GAAG,KAAK;AAHZ,SAAb;AAKD,OAND,MAMO,IAAI,KAAJ,EAAW;AAChB,cAAM,CAAC,SAAD,EAAY,aAAZ,IAA6B,KAAK,CAAC,QAAN,GAAiB,IAAjB,GAAwB,KAAxB,CAA8B,GAA9B,EAAmC,CAAnC,CAAnC;AACA,QAAA,IAAI,CAAC,KAAL,GAAa,EACX,GAAG,IAAI,CAAC,KADG;AAEX,WAAC,SAAS,GAAG,QAAb,GAAwB;AAFb,SAAb;;AAIA,YAAI,aAAJ,EAAmB;AACjB,UAAA,IAAI,CAAC,KAAL,CAAW,WAAW,aAAtB,IAAuC,IAAvC;AACD;AACF;;AACD,aAAO,IAAP;AACD;;AA5DM;AAPe,CAAX,CAAf","sourcesContent":["import Vue from 'vue'\nimport { VNodeData } from 'vue/types/vnode'\nimport { consoleError } from '../../util/console'\nimport { isCssColor } from '../../util/colorUtils'\n\nexport default Vue.extend({\n name: 'colorable',\n\n props: {\n color: String,\n },\n\n methods: {\n setBackgroundColor (color?: string | false, data: VNodeData = {}): VNodeData {\n if (typeof data.style === 'string') {\n // istanbul ignore next\n consoleError('style must be an object', this)\n // istanbul ignore next\n return data\n }\n if (typeof data.class === 'string') {\n // istanbul ignore next\n consoleError('class must be an object', this)\n // istanbul ignore next\n return data\n }\n if (isCssColor(color)) {\n data.style = {\n ...data.style as object,\n 'background-color': `${color}`,\n 'border-color': `${color}`,\n }\n } else if (color) {\n data.class = {\n ...data.class,\n [color]: true,\n }\n }\n\n return data\n },\n\n setTextColor (color?: string | false, data: VNodeData = {}): VNodeData {\n if (typeof data.style === 'string') {\n // istanbul ignore next\n consoleError('style must be an object', this)\n // istanbul ignore next\n return data\n }\n if (typeof data.class === 'string') {\n // istanbul ignore next\n consoleError('class must be an object', this)\n // istanbul ignore next\n return data\n }\n if (isCssColor(color)) {\n data.style = {\n ...data.style as object,\n color: `${color}`,\n 'caret-color': `${color}`,\n }\n } else if (color) {\n const [colorName, colorModifier] = color.toString().trim().split(' ', 2) as (string | undefined)[]\n data.class = {\n ...data.class,\n [colorName + '--text']: true,\n }\n if (colorModifier) {\n data.class['text--' + colorModifier] = true\n }\n }\n return data\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-12
View File
@@ -1,12 +0,0 @@
import Vue from 'vue';
import { deepEqual } from '../../util/helpers';
export default Vue.extend({
name: 'comparable',
props: {
valueComparator: {
type: Function,
default: deepEqual
}
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/comparable/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAA8B,KAA9B;AACA,SAAS,SAAT,QAA0B,oBAA1B;AAEA,eAAe,GAAG,CAAC,MAAJ,CAAW;AACxB,EAAA,IAAI,EAAE,YADkB;AAExB,EAAA,KAAK,EAAE;AACL,IAAA,eAAe,EAAE;AACf,MAAA,IAAI,EAAE,QADS;AAEf,MAAA,OAAO,EAAE;AAFM;AADZ;AAFiB,CAAX,CAAf","sourcesContent":["import Vue, { PropType } from 'vue'\nimport { deepEqual } from '../../util/helpers'\n\nexport default Vue.extend({\n name: 'comparable',\n props: {\n valueComparator: {\n type: Function as PropType<typeof deepEqual>,\n default: deepEqual,\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-51
View File
@@ -1,51 +0,0 @@
import Vue from 'vue';
/**
* Delayable
*
* @mixin
*
* Changes the open or close delay time for elements
*/
export default Vue.extend().extend({
name: 'delayable',
props: {
openDelay: {
type: [Number, String],
default: 0
},
closeDelay: {
type: [Number, String],
default: 0
}
},
data: () => ({
openTimeout: undefined,
closeTimeout: undefined
}),
methods: {
/**
* Clear any pending delay timers from executing
*/
clearDelay() {
clearTimeout(this.openTimeout);
clearTimeout(this.closeTimeout);
},
/**
* Runs callback after a specified delay
*/
runDelay(type, cb) {
this.clearDelay();
const delay = parseInt(this[`${type}Delay`], 10);
this[`${type}Timeout`] = setTimeout(cb || (() => {
this.isActive = {
open: true,
close: false
}[type];
}), delay);
}
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/delayable/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAgB,KAAhB;AAEA;;;;;;;;AAOA,eAAe,GAAG,CAAC,MAAJ,GAA2C,MAA3C,CAAkD;AAC/D,EAAA,IAAI,EAAE,WADyD;AAG/D,EAAA,KAAK,EAAE;AACL,IAAA,SAAS,EAAE;AACT,MAAA,IAAI,EAAE,CAAC,MAAD,EAAS,MAAT,CADG;AAET,MAAA,OAAO,EAAE;AAFA,KADN;AAKL,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,CAAC,MAAD,EAAS,MAAT,CADI;AAEV,MAAA,OAAO,EAAE;AAFC;AALP,GAHwD;AAc/D,EAAA,IAAI,EAAE,OAAO;AACX,IAAA,WAAW,EAAE,SADF;AAEX,IAAA,YAAY,EAAE;AAFH,GAAP,CAdyD;AAmB/D,EAAA,OAAO,EAAE;AACP;;;AAGA,IAAA,UAAU,GAAA;AACR,MAAA,YAAY,CAAC,KAAK,WAAN,CAAZ;AACA,MAAA,YAAY,CAAC,KAAK,YAAN,CAAZ;AACD,KAPM;;AAQP;;;AAGA,IAAA,QAAQ,CAAE,IAAF,EAA0B,EAA1B,EAAyC;AAC/C,WAAK,UAAL;AAEA,YAAM,KAAK,GAAG,QAAQ,CAAE,KAAa,GAAG,IAAI,OAApB,CAAF,EAAgC,EAAhC,CAAtB;AAEE,WAAa,GAAG,IAAI,SAApB,IAAiC,UAAU,CAAC,EAAE,KAAK,MAAK;AACxD,aAAK,QAAL,GAAgB;AAAE,UAAA,IAAI,EAAE,IAAR;AAAc,UAAA,KAAK,EAAE;AAArB,UAA6B,IAA7B,CAAhB;AACD,OAF+C,CAAH,EAEzC,KAFyC,CAA3C;AAGH;;AAnBM;AAnBsD,CAAlD,CAAf","sourcesContent":["import Vue from 'vue'\n\n/**\n * Delayable\n *\n * @mixin\n *\n * Changes the open or close delay time for elements\n */\nexport default Vue.extend<Vue & { isActive?: boolean }>().extend({\n name: 'delayable',\n\n props: {\n openDelay: {\n type: [Number, String],\n default: 0,\n },\n closeDelay: {\n type: [Number, String],\n default: 0,\n },\n },\n\n data: () => ({\n openTimeout: undefined as number | undefined,\n closeTimeout: undefined as number | undefined,\n }),\n\n methods: {\n /**\n * Clear any pending delay timers from executing\n */\n clearDelay (): void {\n clearTimeout(this.openTimeout)\n clearTimeout(this.closeTimeout)\n },\n /**\n * Runs callback after a specified delay\n */\n runDelay (type: 'open' | 'close', cb?: () => void): void {\n this.clearDelay()\n\n const delay = parseInt((this as any)[`${type}Delay`], 10)\n\n ;(this as any)[`${type}Timeout`] = setTimeout(cb || (() => {\n this.isActive = { open: true, close: false }[type]\n }), delay)\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-70
View File
@@ -1,70 +0,0 @@
import mixins from '../../util/mixins';
function searchChildren(children) {
const results = [];
for (let index = 0; index < children.length; index++) {
const child = children[index];
if (child.isActive && child.isDependent) {
results.push(child);
} else {
results.push(...searchChildren(child.$children));
}
}
return results;
}
/* @vue/component */
export default mixins().extend({
name: 'dependent',
data() {
return {
closeDependents: true,
isActive: false,
isDependent: true
};
},
watch: {
isActive(val) {
if (val) return;
const openDependents = this.getOpenDependents();
for (let index = 0; index < openDependents.length; index++) {
openDependents[index].isActive = false;
}
}
},
methods: {
getOpenDependents() {
if (this.closeDependents) return searchChildren(this.$children);
return [];
},
getOpenDependentElements() {
const result = [];
const openDependents = this.getOpenDependents();
for (let index = 0; index < openDependents.length; index++) {
result.push(...openDependents[index].getClickableDependentElements());
}
return result;
},
getClickableDependentElements() {
const result = [this.$el];
if (this.$refs.content) result.push(this.$refs.content);
if (this.overlay) result.push(this.overlay.$el);
result.push(...this.getOpenDependentElements());
return result;
}
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/dependent/index.ts"],"names":[],"mappings":"AAEA,OAAO,MAAP,MAAmB,mBAAnB;;AAgBA,SAAS,cAAT,CAAyB,QAAzB,EAAwC;AACtC,QAAM,OAAO,GAAG,EAAhB;;AACA,OAAK,IAAI,KAAK,GAAG,CAAjB,EAAoB,KAAK,GAAG,QAAQ,CAAC,MAArC,EAA6C,KAAK,EAAlD,EAAsD;AACpD,UAAM,KAAK,GAAG,QAAQ,CAAC,KAAD,CAAtB;;AACA,QAAI,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,WAA5B,EAAyC;AACvC,MAAA,OAAO,CAAC,IAAR,CAAa,KAAb;AACD,KAFD,MAEO;AACL,MAAA,OAAO,CAAC,IAAR,CAAa,GAAG,cAAc,CAAC,KAAK,CAAC,SAAP,CAA9B;AACD;AACF;;AAED,SAAO,OAAP;AACD;AAED;;;AACA,eAAe,MAAM,GAAY,MAAlB,CAAyB;AACtC,EAAA,IAAI,EAAE,WADgC;;AAGtC,EAAA,IAAI,GAAA;AACF,WAAO;AACL,MAAA,eAAe,EAAE,IADZ;AAEL,MAAA,QAAQ,EAAE,KAFL;AAGL,MAAA,WAAW,EAAE;AAHR,KAAP;AAKD,GATqC;;AAWtC,EAAA,KAAK,EAAE;AACL,IAAA,QAAQ,CAAE,GAAF,EAAK;AACX,UAAI,GAAJ,EAAS;AAET,YAAM,cAAc,GAAG,KAAK,iBAAL,EAAvB;;AACA,WAAK,IAAI,KAAK,GAAG,CAAjB,EAAoB,KAAK,GAAG,cAAc,CAAC,MAA3C,EAAmD,KAAK,EAAxD,EAA4D;AAC1D,QAAA,cAAc,CAAC,KAAD,CAAd,CAAsB,QAAtB,GAAiC,KAAjC;AACD;AACF;;AARI,GAX+B;AAsBtC,EAAA,OAAO,EAAE;AACP,IAAA,iBAAiB,GAAA;AACf,UAAI,KAAK,eAAT,EAA0B,OAAO,cAAc,CAAC,KAAK,SAAN,CAArB;AAE1B,aAAO,EAAP;AACD,KALM;;AAMP,IAAA,wBAAwB,GAAA;AACtB,YAAM,MAAM,GAAG,EAAf;AACA,YAAM,cAAc,GAAG,KAAK,iBAAL,EAAvB;;AAEA,WAAK,IAAI,KAAK,GAAG,CAAjB,EAAoB,KAAK,GAAG,cAAc,CAAC,MAA3C,EAAmD,KAAK,EAAxD,EAA4D;AAC1D,QAAA,MAAM,CAAC,IAAP,CAAY,GAAG,cAAc,CAAC,KAAD,CAAd,CAAsB,6BAAtB,EAAf;AACD;;AAED,aAAO,MAAP;AACD,KAfM;;AAgBP,IAAA,6BAA6B,GAAA;AAC3B,YAAM,MAAM,GAAG,CAAC,KAAK,GAAN,CAAf;AACA,UAAI,KAAK,KAAL,CAAW,OAAf,EAAwB,MAAM,CAAC,IAAP,CAAY,KAAK,KAAL,CAAW,OAAvB;AACxB,UAAI,KAAK,OAAT,EAAkB,MAAM,CAAC,IAAP,CAAY,KAAK,OAAL,CAAa,GAAzB;AAClB,MAAA,MAAM,CAAC,IAAP,CAAY,GAAG,KAAK,wBAAL,EAAf;AAEA,aAAO,MAAP;AACD;;AAvBM;AAtB6B,CAAzB,CAAf","sourcesContent":["import Vue from 'vue'\n\nimport mixins from '../../util/mixins'\nimport { VOverlay } from '../../components/VOverlay'\n\ninterface options extends Vue {\n $el: HTMLElement\n $refs: {\n content: HTMLElement\n }\n overlay?: InstanceType<typeof VOverlay>\n}\n\ninterface DependentInstance extends Vue {\n isActive?: boolean\n isDependent?: boolean\n}\n\nfunction searchChildren (children: Vue[]): DependentInstance[] {\n const results = []\n for (let index = 0; index < children.length; index++) {\n const child = children[index] as DependentInstance\n if (child.isActive && child.isDependent) {\n results.push(child)\n } else {\n results.push(...searchChildren(child.$children))\n }\n }\n\n return results\n}\n\n/* @vue/component */\nexport default mixins<options>().extend({\n name: 'dependent',\n\n data () {\n return {\n closeDependents: true,\n isActive: false,\n isDependent: true,\n }\n },\n\n watch: {\n isActive (val) {\n if (val) return\n\n const openDependents = this.getOpenDependents()\n for (let index = 0; index < openDependents.length; index++) {\n openDependents[index].isActive = false\n }\n },\n },\n\n methods: {\n getOpenDependents (): any[] {\n if (this.closeDependents) return searchChildren(this.$children)\n\n return []\n },\n getOpenDependentElements (): HTMLElement[] {\n const result = []\n const openDependents = this.getOpenDependents()\n\n for (let index = 0; index < openDependents.length; index++) {\n result.push(...openDependents[index].getClickableDependentElements())\n }\n\n return result\n },\n getClickableDependentElements (): HTMLElement[] {\n const result = [this.$el]\n if (this.$refs.content) result.push(this.$refs.content)\n if (this.overlay) result.push(this.overlay.$el as HTMLElement)\n result.push(...this.getOpenDependentElements())\n\n return result\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-123
View File
@@ -1,123 +0,0 @@
// Mixins
import Bootable from '../bootable'; // Utilities
import { getObjectValueByPath } from '../../util/helpers';
import mixins from '../../util/mixins';
import { consoleWarn } from '../../util/console';
function validateAttachTarget(val) {
const type = typeof val;
if (type === 'boolean' || type === 'string') return true;
return val.nodeType === Node.ELEMENT_NODE;
}
/* @vue/component */
export default mixins(Bootable).extend({
name: 'detachable',
props: {
attach: {
default: false,
validator: validateAttachTarget
},
contentClass: {
type: String,
default: ''
}
},
data: () => ({
activatorNode: null,
hasDetached: false
}),
watch: {
attach() {
this.hasDetached = false;
this.initDetach();
},
hasContent() {
this.$nextTick(this.initDetach);
}
},
beforeMount() {
this.$nextTick(() => {
if (this.activatorNode) {
const activator = Array.isArray(this.activatorNode) ? this.activatorNode : [this.activatorNode];
activator.forEach(node => {
if (!node.elm) return;
if (!this.$el.parentNode) return;
const target = this.$el === this.$el.parentNode.firstChild ? this.$el : this.$el.nextSibling;
this.$el.parentNode.insertBefore(node.elm, target);
});
}
});
},
mounted() {
this.hasContent && this.initDetach();
},
deactivated() {
this.isActive = false;
},
beforeDestroy() {
// IE11 Fix
try {
if (this.$refs.content && this.$refs.content.parentNode) {
this.$refs.content.parentNode.removeChild(this.$refs.content);
}
if (this.activatorNode) {
const activator = Array.isArray(this.activatorNode) ? this.activatorNode : [this.activatorNode];
activator.forEach(node => {
node.elm && node.elm.parentNode && node.elm.parentNode.removeChild(node.elm);
});
}
} catch (e) {
console.log(e);
}
},
methods: {
getScopeIdAttrs() {
const scopeId = getObjectValueByPath(this.$vnode, 'context.$options._scopeId');
return scopeId && {
[scopeId]: ''
};
},
initDetach() {
if (this._isDestroyed || !this.$refs.content || this.hasDetached || // Leave menu in place if attached
// and dev has not changed target
this.attach === '' || // If used as a boolean prop (<v-menu attach>)
this.attach === true || // If bound to a boolean (<v-menu :attach="true">)
this.attach === 'attach' // If bound as boolean prop in pug (v-menu(attach))
) return;
let target;
if (this.attach === false) {
// Default, detach to app
target = document.querySelector('[data-app]');
} else if (typeof this.attach === 'string') {
// CSS selector
target = document.querySelector(this.attach);
} else {
// DOM Element
target = this.attach;
}
if (!target) {
consoleWarn(`Unable to locate target ${this.attach || '[data-app]'}`, this);
return;
}
target.appendChild(this.$refs.content);
this.hasDetached = true;
}
}
});
//# sourceMappingURL=index.js.map
File diff suppressed because one or more lines are too long
-23
View File
@@ -1,23 +0,0 @@
import Vue from 'vue';
export default Vue.extend({
name: 'elevatable',
props: {
elevation: [Number, String]
},
computed: {
computedElevation() {
return this.elevation;
},
elevationClasses() {
const elevation = this.computedElevation;
if (elevation == null) return {};
if (isNaN(parseInt(elevation))) return {};
return {
[`elevation-${this.elevation}`]: true
};
}
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/elevatable/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAgB,KAAhB;AAEA,eAAe,GAAG,CAAC,MAAJ,CAAW;AACxB,EAAA,IAAI,EAAE,YADkB;AAGxB,EAAA,KAAK,EAAE;AACL,IAAA,SAAS,EAAE,CAAC,MAAD,EAAS,MAAT;AADN,GAHiB;AAOxB,EAAA,QAAQ,EAAE;AACR,IAAA,iBAAiB,GAAA;AACf,aAAO,KAAK,SAAZ;AACD,KAHO;;AAIR,IAAA,gBAAgB,GAAA;AACd,YAAM,SAAS,GAAG,KAAK,iBAAvB;AAEA,UAAI,SAAS,IAAI,IAAjB,EAAuB,OAAO,EAAP;AACvB,UAAI,KAAK,CAAC,QAAQ,CAAC,SAAD,CAAT,CAAT,EAAgC,OAAO,EAAP;AAChC,aAAO;AAAE,SAAC,aAAa,KAAK,SAAS,EAA5B,GAAiC;AAAnC,OAAP;AACD;;AAVO;AAPc,CAAX,CAAf","sourcesContent":["import Vue from 'vue'\n\nexport default Vue.extend({\n name: 'elevatable',\n\n props: {\n elevation: [Number, String],\n },\n\n computed: {\n computedElevation (): string | number | undefined {\n return this.elevation\n },\n elevationClasses (): Record<string, boolean> {\n const elevation = this.computedElevation\n\n if (elevation == null) return {}\n if (isNaN(parseInt(elevation))) return {}\n return { [`elevation-${this.elevation}`]: true }\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-13
View File
@@ -1,13 +0,0 @@
import Vue from 'vue';
/* @vue/component */
export default Vue.extend({
name: 'filterable',
props: {
noDataText: {
type: String,
default: '$vuetify.noDataText'
}
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/filterable/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAgB,KAAhB;AAEA;;AACA,eAAe,GAAG,CAAC,MAAJ,CAAW;AACxB,EAAA,IAAI,EAAE,YADkB;AAGxB,EAAA,KAAK,EAAE;AACL,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,MADI;AAEV,MAAA,OAAO,EAAE;AAFC;AADP;AAHiB,CAAX,CAAf","sourcesContent":["import Vue from 'vue'\n\n/* @vue/component */\nexport default Vue.extend({\n name: 'filterable',\n\n props: {\n noDataText: {\n type: String,\n default: '$vuetify.noDataText',\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-57
View File
@@ -1,57 +0,0 @@
// Mixins
import { inject as RegistrableInject } from '../registrable';
export function factory(namespace, child, parent) {
// TODO: ts 3.4 broke directly returning this
const R = RegistrableInject(namespace, child, parent).extend({
name: 'groupable',
props: {
activeClass: {
type: String,
default() {
if (!this[namespace]) return undefined;
return this[namespace].activeClass;
}
},
disabled: Boolean
},
data() {
return {
isActive: false
};
},
computed: {
groupClasses() {
if (!this.activeClass) return {};
return {
[this.activeClass]: this.isActive
};
}
},
created() {
this[namespace] && this[namespace].register(this);
},
beforeDestroy() {
this[namespace] && this[namespace].unregister(this);
},
methods: {
toggle() {
this.$emit('change');
}
}
});
return R;
}
/* eslint-disable-next-line no-redeclare */
const Groupable = factory('itemGroup');
export default Groupable;
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/groupable/index.ts"],"names":[],"mappings":"AAAA;AACA,SAAsB,MAAM,IAAI,iBAAhC,QAAyD,gBAAzD;AAgBA,OAAM,SAAU,OAAV,CACJ,SADI,EAEJ,KAFI,EAGJ,MAHI,EAGW;AAEf;AACA,QAAM,CAAC,GAAG,iBAAiB,CAAO,SAAP,EAAkB,KAAlB,EAAyB,MAAzB,CAAjB,CAAkD,MAAlD,CAAyD;AACjE,IAAA,IAAI,EAAE,WAD2D;AAGjE,IAAA,KAAK,EAAE;AACL,MAAA,WAAW,EAAE;AACX,QAAA,IAAI,EAAE,MADK;;AAEX,QAAA,OAAO,GAAA;AACL,cAAI,CAAC,KAAK,SAAL,CAAL,EAAsB,OAAO,SAAP;AAEtB,iBAAO,KAAK,SAAL,EAAgB,WAAvB;AACD;;AANU,OADR;AASL,MAAA,QAAQ,EAAE;AATL,KAH0D;;AAejE,IAAA,IAAI,GAAA;AACF,aAAO;AACL,QAAA,QAAQ,EAAE;AADL,OAAP;AAGD,KAnBgE;;AAqBjE,IAAA,QAAQ,EAAE;AACR,MAAA,YAAY,GAAA;AACV,YAAI,CAAC,KAAK,WAAV,EAAuB,OAAO,EAAP;AAEvB,eAAO;AACL,WAAC,KAAK,WAAN,GAAoB,KAAK;AADpB,SAAP;AAGD;;AAPO,KArBuD;;AA+BjE,IAAA,OAAO,GAAA;AACL,WAAK,SAAL,KAAoB,KAAK,SAAL,EAAwB,QAAxB,CAAiC,IAAjC,CAApB;AACD,KAjCgE;;AAmCjE,IAAA,aAAa,GAAA;AACX,WAAK,SAAL,KAAoB,KAAK,SAAL,EAAwB,UAAxB,CAAmC,IAAnC,CAApB;AACD,KArCgE;;AAuCjE,IAAA,OAAO,EAAE;AACP,MAAA,MAAM,GAAA;AACJ,aAAK,KAAL,CAAW,QAAX;AACD;;AAHM;AAvCwD,GAAzD,CAAV;AA8CA,SAAO,CAAP;AACD;AAED;;AACA,MAAM,SAAS,GAAG,OAAO,CAAC,WAAD,CAAzB;AAEA,eAAe,SAAf","sourcesContent":["// Mixins\nimport { Registrable, inject as RegistrableInject } from '../registrable'\n\n// Utilities\nimport { ExtractVue } from '../../util/mixins'\nimport { VueConstructor } from 'vue'\nimport { PropValidator } from 'vue/types/options'\n\n/* eslint-disable-next-line no-use-before-define */\nexport type Groupable<T extends string, C extends VueConstructor | null = null> = VueConstructor<ExtractVue<Registrable<T, C>> & {\n activeClass: string\n isActive: boolean\n disabled: boolean\n groupClasses: object\n toggle (): void\n}>\n\nexport function factory<T extends string, C extends VueConstructor | null = null> (\n namespace: T,\n child?: string,\n parent?: string\n): Groupable<T, C> {\n // TODO: ts 3.4 broke directly returning this\n const R = RegistrableInject<T, C>(namespace, child, parent).extend({\n name: 'groupable',\n\n props: {\n activeClass: {\n type: String,\n default (): string | undefined {\n if (!this[namespace]) return undefined\n\n return this[namespace].activeClass\n },\n } as any as PropValidator<string>,\n disabled: Boolean,\n },\n\n data () {\n return {\n isActive: false,\n }\n },\n\n computed: {\n groupClasses (): object {\n if (!this.activeClass) return {}\n\n return {\n [this.activeClass]: this.isActive,\n }\n },\n },\n\n created () {\n this[namespace] && (this[namespace] as any).register(this)\n },\n\n beforeDestroy () {\n this[namespace] && (this[namespace] as any).unregister(this)\n },\n\n methods: {\n toggle () {\n this.$emit('change')\n },\n },\n })\n\n return R\n}\n\n/* eslint-disable-next-line no-redeclare */\nconst Groupable = factory('itemGroup')\n\nexport default Groupable\n"],"sourceRoot":"","file":"index.js"}
-48
View File
@@ -1,48 +0,0 @@
// Directives
import Intersect from '../../directives/intersect'; // Utilities
import { consoleWarn } from '../../util/console'; // Types
import Vue from 'vue';
export default function intersectable(options) {
if (typeof window === 'undefined' || !('IntersectionObserver' in window)) {
// do nothing because intersection observer is not available
return Vue.extend({
name: 'intersectable'
});
}
return Vue.extend({
name: 'intersectable',
mounted() {
Intersect.inserted(this.$el, {
name: 'intersect',
value: this.onObserve
});
},
destroyed() {
Intersect.unbind(this.$el);
},
methods: {
onObserve(entries, observer, isIntersecting) {
if (!isIntersecting) return;
for (let i = 0, length = options.onVisible.length; i < length; i++) {
const callback = this[options.onVisible[i]];
if (typeof callback === 'function') {
callback();
continue;
}
consoleWarn(options.onVisible[i] + ' method is not available on the instance but referenced in intersectable mixin options');
}
}
}
});
}
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/intersectable/index.ts"],"names":[],"mappings":"AAAA;AACA,OAAO,SAAP,MAAsB,4BAAtB,C,CAEA;;AACA,SAAS,WAAT,QAA4B,oBAA5B,C,CAEA;;AACA,OAAO,GAAP,MAAgB,KAAhB;AAEA,eAAc,SAAU,aAAV,CAAyB,OAAzB,EAAyD;AACrE,MAAI,OAAO,MAAP,KAAkB,WAAlB,IAAiC,EAAE,0BAA0B,MAA5B,CAArC,EAA0E;AACxE;AACA,WAAO,GAAG,CAAC,MAAJ,CAAW;AAAE,MAAA,IAAI,EAAE;AAAR,KAAX,CAAP;AACD;;AAED,SAAO,GAAG,CAAC,MAAJ,CAAW;AAChB,IAAA,IAAI,EAAE,eADU;;AAGhB,IAAA,OAAO,GAAA;AACL,MAAA,SAAS,CAAC,QAAV,CAAmB,KAAK,GAAxB,EAA4C;AAC1C,QAAA,IAAI,EAAE,WADoC;AAE1C,QAAA,KAAK,EAAE,KAAK;AAF8B,OAA5C;AAID,KARe;;AAUhB,IAAA,SAAS,GAAA;AACP,MAAA,SAAS,CAAC,MAAV,CAAiB,KAAK,GAAtB;AACD,KAZe;;AAchB,IAAA,OAAO,EAAE;AACP,MAAA,SAAS,CAAE,OAAF,EAAwC,QAAxC,EAAwE,cAAxE,EAA+F;AACtG,YAAI,CAAC,cAAL,EAAqB;;AAErB,aAAK,IAAI,CAAC,GAAG,CAAR,EAAW,MAAM,GAAG,OAAO,CAAC,SAAR,CAAkB,MAA3C,EAAmD,CAAC,GAAG,MAAvD,EAA+D,CAAC,EAAhE,EAAoE;AAClE,gBAAM,QAAQ,GAAI,KAAa,OAAO,CAAC,SAAR,CAAkB,CAAlB,CAAb,CAAlB;;AAEA,cAAI,OAAO,QAAP,KAAoB,UAAxB,EAAoC;AAClC,YAAA,QAAQ;AACR;AACD;;AAED,UAAA,WAAW,CAAC,OAAO,CAAC,SAAR,CAAkB,CAAlB,IAAuB,wFAAxB,CAAX;AACD;AACF;;AAdM;AAdO,GAAX,CAAP;AA+BD","sourcesContent":["// Directives\nimport Intersect from '../../directives/intersect'\n\n// Utilities\nimport { consoleWarn } from '../../util/console'\n\n// Types\nimport Vue from 'vue'\n\nexport default function intersectable (options: { onVisible: string[] }) {\n if (typeof window === 'undefined' || !('IntersectionObserver' in window)) {\n // do nothing because intersection observer is not available\n return Vue.extend({ name: 'intersectable' })\n }\n\n return Vue.extend({\n name: 'intersectable',\n\n mounted () {\n Intersect.inserted(this.$el as HTMLElement, {\n name: 'intersect',\n value: this.onObserve,\n })\n },\n\n destroyed () {\n Intersect.unbind(this.$el as HTMLElement)\n },\n\n methods: {\n onObserve (entries: IntersectionObserverEntry[], observer: IntersectionObserver, isIntersecting: boolean) {\n if (!isIntersecting) return\n\n for (let i = 0, length = options.onVisible.length; i < length; i++) {\n const callback = (this as any)[options.onVisible[i]]\n\n if (typeof callback === 'function') {\n callback()\n continue\n }\n\n consoleWarn(options.onVisible[i] + ' method is not available on the instance but referenced in intersectable mixin options')\n }\n },\n },\n })\n}\n"],"sourceRoot":"","file":"index.js"}
-42
View File
@@ -1,42 +0,0 @@
import Vue from 'vue';
import VProgressLinear from '../../components/VProgressLinear';
/**
* Loadable
*
* @mixin
*
* Used to add linear progress bar to components
* Can use a default bar with a specific color
* or designate a custom progress linear bar
*/
/* @vue/component */
export default Vue.extend().extend({
name: 'loadable',
props: {
loading: {
type: [Boolean, String],
default: false
},
loaderHeight: {
type: [Number, String],
default: 2
}
},
methods: {
genProgress() {
if (this.loading === false) return null;
return this.$slots.progress || this.$createElement(VProgressLinear, {
props: {
absolute: true,
color: this.loading === true || this.loading === '' ? this.color || 'primary' : this.loading,
height: this.loaderHeight,
indeterminate: true
}
});
}
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/loadable/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAA2B,KAA3B;AACA,OAAO,eAAP,MAA4B,kCAA5B;AAMA;;;;;;;;;;AASA;;AACA,eAAe,GAAG,CAAC,MAAJ,GAAwB,MAAxB,CAA+B;AAC5C,EAAA,IAAI,EAAE,UADsC;AAG5C,EAAA,KAAK,EAAE;AACL,IAAA,OAAO,EAAE;AACP,MAAA,IAAI,EAAE,CAAC,OAAD,EAAU,MAAV,CADC;AAEP,MAAA,OAAO,EAAE;AAFF,KADJ;AAKL,IAAA,YAAY,EAAE;AACZ,MAAA,IAAI,EAAE,CAAC,MAAD,EAAS,MAAT,CADM;AAEZ,MAAA,OAAO,EAAE;AAFG;AALT,GAHqC;AAc5C,EAAA,OAAO,EAAE;AACP,IAAA,WAAW,GAAA;AACT,UAAI,KAAK,OAAL,KAAiB,KAArB,EAA4B,OAAO,IAAP;AAE5B,aAAO,KAAK,MAAL,CAAY,QAAZ,IAAwB,KAAK,cAAL,CAAoB,eAApB,EAAqC;AAClE,QAAA,KAAK,EAAE;AACL,UAAA,QAAQ,EAAE,IADL;AAEL,UAAA,KAAK,EAAG,KAAK,OAAL,KAAiB,IAAjB,IAAyB,KAAK,OAAL,KAAiB,EAA3C,GACF,KAAK,KAAL,IAAc,SADZ,GAEH,KAAK,OAJJ;AAKL,UAAA,MAAM,EAAE,KAAK,YALR;AAML,UAAA,aAAa,EAAE;AANV;AAD2D,OAArC,CAA/B;AAUD;;AAdM;AAdmC,CAA/B,CAAf","sourcesContent":["import Vue, { VNode } from 'vue'\nimport VProgressLinear from '../../components/VProgressLinear'\n\ninterface colorable extends Vue {\n color?: string\n}\n\n/**\n * Loadable\n *\n * @mixin\n *\n * Used to add linear progress bar to components\n * Can use a default bar with a specific color\n * or designate a custom progress linear bar\n */\n/* @vue/component */\nexport default Vue.extend<colorable>().extend({\n name: 'loadable',\n\n props: {\n loading: {\n type: [Boolean, String],\n default: false,\n },\n loaderHeight: {\n type: [Number, String],\n default: 2,\n },\n },\n\n methods: {\n genProgress (): VNode | VNode[] | null {\n if (this.loading === false) return null\n\n return this.$slots.progress || this.$createElement(VProgressLinear, {\n props: {\n absolute: true,\n color: (this.loading === true || this.loading === '')\n ? (this.color || 'primary')\n : this.loading,\n height: this.loaderHeight,\n indeterminate: true,\n },\n })\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-14
View File
@@ -1,14 +0,0 @@
import Vue from 'vue';
export default Vue.extend({
name: 'localable',
props: {
locale: String
},
computed: {
currentLocale() {
return this.locale || this.$vuetify.lang.current;
}
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/localable/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAgB,KAAhB;AAEA,eAAe,GAAG,CAAC,MAAJ,CAAW;AACxB,EAAA,IAAI,EAAE,WADkB;AAGxB,EAAA,KAAK,EAAE;AACL,IAAA,MAAM,EAAE;AADH,GAHiB;AAOxB,EAAA,QAAQ,EAAE;AACR,IAAA,aAAa,GAAA;AACX,aAAO,KAAK,MAAL,IAAe,KAAK,QAAL,CAAc,IAAd,CAAmB,OAAzC;AACD;;AAHO;AAPc,CAAX,CAAf","sourcesContent":["import Vue from 'vue'\n\nexport default Vue.extend({\n name: 'localable',\n\n props: {\n locale: String,\n },\n\n computed: {\n currentLocale (): string {\n return this.locale || this.$vuetify.lang.current\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-35
View File
@@ -1,35 +0,0 @@
// Helpers
import { convertToUnit } from '../../util/helpers'; // Types
import Vue from 'vue';
export default Vue.extend({
name: 'measurable',
props: {
height: [Number, String],
maxHeight: [Number, String],
maxWidth: [Number, String],
minHeight: [Number, String],
minWidth: [Number, String],
width: [Number, String]
},
computed: {
measurableStyles() {
const styles = {};
const height = convertToUnit(this.height);
const minHeight = convertToUnit(this.minHeight);
const minWidth = convertToUnit(this.minWidth);
const maxHeight = convertToUnit(this.maxHeight);
const maxWidth = convertToUnit(this.maxWidth);
const width = convertToUnit(this.width);
if (height) styles.height = height;
if (minHeight) styles.minHeight = minHeight;
if (minWidth) styles.minWidth = minWidth;
if (maxHeight) styles.maxHeight = maxHeight;
if (maxWidth) styles.maxWidth = maxWidth;
if (width) styles.width = width;
return styles;
}
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/measurable/index.ts"],"names":[],"mappings":"AAAA;AACA,SAAS,aAAT,QAA8B,oBAA9B,C,CAEA;;AACA,OAAO,GAAP,MAA8B,KAA9B;AAIA,eAAe,GAAG,CAAC,MAAJ,CAAW;AACxB,EAAA,IAAI,EAAE,YADkB;AAGxB,EAAA,KAAK,EAAE;AACL,IAAA,MAAM,EAAE,CAAC,MAAD,EAAS,MAAT,CADH;AAEL,IAAA,SAAS,EAAE,CAAC,MAAD,EAAS,MAAT,CAFN;AAGL,IAAA,QAAQ,EAAE,CAAC,MAAD,EAAS,MAAT,CAHL;AAIL,IAAA,SAAS,EAAE,CAAC,MAAD,EAAS,MAAT,CAJN;AAKL,IAAA,QAAQ,EAAE,CAAC,MAAD,EAAS,MAAT,CALL;AAML,IAAA,KAAK,EAAE,CAAC,MAAD,EAAS,MAAT;AANF,GAHiB;AAYxB,EAAA,QAAQ,EAAE;AACR,IAAA,gBAAgB,GAAA;AACd,YAAM,MAAM,GAA2B,EAAvC;AAEA,YAAM,MAAM,GAAG,aAAa,CAAC,KAAK,MAAN,CAA5B;AACA,YAAM,SAAS,GAAG,aAAa,CAAC,KAAK,SAAN,CAA/B;AACA,YAAM,QAAQ,GAAG,aAAa,CAAC,KAAK,QAAN,CAA9B;AACA,YAAM,SAAS,GAAG,aAAa,CAAC,KAAK,SAAN,CAA/B;AACA,YAAM,QAAQ,GAAG,aAAa,CAAC,KAAK,QAAN,CAA9B;AACA,YAAM,KAAK,GAAG,aAAa,CAAC,KAAK,KAAN,CAA3B;AAEA,UAAI,MAAJ,EAAY,MAAM,CAAC,MAAP,GAAgB,MAAhB;AACZ,UAAI,SAAJ,EAAe,MAAM,CAAC,SAAP,GAAmB,SAAnB;AACf,UAAI,QAAJ,EAAc,MAAM,CAAC,QAAP,GAAkB,QAAlB;AACd,UAAI,SAAJ,EAAe,MAAM,CAAC,SAAP,GAAmB,SAAnB;AACf,UAAI,QAAJ,EAAc,MAAM,CAAC,QAAP,GAAkB,QAAlB;AACd,UAAI,KAAJ,EAAW,MAAM,CAAC,KAAP,GAAe,KAAf;AAEX,aAAO,MAAP;AACD;;AAnBO;AAZc,CAAX,CAAf","sourcesContent":["// Helpers\nimport { convertToUnit } from '../../util/helpers'\n\n// Types\nimport Vue, { PropType } from 'vue'\n\nexport type NumberOrNumberString = PropType<string | number | undefined>\n\nexport default Vue.extend({\n name: 'measurable',\n\n props: {\n height: [Number, String] as NumberOrNumberString,\n maxHeight: [Number, String] as NumberOrNumberString,\n maxWidth: [Number, String] as NumberOrNumberString,\n minHeight: [Number, String] as NumberOrNumberString,\n minWidth: [Number, String] as NumberOrNumberString,\n width: [Number, String] as NumberOrNumberString,\n },\n\n computed: {\n measurableStyles (): object {\n const styles: Record<string, string> = {}\n\n const height = convertToUnit(this.height)\n const minHeight = convertToUnit(this.minHeight)\n const minWidth = convertToUnit(this.minWidth)\n const maxHeight = convertToUnit(this.maxHeight)\n const maxWidth = convertToUnit(this.maxWidth)\n const width = convertToUnit(this.width)\n\n if (height) styles.height = height\n if (minHeight) styles.minHeight = minHeight\n if (minWidth) styles.minWidth = minWidth\n if (maxHeight) styles.maxHeight = maxHeight\n if (maxWidth) styles.maxWidth = maxWidth\n if (width) styles.width = width\n\n return styles\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-358
View File
@@ -1,358 +0,0 @@
// Mixins
import Positionable from '../positionable';
import Stackable from '../stackable';
import Activatable from '../activatable'; // Utilities
import mixins from '../../util/mixins';
import { convertToUnit } from '../../util/helpers'; // Types
const baseMixins = mixins(Stackable, Positionable, Activatable);
/* @vue/component */
export default baseMixins.extend().extend({
name: 'menuable',
props: {
allowOverflow: Boolean,
light: Boolean,
dark: Boolean,
maxWidth: {
type: [Number, String],
default: 'auto'
},
minWidth: [Number, String],
nudgeBottom: {
type: [Number, String],
default: 0
},
nudgeLeft: {
type: [Number, String],
default: 0
},
nudgeRight: {
type: [Number, String],
default: 0
},
nudgeTop: {
type: [Number, String],
default: 0
},
nudgeWidth: {
type: [Number, String],
default: 0
},
offsetOverflow: Boolean,
openOnClick: Boolean,
positionX: {
type: Number,
default: null
},
positionY: {
type: Number,
default: null
},
zIndex: {
type: [Number, String],
default: null
}
},
data: () => ({
absoluteX: 0,
absoluteY: 0,
activatedBy: null,
activatorFixed: false,
dimensions: {
activator: {
top: 0,
left: 0,
bottom: 0,
right: 0,
width: 0,
height: 0,
offsetTop: 0,
scrollHeight: 0,
offsetLeft: 0
},
content: {
top: 0,
left: 0,
bottom: 0,
right: 0,
width: 0,
height: 0,
offsetTop: 0,
scrollHeight: 0
}
},
hasJustFocused: false,
hasWindow: false,
inputActivator: false,
isContentActive: false,
pageWidth: 0,
pageYOffset: 0,
stackClass: 'v-menu__content--active',
stackMinZIndex: 6
}),
computed: {
computedLeft() {
const a = this.dimensions.activator;
const c = this.dimensions.content;
const activatorLeft = (this.attach !== false ? a.offsetLeft : a.left) || 0;
const minWidth = Math.max(a.width, c.width);
let left = 0;
left += this.left ? activatorLeft - (minWidth - a.width) : activatorLeft;
if (this.offsetX) {
const maxWidth = isNaN(Number(this.maxWidth)) ? a.width : Math.min(a.width, Number(this.maxWidth));
left += this.left ? -maxWidth : a.width;
}
if (this.nudgeLeft) left -= parseInt(this.nudgeLeft);
if (this.nudgeRight) left += parseInt(this.nudgeRight);
return left;
},
computedTop() {
const a = this.dimensions.activator;
const c = this.dimensions.content;
let top = 0;
if (this.top) top += a.height - c.height;
if (this.attach !== false) top += a.offsetTop;else top += a.top + this.pageYOffset;
if (this.offsetY) top += this.top ? -a.height : a.height;
if (this.nudgeTop) top -= parseInt(this.nudgeTop);
if (this.nudgeBottom) top += parseInt(this.nudgeBottom);
return top;
},
hasActivator() {
return !!this.$slots.activator || !!this.$scopedSlots.activator || !!this.activator || !!this.inputActivator;
}
},
watch: {
disabled(val) {
val && this.callDeactivate();
},
isActive(val) {
if (this.disabled) return;
val ? this.callActivate() : this.callDeactivate();
},
positionX: 'updateDimensions',
positionY: 'updateDimensions'
},
beforeMount() {
this.hasWindow = typeof window !== 'undefined';
},
methods: {
absolutePosition() {
return {
offsetTop: 0,
offsetLeft: 0,
scrollHeight: 0,
top: this.positionY || this.absoluteY,
bottom: this.positionY || this.absoluteY,
left: this.positionX || this.absoluteX,
right: this.positionX || this.absoluteX,
height: 0,
width: 0
};
},
activate() {},
calcLeft(menuWidth) {
return convertToUnit(this.attach !== false ? this.computedLeft : this.calcXOverflow(this.computedLeft, menuWidth));
},
calcTop() {
return convertToUnit(this.attach !== false ? this.computedTop : this.calcYOverflow(this.computedTop));
},
calcXOverflow(left, menuWidth) {
const xOverflow = left + menuWidth - this.pageWidth + 12;
if ((!this.left || this.right) && xOverflow > 0) {
left = Math.max(left - xOverflow, 0);
} else {
left = Math.max(left, 12);
}
return left + this.getOffsetLeft();
},
calcYOverflow(top) {
const documentHeight = this.getInnerHeight();
const toTop = this.pageYOffset + documentHeight;
const activator = this.dimensions.activator;
const contentHeight = this.dimensions.content.height;
const totalHeight = top + contentHeight;
const isOverflowing = toTop < totalHeight; // If overflowing bottom and offset
// TODO: set 'bottom' position instead of 'top'
if (isOverflowing && this.offsetOverflow && // If we don't have enough room to offset
// the overflow, don't offset
activator.top > contentHeight) {
top = this.pageYOffset + (activator.top - contentHeight); // If overflowing bottom
} else if (isOverflowing && !this.allowOverflow) {
top = toTop - contentHeight - 12; // If overflowing top
} else if (top < this.pageYOffset && !this.allowOverflow) {
top = this.pageYOffset + 12;
}
return top < 12 ? 12 : top;
},
callActivate() {
if (!this.hasWindow) return;
this.activate();
},
callDeactivate() {
this.isContentActive = false;
this.deactivate();
},
checkForPageYOffset() {
if (this.hasWindow) {
this.pageYOffset = this.activatorFixed ? 0 : this.getOffsetTop();
}
},
checkActivatorFixed() {
if (this.attach !== false) return;
let el = this.getActivator();
while (el) {
if (window.getComputedStyle(el).position === 'fixed') {
this.activatorFixed = true;
return;
}
el = el.offsetParent;
}
this.activatorFixed = false;
},
deactivate() {},
genActivatorListeners() {
const listeners = Activatable.options.methods.genActivatorListeners.call(this);
const onClick = listeners.click;
listeners.click = e => {
if (this.openOnClick) {
onClick && onClick(e);
}
this.absoluteX = e.clientX;
this.absoluteY = e.clientY;
};
return listeners;
},
getInnerHeight() {
if (!this.hasWindow) return 0;
return window.innerHeight || document.documentElement.clientHeight;
},
getOffsetLeft() {
if (!this.hasWindow) return 0;
return window.pageXOffset || document.documentElement.scrollLeft;
},
getOffsetTop() {
if (!this.hasWindow) return 0;
return window.pageYOffset || document.documentElement.scrollTop;
},
getRoundedBoundedClientRect(el) {
const rect = el.getBoundingClientRect();
return {
top: Math.round(rect.top),
left: Math.round(rect.left),
bottom: Math.round(rect.bottom),
right: Math.round(rect.right),
width: Math.round(rect.width),
height: Math.round(rect.height)
};
},
measure(el) {
if (!el || !this.hasWindow) return null;
const rect = this.getRoundedBoundedClientRect(el); // Account for activator margin
if (this.attach !== false) {
const style = window.getComputedStyle(el);
rect.left = parseInt(style.marginLeft);
rect.top = parseInt(style.marginTop);
}
return rect;
},
sneakPeek(cb) {
requestAnimationFrame(() => {
const el = this.$refs.content;
if (!el || el.style.display !== 'none') {
cb();
return;
}
el.style.display = 'inline-block';
cb();
el.style.display = 'none';
});
},
startTransition() {
return new Promise(resolve => requestAnimationFrame(() => {
this.isContentActive = this.hasJustFocused = this.isActive;
resolve();
}));
},
updateDimensions() {
this.hasWindow = typeof window !== 'undefined';
this.checkActivatorFixed();
this.checkForPageYOffset();
this.pageWidth = document.documentElement.clientWidth;
const dimensions = {
activator: { ...this.dimensions.activator
},
content: { ...this.dimensions.content
}
}; // Activator should already be shown
if (!this.hasActivator || this.absolute) {
dimensions.activator = this.absolutePosition();
} else {
const activator = this.getActivator();
if (!activator) return;
dimensions.activator = this.measure(activator);
dimensions.activator.offsetLeft = activator.offsetLeft;
if (this.attach !== false) {
// account for css padding causing things to not line up
// this is mostly for v-autocomplete, hopefully it won't break anything
dimensions.activator.offsetTop = activator.offsetTop;
} else {
dimensions.activator.offsetTop = 0;
}
} // Display and hide to get dimensions
this.sneakPeek(() => {
this.$refs.content && (dimensions.content = this.measure(this.$refs.content));
this.dimensions = dimensions;
});
}
}
});
//# sourceMappingURL=index.js.map
File diff suppressed because one or more lines are too long
-46
View File
@@ -1,46 +0,0 @@
import { deprecate } from '../../util/console';
import Vue from 'vue';
/* @vue/component */
export default Vue.extend({
name: 'mobile',
props: {
mobileBreakpoint: {
type: [Number, String],
default() {
// Avoid destroying unit
// tests for users
return this.$vuetify ? this.$vuetify.breakpoint.mobileBreakpoint : undefined;
},
validator: v => !isNaN(Number(v)) || ['xs', 'sm', 'md', 'lg', 'xl'].includes(String(v))
}
},
computed: {
isMobile() {
const {
mobile,
width,
name,
mobileBreakpoint
} = this.$vuetify.breakpoint; // Check if local mobileBreakpoint matches
// the application's mobileBreakpoint
if (mobileBreakpoint === this.mobileBreakpoint) return mobile;
const mobileWidth = parseInt(this.mobileBreakpoint, 10);
const isNumber = !isNaN(mobileWidth);
return isNumber ? width < mobileWidth : name === this.mobileBreakpoint;
}
},
created() {
/* istanbul ignore next */
if (this.$attrs.hasOwnProperty('mobile-break-point')) {
deprecate('mobile-break-point', 'mobile-breakpoint', this);
}
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/mobile/index.ts"],"names":[],"mappings":"AAEA,SAAS,SAAT,QAA0B,oBAA1B;AACA,OAAO,GAAP,MAA8B,KAA9B;AAEA;;AACA,eAAe,GAAG,CAAC,MAAJ,CAAW;AACxB,EAAA,IAAI,EAAE,QADkB;AAGxB,EAAA,KAAK,EAAE;AACL,IAAA,gBAAgB,EAAE;AAChB,MAAA,IAAI,EAAE,CAAC,MAAD,EAAS,MAAT,CADU;;AAEhB,MAAA,OAAO,GAAA;AACL;AACA;AACA,eAAO,KAAK,QAAL,GACH,KAAK,QAAL,CAAc,UAAd,CAAyB,gBADtB,GAEH,SAFJ;AAGD,OARe;;AAShB,MAAA,SAAS,EAAE,CAAC,IACV,CAAC,KAAK,CAAC,MAAM,CAAC,CAAD,CAAP,CAAN,IACA,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,EAAyB,IAAzB,EAA+B,QAA/B,CAAwC,MAAM,CAAC,CAAD,CAA9C;AAXc;AADb,GAHiB;AAoBxB,EAAA,QAAQ,EAAE;AACR,IAAA,QAAQ,GAAA;AACN,YAAM;AACJ,QAAA,MADI;AAEJ,QAAA,KAFI;AAGJ,QAAA,IAHI;AAIJ,QAAA;AAJI,UAKF,KAAK,QAAL,CAAc,UALlB,CADM,CAQN;AACA;;AACA,UAAI,gBAAgB,KAAK,KAAK,gBAA9B,EAAgD,OAAO,MAAP;AAEhD,YAAM,WAAW,GAAG,QAAQ,CAAC,KAAK,gBAAN,EAAwB,EAAxB,CAA5B;AACA,YAAM,QAAQ,GAAG,CAAC,KAAK,CAAC,WAAD,CAAvB;AAEA,aAAO,QAAQ,GACX,KAAK,GAAG,WADG,GAEX,IAAI,KAAK,KAAK,gBAFlB;AAGD;;AAnBO,GApBc;;AA0CxB,EAAA,OAAO,GAAA;AACL;AACA,QAAI,KAAK,MAAL,CAAY,cAAZ,CAA2B,oBAA3B,CAAJ,EAAsD;AACpD,MAAA,SAAS,CAAC,oBAAD,EAAuB,mBAAvB,EAA4C,IAA5C,CAAT;AACD;AACF;;AA/CuB,CAAX,CAAf","sourcesContent":["// Types\nimport { BreakpointName } from 'vuetify/types/services/breakpoint'\nimport { deprecate } from '../../util/console'\nimport Vue, { PropType } from 'vue'\n\n/* @vue/component */\nexport default Vue.extend({\n name: 'mobile',\n\n props: {\n mobileBreakpoint: {\n type: [Number, String] as PropType<BreakpointName>,\n default (): BreakpointName | undefined {\n // Avoid destroying unit\n // tests for users\n return this.$vuetify\n ? this.$vuetify.breakpoint.mobileBreakpoint\n : undefined\n },\n validator: v => (\n !isNaN(Number(v)) ||\n ['xs', 'sm', 'md', 'lg', 'xl'].includes(String(v))\n ),\n },\n },\n\n computed: {\n isMobile (): boolean {\n const {\n mobile,\n width,\n name,\n mobileBreakpoint,\n } = this.$vuetify.breakpoint\n\n // Check if local mobileBreakpoint matches\n // the application's mobileBreakpoint\n if (mobileBreakpoint === this.mobileBreakpoint) return mobile\n\n const mobileWidth = parseInt(this.mobileBreakpoint, 10)\n const isNumber = !isNaN(mobileWidth)\n\n return isNumber\n ? width < mobileWidth\n : name === this.mobileBreakpoint\n },\n },\n\n created () {\n /* istanbul ignore next */\n if (this.$attrs.hasOwnProperty('mobile-break-point')) {\n deprecate('mobile-break-point', 'mobile-breakpoint', this)\n }\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-198
View File
@@ -1,198 +0,0 @@
// Components
import VOverlay from '../../components/VOverlay'; // Utilities
import { keyCodes, addOnceEventListener, addPassiveEventListener, getZIndex } from '../../util/helpers'; // Types
import Vue from 'vue';
/* @vue/component */
export default Vue.extend().extend({
name: 'overlayable',
props: {
hideOverlay: Boolean,
overlayColor: String,
overlayOpacity: [Number, String]
},
data() {
return {
animationFrame: 0,
overlay: null
};
},
watch: {
hideOverlay(value) {
if (!this.isActive) return;
if (value) this.removeOverlay();else this.genOverlay();
}
},
beforeDestroy() {
this.removeOverlay();
},
methods: {
createOverlay() {
const overlay = new VOverlay({
propsData: {
absolute: this.absolute,
value: false,
color: this.overlayColor,
opacity: this.overlayOpacity
}
});
overlay.$mount();
const parent = this.absolute ? this.$el.parentNode : document.querySelector('[data-app]');
parent && parent.insertBefore(overlay.$el, parent.firstChild);
this.overlay = overlay;
},
genOverlay() {
this.hideScroll();
if (this.hideOverlay) return;
if (!this.overlay) this.createOverlay();
this.animationFrame = requestAnimationFrame(() => {
if (!this.overlay) return;
if (this.activeZIndex !== undefined) {
this.overlay.zIndex = String(this.activeZIndex - 1);
} else if (this.$el) {
this.overlay.zIndex = getZIndex(this.$el);
}
this.overlay.value = true;
});
return true;
},
/** removeOverlay(false) will not restore the scollbar afterwards */
removeOverlay(showScroll = true) {
if (this.overlay) {
addOnceEventListener(this.overlay.$el, 'transitionend', () => {
if (!this.overlay || !this.overlay.$el || !this.overlay.$el.parentNode || this.overlay.value) return;
this.overlay.$el.parentNode.removeChild(this.overlay.$el);
this.overlay.$destroy();
this.overlay = null;
}); // Cancel animation frame in case
// overlay is removed before it
// has finished its animation
cancelAnimationFrame(this.animationFrame);
this.overlay.value = false;
}
showScroll && this.showScroll();
},
scrollListener(e) {
if (e.type === 'keydown') {
if (['INPUT', 'TEXTAREA', 'SELECT'].includes(e.target.tagName) || // https://github.com/vuetifyjs/vuetify/issues/4715
e.target.isContentEditable) return;
const up = [keyCodes.up, keyCodes.pageup];
const down = [keyCodes.down, keyCodes.pagedown];
if (up.includes(e.keyCode)) {
e.deltaY = -1;
} else if (down.includes(e.keyCode)) {
e.deltaY = 1;
} else {
return;
}
}
if (e.target === this.overlay || e.type !== 'keydown' && e.target === document.body || this.checkPath(e)) e.preventDefault();
},
hasScrollbar(el) {
if (!el || el.nodeType !== Node.ELEMENT_NODE) return false;
const style = window.getComputedStyle(el);
return ['auto', 'scroll'].includes(style.overflowY) && el.scrollHeight > el.clientHeight;
},
shouldScroll(el, delta) {
if (el.scrollTop === 0 && delta < 0) return true;
return el.scrollTop + el.clientHeight === el.scrollHeight && delta > 0;
},
isInside(el, parent) {
if (el === parent) {
return true;
} else if (el === null || el === document.body) {
return false;
} else {
return this.isInside(el.parentNode, parent);
}
},
checkPath(e) {
const path = e.path || this.composedPath(e);
const delta = e.deltaY;
if (e.type === 'keydown' && path[0] === document.body) {
const dialog = this.$refs.dialog; // getSelection returns null in firefox in some edge cases, can be ignored
const selected = window.getSelection().anchorNode;
if (dialog && this.hasScrollbar(dialog) && this.isInside(selected, dialog)) {
return this.shouldScroll(dialog, delta);
}
return true;
}
for (let index = 0; index < path.length; index++) {
const el = path[index];
if (el === document) return true;
if (el === document.documentElement) return true;
if (el === this.$refs.content) return true;
if (this.hasScrollbar(el)) return this.shouldScroll(el, delta);
}
return true;
},
/**
* Polyfill for Event.prototype.composedPath
*/
composedPath(e) {
if (e.composedPath) return e.composedPath();
const path = [];
let el = e.target;
while (el) {
path.push(el);
if (el.tagName === 'HTML') {
path.push(document);
path.push(window);
return path;
}
el = el.parentElement;
}
return path;
},
hideScroll() {
if (this.$vuetify.breakpoint.smAndDown) {
document.documentElement.classList.add('overflow-y-hidden');
} else {
addPassiveEventListener(window, 'wheel', this.scrollListener, {
passive: false
});
window.addEventListener('keydown', this.scrollListener);
}
},
showScroll() {
document.documentElement.classList.remove('overflow-y-hidden');
window.removeEventListener('wheel', this.scrollListener);
window.removeEventListener('keydown', this.scrollListener);
}
}
});
//# sourceMappingURL=index.js.map
File diff suppressed because one or more lines are too long
-32
View File
@@ -1,32 +0,0 @@
// Mixins
import Colorable from '../colorable'; // Utilities
import mixins from '../../util/mixins';
import { kebabCase } from '../../util/helpers';
/* @vue/component */
export default mixins(Colorable).extend({
methods: {
genPickerButton(prop, value, content, readonly = false, staticClass = '') {
const active = this[prop] === value;
const click = event => {
event.stopPropagation();
this.$emit(`update:${kebabCase(prop)}`, value);
};
return this.$createElement('div', {
staticClass: `v-picker__title__btn ${staticClass}`.trim(),
class: {
'v-picker__title__btn--active': active,
'v-picker__title__btn--readonly': readonly
},
on: active || readonly ? undefined : {
click
}
}, Array.isArray(content) ? content : [content]);
}
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/picker-button/index.ts"],"names":[],"mappings":"AAAA;AACA,OAAO,SAAP,MAAsB,cAAtB,C,CAEA;;AACA,OAAO,MAAP,MAAmB,mBAAnB;AACA,SAAS,SAAT,QAA0B,oBAA1B;AAKA;;AACA,eAAe,MAAM,CACnB,SADmB,CAAN,CAEb,MAFa,CAEN;AACP,EAAA,OAAO,EAAE;AACP,IAAA,eAAe,CACb,IADa,EAEb,KAFa,EAGb,OAHa,EAIb,QAAQ,GAAG,KAJE,EAKb,WAAW,GAAG,EALD,EAKG;AAEhB,YAAM,MAAM,GAAI,KAAa,IAAb,MAAuB,KAAvC;;AACA,YAAM,KAAK,GAAI,KAAD,IAAiB;AAC7B,QAAA,KAAK,CAAC,eAAN;AACA,aAAK,KAAL,CAAW,UAAU,SAAS,CAAC,IAAD,CAAM,EAApC,EAAwC,KAAxC;AACD,OAHD;;AAKA,aAAO,KAAK,cAAL,CAAoB,KAApB,EAA2B;AAChC,QAAA,WAAW,EAAE,wBAAwB,WAAW,EAAnC,CAAsC,IAAtC,EADmB;AAEhC,QAAA,KAAK,EAAE;AACL,0CAAgC,MAD3B;AAEL,4CAAkC;AAF7B,SAFyB;AAMhC,QAAA,EAAE,EAAG,MAAM,IAAI,QAAX,GAAuB,SAAvB,GAAmC;AAAE,UAAA;AAAF;AANP,OAA3B,EAOJ,KAAK,CAAC,OAAN,CAAc,OAAd,IAAyB,OAAzB,GAAmC,CAAC,OAAD,CAP/B,CAAP;AAQD;;AAtBM;AADF,CAFM,CAAf","sourcesContent":["// Mixins\nimport Colorable from '../colorable'\n\n// Utilities\nimport mixins from '../../util/mixins'\nimport { kebabCase } from '../../util/helpers'\n\n// Types\nimport { VNodeChildren } from 'vue'\n\n/* @vue/component */\nexport default mixins(\n Colorable\n).extend({\n methods: {\n genPickerButton (\n prop: string,\n value: any,\n content: VNodeChildren,\n readonly = false,\n staticClass = ''\n ) {\n const active = (this as any)[prop] === value\n const click = (event: Event) => {\n event.stopPropagation()\n this.$emit(`update:${kebabCase(prop)}`, value)\n }\n\n return this.$createElement('div', {\n staticClass: `v-picker__title__btn ${staticClass}`.trim(),\n class: {\n 'v-picker__title__btn--active': active,\n 'v-picker__title__btn--readonly': readonly,\n },\n on: (active || readonly) ? undefined : { click },\n }, Array.isArray(content) ? content : [content])\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-71
View File
@@ -1,71 +0,0 @@
// Components
import VPicker from '../../components/VPicker'; // Mixins
import Colorable from '../colorable';
import Elevatable from '../../mixins/elevatable';
import Themeable from '../themeable'; // Utils
import mixins from '../../util/mixins';
export default mixins(Colorable, Elevatable, Themeable
/* @vue/component */
).extend({
name: 'picker',
props: {
flat: Boolean,
fullWidth: Boolean,
headerColor: String,
landscape: Boolean,
noTitle: Boolean,
width: {
type: [Number, String],
default: 290
}
},
methods: {
genPickerTitle() {
return null;
},
genPickerBody() {
return null;
},
genPickerActionsSlot() {
return this.$scopedSlots.default ? this.$scopedSlots.default({
save: this.save,
cancel: this.cancel
}) : this.$slots.default;
},
genPicker(staticClass) {
const children = [];
if (!this.noTitle) {
const title = this.genPickerTitle();
title && children.push(title);
}
const body = this.genPickerBody();
body && children.push(body);
children.push(this.$createElement('template', {
slot: 'actions'
}, [this.genPickerActionsSlot()]));
return this.$createElement(VPicker, {
staticClass,
props: {
color: this.headerColor || this.color,
dark: this.dark,
elevation: this.elevation,
flat: this.flat,
fullWidth: this.fullWidth,
landscape: this.landscape,
light: this.light,
width: this.width,
noTitle: this.noTitle
}
}, children);
}
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/picker/index.ts"],"names":[],"mappings":"AAAA;AACA,OAAO,OAAP,MAAoB,0BAApB,C,CAEA;;AACA,OAAO,SAAP,MAAsB,cAAtB;AACA,OAAO,UAAP,MAAuB,yBAAvB;AACA,OAAO,SAAP,MAAsB,cAAtB,C,CAEA;;AACA,OAAO,MAAP,MAAmB,mBAAnB;AAKA,eAAe,MAAM,CACnB,SADmB,EAEnB,UAFmB,EAGnB;AACF;AAJqB,CAAN,CAKb,MALa,CAKN;AACP,EAAA,IAAI,EAAE,QADC;AAGP,EAAA,KAAK,EAAE;AACL,IAAA,IAAI,EAAE,OADD;AAEL,IAAA,SAAS,EAAE,OAFN;AAGL,IAAA,WAAW,EAAE,MAHR;AAIL,IAAA,SAAS,EAAE,OAJN;AAKL,IAAA,OAAO,EAAE,OALJ;AAML,IAAA,KAAK,EAAE;AACL,MAAA,IAAI,EAAE,CAAC,MAAD,EAAS,MAAT,CADD;AAEL,MAAA,OAAO,EAAE;AAFJ;AANF,GAHA;AAeP,EAAA,OAAO,EAAE;AACP,IAAA,cAAc,GAAA;AACZ,aAAO,IAAP;AACD,KAHM;;AAIP,IAAA,aAAa,GAAA;AACX,aAAO,IAAP;AACD,KANM;;AAOP,IAAA,oBAAoB,GAAA;AAClB,aAAO,KAAK,YAAL,CAAkB,OAAlB,GAA4B,KAAK,YAAL,CAAkB,OAAlB,CAA0B;AAC3D,QAAA,IAAI,EAAG,KAAa,IADuC;AAE3D,QAAA,MAAM,EAAG,KAAa;AAFqC,OAA1B,CAA5B,GAGF,KAAK,MAAL,CAAY,OAHjB;AAID,KAZM;;AAaP,IAAA,SAAS,CAAE,WAAF,EAAqB;AAC5B,YAAM,QAAQ,GAAY,EAA1B;;AAEA,UAAI,CAAC,KAAK,OAAV,EAAmB;AACjB,cAAM,KAAK,GAAG,KAAK,cAAL,EAAd;AACA,QAAA,KAAK,IAAI,QAAQ,CAAC,IAAT,CAAc,KAAd,CAAT;AACD;;AAED,YAAM,IAAI,GAAG,KAAK,aAAL,EAAb;AACA,MAAA,IAAI,IAAI,QAAQ,CAAC,IAAT,CAAc,IAAd,CAAR;AAEA,MAAA,QAAQ,CAAC,IAAT,CAAc,KAAK,cAAL,CAAoB,UAApB,EAAgC;AAAE,QAAA,IAAI,EAAE;AAAR,OAAhC,EAAqD,CAAC,KAAK,oBAAL,EAAD,CAArD,CAAd;AAEA,aAAO,KAAK,cAAL,CAAoB,OAApB,EAA6B;AAClC,QAAA,WADkC;AAElC,QAAA,KAAK,EAAE;AACL,UAAA,KAAK,EAAE,KAAK,WAAL,IAAoB,KAAK,KAD3B;AAEL,UAAA,IAAI,EAAE,KAAK,IAFN;AAGL,UAAA,SAAS,EAAE,KAAK,SAHX;AAIL,UAAA,IAAI,EAAE,KAAK,IAJN;AAKL,UAAA,SAAS,EAAE,KAAK,SALX;AAML,UAAA,SAAS,EAAE,KAAK,SANX;AAOL,UAAA,KAAK,EAAE,KAAK,KAPP;AAQL,UAAA,KAAK,EAAE,KAAK,KARP;AASL,UAAA,OAAO,EAAE,KAAK;AATT;AAF2B,OAA7B,EAaJ,QAbI,CAAP;AAcD;;AAxCM;AAfF,CALM,CAAf","sourcesContent":["// Components\nimport VPicker from '../../components/VPicker'\n\n// Mixins\nimport Colorable from '../colorable'\nimport Elevatable from '../../mixins/elevatable'\nimport Themeable from '../themeable'\n\n// Utils\nimport mixins from '../../util/mixins'\n\n// Types\nimport { VNode } from 'vue'\n\nexport default mixins(\n Colorable,\n Elevatable,\n Themeable\n/* @vue/component */\n).extend({\n name: 'picker',\n\n props: {\n flat: Boolean,\n fullWidth: Boolean,\n headerColor: String,\n landscape: Boolean,\n noTitle: Boolean,\n width: {\n type: [Number, String],\n default: 290,\n },\n },\n\n methods: {\n genPickerTitle (): VNode | null {\n return null\n },\n genPickerBody (): VNode | null {\n return null\n },\n genPickerActionsSlot () {\n return this.$scopedSlots.default ? this.$scopedSlots.default({\n save: (this as any).save,\n cancel: (this as any).cancel,\n }) : this.$slots.default\n },\n genPicker (staticClass: string) {\n const children: VNode[] = []\n\n if (!this.noTitle) {\n const title = this.genPickerTitle()\n title && children.push(title)\n }\n\n const body = this.genPickerBody()\n body && children.push(body)\n\n children.push(this.$createElement('template', { slot: 'actions' }, [this.genPickerActionsSlot()]))\n\n return this.$createElement(VPicker, {\n staticClass,\n props: {\n color: this.headerColor || this.color,\n dark: this.dark,\n elevation: this.elevation,\n flat: this.flat,\n fullWidth: this.fullWidth,\n landscape: this.landscape,\n light: this.light,\n width: this.width,\n noTitle: this.noTitle,\n },\n }, children)\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-45
View File
@@ -1,45 +0,0 @@
import Vue from 'vue';
import { filterObjectOnKeys } from '../../util/helpers';
const availableProps = {
absolute: Boolean,
bottom: Boolean,
fixed: Boolean,
left: Boolean,
right: Boolean,
top: Boolean
};
export function factory(selected = []) {
return Vue.extend({
name: 'positionable',
props: selected.length ? filterObjectOnKeys(availableProps, selected) : availableProps
});
}
export default factory(); // Add a `*` before the second `/`
/* Tests /
let single = factory(['top']).extend({
created () {
this.top
this.bottom
this.absolute
}
})
let some = factory(['top', 'bottom']).extend({
created () {
this.top
this.bottom
this.absolute
}
})
let all = factory().extend({
created () {
this.top
this.bottom
this.absolute
this.foobar
}
})
/**/
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/positionable/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAgB,KAAhB;AACA,SAAS,kBAAT,QAAmC,oBAAnC;AAGA,MAAM,cAAc,GAAG;AACrB,EAAA,QAAQ,EAAE,OADW;AAErB,EAAA,MAAM,EAAE,OAFa;AAGrB,EAAA,KAAK,EAAE,OAHc;AAIrB,EAAA,IAAI,EAAE,OAJe;AAKrB,EAAA,KAAK,EAAE,OALc;AAMrB,EAAA,GAAG,EAAE;AANgB,CAAvB;AAcA,OAAM,SAAU,OAAV,CAAmB,QAAA,GAAkB,EAArC,EAAuC;AAC3C,SAAO,GAAG,CAAC,MAAJ,CAAW;AAChB,IAAA,IAAI,EAAE,cADU;AAEhB,IAAA,KAAK,EAAE,QAAQ,CAAC,MAAT,GAAkB,kBAAkB,CAAC,cAAD,EAAiB,QAAjB,CAApC,GAAiE;AAFxD,GAAX,CAAP;AAID;AAED,eAAe,OAAO,EAAtB,C,CAEA;;AACA","sourcesContent":["import Vue from 'vue'\nimport { filterObjectOnKeys } from '../../util/helpers'\nimport { OptionsVue, VueConstructor } from 'vue/types/vue'\n\nconst availableProps = {\n absolute: Boolean,\n bottom: Boolean,\n fixed: Boolean,\n left: Boolean,\n right: Boolean,\n top: Boolean,\n}\ntype props = Record<keyof typeof availableProps, boolean>\n\nexport type Positionable<S extends keyof props> = VueConstructor<Vue & { [P in S]: boolean }, { [P in S]: BooleanConstructor }>\n\nexport function factory <S extends keyof props> (selected?: S[]): Positionable<S>\nexport function factory (selected: undefined): OptionsVue<Vue, {}, {}, {}, props, typeof availableProps>\nexport function factory (selected: any[] = []): any {\n return Vue.extend({\n name: 'positionable',\n props: selected.length ? filterObjectOnKeys(availableProps, selected) : availableProps,\n })\n}\n\nexport default factory()\n\n// Add a `*` before the second `/`\n/* Tests /\nlet single = factory(['top']).extend({\n created () {\n this.top\n this.bottom\n this.absolute\n }\n})\n\nlet some = factory(['top', 'bottom']).extend({\n created () {\n this.top\n this.bottom\n this.absolute\n }\n})\n\nlet all = factory().extend({\n created () {\n this.top\n this.bottom\n this.absolute\n this.foobar\n }\n})\n/**/\n"],"sourceRoot":"","file":"index.js"}
-47
View File
@@ -1,47 +0,0 @@
import Vue from 'vue';
export function factory(prop = 'value', event = 'change') {
return Vue.extend({
name: 'proxyable',
model: {
prop,
event
},
props: {
[prop]: {
required: false
}
},
data() {
return {
internalLazyValue: this[prop]
};
},
computed: {
internalValue: {
get() {
return this.internalLazyValue;
},
set(val) {
if (val === this.internalLazyValue) return;
this.internalLazyValue = val;
this.$emit(event, val);
}
}
},
watch: {
[prop](val) {
this.internalLazyValue = val;
}
}
});
}
/* eslint-disable-next-line no-redeclare */
const Proxyable = factory();
export default Proxyable;
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/proxyable/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAoC,KAApC;AASA,OAAM,SAAU,OAAV,CACJ,IAAI,GAAG,OADH,EAEJ,KAAK,GAAG,QAFJ,EAEY;AAEhB,SAAO,GAAG,CAAC,MAAJ,CAAW;AAChB,IAAA,IAAI,EAAE,WADU;AAGhB,IAAA,KAAK,EAAE;AACL,MAAA,IADK;AAEL,MAAA;AAFK,KAHS;AAQhB,IAAA,KAAK,EAAE;AACL,OAAC,IAAD,GAAQ;AACN,QAAA,QAAQ,EAAE;AADJ;AADH,KARS;;AAchB,IAAA,IAAI,GAAA;AACF,aAAO;AACL,QAAA,iBAAiB,EAAE,KAAK,IAAL;AADd,OAAP;AAGD,KAlBe;;AAoBhB,IAAA,QAAQ,EAAE;AACR,MAAA,aAAa,EAAE;AACb,QAAA,GAAG,GAAA;AACD,iBAAO,KAAK,iBAAZ;AACD,SAHY;;AAIb,QAAA,GAAG,CAAE,GAAF,EAAU;AACX,cAAI,GAAG,KAAK,KAAK,iBAAjB,EAAoC;AAEpC,eAAK,iBAAL,GAAyB,GAAzB;AAEA,eAAK,KAAL,CAAW,KAAX,EAAkB,GAAlB;AACD;;AAVY;AADP,KApBM;AAmChB,IAAA,KAAK,EAAE;AACL,OAAC,IAAD,EAAQ,GAAR,EAAW;AACT,aAAK,iBAAL,GAAyB,GAAzB;AACD;;AAHI;AAnCS,GAAX,CAAP;AAyCD;AAED;;AACA,MAAM,SAAS,GAAG,OAAO,EAAzB;AAEA,eAAe,SAAf","sourcesContent":["import Vue, { VueConstructor } from 'vue'\n\n/* eslint-disable-next-line no-use-before-define */\nexport type Proxyable<T extends string = 'value'> = VueConstructor<Vue & {\n internalLazyValue: unknown\n internalValue: unknown\n} & Record<T, any>>\n\nexport function factory<T extends string = 'value'> (prop?: T, event?: string): Proxyable<T>\nexport function factory (\n prop = 'value',\n event = 'change'\n) {\n return Vue.extend({\n name: 'proxyable',\n\n model: {\n prop,\n event,\n },\n\n props: {\n [prop]: {\n required: false,\n },\n },\n\n data () {\n return {\n internalLazyValue: this[prop] as unknown,\n }\n },\n\n computed: {\n internalValue: {\n get (): unknown {\n return this.internalLazyValue\n },\n set (val: any) {\n if (val === this.internalLazyValue) return\n\n this.internalLazyValue = val\n\n this.$emit(event, val)\n },\n },\n },\n\n watch: {\n [prop] (val) {\n this.internalLazyValue = val\n },\n },\n })\n}\n\n/* eslint-disable-next-line no-redeclare */\nconst Proxyable = factory()\n\nexport default Proxyable\n"],"sourceRoot":"","file":"index.js"}
-41
View File
@@ -1,41 +0,0 @@
import Vue from 'vue';
import { consoleWarn } from '../../util/console';
function generateWarning(child, parent) {
return () => consoleWarn(`The ${child} component must be used inside a ${parent}`);
}
export function inject(namespace, child, parent) {
const defaultImpl = child && parent ? {
register: generateWarning(child, parent),
unregister: generateWarning(child, parent)
} : null;
return Vue.extend({
name: 'registrable-inject',
inject: {
[namespace]: {
default: defaultImpl
}
}
});
}
export function provide(namespace, self = false) {
return Vue.extend({
name: 'registrable-provide',
methods: self ? {} : {
register: null,
unregister: null
},
provide() {
return {
[namespace]: self ? this : {
register: this.register,
unregister: this.unregister
}
};
}
});
}
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/registrable/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAgB,KAAhB;AAEA,SAAS,WAAT,QAA4B,oBAA5B;;AAEA,SAAS,eAAT,CAA0B,KAA1B,EAAyC,MAAzC,EAAuD;AACrD,SAAO,MAAM,WAAW,CAAC,OAAO,KAAK,oCAAoC,MAAM,EAAvD,CAAxB;AACD;;AASD,OAAM,SAAU,MAAV,CAEH,SAFG,EAEW,KAFX,EAE2B,MAF3B,EAE0C;AAC9C,QAAM,WAAW,GAAG,KAAK,IAAI,MAAT,GAAkB;AACpC,IAAA,QAAQ,EAAE,eAAe,CAAC,KAAD,EAAQ,MAAR,CADW;AAEpC,IAAA,UAAU,EAAE,eAAe,CAAC,KAAD,EAAQ,MAAR;AAFS,GAAlB,GAGhB,IAHJ;AAKA,SAAO,GAAG,CAAC,MAAJ,CAAW;AAChB,IAAA,IAAI,EAAE,oBADU;AAGhB,IAAA,MAAM,EAAE;AACN,OAAC,SAAD,GAAa;AACX,QAAA,OAAO,EAAE;AADE;AADP;AAHQ,GAAX,CAAP;AASD;AAED,OAAM,SAAU,OAAV,CAAmB,SAAnB,EAAsC,IAAI,GAAG,KAA7C,EAAkD;AACtD,SAAO,GAAG,CAAC,MAAJ,CAAW;AAChB,IAAA,IAAI,EAAE,qBADU;AAGhB,IAAA,OAAO,EAAE,IAAI,GAAG,EAAH,GAAQ;AACnB,MAAA,QAAQ,EAAE,IADS;AAEnB,MAAA,UAAU,EAAE;AAFO,KAHL;;AAOhB,IAAA,OAAO,GAAA;AACL,aAAO;AACL,SAAC,SAAD,GAAa,IAAI,GAAG,IAAH,GAAU;AACzB,UAAA,QAAQ,EAAE,KAAK,QADU;AAEzB,UAAA,UAAU,EAAE,KAAK;AAFQ;AADtB,OAAP;AAMD;;AAde,GAAX,CAAP;AAgBD","sourcesContent":["import Vue from 'vue'\nimport { VueConstructor } from 'vue/types/vue'\nimport { consoleWarn } from '../../util/console'\n\nfunction generateWarning (child: string, parent: string) {\n return () => consoleWarn(`The ${child} component must be used inside a ${parent}`)\n}\n\nexport type Registrable<T extends string, C extends VueConstructor | null = null> = VueConstructor<Vue & {\n [K in T]: C extends VueConstructor ? InstanceType<C> : {\n register (...props: any[]): void\n unregister (self: any): void\n }\n}>\n\nexport function inject<\n T extends string, C extends VueConstructor | null = null\n> (namespace: T, child?: string, parent?: string): Registrable<T, C> {\n const defaultImpl = child && parent ? {\n register: generateWarning(child, parent),\n unregister: generateWarning(child, parent),\n } : null\n\n return Vue.extend({\n name: 'registrable-inject',\n\n inject: {\n [namespace]: {\n default: defaultImpl,\n },\n },\n })\n}\n\nexport function provide (namespace: string, self = false) {\n return Vue.extend({\n name: 'registrable-provide',\n\n methods: self ? {} : {\n register: null,\n unregister: null,\n },\n provide (): object {\n return {\n [namespace]: self ? this : {\n register: this.register,\n unregister: this.unregister,\n },\n }\n },\n })\n}\n"],"sourceRoot":"","file":"index.js"}
-33
View File
@@ -1,33 +0,0 @@
import Vue from 'vue';
/* @vue/component */
export default Vue.extend({
name: 'returnable',
props: {
returnValue: null
},
data: () => ({
isActive: false,
originalValue: null
}),
watch: {
isActive(val) {
if (val) {
this.originalValue = this.returnValue;
} else {
this.$emit('update:return-value', this.originalValue);
}
}
},
methods: {
save(value) {
this.originalValue = value;
setTimeout(() => {
this.isActive = false;
});
}
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/returnable/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAgB,KAAhB;AAEA;;AACA,eAAe,GAAG,CAAC,MAAJ,CAAW;AACxB,EAAA,IAAI,EAAE,YADkB;AAGxB,EAAA,KAAK,EAAE;AACL,IAAA,WAAW,EAAE;AADR,GAHiB;AAOxB,EAAA,IAAI,EAAE,OAAO;AACX,IAAA,QAAQ,EAAE,KADC;AAEX,IAAA,aAAa,EAAE;AAFJ,GAAP,CAPkB;AAYxB,EAAA,KAAK,EAAE;AACL,IAAA,QAAQ,CAAE,GAAF,EAAK;AACX,UAAI,GAAJ,EAAS;AACP,aAAK,aAAL,GAAqB,KAAK,WAA1B;AACD,OAFD,MAEO;AACL,aAAK,KAAL,CAAW,qBAAX,EAAkC,KAAK,aAAvC;AACD;AACF;;AAPI,GAZiB;AAsBxB,EAAA,OAAO,EAAE;AACP,IAAA,IAAI,CAAE,KAAF,EAAY;AACd,WAAK,aAAL,GAAqB,KAArB;AACA,MAAA,UAAU,CAAC,MAAK;AACd,aAAK,QAAL,GAAgB,KAAhB;AACD,OAFS,CAAV;AAGD;;AANM;AAtBe,CAAX,CAAf","sourcesContent":["import Vue from 'vue'\n\n/* @vue/component */\nexport default Vue.extend({\n name: 'returnable',\n\n props: {\n returnValue: null as any,\n },\n\n data: () => ({\n isActive: false,\n originalValue: null as any,\n }),\n\n watch: {\n isActive (val) {\n if (val) {\n this.originalValue = this.returnValue\n } else {\n this.$emit('update:return-value', this.originalValue)\n }\n },\n },\n\n methods: {\n save (value: any) {\n this.originalValue = value\n setTimeout(() => {\n this.isActive = false\n })\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-37
View File
@@ -1,37 +0,0 @@
// Directives
import ripple from '../../directives/ripple'; // Types
import Vue from 'vue';
export default Vue.extend({
name: 'rippleable',
directives: {
ripple
},
props: {
ripple: {
type: [Boolean, Object],
default: true
}
},
methods: {
genRipple(data = {}) {
if (!this.ripple) return null;
data.staticClass = 'v-input--selection-controls__ripple';
data.directives = data.directives || [];
data.directives.push({
name: 'ripple',
value: {
center: true
}
});
data.on = Object.assign({
click: this.onChange
}, this.$listeners);
return this.$createElement('div', data);
},
onChange() {}
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/rippleable/index.ts"],"names":[],"mappings":"AAAA;AACA,OAAO,MAAP,MAAmB,yBAAnB,C,CAEA;;AACA,OAAO,GAAP,MAAsD,KAAtD;AAEA,eAAe,GAAG,CAAC,MAAJ,CAAW;AACxB,EAAA,IAAI,EAAE,YADkB;AAGxB,EAAA,UAAU,EAAE;AAAE,IAAA;AAAF,GAHY;AAKxB,EAAA,KAAK,EAAE;AACL,IAAA,MAAM,EAAE;AACN,MAAA,IAAI,EAAE,CAAC,OAAD,EAAU,MAAV,CADA;AAEN,MAAA,OAAO,EAAE;AAFH;AADH,GALiB;AAYxB,EAAA,OAAO,EAAE;AACP,IAAA,SAAS,CAAE,IAAA,GAAkB,EAApB,EAAsB;AAC7B,UAAI,CAAC,KAAK,MAAV,EAAkB,OAAO,IAAP;AAElB,MAAA,IAAI,CAAC,WAAL,GAAmB,qCAAnB;AAEA,MAAA,IAAI,CAAC,UAAL,GAAkB,IAAI,CAAC,UAAL,IAAmB,EAArC;AACA,MAAA,IAAI,CAAC,UAAL,CAAgB,IAAhB,CAAqB;AACnB,QAAA,IAAI,EAAE,QADa;AAEnB,QAAA,KAAK,EAAE;AAAE,UAAA,MAAM,EAAE;AAAV;AAFY,OAArB;AAIA,MAAA,IAAI,CAAC,EAAL,GAAU,MAAM,CAAC,MAAP,CAAc;AACtB,QAAA,KAAK,EAAE,KAAK;AADU,OAAd,EAEP,KAAK,UAFE,CAAV;AAIA,aAAO,KAAK,cAAL,CAAoB,KAApB,EAA2B,IAA3B,CAAP;AACD,KAhBM;;AAiBP,IAAA,QAAQ,GAAA,CAAM;;AAjBP;AAZe,CAAX,CAAf","sourcesContent":["// Directives\nimport ripple from '../../directives/ripple'\n\n// Types\nimport Vue, { VNode, VNodeData, VNodeDirective } from 'vue'\n\nexport default Vue.extend({\n name: 'rippleable',\n\n directives: { ripple },\n\n props: {\n ripple: {\n type: [Boolean, Object],\n default: true,\n },\n },\n\n methods: {\n genRipple (data: VNodeData = {}): VNode | null {\n if (!this.ripple) return null\n\n data.staticClass = 'v-input--selection-controls__ripple'\n\n data.directives = data.directives || []\n data.directives.push({\n name: 'ripple',\n value: { center: true },\n } as VNodeDirective)\n data.on = Object.assign({\n click: this.onChange,\n }, this.$listeners)\n\n return this.$createElement('div', data)\n },\n onChange () {},\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-34
View File
@@ -1,34 +0,0 @@
import Vue from 'vue';
/* @vue/component */
export default Vue.extend({
name: 'roundable',
props: {
rounded: [Boolean, String],
tile: Boolean
},
computed: {
roundedClasses() {
const composite = [];
const rounded = typeof this.rounded === 'string' ? String(this.rounded) : this.rounded === true;
if (this.tile) {
composite.push('rounded-0');
} else if (typeof rounded === 'string') {
const values = rounded.split(' ');
for (const value of values) {
composite.push(`rounded-${value}`);
}
} else if (rounded) {
composite.push('rounded');
}
return composite.length > 0 ? {
[composite.join(' ')]: true
} : {};
}
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/roundable/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAgB,KAAhB;AAEA;;AACA,eAAe,GAAG,CAAC,MAAJ,CAAW;AACxB,EAAA,IAAI,EAAE,WADkB;AAGxB,EAAA,KAAK,EAAE;AACL,IAAA,OAAO,EAAE,CAAC,OAAD,EAAU,MAAV,CADJ;AAEL,IAAA,IAAI,EAAE;AAFD,GAHiB;AAQxB,EAAA,QAAQ,EAAE;AACR,IAAA,cAAc,GAAA;AACZ,YAAM,SAAS,GAAG,EAAlB;AACA,YAAM,OAAO,GAAG,OAAO,KAAK,OAAZ,KAAwB,QAAxB,GACZ,MAAM,CAAC,KAAK,OAAN,CADM,GAEZ,KAAK,OAAL,KAAiB,IAFrB;;AAIA,UAAI,KAAK,IAAT,EAAe;AACb,QAAA,SAAS,CAAC,IAAV,CAAe,WAAf;AACD,OAFD,MAEO,IAAI,OAAO,OAAP,KAAmB,QAAvB,EAAiC;AACtC,cAAM,MAAM,GAAG,OAAO,CAAC,KAAR,CAAc,GAAd,CAAf;;AAEA,aAAK,MAAM,KAAX,IAAoB,MAApB,EAA4B;AAC1B,UAAA,SAAS,CAAC,IAAV,CAAe,WAAW,KAAK,EAA/B;AACD;AACF,OANM,MAMA,IAAI,OAAJ,EAAa;AAClB,QAAA,SAAS,CAAC,IAAV,CAAe,SAAf;AACD;;AAED,aAAO,SAAS,CAAC,MAAV,GAAmB,CAAnB,GAAuB;AAC5B,SAAC,SAAS,CAAC,IAAV,CAAe,GAAf,CAAD,GAAuB;AADK,OAAvB,GAEH,EAFJ;AAGD;;AAtBO;AARc,CAAX,CAAf","sourcesContent":["import Vue from 'vue'\n\n/* @vue/component */\nexport default Vue.extend({\n name: 'roundable',\n\n props: {\n rounded: [Boolean, String],\n tile: Boolean,\n },\n\n computed: {\n roundedClasses (): Record<string, boolean> {\n const composite = []\n const rounded = typeof this.rounded === 'string'\n ? String(this.rounded)\n : this.rounded === true\n\n if (this.tile) {\n composite.push('rounded-0')\n } else if (typeof rounded === 'string') {\n const values = rounded.split(' ')\n\n for (const value of values) {\n composite.push(`rounded-${value}`)\n }\n } else if (rounded) {\n composite.push('rounded')\n }\n\n return composite.length > 0 ? {\n [composite.join(' ')]: true,\n } : {}\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-139
View File
@@ -1,139 +0,0 @@
import Vue from 'vue'; // Directives
import Ripple from '../../directives/ripple'; // Utilities
import { getObjectValueByPath } from '../../util/helpers';
export default Vue.extend({
name: 'routable',
directives: {
Ripple
},
props: {
activeClass: String,
append: Boolean,
disabled: Boolean,
exact: {
type: Boolean,
default: undefined
},
exactActiveClass: String,
link: Boolean,
href: [String, Object],
to: [String, Object],
nuxt: Boolean,
replace: Boolean,
ripple: {
type: [Boolean, Object],
default: null
},
tag: String,
target: String
},
data: () => ({
isActive: false,
proxyClass: ''
}),
computed: {
classes() {
const classes = {};
if (this.to) return classes;
if (this.activeClass) classes[this.activeClass] = this.isActive;
if (this.proxyClass) classes[this.proxyClass] = this.isActive;
return classes;
},
computedRipple() {
return this.ripple != null ? this.ripple : !this.disabled && this.isClickable;
},
isClickable() {
if (this.disabled) return false;
return Boolean(this.isLink || this.$listeners.click || this.$listeners['!click'] || this.$attrs.tabindex);
},
isLink() {
return this.to || this.href || this.link;
},
styles: () => ({})
},
watch: {
$route: 'onRouteChange'
},
methods: {
click(e) {
this.$emit('click', e);
},
generateRouteLink() {
let exact = this.exact;
let tag;
const data = {
attrs: {
tabindex: 'tabindex' in this.$attrs ? this.$attrs.tabindex : undefined
},
class: this.classes,
style: this.styles,
props: {},
directives: [{
name: 'ripple',
value: this.computedRipple
}],
[this.to ? 'nativeOn' : 'on']: { ...this.$listeners,
click: this.click
},
ref: 'link'
};
if (typeof this.exact === 'undefined') {
exact = this.to === '/' || this.to === Object(this.to) && this.to.path === '/';
}
if (this.to) {
// Add a special activeClass hook
// for component level styles
let activeClass = this.activeClass;
let exactActiveClass = this.exactActiveClass || activeClass;
if (this.proxyClass) {
activeClass = `${activeClass} ${this.proxyClass}`.trim();
exactActiveClass = `${exactActiveClass} ${this.proxyClass}`.trim();
}
tag = this.nuxt ? 'nuxt-link' : 'router-link';
Object.assign(data.props, {
to: this.to,
exact,
activeClass,
exactActiveClass,
append: this.append,
replace: this.replace
});
} else {
tag = this.href && 'a' || this.tag || 'div';
if (tag === 'a' && this.href) data.attrs.href = this.href;
}
if (this.target) data.attrs.target = this.target;
return {
tag,
data
};
},
onRouteChange() {
if (!this.to || !this.$refs.link || !this.$route) return;
const activeClass = `${this.activeClass} ${this.proxyClass || ''}`.trim();
const path = `_vnode.data.class.${activeClass}`;
this.$nextTick(() => {
/* istanbul ignore else */
if (getObjectValueByPath(this.$refs.link, path)) {
this.toggle();
}
});
},
toggle: () => {}
}
});
//# sourceMappingURL=index.js.map
File diff suppressed because one or more lines are too long
-97
View File
@@ -1,97 +0,0 @@
// Directives
import { Scroll } from '../../directives'; // Utilities
import { consoleWarn } from '../../util/console'; // Types
import Vue from 'vue';
/**
* Scrollable
*
* Used for monitoring scrolling and
* invoking functions based upon
* scrolling thresholds being
* met.
*/
/* @vue/component */
export default Vue.extend({
name: 'scrollable',
directives: {
Scroll
},
props: {
scrollTarget: String,
scrollThreshold: [String, Number]
},
data: () => ({
currentScroll: 0,
currentThreshold: 0,
isActive: false,
isScrollingUp: false,
previousScroll: 0,
savedScroll: 0,
target: null
}),
computed: {
/**
* A computed property that returns
* whether scrolling features are
* enabled or disabled
*/
canScroll() {
return typeof window !== 'undefined';
},
/**
* The threshold that must be met before
* thresholdMet function is invoked
*/
computedScrollThreshold() {
return this.scrollThreshold ? Number(this.scrollThreshold) : 300;
}
},
watch: {
isScrollingUp() {
this.savedScroll = this.savedScroll || this.currentScroll;
},
isActive() {
this.savedScroll = 0;
}
},
mounted() {
if (this.scrollTarget) {
this.target = document.querySelector(this.scrollTarget);
if (!this.target) {
consoleWarn(`Unable to locate element with identifier ${this.scrollTarget}`, this);
}
}
},
methods: {
onScroll() {
if (!this.canScroll) return;
this.previousScroll = this.currentScroll;
this.currentScroll = this.target ? this.target.scrollTop : window.pageYOffset;
this.isScrollingUp = this.currentScroll < this.previousScroll;
this.currentThreshold = Math.abs(this.currentScroll - this.computedScrollThreshold);
this.$nextTick(() => {
if (Math.abs(this.currentScroll - this.savedScroll) > this.computedScrollThreshold) this.thresholdMet();
});
},
/**
* The method invoked when
* scrolling in any direction
* has exceeded the threshold
*/
thresholdMet() {}
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/scrollable/index.ts"],"names":[],"mappings":"AAAA;AACA,SAAS,MAAT,QAAuB,kBAAvB,C,CAEA;;AACA,SAAS,WAAT,QAA4B,oBAA5B,C,CAEA;;AACA,OAAO,GAAP,MAAgB,KAAhB;AAEA;;;;;;;;;AAQA;;AACA,eAAe,GAAG,CAAC,MAAJ,CAAW;AACxB,EAAA,IAAI,EAAE,YADkB;AAGxB,EAAA,UAAU,EAAE;AAAE,IAAA;AAAF,GAHY;AAKxB,EAAA,KAAK,EAAE;AACL,IAAA,YAAY,EAAE,MADT;AAEL,IAAA,eAAe,EAAE,CAAC,MAAD,EAAS,MAAT;AAFZ,GALiB;AAUxB,EAAA,IAAI,EAAE,OAAO;AACX,IAAA,aAAa,EAAE,CADJ;AAEX,IAAA,gBAAgB,EAAE,CAFP;AAGX,IAAA,QAAQ,EAAE,KAHC;AAIX,IAAA,aAAa,EAAE,KAJJ;AAKX,IAAA,cAAc,EAAE,CALL;AAMX,IAAA,WAAW,EAAE,CANF;AAOX,IAAA,MAAM,EAAE;AAPG,GAAP,CAVkB;AAoBxB,EAAA,QAAQ,EAAE;AACR;;;;;AAKA,IAAA,SAAS,GAAA;AACP,aAAO,OAAO,MAAP,KAAkB,WAAzB;AACD,KARO;;AASR;;;;AAIA,IAAA,uBAAuB,GAAA;AACrB,aAAO,KAAK,eAAL,GACH,MAAM,CAAC,KAAK,eAAN,CADH,GAEH,GAFJ;AAGD;;AAjBO,GApBc;AAwCxB,EAAA,KAAK,EAAE;AACL,IAAA,aAAa,GAAA;AACX,WAAK,WAAL,GAAmB,KAAK,WAAL,IAAoB,KAAK,aAA5C;AACD,KAHI;;AAIL,IAAA,QAAQ,GAAA;AACN,WAAK,WAAL,GAAmB,CAAnB;AACD;;AANI,GAxCiB;;AAiDxB,EAAA,OAAO,GAAA;AACL,QAAI,KAAK,YAAT,EAAuB;AACrB,WAAK,MAAL,GAAc,QAAQ,CAAC,aAAT,CAAuB,KAAK,YAA5B,CAAd;;AAEA,UAAI,CAAC,KAAK,MAAV,EAAkB;AAChB,QAAA,WAAW,CAAC,4CAA4C,KAAK,YAAY,EAA9D,EAAkE,IAAlE,CAAX;AACD;AACF;AACF,GAzDuB;;AA2DxB,EAAA,OAAO,EAAE;AACP,IAAA,QAAQ,GAAA;AACN,UAAI,CAAC,KAAK,SAAV,EAAqB;AAErB,WAAK,cAAL,GAAsB,KAAK,aAA3B;AACA,WAAK,aAAL,GAAqB,KAAK,MAAL,GACjB,KAAK,MAAL,CAAY,SADK,GAEjB,MAAM,CAAC,WAFX;AAIA,WAAK,aAAL,GAAqB,KAAK,aAAL,GAAqB,KAAK,cAA/C;AACA,WAAK,gBAAL,GAAwB,IAAI,CAAC,GAAL,CAAS,KAAK,aAAL,GAAqB,KAAK,uBAAnC,CAAxB;AAEA,WAAK,SAAL,CAAe,MAAK;AAClB,YACE,IAAI,CAAC,GAAL,CAAS,KAAK,aAAL,GAAqB,KAAK,WAAnC,IACA,KAAK,uBAFP,EAGE,KAAK,YAAL;AACH,OALD;AAMD,KAlBM;;AAmBP;;;;;AAKA,IAAA,YAAY,GAAA,CAAkB;;AAxBvB;AA3De,CAAX,CAAf","sourcesContent":["// Directives\nimport { Scroll } from '../../directives'\n\n// Utilities\nimport { consoleWarn } from '../../util/console'\n\n// Types\nimport Vue from 'vue'\n\n/**\n * Scrollable\n *\n * Used for monitoring scrolling and\n * invoking functions based upon\n * scrolling thresholds being\n * met.\n */\n/* @vue/component */\nexport default Vue.extend({\n name: 'scrollable',\n\n directives: { Scroll },\n\n props: {\n scrollTarget: String,\n scrollThreshold: [String, Number],\n },\n\n data: () => ({\n currentScroll: 0,\n currentThreshold: 0,\n isActive: false,\n isScrollingUp: false,\n previousScroll: 0,\n savedScroll: 0,\n target: null as Element | null,\n }),\n\n computed: {\n /**\n * A computed property that returns\n * whether scrolling features are\n * enabled or disabled\n */\n canScroll (): boolean {\n return typeof window !== 'undefined'\n },\n /**\n * The threshold that must be met before\n * thresholdMet function is invoked\n */\n computedScrollThreshold (): number {\n return this.scrollThreshold\n ? Number(this.scrollThreshold)\n : 300\n },\n },\n\n watch: {\n isScrollingUp () {\n this.savedScroll = this.savedScroll || this.currentScroll\n },\n isActive () {\n this.savedScroll = 0\n },\n },\n\n mounted () {\n if (this.scrollTarget) {\n this.target = document.querySelector(this.scrollTarget)\n\n if (!this.target) {\n consoleWarn(`Unable to locate element with identifier ${this.scrollTarget}`, this)\n }\n }\n },\n\n methods: {\n onScroll () {\n if (!this.canScroll) return\n\n this.previousScroll = this.currentScroll\n this.currentScroll = this.target\n ? this.target.scrollTop\n : window.pageYOffset\n\n this.isScrollingUp = this.currentScroll < this.previousScroll\n this.currentThreshold = Math.abs(this.currentScroll - this.computedScrollThreshold)\n\n this.$nextTick(() => {\n if (\n Math.abs(this.currentScroll - this.savedScroll) >\n this.computedScrollThreshold\n ) this.thresholdMet()\n })\n },\n /**\n * The method invoked when\n * scrolling in any direction\n * has exceeded the threshold\n */\n thresholdMet () { /* noop */ },\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-160
View File
@@ -1,160 +0,0 @@
// Components
import VInput from '../../components/VInput'; // Mixins
import Rippleable from '../rippleable';
import Comparable from '../comparable'; // Utilities
import mixins from '../../util/mixins';
/* @vue/component */
export default mixins(VInput, Rippleable, Comparable).extend({
name: 'selectable',
model: {
prop: 'inputValue',
event: 'change'
},
props: {
id: String,
inputValue: null,
falseValue: null,
trueValue: null,
multiple: {
type: Boolean,
default: null
},
label: String
},
data() {
return {
hasColor: this.inputValue,
lazyValue: this.inputValue
};
},
computed: {
computedColor() {
if (!this.isActive) return undefined;
if (this.color) return this.color;
if (this.isDark && !this.appIsDark) return 'white';
return 'primary';
},
isMultiple() {
return this.multiple === true || this.multiple === null && Array.isArray(this.internalValue);
},
isActive() {
const value = this.value;
const input = this.internalValue;
if (this.isMultiple) {
if (!Array.isArray(input)) return false;
return input.some(item => this.valueComparator(item, value));
}
if (this.trueValue === undefined || this.falseValue === undefined) {
return value ? this.valueComparator(value, input) : Boolean(input);
}
return this.valueComparator(input, this.trueValue);
},
isDirty() {
return this.isActive;
},
rippleState() {
return !this.isDisabled && !this.validationState ? undefined : this.validationState;
}
},
watch: {
inputValue(val) {
this.lazyValue = val;
this.hasColor = val;
}
},
methods: {
genLabel() {
const label = VInput.options.methods.genLabel.call(this);
if (!label) return label;
label.data.on = {
click: e => {
// Prevent label from
// causing the input
// to focus
e.preventDefault();
this.onChange();
}
};
return label;
},
genInput(type, attrs) {
return this.$createElement('input', {
attrs: Object.assign({
'aria-checked': this.isActive.toString(),
disabled: this.isDisabled,
id: this.computedId,
role: type,
type
}, attrs),
domProps: {
value: this.value,
checked: this.isActive
},
on: {
blur: this.onBlur,
change: this.onChange,
focus: this.onFocus,
keydown: this.onKeydown
},
ref: 'input'
});
},
onBlur() {
this.isFocused = false;
},
onChange() {
if (!this.isInteractive) return;
const value = this.value;
let input = this.internalValue;
if (this.isMultiple) {
if (!Array.isArray(input)) {
input = [];
}
const length = input.length;
input = input.filter(item => !this.valueComparator(item, value));
if (input.length === length) {
input.push(value);
}
} else if (this.trueValue !== undefined && this.falseValue !== undefined) {
input = this.valueComparator(input, this.trueValue) ? this.falseValue : this.trueValue;
} else if (value) {
input = this.valueComparator(input, value) ? null : value;
} else {
input = !input;
}
this.validate(true, input);
this.internalValue = input;
this.hasColor = input;
},
onFocus() {
this.isFocused = true;
},
/** @abstract */
onKeydown(e) {}
}
});
//# sourceMappingURL=index.js.map
File diff suppressed because one or more lines are too long
-27
View File
@@ -1,27 +0,0 @@
import Vue from 'vue';
export default Vue.extend({
name: 'sizeable',
props: {
large: Boolean,
small: Boolean,
xLarge: Boolean,
xSmall: Boolean
},
computed: {
medium() {
return Boolean(!this.xSmall && !this.small && !this.large && !this.xLarge);
},
sizeableClasses() {
return {
'v-size--x-small': this.xSmall,
'v-size--small': this.small,
'v-size--default': this.medium,
'v-size--large': this.large,
'v-size--x-large': this.xLarge
};
}
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/sizeable/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAgB,KAAhB;AAEA,eAAe,GAAG,CAAC,MAAJ,CAAW;AACxB,EAAA,IAAI,EAAE,UADkB;AAGxB,EAAA,KAAK,EAAE;AACL,IAAA,KAAK,EAAE,OADF;AAEL,IAAA,KAAK,EAAE,OAFF;AAGL,IAAA,MAAM,EAAE,OAHH;AAIL,IAAA,MAAM,EAAE;AAJH,GAHiB;AAUxB,EAAA,QAAQ,EAAE;AACR,IAAA,MAAM,GAAA;AACJ,aAAO,OAAO,CACZ,CAAC,KAAK,MAAN,IACA,CAAC,KAAK,KADN,IAEA,CAAC,KAAK,KAFN,IAGA,CAAC,KAAK,MAJM,CAAd;AAMD,KARO;;AASR,IAAA,eAAe,GAAA;AACb,aAAO;AACL,2BAAmB,KAAK,MADnB;AAEL,yBAAiB,KAAK,KAFjB;AAGL,2BAAmB,KAAK,MAHnB;AAIL,yBAAiB,KAAK,KAJjB;AAKL,2BAAmB,KAAK;AALnB,OAAP;AAOD;;AAjBO;AAVc,CAAX,CAAf","sourcesContent":["import Vue from 'vue'\n\nexport default Vue.extend({\n name: 'sizeable',\n\n props: {\n large: Boolean,\n small: Boolean,\n xLarge: Boolean,\n xSmall: Boolean,\n },\n\n computed: {\n medium (): boolean {\n return Boolean(\n !this.xSmall &&\n !this.small &&\n !this.large &&\n !this.xLarge\n )\n },\n sizeableClasses (): object {\n return {\n 'v-size--x-small': this.xSmall,\n 'v-size--small': this.small,\n 'v-size--default': this.medium,\n 'v-size--large': this.large,\n 'v-size--x-large': this.xLarge,\n }\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-28
View File
@@ -1,28 +0,0 @@
import Vue from 'vue';
/**
* SSRBootable
*
* @mixin
*
* Used in layout components (drawer, toolbar, content)
* to avoid an entry animation when using SSR
*/
export default Vue.extend({
name: 'ssr-bootable',
data: () => ({
isBooted: false
}),
mounted() {
// Use setAttribute instead of dataset
// because dataset does not work well
// with unit tests
window.requestAnimationFrame(() => {
this.$el.setAttribute('data-booted', 'true');
this.isBooted = true;
});
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/ssr-bootable/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAgB,KAAhB;AAEA;;;;;;;;;AAQA,eAAe,GAAG,CAAC,MAAJ,CAAW;AACxB,EAAA,IAAI,EAAE,cADkB;AAGxB,EAAA,IAAI,EAAE,OAAO;AACX,IAAA,QAAQ,EAAE;AADC,GAAP,CAHkB;;AAOxB,EAAA,OAAO,GAAA;AACL;AACA;AACA;AACA,IAAA,MAAM,CAAC,qBAAP,CAA6B,MAAK;AAChC,WAAK,GAAL,CAAS,YAAT,CAAsB,aAAtB,EAAqC,MAArC;AACA,WAAK,QAAL,GAAgB,IAAhB;AACD,KAHD;AAID;;AAfuB,CAAX,CAAf","sourcesContent":["import Vue from 'vue'\n\n/**\n * SSRBootable\n *\n * @mixin\n *\n * Used in layout components (drawer, toolbar, content)\n * to avoid an entry animation when using SSR\n */\nexport default Vue.extend({\n name: 'ssr-bootable',\n\n data: () => ({\n isBooted: false,\n }),\n\n mounted () {\n // Use setAttribute instead of dataset\n // because dataset does not work well\n // with unit tests\n window.requestAnimationFrame(() => {\n this.$el.setAttribute('data-booted', 'true')\n this.isBooted = true\n })\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-52
View File
@@ -1,52 +0,0 @@
import Vue from 'vue';
import { getZIndex } from '../../util/helpers';
/* @vue/component */
export default Vue.extend().extend({
name: 'stackable',
data() {
return {
stackElement: null,
stackExclude: null,
stackMinZIndex: 0,
isActive: false
};
},
computed: {
activeZIndex() {
if (typeof window === 'undefined') return 0;
const content = this.stackElement || this.$refs.content; // Return current zindex if not active
const index = !this.isActive ? getZIndex(content) : this.getMaxZIndex(this.stackExclude || [content]) + 2;
if (index == null) return index; // Return max current z-index (excluding self) + 2
// (2 to leave room for an overlay below, if needed)
return parseInt(index);
}
},
methods: {
getMaxZIndex(exclude = []) {
const base = this.$el; // Start with lowest allowed z-index or z-index of
// base component's element, whichever is greater
const zis = [this.stackMinZIndex, getZIndex(base)]; // Convert the NodeList to an array to
// prevent an Edge bug with Symbol.iterator
// https://github.com/vuetifyjs/vuetify/issues/2146
const activeElements = [...document.getElementsByClassName('v-menu__content--active'), ...document.getElementsByClassName('v-dialog__content--active')]; // Get z-index for all active dialogs
for (let index = 0; index < activeElements.length; index++) {
if (!exclude.includes(activeElements[index])) {
zis.push(getZIndex(activeElements[index]));
}
}
return Math.max(...zis);
}
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/stackable/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAgB,KAAhB;AAEA,SAAS,SAAT,QAA0B,oBAA1B;AAQA;;AACA,eAAe,GAAG,CAAC,MAAJ,GAAsB,MAAtB,CAA6B;AAC1C,EAAA,IAAI,EAAE,WADoC;;AAG1C,EAAA,IAAI,GAAA;AACF,WAAO;AACL,MAAA,YAAY,EAAE,IADT;AAEL,MAAA,YAAY,EAAE,IAFT;AAGL,MAAA,cAAc,EAAE,CAHX;AAIL,MAAA,QAAQ,EAAE;AAJL,KAAP;AAMD,GAVyC;;AAW1C,EAAA,QAAQ,EAAE;AACR,IAAA,YAAY,GAAA;AACV,UAAI,OAAO,MAAP,KAAkB,WAAtB,EAAmC,OAAO,CAAP;AAEnC,YAAM,OAAO,GAAG,KAAK,YAAL,IAAqB,KAAK,KAAL,CAAW,OAAhD,CAHU,CAIV;;AAEA,YAAM,KAAK,GAAG,CAAC,KAAK,QAAN,GACV,SAAS,CAAC,OAAD,CADC,GAEV,KAAK,YAAL,CAAkB,KAAK,YAAL,IAAqB,CAAC,OAAD,CAAvC,IAAoD,CAFxD;AAIA,UAAI,KAAK,IAAI,IAAb,EAAmB,OAAO,KAAP,CAVT,CAYV;AACA;;AACA,aAAO,QAAQ,CAAC,KAAD,CAAf;AACD;;AAhBO,GAXgC;AA6B1C,EAAA,OAAO,EAAE;AACP,IAAA,YAAY,CAAE,OAAA,GAAqB,EAAvB,EAAyB;AACnC,YAAM,IAAI,GAAG,KAAK,GAAlB,CADmC,CAEnC;AACA;;AACA,YAAM,GAAG,GAAG,CAAC,KAAK,cAAN,EAAsB,SAAS,CAAC,IAAD,CAA/B,CAAZ,CAJmC,CAKnC;AACA;AACA;;AACA,YAAM,cAAc,GAAG,CACrB,GAAG,QAAQ,CAAC,sBAAT,CAAgC,yBAAhC,CADkB,EAErB,GAAG,QAAQ,CAAC,sBAAT,CAAgC,2BAAhC,CAFkB,CAAvB,CARmC,CAanC;;AACA,WAAK,IAAI,KAAK,GAAG,CAAjB,EAAoB,KAAK,GAAG,cAAc,CAAC,MAA3C,EAAmD,KAAK,EAAxD,EAA4D;AAC1D,YAAI,CAAC,OAAO,CAAC,QAAR,CAAiB,cAAc,CAAC,KAAD,CAA/B,CAAL,EAA8C;AAC5C,UAAA,GAAG,CAAC,IAAJ,CAAS,SAAS,CAAC,cAAc,CAAC,KAAD,CAAf,CAAlB;AACD;AACF;;AAED,aAAO,IAAI,CAAC,GAAL,CAAS,GAAG,GAAZ,CAAP;AACD;;AAtBM;AA7BiC,CAA7B,CAAf","sourcesContent":["import Vue from 'vue'\n\nimport { getZIndex } from '../../util/helpers'\n\ninterface options extends Vue {\n $refs: {\n content: Element\n }\n}\n\n/* @vue/component */\nexport default Vue.extend<options>().extend({\n name: 'stackable',\n\n data () {\n return {\n stackElement: null as Element | null,\n stackExclude: null as Element[] | null,\n stackMinZIndex: 0,\n isActive: false,\n }\n },\n computed: {\n activeZIndex (): number {\n if (typeof window === 'undefined') return 0\n\n const content = this.stackElement || this.$refs.content\n // Return current zindex if not active\n\n const index = !this.isActive\n ? getZIndex(content)\n : this.getMaxZIndex(this.stackExclude || [content]) + 2\n\n if (index == null) return index\n\n // Return max current z-index (excluding self) + 2\n // (2 to leave room for an overlay below, if needed)\n return parseInt(index)\n },\n },\n methods: {\n getMaxZIndex (exclude: Element[] = []) {\n const base = this.$el\n // Start with lowest allowed z-index or z-index of\n // base component's element, whichever is greater\n const zis = [this.stackMinZIndex, getZIndex(base)]\n // Convert the NodeList to an array to\n // prevent an Edge bug with Symbol.iterator\n // https://github.com/vuetifyjs/vuetify/issues/2146\n const activeElements = [\n ...document.getElementsByClassName('v-menu__content--active'),\n ...document.getElementsByClassName('v-dialog__content--active'),\n ]\n\n // Get z-index for all active dialogs\n for (let index = 0; index < activeElements.length; index++) {\n if (!exclude.includes(activeElements[index])) {\n zis.push(getZIndex(activeElements[index]))\n }\n }\n\n return Math.max(...zis)\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-108
View File
@@ -1,108 +0,0 @@
import Vue from 'vue';
export function functionalThemeClasses(context) {
const vm = { ...context.props,
...context.injections
};
const isDark = Themeable.options.computed.isDark.call(vm);
return Themeable.options.computed.themeClasses.call({
isDark
});
}
/* @vue/component */
const Themeable = Vue.extend().extend({
name: 'themeable',
provide() {
return {
theme: this.themeableProvide
};
},
inject: {
theme: {
default: {
isDark: false
}
}
},
props: {
dark: {
type: Boolean,
default: null
},
light: {
type: Boolean,
default: null
}
},
data() {
return {
themeableProvide: {
isDark: false
}
};
},
computed: {
appIsDark() {
return this.$vuetify.theme.dark || false;
},
isDark() {
if (this.dark === true) {
// explicitly dark
return true;
} else if (this.light === true) {
// explicitly light
return false;
} else {
// inherit from parent, or default false if there is none
return this.theme.isDark;
}
},
themeClasses() {
return {
'theme--dark': this.isDark,
'theme--light': !this.isDark
};
},
/** Used by menus and dialogs, inherits from v-app instead of the parent */
rootIsDark() {
if (this.dark === true) {
// explicitly dark
return true;
} else if (this.light === true) {
// explicitly light
return false;
} else {
// inherit from v-app
return this.appIsDark;
}
},
rootThemeClasses() {
return {
'theme--dark': this.rootIsDark,
'theme--light': !this.rootIsDark
};
}
},
watch: {
isDark: {
handler(newVal, oldVal) {
if (newVal !== oldVal) {
this.themeableProvide.isDark = this.isDark;
}
},
immediate: true
}
}
});
export default Themeable;
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/themeable/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAgB,KAAhB;AAUA,OAAM,SAAU,sBAAV,CAAkC,OAAlC,EAAwD;AAC5D,QAAM,EAAE,GAAG,EACT,GAAG,OAAO,CAAC,KADF;AAET,OAAG,OAAO,CAAC;AAFF,GAAX;AAIA,QAAM,MAAM,GAAG,SAAS,CAAC,OAAV,CAAkB,QAAlB,CAA2B,MAA3B,CAAkC,IAAlC,CAAuC,EAAvC,CAAf;AACA,SAAO,SAAS,CAAC,OAAV,CAAkB,QAAlB,CAA2B,YAA3B,CAAwC,IAAxC,CAA6C;AAAE,IAAA;AAAF,GAA7C,CAAP;AACD;AAED;;AACA,MAAM,SAAS,GAAG,GAAG,CAAC,MAAJ,GAAwB,MAAxB,CAA+B;AAC/C,EAAA,IAAI,EAAE,WADyC;;AAG/C,EAAA,OAAO,GAAA;AACL,WAAO;AACL,MAAA,KAAK,EAAE,KAAK;AADP,KAAP;AAGD,GAP8C;;AAS/C,EAAA,MAAM,EAAE;AACN,IAAA,KAAK,EAAE;AACL,MAAA,OAAO,EAAE;AACP,QAAA,MAAM,EAAE;AADD;AADJ;AADD,GATuC;AAiB/C,EAAA,KAAK,EAAE;AACL,IAAA,IAAI,EAAE;AACJ,MAAA,IAAI,EAAE,OADF;AAEJ,MAAA,OAAO,EAAE;AAFL,KADD;AAKL,IAAA,KAAK,EAAE;AACL,MAAA,IAAI,EAAE,OADD;AAEL,MAAA,OAAO,EAAE;AAFJ;AALF,GAjBwC;;AA4B/C,EAAA,IAAI,GAAA;AACF,WAAO;AACL,MAAA,gBAAgB,EAAE;AAChB,QAAA,MAAM,EAAE;AADQ;AADb,KAAP;AAKD,GAlC8C;;AAoC/C,EAAA,QAAQ,EAAE;AACR,IAAA,SAAS,GAAA;AACP,aAAO,KAAK,QAAL,CAAc,KAAd,CAAoB,IAApB,IAA4B,KAAnC;AACD,KAHO;;AAIR,IAAA,MAAM,GAAA;AACJ,UAAI,KAAK,IAAL,KAAc,IAAlB,EAAwB;AACtB;AACA,eAAO,IAAP;AACD,OAHD,MAGO,IAAI,KAAK,KAAL,KAAe,IAAnB,EAAyB;AAC9B;AACA,eAAO,KAAP;AACD,OAHM,MAGA;AACL;AACA,eAAO,KAAK,KAAL,CAAW,MAAlB;AACD;AACF,KAfO;;AAgBR,IAAA,YAAY,GAAA;AACV,aAAO;AACL,uBAAe,KAAK,MADf;AAEL,wBAAgB,CAAC,KAAK;AAFjB,OAAP;AAID,KArBO;;AAsBR;AACA,IAAA,UAAU,GAAA;AACR,UAAI,KAAK,IAAL,KAAc,IAAlB,EAAwB;AACtB;AACA,eAAO,IAAP;AACD,OAHD,MAGO,IAAI,KAAK,KAAL,KAAe,IAAnB,EAAyB;AAC9B;AACA,eAAO,KAAP;AACD,OAHM,MAGA;AACL;AACA,eAAO,KAAK,SAAZ;AACD;AACF,KAlCO;;AAmCR,IAAA,gBAAgB,GAAA;AACd,aAAO;AACL,uBAAe,KAAK,UADf;AAEL,wBAAgB,CAAC,KAAK;AAFjB,OAAP;AAID;;AAxCO,GApCqC;AA+E/C,EAAA,KAAK,EAAE;AACL,IAAA,MAAM,EAAE;AACN,MAAA,OAAO,CAAE,MAAF,EAAU,MAAV,EAAgB;AACrB,YAAI,MAAM,KAAK,MAAf,EAAuB;AACrB,eAAK,gBAAL,CAAsB,MAAtB,GAA+B,KAAK,MAApC;AACD;AACF,OALK;;AAMN,MAAA,SAAS,EAAE;AANL;AADH;AA/EwC,CAA/B,CAAlB;AA2FA,eAAe,SAAf","sourcesContent":["import Vue from 'vue'\nimport { PropType, RenderContext } from 'vue/types/options'\n\n/* eslint-disable-next-line no-use-before-define */\ninterface Themeable extends Vue {\n theme: {\n isDark: boolean\n }\n}\n\nexport function functionalThemeClasses (context: RenderContext): object {\n const vm = {\n ...context.props,\n ...context.injections,\n }\n const isDark = Themeable.options.computed.isDark.call(vm)\n return Themeable.options.computed.themeClasses.call({ isDark })\n}\n\n/* @vue/component */\nconst Themeable = Vue.extend<Themeable>().extend({\n name: 'themeable',\n\n provide (): object {\n return {\n theme: this.themeableProvide,\n }\n },\n\n inject: {\n theme: {\n default: {\n isDark: false,\n },\n },\n },\n\n props: {\n dark: {\n type: Boolean as PropType<boolean | null>,\n default: null,\n },\n light: {\n type: Boolean as PropType<boolean | null>,\n default: null,\n },\n },\n\n data () {\n return {\n themeableProvide: {\n isDark: false,\n },\n }\n },\n\n computed: {\n appIsDark (): boolean {\n return this.$vuetify.theme.dark || false\n },\n isDark (): boolean {\n if (this.dark === true) {\n // explicitly dark\n return true\n } else if (this.light === true) {\n // explicitly light\n return false\n } else {\n // inherit from parent, or default false if there is none\n return this.theme.isDark\n }\n },\n themeClasses (): object {\n return {\n 'theme--dark': this.isDark,\n 'theme--light': !this.isDark,\n }\n },\n /** Used by menus and dialogs, inherits from v-app instead of the parent */\n rootIsDark (): boolean {\n if (this.dark === true) {\n // explicitly dark\n return true\n } else if (this.light === true) {\n // explicitly light\n return false\n } else {\n // inherit from v-app\n return this.appIsDark\n }\n },\n rootThemeClasses (): Dictionary<boolean> {\n return {\n 'theme--dark': this.rootIsDark,\n 'theme--light': !this.rootIsDark,\n }\n },\n },\n\n watch: {\n isDark: {\n handler (newVal, oldVal) {\n if (newVal !== oldVal) {\n this.themeableProvide.isDark = this.isDark\n }\n },\n immediate: true,\n },\n },\n})\n\nexport default Themeable\n"],"sourceRoot":"","file":"index.js"}
-37
View File
@@ -1,37 +0,0 @@
import Vue from 'vue';
export function factory(prop = 'value', event = 'input') {
return Vue.extend({
name: 'toggleable',
model: {
prop,
event
},
props: {
[prop]: {
required: false
}
},
data() {
return {
isActive: !!this[prop]
};
},
watch: {
[prop](val) {
this.isActive = !!val;
},
isActive(val) {
!!val !== this[prop] && this.$emit(event, val);
}
}
});
}
/* eslint-disable-next-line no-redeclare */
const Toggleable = factory();
export default Toggleable;
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/toggleable/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAoC,KAApC;AAMA,OAAM,SAAU,OAAV,CAAmB,IAAI,GAAG,OAA1B,EAAmC,KAAK,GAAG,OAA3C,EAAkD;AACtD,SAAO,GAAG,CAAC,MAAJ,CAAW;AAChB,IAAA,IAAI,EAAE,YADU;AAGhB,IAAA,KAAK,EAAE;AAAE,MAAA,IAAF;AAAQ,MAAA;AAAR,KAHS;AAKhB,IAAA,KAAK,EAAE;AACL,OAAC,IAAD,GAAQ;AAAE,QAAA,QAAQ,EAAE;AAAZ;AADH,KALS;;AAShB,IAAA,IAAI,GAAA;AACF,aAAO;AACL,QAAA,QAAQ,EAAE,CAAC,CAAC,KAAK,IAAL;AADP,OAAP;AAGD,KAbe;;AAehB,IAAA,KAAK,EAAE;AACL,OAAC,IAAD,EAAQ,GAAR,EAAW;AACT,aAAK,QAAL,GAAgB,CAAC,CAAC,GAAlB;AACD,OAHI;;AAIL,MAAA,QAAQ,CAAE,GAAF,EAAK;AACX,SAAC,CAAC,GAAF,KAAU,KAAK,IAAL,CAAV,IAAwB,KAAK,KAAL,CAAW,KAAX,EAAkB,GAAlB,CAAxB;AACD;;AANI;AAfS,GAAX,CAAP;AAwBD;AAED;;AACA,MAAM,UAAU,GAAG,OAAO,EAA1B;AAEA,eAAe,UAAf","sourcesContent":["import Vue, { VueConstructor } from 'vue'\n\n/* eslint-disable-next-line no-use-before-define */\nexport type Toggleable<T extends string = 'value'> = VueConstructor<Vue & { isActive: boolean } & Record<T, any>>\n\nexport function factory<T extends string = 'value'> (prop?: T, event?: string): Toggleable<T>\nexport function factory (prop = 'value', event = 'input') {\n return Vue.extend({\n name: 'toggleable',\n\n model: { prop, event },\n\n props: {\n [prop]: { required: false },\n },\n\n data () {\n return {\n isActive: !!this[prop],\n }\n },\n\n watch: {\n [prop] (val) {\n this.isActive = !!val\n },\n isActive (val) {\n !!val !== this[prop] && this.$emit(event, val)\n },\n },\n })\n}\n\n/* eslint-disable-next-line no-redeclare */\nconst Toggleable = factory()\n\nexport default Toggleable\n"],"sourceRoot":"","file":"index.js"}
-10
View File
@@ -1,10 +0,0 @@
import Vue from 'vue';
export default Vue.extend({
name: 'transitionable',
props: {
mode: String,
origin: String,
transition: String
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/transitionable/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAgB,KAAhB;AAEA,eAAe,GAAG,CAAC,MAAJ,CAAW;AACxB,EAAA,IAAI,EAAE,gBADkB;AAGxB,EAAA,KAAK,EAAE;AACL,IAAA,IAAI,EAAE,MADD;AAEL,IAAA,MAAM,EAAE,MAFH;AAGL,IAAA,UAAU,EAAE;AAHP;AAHiB,CAAX,CAAf","sourcesContent":["import Vue from 'vue'\n\nexport default Vue.extend({\n name: 'transitionable',\n\n props: {\n mode: String,\n origin: String,\n transition: String,\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-56
View File
@@ -1,56 +0,0 @@
import Vue from 'vue';
export default Vue.extend({
name: 'translatable',
props: {
height: Number
},
data: () => ({
elOffsetTop: 0,
parallax: 0,
parallaxDist: 0,
percentScrolled: 0,
scrollTop: 0,
windowHeight: 0,
windowBottom: 0
}),
computed: {
imgHeight() {
return this.objHeight();
}
},
beforeDestroy() {
window.removeEventListener('scroll', this.translate, false);
window.removeEventListener('resize', this.translate, false);
},
methods: {
calcDimensions() {
const offset = this.$el.getBoundingClientRect();
this.scrollTop = window.pageYOffset;
this.parallaxDist = this.imgHeight - this.height;
this.elOffsetTop = offset.top + this.scrollTop;
this.windowHeight = window.innerHeight;
this.windowBottom = this.scrollTop + this.windowHeight;
},
listeners() {
window.addEventListener('scroll', this.translate, false);
window.addEventListener('resize', this.translate, false);
},
/** @abstract **/
objHeight() {
throw new Error('Not implemented !');
},
translate() {
this.calcDimensions();
this.percentScrolled = (this.windowBottom - this.elOffsetTop) / (parseInt(this.height) + this.windowHeight);
this.parallax = Math.round(this.parallaxDist * this.percentScrolled);
}
}
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/mixins/translatable/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAgB,KAAhB;AAEA,eAAe,GAAG,CAAC,MAAJ,CAAW;AACxB,EAAA,IAAI,EAAE,cADkB;AAGxB,EAAA,KAAK,EAAE;AACL,IAAA,MAAM,EAAE;AADH,GAHiB;AAOxB,EAAA,IAAI,EAAE,OAAO;AACX,IAAA,WAAW,EAAE,CADF;AAEX,IAAA,QAAQ,EAAE,CAFC;AAGX,IAAA,YAAY,EAAE,CAHH;AAIX,IAAA,eAAe,EAAE,CAJN;AAKX,IAAA,SAAS,EAAE,CALA;AAMX,IAAA,YAAY,EAAE,CANH;AAOX,IAAA,YAAY,EAAE;AAPH,GAAP,CAPkB;AAiBxB,EAAA,QAAQ,EAAE;AACR,IAAA,SAAS,GAAA;AACP,aAAO,KAAK,SAAL,EAAP;AACD;;AAHO,GAjBc;;AAuBxB,EAAA,aAAa,GAAA;AACX,IAAA,MAAM,CAAC,mBAAP,CAA2B,QAA3B,EAAqC,KAAK,SAA1C,EAAqD,KAArD;AACA,IAAA,MAAM,CAAC,mBAAP,CAA2B,QAA3B,EAAqC,KAAK,SAA1C,EAAqD,KAArD;AACD,GA1BuB;;AA4BxB,EAAA,OAAO,EAAE;AACP,IAAA,cAAc,GAAA;AACZ,YAAM,MAAM,GAAG,KAAK,GAAL,CAAS,qBAAT,EAAf;AAEA,WAAK,SAAL,GAAiB,MAAM,CAAC,WAAxB;AACA,WAAK,YAAL,GAAoB,KAAK,SAAL,GAAiB,KAAK,MAA1C;AACA,WAAK,WAAL,GAAmB,MAAM,CAAC,GAAP,GAAa,KAAK,SAArC;AACA,WAAK,YAAL,GAAoB,MAAM,CAAC,WAA3B;AACA,WAAK,YAAL,GAAoB,KAAK,SAAL,GAAiB,KAAK,YAA1C;AACD,KATM;;AAUP,IAAA,SAAS,GAAA;AACP,MAAA,MAAM,CAAC,gBAAP,CAAwB,QAAxB,EAAkC,KAAK,SAAvC,EAAkD,KAAlD;AACA,MAAA,MAAM,CAAC,gBAAP,CAAwB,QAAxB,EAAkC,KAAK,SAAvC,EAAkD,KAAlD;AACD,KAbM;;AAcP;AACA,IAAA,SAAS,GAAA;AACP,YAAM,IAAI,KAAJ,CAAU,mBAAV,CAAN;AACD,KAjBM;;AAkBP,IAAA,SAAS,GAAA;AACP,WAAK,cAAL;AAEA,WAAK,eAAL,GACE,CAAC,KAAK,YAAL,GAAoB,KAAK,WAA1B,KACC,QAAQ,CAAC,KAAK,MAAN,CAAR,GAAwB,KAAK,YAD9B,CADF;AAKA,WAAK,QAAL,GAAgB,IAAI,CAAC,KAAL,CAAW,KAAK,YAAL,GAAoB,KAAK,eAApC,CAAhB;AACD;;AA3BM;AA5Be,CAAX,CAAf","sourcesContent":["import Vue from 'vue'\n\nexport default Vue.extend({\n name: 'translatable',\n\n props: {\n height: Number,\n },\n\n data: () => ({\n elOffsetTop: 0,\n parallax: 0,\n parallaxDist: 0,\n percentScrolled: 0,\n scrollTop: 0,\n windowHeight: 0,\n windowBottom: 0,\n }),\n\n computed: {\n imgHeight (): number {\n return this.objHeight()\n },\n },\n\n beforeDestroy () {\n window.removeEventListener('scroll', this.translate, false)\n window.removeEventListener('resize', this.translate, false)\n },\n\n methods: {\n calcDimensions () {\n const offset = this.$el.getBoundingClientRect()\n\n this.scrollTop = window.pageYOffset\n this.parallaxDist = this.imgHeight - this.height\n this.elOffsetTop = offset.top + this.scrollTop\n this.windowHeight = window.innerHeight\n this.windowBottom = this.scrollTop + this.windowHeight\n },\n listeners () {\n window.addEventListener('scroll', this.translate, false)\n window.addEventListener('resize', this.translate, false)\n },\n /** @abstract **/\n objHeight (): number {\n throw new Error('Not implemented !')\n },\n translate () {\n this.calcDimensions()\n\n this.percentScrolled = (\n (this.windowBottom - this.elOffsetTop) /\n (parseInt(this.height) + this.windowHeight)\n )\n\n this.parallax = Math.round(this.parallaxDist * this.percentScrolled)\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"}
-259
View File
@@ -1,259 +0,0 @@
// Mixins
import Colorable from '../colorable';
import Themeable from '../themeable';
import { inject as RegistrableInject } from '../registrable'; // Utilities
import { deepEqual } from '../../util/helpers';
import { consoleError } from '../../util/console';
import mixins from '../../util/mixins';
const baseMixins = mixins(Colorable, RegistrableInject('form'), Themeable);
/* @vue/component */
export default baseMixins.extend({
name: 'validatable',
props: {
disabled: Boolean,
error: Boolean,
errorCount: {
type: [Number, String],
default: 1
},
errorMessages: {
type: [String, Array],
default: () => []
},
messages: {
type: [String, Array],
default: () => []
},
readonly: Boolean,
rules: {
type: Array,
default: () => []
},
success: Boolean,
successMessages: {
type: [String, Array],
default: () => []
},
validateOnBlur: Boolean,
value: {
required: false
}
},
data() {
return {
errorBucket: [],
hasColor: false,
hasFocused: false,
hasInput: false,
isFocused: false,
isResetting: false,
lazyValue: this.value,
valid: false
};
},
computed: {
computedColor() {
if (this.isDisabled) return undefined;
if (this.color) return this.color; // It's assumed that if the input is on a
// dark background, the user will want to
// have a white color. If the entire app
// is setup to be dark, then they will
// like want to use their primary color
if (this.isDark && !this.appIsDark) return 'white';else return 'primary';
},
hasError() {
return this.internalErrorMessages.length > 0 || this.errorBucket.length > 0 || this.error;
},
// TODO: Add logic that allows the user to enable based
// upon a good validation
hasSuccess() {
return this.internalSuccessMessages.length > 0 || this.success;
},
externalError() {
return this.internalErrorMessages.length > 0 || this.error;
},
hasMessages() {
return this.validationTarget.length > 0;
},
hasState() {
if (this.isDisabled) return false;
return this.hasSuccess || this.shouldValidate && this.hasError;
},
internalErrorMessages() {
return this.genInternalMessages(this.errorMessages);
},
internalMessages() {
return this.genInternalMessages(this.messages);
},
internalSuccessMessages() {
return this.genInternalMessages(this.successMessages);
},
internalValue: {
get() {
return this.lazyValue;
},
set(val) {
this.lazyValue = val;
this.$emit('input', val);
}
},
isDisabled() {
return this.disabled || !!this.form && this.form.disabled;
},
isInteractive() {
return !this.isDisabled && !this.isReadonly;
},
isReadonly() {
return this.readonly || !!this.form && this.form.readonly;
},
shouldValidate() {
if (this.externalError) return true;
if (this.isResetting) return false;
return this.validateOnBlur ? this.hasFocused && !this.isFocused : this.hasInput || this.hasFocused;
},
validations() {
return this.validationTarget.slice(0, Number(this.errorCount));
},
validationState() {
if (this.isDisabled) return undefined;
if (this.hasError && this.shouldValidate) return 'error';
if (this.hasSuccess) return 'success';
if (this.hasColor) return this.computedColor;
return undefined;
},
validationTarget() {
if (this.internalErrorMessages.length > 0) {
return this.internalErrorMessages;
} else if (this.successMessages.length > 0) {
return this.internalSuccessMessages;
} else if (this.messages.length > 0) {
return this.internalMessages;
} else if (this.shouldValidate) {
return this.errorBucket;
} else return [];
}
},
watch: {
rules: {
handler(newVal, oldVal) {
if (deepEqual(newVal, oldVal)) return;
this.validate();
},
deep: true
},
internalValue() {
// If it's the first time we're setting input,
// mark it with hasInput
this.hasInput = true;
this.validateOnBlur || this.$nextTick(this.validate);
},
isFocused(val) {
// Should not check validation
// if disabled
if (!val && !this.isDisabled) {
this.hasFocused = true;
this.validateOnBlur && this.$nextTick(this.validate);
}
},
isResetting() {
setTimeout(() => {
this.hasInput = false;
this.hasFocused = false;
this.isResetting = false;
this.validate();
}, 0);
},
hasError(val) {
if (this.shouldValidate) {
this.$emit('update:error', val);
}
},
value(val) {
this.lazyValue = val;
}
},
beforeMount() {
this.validate();
},
created() {
this.form && this.form.register(this);
},
beforeDestroy() {
this.form && this.form.unregister(this);
},
methods: {
genInternalMessages(messages) {
if (!messages) return [];else if (Array.isArray(messages)) return messages;else return [messages];
},
/** @public */
reset() {
this.isResetting = true;
this.internalValue = Array.isArray(this.internalValue) ? [] : undefined;
},
/** @public */
resetValidation() {
this.isResetting = true;
},
/** @public */
validate(force = false, value) {
const errorBucket = [];
value = value || this.internalValue;
if (force) this.hasInput = this.hasFocused = true;
for (let index = 0; index < this.rules.length; index++) {
const rule = this.rules[index];
const valid = typeof rule === 'function' ? rule(value) : rule;
if (valid === false || typeof valid === 'string') {
errorBucket.push(valid || '');
} else if (typeof valid !== 'boolean') {
consoleError(`Rules should return a string or boolean, received '${typeof valid}' instead`, this);
}
}
this.errorBucket = errorBucket;
this.valid = errorBucket.length === 0;
return this.valid;
}
}
});
//# sourceMappingURL=index.js.map
File diff suppressed because one or more lines are too long