tanxin-ui 0.5.8 → 0.6.0

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.
@@ -1485,6 +1485,20 @@ function colorHsl(color, index2) {
1485
1485
  v: getValue$2(hsv[2], i2, isLight2)
1486
1486
  }).toHslString().replace(/hsl\((.*)\)/, "$1");
1487
1487
  }
1488
+ function updateColor(style, hexColor, colorName) {
1489
+ for (let i2 = 1; i2 <= 10; i2++) {
1490
+ style["--" + colorName + "-" + i2] = colorPalette(hexColor, i2);
1491
+ style["--" + colorName + "-" + i2 + "-hsl"] = colorHsl(hexColor, i2);
1492
+ }
1493
+ if (colorName == "primary") {
1494
+ style["--border-color-hover"] = "var(--primary-6)";
1495
+ style["--bg-color-selected"] = "var(--primary-6)";
1496
+ style["--bg-color-selected-light"] = "hsla(var(--primary-6-hsl) , 14%)";
1497
+ style["--primary-color"] = "var(--primary-6)";
1498
+ style["--primary-color-shadow"] = "hsla(var(--primary-6-hsl) , 20%)";
1499
+ style["--primary-color-shadow-secondary"] = "hsla(var(--primary-6-hsl) , 15%)";
1500
+ }
1501
+ }
1488
1502
  const configProviderProps = {
1489
1503
  rootPrefixCls: PropTypes.string.def("t"),
1490
1504
  theme: PropTypes.string.def("light"),
@@ -1503,7 +1517,7 @@ var ConfigProvider = defineComponent({
1503
1517
  if (props.colors != void 0) {
1504
1518
  for (const key in props.colors) {
1505
1519
  if (props.colors[key]) {
1506
- updateColor(style, key);
1520
+ updateColor(style, props.colors[key], key);
1507
1521
  }
1508
1522
  }
1509
1523
  }
@@ -1514,21 +1528,6 @@ var ConfigProvider = defineComponent({
1514
1528
  [`theme-${props.theme}`]: props.theme != "light"
1515
1529
  }];
1516
1530
  });
1517
- const updateColor = (style, colorName) => {
1518
- const hexColor = props.colors[colorName];
1519
- for (let i2 = 1; i2 <= 10; i2++) {
1520
- style["--" + colorName + "-" + i2] = colorPalette(hexColor, i2);
1521
- style["--" + colorName + "-" + i2 + "-hsl"] = colorHsl(hexColor, i2);
1522
- }
1523
- if (colorName == "primary") {
1524
- style["--border-color-hover"] = "var(--primary-6)";
1525
- style["--bg-color-selected"] = "var(--primary-6)";
1526
- style["--bg-color-selected-light"] = "hsla(var(--primary-6-hsl) , 14%)";
1527
- style["--primary-color"] = "var(--primary-6)";
1528
- style["--primary-color-shadow"] = "hsla(var(--primary-6-hsl) , 20%)";
1529
- style["--primary-color-shadow-secondary"] = "hsla(var(--primary-6-hsl) , 15%)";
1530
- }
1531
- };
1532
1531
  const configProvider = {
1533
1532
  rootPrefixCls: computed(() => props.rootPrefixCls),
1534
1533
  customStyles: computed(() => styles.value)
@@ -11876,8 +11875,7 @@ var MessageList = defineComponent({
11876
11875
  const messageArr = reactive([]);
11877
11876
  const render = () => {
11878
11877
  let _slot;
11879
- const transitionProps = getTransitionGroupProps("move-up");
11880
- console.log("transitionProps=", transitionProps);
11878
+ getTransitionGroupProps("move-up");
11881
11879
  return createVNode(Fragment, null, [createVNode(resolveComponent("transition-group"), {
11882
11880
  "tag": "div",
11883
11881
  "name": "message-animation",
@@ -15763,7 +15761,7 @@ notification["close"] = (messageId) => {
15763
15761
  return listInstance[container].removeMsg(messageId);
15764
15762
  };
15765
15763
  const TNotification = withInstallFunction(notification, "$notification");
15766
- let scrollBarWidth$1;
15764
+ let scrollBarWidth;
15767
15765
  function originHasScroll(container) {
15768
15766
  if (container.tagName == "BODY")
15769
15767
  return container.scrollHeight > (window.innerHeight || document.documentElement.clientHeight);
@@ -15771,10 +15769,10 @@ function originHasScroll(container) {
15771
15769
  return container.scrollHeight > container.clientHeight;
15772
15770
  }
15773
15771
  }
15774
- function getScrollbarWidth$1() {
15772
+ function getScrollbarWidth() {
15775
15773
  var _a;
15776
- if (scrollBarWidth$1 !== void 0)
15777
- return scrollBarWidth$1;
15774
+ if (scrollBarWidth !== void 0)
15775
+ return scrollBarWidth;
15778
15776
  const outer = document.createElement("div");
15779
15777
  outer.style.visibility = "hidden";
15780
15778
  outer.style.position = "absolute";
@@ -15788,14 +15786,14 @@ function getScrollbarWidth$1() {
15788
15786
  outer.appendChild(inner);
15789
15787
  const filledWidth = inner.offsetWidth;
15790
15788
  (_a = outer.parentNode) == null ? void 0 : _a.removeChild(outer);
15791
- scrollBarWidth$1 = emptyWidth - filledWidth;
15792
- return scrollBarWidth$1;
15789
+ scrollBarWidth = emptyWidth - filledWidth;
15790
+ return scrollBarWidth;
15793
15791
  }
15794
15792
  function handleAboutScrollbar(container, existsScroll, toShowScrollBar) {
15795
15793
  var _a;
15796
15794
  if (!existsScroll)
15797
15795
  return;
15798
- const paddingRight = getScrollbarWidth$1();
15796
+ const paddingRight = getScrollbarWidth();
15799
15797
  const preStyle = (_a = container.getAttribute("style")) != null ? _a : "";
15800
15798
  const preStyleArr = preStyle.split(";");
15801
15799
  const styles = {};
@@ -15919,7 +15917,10 @@ var Modal = defineComponent({
15919
15917
  return style;
15920
15918
  });
15921
15919
  const containerStyles = computed(() => {
15922
- const style = {};
15920
+ const configContext = injectConfig();
15921
+ let style = cloneDeep(configContext.customStyles.value);
15922
+ if (style == void 0)
15923
+ style = {};
15923
15924
  if (props.width && !fullscreen.value) {
15924
15925
  style[`width`] = dialogPosition.value ? "100%" : getLength(props.width);
15925
15926
  style[`max-width`] = dialogPosition.value ? "100%" : "94%";
@@ -16512,27 +16513,6 @@ messageBox["confirm"] = (options) => {
16512
16513
  return newMessage("confirm", options);
16513
16514
  };
16514
16515
  const TMessageBox = withInstallFunction(messageBox, "$messageBox");
16515
- let scrollBarWidth;
16516
- function getScrollbarWidth() {
16517
- var _a;
16518
- if (scrollBarWidth !== void 0)
16519
- return scrollBarWidth;
16520
- const outer = document.createElement("div");
16521
- outer.style.visibility = "hidden";
16522
- outer.style.position = "absolute";
16523
- outer.style.width = "100px";
16524
- outer.style.top = "-9999px";
16525
- document.body.appendChild(outer);
16526
- const emptyWidth = outer.offsetWidth;
16527
- outer.style.overflow = "scroll";
16528
- const inner = document.createElement("div");
16529
- inner.style.width = "100%";
16530
- outer.appendChild(inner);
16531
- const filledWidth = inner.offsetWidth;
16532
- (_a = outer.parentNode) == null ? void 0 : _a.removeChild(outer);
16533
- scrollBarWidth = emptyWidth - filledWidth;
16534
- return scrollBarWidth;
16535
- }
16536
16516
  function _isSlot$c(s2) {
16537
16517
  return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
16538
16518
  }
@@ -16634,7 +16614,10 @@ var Drawer = defineComponent({
16634
16614
  return style;
16635
16615
  });
16636
16616
  const containerStyles = computed(() => {
16637
- const style = {};
16617
+ const configContext = injectConfig();
16618
+ let style = cloneDeep(configContext.customStyles.value);
16619
+ if (style == void 0)
16620
+ style = {};
16638
16621
  if (props.width && !fullscreen.value)
16639
16622
  ;
16640
16623
  return style;
@@ -22179,7 +22162,7 @@ function _isSlot$4(s2) {
22179
22162
  return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
22180
22163
  }
22181
22164
  function usePop(props, selectedPath, prefixCls, byOptions, menuList, popperFuns) {
22182
- var _a;
22165
+ var _a, _b;
22183
22166
  const slots = useSlots();
22184
22167
  const classes = computed(() => [[`${prefixCls.value}`], [`is-pop`], {
22185
22168
  [`is-collapsed`]: props.collapsed,
@@ -22226,7 +22209,7 @@ function usePop(props, selectedPath, prefixCls, byOptions, menuList, popperFuns)
22226
22209
  default: () => [item.icon]
22227
22210
  }) : null]), createVNode("div", {
22228
22211
  "class": `${prefixCls.value}-item-title-words`
22229
- }, [props.firstShort ? item.label : item.label]), item.children && item.children.length > 0 && props.collapsable ? createVNode(resolveComponent("t-icon"), {
22212
+ }, [props.firstShort ? item.labelShort : item.label]), item.children && item.children.length > 0 && props.collapsable ? createVNode(resolveComponent("t-icon"), {
22230
22213
  "class": `${prefixCls.value}-item-title-arrow-pop`
22231
22214
  }, {
22232
22215
  default: () => [createVNode(ChevronForward, null, null)]
@@ -22308,12 +22291,12 @@ function usePop(props, selectedPath, prefixCls, byOptions, menuList, popperFuns)
22308
22291
  "class": getItemClasses(item)
22309
22292
  }, [item.children && item.children.length > 0 ? getChildren(item, level) : getItemRow(item, level)]);
22310
22293
  };
22311
- return createVNode("ul", {
22294
+ return createVNode(Fragment, null, [(_a = slots.header) == null ? void 0 : _a.call(slots), createVNode("ul", {
22312
22295
  "class": [...classes.value, `is-pop`],
22313
22296
  "style": styles.value
22314
22297
  }, [byOptions ? menuList.value.map((item) => {
22315
22298
  return renderItem(item, 1);
22316
- }) : (_a = slots.default) == null ? void 0 : _a.call(slots)]);
22299
+ }) : (_b = slots.default) == null ? void 0 : _b.call(slots)])]);
22317
22300
  }
22318
22301
  var Menu = defineComponent({
22319
22302
  name: "TMenu",
@@ -22464,19 +22447,14 @@ var Menu = defineComponent({
22464
22447
  var _a, _b;
22465
22448
  if (!byOptions)
22466
22449
  return;
22467
- console.log("props.options=", props.options);
22468
22450
  menuList.value = initOptions(props.options, (_b = (_a = props.options[0]) == null ? void 0 : _a.keyPath) != null ? _b : ["top"]);
22469
- console.log("initDatainitData menuList=", menuList.value);
22470
22451
  if (props.showIcon) {
22471
22452
  calculateNoIcon(menuList.value);
22472
22453
  calculateParentNoIcon(menuList.value);
22473
22454
  }
22474
22455
  };
22475
22456
  const updateRightMenu = () => {
22476
- console.log("updateRightMenu");
22477
22457
  if (props.type == "seperate") {
22478
- console.log("updateRightMenu11 menuList=", menuList.value);
22479
- console.log("updateRightMenu selectedPath.value=", selectedPath.value);
22480
22458
  let firstSelectedItem = null;
22481
22459
  if (selectedPath.value.length > 0) {
22482
22460
  firstSelectedItem = menuList.value.find((item) => item.itemKey == selectedPath.value[0]);
@@ -22484,12 +22462,10 @@ var Menu = defineComponent({
22484
22462
  firstSelectedItem = menuList.value.length > 0 ? menuList.value[0] : null;
22485
22463
  if (firstSelectedItem)
22486
22464
  rightMenuList.value = firstSelectedItem.children;
22487
- console.log("rightMenuList.value=", rightMenuList.value);
22488
22465
  }
22489
22466
  };
22490
22467
  onMounted(() => {
22491
22468
  initData();
22492
- console.log("onMounted", menuList.value);
22493
22469
  setSelectedPath(props.selectedPath);
22494
22470
  updateRightMenu();
22495
22471
  });