@solar-taro/ui-sun 1.1.0 → 1.1.1

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/index8.js CHANGED
@@ -1,25 +1,30 @@
1
- import { defineComponent as p, inject as a, getCurrentInstance as c, onUnmounted as m, unref as u, renderSlot as i, mergeProps as _, openBlock as f, createElementBlock as v } from "vue";
2
- import { ACTIVE_CHILD as d, PARENT as g } from "./index33.js";
3
- const o = u, k = i, C = _, B = f, E = v, $ = /* @__PURE__ */ p({
4
- __name: "segment-btn",
5
- props: {
6
- value: {}
7
- },
8
- setup(b) {
9
- const l = a(d), e = a(g), n = c();
10
- return m(() => {
11
- e.unlink(n);
12
- }), e.link(n), (t, r) => {
13
- var s;
14
- return B(), E("view", C(t.$attrs, {
15
- class: ["sun-segment-btn", { "sun-segment-btn-active": ((s = o(l)) == null ? void 0 : s.props.value) === t.value }],
16
- onTap: r[0] || (r[0] = (I) => o(e).active(o(n)))
17
- }), [
18
- k(t.$slots, "default")
19
- ], 16);
1
+ import { defineComponent as i, renderSlot as d, createElementVNode as s, openBlock as c, createElementBlock as l } from "vue";
2
+ import { withPixel as t } from "@solar-kit/core";
3
+ import { getNavbarRect as p } from "@solar-taro/core";
4
+ const a = d, o = s, g = c, m = l, v = { class: "sun-navbar-inner" }, b = { class: "sun-navbar-center" }, k = /* @__PURE__ */ i({
5
+ __name: "index",
6
+ setup(_) {
7
+ const e = p(), r = {
8
+ "--navbar-height": t(e.height),
9
+ "--navbar-content-height": t(e.buttonHeight),
10
+ "--navbar-padding-top": t(e.paddingTop),
11
+ "--navbar-padding-bottom": t(e.paddingBottom),
12
+ "--navbar-padding-left": t(e.paddingLeft),
13
+ "--navbar-padding-right": t(e.paddingRight)
20
14
  };
15
+ return (n, h) => (g(), m("view", {
16
+ class: "sun-navbar",
17
+ style: r
18
+ }, [
19
+ o("view", v, [
20
+ a(n.$slots, "default"),
21
+ o("view", b, [
22
+ a(n.$slots, "center")
23
+ ])
24
+ ])
25
+ ]));
21
26
  }
22
27
  });
23
28
  export {
24
- $ as default
29
+ k as default
25
30
  };
package/index9.js CHANGED
@@ -1,56 +1,62 @@
1
- import { defineComponent as x, getCurrentInstance as V, shallowRef as E, shallowReactive as k, computed as c, provide as m, watch as C, onMounted as w, renderSlot as y, createElementVNode as B, mergeProps as I, openBlock as O, createElementBlock as A } from "vue";
2
- import { ACTIVE_CHILD as N, PARENT as P } from "./index33.js";
3
- const R = y, T = B, b = I, L = O, S = A, $ = { class: "sun-segment-inner" }, M = /* @__PURE__ */ x({
4
- __name: "segment",
1
+ import { defineComponent as l, renderSlot as s, createElementVNode as a, mergeProps as f, withModifiers as p, normalizeClass as i, normalizeStyle as u, openBlock as d, createElementBlock as c } from "vue";
2
+ const n = s, t = a, v = f, m = p, y = i, g = u, w = d, S = c, x = { class: "sun-popover-trigger" }, k = /* @__PURE__ */ l({
3
+ __name: "index",
5
4
  props: {
6
- modelValue: {}
7
- },
8
- emits: ["update:modelValue", "change"],
9
- setup(v, { emit: f }) {
10
- const d = f, u = v, g = V(), o = E(null), t = k([]), i = c(() => t.indexOf(o.value)), h = c(() => t.length), _ = c(() => ({
11
- "--segment-length": h.value,
12
- "--segment-active-index": i.value
13
- }));
14
- m(N, o), m(P, {
15
- link: (e) => {
16
- const n = p();
17
- t.push(e), t.sort((a, s) => {
18
- const l = n.indexOf(a.vnode), r = n.indexOf(s.vnode);
19
- return l - r;
20
- });
21
- },
22
- unlink: (e) => {
23
- t.slice(t.indexOf(e), 1);
24
- },
25
- active: (e) => {
26
- d("change", {
27
- value: e.props.value,
28
- index: i.value
29
- }), d("update:modelValue", e.props.value), o.value = e;
30
- }
31
- }), C(() => u.modelValue, (e) => {
32
- o.value = t.find((n) => n.props.value === e);
33
- });
34
- function p() {
35
- return g.subTree.children[0].children[0].children.filter((e) => typeof e.type != "symbol");
5
+ /** 是否显示 */
6
+ show: {
7
+ type: Boolean,
8
+ default: void 0
9
+ },
10
+ /** popover的横轴位置:left,right,start,end,center */
11
+ x: {
12
+ type: String,
13
+ default: "left"
14
+ },
15
+ /** popover的纵轴位置:top,bottom,start,end,center */
16
+ y: {
17
+ type: String,
18
+ default: "center"
19
+ },
20
+ /** 横轴偏移度 */
21
+ offsetX: {
22
+ type: String,
23
+ default: "7.5rpx"
24
+ },
25
+ /** 纵轴偏移度 */
26
+ offsetY: {
27
+ type: String,
28
+ default: "7.5rpx"
29
+ },
30
+ /** popover背景 */
31
+ bg: {
32
+ type: String,
33
+ default: "#fff"
34
+ },
35
+ /** popover文字颜色 */
36
+ color: {
37
+ type: String,
38
+ default: "#000"
36
39
  }
37
- return w(() => {
38
- const e = p();
39
- t.forEach((n) => {
40
- var s, l;
41
- const a = e.findIndex((r) => r === n.vnode);
42
- (l = (s = n.props).value) != null || (s.value = a), n.props.value === u.modelValue && (o.value = n);
43
- });
44
- }), (e, n) => (L(), S("view", b(e.$attrs, {
45
- class: "sun-segment",
46
- style: _.value
47
- }), [
48
- T("view", $, [
49
- R(e.$slots, "default")
50
- ])
51
- ], 16));
40
+ },
41
+ setup(e) {
42
+ return (o, r) => (w(), S("view", {
43
+ class: y(["sun-popover", [{ "sun-popover-show": e.show }, `sun-popover-x-${e.x}`, `sun-popover-y-${e.y}`]]),
44
+ style: g({ "--popover-x-offset": e.offsetX, "--popover-y-offset": e.offsetY, "--popover-background": e.bg }),
45
+ onTap: m(($) => !1, ["stop"])
46
+ }, [
47
+ t("view", x, [
48
+ n(o.$slots, "default")
49
+ ]),
50
+ t("view", v(o.$attrs, {
51
+ class: "sun-popover-container",
52
+ style: { color: e.color }
53
+ }), [
54
+ r[0] || (r[0] = t("view", { class: "sun-popover-arrow" }, null, -1)),
55
+ n(o.$slots, "content")
56
+ ], 16)
57
+ ], 38));
52
58
  }
53
59
  });
54
60
  export {
55
- M as default
61
+ k as default
56
62
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solar-taro/ui-sun",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",
package/plugin.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { Plugin } from 'vue';
2
+
3
+ /**
4
+ * solar sun ui vue plugin
5
+ */
6
+ export declare const SolarSun: Plugin;
@@ -8,11 +8,14 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
8
8
  itemKey?: string;
9
9
  id?: string;
10
10
  bottomSpace?: number;
11
+ loading?: boolean;
12
+ loadingText?: string;
11
13
  }>, {
12
14
  refresherBg: string;
13
15
  direction: string;
14
16
  id: () => string;
15
17
  bottomSpace: number;
18
+ loadingText: string;
16
19
  }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
17
20
  refresh: () => void;
18
21
  lower: () => void;
@@ -26,11 +29,14 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
26
29
  itemKey?: string;
27
30
  id?: string;
28
31
  bottomSpace?: number;
32
+ loading?: boolean;
33
+ loadingText?: string;
29
34
  }>, {
30
35
  refresherBg: string;
31
36
  direction: string;
32
37
  id: () => string;
33
38
  bottomSpace: number;
39
+ loadingText: string;
34
40
  }>>> & Readonly<{
35
41
  onRefresh?: (() => any) | undefined;
36
42
  onLower?: (() => any) | undefined;
@@ -39,11 +45,13 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
39
45
  direction: "vertical" | "horizontal";
40
46
  id: string;
41
47
  bottomSpace: number;
48
+ loadingText: string;
42
49
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
43
50
  default?(_: {
44
51
  item: Record<string, any>;
45
52
  index: number;
46
53
  }): any;
54
+ empty?(_: {}): any;
47
55
  }>;
48
56
  export default _default;
49
57
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;