@next-bricks/advanced 0.4.0 → 0.6.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.
@@ -1,4 +1,5 @@
1
1
  import type { ColumnType, TablePaginationConfig } from "antd/es/table";
2
+ import type { TableRowSelection } from "antd/es/table/interface.js";
2
3
  import type { UseBrickConf } from "@next-core/types";
3
4
  export type RecordType = Record<string, any>;
4
5
  export interface Column extends ColumnType<RecordType> {
@@ -19,4 +20,8 @@ interface PaginationConfig extends Pick<TablePaginationConfig, "disabled" | "hid
19
20
  showTotal?: boolean;
20
21
  }
21
22
  export type PaginationType = false | PaginationConfig | undefined;
23
+ interface RowSelectionConfig extends Pick<TableRowSelection<RecordType>, "columnWidth" | "fixed" | "hideSelectAll" | "preserveSelectedRowKeys" | "type"> {
24
+ showSelectInfo?: boolean;
25
+ }
26
+ export type RowSelectionType = boolean | RowSelectionConfig | undefined;
22
27
  export {};
@@ -4,3 +4,8 @@ export declare const defaultPaginationConfig: {
4
4
  showSizeChanger: boolean;
5
5
  showTotal: boolean;
6
6
  };
7
+ export declare const defaultRowSelectionConfig: {
8
+ preserveSelectedRowKeys: boolean;
9
+ showSelectInfo: boolean;
10
+ };
11
+ export declare function getSearchKeywords(value: unknown): string[];
@@ -42,6 +42,171 @@
42
42
  title: Address
43
43
  dataSource:
44
44
  pageSize: 5
45
+ page: 1
46
+ list:
47
+ - key: 0
48
+ name: Jack
49
+ age: 18
50
+ address: Guangzhou
51
+ - key: 1
52
+ name: Alex
53
+ age: 20
54
+ address: Shanghai
55
+ - key: 2
56
+ name: Lucy
57
+ age: 16
58
+ address: Yunnan
59
+ - key: 3
60
+ name: Sam
61
+ age: 28
62
+ address: Guangzhou
63
+ - key: 4
64
+ name: Bob
65
+ age: 35
66
+ address: Hainan
67
+ - key: 5
68
+ name: Ava
69
+ age: 23
70
+ address: Beijing
71
+ - key: 6
72
+ name: Sophia
73
+ age: 20
74
+ address: Shanghai
75
+ - key: 7
76
+ name: Charlotte
77
+ age: 33
78
+ address: Chongqing
79
+ - key: 8
80
+ name: Mia
81
+ age: 18
82
+ address: Chengdu
83
+ - key: 9
84
+ name: Noah
85
+ age: 38
86
+ address: Hainan
87
+ - key: 10
88
+ name: William
89
+ age: 16
90
+ address: Taiwan
91
+ ```
92
+
93
+ ### Front Search
94
+
95
+ ```yaml preview
96
+ - brick: eo-search-bar
97
+ children:
98
+ - brick: eo-search
99
+ slot: start
100
+ properties:
101
+ placeholder: Enter keyword
102
+ events:
103
+ search:
104
+ target: "#table"
105
+ method: search
106
+ args:
107
+ - q: <% EVENT.detail %>
108
+ - brick: eo-next-table
109
+ events:
110
+ page.change:
111
+ - action: console.log
112
+ page.size.change:
113
+ - action: console.log
114
+ properties:
115
+ id: table
116
+ searchFields:
117
+ - address
118
+ pagination:
119
+ pageSizeOptions:
120
+ - 5
121
+ - 10
122
+ - 20
123
+ columns:
124
+ - dataIndex: name
125
+ key: name
126
+ title: Name
127
+ - dataIndex: age
128
+ key: age
129
+ title: Age
130
+ - dataIndex: address
131
+ key: address
132
+ title: Address
133
+ dataSource:
134
+ pageSize: 5
135
+ page: 1
136
+ list:
137
+ - key: 0
138
+ name: Jack
139
+ age: 18
140
+ address: Guangzhou
141
+ - key: 1
142
+ name: Alex
143
+ age: 20
144
+ address: Shanghai
145
+ - key: 2
146
+ name: Lucy
147
+ age: 16
148
+ address: Yunnan
149
+ - key: 3
150
+ name: Sam
151
+ age: 28
152
+ address: Guangzhou
153
+ - key: 4
154
+ name: Bob
155
+ age: 35
156
+ address: Hainan
157
+ - key: 5
158
+ name: Ava
159
+ age: 23
160
+ address: Beijing
161
+ - key: 6
162
+ name: Sophia
163
+ age: 20
164
+ address: Shanghai
165
+ - key: 7
166
+ name: Charlotte
167
+ age: 33
168
+ address: Chongqing
169
+ - key: 8
170
+ name: Mia
171
+ age: 18
172
+ address: Chengdu
173
+ - key: 9
174
+ name: Noah
175
+ age: 38
176
+ address: Hainan
177
+ - key: 10
178
+ name: William
179
+ age: 16
180
+ address: Taiwan
181
+ ```
182
+
183
+ ### Row Selection
184
+
185
+ ```yaml preview
186
+ - brick: eo-next-table
187
+ events:
188
+ row.select:
189
+ - action: console.log
190
+ properties:
191
+ rowSelection: true
192
+ pagination:
193
+ pageSizeOptions:
194
+ - 5
195
+ - 10
196
+ - 20
197
+ columns:
198
+ - dataIndex: name
199
+ key: name
200
+ title: Name
201
+ - dataIndex: age
202
+ key: age
203
+ title: Age
204
+ - dataIndex: address
205
+ key: address
206
+ title: Address
207
+ dataSource:
208
+ pageSize: 5
209
+ page: 1
45
210
  list:
46
211
  - key: 0
47
212
  name: Jack
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-bricks/advanced",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "homepage": "https://github.com/easyops-cn/next-bricks/tree/master/bricks/basic",
5
5
  "repository": {
6
6
  "type": "git",
@@ -37,5 +37,5 @@
37
37
  "@next-core/build-next-bricks": "^1.14.2",
38
38
  "@next-core/test-next": "^1.0.10"
39
39
  },
40
- "gitHead": "a939268174b36bf2fcb9e27d86f9b15f3773d0ea"
40
+ "gitHead": "b5cca752aa869c88c9824404cfad265e6c3beed1"
41
41
  }
