@king-one/antdv 1.0.22 → 1.0.24
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/CHANGELOG.md +12 -0
- package/dist/es/components/base/style/index.mjs +1 -2
- package/dist/es/components/collapse-transtion/hooks/use-collapse-transtion.mjs +43 -110
- package/dist/es/components/collapse-transtion/index.mjs +11 -10
- package/dist/es/components/collapse-transtion/src/collapse-transtion.vue.mjs +4 -6
- package/dist/es/components/collapse-transtion/src/collapse-transtion.vue2.mjs +21 -27
- package/dist/es/components/collapse-transtion/src/types.mjs +5 -5
- package/dist/es/components/collapse-transtion/style/index.mjs +2 -3
- package/dist/es/components/form/component/form.mjs +4 -4
- package/dist/es/components/form/component/form.vue.mjs +4 -6
- package/dist/es/components/form/component/form.vue2.mjs +14 -19
- package/dist/es/components/form/index.mjs +10 -9
- package/dist/es/components/index.mjs +14 -10
- package/dist/es/components/pro-dialog/hooks/useProDialog.mjs +27 -42
- package/dist/es/components/pro-dialog/index.mjs +12 -11
- package/dist/es/components/pro-dialog/src/pro-dialog.vue.mjs +4 -6
- package/dist/es/components/pro-dialog/src/pro-dialog.vue2.mjs +18 -35
- package/dist/es/components/pro-dialog/src/types.mjs +6 -7
- package/dist/es/components/scale-virtual-list/component/scale-virtual-list.vue.mjs +4 -0
- package/dist/es/components/scale-virtual-list/component/scale-virtual-list.vue2.mjs +63 -0
- package/dist/es/components/scale-virtual-list/component/types.mjs +1 -0
- package/dist/es/components/scale-virtual-list/hooks/useVirtualList.mjs +156 -0
- package/dist/es/components/scale-virtual-list/index.mjs +10 -0
- package/dist/es/components/scale-virtual-list/style/index.mjs +2 -0
- package/dist/es/components/scroll-bar/index.mjs +9 -9
- package/dist/es/components/scroll-bar/src/scroll-bar.mjs +141 -358
- package/dist/es/components/scroll-bar/src/types.mjs +4 -4
- package/dist/es/components/utils/install.mjs +14 -14
- package/dist/es/components/virtual-list/index.mjs +10 -9
- package/dist/es/components/virtual-list/src/types.mjs +5 -5
- package/dist/es/components/virtual-list/src/virtual-list.vue.mjs +4 -6
- package/dist/es/components/virtual-list/src/virtual-list.vue2.mjs +74 -87
- package/dist/es/hooks/use-namespace/index.mjs +43 -72
- package/dist/es/index.mjs +30 -16
- package/dist/es/installer.mjs +12 -12
- package/dist/lib/components/base/style/index.js +1 -5
- package/dist/lib/components/collapse-transtion/hooks/use-collapse-transtion.js +1 -136
- package/dist/lib/components/collapse-transtion/index.js +1 -16
- package/dist/lib/components/collapse-transtion/src/collapse-transtion.vue.js +1 -10
- package/dist/lib/components/collapse-transtion/src/collapse-transtion.vue2.js +1 -34
- package/dist/lib/components/collapse-transtion/src/types.js +1 -11
- package/dist/lib/components/collapse-transtion/style/index.js +1 -6
- package/dist/lib/components/form/component/form.js +1 -13
- package/dist/lib/components/form/component/form.vue.js +1 -10
- package/dist/lib/components/form/component/form.vue2.js +1 -30
- package/dist/lib/components/form/index.js +1 -15
- package/dist/lib/components/index.js +1 -25
- package/dist/lib/components/pro-dialog/hooks/useProDialog.js +1 -52
- package/dist/lib/components/pro-dialog/index.js +1 -19
- package/dist/lib/components/pro-dialog/src/pro-dialog.vue.js +1 -10
- package/dist/lib/components/pro-dialog/src/pro-dialog.vue2.js +1 -42
- package/dist/lib/components/pro-dialog/src/types.js +1 -11
- package/dist/lib/components/scale-virtual-list/component/scale-virtual-list.vue.js +1 -0
- package/dist/lib/components/scale-virtual-list/component/scale-virtual-list.vue2.js +1 -0
- package/dist/lib/components/scale-virtual-list/component/types.js +1 -0
- package/dist/lib/components/scale-virtual-list/hooks/useVirtualList.js +1 -0
- package/dist/lib/components/scale-virtual-list/index.js +1 -0
- package/dist/lib/components/scale-virtual-list/style/index.js +1 -0
- package/dist/lib/components/scroll-bar/index.js +1 -15
- package/dist/lib/components/scroll-bar/src/scroll-bar.js +1 -390
- package/dist/lib/components/scroll-bar/src/types.js +1 -11
- package/dist/lib/components/utils/install.js +1 -22
- package/dist/lib/components/virtual-list/index.js +1 -15
- package/dist/lib/components/virtual-list/src/types.js +1 -32
- package/dist/lib/components/virtual-list/src/virtual-list.vue.js +1 -10
- package/dist/lib/components/virtual-list/src/virtual-list.vue2.js +1 -104
- package/dist/lib/hooks/use-namespace/index.js +1 -83
- package/dist/lib/index.js +1 -30
- package/dist/lib/installer.js +1 -19
- package/dist/theme-chalk/index.css +1 -1
- package/dist/theme-chalk/scale-virtual-list.css +1 -0
- package/dist/{es → types}/components/collapse-transtion/hooks/use-collapse-transtion.d.ts +2 -2
- package/dist/types/components/collapse-transtion/index.d.ts +41 -0
- package/dist/types/components/collapse-transtion/src/collapse-transtion.vue.d.ts +27 -0
- package/dist/{es → types}/components/collapse-transtion/src/types.d.ts +1 -1
- package/dist/{lib → types}/components/form/component/form.d.ts +2 -2
- package/dist/types/components/form/component/form.vue.d.ts +32 -0
- package/dist/types/components/form/index.d.ts +50 -0
- package/dist/{lib → types}/components/index.d.ts +2 -0
- package/dist/{lib → types}/components/pro-dialog/hooks/useProDialog.d.ts +2 -1
- package/dist/types/components/pro-dialog/index.d.ts +26 -0
- package/dist/types/components/pro-dialog/src/pro-dialog.vue.d.ts +24 -0
- package/dist/types/components/pro-dialog/src/types.d.ts +7 -0
- package/dist/types/components/scale-virtual-list/component/scale-virtual-list.vue.d.ts +28 -0
- package/dist/types/components/scale-virtual-list/component/types.d.ts +11 -0
- package/dist/types/components/scale-virtual-list/hooks/useVirtualList.d.ts +70 -0
- package/dist/types/components/scale-virtual-list/index.d.ts +67 -0
- package/dist/types/components/scroll-bar/index.d.ts +36 -0
- package/dist/types/components/scroll-bar/src/scroll-bar.d.ts +34 -0
- package/dist/{es → types}/components/scroll-bar/src/types.d.ts +1 -1
- package/dist/{lib → types}/components/utils/install.d.ts +1 -1
- package/dist/types/components/utils/tool.d.ts +1 -0
- package/dist/types/components/virtual-list/index.d.ts +163 -0
- package/dist/{es → types}/components/virtual-list/src/types.d.ts +2 -2
- package/dist/types/components/virtual-list/src/virtual-list.vue.d.ts +364 -0
- package/dist/{es → types}/index.d.ts +1 -1
- package/dist/{lib → types}/installer.d.ts +1 -1
- package/package.json +8 -3
- package/dist/cdn/index.cdn.js +0 -16
- package/dist/cdn/index.cdn.js.map +0 -1
- package/dist/cdn/index.cdn.mjs +0 -16
- package/dist/cdn/index.cdn.mjs.map +0 -1
- package/dist/cdn/index.css +0 -1
- package/dist/es/components/base/style/index.mjs.map +0 -1
- package/dist/es/components/collapse-transtion/hooks/use-collapse-transtion.mjs.map +0 -1
- package/dist/es/components/collapse-transtion/index.d.ts +0 -29
- package/dist/es/components/collapse-transtion/index.mjs.map +0 -1
- package/dist/es/components/collapse-transtion/src/collapse-transtion.vue.d.ts +0 -27
- package/dist/es/components/collapse-transtion/src/collapse-transtion.vue.mjs.map +0 -1
- package/dist/es/components/collapse-transtion/src/collapse-transtion.vue2.mjs.map +0 -1
- package/dist/es/components/collapse-transtion/src/types.mjs.map +0 -1
- package/dist/es/components/collapse-transtion/style/index.mjs.map +0 -1
- package/dist/es/components/form/component/form.d.ts +0 -10
- package/dist/es/components/form/component/form.mjs.map +0 -1
- package/dist/es/components/form/component/form.vue.d.ts +0 -16
- package/dist/es/components/form/component/form.vue.mjs.map +0 -1
- package/dist/es/components/form/component/form.vue2.mjs.map +0 -1
- package/dist/es/components/form/index.d.ts +0 -17
- package/dist/es/components/form/index.mjs.map +0 -1
- package/dist/es/components/form-item/component/form-item.vue.d.ts +0 -24
- package/dist/es/components/form-item/component/form-item.vue.mjs +0 -6
- package/dist/es/components/form-item/component/form-item.vue.mjs.map +0 -1
- package/dist/es/components/form-item/component/form-item.vue2.mjs +0 -128
- package/dist/es/components/form-item/component/form-item.vue2.mjs.map +0 -1
- package/dist/es/components/form-item/index.d.ts +0 -0
- package/dist/es/components/form-item/index.mjs +0 -2
- package/dist/es/components/form-item/index.mjs.map +0 -1
- package/dist/es/components/index.d.ts +0 -4
- package/dist/es/components/index.mjs.map +0 -1
- package/dist/es/components/pro-dialog/hooks/useProDialog.d.ts +0 -13
- package/dist/es/components/pro-dialog/hooks/useProDialog.mjs.map +0 -1
- package/dist/es/components/pro-dialog/index.d.ts +0 -1542
- package/dist/es/components/pro-dialog/index.mjs.map +0 -1
- package/dist/es/components/pro-dialog/src/pro-dialog.vue.d.ts +0 -1539
- package/dist/es/components/pro-dialog/src/pro-dialog.vue.mjs.map +0 -1
- package/dist/es/components/pro-dialog/src/pro-dialog.vue2.mjs.map +0 -1
- package/dist/es/components/pro-dialog/src/types.d.ts +0 -6
- package/dist/es/components/pro-dialog/src/types.mjs.map +0 -1
- package/dist/es/components/pro-dialog/style/index.mjs +0 -3
- package/dist/es/components/pro-dialog/style/index.mjs.map +0 -1
- package/dist/es/components/scroll-bar/index.d.ts +0 -35
- package/dist/es/components/scroll-bar/index.mjs.map +0 -1
- package/dist/es/components/scroll-bar/src/scroll-bar.d.ts +0 -33
- package/dist/es/components/scroll-bar/src/scroll-bar.mjs.map +0 -1
- package/dist/es/components/scroll-bar/src/types.mjs.map +0 -1
- package/dist/es/components/scroll-bar/style/index.mjs +0 -3
- package/dist/es/components/scroll-bar/style/index.mjs.map +0 -1
- package/dist/es/components/utils/install.d.ts +0 -7
- package/dist/es/components/utils/install.mjs.map +0 -1
- package/dist/es/components/virtual-list/index.d.ts +0 -312
- package/dist/es/components/virtual-list/index.mjs.map +0 -1
- package/dist/es/components/virtual-list/src/types.mjs.map +0 -1
- package/dist/es/components/virtual-list/src/virtual-list.vue.d.ts +0 -312
- package/dist/es/components/virtual-list/src/virtual-list.vue.mjs.map +0 -1
- package/dist/es/components/virtual-list/src/virtual-list.vue2.mjs.map +0 -1
- package/dist/es/hooks/use-namespace/index.d.ts +0 -23
- package/dist/es/hooks/use-namespace/index.mjs.map +0 -1
- package/dist/es/index.mjs.map +0 -1
- package/dist/es/installer.d.ts +0 -6
- package/dist/es/installer.mjs.map +0 -1
- package/dist/lib/components/base/style/index.js.map +0 -1
- package/dist/lib/components/collapse-transtion/hooks/use-collapse-transtion.d.ts +0 -12
- package/dist/lib/components/collapse-transtion/hooks/use-collapse-transtion.js.map +0 -1
- package/dist/lib/components/collapse-transtion/index.d.ts +0 -29
- package/dist/lib/components/collapse-transtion/index.js.map +0 -1
- package/dist/lib/components/collapse-transtion/src/collapse-transtion.vue.d.ts +0 -27
- package/dist/lib/components/collapse-transtion/src/collapse-transtion.vue.js.map +0 -1
- package/dist/lib/components/collapse-transtion/src/collapse-transtion.vue2.js.map +0 -1
- package/dist/lib/components/collapse-transtion/src/types.d.ts +0 -8
- package/dist/lib/components/collapse-transtion/src/types.js.map +0 -1
- package/dist/lib/components/collapse-transtion/style/index.js.map +0 -1
- package/dist/lib/components/form/component/form.js.map +0 -1
- package/dist/lib/components/form/component/form.vue.d.ts +0 -16
- package/dist/lib/components/form/component/form.vue.js.map +0 -1
- package/dist/lib/components/form/component/form.vue2.js.map +0 -1
- package/dist/lib/components/form/index.d.ts +0 -17
- package/dist/lib/components/form/index.js.map +0 -1
- package/dist/lib/components/form-item/component/form-item.vue.d.ts +0 -24
- package/dist/lib/components/form-item/component/form-item.vue.js +0 -10
- package/dist/lib/components/form-item/component/form-item.vue.js.map +0 -1
- package/dist/lib/components/form-item/component/form-item.vue2.js +0 -132
- package/dist/lib/components/form-item/component/form-item.vue2.js.map +0 -1
- package/dist/lib/components/form-item/index.d.ts +0 -0
- package/dist/lib/components/form-item/index.js +0 -3
- package/dist/lib/components/form-item/index.js.map +0 -1
- package/dist/lib/components/index.js.map +0 -1
- package/dist/lib/components/pro-dialog/hooks/useProDialog.js.map +0 -1
- package/dist/lib/components/pro-dialog/index.d.ts +0 -1542
- package/dist/lib/components/pro-dialog/index.js.map +0 -1
- package/dist/lib/components/pro-dialog/src/pro-dialog.vue.d.ts +0 -1539
- package/dist/lib/components/pro-dialog/src/pro-dialog.vue.js.map +0 -1
- package/dist/lib/components/pro-dialog/src/pro-dialog.vue2.js.map +0 -1
- package/dist/lib/components/pro-dialog/src/types.d.ts +0 -6
- package/dist/lib/components/pro-dialog/src/types.js.map +0 -1
- package/dist/lib/components/pro-dialog/style/index.js +0 -6
- package/dist/lib/components/pro-dialog/style/index.js.map +0 -1
- package/dist/lib/components/scroll-bar/index.d.ts +0 -35
- package/dist/lib/components/scroll-bar/index.js.map +0 -1
- package/dist/lib/components/scroll-bar/src/scroll-bar.d.ts +0 -33
- package/dist/lib/components/scroll-bar/src/scroll-bar.js.map +0 -1
- package/dist/lib/components/scroll-bar/src/types.d.ts +0 -7
- package/dist/lib/components/scroll-bar/src/types.js.map +0 -1
- package/dist/lib/components/scroll-bar/style/index.js +0 -6
- package/dist/lib/components/scroll-bar/style/index.js.map +0 -1
- package/dist/lib/components/utils/install.js.map +0 -1
- package/dist/lib/components/virtual-list/index.d.ts +0 -312
- package/dist/lib/components/virtual-list/index.js.map +0 -1
- package/dist/lib/components/virtual-list/src/types.d.ts +0 -39
- package/dist/lib/components/virtual-list/src/types.js.map +0 -1
- package/dist/lib/components/virtual-list/src/virtual-list.vue.d.ts +0 -312
- package/dist/lib/components/virtual-list/src/virtual-list.vue.js.map +0 -1
- package/dist/lib/components/virtual-list/src/virtual-list.vue2.js.map +0 -1
- package/dist/lib/hooks/use-namespace/index.d.ts +0 -23
- package/dist/lib/hooks/use-namespace/index.js.map +0 -1
- package/dist/lib/index.d.ts +0 -3
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/installer.js.map +0 -1
|
@@ -1,30 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
var form = require('./form.js');
|
|
7
|
-
|
|
8
|
-
const _hoisted_1 = { class: "king-form" };
|
|
9
|
-
const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode(
|
|
10
|
-
"div",
|
|
11
|
-
null,
|
|
12
|
-
"\u4F1F\u5927\u7684\u597D\u6B4C",
|
|
13
|
-
-1
|
|
14
|
-
/* HOISTED */
|
|
15
|
-
);
|
|
16
|
-
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
17
|
-
__name: "form",
|
|
18
|
-
props: form.formType,
|
|
19
|
-
setup(__props) {
|
|
20
|
-
return (_ctx, _cache) => {
|
|
21
|
-
return vue.openBlock(), vue.createElementBlock("form", _hoisted_1, [
|
|
22
|
-
_hoisted_2,
|
|
23
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
24
|
-
]);
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
exports.default = _sfc_main;
|
|
30
|
-
//# sourceMappingURL=form.vue2.js.map
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("./form.js"),r={class:"king-form"},n=e.createElementVNode("div",null,"伟大的好歌",-1),s=e.defineComponent({__name:"form",props:t.formType,setup(l){return(o,c)=>(e.openBlock(),e.createElementBlock("form",r,[n,e.renderSlot(o.$slots,"default")]))}});exports.default=s;
|
|
@@ -1,15 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var install = require('../utils/install.js');
|
|
6
|
-
require('./component/form.vue.js');
|
|
7
|
-
var form = require('./component/form.js');
|
|
8
|
-
var form_vue_vue_type_script_setup_true_lang = require('./component/form.vue2.js');
|
|
9
|
-
|
|
10
|
-
const KForm = install.withInstall(form_vue_vue_type_script_setup_true_lang.default);
|
|
11
|
-
|
|
12
|
-
exports.formType = form.formType;
|
|
13
|
-
exports.KForm = KForm;
|
|
14
|
-
exports.default = KForm;
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../utils/install.js");require("./component/form.vue.js");const t=require("./component/form.js"),u=require("./component/form.vue2.js"),e=r.withInstall(u.default);exports.formType=t.formType;exports.KForm=e;exports.default=e;
|
|
@@ -1,25 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var index = require('./form/index.js');
|
|
4
|
-
var index$1 = require('./virtual-list/index.js');
|
|
5
|
-
var index$2 = require('./collapse-transtion/index.js');
|
|
6
|
-
var index$3 = require('./pro-dialog/index.js');
|
|
7
|
-
var form = require('./form/component/form.js');
|
|
8
|
-
var types = require('./virtual-list/src/types.js');
|
|
9
|
-
var types$1 = require('./collapse-transtion/src/types.js');
|
|
10
|
-
var useProDialog = require('./pro-dialog/hooks/useProDialog.js');
|
|
11
|
-
var types$2 = require('./pro-dialog/src/types.js');
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
exports.KForm = index.KForm;
|
|
16
|
-
exports.KVirtualList = index$1.KVirtualList;
|
|
17
|
-
exports.KCollapseTranstion = index$2.KCollapseTranstion;
|
|
18
|
-
exports.KProDialog = index$3.KProDialog;
|
|
19
|
-
exports.formType = form.formType;
|
|
20
|
-
exports.virtualListProps = types.virtualListProps;
|
|
21
|
-
exports.collapseProps = types$1.collapseProps;
|
|
22
|
-
exports.useProDialog = useProDialog.useProDialog;
|
|
23
|
-
exports.useProDialogInit = useProDialog.useProDialogInit;
|
|
24
|
-
exports.ProDialogProps = types$2.ProDialogProps;
|
|
25
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./form/index.js"),e=require("./virtual-list/index.js"),i=require("./collapse-transtion/index.js"),o=require("./pro-dialog/index.js"),t=require("./scroll-bar/index.js"),l=require("./scale-virtual-list/index.js");exports.KForm=r.KForm;exports.KVirtualList=e.KVirtualList;exports.KCollapseTranstion=i.KCollapseTranstion;exports.KProDialog=o.KProDialog;exports.KScrollBar=t.KScrollBar;exports.KScaleVirtualList=l.KScaleVirtualList;
|
|
@@ -1,52 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var vue = require('vue');
|
|
4
|
-
|
|
5
|
-
function useProDialog() {
|
|
6
|
-
const dialogVisible = vue.ref(false);
|
|
7
|
-
const openDialog = () => {
|
|
8
|
-
dialogVisible.value = true;
|
|
9
|
-
};
|
|
10
|
-
const closeDialog = () => {
|
|
11
|
-
dialogVisible.value = false;
|
|
12
|
-
};
|
|
13
|
-
const dialogMethods = {
|
|
14
|
-
openDialog,
|
|
15
|
-
closeDialog
|
|
16
|
-
};
|
|
17
|
-
const instance = vue.getCurrentInstance();
|
|
18
|
-
if (instance) {
|
|
19
|
-
instance.emit("init", dialogMethods);
|
|
20
|
-
}
|
|
21
|
-
return { dialogVisible, openDialog, closeDialog };
|
|
22
|
-
}
|
|
23
|
-
function useProDialogInit() {
|
|
24
|
-
const modalRef = vue.ref(null);
|
|
25
|
-
const getInstance = () => {
|
|
26
|
-
const instance = vue.unref(modalRef.value);
|
|
27
|
-
if (!instance) {
|
|
28
|
-
console.error("useModal instance is undefined!");
|
|
29
|
-
}
|
|
30
|
-
return instance;
|
|
31
|
-
};
|
|
32
|
-
const initDialog = (modalInstance) => {
|
|
33
|
-
vue.onBeforeUnmount(() => {
|
|
34
|
-
});
|
|
35
|
-
modalRef.value = modalInstance;
|
|
36
|
-
};
|
|
37
|
-
const methods = {
|
|
38
|
-
openDialog: () => {
|
|
39
|
-
var _a;
|
|
40
|
-
(_a = getInstance()) == null ? void 0 : _a.openDialog();
|
|
41
|
-
},
|
|
42
|
-
closeDialog: () => {
|
|
43
|
-
var _a;
|
|
44
|
-
return (_a = getInstance()) == null ? void 0 : _a.closeDialog();
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
return [initDialog, methods];
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
exports.useProDialog = useProDialog;
|
|
51
|
-
exports.useProDialogInit = useProDialogInit;
|
|
52
|
-
//# sourceMappingURL=useProDialog.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue");function l(){const o=t.ref(!1),n=()=>{o.value=!0},i=()=>{o.value=!1},s={openDialog:n,closeDialog:i},e=t.getCurrentInstance();return e&&e.emit("init",s),{dialogVisible:o,openDialog:n,closeDialog:i}}function a(){const o=t.ref(null),n=()=>{const e=t.unref(o.value);return e||console.error("useModal instance is undefined!"),e};return[e=>{o.value=e},{openDialog:()=>{var e;(e=n())==null||e.openDialog()},closeDialog:()=>{var e;return(e=n())==null?void 0:e.closeDialog()}}]}exports.useProDialog=l;exports.useProDialogInit=a;
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var install = require('../utils/install.js');
|
|
6
|
-
require('./src/pro-dialog.vue.js');
|
|
7
|
-
require('./style/index.js');
|
|
8
|
-
var useProDialog = require('./hooks/useProDialog.js');
|
|
9
|
-
var types = require('./src/types.js');
|
|
10
|
-
var proDialog_vue_vue_type_script_setup_true_lang = require('./src/pro-dialog.vue2.js');
|
|
11
|
-
|
|
12
|
-
const KProDialog = install.withInstall(proDialog_vue_vue_type_script_setup_true_lang.default);
|
|
13
|
-
|
|
14
|
-
exports.useProDialog = useProDialog.useProDialog;
|
|
15
|
-
exports.useProDialogInit = useProDialog.useProDialogInit;
|
|
16
|
-
exports.ProDialogProps = types.ProDialogProps;
|
|
17
|
-
exports.KProDialog = KProDialog;
|
|
18
|
-
exports.default = KProDialog;
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../utils/install.js");require("./src/pro-dialog.vue.js");const o=require("./hooks/useProDialog.js"),r=require("./src/types.js"),i=require("./src/pro-dialog.vue2.js"),t=e.withInstall(i.default);exports.useProDialog=o.useProDialog;exports.useProDialogInit=o.useProDialogInit;exports.proDialogProps=r.proDialogProps;exports.KProDialog=t;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var proDialog_vue_vue_type_script_setup_true_lang = require('./pro-dialog.vue2.js');
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
exports.default = proDialog_vue_vue_type_script_setup_true_lang.default;
|
|
10
|
-
//# sourceMappingURL=pro-dialog.vue.js.map
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./pro-dialog.vue2.js");exports.default=e.default;
|
|
@@ -1,42 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
var index = require('../../../hooks/use-namespace/index.js');
|
|
7
|
-
var antDesignVue = require('ant-design-vue');
|
|
8
|
-
var types = require('./types.js');
|
|
9
|
-
|
|
10
|
-
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
11
|
-
...{
|
|
12
|
-
name: "ProDialog"
|
|
13
|
-
},
|
|
14
|
-
__name: "pro-dialog",
|
|
15
|
-
props: types.ProDialogProps,
|
|
16
|
-
emits: ["onConfirm", "onCancel", "update:modelValue"],
|
|
17
|
-
setup(__props, { emit: __emit }) {
|
|
18
|
-
const props = __props;
|
|
19
|
-
const emits = __emit;
|
|
20
|
-
const model = vue.useModel(props, "modelValue");
|
|
21
|
-
const handleClick = () => emits("onConfirm");
|
|
22
|
-
const handleCancel = () => emits("onCancel");
|
|
23
|
-
return (_ctx, _cache) => {
|
|
24
|
-
return vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Modal), {
|
|
25
|
-
open: vue.unref(model),
|
|
26
|
-
"onUpdate:open": _cache[0] || (_cache[0] = ($event) => vue.isRef(model) ? model.value = $event : null),
|
|
27
|
-
"wrap-class-name": `${vue.unref(index.defaultNamespace)}-pro-dialog`,
|
|
28
|
-
onOk: handleClick,
|
|
29
|
-
onCancel: handleCancel
|
|
30
|
-
}, {
|
|
31
|
-
default: vue.withCtx(() => [
|
|
32
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
33
|
-
]),
|
|
34
|
-
_: 3
|
|
35
|
-
/* FORWARDED */
|
|
36
|
-
}, 8, ["open", "wrap-class-name"]);
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
exports.default = _sfc_main;
|
|
42
|
-
//# sourceMappingURL=pro-dialog.vue2.js.map
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("ant-design-vue"),s=require("./types.js"),a=e.defineComponent({__name:"pro-dialog",props:e.mergeModels(s.proDialogProps,{modelValue:{required:!0,type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const o=e.useModel(l,"modelValue");return(u,r)=>(e.openBlock(),e.createBlock(e.unref(t.Modal),e.mergeProps({open:o.value,"onUpdate:open":r[0]||(r[0]=n=>o.value=n)},u.dialogProps),null,16,["open"]))}});exports.default=a;
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const ProDialogProps = {
|
|
4
|
-
modelValue: {
|
|
5
|
-
type: Boolean,
|
|
6
|
-
required: true
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
exports.ProDialogProps = ProDialogProps;
|
|
11
|
-
//# sourceMappingURL=types.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o={dialogProps:{type:Object}};exports.proDialogProps=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./scale-virtual-list.vue2.js");exports.default=e.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("../../../hooks/use-namespace/index.js"),d=require("../hooks/useVirtualList.js"),f=e.defineComponent({__name:"scale-virtual-list",props:{list:{},option:{}},setup(s,{expose:n}){const l=s,{list:a,containerProps:o,wrapperProps:c,scrollTo:i,scaleTo:u}=d.useVirtualList(l.list,l.option);return n({scrollTo:i,scaleTo:u}),(p,m)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:`${e.unref(t.defaultNamespace)}-scale-virtual-list`},e.unref(o)),[e.createElementVNode("div",{class:e.normalizeClass(`${e.unref(t.defaultNamespace)}-scale-virtual-list-container`)},[e.createElementVNode("div",e.mergeProps({class:`${e.unref(t.defaultNamespace)}-scale-vittual-wrapper`},e.unref(c)),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),r=>(e.openBlock(),e.createElementBlock("div",{key:r.index},[e.renderSlot(p.$slots,"default",{item:r,index:r.index})]))),128))],16)],2)],16))}});exports.default=f;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue-demi"),M=require("@vueuse/core");function S(c,t){const{containerStyle:n,wrapperProps:e,scrollTo:r,calculateRange:a,currentList:u,containerRef:o,scaleTo:s,state:l}="itemHeight"in t?q(t,c):k(t,c);return{state:l,scaleTo:s,list:u,scrollTo:r,containerProps:{ref:o,onScroll:()=>{a()},style:n},wrapperProps:e}}function C(c){const t=i.ref(null),n=M.useElementSize(t),e=i.ref([]),r=i.shallowRef(c);return{state:i.ref({start:0,end:10,current:0,scale:1}),source:r,currentList:e,size:n,containerRef:t}}function O(c,t,n){return e=>{const{start:r=0,scale:a=1}=c.value;if(typeof n=="number")return Math.ceil(e/(n*a));let u=0,o=0;for(let s=r;s<t.value.length;s++){const l=n(s)*a;if(u+=l,o=s,u>e)break}return o-r}}function $(c,t,n){return e=>{const{scale:r=1}=n.value;if(typeof t=="number")return Math.floor(e/(t*r))+1;let a=0,u=0;for(let o=0;o<c.value.length;o++){const s=t(o)*r;if(a+=s,a>=e){u=o;break}}return u+1}}function x(c,t,n,e,{containerRef:r,state:a,currentList:u,source:o}){return()=>{const s=r.value;if(s){const l=n(c==="vertical"?s.scrollTop:s.scrollLeft),h=e(c==="vertical"?s.clientHeight:s.clientWidth),p=l-t,g=l+h+t;a.value={start:p<0?0:p,end:g>o.value.length?o.value.length:g,current:l-1,scale:a.value.scale},u.value=o.value.slice(a.value.start,a.value.end).map((f,v)=>({data:f,index:v+a.value.start}))}}}function H(c,t,n){return e=>{const{scale:r=1}=n.value;return typeof c=="number"?e*(c*r):t.value.slice(0,e).reduce((u,o,s)=>u+c(s)*r,0)}}function P(c,t,n,e){i.watch([c.width,c.height,t,n],()=>{e()})}function D(c,t,n){return i.computed(()=>{const{scale:e=1}=n.value;return typeof c=="number"?t.value.length*c*e:t.value.reduce((r,a,u)=>r+c(u)*e,0)})}const _={horizontal:"scrollLeft",vertical:"scrollTop"};function W(c,t,n,e){return r=>{e.value&&(e.value[_[c]]=n(r),t())}}function k(c,t){const n=C(t),{state:e,source:r,currentList:a,size:u,containerRef:o}=n,s={overflowX:"auto"},{itemWidth:l,overscan:h=5}=c,p=O(e,r,l),g=$(r,l,e),f=x("horizontal",h,g,p,n),v=H(l,r,e),m=i.computed(()=>v(e.value.start)),L=D(l,r,e);P(u,t,o,f);const w=W("horizontal",f,v,o),b=d=>{e.value.scale=d},R=i.computed(()=>({style:{height:"100%",width:`${L.value-m.value}px`,marginLeft:`${m.value}px`,display:"flex",transform:`scale(${e.value.scale})`,transformOrigin:"50% 0%"}}));return{state:e,scaleTo:b,scrollTo:w,calculateRange:f,wrapperProps:R,containerStyle:s,currentList:a,containerRef:o}}function q(c,t){const n=C(t),{state:e,source:r,currentList:a,size:u,containerRef:o}=n,s={overflowY:"auto"},{itemHeight:l,overscan:h=5}=c,p=O(e,r,l),g=$(r,l,e),f=x("vertical",h,g,p,n),v=H(l,r,e),m=i.computed(()=>v(e.value.start)),L=D(l,r,e);P(u,t,o,f);const w=W("vertical",f,v,o),b=d=>{const y=o.value;if(y){const{current:V}=e.value;let T=0;typeof l=="number"?T=V*(d*l-e.value.scale*l):T=r.value.slice(0,V).reduce((G,E,z)=>G+d*l(z)-e.value.scale*l(z),0),y.scrollTop=y.scrollTop+T>=0?y.scrollTop+T:0,e.value.scale=d}},R=i.computed(()=>({style:{height:`${L.value-m.value}px`,marginTop:`${m.value}px`,transform:`translateX(-50%) scale(${e.value.scale})`,transformOrigin:"50% 0%"}}));return{state:e,scaleTo:b,calculateRange:f,scrollTo:w,containerStyle:s,wrapperProps:R,currentList:a,containerRef:o}}exports.useVirtualList=S;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../utils/install.js");require("./component/scale-virtual-list.vue.js");require("./style/index.js");require("./component/types.js");const r=require("./component/scale-virtual-list.vue2.js"),e=t.withInstall(r.default);exports.KScaleVirtualList=e;exports.default=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require("../../base/style/index.js");require("@king-one/antdv/dist/theme-chalk/scale-virtual-list.css");
|
|
@@ -1,15 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var install = require('../utils/install.js');
|
|
6
|
-
var scrollBar = require('./src/scroll-bar.js');
|
|
7
|
-
require('./style/index.js');
|
|
8
|
-
var types = require('./src/types.js');
|
|
9
|
-
|
|
10
|
-
const KScrollBar = install.withInstall(scrollBar.default);
|
|
11
|
-
|
|
12
|
-
exports.scrollbarProps = types.scrollbarProps;
|
|
13
|
-
exports.KScrollBar = KScrollBar;
|
|
14
|
-
exports.default = KScrollBar;
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../utils/install.js"),l=require("./src/scroll-bar.js"),t=require("./src/types.js"),r=e.withInstall(l.default);exports.scrollbarProps=t.scrollbarProps;exports.KScrollBar=r;exports.default=r;
|
|
@@ -1,390 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
var vueuc = require('vueuc');
|
|
7
|
-
var evtd = require('evtd');
|
|
8
|
-
var index = require('../../../hooks/use-namespace/index.js');
|
|
9
|
-
var types = require('./types.js');
|
|
10
|
-
|
|
11
|
-
function _isSlot(s) {
|
|
12
|
-
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
|
|
13
|
-
}
|
|
14
|
-
var ScrollBar = /* @__PURE__ */ vue.defineComponent({
|
|
15
|
-
name: "KScrollbar",
|
|
16
|
-
props: types.scrollbarProps,
|
|
17
|
-
inheritAttrs: false,
|
|
18
|
-
setup(props) {
|
|
19
|
-
vue.onMounted(() => {
|
|
20
|
-
if (props.container) return;
|
|
21
|
-
sync();
|
|
22
|
-
});
|
|
23
|
-
const handleContentResize = () => {
|
|
24
|
-
sync();
|
|
25
|
-
};
|
|
26
|
-
const handleContainerResize = () => {
|
|
27
|
-
sync();
|
|
28
|
-
};
|
|
29
|
-
const contentRef = vue.ref(null);
|
|
30
|
-
const containerRef = vue.ref(null);
|
|
31
|
-
const yRailRef = vue.ref(null);
|
|
32
|
-
const xRailRef = vue.ref(null);
|
|
33
|
-
const contentHeightRef = vue.ref(null);
|
|
34
|
-
const contentWidthRef = vue.ref(null);
|
|
35
|
-
const containerHeightRef = vue.ref(null);
|
|
36
|
-
const containerWidthRef = vue.ref(null);
|
|
37
|
-
const yRailSizeRef = vue.ref(null);
|
|
38
|
-
const xRailSizeRef = vue.ref(null);
|
|
39
|
-
const mergedContentRef = vue.computed(() => {
|
|
40
|
-
var _a;
|
|
41
|
-
return ((_a = props.content) == null ? void 0 : _a.call(props)) || contentRef.value;
|
|
42
|
-
});
|
|
43
|
-
const mergedContainerRef = vue.computed(() => {
|
|
44
|
-
var _a;
|
|
45
|
-
return ((_a = props.container) == null ? void 0 : _a.call(props)) || containerRef.value;
|
|
46
|
-
});
|
|
47
|
-
const containerScrollTopRef = vue.ref(0);
|
|
48
|
-
const containerScrollLeftRef = vue.ref(0);
|
|
49
|
-
const needYBarRef = vue.computed(() => {
|
|
50
|
-
const {
|
|
51
|
-
value: containerHeight
|
|
52
|
-
} = containerHeightRef;
|
|
53
|
-
const {
|
|
54
|
-
value: contentHeight
|
|
55
|
-
} = contentHeightRef;
|
|
56
|
-
return containerHeight !== null && contentHeight !== null && contentHeight > containerHeight;
|
|
57
|
-
});
|
|
58
|
-
const yBarSizeRef = vue.computed(() => {
|
|
59
|
-
const {
|
|
60
|
-
value: containerHeight
|
|
61
|
-
} = containerHeightRef;
|
|
62
|
-
const {
|
|
63
|
-
value: contentHeight
|
|
64
|
-
} = contentHeightRef;
|
|
65
|
-
const {
|
|
66
|
-
value: yRailSize
|
|
67
|
-
} = yRailSizeRef;
|
|
68
|
-
if (containerHeight === null || contentHeight === null || yRailSize === null) {
|
|
69
|
-
return 0;
|
|
70
|
-
} else {
|
|
71
|
-
return Math.min(containerHeight, yRailSize * containerHeight / contentHeight + 5 * 1.5);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
const yBarSizePxRef = vue.computed(() => {
|
|
75
|
-
return `${yBarSizeRef.value}px`;
|
|
76
|
-
});
|
|
77
|
-
const yBarTopRef = vue.computed(() => {
|
|
78
|
-
const {
|
|
79
|
-
value: containerHeight
|
|
80
|
-
} = containerHeightRef;
|
|
81
|
-
const {
|
|
82
|
-
value: containerScrollTop
|
|
83
|
-
} = containerScrollTopRef;
|
|
84
|
-
const {
|
|
85
|
-
value: contentHeight
|
|
86
|
-
} = contentHeightRef;
|
|
87
|
-
const {
|
|
88
|
-
value: yRailSize
|
|
89
|
-
} = yRailSizeRef;
|
|
90
|
-
if (containerHeight === null || contentHeight === null || yRailSize === null) {
|
|
91
|
-
return 0;
|
|
92
|
-
} else {
|
|
93
|
-
const heightDiff = contentHeight - containerHeight;
|
|
94
|
-
if (!heightDiff) return 0;
|
|
95
|
-
return containerScrollTop / heightDiff * (yRailSize - yBarSizeRef.value);
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
const yBarTopPxRef = vue.computed(() => {
|
|
99
|
-
return `${yBarTopRef.value}px`;
|
|
100
|
-
});
|
|
101
|
-
let yBarPressed = false;
|
|
102
|
-
let memoYTop = 0;
|
|
103
|
-
let memoMouseY = 0;
|
|
104
|
-
let yBarVanishTimerId;
|
|
105
|
-
let xBarVanishTimerId;
|
|
106
|
-
const handleYScrollMouseMove = (e) => {
|
|
107
|
-
if (!yBarPressed) return;
|
|
108
|
-
if (xBarVanishTimerId !== void 0) {
|
|
109
|
-
window.clearTimeout(xBarVanishTimerId);
|
|
110
|
-
}
|
|
111
|
-
if (yBarVanishTimerId !== void 0) {
|
|
112
|
-
window.clearTimeout(yBarVanishTimerId);
|
|
113
|
-
}
|
|
114
|
-
const {
|
|
115
|
-
value: containerHeight
|
|
116
|
-
} = containerHeightRef;
|
|
117
|
-
const {
|
|
118
|
-
value: contentHeight
|
|
119
|
-
} = contentHeightRef;
|
|
120
|
-
const {
|
|
121
|
-
value: yBarSize
|
|
122
|
-
} = yBarSizeRef;
|
|
123
|
-
if (containerHeight === null || contentHeight === null) return;
|
|
124
|
-
const dY = e.clientY - memoMouseY;
|
|
125
|
-
const dScrollTop = dY * (contentHeight - containerHeight) / (containerHeight - yBarSize);
|
|
126
|
-
const toScrollTopUpperBound = contentHeight - containerHeight;
|
|
127
|
-
let toScrollTop = memoYTop + dScrollTop;
|
|
128
|
-
toScrollTop = Math.min(toScrollTopUpperBound, toScrollTop);
|
|
129
|
-
toScrollTop = Math.max(toScrollTop, 0);
|
|
130
|
-
const {
|
|
131
|
-
value: container
|
|
132
|
-
} = mergedContainerRef;
|
|
133
|
-
if (container) {
|
|
134
|
-
container.scrollTop = toScrollTop;
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
const handleYScrollMouseUp = (e) => {
|
|
138
|
-
e.preventDefault();
|
|
139
|
-
e.stopPropagation();
|
|
140
|
-
evtd.off("mousemove", window, handleYScrollMouseMove, true);
|
|
141
|
-
evtd.off("mouseup", window, handleYScrollMouseUp, true);
|
|
142
|
-
yBarPressed = false;
|
|
143
|
-
sync();
|
|
144
|
-
};
|
|
145
|
-
const handleYScrollMouseDown = (e) => {
|
|
146
|
-
e.preventDefault();
|
|
147
|
-
e.stopPropagation();
|
|
148
|
-
evtd.on("mousemove", window, handleYScrollMouseMove, true);
|
|
149
|
-
evtd.on("mouseup", window, handleYScrollMouseUp, true);
|
|
150
|
-
memoYTop = containerScrollTopRef.value;
|
|
151
|
-
memoMouseY = e.clientY;
|
|
152
|
-
yBarPressed = true;
|
|
153
|
-
};
|
|
154
|
-
function handleScroll(e) {
|
|
155
|
-
const {
|
|
156
|
-
onScroll
|
|
157
|
-
} = props;
|
|
158
|
-
if (onScroll) onScroll(e);
|
|
159
|
-
syncScrollState();
|
|
160
|
-
}
|
|
161
|
-
const needXBarRef = vue.computed(() => {
|
|
162
|
-
const {
|
|
163
|
-
value: containerWidth
|
|
164
|
-
} = containerWidthRef;
|
|
165
|
-
const {
|
|
166
|
-
value: contentWidth
|
|
167
|
-
} = contentWidthRef;
|
|
168
|
-
return containerWidth !== null && contentWidth !== null && contentWidth > containerWidth;
|
|
169
|
-
});
|
|
170
|
-
const xBarSizeRef = vue.computed(() => {
|
|
171
|
-
const {
|
|
172
|
-
value: containerWidth
|
|
173
|
-
} = containerWidthRef;
|
|
174
|
-
const {
|
|
175
|
-
value: contentWidth
|
|
176
|
-
} = contentWidthRef;
|
|
177
|
-
const {
|
|
178
|
-
value: xRailSize
|
|
179
|
-
} = xRailSizeRef;
|
|
180
|
-
if (containerWidth === null || contentWidth === null || xRailSize === null) {
|
|
181
|
-
return 0;
|
|
182
|
-
} else {
|
|
183
|
-
return xRailSize * containerWidth / contentWidth + 5 * 1.5;
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
const xBarSizePxRef = vue.computed(() => {
|
|
187
|
-
return `${xBarSizeRef.value}px`;
|
|
188
|
-
});
|
|
189
|
-
const xBarLeftRef = vue.computed(() => {
|
|
190
|
-
const {
|
|
191
|
-
value: containerWidth
|
|
192
|
-
} = containerWidthRef;
|
|
193
|
-
const {
|
|
194
|
-
value: containerScrollLeft
|
|
195
|
-
} = containerScrollLeftRef;
|
|
196
|
-
const {
|
|
197
|
-
value: contentWidth
|
|
198
|
-
} = contentWidthRef;
|
|
199
|
-
const {
|
|
200
|
-
value: xRailSize
|
|
201
|
-
} = xRailSizeRef;
|
|
202
|
-
if (containerWidth === null || contentWidth === null || xRailSize === null) {
|
|
203
|
-
return 0;
|
|
204
|
-
} else {
|
|
205
|
-
const widthDiff = contentWidth - containerWidth;
|
|
206
|
-
if (!widthDiff) return 0;
|
|
207
|
-
return containerScrollLeft / widthDiff * (xRailSize - xBarSizeRef.value);
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
const xBarLeftPxRef = vue.computed(() => {
|
|
211
|
-
return `${xBarLeftRef.value}px`;
|
|
212
|
-
});
|
|
213
|
-
let xBarPressed = false;
|
|
214
|
-
let memoXLeft = 0;
|
|
215
|
-
let memoMouseX = 0;
|
|
216
|
-
const handleXScrollMouseMove = (e) => {
|
|
217
|
-
if (!xBarPressed) return;
|
|
218
|
-
if (xBarVanishTimerId !== void 0) {
|
|
219
|
-
window.clearTimeout(xBarVanishTimerId);
|
|
220
|
-
}
|
|
221
|
-
if (yBarVanishTimerId !== void 0) {
|
|
222
|
-
window.clearTimeout(yBarVanishTimerId);
|
|
223
|
-
}
|
|
224
|
-
const {
|
|
225
|
-
value: containerWidth
|
|
226
|
-
} = containerWidthRef;
|
|
227
|
-
const {
|
|
228
|
-
value: contentWidth
|
|
229
|
-
} = contentWidthRef;
|
|
230
|
-
const {
|
|
231
|
-
value: xBarSize
|
|
232
|
-
} = xBarSizeRef;
|
|
233
|
-
if (containerWidth === null || contentWidth === null) return;
|
|
234
|
-
const dX = e.clientX - memoMouseX;
|
|
235
|
-
const dScrollLeft = dX * (contentWidth - containerWidth) / (containerWidth - xBarSize);
|
|
236
|
-
const toScrollLeftUpperBound = contentWidth - containerWidth;
|
|
237
|
-
let toScrollLeft = memoXLeft + dScrollLeft;
|
|
238
|
-
toScrollLeft = Math.min(toScrollLeftUpperBound, toScrollLeft);
|
|
239
|
-
toScrollLeft = Math.max(toScrollLeft, 0);
|
|
240
|
-
const {
|
|
241
|
-
value: container
|
|
242
|
-
} = mergedContainerRef;
|
|
243
|
-
if (container) {
|
|
244
|
-
container.scrollLeft = toScrollLeft;
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
const handleXScrollMouseUp = (e) => {
|
|
248
|
-
e.preventDefault();
|
|
249
|
-
e.stopPropagation();
|
|
250
|
-
evtd.off("mousemove", window, handleXScrollMouseMove, true);
|
|
251
|
-
evtd.off("mouseup", window, handleXScrollMouseUp, true);
|
|
252
|
-
xBarPressed = false;
|
|
253
|
-
sync();
|
|
254
|
-
};
|
|
255
|
-
function handleXScrollMouseDown(e) {
|
|
256
|
-
e.preventDefault();
|
|
257
|
-
e.stopPropagation();
|
|
258
|
-
xBarPressed = true;
|
|
259
|
-
evtd.on("mousemove", window, handleXScrollMouseMove, true);
|
|
260
|
-
evtd.on("mouseup", window, handleXScrollMouseUp, true);
|
|
261
|
-
memoXLeft = containerScrollLeftRef.value;
|
|
262
|
-
memoMouseX = e.clientX;
|
|
263
|
-
}
|
|
264
|
-
function syncScrollState() {
|
|
265
|
-
const {
|
|
266
|
-
value: container
|
|
267
|
-
} = mergedContainerRef;
|
|
268
|
-
if (container) {
|
|
269
|
-
containerScrollTopRef.value = container.scrollTop;
|
|
270
|
-
containerScrollLeftRef.value = container.scrollLeft;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
const syncPositionState = () => {
|
|
274
|
-
const {
|
|
275
|
-
value: content
|
|
276
|
-
} = mergedContentRef;
|
|
277
|
-
if (content) {
|
|
278
|
-
const contentClient = content.getBoundingClientRect();
|
|
279
|
-
contentHeightRef.value = contentClient.height;
|
|
280
|
-
contentWidthRef.value = contentClient.width;
|
|
281
|
-
}
|
|
282
|
-
const {
|
|
283
|
-
value: container
|
|
284
|
-
} = mergedContainerRef;
|
|
285
|
-
if (container) {
|
|
286
|
-
const containerClient = container.getBoundingClientRect();
|
|
287
|
-
containerHeightRef.value = containerClient.height;
|
|
288
|
-
containerWidthRef.value = containerClient.width;
|
|
289
|
-
}
|
|
290
|
-
const {
|
|
291
|
-
value: yRailEl
|
|
292
|
-
} = yRailRef;
|
|
293
|
-
if (yRailEl) {
|
|
294
|
-
yRailSizeRef.value = yRailEl.offsetHeight;
|
|
295
|
-
}
|
|
296
|
-
const {
|
|
297
|
-
value: xRailEl
|
|
298
|
-
} = xRailRef;
|
|
299
|
-
if (xRailEl) {
|
|
300
|
-
xRailSizeRef.value = xRailEl.offsetWidth;
|
|
301
|
-
}
|
|
302
|
-
};
|
|
303
|
-
function sync() {
|
|
304
|
-
syncPositionState();
|
|
305
|
-
syncScrollState();
|
|
306
|
-
}
|
|
307
|
-
return {
|
|
308
|
-
sync,
|
|
309
|
-
handleContentResize,
|
|
310
|
-
handleContainerResize,
|
|
311
|
-
contentRef,
|
|
312
|
-
yRailRef,
|
|
313
|
-
xRailRef,
|
|
314
|
-
containerRef,
|
|
315
|
-
contentHeightRef,
|
|
316
|
-
containerHeightRef,
|
|
317
|
-
needYBarRef,
|
|
318
|
-
needXBarRef,
|
|
319
|
-
yBarSizePxRef,
|
|
320
|
-
handleYScrollMouseDown,
|
|
321
|
-
handleXScrollMouseDown,
|
|
322
|
-
yBarTopPxRef,
|
|
323
|
-
handleScroll,
|
|
324
|
-
xBarSizePxRef,
|
|
325
|
-
xBarLeftPxRef
|
|
326
|
-
};
|
|
327
|
-
},
|
|
328
|
-
render() {
|
|
329
|
-
let _slot;
|
|
330
|
-
const {
|
|
331
|
-
$slots,
|
|
332
|
-
xScrollable
|
|
333
|
-
} = this;
|
|
334
|
-
const createXBar = () => {
|
|
335
|
-
return vue.createVNode("div", {
|
|
336
|
-
"class": `${index.defaultNamespace}-scrollbar-rail ${index.defaultNamespace}-scrollbar-rail--horizontal`,
|
|
337
|
-
"ref": "xRailRef"
|
|
338
|
-
}, [this.needXBarRef && vue.createVNode("div", {
|
|
339
|
-
"class": `${index.defaultNamespace}-scrollbar-rail__scrollbar--horizontal`,
|
|
340
|
-
"style": {
|
|
341
|
-
width: this.xBarSizePxRef,
|
|
342
|
-
left: this.xBarLeftPxRef
|
|
343
|
-
},
|
|
344
|
-
"onMousedown": this.handleXScrollMouseDown
|
|
345
|
-
}, null)]);
|
|
346
|
-
};
|
|
347
|
-
const createYBar = () => {
|
|
348
|
-
return vue.createVNode("div", {
|
|
349
|
-
"class": `${index.defaultNamespace}-scrollbar-rail ${index.defaultNamespace}-scrollbar-rail--vertical`,
|
|
350
|
-
"ref": "yRailRef"
|
|
351
|
-
}, [this.needYBarRef && vue.createVNode("div", {
|
|
352
|
-
"class": `${index.defaultNamespace}-scrollbar-rail__scrollbar--vertical`,
|
|
353
|
-
"style": {
|
|
354
|
-
height: this.yBarSizePxRef,
|
|
355
|
-
top: this.yBarTopPxRef
|
|
356
|
-
},
|
|
357
|
-
"onMousedown": this.handleYScrollMouseDown
|
|
358
|
-
}, null)]);
|
|
359
|
-
};
|
|
360
|
-
const createChildren = () => {
|
|
361
|
-
var _a;
|
|
362
|
-
return vue.createVNode("div", vue.mergeProps({
|
|
363
|
-
"class": `${index.defaultNamespace}-scrollbar`
|
|
364
|
-
}, this.$attrs), [this.container ? (_a = $slots.default) == null ? void 0 : _a.call($slots) : vue.createVNode("div", {
|
|
365
|
-
"class": `${index.defaultNamespace}-scrollbar-container`,
|
|
366
|
-
"onScroll": this.handleScroll,
|
|
367
|
-
"ref": "containerRef"
|
|
368
|
-
}, [vue.createVNode(vueuc.VResizeObserver, {
|
|
369
|
-
"onResize": this.handleContentResize
|
|
370
|
-
}, {
|
|
371
|
-
default: () => {
|
|
372
|
-
var _a2;
|
|
373
|
-
return [vue.createVNode("div", {
|
|
374
|
-
"ref": "contentRef",
|
|
375
|
-
"class": `${index.defaultNamespace}-scrollbar-content`
|
|
376
|
-
}, [(_a2 = $slots.default) == null ? void 0 : _a2.call($slots)])];
|
|
377
|
-
}
|
|
378
|
-
})]), createYBar(), xScrollable && createXBar()]);
|
|
379
|
-
};
|
|
380
|
-
const createBarNode = this.container ? createChildren() : vue.createVNode(vueuc.VResizeObserver, {
|
|
381
|
-
"onResize": this.handleContainerResize
|
|
382
|
-
}, _isSlot(_slot = createChildren()) ? _slot : {
|
|
383
|
-
default: () => [_slot]
|
|
384
|
-
});
|
|
385
|
-
return createBarNode;
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
|
|
389
|
-
exports.default = ScrollBar;
|
|
390
|
-
//# sourceMappingURL=scroll-bar.js.map
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),I=require("vueuc"),s=require("evtd"),u=require("../../../hooks/use-namespace/index.js"),oe=require("./types.js"),ae=n.defineComponent({name:"KScrollbar",props:oe.scrollbarProps,inheritAttrs:!1,setup(o){n.onMounted(()=>{o.container||d()});const g=()=>{d()},z=()=>{d()},S=n.ref(null),v=n.ref(null),y=n.ref(null),h=n.ref(null),i=n.ref(null),m=n.ref(null),f=n.ref(null),R=n.ref(null),M=n.ref(null),b=n.ref(null),j=n.computed(()=>{var e;return((e=o.content)==null?void 0:e.call(o))||S.value}),w=n.computed(()=>{var e;return((e=o.container)==null?void 0:e.call(o))||v.value}),T=n.ref(0),P=n.ref(0),A=n.computed(()=>{const{value:e}=f,{value:t}=i;return e!==null&&t!==null&&t>e}),X=n.computed(()=>{const{value:e}=f,{value:t}=i,{value:l}=M;return e===null||t===null||l===null?0:Math.min(e,l*e/t+5*1.5)}),K=n.computed(()=>`${X.value}px`),k=n.computed(()=>{const{value:e}=f,{value:t}=T,{value:l}=i,{value:r}=M;if(e===null||l===null||r===null)return 0;{const a=l-e;return a?t/a*(r-X.value):0}}),F=n.computed(()=>`${k.value}px`);let Y=!1,N=0,W=0,x,B;const $=e=>{if(!Y)return;B!==void 0&&window.clearTimeout(B),x!==void 0&&window.clearTimeout(x);const{value:t}=f,{value:l}=i,{value:r}=X;if(t===null||l===null)return;const H=(e.clientY-W)*(l-t)/(t-r),L=l-t;let c=N+H;c=Math.min(L,c),c=Math.max(c,0);const{value:p}=w;p&&(p.scrollTop=c)},D=e=>{e.preventDefault(),e.stopPropagation(),s.off("mousemove",window,$,!0),s.off("mouseup",window,D,!0),Y=!1,d()},G=e=>{e.preventDefault(),e.stopPropagation(),s.on("mousemove",window,$,!0),s.on("mouseup",window,D,!0),N=T.value,W=e.clientY,Y=!0};function J(e){const{onScroll:t}=o;t&&t(e),O()}const Q=n.computed(()=>{const{value:e}=R,{value:t}=m;return e!==null&&t!==null&&t>e}),C=n.computed(()=>{const{value:e}=R,{value:t}=m,{value:l}=b;return e===null||t===null||l===null?0:l*e/t+5*1.5}),Z=n.computed(()=>`${C.value}px`),ee=n.computed(()=>{const{value:e}=R,{value:t}=P,{value:l}=m,{value:r}=b;if(e===null||l===null||r===null)return 0;{const a=l-e;return a?t/a*(r-C.value):0}}),te=n.computed(()=>`${ee.value}px`);let E=!1,_=0,q=0;const U=e=>{if(!E)return;B!==void 0&&window.clearTimeout(B),x!==void 0&&window.clearTimeout(x);const{value:t}=R,{value:l}=m,{value:r}=C;if(t===null||l===null)return;const H=(e.clientX-q)*(l-t)/(t-r),L=l-t;let c=_+H;c=Math.min(L,c),c=Math.max(c,0);const{value:p}=w;p&&(p.scrollLeft=c)},V=e=>{e.preventDefault(),e.stopPropagation(),s.off("mousemove",window,U,!0),s.off("mouseup",window,V,!0),E=!1,d()};function ne(e){e.preventDefault(),e.stopPropagation(),E=!0,s.on("mousemove",window,U,!0),s.on("mouseup",window,V,!0),_=P.value,q=e.clientX}function O(){const{value:e}=w;e&&(T.value=e.scrollTop,P.value=e.scrollLeft)}const le=()=>{const{value:e}=j;if(e){const a=e.getBoundingClientRect();i.value=a.height,m.value=a.width}const{value:t}=w;if(t){const a=t.getBoundingClientRect();f.value=a.height,R.value=a.width}const{value:l}=y;l&&(M.value=l.offsetHeight);const{value:r}=h;r&&(b.value=r.offsetWidth)};function d(){le(),O()}return{sync:d,handleContentResize:g,handleContainerResize:z,contentRef:S,yRailRef:y,xRailRef:h,containerRef:v,contentHeightRef:i,containerHeightRef:f,needYBarRef:A,needXBarRef:Q,yBarSizePxRef:K,handleYScrollMouseDown:G,handleXScrollMouseDown:ne,yBarTopPxRef:F,handleScroll:J,xBarSizePxRef:Z,xBarLeftPxRef:te}},render(){const{$slots:o,xScrollable:g}=this,z=()=>React.createElement("div",{class:`${u.defaultNamespace}-scrollbar-rail ${u.defaultNamespace}-scrollbar-rail--horizontal`,ref:"xRailRef"},this.needXBarRef&&React.createElement("div",{class:`${u.defaultNamespace}-scrollbar-rail__scrollbar--horizontal`,style:{width:this.xBarSizePxRef,left:this.xBarLeftPxRef},onMousedown:this.handleXScrollMouseDown})),S=()=>React.createElement("div",{class:`${u.defaultNamespace}-scrollbar-rail ${u.defaultNamespace}-scrollbar-rail--vertical`,ref:"yRailRef"},this.needYBarRef&&React.createElement("div",{class:`${u.defaultNamespace}-scrollbar-rail__scrollbar--vertical`,style:{height:this.yBarSizePxRef,top:this.yBarTopPxRef},onMousedown:this.handleYScrollMouseDown})),v=()=>{var h,i;return React.createElement("div",{class:`${u.defaultNamespace}-scrollbar`,...this.$attrs},this.container?(h=o.default)==null?void 0:h.call(o):React.createElement("div",{class:`${u.defaultNamespace}-scrollbar-container`,onScroll:this.handleScroll,ref:"containerRef"},React.createElement(I.VResizeObserver,{onResize:this.handleContentResize},React.createElement("div",{ref:"contentRef",class:`${u.defaultNamespace}-scrollbar-content`},(i=o.default)==null?void 0:i.call(o)))),S(),g&&z())};return this.container?v():React.createElement(I.VResizeObserver,{onResize:this.handleContainerResize},v())}});exports.default=ae;
|