ep-craft 0.1.30 → 0.1.32

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 (154) hide show
  1. package/dist/components/aside/aside.d.ts +26 -0
  2. package/dist/components/aside/aside.js +29 -0
  3. package/dist/components/aside/index.d.ts +2 -2
  4. package/dist/components/aside/index.js +4 -4
  5. package/dist/components/autocomplete/EpAutocomplete.d.ts +494 -0
  6. package/dist/components/autocomplete/EpAutocomplete.js +465 -0
  7. package/dist/components/autocomplete/autocomplete.d.ts +322 -0
  8. package/dist/components/autocomplete/autocomplete.js +120 -0
  9. package/dist/components/autocomplete/index.d.ts +23 -2
  10. package/dist/components/autocomplete/index.js +9 -3
  11. package/dist/components/autocomplete/instance.d.ts +70 -0
  12. package/dist/components/backtop/EpBacktop.vue.d.ts +55 -0
  13. package/dist/components/backtop/EpBacktop.vue.js +59 -0
  14. package/dist/components/backtop/EpBacktop2.vue.js +4 -0
  15. package/dist/components/backtop/backtop.d.ts +43 -0
  16. package/dist/components/backtop/backtop.js +36 -0
  17. package/dist/components/backtop/index.d.ts +35 -2
  18. package/dist/components/backtop/index.js +6 -3
  19. package/dist/components/backtop/instance.d.ts +10 -0
  20. package/dist/components/backtop/use-backtop.d.ts +13 -0
  21. package/dist/components/backtop/use-backtop.js +23 -0
  22. package/dist/components/checkbox/EpCheckbox.vue.d.ts +147 -0
  23. package/dist/components/checkbox/EpCheckbox.vue.js +101 -0
  24. package/dist/components/checkbox/EpCheckbox2.vue.js +4 -0
  25. package/dist/components/checkbox/index.d.ts +34 -2
  26. package/dist/components/checkbox/index.js +10 -4
  27. package/dist/components/checkbox/instance.d.ts +10 -0
  28. package/dist/components/checkbox/src/checkbox.d.ts +208 -0
  29. package/dist/components/checkbox/src/checkbox.js +119 -0
  30. package/dist/components/checkbox/src/composables/use-checkbox-disabled.d.ts +7 -0
  31. package/dist/components/checkbox/src/composables/use-checkbox-disabled.js +31 -0
  32. package/dist/components/checkbox/src/composables/use-checkbox-event.d.ts +9 -0
  33. package/dist/components/checkbox/src/composables/use-checkbox-event.js +48 -0
  34. package/dist/components/checkbox/src/composables/use-checkbox-model.d.ts +7 -0
  35. package/dist/components/checkbox/src/composables/use-checkbox-model.js +31 -0
  36. package/dist/components/checkbox/src/composables/use-checkbox-status.d.ts +12 -0
  37. package/dist/components/checkbox/src/composables/use-checkbox-status.js +33 -0
  38. package/dist/components/checkbox/src/composables/use-checkbox.d.ts +16 -0
  39. package/dist/components/checkbox/src/composables/use-checkbox.js +81 -0
  40. package/dist/components/checkbox/src/constants.d.ts +8 -0
  41. package/dist/components/checkbox/src/constants.js +4 -0
  42. package/dist/components/checkbox-button/EpCheckboxButton.vue.d.ts +147 -0
  43. package/dist/components/checkbox-button/EpCheckboxButton.vue.js +84 -0
  44. package/dist/components/checkbox-button/EpCheckboxButton2.vue.js +4 -0
  45. package/dist/components/checkbox-button/index.d.ts +24 -2
  46. package/dist/components/checkbox-button/index.js +6 -3
  47. package/dist/components/checkbox-button/instance.d.ts +10 -0
  48. package/dist/components/checkbox-group/EpCheckboxGroup.vue.d.ts +74 -0
  49. package/dist/components/checkbox-group/EpCheckboxGroup.vue.js +92 -0
  50. package/dist/components/checkbox-group/EpCheckboxGroup2.vue.js +4 -0
  51. package/dist/components/checkbox-group/index.d.ts +27 -2
  52. package/dist/components/checkbox-group/index.js +10 -4
  53. package/dist/components/checkbox-group/instance.d.ts +10 -0
  54. package/dist/components/checkbox-group/src/checkbox-group.d.ts +102 -0
  55. package/dist/components/checkbox-group/src/checkbox-group.js +84 -0
  56. package/dist/components/container/container.d.ts +35 -0
  57. package/dist/components/container/container.js +26 -0
  58. package/dist/components/container/index.d.ts +23 -2
  59. package/dist/components/container/index.js +13 -4
  60. package/dist/components/date-picker/src/date-picker.d.ts +5 -5
  61. package/dist/components/footer/footer.d.ts +28 -0
  62. package/dist/components/footer/footer.js +29 -0
  63. package/dist/components/footer/index.d.ts +2 -2
  64. package/dist/components/footer/index.js +4 -4
  65. package/dist/components/header/header.d.ts +28 -0
  66. package/dist/components/header/header.js +29 -0
  67. package/dist/components/header/index.d.ts +2 -2
  68. package/dist/components/header/index.js +4 -4
  69. package/dist/components/input/index.d.ts +177 -0
  70. package/dist/components/input/index.js +8 -6
  71. package/dist/components/input/input.d.ts +2 -2
  72. package/dist/components/input/input.js +6 -6
  73. package/dist/components/input-number/EpInputNumber.vue.d.ts +5 -5
  74. package/dist/components/input-number/input-number.d.ts +2 -2
  75. package/dist/components/main/index.d.ts +2 -2
  76. package/dist/components/main/index.js +3 -3
  77. package/dist/components/main/main.d.ts +14 -0
  78. package/dist/components/main/main.js +14 -0
  79. package/dist/components/pagination/index.d.ts +4 -2
  80. package/dist/components/pagination/index.js +9 -3
  81. package/dist/components/pagination/src/components/jumper.d.ts +13 -0
  82. package/dist/components/pagination/src/components/jumper.js +16 -0
  83. package/dist/components/pagination/src/components/jumper.vue.d.ts +16 -0
  84. package/dist/components/pagination/src/components/jumper.vue.js +58 -0
  85. package/dist/components/pagination/src/components/jumper2.vue.js +4 -0
  86. package/dist/components/pagination/src/components/next.d.ts +22 -0
  87. package/dist/components/pagination/src/components/next.js +26 -0
  88. package/dist/components/pagination/src/components/next.vue.d.ts +42 -0
  89. package/dist/components/pagination/src/components/next.vue.js +44 -0
  90. package/dist/components/pagination/src/components/next2.vue.js +4 -0
  91. package/dist/components/pagination/src/components/pager.d.ts +16 -0
  92. package/dist/components/pagination/src/components/pager.js +24 -0
  93. package/dist/components/pagination/src/components/pager.vue.d.ts +30 -0
  94. package/dist/components/pagination/src/components/pager.vue.js +148 -0
  95. package/dist/components/pagination/src/components/pager2.vue.js +4 -0
  96. package/dist/components/pagination/src/components/prev.d.ts +24 -0
  97. package/dist/components/pagination/src/components/prev.js +25 -0
  98. package/dist/components/pagination/src/components/prev.vue.d.ts +39 -0
  99. package/dist/components/pagination/src/components/prev.vue.js +44 -0
  100. package/dist/components/pagination/src/components/prev2.vue.js +4 -0
  101. package/dist/components/pagination/src/components/sizes.d.ts +35 -0
  102. package/dist/components/pagination/src/components/sizes.js +34 -0
  103. package/dist/components/pagination/src/components/sizes.vue.d.ts +68 -0
  104. package/dist/components/pagination/src/components/sizes.vue.js +73 -0
  105. package/dist/components/pagination/src/components/sizes2.vue.js +4 -0
  106. package/dist/components/pagination/src/components/total.d.ts +8 -0
  107. package/dist/components/pagination/src/components/total.js +15 -0
  108. package/dist/components/pagination/src/components/total.vue.d.ts +8 -0
  109. package/dist/components/pagination/src/components/total.vue.js +33 -0
  110. package/dist/components/pagination/src/components/total2.vue.js +4 -0
  111. package/dist/components/pagination/src/constants.d.ts +9 -0
  112. package/dist/components/pagination/src/constants.js +4 -0
  113. package/dist/components/pagination/src/pagination.d.ts +147 -0
  114. package/dist/components/pagination/src/pagination.js +314 -0
  115. package/dist/components/pagination/src/usePagination.d.ts +1 -0
  116. package/dist/components/pagination/src/usePagination.js +6 -0
  117. package/dist/components/popper/src/content.vue.d.ts +6 -6
  118. package/dist/components/scrollbar/index.d.ts +217 -6
  119. package/dist/components/scrollbar/index.js +12 -5
  120. package/dist/components/scrollbar/src/bar.d.ts +23 -0
  121. package/dist/components/scrollbar/src/bar.js +19 -0
  122. package/dist/components/scrollbar/src/bar.vue.d.ts +23 -0
  123. package/dist/components/scrollbar/src/bar.vue.js +43 -0
  124. package/dist/components/scrollbar/src/bar2.vue.js +4 -0
  125. package/dist/components/scrollbar/src/constants.d.ts +6 -0
  126. package/dist/components/scrollbar/src/constants.js +4 -0
  127. package/dist/components/scrollbar/src/scrollbar.d.ts +111 -6
  128. package/dist/components/scrollbar/src/scrollbar.js +108 -7
  129. package/dist/components/scrollbar/src/scrollbar.vue.d.ts +101 -0
  130. package/dist/components/scrollbar/src/scrollbar.vue.js +178 -0
  131. package/dist/components/scrollbar/src/scrollbar2.vue.js +4 -0
  132. package/dist/components/scrollbar/src/thumb.d.ts +29 -0
  133. package/dist/components/scrollbar/src/thumb.js +19 -0
  134. package/dist/components/scrollbar/src/thumb.vue.d.ts +27 -0
  135. package/dist/components/scrollbar/src/thumb.vue.js +109 -0
  136. package/dist/components/scrollbar/src/thumb2.vue.js +4 -0
  137. package/dist/components/scrollbar/src/util.d.ts +2 -14
  138. package/dist/components/scrollbar/src/util.js +12 -3
  139. package/dist/components/select/index.d.ts +2214 -0
  140. package/dist/components/select/index.js +10 -7
  141. package/dist/components/select/select.vue.d.ts +148 -90
  142. package/dist/components/select-v2/src/select.vue.d.ts +30 -30
  143. package/dist/components/time-picker/src/common/picker.vue.d.ts +5 -5
  144. package/dist/components/time-picker/src/time-picker.d.ts +5 -5
  145. package/dist/components/tooltip/index.d.ts +24 -24
  146. package/dist/components/tooltip/src/content.vue.d.ts +6 -6
  147. package/dist/components/tooltip/src/tooltip.vue.d.ts +8 -8
  148. package/dist/ep-craft.js +187 -179
  149. package/dist/index.css +1 -1
  150. package/dist/index.d.ts +18 -0
  151. package/dist/vendored-components.d.ts +5 -2
  152. package/dist/vendored-components.js +22 -1
  153. package/package.json +5 -2
  154. package/theme-chalk/src/float-label.scss +51 -26
