@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 H, computed as O, createElementBlock as s, openBlock as o, normalizeStyle as q, unref as e, renderSlot as w, ref as D, normalizeClass as P, createBlock as I, toDisplayString as m, withCtx as h, Fragment as U, renderList as K, createVNode as v, createElementVNode as r, createCommentVNode as g, createTextVNode as V, onMounted as ne, watch as G, Teleport as ve, nextTick as me, withDirectives as pe, withKeys as fe, withModifiers as ge, vShow as ye, reactive as ke, provide as _e } from "vue";
2
- import { isBoolean as Q, isString as X, isUndefined as we, OCarousel as ee, OCarouselItem as te, OFigure as oe, OButton as j, OIcon as z, OIconClose as be, ODialog as $e, OSwitch as re, OInput as Ce, ODivider as Ie, OConfigProvider as xe, isArray as ze, OLink as Oe } from "@opensig/opendesign";
1
+ import { defineComponent as H, computed as O, createElementBlock as s, openBlock as o, normalizeStyle as q, unref as e, renderSlot as w, ref as D, normalizeClass as P, createBlock as I, toDisplayString as m, withCtx as h, Fragment as U, renderList as K, createVNode as v, createElementVNode as c, createCommentVNode as g, createTextVNode as V, onMounted as ne, watch as G, Teleport as ve, nextTick as me, withDirectives as pe, withKeys as fe, withModifiers as ge, vShow as ye, reactive as ke, provide as _e } from "vue";
2
+ import { isBoolean as Q, isString as X, isUndefined as we, OCarousel as ee, OCarouselItem as te, OFigure as oe, OButton as j, OIcon as z, OIconClose as be, ODialog as $e, OSwitch as ce, OInput as Ce, ODivider as Ie, OConfigProvider as xe, isArray as ze, OLink as Oe } from "@opensig/opendesign";
3
3
  import { useTheme as Se, useScreen as F } from "@opendesign-plus/composables";
4
- import { _ as R, u as ce, C as Ve, c as Pe } from "./chunk-index.es.js";
4
+ import { _ as R, u as re, C as Ve, c as Pe } from "./chunk-index.es.js";
5
5
  import { useVModel as Me, onClickOutside as Be } from "@vueuse/core";
