uniapp-dyckui 4.1.5 → 4.1.7

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/dist/index.cjs CHANGED
@@ -86,14 +86,34 @@ const _export_sfc = (sfc, props) => {
86
86
  const Button = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-02c23a30"]]);
87
87
  const _hoisted_1$9 = { class: "dialog-content" };
88
88
  const _hoisted_2$8 = { class: "dialog-icon" };
89
- const _hoisted_3$8 = ["src"];
89
+ const _hoisted_3$8 = {
90
+ key: 0,
91
+ class: "iconfont dialog-icon-custom"
92
+ };
90
93
  const _hoisted_4$5 = {
91
94
  key: 1,
95
+ class: "iconfont dialog-button-primary icon-shouji"
96
+ };
97
+ const _hoisted_5$4 = {
98
+ key: 2,
99
+ class: "iconfont dialog-button-primary icon-xianshiqi"
100
+ };
101
+ const _hoisted_6$4 = {
102
+ key: 3,
103
+ class: "iconfont dialog-button-primary icon-xianshiqi1"
104
+ };
105
+ const _hoisted_7$2 = {
106
+ key: 4,
107
+ class: "iconfont dialog-button-primary icon-lianjiewangzhi"
108
+ };
109
+ const _hoisted_8$2 = ["src"];
110
+ const _hoisted_9$1 = {
111
+ key: 6,
92
112
  class: "default-icon"
93
113
  };
94
- const _hoisted_5$4 = { class: "dialog-title" };
95
- const _hoisted_6$4 = { class: "dialog-description" };
96
- const _hoisted_7$2 = { class: "dialog-buttons" };
114
+ const _hoisted_10$1 = { class: "dialog-title" };
115
+ const _hoisted_11$1 = { class: "dialog-description" };
116
+ const _hoisted_12$1 = { class: "dialog-buttons" };
97
117
  const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
98
118
  __name: "index",
99
119
  props: {
@@ -102,6 +122,8 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
102
122
  title: { default: "" },
103
123
  description: { default: "" },
104
124
  icon: { default: "" },
125
+ iconType: { default: void 0 },
126
+ customIcon: { default: "" },
105
127
  mask: { type: Boolean, default: true },
106
128
  maskOpacity: { default: 0.5 },
107
129
  closeOnMaskClick: { type: Boolean, default: true }
@@ -109,7 +131,7 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
109
131
  emits: ["update:modelValue", "confirm", "cancel"],
110
132
  setup(__props, { emit: __emit }) {
111
133
  vue.useCssVars((_ctx) => ({
112
- "v1f434a4e": _ctx.maskOpacity
134
+ "ec110036": _ctx.maskOpacity
113
135
  }));
114
136
  const props = __props;
115
137
  const emit = __emit;
@@ -146,17 +168,19 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
146
168
  }, [
147
169
  vue.createElementVNode("view", _hoisted_1$9, [
148
170
  vue.createElementVNode("view", _hoisted_2$8, [
149
- __props.icon ? (vue.openBlock(), vue.createElementBlock("image", {
150
- key: 0,
151
- src: __props.icon,
152
- alt: "dialog-icon"
153
- }, null, 8, _hoisted_3$8)) : (vue.openBlock(), vue.createElementBlock("view", _hoisted_4$5))
171
+ vue.renderSlot(_ctx.$slots, "icon", {}, () => [
172
+ __props.customIcon ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_3$8, vue.toDisplayString(__props.customIcon), 1)) : __props.iconType === "phone" ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_4$5)) : __props.iconType === "screen" ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_5$4)) : __props.iconType === "links" ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_6$4)) : __props.iconType === "links2" ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_7$2)) : __props.icon ? (vue.openBlock(), vue.createElementBlock("image", {
173
+ key: 5,
174
+ src: __props.icon,
175
+ alt: "dialog-icon"
176
+ }, null, 8, _hoisted_8$2)) : (vue.openBlock(), vue.createElementBlock("view", _hoisted_9$1))
177
+ ], true)
154
178
  ]),
155
- vue.createElementVNode("text", _hoisted_5$4, vue.toDisplayString(__props.title), 1),
156
- vue.createElementVNode("text", _hoisted_6$4, vue.toDisplayString(__props.description), 1)
179
+ vue.createElementVNode("view", _hoisted_10$1, vue.toDisplayString(__props.title), 1),
180
+ vue.createElementVNode("text", _hoisted_11$1, vue.toDisplayString(__props.description), 1)
157
181
  ]),
158
182
  _cache[1] || (_cache[1] = vue.createElementVNode("view", { class: "dialog-divider" }, null, -1)),
159
- vue.createElementVNode("view", _hoisted_7$2, [
183
+ vue.createElementVNode("view", _hoisted_12$1, [
160
184
  __props.type === "open-app" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
161
185
  vue.createElementVNode("view", {
162
186
  class: "dialog-button dialog-button-cancel",
@@ -186,7 +210,7 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
186
210
  };
187
211
  }
188
212
  });
189
- const Dialog = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-a2785685"]]);
213
+ const Dialog = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-1151ef29"]]);
190
214
  const _hoisted_1$8 = {
191
215
  key: 0,
192
216
  class: "sw-divider__text"
@@ -795,7 +819,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
795
819
  };
796
820
  }
797
821
  });
798
- const Popup = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-a8084c82"]]);
822
+ const Popup = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-5d3c3e08"]]);
799
823
  const _hoisted_1$2 = {
800
824
  key: 0,
801
825
  class: "refresh-content"
@@ -878,7 +902,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
878
902
  const now = Date.now();
879
903
  if (now - lastScrollTime >= delay) {
880
904
  lastScrollTime = now;
881
- fn.apply(null, args);
905
+ fn(...args);
882
906
  }
883
907
  };
884
908
  }
@@ -1074,7 +1098,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
1074
1098
  };
1075
1099
  }
1076
1100
  });
1077
- const PullRefresh = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-b591b189"]]);
1101
+ const PullRefresh = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-b679bd64"]]);
1078
1102
  const _hoisted_1$1 = { class: "sw-swiper" };
1079
1103
  const _hoisted_2$1 = {
1080
1104
  key: 0,
@@ -1199,7 +1223,7 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
1199
1223
  };
1200
1224
  }
1201
1225
  });
1202
- const Swiper = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-4f860ae8"]]);
1226
+ const Swiper = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-48e33fb8"]]);
1203
1227
  const _hoisted_1 = {
1204
1228
  key: 0,
1205
1229
  class: "sw-toast__loading"
@@ -1218,19 +1242,19 @@ const _hoisted_4 = {
1218
1242
  };
1219
1243
  const _hoisted_5 = {
1220
1244
  key: 0,
1221
- class: "sw-toast__icon--success"
1245
+ class: "sw-toast__icon--success iconfont icon-zhengqueshixin"
1222
1246
  };
1223
1247
  const _hoisted_6 = {
1224
1248
  key: 1,
1225
- class: "sw-toast__icon--fail"
1249
+ class: "sw-toast__icon--fail iconfont icon-shanchu"
1226
1250
  };
1227
1251
  const _hoisted_7 = {
1228
1252
  key: 2,
1229
- class: "sw-toast__custom-icon"
1253
+ class: "sw-toast__icon--warning iconfont icon-jurassic_warn"
1230
1254
  };
1231
1255
  const _hoisted_8 = {
1232
- key: 2,
1233
- class: "sw-toast__text"
1256
+ key: 3,
1257
+ class: "sw-toast__custom-icon"
1234
1258
  };
1235
1259
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1236
1260
  __name: "index",
@@ -1244,7 +1268,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1244
1268
  icon: { type: Boolean, default: true },
1245
1269
  customIcon: { default: "" },
1246
1270
  large: { type: Boolean, default: false },
1247
- customStyle: { default: () => ({}) }
1271
+ customStyle: { default: () => ({}) },
1272
+ countdown: { type: Boolean, default: false },
1273
+ countdownSeconds: { default: 5 },
1274
+ countdownParentheses: { type: Boolean, default: false },
1275
+ countdownSuffix: { default: "" },
1276
+ longText: { type: Boolean, default: false }
1248
1277
  },
1249
1278
  emits: ["update:modelValue", "close", "click"],
1250
1279
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -1252,8 +1281,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1252
1281
  const emit = __emit;
1253
1282
  const toastRef = vue.ref(null);
1254
1283
  let timer = null;
1284
+ let countdownTimer = null;
1255
1285
  const showToast = vue.ref(props.modelValue);
1256
1286
  const isClosing = vue.ref(false);
1287
+ const currentCountdown = vue.ref(props.countdownSeconds);
1288
+ const originalMessage = vue.ref(props.message);
1257
1289
  const showIcon = vue.computed(() => {
1258
1290
  if (props.loading)
1259
1291
  return true;
@@ -1261,21 +1293,35 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1261
1293
  return props.icon;
1262
1294
  return true;
1263
1295
  });
1296
+ const displayMessage = vue.computed(() => {
1297
+ if (props.countdown && showToast.value) {
1298
+ let countdownPart = "";
1299
+ if (props.countdownParentheses) {
1300
+ countdownPart = `(${currentCountdown.value}秒${props.countdownSuffix})`;
1301
+ } else {
1302
+ countdownPart = `${currentCountdown.value}秒${props.countdownSuffix}`;
1303
+ }
1304
+ return `${originalMessage.value || ""} ${countdownPart}`;
1305
+ }
1306
+ return props.message;
1307
+ });
1264
1308
  function onClick() {
1265
1309
  emit("click");
1266
1310
  }
1267
1311
  function close() {
1268
1312
  if (!showToast.value)
1269
1313
  return;
1314
+ clearCountdownTimer();
1270
1315
  isClosing.value = true;
1271
1316
  emit("close");
1272
1317
  }
