@opendesign-plus/components 0.0.1-rc.5 → 0.0.1-rc.6

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
- import { defineComponent as j, computed as O, ref as D, onMounted as H, watch as Z, createBlock as S, openBlock as f, unref as e, withCtx as a, Teleport as F, createElementBlock as C, createCommentVNode as I, createElementVNode as o, createVNode as r, normalizeClass as P, createTextVNode as d, toDisplayString as i, Fragment as W, renderSlot as q, nextTick as J } from "vue";
1
+ import { defineComponent as j, computed as O, ref as S, onMounted as H, watch as Z, createBlock as I, openBlock as f, unref as e, withCtx as a, Teleport as F, createElementBlock as E, createCommentVNode as U, createElementVNode as o, createVNode as r, normalizeClass as P, createTextVNode as d, toDisplayString as l, Fragment as W, renderSlot as q, nextTick as J } from "vue";
2
2
  import { u as Q, C as X, _ as ee } from "./chunk-index.es.js";
3
3
  import { useScreen as oe } from "@opendesign-plus/composables";
4
- import { ElButton as h, ElIcon as te, ElDialog as le, ElSwitch as ie } from "element-plus";
4
+ import { ElButton as h, ElIcon as te, ElDialog as ie, ElSwitch as le } from "element-plus";
5
5
  import "element-plus/es/components/button/style/index";
6
6
  import "element-plus/es/components/dialog/style/index";
7
7
  import "element-plus/es/components/switch/style/index";
