@bpui/libs
Advanced tools
Comparing version
@@ -5,3 +5,3 @@ { | ||
"@types/hammerjs": "^2.0.36", | ||
"febs-browser": "^0.8.93", | ||
"febs-browser": "^1.0.2", | ||
"hammerjs": "^2.0.8", | ||
@@ -53,3 +53,3 @@ "smoothscroll-polyfill": "^0.4.4" | ||
"name": "@bpui/libs", | ||
"version": "0.2.5" | ||
"version": "0.2.6" | ||
} |
@@ -10,3 +10,3 @@ 'use strict'; | ||
import febs from 'febs-browser'; | ||
import * as febs from 'febs-browser';; | ||
@@ -13,0 +13,0 @@ export { |
@@ -10,3 +10,3 @@ 'use strict'; | ||
import febs from 'febs-browser'; | ||
import * as febs from 'febs-browser';; | ||
@@ -13,0 +13,0 @@ |
@@ -10,3 +10,4 @@ 'use strict'; | ||
const GlobalIcons = /*Symbol*/('GlobalIcons'); | ||
// const GlobalIcons = Symbol('$BpGlobalIcons'); | ||
const GlobalIcons = ('$BpGlobalIcons'); | ||
@@ -22,13 +23,13 @@ const Instance = ()=>{ | ||
installed:boolean | ||
icons:Set<string> | ||
icons_svgPath:Map<string, string> | ||
icons_alias:Map<string, string> | ||
icons_font:Map<string, {className:string, children:string[]}> | ||
icons:any//Set<string> | ||
icons_svgPath:any//Map<string, string> | ||
icons_alias:any//Map<string, string> | ||
icons_font:any//Map<string, {className:string, children:string[]}> | ||
constructor() { | ||
this.installed = false; | ||
this.icons = new Set(); | ||
this.icons_svgPath = new Map(); | ||
this.icons_alias = new Map(); | ||
this.icons_font = new Map(); | ||
this.icons = {};//new Set(); | ||
this.icons_svgPath = {};//new Map(); | ||
this.icons_alias = {};//new Map(); | ||
this.icons_font = {};//new Map(); | ||
} | ||
@@ -39,5 +40,8 @@ } | ||
function clearIcon(name:string) { | ||
Instance().icons_font.delete(name); | ||
Instance().icons_svgPath.delete(name); | ||
Instance().icons_alias.delete(name); | ||
if (name && name.length > 0) { | ||
delete Instance().icons[name]; | ||
delete Instance().icons_font[name]; | ||
delete Instance().icons_svgPath[name]; | ||
delete Instance().icons_alias[name]; | ||
} | ||
} | ||
@@ -49,4 +53,5 @@ | ||
*/ | ||
function list(): IterableIterator<string> { | ||
return Instance().icons.keys(); | ||
function list(): string[]/*IterableIterator<string>*/ { | ||
// return Instance().icons.keys(); | ||
return Object.keys(Instance().icons); | ||
} | ||
@@ -58,11 +63,11 @@ | ||
function getIcon(iconName:string):{type:'svg'|'font', value:string} { | ||
let srcName = Instance().icons_alias.get(iconName); | ||
let srcName = Instance().icons_alias[iconName]; | ||
if (srcName) { | ||
iconName = srcName; | ||
} | ||
if (Instance().icons.has(iconName)) { | ||
if (Instance().icons.hasOwnProperty(iconName)) { | ||
let obj = {} as any; | ||
let v1 = Instance().icons_font.get(iconName); | ||
let v1 = Instance().icons_font[iconName]; | ||
if (v1) { | ||
@@ -74,3 +79,3 @@ obj.type = 'font'; | ||
let v2 = Instance().icons_svgPath.get(iconName); | ||
let v2 = Instance().icons_svgPath[iconName]; | ||
if (v2) { | ||
@@ -93,4 +98,4 @@ obj.type = 'svg'; | ||
clearIcon(iconName); | ||
Instance().icons.add(iconName); | ||
Instance().icons_svgPath.set(iconName, filePath); | ||
Instance().icons[iconName] = true; | ||
Instance().icons_svgPath[iconName] = filePath; | ||
} | ||
@@ -106,5 +111,5 @@ | ||
clearIcon(iconName); | ||
Instance().icons.add(iconName); | ||
Instance().icons[iconName] = true; | ||
let children = []; | ||
Instance().icons_font.set(iconName, {className, children}); | ||
Instance().icons_font[iconName] = {className, children}; | ||
return children; | ||
@@ -118,8 +123,8 @@ } | ||
function registerAliasIcon(aliasName:string, srcIconName:string) { | ||
if (!Instance().icons.has(srcIconName)) { | ||
if (!Instance().icons.hasOwnProperty(srcIconName)) { | ||
throw new Error('icon name `' + srcIconName + '` isn\'t existed!'); | ||
} | ||
if (!Instance().icons.has(aliasName)) { | ||
Instance().icons_alias.set(aliasName, srcIconName); | ||
if (!Instance().icons.hasOwnProperty(aliasName)) { | ||
Instance().icons_alias[aliasName] = srcIconName; | ||
} | ||
@@ -126,0 +131,0 @@ } |
@@ -15,5 +15,5 @@ 'use strict'; | ||
// // store at window. | ||
// store at window. | ||
// if (process.env.NODE_ENV == 'development') { | ||
// ((window||window) as any).bpLibs = bpLibs; | ||
((window||window) as any).bpLibs = bpLibs; | ||
// } | ||
@@ -20,0 +20,0 @@ |
@@ -10,9 +10,12 @@ 'use strict'; | ||
import febs from 'febs-browser'; | ||
import * as febs from 'febs-browser';; | ||
import * as dom from './dom'; | ||
import * as utils from './router/utils'; | ||
const GlobalRouter = Symbol('GlobalRouter'); | ||
const GlobalRouterBase = Symbol('GlobalRouterBase'); | ||
const GlobalRouter404 = Symbol('GlobalRouter404'); | ||
// const GlobalRouter = Symbol('$BpGlobalRouter'); | ||
// const GlobalRouterBase = Symbol('$BpGlobalRouterBase'); | ||
// const GlobalRouter404 = Symbol('$BpGlobalRouter404'); | ||
const GlobalRouter = ('$BpGlobalRouter'); | ||
const GlobalRouterBase = ('$BpGlobalRouterBase'); | ||
const GlobalRouter404 = ('$BpGlobalRouter404'); | ||
@@ -19,0 +22,0 @@ |
@@ -10,3 +10,3 @@ 'use strict'; | ||
import febs from 'febs-browser'; | ||
import * as febs from 'febs-browser';; | ||
import * as url from '../utils/url'; | ||
@@ -16,3 +16,4 @@ import * as router from '../init'; | ||
const InstanceOnRoute = Symbol('InstanceOnRoute'); | ||
// const InstanceOnRoute = Symbol('$BpInstanceOnRoute'); | ||
const InstanceOnRoute = ('$BpInstanceOnRoute'); | ||
@@ -28,3 +29,3 @@ | ||
*/ | ||
get length():number { | ||
get pageLength():number { | ||
return window.history.length; | ||
@@ -133,3 +134,3 @@ } | ||
*/ | ||
on(eventType:'routeChanged', handler:(to:bp.Location, type?:number)=>void) : void { | ||
on(eventType:'routeChanged', handler:(to:bp.Location, type?:number)=>void) : bp.Router { | ||
if (eventType == 'routeChanged') { | ||
@@ -147,5 +148,6 @@ if (!window[InstanceOnRoute]) { | ||
} | ||
return this; | ||
} | ||
off(eventType:'routeChanged', handler?:(to:bp.Location, type?:number)=>void) : void { | ||
off(eventType:'routeChanged', handler?:(to:bp.Location, type?:number)=>void) : bp.Router { | ||
if (eventType == 'routeChanged') { | ||
@@ -159,2 +161,3 @@ if (window[InstanceOnRoute]) { | ||
} | ||
return this; | ||
} | ||
@@ -161,0 +164,0 @@ |
@@ -10,3 +10,3 @@ 'use strict'; | ||
import febs from 'febs-browser'; | ||
import * as febs from 'febs-browser';; | ||
@@ -13,0 +13,0 @@ export function parseUrl(search:string):bp.Directory<string> { |
@@ -12,3 +12,4 @@ 'use strict'; | ||
const s_timer = Symbol('s_timer'); | ||
// const s_timer = Symbol('$BpTimer'); | ||
const s_timer = ('$BpTimer'); | ||
@@ -20,3 +21,6 @@ export function beforeCreate(Vue, ctx:any) { | ||
get () { return ctx[s_timer]; } | ||
}) | ||
}); | ||
Object.defineProperty(ctx, '$bpTimer', { | ||
get () { return ctx[s_timer]; } | ||
}); | ||
} | ||
@@ -23,0 +27,0 @@ } |
@@ -17,3 +17,3 @@ /** | ||
*/ | ||
list(): IterableIterator<string>; | ||
list(): string[]; | ||
@@ -20,0 +20,0 @@ /** |
@@ -19,5 +19,5 @@ /** | ||
/** | ||
* 历史记录长度. | ||
* 历史记录长度 (length名称在ie下不可重定义,故使用pageLength). | ||
*/ | ||
length:number; | ||
pageLength:number; | ||
@@ -68,5 +68,5 @@ /** | ||
*/ | ||
on(eventType:'routeChanged', handler:(to:bp.Location, type?:number)=>void) : void; | ||
off(eventType:'routeChanged', handler?:(to:bp.Location, type?:number)=>void) : void; | ||
on(eventType:'routeChanged', handler:(to:bp.Location, type?:number)=>void) : Router; | ||
off(eventType:'routeChanged', handler?:(to:bp.Location, type?:number)=>void) : Router; | ||
} | ||
} |
@@ -6,2 +6,3 @@ import Vue from 'vue'; | ||
$timer: bp.Timer; | ||
$bpTimer: bp.Timer; /* the same as $timer */ | ||
$bpLibs: typeof bp.bpLibs; | ||
@@ -8,0 +9,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
1498792
6.73%15521
2.89%6
Infinity%+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated