@polyv/product-ui 1.0.0-rc-20250612.3

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.
Files changed (76) hide show
  1. package/address-edit.cjs.js +8 -0
  2. package/address-edit.es.d.ts +3 -0
  3. package/address-edit.es.js +5908 -0
  4. package/address-edit.umd.js +8 -0
  5. package/address-item.cjs.js +8 -0
  6. package/address-item.es.d.ts +3 -0
  7. package/address-item.es.js +425 -0
  8. package/address-item.umd.js +8 -0
  9. package/address-list.cjs.js +9 -0
  10. package/address-list.es.d.ts +3 -0
  11. package/address-list.es.js +1908 -0
  12. package/address-list.umd.js +9 -0
  13. package/index.cjs.js +8 -0
  14. package/index.es.js +15347 -0
  15. package/index.umd.js +8 -0
  16. package/mobile-product-pendant.cjs.js +8 -0
  17. package/mobile-product-pendant.es.d.ts +3 -0
  18. package/mobile-product-pendant.es.js +813 -0
  19. package/mobile-product-pendant.umd.js +8 -0
  20. package/order-confirm.cjs.js +9 -0
  21. package/order-confirm.es.d.ts +3 -0
  22. package/order-confirm.es.js +5254 -0
  23. package/order-confirm.umd.js +9 -0
  24. package/order-detail.cjs.js +8 -0
  25. package/order-detail.es.d.ts +3 -0
  26. package/order-detail.es.js +2474 -0
  27. package/order-detail.umd.js +8 -0
  28. package/order-item.cjs.js +8 -0
  29. package/order-item.es.d.ts +3 -0
  30. package/order-item.es.js +1448 -0
  31. package/order-item.umd.js +8 -0
  32. package/order-list-popup.cjs.js +9 -0
  33. package/order-list-popup.es.d.ts +3 -0
  34. package/order-list-popup.es.js +4114 -0
  35. package/order-list-popup.umd.js +9 -0
  36. package/order-list.cjs.js +8 -0
  37. package/order-list.es.d.ts +3 -0
  38. package/order-list.es.js +2572 -0
  39. package/order-list.umd.js +9 -0
  40. package/order-popup.cjs.js +9 -0
  41. package/order-popup.es.d.ts +3 -0
  42. package/order-popup.es.js +8050 -0
  43. package/order-popup.umd.js +9 -0
  44. package/package.json +28 -0
  45. package/pc-product-pendant.cjs.js +9 -0
  46. package/pc-product-pendant.es.d.ts +3 -0
  47. package/pc-product-pendant.es.js +1604 -0
  48. package/pc-product-pendant.umd.js +9 -0
  49. package/product-button.cjs.js +9 -0
  50. package/product-button.es.d.ts +3 -0
  51. package/product-button.es.js +1882 -0
  52. package/product-button.umd.js +9 -0
  53. package/product-detail-popup.cjs.js +9 -0
  54. package/product-detail-popup.es.d.ts +3 -0
  55. package/product-detail-popup.es.js +8250 -0
  56. package/product-detail-popup.umd.js +9 -0
  57. package/product-detail.cjs.js +9 -0
  58. package/product-detail.es.d.ts +3 -0
  59. package/product-detail.es.js +8082 -0
  60. package/product-detail.umd.js +9 -0
  61. package/product-iframe-link-popup.cjs.js +9 -0
  62. package/product-iframe-link-popup.es.d.ts +3 -0
  63. package/product-iframe-link-popup.es.js +2209 -0
  64. package/product-iframe-link-popup.umd.js +9 -0
  65. package/product-item.cjs.js +8 -0
  66. package/product-item.es.d.ts +3 -0
  67. package/product-item.es.js +3700 -0
  68. package/product-item.umd.js +9 -0
  69. package/product-list-popup.cjs.js +9 -0
  70. package/product-list-popup.es.d.ts +3 -0
  71. package/product-list-popup.es.js +5302 -0
  72. package/product-list-popup.umd.js +9 -0
  73. package/product-list.cjs.js +9 -0
  74. package/product-list.es.d.ts +3 -0
  75. package/product-list.es.js +5189 -0
  76. package/product-list.umd.js +9 -0