1273
1318
  function startTimer() {
1274
1319
  clearTimer();
1275
- if (props.duration > 0 && !props.loading) {
1320
+ const actualDuration = props.countdown && props.countdownSeconds > 0 ? props.countdownSeconds * 1e3 : props.duration;
1321
+ if (actualDuration > 0 && !props.loading) {
1276
1322
  timer = setTimeout(() => {
1277
1323
  close();
1278
- }, props.duration);
1324
+ }, actualDuration);
1279
1325
  }
1280
1326
  }
1281
1327
  function clearTimer() {
@@ -1284,6 +1330,29 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1284
1330
  timer = null;
1285
1331
  }
1286
1332
  }
1333
+ function startCountdown() {
1334
+ clearCountdownTimer();
1335
+ if (props.countdown && props.countdownSeconds > 0) {
1336
+ currentCountdown.value = props.countdownSeconds;
1337
+ originalMessage.value = props.message;
1338
+ countdownTimer = setInterval(() => {
1339
+ currentCountdown.value--;
1340
+ if (currentCountdown.value <= 0) {
1341
+ clearCountdownTimer();
1342
+ if (props.duration > 0) {
1343
+ close();
1344
+ }
1345
+ }
1346
+ }, 1e3);
1347
+ }
1348
+ }
1349
+ function clearCountdownTimer() {
1350
+ if (countdownTimer) {
1351
+ clearInterval(countdownTimer);
1352
+ countdownTimer = null;
1353
+ }
1354
+ currentCountdown.value = props.countdownSeconds;
1355
+ }
1287
1356
  function handleTransitionEnd() {
1288
1357
  if (isClosing.value) {
1289
1358
  showToast.value = false;
@@ -1296,6 +1365,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1296
1365
  showToast.value = true;
1297
1366
  isClosing.value = false;
1298
1367
  startTimer();
1368
+ if (props.countdown) {
1369
+ startCountdown();
1370
+ }
1299
1371
  } else {
1300
1372
  close();
1301
1373
  }
@@ -1303,15 +1375,29 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1303
1375
  vue.watch(() => props.message, () => {
1304
1376
  if (showToast.value && !props.loading) {
1305
1377
  startTimer();
1378
+ if (props.countdown) {
1379
+ originalMessage.value = props.message;
1380
+ }
1381
+ }
1382
+ });
1383
+ vue.watch([() => props.countdown, () => props.countdownSeconds], () => {
1384
+ if (showToast.value && props.countdown) {
1385
+ startCountdown();
1386
+ } else {
1387
+ clearCountdownTimer();
1306
1388
  }
1307
1389
  });
1308
1390
  vue.onMounted(() => {
1309
1391
  if (props.modelValue) {
1310
1392
  startTimer();
1393
+ if (props.countdown) {
1394
+ startCountdown();
1395
+ }
1311
1396
  }
1312
1397
  });
1313
1398
  vue.onUnmounted(() => {
1314
1399
  clearTimer();
1400
+ clearCountdownTimer();
1315
1401
  });
1316
1402
  __expose({
1317
1403
  /**
@@ -1338,16 +1424,19 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1338
1424
  __props.loading ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1, [
1339
1425
  !__props.customIcon ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_2)) : (vue.openBlock(), vue.createElementBlock("text", _hoisted_3, vue.toDisplayString(__props.customIcon), 1))
1340
1426
  ])) : showIcon.value ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_4, [
1341
- __props.type === "success" ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_5, "✓")) : __props.type === "fail" ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_6, "")) : __props.customIcon ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_7, vue.toDisplayString(__props.customIcon), 1)) : vue.createCommentVNode("", true)
1427
+ __props.type === "success" ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_5)) : __props.type === "fail" ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_6)) : __props.type === "warning" ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_7)) : __props.customIcon ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_8, vue.toDisplayString(__props.customIcon), 1)) : vue.createCommentVNode("", true)
1342
1428
  ])) : vue.createCommentVNode("", true),
1343
- __props.message ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_8, vue.toDisplayString(__props.message), 1)) : vue.createCommentVNode("", true)
1429
+ displayMessage.value ? (vue.openBlock(), vue.createElementBlock("text", {
1430
+ key: 2,
1431
+ class: vue.normalizeClass(["sw-toast__text", { "sw-toast__text--long": __props.longText }])
1432
+ }, vue.toDisplayString(displayMessage.value), 3)) : vue.createCommentVNode("", true)
1344
1433
  ], 38)), [
1345
1434
  [vue.vShow, showToast.value]
1346
1435
  ]);
1347
1436
  };
1348
1437
  }
1349
1438
  });
1350
- const Toast = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-482db7a0"]]);
1439
+ const Toast = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-78362f19"]]);
1351
1440
  const index = {
1352
1441
  Button,
1353
1442
  Dialog,