tanxin-ui 0.5.8 → 0.5.9
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/tanxin-ui.es.js +15 -41
- package/dist/tanxin-ui.umd.js +5 -5
- package/es/drawer/src/drawer.js +5 -2
- package/es/menu/src/menu.js +0 -7
- package/es/menu/src/use-pop.js +5 -5
- package/es/modal/src/modal.d.ts +1 -1
- package/es/modal/src/modal.js +4 -1
- package/es/utils/scrollbarWidth.d.ts +16 -0
- package/lib/drawer/src/drawer.js +10 -3
- package/lib/menu/src/menu.js +0 -7
- package/lib/menu/src/use-pop.js +4 -4
- package/lib/modal/src/modal.d.ts +1 -1
- package/lib/modal/src/modal.js +8 -1
- package/lib/utils/scrollbarWidth.d.ts +16 -0
- package/package.json +1 -1
- package/es/utils/ScrollbarWidth2.js +0 -24
- package/lib/utils/ScrollbarWidth2.js +0 -26
package/dist/tanxin-ui.es.js
CHANGED
|
@@ -15763,7 +15763,7 @@ notification["close"] = (messageId) => {
|
|
|
15763
15763
|
return listInstance[container].removeMsg(messageId);
|
|
15764
15764
|
};
|
|
15765
15765
|
const TNotification = withInstallFunction(notification, "$notification");
|
|
15766
|
-
let scrollBarWidth
|
|
15766
|
+
let scrollBarWidth;
|
|
15767
15767
|
function originHasScroll(container) {
|
|
15768
15768
|
if (container.tagName == "BODY")
|
|
15769
15769
|
return container.scrollHeight > (window.innerHeight || document.documentElement.clientHeight);
|
|
@@ -15771,10 +15771,10 @@ function originHasScroll(container) {
|
|
|
15771
15771
|
return container.scrollHeight > container.clientHeight;
|
|
15772
15772
|
}
|
|
15773
15773
|
}
|
|
15774
|
-
function getScrollbarWidth
|
|
15774
|
+
function getScrollbarWidth() {
|
|
15775
15775
|
var _a;
|
|
15776
|
-
if (scrollBarWidth
|
|
15777
|
-
return scrollBarWidth
|
|
15776
|
+
if (scrollBarWidth !== void 0)
|
|
15777
|
+
return scrollBarWidth;
|
|
15778
15778
|
const outer = document.createElement("div");
|
|
15779
15779
|
outer.style.visibility = "hidden";
|
|
15780
15780
|
outer.style.position = "absolute";
|
|
@@ -15788,14 +15788,14 @@ function getScrollbarWidth$1() {
|
|
|
15788
15788
|
outer.appendChild(inner);
|
|
15789
15789
|
const filledWidth = inner.offsetWidth;
|
|
15790
15790
|
(_a = outer.parentNode) == null ? void 0 : _a.removeChild(outer);
|
|
15791
|
-
scrollBarWidth
|
|
15792
|
-
return scrollBarWidth
|
|
15791
|
+
scrollBarWidth = emptyWidth - filledWidth;
|
|
15792
|
+
return scrollBarWidth;
|
|
15793
15793
|
}
|
|
15794
15794
|
function handleAboutScrollbar(container, existsScroll, toShowScrollBar) {
|
|
15795
15795
|
var _a;
|
|
15796
15796
|
if (!existsScroll)
|
|
15797
15797
|
return;
|
|
15798
|
-
const paddingRight = getScrollbarWidth
|
|
15798
|
+
const paddingRight = getScrollbarWidth();
|
|
15799
15799
|
const preStyle = (_a = container.getAttribute("style")) != null ? _a : "";
|
|
15800
15800
|
const preStyleArr = preStyle.split(";");
|
|
15801
15801
|
const styles = {};
|
|
@@ -15919,7 +15919,8 @@ var Modal = defineComponent({
|
|
|
15919
15919
|
return style;
|
|
15920
15920
|
});
|
|
15921
15921
|
const containerStyles = computed(() => {
|
|
15922
|
-
const
|
|
15922
|
+
const configContext = injectConfig();
|
|
15923
|
+
const style = cloneDeep(configContext.customStyles.value);
|
|
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,8 @@ var Drawer = defineComponent({
|
|
|
16634
16614
|
return style;
|
|
16635
16615
|
});
|
|
16636
16616
|
const containerStyles = computed(() => {
|
|
16637
|
-
const
|
|
16617
|
+
const configContext = injectConfig();
|
|
16618
|
+
const style = cloneDeep(configContext.customStyles.value);
|
|
16638
16619
|
if (props.width && !fullscreen.value)
|
|
16639
16620
|
;
|
|
16640
16621
|
return style;
|
|
@@ -22179,7 +22160,7 @@ function _isSlot$4(s2) {
|
|
|
22179
22160
|
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
|
|
22180
22161
|
}
|
|
22181
22162
|
function usePop(props, selectedPath, prefixCls, byOptions, menuList, popperFuns) {
|
|
22182
|
-
var _a;
|
|
22163
|
+
var _a, _b;
|
|
22183
22164
|
const slots = useSlots();
|
|
22184
22165
|
const classes = computed(() => [[`${prefixCls.value}`], [`is-pop`], {
|
|
22185
22166
|
[`is-collapsed`]: props.collapsed,
|
|
@@ -22226,7 +22207,7 @@ function usePop(props, selectedPath, prefixCls, byOptions, menuList, popperFuns)
|
|
|
22226
22207
|
default: () => [item.icon]
|
|
22227
22208
|
}) : null]), createVNode("div", {
|
|
22228
22209
|
"class": `${prefixCls.value}-item-title-words`
|
|
22229
|
-
}, [props.firstShort ? item.
|
|
22210
|
+
}, [props.firstShort ? item.labelShort : item.label]), item.children && item.children.length > 0 && props.collapsable ? createVNode(resolveComponent("t-icon"), {
|
|
22230
22211
|
"class": `${prefixCls.value}-item-title-arrow-pop`
|
|
22231
22212
|
}, {
|
|
22232
22213
|
default: () => [createVNode(ChevronForward, null, null)]
|
|
@@ -22308,12 +22289,12 @@ function usePop(props, selectedPath, prefixCls, byOptions, menuList, popperFuns)
|
|
|
22308
22289
|
"class": getItemClasses(item)
|
|
22309
22290
|
}, [item.children && item.children.length > 0 ? getChildren(item, level) : getItemRow(item, level)]);
|
|
22310
22291
|
};
|
|
22311
|
-
return createVNode("ul", {
|
|
22292
|
+
return createVNode(Fragment, null, [(_a = slots.header) == null ? void 0 : _a.call(slots), createVNode("ul", {
|
|
22312
22293
|
"class": [...classes.value, `is-pop`],
|
|
22313
22294
|
"style": styles.value
|
|
22314
22295
|
}, [byOptions ? menuList.value.map((item) => {
|
|
22315
22296
|
return renderItem(item, 1);
|
|
22316
|
-
}) : (
|
|
22297
|
+
}) : (_b = slots.default) == null ? void 0 : _b.call(slots)])]);
|
|
22317
22298
|
}
|
|
22318
22299
|
var Menu = defineComponent({
|
|
22319
22300
|
name: "TMenu",
|
|
@@ -22464,19 +22445,14 @@ var Menu = defineComponent({
|
|
|
22464
22445
|
var _a, _b;
|
|
22465
22446
|
if (!byOptions)
|
|
22466
22447
|
return;
|
|
22467
|
-
console.log("props.options=", props.options);
|
|
22468
22448
|
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
22449
|
if (props.showIcon) {
|
|
22471
22450
|
calculateNoIcon(menuList.value);
|
|
22472
22451
|
calculateParentNoIcon(menuList.value);
|
|
22473
22452
|
}
|
|
22474
22453
|
};
|
|
22475
22454
|
const updateRightMenu = () => {
|
|
22476
|
-
console.log("updateRightMenu");
|
|
22477
22455
|
if (props.type == "seperate") {
|
|
22478
|
-
console.log("updateRightMenu11 menuList=", menuList.value);
|
|
22479
|
-
console.log("updateRightMenu selectedPath.value=", selectedPath.value);
|
|
22480
22456
|
let firstSelectedItem = null;
|
|
22481
22457
|
if (selectedPath.value.length > 0) {
|
|
22482
22458
|
firstSelectedItem = menuList.value.find((item) => item.itemKey == selectedPath.value[0]);
|
|
@@ -22484,12 +22460,10 @@ var Menu = defineComponent({
|
|
|
22484
22460
|
firstSelectedItem = menuList.value.length > 0 ? menuList.value[0] : null;
|
|
22485
22461
|
if (firstSelectedItem)
|
|
22486
22462
|
rightMenuList.value = firstSelectedItem.children;
|
|
22487
|
-
console.log("rightMenuList.value=", rightMenuList.value);
|
|
22488
22463
|
}
|
|
22489
22464
|
};
|
|
22490
22465
|
onMounted(() => {
|
|
22491
22466
|
initData();
|
|
22492
|
-
console.log("onMounted", menuList.value);
|
|
22493
22467
|
setSelectedPath(props.selectedPath);
|
|
22494
22468
|
updateRightMenu();
|
|
22495
22469
|
});
|