This commit is contained in:
darenhsu
2022-07-17 13:16:16 +08:00
parent 84759556ff
commit befd344ab0
28070 changed files with 4008428 additions and 1 deletions
+54
View File
@@ -0,0 +1,54 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _console = require("../../util/console");
var _vue = _interopRequireDefault(require("vue"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/* @vue/component */
var _default2 = _vue.default.extend({
name: 'mobile',
props: {
mobileBreakpoint: {
type: [Number, String],
default: function _default() {
// Avoid destroying unit
// tests for users
return this.$vuetify ? this.$vuetify.breakpoint.mobileBreakpoint : undefined;
},
validator: function validator(v) {
return !isNaN(Number(v)) || ['xs', 'sm', 'md', 'lg', 'xl'].includes(String(v));
}
}
},
computed: {
isMobile: function isMobile() {
var _this$$vuetify$breakp = this.$vuetify.breakpoint,
mobile = _this$$vuetify$breakp.mobile,
width = _this$$vuetify$breakp.width,
name = _this$$vuetify$breakp.name,
mobileBreakpoint = _this$$vuetify$breakp.mobileBreakpoint; // Check if local mobileBreakpoint matches
// the application's mobileBreakpoint
if (mobileBreakpoint === this.mobileBreakpoint) return mobile;
var mobileWidth = parseInt(this.mobileBreakpoint, 10);
var isNumber = !isNaN(mobileWidth);
return isNumber ? width < mobileWidth : name === this.mobileBreakpoint;
}
},
created: function created() {
/* istanbul ignore next */
if (this.$attrs.hasOwnProperty('mobile-break-point')) {
(0, _console.deprecate)('mobile-break-point', 'mobile-breakpoint', this);
}
}
});
exports.default = _default2;
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/mixins/mobile/index.ts"],"names":[],"mappings":";;;;;;;AAEA;;AACA;;;;AAEA;gBACe,aAAI,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,OAFgB,sBAET;AACL;AACA;AACA,eAAO,KAAK,QAAL,GACH,KAAK,QAAL,CAAc,UAAd,CAAyB,gBADtB,GAEH,SAFJ;AAGD,OARe;AAShB,MAAA,SAAS,EAAE,mBAAA,CAAC;AAAA,eACV,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,CAFU;AAAA;AATI;AADb,GAHiB;AAoBxB,EAAA,QAAQ,EAAE;AACR,IAAA,QADQ,sBACA;AAAA,kCAMF,KAAK,QAAL,CAAc,UANZ;AAAA,UAEJ,MAFI,yBAEJ,MAFI;AAAA,UAGJ,KAHI,yBAGJ,KAHI;AAAA,UAIJ,IAJI,yBAIJ,IAJI;AAAA,UAKJ,gBALI,yBAKJ,gBALI,EAQN;AACA;;AACA,UAAI,gBAAgB,KAAK,KAAK,gBAA9B,EAAgD,OAAO,MAAP;AAEhD,UAAM,WAAW,GAAG,QAAQ,CAAC,KAAK,gBAAN,EAAwB,EAAxB,CAA5B;AACA,UAAM,QAAQ,GAAG,CAAC,KAAK,CAAC,WAAD,CAAvB;AAEA,aAAO,QAAQ,GACX,KAAK,GAAG,WADG,GAEX,IAAI,KAAK,KAAK,gBAFlB;AAGD;AAnBO,GApBc;AA0CxB,EAAA,OA1CwB,qBA0CjB;AACL;AACA,QAAI,KAAK,MAAL,CAAY,cAAZ,CAA2B,oBAA3B,CAAJ,EAAsD;AACpD,8BAAU,oBAAV,EAAgC,mBAAhC,EAAqD,IAArD;AACD;AACF;AA/CuB,CAAX,C","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"}