@solar-taro/ui-vant 3.5.2 → 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/index4.js CHANGED
@@ -1,6 +1,7 @@
1
- import { defineComponent as E, ref as N, computed as r, mergeProps as I, createElementVNode as L, openBlock as P, createElementBlock as $, createCommentVNode as q } from "vue";
2
- import { cloneDeep as y } from "lodash-es";
3
- const D = I, A = L, v = P, h = $, T = q, j = ["show"], z = ["title", "value-key", "columns", "loading"], H = /* @__PURE__ */ E({
1
+ import { defineComponent as x, ref as B, computed as d, watch as E, openBlock as N, createElementBlock as I, createElementVNode as L, mergeProps as P, createBlock as $, unref as q, createCommentVNode as D } from "vue";
2
+ import { SunSearchbar as S } from "@solar-taro/ui-sun";
3
+ import { cloneDeep as v } from "lodash-es";
4
+ const A = P, T = L, U = q, K = N, j = $, z = D, F = I, G = ["show"], H = ["title", "value-key", "columns", "loading"], Q = /* @__PURE__ */ x({
4
5
  inheritAttrs: !1,
5
6
  __name: "index",
6
7
  props: {
@@ -16,116 +17,112 @@ const D = I, A = L, v = P, h = $, T = q, j = ["show"], z = ["title", "value-key"
16
17
  required: { type: Boolean }
17
18
  },
18
19
  emits: ["close", "cancel", "confirm", "update:show", "update:modelValue"],
19
- setup(K, { emit: g }) {
20
- const u = g, n = K, a = N(""), d = r(() => {
21
- const e = y(n.options);
22
- for (let t = 0; t < e.length - 1; t++) {
23
- const o = e[t];
24
- for (let l = 0; l < o.length; l++) {
25
- const i = o[l];
26
- i.children = e[t + 1].filter((s) => s[n.pidKey] === i[n.valueKey]);
20
+ setup(i, { emit: h }) {
21
+ const s = h, e = i, a = B(""), c = d(() => {
22
+ const n = v(e.options);
23
+ for (let t = 0; t < n.length - 1; t++) {
24
+ const l = n[t];
25
+ for (let o = 0; o < l.length; o++) {
26
+ const u = l[o];
27
+ u.children = n[t + 1].filter((r) => r[e.pidKey] === u[e.valueKey]);
27
28
  }
28
29
  }
29
- return e[0];
30
- }), p = r(() => y(d.value).map((e) => c(e)).flat()), C = r(() => {
31
- const e = n.options[n.options.length - 1].find((t) => t[n.valueKey] === n.modelValue);
32
- return e ? x(e) : m();
30
+ return n[0];
31
+ }), f = d(() => v(c.value).map((n) => m(n)).flat()), g = d(() => {
32
+ const n = e.options[e.options.length - 1].find((t) => t[e.valueKey] === e.modelValue);
33
+ return n ? b(n) : y();
33
34
  });
34
- function w() {
35
- n.required || u("update:modelValue", null), u("cancel", n.modelValue), f();
35
+ function V() {
36
+ e.required || s("update:modelValue", null), s("cancel", e.modelValue), p();
36
37
  }
37
- function f() {
38
- u("update:show", !1), u("close");
38
+ function p() {
39
+ s("update:show", !1), s("close");
39
40
  }
40
- function V({ detail: e }) {
41
- const t = e.value[e.value.length - 1];
42
- u("update:modelValue", t[n.valueKey]), u("confirm", B(t)), u("update:show", !1);
41
+ function C({ detail: n }) {
42
+ const t = n.value[n.value.length - 1];
43
+ s("update:modelValue", t[e.valueKey]), s("confirm", w(t)), s("update:show", !1);
43
44
  }
44
- function k({ detail: e }) {
45
- const { picker: t, value: o, index: l } = e;
46
- !a.value && l < n.options.length - 1 && t.setColumnValues(
47
- l + 1,
48
- n.options[l + 1].filter((i) => i[n.pidKey] === o[l][n.valueKey])
45
+ function k({ detail: n }) {
46
+ const { picker: t, value: l, index: o } = n;
47
+ !a.value && o < e.options.length - 1 && t.setColumnValues(
48
+ o + 1,
49
+ e.options[o + 1].filter((u) => u[e.pidKey] === l[o][e.valueKey])
49
50
  );
50
51
  }
51
- function b({ detail: e }) {
52
- a.value = e.trim().toLowerCase(), m();
53
- }
54
- function B(e) {
55
- const t = [n.options[n.options.length - 1].find((o) => o[n.valueKey] === e[n.valueKey] && o[n.pidKey] === e[n.pidKey])];
56
- for (let o = n.options.length - 2; o >= 0; o--)
52
+ function w(n) {
53
+ const t = [e.options[e.options.length - 1].find((l) => l[e.valueKey] === n[e.valueKey] && l[e.pidKey] === n[e.pidKey])];
54
+ for (let l = e.options.length - 2; l >= 0; l--)
57
55
  t.unshift(
58
- n.options[o].find((l) => {
59
- var i;
60
- return l[n.valueKey] === ((i = t[0]) == null ? void 0 : i[n.pidKey]);
56
+ e.options[l].find((o) => {
57
+ var u;
58
+ return o[e.valueKey] === ((u = t[0]) == null ? void 0 : u[e.pidKey]);
61
59
  })
62
60
  );
63
61
  return t;
64
62
  }
65
- function c(e, t = "") {
66
- var i;
67
- let o = [], l = t + e[n.labelKey];
68
- return (i = e.children) != null && i.length ? e.children.forEach((s) => {
69
- o = o.concat(c(s, l + " / "));
70
- }) : (e[n.labelKey] = l, o.push(e)), o;
63
+ function m(n, t = "") {
64
+ var u;
65
+ let l = [], o = t + n[e.labelKey];
66
+ return (u = n.children) != null && u.length ? n.children.forEach((r) => {
67
+ l = l.concat(m(r, o + " / "));
68
+ }) : (n[e.labelKey] = o, l.push(n)), l;
71
69
  }
72
- function m() {
73
- var o;
70
+ function y() {
71
+ var l;
74
72
  if (a.value)
75
73
  return [{
76
- values: p.value.filter((l) => l[n.labelKey].toLowerCase().includes(a.value))
74
+ values: f.value.filter((o) => o[e.labelKey].toLowerCase().includes(a.value))
77
75
  }];
78
- const e = [];
79
- let t = d.value;
76
+ const n = [];
77
+ let t = c.value;
80
78
  for (; t; )
81
- e.push({ values: t }), t = (o = t[0]) == null ? void 0 : o.children;
82
- return e;
79
+ n.push({ values: t }), t = (l = t[0]) == null ? void 0 : l.children;
80
+ return n;
83
81
  }
84
- function x(e) {
82
+ function b(n) {
85
83
  if (a.value) {
86
- const o = p.value.filter((l) => l[n.labelKey].toLowerCase().includes(a.value));
84
+ const l = f.value.filter((o) => o[e.labelKey].toLowerCase().includes(a.value));
87
85
  return [{
88
- values: o,
89
- defaultIndex: o.findIndex((l) => l[n.valueKey] === e[n.valueKey])
86
+ values: l,
87
+ defaultIndex: l.findIndex((o) => o[e.valueKey] === n[e.valueKey])
90
88
  }];
91
89
  }
92
90
  const t = [];
93
- for (let o = n.options.length - 1; o >= 0; o--) {
94
- const l = n.options[o].filter((i) => i[n.pidKey] === e[n.pidKey]);
95
- t[o] = {
96
- values: l,
97
- defaultIndex: l.findIndex((i) => i[n.valueKey] === e[n.valueKey])
98
- }, o > 0 && (e = n.options[o - 1].find((i) => i[n.valueKey] === e[n.pidKey]));
91
+ for (let l = e.options.length - 1; l >= 0; l--) {
92
+ const o = e.options[l].filter((u) => u[e.pidKey] === n[e.pidKey]);
93
+ t[l] = {
94
+ values: o,
95
+ defaultIndex: o.findIndex((u) => u[e.valueKey] === n[e.valueKey])
96
+ }, l > 0 && (n = e.options[l - 1].find((u) => u[e.valueKey] === n[e.pidKey]));
99
97
  }
100
98
  return t;
101
99
  }
102
- return (e, t) => (v(), h("van-popup", {
103
- show: e.show,
100
+ return E(a, y), (n, t) => (K(), F("van-popup", {
101
+ show: i.show,
104
102
  position: "bottom",
105
103
  round: !0,
106
104
  "close-on-click-overlay": !0,
107
- onClose: t[4] || (t[4] = (o) => f())
105
+ onClose: t[4] || (t[4] = (l) => p())
108
106
  }, [
109
- A("van-picker", D(e.$attrs, {
110
- title: e.title,
107
+ T("van-picker", A(n.$attrs, {
108
+ title: i.title,
111
109
  "show-toolbar": !0,
112
- "value-key": e.labelKey,
113
- columns: C.value,
114
- loading: e.loading,
115
- onCancel: t[0] || (t[0] = (o) => w()),
116
- onConfirm: t[1] || (t[1] = (o) => V(o)),
117
- onChange: t[2] || (t[2] = (o) => k(o))
118
- }), null, 16, z),
119
- e.searchable && e.options.length ? (v(), h("van-search", {
110
+ "value-key": i.labelKey,
111
+ columns: g.value,
112
+ loading: i.loading,
113
+ onCancel: t[0] || (t[0] = (l) => V()),
114
+ onConfirm: t[1] || (t[1] = (l) => C(l)),
115
+ onChange: t[2] || (t[2] = (l) => k(l))
116
+ }), null, 16, H),
117
+ i.searchable && i.options.length ? (K(), j(U(S), {
120
118
  key: 0,
121
- shape: "round",
122
- "input-align": "center",
123
- placeholder: "请输入搜索关键词",
124
- onChange: t[3] || (t[3] = (o) => b(o))
125
- }, null, 32)) : T("", !0)
126
- ], 40, j));
119
+ modelValue: a.value,
120
+ "onUpdate:modelValue": t[3] || (t[3] = (l) => a.value = l),
121
+ placeholder: "输入关键字搜索"
122
+ }, null, 8, ["modelValue"])) : z("", !0)
123
+ ], 40, G));
127
124
  }
128
125
  });
129
126
  export {
130
- H as default
127
+ Q as default
131
128
  };
package/index5.js CHANGED
@@ -1,30 +1,34 @@
1
- import { defineComponent as H, mergeModels as D, useModel as z, computed as i, ref as V, renderSlot as Y, unref as j, openBlock as x, createBlock as A, createCommentVNode as G, createElementVNode as J, mergeProps as K, resolveDirective as L, createElementBlock as O, withDirectives as Q, toDisplayString as R, normalizeClass as U, createVNode as W, Fragment as X } from "vue";
2
- import { date as m } from "@solar-taro/core";
3
- import { SunIcon as b } from "@solar-taro/ui-sun";
4
- import { vDatetimePicker as Z } from "./index12.js";
5
- const ee = Y, c = j, o = x, te = A, ae = G, r = J, ne = K, re = L, s = O, C = Q, d = R, M = U, le = W, oe = X, ie = ["label", "value", "placeholder", "required"], se = { name: "right-icon" }, ue = ["show", "title"], ce = { class: "sun-date-range-picker-input-group" }, de = {
1
+ import { defineComponent as R, inject as N, useModel as A, useId as G, computed as c, ref as $, effect as q, Fragment as J, mergeModels as x, openBlock as K, createElementBlock as O, renderSlot as Q, createElementVNode as W, normalizeClass as X, toDisplayString as Z, createBlock as ee, unref as te, withModifiers as ae, createCommentVNode as ne, createVNode as re, createSlots as ie, withCtx as le, withDirectives as se } from "vue";
2
+ import { date as g } from "@solar-taro/core";
3
+ import { SUN_ITEM as oe, SUN_FIELD as ue, SunIcon as V } from "@solar-taro/ui-sun";
4
+ import { linkedRef as de } from "@solar-vue/core";
5
+ import ce from "./index6.js";
6
+ import { vDatetimePicker as pe } from "./index13.js";
7
+ const ve = Q, p = Z, l = K, d = O, me = ne, n = te, I = ae, fe = ee, D = re, M = X, s = W, ke = se, E = le, we = ie, ge = J, ye = {
8
+ key: 0,
9
+ class: "sun-date-range-picker-inner"
10
+ }, he = {
11
+ key: 1,
12
+ class: "sun-date-range-picker-placeholder"
13
+ }, _e = { class: "sun-date-range-picker-input-group" }, be = {
6
14
  key: 0,
7
15
  class: "sun-date-range-picker-input-value"
8
- }, ve = {
16
+ }, Ve = {
9
17
  key: 1,
10
18
  class: "sun-date-range-picker-input-placeholder"
11
- }, pe = { class: "sun-date-range-picker-input-label" }, me = {
19
+ }, De = { class: "sun-date-range-picker-input-label" }, Me = {
12
20
  key: 0,
13
21
  class: "date-range-picker-input-value"
14
- }, fe = {
22
+ }, Ce = {
15
23
  key: 1,
16
24
  class: "sun-date-range-picker-input-placeholder"
17
- }, ge = { class: "sun-date-range-picker-input-label" }, ke = ["id", "type", "value", "min-date", "max-date"], ye = { class: "sun-date-range-picker-btn-wrapper" };
18
- let we = 1;
19
- const be = /* @__PURE__ */ H({
25
+ }, Te = { class: "sun-date-range-picker-input-label" }, Se = ["id", "type", "value", "min-date", "max-date"], F = " ~ ", Ee = /* @__PURE__ */ R({
20
26
  __name: "index",
21
- props: /* @__PURE__ */ D({
22
- id: { default: () => `van-datetime-picker-${we++}` },
27
+ props: /* @__PURE__ */ x({
23
28
  type: { default: "date" },
24
- label: {},
25
- title: {},
26
29
  placeholder: {},
27
30
  required: { type: Boolean },
31
+ disabled: { type: Boolean },
28
32
  format: {},
29
33
  min: { default: () => new Date((/* @__PURE__ */ new Date()).getFullYear() - 1, 0, 0, 0, 0, 0).getTime() },
30
34
  max: { default: () => new Date((/* @__PURE__ */ new Date()).getFullYear() + 1, 0, 0, 0, 0, 0).getTime() }
@@ -32,145 +36,157 @@ const be = /* @__PURE__ */ H({
32
36
  modelValue: { required: !0 },
33
37
  modelModifiers: {}
34
38
  }),
35
- emits: /* @__PURE__ */ D(["confirm", "clear", "close"], ["update:modelValue"]),
36
- setup(w, { emit: $ }) {
37
- const n = w, a = z(w, "modelValue"), f = $, _ = " ~ ", B = i(
38
- () => a.value[u.value] || F()
39
- ), g = V(!1), u = V(0), T = i(() => {
40
- const [t, e] = a.value;
41
- return t && e ? m(t, v.value) + _ + m(e, v.value) : "";
42
- }), q = i(() => a.value.length && !n.required), v = i(() => {
43
- if (n.format)
44
- return n.format;
45
- switch (n.type) {
39
+ emits: /* @__PURE__ */ x(["confirm", "clear"], ["update:modelValue"]),
40
+ setup(o, { emit: H }) {
41
+ const v = N(oe, void 0), y = N(ue, void 0), a = o, C = H, u = A(o, "modelValue"), r = de(() => [...u.value]), U = G(), j = c(
42
+ () => r.value[m.value] || S()
43
+ ), f = $(!1), m = $(0), h = c(() => {
44
+ const [t, e] = u.value;
45
+ return t && e ? g(t, k.value) + F + g(e, k.value) : "";
46
+ }), T = c(() => u.value.length && !a.required && !a.disabled), k = c(() => {
47
+ if (a.format)
48
+ return a.format;
49
+ switch (a.type) {
46
50
  case "date":
47
51
  return "yyyy-MM-dd";
48
52
  case "datetime":
49
53
  return "yyyy-MM-dd HH:mm";
50
54
  }
51
- }), N = i(() => {
52
- if (n.title)
53
- return n.title;
54
- switch (n.type) {
55
+ }), z = c(() => {
56
+ switch (a.type) {
55
57
  case "date":
56
58
  return "请选择日期";
57
59
  case "datetime":
58
60
  return "请选择时间";
59
61
  }
60
- }), k = i(() => {
61
- if (n.placeholder)
62
- return n.placeholder;
63
- switch (n.type) {
62
+ }), _ = c(() => {
63
+ if (a.placeholder)
64
+ return a.placeholder;
65
+ switch (a.type) {
64
66
  case "date":
65
67
  return ["开始日期", "结束日期"];
66
68
  case "datetime":
67
69
  return ["开始时间", "结束时间"];
68
70
  }
69
71
  });
70
- function F() {
72
+ function S() {
71
73
  const t = /* @__PURE__ */ new Date(), e = t.getMinutes();
72
- switch (n.type) {
74
+ switch (a.type) {
73
75
  case "date":
74
76
  return t.setHours(0, 0, 0, 0);
75
77
  case "datetime":
76
- return t.setMinutes(e - e % 5);
78
+ return t.setMinutes(e - e % 5, 0, 0);
77
79
  }
78
80
  }
79
- function h() {
80
- g.value = !0, p(0);
81
+ function b() {
82
+ a.disabled || (f.value = !0, w(0));
81
83
  }
82
- function y() {
83
- g.value = !1, f("close");
84
+ function P() {
85
+ f.value = !1;
84
86
  }
85
- function I() {
86
- f("clear", a.value), a.value = [];
87
+ function B() {
88
+ C("clear", u.value), u.value = [], r.value = [];
87
89
  }
88
- function p(t) {
89
- u.value = t;
90
+ function w(t) {
91
+ var e, i;
92
+ m.value = t, (i = (e = r.value)[t]) != null || (e[t] = S());
90
93
  }
91
- function S(t) {
92
- a.value[u.value] = t, a.value = [...a.value];
94
+ function Y(t) {
95
+ r.value[m.value] = t;
93
96
  }
94
- function E() {
95
- const [t, e] = a.value;
97
+ function L() {
98
+ const [t, e] = r.value;
96
99
  if (!t || !e)
97
- return p(t ? 1 : 0);
98
- f("confirm", a.value), y();
100
+ return w(t ? 1 : 0);
101
+ u.value = [...r.value], C("confirm", u.value), P();
99
102
  }
100
- return (t, e) => {
101
- const P = re("readonly");
102
- return o(), s(oe, null, [
103
- ee(t.$slots, "default", { present: h }, () => [
104
- C((o(), s("van-field", ne(t.$attrs, {
105
- label: t.label,
106
- value: T.value,
107
- placeholder: k.value.join(_),
108
- required: t.required,
109
- onClickInput: e[1] || (e[1] = (l) => h())
110
- }), [
111
- r("slot-view", se, [
112
- q.value ? (o(), te(c(b), {
113
- key: 0,
114
- class: "sun-date-range-picker-clear-icon",
115
- name: "close-circle",
116
- onTap: e[0] || (e[0] = (l) => I())
117
- })) : ae("", !0)
118
- ])
119
- ], 16, ie)), [
120
- [P]
121
- ])
122
- ]),
123
- r("van-action-sheet", {
124
- show: g.value,
125
- title: N.value,
126
- "close-on-click-overlay": !0,
127
- onClose: e[6] || (e[6] = (l) => y()),
128
- onCancel: e[7] || (e[7] = (l) => y())
103
+ return q(() => {
104
+ y && (y.required.value = a.required, y.disabled.value = a.disabled);
105
+ }), q(() => {
106
+ v && (v.clickable.value = !a.disabled);
107
+ }), v == null || v.onTap(b), (t, e) => (l(), d(ge, null, [
108
+ ve(t.$slots, "default", {
109
+ present: b,
110
+ displayValue: h.value
111
+ }, () => [
112
+ s("view", {
113
+ class: M(["sun-date-range-picker", {
114
+ "sun-date-range-picker-required": o.required,
115
+ "sun-date-range-picker-disabled": o.disabled
116
+ }]),
117
+ onTap: e[1] || (e[1] = (i) => b())
129
118
  }, [
130
- r("view", ce, [
131
- r("view", {
132
- class: M(["sun-date-range-picker-input", { "sun-date-range-picker-input-active": u.value === 0 }]),
133
- onTap: e[2] || (e[2] = (l) => p(0))
119
+ h.value ? (l(), d("view", ye, p(h.value), 1)) : (l(), d("view", he, p(_.value.join(F)), 1)),
120
+ T.value ? (l(), fe(n(V), {
121
+ key: 2,
122
+ class: "sun-date-range-picker-clear-icon",
123
+ name: "close-circle",
124
+ onTap: e[0] || (e[0] = I((i) => B(), ["stop"]))
125
+ })) : me("", !0),
126
+ D(n(V), {
127
+ class: "sun-date-range-picker-icon",
128
+ name: "calendar-outline"
129
+ })
130
+ ], 34)
131
+ ]),
132
+ D(n(ce), {
133
+ show: f.value,
134
+ "onUpdate:show": e[6] || (e[6] = (i) => f.value = i),
135
+ title: z.value,
136
+ "confirm-text": n(r)[0] && n(r)[1] ? "确定" : "继续",
137
+ onTap: e[7] || (e[7] = I(() => {
138
+ }, ["stop"])),
139
+ onConfirm: e[8] || (e[8] = (i) => L())
140
+ }, we({
141
+ default: E(() => [
142
+ s("view", _e, [
143
+ s("view", {
144
+ class: M(["sun-date-range-picker-input", { "sun-date-range-picker-input-active": m.value === 0 }]),
145
+ onTap: e[3] || (e[3] = (i) => w(0))
134
146
  }, [
135
- a.value[0] ? (o(), s("view", de, d(c(m)(a.value[0], v.value)), 1)) : (o(), s("view", ve, "请选择")),
136
- r("view", pe, d(k.value[0]), 1)
147
+ n(r)[0] ? (l(), d("view", be, p(n(g)(n(r)[0], k.value)), 1)) : (l(), d("view", Ve, "请选择")),
148
+ s("view", De, p(_.value[0]), 1)
137
149
  ], 34),
138
- le(c(b), {
150
+ D(n(V), {
139
151
  class: "sun-date-range-picker-input-group-icon",
140
152
  name: "arrow-forward"
141
153
  }),
142
- r("view", {
143
- class: M(["sun-date-range-picker-input", { "sun-date-range-picker-input-active": u.value === 1 }]),
144
- onTap: e[3] || (e[3] = (l) => p(1))
154
+ s("view", {
155
+ class: M(["sun-date-range-picker-input", { "sun-date-range-picker-input-active": m.value === 1 }]),
156
+ onTap: e[4] || (e[4] = (i) => w(1))
145
157
  }, [
146
- a.value[1] ? (o(), s("view", me, d(c(m)(a.value[1], v.value)), 1)) : (o(), s("view", fe, "请选择")),
147
- r("view", ge, d(k.value[1]), 1)
158
+ n(r)[1] ? (l(), d("view", Me, p(n(g)(n(r)[1], k.value)), 1)) : (l(), d("view", Ce, "请选择")),
159
+ s("view", Te, p(_.value[1]), 1)
148
160
  ], 34)
149
161
  ]),
150
- C(r("van-datetime-picker", {
151
- id: t.id,
152
- type: t.type,
162
+ ke(s("van-datetime-picker", {
163
+ id: n(U),
164
+ type: o.type,
153
165
  "show-toolbar": !1,
154
- value: B.value,
155
- "min-date": t.min,
156
- "max-date": t.max,
157
- onInput: e[4] || (e[4] = (l) => S(l.detail))
158
- }, null, 40, ke), [
159
- [c(Z)]
160
- ]),
161
- r("view", ye, [
162
- r("van-button", {
163
- type: "primary",
164
- round: "true",
165
- block: "true",
166
- onTap: e[5] || (e[5] = (l) => E())
167
- }, d(a.value[0] && a.value[1] ? "确定" : "继续"), 33)
166
+ value: j.value,
167
+ "min-date": o.min,
168
+ "max-date": o.max,
169
+ onInput: e[5] || (e[5] = (i) => Y(i.detail))
170
+ }, null, 40, Se), [
171
+ [n(pe)]
168
172
  ])
169
- ], 40, ue)
170
- ], 64);
171
- };
173
+ ]),
174
+ _: 2
175
+ }, [
176
+ T.value ? {
177
+ name: "extra",
178
+ fn: E(() => [
179
+ s("view", {
180
+ class: "sun-date-range-picker-clear-btn",
181
+ onTap: e[2] || (e[2] = (i) => B())
182
+ }, "清除", 32)
183
+ ]),
184
+ key: "0"
185
+ } : void 0
186
+ ]), 1032, ["show", "title", "confirm-text"])
187
+ ], 64));
172
188
  }
173
189
  });
174
190
  export {
175
- be as default
191
+ Ee as default
176
192
  };
package/index6.js CHANGED
@@ -1,12 +1,13 @@
1
- import { defineComponent as f, ref as h, computed as b, watch as y, onUnmounted as g, renderSlot as v, createElementVNode as w, toDisplayString as k, openBlock as B, createElementBlock as _, createCommentVNode as C, mergeProps as $ } from "vue";
1
+ import { defineComponent as f, ref as h, computed as p, watch as b, onUnmounted as w, openBlock as g, createElementBlock as y, mergeProps as v, createElementVNode as x, renderSlot as k, createVNode as B, unref as C, withCtx as N, createTextVNode as V, toDisplayString as _, createCommentVNode as $ } from "vue";
2
+ import { SunButton as S } from "@solar-taro/ui-sun";
2
3
  import { onKeyboardHeightChange as D, offKeyboardHeightChange as E } from "@tarojs/taro";
3
- const n = v, r = w, N = k, a = B, i = _, S = C, V = $, H = ["show", "title", "close-on-click-overlay"], K = {
4
+ const s = k, T = x, H = _, K = V, P = C, I = N, U = B, i = g, r = y, j = $, q = v, z = ["show", "title", "close-on-click-overlay"], A = {
4
5
  class: "sun-modal-extra",
5
6
  style: { position: "absolute", top: "0", left: "16px", display: "flex", alignItems: "center", height: "48px" }
6
- }, P = {
7
+ }, F = {
7
8
  key: 0,
8
9
  class: "van-button-container van-button-group"
9
- }, T = ["disabled"], U = /* @__PURE__ */ f({
10
+ }, M = /* @__PURE__ */ f({
10
11
  __name: "index",
11
12
  props: {
12
13
  show: { type: Boolean },
@@ -16,39 +17,42 @@ const n = v, r = w, N = k, a = B, i = _, S = C, V = $, H = ["show", "title", "cl
16
17
  confirmDisabled: { type: Boolean }
17
18
  },
18
19
  emits: ["update:show", "close", "confirm"],
19
- setup(c, { emit: d }) {
20
- const t = d, m = c, s = h(0), p = b(() => s.value === 0);
21
- function l(e) {
22
- s.value = e.height;
20
+ setup(t, { emit: c }) {
21
+ const n = c, d = t, l = h(0), m = p(() => l.value === 0);
22
+ function a(e) {
23
+ l.value = e.height;
23
24
  }
24
- return y(() => m.show, (e) => {
25
- e || t("close");
26
- }), D(l), g(() => {
27
- E(l);
28
- }), (e, o) => (a(), i("van-action-sheet", V(e.$attrs, {
29
- show: e.show,
30
- title: e.title,
31
- "close-on-click-overlay": p.value,
32
- onClose: o[1] || (o[1] = (u) => t("update:show", !1))
25
+ return b(() => d.show, (e) => {
26
+ e || n("close");
27
+ }), D(a), w(() => {
28
+ E(a);
29
+ }), (e, o) => (i(), r("van-action-sheet", q(e.$attrs, {
30
+ show: t.show,
31
+ title: t.title,
32
+ "close-on-click-overlay": m.value,
33
+ onClose: o[1] || (o[1] = (u) => n("update:show", !1))
33
34
  }), [
34
- r("view", K, [
35
- n(e.$slots, "extra")
35
+ T("view", A, [
36
+ s(e.$slots, "extra")
36
37
  ]),
37
- n(e.$slots, "default"),
38
- e.showButtons ? (a(), i("view", P, [
39
- n(e.$slots, "buttons", {}, () => [
40
- r("van-button", {
41
- type: "primary",
42
- round: "true",
43
- block: "true",
44
- disabled: e.confirmDisabled,
45
- onClick: o[0] || (o[0] = (u) => t("confirm"))
46
- }, N(e.confirmText), 9, T)
38
+ s(e.$slots, "default"),
39
+ t.showButtons ? (i(), r("view", F, [
40
+ s(e.$slots, "buttons", {}, () => [
41
+ U(P(S), {
42
+ expand: "block",
43
+ disabled: t.confirmDisabled,
44
+ onClick: o[0] || (o[0] = (u) => n("confirm"))
45
+ }, {
46
+ default: I(() => [
47
+ K(H(t.confirmText), 1)
48
+ ]),
49
+ _: 1
50
+ }, 8, ["disabled"])
47
51
  ])
48
- ])) : S("", !0)
49
- ], 16, H));
52
+ ])) : j("", !0)
53
+ ], 16, z));
50
54
  }
51
55
  });
52
56
  export {
53
- U as default
57
+ M as default
54
58
  };