@aplus-frontend/ui 0.4.23 → 0.4.25

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 (59) hide show
  1. package/es/src/ap-form/ap-form.vue.d.ts +1 -2
  2. package/es/src/ap-form/drawer-form/index.vue.d.ts +3 -4
  3. package/es/src/ap-form/modal-form/index.vue.d.ts +3 -4
  4. package/es/src/ap-form/search-form/index.vue.d.ts +3 -4
  5. package/es/src/ap-list/index.vue.d.ts +2 -4
  6. package/es/src/ap-table/ap-table.vue.d.ts +2 -4
  7. package/es/src/ap-table/ap-table.vue2.mjs +67 -64
  8. package/es/src/ap-table/hooks/use-table-column-state.d.ts +4 -4
  9. package/es/src/ap-upload/components/MultipleFile.vue.d.ts +1 -1
  10. package/es/src/ap-upload/components/Picture.vue.d.ts +2 -7
  11. package/es/src/business/ap-attachment/ApAttachment.mjs +31 -31
  12. package/es/src/business/ap-attachment/interface.d.ts +2 -2
  13. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +6 -2
  14. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +36 -32
  15. package/es/src/business/ap-batch-action-group/index.d.ts +16 -7
  16. package/es/src/business/ap-batch-action-group/interface.d.ts +5 -0
  17. package/es/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +2 -4
  18. package/es/src/business/ap-expand-alert/index.d.ts +4 -6
  19. package/es/src/business/ap-select-layout/index.d.ts +2 -4
  20. package/es/src/business/ap-select-layout/select-layout.vue.d.ts +2 -4
  21. package/es/src/editable-table/form-item.vue.d.ts +2 -4
  22. package/es/src/editable-table/index.vue.d.ts +2 -4
  23. package/es/src/scroll-bar/index.vue.d.ts +2 -1
  24. package/es/src/scroll-bar/index.vue.mjs +38 -41
  25. package/es/src/scroll-bar/internal.vue.mjs +10 -11
  26. package/es/src/scroll-view/index.vue.d.ts +5 -5
  27. package/es/src/tests/wrapper.d.ts +4 -4
  28. package/es/src/work-order-modal/work-order-modal.vue.d.ts +2 -3
  29. package/lib/src/ap-form/ap-form.vue.d.ts +1 -2
  30. package/lib/src/ap-form/drawer-form/index.vue.d.ts +3 -4
  31. package/lib/src/ap-form/modal-form/index.vue.d.ts +3 -4
  32. package/lib/src/ap-form/search-form/index.vue.d.ts +3 -4
  33. package/lib/src/ap-list/index.vue.d.ts +2 -4
  34. package/lib/src/ap-table/ap-table.vue.d.ts +2 -4
  35. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  36. package/lib/src/ap-table/hooks/use-table-column-state.d.ts +4 -4
  37. package/lib/src/ap-upload/components/MultipleFile.vue.d.ts +1 -1
  38. package/lib/src/ap-upload/components/Picture.vue.d.ts +2 -7
  39. package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
  40. package/lib/src/business/ap-attachment/interface.d.ts +2 -2
  41. package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +6 -2
  42. package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.js +1 -1
  43. package/lib/src/business/ap-batch-action-group/index.d.ts +16 -7
  44. package/lib/src/business/ap-batch-action-group/interface.d.ts +5 -0
  45. package/lib/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +2 -4
  46. package/lib/src/business/ap-expand-alert/index.d.ts +4 -6
  47. package/lib/src/business/ap-select-layout/index.d.ts +2 -4
  48. package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +2 -4
  49. package/lib/src/editable-table/form-item.vue.d.ts +2 -4
  50. package/lib/src/editable-table/index.vue.d.ts +2 -4
  51. package/lib/src/scroll-bar/index.vue.d.ts +2 -1
  52. package/lib/src/scroll-bar/index.vue.js +1 -1
  53. package/lib/src/scroll-bar/internal.vue.js +1 -1
  54. package/lib/src/scroll-view/index.vue.d.ts +5 -5
  55. package/lib/src/tests/wrapper.d.ts +4 -4
  56. package/lib/src/work-order-modal/work-order-modal.vue.d.ts +2 -3
  57. package/package.json +1 -1
  58. package/theme/ap-scroll-bar/index.css +31 -0
  59. package/theme/ap-scroll-bar/index.less +39 -0
