@quickbi/bi-open-sdk 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # 说明
2
+
3
+ 无框架的开放组件 sdk
package/cjs/index.d.ts ADDED
@@ -0,0 +1,35 @@
1
+ // Generated by dts-bundle v0.7.3
2
+ // Dependencies for this module:
3
+ // ../../../../../../../../../../@quickbi/bi-open
4
+ // ../../../../../../../../../../@quickbi/bi-types
5
+
6
+ declare module '@quickbi/bi-open-sdk' {
7
+ export { I18n, formatNumberWithConfig, formatNumber, LATEST_VERSION, revisal, OLDEST_VERSION, getRevisalRange, } from '@quickbi/bi-open';
8
+ export type { Interfaces } from '@quickbi/bi-open';
9
+ export { createBIComponent } from '@quickbi/bi-open-sdk/wrapper';
10
+ }
11
+
12
+ declare module '@quickbi/bi-open-sdk/wrapper' {
13
+ /**
14
+ * @flie 开放组件入口文件
15
+ */
16
+ import type { LifecycleMount, LifecycleUnmount, LifecycleUpdate, ComponentProps, LifecycleBootstrap } from '@quickbi/bi-types';
17
+ interface IBiComponent {
18
+ mount?: LifecycleMount<ComponentProps>;
19
+ umount?: LifecycleUnmount<ComponentProps>;
20
+ update?: LifecycleUpdate<ComponentProps>;
21
+ }
22
+ interface IBiComponentConstructor {
23
+ new (): IBiComponent;
24
+ }
25
+ export function createBIComponent({ element: BiComponent }: {
26
+ element: IBiComponentConstructor;
27
+ }): {
28
+ bootstrap: LifecycleBootstrap<ComponentProps>;
29
+ mount: LifecycleMount<ComponentProps>;
30
+ unmount: LifecycleUnmount<ComponentProps>;
31
+ update: LifecycleUpdate<ComponentProps>;
32
+ };
33
+ export {};
34
+ }
35
+
package/cjs/index.js ADDED
@@ -0,0 +1,72 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/basic/bi-open/packages/bi-open-sdk/src/index.ts
20
+ var src_exports = {};
21
+ __export(src_exports, {
22
+ I18n: () => import_bi_open.I18n,
23
+ LATEST_VERSION: () => import_bi_open.LATEST_VERSION,
24
+ OLDEST_VERSION: () => import_bi_open.OLDEST_VERSION,
25
+ createBIComponent: () => createBIComponent,
26
+ formatNumber: () => import_bi_open.formatNumber,
27
+ formatNumberWithConfig: () => import_bi_open.formatNumberWithConfig,
28
+ getRevisalRange: () => import_bi_open.getRevisalRange,
29
+ revisal: () => import_bi_open.revisal
30
+ });
31
+ module.exports = __toCommonJS(src_exports);
32
+ var import_bi_open = require("@quickbi/bi-open");
33
+
34
+ // src/basic/bi-open/packages/bi-open-sdk/src/wrapper.ts
35
+ function createBIComponent(param) {
36
+ var BiComponent = param.element;
37
+ var instance = /* @__PURE__ */ new WeakMap();
38
+ var bootstrap = function() {
39
+ };
40
+ var mount = function(props) {
41
+ if (props.container) {
42
+ var biComponent = new BiComponent();
43
+ instance.set(props.container, biComponent);
44
+ if (typeof biComponent.mount === "function") {
45
+ biComponent.mount(props);
46
+ }
47
+ }
48
+ };
49
+ var update = function(props) {
50
+ if (props.container) {
51
+ var biComponent = instance.get(props.container);
52
+ if (biComponent && typeof biComponent.update === "function") {
53
+ biComponent.update(props);
54
+ }
55
+ }
56
+ };
57
+ var unmount = function(props) {
58
+ if (props.container) {
59
+ var biComponent = instance.get(props.container);
60
+ if (biComponent && typeof biComponent.umount === "function") {
61
+ biComponent.umount(props);
62
+ instance.delete(props.container);
63
+ }
64
+ }
65
+ };
66
+ return {
67
+ bootstrap,
68
+ mount,
69
+ unmount,
70
+ update
71
+ };
72
+ }
package/esm/index.d.ts ADDED
@@ -0,0 +1,35 @@
1
+ // Generated by dts-bundle v0.7.3
2
+ // Dependencies for this module:
3
+ // ../../../../../../../../../../@quickbi/bi-open
4
+ // ../../../../../../../../../../@quickbi/bi-types
5
+
6
+ declare module '@quickbi/bi-open-sdk' {
7
+ export { I18n, formatNumberWithConfig, formatNumber, LATEST_VERSION, revisal, OLDEST_VERSION, getRevisalRange, } from '@quickbi/bi-open';
8
+ export type { Interfaces } from '@quickbi/bi-open';
9
+ export { createBIComponent } from '@quickbi/bi-open-sdk/wrapper';
10
+ }
11
+
12
+ declare module '@quickbi/bi-open-sdk/wrapper' {
13
+ /**
14
+ * @flie 开放组件入口文件
15
+ */
16
+ import type { LifecycleMount, LifecycleUnmount, LifecycleUpdate, ComponentProps, LifecycleBootstrap } from '@quickbi/bi-types';
17
+ interface IBiComponent {
18
+ mount?: LifecycleMount<ComponentProps>;
19
+ umount?: LifecycleUnmount<ComponentProps>;
20
+ update?: LifecycleUpdate<ComponentProps>;
21
+ }
22
+ interface IBiComponentConstructor {
23
+ new (): IBiComponent;
24
+ }
25
+ export function createBIComponent({ element: BiComponent }: {
26
+ element: IBiComponentConstructor;
27
+ }): {
28
+ bootstrap: LifecycleBootstrap<ComponentProps>;
29
+ mount: LifecycleMount<ComponentProps>;
30
+ unmount: LifecycleUnmount<ComponentProps>;
31
+ update: LifecycleUpdate<ComponentProps>;
32
+ };
33
+ export {};
34
+ }
35
+
package/esm/index.mjs ADDED
@@ -0,0 +1,52 @@
1
+ // src/basic/bi-open/packages/bi-open-sdk/src/index.ts
2
+ import { I18n, formatNumberWithConfig, formatNumber, LATEST_VERSION, revisal, OLDEST_VERSION, getRevisalRange } from "@quickbi/bi-open";
3
+
4
+ // src/basic/bi-open/packages/bi-open-sdk/src/wrapper.ts
5
+ function createBIComponent(param) {
6
+ var BiComponent = param.element;
7
+ var instance = /* @__PURE__ */ new WeakMap();
8
+ var bootstrap = function() {
9
+ };
10
+ var mount = function(props) {
11
+ if (props.container) {
12
+ var biComponent = new BiComponent();
13
+ instance.set(props.container, biComponent);
14
+ if (typeof biComponent.mount === "function") {
15
+ biComponent.mount(props);
16
+ }
17
+ }
18
+ };
19
+ var update = function(props) {
20
+ if (props.container) {
21
+ var biComponent = instance.get(props.container);
22
+ if (biComponent && typeof biComponent.update === "function") {
23
+ biComponent.update(props);
24
+ }
25
+ }
26
+ };
27
+ var unmount = function(props) {
28
+ if (props.container) {
29
+ var biComponent = instance.get(props.container);
30
+ if (biComponent && typeof biComponent.umount === "function") {
31
+ biComponent.umount(props);
32
+ instance.delete(props.container);
33
+ }
34
+ }
35
+ };
36
+ return {
37
+ bootstrap,
38
+ mount,
39
+ unmount,
40
+ update
41
+ };
42
+ }
43
+ export {
44
+ I18n,
45
+ LATEST_VERSION,
46
+ OLDEST_VERSION,
47
+ createBIComponent,
48
+ formatNumber,
49
+ formatNumberWithConfig,
50
+ getRevisalRange,
51
+ revisal
52
+ };
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@quickbi/bi-open-sdk",
3
+ "version": "4.0.0",
4
+ "main": "./cjs/index.js",
5
+ "publishConfig": {
6
+ "registry": "https://registry.npmjs.org",
7
+ "access": "public"
8
+ },
9
+ "dependencies": {
10
+ "@quickbi/bi-open": "4.0.0",
11
+ "@quickbi/bi-types": "3.2.0"
12
+ },
13
+ "sideEffects": false,
14
+ "files": [
15
+ "esm",
16
+ "cjs",
17
+ "README.md"
18
+ ],
19
+ "author": "Quick BI team",
20
+ "peerDependencies": {},
21
+ "module": "./esm/index.mjs",
22
+ "browser": "./esm/index.mjs",
23
+ "exports": {
24
+ ".": {
25
+ "import": "./esm/index.mjs",
26
+ "require": "./cjs/index.js",
27
+ "default": "./esm/index.mjs",
28
+ "types": "./esm/index.d.ts"
29
+ },
30
+ "./*.css": {
31
+ "import": "./esm/*.css",
32
+ "require": "./cjs/*.css",
33
+ "default": "./esm/*.css"
34
+ }
35
+ },
36
+ "revisalInfo": {
37
+ "version": "4.1"
38
+ }
39
+ }