nubomed-ui 2.0.50 → 2.0.52
Sign up to get free protection for your applications and to get access to all the features.
- package/css/nb-ui/index.css +1 -1
- package/nubomed-ui.common.js +11 -1173
- package/nubomed-ui.common.js.map +1 -1
- package/nubomed-ui.umd.js +11 -1173
- package/nubomed-ui.umd.js.map +1 -1
- package/nubomed-ui.umd.min.js +1 -7
- package/nubomed-ui.umd.min.js.map +1 -1
- package/package.json +1 -1
package/nubomed-ui.umd.js
CHANGED
@@ -1053,7 +1053,7 @@ src.install = function (Vue) {
|
|
1053
1053
|
|
1054
1054
|
/***/ }),
|
1055
1055
|
|
1056
|
-
/***/
|
1056
|
+
/***/ 5155:
|
1057
1057
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
1058
1058
|
|
1059
1059
|
"use strict";
|
@@ -1065,1178 +1065,18 @@ __webpack_require__.d(__webpack_exports__, {
|
|
1065
1065
|
"default": function() { return /* binding */ NBExpiryIcon; }
|
1066
1066
|
});
|
1067
1067
|
|
1068
|
-
;// ./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/components/NBExpiryIcon/src/index.vue?vue&type=template&id=
|
1068
|
+
;// ./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/components/NBExpiryIcon/src/index.vue?vue&type=template&id=9b72fa0a&scoped=true
|
1069
1069
|
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.icon)?_c('span',{staticClass:"nb-expiry-icon",class:("nb-expiry-icon--" + _vm.value)},[_vm._v(_vm._s(_vm.icon))]):_vm._e()}
|
1070
1070
|
var staticRenderFns = []
|
1071
1071
|
|
1072
1072
|
|
1073
|
-
;// ./node_modules/vuex/dist/vuex.esm.js
|
1074
|
-
/*!
|
1075
|
-
* vuex v3.6.2
|
1076
|
-
* (c) 2021 Evan You
|
1077
|
-
* @license MIT
|
1078
|
-
*/
|
1079
|
-
function applyMixin (Vue) {
|
1080
|
-
var version = Number(Vue.version.split('.')[0]);
|
1081
|
-
|
1082
|
-
if (version >= 2) {
|
1083
|
-
Vue.mixin({ beforeCreate: vuexInit });
|
1084
|
-
} else {
|
1085
|
-
// override init and inject vuex init procedure
|
1086
|
-
// for 1.x backwards compatibility.
|
1087
|
-
var _init = Vue.prototype._init;
|
1088
|
-
Vue.prototype._init = function (options) {
|
1089
|
-
if ( options === void 0 ) options = {};
|
1090
|
-
|
1091
|
-
options.init = options.init
|
1092
|
-
? [vuexInit].concat(options.init)
|
1093
|
-
: vuexInit;
|
1094
|
-
_init.call(this, options);
|
1095
|
-
};
|
1096
|
-
}
|
1097
|
-
|
1098
|
-
/**
|
1099
|
-
* Vuex init hook, injected into each instances init hooks list.
|
1100
|
-
*/
|
1101
|
-
|
1102
|
-
function vuexInit () {
|
1103
|
-
var options = this.$options;
|
1104
|
-
// store injection
|
1105
|
-
if (options.store) {
|
1106
|
-
this.$store = typeof options.store === 'function'
|
1107
|
-
? options.store()
|
1108
|
-
: options.store;
|
1109
|
-
} else if (options.parent && options.parent.$store) {
|
1110
|
-
this.$store = options.parent.$store;
|
1111
|
-
}
|
1112
|
-
}
|
1113
|
-
}
|
1114
|
-
|
1115
|
-
var target = typeof window !== 'undefined'
|
1116
|
-
? window
|
1117
|
-
: typeof __webpack_require__.g !== 'undefined'
|
1118
|
-
? __webpack_require__.g
|
1119
|
-
: {};
|
1120
|
-
var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
1121
|
-
|
1122
|
-
function devtoolPlugin (store) {
|
1123
|
-
if (!devtoolHook) { return }
|
1124
|
-
|
1125
|
-
store._devtoolHook = devtoolHook;
|
1126
|
-
|
1127
|
-
devtoolHook.emit('vuex:init', store);
|
1128
|
-
|
1129
|
-
devtoolHook.on('vuex:travel-to-state', function (targetState) {
|
1130
|
-
store.replaceState(targetState);
|
1131
|
-
});
|
1132
|
-
|
1133
|
-
store.subscribe(function (mutation, state) {
|
1134
|
-
devtoolHook.emit('vuex:mutation', mutation, state);
|
1135
|
-
}, { prepend: true });
|
1136
|
-
|
1137
|
-
store.subscribeAction(function (action, state) {
|
1138
|
-
devtoolHook.emit('vuex:action', action, state);
|
1139
|
-
}, { prepend: true });
|
1140
|
-
}
|
1141
|
-
|
1142
|
-
/**
|
1143
|
-
* Get the first item that pass the test
|
1144
|
-
* by second argument function
|
1145
|
-
*
|
1146
|
-
* @param {Array} list
|
1147
|
-
* @param {Function} f
|
1148
|
-
* @return {*}
|
1149
|
-
*/
|
1150
|
-
function find (list, f) {
|
1151
|
-
return list.filter(f)[0]
|
1152
|
-
}
|
1153
|
-
|
1154
|
-
/**
|
1155
|
-
* Deep copy the given object considering circular structure.
|
1156
|
-
* This function caches all nested objects and its copies.
|
1157
|
-
* If it detects circular structure, use cached copy to avoid infinite loop.
|
1158
|
-
*
|
1159
|
-
* @param {*} obj
|
1160
|
-
* @param {Array<Object>} cache
|
1161
|
-
* @return {*}
|
1162
|
-
*/
|
1163
|
-
function deepCopy (obj, cache) {
|
1164
|
-
if ( cache === void 0 ) cache = [];
|
1165
|
-
|
1166
|
-
// just return if obj is immutable value
|
1167
|
-
if (obj === null || typeof obj !== 'object') {
|
1168
|
-
return obj
|
1169
|
-
}
|
1170
|
-
|
1171
|
-
// if obj is hit, it is in circular structure
|
1172
|
-
var hit = find(cache, function (c) { return c.original === obj; });
|
1173
|
-
if (hit) {
|
1174
|
-
return hit.copy
|
1175
|
-
}
|
1176
|
-
|
1177
|
-
var copy = Array.isArray(obj) ? [] : {};
|
1178
|
-
// put the copy into cache at first
|
1179
|
-
// because we want to refer it in recursive deepCopy
|
1180
|
-
cache.push({
|
1181
|
-
original: obj,
|
1182
|
-
copy: copy
|
1183
|
-
});
|
1184
|
-
|
1185
|
-
Object.keys(obj).forEach(function (key) {
|
1186
|
-
copy[key] = deepCopy(obj[key], cache);
|
1187
|
-
});
|
1188
|
-
|
1189
|
-
return copy
|
1190
|
-
}
|
1191
|
-
|
1192
|
-
/**
|
1193
|
-
* forEach for object
|
1194
|
-
*/
|
1195
|
-
function forEachValue (obj, fn) {
|
1196
|
-
Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
|
1197
|
-
}
|
1198
|
-
|
1199
|
-
function isObject (obj) {
|
1200
|
-
return obj !== null && typeof obj === 'object'
|
1201
|
-
}
|
1202
|
-
|
1203
|
-
function isPromise (val) {
|
1204
|
-
return val && typeof val.then === 'function'
|
1205
|
-
}
|
1206
|
-
|
1207
|
-
function assert (condition, msg) {
|
1208
|
-
if (!condition) { throw new Error(("[vuex] " + msg)) }
|
1209
|
-
}
|
1210
|
-
|
1211
|
-
function partial (fn, arg) {
|
1212
|
-
return function () {
|
1213
|
-
return fn(arg)
|
1214
|
-
}
|
1215
|
-
}
|
1216
|
-
|
1217
|
-
// Base data struct for store's module, package with some attribute and method
|
1218
|
-
var Module = function Module (rawModule, runtime) {
|
1219
|
-
this.runtime = runtime;
|
1220
|
-
// Store some children item
|
1221
|
-
this._children = Object.create(null);
|
1222
|
-
// Store the origin module object which passed by programmer
|
1223
|
-
this._rawModule = rawModule;
|
1224
|
-
var rawState = rawModule.state;
|
1225
|
-
|
1226
|
-
// Store the origin module's state
|
1227
|
-
this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
|
1228
|
-
};
|
1229
|
-
|
1230
|
-
var prototypeAccessors = { namespaced: { configurable: true } };
|
1231
|
-
|
1232
|
-
prototypeAccessors.namespaced.get = function () {
|
1233
|
-
return !!this._rawModule.namespaced
|
1234
|
-
};
|
1235
|
-
|
1236
|
-
Module.prototype.addChild = function addChild (key, module) {
|
1237
|
-
this._children[key] = module;
|
1238
|
-
};
|
1239
|
-
|
1240
|
-
Module.prototype.removeChild = function removeChild (key) {
|
1241
|
-
delete this._children[key];
|
1242
|
-
};
|
1243
|
-
|
1244
|
-
Module.prototype.getChild = function getChild (key) {
|
1245
|
-
return this._children[key]
|
1246
|
-
};
|
1247
|
-
|
1248
|
-
Module.prototype.hasChild = function hasChild (key) {
|
1249
|
-
return key in this._children
|
1250
|
-
};
|
1251
|
-
|
1252
|
-
Module.prototype.update = function update (rawModule) {
|
1253
|
-
this._rawModule.namespaced = rawModule.namespaced;
|
1254
|
-
if (rawModule.actions) {
|
1255
|
-
this._rawModule.actions = rawModule.actions;
|
1256
|
-
}
|
1257
|
-
if (rawModule.mutations) {
|
1258
|
-
this._rawModule.mutations = rawModule.mutations;
|
1259
|
-
}
|
1260
|
-
if (rawModule.getters) {
|
1261
|
-
this._rawModule.getters = rawModule.getters;
|
1262
|
-
}
|
1263
|
-
};
|
1264
|
-
|
1265
|
-
Module.prototype.forEachChild = function forEachChild (fn) {
|
1266
|
-
forEachValue(this._children, fn);
|
1267
|
-
};
|
1268
|
-
|
1269
|
-
Module.prototype.forEachGetter = function forEachGetter (fn) {
|
1270
|
-
if (this._rawModule.getters) {
|
1271
|
-
forEachValue(this._rawModule.getters, fn);
|
1272
|
-
}
|
1273
|
-
};
|
1274
|
-
|
1275
|
-
Module.prototype.forEachAction = function forEachAction (fn) {
|
1276
|
-
if (this._rawModule.actions) {
|
1277
|
-
forEachValue(this._rawModule.actions, fn);
|
1278
|
-
}
|
1279
|
-
};
|
1280
|
-
|
1281
|
-
Module.prototype.forEachMutation = function forEachMutation (fn) {
|
1282
|
-
if (this._rawModule.mutations) {
|
1283
|
-
forEachValue(this._rawModule.mutations, fn);
|
1284
|
-
}
|
1285
|
-
};
|
1286
|
-
|
1287
|
-
Object.defineProperties( Module.prototype, prototypeAccessors );
|
1288
|
-
|
1289
|
-
var ModuleCollection = function ModuleCollection (rawRootModule) {
|
1290
|
-
// register root module (Vuex.Store options)
|
1291
|
-
this.register([], rawRootModule, false);
|
1292
|
-
};
|
1293
|
-
|
1294
|
-
ModuleCollection.prototype.get = function get (path) {
|
1295
|
-
return path.reduce(function (module, key) {
|
1296
|
-
return module.getChild(key)
|
1297
|
-
}, this.root)
|
1298
|
-
};
|
1299
|
-
|
1300
|
-
ModuleCollection.prototype.getNamespace = function getNamespace (path) {
|
1301
|
-
var module = this.root;
|
1302
|
-
return path.reduce(function (namespace, key) {
|
1303
|
-
module = module.getChild(key);
|
1304
|
-
return namespace + (module.namespaced ? key + '/' : '')
|
1305
|
-
}, '')
|
1306
|
-
};
|
1307
|
-
|
1308
|
-
ModuleCollection.prototype.update = function update$1 (rawRootModule) {
|
1309
|
-
update([], this.root, rawRootModule);
|
1310
|
-
};
|
1311
|
-
|
1312
|
-
ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
|
1313
|
-
var this$1 = this;
|
1314
|
-
if ( runtime === void 0 ) runtime = true;
|
1315
|
-
|
1316
|
-
if ((false)) {}
|
1317
|
-
|
1318
|
-
var newModule = new Module(rawModule, runtime);
|
1319
|
-
if (path.length === 0) {
|
1320
|
-
this.root = newModule;
|
1321
|
-
} else {
|
1322
|
-
var parent = this.get(path.slice(0, -1));
|
1323
|
-
parent.addChild(path[path.length - 1], newModule);
|
1324
|
-
}
|
1325
|
-
|
1326
|
-
// register nested modules
|
1327
|
-
if (rawModule.modules) {
|
1328
|
-
forEachValue(rawModule.modules, function (rawChildModule, key) {
|
1329
|
-
this$1.register(path.concat(key), rawChildModule, runtime);
|
1330
|
-
});
|
1331
|
-
}
|
1332
|
-
};
|
1333
|
-
|
1334
|
-
ModuleCollection.prototype.unregister = function unregister (path) {
|
1335
|
-
var parent = this.get(path.slice(0, -1));
|
1336
|
-
var key = path[path.length - 1];
|
1337
|
-
var child = parent.getChild(key);
|
1338
|
-
|
1339
|
-
if (!child) {
|
1340
|
-
if ((false)) {}
|
1341
|
-
return
|
1342
|
-
}
|
1343
|
-
|
1344
|
-
if (!child.runtime) {
|
1345
|
-
return
|
1346
|
-
}
|
1347
|
-
|
1348
|
-
parent.removeChild(key);
|
1349
|
-
};
|
1350
|
-
|
1351
|
-
ModuleCollection.prototype.isRegistered = function isRegistered (path) {
|
1352
|
-
var parent = this.get(path.slice(0, -1));
|
1353
|
-
var key = path[path.length - 1];
|
1354
|
-
|
1355
|
-
if (parent) {
|
1356
|
-
return parent.hasChild(key)
|
1357
|
-
}
|
1358
|
-
|
1359
|
-
return false
|
1360
|
-
};
|
1361
|
-
|
1362
|
-
function update (path, targetModule, newModule) {
|
1363
|
-
if ((false)) {}
|
1364
|
-
|
1365
|
-
// update target module
|
1366
|
-
targetModule.update(newModule);
|
1367
|
-
|
1368
|
-
// update nested modules
|
1369
|
-
if (newModule.modules) {
|
1370
|
-
for (var key in newModule.modules) {
|
1371
|
-
if (!targetModule.getChild(key)) {
|
1372
|
-
if ((false)) {}
|
1373
|
-
return
|
1374
|
-
}
|
1375
|
-
update(
|
1376
|
-
path.concat(key),
|
1377
|
-
targetModule.getChild(key),
|
1378
|
-
newModule.modules[key]
|
1379
|
-
);
|
1380
|
-
}
|
1381
|
-
}
|
1382
|
-
}
|
1383
|
-
|
1384
|
-
var functionAssert = {
|
1385
|
-
assert: function (value) { return typeof value === 'function'; },
|
1386
|
-
expected: 'function'
|
1387
|
-
};
|
1388
|
-
|
1389
|
-
var objectAssert = {
|
1390
|
-
assert: function (value) { return typeof value === 'function' ||
|
1391
|
-
(typeof value === 'object' && typeof value.handler === 'function'); },
|
1392
|
-
expected: 'function or object with "handler" function'
|
1393
|
-
};
|
1394
|
-
|
1395
|
-
var assertTypes = {
|
1396
|
-
getters: functionAssert,
|
1397
|
-
mutations: functionAssert,
|
1398
|
-
actions: objectAssert
|
1399
|
-
};
|
1400
|
-
|
1401
|
-
function assertRawModule (path, rawModule) {
|
1402
|
-
Object.keys(assertTypes).forEach(function (key) {
|
1403
|
-
if (!rawModule[key]) { return }
|
1404
|
-
|
1405
|
-
var assertOptions = assertTypes[key];
|
1406
|
-
|
1407
|
-
forEachValue(rawModule[key], function (value, type) {
|
1408
|
-
assert(
|
1409
|
-
assertOptions.assert(value),
|
1410
|
-
makeAssertionMessage(path, key, type, value, assertOptions.expected)
|
1411
|
-
);
|
1412
|
-
});
|
1413
|
-
});
|
1414
|
-
}
|
1415
|
-
|
1416
|
-
function makeAssertionMessage (path, key, type, value, expected) {
|
1417
|
-
var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
|
1418
|
-
if (path.length > 0) {
|
1419
|
-
buf += " in module \"" + (path.join('.')) + "\"";
|
1420
|
-
}
|
1421
|
-
buf += " is " + (JSON.stringify(value)) + ".";
|
1422
|
-
return buf
|
1423
|
-
}
|
1424
|
-
|
1425
|
-
var Vue; // bind on install
|
1426
|
-
|
1427
|
-
var Store = function Store (options) {
|
1428
|
-
var this$1 = this;
|
1429
|
-
if ( options === void 0 ) options = {};
|
1430
|
-
|
1431
|
-
// Auto install if it is not done yet and `window` has `Vue`.
|
1432
|
-
// To allow users to avoid auto-installation in some cases,
|
1433
|
-
// this code should be placed here. See #731
|
1434
|
-
if (!Vue && typeof window !== 'undefined' && window.Vue) {
|
1435
|
-
install(window.Vue);
|
1436
|
-
}
|
1437
|
-
|
1438
|
-
if ((false)) {}
|
1439
|
-
|
1440
|
-
var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
|
1441
|
-
var strict = options.strict; if ( strict === void 0 ) strict = false;
|
1442
|
-
|
1443
|
-
// store internal state
|
1444
|
-
this._committing = false;
|
1445
|
-
this._actions = Object.create(null);
|
1446
|
-
this._actionSubscribers = [];
|
1447
|
-
this._mutations = Object.create(null);
|
1448
|
-
this._wrappedGetters = Object.create(null);
|
1449
|
-
this._modules = new ModuleCollection(options);
|
1450
|
-
this._modulesNamespaceMap = Object.create(null);
|
1451
|
-
this._subscribers = [];
|
1452
|
-
this._watcherVM = new Vue();
|
1453
|
-
this._makeLocalGettersCache = Object.create(null);
|
1454
|
-
|
1455
|
-
// bind commit and dispatch to self
|
1456
|
-
var store = this;
|
1457
|
-
var ref = this;
|
1458
|
-
var dispatch = ref.dispatch;
|
1459
|
-
var commit = ref.commit;
|
1460
|
-
this.dispatch = function boundDispatch (type, payload) {
|
1461
|
-
return dispatch.call(store, type, payload)
|
1462
|
-
};
|
1463
|
-
this.commit = function boundCommit (type, payload, options) {
|
1464
|
-
return commit.call(store, type, payload, options)
|
1465
|
-
};
|
1466
|
-
|
1467
|
-
// strict mode
|
1468
|
-
this.strict = strict;
|
1469
|
-
|
1470
|
-
var state = this._modules.root.state;
|
1471
|
-
|
1472
|
-
// init root module.
|
1473
|
-
// this also recursively registers all sub-modules
|
1474
|
-
// and collects all module getters inside this._wrappedGetters
|
1475
|
-
installModule(this, state, [], this._modules.root);
|
1476
|
-
|
1477
|
-
// initialize the store vm, which is responsible for the reactivity
|
1478
|
-
// (also registers _wrappedGetters as computed properties)
|
1479
|
-
resetStoreVM(this, state);
|
1480
|
-
|
1481
|
-
// apply plugins
|
1482
|
-
plugins.forEach(function (plugin) { return plugin(this$1); });
|
1483
|
-
|
1484
|
-
var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
|
1485
|
-
if (useDevtools) {
|
1486
|
-
devtoolPlugin(this);
|
1487
|
-
}
|
1488
|
-
};
|
1489
|
-
|
1490
|
-
var prototypeAccessors$1 = { state: { configurable: true } };
|
1491
|
-
|
1492
|
-
prototypeAccessors$1.state.get = function () {
|
1493
|
-
return this._vm._data.$$state
|
1494
|
-
};
|
1495
|
-
|
1496
|
-
prototypeAccessors$1.state.set = function (v) {
|
1497
|
-
if ((false)) {}
|
1498
|
-
};
|
1499
|
-
|
1500
|
-
Store.prototype.commit = function commit (_type, _payload, _options) {
|
1501
|
-
var this$1 = this;
|
1502
|
-
|
1503
|
-
// check object-style commit
|
1504
|
-
var ref = unifyObjectStyle(_type, _payload, _options);
|
1505
|
-
var type = ref.type;
|
1506
|
-
var payload = ref.payload;
|
1507
|
-
var options = ref.options;
|
1508
|
-
|
1509
|
-
var mutation = { type: type, payload: payload };
|
1510
|
-
var entry = this._mutations[type];
|
1511
|
-
if (!entry) {
|
1512
|
-
if ((false)) {}
|
1513
|
-
return
|
1514
|
-
}
|
1515
|
-
this._withCommit(function () {
|
1516
|
-
entry.forEach(function commitIterator (handler) {
|
1517
|
-
handler(payload);
|
1518
|
-
});
|
1519
|
-
});
|
1520
|
-
|
1521
|
-
this._subscribers
|
1522
|
-
.slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
|
1523
|
-
.forEach(function (sub) { return sub(mutation, this$1.state); });
|
1524
|
-
|
1525
|
-
if (
|
1526
|
-
false
|
1527
|
-
) {}
|
1528
|
-
};
|
1529
|
-
|
1530
|
-
Store.prototype.dispatch = function dispatch (_type, _payload) {
|
1531
|
-
var this$1 = this;
|
1532
|
-
|
1533
|
-
// check object-style dispatch
|
1534
|
-
var ref = unifyObjectStyle(_type, _payload);
|
1535
|
-
var type = ref.type;
|
1536
|
-
var payload = ref.payload;
|
1537
|
-
|
1538
|
-
var action = { type: type, payload: payload };
|
1539
|
-
var entry = this._actions[type];
|
1540
|
-
if (!entry) {
|
1541
|
-
if ((false)) {}
|
1542
|
-
return
|
1543
|
-
}
|
1544
|
-
|
1545
|
-
try {
|
1546
|
-
this._actionSubscribers
|
1547
|
-
.slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
|
1548
|
-
.filter(function (sub) { return sub.before; })
|
1549
|
-
.forEach(function (sub) { return sub.before(action, this$1.state); });
|
1550
|
-
} catch (e) {
|
1551
|
-
if ((false)) {}
|
1552
|
-
}
|
1553
|
-
|
1554
|
-
var result = entry.length > 1
|
1555
|
-
? Promise.all(entry.map(function (handler) { return handler(payload); }))
|
1556
|
-
: entry[0](payload);
|
1557
|
-
|
1558
|
-
return new Promise(function (resolve, reject) {
|
1559
|
-
result.then(function (res) {
|
1560
|
-
try {
|
1561
|
-
this$1._actionSubscribers
|
1562
|
-
.filter(function (sub) { return sub.after; })
|
1563
|
-
.forEach(function (sub) { return sub.after(action, this$1.state); });
|
1564
|
-
} catch (e) {
|
1565
|
-
if ((false)) {}
|
1566
|
-
}
|
1567
|
-
resolve(res);
|
1568
|
-
}, function (error) {
|
1569
|
-
try {
|
1570
|
-
this$1._actionSubscribers
|
1571
|
-
.filter(function (sub) { return sub.error; })
|
1572
|
-
.forEach(function (sub) { return sub.error(action, this$1.state, error); });
|
1573
|
-
} catch (e) {
|
1574
|
-
if ((false)) {}
|
1575
|
-
}
|
1576
|
-
reject(error);
|
1577
|
-
});
|
1578
|
-
})
|
1579
|
-
};
|
1580
|
-
|
1581
|
-
Store.prototype.subscribe = function subscribe (fn, options) {
|
1582
|
-
return genericSubscribe(fn, this._subscribers, options)
|
1583
|
-
};
|
1584
|
-
|
1585
|
-
Store.prototype.subscribeAction = function subscribeAction (fn, options) {
|
1586
|
-
var subs = typeof fn === 'function' ? { before: fn } : fn;
|
1587
|
-
return genericSubscribe(subs, this._actionSubscribers, options)
|
1588
|
-
};
|
1589
|
-
|
1590
|
-
Store.prototype.watch = function watch (getter, cb, options) {
|
1591
|
-
var this$1 = this;
|
1592
|
-
|
1593
|
-
if ((false)) {}
|
1594
|
-
return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
|
1595
|
-
};
|
1596
|
-
|
1597
|
-
Store.prototype.replaceState = function replaceState (state) {
|
1598
|
-
var this$1 = this;
|
1599
|
-
|
1600
|
-
this._withCommit(function () {
|
1601
|
-
this$1._vm._data.$$state = state;
|
1602
|
-
});
|
1603
|
-
};
|
1604
|
-
|
1605
|
-
Store.prototype.registerModule = function registerModule (path, rawModule, options) {
|
1606
|
-
if ( options === void 0 ) options = {};
|
1607
|
-
|
1608
|
-
if (typeof path === 'string') { path = [path]; }
|
1609
|
-
|
1610
|
-
if ((false)) {}
|
1611
|
-
|
1612
|
-
this._modules.register(path, rawModule);
|
1613
|
-
installModule(this, this.state, path, this._modules.get(path), options.preserveState);
|
1614
|
-
// reset store to update getters...
|
1615
|
-
resetStoreVM(this, this.state);
|
1616
|
-
};
|
1617
|
-
|
1618
|
-
Store.prototype.unregisterModule = function unregisterModule (path) {
|
1619
|
-
var this$1 = this;
|
1620
|
-
|
1621
|
-
if (typeof path === 'string') { path = [path]; }
|
1622
|
-
|
1623
|
-
if ((false)) {}
|
1624
|
-
|
1625
|
-
this._modules.unregister(path);
|
1626
|
-
this._withCommit(function () {
|
1627
|
-
var parentState = getNestedState(this$1.state, path.slice(0, -1));
|
1628
|
-
Vue.delete(parentState, path[path.length - 1]);
|
1629
|
-
});
|
1630
|
-
resetStore(this);
|
1631
|
-
};
|
1632
|
-
|
1633
|
-
Store.prototype.hasModule = function hasModule (path) {
|
1634
|
-
if (typeof path === 'string') { path = [path]; }
|
1635
|
-
|
1636
|
-
if ((false)) {}
|
1637
|
-
|
1638
|
-
return this._modules.isRegistered(path)
|
1639
|
-
};
|
1640
|
-
|
1641
|
-
Store.prototype.hotUpdate = function hotUpdate (newOptions) {
|
1642
|
-
this._modules.update(newOptions);
|
1643
|
-
resetStore(this, true);
|
1644
|
-
};
|
1645
|
-
|
1646
|
-
Store.prototype._withCommit = function _withCommit (fn) {
|
1647
|
-
var committing = this._committing;
|
1648
|
-
this._committing = true;
|
1649
|
-
fn();
|
1650
|
-
this._committing = committing;
|
1651
|
-
};
|
1652
|
-
|
1653
|
-
Object.defineProperties( Store.prototype, prototypeAccessors$1 );
|
1654
|
-
|
1655
|
-
function genericSubscribe (fn, subs, options) {
|
1656
|
-
if (subs.indexOf(fn) < 0) {
|
1657
|
-
options && options.prepend
|
1658
|
-
? subs.unshift(fn)
|
1659
|
-
: subs.push(fn);
|
1660
|
-
}
|
1661
|
-
return function () {
|
1662
|
-
var i = subs.indexOf(fn);
|
1663
|
-
if (i > -1) {
|
1664
|
-
subs.splice(i, 1);
|
1665
|
-
}
|
1666
|
-
}
|
1667
|
-
}
|
1668
|
-
|
1669
|
-
function resetStore (store, hot) {
|
1670
|
-
store._actions = Object.create(null);
|
1671
|
-
store._mutations = Object.create(null);
|
1672
|
-
store._wrappedGetters = Object.create(null);
|
1673
|
-
store._modulesNamespaceMap = Object.create(null);
|
1674
|
-
var state = store.state;
|
1675
|
-
// init all modules
|
1676
|
-
installModule(store, state, [], store._modules.root, true);
|
1677
|
-
// reset vm
|
1678
|
-
resetStoreVM(store, state, hot);
|
1679
|
-
}
|
1680
|
-
|
1681
|
-
function resetStoreVM (store, state, hot) {
|
1682
|
-
var oldVm = store._vm;
|
1683
|
-
|
1684
|
-
// bind store public getters
|
1685
|
-
store.getters = {};
|
1686
|
-
// reset local getters cache
|
1687
|
-
store._makeLocalGettersCache = Object.create(null);
|
1688
|
-
var wrappedGetters = store._wrappedGetters;
|
1689
|
-
var computed = {};
|
1690
|
-
forEachValue(wrappedGetters, function (fn, key) {
|
1691
|
-
// use computed to leverage its lazy-caching mechanism
|
1692
|
-
// direct inline function use will lead to closure preserving oldVm.
|
1693
|
-
// using partial to return function with only arguments preserved in closure environment.
|
1694
|
-
computed[key] = partial(fn, store);
|
1695
|
-
Object.defineProperty(store.getters, key, {
|
1696
|
-
get: function () { return store._vm[key]; },
|
1697
|
-
enumerable: true // for local getters
|
1698
|
-
});
|
1699
|
-
});
|
1700
|
-
|
1701
|
-
// use a Vue instance to store the state tree
|
1702
|
-
// suppress warnings just in case the user has added
|
1703
|
-
// some funky global mixins
|
1704
|
-
var silent = Vue.config.silent;
|
1705
|
-
Vue.config.silent = true;
|
1706
|
-
store._vm = new Vue({
|
1707
|
-
data: {
|
1708
|
-
$$state: state
|
1709
|
-
},
|
1710
|
-
computed: computed
|
1711
|
-
});
|
1712
|
-
Vue.config.silent = silent;
|
1713
|
-
|
1714
|
-
// enable strict mode for new vm
|
1715
|
-
if (store.strict) {
|
1716
|
-
enableStrictMode(store);
|
1717
|
-
}
|
1718
|
-
|
1719
|
-
if (oldVm) {
|
1720
|
-
if (hot) {
|
1721
|
-
// dispatch changes in all subscribed watchers
|
1722
|
-
// to force getter re-evaluation for hot reloading.
|
1723
|
-
store._withCommit(function () {
|
1724
|
-
oldVm._data.$$state = null;
|
1725
|
-
});
|
1726
|
-
}
|
1727
|
-
Vue.nextTick(function () { return oldVm.$destroy(); });
|
1728
|
-
}
|
1729
|
-
}
|
1730
|
-
|
1731
|
-
function installModule (store, rootState, path, module, hot) {
|
1732
|
-
var isRoot = !path.length;
|
1733
|
-
var namespace = store._modules.getNamespace(path);
|
1734
|
-
|
1735
|
-
// register in namespace map
|
1736
|
-
if (module.namespaced) {
|
1737
|
-
if (store._modulesNamespaceMap[namespace] && ("production" !== 'production')) {}
|
1738
|
-
store._modulesNamespaceMap[namespace] = module;
|
1739
|
-
}
|
1740
|
-
|
1741
|
-
// set state
|
1742
|
-
if (!isRoot && !hot) {
|
1743
|
-
var parentState = getNestedState(rootState, path.slice(0, -1));
|
1744
|
-
var moduleName = path[path.length - 1];
|
1745
|
-
store._withCommit(function () {
|
1746
|
-
if ((false)) {}
|
1747
|
-
Vue.set(parentState, moduleName, module.state);
|
1748
|
-
});
|
1749
|
-
}
|
1750
|
-
|
1751
|
-
var local = module.context = makeLocalContext(store, namespace, path);
|
1752
|
-
|
1753
|
-
module.forEachMutation(function (mutation, key) {
|
1754
|
-
var namespacedType = namespace + key;
|
1755
|
-
registerMutation(store, namespacedType, mutation, local);
|
1756
|
-
});
|
1757
|
-
|
1758
|
-
module.forEachAction(function (action, key) {
|
1759
|
-
var type = action.root ? key : namespace + key;
|
1760
|
-
var handler = action.handler || action;
|
1761
|
-
registerAction(store, type, handler, local);
|
1762
|
-
});
|
1763
|
-
|
1764
|
-
module.forEachGetter(function (getter, key) {
|
1765
|
-
var namespacedType = namespace + key;
|
1766
|
-
registerGetter(store, namespacedType, getter, local);
|
1767
|
-
});
|
1768
|
-
|
1769
|
-
module.forEachChild(function (child, key) {
|
1770
|
-
installModule(store, rootState, path.concat(key), child, hot);
|
1771
|
-
});
|
1772
|
-
}
|
1773
|
-
|
1774
|
-
/**
|
1775
|
-
* make localized dispatch, commit, getters and state
|
1776
|
-
* if there is no namespace, just use root ones
|
1777
|
-
*/
|
1778
|
-
function makeLocalContext (store, namespace, path) {
|
1779
|
-
var noNamespace = namespace === '';
|
1780
|
-
|
1781
|
-
var local = {
|
1782
|
-
dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
|
1783
|
-
var args = unifyObjectStyle(_type, _payload, _options);
|
1784
|
-
var payload = args.payload;
|
1785
|
-
var options = args.options;
|
1786
|
-
var type = args.type;
|
1787
|
-
|
1788
|
-
if (!options || !options.root) {
|
1789
|
-
type = namespace + type;
|
1790
|
-
if (false) {}
|
1791
|
-
}
|
1792
|
-
|
1793
|
-
return store.dispatch(type, payload)
|
1794
|
-
},
|
1795
|
-
|
1796
|
-
commit: noNamespace ? store.commit : function (_type, _payload, _options) {
|
1797
|
-
var args = unifyObjectStyle(_type, _payload, _options);
|
1798
|
-
var payload = args.payload;
|
1799
|
-
var options = args.options;
|
1800
|
-
var type = args.type;
|
1801
|
-
|
1802
|
-
if (!options || !options.root) {
|
1803
|
-
type = namespace + type;
|
1804
|
-
if (false) {}
|
1805
|
-
}
|
1806
|
-
|
1807
|
-
store.commit(type, payload, options);
|
1808
|
-
}
|
1809
|
-
};
|
1810
|
-
|
1811
|
-
// getters and state object must be gotten lazily
|
1812
|
-
// because they will be changed by vm update
|
1813
|
-
Object.defineProperties(local, {
|
1814
|
-
getters: {
|
1815
|
-
get: noNamespace
|
1816
|
-
? function () { return store.getters; }
|
1817
|
-
: function () { return makeLocalGetters(store, namespace); }
|
1818
|
-
},
|
1819
|
-
state: {
|
1820
|
-
get: function () { return getNestedState(store.state, path); }
|
1821
|
-
}
|
1822
|
-
});
|
1823
|
-
|
1824
|
-
return local
|
1825
|
-
}
|
1826
|
-
|
1827
|
-
function makeLocalGetters (store, namespace) {
|
1828
|
-
if (!store._makeLocalGettersCache[namespace]) {
|
1829
|
-
var gettersProxy = {};
|
1830
|
-
var splitPos = namespace.length;
|
1831
|
-
Object.keys(store.getters).forEach(function (type) {
|
1832
|
-
// skip if the target getter is not match this namespace
|
1833
|
-
if (type.slice(0, splitPos) !== namespace) { return }
|
1834
|
-
|
1835
|
-
// extract local getter type
|
1836
|
-
var localType = type.slice(splitPos);
|
1837
|
-
|
1838
|
-
// Add a port to the getters proxy.
|
1839
|
-
// Define as getter property because
|
1840
|
-
// we do not want to evaluate the getters in this time.
|
1841
|
-
Object.defineProperty(gettersProxy, localType, {
|
1842
|
-
get: function () { return store.getters[type]; },
|
1843
|
-
enumerable: true
|
1844
|
-
});
|
1845
|
-
});
|
1846
|
-
store._makeLocalGettersCache[namespace] = gettersProxy;
|
1847
|
-
}
|
1848
|
-
|
1849
|
-
return store._makeLocalGettersCache[namespace]
|
1850
|
-
}
|
1851
|
-
|
1852
|
-
function registerMutation (store, type, handler, local) {
|
1853
|
-
var entry = store._mutations[type] || (store._mutations[type] = []);
|
1854
|
-
entry.push(function wrappedMutationHandler (payload) {
|
1855
|
-
handler.call(store, local.state, payload);
|
1856
|
-
});
|
1857
|
-
}
|
1858
|
-
|
1859
|
-
function registerAction (store, type, handler, local) {
|
1860
|
-
var entry = store._actions[type] || (store._actions[type] = []);
|
1861
|
-
entry.push(function wrappedActionHandler (payload) {
|
1862
|
-
var res = handler.call(store, {
|
1863
|
-
dispatch: local.dispatch,
|
1864
|
-
commit: local.commit,
|
1865
|
-
getters: local.getters,
|
1866
|
-
state: local.state,
|
1867
|
-
rootGetters: store.getters,
|
1868
|
-
rootState: store.state
|
1869
|
-
}, payload);
|
1870
|
-
if (!isPromise(res)) {
|
1871
|
-
res = Promise.resolve(res);
|
1872
|
-
}
|
1873
|
-
if (store._devtoolHook) {
|
1874
|
-
return res.catch(function (err) {
|
1875
|
-
store._devtoolHook.emit('vuex:error', err);
|
1876
|
-
throw err
|
1877
|
-
})
|
1878
|
-
} else {
|
1879
|
-
return res
|
1880
|
-
}
|
1881
|
-
});
|
1882
|
-
}
|
1883
|
-
|
1884
|
-
function registerGetter (store, type, rawGetter, local) {
|
1885
|
-
if (store._wrappedGetters[type]) {
|
1886
|
-
if ((false)) {}
|
1887
|
-
return
|
1888
|
-
}
|
1889
|
-
store._wrappedGetters[type] = function wrappedGetter (store) {
|
1890
|
-
return rawGetter(
|
1891
|
-
local.state, // local state
|
1892
|
-
local.getters, // local getters
|
1893
|
-
store.state, // root state
|
1894
|
-
store.getters // root getters
|
1895
|
-
)
|
1896
|
-
};
|
1897
|
-
}
|
1898
|
-
|
1899
|
-
function enableStrictMode (store) {
|
1900
|
-
store._vm.$watch(function () { return this._data.$$state }, function () {
|
1901
|
-
if ((false)) {}
|
1902
|
-
}, { deep: true, sync: true });
|
1903
|
-
}
|
1904
|
-
|
1905
|
-
function getNestedState (state, path) {
|
1906
|
-
return path.reduce(function (state, key) { return state[key]; }, state)
|
1907
|
-
}
|
1908
|
-
|
1909
|
-
function unifyObjectStyle (type, payload, options) {
|
1910
|
-
if (isObject(type) && type.type) {
|
1911
|
-
options = payload;
|
1912
|
-
payload = type;
|
1913
|
-
type = type.type;
|
1914
|
-
}
|
1915
|
-
|
1916
|
-
if ((false)) {}
|
1917
|
-
|
1918
|
-
return { type: type, payload: payload, options: options }
|
1919
|
-
}
|
1920
|
-
|
1921
|
-
function install (_Vue) {
|
1922
|
-
if (Vue && _Vue === Vue) {
|
1923
|
-
if ((false)) {}
|
1924
|
-
return
|
1925
|
-
}
|
1926
|
-
Vue = _Vue;
|
1927
|
-
applyMixin(Vue);
|
1928
|
-
}
|
1929
|
-
|
1930
|
-
/**
|
1931
|
-
* Reduce the code which written in Vue.js for getting the state.
|
1932
|
-
* @param {String} [namespace] - Module's namespace
|
1933
|
-
* @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
|
1934
|
-
* @param {Object}
|
1935
|
-
*/
|
1936
|
-
var mapState = normalizeNamespace(function (namespace, states) {
|
1937
|
-
var res = {};
|
1938
|
-
if (false) {}
|
1939
|
-
normalizeMap(states).forEach(function (ref) {
|
1940
|
-
var key = ref.key;
|
1941
|
-
var val = ref.val;
|
1942
|
-
|
1943
|
-
res[key] = function mappedState () {
|
1944
|
-
var state = this.$store.state;
|
1945
|
-
var getters = this.$store.getters;
|
1946
|
-
if (namespace) {
|
1947
|
-
var module = getModuleByNamespace(this.$store, 'mapState', namespace);
|
1948
|
-
if (!module) {
|
1949
|
-
return
|
1950
|
-
}
|
1951
|
-
state = module.context.state;
|
1952
|
-
getters = module.context.getters;
|
1953
|
-
}
|
1954
|
-
return typeof val === 'function'
|
1955
|
-
? val.call(this, state, getters)
|
1956
|
-
: state[val]
|
1957
|
-
};
|
1958
|
-
// mark vuex getter for devtools
|
1959
|
-
res[key].vuex = true;
|
1960
|
-
});
|
1961
|
-
return res
|
1962
|
-
});
|
1963
|
-
|
1964
|
-
/**
|
1965
|
-
* Reduce the code which written in Vue.js for committing the mutation
|
1966
|
-
* @param {String} [namespace] - Module's namespace
|
1967
|
-
* @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept another params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
|
1968
|
-
* @return {Object}
|
1969
|
-
*/
|
1970
|
-
var mapMutations = normalizeNamespace(function (namespace, mutations) {
|
1971
|
-
var res = {};
|
1972
|
-
if (false) {}
|
1973
|
-
normalizeMap(mutations).forEach(function (ref) {
|
1974
|
-
var key = ref.key;
|
1975
|
-
var val = ref.val;
|
1976
|
-
|
1977
|
-
res[key] = function mappedMutation () {
|
1978
|
-
var args = [], len = arguments.length;
|
1979
|
-
while ( len-- ) args[ len ] = arguments[ len ];
|
1980
|
-
|
1981
|
-
// Get the commit method from store
|
1982
|
-
var commit = this.$store.commit;
|
1983
|
-
if (namespace) {
|
1984
|
-
var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
|
1985
|
-
if (!module) {
|
1986
|
-
return
|
1987
|
-
}
|
1988
|
-
commit = module.context.commit;
|
1989
|
-
}
|
1990
|
-
return typeof val === 'function'
|
1991
|
-
? val.apply(this, [commit].concat(args))
|
1992
|
-
: commit.apply(this.$store, [val].concat(args))
|
1993
|
-
};
|
1994
|
-
});
|
1995
|
-
return res
|
1996
|
-
});
|
1997
|
-
|
1998
|
-
/**
|
1999
|
-
* Reduce the code which written in Vue.js for getting the getters
|
2000
|
-
* @param {String} [namespace] - Module's namespace
|
2001
|
-
* @param {Object|Array} getters
|
2002
|
-
* @return {Object}
|
2003
|
-
*/
|
2004
|
-
var mapGetters = normalizeNamespace(function (namespace, getters) {
|
2005
|
-
var res = {};
|
2006
|
-
if (false) {}
|
2007
|
-
normalizeMap(getters).forEach(function (ref) {
|
2008
|
-
var key = ref.key;
|
2009
|
-
var val = ref.val;
|
2010
|
-
|
2011
|
-
// The namespace has been mutated by normalizeNamespace
|
2012
|
-
val = namespace + val;
|
2013
|
-
res[key] = function mappedGetter () {
|
2014
|
-
if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
|
2015
|
-
return
|
2016
|
-
}
|
2017
|
-
if (false) {}
|
2018
|
-
return this.$store.getters[val]
|
2019
|
-
};
|
2020
|
-
// mark vuex getter for devtools
|
2021
|
-
res[key].vuex = true;
|
2022
|
-
});
|
2023
|
-
return res
|
2024
|
-
});
|
2025
|
-
|
2026
|
-
/**
|
2027
|
-
* Reduce the code which written in Vue.js for dispatch the action
|
2028
|
-
* @param {String} [namespace] - Module's namespace
|
2029
|
-
* @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
|
2030
|
-
* @return {Object}
|
2031
|
-
*/
|
2032
|
-
var mapActions = normalizeNamespace(function (namespace, actions) {
|
2033
|
-
var res = {};
|
2034
|
-
if (false) {}
|
2035
|
-
normalizeMap(actions).forEach(function (ref) {
|
2036
|
-
var key = ref.key;
|
2037
|
-
var val = ref.val;
|
2038
|
-
|
2039
|
-
res[key] = function mappedAction () {
|
2040
|
-
var args = [], len = arguments.length;
|
2041
|
-
while ( len-- ) args[ len ] = arguments[ len ];
|
2042
|
-
|
2043
|
-
// get dispatch function from store
|
2044
|
-
var dispatch = this.$store.dispatch;
|
2045
|
-
if (namespace) {
|
2046
|
-
var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
|
2047
|
-
if (!module) {
|
2048
|
-
return
|
2049
|
-
}
|
2050
|
-
dispatch = module.context.dispatch;
|
2051
|
-
}
|
2052
|
-
return typeof val === 'function'
|
2053
|
-
? val.apply(this, [dispatch].concat(args))
|
2054
|
-
: dispatch.apply(this.$store, [val].concat(args))
|
2055
|
-
};
|
2056
|
-
});
|
2057
|
-
return res
|
2058
|
-
});
|
2059
|
-
|
2060
|
-
/**
|
2061
|
-
* Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
|
2062
|
-
* @param {String} namespace
|
2063
|
-
* @return {Object}
|
2064
|
-
*/
|
2065
|
-
var createNamespacedHelpers = function (namespace) { return ({
|
2066
|
-
mapState: mapState.bind(null, namespace),
|
2067
|
-
mapGetters: mapGetters.bind(null, namespace),
|
2068
|
-
mapMutations: mapMutations.bind(null, namespace),
|
2069
|
-
mapActions: mapActions.bind(null, namespace)
|
2070
|
-
}); };
|
2071
|
-
|
2072
|
-
/**
|
2073
|
-
* Normalize the map
|
2074
|
-
* normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
|
2075
|
-
* normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
|
2076
|
-
* @param {Array|Object} map
|
2077
|
-
* @return {Object}
|
2078
|
-
*/
|
2079
|
-
function normalizeMap (map) {
|
2080
|
-
if (!isValidMap(map)) {
|
2081
|
-
return []
|
2082
|
-
}
|
2083
|
-
return Array.isArray(map)
|
2084
|
-
? map.map(function (key) { return ({ key: key, val: key }); })
|
2085
|
-
: Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
|
2086
|
-
}
|
2087
|
-
|
2088
|
-
/**
|
2089
|
-
* Validate whether given map is valid or not
|
2090
|
-
* @param {*} map
|
2091
|
-
* @return {Boolean}
|
2092
|
-
*/
|
2093
|
-
function isValidMap (map) {
|
2094
|
-
return Array.isArray(map) || isObject(map)
|
2095
|
-
}
|
2096
|
-
|
2097
|
-
/**
|
2098
|
-
* Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
|
2099
|
-
* @param {Function} fn
|
2100
|
-
* @return {Function}
|
2101
|
-
*/
|
2102
|
-
function normalizeNamespace (fn) {
|
2103
|
-
return function (namespace, map) {
|
2104
|
-
if (typeof namespace !== 'string') {
|
2105
|
-
map = namespace;
|
2106
|
-
namespace = '';
|
2107
|
-
} else if (namespace.charAt(namespace.length - 1) !== '/') {
|
2108
|
-
namespace += '/';
|
2109
|
-
}
|
2110
|
-
return fn(namespace, map)
|
2111
|
-
}
|
2112
|
-
}
|
2113
|
-
|
2114
|
-
/**
|
2115
|
-
* Search a special module from store by namespace. if module not exist, print error message.
|
2116
|
-
* @param {Object} store
|
2117
|
-
* @param {String} helper
|
2118
|
-
* @param {String} namespace
|
2119
|
-
* @return {Object}
|
2120
|
-
*/
|
2121
|
-
function getModuleByNamespace (store, helper, namespace) {
|
2122
|
-
var module = store._modulesNamespaceMap[namespace];
|
2123
|
-
if (false) {}
|
2124
|
-
return module
|
2125
|
-
}
|
2126
|
-
|
2127
|
-
// Credits: borrowed code from fcomb/redux-logger
|
2128
|
-
|
2129
|
-
function createLogger (ref) {
|
2130
|
-
if ( ref === void 0 ) ref = {};
|
2131
|
-
var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;
|
2132
|
-
var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };
|
2133
|
-
var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };
|
2134
|
-
var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };
|
2135
|
-
var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };
|
2136
|
-
var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };
|
2137
|
-
var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;
|
2138
|
-
var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;
|
2139
|
-
var logger = ref.logger; if ( logger === void 0 ) logger = console;
|
2140
|
-
|
2141
|
-
return function (store) {
|
2142
|
-
var prevState = deepCopy(store.state);
|
2143
|
-
|
2144
|
-
if (typeof logger === 'undefined') {
|
2145
|
-
return
|
2146
|
-
}
|
2147
|
-
|
2148
|
-
if (logMutations) {
|
2149
|
-
store.subscribe(function (mutation, state) {
|
2150
|
-
var nextState = deepCopy(state);
|
2151
|
-
|
2152
|
-
if (filter(mutation, prevState, nextState)) {
|
2153
|
-
var formattedTime = getFormattedTime();
|
2154
|
-
var formattedMutation = mutationTransformer(mutation);
|
2155
|
-
var message = "mutation " + (mutation.type) + formattedTime;
|
2156
|
-
|
2157
|
-
startMessage(logger, message, collapsed);
|
2158
|
-
logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));
|
2159
|
-
logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);
|
2160
|
-
logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));
|
2161
|
-
endMessage(logger);
|
2162
|
-
}
|
2163
|
-
|
2164
|
-
prevState = nextState;
|
2165
|
-
});
|
2166
|
-
}
|
2167
|
-
|
2168
|
-
if (logActions) {
|
2169
|
-
store.subscribeAction(function (action, state) {
|
2170
|
-
if (actionFilter(action, state)) {
|
2171
|
-
var formattedTime = getFormattedTime();
|
2172
|
-
var formattedAction = actionTransformer(action);
|
2173
|
-
var message = "action " + (action.type) + formattedTime;
|
2174
|
-
|
2175
|
-
startMessage(logger, message, collapsed);
|
2176
|
-
logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);
|
2177
|
-
endMessage(logger);
|
2178
|
-
}
|
2179
|
-
});
|
2180
|
-
}
|
2181
|
-
}
|
2182
|
-
}
|
2183
|
-
|
2184
|
-
function startMessage (logger, message, collapsed) {
|
2185
|
-
var startMessage = collapsed
|
2186
|
-
? logger.groupCollapsed
|
2187
|
-
: logger.group;
|
2188
|
-
|
2189
|
-
// render
|
2190
|
-
try {
|
2191
|
-
startMessage.call(logger, message);
|
2192
|
-
} catch (e) {
|
2193
|
-
logger.log(message);
|
2194
|
-
}
|
2195
|
-
}
|
2196
|
-
|
2197
|
-
function endMessage (logger) {
|
2198
|
-
try {
|
2199
|
-
logger.groupEnd();
|
2200
|
-
} catch (e) {
|
2201
|
-
logger.log('—— log end ——');
|
2202
|
-
}
|
2203
|
-
}
|
2204
|
-
|
2205
|
-
function getFormattedTime () {
|
2206
|
-
var time = new Date();
|
2207
|
-
return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))
|
2208
|
-
}
|
2209
|
-
|
2210
|
-
function repeat (str, times) {
|
2211
|
-
return (new Array(times + 1)).join(str)
|
2212
|
-
}
|
2213
|
-
|
2214
|
-
function pad (num, maxLength) {
|
2215
|
-
return repeat('0', maxLength - num.toString().length) + num
|
2216
|
-
}
|
2217
|
-
|
2218
|
-
var index = {
|
2219
|
-
Store: Store,
|
2220
|
-
install: install,
|
2221
|
-
version: '3.6.2',
|
2222
|
-
mapState: mapState,
|
2223
|
-
mapMutations: mapMutations,
|
2224
|
-
mapGetters: mapGetters,
|
2225
|
-
mapActions: mapActions,
|
2226
|
-
createNamespacedHelpers: createNamespacedHelpers,
|
2227
|
-
createLogger: createLogger
|
2228
|
-
};
|
2229
|
-
|
2230
|
-
/* harmony default export */ var vuex_esm = ((/* unused pure expression or super */ null && (index)));
|
2231
|
-
|
2232
|
-
|
2233
1073
|
// EXTERNAL MODULE: ./locale/index.js + 1 modules
|
2234
1074
|
var locale = __webpack_require__(7294);
|
2235
1075
|
;// ./packages/mixins/index.js
|
2236
1076
|
/*
|
2237
1077
|
* @Author: chenghuan.dong
|
2238
1078
|
* @Date: 2024-11-18 11:19:51
|
2239
|
-
* @LastEditTime: 2024-11-18
|
1079
|
+
* @LastEditTime: 2024-11-18 19:40:11
|
2240
1080
|
* @LastEditors: chenghuan.dong
|
2241
1081
|
* @Description:
|
2242
1082
|
* @FilePath: \nubomed-ui\packages\mixins\index.js
|
@@ -2244,7 +1084,7 @@ var locale = __webpack_require__(7294);
|
|
2244
1084
|
|
2245
1085
|
/* harmony default export */ var mixins = ({
|
2246
1086
|
methods: {
|
2247
|
-
|
1087
|
+
t(...args) {
|
2248
1088
|
return locale.t.apply(this, args);
|
2249
1089
|
}
|
2250
1090
|
}
|
@@ -2264,7 +1104,6 @@ var locale = __webpack_require__(7294);
|
|
2264
1104
|
//
|
2265
1105
|
|
2266
1106
|
|
2267
|
-
|
2268
1107
|
/* harmony default export */ var srcvue_type_script_lang_js = ({
|
2269
1108
|
name: 'NBExpiryIcon',
|
2270
1109
|
mixins: [mixins],
|
@@ -2281,10 +1120,9 @@ var locale = __webpack_require__(7294);
|
|
2281
1120
|
}
|
2282
1121
|
},
|
2283
1122
|
computed: {
|
2284
|
-
...mapGetters([]),
|
2285
1123
|
// 实际的语言
|
2286
1124
|
factLocal() {
|
2287
|
-
return this.language ||
|
1125
|
+
return this.language || 'zh-cn';
|
2288
1126
|
},
|
2289
1127
|
icon() {
|
2290
1128
|
if (![0, 1, 3, 6].includes(parseInt(this.value))) {
|
@@ -2307,16 +1145,16 @@ var locale = __webpack_require__(7294);
|
|
2307
1145
|
} else {
|
2308
1146
|
switch (parseInt(this.value)) {
|
2309
1147
|
case 0:
|
2310
|
-
return this
|
1148
|
+
return this.t('nbUI.overdue');
|
2311
1149
|
// '过期'
|
2312
1150
|
case 1:
|
2313
|
-
return this
|
1151
|
+
return this.t('nbUI.oneMonth');
|
2314
1152
|
// '1个月'
|
2315
1153
|
case 3:
|
2316
|
-
return this
|
1154
|
+
return this.t('nbUI.threeMonth');
|
2317
1155
|
// '3个月'
|
2318
1156
|
case 6:
|
2319
|
-
return this
|
1157
|
+
return this.t('nbUI.sixMonth');
|
2320
1158
|
// '6个月'
|
2321
1159
|
default:
|
2322
1160
|
return '';
|
@@ -2343,7 +1181,7 @@ var component = (0,componentNormalizer/* default */.A)(
|
|
2343
1181
|
staticRenderFns,
|
2344
1182
|
false,
|
2345
1183
|
null,
|
2346
|
-
"
|
1184
|
+
"9b72fa0a",
|
2347
1185
|
null
|
2348
1186
|
|
2349
1187
|
)
|
@@ -4576,7 +3414,7 @@ var map = {
|
|
4576
3414
|
"./NBCheckboxGroup/index.js": 2129,
|
4577
3415
|
"./NBDialog/index.js": 4066,
|
4578
3416
|
"./NBEmpty/index.js": 2846,
|
4579
|
-
"./NBExpiryIcon/index.js":
|
3417
|
+
"./NBExpiryIcon/index.js": 5155,
|
4580
3418
|
"./NBFullscreenDialog/index.js": 1516,
|
4581
3419
|
"./NBHeader/index.js": 6523,
|
4582
3420
|
"./NBIcon/index.js": 5408,
|