@@ -1,4 +1,4 @@
1
- import { Component, VNode, CSSProperties, PublicProps, ShallowUnwrapRef, RendererNode, RendererElement, Plugin } from 'vue';
1
+ import { Component, VNode, CSSProperties, PublicProps, ShallowUnwrapRef, Plugin } from 'vue';
2
2
  export * from './interface';
3
3
  declare const ApExpandAlert: (<T extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
4
4
  attrs: any;
@@ -20,7 +20,7 @@ declare const ApExpandAlert: (<T extends Record<string, any>>(__VLS_props: NonNu
20
20
  props: {
21
21
  readonly onExpand?: ((...args: any[]) => any) | undefined;
22
22
  readonly onChoose?: ((...args: any[]) => any) | undefined;
23
- type?: "warning" | "error" | "success" | "info" | "card" | undefined;
23
+ type?: "warning" | "error" | "success" | "info" | "card" | undefined | undefined;
24
24
  data?: string | T[] | undefined;
25
25
  prefix?: string | undefined;
26
26
  tipTitle?: string | undefined;
@@ -29,7 +29,7 @@ declare const ApExpandAlert: (<T extends Record<string, any>>(__VLS_props: NonNu
29
29
  separatorStyle?: CSSProperties | undefined;
30
30
  contentStyle?: Omit< CSSProperties, "wordBreak" | "overflow" | "display" | "webkitLineClamp" | "webkitBoxOrient"> | undefined;
31
31
  prefixStyle?: CSSProperties | undefined;
32
- rows?: (string | number) | undefined;
32
+ rows?: string | number | undefined;
33
33
  defaultExpand?: boolean | undefined;
34
34
  showIcon?: boolean | undefined;
35
35
  } & PublicProps;
@@ -51,9 +51,7 @@ declare const ApExpandAlert: (<T extends Record<string, any>>(__VLS_props: NonNu
51
51
  }): any;
52
52
  };
53
53
  emit: (event: "expand" | "choose", ...args: any[]) => void;
54
- }>) => VNode<RendererNode, RendererElement, {
55
- [key: string]: any;
56
- }> & {
54
+ }>) => VNode & {
57
55
  __ctx?: Awaited<typeof __VLS_setup>;
58
56
  }) & ( Plugin & (new (...args: any[]) => {
59
57
  $props: {
@@ -1,5 +1,5 @@
1
1
  import { ApSelectItem } from './interface';
2
- import { PublicProps, ShallowUnwrapRef, VNode, RendererNode, RendererElement, Plugin } from 'vue';
2
+ import { PublicProps, ShallowUnwrapRef, VNode, Plugin } from 'vue';
3
3
  export * from './interface';
4
4
  declare const ApSelectLayout: (<T extends ApSelectItem>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
5
5
  attrs: any;
@@ -38,9 +38,7 @@ declare const ApSelectLayout: (<T extends ApSelectItem>(__VLS_props: NonNullable
38
38
  (event: "afterEnter", el: Element): void;
39
39
  (event: "afterLeave", el: Element): void;
40
40
  };
41
- }>) => VNode<RendererNode, RendererElement, {
42
- [key: string]: any;
43
- }> & {
41
+ }>) => VNode & {
44
42
  __ctx?: Awaited<typeof __VLS_setup>;
45
43
  }) & ( Plugin & (new (...args: any[]) => {
46
44
  $props: {
@@ -1,5 +1,5 @@
1
1
  import { ApSelectItem, ApSelectLayoutProps } from './interface';
2
- import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode, RendererNode, RendererElement } from 'vue';
2
+ import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
3
3
  declare const _default: <T extends ApSelectItem>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
4
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
5
5
  readonly onOnSelect?: ((value: T) => any) | undefined;
@@ -19,9 +19,7 @@ declare const _default: <T extends ApSelectItem>(__VLS_props: NonNullable<Awaite
19
19
  (event: "afterEnter", el: Element): void;
20
20
  (event: "afterLeave", el: Element): void;
21
21
  };
22
- }>) => VNode<RendererNode, RendererElement, {
23
- [key: string]: any;
24
- }> & {
22
+ }>) => VNode & {
25
23
  __ctx?: Awaited<typeof __VLS_setup>;
26
24
  };
27
25
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import { EditableColumnType, EditableTableFormItemProps } from './interface';
2
2
  import { StandardBehaviorOptions } from '../../node_modules/scroll-into-view-if-needed';
3
- import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode, RendererNode, RendererElement } from 'vue';
3
+ import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
4
4
  import { UnwrapRefSimple } from '@vue/reactivity';
5
5
  declare const _default: <RecordType = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
6
6
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & EditableTableFormItemProps<RecordType> & Partial<{}>> & PublicProps;
@@ -48,9 +48,7 @@ declare const _default: <RecordType = any>(__VLS_props: NonNullable<Awaited<type
48
48
  }) => void;
49
49
  };
50
50
  emit: {};
51
- }>) => VNode<RendererNode, RendererElement, {
52
- [key: string]: any;
53
- }> & {
51
+ }>) => VNode & {
54
52
  __ctx?: Awaited<typeof __VLS_setup>;
55
53
  };
56
54
  export default _default;
@@ -2,7 +2,7 @@ import { EditableTableProps, EditableColumnType } from './interface';
2
2
  import { NamePath, ValidateOptions } from '@aplus-frontend/antdv/es/form/interface';
3
3
  import { Recordable } from '../type';
4
4
  import { StandardBehaviorOptions } from '../../node_modules/scroll-into-view-if-needed';
5
- import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode, RendererNode, RendererElement } from 'vue';
5
+ import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
6
6
  declare const _default: <RecordType extends Recordable = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
7
7
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
8
8
  readonly "onUpdate:value"?: ((...args: any[]) => any) | undefined;
@@ -53,9 +53,7 @@ declare const _default: <RecordType extends Recordable = any>(__VLS_props: NonNu
53
53
  }) => void;
54
54
  };
55
55
  emit: (event: "update:value", ...args: any[]) => void;
56
- }>) => VNode<RendererNode, RendererElement, {
57
- [key: string]: any;
58
- }> & {
56
+ }>) => VNode & {
59
57
  __ctx?: Awaited<typeof __VLS_setup>;
60
58
  };
61
59
  export default _default;
@@ -1,8 +1,9 @@
1
1
  import { ScrollBarProps, ScrollBarDirection, InternalScrollBarProps } from './interface';
2
2
  import { DefineComponent, ComputedRef, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, CreateComponentPublicInstanceWithMixins, Ref, GlobalComponents, GlobalDirectives } from 'vue';
