@king-one/antdv 1.0.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.
Files changed (133) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/cdn/index.cdn.js +16 -0
  3. package/cdn/index.cdn.js.map +1 -0
  4. package/cdn/index.cdn.mjs +16 -0
  5. package/cdn/index.cdn.mjs.map +1 -0
  6. package/cdn/index.css +1 -0
  7. package/es/components/base/style/index.d.ts +1 -0
  8. package/es/components/base/style/index.mjs +2 -0
  9. package/es/components/base/style/index.mjs.map +1 -0
  10. package/es/components/form/component/form.d.ts +10 -0
  11. package/es/components/form/component/form.mjs +11 -0
  12. package/es/components/form/component/form.mjs.map +1 -0
  13. package/es/components/form/component/form.vue.d.ts +16 -0
  14. package/es/components/form/component/form.vue.mjs +6 -0
  15. package/es/components/form/component/form.vue.mjs.map +1 -0
  16. package/es/components/form/component/form.vue2.mjs +26 -0
  17. package/es/components/form/component/form.vue2.mjs.map +1 -0
  18. package/es/components/form/index.d.ts +17 -0
  19. package/es/components/form/index.mjs +9 -0
  20. package/es/components/form/index.mjs.map +1 -0
  21. package/es/components/form-item/component/form-item.vue.d.ts +11 -0
  22. package/es/components/form-item/component/form-item.vue.mjs +6 -0
  23. package/es/components/form-item/component/form-item.vue.mjs.map +1 -0
  24. package/es/components/form-item/component/form-item.vue2.mjs +113 -0
  25. package/es/components/form-item/component/form-item.vue2.mjs.map +1 -0
  26. package/es/components/form-item/index.d.ts +0 -0
  27. package/es/components/form-item/index.mjs +2 -0
  28. package/es/components/form-item/index.mjs.map +1 -0
  29. package/es/components/index.d.ts +2 -0
  30. package/es/components/index.mjs +5 -0
  31. package/es/components/index.mjs.map +1 -0
  32. package/es/components/scroll-bar/index.d.ts +26 -0
  33. package/es/components/scroll-bar/index.mjs +9 -0
  34. package/es/components/scroll-bar/index.mjs.map +1 -0
  35. package/es/components/scroll-bar/src/scroll-bar.d.ts +24 -0
  36. package/es/components/scroll-bar/src/scroll-bar.mjs +248 -0
  37. package/es/components/scroll-bar/src/scroll-bar.mjs.map +1 -0
  38. package/es/components/scroll-bar/src/types.d.ts +6 -0
  39. package/es/components/scroll-bar/src/types.mjs +8 -0
  40. package/es/components/scroll-bar/src/types.mjs.map +1 -0
  41. package/es/components/scroll-bar/style/index.d.ts +2 -0
  42. package/es/components/scroll-bar/style/index.mjs +3 -0
  43. package/es/components/scroll-bar/style/index.mjs.map +1 -0
  44. package/es/components/utils/install.d.ts +7 -0
  45. package/es/components/utils/install.mjs +19 -0
  46. package/es/components/utils/install.mjs.map +1 -0
  47. package/es/components/virtual-list/index.d.ts +276 -0
  48. package/es/components/virtual-list/index.mjs +9 -0
  49. package/es/components/virtual-list/index.mjs.map +1 -0
  50. package/es/components/virtual-list/src/types.d.ts +28 -0
  51. package/es/components/virtual-list/src/types.mjs +29 -0
  52. package/es/components/virtual-list/src/types.mjs.map +1 -0
  53. package/es/components/virtual-list/src/virtual-list.vue.d.ts +275 -0
  54. package/es/components/virtual-list/src/virtual-list.vue.mjs +6 -0
  55. package/es/components/virtual-list/src/virtual-list.vue.mjs.map +1 -0
  56. package/es/components/virtual-list/src/virtual-list.vue2.mjs +79 -0
  57. package/es/components/virtual-list/src/virtual-list.vue2.mjs.map +1 -0
  58. package/es/hooks/use-namespace/index.d.ts +23 -0
  59. package/es/hooks/use-namespace/index.mjs +78 -0
  60. package/es/hooks/use-namespace/index.mjs.map +1 -0
  61. package/es/index.d.ts +3 -0
  62. package/es/index.mjs +11 -0
  63. package/es/index.mjs.map +1 -0
  64. package/es/installer.d.ts +6 -0
  65. package/es/installer.mjs +14 -0
  66. package/es/installer.mjs.map +1 -0
  67. package/lib/components/base/style/index.d.ts +1 -0
  68. package/lib/components/base/style/index.js +5 -0
  69. package/lib/components/base/style/index.js.map +1 -0
  70. package/lib/components/form/component/form.d.ts +10 -0
  71. package/lib/components/form/component/form.js +13 -0
  72. package/lib/components/form/component/form.js.map +1 -0
  73. package/lib/components/form/component/form.vue.d.ts +16 -0
  74. package/lib/components/form/component/form.vue.js +10 -0
  75. package/lib/components/form/component/form.vue.js.map +1 -0
  76. package/lib/components/form/component/form.vue2.js +30 -0
  77. package/lib/components/form/component/form.vue2.js.map +1 -0
  78. package/lib/components/form/index.d.ts +17 -0
  79. package/lib/components/form/index.js +15 -0
  80. package/lib/components/form/index.js.map +1 -0
  81. package/lib/components/form-item/component/form-item.vue.d.ts +11 -0
  82. package/lib/components/form-item/component/form-item.vue.js +10 -0
  83. package/lib/components/form-item/component/form-item.vue.js.map +1 -0
  84. package/lib/components/form-item/component/form-item.vue2.js +117 -0
  85. package/lib/components/form-item/component/form-item.vue2.js.map +1 -0
  86. package/lib/components/form-item/index.d.ts +0 -0
  87. package/lib/components/form-item/index.js +3 -0
  88. package/lib/components/form-item/index.js.map +1 -0
  89. package/lib/components/index.d.ts +2 -0
  90. package/lib/components/index.js +14 -0
  91. package/lib/components/index.js.map +1 -0
  92. package/lib/components/scroll-bar/index.d.ts +26 -0
  93. package/lib/components/scroll-bar/index.js +15 -0
  94. package/lib/components/scroll-bar/index.js.map +1 -0
  95. package/lib/components/scroll-bar/src/scroll-bar.d.ts +24 -0
  96. package/lib/components/scroll-bar/src/scroll-bar.js +252 -0
  97. package/lib/components/scroll-bar/src/scroll-bar.js.map +1 -0
  98. package/lib/components/scroll-bar/src/types.d.ts +6 -0
  99. package/lib/components/scroll-bar/src/types.js +10 -0
  100. package/lib/components/scroll-bar/src/types.js.map +1 -0
  101. package/lib/components/scroll-bar/style/index.d.ts +2 -0
  102. package/lib/components/scroll-bar/style/index.js +6 -0
  103. package/lib/components/scroll-bar/style/index.js.map +1 -0
  104. package/lib/components/utils/install.d.ts +7 -0
  105. package/lib/components/utils/install.js +22 -0
  106. package/lib/components/utils/install.js.map +1 -0
  107. package/lib/components/virtual-list/index.d.ts +276 -0
  108. package/lib/components/virtual-list/index.js +15 -0
  109. package/lib/components/virtual-list/index.js.map +1 -0
  110. package/lib/components/virtual-list/src/types.d.ts +28 -0
  111. package/lib/components/virtual-list/src/types.js +31 -0
  112. package/lib/components/virtual-list/src/types.js.map +1 -0
  113. package/lib/components/virtual-list/src/virtual-list.vue.d.ts +275 -0
  114. package/lib/components/virtual-list/src/virtual-list.vue.js +10 -0
  115. package/lib/components/virtual-list/src/virtual-list.vue.js.map +1 -0
  116. package/lib/components/virtual-list/src/virtual-list.vue2.js +83 -0
  117. package/lib/components/virtual-list/src/virtual-list.vue2.js.map +1 -0
  118. package/lib/hooks/use-namespace/index.d.ts +23 -0
  119. package/lib/hooks/use-namespace/index.js +83 -0
  120. package/lib/hooks/use-namespace/index.js.map +1 -0
  121. package/lib/index.d.ts +3 -0
  122. package/lib/index.js +19 -0
  123. package/lib/index.js.map +1 -0
  124. package/lib/installer.d.ts +6 -0
  125. package/lib/installer.js +19 -0
  126. package/lib/installer.js.map +1 -0
  127. package/package.json +29 -0
  128. package/theme-chalk/base.css +1 -0
  129. package/theme-chalk/buttons.css +1 -0
  130. package/theme-chalk/index.css +1 -0
  131. package/theme-chalk/reset.css +0 -0
  132. package/theme-chalk/scroll-bar.css +1 -0
  133. package/theme-chalk/var.css +1 -0