@@ -17,90 +17,91 @@ const se = {
17
17
  }, ue = ["href"], me = { class: "cookie-title" }, pe = { class: "cookie-desc" }, ke = ["href"], ve = {
18
18
  key: 0,
19
19
  class: "cookie-notice-right"
20
- }, fe = { class: "cookie-dlg-content" }, _e = { class: "content-item" }, ye = { class: "item-header" }, he = { class: "item-title" }, ge = { class: "item-extra" }, Ce = { class: "item-detail" }, Ee = { class: "content-item" }, we = { class: "item-header" }, Ve = { class: "item-title" }, be = { class: "item-extra" }, Ae = { class: "item-detail" }, xe = "0", U = "1", Ne = "2", E = "3", Oe = "agreed-cookiepolicy-zh", De = "agreed-cookiepolicy-en", Se = /* @__PURE__ */ j({
20
+ }, fe = { class: "cookie-dlg-content" }, _e = { class: "content-item" }, ye = { class: "item-header" }, he = { class: "item-title" }, ge = { class: "item-extra" }, Ce = { class: "item-detail" }, Ee = { class: "content-item" }, we = { class: "item-header" }, Ve = { class: "item-title" }, be = { class: "item-extra" }, Ae = { class: "item-detail" }, De = "0", B = "1", xe = "2", w = "3", Ne = "agreed-cookiepolicy-zh", Oe = "agreed-cookiepolicy-en", Se = /* @__PURE__ */ j({
21
21
  __name: "OElCookieNotice",
22
22
  props: {
23
23
  visible: { type: Boolean },
24
24
  enableGrid: { type: Boolean },
25
25
  community: {},
26
26
  detailUrl: {},
27
- wrapper: {}
27
+ wrapper: {},
28
+ cookieDomain: {}
28
29
  },
29
30
  emits: ["update:visible"],
30
- setup(u, { expose: B, emit: R }) {
31
- const $ = u, G = R, { lePadV: T } = oe(), { locale: g, t: l } = Q(), p = O(() => g.value === "zh"), c = O(() => p.value ? Oe : De), m = D(!1), k = ne($, "visible", G, { defaultValue: !1 }), _ = (n) => {
31
+ setup(u, { expose: R, emit: $ }) {
32
+ const g = u, G = $, { lePadV: T } = oe(), { locale: C, t: i } = Q(), p = O(() => C.value === "zh"), c = O(() => p.value ? Ne : Oe), m = S(!1), k = ne(g, "visible", G, { defaultValue: !1 }), _ = (n) => {
32
33
  const t = document.cookie.split(";").find((s) => s.split("=")[0].trim() === encodeURIComponent(n));
33
34
  return t ? decodeURIComponent(t.split("=")[1]) : null;
34
- }, w = (n, t, s, M) => {
35
+ }, V = (n, t, s, M) => {
35
36
  const Y = `; max-age=${s * 24 * 60 * 60}`;
36
37
  document.cookie = `${encodeURIComponent(n)}=${encodeURIComponent(t)}${Y}; path=/; domain=${M}`;
37
38
  }, v = (n) => {
38
39
  typeof n == "boolean" ? k.value = n : k.value = !k.value, J(() => {
39
- !k.value && p.value && _(c.value) !== E && w(c.value, E, 180, location.hostname);
40
+ !k.value && p.value && _(c.value) !== w && V(c.value, w, 180, g.cookieDomain ?? location.hostname);
40
41
  });
41
- }, y = D(!1), V = (n) => {
42
+ }, y = S(!1), b = (n) => {
42
43
  typeof n == "boolean" ? y.value = n : y.value = !y.value;
43
- }, A = () => p.value ? _(c.value) !== E : (_(c.value) ?? "0") === xe, x = () => p.value ? _(c.value) === E : _(c.value) === U;
44
+ }, D = () => p.value ? _(c.value) !== w : (_(c.value) ?? "0") === De, x = () => p.value ? _(c.value) === w : _(c.value) === B;
44
45
  H(() => {
45
- A() && v(!0);
46
- }), Z(g, () => {
47
- v(A());
46
+ D() && v(!0);
47
+ }), Z(C, () => {
48
+ v(D());
48
49
  });
49
- const b = () => {
50
- m.value = !0, w(c.value, U, 180, location.hostname), v(!1);
50
+ const A = () => {
51
+ m.value = !0, V(c.value, B, 180, g.cookieDomain ?? location.hostname), v(!1);
51
52
  }, N = () => {
52
- m.value = !1, w(c.value, Ne, 180, location.hostname), v(!1);
53
+ m.value = !1, V(c.value, xe, 180, g.cookieDomain ?? location.hostname), v(!1);
53
54
  }, K = () => {
54
- m.value ? b() : N(), V(!1);
55
+ m.value ? A() : N(), b(!1);
55
56
  }, L = () => {
56
- m.value = !0, b(), V(!1);
57
+ m.value = !0, A(), b(!1);
57
58
  }, z = () => {
58
59
  m.value = x();
59
60
  };
60
- return B({
61
+ return R({
61
62
  check() {
62
63
  x() === k.value && v();
63
64
  }
64
- }), (n, t) => (f(), S(e(X), null, {
65
+ }), (n, t) => (f(), I(e(X), null, {
65
66
  default: a(() => [
66
- (f(), S(F, {
67
+ (f(), I(F, {
67
68
  to: u.wrapper || "#app"
68
69
  }, [
69
- e(k) ? (f(), C("div", se, [
70
+ e(k) ? (f(), E("div", se, [
70
71
  o("div", ae, [
71
72
  o("div", {
72
- type: e(g),
73
+ type: e(C),
73
74
  class: P({ "cookie-notice-wrap-grid": u.enableGrid, "cookie-notice-wrap": !u.enableGrid })
74
75
  }, [
75
76
  o("div", re, [
76
- p.value ? (f(), C("p", de, [
77
- d(i(e(l)("cookie.desc")) + " ", 1),
77
+ p.value ? (f(), E("p", de, [
78
+ d(l(e(i)("cookie.desc")) + " ", 1),
78
79
  o("a", {
79
80
  href: u.detailUrl,
80
81
  target: "_blank",
81
82
  rel: "noopener noreferrer"
82
- }, i(e(l)("cookie.about")), 9, ue)
83
- ])) : (f(), C(W, { key: 1 }, [
84
- o("p", me, i(e(l)("cookie.title", [u.community])), 1),
83
+ }, l(e(i)("cookie.about")), 9, ue)
84
+ ])) : (f(), E(W, { key: 1 }, [
85
+ o("p", me, l(e(i)("cookie.title", [u.community])), 1),
85
86
  o("p", pe, [
86
- d(i(e(l)("cookie.desc")) + " ", 1),
87
+ d(l(e(i)("cookie.desc")) + " ", 1),
87
88
  o("a", {
88
89
  href: u.detailUrl,
89
90
  target: "_blank",
90
91
  rel: "noopener noreferrer"
91
- }, i(e(l)("cookie.about")), 9, ke),
92
+ }, l(e(i)("cookie.about")), 9, ke),
92
93
  t[4] || (t[4] = d(". ", -1))
93
94
  ])
94
95
  ], 64))
95
96
  ]),
96
- p.value ? I("", !0) : (f(), C("div", ve, [
97
+ p.value ? U("", !0) : (f(), E("div", ve, [
97
98
  r(e(h), {
98
99
  round: "",
99
100
  type: "primary",
100
- onClick: b
101
+ onClick: A
101
102
  }, {
102
103
  default: a(() => [
103
- d(i(e(l)("cookie.acceptAll")), 1)
104
+ d(l(e(i)("cookie.acceptAll")), 1)
104
105
  ]),
105
106
  _: 1
106
107
  }),
@@ -110,24 +111,24 @@ const se = {
110
111
  onClick: N
111
112
  }, {
112
113
  default: a(() => [
113
- d(i(e(l)("cookie.rejectAll")), 1)
114
+ d(l(e(i)("cookie.rejectAll")), 1)
114
115
  ]),
115
116
  _: 1
116
117
  }),
117
118
  r(e(h), {
118
119
  round: "",
119
120
  type: "primary",
120
- onClick: t[0] || (t[0] = (s) => V(!0))
121
+ onClick: t[0] || (t[0] = (s) => b(!0))
121
122
  }, {
122
123
  default: a(() => [
123
- d(i(e(l)("cookie.manage")), 1)
124
+ d(l(e(i)("cookie.manage")), 1)
124
125
  ]),
125
126
  _: 1
126
127
  })
127
128
  ])),
128
129
  r(e(te), {
129
130
  class: "cookie-notice-close",
130
- type: e(g),
131
+ type: e(C),
131
132
  onClick: t[1] || (t[1] = (s) => v(!1))
132
133
  }, {
133
134
  default: a(() => [
@@ -147,11 +148,11 @@ const se = {
147
148
  }, 8, ["type"])
148
149
  ], 10, ce)
149
150
  ]),
150
- r(e(le), {
151
+ r(e(ie), {
151
152
  modelValue: y.value,
152
153
  "onUpdate:modelValue": t[3] || (t[3] = (s) => y.value = s),
153
154
  width: e(T) ? "90%" : "50%",
154
- title: e(l)("cookie.manage"),
155
+ title: e(i)("cookie.manage"),
155
156
  "destroy-on-close": "",
156
157
  onOpen: z
157
158
  }, {
@@ -163,7 +164,7 @@ const se = {
163
164
  style: { "margin-right": "16px" }
164
165
  }, {
165
166
  default: a(() => [
166
- d(i(e(l)("cookie.saveSetting")), 1)
167
+ d(l(e(i)("cookie.saveSetting")), 1)
167
168
  ]),
168
169
  _: 1
169
170
  }),
@@ -173,7 +174,7 @@ const se = {
173
174
  onClick: L
174
175
  }, {
175
176
  default: a(() => [
176
- d(i(e(l)("cookie.acceptAll")), 1)
177
+ d(l(e(i)("cookie.acceptAll")), 1)
177
178
  ]),
178
179
  _: 1
179
180
  })
@@ -182,34 +183,34 @@ const se = {
182
183
  o("div", fe, [
183
184
  o("div", _e, [
184
185
  o("div", ye, [
185
- o("span", he, i(e(l)("cookie.necessaryCookie")), 1),
186
- o("span", ge, i(e(l)("cookie.alwaysOn")), 1)
186
+ o("span", he, l(e(i)("cookie.necessaryCookie")), 1),
187
+ o("span", ge, l(e(i)("cookie.alwaysOn")), 1)
187
188
  ]),
188
- o("div", Ce, i(e(l)("cookie.necessaryCookieDetail")), 1)
189
+ o("div", Ce, l(e(i)("cookie.necessaryCookieDetail")), 1)
189
190
  ]),
190
191
  o("div", Ee, [
191
192
  o("div", we, [
192
- o("span", Ve, i(e(l)("cookie.analyticalCookie")), 1),
193
+ o("span", Ve, l(e(i)("cookie.analyticalCookie")), 1),
193
194
  o("span", be, [
194
- r(e(ie), {
195
+ r(e(le), {
195
196
  modelValue: m.value,
196
197
  "onUpdate:modelValue": t[2] || (t[2] = (s) => m.value = s)
197
198
  }, null, 8, ["modelValue"])
198
199
  ])
199
200
  ]),
200
- o("div", Ae, i(e(l)("cookie.analyticalCookieDetail")), 1)
201
+ o("div", Ae, l(e(i)("cookie.analyticalCookieDetail")), 1)
201
202
  ])
202
203
  ])
203
204
  ]),
204
205
  _: 1
205
206
  }, 8, ["modelValue", "width", "title"])
206
- ])) : I("", !0)
207
+ ])) : U("", !0)
207
208
  ], 8, ["to"]))
208
209
  ]),
209
210
  _: 3
210
211
  }));
211
212
  }
212
- }), ze = /* @__PURE__ */ ee(Se, [["__scopeId", "data-v-0f21fee4"]]);
213
+ }), ze = /* @__PURE__ */ ee(Se, [["__scopeId", "data-v-c6024199"]]);
213
214
  export {
214
215
  ze as OElCookieNotice
215
216
  };