3
+ declare function handleBarScroll(percent: number): void;
3
4
  declare const _default: DefineComponent<ScrollBarProps, {
4
5
  currentScroll: ComputedRef<number | undefined>;
5
- scroll: (percent: number) => void | undefined;
6
+ scroll: typeof handleBarScroll;
6
7
  visible: ComputedRef<boolean>;
7
8
  rootElement: ComputedRef<HTMLElement | undefined>;
8
9
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ScrollBarProps> & Readonly<{}>, {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue");require("./internal.vue2.js");const h=require("lodash-unified"),u=require("./utils/index.js"),_=require("@vueuse/core"),g=require("./internal.vue.js"),m=r.defineComponent({name:"ScrollBar",__name:"index",props:{scrollContainer:{},extraSize:{default:0},direction:{default:"vertical"},scroll:{},barLength:{default:30},width:{},barColor:{},trackColor:{},trackWidth:{},disabled:{type:Boolean,default:!1},showTrack:{type:Boolean,default:!0},trackSpeed:{default:2},onScrollStart:{},onScroll:{},onScrollEnd:{}},setup(f,{expose:d}){const l=f,n=r.toRef(l,"scrollContainer"),a=r.ref(),c=r.ref(l.barLength);function S(){if(!n.value||!a.value)return;const{totalSize:e,visibleSize:t,distance:o}=u.getScrollable(n.value,l.direction),i=o/(e+l.extraSize-t||1)*100;a.value.scroll(i)}function s(){const{visibleSize:e,totalSize:t}=u.getScrollable(n.value,l.direction);c.value=u.ensureRangeValue(e/(t+l.extraSize||1)*100)}_.useResizeObserver(n,()=>{s()}),r.watchEffect(()=>{const e=r.unref(n.value);e&&(s(),e.addEventListener("scroll",S))},{flush:"post"}),r.watch(()=>l.barLength,e=>{c.value=e});function v(e){const t=r.unref(n);if(!t)return;const{totalSize:o,visibleSize:i,topOrLeft:p}=u.getScrollable(t,l.direction);if(o<=i)return;const b=`scroll${p}`;t[b]=e*(o+l.extraSize-i)/100}return d({currentScroll:r.computed(()=>{var e;return r.unref((e=a.value)==null?void 0:e.currentScroll)}),scroll:e=>{var t,o;return(o=(t=a.value)==null?void 0:t.scroll)==null?void 0:o.call(t,e)},visible:r.computed(()=>c.value<100),rootElement:r.computed(()=>{var e;return r.unref((e=a.value)==null?void 0:e.container)})}),(e,t)=>c.value!==100?(r.openBlock(),r.createBlock(g.default,r.mergeProps({key:0,ref_key:"barRef",ref:a},r.unref(h.omit)(l,["onScroll","extraSize","scrollContainer"]),{"bar-length":c.value,onScroll:v}),null,16,["bar-length"])):r.createCommentVNode("",!0)}});exports.default=m;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./internal.vue2.js");const h=require("lodash-unified"),u=require("./utils/index.js"),_=require("@vueuse/core"),g=require("./internal.vue.js"),m=e.defineComponent({name:"ScrollBar",__name:"index",props:{scrollContainer:{},extraSize:{default:0},direction:{default:"vertical"},scroll:{},barLength:{default:30},width:{},barColor:{},trackColor:{},trackWidth:{},disabled:{type:Boolean,default:!1},showTrack:{type:Boolean,default:!0},trackSpeed:{default:2},onScrollStart:{},onScroll:{},onScrollEnd:{}},setup(d,{expose:S}){const t=d,o=e.toRef(t,"scrollContainer"),n=e.ref(),a=e.ref(t.barLength);function p(){if(!o.value||!n.value)return;const{totalSize:r,visibleSize:l,distance:c}=u.getScrollable(o.value,t.direction),i=c/(r+t.extraSize-l||1)*100;n.value.scroll(i)}function s(){const{visibleSize:r,totalSize:l}=u.getScrollable(o.value,t.direction);a.value=u.ensureRangeValue(r/(l+t.extraSize||1)*100)}_.useResizeObserver(o,()=>{s()}),e.watchEffect(()=>{const r=e.unref(o.value);r&&(s(),r.addEventListener("scroll",p))},{flush:"post"}),e.watch(()=>t.barLength,r=>{a.value=r});function f(r){const l=e.unref(o);if(!l)return;const{totalSize:c,visibleSize:i,topOrLeft:v}=u.getScrollable(l,t.direction);if(c<=i)return;const b=`scroll${v}`;l[b]=r*(c+t.extraSize-i)/100}return S({currentScroll:e.computed(()=>{var r;return e.unref((r=n.value)==null?void 0:r.currentScroll)}),scroll:f,visible:e.computed(()=>a.value<100),rootElement:e.computed(()=>{var r;return e.unref((r=n.value)==null?void 0:r.container)})}),(r,l)=>a.value!==100?(e.openBlock(),e.createBlock(g.default,e.mergeProps({key:0,ref_key:"barRef",ref:n},e.unref(h.omit)(t,["onScroll","extraSize","scrollContainer"]),{"bar-length":a.value,onScroll:f}),null,16,["bar-length"])):e.createCommentVNode("",!0)}});exports.default=m;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue");require("../config-provider/index.js");const T=require("./hooks/use-track.js"),y=require("./utils/index.js"),P=require("../config-provider/hooks/use-namespace.js"),B=t.defineComponent({__name:"internal",props:{direction:{default:"vertical"},scroll:{default:0},barLength:{default:35},width:{},barColor:{},trackColor:{},trackWidth:{},disabled:{type:Boolean,default:!1},showTrack:{type:Boolean,default:!0},trackSpeed:{default:2},onScrollStart:{},onScroll:{},onScrollEnd:{}},setup(E,{expose:p}){const n=E,h=t.ref(),c=t.ref(),l=t.ref(),{b:L,e:b,m:C,em:u,cssVar:R}=P.useNamespace("scroll-bar"),o=t.ref(n.scroll),{handleMouseDown:k}=T.useTrack({currentScroll:o,track:c,bar:l,type:t.toRef(n,"direction"),trackSpeed:t.toRef(n,"trackSpeed"),barLength:t.toRef(n,"barLength"),disabled:t.toRef(n,"disabled"),onDown:e=>{var r;(r=n.onScrollStart)==null||r.call(n,e)},onUp:e=>{var r;(r=n.onScrollEnd)==null||r.call(n,e)},onScroll:e=>{var r;(r=n.onScroll)==null||r.call(n,e)}});t.watch(()=>n.scroll,e=>{o.value=e}),t.watchEffect(()=>{if(!t.unref(l))return;const e=`${(100-n.barLength)*o.value/n.barLength}%`,r=`${n.barLength}%`;n.direction==="vertical"?(l.value.style.height=r,l.value.style.transform=`translate3d(0, ${e}, 0)`):(l.value.style.width=r,l.value.style.transform=`translate3d(${e}, 0, 0)`)});let f,s,d;function M(e){var w;if(n.disabled||e.button!==0)return;e.preventDefault(),e.stopPropagation();const r=t.unref(c),i=t.unref(l);if(!r||!i)return;document.addEventListener("pointermove",v),document.addEventListener("pointerup",m);const a=r.getBoundingClientRect(),S=i.getBoundingClientRect();n.direction==="vertical"?(f=a.height,s=S.top-a.top,d=e.clientY):(f=a.width,s=S.left-a.left,d=e.clientX),(w=n.onScrollStart)==null||w.call(n,t.unref(o))}function v(e){var a;e.stopPropagation(),e.preventDefault();let r;n.direction==="vertical"?r=s+e.clientY-d:r=s+e.clientX-d;const i=r/f/(100-n.barLength)*1e4;o.value=y.ensureRangeValue(i),(a=n.onScroll)==null||a.call(n,t.unref(o))}function m(e){var r;e.preventDefault(),document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",m),(r=n.onScrollEnd)==null||r.call(n,t.unref(o))}function g(e){e.cancelable&&(e.stopPropagation(),e.preventDefault())}function D(e){var r;Math.abs(t.unref(o)-e)<=.001||(o.value=y.ensureRangeValue(e),(r=n.onScroll)==null||r.call(n,e))}return p({currentScroll:o,container:h,bar:l,track:c,scroll:D}),(e,r)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"container",ref:h,class:t.normalizeClass([t.unref(L)(),t.unref(C)(e.direction)]),style:t.normalizeStyle(t.unref(R)({"bar-color":e.barColor,"track-color":e.trackColor,"bar-width":e.width?`${e.width}px`:void 0,"track-width":e.trackWidth?`${e.trackWidth}px`:void 0}))},[t.createElementVNode("div",{ref_key:"track",ref:c,class:t.normalizeClass([t.unref(b)("track"),e.disabled?t.unref(u)("track","disabled"):null,e.showTrack?null:t.unref(u)("track","hidden")]),onPointerdown:r[0]||(r[0]=(...i)=>t.unref(k)&&t.unref(k)(...i)),onTouchstart:g},null,34),t.createElementVNode("div",{ref_key:"bar",ref:l,class:t.normalizeClass([t.unref(b)("bar"),t.unref(u)("bar",e.direction),e.disabled?t.unref(u)("bar","disabled"):null]),onPointerdown:M,onTouchstart:g},null,34)],6))}});exports.default=B;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue");require("../config-provider/index.js");const T=require("./hooks/use-track.js"),p=require("./utils/index.js"),P=require("../config-provider/hooks/use-namespace.js"),B=t.defineComponent({__name:"internal",props:{direction:{default:"vertical"},scroll:{default:0},barLength:{default:35},width:{},barColor:{},trackColor:{},trackWidth:{},disabled:{type:Boolean,default:!1},showTrack:{type:Boolean,default:!0},trackSpeed:{default:2},onScrollStart:{},onScroll:{},onScrollEnd:{}},setup(y,{expose:E}){const n=y,h=t.ref(),c=t.ref(),l=t.ref(),{b:L,e:b,m:C,em:u,cssVar:R}=P.useNamespace("scroll-bar"),o=t.ref(n.scroll),{handleMouseDown:k}=T.useTrack({currentScroll:o,track:c,bar:l,type:t.toRef(n,"direction"),trackSpeed:t.toRef(n,"trackSpeed"),barLength:t.toRef(n,"barLength"),disabled:t.toRef(n,"disabled"),onDown:e=>{var r;(r=n.onScrollStart)==null||r.call(n,e)},onUp:e=>{var r;(r=n.onScrollEnd)==null||r.call(n,e)},onScroll:e=>{var r;(r=n.onScroll)==null||r.call(n,e)}});t.watch(()=>n.scroll,e=>{o.value=e}),t.watchEffect(()=>{if(!t.unref(l))return;const e=`${(100-n.barLength)*o.value/n.barLength}%`,r=`${n.barLength}%`;n.direction==="vertical"?(l.value.style.height=r,l.value.style.transform=`translate3d(0, ${e}, 0)`):(l.value.style.width=r,l.value.style.transform=`translate3d(${e}, 0, 0)`)});let f,s,d;function M(e){var w;if(n.disabled||e.button!==0)return;e.preventDefault(),e.stopPropagation();const r=t.unref(c),i=t.unref(l);if(!r||!i)return;document.addEventListener("pointermove",v),document.addEventListener("pointerup",m);const a=r.getBoundingClientRect(),S=i.getBoundingClientRect();n.direction==="vertical"?(f=a.height,s=S.top-a.top,d=e.clientY):(f=a.width,s=S.left-a.left,d=e.clientX),(w=n.onScrollStart)==null||w.call(n,t.unref(o))}function v(e){var a;e.stopPropagation(),e.preventDefault();let r;n.direction==="vertical"?r=s+e.clientY-d:r=s+e.clientX-d;const i=r/f/(100-n.barLength)*1e4;o.value=p.ensureRangeValue(i),(a=n.onScroll)==null||a.call(n,t.unref(o))}function m(e){var r;e.preventDefault(),document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",m),(r=n.onScrollEnd)==null||r.call(n,t.unref(o))}function g(e){e.cancelable&&(e.stopPropagation(),e.preventDefault())}function D(e){Math.abs(t.unref(o)-e)<=.001||(o.value=p.ensureRangeValue(e))}return E({currentScroll:o,container:h,bar:l,track:c,scroll:D}),(e,r)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"container",ref:h,class:t.normalizeClass([t.unref(L)(),t.unref(C)(e.direction)]),style:t.normalizeStyle(t.unref(R)({"bar-color":e.barColor,"track-color":e.trackColor,"bar-width":e.width?`${e.width}px`:void 0,"track-width":e.trackWidth?`${e.trackWidth}px`:void 0}))},[t.createElementVNode("div",{ref_key:"track",ref:c,class:t.normalizeClass([t.unref(b)("track"),e.disabled?t.unref(u)("track","disabled"):null,e.showTrack?null:t.unref(u)("track","hidden")]),onPointerdown:r[0]||(r[0]=(...i)=>t.unref(k)&&t.unref(k)(...i)),onTouchstart:g},null,34),t.createElementVNode("div",{ref_key:"bar",ref:l,class:t.normalizeClass([t.unref(b)("bar"),t.unref(u)("bar",e.direction),e.disabled?t.unref(u)("bar","disabled"):null]),onPointerdown:M,onTouchstart:g},null,34)],6))}});exports.default=B;
@@ -1,5 +1,5 @@
1
1
  import { ScrollOptions, ScrollViewProps } from './interface';