@@ -0,0 +1,813 @@
1
+ !function(){"use strict";try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode("@font-face{font-family:D-DIN-PRO-Regular;src:url(https://s4.videocc.net/font/D-DIN-PRO-400-Regular.otf)}@font-face{font-family:D-DIN-PRO-Medium;src:url(https://s4.videocc.net/font/D-DIN-PRO-500-Medium.otf)}@font-face{font-family:D-DIN-PRO-Bold;src:url(https://s4.videocc.net/font/D-DIN-PRO-700-Bold.otf)}.plv-product-common-pendant{position:relative;width:36px;height:36px;overflow:hidden;border-radius:4px;background-color:#0000000f;cursor:pointer}.plv-product-common-pendant+.plv-product-common-pendant{margin-top:8px}.plv-product-common-pendant__icon{width:100%;height:100%;background-repeat:no-repeat;background-size:100% 100%}.plv-product-common-pendant__text{position:absolute;bottom:7px;left:50%;display:flex;justify-content:center;align-items:center;box-sizing:border-box;min-width:32px;height:12px;padding:0 2px;border-radius:6px;color:#fff;text-align:center;white-space:nowrap;transform:translate(-50%)}.plv-product-common-pendant__text span{font-size:12px}@font-face{font-family:D-DIN-PRO-Regular;src:url(https://s4.videocc.net/font/D-DIN-PRO-400-Regular.otf)}@font-face{font-family:D-DIN-PRO-Medium;src:url(https://s4.videocc.net/font/D-DIN-PRO-500-Medium.otf)}@font-face{font-family:D-DIN-PRO-Bold;src:url(https://s4.videocc.net/font/D-DIN-PRO-700-Bold.otf)}.plv-font-din-pro-regular{font-family:D-DIN-PRO-Regular,sans-serif}.plv-font-din-pro-medium{font-family:D-DIN-PRO-Medium,sans-serif}.plv-font-din-pro-bold{font-family:D-DIN-PRO-Bold,sans-serif}.plv-product-pendant .plv-product-common-pendant__text{font-family:DINPro-Regular,sans-serif}")),document.head.appendChild(t)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}}();
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
6
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
+ var __spreadValues = (a2, b2) => {
8
+ for (var prop in b2 || (b2 = {}))
9
+ if (__hasOwnProp.call(b2, prop))
10
+ __defNormalProp(a2, prop, b2[prop]);
11
+ if (__getOwnPropSymbols)
12
+ for (var prop of __getOwnPropSymbols(b2)) {
13
+ if (__propIsEnum.call(b2, prop))
14
+ __defNormalProp(a2, prop, b2[prop]);
15
+ }
16
+ return a2;
17
+ };
18
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
19
+ var __async = (__this, __arguments, generator) => {
20
+ return new Promise((resolve, reject) => {
21
+ var fulfilled = (value) => {
22
+ try {
23
+ step(generator.next(value));
24
+ } catch (e) {
25
+ reject(e);
26
+ }
27
+ };
28
+ var rejected = (value) => {
29
+ try {
30
+ step(generator.throw(value));
31
+ } catch (e) {
32
+ reject(e);
33
+ }
34
+ };
35
+ var step = (x2) => x2.done ? resolve(x2.value) : Promise.resolve(x2.value).then(fulfilled, rejected);
36
+ step((generator = generator.apply(__this, __arguments)).next());
37
+ });
38
+ };
39
+ import { ref, computed, onUnmounted, unref, isRef, defineComponent, watch, inject, onMounted } from "vue";
40
+ const pendantIcon = "data:image/png;base64,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";
41
+ const computes = [{ divisor: 86400, unit: "days" }, { divisor: 3600, unit: "hours" }, { divisor: 60, unit: "minutes" }, { divisor: 1, unit: "seconds" }];
42
+ class Countdown {
43
+ constructor(s2, t2) {
44
+ if (s2 |= 0, isNaN(s2)) throw new Error("Total seconds must be a number");
45
+ this._totalMSecs = 1e3 * s2, this._cb = t2;
46
+ }
47
+ _exec() {
48
+ if (!this._startTime || null == this._usingMSecs) return;
49
+ let s2 = Math.max(0, this._usingMSecs - (Date.now() - this._startTime));
50
+ if (s2 > 0 && setTimeout(() => {
51
+ this._exec();
52
+ }, 1e3), this._remainingMSecs = s2, s2 >= 0) {
53
+ const t2 = { days: 0, hours: 0, minutes: 0, seconds: 0, totalMsecs: s2 };
54
+ s2 = Math.round(s2 / 1e3), computes.forEach((i2, e) => {
55
+ t2[i2.unit] = s2 / i2.divisor, e === computes.length - 1 ? t2[i2.unit] = Math.round(t2[i2.unit]) : (t2[i2.unit] = Math.floor(t2[i2.unit]), s2 %= i2.divisor);
56
+ }), this._cb(t2);
57
+ }
58
+ }
59
+ start() {
60
+ null == this._usingMSecs && (this._usingMSecs = this._totalMSecs), this._usingMSecs <= 0 || (this._startTime = Date.now(), this._exec());
61
+ }
62
+ _break() {
63
+ this._timerId && clearTimeout(this._timerId), this._startTime = void 0;
64
+ }
65
+ stop() {
66
+ this._break(), this._usingMSecs = this._totalMSecs;
67
+ }
68
+ pause() {
69
+ this._break(), this._usingMSecs = this._remainingMSecs;
70
+ }
71
+ }
72
+ const useSecondCountDown = (options = {}) => {
73
+ var _a, _b;
74
+ let second = (_a = options.second) != null ? _a : ref();
75
+ let endTimestamp = (_b = options.endTimestamp) != null ? _b : ref();
76
+ let onCountDownChange = options.onCountDownChange;
77
+ let onCountDownFinish = options.onCountDownFinish;
78
+ function __updateSecond(paramSecond) {
79
+ if (isRef(second)) {
80
+ second.value = isRef(paramSecond) ? paramSecond.value : paramSecond;
81
+ } else {
82
+ second = paramSecond || second;
83
+ }
84
+ }
85
+ function __updateEndTimestamp(paramEndTimestamp) {
86
+ if (isRef(endTimestamp)) {
87
+ endTimestamp.value = isRef(paramEndTimestamp) ? paramEndTimestamp.value : paramEndTimestamp;
88
+ } else {
89
+ endTimestamp = paramEndTimestamp || endTimestamp;
90
+ }
91
+ }
92
+ function updateOptions(options2 = {}) {
93
+ if (options2.second) {
94
+ __updateSecond(options2.second);
95
+ }
96
+ if (options2.endTimestamp) {
97
+ __updateEndTimestamp(options2.endTimestamp);
98
+ }
99
+ if (options2.onCountDownChange) {
100
+ onCountDownChange = options2.onCountDownChange;
101
+ }
102
+ if (options2.onCountDownFinish) {
103
+ onCountDownFinish = options2.onCountDownFinish;
104
+ }
105
+ }
106
+ const defaultSurplusData = {
107
+ // 天数
108
+ days: 0,
109
+ // 小时数
110
+ hours: 0,
111
+ // 分钟数
112
+ minutes: 0,
113
+ // 秒数
114
+ seconds: 0,
115
+ // 剩余总毫秒数
116
+ totalMsecs: 0
117
+ };
118
+ const surplusTime = ref(__spreadValues({}, defaultSurplusData));
119
+ const surplusSecond = computed(() => {
120
+ const val = surplusTime.value.totalMsecs / 1e3;
121
+ return parseInt(val.toString());
122
+ });
123
+ const computedSecond = () => {
124
+ const secondVal = unref(second);
125
+ const endTimestampVal = unref(endTimestamp);
126
+ if (typeof secondVal === "number") {
127
+ return secondVal;
128
+ } else if (typeof endTimestampVal === "number") {
129
+ const diffTime = (endTimestampVal - Date.now()) / 1e3;
130
+ return diffTime < 0 ? 0 : diffTime;
131
+ }
132
+ return 0;
133
+ };
134
+ function resetSurplus() {
135
+ surplusTime.value = __spreadValues({}, defaultSurplusData);
136
+ }
137
+ let countDownInstance;
138
+ function initCountDown() {
139
+ surplusTime.value = __spreadValues({}, defaultSurplusData);
140
+ destroyCountDown();
141
+ countDownInstance = new Countdown(computedSecond(), onCountDownCallback);
142
+ startCountDown();
143
+ }
144
+ function destroyCountDown() {
145
+ stopCountDown();
146
+ countDownInstance = void 0;
147
+ }
148
+ function startCountDown(options2, init = false) {
149
+ if (options2) {
150
+ updateOptions(options2);
151
+ }
152
+ if (init) {
153
+ initCountDown();
154
+ return;
155
+ }
156
+ if (countDownInstance) {
157
+ countDownInstance.start();
158
+ } else {
159
+ initCountDown();
160
+ }
161
+ }
162
+ function stopCountDown() {
163
+ if (countDownInstance) {
164
+ countDownInstance.stop();
165
+ }
166
+ }
167
+ function onCountDownCallback(rest) {
168
+ surplusTime.value = rest;
169
+ if (onCountDownChange) {
170
+ onCountDownChange(unref(surplusTime));
171
+ }
172
+ if (rest.totalMsecs === 0 && onCountDownFinish) {
173
+ onCountDownFinish();
174
+ }
175
+ }
176
+ onUnmounted(() => {
177
+ destroyCountDown();
178
+ });
179
+ return {
180
+ surplusTime,
181
+ surplusSecond,
182
+ computedSecond,
183
+ initCountDown,
184
+ startCountDown,
185
+ resetSurplus,
186
+ stopCountDown,
187
+ destroyCountDown
188
+ };
189
+ };
190
+ /*!
191
+ * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
192
+ *
193
+ * Copyright (c) 2014-2017, Jon Schlinkert.
194
+ * Released under the MIT License.
195
+ */
196
+ function isObject(o2) {
197
+ return Object.prototype.toString.call(o2) === "[object Object]";
198
+ }
199
+ function isPlainObject(o2) {
200
+ var ctor, prot;
201
+ if (isObject(o2) === false) return false;
202
+ ctor = o2.constructor;
203
+ if (ctor === void 0) return true;
204
+ prot = ctor.prototype;
205
+ if (isObject(prot) === false) return false;
206
+ if (prot.hasOwnProperty("isPrototypeOf") === false) {
207
+ return false;
208
+ }
209
+ return true;
210
+ }
211
+ var define_process_env_default = {};
212
+ function t() {
213
+ return t = Object.assign ? Object.assign.bind() : function(e2) {
214
+ for (var t2 = 1; t2 < arguments.length; t2++) {
215
+ var n2 = arguments[t2];
216
+ for (var r2 in n2) Object.prototype.hasOwnProperty.call(n2, r2) && (e2[r2] = n2[r2]);
217
+ }
218
+ return e2;
219
+ }, t.apply(this, arguments);
220
+ }
221
+ function n(e2, t2) {
222
+ if (null == e2) return {};
223
+ var n2 = {};
224
+ for (var r2 in e2) if (Object.prototype.hasOwnProperty.call(e2, r2)) {
225
+ if (t2.indexOf(r2) >= 0) continue;
226
+ n2[r2] = e2[r2];
227
+ }
228
+ return n2;
229
+ }
230
+ const r = { silent: false, logLevel: "warn" }, i = ["validator"], o = Object.prototype, a = o.toString, s = o.hasOwnProperty, u = /^\s*function (\w+)/;
231
+ function l(e2) {
232
+ var t2;
233
+ const n2 = null !== (t2 = null == e2 ? void 0 : e2.type) && void 0 !== t2 ? t2 : e2;
234
+ if (n2) {
235
+ const e3 = n2.toString().match(u);
236
+ return e3 ? e3[1] : "";
237
+ }
238
+ return "";
239
+ }
240
+ const c = isPlainObject;
241
+ function f() {
242
+ }
243
+ let d = f;
244
+ if ("production" !== define_process_env_default.NODE_ENV) {
245
+ const e2 = "undefined" != typeof console;
246
+ d = e2 ? function(e3, t2 = r.logLevel) {
247
+ false === r.silent && console[t2](`[VueTypes warn]: ${e3}`);
248
+ } : f;
249
+ }
250
+ const p = (e2, t2) => s.call(e2, t2), y = Number.isInteger || function(e2) {
251
+ return "number" == typeof e2 && isFinite(e2) && Math.floor(e2) === e2;
252
+ }, v = Array.isArray || function(e2) {
253
+ return "[object Array]" === a.call(e2);
254
+ }, h = (e2) => "[object Function]" === a.call(e2), b = (e2, t2) => c(e2) && p(e2, "_vueTypes_name") && (!t2 || e2._vueTypes_name === t2), g = (e2) => c(e2) && (p(e2, "type") || ["_vueTypes_name", "validator", "default", "required"].some((t2) => p(e2, t2)));
255
+ function O(e2, t2) {
256
+ return Object.defineProperty(e2.bind(t2), "__original", { value: e2 });
257
+ }
258
+ function m(e2, t2, n2 = false) {
259
+ let r2, i2 = true, o2 = "";
260
+ r2 = c(e2) ? e2 : { type: e2 };
261
+ const a2 = b(r2) ? r2._vueTypes_name + " - " : "";
262
+ if (g(r2) && null !== r2.type) {
263
+ if (void 0 === r2.type || true === r2.type) return i2;
264
+ if (!r2.required && null == t2) return i2;
265
+ v(r2.type) ? (i2 = r2.type.some((e3) => true === m(e3, t2, true)), o2 = r2.type.map((e3) => l(e3)).join(" or ")) : (o2 = l(r2), i2 = "Array" === o2 ? v(t2) : "Object" === o2 ? c(t2) : "String" === o2 || "Number" === o2 || "Boolean" === o2 || "Function" === o2 ? function(e3) {
266
+ if (null == e3) return "";
267
+ const t3 = e3.constructor.toString().match(u);
268
+ return t3 ? t3[1].replace(/^Async/, "") : "";
269
+ }(t2) === o2 : t2 instanceof r2.type);
270
+ }
271
+ if (!i2) {
272
+ const e3 = `${a2}value "${t2}" should be of type "${o2}"`;
273
+ return false === n2 ? (d(e3), false) : e3;
274
+ }
275
+ if (p(r2, "validator") && h(r2.validator)) {
276
+ const e3 = d, o3 = [];
277
+ if (d = (e4) => {
278
+ o3.push(e4);
279
+ }, i2 = r2.validator(t2), d = e3, !i2) {
280
+ const e4 = (o3.length > 1 ? "* " : "") + o3.join("\n* ");
281
+ return o3.length = 0, false === n2 ? (d(e4), i2) : e4;
282
+ }
283
+ }
284
+ return i2;
285
+ }
286
+ function j(e2, t2) {
287
+ const n2 = Object.defineProperties(t2, { _vueTypes_name: { value: e2, writable: true }, isRequired: { get() {
288
+ return this.required = true, this;
289
+ } }, def: { value(e3) {
290
+ return void 0 === e3 ? this.type === Boolean || Array.isArray(this.type) && this.type.includes(Boolean) ? void (this.default = void 0) : (p(this, "default") && delete this.default, this) : h(e3) || true === m(this, e3, true) ? (this.default = v(e3) ? () => [...e3] : c(e3) ? () => Object.assign({}, e3) : e3, this) : (d(`${this._vueTypes_name} - invalid default value: "${e3}"`), this);
291
+ } } }), { validator: r2 } = n2;
292
+ return h(r2) && (n2.validator = O(r2, n2)), n2;
293
+ }
294
+ function _(e2, t2) {
295
+ const n2 = j(e2, t2);
296
+ return Object.defineProperty(n2, "validate", { value(e3) {
297
+ return h(this.validator) && d(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:
298
+ ${JSON.stringify(this)}`), this.validator = O(e3, this), this;
299
+ } });
300
+ }
301
+ function T(e2, t2, r2) {
302
+ const o2 = function(e3) {
303
+ const t3 = {};
304
+ return Object.getOwnPropertyNames(e3).forEach((n2) => {
305
+ t3[n2] = Object.getOwnPropertyDescriptor(e3, n2);
306
+ }), Object.defineProperties({}, t3);
307
+ }(t2);
308
+ if (o2._vueTypes_name = e2, !c(r2)) return o2;
309
+ const { validator: a2 } = r2, s2 = n(r2, i);
310
+ if (h(a2)) {
311
+ let { validator: e3 } = o2;
312
+ e3 && (e3 = null !== (l2 = (u2 = e3).__original) && void 0 !== l2 ? l2 : u2), o2.validator = O(e3 ? function(t3) {
313
+ return e3.call(this, t3) && a2.call(this, t3);
314
+ } : a2, o2);
315
+ }
316
+ var u2, l2;
317
+ return Object.assign(o2, s2);
318
+ }
319
+ function $(e2) {
320
+ return e2.replace(/^(?!\s*$)/gm, " ");
321
+ }
322
+ const w = () => _("any", {}), x = () => _("function", { type: Function }), P = () => _("boolean", { type: Boolean }), A = () => _("string", { type: String }), E = () => _("number", { type: Number }), S = () => _("array", { type: Array }), N = () => _("object", { type: Object }), V = () => j("integer", { type: Number, validator(e2) {
323
+ const t2 = y(e2);
324
+ return false === t2 && d(`integer - "${e2}" is not an integer`), t2;
325
+ } }), q = () => j("symbol", { validator(e2) {
326
+ const t2 = "symbol" == typeof e2;
327
+ return false === t2 && d(`symbol - invalid value "${e2}"`), t2;
328
+ } }), k = () => Object.defineProperty({ type: null, validator(e2) {
329
+ const t2 = null === e2;
330
+ return false === t2 && d("nullable - value should be null"), t2;
331
+ } }, "_vueTypes_name", { value: "nullable" });
332
+ function D(e2, t2 = "custom validation failed") {
333
+ if ("function" != typeof e2) throw new TypeError("[VueTypes error]: You must provide a function as argument");
334
+ return j(e2.name || "<<anonymous function>>", { type: null, validator(n2) {
335
+ const r2 = e2(n2);
336
+ return r2 || d(`${this._vueTypes_name} - ${t2}`), r2;
337
+ } });
338
+ }
339
+ function L(e2) {
340
+ if (!v(e2)) throw new TypeError("[VueTypes error]: You must provide an array as argument.");
341
+ const t2 = `oneOf - value should be one of "${e2.map((e3) => "symbol" == typeof e3 ? e3.toString() : e3).join('", "')}".`, n2 = { validator(n3) {
342
+ const r2 = -1 !== e2.indexOf(n3);
343
+ return r2 || d(t2), r2;
344
+ } };
345
+ if (-1 === e2.indexOf(null)) {
346
+ const t3 = e2.reduce((e3, t4) => {
347
+ if (null != t4) {
348
+ const n3 = t4.constructor;
349
+ -1 === e3.indexOf(n3) && e3.push(n3);
350
+ }
351
+ return e3;
352
+ }, []);
353
+ t3.length > 0 && (n2.type = t3);
354
+ }
355
+ return j("oneOf", n2);
356
+ }
357
+ function B(e2) {
358
+ if (!v(e2)) throw new TypeError("[VueTypes error]: You must provide an array as argument");
359
+ let t2 = false, n2 = false, r2 = [];
360
+ for (let i3 = 0; i3 < e2.length; i3 += 1) {
361
+ const o2 = e2[i3];
362
+ if (g(o2)) {
363
+ if (h(o2.validator) && (t2 = true), b(o2, "oneOf") && o2.type) {
364
+ r2 = r2.concat(o2.type);
365
+ continue;
366
+ }
367
+ if (b(o2, "nullable")) {
368
+ n2 = true;
369
+ continue;
370
+ }
371
+ if (true === o2.type || !o2.type) {
372
+ d('oneOfType - invalid usage of "true" and "null" as types.');
373
+ continue;
374
+ }
375
+ r2 = r2.concat(o2.type);
376
+ } else r2.push(o2);
377
+ }
378
+ r2 = r2.filter((e3, t3) => r2.indexOf(e3) === t3);
379
+ const i2 = false === n2 && r2.length > 0 ? r2 : null;
380
+ return j("oneOfType", t2 ? { type: i2, validator(t3) {
381
+ const n3 = [], r3 = e2.some((e3) => {
382
+ const r4 = m(e3, t3, true);
383
+ return "string" == typeof r4 && n3.push(r4), true === r4;
384
+ });
385
+ return r3 || d(`oneOfType - provided value does not match any of the ${n3.length} passed-in validators:
386
+ ${$(n3.join("\n"))}`), r3;
387
+ } } : { type: i2 });
388
+ }
389
+ function F(e2) {
390
+ return j("arrayOf", { type: Array, validator(t2) {
391
+ let n2 = "";
392
+ const r2 = t2.every((t3) => (n2 = m(e2, t3, true), true === n2));
393
+ return r2 || d(`arrayOf - value validation error:
394
+ ${$(n2)}`), r2;
395
+ } });
396
+ }
397
+ function Y(e2) {
398
+ return j("instanceOf", { type: e2 });
399
+ }
400
+ function I(e2) {
401
+ return j("objectOf", { type: Object, validator(t2) {
402
+ let n2 = "";
403
+ const r2 = Object.keys(t2).every((r3) => (n2 = m(e2, t2[r3], true), true === n2));
404
+ return r2 || d(`objectOf - value validation error:
405
+ ${$(n2)}`), r2;
406
+ } });
407
+ }
408
+ function J(e2) {
409
+ const t2 = Object.keys(e2), n2 = t2.filter((t3) => {
410
+ var n3;
411
+ return !(null === (n3 = e2[t3]) || void 0 === n3 || !n3.required);
412
+ }), r2 = j("shape", { type: Object, validator(r3) {
413
+ if (!c(r3)) return false;
414
+ const i2 = Object.keys(r3);
415
+ if (n2.length > 0 && n2.some((e3) => -1 === i2.indexOf(e3))) {
416
+ const e3 = n2.filter((e4) => -1 === i2.indexOf(e4));
417
+ return d(1 === e3.length ? `shape - required property "${e3[0]}" is not defined.` : `shape - required properties "${e3.join('", "')}" are not defined.`), false;
418
+ }
419
+ return i2.every((n3) => {
420
+ if (-1 === t2.indexOf(n3)) return true === this._vueTypes_isLoose || (d(`shape - shape definition does not include a "${n3}" property. Allowed keys: "${t2.join('", "')}".`), false);
421
+ const i3 = m(e2[n3], r3[n3], true);
422
+ return "string" == typeof i3 && d(`shape - "${n3}" property validation error:
423
+ ${$(i3)}`), true === i3;
424
+ });
425
+ } });
426
+ return Object.defineProperty(r2, "_vueTypes_isLoose", { writable: true, value: false }), Object.defineProperty(r2, "loose", { get() {
427
+ return this._vueTypes_isLoose = true, this;
428
+ } }), r2;
429
+ }
430
+ const M = ["name", "validate", "getter"], R = /* @__PURE__ */ ((e2) => ((e2 = class {
431
+ static get any() {
432
+ return w();
433
+ }
434
+ static get func() {
435
+ return x().def(this.defaults.func);
436
+ }
437
+ static get bool() {
438
+ return void 0 === this.defaults.bool ? P() : P().def(this.defaults.bool);
439
+ }
440
+ static get string() {
441
+ return A().def(this.defaults.string);
442
+ }
443
+ static get number() {
444
+ return E().def(this.defaults.number);
445
+ }
446
+ static get array() {
447
+ return S().def(this.defaults.array);
448
+ }
449
+ static get object() {
450
+ return N().def(this.defaults.object);
451
+ }
452
+ static get integer() {
453
+ return V().def(this.defaults.integer);
454
+ }
455
+ static get symbol() {
456
+ return q();
457
+ }
458
+ static get nullable() {
459
+ return k();
460
+ }
461
+ static extend(e3) {
462
+ if (d("VueTypes.extend is deprecated. Use the ES6+ method instead. See https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#extending-namespaced-validators-in-es6 for details."), v(e3)) return e3.forEach((e4) => this.extend(e4)), this;
463
+ const { name: t2, validate: r2 = false, getter: i2 = false } = e3, o2 = n(e3, M);
464
+ if (p(this, t2)) throw new TypeError(`[VueTypes error]: Type "${t2}" already defined`);
465
+ const { type: a2 } = o2;
466
+ if (b(a2)) return delete o2.type, Object.defineProperty(this, t2, i2 ? { get: () => T(t2, a2, o2) } : { value(...e4) {
467
+ const n2 = T(t2, a2, o2);
468
+ return n2.validator && (n2.validator = n2.validator.bind(n2, ...e4)), n2;
469
+ } });
470
+ let s2;
471
+ return s2 = i2 ? { get() {
472
+ const e4 = Object.assign({}, o2);
473
+ return r2 ? _(t2, e4) : j(t2, e4);
474
+ }, enumerable: true } : { value(...e4) {
475
+ const n2 = Object.assign({}, o2);
476
+ let i3;
477
+ return i3 = r2 ? _(t2, n2) : j(t2, n2), n2.validator && (i3.validator = n2.validator.bind(i3, ...e4)), i3;
478
+ }, enumerable: true }, Object.defineProperty(this, t2, s2);
479
+ }
480
+ }).defaults = {}, e2.sensibleDefaults = void 0, e2.config = r, e2.custom = D, e2.oneOf = L, e2.instanceOf = Y, e2.oneOfType = B, e2.arrayOf = F, e2.objectOf = I, e2.shape = J, e2.utils = { validate: (e3, t2) => true === m(t2, e3, true), toType: (e3, t2, n2 = false) => n2 ? _(e3, t2) : j(e3, t2) }, e2))();
481
+ function U(e2 = { func: () => {
482
+ }, bool: true, string: "", number: 0, array: () => [], object: () => ({}), integer: 0 }) {
483
+ var n2;
484
+ return (n2 = class extends R {
485
+ static get sensibleDefaults() {
486
+ return t({}, this.defaults);
487
+ }
488
+ static set sensibleDefaults(n3) {
489
+ this.defaults = false !== n3 ? t({}, true !== n3 ? n3 : e2) : {};
490
+ }
491
+ }).defaults = t({}, e2), n2;
492
+ }
493
+ class z extends U() {
494
+ }
495
+ class PropUtils {
496
+ /** String 类型,默认:'' */
497
+ static get string() {
498
+ return A().def("");
499
+ }
500
+ /** String 类型,默认:undefined */
501
+ static get looseString() {
502
+ return A();
503
+ }
504
+ /** Number 类型,默认:0 */
505
+ static get number() {
506
+ return E().def(0);
507
+ }
508
+ /** Number 类型,默认:undefined */
509
+ static get looseNumber() {
510
+ return E();
511
+ }
512
+ /** Boolean 类型,默认:true */
513
+ static get bool() {
514
+ return P().def(true);
515
+ }
516
+ static get looseBool() {
517
+ return B([]).def(void 0);
518
+ }
519
+ static get looseElement() {
520
+ return B([]).def(void 0);
521
+ }
522
+ }
523
+ __publicField(PropUtils, "objectType", N);
524
+ /** Array 类型,默认:[] */
525
+ __publicField(PropUtils, "array", () => {
526
+ return S().def([]);
527
+ });
528
+ /** Object 类型 */
529
+ __publicField(PropUtils, "object", N);
530
+ /** Function 类型 */
531
+ __publicField(PropUtils, "func", x);
532
+ /** 指定为数组中的值 */
533
+ __publicField(PropUtils, "oneOf", L);
534
+ /** 自定义类型 */
535
+ __publicField(PropUtils, "oneOfType", B);
536
+ /** 枚举类型 */
537
+ __publicField(PropUtils, "enum", A);
538
+ /** 任意类型 */
539
+ __publicField(PropUtils, "any", w);
540
+ function formatSeconds(e, t2 = { segments: 2, digits: 2 }) {
541
+ if (e = Number(e), isNaN(e) || e < 0) throw new Error('"secs" must be a positive integer');
542
+ let n2 = 2;
543
+ "auto" === t2.segments && e >= 3600 ? n2 = 3 : "number" == typeof t2.segments && -1 !== [2, 3].indexOf(t2.segments) && (n2 = t2.segments);
544
+ let r2 = 0 | (t2.digits || 2);
545
+ r2 = Math.max(1, r2);
546
+ const s2 = new Array(r2 + 1).join("0"), o2 = [60, 1];
547
+ return 3 === n2 && o2.unshift(3600), o2.map((t3) => {
548
+ const n3 = Math.floor(e / t3), o3 = n3.toString().length;
549
+ return e %= t3, (s2 + n3).slice(-Math.max(o3, r2));
550
+ }).join(":");
551
+ }
552
+ const emitFunc = () => () => true;
553
+ const supportWebP = /* @__PURE__ */ (() => {
554
+ let A2;
555
+ return () => {
556
+ if (null == A2) try {
557
+ A2 = function() {
558
+ const A3 = document.createElement("canvas");
559
+ if (A3.getContext && A3.getContext("2d")) {
560
+ const e = "image/webp";
561
+ return 0 === A3.toDataURL(e).indexOf("data:" + e);
562
+ }
563
+ return false;
564
+ }();
565
+ } catch (e) {
566
+ A2 = false;
567
+ }
568
+ return A2;
569
+ };
570
+ })();
571
+ function getExtname(A2) {
572
+ const e = (A2 || "").split("."), t2 = e[e.length - 1];
573
+ return t2 ? t2.toLowerCase() : "";
574
+ }
575
+ function handleCompressOptions(A2) {
576
+ var e, t2;
577
+ const r2 = "number" == typeof A2 ? { width: A2 } : A2;
578
+ return r2.allowJPG = null === (e = r2.allowJPG) || void 0 === e || e, r2.allowWebP = null !== (t2 = r2.allowWebP) && void 0 !== t2 ? t2 : "auto", r2;
579
+ }
580
+ function createURLObject(A2) {
581
+ let e;
582
+ if ("undefined" != typeof document) {
583
+ const t2 = document.createElement("a");
584
+ t2.href = A2, e = t2;
585
+ } else if ("function" == typeof URL) try {
586
+ e = new URL(/^\/\//.test(A2) ? "https:" + A2 : A2);
587
+ } catch (A3) {
588
+ }
589
+ return e;
590
+ }
591
+ function genOSSCompressParams(A2, e) {
592
+ let t2 = "";
593
+ return null == e.width && null == e.height || (t2 += "/resize", e.width && (t2 += ",w_" + e.width), e.height && (t2 += ",h_" + e.height), t2 += ",limit_1"), e.allowAVIF && "gif" !== A2 ? t2 += "/format,avif" : true === e.allowWebP || "auto" === e.allowWebP && supportWebP() ? t2 += "/format,webp/quality,Q_80" : e.allowJPG && "gif" !== A2 && (t2 += "/format,jpg/quality,Q_80"), t2;
594
+ }
595
+ function setOSSCompressParams(A2, e) {
596
+ let t2 = false;
597
+ return A2 = A2.replace(/([?&]x-oss-process)(?:=([^&]*))?/, (A3, r2, o2) => (t2 = true, /^image/.test(o2) ? r2 + "=" + o2.replace(/\/(?:resize|format|quality)[^/]*/gi, "") + e : A3)), t2 ? A2 : A2 + (-1 === A2.indexOf("?") ? "?" : "&") + "x-oss-process=image" + e;
598
+ }
599
+ function ossCompress(A2, e) {
600
+ const t2 = createURLObject(A2);
601
+ if (!t2) return A2;
602
+ if (!/\.videocc\.net$/i.test(t2.hostname)) return A2;
603
+ const r2 = genOSSCompressParams(getExtname(t2.pathname.split("/").pop()), handleCompressOptions(e));
604
+ return r2 && (t2.search = setOSSCompressParams(t2.search, r2)), t2.href;
605
+ }
606
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
607
+ __name: "index",
608
+ props: {
609
+ /** 挂件图片 */
610
+ iconUrl: PropUtils.string,
611
+ /** 挂件文案 */
612
+ text: PropUtils.string,
613
+ /** 倒计时秒数 */
614
+ countdownSecond: PropUtils.number,
615
+ /** 倒计时时间戳 */
616
+ countdownTimestamp: PropUtils.number
617
+ },
618
+ emits: {
619
+ "click-pendant": emitFunc()
620
+ },
621
+ setup(__props, { emit }) {
622
+ const props = __props;
623
+ const { startCountDown, stopCountDown, resetSurplus, surplusSecond } = useSecondCountDown();
624
+ const pendantText = computed(() => {
625
+ if (surplusSecond.value > 0) {
626
+ return formatSeconds(surplusSecond.value, {
627
+ segments: "auto"
628
+ });
629
+ }
630
+ return props.text;
631
+ });
632
+ const pendantIconStyle = computed(() => {
633
+ const styles = {};
634
+ if (props.iconUrl) {
635
+ styles.backgroundImage = `url(${ossCompress(props.iconUrl, { width: 120 })})`;
636
+ }
637
+ return styles;
638
+ });
639
+ watch(
640
+ () => [props.countdownSecond, props.countdownTimestamp],
641
+ () => {
642
+ if (props.countdownSecond) {
643
+ startCountDown({ second: props.countdownSecond });
644
+ } else if (props.countdownTimestamp) {
645
+ startCountDown({ endTimestamp: props.countdownTimestamp });
646
+ } else {
647
+ stopCountDown();
648
+ resetSurplus();
649
+ }
650
+ },
651
+ {
652
+ immediate: true
653
+ }
654
+ );
655
+ return { __sfc: true, props, emit, startCountDown, stopCountDown, resetSurplus, surplusSecond, pendantText, pendantIconStyle };
656
+ }
657
+ });
658
+ function normalizeComponent(scriptExports, render3, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
659
+ var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
660
+ if (render3) {
661
+ options.render = render3;
662
+ options.staticRenderFns = staticRenderFns;
663
+ options._compiled = true;
664
+ }
665
+ return {
666
+ exports: scriptExports,
667
+ options
668
+ };
669
+ }
670
+ var _sfc_render$1 = function render() {
671
+ var _vm = this, _c = _vm._self._c, _setup = _vm._self._setupProxy;
672
+ return _c("div", { staticClass: "plv-product-common-pendant", on: { "click": function($event) {
673
+ return _setup.emit("click-pendant");
674
+ } } }, [_c("div", { staticClass: "plv-product-common-pendant__icon", style: _setup.pendantIconStyle }), _setup.pendantText ? _c("div", { staticClass: "plv-product-common-pendant__text" }, [_c("span", [_vm._v(_vm._s(_setup.pendantText))])]) : _vm._e()]);
675
+ };
676
+ var _sfc_staticRenderFns$1 = [];
677
+ var __component__$1 = /* @__PURE__ */ normalizeComponent(
678
+ _sfc_main$1,
679
+ _sfc_render$1,
680
+ _sfc_staticRenderFns$1
681
+ );
682
+ const CommonPendant = __component__$1.exports;
683
+ function mitt(n2) {
684
+ return { all: n2 = n2 || /* @__PURE__ */ new Map(), on: function(t2, e) {
685
+ var i2 = n2.get(t2);
686
+ i2 ? i2.push(e) : n2.set(t2, [e]);
687
+ }, off: function(t2, e) {
688
+ var i2 = n2.get(t2);
689
+ i2 && (e ? i2.splice(i2.indexOf(e) >>> 0, 1) : n2.set(t2, []));
690
+ }, emit: function(t2, e) {
691
+ var i2 = n2.get(t2);
692
+ i2 && i2.slice().map(function(n3) {
693
+ n3(e);
694
+ }), (i2 = n2.get("*")) && i2.slice().map(function(n3) {
695
+ n3(t2, e);
696
+ });
697
+ } };
698
+ }
699
+ const globalKey = "__product-event-emitter-key";
700
+ function createEmitter() {
701
+ if (window[globalKey]) {
702
+ return window[globalKey];
703
+ }
704
+ const emitter = mitt();
705
+ window[globalKey] = emitter;
706
+ return emitter;
707
+ }
708
+ var LangType = /* @__PURE__ */ ((LangType2) => {
709
+ LangType2["ZH_CN"] = "zh_CN";
710
+ LangType2["ZH_TW"] = "zh_TW";
711
+ LangType2["English"] = "en";
712
+ LangType2["Japanese"] = "ja";
713
+ LangType2["Korean"] = "ko";
714
+ LangType2["Russian"] = "ru";
715
+ return LangType2;
716
+ })(LangType || {});
717
+ const ProductInjectKey = "interactGlobalConfigV2";
718
+ const useGlobalInject = () => {
719
+ const injectData = inject(ProductInjectKey, {
720
+ globalLang: LangType.ZH_CN
721
+ });
722
+ const toast = (msg) => {
723
+ if (injectData.toast) {
724
+ injectData.toast(msg);
725
+ }
726
+ };
727
+ function getEmitter() {
728
+ if (injectData.getEmitter) {
729
+ return injectData.getEmitter();
730
+ }
731
+ return createEmitter();
732
+ }
733
+ const messageBox = (options) => {
734
+ if (injectData.messageBox) {
735
+ return injectData.messageBox(options);
736
+ }
737
+ return Promise.resolve(false);
738
+ };
739
+ return {
740
+ injectData,
741
+ toast,
742
+ getEmitter,
743
+ messageBox
744
+ };
745
+ };
746
+ const productEvents = {
747
+ /**
748
+ * 打开商品列表弹层
749
+ */
750
+ OpenProductListPopup: "openProductListPopup"
751
+ };
752
+ const productPendantProps = () => ({
753
+ productTarget: PropUtils.object().isRequired
754
+ });
755
+ const useProductPendant = (options) => {
756
+ const { props } = options;
757
+ const { getEmitter } = useGlobalInject();
758
+ const productTotal = ref("");
759
+ const isCollapsed = ref(false);
760
+ function getProductTotal() {
761
+ return __async(this, null, function* () {
762
+ const data = yield props.productTarget.getProductList();
763
+ productTotal.value = String(data.total);
764
+ });
765
+ }
766
+ function onClickPendant() {
767
+ getEmitter().emit(productEvents.OpenProductListPopup);
768
+ }
769
+ function toggleCollapse() {
770
+ isCollapsed.value = !isCollapsed.value;
771
+ }
772
+ return {
773
+ productTotal,
774
+ isCollapsed,
775
+ onClickPendant,
776
+ getProductTotal,
777
+ toggleCollapse
778
+ };
779
+ };
780
+ const _sfc_main = /* @__PURE__ */ defineComponent({
781
+ __name: "mobile-product-pendant",
782
+ props: productPendantProps(),
783
+ setup(__props) {
784
+ const props = __props;
785
+ const { productTotal, onClickPendant, getProductTotal } = useProductPendant({ props });
786
+ onMounted(() => {
787
+ getProductTotal();
788
+ });
789
+ return { __sfc: true, props, productTotal, onClickPendant, getProductTotal, pendantIcon, CommonPendant };
790
+ }
791
+ });
792
+ var _sfc_render = function render2() {
793
+ var _vm = this, _c = _vm._self._c, _setup = _vm._self._setupProxy;
794
+ return _c("div", { staticClass: "plv-product-pendant" }, [_setup.productTotal ? _c(_setup.CommonPendant, { attrs: { "icon-url": _setup.pendantIcon, "text": _setup.productTotal }, on: { "click-pendant": _setup.onClickPendant } }) : _vm._e()], 1);
795
+ };
796
+ var _sfc_staticRenderFns = [];
797
+ var __component__ = /* @__PURE__ */ normalizeComponent(
798
+ _sfc_main,
799
+ _sfc_render,
800
+ _sfc_staticRenderFns
801
+ );
802
+ const mobileProductPendant = __component__.exports;
803
+ ;
804
+ console.log(
805
+ "%c@polyv/product-ui",
806
+ "background:#409EFF;padding: 2px 6px;border-radius: 3px;color: #fff",
807
+ "[component: mobile-product-pendant]",
808
+ "[version: 1.0.0-rc-20250612.3]",
809
+ "[buildTime: 2025-06-12 02:28:37]"
810
+ );
811
+ export {
812
+ mobileProductPendant as default
813
+ };