btxui 1.1.13 → 1.1.14

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.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, computed, reactive, onMounted, renderSlot, watch, openBlock, createBlock, normalizeClass, withCtx, createElementVNode, normalizeStyle, getCurrentInstance, resolveDynamicComponent, withModifiers, createElementBlock, nextTick, createVNode, resolveComponent, Fragment, createCommentVNode, watchEffect, withDirectives, toDisplayString, vShow, vModelDynamic, vModelText, mergeProps, createTextVNode, renderList, createSlots, onBeforeMount, KeepAlive, onBeforeUnmount, inject, unref, normalizeProps, guardReactiveProps, provide } from "vue";
1
+ import { defineComponent, ref, computed, reactive, onBeforeMount, renderSlot, watch, onMounted, openBlock, createBlock, normalizeClass, withCtx, createElementVNode, normalizeStyle, getCurrentInstance, resolveDynamicComponent, withModifiers, createElementBlock, nextTick, createVNode, resolveComponent, Fragment, createCommentVNode, watchEffect, withDirectives, toDisplayString, vShow, vModelDynamic, vModelText, mergeProps, createTextVNode, renderList, createSlots, render, KeepAlive, inject, unref, normalizeProps, guardReactiveProps, provide } from "vue";
2
2
  const theme = {
3
3
  // 预置主题色
4
4
  colors: {
@@ -197,6 +197,14 @@ const prestyles = {
197
197
  "objfit-scaledown": `object-fit: scale-down;`,
198
198
  // 图层混合模式
199
199
  "lighten": `mix-blend-mode: lighten;`,
200
+ // 动画
201
+ "ani": `animation-duration: 0.7s;`,
202
+ "ani-fast": `animation-duration: 0.3s;`,
203
+ "ani-slow": `animation-duration: 1.4s;`,
204
+ "ani-mode-forwards": `animation-fill-mode: forwards;`,
205
+ "ani-mode-backwards": `animation-fill-mode: backwards;`,
206
+ "ani-mode-both": `animation-fill-mode: both;`,
207
+ "ani-loop": `animation-timing-function: linear; animation-iteration-count: infinite;`,
200
208
  // 二段赋值-----------------------------------------------------------------------------------
201
209
  // 文字颜色
202
210
  "color": {
@@ -365,20 +373,20 @@ var md5$1 = {
365
373
  function bitRotateLeft(num, cnt) {
366
374
  return num << cnt | num >>> 32 - cnt;
367
375
  }
368
- function md5cmn(q, a, b, x, s, t2) {
369
- return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t2)), s), b);
376
+ function md5cmn(q, a, b, x, s, t) {
377
+ return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);
370
378
  }
371
- function md5ff(a, b, c, d, x, s, t2) {
372
- return md5cmn(b & c | ~b & d, a, b, x, s, t2);
379
+ function md5ff(a, b, c, d, x, s, t) {
380
+ return md5cmn(b & c | ~b & d, a, b, x, s, t);
373
381
  }
374
- function md5gg(a, b, c, d, x, s, t2) {
375
- return md5cmn(b & d | c & ~d, a, b, x, s, t2);
382
+ function md5gg(a, b, c, d, x, s, t) {
383
+ return md5cmn(b & d | c & ~d, a, b, x, s, t);
376
384
  }
377
- function md5hh(a, b, c, d, x, s, t2) {
378
- return md5cmn(b ^ c ^ d, a, b, x, s, t2);
385
+ function md5hh(a, b, c, d, x, s, t) {
386
+ return md5cmn(b ^ c ^ d, a, b, x, s, t);
379
387
  }
380
- function md5ii(a, b, c, d, x, s, t2) {
381
- return md5cmn(c ^ (b | ~d), a, b, x, s, t2);
388
+ function md5ii(a, b, c, d, x, s, t) {
389
+ return md5cmn(c ^ (b | ~d), a, b, x, s, t);
382
390
  }
383
391
  function binlMD5(x, len) {
384
392
  x[len >> 5] |= 128 << len % 32;
@@ -685,8 +693,10 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
685
693
  return "";
686
694
  const combineStyle = _class.trim().split(" ").reduce((total, rule) => {
687
695
  const validateRule = parseStyle(rule);
688
- if (!validateRule)
689
- return "";
696
+ if (!validateRule) {
697
+ console.warn(`combineStyles without ${rule} rule!`);
698
+ total += "";
699
+ }
690
700
  total += `${validateRule};`;
691
701
  return total;
692
702
  }, "");
@@ -778,7 +788,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
778
788
  transform: `${translate} ${scale} ${rotate} ${skew}`
779
789
  } : {};
780
790
  };
781
- onMounted(() => {
791
+ onBeforeMount(() => {
782
792
  if (props.matrix)
783
793
  matrix();
784
794
  initStyle();
@@ -801,7 +811,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
801
811
  };
802
812
  }
803
813
  });
804
- const _hoisted_1$c = ["data-ani-states", "state"];
814
+ const _hoisted_1$b = ["data-ani-states", "state"];
805
815
  const _sfc_main$u = /* @__PURE__ */ defineComponent({
806
816
  __name: "b-view",
807
817
  props: {
@@ -820,17 +830,23 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
820
830
  const $el = ref();
821
831
  const state = computed(() => props.state);
822
832
  let lastAni;
823
- watch(state, (val, old) => {
824
- if (val == null || val == void 0 || !$el.value.dataset.aniStates)
833
+ let stateClass = "";
834
+ watch(state, () => {
835
+ setAniState();
836
+ });
837
+ const setAniState = () => {
838
+ if (!$el.value.dataset.aniStates)
825
839
  return;
826
840
  const aniStates = JSON.parse($el.value.dataset.aniStates);
827
- if (aniStates[val]) {
828
- if (old != null || old != void 0)
829
- $el.value.classList.remove(aniStates[old]);
830
- $el.value.classList.add("ani-fast", aniStates[val]);
841
+ const val = state.value;
842
+ if (val && aniStates[val]) {
843
+ if (stateClass)
844
+ $el.value.classList.remove(stateClass);
845
+ stateClass = aniStates[val];
846
+ $el.value.classList.add(stateClass);
831
847
  lastAni = aniStates[val];
832
848
  }
833
- });
849
+ };
834
850
  const aniEnd = (e) => {
835
851
  if (!props.aniEndClear)
836
852
  $el.value.classList.remove(lastAni);
@@ -843,6 +859,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
843
859
  e.preventDefault();
844
860
  };
845
861
  }
862
+ setAniState();
846
863
  });
847
864
  return (_ctx, _cache) => {
848
865
  return openBlock(), createBlock(_sfc_main$v, {
@@ -862,14 +879,14 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
862
879
  style: normalizeStyle({ ...bgStyle.value, ...scope.matrixStyle })
863
880
  }, [
864
881
  renderSlot(_ctx.$slots, "default")
865
- ], 46, _hoisted_1$c)
882
+ ], 46, _hoisted_1$b)
866
883
  ]),
867
884
  _: 3
868
885
  }, 8, ["class", "cname", "states", "matrix"]);
869
886
  };
870
887
  }
871
888
  });
872
- const _hoisted_1$b = ["state"];
889
+ const _hoisted_1$a = ["state"];
873
890
  const _sfc_main$t = /* @__PURE__ */ defineComponent({
874
891
  __name: "b-text",
875
892
  props: {
@@ -891,7 +908,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
891
908
  state: _ctx.state
892
909
  }, [
893
910
  renderSlot(_ctx.$slots, "default")
894
- ], 10, _hoisted_1$b)
911
+ ], 10, _hoisted_1$a)
895
912
  ]),
896
913
  _: 3
897
914
  }, 8, ["class", "states", "cname"]);
@@ -958,17 +975,17 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
958
975
  !props.forbid && emit("on_dblclick", e);
959
976
  };
960
977
  let touchStartTime = ref(0);
961
- let t2;
978
+ let t;
962
979
  let isLongTouch = false;
963
980
  const enter = (e) => {
964
981
  emit("on_enter", e);
965
982
  if (e.type === "touchstart") {
966
983
  touchStartTime.value = Date.now();
967
- t2 = setInterval(() => {
984
+ t = setInterval(() => {
968
985
  if (Date.now() - touchStartTime.value > (props.touchDuration || 1e3)) {
969
986
  isLongTouch = true;
970
987
  emit("on_longTouch", e);
971
- clearTimeout(t2);
988
+ clearTimeout(t);
972
989
  }
973
990
  }, 100);
974
991
  }
@@ -983,7 +1000,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
983
1000
  e.preventDefault();
984
1001
  isLongTouch = false;
985
1002
  }
986
- clearTimeout(t2);
1003
+ clearTimeout(t);
987
1004
  }
988
1005
  };
989
1006
  onMounted(() => {
@@ -1030,7 +1047,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
1030
1047
  };
1031
1048
  }
1032
1049
  });
1033
- const _hoisted_1$a = ["src", "state", "alt"];
1050
+ const _hoisted_1$9 = ["src", "state", "alt"];
1034
1051
  const _sfc_main$r = /* @__PURE__ */ defineComponent({
1035
1052
  __name: "b-img",
1036
1053
  props: {
@@ -1082,7 +1099,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
1082
1099
  alt: _ctx.alt,
1083
1100
  ref_key: "$img",
1084
1101
  ref: $img
1085
- }, null, 14, _hoisted_1$a)) : (openBlock(), createElementBlock("div", {
1102
+ }, null, 14, _hoisted_1$9)) : (openBlock(), createElementBlock("div", {
1086
1103
  key: 1,
1087
1104
  class: normalizeClass(`bg-color-neutral ${scope.className} ani-fade-in`)
1088
1105
  }, null, 2))
@@ -1160,7 +1177,7 @@ function _sfc_render(_ctx, _cache) {
1160
1177
  });
1161
1178
  }
1162
1179
  const AniLoading = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render]]);
1163
- const _hoisted_1$9 = ["state"];
1180
+ const _hoisted_1$8 = ["state"];
1164
1181
  const _sfc_main$m = /* @__PURE__ */ defineComponent({
1165
1182
  __name: "b-icon",
1166
1183
  props: {
@@ -1195,15 +1212,15 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
1195
1212
  key: 2,
1196
1213
  class: normalizeClass(`ico-${props.icon} ${scope.className}`),
1197
1214
  state: _ctx.state
1198
- }, null, 10, _hoisted_1$9))
1215
+ }, null, 10, _hoisted_1$8))
1199
1216
  ]),
1200
1217
  _: 1
1201
1218
  }, 8, ["class", "states", "cname"]);
1202
1219
  };
1203
1220
  }
1204
1221
  });
1205
- const _hoisted_1$8 = ["contenteditable", "focus-state", "state"];
1206
- const _hoisted_2$3 = ["type", "name", "focus-state", "state", "placeholder", "maxlength", "readonly"];
1222
+ const _hoisted_1$7 = ["contenteditable", "focus-state", "state"];
1223
+ const _hoisted_2$2 = ["type", "name", "focus-state", "state", "placeholder", "maxlength", "readonly"];
1207
1224
  const _sfc_main$l = /* @__PURE__ */ defineComponent({
1208
1225
  __name: "b-input",
1209
1226
  props: {
@@ -1371,7 +1388,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1371
1388
  style: { "outline": "none", "width": "100%" },
1372
1389
  state: _ctx.state,
1373
1390
  autocomplete: "off"
1374
- }, toDisplayString(val2.value), 43, _hoisted_1$8)) : withDirectives((openBlock(), createElementBlock("input", {
1391
+ }, toDisplayString(val2.value), 43, _hoisted_1$7)) : withDirectives((openBlock(), createElementBlock("input", {
1375
1392
  key: 2,
1376
1393
  class: normalizeClass(scope.className),
1377
1394
  onFocus: _cache[1] || (_cache[1] = ($event) => focusEvent($event)),
@@ -1389,7 +1406,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1389
1406
  maxlength: _ctx.maxlength,
1390
1407
  readonly: _ctx.readonly,
1391
1408
  autocomplete: "off"
1392
- }, null, 42, _hoisted_2$3)), [
1409
+ }, null, 42, _hoisted_2$2)), [
1393
1410
  [vModelDynamic, val.value]
1394
1411
  ]),
1395
1412
  !_ctx.readonly && !_ctx.aspectHeight && !_ctx.hideClear ? (openBlock(), createBlock(_component_b_hot, {
@@ -1421,7 +1438,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1421
1438
  };
1422
1439
  }
1423
1440
  });
1424
- const _hoisted_1$7 = ["name", "focus", "state", "placeholder", "maxlength", "readonly", "rows"];
1441
+ const _hoisted_1$6 = ["name", "focus", "state", "placeholder", "maxlength", "readonly", "rows"];
1425
1442
  const _sfc_main$k = /* @__PURE__ */ defineComponent({
1426
1443
  __name: "b-textarea",
1427
1444
  props: {
@@ -1467,7 +1484,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
1467
1484
  maxlength: _ctx.maxlength,
1468
1485
  readonly: _ctx.readonly,
1469
1486
  rows: _ctx.rows || 7
1470
- }, null, 42, _hoisted_1$7), [
1487
+ }, null, 42, _hoisted_1$6), [
1471
1488
  [vModelText, val.value]
1472
1489
  ])
1473
1490
  ]),
@@ -1476,8 +1493,8 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
1476
1493
  };
1477
1494
  }
1478
1495
  });
1479
- const _hoisted_1$6 = ["poster", "muted", "src", "autoplay", "controls", "loop"];
1480
- const _hoisted_2$2 = ["poster", "muted", "src", "autoplay", "controls", "loop"];
1496
+ const _hoisted_1$5 = ["poster", "muted", "src", "autoplay", "controls", "loop"];
1497
+ const _hoisted_2$1 = ["poster", "muted", "src", "autoplay", "controls", "loop"];
1481
1498
  const _sfc_main$j = /* @__PURE__ */ defineComponent({
1482
1499
  __name: "b-video",
1483
1500
  props: {
@@ -1593,7 +1610,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
1593
1610
  autoplay: _ctx.autoPlay,
1594
1611
  controls: !_ctx.customControls,
1595
1612
  loop: _ctx.loop
1596
- }, null, 42, _hoisted_1$6)) : (openBlock(), createElementBlock("video", {
1613
+ }, null, 42, _hoisted_1$5)) : (openBlock(), createElementBlock("video", {
1597
1614
  key: 2,
1598
1615
  ref_key: "$video",
1599
1616
  ref: $video,
@@ -1609,7 +1626,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
1609
1626
  autoplay: _ctx.autoPlay,
1610
1627
  controls: !_ctx.customControls,
1611
1628
  loop: _ctx.loop
1612
- }, null, 42, _hoisted_2$2))
1629
+ }, null, 42, _hoisted_2$1))
1613
1630
  ], 2)
1614
1631
  ]),
1615
1632
  _: 1
@@ -1617,7 +1634,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
1617
1634
  };
1618
1635
  }
1619
1636
  });
1620
- const _hoisted_1$5 = ["state"];
1637
+ const _hoisted_1$4 = ["state"];
1621
1638
  const tolerance = 2;
1622
1639
  const _sfc_main$i = /* @__PURE__ */ defineComponent({
1623
1640
  __name: "b-list",
@@ -1702,14 +1719,14 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
1702
1719
  }, [
1703
1720
  renderSlot(_ctx.$slots, "default")
1704
1721
  ], 38)
1705
- ], 10, _hoisted_1$5)
1722
+ ], 10, _hoisted_1$4)
1706
1723
  ]),
1707
1724
  _: 3
1708
1725
  }, 8, ["class", "states", "cname"]);
1709
1726
  };
1710
1727
  }
1711
1728
  });
1712
- const _hoisted_1$4 = ["state", "draggable"];
1729
+ const _hoisted_1$3 = ["state", "draggable"];
1713
1730
  const _sfc_main$h = /* @__PURE__ */ defineComponent({
1714
1731
  __name: "b-drag",
1715
1732
  props: {
@@ -1842,14 +1859,14 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
1842
1859
  draggable: _ctx.dragStart ? true : false
1843
1860
  }, [
1844
1861
  renderSlot(_ctx.$slots, "default")
1845
- ], 14, _hoisted_1$4)
1862
+ ], 14, _hoisted_1$3)
1846
1863
  ]),
1847
1864
  _: 3
1848
1865
  }, 8, ["class", "states", "cname"]);
1849
1866
  };
1850
1867
  }
1851
1868
  });
1852
- const _hoisted_1$3 = ["src"];
1869
+ const _hoisted_1$2 = ["src"];
1853
1870
  const _sfc_main$g = /* @__PURE__ */ defineComponent({
1854
1871
  __name: "b-webview",
1855
1872
  props: {
@@ -1868,7 +1885,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
1868
1885
  class: normalizeClass(scope.className),
1869
1886
  frameborder: "0",
1870
1887
  src: _ctx.src
1871
- }, null, 10, _hoisted_1$3)
1888
+ }, null, 10, _hoisted_1$2)
1872
1889
  ]),
1873
1890
  _: 1
1874
1891
  }, 8, ["class", "cname"]);
@@ -2240,9 +2257,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
2240
2257
  };
2241
2258
  }
2242
2259
  });
2243
- const _hoisted_1$2 = ["state"];
2244
- const _hoisted_2$1 = ["innerHTML"];
2245
- const _hoisted_3$1 = ["innerHTML"];
2260
+ const _hoisted_1$1 = ["state"];
2261
+ const _hoisted_2 = ["innerHTML"];
2262
+ const _hoisted_3 = ["innerHTML"];
2246
2263
  const _sfc_main$9 = /* @__PURE__ */ defineComponent({
2247
2264
  __name: "tabs-wid",
2248
2265
  props: {
@@ -2324,7 +2341,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
2324
2341
  slots.value.length === 0 && _ctx.tabStyle === "grid" ? {
2325
2342
  name: "default",
2326
2343
  fn: withCtx((scope) => [
2327
- createElementVNode("span", { state: scope }, null, 8, _hoisted_1$2)
2344
+ createElementVNode("span", { state: scope }, null, 8, _hoisted_1$1)
2328
2345
  ]),
2329
2346
  key: "0"
2330
2347
  } : slots.value.length === 0 && _ctx.tabStyle === "card" ? {
@@ -2375,7 +2392,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
2375
2392
  innerHTML: tabConts[selected.value],
2376
2393
  class: normalizeClass(_ctx.smooth ? `ani-fast ani-${flipDir.value}` : ""),
2377
2394
  onAnimationend: _cache[0] || (_cache[0] = ($event) => flipDir.value = "")
2378
- }, null, 42, _hoisted_2$1)
2395
+ }, null, 42, _hoisted_2)
2379
2396
  ]),
2380
2397
  _: 1
2381
2398
  })) : (openBlock(), createBlock(_sfc_main$u, {
@@ -2385,7 +2402,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
2385
2402
  default: withCtx(() => [
2386
2403
  createElementVNode("div", {
2387
2404
  innerHTML: _ctx.noDataNotic ?? "暂未选择标签"
2388
- }, null, 8, _hoisted_3$1)
2405
+ }, null, 8, _hoisted_3)
2389
2406
  ]),
2390
2407
  _: 1
2391
2408
  }))
@@ -2396,7 +2413,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
2396
2413
  };
2397
2414
  }
2398
2415
  });
2399
- const _hoisted_1$1 = ["multiple"];
2416
+ const _hoisted_1 = ["multiple"];
2400
2417
  const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2401
2418
  __name: "upload-wid",
2402
2419
  props: {
@@ -2487,124 +2504,293 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2487
2504
  ref: $uploader,
2488
2505
  onChange: trigerUpload,
2489
2506
  multiple: _ctx.multiple
2490
- }, null, 40, _hoisted_1$1))
2507
+ }, null, 40, _hoisted_1))
2491
2508
  ]),
2492
2509
  _: 3
2493
2510
  });
2494
2511
  };
2495
2512
  }
2496
2513
  });
