拿掉 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
-256
View File
@@ -1,256 +0,0 @@
// Styles
import "../../../src/components/VWindow/VWindow.sass"; // Directives
import Touch from '../../directives/touch'; // Components
import VBtn from '../VBtn';
import VIcon from '../VIcon';
import { BaseItemGroup } from '../VItemGroup/VItemGroup';
/* @vue/component */
export default BaseItemGroup.extend({
name: 'v-window',
provide() {
return {
windowGroup: this
};
},
directives: {
Touch
},
props: {
activeClass: {
type: String,
default: 'v-window-item--active'
},
continuous: Boolean,
mandatory: {
type: Boolean,
default: true
},
nextIcon: {
type: [Boolean, String],
default: '$next'
},
prevIcon: {
type: [Boolean, String],
default: '$prev'
},
reverse: {
type: Boolean,
default: undefined
},
showArrows: Boolean,
showArrowsOnHover: Boolean,
touch: Object,
touchless: Boolean,
value: {
required: false
},
vertical: Boolean
},
data() {
return {
changedByDelimiters: false,
internalHeight: undefined,
transitionHeight: undefined,
transitionCount: 0,
isBooted: false,
isReverse: false
};
},
computed: {
isActive() {
return this.transitionCount > 0;
},
classes() {
return { ...BaseItemGroup.options.computed.classes.call(this),
'v-window--show-arrows-on-hover': this.showArrowsOnHover
};
},
computedTransition() {
if (!this.isBooted) return '';
const axis = this.vertical ? 'y' : 'x';
const reverse = this.$vuetify.rtl && axis === 'x' ? !this.internalReverse : this.internalReverse;
const direction = reverse ? '-reverse' : '';
return `v-window-${axis}${direction}-transition`;
},
hasActiveItems() {
return Boolean(this.items.find(item => !item.disabled));
},
hasNext() {
return this.continuous || this.internalIndex < this.items.length - 1;
},
hasPrev() {
return this.continuous || this.internalIndex > 0;
},
internalIndex() {
return this.items.findIndex((item, i) => {
return this.internalValue === this.getValue(item, i);
});
},
internalReverse() {
return this.reverse ? !this.isReverse : this.isReverse;
}
},
watch: {
internalIndex: 'updateReverse'
},
mounted() {
window.requestAnimationFrame(() => this.isBooted = true);
},
methods: {
genContainer() {
const children = [this.$slots.default];
if (this.showArrows) {
children.push(this.genControlIcons());
}
return this.$createElement('div', {
staticClass: 'v-window__container',
class: {
'v-window__container--is-active': this.isActive
},
style: {
height: this.internalHeight || this.transitionHeight
}
}, children);
},
genIcon(direction, icon, fn) {
return this.$createElement('div', {
staticClass: `v-window__${direction}`
}, [this.$createElement(VBtn, {
props: {
icon: true
},
attrs: {
'aria-label': this.$vuetify.lang.t(`$vuetify.carousel.${direction}`)
},
on: {
click: () => {
this.changedByDelimiters = true;
fn();
}
}
}, [this.$createElement(VIcon, {
props: {
large: true
}
}, icon)])]);
},
genControlIcons() {
const icons = [];
const prevIcon = this.$vuetify.rtl ? this.nextIcon : this.prevIcon;
/* istanbul ignore else */
if (this.hasPrev && prevIcon && typeof prevIcon === 'string') {
const icon = this.genIcon('prev', prevIcon, this.prev);
icon && icons.push(icon);
}
const nextIcon = this.$vuetify.rtl ? this.prevIcon : this.nextIcon;
/* istanbul ignore else */
if (this.hasNext && nextIcon && typeof nextIcon === 'string') {
const icon = this.genIcon('next', nextIcon, this.next);
icon && icons.push(icon);
}
return icons;
},
getNextIndex(index) {
const nextIndex = (index + 1) % this.items.length;
const item = this.items[nextIndex];
if (item.disabled) return this.getNextIndex(nextIndex);
return nextIndex;
},
getPrevIndex(index) {
const prevIndex = (index + this.items.length - 1) % this.items.length;
const item = this.items[prevIndex];
if (item.disabled) return this.getPrevIndex(prevIndex);
return prevIndex;
},
next() {
this.isReverse = this.$vuetify.rtl;
/* istanbul ignore if */
if (!this.hasActiveItems || !this.hasNext) return;
const nextIndex = this.getNextIndex(this.internalIndex);
const item = this.items[nextIndex];
this.internalValue = this.getValue(item, nextIndex);
},
prev() {
this.isReverse = !this.$vuetify.rtl;
/* istanbul ignore if */
if (!this.hasActiveItems || !this.hasPrev) return;
const lastIndex = this.getPrevIndex(this.internalIndex);
const item = this.items[lastIndex];
this.internalValue = this.getValue(item, lastIndex);
},
updateReverse(val, oldVal) {
if (this.changedByDelimiters) {
this.changedByDelimiters = false;
return;
}
this.isReverse = val < oldVal;
}
},
render(h) {
const data = {
staticClass: 'v-window',
class: this.classes,
directives: []
};
if (!this.touchless) {
const value = this.touch || {
left: () => {
this.$vuetify.rtl ? this.prev() : this.next();
},
right: () => {
this.$vuetify.rtl ? this.next() : this.prev();
},
end: e => {
e.stopPropagation();
},
start: e => {
e.stopPropagation();
}
};
data.directives.push({
name: 'touch',
value
});
}
return h('div', data, [this.genContainer()]);
}
});
//# sourceMappingURL=VWindow.js.map
File diff suppressed because one or more lines are too long
-144
View File
@@ -1,144 +0,0 @@
// Mixins
import Bootable from '../../mixins/bootable';
import { factory as GroupableFactory } from '../../mixins/groupable'; // Directives
import Touch from '../../directives/touch'; // Utilities
import { convertToUnit } from '../../util/helpers';
import mixins from '../../util/mixins';
const baseMixins = mixins(Bootable, GroupableFactory('windowGroup', 'v-window-item', 'v-window'));
export default baseMixins.extend().extend().extend({
name: 'v-window-item',
directives: {
Touch
},
props: {
disabled: Boolean,
reverseTransition: {
type: [Boolean, String],
default: undefined
},
transition: {
type: [Boolean, String],
default: undefined
},
value: {
required: false
}
},
data() {
return {
isActive: false,
inTransition: false
};
},
computed: {
classes() {
return this.groupClasses;
},
computedTransition() {
if (!this.windowGroup.internalReverse) {
return typeof this.transition !== 'undefined' ? this.transition || '' : this.windowGroup.computedTransition;
}
return typeof this.reverseTransition !== 'undefined' ? this.reverseTransition || '' : this.windowGroup.computedTransition;
}
},
methods: {
genDefaultSlot() {
return this.$slots.default;
},
genWindowItem() {
return this.$createElement('div', {
staticClass: 'v-window-item',
class: this.classes,
directives: [{
name: 'show',
value: this.isActive
}],
on: this.$listeners
}, this.genDefaultSlot());
},
onAfterTransition() {
if (!this.inTransition) {
return;
} // Finalize transition state.
this.inTransition = false;
if (this.windowGroup.transitionCount > 0) {
this.windowGroup.transitionCount--; // Remove container height if we are out of transition.
if (this.windowGroup.transitionCount === 0) {
this.windowGroup.transitionHeight = undefined;
}
}
},
onBeforeTransition() {
if (this.inTransition) {
return;
} // Initialize transition state here.
this.inTransition = true;
if (this.windowGroup.transitionCount === 0) {
// Set initial height for height transition.
this.windowGroup.transitionHeight = convertToUnit(this.windowGroup.$el.clientHeight);
}
this.windowGroup.transitionCount++;
},
onTransitionCancelled() {
this.onAfterTransition(); // This should have the same path as normal transition end.
},
onEnter(el) {
if (!this.inTransition) {
return;
}
this.$nextTick(() => {
// Do not set height if no transition or cancelled.
if (!this.computedTransition || !this.inTransition) {
return;
} // Set transition target height.
this.windowGroup.transitionHeight = convertToUnit(el.clientHeight);
});
}
},
render(h) {
return h('transition', {
props: {
name: this.computedTransition
},
on: {
// Handlers for enter windows.
beforeEnter: this.onBeforeTransition,
afterEnter: this.onAfterTransition,
enterCancelled: this.onTransitionCancelled,
// Handlers for leave windows.
beforeLeave: this.onBeforeTransition,
afterLeave: this.onAfterTransition,
leaveCancelled: this.onTransitionCancelled,
// Enter handler for height transition.
enter: this.onEnter
}
}, this.showLazyContent(() => [this.genWindowItem()]));
}
});
//# sourceMappingURL=VWindowItem.js.map
File diff suppressed because one or more lines are too long
-10
View File
@@ -1,10 +0,0 @@
import VWindow from './VWindow';
import VWindowItem from './VWindowItem';
export { VWindow, VWindowItem };
export default {
$_vuetify_subcomponents: {
VWindow,
VWindowItem
}
};
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/components/VWindow/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAP,MAAoB,WAApB;AACA,OAAO,WAAP,MAAwB,eAAxB;AAEA,SAAS,OAAT,EAAkB,WAAlB;AAEA,eAAe;AACb,EAAA,uBAAuB,EAAE;AACvB,IAAA,OADuB;AAEvB,IAAA;AAFuB;AADZ,CAAf","sourcesContent":["import VWindow from './VWindow'\nimport VWindowItem from './VWindowItem'\n\nexport { VWindow, VWindowItem }\n\nexport default {\n $_vuetify_subcomponents: {\n VWindow,\n VWindowItem,\n },\n}\n"],"sourceRoot":"","file":"index.js"}