btxui 1.1.13 → 1.1.15

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;
@@ -557,7 +565,7 @@ var md5$1 = {
557
565
  })(md5$1);
558
566
  const md5 = md5Exports;
559
567
  const GLOBAL_STYLE_NAME = "BTXUIGlobal";
560
- const _sfc_main$v = /* @__PURE__ */ defineComponent({
568
+ const _sfc_main$w = /* @__PURE__ */ defineComponent({
561
569
  __name: "b-style",
562
570
  props: {
563
571
  class: {},
@@ -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,8 +811,8 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
801
811
  };
802
812
  }
803
813
  });
804
- const _hoisted_1$c = ["data-ani-states", "state"];
805
- const _sfc_main$u = /* @__PURE__ */ defineComponent({
814
+ const _hoisted_1$b = ["data-ani-states", "state"];
815
+ const _sfc_main$v = /* @__PURE__ */ defineComponent({
806
816
  __name: "b-view",
807
817
  props: {
808
818
  class: {},
@@ -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,9 +859,10 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
843
859
  e.preventDefault();
844
860
  };
845
861
  }
862
+ setAniState();
846
863
  });
847
864
  return (_ctx, _cache) => {
848
- return openBlock(), createBlock(_sfc_main$v, {
865
+ return openBlock(), createBlock(_sfc_main$w, {
849
866
  class: normalizeClass(_ctx.class),
850
867
  cname: _ctx.cname,
851
868
  states: _ctx.states,
@@ -862,15 +879,15 @@ 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"];
873
- const _sfc_main$t = /* @__PURE__ */ defineComponent({
889
+ const _hoisted_1$a = ["state"];
890
+ const _sfc_main$u = /* @__PURE__ */ defineComponent({
874
891
  __name: "b-text",
875
892
  props: {
876
893
  class: {},
@@ -880,7 +897,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
880
897
  },
881
898
  setup(__props) {
882
899
  return (_ctx, _cache) => {
883
- return openBlock(), createBlock(_sfc_main$v, {
900
+ return openBlock(), createBlock(_sfc_main$w, {
884
901
  class: normalizeClass(_ctx.class),
885
902
  states: _ctx.states,
886
903
  cname: _ctx.cname
@@ -891,14 +908,14 @@ 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"]);
898
915
  };
899
916
  }
900
917
  });
901
- const _sfc_main$s = /* @__PURE__ */ defineComponent({
918
+ const _sfc_main$t = /* @__PURE__ */ defineComponent({
902
919
  __name: "b-hot",
903
920
  props: {
904
921
  link: {},
@@ -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(() => {
@@ -991,7 +1008,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
991
1008
  $anchor.value.download = props.download;
992
1009
  });
993
1010
  return (_ctx, _cache) => {
994
- return openBlock(), createBlock(_sfc_main$v, {
1011
+ return openBlock(), createBlock(_sfc_main$w, {
995
1012
  class: normalizeClass(_ctx.class),
996
1013
  states: _ctx.states,
997
1014
  hover: _ctx.hover,
@@ -1030,8 +1047,8 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
1030
1047
  };
1031
1048
  }
1032
1049
  });
1033
- const _hoisted_1$a = ["src", "state", "alt"];
1034
- const _sfc_main$r = /* @__PURE__ */ defineComponent({
1050
+ const _hoisted_1$9 = ["src", "state", "alt"];
1051
+ const _sfc_main$s = /* @__PURE__ */ defineComponent({
1035
1052
  __name: "b-img",
1036
1053
  props: {
1037
1054
  img: {},
@@ -1066,7 +1083,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
1066
1083
  setSrc();
1067
1084
  });
1068
1085
  return (_ctx, _cache) => {
1069
- return openBlock(), createBlock(_sfc_main$v, {
1086
+ return openBlock(), createBlock(_sfc_main$w, {
1070
1087
  class: normalizeClass(_ctx.class),
1071
1088
  cname: _ctx.cname,
1072
1089
  states: _ctx.states,
@@ -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))
@@ -1092,17 +1109,17 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
1092
1109
  };
1093
1110
  }
1094
1111
  });
1095
- const _sfc_main$q = /* @__PURE__ */ defineComponent({
1112
+ const _sfc_main$r = /* @__PURE__ */ defineComponent({
1096
1113
  __name: "ani-success",
1097
1114
  setup(__props) {
1098
1115
  return (_ctx, _cache) => {
1099
- return openBlock(), createBlock(_sfc_main$u, {
1116
+ return openBlock(), createBlock(_sfc_main$v, {
1100
1117
  class: "flex-5",
1101
1118
  matrix: { translate: "0,9px", rotate: "45deg" }
1102
1119
  }, {
1103
1120
  default: withCtx(() => [
1104
- createVNode(_sfc_main$t, { class: "ani-success-part1 w-1 h-3-px bg-color-green round-sm" }),
1105
- createVNode(_sfc_main$t, { class: "ani-success-part2 w-1d7 h-3-px bg-color-green round-sm rel t-1-px l-f1-px" })
1121
+ createVNode(_sfc_main$u, { class: "ani-success-part1 w-1 h-3-px bg-color-green round-sm" }),
1122
+ createVNode(_sfc_main$u, { class: "ani-success-part2 w-1d7 h-3-px bg-color-green round-sm rel t-1-px l-f1-px" })
1106
1123
  ]),
1107
1124
  _: 1
1108
1125
  });
@@ -1118,7 +1135,7 @@ const _export_sfc = (sfc, props) => {
1118
1135
  }
1119
1136
  return target;
1120
1137
  };
1121
- const _sfc_main$p = {};
1138
+ const _sfc_main$q = {};
1122
1139
  function _sfc_render$2(_ctx, _cache) {
1123
1140
  const _component_b_text = resolveComponent("b-text");
1124
1141
  const _component_b_view = resolveComponent("b-view");
@@ -1130,9 +1147,9 @@ function _sfc_render$2(_ctx, _cache) {
1130
1147
  _: 1
1131
1148
  });
1132
1149
  }
1133
- const AniFail = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$2]]);
1150
+ const AniFail = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$2]]);
1134
1151
  const aniNotic_vue_vue_type_style_index_0_lang = "";
1135
- const _sfc_main$o = {};
1152
+ const _sfc_main$p = {};
1136
1153
  function _sfc_render$1(_ctx, _cache) {
1137
1154
  const _component_b_text = resolveComponent("b-text");
1138
1155
  const _component_b_view = resolveComponent("b-view");
@@ -1147,9 +1164,9 @@ function _sfc_render$1(_ctx, _cache) {
1147
1164
  _: 1
1148
1165
  });
1149
1166
  }
1150
- const AniNotic = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$1]]);
1167
+ const AniNotic = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$1]]);
1151
1168
  const aniLoading_vue_vue_type_style_index_0_lang = "";
1152
- const _sfc_main$n = {};
1169
+ const _sfc_main$o = {};
1153
1170
  function _sfc_render(_ctx, _cache) {
1154
1171
  const _component_b_view = resolveComponent("b-view");
1155
1172
  return openBlock(), createBlock(_component_b_view, { class: "flex-5" }, {
@@ -1159,9 +1176,9 @@ function _sfc_render(_ctx, _cache) {
1159
1176
  _: 1
1160
1177
  });
1161
1178
  }
1162
- const AniLoading = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render]]);
1163
- const _hoisted_1$9 = ["state"];
1164
- const _sfc_main$m = /* @__PURE__ */ defineComponent({
1179
+ const AniLoading = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render]]);
1180
+ const _hoisted_1$8 = ["state"];
1181
+ const _sfc_main$n = /* @__PURE__ */ defineComponent({
1165
1182
  __name: "b-icon",
1166
1183
  props: {
1167
1184
  icon: {},
@@ -1173,19 +1190,19 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
1173
1190
  setup(__props) {
1174
1191
  const props = __props;
1175
1192
  return (_ctx, _cache) => {
1176
- return openBlock(), createBlock(_sfc_main$v, {
1193
+ return openBlock(), createBlock(_sfc_main$w, {
1177
1194
  class: normalizeClass(_ctx.class),
1178
1195
  states: _ctx.states,
1179
1196
  cname: _ctx.cname
1180
1197
  }, {
1181
1198
  className: withCtx((scope) => [
1182
1199
  _ctx.icon.search("ani_") === 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1183
- _ctx.icon === "ani_success" ? (openBlock(), createBlock(_sfc_main$q, { key: "success" })) : createCommentVNode("", true),
1200
+ _ctx.icon === "ani_success" ? (openBlock(), createBlock(_sfc_main$r, { key: "success" })) : createCommentVNode("", true),
1184
1201
  _ctx.icon === "ani_fail" ? (openBlock(), createBlock(AniFail, { key: "fail" })) : createCommentVNode("", true),
1185
1202
  _ctx.icon === "ani_notic" ? (openBlock(), createBlock(AniNotic, { key: "notic" })) : createCommentVNode("", true),
1186
1203
  _ctx.icon === "ani_loading" ? (openBlock(), createBlock(AniLoading, { key: "loading" })) : createCommentVNode("", true)
1187
1204
  ], 64)) : createCommentVNode("", true),
1188
- _ctx.icon.search("/") > -1 ? (openBlock(), createBlock(_sfc_main$u, {
1205
+ _ctx.icon.search("/") > -1 ? (openBlock(), createBlock(_sfc_main$v, {
1189
1206
  key: 1,
1190
1207
  "bg-img": _ctx.icon,
1191
1208
  states: _ctx.states,
@@ -1195,16 +1212,16 @@ 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"];
1207
- const _sfc_main$l = /* @__PURE__ */ defineComponent({
1222
+ const _hoisted_1$7 = ["contenteditable", "focus-state", "state"];
1223
+ const _hoisted_2$2 = ["type", "name", "focus-state", "state", "placeholder", "maxlength", "readonly"];
1224
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
1208
1225
  __name: "b-input",
1209
1226
  props: {
1210
1227
  type: {},
@@ -1339,7 +1356,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1339
1356
  const _component_b_icon = resolveComponent("b-icon");
1340
1357
  const _component_b_hot = resolveComponent("b-hot");
1341
1358
  const _component_b_view = resolveComponent("b-view");
1342
- return openBlock(), createBlock(_sfc_main$v, {
1359
+ return openBlock(), createBlock(_sfc_main$w, {
1343
1360
  class: normalizeClass(_ctx.class),
1344
1361
  focus: _ctx.focus,
1345
1362
  states: _ctx.states,
@@ -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,8 +1438,8 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1421
1438
  };
1422
1439
  }
1423
1440
  });
1424
- const _hoisted_1$7 = ["name", "focus", "state", "placeholder", "maxlength", "readonly", "rows"];
1425
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
1441
+ const _hoisted_1$6 = ["name", "focus", "state", "placeholder", "maxlength", "readonly", "rows"];
1442
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1426
1443
  __name: "b-textarea",
1427
1444
  props: {
1428
1445
  text: {},
@@ -1446,7 +1463,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
1446
1463
  emit("update:text", formatText(val.value));
1447
1464
  };
1448
1465
  return (_ctx, _cache) => {
1449
- return openBlock(), createBlock(_sfc_main$v, {
1466
+ return openBlock(), createBlock(_sfc_main$w, {
1450
1467
  class: normalizeClass(_ctx.class),
1451
1468
  focus: _ctx.focus,
1452
1469
  states: _ctx.states,
@@ -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,9 +1493,9 @@ 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"];
1481
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
1496
+ const _hoisted_1$5 = ["poster", "muted", "src", "autoplay", "controls", "loop"];
1497
+ const _hoisted_2$1 = ["poster", "muted", "src", "autoplay", "controls", "loop"];
1498
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
1482
1499
  __name: "b-video",
1483
1500
  props: {
1484
1501
  video: {},
@@ -1540,7 +1557,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
1540
1557
  const _component_b_icon = resolveComponent("b-icon");
1541
1558
  const _component_b_view = resolveComponent("b-view");
1542
1559
  const _component_b_hot = resolveComponent("b-hot");
1543
- return openBlock(), createBlock(_sfc_main$v, {
1560
+ return openBlock(), createBlock(_sfc_main$w, {
1544
1561
  class: normalizeClass(_ctx.class),
1545
1562
  cname: _ctx.cname
1546
1563
  }, {
@@ -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,9 +1634,9 @@ 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
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
1639
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
1623
1640
  __name: "b-list",
1624
1641
  props: {
1625
1642
  scroll: {},
@@ -1682,7 +1699,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
1682
1699
  watchPos();
1683
1700
  });
1684
1701
  return (_ctx, _cache) => {
1685
- return openBlock(), createBlock(_sfc_main$v, {
1702
+ return openBlock(), createBlock(_sfc_main$w, {
1686
1703
  class: normalizeClass(_ctx.class),
1687
1704
  states: _ctx.states,
1688
1705
  cname: _ctx.cname
@@ -1702,15 +1719,15 @@ 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"];
1713
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
1729
+ const _hoisted_1$3 = ["state", "draggable"];
1730
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
1714
1731
  __name: "b-drag",
1715
1732
  props: {
1716
1733
  class: {},
@@ -1820,7 +1837,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
1820
1837
  bindEvent();
1821
1838
  });
1822
1839
  return (_ctx, _cache) => {
1823
- return openBlock(), createBlock(_sfc_main$v, {
1840
+ return openBlock(), createBlock(_sfc_main$w, {
1824
1841
  class: normalizeClass(_ctx.class),
1825
1842
  states: { dragStart: _ctx.dragStart, dragOver: _ctx.dragOver },
1826
1843
  cname: _ctx.cname
@@ -1842,15 +1859,15 @@ 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"];
1853
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
1869
+ const _hoisted_1$2 = ["src"];
1870
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
1854
1871
  __name: "b-webview",
1855
1872
  props: {
1856
1873
  src: {},
@@ -1859,7 +1876,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
1859
1876
  },
1860
1877
  setup(__props) {
1861
1878
  return (_ctx, _cache) => {
1862
- return openBlock(), createBlock(_sfc_main$v, {
1879
+ return openBlock(), createBlock(_sfc_main$w, {
1863
1880
  class: normalizeClass(_ctx.class),
1864
1881
  cname: _ctx.cname
1865
1882
  }, {
@@ -1868,14 +1885,14 @@ 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"]);
1875
1892
  };
1876
1893
  }
1877
1894
  });
1878
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
1895
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
1879
1896
  __name: "b-row",
1880
1897
  props: {
1881
1898
  class: {},
@@ -1892,7 +1909,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
1892
1909
  });
1893
1910
  const combClass = ref(`${props.class} flex pad-h-${gap.value[0]} pad-v-${gap.value[1]}`);
1894
1911
  return (_ctx, _cache) => {
1895
- return openBlock(), createBlock(_sfc_main$u, mergeProps({ class: combClass.value }, _ctx.viewData, {
1912
+ return openBlock(), createBlock(_sfc_main$v, mergeProps({ class: combClass.value }, _ctx.viewData, {
1896
1913
  extraClass: {
1897
1914
  selector: ">",
1898
1915
  value: `pad-h-${gap.value[0]} pad-v-${gap.value[1]}`
@@ -1906,7 +1923,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
1906
1923
  };
1907
1924
  }
1908
1925
  });
1909
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
1926
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
1910
1927
  __name: "b-col",
1911
1928
  props: {
1912
1929
  span: {},
@@ -1918,7 +1935,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
1918
1935
  const props = __props;
1919
1936
  const combClass = ref(`${props.class ?? ""} ${props.span ? "col-" + props.span : ""} ${props.offset ? "offset-" + props.offset : ""}`);
1920
1937
  return (_ctx, _cache) => {
1921
- return openBlock(), createBlock(_sfc_main$u, mergeProps({ class: combClass.value }, _ctx.viewData), {
1938
+ return openBlock(), createBlock(_sfc_main$v, mergeProps({ class: combClass.value }, _ctx.viewData), {
1922
1939
  default: withCtx(() => [
1923
1940
  renderSlot(_ctx.$slots, "default")
1924
1941
  ]),
@@ -1927,7 +1944,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
1927
1944
  };
1928
1945
  }
1929
1946
  });
1930
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
1947
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
1931
1948
  __name: "btn-wid",
1932
1949
  props: {
1933
1950
  btnText: {},
@@ -1974,13 +1991,13 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
1974
1991
  };
1975
1992
  });
1976
1993
  return (_ctx, _cache) => {
1977
- return openBlock(), createBlock(_sfc_main$s, mergeProps(_ctx.hotData, {
1994
+ return openBlock(), createBlock(_sfc_main$t, mergeProps(_ctx.hotData, {
1978
1995
  class: `flex-5 pad-h-1d4 pad-v-d4 thick-1 ellipsis ${_ctx.btnRound ? "round-lg" : "round-sm"} ${_ctx.btnWidth ? "lw-" + _ctx.btnWidth : ""} ${normal.value.bg} ${normal.value.text} ${normal.value.line} solid`,
1979
1996
  hover: `${hover.value.text} ${hover.value.bg} ${hover.value.line}`,
1980
1997
  active: `${active.value.text} ${active.value.bg} ${active.value.line}`
1981
1998
  }), {
1982
1999
  default: withCtx(() => [
1983
- _ctx.iconData ? (openBlock(), createBlock(_sfc_main$m, mergeProps({ key: 0 }, _ctx.iconData, { class: "mrg-r-d7" }), null, 16)) : createCommentVNode("", true),
2000
+ _ctx.iconData ? (openBlock(), createBlock(_sfc_main$n, mergeProps({ key: 0 }, _ctx.iconData, { class: "mrg-r-d7" }), null, 16)) : createCommentVNode("", true),
1984
2001
  createTextVNode(" " + toDisplayString(_ctx.btnText), 1)
1985
2002
  ]),
1986
2003
  _: 1
@@ -1988,7 +2005,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
1988
2005
  };
1989
2006
  }
1990
2007
  });
1991
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
2008
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
1992
2009
  __name: "checkbox-wid",
1993
2010
  props: {
1994
2011
  selected: { type: Boolean },
@@ -2016,7 +2033,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2016
2033
  emit("change", props.value, state);
2017
2034
  };
2018
2035
  return (_ctx, _cache) => {
2019
- return openBlock(), createBlock(_sfc_main$s, {
2036
+ return openBlock(), createBlock(_sfc_main$t, {
2020
2037
  class: normalizeClass(combClass.value),
2021
2038
  hover: "alpha-d9",
2022
2039
  state: selected.value ? "act" : "",
@@ -2030,7 +2047,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2030
2047
  }, () => {
2031
2048
  var _a, _b;
2032
2049
  return [
2033
- createVNode(_sfc_main$u, {
2050
+ createVNode(_sfc_main$v, {
2034
2051
  class: "w-24-px h-24-px bg-color-neutral round-sm flex-5",
2035
2052
  state: selected.value ? "act" : "",
2036
2053
  cname: combClass.value + combActClass.value,
@@ -2039,7 +2056,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2039
2056
  }
2040
2057
  }, {
2041
2058
  default: withCtx(() => [
2042
- createVNode(_sfc_main$m, {
2059
+ createVNode(_sfc_main$n, {
2043
2060
  icon: "success",
2044
2061
  class: "alpha-d3",
2045
2062
  state: selected.value ? "act" : "",
@@ -2052,7 +2069,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2052
2069
  }, 8, ["state", "cname", "states"])
2053
2070
  ];
2054
2071
  }),
2055
- label.value ? (openBlock(), createBlock(_sfc_main$u, {
2072
+ label.value ? (openBlock(), createBlock(_sfc_main$v, {
2056
2073
  key: 0,
2057
2074
  class: "pad-h-1 ellipsis"
2058
2075
  }, {
@@ -2067,7 +2084,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2067
2084
  };
2068
2085
  }
2069
2086
  });
2070
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
2087
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2071
2088
  __name: "checkbox-group-wid",
2072
2089
  props: {
2073
2090
  options: {},
@@ -2110,11 +2127,11 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
2110
2127
  return (_ctx, _cache) => {
2111
2128
  const _component_b_col = resolveComponent("b-col");
2112
2129
  const _component_b_row = resolveComponent("b-row");
2113
- return openBlock(), createBlock(_sfc_main$u, {
2130
+ return openBlock(), createBlock(_sfc_main$v, {
2114
2131
  class: normalizeClass(_ctx.class)
2115
2132
  }, {
2116
2133
  default: withCtx(() => [
2117
- _ctx.title ? (openBlock(), createBlock(_sfc_main$u, {
2134
+ _ctx.title ? (openBlock(), createBlock(_sfc_main$v, {
2118
2135
  key: 0,
2119
2136
  class: "mrg-b-1"
2120
2137
  }, {
@@ -2132,7 +2149,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
2132
2149
  key: i
2133
2150
  }, {
2134
2151
  default: withCtx(() => [
2135
- createVNode(_sfc_main$c, mergeProps({
2152
+ createVNode(_sfc_main$d, mergeProps({
2136
2153
  onChange: change,
2137
2154
  label: item.label,
2138
2155
  value: item.value
@@ -2172,7 +2189,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
2172
2189
  };
2173
2190
  }
2174
2191
  });
2175
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
2192
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
2176
2193
  __name: "radio-group-wid",
2177
2194
  props: {
2178
2195
  options: {},
@@ -2200,7 +2217,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
2200
2217
  });
2201
2218
  return (_ctx, _cache) => {
2202
2219
  const _component_b_view = resolveComponent("b-view");
2203
- return openBlock(), createBlock(_sfc_main$b, {
2220
+ return openBlock(), createBlock(_sfc_main$c, {
2204
2221
  span: _ctx.span,
2205
2222
  title: _ctx.title,
2206
2223
  class: normalizeClass(_ctx.class),
@@ -2240,10 +2257,10 @@ 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"];
2246
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
2260
+ const _hoisted_1$1 = ["state"];
2261
+ const _hoisted_2 = ["innerHTML"];
2262
+ const _hoisted_3 = ["innerHTML"];
2263
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
2247
2264
  __name: "tabs-wid",
2248
2265
  props: {
2249
2266
  options: {},
@@ -2313,9 +2330,9 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
2313
2330
  });
2314
2331
  return (_ctx, _cache) => {
2315
2332
  return openBlock(), createElementBlock(Fragment, null, [
2316
- createVNode(_sfc_main$u, { class: "flex-7" }, {
2333
+ createVNode(_sfc_main$v, { class: "flex-7" }, {
2317
2334
  default: withCtx(() => [
2318
- createVNode(_sfc_main$a, {
2335
+ createVNode(_sfc_main$b, {
2319
2336
  options: options.value,
2320
2337
  title: _ctx.title,
2321
2338
  selected: selected.value,
@@ -2324,19 +2341,19 @@ 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" ? {
2331
2348
  name: "default",
2332
2349
  fn: withCtx((scope) => [
2333
- createVNode(_sfc_main$u, { class: "w-4-px b-f1-px h-1-px bg-color-neutral r-f5-px abs" })
2350
+ createVNode(_sfc_main$v, { class: "w-4-px b-f1-px h-1-px bg-color-neutral r-f5-px abs" })
2334
2351
  ]),
2335
2352
  key: "1"
2336
2353
  } : slots.value.length === 0 ? {
2337
2354
  name: "default",
2338
2355
  fn: withCtx((scope) => [
2339
- createVNode(_sfc_main$u, {
2356
+ createVNode(_sfc_main$v, {
2340
2357
  class: normalizeClass(`max-w l-0 b-f1-px round-sm h-2-px bg-color-none abs`),
2341
2358
  state: scope.state,
2342
2359
  states: {
@@ -2357,35 +2374,35 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
2357
2374
  };
2358
2375
  })
2359
2376
  ]), 1032, ["options", "title", "selected"]),
2360
- contLine.value ? (openBlock(), createBlock(_sfc_main$u, {
2377
+ contLine.value ? (openBlock(), createBlock(_sfc_main$v, {
2361
2378
  key: 0,
2362
2379
  class: "grow-1 h-1-px bg-color-neutral"
2363
2380
  })) : createCommentVNode("", true)
2364
2381
  ]),
2365
2382
  _: 3
2366
2383
  }),
2367
- contArea.value ? (openBlock(), createBlock(_sfc_main$u, {
2384
+ contArea.value ? (openBlock(), createBlock(_sfc_main$v, {
2368
2385
  key: 0,
2369
2386
  class: "pad-v-1d5 over-hide"
2370
2387
  }, {
2371
2388
  default: withCtx(() => [
2372
- selected.value ? (openBlock(), createBlock(_sfc_main$u, { key: 0 }, {
2389
+ selected.value ? (openBlock(), createBlock(_sfc_main$v, { key: 0 }, {
2373
2390
  default: withCtx(() => [
2374
2391
  createElementVNode("div", {
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
- })) : (openBlock(), createBlock(_sfc_main$u, {
2398
+ })) : (openBlock(), createBlock(_sfc_main$v, {
2382
2399
  key: 1,
2383
2400
  class: "alpha-d5"
2384
2401
  }, {
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,8 +2413,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
2396
2413
  };
2397
2414
  }
2398
2415
  });
2399
- const _hoisted_1$1 = ["multiple"];
2400
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2416
+ const _hoisted_1 = ["multiple"];
2417
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
2401
2418
  __name: "upload-wid",
2402
2419
  props: {
2403
2420
  type: {},
@@ -2456,7 +2473,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2456
2473
  };
2457
2474
  return (_ctx, _cache) => {
2458
2475
  const _component_b_hot = resolveComponent("b-hot");
2459
- return openBlock(), createBlock(_sfc_main$u, { class: "flex" }, {
2476
+ return openBlock(), createBlock(_sfc_main$v, { class: "flex" }, {
2460
2477
  default: withCtx(() => [
2461
2478
  _ctx.$slots.default ? (openBlock(), createBlock(_component_b_hot, {
2462
2479
  key: 0,
@@ -2466,7 +2483,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2466
2483
  renderSlot(_ctx.$slots, "default")
2467
2484
  ]),
2468
2485
  _: 3
2469
- })) : (openBlock(), createBlock(_sfc_main$d, mergeProps({
2486
+ })) : (openBlock(), createBlock(_sfc_main$e, mergeProps({
2470
2487
  key: 1,
2471
2488
  onOn_click: _cache[1] || (_cache[1] = ($event) => $uploader.value.click())
2472
2489
  }, btnData.value), null, 16)),
@@ -2487,802 +2504,706 @@ 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);
2544
- }
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";
2555
- }
2556
- bToast.childNodes[0].childNodes[1].innerText = text;
2557
- bToast.style.cssText = showStyle;
2558
- t = setTimeout(() => {
2559
- bToast.style.cssText = hideStyle;
2560
- }, duration);
2561
- };
2562
- 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;
2593
- };
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);
2606
- } else {
2607
- bToast.style.cssText = hideStyle;
2608
- }
2609
- };
2610
- const upload = (extra) => {
2611
- const $input = document.createElement("input");
2612
- $input.type = "file";
2613
- if (extra == null ? void 0 : extra.camera) {
2614
- $input.capture = "user";
2615
- $input.accept = "image/*";
2616
- }
2617
- document.body.appendChild($input);
2618
- return new Promise((resolve) => {
2619
- $input.onchange = (e) => {
2620
- const target = e.target;
2621
- if (target.files)
2622
- resolve(target.files);
2623
- };
2624
- $input.click();
2625
- document.body.removeChild($input);
2626
- });
2627
- };
2628
- const compress = (file, compress2) => {
2629
- return new Promise((resolve, reject) => {
2630
- const reader = new FileReader();
2631
- reader.readAsDataURL(file);
2632
- reader.onload = function() {
2633
- const img = new Image();
2634
- img.src = reader.result;
2635
- img.onload = function() {
2636
- const canvas = document.createElement("canvas");
2637
- const ctx = canvas.getContext("2d");
2638
- const { naturalHeight, naturalWidth } = img;
2639
- const ratio = naturalWidth / naturalHeight;
2640
- canvas.width = (compress2 == null ? void 0 : compress2.width) || naturalWidth;
2641
- canvas.height = (compress2 == null ? void 0 : compress2.height) || canvas.width / ratio;
2642
- ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
2643
- canvas.toBlob((blob) => {
2644
- resolve(new File([blob], file.name, {
2645
- type: blob.type,
2646
- lastModified: (/* @__PURE__ */ new Date()).getTime()
2647
- }));
2648
- }, file.type, (compress2 == null ? void 0 : compress2.quality) || 0.7);
2649
- };
2650
- img.onerror = reject;
2651
- };
2652
- reader.onerror = reject;
2653
- });
2654
- };
2655
- const uploadImage = async (imageCompress, extra) => {
2656
- const files = await upload(extra);
2657
- const file = await compress(files[0], imageCompress);
2658
- const fileReader = new FileReader();
2659
- fileReader.readAsDataURL(file);
2660
- return new Promise((resolve) => {
2661
- fileReader.onload = (e) => {
2662
- var _a;
2663
- resolve({
2664
- file,
2665
- preview: (_a = e.target) == null ? void 0 : _a.result
2666
- });
2667
- };
2668
- });
2669
- };
2670
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
2671
- __name: "img-upload-wid",
2514
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2515
+ __name: "modal-wid",
2672
2516
  props: {
2673
- preview: {},
2674
- cover: {},
2675
- size: {},
2676
- multiple: { type: Boolean },
2677
- bsize: {},
2678
- compress: {},
2679
- camera: { type: Boolean }
2517
+ visiable: { type: Boolean },
2518
+ matteColor: {},
2519
+ matteCloseForbid: { type: Boolean },
2520
+ closeEnable: { type: Boolean },
2521
+ roundEnable: { type: Boolean },
2522
+ pannelColor: {},
2523
+ dir: {},
2524
+ aniName: {}
2680
2525
  },
2681
- emits: ["update:preview", "on_upload"],
2526
+ emits: ["update:visiable", "opened", "closed"],
2682
2527
  setup(__props, { emit }) {
2683
2528
  const props = __props;
2684
- const size = computed(() => props.compress ? 1024 * 1024 * 20 : props.size);
2685
- const imgUpload = async (files, checkResult) => {
2686
- if (checkResult.success) {
2687
- let file = files[0];
2688
- const fileReader = new FileReader();
2689
- fileReader.readAsDataURL(files[0]);
2690
- fileReader.onload = (e) => {
2691
- var _a;
2692
- emit("update:preview", (_a = e.target) == null ? void 0 : _a.result);
2693
- };
2694
- if (props.compress)
2695
- file = await compress(files[0], props.compress);
2696
- emit("on_upload", file, checkResult);
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);
2697
2608
  }
2698
2609
  };
2610
+ const hide = () => {
2611
+ emit("update:visiable", false);
2612
+ };
2699
2613
  return (_ctx, _cache) => {
2700
- const _component_b_view = resolveComponent("b-view");
2701
- const _component_b_icon = resolveComponent("b-icon");
2702
- return openBlock(), createBlock(_sfc_main$8, {
2703
- onOn_upload: imgUpload,
2704
- size: size.value,
2705
- multiple: _ctx.multiple,
2706
- camera: _ctx.camera,
2707
- type: ["image/jpeg", "image/png", "image/gif"]
2614
+ return openBlock(), createBlock(_sfc_main$v, {
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
+ }
2708
2621
  }, {
2709
- default: withCtx(() => {
2710
- var _a, _b, _c, _d, _e, _f;
2711
- return [
2712
- _ctx.preview ? (openBlock(), createBlock(_component_b_view, {
2713
- key: 0,
2714
- class: normalizeClass(`w-${((_a = _ctx.cover) == null ? void 0 : _a.width) || 7} h-${((_b = _ctx.cover) == null ? void 0 : _b.height) || 7} bsize-${_ctx.bsize || "cover"} bpos-2 round-sm bg-color-neutral`),
2715
- "bg-img": _ctx.preview
2716
- }, null, 8, ["class", "bg-img"])) : (openBlock(), createBlock(_component_b_icon, {
2717
- key: 1,
2718
- icon: "add",
2719
- class: normalizeClass(`flex-5 w-${((_c = _ctx.cover) == null ? void 0 : _c.width) || 7} h-${((_d = _ctx.cover) == null ? void 0 : _d.height) || 7} ${((_e = _ctx.cover) == null ? void 0 : _e.color) ? "color-" + ((_f = _ctx.cover) == null ? void 0 : _f.color) : ""} round-sm bg-color-neutral`)
2720
- }, null, 8, ["class"]))
2721
- ];
2722
- }),
2723
- _: 1
2724
- }, 8, ["size", "multiple", "camera"]);
2725
- };
2726
- }
2727
- });
2728
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2729
- __name: "app-wid",
2730
- props: {
2731
- path: {},
2732
- spread: {},
2733
- iconTransAni: { type: Boolean },
2734
- center: {},
2735
- colors: {},
2736
- round: { type: Boolean },
2737
- keepAlive: { type: Boolean }
2738
- },
2739
- emits: ["on_toggle"],
2740
- setup(__props) {
2741
- const props = __props;
2742
- const curRoute = computed(() => props.path);
2743
- const navs = computed(() => {
2744
- const spread = [...props.spread];
2745
- if (props.center) {
2746
- spread.splice(Math.floor(spread.length / 2), 0, reactive({ ...props.center, main: true }));
2747
- }
2748
- return spread;
2749
- });
2750
- return (_ctx, _cache) => {
2751
- var _a;
2752
- const _component_router_view = resolveComponent("router-view");
2753
- return openBlock(), createBlock(_sfc_main$u, {
2754
- class: normalizeClass(`max fixed flex-column color-light select-none bg-color-${((_a = _ctx.colors) == null ? void 0 : _a.bg) || "none"}`)
2755
- }, {
2756
- default: withCtx(() => {
2757
- var _a2;
2758
- return [
2759
- createVNode(_sfc_main$u, { class: "rel grow-1" }, {
2760
- default: withCtx(() => [
2761
- createVNode(_sfc_main$i, {
2762
- scroll: { y: "auto", x: "hidden" },
2763
- class: "abs max"
2622
+ default: withCtx(() => [
2623
+ createVNode(_sfc_main$t, {
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$v, {
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$v, {
2643
+ class: normalizeClass(`bg-color-${_ctx.pannelColor || "light"} rel pad-2 ${_ctx.roundEnable ? "round-md" : ""} ${dirStyle.value.pannal}`)
2764
2644
  }, {
2765
2645
  default: withCtx(() => [
2766
- _ctx.keepAlive ? (openBlock(), createBlock(KeepAlive, { key: 0 }, [
2767
- createVNode(_component_router_view)
2768
- ], 1024)) : (openBlock(), createBlock(_component_router_view, { key: 1 }))
2646
+ !_ctx.closeEnable ? (openBlock(), createBlock(_sfc_main$t, {
2647
+ key: 0,
2648
+ class: "abs r-1 t-d7 color-mgray",
2649
+ onOn_click: hide
2650
+ }, {
2651
+ default: withCtx(() => [
2652
+ createVNode(_sfc_main$n, {
2653
+ icon: "fail",
2654
+ class: "fsize-2 lh-1d4"
2655
+ })
2656
+ ]),
2657
+ _: 1
2658
+ })) : createCommentVNode("", true),
2659
+ renderSlot(_ctx.$slots, "default")
2769
2660
  ]),
2770
- _: 1
2771
- })
2772
- ]),
2773
- _: 1
2774
- }),
2775
- createVNode(_sfc_main$u, {
2776
- class: normalizeClass(`pcenter pad-t-d5 flex-1 ${_ctx.round ? "round-md round-t" : ""} bg-color-${((_a2 = _ctx.colors) == null ? void 0 : _a2.bar) || "dark"} solid-t line-neutral thick-d4 app-nav-bar`)
2777
- }, {
2778
- default: withCtx(() => [
2779
- (openBlock(true), createElementBlock(Fragment, null, renderList(navs.value, (nav, i) => {
2780
- return openBlock(), createBlock(_sfc_main$s, mergeProps({ key: i }, nav.hotData, {
2781
- class: "grow-1",
2782
- onOn_click: ($event) => _ctx.$emit("on_toggle", nav)
2783
- }), {
2784
- default: withCtx(() => {
2785
- var _a3, _b, _c, _d, _e, _f;
2786
- return [
2787
- nav.main ? (openBlock(), createBlock(_sfc_main$u, {
2788
- key: 0,
2789
- class: "rel w-5 mrg-h-auto"
2790
- }, {
2791
- default: withCtx(() => {
2792
- var _a4, _b2, _c2, _d2;
2793
- return [
2794
- createVNode(_sfc_main$m, mergeProps(nav.iconData, {
2795
- class: `abs flex-5 solid t-f1d4 thick-2 w-5 h-5 round fsize-1d7 line-${((_b2 = (_a4 = _ctx.colors) == null ? void 0 : _a4.center) == null ? void 0 : _b2.line) || "neutral"} bg-color-${((_d2 = (_c2 = _ctx.colors) == null ? void 0 : _c2.center) == null ? void 0 : _d2.bg) || "dgray"}`
2796
- }), null, 16, ["class"])
2797
- ];
2798
- }),
2799
- _: 2
2800
- }, 1024)) : (openBlock(), createBlock(_sfc_main$u, {
2801
- key: 1,
2802
- class: normalizeClass(`flex-column rel flex-5 color-${((_b = (_a3 = _ctx.colors) == null ? void 0 : _a3.text) == null ? void 0 : _b.normal) || "mgray"}`),
2803
- cname: ((_d = (_c = _ctx.colors) == null ? void 0 : _c.text) == null ? void 0 : _d.act) || "light",
2804
- state: curRoute.value === nav.hotData.link ? "act" : "",
2805
- states: {
2806
- act: `color-${((_f = (_e = _ctx.colors) == null ? void 0 : _e.text) == null ? void 0 : _f.act) || "light"}`
2807
- }
2808
- }, {
2809
- default: withCtx(() => [
2810
- nav.unread === 1 ? (openBlock(), createBlock(_sfc_main$u, {
2811
- key: 0,
2812
- class: "round w-d7 h-d7 r-9d2-vw t-d2 bg-color-red abs"
2813
- })) : createCommentVNode("", true),
2814
- nav.unread > 1 ? (openBlock(), createBlock(_sfc_main$u, {
2815
- key: 1,
2816
- class: "flex-5 round w-1d5 h-1d5 bold r-7d7-vw t-fd5 bg-color-red abs color-Cfff"
2817
- }, {
2818
- default: withCtx(() => [
2819
- createTextVNode(toDisplayString(nav.unread), 1)
2820
- ]),
2821
- _: 2
2822
- }, 1024)) : createCommentVNode("", true),
2823
- createVNode(_sfc_main$m, mergeProps(nav.iconData, {
2824
- cname: nav.act,
2825
- state: curRoute.value === nav.hotData.link ? "act" : "",
2826
- states: {
2827
- act: nav.act ?? ""
2828
- },
2829
- class: `w-2d7 h-2d7 ${_ctx.iconTransAni ? "trans-fast" : ""} fsize-1d7`
2830
- }), null, 16, ["cname", "state", "states", "class"]),
2831
- nav.text ? (openBlock(), createBlock(_sfc_main$t, {
2832
- key: 2,
2833
- class: "fsize-d83"
2834
- }, {
2835
- default: withCtx(() => [
2836
- createTextVNode(toDisplayString(nav.text), 1)
2837
- ]),
2838
- _: 2
2839
- }, 1024)) : createCommentVNode("", true)
2840
- ]),
2841
- _: 2
2842
- }, 1032, ["class", "cname", "state", "states"]))
2843
- ];
2844
- }),
2845
- _: 2
2846
- }, 1040, ["onOn_click"]);
2847
- }), 128))
2848
- ]),
2849
- _: 1
2850
- }, 8, ["class"])
2851
- ];
2852
- }),
2853
- _: 1
2854
- }, 8, ["class"]);
2661
+ _: 3
2662
+ }, 8, ["class"])
2663
+ ])
2664
+ ]),
2665
+ _: 3
2666
+ }, 8, ["class", "state", "states"])
2667
+ ]),
2668
+ _: 3
2669
+ }, 8, ["class", "state"]);
2855
2670
  };
2856
2671
  }
2857
2672
  });
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",
2673
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
2674
+ __name: "toast-wid",
2869
2675
  props: {
2870
- colors: {}
2676
+ text: {},
2677
+ duration: {},
2678
+ icon: {},
2679
+ matteColor: {},
2680
+ extra: {}
2871
2681
  },
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;
2881
- });
2882
- reactive({
2883
- text: "dgray",
2884
- pannel: "light",
2885
- success: "#e6fff2",
2886
- fail: "#f9f2f4",
2887
- notic: "#e6f5ff",
2888
- loading: "lgray",
2889
- ...this.colors
2890
- });
2891
- const $_close = (callback) => {
2892
- callback && callback();
2893
- $_cancel_bind_keyboard_event();
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);
2894
2694
  };
2895
- const $_cancel_bind_keyboard_event = () => {
2896
- window.removeEventListener("keyup", this.$_keyboard_enter);
2695
+ const close = () => {
2696
+ visiable.value = false;
2897
2697
  };
2898
- onMounted(() => {
2899
- });
2900
- onBeforeUnmount(() => {
2901
- $_close();
2698
+ const closed = () => {
2699
+ clearTimeout(t);
2700
+ emit("close");
2701
+ };
2702
+ __expose({
2703
+ show,
2704
+ close
2902
2705
  });
2903
2706
  return (_ctx, _cache) => {
2904
- return openBlock(), createElementBlock("dialog", _hoisted_1, _hoisted_4);
2707
+ return openBlock(), createBlock(_sfc_main$8, {
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$v, { 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$v, {
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$n, { icon: _ctx.icon }, null, 8, ["icon"])
2735
+ ]),
2736
+ _: 1
2737
+ }, 8, ["state"])) : createCommentVNode("", true),
2738
+ createVNode(_sfc_main$u, 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"]);
2905
2752
  };
2906
2753
  }
2907
2754
  });
2908
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2909
- __name: "toast-wid",
2755
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2756
+ __name: "confirm-wid",
2910
2757
  props: {
2911
- matteColor: {}
2758
+ notic: {},
2759
+ type: {},
2760
+ theme: {},
2761
+ text: {},
2762
+ matteColor: {},
2763
+ ok: { type: Function },
2764
+ cancel: { type: Function }
2912
2765
  },
2913
- setup(__props, { expose: __expose }) {
2766
+ emits: ["ok", "cancel", "close"],
2767
+ setup(__props, { expose: __expose, emit }) {
2768
+ const props = __props;
2914
2769
  const visiable = ref(false);
2915
- const show = (duration) => {
2916
- visiable.value = true;
2917
- setTimeout(() => {
2918
- visiable.value = false;
2919
- }, duration || 2e3);
2770
+ const closed = () => {
2771
+ emit("close");
2772
+ };
2773
+ const pannelWidthClass = computed(() => {
2774
+ const { availWidth, availHeight } = window.screen;
2775
+ return availWidth / availHeight > 1 ? "lw-24 rw-37" : "rw-74-vw";
2776
+ });
2777
+ const theme2 = computed(() => {
2778
+ return {
2779
+ bg: "light",
2780
+ text: "dark",
2781
+ line: "lgray",
2782
+ ok: "blue",
2783
+ cancel: "mgray",
2784
+ ...props == null ? void 0 : props.theme
2785
+ };
2786
+ });
2787
+ const ok = () => {
2788
+ var _a;
2789
+ emit("ok");
2790
+ (_a = props.ok) == null ? void 0 : _a.call(props);
2791
+ visiable.value = false;
2792
+ };
2793
+ const cancel = () => {
2794
+ var _a;
2795
+ emit("cancel");
2796
+ (_a = props.cancel) == null ? void 0 : _a.call(props);
2797
+ visiable.value = false;
2920
2798
  };
2921
2799
  __expose({
2922
- show
2800
+ show: () => {
2801
+ visiable.value = true;
2802
+ }
2923
2803
  });
2924
2804
  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
- }
2805
+ return openBlock(), createBlock(_sfc_main$8, {
2806
+ visiable: visiable.value,
2807
+ "onUpdate:visiable": _cache[0] || (_cache[0] = ($event) => visiable.value = $event),
2808
+ "matte-close-forbid": true,
2809
+ onClosed: closed,
2810
+ dir: "center",
2811
+ "ani-name": ["ani-fade-in", "ani-fade-out"],
2812
+ "matte-color": _ctx.matteColor
2933
2813
  }, {
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
- }
2814
+ custom: withCtx(() => [
2815
+ createVNode(_sfc_main$v, {
2816
+ class: normalizeClass(`bg-color-${theme2.value.bg} round-md ${pannelWidthClass.value} pcenter`)
2942
2817
  }, {
2943
2818
  default: withCtx(() => [
2944
- renderSlot(_ctx.$slots, "default")
2819
+ createVNode(_sfc_main$v, {
2820
+ class: normalizeClass(`color-${theme2.value.text} pad-3d4 fsize-1d4 bolder-470`)
2821
+ }, {
2822
+ default: withCtx(() => [
2823
+ createTextVNode(toDisplayString(_ctx.notic), 1)
2824
+ ]),
2825
+ _: 1
2826
+ }, 8, ["class"]),
2827
+ createVNode(_sfc_main$v, {
2828
+ class: normalizeClass(`flex solid-t bolder-470 line-${theme2.value.line} thick-d4 fsize-1d44`)
2829
+ }, {
2830
+ default: withCtx(() => [
2831
+ _ctx.type === "confirm" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2832
+ createVNode(_sfc_main$t, {
2833
+ class: normalizeClass(`color-${theme2.value.cancel} solid-r thick-d4 line-${theme2.value.line} round-md round-3 flex-5 pad-v-1d4 w-50-P`),
2834
+ active: "bg-color-neutral",
2835
+ onOn_click: cancel
2836
+ }, {
2837
+ default: withCtx(() => {
2838
+ var _a;
2839
+ return [
2840
+ createTextVNode(toDisplayString(((_a = _ctx.text) == null ? void 0 : _a.cancel) ?? "取消"), 1)
2841
+ ];
2842
+ }),
2843
+ _: 1
2844
+ }, 8, ["class"]),
2845
+ createVNode(_sfc_main$t, {
2846
+ class: normalizeClass(`color-${theme2.value.ok} round-md round-4 flex-5 pad-v-1d4 w-50-P`),
2847
+ active: "bg-color-neutral",
2848
+ onOn_click: ok
2849
+ }, {
2850
+ default: withCtx(() => {
2851
+ var _a;
2852
+ return [
2853
+ createTextVNode(toDisplayString(((_a = _ctx.text) == null ? void 0 : _a.ok) ?? "确定"), 1)
2854
+ ];
2855
+ }),
2856
+ _: 1
2857
+ }, 8, ["class"])
2858
+ ], 64)) : (openBlock(), createBlock(_sfc_main$t, {
2859
+ key: 1,
2860
+ class: normalizeClass(`color-${theme2.value.ok} round-b round-md flex-5 pad-v-1d4 grow-1`),
2861
+ active: "bg-color-neutral",
2862
+ onOn_click: ok
2863
+ }, {
2864
+ default: withCtx(() => {
2865
+ var _a;
2866
+ return [
2867
+ createTextVNode(toDisplayString(((_a = _ctx.text) == null ? void 0 : _a.ok) ?? "确定"), 1)
2868
+ ];
2869
+ }),
2870
+ _: 1
2871
+ }, 8, ["class"]))
2872
+ ]),
2873
+ _: 1
2874
+ }, 8, ["class"])
2945
2875
  ]),
2946
- _: 3
2947
- }, 8, ["state"])
2876
+ _: 1
2877
+ }, 8, ["class"])
2948
2878
  ]),
2949
- _: 3
2950
- }, 8, ["class", "state"]);
2879
+ _: 1
2880
+ }, 8, ["visiable", "matte-color"]);
2951
2881
  };
2952
2882
  }
2953
2883
  });
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
- }
2884
+ const showToast = (text, duration = 2e3, icon = "", extra = {}) => {
2885
+ var _a, _b;
2886
+ const $toastContainer = document.createElement("div");
2887
+ $toastContainer.setAttribute("id", "BTXUI-toast");
2888
+ document.body.appendChild($toastContainer);
2889
+ const vNode = createVNode(_sfc_main$7, {
2890
+ text,
2891
+ duration,
2892
+ icon,
2893
+ extra,
2894
+ onClose: () => {
2895
+ render(null, $toastContainer);
2896
+ document.body.removeChild($toastContainer);
2897
+ }
2898
+ });
2899
+ render(vNode, $toastContainer);
2900
+ setTimeout((_b = (_a = vNode.component) == null ? void 0 : _a.exposed) == null ? void 0 : _b.show, 40);
2901
+ return vNode;
2902
+ };
2903
+ let cacheVNode;
2904
+ const cacheVNodeClose = () => {
2905
+ var _a, _b;
2906
+ (_b = (_a = cacheVNode.component) == null ? void 0 : _a.exposed) == null ? void 0 : _b.close();
2907
+ };
2908
+ const showLoadToast = (text = "数据加载中") => {
2909
+ cacheVNode = showToast(text, 0, "load", {
2910
+ type: "loading"
2911
+ });
2912
+ };
2913
+ const hideLoadToast = (text, icon) => {
2914
+ if (text) {
2915
+ cacheVNode.component.props.text = text;
2916
+ cacheVNode.component.props.icon = icon;
2917
+ cacheVNode.component.props.extra.type = "";
2918
+ setTimeout(cacheVNodeClose, 1e3);
2919
+ } else {
2920
+ cacheVNodeClose();
2921
+ }
2922
+ };
2923
+ let cacheConfirmTheme = {
2924
+ theme: {},
2925
+ matte: ""
2926
+ };
2927
+ const _confirm = (type, notic, ok, cancel) => {
2928
+ var _a, _b;
2929
+ const $toastContainer = document.createElement("div");
2930
+ $toastContainer.setAttribute("id", "BTXUI-confirm");
2931
+ document.body.appendChild($toastContainer);
2932
+ const vNode = createVNode(_sfc_main$6, {
2933
+ type,
2934
+ notic,
2935
+ ok,
2936
+ cancel,
2937
+ theme: cacheConfirmTheme.theme,
2938
+ matteColor: cacheConfirmTheme.matte,
2939
+ onClose: () => {
2940
+ render(null, $toastContainer);
2941
+ document.body.removeChild($toastContainer);
2942
+ }
2943
+ });
2944
+ render(vNode, $toastContainer);
2945
+ setTimeout((_b = (_a = vNode.component) == null ? void 0 : _a.exposed) == null ? void 0 : _b.show, 40);
2946
+ return vNode;
2947
+ };
2948
+ const confirmTheme = (theme2, matteColor) => {
2949
+ cacheConfirmTheme.theme = theme2;
2950
+ cacheConfirmTheme.matte = matteColor;
2951
+ };
2952
+ const showAlert = (notic, ok) => {
2953
+ _confirm("alert", notic, ok);
2954
+ };
2955
+ const showConfirm = (notic, ok, cancel) => {
2956
+ _confirm("confirm", notic, ok, cancel);
2957
+ };
2958
+ const upload = (extra) => {
2959
+ const $input = document.createElement("input");
2960
+ $input.type = "file";
2961
+ if (extra == null ? void 0 : extra.camera) {
2962
+ $input.capture = "user";
2963
+ $input.accept = "image/*";
2964
+ }
2965
+ document.body.appendChild($input);
2966
+ return new Promise((resolve) => {
2967
+ $input.onchange = (e) => {
2968
+ const target = e.target;
2969
+ if (target.files)
2970
+ resolve(target.files);
3012
2971
  };
3013
- const hide = () => {
3014
- emit("update:visiable", false);
2972
+ $input.click();
2973
+ document.body.removeChild($input);
2974
+ });
2975
+ };
2976
+ const compress = (file, compress2) => {
2977
+ return new Promise((resolve, reject) => {
2978
+ const reader = new FileReader();
2979
+ reader.readAsDataURL(file);
2980
+ reader.onload = function() {
2981
+ const img = new Image();
2982
+ img.src = reader.result;
2983
+ img.onload = function() {
2984
+ const canvas = document.createElement("canvas");
2985
+ const ctx = canvas.getContext("2d");
2986
+ const { naturalHeight, naturalWidth } = img;
2987
+ const ratio = naturalWidth / naturalHeight;
2988
+ canvas.width = (compress2 == null ? void 0 : compress2.width) || naturalWidth;
2989
+ canvas.height = (compress2 == null ? void 0 : compress2.height) || canvas.width / ratio;
2990
+ ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
2991
+ canvas.toBlob((blob) => {
2992
+ resolve(new File([blob], file.name, {
2993
+ type: blob.type,
2994
+ lastModified: (/* @__PURE__ */ new Date()).getTime()
2995
+ }));
2996
+ }, file.type, (compress2 == null ? void 0 : compress2.quality) || 0.7);
2997
+ };
2998
+ img.onerror = reject;
3015
2999
  };
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"]);
3000
+ reader.onerror = reject;
3001
+ });
3002
+ };
3003
+ const uploadImage = async (imageCompress, extra) => {
3004
+ const files = await upload(extra);
3005
+ const file = await compress(files[0], imageCompress);
3006
+ const fileReader = new FileReader();
3007
+ fileReader.readAsDataURL(file);
3008
+ return new Promise((resolve) => {
3009
+ fileReader.onload = (e) => {
3010
+ var _a;
3011
+ resolve({
3012
+ file,
3013
+ preview: (_a = e.target) == null ? void 0 : _a.result
3014
+ });
3106
3015
  };
3107
- }
3108
- });
3109
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
3110
- __name: "content-node-wid",
3016
+ });
3017
+ };
3018
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
3019
+ __name: "img-upload-wid",
3111
3020
  props: {
3112
- dataTree: {},
3113
- gap: {},
3114
- indent: {},
3115
- hover: {},
3116
- active: {}
3021
+ preview: {},
3022
+ cover: {},
3023
+ size: {},
3024
+ multiple: { type: Boolean },
3025
+ bsize: {},
3026
+ compress: {},
3027
+ camera: { type: Boolean }
3117
3028
  },
3118
- emits: ["on_select"],
3029
+ emits: ["update:preview", "on_upload"],
3119
3030
  setup(__props, { emit }) {
3120
3031
  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;
3032
+ const size = computed(() => props.compress ? 1024 * 1024 * 20 : props.size);
3033
+ const imgUpload = async (files, checkResult) => {
3034
+ if (checkResult.success) {
3035
+ let file = files[0];
3036
+ const fileReader = new FileReader();
3037
+ fileReader.readAsDataURL(files[0]);
3038
+ fileReader.onload = (e) => {
3039
+ var _a;
3040
+ emit("update:preview", (_a = e.target) == null ? void 0 : _a.result);
3041
+ };
3042
+ if (props.compress)
3043
+ file = await compress(files[0], props.compress);
3044
+ emit("on_upload", file, checkResult);
3045
+ }
3135
3046
  };
3136
3047
  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);
3048
+ const _component_b_view = resolveComponent("b-view");
3049
+ const _component_b_icon = resolveComponent("b-icon");
3050
+ return openBlock(), createBlock(_sfc_main$9, {
3051
+ onOn_upload: imgUpload,
3052
+ size: size.value,
3053
+ multiple: _ctx.multiple,
3054
+ camera: _ctx.camera,
3055
+ type: ["image/jpeg", "image/png", "image/gif"]
3056
+ }, {
3057
+ default: withCtx(() => {
3058
+ var _a, _b, _c, _d, _e, _f;
3059
+ return [
3060
+ _ctx.preview ? (openBlock(), createBlock(_component_b_view, {
3061
+ key: 0,
3062
+ class: normalizeClass(`w-${((_a = _ctx.cover) == null ? void 0 : _a.width) || 7} h-${((_b = _ctx.cover) == null ? void 0 : _b.height) || 7} bsize-${_ctx.bsize || "cover"} bpos-2 round-sm bg-color-neutral`),
3063
+ "bg-img": _ctx.preview
3064
+ }, null, 8, ["class", "bg-img"])) : (openBlock(), createBlock(_component_b_icon, {
3065
+ key: 1,
3066
+ icon: "add",
3067
+ class: normalizeClass(`flex-5 w-${((_c = _ctx.cover) == null ? void 0 : _c.width) || 7} h-${((_d = _ctx.cover) == null ? void 0 : _d.height) || 7} ${((_e = _ctx.cover) == null ? void 0 : _e.color) ? "color-" + ((_f = _ctx.cover) == null ? void 0 : _f.color) : ""} round-sm bg-color-neutral`)
3068
+ }, null, 8, ["class"]))
3069
+ ];
3070
+ }),
3071
+ _: 1
3072
+ }, 8, ["size", "multiple", "camera"]);
3203
3073
  };
3204
3074
  }
3205
3075
  });
3206
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
3207
- __name: "content-wid",
3076
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
3077
+ __name: "app-wid",
3208
3078
  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;
3079
+ path: {},
3080
+ spread: {},
3081
+ iconTransAni: { type: Boolean },
3082
+ center: {},
3083
+ colors: {},
3084
+ round: { type: Boolean },
3085
+ keepAlive: { type: Boolean }
3086
+ },
3087
+ emits: ["on_toggle"],
3088
+ setup(__props) {
3089
+ const props = __props;
3090
+ const curRoute = computed(() => props.path);
3091
+ const navs = computed(() => {
3092
+ const spread = [...props.spread];
3093
+ if (props.center) {
3094
+ spread.splice(Math.floor(spread.length / 2), 0, reactive({ ...props.center, main: true }));
3256
3095
  }
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
- };
3096
+ return spread;
3097
+ });
3263
3098
  return (_ctx, _cache) => {
3264
- return openBlock(), createBlock(_sfc_main$s, {
3265
- onOn_click: select,
3266
- "event-proxy": true
3099
+ var _a;
3100
+ const _component_router_view = resolveComponent("router-view");
3101
+ return openBlock(), createBlock(_sfc_main$v, {
3102
+ class: normalizeClass(`max fixed flex-column color-light select-none bg-color-${((_a = _ctx.colors) == null ? void 0 : _a.bg) || "none"}`)
3267
3103
  }, {
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"])))
3104
+ default: withCtx(() => {
3105
+ var _a2;
3106
+ return [
3107
+ createVNode(_sfc_main$v, { class: "rel grow-1" }, {
3108
+ default: withCtx(() => [
3109
+ createVNode(_sfc_main$j, {
3110
+ scroll: { y: "auto", x: "hidden" },
3111
+ class: "abs max"
3112
+ }, {
3113
+ default: withCtx(() => [
3114
+ _ctx.keepAlive ? (openBlock(), createBlock(KeepAlive, { key: 0 }, [
3115
+ createVNode(_component_router_view)
3116
+ ], 1024)) : (openBlock(), createBlock(_component_router_view, { key: 1 }))
3117
+ ]),
3118
+ _: 1
3119
+ })
3274
3120
  ]),
3275
- key: "0"
3276
- } : void 0
3277
- ]), 1040)) : createCommentVNode("", true)
3278
- ]),
3279
- _: 3
3280
- });
3121
+ _: 1
3122
+ }),
3123
+ createVNode(_sfc_main$v, {
3124
+ class: normalizeClass(`pcenter pad-t-d5 flex-1 ${_ctx.round ? "round-md round-t" : ""} bg-color-${((_a2 = _ctx.colors) == null ? void 0 : _a2.bar) || "dark"} solid-t line-neutral thick-d4 app-nav-bar`)
3125
+ }, {
3126
+ default: withCtx(() => [
3127
+ (openBlock(true), createElementBlock(Fragment, null, renderList(navs.value, (nav, i) => {
3128
+ return openBlock(), createBlock(_sfc_main$t, mergeProps({ key: i }, nav.hotData, {
3129
+ class: "grow-1",
3130
+ onOn_click: ($event) => _ctx.$emit("on_toggle", nav)
3131
+ }), {
3132
+ default: withCtx(() => {
3133
+ var _a3, _b, _c, _d, _e, _f;
3134
+ return [
3135
+ nav.main ? (openBlock(), createBlock(_sfc_main$v, {
3136
+ key: 0,
3137
+ class: "rel w-5 mrg-h-auto"
3138
+ }, {
3139
+ default: withCtx(() => {
3140
+ var _a4, _b2, _c2, _d2;
3141
+ return [
3142
+ createVNode(_sfc_main$n, mergeProps(nav.iconData, {
3143
+ class: `abs flex-5 solid t-f1d4 thick-2 w-5 h-5 round fsize-1d7 line-${((_b2 = (_a4 = _ctx.colors) == null ? void 0 : _a4.center) == null ? void 0 : _b2.line) || "neutral"} bg-color-${((_d2 = (_c2 = _ctx.colors) == null ? void 0 : _c2.center) == null ? void 0 : _d2.bg) || "dgray"}`
3144
+ }), null, 16, ["class"])
3145
+ ];
3146
+ }),
3147
+ _: 2
3148
+ }, 1024)) : (openBlock(), createBlock(_sfc_main$v, {
3149
+ key: 1,
3150
+ class: normalizeClass(`flex-column rel flex-5 color-${((_b = (_a3 = _ctx.colors) == null ? void 0 : _a3.text) == null ? void 0 : _b.normal) || "mgray"}`),
3151
+ cname: ((_d = (_c = _ctx.colors) == null ? void 0 : _c.text) == null ? void 0 : _d.act) || "light",
3152
+ state: curRoute.value === nav.hotData.link ? "act" : "",
3153
+ states: {
3154
+ act: `color-${((_f = (_e = _ctx.colors) == null ? void 0 : _e.text) == null ? void 0 : _f.act) || "light"}`
3155
+ }
3156
+ }, {
3157
+ default: withCtx(() => [
3158
+ nav.unread === 1 ? (openBlock(), createBlock(_sfc_main$v, {
3159
+ key: 0,
3160
+ class: "round w-d7 h-d7 r-9d2-vw t-d2 bg-color-red abs"
3161
+ })) : createCommentVNode("", true),
3162
+ nav.unread > 1 ? (openBlock(), createBlock(_sfc_main$v, {
3163
+ key: 1,
3164
+ class: "flex-5 round w-1d5 h-1d5 bold r-7d7-vw t-fd5 bg-color-red abs color-Cfff"
3165
+ }, {
3166
+ default: withCtx(() => [
3167
+ createTextVNode(toDisplayString(nav.unread), 1)
3168
+ ]),
3169
+ _: 2
3170
+ }, 1024)) : createCommentVNode("", true),
3171
+ createVNode(_sfc_main$n, mergeProps(nav.iconData, {
3172
+ cname: nav.act,
3173
+ state: curRoute.value === nav.hotData.link ? "act" : "",
3174
+ states: {
3175
+ act: nav.act ?? ""
3176
+ },
3177
+ class: `w-2d7 h-2d7 ${_ctx.iconTransAni ? "trans-fast" : ""} fsize-1d7`
3178
+ }), null, 16, ["cname", "state", "states", "class"]),
3179
+ nav.text ? (openBlock(), createBlock(_sfc_main$u, {
3180
+ key: 2,
3181
+ class: "fsize-d83"
3182
+ }, {
3183
+ default: withCtx(() => [
3184
+ createTextVNode(toDisplayString(nav.text), 1)
3185
+ ]),
3186
+ _: 2
3187
+ }, 1024)) : createCommentVNode("", true)
3188
+ ]),
3189
+ _: 2
3190
+ }, 1032, ["class", "cname", "state", "states"]))
3191
+ ];
3192
+ }),
3193
+ _: 2
3194
+ }, 1040, ["onOn_click"]);
3195
+ }), 128))
3196
+ ]),
3197
+ _: 1
3198
+ }, 8, ["class"])
3199
+ ];
3200
+ }),
3201
+ _: 1
3202
+ }, 8, ["class"]);
3281
3203
  };
3282
3204
  }
3283
3205
  });
3284
- const contentWid_vue_vue_type_style_index_0_lang = "";
3285
- const _sfc_main = /* @__PURE__ */ defineComponent({
3206
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
3286
3207
  __name: "datetime-wid",
3287
3208
  props: {
3288
3209
  datetime: {},
@@ -3493,19 +3414,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3493
3414
  ]),
3494
3415
  _: 3
3495
3416
  }),
3496
- modalData.dir ? (openBlock(), createBlock(_sfc_main$3, mergeProps({
3417
+ modalData.dir ? (openBlock(), createBlock(_sfc_main$8, mergeProps({
3497
3418
  key: 0,
3498
3419
  visiable: state.value,
3499
3420
  "onUpdate:visiable": _cache[6] || (_cache[6] = ($event) => state.value = $event)
3500
3421
  }, modalData), {
3501
3422
  default: withCtx(() => [
3502
- createVNode(_sfc_main$u, { class: "flex-4 pad-t-1 lw-24" }, {
3423
+ createVNode(_sfc_main$v, { class: "flex-4 pad-t-1 lw-24" }, {
3503
3424
  default: withCtx(() => [
3504
3425
  createVNode(_component_b_icon, {
3505
3426
  icon: "time",
3506
3427
  class: "alpha-d7 mrg-r-d7"
3507
3428
  }),
3508
- curTime.y.show ? (openBlock(), createBlock(_sfc_main$u, { key: 0 }, {
3429
+ curTime.y.show ? (openBlock(), createBlock(_sfc_main$v, { key: 0 }, {
3509
3430
  default: withCtx(() => [
3510
3431
  createVNode(_component_b_hot, {
3511
3432
  onOn_click: _cache[0] || (_cache[0] = ($event) => curOper.value = "y"),
@@ -3527,7 +3448,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3527
3448
  ]),
3528
3449
  _: 1
3529
3450
  })) : createCommentVNode("", true),
3530
- curTime.m.show ? (openBlock(), createBlock(_sfc_main$u, { key: 1 }, {
3451
+ curTime.m.show ? (openBlock(), createBlock(_sfc_main$v, { key: 1 }, {
3531
3452
  default: withCtx(() => [
3532
3453
  createVNode(_component_b_hot, {
3533
3454
  onOn_click: _cache[1] || (_cache[1] = ($event) => curOper.value = "m"),
@@ -3549,7 +3470,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3549
3470
  ]),
3550
3471
  _: 1
3551
3472
  })) : createCommentVNode("", true),
3552
- curTime.d.show ? (openBlock(), createBlock(_sfc_main$u, { key: 2 }, {
3473
+ curTime.d.show ? (openBlock(), createBlock(_sfc_main$v, { key: 2 }, {
3553
3474
  default: withCtx(() => [
3554
3475
  createVNode(_component_b_hot, {
3555
3476
  onOn_click: _cache[2] || (_cache[2] = ($event) => curOper.value = "d"),
@@ -3571,11 +3492,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3571
3492
  ]),
3572
3493
  _: 1
3573
3494
  })) : createCommentVNode("", true),
3574
- twoSides.value ? (openBlock(), createBlock(_sfc_main$u, {
3495
+ twoSides.value ? (openBlock(), createBlock(_sfc_main$v, {
3575
3496
  key: 3,
3576
3497
  class: "w-1d4"
3577
3498
  })) : createCommentVNode("", true),
3578
- curTime.h.show ? (openBlock(), createBlock(_sfc_main$u, { key: 4 }, {
3499
+ curTime.h.show ? (openBlock(), createBlock(_sfc_main$v, { key: 4 }, {
3579
3500
  default: withCtx(() => [
3580
3501
  createVNode(_component_b_hot, {
3581
3502
  onOn_click: _cache[3] || (_cache[3] = ($event) => curOper.value = "h"),
@@ -3597,7 +3518,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3597
3518
  ]),
3598
3519
  _: 1
3599
3520
  })) : createCommentVNode("", true),
3600
- curTime.i.show ? (openBlock(), createBlock(_sfc_main$u, { key: 5 }, {
3521
+ curTime.i.show ? (openBlock(), createBlock(_sfc_main$v, { key: 5 }, {
3601
3522
  default: withCtx(() => [
3602
3523
  createVNode(_component_b_hot, {
3603
3524
  onOn_click: _cache[4] || (_cache[4] = ($event) => curOper.value = "i"),
@@ -3619,107 +3540,568 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3619
3540
  ]),
3620
3541
  _: 1
3621
3542
  })) : createCommentVNode("", true),
3622
- curTime.s.show ? (openBlock(), createBlock(_sfc_main$u, { key: 6 }, {
3543
+ curTime.s.show ? (openBlock(), createBlock(_sfc_main$v, { key: 6 }, {
3544
+ default: withCtx(() => [
3545
+ createVNode(_component_b_hot, {
3546
+ onOn_click: _cache[5] || (_cache[5] = ($event) => curOper.value = "s"),
3547
+ cname: "s",
3548
+ state: curOper.value,
3549
+ states: { s: "color-green" }
3550
+ }, {
3551
+ default: withCtx(() => [
3552
+ createTextVNode(toDisplayString(padZero(curTime.s.val)), 1)
3553
+ ]),
3554
+ _: 1
3555
+ }, 8, ["state"]),
3556
+ createVNode(_component_b_text, { class: "pad-h-d4 alpha-d4" }, {
3557
+ default: withCtx(() => [
3558
+ createTextVNode("秒")
3559
+ ]),
3560
+ _: 1
3561
+ })
3562
+ ]),
3563
+ _: 1
3564
+ })) : createCommentVNode("", true)
3565
+ ]),
3566
+ _: 1
3567
+ }),
3568
+ createVNode(_sfc_main$v, { class: "flex" }, {
3569
+ default: withCtx(() => [
3570
+ createVNode(_component_b_list, {
3571
+ class: "grow-1 h-17 bg-color-neutral mrg-v-1 round-md pad-1",
3572
+ scroll: { x: "auto", y: "auto" }
3573
+ }, {
3574
+ default: withCtx(() => [
3575
+ createVNode(_component_b_hot, {
3576
+ onOn_click: selectDateTime,
3577
+ ref_key: "$list",
3578
+ ref: $list
3579
+ }, {
3580
+ default: withCtx(() => [
3581
+ (openBlock(true), createElementBlock(Fragment, null, renderList(options.value, (opt) => {
3582
+ return openBlock(), createBlock(_sfc_main$v, {
3583
+ state: opt,
3584
+ hover: "bg-color-neutral",
3585
+ class: "h-3 pad-h-1 lh-3-rem flex round-sm alpha-d7"
3586
+ }, {
3587
+ default: withCtx(() => [
3588
+ createTextVNode(toDisplayString(padZero(opt)) + " ", 1),
3589
+ createVNode(_component_b_text, { class: "pad-l-d4 alpha-d4" }, {
3590
+ default: withCtx(() => [
3591
+ createTextVNode(toDisplayString(datetimeMap[curOper.value]), 1)
3592
+ ]),
3593
+ _: 1
3594
+ })
3595
+ ]),
3596
+ _: 2
3597
+ }, 1032, ["state"]);
3598
+ }), 256))
3599
+ ]),
3600
+ _: 1
3601
+ }, 512)
3602
+ ]),
3603
+ _: 1
3604
+ })
3605
+ ]),
3606
+ _: 1
3607
+ }),
3608
+ createVNode(_component_btn_wid, mergeProps(btnData.value, { onOn_click: ok }), null, 16)
3609
+ ]),
3610
+ _: 1
3611
+ }, 16, ["visiable"])) : createCommentVNode("", true)
3612
+ ], 64);
3613
+ };
3614
+ }
3615
+ });
3616
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
3617
+ __name: "price-wid",
3618
+ props: {
3619
+ price: {},
3620
+ matteColor: {},
3621
+ matteCloseForbid: { type: Boolean },
3622
+ theme: {}
3623
+ },
3624
+ emits: ["sendPrice", "update:price"],
3625
+ setup(__props, { expose: __expose, emit }) {
3626
+ const props = __props;
3627
+ const theme2 = reactive({
3628
+ dir: "",
3629
+ pannel: "lgray",
3630
+ text: "dgray",
3631
+ btn: {
3632
+ normal: "light",
3633
+ active: "neutral"
3634
+ },
3635
+ btn2: {
3636
+ normal: "yellow",
3637
+ active: "yellow"
3638
+ },
3639
+ ...props.theme
3640
+ });
3641
+ onMounted(() => {
3642
+ const { availWidth, availHeight } = window.screen;
3643
+ theme2.dir = availWidth / availHeight > 1 ? "center" : "bottom";
3644
+ });
3645
+ const price = ref(props.price.toString());
3646
+ const state = ref(false);
3647
+ const selPrice = (e) => {
3648
+ const x = e.clientX;
3649
+ const y = e.clientY;
3650
+ let element = document.elementFromPoint(x, y);
3651
+ let priceStr = price.value || "";
3652
+ switch (element.getAttribute("state")) {
3653
+ case ".":
3654
+ if (priceStr === "") {
3655
+ priceStr = "0.";
3656
+ } else if (priceStr.indexOf(".") === -1) {
3657
+ priceStr += ".";
3658
+ }
3659
+ break;
3660
+ case "delete":
3661
+ priceStr = priceStr.slice(0, -1);
3662
+ break;
3663
+ case "ok":
3664
+ sendPrice();
3665
+ break;
3666
+ default:
3667
+ const price2 = priceStr.split(".");
3668
+ const decimal = price2[1];
3669
+ const integer = price2[0];
3670
+ if (priceStr === "0") {
3671
+ priceStr = element.innerText;
3672
+ } else if ((integer.length < 7 || priceStr[7] === ".") && ((decimal == null ? void 0 : decimal.length) < 2 || !decimal && (element.innerText === "0" && priceStr !== "0" || element.innerText !== "0"))) {
3673
+ priceStr += element.innerText;
3674
+ }
3675
+ }
3676
+ price.value = priceStr;
3677
+ };
3678
+ const sendPrice = () => {
3679
+ if (!price.value) {
3680
+ showToast("需先填写金额", 2e3, "warning");
3681
+ return;
3682
+ }
3683
+ const priceNum = parseFloat(price.value);
3684
+ if (priceNum <= 0) {
3685
+ showToast("输入金额错误", 2e3, "warning");
3686
+ return;
3687
+ }
3688
+ emit("sendPrice", priceNum);
3689
+ emit("update:price", priceNum);
3690
+ nextTick(hide);
3691
+ };
3692
+ const show = () => {
3693
+ state.value = true;
3694
+ };
3695
+ const hide = () => {
3696
+ state.value = false;
3697
+ };
3698
+ const clear = () => {
3699
+ price.value = "";
3700
+ };
3701
+ __expose({
3702
+ show,
3703
+ hide,
3704
+ clear
3705
+ });
3706
+ return (_ctx, _cache) => {
3707
+ const _component_b_hot = resolveComponent("b-hot");
3708
+ const _component_b_text = resolveComponent("b-text");
3709
+ const _component_b_input = resolveComponent("b-input");
3710
+ const _component_b_col = resolveComponent("b-col");
3711
+ const _component_b_row = resolveComponent("b-row");
3712
+ return openBlock(), createElementBlock(Fragment, null, [
3713
+ createVNode(_component_b_hot, { onOn_click: show }, {
3714
+ default: withCtx(() => [
3715
+ renderSlot(_ctx.$slots, "default")
3716
+ ]),
3717
+ _: 3
3718
+ }),
3719
+ theme2.dir ? (openBlock(), createBlock(_sfc_main$8, {
3720
+ key: 0,
3721
+ visiable: state.value,
3722
+ "onUpdate:visiable": _cache[1] || (_cache[1] = ($event) => state.value = $event),
3723
+ dir: theme2.dir,
3724
+ "matte-color": _ctx.matteColor,
3725
+ "matte-close-forbid": _ctx.matteCloseForbid
3726
+ }, {
3727
+ custom: withCtx(() => [
3728
+ createVNode(_sfc_main$v, {
3729
+ class: normalizeClass(`${theme2.dir === "center" ? "w-30 round-md fsize-1d3" : "fsize-1d6"} bg-color-${theme2.pannel} color-${theme2.text}`)
3730
+ }, {
3731
+ default: withCtx(() => [
3732
+ _ctx.$slots.screen ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createBlock(_sfc_main$v, {
3733
+ key: 1,
3734
+ class: "flex-4 no-wrap pad-1d4"
3735
+ }, {
3623
3736
  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
- }, {
3737
+ createVNode(_component_b_text, { class: "fsize-2d4 bold alpha-d4" }, {
3630
3738
  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" }, {
3636
- default: withCtx(() => [
3637
- createTextVNode("秒")
3739
+ createTextVNode("¥")
3638
3740
  ]),
3639
3741
  _: 1
3640
- })
3742
+ }),
3743
+ createVNode(_component_b_input, {
3744
+ text: price.value,
3745
+ "onUpdate:text": _cache[0] || (_cache[0] = ($event) => price.value = $event),
3746
+ type: "text",
3747
+ readonly: true,
3748
+ class: normalizeClass(`grow-1 bg-color-none fsize-3 bolder-500 line-none color-${theme2.text}`)
3749
+ }, null, 8, ["text", "class"])
3641
3750
  ]),
3642
3751
  _: 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
- }, {
3752
+ })),
3753
+ createVNode(_sfc_main$v, { class: "pad-b-2 bolder-500" }, {
3653
3754
  default: withCtx(() => [
3654
- createVNode(_component_b_hot, {
3655
- onOn_click: selectDateTime,
3656
- ref_key: "$list",
3657
- ref: $list
3658
- }, {
3755
+ createVNode(_component_b_hot, { onOn_click: selPrice }, {
3659
3756
  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" }, {
3757
+ createVNode(_component_b_row, { gap: ".7" }, {
3758
+ default: withCtx(() => [
3759
+ (openBlock(), createElementBlock(Fragment, null, renderList(3, (num) => {
3760
+ return createVNode(_component_b_col, { span: 3 }, {
3669
3761
  default: withCtx(() => [
3670
- createTextVNode(toDisplayString(datetimeMap[curOper.value]), 1)
3762
+ createVNode(_component_b_hot, {
3763
+ class: normalizeClass(`bg-color-${theme2.btn.normal} flex-5 round-sm h-4d2`),
3764
+ active: `bg-color-${theme2.btn.active}`,
3765
+ state: num
3766
+ }, {
3767
+ default: withCtx(() => [
3768
+ createTextVNode(toDisplayString(num), 1)
3769
+ ]),
3770
+ _: 2
3771
+ }, 1032, ["class", "active", "state"])
3671
3772
  ]),
3672
- _: 1
3673
- })
3674
- ]),
3675
- _: 2
3676
- }, 1032, ["state"]);
3677
- }), 256))
3773
+ _: 2
3774
+ }, 1024);
3775
+ }), 64)),
3776
+ createVNode(_component_b_col, { span: 3 }, {
3777
+ default: withCtx(() => [
3778
+ createVNode(_component_b_hot, {
3779
+ class: normalizeClass(`bg-color-${theme2.btn.normal} flex-5 round-sm h-4d2`),
3780
+ active: `bg-color-${theme2.btn.active}`,
3781
+ state: "delete"
3782
+ }, {
3783
+ default: withCtx(() => [
3784
+ _ctx.$slots.delete ? renderSlot(_ctx.$slots, "delete", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
3785
+ createTextVNode("删除")
3786
+ ], 64))
3787
+ ]),
3788
+ _: 3
3789
+ }, 8, ["class", "active"])
3790
+ ]),
3791
+ _: 3
3792
+ }),
3793
+ (openBlock(), createElementBlock(Fragment, null, renderList(3, (num) => {
3794
+ return createVNode(_component_b_col, { span: 3 }, {
3795
+ default: withCtx(() => [
3796
+ createVNode(_component_b_hot, {
3797
+ class: normalizeClass(`bg-color-${theme2.btn.normal} flex-5 round-sm h-4d2`),
3798
+ active: `bg-color-${theme2.btn.active}`,
3799
+ state: num
3800
+ }, {
3801
+ default: withCtx(() => [
3802
+ createTextVNode(toDisplayString(num + 3), 1)
3803
+ ]),
3804
+ _: 2
3805
+ }, 1032, ["class", "active", "state"])
3806
+ ]),
3807
+ _: 2
3808
+ }, 1024);
3809
+ }), 64)),
3810
+ createVNode(_component_b_col, { span: 3 }),
3811
+ (openBlock(), createElementBlock(Fragment, null, renderList(3, (num) => {
3812
+ return createVNode(_component_b_col, { span: 3 }, {
3813
+ default: withCtx(() => [
3814
+ createVNode(_component_b_hot, {
3815
+ class: normalizeClass(`bg-color-${theme2.btn.normal} flex-5 round-sm h-4d2`),
3816
+ active: `bg-color-${theme2.btn.active}`,
3817
+ state: num
3818
+ }, {
3819
+ default: withCtx(() => [
3820
+ createTextVNode(toDisplayString(num + 6), 1)
3821
+ ]),
3822
+ _: 2
3823
+ }, 1032, ["class", "active", "state"])
3824
+ ]),
3825
+ _: 2
3826
+ }, 1024);
3827
+ }), 64)),
3828
+ createVNode(_component_b_col, { span: 3 }),
3829
+ createVNode(_component_b_col, { span: 6 }, {
3830
+ default: withCtx(() => [
3831
+ createVNode(_component_b_hot, {
3832
+ class: normalizeClass(`bg-color-${theme2.btn.normal} flex-5 round-sm h-4d2`),
3833
+ active: `bg-color-${theme2.btn.active}`,
3834
+ state: "0"
3835
+ }, {
3836
+ default: withCtx(() => [
3837
+ createTextVNode("0")
3838
+ ]),
3839
+ _: 1
3840
+ }, 8, ["class", "active"])
3841
+ ]),
3842
+ _: 1
3843
+ }),
3844
+ createVNode(_component_b_col, { span: 3 }, {
3845
+ default: withCtx(() => [
3846
+ createVNode(_component_b_hot, {
3847
+ class: normalizeClass(`bg-color-${theme2.btn.normal} flex-5 round-sm h-4d2`),
3848
+ active: `bg-color-${theme2.btn.active}`,
3849
+ state: "."
3850
+ }, {
3851
+ default: withCtx(() => [
3852
+ createTextVNode(".")
3853
+ ]),
3854
+ _: 1
3855
+ }, 8, ["class", "active"])
3856
+ ]),
3857
+ _: 1
3858
+ }),
3859
+ createVNode(_component_b_col, { span: 3 }, {
3860
+ default: withCtx(() => [
3861
+ createVNode(_sfc_main$v, { class: "rel h-4d2" }, {
3862
+ default: withCtx(() => [
3863
+ createVNode(_component_b_hot, {
3864
+ class: normalizeClass(`abs b-0 h-14 max-w bg-color-${theme2.btn2.normal} flex-5 round-sm`),
3865
+ active: `bg-color-${theme2.btn2.active}`,
3866
+ state: "ok"
3867
+ }, {
3868
+ default: withCtx(() => [
3869
+ _ctx.$slots.ok ? renderSlot(_ctx.$slots, "ok", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
3870
+ createTextVNode("转账")
3871
+ ], 64))
3872
+ ]),
3873
+ _: 3
3874
+ }, 8, ["class", "active"])
3875
+ ]),
3876
+ _: 3
3877
+ })
3878
+ ]),
3879
+ _: 3
3880
+ })
3881
+ ]),
3882
+ _: 3
3883
+ })
3678
3884
  ]),
3679
- _: 1
3680
- }, 512)
3885
+ _: 3
3886
+ })
3681
3887
  ]),
3682
- _: 1
3888
+ _: 3
3683
3889
  })
3684
3890
  ]),
3685
- _: 1
3686
- }),
3687
- createVNode(_component_btn_wid, mergeProps(btnData.value, { onOn_click: ok }), null, 16)
3891
+ _: 3
3892
+ }, 8, ["class"])
3688
3893
  ]),
3689
- _: 1
3690
- }, 16, ["visiable"])) : createCommentVNode("", true)
3894
+ _: 3
3895
+ }, 8, ["visiable", "dir", "matte-color", "matte-close-forbid"])) : createCommentVNode("", true)
3691
3896
  ], 64);
3692
3897
  };
3693
3898
  }
3694
3899
  });
3900
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
3901
+ __name: "content-node-wid",
3902
+ props: {
3903
+ dataTree: {},
3904
+ gap: {},
3905
+ indent: {},
3906
+ hover: {},
3907
+ active: {}
3908
+ },
3909
+ emits: ["on_select"],
3910
+ setup(__props, { emit }) {
3911
+ const props = __props;
3912
+ const dataTree = ref(props.dataTree || []);
3913
+ const selected = inject("selected");
3914
+ const gap = computed(() => {
3915
+ return props.gap || "d7";
3916
+ });
3917
+ const indent = computed(() => {
3918
+ return props.indent || "3";
3919
+ });
3920
+ const setIndex = (level) => {
3921
+ return (level * parseFloat(indent.value.replace("d", ".")) + parseFloat(gap.value.replace("d", "."))).toString().replace(".", "d");
3922
+ };
3923
+ const dealSlotData = (item) => {
3924
+ const { parent, children, ...extra } = item;
3925
+ return extra;
3926
+ };
3927
+ return (_ctx, _cache) => {
3928
+ const _component_b_text = resolveComponent("b-text");
3929
+ const _component_content_node_wid = resolveComponent("content-node-wid", true);
3930
+ return openBlock(true), createElementBlock(Fragment, null, renderList(dataTree.value, (item) => {
3931
+ return openBlock(), createBlock(_sfc_main$v, {
3932
+ state: `id-${item.id}`,
3933
+ key: item.id
3934
+ }, {
3935
+ default: withCtx(() => {
3936
+ var _a;
3937
+ return [
3938
+ createVNode(_sfc_main$t, {
3939
+ cname: `${item.id}-${Math.random()}`,
3940
+ class: normalizeClass(`flex-4 pad-v-${gap.value} pad-l-${setIndex(item.level)}`),
3941
+ hover: _ctx.hover,
3942
+ states: {
3943
+ true: `${_ctx.active ? _ctx.active : ""}`,
3944
+ false: ""
3945
+ },
3946
+ state: (((_a = unref(selected)) == null ? void 0 : _a.findIndex((data) => data.id === item.id)) > -1).toString()
3947
+ }, {
3948
+ default: withCtx(() => [
3949
+ item.children && item.children.length ? (openBlock(), createBlock(_sfc_main$n, {
3950
+ key: 0,
3951
+ class: "mrg-r-d4",
3952
+ state: item.spread ? "content-wid-spread" : "content-wid-collapse",
3953
+ icon: "arrow-right"
3954
+ }, null, 8, ["state"])) : createCommentVNode("", true),
3955
+ renderSlot(_ctx.$slots, "default", {
3956
+ dataItem: dealSlotData(item)
3957
+ }, () => [
3958
+ createVNode(_component_b_text, null, {
3959
+ default: withCtx(() => [
3960
+ createTextVNode(toDisplayString(item.text), 1)
3961
+ ]),
3962
+ _: 2
3963
+ }, 1024)
3964
+ ])
3965
+ ]),
3966
+ _: 2
3967
+ }, 1032, ["cname", "class", "hover", "states", "state"]),
3968
+ item.children && item.children.length ? (openBlock(), createBlock(_sfc_main$v, {
3969
+ key: 0,
3970
+ states: {
3971
+ "show": "show",
3972
+ "hide": "hide"
3973
+ },
3974
+ state: item.spread ? "show" : "hide"
3975
+ }, {
3976
+ default: withCtx(() => [
3977
+ createVNode(_component_content_node_wid, normalizeProps(guardReactiveProps({ ...props, dataTree: item.children })), createSlots({ _: 2 }, [
3978
+ _ctx.$slots.default ? {
3979
+ name: "default",
3980
+ fn: withCtx((scope) => [
3981
+ renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(scope)))
3982
+ ]),
3983
+ key: "0"
3984
+ } : void 0
3985
+ ]), 1040)
3986
+ ]),
3987
+ _: 2
3988
+ }, 1032, ["state"])) : createCommentVNode("", true)
3989
+ ];
3990
+ }),
3991
+ _: 2
3992
+ }, 1032, ["state"]);
3993
+ }), 128);
3994
+ };
3995
+ }
3996
+ });
3997
+ const _sfc_main = /* @__PURE__ */ defineComponent({
3998
+ __name: "content-wid",
3999
+ props: {
4000
+ dataTree: {},
4001
+ gap: {},
4002
+ indent: {},
4003
+ hover: {},
4004
+ active: {}
4005
+ },
4006
+ emits: ["on_select"],
4007
+ setup(__props, { emit }) {
4008
+ const props = __props;
4009
+ let prefix = 0;
4010
+ const flatDataTree = reactive([]);
4011
+ const indexDataTree = reactive({});
4012
+ const dataTree = ref(props.dataTree);
4013
+ const flatState = ref(false);
4014
+ const flatData = () => {
4015
+ const traverse = (items, parent, level = 0) => {
4016
+ for (const item of items) {
4017
+ item.level = level;
4018
+ item.prefix = prefix++;
4019
+ if (parent)
4020
+ item.parent = parent;
4021
+ if (item.children)
4022
+ item.spread = item.spread || false;
4023
+ flatDataTree.push(item);
4024
+ indexDataTree[item.id] = item;
4025
+ if (item.children && item.children.length > 0) {
4026
+ traverse(item.children, item, level + 1);
4027
+ }
4028
+ }
4029
+ };
4030
+ traverse(dataTree.value);
4031
+ };
4032
+ const selected = ref([]);
4033
+ onBeforeMount(() => {
4034
+ provide("selected", selected.value);
4035
+ });
4036
+ onMounted(() => {
4037
+ flatData();
4038
+ flatState.value = true;
4039
+ });
4040
+ const select = (e) => {
4041
+ var _a, _b;
4042
+ const x = e.clientX;
4043
+ const y = e.clientY;
4044
+ let element = document.elementFromPoint(x, y);
4045
+ while (!(((_a = element == null ? void 0 : element.getAttribute("state")) == null ? void 0 : _a.indexOf("id-")) === 0)) {
4046
+ element = element == null ? void 0 : element.parentElement;
4047
+ }
4048
+ const data = indexDataTree[(_b = element == null ? void 0 : element.getAttribute("state")) == null ? void 0 : _b.substring(3)];
4049
+ selected.value[0] = data;
4050
+ if (data.spread !== void 0)
4051
+ data.spread = !data.spread;
4052
+ emit("on_select", data);
4053
+ };
4054
+ return (_ctx, _cache) => {
4055
+ return openBlock(), createBlock(_sfc_main$t, {
4056
+ onOn_click: select,
4057
+ "event-proxy": true
4058
+ }, {
4059
+ default: withCtx(() => [
4060
+ flatState.value ? (openBlock(), createBlock(_sfc_main$1, normalizeProps(mergeProps({ key: 0 }, { ...props, dataTree: dataTree.value })), createSlots({ _: 2 }, [
4061
+ _ctx.$slots.default ? {
4062
+ name: "default",
4063
+ fn: withCtx((scope) => [
4064
+ renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(scope["dataItem"])))
4065
+ ]),
4066
+ key: "0"
4067
+ } : void 0
4068
+ ]), 1040)) : createCommentVNode("", true)
4069
+ ]),
4070
+ _: 3
4071
+ });
4072
+ };
4073
+ }
4074
+ });
4075
+ const contentWid_vue_vue_type_style_index_0_lang = "";
3695
4076
  const initGlobalComponents = [
4077
+ _sfc_main$w,
3696
4078
  _sfc_main$v,
3697
4079
  _sfc_main$u,
3698
4080
  _sfc_main$t,
3699
4081
  _sfc_main$s,
3700
- _sfc_main$r,
3701
- _sfc_main$m,
4082
+ _sfc_main$n,
4083
+ _sfc_main$k,
3702
4084
  _sfc_main$j,
4085
+ _sfc_main$h,
4086
+ _sfc_main$m,
3703
4087
  _sfc_main$i,
3704
- _sfc_main$g,
3705
4088
  _sfc_main$l,
3706
- _sfc_main$h,
3707
- _sfc_main$k,
4089
+ _sfc_main$g,
3708
4090
  _sfc_main$f,
3709
4091
  _sfc_main$e,
3710
4092
  _sfc_main$d,
3711
- _sfc_main$5,
3712
4093
  _sfc_main$c,
3713
4094
  _sfc_main$b,
3714
4095
  _sfc_main$a,
4096
+ _sfc_main$4,
3715
4097
  _sfc_main$9,
3716
- _sfc_main$6,
4098
+ _sfc_main$5,
4099
+ _sfc_main,
3717
4100
  _sfc_main$8,
4101
+ _sfc_main$6,
3718
4102
  _sfc_main$7,
3719
- _sfc_main$1,
3720
4103
  _sfc_main$3,
3721
- _sfc_main,
3722
- _sfc_main$4
4104
+ _sfc_main$2
3723
4105
  ];
3724
4106
  const index = {
3725
4107
  name: "btxui",
@@ -3737,8 +4119,11 @@ const index = {
3737
4119
  };
3738
4120
  export {
3739
4121
  compress,
4122
+ confirmTheme,
3740
4123
  index as default,
3741
4124
  hideLoadToast,
4125
+ showAlert,
4126
+ showConfirm,
3742
4127
  showLoadToast,
3743
4128
  showToast,
3744
4129
  upload,