@aplus-frontend/ui 7.7.3 → 7.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/src/ap-field/checkbox/index.vue.mjs +18 -8
- package/es/src/ap-field/number/index.vue.mjs +19 -19
- package/es/src/ap-field/radio/index.vue.mjs +24 -24
- package/es/src/ap-field/rate/index.vue.mjs +10 -10
- package/es/src/ap-field/select/index.vue.mjs +74 -71
- package/es/src/ap-field/slider/index.vue.d.ts +4 -2
- package/es/src/ap-field/slider/index.vue.mjs +12 -12
- package/es/src/ap-field/switch/index.vue.mjs +20 -20
- package/es/src/ap-field/text/index.vue2.mjs +23 -23
- package/es/src/ap-field/text/password.vue.mjs +9 -9
- package/es/src/ap-field/text-area/index.vue.mjs +24 -20
- package/es/src/ap-field/tree-select/index.vue.mjs +17 -17
- package/es/src/ap-form/ap-form.vue2.mjs +64 -64
- package/es/src/ap-form/drawer-form/index.vue.mjs +41 -41
- package/es/src/ap-form/item/index.vue.mjs +64 -64
- package/es/src/ap-form/items/number/index.vue.mjs +10 -10
- package/es/src/ap-form/items/radio/index.vue.mjs +3 -3
- package/es/src/ap-form/items/select/index.vue.mjs +5 -5
- package/es/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/text/index.vue2.mjs +6 -6
- package/es/src/ap-form/items/text/password.vue.mjs +7 -7
- package/es/src/ap-form/items/text-area/index.vue.mjs +5 -5
- package/es/src/ap-form/items/tree-select/index.vue.mjs +7 -7
- package/es/src/ap-form/search-form/index.vue.mjs +63 -63
- package/es/src/ap-form/style/item.mjs +8 -7
- package/es/src/ap-list/index.vue.mjs +6 -6
- package/es/src/ap-table/constants.d.ts +1 -1
- package/es/src/business/batch-input-group/index.vue.d.ts +1 -1
- package/es/src/editable-table/form-item.vue.mjs +64 -64
- package/es/src/editable-table/index.vue.mjs +66 -66
- package/es/src/scroll-bar/index.vue.d.ts +7 -7
- package/es/src/scroll-bar/index.vue.mjs +21 -21
- package/es/src/scroll-bar/internal.vue.d.ts +4 -4
- package/es/src/scroll-bar/internal.vue.mjs +20 -20
- package/es/src/scroll-view/hooks/use-scroll-wrapper.d.ts +4 -4
- package/es/src/scroll-view/hooks/use-scroll-wrapper.mjs +13 -13
- package/es/src/scroll-view/index.vue.d.ts +25 -25
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ap-field/checkbox/index.vue.js +1 -1
- package/lib/src/ap-field/number/index.vue.js +1 -1
- package/lib/src/ap-field/radio/index.vue.js +1 -1
- package/lib/src/ap-field/rate/index.vue.js +1 -1
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-field/slider/index.vue.d.ts +4 -2
- package/lib/src/ap-field/slider/index.vue.js +1 -1
- package/lib/src/ap-field/switch/index.vue.js +1 -1
- package/lib/src/ap-field/text/index.vue2.js +1 -1
- package/lib/src/ap-field/text/password.vue.js +1 -1
- package/lib/src/ap-field/text-area/index.vue.js +1 -1
- package/lib/src/ap-field/tree-select/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
- package/lib/src/ap-form/item/index.vue.js +1 -1
- package/lib/src/ap-form/items/number/index.vue.js +1 -1
- package/lib/src/ap-form/items/radio/index.vue.js +1 -1
- package/lib/src/ap-form/items/select/index.vue.js +1 -1
- package/lib/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/text/index.vue2.js +1 -1
- package/lib/src/ap-form/items/text/password.vue.js +1 -1
- package/lib/src/ap-form/items/text-area/index.vue.js +1 -1
- package/lib/src/ap-form/items/tree-select/index.vue.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-form/style/item.js +1 -1
- package/lib/src/ap-list/index.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +1 -1
- package/lib/src/business/batch-input-group/index.vue.d.ts +1 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/scroll-bar/index.vue.d.ts +7 -7
- package/lib/src/scroll-bar/index.vue.js +1 -1
- package/lib/src/scroll-bar/internal.vue.d.ts +4 -4
- package/lib/src/scroll-bar/internal.vue.js +1 -1
- package/lib/src/scroll-view/hooks/use-scroll-wrapper.d.ts +4 -4
- package/lib/src/scroll-view/hooks/use-scroll-wrapper.js +1 -1
- package/lib/src/scroll-view/index.vue.d.ts +25 -25
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("@aplus-frontend/antdv");require("../ap-form.vue.js");require("../item/index.vue2.js");const W=require("../item-group/helper.js");require("../../config-provider/index.js");const S=require("lodash-unified");require("../../utils/index.js");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("@aplus-frontend/antdv");require("../ap-form.vue.js");require("../item/index.vue2.js");const W=require("../item-group/helper.js");require("../../config-provider/index.js");const S=require("lodash-unified");require("../../utils/index.js");const R=require("./utils.js");require("./components/popover-filter.vue.js");const Y=require("./hooks/use-count-per-row.js");require("./components/popover-sorter/index.vue.js");const Z=require("./hooks/use-sorter.js"),ee=require("./hooks/use-collapse-input-count.js"),te=require("../../utils/warning.js"),oe=require("../style/search-form.js"),D=require("../../utils/format.js"),ne=require("../../config-provider/hooks/use-namespace.js"),ae=require("../../config-provider/hooks/use-locale.js"),O=require("../../utils/is.js"),z=require("../item/index.vue.js"),re=require("./components/popover-filter.vue2.js"),le=require("./components/popover-sorter/index.vue2.js"),se=require("../ap-form.vue2.js");function ue(d){return typeof d=="function"||Object.prototype.toString.call(d)==="[object Object]"&&!e.isVNode(d)}const l=100,ce=e.defineComponent({name:"ApFormSearchForm",__name:"index",props:{layout:{default:"horizontal"},labelCol:{},wrapperCol:{},colon:{type:Boolean,default:!0},labelAlign:{default:"right"},labelWrap:{type:Boolean},prefixCls:{},requiredMark:{},hideRequiredMark:{type:Boolean,default:!1},rules:{},validateMessages:{},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{},onSubmit:{},name:{},validateTrigger:{default:"change"},size:{},disabled:{type:Boolean},onFieldsChange:{},onFinish:{},onFinishFailed:{},onValidate:{},variant:{},initialValues:{},onValuesChange:{},syncToUrl:{type:[Boolean,Function]},syncToUrlPriority:{type:Boolean},collapse:{type:Boolean,default:void 0},defaultCollapse:{type:Boolean,default:!0},"onUpdate:collapse":{},searchText:{},resetText:{},onReset:{},customReset:{type:Boolean,default:!1},extraInAction:{type:Boolean,default:!1},forceExpand:{type:Boolean,default:!1},countPerRow:{default:5},submitLoading:{type:Boolean},maxRows:{default:2},sortable:{type:Boolean,default:!0},resizeTarget:{},resize:{},loadingDelay:{default:300}},setup(d,{expose:L}){const g=e.useSlots(),o=d;te.useDevWarning("SearchForm").deprecated(typeof o.resizeTarget<"u","resizeTarget","resize.target");const j=oe.default("ap-form-search-form"),{b:p}=ne.useNamespace("ap-form-search-form"),{t:F}=ae.useLocale(),x=e.ref(),B=e.shallowRef(),M=Y.useCountPerRow(o,B),b=e.shallowRef();function q(){const t=x.value?.getFieldsValueTransformed(!0);R.execFunc(o.onSubmit,t)}function U(){o.customReset||x.value?.resetFields?.(),R.execFunc(o.onReset)}const $=t=>O.isDef(t)?(S.isArray(t)?t:[t]).join(""):Date.now();let k=[];const f=e.shallowRef(W.genRealChildren(g.default())),c=e.shallowRef(g.extra?.()),V=e.computed(()=>D.floorWith(l/e.unref(M),4)),{items:v,sorted:A,handleClickConfirm:C}=Z.useSorter(f);e.watch(()=>g.default(),t=>{k=f.value,f.value=R.diffFormItem(k,W.genRealChildren(t)),A.value=!1}),e.watch(()=>g.extra?.(),t=>{c.value=t});function H(t){return D.floorWith(t*(l/24),4)}const n=e.computed(()=>{const t=f.value,i=[],a=[],h=[],s=e.unref(V);let y=0,N=0;const K=l*o.maxRows-s*(e.unref(c)&&!o.extraInAction?2:1);t.forEach(w=>{const T=ee.getTargetNode(w);if(!T)return;const u=T.props;if(S.isBoolean(u.hidden)?!!u.hidden:O.isDef(u.hidden))i.push(w);else{let _=u.span?H(u.span):s;const P={node:w,span:_,key:`ApFormSearchFormItem-${$(u.name)}-${u._signal}`},E=l-y%l;E<_&&(_+=E),y+=_,y>K?a.push(P):(N=y,h.push(P))}});const I=l-(N+s)%l,Q=Math.ceil(N)%l<s,X=I<s?l:I;return{hideNode:e.createVNode(e.Fragment,null,[i]),nodes:h,collapseNodes:a,extraSpan:X,lastRowOnlyIncludeActionAndExtra:Q}}),m=t=>`${t}%`,G=e.computed(()=>{let t;const i=n.value.collapseNodes.length||o.sortable&&f.value.length,a=e.createVNode(r.Col,{flex:m(e.unref(V)),key:"actionWrapper"},{default:()=>[e.createVNode(z.default,null,{default:()=>[e.createVNode(r.Flex,{wrap:"wrap",justify:n.value.lastRowOnlyIncludeActionAndExtra&&!(e.unref(c)&&o.extraInAction)?"flex-end":"space-between"},{default:()=>[e.createVNode(r.Flex,{gap:8,wrap:"wrap"},{default:()=>[i?e.createVNode("div",{class:p("column-setting-trigger-wrapper")},[n.value.collapseNodes.length?e.createVNode(re.default,{onSubmit:q,config:n.value.collapseNodes,submitLoading:o.submitLoading},null):null,o.sortable&&v.value.length?e.createVNode(le.default,{ref:b,items:v.value,onClickConfirm:C,sorted:A.value},null):null]):null,e.createVNode(r.Button,{type:"primary",onClick:q,loading:o.submitLoading?{delay:o.loadingDelay}:!1,htmlType:"submit",class:p("action-btn")},{default:()=>[o.searchText||F("ap.apForm.search.search")]}),e.createVNode(r.Button,{onClick:U,type:"text",class:[p("action-btn"),p("action-btn-reset")]},{default:()=>[o.resetText||F("ap.apForm.search.reset")]})]}),o.extraInAction?e.unref(c):null]})]})]}),h=!o.extraInAction&&e.unref(c)?e.createVNode(r.Col,{flex:m(n.value.extraSpan),key:"extraNode"},{default:()=>[e.createVNode(z.default,null,{default:()=>[e.createVNode(r.Flex,{justify:n.value.extraSpan===l||n.value.lastRowOnlyIncludeActionAndExtra?"start":"flex-end"},ue(t=e.unref(c))?t:{default:()=>[t]})]})]}):null,s=e.createVNode(r.Col,{flex:m(n.value.extraSpan)},null);return n.value.lastRowOnlyIncludeActionAndExtra?e.createVNode(e.Fragment,null,[h||s,a]):e.createVNode(e.Fragment,null,[a,h])});function J(){const t=b.value?.getCachedList();C(t)}return L({apForm:e.computed(()=>e.unref(x)),getSorterItems:()=>v.value,setSorterItems:C,resetSorterItems:J}),(t,i)=>(e.openBlock(),e.createBlock(se.default,e.mergeProps({ref_key:"apForm",ref:x,class:[e.unref(p)(),e.unref(j)]},e.unref(S.omit)(o,["collapse","defaultCollapse","onUpdate:collapse","searchText","resetText","onSubmit","onReset","extraInAction","forceExpand","countPerRow"])),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value.hideNode))),e.createVNode(e.unref(r.Row),{ref_key:"contentWrapperRef",ref:B,gutter:8},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value.nodes,a=>(e.openBlock(),e.createBlock(e.unref(r.Col),{key:a.key,flex:m(a.span),style:e.normalizeStyle({maxWidth:m(a.span)})},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.node)))]),_:2},1032,["flex","style"]))),128)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(G.value)))]),_:1},512)]),_:1},16,["class"]))}});exports.default=ce;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../../utils/cssinjs/index.js"),a=n=>{const{componentCls:t,namespace:e}=n,i=`${t}--disabled`;return{[t]:{"&--bordered":{boxSizing:"border-box",border:`${n.lineWidth} ${n.lineType} ${n.borderColorBase}`,borderRadius:n.borderRadius,paddingInline:n.space,".ant-input-affix-wrapper":{padding:0},[`&:has(.${e}-batch-input-group):has(.ant-select)`]:{".ant-input-affix-wrapper":{paddingInlineEnd:n.space}},"&:has(textarea.ant-input)":{paddingInlineEnd:0,".ant-input":{paddingInlineStart:0}},[`&:has(div.${e}-batch-input-group .ant-input)`]:{paddingInlineEnd:n.space,".ant-input":{paddingInlineStart:0}},".ant-picker":{padding:0},".ant-form-item-control-input-content":{"& > .ant-input-group":{"& > .ant-picker-range:nth-child(1)":{".ant-picker-clear":{insetInlineEnd:0}}}},".ant-space-compact-block":{".ant-input":{paddingInlineStart:n.space}},".ant-select-selector":{borderWidth:"0 !important",boxShadow:"none !important",background:"unset !important"},".ant-select-single .ant-select-selector":{height:`${n.controlHeight} !important`},"input.ant-input-number-input":{paddingInlineStart:0},"&:has(.ant-input-number)":{paddingInlineEnd:0},"&:has(.ant-select)":{paddingInlineEnd:0,".ant-form-item-label > label":{paddingInlineEnd:n.spaceXS}},"div.ant-form-item-control":{flex:"1 1 0",minWidth:0},".ant-form-item-label > label":{paddingRight:n.spaceLG,height:n.controlHeight,"&::after":{margin:0}},".ant-form-item-control-input":{minHeight:n.controlHeight,".ant-select-single":{height:"unset"}},[`&:hover:not(${i})`]:{borderColor:n.hoverColorBase},"&:focus":{borderColor:n.activeColorBase,boxShadow:"0 0 0 2px rgba(5, 155, 255, 0.1)"},[`.${e}-batch-input-group-popover-input__popover`]:{width:"calc(100% + 12px)"}},"&--disabled":{cursor:"not-allowed",backgroundColor:n.colorBgDisabled,".ant-select-selector":{backgroundColor:"transparent !important"}},"&--focused":{borderColor:n.activeColorBase,boxShadow:"0 0 0 2px rgba(5, 155, 255, 0.1)"},".ant-form-show-help":{".ant-form-item-explain-error":{fontSize:n.fontSize,lineHeight:n.lineHeightSM}},".ant-col .ant-form-item-extra":{lineHeight:n.lineHeightLG,minHeight:"unset",marginBlockStart:n.spaceXS,marginBlockEnd:n.spaceLG},".ant-input-group":{".ant-picker:only-child":{width:"100%"},".ant-select + .ant-picker":{paddingInline:n.space,flex:1}}}}},o=r.genComponentStyleHook("ApForm",n=>[a(n)]);exports.default=o;exports.genApFormItemStyle=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("@aplus-frontend/antdv"),M=require("../ap-table/hooks/use-table-paging-ng.js");require("../config-provider/index.js");const f=require("lodash-unified"),U=require("./hooks/use-offline-list.js");require("vue-virtual-scroller/dist/vue-virtual-scroller.css");const g=require("vue-virtual-scroller"),K=require("./style/index.js"),W=require("../config-provider/hooks/use-namespace.js"),G=e.defineComponent({name:"ApList",__name:"index",props:{dataSource:{},loading:{type:Boolean,default:void 0},onItem:{},params:{},request:{},defaultData:{},onLoadingChange:{},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},manual:{type:Boolean},containerStyle:{type:[Boolean,null,String,Object,Array]},contentStyle:{type:[Boolean,null,String,Object,Array]},footerWarpperStyle:{type:[Boolean,null,String,Object,Array]},virtual:{default:void 0},rowKey:{},adaptive:{type:Boolean,default:!1}},setup(B,{expose:b}){const C=c.Empty.PRESENTED_IMAGE_SIMPLE,t=B,{b:s,e:d,bm:z,m:
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("@aplus-frontend/antdv"),M=require("../ap-table/hooks/use-table-paging-ng.js");require("../config-provider/index.js");const f=require("lodash-unified"),U=require("./hooks/use-offline-list.js");require("vue-virtual-scroller/dist/vue-virtual-scroller.css");const g=require("vue-virtual-scroller"),K=require("./style/index.js"),W=require("../config-provider/hooks/use-namespace.js"),G=e.defineComponent({name:"ApList",__name:"index",props:{dataSource:{},loading:{type:Boolean,default:void 0},onItem:{},params:{},request:{},defaultData:{},onLoadingChange:{},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},manual:{type:Boolean},containerStyle:{type:[Boolean,null,String,Object,Array]},contentStyle:{type:[Boolean,null,String,Object,Array]},footerWarpperStyle:{type:[Boolean,null,String,Object,Array]},virtual:{default:void 0},rowKey:{},adaptive:{type:Boolean,default:!1}},setup(B,{expose:b}){const C=c.Empty.PRESENTED_IMAGE_SIMPLE,t=B,{b:s,e:d,bm:z,m:w}=W.useNamespace("ap-list"),I=K.default("ap-list"),S=e.shallowRef(),{formRef:m,submit:y,reset:v,handleTableChange:q,data:p,refresh:E,refreshByDelete:P,tableProps:h,getPaging:V,setPaging:D}=M.useTablePaging({async request(n){const r=await t.request?.(n);return{data:r?.data||[],total:r?.total||0}},params:e.toRef(t,"params"),defaultData:t.defaultData,manual:t.manual,pagination:t.pagination,formatParams:t.beforeSearchSubmit}),N={form:m},{pagination:k,dataSource:F,onChange:O}=U.useOfflineList(t);function L(n,r){if(e.unref(u)){O(n,r);return}q({current:n,pageSize:r},{},{},{currentDataSource:[],action:"paginate"})}const l=e.computed(()=>e.unref(u)?e.unref(F):e.unref(p).records),i=e.computed(()=>f.isUndefined(t.loading)?e.unref(p).loading:t.loading),R=e.computed(()=>t.pagination===!1||t.virtual?!1:t.pagination?.hideOnSinglePage!==!0?!0:e.unref(u)?(t.dataSource?.length||0)>e.unref(k).pageSize:e.unref(p).total>e.unref(h).pagination.pageSize),u=e.computed(()=>!f.isUndefined(t.dataSource));e.watch(()=>e.unref(i),n=>{t.onLoadingChange?.(n)});function T(n){S.value?.querySelector(n||":first-child")?.scrollIntoView({behavior:"smooth",block:"center"})}function $(n=!1){const r=m.value?.apForm;return(n?r?.getFieldsValueTransformed:r?.getFieldsValue)?.()||{}}function j(n){m.value?.apForm?.setFieldsValue?.(n)}return b({submit:()=>y(),reset:()=>v(),refresh:()=>E(),refreshByDelete:n=>P(n),scrollToFirstRow:T,getSearchFormValuesIfSetted:$,setPaging:D,getPaging:V,setSearchFormValuesIfSetted:j}),(n,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(s)(),{[e.unref(w)("adaptive")]:n.adaptive},e.unref(I)]),style:e.normalizeStyle(n.containerStyle)},[e.renderSlot(n.$slots,"header",{formIns:N,submit:e.unref(y),reset:e.unref(v)}),e.createElementVNode("div",{class:e.normalizeClass([e.unref(s)("content-container"),{[e.unref(z)("content-container","spinning")]:i.value}])},[i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(d)("spin-wrapper"))},[e.createVNode(e.unref(c.Spin),{spinning:i.value},null,8,["spinning"])],2)):e.createCommentVNode("",!0),l.value.length===0?e.renderSlot(n.$slots,"empty",{key:1,loading:i.value},()=>[e.createVNode(e.unref(c.Empty),{image:e.unref(C)},null,8,["image"])]):(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"contentRef",ref:S,style:e.normalizeStyle(n.contentStyle),class:e.normalizeClass(e.unref(d)("content"))},[n.virtual?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(f.isNumber)(n.virtual)?(e.openBlock(),e.createBlock(e.unref(g.RecycleScroller),{key:0,class:e.normalizeClass(e.unref(s)("scroll-wrapper")),items:l.value,"item-size":n.virtual,"key-field":t.rowKey||"id"},{default:e.withCtx(({item:a,index:o})=>[e.renderSlot(n.$slots,"renderItem",{item:a,index:o})]),_:3},8,["class","items","item-size","key-field"])):(e.openBlock(),e.createBlock(e.unref(g.DynamicScroller),{key:1,items:l.value,"min-item-size":n.virtual.minItemSize,class:e.normalizeClass(e.unref(s)("scroll-wrapper"))},{default:e.withCtx(({item:a,index:o,active:A})=>[e.createVNode(e.unref(g.DynamicScrollerItem),{item:a,active:A,"data-index":o,"size-dependencies":n.virtual.sizeDependencies?.(a)},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"renderItem",{item:a,index:o})]),_:2},1032,["item","active","data-index","size-dependencies"])]),_:3},8,["items","min-item-size","class"]))],64)):e.renderSlot(n.$slots,"renderContent",{key:1,dataSource:l.value},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(a,o)=>e.renderSlot(n.$slots,"renderItem",{item:a,index:o})),256))])],6))],2),R.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(d)("footer")),style:e.normalizeStyle(n.footerWarpperStyle)},[e.createVNode(e.unref(c.Pagination),e.mergeProps(u.value?e.unref(k):e.unref(f.omit)(e.unref(h).pagination,["showTotal"]),{onChange:L}),null,16)],6)):e.createCommentVNode("",!0)],6))}});exports.default=G;
|
|
@@ -1773,7 +1773,7 @@ export declare const apTableFormItemMap: {
|
|
|
1773
1773
|
allowClear: boolean;
|
|
1774
1774
|
}> & Omit<Readonly< ApFieldTextProps> & Readonly<{
|
|
1775
1775
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
1776
|
-
}>, "blur" | "focus" | "input" | "select" | ("type" | "mode" | "disabled" | "bordered" | "emptyText" | "lazy" | "allowClear")
|
|
1776
|
+
}>, "blur" | "focus" | "input" | "select" | "setSelectionRange" | ("type" | "mode" | "disabled" | "bordered" | "emptyText" | "lazy" | "allowClear")> & ShallowUnwrapRef<{
|
|
1777
1777
|
focus: (options?: InputFocusOptions) => void;
|
|
1778
1778
|
blur: () => void;
|
|
1779
1779
|
input: any;
|
|
@@ -139,7 +139,7 @@ declare const _default: DefineComponent<BatchInputGroupProps, {}, {}, {}, {}, Co
|
|
|
139
139
|
allowClear: boolean;
|
|
140
140
|
}> & Omit<Readonly< ApFieldTextProps> & Readonly<{
|
|
141
141
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
142
|
-
}>, "blur" | "focus" | "input" | "select" | ("type" | "mode" | "disabled" | "bordered" | "emptyText" | "lazy" | "allowClear")
|
|
142
|
+
}>, "blur" | "focus" | "input" | "select" | "setSelectionRange" | ("type" | "mode" | "disabled" | "bordered" | "emptyText" | "lazy" | "allowClear")> & ShallowUnwrapRef<{
|
|
143
143
|
focus: (options?: InputFocusOptions) => void;
|
|
144
144
|
blur: () => void;
|
|
145
145
|
input: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),_=require("@aplus-frontend/antdv"),m=require("../ap-form/index.js"),u=require("lodash-unified");require("../config-provider/index.js");const k=require("../ap-form/context.js");require("../utils/index.js");const P=require("./hooks/use-get-columns.js"),j=require("./utils.js"),A=require("../ap-form/utils/get.js"),O=require("../utils/warning.js"),z=require("./style/index.js"),K=require("../config-provider/hooks/use-namespace.js"),$=require("../config-provider/hooks/use-global-config.js"),p=require("../utils/is.js"),G=t.defineComponent({name:"EditableTableFormItem",__name:"form-item",props:{dropdownPrefixCls:{},pagination:{type:[Boolean,Object],default:!1},loading:{type:[Boolean,Object],default:void 0},size:{default:"small"},bordered:{type:Boolean,default:!1},locale:{},onResizeColumn:{},rowSelection:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},rowKey:{type:[String,Function],default:"key"},tableLayout:{default:"fixed"},rowClassName:{},title:{},footer:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object]},transformCellText:{},columns:{},value:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},onFieldChange:{},label:{},name:{},formItem:{default:()=>({})}},setup(g,{expose:b}){const o=g;O.useDevWarning("EditableTableFormItem")(!1,"breaking","EditableTableFormItem has been EOL, Please use EditableAgGridFormItem(https://aplus.aplnk.com/aplus-ui/components/ag-grid/editable/) instead.");const{internalInstance:i,model:h}=k.useInjectForm(),d=t.ref(A.getModelValue(t.unref(h),o.name)||[]),w=t.useSlots(),x=t.toRef(o,"name"),y=m.ApForm.useWatch(x);t.watch(()=>y.value,async e=>{await t.nextTick(),d.value=e,o.onChange?.(e)},{deep:!0});const{b:C}=K.useNamespace("editable-table"),R=z.default("editable-table"),c=t.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),_=require("@aplus-frontend/antdv"),m=require("../ap-form/index.js"),u=require("lodash-unified");require("../config-provider/index.js");const k=require("../ap-form/context.js");require("../utils/index.js");const P=require("./hooks/use-get-columns.js"),j=require("./utils.js"),A=require("../ap-form/utils/get.js"),O=require("../utils/warning.js"),z=require("./style/index.js"),K=require("../config-provider/hooks/use-namespace.js"),$=require("../config-provider/hooks/use-global-config.js"),p=require("../utils/is.js"),G=t.defineComponent({name:"EditableTableFormItem",__name:"form-item",props:{dropdownPrefixCls:{},pagination:{type:[Boolean,Object],default:!1},loading:{type:[Boolean,Object],default:void 0},size:{default:"small"},bordered:{type:Boolean,default:!1},locale:{},onResizeColumn:{},rowSelection:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},rowKey:{type:[String,Function],default:"key"},tableLayout:{default:"fixed"},rowClassName:{},title:{},footer:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object]},transformCellText:{},columns:{},value:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},onFieldChange:{},label:{},name:{},formItem:{default:()=>({})}},setup(g,{expose:b}){const o=g;O.useDevWarning("EditableTableFormItem")(!1,"breaking","EditableTableFormItem has been EOL, Please use EditableAgGridFormItem(https://aplus.aplnk.com/aplus-ui/components/ag-grid/editable/) instead.");const{internalInstance:i,model:h}=k.useInjectForm(),d=t.ref(A.getModelValue(t.unref(h),o.name)||[]),w=t.useSlots(),x=t.toRef(o,"name"),y=m.ApForm.useWatch(x);t.watch(()=>y.value,async e=>{await t.nextTick(),d.value=e,o.onChange?.(e)},{deep:!0});const{b:C}=K.useNamespace("editable-table"),R=z.default("editable-table"),c=t.shallowRef(),F=$.useGlobalConfig("valueTypeMap"),v=P.default(o,F);function q(e,l){const s=t.unref(d)?.length||0;if(p.isDef(o.maxLength)&&s>=o.maxLength)return;const n={...e||{}};i?.setFieldValue(o.name,n,!0,(a,r)=>{if(!a[r]){a[r]=[n];return}u.isUndefined(l)?a[r].push(n):a[r].splice(l,0,n)})}function T(e,l="suffix"){const s=t.unref(d)?.length||0,n=u.isNumber(e)?e:e.length;if(p.isDef(o.maxLength)&&s+n>o.maxLength)return;const a=u.isNumber(e)?new Array(e).fill(0).map(()=>({})):u.cloneDeep(e);i?.setFieldValue(o.name,a,!0,(r,f)=>{if(!r[f]){r[f]=[...a];return}l==="suffix"?r[f].push(...a):r[f].unshift(...a)})}function B(e){const l=new Set(u.isNumber(e)?[e]:e);i?.setFieldValue(o.name,void 0,!0,(s,n)=>{s[n]=s[n].filter((a,r)=>!l.has(r))})}function I(e){const l=new Set(u.isArray(e)?e:[e]);l.size!==0&&i?.setFieldValue?.(o.name,void 0,!0,(s,n)=>{s[n]=s[n].filter(a=>!l.has(a[o.rowKey]))})}function D(){return t.unref(d)}function S(e){return t.unref(d)?.[e]}function E(e,l,s=!0){i?.setFieldValue(o.name,void 0,!0,(n,a)=>{!n[a]||!n[a][e]||(n[a][e]={...s?n[a][e]:{},...l})})}function N(e){i?.setFieldValue(o.name,e)}function L(e,l){const s=e==="end"?d.value.length-1:e;j.scrollToRowIndex(s,c.value?.$el,l)}function V(){i?.setFieldValue?.(o.name,[])}return b({add:q,remove:B,getRowData:S,getRowsData:D,setRowData:E,addMultiple:T,scrollTo:L,setTableData:N,clear:V,removeByKey:I}),(e,l)=>(t.openBlock(),t.createBlock(t.unref(m.ApForm).FormItem,t.mergeProps(e.formItem,{name:e.name,label:e.label}),{default:t.withCtx(()=>[t.createVNode(t.unref(_.Table),t.mergeProps(t.unref(u.omit)(o,["name","maxLength","onChange"]),{ref_key:"tableRef",ref:c,class:[t.unref(C)(),t.unref(R)],columns:t.unref(v),"data-source":d.value}),t.createSlots({_:2},[t.renderList(t.unref(u.omit)(w,["headerCell"]),(s,n)=>({name:n,fn:t.withCtx(a=>[t.renderSlot(e.$slots,n,t.normalizeProps(t.guardReactiveProps(a||{})))])}))]),1040,["class","columns","data-source"])]),_:3},16,["name","label"]))}});exports.default=G;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),O=require("@aplus-frontend/antdv"),p=require("../ap-form/index.js"),i=require("lodash-unified");require("../config-provider/index.js");require("../hooks/index.js");require("../utils/index.js");const j=require("./utils.js"),z=require("./hooks/use-get-columns.js"),K=require("../utils/warning.js"),$=require("./style/index.js"),G=require("../config-provider/hooks/use-namespace.js"),U=require("../hooks/useControllableValue.js"),W=require("../config-provider/hooks/use-global-config.js"),h=require("../utils/is.js"),H=n.defineComponent({name:"EditableTable",__name:"index",props:{dropdownPrefixCls:{},pagination:{type:[Boolean,Object],default:!1},loading:{type:[Boolean,Object],default:void 0},size:{default:"small"},bordered:{type:Boolean,default:!1},locale:{},onResizeColumn:{},rowSelection:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},rowKey:{type:[String,Function],default:"key"},tableLayout:{default:"fixed"},rowClassName:{},title:{},footer:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object]},transformCellText:{},columns:{},value:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},name:{default:"ap-editable-table-inner-name"},onFieldChange:{}},emits:["update:value"],setup(g,{expose:b,emit:
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),O=require("@aplus-frontend/antdv"),p=require("../ap-form/index.js"),i=require("lodash-unified");require("../config-provider/index.js");require("../hooks/index.js");require("../utils/index.js");const j=require("./utils.js"),z=require("./hooks/use-get-columns.js"),K=require("../utils/warning.js"),$=require("./style/index.js"),G=require("../config-provider/hooks/use-namespace.js"),U=require("../hooks/useControllableValue.js"),W=require("../config-provider/hooks/use-global-config.js"),h=require("../utils/is.js"),H=n.defineComponent({name:"EditableTable",__name:"index",props:{dropdownPrefixCls:{},pagination:{type:[Boolean,Object],default:!1},loading:{type:[Boolean,Object],default:void 0},size:{default:"small"},bordered:{type:Boolean,default:!1},locale:{},onResizeColumn:{},rowSelection:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},rowKey:{type:[String,Function],default:"key"},tableLayout:{default:"fixed"},rowClassName:{},title:{},footer:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object]},transformCellText:{},columns:{},value:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},name:{default:"ap-editable-table-inner-name"},onFieldChange:{}},emits:["update:value"],setup(g,{expose:b,emit:w}){const t=g;K.useDevWarning("EditableTable")(!1,"breaking","EditableTable has been EOL, Please use EditableAgGrid(https://aplus.aplnk.com/aplus-ui/components/ag-grid/editable/) instead.");const{b:v}=G.useNamespace("editable-table"),x=$.default("editable-table"),y=n.useSlots(),C=w,m=n.shallowRef(),{value:d,updateValue:R}=U.useControllableValue(t,C),r=n.ref(),F=W.useGlobalConfig("valueTypeMap"),c=p.ApForm.useWatch(t.name,r);n.watch(()=>c.value,e=>{R(e),t.onChange?.(e)},{deep:!0,flush:"post"}),n.watch(d,e=>{e!==n.unref(c)&&(i.isEqual(e,n.unref(c))||r.value?.setFieldValue(t.name,e))},{deep:!0});const q=z.default(t,F);function B(){r.value?.resetFields()}function T(e){return e?(i.isArray(e)?e:[e]).map(l=>i.isArray(l)?[t.name,...l]:[t.name,l]):void 0}async function V(e,u){return(await r.value?.validateFields(T(e),u))?.[t.name]}function E(e,u){const l=n.unref(d)?.length||0;if(h.isDef(t.maxLength)&&l>=t.maxLength)return;const a={...e||{}};r.value?.setFieldValue?.(t.name,a,!0,(o,s)=>{if(!o[s]){o[s]=[a];return}i.isUndefined(u)?o[s].push(a):o[s].splice(u,0,a)})}function N(e,u="suffix"){const l=n.unref(d)?.length||0,a=i.isNumber(e)?e:e.length;if(h.isDef(t.maxLength)&&l+a>t.maxLength)return;const o=i.isNumber(e)?new Array(e).fill(0).map(()=>({})):i.cloneDeep(e);r.value?.setFieldValue?.(t.name,o,!0,(s,f)=>{if(!s[f]){s[f]=[...o];return}u==="suffix"?s[f].push(...o):s[f].unshift(...o)})}function S(e){const u=new Set(i.isNumber(e)?[e]:e);r.value?.setFieldValue?.(t.name,void 0,!0,(l,a)=>{l[a]=l[a].filter((o,s)=>!u.has(s))})}function A(e){const u=new Set(i.isArray(e)?e:[e]);u.size!==0&&r.value?.setFieldValue?.(t.name,void 0,!0,(l,a)=>{l[a]=l[a].filter(o=>!u.has(o[t.rowKey]))})}function D(){return n.unref(d)}function _(e){r.value?.setFieldValue(t.name,e)}function L(e){return n.unref(d)?.[e]}function k(e,u,l=!0){r.value?.setFieldValue?.(t.name,void 0,!0,(a,o)=>{!a[o]||!a[o][e]||(a[o][e]={...l?a[o][e]:{},...u})})}function P(e,u){const l=e==="end"?d.value.length-1:e;j.scrollToRowIndex(l,m.value?.$el,u)}function I(){r.value?.setFieldValue?.(t.name,[])}return b({resetFields:B,validateFields:V,add:E,remove:S,getRowData:L,getRowsData:D,setRowData:k,addMultiple:N,scrollTo:P,clear:I,setTableData:_,removeByKey:A}),(e,u)=>(n.openBlock(),n.createBlock(n.unref(p.ApForm),{ref_key:"formRef",ref:r,"initial-values":{[t.name]:n.unref(d)}},{default:n.withCtx(()=>[n.createVNode(n.unref(p.ApForm).FormItem,{name:e.name,"no-style":""},{default:n.withCtx(()=>[n.createVNode(n.unref(O.Table),n.mergeProps(n.unref(i.omit)(t,["name","value","onUpdate:value","maxLength","onChange"]),{ref_key:"tableRef",ref:m,class:[n.unref(v)(),n.unref(x)],columns:n.unref(q),"data-source":n.unref(d)}),n.createSlots({_:2},[n.renderList(n.unref(i.omit)(y,["headerCell"]),(l,a)=>({name:a,fn:n.withCtx(o=>[n.renderSlot(e.$slots,a,n.normalizeProps(n.guardReactiveProps(o||{})))])}))]),1040,["class","columns","data-source"])]),_:3},8,["name"])]),_:3},8,["initial-values"]))}});exports.default=H;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ScrollBarProps, ScrollBarDirection, InternalScrollBarProps } from './interface';
|
|
2
|
-
import { DefineComponent, ComputedRef, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, CreateComponentPublicInstanceWithMixins, Ref, GlobalComponents, GlobalDirectives } from 'vue';
|
|
2
|
+
import { DefineComponent, ComputedRef, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, CreateComponentPublicInstanceWithMixins, Ref, ShallowRef, GlobalComponents, GlobalDirectives } from 'vue';
|
|
3
3
|
declare function handleBarScroll(percent: number): void;
|
|
4
4
|
declare const _default: DefineComponent<ScrollBarProps, {
|
|
5
5
|
currentScroll: ComputedRef<number | undefined>;
|
|
@@ -16,9 +16,9 @@ declare const _default: DefineComponent<ScrollBarProps, {
|
|
|
16
16
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
17
17
|
barRef: CreateComponentPublicInstanceWithMixins<Readonly< InternalScrollBarProps> & Readonly<{}>, {
|
|
18
18
|
currentScroll: Ref<number, number>;
|
|
19
|
-
container:
|
|
20
|
-
bar:
|
|
21
|
-
track:
|
|
19
|
+
container: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
20
|
+
bar: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
21
|
+
track: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
22
22
|
scroll: (percent: number) => void;
|
|
23
23
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
|
24
24
|
scroll: number;
|
|
@@ -40,9 +40,9 @@ declare const _default: DefineComponent<ScrollBarProps, {
|
|
|
40
40
|
Defaults: {};
|
|
41
41
|
}, Readonly< InternalScrollBarProps> & Readonly<{}>, {
|
|
42
42
|
currentScroll: Ref<number, number>;
|
|
43
|
-
container:
|
|
44
|
-
bar:
|
|
45
|
-
track:
|
|
43
|
+
container: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
44
|
+
bar: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
45
|
+
track: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
46
46
|
scroll: (percent: number) => void;
|
|
47
47
|
}, {}, {}, {}, {
|
|
48
48
|
scroll: number;
|
|
@@ -1 +1 @@
|
|
|
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.
|
|
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.shallowRef(),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(()=>e.unref(n.value?.currentScroll)),scroll:f,visible:e.computed(()=>a.value<100),rootElement:e.computed(()=>e.unref(n.value?.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,11 +1,11 @@
|
|
|
1
1
|
import { InternalScrollBarProps, ScrollBarDirection } from './interface';
|
|
2
|
-
import { DefineComponent, Ref, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
import { DefineComponent, Ref, ShallowRef, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
3
|
declare function scroll(percent: number): void;
|
|
4
4
|
declare const _default: DefineComponent<InternalScrollBarProps, {
|
|
5
5
|
currentScroll: Ref<number, number>;
|
|
6
|
-
container:
|
|
7
|
-
bar:
|
|
8
|
-
track:
|
|
6
|
+
container: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
7
|
+
bar: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
8
|
+
track: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
9
9
|
scroll: typeof scroll;
|
|
10
10
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<InternalScrollBarProps> & Readonly<{}>, {
|
|
11
11
|
scroll: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
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"),w=require("./utils/index.js"),P=require("./style/index.js"),$=require("../config-provider/hooks/use-namespace.js"),q=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(S,{expose:y}){const r=S,h=t.shallowRef(),s=t.shallowRef(),l=t.shallowRef(),{b:R,e:p,m:E,em:c,cssVar:L}=$.useNamespace("scroll-bar"),C=P.default("scroll-bar"),o=t.ref(r.scroll),{handleMouseDown:b}=T.useTrack({currentScroll:o,track:s,bar:l,type:t.toRef(r,"direction"),trackSpeed:t.toRef(r,"trackSpeed"),barLength:t.toRef(r,"barLength"),disabled:t.toRef(r,"disabled"),onDown:e=>{r.onScrollStart?.(e)},onUp:e=>{r.onScrollEnd?.(e)},onScroll:e=>{r.onScroll?.(e)}});t.watch(()=>r.scroll,e=>{o.value=e}),t.watchEffect(()=>{if(!t.unref(l))return;const e=`${(100-r.barLength)*o.value/r.barLength}%`,n=`${r.barLength}%`;r.direction==="vertical"?(l.value.style.height=n,l.value.style.transform=`translate3d(0, ${e}, 0)`):(l.value.style.width=n,l.value.style.transform=`translate3d(${e}, 0, 0)`)});let f,i,u;function M(e){if(r.disabled||e.button!==0)return;e.preventDefault(),e.stopPropagation();const n=t.unref(s),a=t.unref(l);if(!n||!a)return;document.addEventListener("pointermove",k),document.addEventListener("pointerup",v);const d=n.getBoundingClientRect(),g=a.getBoundingClientRect();r.direction==="vertical"?(f=d.height,i=g.top-d.top,u=e.clientY):(f=d.width,i=g.left-d.left,u=e.clientX),r.onScrollStart?.(t.unref(o))}function k(e){e.stopPropagation(),e.preventDefault();let n;r.direction==="vertical"?n=i+e.clientY-u:n=i+e.clientX-u;const a=n/f/(100-r.barLength)*1e4;o.value=w.ensureRangeValue(a),r.onScroll?.(t.unref(o))}function v(e){e.preventDefault(),document.removeEventListener("pointermove",k),document.removeEventListener("pointerup",v),r.onScrollEnd?.(t.unref(o))}function m(e){e.cancelable&&(e.stopPropagation(),e.preventDefault())}function D(e){Math.abs(t.unref(o)-e)<=.001||(o.value=w.ensureRangeValue(e))}return y({currentScroll:o,container:h,bar:l,track:s,scroll:D}),(e,n)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"container",ref:h,class:t.normalizeClass([t.unref(R)(),t.unref(E)(e.direction),t.unref(C)]),style:t.normalizeStyle(t.unref(L)({"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},!1))},[t.createElementVNode("div",{ref_key:"track",ref:s,class:t.normalizeClass([t.unref(p)("track"),e.disabled?t.unref(c)("track","disabled"):null,e.showTrack?null:t.unref(c)("track","hidden")]),onPointerdown:n[0]||(n[0]=(...a)=>t.unref(b)&&t.unref(b)(...a)),onTouchstart:m},null,34),t.createElementVNode("div",{ref_key:"bar",ref:l,class:t.normalizeClass([t.unref(p)("bar"),t.unref(c)("bar",e.direction),e.disabled?t.unref(c)("bar","disabled"):null]),onPointerdown:M,onTouchstart:m},null,34)],6))}});exports.default=q;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InternalScrollBarExpose } from '../../scroll-bar';
|
|
2
|
-
import {
|
|
2
|
+
import { ShallowRef } from 'vue';
|
|
3
3
|
declare const useScrollWrapper: () => {
|
|
4
4
|
maxScrollDistance: {
|
|
5
5
|
x: number;
|
|
@@ -9,11 +9,11 @@ declare const useScrollWrapper: () => {
|
|
|
9
9
|
x: number;
|
|
10
10
|
y: number;
|
|
11
11
|
};
|
|
12
|
-
xBarRef:
|
|
13
|
-
yBarRef:
|
|
12
|
+
xBarRef: ShallowRef<InternalScrollBarExpose | undefined, InternalScrollBarExpose | undefined>;
|
|
13
|
+
yBarRef: ShallowRef<InternalScrollBarExpose | undefined, InternalScrollBarExpose | undefined>;
|
|
14
14
|
scrollYBar: () => void;
|
|
15
15
|
scrollXBar: () => void;
|
|
16
|
-
containerRef:
|
|
16
|
+
containerRef: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
17
17
|
updateMaxScrollDistance: () => void;
|
|
18
18
|
};
|
|
19
19
|
export default useScrollWrapper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("../../scroll-bar/utils/index.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("../../scroll-bar/utils/index.js"),t=require("vue"),z=()=>{const e=t.shallowRef(),a=t.reactive({x:0,y:0}),i=t.reactive({x:0,y:0}),n=t.shallowRef(),s=t.shallowRef();t.watch(()=>e.value,()=>{u()});function u(){const l=t.unref(e);if(!l)return;const{visibleSize:o,totalSize:r}=c.getScrollable(l,"horizontal"),{visibleSize:S,totalSize:b}=c.getScrollable(l,"vertical");a.x=r-o,a.y=b-S}function v(){if(!e.value)return;const{totalSize:l,visibleSize:o}=c.getScrollable(e.value,"vertical"),r=i.y/(l-o||1)*100;s.value?.scroll(r)}function f(){if(!e.value)return;const{totalSize:l,visibleSize:o}=c.getScrollable(e.value,"horizontal"),r=i.x/(l-o||1)*100;n.value?.scroll(r)}return{maxScrollDistance:a,scrollOffset:i,xBarRef:n,yBarRef:s,scrollYBar:v,scrollXBar:f,containerRef:e,updateMaxScrollDistance:u}};exports.default=z;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ScrollOptions, ScrollViewProps } from './interface';
|
|
2
2
|
import { ScrollBarDirection, InternalScrollBarProps } from '../scroll-bar';
|
|
3
|
-
import { CreateComponentPublicInstanceWithMixins, Ref, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, DefineComponent, ComputedRef } from 'vue';
|
|
3
|
+
import { CreateComponentPublicInstanceWithMixins, Ref, ShallowRef, 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;
|
|
6
6
|
declare function scrollIntoView(element: HTMLElement, position?: 'start' | 'center' | 'end'): void;
|
|
@@ -14,9 +14,9 @@ declare function __VLS_template(): {
|
|
|
14
14
|
contentRef: HTMLDivElement;
|
|
15
15
|
yBarRef: CreateComponentPublicInstanceWithMixins<Readonly< InternalScrollBarProps> & Readonly<{}>, {
|
|
16
16
|
currentScroll: Ref<number, number>;
|
|
17
|
-
container:
|
|
18
|
-
bar:
|
|
19
|
-
track:
|
|
17
|
+
container: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
18
|
+
bar: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
19
|
+
track: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
20
20
|
scroll: (percent: number) => void;
|
|
21
21
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
|
22
22
|
scroll: number;
|
|
@@ -38,9 +38,9 @@ declare function __VLS_template(): {
|
|
|
38
38
|
Defaults: {};
|
|
39
39
|
}, Readonly< InternalScrollBarProps> & Readonly<{}>, {
|
|
40
40
|
currentScroll: Ref<number, number>;
|
|
41
|
-
container:
|
|
42
|
-
bar:
|
|
43
|
-
track:
|
|
41
|
+
container: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
42
|
+
bar: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
43
|
+
track: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
44
44
|
scroll: (percent: number) => void;
|
|
45
45
|
}, {}, {}, {}, {
|
|
46
46
|
scroll: number;
|
|
@@ -52,9 +52,9 @@ declare function __VLS_template(): {
|
|
|
52
52
|
}> | null;
|
|
53
53
|
xBarRef: CreateComponentPublicInstanceWithMixins<Readonly< InternalScrollBarProps> & Readonly<{}>, {
|
|
54
54
|
currentScroll: Ref<number, number>;
|
|
55
|
-
container:
|
|
56
|
-
bar:
|
|
57
|
-
track:
|
|
55
|
+
container: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
56
|
+
bar: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
57
|
+
track: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
58
58
|
scroll: (percent: number) => void;
|
|
59
59
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
|
60
60
|
scroll: number;
|
|
@@ -76,9 +76,9 @@ declare function __VLS_template(): {
|
|
|
76
76
|
Defaults: {};
|
|
77
77
|
}, Readonly< InternalScrollBarProps> & Readonly<{}>, {
|
|
78
78
|
currentScroll: Ref<number, number>;
|
|
79
|
-
container:
|
|
80
|
-
bar:
|
|
81
|
-
track:
|
|
79
|
+
container: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
80
|
+
bar: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
81
|
+
track: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
82
82
|
scroll: (percent: number) => void;
|
|
83
83
|
}, {}, {}, {}, {
|
|
84
84
|
scroll: number;
|
|
@@ -130,9 +130,9 @@ declare const __VLS_component: DefineComponent<ScrollViewProps, {
|
|
|
130
130
|
contentRef: HTMLDivElement;
|
|
131
131
|
yBarRef: CreateComponentPublicInstanceWithMixins<Readonly< InternalScrollBarProps> & Readonly<{}>, {
|
|
132
132
|
currentScroll: Ref<number, number>;
|
|
133
|
-
container:
|
|
134
|
-
bar:
|
|
135
|
-
track:
|
|
133
|
+
container: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
134
|
+
bar: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
135
|
+
track: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
136
136
|
scroll: (percent: number) => void;
|
|
137
137
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
|
138
138
|
scroll: number;
|
|
@@ -154,9 +154,9 @@ declare const __VLS_component: DefineComponent<ScrollViewProps, {
|
|
|
154
154
|
Defaults: {};
|
|
155
155
|
}, Readonly< InternalScrollBarProps> & Readonly<{}>, {
|
|
156
156
|
currentScroll: Ref<number, number>;
|
|
157
|
-
container:
|
|
158
|
-
bar:
|
|
159
|
-
track:
|
|
157
|
+
container: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
158
|
+
bar: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
159
|
+
track: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
160
160
|
scroll: (percent: number) => void;
|
|
161
161
|
}, {}, {}, {}, {
|
|
162
162
|
scroll: number;
|
|
@@ -168,9 +168,9 @@ declare const __VLS_component: DefineComponent<ScrollViewProps, {
|
|
|
168
168
|
}> | null;
|
|
169
169
|
xBarRef: CreateComponentPublicInstanceWithMixins<Readonly< InternalScrollBarProps> & Readonly<{}>, {
|
|
170
170
|
currentScroll: Ref<number, number>;
|
|
171
|
-
container:
|
|
172
|
-
bar:
|
|
173
|
-
track:
|
|
171
|
+
container: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
172
|
+
bar: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
173
|
+
track: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
174
174
|
scroll: (percent: number) => void;
|
|
175
175
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
|
176
176
|
scroll: number;
|
|
@@ -192,9 +192,9 @@ declare const __VLS_component: DefineComponent<ScrollViewProps, {
|
|
|
192
192
|
Defaults: {};
|
|
193
193
|
}, Readonly< InternalScrollBarProps> & Readonly<{}>, {
|
|
194
194
|
currentScroll: Ref<number, number>;
|
|
195
|
-
container:
|
|
196
|
-
bar:
|
|
197
|
-
track:
|
|
195
|
+
container: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
196
|
+
bar: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
197
|
+
track: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
|
|
198
198
|
scroll: (percent: number) => void;
|
|
199
199
|
}, {}, {}, {}, {
|
|
200
200
|
scroll: number;
|
package/lib/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.7.
|
|
1
|
+
declare const _default: "7.7.4";
|
|
2
2
|
export default _default;
|
package/lib/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.7.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.7.4";exports.default=e;
|