2
- import { ScrollBarDirection, InternalScrollBarProps, ColorType } from '../scroll-bar';
2
+ import { ScrollBarDirection, InternalScrollBarProps } from '../scroll-bar';
3
3
  import { CreateComponentPublicInstanceWithMixins, Ref, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, DefineComponent, ComputedRef } from 'vue';
4
4
  declare function scroll(x?: number, y?: number): void;
5
5
  declare function scrollTo({ smooth, left, top }: ScrollOptions): void;
@@ -106,8 +106,8 @@ declare const __VLS_component: DefineComponent<ScrollViewProps, {
106
106
  onScroll?: ((percent: number) => void) | undefined;
107
107
  disabled?: boolean | undefined;
108
108
  trackSpeed?: number | undefined;
109
- barColor?: ColorType;
110
- trackColor?: ColorType;
109
+ barColor?: import("csstype").Property.BackgroundColor | undefined;
110
+ trackColor?: import("csstype").Property.BackgroundColor | undefined;
111
111
  trackWidth?: number | undefined;
112
112
  showTrack?: boolean | undefined;
113
113
  onScrollStart?: ((percent: number) => void) | undefined;
@@ -118,8 +118,8 @@ declare const __VLS_component: DefineComponent<ScrollViewProps, {
118
118
  onScroll?: ((percent: number) => void) | undefined;
119
119
  disabled?: boolean | undefined;
120
120
  trackSpeed?: number | undefined;
121
- barColor?: ColorType;
122
- trackColor?: ColorType;
121
+ barColor?: import("csstype").Property.BackgroundColor | undefined;
122
+ trackColor?: import("csstype").Property.BackgroundColor | undefined;
123
123
  trackWidth?: number | undefined;
124
124
  showTrack?: boolean | undefined;
125
125
  onScrollStart?: ((percent: number) => void) | undefined;
@@ -1,8 +1,8 @@
1
1
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
2
  export declare const Wrapper: DefineComponent<{
3
- uiMode?: ("admin" | "aplus") | undefined;
4
- lang?: ("en" | "zh-cn") | undefined;
3
+ uiMode?: "admin" | "aplus" | undefined;
4
+ lang?: "en" | "zh-cn" | undefined;
5
5
  }, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
6
- uiMode?: ("admin" | "aplus") | undefined;
7
- lang?: ("en" | "zh-cn") | undefined;
6
+ uiMode?: "admin" | "aplus" | undefined;
7
+ lang?: "en" | "zh-cn" | undefined;
8
8
  }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
@@ -1,14 +1,13 @@
1
1
  import { WorkOrderModalProps } from './interfaces';
2
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, ComponentInternalInstance, ExtractPropTypes, PropType, HTMLAttributes, VNodeProps, AllowedComponentProps, ComponentCustomProps, CreateComponentPublicInstanceWithMixins, GlobalComponents, GlobalDirectives, Slot, ComponentPublicInstance, ComponentOptionsBase, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties } from 'vue';
3
3
  import { ButtonSize, SizeType } from '@aplus-frontend/antdv/es/button';
4
- import { ValidateMessages, FormLabelAlign, FieldData, ValidateErrorEntity, NamePath, RuleObject, ValidateOptions, InternalNamePath } from '@aplus-frontend/antdv/es/form/interface';
4
+ import { ValidateMessages, FormLabelAlign, FieldData, ValidateErrorEntity, NamePath, ValidateOptions, InternalNamePath } from '@aplus-frontend/antdv/es/form/interface';
5
5
  import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
6
6
  import { ColSize } from '@aplus-frontend/antdv/es/grid';
7
7
  import { RuleObject } from '@aplus-frontend/antdv/es/form';
8
8
  import { Options } from '../../node_modules/scroll-into-view-if-needed';
9
9
  import { Recordable } from '../type';
10
10
  import { VueTypeDef, VueTypeValidableDef } from '../../node_modules/vue-types';
11
- import { SizeType } from '@aplus-frontend/antdv/es/config-provider';
12
11
  import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
13
12
  import { ApFormProps, ApFormInternalInstance, WatchFunc } from '..';
14
13
  import { OnCleanup } from '@vue/reactivity';
@@ -113,7 +112,7 @@ declare const _default: DefineComponent<WorkOrderModalProps, {}, {}, {}, {}, Com
113
112
  readonly onValidate?: ((name: string | number | string[] | number[], status: boolean, errors: string[]) => void) | undefined;