6
6
  const De = /* @__PURE__ */ H({
7
7
  __name: "ContentWrapper",
@@ -9,15 +9,15 @@ const De = /* @__PURE__ */ H({
9
9
  verticalPadding: { type: [Boolean, String, Array], default: void 0 }
10
10
  },
11
11
  setup(t) {
12
- const l = Symbol("default"), a = t, f = O(() => a.verticalPadding ? Q(a.verticalPadding) ? l : X(a.verticalPadding) ? a.verticalPadding : a.verticalPadding[0] : 0), d = O(() => a.verticalPadding ? Q(a.verticalPadding) ? l : X(a.verticalPadding) ? a.verticalPadding : we(a.verticalPadding[1]) ? a.verticalPadding[0] : a.verticalPadding[1] : 0);
13
- return (p, y) => (o(), s("div", {
12
+ const l = Symbol("default"), a = t, p = O(() => a.verticalPadding ? Q(a.verticalPadding) ? l : X(a.verticalPadding) ? a.verticalPadding : a.verticalPadding[0] : 0), d = O(() => a.verticalPadding ? Q(a.verticalPadding) ? l : X(a.verticalPadding) ? a.verticalPadding : we(a.verticalPadding[1]) ? a.verticalPadding[0] : a.verticalPadding[1] : 0);
13
+ return (f, y) => (o(), s("div", {
14
14
  class: "content-wrapper",
15
15
  style: q({
16
- "--content-wrapper-vertical-paddingTop": f.value === e(l) ? void 0 : f.value,
16
+ "--content-wrapper-vertical-paddingTop": p.value === e(l) ? void 0 : p.value,
17
17
  "--content-wrapper-vertical-paddingBottom": d.value === e(l) ? void 0 : d.value
18
18
  })
19
19
  }, [
20
- w(p.$slots, "default", {}, void 0, !0)
20
+ w(f.$slots, "default", {}, void 0, !0)
21
21
  ], 4));
22
22
  }
23
23
  }), le = /* @__PURE__ */ R(De, [["__scopeId", "data-v-a0f91aed"]]), Ae = { key: 0 }, Te = { class: "banner-content" }, Ue = ["src"], He = {
@@ -37,22 +37,22 @@ const De = /* @__PURE__ */ H({
37
37
  contentJustifyCenter: !1
38
38
  },
39
39
  setup(t) {
40
- const l = t, { isLight: a } = Se("opendesignplus", document.domain || "localhost"), { isPhone: f } = F(), d = O(() => l.options), p = D(""), y = (c) => {
40
+ const l = t, { isLight: a } = Se("opendesignplus", document.domain || "localhost"), { isPhone: p } = F(), d = O(() => l.options), f = D(""), y = (r) => {
41
41
  setTimeout(() => {
42
- p.value = d.value[c].bg_theme ?? "light";
42
+ f.value = d.value[r].bg_theme ?? "light";
43
43
  }, 100);
44
- }, u = (c, C) => {
45
- c && !C && window.open(c);
44
+ }, u = (r, C) => {
45
+ r && !C && window.open(r);
46
46
  };
47
- return (c, C) => (o(), s("div", {
47
+ return (r, C) => (o(), s("div", {
48
48
  class: P(["home-banner", t.size])
49
49
  }, [
50
- t.size === "tiny" ? (o(), s("div", Ae, m(d.value[1].title), 1)) : e(f) ? (o(), I(e(ee), {
50
+ t.size === "tiny" ? (o(), s("div", Ae, m(d.value[1].title), 1)) : e(p) ? (o(), I(e(ee), {
51
51
  key: 2,
52
52
  class: "banner-carousel",
53
53
  effect: "gallery",
54
54
  "indicator-click": "",
55
- "data-o-theme": p.value,
55
+ "data-o-theme": f.value,
56
56
  arrow: "never",
57
57
  "auto-play": !0,
58
58
  onBeforeChange: y
@@ -84,7 +84,7 @@ const De = /* @__PURE__ */ H({
84
84
  "active-class": "current-slide",
85
85
  "indicator-click": "",
86
86
  "auto-play": !0,
87
- "data-o-theme": p.value,
87
+ "data-o-theme": f.value,
88
88
  onBeforeChange: y
89
89
  }, {
90
90
  default: h(() => [
@@ -110,8 +110,8 @@ const De = /* @__PURE__ */ H({
110
110
  class: P(["banner-wrapper", ["banner-wrapper", t.contentJustifyCenter ? "content-center" : ""]])
111
111
  }, {
112
112
  default: h(() => [
113
- r("div", Te, [
114
- !e(f) && n.attach ? (o(), s("img", {
113
+ c("div", Te, [
114
+ !e(p) && n.attach ? (o(), s("img", {
115
115
  key: 0,
116
116
  src: n.attach,
117
117
  class: "banner-attach"
@@ -168,18 +168,19 @@ const De = /* @__PURE__ */ H({
168
168
  }, Fe = ["href"], Ye = { class: "cookie-title" }, Ze = { class: "cookie-desc" }, qe = ["href"], Qe = {
169
169
  key: 0,
170
170
  class: "cookie-notice-right"
171
- }, Xe = { class: "cookie-dlg-title" }, et = { class: "cookie-dlg-content" }, tt = { class: "content-item" }, ot = { class: "item-header" }, lt = { class: "item-title" }, at = { class: "item-extra" }, st = { class: "item-detail" }, nt = { class: "content-item" }, rt = { class: "item-header" }, ct = { class: "item-title" }, it = { class: "item-extra" }, dt = { class: "item-detail" }, ut = "0", ae = "1", ht = "2", W = "3", vt = "agreed-cookiepolicy-zh", mt = "agreed-cookiepolicy-en", pt = /* @__PURE__ */ H({
171
+ }, Xe = { class: "cookie-dlg-title" }, et = { class: "cookie-dlg-content" }, tt = { class: "content-item" }, ot = { class: "item-header" }, lt = { class: "item-title" }, at = { class: "item-extra" }, st = { class: "item-detail" }, nt = { class: "content-item" }, ct = { class: "item-header" }, rt = { class: "item-title" }, it = { class: "item-extra" }, dt = { class: "item-detail" }, ut = "0", ae = "1", ht = "2", W = "3", vt = "agreed-cookiepolicy-zh", mt = "agreed-cookiepolicy-en", pt = /* @__PURE__ */ H({
172
172
  __name: "OCookieNotice",
173
173
  props: {
174
174
  visible: { type: Boolean },
175
175
  enableGrid: { type: Boolean },
176
176
  community: {},
177
177
  detailUrl: {},
178
- wrapper: {}
178
+ wrapper: {},
179
+ cookieDomain: {}
179
180
  },
180
181
  emits: ["update:visible"],
181
182
  setup(t, { expose: l, emit: a }) {
182
- const f = t, d = a, { lePadV: p, leLaptop: y } = F(), { locale: u, t: c } = ce(), C = O(() => u.value === "zh"), n = O(() => C.value ? vt : mt), b = D(!1), x = Me(f, "visible", d, { defaultValue: !1 }), B = ($) => {
183
+ const p = t, d = a, { lePadV: f, leLaptop: y } = F(), { locale: u, t: r } = re(), C = O(() => u.value === "zh"), n = O(() => C.value ? vt : mt), b = D(!1), x = Me(p, "visible", d, { defaultValue: !1 }), B = ($) => {
183
184
  const _ = document.cookie.split(";").find((M) => M.split("=")[0].trim() === encodeURIComponent($));
184
185
  return _ ? decodeURIComponent(_.split("=")[1]) : null;
185
186
  }, L = ($, _, M, ue) => {
@@ -189,7 +190,7 @@ const De = /* @__PURE__ */ H({
189
190
  document.cookie = `${encodeURIComponent($)}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${_}`;
190
191
  }, S = ($) => {
191
192
  typeof $ == "boolean" ? x.value = $ : x.value = !x.value, me(() => {
192
- !x.value && C.value && B(n.value) !== W && L(n.value, W, 180, location.hostname);
193
+ !x.value && C.value && B(n.value) !== W && L(n.value, W, 180, p.cookieDomain ?? location.hostname);
193
194
  });
194
195
  }, A = D(!1), E = ($) => {
195
196
  typeof $ == "boolean" ? A.value = $ : A.value = !A.value;
@@ -200,14 +201,14 @@ const De = /* @__PURE__ */ H({
200
201
  S(i());
201
202
  });
202
203
  const k = () => {
203
- b.value = !0, J(n.value, location.hostname), L(n.value, ae, 180, location.hostname), S(!1);
204
+ b.value = !0, J(n.value, p.cookieDomain ?? location.hostname), L(n.value, ae, 180, p.cookieDomain ?? location.hostname), S(!1);
204
205
  }, N = () => {
205
- b.value = !1, J(n.value, location.hostname), L(n.value, ht, 180, location.hostname), S(!1);
206
+ b.value = !1, J(n.value, p.cookieDomain ?? location.hostname), L(n.value, ht, 180, p.cookieDomain ?? location.hostname), S(!1);
206
207
  }, ie = O(() => [
207
208
  {
208
209
  id: "save",
209
210
  color: "primary",
210
- label: c("cookie.saveSetting"),
211
+ label: r("cookie.saveSetting"),
211
212
  variant: "outline",
212
213
  size: "large",
213
214
  round: "pill",
@@ -218,7 +219,7 @@ const De = /* @__PURE__ */ H({
218
219
  {
219
220
  id: "allowAll",
220
221
  color: "primary",
221
- label: c("cookie.acceptAll"),
222
+ label: r("cookie.acceptAll"),
222
223
  variant: "outline",
223
224
  size: "large",
224
225
  round: "pill",
@@ -239,28 +240,28 @@ const De = /* @__PURE__ */ H({
239
240
  to: t.wrapper || "#app"
240
241
  }, [
241
242
  e(x) ? (o(), s("div", Le, [
242
- r("div", Ge, [
243
- r("div", {
243
+ c("div", Ge, [
244
+ c("div", {
244
245
  type: e(u),
245
246
  class: P({ "cookie-notice-wrap-grid": t.enableGrid, "cookie-notice-wrap": !t.enableGrid })
246
247
  }, [
247
- r("div", We, [
248
+ c("div", We, [
248
249
  C.value ? (o(), s("p", je, [
249
- V(m(e(c)("cookie.desc")) + " ", 1),
250
- r("a", {
250
+ V(m(e(r)("cookie.desc")) + " ", 1),
251
+ c("a", {
251
252
  href: t.detailUrl,
252
253
  target: "_blank",
253
254
  rel: "noopener noreferrer"
254
- }, m(e(c)("cookie.about")), 9, Fe)
255
+ }, m(e(r)("cookie.about")), 9, Fe)
255
256
  ])) : (o(), s(U, { key: 1 }, [
256
- r("p", Ye, m(e(c)("cookie.title", [t.community])), 1),
257
- r("p", Ze, [
258
- V(m(e(c)("cookie.desc")) + " ", 1),
259
- r("a", {
257
+ c("p", Ye, m(e(r)("cookie.title", [t.community])), 1),
258
+ c("p", Ze, [
259
+ V(m(e(r)("cookie.desc")) + " ", 1),
260
+ c("a", {
260
261
  href: t.detailUrl,
261
262
  target: "_blank",
262
263
  rel: "noopener noreferrer"
263
- }, m(e(c)("cookie.about")), 9, qe),
264
+ }, m(e(r)("cookie.about")), 9, qe),
264
265
  _[4] || (_[4] = V(". ", -1))
265
266
  ])
266
267
  ], 64))
@@ -273,7 +274,7 @@ const De = /* @__PURE__ */ H({
273
274
  onClick: k
274
275
  }, {
275
276
  default: h(() => [
276
- V(m(e(c)("cookie.acceptAll")), 1)
277
+ V(m(e(r)("cookie.acceptAll")), 1)
277
278
  ]),
278
279
  _: 1
279
280
  }),
@@ -284,7 +285,7 @@ const De = /* @__PURE__ */ H({
284
285
  onClick: N
285
286
  }, {
286
287
  default: h(() => [
287
- V(m(e(c)("cookie.rejectAll")), 1)
288
+ V(m(e(r)("cookie.rejectAll")), 1)
288
289
  ]),
289
290
  _: 1
290
291
  }),
@@ -295,7 +296,7 @@ const De = /* @__PURE__ */ H({
295
296
  onClick: _[0] || (_[0] = (M) => E(!0))
296
297
  }, {
297
298
  default: h(() => [
298
- V(m(e(c)("cookie.manage")), 1)
299
+ V(m(e(r)("cookie.manage")), 1)
299
300
  ]),
300
301
  _: 1
301
302
  })
@@ -316,34 +317,34 @@ const De = /* @__PURE__ */ H({
316
317
  visible: A.value,
317
318
  "onUpdate:visible": _[3] || (_[3] = (M) => A.value = M),
318
319
  size: e(y) ? "medium" : "large",
319
- "phone-half-full": e(p),
320
+ "phone-half-full": e(f),
320
321
  class: "cookie-dlg",
321
322
  actions: ie.value,
322
323
  onChange: de
323
324
  }, {
324
325
  header: h(() => [
325
- r("span", Xe, m(e(c)("cookie.manage")), 1)
326
+ c("span", Xe, m(e(r)("cookie.manage")), 1)
326
327
  ]),
327
328
  default: h(() => [
328
- r("div", et, [
329
- r("div", tt, [
330
- r("div", ot, [
331
- r("span", lt, m(e(c)("cookie.necessaryCookie")), 1),
332
- r("span", at, m(e(c)("cookie.alwaysOn")), 1)
329
+ c("div", et, [
330
+ c("div", tt, [
331
+ c("div", ot, [
332
+ c("span", lt, m(e(r)("cookie.necessaryCookie")), 1),
333
+ c("span", at, m(e(r)("cookie.alwaysOn")), 1)
333
334
  ]),
334
- r("div", st, m(e(c)("cookie.necessaryCookieDetail")), 1)
335
+ c("div", st, m(e(r)("cookie.necessaryCookieDetail")), 1)
335
336
  ]),
336
- r("div", nt, [
337
- r("div", rt, [
338
- r("span", ct, m(e(c)("cookie.analyticalCookie")), 1),
339
- r("span", it, [
340
- v(e(re), {
337
+ c("div", nt, [
338
+ c("div", ct, [
339
+ c("span", rt, m(e(r)("cookie.analyticalCookie")), 1),
340
+ c("span", it, [
341
+ v(e(ce), {
341
342
  modelValue: b.value,
342
343
  "onUpdate:modelValue": _[2] || (_[2] = (M) => b.value = M)
343
344
  }, null, 8, ["modelValue"])
344
345
  ])
345
346
  ]),
346
- r("div", dt, m(e(c)("cookie.analyticalCookieDetail")), 1)
347
+ c("div", dt, m(e(r)("cookie.analyticalCookieDetail")), 1)
347
348
  ])
348
349
  ])
349
350
  ]),
@@ -355,7 +356,7 @@ const De = /* @__PURE__ */ H({
355
356
  _: 1
356
357
  }));
357
358
  }
358
- }), ft = /* @__PURE__ */ R(pt, [["__scopeId", "data-v-e46f706e"]]), gt = {
359
+ }), ft = /* @__PURE__ */ R(pt, [["__scopeId", "data-v-712c28fb"]]), gt = {
359
360
  version: "1.1",
360
361
  xmlns: "http://www.w3.org/2000/svg",
361
362
  width: "24",
@@ -364,7 +365,7 @@ const De = /* @__PURE__ */ H({
364
365
  };
365
366
  function yt(t, l) {
366
367
  return o(), s("svg", gt, [...l[0] || (l[0] = [
367
- r("path", {
368
+ c("path", {
368
369
  fill: "currentColor",
369
370
  d: "M18.528 5.472c0.246 0.246 0.271 0.63 0.074 0.903l-0.074 0.087-5.54 5.538 0.006 0.006-0.989 0.989-0.006-0.006-5.538 5.54c-0.273 0.273-0.717 0.273-0.99 0-0.246-0.246-0.271-0.63-0.074-0.903l0.074-0.087 5.538-5.539-5.538-5.538-0.074-0.087c-0.197-0.274-0.172-0.657 0.074-0.903s0.63-0.271 0.903-0.074l0.087 0.074 5.538 5.539 5.539-5.539c0.273-0.273 0.717-0.273 0.99 0zM14.551 13.561l3.978 3.978 0.074 0.087c0.197 0.274 0.172 0.657-0.074 0.903s-0.63 0.271-0.903 0.074l-0.087-0.074-3.978-3.978c-0.273-0.273-0.273-0.717 0-0.99v0c0.273-0.273 0.717-0.273 0.99 0z"
370
371
  }, null, -1)
@@ -379,12 +380,12 @@ const kt = { name: "components-icon-close", render: yt }, _t = {
379
380
  };
380
381
  function wt(t, l) {
381
382
  return o(), s("svg", _t, [...l[0] || (l[0] = [
382
- r("path", {
383
+ c("path", {
383
384
  opacity: "0.8",
384
385
  fill: "currentColor",
385
386
  d: "M13.215 0.524c-7.048 0-12.762 5.714-12.762 12.762s5.714 12.762 12.762 12.762c7.048 0 12.762-5.714 12.762-12.762s-5.714-12.762-12.762-12.762zM13.215 2.809c5.786 0 10.476 4.69 10.476 10.476s-4.69 10.476-10.476 10.476c-5.786 0-10.476-4.69-10.476-10.476s4.69-10.476 10.476-10.476z"
386
387
  }, null, -1),
387
- r("path", {
388
+ c("path", {
388
389
  opacity: "0.8",
389
390
  fill: "currentColor",
390
391
  d: "M23.33 23.22c0.446-0.447 1.169-0.448 1.616-0.002l4.771 4.759c0.447 0.446 0.448 1.169 0.002 1.616s-1.169 0.448-1.616 0.002l-4.771-4.759c-0.447-0.446-0.448-1.169-0.002-1.616z"
@@ -400,7 +401,7 @@ const se = { name: "components-icon-header-search", render: wt }, bt = {
400
401
  };
401
402
  function $t(t, l) {
402
403
  return o(), s("svg", bt, [...l[0] || (l[0] = [
403
- r("path", {
404
+ c("path", {
404
405
  fill: "currentColor",
405
406
  d: "M10.858 22.41c-0.349 0.349-0.915 0.349-1.263 0-0.314-0.314-0.345-0.804-0.094-1.153l0.094-0.111 5.146-5.15-5.177-5.178c-0.274-0.305-0.3-0.755-0.077-1.087l0.111-0.135c0.347-0.347 0.91-0.347 1.257 0l5.142 5.143 5.15-5.146c0.349-0.349 0.915-0.349 1.263 0 0.314 0.314 0.345 0.804 0.094 1.153l-0.094 0.111-11.552 11.552zM17.89 16.634l4.551 4.552c0.313 0.349 0.302 0.886-0.034 1.222-0.347 0.347-0.91 0.347-1.257 0l-4.516-4.518 1.256-1.256z"
406
407
  }, null, -1)
@@ -415,7 +416,7 @@ const Ct = { name: "components-icon-header-delete", render: $t }, It = {
415
416
  };
416
417
  function xt(t, l) {
417
418
  return o(), s("svg", It, [...l[0] || (l[0] = [
418
- r("path", {
419
+ c("path", {
419
420
  fill: "currentColor",
420
421
  d: "M19.154 5.295c0.387 0 0.7 0.313 0.7 0.7 0 0.354-0.263 0.647-0.605 0.694l-0.095 0.006-12.201-0.001 0.001 12.413c0 0.17 0.12 0.311 0.28 0.344l0.071 0.007h9.39c0.17 0 0.311-0.12 0.344-0.28l0.007-0.071v-10.47c0-0.387 0.313-0.7 0.7-0.7 0.354 0 0.647 0.263 0.694 0.605l0.006 0.095v10.47c0 0.919-0.708 1.672-1.608 1.745l-0.144 0.006h-9.39c-0.919 0-1.672-0.708-1.745-1.608l-0.006-0.144-0.001-12.413-0.707 0.001c-0.387 0-0.7-0.313-0.7-0.7 0-0.354 0.263-0.647 0.605-0.694l0.095-0.006h14.308zM10.011 9.744c0.354 0 0.647 0.263 0.694 0.605l0.006 0.095v5.68c0 0.387-0.313 0.7-0.7 0.7-0.354 0-0.647-0.263-0.694-0.605l-0.006-0.095v-5.68c0-0.387 0.313-0.7 0.7-0.7zM13.953 9.744c0.354 0 0.647 0.263 0.694 0.605l0.006 0.095v5.68c0 0.387-0.313 0.7-0.7 0.7-0.354 0-0.647-0.263-0.694-0.605l-0.006-0.095v-5.68c0-0.387 0.313-0.7 0.7-0.7zM13.652 3.189c0.387 0 0.7 0.313 0.7 0.7 0 0.354-0.263 0.647-0.605 0.694l-0.095 0.006h-3.972c-0.387 0-0.7-0.313-0.7-0.7 0-0.354 0.263-0.647 0.605-0.694l0.095-0.006h3.972z"
421
422
  }, null, -1)
@@ -430,7 +431,7 @@ const zt = { name: "components-icon-delete", render: xt }, Ot = {
430
431
  };
431
432
  function St(t, l) {
432
433
  return o(), s("svg", Ot, [...l[0] || (l[0] = [
433
- r("path", {
434
+ c("path", {
434
435
  fill: "currentColor",
435
436
  d: "M5.886 19.111l10.672 10.677c0.46 0.524 0.44 1.322-0.060 1.822s-1.298 0.52-1.822 0.060l-0.064-0.060-12.498-12.498h3.772zM14.613 0.391c0.521-0.521 1.365-0.521 1.886 0 0.5 0.5 0.52 1.298 0.060 1.822l-0.060 0.064-12.391 12.391h29.67c0.71 0 1.291 0.555 1.331 1.255l0.002 0.078c0 0.71-0.555 1.291-1.255 1.331l-0.078 0.002h-31.816c-0.472 0-0.924-0.187-1.257-0.521-0.671-0.671-0.694-1.745-0.067-2.443l0.067-0.071 13.908-13.908z"
436
437
  }, null, -1)
@@ -467,7 +468,7 @@ const Vt = { name: "components-icon-header-back", render: St }, Pt = { class: "o
467
468
  },
468
469
  emits: ["update:modelValue", "update:historyItems", "clear", "search", "delete-history", "delete-history-item"],
469
470
  setup(t, { emit: l }) {
470
- const { lePadV: a } = F(), { t: f } = ce(), d = t, p = l, y = D(d.modelValue), u = D(d.historyItems), c = D(!1), C = D(), n = O(() => !a.value && c.value || a.value && y.value);
471
+ const { lePadV: a } = F(), { t: p } = re(), d = t, f = l, y = D(d.modelValue), u = D(d.historyItems), r = D(!1), C = D(), n = O(() => !a.value && r.value || a.value && y.value);
471
472
  G(
472
473
  () => d.modelValue,
473
474
  (i) => {
@@ -476,7 +477,7 @@ const Vt = { name: "components-icon-header-back", render: St }, Pt = { class: "o
476
477
  ), G(
477
478
  () => y.value,
478
479
  (i) => {
479
- p("update:modelValue", i);
480
+ f("update:modelValue", i);
480
481
  }
481
482
  ), G(
482
483
  () => d.historyItems,
@@ -486,7 +487,7 @@ const Vt = { name: "components-icon-header-back", render: St }, Pt = { class: "o
486
487
  ), G(
487
488
  () => u.value,
488
489
  (i) => {
489
- p("update:historyItems", i);
490
+ f("update:historyItems", i);
490
491
  }
491
492
  ), ne(() => {
492
493
  if (d.storeHistory && d.storageKey)
@@ -497,24 +498,24 @@ const Vt = { name: "components-icon-header-back", render: St }, Pt = { class: "o
497
498
  }
498
499
  });
499
500
  const b = () => {
500
- c.value = !0;
501
+ r.value = !0;
501
502
  }, x = () => {
502
503
  const i = y.value.trim();
503
- i && (c.value = !1, u.value.unshift(i), u.value = Array.from(new Set(u.value)), u.value.length > d.maxHistoryCount && u.value.pop(), d.storeHistory && d.storeHistory && localStorage.setItem(d.storageKey, JSON.stringify(u.value)), p("search", i), d.searchUrl && window.open(d.searchUrl + i, d.searchUrlOpenBlank ? "_blank" : "_self", "noopener noreferrer"));
504
+ i && (r.value = !1, u.value.unshift(i), u.value = Array.from(new Set(u.value)), u.value.length > d.maxHistoryCount && u.value.pop(), d.storeHistory && d.storeHistory && localStorage.setItem(d.storageKey, JSON.stringify(u.value)), f("search", i), d.searchUrl && window.open(d.searchUrl + i, d.searchUrlOpenBlank ? "_blank" : "_self", "noopener noreferrer"));
504
505
  }, B = () => {
505
- y.value = "", p("clear"), a.value || (c.value = !1);
506
+ y.value = "", f("clear"), a.value || (r.value = !1);
506
507
  }, L = () => {
507
508
  const i = [...u.value];
508
- u.value = [], d.storeHistory && d.storeHistory && localStorage.removeItem(d.storageKey), p("delete-history", i);
509
+ u.value = [], d.storeHistory && d.storeHistory && localStorage.removeItem(d.storageKey), f("delete-history", i);
509
510
  }, J = (i) => {
510
- u.value = u.value.filter((T) => T !== i), d.storeHistory && d.storeHistory && (u.value.length ? localStorage.setItem(d.storageKey, JSON.stringify(u.value)) : localStorage.removeItem(d.storageKey)), p("delete-history-item", i);
511
+ u.value = u.value.filter((T) => T !== i), d.storeHistory && d.storeHistory && (u.value.length ? localStorage.setItem(d.storageKey, JSON.stringify(u.value)) : localStorage.removeItem(d.storageKey)), f("delete-history-item", i);
511
512
  }, S = (i) => {
512
513
  y.value = i, x();
513
514
  }, A = () => {
514
- y.value = "", c.value = !1;
515
+ y.value = "", r.value = !1;
515
516
  }, E = D();
516
517
  return Be(E, B), (i, T) => (o(), s("div", Pt, [
517
- r("div", {
518
+ c("div", {
518
519
  ref_key: "posWrapper",
519
520
  ref: E,
520
521
  class: P({
@@ -522,13 +523,13 @@ const Vt = { name: "components-icon-header-back", render: St }, Pt = { class: "o
522
523
  "o-header-search-input-pc-wrapper-left": !e(a) && t.expandDirection === "left",
523
524
  "o-header-search-input-pc-wrapper-right": !e(a) && t.expandDirection === "right",
524
525
  "o-header-search-input-mobile-wrapper": e(a),
525
- focus: c.value
526
+ focus: r.value
526
527
  })
527
528
  }, [
528
- r("div", {
529
- class: P(["o-header-search-input-wrapper", { focus: c.value }])
529
+ c("div", {
530
+ class: P(["o-header-search-input-wrapper", { focus: r.value }])
530
531
  }, [
531
- e(a) && c.value ? (o(), I(e(z), {
532
+ e(a) && r.value ? (o(), I(e(z), {
532
533
  key: 0,
533
534
  class: "o-header-search-icon",
534
535
  onClick: A
@@ -544,7 +545,7 @@ const Vt = { name: "components-icon-header-back", render: St }, Pt = { class: "o
544
545
  modelValue: y.value,
545
546
  "onUpdate:modelValue": T[0] || (T[0] = (k) => y.value = k),
546
547
  class: "o-header-search-input",
547
- placeholder: c.value ? t.expandedPlaceholder ?? e(f)("search.expandedPlaceholder") : t.placeholder ?? e(f)("search.placeholder"),
548
+ placeholder: r.value ? t.expandedPlaceholder ?? e(p)("search.expandedPlaceholder") : t.placeholder ?? e(p)("search.placeholder"),
548
549
  onFocus: b,
549
550
  onKeyup: fe(x, ["enter"])
550
551
  }, {
@@ -574,13 +575,13 @@ const Vt = { name: "components-icon-header-back", render: St }, Pt = { class: "o
574
575
  ]),
575
576
  _: 3
576
577
  }, 8, ["modelValue", "placeholder"]),
577
- e(a) && c.value ? (o(), s("span", {
578
+ e(a) && r.value ? (o(), s("span", {
578
579
  key: 1,
579
580
  class: "o-header-search-text",
580
581
  onClick: x
581
- }, m(t.searchTextMobile ?? e(f)("search")), 1)) : g("", !0)
582
+ }, m(t.searchTextMobile ?? e(p)("search")), 1)) : g("", !0)
582
583
  ], 2),
583
- pe(r("div", Mt, [
584
+ pe(c("div", Mt, [
584
585
  w(i.$slots, "drawer", {
585
586
  recommendItems: t.recommendItems,
586
587
  historyItems: u.value,
@@ -597,8 +598,8 @@ const Vt = { name: "components-icon-header-back", render: St }, Pt = { class: "o
597
598
  ], !0)
598
599
  ])) : u.value.length ? (o(), s("div", At, [
599
600
  w(i.$slots, "history-header", { history: u.value }, () => [
600
- r("div", Tt, [
601
- r("span", Ut, m(t.historyTitle ?? e(f)("search.history")), 1),
601
+ c("div", Tt, [
602
+ c("span", Ut, m(t.historyTitle ?? e(p)("search.history")), 1),
602
603
  v(e(z), {
603
604
  class: "o-header-search-icon",
604
605
  onClick: L
@@ -611,13 +612,13 @@ const Vt = { name: "components-icon-header-back", render: St }, Pt = { class: "o
611
612
  ])
612
613
  ], !0),
613
614
  w(i.$slots, "history-content", { history: u.value }, () => [
614
- r("div", Ht, [
615
+ c("div", Ht, [
615
616
  (o(!0), s(U, null, K(u.value, (k) => (o(), s("div", {
616
617
  key: k,
617
618
  class: "o-header-search-history-item",
618
619
  onClick: (N) => S(k)
619
620
  }, [
620
- r("span", Nt, m(k), 1),
621
+ c("span", Nt, m(k), 1),
621
622
  v(e(z), {
622
623
  class: "o-header-search-history-item-icon",
623
624
  onClick: ge((N) => J(k), ["stop"])
@@ -637,10 +638,10 @@ const Vt = { name: "components-icon-header-back", render: St }, Pt = { class: "o
637
638
  })) : g("", !0),
638
639
  t.hotItems.length ? (o(), s("div", Kt, [
639
640
  w(i.$slots, "hot-header", { hot: t.hotItems }, () => [
640
- r("div", Rt, m(t.hotTitle ?? e(f)("search.hot")), 1)
641
+ c("div", Rt, m(t.hotTitle ?? e(p)("search.hot")), 1)
641
642
  ], !0),
642
643
  w(i.$slots, "hot-content", { hot: t.hotItems }, () => [
643
- r("div", Lt, [
644
+ c("div", Lt, [
644
645
  (o(!0), s(U, null, K(t.hotItems, (k) => (o(), s("div", {
645
646
  key: k,
646
647
  class: "o-header-search-hot-item",
@@ -651,7 +652,7 @@ const Vt = { name: "components-icon-header-back", render: St }, Pt = { class: "o
651
652
  ])) : g("", !0)
652
653
  ], !0)
653
654
  ], 512), [
654
- [ye, c.value]
655
+ [ye, r.value]
655
656
  ])
656
657
  ], 2),
657
658
  e(a) ? (o(), I(e(z), {
@@ -723,11 +724,11 @@ const Vt = { name: "components-icon-header-back", render: St }, Pt = { class: "o
723
724
  locale: O(() => l.locale),
724
725
  theme: O(() => l.theme)
725
726
  });
726
- return _e(Pe, a), (f, d) => (o(), I(e(xe), {
727
+ return _e(Pe, a), (p, d) => (o(), I(e(xe), {
727
728
  locale: t.locale === "zh" ? e(jt) : e(Ft)
728
729
  }, {
729
730
  default: h(() => [
730
- w(f.$slots, "default")
731
+ w(p.$slots, "default")
731
732
  ]),
732
733
  _: 3
733
734
  }, 8, ["locale"]));
@@ -741,7 +742,7 @@ const Vt = { name: "components-icon-header-back", render: St }, Pt = { class: "o
741
742
  };
742
743
  function qt(t, l) {
743
744
  return o(), s("svg", Zt, [...l[0] || (l[0] = [
744
- r("path", { d: "M9.246 5.764c-0.251 0.251-0.271 0.644-0.063 0.918l0.063 0.072 5.016 5.016c0.1 0.1 0.115 0.254 0.043 0.37l-0.043 0.054-5.062 5.062c-0.273 0.273-0.273 0.717 0 0.99 0.251 0.251 0.644 0.271 0.918 0.063l0.072-0.063 5.062-5.062c0.629-0.629 0.662-1.628 0.099-2.296l-0.099-0.108-5.016-5.016c-0.273-0.273-0.717-0.273-0.99 0z" }, null, -1)
745
+ c("path", { d: "M9.246 5.764c-0.251 0.251-0.271 0.644-0.063 0.918l0.063 0.072 5.016 5.016c0.1 0.1 0.115 0.254 0.043 0.37l-0.043 0.054-5.062 5.062c-0.273 0.273-0.273 0.717 0 0.99 0.251 0.251 0.644 0.271 0.918 0.063l0.072-0.063 5.062-5.062c0.629-0.629 0.662-1.628 0.099-2.296l-0.099-0.108-5.016-5.016c-0.273-0.273-0.717-0.273-0.99 0z" }, null, -1)
745
746
  ])]);
746
747
  }
747
748
  const Qt = { name: "components-icon-chevron-right", render: qt }, Xt = { class: "section-wrapper" }, e0 = {
@@ -768,10 +769,10 @@ const Qt = { name: "components-icon-chevron-right", render: qt }, Xt = { class:
768
769
  },
769
770
  setup(t) {
770
771
  const l = t;
771
- return (a, f) => (o(), s("div", {
772
+ return (a, p) => (o(), s("div", {
772
773
  class: P(["app-section", { "is-full": l.full }])
773
774
  }, [
774
- r("div", Xt, [
775
+ c("div", Xt, [
775
776
  w(a.$slots, "main", {}, () => [
776
777
  a.$slots.header || l.title || l.subtitle ? (o(), s("div", {
777
778
  key: 0,
@@ -828,16 +829,16 @@ const Qt = { name: "components-icon-chevron-right", render: qt }, Xt = { class:
828
829
  height: "24",
829
830
  viewBox: "0 0 24 24"
830
831
  };
831
- function r0(t, l) {
832
+ function c0(t, l) {
832
833
  return o(), s("svg", n0, [...l[0] || (l[0] = [
833
- r("path", {
834
+ c("path", {
834
835
  opacity: "0.8",
835
836
  fill: "currentColor",
836
837
  d: "M12 1.992c0.387 0 0.7 0.313 0.7 0.7v1.2c0 0.387-0.313 0.7-0.7 0.7s-0.7-0.313-0.7-0.7v-1.2c0-0.387 0.313-0.7 0.7-0.7zM6.769 6.747c-0.273 0.273-0.717 0.273-0.99 0l-0.849-0.849c-0.137-0.137-0.205-0.316-0.205-0.495s0.068-0.358 0.205-0.495c0.273-0.273 0.717-0.273 0.99 0l0.849 0.849c0.136 0.137 0.205 0.316 0.205 0.495s-0.068 0.358-0.205 0.495zM18.192 6.747c-0.273 0.273-0.717 0.273-0.99 0-0.137-0.137-0.205-0.316-0.205-0.495s0.068-0.358 0.205-0.495l0.849-0.849c0.273-0.273 0.717-0.273 0.99 0 0.137 0.137 0.205 0.316 0.205 0.495s-0.068 0.358-0.205 0.495l-0.849 0.849zM5.3 12c0-3.7 3-6.7 6.7-6.7s6.7 3 6.7 6.7-3 6.7-6.7 6.7c-3.7 0-6.7-3-6.7-6.7zM17.3 12c0-2.927-2.373-5.3-5.3-5.3s-5.3 2.373-5.3 5.3c0 2.927 2.373 5.3 5.3 5.3s5.3-2.373 5.3-5.3zM4.594 11.969c0 0.387-0.313 0.7-0.7 0.7h-1.2c-0.387 0-0.7-0.313-0.7-0.7s0.313-0.7 0.7-0.7h1.2c0.386 0 0.7 0.313 0.7 0.7zM21.977 11.999c0 0.387-0.314 0.7-0.7 0.7h-1.2c-0.387 0-0.7-0.313-0.7-0.7s0.313-0.7 0.7-0.7h1.2c0.387 0 0.7 0.313 0.7 0.7zM5.921 19.060c-0.273 0.273-0.717 0.273-0.99 0-0.137-0.137-0.205-0.316-0.205-0.495s0.068-0.358 0.205-0.495l0.849-0.849c0.273-0.273 0.717-0.273 0.99 0 0.137 0.137 0.205 0.316 0.205 0.495s-0.068 0.358-0.205 0.495l-0.849 0.849zM19.041 19.060c-0.273 0.273-0.717 0.273-0.99 0l-0.849-0.849c-0.137-0.137-0.205-0.316-0.205-0.495s0.068-0.358 0.205-0.495c0.273-0.273 0.717-0.273 0.99 0l0.849 0.849c0.137 0.137 0.205 0.316 0.205 0.495s-0.068 0.358-0.205 0.495zM11.971 19.376c0.387 0 0.7 0.313 0.7 0.7v1.2c0 0.387-0.313 0.7-0.7 0.7s-0.7-0.313-0.7-0.7v-1.2c0-0.387 0.313-0.7 0.7-0.7z"
837
838
  }, null, -1)
838
839
  ])]);
839
840
  }
840
- const Y = { name: "components-icon-sun", render: r0 }, c0 = {
841
+ const Y = { name: "components-icon-sun", render: c0 }, r0 = {
841
842
  version: "1.1",
842
843
  xmlns: "http://www.w3.org/2000/svg",
843
844
  width: "24",
@@ -845,8 +846,8 @@ const Y = { name: "components-icon-sun", render: r0 }, c0 = {
845
846
  viewBox: "0 0 24 24"
846
847
  };
847
848
  function i0(t, l) {
848
- return o(), s("svg", c0, [...l[0] || (l[0] = [
849
- r("path", {
849
+ return o(), s("svg", r0, [...l[0] || (l[0] = [
850
+ c("path", {
850
851
  opacity: "0.8",
851
852
  fill: "currentColor",
852
853
  d: "M12 2.3c5.357 0 9.7 4.343 9.7 9.7s-4.343 9.7-9.7 9.7c-4.651 0-8.622-3.298-9.515-7.806-0.101-0.509 0.369-0.948 0.87-0.812 0.531 0.144 1.082 0.218 1.645 0.218 3.479 0 6.3-2.82 6.3-6.3 0-1.276-0.379-2.494-1.079-3.527-0.291-0.43-0.029-1.016 0.486-1.086 0.425-0.057 0.857-0.086 1.293-0.086zM12 3.7l-0.042 0.001 0.058 0.121c0.402 0.887 0.634 1.85 0.677 2.845l0.007 0.333c0 4.253-3.447 7.7-7.7 7.7-0.229 0-0.457-0.010-0.682-0.030l-0.186-0.021 0.076 0.218c1.147 3.123 4.102 5.321 7.528 5.429l0.264 0.004c4.584 0 8.3-3.716 8.3-8.3s-3.716-8.3-8.3-8.3z"
@@ -868,17 +869,17 @@ const Z = { name: "components-icon-moon", render: i0 }, d0 = { class: "o-theme-s
868
869
  },
869
870
  emits: ["update:theme", "change"],
870
871
  setup(t, { emit: l }) {
871
- const a = t, f = l, { gtPhone: d } = F(), p = O({
872
+ const a = t, p = l, { gtPhone: d } = F(), f = O({
872
873
  get() {
873
874
  return a.theme;
874
875
  },
875
- set(c) {
876
- f("update:theme", c), f("change", c);
876
+ set(r) {
877
+ p("update:theme", r), p("change", r);
877
878
  }
878
879
  }), y = O(() => a.type === "common" || a.type === "auto" && d.value), u = () => {
879
- p.value = p.value === a.lightValue ? a.darkValue : a.lightValue;
880
+ f.value = f.value === a.lightValue ? a.darkValue : a.lightValue;
880
881
  };
881
- return (c, C) => (o(), s("div", d0, [
882
+ return (r, C) => (o(), s("div", d0, [
882
883
  y.value ? (o(), s("div", {
883
884
  key: 0,
884
885
  class: "o-theme-switcher-common",
@@ -886,14 +887,14 @@ const Z = { name: "components-icon-moon", render: i0 }, d0 = { class: "o-theme-s
886
887
  }, [
887
888
  v(e(z), { class: "o-theme-icon" }, {
888
889
  default: h(() => [
889
- p.value === t.lightValue ? (o(), I(e(Z), { key: 0 })) : (o(), I(e(Y), { key: 1 }))
890
+ f.value === t.lightValue ? (o(), I(e(Z), { key: 0 })) : (o(), I(e(Y), { key: 1 }))
890
891
  ]),
891
892
  _: 1
892
893
  })
893
894
  ])) : (o(), s("div", u0, [
894
- v(e(re), {
895
- modelValue: p.value,
896
- "onUpdate:modelValue": C[0] || (C[0] = (n) => p.value = n),
895
+ v(e(ce), {
896
+ modelValue: f.value,
897
+ "onUpdate:modelValue": C[0] || (C[0] = (n) => f.value = n),
897
898
  class: "o-theme-switch",
898
899
  "checked-value": t.darkValue,
899
900
  "unchecked-value": t.lightValue
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opendesign-plus/components",
3
- "version": "0.0.1-rc.5",
3
+ "version": "0.0.1-rc.6",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -10,7 +10,6 @@ const NOT_SIGNED = '0';
10
10
  const ALL_AGREED = '1';
11
11
  const NECCESSARY_AGREED = '2';
12
12
  const NOT_SHOW_BUT_AGREED = '3';
13
- const COOKIE_DOMAIN = import.meta.env.VITE_COOKIE_DOMAIN as string;
14
13
  const COOKIE_KEY_ZH = 'agreed-cookiepolicy-zh';
15
14
  const COOKIE_KEY_EN = 'agreed-cookiepolicy-en';
16
15
 
@@ -20,6 +19,7 @@ const props = defineProps<{
20
19
  community: string;
21
20
  detailUrl: string;
22
21
  wrapper?: string | HTMLElement;
22
+ cookieDomain: string;
23
23
  }>();
24
24
 
25
25
  const emit = defineEmits<{
@@ -62,7 +62,7 @@ const toggleNoticeVisible = (val?: boolean) => {
62
62
  }
63
63
  nextTick(() => {
64
64
  if (!visibleVmodel.value && isZh.value && getCookie(cookieKey.value) !== NOT_SHOW_BUT_AGREED) {
65
- setCookie(cookieKey.value, NOT_SHOW_BUT_AGREED, 180, COOKIE_DOMAIN ?? location.hostname);
65
+ setCookie(cookieKey.value, NOT_SHOW_BUT_AGREED, 180, props.cookieDomain ?? location.hostname);
66
66
  }
67
67
  });
68
68
  };
@@ -109,16 +109,16 @@ watch(locale, () => {
109
109
  // 用户同意所有cookie
110
110
  const acceptAll = () => {
111
111
  analysisAllowed.value = true;
112
- removeCookie(cookieKey.value, COOKIE_DOMAIN ?? location.hostname);
113
- setCookie(cookieKey.value, ALL_AGREED, 180, COOKIE_DOMAIN ?? location.hostname);
112
+ removeCookie(cookieKey.value, props.cookieDomain ?? location.hostname);
113
+ setCookie(cookieKey.value, ALL_AGREED, 180, props.cookieDomain ?? location.hostname);
114
114
  toggleNoticeVisible(false);
115
115
  };
116
116
 
117
117
  // 用户拒绝所有cookie,即仅同意必要cookie
118
118
  const rejectAll = () => {
119
119
  analysisAllowed.value = false;
120
- removeCookie(cookieKey.value, COOKIE_DOMAIN ?? location.hostname);
121
- setCookie(cookieKey.value, NECCESSARY_AGREED, 180, COOKIE_DOMAIN ?? location.hostname);
120
+ removeCookie(cookieKey.value, props.cookieDomain ?? location.hostname);
121
+ setCookie(cookieKey.value, NECCESSARY_AGREED, 180, props.cookieDomain ?? location.hostname);
122
122
  toggleNoticeVisible(false);
123
123
  };
124
124