@@ -1,6 +1,12 @@
1
- import { ElAutocomplete as t } from "element-plus";
2
1
  import { withInstall as o } from "../../utils/with-install.js";
3
- const e = Object.assign({}, t, { name: "EpAutocomplete" }), c = o(e, "ep-autocomplete");
2
+ import t from "./EpAutocomplete.js";
3
+ import { autocompleteEmits as c, autocompleteProps as u } from "./autocomplete.js";
4
+ const m = o(
5
+ t,
6
+ "ep-autocomplete"
7
+ );
4
8
  export {
5
- c as EpAutocomplete
9
+ m as EpAutocomplete,
10
+ c as autocompleteEmits,
11
+ u as autocompleteProps
6
12
  };
@@ -0,0 +1,70 @@
1
+ import type { ComponentInstance, Ref, ShallowUnwrapRef } from 'vue';
2
+ import type { ComponentExposed } from 'vue-component-type-helpers';
3
+ import type { AutocompleteData, AutocompleteDataItem } from './autocomplete';
4
+ import type { InputInstance } from '../input';
5
+ import type { TooltipInstance } from '../tooltip';
6
+ import type _EpAutocomplete from './EpAutocomplete';
7
+ /**
8
+ * 上游 `autocomplete.d.ts` 的公开实例类型为
9
+ * `ComponentInstance<typeof _default> & ComponentExposed<typeof _default>`;
10
+ * 本地对应物即下方 `AutocompleteInstance`。
11
+ *
12
+ * 前两项照抄上游写法。但**本地多交集一项 `AutocompleteExposed`**,原因如下:
13
+ *
14
+ * 上游 `_default` 是 SFC 编译出的**函数式组件签名**(形如
15
+ * `(props, ctx, expose: (exposed: infer E) => any) => VNode`),
16
+ * 故 `ComponentExposed` 能走 `T extends (props, ctx, expose, ...) => any` 分支、
17
+ * 取出 expose 载荷。
18
+ *
19
+ * 本地本体是 `.ts` 的 `defineComponent`(render 函数式),其返回类型是**可 new 的
20
+ * `DefineComponent`**,`ComponentExposed` 会先命中 `T extends new (...) => infer E`
21
+ * 分支而**退化为公开实例类型**、取不到 expose 载荷。实测(`vue-tsc`,同一探针内
22
+ * 故意赋给 `number` 以打印解析结果):`InstanceType<typeof _EpAutocomplete>`、
23
+ * `ComponentInstance<typeof _EpAutocomplete>`、`ComponentExposed<typeof _EpAutocomplete>`
24
+ * 三者解析结果**逐字相同**,且均**不含** `focus` / `blur` / `handleSelect` 等成员。
25
+ *
26
+ * 若只写前两项,公开类型面将比上游**少一整个 expose 面**(需求 5.8 的使用方式
27
+ * `ref<AutocompleteInstance>().value.focus()` 会类型报错)。故此处按本体
28
+ * `EpAutocomplete.ts` 的 `__expose({ ... })` 载荷**逐项转录**并取 `ShallowUnwrapRef`
29
+ * (与上游 `autocomplete.vue.d.ts` 的 `ShallowUnwrapRef<{ ... }>` 同款展开),
30
+ * 使交集后的公开面与上游等价。转录项与上游 expose 清单一一对应,无新增。
31
+ *
32
+ * 处置先例:`src/components/scrollbar/src/scrollbar.ts` 的 `ScrollbarInstance`
33
+ * 亦是手写 expose 接口(该处因 `scrollTo` 重载不可赋值而必须手写)。
34
+ */
35
+ type AutocompleteExposed = ShallowUnwrapRef<{
36
+ /** @description the index of the currently highlighted item */
37
+ highlightedIndex: Ref<number>;
38
+ /** @description autocomplete whether activated */
39
+ activated: Ref<boolean>;
40
+ /** @description remote search loading status */
41
+ loading: Ref<boolean>;
42
+ /** @description el-input component instance */
43
+ inputRef: Ref<InputInstance | undefined>;
44
+ /** @description el-tooltip component instance */
45
+ popperRef: Ref<TooltipInstance | undefined>;
46
+ /** @description fetch suggestions result */
47
+ suggestions: Ref<AutocompleteData>;
48
+ /** @description triggers when a suggestion is clicked */
49
+ handleSelect: (item: AutocompleteDataItem) => Promise<void>;
50
+ /** @description handle keyboard enter event */
51
+ handleKeyEnter: () => Promise<void>;
52
+ /** @description focus the input element */
53
+ focus: () => void;
54
+ /** @description blur the input element */
55
+ blur: () => void;
56
+ /** @description close suggestion */
57
+ close: () => void;
58
+ /** @description highlight an item in a suggestion */
59
+ highlight: (index: number) => void;
60
+ /** @description loading suggestion list */
61
+ getData: (queryString: string) => Promise<void>;
62
+ }>;
63
+ /**
64
+ * EpAutocomplete 的公开实例类型(对应上游 `AutocompleteInstance`)。
65
+ *
66
+ * 定义形态见上方注释:前两项与上游逐字对应,第三项补齐本地 `.ts` 本体
67
+ * 取不到的 expose 载荷。
68
+ */
69
+ export type AutocompleteInstance = ComponentInstance<typeof _EpAutocomplete> & ComponentExposed<typeof _EpAutocomplete> & AutocompleteExposed;
70
+ export {};
@@ -0,0 +1,55 @@
1
+ declare var __VLS_5: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_5) => any;
4
+ };
5
+ declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
+ readonly visibilityHeight: {
7
+ readonly type: NumberConstructor;
8
+ readonly default: 200;
9
+ };
10
+ readonly target: {
11
+ readonly type: StringConstructor;
12
+ readonly default: "";
13
+ };
14
+ readonly right: {
15
+ readonly type: NumberConstructor;
16
+ readonly default: 40;
17
+ };
18
+ readonly bottom: {
19
+ readonly type: NumberConstructor;
20
+ readonly default: 40;
21
+ };
22
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
+ click: (evt: MouseEvent) => void;
24
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
25
+ readonly visibilityHeight: {
26
+ readonly type: NumberConstructor;
27
+ readonly default: 200;
28
+ };
29
+ readonly target: {
30
+ readonly type: StringConstructor;
31
+ readonly default: "";
32
+ };
33
+ readonly right: {
34
+ readonly type: NumberConstructor;
35
+ readonly default: 40;
36
+ };
37
+ readonly bottom: {
38
+ readonly type: NumberConstructor;
39
+ readonly default: 40;
40
+ };
41
+ }>> & Readonly<{
42
+ onClick?: ((evt: MouseEvent) => any) | undefined;
43
+ }>, {
44
+ readonly right: number;
45
+ readonly bottom: number;
46
+ readonly target: string;
47
+ readonly visibilityHeight: number;
48
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
49
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
50
+ export default _default;
51
+ type __VLS_WithSlots<T, S> = T & {
52
+ new (): {
53
+ $slots: S;
54
+ };
55
+ };
@@ -0,0 +1,59 @@
1
+ import { defineComponent as C, computed as E, openBlock as p, createBlock as B, Transition as N, unref as t, withCtx as i, createElementBlock as _, withModifiers as T, normalizeClass as a, normalizeStyle as h, renderSlot as v, createVNode as s, createCommentVNode as x } from "vue";
2
+ import { ElIcon as y } from "../icon/index.js";
3
+ import { CaretTop as $ } from "@element-plus/icons-vue";
4
+ import { useNamespace as M } from "../../hooks/use-namespace/index.js";
5
+ import "@vue/shared";
6
+ import "lodash-unified";
7
+ import "@vueuse/core";
8
+ import "../../hooks/use-size/index.js";
9
+ import "@popperjs/core";
10
+ import "../../hooks/use-z-index/index.js";
11
+ import "../../hooks/use-delayed-toggle/index.js";
12
+ import "../../hooks/use-aria/index.js";
13
+ import "../../hooks/use-model-toggle/index.js";
14
+ import "../../hooks/use-empty-values/index.js";
15
+ import { backtopEmits as S, backtopProps as g } from "./backtop.js";
16
+ import { useBackTop as w } from "./use-backtop.js";
17
+ const n = "EpBacktop", R = /* @__PURE__ */ C({
18
+ name: n,
19
+ __name: "EpBacktop",
20
+ props: g,
21
+ emits: S,
22
+ setup(c, { emit: l }) {
23
+ const o = c, f = l, e = M("backtop"), { handleClick: r, visible: u } = w(o, f, n), d = E(() => ({
24
+ right: `${o.right}px`,
25
+ bottom: `${o.bottom}px`
26
+ }));
27
+ return (k, m) => (p(), B(N, {
28
+ name: `${t(e).namespace.value}-fade-in`
29
+ }, {
30
+ default: i(() => [
31
+ t(u) ? (p(), _("div", {
32
+ key: 0,
33
+ style: h(d.value),
34
+ class: a(t(e).b()),
35
+ onClick: m[0] || (m[0] = T(
36
+ //@ts-ignore
37
+ (...b) => t(r) && t(r)(...b),
38
+ ["stop"]
39
+ ))
40
+ }, [
41
+ v(k.$slots, "default", {}, () => [
42
+ s(t(y), {
43
+ class: a(t(e).e("icon"))
44
+ }, {
45
+ default: i(() => [
46
+ s(t($))
47
+ ]),
48
+ _: 1
49
+ }, 8, ["class"])
50
+ ])
51
+ ], 6)) : x("", !0)
52
+ ]),
53
+ _: 3
54
+ }, 8, ["name"]));
55
+ }
56
+ });
57
+ export {
58
+ R as default
59
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./EpBacktop.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,43 @@
1
+ import type { ExtractPropTypes, ExtractPublicPropTypes } from 'vue';
2
+ /**
3
+ * @deprecated Removed after 3.0.0, Use `BacktopProps` instead.
4
+ */
5
+ export declare const backtopProps: {
6
+ /**
7
+ * @description the button will not show until the scroll height reaches this value.
8
+ */
9
+ readonly visibilityHeight: {
10
+ readonly type: NumberConstructor;
11
+ readonly default: 200;
12
+ };
13
+ /**
14
+ * @description the target to trigger scroll.
15
+ */
16
+ readonly target: {
17
+ readonly type: StringConstructor;
18
+ readonly default: "";
19
+ };
20
+ /**
21
+ * @description right distance.
22
+ */
23
+ readonly right: {
24
+ readonly type: NumberConstructor;
25
+ readonly default: 40;
26
+ };
27
+ /**
28
+ * @description bottom distance.
29
+ */
30
+ readonly bottom: {
31
+ readonly type: NumberConstructor;
32
+ readonly default: 40;
33
+ };
34
+ };
35
+ export type BacktopProps = ExtractPropTypes<typeof backtopProps>;
36
+ /**
37
+ * @deprecated Removed after 3.0.0, Use `BacktopProps` instead.
38
+ */
39
+ export type BacktopPropsPublic = ExtractPublicPropTypes<typeof backtopProps>;
40
+ export declare const backtopEmits: {
41
+ click: (evt: MouseEvent) => boolean;
42
+ };
43
+ export type BacktopEmits = typeof backtopEmits;
@@ -0,0 +1,36 @@
1
+ const e = {
2
+ /**
3
+ * @description the button will not show until the scroll height reaches this value.
4
+ */
5
+ visibilityHeight: {
6
+ type: Number,
7
+ default: 200
8
+ },
9
+ /**
10
+ * @description the target to trigger scroll.
11
+ */
12
+ target: {
13
+ type: String,
14
+ default: ""
15
+ },
16
+ /**
17
+ * @description right distance.
18
+ */
19
+ right: {
20
+ type: Number,
21
+ default: 40
22
+ },
23
+ /**
24
+ * @description bottom distance.
25
+ */
26
+ bottom: {
27
+ type: Number,
28
+ default: 40
29
+ }
30
+ }, i = {
31
+ click: (t) => t instanceof MouseEvent
32
+ };
33
+ export {
34
+ i as backtopEmits,
35
+ e as backtopProps
36
+ };
@@ -1,4 +1,37 @@
1
1
  import type { Plugin } from 'vue';
2
- import { ElBacktop } from 'element-plus';
3
- export declare const EpBacktop: typeof ElBacktop & Plugin;
2
+ import _EpBacktop from './EpBacktop.vue';
3
+ /**
4
+ * backtop 自持 barrel:用**本地**安装辅助把 SFC 本体注册为 `ep-backtop`
5
+ * ——对外注册名与迁移前的 8 行包装态**逐字相同**(需求 6.2)。
6
+ *
7
+ * 形态对齐 `src/components/input/index.ts`(纯本地本体的自持 barrel)。与迁移前的
8
+ * `Object.assign({}, ElBacktop, { name: 'EpBacktop' })` 包装态的关键差异:本体不再来自
9
+ * `element-plus`,故本入口模块**零 element-plus 引用**(需求 1.3)。
10
+ *
11
+ * **必须用 `../../utils/with-install`(本地版),不得误用 `../../utils/vue/install`(上游版)**:
12
+ * 二者同名而签名不同——本地版 `withInstall(component, name: string)` 按**显式注册名**注册;
13
+ * 上游版 `withInstall(main, extra?)` 按 `comp.name` 注册,并把 `extra`
14
+ * 交给 `Object.values()` 展开。若误用上游版,第二参字符串会被**逐字符展开**,`ep-backtop`
15
+ * **静默注册失败**(需求 6.2 破,且构建与类型检查均无异常)。
16
+ *
17
+ * **不导出 `backtopProps` / `backtopEmits` 运行时常量**:design.md 决策 D2——二者无消费者,
18
+ * 仅在本目录内供 `EpBacktop.vue` 使用(`defineProps(backtopProps)` / `defineEmits(backtopEmits)`);
19
+ * `use-backtop.ts` 只取 `BacktopProps` **类型**,不引用这两个运行时常量。需求 6.3 只要求
20
+ * 「迁移前已提供的导出不缺失」,而迁移前的 barrel 不导出任何常量,故此处按契约显式不导出。
21
+ *
22
+ * **不补 `ElBacktop` 具名别名**:仓内无消费者(本目录唯一的消费入口是主入口
23
+ * `src/components/index.ts`,它只导出 `EpBacktop`),且对**同一 SFC 对象**二次 `withInstall`
24
+ * 会与 `EpBacktop` 争抢同一个 `.install`(该既有瑕疵见 `input/index.ts` 的 `ElInput` 别名注释)。
25
+ * 与 scrollbar / input 需双名导出的情形不同。
26
+ *
27
+ * **不使用 `export *`**:公开面按契约显式列出,避免 `backtop.ts` / `instance.ts` 的内部声明
28
+ * 外泄到主入口(与 `input` / `autocomplete` 一致)。
29
+ *
30
+ * `EpBacktop.name` 为 `'EpBacktop'`——由 SFC 内 `defineOptions({ name: 'EpBacktop' })` 设定;
31
+ * `withInstall` 只写 `.install`、**从不写** `.name`,故组件名(`EpBacktop`)与注册名
32
+ * (`ep-backtop`,由第二参独立设定)互不干涉。
33
+ */
34
+ export declare const EpBacktop: typeof _EpBacktop & Plugin;
4
35
  export default EpBacktop;
36
+ export type { BacktopProps, BacktopPropsPublic, BacktopEmits, } from './backtop';
37
+ export type { BacktopInstance } from './instance';
@@ -1,6 +1,9 @@
1
- import { ElBacktop as t } from "element-plus";
2
1
  import { withInstall as o } from "../../utils/with-install.js";
3
- const p = Object.assign({}, t, { name: "EpBacktop" }), k = o(p, "ep-backtop");
2
+ import t from "./EpBacktop.vue.js";
3
+ const r = o(
4
+ t,
5
+ "ep-backtop"
6
+ );
4
7
  export {
5
- k as EpBacktop
8
+ r as EpBacktop
6
9
  };
@@ -0,0 +1,10 @@
1
+ import type _EpBacktop from './EpBacktop.vue';
2
+ /**
3
+ * EpBacktop 的公开实例类型。
4
+ *
5
+ * 对应上游 `es/components/backtop/src/instance.d.ts` 的 `BacktopInstance`
6
+ * (上游写作 `InstanceType<typeof _default> & unknown`)。本地对 SFC 取实例类型,
7
+ * 与 `src/components/input/instance.ts` 的 `InputInstance` 同款写法:`X & unknown`
8
+ * 与 `X` 类型等价,故省略该恒等交集。
9
+ */
10
+ export type BacktopInstance = InstanceType<typeof _EpBacktop>;
@@ -0,0 +1,13 @@
1
+ import type { Ref } from 'vue';
2
+ import type { BacktopProps } from './backtop';
3
+ /**
4
+ * 管理回到顶部按钮的滚动显隐与点击回顶行为。
5
+ *
6
+ * @param props 组件 props(本地 `BacktopProps` 为全必填,等价于上游 `Required<BacktopProps>`)
7
+ * @param emit 组件的 `emit`,`click` 事件的载荷为原始 `MouseEvent`
8
+ * @param componentName 仅用于 `throwError` 的错误 scope
9
+ */
10
+ export declare const useBackTop: (props: BacktopProps, emit: (e: "click", evt: MouseEvent) => void, componentName: string) => {
11
+ visible: Ref<boolean>;
12
+ handleClick: (event: MouseEvent) => void;
13
+ };
@@ -0,0 +1,23 @@
1
+ import { useEventListener as m, useThrottleFn as v } from "@vueuse/core";
2
+ import { shallowRef as n, ref as d, onMounted as f } from "vue";
3
+ import "@vue/shared";
4
+ import "lodash-unified";
5
+ import { throwError as h } from "../../utils/error.js";
6
+ import "@element-plus/icons-vue";
7
+ const w = (t, a, u) => {
8
+ const e = n(), o = n(), l = d(!1), r = () => {
9
+ e.value && (l.value = e.value.scrollTop >= t.visibilityHeight);
10
+ }, c = (s) => {
11
+ var i;
12
+ (i = e.value) == null || i.scrollTo({ top: 0, behavior: "smooth" }), a("click", s);
13
+ };
14
+ return m(o, "scroll", v(r, 300, !0)), f(() => {
15
+ o.value = document, e.value = document.documentElement, t.target && (e.value = document.querySelector(t.target) ?? void 0, e.value || h(u, `target does not exist: ${t.target}`), o.value = e.value), r();
16
+ }), {
17
+ visible: l,
18
+ handleClick: c
19
+ };
20
+ };
21
+ export {
22
+ w as useBackTop
23
+ };
@@ -0,0 +1,147 @@
1
+ declare var __VLS_10: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_10) => any;
4
+ };
5
+ declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
+ ariaControls: StringConstructor;
7
+ modelValue: {
8
+ type: (BooleanConstructor | NumberConstructor | StringConstructor)[];
9
+ default: undefined;
10
+ };
11
+ label: {
12
+ type: (BooleanConstructor | ObjectConstructor | NumberConstructor | StringConstructor)[];
13
+ default: undefined;
14
+ };
15
+ value: {
16
+ type: (BooleanConstructor | ObjectConstructor | NumberConstructor | StringConstructor)[];
17
+ default: undefined;
18
+ };
19
+ indeterminate: BooleanConstructor;
20
+ disabled: {
21
+ type: BooleanConstructor;
22
+ default: undefined;
23
+ };
24
+ checked: BooleanConstructor;
25
+ name: {
26
+ type: StringConstructor;
27
+ default: undefined;
28
+ };
29
+ trueValue: {
30
+ type: (NumberConstructor | StringConstructor)[];
31
+ default: undefined;
32
+ };
33
+ falseValue: {
34
+ type: (NumberConstructor | StringConstructor)[];
35
+ default: undefined;
36
+ };
37
+ trueLabel: {
38
+ type: (NumberConstructor | StringConstructor)[];
39
+ default: undefined;
40
+ };
41
+ falseLabel: {
42
+ type: (NumberConstructor | StringConstructor)[];
43
+ default: undefined;
44
+ };
45
+ id: {
46
+ type: StringConstructor;
47
+ default: undefined;
48
+ };
49
+ border: BooleanConstructor;
50
+ size: {
51
+ readonly type: import("vue").PropType<import("../../utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
52
+ readonly required: false;
53
+ readonly validator: ((val: unknown) => boolean) | undefined;
54
+ __epPropKey: true;
55
+ };
56
+ tabindex: (NumberConstructor | StringConstructor)[];
57
+ validateEvent: {
58
+ type: BooleanConstructor;
59
+ default: boolean;
60
+ };
61
+ ariaLabel: StringConstructor;
62
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
63
+ "update:modelValue": (val: import(".").CheckboxValueType) => void;
64
+ change: (val: import(".").CheckboxValueType) => void;
65
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
66
+ ariaControls: StringConstructor;
67
+ modelValue: {
68
+ type: (BooleanConstructor | NumberConstructor | StringConstructor)[];
69
+ default: undefined;
70
+ };
71
+ label: {
72
+ type: (BooleanConstructor | ObjectConstructor | NumberConstructor | StringConstructor)[];
73
+ default: undefined;
74
+ };
75
+ value: {
76
+ type: (BooleanConstructor | ObjectConstructor | NumberConstructor | StringConstructor)[];
77
+ default: undefined;
78
+ };
79
+ indeterminate: BooleanConstructor;
80
+ disabled: {
81
+ type: BooleanConstructor;
82
+ default: undefined;
83
+ };
84
+ checked: BooleanConstructor;
85
+ name: {
86
+ type: StringConstructor;
87
+ default: undefined;
88
+ };
89
+ trueValue: {
90
+ type: (NumberConstructor | StringConstructor)[];
91
+ default: undefined;
92
+ };
93
+ falseValue: {
94
+ type: (NumberConstructor | StringConstructor)[];
95
+ default: undefined;
96
+ };
97
+ trueLabel: {
98
+ type: (NumberConstructor | StringConstructor)[];
99
+ default: undefined;
100
+ };
101
+ falseLabel: {
102
+ type: (NumberConstructor | StringConstructor)[];
103
+ default: undefined;
104
+ };
105
+ id: {
106
+ type: StringConstructor;
107
+ default: undefined;
108
+ };
109
+ border: BooleanConstructor;
110
+ size: {
111
+ readonly type: import("vue").PropType<import("../../utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
112
+ readonly required: false;
113
+ readonly validator: ((val: unknown) => boolean) | undefined;
114
+ __epPropKey: true;
115
+ };
116
+ tabindex: (NumberConstructor | StringConstructor)[];
117
+ validateEvent: {
118
+ type: BooleanConstructor;
119
+ default: boolean;
120
+ };
121
+ ariaLabel: StringConstructor;
122
+ }>> & Readonly<{
123
+ "onUpdate:modelValue"?: ((val: import(".").CheckboxValueType) => any) | undefined;
124
+ onChange?: ((val: import(".").CheckboxValueType) => any) | undefined;
125
+ }>, {
126
+ name: string;
127
+ border: boolean;
128
+ disabled: boolean;
129
+ label: string | number | boolean | Record<string, any>;
130
+ value: string | number | boolean | Record<string, any>;
131
+ id: string;
132
+ modelValue: string | number | boolean;
133
+ validateEvent: boolean;
134
+ checked: boolean;
135
+ indeterminate: boolean;
136
+ trueValue: string | number;
137
+ falseValue: string | number;
138
+ trueLabel: string | number;
139
+ falseLabel: string | number;
140
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
141
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
142
+ export default _default;
143
+ type __VLS_WithSlots<T, S> = T & {
144
+ new (): {
145
+ $slots: S;
146
+ };
147
+ };
@@ -0,0 +1,101 @@
1
+ import { defineComponent as B, useSlots as w, computed as d, openBlock as p, createBlock as D, resolveDynamicComponent as F, unref as e, normalizeClass as n, withCtx as M, createElementVNode as c, withDirectives as S, mergeProps as $, isRef as O, withModifiers as P, vModelCheckbox as z, createElementBlock as C, renderSlot as I, Fragment as K, createTextVNode as R, toDisplayString as T, createCommentVNode as h } from "vue";
2
+ import { useNamespace as A } from "../../hooks/use-namespace/index.js";
3
+ import "@vue/shared";
4
+ import "lodash-unified";
5
+ import "@vueuse/core";
6
+ import "@element-plus/icons-vue";
7
+ import "../../hooks/use-size/index.js";
8
+ import "@popperjs/core";
9
+ import "../../hooks/use-z-index/index.js";
10
+ import "../../hooks/use-delayed-toggle/index.js";
11
+ import "../../hooks/use-aria/index.js";
12
+ import "../../hooks/use-model-toggle/index.js";
13
+ import "../../hooks/use-empty-values/index.js";
14
+ import { checkboxEmits as U, checkboxProps as j } from "./src/checkbox.js";
15
+ import { useCheckbox as q } from "./src/composables/use-checkbox.js";
16
+ const G = ["id", "indeterminate", "name", "tabindex", "disabled"], H = "EpCheckbox", se = /* @__PURE__ */ B({
17
+ name: H,
18
+ __name: "EpCheckbox",
19
+ props: j,
20
+ emits: U,
21
+ setup(V) {
22
+ const l = V, {
23
+ inputId: b,
24
+ isLabeledByFormItem: f,
25
+ isChecked: k,
26
+ isDisabled: r,
27
+ isFocused: s,
28
+ checkboxSize: g,
29
+ hasOwnLabel: u,
30
+ model: m,
31
+ actualValue: x,
32
+ handleChange: v,
33
+ onClickRoot: E
34
+ } = q(l, w()), L = d(() => l.trueValue || l.falseValue || l.trueLabel || l.falseLabel ? {
35
+ "true-value": l.trueValue ?? l.trueLabel ?? !0,
36
+ "false-value": l.falseValue ?? l.falseLabel ?? !1
37
+ } : { value: x.value }), a = A("checkbox"), N = d(() => [
38
+ a.b(),
39
+ a.m(g.value),
40
+ a.is("disabled", r.value),
41
+ a.is("bordered", l.border),
42
+ a.is("checked", k.value)
43
+ ]), y = d(() => [
44
+ a.e("input"),
45
+ a.is("disabled", r.value),
46
+ a.is("checked", k.value),
47
+ a.is("indeterminate", l.indeterminate),
48
+ a.is("focus", s.value)
49
+ ]);
50
+ return (o, t) => (p(), D(F(!e(u) && e(f) ? "span" : "label"), {
51
+ for: !e(u) && e(f) ? null : e(b),
52
+ class: n(N.value),
53
+ "aria-controls": o.indeterminate ? o.ariaControls : null,
54
+ "aria-checked": o.indeterminate ? "mixed" : void 0,
55
+ "aria-label": o.ariaLabel,
56
+ onClick: e(E)
57
+ }, {
58
+ default: M(() => [
59
+ c("span", {
60
+ class: n(y.value)
61
+ }, [
62
+ S(c("input", $({
63
+ id: e(b),
64
+ "onUpdate:modelValue": t[0] || (t[0] = (i) => O(m) ? m.value = i : null),
65
+ class: e(a).e("original"),
66
+ type: "checkbox",
67
+ indeterminate: o.indeterminate,
68
+ name: o.name,
69
+ tabindex: o.tabindex,
70
+ disabled: e(r)
71
+ }, L.value, {
72
+ onChange: t[1] || (t[1] = //@ts-ignore
73
+ (...i) => e(v) && e(v)(...i)),
74
+ onFocus: t[2] || (t[2] = (i) => s.value = !0),
75
+ onBlur: t[3] || (t[3] = (i) => s.value = !1),
76
+ onClick: t[4] || (t[4] = P(() => {
77
+ }, ["stop"]))
78
+ }), null, 16, G), [
79
+ [z, e(m)]
80
+ ]),
81
+ c("span", {
82
+ class: n(e(a).e("inner"))
83
+ }, null, 2)
84
+ ], 2),
85
+ e(u) ? (p(), C("span", {
86
+ key: 0,
87
+ class: n(e(a).e("label"))
88
+ }, [
89
+ I(o.$slots, "default"),
90
+ o.$slots.default ? h("", !0) : (p(), C(K, { key: 0 }, [
91
+ R(T(o.label), 1)
92
+ ], 64))
93
+ ], 2)) : h("", !0)
94
+ ]),
95
+ _: 3
96
+ }, 8, ["for", "class", "aria-controls", "aria-checked", "aria-label", "onClick"]));
97
+ }
98
+ });
99
+ export {
100
+ se as default
101
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./EpCheckbox.vue.js";
2
+ export {
3
+ f as default
4
+ };