114
113
  readonly initialValues?: Recordable | undefined;
115
114
  readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
116
- readonly syncToUrl?: (boolean | ((values: Recordable, type: "get" | "set") => Recordable)) | undefined;
115
+ readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
117
116
  readonly syncToUrlPriority?: boolean | undefined;
118
117
  } & VNodeProps & AllowedComponentProps & ComponentCustomProps;
119
118
  $attrs: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "0.4.23",
3
+ "version": "0.4.25",
4
4
  "main": "./lib/index.js",
5
5
  "type": "module",
6
6
  "files": [
@@ -0,0 +1,31 @@
1
+ .aplus-ap-scroll-bar {
2
+ position: relative;
3
+ background-color: var(--ap-scroll-bar-background, rgba(0, 0, 0, 0.05));
4
+ }
5
+ .aplus-ap-scroll-bar--horizontal {
6
+ height: 10px;
7
+ }
8
+ .aplus-ap-scroll-bar--vertical {
9
+ width: 10px;
10
+ height: 100%;
11
+ }
12
+ .aplus-ap-scroll-bar__bar {
13
+ position: absolute;
14
+ border-radius: 8px;
15
+ background-color: rgba(144, 147, 153, 0.3);
16
+ background-color: var(--ap-scroll-bar-bar, rgba(144, 147, 153, 0.3));
17
+ box-shadow: var(--ap-scroll-bar-bar-shadow, inset 0 0 6px rgba(0, 0, 0, 0.2));
18
+ }
19
+ .aplus-ap-scroll-bar__bar--horizontal {
20
+ height: 8px;
21
+ top: 1px;
22
+ }
23
+ .aplus-ap-scroll-bar__bar--vertical {
24
+ width: 8px;
25
+ left: 1px;
26
+ }
27
+ .aplus-ap-scroll-bar__bar:hover,
28
+ .aplus-ap-scroll-bar__bar:focus,
29
+ .aplus-ap-scroll-bar__bar:active {
30
+ background-color: var(--ap-scroll-bar-bar-active, rgba(144, 147, 153, 0.5));
31
+ }
@@ -0,0 +1,39 @@
1
+ @import '../mixins/mixins.less';
2
+ @import '../mixins/config.less';
3
+
4
+ .b('ap-scroll-bar', {
5
+ position: relative;
6
+ // z-index: 999;
7
+ background-color: var(--ap-scroll-bar-background, rgb(0 0 0 / 5%));
8
+
9
+ &--horizontal {
10
+ height: 10px;
11
+ }
12
+
13
+ &--vertical {
14
+ width: 10px;
15
+ height: 100%;
16
+ }
17
+
18
+ &__bar {
19
+ position: absolute;
20
+ border-radius: 8px;
21
+ background-color: rgb(144 147 153 / 30%);
22
+ background-color: var(--ap-scroll-bar-bar, rgb(144 147 153 / 30%));
23
+ box-shadow: var(--ap-scroll-bar-bar-shadow, inset 0 0 6px rgb(0 0 0 / 20%)); ;
24
+
25
+ &--horizontal {
26
+ height: 8px;
27
+ top: 1px;
28
+ }
29
+
30
+ &--vertical {
31
+ width: 8px;
32
+ left: 1px;
33
+ }
34
+
35
+ &:hover, &:focus, &:active {
36
+ background-color: var(--ap-scroll-bar-bar-active, rgb(144 147 153 / 50%));
37
+ }
38
+ }
39
+ });