metadesktop
Version:
js元桌面 基于vue的框架,实现web桌面系统
1,463 lines (1,392 loc) • 164 kB
JavaScript
/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ 704:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "$System": function() { return /* binding */ $System; },
/* harmony export */ "AdministrationManage": function() { return /* binding */ AdministrationManage; },
/* harmony export */ "ApplicationManage": function() { return /* binding */ ApplicationManage; },
/* harmony export */ "BottomBarManage": function() { return /* binding */ BottomBarManage; },
/* harmony export */ "DesktopBackgroundManage": function() { return /* binding */ DesktopBackgroundManage; },
/* harmony export */ "oldConfigToNewAttribute": function() { return /* binding */ oldConfigToNewAttribute; }
/* harmony export */ });
/* harmony import */ var _js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(91);
/* harmony import */ var _js_Application__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(791);
/* harmony import */ var _js_manage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(14);
class ApplicationManage {
static getInstance() {
if (!ApplicationManage.applicationManage) {
ApplicationManage.applicationManage = new ApplicationManage();
}
return ApplicationManage.applicationManage;
}
addApplication(component, showDesktop = true) {
let config;
if (component.windowConfig) {
config = oldConfigToNewAttribute(component);
}
const findApp = _js__WEBPACK_IMPORTED_MODULE_0__/* .database.app.findByName */ .Fs.app.findByName(config.app.name);
if (findApp) {
return findApp;
}
const app = (0,_js_manage__WEBPACK_IMPORTED_MODULE_2__.createApp)(Object.assign({ showDesktop, content: component, contentMode: _js_Application__WEBPACK_IMPORTED_MODULE_1__/* ["default"].CONTENT_OLD_VUE_COMPONENT */ .Z.CONTENT_OLD_VUE_COMPONENT }, config.app)).setWindowConfig(Object.assign({}, config.win)).on("createWindow", (e) => {
e.window.on("vueInstall", ApplicationManage.VueInstall);
});
return app;
}
addApplicationWeb(value, showDesktop = true) {
const findApp = _js__WEBPACK_IMPORTED_MODULE_0__/* .database.app.findByName */ .Fs.app.findByName(value.title);
if (findApp) {
return findApp;
}
return (0,_js_manage__WEBPACK_IMPORTED_MODULE_2__.createWebApp)({
url: value.href,
icon: value.icon,
iconMode: _js_Application__WEBPACK_IMPORTED_MODULE_1__/* ["default"].ICON_DEFAULT */ .Z.ICON_DEFAULT,
name: value.title,
showDesktop,
});
}
remove(app) {
_js__WEBPACK_IMPORTED_MODULE_0__/* .database.app.remove */ .Fs.app.remove(app);
}
removeByComponent(com) {
const index = this.indexOfByComponent(com);
if (index > -1) {
this.remove(index);
}
}
removeByName(name) {
const app = _js__WEBPACK_IMPORTED_MODULE_0__/* .database.app.findByName */ .Fs.app.findByName(name);
if (app)
_js__WEBPACK_IMPORTED_MODULE_0__/* .database.app.remove */ .Fs.app.remove(app);
}
findAppByNmae(name) {
return _js__WEBPACK_IMPORTED_MODULE_0__/* .database.app.findByName */ .Fs.app.findByName(name);
}
findAppByTitle(name) {
return _js__WEBPACK_IMPORTED_MODULE_0__/* .database.app.findByName */ .Fs.app.findByName(name);
}
indexOfByComponent(com) {
const list = _js__WEBPACK_IMPORTED_MODULE_0__/* .database.app.appList */ .Fs.app.appList;
for (let i = 0; i < list.length; i++) {
const app = list[i];
if (app.attributes.content == com) {
return i;
}
}
return -1;
}
clear() {
_js__WEBPACK_IMPORTED_MODULE_0__/* .database.app.clear */ .Fs.app.clear();
}
}
Object.defineProperty(ApplicationManage, "VueInstall", {
enumerable: true,
configurable: true,
writable: true,
value: new Function()
});
class DesktopBackgroundManage {
pushImage() {
console.log(1);
}
setModel() {
console.log(1);
}
setImageIndex() {
console.log(1);
}
}
class BottomBarManage {
}
class AdministrationManage {
setUserName() {
console.log("该方法已经被弃用");
}
onClickUser() {
console.log("该方法已经被弃用");
}
}
function oldConfigToNewAttribute(component) {
const app = {};
const win = {
size: {
width: "100px",
height: "100px"
}
};
const config = component.windowConfig;
if (config) {
if (config.icon_svg) {
app.iconMode = _js_Application__WEBPACK_IMPORTED_MODULE_1__/* ["default"].ICON_SVG */ .Z.ICON_SVG;
}
else {
app.iconMode = _js_Application__WEBPACK_IMPORTED_MODULE_1__/* ["default"].ICON_DEFAULT */ .Z.ICON_DEFAULT;
}
win.iconMode = app.iconMode;
if (config.icon) {
app.icon = config.icon;
win.icon = config.icon;
}
if (config.maxCountWindow) {
app.windowMaxCount = config.maxCountWindow;
}
if (config.windowWidth) {
win.size.width = config.windowWidth;
}
if (config.windowHeight) {
win.size.height = config.windowHeight;
}
if (config.titleBarFullScreenBackground) {
win.fullScreenBtnColor = config.titleBarFullScreenBackground;
}
if (config.titleBarCancelBackground) {
win.closeBtnColor = config.titleBarCancelBackground;
}
if (config.titleBarHideBackground) {
win.hideBtnColor = config.titleBarHideBackground;
}
if (config.showDesktop) {
app.showDesktop = config.showDesktop;
}
if (config.title) {
app.name = config.title;
win.name = config.title;
}
else if (component.name) {
app.name = component.nam;
win.name = component.nam;
}
// if(config.showAddmin){
// }
// if(config.isResetSize){
// }
}
return { app, win };
}
class $System {
constructor() {
Object.defineProperty(this, "getApplicationManage", {
enumerable: true,
configurable: true,
writable: true,
value: function () {
return ApplicationManage.getInstance();
}
});
Object.defineProperty(this, "getDesktopBackgroundManage", {
enumerable: true,
configurable: true,
writable: true,
value: function () {
return new DesktopBackgroundManage();
}
});
Object.defineProperty(this, "getAdministrationManage", {
enumerable: true,
configurable: true,
writable: true,
value: function () {
return new AdministrationManage();
}
});
}
getBottomBarManage() {
const manage = new DesktopBackgroundManage();
new Proxy(manage, {
get(target, p) {
console.log(p, "方法已经弃用");
}
});
return manage;
}
}
/***/ }),
/***/ 791:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "Z": function() { return /* binding */ Application; }
/* harmony export */ });
/* harmony import */ var _Attributes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79);
/* harmony import */ var _Window__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(428);
/* harmony import */ var _database_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(189);
/* harmony import */ var _uuid__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(647);
/* harmony import */ var _Event__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(590);
const ICON_SVG = Symbol("ICON_SVG");
const ICON_DEFAULT = Symbol("ICON_DEFAULT");
const CONTENT_VUE_COMPONENT = Symbol("CONTENT_VUE_COMPONENT");
const CONTENT_OLD_VUE_COMPONENT = Symbol("CONTENT_OLD_VUE_COMPONENT");
const CONTENT_HTML_ELEMENT = Symbol("CONTENT_HTML_ELEMENT");
const LEVEL_BACKGROUND = Symbol("LEVEL_BACKGROUND");
const LEVEL_DEFAULT = Symbol("LEVEL_DEFAULT");
const LEVEL_FORGGROUND = Symbol("LEVEL_FORGGROUND");
const POSITION_CUSTOM = Symbol("POSITION_CUSTOM");
const POSITION_LEFT_TOP = Symbol("POSITION_LEFT_TOP");
const POSITION_LEFT_BOTTOM = Symbol("POSITION_LEFT_BOTTOM");
const POSITION_RIGHT_TOP = Symbol("POSITION_RIGHT_TOP");
const POSITION_RIGHT_BOTTOM = Symbol("POSITION_RIGHT_BOTTOM");
const POSITION_CENTER_TOP = Symbol("POSITION_CENTER_TOP");
const POSITION_CENTER_BOTTOM = Symbol("POSITION_CENTER_BOTTOM");
const POSITION_LEFT_CENTER = Symbol("POSITION_LEFT_CENTER");
const POSITION_RIGHT_CENTER = Symbol("POSITION_RIGHT_CENTER");
const POSITION_CENTER = Symbol("POSITION_CENTER");
function deepClone(obj) {
// 定义一个变量 并判断是数组还是对象
const objClone = Array.isArray(obj) ? [] : {};
if (obj && typeof obj === 'object' && obj != null) {
// 判断obj存在并且是对象类型的时候 因为null也是object类型,所以要单独做判断
for (const key in obj) {
// 循环对象类型的obj
if (Object.prototype.hasOwnProperty.call(obj, key)) {
// 判断obj中是否存在key属性
if (obj[key] && typeof obj[key] === 'object') {
// 判断如果obj[key]存在并且obj[key]是对象类型的时候应该深拷贝,即在堆内存中开辟新的内存
objClone[key] = deepClone(obj[key]);
}
else {
// 否则就是浅复制
objClone[key] = obj[key];
}
}
}
}
return objClone;
}
class OldApplication {
constructor() {
Object.defineProperty(this, "attributes", {
enumerable: true,
configurable: true,
writable: true,
value: new _Attributes__WEBPACK_IMPORTED_MODULE_0__/* .ApplicationAttributes */ .Rm()
});
Object.defineProperty(this, "Event", {
enumerable: true,
configurable: true,
writable: true,
value: new _Event__WEBPACK_IMPORTED_MODULE_3__/* .Event */ .j(null)
});
Object.defineProperty(this, "onShowDesktop", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
}
setShowDesktop(b) {
this.attributes.setAttribute("showDesktop", b);
}
setShowAddmin(b) {
console.log("setShowAddmin 方法已经被废弃");
}
emit(eventName, e) {
this.Event.emit(eventName, e);
return this;
}
on(eventName, calback) {
this.Event.emit(eventName, calback);
return this;
}
createWindow(object = {}) {
console.log(object);
}
open(object = {}) {
const fun = (e) => {
e.window.value.setValues(object);
this.Event.remove("createWindow", fun);
};
this.on("createWindow", fun);
const win = this.createWindow();
return win;
}
}
class Application extends OldApplication {
constructor(object = {}) {
super();
Object.defineProperty(this, "attributes", {
enumerable: true,
configurable: true,
writable: true,
value: new _Attributes__WEBPACK_IMPORTED_MODULE_0__/* .ApplicationAttributes */ .Rm()
});
Object.defineProperty(this, "uuid", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "windowConfig", {
enumerable: true,
configurable: true,
writable: true,
value: {}
});
Object.defineProperty(this, "Event", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this.setAttributes(Object.assign({}, object));
this.uuid = "app:" + (0,_uuid__WEBPACK_IMPORTED_MODULE_4__/* .uuid */ .V)();
this.Event = new _Event__WEBPACK_IMPORTED_MODULE_3__/* .Event */ .j(this);
}
// 图标模式
static get ICON_SVG() { return ICON_SVG; }
static get ICON_DEFAULT() { return ICON_DEFAULT; }
// 内容模式
static get CONTENT_VUE_COMPONENT() { return CONTENT_VUE_COMPONENT; }
static get CONTENT_OLD_VUE_COMPONENT() { return CONTENT_OLD_VUE_COMPONENT; }
static get CONTENT_HTML_ELEMENT() { return CONTENT_HTML_ELEMENT; }
// 层级
static get LEVEL_BACKGROUND() { return LEVEL_BACKGROUND; }
static get LEVEL_DEFAULT() { return LEVEL_DEFAULT; }
static get LEVEL_FORGGROUND() { return LEVEL_FORGGROUND; }
// 位置设置模式
static get POSITION_CUSTOM() { return POSITION_CUSTOM; }
static get POSITION_LEFT_TOP() { return POSITION_LEFT_TOP; }
static get POSITION_LEFT_BOTTOM() { return POSITION_LEFT_BOTTOM; }
static get POSITION_RIGHT_TOP() { return POSITION_RIGHT_TOP; }
static get POSITION_RIGHT_BOTTOM() { return POSITION_RIGHT_BOTTOM; }
static get POSITION_CENTER_TOP() { return POSITION_CENTER_TOP; }
static get POSITION_CENTER_BOTTOM() { return POSITION_CENTER_BOTTOM; }
static get POSITION_LEFT_CENTER() { return POSITION_LEFT_CENTER; }
static get POSITION_RIGHT_CENTER() { return POSITION_RIGHT_CENTER; }
static get POSITION_CENTER() { return POSITION_CENTER; }
setWindowConfig(windowConfig = {}) {
this.windowConfig = Object.assign(Object.assign({}, this.windowConfig), windowConfig);
return this;
}
setAttributes(object = {}) {
for (const key in object) {
if (Object.prototype.hasOwnProperty.call(object, key)) {
const element = object[key];
this.setAttribute(key, element);
}
}
return this;
}
setAttribute(name, value) {
this.attributes[name] = value;
return this;
}
getAttribute(name) {
return this.attributes[name];
}
setMenu(name, fun) {
if (name instanceof Array)
return;
this.attributes.menu.setMenu(name, fun);
return this;
}
createWindow(object = {}) {
if (this.attributes.windowMaxCount == this.attributes.windowCount) {
const win = _database_index__WEBPACK_IMPORTED_MODULE_2__/* ["default"].window.findByApplication */ .Z.window.findByApplication(this);
_database_index__WEBPACK_IMPORTED_MODULE_2__/* ["default"].app.setActive */ .Z.app.setActive(this);
if (win instanceof _Window__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z) {
_database_index__WEBPACK_IMPORTED_MODULE_2__/* ["default"].window.setActive */ .Z.window.setActive(win);
win.show();
}
return win;
}
const win = new _Window__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z(this, Object.assign(Object.assign({ name: this.attributes.name, icon: this.attributes.icon, iconMode: this.attributes.iconMode }, deepClone(this.windowConfig)), object));
_database_index__WEBPACK_IMPORTED_MODULE_2__/* ["default"].window.push */ .Z.window.push(win);
_database_index__WEBPACK_IMPORTED_MODULE_2__/* ["default"].app.setActive */ .Z.app.setActive(this);
_database_index__WEBPACK_IMPORTED_MODULE_2__/* ["default"].window.setActive */ .Z.window.setActive(win);
this.attributes.windowCount++;
this.Event.emit("createWindow", {
window: win
});
win.render();
return win;
}
on(eventName, calback) {
this.Event.on(eventName, calback);
return this;
}
}
/***/ }),
/***/ 79:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "Rm": function() { return /* binding */ ApplicationAttributes; },
/* harmony export */ "yN": function() { return /* binding */ WindowAttributes; },
/* harmony export */ "zj": function() { return /* binding */ Attributes; }
/* harmony export */ });
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(797);
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _animation_KeyframesAnimation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(560);
/* harmony import */ var _Application__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(791);
/* harmony import */ var _Menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(910);
/* harmony import */ var _Value__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(206);
const eliminates = ["getAttribute", "setAttribute", "setAttributes", "paste"];
class Attributes {
setAttributes(object = {}) {
for (const key in object) {
if (Object.prototype.hasOwnProperty.call(object, key)) {
const element = object[key];
this.setAttribute(key, element);
}
}
return this;
}
setAttribute(name, value) {
this[name] = value;
return this;
}
getAttribute(name) {
return this[name];
}
copy(attributes) {
for (const key in attributes) {
if (Object.prototype.hasOwnProperty.call(attributes, key)) {
if (eliminates.indexOf(key) == -1) {
const element = attributes[key];
this.setAttribute(key, element);
}
}
}
}
clone() {
const attributes = new Attributes();
for (const key in this) {
if (Object.prototype.hasOwnProperty.call(this, key)) {
if (eliminates.indexOf(key) == -1) {
const element = this[key];
attributes.setAttribute(key, element);
}
}
}
return attributes;
}
}
let index = 0;
class ApplicationAttributes extends Attributes {
constructor() {
super(...arguments);
Object.defineProperty(this, "showDesktop", {
enumerable: true,
configurable: true,
writable: true,
value: (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(true)
});
Object.defineProperty(this, "windowMaxCount", {
enumerable: true,
configurable: true,
writable: true,
value: 1
});
Object.defineProperty(this, "windowCount", {
enumerable: true,
configurable: true,
writable: true,
value: 0
});
Object.defineProperty(this, "showStatusBar", {
enumerable: true,
configurable: true,
writable: true,
value: (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(true)
});
Object.defineProperty(this, "icon", {
enumerable: true,
configurable: true,
writable: true,
value: (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(`<svg t="1673152405385" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7488"><path d="M179.2 153.6a51.2 51.2 0 0 0-51.2 51.2v128a51.2 51.2 0 0 0 51.2 51.2h128a51.2 51.2 0 0 0 51.2-51.2V204.8a51.2 51.2 0 0 0-51.2-51.2H179.2z m0-102.4h128a153.6 153.6 0 0 1 153.6 153.6v128a153.6 153.6 0 0 1-153.6 153.6H179.2a153.6 153.6 0 0 1-153.6-153.6V204.8a153.6 153.6 0 0 1 153.6-153.6z m0 614.4a51.2 51.2 0 0 0-51.2 51.2v128a51.2 51.2 0 0 0 51.2 51.2h128a51.2 51.2 0 0 0 51.2-51.2V716.8a51.2 51.2 0 0 0-51.2-51.2H179.2z m0-102.4h128a153.6 153.6 0 0 1 153.6 153.6v128a153.6 153.6 0 0 1-153.6 153.6H179.2a153.6 153.6 0 0 1-153.6-153.6V716.8a153.6 153.6 0 0 1 153.6-153.6z m611.84-403.4048a51.2 51.2 0 0 0-72.3968 0L646.144 232.2432a51.2 51.2 0 0 0 0 72.3968l72.448 72.3968a51.2 51.2 0 0 0 72.3968 0l72.3968-72.3968a51.2 51.2 0 0 0 0-72.3968L791.04 159.744z m72.3968-72.3968l72.3968 72.3968a153.6 153.6 0 0 1 0 217.2416l-72.3968 72.3968a153.6 153.6 0 0 1-217.2416 0l-72.3968-72.3968a153.6 153.6 0 0 1 0-217.2416l72.3968-72.3968a153.6 153.6 0 0 1 217.2416 0zM699.7504 896a51.2 51.2 0 0 1 0 102.4A162.1504 162.1504 0 0 1 537.6 836.2496v-110.8992A162.1504 162.1504 0 0 1 699.7504 563.2h110.8992a162.1504 162.1504 0 0 1 162.1504 162.1504v8.448a51.2 51.2 0 0 1-102.4 0v-8.448c0-33.024-26.7264-59.7504-59.7504-59.7504h-110.8992c-33.024 0-59.7504 26.7264-59.7504 59.7504v110.8992c0 33.024 26.7264 59.7504 59.7504 59.7504z" fill="#2C6DD2" p-id="7489"></path><path d="M791.4496 160a51.2 51.2 0 0 0-72.3968 0l-72.448 72.3968a51.2 51.2 0 0 0 0 72.3968l72.448 72.3968a51.2 51.2 0 0 0 72.3968 0l72.3968-72.3968a51.2 51.2 0 0 0 0-72.3968l-72.3968-72.3968z" fill="#20C997" p-id="7490"></path></svg>`)
});
Object.defineProperty(this, "iconMode", {
enumerable: true,
configurable: true,
writable: true,
value: _Application__WEBPACK_IMPORTED_MODULE_2__/* ["default"].ICON_SVG */ .Z.ICON_SVG
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: "应用程序" + index++
});
Object.defineProperty(this, "contentMode", {
enumerable: true,
configurable: true,
writable: true,
value: _Application__WEBPACK_IMPORTED_MODULE_2__/* ["default"].CONTENT_HTML_ELEMENT */ .Z.CONTENT_HTML_ELEMENT
});
Object.defineProperty(this, "content", {
enumerable: true,
configurable: true,
writable: true,
value: "<h1 style='text-align: center;color: gray;margin: auto'>欢迎使用MetaDesktop 1.0</h1>"
});
Object.defineProperty(this, "menu", {
enumerable: true,
configurable: true,
writable: true,
value: new _Menu__WEBPACK_IMPORTED_MODULE_3__/* .ApplicationMenu */ .V()
});
}
}
class WindowAttributes extends Attributes {
constructor() {
super(...arguments);
Object.defineProperty(this, "position", {
enumerable: true,
configurable: true,
writable: true,
value: {
x: "0px",
y: "0px",
}
});
Object.defineProperty(this, "size", {
enumerable: true,
configurable: true,
writable: true,
value: {
width: "auto",
height: "auto",
}
});
Object.defineProperty(this, "positionMode", {
enumerable: true,
configurable: true,
writable: true,
value: _Application__WEBPACK_IMPORTED_MODULE_2__/* ["default"].POSITION_CENTER */ .Z.POSITION_CENTER
});
Object.defineProperty(this, "showTitleBar", {
enumerable: true,
configurable: true,
writable: true,
value: true
}); // 是否显示标题栏
Object.defineProperty(this, "titleBarBackground", {
enumerable: true,
configurable: true,
writable: true,
value: "rgb(34, 34, 34)"
});
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: ""
}); // 标题
Object.defineProperty(this, "icon", {
enumerable: true,
configurable: true,
writable: true,
value: ""
}); // 图
Object.defineProperty(this, "iconMode", {
enumerable: true,
configurable: true,
writable: true,
value: _Application__WEBPACK_IMPORTED_MODULE_2__/* ["default"].ICON_SVG */ .Z.ICON_SVG
});
Object.defineProperty(this, "background", {
enumerable: true,
configurable: true,
writable: true,
value: "white"
}); // 默认背景
Object.defineProperty(this, "level", {
enumerable: true,
configurable: true,
writable: true,
value: _Application__WEBPACK_IMPORTED_MODULE_2__/* ["default"].LEVEL_DEFAULT */ .Z.LEVEL_DEFAULT
}); //层级
Object.defineProperty(this, "index", {
enumerable: true,
configurable: true,
writable: true,
value: 0
});
Object.defineProperty(this, "showStatusBar", {
enumerable: true,
configurable: true,
writable: true,
value: true
});
Object.defineProperty(this, "windowMove", {
enumerable: true,
configurable: true,
writable: true,
value: true
});
Object.defineProperty(this, "closeBtnColor", {
enumerable: true,
configurable: true,
writable: true,
value: "none"
});
Object.defineProperty(this, "hideBtnColor", {
enumerable: true,
configurable: true,
writable: true,
value: "none"
});
Object.defineProperty(this, "fullScreenBtnColor", {
enumerable: true,
configurable: true,
writable: true,
value: "none"
});
Object.defineProperty(this, "keyframesAnimationEntry", {
enumerable: true,
configurable: true,
writable: true,
value: new _animation_KeyframesAnimation__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z(null)
.Keyframes({
opacity: "0",
time: 0
})
.Keyframes({
opacity: "1",
time: 1
})
});
Object.defineProperty(this, "keyframesAnimationLeave", {
enumerable: true,
configurable: true,
writable: true,
value: new _animation_KeyframesAnimation__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z(null)
.Keyframes({
opacity: "1",
time: 0
})
.Keyframes({
opacity: "0",
time: 1
})
});
Object.defineProperty(this, "openKeyframesAnimation", {
enumerable: true,
configurable: true,
writable: true,
value: true
});
Object.defineProperty(this, "value", {
enumerable: true,
configurable: true,
writable: true,
value: new _Value__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z()
});
Object.defineProperty(this, "menu", {
enumerable: true,
configurable: true,
writable: true,
value: new _Menu__WEBPACK_IMPORTED_MODULE_3__/* .WindowMenu */ .h()
});
}
}
/***/ }),
/***/ 590:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "j": function() { return /* binding */ Event; }
/* harmony export */ });
class Event {
constructor(target) {
Object.defineProperty(this, "target", {
enumerable: true,
configurable: true,
writable: true,
value: null
});
this.target = target;
}
emit(eventName, e = {}) {
if (this[eventName] instanceof Array) {
const list = this[eventName];
for (let i = 0; i < list.length; i++) {
list[i].call(this.target, e);
}
}
return this;
}
on(eventName, calback) {
if (!(this[eventName] instanceof Array)) {
this[eventName] = [];
}
this[eventName].push(calback);
return this;
}
remove(eventName, calback) {
if (this[eventName] instanceof Array) {
const list = this[eventName];
for (let i = 0; i < list.length; i++) {
if (list[i] == calback) {
list.splice(i, 1);
return;
}
}
}
return this;
}
}
/***/ }),
/***/ 910:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "V": function() { return /* binding */ ApplicationMenu; },
/* harmony export */ "h": function() { return /* binding */ WindowMenu; }
/* harmony export */ });
class Menu {
setMenu(name, menu) {
this[name] = menu;
}
setMenus(obj) {
Object.keys(obj).forEach(key => {
this.setMenu(key, obj[key]);
});
}
getMenu(name, menu) {
return this[name];
}
}
class ApplicationMenu extends Menu {
constructor() {
super(...arguments);
Object.defineProperty(this, "打开", {
enumerable: true,
configurable: true,
writable: true,
value: function (app) {
app.createWindow();
}
});
Object.defineProperty(this, "隐藏", {
enumerable: true,
configurable: true,
writable: true,
value: function (app) {
app.attributes.setAttribute("showDesktop", false);
}
});
}
}
class WindowMenu extends Menu {
constructor() {
super(...arguments);
Object.defineProperty(this, "关闭窗口", {
enumerable: true,
configurable: true,
writable: true,
value: function (win, context) {
win.close();
context.isMenus = false;
}
});
Object.defineProperty(this, "显示窗口", {
enumerable: true,
configurable: true,
writable: true,
value: function (win) {
win.show();
}
});
Object.defineProperty(this, "隐藏窗口", {
enumerable: true,
configurable: true,
writable: true,
value: function (win) {
win.hide();
}
});
}
}
/***/ }),
/***/ 206:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "Z": function() { return /* binding */ Value; }
/* harmony export */ });
const eliminates = ["getAttribute", "setAttribute", "setAttributes", "paste"];
class Value {
setValues(object = {}) {
for (const key in object) {
if (Object.prototype.hasOwnProperty.call(object, key)) {
const element = object[key];
this.setValue(key, element);
}
}
return this;
}
setValue(name, value) {
if (value == null)
delete this[name];
else
this[name] = value;
return this;
}
getValue(name) {
return this[name];
}
copy(value) {
for (const key in value) {
if (Object.prototype.hasOwnProperty.call(value, key)) {
if (eliminates.indexOf(key) == -1) {
const element = value[key];
this.setValue(key, element);
}
}
}
}
clone() {
const value = new Value();
for (const key in this) {
if (Object.prototype.hasOwnProperty.call(this, key)) {
if (eliminates.indexOf(key) == -1) {
const element = this[key];
value.setAttribute(key, element);
}
}
}
return value;
}
}
/***/ }),
/***/ 428:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"Z": function() { return /* binding */ Window; }
});
// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__(797);
// EXTERNAL MODULE: ./src/js/Application.ts
var Application = __webpack_require__(791);
// EXTERNAL MODULE: ./src/js/uuid.ts
var uuid = __webpack_require__(647);
// EXTERNAL MODULE: ./src/js/container.ts
var container = __webpack_require__(87);
// EXTERNAL MODULE: ./src/js/Attributes.ts
var Attributes = __webpack_require__(79);
// EXTERNAL MODULE: ./src/js/database/index.ts + 2 modules
var database = __webpack_require__(189);
// EXTERNAL MODULE: ./src/js/animation/KeyframesAnimation.ts
var KeyframesAnimation = __webpack_require__(560);
// EXTERNAL MODULE: ./src/js/Event.ts
var Event = __webpack_require__(590);
// EXTERNAL MODULE: ./src/compatible/components/MetaRouterView.vue + 5 modules
var MetaRouterView = __webpack_require__(473);
// EXTERNAL MODULE: ./src/compatible/js/utils.ts
var utils = __webpack_require__(704);
;// CONCATENATED MODULE: ./src/js/WindowPages.ts
const CLOSE = Symbol("CLOSE");
const HIDE = Symbol("HIDE");
const SHOW = Symbol("SHOW");
class WindowPage {
constructor(el, parent) {
Object.defineProperty(this, "_state", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "$el", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "$parent", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "event", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this.$el = el;
this.$parent = parent;
this.event = new Event/* Event */.j(this);
this.initStyle();
Object.defineProperty(this, "state", {
get() {
return this._state;
}
});
this._state = SHOW;
}
initStyle() {
this.$el.setAttribute("style", ` position: absolute;left: 0;top: 0;width: 100%;height: 100%;pointer-events: all;z-index:1000`);
}
close() {
if (this._state != WindowPage.CLOSE) {
this.$parent.$el.removeChild(this.$el);
this.$parent.removePage(this);
this.event.emit("close");
}
}
hide() {
if (this._state == WindowPage.SHOW) {
this.$el.style.display = "none";
this._state = WindowPage.HIDE;
this.event.emit("hide");
}
}
show() {
if (this._state == WindowPage.HIDE) {
this.$el.style.display = "block";
this._state = WindowPage.SHOW;
this.event.emit("show");
}
}
setVueComponent(com) {
const { createApp } = __webpack_require__(797);
createApp(com).use({
install: (Vue) => {
Vue.component("MetaRouterView", MetaRouterView/* default */.Z);
Vue.config.globalProperties.$window = this;
}
}).mount(this.$el);
new KeyframesAnimation/* default */.Z(this.$el)
.Keyframes({
time: 0,
opcity: 0,
})
.Keyframes({
time: 1,
opcity: 1,
})
.start();
}
}
Object.defineProperty(WindowPage, "CLOSE", {
enumerable: true,
configurable: true,
writable: true,
value: CLOSE
});
Object.defineProperty(WindowPage, "HIDE", {
enumerable: true,
configurable: true,
writable: true,
value: HIDE
});
Object.defineProperty(WindowPage, "SHOW", {
enumerable: true,
configurable: true,
writable: true,
value: SHOW
});
class WindowPages {
constructor(win) {
Object.defineProperty(this, "win", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "$el", {
enumerable: true,
configurable: true,
writable: true,
value: document.createElement("ul")
});
Object.defineProperty(this, "list", {
enumerable: true,
configurable: true,
writable: true,
value: []
});
this.win = win;
}
init() {
this.initStyle();
this.win.$contentEl.appendChild(this.$el);
}
initStyle() {
this.$el.setAttribute("style", `
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
pointer-events: none;
display: none
`);
}
createPage() {
if (this.list instanceof Array && this.list.length == 0) {
setTimeout(() => {
this.$el.style.display = "block";
});
}
const li = document.createElement("li");
this.$el.appendChild(li);
const windowPage = new WindowPage(li, this);
if (this.list instanceof Array)
this.list.push(windowPage);
return windowPage;
}
removePage(windowPage) {
if (this.list instanceof Array) {
const index = this.list.indexOf(windowPage);
if (index > -1)
this.list.splice(index, 1);
if (this.list instanceof Array && this.list.length == 0) {
this.$el.style.display = "none";
}
}
}
clear() {
for (let i = 0; i < this.list.length; i++) {
this.list[i].close();
}
this.list.length = 0;
}
alert(config) {
config = Object.assign({ title: "提示!", msg: "请输入内容!", cancel: true, onClick: new Function(), mask: false, maskColor: "rgba(0,0,0,0.5)" }, config);
const page = this.createPage();
const classN = "msg_" + Math.floor(Math.random() * 10000);
if (config.mask)
page.$el.style.background = config.maskColor;
page.$el.innerHTML = `
<div class="${classN}">
<style>
.${classN}{
position:absolute;
left:50%;
top:50%;
transform:translate(-50%,-50%);
background:#ffffff;
padding:10px;
min-width: 250px;
padding-bottom: 0px;
border-radius: 10px;
box-shadow: 0px 0px 20px gray;
}
.${classN}>h5{
text-align: center;
padding: 5px 0;
}
.${classN}>p{
text-align: center;
padding: 10px 0;
display: block;
}
.${classN}>div{
display: flex;
padding: 5px 0;
}
.${classN}>span{
height: 0.5px;
width:100%;
display:block;
background: rgb(200, 200, 200);
}
.${classN}>div>button{
flex: 1;
border: none;
padding: 5px 0;
cursor: pointer;
background: none
}
.${classN}>div>button:active{
background: whitesmoke;
}
.${classN}>div>button:nth-child(1){
border-right: solid 1px rgb(200, 200, 200);
color: gray;
}
</style>
<h5 class="title">${config.title}</h5>
<p>${config.msg}</p>
<span></span>
<div>
<button class="cancel">取消</button>
<button class="confirm">确认</button>
</div>
</div>
`;
const ele = {
cancel: page.$el.querySelector(".cancel"),
confirm: page.$el.querySelector(".confirm"),
title: page.$el.querySelector(".title")
};
if (!config.cancel) {
ele.cancel.style.display = "none";
}
if (!config.title) {
ele.title.style.display = "none";
}
function close() {
new KeyframesAnimation/* default */.Z(page.$el)
.Keyframes({
time: 0,
opacity: 1,
transform: "scale(1,1)"
})
.Keyframes({
time: 1,
opacity: 0,
transform: "scale(0.3,0.3)"
})
.start()
.onEnd = () => {
page.close();
};
}
function result(res) {
config.onClick({
button: res
});
}
ele.confirm.onclick = () => {
close();
result("confirm");
};
ele.cancel.onclick = () => {
close();
result("cancel");
};
new KeyframesAnimation/* default */.Z(page.$el)
.Keyframes({
time: 0,
opacity: 0,
transform: "scale(0.3,0.3)"
})
.Keyframes({
time: 1,
opacity: 1,
transform: "scale(1,1)"
})
.start();
return page;
}
message(msg = "请输入消息!", duration = 1000) {
if (typeof msg == "object") {
const obj = msg;
if (obj.msg)
msg = obj.msg;
else
msg = "请输入消息!";
if (obj.duration)
duration = obj.duration;
else
duration = 1000;
}
const page = this.createPage();
page.$el.style.pointerEvents = "none";
page.$el.innerHTML = `
<div style="position:absolute;
left:50%;
top:50%;
transform:translate(-50%,-50%);
background:#000000;
color: #ffffff;
pointer-events: all;
padding:5px 20px">
${msg}
</div>
`;
const el = page.$el.querySelector("div");
new KeyframesAnimation/* default */.Z(el)
.Keyframes({
time: 0,
opacity: 0
})
.Keyframes({
time: 1,
opacity: 1
})
.start();
setTimeout(() => {
new KeyframesAnimation/* default */.Z(el)
.Keyframes({
time: 0,
opacity: 1,
})
.Keyframes({
time: 1,
opacity: 0,
})
.start()
.onEnd = () => {
page.close();
};
}, duration);
return page;
}
}
;// CONCATENATED MODULE: ./src/js/utils/isMobile.ts
function isMobile() {
const userAgentInfo = navigator.userAgent;
const Agents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod'];
const getArr = Agents.filter(i => userAgentInfo.includes(i));
return getArr.length ? true : false;
}
;// CONCATENATED MODULE: ./src/js/Window.ts
const LOAD_BEFORE = Symbol("LOAD_BEFORE");
const LOAD = Symbol("LOAD");
const DESTROY = Symbol("DESTROY");
const Window_HIDE = Symbol("HIDE");
const Window_SHOW = Symbol("SHOW");
const FULLSCREEN = Symbol("FULLSCREEN");
const style = document.createElement("style");
style.innerHTML = `
*{
padding: 0;
margin: 0;
list-style: none;
}
.meta-window *::-webkit-scrollbar{
width: 5px;
height: 5px;
background: rgb(233, 233, 233);
}
.meta-window *::-webkit-scrollbar-thumb{
background: rgba(74, 198, 255,0.3);
border: 5px;
transition: 0.25s;
}
.meta-window *::-webkit-scrollbar-thumb:hover{
background: rgb(74, 198, 255);
}
.meta-window{
position: absolute;
left: 0;
top: 0;
width: 0;
height: 0;
background: none;
display: flex;
flex-direction: column;
box-sizing: border-box;
z-index: 0;
box-shadow: 0 0 20px gray;
}
.meta-window >.bar>.control-icon>svg {
width: 20px;
height: 20px;
border-radius: 50%;
background: red;
fill: white;
padding: 2px;
box-sizing: border-box;
margin: 0 2.5px;
transition: 0.25s;
border: solid 1px gray;
}
.meta-window >.bar>.control-icon>svg:hover{
transform: scale(1.25,1.25);
}
.meta-window >.bar>.control-icon>svg:active{
transform: scale(0.85,0.85)
}
.meta-window>.bar>.control-icon> .fullscreen,.hide,.close,.cancelFullscreen :hover {
cursor: pointer;
}
.meta-window>.bar>.info {
position: relative;
display: flex;
align-items: center;
}
.meta-window>.bar> .info *::selection {
background: none;
}
.meta-window>.bar>.info> .title {
color: white;
}
.meta-window>.bar>.info svg,img{
border-radius: 0%;
background: transparent;
padding: 0px;
margin-right: 5px;
width: 20px;
height: 20px;
}
.meta-window>.bar> .info svg:hover {
cursor: default;
}
.meta-window>.bar> .info .mask {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.meta-window>.bar> .control-icon {
display: flex;
}
.meta-window>.bar {
display: flex;
height: 32px;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 0 10px;
background: rgb(34, 34, 34);
}
`;
container.container.appendChild(style);
class Window {
constructor(application, object = {}) {
Object.defineProperty(this, "status", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "$el", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "$contentEl", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "$parentEl", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "uuid", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "application", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "$elList", {
enumerable: true,
configurable: true,
writable: true,
value: {}
});
Object.defineProperty(this, "attributes", {
enumerable: true,
configurable: true,
writable: true,
value: new Attributes/* WindowAttributes */.yN()
});
Object.defineProperty(this, "Event", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "windowPages", {
enumerable: true,
configurable: true,
writable: true,
value: