@mingto/mt-ui 1.1.46 → 1.1.48

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.umd.js CHANGED
@@ -4838,7 +4838,190 @@
4838
4838
  name: "数字人融合web",
4839
4839
  font_family: "iconfont",
4840
4840
  css_prefix_text: "icon-",
4841
+ description: "",
4841
4842
  glyphs: [
4843
+ {
4844
+ "icon_id": "47727481",
4845
+ "name": "icon-gzjl",
4846
+ "font_class": "icon-gzjl",
4847
+ "unicode": "e608",
4848
+ "unicode_decimal": 58888
4849
+ },
4850
+ {
4851
+ "icon_id": "47727480",
4852
+ "name": "icon-csgc",
4853
+ "font_class": "icon-csgc",
4854
+ "unicode": "e60a",
4855
+ "unicode_decimal": 58890
4856
+ },
4857
+ {
4858
+ "icon_id": "47727479",
4859
+ "name": "icon-gwnl",
4860
+ "font_class": "icon-gwnl",
4861
+ "unicode": "e60b",
4862
+ "unicode_decimal": 58891
4863
+ },
4864
+ {
4865
+ "icon_id": "47601681",
4866
+ "name": "key",
4867
+ "font_class": "key-01",
4868
+ "unicode": "e74f",
4869
+ "unicode_decimal": 59215
4870
+ },
4871
+ {
4872
+ "icon_id": "47480457",
4873
+ "name": "任务对话",
4874
+ "font_class": "renwuduihua",
4875
+ "unicode": "e74e",
4876
+ "unicode_decimal": 59214
4877
+ },
4878
+ {
4879
+ "icon_id": "47478817",
4880
+ "name": "任务循环时间",
4881
+ "font_class": "renwuxunhuanshijian",
4882
+ "unicode": "e74c",
4883
+ "unicode_decimal": 59212
4884
+ },
4885
+ {
4886
+ "icon_id": "47478815",
4887
+ "name": "任务执行时间",
4888
+ "font_class": "renwuzhihangshijian",
4889
+ "unicode": "e74d",
4890
+ "unicode_decimal": 59213
4891
+ },
4892
+ {
4893
+ "icon_id": "47478832",
4894
+ "name": "任务规划",
4895
+ "font_class": "renwuguihua",
4896
+ "unicode": "e749",
4897
+ "unicode_decimal": 59209
4898
+ },
4899
+ {
4900
+ "icon_id": "47478818",
4901
+ "name": "执行记录",
4902
+ "font_class": "zhihangjilu",
4903
+ "unicode": "e74a",
4904
+ "unicode_decimal": 59210
4905
+ },
4906
+ {
4907
+ "icon_id": "47478816",
4908
+ "name": "浏览记录",
4909
+ "font_class": "liulanjilu",
4910
+ "unicode": "e74b",
4911
+ "unicode_decimal": 59211
4912
+ },
4913
+ {
4914
+ "icon_id": "47476167",
4915
+ "name": "沉浸对话",
4916
+ "font_class": "chenjinduihua",
4917
+ "unicode": "e744",
4918
+ "unicode_decimal": 59204
4919
+ },
4920
+ {
4921
+ "icon_id": "47476166",
4922
+ "name": "使用技能",
4923
+ "font_class": "shiyongjineng",
4924
+ "unicode": "e745",
4925
+ "unicode_decimal": 59205
4926
+ },
4927
+ {
4928
+ "icon_id": "47476164",
4929
+ "name": "关闭菜单",
4930
+ "font_class": "guanbicaidan",
4931
+ "unicode": "e746",
4932
+ "unicode_decimal": 59206
4933
+ },
4934
+ {
4935
+ "icon_id": "47476165",
4936
+ "name": "自由浏览",
4937
+ "font_class": "ziyouliulan",
4938
+ "unicode": "e747",
4939
+ "unicode_decimal": 59207
4940
+ },
4941
+ {
4942
+ "icon_id": "47476163",
4943
+ "name": "打开菜单",
4944
+ "font_class": "dakaicaidan",
4945
+ "unicode": "e748",
4946
+ "unicode_decimal": 59208
4947
+ },
4948
+ {
4949
+ "icon_id": "47299703",
4950
+ "name": "空间",
4951
+ "font_class": "kongjian",
4952
+ "unicode": "e73f",
4953
+ "unicode_decimal": 59199
4954
+ },
4955
+ {
4956
+ "icon_id": "47288981",
4957
+ "name": "云主机",
4958
+ "font_class": "yunzhuji1",
4959
+ "unicode": "e742",
4960
+ "unicode_decimal": 59202
4961
+ },
4962
+ {
4963
+ "icon_id": "47234409",
4964
+ "name": "本地部署",
4965
+ "font_class": "bendibushu",
4966
+ "unicode": "e743",
4967
+ "unicode_decimal": 59203
4968
+ },
4969
+ {
4970
+ "icon_id": "47196573",
4971
+ "name": "用户",
4972
+ "font_class": "yonghu",
4973
+ "unicode": "e741",
4974
+ "unicode_decimal": 59201
4975
+ },
4976
+ {
4977
+ "icon_id": "47094946",
4978
+ "name": "gift-01",
4979
+ "font_class": "gift-01",
4980
+ "unicode": "e740",
4981
+ "unicode_decimal": 59200
4982
+ },
4983
+ {
4984
+ "icon_id": "47059841",
4985
+ "name": "算力卡",
4986
+ "font_class": "suanlika",
4987
+ "unicode": "e73e",
4988
+ "unicode_decimal": 59198
4989
+ },
4990
+ {
4991
+ "icon_id": "47051679",
4992
+ "name": "一体机",
4993
+ "font_class": "server-03",
4994
+ "unicode": "e73d",
4995
+ "unicode_decimal": 59197
4996
+ },
4997
+ {
4998
+ "icon_id": "47033552",
4999
+ "name": "搜索",
5000
+ "font_class": "ss-line-black",
5001
+ "unicode": "e73c",
5002
+ "unicode_decimal": 59196
5003
+ },
5004
+ {
5005
+ "icon_id": "47014867",
5006
+ "name": "workbot",
5007
+ "font_class": "workbot",
5008
+ "unicode": "e73b",
5009
+ "unicode_decimal": 59195
5010
+ },
5011
+ {
5012
+ "icon_id": "47014869",
5013
+ "name": "智能体",
5014
+ "font_class": "zhinengti",
5015
+ "unicode": "e67a",
5016
+ "unicode_decimal": 59002
5017
+ },
5018
+ {
5019
+ "icon_id": "47014868",
5020
+ "name": "技能",
5021
+ "font_class": "jineng",
5022
+ "unicode": "e73a",
5023
+ "unicode_decimal": 59194
5024
+ },
4842
5025
  {
4843
5026
  "icon_id": "46995621",
4844
5027
  "name": "播放",
@@ -6715,13 +6898,6 @@
6715
6898
  "unicode": "e679",
6716
6899
  "unicode_decimal": 59001
6717
6900
  },
6718
- {
6719
- "icon_id": "39830017",
6720
- "name": "general_gray_research",
6721
- "font_class": "general_gray_research",
6722
- "unicode": "e67a",
6723
- "unicode_decimal": 59002
6724
- },
6725
6901
  {
6726
6902
  "icon_id": "39830018",
6727
6903
  "name": "general_bold_video",
@@ -7086,10 +7262,12 @@
7086
7262
  return [ns.b()];
7087
7263
  });
7088
7264
  const imageStyles = (0, vue.computed)(() => {
7089
- return {
7090
- width: props.width ? convertValueToViewportWidth(props.width) : void 0,
7091
- height: props.height ? convertValueToViewportWidth(props.height) : void 0
7092
- };
7265
+ const styles = {};
7266
+ Object.assign(styles, ns.cssVarBlock({
7267
+ ...props.width ? { width: convertValueToViewportWidth(props.width) } : {},
7268
+ ...props.height ? { height: convertValueToViewportWidth(props.height) } : {}
7269
+ }));
7270
+ return styles;
7093
7271
  });
7094
7272
  const hasLoadError = (0, vue.ref)(false);
7095
7273
  const isLoading = (0, vue.ref)(true);
@@ -10200,8 +10378,12 @@
10200
10378
  */
10201
10379
  var posterComponent = (0, vue.defineComponent)({
10202
10380
  inheritAttrs: false,
10381
+ props: { dialogEvents: {
10382
+ type: Object,
10383
+ default: () => ({})
10384
+ } },
10203
10385
  emits: ["close"],
10204
- setup(_props, { slots, emit, attrs, expose }) {
10386
+ setup(props, { slots, emit, attrs, expose }) {
10205
10387
  /**
10206
10388
  * 控制弹窗显示状态的响应式变量。
10207
10389
  */
@@ -10233,6 +10415,7 @@
10233
10415
  return () => (0, vue.createVNode)(MtDialog, {
10234
10416
  modelValue: visible.value,
10235
10417
  ...attrs,
10418
+ ...props.dialogEvents,
10236
10419
  "onUpdate:modelValue": handleUpdateModelValue,
10237
10420
  "onClosed": handleClosed,
10238
10421
  "ref": dialogRef
@@ -10288,10 +10471,14 @@
10288
10471
  /**
10289
10472
  * 合并弹窗组件的事件处理函数。
10290
10473
  */
10291
- const dialogEvents = { onClose() {
10292
- options?.events?.onClose?.();
10293
- (0, vue.render)(null, container);
10294
- } };
10474
+ const dialogEvents = {
10475
+ ...options.dialogEvents,
10476
+ onClose() {
10477
+ options.dialogEvents?.onClose?.();
10478
+ options?.events?.onClose?.();
10479
+ (0, vue.render)(null, container);
10480
+ }
10481
+ };
10295
10482
  document.body.appendChild(container);
10296
10483
  /**
10297
10484
  * 动态加载内容组件并渲染弹窗。
@@ -10304,7 +10491,7 @@
10304
10491
  });
10305
10492
  dialogVNode = (0, vue.createVNode)(posterComponent, {
10306
10493
  ...dialogProps,
10307
- ...dialogEvents
10494
+ dialogEvents
10308
10495
  }, { default: () => contentVNode });
10309
10496
  (0, vue.render)(dialogVNode, container);
10310
10497
  });
@@ -10415,7 +10602,7 @@
10415
10602
  });
10416
10603
  const progressStyles = (0, vue.computed)(() => {
10417
10604
  const styles = {};
10418
- styles.height = convertValueToViewportWidth(props.strokeWidth);
10605
+ Object.assign(styles, ns.cssVarBlock({ height: convertValueToViewportWidth(props.strokeWidth) }));
10419
10606
  return styles;
10420
10607
  });
10421
10608
  const innerStyles = (0, vue.computed)(() => {
@@ -10428,8 +10615,10 @@
10428
10615
  });
10429
10616
  const circleStyles = (0, vue.computed)(() => {
10430
10617
  const styles = {};
10431
- styles.width = convertValueToViewportWidth(props.width);
10432
- styles.height = convertValueToViewportWidth(props.width);
10618
+ Object.assign(styles, ns.cssVarBlock({
10619
+ width: convertValueToViewportWidth(props.width),
10620
+ height: convertValueToViewportWidth(props.width)
10621
+ }));
10433
10622
  return styles;
10434
10623
  });
10435
10624
  const content = (0, vue.computed)(() => {
@@ -19412,8 +19601,7 @@ triggerRef });
19412
19601
  const emits = __emit;
19413
19602
  const ns = useNamespace("tabs");
19414
19603
  const tabsRef = (0, vue.ref)();
19415
- const barStyles = (0, vue.ref)({});
19416
- const lineStyles = (0, vue.ref)({});
19604
+ const mounted = (0, vue.ref)(false);
19417
19605
  const currentTabName = (0, vue.computed)({
19418
19606
  get() {
19419
19607
  return props.modelValue;
@@ -19428,50 +19616,40 @@ triggerRef });
19428
19616
  onChange,
19429
19617
  type: props.type
19430
19618
  });
19431
- function getActiveTabElement() {
19432
- if (!tabsRef.value) return null;
19433
- for (let index = 0; index < children.length; index++) {
19434
- const child = children[index];
19435
- if (!child.exposed || !isTabContext(child.exposed) || !child.exposed.isActive.value) continue;
19436
- return tabsRef.value.querySelector(`#tab-${index}`);
19437
- }
19438
- return null;
19439
- }
19440
- async function updateActiveStyles() {
19441
- await (0, vue.nextTick)();
19442
- const $el = getActiveTabElement();
19443
- if (!$el) {
19444
- barStyles.value = {};
19445
- lineStyles.value = {};
19446
- return;
19447
- }
19448
- barStyles.value = {
19449
- width: `${$el.clientWidth}px`,
19450
- left: `${$el.offsetLeft}px`
19451
- };
19619
+ const barStyles = (0, vue.computed)(() => {
19452
19620
  const styles = {};
19453
- const tabStyles = window.getComputedStyle($el);
19454
- styles.width = `${$el.clientWidth - (0, _mingto_tools.beParsedAsNumber)(tabStyles.paddingLeft) - (0, _mingto_tools.beParsedAsNumber)(tabStyles.paddingRight)}px`;
19455
- styles.left = `${$el.offsetLeft + (0, _mingto_tools.beParsedAsNumber)(tabStyles.paddingLeft)}px`;
19456
- lineStyles.value = styles;
19457
- }
19621
+ if (tabsRef.value) children.forEach((child, index) => {
19622
+ const $el = tabsRef.value.querySelector(`#tab-${index}`);
19623
+ if (!$el) return;
19624
+ if (!child.exposed || !isTabContext(child.exposed) || !(0, vue.unref)(child.exposed.isActive)) return;
19625
+ styles.width = `${$el.clientWidth}px`;
19626
+ styles.left = `${$el.offsetLeft}px`;
19627
+ });
19628
+ return styles;
19629
+ });
19630
+ const lineStyles = (0, vue.computed)(() => {
19631
+ const styles = {};
19632
+ if (tabsRef.value) children.forEach((child, index) => {
19633
+ const $el = tabsRef.value.querySelector(`#tab-${index}`);
19634
+ if (!$el) return;
19635
+ if (!child.exposed || !isTabContext(child.exposed) || !(0, vue.unref)(child.exposed.isActive)) return;
19636
+ const tabStyles = window.getComputedStyle($el);
19637
+ const paddingLeft = (0, _mingto_tools.beParsedAsNumber)(tabStyles.paddingLeft);
19638
+ const paddingRight = (0, _mingto_tools.beParsedAsNumber)(tabStyles.paddingRight);
19639
+ styles.width = `${Math.max($el.clientWidth - paddingLeft - paddingRight, 0)}px`;
19640
+ styles.left = `${$el.offsetLeft + paddingLeft}px`;
19641
+ });
19642
+ return styles;
19643
+ });
19458
19644
  const tabsClasses = (0, vue.computed)(() => {
19459
19645
  return [ns.b(), ns.m(props.type)];
19460
19646
  });
19461
19647
  function onChange(tabName) {
19462
19648
  currentTabName.value = tabName;
19463
19649
  }
19464
- (0, vue.watch)(() => [
19465
- currentTabName.value,
19466
- children.length,
19467
- props.type
19468
- ], updateActiveStyles, { flush: "post" });
19469
- (0, vue.onMounted)(() => {
19470
- updateActiveStyles();
19471
- window.addEventListener("resize", updateActiveStyles);
19472
- });
19473
- (0, vue.onBeforeUnmount)(() => {
19474
- window.removeEventListener("resize", updateActiveStyles);
19650
+ (0, vue.onMounted)(async () => {
19651
+ await (0, vue.nextTick)();
19652
+ mounted.value = true;
19475
19653
  });
19476
19654
  return (_ctx, _cache) => {
19477
19655
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
@@ -19484,12 +19662,12 @@ triggerRef });
19484
19662
  class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("active-bar")),
19485
19663
  style: (0, vue.normalizeStyle)(barStyles.value)
19486
19664
  }, null, 6)) : (0, vue.createCommentVNode)("", true),
19487
- props.type === "line" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
19665
+ (0, vue.renderSlot)(_ctx.$slots, "default"),
19666
+ props.type === "line" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
19488
19667
  key: 1,
19489
19668
  class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("active-line")),
19490
19669
  style: (0, vue.normalizeStyle)(lineStyles.value)
19491
- }, null, 6)) : (0, vue.createCommentVNode)("", true),
19492
- (0, vue.renderSlot)(_ctx.$slots, "default")
19670
+ }, null, 6)) : (0, vue.createCommentVNode)("", true)
19493
19671
  ], 2);
19494
19672
  };
19495
19673
  }
@@ -19640,6 +19818,12 @@ triggerRef });
19640
19818
  disabled: props.disabled,
19641
19819
  visible: props.visible,
19642
19820
  offset: props.offset,
19821
+ "show-arrow": props["visible-arrow"],
19822
+ "popper-options": props["popper-options"],
19823
+ "show-after": props["show-after"],
19824
+ "hide-after": props["hide-after"],
19825
+ "auto-close": props["auto-close"],
19826
+ "popper-class": props["popper-class"],
19643
19827
  enterable: props.enterable,
19644
19828
  "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => emits("update:visible", $event))
19645
19829
  }), (0, vue.createSlots)({ _: 2 }, [(0, vue.unref)(slots).default ? {
@@ -19659,6 +19843,12 @@ triggerRef });
19659
19843
  "disabled",
19660
19844
  "visible",
19661
19845
  "offset",
19846
+ "show-arrow",
19847
+ "popper-options",
19848
+ "show-after",
19849
+ "hide-after",
19850
+ "auto-close",
19851
+ "popper-class",
19662
19852
  "enterable"
19663
19853
  ]);
19664
19854
  };
@@ -1,4 +1,4 @@
1
- export declare const MtMessage: ((options: import('./src/message').MessageParamsNormalized | import('./src/message').MessageParamsNormalized["message"]) => void) & Record<"error" | "success" | "warning", (options: import('./src/message').MessageParamsNormalized | import('./src/message').MessageParamsNormalized["message"]) => void> & {
1
+ export declare const MtMessage: ((options: import('./src/message').MessageParamsNormalized | import('./src/message').MessageParamsNormalized["message"]) => import('./src/message').MessageHandler) & Record<"error" | "success" | "warning", (options: import('./src/message').MessageParamsNormalized | import('./src/message').MessageParamsNormalized["message"]) => import('./src/message').MessageHandler> & {
2
2
  closeAll: (type?: import('./src/message').MessageTypes) => void;
3
3
  } & import('vue').Plugin;
4
4
  export default MtMessage;
@@ -56,14 +56,14 @@ declare const messageProps: {
56
56
  };
57
57
  type MessageProps = ExtractPropTypes<typeof messageProps>;
58
58
  type MessageInstance = InstanceType<typeof MessageConstructor>;
59
- type MessageFunction = {
60
- (options: MessageParamsNormalized | MessageParamsNormalized['message']): void;
61
- } & Record<MessageTypes, (options: MessageParamsNormalized | MessageParamsNormalized['message']) => void> & {
62
- closeAll: (type?: MessageTypes) => void;
63
- };
64
59
  interface MessageHandler {
65
60
  close: () => void;
66
61
  }
62
+ type MessageFunction = {
63
+ (options: MessageParamsNormalized | MessageParamsNormalized['message']): MessageHandler;
64
+ } & Record<MessageTypes, (options: MessageParamsNormalized | MessageParamsNormalized['message']) => MessageHandler> & {
65
+ closeAll: (type?: MessageTypes) => void;
66
+ };
67
67
  type MessageParamsNormalized = Partial<Omit<MessageProps, 'id'>> & Pick<MessageProps, 'message'>;
68
68
  export type { MessageFunction, MessageHandler, MessageInstance, MessageParamsNormalized, MessageProps, MessageTypes, };
69
69
  export { messageProps, messageTypes, };
@@ -1,5 +1,8 @@
1
1
  import { Component } from 'vue';
2
2
  import { DialogProps } from '../../dialog';
3
+ type DialogEvents = {
4
+ onClose?: () => void;
5
+ };
3
6
  /**
4
7
  * PosterOptions 接口定义了 Poster 函数的参数结构。
5
8
  */
@@ -25,7 +28,7 @@ interface PosterOptions {
25
28
  /**
26
29
  * 传递给弹窗组件的事件处理函数。
27
30
  */
28
- dialogEvents?: Record<string, (...args: unknown[]) => void>;
31
+ dialogEvents?: DialogEvents;
29
32
  }
30
33
  /**
31
34
  * PosterReturn 接口定义了 Poster 函数的返回值结构。