@sunyard-szyy-ui/components 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -20
- package/es/autocomplete/index.d.ts +2 -0
- package/es/autocomplete/index.d.ts.map +1 -0
- package/es/autocomplete/src/autocomplete.d.ts +32 -0
- package/es/autocomplete/src/autocomplete.d.ts.map +1 -0
- package/es/autocomplete/src/autocomplete.mjs +1 -0
- package/es/autocomplete/style/css.d.ts +3 -0
- package/es/autocomplete/style/css.d.ts.map +1 -0
- package/es/autocomplete/style/index.d.ts +3 -0
- package/es/autocomplete/style/index.d.ts.map +1 -0
- package/es/color-picker/index.d.ts +2 -0
- package/es/color-picker/index.d.ts.map +1 -0
- package/es/color-picker/src/color-picker.d.ts +30 -0
- package/es/color-picker/src/color-picker.d.ts.map +1 -0
- package/es/color-picker/src/color-picker.mjs +1 -0
- package/es/color-picker/style/css.d.ts +3 -0
- package/es/color-picker/style/css.d.ts.map +1 -0
- package/es/color-picker/style/index.d.ts +3 -0
- package/es/color-picker/style/index.d.ts.map +1 -0
- package/es/components/autocomplete/index.mjs +1 -0
- package/es/components/autocomplete/style/css.mjs +1 -0
- package/es/components/autocomplete/style/index.mjs +1 -0
- package/es/components/color-picker/index.mjs +1 -0
- package/es/components/color-picker/style/css.mjs +1 -0
- package/es/components/color-picker/style/index.mjs +1 -0
- package/es/components/config-provider/index.mjs +1 -0
- package/es/components/config-provider/style/css.mjs +1 -0
- package/es/components/config-provider/style/index.mjs +1 -0
- package/es/components/icon/index.mjs +1 -0
- package/es/components/icon/style/css.mjs +1 -0
- package/es/components/icon/style/index.mjs +1 -0
- package/es/components/pro-form/index.mjs +1 -0
- package/es/components/pro-form/style/css.mjs +1 -0
- package/es/components/pro-form/style/index.mjs +1 -0
- package/es/components/pro-table/index.mjs +1 -0
- package/es/components/pro-table/style/css.mjs +1 -0
- package/es/components/pro-table/style/index.mjs +1 -0
- package/es/components/select-v2/index.mjs +1 -0
- package/es/components/select-v2/style/css.mjs +1 -0
- package/es/components/select-v2/style/index.mjs +1 -0
- package/es/components/slider/index.mjs +1 -0
- package/es/components/slider/style/css.mjs +1 -0
- package/es/components/slider/style/index.mjs +1 -0
- package/es/components/tree-select/index.mjs +1 -0
- package/es/components/tree-select/style/css.mjs +1 -0
- package/es/components/tree-select/style/index.mjs +1 -0
- package/es/config-provider/index.d.ts +2 -0
- package/es/config-provider/index.d.ts.map +1 -0
- package/es/config-provider/src/config-provider.d.ts +25 -0
- package/es/config-provider/src/config-provider.d.ts.map +1 -0
- package/es/config-provider/src/config-provider.mjs +1 -0
- package/es/config-provider/style/css.d.ts +2 -0
- package/es/config-provider/style/css.d.ts.map +1 -0
- package/es/config-provider/style/index.d.ts +2 -0
- package/es/config-provider/style/index.d.ts.map +1 -0
- package/es/icon/index.d.ts +2 -0
- package/es/icon/index.d.ts.map +1 -0
- package/es/icon/src/icon.d.ts +25 -0
- package/es/icon/src/icon.d.ts.map +1 -0
- package/es/icon/src/icon.mjs +1 -0
- package/es/icon/style/css.d.ts +2 -0
- package/es/icon/style/css.d.ts.map +1 -0
- package/es/icon/style/index.d.ts +2 -0
- package/es/icon/style/index.d.ts.map +1 -0
- package/es/index.d.ts +9 -1
- package/es/index.d.ts.map +1 -1
- package/es/index.mjs +1 -1
- package/es/pro-form/index.d.ts +2 -0
- package/es/pro-form/index.d.ts.map +1 -0
- package/es/pro-form/src/ProForm.vue.mjs +1 -0
- package/es/pro-form/src/ProForm.vue2.mjs +1 -0
- package/es/pro-form/src/ProFormItem.vue.mjs +1 -0
- package/es/pro-form/src/ProFormItem.vue2.mjs +1 -0
- package/es/pro-form/src/pro-form.d.ts +14 -0
- package/es/pro-form/src/pro-form.d.ts.map +1 -0
- package/es/pro-form/src/pro-form.mjs +1 -0
- package/es/pro-form/src/types.d.ts +72 -0
- package/es/pro-form/src/types.d.ts.map +1 -0
- package/es/pro-form/style/css.d.ts +38 -0
- package/es/pro-form/style/css.d.ts.map +1 -0
- package/es/pro-form/style/index.d.ts +38 -0
- package/es/pro-form/style/index.d.ts.map +1 -0
- package/es/pro-table/index.d.ts +2 -0
- package/es/pro-table/index.d.ts.map +1 -0
- package/es/pro-table/src/ColSetting.vue.mjs +4 -0
- package/es/pro-table/src/ColSetting.vue2.mjs +1 -0
- package/es/pro-table/src/ProTable.vue.mjs +1 -0
- package/es/pro-table/src/ProTable.vue2.mjs +1 -0
- package/es/pro-table/src/ProTableColumn.vue.mjs +1 -0
- package/es/pro-table/src/ProTableColumn.vue2.mjs +1 -0
- package/es/pro-table/src/context.d.ts +40 -0
- package/es/pro-table/src/context.d.ts.map +1 -0
- package/es/pro-table/src/hooks/use-pro-table.d.ts +5 -0
- package/es/pro-table/src/hooks/use-pro-table.d.ts.map +1 -0
- package/es/pro-table/src/hooks/use-pro-table.mjs +1 -0
- package/es/pro-table/src/hooks/use-selection.d.ts +8 -0
- package/es/pro-table/src/hooks/use-selection.d.ts.map +1 -0
- package/es/pro-table/src/hooks/use-selection.mjs +1 -0
- package/es/pro-table/src/hooks/use-table.d.ts +31 -0
- package/es/pro-table/src/hooks/use-table.d.ts.map +1 -0
- package/es/pro-table/src/hooks/use-table.mjs +1 -0
- package/es/pro-table/src/pro-table.d.ts +10 -0
- package/es/pro-table/src/pro-table.d.ts.map +1 -0
- package/es/pro-table/src/pro-table.mjs +1 -0
- package/es/pro-table/src/shared/ProTableColSetting.vue.mjs +1 -0
- package/es/pro-table/src/shared/ProTableColSetting.vue2.mjs +1 -0
- package/es/pro-table/src/shared/ProTablePagination.vue.mjs +1 -0
- package/es/pro-table/src/shared/ProTablePagination.vue2.mjs +1 -0
- package/es/pro-table/src/shared/ProTableSearchRenderer.vue.mjs +1 -0
- package/es/pro-table/src/shared/ProTableSearchRenderer.vue2.mjs +1 -0
- package/es/pro-table/src/shared/ProTableTable.vue.mjs +1 -0
- package/es/pro-table/src/shared/ProTableTable.vue2.mjs +1 -0
- package/es/pro-table/src/types.d.ts +116 -0
- package/es/pro-table/src/types.d.ts.map +1 -0
- package/es/pro-table/src/variants/classic/ClassicLayout.vue.mjs +1 -0
- package/es/pro-table/src/variants/classic/ClassicLayout.vue2.mjs +1 -0
- package/es/pro-table/src/variants/classic/index.d.ts +2 -0
- package/es/pro-table/src/variants/classic/index.d.ts.map +1 -0
- package/es/pro-table/src/variants/custom/CustomLayout.vue.mjs +1 -0
- package/es/pro-table/src/variants/custom/CustomLayout.vue2.mjs +1 -0
- package/es/pro-table/src/variants/custom/index.d.ts +2 -0
- package/es/pro-table/src/variants/custom/index.d.ts.map +1 -0
- package/es/pro-table/src/variants/unify/UnifyLayout.vue.mjs +1 -0
- package/es/pro-table/src/variants/unify/UnifyLayout.vue2.mjs +1 -0
- package/es/pro-table/src/variants/unify/UnifyQuickSearch.vue.mjs +1 -0
- package/es/pro-table/src/variants/unify/UnifyQuickSearch.vue2.mjs +1 -0
- package/es/pro-table/src/variants/unify/UnifySearchPanel.vue.mjs +1 -0
- package/es/pro-table/src/variants/unify/UnifySearchPanel.vue2.mjs +1 -0
- package/es/pro-table/src/variants/unify/index.d.ts +2 -0
- package/es/pro-table/src/variants/unify/index.d.ts.map +1 -0
- package/es/pro-table/style/css.d.ts +19 -0
- package/es/pro-table/style/css.d.ts.map +1 -0
- package/es/pro-table/style/index.d.ts +19 -0
- package/es/pro-table/style/index.d.ts.map +1 -0
- package/es/select-v2/index.d.ts +2 -0
- package/es/select-v2/index.d.ts.map +1 -0
- package/es/select-v2/src/select-v2.d.ts +30 -0
- package/es/select-v2/src/select-v2.d.ts.map +1 -0
- package/es/select-v2/src/select-v2.mjs +1 -0
- package/es/select-v2/style/css.d.ts +3 -0
- package/es/select-v2/style/css.d.ts.map +1 -0
- package/es/select-v2/style/index.d.ts +3 -0
- package/es/select-v2/style/index.d.ts.map +1 -0
- package/es/slider/index.d.ts +2 -0
- package/es/slider/index.d.ts.map +1 -0
- package/es/slider/src/slider.d.ts +25 -0
- package/es/slider/src/slider.d.ts.map +1 -0
- package/es/slider/src/slider.mjs +1 -0
- package/es/slider/style/css.d.ts +3 -0
- package/es/slider/style/css.d.ts.map +1 -0
- package/es/slider/style/index.d.ts +3 -0
- package/es/slider/style/index.d.ts.map +1 -0
- package/es/tree-select/index.d.ts +2 -0
- package/es/tree-select/index.d.ts.map +1 -0
- package/es/tree-select/src/tree-select.d.ts +30 -0
- package/es/tree-select/src/tree-select.d.ts.map +1 -0
- package/es/tree-select/src/tree-select.mjs +1 -0
- package/es/tree-select/style/css.d.ts +3 -0
- package/es/tree-select/style/css.d.ts.map +1 -0
- package/es/tree-select/style/index.d.ts +3 -0
- package/es/tree-select/style/index.d.ts.map +1 -0
- package/lib/autocomplete/index.d.ts +2 -0
- package/lib/autocomplete/src/autocomplete.d.ts +32 -0
- package/lib/autocomplete/src/autocomplete.js +1 -0
- package/lib/autocomplete/style/css.d.ts +3 -0
- package/lib/autocomplete/style/index.d.ts +3 -0
- package/lib/color-picker/index.d.ts +2 -0
- package/lib/color-picker/src/color-picker.d.ts +30 -0
- package/lib/color-picker/src/color-picker.js +1 -0
- package/lib/color-picker/style/css.d.ts +3 -0
- package/lib/color-picker/style/index.d.ts +3 -0
- package/lib/components/autocomplete/index.js +1 -0
- package/lib/components/autocomplete/style/css.js +1 -0
- package/lib/components/autocomplete/style/index.js +1 -0
- package/lib/components/color-picker/index.js +1 -0
- package/lib/components/color-picker/style/css.js +1 -0
- package/lib/components/color-picker/style/index.js +1 -0
- package/lib/components/config-provider/index.js +1 -0
- package/lib/components/config-provider/style/css.js +1 -0
- package/lib/components/config-provider/style/index.js +1 -0
- package/lib/components/icon/index.js +1 -0
- package/lib/components/icon/style/css.js +1 -0
- package/lib/components/icon/style/index.js +1 -0
- package/lib/components/pro-form/index.js +1 -0
- package/lib/components/pro-form/style/css.js +1 -0
- package/lib/components/pro-form/style/index.js +1 -0
- package/lib/components/pro-table/index.js +1 -0
- package/lib/components/pro-table/style/css.js +1 -0
- package/lib/components/pro-table/style/index.js +1 -0
- package/lib/components/select-v2/index.js +1 -0
- package/lib/components/select-v2/style/css.js +1 -0
- package/lib/components/select-v2/style/index.js +1 -0
- package/lib/components/slider/index.js +1 -0
- package/lib/components/slider/style/css.js +1 -0
- package/lib/components/slider/style/index.js +1 -0
- package/lib/components/tree-select/index.js +1 -0
- package/lib/components/tree-select/style/css.js +1 -0
- package/lib/components/tree-select/style/index.js +1 -0
- package/lib/config-provider/index.d.ts +2 -0
- package/lib/config-provider/src/config-provider.d.ts +25 -0
- package/lib/config-provider/src/config-provider.js +1 -0
- package/lib/config-provider/style/css.d.ts +2 -0
- package/lib/config-provider/style/index.d.ts +2 -0
- package/lib/icon/index.d.ts +2 -0
- package/lib/icon/src/icon.d.ts +25 -0
- package/lib/icon/src/icon.js +1 -0
- package/lib/icon/style/css.d.ts +2 -0
- package/lib/icon/style/index.d.ts +2 -0
- package/lib/index.d.ts +9 -1
- package/lib/index.js +1 -1
- package/lib/pro-form/index.d.ts +2 -0
- package/lib/pro-form/src/ProForm.vue.js +1 -0
- package/lib/pro-form/src/ProForm.vue2.js +1 -0
- package/lib/pro-form/src/ProFormItem.vue.js +1 -0
- package/lib/pro-form/src/ProFormItem.vue2.js +1 -0
- package/lib/pro-form/src/pro-form.d.ts +14 -0
- package/lib/pro-form/src/pro-form.js +1 -0
- package/lib/pro-form/src/types.d.ts +72 -0
- package/lib/pro-form/style/css.d.ts +38 -0
- package/lib/pro-form/style/index.d.ts +38 -0
- package/lib/pro-table/index.d.ts +2 -0
- package/lib/pro-table/src/ColSetting.vue.js +4 -0
- package/lib/pro-table/src/ColSetting.vue2.js +1 -0
- package/lib/pro-table/src/ProTable.vue.js +1 -0
- package/lib/pro-table/src/ProTable.vue2.js +1 -0
- package/lib/pro-table/src/ProTableColumn.vue.js +1 -0
- package/lib/pro-table/src/ProTableColumn.vue2.js +1 -0
- package/lib/pro-table/src/context.d.ts +40 -0
- package/lib/pro-table/src/hooks/use-pro-table.d.ts +5 -0
- package/lib/pro-table/src/hooks/use-pro-table.js +1 -0
- package/lib/pro-table/src/hooks/use-selection.d.ts +8 -0
- package/lib/pro-table/src/hooks/use-selection.js +1 -0
- package/lib/pro-table/src/hooks/use-table.d.ts +31 -0
- package/lib/pro-table/src/hooks/use-table.js +1 -0
- package/lib/pro-table/src/pro-table.d.ts +10 -0
- package/lib/pro-table/src/pro-table.js +1 -0
- package/lib/pro-table/src/shared/ProTableColSetting.vue.js +1 -0
- package/lib/pro-table/src/shared/ProTableColSetting.vue2.js +1 -0
- package/lib/pro-table/src/shared/ProTablePagination.vue.js +1 -0
- package/lib/pro-table/src/shared/ProTablePagination.vue2.js +1 -0
- package/lib/pro-table/src/shared/ProTableSearchRenderer.vue.js +1 -0
- package/lib/pro-table/src/shared/ProTableSearchRenderer.vue2.js +1 -0
- package/lib/pro-table/src/shared/ProTableTable.vue.js +1 -0
- package/lib/pro-table/src/shared/ProTableTable.vue2.js +1 -0
- package/lib/pro-table/src/types.d.ts +116 -0
- package/lib/pro-table/src/variants/classic/ClassicLayout.vue.js +1 -0
- package/lib/pro-table/src/variants/classic/ClassicLayout.vue2.js +1 -0
- package/lib/pro-table/src/variants/classic/index.d.ts +2 -0
- package/lib/pro-table/src/variants/custom/CustomLayout.vue.js +1 -0
- package/lib/pro-table/src/variants/custom/CustomLayout.vue2.js +1 -0
- package/lib/pro-table/src/variants/custom/index.d.ts +2 -0
- package/lib/pro-table/src/variants/unify/UnifyLayout.vue.js +1 -0
- package/lib/pro-table/src/variants/unify/UnifyLayout.vue2.js +1 -0
- package/lib/pro-table/src/variants/unify/UnifyQuickSearch.vue.js +1 -0
- package/lib/pro-table/src/variants/unify/UnifyQuickSearch.vue2.js +1 -0
- package/lib/pro-table/src/variants/unify/UnifySearchPanel.vue.js +1 -0
- package/lib/pro-table/src/variants/unify/UnifySearchPanel.vue2.js +1 -0
- package/lib/pro-table/src/variants/unify/index.d.ts +2 -0
- package/lib/pro-table/style/css.d.ts +19 -0
- package/lib/pro-table/style/index.d.ts +19 -0
- package/lib/select-v2/index.d.ts +2 -0
- package/lib/select-v2/src/select-v2.d.ts +30 -0
- package/lib/select-v2/src/select-v2.js +1 -0
- package/lib/select-v2/style/css.d.ts +3 -0
- package/lib/select-v2/style/index.d.ts +3 -0
- package/lib/slider/index.d.ts +2 -0
- package/lib/slider/src/slider.d.ts +25 -0
- package/lib/slider/src/slider.js +1 -0
- package/lib/slider/style/css.d.ts +3 -0
- package/lib/slider/style/index.d.ts +3 -0
- package/lib/tree-select/index.d.ts +2 -0
- package/lib/tree-select/src/tree-select.d.ts +30 -0
- package/lib/tree-select/src/tree-select.js +1 -0
- package/lib/tree-select/style/css.d.ts +3 -0
- package/lib/tree-select/style/index.d.ts +3 -0
- package/package.json +9 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import f from"./ProForm.vue.mjs";export{f as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var _=Object.defineProperty,q=Object.defineProperties;var D=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var j=(e,c,u)=>c in e?_(e,c,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[c]=u,t=(e,c)=>{for(var u in c||(c={}))E.call(c,u)&&j(e,u,c[u]);if(O)for(var u of O(c))G.call(c,u)&&j(e,u,c[u]);return e},n=(e,c)=>q(e,D(c));import{defineComponent as K,inject as U,computed as s,h as d,withCtx as $}from"vue";import{SyInput as A}from"../../input/src/input.mjs";import{SyInputNumber as z}from"../../input-number/src/input-number.mjs";import{SySelect as B,SyOption as F}from"../../select/src/select.mjs";import{SyCascader as L}from"../../cascader/src/cascader.mjs";import{SyDatePicker as W}from"../../date-picker/src/date-picker.mjs";import{SyTimePicker as H}from"../../time-picker/src/time-picker.mjs";import{SyTimeSelect as J}from"../../time-select/src/time-select.mjs";import{SySwitch as Q}from"../../switch/src/switch.mjs";import{SyRadioGroup as Y,SyRadio as Z}from"../../radio/src/radio.mjs";import{SyRadioButton as X}from"../../radio/src/radio-button.mjs";import{SyCheckboxGroup as ee,SyCheckbox as le}from"../../checkbox/src/checkbox.mjs";import{AdapterSelectV2 as ae,AdapterTreeSelect as te,AdapterColorPicker as re,AdapterSlider as ce,AdapterAutocomplete as oe}from"@sunyard-szyy-ui/adapter";const ue={input:A,"input-number":z,"time-picker":H,"time-select":J,autocomplete:oe,switch:Q,slider:ce,"color-picker":re},w={input:e=>({placeholder:e.placeholder,clearable:e.clearable,style:"width: 100%"}),"input-number":e=>({placeholder:e.placeholder,style:"width: 100%"}),"time-picker":e=>({placeholder:e.placeholder,clearable:e.clearable,style:"width: 100%"}),"time-select":e=>({placeholder:e.placeholder,clearable:e.clearable,style:"width: 100%"}),autocomplete:e=>({placeholder:e.placeholder,clearable:e.clearable,style:"width: 100%"}),switch:()=>({}),slider:()=>({style:"width: 100%; padding: 0 6px"}),"color-picker":()=>({})};function ne(e){return e?Object.fromEntries(Object.entries(e).map(([c,u])=>[c.startsWith("on")?c:`on${c[0].toUpperCase()}${c.slice(1)}`,u])):{}}const ke=K({name:"ProFormItem",props:{schema:{type:Object,required:!0},model:{type:Object,required:!0},modelValue:{default:void 0}},emits:["update:modelValue"],setup(e,{emit:c}){const u=U("proTableEnumMap",{value:new Map}),y=s({get:()=>e.modelValue,set:l=>c("update:modelValue",l)}),b=s(()=>{var l,a;return(a=(l=e.schema.fieldNames)==null?void 0:l.label)!=null?a:"label"}),m=s(()=>{var l,a;return(a=(l=e.schema.fieldNames)==null?void 0:l.value)!=null?a:"value"}),g=s(()=>{var l,a;return(a=(l=e.schema.fieldNames)==null?void 0:l.children)!=null?a:"children"}),v=s(()=>{var l,a;return(l=e.schema.options)!=null&&l.length?e.schema.options:(a=u.value.get(e.schema.field))!=null?a:[]}),M=s(()=>{const{label:l,value:a}={label:b.value,value:m.value};return l==="label"&&a==="value"?v.value:v.value.map(r=>n(t({},r),{label:r[l],value:r[a]}))}),I=s(()=>{const l=t({},e.schema.props),{label:a,value:r,children:o}={label:b.value,value:m.value,children:g.value};return n(t({},l),{props:n(t({},l.props),{label:a,children:o}),nodeKey:r})}),N=s(()=>{const l=t({},e.schema.props),{label:a,value:r,children:o}={label:b.value,value:m.value,children:g.value};return n(t({},l),{props:n(t({},l.props),{label:a,value:r,children:o})})}),f=s(()=>t({},e.schema.props)),R=s(()=>{var a,r,o;const l=(r=(a=e.schema.props)==null?void 0:a.type)!=null?r:"";return["daterange","datetimerange","monthrange","yearrange"].includes(l)||!!((o=e.schema.props)!=null&&o.isRange)}),h=s(()=>{var a,r;if(((a=e.schema.props)==null?void 0:a.placeholder)!=null)return e.schema.props.placeholder;const l=(r=e.schema.component)!=null?r:"input";return["input","input-number","autocomplete"].includes(l)?"请输入":"请选择"}),p=s(()=>{var l;return((l=e.schema.props)==null?void 0:l.clearable)!=null?e.schema.props.clearable:e.schema.defaultValue==null}),T=s(()=>{var a,r,o;const l=t({},e.schema.props);return R.value?n(t({},l),{rangeSeparator:(a=l.rangeSeparator)!=null?a:"至",startPlaceholder:(r=l.startPlaceholder)!=null?r:"开始时间",endPlaceholder:(o=l.endPlaceholder)!=null?o:"结束时间",clearable:p.value}):n(t({},l),{placeholder:h.value,clearable:p.value})});return()=>{var k,V,C,x;const{schema:l}=e,a=(k=l.component)!=null?k:"input",r=ne(l.events),o={modelValue:y.value,"onUpdate:modelValue":i=>y.value=i};if(l.render)return l.render(e.model);if(a==="text")return d("span",{class:"sy-pro-form-item__text"},String((V=y.value)!=null?V:""));if(a==="select")return d(B,n(t(t(t({},o),f.value),r),{placeholder:h.value,clearable:p.value,style:"width: 100%"}),{default:$(()=>v.value.map(i=>d(F,{key:i[m.value],label:i[b.value],value:i[m.value]})))});if(a==="select-v2")return d(ae,n(t(t(t({},o),f.value),r),{placeholder:h.value,clearable:p.value,options:M.value,style:"width: 100%"}));if(a==="tree-select")return d(te,n(t(t(t({},o),I.value),r),{placeholder:h.value,clearable:p.value,data:v.value,style:"width: 100%"}));if(a==="cascader")return d(L,n(t(t(t({},o),N.value),r),{placeholder:h.value,clearable:p.value,options:v.value,style:"width: 100%"}));if(a==="radio"||a==="radio-button"){const i=a==="radio"?Z:X;return d(Y,t(t(t({},o),f.value),r),{default:()=>v.value.map(S=>d(i,{key:S[m.value],value:S[m.value]},{default:()=>String(S[b.value])}))})}if(a==="checkbox")return d(ee,t(t(t({},o),f.value),r),{default:()=>v.value.map(i=>d(le,{key:i[m.value],value:i[m.value]},{default:()=>String(i[b.value])}))});if(a==="date-picker")return d(W,n(t(t(t({},o),T.value),r),{style:"width: 100%"}));const P=ue[a];if(P){const i=(x=(C=w[a])==null?void 0:C.call(w,{placeholder:h.value,clearable:p.value}))!=null?x:{};return d(P,t(t(t(t({},o),f.value),r),i))}return d(A,n(t(t(t({},o),f.value),r),{placeholder:h.value,clearable:p.value,style:"width: 100%"}))}}});export{ke as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import f from"./ProFormItem.vue.mjs";export{f as default};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import ProForm from './ProForm.vue';
|
|
2
|
+
export declare const SyProForm: import("@sunyard-szyy-ui/utils").SFCWithInstall<{
|
|
3
|
+
new (...args: any[]): any;
|
|
4
|
+
__isFragment?: never;
|
|
5
|
+
__isTeleport?: never;
|
|
6
|
+
__isSuspense?: never;
|
|
7
|
+
} & import("vue").ComponentOptionsBase<object, object, any, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps>;
|
|
8
|
+
export type SyProFormInstance = InstanceType<typeof ProForm> & {
|
|
9
|
+
validate: (cb?: (valid: boolean) => void) => void;
|
|
10
|
+
resetFields: () => void;
|
|
11
|
+
clearValidate: (props?: string | string[]) => void;
|
|
12
|
+
};
|
|
13
|
+
export type { ProFormSchema, ProFormComponentType, ProFormProps, BreakPoint } from './types';
|
|
14
|
+
//# sourceMappingURL=pro-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pro-form.d.ts","sourceRoot":"","sources":["../../../src/pro-form/src/pro-form.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,eAAe,CAAC;AAEpC,eAAO,MAAM,SAAS;;;;;ubAAuB,CAAC;AAC9C,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,OAAO,OAAO,CAAC,GAAG;IAC7D,QAAQ,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,KAAK,IAAI,CAAC;IAClD,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,aAAa,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;CACpD,CAAC;AAEF,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{withInstall as o}from"@sunyard-szyy-ui/utils";import r from"./ProForm.vue.mjs";const i=o(r);export{i as SyProForm};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
export type BreakPoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
export type ProFormComponentType = 'input' | 'input-number' | 'select' | 'select-v2' | 'tree-select' | 'cascader' | 'date-picker' | 'time-picker' | 'time-select' | 'switch' | 'radio' | 'radio-button' | 'checkbox' | 'slider' | 'color-picker' | 'autocomplete' | 'text' | 'slot';
|
|
4
|
+
export interface ProFormSchema {
|
|
5
|
+
field: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
tooltip?: string;
|
|
8
|
+
component?: ProFormComponentType;
|
|
9
|
+
props?: Record<string, any>;
|
|
10
|
+
events?: Record<string, any>;
|
|
11
|
+
options?: Array<{
|
|
12
|
+
label: string;
|
|
13
|
+
value: any;
|
|
14
|
+
} & Record<string, any>>;
|
|
15
|
+
fieldNames?: {
|
|
16
|
+
label?: string;
|
|
17
|
+
value?: string;
|
|
18
|
+
children?: string;
|
|
19
|
+
};
|
|
20
|
+
rules?: any[];
|
|
21
|
+
defaultValue?: any;
|
|
22
|
+
span?: number;
|
|
23
|
+
offset?: number;
|
|
24
|
+
xs?: {
|
|
25
|
+
span?: number;
|
|
26
|
+
offset?: number;
|
|
27
|
+
};
|
|
28
|
+
sm?: {
|
|
29
|
+
span?: number;
|
|
30
|
+
offset?: number;
|
|
31
|
+
};
|
|
32
|
+
md?: {
|
|
33
|
+
span?: number;
|
|
34
|
+
offset?: number;
|
|
35
|
+
};
|
|
36
|
+
lg?: {
|
|
37
|
+
span?: number;
|
|
38
|
+
offset?: number;
|
|
39
|
+
};
|
|
40
|
+
xl?: {
|
|
41
|
+
span?: number;
|
|
42
|
+
offset?: number;
|
|
43
|
+
};
|
|
44
|
+
hidden?: boolean | ((model: Record<string, any>) => boolean);
|
|
45
|
+
labelWidth?: string | number;
|
|
46
|
+
order?: number;
|
|
47
|
+
render?: (model: Record<string, any>) => VNode;
|
|
48
|
+
}
|
|
49
|
+
export interface ProFormProps {
|
|
50
|
+
model: Record<string, any>;
|
|
51
|
+
schema: ProFormSchema[];
|
|
52
|
+
cols?: number | Partial<Record<BreakPoint, number>>;
|
|
53
|
+
labelWidth?: string | number;
|
|
54
|
+
labelPosition?: 'left' | 'right' | 'top';
|
|
55
|
+
disabled?: boolean;
|
|
56
|
+
size?: 'large' | 'default' | 'small';
|
|
57
|
+
showQueryBtn?: boolean;
|
|
58
|
+
showResetBtn?: boolean;
|
|
59
|
+
queryBtnText?: string;
|
|
60
|
+
resetBtnText?: string;
|
|
61
|
+
loading?: boolean;
|
|
62
|
+
/** false / undefined:不折叠;true:折叠展示 1 行;number:折叠展示 N 行 */
|
|
63
|
+
collapsible?: boolean | number;
|
|
64
|
+
defaultCollapsed?: boolean;
|
|
65
|
+
/** 按钮区对齐:inline(网格内贴右)| left | center | right(独立成行) */
|
|
66
|
+
buttonAlign?: 'inline' | 'left' | 'center' | 'right';
|
|
67
|
+
}
|
|
68
|
+
export interface Responsive {
|
|
69
|
+
span?: number;
|
|
70
|
+
offset?: number;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/pro-form/src/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import 'element-plus/es/components/form/style/css';
|
|
2
|
+
import 'element-plus/es/components/form-item/style/css';
|
|
3
|
+
import 'element-plus/es/components/button/style/css';
|
|
4
|
+
import 'element-plus/es/components/input/style/css';
|
|
5
|
+
import 'element-plus/es/components/input-number/style/css';
|
|
6
|
+
import 'element-plus/es/components/select/style/css';
|
|
7
|
+
import 'element-plus/es/components/select-v2/style/css';
|
|
8
|
+
import 'element-plus/es/components/cascader/style/css';
|
|
9
|
+
import 'element-plus/es/components/date-picker/style/css';
|
|
10
|
+
import 'element-plus/es/components/time-picker/style/css';
|
|
11
|
+
import 'element-plus/es/components/time-select/style/css';
|
|
12
|
+
import 'element-plus/es/components/switch/style/css';
|
|
13
|
+
import 'element-plus/es/components/radio/style/css';
|
|
14
|
+
import 'element-plus/es/components/radio-button/style/css';
|
|
15
|
+
import 'element-plus/es/components/radio-group/style/css';
|
|
16
|
+
import 'element-plus/es/components/checkbox/style/css';
|
|
17
|
+
import 'element-plus/es/components/checkbox-group/style/css';
|
|
18
|
+
import 'element-plus/es/components/slider/style/css';
|
|
19
|
+
import 'element-plus/es/components/color-picker/style/css';
|
|
20
|
+
import 'element-plus/es/components/autocomplete/style/css';
|
|
21
|
+
import 'element-plus/es/components/tree-select/style/css';
|
|
22
|
+
import 'element-plus/es/components/tooltip/style/css';
|
|
23
|
+
import 'element-plus/es/components/icon/style/css';
|
|
24
|
+
import 'sunyard-szyy-ui/theme-chalk/form.css';
|
|
25
|
+
import 'sunyard-szyy-ui/theme-chalk/button.css';
|
|
26
|
+
import 'sunyard-szyy-ui/theme-chalk/input.css';
|
|
27
|
+
import 'sunyard-szyy-ui/theme-chalk/input-number.css';
|
|
28
|
+
import 'sunyard-szyy-ui/theme-chalk/select.css';
|
|
29
|
+
import 'sunyard-szyy-ui/theme-chalk/cascader.css';
|
|
30
|
+
import 'sunyard-szyy-ui/theme-chalk/date-picker.css';
|
|
31
|
+
import 'sunyard-szyy-ui/theme-chalk/time-picker.css';
|
|
32
|
+
import 'sunyard-szyy-ui/theme-chalk/time-select.css';
|
|
33
|
+
import 'sunyard-szyy-ui/theme-chalk/switch.css';
|
|
34
|
+
import 'sunyard-szyy-ui/theme-chalk/radio.css';
|
|
35
|
+
import 'sunyard-szyy-ui/theme-chalk/checkbox.css';
|
|
36
|
+
import 'sunyard-szyy-ui/theme-chalk/tooltip.css';
|
|
37
|
+
import 'sunyard-szyy-ui/theme-chalk/pro-form.css';
|
|
38
|
+
//# sourceMappingURL=css.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../../src/pro-form/style/css.ts"],"names":[],"mappings":"AACA,OAAO,2CAA2C,CAAC;AACnD,OAAO,gDAAgD,CAAC;AACxD,OAAO,6CAA6C,CAAC;AACrD,OAAO,4CAA4C,CAAC;AACpD,OAAO,mDAAmD,CAAC;AAC3D,OAAO,6CAA6C,CAAC;AACrD,OAAO,gDAAgD,CAAC;AACxD,OAAO,+CAA+C,CAAC;AACvD,OAAO,kDAAkD,CAAC;AAC1D,OAAO,kDAAkD,CAAC;AAC1D,OAAO,kDAAkD,CAAC;AAC1D,OAAO,6CAA6C,CAAC;AACrD,OAAO,4CAA4C,CAAC;AACpD,OAAO,mDAAmD,CAAC;AAC3D,OAAO,kDAAkD,CAAC;AAC1D,OAAO,+CAA+C,CAAC;AACvD,OAAO,qDAAqD,CAAC;AAC7D,OAAO,6CAA6C,CAAC;AACrD,OAAO,mDAAmD,CAAC;AAC3D,OAAO,mDAAmD,CAAC;AAC3D,OAAO,kDAAkD,CAAC;AAC1D,OAAO,8CAA8C,CAAC;AACtD,OAAO,2CAA2C,CAAC;AAGnD,OAAO,sCAAsC,CAAC;AAC9C,OAAO,wCAAwC,CAAC;AAChD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,8CAA8C,CAAC;AACtD,OAAO,wCAAwC,CAAC;AAChD,OAAO,0CAA0C,CAAC;AAClD,OAAO,6CAA6C,CAAC;AACrD,OAAO,6CAA6C,CAAC;AACrD,OAAO,6CAA6C,CAAC;AACrD,OAAO,wCAAwC,CAAC;AAChD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,0CAA0C,CAAC;AAClD,OAAO,yCAAyC,CAAC;AAGjD,OAAO,0CAA0C,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import 'element-plus/es/components/form/style/css';
|
|
2
|
+
import 'element-plus/es/components/form-item/style/css';
|
|
3
|
+
import 'element-plus/es/components/button/style/css';
|
|
4
|
+
import 'element-plus/es/components/input/style/css';
|
|
5
|
+
import 'element-plus/es/components/input-number/style/css';
|
|
6
|
+
import 'element-plus/es/components/select/style/css';
|
|
7
|
+
import 'element-plus/es/components/select-v2/style/css';
|
|
8
|
+
import 'element-plus/es/components/cascader/style/css';
|
|
9
|
+
import 'element-plus/es/components/date-picker/style/css';
|
|
10
|
+
import 'element-plus/es/components/time-picker/style/css';
|
|
11
|
+
import 'element-plus/es/components/time-select/style/css';
|
|
12
|
+
import 'element-plus/es/components/switch/style/css';
|
|
13
|
+
import 'element-plus/es/components/radio/style/css';
|
|
14
|
+
import 'element-plus/es/components/radio-button/style/css';
|
|
15
|
+
import 'element-plus/es/components/radio-group/style/css';
|
|
16
|
+
import 'element-plus/es/components/checkbox/style/css';
|
|
17
|
+
import 'element-plus/es/components/checkbox-group/style/css';
|
|
18
|
+
import 'element-plus/es/components/slider/style/css';
|
|
19
|
+
import 'element-plus/es/components/color-picker/style/css';
|
|
20
|
+
import 'element-plus/es/components/autocomplete/style/css';
|
|
21
|
+
import 'element-plus/es/components/tree-select/style/css';
|
|
22
|
+
import 'element-plus/es/components/tooltip/style/css';
|
|
23
|
+
import 'element-plus/es/components/icon/style/css';
|
|
24
|
+
import 'sunyard-szyy-ui/theme-chalk/src/form.scss';
|
|
25
|
+
import 'sunyard-szyy-ui/theme-chalk/src/button.scss';
|
|
26
|
+
import 'sunyard-szyy-ui/theme-chalk/src/input.scss';
|
|
27
|
+
import 'sunyard-szyy-ui/theme-chalk/src/input-number.scss';
|
|
28
|
+
import 'sunyard-szyy-ui/theme-chalk/src/select.scss';
|
|
29
|
+
import 'sunyard-szyy-ui/theme-chalk/src/cascader.scss';
|
|
30
|
+
import 'sunyard-szyy-ui/theme-chalk/src/date-picker.scss';
|
|
31
|
+
import 'sunyard-szyy-ui/theme-chalk/src/time-picker.scss';
|
|
32
|
+
import 'sunyard-szyy-ui/theme-chalk/src/time-select.scss';
|
|
33
|
+
import 'sunyard-szyy-ui/theme-chalk/src/switch.scss';
|
|
34
|
+
import 'sunyard-szyy-ui/theme-chalk/src/radio.scss';
|
|
35
|
+
import 'sunyard-szyy-ui/theme-chalk/src/checkbox.scss';
|
|
36
|
+
import 'sunyard-szyy-ui/theme-chalk/src/tooltip.scss';
|
|
37
|
+
import 'sunyard-szyy-ui/theme-chalk/src/pro-form.scss';
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pro-form/style/index.ts"],"names":[],"mappings":"AACA,OAAO,2CAA2C,CAAC;AACnD,OAAO,gDAAgD,CAAC;AACxD,OAAO,6CAA6C,CAAC;AACrD,OAAO,4CAA4C,CAAC;AACpD,OAAO,mDAAmD,CAAC;AAC3D,OAAO,6CAA6C,CAAC;AACrD,OAAO,gDAAgD,CAAC;AACxD,OAAO,+CAA+C,CAAC;AACvD,OAAO,kDAAkD,CAAC;AAC1D,OAAO,kDAAkD,CAAC;AAC1D,OAAO,kDAAkD,CAAC;AAC1D,OAAO,6CAA6C,CAAC;AACrD,OAAO,4CAA4C,CAAC;AACpD,OAAO,mDAAmD,CAAC;AAC3D,OAAO,kDAAkD,CAAC;AAC1D,OAAO,+CAA+C,CAAC;AACvD,OAAO,qDAAqD,CAAC;AAC7D,OAAO,6CAA6C,CAAC;AACrD,OAAO,mDAAmD,CAAC;AAC3D,OAAO,mDAAmD,CAAC;AAC3D,OAAO,kDAAkD,CAAC;AAC1D,OAAO,8CAA8C,CAAC;AACtD,OAAO,2CAA2C,CAAC;AAGnD,OAAO,2CAA2C,CAAC;AACnD,OAAO,6CAA6C,CAAC;AACrD,OAAO,4CAA4C,CAAC;AACpD,OAAO,mDAAmD,CAAC;AAC3D,OAAO,6CAA6C,CAAC;AACrD,OAAO,+CAA+C,CAAC;AACvD,OAAO,kDAAkD,CAAC;AAC1D,OAAO,kDAAkD,CAAC;AAC1D,OAAO,kDAAkD,CAAC;AAC1D,OAAO,6CAA6C,CAAC;AACrD,OAAO,4CAA4C,CAAC;AACpD,OAAO,+CAA+C,CAAC;AACvD,OAAO,8CAA8C,CAAC;AAGtD,OAAO,+CAA+C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pro-table/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{defineComponent as V,ref as _,computed as d,openBlock as p,createBlock as h,unref as o,withCtx as n,createCommentVNode as u,createVNode as r,createTextVNode as k,toDisplayString as w,createElementBlock as C,createElementVNode as U}from"vue";import{SyDrawer as N}from"../../drawer/src/drawer.mjs";import{SyTable as B,SyTableColumn as c}from"../../table/src/table.mjs";import{SySwitch as y}from"../../switch/src/switch.mjs";const E={key:1,style:{color:"var(--el-text-color-placeholder)"}},I=V({__name:"ColSetting",props:{columns:{}},setup(b,{expose:v}){const S=b,i=_(!1),s=d(()=>S.columns.filter(e=>{if(e.type&&["selection","index","expand","radio","sort"].includes(e.type))return!1;const l=e.isSetting;return l===void 0||l===!0}));d(()=>s.value.every(e=>e.isShow!==!1)),d(()=>{const e=s.value.length,l=s.value.filter(t=>t.isShow!==!1).length;return l>0&&l<e});const m=new WeakMap;function x(){s.value.forEach(e=>{m.has(e)||m.set(e,{isShow:e.isShow!==!1,sortable:e.sortable})})}function g(){x(),i.value=!0}return v({open:g}),(e,l)=>(p(),h(o(N),{modelValue:i.value,"onUpdate:modelValue":l[0]||(l[0]=t=>i.value=t),title:"列设置",size:"380px","append-to-body":!0,class:"sy-pro-table__col-setting"},{default:n(()=>[u(" 全选 + 重置 "),u(` <div class="sy-pro-table__col-setting-toolbar">
|
|
2
|
+
<sy-checkbox :model-value="checkAll" :indeterminate="isIndeterminate" @change="onCheckAll"> 全部显示 </sy-checkbox>
|
|
3
|
+
<sy-button type="primary" link @click="onReset">重置</sy-button>
|
|
4
|
+
</div> `),u(" 列配置表格 "),r(o(B),{data:s.value,"row-key":"prop",border:!0,"default-expand-all":"","tree-props":{children:"_children"}},{empty:n(()=>[...l[1]||(l[1]=[U("div",{style:{padding:"24px 0",color:"var(--el-text-color-secondary)","font-size":"13px"}},"暂无可配置列",-1)])]),default:n(()=>[r(o(c),{prop:"label",label:"列名",align:"left","min-width":"100"},{default:n(({row:t})=>{var a,f;return[k(w((f=(a=t.label)!=null?a:t.prop)!=null?f:"—"),1)]}),_:1}),r(o(c),{prop:"isShow",label:"显示",align:"center",width:"80"},{default:n(({row:t})=>[r(o(y),{"model-value":t.isShow!==!1,"onUpdate:modelValue":a=>{t.isShow=a}},null,8,["model-value","onUpdate:modelValue"])]),_:1}),r(o(c),{prop:"sortable",label:"排序",align:"center",width:"80"},{default:n(({row:t})=>[typeof t.sortable=="boolean"?(p(),h(o(y),{key:0,modelValue:t.sortable,"onUpdate:modelValue":a=>t.sortable=a},null,8,["modelValue","onUpdate:modelValue"])):(p(),C("span",E,"—"))]),_:1})]),_:1},8,["data"])]),_:1},8,["modelValue"]))}});export{I as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import f from"./ColSetting.vue.mjs";export{f as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as $,useSlots as B,openBlock as p,createBlock as d,unref as n,createSlots as f,withCtx as a,renderSlot as o,normalizeProps as m,guardReactiveProps as u}from"vue";import{useProTable as b}from"./hooks/use-pro-table.mjs";import k from"./variants/classic/ClassicLayout.vue.mjs";import S from"./variants/custom/CustomLayout.vue.mjs";import v from"./variants/unify/UnifyLayout.vue.mjs";const T=$({name:"SyProTable",inheritAttrs:!1,__name:"ProTable",props:{columns:{},data:{},request:{},params:{},postData:{},requestError:{},manualRequest:{type:Boolean,default:!1},pagination:{type:Boolean,default:!0},rowKey:{default:"id"},border:{type:Boolean,default:!1},stripe:{type:Boolean,default:!1},showSearch:{type:Boolean,default:!0},searchCols:{default:4},toolButton:{type:[Boolean,Array],default:!0},highlightCurrentRow:{type:Boolean,default:!1},size:{},pageSizes:{default:()=>[10,20,50,100]},pageLayout:{default:"total, sizes, prev, pager, next, jumper"},type:{default:"classic"}},emits:["search","reset","dragSort"],setup(c,{expose:g,emit:h}){const r=c,y=h,s=B(),e=b(r,y,s);function i(t){y("dragSort",t)}return g({tableRef:e.tableRef,formRef:e.formRef,tableData:e.tableData,enumMap:e.enumMap,pageable:e.pageable,searchParam:e.searchParam,searchInitParam:e.searchInitParam,isSelected:e.isSelected,selectedList:e.selectedList,selectedListIds:e.selectedListIds,radio:e.radio,getTableList:e.getTableList,search:e.search,reset:e.reset,clearSelection:e.clearSelection,clearRadio:e.clearRadio,handleSizeChange:e.handleSizeChange,handleCurrentChange:e.handleCurrentChange}),(t,C)=>r.type==="classic"?(p(),d(k,{key:0,context:n(e),"on-drag-sort":i},f({tableHeader:a(l=>[o(t.$slots,"tableHeader",m(u(l)))]),default:a(()=>[o(t.$slots,"default")]),_:2},[n(s).toolButton?{name:"toolButton",fn:a(()=>[o(t.$slots,"toolButton")]),key:"0"}:void 0,n(s).append?{name:"append",fn:a(()=>[o(t.$slots,"append")]),key:"1"}:void 0,n(s).empty?{name:"empty",fn:a(()=>[o(t.$slots,"empty")]),key:"2"}:void 0,n(s).pagination?{name:"pagination",fn:a(()=>[o(t.$slots,"pagination")]),key:"3"}:void 0]),1032,["context"])):r.type==="unify"?(p(),d(v,{key:1,context:n(e),"on-drag-sort":i},f({tableHeader:a(l=>[o(t.$slots,"tableHeader",m(u(l)))]),default:a(()=>[o(t.$slots,"default")]),_:2},[n(s).toolButton?{name:"toolButton",fn:a(()=>[o(t.$slots,"toolButton")]),key:"0"}:void 0,n(s).append?{name:"append",fn:a(()=>[o(t.$slots,"append")]),key:"1"}:void 0,n(s).empty?{name:"empty",fn:a(()=>[o(t.$slots,"empty")]),key:"2"}:void 0,n(s).pagination?{name:"pagination",fn:a(()=>[o(t.$slots,"pagination")]),key:"3"}:void 0]),1032,["context"])):(p(),d(S,{key:2,context:n(e),"on-drag-sort":i},f({tableHeader:a(l=>[o(t.$slots,"tableHeader",m(u(l)))]),default:a(()=>[o(t.$slots,"default")]),_:2},[n(s).toolButton?{name:"toolButton",fn:a(()=>[o(t.$slots,"toolButton")]),key:"0"}:void 0,n(s).append?{name:"append",fn:a(()=>[o(t.$slots,"append")]),key:"1"}:void 0,n(s).empty?{name:"empty",fn:a(()=>[o(t.$slots,"empty")]),key:"2"}:void 0,n(s).pagination?{name:"pagination",fn:a(()=>[o(t.$slots,"pagination")]),key:"3"}:void 0]),1032,["context"]))}});export{T as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import f from"./ProTable.vue.mjs";export{f as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as C,inject as E,computed as V,unref as u,resolveComponent as $,openBlock as m,createElementBlock as f,Fragment as y,createCommentVNode as g,createBlock as j,withCtx as s,renderList as z,createVNode as a,normalizeProps as x,guardReactiveProps as S,mergeProps as F,h as v}from"vue";import{DCaret as A}from"@element-plus/icons-vue";import{SyTableColumn as b}from"../../table/src/table.mjs";import{SyTag as k}from"../../tag/src/tag.mjs";import{SyIcon as D}from"../../icon/src/icon.mjs";import{SyRadio as I}from"../../radio/src/radio.mjs";const X=C({__name:"ProTableColumn",props:{column:{}},emits:["radioChange"],setup(l){const i=l,w=E("proTableEnumMap",{value:new Map}),d=E("proTableSlots",{}),H=V(()=>{const e=i.column.isShow;return e===void 0?!0:u(e)}),T=V(()=>{var t,o,r,n;const e=i.column.enum;return typeof e=="function"?(o=w.value.get((t=i.column.prop)!=null?t:""))!=null?o:[]:e?u(e):(n=w.value.get((r=i.column.prop)!=null?r:""))!=null?n:[]});function P(e){var c,h;const{fieldNames:t}=i.column,o=(c=t==null?void 0:t.label)!=null?c:"label",r=(h=t==null?void 0:t.value)!=null?h:"value",n=T.value.find(p=>p[r]===e);return n?n[o]:String(e!=null?e:"")}function q(e){var n;const{fieldNames:t}=i.column,o=(n=t==null?void 0:t.value)!=null?n:"value",r=T.value.find(c=>c[o]===e);return(r==null?void 0:r.tagType)||void 0}function R(e){return e.split(".").reduce((o,r,n)=>n===0?o+r:o+r.charAt(0).toUpperCase()+r.slice(1),"")}function B(e){var h;const{column:t}=i;if(t.render)return t.render(e);if(t.type==="expand"){const p="expand";return d[p]?d[p](e):null}const o=(h=t.prop)!=null?h:"",r=e.row[o],n=R(o);if(d[n])return d[n](e);if(t.isFilterEnum!==!1&&T.value.length>0){if(t.tag){const p=q(r);return v(k,p?{type:p}:{},()=>P(r))}return v("span",{},P(r))}return t.tag?v(k,{},()=>String(r!=null?r:"")):v("span",{},String(r!=null?r:""))}function L(e){var r,n;const{column:t}=i;if(t.headerRender)return t.headerRender(e);const o=`${R((r=t.prop)!=null?r:"")}Header`;return d[o]?d[o](e):(n=t.label)!=null?n:""}const M=C({name:"ProTableExpandRenderer",props:{scope:{type:Object,required:!0}},setup(e){return()=>d.expand?d.expand(e.scope):null}}),O=C({name:"ProTableHeaderRenderer",props:{scope:{type:Object,required:!0}},setup(e){return()=>L(e.scope)}}),U=C({name:"ProTableCellRenderer",props:{scope:{type:Object,required:!0}},setup(e){return()=>B(e.scope)}});return(e,t)=>{var r;const o=$("ProTableColumn",!0);return H.value?(m(),f(y,{key:0},[g(" 多级表头 "),(r=l.column.children)!=null&&r.length?(m(),j(u(b),{key:0,label:l.column.label,align:l.column.align},{default:s(()=>[(m(!0),f(y,null,z(l.column.children,n=>{var c;return m(),j(o,{key:(c=n.prop)!=null?c:n.label,column:n},null,8,["column"])}),128))]),_:1},8,["label","align"])):l.column.type&&["selection","index"].includes(l.column.type)?(m(),f(y,{key:1},[g(" 特殊列:selection / index(自闭合,无需 slot) "),a(u(b),x(S(l.column)),null,16)],2112)):l.column.type==="expand"?(m(),f(y,{key:2},[g(" expand 列:必须通过 #default slot 提供展开行内容 "),a(u(b),x(S(l.column)),{default:s(n=>[a(u(M),{scope:n},null,8,["scope"])]),_:1},16)],2112)):l.column.type==="radio"?(m(),f(y,{key:3},[g(" radio 列 "),a(u(b),F(l.column,{width:"60",align:"center"}),{default:s(n=>[a(u(I),{modelValue:n.row.__radioSelected,"onUpdate:modelValue":c=>n.row.__radioSelected=c,value:!0,onChange:()=>e.$emit("radioChange",n.row)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1},16)],2112)):l.column.type==="sort"?(m(),f(y,{key:4},[g(" sort 列(拖拽手柄) "),a(u(b),F(l.column,{width:"60",align:"center",label:"排序"}),{default:s(()=>[a(u(k),{class:"move",style:{cursor:"move"}},{default:s(()=>[a(u(D),null,{default:s(()=>[a(u(A))]),_:1})]),_:1})]),_:1},16)],2112)):(m(),f(y,{key:5},[g(" 普通列 "),a(u(b),x(S(l.column)),{header:s(n=>[a(u(O),{scope:n},null,8,["scope"])]),default:s(n=>[a(u(U),{scope:n},null,8,["scope"])]),_:1},16)],2112))],64)):g("v-if",!0)}}});export{X as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import f from"./ProTableColumn.vue.mjs";export{f as default};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import type { ProFormSchema } from '../../pro-form/src/types';
|
|
3
|
+
import type { EnumItem, Pageable, ProTableColumn, ProTableProps, ProTableType, ToolButtonType } from './types';
|
|
4
|
+
export interface ProTableContext {
|
|
5
|
+
props: Readonly<ProTableProps>;
|
|
6
|
+
type: ProTableType;
|
|
7
|
+
tableRef: Ref<any>;
|
|
8
|
+
formRef: Ref<any>;
|
|
9
|
+
colSettingRef: Ref<any>;
|
|
10
|
+
flatColumns: ComputedRef<ProTableColumn[]>;
|
|
11
|
+
enumMap: Ref<Map<string, EnumItem[]>>;
|
|
12
|
+
searchColumns: ComputedRef<ProTableColumn[]>;
|
|
13
|
+
/** 标记为 search.quick 的列,按 quick.order / columns 顺序排序,供 unify 顶部快捷搜索使用 */
|
|
14
|
+
quickSearchColumns: ComputedRef<ProTableColumn[]>;
|
|
15
|
+
searchSchema: ComputedRef<ProFormSchema[]>;
|
|
16
|
+
searchParam: Ref<Record<string, any>>;
|
|
17
|
+
searchInitParam: Record<string, any>;
|
|
18
|
+
loading: Ref<boolean>;
|
|
19
|
+
tableData: ComputedRef<any[]>;
|
|
20
|
+
pageable: Pageable;
|
|
21
|
+
selectedList: Ref<any[]>;
|
|
22
|
+
selectedListIds: ComputedRef<any[]>;
|
|
23
|
+
isSelected: ComputedRef<boolean>;
|
|
24
|
+
radio: Ref<any>;
|
|
25
|
+
isShowSearch: Ref<boolean>;
|
|
26
|
+
getTableList: () => Promise<void> | void;
|
|
27
|
+
search: () => void;
|
|
28
|
+
reset: () => void;
|
|
29
|
+
clearSelection: () => void;
|
|
30
|
+
clearRadio: () => void;
|
|
31
|
+
handleSizeChange: (size: number) => void;
|
|
32
|
+
handleCurrentChange: (page: number) => void;
|
|
33
|
+
onSortChange: (info: any) => void;
|
|
34
|
+
onRadioChange: (row: any) => void;
|
|
35
|
+
selectionChange: (rows: any[]) => void;
|
|
36
|
+
showToolBtn: (type: ToolButtonType) => boolean;
|
|
37
|
+
toggleSearch: () => void;
|
|
38
|
+
openColSetting: () => void;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/pro-table/src/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE/G,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;IAC/B,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IAClB,aAAa,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB,WAAW,EAAE,WAAW,CAAC,cAAc,EAAE,CAAC,CAAC;IAC3C,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;IACtC,aAAa,EAAE,WAAW,CAAC,cAAc,EAAE,CAAC,CAAC;IAC7C,wEAAwE;IACxE,kBAAkB,EAAE,WAAW,CAAC,cAAc,EAAE,CAAC,CAAC;IAClD,YAAY,EAAE,WAAW,CAAC,aAAa,EAAE,CAAC,CAAC;IAC3C,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IACtC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACtB,SAAS,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC;IAC9B,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;IACzB,eAAe,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC;IACpC,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACjC,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IAChB,YAAY,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAC3B,YAAY,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACzC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,mBAAmB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,YAAY,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAClC,aAAa,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAClC,eAAe,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IACvC,WAAW,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,CAAC;IAC/C,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Slots } from 'vue';
|
|
2
|
+
import type { ProTableContext } from '../context';
|
|
3
|
+
import type { ProTableProps } from '../types';
|
|
4
|
+
export declare function useProTable(props: Readonly<ProTableProps>, emit: (...args: any[]) => any, slots: Slots): ProTableContext;
|
|
5
|
+
//# sourceMappingURL=use-pro-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-pro-table.d.ts","sourceRoot":"","sources":["../../../../src/pro-table/src/hooks/use-pro-table.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAO,KAAK,EAAE,MAAM,KAAK,CAAC;AAItC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAA4B,aAAa,EAAgC,MAAM,UAAU,CAAC;AActG,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAAE,KAAK,EAAE,KAAK,GAAG,eAAe,CAwLxH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var j=(a,f,i)=>new Promise((l,C)=>{var q=o=>{try{m(i.next(o))}catch(c){C(c)}},v=o=>{try{m(i.throw(o))}catch(c){C(c)}},m=o=>o.done?l(o.value):Promise.resolve(o.value).then(q,v);m((i=i.apply(a,f)).next())});import{ref as p,computed as k,provide as z,unref as ie,toRef as le,onMounted as fe}from"vue";import{useSelection as he}from"./use-selection.mjs";import{useTable as de}from"./use-table.mjs";function _(a){var i;const f=[];for(const l of a)(i=l.children)!=null&&i.length?f.push(l,..._(l.children)):f.push(l);return f}function ge(a,f,i){var D;const l=p(),C=p(),q=p(),v=p(a.type!=="unify"),m=p(null),o=k(()=>_(a.columns)),c=p(new Map);function F(e){return j(this,null,function*(){var n;if(!e.enum||!e.prop)return;const t=e.enum;if(typeof t=="function"){c.value.set(e.prop,[]);try{const s=yield t();c.value.set(e.prop,s)}catch(s){}}else c.value.set(e.prop,Array.isArray(t)?t:(n=t.value)!=null?n:[])})}z("proTableEnumMap",c),z("proTableSlots",i);const R=k(()=>o.value.filter(e=>{var t,n;return((t=e.search)==null?void 0:t.component)||((n=e.search)==null?void 0:n.render)}).sort((e,t)=>{var n,s,u,r;return((s=(n=e.search)==null?void 0:n.order)!=null?s:0)-((r=(u=t.search)==null?void 0:u.order)!=null?r:0)})),G=k(()=>R.value.filter(e=>{var t;return!!((t=e.search)!=null&&t.quick)}).sort((e,t)=>{var u,r,h,d,b,S;const n=typeof((u=e.search)==null?void 0:u.quick)=="object"&&(h=(r=e.search)==null?void 0:r.quick.order)!=null?h:0,s=typeof((d=t.search)==null?void 0:d.quick)=="object"&&(S=(b=t.search)==null?void 0:b.quick.order)!=null?S:0;return n-s})),H=k(()=>R.value.map(e=>{var t,n,s,u,r,h,d,b,S,M,V,A,B,E,N;return{field:(s=(n=(t=e.search)==null?void 0:t.key)!=null?n:e.prop)!=null?s:"",label:e.label,component:(u=e.search)==null?void 0:u.component,props:(r=e.search)==null?void 0:r.props,options:(()=>{var O,P,L,I,K;if(!(!e.enum||(P=(O=e.search)==null?void 0:O.component)!=null&&P.includes("tree")))return typeof e.enum=="function"?(I=c.value.get((L=e.prop)!=null?L:""))!=null?I:void 0:Array.isArray(e.enum)?e.enum:(K=ie(e.enum))!=null?K:void 0})(),fieldNames:e.fieldNames,defaultValue:(h=e.search)==null?void 0:h.defaultValue,span:(d=e.search)==null?void 0:d.span,offset:(b=e.search)==null?void 0:b.offset,order:(S=e.search)==null?void 0:S.order,render:(M=e.search)==null?void 0:M.render,xs:(V=e.search)==null?void 0:V.xs,sm:(A=e.search)==null?void 0:A.sm,md:(B=e.search)==null?void 0:B.md,lg:(E=e.search)==null?void 0:E.lg,xl:(N=e.search)==null?void 0:N.xl}})),y=p({}),w={};function x(){var e,t,n,s,u;for(const r of Object.keys(y.value))delete y.value[r];for(const r of Object.keys(w))delete w[r];for(const r of R.value){const h=(n=(t=(e=r.search)==null?void 0:e.key)!=null?t:r.prop)!=null?n:"",d=(u=(s=r.search)==null?void 0:s.defaultValue)!=null?u:null;y.value[h]=d,w[h]=d}}const{loading:J,processTableData:Q,pageable:T,getTableList:g,handleSizeChange:U,handleCurrentChange:W}=de({request:a.request,params:le(a,"params"),searchParam:y,postData:a.postData,requestError:a.requestError,pagination:a.pagination,staticData:k(()=>a.data)});function X(){Object.assign(T,{pageNum:1}),g(),f("search")}function Y(){x(),Object.assign(T,{pageNum:1}),g(),f("reset")}const{selectedList:Z,isSelected:$,selectedListIds:ee,selectionChange:te,clearSelection:ae}=he(a.rowKey);function ne(e){var t;m.value=e[(t=a.rowKey)!=null?t:"id"]}function re(){var e,t;m.value=null,(t=(e=l.value)==null?void 0:e.setCurrentRow)==null||t.call(e,void 0)}function se(e){g()}function oe(e){return a.toolButton===!0?!0:a.toolButton===!1?!1:a.toolButton.includes(e)}function ue(){v.value=!v.value}function ce(){var e,t;(t=(e=q.value)==null?void 0:e.open)==null||t.call(e)}return fe(()=>j(this,null,function*(){for(const e of o.value)F(e);x(),a.manualRequest||g()})),{props:a,type:(D=a.type)!=null?D:"classic",tableRef:l,formRef:C,colSettingRef:q,flatColumns:o,enumMap:c,searchColumns:R,quickSearchColumns:G,searchSchema:H,searchParam:y,searchInitParam:w,loading:J,tableData:Q,pageable:T,selectedList:Z,selectedListIds:ee,isSelected:$,radio:m,isShowSearch:v,getTableList:g,search:X,reset:Y,clearSelection:ae,clearRadio:re,handleSizeChange:U,handleCurrentChange:W,onSortChange:se,onRadioChange:ne,selectionChange:te,showToolBtn:oe,toggleSearch:ue,openColSetting:ce}}export{ge as useProTable};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function useSelection(rowKey?: string): {
|
|
2
|
+
selectedList: import("vue").Ref<any[], any[]>;
|
|
3
|
+
isSelected: import("vue").ComputedRef<boolean>;
|
|
4
|
+
selectedListIds: import("vue").ComputedRef<any[]>;
|
|
5
|
+
selectionChange: (rows: any[]) => void;
|
|
6
|
+
clearSelection: () => void;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=use-selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-selection.d.ts","sourceRoot":"","sources":["../../../../src/pro-table/src/hooks/use-selection.ts"],"names":[],"mappings":"AAEA,wBAAgB,YAAY,CAAC,MAAM,GAAE,MAAa;;;;4BAOjB,GAAG,EAAE;;EAerC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ref as u,computed as n}from"vue";function r(c="id"){const e=u([]),o=n(()=>e.value.length>0),l=n(()=>e.value.map(t=>t[c]));function i(t){e.value=t}function s(){e.value=[]}return{selectedList:e,isSelected:o,selectedListIds:l,selectionChange:i,clearSelection:s}}export{r as useSelection};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { ProTableRequestResult } from '../types';
|
|
3
|
+
interface UseTableOptions {
|
|
4
|
+
request?: (params: any) => Promise<ProTableRequestResult>;
|
|
5
|
+
params?: Ref<Record<string, any>>;
|
|
6
|
+
/** 来自搜索表单的参数(由外部维护,getTableList 时自动合并)*/
|
|
7
|
+
searchParam?: Ref<Record<string, any>>;
|
|
8
|
+
postData?: (data: any[]) => any[];
|
|
9
|
+
requestError?: (error: any) => void;
|
|
10
|
+
pagination?: boolean;
|
|
11
|
+
staticData?: Ref<any[] | undefined>;
|
|
12
|
+
}
|
|
13
|
+
export declare function useTable(options: UseTableOptions): {
|
|
14
|
+
loading: Ref<boolean, boolean>;
|
|
15
|
+
tableData: Ref<any[], any[]>;
|
|
16
|
+
pageable: {
|
|
17
|
+
pageNum: number;
|
|
18
|
+
pageSize: number;
|
|
19
|
+
total: number;
|
|
20
|
+
};
|
|
21
|
+
processTableData: import("vue").ComputedRef<any[]>;
|
|
22
|
+
searchParam: Record<string, any>;
|
|
23
|
+
searchInitParam: Record<string, any>;
|
|
24
|
+
getTableList: () => Promise<void>;
|
|
25
|
+
search: () => void;
|
|
26
|
+
reset: () => void;
|
|
27
|
+
handleSizeChange: (size: number) => void;
|
|
28
|
+
handleCurrentChange: (page: number) => void;
|
|
29
|
+
};
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=use-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-table.d.ts","sourceRoot":"","sources":["../../../../src/pro-table/src/hooks/use-table.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,KAAK,EAAY,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEhE,UAAU,eAAe;IACvB,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC1D,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAClC,yCAAyC;IACzC,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IACvC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAAE,CAAC;IAClC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,CAAC;CACrC;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,eAAe;;;;;;;;;;;;;;6BAiGf,MAAM;gCAMH,MAAM;EAuB1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var B=Object.defineProperty;var T=Object.getOwnPropertySymbols;var D=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var k=(l,t,e)=>t in l?B(l,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):l[t]=e,N=(l,t)=>{for(var e in t||(t={}))D.call(t,e)&&k(l,e,t[e]);if(T)for(var e of T(t))F.call(t,e)&&k(l,e,t[e]);return l};var C=(l,t,e)=>new Promise((f,g)=>{var c=o=>{try{n(e.next(o))}catch(r){g(r)}},m=o=>{try{n(e.throw(o))}catch(r){g(r)}},n=o=>o.done?f(o.value):Promise.resolve(o.value).then(c,m);n((e=e.apply(l,t)).next())});import{ref as j,reactive as y,computed as G,watch as H}from"vue";function M(l){const{request:t,params:e,searchParam:f,postData:g,requestError:c,pagination:m=!0,staticData:n}=l,o=j(!1),r=j([]),u=y({pageNum:1,pageSize:10,total:0}),b=y({}),d=y({}),w=G(()=>{if(!(n!=null&&n.value))return r.value;if(!m)return n.value;const a=(u.pageNum-1)*u.pageSize;return n.value.slice(a,a+u.pageSize)});function S(a,s){for(const[v,i]of Object.entries(a))(i!=null&&i!==""||i===!1||i===0)&&(s[v]=i)}function O(){const a={};return S(d,a),f!=null&&f.value&&S(f.value,a),a}function p(){return C(this,null,function*(){var a,s,v;if(n!=null&&n.value){u.total=n.value.length;return}if(t)try{o.value=!0;const i=O(),z=N(N(N({},b),i),(a=e==null?void 0:e.value)!=null?a:{});m&&(z.pageNum=u.pageNum,z.pageSize=u.pageSize);const h=yield t(z);if(!h.success){c==null||c(h);return}let P=(s=h.data)!=null?s:[];g&&(P=g(P)),r.value=P,m&&(u.total=(v=h.total)!=null?v:0)}catch(i){c==null||c(i)}finally{o.value=!1}})}function I(){u.pageNum=1,p()}function L(){var a;u.pageNum=1;for(const s of Object.keys(d))d[s]=(a=b[s])!=null?a:null;p()}function x(a){u.pageSize=a,u.pageNum=1,p()}function A(a){u.pageNum=a,p()}return e&&H(e,()=>p(),{deep:!0}),{loading:o,tableData:r,pageable:u,processTableData:w,searchParam:d,searchInitParam:b,getTableList:p,search:I,reset:L,handleSizeChange:x,handleCurrentChange:A}}export{M as useTable};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import ProTable from './ProTable.vue';
|
|
2
|
+
export declare const SyProTable: import("@sunyard-szyy-ui/utils").SFCWithInstall<{
|
|
3
|
+
new (...args: any[]): any;
|
|
4
|
+
__isFragment?: never;
|
|
5
|
+
__isTeleport?: never;
|
|
6
|
+
__isSuspense?: never;
|
|
7
|
+
} & import("vue").ComponentOptionsBase<object, object, any, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps>;
|
|
8
|
+
export type SyProTableInstance = InstanceType<typeof ProTable>;
|
|
9
|
+
export type { ProTableColumn, ProTableProps, ProTableSearchConfig, ProTableQuickHint, Pageable, EnumItem, ToolButtonType, ProTableType } from './types';
|
|
10
|
+
//# sourceMappingURL=pro-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pro-table.d.ts","sourceRoot":"","sources":["../../../src/pro-table/src/pro-table.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC,eAAO,MAAM,UAAU;;;;;ubAAwB,CAAC;AAChD,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,QAAQ,CAAC,CAAC;AAE/D,YAAY,EACV,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,YAAY,EACb,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{withInstall as o}from"@sunyard-szyy-ui/utils";import r from"./ProTable.vue.mjs";const i=o(r);export{i as SyProTable};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as f,ref as p,openBlock as l,createBlock as m,unref as u}from"vue";import a from"../ColSetting.vue.mjs";const C=f({__name:"ProTableColSetting",props:{context:{}},setup(t,{expose:r}){const c=t.context.flatColumns,o=p();function s(){var e,n;(n=(e=o.value)==null?void 0:e.open)==null||n.call(e)}return r({open:s}),(e,n)=>(l(),m(a,{ref_key:"innerRef",ref:o,columns:u(c)},null,8,["columns"]))}});export{C as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import f from"./ProTableColSetting.vue.mjs";export{f as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as l,unref as e,openBlock as u,createElementBlock as c,renderSlot as d,createVNode as C,createCommentVNode as m}from"vue";import{SyPagination as z}from"../../../pagination/src/pagination.mjs";const h={key:0,class:"sy-pro-table__pagination"},x=l({__name:"ProTablePagination",props:{context:{}},setup(p){const t=p,o=t.context.props,n=t.context.pageable,g=t.context.handleSizeChange,i=t.context.handleCurrentChange;return(s,a)=>e(o).pagination&&e(n).total>0?(u(),c("div",h,[d(s.$slots,"pagination",{},()=>[C(e(z),{"current-page":e(n).pageNum,"onUpdate:currentPage":a[0]||(a[0]=r=>e(n).pageNum=r),"page-size":e(n).pageSize,"onUpdate:pageSize":a[1]||(a[1]=r=>e(n).pageSize=r),total:e(n).total,"page-sizes":e(o).pageSizes,layout:e(o).pageLayout,background:"",onSizeChange:e(g),onCurrentChange:e(i)},null,8,["current-page","page-size","total","page-sizes","layout","onSizeChange","onCurrentChange"])])])):m("v-if",!0)}});export{x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import f from"./ProTablePagination.vue.mjs";export{f as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as f,ref as i,openBlock as d,createBlock as p,unref as n}from"vue";import{SyProForm as b}from"../../../pro-form/src/pro-form.mjs";const R=f({__name:"ProTableSearchRenderer",props:{context:{},cols:{default:4},showQueryBtn:{type:Boolean,default:!0},showResetBtn:{type:Boolean,default:!0},collapsible:{type:Boolean,default:!0}},setup(o,{expose:c}){const s=o,l=s.context.searchParam,h=s.context.searchSchema,u=s.context.search,m=s.context.reset,a=i();return c({validate:t=>{var e,r;return(r=(e=a.value)==null?void 0:e.validate)==null?void 0:r.call(e,t)},resetFields:()=>{var t,e;return(e=(t=a.value)==null?void 0:t.resetFields)==null?void 0:e.call(t)},clearValidate:t=>{var e,r;return(r=(e=a.value)==null?void 0:e.clearValidate)==null?void 0:r.call(e,t)},formRef:a}),(t,e)=>(d(),p(n(b),{ref_key:"innerFormRef",ref:a,model:n(l),schema:n(h),cols:o.cols,"show-query-btn":o.showQueryBtn,"show-reset-btn":o.showResetBtn,collapsible:o.collapsible,onSearch:n(u),onReset:n(m)},null,8,["model","schema","cols","show-query-btn","show-reset-btn","collapsible","onSearch","onReset"]))}});export{R as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import f from"./ProTableSearchRenderer.vue.mjs";export{f as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as D,useAttrs as w,onMounted as T,nextTick as $,resolveDirective as E,withDirectives as z,openBlock as p,createBlock as g,unref as e,mergeProps as B,withCtx as u,renderSlot as m,createElementBlock as P,Fragment as F,renderList as N,createElementVNode as V,createVNode as q}from"vue";import A from"sortablejs";import{SyTable as K}from"../../../table/src/table.mjs";import{SyEmpty as L}from"../../../empty/src/empty.mjs";import M from"../ProTableColumn.vue.mjs";const j={class:"sy-pro-table__empty"},U=D({__name:"ProTableTable",props:{context:{},onDragSort:{type:Function}},setup(f){const t=f,C=w(),n=t.context.props,l=t.context.tableRef,b=t.context.loading,d=t.context.tableData,y=t.context.flatColumns,S=t.context.selectionChange,_=t.context.onSortChange,v=t.context.onRadioChange;function R(r){l.value=r}function k(){var i;if(!n.columns.some(o=>o.type==="sort")||!l.value)return;const c=(i=l.value.$el)==null?void 0:i.querySelector("tbody");c&&A.create(c,{handle:".move",animation:150,onEnd({newIndex:o,oldIndex:a}){var h;if(o===a)return;const s=d.value,x=s.splice(a,1)[0];s.splice(o,0,x),(h=t.onDragSort)==null||h.call(t,{newIndex:o,oldIndex:a})}})}return T(()=>{$(()=>k())}),(r,c)=>{const i=E("loading");return z((p(),g(e(K),B({ref:R,class:"sy-pro-table__table"},e(C),{data:e(d),border:e(n).border,stripe:e(n).stripe,"row-key":e(n).rowKey,size:e(n).size,"highlight-current-row":e(n).highlightCurrentRow,onSelectionChange:e(S),onSortChange:e(_)}),{append:u(()=>[m(r.$slots,"append")]),empty:u(()=>[m(r.$slots,"empty",{},()=>[V("div",j,[q(e(L),{description:"暂无数据"})])])]),default:u(()=>[m(r.$slots,"default"),(p(!0),P(F,null,N(e(y),o=>{var a,s;return p(),g(M,{key:(s=(a=o.prop)!=null?a:o.label)!=null?s:o.type,column:o,onRadioChange:e(v)},null,8,["column","onRadioChange"])}),128))]),_:3},16,["data","border","stripe","row-key","size","highlight-current-row","onSelectionChange","onSortChange"])),[[i,e(b)]])}}});export{U as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import f from"./ProTableTable.vue.mjs";export{f as default};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { Ref, VNode } from 'vue';
|
|
2
|
+
import type { BreakPoint, ProFormComponentType } from '../../pro-form/src/types';
|
|
3
|
+
export type { BreakPoint };
|
|
4
|
+
export type ProTableType = 'classic' | 'unify' | 'custom';
|
|
5
|
+
export interface EnumItem {
|
|
6
|
+
label: string;
|
|
7
|
+
value: any;
|
|
8
|
+
tagType?: 'primary' | 'success' | 'warning' | 'danger' | 'info';
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 快捷搜索附加配置(unify 模式下顶部动作条上小入口的细节调整)
|
|
13
|
+
* 仅在 ProTableSearchConfig.quick 被启用时生效
|
|
14
|
+
*/
|
|
15
|
+
export interface ProTableQuickHint {
|
|
16
|
+
/** 顶部快捷控件宽度,数字按 px 处理,默认 220 */
|
|
17
|
+
width?: string | number;
|
|
18
|
+
/** 顶部展示顺序,不传则按 columns 顺序(与 search.order 无关) */
|
|
19
|
+
order?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface ProTableSearchConfig {
|
|
22
|
+
component?: ProFormComponentType;
|
|
23
|
+
props?: Record<string, any>;
|
|
24
|
+
key?: string;
|
|
25
|
+
order?: number;
|
|
26
|
+
span?: number;
|
|
27
|
+
offset?: number;
|
|
28
|
+
defaultValue?: any;
|
|
29
|
+
render?: () => VNode;
|
|
30
|
+
xs?: {
|
|
31
|
+
span?: number;
|
|
32
|
+
offset?: number;
|
|
33
|
+
};
|
|
34
|
+
sm?: {
|
|
35
|
+
span?: number;
|
|
36
|
+
offset?: number;
|
|
37
|
+
};
|
|
38
|
+
md?: {
|
|
39
|
+
span?: number;
|
|
40
|
+
offset?: number;
|
|
41
|
+
};
|
|
42
|
+
lg?: {
|
|
43
|
+
span?: number;
|
|
44
|
+
offset?: number;
|
|
45
|
+
};
|
|
46
|
+
xl?: {
|
|
47
|
+
span?: number;
|
|
48
|
+
offset?: number;
|
|
49
|
+
};
|
|
50
|
+
/** 标记为快捷搜索:true / 配置对象 → 同时出现在 unify 模式动作条上的小入口里 */
|
|
51
|
+
quick?: boolean | ProTableQuickHint;
|
|
52
|
+
}
|
|
53
|
+
export interface ProTableColumn {
|
|
54
|
+
prop?: string;
|
|
55
|
+
label?: string;
|
|
56
|
+
type?: 'index' | 'selection' | 'expand' | 'radio' | 'sort';
|
|
57
|
+
width?: string | number;
|
|
58
|
+
minWidth?: string | number;
|
|
59
|
+
fixed?: boolean | 'left' | 'right';
|
|
60
|
+
align?: 'left' | 'center' | 'right';
|
|
61
|
+
sortable?: boolean | 'custom';
|
|
62
|
+
isShow?: boolean | Ref<boolean>;
|
|
63
|
+
isSetting?: boolean | Ref<boolean>;
|
|
64
|
+
render?: (scope: {
|
|
65
|
+
row: any;
|
|
66
|
+
$index: number;
|
|
67
|
+
}) => VNode;
|
|
68
|
+
headerRender?: (scope: {
|
|
69
|
+
column: any;
|
|
70
|
+
$index: number;
|
|
71
|
+
}) => VNode;
|
|
72
|
+
enum?: EnumItem[] | Ref<EnumItem[]> | (() => Promise<EnumItem[]>);
|
|
73
|
+
isFilterEnum?: boolean;
|
|
74
|
+
fieldNames?: {
|
|
75
|
+
label?: string;
|
|
76
|
+
value?: string;
|
|
77
|
+
children?: string;
|
|
78
|
+
};
|
|
79
|
+
tag?: boolean;
|
|
80
|
+
search?: ProTableSearchConfig;
|
|
81
|
+
children?: ProTableColumn[];
|
|
82
|
+
[key: string]: any;
|
|
83
|
+
}
|
|
84
|
+
export interface Pageable {
|
|
85
|
+
pageNum: number;
|
|
86
|
+
pageSize: number;
|
|
87
|
+
total: number;
|
|
88
|
+
}
|
|
89
|
+
export interface ProTableRequestResult {
|
|
90
|
+
data: any[];
|
|
91
|
+
total: number;
|
|
92
|
+
success: boolean;
|
|
93
|
+
}
|
|
94
|
+
export type ToolButtonType = 'refresh' | 'setting' | 'search';
|
|
95
|
+
export interface ProTableProps {
|
|
96
|
+
columns: ProTableColumn[];
|
|
97
|
+
data?: any[];
|
|
98
|
+
request?: (params: any) => Promise<ProTableRequestResult>;
|
|
99
|
+
params?: Record<string, any>;
|
|
100
|
+
postData?: (data: any[]) => any[];
|
|
101
|
+
requestError?: (error: any) => void;
|
|
102
|
+
manualRequest?: boolean;
|
|
103
|
+
pagination?: boolean;
|
|
104
|
+
rowKey?: string;
|
|
105
|
+
border?: boolean;
|
|
106
|
+
stripe?: boolean;
|
|
107
|
+
showSearch?: boolean;
|
|
108
|
+
searchCols?: number | Partial<Record<BreakPoint, number>>;
|
|
109
|
+
toolButton?: boolean | ToolButtonType[];
|
|
110
|
+
highlightCurrentRow?: boolean;
|
|
111
|
+
size?: 'large' | 'default' | 'small';
|
|
112
|
+
pageSizes?: number[];
|
|
113
|
+
pageLayout?: string;
|
|
114
|
+
type?: ProTableType;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/pro-table/src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEjF,YAAY,EAAE,UAAU,EAAE,CAAC;AAE3B,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE1D,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,GAAG,CAAC;IACX,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IAChE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,KAAK,CAAC;IACrB,EAAE,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,EAAE,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,EAAE,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,EAAE,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,EAAE,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,oDAAoD;IACpD,KAAK,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC;CACrC;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IAC3D,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC9B,MAAM,CAAC,EAAE,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC;IACnC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,GAAG,EAAE,GAAG,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,KAAK,CAAC;IACxD,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,GAAG,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,KAAK,CAAC;IACjE,IAAI,CAAC,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAClE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnE,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE9D,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACb,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAAE,CAAC;IAClC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACpC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1D,UAAU,CAAC,EAAE,OAAO,GAAG,cAAc,EAAE,CAAC;IACxC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as B,openBlock as i,createElementBlock as _,unref as t,createVNode as n,createCommentVNode as r,createElementVNode as a,renderSlot as l,createBlock as m,withCtx as c}from"vue";import{Refresh as R,Operation as T,Search as I}from"@element-plus/icons-vue";import{SyButton as p}from"../../../../button/src/button.mjs";import{SyTooltip as h}from"../../../../tooltip/src/tooltip.mjs";import N from"../../shared/ProTableColSetting.vue.mjs";import V from"../../shared/ProTablePagination.vue.mjs";import D from"../../shared/ProTableSearchRenderer.vue.mjs";import E from"../../shared/ProTableTable.vue.mjs";const F={class:"sy-pro-table sy-pro-table--classic"},H={key:0,class:"sy-pro-table__search"},O={class:"sy-pro-table__main"},P={class:"sy-pro-table__header"},j={class:"sy-pro-table__header-left"},q={class:"sy-pro-table__header-right"},X=B({__name:"ClassicLayout",props:{context:{},onDragSort:{type:Function}},setup(s){const e=s,d=e.context.props,x=e.context.isShowSearch,u=e.context.searchColumns,S=e.context.selectedList,g=e.context.selectedListIds,y=e.context.isSelected,C=e.context.getTableList,k=e.context.openColSetting,v=e.context.toggleSearch,f=e.context.showToolBtn,b=e.context.formRef,$=e.context.colSettingRef;function L(o){b.value=o}function w(o){$.value=o}return(o,z)=>(i(),_("div",F,[t(d).showSearch&&t(x)&&t(u).length>0?(i(),_("div",H,[n(D,{ref:L,context:s.context,cols:t(d).searchCols},null,8,["context","cols"])])):r("v-if",!0),a("div",O,[a("div",P,[a("div",j,[l(o.$slots,"tableHeader",{selectedList:t(S),selectedListIds:t(g),isSelected:t(y)})]),a("div",q,[l(o.$slots,"toolButton",{},()=>[t(f)("refresh")?(i(),m(t(h),{key:0,content:"刷新",placement:"top"},{default:c(()=>[n(t(p),{icon:t(R),circle:"",onClick:t(C)},null,8,["icon","onClick"])]),_:1})):r("v-if",!0),t(f)("setting")?(i(),m(t(h),{key:1,content:"列设置",placement:"top"},{default:c(()=>[n(t(p),{icon:t(T),circle:"",onClick:t(k)},null,8,["icon","onClick"])]),_:1})):r("v-if",!0),t(d).showSearch&&t(f)("search")&&t(u).length>0?(i(),m(t(h),{key:2,content:"搜索",placement:"top"},{default:c(()=>[n(t(p),{icon:t(I),circle:"",onClick:t(v)},null,8,["icon","onClick"])]),_:1})):r("v-if",!0)])])]),n(E,{context:s.context,"on-drag-sort":s.onDragSort},{append:c(()=>[l(o.$slots,"append")]),empty:c(()=>[l(o.$slots,"empty")]),default:c(()=>[l(o.$slots,"default")]),_:3},8,["context","on-drag-sort"]),n(V,{context:s.context},{pagination:c(()=>[l(o.$slots,"pagination")]),_:3},8,["context"])]),n(N,{ref:w,context:s.context},null,8,["context"])]))}});export{X as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import f from"./ClassicLayout.vue.mjs";export{f as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/pro-table/src/variants/classic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|