@@ -1,2 +0,0 @@
1
- "use strict";(self.webpackChunk_next_bricks_advanced=self.webpackChunk_next_bricks_advanced||[]).push([[4553],{4553:(e,t,a)=>{a.r(t);var i=a(3028),s=a(6666),n=a(3395),r=a(1815),l=a(381),o=a(687),h=a(2604),d=a(8657),c=a.n(d),u=a(7320),p=a(1466),g=a(2869),w=a(5178),m=a(104),v=a(7896),Z=a(2159),f=a(6154),b={$eq:w.isEqual,$lt:w.lt,$lte:w.lte,$gt:w.gt,$gte:w.gte,$ne:(e,t)=>!(0,w.isEqual)(e,t),$isEqual:w.isEqual,$notEqual:(e,t)=>!(0,w.isEqual)(e,t),$in:w.includes,$nin:(e,t)=>!(0,w.includes)(e,t),$exists:(e,t)=>e?!(0,w.isUndefined)(t):(0,w.isUndefined)(t)};function y(e,t,a){var{dataIndex:i,mapping:s}=e,n=void 0!==i?(0,w.get)(t,i):a,r=s.find((e=>e.value===n));return r?{borderLeft:"4px solid ".concat(r.leftBorderColor)}:{}}var C=(e,t,a,i)=>{e&&(0,w.forEach)(e,(e=>{var s=(0,w.get)(e,a),n=(0,w.get)(e,t);i.push(n),null!=s&&s.length&&C(s,t,a,i)}))},x=(e,t,a)=>{e&&(0,w.forEach)(e,(e=>{var i=(0,w.get)(e,t);a.push(e),null!=i&&i.length&&x(i,t,a)}))};function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return null!=t&&t.length&&t.forEach((t=>{var a;return null!==(a=t[e])&&void 0!==a&&a.length?S(e,t[e]):(delete t[e],t)})),t}var k=a(2779),_=a.n(k),R=a(8533),E=a(2689),M=a(2238),W=a(8683),P=a(4819),B=a.n(P),K=a(3261),I=a(3691),N=["index","moveRow","className","style"],U=["useBrick","valueSuffix","cellStatus","cellStyle","headerBrick","colSpanKey","rowSpanKey","filterDropdownBrick"],D="DraggableBodyRow",z={lib:"antd",icon:"down",theme:"outlined"},T={lib:"antd",icon:"right",theme:"outlined"},A=(0,p.wrapBrick)("eo-icon"),F=e=>{var{index:t,moveRow:a,className:s,style:n}=e,r=(0,Z.Z)(e,N),l=c().useRef(null),[{isOver:o,dropClassName:h},d]=(0,R.L)({accept:D,collect:e=>{var{index:a}=e.getItem()||{};return a===t?{}:{isOver:e.isOver(),dropClassName:a<t?"dropOverDownward":"dropOverUpward"}},drop:e=>{a(e.index,t)}}),[,u]=(0,E.c)({type:D,item:{type:D,index:t},collect:e=>({isDragging:e.isDragging()})});return d(u(l)),c().createElement("tr",(0,v.Z)({ref:l,className:_()(s,{[h]:o}),style:(0,i.Z)({cursor:"move"},n)},r))};function O(e){if(e.error)throw e.error;var{configProps:t={pagination:!0,sortBy:!1},columns:a,rowKey:s="key",expandIconAsCell:n,expandIconColumnIndex:r,childrenColumnName:l,scroll:o,optimizedColumns:h,onDelete:u,ellipsisInfo:p,showHeader:g}=e,m=(0,d.useMemo)((()=>{var t;return null===(t=e.dataSource)||void 0===t?void 0:t.map(((e,t)=>(0,w.isNil)(e[s])?(0,i.Z)((0,i.Z)({},e),{},{[s]:t}):e))}),[e.dataSource,s]),[b,C]=(0,d.useState)(m),x=(0,d.useRef)(new Map),S=(0,d.useRef)(new Map),k=(0,d.useRef)(new Map),R=(0,d.useRef)(new Map);(0,d.useEffect)((()=>{R.current.clear(),C(m)}),[m]);var E=null!=t&&t.rowSelection?-1:0,P=(0,d.useMemo)((()=>{if(a){S.current.clear(),k.current.clear();var e=a.map(((e,t)=>{var a,{useBrick:o,valueSuffix:h,cellStatus:d,cellStyle:u={},headerBrick:g,colSpanKey:m,rowSpanKey:v,filterDropdownBrick:f}=e,b=(0,Z.Z)(e,U);if(null!=g&&g.useBrick){var C=null==g?void 0:g.useBrick,_=S.current.get(e);_||(_={title:b.title},S.current.set(e,_)),b.title=((e,t)=>function(){return c().createElement(K.ReactUseMultipleBricks,{useBrick:e,data:t})})(C,_)}if(null!=f&&f.useBrick&&(b.filterDropdown=c().createElement(K.ReactUseMultipleBricks,{useBrick:f.useBrick})),o?(o&&((a=k.current.get(o))||(a=new Map,k.current.set(o,a))),b.render=((e,t)=>function(a,i,s){if(e){var n=null==t?void 0:t.get(i);return n||(n={cellData:a,rowData:i,columnIndex:s},null==t||t.set(i,n)),c().createElement(K.ReactUseMultipleBricks,{useBrick:e,data:n})}})(o,a),b.shouldCellUpdate=(e,t)=>!(0,w.isEqual)(e,t)):h&&(b.render=e=>e+h),!n&&t===Number(r)+E){var R=b.render;b.render=function(e,t,a){return c().createElement(c().Fragment,null,!t[l]&&x.current.get(s?t[s]:t),R?R(e,t,a):e)}}if(d||m||v||u){var M=b.render;b.render=(e,t,a)=>({children:M?M(e,t,a):e,props:{colSpan:t[m],rowSpan:t[v],style:(0,i.Z)((0,i.Z)({},d?y(d,t,e):{}),u)}})}return"string"==typeof b.dataIndex&&(b.dataIndex=(0,w.toPath)(b.dataIndex)),"top"===b.verticalAlign&&(b.className?b.className+=" alignTop":b.className="alignTop"),"bottom"===b.verticalAlign&&(b.className?b.className+=" alignBottom":b.className="alignBottom"),p&&(b.className?b.className+=" ellipsisInfoCell":b.className="ellipsisInfoCell"),b}));return e}}),[a,l,n,r,E,s,u,p]),N={body:{row:F}},D=(t,a)=>{var i=b[t],s=B()(b,{$splice:[[t,1],[a,0,i]]});C(s),e.onDrag&&e.onDrag(s)},O=(0,w.pickBy)({expandIconColumnIndex:r,expandIconAsCell:n,expandRowByClick:e.expandRowByClick,expandedRowKeys:e.expandedRowKeys,defaultExpandAllRows:e.defaultExpandAllRows},(e=>!(0,w.isNil)(e))),q=c().createElement(f.Z,(0,v.Z)({className:_()("brickTable",{expandIconCellHidden:!n,customDropTable:e.tableDraggable,tableThTransparent:e.thTransparent,zebraPatternTable:(null==b?void 0:b.length)>=2&&e.zebraPattern}),dataSource:b},e.tableDraggable?{components:N,onRow:(e,t)=>({index:t,moveRow:D})}:{},{columns:P,onChange:e.onChange},e.expandedRowBrick?{expandedRowRender:(t,a)=>{var i,s=R.current.get(t);return s||(s={rowData:t,rowIndex:a},R.current.set(t,s)),c().createElement(K.ReactUseMultipleBricks,{useBrick:null===(i=e.expandedRowBrick)||void 0===i?void 0:i.useBrick,data:s})}}:{},O,{onExpand:(t,a)=>{e.onExpand&&e.onExpand(t,a)},showSorterTooltip:!1,onExpandedRowsChange:t=>{e.onExpandedRowsChange&&e.onExpandedRowsChange(t)},rowKey:s,childrenColumnName:l,rowClassName:(t,a)=>t.invalidRow?"invalidRow":t.disabledRow?"disabledRow":e.zebraPattern&&a%2?"brickTableOddRow":"",expandIcon:t=>{var a,i,r,{record:l,expandable:o,expanded:h,onExpand:d}=t,u=(null===(a=e.expandIcon)||void 0===a?void 0:a.collapsedIcon)||z;o?(h||(u=(null===(r=e.expandIcon)||void 0===r?void 0:r.expandedIcon)||T),i=c().createElement("span",{className:"expandIconSpan","data-testid":"expand-icon",onClick:e=>{d(l,e)}},c().createElement(A,u))):i=c().createElement("span",{className:"expandIconSpan","data-testid":"expand-icon"},c().createElement("span",{style:{visibility:"hidden"}},c().createElement(A,u)));return i?(n||x.current.set(s?l[s]:l,i),i):c().createElement(c().Fragment,null)},scroll:o,showHeader:g},t));e.tableDraggable&&(q=c().createElement(M.W,{backend:W.PD},q));var L=(0,d.useMemo)((()=>(0,I.Df)()),[]);return c().createElement(I.V9,{container:e.shadowRoot,cache:L},q)}a(5254);var q,L,H,$,V,Q,j,J,G,X,Y,ee,te,ae,ie,se,ne,re,le,oe,he,de,ce,ue,pe,ge,we,me,ve,Ze,fe,be,ye,Ce,xe,Se,ke,_e,Re,Ee,Me,We,Pe,Be,Ke,Ie,Ne,Ue,De,ze,Te,Ae,Fe,Oe,qe,Le,He,$e,Ve,Qe,je,Je,Ge,Xe,Ye,et,tt,at,it,st,nt,rt,lt,ot,ht,dt,ct,ut,pt,gt,wt,mt,vt,Zt,ft,bt,yt,Ct,xt,St,kt,_t,Rt,Et,Mt,Wt,Pt,Bt,Kt,It,Nt,Ut,Dt,zt,Tt,At,Ft,Ot,qt,Lt,Ht,$t,Vt,Qt,jt,Jt,Gt,Xt,Yt,ea,ta,aa,ia,sa,na,ra,la,oa,ha,{defineElement:da,property:ca,event:ua,method:pa}=(0,u.createDecorators)();L=da("eo-table",{styleTexts:[g.Z],alias:["advanced.general-table"]}),H=ua({type:"page.update"}),j=ua({type:"filter.update"}),Y=ua({type:"select.update"}),ie=ua({type:"select.row.keys.update"}),le=ua({type:"sort.update",cancelable:!0}),ce=ua({type:"row.expand"}),we=ua({type:"expand.rows.change"}),fe=ua({type:"row.drag"}),xe=ca({type:Boolean}),ke=ca({attribute:!1}),Re=ca(),Me=ca({attribute:!1}),Pe=ca({type:Boolean}),Ke=ca({attribute:!1}),Ne=ca({attribute:!1}),De=ca(),Te=ca({attribute:!1}),Fe=ca({attribute:!1}),qe=ca({attribute:!1}),He=ca({attribute:!1}),Ve=ca({attribute:!1}),je=ca({type:Number}),Ge=ca({type:Boolean}),Ye=ca({attribute:!1}),tt=ca({attribute:!1}),it=ca({type:Boolean}),nt=ca({type:Boolean}),lt=ca({attribute:!1}),ht=ca({type:Boolean}),ct=ca({type:Boolean}),pt=ca({attribute:!1}),wt=ca({attribute:!1}),vt=ca({type:Boolean}),ft=ca(),yt=ca({type:Boolean}),xt=ca({attribute:!1}),kt=ca({type:Number}),Rt=ca({type:Number}),Mt=ca({attribute:!1}),Pt=ca(),Kt=ca({type:Boolean}),Nt=ca({type:Boolean}),Dt=ca({type:Boolean}),Tt=ca({attribute:!1}),Ft=ca({type:Boolean}),qt=ca({type:Boolean}),Ht=ca({type:Boolean}),Vt=ca({attribute:!1}),jt=ca(),Gt=ca({attribute:!1}),Yt=ca({type:Boolean}),ta=ca({type:Boolean}),ia=ca({attribute:!1}),na=pa(),ra=pa();var ga=new WeakMap,wa=new WeakMap,ma=new WeakMap,va=new WeakMap,Za=new WeakMap,fa=new WeakMap,ba=new WeakMap,ya=new WeakMap,Ca=new WeakMap,xa=new WeakMap,Sa=new WeakMap,ka=new WeakMap,_a=new WeakMap,Ra=new WeakMap,Ea=new WeakMap,Ma=new WeakMap,Wa=new WeakMap,Pa=new WeakMap,Ba=new WeakMap,Ka=new WeakMap,Ia=new WeakMap,Na=new WeakMap,Ua=new WeakMap,Da=new WeakMap,za=new WeakMap,Ta=new WeakMap,Aa=new WeakMap,Fa=new WeakMap,Oa=new WeakMap,qa=new WeakMap,La=new WeakMap,Ha=new WeakMap,$a=new WeakMap,Va=new WeakMap,Qa=new WeakMap,ja=new WeakMap,Ja=new WeakMap,Ga=new WeakMap,Xa=new WeakMap,Ya=new WeakMap,ei=new WeakMap,ti=new WeakMap,ai=new WeakMap,ii=new WeakMap,si=new WeakMap,ni=new WeakMap,ri=new WeakMap,li=new WeakMap,oi=new WeakMap,hi=new WeakMap,di=new WeakMap,ci=new WeakMap,ui=new WeakMap,pi=new WeakMap,gi=new WeakMap,wi=new WeakMap,mi=new WeakMap,vi=new WeakMap,Zi=new WeakMap,fi=new WeakMap,bi=new WeakMap,yi=new WeakMap;class Ci extends p.ReactNextElement{constructor(){super(...arguments),(0,n.Z)(this,Ma,{get:zi,set:Di}),(0,n.Z)(this,Ra,{get:Ui,set:Ni}),(0,n.Z)(this,ka,{get:Ii,set:Ki}),(0,n.Z)(this,xa,{get:Bi,set:Pi}),(0,n.Z)(this,ya,{get:Wi,set:Mi}),(0,n.Z)(this,fa,{get:Ei,set:Ri}),(0,n.Z)(this,va,{get:_i,set:ki}),(0,n.Z)(this,wa,{get:Si,set:xi}),(0,n.Z)(this,ga,{writable:!0,value:(la(this),$(this))}),(0,n.Z)(this,ma,{writable:!0,value:J(this)}),(0,n.Z)(this,Za,{writable:!0,value:ee(this)}),(0,n.Z)(this,ba,{writable:!0,value:se(this)}),(0,n.Z)(this,Ca,{writable:!0,value:oe(this)}),(0,n.Z)(this,Sa,{writable:!0,value:ue(this)}),(0,n.Z)(this,_a,{writable:!0,value:me(this)}),(0,n.Z)(this,Ea,{writable:!0,value:be(this)}),(0,n.Z)(this,Wa,{writable:!0,value:Se(this,!0)}),(0,n.Z)(this,Pa,{writable:!0,value:_e(this)}),(0,n.Z)(this,Ba,{writable:!0,value:Ee(this)}),(0,n.Z)(this,Ka,{writable:!0,value:We(this)}),(0,n.Z)(this,Ia,{writable:!0,value:Be(this,!1)}),(0,n.Z)(this,Na,{writable:!0,value:Ie(this)}),(0,n.Z)(this,Ua,{writable:!0,value:Ue(this)}),(0,n.Z)(this,Da,{writable:!0,value:ze(this)}),(0,n.Z)(this,za,{writable:!0,value:Ae(this)}),(0,n.Z)(this,Ta,{writable:!0,value:Oe(this)}),(0,n.Z)(this,Aa,{writable:!0,value:Le(this)}),(0,n.Z)(this,Fa,{writable:!0,value:$e(this)}),(0,n.Z)(this,Oa,{writable:!0,value:Qe(this,!0)}),(0,n.Z)(this,qa,{writable:!0,value:Je(this)}),(0,n.Z)(this,La,{writable:!0,value:Xe(this)}),(0,n.Z)(this,Ha,{writable:!0,value:et(this)}),(0,n.Z)(this,$a,{writable:!0,value:at(this,!1)}),(0,n.Z)(this,Va,{writable:!0,value:st(this)}),(0,n.Z)(this,Qa,{writable:!0,value:rt(this)}),(0,n.Z)(this,ja,{writable:!0,value:ot(this)}),(0,n.Z)(this,Ja,{writable:!0,value:dt(this)}),(0,n.Z)(this,Ga,{writable:!0,value:ut(this)}),(0,s.Z)(this,"_disabledChildrenKeys",[]),(0,n.Z)(this,Xa,{writable:!0,value:gt(this,"children")}),(0,n.Z)(this,Ya,{writable:!0,value:mt(this,!0)}),(0,n.Z)(this,ei,{writable:!0,value:Zt(this)}),(0,n.Z)(this,ti,{writable:!0,value:bt(this,"")}),(0,n.Z)(this,ai,{writable:!0,value:Ct(this)}),(0,n.Z)(this,ii,{writable:!0,value:St(this)}),(0,n.Z)(this,si,{writable:!0,value:_t(this)}),(0,n.Z)(this,ni,{writable:!0,value:Et(this)}),(0,n.Z)(this,ri,{writable:!0,value:Wt(this,{x:!0})}),(0,n.Z)(this,li,{writable:!0,value:Bt(this,"q")}),(0,n.Z)(this,oi,{writable:!0,value:It(this)}),(0,n.Z)(this,hi,{writable:!0,value:Ut(this)}),(0,n.Z)(this,di,{writable:!0,value:zt(this)}),(0,n.Z)(this,ci,{writable:!0,value:At(this,[])}),(0,n.Z)(this,ui,{writable:!0,value:Ot(this)}),(0,n.Z)(this,pi,{writable:!0,value:Lt(this)}),(0,n.Z)(this,gi,{writable:!0,value:$t(this,!0)}),(0,n.Z)(this,wi,{writable:!0,value:Qt(this)}),(0,n.Z)(this,mi,{writable:!0,value:Jt(this)}),(0,n.Z)(this,vi,{writable:!0,value:Xt(this)}),(0,n.Z)(this,Zi,{writable:!0,value:ea(this,!0)}),(0,n.Z)(this,fi,{writable:!0,value:aa(this,!0)}),(0,s.Z)(this,"_originalDataSource",[]),(0,s.Z)(this,"_dataSource",[]),(0,s.Z)(this,"_pureSource",void 0),(0,s.Z)(this,"_columns",void 0),(0,s.Z)(this,"_finalConfigProps",{}),(0,s.Z)(this,"_error",void 0),(0,n.Z)(this,bi,{writable:!0,value:void 0}),(0,s.Z)(this,"_selectUpdateEventName",""),(0,s.Z)(this,"_selectUpdateEventDetailKeys",[]),(0,s.Z)(this,"_selectUpdateEventDetailField",""),(0,s.Z)(this,"_selectUpdateEventDetailExtra",{}),(0,s.Z)(this,"_fields",{page:"page",pageSize:"pageSize",dataSource:"list",total:"total",ascend:"ascend",descend:"descend"}),(0,n.Z)(this,yi,{writable:!0,value:sa(this,[])}),(0,s.Z)(this,"_selected",!1),(0,s.Z)(this,"_selectedRow",void 0),(0,s.Z)(this,"_selectedRows",[]),(0,s.Z)(this,"_allChildren",[]),(0,s.Z)(this,"_isInSelect",!1),(0,s.Z)(this,"_getRowKey",(()=>{var e,t,a,i;return null!==(e=null!==(t=null!==(a=this.rowKey)&&void 0!==a?a:this._fields.rowKey)&&void 0!==t?t:null===(i=this.configProps)||void 0===i?void 0:i.rowKey)&&void 0!==e?e:"key"})),(0,s.Z)(this,"_findParentByChildKeyValue",((e,t,a,i)=>{var s;return a.some((a=>{if(a[t]===e)s=i;else{var n=a[this.childrenColumnName];n&&(s=this._findParentByChildKeyValue(e,t,n,a))}return!!s})),s})),(0,s.Z)(this,"_handleRowSelectChange",((e,t)=>{var a=this._getRowKey(),i=(0,w.keyBy)(t,a);if(this._selected){var s=[...e];if(this._allChildren.forEach((e=>{var t=e[a];s.push(t),i[t]=e})),this.autoSelectParentWhenAllChildrenSelected&&this._selectedRow){var n=new Set(e),r=this._findParentByChildKeyValue(this._selectedRow[a],a,this._dataSource);if(r&&r[this.childrenColumnName].every((e=>n.has(e[a])))){var l=r[a];s.push(l),i[l]=r}}this.selectedRowKeys=(0,w.uniq)(s)}else{var h;this.autoSelectParentWhenAllChildrenSelected&&this._selectedRow&&(h=this._findParentByChildKeyValue(this._selectedRow[a],a,this._dataSource)),this.selectedRowKeys=(0,w.pullAll)(e,(0,w.map)(this._allChildren.concat(h),a))}this._selectedRow=void 0;var d=(0,w.keyBy)(this.extraRows,a);this._selectedRows=this.selectedRowKeys.map((e=>i[e]||d[e]));var c=null,u=(0,w.isEmpty)(this._selectUpdateEventDetailField)?this._selectedRows:(0,w.map)(this._selectedRows,(e=>(0,w.get)(e,this._selectUpdateEventDetailField)));c=(0,w.isEmpty)(this._selectUpdateEventDetailKeys)||(0,w.isEmpty)(u)?u:(0,w.set)({},this._selectUpdateEventDetailKeys,u),(0,w.isEmpty)(c)||(c=(0,w.merge)(c,this._selectUpdateEventDetailExtra)),this._selectUpdateEventName?this.dispatchEvent(new CustomEvent(this._selectUpdateEventName,{detail:c})):(0,o.Z)(this,fa).emit(c),(0,o.Z)(this,ya).emit(e)})),(0,s.Z)(this,"_getSelectedRowsWithChildren",(e=>{var t=[];return!(0,w.isEmpty)(e[this.childrenColumnName])&&(0,w.isArray)(e[this.childrenColumnName])&&(0,w.forEach)(e[this.childrenColumnName],(e=>{t.push(e),t.push(...this._getSelectedRowsWithChildren(e))})),t})),(0,s.Z)(this,"_handleOnSelect",((e,t,a)=>{this._selected=t,this._selectedRow=e,this._isInSelect=!0;var i=this._getRowKey(),s=this.selectAllChildren?this._getSelectedRowsWithChildren(e):[];this._allChildren=s,this.autoSelectParentWhenAllChildrenSelected||(this._disabledChildrenKeys=t?(0,w.uniq)([...this._disabledChildrenKeys,...(0,w.map)(s,i)]):(0,w.pullAll)(this._disabledChildrenKeys,[...(0,w.map)(s,i)])),this.storeCheckedByUrl&&i&&this._updateUrlChecked([e[i]],t)})),(0,s.Z)(this,"_handleSelectAll",((e,t,a)=>{this._selected=e,this._isInSelect=!0;var i=this._getRowKey();if(this.selectAllChildren){var s=(0,w.map)(this._dataSource,i),n=a.filter((e=>s.includes(e[i]))),r=(0,w.flatten)((0,w.map)(n,(e=>(0,w.map)(this._getSelectedRowsWithChildren(e),(e=>e[i]))))),l=(0,w.flatten)((0,w.map)(n,(e=>(0,w.map)(this._getSelectedRowsWithChildren(e),(e=>e)))));this._allChildren=l,this.autoSelectParentWhenAllChildrenSelected||(this._disabledChildrenKeys=e?(0,w.uniq)(this._disabledChildrenKeys.concat(r)):this._disabledChildrenKeys.filter((e=>!r.includes(e))))}this.storeCheckedByUrl&&i&&this._updateUrlChecked((0,w.map)(a,i),e)})),(0,s.Z)(this,"_getCheckedFromUrl",(()=>{var e=(0,m.getHistory)(),t=new URLSearchParams(e.location.search).get("checked");return(0,w.isEmpty)(t)?[]:t.split(",")})),(0,s.Z)(this,"_updateUrlChecked",((e,t)=>{var a=(0,m.getHistory)(),i=this._getCheckedFromUrl();t?i=[...i,...e]:(0,w.pull)(i,...e),this.shouldUpdateUrlParams&&a.pushQuery({checked:i.join(",")},{notify:!1})})),(0,s.Z)(this,"_handleOnChange",((e,t,a)=>{var i=(0,m.getHistory)(),s=new URLSearchParams(i.location.search);if(!(0,w.isEmpty)(e))if(e.pageSize!==this.pageSize)e.current=1,s.set("page","1"),s.set("pageSize",(null==e?void 0:e.pageSize).toString()),(0,o.Z)(this,va).emit({[this._fields.pageSize]:e.pageSize,[this._fields.page]:1}),this.page=1,this.pageSize=e.pageSize;else if(e.current!==this.page){var n=e.current||1;s.set("page",n.toString()),(0,o.Z)(this,wa).emit({[this._fields.page]:n}),this.page=n}this.filters=t,(0,w.isEmpty)(t)||(0,w.forEach)(t,((e,t)=>{(0,w.isNil)(e)||0===e.length?s.delete(t):s.set(t,e)})),a.order&&(0,w.isNil)(a.order)&&(a.columnKey!==this.sort||this._fields[a.order]!==this.order)&&(a.columnKey&&a.order?(s.set("sort",a.columnKey),s.set("order",this._fields[a.order].toString()),this.sort=a.columnKey,this.order=this._fields[a.order]):(s.delete("sort"),s.delete("order"),this.sort=null,this.order=null),(0,o.Z)(this,xa).emit({sort:this.sort,order:this.order})),this.frontSearch?(this.shouldUpdateUrlParams&&i.push("?".concat(s),{notify:!1}),this.frontendSearch(e,t,a)):this.shouldUpdateUrlParams&&i.push("?".concat(s),{notify:!!this.shouldRenderWhenUrlParamsUpdate})})),(0,s.Z)(this,"renderSelectInfo",(()=>c().createElement("span",{style:{marginLeft:20}},c().createElement("span",null,"已选择",this.selectedRowKeys.length,"项"),c().createElement("a",{role:"button",style:{marginLeft:"10px"},onClick:()=>{this.selectedRowKeys=[],this._selectedRows=[],this._disabledChildrenKeys=[],this._allChildren=[],this._selectUpdateEventName?this.dispatchEvent(new CustomEvent(this._selectUpdateEventName,{detail:[]})):(0,o.Z)(this,fa).emit([])}},"清空")))),(0,s.Z)(this,"_handleOnExpand",((e,t)=>{if(this.expandedRowKeys){var a=this._getRowKey(),i=[(0,w.get)(t,a)],s=(0,w.get)(t,this.childrenColumnName);if(!(0,w.isEmpty)(s)){var n=(0,w.map)((0,w.filter)(s,(e=>(0,w.isEmpty)((0,w.get)(e,this.childrenColumnName)))),a);i.push(...n)}this.expandedRowKeys=e?[...this.expandedRowKeys,...i]:(0,w.pull)(this.expandedRowKeys,...i),this._render()}(0,o.Z)(this,ka).emit({expanded:e,record:t})})),(0,s.Z)(this,"_handleOnExpandedRowsChange",(e=>{(0,o.Z)(this,Ra).emit({expandedRows:e})})),(0,s.Z)(this,"_handleOnDrag",(e=>{(0,o.Z)(this,Ma).emit({data:e})})),(0,s.Z)(this,"_getAllRows",(()=>{var e=[];return x(this._dataSource,this.childrenColumnName,e),e})),(0,s.Z)(this,"_handleDefaultSelectAll",(()=>{this._isInSelect=!0;var e=this._getRowKey();return this._selectedRows=this._getAllRows(),this.selectedRowKeys=(0,w.map)(this._selectedRows,e),this.selectedRowKeys})),(0,s.Z)(this,"_initConfigProps",(()=>{var e,t,a,s={current:this.page,pageSize:this.pageSize,total:(0,o.Z)(this,bi),showSizeChanger:!0,pageSizeOptions:["10","20","50"],showTotal:e=>{var t;return c().createElement(c().Fragment,null,c().createElement("span",{className:"totalText"},"共 ",c().createElement("strong",{className:"total"},e)," 条"),((null===(t=this.configProps)||void 0===t?void 0:t.rowSelection)||this.rowSelection)&&this.showSelectInfo&&0!==this.selectedRowKeys.length&&this.renderSelectInfo())}},n=this._getRowKey();this.rowDisabledConfig&&(a=Array.isArray(this.rowDisabledConfig)?this.rowDisabledConfig:[this.rowDisabledConfig]);var r=(0,i.Z)((0,i.Z)({},n?{selectedRowKeys:this._isInSelect?this.selectedRowKeys:this.storeCheckedByUrl?this._getCheckedFromUrl():this.defaultSelectAll?this._handleDefaultSelectAll():this.selectedRowKeys,onSelect:this._handleOnSelect,onSelectAll:this._handleSelectAll,onChange:this._handleRowSelectChange,preserveSelectedRowKeys:!0}:{onChange:this._handleRowSelectChange,preserveSelectedRowKeys:!0}),{},{getCheckboxProps:e=>!(0,w.isEmpty)(this._disabledChildrenKeys)&&this._disabledChildrenKeys.includes((0,w.get)(e,n))?{disabled:!0}:a?{disabled:a.some((t=>{var{field:a,value:i,operator:s}=t,n=b[s];return null==n?void 0:n(i,(0,w.get)(e,a))}))}:{}});this.configProps?(this._finalConfigProps=(0,w.cloneDeep)(this.configProps),!1!==this.configProps.pagination&&(this._finalConfigProps.pagination=(0,i.Z)((0,i.Z)((0,i.Z)({},s),this.pagination),this.configProps.pagination),void 0!==this.configProps.pagination&&null!==this.configProps.pagination||!1!==this.pagination||(this._finalConfigProps.pagination=!1)),this.configProps.size||(this._finalConfigProps.size=this.size)):(this._finalConfigProps={},this._finalConfigProps.pagination=!1!==this.pagination&&s,this._finalConfigProps.size=this.size);var l,h,d=null!==(e=null===(t=this.configProps)||void 0===t?void 0:t.rowSelection)&&void 0!==e?e:this.rowSelection;d?this._finalConfigProps.rowSelection=!0===d?(0,i.Z)((0,i.Z)({},r),{},{type:null!==(l=this.type)&&void 0!==l?l:"checkbox"}):(0,i.Z)((0,i.Z)((0,i.Z)({},r),{},{type:null!==(h=this.type)&&void 0!==h?h:"checkbox"},d),r.selectedRowKeys?{selectedRowKeys:r.selectedRowKeys}:{}):this.type?this._finalConfigProps.rowSelection=(0,i.Z)((0,i.Z)({},r),{},{type:this.type}):this._finalConfigProps.rowSelection=!1,this._columns&&(this._columns=this._columns.map((e=>{if((0,w.isNil)(e.key)&&(e.key=e.dataIndex),e.sorter&&(e.sortOrder=this.sort===e.key&&!(0,w.isNil)(this.order)&&(this._fields.ascend===this.order?"ascend":"descend")),e.filters){var t,a,i=(0,m.getHistory)(),s=null!==(t=new URLSearchParams(i.location.search).get(e.key))&&void 0!==t?t:null===(a=(0,w.get)(this.filters,e.key))||void 0===a?void 0:a.join(",");(0,w.isNil)(s)||(0,w.isEmpty)(s)?(e.filtered=!1,e.filteredValue=[]):(e.filtered=!0,e.filteredValue=s.split(",").map((t=>{var a,i;return null!==(a=null===(i=(0,w.find)(e.filters,(e=>String(e.value)===t)))||void 0===i?void 0:i.value)&&void 0!==a?a:t})))}return e})))}))}set columns(e){this._columns=e,this._render()}get columns(){return this._columns}set dataSource(e){var t,a,i,s,n,r;this._isInSelect=!1,this._originalDataSource=e,this._dataSource=(0,w.cloneDeep)(this._fields.dataSource?(0,w.get)(e,this._fields.dataSource):e),this._pureSource=(0,w.cloneDeep)(this._dataSource),this.stripEmptyExpandableChildren&&S((null===(r=this.configProps)||void 0===r||null===(r=r.expandable)||void 0===r?void 0:r.childrenColumnName)||"children",this._dataSource),(0,l.Z)(this,bi,(0,w.get)(e,this._fields.total)),this.page=null!==(t=null!==(a=(0,w.get)(e,"page"))&&void 0!==a?a:this.page)&&void 0!==t?t:1,this.pageSize=null!==(i=null!==(s=null!==(n=(0,w.get)(e,"page_size"))&&void 0!==n?n:(0,w.get)(e,"pageSize"))&&void 0!==s?s:this.pageSize)&&void 0!==i?i:10,this._render()}get showCard(){return(0,o.Z)(this,Wa)}set showCard(e){(0,l.Z)(this,Wa,e)}get rowSelection(){return(0,o.Z)(this,Pa)}set rowSelection(e){(0,l.Z)(this,Pa,e)}get rowKey(){return(0,o.Z)(this,Ba)}set rowKey(e){(0,l.Z)(this,Ba,e)}get hiddenColumns(){return(0,o.Z)(this,Ka)}set hiddenColumns(e){(0,l.Z)(this,Ka,e)}get showSelectInfo(){return(0,o.Z)(this,Ia)}set showSelectInfo(e){(0,l.Z)(this,Ia,e)}get filters(){return(0,o.Z)(this,Na)}set filters(e){(0,l.Z)(this,Na,e)}get configProps(){return(0,o.Z)(this,Ua)}set configProps(e){(0,l.Z)(this,Ua,e)}get sort(){return(0,o.Z)(this,Da)}set sort(e){(0,l.Z)(this,Da,e)}get order(){return(0,o.Z)(this,za)}set order(e){(0,l.Z)(this,za,e)}get rowDisabledConfig(){return(0,o.Z)(this,Ta)}set rowDisabledConfig(e){(0,l.Z)(this,Ta,e)}get expandedRowBrick(){return(0,o.Z)(this,Aa)}set expandedRowBrick(e){(0,l.Z)(this,Aa,e)}get expandIcon(){return(0,o.Z)(this,Fa)}set expandIcon(e){(0,l.Z)(this,Fa,e)}get expandIconAsCell(){return(0,o.Z)(this,Oa)}set expandIconAsCell(e){(0,l.Z)(this,Oa,e)}get expandIconColumnIndex(){return(0,o.Z)(this,qa)}set expandIconColumnIndex(e){(0,l.Z)(this,qa,e)}get expandRowByClick(){return(0,o.Z)(this,La)}set expandRowByClick(e){(0,l.Z)(this,La,e)}get optimizedColumns(){return(0,o.Z)(this,Ha)}set optimizedColumns(e){(0,l.Z)(this,Ha,e)}get stripEmptyExpandableChildren(){return(0,o.Z)(this,$a)}set stripEmptyExpandableChildren(e){(0,l.Z)(this,$a,e)}get defaultExpandAllRows(){return(0,o.Z)(this,Va)}set defaultExpandAllRows(e){(0,l.Z)(this,Va,e)}get ellipsisInfo(){return(0,o.Z)(this,Qa)}set ellipsisInfo(e){(0,l.Z)(this,Qa,e)}get expandedRowKeys(){return(0,o.Z)(this,ja)}set expandedRowKeys(e){(0,l.Z)(this,ja,e)}get selectAllChildren(){return(0,o.Z)(this,Ja)}set selectAllChildren(e){(0,l.Z)(this,Ja,e)}get defaultSelectAll(){return(0,o.Z)(this,Ga)}set defaultSelectAll(e){(0,l.Z)(this,Ga,e)}get childrenColumnName(){return(0,o.Z)(this,Xa)}set childrenColumnName(e){(0,l.Z)(this,Xa,e)}get sortable(){return(0,o.Z)(this,Ya)}set sortable(e){(0,l.Z)(this,Ya,e)}set fields(e){this._fields=(0,i.Z)((0,i.Z)({},this._fields),e),this._render()}get frontSearch(){return(0,o.Z)(this,ei)}set frontSearch(e){(0,l.Z)(this,ei,e)}get frontSearchQuery(){return(0,o.Z)(this,ti)}set frontSearchQuery(e){(0,l.Z)(this,ti,e)}get exactSearch(){return(0,o.Z)(this,ai)}set exactSearch(e){(0,l.Z)(this,ai,e)}get frontSearchFilterKeys(){return(0,o.Z)(this,ii)}set frontSearchFilterKeys(e){(0,l.Z)(this,ii,e)}get page(){return(0,o.Z)(this,si)}set page(e){(0,l.Z)(this,si,e)}get pageSize(){return(0,o.Z)(this,ni)}set pageSize(e){(0,l.Z)(this,ni,e)}get scrollConfigs(){return(0,o.Z)(this,ri)}set scrollConfigs(e){(0,l.Z)(this,ri,e)}get qField(){return(0,o.Z)(this,li)}set qField(e){(0,l.Z)(this,li,e)}get tableDraggable(){return(0,o.Z)(this,oi)}set tableDraggable(e){(0,l.Z)(this,oi,e)}get zebraPattern(){return(0,o.Z)(this,hi)}set zebraPattern(e){(0,l.Z)(this,hi,e)}get storeCheckedByUrl(){return(0,o.Z)(this,di)}set storeCheckedByUrl(e){(0,l.Z)(this,di,e)}get extraRows(){return(0,o.Z)(this,ci)}set extraRows(e){(0,l.Z)(this,ci,e)}get autoSelectParentWhenAllChildrenSelected(){return(0,o.Z)(this,ui)}set autoSelectParentWhenAllChildrenSelected(e){(0,l.Z)(this,ui,e)}get thTransparent(){return(0,o.Z)(this,pi)}set thTransparent(e){(0,l.Z)(this,pi,e)}get showHeader(){return(0,o.Z)(this,gi)}set showHeader(e){(0,l.Z)(this,gi,e)}get pagination(){return(0,o.Z)(this,wi)}set pagination(e){(0,l.Z)(this,wi,e)}get size(){return(0,o.Z)(this,mi)}set size(e){(0,l.Z)(this,mi,e)}get type(){return(0,o.Z)(this,vi)}set type(e){(0,l.Z)(this,vi,e)}get shouldUpdateUrlParams(){return(0,o.Z)(this,Zi)}set shouldUpdateUrlParams(e){(0,l.Z)(this,Zi,e)}get shouldRenderWhenUrlParamsUpdate(){return(0,o.Z)(this,fi)}set shouldRenderWhenUrlParamsUpdate(e){(0,l.Z)(this,fi,e)}get processedDataSource(){return this._dataSource}get processConfigProps(){return this._finalConfigProps}get processedColumns(){return this.getModifyColumns()}get selectedRowKeys(){return(0,o.Z)(this,yi)}set selectedRowKeys(e){(0,l.Z)(this,yi,e)}filterSourceData(e){var t=this.exactSearch?e.detail.q.trim():e.detail.q.trim().toLowerCase();if(this.shouldUpdateUrlParams){var a=(0,m.getHistory)(),i=new URLSearchParams(a.location.search);i.set("page","1"),t?(i.set(this.qField,t),a.push("?".concat(i),{notify:!this.frontSearch})):(i.delete(this.qField),a.push("?".concat(i),{notify:!this.frontSearch})),this.page=1}this.frontSearchQuery=t}handleFrontendDataChange(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(this.shouldUpdateUrlParams){var a=(0,m.getHistory)(),i=new URLSearchParams(a.location.search);this.frontSearchQuery=i.get(this.qField)}var s=[];s=this.handleFrontendFilterSource(e,this.frontSearchQuery||"",t);var n=(0,w.isNil)(this.order)?null:this._fields.ascend===this.order?"ascend":"descend";return s=this.handleFrontendSorter(s,{columnKey:this.sort,order:n}),s=this.handleFrontendFilters(s),(0,l.Z)(this,bi,s.length),s}handleFrontendFilterSource(e,t,a,s){if(!t)return e;var n=[];return s||(s=this.frontSearchFilterKeys||a.map((e=>e.dataIndex))),e.forEach((e=>{var r,l=e[this.childrenColumnName];if(l){var o=this.handleFrontendFilterSource(l,t,a,s);if(o.length>0)return void n.push((0,i.Z)((0,i.Z)({},e),{},{[this.childrenColumnName]:o}))}(null===(r=s)||void 0===r?void 0:r.some((a=>{var i=(0,w.get)(e,a);return!(0,w.isNil)(i)&&(this.exactSearch?i===t:JSON.stringify(i).toLowerCase().includes(t))})))&&n.push(e)})),n}handleFrontendSorter(e,t){var a=e||[],{columnKey:i,order:s}=t;if(!i||!s)return e;var n=1;return"descend"===s?n=-1:"ascend"===s&&(n=1),void 0!==n&&(a.sort(((e,t)=>{var a=(0,w.get)(e,i),s=(0,w.get)(t,i);if((0,w.isNil)(a)){if(!(0,w.isNil)(s))return 1}else if((0,w.isNil)(s))return-1;return a==s?0:a>s?n:-n})),a.forEach((e=>{var a=e[this.childrenColumnName];a&&this.handleFrontendSorter(a,t)}))),a}handleFrontendFilters(e){var t=e||[],a=(0,w.map)(this.filters,((e,t)=>({key:t,value:e}))).filter((e=>!(0,w.isNil)(e.value)&&0!==e.value.length));return t.filter((e=>(0,w.every)(a,(t=>{var a,i;return null===(a=null===(i=t.value)||void 0===i?void 0:i.includes((0,w.get)(e,t.key)))||void 0===a||a}))))}frontendSearch(e,t,a){this.sort=(0,w.isNil)(a.order)?null:a.columnKey,this.order=(0,w.isNil)(a.order)?null:this._fields[a.order]}expandAll(){var e=[],t=this._getRowKey();this._dataSource&&C(this._dataSource,t,this.childrenColumnName,e),this.expandedRowKeys=e}getModifyColumns(){var e=this._columns;return this._columns&&this.hiddenColumns&&(e=this._columns.filter((e=>{var t,a;return!(null!==(t=this.hiddenColumns)&&void 0!==t&&t.includes(null!==(a=e.dataIndex)&&void 0!==a?a:e.key))}))),!1===this.sortable&&(e=(0,w.map)(e,(e=>(e.sorter=!1,e)))),e}render(){return this.frontSearch&&(this._dataSource=this.handleFrontendDataChange(this._pureSource,this._columns)),this._initConfigProps(),c().createElement(O,{shadowRoot:this.shadowRoot,dataSource:this._dataSource||[],columns:this.getModifyColumns(),configProps:this._finalConfigProps,error:this._error,onChange:this._handleOnChange,showCard:this.showCard,showHeader:this.showHeader,expandedRowBrick:this.expandedRowBrick,expandIconAsCell:this.expandIconAsCell,expandIconColumnIndex:this.expandIconColumnIndex,expandRowByClick:this.expandRowByClick,defaultExpandAllRows:this.defaultExpandAllRows,onExpand:this._handleOnExpand,onExpandedRowsChange:this._handleOnExpandedRowsChange,expandedRowKeys:this.expandedRowKeys,rowKey:this._getRowKey(),childrenColumnName:this.childrenColumnName,tableDraggable:this.tableDraggable||this.draggable,onDrag:this._handleOnDrag,zebraPattern:this.zebraPattern,expandIcon:this.expandIcon,scroll:this.scrollConfigs,optimizedColumns:this.optimizedColumns,ellipsisInfo:this.ellipsisInfo,thTransparent:this.thTransparent})}_test_only_getOriginalDataSource(){return this._originalDataSource}updateData(e){this._dataSource=e.detail,this._error=null,this._render()}updateError(e){this._error=e.detail,this._render()}set selectUpdateEventName(e){this._selectUpdateEventName=e}set selectUpdateEventDetailKeys(e){this._selectUpdateEventDetailKeys=e}set selectUpdateEventDetailField(e){this._selectUpdateEventDetailField=e}set selectUpdateEventDetailExtra(e){this._selectUpdateEventDetailExtra=e}}function xi(e){Q(this,e)}function Si(){return V(this)}function ki(e){X(this,e)}function _i(){return G(this)}function Ri(e){ae(this,e)}function Ei(){return te(this)}function Mi(e){re(this,e)}function Wi(){return ne(this)}function Pi(e){de(this,e)}function Bi(){return he(this)}function Ki(e){ge(this,e)}function Ii(){return pe(this)}function Ni(e){Ze(this,e)}function Ui(){return ve(this)}function Di(e){Ce(this,e)}function zi(){return ye(this)}oa=Ci,({e:[$,V,Q,J,G,X,ee,te,ae,se,ne,re,oe,he,de,ue,pe,ge,me,ve,Ze,be,ye,Ce,Se,_e,Ee,We,Be,Ie,Ue,ze,Ae,Oe,Le,$e,Qe,Je,Xe,et,at,st,rt,ot,dt,ut,gt,mt,Zt,bt,Ct,St,_t,Et,Wt,Bt,It,Ut,zt,At,Ot,Lt,$t,Qt,Jt,Xt,ea,aa,sa,la],c:[ha,q]}=(0,h.Z)(oa,[[H,1,"pageUpdate",e=>(0,o.Z)(e,ga),(e,t)=>(0,l.Z)(e,ga,t)],[j,1,"filterUpdate",e=>(0,o.Z)(e,ma),(e,t)=>(0,l.Z)(e,ma,t)],[Y,1,"selectUpdate",e=>(0,o.Z)(e,Za),(e,t)=>(0,l.Z)(e,Za,t)],[ie,1,"selectRowKeysUpdate",e=>(0,o.Z)(e,ba),(e,t)=>(0,l.Z)(e,ba,t)],[le,1,"sortUpdate",e=>(0,o.Z)(e,Ca),(e,t)=>(0,l.Z)(e,Ca,t)],[ce,1,"rowExpand",e=>(0,o.Z)(e,Sa),(e,t)=>(0,l.Z)(e,Sa,t)],[we,1,"expandRowsChange",e=>(0,o.Z)(e,_a),(e,t)=>(0,l.Z)(e,_a,t)],[fe,1,"rowDrag",e=>(0,o.Z)(e,Ea),(e,t)=>(0,l.Z)(e,Ea,t)],[xe,1,"showCard"],[ke,1,"rowSelection"],[Re,1,"rowKey"],[Me,1,"hiddenColumns"],[Pe,1,"showSelectInfo"],[Ke,1,"filters"],[Ne,1,"configProps"],[De,1,"sort"],[Te,1,"order"],[Fe,1,"rowDisabledConfig"],[qe,1,"expandedRowBrick"],[He,1,"expandIcon"],[Ve,1,"expandIconAsCell"],[je,1,"expandIconColumnIndex"],[Ge,1,"expandRowByClick"],[Ye,1,"optimizedColumns"],[tt,1,"stripEmptyExpandableChildren"],[it,1,"defaultExpandAllRows"],[nt,1,"ellipsisInfo"],[lt,1,"expandedRowKeys"],[ht,1,"selectAllChildren"],[ct,1,"defaultSelectAll"],[pt,1,"childrenColumnName"],[wt,1,"sortable"],[vt,1,"frontSearch"],[ft,1,"frontSearchQuery"],[yt,1,"exactSearch"],[xt,1,"frontSearchFilterKeys"],[kt,1,"page"],[Rt,1,"pageSize"],[Mt,1,"scrollConfigs"],[Pt,1,"qField"],[Kt,1,"tableDraggable"],[Nt,1,"zebraPattern"],[Dt,1,"storeCheckedByUrl"],[Tt,1,"extraRows"],[Ft,1,"autoSelectParentWhenAllChildrenSelected"],[qt,1,"thTransparent"],[Ht,1,"showHeader"],[Vt,1,"pagination"],[jt,1,"size"],[Gt,1,"type"],[Yt,1,"shouldUpdateUrlParams"],[ta,1,"shouldRenderWhenUrlParamsUpdate"],[ia,1,"selectedRowKeys"],[na,2,"filterSourceData"],[ra,2,"expandAll"]],[L],0,(e=>bi.has((0,r.Z)(e))))),q();var Ti,Ai,Fi,Oi,qi,Li,Hi,$i,Vi,Qi,ji,Ji,Gi,Xi,Yi,es,ts,as,is,ss,ns,rs,ls,os,hs,ds,cs,us,ps,gs,ws,ms,vs,Zs,fs,bs,ys,Cs,xs,Ss=a(8682),{defineElement:ks,property:_s,event:Rs}=(0,u.createDecorators)(),Es=(0,p.wrapBrick)("eo-icon");Ai=ks("eo-cascader",{alias:["advanced.general-cascader"]}),Fi=_s({attribute:!1}),qi=_s({attribute:!1}),Hi=_s({attribute:!1}),Vi=_s(),ji=_s({type:Boolean}),Gi=_s({type:Boolean}),Yi=_s({type:Boolean}),ts=_s({type:Boolean}),is=_s({attribute:!1}),ns=_s(),ls=_s(),hs=_s(),cs=_s({type:Number}),ps=_s({attribute:!1}),ws=_s({attribute:!1}),vs=Rs({type:"cascader.change"});var Ms=new WeakMap,Ws=new WeakMap,Ps=new WeakMap,Bs=new WeakMap,Ks=new WeakMap,Is=new WeakMap,Ns=new WeakMap,Us=new WeakMap,Ds=new WeakMap,zs=new WeakMap,Ts=new WeakMap,As=new WeakMap,Fs=new WeakMap,Os=new WeakMap,qs=new WeakMap,Ls=new WeakMap,Hs=new WeakMap,$s=new WeakMap;class Vs extends p.ReactNextElement{constructor(){super(...arguments),(0,n.Z)(this,Hs,{get:js,set:Qs}),(0,n.Z)(this,Ms,{writable:!0,value:(ys(this),Oi(this))}),(0,n.Z)(this,Ws,{writable:!0,value:Li(this,{label:"label",value:"value",children:"children"})}),(0,n.Z)(this,Ps,{writable:!0,value:$i(this)}),(0,n.Z)(this,Bs,{writable:!0,value:Qi(this)}),(0,n.Z)(this,Ks,{writable:!0,value:Ji(this)}),(0,n.Z)(this,Is,{writable:!0,value:Xi(this)}),(0,n.Z)(this,Ns,{writable:!0,value:es(this,!0)}),(0,n.Z)(this,Us,{writable:!0,value:as(this,!0)}),(0,n.Z)(this,Ds,{writable:!0,value:ss(this)}),(0,n.Z)(this,zs,{writable:!0,value:rs(this,"click")}),(0,n.Z)(this,Ts,{writable:!0,value:os(this,"bottomLeft")}),(0,n.Z)(this,As,{writable:!0,value:ds(this)}),(0,n.Z)(this,Fs,{writable:!0,value:us(this,50)}),(0,n.Z)(this,Os,{writable:!0,value:gs(this)}),(0,n.Z)(this,qs,{writable:!0,value:ms(this)}),(0,n.Z)(this,Ls,{writable:!0,value:Zs(this)}),(0,n.Z)(this,$s,{writable:!0,value:(e,t)=>{this.value=e,Promise.resolve().then((()=>{(0,o.Z)(this,Hs).emit({value:e,selectedOptions:t})}))}})}get options(){return(0,o.Z)(this,Ms)}set options(e){(0,l.Z)(this,Ms,e)}get fieldNames(){return(0,o.Z)(this,Ws)}set fieldNames(e){(0,l.Z)(this,Ws,e)}get value(){return(0,o.Z)(this,Ps)}set value(e){(0,l.Z)(this,Ps,e)}get placeholder(){return(0,o.Z)(this,Bs)}set placeholder(e){(0,l.Z)(this,Bs,e)}get multiple(){return(0,o.Z)(this,Ks)}set multiple(e){(0,l.Z)(this,Ks,e)}get disabled(){return(0,o.Z)(this,Is)}set disabled(e){(0,l.Z)(this,Is,e)}get allowClear(){return(0,o.Z)(this,Ns)}set allowClear(e){(0,l.Z)(this,Ns,e)}get showSearch(){return(0,o.Z)(this,Us)}set showSearch(e){(0,l.Z)(this,Us,e)}get suffixIcon(){return(0,o.Z)(this,Ds)}set suffixIcon(e){(0,l.Z)(this,Ds,e)}get expandTrigger(){return(0,o.Z)(this,zs)}set expandTrigger(e){(0,l.Z)(this,zs,e)}get popupPlacement(){return(0,o.Z)(this,Ts)}set popupPlacement(e){(0,l.Z)(this,Ts,e)}get size(){return(0,o.Z)(this,As)}set size(e){(0,l.Z)(this,As,e)}get limit(){return(0,o.Z)(this,Fs)}set limit(e){(0,l.Z)(this,Fs,e)}get maxTagCount(){return(0,o.Z)(this,Os)}set maxTagCount(e){(0,l.Z)(this,Os,e)}get cascaderStyle(){return(0,o.Z)(this,qs)}set cascaderStyle(e){(0,l.Z)(this,qs,e)}render(){return c().createElement(Js,{shadowRoot:this.shadowRoot,options:this.options,fieldNames:this.fieldNames,value:this.value,multiple:this.multiple,placeholder:this.placeholder,disabled:this.disabled,allowClear:this.allowClear,showSearch:this.showSearch,expandTrigger:this.expandTrigger,suffixIcon:this.suffixIcon,size:this.size,limit:this.limit,popupPlacement:this.popupPlacement,maxTagCount:this.maxTagCount,cascaderStyle:this.cascaderStyle,onChange:(0,o.Z)(this,$s)})}}function Qs(e){bs(this,e)}function js(){return fs(this)}function Js(e){var{shadowRoot:t,options:a,fieldNames:i,value:s,placeholder:n,disabled:r,multiple:l,allowClear:o,showSearch:h,expandTrigger:u,size:p,limit:g,popupPlacement:w,cascaderStyle:m,suffixIcon:v,maxTagCount:Z,onChange:f}=e,b=(0,d.useMemo)((()=>(0,I.Df)()),[]);return c().createElement(I.V9,{container:t,cache:b},c().createElement(Ss.Z,{getPopupContainer:e=>e.parentElement,allowClear:o,disabled:r,multiple:l,expandTrigger:u,fieldNames:i,placeholder:n,size:p,showSearch:h&&{limit:g,filter:(e,t)=>{for(var a,s=(null==i?void 0:i.label)||"label",n=e.split(" ").filter((e=>e)).map((e=>e.toLocaleLowerCase())),r=function(e){if(!t.some((t=>t[s].toLowerCase().includes(n[e]))))return{v:!1}},l=0;l<n.length;l++)if(a=r(l))return a.v;return!0}},placement:w,style:m,suffixIcon:v&&c().createElement(Es,v),maxTagCount:Z,value:s,options:a,onChange:(e,t)=>null==f?void 0:f(e,t)}))}Cs=Vs,({e:[Oi,Li,$i,Qi,Ji,Xi,es,as,ss,rs,os,ds,us,gs,ms,Zs,fs,bs,ys],c:[xs,Ti]}=(0,h.Z)(Cs,[[Fi,1,"options"],[qi,1,"fieldNames"],[Hi,1,"value"],[Vi,1,"placeholder"],[ji,1,"multiple"],[Gi,1,"disabled"],[Yi,1,"allowClear"],[ts,1,"showSearch"],[is,1,"suffixIcon"],[ns,1,"expandTrigger"],[ls,1,"popupPlacement"],[hs,1,"size"],[cs,1,"limit"],[ps,1,"maxTagCount"],[ws,1,"cascaderStyle"],[vs,1,"changeEvent",e=>(0,o.Z)(e,Ls),(e,t)=>(0,l.Z)(e,Ls,t)]],[Ai],0,(e=>$s.has((0,r.Z)(e))))),Ti();var Gs,Xs,Ys,en,tn,an,sn,nn,rn,ln,on,hn,dn,cn,un,pn,gn,wn,mn=a(750),vn=a(8298),Zn=a(1876),fn=a(7088),bn=a(2068),yn=function(e){return e.TOTAL="TOTAL",e}({}),Cn="bricks/advanced/eo-next-table",xn={showSizeChanger:!0,showTotal:!0};function Sn(e){var{shadowRoot:t,columns:a,dataSource:s,pagination:n,onPageChange:r,onPageSizeChange:l}=e,{t:o}=(0,fn.useTranslation)(Cn),h=(0,d.useMemo)((()=>(0,I.Df)()),[]),u=(0,K.useCurrentTheme)(),p=(0,d.useMemo)((()=>null==a?void 0:a.map((e=>(0,i.Z)((0,i.Z)({},e),{},{render(t,a,i){if(e.useBrick){var s={cellData:t,rowData:a,columnIndex:i};return c().createElement(K.ReactUseMultipleBricks,{useBrick:e.useBrick,data:s})}return c().createElement(c().Fragment,null,t)},title(t){var a;if(null!==(a=e.headerBrick)&&void 0!==a&&a.useBrick){var i={title:e.title};return c().createElement(K.ReactUseMultipleBricks,{useBrick:e.headerBrick.useBrick,data:i})}return c().createElement(c().Fragment,null,e.title)}})))),[a]),g=(0,d.useMemo)((()=>{var e,t;if(!1===n)return!1;var a=(0,i.Z)((0,i.Z)({},xn),n);return(0,i.Z)((0,i.Z)({},a),{},{total:null==s?void 0:s.total,defaultCurrent:null!==(e=null==s?void 0:s.page)&&void 0!==e?e:1,defaultPageSize:null!==(t=null==s?void 0:s.pageSize)&&void 0!==t?t:20,showTotal:a.showTotal?e=>c().createElement("span",{className:"pagination-total-text"},c().createElement(bn.Trans,{i18nKey:o(yn.TOTAL),values:{total:e},components:{el:c().createElement("strong",{className:"pagination-total-number"})}})):()=>null,onChange:(e,t)=>{null==r||r({page:e,pageSize:t})},onShowSizeChange:(e,t)=>{null==l||l({page:e,pageSize:t})}})}),[s,n,r,l]);return c().createElement(vn.ZP,{theme:{algorithm:"dark-v2"===u?Zn.default.darkAlgorithm:Zn.default.defaultAlgorithm}},c().createElement(I.V9,{container:t,cache:h},c().createElement(f.Z,{columns:p,dataSource:null==s?void 0:s.list,pagination:g})))}(0,fn.initializeReactI18n)(Cn,{en:{TOTAL:"Total <el>{{ total }}</el> Items"},zh:{TOTAL:"共 <el>{{ total }}</el> 条"}});var kn,{defineElement:_n,property:Rn,event:En}=(0,u.createDecorators)();Xs=_n("eo-next-table",{styleTexts:[mn.Z]}),Ys=Rn({attribute:!1}),tn=Rn({attribute:!1}),sn=Rn({attribute:!1}),rn=En({type:"page.change"}),dn=En({type:"page.size.change"});var Mn=new WeakMap,Wn=new WeakMap,Pn=new WeakMap,Bn=new WeakMap,Kn=new WeakMap,In=new WeakMap,Nn=new WeakMap,Un=new WeakMap,Dn=new WeakMap;class zn extends p.ReactNextElement{constructor(){super(...arguments),(0,n.Z)(this,Un,{get:On,set:Fn}),(0,n.Z)(this,Kn,{get:An,set:Tn}),(0,n.Z)(this,Mn,{writable:!0,value:(gn(this),en(this))}),(0,n.Z)(this,Wn,{writable:!0,value:an(this)}),(0,n.Z)(this,Pn,{writable:!0,value:nn(this)}),(0,n.Z)(this,Bn,{writable:!0,value:ln(this)}),(0,n.Z)(this,In,{writable:!0,value:e=>{(0,o.Z)(this,Kn).emit(e)}}),(0,n.Z)(this,Nn,{writable:!0,value:cn(this)}),(0,n.Z)(this,Dn,{writable:!0,value:e=>{(0,o.Z)(this,Un).emit(e)}})}get columns(){return(0,o.Z)(this,Mn)}set columns(e){(0,l.Z)(this,Mn,e)}get dataSource(){return(0,o.Z)(this,Wn)}set dataSource(e){(0,l.Z)(this,Wn,e)}get pagination(){return(0,o.Z)(this,Pn)}set pagination(e){(0,l.Z)(this,Pn,e)}render(){return c().createElement(Sn,{shadowRoot:this.shadowRoot,columns:this.columns,dataSource:this.dataSource,pagination:this.pagination,onPageChange:(0,o.Z)(this,In),onPageSizeChange:(0,o.Z)(this,Dn)})}}function Tn(e){hn(this,e)}function An(){return on(this)}function Fn(e){pn(this,e)}function On(){return un(this)}wn=zn,({e:[en,an,nn,ln,on,hn,cn,un,pn,gn],c:[kn,Gs]}=(0,h.Z)(wn,[[Ys,1,"columns"],[tn,1,"dataSource"],[sn,1,"pagination"],[rn,1,"pageChangeEvent",e=>(0,o.Z)(e,Bn),(e,t)=>(0,l.Z)(e,Bn,t)],[dn,1,"pageSizeChangeEvent",e=>(0,o.Z)(e,Nn),(e,t)=>(0,l.Z)(e,Nn,t)]],[Xs],0,(e=>Dn.has((0,r.Z)(e))))),Gs()},750:(e,t,a)=>{a.d(t,{Z:()=>l});var i=a(9601),s=a.n(i),n=a(2609),r=a.n(n)()(s());r.push([e.id,":host{display:block}:host([hidden]){display:none}.pagination-total-text{color:var(--antd-pagination-total-text)}.pagination-total-number{font-weight:var(--font-weight-400);color:var(--antd-pagination-total-strong-text)}",""]);const l=r.toString()},2869:(e,t,a)=>{a.d(t,{Z:()=>l});var i=a(9601),s=a.n(i),n=a(2609),r=a.n(n)()(s());r.push([e.id,".brickTableOddRow{background-color:var(--color-fill-bg-base-4)}.ant-table-small .ant-table-body{margin:0}.ant-table-small .ant-table-thead{background:var(--antd-table-header-bg)}.ant-table-small .ant-table-row{line-height:26px}.ant-table-tbody > tr.invalidRow > td{background-color:var(--color-error-bg)}.ant-table-tbody > tr.invalidRow:hover > td{background-color:var(--color-error-bg)}.ant-table-tbody > tr.disabledRow > td{background-color:var(--theme-gray-border-color)}.ant-table-tbody > .ant-table-row-selected td{background:var(--antd-table-cell-fixed-body-bg)!important}td.alignTop{vertical-align:top}td.alignBottom{vertical-align:bottom}.expandIconCellHidden .ant-table-row-expand-icon-cell,\n.expandIconCellHidden .ant-table-expand-icon-col{width:1px;min-width:auto}.expandIconCellHidden .ant-table-row-expand-icon-cell > *,\n.expandIconCellHidden .ant-table-expand-icon-col > *{display:none}.expandIconSpan{cursor:pointer;margin-right:9px;color:var(--antd-table-row-expand-icon-color);font-size:11px}.expandIconSpan .anticon{background:var(--antd-table-row-expand-icon-action-bg);border-radius:2px;padding:3px}.tableThTransparent thead.ant-table-thead > tr > th{background:var(--antd-table-header-bg)}.zebraPatternTable .ant-table-tbody tr td{border-bottom:0}.ellipsis{max-width:240px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.totalText{color:var(--antd-pagination-total-text)}.total{font-weight:normal;color:var(--antd-pagination-total-strong-text)}.ant-table-wrapper .ant-table-thead > tr > th{padding:11px 16px;font-size:12px;line-height:20px;border-bottom:0;font-weight:500;color:var(--antd-table-header-color)}",""]);const l=r.toString()}}]);
2
- //# sourceMappingURL=4553.82506318.js.map