@shjjs/visual-ui 3.0.29 → 3.0.31

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.
@@ -1,7 +1,7 @@
1
1
  import o from "./index.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../../../_virtual/_plugin-vue_export-helper.mjs";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3ef4f9e8"]]);
4
+ const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-4863bb72"]]);
5
5
  export {
6
- p as default
6
+ _ as default
7
7
  };
@@ -1,28 +1,28 @@
1
- import { defineComponent as a, computed as t, createElementBlock as i, openBlock as s, normalizeStyle as p } from "vue";
2
- import { upgradeImage as m } from "./version.mjs";
3
- const n = a({ name: "ShjImage" }), g = /* @__PURE__ */ a({
4
- ...n,
1
+ import { defineComponent as t, computed as s, createElementBlock as n, openBlock as p, normalizeStyle as m } from "vue";
2
+ import { upgradeImage as u } from "./version.mjs";
3
+ const l = t({ name: "ShjImage" }), g = /* @__PURE__ */ t({
4
+ ...l,
5
5
  props: {
6
6
  option: {}
7
7
  },
8
- setup(o, { expose: r }) {
9
- const e = t(() => m(o.option));
10
- return r({
8
+ setup(r, { expose: i }) {
9
+ const e = s(() => u(r.option)), a = (o) => typeof o == "number" ? `${o}px` : o ?? "center";
10
+ return i({
11
11
  refresh: () => {
12
12
  },
13
13
  refreshView: () => {
14
14
  },
15
15
  refreshData: () => {
16
16
  }
17
- }), (l, u) => (s(), i("div", {
17
+ }), (o, c) => (p(), n("div", {
18
18
  class: "image",
19
- style: p({
19
+ style: m({
20
20
  "--image-url": `url('${e.value.base.url}')`,
21
- "--image-border-radius": e.value.base.borderRadius + "px",
21
+ "--image-border-radius": (e.value.base.borderRadius ?? 0) + "px",
22
22
  "--image-repeat": e.value.base.mode === "repeat" ? "repeat" : "no-repeat",
23
23
  "--image-size": e.value.base.mode === "repeat" ? "auto" : e.value.base.mode,
24
- "--image-position-x": e.value.base.positionX + "px",
25
- "--image-position-y": e.value.base.positionY + "px"
24
+ "--image-position-x": a(e.value.base.positionX),
25
+ "--image-position-y": a(e.value.base.positionY)
26
26
  })
27
27
  }, null, 4));
28
28
  }
@@ -1,18 +1,18 @@
1
- import { cloneDeep as i } from "lodash";
2
- const r = "2.0.0", s = (e) => {
3
- const o = i(e);
4
- return o.version !== r ? {
1
+ import { cloneDeep as n } from "lodash";
2
+ const r = "2.0.0", t = (o) => {
3
+ const e = n(o);
4
+ return e.version !== r ? {
5
5
  base: {
6
- url: o.url,
7
- mode: o.mode,
8
- positionX: o.positionX,
9
- positionY: o.positionY,
10
- borderRadius: o.borderRadius
6
+ url: e.url,
7
+ mode: e.mode,
8
+ positionX: e.positionX ?? "center",
9
+ positionY: e.positionY ?? "center",
10
+ borderRadius: e.borderRadius ?? 0
11
11
  },
12
12
  version: r
13
- } : e;
13
+ } : o;
14
14
  };
15
15
  export {
16
16
  r as VERSION,
17
- s as upgradeImage
17
+ t as upgradeImage
18
18
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./index.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../../../_virtual/_plugin-vue_export-helper.mjs";
4
- const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-7b570c4e"]]);
4
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2305a074"]]);
5
5
  export {
6
- c as default
6
+ a as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as e, computed as s, ref as n, onMounted as u, nextTick as c, createElementBlock as l, openBlock as v, normalizeStyle as d } from "vue";
1
+ import { defineComponent as a, computed as n, ref as u, onMounted as c, nextTick as l, createElementBlock as d, openBlock as f, normalizeStyle as v } from "vue";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import "../../../Interaction/components/Tabs/index.mjs";
@@ -161,52 +161,52 @@ import "../../../Scene/components/Earth/index.mjs";
161
161
  import "../../../Deleted/components/StaticSwitch/index.mjs";
162
162
  import "../../../Deleted/components/RowScroll/index.mjs";
163
163
  import "../../../Deleted/components/Wavesurfer/index.mjs";
164
- import { SHJDatasourceV2 as f } from "../../../../commons/plugins/datasource/index.mjs";
165
- import { SHJParseEvent as p } from "../../../../commons/plugins/event/index.mjs";
164
+ import { SHJDatasourceV2 as g } from "../../../../commons/plugins/datasource/index.mjs";
165
+ import { SHJParseEvent as e } from "../../../../commons/plugins/event/index.mjs";
166
166
  import "lodash";
167
- import { upgradeImageDynamic as g } from "./version.mjs";
168
- import { useWatch as b } from "./hooks/useWatch.mjs";
169
- const x = e({ name: "ShjImageDynamic" }), Hr = /* @__PURE__ */ e({
167
+ import { upgradeImageDynamic as b } from "./version.mjs";
168
+ import { useWatch as h } from "./hooks/useWatch.mjs";
169
+ const x = a({ name: "ShjImageDynamic" }), Ir = /* @__PURE__ */ a({
170
170
  ...x,
171
171
  props: {
172
172
  option: {},
173
173
  sources: {},
174
174
  useEvents: {}
175
175
  },
176
- setup(o, { expose: a }) {
177
- const t = s(() => g(o.option)), i = n(""), r = () => {
178
- f.parse({
179
- sources: o.sources,
180
- callback: ({ data: m }) => {
176
+ setup(r, { expose: s }) {
177
+ const t = n(() => b(r.option)), p = (o) => typeof o == "number" ? `${o}px` : o ?? "center", m = u(""), i = () => {
178
+ g.parse({
179
+ sources: r.sources,
180
+ callback: ({ data: o }) => {
181
181
  try {
182
- p.parseEvents(o.useEvents, "dataListener", m), i.value = m[0].data[0].src;
182
+ e.parseEvents(r.useEvents, "dataListener", o), m.value = o[0].data[0].src;
183
183
  } catch {
184
- p.parseEvents(o.useEvents, "dataListener", null), i.value = "";
184
+ e.parseEvents(r.useEvents, "dataListener", null), m.value = "";
185
185
  }
186
186
  }
187
187
  });
188
188
  };
189
- return u(() => {
190
- c(() => {
191
- r();
189
+ return c(() => {
190
+ l(() => {
191
+ i();
192
192
  });
193
- }), b({ option: t.value, sources: o.sources }, r), a({
194
- refresh: () => r(),
195
- refreshView: () => r(),
196
- refreshData: () => r()
197
- }), (m, h) => (v(), l("div", {
193
+ }), h({ option: t.value, sources: r.sources }, i), s({
194
+ refresh: () => i(),
195
+ refreshView: () => i(),
196
+ refreshData: () => i()
197
+ }), (o, y) => (f(), d("div", {
198
198
  class: "image",
199
- style: d({
200
- "--image-url": `url('${i.value}')`,
201
- "--image-border-radius": t.value.base.borderRadius + "px",
199
+ style: v({
200
+ "--image-url": `url('${m.value}')`,
201
+ "--image-border-radius": (t.value.base.borderRadius ?? 0) + "px",
202
202
  "--image-repeat": t.value.base.mode === "repeat" ? "repeat" : "no-repeat",
203
203
  "--image-size": t.value.base.mode === "repeat" ? "auto" : t.value.base.mode,
204
- "--image-position-x": t.value.base.positionX + "px",
205
- "--image-position-y": t.value.base.positionY + "px"
204
+ "--image-position-x": p(t.value.base.positionX),
205
+ "--image-position-y": p(t.value.base.positionY)
206
206
  })
207
207
  }, null, 4));
208
208
  }
209
209
  });
210
210
  export {
211
- Hr as default
211
+ Ir as default
212
212
  };
@@ -1,17 +1,17 @@
1
- import { cloneDeep as n } from "lodash";
2
- const i = "2.0.0", s = (e) => {
3
- const o = n(e);
4
- return o.version !== i ? {
1
+ import { cloneDeep as r } from "lodash";
2
+ const n = "2.0.0", t = (o) => {
3
+ const e = r(o);
4
+ return e.version !== n ? {
5
5
  base: {
6
- mode: o.mode,
7
- positionX: o.positionX,
8
- positionY: o.positionY,
9
- borderRadius: o.borderRadius
6
+ mode: e.mode,
7
+ positionX: e.positionX ?? "center",
8
+ positionY: e.positionY ?? "center",
9
+ borderRadius: e.borderRadius ?? 0
10
10
  },
11
- version: i
12
- } : e;
11
+ version: n
12
+ } : o;
13
13
  };
14
14
  export {
15
- i as VERSION,
16
- s as upgradeImageDynamic
15
+ n as VERSION,
16
+ t as upgradeImageDynamic
17
17
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./index.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../../../_virtual/_plugin-vue_export-helper.mjs";
4
- const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-e982c808"]]);
4
+ const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5075cbee"]]);
5
5
  export {
6
- c as default
6
+ r as default
7
7
  };
@@ -1,32 +1,32 @@
1
- import { defineComponent as a, computed as u, createElementBlock as l, openBlock as s, normalizeStyle as p } from "vue";
2
- import { upgradeDefault as d } from "./version.mjs";
3
- const i = a({ name: "ShjDefault" }), k = /* @__PURE__ */ a({
4
- ...i,
1
+ import { defineComponent as r, computed as d, createElementBlock as i, openBlock as l, normalizeStyle as p } from "vue";
2
+ import { upgradeDefault as g } from "./version.mjs";
3
+ const k = r({ name: "ShjDefault" }), f = /* @__PURE__ */ r({
4
+ ...k,
5
5
  props: {
6
6
  option: {},
7
7
  sources: {},
8
8
  useEvents: {}
9
9
  },
10
- setup(r) {
11
- const e = u(() => d(r.option)), c = () => {
10
+ setup(c) {
11
+ const e = d(() => g(c.option)), n = (o) => typeof o == "number" ? `${o}px` : o ?? "center", u = () => {
12
12
  try {
13
- const o = e.value.background.image, n = e.value.background.color, t = e.value.background.size;
13
+ const o = e.value.background.image, a = e.value.background.color, t = e.value.background.size, s = t === "repeat" || t === "auto" ? "auto" : t;
14
14
  return {
15
- background: o ? `url('${o}')` : n,
16
- backgroundSize: t,
17
- backgroundPosition: t === "auto" ? "0px 0px" : "center",
18
- backgroundRepeat: t === "auto" ? "repeat" : "no-repeat"
15
+ background: o ? `url('${o}')` : a,
16
+ backgroundSize: s,
17
+ backgroundPosition: `${n(e.value.background.positionX)} ${n(e.value.background.positionY)}`,
18
+ backgroundRepeat: t === "repeat" || t === "auto" ? "repeat" : "no-repeat"
19
19
  };
20
20
  } catch {
21
21
  return {};
22
22
  }
23
23
  };
24
- return (o, n) => (s(), l("div", {
24
+ return (o, a) => (l(), i("div", {
25
25
  class: "shj-default",
26
- style: p(c())
26
+ style: p(u())
27
27
  }, null, 4));
28
28
  }
29
29
  });
30
30
  export {
31
- k as default
31
+ f as default
32
32
  };
@@ -1,9 +1,27 @@
1
- import { cloneDeep as o } from "lodash";
2
- const n = "2.0.0", s = (r) => {
3
- const e = o(r) ?? {};
4
- return e.version !== n ? (e.version = n, e) : r;
1
+ import { cloneDeep as n } from "lodash";
2
+ const e = "2.0.0", i = (r) => {
3
+ const o = n(r) ?? {};
4
+ return o.version !== e ? (o.version = e, {
5
+ ...o,
6
+ background: {
7
+ color: o.background?.color ?? "#00000000",
8
+ image: o.background?.image ?? "",
9
+ size: o.background?.size ?? "cover",
10
+ positionX: o.background?.positionX ?? "center",
11
+ positionY: o.background?.positionY ?? "center"
12
+ }
13
+ }) : {
14
+ ...r,
15
+ background: {
16
+ color: r.background?.color ?? "#00000000",
17
+ image: r.background?.image ?? "",
18
+ size: r.background?.size ?? "cover",
19
+ positionX: r.background?.positionX ?? "center",
20
+ positionY: r.background?.positionY ?? "center"
21
+ }
22
+ };
5
23
  };
6
24
  export {
7
- n as VERSION,
8
- s as upgradeDefault
25
+ e as VERSION,
26
+ i as upgradeDefault
9
27
  };
@@ -6,6 +6,7 @@ declare const _sfc_main: import("vue").DefineComponent<import("vue").ExtractProp
6
6
  };
7
7
  }>, {
8
8
  option: import("vue").ComputedRef<IImageOption>;
9
+ formatBackgroundPosition: (value: "left" | "center" | "right" | "top" | "bottom" | number | undefined) => string;
9
10
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
10
11
  option: {
11
12
  type: any;
@@ -2,8 +2,8 @@ export interface IImageOption {
2
2
  base: {
3
3
  url: string;
4
4
  mode: string;
5
- positionX: number;
6
- positionY: number;
5
+ positionX: "left" | "center" | "right" | number;
6
+ positionY: "top" | "center" | "bottom" | number;
7
7
  borderRadius: number;
8
8
  };
9
9
  version: string;
@@ -14,6 +14,7 @@ declare const _sfc_main: import("vue").DefineComponent<import("vue").ExtractProp
14
14
  };
15
15
  }>, {
16
16
  option: import("vue").ComputedRef<IImageDynamicOption>;
17
+ formatBackgroundPosition: (value: "left" | "center" | "right" | "top" | "bottom" | number | undefined) => string;
17
18
  url: import("vue").Ref<string, string>;
18
19
  init: () => void;
19
20
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -1,8 +1,8 @@
1
1
  export interface IImageDynamicOption {
2
2
  base: {
3
3
  mode: string;
4
- positionX: number;
5
- positionY: number;
4
+ positionX: "left" | "center" | "right" | number;
5
+ positionY: "top" | "center" | "bottom" | number;
6
6
  borderRadius: number;
7
7
  };
8
8
  version: string;
@@ -15,6 +15,7 @@ declare const _sfc_main: import("vue").DefineComponent<import("vue").ExtractProp
15
15
  };
16
16
  }>, {
17
17
  option: import("vue").ComputedRef<IDefaultOption>;
18
+ formatBackgroundPosition: (value: "left" | "center" | "right" | "top" | "bottom" | number | undefined) => string;
18
19
  handleSceneStyle: () => StyleValue | undefined;
19
20
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
20
21
  option: {
@@ -3,6 +3,8 @@ export interface IDefaultOption {
3
3
  color: string;
4
4
  image: string;
5
5
  size: string;
6
+ positionX: "left" | "center" | "right" | number;
7
+ positionY: "top" | "center" | "bottom" | number;
6
8
  };
7
9
  version: string;
8
10
  }