New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bi-open-vue-sdk

Package Overview
Dependencies
Maintainers
0
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bi-open-vue-sdk - npm Package Compare versions

Comparing version

to
0.0.12-beta.0

21

declaration/index.d.ts

@@ -1,3 +0,18 @@

export { I18n, getStringRealLength, getAliasName, formatNumberWithConfig, formatNumber, transposeData, LATEST_VERSION, CHANGE_LOGS, revisal, OLDEST_VERSION, getRivisalRange, } from 'bi-open';
export { Interfaces } from './interfaces';
export { createBIComponent } from './wrapper';
import { Interfaces } from 'bi-open';
export { CHANGE_LOGS, I18n, Interfaces, LATEST_VERSION, OLDEST_VERSION, formatNumber, formatNumberWithConfig, getAliasName, getRevisalRange, getStringRealLength, revisal, transposeData } from 'bi-open';
import { VNode } from 'vue';
/**
* @flie 开放组件入口文件
*/
declare function createBIComponent({ element: RawComponent }: {
element: VNode;
}): {
bootstrap: Interfaces.LifecycleBootstrap<Interfaces.ComponentProps, any>;
mount: Interfaces.LifecycleMount<Interfaces.ComponentProps, any>;
unmount: Interfaces.LifecycleUnmount<Interfaces.ComponentProps, any>;
update: Interfaces.LifecycleUpdate<Interfaces.ComponentProps, any>;
};
export { createBIComponent };

133

dist/main/index.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
value: true
});
Object.defineProperty(exports, "I18n", {
enumerable: true,
get: function get() {
return _biOpen.I18n;
}
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
CHANGE_LOGS: function() {
return _biopen.CHANGE_LOGS;
},
I18n: function() {
return _biopen.I18n;
},
Interfaces: function() {
return _interfaces.Interfaces;
},
LATEST_VERSION: function() {
return _biopen.LATEST_VERSION;
},
OLDEST_VERSION: function() {
return _biopen.OLDEST_VERSION;
},
createBIComponent: function() {
return _wrapper.createBIComponent;
},
formatNumber: function() {
return _biopen.formatNumber;
},
formatNumberWithConfig: function() {
return _biopen.formatNumberWithConfig;
},
getAliasName: function() {
return _biopen.getAliasName;
},
getRevisalRange: function() {
return _biopen.getRevisalRange;
},
getStringRealLength: function() {
return _biopen.getStringRealLength;
},
revisal: function() {
return _biopen.revisal;
},
transposeData: function() {
return _biopen.transposeData;
}
});
Object.defineProperty(exports, "getStringRealLength", {
enumerable: true,
get: function get() {
return _biOpen.getStringRealLength;
}
});
Object.defineProperty(exports, "getAliasName", {
enumerable: true,
get: function get() {
return _biOpen.getAliasName;
}
});
Object.defineProperty(exports, "formatNumberWithConfig", {
enumerable: true,
get: function get() {
return _biOpen.formatNumberWithConfig;
}
});
Object.defineProperty(exports, "formatNumber", {
enumerable: true,
get: function get() {
return _biOpen.formatNumber;
}
});
Object.defineProperty(exports, "transposeData", {
enumerable: true,
get: function get() {
return _biOpen.transposeData;
}
});
Object.defineProperty(exports, "LATEST_VERSION", {
enumerable: true,
get: function get() {
return _biOpen.LATEST_VERSION;
}
});
Object.defineProperty(exports, "CHANGE_LOGS", {
enumerable: true,
get: function get() {
return _biOpen.CHANGE_LOGS;
}
});
Object.defineProperty(exports, "revisal", {
enumerable: true,
get: function get() {
return _biOpen.revisal;
}
});
Object.defineProperty(exports, "OLDEST_VERSION", {
enumerable: true,
get: function get() {
return _biOpen.OLDEST_VERSION;
}
});
Object.defineProperty(exports, "getRivisalRange", {
enumerable: true,
get: function get() {
return _biOpen.getRivisalRange;
}
});
Object.defineProperty(exports, "Interfaces", {
enumerable: true,
get: function get() {
return _interfaces.Interfaces;
}
});
Object.defineProperty(exports, "createBIComponent", {
enumerable: true,
get: function get() {
return _wrapper.createBIComponent;
}
});
var _biOpen = require("bi-open");
var _biopen = require("bi-open");
var _interfaces = require("./interfaces");
var _wrapper = require("./wrapper");
var _wrapper = require("./wrapper");

@@ -0,13 +1,14 @@