2497
- let t;
2498
- const defaultStyle = `
2499
- position: fixed;
2500
- left: 0;
2501
- top: 0;
2502
- width: 100%;
2503
- height: 100%;
2504
- background-color: rgba(0,0,0,.2);
2505
- transition: all .3s;
2506
- display: flex;
2507
- align-items: center;
2508
- justify-content: center;
2509
- z-index: 99;
2510
- transition: all .3s;
2511
- `;
2512
- const hideStyle = defaultStyle + `
2513
- opacity: 0;
2514
- visibility: hidden;
2515
- `;
2516
- const showStyle = defaultStyle + `
2517
- opacity: 1;
2518
- visibility: visible;
2519
- `;
2520
- const showToast = (text, duration = 2e3, icon = "") => {
2521
- clearTimeout(t);
2522
- let bToast = document.querySelector(".b-toast");
2523
- let bToastIcon;
2524
- if (!bToast) {
2525
- bToast = document.createElement("div");
2526
- bToast.className = "b-toast";
2527
- const bToastInner = document.createElement("div");
2528
- bToast.appendChild(bToastInner);
2529
- bToastIcon = document.createElement("i");
2530
- bToastIcon.className = "b-toast-icon";
2531
- const bToastText = document.createElement("div");
2532
- bToastInner.appendChild(bToastIcon);
2533
- bToastInner.appendChild(bToastText);
2534
- bToastInner.style.cssText = `
2535
- color: #fff;
2536
- border-radius: 7px;
2537
- padding: 1.2rem 1.7rem;
2538
- text-align: center;
2539
- background-color: rgba(0,0,0,.9);
2540
- font-size: 1.27rem;
2541
- `;
2542
- bToast.style.cssText = hideStyle;
2543
- document.body.appendChild(bToast);
2514
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
2515
+ __name: "modal-wid",
2516
+ props: {
2517
+ visiable: { type: Boolean },
2518
+ matteColor: {},
2519
+ matteCloseForbid: { type: Boolean },
2520
+ closeEnable: { type: Boolean },
2521
+ roundEnable: { type: Boolean },
2522
+ pannelColor: {},
2523
+ dir: {},
2524
+ aniName: {}
2525
+ },
2526
+ emits: ["update:visiable", "opened", "closed"],
2527
+ setup(__props, { emit }) {
2528
+ const props = __props;
2529
+ const dir = computed(() => props.dir || "bottom");
2530
+ const dirStyle = computed(() => {
2531
+ let layout, pannal;
2532
+ switch (dir.value) {
2533
+ case "left":
2534
+ layout = "flex-4";
2535
+ pannal = `max-h round-r`;
2536
+ break;
2537
+ case "right":
2538
+ layout = "flex-6";
2539
+ pannal = `max-h round-l`;
2540
+ break;
2541
+ case "top":
2542
+ layout = "flex-2";
2543
+ pannal = `max-w round-b`;
2544
+ break;
2545
+ case "bottom":
2546
+ layout = "flex-8";
2547
+ pannal = `max-w round-t`;
2548
+ break;
2549
+ case "center":
2550
+ layout = "flex-5";
2551
+ pannal = ``;
2552
+ break;
2553
+ }
2554
+ return { layout, pannal };
2555
+ });
2556
+ const pannelStates = computed(() => {
2557
+ const [aniIn, aniOut] = props.aniName ?? ["", ""];
2558
+ return {
2559
+ left: {
2560
+ ani: aniIn || "ani-left-to-right"
2561
+ },
2562
+ right: {
2563
+ ani: aniIn || "ani-right-to-left"
2564
+ },
2565
+ top: {
2566
+ ani: aniIn || "ani-top-to-bottom"
2567
+ },
2568
+ bottom: {
2569
+ ani: aniIn || "ani-bottom-to-top"
2570
+ },
2571
+ center: {
2572
+ ani: aniIn || "ani-scale-fade-in"
2573
+ },
2574
+ leftBack: {
2575
+ ani: aniOut || "ani-left-to-right-reverse"
2576
+ },
2577
+ rightBack: {
2578
+ ani: aniOut || "ani-right-to-left-reverse"
2579
+ },
2580
+ topBack: {
2581
+ ani: aniOut || "ani-top-to-bottom-reverse"
2582
+ },
2583
+ bottomBack: {
2584
+ ani: aniOut || "ani-bottom-to-top-reverse"
2585
+ },
2586
+ centerBack: {
2587
+ ani: aniOut || "ani-scale-fade-out"
2588
+ }
2589
+ };
2590
+ });
2591
+ const aniDir = ref("");
2592
+ const closeState = ref(false);
2593
+ watchEffect(() => {
2594
+ if (props.visiable) {
2595
+ closeState.value = true;
2596
+ aniDir.value = dir.value;
2597
+ } else {
2598
+ aniDir.value = `${dir.value}Back`;
2599
+ }
2600
+ });
2601
+ const pannelAniend = (e) => {
2602
+ aniDir.value.indexOf("Back") === -1 && emit("opened", e);
2603
+ };
2604
+ const matteAniend = (e) => {
2605
+ if (getComputedStyle(e.target).opacity === "0" && e.propertyName === "visibility") {
2606
+ closeState.value = false;
2607
+ emit("closed", e);
2608
+ }
2609
+ };
2610
+ const hide = () => {
2611
+ emit("update:visiable", false);
2612
+ };
2613
+ return (_ctx, _cache) => {
2614
+ return openBlock(), createBlock(_sfc_main$u, {
2615
+ class: normalizeClass(`fixed t-0 l-0 max z-9 ${dirStyle.value.layout}`),
2616
+ state: closeState.value.toString(),
2617
+ states: {
2618
+ true: "alpha-1 visible",
2619
+ false: "alpha-0"
2620
+ }
2621
+ }, {
2622
+ default: withCtx(() => [
2623
+ createVNode(_sfc_main$s, {
2624
+ onOn_transend: matteAniend,
2625
+ onOn_click: _cache[0] || (_cache[0] = ($event) => !_ctx.matteCloseForbid && hide()),
2626
+ state: _ctx.visiable.toString(),
2627
+ states: {
2628
+ true: "alpha-1 visible",
2629
+ false: "alpha-0"
2630
+ },
2631
+ class: normalizeClass(`abs trans-fast max t-0 l-0 bg-color-${_ctx.matteColor || "C000000cc"}`)
2632
+ }, null, 8, ["state", "class"]),
2633
+ createVNode(_sfc_main$u, {
2634
+ class: normalizeClass(`${dirStyle.value.pannal} rel ani-mode-both ani-fast`),
2635
+ state: aniDir.value,
2636
+ "ani-end-clear": true,
2637
+ onOn_aniEnd: pannelAniend,
2638
+ states: pannelStates.value
2639
+ }, {
2640
+ default: withCtx(() => [
2641
+ renderSlot(_ctx.$slots, "custom", {}, () => [
2642
+ createVNode(_sfc_main$u, {
2643
+ class: normalizeClass(`bg-color-${_ctx.pannelColor || "light"} rel pad-2 ${_ctx.roundEnable ? "round-md" : ""} ${dirStyle.value.pannal}`)
2644
+ }, {
2645
+ default: withCtx(() => [
2646
+ !_ctx.closeEnable ? (openBlock(), createBlock(_sfc_main$s, {
2647
+ key: 0,
2648
+ class: "abs r-1 t-d7 color-mgray",
2649
+ onOn_click: hide
2650
+ }, {
2651
+ default: withCtx(() => [
2652
+ createVNode(_sfc_main$m, {
2653
+ icon: "fail",
2654
+ class: "fsize-2 lh-1d4"
2655
+ })
2656
+ ]),
2657
+ _: 1
2658
+ })) : createCommentVNode("", true),
2659
+ renderSlot(_ctx.$slots, "default")
2660
+ ]),
2661
+ _: 3
2662
+ }, 8, ["class"])
2663
+ ])
2664
+ ]),
2665
+ _: 3
2666
+ }, 8, ["class", "state", "states"])
2667
+ ]),
2668
+ _: 3
2669
+ }, 8, ["class", "state"]);
2670
+ };
2544
2671
  }
2545
- bToastIcon = bToast.querySelector(".b-toast-icon");
2546
- if (icon) {
2547
- bToastIcon.className = `b-toast-icon ico-${icon}`;
2548
- bToastIcon.style.cssText = `
2549
- color: #fff;
2550
- font-size: 3.2rem;
2551
- margin-bottom: 1.2rem;
2552
- `;
2553
- } else {
2554
- bToastIcon.style.display = "none";
2672
+ });
2673
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2674
+ __name: "toast-wid",
2675
+ props: {
2676
+ text: {},
2677
+ duration: {},
2678
+ icon: {},
2679
+ matteColor: {},
2680
+ extra: {}
2681
+ },
2682
+ emits: ["close"],
2683
+ setup(__props, { expose: __expose, emit }) {
2684
+ const props = __props;
2685
+ let t;
2686
+ const visiable = ref(false);
2687
+ const show = () => {
2688
+ visiable.value = true;
2689
+ if (props.duration === 0)
2690
+ return;
2691
+ t = setTimeout(() => {
2692
+ close();
2693
+ }, props.duration || 2e3);
2694
+ };
2695
+ const close = () => {
2696
+ visiable.value = false;
2697
+ };
2698
+ const closed = () => {
2699
+ clearTimeout(t);
2700
+ emit("close");
2701
+ };
2702
+ __expose({
2703
+ show,
2704
+ close
2705
+ });
2706
+ return (_ctx, _cache) => {
2707
+ return openBlock(), createBlock(_sfc_main$7, {
2708
+ visiable: visiable.value,
2709
+ "onUpdate:visiable": _cache[0] || (_cache[0] = ($event) => visiable.value = $event),
2710
+ "matte-close-forbid": true,
2711
+ onClosed: closed,
2712
+ "ani-name": ["ani-fade-in", "ani-fade-out"],
2713
+ dir: "center",
2714
+ "matte-color": _ctx.matteColor || "C00000044"
2715
+ }, {
2716
+ custom: withCtx(() => [
2717
+ renderSlot(_ctx.$slots, "default", {}, () => [
2718
+ createVNode(_sfc_main$u, { class: "round-md pad-v-1d2 pad-h-1d7 color-light fsize-1d27 bg-color-C000000ee flex-column lw-10 pcenter" }, {
2719
+ default: withCtx(() => {
2720
+ var _a;
2721
+ return [
2722
+ _ctx.icon ? (openBlock(), createBlock(_sfc_main$u, {
2723
+ key: 0,
2724
+ class: "mrg-b-1d2 fsize-3d2",
2725
+ states: {
2726
+ loading: {
2727
+ class: "ani-loop ani-slow",
2728
+ ani: "ani-rotate"
2729
+ }
2730
+ },
2731
+ state: ((_a = _ctx.extra) == null ? void 0 : _a.type) ?? ""
2732
+ }, {
2733
+ default: withCtx(() => [
2734
+ createVNode(_sfc_main$m, { icon: _ctx.icon }, null, 8, ["icon"])
2735
+ ]),
2736
+ _: 1
2737
+ }, 8, ["state"])) : createCommentVNode("", true),
2738
+ createVNode(_sfc_main$t, null, {
2739
+ default: withCtx(() => [
2740
+ createTextVNode(toDisplayString(_ctx.text), 1)
2741
+ ]),
2742
+ _: 1
2743
+ })
2744
+ ];
2745
+ }),
2746
+ _: 1
2747
+ })
2748
+ ])
2749
+ ]),
2750
+ _: 3
2751
+ }, 8, ["visiable", "matte-color"]);
2752
+ };
2753
+ }
2754
+ });
2755
+ let $toastContainer;
2756
+ const showToast = (text, duration = 2e3, icon = "", extra = {}) => {
2757
+ var _a, _b;
2758
+ if (!$toastContainer) {
2759
+ $toastContainer = document.createElement("div");
2760
+ $toastContainer.setAttribute("id", "BTXUI-toast");
2761
+ document.body.appendChild($toastContainer);
2555
2762
  }
2556
- bToast.childNodes[0].childNodes[1].innerText = text;
2557
- bToast.style.cssText = showStyle;
2558
- t = setTimeout(() => {
2559
- bToast.style.cssText = hideStyle;
2560
- }, duration);
2763
+ const vNode = createVNode(_sfc_main$6, {
2764
+ text,
2765
+ duration,
2766
+ icon,
2767
+ extra,
2768
+ onClose: () => {
2769
+ render(null, $toastContainer);
2770
+ }
2771
+ });
2772
+ render(vNode, $toastContainer);
2773
+ setTimeout((_b = (_a = vNode.component) == null ? void 0 : _a.exposed) == null ? void 0 : _b.show, 40);
2774
+ return vNode;
2775
+ };
2776
+ let cacheVNode;
2777
+ const cacheVNodeClose = () => {
2778
+ var _a, _b;
2779
+ (_b = (_a = cacheVNode.component) == null ? void 0 : _a.exposed) == null ? void 0 : _b.close();
2561
2780
  };