package/cdn/index.css ADDED
@@ -0,0 +1 @@
1
+ :root{--king-color-white:#ffffff;--king-color-primary:#409eff;--king-color-success:#67c23a;--king-color-warning:#e6a23c;--king-color-danger:#f56c6c;--king-color-error:#f56c6c;--king-color-info:#909399}.king-button--primary{--king-button-text-color:var(--king-color-primary)}.king-button--success{--king-button-text-color:var(--king-color-success)}.king-button--warning{--king-button-text-color:var(--king-color-warning)}.king-button--danger{--king-button-text-color:var(--king-color-danger)}.king-button--error{--king-button-text-color:var(--king-color-error)}.king-button--info{--king-button-text-color:var(--king-color-info)}.king-button{color:var(--king-button-text-color)}.king-scrollbar{overflow:hidden;position:relative;z-index:auto;height:100%;width:100%}.king-scrollbar .king-scrollbar-container{width:100%;overflow:scroll;height:100%;min-height:inherit;max-height:inherit;scrollbar-width:none}.king-scrollbar .king-scrollbar-rail{position:absolute;right:0;width:5px;top:2px;bottom:2px;right:4px}.king-scrollbar .king-scrollbar-rail__scrollbar{background:rgba(0,0,0,.25);position:absolute;border-radius:5px;width:100%;cursor:pointer}
@@ -0,0 +1 @@
1
+ import '@king-one/antdv/theme-chalk/src/base.scss';
@@ -0,0 +1,2 @@
1
+ import '@king-one/antdv/theme-chalk/src/base.scss';
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import type { RuleItem } from 'async-validator';
2
+ import type { PropType } from 'vue';
3
+ export declare const formType: {
4
+ readonly model: {
5
+ readonly type: ObjectConstructor;
6
+ };
7
+ readonly rules: {
8
+ readonly type: PropType<Record<string, RuleItem[]>>;
9
+ };
10
+ };
@@ -0,0 +1,11 @@
1
+ const formType = {
2
+ model: {
3
+ type: Object
4
+ },
5
+ rules: {
6
+ type: Object
7
+ }
8
+ };
9
+
10
+ export { formType };
11
+ //# sourceMappingURL=form.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.mjs","sources":["../../../../../../packages/antdv/components/form/component/form.ts"],"sourcesContent":["/*\n * @Description:\n * @Version: 2.0\n * @Autor: caohao\n * @Date: 2024-09-16 17:25:58\n * @LastEditors: caohao\n * @LastEditTime: 2024-09-16 22:46:07\n */\nimport type {\n RuleItem\n} from 'async-validator'\nimport type { PropType } from 'vue'\n\nexport const formType = {\n model: {\n type: Object\n },\n rules: {\n type: Object as PropType<Record<string, RuleItem[]>>\n }\n} as const\n"],"names":[],"mappings":"AAaO,MAAM,QAAW,GAAA;AAAA,EACtB,KAAO,EAAA;AAAA,IACL,IAAM,EAAA,MAAA;AAAA,GACR;AAAA,EACA,KAAO,EAAA;AAAA,IACL,IAAM,EAAA,MAAA;AAAA,GACR;AACF;;;;"}
@@ -0,0 +1,16 @@
1
+ declare const _default: import("vue").DefineComponent<{
2
+ readonly model: {
3
+ readonly type: ObjectConstructor;
4
+ };
5
+ readonly rules: {
6
+ readonly type: import("vue").PropType<Record<string, import("async-validator").RuleItem[]>>;
7
+ };
8
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
+ readonly model: {
10
+ readonly type: ObjectConstructor;
11
+ };
12
+ readonly rules: {
13
+ readonly type: import("vue").PropType<Record<string, import("async-validator").RuleItem[]>>;
14
+ };
15
+ }>>, {}, {}>;
16
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import _sfc_main from './form.vue2.mjs';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
6
+ //# sourceMappingURL=form.vue.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.vue.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,26 @@
1
+ import { createElementVNode, defineComponent, openBlock, createElementBlock, renderSlot } from 'vue';
2
+ import { formType } from './form.mjs';
3
+
4
+ const _hoisted_1 = { class: "king-form" };
5
+ const _hoisted_2 = /* @__PURE__ */ createElementVNode(
6
+ "div",
7
+ null,
8
+ "\u4F1F\u5927\u7684\u597D\u6B4C",
9
+ -1
10
+ /* HOISTED */
11
+ );
12
+ var _sfc_main = /* @__PURE__ */ defineComponent({
13
+ __name: "form",
14
+ props: formType,
15
+ setup(__props) {
16
+ return (_ctx, _cache) => {
17
+ return openBlock(), createElementBlock("form", _hoisted_1, [
18
+ _hoisted_2,
19
+ renderSlot(_ctx.$slots, "default")
20
+ ]);
21
+ };
22
+ }
23
+ });
24
+
25
+ export { _sfc_main as default };
26
+ //# sourceMappingURL=form.vue2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.vue2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,17 @@
1
+ export * from './component/form';
2
+ export declare const KForm: import("../utils/install").SFCWithInstall<import("vue").DefineComponent<{
3
+ readonly model: {
4
+ readonly type: ObjectConstructor;
5
+ };
6
+ readonly rules: {
7
+ readonly type: import("vue").PropType<Record<string, import("async-validator").RuleItem[]>>;
8
+ };
9
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
10
+ readonly model: {
11
+ readonly type: ObjectConstructor;
12
+ };
13
+ readonly rules: {
14
+ readonly type: import("vue").PropType<Record<string, import("async-validator").RuleItem[]>>;
15
+ };
16
+ }>>, {}, {}>>;
17
+ export default KForm;
@@ -0,0 +1,9 @@
1
+ import { withInstall } from '../utils/install.mjs';
2
+ import './component/form.vue.mjs';
3
+ export { formType } from './component/form.mjs';
4
+ import _sfc_main from './component/form.vue2.mjs';
5
+
6
+ const KForm = withInstall(_sfc_main);
7
+
8
+ export { KForm, KForm as default };
9
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../packages/antdv/components/form/index.ts"],"sourcesContent":["import { withInstall } from '../utils/install'\nimport form from './component/form.vue'\n\nexport * from './component/form'\nexport const KForm = withInstall(form) // 增加类型\nexport default KForm\n"],"names":["form"],"mappings":";;;;;AAIa,MAAA,KAAA,GAAQ,YAAYA,SAAI;;;;"}
@@ -0,0 +1,11 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {
2
+ columns: import("ant-design-vue").TableColumnsType<any>;
3
+ data: {
4
+ key: string;
5
+ name: string;
6
+ age: number;
7
+ address: string;
8
+ }[];
9
+ onChange: (pagination: any, filters: any, sorter: any, extra: any) => void;
10
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
11
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import _sfc_main from './form-item.vue2.mjs';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
6
+ //# sourceMappingURL=form-item.vue.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-item.vue.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,113 @@
1
+ import { defineComponent, resolveComponent, openBlock, createBlock } from 'vue';
2
+
3
+ var _sfc_main = /* @__PURE__ */ defineComponent({
4
+ __name: "form-item",
5
+ setup(__props) {
6
+ const columns = [
7
+ {
8
+ title: "Name",
9
+ dataIndex: "name",
10
+ filters: [
11
+ {
12
+ text: "Joe",
13
+ value: "Joe"
14
+ },
15
+ {
16
+ text: "Category 1",
17
+ value: "Category 1",
18
+ children: [
19
+ {
20
+ text: "Yellow",
21
+ value: "Yellow"
22
+ },
23
+ {
24
+ text: "Pink",
25
+ value: "Pink"
26
+ }
27
+ ]
28
+ },
29
+ {
30
+ text: "Category 2",
31
+ value: "Category 2",
32
+ children: [
33
+ {
34
+ text: "Green",
35
+ value: "Green"
36
+ },
37
+ {
38
+ text: "Black",
39
+ value: "Black"
40
+ }
41
+ ]
42
+ }
43
+ ],
44
+ filterMode: "tree",
45
+ filterSearch: true,
46
+ onFilter: (value, record) => record.name.includes(value),
47
+ width: "30%"
48
+ },
49
+ {
50
+ title: "Age",
51
+ dataIndex: "age",
52
+ sorter: (a, b) => a.age - b.age
53
+ },
54
+ {
55
+ title: "Address",
56
+ dataIndex: "address",
57
+ filters: [
58
+ {
59
+ text: "London",
60
+ value: "London"
61
+ },
62
+ {
63
+ text: "New York",
64
+ value: "New York"
65
+ }
66
+ ],
67
+ onFilter: (value, record) => record.address.startsWith(value),
68
+ filterSearch: true,
69
+ width: "40%"
70
+ }
71
+ ];
72
+ const data = [
73
+ {
74
+ key: "1",
75
+ name: "John Brown",
76
+ age: 32,
77
+ address: "New York No. 1 Lake Park"
78
+ },
79
+ {
80
+ key: "2",
81
+ name: "Jim Green",
82
+ age: 42,
83
+ address: "London No. 1 Lake Park"
84
+ },
85
+ {
86
+ key: "3",
87
+ name: "Joe Black",
88
+ age: 32,
89
+ address: "Sidney No. 1 Lake Park"
90
+ },
91
+ {
92
+ key: "4",
93
+ name: "Jim Red",
94
+ age: 32,
95
+ address: "London No. 2 Lake Park"
96
+ }
97
+ ];
98
+ function onChange(pagination, filters, sorter, extra) {
99
+ console.log("params", pagination, filters, sorter, extra);
100
+ }
101
+ return (_ctx, _cache) => {
102
+ const _component_a_table = resolveComponent("a-table");
103
+ return openBlock(), createBlock(_component_a_table, {
104
+ columns,
105
+ "data-source": data,
106
+ onChange
107
+ });
108
+ };
109
+ }
110
+ });
111
+
112
+ export { _sfc_main as default };
113
+ //# sourceMappingURL=form-item.vue2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-item.vue2.mjs","sources":["../../../../../../packages/antdv/components/form-item/component/form-item.vue"],"sourcesContent":["<!-- eslint-disable no-console -->\n<script lang=\"ts\" setup>\nimport type { TableProps } from 'ant-design-vue'\n\nconst columns: TableProps['columns'] = [\n {\n title: 'Name',\n dataIndex: 'name',\n filters: [\n {\n text: 'Joe',\n value: 'Joe'\n },\n {\n text: 'Category 1',\n value: 'Category 1',\n children: [\n {\n text: 'Yellow',\n value: 'Yellow'\n },\n {\n text: 'Pink',\n value: 'Pink'\n }\n ]\n },\n {\n text: 'Category 2',\n value: 'Category 2',\n children: [\n {\n text: 'Green',\n value: 'Green'\n },\n {\n text: 'Black',\n value: 'Black'\n }\n ]\n }\n ],\n filterMode: 'tree',\n filterSearch: true,\n onFilter: (value, record) => record.name.includes(value),\n width: '30%'\n },\n {\n title: 'Age',\n dataIndex: 'age',\n sorter: (a, b) => a.age - b.age\n },\n {\n title: 'Address',\n dataIndex: 'address',\n filters: [\n {\n text: 'London',\n value: 'London'\n },\n {\n text: 'New York',\n value: 'New York'\n }\n ],\n onFilter: (value, record) => record.address.startsWith(value),\n filterSearch: true,\n width: '40%'\n }\n]\n\nconst data = [\n {\n key: '1',\n name: 'John Brown',\n age: 32,\n address: 'New York No. 1 Lake Park'\n },\n {\n key: '2',\n name: 'Jim Green',\n age: 42,\n address: 'London No. 1 Lake Park'\n },\n {\n key: '3',\n name: 'Joe Black',\n age: 32,\n address: 'Sidney No. 1 Lake Park'\n },\n {\n key: '4',\n name: 'Jim Red',\n age: 32,\n address: 'London No. 2 Lake Park'\n }\n]\n\nfunction onChange(pagination, filters, sorter, extra) {\n console.log('params', pagination, filters, sorter, extra)\n}\n</script>\n\n<template>\n <a-table :columns=\"columns\" :data-source=\"data\" @change=\"onChange\" />\n</template>\n"],"names":[],"mappings":"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"}
File without changes
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from './form';
2
+ export * from './virtual-list';
@@ -0,0 +1,5 @@
1
+ export { KForm } from './form/index.mjs';
2
+ export { KVirtualList } from './virtual-list/index.mjs';
3
+ export { formType } from './form/component/form.mjs';
4
+ export { virtualListProps } from './virtual-list/src/types.mjs';
5
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -0,0 +1,26 @@
1
+ import './style';
2
+ export * from './src/types';
3
+ export declare const KScrollBar: import("../utils/install").SFCWithInstall<import("vue").DefineComponent<{
4
+ readonly container: import("vue").PropType<() => HTMLElement | null | undefined>;
5
+ readonly content: import("vue").PropType<() => HTMLElement | null | undefined>;
6
+ readonly onScroll: import("vue").PropType<(e: Event) => void>;
7
+ }, {
8
+ sync: () => void;
9
+ handleContentResize: () => void;
10
+ handleContainerResize: () => void;
11
+ contentRef: import("vue").Ref<HTMLElement | null>;
12
+ yRailRef: import("vue").Ref<HTMLElement | null>;
13
+ containerRef: import("vue").Ref<HTMLElement | null>;
14
+ contentHeightRef: import("vue").Ref<Nullable<number>>;
15
+ containerHeightRef: import("vue").Ref<Nullable<number>>;
16
+ needYBarRef: import("vue").ComputedRef<boolean>;
17
+ yBarSizePxRef: import("vue").ComputedRef<string>;
18
+ handleYScrollMouseDown: (e: MouseEvent) => void;
19
+ yBarTopPxRef: import("vue").ComputedRef<string>;
20
+ handleScroll: (e: Event) => void;
21
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
22
+ readonly container: import("vue").PropType<() => HTMLElement | null | undefined>;
23
+ readonly content: import("vue").PropType<() => HTMLElement | null | undefined>;
24
+ readonly onScroll: import("vue").PropType<(e: Event) => void>;
25
+ }>>, {}, {}>>;
26
+ export default KScrollBar;
@@ -0,0 +1,9 @@
1
+ import { withInstall } from '../utils/install.mjs';
2
+ import ScrollBar from './src/scroll-bar.mjs';
3
+ import './style/index.mjs';
4
+ export { scrollbarProps } from './src/types.mjs';
5
+
6
+ const KScrollBar = withInstall(ScrollBar);
7
+
8
+ export { KScrollBar, KScrollBar as default };
9
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../packages/antdv/components/scroll-bar/index.ts"],"sourcesContent":["import { withInstall } from '../utils/install'\nimport ScrollBar from './src/scroll-bar'\nimport './style'\n\nexport * from './src/types'\nexport const KScrollBar = withInstall(ScrollBar)\nexport default KScrollBar\n"],"names":[],"mappings":";;;;;AAKa,MAAA,UAAA,GAAa,YAAY,SAAS;;;;"}
@@ -0,0 +1,24 @@
1
+ declare const _default: import("vue").DefineComponent<{
2
+ readonly container: import("vue").PropType<() => HTMLElement | null | undefined>;
3
+ readonly content: import("vue").PropType<() => HTMLElement | null | undefined>;
4
+ readonly onScroll: import("vue").PropType<(e: Event) => void>;
5
+ }, {
6
+ sync: () => void;
7
+ handleContentResize: () => void;
8
+ handleContainerResize: () => void;
9
+ contentRef: import("vue").Ref<HTMLElement | null>;
10
+ yRailRef: import("vue").Ref<HTMLElement | null>;
11
+ containerRef: import("vue").Ref<HTMLElement | null>;
12
+ contentHeightRef: import("vue").Ref<Nullable<number>>;
13
+ containerHeightRef: import("vue").Ref<Nullable<number>>;
14
+ needYBarRef: import("vue").ComputedRef<boolean>;
15
+ yBarSizePxRef: import("vue").ComputedRef<string>;
16
+ handleYScrollMouseDown: (e: MouseEvent) => void;
17
+ yBarTopPxRef: import("vue").ComputedRef<string>;
18
+ handleScroll: (e: Event) => void;
19
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
20
+ readonly container: import("vue").PropType<() => HTMLElement | null | undefined>;
21
+ readonly content: import("vue").PropType<() => HTMLElement | null | undefined>;
22
+ readonly onScroll: import("vue").PropType<(e: Event) => void>;
23
+ }>>, {}, {}>;
24
+ export default _default;
@@ -0,0 +1,248 @@
1
+ import { isVNode, defineComponent, onMounted, ref, computed, createVNode, mergeProps } from 'vue';
2
+ import { VResizeObserver } from 'vueuc';
3
+ import { off, on } from 'evtd';
4
+ import { defaultNamespace } from '../../../hooks/use-namespace/index.mjs';
5
+ import { scrollbarProps } from './types.mjs';
6
+
7
+ function _isSlot(s) {
8
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
9
+ }
10
+ var ScrollBar = /* @__PURE__ */ defineComponent({
11
+ name: "KScrollbar",
12
+ props: scrollbarProps,
13
+ inheritAttrs: false,
14
+ setup(props) {
15
+ onMounted(() => {
16
+ if (props.container) return;
17
+ sync();
18
+ });
19
+ const handleContentResize = () => {
20
+ sync();
21
+ };
22
+ const handleContainerResize = () => {
23
+ sync();
24
+ };
25
+ const contentRef = ref(null);
26
+ const containerRef = ref(null);
27
+ const yRailRef = ref(null);
28
+ const contentHeightRef = ref(null);
29
+ const contentWidthRef = ref(null);
30
+ const containerHeightRef = ref(null);
31
+ const containerWidthRef = ref(null);
32
+ const yRailSizeRef = ref(null);
33
+ const mergedContentRef = computed(() => {
34
+ var _a;
35
+ return ((_a = props.content) == null ? void 0 : _a.call(props)) || contentRef.value;
36
+ });
37
+ const mergedContainerRef = computed(() => {
38
+ var _a;
39
+ return ((_a = props.container) == null ? void 0 : _a.call(props)) || containerRef.value;
40
+ });
41
+ const containerScrollTopRef = ref(0);
42
+ const yBarSizeRef = computed(() => {
43
+ const {
44
+ value: containerHeight
45
+ } = containerHeightRef;
46
+ const {
47
+ value: contentHeight
48
+ } = contentHeightRef;
49
+ const {
50
+ value: yRailSize
51
+ } = yRailSizeRef;
52
+ if (containerHeight === null || contentHeight === null || yRailSize === null) {
53
+ return 0;
54
+ } else {
55
+ return Math.min(containerHeight, yRailSize * containerHeight / contentHeight + 5 * 1.5);
56
+ }
57
+ });
58
+ const yBarTopRef = computed(() => {
59
+ const {
60
+ value: containerHeight
61
+ } = containerHeightRef;
62
+ const {
63
+ value: containerScrollTop
64
+ } = containerScrollTopRef;
65
+ const {
66
+ value: contentHeight
67
+ } = contentHeightRef;
68
+ const {
69
+ value: yRailSize
70
+ } = yRailSizeRef;
71
+ if (containerHeight === null || contentHeight === null || yRailSize === null) {
72
+ return 0;
73
+ } else {
74
+ const heightDiff = contentHeight - containerHeight;
75
+ if (!heightDiff) return 0;
76
+ return containerScrollTop / heightDiff * (yRailSize - yBarSizeRef.value);
77
+ }
78
+ });
79
+ const yBarTopPxRef = computed(() => {
80
+ return `${yBarTopRef.value}px`;
81
+ });
82
+ const needYBarRef = computed(() => {
83
+ const {
84
+ value: containerHeight
85
+ } = containerHeightRef;
86
+ const {
87
+ value: contentHeight
88
+ } = contentHeightRef;
89
+ return containerHeight !== null && contentHeight !== null && contentHeight > containerHeight;
90
+ });
91
+ const yBarSizePxRef = computed(() => {
92
+ return `${yBarSizeRef.value}px`;
93
+ });
94
+ const syncPositionState = () => {
95
+ const {
96
+ value: content
97
+ } = mergedContentRef;
98
+ if (content) {
99
+ contentHeightRef.value = content.offsetHeight;
100
+ contentWidthRef.value = content.offsetWidth;
101
+ }
102
+ const {
103
+ value: container
104
+ } = mergedContainerRef;
105
+ if (container) {
106
+ containerHeightRef.value = container.offsetHeight;
107
+ containerWidthRef.value = container.offsetWidth;
108
+ }
109
+ const {
110
+ value: yRailEl
111
+ } = yRailRef;
112
+ if (yRailEl) {
113
+ yRailSizeRef.value = yRailEl.offsetHeight;
114
+ }
115
+ };
116
+ let yBarPressed = false;
117
+ let memoYTop = 0;
118
+ let memoMouseY = 0;
119
+ let yBarVanishTimerId;
120
+ const handleYScrollMouseMove = (e) => {
121
+ if (!yBarPressed) return;
122
+ if (yBarVanishTimerId !== void 0) {
123
+ window.clearTimeout(yBarVanishTimerId);
124
+ }
125
+ const {
126
+ value: containerHeight
127
+ } = containerHeightRef;
128
+ const {
129
+ value: contentHeight
130
+ } = contentHeightRef;
131
+ const {
132
+ value: yBarSize
133
+ } = yBarSizeRef;
134
+ if (containerHeight === null || contentHeight === null) return;
135
+ const dY = e.clientY - memoMouseY;
136
+ const dScrollTop = dY * (contentHeight - containerHeight) / (containerHeight - yBarSize);
137
+ const toScrollTopUpperBound = contentHeight - containerHeight;
138
+ let toScrollTop = memoYTop + dScrollTop;
139
+ toScrollTop = Math.min(toScrollTopUpperBound, toScrollTop);
140
+ toScrollTop = Math.max(toScrollTop, 0);
141
+ const {
142
+ value: container
143
+ } = mergedContainerRef;
144
+ if (container) {
145
+ container.scrollTop = toScrollTop;
146
+ }
147
+ };
148
+ const handleYScrollMouseUp = (e) => {
149
+ e.preventDefault();
150
+ e.stopPropagation();
151
+ off("mousemove", window, handleYScrollMouseMove, true);
152
+ off("mouseup", window, handleYScrollMouseUp, true);
153
+ yBarPressed = false;
154
+ sync();
155
+ };
156
+ const handleYScrollMouseDown = (e) => {
157
+ e.preventDefault();
158
+ e.stopPropagation();
159
+ on("mousemove", window, handleYScrollMouseMove, true);
160
+ on("mouseup", window, handleYScrollMouseUp, true);
161
+ memoYTop = containerScrollTopRef.value;
162
+ memoMouseY = e.clientY;
163
+ yBarPressed = true;
164
+ };
165
+ function handleScroll(e) {
166
+ const {
167
+ onScroll
168
+ } = props;
169
+ if (onScroll) onScroll(e);
170
+ syncScrollState();
171
+ }
172
+ function syncScrollState() {
173
+ const {
174
+ value: container
175
+ } = mergedContainerRef;
176
+ if (container) {
177
+ containerScrollTopRef.value = container.scrollTop;
178
+ }
179
+ }
180
+ function sync() {
181
+ syncPositionState();
182
+ syncScrollState();
183
+ }
184
+ return {
185
+ sync,
186
+ handleContentResize,
187
+ handleContainerResize,
188
+ contentRef,
189
+ yRailRef,
190
+ containerRef,
191
+ contentHeightRef,
192
+ containerHeightRef,
193
+ needYBarRef,
194
+ yBarSizePxRef,
195
+ handleYScrollMouseDown,
196
+ yBarTopPxRef,
197
+ handleScroll
198
+ };
199
+ },
200
+ render() {
201
+ let _slot;
202
+ const {
203
+ $slots
204
+ } = this;
205
+ const createYBar = () => {
206
+ return createVNode("div", {
207
+ "class": `${defaultNamespace}-scrollbar-rail`,
208
+ "ref": "yRailRef"
209
+ }, [this.needYBarRef && createVNode("div", {
210
+ "class": `${defaultNamespace}-scrollbar-rail__scrollbar`,
211
+ "style": {
212
+ height: this.yBarSizePxRef,
213
+ top: this.yBarTopPxRef
214
+ },
215
+ "onMousedown": this.handleYScrollMouseDown
216
+ }, null)]);
217
+ };
218
+ const createChildren = () => {
219
+ var _a;
220
+ return createVNode("div", mergeProps({
221
+ "class": `${defaultNamespace}-scrollbar`
222
+ }, this.$attrs), [this.container ? (_a = $slots.default) == null ? void 0 : _a.call($slots) : createVNode("div", {
223
+ "class": `${defaultNamespace}-scrollbar-container`,
224
+ "onScroll": this.handleScroll,
225
+ "ref": "containerRef"
226
+ }, [createVNode(VResizeObserver, {
227
+ "onResize": this.handleContentResize
228
+ }, {
229
+ default: () => {
230
+ var _a2;
231
+ return [createVNode("div", {
232
+ "ref": "contentRef",
233
+ "class": `${defaultNamespace}-scrollbar-content`
234
+ }, [(_a2 = $slots.default) == null ? void 0 : _a2.call($slots)])];
235
+ }
236
+ })]), createYBar()]);
237
+ };
238
+ const createBarNode = this.container ? createChildren() : createVNode(VResizeObserver, {
239
+ "onResize": this.handleContainerResize
240
+ }, _isSlot(_slot = createChildren()) ? _slot : {
241
+ default: () => [_slot]
242
+ });
243
+ return createBarNode;
244
+ }
245
+ });
246
+
247
+ export { ScrollBar as default };
248
+ //# sourceMappingURL=scroll-bar.mjs.map