/**
* 接口全部来自 bi-open
*/ // eslint-disable-next-line rulesdir/no-useless-export
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
value: true
});
Object.defineProperty(exports, "Interfaces", {
enumerable: true,
get: function get() {
return _biOpen.Interfaces;
}
enumerable: true,
get: function() {
return _biopen.Interfaces;
}
});
var _biOpen = require("bi-open");
var _biopen = require("bi-open");

@@ -0,81 +1,85 @@

/**
* @flie 开放组件入口文件
*/ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// eslint-disable-next-line import/no-unresolved
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
value: true
});
exports.createBIComponent = createBIComponent;
Object.defineProperty(exports, "createBIComponent", {
enumerable: true,
get: function() {
return createBIComponent;
}
});
var _vue = require("vue");
function getRandId() {
return Math.random().toString(32).slice(2);
return Math.random().toString(32).slice(2);
}
function createBIComponent(_ref) {
var RawComponent = _ref.element;
var instance = new WeakMap();
var id = getRandId();
var CUSTOM_COMPONENT_CHANGE_EVENT = "CUSTOM_COMPONENT_CHANGE_EVENT_".concat(id);
var bootstrap = function bootstrap() {};
var mount = function mount(props) {
if (props.container) {
var vueInstance = (0, _vue.createApp)({
data: function data() {
return {
container: props.container,
customProps: props.customProps
};
},
mounted: function mounted() {
props.container.addEventListener(CUSTOM_COMPONENT_CHANGE_EVENT, this.handlePropsChange);
},
beforeUnmount: function beforeUnmount() {
props.container.removeEventListener(CUSTOM_COMPONENT_CHANGE_EVENT, this.handlePropsChange);
},
methods: {
handlePropsChange: function handlePropsChange(e) {
if (e.detail) {
this.customProps = e.detail;
function createBIComponent(param) {
var RawComponent = param.element;
var instance = new WeakMap(); // 保存组件实例
var id = getRandId(); // 生成随机id
var CUSTOM_COMPONENT_CHANGE_EVENT = "CUSTOM_COMPONENT_CHANGE_EVENT_".concat(id);
// 开机, 注册组件元信息
var bootstrap = function() {};
// 挂载
var mount = function(props) {
if (props.container) {
var vueInstance = (0, _vue.createApp)({
data: function data() {
return {
container: props.container,
customProps: props.customProps
};
},
mounted: function mounted() {
props.container.addEventListener(CUSTOM_COMPONENT_CHANGE_EVENT, this.handlePropsChange);
},
beforeUnmount: function beforeUnmount() {
props.container.removeEventListener(CUSTOM_COMPONENT_CHANGE_EVENT, this.handlePropsChange);
},
methods: {
handlePropsChange: function handlePropsChange(e) {
if (e.detail) {
this.customProps = e.detail;
}
}
},
render: function render() {
return (0, _vue.h)(RawComponent, {
container: this.container,
customProps: this.customProps
});
}
});
vueInstance.mount(props.container);
instance.set(props.container, vueInstance);
}
};
// 更新
var update = function(props) {
if (props.container) {
props.container.dispatchEvent(new CustomEvent(CUSTOM_COMPONENT_CHANGE_EVENT, {
detail: props.customProps
}));
}
};
// 卸载组件
var unmount = function(props) {
if (props.container) {
var vueInstance = instance.get(props.container);
if (vueInstance) {
vueInstance.unmount();
instance.delete(props.container);
}
}
},
render: function render() {
return (0, _vue.h)(RawComponent, {
container: this.container,
customProps: this.customProps
});
}
});
vueInstance.mount(props.container);
instance.set(props.container, vueInstance);
}
};
var update = function update(props) {
if (props.container) {
props.container.dispatchEvent(new CustomEvent(CUSTOM_COMPONENT_CHANGE_EVENT, {
detail: props.customProps
}));
}
};
var unmount = function unmount(props) {
if (props.container) {
var vueInstance = instance.get(props.container);
if (vueInstance) {
vueInstance.unmount();
instance.delete(props.container);
}
}
};
return {
bootstrap: bootstrap,
mount: mount,
unmount: unmount,
update: update
};
}
};
return {
bootstrap: bootstrap,
mount: mount,
unmount: unmount,
update: update
};
}

@@ -1,3 +0,3 @@

export { I18n, getStringRealLength, getAliasName, formatNumberWithConfig, formatNumber, transposeData, LATEST_VERSION, CHANGE_LOGS, revisal, OLDEST_VERSION, getRivisalRange } from 'bi-open';
export { I18n, getStringRealLength, getAliasName, formatNumberWithConfig, formatNumber, transposeData, LATEST_VERSION, CHANGE_LOGS, revisal, OLDEST_VERSION, getRevisalRange } from 'bi-open';
export { Interfaces } from './interfaces';
export { createBIComponent } from './wrapper';
export { createBIComponent } from './wrapper';

@@ -1,1 +0,4 @@

export { Interfaces } from 'bi-open';
/**
* 接口全部来自 bi-open
*/ // eslint-disable-next-line rulesdir/no-useless-export
export { Interfaces } from 'bi-open';

@@ -0,74 +1,77 @@

/**
* @flie 开放组件入口文件
*/ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// eslint-disable-next-line import/no-unresolved
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// eslint-disable-next-line import/no-unresolved
import { createApp, h } from 'vue';
function getRandId() {
return Math.random().toString(32).slice(2);
return Math.random().toString(32).slice(2);
}
export function createBIComponent(_ref) {
var RawComponent = _ref.element;
var instance = new WeakMap();
var id = getRandId();
var CUSTOM_COMPONENT_CHANGE_EVENT = "CUSTOM_COMPONENT_CHANGE_EVENT_".concat(id);
var bootstrap = function bootstrap() {};
var mount = function mount(props) {
if (props.container) {
var vueInstance = createApp({
data: function data() {
return {
container: props.container,
customProps: props.customProps
};
},
mounted: function mounted() {
props.container.addEventListener(CUSTOM_COMPONENT_CHANGE_EVENT, this.handlePropsChange);
},
beforeUnmount: function beforeUnmount() {
props.container.removeEventListener(CUSTOM_COMPONENT_CHANGE_EVENT, this.handlePropsChange);
},
methods: {
handlePropsChange: function handlePropsChange(e) {
if (e.detail) {
this.customProps = e.detail;
export function createBIComponent({ element: RawComponent }) {
const instance = new WeakMap(); // 保存组件实例
const id = getRandId(); // 生成随机id
const CUSTOM_COMPONENT_CHANGE_EVENT = `CUSTOM_COMPONENT_CHANGE_EVENT_${id}`;
// 开机, 注册组件元信息
const bootstrap = ()=>{};
// 挂载
const mount = (props)=>{
if (props.container) {
const vueInstance = createApp({
data () {
return {
container: props.container,
customProps: props.customProps
};
},
mounted () {
props.container.addEventListener(CUSTOM_COMPONENT_CHANGE_EVENT, this.handlePropsChange);
},
beforeUnmount () {
props.container.removeEventListener(CUSTOM_COMPONENT_CHANGE_EVENT, this.handlePropsChange);
},
methods: {
handlePropsChange (e) {
if (e.detail) {
this.customProps = e.detail;
}
}
},
render () {
return h(RawComponent, {
container: this.container,
customProps: this.customProps
});
}
});
vueInstance.mount(props.container);
instance.set(props.container, vueInstance);
}
};
// 更新
const update = (props)=>{
if (props.container) {
props.container.dispatchEvent(new CustomEvent(CUSTOM_COMPONENT_CHANGE_EVENT, {
detail: props.customProps
}));
}
};
// 卸载组件
const unmount = (props)=>{
if (props.container) {
const vueInstance = instance.get(props.container);
if (vueInstance) {
vueInstance.unmount();
instance.delete(props.container);
}
}
},
render: function render() {
return h(RawComponent, {
container: this.container,
customProps: this.customProps
});
}
});
vueInstance.mount(props.container);
instance.set(props.container, vueInstance);
}
};
var update = function update(props) {
if (props.container) {
props.container.dispatchEvent(new CustomEvent(CUSTOM_COMPONENT_CHANGE_EVENT, {
detail: props.customProps
}));
}
};
var unmount = function unmount(props) {
if (props.container) {
var vueInstance = instance.get(props.container);
if (vueInstance) {
vueInstance.unmount();
instance.delete(props.container);
}
}
};
return {
bootstrap: bootstrap,
mount: mount,
unmount: unmount,
update: update
};
}
};
return {
bootstrap,
mount,
unmount,
update
};
}
{
"name": "bi-open-vue-sdk",
"version": "0.0.11",
"version": "0.0.12-beta.0",
"peerDependencies": {

@@ -10,2 +10,3 @@ "vue": "^3.0.11"

},
"npmClient": "npm",
"sideEffects": [

@@ -17,3 +18,3 @@ "**/*.scss",

"dependencies": {
"bi-open": "^3.0.25"
"vue": "^3.0.11"
},

@@ -20,0 +21,0 @@ "main": "dist/main",