2562
2781
  const showLoadToast = (text = "数据加载中") => {
2563
- let bToast = document.querySelector(".b-load-toast");
2564
- if (!bToast) {
2565
- bToast = document.createElement("div");
2566
- bToast.className = "b-load-toast";
2567
- const bToastInner = document.createElement("div");
2568
- bToast.appendChild(bToastInner);
2569
- const bToastIcon = document.createElement("i");
2570
- bToastIcon.style.cssText = `
2571
- color: #fff;
2572
- font-size: 3.2rem;
2573
- margin-bottom: 1.2rem;
2574
- `;
2575
- const bToastText = document.createElement("div");
2576
- bToastInner.appendChild(bToastIcon);
2577
- bToastInner.appendChild(bToastText);
2578
- bToastInner.style.cssText = `
2579
- color: #fff;
2580
- border-radius: 7px;
2581
- padding: 1.2rem 1.7rem;
2582
- text-align: center;
2583
- background-color: rgba(0,0,0,.9);
2584
- min-width: 10rem;
2585
- font-size: 1.27rem;
2586
- `;
2587
- bToast.style.cssText = hideStyle;
2588
- document.body.appendChild(bToast);
2589
- }
2590
- bToast.childNodes[0].childNodes[0].className = "ico-load ani-rotate ani-loop ani-slow";
2591
- bToast.childNodes[0].childNodes[1].innerText = text;
2592
- bToast.style.cssText = showStyle;
2782
+ cacheVNode = showToast(text, 0, "load", {
2783
+ type: "loading"
2784
+ });
2593
2785
  };
2594
- const hideLoadToast = (_text, _icon) => {
2595
- clearTimeout(t);
2596
- let bToast = document.querySelector(".b-load-toast");
2597
- if (!bToast)
2598
- return;
2599
- if (_text) {
2600
- if (_icon)
2601
- bToast.childNodes[0].childNodes[0].className = `ico-${_icon}`;
2602
- bToast.childNodes[0].childNodes[1].innerText = _text;
2603
- setTimeout(() => {
2604
- bToast.style.cssText = hideStyle;
2605
- }, 1e3);
2786
+ const hideLoadToast = (text, icon) => {
2787
+ if (text) {
2788
+ cacheVNode.component.props.text = text;
2789
+ cacheVNode.component.props.icon = icon;
2790
+ cacheVNode.component.props.extra.type = "";
2791
+ setTimeout(cacheVNodeClose, 1e3);
2606
2792
  } else {
2607
- bToast.style.cssText = hideStyle;
2793
+ cacheVNodeClose();
2608
2794
  }
2609
2795
  };
2610
2796
  const upload = (extra) => {
@@ -2667,7 +2853,7 @@ const uploadImage = async (imageCompress, extra) => {
2667
2853
  };
2668
2854
  });
2669
2855
  };
2670
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
2856
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2671
2857
  __name: "img-upload-wid",
2672
2858
  props: {
2673
2859
  preview: {},
@@ -2725,7 +2911,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
2725
2911
  };
2726
2912
  }
2727
2913
  });
2728
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2914
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2729
2915
  __name: "app-wid",
2730
2916
  props: {
2731
2917
  path: {},
@@ -2855,519 +3041,92 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2855
3041
  };
2856
3042
  }
2857
3043
  });
2858
- const _hoisted_1 = { open: "true" };
2859
- const _hoisted_2 = /* @__PURE__ */ createElementVNode("div", null, "hello dialog", -1);
2860
- const _hoisted_3 = /* @__PURE__ */ createElementVNode("div", null, [
2861
- /* @__PURE__ */ createElementVNode("button", { onclick: "document.querySelector('dialog').close()" }, "关闭")
2862
- ], -1);
2863
- const _hoisted_4 = [
2864
- _hoisted_2,
2865
- _hoisted_3
2866
- ];
2867
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2868
- __name: "confirm-wid",
3044
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
3045
+ __name: "datetime-wid",
2869
3046
  props: {
2870
- colors: {}
3047
+ datetime: {},
3048
+ format: {},
3049
+ btnData: {},
3050
+ modalData: {}
2871
3051
  },
2872
- setup(__props, { expose: __expose }) {
2873
- __expose({
2874
- show: () => {
2875
- console.log(1111);
2876
- }
2877
- });
2878
- computed(() => {
2879
- let state = this.pannel.state;
2880
- return state === "success" || state === "fail" || state === "notic" || state === "loading" ? `ani_${state}` : state;
3052
+ emits: ["update:datetime", "getData"],
3053
+ setup(__props, { expose: __expose, emit }) {
3054
+ const props = __props;
3055
+ const state = ref(false);
3056
+ const modalData = reactive({
3057
+ roundEnable: true,
3058
+ ...props.modalData,
3059
+ dir: ""
2881
3060
  });
2882
- reactive({
2883
- text: "dgray",
2884
- pannel: "light",
2885
- success: "#e6fff2",
2886
- fail: "#f9f2f4",
2887
- notic: "#e6f5ff",
2888
- loading: "lgray",
2889
- ...this.colors
3061
+ const btnData = computed(() => {
3062
+ return {
3063
+ btnText: "确定",
3064
+ ...props.btnData
3065
+ };
2890
3066
  });
2891
- const $_close = (callback) => {
2892
- callback && callback();
2893
- $_cancel_bind_keyboard_event();
3067
+ const padZero = (time) => {
3068
+ const _time = time.toString();
3069
+ return _time.length === 1 ? `0${_time}` : _time;
2894
3070
  };
2895
- const $_cancel_bind_keyboard_event = () => {
2896
- window.removeEventListener("keyup", this.$_keyboard_enter);
3071
+ const curDate = computed(() => props.datetime);
3072
+ const setCurTime = (datetime) => {
3073
+ const date = new Date(datetime);
3074
+ curTime.y.val = date.getFullYear();
3075
+ curTime.m.val = date.getMonth() + 1;
3076
+ curTime.d.val = date.getDate();
3077
+ curTime.h.val = date.getHours();
3078
+ curTime.i.val = date.getMinutes();
3079
+ curTime.s.val = date.getSeconds();
2897
3080
  };
2898
- onMounted(() => {
3081
+ const curTime = reactive({
3082
+ y: {
3083
+ val: 0,
3084
+ show: false
3085
+ },
3086
+ m: {
3087
+ val: 0,
3088
+ show: false
3089
+ },
3090
+ d: {
3091
+ val: 0,
3092
+ show: false
3093
+ },
3094
+ h: {
3095
+ val: 0,
3096
+ show: false
3097
+ },
3098
+ i: {
3099
+ val: 0,
3100
+ show: false
3101
+ },
3102
+ s: {
3103
+ val: 0,
3104
+ show: false
3105
+ }
2899
3106
  });
2900
- onBeforeUnmount(() => {
2901
- $_close();
3107
+ watch(curDate, (val) => {
3108
+ setCurTime(val);
3109
+ }, {
3110
+ immediate: true
2902
3111
  });
2903
- return (_ctx, _cache) => {
2904
- return openBlock(), createElementBlock("dialog", _hoisted_1, _hoisted_4);
3112
+ const curOper = ref("");
3113
+ const twoSides = ref(false);
3114
+ const formatData = () => {
3115
+ const format = props.format || "y/m/d h:i:s";
3116
+ const data = format.split(" ");
3117
+ twoSides.value = data.length > 1;
3118
+ data.forEach((d) => {
3119
+ d.split(/\/|-|:/g).forEach((_d) => {
3120
+ if (!curOper.value)
3121
+ curOper.value = _d;
3122
+ curTime[_d].show = true;
3123
+ });
3124
+ });
2905
3125
  };
2906
- }
2907
- });
2908
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2909
- __name: "toast-wid",
2910
- props: {
2911
- matteColor: {}
2912
- },
2913
- setup(__props, { expose: __expose }) {
2914
- const visiable = ref(false);
2915
- const show = (duration) => {
2916
- visiable.value = true;
2917
- setTimeout(() => {
2918
- visiable.value = false;
2919
- }, duration || 2e3);
2920
- };
2921
- __expose({
2922
- show
2923
- });
2924
- return (_ctx, _cache) => {
2925
- const _component_b_view = resolveComponent("b-view");
2926
- return openBlock(), createBlock(_component_b_view, {
2927
- class: normalizeClass(`fixed max bg-color-${_ctx.matteColor || "rgba_0_0_0_d2"} l-0 t-0 flex-5`),
2928
- state: visiable.value,
2929
- states: {
2930
- true: "alpha-1 visible",
2931
- false: "alpha-0"
2932
- }
2933
- }, {
2934
- default: withCtx(() => [
2935
- createVNode(_component_b_view, {
2936
- class: "trans-fast",
2937
- state: visiable.value,
2938
- states: {
2939
- true: "alpha-1 visible",
2940
- false: "alpha-0"
2941
- }
2942
- }, {
2943
- default: withCtx(() => [
2944
- renderSlot(_ctx.$slots, "default")
2945
- ]),
2946
- _: 3
2947
- }, 8, ["state"])
2948
- ]),
2949
- _: 3
2950
- }, 8, ["class", "state"]);
2951
- };
2952
- }
2953
- });
2954
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2955
- __name: "modal-wid",
2956
- props: {
2957
- visiable: { type: Boolean },
2958
- matteColor: {},
2959
- closeEnable: { type: Boolean },
2960
- roundEnable: { type: Boolean },
2961
- pannelColor: {},
2962
- dir: {}
2963
- },
2964
- emits: ["update:visiable", "opened", "closed"],
2965
- setup(__props, { emit }) {
2966
- const props = __props;
2967
- const dir = computed(() => props.dir || "bottom");
2968
- const dirStyle = computed(() => {
2969
- let layout, pannal;
2970
- switch (dir.value) {
2971
- case "left":
2972
- layout = "flex-4";
2973
- pannal = `max-h round-r`;
2974
- break;
2975
- case "right":
2976
- layout = "flex-6";
2977
- pannal = `max-h round-l`;
2978
- break;
2979
- case "top":
2980
- layout = "flex-2";
2981
- pannal = `max-w round-b`;
2982
- break;
2983
- case "bottom":
2984
- layout = "flex-8";
2985
- pannal = `max-w round-t`;
2986
- break;
2987
- case "center":
2988
- layout = "flex-5";
2989
- pannal = ``;
2990
- break;
2991
- }
2992
- return { layout, pannal };
2993
- });
2994
- const aniDir = ref("");
2995
- const closeState = ref(false);
2996
- watchEffect(() => {
2997
- if (props.visiable) {
2998
- closeState.value = true;
2999
- aniDir.value = dir.value;
3000
- } else {
3001
- aniDir.value = `${dir.value}Back`;
3002
- }
3003
- });
3004
- const pannelAniend = (e) => {
3005
- aniDir.value.indexOf("Back") === -1 && emit("opened", e);
3006
- };
3007
- const matteAniend = (e) => {
3008
- if (getComputedStyle(e.target).opacity === "0" && e.propertyName === "visibility") {
3009
- closeState.value = false;
3010
- emit("closed", e);
3011
- }
3012
- };
3013
- const hide = () => {
3014
- emit("update:visiable", false);
3015
- };
3016
- return (_ctx, _cache) => {
3017
- const _component_b_hot = resolveComponent("b-hot");
3018
- const _component_b_icon = resolveComponent("b-icon");
3019
- const _component_b_view = resolveComponent("b-view");
3020
- return openBlock(), createBlock(_component_b_view, {
3021
- class: normalizeClass(`fixed t-0 l-0 max z-9 ${dirStyle.value.layout}`),
3022
- state: closeState.value,
3023
- states: {
3024
- true: "alpha-1 visible",
3025
- false: "alpha-0"
3026
- }
3027
- }, {
3028
- default: withCtx(() => [
3029
- createVNode(_component_b_hot, {
3030
- onOn_transend: matteAniend,
3031
- onOn_click: hide,
3032
- state: _ctx.visiable,
3033
- states: {
3034
- true: "alpha-1 visible",
3035
- false: "alpha-0"
3036
- },
3037
- class: normalizeClass(`abs trans-fast max t-0 l-0 bg-color-${_ctx.matteColor || "C000000cc"}`)
3038
- }, null, 8, ["state", "class"]),
3039
- createVNode(_component_b_view, {
3040
- class: normalizeClass(`${dirStyle.value.pannal} rel ani-mode-both`),
3041
- state: aniDir.value,
3042
- "ani-end-clear": true,
3043
- onOn_aniEnd: pannelAniend,
3044
- states: {
3045
- left: {
3046
- ani: "ani-left-to-right"
3047
- },
3048
- right: {
3049
- ani: "ani-right-to-left"
3050
- },
3051
- top: {
3052
- ani: "ani-top-to-bottom"
3053
- },
3054
- bottom: {
3055
- ani: "ani-bottom-to-top"
3056
- },
3057
- center: {
3058
- ani: "ani-scale-fade-in"
3059
- },
3060
- leftBack: {
3061
- ani: "ani-left-to-right-reverse"
3062
- },
3063
- rightBack: {
3064
- ani: "ani-right-to-left-reverse"
3065
- },
3066
- topBack: {
3067
- ani: "ani-top-to-bottom-reverse"
3068
- },
3069
- bottomBack: {
3070
- ani: "ani-bottom-to-top-reverse"
3071
- },
3072
- centerBack: {
3073
- ani: "ani-scale-fade-out"
3074
- }
3075
- }
3076
- }, {
3077
- default: withCtx(() => [
3078
- _ctx.$slots.custom ? renderSlot(_ctx.$slots, "custom", { key: 0 }) : (openBlock(), createBlock(_component_b_view, {
3079
- key: 1,
3080
- class: normalizeClass(`bg-color-${_ctx.pannelColor || "light"} rel pad-2 ${_ctx.roundEnable ? "round-md" : ""} ${dirStyle.value.pannal}`)
3081
- }, {
3082
- default: withCtx(() => [
3083
- !_ctx.closeEnable ? (openBlock(), createBlock(_component_b_hot, {
3084
- key: 0,
3085
- class: "abs r-1 t-d7 color-mgray",
3086
- onOn_click: hide
3087
- }, {
3088
- default: withCtx(() => [
3089
- createVNode(_component_b_icon, {
3090
- icon: "fail",
3091
- class: "fsize-2 lh-1d4"
3092
- })
3093
- ]),
3094
- _: 1
3095
- })) : createCommentVNode("", true),
3096
- renderSlot(_ctx.$slots, "default")
3097
- ]),
3098
- _: 3
3099
- }, 8, ["class"]))
3100
- ]),
3101
- _: 3
3102
- }, 8, ["class", "state"])
3103
- ]),
3104
- _: 3
3105
- }, 8, ["class", "state"]);
3106
- };
3107
- }
3108
- });
3109
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
3110
- __name: "content-node-wid",
3111
- props: {
3112
- dataTree: {},
3113
- gap: {},
3114
- indent: {},
3115
- hover: {},
3116
- active: {}
3117
- },
3118
- emits: ["on_select"],
3119
- setup(__props, { emit }) {
3120
- const props = __props;
3121
- const dataTree = ref(props.dataTree || []);
3122
- const selected = inject("selected");
3123
- const gap = computed(() => {
3124
- return props.gap || "d7";
3125
- });
3126
- const indent = computed(() => {
3127
- return props.indent || "3";
3128
- });
3129
- const setIndex = (level) => {
3130
- return (level * parseFloat(indent.value.replace("d", ".")) + parseFloat(gap.value.replace("d", "."))).toString().replace(".", "d");
3131
- };
3132
- const dealSlotData = (item) => {
3133
- const { parent, children, ...extra } = item;
3134
- return extra;
3135
- };
3136
- return (_ctx, _cache) => {
3137
- const _component_b_text = resolveComponent("b-text");
3138
- const _component_content_node_wid = resolveComponent("content-node-wid", true);
3139
- return openBlock(true), createElementBlock(Fragment, null, renderList(dataTree.value, (item) => {
3140
- return openBlock(), createBlock(_sfc_main$u, {
3141
- state: `id-${item.id}`,
3142
- key: item.id
3143
- }, {
3144
- default: withCtx(() => {
3145
- var _a;
3146
- return [
3147
- createVNode(_sfc_main$s, {
3148
- cname: `${item.id}-${Math.random()}`,
3149
- class: normalizeClass(`flex-4 pad-v-${gap.value} pad-l-${setIndex(item.level)}`),
3150
- hover: _ctx.hover,
3151
- states: {
3152
- true: `${_ctx.active ? _ctx.active : ""}`,
3153
- false: ""
3154
- },
3155
- state: (((_a = unref(selected)) == null ? void 0 : _a.findIndex((data) => data.id === item.id)) > -1).toString()
3156
- }, {
3157
- default: withCtx(() => [
3158
- item.children && item.children.length ? (openBlock(), createBlock(_sfc_main$m, {
3159
- key: 0,
3160
- class: "mrg-r-d4",
3161
- state: item.spread ? "content-wid-spread" : "content-wid-collapse",
3162
- icon: "arrow-right"
3163
- }, null, 8, ["state"])) : createCommentVNode("", true),
3164
- renderSlot(_ctx.$slots, "default", {
3165
- dataItem: dealSlotData(item)
3166
- }, () => [
3167
- createVNode(_component_b_text, null, {
3168
- default: withCtx(() => [
3169
- createTextVNode(toDisplayString(item.text), 1)
3170
- ]),
3171
- _: 2
3172
- }, 1024)
3173
- ])
3174
- ]),
3175
- _: 2
3176
- }, 1032, ["cname", "class", "hover", "states", "state"]),
3177
- item.children && item.children.length ? (openBlock(), createBlock(_sfc_main$u, {
3178
- key: 0,
3179
- states: {
3180
- "show": "show",
3181
- "hide": "hide"
3182
- },
3183
- state: item.spread ? "show" : "hide"
3184
- }, {
3185
- default: withCtx(() => [
3186
- createVNode(_component_content_node_wid, normalizeProps(guardReactiveProps({ ...props, dataTree: item.children })), createSlots({ _: 2 }, [
3187
- _ctx.$slots.default ? {
3188
- name: "default",
3189
- fn: withCtx((scope) => [
3190
- renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(scope)))
3191
- ]),
3192
- key: "0"
3193
- } : void 0
3194
- ]), 1040)
3195
- ]),
3196
- _: 2
3197
- }, 1032, ["state"])) : createCommentVNode("", true)
3198
- ];
3199
- }),
3200
- _: 2
3201
- }, 1032, ["state"]);
3202
- }), 128);
3203
- };
3204
- }
3205
- });
3206
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
3207
- __name: "content-wid",
3208
- props: {
3209
- dataTree: {},
3210
- gap: {},
3211
- indent: {},
3212
- hover: {},
3213
- active: {}
3214
- },
3215
- emits: ["on_select"],
3216
- setup(__props, { emit }) {
3217
- const props = __props;
3218
- let prefix = 0;
3219
- const flatDataTree = reactive([]);
3220
- const indexDataTree = reactive({});
3221
- const dataTree = ref(props.dataTree);
3222
- const flatState = ref(false);
3223
- const flatData = () => {
3224
- const traverse = (items, parent, level = 0) => {
3225
- for (const item of items) {
3226
- item.level = level;
3227
- item.prefix = prefix++;
3228
- if (parent)
3229
- item.parent = parent;
3230
- if (item.children)
3231
- item.spread = item.spread || false;
3232
- flatDataTree.push(item);
3233
- indexDataTree[item.id] = item;
3234
- if (item.children && item.children.length > 0) {
3235
- traverse(item.children, item, level + 1);
3236
- }
3237
- }
3238
- };
3239
- traverse(dataTree.value);
3240
- };
3241
- const selected = ref([]);
3242
- onBeforeMount(() => {
3243
- provide("selected", selected.value);
3244
- });
3245
- onMounted(() => {
3246
- flatData();
3247
- flatState.value = true;
3248
- });
3249
- const select = (e) => {
3250
- var _a, _b;
3251
- const x = e.clientX;
3252
- const y = e.clientY;
3253
- let element = document.elementFromPoint(x, y);
3254
- while (!(((_a = element == null ? void 0 : element.getAttribute("state")) == null ? void 0 : _a.indexOf("id-")) === 0)) {
3255
- element = element == null ? void 0 : element.parentElement;
3256
- }
3257
- const data = indexDataTree[(_b = element == null ? void 0 : element.getAttribute("state")) == null ? void 0 : _b.substring(3)];
3258
- selected.value[0] = data;
3259
- if (data.spread !== void 0)
3260
- data.spread = !data.spread;
3261
- emit("on_select", data);
3262
- };
3263
- return (_ctx, _cache) => {
3264
- return openBlock(), createBlock(_sfc_main$s, {
3265
- onOn_click: select,
3266
- "event-proxy": true
3267
- }, {
3268
- default: withCtx(() => [
3269
- flatState.value ? (openBlock(), createBlock(_sfc_main$2, normalizeProps(mergeProps({ key: 0 }, { ...props, dataTree: dataTree.value })), createSlots({ _: 2 }, [
3270
- _ctx.$slots.default ? {
3271
- name: "default",
3272
- fn: withCtx((scope) => [
3273
- renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(scope["dataItem"])))
3274
- ]),
3275
- key: "0"
3276
- } : void 0
3277
- ]), 1040)) : createCommentVNode("", true)
3278
- ]),
3279
- _: 3
3280
- });
3281
- };
3282
- }
3283
- });
3284
- const contentWid_vue_vue_type_style_index_0_lang = "";
3285
- const _sfc_main = /* @__PURE__ */ defineComponent({
3286
- __name: "datetime-wid",
3287
- props: {
3288
- datetime: {},
3289
- format: {},
3290
- btnData: {},
3291
- modalData: {}
3292
- },
3293
- emits: ["update:datetime", "getData"],
3294
- setup(__props, { expose: __expose, emit }) {
3295
- const props = __props;
3296
- const state = ref(false);
3297
- const modalData = reactive({
3298
- roundEnable: true,
3299
- ...props.modalData,
3300
- dir: ""
3301
- });
3302
- const btnData = computed(() => {
3303
- return {
3304
- btnText: "确定",
3305
- ...props.btnData
3306
- };
3307
- });
3308
- const padZero = (time) => {
3309
- const _time = time.toString();
3310
- return _time.length === 1 ? `0${_time}` : _time;
3311
- };
3312
- const curDate = computed(() => props.datetime);
3313
- const setCurTime = (datetime) => {
3314
- const date = new Date(datetime);
3315
- curTime.y.val = date.getFullYear();
3316
- curTime.m.val = date.getMonth() + 1;
3317
- curTime.d.val = date.getDate();
3318
- curTime.h.val = date.getHours();
3319
- curTime.i.val = date.getMinutes();
3320
- curTime.s.val = date.getSeconds();
3321
- };
3322
- const curTime = reactive({
3323
- y: {
3324
- val: 0,
3325
- show: false
3326
- },
3327
- m: {
3328
- val: 0,
3329
- show: false
3330
- },
3331
- d: {
3332
- val: 0,
3333
- show: false
3334
- },
3335
- h: {
3336
- val: 0,
3337
- show: false
3338
- },
3339
- i: {
3340
- val: 0,
3341
- show: false
3342
- },
3343
- s: {
3344
- val: 0,
3345
- show: false
3346
- }
3347
- });
3348
- watch(curDate, (val) => {
3349
- setCurTime(val);
3350
- }, {
3351
- immediate: true
3352
- });
3353
- const curOper = ref("");
3354
- const twoSides = ref(false);
3355
- const formatData = () => {
3356
- const format = props.format || "y/m/d h:i:s";
3357
- const data = format.split(" ");
3358
- twoSides.value = data.length > 1;
3359
- data.forEach((d) => {
3360
- d.split(/\/|-|:/g).forEach((_d) => {
3361
- if (!curOper.value)
3362
- curOper.value = _d;
3363
- curTime[_d].show = true;
3364
- });
3365
- });
3366
- };
3367
- const init = () => {
3368
- const { availWidth, availHeight } = window.screen;
3369
- modalData.dir = availWidth / availHeight > 1 ? "center" : "bottom";
3370
- formatData();
3126
+ const init = () => {
3127
+ const { availWidth, availHeight } = window.screen;
3128
+ modalData.dir = availWidth / availHeight > 1 ? "center" : "bottom";
3129
+ formatData();
3371
3130
  };
3372
3131
  onMounted(init);
3373
3132
  const datetimeMap = {
@@ -3493,7 +3252,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3493
3252
  ]),
3494
3253
  _: 3
3495
3254
  }),
3496
- modalData.dir ? (openBlock(), createBlock(_sfc_main$3, mergeProps({
3255
+ modalData.dir ? (openBlock(), createBlock(_sfc_main$7, mergeProps({
3497
3256
  key: 0,
3498
3257
  visiable: state.value,
3499
3258
  "onUpdate:visiable": _cache[6] || (_cache[6] = ($event) => state.value = $event)
@@ -3621,77 +3380,537 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3621
3380
  })) : createCommentVNode("", true),
3622
3381
  curTime.s.show ? (openBlock(), createBlock(_sfc_main$u, { key: 6 }, {
3623
3382
  default: withCtx(() => [
3624
- createVNode(_component_b_hot, {
3625
- onOn_click: _cache[5] || (_cache[5] = ($event) => curOper.value = "s"),
3626
- cname: "s",
3627
- state: curOper.value,
3628
- states: { s: "color-green" }
3629
- }, {
3630
- default: withCtx(() => [
3631
- createTextVNode(toDisplayString(padZero(curTime.s.val)), 1)
3632
- ]),
3633
- _: 1
3634
- }, 8, ["state"]),
3635
- createVNode(_component_b_text, { class: "pad-h-d4 alpha-d4" }, {
3383
+ createVNode(_component_b_hot, {
3384
+ onOn_click: _cache[5] || (_cache[5] = ($event) => curOper.value = "s"),
3385
+ cname: "s",
3386
+ state: curOper.value,
3387
+ states: { s: "color-green" }
3388
+ }, {
3389
+ default: withCtx(() => [
3390
+ createTextVNode(toDisplayString(padZero(curTime.s.val)), 1)
3391
+ ]),
3392
+ _: 1
3393
+ }, 8, ["state"]),
3394
+ createVNode(_component_b_text, { class: "pad-h-d4 alpha-d4" }, {
3395
+ default: withCtx(() => [
3396
+ createTextVNode("秒")
3397
+ ]),
3398
+ _: 1
3399
+ })
3400
+ ]),
3401
+ _: 1
3402
+ })) : createCommentVNode("", true)
3403
+ ]),
3404
+ _: 1
3405
+ }),
3406
+ createVNode(_sfc_main$u, { class: "flex" }, {
3407
+ default: withCtx(() => [
3408
+ createVNode(_component_b_list, {
3409
+ class: "grow-1 h-17 bg-color-neutral mrg-v-1 round-md pad-1",
3410
+ scroll: { x: "auto", y: "auto" }
3411
+ }, {
3412
+ default: withCtx(() => [
3413
+ createVNode(_component_b_hot, {
3414
+ onOn_click: selectDateTime,
3415
+ ref_key: "$list",
3416
+ ref: $list
3417
+ }, {
3418
+ default: withCtx(() => [
3419
+ (openBlock(true), createElementBlock(Fragment, null, renderList(options.value, (opt) => {
3420
+ return openBlock(), createBlock(_sfc_main$u, {
3421
+ state: opt,
3422
+ hover: "bg-color-neutral",
3423
+ class: "h-3 pad-h-1 lh-3-rem flex round-sm alpha-d7"
3424
+ }, {
3425
+ default: withCtx(() => [
3426
+ createTextVNode(toDisplayString(padZero(opt)) + " ", 1),
3427
+ createVNode(_component_b_text, { class: "pad-l-d4 alpha-d4" }, {
3428
+ default: withCtx(() => [
3429
+ createTextVNode(toDisplayString(datetimeMap[curOper.value]), 1)
3430
+ ]),
3431
+ _: 1
3432
+ })
3433
+ ]),
3434
+ _: 2
3435
+ }, 1032, ["state"]);
3436
+ }), 256))
3437
+ ]),
3438
+ _: 1
3439
+ }, 512)
3440
+ ]),
3441
+ _: 1
3442
+ })
3443
+ ]),
3444
+ _: 1
3445
+ }),
3446
+ createVNode(_component_btn_wid, mergeProps(btnData.value, { onOn_click: ok }), null, 16)
3447
+ ]),
3448
+ _: 1
3449
+ }, 16, ["visiable"])) : createCommentVNode("", true)
3450
+ ], 64);
3451
+ };
3452
+ }
3453
+ });
3454
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
3455
+ __name: "price-wid",
3456
+ props: {
3457
+ price: {},
3458
+ matteColor: {},
3459
+ matteCloseForbid: { type: Boolean },
3460
+ theme: {}
3461
+ },
3462
+ emits: ["sendPrice", "update:price"],
3463
+ setup(__props, { expose: __expose, emit }) {
3464
+ const props = __props;
3465
+ const theme2 = reactive({
3466
+ dir: "",
3467
+ pannel: "lgray",
3468
+ text: "dgray",
3469
+ btn: {
3470
+ normal: "light",
3471
+ active: "neutral"
3472
+ },
3473
+ btn2: {
3474
+ normal: "yellow",
3475
+ active: "yellow"
3476
+ },
3477
+ ...props.theme
3478
+ });
3479
+ onMounted(() => {
3480
+ const { availWidth, availHeight } = window.screen;
3481
+ theme2.dir = availWidth / availHeight > 1 ? "center" : "bottom";
3482
+ });
3483
+ const price = ref(props.price.toString());
3484
+ const state = ref(false);
3485
+ const selPrice = (e) => {
3486
+ const x = e.clientX;
3487
+ const y = e.clientY;
3488
+ let element = document.elementFromPoint(x, y);
3489
+ let priceStr = price.value || "";
3490
+ switch (element.getAttribute("state")) {
3491
+ case ".":
3492
+ if (priceStr === "") {
3493
+ priceStr = "0.";
3494
+ } else if (priceStr.indexOf(".") === -1) {
3495
+ priceStr += ".";
3496
+ }
3497
+ break;
3498
+ case "delete":
3499
+ priceStr = priceStr.slice(0, -1);
3500
+ break;
3501
+ case "ok":
3502
+ sendPrice();
3503
+ break;
3504
+ default:
3505
+ const price2 = priceStr.split(".");
3506
+ const decimal = price2[1];
3507
+ const integer = price2[0];
3508
+ if (priceStr === "0") {
3509
+ priceStr = element.innerText;
3510
+ } else if ((integer.length < 7 || priceStr[7] === ".") && ((decimal == null ? void 0 : decimal.length) < 2 || !decimal && (element.innerText === "0" && priceStr !== "0" || element.innerText !== "0"))) {
3511
+ priceStr += element.innerText;
3512
+ }
3513
+ }
3514
+ price.value = priceStr;
3515
+ };
3516
+ const sendPrice = () => {
3517
+ if (!price.value) {
3518
+ showToast("需先填写金额", 2e3, "warning");
3519
+ return;
3520
+ }
3521
+ const priceNum = parseFloat(price.value);
3522
+ if (priceNum <= 0) {
3523
+ showToast("输入金额错误", 2e3, "warning");
3524
+ return;
3525
+ }
3526
+ emit("sendPrice", priceNum);
3527
+ emit("update:price", priceNum);
3528
+ nextTick(hide);
3529
+ };
3530
+ const show = () => {
3531
+ state.value = true;
3532
+ };
3533
+ const hide = () => {
3534
+ state.value = false;
3535
+ };
3536
+ const clear = () => {
3537
+ price.value = "";
3538
+ };
3539
+ __expose({
3540
+ show,
3541
+ hide,
3542
+ clear
3543
+ });
3544
+ return (_ctx, _cache) => {
3545
+ const _component_b_hot = resolveComponent("b-hot");
3546
+ const _component_b_text = resolveComponent("b-text");
3547
+ const _component_b_input = resolveComponent("b-input");
3548
+ const _component_b_col = resolveComponent("b-col");
3549
+ const _component_b_row = resolveComponent("b-row");
3550
+ return openBlock(), createElementBlock(Fragment, null, [
3551
+ createVNode(_component_b_hot, { onOn_click: show }, {
3552
+ default: withCtx(() => [
3553
+ renderSlot(_ctx.$slots, "default")
3554
+ ]),
3555
+ _: 3
3556
+ }),
3557
+ theme2.dir ? (openBlock(), createBlock(_sfc_main$7, {
3558
+ key: 0,
3559
+ visiable: state.value,
3560
+ "onUpdate:visiable": _cache[1] || (_cache[1] = ($event) => state.value = $event),
3561
+ dir: theme2.dir,
3562
+ "matte-color": _ctx.matteColor,
3563
+ "matte-close-forbid": _ctx.matteCloseForbid
3564
+ }, {
3565
+ custom: withCtx(() => [
3566
+ createVNode(_sfc_main$u, {
3567
+ class: normalizeClass(`${theme2.dir === "center" ? "w-30 round-md fsize-1d3" : "fsize-1d6"} bg-color-${theme2.pannel} color-${theme2.text}`)
3568
+ }, {
3569
+ default: withCtx(() => [
3570
+ _ctx.$slots.screen ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createBlock(_sfc_main$u, {
3571
+ key: 1,
3572
+ class: "flex-4 no-wrap pad-1d4"
3573
+ }, {
3574
+ default: withCtx(() => [
3575
+ createVNode(_component_b_text, { class: "fsize-2d4 bold alpha-d4" }, {
3636
3576
  default: withCtx(() => [
3637
- createTextVNode("")
3577
+ createTextVNode("")
3638
3578
  ]),
3639
3579
  _: 1
3640
- })
3580
+ }),
3581
+ createVNode(_component_b_input, {
3582
+ text: price.value,
3583
+ "onUpdate:text": _cache[0] || (_cache[0] = ($event) => price.value = $event),
3584
+ type: "text",
3585
+ readonly: true,
3586
+ class: normalizeClass(`grow-1 bg-color-none fsize-3 bolder-500 line-none color-${theme2.text}`)
3587
+ }, null, 8, ["text", "class"])
3641
3588
  ]),
3642
3589
  _: 1
3643
- })) : createCommentVNode("", true)
3644
- ]),
3645
- _: 1
3646
- }),
3647
- createVNode(_sfc_main$u, { class: "flex" }, {
3648
- default: withCtx(() => [
3649
- createVNode(_component_b_list, {
3650
- class: "grow-1 h-17 bg-color-neutral mrg-v-1 round-md pad-1",
3651
- scroll: { x: "auto", y: "auto" }
3652
- }, {
3590
+ })),
3591
+ createVNode(_sfc_main$u, { class: "pad-b-2 bolder-500" }, {
3653
3592
  default: withCtx(() => [
3654
- createVNode(_component_b_hot, {
3655
- onOn_click: selectDateTime,
3656
- ref_key: "$list",
3657
- ref: $list
3658
- }, {
3593
+ createVNode(_component_b_hot, { onOn_click: selPrice }, {
3659
3594
  default: withCtx(() => [
3660
- (openBlock(true), createElementBlock(Fragment, null, renderList(options.value, (opt) => {
3661
- return openBlock(), createBlock(_sfc_main$u, {
3662
- state: opt,
3663
- hover: "bg-color-neutral",
3664
- class: "h-3 pad-h-1 lh-3-rem flex round-sm alpha-d7"
3665
- }, {
3666
- default: withCtx(() => [
3667
- createTextVNode(toDisplayString(padZero(opt)) + " ", 1),
3668
- createVNode(_component_b_text, { class: "pad-l-d4 alpha-d4" }, {
3595
+ createVNode(_component_b_row, { gap: ".7" }, {
3596
+ default: withCtx(() => [
3597
+ (openBlock(), createElementBlock(Fragment, null, renderList(3, (num) => {
3598
+ return createVNode(_component_b_col, { span: 3 }, {
3669
3599
  default: withCtx(() => [
3670
- createTextVNode(toDisplayString(datetimeMap[curOper.value]), 1)
3600
+ createVNode(_component_b_hot, {
3601
+ class: normalizeClass(`bg-color-${theme2.btn.normal} flex-5 round-sm h-4d2`),
3602
+ active: `bg-color-${theme2.btn.active}`,
3603
+ state: num
3604
+ }, {
3605
+ default: withCtx(() => [
3606
+ createTextVNode(toDisplayString(num), 1)
3607
+ ]),
3608
+ _: 2
3609
+ }, 1032, ["class", "active", "state"])
3671
3610
  ]),
3672
- _: 1
3673
- })
3674
- ]),
3675
- _: 2
3676
- }, 1032, ["state"]);
3677
- }), 256))
3611
+ _: 2
3612
+ }, 1024);
3613
+ }), 64)),
3614
+ createVNode(_component_b_col, { span: 3 }, {
3615
+ default: withCtx(() => [
3616
+ createVNode(_component_b_hot, {
3617
+ class: normalizeClass(`bg-color-${theme2.btn.normal} flex-5 round-sm h-4d2`),
3618
+ active: `bg-color-${theme2.btn.active}`,
3619
+ state: "delete"
3620
+ }, {
3621
+ default: withCtx(() => [
3622
+ _ctx.$slots.delete ? renderSlot(_ctx.$slots, "delete", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
3623
+ createTextVNode("删除")
3624
+ ], 64))
3625
+ ]),
3626
+ _: 3
3627
+ }, 8, ["class", "active"])
3628
+ ]),
3629
+ _: 3
3630
+ }),
3631
+ (openBlock(), createElementBlock(Fragment, null, renderList(3, (num) => {
3632
+ return createVNode(_component_b_col, { span: 3 }, {
3633
+ default: withCtx(() => [
3634
+ createVNode(_component_b_hot, {
3635
+ class: normalizeClass(`bg-color-${theme2.btn.normal} flex-5 round-sm h-4d2`),
3636
+ active: `bg-color-${theme2.btn.active}`,
3637
+ state: num
3638
+ }, {
3639
+ default: withCtx(() => [
3640
+ createTextVNode(toDisplayString(num + 3), 1)
3641
+ ]),
3642
+ _: 2
3643
+ }, 1032, ["class", "active", "state"])
3644
+ ]),
3645
+ _: 2
3646
+ }, 1024);
3647
+ }), 64)),
3648
+ createVNode(_component_b_col, { span: 3 }),
3649
+ (openBlock(), createElementBlock(Fragment, null, renderList(3, (num) => {
3650
+ return createVNode(_component_b_col, { span: 3 }, {
3651
+ default: withCtx(() => [
3652
+ createVNode(_component_b_hot, {
3653
+ class: normalizeClass(`bg-color-${theme2.btn.normal} flex-5 round-sm h-4d2`),
3654
+ active: `bg-color-${theme2.btn.active}`,
3655
+ state: num
3656
+ }, {
3657
+ default: withCtx(() => [
3658
+ createTextVNode(toDisplayString(num + 6), 1)
3659
+ ]),
3660
+ _: 2
3661
+ }, 1032, ["class", "active", "state"])
3662
+ ]),
3663
+ _: 2
3664
+ }, 1024);
3665
+ }), 64)),
3666
+ createVNode(_component_b_col, { span: 3 }),
3667
+ createVNode(_component_b_col, { span: 6 }, {
3668
+ default: withCtx(() => [
3669
+ createVNode(_component_b_hot, {
3670
+ class: normalizeClass(`bg-color-${theme2.btn.normal} flex-5 round-sm h-4d2`),
3671
+ active: `bg-color-${theme2.btn.active}`,
3672
+ state: "0"
3673
+ }, {
3674
+ default: withCtx(() => [
3675
+ createTextVNode("0")
3676
+ ]),
3677
+ _: 1
3678
+ }, 8, ["class", "active"])
3679
+ ]),
3680
+ _: 1
3681
+ }),
3682
+ createVNode(_component_b_col, { span: 3 }, {
3683
+ default: withCtx(() => [
3684
+ createVNode(_component_b_hot, {
3685
+ class: normalizeClass(`bg-color-${theme2.btn.normal} flex-5 round-sm h-4d2`),
3686
+ active: `bg-color-${theme2.btn.active}`,
3687
+ state: "."
3688
+ }, {
3689
+ default: withCtx(() => [
3690
+ createTextVNode(".")
3691
+ ]),
3692
+ _: 1
3693
+ }, 8, ["class", "active"])
3694
+ ]),
3695
+ _: 1
3696
+ }),
3697
+ createVNode(_component_b_col, { span: 3 }, {
3698
+ default: withCtx(() => [
3699
+ createVNode(_sfc_main$u, { class: "rel h-4d2" }, {
3700
+ default: withCtx(() => [
3701
+ createVNode(_component_b_hot, {
3702
+ class: normalizeClass(`abs b-0 h-14 max-w bg-color-${theme2.btn2.normal} flex-5 round-sm`),
3703
+ active: `bg-color-${theme2.btn2.active}`,
3704
+ state: "ok"
3705
+ }, {
3706
+ default: withCtx(() => [
3707
+ _ctx.$slots.ok ? renderSlot(_ctx.$slots, "ok", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
3708
+ createTextVNode("转账")
3709
+ ], 64))
3710
+ ]),
3711
+ _: 3
3712
+ }, 8, ["class", "active"])
3713
+ ]),
3714
+ _: 3
3715
+ })
3716
+ ]),
3717
+ _: 3
3718
+ })
3719
+ ]),
3720
+ _: 3
3721
+ })
3678
3722
  ]),
3679
- _: 1
3680
- }, 512)
3723
+ _: 3
3724
+ })
3681
3725
  ]),
3682
- _: 1
3726
+ _: 3
3683
3727
  })
3684
3728
  ]),
3685
- _: 1
3686
- }),
3687
- createVNode(_component_btn_wid, mergeProps(btnData.value, { onOn_click: ok }), null, 16)
3729
+ _: 3
3730
+ }, 8, ["class"])
3688
3731
  ]),
3689
- _: 1
3690
- }, 16, ["visiable"])) : createCommentVNode("", true)
3732
+ _: 3
3733
+ }, 8, ["visiable", "dir", "matte-color", "matte-close-forbid"])) : createCommentVNode("", true)
3691
3734
  ], 64);
3692
3735
  };
3693
3736
  }
3694
3737
  });
3738
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
3739
+ __name: "content-node-wid",
3740
+ props: {
3741
+ dataTree: {},
3742
+ gap: {},
3743
+ indent: {},
3744
+ hover: {},
3745
+ active: {}
3746
+ },
3747
+ emits: ["on_select"],
3748
+ setup(__props, { emit }) {
3749
+ const props = __props;
3750
+ const dataTree = ref(props.dataTree || []);
3751
+ const selected = inject("selected");
3752
+ const gap = computed(() => {
3753
+ return props.gap || "d7";
3754
+ });
3755
+ const indent = computed(() => {
3756
+ return props.indent || "3";
3757
+ });
3758
+ const setIndex = (level) => {
3759
+ return (level * parseFloat(indent.value.replace("d", ".")) + parseFloat(gap.value.replace("d", "."))).toString().replace(".", "d");
3760
+ };
3761
+ const dealSlotData = (item) => {
3762
+ const { parent, children, ...extra } = item;
3763
+ return extra;
3764
+ };
3765
+ return (_ctx, _cache) => {
3766
+ const _component_b_text = resolveComponent("b-text");
3767
+ const _component_content_node_wid = resolveComponent("content-node-wid", true);
3768
+ return openBlock(true), createElementBlock(Fragment, null, renderList(dataTree.value, (item) => {
3769
+ return openBlock(), createBlock(_sfc_main$u, {
3770
+ state: `id-${item.id}`,
3771
+ key: item.id
3772
+ }, {
3773
+ default: withCtx(() => {
3774
+ var _a;
3775
+ return [
3776
+ createVNode(_sfc_main$s, {
3777
+ cname: `${item.id}-${Math.random()}`,
3778
+ class: normalizeClass(`flex-4 pad-v-${gap.value} pad-l-${setIndex(item.level)}`),
3779
+ hover: _ctx.hover,
3780
+ states: {
3781
+ true: `${_ctx.active ? _ctx.active : ""}`,
3782
+ false: ""
3783
+ },
3784
+ state: (((_a = unref(selected)) == null ? void 0 : _a.findIndex((data) => data.id === item.id)) > -1).toString()
3785
+ }, {
3786
+ default: withCtx(() => [
3787
+ item.children && item.children.length ? (openBlock(), createBlock(_sfc_main$m, {
3788
+ key: 0,
3789
+ class: "mrg-r-d4",
3790
+ state: item.spread ? "content-wid-spread" : "content-wid-collapse",
3791
+ icon: "arrow-right"
3792
+ }, null, 8, ["state"])) : createCommentVNode("", true),
3793
+ renderSlot(_ctx.$slots, "default", {
3794
+ dataItem: dealSlotData(item)
3795
+ }, () => [
3796
+ createVNode(_component_b_text, null, {
3797
+ default: withCtx(() => [
3798
+ createTextVNode(toDisplayString(item.text), 1)
3799
+ ]),
3800
+ _: 2
3801
+ }, 1024)
3802
+ ])
3803
+ ]),
3804
+ _: 2
3805
+ }, 1032, ["cname", "class", "hover", "states", "state"]),
3806
+ item.children && item.children.length ? (openBlock(), createBlock(_sfc_main$u, {
3807
+ key: 0,
3808
+ states: {
3809
+ "show": "show",
3810
+ "hide": "hide"
3811
+ },
3812
+ state: item.spread ? "show" : "hide"
3813
+ }, {
3814
+ default: withCtx(() => [
3815
+ createVNode(_component_content_node_wid, normalizeProps(guardReactiveProps({ ...props, dataTree: item.children })), createSlots({ _: 2 }, [
3816
+ _ctx.$slots.default ? {
3817
+ name: "default",
3818
+ fn: withCtx((scope) => [
3819
+ renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(scope)))
3820
+ ]),
3821
+ key: "0"
3822
+ } : void 0
3823
+ ]), 1040)
3824
+ ]),
3825
+ _: 2
3826
+ }, 1032, ["state"])) : createCommentVNode("", true)
3827
+ ];
3828
+ }),
3829
+ _: 2
3830
+ }, 1032, ["state"]);
3831
+ }), 128);
3832
+ };
3833
+ }
3834
+ });
3835
+ const _sfc_main = /* @__PURE__ */ defineComponent({
3836
+ __name: "content-wid",
3837
+ props: {
3838
+ dataTree: {},
3839
+ gap: {},
3840
+ indent: {},
3841
+ hover: {},
3842
+ active: {}
3843
+ },
3844
+ emits: ["on_select"],
3845
+ setup(__props, { emit }) {
3846
+ const props = __props;
3847
+ let prefix = 0;
3848
+ const flatDataTree = reactive([]);
3849
+ const indexDataTree = reactive({});
3850
+ const dataTree = ref(props.dataTree);
3851
+ const flatState = ref(false);
3852
+ const flatData = () => {
3853
+ const traverse = (items, parent, level = 0) => {
3854
+ for (const item of items) {
3855
+ item.level = level;
3856
+ item.prefix = prefix++;
3857
+ if (parent)
3858
+ item.parent = parent;
3859
+ if (item.children)
3860
+ item.spread = item.spread || false;
3861
+ flatDataTree.push(item);
3862
+ indexDataTree[item.id] = item;
3863
+ if (item.children && item.children.length > 0) {
3864
+ traverse(item.children, item, level + 1);
3865
+ }
3866
+ }
3867
+ };
3868
+ traverse(dataTree.value);
3869
+ };
3870
+ const selected = ref([]);
3871
+ onBeforeMount(() => {
3872
+ provide("selected", selected.value);
3873
+ });
3874
+ onMounted(() => {
3875
+ flatData();
3876
+ flatState.value = true;
3877
+ });
3878
+ const select = (e) => {
3879
+ var _a, _b;
3880
+ const x = e.clientX;
3881
+ const y = e.clientY;
3882
+ let element = document.elementFromPoint(x, y);
3883
+ while (!(((_a = element == null ? void 0 : element.getAttribute("state")) == null ? void 0 : _a.indexOf("id-")) === 0)) {
3884
+ element = element == null ? void 0 : element.parentElement;
3885
+ }
3886
+ const data = indexDataTree[(_b = element == null ? void 0 : element.getAttribute("state")) == null ? void 0 : _b.substring(3)];
3887
+ selected.value[0] = data;
3888
+ if (data.spread !== void 0)
3889
+ data.spread = !data.spread;
3890
+ emit("on_select", data);
3891
+ };
3892
+ return (_ctx, _cache) => {
3893
+ return openBlock(), createBlock(_sfc_main$s, {
3894
+ onOn_click: select,
3895
+ "event-proxy": true
3896
+ }, {
3897
+ default: withCtx(() => [
3898
+ flatState.value ? (openBlock(), createBlock(_sfc_main$1, normalizeProps(mergeProps({ key: 0 }, { ...props, dataTree: dataTree.value })), createSlots({ _: 2 }, [
3899
+ _ctx.$slots.default ? {
3900
+ name: "default",
3901
+ fn: withCtx((scope) => [
3902
+ renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(scope["dataItem"])))
3903
+ ]),
3904
+ key: "0"
3905
+ } : void 0
3906
+ ]), 1040)) : createCommentVNode("", true)
3907
+ ]),
3908
+ _: 3
3909
+ });
3910
+ };
3911
+ }
3912
+ });
3913
+ const contentWid_vue_vue_type_style_index_0_lang = "";
3695
3914
  const initGlobalComponents = [
3696
3915
  _sfc_main$v,
3697
3916
  _sfc_main$u,
@@ -3708,18 +3927,18 @@ const initGlobalComponents = [
3708
3927
  _sfc_main$f,
3709
3928
  _sfc_main$e,
3710
3929
  _sfc_main$d,
3711
- _sfc_main$5,
3712
3930
  _sfc_main$c,
3713
3931
  _sfc_main$b,
3714
3932
  _sfc_main$a,
3715
3933
  _sfc_main$9,
3716
- _sfc_main$6,
3934
+ _sfc_main$4,
3717
3935
  _sfc_main$8,
3936
+ _sfc_main$5,
3937
+ _sfc_main,
3718
3938
  _sfc_main$7,
3719
- _sfc_main$1,
3720
3939
  _sfc_main$3,
3721
- _sfc_main,
3722
- _sfc_main$4
3940
+ _sfc_main$2,
3941
+ _sfc_main$6
3723
3942
  ];
3724
3943
  const index = {
3725
3944
  name: "btxui",